@maptiler/geocoding-control 1.3.2 → 1.4.0

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 (204) hide show
  1. package/README.md +3 -4
  2. package/icons/airport.svg +6 -0
  3. package/icons/animal_shelter.svg +4 -0
  4. package/icons/art_gallery.svg +4 -0
  5. package/icons/atm.svg +5 -1
  6. package/icons/barrier.svg +4 -0
  7. package/icons/baseball.svg +4 -0
  8. package/icons/basketball.svg +4 -0
  9. package/icons/bbq.svg +4 -1
  10. package/icons/beach.svg +4 -0
  11. package/icons/beer.svg +4 -1
  12. package/icons/bench.svg +4 -1
  13. package/icons/bicycle.svg +4 -1
  14. package/icons/bicycle_parking.svg +5 -1
  15. package/icons/bicycle_rental.svg +5 -1
  16. package/icons/billiards.svg +4 -0
  17. package/icons/board.svg +4 -1
  18. package/icons/bollard.svg +4 -0
  19. package/icons/bowling.svg +4 -1
  20. package/icons/building.svg +4 -0
  21. package/icons/bulldozer.svg +4 -0
  22. package/icons/bus_guided.svg +4 -0
  23. package/icons/bus_trolley.svg +4 -0
  24. package/icons/butcher.svg +4 -1
  25. package/icons/camper_trailer.svg +4 -0
  26. package/icons/campfire.svg +4 -0
  27. package/icons/caution.svg +4 -0
  28. package/icons/cemetery.svg +3 -11
  29. package/icons/charging_station.svg +4 -1
  30. package/icons/christian.svg +5 -0
  31. package/icons/circle-dot.svg +4 -0
  32. package/icons/circle-stroke.svg +4 -0
  33. package/icons/circle.svg +4 -0
  34. package/icons/city.svg +4 -0
  35. package/icons/communications_tower.svg +4 -1
  36. package/icons/confectionery.svg +4 -1
  37. package/icons/construction.svg +4 -0
  38. package/icons/cricket.svg +4 -0
  39. package/icons/cross.svg +4 -1
  40. package/icons/cycle_barrier.svg +4 -0
  41. package/icons/dam.svg +4 -0
  42. package/icons/danger.svg +4 -0
  43. package/icons/diamond.svg +4 -0
  44. package/icons/diamond_stroked.svg +4 -0
  45. package/icons/dot.svg +4 -0
  46. package/icons/drinking_water.svg +4 -1
  47. package/icons/emergency_phone.svg +4 -1
  48. package/icons/entrance.svg +4 -0
  49. package/icons/farm.svg +3 -8
  50. package/icons/fence.svg +4 -0
  51. package/icons/florist.svg +4 -1
  52. package/icons/furniture.svg +4 -1
  53. package/icons/gaming.svg +4 -0
  54. package/icons/garden.svg +4 -0
  55. package/icons/garden_centre.svg +4 -1
  56. package/icons/gate.svg +4 -1
  57. package/icons/globe.svg +4 -0
  58. package/icons/golf_green.svg +4 -0
  59. package/icons/gondola.svg +4 -0
  60. package/icons/guidepost.svg +4 -1
  61. package/icons/hardware.svg +3 -3
  62. package/icons/heart.svg +4 -0
  63. package/icons/heliport.svg +4 -0
  64. package/icons/highway_rest_area.svg +4 -0
  65. package/icons/home.svg +4 -0
  66. package/icons/hot_spring.svg +4 -1
  67. package/icons/hut.svg +4 -0
  68. package/icons/industry.svg +4 -0
  69. package/icons/karaoke.svg +4 -0
  70. package/icons/lift_gate.svg +4 -0
  71. package/icons/light_rail.svg +4 -0
  72. package/icons/lighthouse.svg +4 -1
  73. package/icons/marker.svg +4 -0
  74. package/icons/marker_stroked.svg +4 -0
  75. package/icons/monorail.svg +4 -0
  76. package/icons/motorcycle.svg +4 -1
  77. package/icons/motorcycle_parking.svg +4 -1
  78. package/icons/motorcycle_rental.svg +4 -0
  79. package/icons/motorcycle_repair.svg +4 -0
  80. package/icons/natural.svg +4 -0
  81. package/icons/noodle.svg +4 -0
  82. package/icons/obelisk.svg +4 -1
  83. package/icons/observation_tower.svg +4 -1
  84. package/icons/oneway.svg +4 -0
  85. package/icons/optician.svg +4 -1
  86. package/icons/park.svg +4 -1
  87. package/icons/parking_paid.svg +4 -0
  88. package/icons/pin.svg +4 -0
  89. package/icons/pipe.svg +4 -0
  90. package/icons/pizza.svg +4 -0
  91. package/icons/place_of_worship.svg +4 -1
  92. package/icons/playground.svg +3 -3
  93. package/icons/racetrack.svg +4 -0
  94. package/icons/radiation.svg +4 -0
  95. package/icons/railway.svg +4 -0
  96. package/icons/ranger_station.svg +4 -0
  97. package/icons/recycling.svg +4 -1
  98. package/icons/road_accident.svg +4 -0
  99. package/icons/roadblock.svg +4 -0
  100. package/icons/rocket.svg +4 -0
  101. package/icons/school_bus.svg +4 -0
  102. package/icons/sculpture.svg +4 -0
  103. package/icons/seafood.svg +4 -1
  104. package/icons/shelter.svg +4 -1
  105. package/icons/shoes.svg +4 -1
  106. package/icons/sikh.svg +4 -0
  107. package/icons/snow.svg +4 -0
  108. package/icons/soccer.svg +4 -1
  109. package/icons/spring.svg +4 -1
  110. package/icons/square.svg +4 -0
  111. package/icons/square_stroked.svg +4 -0
  112. package/icons/star.svg +4 -0
  113. package/icons/star_stroked.svg +4 -0
  114. package/icons/statue.svg +4 -1
  115. package/icons/subway.svg +4 -0
  116. package/icons/sushi.svg +4 -0
  117. package/icons/swimming.svg +5 -0
  118. package/icons/swimming_pool.svg +8 -0
  119. package/icons/tako.svg +4 -0
  120. package/icons/taxi.svg +4 -1
  121. package/icons/teahouse.svg +4 -0
  122. package/icons/terminal.svg +4 -1
  123. package/icons/theme_park.svg +4 -0
  124. package/icons/town.svg +4 -0
  125. package/icons/town_hall.svg +4 -1
  126. package/icons/townhall.svg +4 -1
  127. package/icons/tram_stop.svg +4 -0
  128. package/icons/transit.svg +4 -0
  129. package/icons/triangle.svg +4 -0
  130. package/icons/triangle_stroked.svg +4 -0
  131. package/icons/truck.svg +4 -0
  132. package/icons/tunnel.svg +4 -0
  133. package/icons/veterinary.svg +4 -1
  134. package/icons/viewpoint.svg +4 -1
  135. package/icons/village.svg +4 -0
  136. package/icons/volleyball.svg +4 -0
  137. package/icons/warehouse.svg +4 -0
  138. package/icons/water.svg +3 -5
  139. package/icons/water_park.svg +6 -1
  140. package/icons/water_tower.svg +4 -1
  141. package/icons/watermill.svg +4 -0
  142. package/icons/wetland.svg +4 -0
  143. package/icons/wine.svg +4 -0
  144. package/leaflet-controller.d.ts +2 -2
  145. package/leaflet-controller.js +1828 -12736
  146. package/leaflet-controller.js.map +1 -1
  147. package/leaflet-controller.umd.js +13 -22
  148. package/leaflet-controller.umd.js.map +1 -1
  149. package/leaflet.js +3052 -13916
  150. package/leaflet.js.map +1 -1
  151. package/leaflet.umd.js +3 -12
  152. package/leaflet.umd.js.map +1 -1
  153. package/maplibregl-controller.d.ts +2 -2
  154. package/maplibregl-controller.js +1767 -12761
  155. package/maplibregl-controller.js.map +1 -1
  156. package/maplibregl-controller.umd.js +13 -22
  157. package/maplibregl-controller.umd.js.map +1 -1
  158. package/maplibregl.js +2950 -13900
  159. package/maplibregl.js.map +1 -1
  160. package/maplibregl.umd.js +3 -12
  161. package/maplibregl.umd.js.map +1 -1
  162. package/maptilersdk.js +2958 -13908
  163. package/maptilersdk.js.map +1 -1
  164. package/maptilersdk.umd.js +3 -12
  165. package/maptilersdk.umd.js.map +1 -1
  166. package/mask.d.ts +1 -1
  167. package/openlayers-controller.js +1177 -12154
  168. package/openlayers-controller.js.map +1 -1
  169. package/openlayers-controller.umd.js +13 -22
  170. package/openlayers-controller.umd.js.map +1 -1
  171. package/openlayers.js +2667 -13607
  172. package/openlayers.js.map +1 -1
  173. package/openlayers.umd.js +3 -12
  174. package/openlayers.umd.js.map +1 -1
  175. package/package.json +31 -29
  176. package/react.js +996 -955
  177. package/react.js.map +1 -1
  178. package/react.umd.js +1 -1
  179. package/react.umd.js.map +1 -1
  180. package/style.css +1 -1
  181. package/svelte/FeatureItem.svelte +7 -5
  182. package/svelte/GeocodingControl.svelte +72 -14
  183. package/svelte/GeocodingControl.svelte.d.ts +4 -2
  184. package/svelte/geoUtils.js +7 -1
  185. package/svelte/leaflet-controller.d.ts +2 -2
  186. package/svelte/leaflet-controller.js +48 -2
  187. package/svelte/maplibregl-controller.d.ts +2 -2
  188. package/svelte/maplibregl-controller.js +5 -2
  189. package/svelte/mask.d.ts +1 -1
  190. package/svelte/mask.js +32 -29
  191. package/svelte/openlayers-controller.js +13 -14
  192. package/svelte/types.d.ts +15 -9
  193. package/types.d.ts +15 -9
  194. package/vanilla.js +1016 -975
  195. package/vanilla.js.map +1 -1
  196. package/vanilla.umd.js +1 -1
  197. package/vanilla.umd.js.map +1 -1
  198. package/icons/beach_resort.svg +0 -1
  199. package/icons/drinking-water.svg +0 -1
  200. package/icons/emergency-phone.svg +0 -1
  201. package/icons/rental_bicycle.svg +0 -1
  202. package/icons/rental_car.svg +0 -1
  203. /package/icons/{camp_site.svg → campsite.svg} +0 -0
  204. /package/icons/{toll_booth.svg → toll.svg} +0 -0
package/openlayers.umd.js CHANGED
@@ -1,13 +1,4 @@
1
- (function(se,be){typeof exports=="object"&&typeof module<"u"?be(exports,require("ol/control"),require("ol/events/Event"),require("ol"),require("ol/geom"),require("ol/layer/Vector"),require("ol/proj"),require("ol/source/Vector"),require("ol/style/Fill"),require("ol/style/Icon"),require("ol/style/Stroke"),require("ol/style/Style"),require("ol/style/Text")):typeof define=="function"&&define.amd?define(["exports","ol/control","ol/events/Event","ol","ol/geom","ol/layer/Vector","ol/proj","ol/source/Vector","ol/style/Fill","ol/style/Icon","ol/style/Stroke","ol/style/Style","ol/style/Text"],be):(se=typeof globalThis<"u"?globalThis:se||self,be(se.openlayersMaptilerGeocoder={},se.ol.control,se.ol.events.Event,se.ol,se.ol.geom,se.ol.layer.Vector,se.ol.proj,se.ol.source.Vector,se.ol.style.Fill,se.ol.style.Icon,se.ol.style.Stroke,se.ol.style.Style,se.ol.style.Text))})(this,function(se,be,Oe,vt,dt,Jf,an,$f,io,eh,so,th,nh){"use strict";var M_=Object.defineProperty;var Qf=se=>{throw TypeError(se)};var P_=(se,be,Oe)=>be in se?M_(se,be,{enumerable:!0,configurable:!0,writable:!0,value:Oe}):se[be]=Oe;var Lt=(se,be,Oe)=>P_(se,typeof be!="symbol"?be+"":be,Oe),Kf=(se,be,Oe)=>be.has(se)||Qf("Cannot "+Oe);var Dt=(se,be,Oe)=>(Kf(se,be,"read from private field"),Oe?Oe.call(se):be.get(se)),ro=(se,be,Oe)=>be.has(se)?Qf("Cannot add the same private member more than once"):be instanceof WeakSet?be.add(se):be.set(se,Oe),us=(se,be,Oe,vt)=>(Kf(se,be,"write to private field"),vt?vt.call(se,Oe):be.set(se,Oe),Oe);var Et,On;function Pe(){}function rh(a,r){for(const i in r)a[i]=r[i];return a}function ao(a){return a()}function oo(){return Object.create(null)}function Vt(a){a.forEach(ao)}function uo(a){return typeof a=="function"}function xn(a,r){return a!=a?r==r:a!==r||a&&typeof a=="object"||typeof a=="function"}let ni;function Ze(a,r){return a===r?!0:(ni||(ni=document.createElement("a")),ni.href=r,a===ni.href)}function ih(a){return Object.keys(a).length===0}function sh(a,r,i,u){if(a){const l=lo(a,r,i,u);return a[0](l)}}function lo(a,r,i,u){return a[1]&&u?rh(i.ctx.slice(),a[1](u(r))):i.ctx}function ah(a,r,i,u){if(a[2]&&u){const l=a[2](u(i));if(r.dirty===void 0)return l;if(typeof l=="object"){const f=[],v=Math.max(r.dirty.length,l.length);for(let y=0;y<v;y+=1)f[y]=r.dirty[y]|l[y];return f}return r.dirty|l}return r.dirty}function oh(a,r,i,u,l,f){if(l){const v=lo(r,i,u,f);a.p(v,l)}}function uh(a){if(a.ctx.length>32){const r=[],i=a.ctx.length/32;for(let u=0;u<i;u++)r[u]=-1;return r}return-1}function co(a){return a??""}function de(a,r){a.appendChild(r)}function Ae(a,r,i){a.insertBefore(r,i||null)}function Re(a){a.parentNode&&a.parentNode.removeChild(a)}function xe(a){return document.createElement(a)}function Ht(a){return document.createElementNS("http://www.w3.org/2000/svg",a)}function on(a){return document.createTextNode(a)}function ut(){return on(" ")}function lh(){return on("")}function $e(a,r,i,u){return a.addEventListener(r,i,u),()=>a.removeEventListener(r,i,u)}function ch(a){return function(r){return r.preventDefault(),a.call(this,r)}}function Y(a,r,i){i==null?a.removeAttribute(r):a.getAttribute(r)!==i&&a.setAttribute(r,i)}function fh(a){return Array.from(a.childNodes)}function kr(a,r){r=""+r,a.data!==r&&(a.data=r)}function fo(a,r){a.value=r??""}function un(a,r,i){a.classList.toggle(r,!!i)}function hh(a,r,{bubbles:i=!1,cancelable:u=!1}={}){return new CustomEvent(a,{detail:r,bubbles:i,cancelable:u})}let xr;function Sr(a){xr=a}function ho(){if(!xr)throw new Error("Function called outside component initialization");return xr}function gh(a){ho().$$.on_destroy.push(a)}function yh(){const a=ho();return(r,i,{cancelable:u=!1}={})=>{const l=a.$$.callbacks[r];if(l){const f=hh(r,i,{cancelable:u});return l.slice().forEach(v=>{v.call(a,f)}),!f.defaultPrevented}return!0}}function go(a,r){const i=a.$$.callbacks[r.type];i&&i.slice().forEach(u=>u.call(this,r))}const zn=[],ls=[];let Un=[];const yo=[],vh=Promise.resolve();let cs=!1;function dh(){cs||(cs=!0,vh.then(vo))}function fs(a){Un.push(a)}const hs=new Set;let Yn=0;function vo(){if(Yn!==0)return;const a=xr;do{try{for(;Yn<zn.length;){const r=zn[Yn];Yn++,Sr(r),mh(r.$$)}}catch(r){throw zn.length=0,Yn=0,r}for(Sr(null),zn.length=0,Yn=0;ls.length;)ls.pop()();for(let r=0;r<Un.length;r+=1){const i=Un[r];hs.has(i)||(hs.add(i),i())}Un.length=0}while(zn.length);for(;yo.length;)yo.pop()();cs=!1,hs.clear(),Sr(a)}function mh(a){if(a.fragment!==null){a.update(),Vt(a.before_update);const r=a.dirty;a.dirty=[-1],a.fragment&&a.fragment.p(a.ctx,r),a.after_update.forEach(fs)}}function ph(a){const r=[],i=[];Un.forEach(u=>a.indexOf(u)===-1?r.push(u):i.push(u)),i.forEach(u=>u()),Un=r}const ri=new Set;let Sn;function ii(){Sn={r:0,c:[],p:Sn}}function si(){Sn.r||Vt(Sn.c),Sn=Sn.p}function qe(a,r){a&&a.i&&(ri.delete(a),a.i(r))}function We(a,r,i,u){if(a&&a.o){if(ri.has(a))return;ri.add(a),Sn.c.push(()=>{ri.delete(a),u&&(i&&a.d(1),u())}),a.o(r)}else u&&u()}function mo(a){return(a==null?void 0:a.length)!==void 0?a:Array.from(a)}function _h(a,r){We(a,1,1,()=>{r.delete(a.key)})}function Eh(a,r,i,u,l,f,v,y,m,_,k,p){let x=a.length,S=f.length,b=x;const L={};for(;b--;)L[a[b].key]=b;const T=[],O=new Map,P=new Map,R=[];for(b=S;b--;){const q=p(l,f,b),U=i(q);let A=v.get(U);A?R.push(()=>A.p(q,r)):(A=_(U,q),A.c()),O.set(U,T[b]=A),U in L&&P.set(U,Math.abs(b-L[U]))}const G=new Set,M=new Set;function z(q){qe(q,1),q.m(y,k),v.set(q.key,q),k=q.first,S--}for(;x&&S;){const q=T[S-1],U=a[x-1],A=q.key,H=U.key;q===U?(k=q.first,x--,S--):O.has(H)?!v.has(A)||G.has(A)?z(q):M.has(H)?x--:P.get(A)>P.get(H)?(M.add(A),z(q)):(G.add(H),x--):(m(U,v),x--)}for(;x--;){const q=a[x];O.has(q.key)||m(q,v)}for(;S;)z(T[S-1]);return Vt(R),T}function ln(a){a&&a.c()}function Zt(a,r,i){const{fragment:u,after_update:l}=a.$$;u&&u.m(r,i),fs(()=>{const f=a.$$.on_mount.map(ao).filter(uo);a.$$.on_destroy?a.$$.on_destroy.push(...f):Vt(f),a.$$.on_mount=[]}),l.forEach(fs)}function Qt(a,r){const i=a.$$;i.fragment!==null&&(ph(i.after_update),Vt(i.on_destroy),i.fragment&&i.fragment.d(r),i.on_destroy=i.fragment=null,i.ctx=[])}function kh(a,r){a.$$.dirty[0]===-1&&(zn.push(a),dh(),a.$$.dirty.fill(0)),a.$$.dirty[r/31|0]|=1<<r%31}function bn(a,r,i,u,l,f,v=null,y=[-1]){const m=xr;Sr(a);const _=a.$$={fragment:null,ctx:[],props:f,update:Pe,not_equal:l,bound:oo(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(r.context||(m?m.$$.context:[])),callbacks:oo(),dirty:y,skip_bound:!1,root:r.target||m.$$.root};v&&v(_.root);let k=!1;if(_.ctx=i?i(a,r.props||{},(p,x,...S)=>{const b=S.length?S[0]:x;return _.ctx&&l(_.ctx[p],_.ctx[p]=b)&&(!_.skip_bound&&_.bound[p]&&_.bound[p](b),k&&kh(a,p)),x}):[],_.update(),k=!0,Vt(_.before_update),_.fragment=u?u(_.ctx):!1,r.target){if(r.hydrate){const p=fh(r.target);_.fragment&&_.fragment.l(p),p.forEach(Re)}else _.fragment&&_.fragment.c();r.intro&&qe(a.$$.fragment),Zt(a,r.target,r.anchor),vo()}Sr(m)}class In{constructor(){Lt(this,"$$");Lt(this,"$$set")}$destroy(){Qt(this,1),this.$destroy=Pe}$on(r,i){if(!uo(i))return Pe;const u=this.$$.callbacks[r]||(this.$$.callbacks[r]=[]);return u.push(i),()=>{const l=u.indexOf(i);l!==-1&&u.splice(l,1)}}$set(r){this.$$set&&!ih(r)&&(this.$$.skip_bound=!0,this.$$set(r),this.$$.skip_bound=!1)}}const xh="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(xh);function Sh(a){let r,i;return{c(){r=Ht("svg"),i=Ht("path"),Y(i,"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"),Y(r,"viewBox","0 0 14 14"),Y(r,"width","13"),Y(r,"height","13"),Y(r,"class","svelte-en2qvf")},m(u,l){Ae(u,r,l),de(r,i)},p:Pe,i:Pe,o:Pe,d(u){u&&Re(r)}}}class po extends In{constructor(r){super(),bn(this,r,null,Sh,xn,{})}}function bh(a){let r,i;return{c(){r=Ht("svg"),i=Ht("path"),Y(i,"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"),Y(r,"viewBox","0 0 30 30"),Y(r,"fill","none"),Y(r,"xmlns","http://www.w3.org/2000/svg"),Y(r,"class","svelte-d2loi5")},m(u,l){Ae(u,r,l),de(r,i)},p:Pe,i:Pe,o:Pe,d(u){u&&Re(r)}}}class _o extends In{constructor(r){super(),bn(this,r,null,bh,xn,{})}}function Ih(a){let r,i;return{c(){r=xe("img"),Ze(r.src,i=a[3]+"area.svg")||Y(r,"src",i),Y(r,"alt",a[6]),Y(r,"class","svelte-ltkwvy")},m(u,l){Ae(u,r,l)},p(u,l){l&8&&!Ze(r.src,i=u[3]+"area.svg")&&Y(r,"src",i),l&64&&Y(r,"alt",u[6])},d(u){u&&Re(r)}}}function wh(a){let r,i;return{c(){r=xe("img"),Ze(r.src,i=a[3]+"reverse.svg")||Y(r,"src",i),Y(r,"alt",a[6]),Y(r,"class","svelte-ltkwvy")},m(u,l){Ae(u,r,l)},p(u,l){l&8&&!Ze(r.src,i=u[3]+"reverse.svg")&&Y(r,"src",i),l&64&&Y(r,"alt",u[6])},d(u){u&&Re(r)}}}function Nh(a){let r,i;return{c(){r=xe("img"),Ze(r.src,i=a[3]+"poi.svg")||Y(r,"src",i),Y(r,"alt",a[6]),Y(r,"class","svelte-ltkwvy")},m(u,l){Ae(u,r,l)},p(u,l){l&8&&!Ze(r.src,i=u[3]+"poi.svg")&&Y(r,"src",i),l&64&&Y(r,"alt",u[6])},d(u){u&&Re(r)}}}function Lh(a){let r,i;return{c(){r=xe("img"),Ze(r.src,i=a[3]+"postal_code.svg")||Y(r,"src",i),Y(r,"alt",a[6]),Y(r,"class","svelte-ltkwvy")},m(u,l){Ae(u,r,l)},p(u,l){l&8&&!Ze(r.src,i=u[3]+"postal_code.svg")&&Y(r,"src",i),l&64&&Y(r,"alt",u[6])},d(u){u&&Re(r)}}}function Th(a){let r,i;return{c(){r=xe("img"),Ze(r.src,i=a[3]+"street.svg")||Y(r,"src",i),Y(r,"alt",a[6]),Y(r,"class","svelte-ltkwvy")},m(u,l){Ae(u,r,l)},p(u,l){l&8&&!Ze(r.src,i=u[3]+"street.svg")&&Y(r,"src",i),l&64&&Y(r,"alt",u[6])},d(u){u&&Re(r)}}}function Ch(a){let r,i;return{c(){r=xe("img"),Ze(r.src,i=a[3]+"road.svg")||Y(r,"src",i),Y(r,"alt",a[6]),Y(r,"class","svelte-ltkwvy")},m(u,l){Ae(u,r,l)},p(u,l){l&8&&!Ze(r.src,i=u[3]+"road.svg")&&Y(r,"src",i),l&64&&Y(r,"alt",u[6])},d(u){u&&Re(r)}}}function Oh(a){let r,i;return{c(){r=xe("img"),Ze(r.src,i=a[3]+"housenumber.svg")||Y(r,"src",i),Y(r,"alt",a[6]),Y(r,"class","svelte-ltkwvy")},m(u,l){Ae(u,r,l)},p(u,l){l&8&&!Ze(r.src,i=u[3]+"housenumber.svg")&&Y(r,"src",i),l&64&&Y(r,"alt",u[6])},d(u){u&&Re(r)}}}function Rh(a){let r,i,u,l;return{c(){r=xe("img"),Ze(r.src,i=a[5])||Y(r,"src",i),Y(r,"alt",a[4]),Y(r,"class","svelte-ltkwvy")},m(f,v){Ae(f,r,v),u||(l=$e(r,"error",a[14]),u=!0)},p(f,v){v&32&&!Ze(r.src,i=f[5])&&Y(r,"src",i),v&16&&Y(r,"alt",f[4])},d(f){f&&Re(r),u=!1,l()}}}function Eo(a){let r,i;return{c(){r=xe("span"),i=on(a[6]),Y(r,"class","secondary svelte-ltkwvy")},m(u,l){Ae(u,r,l),de(r,i)},p(u,l){l&64&&kr(i,u[6])},d(u){u&&Re(r)}}}function Mh(a){var q,U;let r,i,u,l,f,v,y,m,_=(a[7]?a[0].place_name:a[0].place_name.replace(/,.*/,""))+"",k,p,x=a[2]==="always"||a[2]&&!a[0].address&&((q=a[0].properties)==null?void 0:q.kind)!=="road"&&((U=a[0].properties)==null?void 0:U.kind)!=="road_relation"&&!a[0].id.startsWith("address.")&&!a[0].id.startsWith("postal_code.")&&(!a[0].id.startsWith("poi.")||!a[5])&&!a[7],S,b,L=(a[7]?"":a[0].place_name.replace(/[^,]*,?\s*/,""))+"",T,O,P;function R(A,H){var ee,Z;return H&1&&(i=null),H&1&&(u=null),H&1&&(l=null),A[5]?Rh:A[0].address?Oh:((ee=A[0].properties)==null?void 0:ee.kind)==="road"||((Z=A[0].properties)==null?void 0:Z.kind)==="road_relation"?Ch:(i==null&&(i=!!A[0].id.startsWith("address.")),i?Th:(u==null&&(u=!!A[0].id.startsWith("postal_code.")),u?Lh:(l==null&&(l=!!A[0].id.startsWith("poi.")),l?Nh:A[7]?wh:Ih)))}let G=R(a,-1),M=G(a),z=x&&Eo(a);return{c(){r=xe("li"),M.c(),f=ut(),v=xe("span"),y=xe("span"),m=xe("span"),k=on(_),p=ut(),z&&z.c(),S=ut(),b=xe("span"),T=on(L),Y(m,"class","primary svelte-ltkwvy"),Y(y,"class","svelte-ltkwvy"),Y(b,"class","line2 svelte-ltkwvy"),Y(v,"class","texts svelte-ltkwvy"),Y(r,"tabindex","0"),Y(r,"data-selected",a[1]),Y(r,"class","svelte-ltkwvy"),un(r,"selected",a[1])},m(A,H){Ae(A,r,H),M.m(r,null),de(r,f),de(r,v),de(v,y),de(y,m),de(m,k),de(y,p),z&&z.m(y,null),de(v,S),de(v,b),de(b,T),O||(P=[$e(r,"mouseenter",a[12]),$e(r,"focus",a[13])],O=!0)},p(A,[H]){var ee,Z;G===(G=R(A,H))&&M?M.p(A,H):(M.d(1),M=G(A),M&&(M.c(),M.m(r,f))),H&1&&_!==(_=(A[7]?A[0].place_name:A[0].place_name.replace(/,.*/,""))+"")&&kr(k,_),H&37&&(x=A[2]==="always"||A[2]&&!A[0].address&&((ee=A[0].properties)==null?void 0:ee.kind)!=="road"&&((Z=A[0].properties)==null?void 0:Z.kind)!=="road_relation"&&!A[0].id.startsWith("address.")&&!A[0].id.startsWith("postal_code.")&&(!A[0].id.startsWith("poi.")||!A[5])&&!A[7]),x?z?z.p(A,H):(z=Eo(A),z.c(),z.m(y,null)):z&&(z.d(1),z=null),H&1&&L!==(L=(A[7]?"":A[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&kr(T,L),H&2&&Y(r,"data-selected",A[1]),H&2&&un(r,"selected",A[1])},i:Pe,o:Pe,d(A){A&&Re(r),M.d(),z&&z.d(),O=!1,Vt(P)}}}function Ph(a,r,i){var R;let u,l,{feature:f}=r,{selected:v=!1}=r,{showPlaceType:y}=r,{missingIconsCache:m}=r,{iconsBaseUrl:_}=r;const k=(R=f.properties)==null?void 0:R.categories;let p,x,S=0,b=f.place_type[0]==="reverse";function L(){x&&m.add(x),i(10,S++,S)}function T(G){go.call(this,a,G)}function O(G){go.call(this,a,G)}const P=()=>L();return a.$$set=G=>{"feature"in G&&i(0,f=G.feature),"selected"in G&&i(1,v=G.selected),"showPlaceType"in G&&i(2,y=G.showPlaceType),"missingIconsCache"in G&&i(9,m=G.missingIconsCache),"iconsBaseUrl"in G&&i(3,_=G.iconsBaseUrl)},a.$$.update=()=>{var G,M,z,q;if(a.$$.dirty&3640)do i(11,u--,u),i(4,p=k==null?void 0:k[u]),i(5,x=p?_+p.replace(/ /g,"_")+".svg":void 0);while(u>-1&&(!x||m.has(x)));a.$$.dirty&1&&i(6,l=f.id.startsWith("poi.")?(M=(G=f.properties)==null?void 0:G.categories)==null?void 0:M.join(", "):((q=(z=f.properties)==null?void 0:z.place_type_name)==null?void 0:q[0])??f.place_type[0])},i(11,u=(k==null?void 0:k.length)??0),[f,v,y,_,p,x,l,b,L,m,S,u,T,O,P]}class Ah extends In{constructor(r){super(),bn(this,r,Ph,Mh,xn,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function Dh(a){let r;return{c(){r=xe("div"),r.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>',Y(r,"class","svelte-7cmwmc")},m(i,u){Ae(i,r,u)},p:Pe,i:Pe,o:Pe,d(i){i&&Re(r)}}}class Fh extends In{constructor(r){super(),bn(this,r,null,Dh,xn,{})}}function Gh(a){let r,i;return{c(){r=Ht("svg"),i=Ht("path"),Y(i,"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"),Y(r,"viewBox","0 0 60.006 21.412"),Y(r,"width","14"),Y(r,"height","20"),Y(r,"class","svelte-en2qvf")},m(u,l){Ae(u,r,l),de(r,i)},p:Pe,i:Pe,o:Pe,d(u){u&&Re(r)}}}class Bh extends In{constructor(r){super(),bn(this,r,null,Gh,xn,{})}}function qh(a){let r,i,u;return{c(){r=Ht("svg"),i=Ht("circle"),u=Ht("path"),Y(i,"cx","4.789"),Y(i,"cy","4.787"),Y(i,"r","3.85"),Y(i,"class","svelte-1aq105l"),Y(u,"d","M12.063 12.063 7.635 7.635"),Y(u,"class","svelte-1aq105l"),Y(r,"xmlns","http://www.w3.org/2000/svg"),Y(r,"width","13"),Y(r,"height","13"),Y(r,"viewBox","0 0 13 13"),Y(r,"class","svelte-1aq105l")},m(l,f){Ae(l,r,f),de(r,i),de(r,u)},p:Pe,i:Pe,o:Pe,d(l){l&&Re(r)}}}class zh extends In{constructor(r){super(),bn(this,r,null,qh,xn,{})}}function Uh(a,r,i){const u=r[1],l=r[0],f=u-l;return a===u&&i?a:((a-l)%f+f)%f+l}function ko(a){const r=[...a];return r[2]<r[0]&&(r[2]+=360),r}let br;async function Yh(a,r,i){const u=a==null?void 0:a.getCenterAndZoom();for(const l of r??[])if(!(u&&(l.minZoom!=null&&l.minZoom>u[0]||l.maxZoom!=null&&l.maxZoom<u[0]))){if(l.type==="fixed")return l.coordinates.join(",");e:if(l.type==="client-geolocation"){if(br&&l.cachedLocationExpiry&&br.time+l.cachedLocationExpiry>Date.now()){if(!br.coords)break e;return br.coords}let f;try{return f=await new Promise((v,y)=>{i.signal.addEventListener("abort",()=>{y(Error("aborted"))}),navigator.geolocation.getCurrentPosition(m=>{v([m.coords.longitude,m.coords.latitude].map(_=>_.toFixed(6)).join(","))},m=>{y(m)},l)}),f}catch{}finally{l.cachedLocationExpiry&&(br={time:Date.now(),coords:f})}if(i.signal.aborted)return}if(l.type==="server-geolocation")return"ip";if(u&&l.type==="map-center")return u[1].toFixed(6)+","+u[2].toFixed(6)}}const Wh=/^(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,xo=/^([+-]?[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,})$/,So=/^(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,bo=/^(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,Io=/^(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,wo=/^(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 Xh(a){if(!["DMS","DM","DD"].includes(a))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const r=this.decimalCoordinates.split(",").map(S=>Number(S.trim())),i=Number(r[0]),u=Number(r[1]),l=Math.abs(i),f=Math.abs(u),v=i>0?"N":"S",y=u>0?"E":"W";let m;a=="DD"&&(m=`${l}° ${v}, ${f}° ${y}`);const _=Math.floor(l),k=Math.floor(f),p=(l-_)*60,x=(f-k)*60;if(a=="DM"){let S=No(p,3).toFixed(3).padStart(6,"0"),b=No(x,3).toFixed(3).padStart(6,"0");S.endsWith(".000")&&b.endsWith(".000")&&(S=S.replace(/\.000$/,""),b=b.replace(/\.000$/,"")),m=`${_}° ${S}' ${v}, ${k}° ${b}' ${y}`}if(a=="DMS"){const S=Math.floor(p),b=Math.floor(x);let L=((p-S)*60).toFixed(1).padStart(4,"0"),T=((x-b)*60).toFixed(1).padStart(4,"0");const O=S.toString().padStart(2,"0"),P=b.toString().padStart(2,"0");L.endsWith(".0")&&T.endsWith(".0")&&(L=L.replace(/\.0$/,""),T=T.replace(/\.0$/,"")),m=`${_}° ${O}' ${L}" ${v}, ${k}° ${P}' ${T}" ${y}`}return m}else throw new Error("no decimal coordinates to convert")}function No(a,r){const i=Math.pow(10,r);return Math.round((a+Number.EPSILON)*i)/i}function gs(a,r){r||(r=5),a=a.replace(/\s+/g," ").trim();let i=null,u=null,l="",f="",v=null,y=[],m=!1;if(Wh.test(a))throw new Error("invalid coordinate value");if(xo.test(a))if(y=xo.exec(a),m=Ir(y),m)i=Math.abs(y[1])+y[2]/60,Number(y[1])<0&&(i*=-1),u=Math.abs(y[3])+y[4]/60,Number(y[3])<0&&(u*=-1),v="DM";else throw new Error("invalid coordinate format");else if(So.test(a))if(y=So.exec(a),m=Ir(y),m){if(i=y[2],u=y[6],i.includes(",")&&(i=i.replace(",",".")),u.includes(",")&&(u=u.replace(",",".")),v="DD",Number(Math.round(i))==Number(i))throw new Error("integer only coordinate provided");if(Number(Math.round(u))==Number(u))throw new Error("integer only coordinate provided");y[1]?(l=y[1],f=y[5]):y[4]&&(l=y[4],f=y[8])}else throw new Error("invalid decimal coordinate format");else if(bo.test(a))if(y=bo.exec(a),m=Ir(y),m)i=Math.abs(parseInt(y[2])),y[4]&&(i+=y[4]/60,v="DM"),y[6]&&(i+=y[6].replace(",",".")/3600,v="DMS"),parseInt(y[2])<0&&(i=-1*i),u=Math.abs(parseInt(y[9])),y[11]&&(u+=y[11]/60),y[13]&&(u+=y[13].replace(",",".")/3600),parseInt(y[9])<0&&(u=-1*u),y[1]?(l=y[1],f=y[8]):y[7]&&(l=y[7],f=y[14]);else throw new Error("invalid DMS coordinates format");else if(Io.test(a))if(y=Io.exec(a),m=Ir(y),m)i=Math.abs(parseInt(y[2])),y[4]&&(i+=y[4]/60,v="DM"),y[6]&&(i+=y[6]/3600,v="DMS"),parseInt(y[2])<0&&(i=-1*i),u=Math.abs(parseInt(y[10])),y[12]&&(u+=y[12]/60),y[14]&&(u+=y[14]/3600),parseInt(y[10])<0&&(u=-1*u),y[1]?(l=y[1],f=y[9]):y[8]&&(l=y[8],f=y[16]);else throw new Error("invalid DMS coordinates format");else if(wo.test(a)){if(y=wo.exec(a),m=Ir(y),y.filter(_=>_).length<=5)throw new Error("invalid coordinates format");if(m)i=Math.abs(parseInt(y[2])),y[4]&&(i+=y[4].replace(",",".")/60,v="DM"),y[6]&&(i+=y[6].replace(",",".")/3600,v="DMS"),parseInt(y[2])<0&&(i=-1*i),u=Math.abs(parseInt(y[10])),y[12]&&(u+=y[12].replace(",",".")/60),y[14]&&(u+=y[14].replace(",",".")/3600),parseInt(y[10])<0&&(u=-1*u),y[1]?(l=y[1],f=y[9]):y[8]&&(l=y[8],f=y[16]);else throw new Error("invalid coordinates format")}if(m){if(Math.abs(u)>=180)throw new Error("invalid longitude value");if(Math.abs(i)>=90)throw new Error("invalid latitude value");if(l&&!f||!l&&f)throw new Error("invalid coordinates value");if(l&&l==f)throw new Error("invalid coordinates format");i.toString().includes(",")&&(i=i.replace(",",".")),u.toString().includes(",")&&(u=u.replace(",","."));let _=/S|SOUTH/i;_.test(l)&&i>0&&(i=-1*i),_=/W|WEST/i,_.test(f)&&u>0&&(u=-1*u);const k=y[0].trim();let p,x;const S=/[,/;\u0020]/g,b=k.match(S);if(b==null){const O=Math.floor(a.length/2);p=k.substring(0,O).trim(),x=k.substring(O).trim()}else{let O;b.length%2==1?O=Math.floor(b.length/2):O=b.length/2-1;let P=0;if(O==0)P=k.indexOf(b[0]),p=k.substring(0,P).trim(),x=k.substring(P+1).trim();else{let R=0,G=0;for(;R<=O;)P=k.indexOf(b[R],G),G=P+1,R++;p=k.substring(0,P).trim(),x=k.substring(P+1).trim()}}const L=p.split(".");if(L.length==2&&L[1]==0&&L[1].length!=2)throw new Error("invalid coordinates format");const T=x.split(".");if(T.length==2&&T[1]==0&&T[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(p)||/^\d+$/.test(x))throw new Error("degree only coordinate/s provided");return i=Number(Number(i).toFixed(r)),u=Number(Number(u).toFixed(r)),Object.freeze({verbatimCoordinates:k,verbatimLatitude:p,verbatimLongitude:x,decimalLatitude:i,decimalLongitude:u,decimalCoordinates:`${i},${u}`,originalFormat:v,closeEnough:jh,toCoordinateFormat:Xh})}else throw new Error("coordinates pattern match failed")}function Ir(a){if(!isNaN(a[0]))return!1;const r=[...a];if(r.shift(),r.length%2>0)return!1;const i=/^[-+]?\d+([\.,]\d+)?$/,u=/[eastsouthnorthwest]+/i,l=r.length/2;for(let f=0;f<l;f++){const v=r[f],y=r[f+l],m=i.test(v)&&i.test(y),_=u.test(v)&&u.test(y),k=v==y;if(!(v==null&&y==null)){if(v==null||y==null)return!1;if(m||_||k)continue;return!1}}return!0}function Lo(a,r){const i=Math.abs(a-r);return Number(i.toFixed(6))<=1e-5}function jh(a){if(!a)throw new Error("coords must be provided");if(a.includes(",")){const r=a.split(",");if(Number(r[0])==NaN||Number(r[1])==NaN)throw new Error("coords are not valid decimals");return Lo(this.decimalLatitude,Number(r[0]))&&Lo(this.decimalLongitude,r[1])}else throw new Error("coords being tested must be separated by a comma")}const Vh=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});gs.to=Vh;const Hh=[{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"}],Zh={decimalLatitude:40.123,decimalLongitude:-74.123},Qh=[{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}],Kh=[{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 Jh(){const a=[];return Hh.forEach(r=>{r.decimalLatitude?a.push(r):a.push({...r,...Zh})}),[...a,...Qh,...Kh]}const $h=Jh();gs.formats=$h.map(a=>a.verbatimCoordinates);const eg=gs;function To(a,r,i){const u=a.slice();return u[81]=r[i],u[83]=i,u}function Co(a){let r,i;return r=new Fh({}),{c(){ln(r.$$.fragment)},m(u,l){Zt(r,u,l),i=!0},i(u){i||(qe(r.$$.fragment,u),i=!0)},o(u){We(r.$$.fragment,u),i=!1},d(u){Qt(r,u)}}}function Oo(a){let r,i,u,l,f;return i=new Bh({}),{c(){r=xe("button"),ln(i.$$.fragment),Y(r,"type","button"),Y(r,"title",a[9]),Y(r,"class","svelte-zh3kmv"),un(r,"active",a[0])},m(v,y){Ae(v,r,y),Zt(i,r,null),u=!0,l||(f=$e(r,"click",a[67]),l=!0)},p(v,y){(!u||y[0]&512)&&Y(r,"title",v[9]),(!u||y[0]&1)&&un(r,"active",v[0])},i(v){u||(qe(i.$$.fragment,v),u=!0)},o(v){We(i.$$.fragment,v),u=!1},d(v){v&&Re(r),Qt(i),l=!1,f()}}}function tg(a){let r,i=[],u=new Map,l,f,v,y=mo(a[14]);const m=_=>_[81].id+(_[81].address?","+_[81].address:"");for(let _=0;_<y.length;_+=1){let k=To(a,y,_),p=m(k);u.set(p,i[_]=Ro(p,k))}return{c(){r=xe("ul");for(let _=0;_<i.length;_+=1)i[_].c();Y(r,"class","svelte-zh3kmv")},m(_,k){Ae(_,r,k);for(let p=0;p<i.length;p+=1)i[p]&&i[p].m(r,null);l=!0,f||(v=[$e(r,"mouseleave",a[71]),$e(r,"blur",a[72])],f=!0)},p(_,k){k[0]&17880064&&(y=mo(_[14]),ii(),i=Eh(i,k,m,1,_,y,u,r,_h,Ro,null,To),si())},i(_){if(!l){for(let k=0;k<y.length;k+=1)qe(i[k]);l=!0}},o(_){for(let k=0;k<i.length;k+=1)We(i[k]);l=!1},d(_){_&&Re(r);for(let k=0;k<i.length;k+=1)i[k].d();f=!1,Vt(v)}}}function ng(a){let r,i,u,l,f,v;return i=new _o({}),{c(){r=xe("div"),ln(i.$$.fragment),u=ut(),l=xe("div"),f=on(a[7]),Y(l,"class","svelte-zh3kmv"),Y(r,"class","no-results svelte-zh3kmv")},m(y,m){Ae(y,r,m),Zt(i,r,null),de(r,u),de(r,l),de(l,f),v=!0},p(y,m){(!v||m[0]&128)&&kr(f,y[7])},i(y){v||(qe(i.$$.fragment,y),v=!0)},o(y){We(i.$$.fragment,y),v=!1},d(y){y&&Re(r),Qt(i)}}}function rg(a){let r="",i;return{c(){i=on(r)},m(u,l){Ae(u,i,l)},p:Pe,i:Pe,o:Pe,d(u){u&&Re(i)}}}function ig(a){let r,i,u,l,f,v,y,m,_,k,p;return i=new _o({}),m=new po({}),{c(){r=xe("div"),ln(i.$$.fragment),u=ut(),l=xe("div"),f=on(a[6]),v=ut(),y=xe("button"),ln(m.$$.fragment),Y(l,"class","svelte-zh3kmv"),Y(y,"class","svelte-zh3kmv"),Y(r,"class","error svelte-zh3kmv")},m(x,S){Ae(x,r,S),Zt(i,r,null),de(r,u),de(r,l),de(l,f),de(r,v),de(r,y),Zt(m,y,null),_=!0,k||(p=$e(y,"click",a[68]),k=!0)},p(x,S){(!_||S[0]&64)&&kr(f,x[6])},i(x){_||(qe(i.$$.fragment,x),qe(m.$$.fragment,x),_=!0)},o(x){We(i.$$.fragment,x),We(m.$$.fragment,x),_=!1},d(x){x&&Re(r),Qt(i),Qt(m),k=!1,p()}}}function Ro(a,r){let i,u,l;function f(){return r[69](r[83])}function v(){return r[70](r[81])}return u=new Ah({props:{feature:r[81],showPlaceType:r[10],selected:r[15]===r[83],missingIconsCache:r[20],iconsBaseUrl:r[12]}}),u.$on("mouseenter",f),u.$on("focus",v),{key:a,first:null,c(){i=lh(),ln(u.$$.fragment),this.first=i},m(y,m){Ae(y,i,m),Zt(u,y,m),l=!0},p(y,m){r=y;const _={};m[0]&16384&&(_.feature=r[81]),m[0]&1024&&(_.showPlaceType=r[10]),m[0]&49152&&(_.selected=r[15]===r[83]),m[0]&4096&&(_.iconsBaseUrl=r[12]),u.$set(_)},i(y){l||(qe(u.$$.fragment,y),l=!0)},o(y){We(u.$$.fragment,y),l=!1},d(y){y&&Re(i),Qt(u,y)}}}function sg(a){let r,i,u,l,f,v,y,m,_,k,p,x,S,b,L,T,O,P,R,G,M,z=!1;f=new zh({}),p=new po({});let q=a[19]&&Co(),U=a[5]===!0&&Oo(a);const A=a[59].default,H=sh(A,a,a[58],null),ee=[ig,rg,ng,tg],Z=[];function oe(D,Q){var ie,me;return D[18]?0:D[16]?((ie=D[14])==null?void 0:ie.length)===0?2:D[16]&&((me=D[14])!=null&&me.length)?3:-1:1}return~(T=oe(a))&&(O=Z[T]=ee[T](a)),{c(){r=ut(),i=xe("form"),u=xe("div"),l=xe("button"),ln(f.$$.fragment),v=ut(),y=xe("input"),m=ut(),_=xe("div"),k=xe("button"),ln(p.$$.fragment),x=ut(),q&&q.c(),S=ut(),U&&U.c(),b=ut(),H&&H.c(),L=ut(),O&&O.c(),Y(l,"class","search-button svelte-zh3kmv"),Y(l,"type","button"),Y(y,"placeholder",a[8]),Y(y,"aria-label",a[8]),Y(y,"class","svelte-zh3kmv"),Y(k,"type","button"),Y(k,"title",a[3]),Y(k,"class","svelte-zh3kmv"),Y(_,"class","clear-button-container svelte-zh3kmv"),un(_,"displayable",a[1]!==""),Y(u,"class","input-group svelte-zh3kmv"),Y(i,"tabindex","0"),Y(i,"class",P=co(a[2])+" svelte-zh3kmv"),un(i,"can-collapse",a[4]&&a[1]==="")},m(D,Q){Ae(D,r,Q),Ae(D,i,Q),de(i,u),de(u,l),Zt(f,l,null),de(u,v),de(u,y),a[61](y),fo(y,a[1]),de(u,m),de(u,_),de(_,k),Zt(p,k,null),de(_,x),q&&q.m(_,null),de(u,S),U&&U.m(u,null),de(u,b),H&&H.m(u,null),de(i,L),~T&&Z[T].m(i,null),R=!0,G||(M=[$e(l,"click",a[60]),$e(y,"input",a[62]),$e(y,"focus",a[63]),$e(y,"blur",a[64]),$e(y,"keydown",a[22]),$e(y,"input",a[65]),$e(k,"click",a[66]),$e(i,"submit",ch(a[21]))],G=!0)},p(D,Q){(!R||Q[0]&256)&&Y(y,"placeholder",D[8]),(!R||Q[0]&256)&&Y(y,"aria-label",D[8]),Q[0]&2&&y.value!==D[1]&&fo(y,D[1]),(!R||Q[0]&8)&&Y(k,"title",D[3]),D[19]?q?Q[0]&524288&&qe(q,1):(q=Co(),q.c(),qe(q,1),q.m(_,null)):q&&(ii(),We(q,1,1,()=>{q=null}),si()),(!R||Q[0]&2)&&un(_,"displayable",D[1]!==""),D[5]===!0?U?(U.p(D,Q),Q[0]&32&&qe(U,1)):(U=Oo(D),U.c(),qe(U,1),U.m(u,b)):U&&(ii(),We(U,1,1,()=>{U=null}),si()),H&&H.p&&(!R||Q[1]&134217728)&&oh(H,A,D,D[58],R?ah(A,D[58],Q,null):uh(D[58]),null);let ie=T;T=oe(D),T===ie?~T&&Z[T].p(D,Q):(O&&(ii(),We(Z[ie],1,1,()=>{Z[ie]=null}),si()),~T?(O=Z[T],O?O.p(D,Q):(O=Z[T]=ee[T](D),O.c()),qe(O,1),O.m(i,null)):O=null),(!R||Q[0]&4&&P!==(P=co(D[2])+" svelte-zh3kmv"))&&Y(i,"class",P),(!R||Q[0]&22)&&un(i,"can-collapse",D[4]&&D[1]==="")},i(D){R||(qe(z),qe(f.$$.fragment,D),qe(p.$$.fragment,D),qe(q),qe(U),qe(H,D),qe(O),R=!0)},o(D){We(z),We(f.$$.fragment,D),We(p.$$.fragment,D),We(q),We(U),We(H,D),We(O),R=!1},d(D){D&&(Re(r),Re(i)),Qt(f),a[61](null),Qt(p),q&&q.d(),U&&U.d(),H&&H.d(D),~T&&Z[T].d(),G=!1,Vt(M)}}}function ag(a,r,i){let u,{$$slots:l={},$$scope:f}=r,{class:v=void 0}=r,{apiKey:y}=r,{bbox:m=void 0}=r,{clearButtonTitle:_="clear"}=r,{clearOnBlur:k=!1}=r,{collapsed:p=!1}=r,{country:x=void 0}=r,{debounceSearch:S=200}=r,{enableReverse:b=!1}=r,{errorMessage:L="Something went wrong…"}=r,{filter:T=()=>!0}=r,{flyTo:O=!0}=r,{fuzzyMatch:P=!0}=r,{language:R=void 0}=r,{limit:G=void 0}=r,{mapController:M=void 0}=r,{minLength:z=2}=r,{noResultsMessage:q="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!"}=r,{placeholder:U="Search"}=r,{proximity:A=[{type:"server-geolocation"}]}=r,{reverseActive:H=b==="always"}=r,{reverseButtonTitle:ee="toggle reverse geocoding"}=r,{searchValue:Z=""}=r,{showFullGeometry:oe=!0}=r,{showPlaceType:D="ifNeeded"}=r,{showResultsWhileTyping:Q=!0}=r,{selectFirst:ie=!0}=r,{flyToSelected:me=!1}=r,{markerOnSelected:Ge=!0}=r,{types:we=void 0}=r,{excludeTypes:K=!1}=r,{zoom:ze=16}=r,{maxZoom:Le=18}=r,{apiUrl:Ve="https://api.maptiler.com/geocoding"}=r,{fetchParameters:he={}}=r,{iconsBaseUrl:kt="https://cdn.maptiler.com/maptiler-geocoding-control/v1.3.2/icons/"}=r,{adjustUrlQuery:Wr=()=>{}}=r;function Ji(){st.focus()}function C(){st.blur()}function $i(B,Ce=!0,Ue=!1){i(1,Z=B),Ce?(i(15,Ne=-1),lr()):(ct(!Ue,Ue),setTimeout(()=>{st.focus(),st.select()}))}function Se(){i(14,ce=void 0),i(55,ue=void 0),i(15,Ne=-1)}function J(){i(54,Te=[]),i(55,ue=void 0)}let I=!1,ce,Te,ue,Xr="",st,Ne=-1,W,Rn=[],Yt,at,ur,le;const Mn=new Set,lt=yh();gh(()=>{M&&(M.setEventHandler(void 0),M.indicateReverse(!1),M.setSelectedMarker(-1),M.setMarkers(void 0,void 0))});function lr(B){if(at&&(clearTimeout(at),at=void 0),Ne>-1&&ce)i(55,ue=ce[Ne]),i(1,Z=ue.place_type[0]==="reverse"?ue.place_name:ue.place_name.replace(/,.*/,"")),i(18,W=void 0),i(54,Te=void 0),i(15,Ne=-1);else if(Z){const Ce=B||!te(Z);Pn(Z,{exact:!0}).then(()=>{i(54,Te=ce),i(55,ue=void 0),Ce&&ve()}).catch(Ue=>i(18,W=Ue))}}function te(B){try{return eg(B,6)}catch{return!1}}async function Pn(B,{byId:Ce=!1,exact:Ue=!1}={}){i(18,W=void 0),Yt==null||Yt.abort();const tt=new AbortController;i(19,Yt=tt);try{const ge=te(B),nt=new URLSearchParams;if(R!==void 0&&nt.set("language",Array.isArray(R)?R.join(","):R??""),we&&nt.set("types",we.join(",")),K&&nt.set("excludeTypes",String(K)),m&&nt.set("bbox",m.map(hr=>hr.toFixed(6)).join(",")),x&&nt.set("country",Array.isArray(x)?x.join(","):x),!Ce&&!ge){const hr=await Yh(M,A,tt);hr&&nt.set("proximity",hr),(Ue||!Q)&&nt.set("autocomplete","false"),nt.set("fuzzyMatch",String(P))}G!==void 0&&(!ge||(we==null?void 0:we.length)===1)&&nt.set("limit",String(G)),nt.set("key",y),Wr(nt);const St=Ve+"/"+encodeURIComponent(ge?ge.decimalLongitude+","+ge.decimalLatitude:B)+".json?"+nt.toString();if(St===Xr){Ce?(i(14,ce=void 0),i(55,ue=Rn[0])):i(14,ce=Rn);return}Xr=St;const fr=await fetch(St,{signal:tt.signal,...he});if(!fr.ok)throw new Error(await fr.text());const En=await fr.json();lt("response",{url:St,featureCollection:En}),Ce?(i(14,ce=void 0),i(55,ue=En.features[0]),Rn=[ue]):(i(14,ce=En.features.filter(T)),ge&&ce.unshift({type:"Feature",properties:{},id:"reverse_"+ge.decimalLongitude+"_"+ge.decimalLatitude,text:ge.decimalLatitude+", "+ge.decimalLongitude,place_name:ge.decimalLatitude+", "+ge.decimalLongitude,place_type:["reverse"],center:[ge.decimalLongitude,ge.decimalLatitude],bbox:[ge.decimalLongitude,ge.decimalLatitude,ge.decimalLongitude,ge.decimalLatitude],geometry:{type:"Point",coordinates:[ge.decimalLongitude,ge.decimalLatitude]}}),Rn=ce,ge&&st.focus())}catch(ge){if(ge&&typeof ge=="object"&&"name"in ge&&ge.name==="AbortError")return;throw ge}finally{tt===Yt&&i(19,Yt=void 0)}}function ve(){var Ue;if(!(Te!=null&&Te.length)||!O)return;const B=[180,90,-180,-90],Ce=!Te.some(tt=>!tt.matching_text);for(const tt of Te)if(Ce||!tt.matching_text)for(const ge of[0,1,2,3])B[ge]=Math[ge<2?"min":"max"](B[ge],((Ue=tt.bbox)==null?void 0:Ue[ge])??tt.center[ge%2]);M&&Te.length>0&&(ue&&B[0]===B[2]&&B[1]===B[3]?M.flyTo(ue.center,ze):M.fitBounds(ko(B),50,Le))}function ae(B){i(0,H=b==="always"),i(14,ce=void 0),i(55,ue=void 0),i(15,Ne=-1),$i(B[1].toFixed(6)+", "+Uh(B[0],[-180,180],!0).toFixed(6),!1,!0)}function Fa(B){if(!ce)return;let Ce=B.key==="ArrowDown"?1:B.key==="ArrowUp"?-1:0;Ce&&(Ne===(ie?0:-1)&&Ce===-1&&i(15,Ne=ce.length),i(15,Ne+=Ce),Ne>=ce.length&&i(15,Ne=-1),Ne<0&&ie&&i(15,Ne=0),B.preventDefault())}function ct(B=!0,Ce=!1){if(i(18,W=void 0),Q||Ce){if(at&&clearTimeout(at),Z.length<z)return;const Ue=Z;at=window.setTimeout(()=>{Pn(Ue).catch(tt=>i(18,W=tt))},B?S:0)}else i(14,ce=void 0),i(18,W=void 0)}function jr(B){i(55,ue=B),i(1,Z=B.place_name),i(15,Ne=-1)}const ne=()=>st.focus();function Ga(B){ls[B?"unshift":"push"](()=>{st=B,i(17,st)})}function Ba(){Z=this.value,i(1,Z),i(13,I),i(27,k)}const Vr=()=>i(13,I=!0),ot=()=>i(13,I=!1),An=()=>ct(),xt=()=>{i(1,Z=""),st.focus()},es=()=>i(0,H=!H),cr=()=>i(18,W=void 0),qa=B=>i(15,Ne=B),ts=B=>jr(B),tn=()=>{ie||i(15,Ne=-1)},V=()=>{};return a.$$set=B=>{"class"in B&&i(2,v=B.class),"apiKey"in B&&i(25,y=B.apiKey),"bbox"in B&&i(26,m=B.bbox),"clearButtonTitle"in B&&i(3,_=B.clearButtonTitle),"clearOnBlur"in B&&i(27,k=B.clearOnBlur),"collapsed"in B&&i(4,p=B.collapsed),"country"in B&&i(28,x=B.country),"debounceSearch"in B&&i(29,S=B.debounceSearch),"enableReverse"in B&&i(5,b=B.enableReverse),"errorMessage"in B&&i(6,L=B.errorMessage),"filter"in B&&i(30,T=B.filter),"flyTo"in B&&i(31,O=B.flyTo),"fuzzyMatch"in B&&i(32,P=B.fuzzyMatch),"language"in B&&i(33,R=B.language),"limit"in B&&i(34,G=B.limit),"mapController"in B&&i(35,M=B.mapController),"minLength"in B&&i(36,z=B.minLength),"noResultsMessage"in B&&i(7,q=B.noResultsMessage),"placeholder"in B&&i(8,U=B.placeholder),"proximity"in B&&i(37,A=B.proximity),"reverseActive"in B&&i(0,H=B.reverseActive),"reverseButtonTitle"in B&&i(9,ee=B.reverseButtonTitle),"searchValue"in B&&i(1,Z=B.searchValue),"showFullGeometry"in B&&i(38,oe=B.showFullGeometry),"showPlaceType"in B&&i(10,D=B.showPlaceType),"showResultsWhileTyping"in B&&i(39,Q=B.showResultsWhileTyping),"selectFirst"in B&&i(11,ie=B.selectFirst),"flyToSelected"in B&&i(40,me=B.flyToSelected),"markerOnSelected"in B&&i(41,Ge=B.markerOnSelected),"types"in B&&i(42,we=B.types),"excludeTypes"in B&&i(43,K=B.excludeTypes),"zoom"in B&&i(44,ze=B.zoom),"maxZoom"in B&&i(45,Le=B.maxZoom),"apiUrl"in B&&i(46,Ve=B.apiUrl),"fetchParameters"in B&&i(47,he=B.fetchParameters),"iconsBaseUrl"in B&&i(12,kt=B.iconsBaseUrl),"adjustUrlQuery"in B&&i(48,Wr=B.adjustUrlQuery),"$$scope"in B&&i(58,f=B.$$scope)},a.$$.update=()=>{if(a.$$.dirty[0]&32&&i(0,H=b==="always"),a.$$.dirty[0]&134225920&&setTimeout(()=>{i(16,ur=I),k&&!I&&i(1,Z="")}),a.$$.dirty[0]&16386|a.$$.dirty[1]&32&&Z.length<z&&(i(55,ue=void 0),i(14,ce=void 0),i(18,W=void 0),i(54,Te=ce)),a.$$.dirty[1]&16777344&&oe&&ue&&!ue.address&&ue.geometry.type==="Point"&&ue.place_type[0]!=="reverse"&&Pn(ue.id,{byId:!0}).catch(B=>i(18,W=B)),a.$$.dirty[1]&50356241&&(M&&ue&&ue.id!==le&&O&&(!ue.bbox||ue.bbox[0]===ue.bbox[2]&&ue.bbox[1]===ue.bbox[3]?M.flyTo(ue.center,ue.id.startsWith("poi.")||ue.id.startsWith("address.")?Le:ze):M.fitBounds(ko(ue.bbox),50,Le),i(14,ce=void 0),i(54,Te=void 0),i(15,Ne=-1)),i(56,le=ue==null?void 0:ue.id)),a.$$.dirty[0]&18432&&ie&&ce!=null&&ce.length&&i(15,Ne=0),a.$$.dirty[0]&2050&&(ie||i(15,Ne=-1)),a.$$.dirty[0]&16384|a.$$.dirty[1]&8388608&&Te!==ce&&i(54,Te=void 0),a.$$.dirty[0]&81921|a.$$.dirty[1]&8388624&&M&&M.setEventHandler(B=>{switch(B.type){case"mapClick":H&&ae(B.coordinates);break;case"markerClick":{const Ce=ce==null?void 0:ce.find(Ue=>Ue.id===B.id);Ce&&jr(Ce)}break;case"markerMouseEnter":Te&&i(15,Ne=ur?(ce==null?void 0:ce.findIndex(Ce=>Ce.id===B.id))??-1:-1);break;case"markerMouseLeave":Te&&i(15,Ne=-1);break}}),a.$$.dirty[0]&49152&&i(57,u=ce==null?void 0:ce[Ne]),a.$$.dirty[1]&67133969&&M&&u&&O&&me&&M.flyTo(u.center,u.id.startsWith("poi.")||u.id.startsWith("address.")?Le:ze),a.$$.dirty[1]&1040&&(Ge||M==null||M.setMarkers(void 0,void 0)),a.$$.dirty[1]&75498512&&M&&Ge&&!Te&&(M.setMarkers(u?[u]:void 0,void 0),M.setSelectedMarker(u?0:-1)),a.$$.dirty[1]&25165840&&M&&M.setMarkers(Te,ue),a.$$.dirty[0]&32768|a.$$.dirty[1]&8388624&&Te&&M&&M.setSelectedMarker(Ne),a.$$.dirty[0]&2|a.$$.dirty[1]&16&&M){const B=te(Z);M.setReverseMarker(B?[B.decimalLongitude,B.decimalLatitude]:void 0)}a.$$.dirty[1]&67108864&&lt("select",u),a.$$.dirty[1]&16777216&&lt("pick",ue),a.$$.dirty[0]&81920&&lt("optionsVisibilityChange",ur&&!!ce),a.$$.dirty[0]&16384&&lt("featuresListed",ce),a.$$.dirty[1]&8388608&&lt("featuresMarked",Te),a.$$.dirty[0]&1&&lt("reverseToggle",H),a.$$.dirty[0]&2&&lt("queryChange",Z),a.$$.dirty[0]&1|a.$$.dirty[1]&16&&M&&M.indicateReverse(H)},[H,Z,v,_,p,b,L,q,U,ee,D,ie,kt,I,ce,Ne,ur,st,W,Yt,Mn,lr,Fa,ct,jr,y,m,k,x,S,T,O,P,R,G,M,z,A,oe,Q,me,Ge,we,K,ze,Le,Ve,he,Wr,Ji,C,$i,Se,J,Te,ue,le,u,f,l,ne,Ga,Ba,Vr,ot,An,xt,es,cr,qa,ts,tn,V]}let og=class extends In{constructor(r){super(),bn(this,r,ag,sg,xn,{class:2,apiKey:25,bbox:26,clearButtonTitle:3,clearOnBlur:27,collapsed:4,country:28,debounceSearch:29,enableReverse:5,errorMessage:6,filter:30,flyTo:31,fuzzyMatch:32,language:33,limit:34,mapController:35,minLength:36,noResultsMessage:7,placeholder:8,proximity:37,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:38,showPlaceType:10,showResultsWhileTyping:39,selectFirst:11,flyToSelected:40,markerOnSelected:41,types:42,excludeTypes:43,zoom:44,maxZoom:45,apiUrl:46,fetchParameters:47,iconsBaseUrl:12,adjustUrlQuery:48,focus:49,blur:50,setQuery:51,clearList:52,clearMap:53},null,[-1,-1,-1])}get focus(){return this.$$.ctx[49]}get blur(){return this.$$.ctx[50]}get setQuery(){return this.$$.ctx[51]}get clearList(){return this.$$.ctx[52]}get clearMap(){return this.$$.ctx[53]}};var wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Mo(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}function ug(a){if(a.__esModule)return a;var r=a.default;if(typeof r=="function"){var i=function u(){return this instanceof u?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};i.prototype=r.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(a).forEach(function(u){var l=Object.getOwnPropertyDescriptor(a,u);Object.defineProperty(i,u,l.get?l:{enumerable:!0,get:function(){return a[u]}})}),i}var Po=Object.prototype.toString,Ao=function(r){var i=Po.call(r),u=i==="[object Arguments]";return u||(u=i!=="[object Array]"&&r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&Po.call(r.callee)==="[object Function]"),u},ys,Do;function lg(){if(Do)return ys;Do=1;var a;if(!Object.keys){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,u=Ao,l=Object.prototype.propertyIsEnumerable,f=!l.call({toString:null},"toString"),v=l.call(function(){},"prototype"),y=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],m=function(x){var S=x.constructor;return S&&S.prototype===x},_={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},k=function(){if(typeof window>"u")return!1;for(var x in window)try{if(!_["$"+x]&&r.call(window,x)&&window[x]!==null&&typeof window[x]=="object")try{m(window[x])}catch{return!0}}catch{return!0}return!1}(),p=function(x){if(typeof window>"u"||!k)return m(x);try{return m(x)}catch{return!1}};a=function(S){var b=S!==null&&typeof S=="object",L=i.call(S)==="[object Function]",T=u(S),O=b&&i.call(S)==="[object String]",P=[];if(!b&&!L&&!T)throw new TypeError("Object.keys called on a non-object");var R=v&&L;if(O&&S.length>0&&!r.call(S,0))for(var G=0;G<S.length;++G)P.push(String(G));if(T&&S.length>0)for(var M=0;M<S.length;++M)P.push(String(M));else for(var z in S)!(R&&z==="prototype")&&r.call(S,z)&&P.push(String(z));if(f)for(var q=p(S),U=0;U<y.length;++U)!(q&&y[U]==="constructor")&&r.call(S,y[U])&&P.push(y[U]);return P}}return ys=a,ys}var cg=Array.prototype.slice,fg=Ao,Fo=Object.keys,ai=Fo?function(r){return Fo(r)}:lg(),Go=Object.keys;ai.shim=function(){if(Object.keys){var r=function(){var i=Object.keys(arguments);return i&&i.length===arguments.length}(1,2);r||(Object.keys=function(u){return fg(u)?Go(cg.call(u)):Go(u)})}else Object.keys=ai;return Object.keys||ai};var vs=ai,hg=Error,gg=EvalError,yg=RangeError,vg=ReferenceError,Bo=SyntaxError,cn=TypeError,dg=URIError,oi=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},i=Symbol("test"),u=Object(i);if(typeof i=="string"||Object.prototype.toString.call(i)!=="[object Symbol]"||Object.prototype.toString.call(u)!=="[object Symbol]")return!1;var l=42;r[i]=l;for(i in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var f=Object.getOwnPropertySymbols(r);if(f.length!==1||f[0]!==i||!Object.prototype.propertyIsEnumerable.call(r,i))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var v=Object.getOwnPropertyDescriptor(r,i);if(v.value!==l||v.enumerable!==!0)return!1}return!0},qo=typeof Symbol<"u"&&Symbol,mg=oi,ds=function(){return typeof qo!="function"||typeof Symbol!="function"||typeof qo("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:mg()},ms={__proto__:null,foo:{}},pg=Object,_g=function(){return{__proto__:ms}.foo===ms.foo&&!(ms instanceof pg)},Eg="Function.prototype.bind called on incompatible ",kg=Object.prototype.toString,xg=Math.max,Sg="[object Function]",zo=function(r,i){for(var u=[],l=0;l<r.length;l+=1)u[l]=r[l];for(var f=0;f<i.length;f+=1)u[f+r.length]=i[f];return u},bg=function(r,i){for(var u=[],l=i,f=0;l<r.length;l+=1,f+=1)u[f]=r[l];return u},Ig=function(a,r){for(var i="",u=0;u<a.length;u+=1)i+=a[u],u+1<a.length&&(i+=r);return i},wg=function(r){var i=this;if(typeof i!="function"||kg.apply(i)!==Sg)throw new TypeError(Eg+i);for(var u=bg(arguments,1),l,f=function(){if(this instanceof l){var k=i.apply(this,zo(u,arguments));return Object(k)===k?k:this}return i.apply(r,zo(u,arguments))},v=xg(0,i.length-u.length),y=[],m=0;m<v;m++)y[m]="$"+m;if(l=Function("binder","return function ("+Ig(y,",")+"){ return binder.apply(this,arguments); }")(f),i.prototype){var _=function(){};_.prototype=i.prototype,l.prototype=new _,_.prototype=null}return l},Ng=wg,ps=Function.prototype.bind||Ng,Lg=Function.prototype.call,Tg=Object.prototype.hasOwnProperty,Cg=ps,Uo=Cg.call(Lg,Tg),ye,Og=hg,Rg=gg,Mg=yg,Pg=vg,Wn=Bo,Xn=cn,Ag=dg,Yo=Function,_s=function(a){try{return Yo('"use strict"; return ('+a+").constructor;")()}catch{}},wn=Object.getOwnPropertyDescriptor;if(wn)try{wn({},"")}catch{wn=null}var Es=function(){throw new Xn},Dg=wn?function(){try{return arguments.callee,Es}catch{try{return wn(arguments,"callee").get}catch{return Es}}}():Es,jn=ds(),Fg=_g(),Xe=Object.getPrototypeOf||(Fg?function(a){return a.__proto__}:null),Vn={},Gg=typeof Uint8Array>"u"||!Xe?ye:Xe(Uint8Array),Nn={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ye:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ye:ArrayBuffer,"%ArrayIteratorPrototype%":jn&&Xe?Xe([][Symbol.iterator]()):ye,"%AsyncFromSyncIteratorPrototype%":ye,"%AsyncFunction%":Vn,"%AsyncGenerator%":Vn,"%AsyncGeneratorFunction%":Vn,"%AsyncIteratorPrototype%":Vn,"%Atomics%":typeof Atomics>"u"?ye:Atomics,"%BigInt%":typeof BigInt>"u"?ye:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ye:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ye:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ye:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Og,"%eval%":eval,"%EvalError%":Rg,"%Float32Array%":typeof Float32Array>"u"?ye:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ye:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ye:FinalizationRegistry,"%Function%":Yo,"%GeneratorFunction%":Vn,"%Int8Array%":typeof Int8Array>"u"?ye:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ye:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ye:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":jn&&Xe?Xe(Xe([][Symbol.iterator]())):ye,"%JSON%":typeof JSON=="object"?JSON:ye,"%Map%":typeof Map>"u"?ye:Map,"%MapIteratorPrototype%":typeof Map>"u"||!jn||!Xe?ye:Xe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ye:Promise,"%Proxy%":typeof Proxy>"u"?ye:Proxy,"%RangeError%":Mg,"%ReferenceError%":Pg,"%Reflect%":typeof Reflect>"u"?ye:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ye:Set,"%SetIteratorPrototype%":typeof Set>"u"||!jn||!Xe?ye:Xe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ye:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":jn&&Xe?Xe(""[Symbol.iterator]()):ye,"%Symbol%":jn?Symbol:ye,"%SyntaxError%":Wn,"%ThrowTypeError%":Dg,"%TypedArray%":Gg,"%TypeError%":Xn,"%Uint8Array%":typeof Uint8Array>"u"?ye:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ye:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ye:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ye:Uint32Array,"%URIError%":Ag,"%WeakMap%":typeof WeakMap>"u"?ye:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ye:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ye:WeakSet};if(Xe)try{null.error}catch(a){var Bg=Xe(Xe(a));Nn["%Error.prototype%"]=Bg}var qg=function a(r){var i;if(r==="%AsyncFunction%")i=_s("async function () {}");else if(r==="%GeneratorFunction%")i=_s("function* () {}");else if(r==="%AsyncGeneratorFunction%")i=_s("async function* () {}");else if(r==="%AsyncGenerator%"){var u=a("%AsyncGeneratorFunction%");u&&(i=u.prototype)}else if(r==="%AsyncIteratorPrototype%"){var l=a("%AsyncGenerator%");l&&Xe&&(i=Xe(l.prototype))}return Nn[r]=i,i},Wo={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Nr=ps,ui=Uo,zg=Nr.call(Function.call,Array.prototype.concat),Ug=Nr.call(Function.apply,Array.prototype.splice),Xo=Nr.call(Function.call,String.prototype.replace),li=Nr.call(Function.call,String.prototype.slice),Yg=Nr.call(Function.call,RegExp.prototype.exec),Wg=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Xg=/\\(\\)?/g,jg=function(r){var i=li(r,0,1),u=li(r,-1);if(i==="%"&&u!=="%")throw new Wn("invalid intrinsic syntax, expected closing `%`");if(u==="%"&&i!=="%")throw new Wn("invalid intrinsic syntax, expected opening `%`");var l=[];return Xo(r,Wg,function(f,v,y,m){l[l.length]=y?Xo(m,Xg,"$1"):v||f}),l},Vg=function(r,i){var u=r,l;if(ui(Wo,u)&&(l=Wo[u],u="%"+l[0]+"%"),ui(Nn,u)){var f=Nn[u];if(f===Vn&&(f=qg(u)),typeof f>"u"&&!i)throw new Xn("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:l,name:u,value:f}}throw new Wn("intrinsic "+r+" does not exist!")},Ft=function(r,i){if(typeof r!="string"||r.length===0)throw new Xn("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof i!="boolean")throw new Xn('"allowMissing" argument must be a boolean');if(Yg(/^%?[^%]*%?$/,r)===null)throw new Wn("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var u=jg(r),l=u.length>0?u[0]:"",f=Vg("%"+l+"%",i),v=f.name,y=f.value,m=!1,_=f.alias;_&&(l=_[0],Ug(u,zg([0,1],_)));for(var k=1,p=!0;k<u.length;k+=1){var x=u[k],S=li(x,0,1),b=li(x,-1);if((S==='"'||S==="'"||S==="`"||b==='"'||b==="'"||b==="`")&&S!==b)throw new Wn("property names with quotes must have matching quotes");if((x==="constructor"||!p)&&(m=!0),l+="."+x,v="%"+l+"%",ui(Nn,v))y=Nn[v];else if(y!=null){if(!(x in y)){if(!i)throw new Xn("base intrinsic for "+r+" exists, but the property is not available.");return}if(wn&&k+1>=u.length){var L=wn(y,x);p=!!L,p&&"get"in L&&!("originalValue"in L.get)?y=L.get:y=y[x]}else p=ui(y,x),y=y[x];p&&!m&&(Nn[v]=y)}}return y},Hg=Ft,ci=Hg("%Object.defineProperty%",!0)||!1;if(ci)try{ci({},"a",{value:1})}catch{ci=!1}var ks=ci,Zg=Ft,fi=Zg("%Object.getOwnPropertyDescriptor%",!0);if(fi)try{fi([],"length")}catch{fi=null}var xs=fi,jo=ks,Qg=Bo,Hn=cn,Vo=xs,Ss=function(r,i,u){if(!r||typeof r!="object"&&typeof r!="function")throw new Hn("`obj` must be an object or a function`");if(typeof i!="string"&&typeof i!="symbol")throw new Hn("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Hn("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Hn("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Hn("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Hn("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,v=arguments.length>5?arguments[5]:null,y=arguments.length>6?arguments[6]:!1,m=!!Vo&&Vo(r,i);if(jo)jo(r,i,{configurable:v===null&&m?m.configurable:!v,enumerable:l===null&&m?m.enumerable:!l,value:u,writable:f===null&&m?m.writable:!f});else if(y||!l&&!f&&!v)r[i]=u;else throw new Qg("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},bs=ks,Ho=function(){return!!bs};Ho.hasArrayLengthDefineBug=function(){if(!bs)return null;try{return bs([],"length",{value:1}).length!==1}catch{return!0}};var Is=Ho,Kg=vs,Jg=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",$g=Object.prototype.toString,ey=Array.prototype.concat,Zo=Ss,ty=function(a){return typeof a=="function"&&$g.call(a)==="[object Function]"},Qo=Is(),ny=function(a,r,i,u){if(r in a){if(u===!0){if(a[r]===i)return}else if(!ty(u)||!u())return}Qo?Zo(a,r,i,!0):Zo(a,r,i)},Ko=function(a,r){var i=arguments.length>2?arguments[2]:{},u=Kg(r);Jg&&(u=ey.call(u,Object.getOwnPropertySymbols(r)));for(var l=0;l<u.length;l+=1)ny(a,u[l],r[u[l]],i[u[l]])};Ko.supportsDescriptors=!!Qo;var Ln=Ko,Jo={exports:{}},ry=Ft,$o=Ss,iy=Is(),eu=xs,tu=cn,sy=ry("%Math.floor%"),ay=function(r,i){if(typeof r!="function")throw new tu("`fn` is not a function");if(typeof i!="number"||i<0||i>4294967295||sy(i)!==i)throw new tu("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],l=!0,f=!0;if("length"in r&&eu){var v=eu(r,"length");v&&!v.configurable&&(l=!1),v&&!v.writable&&(f=!1)}return(l||f||!u)&&(iy?$o(r,"length",i,!0,!0):$o(r,"length",i)),r};(function(a){var r=ps,i=Ft,u=ay,l=cn,f=i("%Function.prototype.apply%"),v=i("%Function.prototype.call%"),y=i("%Reflect.apply%",!0)||r.call(v,f),m=ks,_=i("%Math.max%");a.exports=function(x){if(typeof x!="function")throw new l("a function is required");var S=y(r,v,arguments);return u(S,1+_(0,x.length-(arguments.length-1)),!0)};var k=function(){return y(r,f,arguments)};m?m(a.exports,"apply",{value:k}):a.exports.apply=k})(Jo);var Zn=Jo.exports,nu=Ft,ru=Zn,oy=ru(nu("String.prototype.indexOf")),mt=function(r,i){var u=nu(r,!!i);return typeof u=="function"&&oy(r,".prototype.")>-1?ru(u):u},uy=vs,iu=oi(),su=mt,au=Object,ly=su("Array.prototype.push"),ou=su("Object.prototype.propertyIsEnumerable"),cy=iu?Object.getOwnPropertySymbols:null,uu=function(r,i){if(r==null)throw new TypeError("target must be an object");var u=au(r);if(arguments.length===1)return u;for(var l=1;l<arguments.length;++l){var f=au(arguments[l]),v=uy(f),y=iu&&(Object.getOwnPropertySymbols||cy);if(y)for(var m=y(f),_=0;_<m.length;++_){var k=m[_];ou(f,k)&&ly(v,k)}for(var p=0;p<v.length;++p){var x=v[p];if(ou(f,x)){var S=f[x];u[x]=S}}}return u},ws=uu,fy=function(){if(!Object.assign)return!1;for(var a="abcdefghijklmnopqrst",r=a.split(""),i={},u=0;u<r.length;++u)i[r[u]]=r[u];var l=Object.assign({},i),f="";for(var v in l)f+=v;return a!==f},hy=function(){if(!Object.assign||!Object.preventExtensions)return!1;var a=Object.preventExtensions({1:2});try{Object.assign(a,"xy")}catch{return a[1]==="y"}return!1},lu=function(){return!Object.assign||fy()||hy()?ws:Object.assign},gy=Ln,yy=lu,vy=function(){var r=yy();return gy(Object,{assign:r},{assign:function(){return Object.assign!==r}}),r},dy=Ln,my=Zn,py=uu,cu=lu,_y=vy,Ey=my.apply(cu()),fu=function(r,i){return Ey(Object,arguments)};dy(fu,{getPolyfill:cu,implementation:py,shim:_y});var ky=fu,Lr=function(){return typeof(function(){}).name=="string"},Tr=Object.getOwnPropertyDescriptor;if(Tr)try{Tr([],"length")}catch{Tr=null}Lr.functionsHaveConfigurableNames=function(){if(!Lr()||!Tr)return!1;var r=Tr(function(){},"name");return!!r&&!!r.configurable};var xy=Function.prototype.bind;Lr.boundFunctionsHaveNames=function(){return Lr()&&typeof xy=="function"&&(function(){}).bind().name!==""};var Sy=Lr,hu=Ss,by=Is(),Iy=Sy.functionsHaveConfigurableNames(),wy=cn,Ny=function(r,i){if(typeof r!="function")throw new wy("`fn` is not a function");var u=arguments.length>2&&!!arguments[2];return(!u||Iy)&&(by?hu(r,"name",i,!0,!0):hu(r,"name",i)),r},Ly=Ny,Ty=cn,Cy=Object,gu=Ly(function(){if(this==null||this!==Cy(this))throw new Ty("RegExp.prototype.flags getter called on non-object");var r="";return this.hasIndices&&(r+="d"),this.global&&(r+="g"),this.ignoreCase&&(r+="i"),this.multiline&&(r+="m"),this.dotAll&&(r+="s"),this.unicode&&(r+="u"),this.unicodeSets&&(r+="v"),this.sticky&&(r+="y"),r},"get flags",!0),Oy=gu,Ry=Ln.supportsDescriptors,My=Object.getOwnPropertyDescriptor,yu=function(){if(Ry&&/a/mig.flags==="gim"){var r=My(RegExp.prototype,"flags");if(r&&typeof r.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var i="",u={};if(Object.defineProperty(u,"hasIndices",{get:function(){i+="d"}}),Object.defineProperty(u,"sticky",{get:function(){i+="y"}}),i==="dy")return r.get}}return Oy},Py=Ln.supportsDescriptors,Ay=yu,Dy=Object.getOwnPropertyDescriptor,Fy=Object.defineProperty,Gy=TypeError,vu=Object.getPrototypeOf,By=/a/,qy=function(){if(!Py||!vu)throw new Gy("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var r=Ay(),i=vu(By),u=Dy(i,"flags");return(!u||u.get!==r)&&Fy(i,"flags",{configurable:!0,enumerable:!1,get:r}),r},zy=Ln,Uy=Zn,Yy=gu,du=yu,Wy=qy,mu=Uy(du());zy(mu,{getPolyfill:du,implementation:Yy,shim:Wy});var Xy=mu,hi={exports:{}},jy=oi,Tn=function(){return jy()&&!!Symbol.toStringTag},Vy=Tn(),Hy=mt,Ns=Hy("Object.prototype.toString"),gi=function(r){return Vy&&r&&typeof r=="object"&&Symbol.toStringTag in r?!1:Ns(r)==="[object Arguments]"},pu=function(r){return gi(r)?!0:r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&Ns(r)!=="[object Array]"&&Ns(r.callee)==="[object Function]"},Zy=function(){return gi(arguments)}();gi.isLegacyArguments=pu;var _u=Zy?gi:pu;const Qy=ug(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ls=typeof Map=="function"&&Map.prototype,Ts=Object.getOwnPropertyDescriptor&&Ls?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,yi=Ls&&Ts&&typeof Ts.get=="function"?Ts.get:null,Eu=Ls&&Map.prototype.forEach,Cs=typeof Set=="function"&&Set.prototype,Os=Object.getOwnPropertyDescriptor&&Cs?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,vi=Cs&&Os&&typeof Os.get=="function"?Os.get:null,ku=Cs&&Set.prototype.forEach,Ky=typeof WeakMap=="function"&&WeakMap.prototype,Cr=Ky?WeakMap.prototype.has:null,Jy=typeof WeakSet=="function"&&WeakSet.prototype,Or=Jy?WeakSet.prototype.has:null,$y=typeof WeakRef=="function"&&WeakRef.prototype,xu=$y?WeakRef.prototype.deref:null,ev=Boolean.prototype.valueOf,tv=Object.prototype.toString,nv=Function.prototype.toString,rv=String.prototype.match,Rs=String.prototype.slice,fn=String.prototype.replace,iv=String.prototype.toUpperCase,Su=String.prototype.toLowerCase,bu=RegExp.prototype.test,Iu=Array.prototype.concat,Gt=Array.prototype.join,sv=Array.prototype.slice,wu=Math.floor,Ms=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Ps=Object.getOwnPropertySymbols,As=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Qn=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Qe=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Qn||!0)?Symbol.toStringTag:null,Nu=Object.prototype.propertyIsEnumerable,Lu=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(a){return a.__proto__}:null);function Tu(a,r){if(a===1/0||a===-1/0||a!==a||a&&a>-1e3&&a<1e3||bu.call(/e/,r))return r;var i=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof a=="number"){var u=a<0?-wu(-a):wu(a);if(u!==a){var l=String(u),f=Rs.call(r,l.length+1);return fn.call(l,i,"$&_")+"."+fn.call(fn.call(f,/([0-9]{3})/g,"$&_"),/_$/,"")}}return fn.call(r,i,"$&_")}var Ds=Qy,Cu=Ds.custom,Ou=Pu(Cu)?Cu:null,av=function a(r,i,u,l){var f=i||{};if(hn(f,"quoteStyle")&&f.quoteStyle!=="single"&&f.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(hn(f,"maxStringLength")&&(typeof f.maxStringLength=="number"?f.maxStringLength<0&&f.maxStringLength!==1/0:f.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var v=hn(f,"customInspect")?f.customInspect:!0;if(typeof v!="boolean"&&v!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(hn(f,"indent")&&f.indent!==null&&f.indent!==" "&&!(parseInt(f.indent,10)===f.indent&&f.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(hn(f,"numericSeparator")&&typeof f.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var y=f.numericSeparator;if(typeof r>"u")return"undefined";if(r===null)return"null";if(typeof r=="boolean")return r?"true":"false";if(typeof r=="string")return Du(r,f);if(typeof r=="number"){if(r===0)return 1/0/r>0?"0":"-0";var m=String(r);return y?Tu(r,m):m}if(typeof r=="bigint"){var _=String(r)+"n";return y?Tu(r,_):_}var k=typeof f.depth>"u"?5:f.depth;if(typeof u>"u"&&(u=0),u>=k&&k>0&&typeof r=="object")return Fs(r)?"[Array]":"[Object]";var p=bv(f,u);if(typeof l>"u")l=[];else if(Au(l,r)>=0)return"[Circular]";function x(oe,D,Q){if(D&&(l=sv.call(l),l.push(D)),Q){var ie={depth:f.depth};return hn(f,"quoteStyle")&&(ie.quoteStyle=f.quoteStyle),a(oe,ie,u+1,l)}return a(oe,f,u+1,l)}if(typeof r=="function"&&!Mu(r)){var S=vv(r),b=di(r,x);return"[Function"+(S?": "+S:" (anonymous)")+"]"+(b.length>0?" { "+Gt.call(b,", ")+" }":"")}if(Pu(r)){var L=Qn?fn.call(String(r),/^(Symbol\(.*\))_[^)]*$/,"$1"):As.call(r);return typeof r=="object"&&!Qn?Rr(L):L}if(kv(r)){for(var T="<"+Su.call(String(r.nodeName)),O=r.attributes||[],P=0;P<O.length;P++)T+=" "+O[P].name+"="+Ru(ov(O[P].value),"double",f);return T+=">",r.childNodes&&r.childNodes.length&&(T+="..."),T+="</"+Su.call(String(r.nodeName))+">",T}if(Fs(r)){if(r.length===0)return"[]";var R=di(r,x);return p&&!Sv(R)?"["+Bs(R,p)+"]":"[ "+Gt.call(R,", ")+" ]"}if(lv(r)){var G=di(r,x);return!("cause"in Error.prototype)&&"cause"in r&&!Nu.call(r,"cause")?"{ ["+String(r)+"] "+Gt.call(Iu.call("[cause]: "+x(r.cause),G),", ")+" }":G.length===0?"["+String(r)+"]":"{ ["+String(r)+"] "+Gt.call(G,", ")+" }"}if(typeof r=="object"&&v){if(Ou&&typeof r[Ou]=="function"&&Ds)return Ds(r,{depth:k-u});if(v!=="symbol"&&typeof r.inspect=="function")return r.inspect()}if(dv(r)){var M=[];return Eu&&Eu.call(r,function(oe,D){M.push(x(D,r,!0)+" => "+x(oe,r))}),Fu("Map",yi.call(r),M,p)}if(_v(r)){var z=[];return ku&&ku.call(r,function(oe){z.push(x(oe,r))}),Fu("Set",vi.call(r),z,p)}if(mv(r))return Gs("WeakMap");if(Ev(r))return Gs("WeakSet");if(pv(r))return Gs("WeakRef");if(fv(r))return Rr(x(Number(r)));if(gv(r))return Rr(x(Ms.call(r)));if(hv(r))return Rr(ev.call(r));if(cv(r))return Rr(x(String(r)));if(typeof window<"u"&&r===window)return"{ [object Window] }";if(typeof globalThis<"u"&&r===globalThis||typeof wr<"u"&&r===wr)return"{ [object globalThis] }";if(!uv(r)&&!Mu(r)){var q=di(r,x),U=Lu?Lu(r)===Object.prototype:r instanceof Object||r.constructor===Object,A=r instanceof Object?"":"null prototype",H=!U&&Qe&&Object(r)===r&&Qe in r?Rs.call(gn(r),8,-1):A?"Object":"",ee=U||typeof r.constructor!="function"?"":r.constructor.name?r.constructor.name+" ":"",Z=ee+(H||A?"["+Gt.call(Iu.call([],H||[],A||[]),": ")+"] ":"");return q.length===0?Z+"{}":p?Z+"{"+Bs(q,p)+"}":Z+"{ "+Gt.call(q,", ")+" }"}return String(r)};function Ru(a,r,i){var u=(i.quoteStyle||r)==="double"?'"':"'";return u+a+u}function ov(a){return fn.call(String(a),/"/g,"&quot;")}function Fs(a){return gn(a)==="[object Array]"&&(!Qe||!(typeof a=="object"&&Qe in a))}function uv(a){return gn(a)==="[object Date]"&&(!Qe||!(typeof a=="object"&&Qe in a))}function Mu(a){return gn(a)==="[object RegExp]"&&(!Qe||!(typeof a=="object"&&Qe in a))}function lv(a){return gn(a)==="[object Error]"&&(!Qe||!(typeof a=="object"&&Qe in a))}function cv(a){return gn(a)==="[object String]"&&(!Qe||!(typeof a=="object"&&Qe in a))}function fv(a){return gn(a)==="[object Number]"&&(!Qe||!(typeof a=="object"&&Qe in a))}function hv(a){return gn(a)==="[object Boolean]"&&(!Qe||!(typeof a=="object"&&Qe in a))}function Pu(a){if(Qn)return a&&typeof a=="object"&&a instanceof Symbol;if(typeof a=="symbol")return!0;if(!a||typeof a!="object"||!As)return!1;try{return As.call(a),!0}catch{}return!1}function gv(a){if(!a||typeof a!="object"||!Ms)return!1;try{return Ms.call(a),!0}catch{}return!1}var yv=Object.prototype.hasOwnProperty||function(a){return a in this};function hn(a,r){return yv.call(a,r)}function gn(a){return tv.call(a)}function vv(a){if(a.name)return a.name;var r=rv.call(nv.call(a),/^function\s*([\w$]+)/);return r?r[1]:null}function Au(a,r){if(a.indexOf)return a.indexOf(r);for(var i=0,u=a.length;i<u;i++)if(a[i]===r)return i;return-1}function dv(a){if(!yi||!a||typeof a!="object")return!1;try{yi.call(a);try{vi.call(a)}catch{return!0}return a instanceof Map}catch{}return!1}function mv(a){if(!Cr||!a||typeof a!="object")return!1;try{Cr.call(a,Cr);try{Or.call(a,Or)}catch{return!0}return a instanceof WeakMap}catch{}return!1}function pv(a){if(!xu||!a||typeof a!="object")return!1;try{return xu.call(a),!0}catch{}return!1}function _v(a){if(!vi||!a||typeof a!="object")return!1;try{vi.call(a);try{yi.call(a)}catch{return!0}return a instanceof Set}catch{}return!1}function Ev(a){if(!Or||!a||typeof a!="object")return!1;try{Or.call(a,Or);try{Cr.call(a,Cr)}catch{return!0}return a instanceof WeakSet}catch{}return!1}function kv(a){return!a||typeof a!="object"?!1:typeof HTMLElement<"u"&&a instanceof HTMLElement?!0:typeof a.nodeName=="string"&&typeof a.getAttribute=="function"}function Du(a,r){if(a.length>r.maxStringLength){var i=a.length-r.maxStringLength,u="... "+i+" more character"+(i>1?"s":"");return Du(Rs.call(a,0,r.maxStringLength),r)+u}var l=fn.call(fn.call(a,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,xv);return Ru(l,"single",r)}function xv(a){var r=a.charCodeAt(0),i={8:"b",9:"t",10:"n",12:"f",13:"r"}[r];return i?"\\"+i:"\\x"+(r<16?"0":"")+iv.call(r.toString(16))}function Rr(a){return"Object("+a+")"}function Gs(a){return a+" { ? }"}function Fu(a,r,i,u){var l=u?Bs(i,u):Gt.call(i,", ");return a+" ("+r+") {"+l+"}"}function Sv(a){for(var r=0;r<a.length;r++)if(Au(a[r],`
2
- `)>=0)return!1;return!0}function bv(a,r){var i;if(a.indent===" ")i=" ";else if(typeof a.indent=="number"&&a.indent>0)i=Gt.call(Array(a.indent+1)," ");else return null;return{base:i,prev:Gt.call(Array(r+1),i)}}function Bs(a,r){if(a.length===0)return"";var i=`
3
- `+r.prev+r.base;return i+Gt.call(a,","+i)+`
4
- `+r.prev}function di(a,r){var i=Fs(a),u=[];if(i){u.length=a.length;for(var l=0;l<a.length;l++)u[l]=hn(a,l)?r(a[l],a):""}var f=typeof Ps=="function"?Ps(a):[],v;if(Qn){v={};for(var y=0;y<f.length;y++)v["$"+f[y]]=f[y]}for(var m in a)hn(a,m)&&(i&&String(Number(m))===m&&m<a.length||Qn&&v["$"+m]instanceof Symbol||(bu.call(/[^\w$]/,m)?u.push(r(m,a)+": "+r(a[m],a)):u.push(m+": "+r(a[m],a))));if(typeof Ps=="function")for(var _=0;_<f.length;_++)Nu.call(a,f[_])&&u.push("["+r(f[_])+"]: "+r(a[f[_]],a));return u}var Gu=Ft,Kn=mt,Iv=av,wv=cn,mi=Gu("%WeakMap%",!0),pi=Gu("%Map%",!0),Nv=Kn("WeakMap.prototype.get",!0),Lv=Kn("WeakMap.prototype.set",!0),Tv=Kn("WeakMap.prototype.has",!0),Cv=Kn("Map.prototype.get",!0),Ov=Kn("Map.prototype.set",!0),Rv=Kn("Map.prototype.has",!0),qs=function(a,r){for(var i=a,u;(u=i.next)!==null;i=u)if(u.key===r)return i.next=u.next,u.next=a.next,a.next=u,u},Mv=function(a,r){var i=qs(a,r);return i&&i.value},Pv=function(a,r,i){var u=qs(a,r);u?u.value=i:a.next={key:r,next:a.next,value:i}},Av=function(a,r){return!!qs(a,r)},Bu=function(){var r,i,u,l={assert:function(f){if(!l.has(f))throw new wv("Side channel does not contain "+Iv(f))},get:function(f){if(mi&&f&&(typeof f=="object"||typeof f=="function")){if(r)return Nv(r,f)}else if(pi){if(i)return Cv(i,f)}else if(u)return Mv(u,f)},has:function(f){if(mi&&f&&(typeof f=="object"||typeof f=="function")){if(r)return Tv(r,f)}else if(pi){if(i)return Rv(i,f)}else if(u)return Av(u,f);return!1},set:function(f,v){mi&&f&&(typeof f=="object"||typeof f=="function")?(r||(r=new mi),Lv(r,f,v)):pi?(i||(i=new pi),Ov(i,f,v)):(u||(u={key:{},next:null}),Pv(u,f,v))}};return l},Dv=Uo,Mr=Bu(),Kt=cn,zs={assert:function(a,r){if(!a||typeof a!="object"&&typeof a!="function")throw new Kt("`O` is not an object");if(typeof r!="string")throw new Kt("`slot` must be a string");if(Mr.assert(a),!zs.has(a,r))throw new Kt("`"+r+"` is not present on `O`")},get:function(a,r){if(!a||typeof a!="object"&&typeof a!="function")throw new Kt("`O` is not an object");if(typeof r!="string")throw new Kt("`slot` must be a string");var i=Mr.get(a);return i&&i["$"+r]},has:function(a,r){if(!a||typeof a!="object"&&typeof a!="function")throw new Kt("`O` is not an object");if(typeof r!="string")throw new Kt("`slot` must be a string");var i=Mr.get(a);return!!i&&Dv(i,"$"+r)},set:function(a,r,i){if(!a||typeof a!="object"&&typeof a!="function")throw new Kt("`O` is not an object");if(typeof r!="string")throw new Kt("`slot` must be a string");var u=Mr.get(a);u||(u={},Mr.set(a,u)),u["$"+r]=i}};Object.freeze&&Object.freeze(zs);var Fv=zs,Pr=Fv,Gv=SyntaxError,qu=typeof StopIteration=="object"?StopIteration:null,Bv=function(r){if(!qu)throw new Gv("this environment lacks StopIteration");Pr.set(r,"[[Done]]",!1);var i={next:function(){var l=Pr.get(this,"[[Iterator]]"),f=Pr.get(l,"[[Done]]");try{return{done:f,value:f?void 0:l.next()}}catch(v){if(Pr.set(l,"[[Done]]",!0),v!==qu)throw v;return{done:!0,value:void 0}}}};return Pr.set(i,"[[Iterator]]",r),i},qv={}.toString,zu=Array.isArray||function(a){return qv.call(a)=="[object Array]"},zv=String.prototype.valueOf,Uv=function(r){try{return zv.call(r),!0}catch{return!1}},Yv=Object.prototype.toString,Wv="[object String]",Xv=Tn(),Uu=function(r){return typeof r=="string"?!0:typeof r!="object"?!1:Xv?Uv(r):Yv.call(r)===Wv},Us=typeof Map=="function"&&Map.prototype?Map:null,jv=typeof Set=="function"&&Set.prototype?Set:null,_i;Us||(_i=function(r){return!1});var Yu=Us?Map.prototype.has:null,Wu=jv?Set.prototype.has:null;!_i&&!Yu&&(_i=function(r){return!1});var Xu=_i||function(r){if(!r||typeof r!="object")return!1;try{if(Yu.call(r),Wu)try{Wu.call(r)}catch{return!0}return r instanceof Us}catch{}return!1},Vv=typeof Map=="function"&&Map.prototype?Map:null,Ys=typeof Set=="function"&&Set.prototype?Set:null,Ei;Ys||(Ei=function(r){return!1});var ju=Vv?Map.prototype.has:null,Vu=Ys?Set.prototype.has:null;!Ei&&!Vu&&(Ei=function(r){return!1});var Hu=Ei||function(r){if(!r||typeof r!="object")return!1;try{if(Vu.call(r),ju)try{ju.call(r)}catch{return!0}return r instanceof Ys}catch{}return!1},Zu=_u,Qu=Bv;if(ds()||oi()){var Ws=Symbol.iterator;hi.exports=function(r){if(r!=null&&typeof r[Ws]<"u")return r[Ws]();if(Zu(r))return Array.prototype[Ws].call(r)}}else{var Hv=zu,Zv=Uu,Ku=Ft,Qv=Ku("%Map%",!0),Kv=Ku("%Set%",!0),Tt=mt,Ju=Tt("Array.prototype.push"),$u=Tt("String.prototype.charCodeAt"),Jv=Tt("String.prototype.slice"),$v=function(r,i){var u=r.length;if(i+1>=u)return i+1;var l=$u(r,i);if(l<55296||l>56319)return i+1;var f=$u(r,i+1);return f<56320||f>57343?i+1:i+2},Xs=function(r){var i=0;return{next:function(){var l=i>=r.length,f;return l||(f=r[i],i+=1),{done:l,value:f}}}},el=function(r,i){if(Hv(r)||Zu(r))return Xs(r);if(Zv(r)){var u=0;return{next:function(){var f=$v(r,u),v=Jv(r,u,f);return u=f,{done:f>r.length,value:v}}}}if(i&&typeof r["_es6-shim iterator_"]<"u")return r["_es6-shim iterator_"]()};if(!Qv&&!Kv)hi.exports=function(r){if(r!=null)return el(r,!0)};else{var ed=Xu,td=Hu,tl=Tt("Map.prototype.forEach",!0),nl=Tt("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var rl=Tt("Map.prototype.iterator",!0),il=Tt("Set.prototype.iterator",!0);var sl=Tt("Map.prototype.@@iterator",!0)||Tt("Map.prototype._es6-shim iterator_",!0),al=Tt("Set.prototype.@@iterator",!0)||Tt("Set.prototype._es6-shim iterator_",!0),nd=function(r){if(ed(r)){if(rl)return Qu(rl(r));if(sl)return sl(r);if(tl){var i=[];return tl(r,function(l,f){Ju(i,[f,l])}),Xs(i)}}if(td(r)){if(il)return Qu(il(r));if(al)return al(r);if(nl){var u=[];return nl(r,function(l){Ju(u,l)}),Xs(u)}}};hi.exports=function(r){return nd(r)||el(r)}}}var rd=hi.exports,ol=function(a){return a!==a},ul=function(r,i){return r===0&&i===0?1/r===1/i:!!(r===i||ol(r)&&ol(i))},id=ul,ll=function(){return typeof Object.is=="function"?Object.is:id},sd=ll,ad=Ln,od=function(){var r=sd();return ad(Object,{is:r},{is:function(){return Object.is!==r}}),r},ud=Ln,ld=Zn,cd=ul,cl=ll,fd=od,fl=ld(cl(),Object);ud(fl,{getPolyfill:cl,implementation:cd,shim:fd});var hd=fl,gd=Zn,hl=mt,yd=Ft,js=yd("%ArrayBuffer%",!0),ki=hl("ArrayBuffer.prototype.byteLength",!0),vd=hl("Object.prototype.toString"),gl=!!js&&!ki&&new js(0).slice,yl=!!gl&&gd(gl),vl=ki||yl?function(r){if(!r||typeof r!="object")return!1;try{return ki?ki(r):yl(r,0),!0}catch{return!1}}:js?function(r){return vd(r)==="[object ArrayBuffer]"}:function(r){return!1},dd=Date.prototype.getDay,md=function(r){try{return dd.call(r),!0}catch{return!1}},pd=Object.prototype.toString,_d="[object Date]",Ed=Tn(),kd=function(r){return typeof r!="object"||r===null?!1:Ed?md(r):pd.call(r)===_d},Vs=mt,dl=Tn(),ml,pl,Hs,Zs;if(dl){ml=Vs("Object.prototype.hasOwnProperty"),pl=Vs("RegExp.prototype.exec"),Hs={};var Qs=function(){throw Hs};Zs={toString:Qs,valueOf:Qs},typeof Symbol.toPrimitive=="symbol"&&(Zs[Symbol.toPrimitive]=Qs)}var xd=Vs("Object.prototype.toString"),Sd=Object.getOwnPropertyDescriptor,bd="[object RegExp]",Id=dl?function(r){if(!r||typeof r!="object")return!1;var i=Sd(r,"lastIndex"),u=i&&ml(i,"value");if(!u)return!1;try{pl(r,Zs)}catch(l){return l===Hs}}:function(r){return!r||typeof r!="object"&&typeof r!="function"?!1:xd(r)===bd},wd=mt,_l=wd("SharedArrayBuffer.prototype.byteLength",!0),Nd=_l?function(r){if(!r||typeof r!="object")return!1;try{return _l(r),!0}catch{return!1}}:function(r){return!1},Ld=Number.prototype.toString,Td=function(r){try{return Ld.call(r),!0}catch{return!1}},Cd=Object.prototype.toString,Od="[object Number]",Rd=Tn(),Md=function(r){return typeof r=="number"?!0:typeof r!="object"?!1:Rd?Td(r):Cd.call(r)===Od},El=mt,Pd=El("Boolean.prototype.toString"),Ad=El("Object.prototype.toString"),Dd=function(r){try{return Pd(r),!0}catch{return!1}},Fd="[object Boolean]",Gd=Tn(),Bd=function(r){return typeof r=="boolean"?!0:r===null||typeof r!="object"?!1:Gd&&Symbol.toStringTag in r?Dd(r):Ad(r)===Fd},Ks={exports:{}},qd=Object.prototype.toString,zd=ds();if(zd){var Ud=Symbol.prototype.toString,Yd=/^Symbol\(.*\)$/,Wd=function(r){return typeof r.valueOf()!="symbol"?!1:Yd.test(Ud.call(r))};Ks.exports=function(r){if(typeof r=="symbol")return!0;if(qd.call(r)!=="[object Symbol]")return!1;try{return Wd(r)}catch{return!1}}}else Ks.exports=function(r){return!1};var Xd=Ks.exports,Js={exports:{}},kl=typeof BigInt<"u"&&BigInt,jd=function(){return typeof kl=="function"&&typeof BigInt=="function"&&typeof kl(42)=="bigint"&&typeof BigInt(42)=="bigint"},Vd=jd();if(Vd){var Hd=BigInt.prototype.valueOf,Zd=function(r){try{return Hd.call(r),!0}catch{}return!1};Js.exports=function(r){return r===null||typeof r>"u"||typeof r=="boolean"||typeof r=="string"||typeof r=="number"||typeof r=="symbol"||typeof r=="function"?!1:typeof r=="bigint"?!0:Zd(r)}}else Js.exports=function(r){return!1};var Qd=Js.exports,Kd=Uu,Jd=Md,$d=Bd,em=Xd,tm=Qd,nm=function(r){if(r==null||typeof r!="object"&&typeof r!="function")return null;if(Kd(r))return"String";if(Jd(r))return"Number";if($d(r))return"Boolean";if(em(r))return"Symbol";if(tm(r))return"BigInt"},xi=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,xl=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,Si;xi||(Si=function(r){return!1});var $s=xi?xi.prototype.has:null,ea=xl?xl.prototype.has:null;!Si&&!$s&&(Si=function(r){return!1});var rm=Si||function(r){if(!r||typeof r!="object")return!1;try{if($s.call(r,$s),ea)try{ea.call(r,ea)}catch{return!0}return r instanceof xi}catch{}return!1},ta={exports:{}},im=Ft,Sl=mt,sm=im("%WeakSet%",!0),na=Sl("WeakSet.prototype.has",!0);if(na){var ra=Sl("WeakMap.prototype.has",!0);ta.exports=function(r){if(!r||typeof r!="object")return!1;try{if(na(r,na),ra)try{ra(r,ra)}catch{return!0}return r instanceof sm}catch{}return!1}}else ta.exports=function(r){return!1};var am=ta.exports,om=Xu,um=Hu,lm=rm,cm=am,fm=function(r){if(r&&typeof r=="object"){if(om(r))return"Map";if(um(r))return"Set";if(lm(r))return"WeakMap";if(cm(r))return"WeakSet"}return!1},bl=Function.prototype.toString,Jn=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,ia,bi;if(typeof Jn=="function"&&typeof Object.defineProperty=="function")try{ia=Object.defineProperty({},"length",{get:function(){throw bi}}),bi={},Jn(function(){throw 42},null,ia)}catch(a){a!==bi&&(Jn=null)}else Jn=null;var hm=/^\s*class\b/,sa=function(r){try{var i=bl.call(r);return hm.test(i)}catch{return!1}},aa=function(r){try{return sa(r)?!1:(bl.call(r),!0)}catch{return!1}},Ii=Object.prototype.toString,gm="[object Object]",ym="[object Function]",vm="[object GeneratorFunction]",dm="[object HTMLAllCollection]",mm="[object HTML document.all class]",pm="[object HTMLCollection]",_m=typeof Symbol=="function"&&!!Symbol.toStringTag,Em=!(0 in[,]),oa=function(){return!1};if(typeof document=="object"){var km=document.all;Ii.call(km)===Ii.call(document.all)&&(oa=function(r){if((Em||!r)&&(typeof r>"u"||typeof r=="object"))try{var i=Ii.call(r);return(i===dm||i===mm||i===pm||i===gm)&&r("")==null}catch{}return!1})}var xm=Jn?function(r){if(oa(r))return!0;if(!r||typeof r!="function"&&typeof r!="object")return!1;try{Jn(r,null,ia)}catch(i){if(i!==bi)return!1}return!sa(r)&&aa(r)}:function(r){if(oa(r))return!0;if(!r||typeof r!="function"&&typeof r!="object")return!1;if(_m)return aa(r);if(sa(r))return!1;var i=Ii.call(r);return i!==ym&&i!==vm&&!/^\[object HTML/.test(i)?!1:aa(r)},Sm=xm,bm=Object.prototype.toString,Il=Object.prototype.hasOwnProperty,Im=function(r,i,u){for(var l=0,f=r.length;l<f;l++)Il.call(r,l)&&(u==null?i(r[l],l,r):i.call(u,r[l],l,r))},wm=function(r,i,u){for(var l=0,f=r.length;l<f;l++)u==null?i(r.charAt(l),l,r):i.call(u,r.charAt(l),l,r)},Nm=function(r,i,u){for(var l in r)Il.call(r,l)&&(u==null?i(r[l],l,r):i.call(u,r[l],l,r))},Lm=function(r,i,u){if(!Sm(i))throw new TypeError("iterator must be a function");var l;arguments.length>=3&&(l=u),bm.call(r)==="[object Array]"?Im(r,i,l):typeof r=="string"?wm(r,i,l):Nm(r,i,l)},Tm=Lm,Cm=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],ua=Cm,Om=typeof globalThis>"u"?wr:globalThis,Rm=function(){for(var r=[],i=0;i<ua.length;i++)typeof Om[ua[i]]=="function"&&(r[r.length]=ua[i]);return r},wi=Tm,Mm=Rm,wl=Zn,la=mt,Ni=xs,Pm=la("Object.prototype.toString"),Nl=Tn(),Ll=typeof globalThis>"u"?wr:globalThis,ca=Mm(),fa=la("String.prototype.slice"),ha=Object.getPrototypeOf,Am=la("Array.prototype.indexOf",!0)||function(r,i){for(var u=0;u<r.length;u+=1)if(r[u]===i)return u;return-1},Li={__proto__:null};Nl&&Ni&&ha?wi(ca,function(a){var r=new Ll[a];if(Symbol.toStringTag in r){var i=ha(r),u=Ni(i,Symbol.toStringTag);if(!u){var l=ha(i);u=Ni(l,Symbol.toStringTag)}Li["$"+a]=wl(u.get)}}):wi(ca,function(a){var r=new Ll[a],i=r.slice||r.set;i&&(Li["$"+a]=wl(i))});var Dm=function(r){var i=!1;return wi(Li,function(u,l){if(!i)try{"$"+u(r)===l&&(i=fa(l,1))}catch{}}),i},Fm=function(r){var i=!1;return wi(Li,function(u,l){if(!i)try{u(r),i=fa(l,1)}catch{}}),i},Gm=function(r){if(!r||typeof r!="object")return!1;if(!Nl){var i=fa(Pm(r),8,-1);return Am(ca,i)>-1?i:i!=="Object"?!1:Fm(r)}return Ni?Dm(r):null},Bm=mt,Tl=Bm("ArrayBuffer.prototype.byteLength",!0),qm=vl,zm=function(r){return qm(r)?Tl?Tl(r):r.byteLength:NaN},Cl=ky,Bt=mt,Ol=Xy,Um=Ft,$n=rd,Ym=Bu,Rl=hd,Ml=_u,Pl=zu,Al=vl,Dl=kd,Fl=Id,Gl=Nd,Bl=vs,ql=nm,zl=fm,Ul=Gm,Yl=zm,Wl=Bt("SharedArrayBuffer.prototype.byteLength",!0),Xl=Bt("Date.prototype.getTime"),ga=Object.getPrototypeOf,jl=Bt("Object.prototype.toString"),Ti=Um("%Set%",!0),ya=Bt("Map.prototype.has",!0),Ci=Bt("Map.prototype.get",!0),Vl=Bt("Map.prototype.size",!0),Oi=Bt("Set.prototype.add",!0),Hl=Bt("Set.prototype.delete",!0),Ri=Bt("Set.prototype.has",!0),Mi=Bt("Set.prototype.size",!0);function Zl(a,r,i,u){for(var l=$n(a),f;(f=l.next())&&!f.done;)if(Ct(r,f.value,i,u))return Hl(a,f.value),!0;return!1}function Ql(a){if(typeof a>"u")return null;if(typeof a!="object")return typeof a=="symbol"?!1:typeof a=="string"||typeof a=="number"?+a==+a:!0}function Wm(a,r,i,u,l,f){var v=Ql(i);if(v!=null)return v;var y=Ci(r,v),m=Cl({},l,{strict:!1});return typeof y>"u"&&!ya(r,v)||!Ct(u,y,m,f)?!1:!ya(a,v)&&Ct(u,y,m,f)}function Xm(a,r,i){var u=Ql(i);return u??(Ri(r,u)&&!Ri(a,u))}function Kl(a,r,i,u,l,f){for(var v=$n(a),y,m;(y=v.next())&&!y.done;)if(m=y.value,Ct(i,m,l,f)&&Ct(u,Ci(r,m),l,f))return Hl(a,m),!0;return!1}function Ct(a,r,i,u){var l=i||{};if(l.strict?Rl(a,r):a===r)return!0;var f=ql(a),v=ql(r);if(f!==v)return!1;if(!a||!r||typeof a!="object"&&typeof r!="object")return l.strict?Rl(a,r):a==r;var y=u.has(a),m=u.has(r),_;if(y&&m){if(u.get(a)===u.get(r))return!0}else _={};return y||u.set(a,_),m||u.set(r,_),Hm(a,r,l,u)}function Jl(a){return!a||typeof a!="object"||typeof a.length!="number"||typeof a.copy!="function"||typeof a.slice!="function"||a.length>0&&typeof a[0]!="number"?!1:!!(a.constructor&&a.constructor.isBuffer&&a.constructor.isBuffer(a))}function jm(a,r,i,u){if(Mi(a)!==Mi(r))return!1;for(var l=$n(a),f=$n(r),v,y,m;(v=l.next())&&!v.done;)if(v.value&&typeof v.value=="object")m||(m=new Ti),Oi(m,v.value);else if(!Ri(r,v.value)){if(i.strict||!Xm(a,r,v.value))return!1;m||(m=new Ti),Oi(m,v.value)}if(m){for(;(y=f.next())&&!y.done;)if(y.value&&typeof y.value=="object"){if(!Zl(m,y.value,i.strict,u))return!1}else if(!i.strict&&!Ri(a,y.value)&&!Zl(m,y.value,i.strict,u))return!1;return Mi(m)===0}return!0}function Vm(a,r,i,u){if(Vl(a)!==Vl(r))return!1;for(var l=$n(a),f=$n(r),v,y,m,_,k,p;(v=l.next())&&!v.done;)if(_=v.value[0],k=v.value[1],_&&typeof _=="object")m||(m=new Ti),Oi(m,_);else if(p=Ci(r,_),typeof p>"u"&&!ya(r,_)||!Ct(k,p,i,u)){if(i.strict||!Wm(a,r,_,k,i,u))return!1;m||(m=new Ti),Oi(m,_)}if(m){for(;(y=f.next())&&!y.done;)if(_=y.value[0],p=y.value[1],_&&typeof _=="object"){if(!Kl(m,a,_,p,i,u))return!1}else if(!i.strict&&(!a.has(_)||!Ct(Ci(a,_),p,i,u))&&!Kl(m,a,_,p,Cl({},i,{strict:!1}),u))return!1;return Mi(m)===0}return!0}function Hm(a,r,i,u){var l,f;if(typeof a!=typeof r||a==null||r==null||jl(a)!==jl(r)||Ml(a)!==Ml(r))return!1;var v=Pl(a),y=Pl(r);if(v!==y)return!1;var m=a instanceof Error,_=r instanceof Error;if(m!==_||(m||_)&&(a.name!==r.name||a.message!==r.message))return!1;var k=Fl(a),p=Fl(r);if(k!==p||(k||p)&&(a.source!==r.source||Ol(a)!==Ol(r)))return!1;var x=Dl(a),S=Dl(r);if(x!==S||(x||S)&&Xl(a)!==Xl(r)||i.strict&&ga&&ga(a)!==ga(r))return!1;var b=Ul(a),L=Ul(r);if(b!==L)return!1;if(b||L){if(a.length!==r.length)return!1;for(l=0;l<a.length;l++)if(a[l]!==r[l])return!1;return!0}var T=Jl(a),O=Jl(r);if(T!==O)return!1;if(T||O){if(a.length!==r.length)return!1;for(l=0;l<a.length;l++)if(a[l]!==r[l])return!1;return!0}var P=Al(a),R=Al(r);if(P!==R)return!1;if(P||R)return Yl(a)!==Yl(r)?!1:typeof Uint8Array=="function"&&Ct(new Uint8Array(a),new Uint8Array(r),i,u);var G=Gl(a),M=Gl(r);if(G!==M)return!1;if(G||M)return Wl(a)!==Wl(r)?!1:typeof Uint8Array=="function"&&Ct(new Uint8Array(a),new Uint8Array(r),i,u);if(typeof a!=typeof r)return!1;var z=Bl(a),q=Bl(r);if(z.length!==q.length)return!1;for(z.sort(),q.sort(),l=z.length-1;l>=0;l--)if(z[l]!=q[l])return!1;for(l=z.length-1;l>=0;l--)if(f=z[l],!Ct(a[f],r[f],i,u))return!1;var U=zl(a),A=zl(r);return U!==A?!1:U==="Set"||A==="Set"?jm(a,r,i,u):U==="Map"?Vm(a,r,i,u):!0}var Zm=function(r,i,u){return Ct(r,i,u,Ym())};const Qm=Mo(Zm);var Km=Object.defineProperty,Ee=(a,r)=>Km(a,"name",{value:r,configurable:!0}),Jm=class{constructor(r){this.direction=!1,this.compareProperties=!0;var i,u,l;this.precision=10**-((i=r==null?void 0:r.precision)!=null?i:17),this.direction=(u=r==null?void 0:r.direction)!=null?u:!1,this.compareProperties=(l=r==null?void 0:r.compareProperties)!=null?l:!0}compare(r,i){if(r.type!==i.type||!Ar(r,i))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,i.coordinates);case"LineString":return this.compareLine(r.coordinates,i.coordinates);case"Polygon":return this.comparePolygon(r,i);case"GeometryCollection":return this.compareGeometryCollection(r,i);case"Feature":return this.compareFeature(r,i);case"FeatureCollection":return this.compareFeatureCollection(r,i);default:if(r.type.startsWith("Multi")){const u=va(r),l=va(i);return u.every(f=>l.some(v=>this.compare(f,v)))}}return!1}compareCoord(r,i){return r.length===i.length&&r.every((u,l)=>Math.abs(u-i[l])<this.precision)}compareLine(r,i,u=0,l=!1){if(!Ar(r,i))return!1;const f=r;let v=i;if(l&&!this.compareCoord(f[0],v[0])){const m=this.fixStartIndex(v,f);if(m)v=m;else return!1}const y=this.compareCoord(f[u],v[u]);return this.direction||y?this.comparePath(f,v):this.compareCoord(f[u],v[v.length-(1+u)])?this.comparePath(f.slice().reverse(),v):!1}fixStartIndex(r,i){let u,l=-1;for(let f=0;f<r.length;f++)if(this.compareCoord(r[f],i[0])){l=f;break}return l>=0&&(u=[].concat(r.slice(l,r.length),r.slice(1,l+1))),u}comparePath(r,i){return r.every((u,l)=>this.compareCoord(u,i[l]))}comparePolygon(r,i){if(this.compareLine(r.coordinates[0],i.coordinates[0],1,!0)){const u=r.coordinates.slice(1,r.coordinates.length),l=i.coordinates.slice(1,i.coordinates.length);return u.every(f=>l.some(v=>this.compareLine(f,v,1,!0)))}return!1}compareGeometryCollection(r,i){return Ar(r.geometries,i.geometries)&&this.compareBBox(r,i)&&r.geometries.every((u,l)=>this.compare(u,i.geometries[l]))}compareFeature(r,i){return r.id===i.id&&(this.compareProperties?Qm(r.properties,i.properties):!0)&&this.compareBBox(r,i)&&this.compare(r.geometry,i.geometry)}compareFeatureCollection(r,i){return Ar(r.features,i.features)&&this.compareBBox(r,i)&&r.features.every((u,l)=>this.compare(u,i.features[l]))}compareBBox(r,i){return!r.bbox&&!i.bbox||(r.bbox&&i.bbox?this.compareCoord(r.bbox,i.bbox):!1)}};Ee(Jm,"GeojsonEquality");function Ar(a,r){return a.coordinates?a.coordinates.length===r.coordinates.length:a.length===r.length}Ee(Ar,"sameLength");function va(a){return a.coordinates.map(r=>({type:a.type.replace("Multi",""),coordinates:r}))}Ee(va,"explode");var it=63710088e-1,$l={centimeters:it*100,centimetres:it*100,degrees:360/(2*Math.PI),feet:it*3.28084,inches:it*39.37,kilometers:it/1e3,kilometres:it/1e3,meters:it,metres:it,miles:it/1609.344,millimeters:it*1e3,millimetres:it*1e3,nauticalmiles:it/1852,radians:1,yards:it*1.0936},ec={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Ot(a,r,i={}){const u={type:"Feature"};return(i.id===0||i.id)&&(u.id=i.id),i.bbox&&(u.bbox=i.bbox),u.properties=r||{},u.geometry=a,u}Ee(Ot,"feature");function $m(a,r,i={}){switch(a){case"Point":return qt(r).geometry;case"LineString":return Jt(r).geometry;case"Polygon":return Dr(r).geometry;case"MultiPoint":return nc(r).geometry;case"MultiLineString":return tc(r).geometry;case"MultiPolygon":return da(r).geometry;default:throw new Error(a+" is invalid")}}Ee($m,"geometry");function qt(a,r,i={}){if(!a)throw new Error("coordinates is required");if(!Array.isArray(a))throw new Error("coordinates must be an Array");if(a.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ai(a[0])||!Ai(a[1]))throw new Error("coordinates must contain numbers");return Ot({type:"Point",coordinates:a},r,i)}Ee(qt,"point");function ep(a,r,i={}){return $t(a.map(u=>qt(u,r)),i)}Ee(ep,"points");function Dr(a,r,i={}){for(const l of a){if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(l[l.length-1].length!==l[0].length)throw new Error("First and last Position are not equivalent.");for(let f=0;f<l[l.length-1].length;f++)if(l[l.length-1][f]!==l[0][f])throw new Error("First and last Position are not equivalent.")}return Ot({type:"Polygon",coordinates:a},r,i)}Ee(Dr,"polygon");function tp(a,r,i={}){return $t(a.map(u=>Dr(u,r)),i)}Ee(tp,"polygons");function Jt(a,r,i={}){if(a.length<2)throw new Error("coordinates must be an array of two or more positions");return Ot({type:"LineString",coordinates:a},r,i)}Ee(Jt,"lineString");function np(a,r,i={}){return $t(a.map(u=>Jt(u,r)),i)}Ee(np,"lineStrings");function $t(a,r={}){const i={type:"FeatureCollection"};return r.id&&(i.id=r.id),r.bbox&&(i.bbox=r.bbox),i.features=a,i}Ee($t,"featureCollection");function tc(a,r,i={}){return Ot({type:"MultiLineString",coordinates:a},r,i)}Ee(tc,"multiLineString");function nc(a,r,i={}){return Ot({type:"MultiPoint",coordinates:a},r,i)}Ee(nc,"multiPoint");function da(a,r,i={}){return Ot({type:"MultiPolygon",coordinates:a},r,i)}Ee(da,"multiPolygon");function rp(a,r,i={}){return Ot({type:"GeometryCollection",geometries:a},r,i)}Ee(rp,"geometryCollection");function ip(a,r=0){if(r&&!(r>=0))throw new Error("precision must be a positive number");const i=Math.pow(10,r||0);return Math.round(a*i)/i}Ee(ip,"round");function ma(a,r="kilometers"){const i=$l[r];if(!i)throw new Error(r+" units is invalid");return a*i}Ee(ma,"radiansToLength");function Pi(a,r="kilometers"){const i=$l[r];if(!i)throw new Error(r+" units is invalid");return a/i}Ee(Pi,"lengthToRadians");function sp(a,r){return rc(Pi(a,r))}Ee(sp,"lengthToDegrees");function ap(a){let r=a%360;return r<0&&(r+=360),r}Ee(ap,"bearingToAzimuth");function rc(a){return a%(2*Math.PI)*180/Math.PI}Ee(rc,"radiansToDegrees");function op(a){return a%360*Math.PI/180}Ee(op,"degreesToRadians");function up(a,r="kilometers",i="kilometers"){if(!(a>=0))throw new Error("length must be a positive number");return ma(Pi(a,r),i)}Ee(up,"convertLength");function lp(a,r="meters",i="kilometers"){if(!(a>=0))throw new Error("area must be a positive number");const u=ec[r];if(!u)throw new Error("invalid original units");const l=ec[i];if(!l)throw new Error("invalid final units");return a/u*l}Ee(lp,"convertArea");function Ai(a){return!isNaN(a)&&a!==null&&!Array.isArray(a)}Ee(Ai,"isNumber");function pa(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}Ee(pa,"isObject");function cp(a){if(!a)throw new Error("bbox is required");if(!Array.isArray(a))throw new Error("bbox must be an Array");if(a.length!==4&&a.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");a.forEach(r=>{if(!Ai(r))throw new Error("bbox must only contain numbers")})}Ee(cp,"validateBBox");function fp(a){if(!a)throw new Error("id is required");if(["string","number"].indexOf(typeof a)===-1)throw new Error("id must be a number or a string")}Ee(fp,"validateId");var hp=Object.defineProperty,He=(a,r)=>hp(a,"name",{value:r,configurable:!0});function er(a,r,i){if(a!==null)for(var u,l,f,v,y,m,_,k=0,p=0,x,S=a.type,b=S==="FeatureCollection",L=S==="Feature",T=b?a.features.length:1,O=0;O<T;O++){_=b?a.features[O].geometry:L?a.geometry:a,x=_?_.type==="GeometryCollection":!1,y=x?_.geometries.length:1;for(var P=0;P<y;P++){var R=0,G=0;if(v=x?_.geometries[P]:_,v!==null){m=v.coordinates;var M=v.type;switch(k=i&&(M==="Polygon"||M==="MultiPolygon")?1:0,M){case null:break;case"Point":if(r(m,p,O,R,G)===!1)return!1;p++,R++;break;case"LineString":case"MultiPoint":for(u=0;u<m.length;u++){if(r(m[u],p,O,R,G)===!1)return!1;p++,M==="MultiPoint"&&R++}M==="LineString"&&R++;break;case"Polygon":case"MultiLineString":for(u=0;u<m.length;u++){for(l=0;l<m[u].length-k;l++){if(r(m[u][l],p,O,R,G)===!1)return!1;p++}M==="MultiLineString"&&R++,M==="Polygon"&&G++}M==="Polygon"&&R++;break;case"MultiPolygon":for(u=0;u<m.length;u++){for(G=0,l=0;l<m[u].length;l++){for(f=0;f<m[u][l].length-k;f++){if(r(m[u][l][f],p,O,R,G)===!1)return!1;p++}G++}R++}break;case"GeometryCollection":for(u=0;u<v.geometries.length;u++)if(er(v.geometries[u],r,i)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}He(er,"coordEach");function gp(a,r,i,u){var l=i;return er(a,function(f,v,y,m,_){v===0&&i===void 0?l=f:l=r(l,f,v,y,m,_)},u),l}He(gp,"coordReduce");function ic(a,r){var i;switch(a.type){case"FeatureCollection":for(i=0;i<a.features.length&&r(a.features[i].properties,i)!==!1;i++);break;case"Feature":r(a.properties,0);break}}He(ic,"propEach");function yp(a,r,i){var u=i;return ic(a,function(l,f){f===0&&i===void 0?u=l:u=r(u,l,f)}),u}He(yp,"propReduce");function Di(a,r){if(a.type==="Feature")r(a,0);else if(a.type==="FeatureCollection")for(var i=0;i<a.features.length&&r(a.features[i],i)!==!1;i++);}He(Di,"featureEach");function vp(a,r,i){var u=i;return Di(a,function(l,f){f===0&&i===void 0?u=l:u=r(u,l,f)}),u}He(vp,"featureReduce");function dp(a){var r=[];return er(a,function(i){r.push(i)}),r}He(dp,"coordAll");function tr(a,r){var i,u,l,f,v,y,m,_,k,p,x=0,S=a.type==="FeatureCollection",b=a.type==="Feature",L=S?a.features.length:1;for(i=0;i<L;i++){for(y=S?a.features[i].geometry:b?a.geometry:a,_=S?a.features[i].properties:b?a.properties:{},k=S?a.features[i].bbox:b?a.bbox:void 0,p=S?a.features[i].id:b?a.id:void 0,m=y?y.type==="GeometryCollection":!1,v=m?y.geometries.length:1,l=0;l<v;l++){if(f=m?y.geometries[l]:y,f===null){if(r(null,x,_,k,p)===!1)return!1;continue}switch(f.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(r(f,x,_,k,p)===!1)return!1;break}case"GeometryCollection":{for(u=0;u<f.geometries.length;u++)if(r(f.geometries[u],x,_,k,p)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}x++}}He(tr,"geomEach");function mp(a,r,i){var u=i;return tr(a,function(l,f,v,y,m){f===0&&i===void 0?u=l:u=r(u,l,f,v,y,m)}),u}He(mp,"geomReduce");function Fi(a,r){tr(a,function(i,u,l,f,v){var y=i===null?null:i.type;switch(y){case null:case"Point":case"LineString":case"Polygon":return r(Ot(i,l,{bbox:f,id:v}),u,0)===!1?!1:void 0}var m;switch(y){case"MultiPoint":m="Point";break;case"MultiLineString":m="LineString";break;case"MultiPolygon":m="Polygon";break}for(var _=0;_<i.coordinates.length;_++){var k=i.coordinates[_],p={type:m,coordinates:k};if(r(Ot(p,l),u,_)===!1)return!1}})}He(Fi,"flattenEach");function pp(a,r,i){var u=i;return Fi(a,function(l,f,v){f===0&&v===0&&i===void 0?u=l:u=r(u,l,f,v)}),u}He(pp,"flattenReduce");function sc(a,r){Fi(a,function(i,u,l){var f=0;if(i.geometry){var v=i.geometry.type;if(!(v==="Point"||v==="MultiPoint")){var y,m=0,_=0,k=0;if(er(i,function(p,x,S,b,L){if(y===void 0||u>m||b>_||L>k){y=p,m=u,_=b,k=L,f=0;return}var T=Jt([y,p],i.properties);if(r(T,u,l,L,f)===!1)return!1;f++,y=p})===!1)return!1}}})}He(sc,"segmentEach");function _p(a,r,i){var u=i,l=!1;return sc(a,function(f,v,y,m,_){l===!1&&i===void 0?u=f:u=r(u,f,v,y,m,_),l=!0}),u}He(_p,"segmentReduce");function ac(a,r){if(!a)throw new Error("geojson is required");Fi(a,function(i,u,l){if(i.geometry!==null){var f=i.geometry.type,v=i.geometry.coordinates;switch(f){case"LineString":if(r(i,u,l,0,0)===!1)return!1;break;case"Polygon":for(var y=0;y<v.length;y++)if(r(Jt(v[y],i.properties),u,l,y)===!1)return!1;break}}})}He(ac,"lineEach");function Ep(a,r,i){var u=i;return ac(a,function(l,f,v,y){f===0&&i===void 0?u=l:u=r(u,l,f,v,y)}),u}He(Ep,"lineReduce");function kp(a,r){if(r=r||{},!pa(r))throw new Error("options is invalid");var i=r.featureIndex||0,u=r.multiFeatureIndex||0,l=r.geometryIndex||0,f=r.segmentIndex||0,v=r.properties,y;switch(a.type){case"FeatureCollection":i<0&&(i=a.features.length+i),v=v||a.features[i].properties,y=a.features[i].geometry;break;case"Feature":v=v||a.properties,y=a.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":y=a;break;default:throw new Error("geojson is invalid")}if(y===null)return null;var m=y.coordinates;switch(y.type){case"Point":case"MultiPoint":return null;case"LineString":return f<0&&(f=m.length+f-1),Jt([m[f],m[f+1]],v,r);case"Polygon":return l<0&&(l=m.length+l),f<0&&(f=m[l].length+f-1),Jt([m[l][f],m[l][f+1]],v,r);case"MultiLineString":return u<0&&(u=m.length+u),f<0&&(f=m[u].length+f-1),Jt([m[u][f],m[u][f+1]],v,r);case"MultiPolygon":return u<0&&(u=m.length+u),l<0&&(l=m[u].length+l),f<0&&(f=m[u][l].length-f-1),Jt([m[u][l][f],m[u][l][f+1]],v,r)}throw new Error("geojson is invalid")}He(kp,"findSegment");function xp(a,r){if(r=r||{},!pa(r))throw new Error("options is invalid");var i=r.featureIndex||0,u=r.multiFeatureIndex||0,l=r.geometryIndex||0,f=r.coordIndex||0,v=r.properties,y;switch(a.type){case"FeatureCollection":i<0&&(i=a.features.length+i),v=v||a.features[i].properties,y=a.features[i].geometry;break;case"Feature":v=v||a.properties,y=a.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":y=a;break;default:throw new Error("geojson is invalid")}if(y===null)return null;var m=y.coordinates;switch(y.type){case"Point":return qt(m,v,r);case"MultiPoint":return u<0&&(u=m.length+u),qt(m[u],v,r);case"LineString":return f<0&&(f=m.length+f),qt(m[f],v,r);case"Polygon":return l<0&&(l=m.length+l),f<0&&(f=m[l].length+f),qt(m[l][f],v,r);case"MultiLineString":return u<0&&(u=m.length+u),f<0&&(f=m[u].length+f),qt(m[u][f],v,r);case"MultiPolygon":return u<0&&(u=m.length+u),l<0&&(l=m[u].length+l),f<0&&(f=m[u][l].length-f),qt(m[u][l][f],v,r)}throw new Error("geojson is invalid")}He(xp,"findPoint");var Sp=Object.defineProperty,bp=(a,r)=>Sp(a,"name",{value:r,configurable:!0});function oc(a,r={}){if(a.bbox!=null&&r.recompute!==!0)return a.bbox;const i=[1/0,1/0,-1/0,-1/0];return er(a,u=>{i[0]>u[0]&&(i[0]=u[0]),i[1]>u[1]&&(i[1]=u[1]),i[2]<u[0]&&(i[2]=u[0]),i[3]<u[1]&&(i[3]=u[1])}),i}bp(oc,"bbox");var Ip=Object.defineProperty,wp=(a,r)=>Ip(a,"name",{value:r,configurable:!0});function uc(a,r={}){const i=oc(a),u=(i[0]+i[2])/2,l=(i[1]+i[3])/2;return qt([u,l],r.properties,r)}wp(uc,"center");var lc={exports:{}};(function(a,r){(function(i,u){a.exports=u()})(wr,function(){function i(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function u(o,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(o,n.key,n)}}function l(o,e,t){return e&&u(o.prototype,e),t&&u(o,t),o}function f(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),e&&y(o,e)}function v(o){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(o)}function y(o,e){return y=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t},y(o,e)}function m(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _(o,e,t){return _=m()?Reflect.construct:function(n,s,c){var h=[null];h.push.apply(h,s);var g=new(Function.bind.apply(n,h));return c&&y(g,c.prototype),g},_.apply(null,arguments)}function k(o){var e=typeof Map=="function"?new Map:void 0;return k=function(t){if(t===null||(n=t,Function.toString.call(n).indexOf("[native code]")===-1))return t;var n;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(t))return e.get(t);e.set(t,s)}function s(){return _(t,arguments,v(this).constructor)}return s.prototype=Object.create(t.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),y(s,t)},k(o)}function p(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function x(o,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return p(o)}function S(o){var e=m();return function(){var t,n=v(o);if(e){var s=v(this).constructor;t=Reflect.construct(n,arguments,s)}else t=n.apply(this,arguments);return x(this,t)}}function b(o,e,t){return b=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(n,s,c){var h=function(d,E){for(;!Object.prototype.hasOwnProperty.call(d,E)&&(d=v(d))!==null;);return d}(n,s);if(h){var g=Object.getOwnPropertyDescriptor(h,s);return g.get?g.get.call(c):g.value}},b(o,e,t||o)}function L(o){return function(e){if(Array.isArray(e))return O(e)}(o)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(o)||T(o)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
5
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function T(o,e){if(o){if(typeof o=="string")return O(o,e);var t=Object.prototype.toString.call(o).slice(8,-1);return t==="Object"&&o.constructor&&(t=o.constructor.name),t==="Map"||t==="Set"?Array.from(o):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?O(o,e):void 0}}function O(o,e){(e==null||e>o.length)&&(e=o.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=o[t];return n}function P(o,e){var t=typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(!t){if(Array.isArray(o)||(t=T(o))||e){t&&(o=t);var n=0,s=function(){};return{s,n:function(){return n>=o.length?{done:!0}:{done:!1,value:o[n++]}},e:function(d){throw d},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
6
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,h=!0,g=!1;return{s:function(){t=t.call(o)},n:function(){var d=t.next();return h=d.done,d},e:function(d){g=!0,c=d},f:function(){try{h||t.return==null||t.return()}finally{if(g)throw c}}}}var R=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"getEndCapStyle",value:function(){return this._endCapStyle}},{key:"isSingleSided",value:function(){return this._isSingleSided}},{key:"setQuadrantSegments",value:function(e){this._quadrantSegments=e,this._quadrantSegments===0&&(this._joinStyle=o.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=o.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),e<=0&&(this._quadrantSegments=1),this._joinStyle!==o.JOIN_ROUND&&(this._quadrantSegments=o.DEFAULT_QUADRANT_SEGMENTS)}},{key:"getJoinStyle",value:function(){return this._joinStyle}},{key:"setJoinStyle",value:function(e){this._joinStyle=e}},{key:"setSimplifyFactor",value:function(e){this._simplifyFactor=e<0?0:e}},{key:"getSimplifyFactor",value:function(){return this._simplifyFactor}},{key:"getQuadrantSegments",value:function(){return this._quadrantSegments}},{key:"setEndCapStyle",value:function(e){this._endCapStyle=e}},{key:"getMitreLimit",value:function(){return this._mitreLimit}},{key:"setMitreLimit",value:function(e){this._mitreLimit=e}},{key:"setSingleSided",value:function(e){this._isSingleSided=e}}],[{key:"constructor_",value:function(){if(this._quadrantSegments=o.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=o.CAP_ROUND,this._joinStyle=o.JOIN_ROUND,this._mitreLimit=o.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=o.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setQuadrantSegments(e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.setQuadrantSegments(t),this.setEndCapStyle(n)}else if(arguments.length===4){var s=arguments[0],c=arguments[1],h=arguments[2],g=arguments[3];this.setQuadrantSegments(s),this.setEndCapStyle(c),this.setJoinStyle(h),this.setMitreLimit(g)}}}},{key:"bufferDistanceError",value:function(e){var t=Math.PI/2/e;return 1-Math.cos(t/2)}}]),o}();R.CAP_ROUND=1,R.CAP_FLAT=2,R.CAP_SQUARE=3,R.JOIN_ROUND=1,R.JOIN_MITRE=2,R.JOIN_BEVEL=3,R.DEFAULT_QUADRANT_SEGMENTS=8,R.DEFAULT_MITRE_LIMIT=5,R.DEFAULT_SIMPLIFY_FACTOR=.01;var G=function(o){f(t,o);var e=S(t);function t(n){var s;return i(this,t),(s=e.call(this,n)).name=Object.keys({Exception:t})[0],s}return l(t,[{key:"toString",value:function(){return this.message}}]),t}(k(Error)),M=function(o){f(t,o);var e=S(t);function t(n){var s;return i(this,t),(s=e.call(this,n)).name=Object.keys({IllegalArgumentException:t})[0],s}return t}(G),z=function(){function o(){i(this,o)}return l(o,[{key:"filter",value:function(e){}}]),o}();function q(){}function U(){}function A(){}var H,ee,Z,oe,D,Q,ie,me,Ge=function(){function o(){i(this,o)}return l(o,null,[{key:"equalsWithTolerance",value:function(e,t,n){return Math.abs(e-t)<=n}}]),o}(),we=function(){function o(e,t){i(this,o),this.low=t||0,this.high=e||0}return l(o,null,[{key:"toBinaryString",value:function(e){var t,n="";for(t=2147483648;t>0;t>>>=1)n+=(e.high&t)===t?"1":"0";for(t=2147483648;t>0;t>>>=1)n+=(e.low&t)===t?"1":"0";return n}}]),o}();function K(){}function ze(){}K.NaN=NaN,K.isNaN=function(o){return Number.isNaN(o)},K.isInfinite=function(o){return!Number.isFinite(o)},K.MAX_VALUE=Number.MAX_VALUE,K.POSITIVE_INFINITY=Number.POSITIVE_INFINITY,K.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY,typeof Float64Array=="function"&&typeof Int32Array=="function"?(Q=2146435072,ie=new Float64Array(1),me=new Int32Array(ie.buffer),K.doubleToLongBits=function(o){ie[0]=o;var e=0|me[0],t=0|me[1];return(t&Q)===Q&&1048575&t&&e!==0&&(e=0,t=2146959360),new we(t,e)},K.longBitsToDouble=function(o){return me[0]=o.low,me[1]=o.high,ie[0]}):(H=1023,ee=Math.log2,Z=Math.floor,oe=Math.pow,D=function(){for(var o=53;o>0;o--){var e=oe(2,o)-1;if(Z(ee(e))+1===o)return e}return 0}(),K.doubleToLongBits=function(o){var e,t,n,s,c,h,g,d,E;if(o<0||1/o===Number.NEGATIVE_INFINITY?(h=1<<31,o=-o):h=0,o===0)return new we(d=h,E=0);if(o===1/0)return new we(d=2146435072|h,E=0);if(o!=o)return new we(d=2146959360,E=0);if(s=0,E=0,(e=Z(o))>1)if(e<=D)(s=Z(ee(e)))<=20?(E=0,d=e<<20-s&1048575):(E=e%(t=oe(2,n=s-20))<<32-n,d=e/t&1048575);else for(n=e,E=0;(n=Z(t=n/2))!==0;)s++,E>>>=1,E|=(1&d)<<31,d>>>=1,t!==n&&(d|=524288);if(g=s+H,c=e===0,e=o-e,s<52&&e!==0)for(n=0;;){if((t=2*e)>=1?(e=t-1,c?(g--,c=!1):(n<<=1,n|=1,s++)):(e=t,c?--g==0&&(s++,c=!1):(n<<=1,s++)),s===20)d|=n,n=0;else if(s===52){E|=n;break}if(t===1){s<20?d|=n<<20-s:s<52&&(E|=n<<52-s);break}}return d|=g<<20,new we(d|=h,E)},K.longBitsToDouble=function(o){var e,t,n,s,c=o.high,h=o.low,g=c&1<<31?-1:1;for(n=((2146435072&c)>>20)-H,s=0,t=1<<19,e=1;e<=20;e++)c&t&&(s+=oe(2,-e)),t>>>=1;for(t=1<<31,e=21;e<=52;e++)h&t&&(s+=oe(2,-e)),t>>>=1;if(n===-1023){if(s===0)return 0*g;n=-1022}else{if(n===1024)return s===0?g/0:NaN;s+=1}return g*s*oe(2,n)});var Le=function(o){f(t,o);var e=S(t);function t(n){var s;return i(this,t),(s=e.call(this,n)).name=Object.keys({RuntimeException:t})[0],s}return t}(G),Ve=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,null,[{key:"constructor_",value:function(){if(arguments.length===0)Le.constructor_.call(this);else if(arguments.length===1){var n=arguments[0];Le.constructor_.call(this,n)}}}]),t}(Le),he=function(){function o(){i(this,o)}return l(o,null,[{key:"shouldNeverReachHere",value:function(){if(arguments.length===0)o.shouldNeverReachHere(null);else if(arguments.length===1){var e=arguments[0];throw new Ve("Should never reach here"+(e!==null?": "+e:""))}}},{key:"isTrue",value:function(){if(arguments.length===1){var e=arguments[0];o.isTrue(e,null)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(!t)throw n===null?new Ve:new Ve(n)}}},{key:"equals",value:function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];o.equals(e,t,null)}else if(arguments.length===3){var n=arguments[0],s=arguments[1],c=arguments[2];if(!s.equals(n))throw new Ve("Expected "+n+" but encountered "+s+(c!==null?": "+c:""))}}}]),o}(),kt=new ArrayBuffer(8),Wr=new Float64Array(kt),Ji=new Int32Array(kt),C=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"getM",value:function(){return K.NaN}},{key:"setOrdinate",value:function(e,t){switch(e){case o.X:this.x=t;break;case o.Y:this.y=t;break;case o.Z:this.setZ(t);break;default:throw new M("Invalid ordinate index: "+e)}}},{key:"equals2D",value:function(){if(arguments.length===1){var e=arguments[0];return this.x===e.x&&this.y===e.y}if(arguments.length===2){var t=arguments[0],n=arguments[1];return!!Ge.equalsWithTolerance(this.x,t.x,n)&&!!Ge.equalsWithTolerance(this.y,t.y,n)}}},{key:"setM",value:function(e){throw new M("Invalid ordinate index: "+o.M)}},{key:"getZ",value:function(){return this.z}},{key:"getOrdinate",value:function(e){switch(e){case o.X:return this.x;case o.Y:return this.y;case o.Z:return this.getZ()}throw new M("Invalid ordinate index: "+e)}},{key:"equals3D",value:function(e){return this.x===e.x&&this.y===e.y&&(this.getZ()===e.getZ()||K.isNaN(this.getZ())&&K.isNaN(e.getZ()))}},{key:"equals",value:function(e){return e instanceof o&&this.equals2D(e)}},{key:"equalInZ",value:function(e,t){return Ge.equalsWithTolerance(this.getZ(),e.getZ(),t)}},{key:"setX",value:function(e){this.x=e}},{key:"compareTo",value:function(e){var t=e;return this.x<t.x?-1:this.x>t.x?1:this.y<t.y?-1:this.y>t.y?1:0}},{key:"getX",value:function(){return this.x}},{key:"setZ",value:function(e){this.z=e}},{key:"clone",value:function(){try{return null}catch(e){if(e instanceof CloneNotSupportedException)return he.shouldNeverReachHere("this shouldn't happen because this class is Cloneable"),null;throw e}}},{key:"copy",value:function(){return new o(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+", "+this.getZ()+")"}},{key:"distance3D",value:function(e){var t=this.x-e.x,n=this.y-e.y,s=this.getZ()-e.getZ();return Math.sqrt(t*t+n*n+s*s)}},{key:"getY",value:function(){return this.y}},{key:"setY",value:function(e){this.y=e}},{key:"distance",value:function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)}},{key:"hashCode",value:function(){var e=17;return e=37*(e=37*e+o.hashCode(this.x))+o.hashCode(this.y)}},{key:"setCoordinate",value:function(e){this.x=e.x,this.y=e.y,this.z=e.getZ()}},{key:"interfaces_",get:function(){return[q,U,A]}}],[{key:"constructor_",value:function(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)o.constructor_.call(this,0,0);else if(arguments.length===1){var e=arguments[0];o.constructor_.call(this,e.x,e.y,e.getZ())}else if(arguments.length===2){var t=arguments[0],n=arguments[1];o.constructor_.call(this,t,n,o.NULL_ORDINATE)}else if(arguments.length===3){var s=arguments[0],c=arguments[1],h=arguments[2];this.x=s,this.y=c,this.z=h}}},{key:"hashCode",value:function(e){return Wr[0]=e,Ji[0]^Ji[1]}}]),o}(),$i=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"compare",value:function(e,t){var n=o.compare(e.x,t.x);if(n!==0)return n;var s=o.compare(e.y,t.y);return s!==0?s:this._dimensionsToTest<=2?0:o.compare(e.getZ(),t.getZ())}},{key:"interfaces_",get:function(){return[ze]}}],[{key:"constructor_",value:function(){if(this._dimensionsToTest=2,arguments.length===0)o.constructor_.call(this,2);else if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new M("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}},{key:"compare",value:function(e,t){return e<t?-1:e>t?1:K.isNaN(e)?K.isNaN(t)?0:-1:K.isNaN(t)?1:0}}]),o}();C.DimensionalComparator=$i,C.NULL_ORDINATE=K.NaN,C.X=0,C.Y=1,C.Z=2,C.M=3;var Se=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"getArea",value:function(){return this.getWidth()*this.getHeight()}},{key:"equals",value:function(e){if(!(e instanceof o))return!1;var t=e;return this.isNull()?t.isNull():this._maxx===t.getMaxX()&&this._maxy===t.getMaxY()&&this._minx===t.getMinX()&&this._miny===t.getMinY()}},{key:"intersection",value:function(e){if(this.isNull()||e.isNull()||!this.intersects(e))return new o;var t=this._minx>e._minx?this._minx:e._minx,n=this._miny>e._miny?this._miny:e._miny;return new o(t,this._maxx<e._maxx?this._maxx:e._maxx,n,this._maxy<e._maxy?this._maxy:e._maxy)}},{key:"isNull",value:function(){return this._maxx<this._minx}},{key:"getMaxX",value:function(){return this._maxx}},{key:"covers",value:function(){if(arguments.length===1){if(arguments[0]instanceof C){var e=arguments[0];return this.covers(e.x,e.y)}if(arguments[0]instanceof o){var t=arguments[0];return!this.isNull()&&!t.isNull()&&t.getMinX()>=this._minx&&t.getMaxX()<=this._maxx&&t.getMinY()>=this._miny&&t.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],s=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&s>=this._miny&&s<=this._maxy}}},{key:"intersects",value:function(){if(arguments.length===1){if(arguments[0]instanceof o){var e=arguments[0];return!this.isNull()&&!e.isNull()&&!(e._minx>this._maxx||e._maxx<this._minx||e._miny>this._maxy||e._maxy<this._miny)}if(arguments[0]instanceof C){var t=arguments[0];return this.intersects(t.x,t.y)}}else if(arguments.length===2){if(arguments[0]instanceof C&&arguments[1]instanceof C){var n=arguments[0],s=arguments[1];if(this.isNull())return!1;var c=n.x<s.x?n.x:s.x;if(c>this._maxx)return!1;var h=n.x>s.x?n.x:s.x;if(h<this._minx)return!1;var g=n.y<s.y?n.y:s.y;if(g>this._maxy)return!1;var d=n.y>s.y?n.y:s.y;return!(d<this._miny)}if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var E=arguments[0],w=arguments[1];return!this.isNull()&&!(E>this._maxx||E<this._minx||w>this._maxy||w<this._miny)}}}},{key:"getMinY",value:function(){return this._miny}},{key:"getDiameter",value:function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return Math.sqrt(e*e+t*t)}},{key:"getMinX",value:function(){return this._minx}},{key:"expandToInclude",value:function(){if(arguments.length===1){if(arguments[0]instanceof C){var e=arguments[0];this.expandToInclude(e.x,e.y)}else if(arguments[0]instanceof o){var t=arguments[0];if(t.isNull())return null;this.isNull()?(this._minx=t.getMinX(),this._maxx=t.getMaxX(),this._miny=t.getMinY(),this._maxy=t.getMaxY()):(t._minx<this._minx&&(this._minx=t._minx),t._maxx>this._maxx&&(this._maxx=t._maxx),t._miny<this._miny&&(this._miny=t._miny),t._maxy>this._maxy&&(this._maxy=t._maxy))}}else if(arguments.length===2){var n=arguments[0],s=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=s,this._maxy=s):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),s<this._miny&&(this._miny=s),s>this._maxy&&(this._maxy=s))}}},{key:"minExtent",value:function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e<t?e:t}},{key:"getWidth",value:function(){return this.isNull()?0:this._maxx-this._minx}},{key:"compareTo",value:function(e){var t=e;return this.isNull()?t.isNull()?0:-1:t.isNull()?1:this._minx<t._minx?-1:this._minx>t._minx?1:this._miny<t._miny?-1:this._miny>t._miny?1:this._maxx<t._maxx?-1:this._maxx>t._maxx?1:this._maxy<t._maxy?-1:this._maxy>t._maxy?1:0}},{key:"translate",value:function(e,t){if(this.isNull())return null;this.init(this.getMinX()+e,this.getMaxX()+e,this.getMinY()+t,this.getMaxY()+t)}},{key:"copy",value:function(){return new o(this)}},{key:"toString",value:function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"}},{key:"setToNull",value:function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1}},{key:"disjoint",value:function(e){return!(!this.isNull()&&!e.isNull())||e._minx>this._maxx||e._maxx<this._minx||e._miny>this._maxy||e._maxy<this._miny}},{key:"getHeight",value:function(){return this.isNull()?0:this._maxy-this._miny}},{key:"maxExtent",value:function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e>t?e:t}},{key:"expandBy",value:function(){if(arguments.length===1){var e=arguments[0];this.expandBy(e,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=t,this._maxx+=t,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}}},{key:"contains",value:function(){if(arguments.length===1){if(arguments[0]instanceof o){var e=arguments[0];return this.covers(e)}if(arguments[0]instanceof C){var t=arguments[0];return this.covers(t)}}else if(arguments.length===2){var n=arguments[0],s=arguments[1];return this.covers(n,s)}}},{key:"centre",value:function(){return this.isNull()?null:new C((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)}},{key:"init",value:function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof C){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof o){var t=arguments[0];this._minx=t._minx,this._maxx=t._maxx,this._miny=t._miny,this._maxy=t._maxy}}else if(arguments.length===2){var n=arguments[0],s=arguments[1];this.init(n.x,s.x,n.y,s.y)}else if(arguments.length===4){var c=arguments[0],h=arguments[1],g=arguments[2],d=arguments[3];c<h?(this._minx=c,this._maxx=h):(this._minx=h,this._maxx=c),g<d?(this._miny=g,this._maxy=d):(this._miny=d,this._maxy=g)}}},{key:"getMaxY",value:function(){return this._maxy}},{key:"distance",value:function(e){if(this.intersects(e))return 0;var t=0;this._maxx<e._minx?t=e._minx-this._maxx:this._minx>e._maxx&&(t=this._minx-e._maxx);var n=0;return this._maxy<e._miny?n=e._miny-this._maxy:this._miny>e._maxy&&(n=this._miny-e._maxy),t===0?n:n===0?t:Math.sqrt(t*t+n*n)}},{key:"hashCode",value:function(){var e=17;return e=37*(e=37*(e=37*(e=37*e+C.hashCode(this._minx))+C.hashCode(this._maxx))+C.hashCode(this._miny))+C.hashCode(this._maxy)}},{key:"interfaces_",get:function(){return[q,A]}}],[{key:"constructor_",value:function(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof C){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof o){var t=arguments[0];this.init(t)}}else if(arguments.length===2){var n=arguments[0],s=arguments[1];this.init(n.x,s.x,n.y,s.y)}else if(arguments.length===4){var c=arguments[0],h=arguments[1],g=arguments[2],d=arguments[3];this.init(c,h,g,d)}}},{key:"intersects",value:function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],n=arguments[2];return n.x>=(e.x<t.x?e.x:t.x)&&n.x<=(e.x>t.x?e.x:t.x)&&n.y>=(e.y<t.y?e.y:t.y)&&n.y<=(e.y>t.y?e.y:t.y)}if(arguments.length===4){var s=arguments[0],c=arguments[1],h=arguments[2],g=arguments[3],d=Math.min(h.x,g.x),E=Math.max(h.x,g.x),w=Math.min(s.x,c.x),N=Math.max(s.x,c.x);return!(w>E)&&!(N<d)&&(d=Math.min(h.y,g.y),E=Math.max(h.y,g.y),w=Math.min(s.y,c.y),N=Math.max(s.y,c.y),!(w>E)&&!(N<d))}}}]),o}(),J=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"isGeometryCollection",value:function(){return this.getTypeCode()===o.TYPECODE_GEOMETRYCOLLECTION}},{key:"getFactory",value:function(){return this._factory}},{key:"getGeometryN",value:function(e){return this}},{key:"getArea",value:function(){return 0}},{key:"isRectangle",value:function(){return!1}},{key:"equalsExact",value:function(e){return this===e||this.equalsExact(e,0)}},{key:"geometryChanged",value:function(){this.apply(o.geometryChangedFilter)}},{key:"geometryChangedAction",value:function(){this._envelope=null}},{key:"equalsNorm",value:function(e){return e!==null&&this.norm().equalsExact(e.norm())}},{key:"getLength",value:function(){return 0}},{key:"getNumGeometries",value:function(){return 1}},{key:"compareTo",value:function(){var e;if(arguments.length===1){var t=arguments[0];return e=t,this.getTypeCode()!==e.getTypeCode()?this.getTypeCode()-e.getTypeCode():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}if(arguments.length===2){var n=arguments[0],s=arguments[1];return e=n,this.getTypeCode()!==e.getTypeCode()?this.getTypeCode()-e.getTypeCode():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(n,s)}}},{key:"getUserData",value:function(){return this._userData}},{key:"getSRID",value:function(){return this._SRID}},{key:"getEnvelope",value:function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())}},{key:"checkNotGeometryCollection",value:function(e){if(e.getTypeCode()===o.TYPECODE_GEOMETRYCOLLECTION)throw new M("This method does not support GeometryCollection arguments")}},{key:"equal",value:function(e,t,n){return n===0?e.equals(t):e.distance(t)<=n}},{key:"norm",value:function(){var e=this.copy();return e.normalize(),e}},{key:"reverse",value:function(){var e=this.reverseInternal();return this.envelope!=null&&(e.envelope=this.envelope.copy()),e.setSRID(this.getSRID()),e}},{key:"copy",value:function(){var e=this.copyInternal();return e.envelope=this._envelope==null?null:this._envelope.copy(),e._SRID=this._SRID,e._userData=this._userData,e}},{key:"getPrecisionModel",value:function(){return this._factory.getPrecisionModel()}},{key:"getEnvelopeInternal",value:function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new Se(this._envelope)}},{key:"setSRID",value:function(e){this._SRID=e}},{key:"setUserData",value:function(e){this._userData=e}},{key:"compare",value:function(e,t){for(var n=e.iterator(),s=t.iterator();n.hasNext()&&s.hasNext();){var c=n.next(),h=s.next(),g=c.compareTo(h);if(g!==0)return g}return n.hasNext()?1:s.hasNext()?-1:0}},{key:"hashCode",value:function(){return this.getEnvelopeInternal().hashCode()}},{key:"isEquivalentClass",value:function(e){return this.getClass()===e.getClass()}},{key:"isGeometryCollectionOrDerived",value:function(){return this.getTypeCode()===o.TYPECODE_GEOMETRYCOLLECTION||this.getTypeCode()===o.TYPECODE_MULTIPOINT||this.getTypeCode()===o.TYPECODE_MULTILINESTRING||this.getTypeCode()===o.TYPECODE_MULTIPOLYGON}},{key:"interfaces_",get:function(){return[U,q,A]}},{key:"getClass",value:function(){return o}}],[{key:"hasNonEmptyElements",value:function(e){for(var t=0;t<e.length;t++)if(!e[t].isEmpty())return!0;return!1}},{key:"hasNullElements",value:function(e){for(var t=0;t<e.length;t++)if(e[t]===null)return!0;return!1}}]),o}();J.constructor_=function(o){o&&(this._envelope=null,this._userData=null,this._factory=o,this._SRID=o.getSRID())},J.TYPECODE_POINT=0,J.TYPECODE_MULTIPOINT=1,J.TYPECODE_LINESTRING=2,J.TYPECODE_LINEARRING=3,J.TYPECODE_MULTILINESTRING=4,J.TYPECODE_POLYGON=5,J.TYPECODE_MULTIPOLYGON=6,J.TYPECODE_GEOMETRYCOLLECTION=7,J.TYPENAME_POINT="Point",J.TYPENAME_MULTIPOINT="MultiPoint",J.TYPENAME_LINESTRING="LineString",J.TYPENAME_LINEARRING="LinearRing",J.TYPENAME_MULTILINESTRING="MultiLineString",J.TYPENAME_POLYGON="Polygon",J.TYPENAME_MULTIPOLYGON="MultiPolygon",J.TYPENAME_GEOMETRYCOLLECTION="GeometryCollection",J.geometryChangedFilter={get interfaces_(){return[z]},filter:function(o){o.geometryChangedAction()}};var I=function(){function o(){i(this,o)}return l(o,null,[{key:"toLocationSymbol",value:function(e){switch(e){case o.EXTERIOR:return"e";case o.BOUNDARY:return"b";case o.INTERIOR:return"i";case o.NONE:return"-"}throw new M("Unknown location value: "+e)}}]),o}();I.INTERIOR=0,I.BOUNDARY=1,I.EXTERIOR=2,I.NONE=-1;var ce=function(){function o(){i(this,o)}return l(o,[{key:"add",value:function(){}},{key:"addAll",value:function(){}},{key:"isEmpty",value:function(){}},{key:"iterator",value:function(){}},{key:"size",value:function(){}},{key:"toArray",value:function(){}},{key:"remove",value:function(){}}]),o}(),Te=function(o){f(t,o);var e=S(t);function t(n){var s;return i(this,t),(s=e.call(this,n)).name=Object.keys({NoSuchElementException:t})[0],s}return t}(G),ue=function(o){f(t,o);var e=S(t);function t(n){var s;return i(this,t),(s=e.call(this,n)).name=Object.keys({UnsupportedOperationException:t})[0],s}return t}(G),Xr=function(o){f(t,o);var e=S(t);function t(){return i(this,t),e.apply(this,arguments)}return l(t,[{key:"contains",value:function(){}}]),t}(ce),st=function(o,e){f(n,o);var t=S(n);function n(s){var c;return i(this,n),(c=t.call(this)).map=new Map,s instanceof ce&&c.addAll(s),c}return l(n,[{key:"contains",value:function(s){var c=s.hashCode?s.hashCode():s;return!!this.map.has(c)}},{key:"add",value:function(s){var c=s.hashCode?s.hashCode():s;return!this.map.has(c)&&!!this.map.set(c,s)}},{key:"addAll",value:function(s){var c,h=P(s);try{for(h.s();!(c=h.n()).done;){var g=c.value;this.add(g)}}catch(d){h.e(d)}finally{h.f()}return!0}},{key:"remove",value:function(){throw new ue}},{key:"size",value:function(){return this.map.size}},{key:"isEmpty",value:function(){return this.map.size===0}},{key:"toArray",value:function(){return Array.from(this.map.values())}},{key:"iterator",value:function(){return new Ne(this.map)}},{key:e,value:function(){return this.map}}]),n}(Xr,Symbol.iterator),Ne=function(){function o(e){i(this,o),this.iterator=e.values();var t=this.iterator.next(),n=t.done,s=t.value;this.done=n,this.value=s}return l(o,[{key:"next",value:function(){if(this.done)throw new Te;var e=this.value,t=this.iterator.next(),n=t.done,s=t.value;return this.done=n,this.value=s,e}},{key:"hasNext",value:function(){return!this.done}},{key:"remove",value:function(){throw new ue}}]),o}(),W=function(){function o(){i(this,o)}return l(o,null,[{key:"opposite",value:function(e){return e===o.LEFT?o.RIGHT:e===o.RIGHT?o.LEFT:e}}]),o}();W.ON=0,W.LEFT=1,W.RIGHT=2;var Rn=function(o){f(t,o);var e=S(t);function t(n){var s;return i(this,t),(s=e.call(this,n)).name=Object.keys({EmptyStackException:t})[0],s}return t}(G),Yt=function(o){f(t,o);var e=S(t);function t(n){var s;return i(this,t),(s=e.call(this,n)).name=Object.keys({IndexOutOfBoundsException:t})[0],s}return t}(G),at=function(o){f(t,o);var e=S(t);function t(){return i(this,t),e.apply(this,arguments)}return l(t,[{key:"get",value:function(){}},{key:"set",value:function(){}},{key:"isEmpty",value:function(){}}]),t}(ce),ur=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),(n=e.call(this)).array=[],n}return l(t,[{key:"add",value:function(n){return this.array.push(n),!0}},{key:"get",value:function(n){if(n<0||n>=this.size())throw new Yt;return this.array[n]}},{key:"push",value:function(n){return this.array.push(n),n}},{key:"pop",value:function(){if(this.array.length===0)throw new Rn;return this.array.pop()}},{key:"peek",value:function(){if(this.array.length===0)throw new Rn;return this.array[this.array.length-1]}},{key:"empty",value:function(){return this.array.length===0}},{key:"isEmpty",value:function(){return this.empty()}},{key:"search",value:function(n){return this.array.indexOf(n)}},{key:"size",value:function(){return this.array.length}},{key:"toArray",value:function(){return this.array.slice()}}]),t}(at);function le(o,e){return o.interfaces_&&o.interfaces_.indexOf(e)>-1}var Mn=function(){function o(e){i(this,o),this.str=e}return l(o,[{key:"append",value:function(e){this.str+=e}},{key:"setCharAt",value:function(e,t){this.str=this.str.substr(0,e)+t+this.str.substr(e+1)}},{key:"toString",value:function(){return this.str}}]),o}(),lt=function(){function o(e){i(this,o),this.value=e}return l(o,[{key:"intValue",value:function(){return this.value}},{key:"compareTo",value:function(e){return this.value<e?-1:this.value>e?1:0}}],[{key:"compare",value:function(e,t){return e<t?-1:e>t?1:0}},{key:"isNan",value:function(e){return Number.isNaN(e)}},{key:"valueOf",value:function(e){return new o(e)}}]),o}(),lr=function(){function o(){i(this,o)}return l(o,null,[{key:"isWhitespace",value:function(e){return e<=32&&e>=0||e===127}},{key:"toUpperCase",value:function(e){return e.toUpperCase()}}]),o}(),te=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"le",value:function(e){return this._hi<e._hi||this._hi===e._hi&&this._lo<=e._lo}},{key:"extractSignificantDigits",value:function(e,t){var n=this.abs(),s=o.magnitude(n._hi),c=o.TEN.pow(s);(n=n.divide(c)).gt(o.TEN)?(n=n.divide(o.TEN),s+=1):n.lt(o.ONE)&&(n=n.multiply(o.TEN),s-=1);for(var h=s+1,g=new Mn,d=o.MAX_PRINT_DIGITS-1,E=0;E<=d;E++){e&&E===h&&g.append(".");var w=Math.trunc(n._hi);if(w<0)break;var N=!1,F=0;w>9?(N=!0,F="9"):F="0"+w,g.append(F),n=n.subtract(o.valueOf(w)).multiply(o.TEN),N&&n.selfAdd(o.TEN);var j=!0,X=o.magnitude(n._hi);if(X<0&&Math.abs(X)>=d-E&&(j=!1),!j)break}return t[0]=s,g.toString()}},{key:"sqr",value:function(){return this.multiply(this)}},{key:"doubleValue",value:function(){return this._hi+this._lo}},{key:"subtract",value:function(){if(arguments[0]instanceof o){var e=arguments[0];return this.add(e.negate())}if(typeof arguments[0]=="number"){var t=arguments[0];return this.add(-t)}}},{key:"equals",value:function(){if(arguments.length===1&&arguments[0]instanceof o){var e=arguments[0];return this._hi===e._hi&&this._lo===e._lo}}},{key:"isZero",value:function(){return this._hi===0&&this._lo===0}},{key:"selfSubtract",value:function(){if(arguments[0]instanceof o){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e._hi,-e._lo)}if(typeof arguments[0]=="number"){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t,0)}}},{key:"getSpecialNumberString",value:function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null}},{key:"min",value:function(e){return this.le(e)?this:e}},{key:"selfDivide",value:function(){if(arguments.length===1){if(arguments[0]instanceof o){var e=arguments[0];return this.selfDivide(e._hi,e._lo)}if(typeof arguments[0]=="number"){var t=arguments[0];return this.selfDivide(t,0)}}else if(arguments.length===2){var n=arguments[0],s=arguments[1],c=null,h=null,g=null,d=null,E=null,w=null,N=null,F=null;return E=this._hi/n,F=(c=(w=o.SPLIT*E)-(c=w-E))*(g=(F=o.SPLIT*n)-(g=F-n))-(N=E*n)+c*(d=n-g)+(h=E-c)*g+h*d,F=E+(w=(this._hi-N-F+this._lo-E*s)/n),this._hi=F,this._lo=E-F+w,this}}},{key:"dump",value:function(){return"DD<"+this._hi+", "+this._lo+">"}},{key:"divide",value:function(){if(arguments[0]instanceof o){var e=arguments[0],t=null,n=null,s=null,c=null,h=null,g=null,d=null,E=null;n=(h=this._hi/e._hi)-(t=(g=o.SPLIT*h)-(t=g-h)),E=t*(s=(E=o.SPLIT*e._hi)-(s=E-e._hi))-(d=h*e._hi)+t*(c=e._hi-s)+n*s+n*c;var w=E=h+(g=(this._hi-d-E+this._lo-h*e._lo)/e._hi),N=h-E+g;return new o(w,N)}if(typeof arguments[0]=="number"){var F=arguments[0];return K.isNaN(F)?o.createNaN():o.copy(this).selfDivide(F,0)}}},{key:"ge",value:function(e){return this._hi>e._hi||this._hi===e._hi&&this._lo>=e._lo}},{key:"pow",value:function(e){if(e===0)return o.valueOf(1);var t=new o(this),n=o.valueOf(1),s=Math.abs(e);if(s>1)for(;s>0;)s%2==1&&n.selfMultiply(t),(s/=2)>0&&(t=t.sqr());else n=t;return e<0?n.reciprocal():n}},{key:"ceil",value:function(){if(this.isNaN())return o.NaN;var e=Math.ceil(this._hi),t=0;return e===this._hi&&(t=Math.ceil(this._lo)),new o(e,t)}},{key:"compareTo",value:function(e){var t=e;return this._hi<t._hi?-1:this._hi>t._hi?1:this._lo<t._lo?-1:this._lo>t._lo?1:0}},{key:"rint",value:function(){return this.isNaN()?this:this.add(.5).floor()}},{key:"setValue",value:function(){if(arguments[0]instanceof o){var e=arguments[0];return this.init(e),this}if(typeof arguments[0]=="number"){var t=arguments[0];return this.init(t),this}}},{key:"max",value:function(e){return this.ge(e)?this:e}},{key:"sqrt",value:function(){if(this.isZero())return o.valueOf(0);if(this.isNegative())return o.NaN;var e=1/Math.sqrt(this._hi),t=this._hi*e,n=o.valueOf(t),s=this.subtract(n.sqr())._hi*(.5*e);return n.add(s)}},{key:"selfAdd",value:function(){if(arguments.length===1){if(arguments[0]instanceof o){var e=arguments[0];return this.selfAdd(e._hi,e._lo)}if(typeof arguments[0]=="number"){var t=arguments[0],n=null,s=null,c=null,h=null,g=null,d=null;return h=(c=this._hi+t)-(g=c-this._hi),s=(d=(h=t-g+(this._hi-h))+this._lo)+(c-(n=c+d)),this._hi=n+s,this._lo=s+(n-this._hi),this}}else if(arguments.length===2){var E=arguments[0],w=arguments[1],N=null,F=null,j=null,X=null,$=null,re=null,fe=null;X=this._hi+E,F=this._lo+w,$=X-(re=X-this._hi),j=F-(fe=F-this._lo);var ke=(N=X+(re=($=E-re+(this._hi-$))+F))+(re=(j=w-fe+(this._lo-j))+(re+(X-N))),Be=re+(N-ke);return this._hi=ke,this._lo=Be,this}}},{key:"selfMultiply",value:function(){if(arguments.length===1){if(arguments[0]instanceof o){var e=arguments[0];return this.selfMultiply(e._hi,e._lo)}if(typeof arguments[0]=="number"){var t=arguments[0];return this.selfMultiply(t,0)}}else if(arguments.length===2){var n=arguments[0],s=arguments[1],c=null,h=null,g=null,d=null,E=null,w=null;c=(E=o.SPLIT*this._hi)-this._hi,w=o.SPLIT*n,c=E-c,h=this._hi-c,g=w-n;var N=(E=this._hi*n)+(w=c*(g=w-g)-E+c*(d=n-g)+h*g+h*d+(this._hi*s+this._lo*n)),F=w+(c=E-N);return this._hi=N,this._lo=F,this}}},{key:"selfSqr",value:function(){return this.selfMultiply(this)}},{key:"floor",value:function(){if(this.isNaN())return o.NaN;var e=Math.floor(this._hi),t=0;return e===this._hi&&(t=Math.floor(this._lo)),new o(e,t)}},{key:"negate",value:function(){return this.isNaN()?this:new o(-this._hi,-this._lo)}},{key:"clone",value:function(){try{return null}catch(e){if(e instanceof CloneNotSupportedException)return null;throw e}}},{key:"multiply",value:function(){if(arguments[0]instanceof o){var e=arguments[0];return e.isNaN()?o.createNaN():o.copy(this).selfMultiply(e)}if(typeof arguments[0]=="number"){var t=arguments[0];return K.isNaN(t)?o.createNaN():o.copy(this).selfMultiply(t,0)}}},{key:"isNaN",value:function(){return K.isNaN(this._hi)}},{key:"intValue",value:function(){return Math.trunc(this._hi)}},{key:"toString",value:function(){var e=o.magnitude(this._hi);return e>=-3&&e<=20?this.toStandardNotation():this.toSciNotation()}},{key:"toStandardNotation",value:function(){var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),n=this.extractSignificantDigits(!0,t),s=t[0]+1,c=n;if(n.charAt(0)===".")c="0"+n;else if(s<0)c="0."+o.stringOfChar("0",-s)+n;else if(n.indexOf(".")===-1){var h=s-n.length;c=n+o.stringOfChar("0",h)+".0"}return this.isNegative()?"-"+c:c}},{key:"reciprocal",value:function(){var e,t,n,s,c=null,h=null,g=null,d=null;e=(n=1/this._hi)-(c=(g=o.SPLIT*n)-(c=g-n)),h=(d=o.SPLIT*this._hi)-this._hi;var E=n+(g=(1-(s=n*this._hi)-(d=c*(h=d-h)-s+c*(t=this._hi-h)+e*h+e*t)-n*this._lo)/this._hi);return new o(E,n-E+g)}},{key:"toSciNotation",value:function(){if(this.isZero())return o.SCI_NOT_ZERO;var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),n=this.extractSignificantDigits(!1,t),s=o.SCI_NOT_EXPONENT_CHAR+t[0];if(n.charAt(0)==="0")throw new IllegalStateException("Found leading zero: "+n);var c="";n.length>1&&(c=n.substring(1));var h=n.charAt(0)+"."+c;return this.isNegative()?"-"+h+s:h+s}},{key:"abs",value:function(){return this.isNaN()?o.NaN:this.isNegative()?this.negate():new o(this)}},{key:"isPositive",value:function(){return this._hi>0||this._hi===0&&this._lo>0}},{key:"lt",value:function(e){return this._hi<e._hi||this._hi===e._hi&&this._lo<e._lo}},{key:"add",value:function(){if(arguments[0]instanceof o){var e=arguments[0];return o.copy(this).selfAdd(e)}if(typeof arguments[0]=="number"){var t=arguments[0];return o.copy(this).selfAdd(t)}}},{key:"init",value:function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var e=arguments[0];this._hi=e,this._lo=0}else if(arguments[0]instanceof o){var t=arguments[0];this._hi=t._hi,this._lo=t._lo}}else if(arguments.length===2){var n=arguments[0],s=arguments[1];this._hi=n,this._lo=s}}},{key:"gt",value:function(e){return this._hi>e._hi||this._hi===e._hi&&this._lo>e._lo}},{key:"isNegative",value:function(){return this._hi<0||this._hi===0&&this._lo<0}},{key:"trunc",value:function(){return this.isNaN()?o.NaN:this.isPositive()?this.floor():this.ceil()}},{key:"signum",value:function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0}},{key:"interfaces_",get:function(){return[A,q,U]}}],[{key:"constructor_",value:function(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof o){var t=arguments[0];this.init(t)}else if(typeof arguments[0]=="string"){var n=arguments[0];o.constructor_.call(this,o.parse(n))}}else if(arguments.length===2){var s=arguments[0],c=arguments[1];this.init(s,c)}}},{key:"determinant",value:function(){if(typeof arguments[3]=="number"&&typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1],n=arguments[2],s=arguments[3];return o.determinant(o.valueOf(e),o.valueOf(t),o.valueOf(n),o.valueOf(s))}if(arguments[3]instanceof o&&arguments[2]instanceof o&&arguments[0]instanceof o&&arguments[1]instanceof o){var c=arguments[0],h=arguments[1],g=arguments[2],d=arguments[3],E=c.multiply(d).selfSubtract(h.multiply(g));return E}}},{key:"sqr",value:function(e){return o.valueOf(e).selfMultiply(e)}},{key:"valueOf",value:function(){if(typeof arguments[0]=="string"){var e=arguments[0];return o.parse(e)}if(typeof arguments[0]=="number"){var t=arguments[0];return new o(t)}}},{key:"sqrt",value:function(e){return o.valueOf(e).sqrt()}},{key:"parse",value:function(e){for(var t=0,n=e.length;lr.isWhitespace(e.charAt(t));)t++;var s=!1;if(t<n){var c=e.charAt(t);c!=="-"&&c!=="+"||(t++,c==="-"&&(s=!0))}for(var h=new o,g=0,d=0,E=0,w=!1;!(t>=n);){var N=e.charAt(t);if(t++,lr.isDigit(N)){var F=N-"0";h.selfMultiply(o.TEN),h.selfAdd(F),g++}else{if(N!=="."){if(N==="e"||N==="E"){var j=e.substring(t);try{E=lt.parseInt(j)}catch(ke){throw ke instanceof NumberFormatException?new NumberFormatException("Invalid exponent "+j+" in string "+e):ke}break}throw new NumberFormatException("Unexpected character '"+N+"' at position "+t+" in string "+e)}d=g,w=!0}}var X=h;w||(d=g);var $=g-d-E;if($===0)X=h;else if($>0){var re=o.TEN.pow($);X=h.divide(re)}else if($<0){var fe=o.TEN.pow(-$);X=h.multiply(fe)}return s?X.negate():X}},{key:"createNaN",value:function(){return new o(K.NaN,K.NaN)}},{key:"copy",value:function(e){return new o(e)}},{key:"magnitude",value:function(e){var t=Math.abs(e),n=Math.log(t)/Math.log(10),s=Math.trunc(Math.floor(n));return 10*Math.pow(10,s)<=t&&(s+=1),s}},{key:"stringOfChar",value:function(e,t){for(var n=new Mn,s=0;s<t;s++)n.append(e);return n.toString()}}]),o}();te.PI=new te(3.141592653589793,12246467991473532e-32),te.TWO_PI=new te(6.283185307179586,24492935982947064e-32),te.PI_2=new te(1.5707963267948966,6123233995736766e-32),te.E=new te(2.718281828459045,14456468917292502e-32),te.NaN=new te(K.NaN,K.NaN),te.EPS=123259516440783e-46,te.SPLIT=134217729,te.MAX_PRINT_DIGITS=32,te.TEN=te.valueOf(10),te.ONE=te.valueOf(1),te.SCI_NOT_EXPONENT_CHAR="E",te.SCI_NOT_ZERO="0.0E0";var Pn=function(){function o(){i(this,o)}return l(o,null,[{key:"orientationIndex",value:function(e,t,n){var s=o.orientationIndexFilter(e,t,n);if(s<=1)return s;var c=te.valueOf(t.x).selfAdd(-e.x),h=te.valueOf(t.y).selfAdd(-e.y),g=te.valueOf(n.x).selfAdd(-t.x),d=te.valueOf(n.y).selfAdd(-t.y);return c.selfMultiply(d).selfSubtract(h.selfMultiply(g)).signum()}},{key:"signOfDet2x2",value:function(){if(arguments[3]instanceof te&&arguments[2]instanceof te&&arguments[0]instanceof te&&arguments[1]instanceof te){var e=arguments[0],t=arguments[1],n=arguments[2],s=arguments[3],c=e.multiply(s).selfSubtract(t.multiply(n));return c.signum()}if(typeof arguments[3]=="number"&&typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var h=arguments[0],g=arguments[1],d=arguments[2],E=arguments[3],w=te.valueOf(h),N=te.valueOf(g),F=te.valueOf(d),j=te.valueOf(E),X=w.multiply(j).selfSubtract(N.multiply(F));return X.signum()}}},{key:"intersection",value:function(e,t,n,s){var c=new te(e.y).selfSubtract(t.y),h=new te(t.x).selfSubtract(e.x),g=new te(e.x).selfMultiply(t.y).selfSubtract(new te(t.x).selfMultiply(e.y)),d=new te(n.y).selfSubtract(s.y),E=new te(s.x).selfSubtract(n.x),w=new te(n.x).selfMultiply(s.y).selfSubtract(new te(s.x).selfMultiply(n.y)),N=h.multiply(w).selfSubtract(E.multiply(g)),F=d.multiply(g).selfSubtract(c.multiply(w)),j=c.multiply(E).selfSubtract(d.multiply(h)),X=N.selfDivide(j).doubleValue(),$=F.selfDivide(j).doubleValue();return K.isNaN(X)||K.isInfinite(X)||K.isNaN($)||K.isInfinite($)?null:new C(X,$)}},{key:"orientationIndexFilter",value:function(e,t,n){var s=null,c=(e.x-n.x)*(t.y-n.y),h=(e.y-n.y)*(t.x-n.x),g=c-h;if(c>0){if(h<=0)return o.signum(g);s=c+h}else{if(!(c<0)||h>=0)return o.signum(g);s=-c-h}var d=o.DP_SAFE_EPSILON*s;return g>=d||-g>=d?o.signum(g):2}},{key:"signum",value:function(e){return e>0?1:e<0?-1:0}}]),o}();Pn.DP_SAFE_EPSILON=1e-15;var ve=function(){function o(){i(this,o)}return l(o,[{key:"getM",value:function(e){if(this.hasM()){var t=this.getDimension()-this.getMeasures();return this.getOrdinate(e,t)}return K.NaN}},{key:"setOrdinate",value:function(e,t,n){}},{key:"getZ",value:function(e){return this.hasZ()?this.getOrdinate(e,2):K.NaN}},{key:"size",value:function(){}},{key:"getOrdinate",value:function(e,t){}},{key:"getCoordinate",value:function(){}},{key:"getCoordinateCopy",value:function(e){}},{key:"createCoordinate",value:function(){}},{key:"getDimension",value:function(){}},{key:"hasM",value:function(){return this.getMeasures()>0}},{key:"getX",value:function(e){}},{key:"hasZ",value:function(){return this.getDimension()-this.getMeasures()>2}},{key:"getMeasures",value:function(){return 0}},{key:"expandEnvelope",value:function(e){}},{key:"copy",value:function(){}},{key:"getY",value:function(e){}},{key:"toCoordinateArray",value:function(){}},{key:"interfaces_",get:function(){return[U]}}]),o}();ve.X=0,ve.Y=1,ve.Z=2,ve.M=3;var ae=function(){function o(){i(this,o)}return l(o,null,[{key:"index",value:function(e,t,n){return Pn.orientationIndex(e,t,n)}},{key:"isCCW",value:function(){if(arguments[0]instanceof Array){var e=arguments[0],t=e.length-1;if(t<3)throw new M("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=e[0],s=0,c=1;c<=t;c++){var h=e[c];h.y>n.y&&(n=h,s=c)}var g=s;do(g-=1)<0&&(g=t);while(e[g].equals2D(n)&&g!==s);var d=s;do d=(d+1)%t;while(e[d].equals2D(n)&&d!==s);var E=e[g],w=e[d];if(E.equals2D(n)||w.equals2D(n)||E.equals2D(w))return!1;var N=o.index(E,n,w),F=null;return F=N===0?E.x>w.x:N>0,F}if(le(arguments[0],ve)){var j=arguments[0],X=j.size()-1;if(X<3)throw new M("Ring has fewer than 4 points, so orientation cannot be determined");for(var $=j.getCoordinate(0),re=0,fe=1;fe<=X;fe++){var ke=j.getCoordinate(fe);ke.y>$.y&&($=ke,re=fe)}var Be=null,Je=re;do(Je-=1)<0&&(Je=X),Be=j.getCoordinate(Je);while(Be.equals2D($)&&Je!==re);var yt=null,At=re;do At=(At+1)%X,yt=j.getCoordinate(At);while(yt.equals2D($)&&At!==re);if(Be.equals2D($)||yt.equals2D($)||Be.equals2D(yt))return!1;var sn=o.index(Be,$,yt);return sn===0?Be.x>yt.x:sn>0}}}]),o}();ae.CLOCKWISE=-1,ae.RIGHT=ae.CLOCKWISE,ae.COUNTERCLOCKWISE=1,ae.LEFT=ae.COUNTERCLOCKWISE,ae.COLLINEAR=0,ae.STRAIGHT=ae.COLLINEAR;var Fa=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"getCoordinate",value:function(){return this._minCoord}},{key:"getRightmostSide",value:function(e,t){var n=this.getRightmostSideOfSegment(e,t);return n<0&&(n=this.getRightmostSideOfSegment(e,t-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(e)),n}},{key:"findRightmostEdgeAtVertex",value:function(){var e=this._minDe.getEdge().getCoordinates();he.isTrue(this._minIndex>0&&this._minIndex<e.length,"rightmost point expected to be interior vertex of edge");var t=e[this._minIndex-1],n=e[this._minIndex+1],s=ae.index(this._minCoord,n,t),c=!1;(t.y<this._minCoord.y&&n.y<this._minCoord.y&&s===ae.COUNTERCLOCKWISE||t.y>this._minCoord.y&&n.y>this._minCoord.y&&s===ae.CLOCKWISE)&&(c=!0),c&&(this._minIndex=this._minIndex-1)}},{key:"getRightmostSideOfSegment",value:function(e,t){var n=e.getEdge().getCoordinates();if(t<0||t+1>=n.length||n[t].y===n[t+1].y)return-1;var s=W.LEFT;return n[t].y<n[t+1].y&&(s=W.RIGHT),s}},{key:"getEdge",value:function(){return this._orientedDe}},{key:"checkForRightmostCoordinate",value:function(e){for(var t=e.getEdge().getCoordinates(),n=0;n<t.length-1;n++)(this._minCoord===null||t[n].x>this._minCoord.x)&&(this._minDe=e,this._minIndex=n,this._minCoord=t[n])}},{key:"findRightmostEdgeAtNode",value:function(){var e=this._minDe.getNode().getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)}},{key:"findEdge",value:function(e){for(var t=e.iterator();t.hasNext();){var n=t.next();n.isForward()&&this.checkForRightmostCoordinate(n)}he.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===W.LEFT&&(this._orientedDe=this._minDe.getSym())}}],[{key:"constructor_",value:function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null}}]),o}(),ct=function(o){f(t,o);var e=S(t);function t(n,s){var c;return i(this,t),(c=e.call(this,s?n+" [ "+s+" ]":n)).pt=s?new C(s):void 0,c.name=Object.keys({TopologyException:t})[0],c}return l(t,[{key:"getCoordinate",value:function(){return this.pt}}]),t}(Le),jr=function(){function o(){i(this,o),this.array=[]}return l(o,[{key:"addLast",value:function(e){this.array.push(e)}},{key:"removeFirst",value:function(){return this.array.shift()}},{key:"isEmpty",value:function(){return this.array.length===0}}]),o}(),ne=function(o,e){f(n,o);var t=S(n);function n(s){var c;return i(this,n),(c=t.call(this)).array=[],s instanceof ce&&c.addAll(s),c}return l(n,[{key:"interfaces_",get:function(){return[at,ce]}},{key:"ensureCapacity",value:function(){}},{key:"add",value:function(s){return arguments.length===1?this.array.push(s):this.array.splice(arguments[0],0,arguments[1]),!0}},{key:"clear",value:function(){this.array=[]}},{key:"addAll",value:function(s){var c,h=P(s);try{for(h.s();!(c=h.n()).done;){var g=c.value;this.array.push(g)}}catch(d){h.e(d)}finally{h.f()}}},{key:"set",value:function(s,c){var h=this.array[s];return this.array[s]=c,h}},{key:"iterator",value:function(){return new Ga(this)}},{key:"get",value:function(s){if(s<0||s>=this.size())throw new Yt;return this.array[s]}},{key:"isEmpty",value:function(){return this.array.length===0}},{key:"sort",value:function(s){s?this.array.sort(function(c,h){return s.compare(c,h)}):this.array.sort()}},{key:"size",value:function(){return this.array.length}},{key:"toArray",value:function(){return this.array.slice()}},{key:"remove",value:function(s){for(var c=0,h=this.array.length;c<h;c++)if(this.array[c]===s)return!!this.array.splice(c,1);return!1}},{key:e,value:function(){return this.array.values()}}]),n}(at,Symbol.iterator),Ga=function(){function o(e){i(this,o),this.arrayList=e,this.position=0}return l(o,[{key:"next",value:function(){if(this.position===this.arrayList.size())throw new Te;return this.arrayList.get(this.position++)}},{key:"hasNext",value:function(){return this.position<this.arrayList.size()}},{key:"set",value:function(e){return this.arrayList.set(this.position-1,e)}},{key:"remove",value:function(){this.arrayList.remove(this.arrayList.get(this.position))}}]),o}(),Ba=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"clearVisitedEdges",value:function(){for(var e=this._dirEdgeList.iterator();e.hasNext();)e.next().setVisited(!1)}},{key:"getRightmostCoordinate",value:function(){return this._rightMostCoord}},{key:"computeNodeDepth",value:function(e){for(var t=null,n=e.getEdges().iterator();n.hasNext();){var s=n.next();if(s.isVisited()||s.getSym().isVisited()){t=s;break}}if(t===null)throw new ct("unable to find edge to compute depths at "+e.getCoordinate());e.getEdges().computeDepths(t);for(var c=e.getEdges().iterator();c.hasNext();){var h=c.next();h.setVisited(!0),this.copySymDepths(h)}}},{key:"computeDepth",value:function(e){this.clearVisitedEdges();var t=this._finder.getEdge();t.getNode(),t.getLabel(),t.setEdgeDepths(W.RIGHT,e),this.copySymDepths(t),this.computeDepths(t)}},{key:"create",value:function(e){this.addReachable(e),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()}},{key:"findResultEdges",value:function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.getDepth(W.RIGHT)>=1&&t.getDepth(W.LEFT)<=0&&!t.isInteriorAreaEdge()&&t.setInResult(!0)}}},{key:"computeDepths",value:function(e){var t=new st,n=new jr,s=e.getNode();for(n.addLast(s),t.add(s),e.setVisited(!0);!n.isEmpty();){var c=n.removeFirst();t.add(c),this.computeNodeDepth(c);for(var h=c.getEdges().iterator();h.hasNext();){var g=h.next().getSym();if(!g.isVisited()){var d=g.getNode();t.contains(d)||(n.addLast(d),t.add(d))}}}}},{key:"compareTo",value:function(e){var t=e;return this._rightMostCoord.x<t._rightMostCoord.x?-1:this._rightMostCoord.x>t._rightMostCoord.x?1:0}},{key:"getEnvelope",value:function(){if(this._env===null){for(var e=new Se,t=this._dirEdgeList.iterator();t.hasNext();)for(var n=t.next().getEdge().getCoordinates(),s=0;s<n.length-1;s++)e.expandToInclude(n[s]);this._env=e}return this._env}},{key:"addReachable",value:function(e){var t=new ur;for(t.add(e);!t.empty();){var n=t.pop();this.add(n,t)}}},{key:"copySymDepths",value:function(e){var t=e.getSym();t.setDepth(W.LEFT,e.getDepth(W.RIGHT)),t.setDepth(W.RIGHT,e.getDepth(W.LEFT))}},{key:"add",value:function(e,t){e.setVisited(!0),this._nodes.add(e);for(var n=e.getEdges().iterator();n.hasNext();){var s=n.next();this._dirEdgeList.add(s);var c=s.getSym().getNode();c.isVisited()||t.push(c)}}},{key:"getNodes",value:function(){return this._nodes}},{key:"getDirectedEdges",value:function(){return this._dirEdgeList}},{key:"interfaces_",get:function(){return[q]}}],[{key:"constructor_",value:function(){this._finder=null,this._dirEdgeList=new ne,this._nodes=new ne,this._rightMostCoord=null,this._env=null,this._finder=new Fa}}]),o}(),Vr=function(){function o(){i(this,o)}return l(o,null,[{key:"intersection",value:function(e,t,n,s){var c=e.x<t.x?e.x:t.x,h=e.y<t.y?e.y:t.y,g=e.x>t.x?e.x:t.x,d=e.y>t.y?e.y:t.y,E=n.x<s.x?n.x:s.x,w=n.y<s.y?n.y:s.y,N=n.x>s.x?n.x:s.x,F=n.y>s.y?n.y:s.y,j=((c>E?c:E)+(g<N?g:N))/2,X=((h>w?h:w)+(d<F?d:F))/2,$=e.x-j,re=e.y-X,fe=t.x-j,ke=t.y-X,Be=n.x-j,Je=n.y-X,yt=s.x-j,At=s.y-X,sn=re-ke,qn=fe-$,ei=$*ke-fe*re,ti=Je-At,Er=yt-Be,Hf=Be*At-yt*Je,Zf=sn*Er-ti*qn,to=(qn*Hf-Er*ei)/Zf,no=(ti*ei-sn*Hf)/Zf;return K.isNaN(to)||K.isInfinite(to)||K.isNaN(no)||K.isInfinite(no)?null:new C(to+j,no+X)}}]),o}(),ot=function(){function o(){i(this,o)}return l(o,null,[{key:"arraycopy",value:function(e,t,n,s,c){for(var h=0,g=t;g<t+c;g++)n[s+h]=e[g],h++}},{key:"getProperty",value:function(e){return{"line.separator":`
7
- `}[e]}}]),o}(),An=function(){function o(){i(this,o)}return l(o,null,[{key:"log10",value:function(e){var t=Math.log(e);return K.isInfinite(t)||K.isNaN(t)?t:t/o.LOG_10}},{key:"min",value:function(e,t,n,s){var c=e;return t<c&&(c=t),n<c&&(c=n),s<c&&(c=s),c}},{key:"clamp",value:function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1],n=arguments[2];return e<t?t:e>n?n:e}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var s=arguments[0],c=arguments[1],h=arguments[2];return s<c?c:s>h?h:s}}},{key:"wrap",value:function(e,t){return e<0?t- -e%t:e%t}},{key:"max",value:function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],n=arguments[2],s=e;return t>s&&(s=t),n>s&&(s=n),s}if(arguments.length===4){var c=arguments[0],h=arguments[1],g=arguments[2],d=arguments[3],E=c;return h>E&&(E=h),g>E&&(E=g),d>E&&(E=d),E}}},{key:"average",value:function(e,t){return(e+t)/2}}]),o}();An.LOG_10=Math.log(10);var xt=function(){function o(){i(this,o)}return l(o,null,[{key:"segmentToSegment",value:function(e,t,n,s){if(e.equals(t))return o.pointToSegment(e,n,s);if(n.equals(s))return o.pointToSegment(s,e,t);var c=!1;if(Se.intersects(e,t,n,s)){var h=(t.x-e.x)*(s.y-n.y)-(t.y-e.y)*(s.x-n.x);if(h===0)c=!0;else{var g=(e.y-n.y)*(s.x-n.x)-(e.x-n.x)*(s.y-n.y),d=((e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y))/h,E=g/h;(E<0||E>1||d<0||d>1)&&(c=!0)}}else c=!0;return c?An.min(o.pointToSegment(e,n,s),o.pointToSegment(t,n,s),o.pointToSegment(n,e,t),o.pointToSegment(s,e,t)):0}},{key:"pointToSegment",value:function(e,t,n){if(t.x===n.x&&t.y===n.y)return e.distance(t);var s=(n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y),c=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/s;if(c<=0)return e.distance(t);if(c>=1)return e.distance(n);var h=((t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y))/s;return Math.abs(h)*Math.sqrt(s)}},{key:"pointToLinePerpendicular",value:function(e,t,n){var s=(n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y),c=((t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y))/s;return Math.abs(c)*Math.sqrt(s)}},{key:"pointToSegmentString",value:function(e,t){if(t.length===0)throw new M("Line array must contain at least one vertex");for(var n=e.distance(t[0]),s=0;s<t.length-1;s++){var c=o.pointToSegment(e,t[s],t[s+1]);c<n&&(n=c)}return n}}]),o}(),es=function(){function o(){i(this,o)}return l(o,[{key:"create",value:function(){if(arguments.length===1)arguments[0]instanceof Array||le(arguments[0],ve);else if(arguments.length!==2){if(arguments.length===3){var e=arguments[0],t=arguments[1];return this.create(e,t)}}}}]),o}(),cr=function(){function o(){i(this,o)}return l(o,[{key:"filter",value:function(e){}}]),o}(),qa=function(){function o(){i(this,o)}return l(o,null,[{key:"ofLine",value:function(e){var t=e.size();if(t<=1)return 0;var n=0,s=new C;e.getCoordinate(0,s);for(var c=s.x,h=s.y,g=1;g<t;g++){e.getCoordinate(g,s);var d=s.x,E=s.y,w=d-c,N=E-h;n+=Math.sqrt(w*w+N*N),c=d,h=E}return n}}]),o}(),ts=function o(){i(this,o)},tn=function(){function o(){i(this,o)}return l(o,null,[{key:"copyCoord",value:function(e,t,n,s){for(var c=Math.min(e.getDimension(),n.getDimension()),h=0;h<c;h++)n.setOrdinate(s,h,e.getOrdinate(t,h))}},{key:"isRing",value:function(e){var t=e.size();return t===0||!(t<=3)&&e.getOrdinate(0,ve.X)===e.getOrdinate(t-1,ve.X)&&e.getOrdinate(0,ve.Y)===e.getOrdinate(t-1,ve.Y)}},{key:"scroll",value:function(){if(arguments.length===2){if(le(arguments[0],ve)&&Number.isInteger(arguments[1])){var e=arguments[0],t=arguments[1];o.scroll(e,t,o.isRing(e))}else if(le(arguments[0],ve)&&arguments[1]instanceof C){var n=arguments[0],s=arguments[1],c=o.indexOf(s,n);if(c<=0)return null;o.scroll(n,c)}}else if(arguments.length===3){var h=arguments[0],g=arguments[1],d=arguments[2],E=g;if(E<=0)return null;for(var w=h.copy(),N=d?h.size()-1:h.size(),F=0;F<N;F++)for(var j=0;j<h.getDimension();j++)h.setOrdinate(F,j,w.getOrdinate((g+F)%N,j));if(d)for(var X=0;X<h.getDimension();X++)h.setOrdinate(N,X,h.getOrdinate(0,X))}}},{key:"isEqual",value:function(e,t){var n=e.size();if(n!==t.size())return!1;for(var s=Math.min(e.getDimension(),t.getDimension()),c=0;c<n;c++)for(var h=0;h<s;h++){var g=e.getOrdinate(c,h),d=t.getOrdinate(c,h);if(e.getOrdinate(c,h)!==t.getOrdinate(c,h)&&(!K.isNaN(g)||!K.isNaN(d)))return!1}return!0}},{key:"minCoordinateIndex",value:function(){if(arguments.length===1){var e=arguments[0];return o.minCoordinateIndex(e,0,e.size()-1)}if(arguments.length===3){for(var t=arguments[0],n=arguments[1],s=arguments[2],c=-1,h=null,g=n;g<=s;g++){var d=t.getCoordinate(g);(h===null||h.compareTo(d)>0)&&(h=d,c=g)}return c}}},{key:"extend",value:function(e,t,n){var s=e.create(n,t.getDimension()),c=t.size();if(o.copy(t,0,s,0,c),c>0)for(var h=c;h<n;h++)o.copy(t,c-1,s,h,1);return s}},{key:"reverse",value:function(e){for(var t=e.size()-1,n=Math.trunc(t/2),s=0;s<=n;s++)o.swap(e,s,t-s)}},{key:"swap",value:function(e,t,n){if(t===n)return null;for(var s=0;s<e.getDimension();s++){var c=e.getOrdinate(t,s);e.setOrdinate(t,s,e.getOrdinate(n,s)),e.setOrdinate(n,s,c)}}},{key:"copy",value:function(e,t,n,s,c){for(var h=0;h<c;h++)o.copyCoord(e,t+h,n,s+h)}},{key:"ensureValidRing",value:function(e,t){var n=t.size();return n===0?t:n<=3?o.createClosedRing(e,t,4):t.getOrdinate(0,ve.X)===t.getOrdinate(n-1,ve.X)&&t.getOrdinate(0,ve.Y)===t.getOrdinate(n-1,ve.Y)?t:o.createClosedRing(e,t,n+1)}},{key:"indexOf",value:function(e,t){for(var n=0;n<t.size();n++)if(e.x===t.getOrdinate(n,ve.X)&&e.y===t.getOrdinate(n,ve.Y))return n;return-1}},{key:"createClosedRing",value:function(e,t,n){var s=e.create(n,t.getDimension()),c=t.size();o.copy(t,0,s,0,c);for(var h=c;h<n;h++)o.copy(t,0,s,h,1);return s}},{key:"minCoordinate",value:function(e){for(var t=null,n=0;n<e.size();n++){var s=e.getCoordinate(n);(t===null||t.compareTo(s)>0)&&(t=s)}return t}}]),o}(),V=function(){function o(){i(this,o)}return l(o,null,[{key:"toDimensionSymbol",value:function(e){switch(e){case o.FALSE:return o.SYM_FALSE;case o.TRUE:return o.SYM_TRUE;case o.DONTCARE:return o.SYM_DONTCARE;case o.P:return o.SYM_P;case o.L:return o.SYM_L;case o.A:return o.SYM_A}throw new M("Unknown dimension value: "+e)}},{key:"toDimensionValue",value:function(e){switch(lr.toUpperCase(e)){case o.SYM_FALSE:return o.FALSE;case o.SYM_TRUE:return o.TRUE;case o.SYM_DONTCARE:return o.DONTCARE;case o.SYM_P:return o.P;case o.SYM_L:return o.L;case o.SYM_A:return o.A}throw new M("Unknown dimension symbol: "+e)}}]),o}();V.P=0,V.L=1,V.A=2,V.FALSE=-1,V.TRUE=-2,V.DONTCARE=-3,V.SYM_FALSE="F",V.SYM_TRUE="T",V.SYM_DONTCARE="*",V.SYM_P="0",V.SYM_L="1",V.SYM_A="2";var B=function(){function o(){i(this,o)}return l(o,[{key:"filter",value:function(e){}}]),o}(),Ce=function(){function o(){i(this,o)}return l(o,[{key:"filter",value:function(e,t){}},{key:"isDone",value:function(){}},{key:"isGeometryChanged",value:function(){}}]),o}(),Ue=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"computeEnvelopeInternal",value:function(){return this.isEmpty()?new Se:this._points.expandEnvelope(new Se)}},{key:"isRing",value:function(){return this.isClosed()&&this.isSimple()}},{key:"getCoordinates",value:function(){return this._points.toCoordinateArray()}},{key:"copyInternal",value:function(){return new t(this._points.copy(),this._factory)}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof J){var n=arguments[0],s=arguments[1];if(!this.isEquivalentClass(n))return!1;var c=n;if(this._points.size()!==c._points.size())return!1;for(var h=0;h<this._points.size();h++)if(!this.equal(this._points.getCoordinate(h),c._points.getCoordinate(h),s))return!1;return!0}return b(v(t.prototype),"equalsExact",this).apply(this,arguments)}},{key:"normalize",value:function(){for(var n=0;n<Math.trunc(this._points.size()/2);n++){var s=this._points.size()-1-n;if(!this._points.getCoordinate(n).equals(this._points.getCoordinate(s))){if(this._points.getCoordinate(n).compareTo(this._points.getCoordinate(s))>0){var c=this._points.copy();tn.reverse(c),this._points=c}return null}}}},{key:"getCoordinate",value:function(){return this.isEmpty()?null:this._points.getCoordinate(0)}},{key:"getBoundaryDimension",value:function(){return this.isClosed()?V.FALSE:0}},{key:"isClosed",value:function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))}},{key:"reverseInternal",value:function(){var n=this._points.copy();return tn.reverse(n),this.getFactory().createLineString(n)}},{key:"getEndPoint",value:function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)}},{key:"getTypeCode",value:function(){return J.TYPECODE_LINESTRING}},{key:"getDimension",value:function(){return 1}},{key:"getLength",value:function(){return qa.ofLine(this._points)}},{key:"getNumPoints",value:function(){return this._points.size()}},{key:"compareToSameClass",value:function(){if(arguments.length===1){for(var n=arguments[0],s=n,c=0,h=0;c<this._points.size()&&h<s._points.size();){var g=this._points.getCoordinate(c).compareTo(s._points.getCoordinate(h));if(g!==0)return g;c++,h++}return c<this._points.size()?1:h<s._points.size()?-1:0}if(arguments.length===2){var d=arguments[0],E=arguments[1],w=d;return E.compare(this._points,w._points)}}},{key:"apply",value:function(){if(le(arguments[0],cr))for(var n=arguments[0],s=0;s<this._points.size();s++)n.filter(this._points.getCoordinate(s));else if(le(arguments[0],Ce)){var c=arguments[0];if(this._points.size()===0)return null;for(var h=0;h<this._points.size()&&(c.filter(this._points,h),!c.isDone());h++);c.isGeometryChanged()&&this.geometryChanged()}else if(le(arguments[0],B)){var g=arguments[0];g.filter(this)}else if(le(arguments[0],z)){var d=arguments[0];d.filter(this)}}},{key:"getBoundary",value:function(){throw new ue}},{key:"isEquivalentClass",value:function(n){return n instanceof t}},{key:"getCoordinateN",value:function(n){return this._points.getCoordinate(n)}},{key:"getGeometryType",value:function(){return J.TYPENAME_LINESTRING}},{key:"getCoordinateSequence",value:function(){return this._points}},{key:"isEmpty",value:function(){return this._points.size()===0}},{key:"init",value:function(n){if(n===null&&(n=this.getFactory().getCoordinateSequenceFactory().create([])),n.size()===1)throw new M("Invalid number of points in LineString (found "+n.size()+" - must be 0 or >= 2)");this._points=n}},{key:"isCoordinate",value:function(n){for(var s=0;s<this._points.size();s++)if(this._points.getCoordinate(s).equals(n))return!0;return!1}},{key:"getStartPoint",value:function(){return this.isEmpty()?null:this.getPointN(0)}},{key:"getPointN",value:function(n){return this.getFactory().createPoint(this._points.getCoordinate(n))}},{key:"interfaces_",get:function(){return[ts]}}],[{key:"constructor_",value:function(){if(this._points=null,arguments.length!==0){if(arguments.length===2){var n=arguments[0],s=arguments[1];J.constructor_.call(this,s),this.init(n)}}}}]),t}(J),tt=function o(){i(this,o)},ge=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"computeEnvelopeInternal",value:function(){if(this.isEmpty())return new Se;var n=new Se;return n.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),n}},{key:"getCoordinates",value:function(){return this.isEmpty()?[]:[this.getCoordinate()]}},{key:"copyInternal",value:function(){return new t(this._coordinates.copy(),this._factory)}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof J){var n=arguments[0],s=arguments[1];return!!this.isEquivalentClass(n)&&(!(!this.isEmpty()||!n.isEmpty())||this.isEmpty()===n.isEmpty()&&this.equal(n.getCoordinate(),this.getCoordinate(),s))}return b(v(t.prototype),"equalsExact",this).apply(this,arguments)}},{key:"normalize",value:function(){}},{key:"getCoordinate",value:function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null}},{key:"getBoundaryDimension",value:function(){return V.FALSE}},{key:"reverseInternal",value:function(){return this.getFactory().createPoint(this._coordinates.copy())}},{key:"getTypeCode",value:function(){return J.TYPECODE_POINT}},{key:"getDimension",value:function(){return 0}},{key:"getNumPoints",value:function(){return this.isEmpty()?0:1}},{key:"getX",value:function(){if(this.getCoordinate()===null)throw new IllegalStateException("getX called on empty Point");return this.getCoordinate().x}},{key:"compareToSameClass",value:function(){if(arguments.length===1){var n=arguments[0],s=n;return this.getCoordinate().compareTo(s.getCoordinate())}if(arguments.length===2){var c=arguments[0],h=arguments[1],g=c;return h.compare(this._coordinates,g._coordinates)}}},{key:"apply",value:function(){if(le(arguments[0],cr)){var n=arguments[0];if(this.isEmpty())return null;n.filter(this.getCoordinate())}else if(le(arguments[0],Ce)){var s=arguments[0];if(this.isEmpty())return null;s.filter(this._coordinates,0),s.isGeometryChanged()&&this.geometryChanged()}else if(le(arguments[0],B)){var c=arguments[0];c.filter(this)}else if(le(arguments[0],z)){var h=arguments[0];h.filter(this)}}},{key:"getBoundary",value:function(){return this.getFactory().createGeometryCollection()}},{key:"getGeometryType",value:function(){return J.TYPENAME_POINT}},{key:"getCoordinateSequence",value:function(){return this._coordinates}},{key:"getY",value:function(){if(this.getCoordinate()===null)throw new IllegalStateException("getY called on empty Point");return this.getCoordinate().y}},{key:"isEmpty",value:function(){return this._coordinates.size()===0}},{key:"init",value:function(n){n===null&&(n=this.getFactory().getCoordinateSequenceFactory().create([])),he.isTrue(n.size()<=1),this._coordinates=n}},{key:"isSimple",value:function(){return!0}},{key:"interfaces_",get:function(){return[tt]}}],[{key:"constructor_",value:function(){this._coordinates=null;var n=arguments[0],s=arguments[1];J.constructor_.call(this,s),this.init(n)}}]),t}(J),nt=function(){function o(){i(this,o)}return l(o,null,[{key:"ofRing",value:function(){if(arguments[0]instanceof Array){var e=arguments[0];return Math.abs(o.ofRingSigned(e))}if(le(arguments[0],ve)){var t=arguments[0];return Math.abs(o.ofRingSigned(t))}}},{key:"ofRingSigned",value:function(){if(arguments[0]instanceof Array){var e=arguments[0];if(e.length<3)return 0;for(var t=0,n=e[0].x,s=1;s<e.length-1;s++){var c=e[s].x-n,h=e[s+1].y,g=e[s-1].y;t+=c*(g-h)}return t/2}if(le(arguments[0],ve)){var d=arguments[0],E=d.size();if(E<3)return 0;var w=new C,N=new C,F=new C;d.getCoordinate(0,N),d.getCoordinate(1,F);var j=N.x;F.x-=j;for(var X=0,$=1;$<E-1;$++)w.y=N.y,N.x=F.x,N.y=F.y,d.getCoordinate($+1,F),F.x-=j,X+=N.x*(w.y-F.y);return X/2}}}]),o}(),St=function(){function o(){i(this,o)}return l(o,null,[{key:"sort",value:function(){var e=arguments,t=arguments[0];if(arguments.length===1)t.sort(function(j,X){return j.compareTo(X)});else if(arguments.length===2)t.sort(function(j,X){return e[1].compare(j,X)});else if(arguments.length===3){var n=t.slice(arguments[1],arguments[2]);n.sort();var s=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length));t.splice(0,t.length);var c,h=P(s);try{for(h.s();!(c=h.n()).done;){var g=c.value;t.push(g)}}catch(j){h.e(j)}finally{h.f()}}else if(arguments.length===4){var d=t.slice(arguments[1],arguments[2]);d.sort(function(j,X){return e[3].compare(j,X)});var E=t.slice(0,arguments[1]).concat(d,t.slice(arguments[2],t.length));t.splice(0,t.length);var w,N=P(E);try{for(N.s();!(w=N.n()).done;){var F=w.value;t.push(F)}}catch(j){N.e(j)}finally{N.f()}}}},{key:"asList",value:function(e){var t,n=new ne,s=P(e);try{for(s.s();!(t=s.n()).done;){var c=t.value;n.add(c)}}catch(h){s.e(h)}finally{s.f()}return n}},{key:"copyOf",value:function(e,t){return e.slice(0,t)}}]),o}(),fr=function o(){i(this,o)},En=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"computeEnvelopeInternal",value:function(){return this._shell.getEnvelopeInternal()}},{key:"getCoordinates",value:function(){if(this.isEmpty())return[];for(var n=new Array(this.getNumPoints()).fill(null),s=-1,c=this._shell.getCoordinates(),h=0;h<c.length;h++)n[++s]=c[h];for(var g=0;g<this._holes.length;g++)for(var d=this._holes[g].getCoordinates(),E=0;E<d.length;E++)n[++s]=d[E];return n}},{key:"getArea",value:function(){var n=0;n+=nt.ofRing(this._shell.getCoordinateSequence());for(var s=0;s<this._holes.length;s++)n-=nt.ofRing(this._holes[s].getCoordinateSequence());return n}},{key:"copyInternal",value:function(){for(var n=this._shell.copy(),s=new Array(this._holes.length).fill(null),c=0;c<this._holes.length;c++)s[c]=this._holes[c].copy();return new t(n,s,this._factory)}},{key:"isRectangle",value:function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var n=this._shell.getCoordinateSequence(),s=this.getEnvelopeInternal(),c=0;c<5;c++){var h=n.getX(c);if(h!==s.getMinX()&&h!==s.getMaxX())return!1;var g=n.getY(c);if(g!==s.getMinY()&&g!==s.getMaxY())return!1}for(var d=n.getX(0),E=n.getY(0),w=1;w<=4;w++){var N=n.getX(w),F=n.getY(w);if(N!==d==(F!==E))return!1;d=N,E=F}return!0}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof J){var n=arguments[0],s=arguments[1];if(!this.isEquivalentClass(n))return!1;var c=n,h=this._shell,g=c._shell;if(!h.equalsExact(g,s)||this._holes.length!==c._holes.length)return!1;for(var d=0;d<this._holes.length;d++)if(!this._holes[d].equalsExact(c._holes[d],s))return!1;return!0}return b(v(t.prototype),"equalsExact",this).apply(this,arguments)}},{key:"normalize",value:function(){if(arguments.length===0){this._shell=this.normalized(this._shell,!0);for(var n=0;n<this._holes.length;n++)this._holes[n]=this.normalized(this._holes[n],!1);St.sort(this._holes)}else if(arguments.length===2){var s=arguments[0],c=arguments[1];if(s.isEmpty())return null;var h=s.getCoordinateSequence(),g=tn.minCoordinateIndex(h,0,h.size()-2);tn.scroll(h,g,!0),ae.isCCW(h)===c&&tn.reverse(h)}}},{key:"getCoordinate",value:function(){return this._shell.getCoordinate()}},{key:"getNumInteriorRing",value:function(){return this._holes.length}},{key:"getBoundaryDimension",value:function(){return 1}},{key:"reverseInternal",value:function(){for(var n=this.getExteriorRing().reverse(),s=new Array(this.getNumInteriorRing()).fill(null),c=0;c<s.length;c++)s[c]=this.getInteriorRingN(c).reverse();return this.getFactory().createPolygon(n,s)}},{key:"getTypeCode",value:function(){return J.TYPECODE_POLYGON}},{key:"getDimension",value:function(){return 2}},{key:"getLength",value:function(){var n=0;n+=this._shell.getLength();for(var s=0;s<this._holes.length;s++)n+=this._holes[s].getLength();return n}},{key:"getNumPoints",value:function(){for(var n=this._shell.getNumPoints(),s=0;s<this._holes.length;s++)n+=this._holes[s].getNumPoints();return n}},{key:"convexHull",value:function(){return this.getExteriorRing().convexHull()}},{key:"normalized",value:function(n,s){var c=n.copy();return this.normalize(c,s),c}},{key:"compareToSameClass",value:function(){if(arguments.length===1){var n=arguments[0],s=this._shell,c=n._shell;return s.compareToSameClass(c)}if(arguments.length===2){var h=arguments[0],g=arguments[1],d=h,E=this._shell,w=d._shell,N=E.compareToSameClass(w,g);if(N!==0)return N;for(var F=this.getNumInteriorRing(),j=d.getNumInteriorRing(),X=0;X<F&&X<j;){var $=this.getInteriorRingN(X),re=d.getInteriorRingN(X),fe=$.compareToSameClass(re,g);if(fe!==0)return fe;X++}return X<F?1:X<j?-1:0}}},{key:"apply",value:function(){if(le(arguments[0],cr)){var n=arguments[0];this._shell.apply(n);for(var s=0;s<this._holes.length;s++)this._holes[s].apply(n)}else if(le(arguments[0],Ce)){var c=arguments[0];if(this._shell.apply(c),!c.isDone())for(var h=0;h<this._holes.length&&(this._holes[h].apply(c),!c.isDone());h++);c.isGeometryChanged()&&this.geometryChanged()}else if(le(arguments[0],B)){var g=arguments[0];g.filter(this)}else if(le(arguments[0],z)){var d=arguments[0];d.filter(this),this._shell.apply(d);for(var E=0;E<this._holes.length;E++)this._holes[E].apply(d)}}},{key:"getBoundary",value:function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var n=new Array(this._holes.length+1).fill(null);n[0]=this._shell;for(var s=0;s<this._holes.length;s++)n[s+1]=this._holes[s];return n.length<=1?this.getFactory().createLinearRing(n[0].getCoordinateSequence()):this.getFactory().createMultiLineString(n)}},{key:"getGeometryType",value:function(){return J.TYPENAME_POLYGON}},{key:"getExteriorRing",value:function(){return this._shell}},{key:"isEmpty",value:function(){return this._shell.isEmpty()}},{key:"getInteriorRingN",value:function(n){return this._holes[n]}},{key:"interfaces_",get:function(){return[fr]}}],[{key:"constructor_",value:function(){this._shell=null,this._holes=null;var n=arguments[0],s=arguments[1],c=arguments[2];if(J.constructor_.call(this,c),n===null&&(n=this.getFactory().createLinearRing()),s===null&&(s=[]),J.hasNullElements(s))throw new M("holes must not contain null elements");if(n.isEmpty()&&J.hasNonEmptyElements(s))throw new M("shell is empty but holes are not");this._shell=n,this._holes=s}}]),t}(J),hr=function(o){f(t,o);var e=S(t);function t(){return i(this,t),e.apply(this,arguments)}return t}(Xr),yf=function(o){f(t,o);var e=S(t);function t(n){var s;return i(this,t),(s=e.call(this)).array=[],n instanceof ce&&s.addAll(n),s}return l(t,[{key:"contains",value:function(n){var s,c=P(this.array);try{for(c.s();!(s=c.n()).done;)if(s.value.compareTo(n)===0)return!0}catch(h){c.e(h)}finally{c.f()}return!1}},{key:"add",value:function(n){if(this.contains(n))return!1;for(var s=0,c=this.array.length;s<c;s++)if(this.array[s].compareTo(n)===1)return!!this.array.splice(s,0,n);return this.array.push(n),!0}},{key:"addAll",value:function(n){var s,c=P(n);try{for(c.s();!(s=c.n()).done;){var h=s.value;this.add(h)}}catch(g){c.e(g)}finally{c.f()}return!0}},{key:"remove",value:function(){throw new ue}},{key:"size",value:function(){return this.array.length}},{key:"isEmpty",value:function(){return this.array.length===0}},{key:"toArray",value:function(){return this.array.slice()}},{key:"iterator",value:function(){return new A0(this.array)}}]),t}(hr),A0=function(){function o(e){i(this,o),this.array=e,this.position=0}return l(o,[{key:"next",value:function(){if(this.position===this.array.length)throw new Te;return this.array[this.position++]}},{key:"hasNext",value:function(){return this.position<this.array.length}},{key:"remove",value:function(){throw new ue}}]),o}(),ft=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"computeEnvelopeInternal",value:function(){for(var n=new Se,s=0;s<this._geometries.length;s++)n.expandToInclude(this._geometries[s].getEnvelopeInternal());return n}},{key:"getGeometryN",value:function(n){return this._geometries[n]}},{key:"getCoordinates",value:function(){for(var n=new Array(this.getNumPoints()).fill(null),s=-1,c=0;c<this._geometries.length;c++)for(var h=this._geometries[c].getCoordinates(),g=0;g<h.length;g++)n[++s]=h[g];return n}},{key:"getArea",value:function(){for(var n=0,s=0;s<this._geometries.length;s++)n+=this._geometries[s].getArea();return n}},{key:"copyInternal",value:function(){for(var n=new Array(this._geometries.length).fill(null),s=0;s<n.length;s++)n[s]=this._geometries[s].copy();return new t(n,this._factory)}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof J){var n=arguments[0],s=arguments[1];if(!this.isEquivalentClass(n))return!1;var c=n;if(this._geometries.length!==c._geometries.length)return!1;for(var h=0;h<this._geometries.length;h++)if(!this._geometries[h].equalsExact(c._geometries[h],s))return!1;return!0}return b(v(t.prototype),"equalsExact",this).apply(this,arguments)}},{key:"normalize",value:function(){for(var n=0;n<this._geometries.length;n++)this._geometries[n].normalize();St.sort(this._geometries)}},{key:"getCoordinate",value:function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()}},{key:"getBoundaryDimension",value:function(){for(var n=V.FALSE,s=0;s<this._geometries.length;s++)n=Math.max(n,this._geometries[s].getBoundaryDimension());return n}},{key:"reverseInternal",value:function(){for(var n=this._geometries.length,s=new ne(n),c=0;c<n;c++)s.add(this._geometries[c].reverse());return this.getFactory().buildGeometry(s)}},{key:"getTypeCode",value:function(){return J.TYPECODE_GEOMETRYCOLLECTION}},{key:"getDimension",value:function(){for(var n=V.FALSE,s=0;s<this._geometries.length;s++)n=Math.max(n,this._geometries[s].getDimension());return n}},{key:"getLength",value:function(){for(var n=0,s=0;s<this._geometries.length;s++)n+=this._geometries[s].getLength();return n}},{key:"getNumPoints",value:function(){for(var n=0,s=0;s<this._geometries.length;s++)n+=this._geometries[s].getNumPoints();return n}},{key:"getNumGeometries",value:function(){return this._geometries.length}},{key:"compareToSameClass",value:function(){if(arguments.length===1){var n=arguments[0],s=new yf(St.asList(this._geometries)),c=new yf(St.asList(n._geometries));return this.compare(s,c)}if(arguments.length===2){for(var h=arguments[0],g=arguments[1],d=h,E=this.getNumGeometries(),w=d.getNumGeometries(),N=0;N<E&&N<w;){var F=this.getGeometryN(N),j=d.getGeometryN(N),X=F.compareToSameClass(j,g);if(X!==0)return X;N++}return N<E?1:N<w?-1:0}}},{key:"apply",value:function(){if(le(arguments[0],cr))for(var n=arguments[0],s=0;s<this._geometries.length;s++)this._geometries[s].apply(n);else if(le(arguments[0],Ce)){var c=arguments[0];if(this._geometries.length===0)return null;for(var h=0;h<this._geometries.length&&(this._geometries[h].apply(c),!c.isDone());h++);c.isGeometryChanged()&&this.geometryChanged()}else if(le(arguments[0],B)){var g=arguments[0];g.filter(this);for(var d=0;d<this._geometries.length;d++)this._geometries[d].apply(g)}else if(le(arguments[0],z)){var E=arguments[0];E.filter(this);for(var w=0;w<this._geometries.length;w++)this._geometries[w].apply(E)}}},{key:"getBoundary",value:function(){return J.checkNotGeometryCollection(this),he.shouldNeverReachHere(),null}},{key:"getGeometryType",value:function(){return J.TYPENAME_GEOMETRYCOLLECTION}},{key:"isEmpty",value:function(){for(var n=0;n<this._geometries.length;n++)if(!this._geometries[n].isEmpty())return!1;return!0}}],[{key:"constructor_",value:function(){if(this._geometries=null,arguments.length!==0){if(arguments.length===2){var n=arguments[0],s=arguments[1];if(J.constructor_.call(this,s),n===null&&(n=[]),J.hasNullElements(n))throw new M("geometries must not contain null elements");this._geometries=n}}}}]),t}(J),za=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"copyInternal",value:function(){for(var n=new Array(this._geometries.length).fill(null),s=0;s<n.length;s++)n[s]=this._geometries[s].copy();return new t(n,this._factory)}},{key:"isValid",value:function(){return!0}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof J){var n=arguments[0],s=arguments[1];return!!this.isEquivalentClass(n)&&b(v(t.prototype),"equalsExact",this).call(this,n,s)}return b(v(t.prototype),"equalsExact",this).apply(this,arguments)}},{key:"getCoordinate",value:function(){if(arguments.length===1&&Number.isInteger(arguments[0])){var n=arguments[0];return this._geometries[n].getCoordinate()}return b(v(t.prototype),"getCoordinate",this).apply(this,arguments)}},{key:"getBoundaryDimension",value:function(){return V.FALSE}},{key:"getTypeCode",value:function(){return J.TYPECODE_MULTIPOINT}},{key:"getDimension",value:function(){return 0}},{key:"getBoundary",value:function(){return this.getFactory().createGeometryCollection()}},{key:"getGeometryType",value:function(){return J.TYPENAME_MULTIPOINT}},{key:"interfaces_",get:function(){return[tt]}}],[{key:"constructor_",value:function(){var n=arguments[0],s=arguments[1];ft.constructor_.call(this,n,s)}}]),t}(ft),Hr=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"copyInternal",value:function(){return new t(this._points.copy(),this._factory)}},{key:"getBoundaryDimension",value:function(){return V.FALSE}},{key:"isClosed",value:function(){return!!this.isEmpty()||b(v(t.prototype),"isClosed",this).call(this)}},{key:"reverseInternal",value:function(){var n=this._points.copy();return tn.reverse(n),this.getFactory().createLinearRing(n)}},{key:"getTypeCode",value:function(){return J.TYPECODE_LINEARRING}},{key:"validateConstruction",value:function(){if(!this.isEmpty()&&!b(v(t.prototype),"isClosed",this).call(this))throw new M("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new M("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")}},{key:"getGeometryType",value:function(){return J.TYPENAME_LINEARRING}}],[{key:"constructor_",value:function(){var n=arguments[0],s=arguments[1];Ue.constructor_.call(this,n,s),this.validateConstruction()}}]),t}(Ue);Hr.MINIMUM_VALID_SIZE=4;var Dn=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"setOrdinate",value:function(n,s){switch(n){case t.X:this.x=s;break;case t.Y:this.y=s;break;default:throw new M("Invalid ordinate index: "+n)}}},{key:"getZ",value:function(){return C.NULL_ORDINATE}},{key:"getOrdinate",value:function(n){switch(n){case t.X:return this.x;case t.Y:return this.y}throw new M("Invalid ordinate index: "+n)}},{key:"setZ",value:function(n){throw new M("CoordinateXY dimension 2 does not support z-ordinate")}},{key:"copy",value:function(){return new t(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+")"}},{key:"setCoordinate",value:function(n){this.x=n.x,this.y=n.y,this.z=n.getZ()}}],[{key:"constructor_",value:function(){if(arguments.length===0)C.constructor_.call(this);else if(arguments.length===1){if(arguments[0]instanceof t){var n=arguments[0];C.constructor_.call(this,n.x,n.y)}else if(arguments[0]instanceof C){var s=arguments[0];C.constructor_.call(this,s.x,s.y)}}else if(arguments.length===2){var c=arguments[0],h=arguments[1];C.constructor_.call(this,c,h,C.NULL_ORDINATE)}}}]),t}(C);Dn.X=0,Dn.Y=1,Dn.Z=-1,Dn.M=-1;var Fn=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"getM",value:function(){return this._m}},{key:"setOrdinate",value:function(n,s){switch(n){case t.X:this.x=s;break;case t.Y:this.y=s;break;case t.M:this._m=s;break;default:throw new M("Invalid ordinate index: "+n)}}},{key:"setM",value:function(n){this._m=n}},{key:"getZ",value:function(){return C.NULL_ORDINATE}},{key:"getOrdinate",value:function(n){switch(n){case t.X:return this.x;case t.Y:return this.y;case t.M:return this._m}throw new M("Invalid ordinate index: "+n)}},{key:"setZ",value:function(n){throw new M("CoordinateXY dimension 2 does not support z-ordinate")}},{key:"copy",value:function(){return new t(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+" m="+this.getM()+")"}},{key:"setCoordinate",value:function(n){this.x=n.x,this.y=n.y,this.z=n.getZ(),this._m=n.getM()}}],[{key:"constructor_",value:function(){if(this._m=null,arguments.length===0)C.constructor_.call(this),this._m=0;else if(arguments.length===1){if(arguments[0]instanceof t){var n=arguments[0];C.constructor_.call(this,n.x,n.y),this._m=n._m}else if(arguments[0]instanceof C){var s=arguments[0];C.constructor_.call(this,s.x,s.y),this._m=this.getM()}}else if(arguments.length===3){var c=arguments[0],h=arguments[1],g=arguments[2];C.constructor_.call(this,c,h,C.NULL_ORDINATE),this._m=g}}}]),t}(C);Fn.X=0,Fn.Y=1,Fn.Z=-1,Fn.M=2;var Ua=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"getM",value:function(){return this._m}},{key:"setOrdinate",value:function(n,s){switch(n){case C.X:this.x=s;break;case C.Y:this.y=s;break;case C.Z:this.z=s;break;case C.M:this._m=s;break;default:throw new M("Invalid ordinate index: "+n)}}},{key:"setM",value:function(n){this._m=n}},{key:"getOrdinate",value:function(n){switch(n){case C.X:return this.x;case C.Y:return this.y;case C.Z:return this.getZ();case C.M:return this.getM()}throw new M("Invalid ordinate index: "+n)}},{key:"copy",value:function(){return new t(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+", "+this.getZ()+" m="+this.getM()+")"}},{key:"setCoordinate",value:function(n){this.x=n.x,this.y=n.y,this.z=n.getZ(),this._m=n.getM()}}],[{key:"constructor_",value:function(){if(this._m=null,arguments.length===0)C.constructor_.call(this),this._m=0;else if(arguments.length===1){if(arguments[0]instanceof t){var n=arguments[0];C.constructor_.call(this,n),this._m=n._m}else if(arguments[0]instanceof C){var s=arguments[0];C.constructor_.call(this,s),this._m=this.getM()}}else if(arguments.length===4){var c=arguments[0],h=arguments[1],g=arguments[2],d=arguments[3];C.constructor_.call(this,c,h,g),this._m=d}}}]),t}(C),ns=function(){function o(){i(this,o)}return l(o,null,[{key:"measures",value:function(e){return e instanceof Dn?0:e instanceof Fn||e instanceof Ua?1:0}},{key:"dimension",value:function(e){return e instanceof Dn?2:e instanceof Fn?3:e instanceof Ua?4:3}},{key:"create",value:function(){if(arguments.length===1){var e=arguments[0];return o.create(e,0)}if(arguments.length===2){var t=arguments[0],n=arguments[1];return t===2?new Dn:t===3&&n===0?new C:t===3&&n===1?new Fn:t===4&&n===1?new Ua:new C}}}]),o}(),Zr=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"getCoordinate",value:function(n){return this.get(n)}},{key:"addAll",value:function(){if(arguments.length===2&&typeof arguments[1]=="boolean"&&le(arguments[0],ce)){for(var n=arguments[0],s=arguments[1],c=!1,h=n.iterator();h.hasNext();)this.add(h.next(),s),c=!0;return c}return b(v(t.prototype),"addAll",this).apply(this,arguments)}},{key:"clone",value:function(){for(var n=b(v(t.prototype),"clone",this).call(this),s=0;s<this.size();s++)n.add(s,this.get(s).clone());return n}},{key:"toCoordinateArray",value:function(){if(arguments.length===0)return this.toArray(t.coordArrayType);if(arguments.length===1){var n=arguments[0];if(n)return this.toArray(t.coordArrayType);for(var s=this.size(),c=new Array(s).fill(null),h=0;h<s;h++)c[h]=this.get(s-h-1);return c}}},{key:"add",value:function(){if(arguments.length===1){var n=arguments[0];return b(v(t.prototype),"add",this).call(this,n)}if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var s=arguments[0],c=arguments[1];return this.add(s,c,!0),!0}if(arguments[0]instanceof C&&typeof arguments[1]=="boolean"){var h=arguments[0],g=arguments[1];if(!g&&this.size()>=1){var d=this.get(this.size()-1);if(d.equals2D(h))return null}b(v(t.prototype),"add",this).call(this,h)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var E=arguments[0],w=arguments[1];return this.add(E,w),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var N=arguments[0],F=arguments[1],j=arguments[2];if(j)for(var X=0;X<N.length;X++)this.add(N[X],F);else for(var $=N.length-1;$>=0;$--)this.add(N[$],F);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof C){var re=arguments[0],fe=arguments[1],ke=arguments[2];if(!ke){var Be=this.size();if(Be>0){if(re>0){var Je=this.get(re-1);if(Je.equals2D(fe))return null}if(re<Be){var yt=this.get(re);if(yt.equals2D(fe))return null}}}b(v(t.prototype),"add",this).call(this,re,fe)}}else if(arguments.length===4){var At=arguments[0],sn=arguments[1],qn=arguments[2],ei=arguments[3],ti=1;qn>ei&&(ti=-1);for(var Er=qn;Er!==ei;Er+=ti)this.add(At[Er],sn);return!0}}},{key:"closeRing",value:function(){if(this.size()>0){var n=this.get(0).copy();this.add(n,!1)}}}],[{key:"constructor_",value:function(){if(arguments.length!==0){if(arguments.length===1){var n=arguments[0];this.ensureCapacity(n.length),this.add(n,!0)}else if(arguments.length===2){var s=arguments[0],c=arguments[1];this.ensureCapacity(s.length),this.add(s,c)}}}}]),t}(ne);Zr.coordArrayType=new Array(0).fill(null);var Ye=function(){function o(){i(this,o)}return l(o,null,[{key:"isRing",value:function(e){return!(e.length<4)&&!!e[0].equals2D(e[e.length-1])}},{key:"ptNotInList",value:function(e,t){for(var n=0;n<e.length;n++){var s=e[n];if(o.indexOf(s,t)<0)return s}return null}},{key:"scroll",value:function(e,t){var n=o.indexOf(t,e);if(n<0)return null;var s=new Array(e.length).fill(null);ot.arraycopy(e,n,s,0,e.length-n),ot.arraycopy(e,0,s,e.length-n,n),ot.arraycopy(s,0,e,0,e.length)}},{key:"equals",value:function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];if(e===t)return!0;if(e===null||t===null||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].equals(t[n]))return!1;return!0}if(arguments.length===3){var s=arguments[0],c=arguments[1],h=arguments[2];if(s===c)return!0;if(s===null||c===null||s.length!==c.length)return!1;for(var g=0;g<s.length;g++)if(h.compare(s[g],c[g])!==0)return!1;return!0}}},{key:"intersection",value:function(e,t){for(var n=new Zr,s=0;s<e.length;s++)t.intersects(e[s])&&n.add(e[s],!0);return n.toCoordinateArray()}},{key:"measures",value:function(e){if(e===null||e.length===0)return 0;var t,n=0,s=P(e);try{for(s.s();!(t=s.n()).done;){var c=t.value;n=Math.max(n,ns.measures(c))}}catch(h){s.e(h)}finally{s.f()}return n}},{key:"hasRepeatedPoints",value:function(e){for(var t=1;t<e.length;t++)if(e[t-1].equals(e[t]))return!0;return!1}},{key:"removeRepeatedPoints",value:function(e){return o.hasRepeatedPoints(e)?new Zr(e,!1).toCoordinateArray():e}},{key:"reverse",value:function(e){for(var t=e.length-1,n=Math.trunc(t/2),s=0;s<=n;s++){var c=e[s];e[s]=e[t-s],e[t-s]=c}}},{key:"removeNull",value:function(e){for(var t=0,n=0;n<e.length;n++)e[n]!==null&&t++;var s=new Array(t).fill(null);if(t===0)return s;for(var c=0,h=0;h<e.length;h++)e[h]!==null&&(s[c++]=e[h]);return s}},{key:"copyDeep",value:function(){if(arguments.length===1){for(var e=arguments[0],t=new Array(e.length).fill(null),n=0;n<e.length;n++)t[n]=e[n].copy();return t}if(arguments.length===5)for(var s=arguments[0],c=arguments[1],h=arguments[2],g=arguments[3],d=arguments[4],E=0;E<d;E++)h[g+E]=s[c+E].copy()}},{key:"isEqualReversed",value:function(e,t){for(var n=0;n<e.length;n++){var s=e[n],c=t[e.length-n-1];if(s.compareTo(c)!==0)return!1}return!0}},{key:"envelope",value:function(e){for(var t=new Se,n=0;n<e.length;n++)t.expandToInclude(e[n]);return t}},{key:"toCoordinateArray",value:function(e){return e.toArray(o.coordArrayType)}},{key:"dimension",value:function(e){if(e===null||e.length===0)return 3;var t,n=0,s=P(e);try{for(s.s();!(t=s.n()).done;){var c=t.value;n=Math.max(n,ns.dimension(c))}}catch(h){s.e(h)}finally{s.f()}return n}},{key:"atLeastNCoordinatesOrNothing",value:function(e,t){return t.length>=e?t:[]}},{key:"indexOf",value:function(e,t){for(var n=0;n<t.length;n++)if(e.equals(t[n]))return n;return-1}},{key:"increasingDirection",value:function(e){for(var t=0;t<Math.trunc(e.length/2);t++){var n=e.length-1-t,s=e[t].compareTo(e[n]);if(s!==0)return s}return 1}},{key:"compare",value:function(e,t){for(var n=0;n<e.length&&n<t.length;){var s=e[n].compareTo(t[n]);if(s!==0)return s;n++}return n<t.length?-1:n<e.length?1:0}},{key:"minCoordinate",value:function(e){for(var t=null,n=0;n<e.length;n++)(t===null||t.compareTo(e[n])>0)&&(t=e[n]);return t}},{key:"extract",value:function(e,t,n){t=An.clamp(t,0,e.length);var s=(n=An.clamp(n,-1,e.length))-t+1;n<0&&(s=0),t>=e.length&&(s=0),n<t&&(s=0);var c=new Array(s).fill(null);if(s===0)return c;for(var h=0,g=t;g<=n;g++)c[h++]=e[g];return c}}]),o}(),D0=function(){function o(){i(this,o)}return l(o,[{key:"compare",value:function(e,t){var n=e,s=t;return Ye.compare(n,s)}},{key:"interfaces_",get:function(){return[ze]}}]),o}(),F0=function(){function o(){i(this,o)}return l(o,[{key:"compare",value:function(e,t){var n=e,s=t;if(n.length<s.length)return-1;if(n.length>s.length)return 1;if(n.length===0)return 0;var c=Ye.compare(n,s);return Ye.isEqualReversed(n,s)?0:c}},{key:"OLDcompare",value:function(e,t){var n=e,s=t;if(n.length<s.length)return-1;if(n.length>s.length)return 1;if(n.length===0)return 0;for(var c=Ye.increasingDirection(n),h=Ye.increasingDirection(s),g=c>0?0:n.length-1,d=h>0?0:n.length-1,E=0;E<n.length;E++){var w=n[g].compareTo(s[d]);if(w!==0)return w;g+=c,d+=h}return 0}},{key:"interfaces_",get:function(){return[ze]}}]),o}();Ye.ForwardComparator=D0,Ye.BidirectionalComparator=F0,Ye.coordArrayType=new Array(0).fill(null);var rs=function(){function o(e){i(this,o),this.str=e}return l(o,[{key:"append",value:function(e){this.str+=e}},{key:"setCharAt",value:function(e,t){this.str=this.str.substr(0,e)+t+this.str.substr(e+1)}},{key:"toString",value:function(){return this.str}}]),o}(),Qr=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"getM",value:function(e){return this.hasM()?this._coordinates[e].getM():K.NaN}},{key:"setOrdinate",value:function(e,t,n){switch(t){case ve.X:this._coordinates[e].x=n;break;case ve.Y:this._coordinates[e].y=n;break;default:this._coordinates[e].setOrdinate(t,n)}}},{key:"getZ",value:function(e){return this.hasZ()?this._coordinates[e].getZ():K.NaN}},{key:"size",value:function(){return this._coordinates.length}},{key:"getOrdinate",value:function(e,t){switch(t){case ve.X:return this._coordinates[e].x;case ve.Y:return this._coordinates[e].y;default:return this._coordinates[e].getOrdinate(t)}}},{key:"getCoordinate",value:function(){if(arguments.length===1){var e=arguments[0];return this._coordinates[e]}if(arguments.length===2){var t=arguments[0],n=arguments[1];n.setCoordinate(this._coordinates[t])}}},{key:"getCoordinateCopy",value:function(e){var t=this.createCoordinate();return t.setCoordinate(this._coordinates[e]),t}},{key:"createCoordinate",value:function(){return ns.create(this.getDimension(),this.getMeasures())}},{key:"getDimension",value:function(){return this._dimension}},{key:"getX",value:function(e){return this._coordinates[e].x}},{key:"getMeasures",value:function(){return this._measures}},{key:"expandEnvelope",value:function(e){for(var t=0;t<this._coordinates.length;t++)e.expandToInclude(this._coordinates[t]);return e}},{key:"copy",value:function(){for(var e=new Array(this.size()).fill(null),t=0;t<this._coordinates.length;t++){var n=this.createCoordinate();n.setCoordinate(this._coordinates[t]),e[t]=n}return new o(e,this._dimension,this._measures)}},{key:"toString",value:function(){if(this._coordinates.length>0){var e=new rs(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var t=1;t<this._coordinates.length;t++)e.append(", "),e.append(this._coordinates[t]);return e.append(")"),e.toString()}return"()"}},{key:"getY",value:function(e){return this._coordinates[e].y}},{key:"toCoordinateArray",value:function(){return this._coordinates}},{key:"interfaces_",get:function(){return[ve,A]}}],[{key:"constructor_",value:function(){if(this._dimension=3,this._measures=0,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];o.constructor_.call(this,e,Ye.dimension(e),Ye.measures(e))}else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var n=0;n<t;n++)this._coordinates[n]=new C}else if(le(arguments[0],ve)){var s=arguments[0];if(s===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=s.getDimension(),this._measures=s.getMeasures(),this._coordinates=new Array(s.size()).fill(null);for(var c=0;c<this._coordinates.length;c++)this._coordinates[c]=s.getCoordinateCopy(c)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var h=arguments[0],g=arguments[1];o.constructor_.call(this,h,g,Ye.measures(h))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var d=arguments[0],E=arguments[1];this._coordinates=new Array(d).fill(null),this._dimension=E;for(var w=0;w<d;w++)this._coordinates[w]=ns.create(E)}}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var N=arguments[0],F=arguments[1],j=arguments[2];this._dimension=F,this._measures=j,this._coordinates=N===null?new Array(0).fill(null):N}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var X=arguments[0],$=arguments[1],re=arguments[2];this._coordinates=new Array(X).fill(null),this._dimension=$,this._measures=re;for(var fe=0;fe<X;fe++)this._coordinates[fe]=this.createCoordinate()}}}}]),o}(),Ya=function(){function o(){i(this,o)}return l(o,[{key:"readResolve",value:function(){return o.instance()}},{key:"create",value:function(){if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new Qr(e)}if(le(arguments[0],ve)){var t=arguments[0];return new Qr(t)}}else{if(arguments.length===2){var n=arguments[0],s=arguments[1];return s>3&&(s=3),s<2&&(s=2),new Qr(n,s)}if(arguments.length===3){var c=arguments[0],h=arguments[1],g=arguments[2],d=h-g;return g>1&&(g=1),d>3&&(d=3),d<2&&(d=2),new Qr(c,d+g,g)}}}},{key:"interfaces_",get:function(){return[es,A]}}],[{key:"instance",value:function(){return o.instanceObject}}]),o}();Ya.instanceObject=new Ya;var Wa=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"copyInternal",value:function(){for(var n=new Array(this._geometries.length).fill(null),s=0;s<n.length;s++)n[s]=this._geometries[s].copy();return new t(n,this._factory)}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof J){var n=arguments[0],s=arguments[1];return!!this.isEquivalentClass(n)&&b(v(t.prototype),"equalsExact",this).call(this,n,s)}return b(v(t.prototype),"equalsExact",this).apply(this,arguments)}},{key:"getBoundaryDimension",value:function(){return 1}},{key:"getTypeCode",value:function(){return J.TYPECODE_MULTIPOLYGON}},{key:"getDimension",value:function(){return 2}},{key:"getBoundary",value:function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var n=new ne,s=0;s<this._geometries.length;s++)for(var c=this._geometries[s].getBoundary(),h=0;h<c.getNumGeometries();h++)n.add(c.getGeometryN(h));var g=new Array(n.size()).fill(null);return this.getFactory().createMultiLineString(n.toArray(g))}},{key:"getGeometryType",value:function(){return J.TYPENAME_MULTIPOLYGON}},{key:"interfaces_",get:function(){return[fr]}}],[{key:"constructor_",value:function(){var n=arguments[0],s=arguments[1];ft.constructor_.call(this,n,s)}}]),t}(ft),vf=function(){function o(){i(this,o)}return l(o,[{key:"get",value:function(){}},{key:"put",value:function(){}},{key:"size",value:function(){}},{key:"values",value:function(){}},{key:"entrySet",value:function(){}}]),o}(),G0=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),(n=e.call(this)).map=new Map,n}return l(t,[{key:"get",value:function(n){return this.map.get(n)||null}},{key:"put",value:function(n,s){return this.map.set(n,s),s}},{key:"values",value:function(){for(var n=new ne,s=this.map.values(),c=s.next();!c.done;)n.add(c.value),c=s.next();return n}},{key:"entrySet",value:function(){var n=new st;return this.map.entries().forEach(function(s){return n.add(s)}),n}},{key:"size",value:function(){return this.map.size()}}]),t}(vf),Mt=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"equals",value:function(e){if(!(e instanceof o))return!1;var t=e;return this._modelType===t._modelType&&this._scale===t._scale}},{key:"compareTo",value:function(e){var t=e,n=this.getMaximumSignificantDigits(),s=t.getMaximumSignificantDigits();return lt.compare(n,s)}},{key:"getScale",value:function(){return this._scale}},{key:"isFloating",value:function(){return this._modelType===o.FLOATING||this._modelType===o.FLOATING_SINGLE}},{key:"getType",value:function(){return this._modelType}},{key:"toString",value:function(){var e="UNKNOWN";return this._modelType===o.FLOATING?e="Floating":this._modelType===o.FLOATING_SINGLE?e="Floating-Single":this._modelType===o.FIXED&&(e="Fixed (Scale="+this.getScale()+")"),e}},{key:"makePrecise",value:function(){if(typeof arguments[0]=="number"){var e=arguments[0];return K.isNaN(e)||this._modelType===o.FLOATING_SINGLE?e:this._modelType===o.FIXED?Math.round(e*this._scale)/this._scale:e}if(arguments[0]instanceof C){var t=arguments[0];if(this._modelType===o.FLOATING)return null;t.x=this.makePrecise(t.x),t.y=this.makePrecise(t.y)}}},{key:"getMaximumSignificantDigits",value:function(){var e=16;return this._modelType===o.FLOATING?e=16:this._modelType===o.FLOATING_SINGLE?e=6:this._modelType===o.FIXED&&(e=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),e}},{key:"setScale",value:function(e){this._scale=Math.abs(e)}},{key:"interfaces_",get:function(){return[A,q]}}],[{key:"constructor_",value:function(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=o.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof gr){var e=arguments[0];this._modelType=e,e===o.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var t=arguments[0];this._modelType=o.FIXED,this.setScale(t)}else if(arguments[0]instanceof o){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}}}},{key:"mostPrecise",value:function(e,t){return e.compareTo(t)>=0?e:t}}]),o}(),gr=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"readResolve",value:function(){return o.nameToTypeMap.get(this._name)}},{key:"toString",value:function(){return this._name}},{key:"interfaces_",get:function(){return[A]}}],[{key:"constructor_",value:function(){this._name=null;var e=arguments[0];this._name=e,o.nameToTypeMap.put(e,this)}}]),o}();gr.nameToTypeMap=new G0,Mt.Type=gr,Mt.FIXED=new gr("FIXED"),Mt.FLOATING=new gr("FLOATING"),Mt.FLOATING_SINGLE=new gr("FLOATING SINGLE"),Mt.maximumPreciseValue=9007199254740992;var Xa=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"copyInternal",value:function(){for(var n=new Array(this._geometries.length).fill(null),s=0;s<n.length;s++)n[s]=this._geometries[s].copy();return new t(n,this._factory)}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof J){var n=arguments[0],s=arguments[1];return!!this.isEquivalentClass(n)&&b(v(t.prototype),"equalsExact",this).call(this,n,s)}return b(v(t.prototype),"equalsExact",this).apply(this,arguments)}},{key:"getBoundaryDimension",value:function(){return this.isClosed()?V.FALSE:0}},{key:"isClosed",value:function(){if(this.isEmpty())return!1;for(var n=0;n<this._geometries.length;n++)if(!this._geometries[n].isClosed())return!1;return!0}},{key:"getTypeCode",value:function(){return J.TYPECODE_MULTILINESTRING}},{key:"getDimension",value:function(){return 1}},{key:"getBoundary",value:function(){throw new ue}},{key:"getGeometryType",value:function(){return J.TYPENAME_MULTILINESTRING}},{key:"interfaces_",get:function(){return[ts]}}],[{key:"constructor_",value:function(){var n=arguments[0],s=arguments[1];ft.constructor_.call(this,n,s)}}]),t}(ft),yr=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"createEmpty",value:function(e){switch(e){case-1:return this.createGeometryCollection();case 0:return this.createPoint();case 1:return this.createLineString();case 2:return this.createPolygon();default:throw new M("Invalid dimension: "+e)}}},{key:"toGeometry",value:function(e){return e.isNull()?this.createPoint():e.getMinX()===e.getMaxX()&&e.getMinY()===e.getMaxY()?this.createPoint(new C(e.getMinX(),e.getMinY())):e.getMinX()===e.getMaxX()||e.getMinY()===e.getMaxY()?this.createLineString([new C(e.getMinX(),e.getMinY()),new C(e.getMaxX(),e.getMaxY())]):this.createPolygon(this.createLinearRing([new C(e.getMinX(),e.getMinY()),new C(e.getMinX(),e.getMaxY()),new C(e.getMaxX(),e.getMaxY()),new C(e.getMaxX(),e.getMinY()),new C(e.getMinX(),e.getMinY())]),null)}},{key:"createLineString",value:function(){if(arguments.length===0)return this.createLineString(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return this.createLineString(e!==null?this.getCoordinateSequenceFactory().create(e):null)}if(le(arguments[0],ve)){var t=arguments[0];return new Ue(t,this)}}}},{key:"createMultiLineString",value:function(){if(arguments.length===0)return new Xa(null,this);if(arguments.length===1){var e=arguments[0];return new Xa(e,this)}}},{key:"buildGeometry",value:function(e){for(var t=null,n=!1,s=!1,c=e.iterator();c.hasNext();){var h=c.next(),g=h.getTypeCode();t===null&&(t=g),g!==t&&(n=!0),h instanceof ft&&(s=!0)}if(t===null)return this.createGeometryCollection();if(n||s)return this.createGeometryCollection(o.toGeometryArray(e));var d=e.iterator().next();if(e.size()>1){if(d instanceof En)return this.createMultiPolygon(o.toPolygonArray(e));if(d instanceof Ue)return this.createMultiLineString(o.toLineStringArray(e));if(d instanceof ge)return this.createMultiPoint(o.toPointArray(e));he.shouldNeverReachHere("Unhandled geometry type: "+d.getGeometryType())}return d}},{key:"createMultiPointFromCoords",value:function(e){return this.createMultiPoint(e!==null?this.getCoordinateSequenceFactory().create(e):null)}},{key:"createPoint",value:function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof C){var e=arguments[0];return this.createPoint(e!==null?this.getCoordinateSequenceFactory().create([e]):null)}if(le(arguments[0],ve)){var t=arguments[0];return new ge(t,this)}}}},{key:"getCoordinateSequenceFactory",value:function(){return this._coordinateSequenceFactory}},{key:"createPolygon",value:function(){if(arguments.length===0)return this.createPolygon(null,null);if(arguments.length===1){if(le(arguments[0],ve)){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof Array){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Hr){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var s=arguments[0],c=arguments[1];return new En(s,c,this)}}},{key:"getSRID",value:function(){return this._SRID}},{key:"createGeometryCollection",value:function(){if(arguments.length===0)return new ft(null,this);if(arguments.length===1){var e=arguments[0];return new ft(e,this)}}},{key:"getPrecisionModel",value:function(){return this._precisionModel}},{key:"createLinearRing",value:function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return this.createLinearRing(e!==null?this.getCoordinateSequenceFactory().create(e):null)}if(le(arguments[0],ve)){var t=arguments[0];return new Hr(t,this)}}}},{key:"createMultiPolygon",value:function(){if(arguments.length===0)return new Wa(null,this);if(arguments.length===1){var e=arguments[0];return new Wa(e,this)}}},{key:"createMultiPoint",value:function(){if(arguments.length===0)return new za(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new za(e,this)}if(le(arguments[0],ve)){var t=arguments[0];if(t===null)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(t.size()).fill(null),s=0;s<t.size();s++){var c=this.getCoordinateSequenceFactory().create(1,t.getDimension(),t.getMeasures());tn.copy(t,s,c,0,1),n[s]=this.createPoint(c)}return this.createMultiPoint(n)}}}},{key:"interfaces_",get:function(){return[A]}}],[{key:"constructor_",value:function(){if(this._precisionModel=null,this._coordinateSequenceFactory=null,this._SRID=null,arguments.length===0)o.constructor_.call(this,new Mt,0);else if(arguments.length===1){if(le(arguments[0],es)){var e=arguments[0];o.constructor_.call(this,new Mt,0,e)}else if(arguments[0]instanceof Mt){var t=arguments[0];o.constructor_.call(this,t,0,o.getDefaultCoordinateSequenceFactory())}}else if(arguments.length===2){var n=arguments[0],s=arguments[1];o.constructor_.call(this,n,s,o.getDefaultCoordinateSequenceFactory())}else if(arguments.length===3){var c=arguments[0],h=arguments[1],g=arguments[2];this._precisionModel=c,this._coordinateSequenceFactory=g,this._SRID=h}}},{key:"toMultiPolygonArray",value:function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)}},{key:"toGeometryArray",value:function(e){if(e===null)return null;var t=new Array(e.size()).fill(null);return e.toArray(t)}},{key:"getDefaultCoordinateSequenceFactory",value:function(){return Ya.instance()}},{key:"toMultiLineStringArray",value:function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)}},{key:"toLineStringArray",value:function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)}},{key:"toMultiPointArray",value:function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)}},{key:"toLinearRingArray",value:function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)}},{key:"toPointArray",value:function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)}},{key:"toPolygonArray",value:function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)}},{key:"createPointFromInternalCoord",value:function(e,t){return t.getPrecisionModel().makePrecise(e),t.getFactory().createPoint(e)}}]),o}(),ja="XY",B0="XYZ",q0="XYM",z0="XYZM",df={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"},mf="EMPTY",is=1,nn=2,kn=3,pf=4,vr=5,U0=6;for(var Y0 in df)df[Y0].toUpperCase();var W0=function(){function o(e){i(this,o),this.wkt=e,this.index_=-1}return l(o,[{key:"isAlpha_",value:function(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}},{key:"isNumeric_",value:function(e,t){return e>="0"&&e<="9"||e=="."&&!(t!==void 0&&t)}},{key:"isWhiteSpace_",value:function(e){return e==" "||e==" "||e=="\r"||e==`
8
- `}},{key:"nextChar_",value:function(){return this.wkt.charAt(++this.index_)}},{key:"nextToken",value:function(){var e,t=this.nextChar_(),n=this.index_,s=t;if(t=="(")e=nn;else if(t==",")e=vr;else if(t==")")e=kn;else if(this.isNumeric_(t)||t=="-")e=pf,s=this.readNumber_();else if(this.isAlpha_(t))e=is,s=this.readText_();else{if(this.isWhiteSpace_(t))return this.nextToken();if(t!=="")throw new Error("Unexpected character: "+t);e=U0}return{position:n,value:s,type:e}}},{key:"readNumber_",value:function(){var e,t=this.index_,n=!1,s=!1;do e=="."?n=!0:e!="e"&&e!="E"||(s=!0),e=this.nextChar_();while(this.isNumeric_(e,n)||!s&&(e=="e"||e=="E")||s&&(e=="-"||e=="+"));return parseFloat(this.wkt.substring(t,this.index_--))}},{key:"readText_",value:function(){var e,t=this.index_;do e=this.nextChar_();while(this.isAlpha_(e));return this.wkt.substring(t,this.index_--).toUpperCase()}}]),o}(),X0=function(){function o(e,t){i(this,o),this.lexer_=e,this.token_,this.layout_=ja,this.factory=t}return l(o,[{key:"consume_",value:function(){this.token_=this.lexer_.nextToken()}},{key:"isTokenType",value:function(e){return this.token_.type==e}},{key:"match",value:function(e){var t=this.isTokenType(e);return t&&this.consume_(),t}},{key:"parse",value:function(){return this.consume_(),this.parseGeometry_()}},{key:"parseGeometryLayout_",value:function(){var e=ja,t=this.token_;if(this.isTokenType(is)){var n=t.value;n==="Z"?e=B0:n==="M"?e=q0:n==="ZM"&&(e=z0),e!==ja&&this.consume_()}return e}},{key:"parseGeometryCollectionText_",value:function(){if(this.match(nn)){var e=[];do e.push(this.parseGeometry_());while(this.match(vr));if(this.match(kn))return e}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePointText_",value:function(){if(this.match(nn)){var e=this.parsePoint_();if(this.match(kn))return e}else if(this.isEmptyGeometry_())return null;throw new Error(this.formatErrorMessage_())}},{key:"parseLineStringText_",value:function(){if(this.match(nn)){var e=this.parsePointList_();if(this.match(kn))return e}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePolygonText_",value:function(){if(this.match(nn)){var e=this.parseLineStringTextList_();if(this.match(kn))return e}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiPointText_",value:function(){var e;if(this.match(nn)){if(e=this.token_.type==nn?this.parsePointTextList_():this.parsePointList_(),this.match(kn))return e}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiLineStringText_",value:function(){if(this.match(nn)){var e=this.parseLineStringTextList_();if(this.match(kn))return e}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiPolygonText_",value:function(){if(this.match(nn)){var e=this.parsePolygonTextList_();if(this.match(kn))return e}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePoint_",value:function(){for(var e=[],t=this.layout_.length,n=0;n<t;++n){var s=this.token_;if(!this.match(pf))break;e.push(s.value)}if(e.length==t)return e;throw new Error(this.formatErrorMessage_())}},{key:"parsePointList_",value:function(){for(var e=[this.parsePoint_()];this.match(vr);)e.push(this.parsePoint_());return e}},{key:"parsePointTextList_",value:function(){for(var e=[this.parsePointText_()];this.match(vr);)e.push(this.parsePointText_());return e}},{key:"parseLineStringTextList_",value:function(){for(var e=[this.parseLineStringText_()];this.match(vr);)e.push(this.parseLineStringText_());return e}},{key:"parsePolygonTextList_",value:function(){for(var e=[this.parsePolygonText_()];this.match(vr);)e.push(this.parsePolygonText_());return e}},{key:"isEmptyGeometry_",value:function(){var e=this.isTokenType(is)&&this.token_.value==mf;return e&&this.consume_(),e}},{key:"formatErrorMessage_",value:function(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"}},{key:"parseGeometry_",value:function(){var e=this.factory,t=function(re){return _(C,L(re))},n=function(re){var fe=re.map(function(ke){return e.createLinearRing(ke.map(t))});return fe.length>1?e.createPolygon(fe[0],fe.slice(1)):e.createPolygon(fe[0])},s=this.token_;if(this.match(is)){var c=s.value;if(this.layout_=this.parseGeometryLayout_(),c=="GEOMETRYCOLLECTION"){var h=this.parseGeometryCollectionText_();return e.createGeometryCollection(h)}switch(c){case"POINT":var g=this.parsePointText_();return g?e.createPoint(_(C,L(g))):e.createPoint();case"LINESTRING":var d=this.parseLineStringText_().map(t);return e.createLineString(d);case"LINEARRING":var E=this.parseLineStringText_().map(t);return e.createLinearRing(E);case"POLYGON":var w=this.parsePolygonText_();return w&&w.length!==0?n(w):e.createPolygon();case"MULTIPOINT":var N=this.parseMultiPointText_();if(!N||N.length===0)return e.createMultiPoint();var F=N.map(t).map(function(re){return e.createPoint(re)});return e.createMultiPoint(F);case"MULTILINESTRING":var j=this.parseMultiLineStringText_().map(function(re){return e.createLineString(re.map(t))});return e.createMultiLineString(j);case"MULTIPOLYGON":var X=this.parseMultiPolygonText_();if(!X||X.length===0)return e.createMultiPolygon();var $=X.map(n);return e.createMultiPolygon($);default:throw new Error("Invalid geometry type: "+c)}}throw new Error(this.formatErrorMessage_())}}]),o}();function _f(o){if(o.isEmpty())return"";var e=o.getCoordinate(),t=[e.x,e.y];return e.z===void 0||Number.isNaN(e.z)||t.push(e.z),e.m===void 0||Number.isNaN(e.m)||t.push(e.m),t.join(" ")}function Kr(o){for(var e=o.getCoordinates().map(function(c){var h=[c.x,c.y];return c.z===void 0||Number.isNaN(c.z)||h.push(c.z),c.m===void 0||Number.isNaN(c.m)||h.push(c.m),h}),t=[],n=0,s=e.length;n<s;++n)t.push(e[n].join(" "));return t.join(", ")}function Ef(o){var e=[];e.push("("+Kr(o.getExteriorRing())+")");for(var t=0,n=o.getNumInteriorRing();t<n;++t)e.push("("+Kr(o.getInteriorRingN(t))+")");return e.join(", ")}var j0={Point:_f,LineString:Kr,LinearRing:Kr,Polygon:Ef,MultiPoint:function(o){for(var e=[],t=0,n=o.getNumGeometries();t<n;++t)e.push("("+_f(o.getGeometryN(t))+")");return e.join(", ")},MultiLineString:function(o){for(var e=[],t=0,n=o.getNumGeometries();t<n;++t)e.push("("+Kr(o.getGeometryN(t))+")");return e.join(", ")},MultiPolygon:function(o){for(var e=[],t=0,n=o.getNumGeometries();t<n;++t)e.push("("+Ef(o.getGeometryN(t))+")");return e.join(", ")},GeometryCollection:function(o){for(var e=[],t=0,n=o.getNumGeometries();t<n;++t)e.push(kf(o.getGeometryN(t)));return e.join(", ")}};function kf(o){var e=o.getGeometryType(),t=j0[e];e=e.toUpperCase();var n=function(s){var c="";if(s.isEmpty())return c;var h=s.getCoordinate();return h.z===void 0||Number.isNaN(h.z)||(c+="Z"),h.m===void 0||Number.isNaN(h.m)||(c+="M"),c}(o);return n.length>0&&(e+=" "+n),o.isEmpty()?e+" "+mf:e+" ("+t(o)+")"}var V0=function(){function o(e){i(this,o),this.geometryFactory=e||new yr,this.precisionModel=this.geometryFactory.getPrecisionModel()}return l(o,[{key:"read",value:function(e){var t=new W0(e);return new X0(t,this.geometryFactory).parse()}},{key:"write",value:function(e){return kf(e)}}]),o}(),Va=function(){function o(e){i(this,o),this.parser=new V0(e)}return l(o,[{key:"write",value:function(e){return this.parser.write(e)}}],[{key:"toLineString",value:function(e,t){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+e.x+" "+e.y+", "+t.x+" "+t.y+" )"}}]),o}(),Me=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"getIndexAlongSegment",value:function(e,t){return this.computeIntLineIndex(),this._intLineIndex[e][t]}},{key:"getTopologySummary",value:function(){var e=new rs;return this.isEndPoint()&&e.append(" endpoint"),this._isProper&&e.append(" proper"),this.isCollinear()&&e.append(" collinear"),e.toString()}},{key:"computeIntersection",value:function(e,t,n,s){this._inputLines[0][0]=e,this._inputLines[0][1]=t,this._inputLines[1][0]=n,this._inputLines[1][1]=s,this._result=this.computeIntersect(e,t,n,s)}},{key:"getIntersectionNum",value:function(){return this._result}},{key:"computeIntLineIndex",value:function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var e=arguments[0],t=this.getEdgeDistance(e,0),n=this.getEdgeDistance(e,1);t>n?(this._intLineIndex[e][0]=0,this._intLineIndex[e][1]=1):(this._intLineIndex[e][0]=1,this._intLineIndex[e][1]=0)}}},{key:"isProper",value:function(){return this.hasIntersection()&&this._isProper}},{key:"setPrecisionModel",value:function(e){this._precisionModel=e}},{key:"isInteriorIntersection",value:function(){if(arguments.length===0)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(arguments.length===1){for(var e=arguments[0],t=0;t<this._result;t++)if(!this._intPt[t].equals2D(this._inputLines[e][0])&&!this._intPt[t].equals2D(this._inputLines[e][1]))return!0;return!1}}},{key:"getIntersection",value:function(e){return this._intPt[e]}},{key:"isEndPoint",value:function(){return this.hasIntersection()&&!this._isProper}},{key:"hasIntersection",value:function(){return this._result!==o.NO_INTERSECTION}},{key:"getEdgeDistance",value:function(e,t){return o.computeEdgeDistance(this._intPt[t],this._inputLines[e][0],this._inputLines[e][1])}},{key:"isCollinear",value:function(){return this._result===o.COLLINEAR_INTERSECTION}},{key:"toString",value:function(){return Va.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Va.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()}},{key:"getEndpoint",value:function(e,t){return this._inputLines[e][t]}},{key:"isIntersection",value:function(e){for(var t=0;t<this._result;t++)if(this._intPt[t].equals2D(e))return!0;return!1}},{key:"getIntersectionAlongSegment",value:function(e,t){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[e][t]]}}],[{key:"constructor_",value:function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new C,this._intPt[1]=new C,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0}},{key:"computeEdgeDistance",value:function(e,t,n){var s=Math.abs(n.x-t.x),c=Math.abs(n.y-t.y),h=-1;if(e.equals(t))h=0;else if(e.equals(n))h=s>c?s:c;else{var g=Math.abs(e.x-t.x),d=Math.abs(e.y-t.y);(h=s>c?g:d)!==0||e.equals(t)||(h=Math.max(g,d))}return he.isTrue(!(h===0&&!e.equals(t)),"Bad distance calculation"),h}},{key:"nonRobustComputeEdgeDistance",value:function(e,t,n){var s=e.x-t.x,c=e.y-t.y,h=Math.sqrt(s*s+c*c);return he.isTrue(!(h===0&&!e.equals(t)),"Invalid distance calculation"),h}}]),o}();Me.DONT_INTERSECT=0,Me.DO_INTERSECT=1,Me.COLLINEAR=2,Me.NO_INTERSECTION=0,Me.POINT_INTERSECTION=1,Me.COLLINEAR_INTERSECTION=2;var Gn=function(o){f(t,o);var e=S(t);function t(){return i(this,t),e.call(this)}return l(t,[{key:"isInSegmentEnvelopes",value:function(n){var s=new Se(this._inputLines[0][0],this._inputLines[0][1]),c=new Se(this._inputLines[1][0],this._inputLines[1][1]);return s.contains(n)&&c.contains(n)}},{key:"computeIntersection",value:function(){if(arguments.length!==3)return b(v(t.prototype),"computeIntersection",this).apply(this,arguments);var n=arguments[0],s=arguments[1],c=arguments[2];if(this._isProper=!1,Se.intersects(s,c,n)&&ae.index(s,c,n)===0&&ae.index(c,s,n)===0)return this._isProper=!0,(n.equals(s)||n.equals(c))&&(this._isProper=!1),this._result=Me.POINT_INTERSECTION,null;this._result=Me.NO_INTERSECTION}},{key:"intersection",value:function(n,s,c,h){var g=this.intersectionSafe(n,s,c,h);return this.isInSegmentEnvelopes(g)||(g=new C(t.nearestEndpoint(n,s,c,h))),this._precisionModel!==null&&this._precisionModel.makePrecise(g),g}},{key:"checkDD",value:function(n,s,c,h,g){var d=Pn.intersection(n,s,c,h),E=this.isInSegmentEnvelopes(d);ot.out.println("DD in env = "+E+" --------------------- "+d),g.distance(d)>1e-4&&ot.out.println("Distance = "+g.distance(d))}},{key:"intersectionSafe",value:function(n,s,c,h){var g=Vr.intersection(n,s,c,h);return g===null&&(g=t.nearestEndpoint(n,s,c,h)),g}},{key:"computeCollinearIntersection",value:function(n,s,c,h){var g=Se.intersects(n,s,c),d=Se.intersects(n,s,h),E=Se.intersects(c,h,n),w=Se.intersects(c,h,s);return g&&d?(this._intPt[0]=c,this._intPt[1]=h,Me.COLLINEAR_INTERSECTION):E&&w?(this._intPt[0]=n,this._intPt[1]=s,Me.COLLINEAR_INTERSECTION):g&&E?(this._intPt[0]=c,this._intPt[1]=n,!c.equals(n)||d||w?Me.COLLINEAR_INTERSECTION:Me.POINT_INTERSECTION):g&&w?(this._intPt[0]=c,this._intPt[1]=s,!c.equals(s)||d||E?Me.COLLINEAR_INTERSECTION:Me.POINT_INTERSECTION):d&&E?(this._intPt[0]=h,this._intPt[1]=n,!h.equals(n)||g||w?Me.COLLINEAR_INTERSECTION:Me.POINT_INTERSECTION):d&&w?(this._intPt[0]=h,this._intPt[1]=s,!h.equals(s)||g||E?Me.COLLINEAR_INTERSECTION:Me.POINT_INTERSECTION):Me.NO_INTERSECTION}},{key:"computeIntersect",value:function(n,s,c,h){if(this._isProper=!1,!Se.intersects(n,s,c,h))return Me.NO_INTERSECTION;var g=ae.index(n,s,c),d=ae.index(n,s,h);if(g>0&&d>0||g<0&&d<0)return Me.NO_INTERSECTION;var E=ae.index(c,h,n),w=ae.index(c,h,s);return E>0&&w>0||E<0&&w<0?Me.NO_INTERSECTION:g===0&&d===0&&E===0&&w===0?this.computeCollinearIntersection(n,s,c,h):(g===0||d===0||E===0||w===0?(this._isProper=!1,n.equals2D(c)||n.equals2D(h)?this._intPt[0]=n:s.equals2D(c)||s.equals2D(h)?this._intPt[0]=s:g===0?this._intPt[0]=new C(c):d===0?this._intPt[0]=new C(h):E===0?this._intPt[0]=new C(n):w===0&&(this._intPt[0]=new C(s))):(this._isProper=!0,this._intPt[0]=this.intersection(n,s,c,h)),Me.POINT_INTERSECTION)}}],[{key:"nearestEndpoint",value:function(n,s,c,h){var g=n,d=xt.pointToSegment(n,c,h),E=xt.pointToSegment(s,c,h);return E<d&&(d=E,g=s),(E=xt.pointToSegment(c,n,s))<d&&(d=E,g=c),(E=xt.pointToSegment(h,n,s))<d&&(d=E,g=h),g}}]),t}(Me),H0=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"countSegment",value:function(e,t){if(e.x<this._p.x&&t.x<this._p.x)return null;if(this._p.x===t.x&&this._p.y===t.y)return this._isPointOnSegment=!0,null;if(e.y===this._p.y&&t.y===this._p.y){var n=e.x,s=t.x;return n>s&&(n=t.x,s=e.x),this._p.x>=n&&this._p.x<=s&&(this._isPointOnSegment=!0),null}if(e.y>this._p.y&&t.y<=this._p.y||t.y>this._p.y&&e.y<=this._p.y){var c=ae.index(e,t,this._p);if(c===ae.COLLINEAR)return this._isPointOnSegment=!0,null;t.y<e.y&&(c=-c),c===ae.LEFT&&this._crossingCount++}}},{key:"isPointInPolygon",value:function(){return this.getLocation()!==I.EXTERIOR}},{key:"getLocation",value:function(){return this._isPointOnSegment?I.BOUNDARY:this._crossingCount%2==1?I.INTERIOR:I.EXTERIOR}},{key:"isOnSegment",value:function(){return this._isPointOnSegment}}],[{key:"constructor_",value:function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var e=arguments[0];this._p=e}},{key:"locatePointInRing",value:function(){if(arguments[0]instanceof C&&le(arguments[1],ve)){for(var e=arguments[0],t=arguments[1],n=new o(e),s=new C,c=new C,h=1;h<t.size();h++)if(t.getCoordinate(h,s),t.getCoordinate(h-1,c),n.countSegment(s,c),n.isOnSegment())return n.getLocation();return n.getLocation()}if(arguments[0]instanceof C&&arguments[1]instanceof Array){for(var g=arguments[0],d=arguments[1],E=new o(g),w=1;w<d.length;w++){var N=d[w],F=d[w-1];if(E.countSegment(N,F),E.isOnSegment())return E.getLocation()}return E.getLocation()}}}]),o}(),Ha=function(){function o(){i(this,o)}return l(o,null,[{key:"isOnLine",value:function(){if(arguments[0]instanceof C&&le(arguments[1],ve)){for(var e=arguments[0],t=arguments[1],n=new Gn,s=new C,c=new C,h=t.size(),g=1;g<h;g++)if(t.getCoordinate(g-1,s),t.getCoordinate(g,c),n.computeIntersection(e,s,c),n.hasIntersection())return!0;return!1}if(arguments[0]instanceof C&&arguments[1]instanceof Array){for(var d=arguments[0],E=arguments[1],w=new Gn,N=1;N<E.length;N++){var F=E[N-1],j=E[N];if(w.computeIntersection(d,F,j),w.hasIntersection())return!0}return!1}}},{key:"locateInRing",value:function(e,t){return H0.locatePointInRing(e,t)}},{key:"isInRing",value:function(e,t){return o.locateInRing(e,t)!==I.EXTERIOR}}]),o}(),bt=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"setAllLocations",value:function(e){for(var t=0;t<this.location.length;t++)this.location[t]=e}},{key:"isNull",value:function(){for(var e=0;e<this.location.length;e++)if(this.location[e]!==I.NONE)return!1;return!0}},{key:"setAllLocationsIfNull",value:function(e){for(var t=0;t<this.location.length;t++)this.location[t]===I.NONE&&(this.location[t]=e)}},{key:"isLine",value:function(){return this.location.length===1}},{key:"merge",value:function(e){if(e.location.length>this.location.length){var t=new Array(3).fill(null);t[W.ON]=this.location[W.ON],t[W.LEFT]=I.NONE,t[W.RIGHT]=I.NONE,this.location=t}for(var n=0;n<this.location.length;n++)this.location[n]===I.NONE&&n<e.location.length&&(this.location[n]=e.location[n])}},{key:"getLocations",value:function(){return this.location}},{key:"flip",value:function(){if(this.location.length<=1)return null;var e=this.location[W.LEFT];this.location[W.LEFT]=this.location[W.RIGHT],this.location[W.RIGHT]=e}},{key:"toString",value:function(){var e=new Mn;return this.location.length>1&&e.append(I.toLocationSymbol(this.location[W.LEFT])),e.append(I.toLocationSymbol(this.location[W.ON])),this.location.length>1&&e.append(I.toLocationSymbol(this.location[W.RIGHT])),e.toString()}},{key:"setLocations",value:function(e,t,n){this.location[W.ON]=e,this.location[W.LEFT]=t,this.location[W.RIGHT]=n}},{key:"get",value:function(e){return e<this.location.length?this.location[e]:I.NONE}},{key:"isArea",value:function(){return this.location.length>1}},{key:"isAnyNull",value:function(){for(var e=0;e<this.location.length;e++)if(this.location[e]===I.NONE)return!0;return!1}},{key:"setLocation",value:function(){if(arguments.length===1){var e=arguments[0];this.setLocation(W.ON,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.location[t]=n}}},{key:"init",value:function(e){this.location=new Array(e).fill(null),this.setAllLocations(I.NONE)}},{key:"isEqualOnSide",value:function(e,t){return this.location[t]===e.location[t]}},{key:"allPositionsEqual",value:function(e){for(var t=0;t<this.location.length;t++)if(this.location[t]!==e)return!1;return!0}}],[{key:"constructor_",value:function(){if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var t=arguments[0];this.init(1),this.location[W.ON]=t}else if(arguments[0]instanceof o){var n=arguments[0];if(this.init(n.location.length),n!==null)for(var s=0;s<this.location.length;s++)this.location[s]=n.location[s]}}else if(arguments.length===3){var c=arguments[0],h=arguments[1],g=arguments[2];this.init(3),this.location[W.ON]=c,this.location[W.LEFT]=h,this.location[W.RIGHT]=g}}}]),o}(),It=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"getGeometryCount",value:function(){var e=0;return this.elt[0].isNull()||e++,this.elt[1].isNull()||e++,e}},{key:"setAllLocations",value:function(e,t){this.elt[e].setAllLocations(t)}},{key:"isNull",value:function(e){return this.elt[e].isNull()}},{key:"setAllLocationsIfNull",value:function(){if(arguments.length===1){var e=arguments[0];this.setAllLocationsIfNull(0,e),this.setAllLocationsIfNull(1,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.elt[t].setAllLocationsIfNull(n)}}},{key:"isLine",value:function(e){return this.elt[e].isLine()}},{key:"merge",value:function(e){for(var t=0;t<2;t++)this.elt[t]===null&&e.elt[t]!==null?this.elt[t]=new bt(e.elt[t]):this.elt[t].merge(e.elt[t])}},{key:"flip",value:function(){this.elt[0].flip(),this.elt[1].flip()}},{key:"getLocation",value:function(){if(arguments.length===1){var e=arguments[0];return this.elt[e].get(W.ON)}if(arguments.length===2){var t=arguments[0],n=arguments[1];return this.elt[t].get(n)}}},{key:"toString",value:function(){var e=new Mn;return this.elt[0]!==null&&(e.append("A:"),e.append(this.elt[0].toString())),this.elt[1]!==null&&(e.append(" B:"),e.append(this.elt[1].toString())),e.toString()}},{key:"isArea",value:function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var e=arguments[0];return this.elt[e].isArea()}}},{key:"isAnyNull",value:function(e){return this.elt[e].isAnyNull()}},{key:"setLocation",value:function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];this.elt[e].setLocation(W.ON,t)}else if(arguments.length===3){var n=arguments[0],s=arguments[1],c=arguments[2];this.elt[n].setLocation(s,c)}}},{key:"isEqualOnSide",value:function(e,t){return this.elt[0].isEqualOnSide(e.elt[0],t)&&this.elt[1].isEqualOnSide(e.elt[1],t)}},{key:"allPositionsEqual",value:function(e,t){return this.elt[e].allPositionsEqual(t)}},{key:"toLine",value:function(e){this.elt[e].isArea()&&(this.elt[e]=new bt(this.elt[e].location[0]))}}],[{key:"constructor_",value:function(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new bt(e),this.elt[1]=new bt(e)}else if(arguments[0]instanceof o){var t=arguments[0];this.elt[0]=new bt(t.elt[0]),this.elt[1]=new bt(t.elt[1])}}else if(arguments.length===2){var n=arguments[0],s=arguments[1];this.elt[0]=new bt(I.NONE),this.elt[1]=new bt(I.NONE),this.elt[n].setLocation(s)}else if(arguments.length===3){var c=arguments[0],h=arguments[1],g=arguments[2];this.elt[0]=new bt(c,h,g),this.elt[1]=new bt(c,h,g)}else if(arguments.length===4){var d=arguments[0],E=arguments[1],w=arguments[2],N=arguments[3];this.elt[0]=new bt(I.NONE,I.NONE,I.NONE),this.elt[1]=new bt(I.NONE,I.NONE,I.NONE),this.elt[d].setLocations(E,w,N)}}},{key:"toLineLabel",value:function(e){for(var t=new o(I.NONE),n=0;n<2;n++)t.setLocation(n,e.getLocation(n));return t}}]),o}(),ss=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"computeRing",value:function(){if(this._ring!==null)return null;for(var e=new Array(this._pts.size()).fill(null),t=0;t<this._pts.size();t++)e[t]=this._pts.get(t);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=ae.isCCW(this._ring.getCoordinates())}},{key:"isIsolated",value:function(){return this._label.getGeometryCount()===1}},{key:"computePoints",value:function(e){this._startDe=e;var t=e,n=!0;do{if(t===null)throw new ct("Found null DirectedEdge");if(t.getEdgeRing()===this)throw new ct("Directed Edge visited twice during ring-building at "+t.getCoordinate());this._edges.add(t);var s=t.getLabel();he.isTrue(s.isArea()),this.mergeLabel(s),this.addPoints(t.getEdge(),t.isForward(),n),n=!1,this.setEdgeRing(t,this),t=this.getNext(t)}while(t!==this._startDe)}},{key:"getLinearRing",value:function(){return this._ring}},{key:"getCoordinate",value:function(e){return this._pts.get(e)}},{key:"computeMaxNodeDegree",value:function(){this._maxNodeDegree=0;var e=this._startDe;do{var t=e.getNode().getEdges().getOutgoingDegree(this);t>this._maxNodeDegree&&(this._maxNodeDegree=t),e=this.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2}},{key:"addPoints",value:function(e,t,n){var s=e.getCoordinates();if(t){var c=1;n&&(c=0);for(var h=c;h<s.length;h++)this._pts.add(s[h])}else{var g=s.length-2;n&&(g=s.length-1);for(var d=g;d>=0;d--)this._pts.add(s[d])}}},{key:"isHole",value:function(){return this._isHole}},{key:"setInResult",value:function(){var e=this._startDe;do e.getEdge().setInResult(!0),e=e.getNext();while(e!==this._startDe)}},{key:"containsPoint",value:function(e){var t=this.getLinearRing();if(!t.getEnvelopeInternal().contains(e)||!Ha.isInRing(e,t.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(e))return!1;return!0}},{key:"addHole",value:function(e){this._holes.add(e)}},{key:"isShell",value:function(){return this._shell===null}},{key:"getLabel",value:function(){return this._label}},{key:"getEdges",value:function(){return this._edges}},{key:"getMaxNodeDegree",value:function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree}},{key:"getShell",value:function(){return this._shell}},{key:"mergeLabel",value:function(){if(arguments.length===1){var e=arguments[0];this.mergeLabel(e,0),this.mergeLabel(e,1)}else if(arguments.length===2){var t=arguments[0],n=arguments[1],s=t.getLocation(n,W.RIGHT);if(s===I.NONE)return null;if(this._label.getLocation(n)===I.NONE)return this._label.setLocation(n,s),null}}},{key:"setShell",value:function(e){this._shell=e,e!==null&&e.addHole(this)}},{key:"toPolygon",value:function(e){for(var t=new Array(this._holes.size()).fill(null),n=0;n<this._holes.size();n++)t[n]=this._holes.get(n).getLinearRing();return e.createPolygon(this.getLinearRing(),t)}}],[{key:"constructor_",value:function(){if(this._startDe=null,this._maxNodeDegree=-1,this._edges=new ne,this._pts=new ne,this._label=new It(I.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new ne,this._geometryFactory=null,arguments.length!==0){if(arguments.length===2){var e=arguments[0],t=arguments[1];this._geometryFactory=t,this.computePoints(e),this.computeRing()}}}}]),o}(),Z0=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"setEdgeRing",value:function(n,s){n.setMinEdgeRing(s)}},{key:"getNext",value:function(n){return n.getNextMin()}}],[{key:"constructor_",value:function(){var n=arguments[0],s=arguments[1];ss.constructor_.call(this,n,s)}}]),t}(ss),Q0=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"buildMinimalRings",value:function(){var n=new ne,s=this._startDe;do{if(s.getMinEdgeRing()===null){var c=new Z0(s,this._geometryFactory);n.add(c)}s=s.getNext()}while(s!==this._startDe);return n}},{key:"setEdgeRing",value:function(n,s){n.setEdgeRing(s)}},{key:"linkDirectedEdgesForMinimalEdgeRings",value:function(){var n=this._startDe;do n.getNode().getEdges().linkMinimalDirectedEdges(this),n=n.getNext();while(n!==this._startDe)}},{key:"getNext",value:function(n){return n.getNext()}}],[{key:"constructor_",value:function(){var n=arguments[0],s=arguments[1];ss.constructor_.call(this,n,s)}}]),t}(ss),xf=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"setVisited",value:function(e){this._isVisited=e}},{key:"setInResult",value:function(e){this._isInResult=e}},{key:"isCovered",value:function(){return this._isCovered}},{key:"isCoveredSet",value:function(){return this._isCoveredSet}},{key:"setLabel",value:function(e){this._label=e}},{key:"getLabel",value:function(){return this._label}},{key:"setCovered",value:function(e){this._isCovered=e,this._isCoveredSet=!0}},{key:"updateIM",value:function(e){he.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(e)}},{key:"isInResult",value:function(){return this._isInResult}},{key:"isVisited",value:function(){return this._isVisited}}],[{key:"constructor_",value:function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this._label=e}}}}]),o}(),as=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"isIncidentEdgeInResult",value:function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();)if(n.next().getEdge().isInResult())return!0;return!1}},{key:"isIsolated",value:function(){return this._label.getGeometryCount()===1}},{key:"getCoordinate",value:function(){return this._coord}},{key:"print",value:function(n){n.println("node "+this._coord+" lbl: "+this._label)}},{key:"computeIM",value:function(n){}},{key:"computeMergedLocation",value:function(n,s){var c=I.NONE;if(c=this._label.getLocation(s),!n.isNull(s)){var h=n.getLocation(s);c!==I.BOUNDARY&&(c=h)}return c}},{key:"setLabel",value:function(){if(arguments.length!==2||!Number.isInteger(arguments[1])||!Number.isInteger(arguments[0]))return b(v(t.prototype),"setLabel",this).apply(this,arguments);var n=arguments[0],s=arguments[1];this._label===null?this._label=new It(n,s):this._label.setLocation(n,s)}},{key:"getEdges",value:function(){return this._edges}},{key:"mergeLabel",value:function(){if(arguments[0]instanceof t){var n=arguments[0];this.mergeLabel(n._label)}else if(arguments[0]instanceof It)for(var s=arguments[0],c=0;c<2;c++){var h=this.computeMergedLocation(s,c),g=this._label.getLocation(c);g===I.NONE&&this._label.setLocation(c,h)}}},{key:"add",value:function(n){this._edges.insert(n),n.setNode(this)}},{key:"setLabelBoundary",value:function(n){if(this._label===null)return null;var s=I.NONE;this._label!==null&&(s=this._label.getLocation(n));var c=null;switch(s){case I.BOUNDARY:c=I.INTERIOR;break;case I.INTERIOR:default:c=I.BOUNDARY}this._label.setLocation(n,c)}}],[{key:"constructor_",value:function(){this._coord=null,this._edges=null;var n=arguments[0],s=arguments[1];this._coord=n,this._edges=s,this._label=new It(0,I.NONE)}}]),t}(xf),K0=function(o){f(t,o);var e=S(t);function t(){return i(this,t),e.apply(this,arguments)}return t}(vf);function Sf(o){return o==null?0:o.color}function _e(o){return o==null?null:o.parent}function Wt(o,e){o!==null&&(o.color=e)}function Za(o){return o==null?null:o.left}function bf(o){return o==null?null:o.right}var Jr=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),(n=e.call(this)).root_=null,n.size_=0,n}return l(t,[{key:"get",value:function(n){for(var s=this.root_;s!==null;){var c=n.compareTo(s.key);if(c<0)s=s.left;else{if(!(c>0))return s.value;s=s.right}}return null}},{key:"put",value:function(n,s){if(this.root_===null)return this.root_={key:n,value:s,left:null,right:null,parent:null,color:0,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var c,h,g=this.root_;do if(c=g,(h=n.compareTo(g.key))<0)g=g.left;else{if(!(h>0)){var d=g.value;return g.value=s,d}g=g.right}while(g!==null);var E={key:n,left:null,right:null,value:s,parent:c,color:0,getValue:function(){return this.value},getKey:function(){return this.key}};return h<0?c.left=E:c.right=E,this.fixAfterInsertion(E),this.size_++,null}},{key:"fixAfterInsertion",value:function(n){var s;for(n.color=1;n!=null&&n!==this.root_&&n.parent.color===1;)_e(n)===Za(_e(_e(n)))?Sf(s=bf(_e(_e(n))))===1?(Wt(_e(n),0),Wt(s,0),Wt(_e(_e(n)),1),n=_e(_e(n))):(n===bf(_e(n))&&(n=_e(n),this.rotateLeft(n)),Wt(_e(n),0),Wt(_e(_e(n)),1),this.rotateRight(_e(_e(n)))):Sf(s=Za(_e(_e(n))))===1?(Wt(_e(n),0),Wt(s,0),Wt(_e(_e(n)),1),n=_e(_e(n))):(n===Za(_e(n))&&(n=_e(n),this.rotateRight(n)),Wt(_e(n),0),Wt(_e(_e(n)),1),this.rotateLeft(_e(_e(n))));this.root_.color=0}},{key:"values",value:function(){var n=new ne,s=this.getFirstEntry();if(s!==null)for(n.add(s.value);(s=t.successor(s))!==null;)n.add(s.value);return n}},{key:"entrySet",value:function(){var n=new st,s=this.getFirstEntry();if(s!==null)for(n.add(s);(s=t.successor(s))!==null;)n.add(s);return n}},{key:"rotateLeft",value:function(n){if(n!=null){var s=n.right;n.right=s.left,s.left!=null&&(s.left.parent=n),s.parent=n.parent,n.parent==null?this.root_=s:n.parent.left===n?n.parent.left=s:n.parent.right=s,s.left=n,n.parent=s}}},{key:"rotateRight",value:function(n){if(n!=null){var s=n.left;n.left=s.right,s.right!=null&&(s.right.parent=n),s.parent=n.parent,n.parent==null?this.root_=s:n.parent.right===n?n.parent.right=s:n.parent.left=s,s.right=n,n.parent=s}}},{key:"getFirstEntry",value:function(){var n=this.root_;if(n!=null)for(;n.left!=null;)n=n.left;return n}},{key:"size",value:function(){return this.size_}},{key:"containsKey",value:function(n){for(var s=this.root_;s!==null;){var c=n.compareTo(s.key);if(c<0)s=s.left;else{if(!(c>0))return!0;s=s.right}}return!1}}],[{key:"successor",value:function(n){var s;if(n===null)return null;if(n.right!==null){for(s=n.right;s.left!==null;)s=s.left;return s}s=n.parent;for(var c=n;s!==null&&c===s.right;)c=s,s=s.parent;return s}}]),t}(K0),If=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"find",value:function(e){return this.nodeMap.get(e)}},{key:"addNode",value:function(){if(arguments[0]instanceof C){var e=arguments[0],t=this.nodeMap.get(e);return t===null&&(t=this.nodeFact.createNode(e),this.nodeMap.put(e,t)),t}if(arguments[0]instanceof as){var n=arguments[0],s=this.nodeMap.get(n.getCoordinate());return s===null?(this.nodeMap.put(n.getCoordinate(),n),n):(s.mergeLabel(n),s)}}},{key:"print",value:function(e){for(var t=this.iterator();t.hasNext();)t.next().print(e)}},{key:"iterator",value:function(){return this.nodeMap.values().iterator()}},{key:"values",value:function(){return this.nodeMap.values()}},{key:"getBoundaryNodes",value:function(e){for(var t=new ne,n=this.iterator();n.hasNext();){var s=n.next();s.getLabel().getLocation(e)===I.BOUNDARY&&t.add(s)}return t}},{key:"add",value:function(e){var t=e.getCoordinate();this.addNode(t).add(e)}}],[{key:"constructor_",value:function(){this.nodeMap=new Jr,this.nodeFact=null;var e=arguments[0];this.nodeFact=e}}]),o}(),rt=function(){function o(){i(this,o)}return l(o,null,[{key:"isNorthern",value:function(e){return e===o.NE||e===o.NW}},{key:"isOpposite",value:function(e,t){return e!==t&&(e-t+4)%4===2}},{key:"commonHalfPlane",value:function(e,t){if(e===t)return e;if((e-t+4)%4===2)return-1;var n=e<t?e:t;return n===0&&(e>t?e:t)===3?3:n}},{key:"isInHalfPlane",value:function(e,t){return t===o.SE?e===o.SE||e===o.SW:e===t||e===t+1}},{key:"quadrant",value:function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];if(e===0&&t===0)throw new M("Cannot compute the quadrant for point ( "+e+", "+t+" )");return e>=0?t>=0?o.NE:o.SE:t>=0?o.NW:o.SW}if(arguments[0]instanceof C&&arguments[1]instanceof C){var n=arguments[0],s=arguments[1];if(s.x===n.x&&s.y===n.y)throw new M("Cannot compute the quadrant for two identical points "+n);return s.x>=n.x?s.y>=n.y?o.NE:o.SE:s.y>=n.y?o.NW:o.SW}}}]),o}();rt.NE=0,rt.NW=1,rt.SW=2,rt.SE=3;var wf=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"compareDirection",value:function(e){return this._dx===e._dx&&this._dy===e._dy?0:this._quadrant>e._quadrant?1:this._quadrant<e._quadrant?-1:ae.index(e._p0,e._p1,this._p1)}},{key:"getDy",value:function(){return this._dy}},{key:"getCoordinate",value:function(){return this._p0}},{key:"setNode",value:function(e){this._node=e}},{key:"print",value:function(e){var t=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),s=n.lastIndexOf("."),c=n.substring(s+1);e.print(" "+c+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label)}},{key:"compareTo",value:function(e){var t=e;return this.compareDirection(t)}},{key:"getDirectedCoordinate",value:function(){return this._p1}},{key:"getDx",value:function(){return this._dx}},{key:"getLabel",value:function(){return this._label}},{key:"getEdge",value:function(){return this._edge}},{key:"getQuadrant",value:function(){return this._quadrant}},{key:"getNode",value:function(){return this._node}},{key:"toString",value:function(){var e=Math.atan2(this._dy,this._dx),t=this.getClass().getName(),n=t.lastIndexOf(".");return" "+t.substring(n+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label}},{key:"computeLabel",value:function(e){}},{key:"init",value:function(e,t){this._p0=e,this._p1=t,this._dx=t.x-e.x,this._dy=t.y-e.y,this._quadrant=rt.quadrant(this._dx,this._dy),he.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")}},{key:"interfaces_",get:function(){return[q]}}],[{key:"constructor_",value:function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var e=arguments[0];this._edge=e}else if(arguments.length===3){var t=arguments[0],n=arguments[1],s=arguments[2];o.constructor_.call(this,t,n,s,null)}else if(arguments.length===4){var c=arguments[0],h=arguments[1],g=arguments[2],d=arguments[3];o.constructor_.call(this,c),this.init(h,g),this._label=d}}}]),o}(),Qa=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"getNextMin",value:function(){return this._nextMin}},{key:"getDepth",value:function(n){return this._depth[n]}},{key:"setVisited",value:function(n){this._isVisited=n}},{key:"computeDirectedLabel",value:function(){this._label=new It(this._edge.getLabel()),this._isForward||this._label.flip()}},{key:"getNext",value:function(){return this._next}},{key:"setDepth",value:function(n,s){if(this._depth[n]!==-999&&this._depth[n]!==s)throw new ct("assigned depths do not match",this.getCoordinate());this._depth[n]=s}},{key:"isInteriorAreaEdge",value:function(){for(var n=!0,s=0;s<2;s++)this._label.isArea(s)&&this._label.getLocation(s,W.LEFT)===I.INTERIOR&&this._label.getLocation(s,W.RIGHT)===I.INTERIOR||(n=!1);return n}},{key:"setNextMin",value:function(n){this._nextMin=n}},{key:"print",value:function(n){b(v(t.prototype),"print",this).call(this,n),n.print(" "+this._depth[W.LEFT]+"/"+this._depth[W.RIGHT]),n.print(" ("+this.getDepthDelta()+")"),this._isInResult&&n.print(" inResult")}},{key:"setMinEdgeRing",value:function(n){this._minEdgeRing=n}},{key:"isLineEdge",value:function(){var n=this._label.isLine(0)||this._label.isLine(1),s=!this._label.isArea(0)||this._label.allPositionsEqual(0,I.EXTERIOR),c=!this._label.isArea(1)||this._label.allPositionsEqual(1,I.EXTERIOR);return n&&s&&c}},{key:"setEdgeRing",value:function(n){this._edgeRing=n}},{key:"getMinEdgeRing",value:function(){return this._minEdgeRing}},{key:"getDepthDelta",value:function(){var n=this._edge.getDepthDelta();return this._isForward||(n=-n),n}},{key:"setInResult",value:function(n){this._isInResult=n}},{key:"getSym",value:function(){return this._sym}},{key:"isForward",value:function(){return this._isForward}},{key:"getEdge",value:function(){return this._edge}},{key:"printEdge",value:function(n){this.print(n),n.print(" "),this._isForward?this._edge.print(n):this._edge.printReverse(n)}},{key:"setSym",value:function(n){this._sym=n}},{key:"setVisitedEdge",value:function(n){this.setVisited(n),this._sym.setVisited(n)}},{key:"setEdgeDepths",value:function(n,s){var c=this.getEdge().getDepthDelta();this._isForward||(c=-c);var h=1;n===W.LEFT&&(h=-1);var g=W.opposite(n),d=s+c*h;this.setDepth(n,s),this.setDepth(g,d)}},{key:"getEdgeRing",value:function(){return this._edgeRing}},{key:"isInResult",value:function(){return this._isInResult}},{key:"setNext",value:function(n){this._next=n}},{key:"isVisited",value:function(){return this._isVisited}}],[{key:"constructor_",value:function(){this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999];var n=arguments[0],s=arguments[1];if(wf.constructor_.call(this,n),this._isForward=s,s)this.init(n.getCoordinate(0),n.getCoordinate(1));else{var c=n.getNumPoints()-1;this.init(n.getCoordinate(c),n.getCoordinate(c-1))}this.computeDirectedLabel()}},{key:"depthFactor",value:function(n,s){return n===I.EXTERIOR&&s===I.INTERIOR?1:n===I.INTERIOR&&s===I.EXTERIOR?-1:0}}]),t}(wf),Nf=function(){function o(){i(this,o)}return l(o,[{key:"createNode",value:function(e){return new as(e,null)}}]),o}(),Lf=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"printEdges",value:function(e){e.println("Edges:");for(var t=0;t<this._edges.size();t++){e.println("edge "+t+":");var n=this._edges.get(t);n.print(e),n.eiList.print(e)}}},{key:"find",value:function(e){return this._nodes.find(e)}},{key:"addNode",value:function(){if(arguments[0]instanceof as){var e=arguments[0];return this._nodes.addNode(e)}if(arguments[0]instanceof C){var t=arguments[0];return this._nodes.addNode(t)}}},{key:"getNodeIterator",value:function(){return this._nodes.iterator()}},{key:"linkResultDirectedEdges",value:function(){for(var e=this._nodes.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()}},{key:"debugPrintln",value:function(e){ot.out.println(e)}},{key:"isBoundaryNode",value:function(e,t){var n=this._nodes.find(t);if(n===null)return!1;var s=n.getLabel();return s!==null&&s.getLocation(e)===I.BOUNDARY}},{key:"linkAllDirectedEdges",value:function(){for(var e=this._nodes.iterator();e.hasNext();)e.next().getEdges().linkAllDirectedEdges()}},{key:"matchInSameDirection",value:function(e,t,n,s){return!!e.equals(n)&&ae.index(e,t,s)===ae.COLLINEAR&&rt.quadrant(e,t)===rt.quadrant(n,s)}},{key:"getEdgeEnds",value:function(){return this._edgeEndList}},{key:"debugPrint",value:function(e){ot.out.print(e)}},{key:"getEdgeIterator",value:function(){return this._edges.iterator()}},{key:"findEdgeInSameDirection",value:function(e,t){for(var n=0;n<this._edges.size();n++){var s=this._edges.get(n),c=s.getCoordinates();if(this.matchInSameDirection(e,t,c[0],c[1])||this.matchInSameDirection(e,t,c[c.length-1],c[c.length-2]))return s}return null}},{key:"insertEdge",value:function(e){this._edges.add(e)}},{key:"findEdgeEnd",value:function(e){for(var t=this.getEdgeEnds().iterator();t.hasNext();){var n=t.next();if(n.getEdge()===e)return n}return null}},{key:"addEdges",value:function(e){for(var t=e.iterator();t.hasNext();){var n=t.next();this._edges.add(n);var s=new Qa(n,!0),c=new Qa(n,!1);s.setSym(c),c.setSym(s),this.add(s),this.add(c)}}},{key:"add",value:function(e){this._nodes.add(e),this._edgeEndList.add(e)}},{key:"getNodes",value:function(){return this._nodes.values()}},{key:"findEdge",value:function(e,t){for(var n=0;n<this._edges.size();n++){var s=this._edges.get(n),c=s.getCoordinates();if(e.equals(c[0])&&t.equals(c[1]))return s}return null}}],[{key:"constructor_",value:function(){if(this._edges=new ne,this._nodes=null,this._edgeEndList=new ne,arguments.length===0)this._nodes=new If(new Nf);else if(arguments.length===1){var e=arguments[0];this._nodes=new If(e)}}},{key:"linkResultDirectedEdges",value:function(e){for(var t=e.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()}}]),o}(),J0=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"sortShellsAndHoles",value:function(e,t,n){for(var s=e.iterator();s.hasNext();){var c=s.next();c.isHole()?n.add(c):t.add(c)}}},{key:"computePolygons",value:function(e){for(var t=new ne,n=e.iterator();n.hasNext();){var s=n.next().toPolygon(this._geometryFactory);t.add(s)}return t}},{key:"placeFreeHoles",value:function(e,t){for(var n=t.iterator();n.hasNext();){var s=n.next();if(s.getShell()===null){var c=o.findEdgeRingContaining(s,e);if(c===null)throw new ct("unable to assign hole to a shell",s.getCoordinate(0));s.setShell(c)}}}},{key:"buildMinimalEdgeRings",value:function(e,t,n){for(var s=new ne,c=e.iterator();c.hasNext();){var h=c.next();if(h.getMaxNodeDegree()>2){h.linkDirectedEdgesForMinimalEdgeRings();var g=h.buildMinimalRings(),d=this.findShell(g);d!==null?(this.placePolygonHoles(d,g),t.add(d)):n.addAll(g)}else s.add(h)}return s}},{key:"buildMaximalEdgeRings",value:function(e){for(var t=new ne,n=e.iterator();n.hasNext();){var s=n.next();if(s.isInResult()&&s.getLabel().isArea()&&s.getEdgeRing()===null){var c=new Q0(s,this._geometryFactory);t.add(c),c.setInResult()}}return t}},{key:"placePolygonHoles",value:function(e,t){for(var n=t.iterator();n.hasNext();){var s=n.next();s.isHole()&&s.setShell(e)}}},{key:"getPolygons",value:function(){return this.computePolygons(this._shellList)}},{key:"findShell",value:function(e){for(var t=0,n=null,s=e.iterator();s.hasNext();){var c=s.next();c.isHole()||(n=c,t++)}return he.isTrue(t<=1,"found two shells in MinimalEdgeRing list"),n}},{key:"add",value:function(){if(arguments.length===1){var e=arguments[0];this.add(e.getEdgeEnds(),e.getNodes())}else if(arguments.length===2){var t=arguments[0],n=arguments[1];Lf.linkResultDirectedEdges(n);var s=this.buildMaximalEdgeRings(t),c=new ne,h=this.buildMinimalEdgeRings(s,this._shellList,c);this.sortShellsAndHoles(h,this._shellList,c),this.placeFreeHoles(this._shellList,c)}}}],[{key:"constructor_",value:function(){this._geometryFactory=null,this._shellList=new ne;var e=arguments[0];this._geometryFactory=e}},{key:"findEdgeRingContaining",value:function(e,t){for(var n=e.getLinearRing(),s=n.getEnvelopeInternal(),c=n.getCoordinateN(0),h=null,g=null,d=t.iterator();d.hasNext();){var E=d.next(),w=E.getLinearRing(),N=w.getEnvelopeInternal();if(!N.equals(s)&&N.contains(s)){c=Ye.ptNotInList(n.getCoordinates(),w.getCoordinates());var F=!1;Ha.isInRing(c,w.getCoordinates())&&(F=!0),F&&(h===null||g.contains(N))&&(g=(h=E).getLinearRing().getEnvelopeInternal())}}return h}}]),o}(),Tf=function(){function o(){i(this,o)}return l(o,[{key:"getBounds",value:function(){}}]),o}(),rn=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"getItem",value:function(){return this._item}},{key:"getBounds",value:function(){return this._bounds}},{key:"interfaces_",get:function(){return[Tf,A]}}],[{key:"constructor_",value:function(){this._bounds=null,this._item=null;var e=arguments[0],t=arguments[1];this._bounds=e,this._item=t}}]),o}(),os=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"poll",value:function(){if(this.isEmpty())return null;var e=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),e}},{key:"size",value:function(){return this._size}},{key:"reorder",value:function(e){for(var t=null,n=this._items.get(e);2*e<=this._size&&((t=2*e)!==this._size&&this._items.get(t+1).compareTo(this._items.get(t))<0&&t++,this._items.get(t).compareTo(n)<0);e=t)this._items.set(e,this._items.get(t));this._items.set(e,n)}},{key:"clear",value:function(){this._size=0,this._items.clear()}},{key:"peek",value:function(){return this.isEmpty()?null:this._items.get(1)}},{key:"isEmpty",value:function(){return this._size===0}},{key:"add",value:function(e){this._items.add(null),this._size+=1;var t=this._size;for(this._items.set(0,e);e.compareTo(this._items.get(Math.trunc(t/2)))<0;t/=2)this._items.set(t,this._items.get(Math.trunc(t/2)));this._items.set(t,e)}}],[{key:"constructor_",value:function(){this._size=null,this._items=null,this._size=0,this._items=new ne,this._items.add(null)}}]),o}(),$0=function(){function o(){i(this,o)}return l(o,[{key:"insert",value:function(e,t){}},{key:"remove",value:function(e,t){}},{key:"query",value:function(){}}]),o}(),wt=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"getLevel",value:function(){return this._level}},{key:"size",value:function(){return this._childBoundables.size()}},{key:"getChildBoundables",value:function(){return this._childBoundables}},{key:"addChildBoundable",value:function(e){he.isTrue(this._bounds===null),this._childBoundables.add(e)}},{key:"isEmpty",value:function(){return this._childBoundables.isEmpty()}},{key:"getBounds",value:function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds}},{key:"interfaces_",get:function(){return[Tf,A]}}],[{key:"constructor_",value:function(){if(this._childBoundables=new ne,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this._level=e}}}}]),o}(),dr={reverseOrder:function(){return{compare:function(o,e){return e.compareTo(o)}}},min:function(o){return dr.sort(o),o.get(0)},sort:function(o,e){var t=o.toArray();e?St.sort(t,e):St.sort(t);for(var n=o.iterator(),s=0,c=t.length;s<c;s++)n.next(),n.set(t[s])},singletonList:function(o){var e=new ne;return e.add(o),e}},e_=function(){function o(){i(this,o)}return l(o,null,[{key:"maxDistance",value:function(e,t,n,s,c,h,g,d){var E=o.distance(e,t,c,h);return E=Math.max(E,o.distance(e,t,g,d)),E=Math.max(E,o.distance(n,s,c,h)),E=Math.max(E,o.distance(n,s,g,d))}},{key:"distance",value:function(e,t,n,s){var c=n-e,h=s-t;return Math.sqrt(c*c+h*h)}},{key:"maximumDistance",value:function(e,t){var n=Math.min(e.getMinX(),t.getMinX()),s=Math.min(e.getMinY(),t.getMinY()),c=Math.max(e.getMaxX(),t.getMaxX()),h=Math.max(e.getMaxY(),t.getMaxY());return o.distance(n,s,c,h)}},{key:"minMaxDistance",value:function(e,t){var n=e.getMinX(),s=e.getMinY(),c=e.getMaxX(),h=e.getMaxY(),g=t.getMinX(),d=t.getMinY(),E=t.getMaxX(),w=t.getMaxY(),N=o.maxDistance(n,s,n,h,g,d,g,w);return N=Math.min(N,o.maxDistance(n,s,n,h,g,d,E,d)),N=Math.min(N,o.maxDistance(n,s,n,h,E,w,g,w)),N=Math.min(N,o.maxDistance(n,s,n,h,E,w,E,d)),N=Math.min(N,o.maxDistance(n,s,c,s,g,d,g,w)),N=Math.min(N,o.maxDistance(n,s,c,s,g,d,E,d)),N=Math.min(N,o.maxDistance(n,s,c,s,E,w,g,w)),N=Math.min(N,o.maxDistance(n,s,c,s,E,w,E,d)),N=Math.min(N,o.maxDistance(c,h,n,h,g,d,g,w)),N=Math.min(N,o.maxDistance(c,h,n,h,g,d,E,d)),N=Math.min(N,o.maxDistance(c,h,n,h,E,w,g,w)),N=Math.min(N,o.maxDistance(c,h,n,h,E,w,E,d)),N=Math.min(N,o.maxDistance(c,h,c,s,g,d,g,w)),N=Math.min(N,o.maxDistance(c,h,c,s,g,d,E,d)),N=Math.min(N,o.maxDistance(c,h,c,s,E,w,g,w)),N=Math.min(N,o.maxDistance(c,h,c,s,E,w,E,d))}}]),o}(),mr=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"maximumDistance",value:function(){return e_.maximumDistance(this._boundable1.getBounds(),this._boundable2.getBounds())}},{key:"expandToQueue",value:function(e,t){var n=o.isComposite(this._boundable1),s=o.isComposite(this._boundable2);if(n&&s)return o.area(this._boundable1)>o.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,!1,e,t),null):(this.expand(this._boundable2,this._boundable1,!0,e,t),null);if(n)return this.expand(this._boundable1,this._boundable2,!1,e,t),null;if(s)return this.expand(this._boundable2,this._boundable1,!0,e,t),null;throw new M("neither boundable is composite")}},{key:"isLeaves",value:function(){return!(o.isComposite(this._boundable1)||o.isComposite(this._boundable2))}},{key:"compareTo",value:function(e){var t=e;return this._distance<t._distance?-1:this._distance>t._distance?1:0}},{key:"expand",value:function(e,t,n,s,c){for(var h=e.getChildBoundables().iterator();h.hasNext();){var g=h.next(),d=null;(d=n?new o(t,g,this._itemDistance):new o(g,t,this._itemDistance)).getDistance()<c&&s.add(d)}}},{key:"getBoundable",value:function(e){return e===0?this._boundable1:this._boundable2}},{key:"getDistance",value:function(){return this._distance}},{key:"distance",value:function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())}},{key:"interfaces_",get:function(){return[q]}}],[{key:"constructor_",value:function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var e=arguments[0],t=arguments[1],n=arguments[2];this._boundable1=e,this._boundable2=t,this._itemDistance=n,this._distance=this.distance()}},{key:"area",value:function(e){return e.getBounds().getArea()}},{key:"isComposite",value:function(e){return e instanceof wt}}]),o}(),Cf=function(){function o(){i(this,o)}return l(o,[{key:"visitItem",value:function(e){}}]),o}(),pr=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"queryInternal",value:function(){if(le(arguments[2],Cf)&&arguments[0]instanceof Object&&arguments[1]instanceof wt)for(var e=arguments[0],t=arguments[1],n=arguments[2],s=t.getChildBoundables(),c=0;c<s.size();c++){var h=s.get(c);this.getIntersectsOp().intersects(h.getBounds(),e)&&(h instanceof wt?this.queryInternal(e,h,n):h instanceof rn?n.visitItem(h.getItem()):he.shouldNeverReachHere())}else if(le(arguments[2],at)&&arguments[0]instanceof Object&&arguments[1]instanceof wt)for(var g=arguments[0],d=arguments[1],E=arguments[2],w=d.getChildBoundables(),N=0;N<w.size();N++){var F=w.get(N);this.getIntersectsOp().intersects(F.getBounds(),g)&&(F instanceof wt?this.queryInternal(g,F,E):F instanceof rn?E.add(F.getItem()):he.shouldNeverReachHere())}}},{key:"getNodeCapacity",value:function(){return this._nodeCapacity}},{key:"lastNode",value:function(e){return e.get(e.size()-1)}},{key:"size",value:function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var e=arguments[0],t=0,n=e.getChildBoundables().iterator();n.hasNext();){var s=n.next();s instanceof wt?t+=this.size(s):s instanceof rn&&(t+=1)}return t}}},{key:"removeItem",value:function(e,t){for(var n=null,s=e.getChildBoundables().iterator();s.hasNext();){var c=s.next();c instanceof rn&&c.getItem()===t&&(n=c)}return n!==null&&(e.getChildBoundables().remove(n),!0)}},{key:"itemsTree",value:function(){if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new ne:e}if(arguments.length===1){for(var t=arguments[0],n=new ne,s=t.getChildBoundables().iterator();s.hasNext();){var c=s.next();if(c instanceof wt){var h=this.itemsTree(c);h!==null&&n.add(h)}else c instanceof rn?n.add(c.getItem()):he.shouldNeverReachHere()}return n.size()<=0?null:n}}},{key:"insert",value:function(e,t){he.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new rn(e,t))}},{key:"boundablesAtLevel",value:function(){if(arguments.length===1){var e=arguments[0],t=new ne;return this.boundablesAtLevel(e,this._root,t),t}if(arguments.length===3){var n=arguments[0],s=arguments[1],c=arguments[2];if(he.isTrue(n>-2),s.getLevel()===n)return c.add(s),null;for(var h=s.getChildBoundables().iterator();h.hasNext();){var g=h.next();g instanceof wt?this.boundablesAtLevel(n,g,c):(he.isTrue(g instanceof rn),n===-1&&c.add(g))}return null}}},{key:"query",value:function(){if(arguments.length===1){var e=arguments[0];this.build();var t=new ne;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.queryInternal(e,this._root,t),t}if(arguments.length===2){var n=arguments[0],s=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.queryInternal(n,this._root,s)}}},{key:"build",value:function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0}},{key:"getRoot",value:function(){return this.build(),this._root}},{key:"remove",value:function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.remove(e,this._root,t)}if(arguments.length===3){var n=arguments[0],s=arguments[1],c=arguments[2],h=this.removeItem(s,c);if(h)return!0;for(var g=null,d=s.getChildBoundables().iterator();d.hasNext();){var E=d.next();if(this.getIntersectsOp().intersects(E.getBounds(),n)&&E instanceof wt&&(h=this.remove(n,E,c))){g=E;break}}return g!==null&&g.getChildBoundables().isEmpty()&&s.getChildBoundables().remove(g),h}}},{key:"createHigherLevels",value:function(e,t){he.isTrue(!e.isEmpty());var n=this.createParentBoundables(e,t+1);return n.size()===1?n.get(0):this.createHigherLevels(n,t+1)}},{key:"depth",value:function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var e=arguments[0],t=0,n=e.getChildBoundables().iterator();n.hasNext();){var s=n.next();if(s instanceof wt){var c=this.depth(s);c>t&&(t=c)}}return t+1}}},{key:"createParentBoundables",value:function(e,t){he.isTrue(!e.isEmpty());var n=new ne;n.add(this.createNode(t));var s=new ne(e);dr.sort(s,this.getComparator());for(var c=s.iterator();c.hasNext();){var h=c.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(t)),this.lastNode(n).addChildBoundable(h)}return n}},{key:"isEmpty",value:function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()}},{key:"interfaces_",get:function(){return[A]}}],[{key:"constructor_",value:function(){if(this._root=null,this._built=!1,this._itemBoundables=new ne,this._nodeCapacity=null,arguments.length===0)o.constructor_.call(this,o.DEFAULT_NODE_CAPACITY);else if(arguments.length===1){var e=arguments[0];he.isTrue(e>1,"Node capacity must be greater than 1"),this._nodeCapacity=e}}},{key:"compareDoubles",value:function(e,t){return e>t?1:e<t?-1:0}}]),o}();pr.IntersectsOp=function(){},pr.DEFAULT_NODE_CAPACITY=10;var t_=function(){function o(){i(this,o)}return l(o,[{key:"distance",value:function(e,t){}}]),o}(),Xt=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"createParentBoundablesFromVerticalSlices",value:function(n,s){he.isTrue(n.length>0);for(var c=new ne,h=0;h<n.length;h++)c.addAll(this.createParentBoundablesFromVerticalSlice(n[h],s));return c}},{key:"nearestNeighbourK",value:function(){if(arguments.length===2){var n=arguments[0],s=arguments[1];return this.nearestNeighbourK(n,K.POSITIVE_INFINITY,s)}if(arguments.length===3){var c=arguments[0],h=arguments[1],g=arguments[2],d=h,E=new os;E.add(c);for(var w=new os;!E.isEmpty()&&d>=0;){var N=E.poll(),F=N.getDistance();if(F>=d)break;if(N.isLeaves())if(w.size()<g)w.add(N);else{var j=w.peek();j.getDistance()>F&&(w.poll(),w.add(N));var X=w.peek();d=X.getDistance()}else N.expandToQueue(E,d)}return t.getItems(w)}}},{key:"createNode",value:function(n){return new Of(n)}},{key:"size",value:function(){return arguments.length===0?b(v(t.prototype),"size",this).call(this):b(v(t.prototype),"size",this).apply(this,arguments)}},{key:"insert",value:function(){if(!(arguments.length===2&&arguments[1]instanceof Object&&arguments[0]instanceof Se))return b(v(t.prototype),"insert",this).apply(this,arguments);var n=arguments[0],s=arguments[1];if(n.isNull())return null;b(v(t.prototype),"insert",this).call(this,n,s)}},{key:"getIntersectsOp",value:function(){return t.intersectsOp}},{key:"verticalSlices",value:function(n,s){for(var c=Math.trunc(Math.ceil(n.size()/s)),h=new Array(s).fill(null),g=n.iterator(),d=0;d<s;d++){h[d]=new ne;for(var E=0;g.hasNext()&&E<c;){var w=g.next();h[d].add(w),E++}}return h}},{key:"query",value:function(){if(arguments.length===1){var n=arguments[0];return b(v(t.prototype),"query",this).call(this,n)}if(arguments.length===2){var s=arguments[0],c=arguments[1];b(v(t.prototype),"query",this).call(this,s,c)}}},{key:"getComparator",value:function(){return t.yComparator}},{key:"createParentBoundablesFromVerticalSlice",value:function(n,s){return b(v(t.prototype),"createParentBoundables",this).call(this,n,s)}},{key:"remove",value:function(){if(arguments.length===2&&arguments[1]instanceof Object&&arguments[0]instanceof Se){var n=arguments[0],s=arguments[1];return b(v(t.prototype),"remove",this).call(this,n,s)}return b(v(t.prototype),"remove",this).apply(this,arguments)}},{key:"depth",value:function(){return arguments.length===0?b(v(t.prototype),"depth",this).call(this):b(v(t.prototype),"depth",this).apply(this,arguments)}},{key:"createParentBoundables",value:function(n,s){he.isTrue(!n.isEmpty());var c=Math.trunc(Math.ceil(n.size()/this.getNodeCapacity())),h=new ne(n);dr.sort(h,t.xComparator);var g=this.verticalSlices(h,Math.trunc(Math.ceil(Math.sqrt(c))));return this.createParentBoundablesFromVerticalSlices(g,s)}},{key:"nearestNeighbour",value:function(){if(arguments.length===1){if(le(arguments[0],t_)){var n=arguments[0];if(this.isEmpty())return null;var s=new mr(this.getRoot(),this.getRoot(),n);return this.nearestNeighbour(s)}if(arguments[0]instanceof mr){var c=arguments[0],h=K.POSITIVE_INFINITY,g=null,d=new os;for(d.add(c);!d.isEmpty()&&h>0;){var E=d.poll(),w=E.getDistance();if(w>=h)break;E.isLeaves()?(h=w,g=E):E.expandToQueue(d,h)}return g===null?null:[g.getBoundable(0).getItem(),g.getBoundable(1).getItem()]}}else{if(arguments.length===2){var N=arguments[0],F=arguments[1];if(this.isEmpty()||N.isEmpty())return null;var j=new mr(this.getRoot(),N.getRoot(),F);return this.nearestNeighbour(j)}if(arguments.length===3){var X=arguments[0],$=arguments[1],re=arguments[2],fe=new rn(X,$),ke=new mr(this.getRoot(),fe,re);return this.nearestNeighbour(ke)[0]}if(arguments.length===4){var Be=arguments[0],Je=arguments[1],yt=arguments[2],At=arguments[3],sn=new rn(Be,Je),qn=new mr(this.getRoot(),sn,yt);return this.nearestNeighbourK(qn,At)}}}},{key:"isWithinDistance",value:function(){if(arguments.length===2){var n=arguments[0],s=arguments[1],c=K.POSITIVE_INFINITY,h=new os;for(h.add(n);!h.isEmpty();){var g=h.poll(),d=g.getDistance();if(d>s)return!1;if(g.maximumDistance()<=s)return!0;if(g.isLeaves()){if((c=d)<=s)return!0}else g.expandToQueue(h,c)}return!1}if(arguments.length===3){var E=arguments[0],w=arguments[1],N=arguments[2],F=new mr(this.getRoot(),E.getRoot(),w);return this.isWithinDistance(F,N)}}},{key:"interfaces_",get:function(){return[$0,A]}}],[{key:"constructor_",value:function(){if(arguments.length===0)t.constructor_.call(this,t.DEFAULT_NODE_CAPACITY);else if(arguments.length===1){var n=arguments[0];pr.constructor_.call(this,n)}}},{key:"centreX",value:function(n){return t.avg(n.getMinX(),n.getMaxX())}},{key:"avg",value:function(n,s){return(n+s)/2}},{key:"getItems",value:function(n){for(var s=new Array(n.size()).fill(null),c=0;!n.isEmpty();){var h=n.poll();s[c]=h.getBoundable(0).getItem(),c++}return s}},{key:"centreY",value:function(n){return t.avg(n.getMinY(),n.getMaxY())}}]),t}(pr),Of=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"computeBounds",value:function(){for(var n=null,s=this.getChildBoundables().iterator();s.hasNext();){var c=s.next();n===null?n=new Se(c.getBounds()):n.expandToInclude(c.getBounds())}return n}}],[{key:"constructor_",value:function(){var n=arguments[0];wt.constructor_.call(this,n)}}]),t}(wt);Xt.STRtreeNode=Of,Xt.xComparator=new(function(){function o(){i(this,o)}return l(o,[{key:"interfaces_",get:function(){return[ze]}},{key:"compare",value:function(e,t){return pr.compareDoubles(Xt.centreX(e.getBounds()),Xt.centreX(t.getBounds()))}}]),o}()),Xt.yComparator=new(function(){function o(){i(this,o)}return l(o,[{key:"interfaces_",get:function(){return[ze]}},{key:"compare",value:function(e,t){return pr.compareDoubles(Xt.centreY(e.getBounds()),Xt.centreY(t.getBounds()))}}]),o}()),Xt.intersectsOp=new(function(){function o(){i(this,o)}return l(o,[{key:"interfaces_",get:function(){return[IntersectsOp]}},{key:"intersects",value:function(e,t){return e.intersects(t)}}]),o}()),Xt.DEFAULT_NODE_CAPACITY=10;var n_=function(){function o(){i(this,o)}return l(o,null,[{key:"relativeSign",value:function(e,t){return e<t?-1:e>t?1:0}},{key:"compare",value:function(e,t,n){if(t.equals2D(n))return 0;var s=o.relativeSign(t.x,n.x),c=o.relativeSign(t.y,n.y);switch(e){case 0:return o.compareValue(s,c);case 1:return o.compareValue(c,s);case 2:return o.compareValue(c,-s);case 3:return o.compareValue(-s,c);case 4:return o.compareValue(-s,-c);case 5:return o.compareValue(-c,-s);case 6:return o.compareValue(-c,s);case 7:return o.compareValue(s,-c)}return he.shouldNeverReachHere("invalid octant value"),0}},{key:"compareValue",value:function(e,t){return e<0?-1:e>0?1:t<0?-1:t>0?1:0}}]),o}(),r_=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"getCoordinate",value:function(){return this.coord}},{key:"print",value:function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex)}},{key:"compareTo",value:function(e){var t=e;return this.segmentIndex<t.segmentIndex?-1:this.segmentIndex>t.segmentIndex?1:this.coord.equals2D(t.coord)?0:this._isInterior?t._isInterior?n_.compare(this._segmentOctant,this.coord,t.coord):1:-1}},{key:"isEndPoint",value:function(e){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===e}},{key:"toString",value:function(){return this.segmentIndex+":"+this.coord.toString()}},{key:"isInterior",value:function(){return this._isInterior}},{key:"interfaces_",get:function(){return[q]}}],[{key:"constructor_",value:function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var e=arguments[0],t=arguments[1],n=arguments[2],s=arguments[3];this._segString=e,this.coord=new C(t),this.segmentIndex=n,this._segmentOctant=s,this._isInterior=!t.equals2D(e.getCoordinate(n))}}]),o}(),i_=function(){function o(){i(this,o)}return l(o,[{key:"hasNext",value:function(){}},{key:"next",value:function(){}},{key:"remove",value:function(){}}]),o}(),s_=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"getSplitCoordinates",value:function(){var e=new Zr;this.addEndpoints();for(var t=this.iterator(),n=t.next();t.hasNext();){var s=t.next();this.addEdgeCoordinates(n,s,e),n=s}return e.toCoordinateArray()}},{key:"addCollapsedNodes",value:function(){var e=new ne;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var t=e.iterator();t.hasNext();){var n=t.next().intValue();this.add(this._edge.getCoordinate(n),n)}}},{key:"createSplitEdgePts",value:function(e,t){var n=t.segmentIndex-e.segmentIndex+2;if(n===2)return[new C(e.coord),new C(t.coord)];var s=this._edge.getCoordinate(t.segmentIndex),c=t.isInterior()||!t.coord.equals2D(s);c||n--;var h=new Array(n).fill(null),g=0;h[g++]=new C(e.coord);for(var d=e.segmentIndex+1;d<=t.segmentIndex;d++)h[g++]=this._edge.getCoordinate(d);return c&&(h[g]=new C(t.coord)),h}},{key:"print",value:function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();)t.next().print(e)}},{key:"findCollapsesFromExistingVertices",value:function(e){for(var t=0;t<this._edge.size()-2;t++){var n=this._edge.getCoordinate(t);this._edge.getCoordinate(t+1);var s=this._edge.getCoordinate(t+2);n.equals2D(s)&&e.add(lt.valueOf(t+1))}}},{key:"addEdgeCoordinates",value:function(e,t,n){var s=this.createSplitEdgePts(e,t);n.add(s,!1)}},{key:"iterator",value:function(){return this._nodeMap.values().iterator()}},{key:"addSplitEdges",value:function(e){this.addEndpoints(),this.addCollapsedNodes();for(var t=this.iterator(),n=t.next();t.hasNext();){var s=t.next(),c=this.createSplitEdge(n,s);e.add(c),n=s}}},{key:"findCollapseIndex",value:function(e,t,n){if(!e.coord.equals2D(t.coord))return!1;var s=t.segmentIndex-e.segmentIndex;return t.isInterior()||s--,s===1&&(n[0]=e.segmentIndex+1,!0)}},{key:"findCollapsesFromInsertedNodes",value:function(e){for(var t=new Array(1).fill(null),n=this.iterator(),s=n.next();n.hasNext();){var c=n.next();this.findCollapseIndex(s,c,t)&&e.add(lt.valueOf(t[0])),s=c}}},{key:"getEdge",value:function(){return this._edge}},{key:"addEndpoints",value:function(){var e=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(e),e)}},{key:"createSplitEdge",value:function(e,t){var n=this.createSplitEdgePts(e,t);return new Bn(n,this._edge.getData())}},{key:"add",value:function(e,t){var n=new r_(this._edge,e,t,this._edge.getSegmentOctant(t)),s=this._nodeMap.get(n);return s!==null?(he.isTrue(s.coord.equals2D(e),"Found equal nodes with different coordinates"),s):(this._nodeMap.put(n,n),n)}},{key:"checkSplitEdgesCorrectness",value:function(e){var t=this._edge.getCoordinates(),n=e.get(0).getCoordinate(0);if(!n.equals2D(t[0]))throw new Le("bad split edge start point at "+n);var s=e.get(e.size()-1).getCoordinates(),c=s[s.length-1];if(!c.equals2D(t[t.length-1]))throw new Le("bad split edge end point at "+c)}}],[{key:"constructor_",value:function(){this._nodeMap=new Jr,this._edge=null;var e=arguments[0];this._edge=e}}]),o}(),a_=function(){function o(){i(this,o)}return l(o,null,[{key:"octant",value:function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];if(e===0&&t===0)throw new M("Cannot compute the octant for point ( "+e+", "+t+" )");var n=Math.abs(e),s=Math.abs(t);return e>=0?t>=0?n>=s?0:1:n>=s?7:6:t>=0?n>=s?3:2:n>=s?4:5}if(arguments[0]instanceof C&&arguments[1]instanceof C){var c=arguments[0],h=arguments[1],g=h.x-c.x,d=h.y-c.y;if(g===0&&d===0)throw new M("Cannot compute the octant for two identical points "+c);return o.octant(g,d)}}}]),o}(),o_=function(){function o(){i(this,o)}return l(o,[{key:"getCoordinates",value:function(){}},{key:"size",value:function(){}},{key:"getCoordinate",value:function(e){}},{key:"isClosed",value:function(){}},{key:"setData",value:function(e){}},{key:"getData",value:function(){}}]),o}(),u_=function(){function o(){i(this,o)}return l(o,[{key:"addIntersection",value:function(e,t){}},{key:"interfaces_",get:function(){return[o_]}}]),o}(),Bn=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"getCoordinates",value:function(){return this._pts}},{key:"size",value:function(){return this._pts.length}},{key:"getCoordinate",value:function(e){return this._pts[e]}},{key:"isClosed",value:function(){return this._pts[0].equals(this._pts[this._pts.length-1])}},{key:"getSegmentOctant",value:function(e){return e===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(e),this.getCoordinate(e+1))}},{key:"setData",value:function(e){this._data=e}},{key:"safeOctant",value:function(e,t){return e.equals2D(t)?0:a_.octant(e,t)}},{key:"getData",value:function(){return this._data}},{key:"addIntersection",value:function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];this.addIntersectionNode(e,t)}else if(arguments.length===4){var n=arguments[0],s=arguments[1],c=arguments[3],h=new C(n.getIntersection(c));this.addIntersection(h,s)}}},{key:"toString",value:function(){return Va.toLineString(new Qr(this._pts))}},{key:"getNodeList",value:function(){return this._nodeList}},{key:"addIntersectionNode",value:function(e,t){var n=t,s=n+1;if(s<this._pts.length){var c=this._pts[s];e.equals2D(c)&&(n=s)}return this._nodeList.add(e,n)}},{key:"addIntersections",value:function(e,t,n){for(var s=0;s<e.getIntersectionNum();s++)this.addIntersection(e,t,n,s)}},{key:"interfaces_",get:function(){return[u_]}}],[{key:"constructor_",value:function(){this._nodeList=new s_(this),this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t}},{key:"getNodedSubstrings",value:function(){if(arguments.length===1){var e=arguments[0],t=new ne;return o.getNodedSubstrings(e,t),t}if(arguments.length===2)for(var n=arguments[0],s=arguments[1],c=n.iterator();c.hasNext();){var h=c.next();h.getNodeList().addSplitEdges(s)}}}]),o}(),ht=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"minX",value:function(){return Math.min(this.p0.x,this.p1.x)}},{key:"orientationIndex",value:function(){if(arguments[0]instanceof o){var e=arguments[0],t=ae.index(this.p0,this.p1,e.p0),n=ae.index(this.p0,this.p1,e.p1);return t>=0&&n>=0||t<=0&&n<=0?Math.max(t,n):0}if(arguments[0]instanceof C){var s=arguments[0];return ae.index(this.p0,this.p1,s)}}},{key:"toGeometry",value:function(e){return e.createLineString([this.p0,this.p1])}},{key:"isVertical",value:function(){return this.p0.x===this.p1.x}},{key:"equals",value:function(e){if(!(e instanceof o))return!1;var t=e;return this.p0.equals(t.p0)&&this.p1.equals(t.p1)}},{key:"intersection",value:function(e){var t=new Gn;return t.computeIntersection(this.p0,this.p1,e.p0,e.p1),t.hasIntersection()?t.getIntersection(0):null}},{key:"project",value:function(){if(arguments[0]instanceof C){var e=arguments[0];if(e.equals(this.p0)||e.equals(this.p1))return new C(e);var t=this.projectionFactor(e),n=new C;return n.x=this.p0.x+t*(this.p1.x-this.p0.x),n.y=this.p0.y+t*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof o){var s=arguments[0],c=this.projectionFactor(s.p0),h=this.projectionFactor(s.p1);if(c>=1&&h>=1||c<=0&&h<=0)return null;var g=this.project(s.p0);c<0&&(g=this.p0),c>1&&(g=this.p1);var d=this.project(s.p1);return h<0&&(d=this.p0),h>1&&(d=this.p1),new o(g,d)}}},{key:"normalize",value:function(){this.p1.compareTo(this.p0)<0&&this.reverse()}},{key:"angle",value:function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)}},{key:"getCoordinate",value:function(e){return e===0?this.p0:this.p1}},{key:"distancePerpendicular",value:function(e){return xt.pointToLinePerpendicular(e,this.p0,this.p1)}},{key:"minY",value:function(){return Math.min(this.p0.y,this.p1.y)}},{key:"midPoint",value:function(){return o.midPoint(this.p0,this.p1)}},{key:"projectionFactor",value:function(e){if(e.equals(this.p0))return 0;if(e.equals(this.p1))return 1;var t=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,s=t*t+n*n;return s<=0?K.NaN:((e.x-this.p0.x)*t+(e.y-this.p0.y)*n)/s}},{key:"closestPoints",value:function(e){var t=this.intersection(e);if(t!==null)return[t,t];var n=new Array(2).fill(null),s=K.MAX_VALUE,c=null,h=this.closestPoint(e.p0);s=h.distance(e.p0),n[0]=h,n[1]=e.p0;var g=this.closestPoint(e.p1);(c=g.distance(e.p1))<s&&(s=c,n[0]=g,n[1]=e.p1);var d=e.closestPoint(this.p0);(c=d.distance(this.p0))<s&&(s=c,n[0]=this.p0,n[1]=d);var E=e.closestPoint(this.p1);return(c=E.distance(this.p1))<s&&(s=c,n[0]=this.p1,n[1]=E),n}},{key:"closestPoint",value:function(e){var t=this.projectionFactor(e);return t>0&&t<1?this.project(e):this.p0.distance(e)<this.p1.distance(e)?this.p0:this.p1}},{key:"maxX",value:function(){return Math.max(this.p0.x,this.p1.x)}},{key:"getLength",value:function(){return this.p0.distance(this.p1)}},{key:"compareTo",value:function(e){var t=e,n=this.p0.compareTo(t.p0);return n!==0?n:this.p1.compareTo(t.p1)}},{key:"reverse",value:function(){var e=this.p0;this.p0=this.p1,this.p1=e}},{key:"equalsTopo",value:function(e){return this.p0.equals(e.p0)&&this.p1.equals(e.p1)||this.p0.equals(e.p1)&&this.p1.equals(e.p0)}},{key:"lineIntersection",value:function(e){return Vr.intersection(this.p0,this.p1,e.p0,e.p1)}},{key:"maxY",value:function(){return Math.max(this.p0.y,this.p1.y)}},{key:"pointAlongOffset",value:function(e,t){var n=this.p0.x+e*(this.p1.x-this.p0.x),s=this.p0.y+e*(this.p1.y-this.p0.y),c=this.p1.x-this.p0.x,h=this.p1.y-this.p0.y,g=Math.sqrt(c*c+h*h),d=0,E=0;if(t!==0){if(g<=0)throw new IllegalStateException("Cannot compute offset from zero-length line segment");d=t*c/g,E=t*h/g}return new C(n-E,s+d)}},{key:"setCoordinates",value:function(){if(arguments.length===1){var e=arguments[0];this.setCoordinates(e.p0,e.p1)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.p0.x=t.x,this.p0.y=t.y,this.p1.x=n.x,this.p1.y=n.y}}},{key:"segmentFraction",value:function(e){var t=this.projectionFactor(e);return t<0?t=0:(t>1||K.isNaN(t))&&(t=1),t}},{key:"toString",value:function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"}},{key:"isHorizontal",value:function(){return this.p0.y===this.p1.y}},{key:"reflect",value:function(e){var t=this.p1.getY()-this.p0.getY(),n=this.p0.getX()-this.p1.getX(),s=this.p0.getY()*(this.p1.getX()-this.p0.getX())-this.p0.getX()*(this.p1.getY()-this.p0.getY()),c=t*t+n*n,h=t*t-n*n,g=e.getX(),d=e.getY();return new C((-h*g-2*t*n*d-2*t*s)/c,(h*d-2*t*n*g-2*n*s)/c)}},{key:"distance",value:function(){if(arguments[0]instanceof o){var e=arguments[0];return xt.segmentToSegment(this.p0,this.p1,e.p0,e.p1)}if(arguments[0]instanceof C){var t=arguments[0];return xt.pointToSegment(t,this.p0,this.p1)}}},{key:"pointAlong",value:function(e){var t=new C;return t.x=this.p0.x+e*(this.p1.x-this.p0.x),t.y=this.p0.y+e*(this.p1.y-this.p0.y),t}},{key:"hashCode",value:function(){var e=K.doubleToLongBits(this.p0.x);e^=31*K.doubleToLongBits(this.p0.y);var t=Math.trunc(e)^Math.trunc(e>>32),n=K.doubleToLongBits(this.p1.x);return n^=31*K.doubleToLongBits(this.p1.y),t^(Math.trunc(n)^Math.trunc(n>>32))}},{key:"interfaces_",get:function(){return[q,A]}}],[{key:"constructor_",value:function(){if(this.p0=null,this.p1=null,arguments.length===0)o.constructor_.call(this,new C,new C);else if(arguments.length===1){var e=arguments[0];o.constructor_.call(this,e.p0,e.p1)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.p0=t,this.p1=n}else if(arguments.length===4){var s=arguments[0],c=arguments[1],h=arguments[2],g=arguments[3];o.constructor_.call(this,new C(s,c),new C(h,g))}}},{key:"midPoint",value:function(e,t){return new C((e.x+t.x)/2,(e.y+t.y)/2)}}]),o}(),l_=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"overlap",value:function(){if(arguments.length!==2){if(arguments.length===4){var e=arguments[0],t=arguments[1],n=arguments[2],s=arguments[3];e.getLineSegment(t,this._overlapSeg1),n.getLineSegment(s,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}}}],[{key:"constructor_",value:function(){this._overlapSeg1=new ht,this._overlapSeg2=new ht}}]),o}(),Rf=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"getLineSegment",value:function(e,t){t.p0=this._pts[e],t.p1=this._pts[e+1]}},{key:"computeSelect",value:function(e,t,n,s){var c=this._pts[t],h=this._pts[n];if(n-t==1)return s.select(this,t),null;if(!e.intersects(c,h))return null;var g=Math.trunc((t+n)/2);t<g&&this.computeSelect(e,t,g,s),g<n&&this.computeSelect(e,g,n,s)}},{key:"getCoordinates",value:function(){for(var e=new Array(this._end-this._start+1).fill(null),t=0,n=this._start;n<=this._end;n++)e[t++]=this._pts[n];return e}},{key:"computeOverlaps",value:function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];this.computeOverlaps(this._start,this._end,e,e._start,e._end,t)}else if(arguments.length===6){var n=arguments[0],s=arguments[1],c=arguments[2],h=arguments[3],g=arguments[4],d=arguments[5];if(s-n==1&&g-h==1)return d.overlap(this,n,c,h),null;if(!this.overlaps(n,s,c,h,g))return null;var E=Math.trunc((n+s)/2),w=Math.trunc((h+g)/2);n<E&&(h<w&&this.computeOverlaps(n,E,c,h,w,d),w<g&&this.computeOverlaps(n,E,c,w,g,d)),E<s&&(h<w&&this.computeOverlaps(E,s,c,h,w,d),w<g&&this.computeOverlaps(E,s,c,w,g,d))}}},{key:"setId",value:function(e){this._id=e}},{key:"select",value:function(e,t){this.computeSelect(e,this._start,this._end,t)}},{key:"getEnvelope",value:function(){if(this._env===null){var e=this._pts[this._start],t=this._pts[this._end];this._env=new Se(e,t)}return this._env}},{key:"overlaps",value:function(e,t,n,s,c){return Se.intersects(this._pts[e],this._pts[t],n._pts[s],n._pts[c])}},{key:"getEndIndex",value:function(){return this._end}},{key:"getStartIndex",value:function(){return this._start}},{key:"getContext",value:function(){return this._context}},{key:"getId",value:function(){return this._id}}],[{key:"constructor_",value:function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var e=arguments[0],t=arguments[1],n=arguments[2],s=arguments[3];this._pts=e,this._start=t,this._end=n,this._context=s}}]),o}(),c_=function(){function o(){i(this,o)}return l(o,null,[{key:"findChainEnd",value:function(e,t){for(var n=t;n<e.length-1&&e[n].equals2D(e[n+1]);)n++;if(n>=e.length-1)return e.length-1;for(var s=rt.quadrant(e[n],e[n+1]),c=t+1;c<e.length&&!(!e[c-1].equals2D(e[c])&&rt.quadrant(e[c-1],e[c])!==s);)c++;return c-1}},{key:"getChains",value:function(){if(arguments.length===1){var e=arguments[0];return o.getChains(e,null)}if(arguments.length===2){var t=arguments[0],n=arguments[1],s=new ne,c=0;do{var h=o.findChainEnd(t,c),g=new Rf(t,c,h,n);s.add(g),c=h}while(c<t.length-1);return s}}}]),o}(),Ka=function(){function o(){i(this,o)}return l(o,[{key:"computeNodes",value:function(e){}},{key:"getNodedSubstrings",value:function(){}}]),o}(),Mf=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"setSegmentIntersector",value:function(e){this._segInt=e}},{key:"interfaces_",get:function(){return[Ka]}}],[{key:"constructor_",value:function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setSegmentIntersector(e)}}}}]),o}(),Ja=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"getMonotoneChains",value:function(){return this._monoChains}},{key:"getNodedSubstrings",value:function(){return Bn.getNodedSubstrings(this._nodedSegStrings)}},{key:"getIndex",value:function(){return this._index}},{key:"add",value:function(n){for(var s=c_.getChains(n.getCoordinates(),n).iterator();s.hasNext();){var c=s.next();c.setId(this._idCounter++),this._index.insert(c.getEnvelope(),c),this._monoChains.add(c)}}},{key:"computeNodes",value:function(n){this._nodedSegStrings=n;for(var s=n.iterator();s.hasNext();)this.add(s.next());this.intersectChains()}},{key:"intersectChains",value:function(){for(var n=new Pf(this._segInt),s=this._monoChains.iterator();s.hasNext();)for(var c=s.next(),h=this._index.query(c.getEnvelope()).iterator();h.hasNext();){var g=h.next();if(g.getId()>c.getId()&&(c.computeOverlaps(g,n),this._nOverlaps++),this._segInt.isDone())return null}}}],[{key:"constructor_",value:function(){if(this._monoChains=new ne,this._index=new Xt,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0,arguments.length!==0){if(arguments.length===1){var n=arguments[0];Mf.constructor_.call(this,n)}}}}]),t}(Mf),Pf=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"overlap",value:function(){if(arguments.length!==4)return b(v(t.prototype),"overlap",this).apply(this,arguments);var n=arguments[0],s=arguments[1],c=arguments[2],h=arguments[3],g=n.getContext(),d=c.getContext();this._si.processIntersections(g,s,d,h)}}],[{key:"constructor_",value:function(){this._si=null;var n=arguments[0];this._si=n}}]),t}(l_);Ja.SegmentOverlapAction=Pf;var Pt=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"isDeletable",value:function(e,t,n,s){var c=this._inputLine[e],h=this._inputLine[t],g=this._inputLine[n];return!!this.isConcave(c,h,g)&&!!this.isShallow(c,h,g,s)&&this.isShallowSampled(c,h,e,n,s)}},{key:"deleteShallowConcavities",value:function(){for(var e=1,t=this.findNextNonDeletedIndex(e),n=this.findNextNonDeletedIndex(t),s=!1;n<this._inputLine.length;){var c=!1;this.isDeletable(e,t,n,this._distanceTol)&&(this._isDeleted[t]=o.DELETE,c=!0,s=!0),e=c?n:t,t=this.findNextNonDeletedIndex(e),n=this.findNextNonDeletedIndex(t)}return s}},{key:"isShallowConcavity",value:function(e,t,n,s){return ae.index(e,t,n)===this._angleOrientation&&xt.pointToSegment(t,e,n)<s}},{key:"isShallowSampled",value:function(e,t,n,s,c){var h=Math.trunc((s-n)/o.NUM_PTS_TO_CHECK);h<=0&&(h=1);for(var g=n;g<s;g+=h)if(!this.isShallow(e,t,this._inputLine[g],c))return!1;return!0}},{key:"isConcave",value:function(e,t,n){var s=ae.index(e,t,n)===this._angleOrientation;return s}},{key:"simplify",value:function(e){this._distanceTol=Math.abs(e),e<0&&(this._angleOrientation=ae.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var t=!1;do t=this.deleteShallowConcavities();while(t);return this.collapseLine()}},{key:"findNextNonDeletedIndex",value:function(e){for(var t=e+1;t<this._inputLine.length&&this._isDeleted[t]===o.DELETE;)t++;return t}},{key:"isShallow",value:function(e,t,n,s){return xt.pointToSegment(t,e,n)<s}},{key:"collapseLine",value:function(){for(var e=new Zr,t=0;t<this._inputLine.length;t++)this._isDeleted[t]!==o.DELETE&&e.add(this._inputLine[t]);return e.toCoordinateArray()}}],[{key:"constructor_",value:function(){this._inputLine=null,this._distanceTol=null,this._isDeleted=null,this._angleOrientation=ae.COUNTERCLOCKWISE;var e=arguments[0];this._inputLine=e}},{key:"simplify",value:function(e,t){return new o(e).simplify(t)}}]),o}();Pt.INIT=0,Pt.DELETE=1,Pt.KEEP=1,Pt.NUM_PTS_TO_CHECK=10;var Af=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"getCoordinates",value:function(){return this._ptList.toArray(o.COORDINATE_ARRAY_TYPE)}},{key:"setPrecisionModel",value:function(e){this._precisionModel=e}},{key:"addPt",value:function(e){var t=new C(e);if(this._precisionModel.makePrecise(t),this.isRedundant(t))return null;this._ptList.add(t)}},{key:"reverse",value:function(){}},{key:"addPts",value:function(e,t){if(t)for(var n=0;n<e.length;n++)this.addPt(e[n]);else for(var s=e.length-1;s>=0;s--)this.addPt(e[s])}},{key:"isRedundant",value:function(e){if(this._ptList.size()<1)return!1;var t=this._ptList.get(this._ptList.size()-1);return e.distance(t)<this._minimimVertexDistance}},{key:"toString",value:function(){return new yr().createLineString(this.getCoordinates()).toString()}},{key:"closeRing",value:function(){if(this._ptList.size()<1)return null;var e=new C(this._ptList.get(0)),t=this._ptList.get(this._ptList.size()-1);if(e.equals(t))return null;this._ptList.add(e)}},{key:"setMinimumVertexDistance",value:function(e){this._minimimVertexDistance=e}}],[{key:"constructor_",value:function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new ne}}]),o}();Af.COORDINATE_ARRAY_TYPE=new Array(0).fill(null);var gt=function(){function o(){i(this,o)}return l(o,null,[{key:"toDegrees",value:function(e){return 180*e/Math.PI}},{key:"normalize",value:function(e){for(;e>Math.PI;)e-=o.PI_TIMES_2;for(;e<=-Math.PI;)e+=o.PI_TIMES_2;return e}},{key:"angle",value:function(){if(arguments.length===1){var e=arguments[0];return Math.atan2(e.y,e.x)}if(arguments.length===2){var t=arguments[0],n=arguments[1],s=n.x-t.x,c=n.y-t.y;return Math.atan2(c,s)}}},{key:"isAcute",value:function(e,t,n){var s=e.x-t.x,c=e.y-t.y;return s*(n.x-t.x)+c*(n.y-t.y)>0}},{key:"isObtuse",value:function(e,t,n){var s=e.x-t.x,c=e.y-t.y;return s*(n.x-t.x)+c*(n.y-t.y)<0}},{key:"interiorAngle",value:function(e,t,n){var s=o.angle(t,e),c=o.angle(t,n);return Math.abs(c-s)}},{key:"normalizePositive",value:function(e){if(e<0){for(;e<0;)e+=o.PI_TIMES_2;e>=o.PI_TIMES_2&&(e=0)}else{for(;e>=o.PI_TIMES_2;)e-=o.PI_TIMES_2;e<0&&(e=0)}return e}},{key:"angleBetween",value:function(e,t,n){var s=o.angle(t,e),c=o.angle(t,n);return o.diff(s,c)}},{key:"diff",value:function(e,t){var n=null;return(n=e<t?t-e:e-t)>Math.PI&&(n=2*Math.PI-n),n}},{key:"toRadians",value:function(e){return e*Math.PI/180}},{key:"getTurn",value:function(e,t){var n=Math.sin(t-e);return n>0?o.COUNTERCLOCKWISE:n<0?o.CLOCKWISE:o.NONE}},{key:"angleBetweenOriented",value:function(e,t,n){var s=o.angle(t,e),c=o.angle(t,n)-s;return c<=-Math.PI?c+o.PI_TIMES_2:c>Math.PI?c-o.PI_TIMES_2:c}}]),o}();gt.PI_TIMES_2=2*Math.PI,gt.PI_OVER_2=Math.PI/2,gt.PI_OVER_4=Math.PI/4,gt.COUNTERCLOCKWISE=ae.COUNTERCLOCKWISE,gt.CLOCKWISE=ae.CLOCKWISE,gt.NONE=ae.COLLINEAR;var $r=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"addNextSegment",value:function(e,t){if(this._s0=this._s1,this._s1=this._s2,this._s2=e,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=ae.index(this._s0,this._s1,this._s2),s=n===ae.CLOCKWISE&&this._side===W.LEFT||n===ae.COUNTERCLOCKWISE&&this._side===W.RIGHT;n===0?this.addCollinear(t):s?this.addOutsideTurn(n,t):this.addInsideTurn(n,t)}},{key:"addLineEndCap",value:function(e,t){var n=new ht(e,t),s=new ht;this.computeOffsetSegment(n,W.LEFT,this._distance,s);var c=new ht;this.computeOffsetSegment(n,W.RIGHT,this._distance,c);var h=t.x-e.x,g=t.y-e.y,d=Math.atan2(g,h);switch(this._bufParams.getEndCapStyle()){case R.CAP_ROUND:this._segList.addPt(s.p1),this.addDirectedFillet(t,d+Math.PI/2,d-Math.PI/2,ae.CLOCKWISE,this._distance),this._segList.addPt(c.p1);break;case R.CAP_FLAT:this._segList.addPt(s.p1),this._segList.addPt(c.p1);break;case R.CAP_SQUARE:var E=new C;E.x=Math.abs(this._distance)*Math.cos(d),E.y=Math.abs(this._distance)*Math.sin(d);var w=new C(s.p1.x+E.x,s.p1.y+E.y),N=new C(c.p1.x+E.x,c.p1.y+E.y);this._segList.addPt(w),this._segList.addPt(N)}}},{key:"getCoordinates",value:function(){return this._segList.getCoordinates()}},{key:"addMitreJoin",value:function(e,t,n,s){var c=Vr.intersection(t.p0,t.p1,n.p0,n.p1);if(c!==null&&(s<=0?1:c.distance(e)/Math.abs(s))<=this._bufParams.getMitreLimit())return this._segList.addPt(c),null;this.addLimitedMitreJoin(t,n,s,this._bufParams.getMitreLimit())}},{key:"addOutsideTurn",value:function(e,t){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*o.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===R.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===R.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(t&&this._segList.addPt(this._offset0.p1),this.addCornerFillet(this._s1,this._offset0.p1,this._offset1.p0,e,this._distance),this._segList.addPt(this._offset1.p0))}},{key:"createSquare",value:function(e){this._segList.addPt(new C(e.x+this._distance,e.y+this._distance)),this._segList.addPt(new C(e.x+this._distance,e.y-this._distance)),this._segList.addPt(new C(e.x-this._distance,e.y-this._distance)),this._segList.addPt(new C(e.x-this._distance,e.y+this._distance)),this._segList.closeRing()}},{key:"addSegments",value:function(e,t){this._segList.addPts(e,t)}},{key:"addFirstSegment",value:function(){this._segList.addPt(this._offset1.p0)}},{key:"addCornerFillet",value:function(e,t,n,s,c){var h=t.x-e.x,g=t.y-e.y,d=Math.atan2(g,h),E=n.x-e.x,w=n.y-e.y,N=Math.atan2(w,E);s===ae.CLOCKWISE?d<=N&&(d+=2*Math.PI):d>=N&&(d-=2*Math.PI),this._segList.addPt(t),this.addDirectedFillet(e,d,N,s,c),this._segList.addPt(n)}},{key:"addLastSegment",value:function(){this._segList.addPt(this._offset1.p1)}},{key:"initSideSegments",value:function(e,t,n){this._s1=e,this._s2=t,this._side=n,this._seg1.setCoordinates(e,t),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)}},{key:"addLimitedMitreJoin",value:function(e,t,n,s){var c=this._seg0.p1,h=gt.angle(c,this._seg0.p0),g=gt.angleBetweenOriented(this._seg0.p0,c,this._seg1.p1)/2,d=gt.normalize(h+g),E=gt.normalize(d+Math.PI),w=s*n,N=n-w*Math.abs(Math.sin(g)),F=c.x+w*Math.cos(E),j=c.y+w*Math.sin(E),X=new C(F,j),$=new ht(c,X),re=$.pointAlongOffset(1,N),fe=$.pointAlongOffset(1,-N);this._side===W.LEFT?(this._segList.addPt(re),this._segList.addPt(fe)):(this._segList.addPt(fe),this._segList.addPt(re))}},{key:"addDirectedFillet",value:function(e,t,n,s,c){var h=s===ae.CLOCKWISE?-1:1,g=Math.abs(t-n),d=Math.trunc(g/this._filletAngleQuantum+.5);if(d<1)return null;for(var E=g/d,w=new C,N=0;N<d;N++){var F=t+h*N*E;w.x=e.x+c*Math.cos(F),w.y=e.y+c*Math.sin(F),this._segList.addPt(w)}}},{key:"computeOffsetSegment",value:function(e,t,n,s){var c=t===W.LEFT?1:-1,h=e.p1.x-e.p0.x,g=e.p1.y-e.p0.y,d=Math.sqrt(h*h+g*g),E=c*n*h/d,w=c*n*g/d;s.p0.x=e.p0.x-w,s.p0.y=e.p0.y+E,s.p1.x=e.p1.x-w,s.p1.y=e.p1.y+E}},{key:"addInsideTurn",value:function(e,t){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*o.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new C((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var s=new C((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(s)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}}},{key:"createCircle",value:function(e){var t=new C(e.x+this._distance,e.y);this._segList.addPt(t),this.addDirectedFillet(e,0,2*Math.PI,-1,this._distance),this._segList.closeRing()}},{key:"addBevelJoin",value:function(e,t){this._segList.addPt(e.p1),this._segList.addPt(t.p0)}},{key:"init",value:function(e){this._distance=e,this._maxCurveSegmentError=e*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Af,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(e*o.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)}},{key:"addCollinear",value:function(e){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===R.JOIN_BEVEL||this._bufParams.getJoinStyle()===R.JOIN_MITRE?(e&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addCornerFillet(this._s1,this._offset0.p1,this._offset1.p0,ae.CLOCKWISE,this._distance))}},{key:"closeRing",value:function(){this._segList.closeRing()}},{key:"hasNarrowConcaveAngle",value:function(){return this._hasNarrowConcaveAngle}}],[{key:"constructor_",value:function(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new ht,this._seg1=new ht,this._offset0=new ht,this._offset1=new ht,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],t=arguments[1],n=arguments[2];this._precisionModel=e,this._bufParams=t,this._li=new Gn,this._filletAngleQuantum=Math.PI/2/t.getQuadrantSegments(),t.getQuadrantSegments()>=8&&t.getJoinStyle()===R.JOIN_ROUND&&(this._closingSegLengthFactor=o.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)}}]),o}();$r.OFFSET_SEGMENT_SEPARATION_FACTOR=.001,$r.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001,$r.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1e-6,$r.MAX_CLOSING_SEG_LEN_FACTOR=80;var f_=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"getOffsetCurve",value:function(e,t){if(this._distance=t,t===0)return null;var n=t<0,s=Math.abs(t),c=this.getSegGen(s);e.length<=1?this.computePointCurve(e[0],c):this.computeOffsetCurve(e,n,c);var h=c.getCoordinates();return n&&Ye.reverse(h),h}},{key:"computeSingleSidedBufferCurve",value:function(e,t,n){var s=this.simplifyTolerance(this._distance);if(t){n.addSegments(e,!0);var c=Pt.simplify(e,-s),h=c.length-1;n.initSideSegments(c[h],c[h-1],W.LEFT),n.addFirstSegment();for(var g=h-2;g>=0;g--)n.addNextSegment(c[g],!0)}else{n.addSegments(e,!1);var d=Pt.simplify(e,s),E=d.length-1;n.initSideSegments(d[0],d[1],W.LEFT),n.addFirstSegment();for(var w=2;w<=E;w++)n.addNextSegment(d[w],!0)}n.addLastSegment(),n.closeRing()}},{key:"computeRingBufferCurve",value:function(e,t,n){var s=this.simplifyTolerance(this._distance);t===W.RIGHT&&(s=-s);var c=Pt.simplify(e,s),h=c.length-1;n.initSideSegments(c[h-1],c[0],t);for(var g=1;g<=h;g++){var d=g!==1;n.addNextSegment(c[g],d)}n.closeRing()}},{key:"computeLineBufferCurve",value:function(e,t){var n=this.simplifyTolerance(this._distance),s=Pt.simplify(e,n),c=s.length-1;t.initSideSegments(s[0],s[1],W.LEFT);for(var h=2;h<=c;h++)t.addNextSegment(s[h],!0);t.addLastSegment(),t.addLineEndCap(s[c-1],s[c]);var g=Pt.simplify(e,-n),d=g.length-1;t.initSideSegments(g[d],g[d-1],W.LEFT);for(var E=d-2;E>=0;E--)t.addNextSegment(g[E],!0);t.addLastSegment(),t.addLineEndCap(g[1],g[0]),t.closeRing()}},{key:"computePointCurve",value:function(e,t){switch(this._bufParams.getEndCapStyle()){case R.CAP_ROUND:t.createCircle(e);break;case R.CAP_SQUARE:t.createSquare(e)}}},{key:"getLineCurve",value:function(e,t){if(this._distance=t,this.isLineOffsetEmpty(t))return null;var n=Math.abs(t),s=this.getSegGen(n);if(e.length<=1)this.computePointCurve(e[0],s);else if(this._bufParams.isSingleSided()){var c=t<0;this.computeSingleSidedBufferCurve(e,c,s)}else this.computeLineBufferCurve(e,s);return s.getCoordinates()}},{key:"getBufferParameters",value:function(){return this._bufParams}},{key:"simplifyTolerance",value:function(e){return e*this._bufParams.getSimplifyFactor()}},{key:"getRingCurve",value:function(e,t,n){if(this._distance=n,e.length<=2)return this.getLineCurve(e,n);if(n===0)return o.copyCoordinates(e);var s=this.getSegGen(n);return this.computeRingBufferCurve(e,t,s),s.getCoordinates()}},{key:"computeOffsetCurve",value:function(e,t,n){var s=this.simplifyTolerance(this._distance);if(t){var c=Pt.simplify(e,-s),h=c.length-1;n.initSideSegments(c[h],c[h-1],W.LEFT),n.addFirstSegment();for(var g=h-2;g>=0;g--)n.addNextSegment(c[g],!0)}else{var d=Pt.simplify(e,s),E=d.length-1;n.initSideSegments(d[0],d[1],W.LEFT),n.addFirstSegment();for(var w=2;w<=E;w++)n.addNextSegment(d[w],!0)}n.addLastSegment()}},{key:"isLineOffsetEmpty",value:function(e){return e===0||e<0&&!this._bufParams.isSingleSided()}},{key:"getSegGen",value:function(e){return new $r(this._precisionModel,this._bufParams,e)}}],[{key:"constructor_",value:function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var e=arguments[0],t=arguments[1];this._precisionModel=e,this._bufParams=t}},{key:"copyCoordinates",value:function(e){for(var t=new Array(e.length).fill(null),n=0;n<t.length;n++)t[n]=new C(e[n]);return t}}]),o}(),Df=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"findStabbedSegments",value:function(){if(arguments.length===1){for(var e=arguments[0],t=new ne,n=this._subgraphs.iterator();n.hasNext();){var s=n.next(),c=s.getEnvelope();e.y<c.getMinY()||e.y>c.getMaxY()||this.findStabbedSegments(e,s.getDirectedEdges(),t)}return t}if(arguments.length===3){if(le(arguments[2],at)&&arguments[0]instanceof C&&arguments[1]instanceof Qa)for(var h=arguments[0],g=arguments[1],d=arguments[2],E=g.getEdge().getCoordinates(),w=0;w<E.length-1;w++){this._seg.p0=E[w],this._seg.p1=E[w+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse();var N=Math.max(this._seg.p0.x,this._seg.p1.x);if(!(N<h.x)&&!(this._seg.isHorizontal()||h.y<this._seg.p0.y||h.y>this._seg.p1.y||ae.index(this._seg.p0,this._seg.p1,h)===ae.RIGHT)){var F=g.getDepth(W.LEFT);this._seg.p0.equals(E[w])||(F=g.getDepth(W.RIGHT));var j=new Ff(this._seg,F);d.add(j)}}else if(le(arguments[2],at)&&arguments[0]instanceof C&&le(arguments[1],at))for(var X=arguments[0],$=arguments[1],re=arguments[2],fe=$.iterator();fe.hasNext();){var ke=fe.next();ke.isForward()&&this.findStabbedSegments(X,ke,re)}}}},{key:"getDepth",value:function(e){var t=this.findStabbedSegments(e);return t.size()===0?0:dr.min(t)._leftDepth}}],[{key:"constructor_",value:function(){this._subgraphs=null,this._seg=new ht;var e=arguments[0];this._subgraphs=e}}]),o}(),Ff=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"compareTo",value:function(e){var t=e;if(this._upwardSeg.minX()>=t._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=t._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(t._upwardSeg);return n!==0||(n=-1*t._upwardSeg.orientationIndex(this._upwardSeg))!==0?n:this._upwardSeg.compareTo(t._upwardSeg)}},{key:"compareX",value:function(e,t){var n=e.p0.compareTo(t.p0);return n!==0?n:e.p1.compareTo(t.p1)}},{key:"toString",value:function(){return this._upwardSeg.toString()}},{key:"interfaces_",get:function(){return[q]}}],[{key:"constructor_",value:function(){this._upwardSeg=null,this._leftDepth=null;var e=arguments[0],t=arguments[1];this._upwardSeg=new ht(e),this._leftDepth=t}}]),o}();Df.DepthSegment=Ff;var Gf=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,null,[{key:"constructor_",value:function(){G.constructor_.call(this,"Projective point not representable on the Cartesian plane.")}}]),t}(G),$a=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"getY",value:function(){var e=this.y/this.w;if(K.isNaN(e)||K.isInfinite(e))throw new Gf;return e}},{key:"getX",value:function(){var e=this.x/this.w;if(K.isNaN(e)||K.isInfinite(e))throw new Gf;return e}},{key:"getCoordinate",value:function(){var e=new C;return e.x=this.getX(),e.y=this.getY(),e}}],[{key:"constructor_",value:function(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],n=arguments[1];this.x=t,this.y=n,this.w=1}else if(arguments[0]instanceof o&&arguments[1]instanceof o){var s=arguments[0],c=arguments[1];this.x=s.y*c.w-c.y*s.w,this.y=c.x*s.w-s.x*c.w,this.w=s.x*c.y-c.x*s.y}else if(arguments[0]instanceof C&&arguments[1]instanceof C){var h=arguments[0],g=arguments[1];this.x=h.y-g.y,this.y=g.x-h.x,this.w=h.x*g.y-g.x*h.y}}else if(arguments.length===3){var d=arguments[0],E=arguments[1],w=arguments[2];this.x=d,this.y=E,this.w=w}else if(arguments.length===4){var N=arguments[0],F=arguments[1],j=arguments[2],X=arguments[3],$=N.y-F.y,re=F.x-N.x,fe=N.x*F.y-F.x*N.y,ke=j.y-X.y,Be=X.x-j.x,Je=j.x*X.y-X.x*j.y;this.x=re*Je-Be*fe,this.y=ke*fe-$*Je,this.w=$*Be-ke*re}}}]),o}(),h_=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"area",value:function(){return o.area(this.p0,this.p1,this.p2)}},{key:"signedArea",value:function(){return o.signedArea(this.p0,this.p1,this.p2)}},{key:"interpolateZ",value:function(e){if(e===null)throw new M("Supplied point is null.");return o.interpolateZ(e,this.p0,this.p1,this.p2)}},{key:"longestSideLength",value:function(){return o.longestSideLength(this.p0,this.p1,this.p2)}},{key:"isAcute",value:function(){return o.isAcute(this.p0,this.p1,this.p2)}},{key:"circumcentre",value:function(){return o.circumcentre(this.p0,this.p1,this.p2)}},{key:"area3D",value:function(){return o.area3D(this.p0,this.p1,this.p2)}},{key:"centroid",value:function(){return o.centroid(this.p0,this.p1,this.p2)}},{key:"inCentre",value:function(){return o.inCentre(this.p0,this.p1,this.p2)}}],[{key:"constructor_",value:function(){this.p0=null,this.p1=null,this.p2=null;var e=arguments[0],t=arguments[1],n=arguments[2];this.p0=e,this.p1=t,this.p2=n}},{key:"area",value:function(e,t,n){return Math.abs(((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2)}},{key:"signedArea",value:function(e,t,n){return((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2}},{key:"det",value:function(e,t,n,s){return e*s-t*n}},{key:"interpolateZ",value:function(e,t,n,s){var c=t.x,h=t.y,g=n.x-c,d=s.x-c,E=n.y-h,w=s.y-h,N=g*w-d*E,F=e.x-c,j=e.y-h,X=(w*F-d*j)/N,$=(-E*F+g*j)/N;return t.getZ()+X*(n.getZ()-t.getZ())+$*(s.getZ()-t.getZ())}},{key:"longestSideLength",value:function(e,t,n){var s=e.distance(t),c=t.distance(n),h=n.distance(e),g=s;return c>g&&(g=c),h>g&&(g=h),g}},{key:"circumcentreDD",value:function(e,t,n){var s=te.valueOf(e.x).subtract(n.x),c=te.valueOf(e.y).subtract(n.y),h=te.valueOf(t.x).subtract(n.x),g=te.valueOf(t.y).subtract(n.y),d=te.determinant(s,c,h,g).multiply(2),E=s.sqr().add(c.sqr()),w=h.sqr().add(g.sqr()),N=te.determinant(c,E,g,w),F=te.determinant(s,E,h,w),j=te.valueOf(n.x).subtract(N.divide(d)).doubleValue(),X=te.valueOf(n.y).add(F.divide(d)).doubleValue();return new C(j,X)}},{key:"isAcute",value:function(e,t,n){return!!gt.isAcute(e,t,n)&&!!gt.isAcute(t,n,e)&&!!gt.isAcute(n,e,t)}},{key:"circumcentre",value:function(e,t,n){var s=n.x,c=n.y,h=e.x-s,g=e.y-c,d=t.x-s,E=t.y-c,w=2*o.det(h,g,d,E),N=o.det(g,h*h+g*g,E,d*d+E*E),F=o.det(h,h*h+g*g,d,d*d+E*E);return new C(s-N/w,c+F/w)}},{key:"perpendicularBisector",value:function(e,t){var n=t.x-e.x,s=t.y-e.y,c=new $a(e.x+n/2,e.y+s/2,1),h=new $a(e.x-s+n/2,e.y+n+s/2,1);return new $a(c,h)}},{key:"angleBisector",value:function(e,t,n){var s=t.distance(e),c=s/(s+t.distance(n)),h=n.x-e.x,g=n.y-e.y;return new C(e.x+c*h,e.y+c*g)}},{key:"area3D",value:function(e,t,n){var s=t.x-e.x,c=t.y-e.y,h=t.getZ()-e.getZ(),g=n.x-e.x,d=n.y-e.y,E=n.getZ()-e.getZ(),w=c*E-h*d,N=h*g-s*E,F=s*d-c*g,j=w*w+N*N+F*F,X=Math.sqrt(j)/2;return X}},{key:"centroid",value:function(e,t,n){var s=(e.x+t.x+n.x)/3,c=(e.y+t.y+n.y)/3;return new C(s,c)}},{key:"inCentre",value:function(e,t,n){var s=t.distance(n),c=e.distance(n),h=e.distance(t),g=s+c+h,d=(s*e.x+c*t.x+h*n.x)/g,E=(s*e.y+c*t.y+h*n.y)/g;return new C(d,E)}}]),o}(),g_=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"addRingSide",value:function(e,t,n,s,c){if(t===0&&e.length<Hr.MINIMUM_VALID_SIZE)return null;var h=s,g=c;e.length>=Hr.MINIMUM_VALID_SIZE&&ae.isCCW(e)&&(h=c,g=s,n=W.opposite(n));var d=this._curveBuilder.getRingCurve(e,n,t);this.addCurve(d,h,g)}},{key:"addRingBothSides",value:function(e,t){this.addRingSide(e,t,W.LEFT,I.EXTERIOR,I.INTERIOR),this.addRingSide(e,t,W.RIGHT,I.INTERIOR,I.EXTERIOR)}},{key:"addPoint",value:function(e){if(this._distance<=0)return null;var t=e.getCoordinates(),n=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(n,I.EXTERIOR,I.INTERIOR)}},{key:"addPolygon",value:function(e){var t=this._distance,n=W.LEFT;this._distance<0&&(t=-this._distance,n=W.RIGHT);var s=e.getExteriorRing(),c=Ye.removeRepeatedPoints(s.getCoordinates());if(this._distance<0&&this.isErodedCompletely(s,this._distance)||this._distance<=0&&c.length<3)return null;this.addRingSide(c,t,n,I.EXTERIOR,I.INTERIOR);for(var h=0;h<e.getNumInteriorRing();h++){var g=e.getInteriorRingN(h),d=Ye.removeRepeatedPoints(g.getCoordinates());this._distance>0&&this.isErodedCompletely(g,-this._distance)||this.addRingSide(d,t,W.opposite(n),I.INTERIOR,I.EXTERIOR)}}},{key:"isTriangleErodedCompletely",value:function(e,t){var n=new h_(e[0],e[1],e[2]),s=n.inCentre();return xt.pointToSegment(s,n.p0,n.p1)<Math.abs(t)}},{key:"addLineString",value:function(e){if(this._curveBuilder.isLineOffsetEmpty(this._distance))return null;var t=Ye.removeRepeatedPoints(e.getCoordinates());if(Ye.isRing(t)&&!this._curveBuilder.getBufferParameters().isSingleSided())this.addRingBothSides(t,this._distance);else{var n=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(n,I.EXTERIOR,I.INTERIOR)}}},{key:"addCurve",value:function(e,t,n){if(e===null||e.length<2)return null;var s=new Bn(e,new It(0,I.BOUNDARY,t,n));this._curveList.add(s)}},{key:"getCurves",value:function(){return this.add(this._inputGeom),this._curveList}},{key:"add",value:function(e){if(e.isEmpty())return null;if(e instanceof En)this.addPolygon(e);else if(e instanceof Ue)this.addLineString(e);else if(e instanceof ge)this.addPoint(e);else if(e instanceof za)this.addCollection(e);else if(e instanceof Xa)this.addCollection(e);else if(e instanceof Wa)this.addCollection(e);else{if(!(e instanceof ft))throw new ue(e.getGeometryType());this.addCollection(e)}}},{key:"isErodedCompletely",value:function(e,t){var n=e.getCoordinates();if(n.length<4)return t<0;if(n.length===4)return this.isTriangleErodedCompletely(n,t);var s=e.getEnvelopeInternal(),c=Math.min(s.getHeight(),s.getWidth());return t<0&&2*Math.abs(t)>c}},{key:"addCollection",value:function(e){for(var t=0;t<e.getNumGeometries();t++){var n=e.getGeometryN(t);this.add(n)}}}],[{key:"constructor_",value:function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new ne;var e=arguments[0],t=arguments[1],n=arguments[2];this._inputGeom=e,this._distance=t,this._curveBuilder=n}}]),o}(),y_=function(){function o(){i(this,o)}return l(o,[{key:"locate",value:function(e){}}]),o}(),v_=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"next",value:function(){if(this._atStart)return this._atStart=!1,o.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new Te;var e=this._parent.getGeometryN(this._index++);return e instanceof ft?(this._subcollectionIterator=new o(e),this._subcollectionIterator.next()):e}},{key:"remove",value:function(){throw new ue(this.getClass().getName())}},{key:"hasNext",value:function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)}},{key:"interfaces_",get:function(){return[i_]}}],[{key:"constructor_",value:function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var e=arguments[0];this._parent=e,this._atStart=!0,this._index=0,this._max=e.getNumGeometries()}},{key:"isAtomic",value:function(e){return!(e instanceof ft)}}]),o}(),d_=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"locate",value:function(e){return o.locate(e,this._geom)}},{key:"interfaces_",get:function(){return[y_]}}],[{key:"constructor_",value:function(){this._geom=null;var e=arguments[0];this._geom=e}},{key:"locatePointInPolygon",value:function(e,t){if(t.isEmpty())return I.EXTERIOR;var n=t.getExteriorRing(),s=o.locatePointInRing(e,n);if(s!==I.INTERIOR)return s;for(var c=0;c<t.getNumInteriorRing();c++){var h=t.getInteriorRingN(c),g=o.locatePointInRing(e,h);if(g===I.BOUNDARY)return I.BOUNDARY;if(g===I.INTERIOR)return I.EXTERIOR}return I.INTERIOR}},{key:"locatePointInRing",value:function(e,t){return t.getEnvelopeInternal().intersects(e)?Ha.locateInRing(e,t.getCoordinates()):I.EXTERIOR}},{key:"containsPointInPolygon",value:function(e,t){return I.EXTERIOR!==o.locatePointInPolygon(e,t)}},{key:"locateInGeometry",value:function(e,t){if(t instanceof En)return o.locatePointInPolygon(e,t);if(t instanceof ft)for(var n=new v_(t);n.hasNext();){var s=n.next();if(s!==t){var c=o.locateInGeometry(e,s);if(c!==I.EXTERIOR)return c}}return I.EXTERIOR}},{key:"isContained",value:function(e,t){return I.EXTERIOR!==o.locate(e,t)}},{key:"locate",value:function(e,t){return t.isEmpty()?I.EXTERIOR:t.getEnvelopeInternal().intersects(e)?o.locateInGeometry(e,t):I.EXTERIOR}}]),o}(),m_=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"getNextCW",value:function(e){this.getEdges();var t=this._edgeList.indexOf(e),n=t-1;return t===0&&(n=this._edgeList.size()-1),this._edgeList.get(n)}},{key:"propagateSideLabels",value:function(e){for(var t=I.NONE,n=this.iterator();n.hasNext();){var s=n.next().getLabel();s.isArea(e)&&s.getLocation(e,W.LEFT)!==I.NONE&&(t=s.getLocation(e,W.LEFT))}if(t===I.NONE)return null;for(var c=t,h=this.iterator();h.hasNext();){var g=h.next(),d=g.getLabel();if(d.getLocation(e,W.ON)===I.NONE&&d.setLocation(e,W.ON,c),d.isArea(e)){var E=d.getLocation(e,W.LEFT),w=d.getLocation(e,W.RIGHT);if(w!==I.NONE){if(w!==c)throw new ct("side location conflict",g.getCoordinate());E===I.NONE&&he.shouldNeverReachHere("found single null side (at "+g.getCoordinate()+")"),c=E}else he.isTrue(d.getLocation(e,W.LEFT)===I.NONE,"found single null side"),d.setLocation(e,W.RIGHT,c),d.setLocation(e,W.LEFT,c)}}}},{key:"getCoordinate",value:function(){var e=this.iterator();return e.hasNext()?e.next().getCoordinate():null}},{key:"print",value:function(e){ot.out.println("EdgeEndStar: "+this.getCoordinate());for(var t=this.iterator();t.hasNext();)t.next().print(e)}},{key:"isAreaLabelsConsistent",value:function(e){return this.computeEdgeEndLabels(e.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)}},{key:"checkAreaLabelsConsistent",value:function(e){var t=this.getEdges();if(t.size()<=0)return!0;var n=t.size()-1,s=t.get(n).getLabel().getLocation(e,W.LEFT);he.isTrue(s!==I.NONE,"Found unlabelled area edge");for(var c=s,h=this.iterator();h.hasNext();){var g=h.next().getLabel();he.isTrue(g.isArea(e),"Found non-area edge");var d=g.getLocation(e,W.LEFT),E=g.getLocation(e,W.RIGHT);if(d===E||E!==c)return!1;c=d}return!0}},{key:"findIndex",value:function(e){this.iterator();for(var t=0;t<this._edgeList.size();t++)if(this._edgeList.get(t)===e)return t;return-1}},{key:"iterator",value:function(){return this.getEdges().iterator()}},{key:"getEdges",value:function(){return this._edgeList===null&&(this._edgeList=new ne(this._edgeMap.values())),this._edgeList}},{key:"getLocation",value:function(e,t,n){return this._ptInAreaLocation[e]===I.NONE&&(this._ptInAreaLocation[e]=d_.locate(t,n[e].getGeometry())),this._ptInAreaLocation[e]}},{key:"toString",value:function(){var e=new Mn;e.append("EdgeEndStar: "+this.getCoordinate()),e.append(`
9
- `);for(var t=this.iterator();t.hasNext();){var n=t.next();e.append(n),e.append(`
10
- `)}return e.toString()}},{key:"computeEdgeEndLabels",value:function(e){for(var t=this.iterator();t.hasNext();)t.next().computeLabel(e)}},{key:"computeLabelling",value:function(e){this.computeEdgeEndLabels(e[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var t=[!1,!1],n=this.iterator();n.hasNext();)for(var s=n.next().getLabel(),c=0;c<2;c++)s.isLine(c)&&s.getLocation(c)===I.BOUNDARY&&(t[c]=!0);for(var h=this.iterator();h.hasNext();)for(var g=h.next(),d=g.getLabel(),E=0;E<2;E++)if(d.isAnyNull(E)){var w=I.NONE;if(t[E])w=I.EXTERIOR;else{var N=g.getCoordinate();w=this.getLocation(E,N,e)}d.setAllLocationsIfNull(E,w)}}},{key:"getDegree",value:function(){return this._edgeMap.size()}},{key:"insertEdgeEnd",value:function(e,t){this._edgeMap.put(e,t),this._edgeList=null}}],[{key:"constructor_",value:function(){this._edgeMap=new Jr,this._edgeList=null,this._ptInAreaLocation=[I.NONE,I.NONE]}}]),o}(),p_=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"linkResultDirectedEdges",value:function(){this.getResultAreaEdges();for(var n=null,s=null,c=this._SCANNING_FOR_INCOMING,h=0;h<this._resultAreaEdgeList.size();h++){var g=this._resultAreaEdgeList.get(h),d=g.getSym();if(g.getLabel().isArea())switch(n===null&&g.isInResult()&&(n=g),c){case this._SCANNING_FOR_INCOMING:if(!d.isInResult())continue;s=d,c=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!g.isInResult())continue;s.setNext(g),c=this._SCANNING_FOR_INCOMING}}if(c===this._LINKING_TO_OUTGOING){if(n===null)throw new ct("no outgoing dirEdge found",this.getCoordinate());he.isTrue(n.isInResult(),"unable to link last incoming dirEdge"),s.setNext(n)}}},{key:"insert",value:function(n){var s=n;this.insertEdgeEnd(s,s)}},{key:"getRightmostEdge",value:function(){var n=this.getEdges(),s=n.size();if(s<1)return null;var c=n.get(0);if(s===1)return c;var h=n.get(s-1),g=c.getQuadrant(),d=h.getQuadrant();return rt.isNorthern(g)&&rt.isNorthern(d)?c:rt.isNorthern(g)||rt.isNorthern(d)?c.getDy()!==0?c:h.getDy()!==0?h:(he.shouldNeverReachHere("found two horizontal edges incident on node"),null):h}},{key:"print",value:function(n){ot.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var s=this.iterator();s.hasNext();){var c=s.next();n.print("out "),c.print(n),n.println(),n.print("in "),c.getSym().print(n),n.println()}}},{key:"getResultAreaEdges",value:function(){if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new ne;for(var n=this.iterator();n.hasNext();){var s=n.next();(s.isInResult()||s.getSym().isInResult())&&this._resultAreaEdgeList.add(s)}return this._resultAreaEdgeList}},{key:"updateLabelling",value:function(n){for(var s=this.iterator();s.hasNext();){var c=s.next().getLabel();c.setAllLocationsIfNull(0,n.getLocation(0)),c.setAllLocationsIfNull(1,n.getLocation(1))}}},{key:"linkAllDirectedEdges",value:function(){this.getEdges();for(var n=null,s=null,c=this._edgeList.size()-1;c>=0;c--){var h=this._edgeList.get(c),g=h.getSym();s===null&&(s=g),n!==null&&g.setNext(n),n=h}s.setNext(n)}},{key:"computeDepths",value:function(){if(arguments.length===1){var n=arguments[0],s=this.findIndex(n),c=n.getDepth(W.LEFT),h=n.getDepth(W.RIGHT),g=this.computeDepths(s+1,this._edgeList.size(),c),d=this.computeDepths(0,s,g);if(d!==h)throw new ct("depth mismatch at "+n.getCoordinate())}else if(arguments.length===3){for(var E=arguments[0],w=arguments[1],N=arguments[2],F=N,j=E;j<w;j++){var X=this._edgeList.get(j);X.setEdgeDepths(W.RIGHT,F),F=X.getDepth(W.LEFT)}return F}}},{key:"mergeSymLabels",value:function(){for(var n=this.iterator();n.hasNext();){var s=n.next();s.getLabel().merge(s.getSym().getLabel())}}},{key:"linkMinimalDirectedEdges",value:function(n){for(var s=null,c=null,h=this._SCANNING_FOR_INCOMING,g=this._resultAreaEdgeList.size()-1;g>=0;g--){var d=this._resultAreaEdgeList.get(g),E=d.getSym();switch(s===null&&d.getEdgeRing()===n&&(s=d),h){case this._SCANNING_FOR_INCOMING:if(E.getEdgeRing()!==n)continue;c=E,h=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(d.getEdgeRing()!==n)continue;c.setNextMin(d),h=this._SCANNING_FOR_INCOMING}}h===this._LINKING_TO_OUTGOING&&(he.isTrue(s!==null,"found null for first outgoing dirEdge"),he.isTrue(s.getEdgeRing()===n,"unable to link last incoming dirEdge"),c.setNextMin(s))}},{key:"getOutgoingDegree",value:function(){if(arguments.length===0){for(var n=0,s=this.iterator();s.hasNext();){var c=s.next();c.isInResult()&&n++}return n}if(arguments.length===1){for(var h=arguments[0],g=0,d=this.iterator();d.hasNext();){var E=d.next();E.getEdgeRing()===h&&g++}return g}}},{key:"getLabel",value:function(){return this._label}},{key:"findCoveredLineEdges",value:function(){for(var n=I.NONE,s=this.iterator();s.hasNext();){var c=s.next(),h=c.getSym();if(!c.isLineEdge()){if(c.isInResult()){n=I.INTERIOR;break}if(h.isInResult()){n=I.EXTERIOR;break}}}if(n===I.NONE)return null;for(var g=n,d=this.iterator();d.hasNext();){var E=d.next(),w=E.getSym();E.isLineEdge()?E.getEdge().setCovered(g===I.INTERIOR):(E.isInResult()&&(g=I.EXTERIOR),w.isInResult()&&(g=I.INTERIOR))}}},{key:"computeLabelling",value:function(n){b(v(t.prototype),"computeLabelling",this).call(this,n),this._label=new It(I.NONE);for(var s=this.iterator();s.hasNext();)for(var c=s.next().getEdge().getLabel(),h=0;h<2;h++){var g=c.getLocation(h);g!==I.INTERIOR&&g!==I.BOUNDARY||this._label.setLocation(h,I.INTERIOR)}}}],[{key:"constructor_",value:function(){this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}}]),t}(m_),__=function(o){f(t,o);var e=S(t);function t(){return i(this,t),e.call(this)}return l(t,[{key:"createNode",value:function(n){return new as(n,new p_)}}]),t}(Nf),Bf=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"compareTo",value:function(e){var t=e;return o.compareOriented(this._pts,this._orientation,t._pts,t._orientation)}},{key:"interfaces_",get:function(){return[q]}}],[{key:"constructor_",value:function(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=o.orientation(e)}},{key:"orientation",value:function(e){return Ye.increasingDirection(e)===1}},{key:"compareOriented",value:function(e,t,n,s){for(var c=t?1:-1,h=s?1:-1,g=t?e.length:-1,d=s?n.length:-1,E=t?0:e.length-1,w=s?0:n.length-1;;){var N=e[E].compareTo(n[w]);if(N!==0)return N;var F=(E+=c)===g,j=(w+=h)===d;if(F&&!j)return-1;if(!F&&j)return 1;if(F&&j)return 0}}}]),o}(),E_=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"print",value:function(e){e.print("MULTILINESTRING ( ");for(var t=0;t<this._edges.size();t++){var n=this._edges.get(t);t>0&&e.print(","),e.print("(");for(var s=n.getCoordinates(),c=0;c<s.length;c++)c>0&&e.print(","),e.print(s[c].x+" "+s[c].y);e.println(")")}e.print(") ")}},{key:"addAll",value:function(e){for(var t=e.iterator();t.hasNext();)this.add(t.next())}},{key:"findEdgeIndex",value:function(e){for(var t=0;t<this._edges.size();t++)if(this._edges.get(t).equals(e))return t;return-1}},{key:"iterator",value:function(){return this._edges.iterator()}},{key:"getEdges",value:function(){return this._edges}},{key:"get",value:function(e){return this._edges.get(e)}},{key:"findEqualEdge",value:function(e){var t=new Bf(e.getCoordinates());return this._ocaMap.get(t)}},{key:"add",value:function(e){this._edges.add(e);var t=new Bf(e.getCoordinates());this._ocaMap.put(t,e)}}],[{key:"constructor_",value:function(){this._edges=new ne,this._ocaMap=new Jr}}]),o}(),qf=function(){function o(){i(this,o)}return l(o,[{key:"processIntersections",value:function(e,t,n,s){}},{key:"isDone",value:function(){}}]),o}(),k_=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"isTrivialIntersection",value:function(e,t,n,s){if(e===n&&this._li.getIntersectionNum()===1){if(o.isAdjacentSegments(t,s))return!0;if(e.isClosed()){var c=e.size()-1;if(t===0&&s===c||s===0&&t===c)return!0}}return!1}},{key:"getProperIntersectionPoint",value:function(){return this._properIntersectionPoint}},{key:"hasProperInteriorIntersection",value:function(){return this._hasProperInterior}},{key:"getLineIntersector",value:function(){return this._li}},{key:"hasProperIntersection",value:function(){return this._hasProper}},{key:"processIntersections",value:function(e,t,n,s){if(e===n&&t===s)return null;this.numTests++;var c=e.getCoordinates()[t],h=e.getCoordinates()[t+1],g=n.getCoordinates()[s],d=n.getCoordinates()[s+1];this._li.computeIntersection(c,h,g,d),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(e,t,n,s)||(this._hasIntersection=!0,e.addIntersections(this._li,t,0),n.addIntersections(this._li,s,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))}},{key:"hasIntersection",value:function(){return this._hasIntersection}},{key:"isDone",value:function(){return!1}},{key:"hasInteriorIntersection",value:function(){return this._hasInterior}},{key:"interfaces_",get:function(){return[qf]}}],[{key:"constructor_",value:function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var e=arguments[0];this._li=e}},{key:"isAdjacentSegments",value:function(e,t){return Math.abs(e-t)===1}}]),o}(),x_=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"getSegmentIndex",value:function(){return this.segmentIndex}},{key:"getCoordinate",value:function(){return this.coord}},{key:"print",value:function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex),e.println(" dist = "+this.dist)}},{key:"compareTo",value:function(e){var t=e;return this.compare(t.segmentIndex,t.dist)}},{key:"isEndPoint",value:function(e){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===e}},{key:"toString",value:function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist}},{key:"getDistance",value:function(){return this.dist}},{key:"compare",value:function(e,t){return this.segmentIndex<e?-1:this.segmentIndex>e?1:this.dist<t?-1:this.dist>t?1:0}},{key:"interfaces_",get:function(){return[q]}}],[{key:"constructor_",value:function(){this.coord=null,this.segmentIndex=null,this.dist=null;var e=arguments[0],t=arguments[1],n=arguments[2];this.coord=new C(e),this.segmentIndex=t,this.dist=n}}]),o}(),S_=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"print",value:function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();)t.next().print(e)}},{key:"iterator",value:function(){return this._nodeMap.values().iterator()}},{key:"addSplitEdges",value:function(e){this.addEndpoints();for(var t=this.iterator(),n=t.next();t.hasNext();){var s=t.next(),c=this.createSplitEdge(n,s);e.add(c),n=s}}},{key:"addEndpoints",value:function(){var e=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[e],e,0)}},{key:"createSplitEdge",value:function(e,t){var n=t.segmentIndex-e.segmentIndex+2,s=this.edge.pts[t.segmentIndex],c=t.dist>0||!t.coord.equals2D(s);c||n--;var h=new Array(n).fill(null),g=0;h[g++]=new C(e.coord);for(var d=e.segmentIndex+1;d<=t.segmentIndex;d++)h[g++]=this.edge.pts[d];return c&&(h[g]=t.coord),new Uf(h,new It(this.edge._label))}},{key:"add",value:function(e,t,n){var s=new x_(e,t,n),c=this._nodeMap.get(s);return c!==null?c:(this._nodeMap.put(s,s),s)}},{key:"isIntersection",value:function(e){for(var t=this.iterator();t.hasNext();)if(t.next().coord.equals(e))return!0;return!1}}],[{key:"constructor_",value:function(){this._nodeMap=new Jr,this.edge=null;var e=arguments[0];this.edge=e}}]),o}(),b_=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"isIntersects",value:function(){return!this.isDisjoint()}},{key:"isCovers",value:function(){return(o.isTrue(this._matrix[I.INTERIOR][I.INTERIOR])||o.isTrue(this._matrix[I.INTERIOR][I.BOUNDARY])||o.isTrue(this._matrix[I.BOUNDARY][I.INTERIOR])||o.isTrue(this._matrix[I.BOUNDARY][I.BOUNDARY]))&&this._matrix[I.EXTERIOR][I.INTERIOR]===V.FALSE&&this._matrix[I.EXTERIOR][I.BOUNDARY]===V.FALSE}},{key:"isCoveredBy",value:function(){return(o.isTrue(this._matrix[I.INTERIOR][I.INTERIOR])||o.isTrue(this._matrix[I.INTERIOR][I.BOUNDARY])||o.isTrue(this._matrix[I.BOUNDARY][I.INTERIOR])||o.isTrue(this._matrix[I.BOUNDARY][I.BOUNDARY]))&&this._matrix[I.INTERIOR][I.EXTERIOR]===V.FALSE&&this._matrix[I.BOUNDARY][I.EXTERIOR]===V.FALSE}},{key:"set",value:function(){if(arguments.length===1)for(var e=arguments[0],t=0;t<e.length;t++){var n=Math.trunc(t/3),s=t%3;this._matrix[n][s]=V.toDimensionValue(e.charAt(t))}else if(arguments.length===3){var c=arguments[0],h=arguments[1],g=arguments[2];this._matrix[c][h]=g}}},{key:"isContains",value:function(){return o.isTrue(this._matrix[I.INTERIOR][I.INTERIOR])&&this._matrix[I.EXTERIOR][I.INTERIOR]===V.FALSE&&this._matrix[I.EXTERIOR][I.BOUNDARY]===V.FALSE}},{key:"setAtLeast",value:function(){if(arguments.length===1)for(var e=arguments[0],t=0;t<e.length;t++){var n=Math.trunc(t/3),s=t%3;this.setAtLeast(n,s,V.toDimensionValue(e.charAt(t)))}else if(arguments.length===3){var c=arguments[0],h=arguments[1],g=arguments[2];this._matrix[c][h]<g&&(this._matrix[c][h]=g)}}},{key:"setAtLeastIfValid",value:function(e,t,n){e>=0&&t>=0&&this.setAtLeast(e,t,n)}},{key:"isWithin",value:function(){return o.isTrue(this._matrix[I.INTERIOR][I.INTERIOR])&&this._matrix[I.INTERIOR][I.EXTERIOR]===V.FALSE&&this._matrix[I.BOUNDARY][I.EXTERIOR]===V.FALSE}},{key:"isTouches",value:function(e,t){return e>t?this.isTouches(t,e):(e===V.A&&t===V.A||e===V.L&&t===V.L||e===V.L&&t===V.A||e===V.P&&t===V.A||e===V.P&&t===V.L)&&this._matrix[I.INTERIOR][I.INTERIOR]===V.FALSE&&(o.isTrue(this._matrix[I.INTERIOR][I.BOUNDARY])||o.isTrue(this._matrix[I.BOUNDARY][I.INTERIOR])||o.isTrue(this._matrix[I.BOUNDARY][I.BOUNDARY]))}},{key:"isOverlaps",value:function(e,t){return e===V.P&&t===V.P||e===V.A&&t===V.A?o.isTrue(this._matrix[I.INTERIOR][I.INTERIOR])&&o.isTrue(this._matrix[I.INTERIOR][I.EXTERIOR])&&o.isTrue(this._matrix[I.EXTERIOR][I.INTERIOR]):e===V.L&&t===V.L&&this._matrix[I.INTERIOR][I.INTERIOR]===1&&o.isTrue(this._matrix[I.INTERIOR][I.EXTERIOR])&&o.isTrue(this._matrix[I.EXTERIOR][I.INTERIOR])}},{key:"isEquals",value:function(e,t){return e===t&&o.isTrue(this._matrix[I.INTERIOR][I.INTERIOR])&&this._matrix[I.INTERIOR][I.EXTERIOR]===V.FALSE&&this._matrix[I.BOUNDARY][I.EXTERIOR]===V.FALSE&&this._matrix[I.EXTERIOR][I.INTERIOR]===V.FALSE&&this._matrix[I.EXTERIOR][I.BOUNDARY]===V.FALSE}},{key:"toString",value:function(){for(var e=new rs("123456789"),t=0;t<3;t++)for(var n=0;n<3;n++)e.setCharAt(3*t+n,V.toDimensionSymbol(this._matrix[t][n]));return e.toString()}},{key:"setAll",value:function(e){for(var t=0;t<3;t++)for(var n=0;n<3;n++)this._matrix[t][n]=e}},{key:"get",value:function(e,t){return this._matrix[e][t]}},{key:"transpose",value:function(){var e=this._matrix[1][0];return this._matrix[1][0]=this._matrix[0][1],this._matrix[0][1]=e,e=this._matrix[2][0],this._matrix[2][0]=this._matrix[0][2],this._matrix[0][2]=e,e=this._matrix[2][1],this._matrix[2][1]=this._matrix[1][2],this._matrix[1][2]=e,this}},{key:"matches",value:function(e){if(e.length!==9)throw new M("Should be length 9: "+e);for(var t=0;t<3;t++)for(var n=0;n<3;n++)if(!o.matches(this._matrix[t][n],e.charAt(3*t+n)))return!1;return!0}},{key:"add",value:function(e){for(var t=0;t<3;t++)for(var n=0;n<3;n++)this.setAtLeast(t,n,e.get(t,n))}},{key:"isDisjoint",value:function(){return this._matrix[I.INTERIOR][I.INTERIOR]===V.FALSE&&this._matrix[I.INTERIOR][I.BOUNDARY]===V.FALSE&&this._matrix[I.BOUNDARY][I.INTERIOR]===V.FALSE&&this._matrix[I.BOUNDARY][I.BOUNDARY]===V.FALSE}},{key:"isCrosses",value:function(e,t){return e===V.P&&t===V.L||e===V.P&&t===V.A||e===V.L&&t===V.A?o.isTrue(this._matrix[I.INTERIOR][I.INTERIOR])&&o.isTrue(this._matrix[I.INTERIOR][I.EXTERIOR]):e===V.L&&t===V.P||e===V.A&&t===V.P||e===V.A&&t===V.L?o.isTrue(this._matrix[I.INTERIOR][I.INTERIOR])&&o.isTrue(this._matrix[I.EXTERIOR][I.INTERIOR]):e===V.L&&t===V.L&&this._matrix[I.INTERIOR][I.INTERIOR]===0}},{key:"interfaces_",get:function(){return[U]}}],[{key:"constructor_",value:function(){if(this._matrix=null,arguments.length===0)this._matrix=Array(3).fill().map(function(){return Array(3)}),this.setAll(V.FALSE);else if(arguments.length===1){if(typeof arguments[0]=="string"){var e=arguments[0];o.constructor_.call(this),this.set(e)}else if(arguments[0]instanceof o){var t=arguments[0];o.constructor_.call(this),this._matrix[I.INTERIOR][I.INTERIOR]=t._matrix[I.INTERIOR][I.INTERIOR],this._matrix[I.INTERIOR][I.BOUNDARY]=t._matrix[I.INTERIOR][I.BOUNDARY],this._matrix[I.INTERIOR][I.EXTERIOR]=t._matrix[I.INTERIOR][I.EXTERIOR],this._matrix[I.BOUNDARY][I.INTERIOR]=t._matrix[I.BOUNDARY][I.INTERIOR],this._matrix[I.BOUNDARY][I.BOUNDARY]=t._matrix[I.BOUNDARY][I.BOUNDARY],this._matrix[I.BOUNDARY][I.EXTERIOR]=t._matrix[I.BOUNDARY][I.EXTERIOR],this._matrix[I.EXTERIOR][I.INTERIOR]=t._matrix[I.EXTERIOR][I.INTERIOR],this._matrix[I.EXTERIOR][I.BOUNDARY]=t._matrix[I.EXTERIOR][I.BOUNDARY],this._matrix[I.EXTERIOR][I.EXTERIOR]=t._matrix[I.EXTERIOR][I.EXTERIOR]}}}},{key:"matches",value:function(){if(Number.isInteger(arguments[0])&&typeof arguments[1]=="string"){var e=arguments[0],t=arguments[1];return t===V.SYM_DONTCARE||t===V.SYM_TRUE&&(e>=0||e===V.TRUE)||t===V.SYM_FALSE&&e===V.FALSE||t===V.SYM_P&&e===V.P||t===V.SYM_L&&e===V.L||t===V.SYM_A&&e===V.A}if(typeof arguments[0]=="string"&&typeof arguments[1]=="string"){var n=arguments[0],s=arguments[1],c=new o(n);return c.matches(s)}}},{key:"isTrue",value:function(e){return e>=0||e===V.TRUE}}]),o}(),I_=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"size",value:function(){return this._size}},{key:"addAll",value:function(e){return e===null||e.length===0?null:(this.ensureCapacity(this._size+e.length),ot.arraycopy(e,0,this._data,this._size,e.length),void(this._size+=e.length))}},{key:"ensureCapacity",value:function(e){if(e<=this._data.length)return null;var t=Math.max(e,2*this._data.length);this._data=St.copyOf(this._data,t)}},{key:"toArray",value:function(){var e=new Array(this._size).fill(null);return ot.arraycopy(this._data,0,e,0,this._size),e}},{key:"add",value:function(e){this.ensureCapacity(this._size+1),this._data[this._size]=e,++this._size}}],[{key:"constructor_",value:function(){if(this._data=null,this._size=0,arguments.length===0)o.constructor_.call(this,10);else if(arguments.length===1){var e=arguments[0];this._data=new Array(e).fill(null)}}}]),o}(),w_=function(){function o(){i(this,o)}return l(o,[{key:"getChainStartIndices",value:function(e){var t=0,n=new I_(Math.trunc(e.length/2));n.add(t);do{var s=this.findChainEnd(e,t);n.add(s),t=s}while(t<e.length-1);return n.toArray()}},{key:"findChainEnd",value:function(e,t){for(var n=rt.quadrant(e[t],e[t+1]),s=t+1;s<e.length&&rt.quadrant(e[s-1],e[s])===n;)s++;return s-1}},{key:"OLDgetChainStartIndices",value:function(e){var t=0,n=new ne;n.add(t);do{var s=this.findChainEnd(e,t);n.add(s),t=s}while(t<e.length-1);return o.toIntArray(n)}}],[{key:"toIntArray",value:function(e){for(var t=new Array(e.size()).fill(null),n=0;n<t.length;n++)t[n]=e.get(n).intValue();return t}}]),o}(),N_=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"getCoordinates",value:function(){return this.pts}},{key:"getMaxX",value:function(e){var t=this.pts[this.startIndex[e]].x,n=this.pts[this.startIndex[e+1]].x;return t>n?t:n}},{key:"getMinX",value:function(e){var t=this.pts[this.startIndex[e]].x,n=this.pts[this.startIndex[e+1]].x;return t<n?t:n}},{key:"computeIntersectsForChain",value:function(){if(arguments.length===4){var e=arguments[0],t=arguments[1],n=arguments[2],s=arguments[3];this.computeIntersectsForChain(this.startIndex[e],this.startIndex[e+1],t,t.startIndex[n],t.startIndex[n+1],s)}else if(arguments.length===6){var c=arguments[0],h=arguments[1],g=arguments[2],d=arguments[3],E=arguments[4],w=arguments[5];if(h-c==1&&E-d==1)return w.addIntersections(this.e,c,g.e,d),null;if(!this.overlaps(c,h,g,d,E))return null;var N=Math.trunc((c+h)/2),F=Math.trunc((d+E)/2);c<N&&(d<F&&this.computeIntersectsForChain(c,N,g,d,F,w),F<E&&this.computeIntersectsForChain(c,N,g,F,E,w)),N<h&&(d<F&&this.computeIntersectsForChain(N,h,g,d,F,w),F<E&&this.computeIntersectsForChain(N,h,g,F,E,w))}}},{key:"overlaps",value:function(e,t,n,s,c){return Se.intersects(this.pts[e],this.pts[t],n.pts[s],n.pts[c])}},{key:"getStartIndexes",value:function(){return this.startIndex}},{key:"computeIntersects",value:function(e,t){for(var n=0;n<this.startIndex.length-1;n++)for(var s=0;s<e.startIndex.length-1;s++)this.computeIntersectsForChain(n,e,s,t)}}],[{key:"constructor_",value:function(){this.e=null,this.pts=null,this.startIndex=null;var e=arguments[0];this.e=e,this.pts=e.getCoordinates();var t=new w_;this.startIndex=t.getChainStartIndices(this.pts)}}]),o}(),zf=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"getDepth",value:function(e,t){return this._depth[e][t]}},{key:"setDepth",value:function(e,t,n){this._depth[e][t]=n}},{key:"isNull",value:function(){if(arguments.length===0){for(var e=0;e<2;e++)for(var t=0;t<3;t++)if(this._depth[e][t]!==o.NULL_VALUE)return!1;return!0}if(arguments.length===1){var n=arguments[0];return this._depth[n][1]===o.NULL_VALUE}if(arguments.length===2){var s=arguments[0],c=arguments[1];return this._depth[s][c]===o.NULL_VALUE}}},{key:"normalize",value:function(){for(var e=0;e<2;e++)if(!this.isNull(e)){var t=this._depth[e][1];this._depth[e][2]<t&&(t=this._depth[e][2]),t<0&&(t=0);for(var n=1;n<3;n++){var s=0;this._depth[e][n]>t&&(s=1),this._depth[e][n]=s}}}},{key:"getDelta",value:function(e){return this._depth[e][W.RIGHT]-this._depth[e][W.LEFT]}},{key:"getLocation",value:function(e,t){return this._depth[e][t]<=0?I.EXTERIOR:I.INTERIOR}},{key:"toString",value:function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]}},{key:"add",value:function(){if(arguments.length===1)for(var e=arguments[0],t=0;t<2;t++)for(var n=1;n<3;n++){var s=e.getLocation(t,n);s!==I.EXTERIOR&&s!==I.INTERIOR||(this.isNull(t,n)?this._depth[t][n]=o.depthAtLocation(s):this._depth[t][n]+=o.depthAtLocation(s))}else if(arguments.length===3){var c=arguments[0],h=arguments[1],g=arguments[2];g===I.INTERIOR&&this._depth[c][h]++}}}],[{key:"constructor_",value:function(){this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var t=0;t<3;t++)this._depth[e][t]=o.NULL_VALUE}},{key:"depthAtLocation",value:function(e){return e===I.EXTERIOR?0:e===I.INTERIOR?1:o.NULL_VALUE}}]),o}();zf.NULL_VALUE=-1;var Uf=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"getDepth",value:function(){return this._depth}},{key:"getCollapsedEdge",value:function(){var n=new Array(2).fill(null);return n[0]=this.pts[0],n[1]=this.pts[1],new t(n,It.toLineLabel(this._label))}},{key:"isIsolated",value:function(){return this._isIsolated}},{key:"getCoordinates",value:function(){return this.pts}},{key:"setIsolated",value:function(n){this._isIsolated=n}},{key:"setName",value:function(n){this._name=n}},{key:"equals",value:function(n){if(!(n instanceof t))return!1;var s=n;if(this.pts.length!==s.pts.length)return!1;for(var c=!0,h=!0,g=this.pts.length,d=0;d<this.pts.length;d++)if(this.pts[d].equals2D(s.pts[d])||(c=!1),this.pts[d].equals2D(s.pts[--g])||(h=!1),!c&&!h)return!1;return!0}},{key:"getCoordinate",value:function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}}},{key:"print",value:function(n){n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&n.print(","),n.print(this.pts[s].x+" "+this.pts[s].y);n.print(") "+this._label+" "+this._depthDelta)}},{key:"computeIM",value:function(n){t.updateIM(this._label,n)}},{key:"isCollapsed",value:function(){return!!this._label.isArea()&&this.pts.length===3&&!!this.pts[0].equals(this.pts[2])}},{key:"isClosed",value:function(){return this.pts[0].equals(this.pts[this.pts.length-1])}},{key:"getMaximumSegmentIndex",value:function(){return this.pts.length-1}},{key:"getDepthDelta",value:function(){return this._depthDelta}},{key:"getNumPoints",value:function(){return this.pts.length}},{key:"printReverse",value:function(n){n.print("edge "+this._name+": ");for(var s=this.pts.length-1;s>=0;s--)n.print(this.pts[s]+" ");n.println("")}},{key:"getMonotoneChainEdge",value:function(){return this._mce===null&&(this._mce=new N_(this)),this._mce}},{key:"getEnvelope",value:function(){if(this._env===null){this._env=new Se;for(var n=0;n<this.pts.length;n++)this._env.expandToInclude(this.pts[n])}return this._env}},{key:"addIntersection",value:function(n,s,c,h){var g=new C(n.getIntersection(h)),d=s,E=n.getEdgeDistance(c,h),w=d+1;if(w<this.pts.length){var N=this.pts[w];g.equals2D(N)&&(d=w,E=0)}this.eiList.add(g,d,E)}},{key:"toString",value:function(){var n=new rs;n.append("edge "+this._name+": "),n.append("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&n.append(","),n.append(this.pts[s].x+" "+this.pts[s].y);return n.append(") "+this._label+" "+this._depthDelta),n.toString()}},{key:"isPointwiseEqual",value:function(n){if(this.pts.length!==n.pts.length)return!1;for(var s=0;s<this.pts.length;s++)if(!this.pts[s].equals2D(n.pts[s]))return!1;return!0}},{key:"setDepthDelta",value:function(n){this._depthDelta=n}},{key:"getEdgeIntersectionList",value:function(){return this.eiList}},{key:"addIntersections",value:function(n,s,c){for(var h=0;h<n.getIntersectionNum();h++)this.addIntersection(n,s,c,h)}}],[{key:"constructor_",value:function(){if(this.pts=null,this._env=null,this.eiList=new S_(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new zf,this._depthDelta=0,arguments.length===1){var n=arguments[0];t.constructor_.call(this,n,null)}else if(arguments.length===2){var s=arguments[0],c=arguments[1];this.pts=s,this._label=c}}},{key:"updateIM",value:function(){if(!(arguments.length===2&&arguments[1]instanceof b_&&arguments[0]instanceof It))return b(v(t),"updateIM",this).apply(this,arguments);var n=arguments[0],s=arguments[1];s.setAtLeastIfValid(n.getLocation(0,W.ON),n.getLocation(1,W.ON),1),n.isArea()&&(s.setAtLeastIfValid(n.getLocation(0,W.LEFT),n.getLocation(1,W.LEFT),2),s.setAtLeastIfValid(n.getLocation(0,W.RIGHT),n.getLocation(1,W.RIGHT),2))}}]),t}(xf),Yf=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"setWorkingPrecisionModel",value:function(e){this._workingPrecisionModel=e}},{key:"insertUniqueEdge",value:function(e){var t=this._edgeList.findEqualEdge(e);if(t!==null){var n=t.getLabel(),s=e.getLabel();t.isPointwiseEqual(e)||(s=new It(e.getLabel())).flip(),n.merge(s);var c=o.depthDelta(s),h=t.getDepthDelta()+c;t.setDepthDelta(h)}else this._edgeList.add(e),e.setDepthDelta(o.depthDelta(e.getLabel()))}},{key:"buildSubgraphs",value:function(e,t){for(var n=new ne,s=e.iterator();s.hasNext();){var c=s.next(),h=c.getRightmostCoordinate(),g=new Df(n).getDepth(h);c.computeDepth(g),c.findResultEdges(),n.add(c),t.add(c.getDirectedEdges(),c.getNodes())}}},{key:"createSubgraphs",value:function(e){for(var t=new ne,n=e.getNodes().iterator();n.hasNext();){var s=n.next();if(!s.isVisited()){var c=new Ba;c.create(s),t.add(c)}}return dr.sort(t,dr.reverseOrder()),t}},{key:"createEmptyResultGeometry",value:function(){return this._geomFact.createPolygon()}},{key:"getNoder",value:function(e){if(this._workingNoder!==null)return this._workingNoder;var t=new Ja,n=new Gn;return n.setPrecisionModel(e),t.setSegmentIntersector(new k_(n)),t}},{key:"buffer",value:function(e,t){var n=this._workingPrecisionModel;n===null&&(n=e.getPrecisionModel()),this._geomFact=e.getFactory();var s=new f_(n,this._bufParams),c=new g_(e,t,s).getCurves();if(c.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(c,n),this._graph=new Lf(new __),this._graph.addEdges(this._edgeList.getEdges());var h=this.createSubgraphs(this._graph),g=new J0(this._geomFact);this.buildSubgraphs(h,g);var d=g.getPolygons();return d.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(d)}},{key:"computeNodedEdges",value:function(e,t){var n=this.getNoder(t);n.computeNodes(e);for(var s=n.getNodedSubstrings().iterator();s.hasNext();){var c=s.next(),h=c.getCoordinates();if(h.length!==2||!h[0].equals2D(h[1])){var g=c.getData(),d=new Uf(c.getCoordinates(),new It(g));this.insertUniqueEdge(d)}}}},{key:"setNoder",value:function(e){this._workingNoder=e}}],[{key:"constructor_",value:function(){this._bufParams=null,this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new E_;var e=arguments[0];this._bufParams=e}},{key:"depthDelta",value:function(e){var t=e.getLocation(0,W.LEFT),n=e.getLocation(0,W.RIGHT);return t===I.INTERIOR&&n===I.EXTERIOR?1:t===I.EXTERIOR&&n===I.INTERIOR?-1:0}},{key:"convertSegStrings",value:function(e){for(var t=new yr,n=new ne;e.hasNext();){var s=e.next(),c=t.createLineString(s.getCoordinates());n.add(c)}return t.buildGeometry(n)}}]),o}(),L_=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"rescale",value:function(){if(le(arguments[0],ce))for(var e=arguments[0],t=e.iterator();t.hasNext();){var n=t.next();this.rescale(n.getCoordinates())}else if(arguments[0]instanceof Array){for(var s=arguments[0],c=0;c<s.length;c++)s[c].x=s[c].x/this._scaleFactor+this._offsetX,s[c].y=s[c].y/this._scaleFactor+this._offsetY;s.length===2&&s[0].equals2D(s[1])&&ot.out.println(s)}}},{key:"scale",value:function(){if(le(arguments[0],ce)){for(var e=arguments[0],t=new ne(e.size()),n=e.iterator();n.hasNext();){var s=n.next();t.add(new Bn(this.scale(s.getCoordinates()),s.getData()))}return t}if(arguments[0]instanceof Array){for(var c=arguments[0],h=new Array(c.length).fill(null),g=0;g<c.length;g++)h[g]=new C(Math.round((c[g].x-this._offsetX)*this._scaleFactor),Math.round((c[g].y-this._offsetY)*this._scaleFactor),c[g].getZ());var d=Ye.removeRepeatedPoints(h);return d}}},{key:"isIntegerPrecision",value:function(){return this._scaleFactor===1}},{key:"getNodedSubstrings",value:function(){var e=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(e),e}},{key:"computeNodes",value:function(e){var t=e;this._isScaled&&(t=this.scale(e)),this._noder.computeNodes(t)}},{key:"interfaces_",get:function(){return[Ka]}}],[{key:"constructor_",value:function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var e=arguments[0],t=arguments[1];o.constructor_.call(this,e,t,0,0)}else if(arguments.length===4){var n=arguments[0],s=arguments[1];this._noder=n,this._scaleFactor=s,this._isScaled=!this.isIntegerPrecision()}}}]),o}(),Wf=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"checkEndPtVertexIntersections",value:function(){if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var t=e.next(),n=t.getCoordinates();this.checkEndPtVertexIntersections(n[0],this._segStrings),this.checkEndPtVertexIntersections(n[n.length-1],this._segStrings)}else if(arguments.length===2){for(var s=arguments[0],c=arguments[1],h=c.iterator();h.hasNext();)for(var g=h.next(),d=g.getCoordinates(),E=1;E<d.length-1;E++)if(d[E].equals(s))throw new Le("found endpt/interior pt intersection at index "+E+" :pt "+s)}}},{key:"checkInteriorIntersections",value:function(){if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var t=e.next(),n=this._segStrings.iterator();n.hasNext();){var s=n.next();this.checkInteriorIntersections(t,s)}else if(arguments.length===2)for(var c=arguments[0],h=arguments[1],g=c.getCoordinates(),d=h.getCoordinates(),E=0;E<g.length-1;E++)for(var w=0;w<d.length-1;w++)this.checkInteriorIntersections(c,E,h,w);else if(arguments.length===4){var N=arguments[0],F=arguments[1],j=arguments[2],X=arguments[3];if(N===j&&F===X)return null;var $=N.getCoordinates()[F],re=N.getCoordinates()[F+1],fe=j.getCoordinates()[X],ke=j.getCoordinates()[X+1];if(this._li.computeIntersection($,re,fe,ke),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,$,re)||this.hasInteriorIntersection(this._li,fe,ke)))throw new Le("found non-noded intersection at "+$+"-"+re+" and "+fe+"-"+ke)}}},{key:"checkValid",value:function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()}},{key:"checkCollapses",value:function(){if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var t=e.next();this.checkCollapses(t)}else if(arguments.length===1)for(var n=arguments[0],s=n.getCoordinates(),c=0;c<s.length-2;c++)this.checkCollapse(s[c],s[c+1],s[c+2])}},{key:"hasInteriorIntersection",value:function(e,t,n){for(var s=0;s<e.getIntersectionNum();s++){var c=e.getIntersection(s);if(!c.equals(t)&&!c.equals(n))return!0}return!1}},{key:"checkCollapse",value:function(e,t,n){if(e.equals(n))throw new Le("found non-noded collapse at "+o.fact.createLineString([e,t,n]))}}],[{key:"constructor_",value:function(){this._li=new Gn,this._segStrings=null;var e=arguments[0];this._segStrings=e}}]),o}();Wf.fact=new yr;var eo=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"intersectsScaled",value:function(e,t){var n=Math.min(e.x,t.x),s=Math.max(e.x,t.x),c=Math.min(e.y,t.y),h=Math.max(e.y,t.y),g=this._maxx<n||this._minx>s||this._maxy<c||this._miny>h;if(g)return!1;var d=this.intersectsToleranceSquare(e,t);return he.isTrue(!(g&&d),"Found bad envelope test"),d}},{key:"initCorners",value:function(e){var t=.5;this._minx=e.x-t,this._maxx=e.x+t,this._miny=e.y-t,this._maxy=e.y+t,this._corner[0]=new C(this._maxx,this._maxy),this._corner[1]=new C(this._minx,this._maxy),this._corner[2]=new C(this._minx,this._miny),this._corner[3]=new C(this._maxx,this._miny)}},{key:"intersects",value:function(e,t){return this._scaleFactor===1?this.intersectsScaled(e,t):(this.copyScaled(e,this._p0Scaled),this.copyScaled(t,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))}},{key:"scale",value:function(e){return Math.round(e*this._scaleFactor)}},{key:"getCoordinate",value:function(){return this._originalPt}},{key:"copyScaled",value:function(e,t){t.x=this.scale(e.x),t.y=this.scale(e.y)}},{key:"getSafeEnvelope",value:function(){if(this._safeEnv===null){var e=o.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Se(this._originalPt.x-e,this._originalPt.x+e,this._originalPt.y-e,this._originalPt.y+e)}return this._safeEnv}},{key:"intersectsPixelClosure",value:function(e,t){return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))}},{key:"intersectsToleranceSquare",value:function(e,t){var n=!1,s=!1;return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(s=!0),this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!n||!s)||!!e.equals(this._pt)||!!t.equals(this._pt))))}},{key:"addSnappedNode",value:function(e,t){var n=e.getCoordinate(t),s=e.getCoordinate(t+1);return!!this.intersects(n,s)&&(e.addIntersection(this.getCoordinate(),t),!0)}}],[{key:"constructor_",value:function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var e=arguments[0],t=arguments[1],n=arguments[2];if(this._originalPt=e,this._pt=e,this._scaleFactor=t,this._li=n,t<=0)throw new M("Scale factor must be non-zero");t!==1&&(this._pt=new C(this.scale(e.x),this.scale(e.y)),this._p0Scaled=new C,this._p1Scaled=new C),this.initCorners(this._pt)}}]),o}();eo.SAFE_ENV_EXPANSION_FACTOR=.75;var T_=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"select",value:function(){if(arguments.length!==1){if(arguments.length===2){var e=arguments[0],t=arguments[1];e.getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}}}}],[{key:"constructor_",value:function(){this.selectedSegment=new ht}}]),o}(),Xf=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"snap",value:function(){if(arguments.length===1){var e=arguments[0];return this.snap(e,null,-1)}if(arguments.length===3){var t=arguments[0],n=arguments[1],s=arguments[2],c=t.getSafeEnvelope(),h=new jf(t,n,s);return this._index.query(c,new(function(){function g(){i(this,g)}return l(g,[{key:"interfaces_",get:function(){return[Cf]}},{key:"visitItem",value:function(d){d.select(c,h)}}]),g}())),h.isNodeAdded()}}}],[{key:"constructor_",value:function(){this._index=null;var e=arguments[0];this._index=e}}]),o}(),jf=function(o){f(t,o);var e=S(t);function t(){var n;return i(this,t),n=e.call(this),t.constructor_.apply(p(n),arguments),n}return l(t,[{key:"isNodeAdded",value:function(){return this._isNodeAdded}},{key:"select",value:function(){if(!(arguments.length===2&&Number.isInteger(arguments[1])&&arguments[0]instanceof Rf))return b(v(t.prototype),"select",this).apply(this,arguments);var n=arguments[0],s=arguments[1],c=n.getContext();if(this._parentEdge===c&&(s===this._hotPixelVertexIndex||s+1===this._hotPixelVertexIndex))return null;this._isNodeAdded|=this._hotPixel.addSnappedNode(c,s)}}],[{key:"constructor_",value:function(){this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var n=arguments[0],s=arguments[1],c=arguments[2];this._hotPixel=n,this._parentEdge=s,this._hotPixelVertexIndex=c}}]),t}(T_);Xf.HotPixelSnapAction=jf;var C_=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"processIntersections",value:function(e,t,n,s){if(e===n&&t===s)return null;var c=e.getCoordinates()[t],h=e.getCoordinates()[t+1],g=n.getCoordinates()[s],d=n.getCoordinates()[s+1];if(this._li.computeIntersection(c,h,g,d),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var E=0;E<this._li.getIntersectionNum();E++)this._interiorIntersections.add(this._li.getIntersection(E));e.addIntersections(this._li,t,0),n.addIntersections(this._li,s,1)}}},{key:"isDone",value:function(){return!1}},{key:"getInteriorIntersections",value:function(){return this._interiorIntersections}},{key:"interfaces_",get:function(){return[qf]}}],[{key:"constructor_",value:function(){this._li=null,this._interiorIntersections=null;var e=arguments[0];this._li=e,this._interiorIntersections=new ne}}]),o}(),O_=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"checkCorrectness",value:function(e){var t=Bn.getNodedSubstrings(e),n=new Wf(t);try{n.checkValid()}catch(s){if(!(s instanceof G))throw s;s.printStackTrace()}}},{key:"getNodedSubstrings",value:function(){return Bn.getNodedSubstrings(this._nodedSegStrings)}},{key:"snapRound",value:function(e,t){var n=this.findInteriorIntersections(e,t);this.computeIntersectionSnaps(n),this.computeVertexSnaps(e)}},{key:"findInteriorIntersections",value:function(e,t){var n=new C_(t);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(e),n.getInteriorIntersections()}},{key:"computeVertexSnaps",value:function(){if(le(arguments[0],ce))for(var e=arguments[0],t=e.iterator();t.hasNext();){var n=t.next();this.computeVertexSnaps(n)}else if(arguments[0]instanceof Bn)for(var s=arguments[0],c=s.getCoordinates(),h=0;h<c.length;h++){var g=new eo(c[h],this._scaleFactor,this._li),d=this._pointSnapper.snap(g,s,h);d&&s.addIntersection(c[h],h)}}},{key:"computeNodes",value:function(e){this._nodedSegStrings=e,this._noder=new Ja,this._pointSnapper=new Xf(this._noder.getIndex()),this.snapRound(e,this._li)}},{key:"computeIntersectionSnaps",value:function(e){for(var t=e.iterator();t.hasNext();){var n=t.next(),s=new eo(n,this._scaleFactor,this._li);this._pointSnapper.snap(s)}}},{key:"interfaces_",get:function(){return[Ka]}}],[{key:"constructor_",value:function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var e=arguments[0];this._pm=e,this._li=new Gn,this._li.setPrecisionModel(e),this._scaleFactor=e.getScale()}}]),o}(),_r=function(){function o(){i(this,o),o.constructor_.apply(this,arguments)}return l(o,[{key:"bufferFixedPrecision",value:function(e){var t=new L_(new O_(new Mt(1)),e.getScale()),n=new Yf(this._bufParams);n.setWorkingPrecisionModel(e),n.setNoder(t),this._resultGeometry=n.buffer(this._argGeom,this._distance)}},{key:"bufferReducedPrecision",value:function(){if(arguments.length===0){for(var e=o.MAX_PRECISION_DIGITS;e>=0;e--){try{this.bufferReducedPrecision(e)}catch(c){if(!(c instanceof ct))throw c;this._saveException=c}if(this._resultGeometry!==null)return null}throw this._saveException}if(arguments.length===1){var t=arguments[0],n=o.precisionScaleFactor(this._argGeom,this._distance,t),s=new Mt(n);this.bufferFixedPrecision(s)}}},{key:"computeGeometry",value:function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var e=this._argGeom.getFactory().getPrecisionModel();e.getType()===Mt.FIXED?this.bufferFixedPrecision(e):this.bufferReducedPrecision()}},{key:"setQuadrantSegments",value:function(e){this._bufParams.setQuadrantSegments(e)}},{key:"bufferOriginalPrecision",value:function(){try{var e=new Yf(this._bufParams);this._resultGeometry=e.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof Le))throw t;this._saveException=t}}},{key:"getResultGeometry",value:function(e){return this._distance=e,this.computeGeometry(),this._resultGeometry}},{key:"setEndCapStyle",value:function(e){this._bufParams.setEndCapStyle(e)}}],[{key:"constructor_",value:function(){if(this._argGeom=null,this._distance=null,this._bufParams=new R,this._resultGeometry=null,this._saveException=null,arguments.length===1){var e=arguments[0];this._argGeom=e}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this._argGeom=t,this._bufParams=n}}},{key:"bufferOp",value:function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=new o(e),s=n.getResultGeometry(t);return s}if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof J&&typeof arguments[1]=="number"){var c=arguments[0],h=arguments[1],g=arguments[2],d=new o(c);d.setQuadrantSegments(g);var E=d.getResultGeometry(h);return E}if(arguments[2]instanceof R&&arguments[0]instanceof J&&typeof arguments[1]=="number"){var w=arguments[0],N=arguments[1],F=arguments[2],j=new o(w,F),X=j.getResultGeometry(N);return X}}else if(arguments.length===4){var $=arguments[0],re=arguments[1],fe=arguments[2],ke=arguments[3],Be=new o($);Be.setQuadrantSegments(fe),Be.setEndCapStyle(ke);var Je=Be.getResultGeometry(re);return Je}}},{key:"precisionScaleFactor",value:function(e,t,n){var s=e.getEnvelopeInternal(),c=An.max(Math.abs(s.getMaxX()),Math.abs(s.getMaxY()),Math.abs(s.getMinX()),Math.abs(s.getMinY()))+2*(t>0?t:0),h=n-Math.trunc(Math.log(c)/Math.log(10)+1);return Math.pow(10,h)}}]),o}();_r.CAP_ROUND=R.CAP_ROUND,_r.CAP_BUTT=R.CAP_FLAT,_r.CAP_FLAT=R.CAP_FLAT,_r.CAP_SQUARE=R.CAP_SQUARE,_r.MAX_PRECISION_DIGITS=12;var R_=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],Vf=function(){function o(e){i(this,o),this.geometryFactory=e||new yr}return l(o,[{key:"read",value:function(e){var t,n=(t=typeof e=="string"?JSON.parse(e):e).type;if(!Nt[n])throw new Error("Unknown GeoJSON type: "+t.type);return R_.indexOf(n)!==-1?Nt[n].call(this,t.coordinates):n==="GeometryCollection"?Nt[n].call(this,t.geometries):Nt[n].call(this,t)}},{key:"write",value:function(e){var t=e.getGeometryType();if(!jt[t])throw new Error("Geometry is not supported");return jt[t].call(this,e)}}]),o}(),Nt={Feature:function(o){var e={};for(var t in o)e[t]=o[t];if(o.geometry){var n=o.geometry.type;if(!Nt[n])throw new Error("Unknown GeoJSON type: "+o.type);e.geometry=this.read(o.geometry)}return o.bbox&&(e.bbox=Nt.bbox.call(this,o.bbox)),e},FeatureCollection:function(o){var e={};if(o.features){e.features=[];for(var t=0;t<o.features.length;++t)e.features.push(this.read(o.features[t]))}return o.bbox&&(e.bbox=this.parse.bbox.call(this,o.bbox)),e},coordinates:function(o){for(var e=[],t=0;t<o.length;++t){var n=o[t];e.push(_(C,L(n)))}return e},bbox:function(o){return this.geometryFactory.createLinearRing([new C(o[0],o[1]),new C(o[2],o[1]),new C(o[2],o[3]),new C(o[0],o[3]),new C(o[0],o[1])])},Point:function(o){var e=_(C,L(o));return this.geometryFactory.createPoint(e)},MultiPoint:function(o){for(var e=[],t=0;t<o.length;++t)e.push(Nt.Point.call(this,o[t]));return this.geometryFactory.createMultiPoint(e)},LineString:function(o){var e=Nt.coordinates.call(this,o);return this.geometryFactory.createLineString(e)},MultiLineString:function(o){for(var e=[],t=0;t<o.length;++t)e.push(Nt.LineString.call(this,o[t]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(o){for(var e=Nt.coordinates.call(this,o[0]),t=this.geometryFactory.createLinearRing(e),n=[],s=1;s<o.length;++s){var c=o[s],h=Nt.coordinates.call(this,c),g=this.geometryFactory.createLinearRing(h);n.push(g)}return this.geometryFactory.createPolygon(t,n)},MultiPolygon:function(o){for(var e=[],t=0;t<o.length;++t){var n=o[t];e.push(Nt.Polygon.call(this,n))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(o){for(var e=[],t=0;t<o.length;++t){var n=o[t];e.push(this.read(n))}return this.geometryFactory.createGeometryCollection(e)}},jt={coordinate:function(o){var e=[o.x,o.y];return o.z&&e.push(o.z),o.m&&e.push(o.m),e},Point:function(o){return{type:"Point",coordinates:jt.coordinate.call(this,o.getCoordinate())}},MultiPoint:function(o){for(var e=[],t=0;t<o._geometries.length;++t){var n=o._geometries[t],s=jt.Point.call(this,n);e.push(s.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(o){for(var e=[],t=o.getCoordinates(),n=0;n<t.length;++n){var s=t[n];e.push(jt.coordinate.call(this,s))}return{type:"LineString",coordinates:e}},MultiLineString:function(o){for(var e=[],t=0;t<o._geometries.length;++t){var n=o._geometries[t],s=jt.LineString.call(this,n);e.push(s.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(o){var e=[],t=jt.LineString.call(this,o._shell);e.push(t.coordinates);for(var n=0;n<o._holes.length;++n){var s=o._holes[n],c=jt.LineString.call(this,s);e.push(c.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(o){for(var e=[],t=0;t<o._geometries.length;++t){var n=o._geometries[t],s=jt.Polygon.call(this,n);e.push(s.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(o){for(var e=[],t=0;t<o._geometries.length;++t){var n=o._geometries[t],s=n.getGeometryType();e.push(jt[s].call(this,n))}return{type:"GeometryCollection",geometries:e}}};return{BufferOp:_r,GeoJSONReader:function(){function o(e){i(this,o),this.parser=new Vf(e||new yr)}return l(o,[{key:"read",value:function(e){return this.parser.read(e)}}]),o}(),GeoJSONWriter:function(){function o(){i(this,o),this.parser=new Vf(this.geometryFactory)}return l(o,[{key:"write",value:function(e){return this.parser.write(e)}}]),o}()}})})(lc);var Np=lc.exports;const Lp=Mo(Np);function yn(){return new Gi}function Gi(){this.reset()}Gi.prototype={constructor:Gi,reset:function(){this.s=this.t=0},add:function(a){cc(Bi,a,this.t),cc(this,Bi.s,this.s),this.s?this.t+=Bi.t:this.s=Bi.t},valueOf:function(){return this.s}};var Bi=new Gi;function cc(a,r,i){var u=a.s=r+i,l=u-r,f=u-l;a.t=r-f+(i-l)}var Ie=1e-6,pe=Math.PI,zt=pe/2,fc=pe/4,Ut=pe*2,vn=180/pe,pt=pe/180,je=Math.abs,Tp=Math.atan,nr=Math.atan2,De=Math.cos,Fe=Math.sin,rr=Math.sqrt;function hc(a){return a>1?0:a<-1?pe:Math.acos(a)}function Cn(a){return a>1?zt:a<-1?-zt:Math.asin(a)}function Fr(){}function qi(a,r){a&&yc.hasOwnProperty(a.type)&&yc[a.type](a,r)}var gc={Feature:function(a,r){qi(a.geometry,r)},FeatureCollection:function(a,r){for(var i=a.features,u=-1,l=i.length;++u<l;)qi(i[u].geometry,r)}},yc={Sphere:function(a,r){r.sphere()},Point:function(a,r){a=a.coordinates,r.point(a[0],a[1],a[2])},MultiPoint:function(a,r){for(var i=a.coordinates,u=-1,l=i.length;++u<l;)a=i[u],r.point(a[0],a[1],a[2])},LineString:function(a,r){_a(a.coordinates,r,0)},MultiLineString:function(a,r){for(var i=a.coordinates,u=-1,l=i.length;++u<l;)_a(i[u],r,0)},Polygon:function(a,r){vc(a.coordinates,r)},MultiPolygon:function(a,r){for(var i=a.coordinates,u=-1,l=i.length;++u<l;)vc(i[u],r)},GeometryCollection:function(a,r){for(var i=a.geometries,u=-1,l=i.length;++u<l;)qi(i[u],r)}};function _a(a,r,i){var u=-1,l=a.length-i,f;for(r.lineStart();++u<l;)f=a[u],r.point(f[0],f[1],f[2]);r.lineEnd()}function vc(a,r){var i=-1,u=a.length;for(r.polygonStart();++i<u;)_a(a[i],r,1);r.polygonEnd()}function Cp(a,r){a&&gc.hasOwnProperty(a.type)?gc[a.type](a,r):qi(a,r)}yn(),yn();function Ea(a){return[nr(a[1],a[0]),Cn(a[2])]}function ir(a){var r=a[0],i=a[1],u=De(i);return[u*De(r),u*Fe(r),Fe(i)]}function zi(a,r){return a[0]*r[0]+a[1]*r[1]+a[2]*r[2]}function Ui(a,r){return[a[1]*r[2]-a[2]*r[1],a[2]*r[0]-a[0]*r[2],a[0]*r[1]-a[1]*r[0]]}function ka(a,r){a[0]+=r[0],a[1]+=r[1],a[2]+=r[2]}function Yi(a,r){return[a[0]*r,a[1]*r,a[2]*r]}function xa(a){var r=rr(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);a[0]/=r,a[1]/=r,a[2]/=r}yn();function dc(a,r){function i(u,l){return u=a(u,l),r(u[0],u[1])}return a.invert&&r.invert&&(i.invert=function(u,l){return u=r.invert(u,l),u&&a.invert(u[0],u[1])}),i}function Sa(a,r){return[a>pe?a-Ut:a<-pe?a+Ut:a,r]}Sa.invert=Sa;function Op(a,r,i){return(a%=Ut)?r||i?dc(pc(a),_c(r,i)):pc(a):r||i?_c(r,i):Sa}function mc(a){return function(r,i){return r+=a,[r>pe?r-Ut:r<-pe?r+Ut:r,i]}}function pc(a){var r=mc(a);return r.invert=mc(-a),r}function _c(a,r){var i=De(a),u=Fe(a),l=De(r),f=Fe(r);function v(y,m){var _=De(m),k=De(y)*_,p=Fe(y)*_,x=Fe(m),S=x*i+k*u;return[nr(p*l-S*f,k*i-x*u),Cn(S*l+p*f)]}return v.invert=function(y,m){var _=De(m),k=De(y)*_,p=Fe(y)*_,x=Fe(m),S=x*l-p*f;return[nr(p*l+x*f,k*i+S*u),Cn(S*i-k*u)]},v}function Rp(a,r,i,u,l,f){if(i){var v=De(r),y=Fe(r),m=u*i;l==null?(l=r+u*Ut,f=r-m/2):(l=Ec(v,l),f=Ec(v,f),(u>0?l<f:l>f)&&(l+=u*Ut));for(var _,k=l;u>0?k>f:k<f;k-=m)_=Ea([v,-y*De(k),-y*Fe(k)]),a.point(_[0],_[1])}}function Ec(a,r){r=ir(r),r[0]-=a,xa(r);var i=hc(-r[1]);return((-r[2]<0?-i:i)+Ut-Ie)%Ut}function kc(){var a=[],r;return{point:function(i,u){r.push([i,u])},lineStart:function(){a.push(r=[])},lineEnd:Fr,rejoin:function(){a.length>1&&a.push(a.pop().concat(a.shift()))},result:function(){var i=a;return a=[],r=null,i}}}function Mp(a,r,i,u,l,f){var v=a[0],y=a[1],m=r[0],_=r[1],k=0,p=1,x=m-v,S=_-y,b;if(b=i-v,!(!x&&b>0)){if(b/=x,x<0){if(b<k)return;b<p&&(p=b)}else if(x>0){if(b>p)return;b>k&&(k=b)}if(b=l-v,!(!x&&b<0)){if(b/=x,x<0){if(b>p)return;b>k&&(k=b)}else if(x>0){if(b<k)return;b<p&&(p=b)}if(b=u-y,!(!S&&b>0)){if(b/=S,S<0){if(b<k)return;b<p&&(p=b)}else if(S>0){if(b>p)return;b>k&&(k=b)}if(b=f-y,!(!S&&b<0)){if(b/=S,S<0){if(b>p)return;b>k&&(k=b)}else if(S>0){if(b<k)return;b<p&&(p=b)}return k>0&&(a[0]=v+k*x,a[1]=y+k*S),p<1&&(r[0]=v+p*x,r[1]=y+p*S),!0}}}}}function Wi(a,r){return je(a[0]-r[0])<Ie&&je(a[1]-r[1])<Ie}function Xi(a,r,i,u){this.x=a,this.z=r,this.o=i,this.e=u,this.v=!1,this.n=this.p=null}function xc(a,r,i,u,l){var f=[],v=[],y,m;if(a.forEach(function(b){if(!((L=b.length-1)<=0)){var L,T=b[0],O=b[L],P;if(Wi(T,O)){for(l.lineStart(),y=0;y<L;++y)l.point((T=b[y])[0],T[1]);l.lineEnd();return}f.push(P=new Xi(T,b,null,!0)),v.push(P.o=new Xi(T,null,P,!1)),f.push(P=new Xi(O,b,null,!1)),v.push(P.o=new Xi(O,null,P,!0))}}),!!f.length){for(v.sort(r),Sc(f),Sc(v),y=0,m=v.length;y<m;++y)v[y].e=i=!i;for(var _=f[0],k,p;;){for(var x=_,S=!0;x.v;)if((x=x.n)===_)return;k=x.z,l.lineStart();do{if(x.v=x.o.v=!0,x.e){if(S)for(y=0,m=k.length;y<m;++y)l.point((p=k[y])[0],p[1]);else u(x.x,x.n.x,1,l);x=x.n}else{if(S)for(k=x.p.z,y=k.length-1;y>=0;--y)l.point((p=k[y])[0],p[1]);else u(x.x,x.p.x,-1,l);x=x.p}x=x.o,k=x.z,S=!S}while(!x.v);l.lineEnd()}}}function Sc(a){if(r=a.length){for(var r,i=0,u=a[0],l;++i<r;)u.n=l=a[i],l.p=u,u=l;u.n=l=a[0],l.p=u}}function bc(a,r){return a<r?-1:a>r?1:a>=r?0:NaN}function Pp(a){return a.length===1&&(a=Ap(a)),{left:function(r,i,u,l){for(u==null&&(u=0),l==null&&(l=r.length);u<l;){var f=u+l>>>1;a(r[f],i)<0?u=f+1:l=f}return u},right:function(r,i,u,l){for(u==null&&(u=0),l==null&&(l=r.length);u<l;){var f=u+l>>>1;a(r[f],i)>0?l=f:u=f+1}return u}}}function Ap(a){return function(r,i){return bc(a(r),i)}}Pp(bc);function Ic(a){for(var r=a.length,i,u=-1,l=0,f,v;++u<r;)l+=a[u].length;for(f=new Array(l);--r>=0;)for(v=a[r],i=v.length;--i>=0;)f[--l]=v[i];return f}var Gr=1e9,ji=-Gr;function Dp(a,r,i,u){function l(_,k){return a<=_&&_<=i&&r<=k&&k<=u}function f(_,k,p,x){var S=0,b=0;if(_==null||(S=v(_,p))!==(b=v(k,p))||m(_,k)<0^p>0)do x.point(S===0||S===3?a:i,S>1?u:r);while((S=(S+p+4)%4)!==b);else x.point(k[0],k[1])}function v(_,k){return je(_[0]-a)<Ie?k>0?0:3:je(_[0]-i)<Ie?k>0?2:1:je(_[1]-r)<Ie?k>0?1:0:k>0?3:2}function y(_,k){return m(_.x,k.x)}function m(_,k){var p=v(_,1),x=v(k,1);return p!==x?p-x:p===0?k[1]-_[1]:p===1?_[0]-k[0]:p===2?_[1]-k[1]:k[0]-_[0]}return function(_){var k=_,p=kc(),x,S,b,L,T,O,P,R,G,M,z,q={point:U,lineStart:Z,lineEnd:oe,polygonStart:H,polygonEnd:ee};function U(Q,ie){l(Q,ie)&&k.point(Q,ie)}function A(){for(var Q=0,ie=0,me=S.length;ie<me;++ie)for(var Ge=S[ie],we=1,K=Ge.length,ze=Ge[0],Le,Ve,he=ze[0],kt=ze[1];we<K;++we)Le=he,Ve=kt,ze=Ge[we],he=ze[0],kt=ze[1],Ve<=u?kt>u&&(he-Le)*(u-Ve)>(kt-Ve)*(a-Le)&&++Q:kt<=u&&(he-Le)*(u-Ve)<(kt-Ve)*(a-Le)&&--Q;return Q}function H(){k=p,x=[],S=[],z=!0}function ee(){var Q=A(),ie=z&&Q,me=(x=Ic(x)).length;(ie||me)&&(_.polygonStart(),ie&&(_.lineStart(),f(null,null,1,_),_.lineEnd()),me&&xc(x,y,Q,f,_),_.polygonEnd()),k=_,x=S=b=null}function Z(){q.point=D,S&&S.push(b=[]),M=!0,G=!1,P=R=NaN}function oe(){x&&(D(L,T),O&&G&&p.rejoin(),x.push(p.result())),q.point=U,G&&k.lineEnd()}function D(Q,ie){var me=l(Q,ie);if(S&&b.push([Q,ie]),M)L=Q,T=ie,O=me,M=!1,me&&(k.lineStart(),k.point(Q,ie));else if(me&&G)k.point(Q,ie);else{var Ge=[P=Math.max(ji,Math.min(Gr,P)),R=Math.max(ji,Math.min(Gr,R))],we=[Q=Math.max(ji,Math.min(Gr,Q)),ie=Math.max(ji,Math.min(Gr,ie))];Mp(Ge,we,a,r,i,u)?(G||(k.lineStart(),k.point(Ge[0],Ge[1])),k.point(we[0],we[1]),me||k.lineEnd(),z=!1):me&&(k.lineStart(),k.point(Q,ie),z=!1)}P=Q,R=ie,G=me}return q}}var ba=yn();function Fp(a,r){var i=r[0],u=r[1],l=[Fe(i),-De(i),0],f=0,v=0;ba.reset();for(var y=0,m=a.length;y<m;++y)if(k=(_=a[y]).length)for(var _,k,p=_[k-1],x=p[0],S=p[1]/2+fc,b=Fe(S),L=De(S),T=0;T<k;++T,x=P,b=G,L=M,p=O){var O=_[T],P=O[0],R=O[1]/2+fc,G=Fe(R),M=De(R),z=P-x,q=z>=0?1:-1,U=q*z,A=U>pe,H=b*G;if(ba.add(nr(H*q*Fe(U),L*M+H*De(U))),f+=A?z+q*Ut:z,A^x>=i^P>=i){var ee=Ui(ir(p),ir(O));xa(ee);var Z=Ui(l,ee);xa(Z);var oe=(A^z>=0?-1:1)*Cn(Z[2]);(u>oe||u===oe&&(ee[0]||ee[1]))&&(v+=A^z>=0?1:-1)}}return(f<-Ie||f<Ie&&ba<-Ie)^v&1}yn();function wc(a){return a}yn(),yn();var sr=1/0,Vi=sr,Br=-sr,Hi=Br,Nc={point:Gp,lineStart:Fr,lineEnd:Fr,polygonStart:Fr,polygonEnd:Fr,result:function(){var a=[[sr,Vi],[Br,Hi]];return Br=Hi=-(Vi=sr=1/0),a}};function Gp(a,r){a<sr&&(sr=a),a>Br&&(Br=a),r<Vi&&(Vi=r),r>Hi&&(Hi=r)}yn();function Lc(a,r,i,u){return function(l,f){var v=r(f),y=l.invert(u[0],u[1]),m=kc(),_=r(m),k=!1,p,x,S,b={point:L,lineStart:O,lineEnd:P,polygonStart:function(){b.point=R,b.lineStart=G,b.lineEnd=M,x=[],p=[]},polygonEnd:function(){b.point=L,b.lineStart=O,b.lineEnd=P,x=Ic(x);var z=Fp(p,y);x.length?(k||(f.polygonStart(),k=!0),xc(x,qp,z,i,f)):z&&(k||(f.polygonStart(),k=!0),f.lineStart(),i(null,null,1,f),f.lineEnd()),k&&(f.polygonEnd(),k=!1),x=p=null},sphere:function(){f.polygonStart(),f.lineStart(),i(null,null,1,f),f.lineEnd(),f.polygonEnd()}};function L(z,q){var U=l(z,q);a(z=U[0],q=U[1])&&f.point(z,q)}function T(z,q){var U=l(z,q);v.point(U[0],U[1])}function O(){b.point=T,v.lineStart()}function P(){b.point=L,v.lineEnd()}function R(z,q){S.push([z,q]);var U=l(z,q);_.point(U[0],U[1])}function G(){_.lineStart(),S=[]}function M(){R(S[0][0],S[0][1]),_.lineEnd();var z=_.clean(),q=m.result(),U,A=q.length,H,ee,Z;if(S.pop(),p.push(S),S=null,!!A){if(z&1){if(ee=q[0],(H=ee.length-1)>0){for(k||(f.polygonStart(),k=!0),f.lineStart(),U=0;U<H;++U)f.point((Z=ee[U])[0],Z[1]);f.lineEnd()}return}A>1&&z&2&&q.push(q.pop().concat(q.shift())),x.push(q.filter(Bp))}}return b}}function Bp(a){return a.length>1}function qp(a,r){return((a=a.x)[0]<0?a[1]-zt-Ie:zt-a[1])-((r=r.x)[0]<0?r[1]-zt-Ie:zt-r[1])}const Tc=Lc(function(){return!0},zp,Yp,[-pe,-zt]);function zp(a){var r=NaN,i=NaN,u=NaN,l;return{lineStart:function(){a.lineStart(),l=1},point:function(f,v){var y=f>0?pe:-pe,m=je(f-r);je(m-pe)<Ie?(a.point(r,i=(i+v)/2>0?zt:-zt),a.point(u,i),a.lineEnd(),a.lineStart(),a.point(y,i),a.point(f,i),l=0):u!==y&&m>=pe&&(je(r-u)<Ie&&(r-=u*Ie),je(f-y)<Ie&&(f-=y*Ie),i=Up(r,i,f,v),a.point(u,i),a.lineEnd(),a.lineStart(),a.point(y,i),l=0),a.point(r=f,i=v),u=y},lineEnd:function(){a.lineEnd(),r=i=NaN},clean:function(){return 2-l}}}function Up(a,r,i,u){var l,f,v=Fe(a-i);return je(v)>Ie?Tp((Fe(r)*(f=De(u))*Fe(i)-Fe(u)*(l=De(r))*Fe(a))/(l*f*v)):(r+u)/2}function Yp(a,r,i,u){var l;if(a==null)l=i*zt,u.point(-pe,l),u.point(0,l),u.point(pe,l),u.point(pe,0),u.point(pe,-l),u.point(0,-l),u.point(-pe,-l),u.point(-pe,0),u.point(-pe,l);else if(je(a[0]-r[0])>Ie){var f=a[0]<r[0]?pe:-pe;l=i*f/2,u.point(-f,l),u.point(0,l),u.point(f,l)}else u.point(r[0],r[1])}function Wp(a,r){var i=De(a),u=i>0,l=je(i)>Ie;function f(k,p,x,S){Rp(S,a,r,x,k,p)}function v(k,p){return De(k)*De(p)>i}function y(k){var p,x,S,b,L;return{lineStart:function(){b=S=!1,L=1},point:function(T,O){var P=[T,O],R,G=v(T,O),M=u?G?0:_(T,O):G?_(T+(T<0?pe:-pe),O):0;if(!p&&(b=S=G)&&k.lineStart(),G!==S&&(R=m(p,P),(!R||Wi(p,R)||Wi(P,R))&&(P[0]+=Ie,P[1]+=Ie,G=v(P[0],P[1]))),G!==S)L=0,G?(k.lineStart(),R=m(P,p),k.point(R[0],R[1])):(R=m(p,P),k.point(R[0],R[1]),k.lineEnd()),p=R;else if(l&&p&&u^G){var z;!(M&x)&&(z=m(P,p,!0))&&(L=0,u?(k.lineStart(),k.point(z[0][0],z[0][1]),k.point(z[1][0],z[1][1]),k.lineEnd()):(k.point(z[1][0],z[1][1]),k.lineEnd(),k.lineStart(),k.point(z[0][0],z[0][1])))}G&&(!p||!Wi(p,P))&&k.point(P[0],P[1]),p=P,S=G,x=M},lineEnd:function(){S&&k.lineEnd(),p=null},clean:function(){return L|(b&&S)<<1}}}function m(k,p,x){var S=ir(k),b=ir(p),L=[1,0,0],T=Ui(S,b),O=zi(T,T),P=T[0],R=O-P*P;if(!R)return!x&&k;var G=i*O/R,M=-i*P/R,z=Ui(L,T),q=Yi(L,G),U=Yi(T,M);ka(q,U);var A=z,H=zi(q,A),ee=zi(A,A),Z=H*H-ee*(zi(q,q)-1);if(!(Z<0)){var oe=rr(Z),D=Yi(A,(-H-oe)/ee);if(ka(D,q),D=Ea(D),!x)return D;var Q=k[0],ie=p[0],me=k[1],Ge=p[1],we;ie<Q&&(we=Q,Q=ie,ie=we);var K=ie-Q,ze=je(K-pe)<Ie,Le=ze||K<Ie;if(!ze&&Ge<me&&(we=me,me=Ge,Ge=we),Le?ze?me+Ge>0^D[1]<(je(D[0]-Q)<Ie?me:Ge):me<=D[1]&&D[1]<=Ge:K>pe^(Q<=D[0]&&D[0]<=ie)){var Ve=Yi(A,(-H+oe)/ee);return ka(Ve,q),[D,Ea(Ve)]}}}function _(k,p){var x=u?a:pe-a,S=0;return k<-x?S|=1:k>x&&(S|=2),p<-x?S|=4:p>x&&(S|=8),S}return Lc(v,y,f,u?[0,-a]:[-pe,a-pe])}function Cc(a){return function(r){var i=new Ia;for(var u in a)i[u]=a[u];return i.stream=r,i}}function Ia(){}Ia.prototype={constructor:Ia,point:function(a,r){this.stream.point(a,r)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Oc(a,r,i){var u=r[1][0]-r[0][0],l=r[1][1]-r[0][1],f=a.clipExtent&&a.clipExtent();a.scale(150).translate([0,0]),f!=null&&a.clipExtent(null),Cp(i,a.stream(Nc));var v=Nc.result(),y=Math.min(u/(v[1][0]-v[0][0]),l/(v[1][1]-v[0][1])),m=+r[0][0]+(u-y*(v[1][0]+v[0][0]))/2,_=+r[0][1]+(l-y*(v[1][1]+v[0][1]))/2;return f!=null&&a.clipExtent(f),a.scale(y*150).translate([m,_])}function Xp(a,r,i){return Oc(a,[[0,0],r],i)}var Rc=16,jp=De(30*pt);function Mc(a,r){return+r?Hp(a,r):Vp(a)}function Vp(a){return Cc({point:function(r,i){r=a(r,i),this.stream.point(r[0],r[1])}})}function Hp(a,r){function i(u,l,f,v,y,m,_,k,p,x,S,b,L,T){var O=_-u,P=k-l,R=O*O+P*P;if(R>4*r&&L--){var G=v+x,M=y+S,z=m+b,q=rr(G*G+M*M+z*z),U=Cn(z/=q),A=je(je(z)-1)<Ie||je(f-p)<Ie?(f+p)/2:nr(M,G),H=a(A,U),ee=H[0],Z=H[1],oe=ee-u,D=Z-l,Q=P*oe-O*D;(Q*Q/R>r||je((O*oe+P*D)/R-.5)>.3||v*x+y*S+m*b<jp)&&(i(u,l,f,v,y,m,ee,Z,A,G/=q,M/=q,z,L,T),T.point(ee,Z),i(ee,Z,A,G,M,z,_,k,p,x,S,b,L,T))}}return function(u){var l,f,v,y,m,_,k,p,x,S,b,L,T={point:O,lineStart:P,lineEnd:G,polygonStart:function(){u.polygonStart(),T.lineStart=M},polygonEnd:function(){u.polygonEnd(),T.lineStart=P}};function O(U,A){U=a(U,A),u.point(U[0],U[1])}function P(){p=NaN,T.point=R,u.lineStart()}function R(U,A){var H=ir([U,A]),ee=a(U,A);i(p,x,k,S,b,L,p=ee[0],x=ee[1],k=U,S=H[0],b=H[1],L=H[2],Rc,u),u.point(p,x)}function G(){T.point=O,u.lineEnd()}function M(){P(),T.point=z,T.lineEnd=q}function z(U,A){R(l=U,A),f=p,v=x,y=S,m=b,_=L,T.point=R}function q(){i(p,x,k,S,b,L,f,v,l,y,m,_,Rc,u),T.lineEnd=G,G()}return T}}var Zp=Cc({point:function(a,r){this.stream.point(a*pt,r*pt)}});function Qp(a){return Kp(function(){return a})()}function Kp(a){var r,i=150,u=480,l=250,f,v,y=0,m=0,_=0,k=0,p=0,x,S,b=null,L=Tc,T=null,O,P,R,G=wc,M=.5,z=Mc(ee,M),q,U;function A(D){return D=S(D[0]*pt,D[1]*pt),[D[0]*i+f,v-D[1]*i]}function H(D){return D=S.invert((D[0]-f)/i,(v-D[1])/i),D&&[D[0]*vn,D[1]*vn]}function ee(D,Q){return D=r(D,Q),[D[0]*i+f,v-D[1]*i]}A.stream=function(D){return q&&U===D?q:q=Zp(L(x,z(G(U=D))))},A.clipAngle=function(D){return arguments.length?(L=+D?Wp(b=D*pt,6*pt):(b=null,Tc),oe()):b*vn},A.clipExtent=function(D){return arguments.length?(G=D==null?(T=O=P=R=null,wc):Dp(T=+D[0][0],O=+D[0][1],P=+D[1][0],R=+D[1][1]),oe()):T==null?null:[[T,O],[P,R]]},A.scale=function(D){return arguments.length?(i=+D,Z()):i},A.translate=function(D){return arguments.length?(u=+D[0],l=+D[1],Z()):[u,l]},A.center=function(D){return arguments.length?(y=D[0]%360*pt,m=D[1]%360*pt,Z()):[y*vn,m*vn]},A.rotate=function(D){return arguments.length?(_=D[0]%360*pt,k=D[1]%360*pt,p=D.length>2?D[2]%360*pt:0,Z()):[_*vn,k*vn,p*vn]},A.precision=function(D){return arguments.length?(z=Mc(ee,M=D*D),oe()):rr(M)},A.fitExtent=function(D,Q){return Oc(A,D,Q)},A.fitSize=function(D,Q){return Xp(A,D,Q)};function Z(){S=dc(x=Op(_,k,p),r);var D=r(y,m);return f=u-D[0]*i,v=l+D[1]*i,oe()}function oe(){return q=U=null,A}return function(){return r=a.apply(this,arguments),A.invert=r.invert&&H,Z()}}function Pc(a){return function(r,i){var u=De(r),l=De(i),f=a(u*l);return[f*l*Fe(r),f*Fe(i)]}}function Ac(a){return function(r,i){var u=rr(r*r+i*i),l=a(u),f=Fe(l),v=De(l);return[nr(r*f,u*v),Cn(u&&i*f/u)]}}var Jp=Pc(function(a){return rr(2/(1+a))});Jp.invert=Ac(function(a){return 2*Cn(a/2)});var Dc=Pc(function(a){return(a=hc(a))&&a/Fe(a)});Dc.invert=Ac(function(a){return a});function $p(){return Qp(Dc).scale(79.4188).clipAngle(180-.001)}function Fc(a,r){return[a,r]}Fc.invert=Fc;var e0=Object.defineProperty,ar=(a,r)=>e0(a,"name",{value:r,configurable:!0}),{BufferOp:t0,GeoJSONReader:n0,GeoJSONWriter:r0}=Lp;function Gc(a,r,i){i=i||{};var u=i.units||"kilometers",l=i.steps||8;if(!a)throw new Error("geojson is required");if(typeof i!="object")throw new Error("options must be an object");if(typeof l!="number")throw new Error("steps must be an number");if(r===void 0)throw new Error("radius is required");if(l<=0)throw new Error("steps must be greater than 0");var f=[];switch(a.type){case"GeometryCollection":return tr(a,function(v){var y=qr(v,r,u,l);y&&f.push(y)}),$t(f);case"FeatureCollection":return Di(a,function(v){var y=qr(v,r,u,l);y&&Di(y,function(m){m&&f.push(m)})}),$t(f)}return qr(a,r,u,l)}ar(Gc,"buffer");function qr(a,r,i,u){var l=a.properties||{},f=a.type==="Feature"?a.geometry:a;if(f.type==="GeometryCollection"){var v=[];return tr(a,function(L){var T=qr(L,r,i,u);T&&v.push(T)}),$t(v)}var y=Bc(f),m={type:f.type,coordinates:Na(f.coordinates,y)},_=new n0,k=_.read(m),p=ma(Pi(r,i),"meters"),x=t0.bufferOp(k,p,u),S=new r0;if(x=S.write(x),!wa(x.coordinates)){var b={type:x.type,coordinates:La(x.coordinates,y)};return Ot(b,l)}}ar(qr,"bufferFeature");function wa(a){return Array.isArray(a[0])?wa(a[0]):isNaN(a[0])}ar(wa,"coordsIsNaN");function Na(a,r){return typeof a[0]!="object"?r(a):a.map(function(i){return Na(i,r)})}ar(Na,"projectCoords");function La(a,r){return typeof a[0]!="object"?r.invert(a):a.map(function(i){return La(i,r)})}ar(La,"unprojectCoords");function Bc(a){var r=uc(a).geometry.coordinates,i=[-r[0],-r[1]];return $p().rotate(i).scale(it)}ar(Bc,"defineProjection");var i0=Gc;/**
1
+ (function(k,F){typeof exports=="object"&&typeof module<"u"?F(exports,require("ol/control"),require("ol/events/Event"),require("ol"),require("ol/geom"),require("ol/layer/Vector"),require("ol/proj"),require("ol/source/Vector"),require("ol/style/Fill"),require("ol/style/Icon"),require("ol/style/Stroke"),require("ol/style/Style"),require("ol/style/Text")):typeof define=="function"&&define.amd?define(["exports","ol/control","ol/events/Event","ol","ol/geom","ol/layer/Vector","ol/proj","ol/source/Vector","ol/style/Fill","ol/style/Icon","ol/style/Stroke","ol/style/Style","ol/style/Text"],F):(k=typeof globalThis<"u"?globalThis:k||self,F(k.openlayersMaptilerGeocoder={},k.ol.control,k.ol.events.Event,k.ol,k.ol.geom,k.ol.layer.Vector,k.ol.proj,k.ol.source.Vector,k.ol.style.Fill,k.ol.style.Icon,k.ol.style.Stroke,k.ol.style.Style,k.ol.style.Text))})(this,function(k,F,D,oe,se,Ki,_e,Ji,zt,$i,jt,en,tn){"use strict";var ao=Object.defineProperty;var Yi=k=>{throw TypeError(k)};var co=(k,F,D)=>F in k?ao(k,F,{enumerable:!0,configurable:!0,writable:!0,value:D}):k[F]=D;var ce=(k,F,D)=>co(k,typeof F!="symbol"?F+"":F,D),Xi=(k,F,D)=>F.has(k)||Yi("Cannot "+D);var de=(k,F,D)=>(Xi(k,F,"read from private field"),D?D.call(k):F.get(k)),Gt=(k,F,D)=>F.has(k)?Yi("Cannot add the same private member more than once"):F instanceof WeakSet?F.add(k):F.set(k,D),gt=(k,F,D,oe)=>(Xi(k,F,"write to private field"),oe?oe.call(k,D):F.set(k,D),D);var ue,Oe;function G(){}function nn(n,e){for(const t in e)n[t]=e[t];return n}function Vt(n){return n()}function Zt(){return Object.create(null)}function ye(n){n.forEach(Vt)}function Qt(n){return typeof n=="function"}function Pe(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let $e;function J(n,e){return n===e?!0:($e||($e=document.createElement("a")),$e.href=e,n===$e.href)}function rn(n){return Object.keys(n).length===0}function on(n,e,t,i){if(n){const r=Ht(n,e,t,i);return n[0](r)}}function Ht(n,e,t,i){return n[1]&&i?nn(t.ctx.slice(),n[1](i(e))):t.ctx}function sn(n,e,t,i){if(n[2]&&i){const r=n[2](i(t));if(e.dirty===void 0)return r;if(typeof r=="object"){const o=[],l=Math.max(e.dirty.length,r.length);for(let s=0;s<l;s+=1)o[s]=e.dirty[s]|r[s];return o}return e.dirty|r}return e.dirty}function ln(n,e,t,i,r,o){if(r){const l=Ht(e,t,i,o);n.p(l,r)}}function un(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function Yt(n){return n??""}function R(n,e){n.appendChild(e)}function z(n,e,t){n.insertBefore(e,t||null)}function B(n){n.parentNode&&n.parentNode.removeChild(n)}function A(n){return document.createElement(n)}function pe(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function Ee(n){return document.createTextNode(n)}function ie(){return Ee(" ")}function an(){return Ee("")}function ee(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function cn(n){return function(e){return e.preventDefault(),n.call(this,e)}}function v(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function fn(n){return Array.from(n.childNodes)}function je(n,e){e=""+e,n.data!==e&&(n.data=e)}function Xt(n,e){n.value=e??""}function Le(n,e,t){n.classList.toggle(e,!!t)}function dn(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}let Ve;function Ze(n){Ve=n}function Kt(){if(!Ve)throw new Error("Function called outside component initialization");return Ve}function hn(n){Kt().$$.on_destroy.push(n)}function gn(){const n=Kt();return(e,t,{cancelable:i=!1}={})=>{const r=n.$$.callbacks[e];if(r){const o=dn(e,t,{cancelable:i});return r.slice().forEach(l=>{l.call(n,o)}),!o.defaultPrevented}return!0}}function Jt(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Fe=[],mt=[];let De=[];const $t=[],mn=Promise.resolve();let yt=!1;function yn(){yt||(yt=!0,mn.then(ei))}function pt(n){De.push(n)}const vt=new Set;let Be=0;function ei(){if(Be!==0)return;const n=Ve;do{try{for(;Be<Fe.length;){const e=Fe[Be];Be++,Ze(e),pn(e.$$)}}catch(e){throw Fe.length=0,Be=0,e}for(Ze(null),Fe.length=0,Be=0;mt.length;)mt.pop()();for(let e=0;e<De.length;e+=1){const t=De[e];vt.has(t)||(vt.add(t),t())}De.length=0}while(Fe.length);for(;$t.length;)$t.pop()();yt=!1,vt.clear(),Ze(n)}function pn(n){if(n.fragment!==null){n.update(),ye(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(pt)}}function vn(n){const e=[],t=[];De.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),De=e}const et=new Set;let Te;function tt(){Te={r:0,c:[],p:Te}}function it(){Te.r||ye(Te.c),Te=Te.p}function Q(n,e){n&&n.i&&(et.delete(n),n.i(e))}function K(n,e,t,i){if(n&&n.o){if(et.has(n))return;et.add(n),Te.c.push(()=>{et.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}function ti(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function bn(n,e){K(n,1,1,()=>{e.delete(n.key)})}function wn(n,e,t,i,r,o,l,s,c,u,d,a){let f=n.length,h=o.length,m=f;const y={};for(;m--;)y[n[m].key]=m;const b=[],p=new Map,E=new Map,_=[];for(m=h;m--;){const L=a(r,o,m),w=t(L);let C=l.get(w);C?_.push(()=>C.p(L,e)):(C=u(w,L),C.c()),p.set(w,b[m]=C),w in y&&E.set(w,Math.abs(m-y[w]))}const x=new Set,N=new Set;function S(L){Q(L,1),L.m(s,d),l.set(L.key,L),d=L.first,h--}for(;f&&h;){const L=b[h-1],w=n[f-1],C=L.key,O=w.key;L===w?(d=L.first,f--,h--):p.has(O)?!l.has(C)||x.has(C)?S(L):N.has(O)?f--:E.get(C)>E.get(O)?(N.add(C),S(L)):(x.add(O),f--):(c(w,l),f--)}for(;f--;){const L=n[f];p.has(L.key)||c(L,l)}for(;h;)S(b[h-1]);return ye(_),b}function Se(n){n&&n.c()}function ve(n,e,t){const{fragment:i,after_update:r}=n.$$;i&&i.m(e,t),pt(()=>{const o=n.$$.on_mount.map(Vt).filter(Qt);n.$$.on_destroy?n.$$.on_destroy.push(...o):ye(o),n.$$.on_mount=[]}),r.forEach(pt)}function be(n,e){const t=n.$$;t.fragment!==null&&(vn(t.after_update),ye(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function _n(n,e){n.$$.dirty[0]===-1&&(Fe.push(n),yn(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function Re(n,e,t,i,r,o,l=null,s=[-1]){const c=Ve;Ze(n);const u=n.$$={fragment:null,ctx:[],props:o,update:G,not_equal:r,bound:Zt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Zt(),dirty:s,skip_bound:!1,root:e.target||c.$$.root};l&&l(u.root);let d=!1;if(u.ctx=t?t(n,e.props||{},(a,f,...h)=>{const m=h.length?h[0]:f;return u.ctx&&r(u.ctx[a],u.ctx[a]=m)&&(!u.skip_bound&&u.bound[a]&&u.bound[a](m),d&&_n(n,a)),f}):[],u.update(),d=!0,ye(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const a=fn(e.target);u.fragment&&u.fragment.l(a),a.forEach(B)}else u.fragment&&u.fragment.c();e.intro&&Q(n.$$.fragment),ve(n,e.target,e.anchor),ei()}Ze(c)}class Ie{constructor(){ce(this,"$$");ce(this,"$$set")}$destroy(){be(this,1),this.$destroy=G}$on(e,t){if(!Qt(t))return G;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}$set(e){this.$$set&&!rn(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const En="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(En);function Ln(n){let e,t;return{c(){e=pe("svg"),t=pe("path"),v(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"),v(e,"viewBox","0 0 14 14"),v(e,"width","13"),v(e,"height","13"),v(e,"class","svelte-en2qvf")},m(i,r){z(i,e,r),R(e,t)},p:G,i:G,o:G,d(i){i&&B(e)}}}class ii extends Ie{constructor(e){super(),Re(this,e,null,Ln,Pe,{})}}function Sn(n){let e,t;return{c(){e=pe("svg"),t=pe("path"),v(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"),v(e,"viewBox","0 0 30 30"),v(e,"fill","none"),v(e,"xmlns","http://www.w3.org/2000/svg"),v(e,"class","svelte-d2loi5")},m(i,r){z(i,e,r),R(e,t)},p:G,i:G,o:G,d(i){i&&B(e)}}}class ni extends Ie{constructor(e){super(),Re(this,e,null,Sn,Pe,{})}}function xn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"area.svg")||v(e,"src",t),v(e,"alt",n[6]),v(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"area.svg")&&v(e,"src",t),r&64&&v(e,"alt",i[6])},d(i){i&&B(e)}}}function Mn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"reverse.svg")||v(e,"src",t),v(e,"alt",n[6]),v(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"reverse.svg")&&v(e,"src",t),r&64&&v(e,"alt",i[6])},d(i){i&&B(e)}}}function kn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"poi.svg")||v(e,"src",t),v(e,"alt",n[6]),v(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"poi.svg")&&v(e,"src",t),r&64&&v(e,"alt",i[6])},d(i){i&&B(e)}}}function Cn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"postal_code.svg")||v(e,"src",t),v(e,"alt",n[6]),v(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"postal_code.svg")&&v(e,"src",t),r&64&&v(e,"alt",i[6])},d(i){i&&B(e)}}}function Nn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"street.svg")||v(e,"src",t),v(e,"alt",n[6]),v(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"street.svg")&&v(e,"src",t),r&64&&v(e,"alt",i[6])},d(i){i&&B(e)}}}function Pn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"road.svg")||v(e,"src",t),v(e,"alt",n[6]),v(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"road.svg")&&v(e,"src",t),r&64&&v(e,"alt",i[6])},d(i){i&&B(e)}}}function Tn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"housenumber.svg")||v(e,"src",t),v(e,"alt",n[6]),v(e,"class","svelte-ltkwvy")},m(i,r){z(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"housenumber.svg")&&v(e,"src",t),r&64&&v(e,"alt",i[6])},d(i){i&&B(e)}}}function Rn(n){let e,t,i,r;return{c(){e=A("img"),J(e.src,t=n[5])||v(e,"src",t),v(e,"alt",n[4]),v(e,"class","svelte-ltkwvy")},m(o,l){z(o,e,l),i||(r=ee(e,"error",n[14]),i=!0)},p(o,l){l&32&&!J(e.src,t=o[5])&&v(e,"src",t),l&16&&v(e,"alt",o[4])},d(o){o&&B(e),i=!1,r()}}}function ri(n){let e,t;return{c(){e=A("span"),t=Ee(n[6]),v(e,"class","secondary svelte-ltkwvy")},m(i,r){z(i,e,r),R(e,t)},p(i,r){r&64&&je(t,i[6])},d(i){i&&B(e)}}}function In(n){let e,t,i,r,o,l,s,c,u,d=(n[7]?n[0].place_name:n[0].place_name.replace(/,.*/,""))+"",a,f,h=n[2]==="always"||n[2]&&!n[0].address&&!n[0].id.startsWith("road.")&&!n[0].id.startsWith("address.")&&!n[0].id.startsWith("postal_code.")&&(!n[0].id.startsWith("poi.")||!n[5])&&!n[7],m,y,b=(n[7]?"":n[0].place_name.replace(/[^,]*,?\s*/,""))+"",p,E,_;function x(w,C){return C&1&&(t=null),C&1&&(i=null),C&1&&(r=null),C&1&&(o=null),w[5]?Rn:w[0].address?Tn:(t==null&&(t=!!w[0].id.startsWith("road.")),t?Pn:(i==null&&(i=!!w[0].id.startsWith("address.")),i?Nn:(r==null&&(r=!!w[0].id.startsWith("postal_code.")),r?Cn:(o==null&&(o=!!w[0].id.startsWith("poi.")),o?kn:w[7]?Mn:xn))))}let N=x(n,-1),S=N(n),L=h&&ri(n);return{c(){e=A("li"),S.c(),l=ie(),s=A("span"),c=A("span"),u=A("span"),a=Ee(d),f=ie(),L&&L.c(),m=ie(),y=A("span"),p=Ee(b),v(u,"class","primary svelte-ltkwvy"),v(c,"class","svelte-ltkwvy"),v(y,"class","line2 svelte-ltkwvy"),v(s,"class","texts svelte-ltkwvy"),v(e,"tabindex","0"),v(e,"data-selected",n[1]),v(e,"class","svelte-ltkwvy"),Le(e,"selected",n[1])},m(w,C){z(w,e,C),S.m(e,null),R(e,l),R(e,s),R(s,c),R(c,u),R(u,a),R(c,f),L&&L.m(c,null),R(s,m),R(s,y),R(y,p),E||(_=[ee(e,"mouseenter",n[12]),ee(e,"focus",n[13])],E=!0)},p(w,[C]){N===(N=x(w,C))&&S?S.p(w,C):(S.d(1),S=N(w),S&&(S.c(),S.m(e,l))),C&1&&d!==(d=(w[7]?w[0].place_name:w[0].place_name.replace(/,.*/,""))+"")&&je(a,d),C&37&&(h=w[2]==="always"||w[2]&&!w[0].address&&!w[0].id.startsWith("road.")&&!w[0].id.startsWith("address.")&&!w[0].id.startsWith("postal_code.")&&(!w[0].id.startsWith("poi.")||!w[5])&&!w[7]),h?L?L.p(w,C):(L=ri(w),L.c(),L.m(c,null)):L&&(L.d(1),L=null),C&1&&b!==(b=(w[7]?"":w[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&je(p,b),C&2&&v(e,"data-selected",w[1]),C&2&&Le(e,"selected",w[1])},i:G,o:G,d(w){w&&B(e),S.d(),L&&L.d(),E=!1,ye(_)}}}function On(n,e,t){var _;let i,r,{feature:o}=e,{selected:l=!1}=e,{showPlaceType:s}=e,{missingIconsCache:c}=e,{iconsBaseUrl:u}=e;const d=(_=o.properties)==null?void 0:_.categories;let a,f,h=0,m=o.place_type[0]==="reverse";function y(){f&&c.add(f),t(10,h++,h)}function b(x){Jt.call(this,n,x)}function p(x){Jt.call(this,n,x)}const E=()=>y();return n.$$set=x=>{"feature"in x&&t(0,o=x.feature),"selected"in x&&t(1,l=x.selected),"showPlaceType"in x&&t(2,s=x.showPlaceType),"missingIconsCache"in x&&t(9,c=x.missingIconsCache),"iconsBaseUrl"in x&&t(3,u=x.iconsBaseUrl)},n.$$.update=()=>{var x,N,S,L;if(n.$$.dirty&3640)do t(11,i--,i),t(4,a=d==null?void 0:d[i]),t(5,f=a?u+a.replace(/ /g,"_")+".svg":void 0);while(i>-1&&(!f||c.has(f)));n.$$.dirty&1&&t(6,r=((N=(x=o.properties)==null?void 0:x.categories)==null?void 0:N.join(", "))??((L=(S=o.properties)==null?void 0:S.place_type_name)==null?void 0:L[0])??o.place_type[0])},t(11,i=(d==null?void 0:d.length)??0),[o,l,s,u,a,f,r,m,y,c,h,i,b,p,E]}class Wn extends Ie{constructor(e){super(),Re(this,e,On,In,Pe,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function An(n){let e;return{c(){e=A("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>',v(e,"class","svelte-7cmwmc")},m(t,i){z(t,e,i)},p:G,i:G,o:G,d(t){t&&B(e)}}}class Fn extends Ie{constructor(e){super(),Re(this,e,null,An,Pe,{})}}function Dn(n){let e,t;return{c(){e=pe("svg"),t=pe("path"),v(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"),v(e,"viewBox","0 0 60.006 21.412"),v(e,"width","14"),v(e,"height","20"),v(e,"class","svelte-en2qvf")},m(i,r){z(i,e,r),R(e,t)},p:G,i:G,o:G,d(i){i&&B(e)}}}class Bn extends Ie{constructor(e){super(),Re(this,e,null,Dn,Pe,{})}}function Un(n){let e,t,i;return{c(){e=pe("svg"),t=pe("circle"),i=pe("path"),v(t,"cx","4.789"),v(t,"cy","4.787"),v(t,"r","3.85"),v(t,"class","svelte-1aq105l"),v(i,"d","M12.063 12.063 7.635 7.635"),v(i,"class","svelte-1aq105l"),v(e,"xmlns","http://www.w3.org/2000/svg"),v(e,"width","13"),v(e,"height","13"),v(e,"viewBox","0 0 13 13"),v(e,"class","svelte-1aq105l")},m(r,o){z(r,e,o),R(e,t),R(e,i)},p:G,i:G,o:G,d(r){r&&B(e)}}}class qn extends Ie{constructor(e){super(),Re(this,e,null,Un,Pe,{})}}function Gn(n,e,t){const i=e[1],r=e[0],o=i-r;return n===i&&t?n:((n-r)%o+o)%o+r}function nt(n){const e=[...n];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 Qe;async function zn(n,e,t){const i=n==null?void 0:n.getCenterAndZoom();for(const r of e??[])if(!(i&&(r.minZoom!=null&&r.minZoom>i[0]||r.maxZoom!=null&&r.maxZoom<i[0]))){if(r.type==="fixed")return r.coordinates.join(",");e:if(r.type==="client-geolocation"){if(Qe&&r.cachedLocationExpiry&&Qe.time+r.cachedLocationExpiry>Date.now()){if(!Qe.coords)break e;return Qe.coords}let o;try{return o=await new Promise((l,s)=>{t.signal.addEventListener("abort",()=>{s(Error("aborted"))}),navigator.geolocation.getCurrentPosition(c=>{l([c.coords.longitude,c.coords.latitude].map(u=>u.toFixed(6)).join(","))},c=>{s(c)},r)}),o}catch{}finally{r.cachedLocationExpiry&&(Qe={time:Date.now(),coords:o})}if(t.signal.aborted)return}if(r.type==="server-geolocation")return"ip";if(i&&r.type==="map-center")return i[1].toFixed(6)+","+i[2].toFixed(6)}}const jn=/^(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,oi=/^([+-]?[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,})$/,si=/^(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,li=/^(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,ui=/^(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,ai=/^(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 Vn(n){if(!["DMS","DM","DD"].includes(n))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(h=>Number(h.trim())),t=Number(e[0]),i=Number(e[1]),r=Math.abs(t),o=Math.abs(i),l=t>0?"N":"S",s=i>0?"E":"W";let c;n=="DD"&&(c=`${r}° ${l}, ${o}° ${s}`);const u=Math.floor(r),d=Math.floor(o),a=(r-u)*60,f=(o-d)*60;if(n=="DM"){let h=ci(a,3).toFixed(3).padStart(6,"0"),m=ci(f,3).toFixed(3).padStart(6,"0");h.endsWith(".000")&&m.endsWith(".000")&&(h=h.replace(/\.000$/,""),m=m.replace(/\.000$/,"")),c=`${u}° ${h}' ${l}, ${d}° ${m}' ${s}`}if(n=="DMS"){const h=Math.floor(a),m=Math.floor(f);let y=((a-h)*60).toFixed(1).padStart(4,"0"),b=((f-m)*60).toFixed(1).padStart(4,"0");const p=h.toString().padStart(2,"0"),E=m.toString().padStart(2,"0");y.endsWith(".0")&&b.endsWith(".0")&&(y=y.replace(/\.0$/,""),b=b.replace(/\.0$/,"")),c=`${u}° ${p}' ${y}" ${l}, ${d}° ${E}' ${b}" ${s}`}return c}else throw new Error("no decimal coordinates to convert")}function ci(n,e){const t=Math.pow(10,e);return Math.round((n+Number.EPSILON)*t)/t}function bt(n,e){e||(e=5),n=n.replace(/\s+/g," ").trim();let t=null,i=null,r="",o="",l=null,s=[],c=!1;if(jn.test(n))throw new Error("invalid coordinate value");if(oi.test(n))if(s=oi.exec(n),c=He(s),c)t=Math.abs(s[1])+s[2]/60,Number(s[1])<0&&(t*=-1),i=Math.abs(s[3])+s[4]/60,Number(s[3])<0&&(i*=-1),l="DM";else throw new Error("invalid coordinate format");else if(si.test(n))if(s=si.exec(n),c=He(s),c){if(t=s[2],i=s[6],t.includes(",")&&(t=t.replace(",",".")),i.includes(",")&&(i=i.replace(",",".")),l="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(i))==Number(i))throw new Error("integer only coordinate provided");s[1]?(r=s[1],o=s[5]):s[4]&&(r=s[4],o=s[8])}else throw new Error("invalid decimal coordinate format");else if(li.test(n))if(s=li.exec(n),c=He(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,l="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,l="DMS"),parseInt(s[2])<0&&(t=-1*t),i=Math.abs(parseInt(s[9])),s[11]&&(i+=s[11]/60),s[13]&&(i+=s[13].replace(",",".")/3600),parseInt(s[9])<0&&(i=-1*i),s[1]?(r=s[1],o=s[8]):s[7]&&(r=s[7],o=s[14]);else throw new Error("invalid DMS coordinates format");else if(ui.test(n))if(s=ui.exec(n),c=He(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,l="DM"),s[6]&&(t+=s[6]/3600,l="DMS"),parseInt(s[2])<0&&(t=-1*t),i=Math.abs(parseInt(s[10])),s[12]&&(i+=s[12]/60),s[14]&&(i+=s[14]/3600),parseInt(s[10])<0&&(i=-1*i),s[1]?(r=s[1],o=s[9]):s[8]&&(r=s[8],o=s[16]);else throw new Error("invalid DMS coordinates format");else if(ai.test(n)){if(s=ai.exec(n),c=He(s),s.filter(u=>u).length<=5)throw new Error("invalid coordinates format");if(c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4].replace(",",".")/60,l="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,l="DMS"),parseInt(s[2])<0&&(t=-1*t),i=Math.abs(parseInt(s[10])),s[12]&&(i+=s[12].replace(",",".")/60),s[14]&&(i+=s[14].replace(",",".")/3600),parseInt(s[10])<0&&(i=-1*i),s[1]?(r=s[1],o=s[9]):s[8]&&(r=s[8],o=s[16]);else throw new Error("invalid coordinates format")}if(c){if(Math.abs(i)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(r&&!o||!r&&o)throw new Error("invalid coordinates value");if(r&&r==o)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),i.toString().includes(",")&&(i=i.replace(",","."));let u=/S|SOUTH/i;u.test(r)&&t>0&&(t=-1*t),u=/W|WEST/i,u.test(o)&&i>0&&(i=-1*i);const d=s[0].trim();let a,f;const h=/[,/;\u0020]/g,m=d.match(h);if(m==null){const p=Math.floor(n.length/2);a=d.substring(0,p).trim(),f=d.substring(p).trim()}else{let p;m.length%2==1?p=Math.floor(m.length/2):p=m.length/2-1;let E=0;if(p==0)E=d.indexOf(m[0]),a=d.substring(0,E).trim(),f=d.substring(E+1).trim();else{let _=0,x=0;for(;_<=p;)E=d.indexOf(m[_],x),x=E+1,_++;a=d.substring(0,E).trim(),f=d.substring(E+1).trim()}}const y=a.split(".");if(y.length==2&&y[1]==0&&y[1].length!=2)throw new Error("invalid coordinates format");const b=f.split(".");if(b.length==2&&b[1]==0&&b[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(a)||/^\d+$/.test(f))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),i=Number(Number(i).toFixed(e)),Object.freeze({verbatimCoordinates:d,verbatimLatitude:a,verbatimLongitude:f,decimalLatitude:t,decimalLongitude:i,decimalCoordinates:`${t},${i}`,originalFormat:l,closeEnough:Zn,toCoordinateFormat:Vn})}else throw new Error("coordinates pattern match failed")}function He(n){if(!isNaN(n[0]))return!1;const e=[...n];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,i=/[eastsouthnorthwest]+/i,r=e.length/2;for(let o=0;o<r;o++){const l=e[o],s=e[o+r],c=t.test(l)&&t.test(s),u=i.test(l)&&i.test(s),d=l==s;if(!(l==null&&s==null)){if(l==null||s==null)return!1;if(c||u||d)continue;return!1}}return!0}function fi(n,e){const t=Math.abs(n-e);return Number(t.toFixed(6))<=1e-5}function Zn(n){if(!n)throw new Error("coords must be provided");if(n.includes(",")){const e=n.split(",");if(Number(e[0])==NaN||Number(e[1])==NaN)throw new Error("coords are not valid decimals");return fi(this.decimalLatitude,Number(e[0]))&&fi(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const Qn=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});bt.to=Qn;const Hn=[{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"}],Yn={decimalLatitude:40.123,decimalLongitude:-74.123},Xn=[{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}],Kn=[{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 Jn(){const n=[];return Hn.forEach(e=>{e.decimalLatitude?n.push(e):n.push({...e,...Yn})}),[...n,...Xn,...Kn]}const $n=Jn();bt.formats=$n.map(n=>n.verbatimCoordinates);const er=bt;function di(n,e,t){const i=n.slice();return i[83]=e[t],i[85]=t,i}function hi(n){let e,t;return e=new Fn({}),{c(){Se(e.$$.fragment)},m(i,r){ve(e,i,r),t=!0},i(i){t||(Q(e.$$.fragment,i),t=!0)},o(i){K(e.$$.fragment,i),t=!1},d(i){be(e,i)}}}function gi(n){let e,t,i,r,o;return t=new Bn({}),{c(){e=A("button"),Se(t.$$.fragment),v(e,"type","button"),v(e,"title",n[9]),v(e,"class","svelte-qnu791"),Le(e,"active",n[0])},m(l,s){z(l,e,s),ve(t,e,null),i=!0,r||(o=ee(e,"click",n[68]),r=!0)},p(l,s){(!i||s[0]&512)&&v(e,"title",l[9]),(!i||s[0]&1)&&Le(e,"active",l[0])},i(l){i||(Q(t.$$.fragment,l),i=!0)},o(l){K(t.$$.fragment,l),i=!1},d(l){l&&B(e),be(t),r=!1,o()}}}function tr(n){let e,t=[],i=new Map,r,o,l,s=ti(n[14]);const c=u=>u[83].id+(u[83].address?","+u[83].address:"");for(let u=0;u<s.length;u+=1){let d=di(n,s,u),a=c(d);i.set(a,t[u]=mi(a,d))}return{c(){e=A("ul");for(let u=0;u<t.length;u+=1)t[u].c();v(e,"class","svelte-qnu791")},m(u,d){z(u,e,d);for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(e,null);r=!0,o||(l=[ee(e,"mouseleave",n[72]),ee(e,"blur",n[73])],o=!0)},p(u,d){d[0]&17880064&&(s=ti(u[14]),tt(),t=wn(t,d,c,1,u,s,i,e,bn,mi,null,di),it())},i(u){if(!r){for(let d=0;d<s.length;d+=1)Q(t[d]);r=!0}},o(u){for(let d=0;d<t.length;d+=1)K(t[d]);r=!1},d(u){u&&B(e);for(let d=0;d<t.length;d+=1)t[d].d();o=!1,ye(l)}}}function ir(n){let e,t,i,r,o,l;return t=new ni({}),{c(){e=A("div"),Se(t.$$.fragment),i=ie(),r=A("div"),o=Ee(n[7]),v(r,"class","svelte-qnu791"),v(e,"class","no-results svelte-qnu791")},m(s,c){z(s,e,c),ve(t,e,null),R(e,i),R(e,r),R(r,o),l=!0},p(s,c){(!l||c[0]&128)&&je(o,s[7])},i(s){l||(Q(t.$$.fragment,s),l=!0)},o(s){K(t.$$.fragment,s),l=!1},d(s){s&&B(e),be(t)}}}function nr(n){let e="",t;return{c(){t=Ee(e)},m(i,r){z(i,t,r)},p:G,i:G,o:G,d(i){i&&B(t)}}}function rr(n){let e,t,i,r,o,l,s,c,u,d,a;return t=new ni({}),c=new ii({}),{c(){e=A("div"),Se(t.$$.fragment),i=ie(),r=A("div"),o=Ee(n[6]),l=ie(),s=A("button"),Se(c.$$.fragment),v(r,"class","svelte-qnu791"),v(s,"class","svelte-qnu791"),v(e,"class","error svelte-qnu791")},m(f,h){z(f,e,h),ve(t,e,null),R(e,i),R(e,r),R(r,o),R(e,l),R(e,s),ve(c,s,null),u=!0,d||(a=ee(s,"click",n[69]),d=!0)},p(f,h){(!u||h[0]&64)&&je(o,f[6])},i(f){u||(Q(t.$$.fragment,f),Q(c.$$.fragment,f),u=!0)},o(f){K(t.$$.fragment,f),K(c.$$.fragment,f),u=!1},d(f){f&&B(e),be(t),be(c),d=!1,a()}}}function mi(n,e){let t,i,r;function o(){return e[70](e[85])}function l(){return e[71](e[83])}return i=new Wn({props:{feature:e[83],showPlaceType:e[10],selected:e[15]===e[85],missingIconsCache:e[20],iconsBaseUrl:e[12]}}),i.$on("mouseenter",o),i.$on("focus",l),{key:n,first:null,c(){t=an(),Se(i.$$.fragment),this.first=t},m(s,c){z(s,t,c),ve(i,s,c),r=!0},p(s,c){e=s;const u={};c[0]&16384&&(u.feature=e[83]),c[0]&1024&&(u.showPlaceType=e[10]),c[0]&49152&&(u.selected=e[15]===e[85]),c[0]&4096&&(u.iconsBaseUrl=e[12]),i.$set(u)},i(s){r||(Q(i.$$.fragment,s),r=!0)},o(s){K(i.$$.fragment,s),r=!1},d(s){s&&B(t),be(i,s)}}}function or(n){let e,t,i,r,o,l,s,c,u,d,a,f,h,m,y,b,p,E,_,x,N,S=!1;o=new qn({}),a=new ii({});let L=n[19]&&hi(),w=n[5]===!0&&gi(n);const C=n[60].default,O=on(C,n,n[59],null),U=[rr,nr,ir,tr],j=[];function W(M,V){var ne,ae;return M[18]?0:M[16]?((ne=M[14])==null?void 0:ne.length)===0?2:M[16]&&((ae=M[14])!=null&&ae.length)?3:-1:1}return~(b=W(n))&&(p=j[b]=U[b](n)),{c(){e=ie(),t=A("form"),i=A("div"),r=A("button"),Se(o.$$.fragment),l=ie(),s=A("input"),c=ie(),u=A("div"),d=A("button"),Se(a.$$.fragment),f=ie(),L&&L.c(),h=ie(),w&&w.c(),m=ie(),O&&O.c(),y=ie(),p&&p.c(),v(r,"class","search-button svelte-qnu791"),v(r,"type","button"),v(s,"placeholder",n[8]),v(s,"aria-label",n[8]),v(s,"class","svelte-qnu791"),v(d,"type","button"),v(d,"title",n[3]),v(d,"class","svelte-qnu791"),v(u,"class","clear-button-container svelte-qnu791"),Le(u,"displayable",n[1]!==""),v(i,"class","input-group svelte-qnu791"),v(t,"tabindex","0"),v(t,"class",E=Yt(n[2])+" svelte-qnu791"),Le(t,"can-collapse",n[4]&&n[1]==="")},m(M,V){z(M,e,V),z(M,t,V),R(t,i),R(i,r),ve(o,r,null),R(i,l),R(i,s),n[62](s),Xt(s,n[1]),R(i,c),R(i,u),R(u,d),ve(a,d,null),R(u,f),L&&L.m(u,null),R(i,h),w&&w.m(i,null),R(i,m),O&&O.m(i,null),R(t,y),~b&&j[b].m(t,null),_=!0,x||(N=[ee(r,"click",n[61]),ee(s,"input",n[63]),ee(s,"focus",n[64]),ee(s,"blur",n[65]),ee(s,"keydown",n[22]),ee(s,"input",n[66]),ee(d,"click",n[67]),ee(t,"submit",cn(n[21]))],x=!0)},p(M,V){(!_||V[0]&256)&&v(s,"placeholder",M[8]),(!_||V[0]&256)&&v(s,"aria-label",M[8]),V[0]&2&&s.value!==M[1]&&Xt(s,M[1]),(!_||V[0]&8)&&v(d,"title",M[3]),M[19]?L?V[0]&524288&&Q(L,1):(L=hi(),L.c(),Q(L,1),L.m(u,null)):L&&(tt(),K(L,1,1,()=>{L=null}),it()),(!_||V[0]&2)&&Le(u,"displayable",M[1]!==""),M[5]===!0?w?(w.p(M,V),V[0]&32&&Q(w,1)):(w=gi(M),w.c(),Q(w,1),w.m(i,m)):w&&(tt(),K(w,1,1,()=>{w=null}),it()),O&&O.p&&(!_||V[1]&268435456)&&ln(O,C,M,M[59],_?sn(C,M[59],V,null):un(M[59]),null);let ne=b;b=W(M),b===ne?~b&&j[b].p(M,V):(p&&(tt(),K(j[ne],1,1,()=>{j[ne]=null}),it()),~b?(p=j[b],p?p.p(M,V):(p=j[b]=U[b](M),p.c()),Q(p,1),p.m(t,null)):p=null),(!_||V[0]&4&&E!==(E=Yt(M[2])+" svelte-qnu791"))&&v(t,"class",E),(!_||V[0]&22)&&Le(t,"can-collapse",M[4]&&M[1]==="")},i(M){_||(Q(S),Q(o.$$.fragment,M),Q(a.$$.fragment,M),Q(L),Q(w),Q(O,M),Q(p),_=!0)},o(M){K(S),K(o.$$.fragment,M),K(a.$$.fragment,M),K(L),K(w),K(O,M),K(p),_=!1},d(M){M&&(B(e),B(t)),be(o),n[62](null),be(a),L&&L.d(),w&&w.d(),O&&O.d(M),~b&&j[b].d(),x=!1,ye(N)}}}function sr(n,e,t){let i,{$$slots:r={},$$scope:o}=e;const l={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:s=void 0}=e,{apiKey:c}=e,{bbox:u=void 0}=e,{clearButtonTitle:d="clear"}=e,{clearOnBlur:a=!1}=e,{collapsed:f=!1}=e,{country:h=void 0}=e,{debounceSearch:m=200}=e,{enableReverse:y=!1}=e,{errorMessage:b="Something went wrong…"}=e,{filter:p=()=>!0}=e,{flyTo:E=!0}=e,{fuzzyMatch:_=!0}=e,{language:x=void 0}=e,{limit:N=void 0}=e,{mapController:S=void 0}=e,{minLength:L=2}=e,{noResultsMessage:w="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:C="Search"}=e,{proximity:O=[{type:"server-geolocation"}]}=e,{reverseActive:U=y==="always"}=e,{reverseButtonTitle:j="toggle reverse geocoding"}=e,{searchValue:W=""}=e,{showFullGeometry:M=!0}=e,{showPlaceType:V="ifNeeded"}=e,{showResultsWhileTyping:ne=!0}=e,{selectFirst:ae=!0}=e,{flyToSelected:Tt=!1}=e,{markerOnSelected:ut=!0}=e,{types:We=void 0}=e,{excludeTypes:at=!1}=e,{zoom:qe=l}=e,{maxZoom:ct=void 0}=e,{apiUrl:Rt="https://api.maptiler.com/geocoding"}=e,{fetchParameters:It={}}=e,{iconsBaseUrl:Vi="https://cdn.maptiler.com/maptiler-geocoding-control/v1.4.0/icons/"}=e,{adjustUrlQuery:Ot=()=>{}}=e;function Gr(){he.focus()}function zr(){he.blur()}function Zi(g,Z=!0,X=!1){t(1,W=g),Z?(t(15,q=-1),Hi()):(Dt(!X,X),setTimeout(()=>{he.focus(),he.select()}))}function jr(){t(14,I=void 0),t(56,P=void 0),t(15,q=-1)}function Vr(){t(55,H=[]),t(56,P=void 0)}let Ge=!1,I,H,P,Qi="",he,q=-1,ge,ft=[],Ae,ze,dt,Wt;const Zr=new Set,Ne=gn();hn(()=>{S&&(S.setEventHandler(void 0),S.indicateReverse(!1),S.setSelectedMarker(-1),S.setMarkers(void 0,void 0))});function Hi(g){if(ze&&(clearTimeout(ze),ze=void 0),q>-1&&I)t(56,P=I[q]),t(1,W=P.place_type[0]==="reverse"?P.place_name:P.place_name.replace(/,.*/,"")),t(18,ge=void 0),t(55,H=void 0),t(15,q=-1);else if(W){const Z=g||!At(W);Ft(W,{exact:!0}).then(()=>{t(55,H=I),t(56,P=void 0),Z&&Qr()}).catch(X=>t(18,ge=X))}}function At(g){try{return er(g,6)}catch{return!1}}async function Ft(g,{byId:Z=!1,exact:X=!1}={}){t(18,ge=void 0),Ae==null||Ae.abort();const re=new AbortController;t(19,Ae=re);try{const T=At(g),Y=new URLSearchParams;if(x!==void 0&&Y.set("language",Array.isArray(x)?x.join(","):x??""),We&&Y.set("types",We.join(",")),at&&Y.set("excludeTypes",String(at)),u&&Y.set("bbox",u.map(ht=>ht.toFixed(6)).join(",")),h&&Y.set("country",Array.isArray(h)?h.join(","):h),!Z&&!T){const ht=await zn(S,O,re);ht&&Y.set("proximity",ht),(X||!ne)&&Y.set("autocomplete","false"),Y.set("fuzzyMatch",String(_))}N!==void 0&&(!T||(We==null?void 0:We.length)===1)&&Y.set("limit",String(N)),Y.set("key",c),Ot(Y);const me=Rt+"/"+encodeURIComponent(T?T.decimalLongitude+","+T.decimalLatitude:g)+".json?"+Y.toString();if(me===Qi){Z?(t(14,I=void 0),t(56,P=ft[0])):t(14,I=ft);return}Qi=me;const Ut=await fetch(me,{signal:re.signal,...It});if(!Ut.ok)throw new Error(await Ut.text());const qt=await Ut.json();Ne("response",{url:me,featureCollection:qt}),Z?(t(14,I=void 0),t(56,P=qt.features[0]),ft=[P]):(t(14,I=qt.features.filter(p)),T&&I.unshift({type:"Feature",properties:{},id:"reverse_"+T.decimalLongitude+"_"+T.decimalLatitude,text:T.decimalLatitude+", "+T.decimalLongitude,place_name:T.decimalLatitude+", "+T.decimalLongitude,place_type:["reverse"],center:[T.decimalLongitude,T.decimalLatitude],bbox:[T.decimalLongitude,T.decimalLatitude,T.decimalLongitude,T.decimalLatitude],geometry:{type:"Point",coordinates:[T.decimalLongitude,T.decimalLatitude]}}),ft=I,T&&he.focus())}catch(T){if(T&&typeof T=="object"&&"name"in T&&T.name==="AbortError")return;throw T}finally{re===Ae&&t(19,Ae=void 0)}}function Qr(){var re;if(!(H!=null&&H.length)||!E)return;const g=[180,90,-180,-90],Z=!H.some(T=>!T.matching_text);let X;for(const T of H){const Y=Je(T);if(X=ct??(X===void 0?Y:Y===void 0?X:Math.max(X,Y)),Z||!T.matching_text)for(const me of[0,1,2,3])g[me]=Math[me<2?"min":"max"](g[me],((re=T.bbox)==null?void 0:re[me])??T.center[me%2])}S&&H.length>0&&(P&&g[0]===g[2]&&g[1]===g[3]?S.flyTo(P.center,Je(P)):S.fitBounds(nt(g),50,X))}function Je(g){var X;if(!g.bbox||g.bbox[0]!==g.bbox[2]&&g.bbox[1]!==g.bbox[3])return;if(typeof qe=="number")return g.id.startsWith("poi.")||g.id.startsWith("address.")?ct:qe;const Z=g.id.replace(/\..*/,"");return(Array.isArray((X=g.properties)==null?void 0:X.categories)?g.properties.categories.reduce((re,T)=>{const Y=qe[Z+"."+T];return re===void 0?Y:Y===void 0?re:Math.max(re,Y)},void 0):void 0)??qe[Z]}function Hr(g){t(0,U=y==="always"),t(14,I=void 0),t(56,P=void 0),t(15,q=-1),Zi(g[1].toFixed(6)+", "+Gn(g[0],[-180,180],!0).toFixed(6),!1,!0)}function Yr(g){if(!I)return;let Z=g.key==="ArrowDown"?1:g.key==="ArrowUp"?-1:0;Z&&(q===(ae?0:-1)&&Z===-1&&t(15,q=I.length),t(15,q+=Z),q>=I.length&&t(15,q=-1),q<0&&ae&&t(15,q=0),g.preventDefault())}function Dt(g=!0,Z=!1){if(t(18,ge=void 0),ne||Z){if(ze&&clearTimeout(ze),W.length<L)return;const X=W;ze=window.setTimeout(()=>{Ft(X).catch(re=>t(18,ge=re))},g?m:0)}else t(14,I=void 0),t(18,ge=void 0)}function Bt(g){t(56,P=g),t(1,W=g.place_name),t(15,q=-1)}const Xr=()=>he.focus();function Kr(g){mt[g?"unshift":"push"](()=>{he=g,t(17,he)})}function Jr(){W=this.value,t(1,W),t(13,Ge),t(28,a)}const $r=()=>t(13,Ge=!0),eo=()=>t(13,Ge=!1),to=()=>Dt(),io=()=>{t(1,W=""),he.focus()},no=()=>t(0,U=!U),ro=()=>t(18,ge=void 0),oo=g=>t(15,q=g),so=g=>Bt(g),lo=()=>{ae||t(15,q=-1)},uo=()=>{};return n.$$set=g=>{"class"in g&&t(2,s=g.class),"apiKey"in g&&t(26,c=g.apiKey),"bbox"in g&&t(27,u=g.bbox),"clearButtonTitle"in g&&t(3,d=g.clearButtonTitle),"clearOnBlur"in g&&t(28,a=g.clearOnBlur),"collapsed"in g&&t(4,f=g.collapsed),"country"in g&&t(29,h=g.country),"debounceSearch"in g&&t(30,m=g.debounceSearch),"enableReverse"in g&&t(5,y=g.enableReverse),"errorMessage"in g&&t(6,b=g.errorMessage),"filter"in g&&t(31,p=g.filter),"flyTo"in g&&t(32,E=g.flyTo),"fuzzyMatch"in g&&t(33,_=g.fuzzyMatch),"language"in g&&t(34,x=g.language),"limit"in g&&t(35,N=g.limit),"mapController"in g&&t(36,S=g.mapController),"minLength"in g&&t(37,L=g.minLength),"noResultsMessage"in g&&t(7,w=g.noResultsMessage),"placeholder"in g&&t(8,C=g.placeholder),"proximity"in g&&t(38,O=g.proximity),"reverseActive"in g&&t(0,U=g.reverseActive),"reverseButtonTitle"in g&&t(9,j=g.reverseButtonTitle),"searchValue"in g&&t(1,W=g.searchValue),"showFullGeometry"in g&&t(39,M=g.showFullGeometry),"showPlaceType"in g&&t(10,V=g.showPlaceType),"showResultsWhileTyping"in g&&t(40,ne=g.showResultsWhileTyping),"selectFirst"in g&&t(11,ae=g.selectFirst),"flyToSelected"in g&&t(41,Tt=g.flyToSelected),"markerOnSelected"in g&&t(42,ut=g.markerOnSelected),"types"in g&&t(43,We=g.types),"excludeTypes"in g&&t(44,at=g.excludeTypes),"zoom"in g&&t(45,qe=g.zoom),"maxZoom"in g&&t(46,ct=g.maxZoom),"apiUrl"in g&&t(47,Rt=g.apiUrl),"fetchParameters"in g&&t(48,It=g.fetchParameters),"iconsBaseUrl"in g&&t(12,Vi=g.iconsBaseUrl),"adjustUrlQuery"in g&&t(49,Ot=g.adjustUrlQuery),"$$scope"in g&&t(59,o=g.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&32&&t(0,U=y==="always"),n.$$.dirty[0]&268443648&&setTimeout(()=>{t(16,dt=Ge),a&&!Ge&&t(1,W="")}),n.$$.dirty[0]&16386|n.$$.dirty[1]&64&&W.length<L&&(t(56,P=void 0),t(14,I=void 0),t(18,ge=void 0),t(55,H=I)),n.$$.dirty[1]&33554688&&M&&P&&!P.address&&P.geometry.type==="Point"&&P.place_type[0]!=="reverse"&&Ft(P.id,{byId:!0}).catch(g=>t(18,ge=g)),n.$$.dirty[1]&100663330&&(S&&P&&P.id!==Wt&&E&&(!P.bbox||P.bbox[0]===P.bbox[2]&&P.bbox[1]===P.bbox[3]?S.flyTo(P.center,Je(P)):S.fitBounds(nt(P.bbox),50,Je(P)),t(14,I=void 0),t(55,H=void 0),t(15,q=-1)),t(57,Wt=P==null?void 0:P.id)),n.$$.dirty[0]&18432&&ae&&I!=null&&I.length&&t(15,q=0),n.$$.dirty[0]&2050&&(ae||t(15,q=-1)),n.$$.dirty[0]&16384|n.$$.dirty[1]&16777216&&H!==I&&t(55,H=void 0),n.$$.dirty[0]&81921|n.$$.dirty[1]&16777248&&S&&S.setEventHandler(g=>{switch(g.type){case"mapClick":U&&Hr(g.coordinates);break;case"markerClick":{const Z=I==null?void 0:I.find(X=>X.id===g.id);Z&&Bt(Z)}break;case"markerMouseEnter":H&&t(15,q=dt?(I==null?void 0:I.findIndex(Z=>Z.id===g.id))??-1:-1);break;case"markerMouseLeave":H&&t(15,q=-1);break}}),n.$$.dirty[0]&49152&&t(58,i=I==null?void 0:I[q]),n.$$.dirty[1]&134218786&&S&&i&&E&&Tt&&S.flyTo(i.center,Je(i)),n.$$.dirty[1]&2080&&(ut||S==null||S.setMarkers(void 0,void 0)),n.$$.dirty[1]&150997024&&S&&ut&&!H&&(S.setMarkers(i?[i]:void 0,void 0),S.setSelectedMarker(i?0:-1)),n.$$.dirty[1]&50331680&&S&&S.setMarkers(H,P),n.$$.dirty[0]&32768|n.$$.dirty[1]&16777248&&H&&S&&S.setSelectedMarker(q),n.$$.dirty[0]&2|n.$$.dirty[1]&32&&S){const g=At(W);S.setReverseMarker(g?[g.decimalLongitude,g.decimalLatitude]:void 0)}n.$$.dirty[1]&134217728&&Ne("select",i),n.$$.dirty[1]&33554432&&Ne("pick",P),n.$$.dirty[0]&81920&&Ne("optionsVisibilityChange",dt&&!!I),n.$$.dirty[0]&16384&&Ne("featuresListed",I),n.$$.dirty[1]&16777216&&Ne("featuresMarked",H),n.$$.dirty[0]&1&&Ne("reverseToggle",U),n.$$.dirty[0]&2&&Ne("queryChange",W),n.$$.dirty[0]&1|n.$$.dirty[1]&32&&S&&S.indicateReverse(U)},[U,W,s,d,f,y,b,w,C,j,V,ae,Vi,Ge,I,q,dt,he,ge,Ae,Zr,Hi,Yr,Dt,Bt,l,c,u,a,h,m,p,E,_,x,N,S,L,O,M,ne,Tt,ut,We,at,qe,ct,Rt,It,Ot,Gr,zr,Zi,jr,Vr,H,P,Wt,i,o,r,Xr,Kr,Jr,$r,eo,to,io,no,ro,oo,so,lo,uo]}let lr=class extends Ie{constructor(e){super(),Re(this,e,sr,or,Pe,{ZOOM_DEFAULTS:25,class:2,apiKey:26,bbox:27,clearButtonTitle:3,clearOnBlur:28,collapsed:4,country:29,debounceSearch:30,enableReverse:5,errorMessage:6,filter:31,flyTo:32,fuzzyMatch:33,language:34,limit:35,mapController:36,minLength:37,noResultsMessage:7,placeholder:8,proximity:38,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:39,showPlaceType:10,showResultsWhileTyping:40,selectFirst:11,flyToSelected:41,markerOnSelected:42,types:43,excludeTypes:44,zoom:45,maxZoom:46,apiUrl:47,fetchParameters:48,iconsBaseUrl:12,adjustUrlQuery:49,focus:50,blur:51,setQuery:52,clearList:53,clearMap:54},null,[-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[25]}get focus(){return this.$$.ctx[50]}get blur(){return this.$$.ctx[51]}get setQuery(){return this.$$.ctx[52]}get clearList(){return this.$$.ctx[53]}get clearMap(){return this.$$.ctx[54]}};function rt(n,e,t={}){const i={type:"Feature"};return(t.id===0||t.id)&&(i.id=t.id),t.bbox&&(i.bbox=t.bbox),i.properties=e||{},i.geometry=n,i}function wt(n,e,t={}){for(const r of n){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 o=0;o<r[r.length-1].length;o++)if(r[r.length-1][o]!==r[0][o])throw new Error("First and last Position are not equivalent.")}return rt({type:"Polygon",coordinates:n},e,t)}function _t(n,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}function yi(n,e,t={}){return rt({type:"MultiPolygon",coordinates:n},e,t)}function pi(n,e,t){if(n!==null)for(var i,r,o,l,s,c,u,d=0,a=0,f,h=n.type,m=h==="FeatureCollection",y=h==="Feature",b=m?n.features.length:1,p=0;p<b;p++){u=m?n.features[p].geometry:y?n.geometry:n,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var E=0;E<s;E++){var _=0,x=0;if(l=f?u.geometries[E]:u,l!==null){c=l.coordinates;var N=l.type;switch(d=0,N){case null:break;case"Point":if(e(c,a,p,_,x)===!1)return!1;a++,_++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(e(c[i],a,p,_,x)===!1)return!1;a++,N==="MultiPoint"&&_++}N==="LineString"&&_++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(r=0;r<c[i].length-d;r++){if(e(c[i][r],a,p,_,x)===!1)return!1;a++}N==="MultiLineString"&&_++,N==="Polygon"&&x++}N==="Polygon"&&_++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(x=0,r=0;r<c[i].length;r++){for(o=0;o<c[i][r].length-d;o++){if(e(c[i][r][o],a,p,_,x)===!1)return!1;a++}x++}_++}break;case"GeometryCollection":for(i=0;i<l.geometries.length;i++)if(pi(l.geometries[i],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Et(n,e){var t,i,r,o,l,s,c,u,d,a,f=0,h=n.type==="FeatureCollection",m=n.type==="Feature",y=h?n.features.length:1;for(t=0;t<y;t++){for(s=h?n.features[t].geometry:m?n.geometry:n,u=h?n.features[t].properties:m?n.properties:{},d=h?n.features[t].bbox:m?n.bbox:void 0,a=h?n.features[t].id:m?n.id:void 0,c=s?s.type==="GeometryCollection":!1,l=c?s.geometries.length:1,r=0;r<l;r++){if(o=c?s.geometries[r]:s,o===null){if(e(null,f,u,d,a)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,f,u,d,a)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(e(o.geometries[i],f,u,d,a)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function ur(n,e){Et(n,function(t,i,r,o,l){var s=t===null?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return e(rt(t,r,{bbox:o,id:l}),i,0)===!1?!1:void 0}var c;switch(s){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<t.coordinates.length;u++){var d=t.coordinates[u],a={type:c,coordinates:d};if(e(rt(a,r),i,u)===!1)return!1}})}function ar(n,e={}){if(n.bbox!=null&&e.recompute!==!0)return n.bbox;const t=[1/0,1/0,-1/0,-1/0];return pi(n,i=>{t[0]>i[0]&&(t[0]=i[0]),t[1]>i[1]&&(t[1]=i[1]),t[2]<i[0]&&(t[2]=i[0]),t[3]<i[1]&&(t[3]=i[1])}),t}var vi=ar;/**
11
2
  * splaytree v3.1.2
12
3
  * Fast Splay tree for Node and browser
13
4
  *
@@ -27,6 +18,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
27
18
 
28
19
  See the Apache Version 2.0 License for specific language governing permissions
29
20
  and limitations under the License.
30
- ***************************************************************************** */function s0(a,r){var i={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},u,l,f,v;return v={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function y(_){return function(k){return m([_,k])}}function m(_){if(u)throw new TypeError("Generator is already executing.");for(;i;)try{if(u=1,l&&(f=_[0]&2?l.return:_[0]?l.throw||((f=l.return)&&f.call(l),0):l.next)&&!(f=f.call(l,_[1])).done)return f;switch(l=0,f&&(_=[_[0]&2,f.value]),_[0]){case 0:case 1:f=_;break;case 4:return i.label++,{value:_[1],done:!1};case 5:i.label++,l=_[1],_=[0];continue;case 7:_=i.ops.pop(),i.trys.pop();continue;default:if(f=i.trys,!(f=f.length>0&&f[f.length-1])&&(_[0]===6||_[0]===2)){i=0;continue}if(_[0]===3&&(!f||_[1]>f[0]&&_[1]<f[3])){i.label=_[1];break}if(_[0]===6&&i.label<f[1]){i.label=f[1],f=_;break}if(f&&i.label<f[2]){i.label=f[2],i.ops.push(_);break}f[2]&&i.ops.pop(),i.trys.pop();continue}_=r.call(a,i)}catch(k){_=[6,k],l=0}finally{u=f=0}if(_[0]&5)throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}}var dn=function(){function a(r,i){this.next=null,this.key=r,this.data=i,this.left=null,this.right=null}return a}();function a0(a,r){return a>r?1:a<r?-1:0}function mn(a,r,i){for(var u=new dn(null,null),l=u,f=u;;){var v=i(a,r.key);if(v<0){if(r.left===null)break;if(i(a,r.left.key)<0){var y=r.left;if(r.left=y.right,y.right=r,r=y,r.left===null)break}f.left=r,f=r,r=r.left}else if(v>0){if(r.right===null)break;if(i(a,r.right.key)>0){var y=r.right;if(r.right=y.left,y.left=r,r=y,r.right===null)break}l.right=r,l=r,r=r.right}else break}return l.right=r.left,f.left=r.right,r.left=u.right,r.right=u.left,r}function Ta(a,r,i,u){var l=new dn(a,r);if(i===null)return l.left=l.right=null,l;i=mn(a,i,u);var f=u(a,i.key);return f<0?(l.left=i.left,l.right=i,i.left=null):f>=0&&(l.right=i.right,l.left=i,i.right=null),l}function qc(a,r,i){var u=null,l=null;if(r){r=mn(a,r,i);var f=i(r.key,a);f===0?(u=r.left,l=r.right):f<0?(l=r.right,r.right=null,u=r):(u=r.left,r.left=null,l=r)}return{left:u,right:l}}function o0(a,r,i){return r===null?a:(a===null||(r=mn(a.key,r,i),r.left=a),r)}function Ca(a,r,i,u,l){if(a){u(""+r+(i?"└── ":"├── ")+l(a)+`
31
- `);var f=r+(i?" ":"│ ");a.left&&Ca(a.left,f,!1,u,l),a.right&&Ca(a.right,f,!0,u,l)}}var Oa=function(){function a(r){r===void 0&&(r=a0),this._root=null,this._size=0,this._comparator=r}return a.prototype.insert=function(r,i){return this._size++,this._root=Ta(r,i,this._root,this._comparator)},a.prototype.add=function(r,i){var u=new dn(r,i);this._root===null&&(u.left=u.right=null,this._size++,this._root=u);var l=this._comparator,f=mn(r,this._root,l),v=l(r,f.key);return v===0?this._root=f:(v<0?(u.left=f.left,u.right=f,f.left=null):v>0&&(u.right=f.right,u.left=f,f.right=null),this._size++,this._root=u),this._root},a.prototype.remove=function(r){this._root=this._remove(r,this._root,this._comparator)},a.prototype._remove=function(r,i,u){var l;if(i===null)return null;i=mn(r,i,u);var f=u(r,i.key);return f===0?(i.left===null?l=i.right:(l=mn(r,i.left,u),l.right=i.right),this._size--,l):i},a.prototype.pop=function(){var r=this._root;if(r){for(;r.left;)r=r.left;return this._root=mn(r.key,this._root,this._comparator),this._root=this._remove(r.key,this._root,this._comparator),{key:r.key,data:r.data}}return null},a.prototype.findStatic=function(r){for(var i=this._root,u=this._comparator;i;){var l=u(r,i.key);if(l===0)return i;l<0?i=i.left:i=i.right}return null},a.prototype.find=function(r){return this._root&&(this._root=mn(r,this._root,this._comparator),this._comparator(r,this._root.key)!==0)?null:this._root},a.prototype.contains=function(r){for(var i=this._root,u=this._comparator;i;){var l=u(r,i.key);if(l===0)return!0;l<0?i=i.left:i=i.right}return!1},a.prototype.forEach=function(r,i){for(var u=this._root,l=[],f=!1;!f;)u!==null?(l.push(u),u=u.left):l.length!==0?(u=l.pop(),r.call(i,u),u=u.right):f=!0;return this},a.prototype.range=function(r,i,u,l){for(var f=[],v=this._comparator,y=this._root,m;f.length!==0||y;)if(y)f.push(y),y=y.left;else{if(y=f.pop(),m=v(y.key,i),m>0)break;if(v(y.key,r)>=0&&u.call(l,y))return this;y=y.right}return this},a.prototype.keys=function(){var r=[];return this.forEach(function(i){var u=i.key;return r.push(u)}),r},a.prototype.values=function(){var r=[];return this.forEach(function(i){var u=i.data;return r.push(u)}),r},a.prototype.min=function(){return this._root?this.minNode(this._root).key:null},a.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},a.prototype.minNode=function(r){if(r===void 0&&(r=this._root),r)for(;r.left;)r=r.left;return r},a.prototype.maxNode=function(r){if(r===void 0&&(r=this._root),r)for(;r.right;)r=r.right;return r},a.prototype.at=function(r){for(var i=this._root,u=!1,l=0,f=[];!u;)if(i)f.push(i),i=i.left;else if(f.length>0){if(i=f.pop(),l===r)return i;l++,i=i.right}else u=!0;return null},a.prototype.next=function(r){var i=this._root,u=null;if(r.right){for(u=r.right;u.left;)u=u.left;return u}for(var l=this._comparator;i;){var f=l(r.key,i.key);if(f===0)break;f<0?(u=i,i=i.left):i=i.right}return u},a.prototype.prev=function(r){var i=this._root,u=null;if(r.left!==null){for(u=r.left;u.right;)u=u.right;return u}for(var l=this._comparator;i;){var f=l(r.key,i.key);if(f===0)break;f<0?i=i.left:(u=i,i=i.right)}return u},a.prototype.clear=function(){return this._root=null,this._size=0,this},a.prototype.toList=function(){return l0(this._root)},a.prototype.load=function(r,i,u){i===void 0&&(i=[]),u===void 0&&(u=!1);var l=r.length,f=this._comparator;if(u&&Pa(r,i,0,l-1,f),this._root===null)this._root=Ra(r,i,0,l),this._size=l;else{var v=c0(this.toList(),u0(r,i),f);l=this._size+l,this._root=Ma({head:v},0,l)}return this},a.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(a.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),a.prototype.toString=function(r){r===void 0&&(r=function(u){return String(u.key)});var i=[];return Ca(this._root,"",!0,function(u){return i.push(u)},r),i.join("")},a.prototype.update=function(r,i,u){var l=this._comparator,f=qc(r,this._root,l),v=f.left,y=f.right;l(r,i)<0?y=Ta(i,u,y,l):v=Ta(i,u,v,l),this._root=o0(v,y,l)},a.prototype.split=function(r){return qc(r,this._root,this._comparator)},a.prototype[Symbol.iterator]=function(){var r,i,u;return s0(this,function(l){switch(l.label){case 0:r=this._root,i=[],u=!1,l.label=1;case 1:return u?[3,6]:r===null?[3,2]:(i.push(r),r=r.left,[3,5]);case 2:return i.length===0?[3,4]:(r=i.pop(),[4,r]);case 3:return l.sent(),r=r.right,[3,5];case 4:u=!0,l.label=5;case 5:return[3,1];case 6:return[2]}})},a}();function Ra(a,r,i,u){var l=u-i;if(l>0){var f=i+Math.floor(l/2),v=a[f],y=r[f],m=new dn(v,y);return m.left=Ra(a,r,i,f),m.right=Ra(a,r,f+1,u),m}return null}function u0(a,r){for(var i=new dn(null,null),u=i,l=0;l<a.length;l++)u=u.next=new dn(a[l],r[l]);return u.next=null,i.next}function l0(a){for(var r=a,i=[],u=!1,l=new dn(null,null),f=l;!u;)r?(i.push(r),r=r.left):i.length>0?(r=f=f.next=i.pop(),r=r.right):u=!0;return f.next=null,l.next}function Ma(a,r,i){var u=i-r;if(u>0){var l=r+Math.floor(u/2),f=Ma(a,r,l),v=a.head;return v.left=f,a.head=a.head.next,v.right=Ma(a,l+1,i),v}return null}function c0(a,r,i){for(var u=new dn(null,null),l=u,f=a,v=r;f!==null&&v!==null;)i(f.key,v.key)<0?(l.next=f,f=f.next):(l.next=v,v=v.next),l=l.next;return f!==null?l.next=f:v!==null&&(l.next=v),u.next}function Pa(a,r,i,u,l){if(!(i>=u)){for(var f=a[i+u>>1],v=i-1,y=u+1;;){do v++;while(l(a[v],f)<0);do y--;while(l(a[y],f)>0);if(v>=y)break;var m=a[v];a[v]=a[y],a[y]=m,m=r[v],r[v]=r[y],r[y]=m}Pa(a,r,i,y,l),Pa(a,r,y+1,u,l)}}const en=11102230246251565e-32,Ke=134217729,f0=(3+8*en)*en;function Aa(a,r,i,u,l){let f,v,y,m,_=r[0],k=u[0],p=0,x=0;k>_==k>-_?(f=_,_=r[++p]):(f=k,k=u[++x]);let S=0;if(p<a&&x<i)for(k>_==k>-_?(v=_+f,y=f-(v-_),_=r[++p]):(v=k+f,y=f-(v-k),k=u[++x]),f=v,y!==0&&(l[S++]=y);p<a&&x<i;)k>_==k>-_?(v=f+_,m=v-f,y=f-(v-m)+(_-m),_=r[++p]):(v=f+k,m=v-f,y=f-(v-m)+(k-m),k=u[++x]),f=v,y!==0&&(l[S++]=y);for(;p<a;)v=f+_,m=v-f,y=f-(v-m)+(_-m),_=r[++p],f=v,y!==0&&(l[S++]=y);for(;x<i;)v=f+k,m=v-f,y=f-(v-m)+(k-m),k=u[++x],f=v,y!==0&&(l[S++]=y);return(f!==0||S===0)&&(l[S++]=f),S}function h0(a,r){let i=r[0];for(let u=1;u<a;u++)i+=r[u];return i}function zr(a){return new Float64Array(a)}const g0=(3+16*en)*en,y0=(2+12*en)*en,v0=(9+64*en)*en*en,or=zr(4),zc=zr(8),Uc=zr(12),Yc=zr(16),et=zr(4);function d0(a,r,i,u,l,f,v){let y,m,_,k,p,x,S,b,L,T,O,P,R,G,M,z,q,U;const A=a-l,H=i-l,ee=r-f,Z=u-f;G=A*Z,x=Ke*A,S=x-(x-A),b=A-S,x=Ke*Z,L=x-(x-Z),T=Z-L,M=b*T-(G-S*L-b*L-S*T),z=ee*H,x=Ke*ee,S=x-(x-ee),b=ee-S,x=Ke*H,L=x-(x-H),T=H-L,q=b*T-(z-S*L-b*L-S*T),O=M-q,p=M-O,or[0]=M-(O+p)+(p-q),P=G+O,p=P-G,R=G-(P-p)+(O-p),O=R-z,p=R-O,or[1]=R-(O+p)+(p-z),U=P+O,p=U-P,or[2]=P-(U-p)+(O-p),or[3]=U;let oe=h0(4,or),D=y0*v;if(oe>=D||-oe>=D||(p=a-A,y=a-(A+p)+(p-l),p=i-H,_=i-(H+p)+(p-l),p=r-ee,m=r-(ee+p)+(p-f),p=u-Z,k=u-(Z+p)+(p-f),y===0&&m===0&&_===0&&k===0)||(D=v0*v+f0*Math.abs(oe),oe+=A*k+Z*y-(ee*_+H*m),oe>=D||-oe>=D))return oe;G=y*Z,x=Ke*y,S=x-(x-y),b=y-S,x=Ke*Z,L=x-(x-Z),T=Z-L,M=b*T-(G-S*L-b*L-S*T),z=m*H,x=Ke*m,S=x-(x-m),b=m-S,x=Ke*H,L=x-(x-H),T=H-L,q=b*T-(z-S*L-b*L-S*T),O=M-q,p=M-O,et[0]=M-(O+p)+(p-q),P=G+O,p=P-G,R=G-(P-p)+(O-p),O=R-z,p=R-O,et[1]=R-(O+p)+(p-z),U=P+O,p=U-P,et[2]=P-(U-p)+(O-p),et[3]=U;const Q=Aa(4,or,4,et,zc);G=A*k,x=Ke*A,S=x-(x-A),b=A-S,x=Ke*k,L=x-(x-k),T=k-L,M=b*T-(G-S*L-b*L-S*T),z=ee*_,x=Ke*ee,S=x-(x-ee),b=ee-S,x=Ke*_,L=x-(x-_),T=_-L,q=b*T-(z-S*L-b*L-S*T),O=M-q,p=M-O,et[0]=M-(O+p)+(p-q),P=G+O,p=P-G,R=G-(P-p)+(O-p),O=R-z,p=R-O,et[1]=R-(O+p)+(p-z),U=P+O,p=U-P,et[2]=P-(U-p)+(O-p),et[3]=U;const ie=Aa(Q,zc,4,et,Uc);G=y*k,x=Ke*y,S=x-(x-y),b=y-S,x=Ke*k,L=x-(x-k),T=k-L,M=b*T-(G-S*L-b*L-S*T),z=m*_,x=Ke*m,S=x-(x-m),b=m-S,x=Ke*_,L=x-(x-_),T=_-L,q=b*T-(z-S*L-b*L-S*T),O=M-q,p=M-O,et[0]=M-(O+p)+(p-q),P=G+O,p=P-G,R=G-(P-p)+(O-p),O=R-z,p=R-O,et[1]=R-(O+p)+(p-z),U=P+O,p=U-P,et[2]=P-(U-p)+(O-p),et[3]=U;const me=Aa(ie,Uc,4,et,Yc);return Yc[me-1]}function m0(a,r,i,u,l,f){const v=(r-f)*(i-l),y=(a-l)*(u-f),m=v-y,_=Math.abs(v+y);return Math.abs(m)>=g0*_?m:-d0(a,r,i,u,l,f,_)}const Ur=(a,r)=>a.ll.x<=r.x&&r.x<=a.ur.x&&a.ll.y<=r.y&&r.y<=a.ur.y,Da=(a,r)=>{if(r.ur.x<a.ll.x||a.ur.x<r.ll.x||r.ur.y<a.ll.y||a.ur.y<r.ll.y)return null;const i=a.ll.x<r.ll.x?r.ll.x:a.ll.x,u=a.ur.x<r.ur.x?a.ur.x:r.ur.x,l=a.ll.y<r.ll.y?r.ll.y:a.ll.y,f=a.ur.y<r.ur.y?a.ur.y:r.ur.y;return{ll:{x:i,y:l},ur:{x:u,y:f}}};let pn=Number.EPSILON;pn===void 0&&(pn=Math.pow(2,-52));const p0=pn*pn,Wc=(a,r)=>{if(-pn<a&&a<pn&&-pn<r&&r<pn)return 0;const i=a-r;return i*i<p0*a*r?0:a<r?-1:1};class _0{constructor(){this.reset()}reset(){this.xRounder=new Xc,this.yRounder=new Xc}round(r,i){return{x:this.xRounder.round(r),y:this.yRounder.round(i)}}}class Xc{constructor(){this.tree=new Oa,this.round(0)}round(r){const i=this.tree.add(r),u=this.tree.prev(i);if(u!==null&&Wc(i.key,u.key)===0)return this.tree.remove(r),u.key;const l=this.tree.next(i);return l!==null&&Wc(i.key,l.key)===0?(this.tree.remove(r),l.key):r}}const Yr=new _0,Zi=(a,r)=>a.x*r.y-a.y*r.x,jc=(a,r)=>a.x*r.x+a.y*r.y,Vc=(a,r,i)=>{const u=m0(a.x,a.y,r.x,r.y,i.x,i.y);return u>0?-1:u<0?1:0},Qi=a=>Math.sqrt(jc(a,a)),E0=(a,r,i)=>{const u={x:r.x-a.x,y:r.y-a.y},l={x:i.x-a.x,y:i.y-a.y};return Zi(l,u)/Qi(l)/Qi(u)},k0=(a,r,i)=>{const u={x:r.x-a.x,y:r.y-a.y},l={x:i.x-a.x,y:i.y-a.y};return jc(l,u)/Qi(l)/Qi(u)},Hc=(a,r,i)=>r.y===0?null:{x:a.x+r.x/r.y*(i-a.y),y:i},Zc=(a,r,i)=>r.x===0?null:{x:i,y:a.y+r.y/r.x*(i-a.x)},x0=(a,r,i,u)=>{if(r.x===0)return Zc(i,u,a.x);if(u.x===0)return Zc(a,r,i.x);if(r.y===0)return Hc(i,u,a.y);if(u.y===0)return Hc(a,r,i.y);const l=Zi(r,u);if(l==0)return null;const f={x:i.x-a.x,y:i.y-a.y},v=Zi(f,r)/l,y=Zi(f,u)/l,m=a.x+y*r.x,_=i.x+v*u.x,k=a.y+y*r.y,p=i.y+v*u.y,x=(m+_)/2,S=(k+p)/2;return{x,y:S}};class _t{static compare(r,i){const u=_t.comparePoints(r.point,i.point);return u!==0?u:(r.point!==i.point&&r.link(i),r.isLeft!==i.isLeft?r.isLeft?1:-1:_n.compare(r.segment,i.segment))}static comparePoints(r,i){return r.x<i.x?-1:r.x>i.x?1:r.y<i.y?-1:r.y>i.y?1:0}constructor(r,i){r.events===void 0?r.events=[this]:r.events.push(this),this.point=r,this.isLeft=i}link(r){if(r.point===this.point)throw new Error("Tried to link already linked events");const i=r.point.events;for(let u=0,l=i.length;u<l;u++){const f=i[u];this.point.events.push(f),f.point=this.point}this.checkForConsuming()}checkForConsuming(){const r=this.point.events.length;for(let i=0;i<r;i++){const u=this.point.events[i];if(u.segment.consumedBy===void 0)for(let l=i+1;l<r;l++){const f=this.point.events[l];f.consumedBy===void 0&&u.otherSE.point.events===f.otherSE.point.events&&u.segment.consume(f.segment)}}}getAvailableLinkedEvents(){const r=[];for(let i=0,u=this.point.events.length;i<u;i++){const l=this.point.events[i];l!==this&&!l.segment.ringOut&&l.segment.isInResult()&&r.push(l)}return r}getLeftmostComparator(r){const i=new Map,u=l=>{const f=l.otherSE;i.set(l,{sine:E0(this.point,r.point,f.point),cosine:k0(this.point,r.point,f.point)})};return(l,f)=>{i.has(l)||u(l),i.has(f)||u(f);const{sine:v,cosine:y}=i.get(l),{sine:m,cosine:_}=i.get(f);return v>=0&&m>=0?y<_?1:y>_?-1:0:v<0&&m<0?y<_?-1:y>_?1:0:m<v?-1:m>v?1:0}}}let S0=0;class _n{static compare(r,i){const u=r.leftSE.point.x,l=i.leftSE.point.x,f=r.rightSE.point.x,v=i.rightSE.point.x;if(v<u)return 1;if(f<l)return-1;const y=r.leftSE.point.y,m=i.leftSE.point.y,_=r.rightSE.point.y,k=i.rightSE.point.y;if(u<l){if(m<y&&m<_)return 1;if(m>y&&m>_)return-1;const p=r.comparePoint(i.leftSE.point);if(p<0)return 1;if(p>0)return-1;const x=i.comparePoint(r.rightSE.point);return x!==0?x:-1}if(u>l){if(y<m&&y<k)return-1;if(y>m&&y>k)return 1;const p=i.comparePoint(r.leftSE.point);if(p!==0)return p;const x=r.comparePoint(i.rightSE.point);return x<0?1:x>0?-1:1}if(y<m)return-1;if(y>m)return 1;if(f<v){const p=i.comparePoint(r.rightSE.point);if(p!==0)return p}if(f>v){const p=r.comparePoint(i.rightSE.point);if(p<0)return 1;if(p>0)return-1}if(f!==v){const p=_-y,x=f-u,S=k-m,b=v-l;if(p>x&&S<b)return 1;if(p<x&&S>b)return-1}return f>v?1:f<v||_<k?-1:_>k?1:r.id<i.id?-1:r.id>i.id?1:0}constructor(r,i,u,l){this.id=++S0,this.leftSE=r,r.segment=this,r.otherSE=i,this.rightSE=i,i.segment=this,i.otherSE=r,this.rings=u,this.windings=l}static fromRing(r,i,u){let l,f,v;const y=_t.comparePoints(r,i);if(y<0)l=r,f=i,v=1;else if(y>0)l=i,f=r,v=-1;else throw new Error(`Tried to create degenerate segment at [${r.x}, ${r.y}]`);const m=new _t(l,!0),_=new _t(f,!1);return new _n(m,_,[u],[v])}replaceRightSE(r){this.rightSE=r,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const r=this.leftSE.point.y,i=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:r<i?r:i},ur:{x:this.rightSE.point.x,y:r>i?r:i}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(r){return r.x===this.leftSE.point.x&&r.y===this.leftSE.point.y||r.x===this.rightSE.point.x&&r.y===this.rightSE.point.y}comparePoint(r){if(this.isAnEndpoint(r))return 0;const i=this.leftSE.point,u=this.rightSE.point,l=this.vector();if(i.x===u.x)return r.x===i.x?0:r.x<i.x?1:-1;const f=(r.y-i.y)/l.y,v=i.x+f*l.x;if(r.x===v)return 0;const y=(r.x-i.x)/l.x,m=i.y+y*l.y;return r.y===m?0:r.y<m?-1:1}getIntersection(r){const i=this.bbox(),u=r.bbox(),l=Da(i,u);if(l===null)return null;const f=this.leftSE.point,v=this.rightSE.point,y=r.leftSE.point,m=r.rightSE.point,_=Ur(i,y)&&this.comparePoint(y)===0,k=Ur(u,f)&&r.comparePoint(f)===0,p=Ur(i,m)&&this.comparePoint(m)===0,x=Ur(u,v)&&r.comparePoint(v)===0;if(k&&_)return x&&!p?v:!x&&p?m:null;if(k)return p&&f.x===m.x&&f.y===m.y?null:f;if(_)return x&&v.x===y.x&&v.y===y.y?null:y;if(x&&p)return null;if(x)return v;if(p)return m;const S=x0(f,this.vector(),y,r.vector());return S===null||!Ur(l,S)?null:Yr.round(S.x,S.y)}split(r){const i=[],u=r.events!==void 0,l=new _t(r,!0),f=new _t(r,!1),v=this.rightSE;this.replaceRightSE(f),i.push(f),i.push(l);const y=new _n(l,v,this.rings.slice(),this.windings.slice());return _t.comparePoints(y.leftSE.point,y.rightSE.point)>0&&y.swapEvents(),_t.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),u&&(l.checkForConsuming(),f.checkForConsuming()),i}swapEvents(){const r=this.rightSE;this.rightSE=this.leftSE,this.leftSE=r,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let i=0,u=this.windings.length;i<u;i++)this.windings[i]*=-1}consume(r){let i=this,u=r;for(;i.consumedBy;)i=i.consumedBy;for(;u.consumedBy;)u=u.consumedBy;const l=_n.compare(i,u);if(l!==0){if(l>0){const f=i;i=u,u=f}if(i.prev===u){const f=i;i=u,u=f}for(let f=0,v=u.rings.length;f<v;f++){const y=u.rings[f],m=u.windings[f],_=i.rings.indexOf(y);_===-1?(i.rings.push(y),i.windings.push(m)):i.windings[_]+=m}u.rings=null,u.windings=null,u.consumedBy=i,u.leftSE.consumedBy=i.leftSE,u.rightSE.consumedBy=i.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 r=this.prev.consumedBy||this.prev;this._beforeState=r.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const r=this.beforeState();this._afterState={rings:r.rings.slice(0),windings:r.windings.slice(0),multiPolys:[]};const i=this._afterState.rings,u=this._afterState.windings,l=this._afterState.multiPolys;for(let y=0,m=this.rings.length;y<m;y++){const _=this.rings[y],k=this.windings[y],p=i.indexOf(_);p===-1?(i.push(_),u.push(k)):u[p]+=k}const f=[],v=[];for(let y=0,m=i.length;y<m;y++){if(u[y]===0)continue;const _=i[y],k=_.poly;if(v.indexOf(k)===-1)if(_.isExterior)f.push(k);else{v.indexOf(k)===-1&&v.push(k);const p=f.indexOf(_.poly);p!==-1&&f.splice(p,1)}}for(let y=0,m=f.length;y<m;y++){const _=f[y].multiPoly;l.indexOf(_)===-1&&l.push(_)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const r=this.beforeState().multiPolys,i=this.afterState().multiPolys;switch(Rt.type){case"union":{const u=r.length===0,l=i.length===0;this._isInResult=u!==l;break}case"intersection":{let u,l;r.length<i.length?(u=r.length,l=i.length):(u=i.length,l=r.length),this._isInResult=l===Rt.numMultiPolys&&u<l;break}case"xor":{const u=Math.abs(r.length-i.length);this._isInResult=u%2===1;break}case"difference":{const u=l=>l.length===1&&l[0].isSubject;this._isInResult=u(r)!==u(i);break}default:throw new Error(`Unrecognized operation type found ${Rt.type}`)}return this._isInResult}}class Qc{constructor(r,i,u){if(!Array.isArray(r)||r.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=i,this.isExterior=u,this.segments=[],typeof r[0][0]!="number"||typeof r[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const l=Yr.round(r[0][0],r[0][1]);this.bbox={ll:{x:l.x,y:l.y},ur:{x:l.x,y:l.y}};let f=l;for(let v=1,y=r.length;v<y;v++){if(typeof r[v][0]!="number"||typeof r[v][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let m=Yr.round(r[v][0],r[v][1]);m.x===f.x&&m.y===f.y||(this.segments.push(_n.fromRing(f,m,this)),m.x<this.bbox.ll.x&&(this.bbox.ll.x=m.x),m.y<this.bbox.ll.y&&(this.bbox.ll.y=m.y),m.x>this.bbox.ur.x&&(this.bbox.ur.x=m.x),m.y>this.bbox.ur.y&&(this.bbox.ur.y=m.y),f=m)}(l.x!==f.x||l.y!==f.y)&&this.segments.push(_n.fromRing(f,l,this))}getSweepEvents(){const r=[];for(let i=0,u=this.segments.length;i<u;i++){const l=this.segments[i];r.push(l.leftSE),r.push(l.rightSE)}return r}}class b0{constructor(r,i){if(!Array.isArray(r))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Qc(r[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 u=1,l=r.length;u<l;u++){const f=new Qc(r[u],this,!1);f.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=f.bbox.ll.x),f.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=f.bbox.ll.y),f.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=f.bbox.ur.x),f.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=f.bbox.ur.y),this.interiorRings.push(f)}this.multiPoly=i}getSweepEvents(){const r=this.exteriorRing.getSweepEvents();for(let i=0,u=this.interiorRings.length;i<u;i++){const l=this.interiorRings[i].getSweepEvents();for(let f=0,v=l.length;f<v;f++)r.push(l[f])}return r}}class Kc{constructor(r,i){if(!Array.isArray(r))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof r[0][0][0]=="number"&&(r=[r])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let u=0,l=r.length;u<l;u++){const f=new b0(r[u],this);f.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=f.bbox.ll.x),f.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=f.bbox.ll.y),f.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=f.bbox.ur.x),f.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=f.bbox.ur.y),this.polys.push(f)}this.isSubject=i}getSweepEvents(){const r=[];for(let i=0,u=this.polys.length;i<u;i++){const l=this.polys[i].getSweepEvents();for(let f=0,v=l.length;f<v;f++)r.push(l[f])}return r}}class Ki{static factory(r){const i=[];for(let u=0,l=r.length;u<l;u++){const f=r[u];if(!f.isInResult()||f.ringOut)continue;let v=null,y=f.leftSE,m=f.rightSE;const _=[y],k=y.point,p=[];for(;v=y,y=m,_.push(y),y.point!==k;)for(;;){const x=y.getAvailableLinkedEvents();if(x.length===0){const L=_[0].point,T=_[_.length-1].point;throw new Error(`Unable to complete output ring starting at [${L.x}, ${L.y}]. Last matching segment found ends at [${T.x}, ${T.y}].`)}if(x.length===1){m=x[0].otherSE;break}let S=null;for(let L=0,T=p.length;L<T;L++)if(p[L].point===y.point){S=L;break}if(S!==null){const L=p.splice(S)[0],T=_.splice(L.index);T.unshift(T[0].otherSE),i.push(new Ki(T.reverse()));continue}p.push({index:_.length,point:y.point});const b=y.getLeftmostComparator(v);m=x.sort(b)[0].otherSE;break}i.push(new Ki(_))}return i}constructor(r){this.events=r;for(let i=0,u=r.length;i<u;i++)r[i].segment.ringOut=this;this.poly=null}getGeom(){let r=this.events[0].point;const i=[r];for(let _=1,k=this.events.length-1;_<k;_++){const p=this.events[_].point,x=this.events[_+1].point;Vc(p,r,x)!==0&&(i.push(p),r=p)}if(i.length===1)return null;const u=i[0],l=i[1];Vc(u,r,l)===0&&i.shift(),i.push(i[0]);const f=this.isExteriorRing()?1:-1,v=this.isExteriorRing()?0:i.length-1,y=this.isExteriorRing()?i.length:-1,m=[];for(let _=v;_!=y;_+=f)m.push([i[_].x,i[_].y]);return m}isExteriorRing(){if(this._isExteriorRing===void 0){const r=this.enclosingRing();this._isExteriorRing=r?!r.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let r=this.events[0];for(let l=1,f=this.events.length;l<f;l++){const v=this.events[l];_t.compare(r,v)>0&&(r=v)}let i=r.segment.prevInResult(),u=i?i.prevInResult():null;for(;;){if(!i)return null;if(!u)return i.ringOut;if(u.ringOut!==i.ringOut)return u.ringOut.enclosingRing()!==i.ringOut?i.ringOut:i.ringOut.enclosingRing();i=u.prevInResult(),u=i?i.prevInResult():null}}}class Jc{constructor(r){this.exteriorRing=r,r.poly=this,this.interiorRings=[]}addInterior(r){this.interiorRings.push(r),r.poly=this}getGeom(){const r=[this.exteriorRing.getGeom()];if(r[0]===null)return null;for(let i=0,u=this.interiorRings.length;i<u;i++){const l=this.interiorRings[i].getGeom();l!==null&&r.push(l)}return r}}class I0{constructor(r){this.rings=r,this.polys=this._composePolys(r)}getGeom(){const r=[];for(let i=0,u=this.polys.length;i<u;i++){const l=this.polys[i].getGeom();l!==null&&r.push(l)}return r}_composePolys(r){const i=[];for(let u=0,l=r.length;u<l;u++){const f=r[u];if(!f.poly)if(f.isExteriorRing())i.push(new Jc(f));else{const v=f.enclosingRing();v.poly||i.push(new Jc(v)),v.poly.addInterior(f)}}return i}}class w0{constructor(r){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_n.compare;this.queue=r,this.tree=new Oa(i),this.segments=[]}process(r){const i=r.segment,u=[];if(r.consumedBy)return r.isLeft?this.queue.remove(r.otherSE):this.tree.remove(i),u;const l=r.isLeft?this.tree.add(i):this.tree.find(i);if(!l)throw new Error(`Unable to find segment #${i.id} [${i.leftSE.point.x}, ${i.leftSE.point.y}] -> [${i.rightSE.point.x}, ${i.rightSE.point.y}] in SweepLine tree.`);let f=l,v=l,y,m;for(;y===void 0;)f=this.tree.prev(f),f===null?y=null:f.key.consumedBy===void 0&&(y=f.key);for(;m===void 0;)v=this.tree.next(v),v===null?m=null:v.key.consumedBy===void 0&&(m=v.key);if(r.isLeft){let _=null;if(y){const p=y.getIntersection(i);if(p!==null&&(i.isAnEndpoint(p)||(_=p),!y.isAnEndpoint(p))){const x=this._splitSafely(y,p);for(let S=0,b=x.length;S<b;S++)u.push(x[S])}}let k=null;if(m){const p=m.getIntersection(i);if(p!==null&&(i.isAnEndpoint(p)||(k=p),!m.isAnEndpoint(p))){const x=this._splitSafely(m,p);for(let S=0,b=x.length;S<b;S++)u.push(x[S])}}if(_!==null||k!==null){let p=null;_===null?p=k:k===null?p=_:p=_t.comparePoints(_,k)<=0?_:k,this.queue.remove(i.rightSE),u.push(i.rightSE);const x=i.split(p);for(let S=0,b=x.length;S<b;S++)u.push(x[S])}u.length>0?(this.tree.remove(i),u.push(r)):(this.segments.push(i),i.prev=y)}else{if(y&&m){const _=y.getIntersection(m);if(_!==null){if(!y.isAnEndpoint(_)){const k=this._splitSafely(y,_);for(let p=0,x=k.length;p<x;p++)u.push(k[p])}if(!m.isAnEndpoint(_)){const k=this._splitSafely(m,_);for(let p=0,x=k.length;p<x;p++)u.push(k[p])}}}this.tree.remove(i)}return u}_splitSafely(r,i){this.tree.remove(r);const u=r.rightSE;this.queue.remove(u);const l=r.split(i);return l.push(u),r.consumedBy===void 0&&this.tree.add(r),l}}const $c=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,N0=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class L0{run(r,i,u){Rt.type=r,Yr.reset();const l=[new Kc(i,!0)];for(let p=0,x=u.length;p<x;p++)l.push(new Kc(u[p],!1));if(Rt.numMultiPolys=l.length,Rt.type==="difference"){const p=l[0];let x=1;for(;x<l.length;)Da(l[x].bbox,p.bbox)!==null?x++:l.splice(x,1)}if(Rt.type==="intersection")for(let p=0,x=l.length;p<x;p++){const S=l[p];for(let b=p+1,L=l.length;b<L;b++)if(Da(S.bbox,l[b].bbox)===null)return[]}const f=new Oa(_t.compare);for(let p=0,x=l.length;p<x;p++){const S=l[p].getSweepEvents();for(let b=0,L=S.length;b<L;b++)if(f.insert(S[b]),f.size>$c)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const v=new w0(f);let y=f.size,m=f.pop();for(;m;){const p=m.key;if(f.size===y){const S=p.segment;throw new Error(`Unable to pop() ${p.isLeft?"left":"right"} SweepEvent [${p.point.x}, ${p.point.y}] from segment #${S.id} [${S.leftSE.point.x}, ${S.leftSE.point.y}] -> [${S.rightSE.point.x}, ${S.rightSE.point.y}] from queue.`)}if(f.size>$c)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(v.segments.length>N0)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const x=v.process(p);for(let S=0,b=x.length;S<b;S++){const L=x[S];L.consumedBy===void 0&&f.insert(L)}y=f.size,m=f.pop()}Yr.reset();const _=Ki.factory(v.segments);return new I0(_).getGeom()}}const Rt=new L0;var T0={union:function(a){for(var r=arguments.length,i=new Array(r>1?r-1:0),u=1;u<r;u++)i[u-1]=arguments[u];return Rt.run("union",a,i)},intersection:function(a){for(var r=arguments.length,i=new Array(r>1?r-1:0),u=1;u<r;u++)i[u-1]=arguments[u];return Rt.run("intersection",a,i)},xor:function(a){for(var r=arguments.length,i=new Array(r>1?r-1:0),u=1;u<r;u++)i[u-1]=arguments[u];return Rt.run("xor",a,i)},difference:function(a){for(var r=arguments.length,i=new Array(r>1?r-1:0),u=1;u<r;u++)i[u-1]=arguments[u];return Rt.run("difference",a,i)}},C0=Object.defineProperty,O0=(a,r)=>C0(a,"name",{value:r,configurable:!0});function ef(a){const r=[];if(tr(a,l=>{r.push(l.coordinates)}),r.length<2)throw new Error("Must have at least two features");const i=a.features[0].properties||{},u=T0.difference(r[0],...r.slice(1));return u.length===0?null:u.length===1?Dr(u[0],i):da(u,i)}O0(ef,"difference");var R0=ef;function tf(a){let r;for(const i of a)r&&i[0]-r[0]>=180?i[0]-=360:r&&i[0]-r[0]<-180&&(i[0]+=360),r=i}function nf(a,r){const i=R0($t([Dr([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),a]));if(!i)return;i.properties={isMask:"y"};const u=i0(a,0);if(u){if(u.geometry.type==="Polygon")for(const l of u.geometry.coordinates)tf(l);else for(const l of u.geometry.coordinates)for(const f of l)tf(f);r($t([u,i]))}}const rf="EPSG:4326";function M0(a){var f;const r=a.getProperties(),{isMask:i}=r,u=(f=a.getGeometry())==null?void 0:f.getType(),l=i?0:u==="LineString"||u==="MultiLineString"?3:2;return new th({stroke:i?void 0:new so({color:"#3170fe",lineDash:[l,l],width:l,lineCap:"butt"}),fill:i?new io({color:"#00000020"}):void 0,image:new eh({src:`/icons/marker_${r.isReverse?"reverse":r.isSelected?"selected":"unselected"}.svg`,anchor:[.5,1]}),zIndex:r.isSelected?2:r.isReverse?0:1,text:r.isSelected&&r.tooltip?new nh({backgroundFill:new io({color:"white"}),text:r.tooltip,offsetY:-40,backgroundStroke:new so({color:"white",lineJoin:"round",width:3}),padding:[2,0,0,2]}):void 0})}function sf(a,r={},i={},u=M0){let l=-1,f,v,y,m=!1;const _=new Jf({updateWhileAnimating:!0});a.addLayer(_);const k=new $f({});_.setSource(k),_.setStyle(u),a.on("click",b=>{a.forEachFeatureAtPixel(b.pixel,L=>{const T=L.getId();if(T)return b.stopPropagation(),v==null||v({type:"markerClick",id:T}),L})}),a.on("pointermove",b=>{const L=a.forEachFeatureAtPixel(b.pixel,T=>T.getId());f!==L&&(f&&(v==null||v({type:"markerMouseLeave",id:f})),L&&(v==null||v({type:"markerMouseEnter",id:L})),a.getTargetElement().style.cursor=L?"pointer":m?"crosshair":"",f=L)});function p(){return an.getUserProjection()??a.getView().getProjection()}function x(b){return b.transform(rf,p())}const S=b=>{v==null||v({type:"mapClick",coordinates:an.toLonLat(b.coordinate,p())})};return{setEventHandler(b){b?(v=b,a.on("click",S)):(v=void 0,a.un("click",S))},flyTo(b,L){a.getView().animate({center:an.fromLonLat(b,p()),zoom:L,duration:2e3,...r})},fitBounds(b,L,T){a.getView().fit(an.transformExtent(b,rf,p()),{padding:[L,L,L,L],maxZoom:T,duration:2e3,...i})},indicateReverse(b){m=b,a.getTargetElement().style.cursor=b?"crosshair":""},setReverseMarker(b){y?b?y.getGeometry().setCoordinates(an.fromLonLat(b,p())):(k.removeFeature(y),y.dispose(),y=void 0):b&&(y=new vt.Feature(new dt.Point(an.fromLonLat(b,p()))),y.setProperties({isReverse:!0}),k.addFeature(y))},setMarkers(b,L){function T(O){var P;if(O)for(const R of O.features){const G=R.geometry.type==="Polygon"?new dt.Polygon(R.geometry.coordinates):R.geometry.type==="MultiPolygon"?new dt.MultiPolygon(R.geometry.coordinates):null;G&&k.addFeature(new vt.Feature({isMask:!!((P=R.properties)!=null&&P.isMask),geometry:x(G)}))}}if(k.clear(),y&&k.addFeature(y),T(),L){let O=!1;if(L.geometry.type==="GeometryCollection"){const P=L.geometry.geometries.map(R=>R.type==="Polygon"?new dt.Polygon(R.coordinates):R.type==="MultiPolygon"?new dt.MultiPolygon(R.coordinates):null).filter(R=>!!R);if(P.length>0)k.addFeature(new vt.Feature(x(new dt.GeometryCollection(P)))),O=!0;else for(const R of L.geometry.geometries)R.type==="LineString"?(k.addFeature(new vt.Feature(x(new dt.LineString(R.coordinates)))),O=!0):R.type==="MultiLineString"&&k.addFeature(new vt.Feature(x(new dt.MultiLineString(R.coordinates)))),O=!0}if(!O){if(L.geometry.type==="Polygon")nf(L,T);else if(L.geometry.type==="MultiPolygon")nf(L,T);else if(L.geometry.type==="LineString"){k.addFeature(new vt.Feature(x(new dt.LineString(L.geometry.coordinates))));return}else if(L.geometry.type==="MultiLineString"){k.addFeature(new vt.Feature(x(new dt.MultiLineString(L.geometry.coordinates))));return}}k.addFeature(new vt.Feature(x(new dt.Point(L.center))))}for(const O of b??[]){if(O===L)continue;const P=new vt.Feature(new dt.Point(an.fromLonLat(O.center,p())));P.setId(O.id),P.setProperties({fuzzy:!!O.matching_text,tooltip:O.place_type[0]==="reverse"?O.place_name:O.place_name.replace(/,.*/,"")}),k.addFeature(P)}},setSelectedMarker(b){var O,P,R;const L=k.getFeatures(),T=(O=L[0])!=null&&O.getProperties().isReverse?1:0;l>-1&&((P=L[l+T])==null||P.setProperties({isSelected:!1})),b>-1&&((R=L[b+T])==null||R.setProperties({isSelected:!0})),l=b},getCenterAndZoom(){const b=a.getView(),L=b.getCenter(),T=b.getZoom();if(!(!L||T===void 0))return[T,...an.toLonLat(L,p())]}}}class P0 extends be.Control{constructor(i){const u=document.createElement("div");u.className="ol-search";super({element:u,target:i.target});ro(this,Et);ro(this,On);const{flyTo:l,fullGeometryStyle:f,...v}=i;us(this,Et,new og({target:u,props:{flyTo:l===void 0?!0:!!l,...v}}));for(const y of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])Dt(this,Et).$on(y,m=>{switch(y){case"select":this.dispatchEvent(new af(m.detail));break;case"featuresListed":this.dispatchEvent(new of(m.detail));break;case"featuresMarked":this.dispatchEvent(new uf(m.detail));break;case"optionsVisibilityChange":this.dispatchEvent(new lf(m.detail));break;case"pick":this.dispatchEvent(new cf(m.detail));break;case"queryChange":this.dispatchEvent(new ff(m.detail));break;case"response":this.dispatchEvent(new hf(m.detail.url,m.detail.featureCollection));break;case"reverseToggle":this.dispatchEvent(new gf(m.detail));break}});us(this,On,i)}setMap(i){var u;if(super.setMap(i),i){const{flyTo:l,fullGeometryStyle:f}=Dt(this,On),v=sf(i,typeof l=="boolean"?void 0:l,typeof l=="boolean"?void 0:l,f);(u=Dt(this,Et))==null||u.$set({mapController:v})}}setOptions(i){var v;us(this,On,i);const{flyTo:u,fullGeometryStyle:l,...f}=Dt(this,On);(v=Dt(this,Et))==null||v.$set({...f,flyTo:u===void 0?!0:!!u})}setQuery(i,u=!0){var l;(l=Dt(this,Et))==null||l.setQuery(i,u)}clearMap(){var i;(i=Dt(this,Et))==null||i.clearMap()}clearList(){var i;(i=Dt(this,Et))==null||i.clearList()}focus(){var i;(i=Dt(this,Et))==null||i.focus()}blur(){var i;(i=Dt(this,Et))==null||i.blur()}}Et=new WeakMap,On=new WeakMap;class af extends Oe{constructor(i){super("select");Lt(this,"feature");this.feature=i}}class of extends Oe{constructor(i){super("featuresListed");Lt(this,"features");this.features=i}}class uf extends Oe{constructor(i){super("featuresMarked");Lt(this,"features");this.features=i}}class lf extends Oe{constructor(i){super("optionsVisibilityChange");Lt(this,"optionsVisible");this.optionsVisible=i}}class cf extends Oe{constructor(i){super("pick");Lt(this,"feature");this.feature=i}}class ff extends Oe{constructor(i){super("queryChange");Lt(this,"query");this.query=i}}class hf extends Oe{constructor(i,u){super("response");Lt(this,"url");Lt(this,"featureCollection");this.url=i,this.featureCollection=u}}class gf extends Oe{constructor(i){super("reverseToggle");Lt(this,"reverse");this.reverse=i}}se.FeaturesListedEvent=of,se.FeaturesMarkedEvent=uf,se.GeocodingControl=P0,se.OptionsVisibilityChangeEvent=lf,se.PickEvent=cf,se.QueryChangeEvent=ff,se.ResponseEvent=hf,se.ReverseToggleEvent=gf,se.SelectEvent=af,se.createOpenLayersMapController=sf,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})});
21
+ ***************************************************************************** */function cr(n,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(u){return function(d){return c([u,d])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,r&&(o=u[0]&2?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,r=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(n,t)}catch(d){u=[6,d],r=0}finally{i=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var xe=function(){function n(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null}return n}();function fr(n,e){return n>e?1:n<e?-1:0}function Me(n,e,t){for(var i=new xe(null,null),r=i,o=i;;){var l=t(n,e.key);if(l<0){if(e.left===null)break;if(t(n,e.left.key)<0){var s=e.left;if(e.left=s.right,s.right=e,e=s,e.left===null)break}o.left=e,o=e,e=e.left}else if(l>0){if(e.right===null)break;if(t(n,e.right.key)>0){var s=e.right;if(e.right=s.left,s.left=e,e=s,e.right===null)break}r.right=e,r=e,e=e.right}else break}return r.right=e.left,o.left=e.right,e.left=i.right,e.right=i.left,e}function Lt(n,e,t,i){var r=new xe(n,e);if(t===null)return r.left=r.right=null,r;t=Me(n,t,i);var o=i(n,t.key);return o<0?(r.left=t.left,r.right=t,t.left=null):o>=0&&(r.right=t.right,r.left=t,t.right=null),r}function bi(n,e,t){var i=null,r=null;if(e){e=Me(n,e,t);var o=t(e.key,n);o===0?(i=e.left,r=e.right):o<0?(r=e.right,e.right=null,i=e):(i=e.left,e.left=null,r=e)}return{left:i,right:r}}function dr(n,e,t){return e===null?n:(n===null||(e=Me(n.key,e,t),e.left=n),e)}function St(n,e,t,i,r){if(n){i(""+e+(t?"└── ":"├── ")+r(n)+`
22
+ `);var o=e+(t?" ":"│ ");n.left&&St(n.left,o,!1,i,r),n.right&&St(n.right,o,!0,i,r)}}var xt=function(){function n(e){e===void 0&&(e=fr),this._root=null,this._size=0,this._comparator=e}return n.prototype.insert=function(e,t){return this._size++,this._root=Lt(e,t,this._root,this._comparator)},n.prototype.add=function(e,t){var i=new xe(e,t);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var r=this._comparator,o=Me(e,this._root,r),l=r(e,o.key);return l===0?this._root=o:(l<0?(i.left=o.left,i.right=o,o.left=null):l>0&&(i.right=o.right,i.left=o,o.right=null),this._size++,this._root=i),this._root},n.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},n.prototype._remove=function(e,t,i){var r;if(t===null)return null;t=Me(e,t,i);var o=i(e,t.key);return o===0?(t.left===null?r=t.right:(r=Me(e,t.left,i),r.right=t.right),this._size--,r):t},n.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=Me(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},n.prototype.findStatic=function(e){for(var t=this._root,i=this._comparator;t;){var r=i(e,t.key);if(r===0)return t;r<0?t=t.left:t=t.right}return null},n.prototype.find=function(e){return this._root&&(this._root=Me(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},n.prototype.contains=function(e){for(var t=this._root,i=this._comparator;t;){var r=i(e,t.key);if(r===0)return!0;r<0?t=t.left:t=t.right}return!1},n.prototype.forEach=function(e,t){for(var i=this._root,r=[],o=!1;!o;)i!==null?(r.push(i),i=i.left):r.length!==0?(i=r.pop(),e.call(t,i),i=i.right):o=!0;return this},n.prototype.range=function(e,t,i,r){for(var o=[],l=this._comparator,s=this._root,c;o.length!==0||s;)if(s)o.push(s),s=s.left;else{if(s=o.pop(),c=l(s.key,t),c>0)break;if(l(s.key,e)>=0&&i.call(r,s))return this;s=s.right}return this},n.prototype.keys=function(){var e=[];return this.forEach(function(t){var i=t.key;return e.push(i)}),e},n.prototype.values=function(){var e=[];return this.forEach(function(t){var i=t.data;return e.push(i)}),e},n.prototype.min=function(){return this._root?this.minNode(this._root).key:null},n.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},n.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},n.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},n.prototype.at=function(e){for(var t=this._root,i=!1,r=0,o=[];!i;)if(t)o.push(t),t=t.left;else if(o.length>0){if(t=o.pop(),r===e)return t;r++,t=t.right}else i=!0;return null},n.prototype.next=function(e){var t=this._root,i=null;if(e.right){for(i=e.right;i.left;)i=i.left;return i}for(var r=this._comparator;t;){var o=r(e.key,t.key);if(o===0)break;o<0?(i=t,t=t.left):t=t.right}return i},n.prototype.prev=function(e){var t=this._root,i=null;if(e.left!==null){for(i=e.left;i.right;)i=i.right;return i}for(var r=this._comparator;t;){var o=r(e.key,t.key);if(o===0)break;o<0?t=t.left:(i=t,t=t.right)}return i},n.prototype.clear=function(){return this._root=null,this._size=0,this},n.prototype.toList=function(){return gr(this._root)},n.prototype.load=function(e,t,i){t===void 0&&(t=[]),i===void 0&&(i=!1);var r=e.length,o=this._comparator;if(i&&Ct(e,t,0,r-1,o),this._root===null)this._root=Mt(e,t,0,r),this._size=r;else{var l=mr(this.toList(),hr(e,t),o);r=this._size+r,this._root=kt({head:l},0,r)}return this},n.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(n.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),n.prototype.toString=function(e){e===void 0&&(e=function(i){return String(i.key)});var t=[];return St(this._root,"",!0,function(i){return t.push(i)},e),t.join("")},n.prototype.update=function(e,t,i){var r=this._comparator,o=bi(e,this._root,r),l=o.left,s=o.right;r(e,t)<0?s=Lt(t,i,s,r):l=Lt(t,i,l,r),this._root=dr(l,s,r)},n.prototype.split=function(e){return bi(e,this._root,this._comparator)},n.prototype[Symbol.iterator]=function(){var e,t,i;return cr(this,function(r){switch(r.label){case 0:e=this._root,t=[],i=!1,r.label=1;case 1:return i?[3,6]:e===null?[3,2]:(t.push(e),e=e.left,[3,5]);case 2:return t.length===0?[3,4]:(e=t.pop(),[4,e]);case 3:return r.sent(),e=e.right,[3,5];case 4:i=!0,r.label=5;case 5:return[3,1];case 6:return[2]}})},n}();function Mt(n,e,t,i){var r=i-t;if(r>0){var o=t+Math.floor(r/2),l=n[o],s=e[o],c=new xe(l,s);return c.left=Mt(n,e,t,o),c.right=Mt(n,e,o+1,i),c}return null}function hr(n,e){for(var t=new xe(null,null),i=t,r=0;r<n.length;r++)i=i.next=new xe(n[r],e[r]);return i.next=null,t.next}function gr(n){for(var e=n,t=[],i=!1,r=new xe(null,null),o=r;!i;)e?(t.push(e),e=e.left):t.length>0?(e=o=o.next=t.pop(),e=e.right):i=!0;return o.next=null,r.next}function kt(n,e,t){var i=t-e;if(i>0){var r=e+Math.floor(i/2),o=kt(n,e,r),l=n.head;return l.left=o,n.head=n.head.next,l.right=kt(n,r+1,t),l}return null}function mr(n,e,t){for(var i=new xe(null,null),r=i,o=n,l=e;o!==null&&l!==null;)t(o.key,l.key)<0?(r.next=o,o=o.next):(r.next=l,l=l.next),r=r.next;return o!==null?r.next=o:l!==null&&(r.next=l),i.next}function Ct(n,e,t,i,r){if(!(t>=i)){for(var o=n[t+i>>1],l=t-1,s=i+1;;){do l++;while(r(n[l],o)<0);do s--;while(r(n[s],o)>0);if(l>=s)break;var c=n[l];n[l]=n[s],n[s]=c,c=e[l],e[l]=e[s],e[s]=c}Ct(n,e,t,s,r),Ct(n,e,s+1,i,r)}}const we=11102230246251565e-32,$=134217729,yr=(3+8*we)*we;function Nt(n,e,t,i,r){let o,l,s,c,u=e[0],d=i[0],a=0,f=0;d>u==d>-u?(o=u,u=e[++a]):(o=d,d=i[++f]);let h=0;if(a<n&&f<t)for(d>u==d>-u?(l=u+o,s=o-(l-u),u=e[++a]):(l=d+o,s=o-(l-d),d=i[++f]),o=l,s!==0&&(r[h++]=s);a<n&&f<t;)d>u==d>-u?(l=o+u,c=l-o,s=o-(l-c)+(u-c),u=e[++a]):(l=o+d,c=l-o,s=o-(l-c)+(d-c),d=i[++f]),o=l,s!==0&&(r[h++]=s);for(;a<n;)l=o+u,c=l-o,s=o-(l-c)+(u-c),u=e[++a],o=l,s!==0&&(r[h++]=s);for(;f<t;)l=o+d,c=l-o,s=o-(l-c)+(d-c),d=i[++f],o=l,s!==0&&(r[h++]=s);return(o!==0||h===0)&&(r[h++]=o),h}function pr(n,e){let t=e[0];for(let i=1;i<n;i++)t+=e[i];return t}function Ye(n){return new Float64Array(n)}const vr=(3+16*we)*we,br=(2+12*we)*we,wr=(9+64*we)*we*we,Ue=Ye(4),wi=Ye(8),_i=Ye(12),Ei=Ye(16),te=Ye(4);function _r(n,e,t,i,r,o,l){let s,c,u,d,a,f,h,m,y,b,p,E,_,x,N,S,L,w;const C=n-r,O=t-r,U=e-o,j=i-o;x=C*j,f=$*C,h=f-(f-C),m=C-h,f=$*j,y=f-(f-j),b=j-y,N=m*b-(x-h*y-m*y-h*b),S=U*O,f=$*U,h=f-(f-U),m=U-h,f=$*O,y=f-(f-O),b=O-y,L=m*b-(S-h*y-m*y-h*b),p=N-L,a=N-p,Ue[0]=N-(p+a)+(a-L),E=x+p,a=E-x,_=x-(E-a)+(p-a),p=_-S,a=_-p,Ue[1]=_-(p+a)+(a-S),w=E+p,a=w-E,Ue[2]=E-(w-a)+(p-a),Ue[3]=w;let W=pr(4,Ue),M=br*l;if(W>=M||-W>=M||(a=n-C,s=n-(C+a)+(a-r),a=t-O,u=t-(O+a)+(a-r),a=e-U,c=e-(U+a)+(a-o),a=i-j,d=i-(j+a)+(a-o),s===0&&c===0&&u===0&&d===0)||(M=wr*l+yr*Math.abs(W),W+=C*d+j*s-(U*u+O*c),W>=M||-W>=M))return W;x=s*j,f=$*s,h=f-(f-s),m=s-h,f=$*j,y=f-(f-j),b=j-y,N=m*b-(x-h*y-m*y-h*b),S=c*O,f=$*c,h=f-(f-c),m=c-h,f=$*O,y=f-(f-O),b=O-y,L=m*b-(S-h*y-m*y-h*b),p=N-L,a=N-p,te[0]=N-(p+a)+(a-L),E=x+p,a=E-x,_=x-(E-a)+(p-a),p=_-S,a=_-p,te[1]=_-(p+a)+(a-S),w=E+p,a=w-E,te[2]=E-(w-a)+(p-a),te[3]=w;const V=Nt(4,Ue,4,te,wi);x=C*d,f=$*C,h=f-(f-C),m=C-h,f=$*d,y=f-(f-d),b=d-y,N=m*b-(x-h*y-m*y-h*b),S=U*u,f=$*U,h=f-(f-U),m=U-h,f=$*u,y=f-(f-u),b=u-y,L=m*b-(S-h*y-m*y-h*b),p=N-L,a=N-p,te[0]=N-(p+a)+(a-L),E=x+p,a=E-x,_=x-(E-a)+(p-a),p=_-S,a=_-p,te[1]=_-(p+a)+(a-S),w=E+p,a=w-E,te[2]=E-(w-a)+(p-a),te[3]=w;const ne=Nt(V,wi,4,te,_i);x=s*d,f=$*s,h=f-(f-s),m=s-h,f=$*d,y=f-(f-d),b=d-y,N=m*b-(x-h*y-m*y-h*b),S=c*u,f=$*c,h=f-(f-c),m=c-h,f=$*u,y=f-(f-u),b=u-y,L=m*b-(S-h*y-m*y-h*b),p=N-L,a=N-p,te[0]=N-(p+a)+(a-L),E=x+p,a=E-x,_=x-(E-a)+(p-a),p=_-S,a=_-p,te[1]=_-(p+a)+(a-S),w=E+p,a=w-E,te[2]=E-(w-a)+(p-a),te[3]=w;const ae=Nt(ne,_i,4,te,Ei);return Ei[ae-1]}function Er(n,e,t,i,r,o){const l=(e-o)*(t-r),s=(n-r)*(i-o),c=l-s,u=Math.abs(l+s);return Math.abs(c)>=vr*u?c:-_r(n,e,t,i,r,o,u)}const Xe=(n,e)=>n.ll.x<=e.x&&e.x<=n.ur.x&&n.ll.y<=e.y&&e.y<=n.ur.y,Pt=(n,e)=>{if(e.ur.x<n.ll.x||n.ur.x<e.ll.x||e.ur.y<n.ll.y||n.ur.y<e.ll.y)return null;const t=n.ll.x<e.ll.x?e.ll.x:n.ll.x,i=n.ur.x<e.ur.x?n.ur.x:e.ur.x,r=n.ll.y<e.ll.y?e.ll.y:n.ll.y,o=n.ur.y<e.ur.y?n.ur.y:e.ur.y;return{ll:{x:t,y:r},ur:{x:i,y:o}}};let ke=Number.EPSILON;ke===void 0&&(ke=Math.pow(2,-52));const Lr=ke*ke,Li=(n,e)=>{if(-ke<n&&n<ke&&-ke<e&&e<ke)return 0;const t=n-e;return t*t<Lr*n*e?0:n<e?-1:1};class Sr{constructor(){this.reset()}reset(){this.xRounder=new Si,this.yRounder=new Si}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}class Si{constructor(){this.tree=new xt,this.round(0)}round(e){const t=this.tree.add(e),i=this.tree.prev(t);if(i!==null&&Li(t.key,i.key)===0)return this.tree.remove(e),i.key;const r=this.tree.next(t);return r!==null&&Li(t.key,r.key)===0?(this.tree.remove(e),r.key):e}}const Ke=new Sr,ot=(n,e)=>n.x*e.y-n.y*e.x,xi=(n,e)=>n.x*e.x+n.y*e.y,Mi=(n,e,t)=>{const i=Er(n.x,n.y,e.x,e.y,t.x,t.y);return i>0?-1:i<0?1:0},st=n=>Math.sqrt(xi(n,n)),xr=(n,e,t)=>{const i={x:e.x-n.x,y:e.y-n.y},r={x:t.x-n.x,y:t.y-n.y};return ot(r,i)/st(r)/st(i)},Mr=(n,e,t)=>{const i={x:e.x-n.x,y:e.y-n.y},r={x:t.x-n.x,y:t.y-n.y};return xi(r,i)/st(r)/st(i)},ki=(n,e,t)=>e.y===0?null:{x:n.x+e.x/e.y*(t-n.y),y:t},Ci=(n,e,t)=>e.x===0?null:{x:t,y:n.y+e.y/e.x*(t-n.x)},kr=(n,e,t,i)=>{if(e.x===0)return Ci(t,i,n.x);if(i.x===0)return Ci(n,e,t.x);if(e.y===0)return ki(t,i,n.y);if(i.y===0)return ki(n,e,t.y);const r=ot(e,i);if(r==0)return null;const o={x:t.x-n.x,y:t.y-n.y},l=ot(o,e)/r,s=ot(o,i)/r,c=n.x+s*e.x,u=t.x+l*i.x,d=n.y+s*e.y,a=t.y+l*i.y,f=(c+u)/2,h=(d+a)/2;return{x:f,y:h}};class le{static compare(e,t){const i=le.comparePoints(e.point,t.point);return i!==0?i:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Ce.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let i=0,r=t.length;i<r;i++){const o=t[i];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const i=this.point.events[t];if(i.segment.consumedBy===void 0)for(let r=t+1;r<e;r++){const o=this.point.events[r];o.consumedBy===void 0&&i.otherSE.point.events===o.otherSE.point.events&&i.segment.consume(o.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,i=this.point.events.length;t<i;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,i=r=>{const o=r.otherSE;t.set(r,{sine:xr(this.point,e.point,o.point),cosine:Mr(this.point,e.point,o.point)})};return(r,o)=>{t.has(r)||i(r),t.has(o)||i(o);const{sine:l,cosine:s}=t.get(r),{sine:c,cosine:u}=t.get(o);return l>=0&&c>=0?s<u?1:s>u?-1:0:l<0&&c<0?s<u?-1:s>u?1:0:c<l?-1:c>l?1:0}}}let Cr=0;class Ce{static compare(e,t){const i=e.leftSE.point.x,r=t.leftSE.point.x,o=e.rightSE.point.x,l=t.rightSE.point.x;if(l<i)return 1;if(o<r)return-1;const s=e.leftSE.point.y,c=t.leftSE.point.y,u=e.rightSE.point.y,d=t.rightSE.point.y;if(i<r){if(c<s&&c<u)return 1;if(c>s&&c>u)return-1;const a=e.comparePoint(t.leftSE.point);if(a<0)return 1;if(a>0)return-1;const f=t.comparePoint(e.rightSE.point);return f!==0?f:-1}if(i>r){if(s<c&&s<d)return-1;if(s>c&&s>d)return 1;const a=t.comparePoint(e.leftSE.point);if(a!==0)return a;const f=e.comparePoint(t.rightSE.point);return f<0?1:f>0?-1:1}if(s<c)return-1;if(s>c)return 1;if(o<l){const a=t.comparePoint(e.rightSE.point);if(a!==0)return a}if(o>l){const a=e.comparePoint(t.rightSE.point);if(a<0)return 1;if(a>0)return-1}if(o!==l){const a=u-s,f=o-i,h=d-c,m=l-r;if(a>f&&h<m)return 1;if(a<f&&h>m)return-1}return o>l?1:o<l||u<d?-1:u>d?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,i,r){this.id=++Cr,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=i,this.windings=r}static fromRing(e,t,i){let r,o,l;const s=le.comparePoints(e,t);if(s<0)r=e,o=t,l=1;else if(s>0)r=t,o=e,l=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const c=new le(r,!0),u=new le(o,!1);return new Ce(c,u,[i],[l])}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<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,i=this.rightSE.point,r=this.vector();if(t.x===i.x)return e.x===t.x?0:e.x<t.x?1:-1;const o=(e.y-t.y)/r.y,l=t.x+o*r.x;if(e.x===l)return 0;const s=(e.x-t.x)/r.x,c=t.y+s*r.y;return e.y===c?0:e.y<c?-1:1}getIntersection(e){const t=this.bbox(),i=e.bbox(),r=Pt(t,i);if(r===null)return null;const o=this.leftSE.point,l=this.rightSE.point,s=e.leftSE.point,c=e.rightSE.point,u=Xe(t,s)&&this.comparePoint(s)===0,d=Xe(i,o)&&e.comparePoint(o)===0,a=Xe(t,c)&&this.comparePoint(c)===0,f=Xe(i,l)&&e.comparePoint(l)===0;if(d&&u)return f&&!a?l:!f&&a?c:null;if(d)return a&&o.x===c.x&&o.y===c.y?null:o;if(u)return f&&l.x===s.x&&l.y===s.y?null:s;if(f&&a)return null;if(f)return l;if(a)return c;const h=kr(o,this.vector(),s,e.vector());return h===null||!Xe(r,h)?null:Ke.round(h.x,h.y)}split(e){const t=[],i=e.events!==void 0,r=new le(e,!0),o=new le(e,!1),l=this.rightSE;this.replaceRightSE(o),t.push(o),t.push(r);const s=new Ce(r,l,this.rings.slice(),this.windings.slice());return le.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),le.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(r.checkForConsuming(),o.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,i=this.windings.length;t<i;t++)this.windings[t]*=-1}consume(e){let t=this,i=e;for(;t.consumedBy;)t=t.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const r=Ce.compare(t,i);if(r!==0){if(r>0){const o=t;t=i,i=o}if(t.prev===i){const o=t;t=i,i=o}for(let o=0,l=i.rings.length;o<l;o++){const s=i.rings[o],c=i.windings[o],u=t.rings.indexOf(s);u===-1?(t.rings.push(s),t.windings.push(c)):t.windings[u]+=c}i.rings=null,i.windings=null,i.consumedBy=t,i.leftSE.consumedBy=t.leftSE,i.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,i=this._afterState.windings,r=this._afterState.multiPolys;for(let s=0,c=this.rings.length;s<c;s++){const u=this.rings[s],d=this.windings[s],a=t.indexOf(u);a===-1?(t.push(u),i.push(d)):i[a]+=d}const o=[],l=[];for(let s=0,c=t.length;s<c;s++){if(i[s]===0)continue;const u=t[s],d=u.poly;if(l.indexOf(d)===-1)if(u.isExterior)o.push(d);else{l.indexOf(d)===-1&&l.push(d);const a=o.indexOf(u.poly);a!==-1&&o.splice(a,1)}}for(let s=0,c=o.length;s<c;s++){const u=o[s].multiPoly;r.indexOf(u)===-1&&r.push(u)}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(fe.type){case"union":{const i=e.length===0,r=t.length===0;this._isInResult=i!==r;break}case"intersection":{let i,r;e.length<t.length?(i=e.length,r=t.length):(i=t.length,r=e.length),this._isInResult=r===fe.numMultiPolys&&i<r;break}case"xor":{const i=Math.abs(e.length-t.length);this._isInResult=i%2===1;break}case"difference":{const i=r=>r.length===1&&r[0].isSubject;this._isInResult=i(e)!==i(t);break}default:throw new Error(`Unrecognized operation type found ${fe.type}`)}return this._isInResult}}class Ni{constructor(e,t,i){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=i,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const r=Ke.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let o=r;for(let l=1,s=e.length;l<s;l++){if(typeof e[l][0]!="number"||typeof e[l][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=Ke.round(e[l][0],e[l][1]);c.x===o.x&&c.y===o.y||(this.segments.push(Ce.fromRing(o,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),o=c)}(r.x!==o.x||r.y!==o.y)&&this.segments.push(Ce.fromRing(o,r,this))}getSweepEvents(){const e=[];for(let t=0,i=this.segments.length;t<i;t++){const r=this.segments[t];e.push(r.leftSE),e.push(r.rightSE)}return e}}class Nr{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Ni(e[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 i=1,r=e.length;i<r;i++){const o=new Ni(e[i],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,i=this.interiorRings.length;t<i;t++){const r=this.interiorRings[t].getSweepEvents();for(let o=0,l=r.length;o<l;o++)e.push(r[o])}return e}}class Pi{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let i=0,r=e.length;i<r;i++){const o=new Nr(e[i],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,i=this.polys.length;t<i;t++){const r=this.polys[t].getSweepEvents();for(let o=0,l=r.length;o<l;o++)e.push(r[o])}return e}}class lt{static factory(e){const t=[];for(let i=0,r=e.length;i<r;i++){const o=e[i];if(!o.isInResult()||o.ringOut)continue;let l=null,s=o.leftSE,c=o.rightSE;const u=[s],d=s.point,a=[];for(;l=s,s=c,u.push(s),s.point!==d;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const y=u[0].point,b=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${y.x}, ${y.y}]. Last matching segment found ends at [${b.x}, ${b.y}].`)}if(f.length===1){c=f[0].otherSE;break}let h=null;for(let y=0,b=a.length;y<b;y++)if(a[y].point===s.point){h=y;break}if(h!==null){const y=a.splice(h)[0],b=u.splice(y.index);b.unshift(b[0].otherSE),t.push(new lt(b.reverse()));continue}a.push({index:u.length,point:s.point});const m=s.getLeftmostComparator(l);c=f.sort(m)[0].otherSE;break}t.push(new lt(u))}return t}constructor(e){this.events=e;for(let t=0,i=e.length;t<i;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point;const t=[e];for(let u=1,d=this.events.length-1;u<d;u++){const a=this.events[u].point,f=this.events[u+1].point;Mi(a,e,f)!==0&&(t.push(a),e=a)}if(t.length===1)return null;const i=t[0],r=t[1];Mi(i,e,r)===0&&t.shift(),t.push(t[0]);const o=this.isExteriorRing()?1:-1,l=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,c=[];for(let u=l;u!=s;u+=o)c.push([t[u].x,t[u].y]);return c}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(){let e=this.events[0];for(let r=1,o=this.events.length;r<o;r++){const l=this.events[r];le.compare(e,l)>0&&(e=l)}let t=e.segment.prevInResult(),i=t?t.prevInResult():null;for(;;){if(!t)return null;if(!i)return t.ringOut;if(i.ringOut!==t.ringOut)return i.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=i.prevInResult(),i=t?t.prevInResult():null}}}class Ti{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,i=this.interiorRings.length;t<i;t++){const r=this.interiorRings[t].getGeom();r!==null&&e.push(r)}return e}}class Pr{constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){const e=[];for(let t=0,i=this.polys.length;t<i;t++){const r=this.polys[t].getGeom();r!==null&&e.push(r)}return e}_composePolys(e){const t=[];for(let i=0,r=e.length;i<r;i++){const o=e[i];if(!o.poly)if(o.isExteriorRing())t.push(new Ti(o));else{const l=o.enclosingRing();l.poly||t.push(new Ti(l)),l.poly.addInterior(o)}}return t}}class Tr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce.compare;this.queue=e,this.tree=new xt(t),this.segments=[]}process(e){const t=e.segment,i=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),i;const r=e.isLeft?this.tree.add(t):this.tree.find(t);if(!r)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let o=r,l=r,s,c;for(;s===void 0;)o=this.tree.prev(o),o===null?s=null:o.key.consumedBy===void 0&&(s=o.key);for(;c===void 0;)l=this.tree.next(l),l===null?c=null:l.key.consumedBy===void 0&&(c=l.key);if(e.isLeft){let u=null;if(s){const a=s.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(u=a),!s.isAnEndpoint(a))){const f=this._splitSafely(s,a);for(let h=0,m=f.length;h<m;h++)i.push(f[h])}}let d=null;if(c){const a=c.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(d=a),!c.isAnEndpoint(a))){const f=this._splitSafely(c,a);for(let h=0,m=f.length;h<m;h++)i.push(f[h])}}if(u!==null||d!==null){let a=null;u===null?a=d:d===null?a=u:a=le.comparePoints(u,d)<=0?u:d,this.queue.remove(t.rightSE),i.push(t.rightSE);const f=t.split(a);for(let h=0,m=f.length;h<m;h++)i.push(f[h])}i.length>0?(this.tree.remove(t),i.push(e)):(this.segments.push(t),t.prev=s)}else{if(s&&c){const u=s.getIntersection(c);if(u!==null){if(!s.isAnEndpoint(u)){const d=this._splitSafely(s,u);for(let a=0,f=d.length;a<f;a++)i.push(d[a])}if(!c.isAnEndpoint(u)){const d=this._splitSafely(c,u);for(let a=0,f=d.length;a<f;a++)i.push(d[a])}}}this.tree.remove(t)}return i}_splitSafely(e,t){this.tree.remove(e);const i=e.rightSE;this.queue.remove(i);const r=e.split(t);return r.push(i),e.consumedBy===void 0&&this.tree.add(e),r}}const Ri=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Rr=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Ir{run(e,t,i){fe.type=e,Ke.reset();const r=[new Pi(t,!0)];for(let a=0,f=i.length;a<f;a++)r.push(new Pi(i[a],!1));if(fe.numMultiPolys=r.length,fe.type==="difference"){const a=r[0];let f=1;for(;f<r.length;)Pt(r[f].bbox,a.bbox)!==null?f++:r.splice(f,1)}if(fe.type==="intersection")for(let a=0,f=r.length;a<f;a++){const h=r[a];for(let m=a+1,y=r.length;m<y;m++)if(Pt(h.bbox,r[m].bbox)===null)return[]}const o=new xt(le.compare);for(let a=0,f=r.length;a<f;a++){const h=r[a].getSweepEvents();for(let m=0,y=h.length;m<y;m++)if(o.insert(h[m]),o.size>Ri)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const l=new Tr(o);let s=o.size,c=o.pop();for(;c;){const a=c.key;if(o.size===s){const h=a.segment;throw new Error(`Unable to pop() ${a.isLeft?"left":"right"} SweepEvent [${a.point.x}, ${a.point.y}] from segment #${h.id} [${h.leftSE.point.x}, ${h.leftSE.point.y}] -> [${h.rightSE.point.x}, ${h.rightSE.point.y}] from queue.`)}if(o.size>Ri)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(l.segments.length>Rr)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=l.process(a);for(let h=0,m=f.length;h<m;h++){const y=f[h];y.consumedBy===void 0&&o.insert(y)}s=o.size,c=o.pop()}Ke.reset();const u=lt.factory(l.segments);return new Pr(u).getGeom()}}const fe=new Ir;var Ii={union:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return fe.run("union",n,t)},intersection:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return fe.run("intersection",n,t)},xor:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return fe.run("xor",n,t)},difference:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return fe.run("difference",n,t)}};function Or(n){const e=[];if(Et(n,r=>{e.push(r.coordinates)}),e.length<2)throw new Error("Must have at least two features");const t=n.features[0].properties||{},i=Ii.difference(e[0],...e.slice(1));return i.length===0?null:i.length===1?wt(i[0],t):yi(i,t)}var Wr=Or;function Ar(n){if(!n)throw new Error("geojson is required");var e=[];return ur(n,function(t){e.push(t)}),_t(e)}var Fr=Ar;function Dr(n,e={}){const t=[];if(Et(n,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const i=Ii.union(t[0],...t.slice(1));return i.length===0?null:i.length===1?wt(i[0],e.properties):yi(i,e.properties)}var Br=Dr;function Oi(n,e){const t=Wr(_t([wt([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),n]));if(!t)return;t.properties={isMask:!0};const i=nt(vi(n)),r=(i[2]-i[0])/360/1e3,o=i[0]<-180,l=i[2]>180,s=Fr(n);if(s.features.length>1&&(o||l))for(const c of s.features){const u=nt(vi(c));if(l&&u[0]<-180+r)for(const d of c.geometry.coordinates)for(const a of d)a[0]+=360-r;if(o&&u[2]>180-r)for(const d of c.geometry.coordinates)for(const a of d)a[0]-=360-r}e(_t([s.features.length<2?n:Br(s)??n,t]))}const Wi="EPSG:4326";function Ur(n){var o;const e=n.getProperties(),{isMask:t}=e,i=(o=n.getGeometry())==null?void 0:o.getType(),r=t?0:i==="LineString"||i==="MultiLineString"?3:2;return new en({stroke:t?void 0:new jt({color:"#3170fe",lineDash:[r,r],width:r,lineCap:"butt"}),fill:t?new zt({color:"#00000020"}):void 0,image:new $i({src:`/icons/marker_${e.isReverse?"reverse":e.isSelected?"selected":"unselected"}.svg`,anchor:[.5,1]}),zIndex:e.isSelected?2:e.isReverse?0:1,text:e.isSelected&&e.tooltip?new tn({backgroundFill:new zt({color:"white"}),text:e.tooltip,offsetY:-40,backgroundStroke:new jt({color:"white",lineJoin:"round",width:3}),padding:[2,0,0,2]}):void 0})}function Ai(n,e={},t={},i=Ur){let r=-1,o,l,s,c=!1;const u=new Ki({updateWhileAnimating:!0});n.addLayer(u);const d=new Ji({});u.setSource(d),u.setStyle(i),n.on("click",m=>{n.forEachFeatureAtPixel(m.pixel,y=>{const b=y.getId();if(b)return m.stopPropagation(),l==null||l({type:"markerClick",id:b}),y})}),n.on("pointermove",m=>{const y=n.forEachFeatureAtPixel(m.pixel,b=>b.getId());o!==y&&(o&&(l==null||l({type:"markerMouseLeave",id:o})),y&&(l==null||l({type:"markerMouseEnter",id:y})),n.getTargetElement().style.cursor=y?"pointer":c?"crosshair":"",o=y)});function a(){return _e.getUserProjection()??n.getView().getProjection()}function f(m){return m.transform(Wi,a())}const h=m=>{l==null||l({type:"mapClick",coordinates:_e.toLonLat(m.coordinate,a())})};return{setEventHandler(m){m?(l=m,n.on("click",h)):(l=void 0,n.un("click",h))},flyTo(m,y){n.getView().animate({center:_e.fromLonLat(m,a()),...y?{zoom:y}:{},duration:2e3,...e})},fitBounds(m,y,b){n.getView().fit(_e.transformExtent(m,Wi,a()),{padding:[y,y,y,y],...b?{maxZoom:b}:{},duration:2e3,...t})},indicateReverse(m){c=m,n.getTargetElement().style.cursor=m?"crosshair":""},setReverseMarker(m){s?m?s.getGeometry().setCoordinates(_e.fromLonLat(m,a())):(d.removeFeature(s),s.dispose(),s=void 0):m&&(s=new oe.Feature(new se.Point(_e.fromLonLat(m,a()))),s.setProperties({isReverse:!0}),d.addFeature(s))},setMarkers(m,y){function b(p){var E;if(p)for(const _ of p.features){const x=_.geometry.type==="Polygon"?new se.Polygon(_.geometry.coordinates):_.geometry.type==="MultiPolygon"?new se.MultiPolygon(_.geometry.coordinates):null;x&&d.addFeature(new oe.Feature({isMask:!!((E=_.properties)!=null&&E.isMask),geometry:f(x)}))}}if(d.clear(),s&&d.addFeature(s),y){let p=!1;if(y.geometry.type==="GeometryCollection"){const E=y.geometry.geometries.map(_=>_.type==="Polygon"?new se.Polygon(_.coordinates):_.type==="MultiPolygon"?new se.MultiPolygon(_.coordinates):null).filter(_=>!!_);if(E.length>0)d.addFeature(new oe.Feature(f(new se.GeometryCollection(E)))),p=!0;else for(const _ of y.geometry.geometries)_.type==="LineString"?(d.addFeature(new oe.Feature(f(new se.LineString(_.coordinates)))),p=!0):_.type==="MultiLineString"&&d.addFeature(new oe.Feature(f(new se.MultiLineString(_.coordinates)))),p=!0}if(!p){if(y.geometry.type==="Polygon")Oi(y,b);else if(y.geometry.type==="MultiPolygon")Oi(y,b);else if(y.geometry.type==="LineString"){d.addFeature(new oe.Feature(f(new se.LineString(y.geometry.coordinates))));return}else if(y.geometry.type==="MultiLineString"){d.addFeature(new oe.Feature(f(new se.MultiLineString(y.geometry.coordinates))));return}}d.addFeature(new oe.Feature(f(new se.Point(y.center))))}for(const p of m??[]){if(p===y)continue;const E=new oe.Feature(new se.Point(_e.fromLonLat(p.center,a())));E.setId(p.id),E.setProperties({fuzzy:!!p.matching_text,tooltip:p.place_type[0]==="reverse"?p.place_name:p.place_name.replace(/,.*/,"")}),d.addFeature(E)}},setSelectedMarker(m){var p,E,_;const y=d.getFeatures(),b=(p=y[0])!=null&&p.getProperties().isReverse?1:0;r>-1&&((E=y[r+b])==null||E.setProperties({isSelected:!1})),m>-1&&((_=y[m+b])==null||_.setProperties({isSelected:!0})),r=m},getCenterAndZoom(){const m=n.getView(),y=m.getCenter(),b=m.getZoom();if(!(!y||b===void 0))return[b,..._e.toLonLat(y,a())]}}}class qr extends F.Control{constructor(t){const i=document.createElement("div");i.className="ol-search";super({element:i,target:t.target});Gt(this,ue);Gt(this,Oe);const{flyTo:r,fullGeometryStyle:o,...l}=t;gt(this,ue,new lr({target:i,props:{flyTo:r===void 0?!0:!!r,...l}}));for(const s of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])de(this,ue).$on(s,c=>{switch(s){case"select":this.dispatchEvent(new Fi(c.detail));break;case"featuresListed":this.dispatchEvent(new Di(c.detail));break;case"featuresMarked":this.dispatchEvent(new Bi(c.detail));break;case"optionsVisibilityChange":this.dispatchEvent(new Ui(c.detail));break;case"pick":this.dispatchEvent(new qi(c.detail));break;case"queryChange":this.dispatchEvent(new Gi(c.detail));break;case"response":this.dispatchEvent(new zi(c.detail.url,c.detail.featureCollection));break;case"reverseToggle":this.dispatchEvent(new ji(c.detail));break}});gt(this,Oe,t)}setMap(t){var i;if(super.setMap(t),t){const{flyTo:r,fullGeometryStyle:o}=de(this,Oe),l=Ai(t,typeof r=="boolean"?void 0:r,typeof r=="boolean"?void 0:r,o);(i=de(this,ue))==null||i.$set({mapController:l})}}setOptions(t){var l;gt(this,Oe,t);const{flyTo:i,fullGeometryStyle:r,...o}=de(this,Oe);(l=de(this,ue))==null||l.$set({...o,flyTo:i===void 0?!0:!!i})}setQuery(t,i=!0){var r;(r=de(this,ue))==null||r.setQuery(t,i)}clearMap(){var t;(t=de(this,ue))==null||t.clearMap()}clearList(){var t;(t=de(this,ue))==null||t.clearList()}focus(){var t;(t=de(this,ue))==null||t.focus()}blur(){var t;(t=de(this,ue))==null||t.blur()}}ue=new WeakMap,Oe=new WeakMap;class Fi extends D{constructor(t){super("select");ce(this,"feature");this.feature=t}}class Di extends D{constructor(t){super("featuresListed");ce(this,"features");this.features=t}}class Bi extends D{constructor(t){super("featuresMarked");ce(this,"features");this.features=t}}class Ui extends D{constructor(t){super("optionsVisibilityChange");ce(this,"optionsVisible");this.optionsVisible=t}}class qi extends D{constructor(t){super("pick");ce(this,"feature");this.feature=t}}class Gi extends D{constructor(t){super("queryChange");ce(this,"query");this.query=t}}class zi extends D{constructor(t,i){super("response");ce(this,"url");ce(this,"featureCollection");this.url=t,this.featureCollection=i}}class ji extends D{constructor(t){super("reverseToggle");ce(this,"reverse");this.reverse=t}}k.FeaturesListedEvent=Di,k.FeaturesMarkedEvent=Bi,k.GeocodingControl=qr,k.OptionsVisibilityChangeEvent=Ui,k.PickEvent=qi,k.QueryChangeEvent=Gi,k.ResponseEvent=zi,k.ReverseToggleEvent=ji,k.SelectEvent=Fi,k.createOpenLayersMapController=Ai,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
32
23
  //# sourceMappingURL=openlayers.umd.js.map