From c7b00f4418704808296c68f44764f7cd377b5aa1 Mon Sep 17 00:00:00 2001 From: dabreegster Date: Sun, 5 May 2024 14:57:44 +0000 Subject: [PATCH] deploy: cf6b2844addb14b79373a117cc649d16d0097f0d --- ...-cf74ae20.js => RenderLanePolygons-fdad512c.js} | 14 +++++++------- assets/{main-85e3dba7.js => main-1e55cb9a.js} | 12 ++++++------ assets/{nested-961ddcbc.js => nested-64b7e2e5.js} | 2 +- index.html | 4 ++-- lane_editor.html | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) rename assets/{RenderLanePolygons-cf74ae20.js => RenderLanePolygons-fdad512c.js} (96%) rename assets/{main-85e3dba7.js => main-1e55cb9a.js} (85%) rename assets/{nested-961ddcbc.js => nested-64b7e2e5.js} (99%) diff --git a/assets/RenderLanePolygons-cf74ae20.js b/assets/RenderLanePolygons-fdad512c.js similarity index 96% rename from assets/RenderLanePolygons-cf74ae20.js rename to assets/RenderLanePolygons-fdad512c.js index d67f0654..469c765d 100644 --- a/assets/RenderLanePolygons-cf74ae20.js +++ b/assets/RenderLanePolygons-fdad512c.js @@ -579,10 +579,10 @@ uniform ${N} ${O} u_${j}; `),Tt=K.concat(Uu.prelude.vertexSource,h.vertexSource).join(` `),st=I.createShader(I.FRAGMENT_SHADER);if(I.isContextLost())return void(this.failedToCreate=!0);if(I.shaderSource(st,ft),I.compileShader(st),!I.getShaderParameter(st,I.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${I.getShaderInfoLog(st)}`);I.attachShader(this.program,st);const vt=I.createShader(I.VERTEX_SHADER);if(I.isContextLost())return void(this.failedToCreate=!0);if(I.shaderSource(vt,Tt),I.compileShader(vt),!I.getShaderParameter(vt,I.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${I.getShaderInfoLog(vt)}`);I.attachShader(this.program,vt),this.attributes={};const Lt={};this.numAttributes=N.length;for(let kt=0;kt({u_depth:new c.aG(kt,Nt.u_depth),u_terrain:new c.aG(kt,Nt.u_terrain),u_terrain_dim:new c.aH(kt,Nt.u_terrain_dim),u_terrain_matrix:new c.aI(kt,Nt.u_terrain_matrix),u_terrain_unpack:new c.aJ(kt,Nt.u_terrain_unpack),u_terrain_exaggeration:new c.aH(kt,Nt.u_terrain_exaggeration)}))(o,Lt),this.binderUniforms=d?d.getUniforms(o,Lt):[]}draw(o,h,d,g,v,E,I,P,k,N,O,j,tt,$,ot,K,ft,Tt){const st=o.gl;if(this.failedToCreate)return;if(o.program.set(this.program),o.setDepthMode(d),o.setStencilMode(g),o.setColorMode(v),o.setCullFace(E),P){o.activeTexture.set(st.TEXTURE2),st.bindTexture(st.TEXTURE_2D,P.depthTexture),o.activeTexture.set(st.TEXTURE3),st.bindTexture(st.TEXTURE_2D,P.texture);for(const Lt in this.terrainUniforms)this.terrainUniforms[Lt].set(P[Lt])}for(const Lt in this.fixedUniforms)this.fixedUniforms[Lt].set(I[Lt]);ot&&ot.setUniforms(o,this.binderUniforms,tt,{zoom:$});let vt=0;switch(h){case st.LINES:vt=2;break;case st.TRIANGLES:vt=3;break;case st.LINE_STRIP:vt=1}for(const Lt of j.get()){const kt=Lt.vaos||(Lt.vaos={});(kt[k]||(kt[k]=new Uc)).bind(o,this,N,ot?ot.getPaintVertexBuffers():[],O,Lt.vertexOffset,K,ft,Tt),st.drawElements(h,Lt.primitiveLength*vt,st.UNSIGNED_SHORT,Lt.primitiveOffset*vt*2)}}}function Gc(_,o,h){const d=1/Be(h,1,o.transform.tileZoom),g=Math.pow(2,h.tileID.overscaledZ),v=h.tileSize*Math.pow(2,o.transform.tileZoom)/g,E=v*(h.tileID.canonical.x+h.tileID.wrap*g),I=v*h.tileID.canonical.y;return{u_image:0,u_texsize:h.imageAtlasTexture.size,u_scale:[d,_.fromScale,_.toScale],u_fade:_.t,u_pixel_coord_upper:[E>>16,I>>16],u_pixel_coord_lower:[65535&E,65535&I]}}const Gu=(_,o,h,d)=>{const g=o.style.light,v=g.properties.get("position"),E=[v.x,v.y,v.z],I=function(){var k=new c.A(9);return c.A!=Float32Array&&(k[1]=0,k[2]=0,k[3]=0,k[5]=0,k[6]=0,k[7]=0),k[0]=1,k[4]=1,k[8]=1,k}();g.properties.get("anchor")==="viewport"&&function(k,N){var O=Math.sin(N),j=Math.cos(N);k[0]=j,k[1]=O,k[2]=0,k[3]=-O,k[4]=j,k[5]=0,k[6]=0,k[7]=0,k[8]=1}(I,-o.transform.angle),function(k,N,O){var j=N[0],tt=N[1],$=N[2];k[0]=j*O[0]+tt*O[3]+$*O[6],k[1]=j*O[1]+tt*O[4]+$*O[7],k[2]=j*O[2]+tt*O[5]+$*O[8]}(E,E,I);const P=g.properties.get("color");return{u_matrix:_,u_lightpos:E,u_lightintensity:g.properties.get("intensity"),u_lightcolor:[P.r,P.g,P.b],u_vertical_gradient:+h,u_opacity:d}},Iy=(_,o,h,d,g,v,E)=>c.e(Gu(_,o,h,d),Gc(v,o,E),{u_height_factor:-Math.pow(2,g.overscaledZ)/E.tileSize/8}),Xd=_=>({u_matrix:_}),jc=(_,o,h,d)=>c.e(Xd(_),Gc(h,o,d)),Cy=(_,o)=>({u_matrix:_,u_world:o}),Yd=(_,o,h,d,g)=>c.e(jc(_,o,h,d),{u_world:g}),Ty=(_,o,h,d)=>{const g=_.transform;let v,E;if(d.paint.get("circle-pitch-alignment")==="map"){const I=Be(h,1,g.zoom);v=!0,E=[I,I]}else v=!1,E=g.pixelsToGLUnits;return{u_camera_to_center_distance:g.cameraToCenterDistance,u_scale_with_map:+(d.paint.get("circle-pitch-scale")==="map"),u_matrix:_.translatePosMatrix(o.posMatrix,h,d.paint.get("circle-translate"),d.paint.get("circle-translate-anchor")),u_pitch_with_map:+v,u_device_pixel_ratio:_.pixelRatio,u_extrude_scale:E}},Kd=(_,o,h)=>{const d=Be(h,1,o.zoom),g=Math.pow(2,o.zoom-h.tileID.overscaledZ),v=h.tileID.overscaleFactor();return{u_matrix:_,u_camera_to_center_distance:o.cameraToCenterDistance,u_pixels_to_tile_units:d,u_extrude_scale:[o.pixelsToGLUnits[0]/(d*g),o.pixelsToGLUnits[1]/(d*g)],u_overscale_factor:v}},Jd=(_,o,h=1)=>({u_matrix:_,u_color:o,u_overlay:0,u_overlay_scale:h}),qc=_=>({u_matrix:_}),Qd=(_,o,h,d)=>({u_matrix:_,u_extrude_scale:Be(o,1,h),u_intensity:d});function $d(_,o){const h=Math.pow(2,o.canonical.z),d=o.canonical.y;return[new c.Y(0,d/h).toLngLat().lat,new c.Y(0,(d+1)/h).toLngLat().lat]}const Wc=(_,o,h,d)=>{const g=_.transform;return{u_matrix:ju(_,o,h,d),u_ratio:1/Be(o,1,g.zoom),u_device_pixel_ratio:_.pixelRatio,u_units_to_pixels:[1/g.pixelsToGLUnits[0],1/g.pixelsToGLUnits[1]]}},tg=(_,o,h,d,g)=>c.e(Wc(_,o,h,g),{u_image:0,u_image_height:d}),gl=(_,o,h,d,g)=>{const v=_.transform,E=xo(o,v);return{u_matrix:ju(_,o,h,g),u_texsize:o.imageAtlasTexture.size,u_ratio:1/Be(o,1,v.zoom),u_device_pixel_ratio:_.pixelRatio,u_image:0,u_scale:[E,d.fromScale,d.toScale],u_fade:d.t,u_units_to_pixels:[1/v.pixelsToGLUnits[0],1/v.pixelsToGLUnits[1]]}},Zc=(_,o,h,d,g,v)=>{const E=_.lineAtlas,I=xo(o,_.transform),P=h.layout.get("line-cap")==="round",k=E.getDash(d.from,P),N=E.getDash(d.to,P),O=k.width*g.fromScale,j=N.width*g.toScale;return c.e(Wc(_,o,h,v),{u_patternscale_a:[I/O,-k.height/2],u_patternscale_b:[I/j,-N.height/2],u_sdfgamma:E.width/(256*Math.min(O,j)*_.pixelRatio)/2,u_image:0,u_tex_y_a:k.y,u_tex_y_b:N.y,u_mix:g.t})};function xo(_,o){return 1/Be(_,1,o.tileZoom)}function ju(_,o,h,d){return _.translatePosMatrix(d?d.posMatrix:o.tileID.posMatrix,o,h.paint.get("line-translate"),h.paint.get("line-translate-anchor"))}const Hc=(_,o,h,d,g)=>{return{u_matrix:_,u_tl_parent:o,u_scale_parent:h,u_buffer_scale:1,u_fade_t:d.mix,u_opacity:d.opacity*g.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:g.paint.get("raster-brightness-min"),u_brightness_high:g.paint.get("raster-brightness-max"),u_saturation_factor:(E=g.paint.get("raster-saturation"),E>0?1-1/(1.001-E):-E),u_contrast_factor:(v=g.paint.get("raster-contrast"),v>0?1/(1-v):1+v),u_spin_weights:qu(g.paint.get("raster-hue-rotate"))};var v,E};function qu(_){_*=Math.PI/180;const o=Math.sin(_),h=Math.cos(_);return[(2*h+1)/3,(-Math.sqrt(3)*o-h+1)/3,(Math.sqrt(3)*o-h+1)/3]}const Wu=(_,o,h,d,g,v,E,I,P,k)=>{const N=g.transform;return{u_is_size_zoom_constant:+(_==="constant"||_==="source"),u_is_size_feature_constant:+(_==="constant"||_==="camera"),u_size_t:o?o.uSizeT:0,u_size:o?o.uSize:0,u_camera_to_center_distance:N.cameraToCenterDistance,u_pitch:N.pitch/360*2*Math.PI,u_rotate_symbol:+h,u_aspect_ratio:N.width/N.height,u_fade_change:g.options.fadeDuration?g.symbolFadeChange:1,u_matrix:v,u_label_plane_matrix:E,u_coord_matrix:I,u_is_text:+P,u_pitch_with_map:+d,u_texsize:k,u_texture:0}},Zu=(_,o,h,d,g,v,E,I,P,k,N)=>{const O=g.transform;return c.e(Wu(_,o,h,d,g,v,E,I,P,k),{u_gamma_scale:d?Math.cos(O._pitch)*O.cameraToCenterDistance:1,u_device_pixel_ratio:g.pixelRatio,u_is_halo:+N})},Hu=(_,o,h,d,g,v,E,I,P,k)=>c.e(Zu(_,o,h,d,g,v,E,I,!0,P,!0),{u_texsize_icon:k,u_texture_icon:1}),Ly=(_,o,h)=>({u_matrix:_,u_opacity:o,u_color:h}),Py=(_,o,h,d,g,v)=>c.e(function(E,I,P,k){const N=P.imageManager.getPattern(E.from.toString()),O=P.imageManager.getPattern(E.to.toString()),{width:j,height:tt}=P.imageManager.getPixelSize(),$=Math.pow(2,k.tileID.overscaledZ),ot=k.tileSize*Math.pow(2,P.transform.tileZoom)/$,K=ot*(k.tileID.canonical.x+k.tileID.wrap*$),ft=ot*k.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:N.tl,u_pattern_br_a:N.br,u_pattern_tl_b:O.tl,u_pattern_br_b:O.br,u_texsize:[j,tt],u_mix:I.t,u_pattern_size_a:N.displaySize,u_pattern_size_b:O.displaySize,u_scale_a:I.fromScale,u_scale_b:I.toScale,u_tile_units_to_pixels:1/Be(k,1,P.transform.tileZoom),u_pixel_coord_upper:[K>>16,ft>>16],u_pixel_coord_lower:[65535&K,65535&ft]}}(d,v,h,g),{u_matrix:_,u_opacity:o}),eg={fillExtrusion:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix),u_lightpos:new c.aK(_,o.u_lightpos),u_lightintensity:new c.aH(_,o.u_lightintensity),u_lightcolor:new c.aK(_,o.u_lightcolor),u_vertical_gradient:new c.aH(_,o.u_vertical_gradient),u_opacity:new c.aH(_,o.u_opacity)}),fillExtrusionPattern:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix),u_lightpos:new c.aK(_,o.u_lightpos),u_lightintensity:new c.aH(_,o.u_lightintensity),u_lightcolor:new c.aK(_,o.u_lightcolor),u_vertical_gradient:new c.aH(_,o.u_vertical_gradient),u_height_factor:new c.aH(_,o.u_height_factor),u_image:new c.aG(_,o.u_image),u_texsize:new c.aL(_,o.u_texsize),u_pixel_coord_upper:new c.aL(_,o.u_pixel_coord_upper),u_pixel_coord_lower:new c.aL(_,o.u_pixel_coord_lower),u_scale:new c.aK(_,o.u_scale),u_fade:new c.aH(_,o.u_fade),u_opacity:new c.aH(_,o.u_opacity)}),fill:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix)}),fillPattern:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix),u_image:new c.aG(_,o.u_image),u_texsize:new c.aL(_,o.u_texsize),u_pixel_coord_upper:new c.aL(_,o.u_pixel_coord_upper),u_pixel_coord_lower:new c.aL(_,o.u_pixel_coord_lower),u_scale:new c.aK(_,o.u_scale),u_fade:new c.aH(_,o.u_fade)}),fillOutline:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix),u_world:new c.aL(_,o.u_world)}),fillOutlinePattern:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix),u_world:new c.aL(_,o.u_world),u_image:new c.aG(_,o.u_image),u_texsize:new c.aL(_,o.u_texsize),u_pixel_coord_upper:new c.aL(_,o.u_pixel_coord_upper),u_pixel_coord_lower:new c.aL(_,o.u_pixel_coord_lower),u_scale:new c.aK(_,o.u_scale),u_fade:new c.aH(_,o.u_fade)}),circle:(_,o)=>({u_camera_to_center_distance:new c.aH(_,o.u_camera_to_center_distance),u_scale_with_map:new c.aG(_,o.u_scale_with_map),u_pitch_with_map:new c.aG(_,o.u_pitch_with_map),u_extrude_scale:new c.aL(_,o.u_extrude_scale),u_device_pixel_ratio:new c.aH(_,o.u_device_pixel_ratio),u_matrix:new c.aI(_,o.u_matrix)}),collisionBox:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix),u_camera_to_center_distance:new c.aH(_,o.u_camera_to_center_distance),u_pixels_to_tile_units:new c.aH(_,o.u_pixels_to_tile_units),u_extrude_scale:new c.aL(_,o.u_extrude_scale),u_overscale_factor:new c.aH(_,o.u_overscale_factor)}),collisionCircle:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix),u_inv_matrix:new c.aI(_,o.u_inv_matrix),u_camera_to_center_distance:new c.aH(_,o.u_camera_to_center_distance),u_viewport_size:new c.aL(_,o.u_viewport_size)}),debug:(_,o)=>({u_color:new c.aM(_,o.u_color),u_matrix:new c.aI(_,o.u_matrix),u_overlay:new c.aG(_,o.u_overlay),u_overlay_scale:new c.aH(_,o.u_overlay_scale)}),clippingMask:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix)}),heatmap:(_,o)=>({u_extrude_scale:new c.aH(_,o.u_extrude_scale),u_intensity:new c.aH(_,o.u_intensity),u_matrix:new c.aI(_,o.u_matrix)}),heatmapTexture:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix),u_world:new c.aL(_,o.u_world),u_image:new c.aG(_,o.u_image),u_color_ramp:new c.aG(_,o.u_color_ramp),u_opacity:new c.aH(_,o.u_opacity)}),hillshade:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix),u_image:new c.aG(_,o.u_image),u_latrange:new c.aL(_,o.u_latrange),u_light:new c.aL(_,o.u_light),u_shadow:new c.aM(_,o.u_shadow),u_highlight:new c.aM(_,o.u_highlight),u_accent:new c.aM(_,o.u_accent)}),hillshadePrepare:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix),u_image:new c.aG(_,o.u_image),u_dimension:new c.aL(_,o.u_dimension),u_zoom:new c.aH(_,o.u_zoom),u_unpack:new c.aJ(_,o.u_unpack)}),line:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix),u_ratio:new c.aH(_,o.u_ratio),u_device_pixel_ratio:new c.aH(_,o.u_device_pixel_ratio),u_units_to_pixels:new c.aL(_,o.u_units_to_pixels)}),lineGradient:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix),u_ratio:new c.aH(_,o.u_ratio),u_device_pixel_ratio:new c.aH(_,o.u_device_pixel_ratio),u_units_to_pixels:new c.aL(_,o.u_units_to_pixels),u_image:new c.aG(_,o.u_image),u_image_height:new c.aH(_,o.u_image_height)}),linePattern:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix),u_texsize:new c.aL(_,o.u_texsize),u_ratio:new c.aH(_,o.u_ratio),u_device_pixel_ratio:new c.aH(_,o.u_device_pixel_ratio),u_image:new c.aG(_,o.u_image),u_units_to_pixels:new c.aL(_,o.u_units_to_pixels),u_scale:new c.aK(_,o.u_scale),u_fade:new c.aH(_,o.u_fade)}),lineSDF:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix),u_ratio:new c.aH(_,o.u_ratio),u_device_pixel_ratio:new c.aH(_,o.u_device_pixel_ratio),u_units_to_pixels:new c.aL(_,o.u_units_to_pixels),u_patternscale_a:new c.aL(_,o.u_patternscale_a),u_patternscale_b:new c.aL(_,o.u_patternscale_b),u_sdfgamma:new c.aH(_,o.u_sdfgamma),u_image:new c.aG(_,o.u_image),u_tex_y_a:new c.aH(_,o.u_tex_y_a),u_tex_y_b:new c.aH(_,o.u_tex_y_b),u_mix:new c.aH(_,o.u_mix)}),raster:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix),u_tl_parent:new c.aL(_,o.u_tl_parent),u_scale_parent:new c.aH(_,o.u_scale_parent),u_buffer_scale:new c.aH(_,o.u_buffer_scale),u_fade_t:new c.aH(_,o.u_fade_t),u_opacity:new c.aH(_,o.u_opacity),u_image0:new c.aG(_,o.u_image0),u_image1:new c.aG(_,o.u_image1),u_brightness_low:new c.aH(_,o.u_brightness_low),u_brightness_high:new c.aH(_,o.u_brightness_high),u_saturation_factor:new c.aH(_,o.u_saturation_factor),u_contrast_factor:new c.aH(_,o.u_contrast_factor),u_spin_weights:new c.aK(_,o.u_spin_weights)}),symbolIcon:(_,o)=>({u_is_size_zoom_constant:new c.aG(_,o.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aG(_,o.u_is_size_feature_constant),u_size_t:new c.aH(_,o.u_size_t),u_size:new c.aH(_,o.u_size),u_camera_to_center_distance:new c.aH(_,o.u_camera_to_center_distance),u_pitch:new c.aH(_,o.u_pitch),u_rotate_symbol:new c.aG(_,o.u_rotate_symbol),u_aspect_ratio:new c.aH(_,o.u_aspect_ratio),u_fade_change:new c.aH(_,o.u_fade_change),u_matrix:new c.aI(_,o.u_matrix),u_label_plane_matrix:new c.aI(_,o.u_label_plane_matrix),u_coord_matrix:new c.aI(_,o.u_coord_matrix),u_is_text:new c.aG(_,o.u_is_text),u_pitch_with_map:new c.aG(_,o.u_pitch_with_map),u_texsize:new c.aL(_,o.u_texsize),u_texture:new c.aG(_,o.u_texture)}),symbolSDF:(_,o)=>({u_is_size_zoom_constant:new c.aG(_,o.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aG(_,o.u_is_size_feature_constant),u_size_t:new c.aH(_,o.u_size_t),u_size:new c.aH(_,o.u_size),u_camera_to_center_distance:new c.aH(_,o.u_camera_to_center_distance),u_pitch:new c.aH(_,o.u_pitch),u_rotate_symbol:new c.aG(_,o.u_rotate_symbol),u_aspect_ratio:new c.aH(_,o.u_aspect_ratio),u_fade_change:new c.aH(_,o.u_fade_change),u_matrix:new c.aI(_,o.u_matrix),u_label_plane_matrix:new c.aI(_,o.u_label_plane_matrix),u_coord_matrix:new c.aI(_,o.u_coord_matrix),u_is_text:new c.aG(_,o.u_is_text),u_pitch_with_map:new c.aG(_,o.u_pitch_with_map),u_texsize:new c.aL(_,o.u_texsize),u_texture:new c.aG(_,o.u_texture),u_gamma_scale:new c.aH(_,o.u_gamma_scale),u_device_pixel_ratio:new c.aH(_,o.u_device_pixel_ratio),u_is_halo:new c.aG(_,o.u_is_halo)}),symbolTextAndIcon:(_,o)=>({u_is_size_zoom_constant:new c.aG(_,o.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aG(_,o.u_is_size_feature_constant),u_size_t:new c.aH(_,o.u_size_t),u_size:new c.aH(_,o.u_size),u_camera_to_center_distance:new c.aH(_,o.u_camera_to_center_distance),u_pitch:new c.aH(_,o.u_pitch),u_rotate_symbol:new c.aG(_,o.u_rotate_symbol),u_aspect_ratio:new c.aH(_,o.u_aspect_ratio),u_fade_change:new c.aH(_,o.u_fade_change),u_matrix:new c.aI(_,o.u_matrix),u_label_plane_matrix:new c.aI(_,o.u_label_plane_matrix),u_coord_matrix:new c.aI(_,o.u_coord_matrix),u_is_text:new c.aG(_,o.u_is_text),u_pitch_with_map:new c.aG(_,o.u_pitch_with_map),u_texsize:new c.aL(_,o.u_texsize),u_texsize_icon:new c.aL(_,o.u_texsize_icon),u_texture:new c.aG(_,o.u_texture),u_texture_icon:new c.aG(_,o.u_texture_icon),u_gamma_scale:new c.aH(_,o.u_gamma_scale),u_device_pixel_ratio:new c.aH(_,o.u_device_pixel_ratio),u_is_halo:new c.aG(_,o.u_is_halo)}),background:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix),u_opacity:new c.aH(_,o.u_opacity),u_color:new c.aM(_,o.u_color)}),backgroundPattern:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix),u_opacity:new c.aH(_,o.u_opacity),u_image:new c.aG(_,o.u_image),u_pattern_tl_a:new c.aL(_,o.u_pattern_tl_a),u_pattern_br_a:new c.aL(_,o.u_pattern_br_a),u_pattern_tl_b:new c.aL(_,o.u_pattern_tl_b),u_pattern_br_b:new c.aL(_,o.u_pattern_br_b),u_texsize:new c.aL(_,o.u_texsize),u_mix:new c.aH(_,o.u_mix),u_pattern_size_a:new c.aL(_,o.u_pattern_size_a),u_pattern_size_b:new c.aL(_,o.u_pattern_size_b),u_scale_a:new c.aH(_,o.u_scale_a),u_scale_b:new c.aH(_,o.u_scale_b),u_pixel_coord_upper:new c.aL(_,o.u_pixel_coord_upper),u_pixel_coord_lower:new c.aL(_,o.u_pixel_coord_lower),u_tile_units_to_pixels:new c.aH(_,o.u_tile_units_to_pixels)}),terrain:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix),u_texture:new c.aG(_,o.u_texture),u_ele_delta:new c.aH(_,o.u_ele_delta)}),terrainDepth:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix),u_ele_delta:new c.aH(_,o.u_ele_delta)}),terrainCoords:(_,o)=>({u_matrix:new c.aI(_,o.u_matrix),u_texture:new c.aG(_,o.u_texture),u_terrain_coords_id:new c.aH(_,o.u_terrain_coords_id),u_ele_delta:new c.aH(_,o.u_ele_delta)})};class My{constructor(o,h,d){this.context=o;const g=o.gl;this.buffer=g.createBuffer(),this.dynamicDraw=!!d,this.context.unbindVAO(),o.bindElementBuffer.set(this.buffer),g.bufferData(g.ELEMENT_ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?g.DYNAMIC_DRAW:g.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(o){const h=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),h.bufferSubData(h.ELEMENT_ARRAY_BUFFER,0,o.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const ml={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Xc{constructor(o,h,d,g){this.length=h.length,this.attributes=d,this.itemSize=h.bytesPerElement,this.dynamicDraw=g,this.context=o;const v=o.gl;this.buffer=v.createBuffer(),o.bindVertexBuffer.set(this.buffer),v.bufferData(v.ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?v.DYNAMIC_DRAW:v.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(o){if(o.length!==this.length)throw new Error(`Length of new data is ${o.length}, which doesn't match current length of ${this.length}`);const h=this.context.gl;this.bind(),h.bufferSubData(h.ARRAY_BUFFER,0,o.arrayBuffer)}enableAttributes(o,h){for(let d=0;d0){const Kt=c.F(),te=Nt;c.aP(Kt,kt.placementInvProjMatrix,_.transform.glCoordMatrix),c.aP(Kt,Kt,kt.placementViewportMatrix),N.push({circleArray:Gt,circleOffset:j,transform:te,invTransform:Kt,coord:vt}),O+=Gt.length/4,j=O}jt&&k.draw(I,P.LINES,gn.disabled,Kn.disabled,_.colorModeForRenderPass(),qn.disabled,Kd(Nt,_.transform,Lt),_.style.map.terrain&&_.style.map.terrain.getTerrainData(vt),h.id,jt.layoutVertexBuffer,jt.indexBuffer,jt.segments,null,_.transform.zoom,null,null,jt.collisionVertexBuffer)}if(!E||!N.length)return;const tt=_.useProgram("collisionCircle"),$=new c.aQ;$.resize(4*O),$._trim();let ot=0;for(const st of N)for(let vt=0;vt=0&&($[K.associatedIconIndex]={shiftedAnchor:He,angle:ne})}else Ft(K.numGlyphs,j)}if(k){tt.clear();const ot=_.icon.placedSymbolArray;for(let K=0;K_.style.map.terrain.getElevation(jt,Go,Gr):null,lr=h.layout.get("text-rotation-alignment")==="map";U(Kt,jt.posMatrix,_,g,So,ks,K,k,lr,Ur)}const Ua=_.translatePosMatrix(jt.posMatrix,Gt,v,E),Ds=ft||g&&kt||ac?Hp:So,Vr=_.translatePosMatrix(ks,Gt,v,E,!0),ar=ne&&h.paint.get(g?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let er;er=ne?Kt.iconsInText?Hu(Ae.kind,Ne,Tt,K,_,Ua,Ds,Vr,en,Hr):Zu(Ae.kind,Ne,Tt,K,_,Ua,Ds,Vr,g,en,!0):Wu(Ae.kind,Ne,Tt,K,_,Ua,Ds,Vr,g,en);const Uo={program:mn,buffers:te,uniformValues:er,atlasTexture:mr,atlasTextureIcon:sr,atlasInterpolation:Rn,atlasInterpolationIcon:wo,isSDF:ne,hasHalo:ar};if(st&&Kt.canOverlap){vt=!0;const Ur=te.segments.get();for(const lr of Ur)Nt.push({segments:new c.$([lr]),sortKey:lr.sortKey,state:Uo,terrainData:Je})}else Nt.push({segments:te.segments,sortKey:0,state:Uo,terrainData:Je})}vt&&Nt.sort((jt,Gt)=>jt.sortKey-Gt.sortKey);for(const jt of Nt){const Gt=jt.state;if(j.activeTexture.set(tt.TEXTURE0),Gt.atlasTexture.bind(Gt.atlasInterpolation,tt.CLAMP_TO_EDGE),Gt.atlasTextureIcon&&(j.activeTexture.set(tt.TEXTURE1),Gt.atlasTextureIcon&&Gt.atlasTextureIcon.bind(Gt.atlasInterpolationIcon,tt.CLAMP_TO_EDGE)),Gt.isSDF){const Kt=Gt.uniformValues;Gt.hasHalo&&(Kt.u_is_halo=1,cg(Gt.buffers,jt.segments,h,_,Gt.program,Lt,N,O,Kt,jt.terrainData)),Kt.u_is_halo=0}cg(Gt.buffers,jt.segments,h,_,Gt.program,Lt,N,O,Gt.uniformValues,jt.terrainData)}}function cg(_,o,h,d,g,v,E,I,P,k){const N=d.context;g.draw(N,N.gl.TRIANGLES,v,E,I,qn.disabled,P,k,h.id,_.layoutVertexBuffer,_.indexBuffer,o,h.paint,d.transform.zoom,_.programConfigurations.get(h.id),_.dynamicLayoutVertexBuffer,_.opacityVertexBuffer)}function oh(_,o,h,d,g){if(!h||!d||!d.imageAtlas)return;const v=d.imageAtlas.patternPositions;let E=v[h.to.toString()],I=v[h.from.toString()];if(!E&&I&&(E=I),!I&&E&&(I=E),!E||!I){const P=g.getPaintProperty(o);E=v[P],I=v[P]}E&&I&&_.setConstantPatternPositions(E,I)}function hg(_,o,h,d,g,v,E){const I=_.context.gl,P="fill-pattern",k=h.paint.get(P),N=k&&k.constantOr(1),O=h.getCrossfadeParameters();let j,tt,$,ot,K;E?(tt=N&&!h.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",j=I.LINES):(tt=N?"fillPattern":"fill",j=I.TRIANGLES);const ft=k.constantOr(null);for(const Tt of d){const st=o.getTile(Tt);if(N&&!st.patternsLoaded())continue;const vt=st.getBucket(h);if(!vt)continue;const Lt=vt.programConfigurations.get(h.id),kt=_.useProgram(tt,Lt),Nt=_.style.map.terrain&&_.style.map.terrain.getTerrainData(Tt);N&&(_.context.activeTexture.set(I.TEXTURE0),st.imageAtlasTexture.bind(I.LINEAR,I.CLAMP_TO_EDGE),Lt.updatePaintBuffers(O)),oh(Lt,P,ft,st,h);const jt=Nt?Tt:null,Gt=_.translatePosMatrix(jt?jt.posMatrix:Tt.posMatrix,st,h.paint.get("fill-translate"),h.paint.get("fill-translate-anchor"));if(E){ot=vt.indexBuffer2,K=vt.segments2;const Kt=[I.drawingBufferWidth,I.drawingBufferHeight];$=tt==="fillOutlinePattern"&&N?Yd(Gt,_,O,st,Kt):Cy(Gt,Kt)}else ot=vt.indexBuffer,K=vt.segments,$=N?jc(Gt,_,O,st):Xd(Gt);kt.draw(_.context,j,g,_.stencilModeForClipping(Tt),v,qn.disabled,$,Nt,h.id,vt.layoutVertexBuffer,ot,K,h.paint,_.transform.zoom,Lt)}}function sh(_,o,h,d,g,v,E){const I=_.context,P=I.gl,k="fill-extrusion-pattern",N=h.paint.get(k),O=N.constantOr(1),j=h.getCrossfadeParameters(),tt=h.paint.get("fill-extrusion-opacity"),$=N.constantOr(null);for(const ot of d){const K=o.getTile(ot),ft=K.getBucket(h);if(!ft)continue;const Tt=_.style.map.terrain&&_.style.map.terrain.getTerrainData(ot),st=ft.programConfigurations.get(h.id),vt=_.useProgram(O?"fillExtrusionPattern":"fillExtrusion",st);O&&(_.context.activeTexture.set(P.TEXTURE0),K.imageAtlasTexture.bind(P.LINEAR,P.CLAMP_TO_EDGE),st.updatePaintBuffers(j)),oh(st,k,$,K,h);const Lt=_.translatePosMatrix(ot.posMatrix,K,h.paint.get("fill-extrusion-translate"),h.paint.get("fill-extrusion-translate-anchor")),kt=h.paint.get("fill-extrusion-vertical-gradient"),Nt=O?Iy(Lt,_,kt,tt,ot,j,K):Gu(Lt,_,kt,tt);vt.draw(I,I.gl.TRIANGLES,g,v,E,qn.backCCW,Nt,Tt,h.id,ft.layoutVertexBuffer,ft.indexBuffer,ft.segments,h.paint,_.transform.zoom,st,_.style.map.terrain&&ft.centroidVertexBuffer)}}function ah(_,o,h,d,g,v,E){const I=_.context,P=I.gl,k=h.fbo;if(!k)return;const N=_.useProgram("hillshade"),O=_.style.map.terrain&&_.style.map.terrain.getTerrainData(o);I.activeTexture.set(P.TEXTURE0),P.bindTexture(P.TEXTURE_2D,k.colorAttachment.get()),N.draw(I,P.TRIANGLES,g,v,E,qn.disabled,((j,tt,$,ot)=>{const K=$.paint.get("hillshade-shadow-color"),ft=$.paint.get("hillshade-highlight-color"),Tt=$.paint.get("hillshade-accent-color");let st=$.paint.get("hillshade-illumination-direction")*(Math.PI/180);$.paint.get("hillshade-illumination-anchor")==="viewport"&&(st-=j.transform.angle);const vt=!j.options.moving;return{u_matrix:ot?ot.posMatrix:j.transform.calculatePosMatrix(tt.tileID.toUnwrapped(),vt),u_image:0,u_latrange:$d(0,tt.tileID),u_light:[$.paint.get("hillshade-exaggeration"),st],u_shadow:K,u_highlight:ft,u_accent:Tt}})(_,h,d,O?o:null),O,d.id,_.rasterBoundsBuffer,_.quadTriangleIndexBuffer,_.rasterBoundsSegments)}function Xp(_,o,h,d,g,v){const E=_.context,I=E.gl,P=o.dem;if(P&&P.data){const k=P.dim,N=P.stride,O=P.getPixels();if(E.activeTexture.set(I.TEXTURE1),E.pixelStoreUnpackPremultiplyAlpha.set(!1),o.demTexture=o.demTexture||_.getTileTexture(N),o.demTexture){const tt=o.demTexture;tt.update(O,{premultiply:!1}),tt.bind(I.NEAREST,I.CLAMP_TO_EDGE)}else o.demTexture=new dt(E,O,I.RGBA,{premultiply:!1}),o.demTexture.bind(I.NEAREST,I.CLAMP_TO_EDGE);E.activeTexture.set(I.TEXTURE0);let j=o.fbo;if(!j){const tt=new dt(E,{width:k,height:k,data:null},I.RGBA);tt.bind(I.LINEAR,I.CLAMP_TO_EDGE),j=o.fbo=E.createFramebuffer(k,k,!0,!1),j.colorAttachment.set(tt.texture)}E.bindFramebuffer.set(j.framebuffer),E.viewport.set([0,0,k,k]),_.useProgram("hillshadePrepare").draw(E,I.TRIANGLES,d,g,v,qn.disabled,((tt,$)=>{const ot=$.stride,K=c.F();return c.aN(K,0,c.W,-c.W,0,0,1),c.H(K,K,[0,-c.W,0]),{u_matrix:K,u_image:1,u_dimension:[ot,ot],u_zoom:tt.overscaledZ,u_unpack:$.getUnpackVector()}})(o.tileID,P),null,h.id,_.rasterBoundsBuffer,_.quadTriangleIndexBuffer,_.rasterBoundsSegments),o.needsHillshadePrepare=!1}}function pg(_,o,h,d,g,v){const E=d.paint.get("raster-fade-duration");if(!v&&E>0){const I=L.now(),P=(I-_.timeAdded)/E,k=o?(I-o.timeAdded)/E:-1,N=h.getSource(),O=g.coveringZoomLevel({tileSize:N.tileSize,roundZoom:N.roundZoom}),j=!o||Math.abs(o.tileID.overscaledZ-O)>Math.abs(_.tileID.overscaledZ-O),tt=j&&_.refreshedUponExpiration?1:c.ac(j?P:1-k,0,1);return _.refreshedUponExpiration&&P>=1&&(_.refreshedUponExpiration=!1),o?{opacity:1,mix:1-tt}:{opacity:tt,mix:0}}return{opacity:1,mix:0}}const fg=new c.aO(1,0,0,1),lh=new c.aO(0,1,0,1),Yp=new c.aO(0,0,1,1),By=new c.aO(1,0,1,1),dg=new c.aO(0,1,1,1);function dr(_,o,h,d){ji(_,0,o+h/2,_.transform.width,h,d)}function Oa(_,o,h,d){ji(_,o-h/2,0,h,_.transform.height,d)}function ji(_,o,h,d,g,v){const E=_.context,I=E.gl;I.enable(I.SCISSOR_TEST),I.scissor(o*_.pixelRatio,h*_.pixelRatio,d*_.pixelRatio,g*_.pixelRatio),E.clear({color:v}),I.disable(I.SCISSOR_TEST)}function Kp(_,o,h){const d=_.context,g=d.gl,v=h.posMatrix,E=_.useProgram("debug"),I=gn.disabled,P=Kn.disabled,k=_.colorModeForRenderPass(),N="$debug",O=_.style.map.terrain&&_.style.map.terrain.getTerrainData(h);d.activeTexture.set(g.TEXTURE0);const j=o.getTileByID(h.key).latestRawTileData,tt=Math.floor((j&&j.byteLength||0)/1024),$=o.getTile(h).tileSize,ot=512/Math.min($,512)*(h.overscaledZ/_.transform.zoom)*.5;let K=h.canonical.toString();h.overscaledZ!==h.canonical.z&&(K+=` => ${h.overscaledZ}`),function(ft,Tt){ft.initDebugOverlayCanvas();const st=ft.debugOverlayCanvas,vt=ft.context.gl,Lt=ft.debugOverlayCanvas.getContext("2d");Lt.clearRect(0,0,st.width,st.height),Lt.shadowColor="white",Lt.shadowBlur=2,Lt.lineWidth=1.5,Lt.strokeStyle="white",Lt.textBaseline="top",Lt.font="bold 36px Open Sans, sans-serif",Lt.fillText(Tt,5,5),Lt.strokeText(Tt,5,5),ft.debugOverlayTexture.update(st),ft.debugOverlayTexture.bind(vt.LINEAR,vt.CLAMP_TO_EDGE)}(_,`${K} ${tt}kB`),E.draw(d,g.TRIANGLES,I,P,Lr.alphaBlended,qn.disabled,Jd(v,c.aO.transparent,ot),null,N,_.debugBuffer,_.quadTriangleIndexBuffer,_.debugSegments),E.draw(d,g.LINE_STRIP,I,P,k,qn.disabled,Jd(v,c.aO.red),O,N,_.debugBuffer,_.tileBorderIndexBuffer,_.debugSegments)}function uh(_,o,h){const d=_.context,g=d.gl,v=_.colorModeForRenderPass(),E=new gn(g.LEQUAL,gn.ReadWrite,_.depthRangeFor3D),I=_.useProgram("terrain"),P=o.getTerrainMesh();d.bindFramebuffer.set(null),d.viewport.set([0,0,_.width,_.height]);for(const k of h){const N=_.renderToTexture.getTexture(k),O=o.getTerrainData(k.tileID);d.activeTexture.set(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,N.texture);const j={u_matrix:_.transform.calculatePosMatrix(k.tileID.toUnwrapped()),u_texture:0,u_ele_delta:o.getMeshFrameDelta(_.transform.zoom)};I.draw(d,g.TRIANGLES,E,Kn.disabled,v,qn.backCCW,j,O,"terrain",P.vertexBuffer,P.indexBuffer,P.segments)}}class gg{constructor(o,h){this.context=new Fy(o),this.transform=h,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:c.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=zr.maxUnderzooming+zr.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Ra}resize(o,h,d){if(this.width=Math.floor(o*d),this.height=Math.floor(h*d),this.pixelRatio=d,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const g of this.style._order)this.style._layers[g].resize()}setup(){const o=this.context,h=new c.aV;h.emplaceBack(0,0),h.emplaceBack(c.W,0),h.emplaceBack(0,c.W),h.emplaceBack(c.W,c.W),this.tileExtentBuffer=o.createVertexBuffer(h,Vc.members),this.tileExtentSegments=c.$.simpleSegment(0,0,4,2);const d=new c.aV;d.emplaceBack(0,0),d.emplaceBack(c.W,0),d.emplaceBack(0,c.W),d.emplaceBack(c.W,c.W),this.debugBuffer=o.createVertexBuffer(d,Vc.members),this.debugSegments=c.$.simpleSegment(0,0,4,5);const g=new c.Z;g.emplaceBack(0,0,0,0),g.emplaceBack(c.W,0,c.W,0),g.emplaceBack(0,c.W,0,c.W),g.emplaceBack(c.W,c.W,c.W,c.W),this.rasterBoundsBuffer=o.createVertexBuffer(g,Qe.members),this.rasterBoundsSegments=c.$.simpleSegment(0,0,4,2);const v=new c.aV;v.emplaceBack(0,0),v.emplaceBack(1,0),v.emplaceBack(0,1),v.emplaceBack(1,1),this.viewportBuffer=o.createVertexBuffer(v,Vc.members),this.viewportSegments=c.$.simpleSegment(0,0,4,2);const E=new c.aW;E.emplaceBack(0),E.emplaceBack(1),E.emplaceBack(3),E.emplaceBack(2),E.emplaceBack(0),this.tileBorderIndexBuffer=o.createIndexBuffer(E);const I=new c.aX;I.emplaceBack(0,1,2),I.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=o.createIndexBuffer(I);const P=this.context.gl;this.stencilClearMode=new Kn({func:P.ALWAYS,mask:0},0,255,P.ZERO,P.ZERO,P.ZERO)}clearStencil(){const o=this.context,h=o.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const d=c.F();c.aN(d,0,this.width,this.height,0,0,1),c.J(d,d,[h.drawingBufferWidth,h.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(o,h.TRIANGLES,gn.disabled,this.stencilClearMode,Lr.disabled,qn.disabled,qc(d),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(o,h){if(this.currentStencilSource===o.source||!o.isTileClipped()||!h||!h.length)return;this.currentStencilSource=o.source;const d=this.context,g=d.gl;this.nextStencilID+h.length>256&&this.clearStencil(),d.setColorMode(Lr.disabled),d.setDepthMode(gn.disabled);const v=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const E of h){const I=this._tileClippingMaskIDs[E.key]=this.nextStencilID++,P=this.style.map.terrain&&this.style.map.terrain.getTerrainData(E);v.draw(d,g.TRIANGLES,gn.disabled,new Kn({func:g.ALWAYS,mask:0},I,255,g.KEEP,g.KEEP,g.REPLACE),Lr.disabled,qn.disabled,qc(E.posMatrix),P,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const o=this.nextStencilID++,h=this.context.gl;return new Kn({func:h.NOTEQUAL,mask:255},o,255,h.KEEP,h.KEEP,h.REPLACE)}stencilModeForClipping(o){const h=this.context.gl;return new Kn({func:h.EQUAL,mask:255},this._tileClippingMaskIDs[o.key],0,h.KEEP,h.KEEP,h.REPLACE)}stencilConfigForOverlap(o){const h=this.context.gl,d=o.sort((E,I)=>I.overscaledZ-E.overscaledZ),g=d[d.length-1].overscaledZ,v=d[0].overscaledZ-g+1;if(v>1){this.currentStencilSource=void 0,this.nextStencilID+v>256&&this.clearStencil();const E={};for(let I=0;I=0;this.currentLayer--){const P=this.style._layers[d[this.currentLayer]],k=g[P.source],N=v[P.source];this._renderTileClippingMasks(P,N),this.renderLayer(this,k,P,N)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerK.source&&!K.isHidden(N)?[k.sourceCaches[K.source]]:[]),tt=j.filter(K=>K.getSource().type==="vector"),$=j.filter(K=>K.getSource().type!=="vector"),ot=K=>{(!O||O.getSource().maxzoomot(K)),O||$.forEach(K=>ot(K)),O}(this.style,this.transform.zoom);P&&function(k,N,O){for(let j=0;j0),g&&(c.a_(h,d),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(v,E){const I=v.context,P=I.gl,k=Lr.unblended,N=new gn(P.LEQUAL,gn.ReadWrite,[0,1]),O=E.getTerrainMesh(),j=E.sourceCache.getRenderableTiles(),tt=v.useProgram("terrainDepth");I.bindFramebuffer.set(E.getFramebuffer("depth").framebuffer),I.viewport.set([0,0,v.width/devicePixelRatio,v.height/devicePixelRatio]),I.clear({color:c.aO.transparent,depth:1});for(const $ of j){const ot=E.getTerrainData($.tileID),K={u_matrix:v.transform.calculatePosMatrix($.tileID.toUnwrapped()),u_ele_delta:E.getMeshFrameDelta(v.transform.zoom)};tt.draw(I,P.TRIANGLES,N,Kn.disabled,k,qn.backCCW,K,ot,"terrain",O.vertexBuffer,O.indexBuffer,O.segments)}I.bindFramebuffer.set(null),I.viewport.set([0,0,v.width,v.height])}(this,this.style.map.terrain),function(v,E){const I=v.context,P=I.gl,k=Lr.unblended,N=new gn(P.LEQUAL,gn.ReadWrite,[0,1]),O=E.getTerrainMesh(),j=E.getCoordsTexture(),tt=E.sourceCache.getRenderableTiles(),$=v.useProgram("terrainCoords");I.bindFramebuffer.set(E.getFramebuffer("coords").framebuffer),I.viewport.set([0,0,v.width/devicePixelRatio,v.height/devicePixelRatio]),I.clear({color:c.aO.transparent,depth:1}),E.coordsIndex=[];for(const ot of tt){const K=E.getTerrainData(ot.tileID);I.activeTexture.set(P.TEXTURE0),P.bindTexture(P.TEXTURE_2D,j.texture);const ft={u_matrix:v.transform.calculatePosMatrix(ot.tileID.toUnwrapped()),u_terrain_coords_id:(255-E.coordsIndex.length)/255,u_texture:0,u_ele_delta:E.getMeshFrameDelta(v.transform.zoom)};$.draw(I,P.TRIANGLES,N,Kn.disabled,k,qn.backCCW,ft,K,"terrain",O.vertexBuffer,O.indexBuffer,O.segments),E.coordsIndex.push(ot.tileID.key)}I.bindFramebuffer.set(null),I.viewport.set([0,0,v.width,v.height])}(this,this.style.map.terrain))}renderLayer(o,h,d,g){if(!d.isHidden(this.transform.zoom)&&(d.type==="background"||d.type==="custom"||(g||[]).length))switch(this.id=d.id,d.type){case"symbol":(function(v,E,I,P,k){if(v.renderPass!=="translucent")return;const N=Kn.disabled,O=v.colorModeForRenderPass();(I._unevaluatedLayout.hasValue("text-variable-anchor")||I._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(j,tt,$,ot,K,ft,Tt){const st=tt.transform,vt=K==="map",Lt=ft==="map";for(const kt of j){const Nt=ot.getTile(kt),jt=Nt.getBucket($);if(!jt||!jt.text||!jt.text.segments.get().length)continue;const Gt=c.ag(jt.textSizeData,st.zoom),Kt=Be(Nt,1,tt.transform.zoom),te=Ge(kt.posMatrix,Lt,vt,tt.transform,Kt),He=$.layout.get("icon-text-fit")!=="none"&&jt.hasIconData();if(Gt){const ne=Math.pow(2,st.zoom-Nt.tileID.overscaledZ);nh(jt,vt,Lt,Tt,st,te,kt.posMatrix,ne,Gt,He,tt.style.map.terrain?(Ae,Xe)=>tt.style.map.terrain.getElevation(kt,Ae,Xe):null)}}}(P,v,I,E,I.layout.get("text-rotation-alignment"),I.layout.get("text-pitch-alignment"),k),I.paint.get("icon-opacity").constantOr(1)!==0&&ih(v,E,I,P,!1,I.paint.get("icon-translate"),I.paint.get("icon-translate-anchor"),I.layout.get("icon-rotation-alignment"),I.layout.get("icon-pitch-alignment"),I.layout.get("icon-keep-upright"),N,O),I.paint.get("text-opacity").constantOr(1)!==0&&ih(v,E,I,P,!0,I.paint.get("text-translate"),I.paint.get("text-translate-anchor"),I.layout.get("text-rotation-alignment"),I.layout.get("text-pitch-alignment"),I.layout.get("text-keep-upright"),N,O),E.map.showCollisionBoxes&&(eh(v,E,I,P,I.paint.get("text-translate"),I.paint.get("text-translate-anchor"),!0),eh(v,E,I,P,I.paint.get("icon-translate"),I.paint.get("icon-translate-anchor"),!1))})(o,h,d,g,this.style.placement.variableOffsets);break;case"circle":(function(v,E,I,P){if(v.renderPass!=="translucent")return;const k=I.paint.get("circle-opacity"),N=I.paint.get("circle-stroke-width"),O=I.paint.get("circle-stroke-opacity"),j=!I.layout.get("circle-sort-key").isConstant();if(k.constantOr(1)===0&&(N.constantOr(1)===0||O.constantOr(1)===0))return;const tt=v.context,$=tt.gl,ot=v.depthModeForSublayer(0,gn.ReadOnly),K=Kn.disabled,ft=v.colorModeForRenderPass(),Tt=[];for(let st=0;stst.sortKey-vt.sortKey);for(const st of Tt){const{programConfiguration:vt,program:Lt,layoutVertexBuffer:kt,indexBuffer:Nt,uniformValues:jt,terrainData:Gt}=st.state;Lt.draw(tt,$.TRIANGLES,ot,K,ft,qn.disabled,jt,Gt,I.id,kt,Nt,st.segments,I.paint,v.transform.zoom,vt)}})(o,h,d,g);break;case"heatmap":(function(v,E,I,P){if(I.paint.get("heatmap-opacity")!==0)if(v.renderPass==="offscreen"){const k=v.context,N=k.gl,O=Kn.disabled,j=new Lr([N.ONE,N.ONE],c.aO.transparent,[!0,!0,!0,!0]);(function(tt,$,ot){const K=tt.gl;tt.activeTexture.set(K.TEXTURE1),tt.viewport.set([0,0,$.width/4,$.height/4]);let ft=ot.heatmapFbo;if(ft)K.bindTexture(K.TEXTURE_2D,ft.colorAttachment.get()),tt.bindFramebuffer.set(ft.framebuffer);else{const Tt=K.createTexture();K.bindTexture(K.TEXTURE_2D,Tt),K.texParameteri(K.TEXTURE_2D,K.TEXTURE_WRAP_S,K.CLAMP_TO_EDGE),K.texParameteri(K.TEXTURE_2D,K.TEXTURE_WRAP_T,K.CLAMP_TO_EDGE),K.texParameteri(K.TEXTURE_2D,K.TEXTURE_MIN_FILTER,K.LINEAR),K.texParameteri(K.TEXTURE_2D,K.TEXTURE_MAG_FILTER,K.LINEAR),ft=ot.heatmapFbo=tt.createFramebuffer($.width/4,$.height/4,!1,!1),function(st,vt,Lt,kt){var Nt,jt;const Gt=st.gl,Kt=(Nt=st.HALF_FLOAT)!==null&&Nt!==void 0?Nt:Gt.UNSIGNED_BYTE,te=(jt=st.RGBA16F)!==null&&jt!==void 0?jt:Gt.RGBA;Gt.texImage2D(Gt.TEXTURE_2D,0,te,vt.width/4,vt.height/4,0,Gt.RGBA,Kt,null),kt.colorAttachment.set(Lt)}(tt,$,Tt,ft)}})(k,v,I),k.clear({color:c.aO.transparent});for(let tt=0;tt{const st=c.F();c.aN(st,0,ot.width,ot.height,0,0,1);const vt=ot.context.gl;return{u_matrix:st,u_world:[vt.drawingBufferWidth,vt.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:K.paint.get("heatmap-opacity")}})(k,N),null,N.id,k.viewportBuffer,k.quadTriangleIndexBuffer,k.viewportSegments,N.paint,k.transform.zoom)}(v,I))})(o,h,d,g);break;case"line":(function(v,E,I,P){if(v.renderPass!=="translucent")return;const k=I.paint.get("line-opacity"),N=I.paint.get("line-width");if(k.constantOr(1)===0||N.constantOr(1)===0)return;const O=v.depthModeForSublayer(0,gn.ReadOnly),j=v.colorModeForRenderPass(),tt=I.paint.get("line-dasharray"),$=I.paint.get("line-pattern"),ot=$.constantOr(1),K=I.paint.get("line-gradient"),ft=I.getCrossfadeParameters(),Tt=ot?"linePattern":tt?"lineSDF":K?"lineGradient":"line",st=v.context,vt=st.gl;let Lt=!0;for(const kt of P){const Nt=E.getTile(kt);if(ot&&!Nt.patternsLoaded())continue;const jt=Nt.getBucket(I);if(!jt)continue;const Gt=jt.programConfigurations.get(I.id),Kt=v.context.program.get(),te=v.useProgram(Tt,Gt),He=Lt||te.program!==Kt,ne=v.style.map.terrain&&v.style.map.terrain.getTerrainData(kt),Ae=$.constantOr(null);if(Ae&&Nt.imageAtlas){const Ne=Nt.imageAtlas,Je=Ne.patternPositions[Ae.to.toString()],en=Ne.patternPositions[Ae.from.toString()];Je&&en&&Gt.setConstantPatternPositions(Je,en)}const Xe=ne?kt:null,mn=ot?gl(v,Nt,I,ft,Xe):tt?Zc(v,Nt,I,tt,ft,Xe):K?tg(v,Nt,I,jt.lineClipsArray.length,Xe):Wc(v,Nt,I,Xe);if(ot)st.activeTexture.set(vt.TEXTURE0),Nt.imageAtlasTexture.bind(vt.LINEAR,vt.CLAMP_TO_EDGE),Gt.updatePaintBuffers(ft);else if(tt&&(He||v.lineAtlas.dirty))st.activeTexture.set(vt.TEXTURE0),v.lineAtlas.bind(st);else if(K){const Ne=jt.gradients[I.id];let Je=Ne.texture;if(I.gradientVersion!==Ne.version){let en=256;if(I.stepInterpolant){const mr=E.getSource().maxzoom,Rn=kt.canonical.z===mr?Math.ceil(1<0?h.pop():null}isPatternMissing(o){if(!o)return!1;if(!o.from||!o.to)return!0;const h=this.imageManager.getPattern(o.from.toString()),d=this.imageManager.getPattern(o.to.toString());return!h||!d}useProgram(o,h){this.cache=this.cache||{};const d=o+(h?h.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[d]||(this.cache[d]=new Na(this.context,Uu[o],h,eg[o],this._showOverdrawInspector,this.style.map.terrain)),this.cache[d]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const o=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(o.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new dt(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:o,drawingBufferHeight:h}=this.context.gl;return this.width!==o||this.height!==h}}class za{constructor(o,h){this.points=o,this.planes=h}static fromInvProjectionMatrix(o,h,d){const g=Math.pow(2,d),v=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(I=>{const P=1/(I=c.af([],I,o))[3]/h*g;return c.a$(I,I,[P,P,1/I[3],P])}),E=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(I=>{const P=function(j,tt){var $=tt[0],ot=tt[1],K=tt[2],ft=$*$+ot*ot+K*K;return ft>0&&(ft=1/Math.sqrt(ft)),j[0]=tt[0]*ft,j[1]=tt[1]*ft,j[2]=tt[2]*ft,j}([],function(j,tt,$){var ot=tt[0],K=tt[1],ft=tt[2],Tt=$[0],st=$[1],vt=$[2];return j[0]=K*vt-ft*st,j[1]=ft*Tt-ot*vt,j[2]=ot*st-K*Tt,j}([],bt([],v[I[0]],v[I[1]]),bt([],v[I[2]],v[I[1]]))),k=-((N=P)[0]*(O=v[I[1]])[0]+N[1]*O[1]+N[2]*O[2]);var N,O;return P.concat(k)});return new za(v,E)}}class Fa{constructor(o,h){this.min=o,this.max=h,this.center=function(d,g,v){return d[0]=.5*g[0],d[1]=.5*g[1],d[2]=.5*g[2],d}([],function(d,g,v){return d[0]=g[0]+v[0],d[1]=g[1]+v[1],d[2]=g[2]+v[2],d}([],this.min,this.max))}quadrant(o){const h=[o%2==0,o<2],d=_t(this.min),g=_t(this.max);for(let v=0;v=0&&E++;if(E===0)return 0;E!==h.length&&(d=!1)}if(d)return 2;for(let g=0;g<3;g++){let v=Number.MAX_VALUE,E=-Number.MAX_VALUE;for(let I=0;Ithis.max[g]-this.min[g])return 0}return 1}}class ru{constructor(o=0,h=0,d=0,g=0){if(isNaN(o)||o<0||isNaN(h)||h<0||isNaN(d)||d<0||isNaN(g)||g<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=o,this.bottom=h,this.left=d,this.right=g}interpolate(o,h,d){return h.top!=null&&o.top!=null&&(this.top=c.z.number(o.top,h.top,d)),h.bottom!=null&&o.bottom!=null&&(this.bottom=c.z.number(o.bottom,h.bottom,d)),h.left!=null&&o.left!=null&&(this.left=c.z.number(o.left,h.left,d)),h.right!=null&&o.right!=null&&(this.right=c.z.number(o.right,h.right,d)),this}getCenter(o,h){const d=c.ac((this.left+o-this.right)/2,0,o),g=c.ac((this.top+h-this.bottom)/2,0,h);return new c.P(d,g)}equals(o){return this.top===o.top&&this.bottom===o.bottom&&this.left===o.left&&this.right===o.right}clone(){return new ru(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Jp=85.051129;class ch{constructor(o,h,d,g,v){this.tileSize=512,this._renderWorldCopies=v===void 0||!!v,this._minZoom=o||0,this._maxZoom=h||22,this._minPitch=d??0,this._maxPitch=g??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new c.M(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new ru,this._posMatrixCache={},this._alignedPosMatrixCache={},this.minElevationForCurrentTile=0}clone(){const o=new ch(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return o.apply(this),o}apply(o){this.tileSize=o.tileSize,this.latRange=o.latRange,this.width=o.width,this.height=o.height,this._center=o._center,this._elevation=o._elevation,this.minElevationForCurrentTile=o.minElevationForCurrentTile,this.zoom=o.zoom,this.angle=o.angle,this._fov=o._fov,this._pitch=o._pitch,this._unmodified=o._unmodified,this._edgeInsets=o._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(o){this._minZoom!==o&&(this._minZoom=o,this.zoom=Math.max(this.zoom,o))}get maxZoom(){return this._maxZoom}set maxZoom(o){this._maxZoom!==o&&(this._maxZoom=o,this.zoom=Math.min(this.zoom,o))}get minPitch(){return this._minPitch}set minPitch(o){this._minPitch!==o&&(this._minPitch=o,this.pitch=Math.max(this.pitch,o))}get maxPitch(){return this._maxPitch}set maxPitch(o){this._maxPitch!==o&&(this._maxPitch=o,this.pitch=Math.min(this.pitch,o))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(o){o===void 0?o=!0:o===null&&(o=!1),this._renderWorldCopies=o}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new c.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(o){const h=-c.b1(o,-180,180)*Math.PI/180;this.angle!==h&&(this._unmodified=!1,this.angle=h,this._calcMatrices(),this.rotationMatrix=function(){var d=new c.A(4);return c.A!=Float32Array&&(d[1]=0,d[2]=0),d[0]=1,d[3]=1,d}(),function(d,g,v){var E=g[0],I=g[1],P=g[2],k=g[3],N=Math.sin(v),O=Math.cos(v);d[0]=E*O+P*N,d[1]=I*O+k*N,d[2]=E*-N+P*O,d[3]=I*-N+k*O}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(o){const h=c.ac(o,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==h&&(this._unmodified=!1,this._pitch=h,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(o){o=Math.max(.01,Math.min(60,o)),this._fov!==o&&(this._unmodified=!1,this._fov=o/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(o){const h=Math.min(Math.max(o,this.minZoom),this.maxZoom);this._zoom!==h&&(this._unmodified=!1,this._zoom=h,this.tileZoom=Math.max(0,Math.floor(h)),this.scale=this.zoomScale(h),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(o){o.lat===this._center.lat&&o.lng===this._center.lng||(this._unmodified=!1,this._center=o,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(o){o!==this._elevation&&(this._elevation=o,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(o){this._edgeInsets.equals(o)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,o,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(o){return this._edgeInsets.equals(o)}interpolatePadding(o,h,d){this._unmodified=!1,this._edgeInsets.interpolate(o,h,d),this._constrain(),this._calcMatrices()}coveringZoomLevel(o){const h=(o.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/o.tileSize));return Math.max(0,h)}getVisibleUnwrappedCoordinates(o){const h=[new c.b2(0,o)];if(this._renderWorldCopies){const d=this.pointCoordinate(new c.P(0,0)),g=this.pointCoordinate(new c.P(this.width,0)),v=this.pointCoordinate(new c.P(this.width,this.height)),E=this.pointCoordinate(new c.P(0,this.height)),I=Math.floor(Math.min(d.x,g.x,v.x,E.x)),P=Math.floor(Math.max(d.x,g.x,v.x,E.x)),k=1;for(let N=I-k;N<=P+k;N++)N!==0&&h.push(new c.b2(N,o))}return h}coveringTiles(o){var h,d;let g=this.coveringZoomLevel(o);const v=g;if(o.minzoom!==void 0&&go.maxzoom&&(g=o.maxzoom);const E=this.pointCoordinate(this.getCameraPoint()),I=c.Y.fromLngLat(this.center),P=Math.pow(2,g),k=[P*E.x,P*E.y,0],N=[P*I.x,P*I.y,0],O=za.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,g);let j=o.minzoom||0;!o.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(j=g);const tt=o.terrain?2/Math.min(this.tileSize,o.tileSize)*this.tileSize:3,$=st=>({aabb:new Fa([st*P,0,0],[(st+1)*P,P,0]),zoom:0,x:0,y:0,wrap:st,fullyVisible:!1}),ot=[],K=[],ft=g,Tt=o.reparseOverscaled?v:g;if(this._renderWorldCopies)for(let st=1;st<=3;st++)ot.push($(-st)),ot.push($(st));for(ot.push($(0));ot.length>0;){const st=ot.pop(),vt=st.x,Lt=st.y;let kt=st.fullyVisible;if(!kt){const te=st.aabb.intersects(O);if(te===0)continue;kt=te===2}const Nt=o.terrain?k:N,jt=st.aabb.distanceX(Nt),Gt=st.aabb.distanceY(Nt),Kt=Math.max(Math.abs(jt),Math.abs(Gt));if(st.zoom===ft||Kt>tt+(1<=j){const te=ft-st.zoom,He=k[0]-.5-(vt<>1),Ae=st.zoom+1;let Xe=st.aabb.quadrant(te);if(o.terrain){const mn=new c.Q(Ae,st.wrap,Ae,He,ne),Ne=o.terrain.getMinMaxElevation(mn),Je=(h=Ne.minElevation)!==null&&h!==void 0?h:this.elevation,en=(d=Ne.maxElevation)!==null&&d!==void 0?d:this.elevation;Xe=new Fa([Xe.min[0],Xe.min[1],Je],[Xe.max[0],Xe.max[1],en])}ot.push({aabb:Xe,zoom:Ae,x:He,y:ne,wrap:st.wrap,fullyVisible:kt})}}return K.sort((st,vt)=>st.distanceSq-vt.distanceSq).map(st=>st.tileID)}resize(o,h){this.width=o,this.height=h,this.pixelsToGLUnits=[2/o,-2/h],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(o){return Math.pow(2,o)}scaleZoom(o){return Math.log(o)/Math.LN2}project(o){const h=c.ac(o.lat,-85.051129,Jp);return new c.P(c.N(o.lng)*this.worldSize,c.O(h)*this.worldSize)}unproject(o){return new c.Y(o.x/this.worldSize,o.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(o){const h=this.elevation,d=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,g=this.pointLocation(this.centerPoint,o),v=o.getElevationForLngLatZoom(g,this.tileZoom);if(!(this.elevation-v))return;const E=d+h-v,I=Math.cos(this._pitch)*this.cameraToCenterDistance/E/c.b3(1,g.lat),P=this.scaleZoom(I/this.tileSize);this._elevation=v,this._center=g,this.zoom=P}setLocationAtPoint(o,h){const d=this.pointCoordinate(h),g=this.pointCoordinate(this.centerPoint),v=this.locationCoordinate(o),E=new c.Y(v.x-(d.x-g.x),v.y-(d.y-g.y));this.center=this.coordinateLocation(E),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(o,h){return h?this.coordinatePoint(this.locationCoordinate(o),h.getElevationForLngLatZoom(o,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(o))}pointLocation(o,h){return this.coordinateLocation(this.pointCoordinate(o,h))}locationCoordinate(o){return c.Y.fromLngLat(o)}coordinateLocation(o){return o&&o.toLngLat()}pointCoordinate(o,h){if(h){const j=h.pointCoordinate(o);if(j!=null)return j}const d=[o.x,o.y,0,1],g=[o.x,o.y,1,1];c.af(d,d,this.pixelMatrixInverse),c.af(g,g,this.pixelMatrixInverse);const v=d[3],E=g[3],I=d[1]/v,P=g[1]/E,k=d[2]/v,N=g[2]/E,O=k===N?0:(0-k)/(N-k);return new c.Y(c.z.number(d[0]/v,g[0]/E,O)/this.worldSize,c.z.number(I,P,O)/this.worldSize)}coordinatePoint(o,h=0,d=this.pixelMatrix){const g=[o.x*this.worldSize,o.y*this.worldSize,h,1];return c.af(g,g,d),new c.P(g[0]/g[3],g[1]/g[3])}getBounds(){const o=Math.max(0,this.height/2-this.getHorizon());return new Ee().extend(this.pointLocation(new c.P(0,o))).extend(this.pointLocation(new c.P(this.width,o))).extend(this.pointLocation(new c.P(this.width,this.height))).extend(this.pointLocation(new c.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new Ee([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(o){o?(this.lngRange=[o.getWest(),o.getEast()],this.latRange=[o.getSouth(),o.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Jp])}calculatePosMatrix(o,h=!1){const d=o.key,g=h?this._alignedPosMatrixCache:this._posMatrixCache;if(g[d])return g[d];const v=o.canonical,E=this.worldSize/this.zoomScale(v.z),I=v.x+Math.pow(2,v.z)*o.wrap,P=c.an(new Float64Array(16));return c.H(P,P,[I*E,v.y*E,0]),c.J(P,P,[E/c.W,E/c.W,1]),c.K(P,h?this.alignedProjMatrix:this.projMatrix,P),g[d]=new Float32Array(P),g[d]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(o,h){h=c.ac(+h,this.minZoom,this.maxZoom);const d={center:new c.M(o.lng,o.lat),zoom:h};let g=this.lngRange;if(!this._renderWorldCopies&&g===null){const st=179.9999999999;g=[-st,st]}const v=this.tileSize*this.zoomScale(d.zoom);let E=0,I=v,P=0,k=v,N=0,O=0;const{x:j,y:tt}=this.size;if(this.latRange){const st=this.latRange;E=c.O(st[1])*v,I=c.O(st[0])*v,I-EI&&(ft=I-st)}if(g){const st=(P+k)/2;let vt=$;this._renderWorldCopies&&(vt=c.b1($,st-v/2,st+v/2));const Lt=j/2;vt-Ltk&&(K=k-Lt)}if(K!==void 0||ft!==void 0){const st=new c.P(K??$,ft??ot);d.center=this.unproject.call({worldSize:v},st).wrap()}return d}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const o=this._unmodified,{center:h,zoom:d}=this.getConstrained(this.center,this.zoom);this.center=h,this.zoom=d,this._unmodified=o,this._constraining=!1}_calcMatrices(){if(!this.height)return;const o=this.centerOffset,h=this.point.x,d=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=c.b3(1,this.center.lat)*this.worldSize;let g=c.an(new Float64Array(16));c.J(g,g,[this.width/2,-this.height/2,1]),c.H(g,g,[1,-1,0]),this.labelPlaneMatrix=g,g=c.an(new Float64Array(16)),c.J(g,g,[1,-1,1]),c.H(g,g,[-1,-1,0]),c.J(g,g,[2/this.width,2/this.height,1]),this.glCoordMatrix=g;const v=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),E=Math.min(this.elevation,this.minElevationForCurrentTile),I=v-E*this._pixelPerMeter/Math.cos(this._pitch),P=E<0?I:v,k=Math.PI/2+this._pitch,N=this._fov*(.5+o.y/this.height),O=Math.sin(N)*P/Math.sin(c.ac(Math.PI-k-N,.01,Math.PI-.01)),j=this.getHorizon(),tt=2*Math.atan(j/this.cameraToCenterDistance)*(.5+o.y/(2*j)),$=Math.sin(tt)*P/Math.sin(c.ac(Math.PI-k-tt,.01,Math.PI-.01)),ot=Math.min(O,$),K=1.01*(Math.cos(Math.PI/2-this._pitch)*ot+P),ft=this.height/50;g=new Float64Array(16),c.b4(g,this._fov,this.width/this.height,ft,K),g[8]=2*-o.x/this.width,g[9]=2*o.y/this.height,c.J(g,g,[1,-1,1]),c.H(g,g,[0,0,-this.cameraToCenterDistance]),c.b5(g,g,this._pitch),c.ad(g,g,this.angle),c.H(g,g,[-h,-d,0]),this.mercatorMatrix=c.J([],g,[this.worldSize,this.worldSize,this.worldSize]),c.J(g,g,[1,1,this._pixelPerMeter]),this.pixelMatrix=c.K(new Float64Array(16),this.labelPlaneMatrix,g),c.H(g,g,[0,0,-this.elevation]),this.projMatrix=g,this.invProjMatrix=c.ar([],g),this.pixelMatrix3D=c.K(new Float64Array(16),this.labelPlaneMatrix,g);const Tt=this.width%2/2,st=this.height%2/2,vt=Math.cos(this.angle),Lt=Math.sin(this.angle),kt=h-Math.round(h)+vt*Tt+Lt*st,Nt=d-Math.round(d)+vt*st+Lt*Tt,jt=new Float64Array(g);if(c.H(jt,jt,[kt>.5?kt-1:kt,Nt>.5?Nt-1:Nt,0]),this.alignedProjMatrix=jt,g=c.ar(new Float64Array(16),this.pixelMatrix),!g)throw new Error("failed to invert matrix");this.pixelMatrixInverse=g,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const o=this.pointCoordinate(new c.P(0,0)),h=[o.x*this.worldSize,o.y*this.worldSize,0,1];return c.af(h,h,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const o=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new c.P(0,o))}getCameraQueryGeometry(o){const h=this.getCameraPoint();if(o.length===1)return[o[0],h];{let d=h.x,g=h.y,v=h.x,E=h.y;for(const I of o)d=Math.min(d,I.x),g=Math.min(g,I.y),v=Math.max(v,I.x),E=Math.max(E,I.y);return[new c.P(d,g),new c.P(v,g),new c.P(v,E),new c.P(d,E),new c.P(d,g)]}}lngLatToCameraDepth(o,h){const d=this.locationCoordinate(o),g=[d.x*this.worldSize,d.y*this.worldSize,h,1];return c.af(g,g,this.projMatrix),g[2]/g[3]}}function Qp(_,o){let h,d=!1,g=null,v=null;const E=()=>{g=null,d&&(_.apply(v,h),g=setTimeout(E,o),d=!1)};return(...I)=>(d=!0,v=this,h=I,g||E(),g)}class $p{constructor(o){this._getCurrentHash=()=>{const h=window.location.hash.replace("#","");if(this._hashName){let d;return h.split("&").map(g=>g.split("=")).forEach(g=>{g[0]===this._hashName&&(d=g)}),(d&&d[1]||"").split("/")}return h.split("/")},this._onHashChange=()=>{const h=this._getCurrentHash();if(h.length>=3&&!h.some(d=>isNaN(d))){const d=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(h[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+h[2],+h[1]],zoom:+h[0],bearing:d,pitch:+(h[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const h=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,h)}catch{}},this._updateHash=Qp(this._updateHashUnthrottled,300),this._hashName=o&&encodeURIComponent(o)}addTo(o){return this._map=o,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(o){const h=this._map.getCenter(),d=Math.round(100*this._map.getZoom())/100,g=Math.ceil((d*Math.LN2+Math.log(512/360/.5))/Math.LN10),v=Math.pow(10,g),E=Math.round(h.lng*v)/v,I=Math.round(h.lat*v)/v,P=this._map.getBearing(),k=this._map.getPitch();let N="";if(N+=o?`/${E}/${I}/${d}`:`${d}/${I}/${E}`,(P||k)&&(N+="/"+Math.round(10*P)/10),k&&(N+=`/${Math.round(k)}`),this._hashName){const O=this._hashName;let j=!1;const tt=window.location.hash.slice(1).split("&").map($=>{const ot=$.split("=")[0];return ot===O?(j=!0,`${ot}=${N}`):$}).filter($=>$);return j||tt.push(`${O}=${N}`),`#${tt.join("&")}`}return`#${N}`}}const Yu={linearity:.3,easing:c.b6(0,0,.3,1)},vl=c.e({deceleration:2500,maxSpeed:1400},Yu),mg=c.e({deceleration:20,maxSpeed:1400},Yu),yg=c.e({deceleration:1e3,maxSpeed:360},Yu),_g=c.e({deceleration:1e3,maxSpeed:90},Yu);class vg{constructor(o){this._map=o,this.clear()}clear(){this._inertiaBuffer=[]}record(o){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:L.now(),settings:o})}_drainInertiaBuffer(){const o=this._inertiaBuffer,h=L.now();for(;o.length>0&&h-o[0].time>160;)o.shift()}_onMoveEnd(o){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const h={zoom:0,bearing:0,pitch:0,pan:new c.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:v}of this._inertiaBuffer)h.zoom+=v.zoomDelta||0,h.bearing+=v.bearingDelta||0,h.pitch+=v.pitchDelta||0,v.panDelta&&h.pan._add(v.panDelta),v.around&&(h.around=v.around),v.pinchAround&&(h.pinchAround=v.pinchAround);const d=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,g={};if(h.pan.mag()){const v=Ju(h.pan.mag(),d,c.e({},vl,o||{}));g.offset=h.pan.mult(v.amount/h.pan.mag()),g.center=this._map.transform.center,Ku(g,v)}if(h.zoom){const v=Ju(h.zoom,d,mg);g.zoom=this._map.transform.zoom+v.amount,Ku(g,v)}if(h.bearing){const v=Ju(h.bearing,d,yg);g.bearing=this._map.transform.bearing+c.ac(v.amount,-179,179),Ku(g,v)}if(h.pitch){const v=Ju(h.pitch,d,_g);g.pitch=this._map.transform.pitch+v.amount,Ku(g,v)}if(g.zoom||g.bearing){const v=h.pinchAround===void 0?h.around:h.pinchAround;g.around=v?this._map.unproject(v):this._map.getCenter()}return this.clear(),c.e(g,{noMoveStart:!0})}}function Ku(_,o){(!_.duration||_.durationh.unproject(P)),I=v.reduce((P,k,N,O)=>P.add(k.div(O.length)),new c.P(0,0));super(o,{points:v,point:I,lngLats:E,lngLat:h.unproject(I),originalEvent:d}),this._defaultPrevented=!1}}class tf extends c.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(o,h,d){super(o,{originalEvent:d}),this._defaultPrevented=!1}}class os{constructor(o,h){this._map=o,this._clickTolerance=h.clickTolerance}reset(){delete this._mousedownPos}wheel(o){return this._firePreventable(new tf(o.type,this._map,o))}mousedown(o,h){return this._mousedownPos=h,this._firePreventable(new no(o.type,this._map,o))}mouseup(o){this._map.fire(new no(o.type,this._map,o))}click(o,h){this._mousedownPos&&this._mousedownPos.dist(h)>=this._clickTolerance||this._map.fire(new no(o.type,this._map,o))}dblclick(o){return this._firePreventable(new no(o.type,this._map,o))}mouseover(o){this._map.fire(new no(o.type,this._map,o))}mouseout(o){this._map.fire(new no(o.type,this._map,o))}touchstart(o){return this._firePreventable(new Ps(o.type,this._map,o))}touchmove(o){this._map.fire(new Ps(o.type,this._map,o))}touchend(o){this._map.fire(new Ps(o.type,this._map,o))}touchcancel(o){this._map.fire(new Ps(o.type,this._map,o))}_firePreventable(o){if(this._map.fire(o),o.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ms{constructor(o){this._map=o}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(o){this._map.fire(new no(o.type,this._map,o))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new no("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(o){this._delayContextMenu?this._contextMenuEvent=o:this._ignoreContextMenu||this._map.fire(new no(o.type,this._map,o)),this._map.listens("contextmenu")&&o.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class iu{constructor(o){this._map=o}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(o){return this.transform.pointLocation(c.P.convert(o),this._map.terrain)}}class ss{constructor(o,h){this._map=o,this._tr=new iu(o),this._el=o.getCanvasContainer(),this._container=o.getContainer(),this._clickTolerance=h.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(o,h){this.isEnabled()&&o.shiftKey&&o.button===0&&(A.disableDrag(),this._startPos=this._lastPos=h,this._active=!0)}mousemoveWindow(o,h){if(!this._active)return;const d=h;if(this._lastPos.equals(d)||!this._box&&d.dist(this._startPos)v.fitScreenCoordinates(d,g,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",o)}keydown(o){this._active&&o.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",o))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(A.remove(this._box),this._box=null),A.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(o,h){return this._map.fire(new c.k(o,{originalEvent:h}))}}function bl(_,o){if(_.length!==o.length)throw new Error(`The number of touches and points are not equal - touches ${_.length}, points ${o.length}`);const h={};for(let d=0;d<_.length;d++)h[_[d].identifier]=o[d];return h}class Vy{constructor(o){this.reset(),this.numTouches=o.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(o,h,d){(this.centroid||d.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=o.timeStamp),d.length===this.numTouches&&(this.centroid=function(g){const v=new c.P(0,0);for(const E of g)v._add(E);return v.div(g.length)}(h),this.touches=bl(d,h)))}touchmove(o,h,d){if(this.aborted||!this.centroid)return;const g=bl(d,h);for(const v in this.touches){const E=g[v];(!E||E.dist(this.touches[v])>30)&&(this.aborted=!0)}}touchend(o,h,d){if((!this.centroid||o.timeStamp-this.startTime>500)&&(this.aborted=!0),d.length===0){const g=!this.aborted&&this.centroid;if(this.reset(),g)return g}}}class ef{constructor(o){this.singleTap=new Vy(o),this.numTaps=o.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(o,h,d){this.singleTap.touchstart(o,h,d)}touchmove(o,h,d){this.singleTap.touchmove(o,h,d)}touchend(o,h,d){const g=this.singleTap.touchend(o,h,d);if(g){const v=o.timeStamp-this.lastTime<500,E=!this.lastTap||this.lastTap.dist(g)<30;if(v&&E||this.reset(),this.count++,this.lastTime=o.timeStamp,this.lastTap=g,this.count===this.numTaps)return this.reset(),g}}}class Uy{constructor(o){this._tr=new iu(o),this._zoomIn=new ef({numTouches:1,numTaps:2}),this._zoomOut=new ef({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(o,h,d){this._zoomIn.touchstart(o,h,d),this._zoomOut.touchstart(o,h,d)}touchmove(o,h,d){this._zoomIn.touchmove(o,h,d),this._zoomOut.touchmove(o,h,d)}touchend(o,h,d){const g=this._zoomIn.touchend(o,h,d),v=this._zoomOut.touchend(o,h,d),E=this._tr;return g?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:I=>I.easeTo({duration:300,zoom:E.zoom+1,around:E.unproject(g)},{originalEvent:o})}):v?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:I=>I.easeTo({duration:300,zoom:E.zoom-1,around:E.unproject(v)},{originalEvent:o})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ou{constructor(o){this._enabled=!!o.enable,this._moveStateManager=o.moveStateManager,this._clickTolerance=o.clickTolerance||1,this._moveFunction=o.move,this._activateOnStart=!!o.activateOnStart,o.assignEvents(this),this.reset()}reset(o){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(o)}_move(...o){const h=this._moveFunction(...o);if(h.bearingDelta||h.pitchDelta||h.around||h.panDelta)return this._active=!0,h}dragStart(o,h){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(o)&&(this._moveStateManager.startMove(o),this._lastPoint=h.length?h[0]:h,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(o,h){if(!this.isEnabled())return;const d=this._lastPoint;if(!d)return;if(o.preventDefault(),!this._moveStateManager.isValidMoveEvent(o))return void this.reset(o);const g=h.length?h[0]:h;return!this._moved&&g.dist(d){_.mousedown=_.dragStart,_.mousemoveWindow=_.dragMove,_.mouseup=_.dragEnd,_.contextmenu=function(o){o.preventDefault()}},su=({enable:_,clickTolerance:o,bearingDegreesPerPixelMoved:h=.8})=>{const d=new As({checkCorrectEvent:g=>A.mouseButton(g)===0&&g.ctrlKey||A.mouseButton(g)===2});return new ou({clickTolerance:o,move:(g,v)=>({bearingDelta:(v.x-g.x)*h}),moveStateManager:d,enable:_,assignEvents:hh})},au=({enable:_,clickTolerance:o,pitchDegreesPerPixelMoved:h=-.5})=>{const d=new As({checkCorrectEvent:g=>A.mouseButton(g)===0&&g.ctrlKey||A.mouseButton(g)===2});return new ou({clickTolerance:o,move:(g,v)=>({pitchDelta:(v.y-g.y)*h}),moveStateManager:d,enable:_,assignEvents:hh})};class bg{constructor(o,h){this._clickTolerance=o.clickTolerance||1,this._map=h,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new c.P(0,0)}minTouchs(){return this._map.cooperativeGestures.isEnabled()?2:1}touchstart(o,h,d){return this._calculateTransform(o,h,d)}touchmove(o,h,d){if(this._active&&!(d.length0&&(this._active=!0);const g=bl(d,h),v=new c.P(0,0),E=new c.P(0,0);let I=0;for(const k in g){const N=g[k],O=this._touches[k];O&&(v._add(N),E._add(N.sub(O)),I++,g[k]=N)}if(this._touches=g,IMath.abs(_.x)}class Sg extends ue{constructor(o){super(),this._currentTouchCount=0,this._map=o}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(o,h,d){super.touchstart(o,h,d),this._currentTouchCount=d.length}_start(o){this._lastPoints=o,fh(o[0].sub(o[1]))&&(this._valid=!1)}_move(o,h,d){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const g=o[0].sub(this._lastPoints[0]),v=o[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(g,v,d.timeStamp),this._valid?(this._lastPoints=o,this._active=!0,{pitchDelta:(g.y+v.y)/2*-.5}):void 0}gestureBeginsVertically(o,h,d){if(this._valid!==void 0)return this._valid;const g=o.mag()>=2,v=h.mag()>=2;if(!g&&!v)return;if(!g||!v)return this._firstMove===void 0&&(this._firstMove=d),d-this._firstMove<100&&void 0;const E=o.y>0==h.y>0;return fh(o)&&fh(h)&&E}}const Gy={panStep:100,bearingStep:15,pitchStep:10};class Ba{constructor(o){this._tr=new iu(o);const h=Gy;this._panStep=h.panStep,this._bearingStep=h.bearingStep,this._pitchStep=h.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(o){if(o.altKey||o.ctrlKey||o.metaKey)return;let h=0,d=0,g=0,v=0,E=0;switch(o.keyCode){case 61:case 107:case 171:case 187:h=1;break;case 189:case 109:case 173:h=-1;break;case 37:o.shiftKey?d=-1:(o.preventDefault(),v=-1);break;case 39:o.shiftKey?d=1:(o.preventDefault(),v=1);break;case 38:o.shiftKey?g=1:(o.preventDefault(),E=-1);break;case 40:o.shiftKey?g=-1:(o.preventDefault(),E=1);break;default:return}return this._rotationDisabled&&(d=0,g=0),{cameraAnimation:I=>{const P=this._tr;I.easeTo({duration:300,easeId:"keyboardHandler",easing:tr,zoom:h?Math.round(P.zoom)+h*(o.shiftKey?2:1):P.zoom,bearing:P.bearing+d*this._bearingStep,pitch:P.pitch+g*this._pitchStep,offset:[-v*this._panStep,-E*this._panStep],center:P.center},{originalEvent:o})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function tr(_){return _*(2-_)}const $u=4.000244140625;class dh{constructor(o,h){this._onTimeout=d=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(d)},this._map=o,this._tr=new iu(o),this._triggerRenderFrame=h,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(o){this._defaultZoomRate=o}setWheelZoomRate(o){this._wheelZoomRate=o}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(o){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!o&&o.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(o){if(!this.isEnabled()||this._map.cooperativeGestures.isEnabled()&&!o[this._map.cooperativeGestures._bypassKey])return;let h=o.deltaMode===WheelEvent.DOM_DELTA_LINE?40*o.deltaY:o.deltaY;const d=L.now(),g=d-(this._lastWheelEventTime||0);this._lastWheelEventTime=d,h!==0&&h%$u==0?this._type="wheel":h!==0&&Math.abs(h)<4?this._type="trackpad":g>400?(this._type=null,this._lastValue=h,this._timeout=setTimeout(this._onTimeout,40,o)):this._type||(this._type=Math.abs(g*h)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,h+=this._lastValue)),o.shiftKey&&h&&(h/=4),this._type&&(this._lastWheelEvent=o,this._delta-=h,this._active||this._start(o)),o.preventDefault()}_start(o){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const h=A.mousePos(this._map.getCanvas(),o),d=this._tr;this._around=h.y>d.transform.height/2-d.transform.getHorizon()?c.M.convert(this._aroundCenter?d.center:d.unproject(h)):c.M.convert(d.center),this._aroundPoint=d.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const o=this._tr.transform;if(this._delta!==0){const I=this._type==="wheel"&&Math.abs(this._delta)>$u?this._wheelZoomRate:this._defaultZoomRate;let P=2/(1+Math.exp(-Math.abs(this._delta*I)));this._delta<0&&P!==0&&(P=1/P);const k=typeof this._targetZoom=="number"?o.zoomScale(this._targetZoom):o.scale;this._targetZoom=Math.min(o.maxZoom,Math.max(o.minZoom,o.scaleZoom(k*P))),this._type==="wheel"&&(this._startZoom=o.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const h=typeof this._targetZoom=="number"?this._targetZoom:o.zoom,d=this._startZoom,g=this._easing;let v,E=!1;if(this._type==="wheel"&&d&&g){const I=Math.min((L.now()-this._lastWheelEventTime)/200,1),P=g(I);v=c.z.number(d,h,P),I<1?this._frameId||(this._frameId=!0):E=!0}else v=h,E=!0;return this._active=!0,E&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!E,zoomDelta:v-o.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(o){let h=c.b7;if(this._prevEase){const d=this._prevEase,g=(L.now()-d.start)/d.duration,v=d.easing(g+.01)-d.easing(g),E=.27/Math.sqrt(v*v+1e-4)*.01,I=Math.sqrt(.0729-E*E);h=c.b6(E,I,.25,1)}return this._prevEase={start:L.now(),duration:o,easing:h},h}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class rf{constructor(o,h){this._clickZoom=o,this._tapZoom=h}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Eg{constructor(o){this._tr=new iu(o),this.reset()}reset(){this._active=!1}dblclick(o,h){return o.preventDefault(),{cameraAnimation:d=>{d.easeTo({duration:300,zoom:this._tr.zoom+(o.shiftKey?-1:1),around:this._tr.unproject(h)},{originalEvent:o})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ig{constructor(){this._tap=new ef({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(o,h,d){if(!this._swipePoint)if(this._tapTime){const g=h[0],v=o.timeStamp-this._tapTime<500,E=this._tapPoint.dist(g)<30;v&&E?d.length>0&&(this._swipePoint=g,this._swipeTouch=d[0].identifier):this.reset()}else this._tap.touchstart(o,h,d)}touchmove(o,h,d){if(this._tapTime){if(this._swipePoint){if(d[0].identifier!==this._swipeTouch)return;const g=h[0],v=g.y-this._swipePoint.y;return this._swipePoint=g,o.preventDefault(),this._active=!0,{zoomDelta:v/128}}}else this._tap.touchmove(o,h,d)}touchend(o,h,d){if(this._tapTime)this._swipePoint&&d.length===0&&this.reset();else{const g=this._tap.touchend(o,h,d);g&&(this._tapTime=o.timeStamp,this._tapPoint=g)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Cg{constructor(o,h,d){this._el=o,this._mousePan=h,this._touchPan=d}enable(o){this._inertiaOptions=o||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class as{constructor(o,h,d){this._pitchWithRotate=o.pitchWithRotate,this._mouseRotate=h,this._mousePitch=d}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class tc{constructor(o,h,d,g){this._el=o,this._touchZoom=h,this._touchRotate=d,this._tapDragZoom=g,this._rotationDisabled=!1,this._enabled=!0}enable(o){this._touchZoom.enable(o),this._rotationDisabled||this._touchRotate.enable(o),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class xe{constructor(o,h){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=o,this._options=h,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const o=this._map.getCanvasContainer();o.classList.add("maplibregl-cooperative-gestures"),this._container=A.create("div","maplibregl-cooperative-gesture-screen",o);let h=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(h=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const d=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),g=document.createElement("div");g.className="maplibregl-desktop-message",g.textContent=h,this._container.appendChild(g);const v=document.createElement("div");v.className="maplibregl-mobile-message",v.textContent=d,this._container.appendChild(v),this._container.setAttribute("aria-hidden","true")}_destoryUI(){this._container&&(A.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destoryUI()}isEnabled(){return this._enabled}touchmove(o){this._onCooperativeGesture(o.touches.length===1)}wheel(o){this._map.scrollZoom.isEnabled()&&this._onCooperativeGesture(!o[this._bypassKey])}_onCooperativeGesture(o){this._enabled&&o&&(this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Le=_=>_.zoom||_.drag||_.pitch||_.rotate;class gh extends c.k{}function ec(_){return _.panDelta&&_.panDelta.mag()||_.zoomDelta||_.bearingDelta||_.pitchDelta}class of{constructor(o,h){this.handleWindowEvent=g=>{this.handleEvent(g,`${g.type}Window`)},this.handleEvent=(g,v)=>{if(g.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const E=g.type==="renderFrame"?void 0:g,I={needsRenderFrame:!1},P={},k={},N=g.touches,O=N?this._getMapTouches(N):void 0,j=O?A.touchPos(this._map.getCanvas(),O):A.mousePos(this._map.getCanvas(),g);for(const{handlerName:ot,handler:K,allowed:ft}of this._handlers){if(!K.isEnabled())continue;let Tt;this._blockedByActive(k,ft,ot)?K.reset():K[v||g.type]&&(Tt=K[v||g.type](g,j,O),this.mergeHandlerResult(I,P,Tt,ot,E),Tt&&Tt.needsRenderFrame&&this._triggerRenderFrame()),(Tt||K.isActive())&&(k[ot]=K)}const tt={};for(const ot in this._previousActiveHandlers)k[ot]||(tt[ot]=E);this._previousActiveHandlers=k,(Object.keys(tt).length||ec(I))&&(this._changes.push([I,P,tt]),this._triggerRenderFrame()),(Object.keys(k).length||ec(I))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:$}=I;$&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],$(this._map))},this._map=o,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new vg(o),this._bearingSnap=h.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(h);const d=this._el;this._listeners=[[d,"touchstart",{passive:!0}],[d,"touchmove",{passive:!1}],[d,"touchend",void 0],[d,"touchcancel",void 0],[d,"mousedown",void 0],[d,"mousemove",void 0],[d,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[d,"mouseover",void 0],[d,"mouseout",void 0],[d,"dblclick",void 0],[d,"click",void 0],[d,"keydown",{capture:!1}],[d,"keyup",void 0],[d,"wheel",{passive:!1}],[d,"contextmenu",void 0],[window,"blur",void 0]];for(const[g,v,E]of this._listeners)A.addEventListener(g,v,g===document?this.handleWindowEvent:this.handleEvent,E)}destroy(){for(const[o,h,d]of this._listeners)A.removeEventListener(o,h,o===document?this.handleWindowEvent:this.handleEvent,d)}_addDefaultHandlers(o){const h=this._map,d=h.getCanvasContainer();this._add("mapEvent",new os(h,o));const g=h.boxZoom=new ss(h,o);this._add("boxZoom",g),o.interactive&&o.boxZoom&&g.enable();const v=h.cooperativeGestures=new xe(h,o.cooperativeGestures);this._add("cooperativeGestures",v),o.cooperativeGestures&&v.enable();const E=new Uy(h),I=new Eg(h);h.doubleClickZoom=new rf(I,E),this._add("tapZoom",E),this._add("clickZoom",I),o.interactive&&o.doubleClickZoom&&h.doubleClickZoom.enable();const P=new Ig;this._add("tapDragZoom",P);const k=h.touchPitch=new Sg(h);this._add("touchPitch",k),o.interactive&&o.touchPitch&&h.touchPitch.enable(o.touchPitch);const N=su(o),O=au(o);h.dragRotate=new as(o,N,O),this._add("mouseRotate",N,["mousePitch"]),this._add("mousePitch",O,["mouseRotate"]),o.interactive&&o.dragRotate&&h.dragRotate.enable();const j=(({enable:Tt,clickTolerance:st})=>{const vt=new As({checkCorrectEvent:Lt=>A.mouseButton(Lt)===0&&!Lt.ctrlKey});return new ou({clickTolerance:st,move:(Lt,kt)=>({around:kt,panDelta:kt.sub(Lt)}),activateOnStart:!0,moveStateManager:vt,enable:Tt,assignEvents:hh})})(o),tt=new bg(o,h);h.dragPan=new Cg(d,j,tt),this._add("mousePan",j),this._add("touchPan",tt,["touchZoom","touchRotate"]),o.interactive&&o.dragPan&&h.dragPan.enable(o.dragPan);const $=new nf,ot=new wg;h.touchZoomRotate=new tc(d,ot,$,P),this._add("touchRotate",$,["touchPan","touchZoom"]),this._add("touchZoom",ot,["touchPan","touchRotate"]),o.interactive&&o.touchZoomRotate&&h.touchZoomRotate.enable(o.touchZoomRotate);const K=h.scrollZoom=new dh(h,()=>this._triggerRenderFrame());this._add("scrollZoom",K,["mousePan"]),o.interactive&&o.scrollZoom&&h.scrollZoom.enable(o.scrollZoom);const ft=h.keyboard=new Ba(h);this._add("keyboard",ft),o.interactive&&o.keyboard&&h.keyboard.enable(),this._add("blockableMapEvent",new Ms(h))}_add(o,h,d){this._handlers.push({handlerName:o,handler:h,allowed:d}),this._handlersById[o]=h}stop(o){if(!this._updatingCamera){for(const{handler:h}of this._handlers)h.reset();this._inertia.clear(),this._fireEvents({},{},o),this._changes=[]}}isActive(){for(const{handler:o}of this._handlers)if(o.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Le(this._eventsInProgress)||this.isZooming()}_blockedByActive(o,h,d){for(const g in o)if(g!==d&&(!h||h.indexOf(g)<0))return!0;return!1}_getMapTouches(o){const h=[];for(const d of o)this._el.contains(d.target)&&h.push(d);return h}mergeHandlerResult(o,h,d,g,v){if(!d)return;c.e(o,d);const E={handlerName:g,originalEvent:d.originalEvent||v};d.zoomDelta!==void 0&&(h.zoom=E),d.panDelta!==void 0&&(h.drag=E),d.pitchDelta!==void 0&&(h.pitch=E),d.bearingDelta!==void 0&&(h.rotate=E)}_applyChanges(){const o={},h={},d={};for(const[g,v,E]of this._changes)g.panDelta&&(o.panDelta=(o.panDelta||new c.P(0,0))._add(g.panDelta)),g.zoomDelta&&(o.zoomDelta=(o.zoomDelta||0)+g.zoomDelta),g.bearingDelta&&(o.bearingDelta=(o.bearingDelta||0)+g.bearingDelta),g.pitchDelta&&(o.pitchDelta=(o.pitchDelta||0)+g.pitchDelta),g.around!==void 0&&(o.around=g.around),g.pinchAround!==void 0&&(o.pinchAround=g.pinchAround),g.noInertia&&(o.noInertia=g.noInertia),c.e(h,v),c.e(d,E);this._updateMapTransform(o,h,d),this._changes=[]}_updateMapTransform(o,h,d){const g=this._map,v=g._getTransformForUpdate(),E=g.terrain;if(!(ec(o)||E&&this._terrainMovement))return this._fireEvents(h,d,!0);let{panDelta:I,zoomDelta:P,bearingDelta:k,pitchDelta:N,around:O,pinchAround:j}=o;j!==void 0&&(O=j),g._stop(!0),O=O||g.transform.centerPoint;const tt=v.pointLocation(I?O.sub(I):O);k&&(v.bearing+=k),N&&(v.pitch+=N),P&&(v.zoom+=P),E?this._terrainMovement||!h.drag&&!h.zoom?h.drag&&this._terrainMovement?v.center=v.pointLocation(v.centerPoint.sub(I)):v.setLocationAtPoint(tt,O):(this._terrainMovement=!0,this._map._elevationFreeze=!0,v.setLocationAtPoint(tt,O),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,v.recalculateZoom(g.terrain)})):v.setLocationAtPoint(tt,O),g._applyUpdatedTransform(v),this._map._update(),o.noInertia||this._inertia.record(o),this._fireEvents(h,d,!0)}_fireEvents(o,h,d){const g=Le(this._eventsInProgress),v=Le(o),E={};for(const N in o){const{originalEvent:O}=o[N];this._eventsInProgress[N]||(E[`${N}start`]=O),this._eventsInProgress[N]=o[N]}!g&&v&&this._fireEvent("movestart",v.originalEvent);for(const N in E)this._fireEvent(N,E[N]);v&&this._fireEvent("move",v.originalEvent);for(const N in o){const{originalEvent:O}=o[N];this._fireEvent(N,O)}const I={};let P;for(const N in this._eventsInProgress){const{handlerName:O,originalEvent:j}=this._eventsInProgress[N];this._handlersById[O].isActive()||(delete this._eventsInProgress[N],P=h[O]||j,I[`${N}end`]=P)}for(const N in I)this._fireEvent(N,I[N]);const k=Le(this._eventsInProgress);if(d&&(g||v)&&!k){this._updatingCamera=!0;const N=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),O=j=>j!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new gh("renderFrame",{timeStamp:o})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class ro extends c.E{constructor(o,h){super(),this._renderFrameCallback=()=>{const d=Math.min((L.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(d)),d<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=o,this._bearingSnap=h.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new c.M(this.transform.center.lng,this.transform.center.lat)}setCenter(o,h){return this.jumpTo({center:o},h)}panBy(o,h,d){return o=c.P.convert(o).mult(-1),this.panTo(this.transform.center,c.e({offset:o},h),d)}panTo(o,h,d){return this.easeTo(c.e({center:o},h),d)}getZoom(){return this.transform.zoom}setZoom(o,h){return this.jumpTo({zoom:o},h),this}zoomTo(o,h,d){return this.easeTo(c.e({zoom:o},h),d)}zoomIn(o,h){return this.zoomTo(this.getZoom()+1,o,h),this}zoomOut(o,h){return this.zoomTo(this.getZoom()-1,o,h),this}getBearing(){return this.transform.bearing}setBearing(o,h){return this.jumpTo({bearing:o},h),this}getPadding(){return this.transform.padding}setPadding(o,h){return this.jumpTo({padding:o},h),this}rotateTo(o,h,d){return this.easeTo(c.e({bearing:o},h),d)}resetNorth(o,h){return this.rotateTo(0,c.e({duration:1e3},o),h),this}resetNorthPitch(o,h){return this.easeTo(c.e({bearing:0,pitch:0,duration:1e3},o),h),this}snapToNorth(o,h){return Math.abs(this.getBearing()){if(this._zooming&&(g.zoom=c.z.number(v,K,Nt)),this._rotating&&(g.bearing=c.z.number(E,k,Nt)),this._pitching&&(g.pitch=c.z.number(I,N,Nt)),this._padding&&(g.interpolatePadding(P,O,Nt),tt=g.centerPoint.add(j)),this.terrain&&!o.freezeElevation&&this._updateElevation(Nt),vt)g.setLocationAtPoint(vt,Lt);else{const jt=g.zoomScale(g.zoom-v),Gt=K>v?Math.min(2,st):Math.max(.5,st),Kt=Math.pow(Gt,1-Nt),te=g.unproject(ft.add(Tt.mult(Nt*Kt)).mult(jt));g.setLocationAtPoint(g.renderWorldCopies?te.wrap():te,tt)}this._applyUpdatedTransform(g),this._fireMoveEvents(h)},Nt=>{this.terrain&&this._finalizeElevation(),this._afterEase(h,Nt)},o),this}_prepareEase(o,h,d={}){this._moving=!0,h||d.moving||this.fire(new c.k("movestart",o)),this._zooming&&!d.zooming&&this.fire(new c.k("zoomstart",o)),this._rotating&&!d.rotating&&this.fire(new c.k("rotatestart",o)),this._pitching&&!d.pitching&&this.fire(new c.k("pitchstart",o))}_prepareElevation(o){this._elevationCenter=o,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(o,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(o){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const h=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(o<1&&h!==this._elevationTarget){const d=this._elevationTarget-this._elevationStart;this._elevationStart+=o*(d-(h-(d*o+this._elevationStart))/(1-o)),this._elevationTarget=h}this.transform.elevation=c.z.number(this._elevationStart,this._elevationTarget,o)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(o){if(!this.transformCameraUpdate)return;const h=o.clone(),{center:d,zoom:g,pitch:v,bearing:E,elevation:I}=this.transformCameraUpdate(h);d&&(h.center=d),g!==void 0&&(h.zoom=g),v!==void 0&&(h.pitch=v),E!==void 0&&(h.bearing=E),I!==void 0&&(h.elevation=I),this.transform.apply(h)}_fireMoveEvents(o){this.fire(new c.k("move",o)),this._zooming&&this.fire(new c.k("zoom",o)),this._rotating&&this.fire(new c.k("rotate",o)),this._pitching&&this.fire(new c.k("pitch",o))}_afterEase(o,h){if(this._easeId&&h&&this._easeId===h)return;delete this._easeId;const d=this._zooming,g=this._rotating,v=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,d&&this.fire(new c.k("zoomend",o)),g&&this.fire(new c.k("rotateend",o)),v&&this.fire(new c.k("pitchend",o)),this.fire(new c.k("moveend",o))}flyTo(o,h){var d;if(!o.essential&&L.prefersReducedMotion){const mn=c.L(o,["center","zoom","bearing","pitch","around"]);return this.jumpTo(mn,h)}this.stop(),o=c.e({offset:[0,0],speed:1.2,curve:1.42,easing:c.b7},o);const g=this._getTransformForUpdate(),v=this.getZoom(),E=this.getBearing(),I=this.getPitch(),P=this.getPadding(),k="bearing"in o?this._normalizeBearing(o.bearing,E):E,N="pitch"in o?+o.pitch:I,O="padding"in o?o.padding:g.padding,j=c.P.convert(o.offset);let tt=g.centerPoint.add(j);const $=g.pointLocation(tt),{center:ot,zoom:K}=g.getConstrained(c.M.convert(o.center||$),(d=o.zoom)!==null&&d!==void 0?d:v);this._normalizeCenter(ot);const ft=g.zoomScale(K-v),Tt=g.project($),st=g.project(ot).sub(Tt);let vt=o.curve;const Lt=Math.max(g.width,g.height),kt=Lt/ft,Nt=st.mag();if("minZoom"in o){const mn=c.ac(Math.min(o.minZoom,v,K),g.minZoom,g.maxZoom),Ne=Lt/g.zoomScale(mn-v);vt=Math.sqrt(Ne/Nt*2)}const jt=vt*vt;function Gt(mn){const Ne=(kt*kt-Lt*Lt+(mn?-1:1)*jt*jt*Nt*Nt)/(2*(mn?kt:Lt)*jt*Nt);return Math.log(Math.sqrt(Ne*Ne+1)-Ne)}function Kt(mn){return(Math.exp(mn)-Math.exp(-mn))/2}function te(mn){return(Math.exp(mn)+Math.exp(-mn))/2}const He=Gt(!1);let ne=function(mn){return te(He)/te(He+vt*mn)},Ae=function(mn){return Lt*((te(He)*(Kt(Ne=He+vt*mn)/te(Ne))-Kt(He))/jt)/Nt;var Ne},Xe=(Gt(!0)-He)/vt;if(Math.abs(Nt)<1e-6||!isFinite(Xe)){if(Math.abs(Lt-kt)<1e-6)return this.easeTo(o,h);const mn=kto.maxDuration&&(o.duration=0),this._zooming=!0,this._rotating=E!==k,this._pitching=N!==I,this._padding=!g.isPaddingEqual(O),this._prepareEase(h,!1),this.terrain&&this._prepareElevation(ot),this._ease(mn=>{const Ne=mn*Xe,Je=1/ne(Ne);g.zoom=mn===1?K:v+g.scaleZoom(Je),this._rotating&&(g.bearing=c.z.number(E,k,mn)),this._pitching&&(g.pitch=c.z.number(I,N,mn)),this._padding&&(g.interpolatePadding(P,O,mn),tt=g.centerPoint.add(j)),this.terrain&&!o.freezeElevation&&this._updateElevation(mn);const en=mn===1?ot:g.unproject(Tt.add(st.mult(Ae(Ne))).mult(Je));g.setLocationAtPoint(g.renderWorldCopies?en.wrap():en,tt),this._applyUpdatedTransform(g),this._fireMoveEvents(h)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(h)},o),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(o,h){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const d=this._onEaseEnd;delete this._onEaseEnd,d.call(this,h)}if(!o){const d=this.handlers;d&&d.stop(!1)}return this}_ease(o,h,d){d.animate===!1||d.duration===0?(o(1),h()):(this._easeStart=L.now(),this._easeOptions=d,this._onEaseFrame=o,this._onEaseEnd=h,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(o,h){o=c.b1(o,-180,180);const d=Math.abs(o-h);return Math.abs(o-360-h)180?-360:d<-180?360:0}queryTerrainElevation(o){return this.terrain?this.terrain.getElevationForLngLatZoom(c.M.convert(o),this.transform.tileZoom)-this.transform.elevation:null}}const sf={compact:!0,customAttribution:'MapLibre'};class ls{constructor(o=sf){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=h=>{!h||h.sourceDataType!=="metadata"&&h.sourceDataType!=="visibility"&&h.dataType!=="style"&&h.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=o}getDefaultPosition(){return"bottom-right"}onAdd(o){return this._map=o,this._compact=this.options.compact,this._container=A.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=A.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=A.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){A.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(o,h){const d=this._map._getUIString(`AttributionControl.${h}`);o.title=d,o.setAttribute("aria-label",d)}_updateAttributions(){if(!this._map.style)return;let o=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?o=o.concat(this.options.customAttribution.map(g=>typeof g!="string"?"":g)):typeof this.options.customAttribution=="string"&&o.push(this.options.customAttribution)),this._map.style.stylesheet){const g=this._map.style.stylesheet;this.styleOwner=g.owner,this.styleId=g.id}const h=this._map.style.sourceCaches;for(const g in h){const v=h[g];if(v.used||v.usedForTerrain){const E=v.getSource();E.attribution&&o.indexOf(E.attribution)<0&&o.push(E.attribution)}}o=o.filter(g=>String(g).trim()),o.sort((g,v)=>g.length-v.length),o=o.filter((g,v)=>{for(let E=v+1;E=0)return!1;return!0});const d=o.join(" | ");d!==this._attribHTML&&(this._attribHTML=d,o.length?(this._innerContainer.innerHTML=d,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Tg{constructor(o={}){this._updateCompact=()=>{const h=this._container.children;if(h.length){const d=h[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&d.classList.add("maplibregl-compact"):d.classList.remove("maplibregl-compact")}},this.options=o}getDefaultPosition(){return"bottom-left"}onAdd(o){this._map=o,this._compact=this.options&&this.options.compact,this._container=A.create("div","maplibregl-ctrl");const h=A.create("a","maplibregl-ctrl-logo");return h.target="_blank",h.rel="noopener nofollow",h.href="https://maplibre.org/",h.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),h.setAttribute("rel","noopener nofollow"),this._container.appendChild(h),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){A.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class nc{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(o){const h=++this._id;return this._queue.push({callback:o,id:h,cancelled:!1}),h}remove(o){const h=this._currentlyRunning,d=h?this._queue.concat(h):this._queue;for(const g of d)if(g.id===o)return void(g.cancelled=!0)}run(o=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const h=this._currentlyRunning=this._queue;this._queue=[];for(const d of h)if(!d.cancelled&&(d.callback(o),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var gr=c.X([{name:"a_pos3d",type:"Int16",components:3}]);class Pr extends c.E{constructor(o){super(),this.sourceCache=o,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,o.usedForTerrain=!0,o.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(o,h){this.sourceCache.update(o,h),this._renderableTilesKeys=[];const d={};for(const g of o.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:h}))d[g.key]=!0,this._renderableTilesKeys.push(g.key),this._tiles[g.key]||(g.posMatrix=new Float64Array(16),c.aN(g.posMatrix,0,c.W,0,c.W,0,1),this._tiles[g.key]=new zo(g,this.tileSize));for(const g in this._tiles)d[g]||delete this._tiles[g]}freeRtt(o){for(const h in this._tiles){const d=this._tiles[h];(!o||d.tileID.equals(o)||d.tileID.isChildOf(o)||o.isChildOf(d.tileID))&&(d.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(o=>this.getTileByID(o))}getTileByID(o){return this._tiles[o]}getTerrainCoords(o){const h={};for(const d of this._renderableTilesKeys){const g=this._tiles[d].tileID;if(g.canonical.equals(o.canonical)){const v=o.clone();v.posMatrix=new Float64Array(16),c.aN(v.posMatrix,0,c.W,0,c.W,0,1),h[d]=v}else if(g.canonical.isChildOf(o.canonical)){const v=o.clone();v.posMatrix=new Float64Array(16);const E=g.canonical.z-o.canonical.z,I=g.canonical.x-(g.canonical.x>>E<>E<>E;c.aN(v.posMatrix,0,k,0,k,0,1),c.H(v.posMatrix,v.posMatrix,[-I*k,-P*k,0]),h[d]=v}else if(o.canonical.isChildOf(g.canonical)){const v=o.clone();v.posMatrix=new Float64Array(16);const E=o.canonical.z-g.canonical.z,I=o.canonical.x-(o.canonical.x>>E<>E<>E;c.aN(v.posMatrix,0,c.W,0,c.W,0,1),c.H(v.posMatrix,v.posMatrix,[I*k,P*k,0]),c.J(v.posMatrix,v.posMatrix,[1/2**E,1/2**E,0]),h[d]=v}}return h}getSourceTile(o,h){const d=this.sourceCache._source;let g=o.overscaledZ-this.deltaZoom;if(g>d.maxzoom&&(g=d.maxzoom),g=d.minzoom&&(!v||!v.dem);)v=this.sourceCache.getTileByID(o.scaledTo(g--).key);return v}tilesAfterTime(o=Date.now()){return Object.values(this._tiles).filter(h=>h.timeAdded>=o)}}class Lg{constructor(o,h,d){this.painter=o,this.sourceCache=new Pr(h),this.options=d,this.exaggeration=typeof d.exaggeration=="number"?d.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(o,h,d,g=c.W){var v;if(!(h>=0&&h=0&&do.canonical.z&&(o.canonical.z>=g?v=o.canonical.z-g:c.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const E=o.canonical.x-(o.canonical.x>>v<>v<>8<<4|v>>8,h[E+3]=0;const d=new c.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(h.buffer)),g=new dt(o,d,o.gl.RGBA,{premultiply:!1});return g.bind(o.gl.NEAREST,o.gl.CLAMP_TO_EDGE),this._coordsTexture=g,g}pointCoordinate(o){this.painter.maybeDrawDepthAndCoords(!0);const h=new Uint8Array(4),d=this.painter.context,g=d.gl,v=Math.round(o.x*this.painter.pixelRatio/devicePixelRatio),E=Math.round(o.y*this.painter.pixelRatio/devicePixelRatio),I=Math.round(this.painter.height/devicePixelRatio);d.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),g.readPixels(v,I-E-1,1,1,g.RGBA,g.UNSIGNED_BYTE,h),d.bindFramebuffer.set(null);const P=h[0]+(h[2]>>4<<8),k=h[1]+((15&h[2])<<8),N=this.coordsIndex[255-h[3]],O=N&&this.sourceCache.getTileByID(N);if(!O)return null;const j=this._coordsTextureSize,tt=(1<o.id!==h),this._recentlyUsed.push(o.id)}stampObject(o){o.stamp=++this._stamp}getOrCreateFreeObject(){for(const h of this._recentlyUsed)if(!this._objects[h].inUse)return this._objects[h];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const o=this._createObject(this._objects.length);return this._objects.push(o),o}freeObject(o){o.inUse=!1}freeAllObjects(){for(const o of this._objects)this.freeObject(o)}isFull(){return!(this._objects.length!o.inUse)===!1}}const ha={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class af{constructor(o,h){this.painter=o,this.terrain=h,this.pool=new rc(o.context,30,h.sourceCache.tileSize*h.qualityFactor)}destruct(){this.pool.destruct()}getTexture(o){return this.pool.getObjectForId(o.rtt[this._stacks.length-1].id).texture}prepareForRender(o,h){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=o._order.filter(d=>!o._layers[d].isHidden(h)),this._coordsDescendingInv={};for(const d in o.sourceCaches){this._coordsDescendingInv[d]={};const g=o.sourceCaches[d].getVisibleCoordinates();for(const v of g){const E=this.terrain.sourceCache.getTerrainCoords(v);for(const I in E)this._coordsDescendingInv[d][I]||(this._coordsDescendingInv[d][I]=[]),this._coordsDescendingInv[d][I].push(E[I])}}this._coordsDescendingInvStr={};for(const d of o._order){const g=o._layers[d],v=g.source;if(ha[g.type]&&!this._coordsDescendingInvStr[v]){this._coordsDescendingInvStr[v]={};for(const E in this._coordsDescendingInv[v])this._coordsDescendingInvStr[v][E]=this._coordsDescendingInv[v][E].map(I=>I.key).sort().join()}}for(const d of this._renderableTiles)for(const g in this._coordsDescendingInvStr){const v=this._coordsDescendingInvStr[g][d.tileID.key];v&&v!==d.rttCoords[g]&&(d.rtt=[])}}renderLayer(o){if(o.isHidden(this.painter.transform.zoom))return!1;const h=o.type,d=this.painter,g=this._renderableLayerIds[this._renderableLayerIds.length-1]===o.id;if(ha[h]&&(this._prevType&&ha[this._prevType]||this._stacks.push([]),this._prevType=h,this._stacks[this._stacks.length-1].push(o.id),!g))return!0;if(ha[this._prevType]||ha[h]&&g){this._prevType=h;const v=this._stacks.length-1,E=this._stacks[v]||[];for(const I of this._renderableTiles){if(this.pool.isFull()&&(uh(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(I),I.rtt[v]){const k=this.pool.getObjectForId(I.rtt[v].id);if(k.stamp===I.rtt[v].stamp){this.pool.useObject(k);continue}}const P=this.pool.getOrCreateFreeObject();this.pool.useObject(P),this.pool.stampObject(P),I.rtt[v]={id:P.id,stamp:P.stamp},d.context.bindFramebuffer.set(P.fbo.framebuffer),d.context.clear({color:c.aO.transparent,stencil:0}),d.currentStencilSource=void 0;for(let k=0;k{_.touchstart=_.dragStart,_.touchmoveWindow=_.dragMove,_.touchend=_.dragEnd},cf={showCompass:!0,showZoom:!0,visualizePitch:!1};class hf{constructor(o,h,d=!1){this.mousedown=E=>{this.startMouse(c.e({},E,{ctrlKey:!0,preventDefault:()=>E.preventDefault()}),A.mousePos(this.element,E)),A.addEventListener(window,"mousemove",this.mousemove),A.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=E=>{this.moveMouse(E,A.mousePos(this.element,E))},this.mouseup=E=>{this.mouseRotate.dragEnd(E),this.mousePitch&&this.mousePitch.dragEnd(E),this.offTemp()},this.touchstart=E=>{E.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=A.touchPos(this.element,E.targetTouches)[0],this.startTouch(E,this._startPos),A.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),A.addEventListener(window,"touchend",this.touchend))},this.touchmove=E=>{E.targetTouches.length!==1?this.reset():(this._lastPos=A.touchPos(this.element,E.targetTouches)[0],this.moveTouch(E,this._lastPos))},this.touchend=E=>{E.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const g=o.dragRotate._mouseRotate.getClickTolerance(),v=o.dragRotate._mousePitch.getClickTolerance();this.element=h,this.mouseRotate=su({clickTolerance:g,enable:!0}),this.touchRotate=(({enable:E,clickTolerance:I,bearingDegreesPerPixelMoved:P=.8})=>{const k=new me;return new ou({clickTolerance:I,move:(N,O)=>({bearingDelta:(O.x-N.x)*P}),moveStateManager:k,enable:E,assignEvents:mh})})({clickTolerance:g,enable:!0}),this.map=o,d&&(this.mousePitch=au({clickTolerance:v,enable:!0}),this.touchPitch=(({enable:E,clickTolerance:I,pitchDegreesPerPixelMoved:P=-.5})=>{const k=new me;return new ou({clickTolerance:I,move:(N,O)=>({pitchDelta:(O.y-N.y)*P}),moveStateManager:k,enable:E,assignEvents:mh})})({clickTolerance:v,enable:!0})),A.addEventListener(h,"mousedown",this.mousedown),A.addEventListener(h,"touchstart",this.touchstart,{passive:!1}),A.addEventListener(h,"touchcancel",this.reset)}startMouse(o,h){this.mouseRotate.dragStart(o,h),this.mousePitch&&this.mousePitch.dragStart(o,h),A.disableDrag()}startTouch(o,h){this.touchRotate.dragStart(o,h),this.touchPitch&&this.touchPitch.dragStart(o,h),A.disableDrag()}moveMouse(o,h){const d=this.map,{bearingDelta:g}=this.mouseRotate.dragMove(o,h)||{};if(g&&d.setBearing(d.getBearing()+g),this.mousePitch){const{pitchDelta:v}=this.mousePitch.dragMove(o,h)||{};v&&d.setPitch(d.getPitch()+v)}}moveTouch(o,h){const d=this.map,{bearingDelta:g}=this.touchRotate.dragMove(o,h)||{};if(g&&d.setBearing(d.getBearing()+g),this.touchPitch){const{pitchDelta:v}=this.touchPitch.dragMove(o,h)||{};v&&d.setPitch(d.getPitch()+v)}}off(){const o=this.element;A.removeEventListener(o,"mousedown",this.mousedown),A.removeEventListener(o,"touchstart",this.touchstart,{passive:!1}),A.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),A.removeEventListener(window,"touchend",this.touchend),A.removeEventListener(o,"touchcancel",this.reset),this.offTemp()}offTemp(){A.enableDrag(),A.removeEventListener(window,"mousemove",this.mousemove),A.removeEventListener(window,"mouseup",this.mouseup),A.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),A.removeEventListener(window,"touchend",this.touchend)}}let pa;function yh(_,o,h){const d=new c.M(_.lng,_.lat);if(_=new c.M(_.lng,_.lat),o){const g=new c.M(_.lng-360,_.lat),v=new c.M(_.lng+360,_.lat),E=h.locationPoint(_).distSqr(o);h.locationPoint(g).distSqr(o)180;){const g=h.locationPoint(_);if(g.x>=0&&g.y>=0&&g.x<=h.width&&g.y<=h.height)break;_.lng>h.center.lng?_.lng-=360:_.lng+=360}return _.lng!==d.lng&&h.locationPoint(_).y>h.height/2-h.getHorizon()?_:d}const oc={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function _h(_,o,h){const d=_.classList;for(const g in oc)d.remove(`maplibregl-${h}-anchor-${g}`);d.add(`maplibregl-${h}-anchor-${o}`)}class sc extends c.E{constructor(o){if(super(),this._onKeyPress=h=>{const d=h.code,g=h.charCode||h.keyCode;d!=="Space"&&d!=="Enter"&&g!==32&&g!==13||this.togglePopup()},this._onMapClick=h=>{const d=h.originalEvent.target,g=this._element;this._popup&&(d===g||g.contains(d))&&this.togglePopup()},this._update=h=>{var d;if(!this._map)return;const g=this._map.loaded()&&!this._map.isMoving();((h==null?void 0:h.type)==="terrain"||(h==null?void 0:h.type)==="render"&&!g)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?yh(this._lngLat,this._flatPos,this._map.transform):(d=this._lngLat)===null||d===void 0?void 0:d.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let v="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?v=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(v=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let E="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?E="rotateX(0deg)":this._pitchAlignment==="map"&&(E=`rotateX(${this._map.getPitch()}deg)`),h&&h.type!=="moveend"||(this._pos=this._pos.round()),A.setTransform(this._element,`${oc[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${E} ${v}`),L.frameAsync(new AbortController).then(()=>{this._updateOpacity(h&&h.type==="moveend")}).catch(()=>{})},this._onMove=h=>{if(!this._isDragging){const d=this._clickTolerance||this._map._clickTolerance;this._isDragging=h.point.dist(this._pointerdownPos)>=d}this._isDragging&&(this._pos=h.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new c.k("dragstart"))),this.fire(new c.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new c.k("dragend")),this._state="inactive"},this._addDragHandler=h=>{this._element.contains(h.originalEvent.target)&&(h.preventDefault(),this._positionDelta=h.point.sub(this._pos).add(this._offset),this._pointerdownPos=h.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=o&&o.anchor||"center",this._color=o&&o.color||"#3FB1CE",this._scale=o&&o.scale||1,this._draggable=o&&o.draggable||!1,this._clickTolerance=o&&o.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=o&&o.rotation||0,this._rotationAlignment=o&&o.rotationAlignment||"auto",this._pitchAlignment=o&&o.pitchAlignment&&o.pitchAlignment!=="auto"?o.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(o==null?void 0:o.opacity,o==null?void 0:o.opacityWhenCovered),o&&o.element)this._element=o.element,this._offset=c.P.convert(o&&o.offset||[0,0]);else{this._defaultMarker=!0,this._element=A.create("div"),this._element.setAttribute("aria-label","Map marker");const h=A.createNS("http://www.w3.org/2000/svg","svg"),d=41,g=27;h.setAttributeNS(null,"display","block"),h.setAttributeNS(null,"height",`${d}px`),h.setAttributeNS(null,"width",`${g}px`),h.setAttributeNS(null,"viewBox",`0 0 ${g} ${d}`);const v=A.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"stroke","none"),v.setAttributeNS(null,"stroke-width","1"),v.setAttributeNS(null,"fill","none"),v.setAttributeNS(null,"fill-rule","evenodd");const E=A.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"fill-rule","nonzero");const I=A.createNS("http://www.w3.org/2000/svg","g");I.setAttributeNS(null,"transform","translate(3.0, 29.0)"),I.setAttributeNS(null,"fill","#000000");const P=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const ft of P){const Tt=A.createNS("http://www.w3.org/2000/svg","ellipse");Tt.setAttributeNS(null,"opacity","0.04"),Tt.setAttributeNS(null,"cx","10.5"),Tt.setAttributeNS(null,"cy","5.80029008"),Tt.setAttributeNS(null,"rx",ft.rx),Tt.setAttributeNS(null,"ry",ft.ry),I.appendChild(Tt)}const k=A.createNS("http://www.w3.org/2000/svg","g");k.setAttributeNS(null,"fill",this._color);const N=A.createNS("http://www.w3.org/2000/svg","path");N.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),k.appendChild(N);const O=A.createNS("http://www.w3.org/2000/svg","g");O.setAttributeNS(null,"opacity","0.25"),O.setAttributeNS(null,"fill","#000000");const j=A.createNS("http://www.w3.org/2000/svg","path");j.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),O.appendChild(j);const tt=A.createNS("http://www.w3.org/2000/svg","g");tt.setAttributeNS(null,"transform","translate(6.0, 7.0)"),tt.setAttributeNS(null,"fill","#FFFFFF");const $=A.createNS("http://www.w3.org/2000/svg","g");$.setAttributeNS(null,"transform","translate(8.0, 8.0)");const ot=A.createNS("http://www.w3.org/2000/svg","circle");ot.setAttributeNS(null,"fill","#000000"),ot.setAttributeNS(null,"opacity","0.25"),ot.setAttributeNS(null,"cx","5.5"),ot.setAttributeNS(null,"cy","5.5"),ot.setAttributeNS(null,"r","5.4999962");const K=A.createNS("http://www.w3.org/2000/svg","circle");K.setAttributeNS(null,"fill","#FFFFFF"),K.setAttributeNS(null,"cx","5.5"),K.setAttributeNS(null,"cy","5.5"),K.setAttributeNS(null,"r","5.4999962"),$.appendChild(ot),$.appendChild(K),E.appendChild(I),E.appendChild(k),E.appendChild(O),E.appendChild(tt),E.appendChild($),h.appendChild(E),h.setAttributeNS(null,"height",d*this._scale+"px"),h.setAttributeNS(null,"width",g*this._scale+"px"),this._element.appendChild(h),this._offset=c.P.convert(o&&o.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",h=>{h.preventDefault()}),this._element.addEventListener("mousedown",h=>{h.preventDefault()}),_h(this._element,this._anchor,"marker"),o&&o.className)for(const h of o.className.split(" "))this._element.classList.add(h);this._popup=null}addTo(o){return this.remove(),this._map=o,o.getCanvasContainer().appendChild(this._element),o.on("move",this._update),o.on("moveend",this._update),o.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),A.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(o){return this._lngLat=c.M.convert(o),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(o){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),o){if(!("offset"in o.options)){const g=Math.abs(13.5)/Math.SQRT2;o.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[g,-1*(38.1-13.5+g)],"bottom-right":[-g,-1*(38.1-13.5+g)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=o,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}getPopup(){return this._popup}togglePopup(){const o=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:o?(o.isOpen()?o.remove():(o.setLngLat(this._lngLat),o.addTo(this._map)),this):this}_updateOpacity(o=!1){var h,d;if(!(!((h=this._map)===null||h===void 0)&&h.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(o)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const g=this._map,v=g.terrain.depthAtPoint(this._pos),E=g.terrain.getElevationForLngLatZoom(this._lngLat,g.transform.tileZoom);if(g.transform.lngLatToCameraDepth(this._lngLat,E)-v<.006)return void(this._element.style.opacity=this._opacity);const I=-this._offset.y/g.transform._pixelPerMeter,P=Math.sin(g.getPitch()*Math.PI/180)*I,k=g.terrain.depthAtPoint(new c.P(this._pos.x,this._pos.y-this._offset.y)),N=g.transform.lngLatToCameraDepth(this._lngLat,E+P)-k>.006;!((d=this._popup)===null||d===void 0)&&d.isOpen()&&N&&this._popup.remove(),this._element.style.opacity=N?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(o){return this._offset=c.P.convert(o),this._update(),this}addClassName(o){this._element.classList.add(o)}removeClassName(o){this._element.classList.remove(o)}toggleClassName(o){return this._element.classList.toggle(o)}setDraggable(o){return this._draggable=!!o,this._map&&(o?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(o){return this._rotation=o||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(o){return this._rotationAlignment=o||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(o){return this._pitchAlignment=o&&o!=="auto"?o:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(o,h){return o===void 0&&h===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),o!==void 0&&(this._opacity=o),h!==void 0&&(this._opacityWhenCovered=h),this._map&&this._updateOpacity(!0),this}}const vh={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let uu=0,xl=!1;const bh={maxWidth:100,unit:"metric"};function xh(_,o,h){const d=h&&h.maxWidth||100,g=_._container.clientHeight/2,v=_.unproject([0,g]),E=_.unproject([d,g]),I=v.distanceTo(E);if(h&&h.unit==="imperial"){const P=3.2808*I;P>5280?wl(o,d,P/5280,_._getUIString("ScaleControl.Miles")):wl(o,d,P,_._getUIString("ScaleControl.Feet"))}else h&&h.unit==="nautical"?wl(o,d,I/1852,_._getUIString("ScaleControl.NauticalMiles")):I>=1e3?wl(o,d,I/1e3,_._getUIString("ScaleControl.Kilometers")):wl(o,d,I,_._getUIString("ScaleControl.Meters"))}function wl(_,o,h,d){const g=function(v){const E=Math.pow(10,`${Math.floor(v)}`.length-1);let I=v/E;return I=I>=10?10:I>=5?5:I>=3?3:I>=2?2:I>=1?1:function(P){const k=Math.pow(10,Math.ceil(-Math.log(P)/Math.LN10));return Math.round(P*k)/k}(I),E*I}(h);_.style.width=o*(g/h)+"px",_.innerHTML=`${g} ${d}`}const pf={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},ff=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function wh(_){if(_){if(typeof _=="number"){const o=Math.round(Math.abs(_)/Math.SQRT2);return{center:new c.P(0,0),top:new c.P(0,_),"top-left":new c.P(o,o),"top-right":new c.P(-o,o),bottom:new c.P(0,-_),"bottom-left":new c.P(o,-o),"bottom-right":new c.P(-o,-o),left:new c.P(_,0),right:new c.P(-_,0)}}if(_ instanceof c.P||Array.isArray(_)){const o=c.P.convert(_);return{center:o,top:o,"top-left":o,"top-right":o,bottom:o,"bottom-left":o,"bottom-right":o,left:o,right:o}}return{center:c.P.convert(_.center||[0,0]),top:c.P.convert(_.top||[0,0]),"top-left":c.P.convert(_["top-left"]||[0,0]),"top-right":c.P.convert(_["top-right"]||[0,0]),bottom:c.P.convert(_.bottom||[0,0]),"bottom-left":c.P.convert(_["bottom-left"]||[0,0]),"bottom-right":c.P.convert(_["bottom-right"]||[0,0]),left:c.P.convert(_.left||[0,0]),right:c.P.convert(_.right||[0,0])}}return wh(new c.P(0,0))}const Pg=y;p.AJAXError=c.be,p.Evented=c.E,p.LngLat=c.M,p.MercatorCoordinate=c.Y,p.Point=c.P,p.addProtocol=c.bf,p.config=c.a,p.removeProtocol=c.bg,p.AttributionControl=ls,p.BoxZoomHandler=ss,p.CanvasSource=rs,p.CooperativeGesturesHandler=xe,p.DoubleClickZoomHandler=rf,p.DragPanHandler=Cg,p.DragRotateHandler=as,p.EdgeInsets=ru,p.FullscreenControl=class extends c.E{constructor(_={}){super(),this._onFullscreenChange=()=>{var o;let h=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((o=h==null?void 0:h.shadowRoot)===null||o===void 0)&&o.fullscreenElement;)h=h.shadowRoot.fullscreenElement;h===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,_&&_.container&&(_.container instanceof HTMLElement?this._container=_.container:c.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(_){return this._map=_,this._container||(this._container=this._map.getContainer()),this._controlContainer=A.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){A.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const _=this._fullscreenButton=A.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);A.create("span","maplibregl-ctrl-icon",_).setAttribute("aria-hidden","true"),_.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const _=this._getTitle();this._fullscreenButton.setAttribute("aria-label",_),this._fullscreenButton.title=_}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new c.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new c.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},p.GeoJSONSource=Wr,p.GeolocateControl=class extends c.E{constructor(_){super(),this._onSuccess=o=>{if(this._map){if(this._isOutOfMapMaxBounds(o))return this._setErrorState(),this.fire(new c.k("outofmaxbounds",o)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=o,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(o),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(o),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new c.k("geolocate",o)),this._finish()}},this._updateCamera=o=>{const h=new c.M(o.coords.longitude,o.coords.latitude),d=o.coords.accuracy,g=this._map.getBearing(),v=c.e({bearing:g},this.options.fitBoundsOptions),E=Ee.fromLngLat(h,d);this._map.fitBounds(E,v,{geolocateSource:!0})},this._updateMarker=o=>{if(o){const h=new c.M(o.coords.longitude,o.coords.latitude);this._accuracyCircleMarker.setLngLat(h).addTo(this._map),this._userLocationDotMarker.setLngLat(h).addTo(this._map),this._accuracy=o.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=o=>{if(this._map){if(this.options.trackUserLocation)if(o.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const h=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=h,this._geolocateButton.setAttribute("aria-label",h),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(o.code===3&&xl)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new c.k("error",o)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=o=>{if(this._map){if(this._container.addEventListener("contextmenu",h=>h.preventDefault()),this._geolocateButton=A.create("button","maplibregl-ctrl-geolocate",this._container),A.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",o===!1){c.w("Geolocation support is not available so the GeolocateControl will be disabled.");const h=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=h,this._geolocateButton.setAttribute("aria-label",h)}else{const h=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=h,this._geolocateButton.setAttribute("aria-label",h)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=A.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new sc({element:this._dotElement}),this._circleElement=A.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new sc({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",h=>{h.geolocateSource||this._watchState!=="ACTIVE_LOCK"||h.originalEvent&&h.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new c.k("trackuserlocationend")))})}},this.options=c.e({},vh,_)}onAdd(_){return this._map=_,this._container=A.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(){return c._(this,arguments,void 0,function*(o=!1){if(pa!==void 0&&!o)return pa;if(window.navigator.permissions===void 0)return pa=!!window.navigator.geolocation,pa;try{pa=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{pa=!!window.navigator.geolocation}return pa})}().then(o=>this._setupUI(o)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),A.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,uu=0,xl=!1}_isOutOfMapMaxBounds(_){const o=this._map.getMaxBounds(),h=_.coords;return o&&(h.longitudeo.getEast()||h.latitudeo.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const _=this._map.getBounds(),o=_.getSouthEast(),h=_.getNorthEast(),d=o.distanceTo(h),g=Math.ceil(this._accuracy/(d/this._map._container.clientHeight)*2);this._circleElement.style.width=`${g}px`,this._circleElement.style.height=`${g}px`}trigger(){if(!this._setup)return c.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new c.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":uu--,xl=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new c.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new c.k("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let _;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),uu++,uu>1?(_={maximumAge:6e5,timeout:0},xl=!0):(_=this.options.positionOptions,xl=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,_)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},p.Hash=$p,p.ImageSource=Hn,p.KeyboardHandler=Ba,p.LngLatBounds=Ee,p.LogoControl=Tg,p.Map=class extends ro{constructor(_){if(c.bc.mark(c.bd.create),(_=c.e({},ic,_)).minZoom!=null&&_.maxZoom!=null&&_.minZoom>_.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(_.minPitch!=null&&_.maxPitch!=null&&_.minPitch>_.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(_.minPitch!=null&&_.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(_.maxPitch!=null&&_.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new ch(_.minZoom,_.maxZoom,_.minPitch,_.maxPitch,_.renderWorldCopies),{bearingSnap:_.bearingSnap}),this._contextLost=o=>{o.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new c.k("webglcontextlost",{originalEvent:o}))},this._contextRestored=o=>{this._setupPainter(),this.resize(),this._update(),this.fire(new c.k("webglcontextrestored",{originalEvent:o}))},this._onMapScroll=o=>{if(o.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=_.interactive,this._maxTileCacheSize=_.maxTileCacheSize,this._maxTileCacheZoomLevels=_.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=_.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=_.preserveDrawingBuffer,this._antialias=_.antialias,this._trackResize=_.trackResize,this._bearingSnap=_.bearingSnap,this._refreshExpiredTiles=_.refreshExpiredTiles,this._fadeDuration=_.fadeDuration,this._crossSourceCollisions=_.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=_.collectResourceTiming,this._renderTaskQueue=new nc,this._controls=[],this._mapId=c.a3(),this._locale=c.e({},lf,_.locale),this._clickTolerance=_.clickTolerance,this._overridePixelRatio=_.pixelRatio,this._maxCanvasSize=_.maxCanvasSize,this.transformCameraUpdate=_.transformCameraUpdate,this._imageQueueHandle=H.addThrottleControl(()=>this.isMoving()),this._requestManager=new nt(_.transformRequest),typeof _.container=="string"){if(this._container=document.getElementById(_.container),!this._container)throw new Error(`Container '${_.container}' not found.`)}else{if(!(_.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=_.container}if(_.maxBounds&&this.setMaxBounds(_.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let o=!1;const h=Qp(d=>{this._trackResize&&!this._removed&&this.resize(d)._update()},50);this._resizeObserver=new ResizeObserver(d=>{o?h(d):o=!0}),this._resizeObserver.observe(this._container)}this.handlers=new of(this,_),this._hash=_.hash&&new $p(typeof _.hash=="string"&&_.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:_.center,zoom:_.zoom,bearing:_.bearing,pitch:_.pitch}),_.bounds&&(this.resize(),this.fitBounds(_.bounds,c.e({},_.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=_.localIdeographFontFamily,this._validateStyle=_.validateStyle,_.style&&this.setStyle(_.style,{localIdeographFontFamily:_.localIdeographFontFamily}),_.attributionControl&&this.addControl(new ls(typeof _.attributionControl=="boolean"?void 0:_.attributionControl)),_.maplibreLogo&&this.addControl(new Tg,_.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",o=>{this._update(o.dataType==="style"),this.fire(new c.k(`${o.dataType}data`,o))}),this.on("dataloading",o=>{this.fire(new c.k(`${o.dataType}dataloading`,o))}),this.on("dataabort",o=>{this.fire(new c.k("sourcedataabort",o))})}_getMapId(){return this._mapId}addControl(_,o){if(o===void 0&&(o=_.getDefaultPosition?_.getDefaultPosition():"top-right"),!_||!_.onAdd)return this.fire(new c.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const h=_.onAdd(this);this._controls.push(_);const d=this._controlPositions[o];return o.indexOf("bottom")!==-1?d.insertBefore(h,d.firstChild):d.appendChild(h),this}removeControl(_){if(!_||!_.onRemove)return this.fire(new c.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const o=this._controls.indexOf(_);return o>-1&&this._controls.splice(o,1),_.onRemove(this),this}hasControl(_){return this._controls.indexOf(_)>-1}calculateCameraOptionsFromTo(_,o,h,d){return d==null&&this.terrain&&(d=this.terrain.getElevationForLngLatZoom(h,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(_,o,h,d)}resize(_){var o;const h=this._containerDimensions(),d=h[0],g=h[1],v=this._getClampedPixelRatio(d,g);if(this._resizeCanvas(d,g,v),this.painter.resize(d,g,v),this.painter.overLimit()){const I=this.painter.context.gl;this._maxCanvasSize=[I.drawingBufferWidth,I.drawingBufferHeight];const P=this._getClampedPixelRatio(d,g);this._resizeCanvas(d,g,P),this.painter.resize(d,g,P)}this.transform.resize(d,g),(o=this._requestedCameraState)===null||o===void 0||o.resize(d,g);const E=!this._moving;return E&&(this.stop(),this.fire(new c.k("movestart",_)).fire(new c.k("move",_))),this.fire(new c.k("resize",_)),E&&this.fire(new c.k("moveend",_)),this}_getClampedPixelRatio(_,o){const{0:h,1:d}=this._maxCanvasSize,g=this.getPixelRatio(),v=_*g,E=o*g;return Math.min(v>h?h/v:1,E>d?d/E:1)*g}getPixelRatio(){var _;return(_=this._overridePixelRatio)!==null&&_!==void 0?_:devicePixelRatio}setPixelRatio(_){this._overridePixelRatio=_,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(_){return this.transform.setMaxBounds(Ee.convert(_)),this._update()}setMinZoom(_){if((_=_??-2)>=-2&&_<=this.transform.maxZoom)return this.transform.minZoom=_,this._update(),this.getZoom()<_&&this.setZoom(_),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(_){if((_=_??22)>=this.transform.minZoom)return this.transform.maxZoom=_,this._update(),this.getZoom()>_&&this.setZoom(_),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(_){if((_=_??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(_>=0&&_<=this.transform.maxPitch)return this.transform.minPitch=_,this._update(),this.getPitch()<_&&this.setPitch(_),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(_){if((_=_??60)>85)throw new Error("maxPitch must be less than or equal to 85");if(_>=this.transform.minPitch)return this.transform.maxPitch=_,this._update(),this.getPitch()>_&&this.setPitch(_),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(_){return this.transform.renderWorldCopies=_,this._update()}project(_){return this.transform.locationPoint(c.M.convert(_),this.style&&this.terrain)}unproject(_){return this.transform.pointLocation(c.P.convert(_),this.terrain)}isMoving(){var _;return this._moving||((_=this.handlers)===null||_===void 0?void 0:_.isMoving())}isZooming(){var _;return this._zooming||((_=this.handlers)===null||_===void 0?void 0:_.isZooming())}isRotating(){var _;return this._rotating||((_=this.handlers)===null||_===void 0?void 0:_.isRotating())}_createDelegatedListener(_,o,h){if(_==="mouseenter"||_==="mouseover"){let d=!1;return{layer:o,listener:h,delegates:{mousemove:v=>{const E=this.getLayer(o)?this.queryRenderedFeatures(v.point,{layers:[o]}):[];E.length?d||(d=!0,h.call(this,new no(_,this,v.originalEvent,{features:E}))):d=!1},mouseout:()=>{d=!1}}}}if(_==="mouseleave"||_==="mouseout"){let d=!1;return{layer:o,listener:h,delegates:{mousemove:E=>{(this.getLayer(o)?this.queryRenderedFeatures(E.point,{layers:[o]}):[]).length?d=!0:d&&(d=!1,h.call(this,new no(_,this,E.originalEvent)))},mouseout:E=>{d&&(d=!1,h.call(this,new no(_,this,E.originalEvent)))}}}}{const d=g=>{const v=this.getLayer(o)?this.queryRenderedFeatures(g.point,{layers:[o]}):[];v.length&&(g.features=v,h.call(this,g),delete g.features)};return{layer:o,listener:h,delegates:{[_]:d}}}}on(_,o,h){if(h===void 0)return super.on(_,o);const d=this._createDelegatedListener(_,o,h);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[_]=this._delegatedListeners[_]||[],this._delegatedListeners[_].push(d);for(const g in d.delegates)this.on(g,d.delegates[g]);return this}once(_,o,h){if(h===void 0)return super.once(_,o);const d=this._createDelegatedListener(_,o,h);for(const g in d.delegates)this.once(g,d.delegates[g]);return this}off(_,o,h){return h===void 0?super.off(_,o):(this._delegatedListeners&&this._delegatedListeners[_]&&(d=>{const g=this._delegatedListeners[_];for(let v=0;vthis._updateStyle(_,o));const h=this.style&&o.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!_)),_?(this.style=new bo(this,o||{}),this.style.setEventedParent(this,{style:this.style}),typeof _=="string"?this.style.loadURL(_,o,h):this.style.loadJSON(_,o,h),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new bo(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(_,o){if(typeof _=="string"){const h=this._requestManager.transformRequest(_,"Style");c.h(h,new AbortController).then(d=>{this._updateDiff(d.data,o)}).catch(d=>{d&&this.fire(new c.j(d))})}else typeof _=="object"&&this._updateDiff(_,o)}_updateDiff(_,o){try{this.style.setState(_,o)&&this._update(!0)}catch(h){c.w(`Unable to perform style diff: ${h.message||h.error||h}. Rebuilding the style from scratch.`),this._updateStyle(_,o)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():c.w("There is no style added to the map.")}addSource(_,o){return this._lazyInitEmptyStyle(),this.style.addSource(_,o),this._update(!0)}isSourceLoaded(_){const o=this.style&&this.style.sourceCaches[_];if(o!==void 0)return o.loaded();this.fire(new c.j(new Error(`There is no source with ID '${_}'`)))}setTerrain(_){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),_){const o=this.style.sourceCaches[_.source];if(!o)throw new Error(`cannot load terrain, because there exists no source with ID: ${_.source}`);this.terrain===null&&o.reload();for(const h in this.style._layers){const d=this.style._layers[h];d.type==="hillshade"&&d.source===_.source&&c.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Lg(this.painter,o,_),this.painter.renderToTexture=new af(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=h=>{h.dataType==="style"?this.terrain.sourceCache.freeRtt():h.dataType==="source"&&h.tile&&(h.sourceId!==_.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(h.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new c.k("terrain",{terrain:_})),this}getTerrain(){var _,o;return(o=(_=this.terrain)===null||_===void 0?void 0:_.options)!==null&&o!==void 0?o:null}areTilesLoaded(){const _=this.style&&this.style.sourceCaches;for(const o in _){const h=_[o]._tiles;for(const d in h){const g=h[d];if(g.state!=="loaded"&&g.state!=="errored")return!1}}return!0}removeSource(_){return this.style.removeSource(_),this._update(!0)}getSource(_){return this.style.getSource(_)}addImage(_,o,h={}){const{pixelRatio:d=1,sdf:g=!1,stretchX:v,stretchY:E,content:I}=h;if(this._lazyInitEmptyStyle(),!(o instanceof HTMLImageElement||c.b(o))){if(o.width===void 0||o.height===void 0)return this.fire(new c.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:P,height:k,data:N}=o,O=o;return this.style.addImage(_,{data:new c.R({width:P,height:k},new Uint8Array(N)),pixelRatio:d,stretchX:v,stretchY:E,content:I,sdf:g,version:0,userImage:O}),O.onAdd&&O.onAdd(this,_),this}}{const{width:P,height:k,data:N}=L.getImageData(o);this.style.addImage(_,{data:new c.R({width:P,height:k},N),pixelRatio:d,stretchX:v,stretchY:E,content:I,sdf:g,version:0})}}updateImage(_,o){const h=this.style.getImage(_);if(!h)return this.fire(new c.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const d=o instanceof HTMLImageElement||c.b(o)?L.getImageData(o):o,{width:g,height:v,data:E}=d;if(g===void 0||v===void 0)return this.fire(new c.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(g!==h.data.width||v!==h.data.height)return this.fire(new c.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const I=!(o instanceof HTMLImageElement||c.b(o));return h.data.replace(E,I),this.style.updateImage(_,h),this}getImage(_){return this.style.getImage(_)}hasImage(_){return _?!!this.style.getImage(_):(this.fire(new c.j(new Error("Missing required image id"))),!1)}removeImage(_){this.style.removeImage(_)}loadImage(_){return H.getImage(this._requestManager.transformRequest(_,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(_,o){return this._lazyInitEmptyStyle(),this.style.addLayer(_,o),this._update(!0)}moveLayer(_,o){return this.style.moveLayer(_,o),this._update(!0)}removeLayer(_){return this.style.removeLayer(_),this._update(!0)}getLayer(_){return this.style.getLayer(_)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(_,o,h){return this.style.setLayerZoomRange(_,o,h),this._update(!0)}setFilter(_,o,h={}){return this.style.setFilter(_,o,h),this._update(!0)}getFilter(_){return this.style.getFilter(_)}setPaintProperty(_,o,h,d={}){return this.style.setPaintProperty(_,o,h,d),this._update(!0)}getPaintProperty(_,o){return this.style.getPaintProperty(_,o)}setLayoutProperty(_,o,h,d={}){return this.style.setLayoutProperty(_,o,h,d),this._update(!0)}getLayoutProperty(_,o){return this.style.getLayoutProperty(_,o)}setGlyphs(_,o={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(_,o),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(_,o,h={}){return this._lazyInitEmptyStyle(),this.style.addSprite(_,o,h,d=>{d||this._update(!0)}),this}removeSprite(_){return this._lazyInitEmptyStyle(),this.style.removeSprite(_),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(_,o={}){return this._lazyInitEmptyStyle(),this.style.setSprite(_,o,h=>{h||this._update(!0)}),this}setLight(_,o={}){return this._lazyInitEmptyStyle(),this.style.setLight(_,o),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(_,o){return this.style.setFeatureState(_,o),this._update()}removeFeatureState(_,o){return this.style.removeFeatureState(_,o),this._update()}getFeatureState(_){return this.style.getFeatureState(_)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let _=0,o=0;return this._container&&(_=this._container.clientWidth||400,o=this._container.clientHeight||300),[_,o]}_setupContainer(){const _=this._container;_.classList.add("maplibregl-map");const o=this._canvasContainer=A.create("div","maplibregl-canvas-container",_);this._interactive&&o.classList.add("maplibregl-interactive"),this._canvas=A.create("canvas","maplibregl-canvas",o),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const h=this._containerDimensions(),d=this._getClampedPixelRatio(h[0],h[1]);this._resizeCanvas(h[0],h[1],d);const g=this._controlContainer=A.create("div","maplibregl-control-container",_),v=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(E=>{v[E]=A.create("div",`maplibregl-ctrl-${E} `,g)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(_,o,h){this._canvas.width=Math.floor(h*_),this._canvas.height=Math.floor(h*o),this._canvas.style.width=`${_}px`,this._canvas.style.height=`${o}px`}_setupPainter(){const _={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let o=null;this._canvas.addEventListener("webglcontextcreationerror",d=>{o={requestedAttributes:_},d&&(o.statusMessage=d.statusMessage,o.type=d.type)},{once:!0});const h=this._canvas.getContext("webgl2",_)||this._canvas.getContext("webgl",_);if(!h){const d="Failed to initialize WebGL";throw o?(o.message=d,new Error(JSON.stringify(o))):new Error(d)}this.painter=new gg(h,this.transform),z.testSupport(h)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(_){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||_,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(_){return this._update(),this._renderTaskQueue.add(_)}_cancelRenderFrame(_){this._renderTaskQueue.remove(_)}_render(_){const o=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(_),this._removed)return;let h=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const g=this.transform.zoom,v=L.now();this.style.zoomHistory.update(g,v);const E=new c.a8(g,{now:v,fadeDuration:o,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),I=E.crossFadingFactor();I===1&&I===this._crossFadingFactor||(h=!0,this._crossFadingFactor=I),this.style.update(E)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,o,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:o,showPadding:this.showPadding}),this.fire(new c.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,c.bc.mark(c.bd.load),this.fire(new c.k("load"))),this.style&&(this.style.hasTransitions()||h)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const d=this._sourcesDirty||this._styleDirty||this._placementDirty;return d||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new c.k("idle")),!this._loaded||this._fullyLoaded||d||(this._fullyLoaded=!0,c.bc.mark(c.bd.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var _;this._hash&&this._hash.remove();for(const h of this._controls)h.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),H.removeThrottleControl(this._imageQueueHandle),(_=this._resizeObserver)===null||_===void 0||_.disconnect();const o=this.painter.context.gl.getExtension("WEBGL_lose_context");o&&o.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),A.remove(this._canvasContainer),A.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),c.bc.clearMetrics(),this._removed=!0,this.fire(new c.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,L.frameAsync(this._frameRequest).then(_=>{c.bc.frame(_),this._frameRequest=null,this._render(_)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(_){this._showTileBoundaries!==_&&(this._showTileBoundaries=_,this._update())}get showPadding(){return!!this._showPadding}set showPadding(_){this._showPadding!==_&&(this._showPadding=_,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(_){this._showCollisionBoxes!==_&&(this._showCollisionBoxes=_,_?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(_){this._showOverdrawInspector!==_&&(this._showOverdrawInspector=_,this._update())}get repaint(){return!!this._repaint}set repaint(_){this._repaint!==_&&(this._repaint=_,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(_){this._vertices=_,this._update()}get version(){return uf}getCameraTargetElevation(){return this.transform.elevation}},p.MapMouseEvent=no,p.MapTouchEvent=Ps,p.MapWheelEvent=tf,p.Marker=sc,p.NavigationControl=class{constructor(_){this._updateZoomButtons=()=>{const o=this._map.getZoom(),h=o===this._map.getMaxZoom(),d=o===this._map.getMinZoom();this._zoomInButton.disabled=h,this._zoomOutButton.disabled=d,this._zoomInButton.setAttribute("aria-disabled",h.toString()),this._zoomOutButton.setAttribute("aria-disabled",d.toString())},this._rotateCompassArrow=()=>{const o=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=o},this._setButtonTitle=(o,h)=>{const d=this._map._getUIString(`NavigationControl.${h}`);o.title=d,o.setAttribute("aria-label",d)},this.options=c.e({},cf,_),this._container=A.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",o=>o.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",o=>this._map.zoomIn({},{originalEvent:o})),A.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",o=>this._map.zoomOut({},{originalEvent:o})),A.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",o=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:o}):this._map.resetNorth({},{originalEvent:o})}),this._compassIcon=A.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(_){return this._map=_,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new hf(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){A.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(_,o){const h=A.create("button",_,this._container);return h.type="button",h.addEventListener("click",o),h}},p.Popup=class extends c.E{constructor(_){super(),this.remove=()=>(this._content&&A.remove(this._content),this._container&&(A.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new c.k("close"))),this),this._onMouseUp=o=>{this._update(o.point)},this._onMouseMove=o=>{this._update(o.point)},this._onDrag=o=>{this._update(o.point)},this._update=o=>{var h;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=A.create("div","maplibregl-popup",this._map.getContainer()),this._tip=A.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const I of this.options.className.split(" "))this._container.classList.add(I);this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?yh(this._lngLat,this._flatPos,this._map.transform):(h=this._lngLat)===null||h===void 0?void 0:h.wrap(),this._trackPointer&&!o)return;const d=this._flatPos=this._pos=this._trackPointer&&o?o:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&o?o:this._map.transform.locationPoint(this._lngLat));let g=this.options.anchor;const v=wh(this.options.offset);if(!g){const I=this._container.offsetWidth,P=this._container.offsetHeight;let k;k=d.y+v.bottom.ythis._map.transform.height-P?["bottom"]:[],d.xthis._map.transform.width-I/2&&k.push("right"),g=k.length===0?"bottom":k.join("-")}let E=d.add(v[g]);this.options.subpixelPositioning||(E=E.round()),A.setTransform(this._container,`${oc[g]} translate(${E.x}px,${E.y}px)`),_h(this._container,g,"popup")},this._onClose=()=>{this.remove()},this.options=c.e(Object.create(pf),_)}addTo(_){return this._map&&this.remove(),this._map=_,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new c.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(_){return this._lngLat=c.M.convert(_),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(_){return this.setDOMContent(document.createTextNode(_))}setHTML(_){const o=document.createDocumentFragment(),h=document.createElement("body");let d;for(h.innerHTML=_;d=h.firstChild,d;)o.appendChild(d);return this.setDOMContent(o)}getMaxWidth(){var _;return(_=this._container)===null||_===void 0?void 0:_.style.maxWidth}setMaxWidth(_){return this.options.maxWidth=_,this._update(),this}setDOMContent(_){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=A.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(_),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(_){this._container&&this._container.classList.add(_)}removeClassName(_){this._container&&this._container.classList.remove(_)}setOffset(_){return this.options.offset=_,this._update(),this}toggleClassName(_){if(this._container)return this._container.classList.toggle(_)}setSubpixelPositioning(_){this.options.subpixelPositioning=_}_createCloseButton(){this.options.closeButton&&(this._closeButton=A.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const _=this._container.querySelector(ff);_&&_.focus()}},p.RasterDEMTileSource=hn,p.RasterTileSource=Mt,p.ScaleControl=class{constructor(_){this._onMove=()=>{xh(this._map,this._container,this.options)},this.setUnit=o=>{this.options.unit=o,xh(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},bh),_)}getDefaultPosition(){return"bottom-left"}onAdd(_){return this._map=_,this._container=A.create("div","maplibregl-ctrl maplibregl-ctrl-scale",_.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){A.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},p.ScrollZoomHandler=dh,p.Style=bo,p.TerrainControl=class{constructor(_){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=_}onAdd(_){return this._map=_,this._container=A.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=A.create("button","maplibregl-ctrl-terrain",this._container),A.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){A.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},p.TwoFingersTouchPitchHandler=Sg,p.TwoFingersTouchRotateHandler=nf,p.TwoFingersTouchZoomHandler=wg,p.TwoFingersTouchZoomRotateHandler=tc,p.VectorTileSource=Or,p.VideoSource=_o,p.addSourceType=(_,o)=>c._(void 0,void 0,void 0,function*(){if(Da(_))throw new Error(`A source type called "${_}" already exists.`);((h,d)=>{Cs[h]=d})(_,o)}),p.clearPrewarmedResources=function(){const _=zn;_&&(_.isPreloaded()&&_.numActive()===1?(_.release(Pe),zn=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},p.getMaxParallelImageRequests=function(){return c.a.MAX_PARALLEL_IMAGE_REQUESTS},p.getRTLTextPluginStatus=function(){return Ht().getRTLTextPluginStatus()},p.getVersion=function(){return Pg},p.getWorkerCount=function(){return Mn.workerCount},p.getWorkerUrl=function(){return c.a.WORKER_URL},p.importScriptInWorkers=function(_){return Bi().broadcast("IS",_)},p.prewarm=function(){Cr().acquire(Pe)},p.setMaxParallelImageRequests=function(_){c.a.MAX_PARALLEL_IMAGE_REQUESTS=_},p.setRTLTextPlugin=function(_,o){return Ht().setRTLTextPlugin(_,o)},p.setWorkerCount=function(_){Mn.workerCount=_},p.setWorkerUrl=function(_){c.a.WORKER_URL=_}});var l=n;return l})})(T2);var wT=T2.exports;const Ep=$v(wT);function Cb(e){let t;return n=>{if(n)for(let r in n){let s=t==null?void 0:t[r],l=n[r];s!==l&&e(r,l,s)}else if(t)for(let r in t)e(r,void 0,t[r]);t=n}}function ST(e,...t){let n=[e];for(let r of t)if(r)Array.isArray(r)&&r[0]===e?n.push(...r.slice(1)):n.push(r);else continue;if(n.length!==1)return n.length===2?n[1]:n}function ET(e){return e===!0?["has","point_count"]:e===!1?["!",["has","point_count"]]:void 0}function av(e,t){return["case",["boolean",["feature-state","hover"],!1],t,e]}var Im=IT;function IT(e){var t,n,r;if(e){if(Array.isArray(e)){for(t=[],n=e.length,r=0;r{r=null}),Zo())},i(s){n||(ee(r),n=!0)},o(s){le(r),n=!1},d(s){s&&fe(t),r&&r.d(s)}}}function TT(e,t,n){let r,s,l,p,c,y,w,T,L,A,z,B,{$$slots:Y={},$$scope:et}=t,{id:at=Md("layer")}=t,{source:W=void 0}=t,{sourceLayer:H=void 0}=t,{beforeId:nt=void 0}=t,{beforeLayerType:ut=void 0}=t,{type:_t}=t,{paint:ct=void 0}=t,{layout:bt=void 0}=t,{filter:It=void 0}=t,{applyToClusters:Ot=void 0}=t,{minzoom:dt=void 0}=t,{maxzoom:Pt=void 0}=t,{manageHoverState:Qt=!1}=t,{hovered:Et=null}=t,{interactive:oe=!0}=t,{hoverCursor:ge=void 0}=t,{eventsIfTopMost:Te=!1}=t;const Fe=Ld(),{map:rn,source:En,self:Me,minzoom:Pe,maxzoom:Mn,eventTopMost:pr,layerInfo:zn}=xT();Zn(e,rn,Vt=>n(31,L=Vt)),Zn(e,En,Vt=>n(32,A=Vt)),Zn(e,Me,Vt=>n(0,T=Vt)),Zn(e,Pe,Vt=>n(34,B=Vt)),Zn(e,Mn,Vt=>n(33,z=Vt)),Ul(()=>{T&&L&&(zn.delete(T),L==null||L.removeLayer(T))});let jn;function Cr(Vt){var Mt,hn;if(!oe||!T||!L||Te&&pr(Vt)!==T)return;let Ee=Vt.features??[],Re=(hn=(Mt=Ee[0])==null?void 0:Mt.properties)==null?void 0:hn.cluster_id,Or={event:Vt,map:L,clusterId:Re,layer:T,source:c,features:Ee};Fe(Vt.type,Or)}function qr(Vt){var Mt,hn;if(!oe||!T||!L||Te&&pr(Vt)!==T)return;ge&&(L.getCanvas().style.cursor=ge);let Ee=Vt.features??[];n(6,Et=Ee[0]??null);let Re=(hn=(Mt=Ee[0])==null?void 0:Mt.properties)==null?void 0:hn.cluster_id;Fe("mouseenter",{event:Vt,map:L,clusterId:Re,layer:T,source:c,features:Ee})}function Bi(Vt){var Mt,hn,Wr;if(!oe||!L)return;if(Te&&pr(Vt)!==T){n(6,Et=null),Qt&&jn!==void 0&&(L==null||L.setFeatureState({source:c,sourceLayer:H,id:jn},{hover:!1}),jn=void 0);return}L.getCanvas().style.cursor=ge;let Ee=Vt.features??[],Re=(hn=(Mt=Ee[0])==null?void 0:Mt.properties)==null?void 0:hn.cluster_id,Or=(Wr=Ee[0])==null?void 0:Wr.id;Or!==jn&&(Qt&&(jn!==void 0&&(L==null||L.setFeatureState({source:c,id:jn,sourceLayer:H},{hover:!1})),L==null||L.setFeatureState({source:c,id:Or,sourceLayer:H},{hover:!0})),jn=Or,n(6,Et=Ee[0]??null)),Fe("mousemove",{event:Vt,map:L,clusterId:Re,layer:T,source:c,features:Ee})}function Zt(Vt){if(!(!oe||!T||!L)){if(ge&&(L.getCanvas().style.cursor=""),n(6,Et=null),Qt&&jn!==void 0){const Ee={source:c,id:jn,sourceLayer:H};L==null||L.setFeatureState(Ee,{hover:!1}),jn=void 0}Fe("mouseleave",{map:L,layer:T,source:c})}}let on=!0;function cn(Vt){L&&(L.off("click",Vt,Cr),L.off("dblclick",Vt,Cr),L.off("contextmenu",Vt,Cr),L.off("mouseenter",Vt,qr),L.off("mousemove",Vt,Bi),L.off("mouseleave",Vt,Zt))}return Ul(()=>{L&&T&&cn(T)}),e.$$set=Vt=>{"id"in Vt&&n(7,at=Vt.id),"source"in Vt&&n(8,W=Vt.source),"sourceLayer"in Vt&&n(9,H=Vt.sourceLayer),"beforeId"in Vt&&n(10,nt=Vt.beforeId),"beforeLayerType"in Vt&&n(11,ut=Vt.beforeLayerType),"type"in Vt&&n(12,_t=Vt.type),"paint"in Vt&&n(13,ct=Vt.paint),"layout"in Vt&&n(14,bt=Vt.layout),"filter"in Vt&&n(15,It=Vt.filter),"applyToClusters"in Vt&&n(16,Ot=Vt.applyToClusters),"minzoom"in Vt&&n(17,dt=Vt.minzoom),"maxzoom"in Vt&&n(18,Pt=Vt.maxzoom),"manageHoverState"in Vt&&n(19,Qt=Vt.manageHoverState),"hovered"in Vt&&n(6,Et=Vt.hovered),"interactive"in Vt&&n(20,oe=Vt.interactive),"hoverCursor"in Vt&&n(21,ge=Vt.hoverCursor),"eventsIfTopMost"in Vt&&n(22,Te=Vt.eventsIfTopMost),"$$scope"in Vt&&n(35,et=Vt.$$scope)},e.$$.update=()=>{if(e.$$.dirty[0]&65536&&n(30,r=ET(Ot)),e.$$.dirty[0]&1073774592&&n(24,s=ST("all",r,It)),e.$$.dirty[0]&131072|e.$$.dirty[1]&8&&n(26,l=dt??B),e.$$.dirty[0]&262144|e.$$.dirty[1]&4&&n(25,p=Pt??z),e.$$.dirty[0]&256|e.$$.dirty[1]&2&&n(29,c=W||A),e.$$.dirty[0]&654343809|e.$$.dirty[1]&1&&L&&T!==at&&c){T&&(cn(T),zn.delete(T));let Vt=nt;if(!nt&&ut){let Ee=L.getStyle().layers,Re=typeof ut=="function"?ut:Mt=>Mt.type===ut,Or=Ee==null?void 0:Ee.find(Re);Or&&(Vt=Or.id)}Nl(Me,T=at,T),L.addLayer(Im({id:T,type:_t,source:c,"source-layer":H,filter:s,paint:ct,layout:bt,minzoom:l,maxzoom:p}),Vt),n(23,on=!0),L.on("click",T,Cr),L.on("dblclick",T,Cr),L.on("contextmenu",T,Cr),L.on("mouseenter",T,qr),L.on("mousemove",T,Bi),L.on("mouseleave",T,Zt)}e.$$.dirty[0]&1048577&&T&&zn.set(T,{interactive:oe}),e.$$.dirty[0]&1|e.$$.dirty[1]&1&&n(28,y=T?Cb((Vt,Ee)=>L==null?void 0:L.setPaintProperty(T,Vt,Ee)):void 0),e.$$.dirty[0]&1|e.$$.dirty[1]&1&&n(27,w=T?Cb((Vt,Ee)=>L==null?void 0:L.setLayoutProperty(T,Vt,Ee)):void 0),e.$$.dirty[0]&268443648&&(y==null||y(ct)),e.$$.dirty[0]&134234112&&(w==null||w(bt)),e.$$.dirty[0]&100663297|e.$$.dirty[1]&1&&T&&(L==null||L.setLayerZoomRange(T,l,p)),e.$$.dirty[0]&25165825|e.$$.dirty[1]&1&&T&&(on?n(23,on=!1):L==null||L.setFilter(T,s))},[T,rn,En,Me,Pe,Mn,Et,at,W,H,nt,ut,_t,ct,bt,It,Ot,dt,Pt,Qt,oe,ge,Te,on,s,p,l,w,y,c,r,L,A,z,B,et,Y]}class t0 extends Pn{constructor(t){super(),Ln(this,t,TT,CT,vn,{id:7,source:8,sourceLayer:9,beforeId:10,beforeLayerType:11,type:12,paint:13,layout:14,filter:15,applyToClusters:16,minzoom:17,maxzoom:18,manageHoverState:19,hovered:6,interactive:20,hoverCursor:21,eventsIfTopMost:22},null,[-1,-1])}}function LT(e){let t;const n=e[16].default,r=Ws(n,e,e[24],null);return{c(){r&&r.c()},m(s,l){r&&r.m(s,l),t=!0},p(s,l){r&&r.p&&(!t||l&16777216)&&Hs(r,n,s,s[24],t?Zs(n,s[24],l,null):Xs(s[24]),null)},i(s){t||(ee(r,s),t=!0)},o(s){le(r,s),t=!1},d(s){r&&r.d(s)}}}function PT(e){let t,n,r;function s(p){e[17](p)}let l={id:e[1],type:"circle",source:e[2],sourceLayer:e[3],beforeId:e[4],beforeLayerType:e[5],paint:e[6],layout:e[7],filter:e[8],applyToClusters:e[9],minzoom:e[10],maxzoom:e[11],hoverCursor:e[12],manageHoverState:e[13],eventsIfTopMost:e[14],interactive:e[15],$$slots:{default:[LT]},$$scope:{ctx:e}};return e[0]!==void 0&&(l.hovered=e[0]),t=new t0({props:l}),Di.push(()=>Jo(t,"hovered",s)),t.$on("click",e[18]),t.$on("dblclick",e[19]),t.$on("contextmenu",e[20]),t.$on("mouseenter",e[21]),t.$on("mousemove",e[22]),t.$on("mouseleave",e[23]),{c(){nn(t.$$.fragment)},m(p,c){$e(t,p,c),r=!0},p(p,[c]){const y={};c&2&&(y.id=p[1]),c&4&&(y.source=p[2]),c&8&&(y.sourceLayer=p[3]),c&16&&(y.beforeId=p[4]),c&32&&(y.beforeLayerType=p[5]),c&64&&(y.paint=p[6]),c&128&&(y.layout=p[7]),c&256&&(y.filter=p[8]),c&512&&(y.applyToClusters=p[9]),c&1024&&(y.minzoom=p[10]),c&2048&&(y.maxzoom=p[11]),c&4096&&(y.hoverCursor=p[12]),c&8192&&(y.manageHoverState=p[13]),c&16384&&(y.eventsIfTopMost=p[14]),c&32768&&(y.interactive=p[15]),c&16777216&&(y.$$scope={dirty:c,ctx:p}),!n&&c&1&&(n=!0,y.hovered=p[0],Ko(()=>n=!1)),t.$set(y)},i(p){r||(ee(t.$$.fragment,p),r=!0)},o(p){le(t.$$.fragment,p),r=!1},d(p){tn(t,p)}}}function MT(e,t,n){let{$$slots:r={},$$scope:s}=t,{id:l=Md("circle")}=t,{source:p=void 0}=t,{sourceLayer:c=void 0}=t,{beforeId:y=void 0}=t,{beforeLayerType:w=void 0}=t,{paint:T}=t,{layout:L=void 0}=t,{filter:A=void 0}=t,{applyToClusters:z=void 0}=t,{minzoom:B=void 0}=t,{maxzoom:Y=void 0}=t,{hoverCursor:et=void 0}=t,{manageHoverState:at=!1}=t,{hovered:W=null}=t,{eventsIfTopMost:H=!1}=t,{interactive:nt=!0}=t;function ut(Pt){W=Pt,n(0,W)}function _t(Pt){ni.call(this,e,Pt)}function ct(Pt){ni.call(this,e,Pt)}function bt(Pt){ni.call(this,e,Pt)}function It(Pt){ni.call(this,e,Pt)}function Ot(Pt){ni.call(this,e,Pt)}function dt(Pt){ni.call(this,e,Pt)}return e.$$set=Pt=>{"id"in Pt&&n(1,l=Pt.id),"source"in Pt&&n(2,p=Pt.source),"sourceLayer"in Pt&&n(3,c=Pt.sourceLayer),"beforeId"in Pt&&n(4,y=Pt.beforeId),"beforeLayerType"in Pt&&n(5,w=Pt.beforeLayerType),"paint"in Pt&&n(6,T=Pt.paint),"layout"in Pt&&n(7,L=Pt.layout),"filter"in Pt&&n(8,A=Pt.filter),"applyToClusters"in Pt&&n(9,z=Pt.applyToClusters),"minzoom"in Pt&&n(10,B=Pt.minzoom),"maxzoom"in Pt&&n(11,Y=Pt.maxzoom),"hoverCursor"in Pt&&n(12,et=Pt.hoverCursor),"manageHoverState"in Pt&&n(13,at=Pt.manageHoverState),"hovered"in Pt&&n(0,W=Pt.hovered),"eventsIfTopMost"in Pt&&n(14,H=Pt.eventsIfTopMost),"interactive"in Pt&&n(15,nt=Pt.interactive),"$$scope"in Pt&&n(24,s=Pt.$$scope)},[W,l,p,c,y,w,T,L,A,z,B,Y,et,at,H,nt,r,ut,_t,ct,bt,It,Ot,dt,s]}class AT extends Pn{constructor(t){super(),Ln(this,t,MT,PT,vn,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,applyToClusters:9,minzoom:10,maxzoom:11,hoverCursor:12,manageHoverState:13,hovered:0,eventsIfTopMost:14,interactive:15})}}function kT(e){let t;const n=e[15].default,r=Ws(n,e,e[23],null);return{c(){r&&r.c()},m(s,l){r&&r.m(s,l),t=!0},p(s,l){r&&r.p&&(!t||l&8388608)&&Hs(r,n,s,s[23],t?Zs(n,s[23],l,null):Xs(s[23]),null)},i(s){t||(ee(r,s),t=!0)},o(s){le(r,s),t=!1},d(s){r&&r.d(s)}}}function DT(e){let t,n,r;function s(p){e[16](p)}let l={id:e[1],type:"fill",source:e[2],sourceLayer:e[3],beforeId:e[4],beforeLayerType:e[5],paint:e[6],layout:e[7],filter:e[8],minzoom:e[9],maxzoom:e[10],hoverCursor:e[11],manageHoverState:e[12],eventsIfTopMost:e[13],interactive:e[14],$$slots:{default:[kT]},$$scope:{ctx:e}};return e[0]!==void 0&&(l.hovered=e[0]),t=new t0({props:l}),Di.push(()=>Jo(t,"hovered",s)),t.$on("click",e[17]),t.$on("dblclick",e[18]),t.$on("contextmenu",e[19]),t.$on("mouseenter",e[20]),t.$on("mousemove",e[21]),t.$on("mouseleave",e[22]),{c(){nn(t.$$.fragment)},m(p,c){$e(t,p,c),r=!0},p(p,[c]){const y={};c&2&&(y.id=p[1]),c&4&&(y.source=p[2]),c&8&&(y.sourceLayer=p[3]),c&16&&(y.beforeId=p[4]),c&32&&(y.beforeLayerType=p[5]),c&64&&(y.paint=p[6]),c&128&&(y.layout=p[7]),c&256&&(y.filter=p[8]),c&512&&(y.minzoom=p[9]),c&1024&&(y.maxzoom=p[10]),c&2048&&(y.hoverCursor=p[11]),c&4096&&(y.manageHoverState=p[12]),c&8192&&(y.eventsIfTopMost=p[13]),c&16384&&(y.interactive=p[14]),c&8388608&&(y.$$scope={dirty:c,ctx:p}),!n&&c&1&&(n=!0,y.hovered=p[0],Ko(()=>n=!1)),t.$set(y)},i(p){r||(ee(t.$$.fragment,p),r=!0)},o(p){le(t.$$.fragment,p),r=!1},d(p){tn(t,p)}}}function RT(e,t,n){let{$$slots:r={},$$scope:s}=t,{id:l=Md("fill")}=t,{source:p=void 0}=t,{sourceLayer:c=void 0}=t,{beforeId:y=void 0}=t,{beforeLayerType:w=void 0}=t,{paint:T}=t,{layout:L=void 0}=t,{filter:A=void 0}=t,{minzoom:z=void 0}=t,{maxzoom:B=void 0}=t,{hoverCursor:Y=void 0}=t,{manageHoverState:et=!1}=t,{hovered:at=null}=t,{eventsIfTopMost:W=!1}=t,{interactive:H=!0}=t;function nt(dt){at=dt,n(0,at)}function ut(dt){ni.call(this,e,dt)}function _t(dt){ni.call(this,e,dt)}function ct(dt){ni.call(this,e,dt)}function bt(dt){ni.call(this,e,dt)}function It(dt){ni.call(this,e,dt)}function Ot(dt){ni.call(this,e,dt)}return e.$$set=dt=>{"id"in dt&&n(1,l=dt.id),"source"in dt&&n(2,p=dt.source),"sourceLayer"in dt&&n(3,c=dt.sourceLayer),"beforeId"in dt&&n(4,y=dt.beforeId),"beforeLayerType"in dt&&n(5,w=dt.beforeLayerType),"paint"in dt&&n(6,T=dt.paint),"layout"in dt&&n(7,L=dt.layout),"filter"in dt&&n(8,A=dt.filter),"minzoom"in dt&&n(9,z=dt.minzoom),"maxzoom"in dt&&n(10,B=dt.maxzoom),"hoverCursor"in dt&&n(11,Y=dt.hoverCursor),"manageHoverState"in dt&&n(12,et=dt.manageHoverState),"hovered"in dt&&n(0,at=dt.hovered),"eventsIfTopMost"in dt&&n(13,W=dt.eventsIfTopMost),"interactive"in dt&&n(14,H=dt.interactive),"$$scope"in dt&&n(23,s=dt.$$scope)},[at,l,p,c,y,w,T,L,A,z,B,Y,et,W,H,r,nt,ut,_t,ct,bt,It,Ot,s]}class Dd extends Pn{constructor(t){super(),Ln(this,t,RT,DT,vn,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}}function NT(e,t,n){let r;const{map:s}=Ad();Zn(e,s,y=>n(4,r=y));let{position:l="top-left"}=t,{container:p=void 0}=t,c=null;return Ul(()=>{r!=null&&r.loaded()&&c&&r.removeControl(c)}),e.$$set=y=>{"position"in y&&n(1,l=y.position),"container"in y&&n(2,p=y.container)},e.$$.update=()=>{if(e.$$.dirty&30&&r&&!c){let y;typeof p=="string"?y=document.querySelector(p)??void 0:y=p,n(3,c=new Ep.FullscreenControl({container:y})),r.addControl(c,l)}},[s,l,p,c,r]}class OT extends Pn{constructor(t){super(),Ln(this,t,NT,null,vn,{position:1,container:2})}}function zT(e,t,n,r,s){let l=!1;e.getSource(t)&&(l=!0,e.removeSource(t));const p=()=>{r(t)&&(e.addSource(t,n),s())};if(l){const c=()=>{t&&(e.getSource(t)?setTimeout(c,1):p())};c()}else p()}function FT(e,t,n){cT().then(()=>{let r=_2(e);if(!r)return;r.getSource(t)===n&&r.removeSource(t)})}function Pb(e){let t=e[0],n,r,s=Mb(e);return{c(){s.c(),n=ll()},m(l,p){s.m(l,p),de(l,n,p),r=!0},p(l,p){p&1&&vn(t,t=l[0])?(Wo(),le(s,1,1,Oe),Zo(),s=Mb(l),s.c(),ee(s,1),s.m(n.parentNode,n)):s.p(l,p)},i(l){r||(ee(s),r=!0)},o(l){le(s),r=!1},d(l){l&&fe(n),s.d(l)}}}function Mb(e){let t;const n=e[15].default,r=Ws(n,e,e[14],null);return{c(){r&&r.c()},m(s,l){r&&r.m(s,l),t=!0},p(s,l){r&&r.p&&(!t||l&16384)&&Hs(r,n,s,s[14],t?Zs(n,s[14],l,null):Xs(s[14]),null)},i(s){t||(ee(r,s),t=!0)},o(s){le(r,s),t=!1},d(s){r&&r.d(s)}}}function BT(e){let t,n,r=e[0]&&Pb(e);return{c(){r&&r.c(),t=ll()},m(s,l){r&&r.m(s,l),de(s,t,l),n=!0},p(s,[l]){s[0]?r?(r.p(s,l),l&1&&ee(r,1)):(r=Pb(s),r.c(),ee(r,1),r.m(t.parentNode,t)):r&&(Wo(),le(r,1,1,()=>{r=null}),Zo())},i(s){n||(ee(r),n=!0)},o(s){le(r),n=!1},d(s){s&&fe(t),r&&r.d(s)}}}function VT(e,t,n){let r,s,l,{$$slots:p={},$$scope:c}=t,{id:y=Md("geojson")}=t,{data:w}=t,{generateId:T=!1}=t,{promoteId:L=void 0}=t,{filter:A=void 0}=t,{lineMetrics:z=void 0}=t,{cluster:B=void 0}=t;const{map:Y,cluster:et,self:at}=bT();Zn(e,Y,nt=>n(13,s=nt)),Zn(e,et,nt=>n(16,l=nt)),Zn(e,at,nt=>n(0,r=nt));let W,H=!0;return Ul(()=>{r&&W&&s&&(FT(Y,r,W),Nl(at,r=null,r),n(11,W=void 0))}),e.$$set=nt=>{"id"in nt&&n(4,y=nt.id),"data"in nt&&n(5,w=nt.data),"generateId"in nt&&n(6,T=nt.generateId),"promoteId"in nt&&n(7,L=nt.promoteId),"filter"in nt&&n(8,A=nt.filter),"lineMetrics"in nt&&n(9,z=nt.lineMetrics),"cluster"in nt&&n(10,B=nt.cluster),"$$scope"in nt&&n(14,c=nt.$$scope)},e.$$.update=()=>{e.$$.dirty&1024&&Nl(et,l=B,l),e.$$.dirty&12273&&s&&r!==y&&(Nl(at,r=y,r),zT(s,r,Im({type:"geojson",data:w,filter:A,lineMetrics:z,generateId:T,promoteId:L,cluster:!!B,clusterMinPoints:B==null?void 0:B.minPoints,clusterMaxZoom:B==null?void 0:B.maxZoom,clusterRadius:B==null?void 0:B.radius,clusterProperties:B==null?void 0:B.properties}),nt=>s&&nt===r,()=>{r&&(n(11,W=s==null?void 0:s.getSource(r)),n(12,H=!0))})),e.$$.dirty&8208&&(s==null||s.on("style.load",()=>{n(11,W=s==null?void 0:s.getSource(y))})),e.$$.dirty&6176&&W&&(H?n(12,H=!1):W.setData(w)),e.$$.dirty&3072&&(W==null||W.setClusterOptions(Im({cluster:!!B,clusterMaxZoom:B==null?void 0:B.maxZoom,clusterRadius:B==null?void 0:B.radius})))},[r,Y,et,at,y,w,T,L,A,z,B,W,H,s,c,p]}class Ip extends Pn{constructor(t){super(),Ln(this,t,VT,BT,vn,{id:4,data:5,generateId:6,promoteId:7,filter:8,lineMetrics:9,cluster:10})}}function UT(e,t,n){let r;const{map:s}=Ad();Zn(e,s,A=>n(8,r=A));let{position:l="top-left"}=t,{positionOptions:p=void 0}=t,{fitBoundsOptions:c=void 0}=t,{trackUserLocation:y=!1}=t,{showAccuracyCircle:w=!0}=t,{showUserLocation:T=!0}=t,L=null;return Ul(()=>{r!=null&&r.loaded()&&L&&r.removeControl(L)}),e.$$set=A=>{"position"in A&&n(1,l=A.position),"positionOptions"in A&&n(2,p=A.positionOptions),"fitBoundsOptions"in A&&n(3,c=A.fitBoundsOptions),"trackUserLocation"in A&&n(4,y=A.trackUserLocation),"showAccuracyCircle"in A&&n(5,w=A.showAccuracyCircle),"showUserLocation"in A&&n(6,T=A.showUserLocation)},e.$$.update=()=>{e.$$.dirty&510&&r&&!L&&(n(7,L=new Ep.GeolocateControl({positionOptions:p,fitBoundsOptions:c,trackUserLocation:y,showAccuracyCircle:w,showUserLocation:T})),r.addControl(L,l))},[s,l,p,c,y,w,T,L,r]}class GT extends Pn{constructor(t){super(),Ln(this,t,UT,null,vn,{position:1,positionOptions:2,fitBoundsOptions:3,trackUserLocation:4,showAccuracyCircle:5,showUserLocation:6})}}function jT(e){let t;const n=e[15].default,r=Ws(n,e,e[23],null);return{c(){r&&r.c()},m(s,l){r&&r.m(s,l),t=!0},p(s,l){r&&r.p&&(!t||l&8388608)&&Hs(r,n,s,s[23],t?Zs(n,s[23],l,null):Xs(s[23]),null)},i(s){t||(ee(r,s),t=!0)},o(s){le(r,s),t=!1},d(s){r&&r.d(s)}}}function qT(e){let t,n,r;function s(p){e[16](p)}let l={id:e[1],type:"line",source:e[2],sourceLayer:e[3],beforeId:e[4],beforeLayerType:e[5],paint:e[6],layout:e[7],filter:e[8],minzoom:e[9],maxzoom:e[10],hoverCursor:e[11],manageHoverState:e[12],eventsIfTopMost:e[13],interactive:e[14],$$slots:{default:[jT]},$$scope:{ctx:e}};return e[0]!==void 0&&(l.hovered=e[0]),t=new t0({props:l}),Di.push(()=>Jo(t,"hovered",s)),t.$on("click",e[17]),t.$on("dblclick",e[18]),t.$on("contextmenu",e[19]),t.$on("mouseenter",e[20]),t.$on("mousemove",e[21]),t.$on("mouseleave",e[22]),{c(){nn(t.$$.fragment)},m(p,c){$e(t,p,c),r=!0},p(p,[c]){const y={};c&2&&(y.id=p[1]),c&4&&(y.source=p[2]),c&8&&(y.sourceLayer=p[3]),c&16&&(y.beforeId=p[4]),c&32&&(y.beforeLayerType=p[5]),c&64&&(y.paint=p[6]),c&128&&(y.layout=p[7]),c&256&&(y.filter=p[8]),c&512&&(y.minzoom=p[9]),c&1024&&(y.maxzoom=p[10]),c&2048&&(y.hoverCursor=p[11]),c&4096&&(y.manageHoverState=p[12]),c&8192&&(y.eventsIfTopMost=p[13]),c&16384&&(y.interactive=p[14]),c&8388608&&(y.$$scope={dirty:c,ctx:p}),!n&&c&1&&(n=!0,y.hovered=p[0],Ko(()=>n=!1)),t.$set(y)},i(p){r||(ee(t.$$.fragment,p),r=!0)},o(p){le(t.$$.fragment,p),r=!1},d(p){tn(t,p)}}}function WT(e,t,n){let{$$slots:r={},$$scope:s}=t,{id:l=Md("line")}=t,{source:p=void 0}=t,{sourceLayer:c=void 0}=t,{beforeId:y=void 0}=t,{beforeLayerType:w=void 0}=t,{paint:T}=t,{layout:L=void 0}=t,{filter:A=void 0}=t,{minzoom:z=void 0}=t,{maxzoom:B=void 0}=t,{hoverCursor:Y=void 0}=t,{manageHoverState:et=!1}=t,{hovered:at=null}=t,{eventsIfTopMost:W=!1}=t,{interactive:H=!0}=t;function nt(dt){at=dt,n(0,at)}function ut(dt){ni.call(this,e,dt)}function _t(dt){ni.call(this,e,dt)}function ct(dt){ni.call(this,e,dt)}function bt(dt){ni.call(this,e,dt)}function It(dt){ni.call(this,e,dt)}function Ot(dt){ni.call(this,e,dt)}return e.$$set=dt=>{"id"in dt&&n(1,l=dt.id),"source"in dt&&n(2,p=dt.source),"sourceLayer"in dt&&n(3,c=dt.sourceLayer),"beforeId"in dt&&n(4,y=dt.beforeId),"beforeLayerType"in dt&&n(5,w=dt.beforeLayerType),"paint"in dt&&n(6,T=dt.paint),"layout"in dt&&n(7,L=dt.layout),"filter"in dt&&n(8,A=dt.filter),"minzoom"in dt&&n(9,z=dt.minzoom),"maxzoom"in dt&&n(10,B=dt.maxzoom),"hoverCursor"in dt&&n(11,Y=dt.hoverCursor),"manageHoverState"in dt&&n(12,et=dt.manageHoverState),"hovered"in dt&&n(0,at=dt.hovered),"eventsIfTopMost"in dt&&n(13,W=dt.eventsIfTopMost),"interactive"in dt&&n(14,H=dt.interactive),"$$scope"in dt&&n(23,s=dt.$$scope)},[at,l,p,c,y,w,T,L,A,z,B,Y,et,W,H,r,nt,ut,_t,ct,bt,It,Ot,s]}class P2 extends Pn{constructor(t){super(),Ln(this,t,WT,qT,vn,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}}function ZT(e){let t=e.getCenter(),n=Math.round(e.getZoom()*100)/100,r=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),s=Math.pow(10,r),l=Math.round(t.lat*s)/s,p=Math.round(t.lng*s)/s,c=`${n}/${l}/${p}`,y=e.getBearing(),w=e.getPitch();return(y||w)&&(c+=`/${Math.round(y*10)/10}`),w&&(c+=`/${Math.round(w)}`),`#${c}`}function HT(e){return e.replace("#","").split("/").map(parseFloat)}var $g=e0;function e0(e,t){return e===t||e!==e&&t!==t?!0:typeof e!=typeof t||{}.toString.call(e)!={}.toString.call(t)||e!==Object(e)||!e?!1:Array.isArray(e)?Ab(e,t):{}.toString.call(e)=="[object Set]"?Ab(Array.from(e),Array.from(t)):{}.toString.call(e)=="[object Object]"?YT(e,t):XT(e,t)}function XT(e,t){return e.toString()===t.toString()}function Ab(e,t){var n=e.length;if(n!=t.length)return!1;for(var r=0;rn(6,r=T));let{position:l="top-left"}=t,{showCompass:p=!0}=t,{showZoom:c=!0}=t,{visualizePitch:y=!1}=t,w=null;return Ul(()=>{r!=null&&r.loaded()&&w&&r.removeControl(w)}),e.$$set=T=>{"position"in T&&n(1,l=T.position),"showCompass"in T&&n(2,p=T.showCompass),"showZoom"in T&&n(3,c=T.showZoom),"visualizePitch"in T&&n(4,y=T.visualizePitch)},e.$$.update=()=>{e.$$.dirty&126&&r&&!w&&(n(5,w=new Ep.NavigationControl({showCompass:p,showZoom:c,visualizePitch:y})),r.addControl(w,l))},[s,l,p,c,y,w,r]}class M2 extends Pn{constructor(t){super(),Ln(this,t,KT,null,vn,{position:1,showCompass:2,showZoom:3,visualizePitch:4})}}function JT(e,t,n){let r;const{map:s}=Ad();Zn(e,s,w=>n(5,r=w));let{position:l="bottom-left"}=t,{maxWidth:p=void 0}=t,{unit:c="metric"}=t,y=null;return Ul(()=>{r!=null&&r.loaded()&&y&&r.removeControl(y)}),e.$$set=w=>{"position"in w&&n(1,l=w.position),"maxWidth"in w&&n(2,p=w.maxWidth),"unit"in w&&n(3,c=w.unit)},e.$$.update=()=>{e.$$.dirty&62&&r&&!y&&(n(4,y=new Ep.ScaleControl({maxWidth:p,unit:c})),r.addControl(y,l))},[s,l,p,c,y,r]}class A2 extends Pn{constructor(t){super(),Ln(this,t,JT,null,vn,{position:1,maxWidth:2,unit:3})}}const{window:QT}=Jv,$T=e=>({map:e[0]&8,loadedImages:e[0]&16,allImagesLoaded:e[0]&32}),kb=e=>({map:e[3],loadedImages:e[4],allImagesLoaded:e[5]});function Db(e){let t,n,r=e[2]&&Rb(e);const s=e[38].default,l=Ws(s,e,e[37],kb);return{c(){r&&r.c(),t=Ve(),l&&l.c()},m(p,c){r&&r.m(p,c),de(p,t,c),l&&l.m(p,c),n=!0},p(p,c){p[2]?r?(r.p(p,c),c[0]&4&&ee(r,1)):(r=Rb(p),r.c(),ee(r,1),r.m(t.parentNode,t)):r&&(Wo(),le(r,1,1,()=>{r=null}),Zo()),l&&l.p&&(!n||c[0]&56|c[1]&64)&&Hs(l,s,p,p[37],n?Zs(s,p[37],c,$T):Xs(p[37]),kb)},i(p){n||(ee(r),ee(l,p),n=!0)},o(p){le(r),le(l,p),n=!1},d(p){p&&fe(t),r&&r.d(p),l&&l.d(p)}}}function Rb(e){let t,n,r,s,l,p,c,y;return t=new M2({props:{position:e[6]}}),r=new GT({props:{position:e[6],fitBoundsOptions:{maxZoom:12}}}),l=new OT({props:{position:e[6]}}),c=new A2({props:{position:e[6]}}),{c(){nn(t.$$.fragment),n=Ve(),nn(r.$$.fragment),s=Ve(),nn(l.$$.fragment),p=Ve(),nn(c.$$.fragment)},m(w,T){$e(t,w,T),de(w,n,T),$e(r,w,T),de(w,s,T),$e(l,w,T),de(w,p,T),$e(c,w,T),y=!0},p(w,T){const L={};T[0]&64&&(L.position=w[6]),t.$set(L);const A={};T[0]&64&&(A.position=w[6]),r.$set(A);const z={};T[0]&64&&(z.position=w[6]),l.$set(z);const B={};T[0]&64&&(B.position=w[6]),c.$set(B)},i(w){y||(ee(t.$$.fragment,w),ee(r.$$.fragment,w),ee(l.$$.fragment,w),ee(c.$$.fragment,w),y=!0)},o(w){le(t.$$.fragment,w),le(r.$$.fragment,w),le(l.$$.fragment,w),le(c.$$.fragment,w),y=!1},d(w){w&&(fe(n),fe(s),fe(p)),tn(t,w),tn(r,w),tn(l,w),tn(c,w)}}}function tL(e){let t,n,r,s,l,p=e[3]&&e[0]&&Db(e);return{c(){t=ae("div"),p&&p.c(),zt(t,"class",n=wm(e[1])+" svelte-p00lfq"),zt(t,"data-testid","map-container"),Qa(t,"expand-map",!e[1])},m(c,y){de(c,t,y),p&&p.m(t,null),r=!0,s||(l=[an(QT,"hashchange",e[10]),rT(e[9].call(null,t))],s=!0)},p(c,y){c[3]&&c[0]?p?(p.p(c,y),y[0]&9&&ee(p,1)):(p=Db(c),p.c(),ee(p,1),p.m(t,null)):p&&(Wo(),le(p,1,1,()=>{p=null}),Zo()),(!r||y[0]&2&&n!==(n=wm(c[1])+" svelte-p00lfq"))&&zt(t,"class",n),(!r||y[0]&2)&&Qa(t,"expand-map",!c[1])},i(c){r||(ee(p),r=!0)},o(c){le(p),r=!1},d(c){c&&fe(t),p&&p.d(),s=!1,Fi(l)}}}function eL(e,t,n){let r,s,l,p,{$$slots:c={},$$scope:y}=t,{map:w=null}=t,{class:T=void 0}=t,{style:L}=t,{diffStyleUpdates:A=!1}=t,{center:z=void 0}=t,{zoom:B=void 0}=t,{pitch:Y=0}=t,{bearing:et=0}=t,{bounds:at=void 0}=t,{hash:W=!1}=t,{loaded:H=!1}=t,{minZoom:nt=0}=t,{maxZoom:ut=22}=t,{antialias:_t=void 0}=t,{zoomOnDoubleClick:ct=!0}=t,{locale:bt=void 0}=t,{interactive:It=!0}=t,{attributionControl:Ot=!0}=t,{cooperativeGestures:dt=!1}=t,{preserveDrawingBuffer:Pt=!1}=t,{maxBounds:Qt=void 0}=t,{images:Et=[]}=t,{standardControls:oe=!1}=t,{filterLayers:ge=void 0}=t,{transformRequest:Te=void 0}=t;const Fe=Ld(),{map:rn,loadedImages:En}=vT();Zn(e,rn,Zt=>n(3,l=Zt)),Zn(e,En,Zt=>n(4,p=Zt));let Me=new Set;async function Pe(Zt,on=!1){if(l&&!(!l.loaded()&&!on))if("url"in Zt){Me.add(Zt.id);try{let cn=await l.loadImage(Zt.url);l==null||l.addImage(Zt.id,cn.data,Zt.options),p.add(Zt.id),En.set(p)}catch(cn){Fe("error",cn)}finally{Me.delete(Zt.id)}}else l.addImage(Zt.id,Zt.data,Zt.options),p.add(Zt.id),En.set(p)}let Mn,pr,zn,jn;function Cr(Zt){return Bi(),Nl(rn,l=new Ep.Map(Im({container:Zt,style:L,locale:bt,center:z,zoom:B,pitch:Y,bearing:et,minZoom:nt,maxZoom:ut,antialias:_t,interactive:It,preserveDrawingBuffer:Pt,maxBounds:Qt,bounds:at,attributionControl:Ot,transformRequest:Te,cooperativeGestures:dt})),l),l.on("load",on=>{on.target.getContainer().setAttribute("data-testid","map"),on.target.getCanvas().setAttribute("data-testid","map-canvas"),n(0,H=!0),Fe("load",l)}),l.on("error",on=>Fe("error",{...on,map:l})),l.on("movestart",on=>Fe("movestart",{...on,map:l})),l.on("moveend",on=>{if(n(11,z=on.target.getCenter()),n(12,B=on.target.getZoom()),n(13,at=on.target.getBounds()),Fe("moveend",{...on,map:l}),W){let cn=window.location.href.replace(/(#.+)?$/,ZT(l));window.history.replaceState(window.history.state,"",cn)}}),l.on("zoomstart",on=>Fe("zoomstart",{...on,map:l})),l.on("zoom",on=>{n(12,B=on.target.getZoom()),Fe("zoom",{...on,map:l})}),l.on("zoomend",on=>{n(12,B=on.target.getZoom()),Fe("zoomend",{...on,map:l})}),l.on("style.load",()=>{if(l){const on=l.getStyle();if(n(34,Mn=on.layers.map(cn=>cn.id)),n(35,pr=Object.keys(on.sources)),jn)for(const[cn,Vt]of Object.entries(jn))l.addSource(cn,Vt);if(zn)for(const cn of zn)l.addLayer(cn);for(const cn of Et)Pe(cn,!0)}}),l.on("styledata",on=>{if(l&&ge){const cn=l.getStyle().layers;if(cn)for(let Vt of cn)ge(Vt)||l.setLayoutProperty(Vt.id,"visibility","none")}Fe("styledata",{...on,map:l})}),{destroy(){n(0,H=!1),l==null||l.remove(),Nl(rn,l=null,l)}}}let qr=L;function Bi(){if(W){let Zt=HT(window.location.hash);Zt.length>=3&&(n(12,B=Zt[0]),n(11,z=[Zt[2],Zt[1]])),Zt.length==5&&(n(16,et=Zt[3]),n(15,Y=Zt[4]))}}return e.$$set=Zt=>{"map"in Zt&&n(14,w=Zt.map),"class"in Zt&&n(1,T=Zt.class),"style"in Zt&&n(17,L=Zt.style),"diffStyleUpdates"in Zt&&n(18,A=Zt.diffStyleUpdates),"center"in Zt&&n(11,z=Zt.center),"zoom"in Zt&&n(12,B=Zt.zoom),"pitch"in Zt&&n(15,Y=Zt.pitch),"bearing"in Zt&&n(16,et=Zt.bearing),"bounds"in Zt&&n(13,at=Zt.bounds),"hash"in Zt&&n(19,W=Zt.hash),"loaded"in Zt&&n(0,H=Zt.loaded),"minZoom"in Zt&&n(20,nt=Zt.minZoom),"maxZoom"in Zt&&n(21,ut=Zt.maxZoom),"antialias"in Zt&&n(22,_t=Zt.antialias),"zoomOnDoubleClick"in Zt&&n(23,ct=Zt.zoomOnDoubleClick),"locale"in Zt&&n(24,bt=Zt.locale),"interactive"in Zt&&n(25,It=Zt.interactive),"attributionControl"in Zt&&n(26,Ot=Zt.attributionControl),"cooperativeGestures"in Zt&&n(27,dt=Zt.cooperativeGestures),"preserveDrawingBuffer"in Zt&&n(28,Pt=Zt.preserveDrawingBuffer),"maxBounds"in Zt&&n(29,Qt=Zt.maxBounds),"images"in Zt&&n(30,Et=Zt.images),"standardControls"in Zt&&n(2,oe=Zt.standardControls),"filterLayers"in Zt&&n(31,ge=Zt.filterLayers),"transformRequest"in Zt&&n(32,Te=Zt.transformRequest),"$$scope"in Zt&&n(37,y=Zt.$$scope)},e.$$.update=()=>{if(e.$$.dirty[0]&4&&n(6,r=typeof oe=="boolean"?void 0:oe),e.$$.dirty[0]&8&&n(14,w=l),e.$$.dirty[0]&393224|e.$$.dirty[1]&56&&l&&!$g(L,qr)){const Zt=l.getStyle();if(Mn&&(zn=Zt.layers.filter(on=>!Mn.includes(on.id))),pr){const on=Object.keys(Zt.sources).filter(cn=>!pr.includes(cn));jn={};for(const cn of on)jn[cn]=Zt.sources[cn]}n(36,qr=L),l.setStyle(L,{diff:A}),Nl(En,p=new Set,p),n(33,Me=new Set)}if(e.$$.dirty[0]&1073741849|e.$$.dirty[1]&4&&H&&l!=null&&l.loaded())for(let Zt of Et)!p.has(Zt.id)&&!Me.has(Zt.id)&&!l.hasImage(Zt.id)&&Pe(Zt);e.$$.dirty[0]&1073741840&&n(5,s=Et.every(Zt=>p.has(Zt.id))),e.$$.dirty[0]&2056&&z&&!$g(z,l==null?void 0:l.getCenter())&&(l==null||l.panTo(z)),e.$$.dirty[0]&4104&&B&&!$g(B,l==null?void 0:l.getZoom())&&(l==null||l.zoomTo(B)),e.$$.dirty[0]&8200&&at&&!$g(at,l==null?void 0:l.getBounds())&&(l==null||l.fitBounds(at)),e.$$.dirty[0]&8388616&&(ct?l==null||l.doubleClickZoom.enable():l==null||l.doubleClickZoom.disable())},[H,T,oe,l,p,s,r,rn,En,Cr,Bi,z,B,at,w,Y,et,L,A,W,nt,ut,_t,ct,bt,It,Ot,dt,Pt,Qt,Et,ge,Te,Me,Mn,pr,qr,y,c]}class nL extends Pn{constructor(t){super(),Ln(this,t,eL,tL,vn,{map:14,class:1,style:17,diffStyleUpdates:18,center:11,zoom:12,pitch:15,bearing:16,bounds:13,hash:19,loaded:0,minZoom:20,maxZoom:21,antialias:22,zoomOnDoubleClick:23,locale:24,interactive:25,attributionControl:26,cooperativeGestures:27,preserveDrawingBuffer:28,maxBounds:29,images:30,standardControls:2,filterLayers:31,transformRequest:32},null,[-1,-1])}}var Rd=Uint8Array,k2=Uint16Array,rL=Int32Array,iL=new Rd([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),oL=new Rd([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),D2=function(e,t){for(var n=new k2(31),r=0;r<31;++r)n[r]=t+=1<>1|(Gn&21845)<<1,Pl=(Pl&52428)>>2|(Pl&13107)<<2,Pl=(Pl&61680)>>4|(Pl&3855)<<4,lL[Gn]=((Pl&65280)>>8|(Pl&255)<<8)>>1;var Pl,Gn,ry=new Rd(288);for(Gn=0;Gn<144;++Gn)ry[Gn]=8;var Gn;for(Gn=144;Gn<256;++Gn)ry[Gn]=9;var Gn;for(Gn=256;Gn<280;++Gn)ry[Gn]=7;var Gn;for(Gn=280;Gn<288;++Gn)ry[Gn]=8;var Gn,uL=new Rd(32);for(Gn=0;Gn<32;++Gn)uL[Gn]=5;var Gn,cL=new Rd(0),hL=typeof TextDecoder<"u"&&new TextDecoder,pL=0;try{hL.decode(cL,{stream:!0}),pL=1}catch{}let Yt;const N2=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&N2.decode();let qf=null;function Qf(){return(qf===null||qf.byteLength===0)&&(qf=new Uint8Array(Yt.memory.buffer)),qf}function ei(e,t){return e=e>>>0,N2.decode(Qf().subarray(e,e+t))}const kl=new Array(128).fill(void 0);kl.push(void 0,null,!0,!1);let $f=kl.length;function _i(e){$f===kl.length&&kl.push(kl.length+1);const t=$f;return $f=kl[t],kl[t]=e,t}function Nn(e){return kl[e]}function fL(e){e<132||(kl[e]=$f,$f=e)}function fc(e){const t=Nn(e);return fL(e),t}let zl=0;const hm=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},dL=typeof hm.encodeInto=="function"?function(e,t){return hm.encodeInto(e,t)}:function(e,t){const n=hm.encode(e);return t.set(n),{read:e.length,written:n.length}};function td(e,t,n){if(n===void 0){const c=hm.encode(e),y=t(c.length,1)>>>0;return Qf().subarray(y,y+c.length).set(c),zl=c.length,y}let r=e.length,s=t(r,1)>>>0;const l=Qf();let p=0;for(;p127)break;l[s+p]=c}if(p!==r){p!==0&&(e=e.slice(p)),s=n(s,r,r=p+e.length*3,1)>>>0;const c=Qf().subarray(s+p,s+r),y=dL(e,c);p+=y.written}return zl=p,s}function A_(e){return e==null}let Wf=null;function qe(){return(Wf===null||Wf.byteLength===0)&&(Wf=new Int32Array(Yt.memory.buffer)),Wf}let Zf=null;function gL(){return(Zf===null||Zf.byteLength===0)&&(Zf=new Float64Array(Yt.memory.buffer)),Zf}function lv(e){const t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){const s=e.description;return s==null?"Symbol":`Symbol(${s})`}if(t=="function"){const s=e.name;return typeof s=="string"&&s.length>0?`Function(${s})`:"Function"}if(Array.isArray(e)){const s=e.length;let l="[";s>0&&(l+=lv(e[0]));for(let p=1;p1)r=n[1];else return toString.call(e);if(r=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message} ${e.stack}`:r}function mL(e,t){const n=t(e.length*1,1)>>>0;return Qf().set(e,n/1),zl=e.length,n}let Hf=null;function yL(){return(Hf===null||Hf.byteLength===0)&&(Hf=new Uint32Array(Yt.memory.buffer)),Hf}function _L(e,t){e=e>>>0;const r=yL().subarray(e/4,e/4+t),s=[];for(let l=0;l>>0;const n=Object.create(n0.prototype);return n.__wbg_ptr=t,n}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();Yt.__wbg_jsdebugstreets_free(t)}getLabel(){let t,n;try{const l=Yt.__wbindgen_add_to_stack_pointer(-16);Yt.jsdebugstreets_getLabel(l,this.__wbg_ptr);var r=qe()[l/4+0],s=qe()[l/4+1];return t=r,n=s,ei(r,s)}finally{Yt.__wbindgen_add_to_stack_pointer(16),Yt.__wbindgen_free(t,n,1)}}getNetwork(){const t=Yt.jsdebugstreets_getNetwork(this.__wbg_ptr);return fc(t)}toDebugGeojson(){try{const r=Yt.__wbindgen_add_to_stack_pointer(-16);Yt.jsdebugstreets_toDebugGeojson(r,this.__wbg_ptr);var t=qe()[r/4+0],n=qe()[r/4+1];let s;return t!==0&&(s=ei(t,n).slice(),Yt.__wbindgen_free(t,n*1,1)),s}finally{Yt.__wbindgen_add_to_stack_pointer(16)}}}class iy{static __wrap(t){t=t>>>0;const n=Object.create(iy.prototype);return n.__wbg_ptr=t,n}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();Yt.__wbg_jsstreetnetwork_free(t)}constructor(t,n,r){try{const c=Yt.__wbindgen_add_to_stack_pointer(-16),y=mL(t,Yt.__wbindgen_malloc),w=zl,T=td(n,Yt.__wbindgen_malloc,Yt.__wbindgen_realloc),L=zl;Yt.jsstreetnetwork_new(c,y,w,T,L,_i(r));var s=qe()[c/4+0],l=qe()[c/4+1],p=qe()[c/4+2];if(p)throw fc(l);return this.__wbg_ptr=s>>>0,this}finally{Yt.__wbindgen_add_to_stack_pointer(16)}}toGeojsonPlain(){let t,n;try{const l=Yt.__wbindgen_add_to_stack_pointer(-16);Yt.jsstreetnetwork_toGeojsonPlain(l,this.__wbg_ptr);var r=qe()[l/4+0],s=qe()[l/4+1];return t=r,n=s,ei(r,s)}finally{Yt.__wbindgen_add_to_stack_pointer(16),Yt.__wbindgen_free(t,n,1)}}toLanePolygonsGeojson(){let t,n;try{const l=Yt.__wbindgen_add_to_stack_pointer(-16);Yt.jsstreetnetwork_toLanePolygonsGeojson(l,this.__wbg_ptr);var r=qe()[l/4+0],s=qe()[l/4+1];return t=r,n=s,ei(r,s)}finally{Yt.__wbindgen_add_to_stack_pointer(16),Yt.__wbindgen_free(t,n,1)}}toLaneMarkingsGeojson(){let t,n;try{const l=Yt.__wbindgen_add_to_stack_pointer(-16);Yt.jsstreetnetwork_toLaneMarkingsGeojson(l,this.__wbg_ptr);var r=qe()[l/4+0],s=qe()[l/4+1];return t=r,n=s,ei(r,s)}finally{Yt.__wbindgen_add_to_stack_pointer(16),Yt.__wbindgen_free(t,n,1)}}toIntersectionMarkingsGeojson(){let t,n;try{const l=Yt.__wbindgen_add_to_stack_pointer(-16);Yt.jsstreetnetwork_toIntersectionMarkingsGeojson(l,this.__wbg_ptr);var r=qe()[l/4+0],s=qe()[l/4+1];return t=r,n=s,ei(r,s)}finally{Yt.__wbindgen_add_to_stack_pointer(16),Yt.__wbindgen_free(t,n,1)}}getDebugSteps(){try{const s=Yt.__wbindgen_add_to_stack_pointer(-16);Yt.jsstreetnetwork_getDebugSteps(s,this.__wbg_ptr);var t=qe()[s/4+0],n=qe()[s/4+1],r=_L(t,n).slice();return Yt.__wbindgen_free(t,n*4,4),r}finally{Yt.__wbindgen_add_to_stack_pointer(16)}}debugClockwiseOrderingGeojson(){let t,n;try{const l=Yt.__wbindgen_add_to_stack_pointer(-16);Yt.jsstreetnetwork_debugClockwiseOrderingGeojson(l,this.__wbg_ptr);var r=qe()[l/4+0],s=qe()[l/4+1];return t=r,n=s,ei(r,s)}finally{Yt.__wbindgen_add_to_stack_pointer(16),Yt.__wbindgen_free(t,n,1)}}debugClockwiseOrderingForIntersectionGeojson(t){let n,r;try{const p=Yt.__wbindgen_add_to_stack_pointer(-16);Yt.jsstreetnetwork_debugClockwiseOrderingForIntersectionGeojson(p,this.__wbg_ptr,t);var s=qe()[p/4+0],l=qe()[p/4+1];return n=s,r=l,ei(s,l)}finally{Yt.__wbindgen_add_to_stack_pointer(16),Yt.__wbindgen_free(n,r,1)}}debugMovementsFromLaneGeojson(t,n){let r,s;try{const c=Yt.__wbindgen_add_to_stack_pointer(-16);Yt.jsstreetnetwork_debugMovementsFromLaneGeojson(c,this.__wbg_ptr,t,n);var l=qe()[c/4+0],p=qe()[c/4+1];return r=l,s=p,ei(l,p)}finally{Yt.__wbindgen_add_to_stack_pointer(16),Yt.__wbindgen_free(r,s,1)}}debugRoadsConnectedToIntersectionGeojson(t){let n,r;try{const p=Yt.__wbindgen_add_to_stack_pointer(-16);Yt.jsstreetnetwork_debugRoadsConnectedToIntersectionGeojson(p,this.__wbg_ptr,t);var s=qe()[p/4+0],l=qe()[p/4+1];return n=s,r=l,ei(s,l)}finally{Yt.__wbindgen_add_to_stack_pointer(16),Yt.__wbindgen_free(n,r,1)}}getOsmTagsForWay(t){let n,r;try{const T=Yt.__wbindgen_add_to_stack_pointer(-16);Yt.jsstreetnetwork_getOsmTagsForWay(T,this.__wbg_ptr,t);var s=qe()[T/4+0],l=qe()[T/4+1],p=qe()[T/4+2],c=qe()[T/4+3],y=s,w=l;if(c)throw y=0,w=0,fc(p);return n=y,r=w,ei(y,w)}finally{Yt.__wbindgen_add_to_stack_pointer(16),Yt.__wbindgen_free(n,r,1)}}toJson(){let t,n;try{const l=Yt.__wbindgen_add_to_stack_pointer(-16);Yt.jsstreetnetwork_toJson(l,this.__wbg_ptr);var r=qe()[l/4+0],s=qe()[l/4+1];return t=r,n=s,ei(r,s)}finally{Yt.__wbindgen_add_to_stack_pointer(16),Yt.__wbindgen_free(t,n,1)}}getGeometryForWay(t){let n,r;try{const p=Yt.__wbindgen_add_to_stack_pointer(-16);Yt.jsstreetnetwork_getGeometryForWay(p,this.__wbg_ptr,t);var s=qe()[p/4+0],l=qe()[p/4+1];return n=s,r=l,ei(s,l)}finally{Yt.__wbindgen_add_to_stack_pointer(16),Yt.__wbindgen_free(n,r,1)}}wayToXml(t){let n,r;try{const T=Yt.__wbindgen_add_to_stack_pointer(-16);Yt.jsstreetnetwork_wayToXml(T,this.__wbg_ptr,t);var s=qe()[T/4+0],l=qe()[T/4+1],p=qe()[T/4+2],c=qe()[T/4+3],y=s,w=l;if(c)throw y=0,w=0,fc(p);return n=y,r=w,ei(y,w)}finally{Yt.__wbindgen_add_to_stack_pointer(16),Yt.__wbindgen_free(n,r,1)}}findBlock(t,n,r){let s,l;try{const A=Yt.__wbindgen_add_to_stack_pointer(-16);Yt.jsstreetnetwork_findBlock(A,this.__wbg_ptr,t,n,r);var p=qe()[A/4+0],c=qe()[A/4+1],y=qe()[A/4+2],w=qe()[A/4+3],T=p,L=c;if(w)throw T=0,L=0,fc(y);return s=T,l=L,ei(T,L)}finally{Yt.__wbindgen_add_to_stack_pointer(16),Yt.__wbindgen_free(s,l,1)}}findAllBlocks(t){let n,r;try{const p=Yt.__wbindgen_add_to_stack_pointer(-16);Yt.jsstreetnetwork_findAllBlocks(p,this.__wbg_ptr,t);var s=qe()[p/4+0],l=qe()[p/4+1];return n=s,r=l,ei(s,l)}finally{Yt.__wbindgen_add_to_stack_pointer(16),Yt.__wbindgen_free(n,r,1)}}overwriteOsmTagsForWay(t,n){const r=td(n,Yt.__wbindgen_malloc,Yt.__wbindgen_realloc),s=zl;Yt.jsstreetnetwork_overwriteOsmTagsForWay(this.__wbg_ptr,t,r,s)}collapseShortRoad(t){Yt.jsstreetnetwork_collapseShortRoad(this.__wbg_ptr,t)}collapseIntersection(t){Yt.jsstreetnetwork_collapseIntersection(this.__wbg_ptr,t)}zipSidepath(t){Yt.jsstreetnetwork_zipSidepath(this.__wbg_ptr,t)}}async function vL(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}const n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{const n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function bL(){const e={};return e.wbg={},e.wbg.__wbg_jsdebugstreets_new=function(t){const n=n0.__wrap(t);return _i(n)},e.wbg.__wbindgen_string_new=function(t,n){const r=ei(t,n);return _i(r)},e.wbg.__wbg_jsstreetnetwork_new=function(t){const n=iy.__wrap(t);return _i(n)},e.wbg.__wbindgen_object_drop_ref=function(t){fc(t)},e.wbg.__wbindgen_boolean_get=function(t){const n=Nn(t);return typeof n=="boolean"?n?1:0:2},e.wbg.__wbindgen_error_new=function(t,n){const r=new Error(ei(t,n));return _i(r)},e.wbg.__wbindgen_string_get=function(t,n){const r=Nn(n),s=typeof r=="string"?r:void 0;var l=A_(s)?0:td(s,Yt.__wbindgen_malloc,Yt.__wbindgen_realloc),p=zl;qe()[t/4+1]=p,qe()[t/4+0]=l},e.wbg.__wbindgen_is_object=function(t){const n=Nn(t);return typeof n=="object"&&n!==null},e.wbg.__wbindgen_is_undefined=function(t){return Nn(t)===void 0},e.wbg.__wbindgen_in=function(t,n){return Nn(t)in Nn(n)},e.wbg.__wbindgen_jsval_loose_eq=function(t,n){return Nn(t)==Nn(n)},e.wbg.__wbindgen_number_get=function(t,n){const r=Nn(n),s=typeof r=="number"?r:void 0;gL()[t/8+1]=A_(s)?0:s,qe()[t/4+0]=!A_(s)},e.wbg.__wbindgen_object_clone_ref=function(t){const n=Nn(t);return _i(n)},e.wbg.__wbg_getwithrefkey_5e6d9547403deab8=function(t,n){const r=Nn(t)[Nn(n)];return _i(r)},e.wbg.__wbg_new_abda76e883ba8a5f=function(){const t=new Error;return _i(t)},e.wbg.__wbg_stack_658279fe44541cf6=function(t,n){const r=Nn(n).stack,s=td(r,Yt.__wbindgen_malloc,Yt.__wbindgen_realloc),l=zl;qe()[t/4+1]=l,qe()[t/4+0]=s},e.wbg.__wbg_error_f851667af71bcfc6=function(t,n){let r,s;try{r=t,s=n,console.error(ei(t,n))}finally{Yt.__wbindgen_free(r,s,1)}},e.wbg.__wbg_debug_2ef5d777cf4811fa=function(t){console.debug(Nn(t))},e.wbg.__wbg_error_f0a6627f4b23c19d=function(t){console.error(Nn(t))},e.wbg.__wbg_info_3ca7870690403fee=function(t){console.info(Nn(t))},e.wbg.__wbg_log_7811587c4c6d2844=function(t){console.log(Nn(t))},e.wbg.__wbg_warn_4affe1093892a4ef=function(t){console.warn(Nn(t))},e.wbg.__wbg_now_0669e62508913829=function(t){return Nn(t).now()},e.wbg.__wbg_newnoargs_c62ea9419c21fbac=function(t,n){const r=new Function(ei(t,n));return _i(r)},e.wbg.__wbg_get_7b48513de5dc5ea4=function(){return zh(function(t,n){const r=Reflect.get(Nn(t),Nn(n));return _i(r)},arguments)},e.wbg.__wbg_call_90c26b09837aba1c=function(){return zh(function(t,n){const r=Nn(t).call(Nn(n));return _i(r)},arguments)},e.wbg.__wbg_self_f0e34d89f33b99fd=function(){return zh(function(){const t=self.self;return _i(t)},arguments)},e.wbg.__wbg_window_d3b084224f4774d7=function(){return zh(function(){const t=window.window;return _i(t)},arguments)},e.wbg.__wbg_globalThis_9caa27ff917c6860=function(){return zh(function(){const t=globalThis.globalThis;return _i(t)},arguments)},e.wbg.__wbg_global_35dfdd59a4da3e74=function(){return zh(function(){const t=global.global;return _i(t)},arguments)},e.wbg.__wbg_instanceof_ArrayBuffer_e7d53d51371448e2=function(t){let n;try{n=Nn(t)instanceof ArrayBuffer}catch{n=!1}return n},e.wbg.__wbg_buffer_a448f833075b71ba=function(t){const n=Nn(t).buffer;return _i(n)},e.wbg.__wbg_new_8f67e318f15d7254=function(t){const n=new Uint8Array(Nn(t));return _i(n)},e.wbg.__wbg_set_2357bf09366ee480=function(t,n,r){Nn(t).set(Nn(n),r>>>0)},e.wbg.__wbg_length_1d25fa9e4ac21ce7=function(t){return Nn(t).length},e.wbg.__wbg_instanceof_Uint8Array_bced6f43aed8c1aa=function(t){let n;try{n=Nn(t)instanceof Uint8Array}catch{n=!1}return n},e.wbg.__wbindgen_debug_string=function(t,n){const r=lv(Nn(n)),s=td(r,Yt.__wbindgen_malloc,Yt.__wbindgen_realloc),l=zl;qe()[t/4+1]=l,qe()[t/4+0]=s},e.wbg.__wbindgen_throw=function(t,n){throw new Error(ei(t,n))},e.wbg.__wbindgen_memory=function(){const t=Yt.memory;return _i(t)},e}function xL(e,t){return Yt=e.exports,wL.__wbindgen_wasm_module=t,Zf=null,Wf=null,Hf=null,qf=null,Yt}async function wL(e){if(Yt!==void 0)return Yt;typeof e>"u"&&(e="/osm2streets/assets/osm2streets_js_bg.wasm");const t=bL();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));const{instance:n,module:r}=await vL(await e,t);return xL(n,r)}function SL(e){let t,n,r,s,l,p,c;return{c(){t=ae("div"),n=Wn(`App: - `),r=ae("select"),s=ae("option"),s.textContent="Street Explorer",l=ae("option"),l.textContent="Lane editor",s.__value="index.html",ds(s,s.__value),l.__value="lane_editor.html",ds(l,l.__value),e[0]===void 0&&ad(()=>e[2].call(r))},m(y,w){de(y,t,w),Wt(t,n),Wt(t,r),Wt(r,s),Wt(r,l),Sm(r,e[0],!0),p||(c=[an(r,"change",e[2]),an(r,"change",e[1])],p=!0)},p(y,[w]){w&1&&Sm(r,y[0])},i:Oe,o:Oe,d(y){y&&fe(t),p=!1,Fi(c)}}}function EL(e,t,n){let r=window.location.pathname.split("/").pop()||"index.html",s=r;function l(){s!=r&&(window.location.href=`${s}${window.location.search}${window.location.hash}`)}function p(){s=x2(this),n(0,s)}return[s,l,p]}class IO extends Pn{constructor(t){super(),Ln(this,t,EL,SL,vn,{})}}const Kh=ui(null),mc=ui(null);let k_=ui(1);const uv=ui(null),cv=ui(null),hv=ui(null),O2="MZEJTanw3WpxRvt7qDfo";let IL=ui("dataviz"),CL=ui("debug");mc.subscribe(e=>{cv.set(null),hv.set(null)});function Jh(e,t,n){let r=["case"];for(let[s,l]of Object.entries(t))r.push(["==",["get",e],s]),r.push(l);return r.push(n),r}function Nd(e){return{id:e,beforeId:TL(e)}}function TL(e){let t=_2(Kh),n,r=!1;for(let s=Nb.length-1;s>=0;s--){let l=Nb[s];if(l==e){r=!0;break}t.getLayer(l)&&(n=l)}if(!r)throw new Error(`Layer ID ${e} not defined in layerZorder`);return n}const Nb=["boundary","lane-polygons","intersection-polygons","lane-markings","intersection-markings","movements","connected-roads","block","block-debug","debug-ids","current-way","road_label","edit-polygon-fill","edit-polygon-lines","edit-polygon-vertices"];var Ob=Object.prototype.toString,z2=function(t){var n=Ob.call(t),r=n==="[object Arguments]";return r||(r=n!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Ob.call(t.callee)==="[object Function]"),r},D_,zb;function LL(){if(zb)return D_;zb=1;var e;if(!Object.keys){var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=z2,s=Object.prototype.propertyIsEnumerable,l=!s.call({toString:null},"toString"),p=s.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],y=function(A){var z=A.constructor;return z&&z.prototype===A},w={$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},T=function(){if(typeof window>"u")return!1;for(var A in window)try{if(!w["$"+A]&&t.call(window,A)&&window[A]!==null&&typeof window[A]=="object")try{y(window[A])}catch{return!0}}catch{return!0}return!1}(),L=function(A){if(typeof window>"u"||!T)return y(A);try{return y(A)}catch{return!1}};e=function(z){var B=z!==null&&typeof z=="object",Y=n.call(z)==="[object Function]",et=r(z),at=B&&n.call(z)==="[object String]",W=[];if(!B&&!Y&&!et)throw new TypeError("Object.keys called on a non-object");var H=p&&Y;if(at&&z.length>0&&!t.call(z,0))for(var nt=0;nt0)for(var ut=0;ut"u"||!Ti?Cn:Ti(Uint8Array),gc={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Cn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Cn:ArrayBuffer,"%ArrayIteratorPrototype%":Fh&&Ti?Ti([][Symbol.iterator]()):Cn,"%AsyncFromSyncIteratorPrototype%":Cn,"%AsyncFunction%":jh,"%AsyncGenerator%":jh,"%AsyncGeneratorFunction%":jh,"%AsyncIteratorPrototype%":jh,"%Atomics%":typeof Atomics>"u"?Cn:Atomics,"%BigInt%":typeof BigInt>"u"?Cn:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Cn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Cn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Cn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":KL,"%eval%":eval,"%EvalError%":JL,"%Float32Array%":typeof Float32Array>"u"?Cn:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Cn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Cn:FinalizationRegistry,"%Function%":V2,"%GeneratorFunction%":jh,"%Int8Array%":typeof Int8Array>"u"?Cn:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Cn:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Cn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Fh&&Ti?Ti(Ti([][Symbol.iterator]())):Cn,"%JSON%":typeof JSON=="object"?JSON:Cn,"%Map%":typeof Map>"u"?Cn:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Fh||!Ti?Cn:Ti(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Cn:Promise,"%Proxy%":typeof Proxy>"u"?Cn:Proxy,"%RangeError%":QL,"%ReferenceError%":$L,"%Reflect%":typeof Reflect>"u"?Cn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Cn:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Fh||!Ti?Cn:Ti(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Cn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Fh&&Ti?Ti(""[Symbol.iterator]()):Cn,"%Symbol%":Fh?Symbol:Cn,"%SyntaxError%":Qh,"%ThrowTypeError%":eP,"%TypedArray%":rP,"%TypeError%":Xh,"%Uint8Array%":typeof Uint8Array>"u"?Cn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Cn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Cn:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Cn:Uint32Array,"%URIError%":tP,"%WeakMap%":typeof WeakMap>"u"?Cn:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Cn:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Cn:WeakSet};if(Ti)try{null.error}catch(e){var iP=Ti(Ti(e));gc["%Error.prototype%"]=iP}var oP=function e(t){var n;if(t==="%AsyncFunction%")n=N_("async function () {}");else if(t==="%GeneratorFunction%")n=N_("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=N_("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=e("%AsyncGenerator%");s&&Ti&&(n=Ti(s.prototype))}return gc[t]=n,n},Gb={__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"]},Od=o0,Cm=B2,sP=Od.call(Function.call,Array.prototype.concat),aP=Od.call(Function.apply,Array.prototype.splice),jb=Od.call(Function.call,String.prototype.replace),Tm=Od.call(Function.call,String.prototype.slice),lP=Od.call(Function.call,RegExp.prototype.exec),uP=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,cP=/\\(\\)?/g,hP=function(t){var n=Tm(t,0,1),r=Tm(t,-1);if(n==="%"&&r!=="%")throw new Qh("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new Qh("invalid intrinsic syntax, expected opening `%`");var s=[];return jb(t,uP,function(l,p,c,y){s[s.length]=c?jb(y,cP,"$1"):p||l}),s},pP=function(t,n){var r=t,s;if(Cm(Gb,r)&&(s=Gb[r],r="%"+s[0]+"%"),Cm(gc,r)){var l=gc[r];if(l===jh&&(l=oP(r)),typeof l>"u"&&!n)throw new Xh("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:r,value:l}}throw new Qh("intrinsic "+t+" does not exist!")},ul=function(t,n){if(typeof t!="string"||t.length===0)throw new Xh("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new Xh('"allowMissing" argument must be a boolean');if(lP(/^%?[^%]*%?$/,t)===null)throw new Qh("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=hP(t),s=r.length>0?r[0]:"",l=pP("%"+s+"%",n),p=l.name,c=l.value,y=!1,w=l.alias;w&&(s=w[0],aP(r,sP([0,1],w)));for(var T=1,L=!0;T=r.length){var Y=dc(c,A);L=!!Y,L&&"get"in Y&&!("originalValue"in Y.get)?c=Y.get:c=c[A]}else L=Cm(c,A),c=c[A];L&&!y&&(gc[p]=c)}}return c},z_,qb;function s0(){if(qb)return z_;qb=1;var e=ul,t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return z_=t,z_}var fP=ul,fm=fP("%Object.getOwnPropertyDescriptor%",!0);if(fm)try{fm([],"length")}catch{fm=null}var a0=fm,Wb=s0(),dP=F2,Bh=Nu,Zb=a0,l0=function(t,n,r){if(!t||typeof t!="object"&&typeof t!="function")throw new Bh("`obj` must be an object or a function`");if(typeof n!="string"&&typeof n!="symbol")throw new Bh("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Bh("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Bh("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Bh("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Bh("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,p=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,y=!!Zb&&Zb(t,n);if(Wb)Wb(t,n,{configurable:p===null&&y?y.configurable:!p,enumerable:s===null&&y?y.enumerable:!s,value:r,writable:l===null&&y?y.writable:!l});else if(c||!s&&!l&&!p)t[n]=r;else throw new dP("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},pv=s0(),U2=function(){return!!pv};U2.hasArrayLengthDefineBug=function(){if(!pv)return null;try{return pv([],"length",{value:1}).length!==1}catch{return!0}};var u0=U2,gP=r0,mP=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",yP=Object.prototype.toString,_P=Array.prototype.concat,Hb=l0,vP=function(e){return typeof e=="function"&&yP.call(e)==="[object Function]"},G2=u0(),bP=function(e,t,n,r){if(t in e){if(r===!0){if(e[t]===n)return}else if(!vP(r)||!r())return}G2?Hb(e,t,n,!0):Hb(e,t,n)},j2=function(e,t){var n=arguments.length>2?arguments[2]:{},r=gP(t);mP&&(r=_P.call(r,Object.getOwnPropertySymbols(t)));for(var s=0;s4294967295||SP(n)!==n)throw new Kb("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],s=!0,l=!0;if("length"in t&&Yb){var p=Yb(t,"length");p&&!p.configurable&&(s=!1),p&&!p.writable&&(l=!1)}return(s||l||!r)&&(wP?Xb(t,"length",n,!0,!0):Xb(t,"length",n)),t};(function(e){var t=o0,n=ul,r=EP,s=Nu,l=n("%Function.prototype.apply%"),p=n("%Function.prototype.call%"),c=n("%Reflect.apply%",!0)||t.call(p,l),y=s0(),w=n("%Math.max%");e.exports=function(A){if(typeof A!="function")throw new s("a function is required");var z=c(t,p,arguments);return r(z,1+w(0,A.length-(arguments.length-1)),!0)};var T=function(){return c(t,l,arguments)};y?y(e.exports,"apply",{value:T}):e.exports.apply=T})(q2);var Cp=q2.exports,W2=ul,Z2=Cp,IP=Z2(W2("String.prototype.indexOf")),sa=function(t,n){var r=W2(t,!!n);return typeof r=="function"&&IP(t,".prototype.")>-1?Z2(r):r},CP=r0,H2=oy(),X2=sa,Jb=Object,TP=X2("Array.prototype.push"),Qb=X2("Object.prototype.propertyIsEnumerable"),LP=H2?Object.getOwnPropertySymbols:null,Y2=function(t,n){if(t==null)throw new TypeError("target must be an object");var r=Jb(t);if(arguments.length===1)return r;for(var s=1;s2&&!!arguments[2];return(!r||jP)&&(GP?$b(t,"name",n,!0,!0):$b(t,"name",n)),t},ZP=WP,HP=Nu,XP=Object,$2=ZP(function(){if(this==null||this!==XP(this))throw new HP("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0),YP=$2,KP=Ac.supportsDescriptors,JP=Object.getOwnPropertyDescriptor,tS=function(){if(KP&&/a/mig.flags==="gim"){var t=JP(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var n="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){n+="d"}}),Object.defineProperty(r,"sticky",{get:function(){n+="y"}}),n==="dy")return t.get}}return YP},QP=Ac.supportsDescriptors,$P=tS,tM=Object.getOwnPropertyDescriptor,eM=Object.defineProperty,nM=TypeError,tx=Object.getPrototypeOf,rM=/a/,iM=function(){if(!QP||!tx)throw new nM("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=$P(),n=tx(rM),r=tM(n,"flags");return(!r||r.get!==t)&&eM(n,"flags",{configurable:!0,enumerable:!1,get:t}),t},oM=Ac,sM=Cp,aM=$2,eS=tS,lM=iM,nS=sM(eS());oM(nS,{getPolyfill:eS,implementation:aM,shim:lM});var uM=nS,dm={exports:{}},cM=oy,kc=function(){return cM()&&!!Symbol.toStringTag},hM=kc(),pM=sa,fv=pM("Object.prototype.toString"),sy=function(t){return hM&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:fv(t)==="[object Arguments]"},rS=function(t){return sy(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&fv(t)!=="[object Array]"&&fv(t.callee)==="[object Function]"},fM=function(){return sy(arguments)}();sy.isLegacyArguments=rS;var iS=fM?sy:rS;const dM={},gM=Object.freeze(Object.defineProperty({__proto__:null,default:dM},Symbol.toStringTag,{value:"Module"})),mM=ny(gM);var c0=typeof Map=="function"&&Map.prototype,B_=Object.getOwnPropertyDescriptor&&c0?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Lm=c0&&B_&&typeof B_.get=="function"?B_.get:null,ex=c0&&Map.prototype.forEach,h0=typeof Set=="function"&&Set.prototype,V_=Object.getOwnPropertyDescriptor&&h0?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Pm=h0&&V_&&typeof V_.get=="function"?V_.get:null,nx=h0&&Set.prototype.forEach,yM=typeof WeakMap=="function"&&WeakMap.prototype,nd=yM?WeakMap.prototype.has:null,_M=typeof WeakSet=="function"&&WeakSet.prototype,rd=_M?WeakSet.prototype.has:null,vM=typeof WeakRef=="function"&&WeakRef.prototype,rx=vM?WeakRef.prototype.deref:null,bM=Boolean.prototype.valueOf,xM=Object.prototype.toString,wM=Function.prototype.toString,SM=String.prototype.match,p0=String.prototype.slice,xu=String.prototype.replace,EM=String.prototype.toUpperCase,ix=String.prototype.toLowerCase,oS=RegExp.prototype.test,ox=Array.prototype.concat,Ja=Array.prototype.join,IM=Array.prototype.slice,sx=Math.floor,dv=typeof BigInt=="function"?BigInt.prototype.valueOf:null,U_=Object.getOwnPropertySymbols,gv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,$h=typeof Symbol=="function"&&typeof Symbol.iterator=="object",po=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===$h||"symbol")?Symbol.toStringTag:null,sS=Object.prototype.propertyIsEnumerable,ax=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function lx(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||oS.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var r=e<0?-sx(-e):sx(e);if(r!==e){var s=String(r),l=p0.call(t,s.length+1);return xu.call(s,n,"$&_")+"."+xu.call(xu.call(l,/([0-9]{3})/g,"$&_"),/_$/,"")}}return xu.call(t,n,"$&_")}var mv=mM,ux=mv.custom,cx=lS(ux)?ux:null,CM=function e(t,n,r,s){var l=n||{};if(vu(l,"quoteStyle")&&l.quoteStyle!=="single"&&l.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(vu(l,"maxStringLength")&&(typeof l.maxStringLength=="number"?l.maxStringLength<0&&l.maxStringLength!==1/0:l.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var p=vu(l,"customInspect")?l.customInspect:!0;if(typeof p!="boolean"&&p!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(vu(l,"indent")&&l.indent!==null&&l.indent!==" "&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(vu(l,"numericSeparator")&&typeof l.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var c=l.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return cS(t,l);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var y=String(t);return c?lx(t,y):y}if(typeof t=="bigint"){var w=String(t)+"n";return c?lx(t,w):w}var T=typeof l.depth>"u"?5:l.depth;if(typeof r>"u"&&(r=0),r>=T&&T>0&&typeof t=="object")return yv(t)?"[Array]":"[Object]";var L=qM(l,r);if(typeof s>"u")s=[];else if(uS(s,t)>=0)return"[Circular]";function A(Qt,Et,oe){if(Et&&(s=IM.call(s),s.push(Et)),oe){var ge={depth:l.depth};return vu(l,"quoteStyle")&&(ge.quoteStyle=l.quoteStyle),e(Qt,ge,r+1,s)}return e(Qt,l,r+1,s)}if(typeof t=="function"&&!hx(t)){var z=NM(t),B=tm(t,A);return"[Function"+(z?": "+z:" (anonymous)")+"]"+(B.length>0?" { "+Ja.call(B,", ")+" }":"")}if(lS(t)){var Y=$h?xu.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):gv.call(t);return typeof t=="object"&&!$h?Of(Y):Y}if(UM(t)){for(var et="<"+ix.call(String(t.nodeName)),at=t.attributes||[],W=0;W",et}if(yv(t)){if(t.length===0)return"[]";var H=tm(t,A);return L&&!jM(H)?"["+_v(H,L)+"]":"[ "+Ja.call(H,", ")+" ]"}if(PM(t)){var nt=tm(t,A);return!("cause"in Error.prototype)&&"cause"in t&&!sS.call(t,"cause")?"{ ["+String(t)+"] "+Ja.call(ox.call("[cause]: "+A(t.cause),nt),", ")+" }":nt.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Ja.call(nt,", ")+" }"}if(typeof t=="object"&&p){if(cx&&typeof t[cx]=="function"&&mv)return mv(t,{depth:T-r});if(p!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(OM(t)){var ut=[];return ex&&ex.call(t,function(Qt,Et){ut.push(A(Et,t,!0)+" => "+A(Qt,t))}),px("Map",Lm.call(t),ut,L)}if(BM(t)){var _t=[];return nx&&nx.call(t,function(Qt){_t.push(A(Qt,t))}),px("Set",Pm.call(t),_t,L)}if(zM(t))return G_("WeakMap");if(VM(t))return G_("WeakSet");if(FM(t))return G_("WeakRef");if(AM(t))return Of(A(Number(t)));if(DM(t))return Of(A(dv.call(t)));if(kM(t))return Of(bM.call(t));if(MM(t))return Of(A(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(t===kd)return"{ [object globalThis] }";if(!LM(t)&&!hx(t)){var ct=tm(t,A),bt=ax?ax(t)===Object.prototype:t instanceof Object||t.constructor===Object,It=t instanceof Object?"":"null prototype",Ot=!bt&&po&&Object(t)===t&&po in t?p0.call(Ou(t),8,-1):It?"Object":"",dt=bt||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",Pt=dt+(Ot||It?"["+Ja.call(ox.call([],Ot||[],It||[]),": ")+"] ":"");return ct.length===0?Pt+"{}":L?Pt+"{"+_v(ct,L)+"}":Pt+"{ "+Ja.call(ct,", ")+" }"}return String(t)};function aS(e,t,n){var r=(n.quoteStyle||t)==="double"?'"':"'";return r+e+r}function TM(e){return xu.call(String(e),/"/g,""")}function yv(e){return Ou(e)==="[object Array]"&&(!po||!(typeof e=="object"&&po in e))}function LM(e){return Ou(e)==="[object Date]"&&(!po||!(typeof e=="object"&&po in e))}function hx(e){return Ou(e)==="[object RegExp]"&&(!po||!(typeof e=="object"&&po in e))}function PM(e){return Ou(e)==="[object Error]"&&(!po||!(typeof e=="object"&&po in e))}function MM(e){return Ou(e)==="[object String]"&&(!po||!(typeof e=="object"&&po in e))}function AM(e){return Ou(e)==="[object Number]"&&(!po||!(typeof e=="object"&&po in e))}function kM(e){return Ou(e)==="[object Boolean]"&&(!po||!(typeof e=="object"&&po in e))}function lS(e){if($h)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!gv)return!1;try{return gv.call(e),!0}catch{}return!1}function DM(e){if(!e||typeof e!="object"||!dv)return!1;try{return dv.call(e),!0}catch{}return!1}var RM=Object.prototype.hasOwnProperty||function(e){return e in this};function vu(e,t){return RM.call(e,t)}function Ou(e){return xM.call(e)}function NM(e){if(e.name)return e.name;var t=SM.call(wM.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function uS(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return cS(p0.call(e,0,t.maxStringLength),t)+r}var s=xu.call(xu.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,GM);return aS(s,"single",t)}function GM(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+EM.call(t.toString(16))}function Of(e){return"Object("+e+")"}function G_(e){return e+" { ? }"}function px(e,t,n,r){var s=r?_v(n,r):Ja.call(n,", ");return e+" ("+t+") {"+s+"}"}function jM(e){for(var t=0;te[2].call(r))},m(y,w){de(y,t,w),Wt(t,n),Wt(t,r),Wt(r,s),Wt(r,l),Sm(r,e[0],!0),p||(c=[an(r,"change",e[2]),an(r,"change",e[1])],p=!0)},p(y,[w]){w&1&&Sm(r,y[0])},i:Oe,o:Oe,d(y){y&&fe(t),p=!1,Fi(c)}}}function EL(e,t,n){let r=window.location.pathname.split("/").pop()||"index.html",s=r;function l(){s!=r&&(window.location.href=`${s}${window.location.search}${window.location.hash}`)}function p(){s=x2(this),n(0,s)}return[s,l,p]}class IO extends Pn{constructor(t){super(),Ln(this,t,EL,SL,vn,{})}}const Kh=ui(null),mc=ui(null);let k_=ui(1);const uv=ui(null),cv=ui(null),hv=ui(null),O2="MZEJTanw3WpxRvt7qDfo";let IL=ui("dataviz"),CL=ui("debug");mc.subscribe(e=>{cv.set(null),hv.set(null)});function Nd(e){return{id:e,beforeId:TL(e)}}function TL(e){let t=_2(Kh),n,r=!1;for(let s=Nb.length-1;s>=0;s--){let l=Nb[s];if(l==e){r=!0;break}t.getLayer(l)&&(n=l)}if(!r)throw new Error(`Layer ID ${e} not defined in layerZorder`);return n}const Nb=["boundary","lane-polygons","intersection-polygons","lane-markings","intersection-markings","movements","connected-roads","block","block-debug","debug-ids","current-way","road_label","edit-polygon-fill","edit-polygon-lines","edit-polygon-vertices"];var Ob=Object.prototype.toString,z2=function(t){var n=Ob.call(t),r=n==="[object Arguments]";return r||(r=n!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Ob.call(t.callee)==="[object Function]"),r},D_,zb;function LL(){if(zb)return D_;zb=1;var e;if(!Object.keys){var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=z2,s=Object.prototype.propertyIsEnumerable,l=!s.call({toString:null},"toString"),p=s.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],y=function(A){var z=A.constructor;return z&&z.prototype===A},w={$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},T=function(){if(typeof window>"u")return!1;for(var A in window)try{if(!w["$"+A]&&t.call(window,A)&&window[A]!==null&&typeof window[A]=="object")try{y(window[A])}catch{return!0}}catch{return!0}return!1}(),L=function(A){if(typeof window>"u"||!T)return y(A);try{return y(A)}catch{return!1}};e=function(z){var B=z!==null&&typeof z=="object",Y=n.call(z)==="[object Function]",et=r(z),at=B&&n.call(z)==="[object String]",W=[];if(!B&&!Y&&!et)throw new TypeError("Object.keys called on a non-object");var H=p&&Y;if(at&&z.length>0&&!t.call(z,0))for(var nt=0;nt0)for(var ut=0;ut"u"||!Ti?Cn:Ti(Uint8Array),gc={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Cn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Cn:ArrayBuffer,"%ArrayIteratorPrototype%":Fh&&Ti?Ti([][Symbol.iterator]()):Cn,"%AsyncFromSyncIteratorPrototype%":Cn,"%AsyncFunction%":jh,"%AsyncGenerator%":jh,"%AsyncGeneratorFunction%":jh,"%AsyncIteratorPrototype%":jh,"%Atomics%":typeof Atomics>"u"?Cn:Atomics,"%BigInt%":typeof BigInt>"u"?Cn:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Cn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Cn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Cn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":KL,"%eval%":eval,"%EvalError%":JL,"%Float32Array%":typeof Float32Array>"u"?Cn:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Cn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Cn:FinalizationRegistry,"%Function%":V2,"%GeneratorFunction%":jh,"%Int8Array%":typeof Int8Array>"u"?Cn:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Cn:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Cn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Fh&&Ti?Ti(Ti([][Symbol.iterator]())):Cn,"%JSON%":typeof JSON=="object"?JSON:Cn,"%Map%":typeof Map>"u"?Cn:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Fh||!Ti?Cn:Ti(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Cn:Promise,"%Proxy%":typeof Proxy>"u"?Cn:Proxy,"%RangeError%":QL,"%ReferenceError%":$L,"%Reflect%":typeof Reflect>"u"?Cn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Cn:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Fh||!Ti?Cn:Ti(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Cn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Fh&&Ti?Ti(""[Symbol.iterator]()):Cn,"%Symbol%":Fh?Symbol:Cn,"%SyntaxError%":Jh,"%ThrowTypeError%":eP,"%TypedArray%":rP,"%TypeError%":Xh,"%Uint8Array%":typeof Uint8Array>"u"?Cn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Cn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Cn:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Cn:Uint32Array,"%URIError%":tP,"%WeakMap%":typeof WeakMap>"u"?Cn:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Cn:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Cn:WeakSet};if(Ti)try{null.error}catch(e){var iP=Ti(Ti(e));gc["%Error.prototype%"]=iP}var oP=function e(t){var n;if(t==="%AsyncFunction%")n=N_("async function () {}");else if(t==="%GeneratorFunction%")n=N_("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=N_("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=e("%AsyncGenerator%");s&&Ti&&(n=Ti(s.prototype))}return gc[t]=n,n},Gb={__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"]},Od=o0,Cm=B2,sP=Od.call(Function.call,Array.prototype.concat),aP=Od.call(Function.apply,Array.prototype.splice),jb=Od.call(Function.call,String.prototype.replace),Tm=Od.call(Function.call,String.prototype.slice),lP=Od.call(Function.call,RegExp.prototype.exec),uP=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,cP=/\\(\\)?/g,hP=function(t){var n=Tm(t,0,1),r=Tm(t,-1);if(n==="%"&&r!=="%")throw new Jh("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new Jh("invalid intrinsic syntax, expected opening `%`");var s=[];return jb(t,uP,function(l,p,c,y){s[s.length]=c?jb(y,cP,"$1"):p||l}),s},pP=function(t,n){var r=t,s;if(Cm(Gb,r)&&(s=Gb[r],r="%"+s[0]+"%"),Cm(gc,r)){var l=gc[r];if(l===jh&&(l=oP(r)),typeof l>"u"&&!n)throw new Xh("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:r,value:l}}throw new Jh("intrinsic "+t+" does not exist!")},ul=function(t,n){if(typeof t!="string"||t.length===0)throw new Xh("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new Xh('"allowMissing" argument must be a boolean');if(lP(/^%?[^%]*%?$/,t)===null)throw new Jh("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=hP(t),s=r.length>0?r[0]:"",l=pP("%"+s+"%",n),p=l.name,c=l.value,y=!1,w=l.alias;w&&(s=w[0],aP(r,sP([0,1],w)));for(var T=1,L=!0;T=r.length){var Y=dc(c,A);L=!!Y,L&&"get"in Y&&!("originalValue"in Y.get)?c=Y.get:c=c[A]}else L=Cm(c,A),c=c[A];L&&!y&&(gc[p]=c)}}return c},z_,qb;function s0(){if(qb)return z_;qb=1;var e=ul,t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return z_=t,z_}var fP=ul,fm=fP("%Object.getOwnPropertyDescriptor%",!0);if(fm)try{fm([],"length")}catch{fm=null}var a0=fm,Wb=s0(),dP=F2,Bh=Nu,Zb=a0,l0=function(t,n,r){if(!t||typeof t!="object"&&typeof t!="function")throw new Bh("`obj` must be an object or a function`");if(typeof n!="string"&&typeof n!="symbol")throw new Bh("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Bh("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Bh("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Bh("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Bh("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,p=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,y=!!Zb&&Zb(t,n);if(Wb)Wb(t,n,{configurable:p===null&&y?y.configurable:!p,enumerable:s===null&&y?y.enumerable:!s,value:r,writable:l===null&&y?y.writable:!l});else if(c||!s&&!l&&!p)t[n]=r;else throw new dP("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},pv=s0(),U2=function(){return!!pv};U2.hasArrayLengthDefineBug=function(){if(!pv)return null;try{return pv([],"length",{value:1}).length!==1}catch{return!0}};var u0=U2,gP=r0,mP=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",yP=Object.prototype.toString,_P=Array.prototype.concat,Hb=l0,vP=function(e){return typeof e=="function"&&yP.call(e)==="[object Function]"},G2=u0(),bP=function(e,t,n,r){if(t in e){if(r===!0){if(e[t]===n)return}else if(!vP(r)||!r())return}G2?Hb(e,t,n,!0):Hb(e,t,n)},j2=function(e,t){var n=arguments.length>2?arguments[2]:{},r=gP(t);mP&&(r=_P.call(r,Object.getOwnPropertySymbols(t)));for(var s=0;s4294967295||SP(n)!==n)throw new Kb("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],s=!0,l=!0;if("length"in t&&Yb){var p=Yb(t,"length");p&&!p.configurable&&(s=!1),p&&!p.writable&&(l=!1)}return(s||l||!r)&&(wP?Xb(t,"length",n,!0,!0):Xb(t,"length",n)),t};(function(e){var t=o0,n=ul,r=EP,s=Nu,l=n("%Function.prototype.apply%"),p=n("%Function.prototype.call%"),c=n("%Reflect.apply%",!0)||t.call(p,l),y=s0(),w=n("%Math.max%");e.exports=function(A){if(typeof A!="function")throw new s("a function is required");var z=c(t,p,arguments);return r(z,1+w(0,A.length-(arguments.length-1)),!0)};var T=function(){return c(t,l,arguments)};y?y(e.exports,"apply",{value:T}):e.exports.apply=T})(q2);var Cp=q2.exports,W2=ul,Z2=Cp,IP=Z2(W2("String.prototype.indexOf")),sa=function(t,n){var r=W2(t,!!n);return typeof r=="function"&&IP(t,".prototype.")>-1?Z2(r):r},CP=r0,H2=oy(),X2=sa,Jb=Object,TP=X2("Array.prototype.push"),Qb=X2("Object.prototype.propertyIsEnumerable"),LP=H2?Object.getOwnPropertySymbols:null,Y2=function(t,n){if(t==null)throw new TypeError("target must be an object");var r=Jb(t);if(arguments.length===1)return r;for(var s=1;s2&&!!arguments[2];return(!r||jP)&&(GP?$b(t,"name",n,!0,!0):$b(t,"name",n)),t},ZP=WP,HP=Nu,XP=Object,$2=ZP(function(){if(this==null||this!==XP(this))throw new HP("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0),YP=$2,KP=Ac.supportsDescriptors,JP=Object.getOwnPropertyDescriptor,tS=function(){if(KP&&/a/mig.flags==="gim"){var t=JP(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var n="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){n+="d"}}),Object.defineProperty(r,"sticky",{get:function(){n+="y"}}),n==="dy")return t.get}}return YP},QP=Ac.supportsDescriptors,$P=tS,tM=Object.getOwnPropertyDescriptor,eM=Object.defineProperty,nM=TypeError,tx=Object.getPrototypeOf,rM=/a/,iM=function(){if(!QP||!tx)throw new nM("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=$P(),n=tx(rM),r=tM(n,"flags");return(!r||r.get!==t)&&eM(n,"flags",{configurable:!0,enumerable:!1,get:t}),t},oM=Ac,sM=Cp,aM=$2,eS=tS,lM=iM,nS=sM(eS());oM(nS,{getPolyfill:eS,implementation:aM,shim:lM});var uM=nS,dm={exports:{}},cM=oy,kc=function(){return cM()&&!!Symbol.toStringTag},hM=kc(),pM=sa,fv=pM("Object.prototype.toString"),sy=function(t){return hM&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:fv(t)==="[object Arguments]"},rS=function(t){return sy(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&fv(t)!=="[object Array]"&&fv(t.callee)==="[object Function]"},fM=function(){return sy(arguments)}();sy.isLegacyArguments=rS;var iS=fM?sy:rS;const dM={},gM=Object.freeze(Object.defineProperty({__proto__:null,default:dM},Symbol.toStringTag,{value:"Module"})),mM=ny(gM);var c0=typeof Map=="function"&&Map.prototype,B_=Object.getOwnPropertyDescriptor&&c0?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Lm=c0&&B_&&typeof B_.get=="function"?B_.get:null,ex=c0&&Map.prototype.forEach,h0=typeof Set=="function"&&Set.prototype,V_=Object.getOwnPropertyDescriptor&&h0?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Pm=h0&&V_&&typeof V_.get=="function"?V_.get:null,nx=h0&&Set.prototype.forEach,yM=typeof WeakMap=="function"&&WeakMap.prototype,nd=yM?WeakMap.prototype.has:null,_M=typeof WeakSet=="function"&&WeakSet.prototype,rd=_M?WeakSet.prototype.has:null,vM=typeof WeakRef=="function"&&WeakRef.prototype,rx=vM?WeakRef.prototype.deref:null,bM=Boolean.prototype.valueOf,xM=Object.prototype.toString,wM=Function.prototype.toString,SM=String.prototype.match,p0=String.prototype.slice,xu=String.prototype.replace,EM=String.prototype.toUpperCase,ix=String.prototype.toLowerCase,oS=RegExp.prototype.test,ox=Array.prototype.concat,Ja=Array.prototype.join,IM=Array.prototype.slice,sx=Math.floor,dv=typeof BigInt=="function"?BigInt.prototype.valueOf:null,U_=Object.getOwnPropertySymbols,gv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Qh=typeof Symbol=="function"&&typeof Symbol.iterator=="object",po=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Qh||"symbol")?Symbol.toStringTag:null,sS=Object.prototype.propertyIsEnumerable,ax=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function lx(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||oS.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var r=e<0?-sx(-e):sx(e);if(r!==e){var s=String(r),l=p0.call(t,s.length+1);return xu.call(s,n,"$&_")+"."+xu.call(xu.call(l,/([0-9]{3})/g,"$&_"),/_$/,"")}}return xu.call(t,n,"$&_")}var mv=mM,ux=mv.custom,cx=lS(ux)?ux:null,CM=function e(t,n,r,s){var l=n||{};if(vu(l,"quoteStyle")&&l.quoteStyle!=="single"&&l.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(vu(l,"maxStringLength")&&(typeof l.maxStringLength=="number"?l.maxStringLength<0&&l.maxStringLength!==1/0:l.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var p=vu(l,"customInspect")?l.customInspect:!0;if(typeof p!="boolean"&&p!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(vu(l,"indent")&&l.indent!==null&&l.indent!==" "&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(vu(l,"numericSeparator")&&typeof l.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var c=l.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return cS(t,l);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var y=String(t);return c?lx(t,y):y}if(typeof t=="bigint"){var w=String(t)+"n";return c?lx(t,w):w}var T=typeof l.depth>"u"?5:l.depth;if(typeof r>"u"&&(r=0),r>=T&&T>0&&typeof t=="object")return yv(t)?"[Array]":"[Object]";var L=qM(l,r);if(typeof s>"u")s=[];else if(uS(s,t)>=0)return"[Circular]";function A(Qt,Et,oe){if(Et&&(s=IM.call(s),s.push(Et)),oe){var ge={depth:l.depth};return vu(l,"quoteStyle")&&(ge.quoteStyle=l.quoteStyle),e(Qt,ge,r+1,s)}return e(Qt,l,r+1,s)}if(typeof t=="function"&&!hx(t)){var z=NM(t),B=tm(t,A);return"[Function"+(z?": "+z:" (anonymous)")+"]"+(B.length>0?" { "+Ja.call(B,", ")+" }":"")}if(lS(t)){var Y=Qh?xu.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):gv.call(t);return typeof t=="object"&&!Qh?Of(Y):Y}if(UM(t)){for(var et="<"+ix.call(String(t.nodeName)),at=t.attributes||[],W=0;W",et}if(yv(t)){if(t.length===0)return"[]";var H=tm(t,A);return L&&!jM(H)?"["+_v(H,L)+"]":"[ "+Ja.call(H,", ")+" ]"}if(PM(t)){var nt=tm(t,A);return!("cause"in Error.prototype)&&"cause"in t&&!sS.call(t,"cause")?"{ ["+String(t)+"] "+Ja.call(ox.call("[cause]: "+A(t.cause),nt),", ")+" }":nt.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Ja.call(nt,", ")+" }"}if(typeof t=="object"&&p){if(cx&&typeof t[cx]=="function"&&mv)return mv(t,{depth:T-r});if(p!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(OM(t)){var ut=[];return ex&&ex.call(t,function(Qt,Et){ut.push(A(Et,t,!0)+" => "+A(Qt,t))}),px("Map",Lm.call(t),ut,L)}if(BM(t)){var _t=[];return nx&&nx.call(t,function(Qt){_t.push(A(Qt,t))}),px("Set",Pm.call(t),_t,L)}if(zM(t))return G_("WeakMap");if(VM(t))return G_("WeakSet");if(FM(t))return G_("WeakRef");if(AM(t))return Of(A(Number(t)));if(DM(t))return Of(A(dv.call(t)));if(kM(t))return Of(bM.call(t));if(MM(t))return Of(A(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(t===kd)return"{ [object globalThis] }";if(!LM(t)&&!hx(t)){var ct=tm(t,A),bt=ax?ax(t)===Object.prototype:t instanceof Object||t.constructor===Object,It=t instanceof Object?"":"null prototype",Ot=!bt&&po&&Object(t)===t&&po in t?p0.call(Ou(t),8,-1):It?"Object":"",dt=bt||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",Pt=dt+(Ot||It?"["+Ja.call(ox.call([],Ot||[],It||[]),": ")+"] ":"");return ct.length===0?Pt+"{}":L?Pt+"{"+_v(ct,L)+"}":Pt+"{ "+Ja.call(ct,", ")+" }"}return String(t)};function aS(e,t,n){var r=(n.quoteStyle||t)==="double"?'"':"'";return r+e+r}function TM(e){return xu.call(String(e),/"/g,""")}function yv(e){return Ou(e)==="[object Array]"&&(!po||!(typeof e=="object"&&po in e))}function LM(e){return Ou(e)==="[object Date]"&&(!po||!(typeof e=="object"&&po in e))}function hx(e){return Ou(e)==="[object RegExp]"&&(!po||!(typeof e=="object"&&po in e))}function PM(e){return Ou(e)==="[object Error]"&&(!po||!(typeof e=="object"&&po in e))}function MM(e){return Ou(e)==="[object String]"&&(!po||!(typeof e=="object"&&po in e))}function AM(e){return Ou(e)==="[object Number]"&&(!po||!(typeof e=="object"&&po in e))}function kM(e){return Ou(e)==="[object Boolean]"&&(!po||!(typeof e=="object"&&po in e))}function lS(e){if(Qh)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!gv)return!1;try{return gv.call(e),!0}catch{}return!1}function DM(e){if(!e||typeof e!="object"||!dv)return!1;try{return dv.call(e),!0}catch{}return!1}var RM=Object.prototype.hasOwnProperty||function(e){return e in this};function vu(e,t){return RM.call(e,t)}function Ou(e){return xM.call(e)}function NM(e){if(e.name)return e.name;var t=SM.call(wM.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function uS(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return cS(p0.call(e,0,t.maxStringLength),t)+r}var s=xu.call(xu.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,GM);return aS(s,"single",t)}function GM(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+EM.call(t.toString(16))}function Of(e){return"Object("+e+")"}function G_(e){return e+" { ? }"}function px(e,t,n,r){var s=r?_v(n,r):Ja.call(n,", ");return e+" ("+t+") {"+s+"}"}function jM(e){for(var t=0;t=0)return!1;return!0}function qM(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=Ja.call(Array(e.indent+1)," ");else return null;return{base:n,prev:Ja.call(Array(t+1),n)}}function _v(e,t){if(e.length===0)return"";var n=` `+t.prev+t.base;return n+Ja.call(e,","+n)+` -`+t.prev}function tm(e,t){var n=yv(e),r=[];if(n){r.length=e.length;for(var s=0;s=r)return n+1;var s=bx(t,n);if(s<55296||s>56319)return n+1;var l=bx(t,n+1);return l<56320||l>57343?n+1:n+2},q_=function(t){var n=0;return{next:function(){var s=n>=t.length,l;return s||(l=t[n],n+=1),{done:s,value:l}}}},xx=function(t,n){if(dA(t)||mx(t))return q_(t);if(gA(t)){var r=0;return{next:function(){var l=vA(t,r),p=_A(t,r,l);return r=l,{done:l>t.length,value:p}}}}if(n&&typeof t["_es6-shim iterator_"]<"u")return t["_es6-shim iterator_"]()};if(!mA&&!yA)dm.exports=function(t){if(t!=null)return xx(t,!0)};else{var bA=mS,xA=_S,wx=ya("Map.prototype.forEach",!0),Sx=ya("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var Ex=ya("Map.prototype.iterator",!0),Ix=ya("Set.prototype.iterator",!0);var Cx=ya("Map.prototype.@@iterator",!0)||ya("Map.prototype._es6-shim iterator_",!0),Tx=ya("Set.prototype.@@iterator",!0)||ya("Set.prototype._es6-shim iterator_",!0),wA=function(t){if(bA(t)){if(Ex)return yx(Ex(t));if(Cx)return Cx(t);if(wx){var n=[];return wx(t,function(s,l){vx(n,[l,s])}),q_(n)}}if(xA(t)){if(Ix)return yx(Ix(t));if(Tx)return Tx(t);if(Sx){var r=[];return Sx(t,function(s){vx(r,s)}),q_(r)}}};dm.exports=function(t){return wA(t)||xx(t)}}}var SA=dm.exports,Lx=function(e){return e!==e},vS=function(t,n){return t===0&&n===0?1/t===1/n:!!(t===n||Lx(t)&&Lx(n))},EA=vS,bS=function(){return typeof Object.is=="function"?Object.is:EA},IA=bS,CA=Ac,TA=function(){var t=IA();return CA(Object,{is:t},{is:function(){return Object.is!==t}}),t},LA=Ac,PA=Cp,MA=vS,xS=bS,AA=TA,wS=PA(xS(),Object);LA(wS,{getPolyfill:xS,implementation:MA,shim:AA});var kA=wS,DA=Cp,SS=sa,RA=ul,vv=RA("%ArrayBuffer%",!0),gm=SS("ArrayBuffer.prototype.byteLength",!0),NA=SS("Object.prototype.toString"),Px=!!vv&&!gm&&new vv(0).slice,Mx=!!Px&&DA(Px),ES=gm||Mx?function(t){if(!t||typeof t!="object")return!1;try{return gm?gm(t):Mx(t,0),!0}catch{return!1}}:vv?function(t){return NA(t)==="[object ArrayBuffer]"}:function(t){return!1},OA=Date.prototype.getDay,zA=function(t){try{return OA.call(t),!0}catch{return!1}},FA=Object.prototype.toString,BA="[object Date]",VA=kc(),UA=function(t){return typeof t!="object"||t===null?!1:VA?zA(t):FA.call(t)===BA},bv=sa,IS=kc(),CS,TS,xv,wv;if(IS){CS=bv("Object.prototype.hasOwnProperty"),TS=bv("RegExp.prototype.exec"),xv={};var W_=function(){throw xv};wv={toString:W_,valueOf:W_},typeof Symbol.toPrimitive=="symbol"&&(wv[Symbol.toPrimitive]=W_)}var GA=bv("Object.prototype.toString"),jA=Object.getOwnPropertyDescriptor,qA="[object RegExp]",WA=IS?function(t){if(!t||typeof t!="object")return!1;var n=jA(t,"lastIndex"),r=n&&CS(n,"value");if(!r)return!1;try{TS(t,wv)}catch(s){return s===xv}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:GA(t)===qA},ZA=sa,Ax=ZA("SharedArrayBuffer.prototype.byteLength",!0),HA=Ax?function(t){if(!t||typeof t!="object")return!1;try{return Ax(t),!0}catch{return!1}}:function(t){return!1},XA=Number.prototype.toString,YA=function(t){try{return XA.call(t),!0}catch{return!1}},KA=Object.prototype.toString,JA="[object Number]",QA=kc(),$A=function(t){return typeof t=="number"?!0:typeof t!="object"?!1:QA?YA(t):KA.call(t)===JA},LS=sa,tk=LS("Boolean.prototype.toString"),ek=LS("Object.prototype.toString"),nk=function(t){try{return tk(t),!0}catch{return!1}},rk="[object Boolean]",ik=kc(),ok=function(t){return typeof t=="boolean"?!0:t===null||typeof t!="object"?!1:ik&&Symbol.toStringTag in t?nk(t):ek(t)===rk},Sv={exports:{}},sk=Object.prototype.toString,ak=i0();if(ak){var lk=Symbol.prototype.toString,uk=/^Symbol\(.*\)$/,ck=function(t){return typeof t.valueOf()!="symbol"?!1:uk.test(lk.call(t))};Sv.exports=function(t){if(typeof t=="symbol")return!0;if(sk.call(t)!=="[object Symbol]")return!1;try{return ck(t)}catch{return!1}}}else Sv.exports=function(t){return!1};var hk=Sv.exports,Ev={exports:{}},kx=typeof BigInt<"u"&&BigInt,pk=function(){return typeof kx=="function"&&typeof BigInt=="function"&&typeof kx(42)=="bigint"&&typeof BigInt(42)=="bigint"},fk=pk();if(fk){var dk=BigInt.prototype.valueOf,gk=function(t){try{return dk.call(t),!0}catch{}return!1};Ev.exports=function(t){return t===null||typeof t>"u"||typeof t=="boolean"||typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="function"?!1:typeof t=="bigint"?!0:gk(t)}}else Ev.exports=function(t){return!1};var mk=Ev.exports,yk=dS,_k=$A,vk=ok,bk=hk,xk=mk,wk=function(t){if(t==null||typeof t!="object"&&typeof t!="function")return null;if(yk(t))return"String";if(_k(t))return"Number";if(vk(t))return"Boolean";if(bk(t))return"Symbol";if(xk(t))return"BigInt"},km=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,Dx=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,Dm;km||(Dm=function(t){return!1});var Iv=km?km.prototype.has:null,Z_=Dx?Dx.prototype.has:null;!Dm&&!Iv&&(Dm=function(t){return!1});var Sk=Dm||function(t){if(!t||typeof t!="object")return!1;try{if(Iv.call(t,Iv),Z_)try{Z_.call(t,Z_)}catch{return!0}return t instanceof km}catch{}return!1},Cv={exports:{}},Ek=ul,PS=sa,Ik=Ek("%WeakSet%",!0),H_=PS("WeakSet.prototype.has",!0);if(H_){var X_=PS("WeakMap.prototype.has",!0);Cv.exports=function(t){if(!t||typeof t!="object")return!1;try{if(H_(t,H_),X_)try{X_(t,X_)}catch{return!0}return t instanceof Ik}catch{}return!1}}else Cv.exports=function(t){return!1};var Ck=Cv.exports,Tk=mS,Lk=_S,Pk=Sk,Mk=Ck,Ak=function(t){if(t&&typeof t=="object"){if(Tk(t))return"Map";if(Lk(t))return"Set";if(Pk(t))return"WeakMap";if(Mk(t))return"WeakSet"}return!1},MS=Function.prototype.toString,Wh=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Tv,mm;if(typeof Wh=="function"&&typeof Object.defineProperty=="function")try{Tv=Object.defineProperty({},"length",{get:function(){throw mm}}),mm={},Wh(function(){throw 42},null,Tv)}catch(e){e!==mm&&(Wh=null)}else Wh=null;var kk=/^\s*class\b/,Lv=function(t){try{var n=MS.call(t);return kk.test(n)}catch{return!1}},Y_=function(t){try{return Lv(t)?!1:(MS.call(t),!0)}catch{return!1}},ym=Object.prototype.toString,Dk="[object Object]",Rk="[object Function]",Nk="[object GeneratorFunction]",Ok="[object HTMLAllCollection]",zk="[object HTML document.all class]",Fk="[object HTMLCollection]",Bk=typeof Symbol=="function"&&!!Symbol.toStringTag,Vk=!(0 in[,]),Pv=function(){return!1};if(typeof document=="object"){var Uk=document.all;ym.call(Uk)===ym.call(document.all)&&(Pv=function(t){if((Vk||!t)&&(typeof t>"u"||typeof t=="object"))try{var n=ym.call(t);return(n===Ok||n===zk||n===Fk||n===Dk)&&t("")==null}catch{}return!1})}var Gk=Wh?function(t){if(Pv(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Wh(t,null,Tv)}catch(n){if(n!==mm)return!1}return!Lv(t)&&Y_(t)}:function(t){if(Pv(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(Bk)return Y_(t);if(Lv(t))return!1;var n=ym.call(t);return n!==Rk&&n!==Nk&&!/^\[object HTML/.test(n)?!1:Y_(t)},jk=Gk,qk=Object.prototype.toString,AS=Object.prototype.hasOwnProperty,Wk=function(t,n,r){for(var s=0,l=t.length;s=3&&(s=r),qk.call(t)==="[object Array]"?Wk(t,n,s):typeof t=="string"?Zk(t,n,s):Hk(t,n,s)},Yk=Xk,Kk=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],K_=Kk,Jk=typeof globalThis>"u"?kd:globalThis,Qk=function(){for(var t=[],n=0;n"u"?kd:globalThis,Mv=$k(),_0=y0("String.prototype.slice"),J_=Object.getPrototypeOf,eD=y0("Array.prototype.indexOf",!0)||function(t,n){for(var r=0;r-1?n:n!=="Object"?!1:rD(t)}return _m?nD(t):null},oD=sa,Ox=oD("ArrayBuffer.prototype.byteLength",!0),sD=ES,aD=function(t){return sD(t)?Ox?Ox(t):t.byteLength:NaN},DS=BP,cl=sa,zx=uM,lD=ul,tp=SA,uD=pS,Fx=kA,Bx=iS,Vx=fS,Ux=ES,Gx=UA,jx=WA,qx=HA,Wx=r0,Zx=wk,Hx=Ak,Xx=iD,Yx=aD,Kx=cl("SharedArrayBuffer.prototype.byteLength",!0),Jx=cl("Date.prototype.getTime"),Q_=Object.getPrototypeOf,Qx=cl("Object.prototype.toString"),Om=lD("%Set%",!0),Av=cl("Map.prototype.has",!0),zm=cl("Map.prototype.get",!0),$x=cl("Map.prototype.size",!0),Fm=cl("Set.prototype.add",!0),RS=cl("Set.prototype.delete",!0),Bm=cl("Set.prototype.has",!0),vm=cl("Set.prototype.size",!0);function tw(e,t,n,r){for(var s=tp(e),l;(l=s.next())&&!l.done;)if(ba(t,l.value,n,r))return RS(e,l.value),!0;return!1}function NS(e){if(typeof e>"u")return null;if(typeof e!="object")return typeof e=="symbol"?!1:typeof e=="string"||typeof e=="number"?+e==+e:!0}function cD(e,t,n,r,s,l){var p=NS(n);if(p!=null)return p;var c=zm(t,p),y=DS({},s,{strict:!1});return typeof c>"u"&&!Av(t,p)||!ba(r,c,y,l)?!1:!Av(e,p)&&ba(r,c,y,l)}function hD(e,t,n){var r=NS(n);return r??(Bm(t,r)&&!Bm(e,r))}function ew(e,t,n,r,s,l){for(var p=tp(e),c,y;(c=p.next())&&!c.done;)if(y=c.value,ba(n,y,s,l)&&ba(r,zm(t,y),s,l))return RS(e,y),!0;return!1}function ba(e,t,n,r){var s=n||{};if(s.strict?Fx(e,t):e===t)return!0;var l=Zx(e),p=Zx(t);if(l!==p)return!1;if(!e||!t||typeof e!="object"&&typeof t!="object")return s.strict?Fx(e,t):e==t;var c=r.has(e),y=r.has(t),w;if(c&&y){if(r.get(e)===r.get(t))return!0}else w={};return c||r.set(e,w),y||r.set(t,w),dD(e,t,s,r)}function nw(e){return!e||typeof e!="object"||typeof e.length!="number"||typeof e.copy!="function"||typeof e.slice!="function"||e.length>0&&typeof e[0]!="number"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function pD(e,t,n,r){if(vm(e)!==vm(t))return!1;for(var s=tp(e),l=tp(t),p,c,y;(p=s.next())&&!p.done;)if(p.value&&typeof p.value=="object")y||(y=new Om),Fm(y,p.value);else if(!Bm(t,p.value)){if(n.strict||!hD(e,t,p.value))return!1;y||(y=new Om),Fm(y,p.value)}if(y){for(;(c=l.next())&&!c.done;)if(c.value&&typeof c.value=="object"){if(!tw(y,c.value,n.strict,r))return!1}else if(!n.strict&&!Bm(e,c.value)&&!tw(y,c.value,n.strict,r))return!1;return vm(y)===0}return!0}function fD(e,t,n,r){if($x(e)!==$x(t))return!1;for(var s=tp(e),l=tp(t),p,c,y,w,T,L;(p=s.next())&&!p.done;)if(w=p.value[0],T=p.value[1],w&&typeof w=="object")y||(y=new Om),Fm(y,w);else if(L=zm(t,w),typeof L>"u"&&!Av(t,w)||!ba(T,L,n,r)){if(n.strict||!cD(e,t,w,T,n,r))return!1;y||(y=new Om),Fm(y,w)}if(y){for(;(c=l.next())&&!c.done;)if(w=c.value[0],L=c.value[1],w&&typeof w=="object"){if(!ew(y,e,w,L,n,r))return!1}else if(!n.strict&&(!e.has(w)||!ba(zm(e,w),L,n,r))&&!ew(y,e,w,L,DS({},n,{strict:!1}),r))return!1;return vm(y)===0}return!0}function dD(e,t,n,r){var s,l;if(typeof e!=typeof t||e==null||t==null||Qx(e)!==Qx(t)||Bx(e)!==Bx(t))return!1;var p=Vx(e),c=Vx(t);if(p!==c)return!1;var y=e instanceof Error,w=t instanceof Error;if(y!==w||(y||w)&&(e.name!==t.name||e.message!==t.message))return!1;var T=jx(e),L=jx(t);if(T!==L||(T||L)&&(e.source!==t.source||zx(e)!==zx(t)))return!1;var A=Gx(e),z=Gx(t);if(A!==z||(A||z)&&Jx(e)!==Jx(t)||n.strict&&Q_&&Q_(e)!==Q_(t))return!1;var B=Xx(e),Y=Xx(t);if(B!==Y)return!1;if(B||Y){if(e.length!==t.length)return!1;for(s=0;s=0;s--)if(_t[s]!=ct[s])return!1;for(s=_t.length-1;s>=0;s--)if(l=_t[s],!ba(e[l],t[l],n,r))return!1;var bt=Hx(e),It=Hx(t);return bt!==It?!1:bt==="Set"||It==="Set"?pD(e,t,n,r):bt==="Map"?fD(e,t,n,r):!0}var gD=function(t,n,r){return ba(t,n,r,uD())};const mD=$v(gD);var yD=Object.defineProperty,Yn=(e,t)=>yD(e,"name",{value:t,configurable:!0}),_D=class{constructor(t){this.direction=!1,this.compareProperties=!0;var n,r,s;this.precision=10**-((n=t==null?void 0:t.precision)!=null?n:17),this.direction=(r=t==null?void 0:t.direction)!=null?r:!1,this.compareProperties=(s=t==null?void 0:t.compareProperties)!=null?s:!0}compare(t,n){if(t.type!==n.type||!Xf(t,n))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,n.coordinates);case"LineString":return this.compareLine(t.coordinates,n.coordinates);case"Polygon":return this.comparePolygon(t,n);case"GeometryCollection":return this.compareGeometryCollection(t,n);case"Feature":return this.compareFeature(t,n);case"FeatureCollection":return this.compareFeatureCollection(t,n);default:if(t.type.startsWith("Multi")){const r=kv(t),s=kv(n);return r.every(l=>s.some(p=>this.compare(l,p)))}}return!1}compareCoord(t,n){return t.length===n.length&&t.every((r,s)=>Math.abs(r-n[s])=0&&(r=[].concat(t.slice(s,t.length),t.slice(1,s+1))),r}comparePath(t,n){return t.every((r,s)=>this.compareCoord(r,n[s]))}comparePolygon(t,n){if(this.compareLine(t.coordinates[0],n.coordinates[0],1,!0)){const r=t.coordinates.slice(1,t.coordinates.length),s=n.coordinates.slice(1,n.coordinates.length);return r.every(l=>s.some(p=>this.compareLine(l,p,1,!0)))}return!1}compareGeometryCollection(t,n){return Xf(t.geometries,n.geometries)&&this.compareBBox(t,n)&&t.geometries.every((r,s)=>this.compare(r,n.geometries[s]))}compareFeature(t,n){return t.id===n.id&&(this.compareProperties?mD(t.properties,n.properties):!0)&&this.compareBBox(t,n)&&this.compare(t.geometry,n.geometry)}compareFeatureCollection(t,n){return Xf(t.features,n.features)&&this.compareBBox(t,n)&&t.features.every((r,s)=>this.compare(r,n.features[s]))}compareBBox(t,n){return!t.bbox&&!n.bbox||(t.bbox&&n.bbox?this.compareCoord(t.bbox,n.bbox):!1)}};Yn(_D,"GeojsonEquality");function Xf(e,t){return e.coordinates?e.coordinates.length===t.coordinates.length:e.length===t.length}Yn(Xf,"sameLength");function kv(e){return e.coordinates.map(t=>({type:e.type.replace("Multi",""),coordinates:t}))}Yn(kv,"explode");var fs=63710088e-1,OS={centimeters:fs*100,centimetres:fs*100,degrees:360/(2*Math.PI),feet:fs*3.28084,inches:fs*39.37,kilometers:fs/1e3,kilometres:fs/1e3,meters:fs,metres:fs,miles:fs/1609.344,millimeters:fs*1e3,millimetres:fs*1e3,nauticalmiles:fs/1852,radians:1,yards:fs*1.0936},rw={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 el(e,t,n={}){const r={type:"Feature"};return(n.id===0||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}Yn(el,"feature");function vD(e,t,n={}){switch(e){case"Point":return Al(t).geometry;case"LineString":return Dl(t).geometry;case"Polygon":return v0(t).geometry;case"MultiPoint":return FS(t).geometry;case"MultiLineString":return zS(t).geometry;case"MultiPolygon":return BS(t).geometry;default:throw new Error(e+" is invalid")}}Yn(vD,"geometry");function Al(e,t,n={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Vm(e[0])||!Vm(e[1]))throw new Error("coordinates must contain numbers");return el({type:"Point",coordinates:e},t,n)}Yn(Al,"point");function bD(e,t,n={}){return ay(e.map(r=>Al(r,t)),n)}Yn(bD,"points");function v0(e,t,n={}){for(const s of e){if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(s[s.length-1].length!==s[0].length)throw new Error("First and last Position are not equivalent.");for(let l=0;lv0(r,t)),n)}Yn(xD,"polygons");function Dl(e,t,n={}){if(e.length<2)throw new Error("coordinates must be an array of two or more positions");return el({type:"LineString",coordinates:e},t,n)}Yn(Dl,"lineString");function wD(e,t,n={}){return ay(e.map(r=>Dl(r,t)),n)}Yn(wD,"lineStrings");function ay(e,t={}){const n={type:"FeatureCollection"};return t.id&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.features=e,n}Yn(ay,"featureCollection");function zS(e,t,n={}){return el({type:"MultiLineString",coordinates:e},t,n)}Yn(zS,"multiLineString");function FS(e,t,n={}){return el({type:"MultiPoint",coordinates:e},t,n)}Yn(FS,"multiPoint");function BS(e,t,n={}){return el({type:"MultiPolygon",coordinates:e},t,n)}Yn(BS,"multiPolygon");function SD(e,t,n={}){return el({type:"GeometryCollection",geometries:e},t,n)}Yn(SD,"geometryCollection");function ED(e,t=0){if(t&&!(t>=0))throw new Error("precision must be a positive number");const n=Math.pow(10,t||0);return Math.round(e*n)/n}Yn(ED,"round");function VS(e,t="kilometers"){const n=OS[t];if(!n)throw new Error(t+" units is invalid");return e*n}Yn(VS,"radiansToLength");function b0(e,t="kilometers"){const n=OS[t];if(!n)throw new Error(t+" units is invalid");return e/n}Yn(b0,"lengthToRadians");function ID(e,t){return US(b0(e,t))}Yn(ID,"lengthToDegrees");function CD(e){let t=e%360;return t<0&&(t+=360),t}Yn(CD,"bearingToAzimuth");function US(e){return e%(2*Math.PI)*180/Math.PI}Yn(US,"radiansToDegrees");function TD(e){return e%360*Math.PI/180}Yn(TD,"degreesToRadians");function LD(e,t="kilometers",n="kilometers"){if(!(e>=0))throw new Error("length must be a positive number");return VS(b0(e,t),n)}Yn(LD,"convertLength");function PD(e,t="meters",n="kilometers"){if(!(e>=0))throw new Error("area must be a positive number");const r=rw[t];if(!r)throw new Error("invalid original units");const s=rw[n];if(!s)throw new Error("invalid final units");return e/r*s}Yn(PD,"convertArea");function Vm(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}Yn(Vm,"isNumber");function x0(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}Yn(x0,"isObject");function MD(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(e.length!==4&&e.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(t=>{if(!Vm(t))throw new Error("bbox must only contain numbers")})}Yn(MD,"validateBBox");function AD(e){if(!e)throw new Error("id is required");if(["string","number"].indexOf(typeof e)===-1)throw new Error("id must be a number or a string")}Yn(AD,"validateId");var kD=Object.defineProperty,$i=(e,t)=>kD(e,"name",{value:t,configurable:!0});function Lp(e,t,n){if(e!==null)for(var r,s,l,p,c,y,w,T=0,L=0,A,z=e.type,B=z==="FeatureCollection",Y=z==="Feature",et=B?e.features.length:1,at=0;aty||B>w||Y>T){c=L,y=r,w=B,T=Y,l=0;return}var et=Dl([c,L],n.properties);if(t(et,r,s,Y,l)===!1)return!1;l++,c=L})===!1)return!1}}})}$i(qS,"segmentEach");function BD(e,t,n){var r=n,s=!1;return qS(e,function(l,p,c,y,w){s===!1&&n===void 0?r=l:r=t(r,l,p,c,y,w),s=!0}),r}$i(BD,"segmentReduce");function WS(e,t){if(!e)throw new Error("geojson is required");ly(e,function(n,r,s){if(n.geometry!==null){var l=n.geometry.type,p=n.geometry.coordinates;switch(l){case"LineString":if(t(n,r,s,0,0)===!1)return!1;break;case"Polygon":for(var c=0;cjD(e,"name",{value:t,configurable:!0});function S0(e,t={}){if(e.bbox!=null&&t.recompute!==!0)return e.bbox;const n=[1/0,1/0,-1/0,-1/0];return Lp(e,r=>{n[0]>r[0]&&(n[0]=r[0]),n[1]>r[1]&&(n[1]=r[1]),n[2]t in e?ZD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iw=(e,t,n)=>(HD(e,typeof t!="symbol"?t+"":t,n),n);function ud(){}function HS(e){return e()}function ow(){return Object.create(null)}function uy(e){e.forEach(HS)}function XS(e){return typeof e=="function"}function XD(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function YD(e){return Object.keys(e).length===0}function KD(e,t){e.appendChild(t)}function JD(e,t,n){e.insertBefore(t,n||null)}function YS(e){e.parentNode&&e.parentNode.removeChild(e)}function sw(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function mu(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function QD(e){return Array.from(e.childNodes)}function rm(e,t,n){e.classList.toggle(t,!!n)}let E0;function id(e){E0=e}const qh=[],aw=[];let Yh=[];const lw=[],$D=Promise.resolve();let Dv=!1;function tR(){Dv||(Dv=!0,$D.then(KS))}function Rv(e){Yh.push(e)}const $_=new Set;let Vh=0;function KS(){if(Vh!==0)return;const e=E0;do{try{for(;Vhe.indexOf(r)===-1?t.push(r):n.push(r)),n.forEach(r=>r()),Yh=t}const rR=new Set;function iR(e,t){e&&e.i&&(rR.delete(e),e.i(t))}function oR(e,t,n){const{fragment:r,after_update:s}=e.$$;r&&r.m(t,n),Rv(()=>{const l=e.$$.on_mount.map(HS).filter(XS);e.$$.on_destroy?e.$$.on_destroy.push(...l):uy(l),e.$$.on_mount=[]}),s.forEach(Rv)}function sR(e,t){const n=e.$$;n.fragment!==null&&(nR(n.after_update),uy(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function aR(e,t){e.$$.dirty[0]===-1&&(qh.push(e),tR(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const B=z.length?z[0]:A;return w.ctx&&s(w.ctx[L],w.ctx[L]=B)&&(!w.skip_bound&&w.bound[L]&&w.bound[L](B),T&&aR(e,L)),A}):[],w.update(),T=!0,uy(w.before_update),w.fragment=r?r(w.ctx):!1,t.target){if(t.hydrate){const L=QD(t.target);w.fragment&&w.fragment.l(L),L.forEach(YS)}else w.fragment&&w.fragment.c();t.intro&&iR(e.$$.fragment),oR(e,t.target,t.anchor),KS()}id(y)}class uR{constructor(){iw(this,"$$"),iw(this,"$$set")}$destroy(){sR(this,1),this.$destroy=ud}$on(t,n){if(!XS(n))return ud;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const s=r.indexOf(n);s!==-1&&r.splice(s,1)}}$set(t){this.$$set&&!YD(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const cR="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(cR);function hR(e){let t,n,r;return{c(){t=sw("svg"),n=sw("path"),mu(n,"stroke-width","4"),mu(n,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),mu(n,"class","svelte-gzo3ar"),mu(t,"width",r=e[0]==="list"?20:void 0),mu(t,"viewBox","0 0 70 85"),mu(t,"fill","none"),mu(t,"class","svelte-gzo3ar"),rm(t,"in-map",e[0]!=="list"),rm(t,"list-icon",e[0]==="list")},m(s,l){JD(s,t,l),KD(t,n)},p(s,[l]){l&1&&r!==(r=s[0]==="list"?20:void 0)&&mu(t,"width",r),l&1&&rm(t,"in-map",s[0]!=="list"),l&1&&rm(t,"list-icon",s[0]==="list")},i:ud,o:ud,d(s){s&&YS(t)}}}function pR(e,t,n){let{displayIn:r}=t;return e.$$set=s=>{"displayIn"in s&&n(0,r=s.displayIn)},[r]}class fR extends uR{constructor(t){super(),lR(this,t,pR,hR,XD,{displayIn:0})}}const dR=[{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"}],gR={decimalLatitude:40.123,decimalLongitude:-74.123},mR=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],yR=[{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}];function _R(){const e=[];return dR.forEach(t=>{t.decimalLatitude?e.push(t):e.push({...t,...gR})}),[...e,...mR,...yR]}const vR=_R();vR.map(e=>e.verbatimCoordinates);/** +`+t.prev}function tm(e,t){var n=yv(e),r=[];if(n){r.length=e.length;for(var s=0;s=r)return n+1;var s=bx(t,n);if(s<55296||s>56319)return n+1;var l=bx(t,n+1);return l<56320||l>57343?n+1:n+2},q_=function(t){var n=0;return{next:function(){var s=n>=t.length,l;return s||(l=t[n],n+=1),{done:s,value:l}}}},xx=function(t,n){if(dA(t)||mx(t))return q_(t);if(gA(t)){var r=0;return{next:function(){var l=vA(t,r),p=_A(t,r,l);return r=l,{done:l>t.length,value:p}}}}if(n&&typeof t["_es6-shim iterator_"]<"u")return t["_es6-shim iterator_"]()};if(!mA&&!yA)dm.exports=function(t){if(t!=null)return xx(t,!0)};else{var bA=mS,xA=_S,wx=ya("Map.prototype.forEach",!0),Sx=ya("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var Ex=ya("Map.prototype.iterator",!0),Ix=ya("Set.prototype.iterator",!0);var Cx=ya("Map.prototype.@@iterator",!0)||ya("Map.prototype._es6-shim iterator_",!0),Tx=ya("Set.prototype.@@iterator",!0)||ya("Set.prototype._es6-shim iterator_",!0),wA=function(t){if(bA(t)){if(Ex)return yx(Ex(t));if(Cx)return Cx(t);if(wx){var n=[];return wx(t,function(s,l){vx(n,[l,s])}),q_(n)}}if(xA(t)){if(Ix)return yx(Ix(t));if(Tx)return Tx(t);if(Sx){var r=[];return Sx(t,function(s){vx(r,s)}),q_(r)}}};dm.exports=function(t){return wA(t)||xx(t)}}}var SA=dm.exports,Lx=function(e){return e!==e},vS=function(t,n){return t===0&&n===0?1/t===1/n:!!(t===n||Lx(t)&&Lx(n))},EA=vS,bS=function(){return typeof Object.is=="function"?Object.is:EA},IA=bS,CA=Ac,TA=function(){var t=IA();return CA(Object,{is:t},{is:function(){return Object.is!==t}}),t},LA=Ac,PA=Cp,MA=vS,xS=bS,AA=TA,wS=PA(xS(),Object);LA(wS,{getPolyfill:xS,implementation:MA,shim:AA});var kA=wS,DA=Cp,SS=sa,RA=ul,vv=RA("%ArrayBuffer%",!0),gm=SS("ArrayBuffer.prototype.byteLength",!0),NA=SS("Object.prototype.toString"),Px=!!vv&&!gm&&new vv(0).slice,Mx=!!Px&&DA(Px),ES=gm||Mx?function(t){if(!t||typeof t!="object")return!1;try{return gm?gm(t):Mx(t,0),!0}catch{return!1}}:vv?function(t){return NA(t)==="[object ArrayBuffer]"}:function(t){return!1},OA=Date.prototype.getDay,zA=function(t){try{return OA.call(t),!0}catch{return!1}},FA=Object.prototype.toString,BA="[object Date]",VA=kc(),UA=function(t){return typeof t!="object"||t===null?!1:VA?zA(t):FA.call(t)===BA},bv=sa,IS=kc(),CS,TS,xv,wv;if(IS){CS=bv("Object.prototype.hasOwnProperty"),TS=bv("RegExp.prototype.exec"),xv={};var W_=function(){throw xv};wv={toString:W_,valueOf:W_},typeof Symbol.toPrimitive=="symbol"&&(wv[Symbol.toPrimitive]=W_)}var GA=bv("Object.prototype.toString"),jA=Object.getOwnPropertyDescriptor,qA="[object RegExp]",WA=IS?function(t){if(!t||typeof t!="object")return!1;var n=jA(t,"lastIndex"),r=n&&CS(n,"value");if(!r)return!1;try{TS(t,wv)}catch(s){return s===xv}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:GA(t)===qA},ZA=sa,Ax=ZA("SharedArrayBuffer.prototype.byteLength",!0),HA=Ax?function(t){if(!t||typeof t!="object")return!1;try{return Ax(t),!0}catch{return!1}}:function(t){return!1},XA=Number.prototype.toString,YA=function(t){try{return XA.call(t),!0}catch{return!1}},KA=Object.prototype.toString,JA="[object Number]",QA=kc(),$A=function(t){return typeof t=="number"?!0:typeof t!="object"?!1:QA?YA(t):KA.call(t)===JA},LS=sa,tk=LS("Boolean.prototype.toString"),ek=LS("Object.prototype.toString"),nk=function(t){try{return tk(t),!0}catch{return!1}},rk="[object Boolean]",ik=kc(),ok=function(t){return typeof t=="boolean"?!0:t===null||typeof t!="object"?!1:ik&&Symbol.toStringTag in t?nk(t):ek(t)===rk},Sv={exports:{}},sk=Object.prototype.toString,ak=i0();if(ak){var lk=Symbol.prototype.toString,uk=/^Symbol\(.*\)$/,ck=function(t){return typeof t.valueOf()!="symbol"?!1:uk.test(lk.call(t))};Sv.exports=function(t){if(typeof t=="symbol")return!0;if(sk.call(t)!=="[object Symbol]")return!1;try{return ck(t)}catch{return!1}}}else Sv.exports=function(t){return!1};var hk=Sv.exports,Ev={exports:{}},kx=typeof BigInt<"u"&&BigInt,pk=function(){return typeof kx=="function"&&typeof BigInt=="function"&&typeof kx(42)=="bigint"&&typeof BigInt(42)=="bigint"},fk=pk();if(fk){var dk=BigInt.prototype.valueOf,gk=function(t){try{return dk.call(t),!0}catch{}return!1};Ev.exports=function(t){return t===null||typeof t>"u"||typeof t=="boolean"||typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="function"?!1:typeof t=="bigint"?!0:gk(t)}}else Ev.exports=function(t){return!1};var mk=Ev.exports,yk=dS,_k=$A,vk=ok,bk=hk,xk=mk,wk=function(t){if(t==null||typeof t!="object"&&typeof t!="function")return null;if(yk(t))return"String";if(_k(t))return"Number";if(vk(t))return"Boolean";if(bk(t))return"Symbol";if(xk(t))return"BigInt"},km=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,Dx=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,Dm;km||(Dm=function(t){return!1});var Iv=km?km.prototype.has:null,Z_=Dx?Dx.prototype.has:null;!Dm&&!Iv&&(Dm=function(t){return!1});var Sk=Dm||function(t){if(!t||typeof t!="object")return!1;try{if(Iv.call(t,Iv),Z_)try{Z_.call(t,Z_)}catch{return!0}return t instanceof km}catch{}return!1},Cv={exports:{}},Ek=ul,PS=sa,Ik=Ek("%WeakSet%",!0),H_=PS("WeakSet.prototype.has",!0);if(H_){var X_=PS("WeakMap.prototype.has",!0);Cv.exports=function(t){if(!t||typeof t!="object")return!1;try{if(H_(t,H_),X_)try{X_(t,X_)}catch{return!0}return t instanceof Ik}catch{}return!1}}else Cv.exports=function(t){return!1};var Ck=Cv.exports,Tk=mS,Lk=_S,Pk=Sk,Mk=Ck,Ak=function(t){if(t&&typeof t=="object"){if(Tk(t))return"Map";if(Lk(t))return"Set";if(Pk(t))return"WeakMap";if(Mk(t))return"WeakSet"}return!1},MS=Function.prototype.toString,Wh=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Tv,mm;if(typeof Wh=="function"&&typeof Object.defineProperty=="function")try{Tv=Object.defineProperty({},"length",{get:function(){throw mm}}),mm={},Wh(function(){throw 42},null,Tv)}catch(e){e!==mm&&(Wh=null)}else Wh=null;var kk=/^\s*class\b/,Lv=function(t){try{var n=MS.call(t);return kk.test(n)}catch{return!1}},Y_=function(t){try{return Lv(t)?!1:(MS.call(t),!0)}catch{return!1}},ym=Object.prototype.toString,Dk="[object Object]",Rk="[object Function]",Nk="[object GeneratorFunction]",Ok="[object HTMLAllCollection]",zk="[object HTML document.all class]",Fk="[object HTMLCollection]",Bk=typeof Symbol=="function"&&!!Symbol.toStringTag,Vk=!(0 in[,]),Pv=function(){return!1};if(typeof document=="object"){var Uk=document.all;ym.call(Uk)===ym.call(document.all)&&(Pv=function(t){if((Vk||!t)&&(typeof t>"u"||typeof t=="object"))try{var n=ym.call(t);return(n===Ok||n===zk||n===Fk||n===Dk)&&t("")==null}catch{}return!1})}var Gk=Wh?function(t){if(Pv(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Wh(t,null,Tv)}catch(n){if(n!==mm)return!1}return!Lv(t)&&Y_(t)}:function(t){if(Pv(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(Bk)return Y_(t);if(Lv(t))return!1;var n=ym.call(t);return n!==Rk&&n!==Nk&&!/^\[object HTML/.test(n)?!1:Y_(t)},jk=Gk,qk=Object.prototype.toString,AS=Object.prototype.hasOwnProperty,Wk=function(t,n,r){for(var s=0,l=t.length;s=3&&(s=r),qk.call(t)==="[object Array]"?Wk(t,n,s):typeof t=="string"?Zk(t,n,s):Hk(t,n,s)},Yk=Xk,Kk=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],K_=Kk,Jk=typeof globalThis>"u"?kd:globalThis,Qk=function(){for(var t=[],n=0;n"u"?kd:globalThis,Mv=$k(),_0=y0("String.prototype.slice"),J_=Object.getPrototypeOf,eD=y0("Array.prototype.indexOf",!0)||function(t,n){for(var r=0;r-1?n:n!=="Object"?!1:rD(t)}return _m?nD(t):null},oD=sa,Ox=oD("ArrayBuffer.prototype.byteLength",!0),sD=ES,aD=function(t){return sD(t)?Ox?Ox(t):t.byteLength:NaN},DS=BP,cl=sa,zx=uM,lD=ul,$h=SA,uD=pS,Fx=kA,Bx=iS,Vx=fS,Ux=ES,Gx=UA,jx=WA,qx=HA,Wx=r0,Zx=wk,Hx=Ak,Xx=iD,Yx=aD,Kx=cl("SharedArrayBuffer.prototype.byteLength",!0),Jx=cl("Date.prototype.getTime"),Q_=Object.getPrototypeOf,Qx=cl("Object.prototype.toString"),Om=lD("%Set%",!0),Av=cl("Map.prototype.has",!0),zm=cl("Map.prototype.get",!0),$x=cl("Map.prototype.size",!0),Fm=cl("Set.prototype.add",!0),RS=cl("Set.prototype.delete",!0),Bm=cl("Set.prototype.has",!0),vm=cl("Set.prototype.size",!0);function tw(e,t,n,r){for(var s=$h(e),l;(l=s.next())&&!l.done;)if(ba(t,l.value,n,r))return RS(e,l.value),!0;return!1}function NS(e){if(typeof e>"u")return null;if(typeof e!="object")return typeof e=="symbol"?!1:typeof e=="string"||typeof e=="number"?+e==+e:!0}function cD(e,t,n,r,s,l){var p=NS(n);if(p!=null)return p;var c=zm(t,p),y=DS({},s,{strict:!1});return typeof c>"u"&&!Av(t,p)||!ba(r,c,y,l)?!1:!Av(e,p)&&ba(r,c,y,l)}function hD(e,t,n){var r=NS(n);return r??(Bm(t,r)&&!Bm(e,r))}function ew(e,t,n,r,s,l){for(var p=$h(e),c,y;(c=p.next())&&!c.done;)if(y=c.value,ba(n,y,s,l)&&ba(r,zm(t,y),s,l))return RS(e,y),!0;return!1}function ba(e,t,n,r){var s=n||{};if(s.strict?Fx(e,t):e===t)return!0;var l=Zx(e),p=Zx(t);if(l!==p)return!1;if(!e||!t||typeof e!="object"&&typeof t!="object")return s.strict?Fx(e,t):e==t;var c=r.has(e),y=r.has(t),w;if(c&&y){if(r.get(e)===r.get(t))return!0}else w={};return c||r.set(e,w),y||r.set(t,w),dD(e,t,s,r)}function nw(e){return!e||typeof e!="object"||typeof e.length!="number"||typeof e.copy!="function"||typeof e.slice!="function"||e.length>0&&typeof e[0]!="number"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function pD(e,t,n,r){if(vm(e)!==vm(t))return!1;for(var s=$h(e),l=$h(t),p,c,y;(p=s.next())&&!p.done;)if(p.value&&typeof p.value=="object")y||(y=new Om),Fm(y,p.value);else if(!Bm(t,p.value)){if(n.strict||!hD(e,t,p.value))return!1;y||(y=new Om),Fm(y,p.value)}if(y){for(;(c=l.next())&&!c.done;)if(c.value&&typeof c.value=="object"){if(!tw(y,c.value,n.strict,r))return!1}else if(!n.strict&&!Bm(e,c.value)&&!tw(y,c.value,n.strict,r))return!1;return vm(y)===0}return!0}function fD(e,t,n,r){if($x(e)!==$x(t))return!1;for(var s=$h(e),l=$h(t),p,c,y,w,T,L;(p=s.next())&&!p.done;)if(w=p.value[0],T=p.value[1],w&&typeof w=="object")y||(y=new Om),Fm(y,w);else if(L=zm(t,w),typeof L>"u"&&!Av(t,w)||!ba(T,L,n,r)){if(n.strict||!cD(e,t,w,T,n,r))return!1;y||(y=new Om),Fm(y,w)}if(y){for(;(c=l.next())&&!c.done;)if(w=c.value[0],L=c.value[1],w&&typeof w=="object"){if(!ew(y,e,w,L,n,r))return!1}else if(!n.strict&&(!e.has(w)||!ba(zm(e,w),L,n,r))&&!ew(y,e,w,L,DS({},n,{strict:!1}),r))return!1;return vm(y)===0}return!0}function dD(e,t,n,r){var s,l;if(typeof e!=typeof t||e==null||t==null||Qx(e)!==Qx(t)||Bx(e)!==Bx(t))return!1;var p=Vx(e),c=Vx(t);if(p!==c)return!1;var y=e instanceof Error,w=t instanceof Error;if(y!==w||(y||w)&&(e.name!==t.name||e.message!==t.message))return!1;var T=jx(e),L=jx(t);if(T!==L||(T||L)&&(e.source!==t.source||zx(e)!==zx(t)))return!1;var A=Gx(e),z=Gx(t);if(A!==z||(A||z)&&Jx(e)!==Jx(t)||n.strict&&Q_&&Q_(e)!==Q_(t))return!1;var B=Xx(e),Y=Xx(t);if(B!==Y)return!1;if(B||Y){if(e.length!==t.length)return!1;for(s=0;s=0;s--)if(_t[s]!=ct[s])return!1;for(s=_t.length-1;s>=0;s--)if(l=_t[s],!ba(e[l],t[l],n,r))return!1;var bt=Hx(e),It=Hx(t);return bt!==It?!1:bt==="Set"||It==="Set"?pD(e,t,n,r):bt==="Map"?fD(e,t,n,r):!0}var gD=function(t,n,r){return ba(t,n,r,uD())};const mD=$v(gD);var yD=Object.defineProperty,Yn=(e,t)=>yD(e,"name",{value:t,configurable:!0}),_D=class{constructor(t){this.direction=!1,this.compareProperties=!0;var n,r,s;this.precision=10**-((n=t==null?void 0:t.precision)!=null?n:17),this.direction=(r=t==null?void 0:t.direction)!=null?r:!1,this.compareProperties=(s=t==null?void 0:t.compareProperties)!=null?s:!0}compare(t,n){if(t.type!==n.type||!Xf(t,n))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,n.coordinates);case"LineString":return this.compareLine(t.coordinates,n.coordinates);case"Polygon":return this.comparePolygon(t,n);case"GeometryCollection":return this.compareGeometryCollection(t,n);case"Feature":return this.compareFeature(t,n);case"FeatureCollection":return this.compareFeatureCollection(t,n);default:if(t.type.startsWith("Multi")){const r=kv(t),s=kv(n);return r.every(l=>s.some(p=>this.compare(l,p)))}}return!1}compareCoord(t,n){return t.length===n.length&&t.every((r,s)=>Math.abs(r-n[s])=0&&(r=[].concat(t.slice(s,t.length),t.slice(1,s+1))),r}comparePath(t,n){return t.every((r,s)=>this.compareCoord(r,n[s]))}comparePolygon(t,n){if(this.compareLine(t.coordinates[0],n.coordinates[0],1,!0)){const r=t.coordinates.slice(1,t.coordinates.length),s=n.coordinates.slice(1,n.coordinates.length);return r.every(l=>s.some(p=>this.compareLine(l,p,1,!0)))}return!1}compareGeometryCollection(t,n){return Xf(t.geometries,n.geometries)&&this.compareBBox(t,n)&&t.geometries.every((r,s)=>this.compare(r,n.geometries[s]))}compareFeature(t,n){return t.id===n.id&&(this.compareProperties?mD(t.properties,n.properties):!0)&&this.compareBBox(t,n)&&this.compare(t.geometry,n.geometry)}compareFeatureCollection(t,n){return Xf(t.features,n.features)&&this.compareBBox(t,n)&&t.features.every((r,s)=>this.compare(r,n.features[s]))}compareBBox(t,n){return!t.bbox&&!n.bbox||(t.bbox&&n.bbox?this.compareCoord(t.bbox,n.bbox):!1)}};Yn(_D,"GeojsonEquality");function Xf(e,t){return e.coordinates?e.coordinates.length===t.coordinates.length:e.length===t.length}Yn(Xf,"sameLength");function kv(e){return e.coordinates.map(t=>({type:e.type.replace("Multi",""),coordinates:t}))}Yn(kv,"explode");var fs=63710088e-1,OS={centimeters:fs*100,centimetres:fs*100,degrees:360/(2*Math.PI),feet:fs*3.28084,inches:fs*39.37,kilometers:fs/1e3,kilometres:fs/1e3,meters:fs,metres:fs,miles:fs/1609.344,millimeters:fs*1e3,millimetres:fs*1e3,nauticalmiles:fs/1852,radians:1,yards:fs*1.0936},rw={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 el(e,t,n={}){const r={type:"Feature"};return(n.id===0||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}Yn(el,"feature");function vD(e,t,n={}){switch(e){case"Point":return Al(t).geometry;case"LineString":return Dl(t).geometry;case"Polygon":return v0(t).geometry;case"MultiPoint":return FS(t).geometry;case"MultiLineString":return zS(t).geometry;case"MultiPolygon":return BS(t).geometry;default:throw new Error(e+" is invalid")}}Yn(vD,"geometry");function Al(e,t,n={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Vm(e[0])||!Vm(e[1]))throw new Error("coordinates must contain numbers");return el({type:"Point",coordinates:e},t,n)}Yn(Al,"point");function bD(e,t,n={}){return ay(e.map(r=>Al(r,t)),n)}Yn(bD,"points");function v0(e,t,n={}){for(const s of e){if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(s[s.length-1].length!==s[0].length)throw new Error("First and last Position are not equivalent.");for(let l=0;lv0(r,t)),n)}Yn(xD,"polygons");function Dl(e,t,n={}){if(e.length<2)throw new Error("coordinates must be an array of two or more positions");return el({type:"LineString",coordinates:e},t,n)}Yn(Dl,"lineString");function wD(e,t,n={}){return ay(e.map(r=>Dl(r,t)),n)}Yn(wD,"lineStrings");function ay(e,t={}){const n={type:"FeatureCollection"};return t.id&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.features=e,n}Yn(ay,"featureCollection");function zS(e,t,n={}){return el({type:"MultiLineString",coordinates:e},t,n)}Yn(zS,"multiLineString");function FS(e,t,n={}){return el({type:"MultiPoint",coordinates:e},t,n)}Yn(FS,"multiPoint");function BS(e,t,n={}){return el({type:"MultiPolygon",coordinates:e},t,n)}Yn(BS,"multiPolygon");function SD(e,t,n={}){return el({type:"GeometryCollection",geometries:e},t,n)}Yn(SD,"geometryCollection");function ED(e,t=0){if(t&&!(t>=0))throw new Error("precision must be a positive number");const n=Math.pow(10,t||0);return Math.round(e*n)/n}Yn(ED,"round");function VS(e,t="kilometers"){const n=OS[t];if(!n)throw new Error(t+" units is invalid");return e*n}Yn(VS,"radiansToLength");function b0(e,t="kilometers"){const n=OS[t];if(!n)throw new Error(t+" units is invalid");return e/n}Yn(b0,"lengthToRadians");function ID(e,t){return US(b0(e,t))}Yn(ID,"lengthToDegrees");function CD(e){let t=e%360;return t<0&&(t+=360),t}Yn(CD,"bearingToAzimuth");function US(e){return e%(2*Math.PI)*180/Math.PI}Yn(US,"radiansToDegrees");function TD(e){return e%360*Math.PI/180}Yn(TD,"degreesToRadians");function LD(e,t="kilometers",n="kilometers"){if(!(e>=0))throw new Error("length must be a positive number");return VS(b0(e,t),n)}Yn(LD,"convertLength");function PD(e,t="meters",n="kilometers"){if(!(e>=0))throw new Error("area must be a positive number");const r=rw[t];if(!r)throw new Error("invalid original units");const s=rw[n];if(!s)throw new Error("invalid final units");return e/r*s}Yn(PD,"convertArea");function Vm(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}Yn(Vm,"isNumber");function x0(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}Yn(x0,"isObject");function MD(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(e.length!==4&&e.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(t=>{if(!Vm(t))throw new Error("bbox must only contain numbers")})}Yn(MD,"validateBBox");function AD(e){if(!e)throw new Error("id is required");if(["string","number"].indexOf(typeof e)===-1)throw new Error("id must be a number or a string")}Yn(AD,"validateId");var kD=Object.defineProperty,$i=(e,t)=>kD(e,"name",{value:t,configurable:!0});function Lp(e,t,n){if(e!==null)for(var r,s,l,p,c,y,w,T=0,L=0,A,z=e.type,B=z==="FeatureCollection",Y=z==="Feature",et=B?e.features.length:1,at=0;aty||B>w||Y>T){c=L,y=r,w=B,T=Y,l=0;return}var et=Dl([c,L],n.properties);if(t(et,r,s,Y,l)===!1)return!1;l++,c=L})===!1)return!1}}})}$i(qS,"segmentEach");function BD(e,t,n){var r=n,s=!1;return qS(e,function(l,p,c,y,w){s===!1&&n===void 0?r=l:r=t(r,l,p,c,y,w),s=!0}),r}$i(BD,"segmentReduce");function WS(e,t){if(!e)throw new Error("geojson is required");ly(e,function(n,r,s){if(n.geometry!==null){var l=n.geometry.type,p=n.geometry.coordinates;switch(l){case"LineString":if(t(n,r,s,0,0)===!1)return!1;break;case"Polygon":for(var c=0;cjD(e,"name",{value:t,configurable:!0});function S0(e,t={}){if(e.bbox!=null&&t.recompute!==!0)return e.bbox;const n=[1/0,1/0,-1/0,-1/0];return Lp(e,r=>{n[0]>r[0]&&(n[0]=r[0]),n[1]>r[1]&&(n[1]=r[1]),n[2]t in e?ZD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iw=(e,t,n)=>(HD(e,typeof t!="symbol"?t+"":t,n),n);function ud(){}function HS(e){return e()}function ow(){return Object.create(null)}function uy(e){e.forEach(HS)}function XS(e){return typeof e=="function"}function XD(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function YD(e){return Object.keys(e).length===0}function KD(e,t){e.appendChild(t)}function JD(e,t,n){e.insertBefore(t,n||null)}function YS(e){e.parentNode&&e.parentNode.removeChild(e)}function sw(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function mu(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function QD(e){return Array.from(e.childNodes)}function rm(e,t,n){e.classList.toggle(t,!!n)}let E0;function id(e){E0=e}const qh=[],aw=[];let Yh=[];const lw=[],$D=Promise.resolve();let Dv=!1;function tR(){Dv||(Dv=!0,$D.then(KS))}function Rv(e){Yh.push(e)}const $_=new Set;let Vh=0;function KS(){if(Vh!==0)return;const e=E0;do{try{for(;Vhe.indexOf(r)===-1?t.push(r):n.push(r)),n.forEach(r=>r()),Yh=t}const rR=new Set;function iR(e,t){e&&e.i&&(rR.delete(e),e.i(t))}function oR(e,t,n){const{fragment:r,after_update:s}=e.$$;r&&r.m(t,n),Rv(()=>{const l=e.$$.on_mount.map(HS).filter(XS);e.$$.on_destroy?e.$$.on_destroy.push(...l):uy(l),e.$$.on_mount=[]}),s.forEach(Rv)}function sR(e,t){const n=e.$$;n.fragment!==null&&(nR(n.after_update),uy(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function aR(e,t){e.$$.dirty[0]===-1&&(qh.push(e),tR(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const B=z.length?z[0]:A;return w.ctx&&s(w.ctx[L],w.ctx[L]=B)&&(!w.skip_bound&&w.bound[L]&&w.bound[L](B),T&&aR(e,L)),A}):[],w.update(),T=!0,uy(w.before_update),w.fragment=r?r(w.ctx):!1,t.target){if(t.hydrate){const L=QD(t.target);w.fragment&&w.fragment.l(L),L.forEach(YS)}else w.fragment&&w.fragment.c();t.intro&&iR(e.$$.fragment),oR(e,t.target,t.anchor),KS()}id(y)}class uR{constructor(){iw(this,"$$"),iw(this,"$$set")}$destroy(){sR(this,1),this.$destroy=ud}$on(t,n){if(!XS(n))return ud;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const s=r.indexOf(n);s!==-1&&r.splice(s,1)}}$set(t){this.$$set&&!YD(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const cR="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(cR);function hR(e){let t,n,r;return{c(){t=sw("svg"),n=sw("path"),mu(n,"stroke-width","4"),mu(n,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),mu(n,"class","svelte-gzo3ar"),mu(t,"width",r=e[0]==="list"?20:void 0),mu(t,"viewBox","0 0 70 85"),mu(t,"fill","none"),mu(t,"class","svelte-gzo3ar"),rm(t,"in-map",e[0]!=="list"),rm(t,"list-icon",e[0]==="list")},m(s,l){JD(s,t,l),KD(t,n)},p(s,[l]){l&1&&r!==(r=s[0]==="list"?20:void 0)&&mu(t,"width",r),l&1&&rm(t,"in-map",s[0]!=="list"),l&1&&rm(t,"list-icon",s[0]==="list")},i:ud,o:ud,d(s){s&&YS(t)}}}function pR(e,t,n){let{displayIn:r}=t;return e.$$set=s=>{"displayIn"in s&&n(0,r=s.displayIn)},[r]}class fR extends uR{constructor(t){super(),lR(this,t,pR,hR,XD,{displayIn:0})}}const dR=[{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"}],gR={decimalLatitude:40.123,decimalLongitude:-74.123},mR=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],yR=[{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}];function _R(){const e=[];return dR.forEach(t=>{t.decimalLatitude?e.push(t):e.push({...t,...gR})}),[...e,...mR,...yR]}const vR=_R();vR.map(e=>e.verbatimCoordinates);/** * splaytree v3.1.2 * Fast Splay tree for Node and browser * @@ -603,10 +603,10 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */function bR(e,t){var n={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},r,s,l,p;return p={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function c(w){return function(T){return y([w,T])}}function y(w){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,s&&(l=w[0]&2?s.return:w[0]?s.throw||((l=s.return)&&l.call(s),0):s.next)&&!(l=l.call(s,w[1])).done)return l;switch(s=0,l&&(w=[w[0]&2,l.value]),w[0]){case 0:case 1:l=w;break;case 4:return n.label++,{value:w[1],done:!1};case 5:n.label++,s=w[1],w=[0];continue;case 7:w=n.ops.pop(),n.trys.pop();continue;default:if(l=n.trys,!(l=l.length>0&&l[l.length-1])&&(w[0]===6||w[0]===2)){n=0;continue}if(w[0]===3&&(!l||w[1]>l[0]&&w[1]t?1:e0){if(t.right===null)break;if(n(e,t.right.key)>0){var c=t.right;if(t.right=c.left,c.left=t,t=c,t.right===null)break}s.right=t,s=t,t=t.right}else break}return s.right=t.left,l.left=t.right,t.left=r.right,t.right=r.left,t}function tv(e,t,n,r){var s=new Iu(e,t);if(n===null)return s.left=s.right=null,s;n=bu(e,n,r);var l=r(e,n.key);return l<0?(s.left=n.left,s.right=n,n.left=null):l>=0&&(s.right=n.right,s.left=n,n.right=null),s}function uw(e,t,n){var r=null,s=null;if(t){t=bu(e,t,n);var l=n(t.key,e);l===0?(r=t.left,s=t.right):l<0?(s=t.right,t.right=null,r=t):(r=t.left,t.left=null,s=t)}return{left:r,right:s}}function wR(e,t,n){return t===null?e:(e===null||(t=bu(e.key,t,n),t.left=e),t)}function Nv(e,t,n,r,s){if(e){r(""+t+(n?"└── ":"├── ")+s(e)+` -`);var l=t+(n?" ":"│ ");e.left&&Nv(e.left,l,!1,r,s),e.right&&Nv(e.right,l,!0,r,s)}}var I0=function(){function e(t){t===void 0&&(t=xR),this._root=null,this._size=0,this._comparator=t}return e.prototype.insert=function(t,n){return this._size++,this._root=tv(t,n,this._root,this._comparator)},e.prototype.add=function(t,n){var r=new Iu(t,n);this._root===null&&(r.left=r.right=null,this._size++,this._root=r);var s=this._comparator,l=bu(t,this._root,s),p=s(t,l.key);return p===0?this._root=l:(p<0?(r.left=l.left,r.right=l,l.left=null):p>0&&(r.right=l.right,r.left=l,l.right=null),this._size++,this._root=r),this._root},e.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},e.prototype._remove=function(t,n,r){var s;if(n===null)return null;n=bu(t,n,r);var l=r(t,n.key);return l===0?(n.left===null?s=n.right:(s=bu(t,n.left,r),s.right=n.right),this._size--,s):n},e.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=bu(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},e.prototype.findStatic=function(t){for(var n=this._root,r=this._comparator;n;){var s=r(t,n.key);if(s===0)return n;s<0?n=n.left:n=n.right}return null},e.prototype.find=function(t){return this._root&&(this._root=bu(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},e.prototype.contains=function(t){for(var n=this._root,r=this._comparator;n;){var s=r(t,n.key);if(s===0)return!0;s<0?n=n.left:n=n.right}return!1},e.prototype.forEach=function(t,n){for(var r=this._root,s=[],l=!1;!l;)r!==null?(s.push(r),r=r.left):s.length!==0?(r=s.pop(),t.call(n,r),r=r.right):l=!0;return this},e.prototype.range=function(t,n,r,s){for(var l=[],p=this._comparator,c=this._root,y;l.length!==0||c;)if(c)l.push(c),c=c.left;else{if(c=l.pop(),y=p(c.key,n),y>0)break;if(p(c.key,t)>=0&&r.call(s,c))return this;c=c.right}return this},e.prototype.keys=function(){var t=[];return this.forEach(function(n){var r=n.key;return t.push(r)}),t},e.prototype.values=function(){var t=[];return this.forEach(function(n){var r=n.data;return t.push(r)}),t},e.prototype.min=function(){return this._root?this.minNode(this._root).key:null},e.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},e.prototype.minNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},e.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},e.prototype.at=function(t){for(var n=this._root,r=!1,s=0,l=[];!r;)if(n)l.push(n),n=n.left;else if(l.length>0){if(n=l.pop(),s===t)return n;s++,n=n.right}else r=!0;return null},e.prototype.next=function(t){var n=this._root,r=null;if(t.right){for(r=t.right;r.left;)r=r.left;return r}for(var s=this._comparator;n;){var l=s(t.key,n.key);if(l===0)break;l<0?(r=n,n=n.left):n=n.right}return r},e.prototype.prev=function(t){var n=this._root,r=null;if(t.left!==null){for(r=t.left;r.right;)r=r.right;return r}for(var s=this._comparator;n;){var l=s(t.key,n.key);if(l===0)break;l<0?n=n.left:(r=n,n=n.right)}return r},e.prototype.clear=function(){return this._root=null,this._size=0,this},e.prototype.toList=function(){return ER(this._root)},e.prototype.load=function(t,n,r){n===void 0&&(n=[]),r===void 0&&(r=!1);var s=t.length,l=this._comparator;if(r&&Fv(t,n,0,s-1,l),this._root===null)this._root=Ov(t,n,0,s),this._size=s;else{var p=IR(this.toList(),SR(t,n),l);s=this._size+s,this._root=zv({head:p},0,s)}return this},e.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),e.prototype.toString=function(t){t===void 0&&(t=function(r){return String(r.key)});var n=[];return Nv(this._root,"",!0,function(r){return n.push(r)},t),n.join("")},e.prototype.update=function(t,n,r){var s=this._comparator,l=uw(t,this._root,s),p=l.left,c=l.right;s(t,n)<0?c=tv(n,r,c,s):p=tv(n,r,p,s),this._root=wR(p,c,s)},e.prototype.split=function(t){return uw(t,this._root,this._comparator)},e.prototype[Symbol.iterator]=function(){var t,n,r;return bR(this,function(s){switch(s.label){case 0:t=this._root,n=[],r=!1,s.label=1;case 1:return r?[3,6]:t===null?[3,2]:(n.push(t),t=t.left,[3,5]);case 2:return n.length===0?[3,4]:(t=n.pop(),[4,t]);case 3:return s.sent(),t=t.right,[3,5];case 4:r=!0,s.label=5;case 5:return[3,1];case 6:return[2]}})},e}();function Ov(e,t,n,r){var s=r-n;if(s>0){var l=n+Math.floor(s/2),p=e[l],c=t[l],y=new Iu(p,c);return y.left=Ov(e,t,n,l),y.right=Ov(e,t,l+1,r),y}return null}function SR(e,t){for(var n=new Iu(null,null),r=n,s=0;s0?(t=l=l.next=n.pop(),t=t.right):r=!0;return l.next=null,s.next}function zv(e,t,n){var r=n-t;if(r>0){var s=t+Math.floor(r/2),l=zv(e,t,s),p=e.head;return p.left=l,e.head=e.head.next,p.right=zv(e,s+1,n),p}return null}function IR(e,t,n){for(var r=new Iu(null,null),s=r,l=e,p=t;l!==null&&p!==null;)n(l.key,p.key)<0?(s.next=l,l=l.next):(s.next=p,p=p.next),s=s.next;return l!==null?s.next=l:p!==null&&(s.next=p),r.next}function Fv(e,t,n,r,s){if(!(n>=r)){for(var l=e[n+r>>1],p=n-1,c=r+1;;){do p++;while(s(e[p],l)<0);do c--;while(s(e[c],l)>0);if(p>=c)break;var y=e[p];e[p]=e[c],e[c]=y,y=t[p],t[p]=t[c],t[c]=y}Fv(e,t,n,c,s),Fv(e,t,c+1,r,s)}}function aa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cw(e,t){for(var n=0;nn.x?1:t.yn.y?1:0}}]);function e(t,n){aa(this,e),t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=n}return Ao(e,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var n=t.point.events,r=0,s=n.length;r=0&&L>=0?wA?-1:0:y<0&&L<0?wA?1:0:Ly?1:0}}}]),e}(),AR=0,Gm=function(){Ao(e,null,[{key:"compare",value:function(t,n){var r=t.leftSE.point.x,s=n.leftSE.point.x,l=t.rightSE.point.x,p=n.rightSE.point.x;if(pc&&y>w)return-1;var L=t.comparePoint(n.leftSE.point);if(L<0)return 1;if(L>0)return-1;var A=n.comparePoint(t.rightSE.point);return A!==0?A:-1}if(r>s){if(cy&&c>T)return 1;var z=n.comparePoint(t.leftSE.point);if(z!==0)return z;var B=t.comparePoint(n.rightSE.point);return B<0?1:B>0?-1:1}if(cy)return 1;if(lp){var et=t.comparePoint(n.rightSE.point);if(et<0)return 1;if(et>0)return-1}if(l!==p){var at=w-c,W=l-r,H=T-y,nt=p-s;if(at>W&&Hnt)return-1}return l>p?1:lT?1:t.idn.id?1:0}}]);function e(t,n,r,s){aa(this,e),this.id=++AR,this.leftSE=t,t.segment=this,t.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=t,this.rings=r,this.windings=s}return Ao(e,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,n=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:tn?t:n}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var n=this.leftSE.point,r=this.rightSE.point,s=this.vector();if(n.x===r.x)return t.x===n.x?0:t.x0&&c.swapEvents(),Ya.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(s.checkForConsuming(),l.checkForConsuming()),n}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var n=0,r=this.windings.length;n0){var l=n;n=r,r=l}if(n.prev===r){var p=n;n=r,r=p}for(var c=0,y=r.rings.length;c0)s=n,l=t,p=-1;else throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));var y=new Ya(s,!0),w=new Ya(l,!1);return new e(y,w,[r],[p])}}]),e}(),gw=function(){function e(t,n,r){if(aa(this,e),!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=r,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var s=cd.round(t[0][0],t[0][1]);this.bbox={ll:{x:s.x,y:s.y},ur:{x:s.x,y:s.y}};for(var l=s,p=1,c=t.length;pthis.bbox.ur.x&&(this.bbox.ur.x=y.x),y.y>this.bbox.ur.y&&(this.bbox.ur.y=y.y),l=y)}(s.x!==l.x||s.y!==l.y)&&this.segments.push(Gm.fromRing(l,s,this))}return Ao(e,[{key:"getSweepEvents",value:function(){for(var t=[],n=0,r=this.segments.length;nthis.bbox.ur.x&&(this.bbox.ur.x=l.bbox.ur.x),l.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=l.bbox.ur.y),this.interiorRings.push(l)}this.multiPoly=n}return Ao(e,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),n=0,r=this.interiorRings.length;nthis.bbox.ur.x&&(this.bbox.ur.x=l.bbox.ur.x),l.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=l.bbox.ur.y),this.polys.push(l)}this.isSubject=n}return Ao(e,[{key:"getSweepEvents",value:function(){for(var t=[],n=0,r=this.polys.length;n0&&(t=s)}for(var l=t.segment.prevInResult(),p=l?l.prevInResult():null;;){if(!l)return null;if(!p)return l.ringOut;if(p.ringOut!==l.ringOut)return p.ringOut.enclosingRing()!==l.ringOut?l.ringOut:l.ringOut.enclosingRing();l=p.prevInResult(),p=l?l.prevInResult():null}}}]),e}(),yw=function(){function e(t){aa(this,e),this.exteriorRing=t,t.poly=this,this.interiorRings=[]}return Ao(e,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(var n=0,r=this.interiorRings.length;n1&&arguments[1]!==void 0?arguments[1]:Gm.compare;aa(this,e),this.queue=t,this.tree=new I0(n),this.segments=[]}return Ao(e,[{key:"process",value:function(t){var n=t.segment,r=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(n),r;var s=t.isLeft?this.tree.insert(n):this.tree.find(n);if(!s)throw new Error("Unable to find segment #".concat(n.id," ")+"[".concat(n.leftSE.point.x,", ").concat(n.leftSE.point.y,"] -> ")+"[".concat(n.rightSE.point.x,", ").concat(n.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var l=s,p=s,c=void 0,y=void 0;c===void 0;)l=this.tree.prev(l),l===null?c=null:l.key.consumedBy===void 0&&(c=l.key);for(;y===void 0;)p=this.tree.next(p),p===null?y=null:p.key.consumedBy===void 0&&(y=p.key);if(t.isLeft){var w=null;if(c){var T=c.getIntersection(n);if(T!==null&&(n.isAnEndpoint(T)||(w=T),!c.isAnEndpoint(T)))for(var L=this._splitSafely(c,T),A=0,z=L.length;A0?(this.tree.remove(n),r.push(t)):(this.segments.push(n),n.prev=c)}else{if(c&&y){var bt=c.getIntersection(y);if(bt!==null){if(!c.isAnEndpoint(bt))for(var It=this._splitSafely(c,bt),Ot=0,dt=It.length;Ot_w)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var nt=new NR(B),ut=B.size,_t=B.pop();_t;){var ct=_t.key;if(B.size===ut){var bt=ct.segment;throw new Error("Unable to pop() ".concat(ct.isLeft?"left":"right"," SweepEvent ")+"[".concat(ct.point.x,", ").concat(ct.point.y,"] from segment #").concat(bt.id," ")+"[".concat(bt.leftSE.point.x,", ").concat(bt.leftSE.point.y,"] -> ")+"[".concat(bt.rightSE.point.x,", ").concat(bt.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(B.size>_w)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(nt.segments.length>OR)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var It=nt.process(ct),Ot=0,dt=It.length;Ot1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;rn[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]t.x?1:this.yt.y?1:0};St.prototype.clone=function(){};St.prototype.copy=function(){return new St(this)};St.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"};St.prototype.distance3D=function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return Math.sqrt(t*t+n*n+r*r)};St.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)};St.prototype.hashCode=function(){var e=17;return e=37*e+St.hashCode(this.x),e=37*e+St.hashCode(this.y),e};St.prototype.setCoordinate=function(e){this.x=e.x,this.y=e.y,this.z=e.z};St.prototype.interfaces_=function(){return[es,hy,ns]};St.prototype.getClass=function(){return St};St.hashCode=function(){if(arguments.length===1){var e=arguments[0],t=Ue.doubleToLongBits(e);return Math.trunc((t^t)>>>32)}};Dc.DimensionalComparator.get=function(){return Rl};Dc.serialVersionUID.get=function(){return 6683108902428367e3};Dc.NULL_ORDINATE.get=function(){return Ue.NaN};Dc.X.get=function(){return 0};Dc.Y.get=function(){return 1};Dc.Z.get=function(){return 2};Object.defineProperties(St,Dc);var Rl=function(e){if(this._dimensionsToTest=2,arguments.length!==0&&arguments.length===1){var t=arguments[0];if(t!==2&&t!==3)throw new Qn("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}};Rl.prototype.compare=function(e,t){var n=e,r=t,s=Rl.compare(n.x,r.x);if(s!==0)return s;var l=Rl.compare(n.y,r.y);if(l!==0)return l;if(this._dimensionsToTest<=2)return 0;var p=Rl.compare(n.z,r.z);return p};Rl.prototype.interfaces_=function(){return[ep]};Rl.prototype.getClass=function(){return Rl};Rl.compare=function(e,t){return et?1:Ue.isNaN(e)?Ue.isNaN(t)?0:-1:Ue.isNaN(t)?1:0};var np=function(){};np.prototype.create=function(){};np.prototype.interfaces_=function(){return[]};np.prototype.getClass=function(){return np};var Ct=function(){},zd={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};Ct.prototype.interfaces_=function(){return[]};Ct.prototype.getClass=function(){return Ct};Ct.toLocationSymbol=function(e){switch(e){case Ct.EXTERIOR:return"e";case Ct.BOUNDARY:return"b";case Ct.INTERIOR:return"i";case Ct.NONE:return"-"}throw new Qn("Unknown location value: "+e)};zd.INTERIOR.get=function(){return 0};zd.BOUNDARY.get=function(){return 1};zd.EXTERIOR.get=function(){return 2};zd.NONE.get=function(){return-1};Object.defineProperties(Ct,zd);var De=function(e,t){return e.interfaces_&&e.interfaces_().indexOf(t)>-1},ko=function(){},oE={LOG_10:{configurable:!0}};ko.prototype.interfaces_=function(){return[]};ko.prototype.getClass=function(){return ko};ko.log10=function(e){var t=Math.log(e);return Ue.isInfinite(t)||Ue.isNaN(t)?t:t/ko.LOG_10};ko.min=function(e,t,n,r){var s=e;return tn?n:e}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],s=arguments[1],l=arguments[2];return rl?l:r}};ko.wrap=function(e,t){return e<0?t- -e%t:e%t};ko.max=function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],n=arguments[2],r=e;return t>r&&(r=t),n>r&&(r=n),r}else if(arguments.length===4){var s=arguments[0],l=arguments[1],p=arguments[2],c=arguments[3],y=s;return l>y&&(y=l),p>y&&(y=p),c>y&&(y=c),y}};ko.average=function(e,t){return(e+t)/2};oE.LOG_10.get=function(){return Math.log(10)};Object.defineProperties(ko,oE);var la=function(e){this.str=e};la.prototype.append=function(e){this.str+=e};la.prototype.setCharAt=function(e,t){this.str=this.str.substr(0,e)+t+this.str.substr(e+1)};la.prototype.toString=function(e){return this.str};var Ys=function(e){this.value=e};Ys.prototype.intValue=function(){return this.value};Ys.prototype.compareTo=function(e){return this.valuee?1:0};Ys.isNaN=function(e){return Number.isNaN(e)};var hd=function(){};hd.isWhitespace=function(e){return e<=32&&e>=0||e===127};hd.toUpperCase=function(e){return e.toUpperCase()};var Dt=function e(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof e){var n=arguments[0];this.init(n)}else if(typeof arguments[0]=="string"){var r=arguments[0];e.call(this,e.parse(r))}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];this.init(s,l)}},Es={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};Dt.prototype.le=function(e){return(this._hi9?(T=!0,L="9"):L="0"+w,p.append(L),n=n.subtract(Dt.valueOf(w)).multiply(Dt.TEN),T&&n.selfAdd(Dt.TEN);var A=!0,z=Dt.magnitude(n._hi);if(z<0&&Math.abs(z)>=c-y&&(A=!1),!A)break}return t[0]=r,p.toString()};Dt.prototype.sqr=function(){return this.multiply(this)};Dt.prototype.doubleValue=function(){return this._hi+this._lo};Dt.prototype.subtract=function(){if(arguments[0]instanceof Dt){var e=arguments[0];return this.add(e.negate())}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.add(-t)}};Dt.prototype.equals=function(){if(arguments.length===1){var e=arguments[0];return this._hi===e._hi&&this._lo===e._lo}};Dt.prototype.isZero=function(){return this._hi===0&&this._lo===0};Dt.prototype.selfSubtract=function(){if(arguments[0]instanceof Dt){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e._hi,-e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t,0)}};Dt.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null};Dt.prototype.min=function(e){return this.le(e)?this:e};Dt.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof Dt){var e=arguments[0];return this.selfDivide(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.selfDivide(t,0)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1],s=null,l=null,p=null,c=null,y=null,w=null,T=null,L=null;return y=this._hi/n,w=Dt.SPLIT*y,s=w-y,L=Dt.SPLIT*n,s=w-s,l=y-s,p=L-n,T=y*n,p=L-p,c=n-p,L=s*p-T+s*c+l*p+l*c,w=(this._hi-T-L+this._lo-y*r)/n,L=y+w,this._hi=L,this._lo=y-L+w,this}};Dt.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"};Dt.prototype.divide=function(){if(arguments[0]instanceof Dt){var e=arguments[0],t=null,n=null,r=null,s=null,l=null,p=null,c=null,y=null;l=this._hi/e._hi,p=Dt.SPLIT*l,t=p-l,y=Dt.SPLIT*e._hi,t=p-t,n=l-t,r=y-e._hi,c=l*e._hi,r=y-r,s=e._hi-r,y=t*r-c+t*s+n*r+n*s,p=(this._hi-c-y+this._lo-l*e._lo)/e._hi,y=l+p;var w=y,T=l-y+p;return new Dt(w,T)}else if(typeof arguments[0]=="number"){var L=arguments[0];return Ue.isNaN(L)?Dt.createNaN():Dt.copy(this).selfDivide(L,0)}};Dt.prototype.ge=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>=e._lo};Dt.prototype.pow=function(e){if(e===0)return Dt.valueOf(1);var t=new Dt(this),n=Dt.valueOf(1),r=Math.abs(e);if(r>1)for(;r>0;)r%2===1&&n.selfMultiply(t),r/=2,r>0&&(t=t.sqr());else n=t;return e<0?n.reciprocal():n};Dt.prototype.ceil=function(){if(this.isNaN())return Dt.NaN;var e=Math.ceil(this._hi),t=0;return e===this._hi&&(t=Math.ceil(this._lo)),new Dt(e,t)};Dt.prototype.compareTo=function(e){var t=e;return this._hit._hi?1:this._lot._lo?1:0};Dt.prototype.rint=function(){if(this.isNaN())return this;var e=this.add(.5);return e.floor()};Dt.prototype.setValue=function(){if(arguments[0]instanceof Dt){var e=arguments[0];return this.init(e),this}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.init(t),this}};Dt.prototype.max=function(e){return this.ge(e)?this:e};Dt.prototype.sqrt=function(){if(this.isZero())return Dt.valueOf(0);if(this.isNegative())return Dt.NaN;var e=1/Math.sqrt(this._hi),t=this._hi*e,n=Dt.valueOf(t),r=this.subtract(n.sqr()),s=r._hi*(e*.5);return n.add(s)};Dt.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof Dt){var e=arguments[0];return this.selfAdd(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0],n=null,r=null,s=null,l=null,p=null,c=null;return s=this._hi+t,p=s-this._hi,l=s-p,l=t-p+(this._hi-l),c=l+this._lo,n=s+c,r=c+(s-n),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(arguments.length===2){var y=arguments[0],w=arguments[1],T=null,L=null,A=null,z=null,B=null,Y=null,et=null,at=null;B=this._hi+y,A=this._lo+w,et=B-this._hi,at=A-this._lo,Y=B-et,z=A-at,Y=y-et+(this._hi-Y),z=w-at+(this._lo-z),et=Y+A,T=B+et,L=et+(B-T),et=z+L;var W=T+et,H=et+(T-W);return this._hi=W,this._lo=H,this}};Dt.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof Dt){var e=arguments[0];return this.selfMultiply(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.selfMultiply(t,0)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1],s=null,l=null,p=null,c=null,y=null,w=null;y=Dt.SPLIT*this._hi,s=y-this._hi,w=Dt.SPLIT*n,s=y-s,l=this._hi-s,p=w-n,y=this._hi*n,p=w-p,c=n-p,w=s*p-y+s*c+l*p+l*c+(this._hi*r+this._lo*n);var T=y+w;s=y-T;var L=w+s;return this._hi=T,this._lo=L,this}};Dt.prototype.selfSqr=function(){return this.selfMultiply(this)};Dt.prototype.floor=function(){if(this.isNaN())return Dt.NaN;var e=Math.floor(this._hi),t=0;return e===this._hi&&(t=Math.floor(this._lo)),new Dt(e,t)};Dt.prototype.negate=function(){return this.isNaN()?this:new Dt(-this._hi,-this._lo)};Dt.prototype.clone=function(){};Dt.prototype.multiply=function(){if(arguments[0]instanceof Dt){var e=arguments[0];return e.isNaN()?Dt.createNaN():Dt.copy(this).selfMultiply(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return Ue.isNaN(t)?Dt.createNaN():Dt.copy(this).selfMultiply(t,0)}};Dt.prototype.isNaN=function(){return Ue.isNaN(this._hi)};Dt.prototype.intValue=function(){return Math.trunc(this._hi)};Dt.prototype.toString=function(){var e=Dt.magnitude(this._hi);return e>=-3&&e<=20?this.toStandardNotation():this.toSciNotation()};Dt.prototype.toStandardNotation=function(){var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),n=this.extractSignificantDigits(!0,t),r=t[0]+1,s=n;if(n.charAt(0)===".")s="0"+n;else if(r<0)s="0."+Dt.stringOfChar("0",-r)+n;else if(n.indexOf(".")===-1){var l=r-n.length,p=Dt.stringOfChar("0",l);s=n+p+".0"}return this.isNegative()?"-"+s:s};Dt.prototype.reciprocal=function(){var e=null,t=null,n=null,r=null,s=null,l=null,p=null,c=null;s=1/this._hi,l=Dt.SPLIT*s,e=l-s,c=Dt.SPLIT*this._hi,e=l-e,t=s-e,n=c-this._hi,p=s*this._hi,n=c-n,r=this._hi-n,c=e*n-p+e*r+t*n+t*r,l=(1-p-c-s*this._lo)/this._hi;var y=s+l,w=s-y+l;return new Dt(y,w)};Dt.prototype.toSciNotation=function(){if(this.isZero())return Dt.SCI_NOT_ZERO;var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),n=this.extractSignificantDigits(!1,t),r=Dt.SCI_NOT_EXPONENT_CHAR+t[0];if(n.charAt(0)==="0")throw new Error("Found leading zero: "+n);var s="";n.length>1&&(s=n.substring(1));var l=n.charAt(0)+"."+s;return this.isNegative()?"-"+l+r:l+r};Dt.prototype.abs=function(){return this.isNaN()?Dt.NaN:this.isNegative()?this.negate():new Dt(this)};Dt.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0};Dt.prototype.lt=function(e){return(this._hie._hi||this._hi===e._hi)&&this._lo>e._lo};Dt.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0};Dt.prototype.trunc=function(){return this.isNaN()?Dt.NaN:this.isPositive()?this.floor():this.ceil()};Dt.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0};Dt.prototype.interfaces_=function(){return[ns,es,hy]};Dt.prototype.getClass=function(){return Dt};Dt.sqr=function(e){return Dt.valueOf(e).selfMultiply(e)};Dt.valueOf=function(){if(typeof arguments[0]=="string"){var e=arguments[0];return Dt.parse(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return new Dt(t)}};Dt.sqrt=function(e){return Dt.valueOf(e).sqrt()};Dt.parse=function(e){for(var t=0,n=e.length;hd.isWhitespace(e.charAt(t));)t++;var r=!1;if(t=n);){var w=e.charAt(t);if(t++,hd.isDigit(w)){var T=w-"0";l.selfMultiply(Dt.TEN),l.selfAdd(T),p++;continue}if(w==="."){c=p;continue}if(w==="e"||w==="E"){var L=e.substring(t);try{y=Ys.parseInt(L)}catch(et){throw et instanceof Error?new Error("Invalid exponent "+L+" in string "+e):et}finally{}break}throw new Error("Unexpected character '"+w+"' at position "+t+" in string "+e)}var A=l,z=p-c-y;if(z===0)A=l;else if(z>0){var B=Dt.TEN.pow(z);A=l.divide(B)}else if(z<0){var Y=Dt.TEN.pow(-z);A=l.multiply(Y)}return r?A.negate():A};Dt.createNaN=function(){return new Dt(Ue.NaN,Ue.NaN)};Dt.copy=function(e){return new Dt(e)};Dt.magnitude=function(e){var t=Math.abs(e),n=Math.log(t)/Math.log(10),r=Math.trunc(Math.floor(n)),s=Math.pow(10,r);return s*10<=t&&(r+=1),r};Dt.stringOfChar=function(e,t){for(var n=new la,r=0;r0){if(l<=0)return Yi.signum(p);r=s+l}else if(s<0){if(l>=0)return Yi.signum(p);r=-s-l}else return Yi.signum(p);var c=Yi.DP_SAFE_EPSILON*r;return p>=c||-p>=c?Yi.signum(p):2};Yi.signum=function(e){return e>0?1:e<0?-1:0};sE.DP_SAFE_EPSILON.get=function(){return 1e-15};Object.defineProperties(Yi,sE);var yn=function(){},Fd={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Fd.X.get=function(){return 0};Fd.Y.get=function(){return 1};Fd.Z.get=function(){return 2};Fd.M.get=function(){return 3};yn.prototype.setOrdinate=function(e,t,n){};yn.prototype.size=function(){};yn.prototype.getOrdinate=function(e,t){};yn.prototype.getCoordinate=function(){};yn.prototype.getCoordinateCopy=function(e){};yn.prototype.getDimension=function(){};yn.prototype.getX=function(e){};yn.prototype.clone=function(){};yn.prototype.expandEnvelope=function(e){};yn.prototype.copy=function(){};yn.prototype.getY=function(e){};yn.prototype.toCoordinateArray=function(){};yn.prototype.interfaces_=function(){return[hy]};yn.prototype.getClass=function(){return yn};Object.defineProperties(yn,Fd);var aE=function(){},Pp=function(e){function t(){e.call(this,"Projective point not representable on the Cartesian plane.")}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(aE),pi=function(){};pi.arraycopy=function(e,t,n,r,s){for(var l=0,p=t;pe._minx?this._minx:e._minx,n=this._miny>e._miny?this._miny:e._miny,r=this._maxx=this._minx&&t.getMaxX()<=this._maxx&&t.getMinY()>=this._miny&&t.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.isNull()?!1:n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}};Se.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof Se){var e=arguments[0];return this.isNull()||e.isNull()?!1:!(e._minx>this._maxx||e._maxxthis._maxy||e._maxythis._maxx||nthis._maxy||rthis._maxx&&(this._maxx=t._maxx),t._minythis._maxy&&(this._maxy=t._maxy))}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(nthis._maxx&&(this._maxx=n),rthis._maxy&&(this._maxy=r))}};Se.prototype.minExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return et._minx?1:this._minyt._miny?1:this._maxxt._maxx?1:this._maxyt._maxy?1:0};Se.prototype.translate=function(e,t){if(this.isNull())return null;this.init(this.getMinX()+e,this.getMaxX()+e,this.getMinY()+t,this.getMaxY()+t)};Se.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"};Se.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1};Se.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny};Se.prototype.maxExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e>t?e:t};Se.prototype.expandBy=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()}};Se.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof Se){var e=arguments[0];return this.covers(e)}else if(arguments[0]instanceof St){var t=arguments[0];return this.covers(t)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.covers(n,r)}};Se.prototype.centre=function(){return this.isNull()?null:new St((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)};Se.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof St){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof Se){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],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(arguments.length===4){var s=arguments[0],l=arguments[1],p=arguments[2],c=arguments[3];se._maxx&&(t=this._minx-e._maxx);var n=0;return this._maxye._maxy&&(n=this._miny-e._maxy),t===0?n:n===0?t:Math.sqrt(t*t+n*n)};Se.prototype.hashCode=function(){var e=17;return e=37*e+St.hashCode(this._minx),e=37*e+St.hashCode(this._maxx),e=37*e+St.hashCode(this._miny),e=37*e+St.hashCode(this._maxy),e};Se.prototype.interfaces_=function(){return[es,ns]};Se.prototype.getClass=function(){return Se};Se.intersects=function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],n=arguments[2];return n.x>=(e.xt.x?e.x:t.x)&&n.y>=(e.yt.y?e.y:t.y)}else if(arguments.length===4){var r=arguments[0],s=arguments[1],l=arguments[2],p=arguments[3],c=Math.min(l.x,p.x),y=Math.max(l.x,p.x),w=Math.min(r.x,s.x),T=Math.max(r.x,s.x);return!(w>y||Ty)||Tn?(this._intLineIndex[e][0]=0,this._intLineIndex[e][1]=1):(this._intLineIndex[e][0]=1,this._intLineIndex[e][1]=0)}};rr.prototype.isProper=function(){return this.hasIntersection()&&this._isProper};rr.prototype.setPrecisionModel=function(e){this._precisionModel=e};rr.prototype.isInteriorIntersection=function(){var e=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var t=arguments[0],n=0;ns?l=r:l=s;else{var p=Math.abs(e.x-t.x),c=Math.abs(e.y-t.y);r>s?l=p:l=c,l===0&&!e.equals(t)&&(l=Math.max(p,c))}return Ye.isTrue(!(l===0&&!e.equals(t)),"Bad distance calculation"),l};rr.nonRobustComputeEdgeDistance=function(e,t,n){var r=e.x-t.x,s=e.y-t.y,l=Math.sqrt(r*r+s*s);return Ye.isTrue(!(l===0&&!e.equals(t)),"Invalid distance calculation"),l};Rc.DONT_INTERSECT.get=function(){return 0};Rc.DO_INTERSECT.get=function(){return 1};Rc.COLLINEAR.get=function(){return 2};Rc.NO_INTERSECTION.get=function(){return 0};Rc.POINT_INTERSECTION.get=function(){return 1};Rc.COLLINEAR_INTERSECTION.get=function(){return 2};Object.defineProperties(rr,Rc);var zu=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(n){var r=new Se(this._inputLines[0][0],this._inputLines[0][1]),s=new Se(this._inputLines[1][0],this._inputLines[1][1]);return r.contains(n)&&s.contains(n)},t.prototype.computeIntersection=function(){if(arguments.length===3){var n=arguments[0],r=arguments[1],s=arguments[2];if(this._isProper=!1,Se.intersects(r,s,n)&&pe.orientationIndex(r,s,n)===0&&pe.orientationIndex(s,r,n)===0)return this._isProper=!0,(n.equals(r)||n.equals(s))&&(this._isProper=!1),this._result=e.POINT_INTERSECTION,null;this._result=e.NO_INTERSECTION}else return e.prototype.computeIntersection.apply(this,arguments)},t.prototype.normalizeToMinimum=function(n,r,s,l,p){p.x=this.smallestInAbsValue(n.x,r.x,s.x,l.x),p.y=this.smallestInAbsValue(n.y,r.y,s.y,l.y),n.x-=p.x,n.y-=p.y,r.x-=p.x,r.y-=p.y,s.x-=p.x,s.y-=p.y,l.x-=p.x,l.y-=p.y},t.prototype.safeHCoordinateIntersection=function(n,r,s,l){var p=null;try{p=gs.intersection(n,r,s,l)}catch(c){if(c instanceof Pp)p=t.nearestEndpoint(n,r,s,l);else throw c}finally{}return p},t.prototype.intersection=function(n,r,s,l){var p=this.intersectionWithNormalization(n,r,s,l);return this.isInSegmentEnvelopes(p)||(p=new St(t.nearestEndpoint(n,r,s,l))),this._precisionModel!==null&&this._precisionModel.makePrecise(p),p},t.prototype.smallestInAbsValue=function(n,r,s,l){var p=n,c=Math.abs(p);return Math.abs(r)1e-4&&pi.out.println("Distance = "+p.distance(c))},t.prototype.intersectionWithNormalization=function(n,r,s,l){var p=new St(n),c=new St(r),y=new St(s),w=new St(l),T=new St;this.normalizeToEnvCentre(p,c,y,w,T);var L=this.safeHCoordinateIntersection(p,c,y,w);return L.x+=T.x,L.y+=T.y,L},t.prototype.computeCollinearIntersection=function(n,r,s,l){var p=Se.intersects(n,r,s),c=Se.intersects(n,r,l),y=Se.intersects(s,l,n),w=Se.intersects(s,l,r);return p&&c?(this._intPt[0]=s,this._intPt[1]=l,e.COLLINEAR_INTERSECTION):y&&w?(this._intPt[0]=n,this._intPt[1]=r,e.COLLINEAR_INTERSECTION):p&&y?(this._intPt[0]=s,this._intPt[1]=n,s.equals(n)&&!c&&!w?e.POINT_INTERSECTION:e.COLLINEAR_INTERSECTION):p&&w?(this._intPt[0]=s,this._intPt[1]=r,s.equals(r)&&!c&&!y?e.POINT_INTERSECTION:e.COLLINEAR_INTERSECTION):c&&y?(this._intPt[0]=l,this._intPt[1]=n,l.equals(n)&&!p&&!w?e.POINT_INTERSECTION:e.COLLINEAR_INTERSECTION):c&&w?(this._intPt[0]=l,this._intPt[1]=r,l.equals(r)&&!p&&!y?e.POINT_INTERSECTION:e.COLLINEAR_INTERSECTION):e.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(n,r,s,l,p){var c=n.xr.x?n.x:r.x,T=n.y>r.y?n.y:r.y,L=s.xl.x?s.x:l.x,B=s.y>l.y?s.y:l.y,Y=c>L?c:L,et=wA?y:A,W=T0&&c>0||p<0&&c<0)return e.NO_INTERSECTION;var y=pe.orientationIndex(s,l,n),w=pe.orientationIndex(s,l,r);if(y>0&&w>0||y<0&&w<0)return e.NO_INTERSECTION;var T=p===0&&c===0&&y===0&&w===0;return T?this.computeCollinearIntersection(n,r,s,l):(p===0||c===0||y===0||w===0?(this._isProper=!1,n.equals2D(s)||n.equals2D(l)?this._intPt[0]=n:r.equals2D(s)||r.equals2D(l)?this._intPt[0]=r:p===0?this._intPt[0]=new St(s):c===0?this._intPt[0]=new St(l):y===0?this._intPt[0]=new St(n):w===0&&(this._intPt[0]=new St(r))):(this._isProper=!0,this._intPt[0]=this.intersection(n,r,s,l)),e.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(n,r,s,l){var p=n,c=pe.distancePointLine(n,s,l),y=pe.distancePointLine(r,s,l);return y0?n>0?-s:s:n>0?s:-s;if(t===0||n===0)return r>0?e>0?s:-s:e>0?-s:s;if(t>0?r>0?t<=r||(s=-s,l=e,e=n,n=l,l=t,t=r,r=l):t<=-r?(s=-s,n=-n,r=-r):(l=e,e=-n,n=l,l=t,t=-r,r=l):r>0?-t<=r?(s=-s,e=-e,t=-t):(l=-e,e=n,n=l,l=-t,t=r,r=l):t>=r?(e=-e,t=-t,n=-n,r=-r):(s=-s,l=-e,e=-n,n=l,l=-t,t=-r,r=l),e>0)if(n>0){if(!(e<=n))return s}else return s;else{if(n>0)return-s;if(e>=n)s=-s,e=-e,n=-n;else return-s}for(;;){if(p=Math.floor(n/e),n=n-p*e,r=r-p*t,r<0)return-s;if(r>t)return s;if(e>n+n){if(tr+r)return-s;n=e-n,r=t-r,s=-s}if(r===0)return n===0?0:-s;if(n===0||(p=Math.floor(e/n),e=e-p*n,t=t-p*r,t<0))return s;if(t>r)return-s;if(n>e+e){if(rt+t)return s;e=n-e,t=r-t,s=-s}if(t===0)return e===0?0:s;if(e===0)return-s}};var js=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var e=arguments[0];this._p=e};js.prototype.countSegment=function(e,t){if(e.xr&&(n=t.x,r=e.x),this._p.x>=n&&this._p.x<=r&&(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 s=e.x-this._p.x,l=e.y-this._p.y,p=t.x-this._p.x,c=t.y-this._p.y,y=_c.signOfDet2x2(s,l,p,c);if(y===0)return this._isPointOnSegment=!0,null;c0&&this._crossingCount++}};js.prototype.isPointInPolygon=function(){return this.getLocation()!==Ct.EXTERIOR};js.prototype.getLocation=function(){return this._isPointOnSegment?Ct.BOUNDARY:this._crossingCount%2===1?Ct.INTERIOR:Ct.EXTERIOR};js.prototype.isOnSegment=function(){return this._isPointOnSegment};js.prototype.interfaces_=function(){return[]};js.prototype.getClass=function(){return js};js.locatePointInRing=function(){if(arguments[0]instanceof St&&De(arguments[1],yn)){for(var e=arguments[0],t=arguments[1],n=new js(e),r=new St,s=new St,l=1;l1||y<0||y>1)&&(s=!0)}}return s?ko.min(pe.distancePointLine(e,n,r),pe.distancePointLine(t,n,r),pe.distancePointLine(n,e,t),pe.distancePointLine(r,e,t)):0};pe.isPointInRing=function(e,t){return pe.locatePointInRing(e,t)!==Ct.EXTERIOR};pe.computeLength=function(e){var t=e.size();if(t<=1)return 0;var n=0,r=new St;e.getCoordinate(0,r);for(var s=r.x,l=r.y,p=1;pn.y&&(n=l,r=s)}var p=r;do p=p-1,p<0&&(p=t);while(e[p].equals2D(n)&&p!==r);var c=r;do c=(c+1)%t;while(e[c].equals2D(n)&&c!==r);var y=e[p],w=e[c];if(y.equals2D(n)||w.equals2D(n)||y.equals2D(w))return!1;var T=pe.computeOrientation(y,n,w),L=!1;return T===0?L=y.x>w.x:L=T>0,L};pe.locatePointInRing=function(e,t){return js.locatePointInRing(e,t)};pe.distancePointLinePerpendicular=function(e,t,n){var r=(n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y),s=((t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y))/r;return Math.abs(s)*Math.sqrt(r)};pe.computeOrientation=function(e,t,n){return pe.orientationIndex(e,t,n)};pe.distancePointLine=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];if(t.length===0)throw new Qn("Line array must contain at least one vertex");for(var n=e.distance(t[0]),r=0;r=1)return l.distance(c);var T=((p.y-l.y)*(c.x-p.x)-(p.x-l.x)*(c.y-p.y))/y;return Math.abs(T)*Math.sqrt(y)}};pe.isOnLine=function(e,t){for(var n=new zu,r=1;r0};ip.prototype.interfaces_=function(){return[Qo]};ip.prototype.getClass=function(){return ip};var op=function(){};op.prototype.isInBoundary=function(e){return e>1};op.prototype.interfaces_=function(){return[Qo]};op.prototype.getClass=function(){return op};var sp=function(){};sp.prototype.isInBoundary=function(e){return e===1};sp.prototype.interfaces_=function(){return[Qo]};sp.prototype.getClass=function(){return sp};var Ar=function(){};Ar.prototype.add=function(){};Ar.prototype.addAll=function(){};Ar.prototype.isEmpty=function(){};Ar.prototype.iterator=function(){};Ar.prototype.size=function(){};Ar.prototype.toArray=function(){};Ar.prototype.remove=function(){};function T0(e){this.message=e||""}T0.prototype=new Error;T0.prototype.name="IndexOutOfBoundsException";var Mp=function(){};Mp.prototype.hasNext=function(){};Mp.prototype.next=function(){};Mp.prototype.remove=function(){};var ms=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t}(Ar);function Ap(e){this.message=e||""}Ap.prototype=new Error;Ap.prototype.name="NoSuchElementException";var ie=function(e){function t(){e.call(this),this.array_=[],arguments[0]instanceof Ar&&this.addAll(arguments[0])}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[e,Ar]},t.prototype.add=function(n){return arguments.length===1?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(n){for(var r=this,s=n.iterator();s.hasNext();)r.add(s.next());return!0},t.prototype.set=function(n,r){var s=this.array_[n];return this.array_[n]=r,s},t.prototype.iterator=function(){return new HR(this)},t.prototype.get=function(n){if(n<0||n>=this.size())throw new T0;return this.array_[n]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var n=this,r=[],s=0,l=this.array_.length;s=1){var w=this.get(this.size()-1);if(w.equals2D(c))return null}e.prototype.add.call(this,c)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var T=arguments[0],L=arguments[1];return this.add(T,L),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var A=arguments[0],z=arguments[1],B=arguments[2];if(B)for(var Y=0;Y=0;et--)r.add(A[et],z);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof St){var at=arguments[0],W=arguments[1],H=arguments[2];if(!H){var nt=this.size();if(nt>0){if(at>0){var ut=this.get(at-1);if(ut.equals2D(W))return null}if(atOt&&(dt=-1);for(var Pt=It;Pt!==Ot;Pt+=dt)r.add(ct[Pt],bt);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new St(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,n),t}(ie),un=function(){},fy={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};fy.ForwardComparator.get=function(){return pd};fy.BidirectionalComparator.get=function(){return ap};fy.coordArrayType.get=function(){return new Array(0).fill(null)};un.prototype.interfaces_=function(){return[]};un.prototype.getClass=function(){return un};un.isRing=function(e){return!(e.length<4||!e[0].equals2D(e[e.length-1]))};un.ptNotInList=function(e,t){for(var n=0;n=e?t:[]};un.indexOf=function(e,t){for(var n=0;n0)&&(t=e[n]);return t};un.extract=function(e,t,n){t=ko.clamp(t,0,e.length),n=ko.clamp(n,-1,e.length);var r=n-t+1;n<0&&(r=0),t>=e.length&&(r=0),nr.length)return 1;if(n.length===0)return 0;var s=un.compare(n,r),l=un.isEqualReversed(n,r);return l?0:s};ap.prototype.OLDcompare=function(e,t){var n=e,r=t;if(n.lengthr.length)return 1;if(n.length===0)return 0;for(var s=un.increasingDirection(n),l=un.increasingDirection(r),p=s>0?0:n.length-1,c=l>0?0:n.length-1,y=0;y0)t=t.right;else return t.value}return null};bi.prototype.put=function(e,t){if(this.root_===null)return this.root_={key:e,value:t,left:null,right:null,parent:null,color:Ka,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n=this.root_,r,s;do if(r=n,s=e.compareTo(n.key),s<0)n=n.left;else if(s>0)n=n.right;else{var l=n.value;return n.value=t,l}while(n!==null);var p={key:e,left:null,right:null,value:t,parent:r,color:Ka,getValue:function(){return this.value},getKey:function(){return this.key}};return s<0?r.left=p:r.right=p,this.fixAfterInsertion(p),this.size_++,null};bi.prototype.fixAfterInsertion=function(e){var t=this;for(e.color=yu;e!=null&&e!==this.root_&&e.parent.color===yu;)if(Vn(e)===ev(Vn(Vn(e)))){var n=ww(Vn(Vn(e)));xw(n)===yu?(Wa(Vn(e),Ka),Wa(n,Ka),Wa(Vn(Vn(e)),yu),e=Vn(Vn(e))):(e===ww(Vn(e))&&(e=Vn(e),t.rotateLeft(e)),Wa(Vn(e),Ka),Wa(Vn(Vn(e)),yu),t.rotateRight(Vn(Vn(e))))}else{var r=ev(Vn(Vn(e)));xw(r)===yu?(Wa(Vn(e),Ka),Wa(r,Ka),Wa(Vn(Vn(e)),yu),e=Vn(Vn(e))):(e===ev(Vn(e))&&(e=Vn(e),t.rotateRight(e)),Wa(Vn(e),Ka),Wa(Vn(Vn(e)),yu),t.rotateLeft(Vn(Vn(e))))}this.root_.color=Ka};bi.prototype.values=function(){var e=new ie,t=this.getFirstEntry();if(t!==null)for(e.add(t.value);(t=bi.successor(t))!==null;)e.add(t.value);return e};bi.prototype.entrySet=function(){var e=new L0,t=this.getFirstEntry();if(t!==null)for(e.add(t);(t=bi.successor(t))!==null;)e.add(t);return e};bi.prototype.rotateLeft=function(e){if(e!=null){var t=e.right;e.right=t.left,t.left!=null&&(t.left.parent=e),t.parent=e.parent,e.parent===null?this.root_=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}};bi.prototype.rotateRight=function(e){if(e!=null){var t=e.left;e.left=t.right,t.right!=null&&(t.right.parent=e),t.parent=e.parent,e.parent===null?this.root_=t:e.parent.right===e?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}};bi.prototype.getFirstEntry=function(){var e=this.root_;if(e!=null)for(;e.left!=null;)e=e.left;return e};bi.successor=function(e){if(e===null)return null;if(e.right!==null){for(var t=e.right;t.left!==null;)t=t.left;return t}else{for(var n=e.parent,r=e;n!==null&&r===n.right;)r=n,n=n.parent;return n}};bi.prototype.size=function(){return this.size_};var fd=function(){};fd.prototype.interfaces_=function(){return[]};fd.prototype.getClass=function(){return fd};function uE(){}uE.prototype=new dy;function Ks(){this.array_=[],arguments[0]instanceof Ar&&this.addAll(arguments[0])}Ks.prototype=new uE;Ks.prototype.contains=function(e){for(var t=this,n=0,r=this.array_.length;n=0;){var p=s.substring(0,l);r.add(p),s=s.substring(l+n),l=s.indexOf(t)}s.length>0&&r.add(s);for(var c=new Array(r.size()).fill(null),y=0;y0)for(var l=s;l0&&r.append(" ");for(var l=0;l0&&r.append(","),r.append(Xo.toString(e.getOrdinate(s,l)))}return r.append(")"),r.toString()}};vr.ensureValidRing=function(e,t){var n=t.size();if(n===0)return t;if(n<=3)return vr.createClosedRing(e,t,4);var r=t.getOrdinate(0,yn.X)===t.getOrdinate(n-1,yn.X)&&t.getOrdinate(0,yn.Y)===t.getOrdinate(n-1,yn.Y);return r?t:vr.createClosedRing(e,t,n+1)};vr.createClosedRing=function(e,t,n){var r=e.create(n,t.getDimension()),s=t.size();vr.copy(t,0,r,0,s);for(var l=s;l0&&vr.reverse(r._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?bn.FALSE:0},t.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return pe.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var r=this._points.copy();vr.reverse(r);var s=this.getFactory().createLineString(r);return s},t.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){for(var s=arguments[0],l=s,p=0,c=0;p= 2)");this._points=r},t.prototype.isCoordinate=function(r){for(var s=this,l=0;l=1&&this.getCoordinateSequence().size()= 4)")},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,n),t}(cr),xa=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return ke.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return this.isEquivalentClass(r)?e.prototype.equalsExact.call(this,r,s):!1}else return e.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.reverse=function(){for(var r=this,s=this._geometries.length,l=new Array(s).fill(null),p=0;p0?t.createPoint(n[0]):t.createPoint():e};md.prototype.interfaces_=function(){return[$o.GeometryEditorOperation]};md.prototype.getClass=function(){return md};var yd=function(){};yd.prototype.edit=function(e,t){return e instanceof Ea?t.createLinearRing(this.edit(e.getCoordinateSequence(),e)):e instanceof cr?t.createLineString(this.edit(e.getCoordinateSequence(),e)):e instanceof fo?t.createPoint(this.edit(e.getCoordinateSequence(),e)):e};yd.prototype.interfaces_=function(){return[$o.GeometryEditorOperation]};yd.prototype.getClass=function(){return yd};var yr=function(){var e=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var n=0;n0){var t=new la(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var n=1;n3&&(r=3),r<2?new yr(n):new yr(n,r)}};Ia.prototype.interfaces_=function(){return[np,ns]};Ia.prototype.getClass=function(){return Ia};Ia.instance=function(){return Ia.instanceObject};M0.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00};M0.instanceObject.get=function(){return new Ia};Object.defineProperties(Ia,M0);var hE=function(e){function t(){e.call(this),this.map_=new Map}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n){return this.map_.get(n)||null},t.prototype.put=function(n,r){return this.map_.set(n,r),r},t.prototype.values=function(){for(var n=new ie,r=this.map_.values(),s=r.next();!s.done;)n.add(s.value),s=r.next();return n},t.prototype.entrySet=function(){var n=new L0;return this.map_.entries().forEach(function(r){return n.add(r)}),n},t.prototype.size=function(){return this.map_.size()},t}(Oc),wn=function e(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=e.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof Qs){var t=arguments[0];this._modelType=t,t===e.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var n=arguments[0];this._modelType=e.FIXED,this.setScale(n)}else if(arguments[0]instanceof e){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}}},A0={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};wn.prototype.equals=function(e){if(!(e instanceof wn))return!1;var t=e;return this._modelType===t._modelType&&this._scale===t._scale};wn.prototype.compareTo=function(e){var t=e,n=this.getMaximumSignificantDigits(),r=t.getMaximumSignificantDigits();return new Ys(n).compareTo(new Ys(r))};wn.prototype.getScale=function(){return this._scale};wn.prototype.isFloating=function(){return this._modelType===wn.FLOATING||this._modelType===wn.FLOATING_SINGLE};wn.prototype.getType=function(){return this._modelType};wn.prototype.toString=function(){var e="UNKNOWN";return this._modelType===wn.FLOATING?e="Floating":this._modelType===wn.FLOATING_SINGLE?e="Floating-Single":this._modelType===wn.FIXED&&(e="Fixed (Scale="+this.getScale()+")"),e};wn.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var e=arguments[0];if(Ue.isNaN(e))return e;if(this._modelType===wn.FLOATING_SINGLE){var t=e;return t}return this._modelType===wn.FIXED?Math.round(e*this._scale)/this._scale:e}else if(arguments[0]instanceof St){var n=arguments[0];if(this._modelType===wn.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}};wn.prototype.getMaximumSignificantDigits=function(){var e=16;return this._modelType===wn.FLOATING?e=16:this._modelType===wn.FLOATING_SINGLE?e=6:this._modelType===wn.FIXED&&(e=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),e};wn.prototype.setScale=function(e){this._scale=Math.abs(e)};wn.prototype.interfaces_=function(){return[ns,es]};wn.prototype.getClass=function(){return wn};wn.mostPrecise=function(e,t){return e.compareTo(t)>=0?e:t};A0.serialVersionUID.get=function(){return 7777263578777804e3};A0.maximumPreciseValue.get=function(){return 9007199254740992};Object.defineProperties(wn,A0);var Qs=function e(t){this._name=t||null,e.nameToTypeMap.put(t,this)},k0={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};Qs.prototype.readResolve=function(){return Qs.nameToTypeMap.get(this._name)};Qs.prototype.toString=function(){return this._name};Qs.prototype.interfaces_=function(){return[ns]};Qs.prototype.getClass=function(){return Qs};k0.serialVersionUID.get=function(){return-552860263173159e4};k0.nameToTypeMap.get=function(){return new hE};Object.defineProperties(Qs,k0);wn.Type=Qs;wn.FIXED=new Qs("FIXED");wn.FLOATING=new Qs("FLOATING");wn.FLOATING_SINGLE=new Qs("FLOATING SINGLE");var ln=function e(){this._precisionModel=new wn,this._SRID=0,this._coordinateSequenceFactory=e.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?De(arguments[0],np)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof wn&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},pE={serialVersionUID:{configurable:!0}};ln.prototype.toGeometry=function(e){return e.isNull()?this.createPoint(null):e.getMinX()===e.getMaxX()&&e.getMinY()===e.getMaxY()?this.createPoint(new St(e.getMinX(),e.getMinY())):e.getMinX()===e.getMaxX()||e.getMinY()===e.getMaxY()?this.createLineString([new St(e.getMinX(),e.getMinY()),new St(e.getMaxX(),e.getMaxY())]):this.createPolygon(this.createLinearRing([new St(e.getMinX(),e.getMinY()),new St(e.getMinX(),e.getMaxY()),new St(e.getMaxX(),e.getMaxY()),new St(e.getMaxX(),e.getMinY()),new St(e.getMinX(),e.getMinY())]),null)};ln.prototype.createLineString=function(e){if(e){if(e instanceof Array)return new cr(this.getCoordinateSequenceFactory().create(e),this);if(De(e,yn))return new cr(e,this)}else return new cr(this.getCoordinateSequenceFactory().create([]),this)};ln.prototype.createMultiLineString=function(){if(arguments.length===0)return new Cu(null,this);if(arguments.length===1){var e=arguments[0];return new Cu(e,this)}};ln.prototype.buildGeometry=function(e){for(var t=null,n=!1,r=!1,s=e.iterator();s.hasNext();){var l=s.next(),p=l.getClass();t===null&&(t=p),p!==t&&(n=!0),l.isGeometryCollectionOrDerived()&&(r=!0)}if(t===null)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(ln.toGeometryArray(e));var c=e.iterator().next(),y=e.size()>1;if(y){if(c instanceof Nr)return this.createMultiPolygon(ln.toPolygonArray(e));if(c instanceof cr)return this.createMultiLineString(ln.toLineStringArray(e));if(c instanceof fo)return this.createMultiPoint(ln.toPointArray(e));Ye.shouldNeverReachHere("Unhandled class: "+c.getClass().getName())}return c};ln.prototype.createMultiPointFromCoords=function(e){return this.createMultiPoint(e!==null?this.getCoordinateSequenceFactory().create(e):null)};ln.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof St){var e=arguments[0];return this.createPoint(e!==null?this.getCoordinateSequenceFactory().create([e]):null)}else if(De(arguments[0],yn)){var t=arguments[0];return new fo(t,this)}}};ln.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory};ln.prototype.createPolygon=function(){if(arguments.length===0)return new Nr(null,null,this);if(arguments.length===1){if(De(arguments[0],yn)){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Array){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Ea){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var r=arguments[0],s=arguments[1];return new Nr(r,s,this)}};ln.prototype.getSRID=function(){return this._SRID};ln.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Ri(null,this);if(arguments.length===1){var e=arguments[0];return new Ri(e,this)}};ln.prototype.createGeometry=function(e){var t=new $o(this);return t.edit(e,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})};ln.prototype.getPrecisionModel=function(){return this._precisionModel};ln.prototype.createLinearRing=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)}else if(De(arguments[0],yn)){var t=arguments[0];return new Ea(t,this)}}};ln.prototype.createMultiPolygon=function(){if(arguments.length===0)return new xa(null,this);if(arguments.length===1){var e=arguments[0];return new xa(e,this)}};ln.prototype.createMultiPoint=function(){var e=this;if(arguments.length===0)return new lp(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new lp(t,this)}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)}else if(De(arguments[0],yn)){var r=arguments[0];if(r===null)return this.createMultiPoint(new Array(0).fill(null));for(var s=new Array(r.size()).fill(null),l=0;l=this.size())throw new Error;return this.array_[e]};ua.prototype.push=function(e){return this.array_.push(e),e};ua.prototype.pop=function(e){if(this.array_.length===0)throw new vy;return this.array_.pop()};ua.prototype.peek=function(){if(this.array_.length===0)throw new vy;return this.array_[this.array_.length-1]};ua.prototype.empty=function(){return this.array_.length===0};ua.prototype.isEmpty=function(){return this.empty()};ua.prototype.search=function(e){return this.array_.indexOf(e)};ua.prototype.size=function(){return this.array_.length};ua.prototype.toArray=function(){for(var e=this,t=[],n=0,r=this.array_.length;n0&&this._minIndexthis._minCoord.y&&n.y>this._minCoord.y&&r===pe.CLOCKWISE)&&(s=!0),s&&(this._minIndex=this._minIndex-1)};$s.prototype.getRightmostSideOfSegment=function(e,t){var n=e.getEdge(),r=n.getCoordinates();if(t<0||t+1>=r.length||r[t].y===r[t+1].y)return-1;var s=Xt.LEFT;return r[t].yt._minCoord.x)&&(t._minDe=e,t._minIndex=r,t._minCoord=n[r])};$s.prototype.findRightmostEdgeAtNode=function(){var e=this._minDe.getNode(),t=e.getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)};$s.prototype.findEdge=function(e){for(var t=this,n=e.iterator();n.hasNext();){var r=n.next();r.isForward()&&t.checkForRightmostCoordinate(r)}Ye.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;var s=this.getRightmostSide(this._minDe,this._minIndex);s===Xt.LEFT&&(this._orientedDe=this._minDe.getSym())};$s.prototype.interfaces_=function(){return[]};$s.prototype.getClass=function(){return $s};var il=function(e){function t(n,r){e.call(this,t.msgWithCoord(n,r)),this.pt=r?new St(r):null,this.name="TopologyException"}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getCoordinate=function(){return this.pt},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.msgWithCoord=function(n,r){return r?n:n+" [ "+r+" ]"},t}(nl),by=function(){this.array_=[]};by.prototype.addLast=function(e){this.array_.push(e)};by.prototype.removeFirst=function(){return this.array_.shift()};by.prototype.isEmpty=function(){return this.array_.length===0};var Ni=function(){this._finder=null,this._dirEdgeList=new ie,this._nodes=new ie,this._rightMostCoord=null,this._env=null,this._finder=new $s};Ni.prototype.clearVisitedEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.setVisited(!1)}};Ni.prototype.getRightmostCoordinate=function(){return this._rightMostCoord};Ni.prototype.computeNodeDepth=function(e){for(var t=this,n=null,r=e.getEdges().iterator();r.hasNext();){var s=r.next();if(s.isVisited()||s.getSym().isVisited()){n=s;break}}if(n===null)throw new il("unable to find edge to compute depths at "+e.getCoordinate());e.getEdges().computeDepths(n);for(var l=e.getEdges().iterator();l.hasNext();){var p=l.next();p.setVisited(!0),t.copySymDepths(p)}};Ni.prototype.computeDepth=function(e){this.clearVisitedEdges();var t=this._finder.getEdge();t.setEdgeDepths(Xt.RIGHT,e),this.copySymDepths(t),this.computeDepths(t)};Ni.prototype.create=function(e){this.addReachable(e),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()};Ni.prototype.findResultEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.getDepth(Xt.RIGHT)>=1&&t.getDepth(Xt.LEFT)<=0&&!t.isInteriorAreaEdge()&&t.setInResult(!0)}};Ni.prototype.computeDepths=function(e){var t=this,n=new L0,r=new by,s=e.getNode();for(r.addLast(s),n.add(s),e.setVisited(!0);!r.isEmpty();){var l=r.removeFirst();n.add(l),t.computeNodeDepth(l);for(var p=l.getEdges().iterator();p.hasNext();){var c=p.next(),y=c.getSym();if(!y.isVisited()){var w=y.getNode();n.contains(w)||(r.addLast(w),n.add(w))}}}};Ni.prototype.compareTo=function(e){var t=e;return this._rightMostCoord.xt._rightMostCoord.x?1:0};Ni.prototype.getEnvelope=function(){if(this._env===null){for(var e=new Se,t=this._dirEdgeList.iterator();t.hasNext();)for(var n=t.next(),r=n.getEdge().getCoordinates(),s=0;sthis.location.length){var n=new Array(3).fill(null);n[Xt.ON]=this.location[Xt.ON],n[Xt.LEFT]=Ct.NONE,n[Xt.RIGHT]=Ct.NONE,this.location=n}for(var r=0;r1&&e.append(Ct.toLocationSymbol(this.location[Xt.LEFT])),e.append(Ct.toLocationSymbol(this.location[Xt.ON])),this.location.length>1&&e.append(Ct.toLocationSymbol(this.location[Xt.RIGHT])),e.toString()};Un.prototype.setLocations=function(e,t,n){this.location[Xt.ON]=e,this.location[Xt.LEFT]=t,this.location[Xt.RIGHT]=n};Un.prototype.get=function(e){return e1};Un.prototype.isAnyNull=function(){for(var e=this,t=0;te._maxNodeDegree&&(e._maxNodeDegree=r),t=e.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2};Ir.prototype.addPoints=function(e,t,n){var r=this,s=e.getCoordinates();if(t){var l=1;n&&(l=0);for(var p=l;p=0;y--)r._pts.add(s[y])}};Ir.prototype.isHole=function(){return this._isHole};Ir.prototype.setInResult=function(){var e=this._startDe;do e.getEdge().setInResult(!0),e=e.getNext();while(e!==this._startDe)};Ir.prototype.containsPoint=function(e){var t=this.getLinearRing(),n=t.getEnvelopeInternal();if(!n.contains(e)||!pe.isPointInRing(e,t.getCoordinates()))return!1;for(var r=this._holes.iterator();r.hasNext();){var s=r.next();if(s.containsPoint(e))return!1}return!0};Ir.prototype.addHole=function(e){this._holes.add(e)};Ir.prototype.isShell=function(){return this._shell===null};Ir.prototype.getLabel=function(){return this._label};Ir.prototype.getEdges=function(){return this._edges};Ir.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree};Ir.prototype.getShell=function(){return this._shell};Ir.prototype.mergeLabel=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],r=t.getLocation(n,Xt.RIGHT);if(r===Ct.NONE)return null;if(this._label.getLocation(n)===Ct.NONE)return this._label.setLocation(n,r),null}};Ir.prototype.setShell=function(e){this._shell=e,e!==null&&e.addHole(this)};Ir.prototype.toPolygon=function(e){for(var t=this,n=new Array(this._holes.size()).fill(null),r=0;r=2,"found partial label"),this.computeIM(e)};Do.prototype.isInResult=function(){return this._isInResult};Do.prototype.isVisited=function(){return this._isVisited};Do.prototype.interfaces_=function(){return[]};Do.prototype.getClass=function(){return Do};var xy=function(e){function t(){e.call(this),this._coord=null,this._edges=null;var n=arguments[0],r=arguments[1];this._coord=n,this._edges=r,this._label=new Tn(0,Ct.NONE)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();){var r=n.next();if(r.getEdge().isInResult())return!0}return!1},t.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},t.prototype.getCoordinate=function(){return this._coord},t.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(n){},t.prototype.computeMergedLocation=function(n,r){var s=Ct.NONE;if(s=this._label.getLocation(r),!n.isNull(r)){var l=n.getLocation(r);s!==Ct.BOUNDARY&&(s=l)}return s},t.prototype.setLabel=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1];this._label===null?this._label=new Tn(n,r):this._label.setLocation(n,r)}else return e.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var n=this;if(arguments[0]instanceof t){var r=arguments[0];this.mergeLabel(r._label)}else if(arguments[0]instanceof Tn)for(var s=arguments[0],l=0;l<2;l++){var p=n.computeMergedLocation(s,l),c=n._label.getLocation(l);c===Ct.NONE&&n._label.setLocation(l,p)}},t.prototype.add=function(n){this._edges.insert(n),n.setNode(this)},t.prototype.setLabelBoundary=function(n){if(this._label===null)return null;var r=Ct.NONE;this._label!==null&&(r=this._label.getLocation(n));var s=null;switch(r){case Ct.BOUNDARY:s=Ct.INTERIOR;break;case Ct.INTERIOR:s=Ct.BOUNDARY;break;default:s=Ct.BOUNDARY;break}this._label.setLocation(n,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Do),ta=function(){this.nodeMap=new bi,this.nodeFact=null;var e=arguments[0];this.nodeFact=e};ta.prototype.find=function(e){return this.nodeMap.get(e)};ta.prototype.addNode=function(){if(arguments[0]instanceof St){var e=arguments[0],t=this.nodeMap.get(e);return t===null&&(t=this.nodeFact.createNode(e),this.nodeMap.put(e,t)),t}else if(arguments[0]instanceof xy){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return r===null?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}};ta.prototype.print=function(e){for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}};ta.prototype.iterator=function(){return this.nodeMap.values().iterator()};ta.prototype.values=function(){return this.nodeMap.values()};ta.prototype.getBoundaryNodes=function(e){for(var t=new ie,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(e)===Ct.BOUNDARY&&t.add(r)}return t};ta.prototype.add=function(e){var t=e.getCoordinate(),n=this.addNode(t);n.add(e)};ta.prototype.interfaces_=function(){return[]};ta.prototype.getClass=function(){return ta};var An=function(){},Ud={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};An.prototype.interfaces_=function(){return[]};An.prototype.getClass=function(){return An};An.isNorthern=function(e){return e===An.NE||e===An.NW};An.isOpposite=function(e,t){if(e===t)return!1;var n=(e-t+4)%4;return n===2};An.commonHalfPlane=function(e,t){if(e===t)return e;var n=(e-t+4)%4;if(n===2)return-1;var r=et?e:t;return r===0&&s===3?3:r};An.isInHalfPlane=function(e,t){return t===An.SE?e===An.SE||e===An.SW:e===t||e===t+1};An.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];if(e===0&&t===0)throw new Qn("Cannot compute the quadrant for point ( "+e+", "+t+" )");return e>=0?t>=0?An.NE:An.SE:t>=0?An.NW:An.SW}else if(arguments[0]instanceof St&&arguments[1]instanceof St){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new Qn("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?An.NE:An.SE:r.y>=n.y?An.NW:An.SW}};Ud.NE.get=function(){return 0};Ud.NW.get=function(){return 1};Ud.SW.get=function(){return 2};Ud.SE.get=function(){return 3};Object.defineProperties(An,Ud);var xi=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],r=arguments[2],s=null;this._edge=t,this.init(n,r),this._label=s}else if(arguments.length===4){var l=arguments[0],p=arguments[1],c=arguments[2],y=arguments[3];this._edge=l,this.init(p,c),this._label=y}};xi.prototype.compareDirection=function(e){return this._dx===e._dx&&this._dy===e._dy?0:this._quadrant>e._quadrant?1:this._quadrant2){p.linkDirectedEdgesForMinimalEdgeRings();var c=p.buildMinimalRings(),y=r.findShell(c);y!==null?(r.placePolygonHoles(y,c),t.add(y)):n.addAll(c)}else s.add(p)}return s};go.prototype.containsPoint=function(e){for(var t=this._shellList.iterator();t.hasNext();){var n=t.next();if(n.containsPoint(e))return!0}return!1};go.prototype.buildMaximalEdgeRings=function(e){for(var t=this,n=new ie,r=e.iterator();r.hasNext();){var s=r.next();if(s.isInResult()&&s.getLabel().isArea()&&s.getEdgeRing()===null){var l=new i3(s,t._geometryFactory);n.add(l),l.setInResult()}}return n};go.prototype.placePolygonHoles=function(e,t){for(var n=t.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(e)}};go.prototype.getPolygons=function(){var e=this.computePolygons(this._shellList);return e};go.prototype.findEdgeRingContaining=function(e,t){for(var n=e.getLinearRing(),r=n.getEnvelopeInternal(),s=n.getCoordinateN(0),l=null,p=null,c=t.iterator();c.hasNext();){var y=c.next(),w=y.getLinearRing(),T=w.getEnvelopeInternal();l!==null&&(p=l.getLinearRing().getEnvelopeInternal());var L=!1;T.contains(r)&&pe.isPointInRing(s,w.getCoordinates())&&(L=!0),L&&(l===null||p.contains(T))&&(l=y)}return l};go.prototype.findShell=function(e){for(var t=0,n=null,r=e.iterator();r.hasNext();){var s=r.next();s.isHole()||(n=s,t++)}return Ye.isTrue(t<=1,"found two shells in MinimalEdgeRing list"),n};go.prototype.add=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];ir.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(t),s=new ie,l=this.buildMinimalEdgeRings(r,this._shellList,s);this.sortShellsAndHoles(l,this._shellList,s),this.placeFreeHoles(this._shellList,s)}};go.prototype.interfaces_=function(){return[]};go.prototype.getClass=function(){return go};var cp=function(){};cp.prototype.getBounds=function(){};cp.prototype.interfaces_=function(){return[]};cp.prototype.getClass=function(){return cp};var vs=function(){this._bounds=null,this._item=null;var e=arguments[0],t=arguments[1];this._bounds=e,this._item=t};vs.prototype.getItem=function(){return this._item};vs.prototype.getBounds=function(){return this._bounds};vs.prototype.interfaces_=function(){return[cp,ns]};vs.prototype.getClass=function(){return vs};var ol=function(){this._size=null,this._items=null,this._size=0,this._items=new ie,this._items.add(null)};ol.prototype.poll=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};ol.prototype.size=function(){return this._size};ol.prototype.reorder=function(e){for(var t=this,n=null,r=this._items.get(e);e*2<=this._size&&(n=e*2,n!==t._size&&t._items.get(n+1).compareTo(t._items.get(n))<0&&n++,t._items.get(n).compareTo(r)<0);e=n)t._items.set(e,t._items.get(n));this._items.set(e,r)};ol.prototype.clear=function(){this._size=0,this._items.clear()};ol.prototype.isEmpty=function(){return this._size===0};ol.prototype.add=function(e){var t=this;this._items.add(null),this._size+=1;var n=this._size;for(this._items.set(0,e);e.compareTo(this._items.get(Math.trunc(n/2)))<0;n/=2)t._items.set(n,t._items.get(Math.trunc(n/2)));this._items.set(n,e)};ol.prototype.interfaces_=function(){return[]};ol.prototype.getClass=function(){return ol};var jl=function(){};jl.prototype.visitItem=function(e){};jl.prototype.interfaces_=function(){return[]};jl.prototype.getClass=function(){return jl};var vc=function(){};vc.prototype.insert=function(e,t){};vc.prototype.remove=function(e,t){};vc.prototype.query=function(){};vc.prototype.interfaces_=function(){return[]};vc.prototype.getClass=function(){return vc};var Rr=function(){if(this._childBoundables=new ie,this._bounds=null,this._level=null,arguments.length!==0&&arguments.length===1){var e=arguments[0];this._level=e}},dE={serialVersionUID:{configurable:!0}};Rr.prototype.getLevel=function(){return this._level};Rr.prototype.size=function(){return this._childBoundables.size()};Rr.prototype.getChildBoundables=function(){return this._childBoundables};Rr.prototype.addChildBoundable=function(e){Ye.isTrue(this._bounds===null),this._childBoundables.add(e)};Rr.prototype.isEmpty=function(){return this._childBoundables.isEmpty()};Rr.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds};Rr.prototype.interfaces_=function(){return[cp,ns]};Rr.prototype.getClass=function(){return Rr};dE.serialVersionUID.get=function(){return 6493722185909574e3};Object.defineProperties(Rr,dE);var bs=function(){};bs.reverseOrder=function(){return{compare:function(e,t){return t.compareTo(e)}}};bs.min=function(e){return bs.sort(e),e.get(0)};bs.sort=function(e,t){var n=e.toArray();t?Su.sort(n,t):Su.sort(n);for(var r=e.iterator(),s=0,l=n.length;sSr.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,e,t),null):(this.expand(this._boundable2,this._boundable1,e,t),null);if(n)return this.expand(this._boundable1,this._boundable2,e,t),null;if(r)return this.expand(this._boundable2,this._boundable1,e,t),null;throw new Qn("neither boundable is composite")};Sr.prototype.isLeaves=function(){return!(Sr.isComposite(this._boundable1)||Sr.isComposite(this._boundable2))};Sr.prototype.compareTo=function(e){var t=e;return this._distancet._distance?1:0};Sr.prototype.expand=function(e,t,n,r){for(var s=this,l=e.getChildBoundables(),p=l.iterator();p.hasNext();){var c=p.next(),y=new Sr(c,t,s._itemDistance);y.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},wy={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};ri.prototype.getNodeCapacity=function(){return this._nodeCapacity};ri.prototype.lastNode=function(e){return e.get(e.size()-1)};ri.prototype.size=function(){var e=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var t=arguments[0],n=0,r=t.getChildBoundables().iterator();r.hasNext();){var s=r.next();s instanceof Rr?n+=e.size(s):s instanceof vs&&(n+=1)}return n}};ri.prototype.removeItem=function(e,t){for(var n=null,r=e.getChildBoundables().iterator();r.hasNext();){var s=r.next();s instanceof vs&&s.getItem()===t&&(n=s)}return n!==null?(e.getChildBoundables().remove(n),!0):!1};ri.prototype.itemsTree=function(){var e=this;if(arguments.length===0){this.build();var t=this.itemsTree(this._root);return t===null?new ie:t}else if(arguments.length===1){for(var n=arguments[0],r=new ie,s=n.getChildBoundables().iterator();s.hasNext();){var l=s.next();if(l instanceof Rr){var p=e.itemsTree(l);p!==null&&r.add(p)}else l instanceof vs?r.add(l.getItem()):Ye.shouldNeverReachHere()}return r.size()<=0?null:r}};ri.prototype.insert=function(e,t){Ye.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new vs(e,t))};ri.prototype.boundablesAtLevel=function(){var e=this;if(arguments.length===1){var t=arguments[0],n=new ie;return this.boundablesAtLevel(t,this._root,n),n}else if(arguments.length===3){var r=arguments[0],s=arguments[1],l=arguments[2];if(Ye.isTrue(r>-2),s.getLevel()===r)return l.add(s),null;for(var p=s.getChildBoundables().iterator();p.hasNext();){var c=p.next();c instanceof Rr?e.boundablesAtLevel(r,c,l):(Ye.isTrue(c instanceof vs),r===-1&&l.add(c))}return null}};ri.prototype.query=function(){var e=this;if(arguments.length===1){var t=arguments[0];this.build();var n=new ie;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,n),n}else if(arguments.length===2){var r=arguments[0],s=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,s)}else if(arguments.length===3){if(De(arguments[2],jl)&&arguments[0]instanceof Object&&arguments[1]instanceof Rr)for(var l=arguments[0],p=arguments[1],c=arguments[2],y=p.getChildBoundables(),w=0;wn&&(n=l)}}return n+1}};ri.prototype.createParentBoundables=function(e,t){var n=this;Ye.isTrue(!e.isEmpty());var r=new ie;r.add(this.createNode(t));var s=new ie(e);bs.sort(s,this.getComparator());for(var l=s.iterator();l.hasNext();){var p=l.next();n.lastNode(r).getChildBoundables().size()===n.getNodeCapacity()&&r.add(n.createNode(t)),n.lastNode(r).addChildBoundable(p)}return r};ri.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()};ri.prototype.interfaces_=function(){return[ns]};ri.prototype.getClass=function(){return ri};ri.compareDoubles=function(e,t){return e>t?1:e0);for(var p=new ie,c=0;c0;){var B=z.poll(),Y=B.getDistance();if(Y>=L)break;B.isLeaves()?(L=Y,A=B):B.expandToQueue(z,L)}return[A.getBoundable(0).getItem(),A.getBoundable(1).getItem()]}}else if(arguments.length===3){var et=arguments[0],at=arguments[1],W=arguments[2],H=new vs(et,at),nt=new Sr(this.getRoot(),H,W);return this.nearestNeighbour(nt)[0]}},t.prototype.interfaces_=function(){return[vc,ns]},t.prototype.getClass=function(){return t},t.centreX=function(r){return t.avg(r.getMinX(),r.getMaxX())},t.avg=function(r,s){return(r+s)/2},t.centreY=function(r){return t.avg(r.getMinY(),r.getMaxY())},n.STRtreeNode.get=function(){return Sw},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[ep]},compare:function(r,s){return e.compareDoubles(t.centreX(r.getBounds()),t.centreX(s.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[ep]},compare:function(r,s){return e.compareDoubles(t.centreY(r.getBounds()),t.centreY(s.getBounds()))}}},n.intersectsOp.get=function(){return{interfaces_:function(){return[e.IntersectsOp]},intersects:function(r,s){return r.intersects(s)}}},n.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,n),t}(ri),Sw=function(e){function t(){var n=arguments[0];e.call(this,n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var n=null,r=this.getChildBoundables().iterator();r.hasNext();){var s=r.next();n===null?n=new Se(s.getBounds()):n.expandToInclude(s.getBounds())}return n},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Rr),Xi=function(){};Xi.prototype.interfaces_=function(){return[]};Xi.prototype.getClass=function(){return Xi};Xi.relativeSign=function(e,t){return et?1:0};Xi.compare=function(e,t,n){if(t.equals2D(n))return 0;var r=Xi.relativeSign(t.x,n.x),s=Xi.relativeSign(t.y,n.y);switch(e){case 0:return Xi.compareValue(r,s);case 1:return Xi.compareValue(s,r);case 2:return Xi.compareValue(s,-r);case 3:return Xi.compareValue(-r,s);case 4:return Xi.compareValue(-r,-s);case 5:return Xi.compareValue(-s,-r);case 6:return Xi.compareValue(-s,r);case 7:return Xi.compareValue(r,-s)}return Ye.shouldNeverReachHere("invalid octant value"),0};Xi.compareValue=function(e,t){return e<0?-1:e>0?1:t<0?-1:t>0?1:0};var ql=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],r=arguments[3];this._segString=e,this.coord=new St(t),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!t.equals2D(e.getCoordinate(n))};ql.prototype.getCoordinate=function(){return this.coord};ql.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex)};ql.prototype.compareTo=function(e){var t=e;return this.segmentIndext.segmentIndex?1:this.coord.equals2D(t.coord)?0:Xi.compare(this._segmentOctant,this.coord,t.coord)};ql.prototype.isEndPoint=function(e){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===e};ql.prototype.isInterior=function(){return this._isInterior};ql.prototype.interfaces_=function(){return[es]};ql.prototype.getClass=function(){return ql};var Oi=function(){this._nodeMap=new bi,this._edge=null;var e=arguments[0];this._edge=e};Oi.prototype.getSplitCoordinates=function(){var e=this,t=new Bd;this.addEndpoints();for(var n=this.iterator(),r=n.next();n.hasNext();){var s=n.next();e.addEdgeCoordinates(r,s,t),r=s}return t.toCoordinateArray()};Oi.prototype.addCollapsedNodes=function(){var e=this,t=new ie;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var n=t.iterator();n.hasNext();){var r=n.next().intValue();e.add(e._edge.getCoordinate(r),r)}};Oi.prototype.print=function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}};Oi.prototype.findCollapsesFromExistingVertices=function(e){for(var t=this,n=0;n=0?t>=0?n>=r?0:1:n>=r?7:6:t>=0?n>=r?3:2:n>=r?4:5}else if(arguments[0]instanceof St&&arguments[1]instanceof St){var s=arguments[0],l=arguments[1],p=l.x-s.x,c=l.y-s.y;if(p===0&&c===0)throw new Qn("Cannot compute the octant for two identical points "+s);return bc.octant(p,c)}};var Ca=function(){};Ca.prototype.getCoordinates=function(){};Ca.prototype.size=function(){};Ca.prototype.getCoordinate=function(e){};Ca.prototype.isClosed=function(){};Ca.prototype.setData=function(e){};Ca.prototype.getData=function(){};Ca.prototype.interfaces_=function(){return[]};Ca.prototype.getClass=function(){return Ca};var _d=function(){};_d.prototype.addIntersection=function(e,t){};_d.prototype.interfaces_=function(){return[Ca]};_d.prototype.getClass=function(){return _d};var br=function(){this._nodeList=new Oi(this),this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};br.prototype.getCoordinates=function(){return this._pts};br.prototype.size=function(){return this._pts.length};br.prototype.getCoordinate=function(e){return this._pts[e]};br.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};br.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(e),this.getCoordinate(e+1))};br.prototype.setData=function(e){this._data=e};br.prototype.safeOctant=function(e,t){return e.equals2D(t)?0:bc.octant(e,t)};br.prototype.getData=function(){return this._data};br.prototype.addIntersection=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],r=arguments[1],s=arguments[3],l=new St(n.getIntersection(s));this.addIntersection(l,r)}};br.prototype.toString=function(){return ys.toLineString(new yr(this._pts))};br.prototype.getNodeList=function(){return this._nodeList};br.prototype.addIntersectionNode=function(e,t){var n=t,r=n+1;if(r=0&&n>=0||t<=0&&n<=0?Math.max(t,n):0}else if(arguments[0]instanceof St){var r=arguments[0];return pe.orientationIndex(this.p0,this.p1,r)}};Ie.prototype.toGeometry=function(e){return e.createLineString([this.p0,this.p1])};Ie.prototype.isVertical=function(){return this.p0.x===this.p1.x};Ie.prototype.equals=function(e){if(!(e instanceof Ie))return!1;var t=e;return this.p0.equals(t.p0)&&this.p1.equals(t.p1)};Ie.prototype.intersection=function(e){var t=new zu;return t.computeIntersection(this.p0,this.p1,e.p0,e.p1),t.hasIntersection()?t.getIntersection(0):null};Ie.prototype.project=function(){if(arguments[0]instanceof St){var e=arguments[0];if(e.equals(this.p0)||e.equals(this.p1))return new St(e);var t=this.projectionFactor(e),n=new St;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}else if(arguments[0]instanceof Ie){var r=arguments[0],s=this.projectionFactor(r.p0),l=this.projectionFactor(r.p1);if(s>=1&&l>=1||s<=0&&l<=0)return null;var p=this.project(r.p0);s<0&&(p=this.p0),s>1&&(p=this.p1);var c=this.project(r.p1);return l<0&&(c=this.p0),l>1&&(c=this.p1),new Ie(p,c)}};Ie.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()};Ie.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)};Ie.prototype.getCoordinate=function(e){return e===0?this.p0:this.p1};Ie.prototype.distancePerpendicular=function(e){return pe.distancePointLinePerpendicular(e,this.p0,this.p1)};Ie.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)};Ie.prototype.midPoint=function(){return Ie.midPoint(this.p0,this.p1)};Ie.prototype.projectionFactor=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,r=t*t+n*n;if(r<=0)return Ue.NaN;var s=((e.x-this.p0.x)*t+(e.y-this.p0.y)*n)/r;return s};Ie.prototype.closestPoints=function(e){var t=this.intersection(e);if(t!==null)return[t,t];var n=new Array(2).fill(null),r=Ue.MAX_VALUE,s=null,l=this.closestPoint(e.p0);r=l.distance(e.p0),n[0]=l,n[1]=e.p0;var p=this.closestPoint(e.p1);s=p.distance(e.p1),s0&&t<1)return this.project(e);var n=this.p0.distance(e),r=this.p1.distance(e);return n1||Ue.isNaN(t))&&(t=1),t};Ie.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"};Ie.prototype.isHorizontal=function(){return this.p0.y===this.p1.y};Ie.prototype.distance=function(){if(arguments[0]instanceof Ie){var e=arguments[0];return pe.distanceLineLine(this.p0,this.p1,e.p0,e.p1)}else if(arguments[0]instanceof St){var t=arguments[0];return pe.distancePointLine(t,this.p0,this.p1)}};Ie.prototype.pointAlong=function(e){var t=new St;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};Ie.prototype.hashCode=function(){var e=Ue.doubleToLongBits(this.p0.x);e^=Ue.doubleToLongBits(this.p0.y)*31;var t=Math.trunc(e)^Math.trunc(e>>32),n=Ue.doubleToLongBits(this.p1.x);n^=Ue.doubleToLongBits(this.p1.y)*31;var r=Math.trunc(n)^Math.trunc(n>>32);return t^r};Ie.prototype.interfaces_=function(){return[es,ns]};Ie.prototype.getClass=function(){return Ie};Ie.midPoint=function(e,t){return new St((e.x+t.x)/2,(e.y+t.y)/2)};mE.serialVersionUID.get=function(){return 0x2d2172135f411c00};Object.defineProperties(Ie,mE);var vd=function(){this.tempEnv1=new Se,this.tempEnv2=new Se,this._overlapSeg1=new Ie,this._overlapSeg2=new Ie};vd.prototype.overlap=function(){if(arguments.length!==2&&arguments.length===4){var e=arguments[0],t=arguments[1],n=arguments[2],r=arguments[3];e.getLineSegment(t,this._overlapSeg1),n.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}};vd.prototype.interfaces_=function(){return[]};vd.prototype.getClass=function(){return vd};var mo=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],r=arguments[3];this._pts=e,this._start=t,this._end=n,this._context=r};mo.prototype.getLineSegment=function(e,t){t.p0=this._pts[e],t.p1=this._pts[e+1]};mo.prototype.computeSelect=function(e,t,n,r){var s=this._pts[t],l=this._pts[n];if(r.tempEnv1.init(s,l),n-t===1)return r.select(this,t),null;if(!e.intersects(r.tempEnv1))return null;var p=Math.trunc((t+n)/2);t=e.length-1)return e.length-1;for(var r=An.quadrant(e[n],e[n+1]),s=t+1;sp.getId()&&(p.computeOverlaps(w,s),r._nOverlaps++),r._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},n.SegmentOverlapAction.get=function(){return Ew},Object.defineProperties(t,n),t}(bd),Ew=function(e){function t(){e.call(this),this._si=null;var n=arguments[0];this._si=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(arguments.length===4){var n=arguments[0],r=arguments[1],s=arguments[2],l=arguments[3],p=n.getContext(),c=s.getContext();this._si.processIntersections(p,r,c,l)}else return e.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(vd),xn=function e(){if(this._quadrantSegments=e.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=e.CAP_ROUND,this._joinStyle=e.JOIN_ROUND,this._mitreLimit=e.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=e.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setQuadrantSegments(t)}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(arguments.length===4){var s=arguments[0],l=arguments[1],p=arguments[2],c=arguments[3];this.setQuadrantSegments(s),this.setEndCapStyle(l),this.setJoinStyle(p),this.setMitreLimit(c)}}},pl={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};xn.prototype.getEndCapStyle=function(){return this._endCapStyle};xn.prototype.isSingleSided=function(){return this._isSingleSided};xn.prototype.setQuadrantSegments=function(e){this._quadrantSegments=e,this._quadrantSegments===0&&(this._joinStyle=xn.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=xn.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),e<=0&&(this._quadrantSegments=1),this._joinStyle!==xn.JOIN_ROUND&&(this._quadrantSegments=xn.DEFAULT_QUADRANT_SEGMENTS)};xn.prototype.getJoinStyle=function(){return this._joinStyle};xn.prototype.setJoinStyle=function(e){this._joinStyle=e};xn.prototype.setSimplifyFactor=function(e){this._simplifyFactor=e<0?0:e};xn.prototype.getSimplifyFactor=function(){return this._simplifyFactor};xn.prototype.getQuadrantSegments=function(){return this._quadrantSegments};xn.prototype.setEndCapStyle=function(e){this._endCapStyle=e};xn.prototype.getMitreLimit=function(){return this._mitreLimit};xn.prototype.setMitreLimit=function(e){this._mitreLimit=e};xn.prototype.setSingleSided=function(e){this._isSingleSided=e};xn.prototype.interfaces_=function(){return[]};xn.prototype.getClass=function(){return xn};xn.bufferDistanceError=function(e){var t=Math.PI/2/e;return 1-Math.cos(t/2)};pl.CAP_ROUND.get=function(){return 1};pl.CAP_FLAT.get=function(){return 2};pl.CAP_SQUARE.get=function(){return 3};pl.JOIN_ROUND.get=function(){return 1};pl.JOIN_MITRE.get=function(){return 2};pl.JOIN_BEVEL.get=function(){return 3};pl.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8};pl.DEFAULT_MITRE_LIMIT.get=function(){return 5};pl.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01};Object.defineProperties(xn,pl);var hr=function(e){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=pe.COUNTERCLOCKWISE,this._inputLine=e||null},Gd={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};hr.prototype.isDeletable=function(e,t,n,r){var s=this._inputLine[e],l=this._inputLine[t],p=this._inputLine[n];return!this.isConcave(s,l,p)||!this.isShallow(s,l,p,r)?!1:this.isShallowSampled(s,l,e,n,r)};hr.prototype.deleteShallowConcavities=function(){for(var e=this,t=1,n=this.findNextNonDeletedIndex(t),r=this.findNextNonDeletedIndex(n),s=!1;r=0;s--)n.addPt(e[s])};Ro.prototype.isRedundant=function(e){if(this._ptList.size()<1)return!1;var t=this._ptList.get(this._ptList.size()-1),n=e.distance(t);return nMath.PI;)e-=fn.PI_TIMES_2;for(;e<=-Math.PI;)e+=fn.PI_TIMES_2;return e};fn.angle=function(){if(arguments.length===1){var e=arguments[0];return Math.atan2(e.y,e.x)}else if(arguments.length===2){var t=arguments[0],n=arguments[1],r=n.x-t.x,s=n.y-t.y;return Math.atan2(s,r)}};fn.isAcute=function(e,t,n){var r=e.x-t.x,s=e.y-t.y,l=n.x-t.x,p=n.y-t.y,c=r*l+s*p;return c>0};fn.isObtuse=function(e,t,n){var r=e.x-t.x,s=e.y-t.y,l=n.x-t.x,p=n.y-t.y,c=r*l+s*p;return c<0};fn.interiorAngle=function(e,t,n){var r=fn.angle(t,e),s=fn.angle(t,n);return Math.abs(s-r)};fn.normalizePositive=function(e){if(e<0){for(;e<0;)e+=fn.PI_TIMES_2;e>=fn.PI_TIMES_2&&(e=0)}else{for(;e>=fn.PI_TIMES_2;)e-=fn.PI_TIMES_2;e<0&&(e=0)}return e};fn.angleBetween=function(e,t,n){var r=fn.angle(t,e),s=fn.angle(t,n);return fn.diff(r,s)};fn.diff=function(e,t){var n=null;return eMath.PI&&(n=2*Math.PI-n),n};fn.toRadians=function(e){return e*Math.PI/180};fn.getTurn=function(e,t){var n=Math.sin(t-e);return n>0?fn.COUNTERCLOCKWISE:n<0?fn.CLOCKWISE:fn.NONE};fn.angleBetweenOriented=function(e,t,n){var r=fn.angle(t,e),s=fn.angle(t,n),l=s-r;return l<=-Math.PI?l+fn.PI_TIMES_2:l>Math.PI?l-fn.PI_TIMES_2:l};zc.PI_TIMES_2.get=function(){return 2*Math.PI};zc.PI_OVER_2.get=function(){return Math.PI/2};zc.PI_OVER_4.get=function(){return Math.PI/4};zc.COUNTERCLOCKWISE.get=function(){return pe.COUNTERCLOCKWISE};zc.CLOCKWISE.get=function(){return pe.CLOCKWISE};zc.NONE.get=function(){return pe.COLLINEAR};Object.defineProperties(fn,zc);var Xn=function e(){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 Ie,this._seg1=new Ie,this._offset0=new Ie,this._offset1=new Ie,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=t,this._bufParams=n,this._li=new zu,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===xn.JOIN_ROUND&&(this._closingSegLengthFactor=e.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},jd={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Xn.prototype.addNextSegment=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=pe.computeOrientation(this._s0,this._s1,this._s2),r=n===pe.CLOCKWISE&&this._side===Xt.LEFT||n===pe.COUNTERCLOCKWISE&&this._side===Xt.RIGHT;n===0?this.addCollinear(t):r?this.addOutsideTurn(n,t):this.addInsideTurn(n,t)};Xn.prototype.addLineEndCap=function(e,t){var n=new Ie(e,t),r=new Ie;this.computeOffsetSegment(n,Xt.LEFT,this._distance,r);var s=new Ie;this.computeOffsetSegment(n,Xt.RIGHT,this._distance,s);var l=t.x-e.x,p=t.y-e.y,c=Math.atan2(p,l);switch(this._bufParams.getEndCapStyle()){case xn.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(t,c+Math.PI/2,c-Math.PI/2,pe.CLOCKWISE,this._distance),this._segList.addPt(s.p1);break;case xn.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(s.p1);break;case xn.CAP_SQUARE:var y=new St;y.x=Math.abs(this._distance)*Math.cos(c),y.y=Math.abs(this._distance)*Math.sin(c);var w=new St(r.p1.x+y.x,r.p1.y+y.y),T=new St(s.p1.x+y.x,s.p1.y+y.y);this._segList.addPt(w),this._segList.addPt(T);break}};Xn.prototype.getCoordinates=function(){var e=this._segList.getCoordinates();return e};Xn.prototype.addMitreJoin=function(e,t,n,r){var s=!0,l=null;try{l=gs.intersection(t.p0,t.p1,n.p0,n.p1);var p=r<=0?1:l.distance(e)/Math.abs(r);p>this._bufParams.getMitreLimit()&&(s=!1)}catch(c){if(c instanceof Pp)l=new St(0,0),s=!1;else throw c}finally{}s?this._segList.addPt(l):this.addLimitedMitreJoin(t,n,r,this._bufParams.getMitreLimit())};Xn.prototype.addFilletCorner=function(e,t,n,r,s){var l=t.x-e.x,p=t.y-e.y,c=Math.atan2(p,l),y=n.x-e.x,w=n.y-e.y,T=Math.atan2(w,y);r===pe.CLOCKWISE?c<=T&&(c+=2*Math.PI):c>=T&&(c-=2*Math.PI),this._segList.addPt(t),this.addFilletArc(e,c,T,r,s),this._segList.addPt(n)};Xn.prototype.addOutsideTurn=function(e,t){if(this._offset0.p1.distance(this._offset1.p0)0){var n=new St((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 r=new St((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(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}};Xn.prototype.createCircle=function(e){var t=new St(e.x+this._distance,e.y);this._segList.addPt(t),this.addFilletArc(e,0,2*Math.PI,-1,this._distance),this._segList.closeRing()};Xn.prototype.addBevelJoin=function(e,t){this._segList.addPt(e.p1),this._segList.addPt(t.p0)};Xn.prototype.init=function(e){this._distance=e,this._maxCurveSegmentError=e*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Ro,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(e*Xn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)};Xn.prototype.addCollinear=function(e){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var t=this._li.getIntersectionNum();t>=2&&(this._bufParams.getJoinStyle()===xn.JOIN_BEVEL||this._bufParams.getJoinStyle()===xn.JOIN_MITRE?(e&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,pe.CLOCKWISE,this._distance))};Xn.prototype.closeRing=function(){this._segList.closeRing()};Xn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle};Xn.prototype.interfaces_=function(){return[]};Xn.prototype.getClass=function(){return Xn};jd.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001};jd.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001};jd.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6};jd.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80};Object.defineProperties(Xn,jd);var Ki=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var e=arguments[0],t=arguments[1];this._precisionModel=e,this._bufParams=t};Ki.prototype.getOffsetCurve=function(e,t){if(this._distance=t,t===0)return null;var n=t<0,r=Math.abs(t),s=this.getSegGen(r);e.length<=1?this.computePointCurve(e[0],s):this.computeOffsetCurve(e,n,s);var l=s.getCoordinates();return n&&un.reverse(l),l};Ki.prototype.computeSingleSidedBufferCurve=function(e,t,n){var r=this.simplifyTolerance(this._distance);if(t){n.addSegments(e,!0);var s=hr.simplify(e,-r),l=s.length-1;n.initSideSegments(s[l],s[l-1],Xt.LEFT),n.addFirstSegment();for(var p=l-2;p>=0;p--)n.addNextSegment(s[p],!0)}else{n.addSegments(e,!1);var c=hr.simplify(e,r),y=c.length-1;n.initSideSegments(c[0],c[1],Xt.LEFT),n.addFirstSegment();for(var w=2;w<=y;w++)n.addNextSegment(c[w],!0)}n.addLastSegment(),n.closeRing()};Ki.prototype.computeRingBufferCurve=function(e,t,n){var r=this.simplifyTolerance(this._distance);t===Xt.RIGHT&&(r=-r);var s=hr.simplify(e,r),l=s.length-1;n.initSideSegments(s[l-1],s[0],t);for(var p=1;p<=l;p++){var c=p!==1;n.addNextSegment(s[p],c)}n.closeRing()};Ki.prototype.computeLineBufferCurve=function(e,t){var n=this.simplifyTolerance(this._distance),r=hr.simplify(e,n),s=r.length-1;t.initSideSegments(r[0],r[1],Xt.LEFT);for(var l=2;l<=s;l++)t.addNextSegment(r[l],!0);t.addLastSegment(),t.addLineEndCap(r[s-1],r[s]);var p=hr.simplify(e,-n),c=p.length-1;t.initSideSegments(p[c],p[c-1],Xt.LEFT);for(var y=c-2;y>=0;y--)t.addNextSegment(p[y],!0);t.addLastSegment(),t.addLineEndCap(p[1],p[0]),t.closeRing()};Ki.prototype.computePointCurve=function(e,t){switch(this._bufParams.getEndCapStyle()){case xn.CAP_ROUND:t.createCircle(e);break;case xn.CAP_SQUARE:t.createSquare(e);break}};Ki.prototype.getLineCurve=function(e,t){if(this._distance=t,t<0&&!this._bufParams.isSingleSided()||t===0)return null;var n=Math.abs(t),r=this.getSegGen(n);if(e.length<=1)this.computePointCurve(e[0],r);else if(this._bufParams.isSingleSided()){var s=t<0;this.computeSingleSidedBufferCurve(e,s,r)}else this.computeLineBufferCurve(e,r);var l=r.getCoordinates();return l};Ki.prototype.getBufferParameters=function(){return this._bufParams};Ki.prototype.simplifyTolerance=function(e){return e*this._bufParams.getSimplifyFactor()};Ki.prototype.getRingCurve=function(e,t,n){if(this._distance=n,e.length<=2)return this.getLineCurve(e,n);if(n===0)return Ki.copyCoordinates(e);var r=this.getSegGen(n);return this.computeRingBufferCurve(e,t,r),r.getCoordinates()};Ki.prototype.computeOffsetCurve=function(e,t,n){var r=this.simplifyTolerance(this._distance);if(t){var s=hr.simplify(e,-r),l=s.length-1;n.initSideSegments(s[l],s[l-1],Xt.LEFT),n.addFirstSegment();for(var p=l-2;p>=0;p--)n.addNextSegment(s[p],!0)}else{var c=hr.simplify(e,r),y=c.length-1;n.initSideSegments(c[0],c[1],Xt.LEFT),n.addFirstSegment();for(var w=2;w<=y;w++)n.addNextSegment(c[w],!0)}n.addLastSegment()};Ki.prototype.getSegGen=function(e){return new Xn(this._precisionModel,this._bufParams,e)};Ki.prototype.interfaces_=function(){return[]};Ki.prototype.getClass=function(){return Ki};Ki.copyCoordinates=function(e){for(var t=new Array(e.length).fill(null),n=0;nl.getMaxY()||e.findStabbedSegments(t,s.getDirectedEdges(),n)}return n}else if(arguments.length===3){if(De(arguments[2],ms)&&arguments[0]instanceof St&&arguments[1]instanceof jv)for(var p=arguments[0],c=arguments[1],y=arguments[2],w=c.getEdge().getCoordinates(),T=0;Te._seg.p1.y&&e._seg.reverse();var L=Math.max(e._seg.p0.x,e._seg.p1.x);if(!(Le._seg.p1.y)&&pe.computeOrientation(e._seg.p0,e._seg.p1,p)!==pe.RIGHT){var A=c.getDepth(Xt.LEFT);e._seg.p0.equals(w[T])||(A=c.getDepth(Xt.RIGHT));var z=new Lu(e._seg,A);y.add(z)}}else if(De(arguments[2],ms)&&arguments[0]instanceof St&&De(arguments[1],ms))for(var B=arguments[0],Y=arguments[1],et=arguments[2],at=Y.iterator();at.hasNext();){var W=at.next();W.isForward()&&e.findStabbedSegments(B,W,et)}}};xc.prototype.getDepth=function(e){var t=this.findStabbedSegments(e);if(t.size()===0)return 0;var n=bs.min(t);return n._leftDepth};xc.prototype.interfaces_=function(){return[]};xc.prototype.getClass=function(){return xc};_E.DepthSegment.get=function(){return Lu};Object.defineProperties(xc,_E);var Lu=function(){this._upwardSeg=null,this._leftDepth=null;var e=arguments[0],t=arguments[1];this._upwardSeg=new Ie(e),this._leftDepth=t};Lu.prototype.compareTo=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),n!==0)?n:this._upwardSeg.compareTo(t._upwardSeg)};Lu.prototype.compareX=function(e,t){var n=e.p0.compareTo(t.p0);return n!==0?n:e.p1.compareTo(t.p1)};Lu.prototype.toString=function(){return this._upwardSeg.toString()};Lu.prototype.interfaces_=function(){return[es]};Lu.prototype.getClass=function(){return Lu};var Sn=function(e,t,n){this.p0=e||null,this.p1=t||null,this.p2=n||null};Sn.prototype.area=function(){return Sn.area(this.p0,this.p1,this.p2)};Sn.prototype.signedArea=function(){return Sn.signedArea(this.p0,this.p1,this.p2)};Sn.prototype.interpolateZ=function(e){if(e===null)throw new Qn("Supplied point is null.");return Sn.interpolateZ(e,this.p0,this.p1,this.p2)};Sn.prototype.longestSideLength=function(){return Sn.longestSideLength(this.p0,this.p1,this.p2)};Sn.prototype.isAcute=function(){return Sn.isAcute(this.p0,this.p1,this.p2)};Sn.prototype.circumcentre=function(){return Sn.circumcentre(this.p0,this.p1,this.p2)};Sn.prototype.area3D=function(){return Sn.area3D(this.p0,this.p1,this.p2)};Sn.prototype.centroid=function(){return Sn.centroid(this.p0,this.p1,this.p2)};Sn.prototype.inCentre=function(){return Sn.inCentre(this.p0,this.p1,this.p2)};Sn.prototype.interfaces_=function(){return[]};Sn.prototype.getClass=function(){return Sn};Sn.area=function(e,t,n){return Math.abs(((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2)};Sn.signedArea=function(e,t,n){return((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2};Sn.det=function(e,t,n,r){return e*r-t*n};Sn.interpolateZ=function(e,t,n,r){var s=t.x,l=t.y,p=n.x-s,c=r.x-s,y=n.y-l,w=r.y-l,T=p*w-c*y,L=e.x-s,A=e.y-l,z=(w*L-c*A)/T,B=(-y*L+p*A)/T,Y=t.z+z*(n.z-t.z)+B*(r.z-t.z);return Y};Sn.longestSideLength=function(e,t,n){var r=e.distance(t),s=t.distance(n),l=n.distance(e),p=r;return s>p&&(p=s),l>p&&(p=l),p};Sn.isAcute=function(e,t,n){return!(!fn.isAcute(e,t,n)||!fn.isAcute(t,n,e)||!fn.isAcute(n,e,t))};Sn.circumcentre=function(e,t,n){var r=n.x,s=n.y,l=e.x-r,p=e.y-s,c=t.x-r,y=t.y-s,w=2*Sn.det(l,p,c,y),T=Sn.det(p,l*l+p*p,y,c*c+y*y),L=Sn.det(l,l*l+p*p,c,c*c+y*y),A=r-T/w,z=s+L/w;return new St(A,z)};Sn.perpendicularBisector=function(e,t){var n=t.x-e.x,r=t.y-e.y,s=new gs(e.x+n/2,e.y+r/2,1),l=new gs(e.x-r+n/2,e.y+n+r/2,1);return new gs(s,l)};Sn.angleBisector=function(e,t,n){var r=t.distance(e),s=t.distance(n),l=r/(r+s),p=n.x-e.x,c=n.y-e.y,y=new St(e.x+l*p,e.y+l*c);return y};Sn.area3D=function(e,t,n){var r=t.x-e.x,s=t.y-e.y,l=t.z-e.z,p=n.x-e.x,c=n.y-e.y,y=n.z-e.z,w=s*y-l*c,T=l*p-r*y,L=r*c-s*p,A=w*w+T*T+L*L,z=Math.sqrt(A)/2;return z};Sn.centroid=function(e,t,n){var r=(e.x+t.x+n.x)/3,s=(e.y+t.y+n.y)/3;return new St(r,s)};Sn.inCentre=function(e,t,n){var r=t.distance(n),s=e.distance(n),l=e.distance(t),p=r+s+l,c=(r*e.x+s*t.x+l*n.x)/p,y=(r*e.y+s*t.y+l*n.y)/p;return new St(c,y)};var ts=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new ie;var e=arguments[0],t=arguments[1],n=arguments[2];this._inputGeom=e,this._distance=t,this._curveBuilder=n};ts.prototype.addPoint=function(e){if(this._distance<=0)return null;var t=e.getCoordinates(),n=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(n,Ct.EXTERIOR,Ct.INTERIOR)};ts.prototype.addPolygon=function(e){var t=this,n=this._distance,r=Xt.LEFT;this._distance<0&&(n=-this._distance,r=Xt.RIGHT);var s=e.getExteriorRing(),l=un.removeRepeatedPoints(s.getCoordinates());if(this._distance<0&&this.isErodedCompletely(s,this._distance)||this._distance<=0&&l.length<3)return null;this.addPolygonRing(l,n,r,Ct.EXTERIOR,Ct.INTERIOR);for(var p=0;p0&&t.isErodedCompletely(c,-t._distance)||t.addPolygonRing(y,n,Xt.opposite(r),Ct.INTERIOR,Ct.EXTERIOR)}};ts.prototype.isTriangleErodedCompletely=function(e,t){var n=new Sn(e[0],e[1],e[2]),r=n.inCentre(),s=pe.distancePointLine(r,n.p0,n.p1);return s=Ea.MINIMUM_VALID_SIZE&&pe.isCCW(e)&&(l=s,p=r,n=Xt.opposite(n));var c=this._curveBuilder.getRingCurve(e,n,t);this.addCurve(c,l,p)};ts.prototype.add=function(e){if(e.isEmpty())return null;e instanceof Nr?this.addPolygon(e):e instanceof cr?this.addLineString(e):e instanceof fo?this.addPoint(e):e instanceof lp?this.addCollection(e):e instanceof Cu?this.addCollection(e):e instanceof xa?this.addCollection(e):e instanceof Ri&&this.addCollection(e)};ts.prototype.isErodedCompletely=function(e,t){var n=e.getCoordinates();if(n.length<4)return t<0;if(n.length===4)return this.isTriangleErodedCompletely(n,t);var r=e.getEnvelopeInternal(),s=Math.min(r.getHeight(),r.getWidth());return t<0&&2*Math.abs(t)>s};ts.prototype.addCollection=function(e){for(var t=this,n=0;n=this._max)throw new Ap;var e=this._parent.getGeometryN(this._index++);return e instanceof Ri?(this._subcollectionIterator=new wa(e),this._subcollectionIterator.next()):e};wa.prototype.remove=function(){throw new Error(this.getClass().getName())};wa.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)};wa.prototype.interfaces_=function(){return[Mp]};wa.prototype.getClass=function(){return wa};wa.isAtomic=function(e){return!(e instanceof Ri)};var Mo=function(){this._geom=null;var e=arguments[0];this._geom=e};Mo.prototype.locate=function(e){return Mo.locate(e,this._geom)};Mo.prototype.interfaces_=function(){return[pp]};Mo.prototype.getClass=function(){return Mo};Mo.isPointInRing=function(e,t){return t.getEnvelopeInternal().intersects(e)?pe.isPointInRing(e,t.getCoordinates()):!1};Mo.containsPointInPolygon=function(e,t){if(t.isEmpty())return!1;var n=t.getExteriorRing();if(!Mo.isPointInRing(e,n))return!1;for(var r=0;r0&&(r.right=l.right,r.left=l,l.right=null),this._size++,this._root=r),this._root},e.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},e.prototype._remove=function(t,n,r){var s;if(n===null)return null;n=bu(t,n,r);var l=r(t,n.key);return l===0?(n.left===null?s=n.right:(s=bu(t,n.left,r),s.right=n.right),this._size--,s):n},e.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=bu(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},e.prototype.findStatic=function(t){for(var n=this._root,r=this._comparator;n;){var s=r(t,n.key);if(s===0)return n;s<0?n=n.left:n=n.right}return null},e.prototype.find=function(t){return this._root&&(this._root=bu(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},e.prototype.contains=function(t){for(var n=this._root,r=this._comparator;n;){var s=r(t,n.key);if(s===0)return!0;s<0?n=n.left:n=n.right}return!1},e.prototype.forEach=function(t,n){for(var r=this._root,s=[],l=!1;!l;)r!==null?(s.push(r),r=r.left):s.length!==0?(r=s.pop(),t.call(n,r),r=r.right):l=!0;return this},e.prototype.range=function(t,n,r,s){for(var l=[],p=this._comparator,c=this._root,y;l.length!==0||c;)if(c)l.push(c),c=c.left;else{if(c=l.pop(),y=p(c.key,n),y>0)break;if(p(c.key,t)>=0&&r.call(s,c))return this;c=c.right}return this},e.prototype.keys=function(){var t=[];return this.forEach(function(n){var r=n.key;return t.push(r)}),t},e.prototype.values=function(){var t=[];return this.forEach(function(n){var r=n.data;return t.push(r)}),t},e.prototype.min=function(){return this._root?this.minNode(this._root).key:null},e.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},e.prototype.minNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},e.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},e.prototype.at=function(t){for(var n=this._root,r=!1,s=0,l=[];!r;)if(n)l.push(n),n=n.left;else if(l.length>0){if(n=l.pop(),s===t)return n;s++,n=n.right}else r=!0;return null},e.prototype.next=function(t){var n=this._root,r=null;if(t.right){for(r=t.right;r.left;)r=r.left;return r}for(var s=this._comparator;n;){var l=s(t.key,n.key);if(l===0)break;l<0?(r=n,n=n.left):n=n.right}return r},e.prototype.prev=function(t){var n=this._root,r=null;if(t.left!==null){for(r=t.left;r.right;)r=r.right;return r}for(var s=this._comparator;n;){var l=s(t.key,n.key);if(l===0)break;l<0?n=n.left:(r=n,n=n.right)}return r},e.prototype.clear=function(){return this._root=null,this._size=0,this},e.prototype.toList=function(){return ER(this._root)},e.prototype.load=function(t,n,r){n===void 0&&(n=[]),r===void 0&&(r=!1);var s=t.length,l=this._comparator;if(r&&Fv(t,n,0,s-1,l),this._root===null)this._root=Ov(t,n,0,s),this._size=s;else{var p=IR(this.toList(),SR(t,n),l);s=this._size+s,this._root=zv({head:p},0,s)}return this},e.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),e.prototype.toString=function(t){t===void 0&&(t=function(r){return String(r.key)});var n=[];return Nv(this._root,"",!0,function(r){return n.push(r)},t),n.join("")},e.prototype.update=function(t,n,r){var s=this._comparator,l=uw(t,this._root,s),p=l.left,c=l.right;s(t,n)<0?c=tv(n,r,c,s):p=tv(n,r,p,s),this._root=wR(p,c,s)},e.prototype.split=function(t){return uw(t,this._root,this._comparator)},e.prototype[Symbol.iterator]=function(){var t,n,r;return bR(this,function(s){switch(s.label){case 0:t=this._root,n=[],r=!1,s.label=1;case 1:return r?[3,6]:t===null?[3,2]:(n.push(t),t=t.left,[3,5]);case 2:return n.length===0?[3,4]:(t=n.pop(),[4,t]);case 3:return s.sent(),t=t.right,[3,5];case 4:r=!0,s.label=5;case 5:return[3,1];case 6:return[2]}})},e}();function Ov(e,t,n,r){var s=r-n;if(s>0){var l=n+Math.floor(s/2),p=e[l],c=t[l],y=new Iu(p,c);return y.left=Ov(e,t,n,l),y.right=Ov(e,t,l+1,r),y}return null}function SR(e,t){for(var n=new Iu(null,null),r=n,s=0;s0?(t=l=l.next=n.pop(),t=t.right):r=!0;return l.next=null,s.next}function zv(e,t,n){var r=n-t;if(r>0){var s=t+Math.floor(r/2),l=zv(e,t,s),p=e.head;return p.left=l,e.head=e.head.next,p.right=zv(e,s+1,n),p}return null}function IR(e,t,n){for(var r=new Iu(null,null),s=r,l=e,p=t;l!==null&&p!==null;)n(l.key,p.key)<0?(s.next=l,l=l.next):(s.next=p,p=p.next),s=s.next;return l!==null?s.next=l:p!==null&&(s.next=p),r.next}function Fv(e,t,n,r,s){if(!(n>=r)){for(var l=e[n+r>>1],p=n-1,c=r+1;;){do p++;while(s(e[p],l)<0);do c--;while(s(e[c],l)>0);if(p>=c)break;var y=e[p];e[p]=e[c],e[c]=y,y=t[p],t[p]=t[c],t[c]=y}Fv(e,t,n,c,s),Fv(e,t,c+1,r,s)}}function aa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cw(e,t){for(var n=0;nn.x?1:t.yn.y?1:0}}]);function e(t,n){aa(this,e),t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=n}return Ao(e,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var n=t.point.events,r=0,s=n.length;r=0&&L>=0?wA?-1:0:y<0&&L<0?wA?1:0:Ly?1:0}}}]),e}(),AR=0,Gm=function(){Ao(e,null,[{key:"compare",value:function(t,n){var r=t.leftSE.point.x,s=n.leftSE.point.x,l=t.rightSE.point.x,p=n.rightSE.point.x;if(pc&&y>w)return-1;var L=t.comparePoint(n.leftSE.point);if(L<0)return 1;if(L>0)return-1;var A=n.comparePoint(t.rightSE.point);return A!==0?A:-1}if(r>s){if(cy&&c>T)return 1;var z=n.comparePoint(t.leftSE.point);if(z!==0)return z;var B=t.comparePoint(n.rightSE.point);return B<0?1:B>0?-1:1}if(cy)return 1;if(lp){var et=t.comparePoint(n.rightSE.point);if(et<0)return 1;if(et>0)return-1}if(l!==p){var at=w-c,W=l-r,H=T-y,nt=p-s;if(at>W&&Hnt)return-1}return l>p?1:lT?1:t.idn.id?1:0}}]);function e(t,n,r,s){aa(this,e),this.id=++AR,this.leftSE=t,t.segment=this,t.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=t,this.rings=r,this.windings=s}return Ao(e,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,n=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:tn?t:n}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var n=this.leftSE.point,r=this.rightSE.point,s=this.vector();if(n.x===r.x)return t.x===n.x?0:t.x0&&c.swapEvents(),Ya.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(s.checkForConsuming(),l.checkForConsuming()),n}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var n=0,r=this.windings.length;n0){var l=n;n=r,r=l}if(n.prev===r){var p=n;n=r,r=p}for(var c=0,y=r.rings.length;c0)s=n,l=t,p=-1;else throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));var y=new Ya(s,!0),w=new Ya(l,!1);return new e(y,w,[r],[p])}}]),e}(),gw=function(){function e(t,n,r){if(aa(this,e),!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=r,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var s=cd.round(t[0][0],t[0][1]);this.bbox={ll:{x:s.x,y:s.y},ur:{x:s.x,y:s.y}};for(var l=s,p=1,c=t.length;pthis.bbox.ur.x&&(this.bbox.ur.x=y.x),y.y>this.bbox.ur.y&&(this.bbox.ur.y=y.y),l=y)}(s.x!==l.x||s.y!==l.y)&&this.segments.push(Gm.fromRing(l,s,this))}return Ao(e,[{key:"getSweepEvents",value:function(){for(var t=[],n=0,r=this.segments.length;nthis.bbox.ur.x&&(this.bbox.ur.x=l.bbox.ur.x),l.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=l.bbox.ur.y),this.interiorRings.push(l)}this.multiPoly=n}return Ao(e,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),n=0,r=this.interiorRings.length;nthis.bbox.ur.x&&(this.bbox.ur.x=l.bbox.ur.x),l.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=l.bbox.ur.y),this.polys.push(l)}this.isSubject=n}return Ao(e,[{key:"getSweepEvents",value:function(){for(var t=[],n=0,r=this.polys.length;n0&&(t=s)}for(var l=t.segment.prevInResult(),p=l?l.prevInResult():null;;){if(!l)return null;if(!p)return l.ringOut;if(p.ringOut!==l.ringOut)return p.ringOut.enclosingRing()!==l.ringOut?l.ringOut:l.ringOut.enclosingRing();l=p.prevInResult(),p=l?l.prevInResult():null}}}]),e}(),yw=function(){function e(t){aa(this,e),this.exteriorRing=t,t.poly=this,this.interiorRings=[]}return Ao(e,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(var n=0,r=this.interiorRings.length;n1&&arguments[1]!==void 0?arguments[1]:Gm.compare;aa(this,e),this.queue=t,this.tree=new I0(n),this.segments=[]}return Ao(e,[{key:"process",value:function(t){var n=t.segment,r=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(n),r;var s=t.isLeft?this.tree.insert(n):this.tree.find(n);if(!s)throw new Error("Unable to find segment #".concat(n.id," ")+"[".concat(n.leftSE.point.x,", ").concat(n.leftSE.point.y,"] -> ")+"[".concat(n.rightSE.point.x,", ").concat(n.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var l=s,p=s,c=void 0,y=void 0;c===void 0;)l=this.tree.prev(l),l===null?c=null:l.key.consumedBy===void 0&&(c=l.key);for(;y===void 0;)p=this.tree.next(p),p===null?y=null:p.key.consumedBy===void 0&&(y=p.key);if(t.isLeft){var w=null;if(c){var T=c.getIntersection(n);if(T!==null&&(n.isAnEndpoint(T)||(w=T),!c.isAnEndpoint(T)))for(var L=this._splitSafely(c,T),A=0,z=L.length;A0?(this.tree.remove(n),r.push(t)):(this.segments.push(n),n.prev=c)}else{if(c&&y){var bt=c.getIntersection(y);if(bt!==null){if(!c.isAnEndpoint(bt))for(var It=this._splitSafely(c,bt),Ot=0,dt=It.length;Ot_w)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var nt=new NR(B),ut=B.size,_t=B.pop();_t;){var ct=_t.key;if(B.size===ut){var bt=ct.segment;throw new Error("Unable to pop() ".concat(ct.isLeft?"left":"right"," SweepEvent ")+"[".concat(ct.point.x,", ").concat(ct.point.y,"] from segment #").concat(bt.id," ")+"[".concat(bt.leftSE.point.x,", ").concat(bt.leftSE.point.y,"] -> ")+"[".concat(bt.rightSE.point.x,", ").concat(bt.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(B.size>_w)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(nt.segments.length>OR)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var It=nt.process(ct),Ot=0,dt=It.length;Ot1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;rn[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]t.x?1:this.yt.y?1:0};St.prototype.clone=function(){};St.prototype.copy=function(){return new St(this)};St.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"};St.prototype.distance3D=function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return Math.sqrt(t*t+n*n+r*r)};St.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)};St.prototype.hashCode=function(){var e=17;return e=37*e+St.hashCode(this.x),e=37*e+St.hashCode(this.y),e};St.prototype.setCoordinate=function(e){this.x=e.x,this.y=e.y,this.z=e.z};St.prototype.interfaces_=function(){return[es,hy,ns]};St.prototype.getClass=function(){return St};St.hashCode=function(){if(arguments.length===1){var e=arguments[0],t=Ue.doubleToLongBits(e);return Math.trunc((t^t)>>>32)}};Dc.DimensionalComparator.get=function(){return Rl};Dc.serialVersionUID.get=function(){return 6683108902428367e3};Dc.NULL_ORDINATE.get=function(){return Ue.NaN};Dc.X.get=function(){return 0};Dc.Y.get=function(){return 1};Dc.Z.get=function(){return 2};Object.defineProperties(St,Dc);var Rl=function(e){if(this._dimensionsToTest=2,arguments.length!==0&&arguments.length===1){var t=arguments[0];if(t!==2&&t!==3)throw new Qn("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}};Rl.prototype.compare=function(e,t){var n=e,r=t,s=Rl.compare(n.x,r.x);if(s!==0)return s;var l=Rl.compare(n.y,r.y);if(l!==0)return l;if(this._dimensionsToTest<=2)return 0;var p=Rl.compare(n.z,r.z);return p};Rl.prototype.interfaces_=function(){return[tp]};Rl.prototype.getClass=function(){return Rl};Rl.compare=function(e,t){return et?1:Ue.isNaN(e)?Ue.isNaN(t)?0:-1:Ue.isNaN(t)?1:0};var ep=function(){};ep.prototype.create=function(){};ep.prototype.interfaces_=function(){return[]};ep.prototype.getClass=function(){return ep};var Ct=function(){},zd={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};Ct.prototype.interfaces_=function(){return[]};Ct.prototype.getClass=function(){return Ct};Ct.toLocationSymbol=function(e){switch(e){case Ct.EXTERIOR:return"e";case Ct.BOUNDARY:return"b";case Ct.INTERIOR:return"i";case Ct.NONE:return"-"}throw new Qn("Unknown location value: "+e)};zd.INTERIOR.get=function(){return 0};zd.BOUNDARY.get=function(){return 1};zd.EXTERIOR.get=function(){return 2};zd.NONE.get=function(){return-1};Object.defineProperties(Ct,zd);var De=function(e,t){return e.interfaces_&&e.interfaces_().indexOf(t)>-1},ko=function(){},oE={LOG_10:{configurable:!0}};ko.prototype.interfaces_=function(){return[]};ko.prototype.getClass=function(){return ko};ko.log10=function(e){var t=Math.log(e);return Ue.isInfinite(t)||Ue.isNaN(t)?t:t/ko.LOG_10};ko.min=function(e,t,n,r){var s=e;return tn?n:e}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],s=arguments[1],l=arguments[2];return rl?l:r}};ko.wrap=function(e,t){return e<0?t- -e%t:e%t};ko.max=function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],n=arguments[2],r=e;return t>r&&(r=t),n>r&&(r=n),r}else if(arguments.length===4){var s=arguments[0],l=arguments[1],p=arguments[2],c=arguments[3],y=s;return l>y&&(y=l),p>y&&(y=p),c>y&&(y=c),y}};ko.average=function(e,t){return(e+t)/2};oE.LOG_10.get=function(){return Math.log(10)};Object.defineProperties(ko,oE);var la=function(e){this.str=e};la.prototype.append=function(e){this.str+=e};la.prototype.setCharAt=function(e,t){this.str=this.str.substr(0,e)+t+this.str.substr(e+1)};la.prototype.toString=function(e){return this.str};var Ys=function(e){this.value=e};Ys.prototype.intValue=function(){return this.value};Ys.prototype.compareTo=function(e){return this.valuee?1:0};Ys.isNaN=function(e){return Number.isNaN(e)};var hd=function(){};hd.isWhitespace=function(e){return e<=32&&e>=0||e===127};hd.toUpperCase=function(e){return e.toUpperCase()};var Dt=function e(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof e){var n=arguments[0];this.init(n)}else if(typeof arguments[0]=="string"){var r=arguments[0];e.call(this,e.parse(r))}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];this.init(s,l)}},Es={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};Dt.prototype.le=function(e){return(this._hi9?(T=!0,L="9"):L="0"+w,p.append(L),n=n.subtract(Dt.valueOf(w)).multiply(Dt.TEN),T&&n.selfAdd(Dt.TEN);var A=!0,z=Dt.magnitude(n._hi);if(z<0&&Math.abs(z)>=c-y&&(A=!1),!A)break}return t[0]=r,p.toString()};Dt.prototype.sqr=function(){return this.multiply(this)};Dt.prototype.doubleValue=function(){return this._hi+this._lo};Dt.prototype.subtract=function(){if(arguments[0]instanceof Dt){var e=arguments[0];return this.add(e.negate())}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.add(-t)}};Dt.prototype.equals=function(){if(arguments.length===1){var e=arguments[0];return this._hi===e._hi&&this._lo===e._lo}};Dt.prototype.isZero=function(){return this._hi===0&&this._lo===0};Dt.prototype.selfSubtract=function(){if(arguments[0]instanceof Dt){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e._hi,-e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t,0)}};Dt.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null};Dt.prototype.min=function(e){return this.le(e)?this:e};Dt.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof Dt){var e=arguments[0];return this.selfDivide(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.selfDivide(t,0)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1],s=null,l=null,p=null,c=null,y=null,w=null,T=null,L=null;return y=this._hi/n,w=Dt.SPLIT*y,s=w-y,L=Dt.SPLIT*n,s=w-s,l=y-s,p=L-n,T=y*n,p=L-p,c=n-p,L=s*p-T+s*c+l*p+l*c,w=(this._hi-T-L+this._lo-y*r)/n,L=y+w,this._hi=L,this._lo=y-L+w,this}};Dt.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"};Dt.prototype.divide=function(){if(arguments[0]instanceof Dt){var e=arguments[0],t=null,n=null,r=null,s=null,l=null,p=null,c=null,y=null;l=this._hi/e._hi,p=Dt.SPLIT*l,t=p-l,y=Dt.SPLIT*e._hi,t=p-t,n=l-t,r=y-e._hi,c=l*e._hi,r=y-r,s=e._hi-r,y=t*r-c+t*s+n*r+n*s,p=(this._hi-c-y+this._lo-l*e._lo)/e._hi,y=l+p;var w=y,T=l-y+p;return new Dt(w,T)}else if(typeof arguments[0]=="number"){var L=arguments[0];return Ue.isNaN(L)?Dt.createNaN():Dt.copy(this).selfDivide(L,0)}};Dt.prototype.ge=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>=e._lo};Dt.prototype.pow=function(e){if(e===0)return Dt.valueOf(1);var t=new Dt(this),n=Dt.valueOf(1),r=Math.abs(e);if(r>1)for(;r>0;)r%2===1&&n.selfMultiply(t),r/=2,r>0&&(t=t.sqr());else n=t;return e<0?n.reciprocal():n};Dt.prototype.ceil=function(){if(this.isNaN())return Dt.NaN;var e=Math.ceil(this._hi),t=0;return e===this._hi&&(t=Math.ceil(this._lo)),new Dt(e,t)};Dt.prototype.compareTo=function(e){var t=e;return this._hit._hi?1:this._lot._lo?1:0};Dt.prototype.rint=function(){if(this.isNaN())return this;var e=this.add(.5);return e.floor()};Dt.prototype.setValue=function(){if(arguments[0]instanceof Dt){var e=arguments[0];return this.init(e),this}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.init(t),this}};Dt.prototype.max=function(e){return this.ge(e)?this:e};Dt.prototype.sqrt=function(){if(this.isZero())return Dt.valueOf(0);if(this.isNegative())return Dt.NaN;var e=1/Math.sqrt(this._hi),t=this._hi*e,n=Dt.valueOf(t),r=this.subtract(n.sqr()),s=r._hi*(e*.5);return n.add(s)};Dt.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof Dt){var e=arguments[0];return this.selfAdd(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0],n=null,r=null,s=null,l=null,p=null,c=null;return s=this._hi+t,p=s-this._hi,l=s-p,l=t-p+(this._hi-l),c=l+this._lo,n=s+c,r=c+(s-n),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(arguments.length===2){var y=arguments[0],w=arguments[1],T=null,L=null,A=null,z=null,B=null,Y=null,et=null,at=null;B=this._hi+y,A=this._lo+w,et=B-this._hi,at=A-this._lo,Y=B-et,z=A-at,Y=y-et+(this._hi-Y),z=w-at+(this._lo-z),et=Y+A,T=B+et,L=et+(B-T),et=z+L;var W=T+et,H=et+(T-W);return this._hi=W,this._lo=H,this}};Dt.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof Dt){var e=arguments[0];return this.selfMultiply(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.selfMultiply(t,0)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1],s=null,l=null,p=null,c=null,y=null,w=null;y=Dt.SPLIT*this._hi,s=y-this._hi,w=Dt.SPLIT*n,s=y-s,l=this._hi-s,p=w-n,y=this._hi*n,p=w-p,c=n-p,w=s*p-y+s*c+l*p+l*c+(this._hi*r+this._lo*n);var T=y+w;s=y-T;var L=w+s;return this._hi=T,this._lo=L,this}};Dt.prototype.selfSqr=function(){return this.selfMultiply(this)};Dt.prototype.floor=function(){if(this.isNaN())return Dt.NaN;var e=Math.floor(this._hi),t=0;return e===this._hi&&(t=Math.floor(this._lo)),new Dt(e,t)};Dt.prototype.negate=function(){return this.isNaN()?this:new Dt(-this._hi,-this._lo)};Dt.prototype.clone=function(){};Dt.prototype.multiply=function(){if(arguments[0]instanceof Dt){var e=arguments[0];return e.isNaN()?Dt.createNaN():Dt.copy(this).selfMultiply(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return Ue.isNaN(t)?Dt.createNaN():Dt.copy(this).selfMultiply(t,0)}};Dt.prototype.isNaN=function(){return Ue.isNaN(this._hi)};Dt.prototype.intValue=function(){return Math.trunc(this._hi)};Dt.prototype.toString=function(){var e=Dt.magnitude(this._hi);return e>=-3&&e<=20?this.toStandardNotation():this.toSciNotation()};Dt.prototype.toStandardNotation=function(){var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),n=this.extractSignificantDigits(!0,t),r=t[0]+1,s=n;if(n.charAt(0)===".")s="0"+n;else if(r<0)s="0."+Dt.stringOfChar("0",-r)+n;else if(n.indexOf(".")===-1){var l=r-n.length,p=Dt.stringOfChar("0",l);s=n+p+".0"}return this.isNegative()?"-"+s:s};Dt.prototype.reciprocal=function(){var e=null,t=null,n=null,r=null,s=null,l=null,p=null,c=null;s=1/this._hi,l=Dt.SPLIT*s,e=l-s,c=Dt.SPLIT*this._hi,e=l-e,t=s-e,n=c-this._hi,p=s*this._hi,n=c-n,r=this._hi-n,c=e*n-p+e*r+t*n+t*r,l=(1-p-c-s*this._lo)/this._hi;var y=s+l,w=s-y+l;return new Dt(y,w)};Dt.prototype.toSciNotation=function(){if(this.isZero())return Dt.SCI_NOT_ZERO;var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),n=this.extractSignificantDigits(!1,t),r=Dt.SCI_NOT_EXPONENT_CHAR+t[0];if(n.charAt(0)==="0")throw new Error("Found leading zero: "+n);var s="";n.length>1&&(s=n.substring(1));var l=n.charAt(0)+"."+s;return this.isNegative()?"-"+l+r:l+r};Dt.prototype.abs=function(){return this.isNaN()?Dt.NaN:this.isNegative()?this.negate():new Dt(this)};Dt.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0};Dt.prototype.lt=function(e){return(this._hie._hi||this._hi===e._hi)&&this._lo>e._lo};Dt.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0};Dt.prototype.trunc=function(){return this.isNaN()?Dt.NaN:this.isPositive()?this.floor():this.ceil()};Dt.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0};Dt.prototype.interfaces_=function(){return[ns,es,hy]};Dt.prototype.getClass=function(){return Dt};Dt.sqr=function(e){return Dt.valueOf(e).selfMultiply(e)};Dt.valueOf=function(){if(typeof arguments[0]=="string"){var e=arguments[0];return Dt.parse(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return new Dt(t)}};Dt.sqrt=function(e){return Dt.valueOf(e).sqrt()};Dt.parse=function(e){for(var t=0,n=e.length;hd.isWhitespace(e.charAt(t));)t++;var r=!1;if(t=n);){var w=e.charAt(t);if(t++,hd.isDigit(w)){var T=w-"0";l.selfMultiply(Dt.TEN),l.selfAdd(T),p++;continue}if(w==="."){c=p;continue}if(w==="e"||w==="E"){var L=e.substring(t);try{y=Ys.parseInt(L)}catch(et){throw et instanceof Error?new Error("Invalid exponent "+L+" in string "+e):et}finally{}break}throw new Error("Unexpected character '"+w+"' at position "+t+" in string "+e)}var A=l,z=p-c-y;if(z===0)A=l;else if(z>0){var B=Dt.TEN.pow(z);A=l.divide(B)}else if(z<0){var Y=Dt.TEN.pow(-z);A=l.multiply(Y)}return r?A.negate():A};Dt.createNaN=function(){return new Dt(Ue.NaN,Ue.NaN)};Dt.copy=function(e){return new Dt(e)};Dt.magnitude=function(e){var t=Math.abs(e),n=Math.log(t)/Math.log(10),r=Math.trunc(Math.floor(n)),s=Math.pow(10,r);return s*10<=t&&(r+=1),r};Dt.stringOfChar=function(e,t){for(var n=new la,r=0;r0){if(l<=0)return Yi.signum(p);r=s+l}else if(s<0){if(l>=0)return Yi.signum(p);r=-s-l}else return Yi.signum(p);var c=Yi.DP_SAFE_EPSILON*r;return p>=c||-p>=c?Yi.signum(p):2};Yi.signum=function(e){return e>0?1:e<0?-1:0};sE.DP_SAFE_EPSILON.get=function(){return 1e-15};Object.defineProperties(Yi,sE);var yn=function(){},Fd={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Fd.X.get=function(){return 0};Fd.Y.get=function(){return 1};Fd.Z.get=function(){return 2};Fd.M.get=function(){return 3};yn.prototype.setOrdinate=function(e,t,n){};yn.prototype.size=function(){};yn.prototype.getOrdinate=function(e,t){};yn.prototype.getCoordinate=function(){};yn.prototype.getCoordinateCopy=function(e){};yn.prototype.getDimension=function(){};yn.prototype.getX=function(e){};yn.prototype.clone=function(){};yn.prototype.expandEnvelope=function(e){};yn.prototype.copy=function(){};yn.prototype.getY=function(e){};yn.prototype.toCoordinateArray=function(){};yn.prototype.interfaces_=function(){return[hy]};yn.prototype.getClass=function(){return yn};Object.defineProperties(yn,Fd);var aE=function(){},Pp=function(e){function t(){e.call(this,"Projective point not representable on the Cartesian plane.")}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(aE),pi=function(){};pi.arraycopy=function(e,t,n,r,s){for(var l=0,p=t;pe._minx?this._minx:e._minx,n=this._miny>e._miny?this._miny:e._miny,r=this._maxx=this._minx&&t.getMaxX()<=this._maxx&&t.getMinY()>=this._miny&&t.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.isNull()?!1:n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}};Se.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof Se){var e=arguments[0];return this.isNull()||e.isNull()?!1:!(e._minx>this._maxx||e._maxxthis._maxy||e._maxythis._maxx||nthis._maxy||rthis._maxx&&(this._maxx=t._maxx),t._minythis._maxy&&(this._maxy=t._maxy))}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(nthis._maxx&&(this._maxx=n),rthis._maxy&&(this._maxy=r))}};Se.prototype.minExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return et._minx?1:this._minyt._miny?1:this._maxxt._maxx?1:this._maxyt._maxy?1:0};Se.prototype.translate=function(e,t){if(this.isNull())return null;this.init(this.getMinX()+e,this.getMaxX()+e,this.getMinY()+t,this.getMaxY()+t)};Se.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"};Se.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1};Se.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny};Se.prototype.maxExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e>t?e:t};Se.prototype.expandBy=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()}};Se.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof Se){var e=arguments[0];return this.covers(e)}else if(arguments[0]instanceof St){var t=arguments[0];return this.covers(t)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.covers(n,r)}};Se.prototype.centre=function(){return this.isNull()?null:new St((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)};Se.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof St){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof Se){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],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(arguments.length===4){var s=arguments[0],l=arguments[1],p=arguments[2],c=arguments[3];se._maxx&&(t=this._minx-e._maxx);var n=0;return this._maxye._maxy&&(n=this._miny-e._maxy),t===0?n:n===0?t:Math.sqrt(t*t+n*n)};Se.prototype.hashCode=function(){var e=17;return e=37*e+St.hashCode(this._minx),e=37*e+St.hashCode(this._maxx),e=37*e+St.hashCode(this._miny),e=37*e+St.hashCode(this._maxy),e};Se.prototype.interfaces_=function(){return[es,ns]};Se.prototype.getClass=function(){return Se};Se.intersects=function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],n=arguments[2];return n.x>=(e.xt.x?e.x:t.x)&&n.y>=(e.yt.y?e.y:t.y)}else if(arguments.length===4){var r=arguments[0],s=arguments[1],l=arguments[2],p=arguments[3],c=Math.min(l.x,p.x),y=Math.max(l.x,p.x),w=Math.min(r.x,s.x),T=Math.max(r.x,s.x);return!(w>y||Ty)||Tn?(this._intLineIndex[e][0]=0,this._intLineIndex[e][1]=1):(this._intLineIndex[e][0]=1,this._intLineIndex[e][1]=0)}};rr.prototype.isProper=function(){return this.hasIntersection()&&this._isProper};rr.prototype.setPrecisionModel=function(e){this._precisionModel=e};rr.prototype.isInteriorIntersection=function(){var e=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var t=arguments[0],n=0;ns?l=r:l=s;else{var p=Math.abs(e.x-t.x),c=Math.abs(e.y-t.y);r>s?l=p:l=c,l===0&&!e.equals(t)&&(l=Math.max(p,c))}return Ye.isTrue(!(l===0&&!e.equals(t)),"Bad distance calculation"),l};rr.nonRobustComputeEdgeDistance=function(e,t,n){var r=e.x-t.x,s=e.y-t.y,l=Math.sqrt(r*r+s*s);return Ye.isTrue(!(l===0&&!e.equals(t)),"Invalid distance calculation"),l};Rc.DONT_INTERSECT.get=function(){return 0};Rc.DO_INTERSECT.get=function(){return 1};Rc.COLLINEAR.get=function(){return 2};Rc.NO_INTERSECTION.get=function(){return 0};Rc.POINT_INTERSECTION.get=function(){return 1};Rc.COLLINEAR_INTERSECTION.get=function(){return 2};Object.defineProperties(rr,Rc);var zu=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(n){var r=new Se(this._inputLines[0][0],this._inputLines[0][1]),s=new Se(this._inputLines[1][0],this._inputLines[1][1]);return r.contains(n)&&s.contains(n)},t.prototype.computeIntersection=function(){if(arguments.length===3){var n=arguments[0],r=arguments[1],s=arguments[2];if(this._isProper=!1,Se.intersects(r,s,n)&&pe.orientationIndex(r,s,n)===0&&pe.orientationIndex(s,r,n)===0)return this._isProper=!0,(n.equals(r)||n.equals(s))&&(this._isProper=!1),this._result=e.POINT_INTERSECTION,null;this._result=e.NO_INTERSECTION}else return e.prototype.computeIntersection.apply(this,arguments)},t.prototype.normalizeToMinimum=function(n,r,s,l,p){p.x=this.smallestInAbsValue(n.x,r.x,s.x,l.x),p.y=this.smallestInAbsValue(n.y,r.y,s.y,l.y),n.x-=p.x,n.y-=p.y,r.x-=p.x,r.y-=p.y,s.x-=p.x,s.y-=p.y,l.x-=p.x,l.y-=p.y},t.prototype.safeHCoordinateIntersection=function(n,r,s,l){var p=null;try{p=gs.intersection(n,r,s,l)}catch(c){if(c instanceof Pp)p=t.nearestEndpoint(n,r,s,l);else throw c}finally{}return p},t.prototype.intersection=function(n,r,s,l){var p=this.intersectionWithNormalization(n,r,s,l);return this.isInSegmentEnvelopes(p)||(p=new St(t.nearestEndpoint(n,r,s,l))),this._precisionModel!==null&&this._precisionModel.makePrecise(p),p},t.prototype.smallestInAbsValue=function(n,r,s,l){var p=n,c=Math.abs(p);return Math.abs(r)1e-4&&pi.out.println("Distance = "+p.distance(c))},t.prototype.intersectionWithNormalization=function(n,r,s,l){var p=new St(n),c=new St(r),y=new St(s),w=new St(l),T=new St;this.normalizeToEnvCentre(p,c,y,w,T);var L=this.safeHCoordinateIntersection(p,c,y,w);return L.x+=T.x,L.y+=T.y,L},t.prototype.computeCollinearIntersection=function(n,r,s,l){var p=Se.intersects(n,r,s),c=Se.intersects(n,r,l),y=Se.intersects(s,l,n),w=Se.intersects(s,l,r);return p&&c?(this._intPt[0]=s,this._intPt[1]=l,e.COLLINEAR_INTERSECTION):y&&w?(this._intPt[0]=n,this._intPt[1]=r,e.COLLINEAR_INTERSECTION):p&&y?(this._intPt[0]=s,this._intPt[1]=n,s.equals(n)&&!c&&!w?e.POINT_INTERSECTION:e.COLLINEAR_INTERSECTION):p&&w?(this._intPt[0]=s,this._intPt[1]=r,s.equals(r)&&!c&&!y?e.POINT_INTERSECTION:e.COLLINEAR_INTERSECTION):c&&y?(this._intPt[0]=l,this._intPt[1]=n,l.equals(n)&&!p&&!w?e.POINT_INTERSECTION:e.COLLINEAR_INTERSECTION):c&&w?(this._intPt[0]=l,this._intPt[1]=r,l.equals(r)&&!p&&!y?e.POINT_INTERSECTION:e.COLLINEAR_INTERSECTION):e.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(n,r,s,l,p){var c=n.xr.x?n.x:r.x,T=n.y>r.y?n.y:r.y,L=s.xl.x?s.x:l.x,B=s.y>l.y?s.y:l.y,Y=c>L?c:L,et=wA?y:A,W=T0&&c>0||p<0&&c<0)return e.NO_INTERSECTION;var y=pe.orientationIndex(s,l,n),w=pe.orientationIndex(s,l,r);if(y>0&&w>0||y<0&&w<0)return e.NO_INTERSECTION;var T=p===0&&c===0&&y===0&&w===0;return T?this.computeCollinearIntersection(n,r,s,l):(p===0||c===0||y===0||w===0?(this._isProper=!1,n.equals2D(s)||n.equals2D(l)?this._intPt[0]=n:r.equals2D(s)||r.equals2D(l)?this._intPt[0]=r:p===0?this._intPt[0]=new St(s):c===0?this._intPt[0]=new St(l):y===0?this._intPt[0]=new St(n):w===0&&(this._intPt[0]=new St(r))):(this._isProper=!0,this._intPt[0]=this.intersection(n,r,s,l)),e.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(n,r,s,l){var p=n,c=pe.distancePointLine(n,s,l),y=pe.distancePointLine(r,s,l);return y0?n>0?-s:s:n>0?s:-s;if(t===0||n===0)return r>0?e>0?s:-s:e>0?-s:s;if(t>0?r>0?t<=r||(s=-s,l=e,e=n,n=l,l=t,t=r,r=l):t<=-r?(s=-s,n=-n,r=-r):(l=e,e=-n,n=l,l=t,t=-r,r=l):r>0?-t<=r?(s=-s,e=-e,t=-t):(l=-e,e=n,n=l,l=-t,t=r,r=l):t>=r?(e=-e,t=-t,n=-n,r=-r):(s=-s,l=-e,e=-n,n=l,l=-t,t=-r,r=l),e>0)if(n>0){if(!(e<=n))return s}else return s;else{if(n>0)return-s;if(e>=n)s=-s,e=-e,n=-n;else return-s}for(;;){if(p=Math.floor(n/e),n=n-p*e,r=r-p*t,r<0)return-s;if(r>t)return s;if(e>n+n){if(tr+r)return-s;n=e-n,r=t-r,s=-s}if(r===0)return n===0?0:-s;if(n===0||(p=Math.floor(e/n),e=e-p*n,t=t-p*r,t<0))return s;if(t>r)return-s;if(n>e+e){if(rt+t)return s;e=n-e,t=r-t,s=-s}if(t===0)return e===0?0:s;if(e===0)return-s}};var js=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var e=arguments[0];this._p=e};js.prototype.countSegment=function(e,t){if(e.xr&&(n=t.x,r=e.x),this._p.x>=n&&this._p.x<=r&&(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 s=e.x-this._p.x,l=e.y-this._p.y,p=t.x-this._p.x,c=t.y-this._p.y,y=_c.signOfDet2x2(s,l,p,c);if(y===0)return this._isPointOnSegment=!0,null;c0&&this._crossingCount++}};js.prototype.isPointInPolygon=function(){return this.getLocation()!==Ct.EXTERIOR};js.prototype.getLocation=function(){return this._isPointOnSegment?Ct.BOUNDARY:this._crossingCount%2===1?Ct.INTERIOR:Ct.EXTERIOR};js.prototype.isOnSegment=function(){return this._isPointOnSegment};js.prototype.interfaces_=function(){return[]};js.prototype.getClass=function(){return js};js.locatePointInRing=function(){if(arguments[0]instanceof St&&De(arguments[1],yn)){for(var e=arguments[0],t=arguments[1],n=new js(e),r=new St,s=new St,l=1;l1||y<0||y>1)&&(s=!0)}}return s?ko.min(pe.distancePointLine(e,n,r),pe.distancePointLine(t,n,r),pe.distancePointLine(n,e,t),pe.distancePointLine(r,e,t)):0};pe.isPointInRing=function(e,t){return pe.locatePointInRing(e,t)!==Ct.EXTERIOR};pe.computeLength=function(e){var t=e.size();if(t<=1)return 0;var n=0,r=new St;e.getCoordinate(0,r);for(var s=r.x,l=r.y,p=1;pn.y&&(n=l,r=s)}var p=r;do p=p-1,p<0&&(p=t);while(e[p].equals2D(n)&&p!==r);var c=r;do c=(c+1)%t;while(e[c].equals2D(n)&&c!==r);var y=e[p],w=e[c];if(y.equals2D(n)||w.equals2D(n)||y.equals2D(w))return!1;var T=pe.computeOrientation(y,n,w),L=!1;return T===0?L=y.x>w.x:L=T>0,L};pe.locatePointInRing=function(e,t){return js.locatePointInRing(e,t)};pe.distancePointLinePerpendicular=function(e,t,n){var r=(n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y),s=((t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y))/r;return Math.abs(s)*Math.sqrt(r)};pe.computeOrientation=function(e,t,n){return pe.orientationIndex(e,t,n)};pe.distancePointLine=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];if(t.length===0)throw new Qn("Line array must contain at least one vertex");for(var n=e.distance(t[0]),r=0;r=1)return l.distance(c);var T=((p.y-l.y)*(c.x-p.x)-(p.x-l.x)*(c.y-p.y))/y;return Math.abs(T)*Math.sqrt(y)}};pe.isOnLine=function(e,t){for(var n=new zu,r=1;r0};rp.prototype.interfaces_=function(){return[Qo]};rp.prototype.getClass=function(){return rp};var ip=function(){};ip.prototype.isInBoundary=function(e){return e>1};ip.prototype.interfaces_=function(){return[Qo]};ip.prototype.getClass=function(){return ip};var op=function(){};op.prototype.isInBoundary=function(e){return e===1};op.prototype.interfaces_=function(){return[Qo]};op.prototype.getClass=function(){return op};var Ar=function(){};Ar.prototype.add=function(){};Ar.prototype.addAll=function(){};Ar.prototype.isEmpty=function(){};Ar.prototype.iterator=function(){};Ar.prototype.size=function(){};Ar.prototype.toArray=function(){};Ar.prototype.remove=function(){};function T0(e){this.message=e||""}T0.prototype=new Error;T0.prototype.name="IndexOutOfBoundsException";var Mp=function(){};Mp.prototype.hasNext=function(){};Mp.prototype.next=function(){};Mp.prototype.remove=function(){};var ms=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t}(Ar);function Ap(e){this.message=e||""}Ap.prototype=new Error;Ap.prototype.name="NoSuchElementException";var ie=function(e){function t(){e.call(this),this.array_=[],arguments[0]instanceof Ar&&this.addAll(arguments[0])}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[e,Ar]},t.prototype.add=function(n){return arguments.length===1?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(n){for(var r=this,s=n.iterator();s.hasNext();)r.add(s.next());return!0},t.prototype.set=function(n,r){var s=this.array_[n];return this.array_[n]=r,s},t.prototype.iterator=function(){return new HR(this)},t.prototype.get=function(n){if(n<0||n>=this.size())throw new T0;return this.array_[n]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var n=this,r=[],s=0,l=this.array_.length;s=1){var w=this.get(this.size()-1);if(w.equals2D(c))return null}e.prototype.add.call(this,c)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var T=arguments[0],L=arguments[1];return this.add(T,L),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var A=arguments[0],z=arguments[1],B=arguments[2];if(B)for(var Y=0;Y=0;et--)r.add(A[et],z);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof St){var at=arguments[0],W=arguments[1],H=arguments[2];if(!H){var nt=this.size();if(nt>0){if(at>0){var ut=this.get(at-1);if(ut.equals2D(W))return null}if(atOt&&(dt=-1);for(var Pt=It;Pt!==Ot;Pt+=dt)r.add(ct[Pt],bt);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new St(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,n),t}(ie),un=function(){},fy={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};fy.ForwardComparator.get=function(){return pd};fy.BidirectionalComparator.get=function(){return sp};fy.coordArrayType.get=function(){return new Array(0).fill(null)};un.prototype.interfaces_=function(){return[]};un.prototype.getClass=function(){return un};un.isRing=function(e){return!(e.length<4||!e[0].equals2D(e[e.length-1]))};un.ptNotInList=function(e,t){for(var n=0;n=e?t:[]};un.indexOf=function(e,t){for(var n=0;n0)&&(t=e[n]);return t};un.extract=function(e,t,n){t=ko.clamp(t,0,e.length),n=ko.clamp(n,-1,e.length);var r=n-t+1;n<0&&(r=0),t>=e.length&&(r=0),nr.length)return 1;if(n.length===0)return 0;var s=un.compare(n,r),l=un.isEqualReversed(n,r);return l?0:s};sp.prototype.OLDcompare=function(e,t){var n=e,r=t;if(n.lengthr.length)return 1;if(n.length===0)return 0;for(var s=un.increasingDirection(n),l=un.increasingDirection(r),p=s>0?0:n.length-1,c=l>0?0:n.length-1,y=0;y0)t=t.right;else return t.value}return null};bi.prototype.put=function(e,t){if(this.root_===null)return this.root_={key:e,value:t,left:null,right:null,parent:null,color:Ka,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n=this.root_,r,s;do if(r=n,s=e.compareTo(n.key),s<0)n=n.left;else if(s>0)n=n.right;else{var l=n.value;return n.value=t,l}while(n!==null);var p={key:e,left:null,right:null,value:t,parent:r,color:Ka,getValue:function(){return this.value},getKey:function(){return this.key}};return s<0?r.left=p:r.right=p,this.fixAfterInsertion(p),this.size_++,null};bi.prototype.fixAfterInsertion=function(e){var t=this;for(e.color=yu;e!=null&&e!==this.root_&&e.parent.color===yu;)if(Vn(e)===ev(Vn(Vn(e)))){var n=ww(Vn(Vn(e)));xw(n)===yu?(Wa(Vn(e),Ka),Wa(n,Ka),Wa(Vn(Vn(e)),yu),e=Vn(Vn(e))):(e===ww(Vn(e))&&(e=Vn(e),t.rotateLeft(e)),Wa(Vn(e),Ka),Wa(Vn(Vn(e)),yu),t.rotateRight(Vn(Vn(e))))}else{var r=ev(Vn(Vn(e)));xw(r)===yu?(Wa(Vn(e),Ka),Wa(r,Ka),Wa(Vn(Vn(e)),yu),e=Vn(Vn(e))):(e===ev(Vn(e))&&(e=Vn(e),t.rotateRight(e)),Wa(Vn(e),Ka),Wa(Vn(Vn(e)),yu),t.rotateLeft(Vn(Vn(e))))}this.root_.color=Ka};bi.prototype.values=function(){var e=new ie,t=this.getFirstEntry();if(t!==null)for(e.add(t.value);(t=bi.successor(t))!==null;)e.add(t.value);return e};bi.prototype.entrySet=function(){var e=new L0,t=this.getFirstEntry();if(t!==null)for(e.add(t);(t=bi.successor(t))!==null;)e.add(t);return e};bi.prototype.rotateLeft=function(e){if(e!=null){var t=e.right;e.right=t.left,t.left!=null&&(t.left.parent=e),t.parent=e.parent,e.parent===null?this.root_=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}};bi.prototype.rotateRight=function(e){if(e!=null){var t=e.left;e.left=t.right,t.right!=null&&(t.right.parent=e),t.parent=e.parent,e.parent===null?this.root_=t:e.parent.right===e?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}};bi.prototype.getFirstEntry=function(){var e=this.root_;if(e!=null)for(;e.left!=null;)e=e.left;return e};bi.successor=function(e){if(e===null)return null;if(e.right!==null){for(var t=e.right;t.left!==null;)t=t.left;return t}else{for(var n=e.parent,r=e;n!==null&&r===n.right;)r=n,n=n.parent;return n}};bi.prototype.size=function(){return this.size_};var fd=function(){};fd.prototype.interfaces_=function(){return[]};fd.prototype.getClass=function(){return fd};function uE(){}uE.prototype=new dy;function Ks(){this.array_=[],arguments[0]instanceof Ar&&this.addAll(arguments[0])}Ks.prototype=new uE;Ks.prototype.contains=function(e){for(var t=this,n=0,r=this.array_.length;n=0;){var p=s.substring(0,l);r.add(p),s=s.substring(l+n),l=s.indexOf(t)}s.length>0&&r.add(s);for(var c=new Array(r.size()).fill(null),y=0;y0)for(var l=s;l0&&r.append(" ");for(var l=0;l0&&r.append(","),r.append(Xo.toString(e.getOrdinate(s,l)))}return r.append(")"),r.toString()}};vr.ensureValidRing=function(e,t){var n=t.size();if(n===0)return t;if(n<=3)return vr.createClosedRing(e,t,4);var r=t.getOrdinate(0,yn.X)===t.getOrdinate(n-1,yn.X)&&t.getOrdinate(0,yn.Y)===t.getOrdinate(n-1,yn.Y);return r?t:vr.createClosedRing(e,t,n+1)};vr.createClosedRing=function(e,t,n){var r=e.create(n,t.getDimension()),s=t.size();vr.copy(t,0,r,0,s);for(var l=s;l0&&vr.reverse(r._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?bn.FALSE:0},t.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return pe.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var r=this._points.copy();vr.reverse(r);var s=this.getFactory().createLineString(r);return s},t.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){for(var s=arguments[0],l=s,p=0,c=0;p= 2)");this._points=r},t.prototype.isCoordinate=function(r){for(var s=this,l=0;l=1&&this.getCoordinateSequence().size()= 4)")},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,n),t}(cr),xa=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return ke.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return this.isEquivalentClass(r)?e.prototype.equalsExact.call(this,r,s):!1}else return e.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.reverse=function(){for(var r=this,s=this._geometries.length,l=new Array(s).fill(null),p=0;p0?t.createPoint(n[0]):t.createPoint():e};md.prototype.interfaces_=function(){return[$o.GeometryEditorOperation]};md.prototype.getClass=function(){return md};var yd=function(){};yd.prototype.edit=function(e,t){return e instanceof Ea?t.createLinearRing(this.edit(e.getCoordinateSequence(),e)):e instanceof cr?t.createLineString(this.edit(e.getCoordinateSequence(),e)):e instanceof fo?t.createPoint(this.edit(e.getCoordinateSequence(),e)):e};yd.prototype.interfaces_=function(){return[$o.GeometryEditorOperation]};yd.prototype.getClass=function(){return yd};var yr=function(){var e=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var n=0;n0){var t=new la(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var n=1;n3&&(r=3),r<2?new yr(n):new yr(n,r)}};Ia.prototype.interfaces_=function(){return[ep,ns]};Ia.prototype.getClass=function(){return Ia};Ia.instance=function(){return Ia.instanceObject};M0.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00};M0.instanceObject.get=function(){return new Ia};Object.defineProperties(Ia,M0);var hE=function(e){function t(){e.call(this),this.map_=new Map}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n){return this.map_.get(n)||null},t.prototype.put=function(n,r){return this.map_.set(n,r),r},t.prototype.values=function(){for(var n=new ie,r=this.map_.values(),s=r.next();!s.done;)n.add(s.value),s=r.next();return n},t.prototype.entrySet=function(){var n=new L0;return this.map_.entries().forEach(function(r){return n.add(r)}),n},t.prototype.size=function(){return this.map_.size()},t}(Oc),wn=function e(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=e.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof Qs){var t=arguments[0];this._modelType=t,t===e.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var n=arguments[0];this._modelType=e.FIXED,this.setScale(n)}else if(arguments[0]instanceof e){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}}},A0={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};wn.prototype.equals=function(e){if(!(e instanceof wn))return!1;var t=e;return this._modelType===t._modelType&&this._scale===t._scale};wn.prototype.compareTo=function(e){var t=e,n=this.getMaximumSignificantDigits(),r=t.getMaximumSignificantDigits();return new Ys(n).compareTo(new Ys(r))};wn.prototype.getScale=function(){return this._scale};wn.prototype.isFloating=function(){return this._modelType===wn.FLOATING||this._modelType===wn.FLOATING_SINGLE};wn.prototype.getType=function(){return this._modelType};wn.prototype.toString=function(){var e="UNKNOWN";return this._modelType===wn.FLOATING?e="Floating":this._modelType===wn.FLOATING_SINGLE?e="Floating-Single":this._modelType===wn.FIXED&&(e="Fixed (Scale="+this.getScale()+")"),e};wn.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var e=arguments[0];if(Ue.isNaN(e))return e;if(this._modelType===wn.FLOATING_SINGLE){var t=e;return t}return this._modelType===wn.FIXED?Math.round(e*this._scale)/this._scale:e}else if(arguments[0]instanceof St){var n=arguments[0];if(this._modelType===wn.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}};wn.prototype.getMaximumSignificantDigits=function(){var e=16;return this._modelType===wn.FLOATING?e=16:this._modelType===wn.FLOATING_SINGLE?e=6:this._modelType===wn.FIXED&&(e=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),e};wn.prototype.setScale=function(e){this._scale=Math.abs(e)};wn.prototype.interfaces_=function(){return[ns,es]};wn.prototype.getClass=function(){return wn};wn.mostPrecise=function(e,t){return e.compareTo(t)>=0?e:t};A0.serialVersionUID.get=function(){return 7777263578777804e3};A0.maximumPreciseValue.get=function(){return 9007199254740992};Object.defineProperties(wn,A0);var Qs=function e(t){this._name=t||null,e.nameToTypeMap.put(t,this)},k0={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};Qs.prototype.readResolve=function(){return Qs.nameToTypeMap.get(this._name)};Qs.prototype.toString=function(){return this._name};Qs.prototype.interfaces_=function(){return[ns]};Qs.prototype.getClass=function(){return Qs};k0.serialVersionUID.get=function(){return-552860263173159e4};k0.nameToTypeMap.get=function(){return new hE};Object.defineProperties(Qs,k0);wn.Type=Qs;wn.FIXED=new Qs("FIXED");wn.FLOATING=new Qs("FLOATING");wn.FLOATING_SINGLE=new Qs("FLOATING SINGLE");var ln=function e(){this._precisionModel=new wn,this._SRID=0,this._coordinateSequenceFactory=e.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?De(arguments[0],ep)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof wn&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},pE={serialVersionUID:{configurable:!0}};ln.prototype.toGeometry=function(e){return e.isNull()?this.createPoint(null):e.getMinX()===e.getMaxX()&&e.getMinY()===e.getMaxY()?this.createPoint(new St(e.getMinX(),e.getMinY())):e.getMinX()===e.getMaxX()||e.getMinY()===e.getMaxY()?this.createLineString([new St(e.getMinX(),e.getMinY()),new St(e.getMaxX(),e.getMaxY())]):this.createPolygon(this.createLinearRing([new St(e.getMinX(),e.getMinY()),new St(e.getMinX(),e.getMaxY()),new St(e.getMaxX(),e.getMaxY()),new St(e.getMaxX(),e.getMinY()),new St(e.getMinX(),e.getMinY())]),null)};ln.prototype.createLineString=function(e){if(e){if(e instanceof Array)return new cr(this.getCoordinateSequenceFactory().create(e),this);if(De(e,yn))return new cr(e,this)}else return new cr(this.getCoordinateSequenceFactory().create([]),this)};ln.prototype.createMultiLineString=function(){if(arguments.length===0)return new Cu(null,this);if(arguments.length===1){var e=arguments[0];return new Cu(e,this)}};ln.prototype.buildGeometry=function(e){for(var t=null,n=!1,r=!1,s=e.iterator();s.hasNext();){var l=s.next(),p=l.getClass();t===null&&(t=p),p!==t&&(n=!0),l.isGeometryCollectionOrDerived()&&(r=!0)}if(t===null)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(ln.toGeometryArray(e));var c=e.iterator().next(),y=e.size()>1;if(y){if(c instanceof Nr)return this.createMultiPolygon(ln.toPolygonArray(e));if(c instanceof cr)return this.createMultiLineString(ln.toLineStringArray(e));if(c instanceof fo)return this.createMultiPoint(ln.toPointArray(e));Ye.shouldNeverReachHere("Unhandled class: "+c.getClass().getName())}return c};ln.prototype.createMultiPointFromCoords=function(e){return this.createMultiPoint(e!==null?this.getCoordinateSequenceFactory().create(e):null)};ln.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof St){var e=arguments[0];return this.createPoint(e!==null?this.getCoordinateSequenceFactory().create([e]):null)}else if(De(arguments[0],yn)){var t=arguments[0];return new fo(t,this)}}};ln.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory};ln.prototype.createPolygon=function(){if(arguments.length===0)return new Nr(null,null,this);if(arguments.length===1){if(De(arguments[0],yn)){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Array){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Ea){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var r=arguments[0],s=arguments[1];return new Nr(r,s,this)}};ln.prototype.getSRID=function(){return this._SRID};ln.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Ri(null,this);if(arguments.length===1){var e=arguments[0];return new Ri(e,this)}};ln.prototype.createGeometry=function(e){var t=new $o(this);return t.edit(e,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})};ln.prototype.getPrecisionModel=function(){return this._precisionModel};ln.prototype.createLinearRing=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)}else if(De(arguments[0],yn)){var t=arguments[0];return new Ea(t,this)}}};ln.prototype.createMultiPolygon=function(){if(arguments.length===0)return new xa(null,this);if(arguments.length===1){var e=arguments[0];return new xa(e,this)}};ln.prototype.createMultiPoint=function(){var e=this;if(arguments.length===0)return new ap(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new ap(t,this)}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)}else if(De(arguments[0],yn)){var r=arguments[0];if(r===null)return this.createMultiPoint(new Array(0).fill(null));for(var s=new Array(r.size()).fill(null),l=0;l=this.size())throw new Error;return this.array_[e]};ua.prototype.push=function(e){return this.array_.push(e),e};ua.prototype.pop=function(e){if(this.array_.length===0)throw new vy;return this.array_.pop()};ua.prototype.peek=function(){if(this.array_.length===0)throw new vy;return this.array_[this.array_.length-1]};ua.prototype.empty=function(){return this.array_.length===0};ua.prototype.isEmpty=function(){return this.empty()};ua.prototype.search=function(e){return this.array_.indexOf(e)};ua.prototype.size=function(){return this.array_.length};ua.prototype.toArray=function(){for(var e=this,t=[],n=0,r=this.array_.length;n0&&this._minIndexthis._minCoord.y&&n.y>this._minCoord.y&&r===pe.CLOCKWISE)&&(s=!0),s&&(this._minIndex=this._minIndex-1)};$s.prototype.getRightmostSideOfSegment=function(e,t){var n=e.getEdge(),r=n.getCoordinates();if(t<0||t+1>=r.length||r[t].y===r[t+1].y)return-1;var s=Xt.LEFT;return r[t].yt._minCoord.x)&&(t._minDe=e,t._minIndex=r,t._minCoord=n[r])};$s.prototype.findRightmostEdgeAtNode=function(){var e=this._minDe.getNode(),t=e.getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)};$s.prototype.findEdge=function(e){for(var t=this,n=e.iterator();n.hasNext();){var r=n.next();r.isForward()&&t.checkForRightmostCoordinate(r)}Ye.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;var s=this.getRightmostSide(this._minDe,this._minIndex);s===Xt.LEFT&&(this._orientedDe=this._minDe.getSym())};$s.prototype.interfaces_=function(){return[]};$s.prototype.getClass=function(){return $s};var il=function(e){function t(n,r){e.call(this,t.msgWithCoord(n,r)),this.pt=r?new St(r):null,this.name="TopologyException"}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getCoordinate=function(){return this.pt},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.msgWithCoord=function(n,r){return r?n:n+" [ "+r+" ]"},t}(nl),by=function(){this.array_=[]};by.prototype.addLast=function(e){this.array_.push(e)};by.prototype.removeFirst=function(){return this.array_.shift()};by.prototype.isEmpty=function(){return this.array_.length===0};var Ni=function(){this._finder=null,this._dirEdgeList=new ie,this._nodes=new ie,this._rightMostCoord=null,this._env=null,this._finder=new $s};Ni.prototype.clearVisitedEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.setVisited(!1)}};Ni.prototype.getRightmostCoordinate=function(){return this._rightMostCoord};Ni.prototype.computeNodeDepth=function(e){for(var t=this,n=null,r=e.getEdges().iterator();r.hasNext();){var s=r.next();if(s.isVisited()||s.getSym().isVisited()){n=s;break}}if(n===null)throw new il("unable to find edge to compute depths at "+e.getCoordinate());e.getEdges().computeDepths(n);for(var l=e.getEdges().iterator();l.hasNext();){var p=l.next();p.setVisited(!0),t.copySymDepths(p)}};Ni.prototype.computeDepth=function(e){this.clearVisitedEdges();var t=this._finder.getEdge();t.setEdgeDepths(Xt.RIGHT,e),this.copySymDepths(t),this.computeDepths(t)};Ni.prototype.create=function(e){this.addReachable(e),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()};Ni.prototype.findResultEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.getDepth(Xt.RIGHT)>=1&&t.getDepth(Xt.LEFT)<=0&&!t.isInteriorAreaEdge()&&t.setInResult(!0)}};Ni.prototype.computeDepths=function(e){var t=this,n=new L0,r=new by,s=e.getNode();for(r.addLast(s),n.add(s),e.setVisited(!0);!r.isEmpty();){var l=r.removeFirst();n.add(l),t.computeNodeDepth(l);for(var p=l.getEdges().iterator();p.hasNext();){var c=p.next(),y=c.getSym();if(!y.isVisited()){var w=y.getNode();n.contains(w)||(r.addLast(w),n.add(w))}}}};Ni.prototype.compareTo=function(e){var t=e;return this._rightMostCoord.xt._rightMostCoord.x?1:0};Ni.prototype.getEnvelope=function(){if(this._env===null){for(var e=new Se,t=this._dirEdgeList.iterator();t.hasNext();)for(var n=t.next(),r=n.getEdge().getCoordinates(),s=0;sthis.location.length){var n=new Array(3).fill(null);n[Xt.ON]=this.location[Xt.ON],n[Xt.LEFT]=Ct.NONE,n[Xt.RIGHT]=Ct.NONE,this.location=n}for(var r=0;r1&&e.append(Ct.toLocationSymbol(this.location[Xt.LEFT])),e.append(Ct.toLocationSymbol(this.location[Xt.ON])),this.location.length>1&&e.append(Ct.toLocationSymbol(this.location[Xt.RIGHT])),e.toString()};Un.prototype.setLocations=function(e,t,n){this.location[Xt.ON]=e,this.location[Xt.LEFT]=t,this.location[Xt.RIGHT]=n};Un.prototype.get=function(e){return e1};Un.prototype.isAnyNull=function(){for(var e=this,t=0;te._maxNodeDegree&&(e._maxNodeDegree=r),t=e.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2};Ir.prototype.addPoints=function(e,t,n){var r=this,s=e.getCoordinates();if(t){var l=1;n&&(l=0);for(var p=l;p=0;y--)r._pts.add(s[y])}};Ir.prototype.isHole=function(){return this._isHole};Ir.prototype.setInResult=function(){var e=this._startDe;do e.getEdge().setInResult(!0),e=e.getNext();while(e!==this._startDe)};Ir.prototype.containsPoint=function(e){var t=this.getLinearRing(),n=t.getEnvelopeInternal();if(!n.contains(e)||!pe.isPointInRing(e,t.getCoordinates()))return!1;for(var r=this._holes.iterator();r.hasNext();){var s=r.next();if(s.containsPoint(e))return!1}return!0};Ir.prototype.addHole=function(e){this._holes.add(e)};Ir.prototype.isShell=function(){return this._shell===null};Ir.prototype.getLabel=function(){return this._label};Ir.prototype.getEdges=function(){return this._edges};Ir.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree};Ir.prototype.getShell=function(){return this._shell};Ir.prototype.mergeLabel=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],r=t.getLocation(n,Xt.RIGHT);if(r===Ct.NONE)return null;if(this._label.getLocation(n)===Ct.NONE)return this._label.setLocation(n,r),null}};Ir.prototype.setShell=function(e){this._shell=e,e!==null&&e.addHole(this)};Ir.prototype.toPolygon=function(e){for(var t=this,n=new Array(this._holes.size()).fill(null),r=0;r=2,"found partial label"),this.computeIM(e)};Do.prototype.isInResult=function(){return this._isInResult};Do.prototype.isVisited=function(){return this._isVisited};Do.prototype.interfaces_=function(){return[]};Do.prototype.getClass=function(){return Do};var xy=function(e){function t(){e.call(this),this._coord=null,this._edges=null;var n=arguments[0],r=arguments[1];this._coord=n,this._edges=r,this._label=new Tn(0,Ct.NONE)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();){var r=n.next();if(r.getEdge().isInResult())return!0}return!1},t.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},t.prototype.getCoordinate=function(){return this._coord},t.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(n){},t.prototype.computeMergedLocation=function(n,r){var s=Ct.NONE;if(s=this._label.getLocation(r),!n.isNull(r)){var l=n.getLocation(r);s!==Ct.BOUNDARY&&(s=l)}return s},t.prototype.setLabel=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1];this._label===null?this._label=new Tn(n,r):this._label.setLocation(n,r)}else return e.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var n=this;if(arguments[0]instanceof t){var r=arguments[0];this.mergeLabel(r._label)}else if(arguments[0]instanceof Tn)for(var s=arguments[0],l=0;l<2;l++){var p=n.computeMergedLocation(s,l),c=n._label.getLocation(l);c===Ct.NONE&&n._label.setLocation(l,p)}},t.prototype.add=function(n){this._edges.insert(n),n.setNode(this)},t.prototype.setLabelBoundary=function(n){if(this._label===null)return null;var r=Ct.NONE;this._label!==null&&(r=this._label.getLocation(n));var s=null;switch(r){case Ct.BOUNDARY:s=Ct.INTERIOR;break;case Ct.INTERIOR:s=Ct.BOUNDARY;break;default:s=Ct.BOUNDARY;break}this._label.setLocation(n,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Do),ta=function(){this.nodeMap=new bi,this.nodeFact=null;var e=arguments[0];this.nodeFact=e};ta.prototype.find=function(e){return this.nodeMap.get(e)};ta.prototype.addNode=function(){if(arguments[0]instanceof St){var e=arguments[0],t=this.nodeMap.get(e);return t===null&&(t=this.nodeFact.createNode(e),this.nodeMap.put(e,t)),t}else if(arguments[0]instanceof xy){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return r===null?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}};ta.prototype.print=function(e){for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}};ta.prototype.iterator=function(){return this.nodeMap.values().iterator()};ta.prototype.values=function(){return this.nodeMap.values()};ta.prototype.getBoundaryNodes=function(e){for(var t=new ie,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(e)===Ct.BOUNDARY&&t.add(r)}return t};ta.prototype.add=function(e){var t=e.getCoordinate(),n=this.addNode(t);n.add(e)};ta.prototype.interfaces_=function(){return[]};ta.prototype.getClass=function(){return ta};var An=function(){},Ud={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};An.prototype.interfaces_=function(){return[]};An.prototype.getClass=function(){return An};An.isNorthern=function(e){return e===An.NE||e===An.NW};An.isOpposite=function(e,t){if(e===t)return!1;var n=(e-t+4)%4;return n===2};An.commonHalfPlane=function(e,t){if(e===t)return e;var n=(e-t+4)%4;if(n===2)return-1;var r=et?e:t;return r===0&&s===3?3:r};An.isInHalfPlane=function(e,t){return t===An.SE?e===An.SE||e===An.SW:e===t||e===t+1};An.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];if(e===0&&t===0)throw new Qn("Cannot compute the quadrant for point ( "+e+", "+t+" )");return e>=0?t>=0?An.NE:An.SE:t>=0?An.NW:An.SW}else if(arguments[0]instanceof St&&arguments[1]instanceof St){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new Qn("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?An.NE:An.SE:r.y>=n.y?An.NW:An.SW}};Ud.NE.get=function(){return 0};Ud.NW.get=function(){return 1};Ud.SW.get=function(){return 2};Ud.SE.get=function(){return 3};Object.defineProperties(An,Ud);var xi=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],r=arguments[2],s=null;this._edge=t,this.init(n,r),this._label=s}else if(arguments.length===4){var l=arguments[0],p=arguments[1],c=arguments[2],y=arguments[3];this._edge=l,this.init(p,c),this._label=y}};xi.prototype.compareDirection=function(e){return this._dx===e._dx&&this._dy===e._dy?0:this._quadrant>e._quadrant?1:this._quadrant2){p.linkDirectedEdgesForMinimalEdgeRings();var c=p.buildMinimalRings(),y=r.findShell(c);y!==null?(r.placePolygonHoles(y,c),t.add(y)):n.addAll(c)}else s.add(p)}return s};go.prototype.containsPoint=function(e){for(var t=this._shellList.iterator();t.hasNext();){var n=t.next();if(n.containsPoint(e))return!0}return!1};go.prototype.buildMaximalEdgeRings=function(e){for(var t=this,n=new ie,r=e.iterator();r.hasNext();){var s=r.next();if(s.isInResult()&&s.getLabel().isArea()&&s.getEdgeRing()===null){var l=new i3(s,t._geometryFactory);n.add(l),l.setInResult()}}return n};go.prototype.placePolygonHoles=function(e,t){for(var n=t.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(e)}};go.prototype.getPolygons=function(){var e=this.computePolygons(this._shellList);return e};go.prototype.findEdgeRingContaining=function(e,t){for(var n=e.getLinearRing(),r=n.getEnvelopeInternal(),s=n.getCoordinateN(0),l=null,p=null,c=t.iterator();c.hasNext();){var y=c.next(),w=y.getLinearRing(),T=w.getEnvelopeInternal();l!==null&&(p=l.getLinearRing().getEnvelopeInternal());var L=!1;T.contains(r)&&pe.isPointInRing(s,w.getCoordinates())&&(L=!0),L&&(l===null||p.contains(T))&&(l=y)}return l};go.prototype.findShell=function(e){for(var t=0,n=null,r=e.iterator();r.hasNext();){var s=r.next();s.isHole()||(n=s,t++)}return Ye.isTrue(t<=1,"found two shells in MinimalEdgeRing list"),n};go.prototype.add=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];ir.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(t),s=new ie,l=this.buildMinimalEdgeRings(r,this._shellList,s);this.sortShellsAndHoles(l,this._shellList,s),this.placeFreeHoles(this._shellList,s)}};go.prototype.interfaces_=function(){return[]};go.prototype.getClass=function(){return go};var up=function(){};up.prototype.getBounds=function(){};up.prototype.interfaces_=function(){return[]};up.prototype.getClass=function(){return up};var vs=function(){this._bounds=null,this._item=null;var e=arguments[0],t=arguments[1];this._bounds=e,this._item=t};vs.prototype.getItem=function(){return this._item};vs.prototype.getBounds=function(){return this._bounds};vs.prototype.interfaces_=function(){return[up,ns]};vs.prototype.getClass=function(){return vs};var ol=function(){this._size=null,this._items=null,this._size=0,this._items=new ie,this._items.add(null)};ol.prototype.poll=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};ol.prototype.size=function(){return this._size};ol.prototype.reorder=function(e){for(var t=this,n=null,r=this._items.get(e);e*2<=this._size&&(n=e*2,n!==t._size&&t._items.get(n+1).compareTo(t._items.get(n))<0&&n++,t._items.get(n).compareTo(r)<0);e=n)t._items.set(e,t._items.get(n));this._items.set(e,r)};ol.prototype.clear=function(){this._size=0,this._items.clear()};ol.prototype.isEmpty=function(){return this._size===0};ol.prototype.add=function(e){var t=this;this._items.add(null),this._size+=1;var n=this._size;for(this._items.set(0,e);e.compareTo(this._items.get(Math.trunc(n/2)))<0;n/=2)t._items.set(n,t._items.get(Math.trunc(n/2)));this._items.set(n,e)};ol.prototype.interfaces_=function(){return[]};ol.prototype.getClass=function(){return ol};var jl=function(){};jl.prototype.visitItem=function(e){};jl.prototype.interfaces_=function(){return[]};jl.prototype.getClass=function(){return jl};var vc=function(){};vc.prototype.insert=function(e,t){};vc.prototype.remove=function(e,t){};vc.prototype.query=function(){};vc.prototype.interfaces_=function(){return[]};vc.prototype.getClass=function(){return vc};var Rr=function(){if(this._childBoundables=new ie,this._bounds=null,this._level=null,arguments.length!==0&&arguments.length===1){var e=arguments[0];this._level=e}},dE={serialVersionUID:{configurable:!0}};Rr.prototype.getLevel=function(){return this._level};Rr.prototype.size=function(){return this._childBoundables.size()};Rr.prototype.getChildBoundables=function(){return this._childBoundables};Rr.prototype.addChildBoundable=function(e){Ye.isTrue(this._bounds===null),this._childBoundables.add(e)};Rr.prototype.isEmpty=function(){return this._childBoundables.isEmpty()};Rr.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds};Rr.prototype.interfaces_=function(){return[up,ns]};Rr.prototype.getClass=function(){return Rr};dE.serialVersionUID.get=function(){return 6493722185909574e3};Object.defineProperties(Rr,dE);var bs=function(){};bs.reverseOrder=function(){return{compare:function(e,t){return t.compareTo(e)}}};bs.min=function(e){return bs.sort(e),e.get(0)};bs.sort=function(e,t){var n=e.toArray();t?Su.sort(n,t):Su.sort(n);for(var r=e.iterator(),s=0,l=n.length;sSr.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,e,t),null):(this.expand(this._boundable2,this._boundable1,e,t),null);if(n)return this.expand(this._boundable1,this._boundable2,e,t),null;if(r)return this.expand(this._boundable2,this._boundable1,e,t),null;throw new Qn("neither boundable is composite")};Sr.prototype.isLeaves=function(){return!(Sr.isComposite(this._boundable1)||Sr.isComposite(this._boundable2))};Sr.prototype.compareTo=function(e){var t=e;return this._distancet._distance?1:0};Sr.prototype.expand=function(e,t,n,r){for(var s=this,l=e.getChildBoundables(),p=l.iterator();p.hasNext();){var c=p.next(),y=new Sr(c,t,s._itemDistance);y.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},wy={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};ri.prototype.getNodeCapacity=function(){return this._nodeCapacity};ri.prototype.lastNode=function(e){return e.get(e.size()-1)};ri.prototype.size=function(){var e=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var t=arguments[0],n=0,r=t.getChildBoundables().iterator();r.hasNext();){var s=r.next();s instanceof Rr?n+=e.size(s):s instanceof vs&&(n+=1)}return n}};ri.prototype.removeItem=function(e,t){for(var n=null,r=e.getChildBoundables().iterator();r.hasNext();){var s=r.next();s instanceof vs&&s.getItem()===t&&(n=s)}return n!==null?(e.getChildBoundables().remove(n),!0):!1};ri.prototype.itemsTree=function(){var e=this;if(arguments.length===0){this.build();var t=this.itemsTree(this._root);return t===null?new ie:t}else if(arguments.length===1){for(var n=arguments[0],r=new ie,s=n.getChildBoundables().iterator();s.hasNext();){var l=s.next();if(l instanceof Rr){var p=e.itemsTree(l);p!==null&&r.add(p)}else l instanceof vs?r.add(l.getItem()):Ye.shouldNeverReachHere()}return r.size()<=0?null:r}};ri.prototype.insert=function(e,t){Ye.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new vs(e,t))};ri.prototype.boundablesAtLevel=function(){var e=this;if(arguments.length===1){var t=arguments[0],n=new ie;return this.boundablesAtLevel(t,this._root,n),n}else if(arguments.length===3){var r=arguments[0],s=arguments[1],l=arguments[2];if(Ye.isTrue(r>-2),s.getLevel()===r)return l.add(s),null;for(var p=s.getChildBoundables().iterator();p.hasNext();){var c=p.next();c instanceof Rr?e.boundablesAtLevel(r,c,l):(Ye.isTrue(c instanceof vs),r===-1&&l.add(c))}return null}};ri.prototype.query=function(){var e=this;if(arguments.length===1){var t=arguments[0];this.build();var n=new ie;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,n),n}else if(arguments.length===2){var r=arguments[0],s=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,s)}else if(arguments.length===3){if(De(arguments[2],jl)&&arguments[0]instanceof Object&&arguments[1]instanceof Rr)for(var l=arguments[0],p=arguments[1],c=arguments[2],y=p.getChildBoundables(),w=0;wn&&(n=l)}}return n+1}};ri.prototype.createParentBoundables=function(e,t){var n=this;Ye.isTrue(!e.isEmpty());var r=new ie;r.add(this.createNode(t));var s=new ie(e);bs.sort(s,this.getComparator());for(var l=s.iterator();l.hasNext();){var p=l.next();n.lastNode(r).getChildBoundables().size()===n.getNodeCapacity()&&r.add(n.createNode(t)),n.lastNode(r).addChildBoundable(p)}return r};ri.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()};ri.prototype.interfaces_=function(){return[ns]};ri.prototype.getClass=function(){return ri};ri.compareDoubles=function(e,t){return e>t?1:e0);for(var p=new ie,c=0;c0;){var B=z.poll(),Y=B.getDistance();if(Y>=L)break;B.isLeaves()?(L=Y,A=B):B.expandToQueue(z,L)}return[A.getBoundable(0).getItem(),A.getBoundable(1).getItem()]}}else if(arguments.length===3){var et=arguments[0],at=arguments[1],W=arguments[2],H=new vs(et,at),nt=new Sr(this.getRoot(),H,W);return this.nearestNeighbour(nt)[0]}},t.prototype.interfaces_=function(){return[vc,ns]},t.prototype.getClass=function(){return t},t.centreX=function(r){return t.avg(r.getMinX(),r.getMaxX())},t.avg=function(r,s){return(r+s)/2},t.centreY=function(r){return t.avg(r.getMinY(),r.getMaxY())},n.STRtreeNode.get=function(){return Sw},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[tp]},compare:function(r,s){return e.compareDoubles(t.centreX(r.getBounds()),t.centreX(s.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[tp]},compare:function(r,s){return e.compareDoubles(t.centreY(r.getBounds()),t.centreY(s.getBounds()))}}},n.intersectsOp.get=function(){return{interfaces_:function(){return[e.IntersectsOp]},intersects:function(r,s){return r.intersects(s)}}},n.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,n),t}(ri),Sw=function(e){function t(){var n=arguments[0];e.call(this,n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var n=null,r=this.getChildBoundables().iterator();r.hasNext();){var s=r.next();n===null?n=new Se(s.getBounds()):n.expandToInclude(s.getBounds())}return n},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Rr),Xi=function(){};Xi.prototype.interfaces_=function(){return[]};Xi.prototype.getClass=function(){return Xi};Xi.relativeSign=function(e,t){return et?1:0};Xi.compare=function(e,t,n){if(t.equals2D(n))return 0;var r=Xi.relativeSign(t.x,n.x),s=Xi.relativeSign(t.y,n.y);switch(e){case 0:return Xi.compareValue(r,s);case 1:return Xi.compareValue(s,r);case 2:return Xi.compareValue(s,-r);case 3:return Xi.compareValue(-r,s);case 4:return Xi.compareValue(-r,-s);case 5:return Xi.compareValue(-s,-r);case 6:return Xi.compareValue(-s,r);case 7:return Xi.compareValue(r,-s)}return Ye.shouldNeverReachHere("invalid octant value"),0};Xi.compareValue=function(e,t){return e<0?-1:e>0?1:t<0?-1:t>0?1:0};var ql=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],r=arguments[3];this._segString=e,this.coord=new St(t),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!t.equals2D(e.getCoordinate(n))};ql.prototype.getCoordinate=function(){return this.coord};ql.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex)};ql.prototype.compareTo=function(e){var t=e;return this.segmentIndext.segmentIndex?1:this.coord.equals2D(t.coord)?0:Xi.compare(this._segmentOctant,this.coord,t.coord)};ql.prototype.isEndPoint=function(e){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===e};ql.prototype.isInterior=function(){return this._isInterior};ql.prototype.interfaces_=function(){return[es]};ql.prototype.getClass=function(){return ql};var Oi=function(){this._nodeMap=new bi,this._edge=null;var e=arguments[0];this._edge=e};Oi.prototype.getSplitCoordinates=function(){var e=this,t=new Bd;this.addEndpoints();for(var n=this.iterator(),r=n.next();n.hasNext();){var s=n.next();e.addEdgeCoordinates(r,s,t),r=s}return t.toCoordinateArray()};Oi.prototype.addCollapsedNodes=function(){var e=this,t=new ie;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var n=t.iterator();n.hasNext();){var r=n.next().intValue();e.add(e._edge.getCoordinate(r),r)}};Oi.prototype.print=function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}};Oi.prototype.findCollapsesFromExistingVertices=function(e){for(var t=this,n=0;n=0?t>=0?n>=r?0:1:n>=r?7:6:t>=0?n>=r?3:2:n>=r?4:5}else if(arguments[0]instanceof St&&arguments[1]instanceof St){var s=arguments[0],l=arguments[1],p=l.x-s.x,c=l.y-s.y;if(p===0&&c===0)throw new Qn("Cannot compute the octant for two identical points "+s);return bc.octant(p,c)}};var Ca=function(){};Ca.prototype.getCoordinates=function(){};Ca.prototype.size=function(){};Ca.prototype.getCoordinate=function(e){};Ca.prototype.isClosed=function(){};Ca.prototype.setData=function(e){};Ca.prototype.getData=function(){};Ca.prototype.interfaces_=function(){return[]};Ca.prototype.getClass=function(){return Ca};var _d=function(){};_d.prototype.addIntersection=function(e,t){};_d.prototype.interfaces_=function(){return[Ca]};_d.prototype.getClass=function(){return _d};var br=function(){this._nodeList=new Oi(this),this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};br.prototype.getCoordinates=function(){return this._pts};br.prototype.size=function(){return this._pts.length};br.prototype.getCoordinate=function(e){return this._pts[e]};br.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};br.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(e),this.getCoordinate(e+1))};br.prototype.setData=function(e){this._data=e};br.prototype.safeOctant=function(e,t){return e.equals2D(t)?0:bc.octant(e,t)};br.prototype.getData=function(){return this._data};br.prototype.addIntersection=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],r=arguments[1],s=arguments[3],l=new St(n.getIntersection(s));this.addIntersection(l,r)}};br.prototype.toString=function(){return ys.toLineString(new yr(this._pts))};br.prototype.getNodeList=function(){return this._nodeList};br.prototype.addIntersectionNode=function(e,t){var n=t,r=n+1;if(r=0&&n>=0||t<=0&&n<=0?Math.max(t,n):0}else if(arguments[0]instanceof St){var r=arguments[0];return pe.orientationIndex(this.p0,this.p1,r)}};Ie.prototype.toGeometry=function(e){return e.createLineString([this.p0,this.p1])};Ie.prototype.isVertical=function(){return this.p0.x===this.p1.x};Ie.prototype.equals=function(e){if(!(e instanceof Ie))return!1;var t=e;return this.p0.equals(t.p0)&&this.p1.equals(t.p1)};Ie.prototype.intersection=function(e){var t=new zu;return t.computeIntersection(this.p0,this.p1,e.p0,e.p1),t.hasIntersection()?t.getIntersection(0):null};Ie.prototype.project=function(){if(arguments[0]instanceof St){var e=arguments[0];if(e.equals(this.p0)||e.equals(this.p1))return new St(e);var t=this.projectionFactor(e),n=new St;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}else if(arguments[0]instanceof Ie){var r=arguments[0],s=this.projectionFactor(r.p0),l=this.projectionFactor(r.p1);if(s>=1&&l>=1||s<=0&&l<=0)return null;var p=this.project(r.p0);s<0&&(p=this.p0),s>1&&(p=this.p1);var c=this.project(r.p1);return l<0&&(c=this.p0),l>1&&(c=this.p1),new Ie(p,c)}};Ie.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()};Ie.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)};Ie.prototype.getCoordinate=function(e){return e===0?this.p0:this.p1};Ie.prototype.distancePerpendicular=function(e){return pe.distancePointLinePerpendicular(e,this.p0,this.p1)};Ie.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)};Ie.prototype.midPoint=function(){return Ie.midPoint(this.p0,this.p1)};Ie.prototype.projectionFactor=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,r=t*t+n*n;if(r<=0)return Ue.NaN;var s=((e.x-this.p0.x)*t+(e.y-this.p0.y)*n)/r;return s};Ie.prototype.closestPoints=function(e){var t=this.intersection(e);if(t!==null)return[t,t];var n=new Array(2).fill(null),r=Ue.MAX_VALUE,s=null,l=this.closestPoint(e.p0);r=l.distance(e.p0),n[0]=l,n[1]=e.p0;var p=this.closestPoint(e.p1);s=p.distance(e.p1),s0&&t<1)return this.project(e);var n=this.p0.distance(e),r=this.p1.distance(e);return n1||Ue.isNaN(t))&&(t=1),t};Ie.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"};Ie.prototype.isHorizontal=function(){return this.p0.y===this.p1.y};Ie.prototype.distance=function(){if(arguments[0]instanceof Ie){var e=arguments[0];return pe.distanceLineLine(this.p0,this.p1,e.p0,e.p1)}else if(arguments[0]instanceof St){var t=arguments[0];return pe.distancePointLine(t,this.p0,this.p1)}};Ie.prototype.pointAlong=function(e){var t=new St;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};Ie.prototype.hashCode=function(){var e=Ue.doubleToLongBits(this.p0.x);e^=Ue.doubleToLongBits(this.p0.y)*31;var t=Math.trunc(e)^Math.trunc(e>>32),n=Ue.doubleToLongBits(this.p1.x);n^=Ue.doubleToLongBits(this.p1.y)*31;var r=Math.trunc(n)^Math.trunc(n>>32);return t^r};Ie.prototype.interfaces_=function(){return[es,ns]};Ie.prototype.getClass=function(){return Ie};Ie.midPoint=function(e,t){return new St((e.x+t.x)/2,(e.y+t.y)/2)};mE.serialVersionUID.get=function(){return 0x2d2172135f411c00};Object.defineProperties(Ie,mE);var vd=function(){this.tempEnv1=new Se,this.tempEnv2=new Se,this._overlapSeg1=new Ie,this._overlapSeg2=new Ie};vd.prototype.overlap=function(){if(arguments.length!==2&&arguments.length===4){var e=arguments[0],t=arguments[1],n=arguments[2],r=arguments[3];e.getLineSegment(t,this._overlapSeg1),n.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}};vd.prototype.interfaces_=function(){return[]};vd.prototype.getClass=function(){return vd};var mo=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],r=arguments[3];this._pts=e,this._start=t,this._end=n,this._context=r};mo.prototype.getLineSegment=function(e,t){t.p0=this._pts[e],t.p1=this._pts[e+1]};mo.prototype.computeSelect=function(e,t,n,r){var s=this._pts[t],l=this._pts[n];if(r.tempEnv1.init(s,l),n-t===1)return r.select(this,t),null;if(!e.intersects(r.tempEnv1))return null;var p=Math.trunc((t+n)/2);t=e.length-1)return e.length-1;for(var r=An.quadrant(e[n],e[n+1]),s=t+1;sp.getId()&&(p.computeOverlaps(w,s),r._nOverlaps++),r._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},n.SegmentOverlapAction.get=function(){return Ew},Object.defineProperties(t,n),t}(bd),Ew=function(e){function t(){e.call(this),this._si=null;var n=arguments[0];this._si=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(arguments.length===4){var n=arguments[0],r=arguments[1],s=arguments[2],l=arguments[3],p=n.getContext(),c=s.getContext();this._si.processIntersections(p,r,c,l)}else return e.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(vd),xn=function e(){if(this._quadrantSegments=e.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=e.CAP_ROUND,this._joinStyle=e.JOIN_ROUND,this._mitreLimit=e.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=e.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setQuadrantSegments(t)}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(arguments.length===4){var s=arguments[0],l=arguments[1],p=arguments[2],c=arguments[3];this.setQuadrantSegments(s),this.setEndCapStyle(l),this.setJoinStyle(p),this.setMitreLimit(c)}}},pl={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};xn.prototype.getEndCapStyle=function(){return this._endCapStyle};xn.prototype.isSingleSided=function(){return this._isSingleSided};xn.prototype.setQuadrantSegments=function(e){this._quadrantSegments=e,this._quadrantSegments===0&&(this._joinStyle=xn.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=xn.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),e<=0&&(this._quadrantSegments=1),this._joinStyle!==xn.JOIN_ROUND&&(this._quadrantSegments=xn.DEFAULT_QUADRANT_SEGMENTS)};xn.prototype.getJoinStyle=function(){return this._joinStyle};xn.prototype.setJoinStyle=function(e){this._joinStyle=e};xn.prototype.setSimplifyFactor=function(e){this._simplifyFactor=e<0?0:e};xn.prototype.getSimplifyFactor=function(){return this._simplifyFactor};xn.prototype.getQuadrantSegments=function(){return this._quadrantSegments};xn.prototype.setEndCapStyle=function(e){this._endCapStyle=e};xn.prototype.getMitreLimit=function(){return this._mitreLimit};xn.prototype.setMitreLimit=function(e){this._mitreLimit=e};xn.prototype.setSingleSided=function(e){this._isSingleSided=e};xn.prototype.interfaces_=function(){return[]};xn.prototype.getClass=function(){return xn};xn.bufferDistanceError=function(e){var t=Math.PI/2/e;return 1-Math.cos(t/2)};pl.CAP_ROUND.get=function(){return 1};pl.CAP_FLAT.get=function(){return 2};pl.CAP_SQUARE.get=function(){return 3};pl.JOIN_ROUND.get=function(){return 1};pl.JOIN_MITRE.get=function(){return 2};pl.JOIN_BEVEL.get=function(){return 3};pl.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8};pl.DEFAULT_MITRE_LIMIT.get=function(){return 5};pl.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01};Object.defineProperties(xn,pl);var hr=function(e){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=pe.COUNTERCLOCKWISE,this._inputLine=e||null},Gd={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};hr.prototype.isDeletable=function(e,t,n,r){var s=this._inputLine[e],l=this._inputLine[t],p=this._inputLine[n];return!this.isConcave(s,l,p)||!this.isShallow(s,l,p,r)?!1:this.isShallowSampled(s,l,e,n,r)};hr.prototype.deleteShallowConcavities=function(){for(var e=this,t=1,n=this.findNextNonDeletedIndex(t),r=this.findNextNonDeletedIndex(n),s=!1;r=0;s--)n.addPt(e[s])};Ro.prototype.isRedundant=function(e){if(this._ptList.size()<1)return!1;var t=this._ptList.get(this._ptList.size()-1),n=e.distance(t);return nMath.PI;)e-=fn.PI_TIMES_2;for(;e<=-Math.PI;)e+=fn.PI_TIMES_2;return e};fn.angle=function(){if(arguments.length===1){var e=arguments[0];return Math.atan2(e.y,e.x)}else if(arguments.length===2){var t=arguments[0],n=arguments[1],r=n.x-t.x,s=n.y-t.y;return Math.atan2(s,r)}};fn.isAcute=function(e,t,n){var r=e.x-t.x,s=e.y-t.y,l=n.x-t.x,p=n.y-t.y,c=r*l+s*p;return c>0};fn.isObtuse=function(e,t,n){var r=e.x-t.x,s=e.y-t.y,l=n.x-t.x,p=n.y-t.y,c=r*l+s*p;return c<0};fn.interiorAngle=function(e,t,n){var r=fn.angle(t,e),s=fn.angle(t,n);return Math.abs(s-r)};fn.normalizePositive=function(e){if(e<0){for(;e<0;)e+=fn.PI_TIMES_2;e>=fn.PI_TIMES_2&&(e=0)}else{for(;e>=fn.PI_TIMES_2;)e-=fn.PI_TIMES_2;e<0&&(e=0)}return e};fn.angleBetween=function(e,t,n){var r=fn.angle(t,e),s=fn.angle(t,n);return fn.diff(r,s)};fn.diff=function(e,t){var n=null;return eMath.PI&&(n=2*Math.PI-n),n};fn.toRadians=function(e){return e*Math.PI/180};fn.getTurn=function(e,t){var n=Math.sin(t-e);return n>0?fn.COUNTERCLOCKWISE:n<0?fn.CLOCKWISE:fn.NONE};fn.angleBetweenOriented=function(e,t,n){var r=fn.angle(t,e),s=fn.angle(t,n),l=s-r;return l<=-Math.PI?l+fn.PI_TIMES_2:l>Math.PI?l-fn.PI_TIMES_2:l};zc.PI_TIMES_2.get=function(){return 2*Math.PI};zc.PI_OVER_2.get=function(){return Math.PI/2};zc.PI_OVER_4.get=function(){return Math.PI/4};zc.COUNTERCLOCKWISE.get=function(){return pe.COUNTERCLOCKWISE};zc.CLOCKWISE.get=function(){return pe.CLOCKWISE};zc.NONE.get=function(){return pe.COLLINEAR};Object.defineProperties(fn,zc);var Xn=function e(){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 Ie,this._seg1=new Ie,this._offset0=new Ie,this._offset1=new Ie,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=t,this._bufParams=n,this._li=new zu,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===xn.JOIN_ROUND&&(this._closingSegLengthFactor=e.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},jd={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Xn.prototype.addNextSegment=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=pe.computeOrientation(this._s0,this._s1,this._s2),r=n===pe.CLOCKWISE&&this._side===Xt.LEFT||n===pe.COUNTERCLOCKWISE&&this._side===Xt.RIGHT;n===0?this.addCollinear(t):r?this.addOutsideTurn(n,t):this.addInsideTurn(n,t)};Xn.prototype.addLineEndCap=function(e,t){var n=new Ie(e,t),r=new Ie;this.computeOffsetSegment(n,Xt.LEFT,this._distance,r);var s=new Ie;this.computeOffsetSegment(n,Xt.RIGHT,this._distance,s);var l=t.x-e.x,p=t.y-e.y,c=Math.atan2(p,l);switch(this._bufParams.getEndCapStyle()){case xn.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(t,c+Math.PI/2,c-Math.PI/2,pe.CLOCKWISE,this._distance),this._segList.addPt(s.p1);break;case xn.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(s.p1);break;case xn.CAP_SQUARE:var y=new St;y.x=Math.abs(this._distance)*Math.cos(c),y.y=Math.abs(this._distance)*Math.sin(c);var w=new St(r.p1.x+y.x,r.p1.y+y.y),T=new St(s.p1.x+y.x,s.p1.y+y.y);this._segList.addPt(w),this._segList.addPt(T);break}};Xn.prototype.getCoordinates=function(){var e=this._segList.getCoordinates();return e};Xn.prototype.addMitreJoin=function(e,t,n,r){var s=!0,l=null;try{l=gs.intersection(t.p0,t.p1,n.p0,n.p1);var p=r<=0?1:l.distance(e)/Math.abs(r);p>this._bufParams.getMitreLimit()&&(s=!1)}catch(c){if(c instanceof Pp)l=new St(0,0),s=!1;else throw c}finally{}s?this._segList.addPt(l):this.addLimitedMitreJoin(t,n,r,this._bufParams.getMitreLimit())};Xn.prototype.addFilletCorner=function(e,t,n,r,s){var l=t.x-e.x,p=t.y-e.y,c=Math.atan2(p,l),y=n.x-e.x,w=n.y-e.y,T=Math.atan2(w,y);r===pe.CLOCKWISE?c<=T&&(c+=2*Math.PI):c>=T&&(c-=2*Math.PI),this._segList.addPt(t),this.addFilletArc(e,c,T,r,s),this._segList.addPt(n)};Xn.prototype.addOutsideTurn=function(e,t){if(this._offset0.p1.distance(this._offset1.p0)0){var n=new St((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 r=new St((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(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}};Xn.prototype.createCircle=function(e){var t=new St(e.x+this._distance,e.y);this._segList.addPt(t),this.addFilletArc(e,0,2*Math.PI,-1,this._distance),this._segList.closeRing()};Xn.prototype.addBevelJoin=function(e,t){this._segList.addPt(e.p1),this._segList.addPt(t.p0)};Xn.prototype.init=function(e){this._distance=e,this._maxCurveSegmentError=e*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Ro,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(e*Xn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)};Xn.prototype.addCollinear=function(e){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var t=this._li.getIntersectionNum();t>=2&&(this._bufParams.getJoinStyle()===xn.JOIN_BEVEL||this._bufParams.getJoinStyle()===xn.JOIN_MITRE?(e&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,pe.CLOCKWISE,this._distance))};Xn.prototype.closeRing=function(){this._segList.closeRing()};Xn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle};Xn.prototype.interfaces_=function(){return[]};Xn.prototype.getClass=function(){return Xn};jd.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001};jd.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001};jd.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6};jd.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80};Object.defineProperties(Xn,jd);var Ki=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var e=arguments[0],t=arguments[1];this._precisionModel=e,this._bufParams=t};Ki.prototype.getOffsetCurve=function(e,t){if(this._distance=t,t===0)return null;var n=t<0,r=Math.abs(t),s=this.getSegGen(r);e.length<=1?this.computePointCurve(e[0],s):this.computeOffsetCurve(e,n,s);var l=s.getCoordinates();return n&&un.reverse(l),l};Ki.prototype.computeSingleSidedBufferCurve=function(e,t,n){var r=this.simplifyTolerance(this._distance);if(t){n.addSegments(e,!0);var s=hr.simplify(e,-r),l=s.length-1;n.initSideSegments(s[l],s[l-1],Xt.LEFT),n.addFirstSegment();for(var p=l-2;p>=0;p--)n.addNextSegment(s[p],!0)}else{n.addSegments(e,!1);var c=hr.simplify(e,r),y=c.length-1;n.initSideSegments(c[0],c[1],Xt.LEFT),n.addFirstSegment();for(var w=2;w<=y;w++)n.addNextSegment(c[w],!0)}n.addLastSegment(),n.closeRing()};Ki.prototype.computeRingBufferCurve=function(e,t,n){var r=this.simplifyTolerance(this._distance);t===Xt.RIGHT&&(r=-r);var s=hr.simplify(e,r),l=s.length-1;n.initSideSegments(s[l-1],s[0],t);for(var p=1;p<=l;p++){var c=p!==1;n.addNextSegment(s[p],c)}n.closeRing()};Ki.prototype.computeLineBufferCurve=function(e,t){var n=this.simplifyTolerance(this._distance),r=hr.simplify(e,n),s=r.length-1;t.initSideSegments(r[0],r[1],Xt.LEFT);for(var l=2;l<=s;l++)t.addNextSegment(r[l],!0);t.addLastSegment(),t.addLineEndCap(r[s-1],r[s]);var p=hr.simplify(e,-n),c=p.length-1;t.initSideSegments(p[c],p[c-1],Xt.LEFT);for(var y=c-2;y>=0;y--)t.addNextSegment(p[y],!0);t.addLastSegment(),t.addLineEndCap(p[1],p[0]),t.closeRing()};Ki.prototype.computePointCurve=function(e,t){switch(this._bufParams.getEndCapStyle()){case xn.CAP_ROUND:t.createCircle(e);break;case xn.CAP_SQUARE:t.createSquare(e);break}};Ki.prototype.getLineCurve=function(e,t){if(this._distance=t,t<0&&!this._bufParams.isSingleSided()||t===0)return null;var n=Math.abs(t),r=this.getSegGen(n);if(e.length<=1)this.computePointCurve(e[0],r);else if(this._bufParams.isSingleSided()){var s=t<0;this.computeSingleSidedBufferCurve(e,s,r)}else this.computeLineBufferCurve(e,r);var l=r.getCoordinates();return l};Ki.prototype.getBufferParameters=function(){return this._bufParams};Ki.prototype.simplifyTolerance=function(e){return e*this._bufParams.getSimplifyFactor()};Ki.prototype.getRingCurve=function(e,t,n){if(this._distance=n,e.length<=2)return this.getLineCurve(e,n);if(n===0)return Ki.copyCoordinates(e);var r=this.getSegGen(n);return this.computeRingBufferCurve(e,t,r),r.getCoordinates()};Ki.prototype.computeOffsetCurve=function(e,t,n){var r=this.simplifyTolerance(this._distance);if(t){var s=hr.simplify(e,-r),l=s.length-1;n.initSideSegments(s[l],s[l-1],Xt.LEFT),n.addFirstSegment();for(var p=l-2;p>=0;p--)n.addNextSegment(s[p],!0)}else{var c=hr.simplify(e,r),y=c.length-1;n.initSideSegments(c[0],c[1],Xt.LEFT),n.addFirstSegment();for(var w=2;w<=y;w++)n.addNextSegment(c[w],!0)}n.addLastSegment()};Ki.prototype.getSegGen=function(e){return new Xn(this._precisionModel,this._bufParams,e)};Ki.prototype.interfaces_=function(){return[]};Ki.prototype.getClass=function(){return Ki};Ki.copyCoordinates=function(e){for(var t=new Array(e.length).fill(null),n=0;nl.getMaxY()||e.findStabbedSegments(t,s.getDirectedEdges(),n)}return n}else if(arguments.length===3){if(De(arguments[2],ms)&&arguments[0]instanceof St&&arguments[1]instanceof jv)for(var p=arguments[0],c=arguments[1],y=arguments[2],w=c.getEdge().getCoordinates(),T=0;Te._seg.p1.y&&e._seg.reverse();var L=Math.max(e._seg.p0.x,e._seg.p1.x);if(!(Le._seg.p1.y)&&pe.computeOrientation(e._seg.p0,e._seg.p1,p)!==pe.RIGHT){var A=c.getDepth(Xt.LEFT);e._seg.p0.equals(w[T])||(A=c.getDepth(Xt.RIGHT));var z=new Lu(e._seg,A);y.add(z)}}else if(De(arguments[2],ms)&&arguments[0]instanceof St&&De(arguments[1],ms))for(var B=arguments[0],Y=arguments[1],et=arguments[2],at=Y.iterator();at.hasNext();){var W=at.next();W.isForward()&&e.findStabbedSegments(B,W,et)}}};xc.prototype.getDepth=function(e){var t=this.findStabbedSegments(e);if(t.size()===0)return 0;var n=bs.min(t);return n._leftDepth};xc.prototype.interfaces_=function(){return[]};xc.prototype.getClass=function(){return xc};_E.DepthSegment.get=function(){return Lu};Object.defineProperties(xc,_E);var Lu=function(){this._upwardSeg=null,this._leftDepth=null;var e=arguments[0],t=arguments[1];this._upwardSeg=new Ie(e),this._leftDepth=t};Lu.prototype.compareTo=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),n!==0)?n:this._upwardSeg.compareTo(t._upwardSeg)};Lu.prototype.compareX=function(e,t){var n=e.p0.compareTo(t.p0);return n!==0?n:e.p1.compareTo(t.p1)};Lu.prototype.toString=function(){return this._upwardSeg.toString()};Lu.prototype.interfaces_=function(){return[es]};Lu.prototype.getClass=function(){return Lu};var Sn=function(e,t,n){this.p0=e||null,this.p1=t||null,this.p2=n||null};Sn.prototype.area=function(){return Sn.area(this.p0,this.p1,this.p2)};Sn.prototype.signedArea=function(){return Sn.signedArea(this.p0,this.p1,this.p2)};Sn.prototype.interpolateZ=function(e){if(e===null)throw new Qn("Supplied point is null.");return Sn.interpolateZ(e,this.p0,this.p1,this.p2)};Sn.prototype.longestSideLength=function(){return Sn.longestSideLength(this.p0,this.p1,this.p2)};Sn.prototype.isAcute=function(){return Sn.isAcute(this.p0,this.p1,this.p2)};Sn.prototype.circumcentre=function(){return Sn.circumcentre(this.p0,this.p1,this.p2)};Sn.prototype.area3D=function(){return Sn.area3D(this.p0,this.p1,this.p2)};Sn.prototype.centroid=function(){return Sn.centroid(this.p0,this.p1,this.p2)};Sn.prototype.inCentre=function(){return Sn.inCentre(this.p0,this.p1,this.p2)};Sn.prototype.interfaces_=function(){return[]};Sn.prototype.getClass=function(){return Sn};Sn.area=function(e,t,n){return Math.abs(((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2)};Sn.signedArea=function(e,t,n){return((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2};Sn.det=function(e,t,n,r){return e*r-t*n};Sn.interpolateZ=function(e,t,n,r){var s=t.x,l=t.y,p=n.x-s,c=r.x-s,y=n.y-l,w=r.y-l,T=p*w-c*y,L=e.x-s,A=e.y-l,z=(w*L-c*A)/T,B=(-y*L+p*A)/T,Y=t.z+z*(n.z-t.z)+B*(r.z-t.z);return Y};Sn.longestSideLength=function(e,t,n){var r=e.distance(t),s=t.distance(n),l=n.distance(e),p=r;return s>p&&(p=s),l>p&&(p=l),p};Sn.isAcute=function(e,t,n){return!(!fn.isAcute(e,t,n)||!fn.isAcute(t,n,e)||!fn.isAcute(n,e,t))};Sn.circumcentre=function(e,t,n){var r=n.x,s=n.y,l=e.x-r,p=e.y-s,c=t.x-r,y=t.y-s,w=2*Sn.det(l,p,c,y),T=Sn.det(p,l*l+p*p,y,c*c+y*y),L=Sn.det(l,l*l+p*p,c,c*c+y*y),A=r-T/w,z=s+L/w;return new St(A,z)};Sn.perpendicularBisector=function(e,t){var n=t.x-e.x,r=t.y-e.y,s=new gs(e.x+n/2,e.y+r/2,1),l=new gs(e.x-r+n/2,e.y+n+r/2,1);return new gs(s,l)};Sn.angleBisector=function(e,t,n){var r=t.distance(e),s=t.distance(n),l=r/(r+s),p=n.x-e.x,c=n.y-e.y,y=new St(e.x+l*p,e.y+l*c);return y};Sn.area3D=function(e,t,n){var r=t.x-e.x,s=t.y-e.y,l=t.z-e.z,p=n.x-e.x,c=n.y-e.y,y=n.z-e.z,w=s*y-l*c,T=l*p-r*y,L=r*c-s*p,A=w*w+T*T+L*L,z=Math.sqrt(A)/2;return z};Sn.centroid=function(e,t,n){var r=(e.x+t.x+n.x)/3,s=(e.y+t.y+n.y)/3;return new St(r,s)};Sn.inCentre=function(e,t,n){var r=t.distance(n),s=e.distance(n),l=e.distance(t),p=r+s+l,c=(r*e.x+s*t.x+l*n.x)/p,y=(r*e.y+s*t.y+l*n.y)/p;return new St(c,y)};var ts=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new ie;var e=arguments[0],t=arguments[1],n=arguments[2];this._inputGeom=e,this._distance=t,this._curveBuilder=n};ts.prototype.addPoint=function(e){if(this._distance<=0)return null;var t=e.getCoordinates(),n=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(n,Ct.EXTERIOR,Ct.INTERIOR)};ts.prototype.addPolygon=function(e){var t=this,n=this._distance,r=Xt.LEFT;this._distance<0&&(n=-this._distance,r=Xt.RIGHT);var s=e.getExteriorRing(),l=un.removeRepeatedPoints(s.getCoordinates());if(this._distance<0&&this.isErodedCompletely(s,this._distance)||this._distance<=0&&l.length<3)return null;this.addPolygonRing(l,n,r,Ct.EXTERIOR,Ct.INTERIOR);for(var p=0;p0&&t.isErodedCompletely(c,-t._distance)||t.addPolygonRing(y,n,Xt.opposite(r),Ct.INTERIOR,Ct.EXTERIOR)}};ts.prototype.isTriangleErodedCompletely=function(e,t){var n=new Sn(e[0],e[1],e[2]),r=n.inCentre(),s=pe.distancePointLine(r,n.p0,n.p1);return s=Ea.MINIMUM_VALID_SIZE&&pe.isCCW(e)&&(l=s,p=r,n=Xt.opposite(n));var c=this._curveBuilder.getRingCurve(e,n,t);this.addCurve(c,l,p)};ts.prototype.add=function(e){if(e.isEmpty())return null;e instanceof Nr?this.addPolygon(e):e instanceof cr?this.addLineString(e):e instanceof fo?this.addPoint(e):e instanceof ap?this.addCollection(e):e instanceof Cu?this.addCollection(e):e instanceof xa?this.addCollection(e):e instanceof Ri&&this.addCollection(e)};ts.prototype.isErodedCompletely=function(e,t){var n=e.getCoordinates();if(n.length<4)return t<0;if(n.length===4)return this.isTriangleErodedCompletely(n,t);var r=e.getEnvelopeInternal(),s=Math.min(r.getHeight(),r.getWidth());return t<0&&2*Math.abs(t)>s};ts.prototype.addCollection=function(e){for(var t=this,n=0;n=this._max)throw new Ap;var e=this._parent.getGeometryN(this._index++);return e instanceof Ri?(this._subcollectionIterator=new wa(e),this._subcollectionIterator.next()):e};wa.prototype.remove=function(){throw new Error(this.getClass().getName())};wa.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)};wa.prototype.interfaces_=function(){return[Mp]};wa.prototype.getClass=function(){return wa};wa.isAtomic=function(e){return!(e instanceof Ri)};var Mo=function(){this._geom=null;var e=arguments[0];this._geom=e};Mo.prototype.locate=function(e){return Mo.locate(e,this._geom)};Mo.prototype.interfaces_=function(){return[hp]};Mo.prototype.getClass=function(){return Mo};Mo.isPointInRing=function(e,t){return t.getEnvelopeInternal().intersects(e)?pe.isPointInRing(e,t.getCoordinates()):!1};Mo.containsPointInPolygon=function(e,t){if(t.isEmpty())return!1;var n=t.getExteriorRing();if(!Mo.isPointInRing(e,n))return!1;for(var r=0;r=0;l--){var p=n._edgeList.get(l),c=p.getSym();s===null&&(s=c),r!==null&&c.setNext(r),r=p}s.setNext(r)},t.prototype.computeDepths=function(){var n=this;if(arguments.length===1){var r=arguments[0],s=this.findIndex(r),l=r.getDepth(Xt.LEFT),p=r.getDepth(Xt.RIGHT),c=this.computeDepths(s+1,this._edgeList.size(),l),y=this.computeDepths(0,s,c);if(y!==p)throw new il("depth mismatch at "+r.getCoordinate())}else if(arguments.length===3){for(var w=arguments[0],T=arguments[1],L=arguments[2],A=L,z=w;z=0;c--){var y=r._resultAreaEdgeList.get(c),w=y.getSym();switch(s===null&&y.getEdgeRing()===n&&(s=y),p){case r._SCANNING_FOR_INCOMING:if(w.getEdgeRing()!==n)continue;l=w,p=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(y.getEdgeRing()!==n)continue;l.setNextMin(y),p=r._SCANNING_FOR_INCOMING;break}}p===this._LINKING_TO_OUTGOING&&(Ye.isTrue(s!==null,"found null for first outgoing dirEdge"),Ye.isTrue(s.getEdgeRing()===n,"unable to link last incoming dirEdge"),l.setNextMin(s))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var n=0,r=this.iterator();r.hasNext();){var s=r.next();s.isInResult()&&n++}return n}else if(arguments.length===1){for(var l=arguments[0],p=0,c=this.iterator();c.hasNext();){var y=c.next();y.getEdgeRing()===l&&p++}return p}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var n=Ct.NONE,r=this.iterator();r.hasNext();){var s=r.next(),l=s.getSym();if(!s.isLineEdge()){if(s.isInResult()){n=Ct.INTERIOR;break}if(l.isInResult()){n=Ct.EXTERIOR;break}}}if(n===Ct.NONE)return null;for(var p=n,c=this.iterator();c.hasNext();){var y=c.next(),w=y.getSym();y.isLineEdge()?y.getEdge().setCovered(p===Ct.INTERIOR):(y.isInResult()&&(p=Ct.EXTERIOR),w.isInResult()&&(p=Ct.INTERIOR))}},t.prototype.computeLabelling=function(n){var r=this;e.prototype.computeLabelling.call(this,n),this._label=new Tn(Ct.NONE);for(var s=this.iterator();s.hasNext();)for(var l=s.next(),p=l.getEdge(),c=p.getLabel(),y=0;y<2;y++){var w=c.getLocation(y);(w===Ct.INTERIOR||w===Ct.BOUNDARY)&&r._label.setLocation(y,Ct.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(wi),vE=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createNode=function(n){return new xy(n,new s3)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(up),Wl=function e(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=e.orientation(t)};Wl.prototype.compareTo=function(e){var t=e,n=Wl.compareOriented(this._pts,this._orientation,t._pts,t._orientation);return n};Wl.prototype.interfaces_=function(){return[es]};Wl.prototype.getClass=function(){return Wl};Wl.orientation=function(e){return un.increasingDirection(e)===1};Wl.compareOriented=function(e,t,n,r){for(var s=t?1:-1,l=r?1:-1,p=t?e.length:-1,c=r?n.length:-1,y=t?0:e.length-1,w=r?0:n.length-1;;){var T=e[y].compareTo(n[w]);if(T!==0)return T;y+=s,w+=l;var L=y===p,A=w===c;if(L&&!A)return-1;if(!L&&A)return 1;if(L&&A)return 0}};var xs=function(){this._edges=new ie,this._ocaMap=new bi};xs.prototype.print=function(e){var t=this;e.print("MULTILINESTRING ( ");for(var n=0;n0&&e.print(","),e.print("(");for(var s=r.getCoordinates(),l=0;l0&&e.print(","),e.print(s[l].x+" "+s[l].y);e.println(")")}e.print(") ")};xs.prototype.addAll=function(e){for(var t=this,n=e.iterator();n.hasNext();)t.add(n.next())};xs.prototype.findEdgeIndex=function(e){for(var t=this,n=0;n0||!t.coord.equals2D(s);l||r--;var p=new Array(r).fill(null),c=0;p[c++]=new St(e.coord);for(var y=e.segmentIndex+1;y<=t.segmentIndex;y++)p[c++]=n.edge.pts[y];return l&&(p[c]=t.coord),new Zm(p,new Tn(this.edge._label))};Ta.prototype.add=function(e,t,n){var r=new ea(e,t,n),s=this._nodeMap.get(r);return s!==null?s:(this._nodeMap.put(r,r),r)};Ta.prototype.isIntersection=function(e){for(var t=this.iterator();t.hasNext();){var n=t.next();if(n.coord.equals(e))return!0}return!1};Ta.prototype.interfaces_=function(){return[]};Ta.prototype.getClass=function(){return Ta};var Mu=function(){};Mu.prototype.getChainStartIndices=function(e){var t=this,n=0,r=new ie;r.add(new Ys(n));do{var s=t.findChainEnd(e,n);r.add(new Ys(s)),n=s}while(nn?t:n};sl.prototype.getMinX=function(e){var t=this.pts[this.startIndex[e]].x,n=this.pts[this.startIndex[e+1]].x;return tn&&(s=1),e._depth[t][r]=s}}};hi.prototype.getDelta=function(e){return this._depth[e][Xt.RIGHT]-this._depth[e][Xt.LEFT]};hi.prototype.getLocation=function(e,t){return this._depth[e][t]<=0?Ct.EXTERIOR:Ct.INTERIOR};hi.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]};hi.prototype.add=function(){var e=this;if(arguments.length===1)for(var t=arguments[0],n=0;n<2;n++)for(var r=1;r<3;r++){var s=t.getLocation(n,r);(s===Ct.EXTERIOR||s===Ct.INTERIOR)&&(e.isNull(n,r)?e._depth[n][r]=hi.depthAtLocation(s):e._depth[n][r]+=hi.depthAtLocation(s))}else if(arguments.length===3){var l=arguments[0],p=arguments[1],c=arguments[2];c===Ct.INTERIOR&&this._depth[l][p]++}};hi.prototype.interfaces_=function(){return[]};hi.prototype.getClass=function(){return hi};hi.depthAtLocation=function(e){return e===Ct.EXTERIOR?0:e===Ct.INTERIOR?1:hi.NULL_VALUE};bE.NULL_VALUE.get=function(){return-1};Object.defineProperties(hi,bE);var Zm=function(e){function t(){if(e.call(this),this.pts=null,this._env=null,this.eiList=new Ta(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new hi,this._depthDelta=0,arguments.length===1){var n=arguments[0];t.call(this,n,null)}else if(arguments.length===2){var r=arguments[0],s=arguments[1];this.pts=r,this._label=s}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var n=new Array(2).fill(null);n[0]=this.pts[0],n[1]=this.pts[1];var r=new t(n,Tn.toLineLabel(this._label));return r},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(n){this._isIsolated=n},t.prototype.setName=function(n){this._name=n},t.prototype.equals=function(n){var r=this;if(!(n instanceof t))return!1;var s=n;if(this.pts.length!==s.pts.length)return!1;for(var l=!0,p=!0,c=this.pts.length,y=0;y0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}},t.prototype.print=function(n){var r=this;n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var s=0;s0&&n.print(","),n.print(r.pts[s].x+" "+r.pts[s].y);n.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(n){t.updateIM(this._label,n)},t.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(n){var r=this;n.print("edge "+this._name+": ");for(var s=this.pts.length-1;s>=0;s--)n.print(r.pts[s]+" ");n.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new sl(this)),this._mce},t.prototype.getEnvelope=function(){var n=this;if(this._env===null){this._env=new Se;for(var r=0;r0&&r.append(","),r.append(n.pts[s].x+" "+n.pts[s].y);return r.append(") "+this._label+" "+this._depthDelta),r.toString()},t.prototype.isPointwiseEqual=function(n){var r=this;if(this.pts.length!==n.pts.length)return!1;for(var s=0;sr||this._maxyl;if(p)return!1;var c=this.intersectsToleranceSquare(e,t);return Ye.isTrue(!(p&&c),"Found bad envelope test"),c};Ji.prototype.initCorners=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 St(this._maxx,this._maxy),this._corner[1]=new St(this._minx,this._maxy),this._corner[2]=new St(this._minx,this._miny),this._corner[3]=new St(this._maxx,this._miny)};Ji.prototype.intersects=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))};Ji.prototype.scale=function(e){return Math.round(e*this._scaleFactor)};Ji.prototype.getCoordinate=function(){return this._originalPt};Ji.prototype.copyScaled=function(e,t){t.x=this.scale(e.x),t.y=this.scale(e.y)};Ji.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var e=Ji.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};Ji.prototype.intersectsPixelClosure=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()))};Ji.prototype.intersectsToleranceSquare=function(e,t){var n=!1,r=!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()&&(r=!0),this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),this._li.isProper())||n&&r||e.equals(this._pt)||t.equals(this._pt))};Ji.prototype.addSnappedNode=function(e,t){var n=e.getCoordinate(t),r=e.getCoordinate(t+1);return this.intersects(n,r)?(e.addIntersection(this.getCoordinate(),t),!0):!1};Ji.prototype.interfaces_=function(){return[]};Ji.prototype.getClass=function(){return Ji};wE.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75};Object.defineProperties(Ji,wE);var xd=function(){this.tempEnv1=new Se,this.selectedSegment=new Ie};xd.prototype.select=function(){if(arguments.length!==1&&arguments.length===2){var e=arguments[0],t=arguments[1];e.getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}};xd.prototype.interfaces_=function(){return[]};xd.prototype.getClass=function(){return xd};var fp=function(){this._index=null;var e=arguments[0];this._index=e},SE={HotPixelSnapAction:{configurable:!0}};fp.prototype.snap=function(){if(arguments.length===1){var e=arguments[0];return this.snap(e,null,-1)}else if(arguments.length===3){var t=arguments[0],n=arguments[1],r=arguments[2],s=t.getSafeEnvelope(),l=new EE(t,n,r);return this._index.query(s,{interfaces_:function(){return[jl]},visitItem:function(p){var c=p;c.select(s,l)}}),l.isNodeAdded()}};fp.prototype.interfaces_=function(){return[]};fp.prototype.getClass=function(){return fp};SE.HotPixelSnapAction.get=function(){return EE};Object.defineProperties(fp,SE);var EE=function(e){function t(){e.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var n=arguments[0],r=arguments[1],s=arguments[2];this._hotPixel=n,this._parentEdge=r,this._hotPixelVertexIndex=s}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1],s=n.getContext();if(this._parentEdge!==null&&s===this._parentEdge&&r===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(s,r)}else return e.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(xd),wc=function(){this._li=null,this._interiorIntersections=null;var e=arguments[0];this._li=e,this._interiorIntersections=new ie};wc.prototype.processIntersections=function(e,t,n,r){var s=this;if(e===n&&t===r)return null;var l=e.getCoordinates()[t],p=e.getCoordinates()[t+1],c=n.getCoordinates()[r],y=n.getCoordinates()[r+1];if(this._li.computeIntersection(l,p,c,y),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var w=0;w=0;t--){try{e.bufferReducedPrecision(t)}catch(l){if(l instanceof il)e._saveException=l;else throw l}finally{}if(e._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var n=arguments[0],r=ci.precisionScaleFactor(this._argGeom,this._distance,n),s=new wn(r);this.bufferFixedPrecision(s)}};ci.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var e=this._argGeom.getFactory().getPrecisionModel();e.getType()===wn.FIXED?this.bufferFixedPrecision(e):this.bufferReducedPrecision()};ci.prototype.setQuadrantSegments=function(e){this._bufParams.setQuadrantSegments(e)};ci.prototype.bufferOriginalPrecision=function(){try{var e=new ki(this._bufParams);this._resultGeometry=e.buffer(this._argGeom,this._distance)}catch(t){if(t instanceof nl)this._saveException=t;else throw t}finally{}};ci.prototype.getResultGeometry=function(e){return this._distance=e,this.computeGeometry(),this._resultGeometry};ci.prototype.setEndCapStyle=function(e){this._bufParams.setEndCapStyle(e)};ci.prototype.interfaces_=function(){return[]};ci.prototype.getClass=function(){return ci};ci.bufferOp=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=new ci(e),r=n.getResultGeometry(t);return r}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ke&&typeof arguments[1]=="number"){var s=arguments[0],l=arguments[1],p=arguments[2],c=new ci(s);c.setQuadrantSegments(p);var y=c.getResultGeometry(l);return y}else if(arguments[2]instanceof xn&&arguments[0]instanceof ke&&typeof arguments[1]=="number"){var w=arguments[0],T=arguments[1],L=arguments[2],A=new ci(w,L),z=A.getResultGeometry(T);return z}}else if(arguments.length===4){var B=arguments[0],Y=arguments[1],et=arguments[2],at=arguments[3],W=new ci(B);W.setQuadrantSegments(et),W.setEndCapStyle(at);var H=W.getResultGeometry(Y);return H}};ci.precisionScaleFactor=function(e,t,n){var r=e.getEnvelopeInternal(),s=ko.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY())),l=t>0?t:0,p=s+2*l,c=Math.trunc(Math.log(p)/Math.log(10)+1),y=n-c,w=Math.pow(10,y);return w};kp.CAP_ROUND.get=function(){return xn.CAP_ROUND};kp.CAP_BUTT.get=function(){return xn.CAP_FLAT};kp.CAP_FLAT.get=function(){return xn.CAP_FLAT};kp.CAP_SQUARE.get=function(){return xn.CAP_SQUARE};kp.MAX_PRECISION_DIGITS.get=function(){return 12};Object.defineProperties(ci,kp);var Pi=function(){this._pt=[new St,new St],this._distance=Ue.NaN,this._isNull=!0};Pi.prototype.getCoordinates=function(){return this._pt};Pi.prototype.getCoordinate=function(e){return this._pt[e]};Pi.prototype.setMinimum=function(){if(arguments.length===1){var e=arguments[0];this.setMinimum(e._pt[0],e._pt[1])}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(t,n),null;var r=t.distance(n);rthis._distance&&this.initialize(t,n,r)}};Pi.prototype.interfaces_=function(){return[]};Pi.prototype.getClass=function(){return Pi};var _a=function(){};_a.prototype.interfaces_=function(){return[]};_a.prototype.getClass=function(){return _a};_a.computeDistance=function(){if(arguments[2]instanceof Pi&&arguments[0]instanceof cr&&arguments[1]instanceof St)for(var e=arguments[0],t=arguments[1],n=arguments[2],r=e.getCoordinates(),s=new Ie,l=0;l0||this._isIn?Ct.INTERIOR:Ct.EXTERIOR)};ws.prototype.interfaces_=function(){return[]};ws.prototype.getClass=function(){return ws};var Mi=function e(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],n=arguments[1];e.call(this,t,e.INSIDE_AREA,n)}else if(arguments.length===3){var r=arguments[0],s=arguments[1],l=arguments[2];this._component=r,this._segIndex=s,this._pt=l}},IE={INSIDE_AREA:{configurable:!0}};Mi.prototype.isInsideArea=function(){return this._segIndex===Mi.INSIDE_AREA};Mi.prototype.getCoordinate=function(){return this._pt};Mi.prototype.getGeometryComponent=function(){return this._component};Mi.prototype.getSegmentIndex=function(){return this._segIndex};Mi.prototype.interfaces_=function(){return[]};Mi.prototype.getClass=function(){return Mi};IE.INSIDE_AREA.get=function(){return-1};Object.defineProperties(Mi,IE);var Fl=function(e){this._pts=e||null};Fl.prototype.filter=function(e){e instanceof fo&&this._pts.add(e)};Fl.prototype.interfaces_=function(){return[Js]};Fl.prototype.getClass=function(){return Fl};Fl.getPoints=function(){if(arguments.length===1){var e=arguments[0];return e instanceof fo?bs.singletonList(e):Fl.getPoints(e,new ie)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];return t instanceof fo?n.add(t):t instanceof Ri&&t.apply(new Fl(n)),n}};var Ec=function(){this._locations=null;var e=arguments[0];this._locations=e};Ec.prototype.filter=function(e){(e instanceof fo||e instanceof cr||e instanceof Nr)&&this._locations.add(new Mi(e,0,e.getCoordinate()))};Ec.prototype.interfaces_=function(){return[Js]};Ec.prototype.getClass=function(){return Ec};Ec.getLocations=function(e){var t=new ie;return e.apply(new Ec(t)),t};var fi=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new ws,this._minDistanceLocation=null,this._minDistance=Ue.MAX_VALUE,arguments.length===2){var e=arguments[0],t=arguments[1];this._geom=[e,t],this._terminateDistance=0}else if(arguments.length===3){var n=arguments[0],r=arguments[1],s=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=s}};fi.prototype.computeContainmentDistance=function(){var e=this;if(arguments.length===0){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(arguments.length===2){var n=arguments[0],r=arguments[1],s=1-n,l=tl.getPolygons(this._geom[n]);if(l.size()>0){var p=Ec.getLocations(this._geom[s]);if(this.computeContainmentDistance(p,l,r),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[s]=r[0],this._minDistanceLocation[n]=r[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&De(arguments[0],ms)&&De(arguments[1],ms)){for(var c=arguments[0],y=arguments[1],w=arguments[2],T=0;Tthis._minDistance)return null;for(var s=t.getCoordinates(),l=n.getCoordinate(),p=0;pthis._minDistance)return null;for(var z=T.getCoordinates(),B=L.getCoordinates(),Y=0;Ythis._distance&&this.initialize(t,n,r)}};vi.prototype.interfaces_=function(){return[]};vi.prototype.getClass=function(){return vi};var Vs=function(){};Vs.prototype.interfaces_=function(){return[]};Vs.prototype.getClass=function(){return Vs};Vs.computeDistance=function(){if(arguments[2]instanceof vi&&arguments[0]instanceof cr&&arguments[1]instanceof St)for(var e=arguments[0],t=arguments[1],n=arguments[2],r=new Ie,s=e.getCoordinates(),l=0;l1||e<=0)throw new Qn("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=e};Yo.prototype.compute=function(e,t){this.computeOrientedDistance(e,t,this._ptDist),this.computeOrientedDistance(t,e,this._ptDist)};Yo.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()};Yo.prototype.computeOrientedDistance=function(e,t,n){var r=new Ic(t);if(e.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var s=new Xl(t,this._densifyFrac);e.apply(s),n.setMaximum(s.getMaxPointDistance())}};Yo.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()};Yo.prototype.interfaces_=function(){return[]};Yo.prototype.getClass=function(){return Yo};Yo.distance=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=new Yo(e,t);return n.distance()}else if(arguments.length===3){var r=arguments[0],s=arguments[1],l=arguments[2],p=new Yo(r,s);return p.setDensifyFraction(l),p.distance()}};O0.MaxPointDistanceFilter.get=function(){return Ic};O0.MaxDensifiedByFractionDistanceFilter.get=function(){return Xl};Object.defineProperties(Yo,O0);var Ic=function(){this._maxPtDist=new vi,this._minPtDist=new vi,this._euclideanDist=new Vs,this._geom=null;var e=arguments[0];this._geom=e};Ic.prototype.filter=function(e){this._minPtDist.initialize(),Vs.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)};Ic.prototype.getMaxPointDistance=function(){return this._maxPtDist};Ic.prototype.interfaces_=function(){return[Sa]};Ic.prototype.getClass=function(){return Ic};var Xl=function(){this._maxPtDist=new vi,this._minPtDist=new vi,this._geom=null,this._numSubSegs=0;var e=arguments[0],t=arguments[1];this._geom=e,this._numSubSegs=Math.trunc(Math.round(1/t))};Xl.prototype.filter=function(e,t){var n=this;if(t===0)return null;for(var r=e.getCoordinate(t-1),s=e.getCoordinate(t),l=(s.x-r.x)/this._numSubSegs,p=(s.y-r.y)/this._numSubSegs,c=0;cn){this._isValid=!1;var s=r.getCoordinates();this._errorLocation=s[1],this._errorIndicator=e.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+ys.toLineString(s[0],s[1])+")"}};co.prototype.isValid=function(){var e=Math.abs(this._bufDistance),t=co.MAX_DISTANCE_DIFF_FRAC*e;return this._minValidDistance=e-t,this._maxValidDistance=e+t,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),co.VERBOSE&&pi.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)};co.prototype.checkNegativeValid=function(){if(!(this._input instanceof Nr||this._input instanceof xa||this._input instanceof Ri))return null;var e=this.getPolygonLines(this._input);if(this.checkMinimumDistance(e,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(e,this._result,this._maxValidDistance)};co.prototype.getErrorIndicator=function(){return this._errorIndicator};co.prototype.checkMinimumDistance=function(e,t,n){var r=new fi(e,t,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound0&&e>t&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&e=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")};di.prototype.report=function(e){if(!di.VERBOSE)return null;pi.out.println("Check "+e+": "+(this._isValid?"passed":"FAILED"))};di.prototype.getErrorMessage=function(){return this._errorMsg};di.prototype.interfaces_=function(){return[]};di.prototype.getClass=function(){return di};di.isValidMsg=function(e,t,n){var r=new di(e,t,n);return r.isValid()?null:r.getErrorMessage()};di.isValid=function(e,t,n){var r=new di(e,t,n);return!!r.isValid()};F0.VERBOSE.get=function(){return!1};F0.MAX_ENV_DIFF_FRAC.get=function(){return .012};Object.defineProperties(di,F0);var ra=function(){this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};ra.prototype.getCoordinates=function(){return this._pts};ra.prototype.size=function(){return this._pts.length};ra.prototype.getCoordinate=function(e){return this._pts[e]};ra.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};ra.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:bc.octant(this.getCoordinate(e),this.getCoordinate(e+1))};ra.prototype.setData=function(e){this._data=e};ra.prototype.getData=function(){return this._data};ra.prototype.toString=function(){return ys.toLineString(new yr(this._pts))};ra.prototype.interfaces_=function(){return[Ca]};ra.prototype.getClass=function(){return ra};var ii=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new ie,this._intersectionCount=0,this._keepIntersections=!0;var e=arguments[0];this._li=e,this._interiorIntersection=null};ii.prototype.getInteriorIntersection=function(){return this._interiorIntersection};ii.prototype.setCheckEndSegmentsOnly=function(e){this._isCheckEndSegmentsOnly=e};ii.prototype.getIntersectionSegments=function(){return this._intSegments};ii.prototype.count=function(){return this._intersectionCount};ii.prototype.getIntersections=function(){return this._intersections};ii.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e};ii.prototype.setKeepIntersections=function(e){this._keepIntersections=e};ii.prototype.processIntersections=function(e,t,n,r){if(!this._findAllIntersections&&this.hasIntersection()||e===n&&t===r)return null;if(this._isCheckEndSegmentsOnly){var s=this.isEndSegment(e,t)||this.isEndSegment(n,r);if(!s)return null}var l=e.getCoordinates()[t],p=e.getCoordinates()[t+1],c=n.getCoordinates()[r],y=n.getCoordinates()[r+1];this._li.computeIntersection(l,p,c,y),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=l,this._intSegments[1]=p,this._intSegments[2]=c,this._intSegments[3]=y,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)};ii.prototype.isEndSegment=function(e,t){return t===0||t>=e.size()-2};ii.prototype.hasIntersection=function(){return this._interiorIntersection!==null};ii.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null};ii.prototype.interfaces_=function(){return[Pu]};ii.prototype.getClass=function(){return ii};ii.createAllIntersectionsFinder=function(e){var t=new ii(e);return t.setFindAllIntersections(!0),t};ii.createAnyIntersectionFinder=function(e){return new ii(e)};ii.createIntersectionCounter=function(e){var t=new ii(e);return t.setFindAllIntersections(!0),t.setKeepIntersections(!1),t};var Ss=function(){this._li=new zu,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var e=arguments[0];this._segStrings=e};Ss.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()};Ss.prototype.getIntersections=function(){return this._segInt.getIntersections()};Ss.prototype.isValid=function(){return this.execute(),this._isValid};Ss.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e};Ss.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new ii(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var e=new R0;if(e.setSegmentIntersector(this._segInt),e.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null};Ss.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new il(this.getErrorMessage(),this._segInt.getInteriorIntersection())};Ss.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var e=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+ys.toLineString(e[0],e[1])+" and "+ys.toLineString(e[2],e[3])};Ss.prototype.interfaces_=function(){return[]};Ss.prototype.getClass=function(){return Ss};Ss.computeIntersections=function(e){var t=new Ss(e);return t.setFindAllIntersections(!0),t.isValid(),t.getIntersections()};var ku=function e(){this._nv=null;var t=arguments[0];this._nv=new Ss(e.toSegmentStrings(t))};ku.prototype.checkValid=function(){this._nv.checkValid()};ku.prototype.interfaces_=function(){return[]};ku.prototype.getClass=function(){return ku};ku.toSegmentStrings=function(e){for(var t=new ie,n=e.iterator();n.hasNext();){var r=n.next();t.add(new ra(r.getCoordinates(),r))}return t};ku.checkValid=function(e){var t=new ku(e);t.checkValid()};var Cc=function(e){this._mapOp=e};Cc.prototype.map=function(e){for(var t=this,n=new ie,r=0;r0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)};Qi.prototype.interfaces_=function(){return[]};Qi.prototype.getClass=function(){return Qi};var Pa=function e(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new Ie,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof cr&&typeof arguments[1]=="number"){var t=arguments[0],n=arguments[1];e.call(this,t.getCoordinates(),n)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var r=arguments[0],s=arguments[1];this._srcPts=r,this._isClosed=e.isClosed(r),this._snapTolerance=s}};Pa.prototype.snapVertices=function(e,t){for(var n=this,r=this._isClosed?e.size()-1:e.size(),s=0;s=0&&e.add(p+1,new St(l),!1)}};Pa.prototype.findSegmentIndexToSnap=function(e,t){for(var n=this,r=Ue.MAX_VALUE,s=-1,l=0;lt&&(t=r)}return t}else if(arguments.length===2){var s=arguments[0],l=arguments[1];return Math.min(_r.computeOverlaySnapTolerance(s),_r.computeOverlaySnapTolerance(l))}};_r.computeSizeBasedSnapTolerance=function(e){var t=e.getEnvelopeInternal(),n=Math.min(t.getHeight(),t.getWidth()),r=n*_r.SNAP_PRECISION_FACTOR;return r};_r.snapToSelf=function(e,t,n){var r=new _r(e);return r.snapToSelf(t,n)};CE.SNAP_PRECISION_FACTOR.get=function(){return 1e-9};Object.defineProperties(_r,CE);var TE=function(e){function t(n,r,s){e.call(this),this._snapTolerance=n||null,this._snapPts=r||null,this._isSelfSnap=s!==void 0?s:!1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(n,r){var s=new Pa(n,this._snapTolerance);return s.setAllowSnappingToSourceVertices(this._isSelfSnap),s.snapTo(r)},t.prototype.transformCoordinates=function(n,r){var s=n.toCoordinateArray(),l=this.snapLine(s,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(l)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Qi),Li=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Li.prototype.getCommon=function(){return Ue.longBitsToDouble(this._commonBits)};Li.prototype.add=function(e){var t=Ue.doubleToLongBits(e);if(this._isFirst)return this._commonBits=t,this._commonSignExp=Li.signExpBits(this._commonBits),this._isFirst=!1,null;var n=Li.signExpBits(t);if(n!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Li.numCommonMostSigMantissaBits(this._commonBits,t),this._commonBits=Li.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))};Li.prototype.toString=function(){if(arguments.length===1){var e=arguments[0],t=Ue.longBitsToDouble(e),n=Ue.toBinaryString(e),r="0000000000000000000000000000000000000000000000000000000000000000"+n,s=r.substring(r.length-64),l=s.substring(0,1)+" "+s.substring(1,12)+"(exp) "+s.substring(12)+" [ "+t+" ]";return l}};Li.prototype.interfaces_=function(){return[]};Li.prototype.getClass=function(){return Li};Li.getBit=function(e,t){var n=1<>52};Li.zeroLowerBits=function(e,t){var n=(1<=0;r--){if(Li.getBit(e,r)!==Li.getBit(t,r))return n;n++}return 52};var Yl=function(){this._commonCoord=null,this._ccFilter=new Lc},B0={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Yl.prototype.addCommonBits=function(e){var t=new Kl(this._commonCoord);e.apply(t),e.geometryChanged()};Yl.prototype.removeCommonBits=function(e){if(this._commonCoord.x===0&&this._commonCoord.y===0)return e;var t=new St(this._commonCoord);t.x=-t.x,t.y=-t.y;var n=new Kl(t);return e.apply(n),e.geometryChanged(),e};Yl.prototype.getCommonCoordinate=function(){return this._commonCoord};Yl.prototype.add=function(e){e.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()};Yl.prototype.interfaces_=function(){return[]};Yl.prototype.getClass=function(){return Yl};B0.CommonCoordinateFilter.get=function(){return Lc};B0.Translater.get=function(){return Kl};Object.defineProperties(Yl,B0);var Lc=function(){this._commonBitsX=new Li,this._commonBitsY=new Li};Lc.prototype.filter=function(e){this._commonBitsX.add(e.x),this._commonBitsY.add(e.y)};Lc.prototype.getCommonCoordinate=function(){return new St(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())};Lc.prototype.interfaces_=function(){return[Sa]};Lc.prototype.getClass=function(){return Lc};var Kl=function(){this.trans=null;var e=arguments[0];this.trans=e};Kl.prototype.filter=function(e,t){var n=e.getOrdinate(t,0)+this.trans.x,r=e.getOrdinate(t,1)+this.trans.y;e.setOrdinate(t,0,n),e.setOrdinate(t,1,r)};Kl.prototype.isDone=function(){return!1};Kl.prototype.isGeometryChanged=function(){return!0};Kl.prototype.interfaces_=function(){return[_s]};Kl.prototype.getClass=function(){return Kl};var oi=function(e,t){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=e,this._geom[1]=t,this.computeSnapTolerance()};oi.prototype.selfSnap=function(e){var t=new _r(e),n=t.snapTo(e,this._snapTolerance);return n};oi.prototype.removeCommonBits=function(e){this._cbr=new Yl,this._cbr.add(e[0]),this._cbr.add(e[1]);var t=new Array(2).fill(null);return t[0]=this._cbr.removeCommonBits(e[0].copy()),t[1]=this._cbr.removeCommonBits(e[1].copy()),t};oi.prototype.prepareResult=function(e){return this._cbr.addCommonBits(e),e};oi.prototype.getResultGeometry=function(e){var t=this.snap(this._geom),n=We.overlayOp(t[0],t[1],e);return this.prepareResult(n)};oi.prototype.checkValid=function(e){e.isValid()||pi.out.println("Snapped geometry is invalid")};oi.prototype.computeSnapTolerance=function(){this._snapTolerance=_r.computeOverlaySnapTolerance(this._geom[0],this._geom[1])};oi.prototype.snap=function(e){var t=this.removeCommonBits(e),n=_r.snap(t[0],t[1],this._snapTolerance);return n};oi.prototype.interfaces_=function(){return[]};oi.prototype.getClass=function(){return oi};oi.overlayOp=function(e,t,n){var r=new oi(e,t);return r.getResultGeometry(n)};oi.union=function(e,t){return oi.overlayOp(e,t,We.UNION)};oi.intersection=function(e,t){return oi.overlayOp(e,t,We.INTERSECTION)};oi.symDifference=function(e,t){return oi.overlayOp(e,t,We.SYMDIFFERENCE)};oi.difference=function(e,t){return oi.overlayOp(e,t,We.DIFFERENCE)};var zi=function(e,t){this._geom=new Array(2).fill(null),this._geom[0]=e,this._geom[1]=t};zi.prototype.getResultGeometry=function(e){var t=null,n=!1,r=null;try{t=We.overlayOp(this._geom[0],this._geom[1],e);var s=!0;s&&(n=!0)}catch(l){if(l instanceof nl)r=l;else throw l}finally{}if(!n)try{t=oi.overlayOp(this._geom[0],this._geom[1],e)}catch(l){throw l instanceof nl?r:l}finally{}return t};zi.prototype.interfaces_=function(){return[]};zi.prototype.getClass=function(){return zi};zi.overlayOp=function(e,t,n){var r=new zi(e,t);return r.getResultGeometry(n)};zi.union=function(e,t){return zi.overlayOp(e,t,We.UNION)};zi.intersection=function(e,t){return zi.overlayOp(e,t,We.INTERSECTION)};zi.symDifference=function(e,t){return zi.overlayOp(e,t,We.SYMDIFFERENCE)};zi.difference=function(e,t){return zi.overlayOp(e,t,We.DIFFERENCE)};var wd=function(){this.mce=null,this.chainIndex=null;var e=arguments[0],t=arguments[1];this.mce=e,this.chainIndex=t};wd.prototype.computeIntersections=function(e,t){this.mce.computeIntersectsForChain(this.chainIndex,e.mce,e.chainIndex,t)};wd.prototype.interfaces_=function(){return[]};wd.prototype.getClass=function(){return wd};var yo=function e(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],n=arguments[1];this._eventType=e.DELETE,this._xValue=t,this._insertEvent=n}else if(arguments.length===3){var r=arguments[0],s=arguments[1],l=arguments[2];this._eventType=e.INSERT,this._label=r,this._xValue=s,this._obj=l}},V0={INSERT:{configurable:!0},DELETE:{configurable:!0}};yo.prototype.isDelete=function(){return this._eventType===yo.DELETE};yo.prototype.setDeleteEventIndex=function(e){this._deleteEventIndex=e};yo.prototype.getObject=function(){return this._obj};yo.prototype.compareTo=function(e){var t=e;return this._xValuet._xValue?1:this._eventTypet._eventType?1:0};yo.prototype.getInsertEvent=function(){return this._insertEvent};yo.prototype.isInsert=function(){return this._eventType===yo.INSERT};yo.prototype.isSameLabel=function(e){return this._label===null?!1:this._label===e._label};yo.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex};yo.prototype.interfaces_=function(){return[es]};yo.prototype.getClass=function(){return yo};V0.INSERT.get=function(){return 1};V0.DELETE.get=function(){return 2};Object.defineProperties(yo,V0);var Hm=function(){};Hm.prototype.interfaces_=function(){return[]};Hm.prototype.getClass=function(){return Hm};var gi=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var e=arguments[0],t=arguments[1],n=arguments[2];this._li=e,this._includeProper=t,this._recordIsolated=n};gi.prototype.isTrivialIntersection=function(e,t,n,r){if(e===n&&this._li.getIntersectionNum()===1){if(gi.isAdjacentSegments(t,r))return!0;if(e.isClosed()){var s=e.getNumPoints()-1;if(t===0&&r===s||r===0&&t===s)return!0}}return!1};gi.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint};gi.prototype.setIsDoneIfProperInt=function(e){this._isDoneWhenProperInt=e};gi.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior};gi.prototype.isBoundaryPointInternal=function(e,t){for(var n=t.iterator();n.hasNext();){var r=n.next(),s=r.getCoordinate();if(e.isIntersection(s))return!0}return!1};gi.prototype.hasProperIntersection=function(){return this._hasProper};gi.prototype.hasIntersection=function(){return this._hasIntersection};gi.prototype.isDone=function(){return this._isDone};gi.prototype.isBoundaryPoint=function(e,t){return t===null?!1:!!(this.isBoundaryPointInternal(e,t[0])||this.isBoundaryPointInternal(e,t[1]))};gi.prototype.setBoundaryNodes=function(e,t){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=e,this._bdyNodes[1]=t};gi.prototype.addIntersections=function(e,t,n,r){if(e===n&&t===r)return null;this.numTests++;var s=e.getCoordinates()[t],l=e.getCoordinates()[t+1],p=n.getCoordinates()[r],c=n.getCoordinates()[r+1];this._li.computeIntersection(s,l,p,c),this._li.hasIntersection()&&(this._recordIsolated&&(e.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(e,t,n,r)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(e.addIntersections(this._li,t,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))};gi.prototype.interfaces_=function(){return[]};gi.prototype.getClass=function(){return gi};gi.isAdjacentSegments=function(e,t){return Math.abs(e-t)===1};var a3=function(e){function t(){e.call(this),this.events=new ie,this.nOverlaps=null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var n=this;bs.sort(this.events);for(var r=0;rt||this._maxl?1:0};Sd.prototype.interfaces_=function(){return[ep]};Sd.prototype.getClass=function(){return Sd};var l3=function(e){function t(){e.call(this),this._item=null;var n=arguments[0],r=arguments[1],s=arguments[2];this._min=n,this._max=r,this._item=s}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.query=function(n,r,s){if(!this.intersects(n,r))return null;s.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ma),u3=function(e){function t(){e.call(this),this._node1=null,this._node2=null;var n=arguments[0],r=arguments[1];this._node1=n,this._node2=r,this.buildExtent(this._node1,this._node2)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(n,r){this._min=Math.min(n._min,r._min),this._max=Math.max(n._max,r._max)},t.prototype.query=function(n,r,s){if(!this.intersects(n,r))return null;this._node1!==null&&this._node1.query(n,r,s),this._node2!==null&&this._node2.query(n,r,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ma),Aa=function(){this._leaves=new ie,this._root=null,this._level=0};Aa.prototype.buildTree=function(){var e=this;bs.sort(this._leaves,new Ma.NodeComparator);for(var t=this._leaves,n=null,r=new ie;;){if(e.buildLevel(t,r),r.size()===1)return r.get(0);n=t,t=r,r=n}};Aa.prototype.insert=function(e,t,n){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new l3(e,t,n))};Aa.prototype.query=function(e,t,n){this.init(),this._root.query(e,t,n)};Aa.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()};Aa.prototype.printNode=function(e){pi.out.println(ys.toLineString(new St(e._min,this._level),new St(e._max,this._level)))};Aa.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()};Aa.prototype.buildLevel=function(e,t){this._level++,t.clear();for(var n=0;n=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,r[0]),this.insertBoundaryPoint(this._argIndex,r[r.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var n=this.getBoundaryNodes(),r=new Array(n.size()).fill(null),s=0,l=n.iterator();l.hasNext();){var p=l.next();r[s++]=p.getCoordinate().copy()}return r},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(n,r,s){if(this.isBoundaryNode(n,r))return null;s===Ct.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(n,r):this.insertPoint(n,r,s)},t.prototype.addPolygonRing=function(n,r,s){if(n.isEmpty())return null;var l=un.removeRepeatedPoints(n.getCoordinates());if(l.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=l[0],null;var p=r,c=s;pe.isCCW(l)&&(p=s,c=r);var y=new Zm(l,new Tn(this._argIndex,Ct.BOUNDARY,p,c));this._lineEdgeMap.put(n,y),this.insertEdge(y),this.insertPoint(this._argIndex,l[0],Ct.BOUNDARY)},t.prototype.insertPoint=function(n,r,s){var l=this._nodes.addNode(r),p=l.getLabel();p===null?l._label=new Tn(n,s):p.setLocation(n,s)},t.prototype.createEdgeSetIntersector=function(){return new a3},t.prototype.addSelfIntersectionNodes=function(n){for(var r=this,s=this._edges.iterator();s.hasNext();)for(var l=s.next(),p=l.getLabel().getLocation(n),c=l.eiList.iterator();c.hasNext();){var y=c.next();r.addSelfIntersectionNode(n,y.coord,p)}},t.prototype.add=function(){if(arguments.length===1){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof xa&&(this._useBoundaryDeterminationRule=!1),n instanceof Nr)this.addPolygon(n);else if(n instanceof cr)this.addLineString(n);else if(n instanceof fo)this.addPoint(n);else if(n instanceof lp)this.addCollection(n);else if(n instanceof Cu)this.addCollection(n);else if(n instanceof xa)this.addCollection(n);else if(n instanceof Ri)this.addCollection(n);else throw new Error(n.getClass().getName())}else return e.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(n){for(var r=this,s=0;s50?(this._areaPtLocator===null&&(this._areaPtLocator=new gp(this._parentGeom)),this._areaPtLocator.locate(n)):this._ptLocator.locate(n,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var n=arguments[0];return this._lineEdgeMap.get(n)}else return e.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(n,r){return n.isInBoundary(r)?Ct.BOUNDARY:Ct.INTERIOR},t}(ir),yp=function(){if(this._li=new zu,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var e=arguments[0];this.setComputationPrecision(e.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Vf(0,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1],r=Qo.OGC_SFS_BOUNDARY_RULE;t.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(t.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Vf(0,t,r),this._arg[1]=new Vf(1,n,r)}else if(arguments.length===3){var s=arguments[0],l=arguments[1],p=arguments[2];s.getPrecisionModel().compareTo(l.getPrecisionModel())>=0?this.setComputationPrecision(s.getPrecisionModel()):this.setComputationPrecision(l.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Vf(0,s,p),this._arg[1]=new Vf(1,l,p)}};yp.prototype.getArgGeometry=function(e){return this._arg[e].getGeometry()};yp.prototype.setComputationPrecision=function(e){this._resultPrecisionModel=e,this._li.setPrecisionModel(this._resultPrecisionModel)};yp.prototype.interfaces_=function(){return[]};yp.prototype.getClass=function(){return yp};var Eu=function(){};Eu.prototype.interfaces_=function(){return[]};Eu.prototype.getClass=function(){return Eu};Eu.map=function(){if(arguments[0]instanceof ke&&De(arguments[1],Eu.MapOp)){for(var e=arguments[0],t=arguments[1],n=new ie,r=0;r=e.size()?null:e.get(t)};Er.union=function(e){var t=new Er(e);return t.union()};ME.STRTREE_NODE_CAPACITY.get=function(){return 4};Object.defineProperties(Er,ME);var Xm=function(){};Xm.prototype.interfaces_=function(){return[]};Xm.prototype.getClass=function(){return Xm};Xm.union=function(e,t){if(e.isEmpty()||t.isEmpty()){if(e.isEmpty()&&t.isEmpty())return We.createEmptyResult(We.UNION,e,t,e.getFactory());if(e.isEmpty())return t.copy();if(t.isEmpty())return e.copy()}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),zi.overlayOp(e,t,We.UNION)};function Fu(){return new Ym}function Ym(){this.reset()}Ym.prototype={constructor:Ym,reset:function(){this.s=this.t=0},add:function(e){Iw(im,e,this.t),Iw(this,im.s,this.s),this.s?this.t+=im.t:this.s=im.t},valueOf:function(){return this.s}};var im=new Ym;function Iw(e,t,n){var r=e.s=t+n,s=r-t,l=r-s;e.t=t-l+(n-s)}var ur=1e-6,On=Math.PI,$a=On/2,Cw=On/4,al=On*2,_u=180/On,Fs=On/180,Ai=Math.abs,c3=Math.atan,vp=Math.atan2,kr=Math.cos,Dr=Math.sin,Dp=Math.sqrt;function AE(e){return e>1?0:e<-1?On:Math.acos(e)}function Pc(e){return e>1?$a:e<-1?-$a:Math.asin(e)}function Yf(){}function Km(e,t){e&&Lw.hasOwnProperty(e.type)&&Lw[e.type](e,t)}var Tw={Feature:function(e,t){Km(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,s=n.length;++rOn?e-al:e<-On?e+al:e,t]}Hv.invert=Hv;function p3(e,t,n){return(e%=al)?t||n?kE(Aw(e),kw(t,n)):Aw(e):t||n?kw(t,n):Hv}function Mw(e){return function(t,n){return t+=e,[t>On?t-al:t<-On?t+al:t,n]}}function Aw(e){var t=Mw(e);return t.invert=Mw(-e),t}function kw(e,t){var n=kr(e),r=Dr(e),s=kr(t),l=Dr(t);function p(c,y){var w=kr(y),T=kr(c)*w,L=Dr(c)*w,A=Dr(y),z=A*n+T*r;return[vp(L*s-z*l,T*n-A*r),Pc(z*s+L*l)]}return p.invert=function(c,y){var w=kr(y),T=kr(c)*w,L=Dr(c)*w,A=Dr(y),z=A*s-L*l;return[vp(L*s+A*l,T*n+z*r),Pc(z*n-T*r)]},p}function f3(e,t,n,r,s,l){if(n){var p=kr(t),c=Dr(t),y=r*n;s==null?(s=t+r*al,l=t-y/2):(s=Dw(p,s),l=Dw(p,l),(r>0?sl)&&(s+=r*al));for(var w,T=s;r>0?T>l:T1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function d3(e,t,n,r,s,l){var p=e[0],c=e[1],y=t[0],w=t[1],T=0,L=1,A=y-p,z=w-c,B;if(B=n-p,!(!A&&B>0)){if(B/=A,A<0){if(B0){if(B>L)return;B>T&&(T=B)}if(B=s-p,!(!A&&B<0)){if(B/=A,A<0){if(B>L)return;B>T&&(T=B)}else if(A>0){if(B0)){if(B/=z,z<0){if(B0){if(B>L)return;B>T&&(T=B)}if(B=l-c,!(!z&&B<0)){if(B/=z,z<0){if(B>L)return;B>T&&(T=B)}else if(z>0){if(B0&&(e[0]=p+T*A,e[1]=c+T*z),L<1&&(t[0]=p+L*A,t[1]=c+L*z),!0}}}}}function bm(e,t){return Ai(e[0]-t[0])=0;--c)s.point((L=T[c])[0],L[1]);else r(A.x,A.p.x,-1,s);A=A.p}A=A.o,T=A.z,z=!z}while(!A.v);s.lineEnd()}}}function Rw(e){if(t=e.length){for(var t,n=0,r=e[0],s;++nt?1:e>=t?0:NaN}function g3(e){return e.length===1&&(e=m3(e)),{left:function(t,n,r,s){for(r==null&&(r=0),s==null&&(s=t.length);r>>1;e(t[l],n)<0?r=l+1:s=l}return r},right:function(t,n,r,s){for(r==null&&(r=0),s==null&&(s=t.length);r>>1;e(t[l],n)>0?s=l:r=l+1}return r}}}function m3(e){return function(t,n){return NE(e(t),n)}}g3(NE);function OE(e){for(var t=e.length,n,r=-1,s=0,l,p;++r=0;)for(p=e[t],n=p.length;--n>=0;)l[--s]=p[n];return l}var Kf=1e9,lm=-Kf;function y3(e,t,n,r){function s(w,T){return e<=w&&w<=n&&t<=T&&T<=r}function l(w,T,L,A){var z=0,B=0;if(w==null||(z=p(w,L))!==(B=p(T,L))||y(w,T)<0^L>0)do A.point(z===0||z===3?e:n,z>1?r:t);while((z=(z+L+4)%4)!==B);else A.point(T[0],T[1])}function p(w,T){return Ai(w[0]-e)0?0:3:Ai(w[0]-n)0?2:1:Ai(w[1]-t)0?1:0:T>0?3:2}function c(w,T){return y(w.x,T.x)}function y(w,T){var L=p(w,1),A=p(T,1);return L!==A?L-A:L===0?T[1]-w[1]:L===1?w[0]-T[0]:L===2?w[1]-T[1]:T[0]-w[0]}return function(w){var T=w,L=DE(),A,z,B,Y,et,at,W,H,nt,ut,_t,ct={point:bt,lineStart:Pt,lineEnd:Qt,polygonStart:Ot,polygonEnd:dt};function bt(oe,ge){s(oe,ge)&&T.point(oe,ge)}function It(){for(var oe=0,ge=0,Te=z.length;ger&&(pr-Pe)*(r-Mn)>(zn-Mn)*(e-Pe)&&++oe:zn<=r&&(pr-Pe)*(r-Mn)<(zn-Mn)*(e-Pe)&&--oe;return oe}function Ot(){T=L,A=[],z=[],_t=!0}function dt(){var oe=It(),ge=_t&&oe,Te=(A=OE(A)).length;(ge||Te)&&(w.polygonStart(),ge&&(w.lineStart(),l(null,null,1,w),w.lineEnd()),Te&&RE(A,c,oe,l,w),w.polygonEnd()),T=w,A=z=B=null}function Pt(){ct.point=Et,z&&z.push(B=[]),ut=!0,nt=!1,W=H=NaN}function Qt(){A&&(Et(Y,et),at&&nt&&L.rejoin(),A.push(L.result())),ct.point=bt,nt&&T.lineEnd()}function Et(oe,ge){var Te=s(oe,ge);if(z&&B.push([oe,ge]),ut)Y=oe,et=ge,at=Te,ut=!1,Te&&(T.lineStart(),T.point(oe,ge));else if(Te&&nt)T.point(oe,ge);else{var Fe=[W=Math.max(lm,Math.min(Kf,W)),H=Math.max(lm,Math.min(Kf,H))],rn=[oe=Math.max(lm,Math.min(Kf,oe)),ge=Math.max(lm,Math.min(Kf,ge))];d3(Fe,rn,e,t,n,r)?(nt||(T.lineStart(),T.point(Fe[0],Fe[1])),T.point(rn[0],rn[1]),Te||T.lineEnd(),_t=!1):Te&&(T.lineStart(),T.point(oe,ge),_t=!1)}W=oe,H=ge,nt=Te}return ct}}var rv=Fu();function _3(e,t){var n=t[0],r=t[1],s=[Dr(n),-kr(n),0],l=0,p=0;rv.reset();for(var c=0,y=e.length;c=0?1:-1,bt=ct*_t,It=bt>On,Ot=B*nt;if(rv.add(vp(Ot*ct*Dr(bt),Y*ut+Ot*kr(bt))),l+=It?_t+ct*al:_t,It^A>=n^W>=n){var dt=Jm(bp(L),bp(at));Zv(dt);var Pt=Jm(s,dt);Zv(Pt);var Qt=(It^_t>=0?-1:1)*Pc(Pt[2]);(r>Qt||r===Qt&&(dt[0]||dt[1]))&&(p+=It^_t>=0?1:-1)}}return(l<-ur||lEd&&(Ed=e),t$m&&($m=t)}Fu();function zE(e,t,n,r){return function(s,l){var p=t(l),c=s.invert(r[0],r[1]),y=DE(),w=t(y),T=!1,L,A,z,B={point:Y,lineStart:at,lineEnd:W,polygonStart:function(){B.point=H,B.lineStart=nt,B.lineEnd=ut,A=[],L=[]},polygonEnd:function(){B.point=Y,B.lineStart=at,B.lineEnd=W,A=OE(A);var _t=_3(L,c);A.length?(T||(l.polygonStart(),T=!0),RE(A,x3,_t,n,l)):_t&&(T||(l.polygonStart(),T=!0),l.lineStart(),n(null,null,1,l),l.lineEnd()),T&&(l.polygonEnd(),T=!1),A=L=null},sphere:function(){l.polygonStart(),l.lineStart(),n(null,null,1,l),l.lineEnd(),l.polygonEnd()}};function Y(_t,ct){var bt=s(_t,ct);e(_t=bt[0],ct=bt[1])&&l.point(_t,ct)}function et(_t,ct){var bt=s(_t,ct);p.point(bt[0],bt[1])}function at(){B.point=et,p.lineStart()}function W(){B.point=Y,p.lineEnd()}function H(_t,ct){z.push([_t,ct]);var bt=s(_t,ct);w.point(bt[0],bt[1])}function nt(){w.lineStart(),z=[]}function ut(){H(z[0][0],z[0][1]),w.lineEnd();var _t=w.clean(),ct=y.result(),bt,It=ct.length,Ot,dt,Pt;if(z.pop(),L.push(z),z=null,!!It){if(_t&1){if(dt=ct[0],(Ot=dt.length-1)>0){for(T||(l.polygonStart(),T=!0),l.lineStart(),bt=0;bt1&&_t&2&&ct.push(ct.pop().concat(ct.shift())),A.push(ct.filter(b3))}}return B}}function b3(e){return e.length>1}function x3(e,t){return((e=e.x)[0]<0?e[1]-$a-ur:$a-e[1])-((t=t.x)[0]<0?t[1]-$a-ur:$a-t[1])}const zw=zE(function(){return!0},w3,E3,[-On,-$a]);function w3(e){var t=NaN,n=NaN,r=NaN,s;return{lineStart:function(){e.lineStart(),s=1},point:function(l,p){var c=l>0?On:-On,y=Ai(l-t);Ai(y-On)0?$a:-$a),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(c,n),e.point(l,n),s=0):r!==c&&y>=On&&(Ai(t-r)ur?c3((Dr(t)*(l=kr(r))*Dr(n)-Dr(r)*(s=kr(t))*Dr(e))/(s*l*p)):(t+r)/2}function E3(e,t,n,r){var s;if(e==null)s=n*$a,r.point(-On,s),r.point(0,s),r.point(On,s),r.point(On,0),r.point(On,-s),r.point(0,-s),r.point(-On,-s),r.point(-On,0),r.point(-On,s);else if(Ai(e[0]-t[0])>ur){var l=e[0]0,s=Ai(n)>ur;function l(T,L,A,z){f3(z,e,t,A,T,L)}function p(T,L){return kr(T)*kr(L)>n}function c(T){var L,A,z,B,Y;return{lineStart:function(){B=z=!1,Y=1},point:function(et,at){var W=[et,at],H,nt=p(et,at),ut=r?nt?0:w(et,at):nt?w(et+(et<0?On:-On),at):0;if(!L&&(B=z=nt)&&T.lineStart(),nt!==z&&(H=y(L,W),(!H||bm(L,H)||bm(W,H))&&(W[0]+=ur,W[1]+=ur,nt=p(W[0],W[1]))),nt!==z)Y=0,nt?(T.lineStart(),H=y(W,L),T.point(H[0],H[1])):(H=y(L,W),T.point(H[0],H[1]),T.lineEnd()),L=H;else if(s&&L&&r^nt){var _t;!(ut&A)&&(_t=y(W,L,!0))&&(Y=0,r?(T.lineStart(),T.point(_t[0][0],_t[0][1]),T.point(_t[1][0],_t[1][1]),T.lineEnd()):(T.point(_t[1][0],_t[1][1]),T.lineEnd(),T.lineStart(),T.point(_t[0][0],_t[0][1])))}nt&&(!L||!bm(L,W))&&T.point(W[0],W[1]),L=W,z=nt,A=ut},lineEnd:function(){z&&T.lineEnd(),L=null},clean:function(){return Y|(B&&z)<<1}}}function y(T,L,A){var z=bp(T),B=bp(L),Y=[1,0,0],et=Jm(z,B),at=om(et,et),W=et[0],H=at-W*W;if(!H)return!A&&T;var nt=n*at/H,ut=-n*W/H,_t=Jm(Y,et),ct=sm(Y,nt),bt=sm(et,ut);nv(ct,bt);var It=_t,Ot=om(ct,It),dt=om(It,It),Pt=Ot*Ot-dt*(om(ct,ct)-1);if(!(Pt<0)){var Qt=Dp(Pt),Et=sm(It,(-Ot-Qt)/dt);if(nv(Et,ct),Et=Wv(Et),!A)return Et;var oe=T[0],ge=L[0],Te=T[1],Fe=L[1],rn;ge0^Et[1]<(Ai(Et[0]-oe)On^(oe<=Et[0]&&Et[0]<=ge)){var Mn=sm(It,(-Ot+Qt)/dt);return nv(Mn,ct),[Et,Wv(Mn)]}}}function w(T,L){var A=r?e:On-e,z=0;return T<-A?z|=1:T>A&&(z|=2),L<-A?z|=4:L>A&&(z|=8),z}return zE(p,c,l,r?[0,-e]:[-On,e-On])}function FE(e){return function(t){var n=new Xv;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Xv(){}Xv.prototype={constructor:Xv,point:function(e,t){this.stream.point(e,t)},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 BE(e,t,n){var r=t[1][0]-t[0][0],s=t[1][1]-t[0][1],l=e.clipExtent&&e.clipExtent();e.scale(150).translate([0,0]),l!=null&&e.clipExtent(null),h3(n,e.stream(Ow));var p=Ow.result(),c=Math.min(r/(p[1][0]-p[0][0]),s/(p[1][1]-p[0][1])),y=+t[0][0]+(r-c*(p[1][0]+p[0][0]))/2,w=+t[0][1]+(s-c*(p[1][1]+p[0][1]))/2;return l!=null&&e.clipExtent(l),e.scale(c*150).translate([y,w])}function C3(e,t,n){return BE(e,[[0,0],t],n)}var Fw=16,T3=kr(30*Fs);function Bw(e,t){return+t?P3(e,t):L3(e)}function L3(e){return FE({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function P3(e,t){function n(r,s,l,p,c,y,w,T,L,A,z,B,Y,et){var at=w-r,W=T-s,H=at*at+W*W;if(H>4*t&&Y--){var nt=p+A,ut=c+z,_t=y+B,ct=Dp(nt*nt+ut*ut+_t*_t),bt=Pc(_t/=ct),It=Ai(Ai(_t)-1)t||Ai((at*Qt+W*Et)/H-.5)>.3||p*A+c*z+y*B2?Et[2]%360*Fs:0,Pt()):[w*_u,T*_u,L*_u]},It.precision=function(Et){return arguments.length?(_t=Bw(dt,ut=Et*Et),Qt()):Dp(ut)},It.fitExtent=function(Et,oe){return BE(It,Et,oe)},It.fitSize=function(Et,oe){return C3(It,Et,oe)};function Pt(){z=kE(A=p3(w,T,L),t);var Et=t(c,y);return l=r-Et[0]*n,p=s+Et[1]*n,Qt()}function Qt(){return ct=bt=null,It}return function(){return t=e.apply(this,arguments),It.invert=t.invert&&Ot,Pt()}}function VE(e){return function(t,n){var r=kr(t),s=kr(n),l=e(r*s);return[l*s*Dr(t),l*Dr(n)]}}function UE(e){return function(t,n){var r=Dp(t*t+n*n),s=e(r),l=Dr(s),p=kr(s);return[vp(t*l,r*p),Pc(r&&n*l/r)]}}var D3=VE(function(e){return Dp(2/(1+e))});D3.invert=UE(function(e){return 2*Pc(e/2)});var GE=VE(function(e){return(e=AE(e))&&e/Dr(e)});GE.invert=UE(function(e){return e});function R3(){return A3(GE).scale(79.4188).clipAngle(180-.001)}function Vw(e,t){return[e,t]}Vw.invert=Vw;function N3(e,t,n){n=n||{};var r=n.units||"kilometers",s=n.steps||8;if(!e)throw new Error("geojson is required");if(typeof n!="object")throw new Error("options must be an object");if(typeof s!="number")throw new Error("steps must be an number");if(t===void 0)throw new Error("radius is required");if(s<=0)throw new Error("steps must be greater than 0");var l=[];switch(e.type){case"GeometryCollection":return rE(e,function(p){var c=xm(p,t,r,s);c&&l.push(c)}),Uv(l);case"FeatureCollection":return bw(e,function(p){var c=xm(p,t,r,s);c&&bw(c,function(y){y&&l.push(y)})}),Uv(l)}return xm(e,t,r,s)}function xm(e,t,n,r){var s=e.properties||{},l=e.type==="Feature"?e.geometry:e;if(l.type==="GeometryCollection"){var p=[];return rE(e,function(Y){var et=xm(Y,t,n,r);et&&p.push(et)}),Uv(p)}var c=O3(l),y={type:l.type,coordinates:qE(l.coordinates,c)},w=new D0,T=w.read(y),L=jR(qR(t,n),"meters"),A=ci.bufferOp(T,L,r),z=new fE;if(A=z.write(A),!jE(A.coordinates)){var B={type:A.type,coordinates:WE(A.coordinates,c)};return cy(B,s)}}function jE(e){return Array.isArray(e[0])?jE(e[0]):isNaN(e[0])}function qE(e,t){return typeof e[0]!="object"?t(e):e.map(function(n){return qE(n,t)})}function WE(e,t){return typeof e[0]!="object"?t.invert(e):e.map(function(n){return WE(n,t)})}function O3(e){var t=ZR(e).geometry.coordinates,n=[-t[0],-t[1]];return R3().rotate(n).scale(Lo)}function z3(e,t){var n=jm(e),r=jm(t),s=e.properties||{},l=QS.difference(n.coordinates,r.coordinates);return l.length===0?null:l.length===1?tE(l[0],s):eE(l,s)}function Uw(e){let t;for(const n of e)t&&n[0]-t[0]>=180?n[0]-=360:t&&n[0]-t[0]<-180&&(n[0]+=360),t=n}function Gw(e,t){const n=z3({type:"Polygon",coordinates:[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]},e);if(!n)return;n.properties={isMask:"y"};const r=N3(e,0);if(r.geometry.type==="Polygon")for(const s of r.geometry.coordinates)Uw(s);else for(const s of r.geometry.coordinates)for(const l of s)Uw(l);t({type:"FeatureCollection",features:[r,n]})}let jw={type:"FeatureCollection",features:[]};function F3(e,t,n=!0,r=!0,s={},l={},p={fill:{paint:{"fill-color":"#000","fill-opacity":.1},filter:["all",["==",["geometry-type"],"Polygon"],["has","isMask"]]},line:{layout:{"line-cap":"square"},paint:{"line-width":["case",["==",["geometry-type"],"Polygon"],2,3],"line-dasharray":[1,1],"line-color":"#3170fe"},filter:["!",["has","isMask"]]}}){let c,y=[],w,T;function L(){(p!=null&&p.fill||p!=null&&p.line)&&e.addSource("full-geom",{type:"geojson",data:jw}),p!=null&&p.fill&&e.addLayer({...p==null?void 0:p.fill,id:"full-geom-fill",type:"fill",source:"full-geom"}),p!=null&&p.line&&e.addLayer({...p==null?void 0:p.line,id:"full-geom-line",type:"line",source:"full-geom"})}e.loaded()?L():e.once("load",()=>{L()});const A=B=>{c==null||c({type:"mapClick",coordinates:[B.lngLat.lng,B.lngLat.lat]})};function z(B=!1){if(!t)throw new Error;const Y=document.createElement("div");return B&&Y.classList.add("marker-interactive"),new fR({props:{displayIn:"maplibre"},target:Y}),new t.Marker({element:Y,offset:[1,-13]})}return{setEventHandler(B){B?(c=B,e.on("click",A)):(c=void 0,e.off("click",A))},flyTo(B,Y){e.flyTo({center:B,zoom:Y,...s})},fitBounds(B,Y,et){e.fitBounds([[B[0],B[1]],[B[2],B[3]]],{padding:Y,maxZoom:et,...l})},indicateReverse(B){e.getCanvasContainer().style.cursor=B?"crosshair":""},setReverseMarker(B){!t||!n||(T?B?T.setLngLat(B):(T.remove(),T=void 0):B&&(T=(typeof n=="object"?new t.Marker(n):z()).setLngLat(B).addTo(e),T.getElement().classList.add("marker-reverse")))},setMarkers(B,Y){if(!n)return;function et(at){var W;(W=e.getSource("full-geom"))==null||W.setData(at)}for(const at of y)at.remove();if(y.length=0,et(jw),!!t){if(Y){let at=!1;if(Y.geometry.type==="GeometryCollection"){const W=Y.geometry.geometries.filter(H=>H.type==="Polygon"||H.type==="MultiPolygon");if(W.length>0){let H=W.pop();for(const nt of W)H=WR(H,nt);Gw({...Y,geometry:H},et),at=!0}else{const H=Y.geometry.geometries.filter(nt=>nt.type==="LineString"||nt.type==="MultiLineString");H.length>0&&(et({...Y,geometry:{type:"GeometryCollection",geometries:H}}),at=!0)}}if(!at){if(Y.geometry.type==="Polygon"||Y.geometry.type==="MultiPolygon")Gw(Y,et);else if(Y.geometry.type==="LineString"||Y.geometry.type==="MultiLineString"){et(Y);return}}n&&y.push((typeof n=="object"?new t.Marker(n):z()).setLngLat(Y.center).addTo(e))}if(r)for(const at of B??[]){if(at===Y)continue;const W=(typeof r=="object"?new t.Marker(r):z(!0)).setLngLat(at.center).setPopup(new t.Popup({offset:[1,-27],closeButton:!1,closeOnMove:!0,className:"maptiler-gc-popup"}).setText(at.place_type[0]==="reverse"?at.place_name:at.place_name.replace(/,.*/,""))).addTo(e),H=W.getElement();H.addEventListener("click",nt=>{nt.stopPropagation(),c==null||c({type:"markerClick",id:at.id})}),H.addEventListener("mouseenter",()=>{c==null||c({type:"markerMouseEnter",id:at.id}),W.togglePopup()}),H.addEventListener("mouseleave",()=>{c==null||c({type:"markerMouseLeave",id:at.id}),W.togglePopup()}),y.push(W)}}},setSelectedMarker(B){w&&w.getElement().classList.toggle("marker-selected",!1),w=B>-1?y[B]:void 0,w==null||w.getElement().classList.toggle("marker-selected",!0)},getCenterAndZoom(){const B=e.getCenter();return[e.getZoom(),B.lng,B.lat]}}}function B3(e){let t,n;return{c(){t=Ol("svg"),n=Ol("path"),zt(n,"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"),zt(t,"viewBox","0 0 14 14"),zt(t,"width","13"),zt(t,"height","13"),zt(t,"class","svelte-en2qvf")},m(r,s){de(r,t,s),Wt(t,n)},p:Oe,i:Oe,o:Oe,d(r){r&&fe(t)}}}class ZE extends Pn{constructor(t){super(),Ln(this,t,null,B3,vn,{})}}function V3(e){let t,n;return{c(){t=Ol("svg"),n=Ol("path"),zt(n,"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"),zt(t,"viewBox","0 0 30 30"),zt(t,"fill","none"),zt(t,"xmlns","http://www.w3.org/2000/svg"),zt(t,"class","svelte-d2loi5")},m(r,s){de(r,t,s),Wt(t,n)},p:Oe,i:Oe,o:Oe,d(r){r&&fe(t)}}}class HE extends Pn{constructor(t){super(),Ln(this,t,null,V3,vn,{})}}function U3(e){let t,n;return{c(){t=ae("img"),ho(t.src,n=e[3]+"area.svg")||zt(t,"src",n),zt(t,"alt",e[6]),zt(t,"class","svelte-ltkwvy")},m(r,s){de(r,t,s)},p(r,s){s&8&&!ho(t.src,n=r[3]+"area.svg")&&zt(t,"src",n),s&64&&zt(t,"alt",r[6])},d(r){r&&fe(t)}}}function G3(e){let t,n;return{c(){t=ae("img"),ho(t.src,n=e[3]+"reverse.svg")||zt(t,"src",n),zt(t,"alt",e[6]),zt(t,"class","svelte-ltkwvy")},m(r,s){de(r,t,s)},p(r,s){s&8&&!ho(t.src,n=r[3]+"reverse.svg")&&zt(t,"src",n),s&64&&zt(t,"alt",r[6])},d(r){r&&fe(t)}}}function j3(e){let t,n;return{c(){t=ae("img"),ho(t.src,n=e[3]+"poi.svg")||zt(t,"src",n),zt(t,"alt",e[6]),zt(t,"class","svelte-ltkwvy")},m(r,s){de(r,t,s)},p(r,s){s&8&&!ho(t.src,n=r[3]+"poi.svg")&&zt(t,"src",n),s&64&&zt(t,"alt",r[6])},d(r){r&&fe(t)}}}function q3(e){let t,n;return{c(){t=ae("img"),ho(t.src,n=e[3]+"postal_code.svg")||zt(t,"src",n),zt(t,"alt",e[6]),zt(t,"class","svelte-ltkwvy")},m(r,s){de(r,t,s)},p(r,s){s&8&&!ho(t.src,n=r[3]+"postal_code.svg")&&zt(t,"src",n),s&64&&zt(t,"alt",r[6])},d(r){r&&fe(t)}}}function W3(e){let t,n;return{c(){t=ae("img"),ho(t.src,n=e[3]+"street.svg")||zt(t,"src",n),zt(t,"alt",e[6]),zt(t,"class","svelte-ltkwvy")},m(r,s){de(r,t,s)},p(r,s){s&8&&!ho(t.src,n=r[3]+"street.svg")&&zt(t,"src",n),s&64&&zt(t,"alt",r[6])},d(r){r&&fe(t)}}}function Z3(e){let t,n;return{c(){t=ae("img"),ho(t.src,n=e[3]+"road.svg")||zt(t,"src",n),zt(t,"alt",e[6]),zt(t,"class","svelte-ltkwvy")},m(r,s){de(r,t,s)},p(r,s){s&8&&!ho(t.src,n=r[3]+"road.svg")&&zt(t,"src",n),s&64&&zt(t,"alt",r[6])},d(r){r&&fe(t)}}}function H3(e){let t,n;return{c(){t=ae("img"),ho(t.src,n=e[3]+"housenumber.svg")||zt(t,"src",n),zt(t,"alt",e[6]),zt(t,"class","svelte-ltkwvy")},m(r,s){de(r,t,s)},p(r,s){s&8&&!ho(t.src,n=r[3]+"housenumber.svg")&&zt(t,"src",n),s&64&&zt(t,"alt",r[6])},d(r){r&&fe(t)}}}function X3(e){let t,n,r,s;return{c(){t=ae("img"),ho(t.src,n=e[5])||zt(t,"src",n),zt(t,"alt",e[4]),zt(t,"class","svelte-ltkwvy")},m(l,p){de(l,t,p),r||(s=an(t,"error",e[14]),r=!0)},p(l,p){p&32&&!ho(t.src,n=l[5])&&zt(t,"src",n),p&16&&zt(t,"alt",l[4])},d(l){l&&fe(t),r=!1,s()}}}function qw(e){let t,n;return{c(){t=ae("span"),n=Wn(e[6]),zt(t,"class","secondary svelte-ltkwvy")},m(r,s){de(r,t,s),Wt(t,n)},p(r,s){s&64&&Vl(n,r[6])},d(r){r&&fe(t)}}}function Y3(e){var ct,bt;let t,n,r,s,l,p,c,y,w=(e[7]?e[0].place_name:e[0].place_name.replace(/,.*/,""))+"",T,L,A=e[2]==="always"||e[2]&&!e[0].address&&((ct=e[0].properties)==null?void 0:ct.kind)!=="road"&&((bt=e[0].properties)==null?void 0:bt.kind)!=="road_relation"&&!e[0].id.startsWith("address.")&&!e[0].id.startsWith("postal_code.")&&(!e[0].id.startsWith("poi.")||!e[5])&&!e[7],z,B,Y=(e[7]?"":e[0].place_name.replace(/[^,]*,?\s*/,""))+"",et,at,W;function H(It,Ot){var dt,Pt;return Ot&1&&(n=null),Ot&1&&(r=null),Ot&1&&(s=null),It[5]?X3:It[0].address?H3:((dt=It[0].properties)==null?void 0:dt.kind)==="road"||((Pt=It[0].properties)==null?void 0:Pt.kind)==="road_relation"?Z3:(n==null&&(n=!!It[0].id.startsWith("address.")),n?W3:(r==null&&(r=!!It[0].id.startsWith("postal_code.")),r?q3:(s==null&&(s=!!It[0].id.startsWith("poi.")),s?j3:It[7]?G3:U3)))}let nt=H(e,-1),ut=nt(e),_t=A&&qw(e);return{c(){t=ae("li"),ut.c(),l=Ve(),p=ae("span"),c=ae("span"),y=ae("span"),T=Wn(w),L=Ve(),_t&&_t.c(),z=Ve(),B=ae("span"),et=Wn(Y),zt(y,"class","primary svelte-ltkwvy"),zt(c,"class","svelte-ltkwvy"),zt(B,"class","line2 svelte-ltkwvy"),zt(p,"class","texts svelte-ltkwvy"),zt(t,"tabindex","0"),zt(t,"data-selected",e[1]),zt(t,"class","svelte-ltkwvy"),Qa(t,"selected",e[1])},m(It,Ot){de(It,t,Ot),ut.m(t,null),Wt(t,l),Wt(t,p),Wt(p,c),Wt(c,y),Wt(y,T),Wt(c,L),_t&&_t.m(c,null),Wt(p,z),Wt(p,B),Wt(B,et),at||(W=[an(t,"mouseenter",e[12]),an(t,"focus",e[13])],at=!0)},p(It,[Ot]){var dt,Pt;nt===(nt=H(It,Ot))&&ut?ut.p(It,Ot):(ut.d(1),ut=nt(It),ut&&(ut.c(),ut.m(t,l))),Ot&1&&w!==(w=(It[7]?It[0].place_name:It[0].place_name.replace(/,.*/,""))+"")&&Vl(T,w),Ot&37&&(A=It[2]==="always"||It[2]&&!It[0].address&&((dt=It[0].properties)==null?void 0:dt.kind)!=="road"&&((Pt=It[0].properties)==null?void 0:Pt.kind)!=="road_relation"&&!It[0].id.startsWith("address.")&&!It[0].id.startsWith("postal_code.")&&(!It[0].id.startsWith("poi.")||!It[5])&&!It[7]),A?_t?_t.p(It,Ot):(_t=qw(It),_t.c(),_t.m(c,null)):_t&&(_t.d(1),_t=null),Ot&1&&Y!==(Y=(It[7]?"":It[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Vl(et,Y),Ot&2&&zt(t,"data-selected",It[1]),Ot&2&&Qa(t,"selected",It[1])},i:Oe,o:Oe,d(It){It&&fe(t),ut.d(),_t&&_t.d(),at=!1,Fi(W)}}}function K3(e,t,n){var H;let r,s,{feature:l}=t,{selected:p=!1}=t,{showPlaceType:c}=t,{missingIconsCache:y}=t,{iconsBaseUrl:w}=t;const T=(H=l.properties)==null?void 0:H.categories;let L,A,z=0,B=l.place_type[0]==="reverse";function Y(nt){A&&y.add(A),n(10,z++,z)}function et(nt){ni.call(this,e,nt)}function at(nt){ni.call(this,e,nt)}const W=nt=>Y(nt.currentTarget);return e.$$set=nt=>{"feature"in nt&&n(0,l=nt.feature),"selected"in nt&&n(1,p=nt.selected),"showPlaceType"in nt&&n(2,c=nt.showPlaceType),"missingIconsCache"in nt&&n(9,y=nt.missingIconsCache),"iconsBaseUrl"in nt&&n(3,w=nt.iconsBaseUrl)},e.$$.update=()=>{var nt,ut,_t,ct;if(e.$$.dirty&3640)do n(11,r--,r),n(4,L=T==null?void 0:T[r]),n(5,A=L?w+L.replace(/ /g,"_")+".svg":void 0);while(r>-1&&(!A||y.has(A)));e.$$.dirty&1&&n(6,s=l.id.startsWith("poi.")?(ut=(nt=l.properties)==null?void 0:nt.categories)==null?void 0:ut.join(", "):((ct=(_t=l.properties)==null?void 0:_t.place_type_name)==null?void 0:ct[0])??l.place_type[0])},n(11,r=(T==null?void 0:T.length)??0),[l,p,c,w,L,A,s,B,Y,y,z,r,et,at,W]}class J3 extends Pn{constructor(t){super(),Ln(this,t,K3,Y3,vn,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function Q3(e){let t;return{c(){t=ae("div"),t.innerHTML='',zt(t,"class","svelte-7cmwmc")},m(n,r){de(n,t,r)},p:Oe,i:Oe,o:Oe,d(n){n&&fe(t)}}}class $3 extends Pn{constructor(t){super(),Ln(this,t,null,Q3,vn,{})}}function tN(e){let t,n;return{c(){t=Ol("svg"),n=Ol("path"),zt(n,"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"),zt(t,"viewBox","0 0 60.006 21.412"),zt(t,"width","14"),zt(t,"height","20"),zt(t,"class","svelte-en2qvf")},m(r,s){de(r,t,s),Wt(t,n)},p:Oe,i:Oe,o:Oe,d(r){r&&fe(t)}}}class eN extends Pn{constructor(t){super(),Ln(this,t,null,tN,vn,{})}}function nN(e){let t,n,r;return{c(){t=Ol("svg"),n=Ol("circle"),r=Ol("path"),zt(n,"cx","4.789"),zt(n,"cy","4.787"),zt(n,"r","3.85"),hc(n,"stroke-width","1.875"),hc(n,"fill","none"),zt(r,"d","M12.063 12.063 7.635 7.635"),hc(r,"stroke-width","1.875"),hc(r,"stroke-linecap","round"),zt(t,"xmlns","http://www.w3.org/2000/svg"),zt(t,"width","13"),zt(t,"height","13"),zt(t,"viewBox","0 0 13 13"),zt(t,"class","svelte-1bpbt60")},m(s,l){de(s,t,l),Wt(t,n),Wt(t,r)},p:Oe,i:Oe,o:Oe,d(s){s&&fe(t)}}}class rN extends Pn{constructor(t){super(),Ln(this,t,null,nN,vn,{})}}function iN(e,t,n){const r=t[1],s=t[0],l=r-s;return e===r&&n?e:((e-s)%l+l)%l+s}function Ww(e){const t=[...e];return t[2]r[0]||s.maxZoom!=null&&s.maxZoomDate.now()){if(!Uf.coords)break t;return Uf.coords}let l;try{return l=await new Promise((p,c)=>{n.signal.addEventListener("abort",()=>{c(Error("aborted"))}),navigator.geolocation.getCurrentPosition(y=>{p([y.coords.longitude,y.coords.latitude].map(w=>w.toFixed(6)).join(","))},y=>{c(y)},s)}),l}catch{}finally{s.cachedLocationExpiry&&(Uf={time:Date.now(),coords:l})}if(n.signal.aborted)return}if(s.type==="server-geolocation")return"ip";if(r&&s.type==="map-center")return r[1].toFixed(6)+","+r[2].toFixed(6)}}const Zw=/(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,Hw=/(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,Xw=/(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,Yw=/(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 sN(e){if(!["DMS","DM","DD"].includes(e))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){if(e=="DD")return this.decimalCoordinates;const t=this.decimalCoordinates.split(",").map(p=>Number(p.trim()));let n=Kw(t[0],e),r=Kw(t[1],e);n.endsWith('.0"')&&r.endsWith('.0"')&&(n=n.replace(/\.0"$/,'"'),r=r.replace(/\.0"$/,'"'));const s=t[0]>=0?" N":" S",l=t[1]>=0?" E":" W";return`${n+s}, ${r+l}`}else throw new Error("no decimal coordinates to convert")}function Kw(e,t){const n=Math.abs(e),r=Math.floor(n),s=(n-r)*60;if(t=="DM"){let c=aN(s,3).toFixed(3).padStart(6,"0");return`${r}° ${c}'`}let l=Math.floor(s),p=((s-l)*60).toFixed(1).padStart(4,"0");return l=l.toString().padStart(2,"0"),`${r}° ${l}' ${p}"`}function aN(e,t){const n=Math.pow(10,t);return Math.round((e+Number.EPSILON)*n)/n}function G0(e,t){t||(t=5),e=e.replace(/\s+/g," ").trim();let n=null,r=null,s="",l="",p=[],c=!1;if(Zw.test(e))if(p=Zw.exec(e),c=um(p),c){if(n=p[2],r=p[6],n.includes(",")&&(n=n.replace(",",".")),r.includes(",")&&(r=r.replace(",",".")),Number(Math.round(n))==Number(n))throw new Error("integer only coordinate provided");if(Number(Math.round(r))==Number(r))throw new Error("integer only coordinate provided");p[1]?(s=p[1],l=p[5]):p[4]&&(s=p[4],l=p[8])}else throw new Error("invalid decimal coordinate format");else if(Hw.test(e))if(p=Hw.exec(e),c=um(p),c)n=Math.abs(parseInt(p[2])),p[4]&&(n+=p[4]/60),p[6]&&(n+=p[6].replace(",",".")/3600),parseInt(p[2])<0&&(n=-1*n),r=Math.abs(parseInt(p[9])),p[11]&&(r+=p[11]/60),p[13]&&(r+=p[13].replace(",",".")/3600),parseInt(p[9])<0&&(r=-1*r),p[1]?(s=p[1],l=p[8]):p[7]&&(s=p[7],l=p[14]);else throw new Error("invalid DMS coordinates format");else if(Xw.test(e))if(p=Xw.exec(e),c=um(p),c)n=Math.abs(parseInt(p[2])),p[4]&&(n+=p[4]/60),p[6]&&(n+=p[6]/3600),parseInt(p[2])<0&&(n=-1*n),r=Math.abs(parseInt(p[10])),p[12]&&(r+=p[12]/60),p[14]&&(r+=p[14]/3600),parseInt(p[10])<0&&(r=-1*r),p[1]?(s=p[1],l=p[9]):p[8]&&(s=p[8],l=p[16]);else throw new Error("invalid DMS coordinates format");else if(Yw.test(e))if(p=Yw.exec(e),c=um(p),c)n=Math.abs(parseInt(p[2])),p[4]&&(n+=p[4]/60),p[6]&&(n+=p[6]/3600),parseInt(p[2])<0&&(n=-1*n),r=Math.abs(parseInt(p[10])),p[12]&&(r+=p[12]/60),p[14]&&(r+=p[14]/3600),parseInt(p[10])<0&&(r=-1*r),p[1]?(s=p[1],l=p[9]):p[8]&&(s=p[8],l=p[16]);else throw new Error("invalid coordinates format");if(c){if(Math.abs(r)>=180)throw new Error("invalid longitude value");if(Math.abs(n)>=90)throw new Error("invalid latitude value");if((s||l)&&(!s||!l))throw new Error("invalid coordinates format");if(s&&s==l)throw new Error("invalid coordinates format");let y=/S|SOUTH/i;y.test(s)&&n>0&&(n=-1*n),y=/W|WEST/i,y.test(l)&&r>0&&(r=-1*r);const w=p[0].trim();let T,L;const A=/[,/;\u0020]/g,z=w.match(A);if(z==null){const et=Math.floor(e.length/2);T=w.substring(0,et).trim(),L=w.substring(et).trim()}else{let et;z.length%2==1?et=Math.floor(z.length/2):et=z.length/2-1;let at=0;if(et==0)at=w.indexOf(z[0]),T=w.substring(0,at).trim(),L=w.substring(at+1).trim();else{let W=0,H=0;for(;W<=et;)at=w.indexOf(z[W],H),H=at+1,W++;T=w.substring(0,at).trim(),L=w.substring(at+1).trim()}}const B=T.split(".");if(B.length==2&&B[1]==0&&B[1].length!=2)throw new Error("invalid coordinates format");const Y=L.split(".");if(Y.length==2&&Y[1]==0&&Y[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(T)||/^\d+$/.test(L))throw new Error("degree only coordinate/s provided");return isNaN(n)&&n.includes(",")&&(n=n.replace(",",".")),n=Number(Number(n).toFixed(t)),isNaN(r)&&r.includes(",")&&(r=r.replace(",",".")),r=Number(Number(r).toFixed(t)),Object.freeze({verbatimCoordinates:w,verbatimLatitude:T,verbatimLongitude:L,decimalLatitude:n,decimalLongitude:r,decimalCoordinates:`${n},${r}`,closeEnough:lN,toCoordinateFormat:sN})}else throw new Error("coordinates pattern match failed")}function um(e){if(!isNaN(e[0]))return!1;const t=[...e];if(t.shift(),t.length%2>0)return!1;const n=/^[-+]?\d+([\.,]\d+)?$/,r=/[eastsouthnorthwest]+/i,s=t.length/2;for(let l=0;l{t.decimalLatitude?e.push(t):e.push({...t,...hN})}),[...e,...pN,...fN]}const gN=dN();G0.formats=gN.map(e=>e.verbatimCoordinates);const mN=G0;function Qw(e,t,n){const r=e.slice();return r[81]=t[n],r[83]=n,r}function $w(e){let t,n;return t=new $3({}),{c(){nn(t.$$.fragment)},m(r,s){$e(t,r,s),n=!0},i(r){n||(ee(t.$$.fragment,r),n=!0)},o(r){le(t.$$.fragment,r),n=!1},d(r){tn(t,r)}}}function t2(e){let t,n,r,s,l;return n=new eN({}),{c(){t=ae("button"),nn(n.$$.fragment),zt(t,"type","button"),zt(t,"title",e[9]),zt(t,"class","svelte-zh3kmv"),Qa(t,"active",e[0])},m(p,c){de(p,t,c),$e(n,t,null),r=!0,s||(l=an(t,"click",e[67]),s=!0)},p(p,c){(!r||c[0]&512)&&zt(t,"title",p[9]),(!r||c[0]&1)&&Qa(t,"active",p[0])},i(p){r||(ee(n.$$.fragment,p),r=!0)},o(p){le(n.$$.fragment,p),r=!1},d(p){p&&fe(t),tn(n),s=!1,l()}}}function yN(e){let t,n=[],r=new Map,s,l,p,c=Em(e[14]);const y=w=>w[81].id+(w[81].address?","+w[81].address:"");for(let w=0;w{ct=null}),Zo()),(!H||oe[0]&2)&&Qa(w,"displayable",Et[1]!==""),Et[5]===!0?bt?(bt.p(Et,oe),oe[0]&32&&ee(bt,1)):(bt=t2(Et),bt.c(),ee(bt,1),bt.m(r,B)):bt&&(Wo(),le(bt,1,1,()=>{bt=null}),Zo()),Ot&&Ot.p&&(!H||oe[1]&134217728)&&Hs(Ot,It,Et,Et[58],H?Zs(It,Et[58],oe,null):Xs(Et[58]),null);let ge=et;et=Qt(Et),et===ge?~et&&Pt[et].p(Et,oe):(at&&(Wo(),le(Pt[ge],1,1,()=>{Pt[ge]=null}),Zo()),~et?(at=Pt[et],at?at.p(Et,oe):(at=Pt[et]=dt[et](Et),at.c()),ee(at,1),at.m(n,null)):at=null),(!H||oe[0]&4&&W!==(W=wm(Et[2])+" svelte-zh3kmv"))&&zt(n,"class",W),(!H||oe[0]&22)&&Qa(n,"can-collapse",Et[4]&&Et[1]==="")},i(Et){H||(ee(_t),ee(l.$$.fragment,Et),ee(L.$$.fragment,Et),ee(ct),ee(bt),ee(Ot,Et),ee(at),H=!0)},o(Et){le(_t),le(l.$$.fragment,Et),le(L.$$.fragment,Et),le(ct),le(bt),le(Ot,Et),le(at),H=!1},d(Et){Et&&(fe(t),fe(n)),tn(l),e[61](null),tn(L),ct&&ct.d(),bt&&bt.d(),Ot&&Ot.d(Et),~et&&Pt[et].d(),nt=!1,Fi(ut)}}}function wN(e,t,n){let r,{$$slots:s={},$$scope:l}=t,{class:p=void 0}=t,{apiKey:c}=t,{bbox:y=void 0}=t,{clearButtonTitle:w="clear"}=t,{clearOnBlur:T=!1}=t,{collapsed:L=!1}=t,{country:A=void 0}=t,{debounceSearch:z=200}=t,{enableReverse:B=!1}=t,{errorMessage:Y="Something went wrong…"}=t,{filter:et=()=>!0}=t,{flyTo:at=!0}=t,{fuzzyMatch:W=!0}=t,{language:H=void 0}=t,{limit:nt=void 0}=t,{mapController:ut=void 0}=t,{minLength:_t=2}=t,{noResultsMessage:ct="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!"}=t,{placeholder:bt="Search"}=t,{proximity:It=[{type:"server-geolocation"}]}=t,{reverseActive:Ot=B==="always"}=t,{reverseButtonTitle:dt="toggle reverse geocoding"}=t,{searchValue:Pt=""}=t,{showFullGeometry:Qt=!0}=t,{showPlaceType:Et="ifNeeded"}=t,{showResultsWhileTyping:oe=!0}=t,{selectFirst:ge=!0}=t,{flyToSelected:Te=!1}=t,{markerOnSelected:Fe=!0}=t,{types:rn=void 0}=t,{excludeTypes:En=!1}=t,{zoom:Me=16}=t,{maxZoom:Pe=18}=t,{apiUrl:Mn="https://api.maptiler.com/geocoding"}=t,{fetchParameters:pr={}}=t,{iconsBaseUrl:zn="https://cdn.maptiler.com/maptiler-geocoding-control/v1.2.2/icons/"}=t,{adjustUrlQuery:jn=X=>{}}=t;function Cr(){Mt.focus()}function qr(){Mt.blur()}function Bi(X,mt=!0){n(1,Pt=X),mt?(n(15,hn=-1),fl()):(zr(),setTimeout(()=>{Mt.focus(),Mt.select()}))}function Zt(){n(14,Vt=void 0),n(55,Re=void 0),n(15,hn=-1)}function on(){n(54,Ee=[]),n(55,Re=void 0)}let cn=!1,Vt,Ee,Re,Or="",Mt,hn=-1,Wr,Qe=[],Hn,_o,rs,Cs;const Da=new Set,mi=Ld();Ul(()=>{ut&&(ut.setEventHandler(void 0),ut.indicateReverse(!1),ut.setSelectedMarker(-1),ut.setMarkers(void 0,void 0))});function fl(X){if(_o&&(clearTimeout(_o),_o=void 0),hn>-1&&Vt)n(55,Re=Vt[hn]),n(1,Pt=Re.place_type[0]==="reverse"?Re.place_name:Re.place_name.replace(/,.*/,"")),n(18,Wr=void 0),n(54,Ee=void 0),n(15,hn=-1);else if(Pt){const mt=X||!is(Pt);Ht(Pt,{exact:!0}).then(()=>{n(54,Ee=Vt),n(55,Re=void 0),mt&&zo()}).catch(ht=>n(18,Wr=ht))}}function is(X){try{return mN(X,6)}catch{return!1}}async function Ht(X,{byId:mt=!1,exact:ht=!1}={}){n(18,Wr=void 0),Hn==null||Hn.abort();const xt=new AbortController;n(19,Hn=xt);try{const At=is(X),Rt=new URLSearchParams;if(H!==void 0&&Rt.set("language",Array.isArray(H)?H.join(","):H??""),rn&&Rt.set("types",rn.join(",")),En&&Rt.set("excludeTypes",String(En)),y&&Rt.set("bbox",y.map(ze=>ze.toFixed(6)).join(",")),A&&Rt.set("country",Array.isArray(A)?A.join(","):A),!mt&&!At){const ze=await oN(ut,It,xt);ze&&Rt.set("proximity",ze),(ht||!oe)&&Rt.set("autocomplete","false"),Rt.set("fuzzyMatch",String(W))}nt!==void 0&&(!At||(rn==null?void 0:rn.length)===1)&&Rt.set("limit",String(nt)),Rt.set("key",c),jn(Rt);const Ft=Mn+"/"+encodeURIComponent(At?At.decimalLongitude+","+At.decimalLatitude:X)+".json?"+Rt.toString();if(Ft===Or){mt?(n(14,Vt=void 0),n(55,Re=Qe[0])):n(14,Vt=Qe);return}Or=Ft;const ve=await fetch(Ft,{signal:xt.signal,...pr});if(!ve.ok)throw new Error(await ve.text());const we=await ve.json();mi("response",{url:Ft,featureCollection:we}),mt?(n(14,Vt=void 0),n(55,Re=we.features[0]),Qe=[Re]):(n(14,Vt=we.features.filter(et)),At&&Vt.unshift({type:"Feature",properties:{},id:"reverse_"+At.decimalLongitude+"_"+At.decimalLatitude,text:At.decimalLatitude+", "+At.decimalLongitude,place_name:At.decimalLatitude+", "+At.decimalLongitude,place_type:["reverse"],center:[At.decimalLongitude,At.decimalLatitude],bbox:[At.decimalLongitude,At.decimalLatitude,At.decimalLongitude,At.decimalLatitude],geometry:{type:"Point",coordinates:[At.decimalLongitude,At.decimalLatitude]}}),Qe=Vt,At&&Mt.focus())}catch(At){if(At&&typeof At=="object"&&"name"in At&&At.name==="AbortError")return;throw At}finally{xt===Hn&&n(19,Hn=void 0)}}function zo(){var ht;if(!(Ee!=null&&Ee.length)||!at)return;const X=[180,90,-180,-90],mt=!Ee.some(xt=>!xt.matching_text);for(const xt of Ee)if(mt||!xt.matching_text)for(const At of[0,1,2,3])X[At]=Math[At<2?"min":"max"](X[At],((ht=xt.bbox)==null?void 0:ht[At])??xt.center[At%2]);ut&&Ee.length>0&&(Re&&X[0]===X[2]&&X[1]===X[3]?ut.flyTo(Re.center,Me):ut.fitBounds(Ww(X),50,Pe))}function Vi(X){n(0,Ot=B==="always"),n(14,Vt=void 0),n(55,Re=void 0),n(15,hn=-1),Bi(X[1].toFixed(6)+", "+iN(X[0],[-180,180],!0).toFixed(6),!1)}function dl(X){if(!Vt)return;let mt=X.key==="ArrowDown"?1:X.key==="ArrowUp"?-1:0;mt&&(hn===(ge?0:-1)&&mt===-1&&n(15,hn=Vt.length),n(15,hn+=mt),hn>=Vt.length&&n(15,hn=-1),hn<0&&ge&&n(15,hn=0),X.preventDefault())}function zr(X=!0){if(n(18,Wr=void 0),oe){if(_o&&clearTimeout(_o),Pt.length<_t)return;const mt=Pt;_o=window.setTimeout(()=>{Ht(mt).catch(ht=>n(18,Wr=ht))},X?z:0)}else n(14,Vt=void 0),n(18,Wr=void 0)}function $t(X){n(55,Re=X),n(1,Pt=X.place_name),n(15,hn=-1)}const Ze=()=>Mt.focus();function je(X){Di[X?"unshift":"push"](()=>{Mt=X,n(17,Mt)})}function xr(){Pt=this.value,n(1,Pt),n(13,cn),n(27,T)}const Fo=()=>n(13,cn=!0),Ge=()=>n(13,cn=!1),ca=()=>zr(),Tr=()=>{n(1,Pt=""),Mt.focus()},it=()=>n(0,Ot=!Ot),F=()=>n(18,Wr=void 0),U=X=>n(15,hn=X),Z=X=>$t(X),Q=()=>{ge||n(15,hn=-1)},gt=()=>{};return e.$$set=X=>{"class"in X&&n(2,p=X.class),"apiKey"in X&&n(25,c=X.apiKey),"bbox"in X&&n(26,y=X.bbox),"clearButtonTitle"in X&&n(3,w=X.clearButtonTitle),"clearOnBlur"in X&&n(27,T=X.clearOnBlur),"collapsed"in X&&n(4,L=X.collapsed),"country"in X&&n(28,A=X.country),"debounceSearch"in X&&n(29,z=X.debounceSearch),"enableReverse"in X&&n(5,B=X.enableReverse),"errorMessage"in X&&n(6,Y=X.errorMessage),"filter"in X&&n(30,et=X.filter),"flyTo"in X&&n(31,at=X.flyTo),"fuzzyMatch"in X&&n(32,W=X.fuzzyMatch),"language"in X&&n(33,H=X.language),"limit"in X&&n(34,nt=X.limit),"mapController"in X&&n(35,ut=X.mapController),"minLength"in X&&n(36,_t=X.minLength),"noResultsMessage"in X&&n(7,ct=X.noResultsMessage),"placeholder"in X&&n(8,bt=X.placeholder),"proximity"in X&&n(37,It=X.proximity),"reverseActive"in X&&n(0,Ot=X.reverseActive),"reverseButtonTitle"in X&&n(9,dt=X.reverseButtonTitle),"searchValue"in X&&n(1,Pt=X.searchValue),"showFullGeometry"in X&&n(38,Qt=X.showFullGeometry),"showPlaceType"in X&&n(10,Et=X.showPlaceType),"showResultsWhileTyping"in X&&n(39,oe=X.showResultsWhileTyping),"selectFirst"in X&&n(11,ge=X.selectFirst),"flyToSelected"in X&&n(40,Te=X.flyToSelected),"markerOnSelected"in X&&n(41,Fe=X.markerOnSelected),"types"in X&&n(42,rn=X.types),"excludeTypes"in X&&n(43,En=X.excludeTypes),"zoom"in X&&n(44,Me=X.zoom),"maxZoom"in X&&n(45,Pe=X.maxZoom),"apiUrl"in X&&n(46,Mn=X.apiUrl),"fetchParameters"in X&&n(47,pr=X.fetchParameters),"iconsBaseUrl"in X&&n(12,zn=X.iconsBaseUrl),"adjustUrlQuery"in X&&n(48,jn=X.adjustUrlQuery),"$$scope"in X&&n(58,l=X.$$scope)},e.$$.update=()=>{if(e.$$.dirty[0]&134225920&&setTimeout(()=>{n(16,rs=cn),T&&!cn&&n(1,Pt="")}),e.$$.dirty[0]&16386|e.$$.dirty[1]&32&&Pt.length<_t&&(n(55,Re=void 0),n(14,Vt=void 0),n(18,Wr=void 0),n(54,Ee=Vt)),e.$$.dirty[1]&16777344&&Qt&&Re&&!Re.address&&Re.geometry.type==="Point"&&Re.place_type[0]!=="reverse"&&Ht(Re.id,{byId:!0}).catch(X=>n(18,Wr=X)),e.$$.dirty[1]&50356241&&(ut&&Re&&Re.id!==Cs&&at&&(!Re.bbox||Re.bbox[0]===Re.bbox[2]&&Re.bbox[1]===Re.bbox[3]?ut.flyTo(Re.center,Re.id.startsWith("poi.")||Re.id.startsWith("address.")?Pe:Me):ut.fitBounds(Ww(Re.bbox),50,Pe),n(14,Vt=void 0),n(54,Ee=void 0),n(15,hn=-1)),n(56,Cs=Re==null?void 0:Re.id)),e.$$.dirty[0]&18432&&ge&&Vt!=null&&Vt.length&&n(15,hn=0),e.$$.dirty[0]&2050&&(ge||n(15,hn=-1)),e.$$.dirty[0]&16384|e.$$.dirty[1]&8388608&&Ee!==Vt&&n(54,Ee=void 0),e.$$.dirty[0]&81921|e.$$.dirty[1]&8388624&&ut&&ut.setEventHandler(X=>{switch(X.type){case"mapClick":Ot&&Vi(X.coordinates);break;case"markerClick":{const mt=Vt==null?void 0:Vt.find(ht=>ht.id===X.id);mt&&$t(mt)}break;case"markerMouseEnter":Ee&&n(15,hn=rs?(Vt==null?void 0:Vt.findIndex(mt=>mt.id===X.id))??-1:-1);break;case"markerMouseLeave":Ee&&n(15,hn=-1);break}}),e.$$.dirty[0]&49152&&n(57,r=Vt==null?void 0:Vt[hn]),e.$$.dirty[1]&67133969&&ut&&r&&at&&Te&&ut.flyTo(r.center,r.id.startsWith("poi.")||r.id.startsWith("address.")?Pe:Me),e.$$.dirty[1]&1040&&(Fe||ut==null||ut.setMarkers(void 0,void 0)),e.$$.dirty[1]&75498512&&ut&&Fe&&!Ee&&(ut.setMarkers(r?[r]:void 0,void 0),ut.setSelectedMarker(r?0:-1)),e.$$.dirty[1]&25165840&&ut&&ut.setMarkers(Ee,Re),e.$$.dirty[0]&32768|e.$$.dirty[1]&8388624&&Ee&&ut&&ut.setSelectedMarker(hn),e.$$.dirty[0]&2|e.$$.dirty[1]&16&&ut){const X=is(Pt);ut.setReverseMarker(X?[X.decimalLongitude,X.decimalLatitude]:void 0)}e.$$.dirty[1]&67108864&&mi("select",r),e.$$.dirty[1]&16777216&&mi("pick",Re),e.$$.dirty[0]&81920&&mi("optionsVisibilityChange",rs&&!!Vt),e.$$.dirty[0]&16384&&mi("featuresListed",Vt),e.$$.dirty[1]&8388608&&mi("featuresMarked",Ee),e.$$.dirty[0]&1&&mi("reverseToggle",Ot),e.$$.dirty[0]&2&&mi("queryChange",Pt),e.$$.dirty[0]&1|e.$$.dirty[1]&16&&ut&&ut.indicateReverse(Ot)},[Ot,Pt,p,w,L,B,Y,ct,bt,dt,Et,ge,zn,cn,Vt,hn,rs,Mt,Wr,Hn,Da,fl,dl,zr,$t,c,y,T,A,z,et,at,W,H,nt,ut,_t,It,Qt,oe,Te,Fe,rn,En,Me,Pe,Mn,pr,jn,Cr,qr,Bi,Zt,on,Ee,Re,Cs,r,l,s,Ze,je,xr,Fo,Ge,ca,Tr,it,F,U,Z,Q,gt]}class SN extends Pn{constructor(t){super(),Ln(this,t,wN,xN,vn,{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]}}function n2(e){let t,n,r;return n=new SN({props:{mapController:e[1],apiKey:e[0]}}),{c(){t=ae("div"),nn(n.$$.fragment),zt(t,"class","svelte-ixhnie")},m(s,l){de(s,t,l),$e(n,t,null),r=!0},p(s,l){const p={};l&2&&(p.mapController=s[1]),l&1&&(p.apiKey=s[0]),n.$set(p)},i(s){r||(ee(n.$$.fragment,s),r=!0)},o(s){le(n.$$.fragment,s),r=!1},d(s){s&&fe(t),tn(n)}}}function EN(e){let t,n,r=e[1]&&n2(e);return{c(){r&&r.c(),t=ll()},m(s,l){r&&r.m(s,l),de(s,t,l),n=!0},p(s,[l]){s[1]?r?(r.p(s,l),l&2&&ee(r,1)):(r=n2(s),r.c(),ee(r,1),r.m(t.parentNode,t)):r&&(Wo(),le(r,1,1,()=>{r=null}),Zo())},i(s){n||(ee(r),n=!0)},o(s){le(r),n=!1},d(s){s&&fe(t),r&&r.d(s)}}}function IN(e,t,n){let r,{apiKey:s}=t,{map:l}=t;return e.$$set=p=>{"apiKey"in p&&n(0,s=p.apiKey),"map"in p&&n(2,l=p.map)},e.$$.update=()=>{e.$$.dirty&4&&n(1,r=l?F3(l,Ep):null)},[s,r,l]}class CN extends Pn{constructor(t){super(),Ln(this,t,IN,EN,vn,{apiKey:0,map:2})}}function r2(e){let t,n;return{c(){t=ae("div"),n=Wn(e[0]),zt(t,"class","svelte-1uuov7f")},m(r,s){de(r,t,s),Wt(t,n)},p(r,s){s&1&&Vl(n,r[0])},d(r){r&&fe(t)}}}function TN(e){let t,n=e[0]&&r2(e);return{c(){n&&n.c(),t=ll()},m(r,s){n&&n.m(r,s),de(r,t,s)},p(r,[s]){r[0]?n?n.p(r,s):(n=r2(r),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},i:Oe,o:Oe,d(r){r&&fe(t),n&&n.d(r)}}}function LN(e,t,n){let{loading:r}=t;return e.$$set=s=>{"loading"in s&&n(0,r=s.loading)},[r]}class PN extends Pn{constructor(t){super(),Ln(this,t,LN,TN,vn,{loading:0})}}var uo=63710088e-1,j0={centimeters:uo*100,centimetres:uo*100,degrees:uo/111325,feet:uo*3.28084,inches:uo*39.37,kilometers:uo/1e3,kilometres:uo/1e3,meters:uo,metres:uo,miles:uo/1609.344,millimeters:uo*1e3,millimetres:uo*1e3,nauticalmiles:uo/1852,radians:1,yards:uo*1.0936},MN={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/uo,yards:1.0936133},Yv={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,millimeters:1e6,millimetres:1e6,yards:1.195990046};function oa(e,t,n){n===void 0&&(n={});var r={type:"Feature"};return(n.id===0||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function AN(e,t,n){switch(e){case"Point":return qo(t).geometry;case"LineString":return Us(t).geometry;case"Polygon":return q0(t).geometry;case"MultiPoint":return YE(t).geometry;case"MultiLineString":return XE(t).geometry;case"MultiPolygon":return KE(t).geometry;default:throw new Error(e+" is invalid")}}function qo(e,t,n){if(n===void 0&&(n={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ty(e[0])||!ty(e[1]))throw new Error("coordinates must contain numbers");var r={type:"Point",coordinates:e};return oa(r,t,n)}function kN(e,t,n){return n===void 0&&(n={}),Mc(e.map(function(r){return qo(r,t)}),n)}function q0(e,t,n){n===void 0&&(n={});for(var r=0,s=e;r=0))throw new Error("precision must be a positive number");var n=Math.pow(10,t||0);return Math.round(e*n)/n}function W0(e,t){t===void 0&&(t="kilometers");var n=j0[t];if(!n)throw new Error(t+" units is invalid");return e*n}function Sy(e,t){t===void 0&&(t="kilometers");var n=j0[t];if(!n)throw new Error(t+" units is invalid");return e/n}function zN(e,t){return Id(Sy(e,t))}function FN(e){var t=e%360;return t<0&&(t+=360),t}function Id(e){var t=e%(2*Math.PI);return t*180/Math.PI}function Gs(e){var t=e%360;return t*Math.PI/180}function BN(e,t,n){if(t===void 0&&(t="kilometers"),n===void 0&&(n="kilometers"),!(e>=0))throw new Error("length must be a positive number");return W0(Sy(e,t),n)}function VN(e,t,n){if(t===void 0&&(t="meters"),n===void 0&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var r=Yv[t];if(!r)throw new Error("invalid original units");var s=Yv[n];if(!s)throw new Error("invalid final units");return e/r*s}function ty(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}function Z0(e){return!!e&&e.constructor===Object}function UN(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(e.length!==4&&e.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(t){if(!ty(t))throw new Error("bbox must only contain numbers")})}function GN(e){if(!e)throw new Error("id is required");if(["string","number"].indexOf(typeof e)===-1)throw new Error("id must be a number or a string")}const jN=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:Yv,bearingToAzimuth:FN,convertArea:VN,convertLength:BN,degreesToRadians:Gs,earthRadius:uo,factors:j0,feature:oa,featureCollection:Mc,geometry:AN,geometryCollection:NN,isNumber:ty,isObject:Z0,lengthToDegrees:zN,lengthToRadians:Sy,lineString:Us,lineStrings:RN,multiLineString:XE,multiPoint:YE,multiPolygon:KE,point:qo,points:kN,polygon:q0,polygons:DN,radiansToDegrees:Id,radiansToLength:W0,round:ON,unitsFactors:MN,validateBBox:UN,validateId:GN},Symbol.toStringTag,{value:"Module"}));function Cd(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if(e.type==="Feature"&&e.geometry!==null&&e.geometry.type==="Point")return e.geometry.coordinates;if(e.type==="Point")return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function wp(e){if(Array.isArray(e))return e;if(e.type==="Feature"){if(e.geometry!==null)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function JE(e,t,n){if(n===void 0&&(n={}),n.final===!0)return qN(e,t);var r=Cd(e),s=Cd(t),l=Gs(r[0]),p=Gs(s[0]),c=Gs(r[1]),y=Gs(s[1]),w=Math.sin(p-l)*Math.cos(y),T=Math.cos(c)*Math.sin(y)-Math.sin(c)*Math.cos(y)*Math.cos(p-l);return Id(Math.atan2(w,T))}function qN(e,t){var n=JE(t,e);return n=(n+180)%360,n}function Gf(e,t,n){n===void 0&&(n={});var r=Cd(e),s=Cd(t),l=Gs(s[1]-r[1]),p=Gs(s[0]-r[0]),c=Gs(r[1]),y=Gs(s[1]),w=Math.pow(Math.sin(l/2),2)+Math.pow(Math.sin(p/2),2)*Math.cos(c)*Math.cos(y);return W0(2*Math.atan2(Math.sqrt(w),Math.sqrt(1-w)),n.units)}function i2(e,t,n,r){r===void 0&&(r={});var s=Cd(e),l=Gs(s[0]),p=Gs(s[1]),c=Gs(n),y=Sy(t,r.units),w=Math.asin(Math.sin(p)*Math.cos(y)+Math.cos(p)*Math.sin(y)*Math.cos(c)),T=l+Math.atan2(Math.sin(c)*Math.sin(y)*Math.cos(p),Math.cos(y)-Math.sin(p)*Math.sin(w)),L=Id(T),A=Id(w);return qo([L,A],r.properties)}function qd(e,t,n){if(e!==null)for(var r,s,l,p,c,y,w,T=0,L=0,A,z=e.type,B=z==="FeatureCollection",Y=z==="Feature",et=B?e.features.length:1,at=0;aty||B>w||Y>T){c=L,y=r,w=B,T=Y,l=0;return}var et=Us([c,L],n.properties);if(t(et,r,s,Y,l)===!1)return!1;l++,c=L})===!1)return!1}}})}function JN(e,t,n){var r=n,s=!1;return $E(e,function(l,p,c,y,w){s===!1&&n===void 0?r=l:r=t(r,l,p,c,y,w),s=!0}),r}function tI(e,t){if(!e)throw new Error("geojson is required");Rp(e,function(n,r,s){if(n.geometry!==null){var l=n.geometry.type,p=n.geometry.coordinates;switch(l){case"LineString":if(t(n,r,s,0,0)===!1)return!1;break;case"Polygon":for(var c=0;cs?n:s,w=r>l?r:l;return[p,c,y,w]}var X0={exports:{}},eI={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(kd,function(){function n(W,H,nt,ut,_t){(function ct(bt,It,Ot,dt,Pt){for(;dt>Ot;){if(dt-Ot>600){var Qt=dt-Ot+1,Et=It-Ot+1,oe=Math.log(Qt),ge=.5*Math.exp(2*oe/3),Te=.5*Math.sqrt(oe*ge*(Qt-ge)/Qt)*(Et-Qt/2<0?-1:1),Fe=Math.max(Ot,Math.floor(It-Et*ge/Qt+Te)),rn=Math.min(dt,Math.floor(It+(Qt-Et)*ge/Qt+Te));ct(bt,It,Fe,rn,Pt)}var En=bt[It],Me=Ot,Pe=dt;for(r(bt,Ot,It),Pt(bt[dt],En)>0&&r(bt,Ot,dt);Me0;)Pe--}Pt(bt[Ot],En)===0?r(bt,Ot,Pe):r(bt,++Pe,dt),Pe<=It&&(Ot=Pe+1),It<=Pe&&(dt=Pe-1)}})(W,H,nt||0,ut||W.length-1,_t||s)}function r(W,H,nt){var ut=W[H];W[H]=W[nt],W[nt]=ut}function s(W,H){return WH?1:0}var l=function(W){W===void 0&&(W=9),this._maxEntries=Math.max(4,W),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function p(W,H,nt){if(!nt)return H.indexOf(W);for(var ut=0;ut=W.minX&&H.maxY>=W.minY}function et(W){return{children:W,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function at(W,H,nt,ut,_t){for(var ct=[H,nt];ct.length;)if(!((nt=ct.pop())-(H=ct.pop())<=ut)){var bt=H+Math.ceil((nt-H)/ut/2)*ut;n(W,bt,H,nt,_t),ct.push(H,bt,bt,nt)}}return l.prototype.all=function(){return this._all(this.data,[])},l.prototype.search=function(W){var H=this.data,nt=[];if(!Y(W,H))return nt;for(var ut=this.toBBox,_t=[];H;){for(var ct=0;ct=0&&_t[H].children.length>this._maxEntries;)this._split(_t,H),H--;this._adjustParentBBoxes(ut,_t,H)},l.prototype._split=function(W,H){var nt=W[H],ut=nt.children.length,_t=this._minEntries;this._chooseSplitAxis(nt,_t,ut);var ct=this._chooseSplitIndex(nt,_t,ut),bt=et(nt.children.splice(ct,nt.children.length-ct));bt.height=nt.height,bt.leaf=nt.leaf,c(nt,this.toBBox),c(bt,this.toBBox),H?W[H-1].children.push(bt):this._splitRoot(nt,bt)},l.prototype._splitRoot=function(W,H){this.data=et([W,H]),this.data.height=W.height+1,this.data.leaf=!1,c(this.data,this.toBBox)},l.prototype._chooseSplitIndex=function(W,H,nt){for(var ut,_t,ct,bt,It,Ot,dt,Pt=1/0,Qt=1/0,Et=H;Et<=nt-H;Et++){var oe=y(W,0,Et,this.toBBox),ge=y(W,Et,nt,this.toBBox),Te=(_t=oe,ct=ge,bt=void 0,It=void 0,Ot=void 0,dt=void 0,bt=Math.max(_t.minX,ct.minX),It=Math.max(_t.minY,ct.minY),Ot=Math.min(_t.maxX,ct.maxX),dt=Math.min(_t.maxY,ct.maxY),Math.max(0,Ot-bt)*Math.max(0,dt-It)),Fe=A(oe)+A(ge);Te=H;Pt--){var Qt=W.children[Pt];w(bt,W.leaf?_t(Qt):Qt),It+=z(bt)}return It},l.prototype._adjustParentBBoxes=function(W,H,nt){for(var ut=nt;ut>=0;ut--)w(H[ut],W)},l.prototype._condense=function(W){for(var H=W.length-1,nt=void 0;H>=0;H--)W[H].children.length===0?H>0?(nt=W[H-1].children).splice(nt.indexOf(W[H]),1):this.clear():c(W[H],this.toBBox)},l})})(eI);var o4=eI.exports;const s4=ny(jN),a4=ny(e4),l4=ny(WD);var Za=o4,nI=s4,rI=a4,Uh=l4.default,u4=rI.featureEach;rI.coordEach;nI.polygon;var s2=nI.featureCollection;function iI(e){var t=new Za(e);return t.insert=function(n){if(n.type!=="Feature")throw new Error("invalid feature");return n.bbox=n.bbox?n.bbox:Uh(n),Za.prototype.insert.call(this,n)},t.load=function(n){var r=[];return Array.isArray(n)?n.forEach(function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:Uh(s),r.push(s)}):u4(n,function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:Uh(s),r.push(s)}),Za.prototype.load.call(this,r)},t.remove=function(n,r){if(n.type!=="Feature")throw new Error("invalid feature");return n.bbox=n.bbox?n.bbox:Uh(n),Za.prototype.remove.call(this,n,r)},t.clear=function(){return Za.prototype.clear.call(this)},t.search=function(n){var r=Za.prototype.search.call(this,this.toBBox(n));return s2(r)},t.collides=function(n){return Za.prototype.collides.call(this,this.toBBox(n))},t.all=function(){var n=Za.prototype.all.call(this);return s2(n)},t.toJSON=function(){return Za.prototype.toJSON.call(this)},t.fromJSON=function(n){return Za.prototype.fromJSON.call(this,n)},t.toBBox=function(n){var r;if(n.bbox)r=n.bbox;else if(Array.isArray(n)&&n.length===4)r=n;else if(Array.isArray(n)&&n.length===6)r=[n[0],n[1],n[3],n[4]];else if(n.type==="Feature")r=Uh(n);else if(n.type==="FeatureCollection")r=Uh(n);else throw new Error("invalid geojson");return{minX:r[0],minY:r[1],maxX:r[2],maxY:r[3]}},t}X0.exports=iI;X0.exports.default=iI;var c4=X0.exports;const h4=$v(c4);function p4(e,t){var n={},r=[];if(e.type==="LineString"&&(e=oa(e)),t.type==="LineString"&&(t=oa(t)),e.type==="Feature"&&t.type==="Feature"&&e.geometry!==null&&t.geometry!==null&&e.geometry.type==="LineString"&&t.geometry.type==="LineString"&&e.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var s=a2(e,t);return s&&r.push(s),Mc(r)}var l=h4();return l.load(o2(t)),ey(o2(e),function(p){ey(l.search(p),function(c){var y=a2(p,c);if(y){var w=wp(y).join(",");n[w]||(n[w]=!0,r.push(y))}})}),Mc(r)}function a2(e,t){var n=wp(e),r=wp(t);if(n.length!==2)throw new Error(" line1 must only contain 2 coordinates");if(r.length!==2)throw new Error(" line2 must only contain 2 coordinates");var s=n[0][0],l=n[0][1],p=n[1][0],c=n[1][1],y=r[0][0],w=r[0][1],T=r[1][0],L=r[1][1],A=(L-w)*(p-s)-(T-y)*(c-l),z=(T-y)*(l-w)-(L-w)*(s-y),B=(p-s)*(l-w)-(c-l)*(s-y);if(A===0)return null;var Y=z/A,et=B/A;if(Y>=0&&Y<=1&&et>=0&&et<=1){var at=s+Y*(p-s),W=l+Y*(c-l);return qo([at,W])}return null}function f4(e,t,n){n===void 0&&(n={});var r=qo([1/0,1/0],{dist:1/0}),s=0;return Rp(e,function(l){for(var p=wp(l),c=0;c0&&(et=Y.features[0],et.properties.dist=Gf(t,et,n),et.properties.location=s+Gf(y,et,n)),y.properties.dist{if(this.active&&!this.dragFrom)this.recalculateHovering(t);else if(this.active&&this.dragFrom){if(this.hover=="polygon"){let n=this.dragFrom[0]-t.lngLat.lng,r=this.dragFrom[1]-t.lngLat.lat;for(let s of this.points)s[0]-=n,s[1]-=r}else this.points[this.hover]=t.lngLat.toArray();this.dragFrom=t.lngLat.toArray(),this.redraw()}});ai(this,"onClick",t=>{if(this.beforeUpdate(),this.active&&this.cursor){let n=[];if(l2(this.points).forEach((r,s)=>{n.push([s+1,f4(r,this.cursor).properties.dist])}),n.sort((r,s)=>r[1]-s[1]),n.length>0){let r=n[0][0];this.points.splice(r,0,this.cursor.geometry.coordinates),this.hover=r}else this.points.push(this.cursor.geometry.coordinates),this.hover=this.points.length-1;this.redraw(),this.pointsUpdated()}else this.active&&typeof this.hover=="number"&&(this.points.splice(this.hover,1),this.hover=null,this.redraw(),this.pointsUpdated(),this.recalculateHovering(t))});ai(this,"onDoubleClick",t=>{this.active&&(t.preventDefault(),this.cursor=iv(t.lngLat.toArray()),this.onClick(t),this.finish())});ai(this,"onMouseDown",t=>{this.active&&!this.dragFrom&&this.hover!=null&&(t.preventDefault(),this.cursor=null,this.dragFrom=t.lngLat.toArray(),this.beforeUpdate(),this.redraw())});ai(this,"onMouseUp",()=>{this.active&&this.dragFrom&&(this.dragFrom=null,this.redraw(),this.pointsUpdated())});ai(this,"onKeypress",t=>{this.active&&(t.key=="Enter"?(t.stopPropagation(),this.finish()):t.key=="z"&&t.ctrlKey&&this.undo())});ai(this,"onKeyDown",t=>{this.active&&t.key=="Escape"&&(t.stopPropagation(),this.cancel())});this.map=t,this.active=!1,this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[],this.points=[],this.cursor=null,this.hover=null,this.dragFrom=null,this.previousStates=[],this.map.on("mousemove",this.onMouseMove),this.map.on("click",this.onClick),this.map.on("dblclick",this.onDoubleClick),this.map.on("mousedown",this.onMouseDown),this.map.on("mouseup",this.onMouseUp),document.addEventListener("keypress",this.onKeypress),document.addEventListener("keydown",this.onKeyDown)}tearDown(){this.map.off("mousemove",this.onMouseMove),this.map.off("click",this.onClick),this.map.off("dblclick",this.onDoubleClick),this.map.off("mousedown",this.onMouseDown),this.map.off("mouseup",this.onMouseUp),document.removeEventListener("keypress",this.onKeypress),document.removeEventListener("keydown",this.onKeyDown)}finish(){let t=this.polygonFeature();if(t)for(let n of this.eventListenersSuccess)n(t);else for(let n of this.eventListenersFailure)n();this.stop()}cancel(){for(let t of this.eventListenersFailure)t();this.stop()}addEventListenerSuccess(t){this.eventListenersSuccess.push(t)}addEventListenerUpdated(t){this.eventListenersUpdated.push(t)}addEventListenerFailure(t){this.eventListenersFailure.push(t)}clearEventListeners(){this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[]}startNew(){this.active=!0,this.map.doubleClickZoom.disable()}editExisting(t){this.active=!0,this.map.doubleClickZoom.disable(),this.points=JSON.parse(JSON.stringify(t.geometry.coordinates[0])),this.points.pop(),this.redraw()}stop(){this.map.doubleClickZoom.enable(),this.points=[],this.cursor=null,this.active=!1,this.hover=null,this.dragFrom=null,this.previousStates=[],this.redraw(),this.map.getCanvas().style.cursor="inherit"}undo(){this.dragFrom!=null||this.previousStates.length==0||(this.points=this.previousStates.pop(),this.hover=null,this.redraw())}redraw(){let t={type:"FeatureCollection",features:[]};this.points.forEach((s,l)=>{let p=iv(s);p.properties.hover=this.hover==l,p.properties.idx=l,t.features.push(p)}),t.features=t.features.concat(l2(this.points));let n=this.polygonFeature();n&&(n.properties.hover=this.hover=="polygon",t.features.push(n)),sI.set(t);let r="crosshair";this.hover!=null&&(r=this.dragFrom?"grabbing":"pointer"),this.map.getCanvas().style.cursor=r,aI.set(this.previousStates.length)}pointsUpdated(){let t=this.polygonFeature();if(t)for(let n of this.eventListenersUpdated)n(t)}recalculateHovering(t){this.cursor=null,this.hover=null;for(let n of this.map.queryRenderedFeatures(t.point,{layers:["edit-polygon-fill","edit-polygon-vertices"]}))if(n.geometry.type=="Polygon"){this.hover="polygon";break}else if(n.geometry.type=="Point"&&Object.hasOwn(n.properties,"idx")){this.hover=n.properties.idx;break}this.hover==null&&(this.cursor=iv(t.lngLat.toArray())),this.redraw()}polygonFeature(){if(this.points.length<3)return null;let t=this.points.map(oI),n=[JSON.parse(JSON.stringify(t))];return n[0].push(JSON.parse(JSON.stringify(n[0][0]))),{type:"Feature",geometry:{type:"Polygon",coordinates:n},properties:{}}}beforeUpdate(){this.previousStates.push(JSON.parse(JSON.stringify(this.points))),this.previousStates.length>y4&&this.previousStates.shift()}}function l2(e){let t=[];for(let n=0;n=3&&t.push({type:"Feature",geometry:{type:"LineString",coordinates:[e[e.length-1],e[0]]},properties:{}}),t}function v4(e){let t,n,r;return{c(){t=Wn("Undo ("),n=Wn(e[1]),r=Wn(")")},m(s,l){de(s,t,l),de(s,n,l),de(s,r,l)},p(s,l){l&2&&Vl(n,s[1])},d(s){s&&(fe(t),fe(n),fe(r))}}}function b4(e){let t;return{c(){t=Wn("Undo")},m(n,r){de(n,t,r)},p:Oe,d(n){n&&fe(t)}}}function x4(e){let t,n,r,s,l,p,c,y,w,T,L;function A(Y,et){return Y[1]==0?b4:v4}let z=A(e),B=z(e);return{c(){t=ae("div"),n=ae("button"),n.textContent="Finish",r=Ve(),s=ae("button"),s.textContent="Cancel",l=Ve(),p=ae("button"),B.c(),y=Ve(),w=ae("ul"),w.innerHTML=`
  • Click +`)}return e.toString()};wi.prototype.computeEdgeEndLabels=function(e){for(var t=this.iterator();t.hasNext();){var n=t.next();n.computeLabel(e)}};wi.prototype.computeLabelling=function(e){var t=this;this.computeEdgeEndLabels(e[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var n=[!1,!1],r=this.iterator();r.hasNext();)for(var s=r.next(),l=s.getLabel(),p=0;p<2;p++)l.isLine(p)&&l.getLocation(p)===Ct.BOUNDARY&&(n[p]=!0);for(var c=this.iterator();c.hasNext();)for(var y=c.next(),w=y.getLabel(),T=0;T<2;T++)if(w.isAnyNull(T)){var L=Ct.NONE;if(n[T])L=Ct.EXTERIOR;else{var A=y.getCoordinate();L=t.getLocation(T,A,e)}w.setAllLocationsIfNull(T,L)}};wi.prototype.getDegree=function(){return this._edgeMap.size()};wi.prototype.insertEdgeEnd=function(e,t){this._edgeMap.put(e,t),this._edgeList=null};wi.prototype.interfaces_=function(){return[]};wi.prototype.getClass=function(){return wi};var s3=function(e){function t(){e.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var n=this;this.getResultAreaEdges();for(var r=null,s=null,l=this._SCANNING_FOR_INCOMING,p=0;p=0;l--){var p=n._edgeList.get(l),c=p.getSym();s===null&&(s=c),r!==null&&c.setNext(r),r=p}s.setNext(r)},t.prototype.computeDepths=function(){var n=this;if(arguments.length===1){var r=arguments[0],s=this.findIndex(r),l=r.getDepth(Xt.LEFT),p=r.getDepth(Xt.RIGHT),c=this.computeDepths(s+1,this._edgeList.size(),l),y=this.computeDepths(0,s,c);if(y!==p)throw new il("depth mismatch at "+r.getCoordinate())}else if(arguments.length===3){for(var w=arguments[0],T=arguments[1],L=arguments[2],A=L,z=w;z=0;c--){var y=r._resultAreaEdgeList.get(c),w=y.getSym();switch(s===null&&y.getEdgeRing()===n&&(s=y),p){case r._SCANNING_FOR_INCOMING:if(w.getEdgeRing()!==n)continue;l=w,p=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(y.getEdgeRing()!==n)continue;l.setNextMin(y),p=r._SCANNING_FOR_INCOMING;break}}p===this._LINKING_TO_OUTGOING&&(Ye.isTrue(s!==null,"found null for first outgoing dirEdge"),Ye.isTrue(s.getEdgeRing()===n,"unable to link last incoming dirEdge"),l.setNextMin(s))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var n=0,r=this.iterator();r.hasNext();){var s=r.next();s.isInResult()&&n++}return n}else if(arguments.length===1){for(var l=arguments[0],p=0,c=this.iterator();c.hasNext();){var y=c.next();y.getEdgeRing()===l&&p++}return p}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var n=Ct.NONE,r=this.iterator();r.hasNext();){var s=r.next(),l=s.getSym();if(!s.isLineEdge()){if(s.isInResult()){n=Ct.INTERIOR;break}if(l.isInResult()){n=Ct.EXTERIOR;break}}}if(n===Ct.NONE)return null;for(var p=n,c=this.iterator();c.hasNext();){var y=c.next(),w=y.getSym();y.isLineEdge()?y.getEdge().setCovered(p===Ct.INTERIOR):(y.isInResult()&&(p=Ct.EXTERIOR),w.isInResult()&&(p=Ct.INTERIOR))}},t.prototype.computeLabelling=function(n){var r=this;e.prototype.computeLabelling.call(this,n),this._label=new Tn(Ct.NONE);for(var s=this.iterator();s.hasNext();)for(var l=s.next(),p=l.getEdge(),c=p.getLabel(),y=0;y<2;y++){var w=c.getLocation(y);(w===Ct.INTERIOR||w===Ct.BOUNDARY)&&r._label.setLocation(y,Ct.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(wi),vE=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createNode=function(n){return new xy(n,new s3)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(lp),Wl=function e(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=e.orientation(t)};Wl.prototype.compareTo=function(e){var t=e,n=Wl.compareOriented(this._pts,this._orientation,t._pts,t._orientation);return n};Wl.prototype.interfaces_=function(){return[es]};Wl.prototype.getClass=function(){return Wl};Wl.orientation=function(e){return un.increasingDirection(e)===1};Wl.compareOriented=function(e,t,n,r){for(var s=t?1:-1,l=r?1:-1,p=t?e.length:-1,c=r?n.length:-1,y=t?0:e.length-1,w=r?0:n.length-1;;){var T=e[y].compareTo(n[w]);if(T!==0)return T;y+=s,w+=l;var L=y===p,A=w===c;if(L&&!A)return-1;if(!L&&A)return 1;if(L&&A)return 0}};var xs=function(){this._edges=new ie,this._ocaMap=new bi};xs.prototype.print=function(e){var t=this;e.print("MULTILINESTRING ( ");for(var n=0;n0&&e.print(","),e.print("(");for(var s=r.getCoordinates(),l=0;l0&&e.print(","),e.print(s[l].x+" "+s[l].y);e.println(")")}e.print(") ")};xs.prototype.addAll=function(e){for(var t=this,n=e.iterator();n.hasNext();)t.add(n.next())};xs.prototype.findEdgeIndex=function(e){for(var t=this,n=0;n0||!t.coord.equals2D(s);l||r--;var p=new Array(r).fill(null),c=0;p[c++]=new St(e.coord);for(var y=e.segmentIndex+1;y<=t.segmentIndex;y++)p[c++]=n.edge.pts[y];return l&&(p[c]=t.coord),new Zm(p,new Tn(this.edge._label))};Ta.prototype.add=function(e,t,n){var r=new ea(e,t,n),s=this._nodeMap.get(r);return s!==null?s:(this._nodeMap.put(r,r),r)};Ta.prototype.isIntersection=function(e){for(var t=this.iterator();t.hasNext();){var n=t.next();if(n.coord.equals(e))return!0}return!1};Ta.prototype.interfaces_=function(){return[]};Ta.prototype.getClass=function(){return Ta};var Mu=function(){};Mu.prototype.getChainStartIndices=function(e){var t=this,n=0,r=new ie;r.add(new Ys(n));do{var s=t.findChainEnd(e,n);r.add(new Ys(s)),n=s}while(nn?t:n};sl.prototype.getMinX=function(e){var t=this.pts[this.startIndex[e]].x,n=this.pts[this.startIndex[e+1]].x;return tn&&(s=1),e._depth[t][r]=s}}};hi.prototype.getDelta=function(e){return this._depth[e][Xt.RIGHT]-this._depth[e][Xt.LEFT]};hi.prototype.getLocation=function(e,t){return this._depth[e][t]<=0?Ct.EXTERIOR:Ct.INTERIOR};hi.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]};hi.prototype.add=function(){var e=this;if(arguments.length===1)for(var t=arguments[0],n=0;n<2;n++)for(var r=1;r<3;r++){var s=t.getLocation(n,r);(s===Ct.EXTERIOR||s===Ct.INTERIOR)&&(e.isNull(n,r)?e._depth[n][r]=hi.depthAtLocation(s):e._depth[n][r]+=hi.depthAtLocation(s))}else if(arguments.length===3){var l=arguments[0],p=arguments[1],c=arguments[2];c===Ct.INTERIOR&&this._depth[l][p]++}};hi.prototype.interfaces_=function(){return[]};hi.prototype.getClass=function(){return hi};hi.depthAtLocation=function(e){return e===Ct.EXTERIOR?0:e===Ct.INTERIOR?1:hi.NULL_VALUE};bE.NULL_VALUE.get=function(){return-1};Object.defineProperties(hi,bE);var Zm=function(e){function t(){if(e.call(this),this.pts=null,this._env=null,this.eiList=new Ta(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new hi,this._depthDelta=0,arguments.length===1){var n=arguments[0];t.call(this,n,null)}else if(arguments.length===2){var r=arguments[0],s=arguments[1];this.pts=r,this._label=s}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var n=new Array(2).fill(null);n[0]=this.pts[0],n[1]=this.pts[1];var r=new t(n,Tn.toLineLabel(this._label));return r},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(n){this._isIsolated=n},t.prototype.setName=function(n){this._name=n},t.prototype.equals=function(n){var r=this;if(!(n instanceof t))return!1;var s=n;if(this.pts.length!==s.pts.length)return!1;for(var l=!0,p=!0,c=this.pts.length,y=0;y0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}},t.prototype.print=function(n){var r=this;n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var s=0;s0&&n.print(","),n.print(r.pts[s].x+" "+r.pts[s].y);n.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(n){t.updateIM(this._label,n)},t.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(n){var r=this;n.print("edge "+this._name+": ");for(var s=this.pts.length-1;s>=0;s--)n.print(r.pts[s]+" ");n.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new sl(this)),this._mce},t.prototype.getEnvelope=function(){var n=this;if(this._env===null){this._env=new Se;for(var r=0;r0&&r.append(","),r.append(n.pts[s].x+" "+n.pts[s].y);return r.append(") "+this._label+" "+this._depthDelta),r.toString()},t.prototype.isPointwiseEqual=function(n){var r=this;if(this.pts.length!==n.pts.length)return!1;for(var s=0;sr||this._maxyl;if(p)return!1;var c=this.intersectsToleranceSquare(e,t);return Ye.isTrue(!(p&&c),"Found bad envelope test"),c};Ji.prototype.initCorners=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 St(this._maxx,this._maxy),this._corner[1]=new St(this._minx,this._maxy),this._corner[2]=new St(this._minx,this._miny),this._corner[3]=new St(this._maxx,this._miny)};Ji.prototype.intersects=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))};Ji.prototype.scale=function(e){return Math.round(e*this._scaleFactor)};Ji.prototype.getCoordinate=function(){return this._originalPt};Ji.prototype.copyScaled=function(e,t){t.x=this.scale(e.x),t.y=this.scale(e.y)};Ji.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var e=Ji.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};Ji.prototype.intersectsPixelClosure=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()))};Ji.prototype.intersectsToleranceSquare=function(e,t){var n=!1,r=!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()&&(r=!0),this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),this._li.isProper())||n&&r||e.equals(this._pt)||t.equals(this._pt))};Ji.prototype.addSnappedNode=function(e,t){var n=e.getCoordinate(t),r=e.getCoordinate(t+1);return this.intersects(n,r)?(e.addIntersection(this.getCoordinate(),t),!0):!1};Ji.prototype.interfaces_=function(){return[]};Ji.prototype.getClass=function(){return Ji};wE.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75};Object.defineProperties(Ji,wE);var xd=function(){this.tempEnv1=new Se,this.selectedSegment=new Ie};xd.prototype.select=function(){if(arguments.length!==1&&arguments.length===2){var e=arguments[0],t=arguments[1];e.getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}};xd.prototype.interfaces_=function(){return[]};xd.prototype.getClass=function(){return xd};var pp=function(){this._index=null;var e=arguments[0];this._index=e},SE={HotPixelSnapAction:{configurable:!0}};pp.prototype.snap=function(){if(arguments.length===1){var e=arguments[0];return this.snap(e,null,-1)}else if(arguments.length===3){var t=arguments[0],n=arguments[1],r=arguments[2],s=t.getSafeEnvelope(),l=new EE(t,n,r);return this._index.query(s,{interfaces_:function(){return[jl]},visitItem:function(p){var c=p;c.select(s,l)}}),l.isNodeAdded()}};pp.prototype.interfaces_=function(){return[]};pp.prototype.getClass=function(){return pp};SE.HotPixelSnapAction.get=function(){return EE};Object.defineProperties(pp,SE);var EE=function(e){function t(){e.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var n=arguments[0],r=arguments[1],s=arguments[2];this._hotPixel=n,this._parentEdge=r,this._hotPixelVertexIndex=s}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1],s=n.getContext();if(this._parentEdge!==null&&s===this._parentEdge&&r===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(s,r)}else return e.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(xd),wc=function(){this._li=null,this._interiorIntersections=null;var e=arguments[0];this._li=e,this._interiorIntersections=new ie};wc.prototype.processIntersections=function(e,t,n,r){var s=this;if(e===n&&t===r)return null;var l=e.getCoordinates()[t],p=e.getCoordinates()[t+1],c=n.getCoordinates()[r],y=n.getCoordinates()[r+1];if(this._li.computeIntersection(l,p,c,y),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var w=0;w=0;t--){try{e.bufferReducedPrecision(t)}catch(l){if(l instanceof il)e._saveException=l;else throw l}finally{}if(e._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var n=arguments[0],r=ci.precisionScaleFactor(this._argGeom,this._distance,n),s=new wn(r);this.bufferFixedPrecision(s)}};ci.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var e=this._argGeom.getFactory().getPrecisionModel();e.getType()===wn.FIXED?this.bufferFixedPrecision(e):this.bufferReducedPrecision()};ci.prototype.setQuadrantSegments=function(e){this._bufParams.setQuadrantSegments(e)};ci.prototype.bufferOriginalPrecision=function(){try{var e=new ki(this._bufParams);this._resultGeometry=e.buffer(this._argGeom,this._distance)}catch(t){if(t instanceof nl)this._saveException=t;else throw t}finally{}};ci.prototype.getResultGeometry=function(e){return this._distance=e,this.computeGeometry(),this._resultGeometry};ci.prototype.setEndCapStyle=function(e){this._bufParams.setEndCapStyle(e)};ci.prototype.interfaces_=function(){return[]};ci.prototype.getClass=function(){return ci};ci.bufferOp=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=new ci(e),r=n.getResultGeometry(t);return r}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ke&&typeof arguments[1]=="number"){var s=arguments[0],l=arguments[1],p=arguments[2],c=new ci(s);c.setQuadrantSegments(p);var y=c.getResultGeometry(l);return y}else if(arguments[2]instanceof xn&&arguments[0]instanceof ke&&typeof arguments[1]=="number"){var w=arguments[0],T=arguments[1],L=arguments[2],A=new ci(w,L),z=A.getResultGeometry(T);return z}}else if(arguments.length===4){var B=arguments[0],Y=arguments[1],et=arguments[2],at=arguments[3],W=new ci(B);W.setQuadrantSegments(et),W.setEndCapStyle(at);var H=W.getResultGeometry(Y);return H}};ci.precisionScaleFactor=function(e,t,n){var r=e.getEnvelopeInternal(),s=ko.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY())),l=t>0?t:0,p=s+2*l,c=Math.trunc(Math.log(p)/Math.log(10)+1),y=n-c,w=Math.pow(10,y);return w};kp.CAP_ROUND.get=function(){return xn.CAP_ROUND};kp.CAP_BUTT.get=function(){return xn.CAP_FLAT};kp.CAP_FLAT.get=function(){return xn.CAP_FLAT};kp.CAP_SQUARE.get=function(){return xn.CAP_SQUARE};kp.MAX_PRECISION_DIGITS.get=function(){return 12};Object.defineProperties(ci,kp);var Pi=function(){this._pt=[new St,new St],this._distance=Ue.NaN,this._isNull=!0};Pi.prototype.getCoordinates=function(){return this._pt};Pi.prototype.getCoordinate=function(e){return this._pt[e]};Pi.prototype.setMinimum=function(){if(arguments.length===1){var e=arguments[0];this.setMinimum(e._pt[0],e._pt[1])}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(t,n),null;var r=t.distance(n);rthis._distance&&this.initialize(t,n,r)}};Pi.prototype.interfaces_=function(){return[]};Pi.prototype.getClass=function(){return Pi};var _a=function(){};_a.prototype.interfaces_=function(){return[]};_a.prototype.getClass=function(){return _a};_a.computeDistance=function(){if(arguments[2]instanceof Pi&&arguments[0]instanceof cr&&arguments[1]instanceof St)for(var e=arguments[0],t=arguments[1],n=arguments[2],r=e.getCoordinates(),s=new Ie,l=0;l0||this._isIn?Ct.INTERIOR:Ct.EXTERIOR)};ws.prototype.interfaces_=function(){return[]};ws.prototype.getClass=function(){return ws};var Mi=function e(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],n=arguments[1];e.call(this,t,e.INSIDE_AREA,n)}else if(arguments.length===3){var r=arguments[0],s=arguments[1],l=arguments[2];this._component=r,this._segIndex=s,this._pt=l}},IE={INSIDE_AREA:{configurable:!0}};Mi.prototype.isInsideArea=function(){return this._segIndex===Mi.INSIDE_AREA};Mi.prototype.getCoordinate=function(){return this._pt};Mi.prototype.getGeometryComponent=function(){return this._component};Mi.prototype.getSegmentIndex=function(){return this._segIndex};Mi.prototype.interfaces_=function(){return[]};Mi.prototype.getClass=function(){return Mi};IE.INSIDE_AREA.get=function(){return-1};Object.defineProperties(Mi,IE);var Fl=function(e){this._pts=e||null};Fl.prototype.filter=function(e){e instanceof fo&&this._pts.add(e)};Fl.prototype.interfaces_=function(){return[Js]};Fl.prototype.getClass=function(){return Fl};Fl.getPoints=function(){if(arguments.length===1){var e=arguments[0];return e instanceof fo?bs.singletonList(e):Fl.getPoints(e,new ie)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];return t instanceof fo?n.add(t):t instanceof Ri&&t.apply(new Fl(n)),n}};var Ec=function(){this._locations=null;var e=arguments[0];this._locations=e};Ec.prototype.filter=function(e){(e instanceof fo||e instanceof cr||e instanceof Nr)&&this._locations.add(new Mi(e,0,e.getCoordinate()))};Ec.prototype.interfaces_=function(){return[Js]};Ec.prototype.getClass=function(){return Ec};Ec.getLocations=function(e){var t=new ie;return e.apply(new Ec(t)),t};var fi=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new ws,this._minDistanceLocation=null,this._minDistance=Ue.MAX_VALUE,arguments.length===2){var e=arguments[0],t=arguments[1];this._geom=[e,t],this._terminateDistance=0}else if(arguments.length===3){var n=arguments[0],r=arguments[1],s=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=s}};fi.prototype.computeContainmentDistance=function(){var e=this;if(arguments.length===0){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(arguments.length===2){var n=arguments[0],r=arguments[1],s=1-n,l=tl.getPolygons(this._geom[n]);if(l.size()>0){var p=Ec.getLocations(this._geom[s]);if(this.computeContainmentDistance(p,l,r),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[s]=r[0],this._minDistanceLocation[n]=r[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&De(arguments[0],ms)&&De(arguments[1],ms)){for(var c=arguments[0],y=arguments[1],w=arguments[2],T=0;Tthis._minDistance)return null;for(var s=t.getCoordinates(),l=n.getCoordinate(),p=0;pthis._minDistance)return null;for(var z=T.getCoordinates(),B=L.getCoordinates(),Y=0;Ythis._distance&&this.initialize(t,n,r)}};vi.prototype.interfaces_=function(){return[]};vi.prototype.getClass=function(){return vi};var Vs=function(){};Vs.prototype.interfaces_=function(){return[]};Vs.prototype.getClass=function(){return Vs};Vs.computeDistance=function(){if(arguments[2]instanceof vi&&arguments[0]instanceof cr&&arguments[1]instanceof St)for(var e=arguments[0],t=arguments[1],n=arguments[2],r=new Ie,s=e.getCoordinates(),l=0;l1||e<=0)throw new Qn("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=e};Yo.prototype.compute=function(e,t){this.computeOrientedDistance(e,t,this._ptDist),this.computeOrientedDistance(t,e,this._ptDist)};Yo.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()};Yo.prototype.computeOrientedDistance=function(e,t,n){var r=new Ic(t);if(e.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var s=new Xl(t,this._densifyFrac);e.apply(s),n.setMaximum(s.getMaxPointDistance())}};Yo.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()};Yo.prototype.interfaces_=function(){return[]};Yo.prototype.getClass=function(){return Yo};Yo.distance=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=new Yo(e,t);return n.distance()}else if(arguments.length===3){var r=arguments[0],s=arguments[1],l=arguments[2],p=new Yo(r,s);return p.setDensifyFraction(l),p.distance()}};O0.MaxPointDistanceFilter.get=function(){return Ic};O0.MaxDensifiedByFractionDistanceFilter.get=function(){return Xl};Object.defineProperties(Yo,O0);var Ic=function(){this._maxPtDist=new vi,this._minPtDist=new vi,this._euclideanDist=new Vs,this._geom=null;var e=arguments[0];this._geom=e};Ic.prototype.filter=function(e){this._minPtDist.initialize(),Vs.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)};Ic.prototype.getMaxPointDistance=function(){return this._maxPtDist};Ic.prototype.interfaces_=function(){return[Sa]};Ic.prototype.getClass=function(){return Ic};var Xl=function(){this._maxPtDist=new vi,this._minPtDist=new vi,this._geom=null,this._numSubSegs=0;var e=arguments[0],t=arguments[1];this._geom=e,this._numSubSegs=Math.trunc(Math.round(1/t))};Xl.prototype.filter=function(e,t){var n=this;if(t===0)return null;for(var r=e.getCoordinate(t-1),s=e.getCoordinate(t),l=(s.x-r.x)/this._numSubSegs,p=(s.y-r.y)/this._numSubSegs,c=0;cn){this._isValid=!1;var s=r.getCoordinates();this._errorLocation=s[1],this._errorIndicator=e.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+ys.toLineString(s[0],s[1])+")"}};co.prototype.isValid=function(){var e=Math.abs(this._bufDistance),t=co.MAX_DISTANCE_DIFF_FRAC*e;return this._minValidDistance=e-t,this._maxValidDistance=e+t,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),co.VERBOSE&&pi.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)};co.prototype.checkNegativeValid=function(){if(!(this._input instanceof Nr||this._input instanceof xa||this._input instanceof Ri))return null;var e=this.getPolygonLines(this._input);if(this.checkMinimumDistance(e,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(e,this._result,this._maxValidDistance)};co.prototype.getErrorIndicator=function(){return this._errorIndicator};co.prototype.checkMinimumDistance=function(e,t,n){var r=new fi(e,t,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound0&&e>t&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&e=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")};di.prototype.report=function(e){if(!di.VERBOSE)return null;pi.out.println("Check "+e+": "+(this._isValid?"passed":"FAILED"))};di.prototype.getErrorMessage=function(){return this._errorMsg};di.prototype.interfaces_=function(){return[]};di.prototype.getClass=function(){return di};di.isValidMsg=function(e,t,n){var r=new di(e,t,n);return r.isValid()?null:r.getErrorMessage()};di.isValid=function(e,t,n){var r=new di(e,t,n);return!!r.isValid()};F0.VERBOSE.get=function(){return!1};F0.MAX_ENV_DIFF_FRAC.get=function(){return .012};Object.defineProperties(di,F0);var ra=function(){this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};ra.prototype.getCoordinates=function(){return this._pts};ra.prototype.size=function(){return this._pts.length};ra.prototype.getCoordinate=function(e){return this._pts[e]};ra.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};ra.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:bc.octant(this.getCoordinate(e),this.getCoordinate(e+1))};ra.prototype.setData=function(e){this._data=e};ra.prototype.getData=function(){return this._data};ra.prototype.toString=function(){return ys.toLineString(new yr(this._pts))};ra.prototype.interfaces_=function(){return[Ca]};ra.prototype.getClass=function(){return ra};var ii=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new ie,this._intersectionCount=0,this._keepIntersections=!0;var e=arguments[0];this._li=e,this._interiorIntersection=null};ii.prototype.getInteriorIntersection=function(){return this._interiorIntersection};ii.prototype.setCheckEndSegmentsOnly=function(e){this._isCheckEndSegmentsOnly=e};ii.prototype.getIntersectionSegments=function(){return this._intSegments};ii.prototype.count=function(){return this._intersectionCount};ii.prototype.getIntersections=function(){return this._intersections};ii.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e};ii.prototype.setKeepIntersections=function(e){this._keepIntersections=e};ii.prototype.processIntersections=function(e,t,n,r){if(!this._findAllIntersections&&this.hasIntersection()||e===n&&t===r)return null;if(this._isCheckEndSegmentsOnly){var s=this.isEndSegment(e,t)||this.isEndSegment(n,r);if(!s)return null}var l=e.getCoordinates()[t],p=e.getCoordinates()[t+1],c=n.getCoordinates()[r],y=n.getCoordinates()[r+1];this._li.computeIntersection(l,p,c,y),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=l,this._intSegments[1]=p,this._intSegments[2]=c,this._intSegments[3]=y,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)};ii.prototype.isEndSegment=function(e,t){return t===0||t>=e.size()-2};ii.prototype.hasIntersection=function(){return this._interiorIntersection!==null};ii.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null};ii.prototype.interfaces_=function(){return[Pu]};ii.prototype.getClass=function(){return ii};ii.createAllIntersectionsFinder=function(e){var t=new ii(e);return t.setFindAllIntersections(!0),t};ii.createAnyIntersectionFinder=function(e){return new ii(e)};ii.createIntersectionCounter=function(e){var t=new ii(e);return t.setFindAllIntersections(!0),t.setKeepIntersections(!1),t};var Ss=function(){this._li=new zu,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var e=arguments[0];this._segStrings=e};Ss.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()};Ss.prototype.getIntersections=function(){return this._segInt.getIntersections()};Ss.prototype.isValid=function(){return this.execute(),this._isValid};Ss.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e};Ss.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new ii(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var e=new R0;if(e.setSegmentIntersector(this._segInt),e.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null};Ss.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new il(this.getErrorMessage(),this._segInt.getInteriorIntersection())};Ss.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var e=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+ys.toLineString(e[0],e[1])+" and "+ys.toLineString(e[2],e[3])};Ss.prototype.interfaces_=function(){return[]};Ss.prototype.getClass=function(){return Ss};Ss.computeIntersections=function(e){var t=new Ss(e);return t.setFindAllIntersections(!0),t.isValid(),t.getIntersections()};var ku=function e(){this._nv=null;var t=arguments[0];this._nv=new Ss(e.toSegmentStrings(t))};ku.prototype.checkValid=function(){this._nv.checkValid()};ku.prototype.interfaces_=function(){return[]};ku.prototype.getClass=function(){return ku};ku.toSegmentStrings=function(e){for(var t=new ie,n=e.iterator();n.hasNext();){var r=n.next();t.add(new ra(r.getCoordinates(),r))}return t};ku.checkValid=function(e){var t=new ku(e);t.checkValid()};var Cc=function(e){this._mapOp=e};Cc.prototype.map=function(e){for(var t=this,n=new ie,r=0;r0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)};Qi.prototype.interfaces_=function(){return[]};Qi.prototype.getClass=function(){return Qi};var Pa=function e(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new Ie,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof cr&&typeof arguments[1]=="number"){var t=arguments[0],n=arguments[1];e.call(this,t.getCoordinates(),n)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var r=arguments[0],s=arguments[1];this._srcPts=r,this._isClosed=e.isClosed(r),this._snapTolerance=s}};Pa.prototype.snapVertices=function(e,t){for(var n=this,r=this._isClosed?e.size()-1:e.size(),s=0;s=0&&e.add(p+1,new St(l),!1)}};Pa.prototype.findSegmentIndexToSnap=function(e,t){for(var n=this,r=Ue.MAX_VALUE,s=-1,l=0;lt&&(t=r)}return t}else if(arguments.length===2){var s=arguments[0],l=arguments[1];return Math.min(_r.computeOverlaySnapTolerance(s),_r.computeOverlaySnapTolerance(l))}};_r.computeSizeBasedSnapTolerance=function(e){var t=e.getEnvelopeInternal(),n=Math.min(t.getHeight(),t.getWidth()),r=n*_r.SNAP_PRECISION_FACTOR;return r};_r.snapToSelf=function(e,t,n){var r=new _r(e);return r.snapToSelf(t,n)};CE.SNAP_PRECISION_FACTOR.get=function(){return 1e-9};Object.defineProperties(_r,CE);var TE=function(e){function t(n,r,s){e.call(this),this._snapTolerance=n||null,this._snapPts=r||null,this._isSelfSnap=s!==void 0?s:!1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(n,r){var s=new Pa(n,this._snapTolerance);return s.setAllowSnappingToSourceVertices(this._isSelfSnap),s.snapTo(r)},t.prototype.transformCoordinates=function(n,r){var s=n.toCoordinateArray(),l=this.snapLine(s,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(l)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Qi),Li=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Li.prototype.getCommon=function(){return Ue.longBitsToDouble(this._commonBits)};Li.prototype.add=function(e){var t=Ue.doubleToLongBits(e);if(this._isFirst)return this._commonBits=t,this._commonSignExp=Li.signExpBits(this._commonBits),this._isFirst=!1,null;var n=Li.signExpBits(t);if(n!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Li.numCommonMostSigMantissaBits(this._commonBits,t),this._commonBits=Li.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))};Li.prototype.toString=function(){if(arguments.length===1){var e=arguments[0],t=Ue.longBitsToDouble(e),n=Ue.toBinaryString(e),r="0000000000000000000000000000000000000000000000000000000000000000"+n,s=r.substring(r.length-64),l=s.substring(0,1)+" "+s.substring(1,12)+"(exp) "+s.substring(12)+" [ "+t+" ]";return l}};Li.prototype.interfaces_=function(){return[]};Li.prototype.getClass=function(){return Li};Li.getBit=function(e,t){var n=1<>52};Li.zeroLowerBits=function(e,t){var n=(1<=0;r--){if(Li.getBit(e,r)!==Li.getBit(t,r))return n;n++}return 52};var Yl=function(){this._commonCoord=null,this._ccFilter=new Lc},B0={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Yl.prototype.addCommonBits=function(e){var t=new Kl(this._commonCoord);e.apply(t),e.geometryChanged()};Yl.prototype.removeCommonBits=function(e){if(this._commonCoord.x===0&&this._commonCoord.y===0)return e;var t=new St(this._commonCoord);t.x=-t.x,t.y=-t.y;var n=new Kl(t);return e.apply(n),e.geometryChanged(),e};Yl.prototype.getCommonCoordinate=function(){return this._commonCoord};Yl.prototype.add=function(e){e.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()};Yl.prototype.interfaces_=function(){return[]};Yl.prototype.getClass=function(){return Yl};B0.CommonCoordinateFilter.get=function(){return Lc};B0.Translater.get=function(){return Kl};Object.defineProperties(Yl,B0);var Lc=function(){this._commonBitsX=new Li,this._commonBitsY=new Li};Lc.prototype.filter=function(e){this._commonBitsX.add(e.x),this._commonBitsY.add(e.y)};Lc.prototype.getCommonCoordinate=function(){return new St(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())};Lc.prototype.interfaces_=function(){return[Sa]};Lc.prototype.getClass=function(){return Lc};var Kl=function(){this.trans=null;var e=arguments[0];this.trans=e};Kl.prototype.filter=function(e,t){var n=e.getOrdinate(t,0)+this.trans.x,r=e.getOrdinate(t,1)+this.trans.y;e.setOrdinate(t,0,n),e.setOrdinate(t,1,r)};Kl.prototype.isDone=function(){return!1};Kl.prototype.isGeometryChanged=function(){return!0};Kl.prototype.interfaces_=function(){return[_s]};Kl.prototype.getClass=function(){return Kl};var oi=function(e,t){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=e,this._geom[1]=t,this.computeSnapTolerance()};oi.prototype.selfSnap=function(e){var t=new _r(e),n=t.snapTo(e,this._snapTolerance);return n};oi.prototype.removeCommonBits=function(e){this._cbr=new Yl,this._cbr.add(e[0]),this._cbr.add(e[1]);var t=new Array(2).fill(null);return t[0]=this._cbr.removeCommonBits(e[0].copy()),t[1]=this._cbr.removeCommonBits(e[1].copy()),t};oi.prototype.prepareResult=function(e){return this._cbr.addCommonBits(e),e};oi.prototype.getResultGeometry=function(e){var t=this.snap(this._geom),n=We.overlayOp(t[0],t[1],e);return this.prepareResult(n)};oi.prototype.checkValid=function(e){e.isValid()||pi.out.println("Snapped geometry is invalid")};oi.prototype.computeSnapTolerance=function(){this._snapTolerance=_r.computeOverlaySnapTolerance(this._geom[0],this._geom[1])};oi.prototype.snap=function(e){var t=this.removeCommonBits(e),n=_r.snap(t[0],t[1],this._snapTolerance);return n};oi.prototype.interfaces_=function(){return[]};oi.prototype.getClass=function(){return oi};oi.overlayOp=function(e,t,n){var r=new oi(e,t);return r.getResultGeometry(n)};oi.union=function(e,t){return oi.overlayOp(e,t,We.UNION)};oi.intersection=function(e,t){return oi.overlayOp(e,t,We.INTERSECTION)};oi.symDifference=function(e,t){return oi.overlayOp(e,t,We.SYMDIFFERENCE)};oi.difference=function(e,t){return oi.overlayOp(e,t,We.DIFFERENCE)};var zi=function(e,t){this._geom=new Array(2).fill(null),this._geom[0]=e,this._geom[1]=t};zi.prototype.getResultGeometry=function(e){var t=null,n=!1,r=null;try{t=We.overlayOp(this._geom[0],this._geom[1],e);var s=!0;s&&(n=!0)}catch(l){if(l instanceof nl)r=l;else throw l}finally{}if(!n)try{t=oi.overlayOp(this._geom[0],this._geom[1],e)}catch(l){throw l instanceof nl?r:l}finally{}return t};zi.prototype.interfaces_=function(){return[]};zi.prototype.getClass=function(){return zi};zi.overlayOp=function(e,t,n){var r=new zi(e,t);return r.getResultGeometry(n)};zi.union=function(e,t){return zi.overlayOp(e,t,We.UNION)};zi.intersection=function(e,t){return zi.overlayOp(e,t,We.INTERSECTION)};zi.symDifference=function(e,t){return zi.overlayOp(e,t,We.SYMDIFFERENCE)};zi.difference=function(e,t){return zi.overlayOp(e,t,We.DIFFERENCE)};var wd=function(){this.mce=null,this.chainIndex=null;var e=arguments[0],t=arguments[1];this.mce=e,this.chainIndex=t};wd.prototype.computeIntersections=function(e,t){this.mce.computeIntersectsForChain(this.chainIndex,e.mce,e.chainIndex,t)};wd.prototype.interfaces_=function(){return[]};wd.prototype.getClass=function(){return wd};var yo=function e(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],n=arguments[1];this._eventType=e.DELETE,this._xValue=t,this._insertEvent=n}else if(arguments.length===3){var r=arguments[0],s=arguments[1],l=arguments[2];this._eventType=e.INSERT,this._label=r,this._xValue=s,this._obj=l}},V0={INSERT:{configurable:!0},DELETE:{configurable:!0}};yo.prototype.isDelete=function(){return this._eventType===yo.DELETE};yo.prototype.setDeleteEventIndex=function(e){this._deleteEventIndex=e};yo.prototype.getObject=function(){return this._obj};yo.prototype.compareTo=function(e){var t=e;return this._xValuet._xValue?1:this._eventTypet._eventType?1:0};yo.prototype.getInsertEvent=function(){return this._insertEvent};yo.prototype.isInsert=function(){return this._eventType===yo.INSERT};yo.prototype.isSameLabel=function(e){return this._label===null?!1:this._label===e._label};yo.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex};yo.prototype.interfaces_=function(){return[es]};yo.prototype.getClass=function(){return yo};V0.INSERT.get=function(){return 1};V0.DELETE.get=function(){return 2};Object.defineProperties(yo,V0);var Hm=function(){};Hm.prototype.interfaces_=function(){return[]};Hm.prototype.getClass=function(){return Hm};var gi=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var e=arguments[0],t=arguments[1],n=arguments[2];this._li=e,this._includeProper=t,this._recordIsolated=n};gi.prototype.isTrivialIntersection=function(e,t,n,r){if(e===n&&this._li.getIntersectionNum()===1){if(gi.isAdjacentSegments(t,r))return!0;if(e.isClosed()){var s=e.getNumPoints()-1;if(t===0&&r===s||r===0&&t===s)return!0}}return!1};gi.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint};gi.prototype.setIsDoneIfProperInt=function(e){this._isDoneWhenProperInt=e};gi.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior};gi.prototype.isBoundaryPointInternal=function(e,t){for(var n=t.iterator();n.hasNext();){var r=n.next(),s=r.getCoordinate();if(e.isIntersection(s))return!0}return!1};gi.prototype.hasProperIntersection=function(){return this._hasProper};gi.prototype.hasIntersection=function(){return this._hasIntersection};gi.prototype.isDone=function(){return this._isDone};gi.prototype.isBoundaryPoint=function(e,t){return t===null?!1:!!(this.isBoundaryPointInternal(e,t[0])||this.isBoundaryPointInternal(e,t[1]))};gi.prototype.setBoundaryNodes=function(e,t){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=e,this._bdyNodes[1]=t};gi.prototype.addIntersections=function(e,t,n,r){if(e===n&&t===r)return null;this.numTests++;var s=e.getCoordinates()[t],l=e.getCoordinates()[t+1],p=n.getCoordinates()[r],c=n.getCoordinates()[r+1];this._li.computeIntersection(s,l,p,c),this._li.hasIntersection()&&(this._recordIsolated&&(e.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(e,t,n,r)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(e.addIntersections(this._li,t,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))};gi.prototype.interfaces_=function(){return[]};gi.prototype.getClass=function(){return gi};gi.isAdjacentSegments=function(e,t){return Math.abs(e-t)===1};var a3=function(e){function t(){e.call(this),this.events=new ie,this.nOverlaps=null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var n=this;bs.sort(this.events);for(var r=0;rt||this._maxl?1:0};Sd.prototype.interfaces_=function(){return[tp]};Sd.prototype.getClass=function(){return Sd};var l3=function(e){function t(){e.call(this),this._item=null;var n=arguments[0],r=arguments[1],s=arguments[2];this._min=n,this._max=r,this._item=s}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.query=function(n,r,s){if(!this.intersects(n,r))return null;s.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ma),u3=function(e){function t(){e.call(this),this._node1=null,this._node2=null;var n=arguments[0],r=arguments[1];this._node1=n,this._node2=r,this.buildExtent(this._node1,this._node2)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(n,r){this._min=Math.min(n._min,r._min),this._max=Math.max(n._max,r._max)},t.prototype.query=function(n,r,s){if(!this.intersects(n,r))return null;this._node1!==null&&this._node1.query(n,r,s),this._node2!==null&&this._node2.query(n,r,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ma),Aa=function(){this._leaves=new ie,this._root=null,this._level=0};Aa.prototype.buildTree=function(){var e=this;bs.sort(this._leaves,new Ma.NodeComparator);for(var t=this._leaves,n=null,r=new ie;;){if(e.buildLevel(t,r),r.size()===1)return r.get(0);n=t,t=r,r=n}};Aa.prototype.insert=function(e,t,n){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new l3(e,t,n))};Aa.prototype.query=function(e,t,n){this.init(),this._root.query(e,t,n)};Aa.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()};Aa.prototype.printNode=function(e){pi.out.println(ys.toLineString(new St(e._min,this._level),new St(e._max,this._level)))};Aa.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()};Aa.prototype.buildLevel=function(e,t){this._level++,t.clear();for(var n=0;n=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,r[0]),this.insertBoundaryPoint(this._argIndex,r[r.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var n=this.getBoundaryNodes(),r=new Array(n.size()).fill(null),s=0,l=n.iterator();l.hasNext();){var p=l.next();r[s++]=p.getCoordinate().copy()}return r},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(n,r,s){if(this.isBoundaryNode(n,r))return null;s===Ct.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(n,r):this.insertPoint(n,r,s)},t.prototype.addPolygonRing=function(n,r,s){if(n.isEmpty())return null;var l=un.removeRepeatedPoints(n.getCoordinates());if(l.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=l[0],null;var p=r,c=s;pe.isCCW(l)&&(p=s,c=r);var y=new Zm(l,new Tn(this._argIndex,Ct.BOUNDARY,p,c));this._lineEdgeMap.put(n,y),this.insertEdge(y),this.insertPoint(this._argIndex,l[0],Ct.BOUNDARY)},t.prototype.insertPoint=function(n,r,s){var l=this._nodes.addNode(r),p=l.getLabel();p===null?l._label=new Tn(n,s):p.setLocation(n,s)},t.prototype.createEdgeSetIntersector=function(){return new a3},t.prototype.addSelfIntersectionNodes=function(n){for(var r=this,s=this._edges.iterator();s.hasNext();)for(var l=s.next(),p=l.getLabel().getLocation(n),c=l.eiList.iterator();c.hasNext();){var y=c.next();r.addSelfIntersectionNode(n,y.coord,p)}},t.prototype.add=function(){if(arguments.length===1){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof xa&&(this._useBoundaryDeterminationRule=!1),n instanceof Nr)this.addPolygon(n);else if(n instanceof cr)this.addLineString(n);else if(n instanceof fo)this.addPoint(n);else if(n instanceof ap)this.addCollection(n);else if(n instanceof Cu)this.addCollection(n);else if(n instanceof xa)this.addCollection(n);else if(n instanceof Ri)this.addCollection(n);else throw new Error(n.getClass().getName())}else return e.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(n){for(var r=this,s=0;s50?(this._areaPtLocator===null&&(this._areaPtLocator=new dp(this._parentGeom)),this._areaPtLocator.locate(n)):this._ptLocator.locate(n,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var n=arguments[0];return this._lineEdgeMap.get(n)}else return e.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(n,r){return n.isInBoundary(r)?Ct.BOUNDARY:Ct.INTERIOR},t}(ir),mp=function(){if(this._li=new zu,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var e=arguments[0];this.setComputationPrecision(e.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Vf(0,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1],r=Qo.OGC_SFS_BOUNDARY_RULE;t.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(t.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Vf(0,t,r),this._arg[1]=new Vf(1,n,r)}else if(arguments.length===3){var s=arguments[0],l=arguments[1],p=arguments[2];s.getPrecisionModel().compareTo(l.getPrecisionModel())>=0?this.setComputationPrecision(s.getPrecisionModel()):this.setComputationPrecision(l.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Vf(0,s,p),this._arg[1]=new Vf(1,l,p)}};mp.prototype.getArgGeometry=function(e){return this._arg[e].getGeometry()};mp.prototype.setComputationPrecision=function(e){this._resultPrecisionModel=e,this._li.setPrecisionModel(this._resultPrecisionModel)};mp.prototype.interfaces_=function(){return[]};mp.prototype.getClass=function(){return mp};var Eu=function(){};Eu.prototype.interfaces_=function(){return[]};Eu.prototype.getClass=function(){return Eu};Eu.map=function(){if(arguments[0]instanceof ke&&De(arguments[1],Eu.MapOp)){for(var e=arguments[0],t=arguments[1],n=new ie,r=0;r=e.size()?null:e.get(t)};Er.union=function(e){var t=new Er(e);return t.union()};ME.STRTREE_NODE_CAPACITY.get=function(){return 4};Object.defineProperties(Er,ME);var Xm=function(){};Xm.prototype.interfaces_=function(){return[]};Xm.prototype.getClass=function(){return Xm};Xm.union=function(e,t){if(e.isEmpty()||t.isEmpty()){if(e.isEmpty()&&t.isEmpty())return We.createEmptyResult(We.UNION,e,t,e.getFactory());if(e.isEmpty())return t.copy();if(t.isEmpty())return e.copy()}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),zi.overlayOp(e,t,We.UNION)};function Fu(){return new Ym}function Ym(){this.reset()}Ym.prototype={constructor:Ym,reset:function(){this.s=this.t=0},add:function(e){Iw(im,e,this.t),Iw(this,im.s,this.s),this.s?this.t+=im.t:this.s=im.t},valueOf:function(){return this.s}};var im=new Ym;function Iw(e,t,n){var r=e.s=t+n,s=r-t,l=r-s;e.t=t-l+(n-s)}var ur=1e-6,On=Math.PI,$a=On/2,Cw=On/4,al=On*2,_u=180/On,Fs=On/180,Ai=Math.abs,c3=Math.atan,_p=Math.atan2,kr=Math.cos,Dr=Math.sin,Dp=Math.sqrt;function AE(e){return e>1?0:e<-1?On:Math.acos(e)}function Pc(e){return e>1?$a:e<-1?-$a:Math.asin(e)}function Yf(){}function Km(e,t){e&&Lw.hasOwnProperty(e.type)&&Lw[e.type](e,t)}var Tw={Feature:function(e,t){Km(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,s=n.length;++rOn?e-al:e<-On?e+al:e,t]}Hv.invert=Hv;function p3(e,t,n){return(e%=al)?t||n?kE(Aw(e),kw(t,n)):Aw(e):t||n?kw(t,n):Hv}function Mw(e){return function(t,n){return t+=e,[t>On?t-al:t<-On?t+al:t,n]}}function Aw(e){var t=Mw(e);return t.invert=Mw(-e),t}function kw(e,t){var n=kr(e),r=Dr(e),s=kr(t),l=Dr(t);function p(c,y){var w=kr(y),T=kr(c)*w,L=Dr(c)*w,A=Dr(y),z=A*n+T*r;return[_p(L*s-z*l,T*n-A*r),Pc(z*s+L*l)]}return p.invert=function(c,y){var w=kr(y),T=kr(c)*w,L=Dr(c)*w,A=Dr(y),z=A*s-L*l;return[_p(L*s+A*l,T*n+z*r),Pc(z*n-T*r)]},p}function f3(e,t,n,r,s,l){if(n){var p=kr(t),c=Dr(t),y=r*n;s==null?(s=t+r*al,l=t-y/2):(s=Dw(p,s),l=Dw(p,l),(r>0?sl)&&(s+=r*al));for(var w,T=s;r>0?T>l:T1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function d3(e,t,n,r,s,l){var p=e[0],c=e[1],y=t[0],w=t[1],T=0,L=1,A=y-p,z=w-c,B;if(B=n-p,!(!A&&B>0)){if(B/=A,A<0){if(B0){if(B>L)return;B>T&&(T=B)}if(B=s-p,!(!A&&B<0)){if(B/=A,A<0){if(B>L)return;B>T&&(T=B)}else if(A>0){if(B0)){if(B/=z,z<0){if(B0){if(B>L)return;B>T&&(T=B)}if(B=l-c,!(!z&&B<0)){if(B/=z,z<0){if(B>L)return;B>T&&(T=B)}else if(z>0){if(B0&&(e[0]=p+T*A,e[1]=c+T*z),L<1&&(t[0]=p+L*A,t[1]=c+L*z),!0}}}}}function bm(e,t){return Ai(e[0]-t[0])=0;--c)s.point((L=T[c])[0],L[1]);else r(A.x,A.p.x,-1,s);A=A.p}A=A.o,T=A.z,z=!z}while(!A.v);s.lineEnd()}}}function Rw(e){if(t=e.length){for(var t,n=0,r=e[0],s;++nt?1:e>=t?0:NaN}function g3(e){return e.length===1&&(e=m3(e)),{left:function(t,n,r,s){for(r==null&&(r=0),s==null&&(s=t.length);r>>1;e(t[l],n)<0?r=l+1:s=l}return r},right:function(t,n,r,s){for(r==null&&(r=0),s==null&&(s=t.length);r>>1;e(t[l],n)>0?s=l:r=l+1}return r}}}function m3(e){return function(t,n){return NE(e(t),n)}}g3(NE);function OE(e){for(var t=e.length,n,r=-1,s=0,l,p;++r=0;)for(p=e[t],n=p.length;--n>=0;)l[--s]=p[n];return l}var Kf=1e9,lm=-Kf;function y3(e,t,n,r){function s(w,T){return e<=w&&w<=n&&t<=T&&T<=r}function l(w,T,L,A){var z=0,B=0;if(w==null||(z=p(w,L))!==(B=p(T,L))||y(w,T)<0^L>0)do A.point(z===0||z===3?e:n,z>1?r:t);while((z=(z+L+4)%4)!==B);else A.point(T[0],T[1])}function p(w,T){return Ai(w[0]-e)0?0:3:Ai(w[0]-n)0?2:1:Ai(w[1]-t)0?1:0:T>0?3:2}function c(w,T){return y(w.x,T.x)}function y(w,T){var L=p(w,1),A=p(T,1);return L!==A?L-A:L===0?T[1]-w[1]:L===1?w[0]-T[0]:L===2?w[1]-T[1]:T[0]-w[0]}return function(w){var T=w,L=DE(),A,z,B,Y,et,at,W,H,nt,ut,_t,ct={point:bt,lineStart:Pt,lineEnd:Qt,polygonStart:Ot,polygonEnd:dt};function bt(oe,ge){s(oe,ge)&&T.point(oe,ge)}function It(){for(var oe=0,ge=0,Te=z.length;ger&&(pr-Pe)*(r-Mn)>(zn-Mn)*(e-Pe)&&++oe:zn<=r&&(pr-Pe)*(r-Mn)<(zn-Mn)*(e-Pe)&&--oe;return oe}function Ot(){T=L,A=[],z=[],_t=!0}function dt(){var oe=It(),ge=_t&&oe,Te=(A=OE(A)).length;(ge||Te)&&(w.polygonStart(),ge&&(w.lineStart(),l(null,null,1,w),w.lineEnd()),Te&&RE(A,c,oe,l,w),w.polygonEnd()),T=w,A=z=B=null}function Pt(){ct.point=Et,z&&z.push(B=[]),ut=!0,nt=!1,W=H=NaN}function Qt(){A&&(Et(Y,et),at&&nt&&L.rejoin(),A.push(L.result())),ct.point=bt,nt&&T.lineEnd()}function Et(oe,ge){var Te=s(oe,ge);if(z&&B.push([oe,ge]),ut)Y=oe,et=ge,at=Te,ut=!1,Te&&(T.lineStart(),T.point(oe,ge));else if(Te&&nt)T.point(oe,ge);else{var Fe=[W=Math.max(lm,Math.min(Kf,W)),H=Math.max(lm,Math.min(Kf,H))],rn=[oe=Math.max(lm,Math.min(Kf,oe)),ge=Math.max(lm,Math.min(Kf,ge))];d3(Fe,rn,e,t,n,r)?(nt||(T.lineStart(),T.point(Fe[0],Fe[1])),T.point(rn[0],rn[1]),Te||T.lineEnd(),_t=!1):Te&&(T.lineStart(),T.point(oe,ge),_t=!1)}W=oe,H=ge,nt=Te}return ct}}var rv=Fu();function _3(e,t){var n=t[0],r=t[1],s=[Dr(n),-kr(n),0],l=0,p=0;rv.reset();for(var c=0,y=e.length;c=0?1:-1,bt=ct*_t,It=bt>On,Ot=B*nt;if(rv.add(_p(Ot*ct*Dr(bt),Y*ut+Ot*kr(bt))),l+=It?_t+ct*al:_t,It^A>=n^W>=n){var dt=Jm(vp(L),vp(at));Zv(dt);var Pt=Jm(s,dt);Zv(Pt);var Qt=(It^_t>=0?-1:1)*Pc(Pt[2]);(r>Qt||r===Qt&&(dt[0]||dt[1]))&&(p+=It^_t>=0?1:-1)}}return(l<-ur||lEd&&(Ed=e),t$m&&($m=t)}Fu();function zE(e,t,n,r){return function(s,l){var p=t(l),c=s.invert(r[0],r[1]),y=DE(),w=t(y),T=!1,L,A,z,B={point:Y,lineStart:at,lineEnd:W,polygonStart:function(){B.point=H,B.lineStart=nt,B.lineEnd=ut,A=[],L=[]},polygonEnd:function(){B.point=Y,B.lineStart=at,B.lineEnd=W,A=OE(A);var _t=_3(L,c);A.length?(T||(l.polygonStart(),T=!0),RE(A,x3,_t,n,l)):_t&&(T||(l.polygonStart(),T=!0),l.lineStart(),n(null,null,1,l),l.lineEnd()),T&&(l.polygonEnd(),T=!1),A=L=null},sphere:function(){l.polygonStart(),l.lineStart(),n(null,null,1,l),l.lineEnd(),l.polygonEnd()}};function Y(_t,ct){var bt=s(_t,ct);e(_t=bt[0],ct=bt[1])&&l.point(_t,ct)}function et(_t,ct){var bt=s(_t,ct);p.point(bt[0],bt[1])}function at(){B.point=et,p.lineStart()}function W(){B.point=Y,p.lineEnd()}function H(_t,ct){z.push([_t,ct]);var bt=s(_t,ct);w.point(bt[0],bt[1])}function nt(){w.lineStart(),z=[]}function ut(){H(z[0][0],z[0][1]),w.lineEnd();var _t=w.clean(),ct=y.result(),bt,It=ct.length,Ot,dt,Pt;if(z.pop(),L.push(z),z=null,!!It){if(_t&1){if(dt=ct[0],(Ot=dt.length-1)>0){for(T||(l.polygonStart(),T=!0),l.lineStart(),bt=0;bt1&&_t&2&&ct.push(ct.pop().concat(ct.shift())),A.push(ct.filter(b3))}}return B}}function b3(e){return e.length>1}function x3(e,t){return((e=e.x)[0]<0?e[1]-$a-ur:$a-e[1])-((t=t.x)[0]<0?t[1]-$a-ur:$a-t[1])}const zw=zE(function(){return!0},w3,E3,[-On,-$a]);function w3(e){var t=NaN,n=NaN,r=NaN,s;return{lineStart:function(){e.lineStart(),s=1},point:function(l,p){var c=l>0?On:-On,y=Ai(l-t);Ai(y-On)0?$a:-$a),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(c,n),e.point(l,n),s=0):r!==c&&y>=On&&(Ai(t-r)ur?c3((Dr(t)*(l=kr(r))*Dr(n)-Dr(r)*(s=kr(t))*Dr(e))/(s*l*p)):(t+r)/2}function E3(e,t,n,r){var s;if(e==null)s=n*$a,r.point(-On,s),r.point(0,s),r.point(On,s),r.point(On,0),r.point(On,-s),r.point(0,-s),r.point(-On,-s),r.point(-On,0),r.point(-On,s);else if(Ai(e[0]-t[0])>ur){var l=e[0]0,s=Ai(n)>ur;function l(T,L,A,z){f3(z,e,t,A,T,L)}function p(T,L){return kr(T)*kr(L)>n}function c(T){var L,A,z,B,Y;return{lineStart:function(){B=z=!1,Y=1},point:function(et,at){var W=[et,at],H,nt=p(et,at),ut=r?nt?0:w(et,at):nt?w(et+(et<0?On:-On),at):0;if(!L&&(B=z=nt)&&T.lineStart(),nt!==z&&(H=y(L,W),(!H||bm(L,H)||bm(W,H))&&(W[0]+=ur,W[1]+=ur,nt=p(W[0],W[1]))),nt!==z)Y=0,nt?(T.lineStart(),H=y(W,L),T.point(H[0],H[1])):(H=y(L,W),T.point(H[0],H[1]),T.lineEnd()),L=H;else if(s&&L&&r^nt){var _t;!(ut&A)&&(_t=y(W,L,!0))&&(Y=0,r?(T.lineStart(),T.point(_t[0][0],_t[0][1]),T.point(_t[1][0],_t[1][1]),T.lineEnd()):(T.point(_t[1][0],_t[1][1]),T.lineEnd(),T.lineStart(),T.point(_t[0][0],_t[0][1])))}nt&&(!L||!bm(L,W))&&T.point(W[0],W[1]),L=W,z=nt,A=ut},lineEnd:function(){z&&T.lineEnd(),L=null},clean:function(){return Y|(B&&z)<<1}}}function y(T,L,A){var z=vp(T),B=vp(L),Y=[1,0,0],et=Jm(z,B),at=om(et,et),W=et[0],H=at-W*W;if(!H)return!A&&T;var nt=n*at/H,ut=-n*W/H,_t=Jm(Y,et),ct=sm(Y,nt),bt=sm(et,ut);nv(ct,bt);var It=_t,Ot=om(ct,It),dt=om(It,It),Pt=Ot*Ot-dt*(om(ct,ct)-1);if(!(Pt<0)){var Qt=Dp(Pt),Et=sm(It,(-Ot-Qt)/dt);if(nv(Et,ct),Et=Wv(Et),!A)return Et;var oe=T[0],ge=L[0],Te=T[1],Fe=L[1],rn;ge0^Et[1]<(Ai(Et[0]-oe)On^(oe<=Et[0]&&Et[0]<=ge)){var Mn=sm(It,(-Ot+Qt)/dt);return nv(Mn,ct),[Et,Wv(Mn)]}}}function w(T,L){var A=r?e:On-e,z=0;return T<-A?z|=1:T>A&&(z|=2),L<-A?z|=4:L>A&&(z|=8),z}return zE(p,c,l,r?[0,-e]:[-On,e-On])}function FE(e){return function(t){var n=new Xv;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Xv(){}Xv.prototype={constructor:Xv,point:function(e,t){this.stream.point(e,t)},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 BE(e,t,n){var r=t[1][0]-t[0][0],s=t[1][1]-t[0][1],l=e.clipExtent&&e.clipExtent();e.scale(150).translate([0,0]),l!=null&&e.clipExtent(null),h3(n,e.stream(Ow));var p=Ow.result(),c=Math.min(r/(p[1][0]-p[0][0]),s/(p[1][1]-p[0][1])),y=+t[0][0]+(r-c*(p[1][0]+p[0][0]))/2,w=+t[0][1]+(s-c*(p[1][1]+p[0][1]))/2;return l!=null&&e.clipExtent(l),e.scale(c*150).translate([y,w])}function C3(e,t,n){return BE(e,[[0,0],t],n)}var Fw=16,T3=kr(30*Fs);function Bw(e,t){return+t?P3(e,t):L3(e)}function L3(e){return FE({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function P3(e,t){function n(r,s,l,p,c,y,w,T,L,A,z,B,Y,et){var at=w-r,W=T-s,H=at*at+W*W;if(H>4*t&&Y--){var nt=p+A,ut=c+z,_t=y+B,ct=Dp(nt*nt+ut*ut+_t*_t),bt=Pc(_t/=ct),It=Ai(Ai(_t)-1)t||Ai((at*Qt+W*Et)/H-.5)>.3||p*A+c*z+y*B2?Et[2]%360*Fs:0,Pt()):[w*_u,T*_u,L*_u]},It.precision=function(Et){return arguments.length?(_t=Bw(dt,ut=Et*Et),Qt()):Dp(ut)},It.fitExtent=function(Et,oe){return BE(It,Et,oe)},It.fitSize=function(Et,oe){return C3(It,Et,oe)};function Pt(){z=kE(A=p3(w,T,L),t);var Et=t(c,y);return l=r-Et[0]*n,p=s+Et[1]*n,Qt()}function Qt(){return ct=bt=null,It}return function(){return t=e.apply(this,arguments),It.invert=t.invert&&Ot,Pt()}}function VE(e){return function(t,n){var r=kr(t),s=kr(n),l=e(r*s);return[l*s*Dr(t),l*Dr(n)]}}function UE(e){return function(t,n){var r=Dp(t*t+n*n),s=e(r),l=Dr(s),p=kr(s);return[_p(t*l,r*p),Pc(r&&n*l/r)]}}var D3=VE(function(e){return Dp(2/(1+e))});D3.invert=UE(function(e){return 2*Pc(e/2)});var GE=VE(function(e){return(e=AE(e))&&e/Dr(e)});GE.invert=UE(function(e){return e});function R3(){return A3(GE).scale(79.4188).clipAngle(180-.001)}function Vw(e,t){return[e,t]}Vw.invert=Vw;function N3(e,t,n){n=n||{};var r=n.units||"kilometers",s=n.steps||8;if(!e)throw new Error("geojson is required");if(typeof n!="object")throw new Error("options must be an object");if(typeof s!="number")throw new Error("steps must be an number");if(t===void 0)throw new Error("radius is required");if(s<=0)throw new Error("steps must be greater than 0");var l=[];switch(e.type){case"GeometryCollection":return rE(e,function(p){var c=xm(p,t,r,s);c&&l.push(c)}),Uv(l);case"FeatureCollection":return bw(e,function(p){var c=xm(p,t,r,s);c&&bw(c,function(y){y&&l.push(y)})}),Uv(l)}return xm(e,t,r,s)}function xm(e,t,n,r){var s=e.properties||{},l=e.type==="Feature"?e.geometry:e;if(l.type==="GeometryCollection"){var p=[];return rE(e,function(Y){var et=xm(Y,t,n,r);et&&p.push(et)}),Uv(p)}var c=O3(l),y={type:l.type,coordinates:qE(l.coordinates,c)},w=new D0,T=w.read(y),L=jR(qR(t,n),"meters"),A=ci.bufferOp(T,L,r),z=new fE;if(A=z.write(A),!jE(A.coordinates)){var B={type:A.type,coordinates:WE(A.coordinates,c)};return cy(B,s)}}function jE(e){return Array.isArray(e[0])?jE(e[0]):isNaN(e[0])}function qE(e,t){return typeof e[0]!="object"?t(e):e.map(function(n){return qE(n,t)})}function WE(e,t){return typeof e[0]!="object"?t.invert(e):e.map(function(n){return WE(n,t)})}function O3(e){var t=ZR(e).geometry.coordinates,n=[-t[0],-t[1]];return R3().rotate(n).scale(Lo)}function z3(e,t){var n=jm(e),r=jm(t),s=e.properties||{},l=QS.difference(n.coordinates,r.coordinates);return l.length===0?null:l.length===1?tE(l[0],s):eE(l,s)}function Uw(e){let t;for(const n of e)t&&n[0]-t[0]>=180?n[0]-=360:t&&n[0]-t[0]<-180&&(n[0]+=360),t=n}function Gw(e,t){const n=z3({type:"Polygon",coordinates:[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]},e);if(!n)return;n.properties={isMask:"y"};const r=N3(e,0);if(r.geometry.type==="Polygon")for(const s of r.geometry.coordinates)Uw(s);else for(const s of r.geometry.coordinates)for(const l of s)Uw(l);t({type:"FeatureCollection",features:[r,n]})}let jw={type:"FeatureCollection",features:[]};function F3(e,t,n=!0,r=!0,s={},l={},p={fill:{paint:{"fill-color":"#000","fill-opacity":.1},filter:["all",["==",["geometry-type"],"Polygon"],["has","isMask"]]},line:{layout:{"line-cap":"square"},paint:{"line-width":["case",["==",["geometry-type"],"Polygon"],2,3],"line-dasharray":[1,1],"line-color":"#3170fe"},filter:["!",["has","isMask"]]}}){let c,y=[],w,T;function L(){(p!=null&&p.fill||p!=null&&p.line)&&e.addSource("full-geom",{type:"geojson",data:jw}),p!=null&&p.fill&&e.addLayer({...p==null?void 0:p.fill,id:"full-geom-fill",type:"fill",source:"full-geom"}),p!=null&&p.line&&e.addLayer({...p==null?void 0:p.line,id:"full-geom-line",type:"line",source:"full-geom"})}e.loaded()?L():e.once("load",()=>{L()});const A=B=>{c==null||c({type:"mapClick",coordinates:[B.lngLat.lng,B.lngLat.lat]})};function z(B=!1){if(!t)throw new Error;const Y=document.createElement("div");return B&&Y.classList.add("marker-interactive"),new fR({props:{displayIn:"maplibre"},target:Y}),new t.Marker({element:Y,offset:[1,-13]})}return{setEventHandler(B){B?(c=B,e.on("click",A)):(c=void 0,e.off("click",A))},flyTo(B,Y){e.flyTo({center:B,zoom:Y,...s})},fitBounds(B,Y,et){e.fitBounds([[B[0],B[1]],[B[2],B[3]]],{padding:Y,maxZoom:et,...l})},indicateReverse(B){e.getCanvasContainer().style.cursor=B?"crosshair":""},setReverseMarker(B){!t||!n||(T?B?T.setLngLat(B):(T.remove(),T=void 0):B&&(T=(typeof n=="object"?new t.Marker(n):z()).setLngLat(B).addTo(e),T.getElement().classList.add("marker-reverse")))},setMarkers(B,Y){if(!n)return;function et(at){var W;(W=e.getSource("full-geom"))==null||W.setData(at)}for(const at of y)at.remove();if(y.length=0,et(jw),!!t){if(Y){let at=!1;if(Y.geometry.type==="GeometryCollection"){const W=Y.geometry.geometries.filter(H=>H.type==="Polygon"||H.type==="MultiPolygon");if(W.length>0){let H=W.pop();for(const nt of W)H=WR(H,nt);Gw({...Y,geometry:H},et),at=!0}else{const H=Y.geometry.geometries.filter(nt=>nt.type==="LineString"||nt.type==="MultiLineString");H.length>0&&(et({...Y,geometry:{type:"GeometryCollection",geometries:H}}),at=!0)}}if(!at){if(Y.geometry.type==="Polygon"||Y.geometry.type==="MultiPolygon")Gw(Y,et);else if(Y.geometry.type==="LineString"||Y.geometry.type==="MultiLineString"){et(Y);return}}n&&y.push((typeof n=="object"?new t.Marker(n):z()).setLngLat(Y.center).addTo(e))}if(r)for(const at of B??[]){if(at===Y)continue;const W=(typeof r=="object"?new t.Marker(r):z(!0)).setLngLat(at.center).setPopup(new t.Popup({offset:[1,-27],closeButton:!1,closeOnMove:!0,className:"maptiler-gc-popup"}).setText(at.place_type[0]==="reverse"?at.place_name:at.place_name.replace(/,.*/,""))).addTo(e),H=W.getElement();H.addEventListener("click",nt=>{nt.stopPropagation(),c==null||c({type:"markerClick",id:at.id})}),H.addEventListener("mouseenter",()=>{c==null||c({type:"markerMouseEnter",id:at.id}),W.togglePopup()}),H.addEventListener("mouseleave",()=>{c==null||c({type:"markerMouseLeave",id:at.id}),W.togglePopup()}),y.push(W)}}},setSelectedMarker(B){w&&w.getElement().classList.toggle("marker-selected",!1),w=B>-1?y[B]:void 0,w==null||w.getElement().classList.toggle("marker-selected",!0)},getCenterAndZoom(){const B=e.getCenter();return[e.getZoom(),B.lng,B.lat]}}}function B3(e){let t,n;return{c(){t=Ol("svg"),n=Ol("path"),zt(n,"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"),zt(t,"viewBox","0 0 14 14"),zt(t,"width","13"),zt(t,"height","13"),zt(t,"class","svelte-en2qvf")},m(r,s){de(r,t,s),Wt(t,n)},p:Oe,i:Oe,o:Oe,d(r){r&&fe(t)}}}class ZE extends Pn{constructor(t){super(),Ln(this,t,null,B3,vn,{})}}function V3(e){let t,n;return{c(){t=Ol("svg"),n=Ol("path"),zt(n,"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"),zt(t,"viewBox","0 0 30 30"),zt(t,"fill","none"),zt(t,"xmlns","http://www.w3.org/2000/svg"),zt(t,"class","svelte-d2loi5")},m(r,s){de(r,t,s),Wt(t,n)},p:Oe,i:Oe,o:Oe,d(r){r&&fe(t)}}}class HE extends Pn{constructor(t){super(),Ln(this,t,null,V3,vn,{})}}function U3(e){let t,n;return{c(){t=ae("img"),ho(t.src,n=e[3]+"area.svg")||zt(t,"src",n),zt(t,"alt",e[6]),zt(t,"class","svelte-ltkwvy")},m(r,s){de(r,t,s)},p(r,s){s&8&&!ho(t.src,n=r[3]+"area.svg")&&zt(t,"src",n),s&64&&zt(t,"alt",r[6])},d(r){r&&fe(t)}}}function G3(e){let t,n;return{c(){t=ae("img"),ho(t.src,n=e[3]+"reverse.svg")||zt(t,"src",n),zt(t,"alt",e[6]),zt(t,"class","svelte-ltkwvy")},m(r,s){de(r,t,s)},p(r,s){s&8&&!ho(t.src,n=r[3]+"reverse.svg")&&zt(t,"src",n),s&64&&zt(t,"alt",r[6])},d(r){r&&fe(t)}}}function j3(e){let t,n;return{c(){t=ae("img"),ho(t.src,n=e[3]+"poi.svg")||zt(t,"src",n),zt(t,"alt",e[6]),zt(t,"class","svelte-ltkwvy")},m(r,s){de(r,t,s)},p(r,s){s&8&&!ho(t.src,n=r[3]+"poi.svg")&&zt(t,"src",n),s&64&&zt(t,"alt",r[6])},d(r){r&&fe(t)}}}function q3(e){let t,n;return{c(){t=ae("img"),ho(t.src,n=e[3]+"postal_code.svg")||zt(t,"src",n),zt(t,"alt",e[6]),zt(t,"class","svelte-ltkwvy")},m(r,s){de(r,t,s)},p(r,s){s&8&&!ho(t.src,n=r[3]+"postal_code.svg")&&zt(t,"src",n),s&64&&zt(t,"alt",r[6])},d(r){r&&fe(t)}}}function W3(e){let t,n;return{c(){t=ae("img"),ho(t.src,n=e[3]+"street.svg")||zt(t,"src",n),zt(t,"alt",e[6]),zt(t,"class","svelte-ltkwvy")},m(r,s){de(r,t,s)},p(r,s){s&8&&!ho(t.src,n=r[3]+"street.svg")&&zt(t,"src",n),s&64&&zt(t,"alt",r[6])},d(r){r&&fe(t)}}}function Z3(e){let t,n;return{c(){t=ae("img"),ho(t.src,n=e[3]+"road.svg")||zt(t,"src",n),zt(t,"alt",e[6]),zt(t,"class","svelte-ltkwvy")},m(r,s){de(r,t,s)},p(r,s){s&8&&!ho(t.src,n=r[3]+"road.svg")&&zt(t,"src",n),s&64&&zt(t,"alt",r[6])},d(r){r&&fe(t)}}}function H3(e){let t,n;return{c(){t=ae("img"),ho(t.src,n=e[3]+"housenumber.svg")||zt(t,"src",n),zt(t,"alt",e[6]),zt(t,"class","svelte-ltkwvy")},m(r,s){de(r,t,s)},p(r,s){s&8&&!ho(t.src,n=r[3]+"housenumber.svg")&&zt(t,"src",n),s&64&&zt(t,"alt",r[6])},d(r){r&&fe(t)}}}function X3(e){let t,n,r,s;return{c(){t=ae("img"),ho(t.src,n=e[5])||zt(t,"src",n),zt(t,"alt",e[4]),zt(t,"class","svelte-ltkwvy")},m(l,p){de(l,t,p),r||(s=an(t,"error",e[14]),r=!0)},p(l,p){p&32&&!ho(t.src,n=l[5])&&zt(t,"src",n),p&16&&zt(t,"alt",l[4])},d(l){l&&fe(t),r=!1,s()}}}function qw(e){let t,n;return{c(){t=ae("span"),n=Wn(e[6]),zt(t,"class","secondary svelte-ltkwvy")},m(r,s){de(r,t,s),Wt(t,n)},p(r,s){s&64&&Vl(n,r[6])},d(r){r&&fe(t)}}}function Y3(e){var ct,bt;let t,n,r,s,l,p,c,y,w=(e[7]?e[0].place_name:e[0].place_name.replace(/,.*/,""))+"",T,L,A=e[2]==="always"||e[2]&&!e[0].address&&((ct=e[0].properties)==null?void 0:ct.kind)!=="road"&&((bt=e[0].properties)==null?void 0:bt.kind)!=="road_relation"&&!e[0].id.startsWith("address.")&&!e[0].id.startsWith("postal_code.")&&(!e[0].id.startsWith("poi.")||!e[5])&&!e[7],z,B,Y=(e[7]?"":e[0].place_name.replace(/[^,]*,?\s*/,""))+"",et,at,W;function H(It,Ot){var dt,Pt;return Ot&1&&(n=null),Ot&1&&(r=null),Ot&1&&(s=null),It[5]?X3:It[0].address?H3:((dt=It[0].properties)==null?void 0:dt.kind)==="road"||((Pt=It[0].properties)==null?void 0:Pt.kind)==="road_relation"?Z3:(n==null&&(n=!!It[0].id.startsWith("address.")),n?W3:(r==null&&(r=!!It[0].id.startsWith("postal_code.")),r?q3:(s==null&&(s=!!It[0].id.startsWith("poi.")),s?j3:It[7]?G3:U3)))}let nt=H(e,-1),ut=nt(e),_t=A&&qw(e);return{c(){t=ae("li"),ut.c(),l=Ve(),p=ae("span"),c=ae("span"),y=ae("span"),T=Wn(w),L=Ve(),_t&&_t.c(),z=Ve(),B=ae("span"),et=Wn(Y),zt(y,"class","primary svelte-ltkwvy"),zt(c,"class","svelte-ltkwvy"),zt(B,"class","line2 svelte-ltkwvy"),zt(p,"class","texts svelte-ltkwvy"),zt(t,"tabindex","0"),zt(t,"data-selected",e[1]),zt(t,"class","svelte-ltkwvy"),Qa(t,"selected",e[1])},m(It,Ot){de(It,t,Ot),ut.m(t,null),Wt(t,l),Wt(t,p),Wt(p,c),Wt(c,y),Wt(y,T),Wt(c,L),_t&&_t.m(c,null),Wt(p,z),Wt(p,B),Wt(B,et),at||(W=[an(t,"mouseenter",e[12]),an(t,"focus",e[13])],at=!0)},p(It,[Ot]){var dt,Pt;nt===(nt=H(It,Ot))&&ut?ut.p(It,Ot):(ut.d(1),ut=nt(It),ut&&(ut.c(),ut.m(t,l))),Ot&1&&w!==(w=(It[7]?It[0].place_name:It[0].place_name.replace(/,.*/,""))+"")&&Vl(T,w),Ot&37&&(A=It[2]==="always"||It[2]&&!It[0].address&&((dt=It[0].properties)==null?void 0:dt.kind)!=="road"&&((Pt=It[0].properties)==null?void 0:Pt.kind)!=="road_relation"&&!It[0].id.startsWith("address.")&&!It[0].id.startsWith("postal_code.")&&(!It[0].id.startsWith("poi.")||!It[5])&&!It[7]),A?_t?_t.p(It,Ot):(_t=qw(It),_t.c(),_t.m(c,null)):_t&&(_t.d(1),_t=null),Ot&1&&Y!==(Y=(It[7]?"":It[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Vl(et,Y),Ot&2&&zt(t,"data-selected",It[1]),Ot&2&&Qa(t,"selected",It[1])},i:Oe,o:Oe,d(It){It&&fe(t),ut.d(),_t&&_t.d(),at=!1,Fi(W)}}}function K3(e,t,n){var H;let r,s,{feature:l}=t,{selected:p=!1}=t,{showPlaceType:c}=t,{missingIconsCache:y}=t,{iconsBaseUrl:w}=t;const T=(H=l.properties)==null?void 0:H.categories;let L,A,z=0,B=l.place_type[0]==="reverse";function Y(nt){A&&y.add(A),n(10,z++,z)}function et(nt){ni.call(this,e,nt)}function at(nt){ni.call(this,e,nt)}const W=nt=>Y(nt.currentTarget);return e.$$set=nt=>{"feature"in nt&&n(0,l=nt.feature),"selected"in nt&&n(1,p=nt.selected),"showPlaceType"in nt&&n(2,c=nt.showPlaceType),"missingIconsCache"in nt&&n(9,y=nt.missingIconsCache),"iconsBaseUrl"in nt&&n(3,w=nt.iconsBaseUrl)},e.$$.update=()=>{var nt,ut,_t,ct;if(e.$$.dirty&3640)do n(11,r--,r),n(4,L=T==null?void 0:T[r]),n(5,A=L?w+L.replace(/ /g,"_")+".svg":void 0);while(r>-1&&(!A||y.has(A)));e.$$.dirty&1&&n(6,s=l.id.startsWith("poi.")?(ut=(nt=l.properties)==null?void 0:nt.categories)==null?void 0:ut.join(", "):((ct=(_t=l.properties)==null?void 0:_t.place_type_name)==null?void 0:ct[0])??l.place_type[0])},n(11,r=(T==null?void 0:T.length)??0),[l,p,c,w,L,A,s,B,Y,y,z,r,et,at,W]}class J3 extends Pn{constructor(t){super(),Ln(this,t,K3,Y3,vn,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function Q3(e){let t;return{c(){t=ae("div"),t.innerHTML='',zt(t,"class","svelte-7cmwmc")},m(n,r){de(n,t,r)},p:Oe,i:Oe,o:Oe,d(n){n&&fe(t)}}}class $3 extends Pn{constructor(t){super(),Ln(this,t,null,Q3,vn,{})}}function tN(e){let t,n;return{c(){t=Ol("svg"),n=Ol("path"),zt(n,"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"),zt(t,"viewBox","0 0 60.006 21.412"),zt(t,"width","14"),zt(t,"height","20"),zt(t,"class","svelte-en2qvf")},m(r,s){de(r,t,s),Wt(t,n)},p:Oe,i:Oe,o:Oe,d(r){r&&fe(t)}}}class eN extends Pn{constructor(t){super(),Ln(this,t,null,tN,vn,{})}}function nN(e){let t,n,r;return{c(){t=Ol("svg"),n=Ol("circle"),r=Ol("path"),zt(n,"cx","4.789"),zt(n,"cy","4.787"),zt(n,"r","3.85"),hc(n,"stroke-width","1.875"),hc(n,"fill","none"),zt(r,"d","M12.063 12.063 7.635 7.635"),hc(r,"stroke-width","1.875"),hc(r,"stroke-linecap","round"),zt(t,"xmlns","http://www.w3.org/2000/svg"),zt(t,"width","13"),zt(t,"height","13"),zt(t,"viewBox","0 0 13 13"),zt(t,"class","svelte-1bpbt60")},m(s,l){de(s,t,l),Wt(t,n),Wt(t,r)},p:Oe,i:Oe,o:Oe,d(s){s&&fe(t)}}}class rN extends Pn{constructor(t){super(),Ln(this,t,null,nN,vn,{})}}function iN(e,t,n){const r=t[1],s=t[0],l=r-s;return e===r&&n?e:((e-s)%l+l)%l+s}function Ww(e){const t=[...e];return t[2]r[0]||s.maxZoom!=null&&s.maxZoomDate.now()){if(!Uf.coords)break t;return Uf.coords}let l;try{return l=await new Promise((p,c)=>{n.signal.addEventListener("abort",()=>{c(Error("aborted"))}),navigator.geolocation.getCurrentPosition(y=>{p([y.coords.longitude,y.coords.latitude].map(w=>w.toFixed(6)).join(","))},y=>{c(y)},s)}),l}catch{}finally{s.cachedLocationExpiry&&(Uf={time:Date.now(),coords:l})}if(n.signal.aborted)return}if(s.type==="server-geolocation")return"ip";if(r&&s.type==="map-center")return r[1].toFixed(6)+","+r[2].toFixed(6)}}const Zw=/(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,Hw=/(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,Xw=/(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,Yw=/(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 sN(e){if(!["DMS","DM","DD"].includes(e))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){if(e=="DD")return this.decimalCoordinates;const t=this.decimalCoordinates.split(",").map(p=>Number(p.trim()));let n=Kw(t[0],e),r=Kw(t[1],e);n.endsWith('.0"')&&r.endsWith('.0"')&&(n=n.replace(/\.0"$/,'"'),r=r.replace(/\.0"$/,'"'));const s=t[0]>=0?" N":" S",l=t[1]>=0?" E":" W";return`${n+s}, ${r+l}`}else throw new Error("no decimal coordinates to convert")}function Kw(e,t){const n=Math.abs(e),r=Math.floor(n),s=(n-r)*60;if(t=="DM"){let c=aN(s,3).toFixed(3).padStart(6,"0");return`${r}° ${c}'`}let l=Math.floor(s),p=((s-l)*60).toFixed(1).padStart(4,"0");return l=l.toString().padStart(2,"0"),`${r}° ${l}' ${p}"`}function aN(e,t){const n=Math.pow(10,t);return Math.round((e+Number.EPSILON)*n)/n}function G0(e,t){t||(t=5),e=e.replace(/\s+/g," ").trim();let n=null,r=null,s="",l="",p=[],c=!1;if(Zw.test(e))if(p=Zw.exec(e),c=um(p),c){if(n=p[2],r=p[6],n.includes(",")&&(n=n.replace(",",".")),r.includes(",")&&(r=r.replace(",",".")),Number(Math.round(n))==Number(n))throw new Error("integer only coordinate provided");if(Number(Math.round(r))==Number(r))throw new Error("integer only coordinate provided");p[1]?(s=p[1],l=p[5]):p[4]&&(s=p[4],l=p[8])}else throw new Error("invalid decimal coordinate format");else if(Hw.test(e))if(p=Hw.exec(e),c=um(p),c)n=Math.abs(parseInt(p[2])),p[4]&&(n+=p[4]/60),p[6]&&(n+=p[6].replace(",",".")/3600),parseInt(p[2])<0&&(n=-1*n),r=Math.abs(parseInt(p[9])),p[11]&&(r+=p[11]/60),p[13]&&(r+=p[13].replace(",",".")/3600),parseInt(p[9])<0&&(r=-1*r),p[1]?(s=p[1],l=p[8]):p[7]&&(s=p[7],l=p[14]);else throw new Error("invalid DMS coordinates format");else if(Xw.test(e))if(p=Xw.exec(e),c=um(p),c)n=Math.abs(parseInt(p[2])),p[4]&&(n+=p[4]/60),p[6]&&(n+=p[6]/3600),parseInt(p[2])<0&&(n=-1*n),r=Math.abs(parseInt(p[10])),p[12]&&(r+=p[12]/60),p[14]&&(r+=p[14]/3600),parseInt(p[10])<0&&(r=-1*r),p[1]?(s=p[1],l=p[9]):p[8]&&(s=p[8],l=p[16]);else throw new Error("invalid DMS coordinates format");else if(Yw.test(e))if(p=Yw.exec(e),c=um(p),c)n=Math.abs(parseInt(p[2])),p[4]&&(n+=p[4]/60),p[6]&&(n+=p[6]/3600),parseInt(p[2])<0&&(n=-1*n),r=Math.abs(parseInt(p[10])),p[12]&&(r+=p[12]/60),p[14]&&(r+=p[14]/3600),parseInt(p[10])<0&&(r=-1*r),p[1]?(s=p[1],l=p[9]):p[8]&&(s=p[8],l=p[16]);else throw new Error("invalid coordinates format");if(c){if(Math.abs(r)>=180)throw new Error("invalid longitude value");if(Math.abs(n)>=90)throw new Error("invalid latitude value");if((s||l)&&(!s||!l))throw new Error("invalid coordinates format");if(s&&s==l)throw new Error("invalid coordinates format");let y=/S|SOUTH/i;y.test(s)&&n>0&&(n=-1*n),y=/W|WEST/i,y.test(l)&&r>0&&(r=-1*r);const w=p[0].trim();let T,L;const A=/[,/;\u0020]/g,z=w.match(A);if(z==null){const et=Math.floor(e.length/2);T=w.substring(0,et).trim(),L=w.substring(et).trim()}else{let et;z.length%2==1?et=Math.floor(z.length/2):et=z.length/2-1;let at=0;if(et==0)at=w.indexOf(z[0]),T=w.substring(0,at).trim(),L=w.substring(at+1).trim();else{let W=0,H=0;for(;W<=et;)at=w.indexOf(z[W],H),H=at+1,W++;T=w.substring(0,at).trim(),L=w.substring(at+1).trim()}}const B=T.split(".");if(B.length==2&&B[1]==0&&B[1].length!=2)throw new Error("invalid coordinates format");const Y=L.split(".");if(Y.length==2&&Y[1]==0&&Y[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(T)||/^\d+$/.test(L))throw new Error("degree only coordinate/s provided");return isNaN(n)&&n.includes(",")&&(n=n.replace(",",".")),n=Number(Number(n).toFixed(t)),isNaN(r)&&r.includes(",")&&(r=r.replace(",",".")),r=Number(Number(r).toFixed(t)),Object.freeze({verbatimCoordinates:w,verbatimLatitude:T,verbatimLongitude:L,decimalLatitude:n,decimalLongitude:r,decimalCoordinates:`${n},${r}`,closeEnough:lN,toCoordinateFormat:sN})}else throw new Error("coordinates pattern match failed")}function um(e){if(!isNaN(e[0]))return!1;const t=[...e];if(t.shift(),t.length%2>0)return!1;const n=/^[-+]?\d+([\.,]\d+)?$/,r=/[eastsouthnorthwest]+/i,s=t.length/2;for(let l=0;l{t.decimalLatitude?e.push(t):e.push({...t,...hN})}),[...e,...pN,...fN]}const gN=dN();G0.formats=gN.map(e=>e.verbatimCoordinates);const mN=G0;function Qw(e,t,n){const r=e.slice();return r[81]=t[n],r[83]=n,r}function $w(e){let t,n;return t=new $3({}),{c(){nn(t.$$.fragment)},m(r,s){$e(t,r,s),n=!0},i(r){n||(ee(t.$$.fragment,r),n=!0)},o(r){le(t.$$.fragment,r),n=!1},d(r){tn(t,r)}}}function t2(e){let t,n,r,s,l;return n=new eN({}),{c(){t=ae("button"),nn(n.$$.fragment),zt(t,"type","button"),zt(t,"title",e[9]),zt(t,"class","svelte-zh3kmv"),Qa(t,"active",e[0])},m(p,c){de(p,t,c),$e(n,t,null),r=!0,s||(l=an(t,"click",e[67]),s=!0)},p(p,c){(!r||c[0]&512)&&zt(t,"title",p[9]),(!r||c[0]&1)&&Qa(t,"active",p[0])},i(p){r||(ee(n.$$.fragment,p),r=!0)},o(p){le(n.$$.fragment,p),r=!1},d(p){p&&fe(t),tn(n),s=!1,l()}}}function yN(e){let t,n=[],r=new Map,s,l,p,c=Em(e[14]);const y=w=>w[81].id+(w[81].address?","+w[81].address:"");for(let w=0;w{ct=null}),Zo()),(!H||oe[0]&2)&&Qa(w,"displayable",Et[1]!==""),Et[5]===!0?bt?(bt.p(Et,oe),oe[0]&32&&ee(bt,1)):(bt=t2(Et),bt.c(),ee(bt,1),bt.m(r,B)):bt&&(Wo(),le(bt,1,1,()=>{bt=null}),Zo()),Ot&&Ot.p&&(!H||oe[1]&134217728)&&Hs(Ot,It,Et,Et[58],H?Zs(It,Et[58],oe,null):Xs(Et[58]),null);let ge=et;et=Qt(Et),et===ge?~et&&Pt[et].p(Et,oe):(at&&(Wo(),le(Pt[ge],1,1,()=>{Pt[ge]=null}),Zo()),~et?(at=Pt[et],at?at.p(Et,oe):(at=Pt[et]=dt[et](Et),at.c()),ee(at,1),at.m(n,null)):at=null),(!H||oe[0]&4&&W!==(W=wm(Et[2])+" svelte-zh3kmv"))&&zt(n,"class",W),(!H||oe[0]&22)&&Qa(n,"can-collapse",Et[4]&&Et[1]==="")},i(Et){H||(ee(_t),ee(l.$$.fragment,Et),ee(L.$$.fragment,Et),ee(ct),ee(bt),ee(Ot,Et),ee(at),H=!0)},o(Et){le(_t),le(l.$$.fragment,Et),le(L.$$.fragment,Et),le(ct),le(bt),le(Ot,Et),le(at),H=!1},d(Et){Et&&(fe(t),fe(n)),tn(l),e[61](null),tn(L),ct&&ct.d(),bt&&bt.d(),Ot&&Ot.d(Et),~et&&Pt[et].d(),nt=!1,Fi(ut)}}}function wN(e,t,n){let r,{$$slots:s={},$$scope:l}=t,{class:p=void 0}=t,{apiKey:c}=t,{bbox:y=void 0}=t,{clearButtonTitle:w="clear"}=t,{clearOnBlur:T=!1}=t,{collapsed:L=!1}=t,{country:A=void 0}=t,{debounceSearch:z=200}=t,{enableReverse:B=!1}=t,{errorMessage:Y="Something went wrong…"}=t,{filter:et=()=>!0}=t,{flyTo:at=!0}=t,{fuzzyMatch:W=!0}=t,{language:H=void 0}=t,{limit:nt=void 0}=t,{mapController:ut=void 0}=t,{minLength:_t=2}=t,{noResultsMessage:ct="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!"}=t,{placeholder:bt="Search"}=t,{proximity:It=[{type:"server-geolocation"}]}=t,{reverseActive:Ot=B==="always"}=t,{reverseButtonTitle:dt="toggle reverse geocoding"}=t,{searchValue:Pt=""}=t,{showFullGeometry:Qt=!0}=t,{showPlaceType:Et="ifNeeded"}=t,{showResultsWhileTyping:oe=!0}=t,{selectFirst:ge=!0}=t,{flyToSelected:Te=!1}=t,{markerOnSelected:Fe=!0}=t,{types:rn=void 0}=t,{excludeTypes:En=!1}=t,{zoom:Me=16}=t,{maxZoom:Pe=18}=t,{apiUrl:Mn="https://api.maptiler.com/geocoding"}=t,{fetchParameters:pr={}}=t,{iconsBaseUrl:zn="https://cdn.maptiler.com/maptiler-geocoding-control/v1.2.2/icons/"}=t,{adjustUrlQuery:jn=X=>{}}=t;function Cr(){Mt.focus()}function qr(){Mt.blur()}function Bi(X,mt=!0){n(1,Pt=X),mt?(n(15,hn=-1),fl()):(zr(),setTimeout(()=>{Mt.focus(),Mt.select()}))}function Zt(){n(14,Vt=void 0),n(55,Re=void 0),n(15,hn=-1)}function on(){n(54,Ee=[]),n(55,Re=void 0)}let cn=!1,Vt,Ee,Re,Or="",Mt,hn=-1,Wr,Qe=[],Hn,_o,rs,Cs;const Da=new Set,mi=Ld();Ul(()=>{ut&&(ut.setEventHandler(void 0),ut.indicateReverse(!1),ut.setSelectedMarker(-1),ut.setMarkers(void 0,void 0))});function fl(X){if(_o&&(clearTimeout(_o),_o=void 0),hn>-1&&Vt)n(55,Re=Vt[hn]),n(1,Pt=Re.place_type[0]==="reverse"?Re.place_name:Re.place_name.replace(/,.*/,"")),n(18,Wr=void 0),n(54,Ee=void 0),n(15,hn=-1);else if(Pt){const mt=X||!is(Pt);Ht(Pt,{exact:!0}).then(()=>{n(54,Ee=Vt),n(55,Re=void 0),mt&&zo()}).catch(ht=>n(18,Wr=ht))}}function is(X){try{return mN(X,6)}catch{return!1}}async function Ht(X,{byId:mt=!1,exact:ht=!1}={}){n(18,Wr=void 0),Hn==null||Hn.abort();const xt=new AbortController;n(19,Hn=xt);try{const At=is(X),Rt=new URLSearchParams;if(H!==void 0&&Rt.set("language",Array.isArray(H)?H.join(","):H??""),rn&&Rt.set("types",rn.join(",")),En&&Rt.set("excludeTypes",String(En)),y&&Rt.set("bbox",y.map(ze=>ze.toFixed(6)).join(",")),A&&Rt.set("country",Array.isArray(A)?A.join(","):A),!mt&&!At){const ze=await oN(ut,It,xt);ze&&Rt.set("proximity",ze),(ht||!oe)&&Rt.set("autocomplete","false"),Rt.set("fuzzyMatch",String(W))}nt!==void 0&&(!At||(rn==null?void 0:rn.length)===1)&&Rt.set("limit",String(nt)),Rt.set("key",c),jn(Rt);const Ft=Mn+"/"+encodeURIComponent(At?At.decimalLongitude+","+At.decimalLatitude:X)+".json?"+Rt.toString();if(Ft===Or){mt?(n(14,Vt=void 0),n(55,Re=Qe[0])):n(14,Vt=Qe);return}Or=Ft;const ve=await fetch(Ft,{signal:xt.signal,...pr});if(!ve.ok)throw new Error(await ve.text());const we=await ve.json();mi("response",{url:Ft,featureCollection:we}),mt?(n(14,Vt=void 0),n(55,Re=we.features[0]),Qe=[Re]):(n(14,Vt=we.features.filter(et)),At&&Vt.unshift({type:"Feature",properties:{},id:"reverse_"+At.decimalLongitude+"_"+At.decimalLatitude,text:At.decimalLatitude+", "+At.decimalLongitude,place_name:At.decimalLatitude+", "+At.decimalLongitude,place_type:["reverse"],center:[At.decimalLongitude,At.decimalLatitude],bbox:[At.decimalLongitude,At.decimalLatitude,At.decimalLongitude,At.decimalLatitude],geometry:{type:"Point",coordinates:[At.decimalLongitude,At.decimalLatitude]}}),Qe=Vt,At&&Mt.focus())}catch(At){if(At&&typeof At=="object"&&"name"in At&&At.name==="AbortError")return;throw At}finally{xt===Hn&&n(19,Hn=void 0)}}function zo(){var ht;if(!(Ee!=null&&Ee.length)||!at)return;const X=[180,90,-180,-90],mt=!Ee.some(xt=>!xt.matching_text);for(const xt of Ee)if(mt||!xt.matching_text)for(const At of[0,1,2,3])X[At]=Math[At<2?"min":"max"](X[At],((ht=xt.bbox)==null?void 0:ht[At])??xt.center[At%2]);ut&&Ee.length>0&&(Re&&X[0]===X[2]&&X[1]===X[3]?ut.flyTo(Re.center,Me):ut.fitBounds(Ww(X),50,Pe))}function Vi(X){n(0,Ot=B==="always"),n(14,Vt=void 0),n(55,Re=void 0),n(15,hn=-1),Bi(X[1].toFixed(6)+", "+iN(X[0],[-180,180],!0).toFixed(6),!1)}function dl(X){if(!Vt)return;let mt=X.key==="ArrowDown"?1:X.key==="ArrowUp"?-1:0;mt&&(hn===(ge?0:-1)&&mt===-1&&n(15,hn=Vt.length),n(15,hn+=mt),hn>=Vt.length&&n(15,hn=-1),hn<0&&ge&&n(15,hn=0),X.preventDefault())}function zr(X=!0){if(n(18,Wr=void 0),oe){if(_o&&clearTimeout(_o),Pt.length<_t)return;const mt=Pt;_o=window.setTimeout(()=>{Ht(mt).catch(ht=>n(18,Wr=ht))},X?z:0)}else n(14,Vt=void 0),n(18,Wr=void 0)}function $t(X){n(55,Re=X),n(1,Pt=X.place_name),n(15,hn=-1)}const Ze=()=>Mt.focus();function je(X){Di[X?"unshift":"push"](()=>{Mt=X,n(17,Mt)})}function xr(){Pt=this.value,n(1,Pt),n(13,cn),n(27,T)}const Fo=()=>n(13,cn=!0),Ge=()=>n(13,cn=!1),ca=()=>zr(),Tr=()=>{n(1,Pt=""),Mt.focus()},it=()=>n(0,Ot=!Ot),F=()=>n(18,Wr=void 0),U=X=>n(15,hn=X),Z=X=>$t(X),Q=()=>{ge||n(15,hn=-1)},gt=()=>{};return e.$$set=X=>{"class"in X&&n(2,p=X.class),"apiKey"in X&&n(25,c=X.apiKey),"bbox"in X&&n(26,y=X.bbox),"clearButtonTitle"in X&&n(3,w=X.clearButtonTitle),"clearOnBlur"in X&&n(27,T=X.clearOnBlur),"collapsed"in X&&n(4,L=X.collapsed),"country"in X&&n(28,A=X.country),"debounceSearch"in X&&n(29,z=X.debounceSearch),"enableReverse"in X&&n(5,B=X.enableReverse),"errorMessage"in X&&n(6,Y=X.errorMessage),"filter"in X&&n(30,et=X.filter),"flyTo"in X&&n(31,at=X.flyTo),"fuzzyMatch"in X&&n(32,W=X.fuzzyMatch),"language"in X&&n(33,H=X.language),"limit"in X&&n(34,nt=X.limit),"mapController"in X&&n(35,ut=X.mapController),"minLength"in X&&n(36,_t=X.minLength),"noResultsMessage"in X&&n(7,ct=X.noResultsMessage),"placeholder"in X&&n(8,bt=X.placeholder),"proximity"in X&&n(37,It=X.proximity),"reverseActive"in X&&n(0,Ot=X.reverseActive),"reverseButtonTitle"in X&&n(9,dt=X.reverseButtonTitle),"searchValue"in X&&n(1,Pt=X.searchValue),"showFullGeometry"in X&&n(38,Qt=X.showFullGeometry),"showPlaceType"in X&&n(10,Et=X.showPlaceType),"showResultsWhileTyping"in X&&n(39,oe=X.showResultsWhileTyping),"selectFirst"in X&&n(11,ge=X.selectFirst),"flyToSelected"in X&&n(40,Te=X.flyToSelected),"markerOnSelected"in X&&n(41,Fe=X.markerOnSelected),"types"in X&&n(42,rn=X.types),"excludeTypes"in X&&n(43,En=X.excludeTypes),"zoom"in X&&n(44,Me=X.zoom),"maxZoom"in X&&n(45,Pe=X.maxZoom),"apiUrl"in X&&n(46,Mn=X.apiUrl),"fetchParameters"in X&&n(47,pr=X.fetchParameters),"iconsBaseUrl"in X&&n(12,zn=X.iconsBaseUrl),"adjustUrlQuery"in X&&n(48,jn=X.adjustUrlQuery),"$$scope"in X&&n(58,l=X.$$scope)},e.$$.update=()=>{if(e.$$.dirty[0]&134225920&&setTimeout(()=>{n(16,rs=cn),T&&!cn&&n(1,Pt="")}),e.$$.dirty[0]&16386|e.$$.dirty[1]&32&&Pt.length<_t&&(n(55,Re=void 0),n(14,Vt=void 0),n(18,Wr=void 0),n(54,Ee=Vt)),e.$$.dirty[1]&16777344&&Qt&&Re&&!Re.address&&Re.geometry.type==="Point"&&Re.place_type[0]!=="reverse"&&Ht(Re.id,{byId:!0}).catch(X=>n(18,Wr=X)),e.$$.dirty[1]&50356241&&(ut&&Re&&Re.id!==Cs&&at&&(!Re.bbox||Re.bbox[0]===Re.bbox[2]&&Re.bbox[1]===Re.bbox[3]?ut.flyTo(Re.center,Re.id.startsWith("poi.")||Re.id.startsWith("address.")?Pe:Me):ut.fitBounds(Ww(Re.bbox),50,Pe),n(14,Vt=void 0),n(54,Ee=void 0),n(15,hn=-1)),n(56,Cs=Re==null?void 0:Re.id)),e.$$.dirty[0]&18432&&ge&&Vt!=null&&Vt.length&&n(15,hn=0),e.$$.dirty[0]&2050&&(ge||n(15,hn=-1)),e.$$.dirty[0]&16384|e.$$.dirty[1]&8388608&&Ee!==Vt&&n(54,Ee=void 0),e.$$.dirty[0]&81921|e.$$.dirty[1]&8388624&&ut&&ut.setEventHandler(X=>{switch(X.type){case"mapClick":Ot&&Vi(X.coordinates);break;case"markerClick":{const mt=Vt==null?void 0:Vt.find(ht=>ht.id===X.id);mt&&$t(mt)}break;case"markerMouseEnter":Ee&&n(15,hn=rs?(Vt==null?void 0:Vt.findIndex(mt=>mt.id===X.id))??-1:-1);break;case"markerMouseLeave":Ee&&n(15,hn=-1);break}}),e.$$.dirty[0]&49152&&n(57,r=Vt==null?void 0:Vt[hn]),e.$$.dirty[1]&67133969&&ut&&r&&at&&Te&&ut.flyTo(r.center,r.id.startsWith("poi.")||r.id.startsWith("address.")?Pe:Me),e.$$.dirty[1]&1040&&(Fe||ut==null||ut.setMarkers(void 0,void 0)),e.$$.dirty[1]&75498512&&ut&&Fe&&!Ee&&(ut.setMarkers(r?[r]:void 0,void 0),ut.setSelectedMarker(r?0:-1)),e.$$.dirty[1]&25165840&&ut&&ut.setMarkers(Ee,Re),e.$$.dirty[0]&32768|e.$$.dirty[1]&8388624&&Ee&&ut&&ut.setSelectedMarker(hn),e.$$.dirty[0]&2|e.$$.dirty[1]&16&&ut){const X=is(Pt);ut.setReverseMarker(X?[X.decimalLongitude,X.decimalLatitude]:void 0)}e.$$.dirty[1]&67108864&&mi("select",r),e.$$.dirty[1]&16777216&&mi("pick",Re),e.$$.dirty[0]&81920&&mi("optionsVisibilityChange",rs&&!!Vt),e.$$.dirty[0]&16384&&mi("featuresListed",Vt),e.$$.dirty[1]&8388608&&mi("featuresMarked",Ee),e.$$.dirty[0]&1&&mi("reverseToggle",Ot),e.$$.dirty[0]&2&&mi("queryChange",Pt),e.$$.dirty[0]&1|e.$$.dirty[1]&16&&ut&&ut.indicateReverse(Ot)},[Ot,Pt,p,w,L,B,Y,ct,bt,dt,Et,ge,zn,cn,Vt,hn,rs,Mt,Wr,Hn,Da,fl,dl,zr,$t,c,y,T,A,z,et,at,W,H,nt,ut,_t,It,Qt,oe,Te,Fe,rn,En,Me,Pe,Mn,pr,jn,Cr,qr,Bi,Zt,on,Ee,Re,Cs,r,l,s,Ze,je,xr,Fo,Ge,ca,Tr,it,F,U,Z,Q,gt]}class SN extends Pn{constructor(t){super(),Ln(this,t,wN,xN,vn,{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]}}function n2(e){let t,n,r;return n=new SN({props:{mapController:e[1],apiKey:e[0]}}),{c(){t=ae("div"),nn(n.$$.fragment),zt(t,"class","svelte-ixhnie")},m(s,l){de(s,t,l),$e(n,t,null),r=!0},p(s,l){const p={};l&2&&(p.mapController=s[1]),l&1&&(p.apiKey=s[0]),n.$set(p)},i(s){r||(ee(n.$$.fragment,s),r=!0)},o(s){le(n.$$.fragment,s),r=!1},d(s){s&&fe(t),tn(n)}}}function EN(e){let t,n,r=e[1]&&n2(e);return{c(){r&&r.c(),t=ll()},m(s,l){r&&r.m(s,l),de(s,t,l),n=!0},p(s,[l]){s[1]?r?(r.p(s,l),l&2&&ee(r,1)):(r=n2(s),r.c(),ee(r,1),r.m(t.parentNode,t)):r&&(Wo(),le(r,1,1,()=>{r=null}),Zo())},i(s){n||(ee(r),n=!0)},o(s){le(r),n=!1},d(s){s&&fe(t),r&&r.d(s)}}}function IN(e,t,n){let r,{apiKey:s}=t,{map:l}=t;return e.$$set=p=>{"apiKey"in p&&n(0,s=p.apiKey),"map"in p&&n(2,l=p.map)},e.$$.update=()=>{e.$$.dirty&4&&n(1,r=l?F3(l,Ep):null)},[s,r,l]}class CN extends Pn{constructor(t){super(),Ln(this,t,IN,EN,vn,{apiKey:0,map:2})}}function r2(e){let t,n;return{c(){t=ae("div"),n=Wn(e[0]),zt(t,"class","svelte-1uuov7f")},m(r,s){de(r,t,s),Wt(t,n)},p(r,s){s&1&&Vl(n,r[0])},d(r){r&&fe(t)}}}function TN(e){let t,n=e[0]&&r2(e);return{c(){n&&n.c(),t=ll()},m(r,s){n&&n.m(r,s),de(r,t,s)},p(r,[s]){r[0]?n?n.p(r,s):(n=r2(r),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},i:Oe,o:Oe,d(r){r&&fe(t),n&&n.d(r)}}}function LN(e,t,n){let{loading:r}=t;return e.$$set=s=>{"loading"in s&&n(0,r=s.loading)},[r]}class PN extends Pn{constructor(t){super(),Ln(this,t,LN,TN,vn,{loading:0})}}var uo=63710088e-1,j0={centimeters:uo*100,centimetres:uo*100,degrees:uo/111325,feet:uo*3.28084,inches:uo*39.37,kilometers:uo/1e3,kilometres:uo/1e3,meters:uo,metres:uo,miles:uo/1609.344,millimeters:uo*1e3,millimetres:uo*1e3,nauticalmiles:uo/1852,radians:1,yards:uo*1.0936},MN={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/uo,yards:1.0936133},Yv={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,millimeters:1e6,millimetres:1e6,yards:1.195990046};function oa(e,t,n){n===void 0&&(n={});var r={type:"Feature"};return(n.id===0||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function AN(e,t,n){switch(e){case"Point":return qo(t).geometry;case"LineString":return Us(t).geometry;case"Polygon":return q0(t).geometry;case"MultiPoint":return YE(t).geometry;case"MultiLineString":return XE(t).geometry;case"MultiPolygon":return KE(t).geometry;default:throw new Error(e+" is invalid")}}function qo(e,t,n){if(n===void 0&&(n={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ty(e[0])||!ty(e[1]))throw new Error("coordinates must contain numbers");var r={type:"Point",coordinates:e};return oa(r,t,n)}function kN(e,t,n){return n===void 0&&(n={}),Mc(e.map(function(r){return qo(r,t)}),n)}function q0(e,t,n){n===void 0&&(n={});for(var r=0,s=e;r=0))throw new Error("precision must be a positive number");var n=Math.pow(10,t||0);return Math.round(e*n)/n}function W0(e,t){t===void 0&&(t="kilometers");var n=j0[t];if(!n)throw new Error(t+" units is invalid");return e*n}function Sy(e,t){t===void 0&&(t="kilometers");var n=j0[t];if(!n)throw new Error(t+" units is invalid");return e/n}function zN(e,t){return Id(Sy(e,t))}function FN(e){var t=e%360;return t<0&&(t+=360),t}function Id(e){var t=e%(2*Math.PI);return t*180/Math.PI}function Gs(e){var t=e%360;return t*Math.PI/180}function BN(e,t,n){if(t===void 0&&(t="kilometers"),n===void 0&&(n="kilometers"),!(e>=0))throw new Error("length must be a positive number");return W0(Sy(e,t),n)}function VN(e,t,n){if(t===void 0&&(t="meters"),n===void 0&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var r=Yv[t];if(!r)throw new Error("invalid original units");var s=Yv[n];if(!s)throw new Error("invalid final units");return e/r*s}function ty(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}function Z0(e){return!!e&&e.constructor===Object}function UN(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(e.length!==4&&e.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(t){if(!ty(t))throw new Error("bbox must only contain numbers")})}function GN(e){if(!e)throw new Error("id is required");if(["string","number"].indexOf(typeof e)===-1)throw new Error("id must be a number or a string")}const jN=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:Yv,bearingToAzimuth:FN,convertArea:VN,convertLength:BN,degreesToRadians:Gs,earthRadius:uo,factors:j0,feature:oa,featureCollection:Mc,geometry:AN,geometryCollection:NN,isNumber:ty,isObject:Z0,lengthToDegrees:zN,lengthToRadians:Sy,lineString:Us,lineStrings:RN,multiLineString:XE,multiPoint:YE,multiPolygon:KE,point:qo,points:kN,polygon:q0,polygons:DN,radiansToDegrees:Id,radiansToLength:W0,round:ON,unitsFactors:MN,validateBBox:UN,validateId:GN},Symbol.toStringTag,{value:"Module"}));function Cd(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if(e.type==="Feature"&&e.geometry!==null&&e.geometry.type==="Point")return e.geometry.coordinates;if(e.type==="Point")return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function xp(e){if(Array.isArray(e))return e;if(e.type==="Feature"){if(e.geometry!==null)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function JE(e,t,n){if(n===void 0&&(n={}),n.final===!0)return qN(e,t);var r=Cd(e),s=Cd(t),l=Gs(r[0]),p=Gs(s[0]),c=Gs(r[1]),y=Gs(s[1]),w=Math.sin(p-l)*Math.cos(y),T=Math.cos(c)*Math.sin(y)-Math.sin(c)*Math.cos(y)*Math.cos(p-l);return Id(Math.atan2(w,T))}function qN(e,t){var n=JE(t,e);return n=(n+180)%360,n}function Gf(e,t,n){n===void 0&&(n={});var r=Cd(e),s=Cd(t),l=Gs(s[1]-r[1]),p=Gs(s[0]-r[0]),c=Gs(r[1]),y=Gs(s[1]),w=Math.pow(Math.sin(l/2),2)+Math.pow(Math.sin(p/2),2)*Math.cos(c)*Math.cos(y);return W0(2*Math.atan2(Math.sqrt(w),Math.sqrt(1-w)),n.units)}function i2(e,t,n,r){r===void 0&&(r={});var s=Cd(e),l=Gs(s[0]),p=Gs(s[1]),c=Gs(n),y=Sy(t,r.units),w=Math.asin(Math.sin(p)*Math.cos(y)+Math.cos(p)*Math.sin(y)*Math.cos(c)),T=l+Math.atan2(Math.sin(c)*Math.sin(y)*Math.cos(p),Math.cos(y)-Math.sin(p)*Math.sin(w)),L=Id(T),A=Id(w);return qo([L,A],r.properties)}function qd(e,t,n){if(e!==null)for(var r,s,l,p,c,y,w,T=0,L=0,A,z=e.type,B=z==="FeatureCollection",Y=z==="Feature",et=B?e.features.length:1,at=0;aty||B>w||Y>T){c=L,y=r,w=B,T=Y,l=0;return}var et=Us([c,L],n.properties);if(t(et,r,s,Y,l)===!1)return!1;l++,c=L})===!1)return!1}}})}function JN(e,t,n){var r=n,s=!1;return $E(e,function(l,p,c,y,w){s===!1&&n===void 0?r=l:r=t(r,l,p,c,y,w),s=!0}),r}function tI(e,t){if(!e)throw new Error("geojson is required");Rp(e,function(n,r,s){if(n.geometry!==null){var l=n.geometry.type,p=n.geometry.coordinates;switch(l){case"LineString":if(t(n,r,s,0,0)===!1)return!1;break;case"Polygon":for(var c=0;cs?n:s,w=r>l?r:l;return[p,c,y,w]}var X0={exports:{}},eI={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(kd,function(){function n(W,H,nt,ut,_t){(function ct(bt,It,Ot,dt,Pt){for(;dt>Ot;){if(dt-Ot>600){var Qt=dt-Ot+1,Et=It-Ot+1,oe=Math.log(Qt),ge=.5*Math.exp(2*oe/3),Te=.5*Math.sqrt(oe*ge*(Qt-ge)/Qt)*(Et-Qt/2<0?-1:1),Fe=Math.max(Ot,Math.floor(It-Et*ge/Qt+Te)),rn=Math.min(dt,Math.floor(It+(Qt-Et)*ge/Qt+Te));ct(bt,It,Fe,rn,Pt)}var En=bt[It],Me=Ot,Pe=dt;for(r(bt,Ot,It),Pt(bt[dt],En)>0&&r(bt,Ot,dt);Me0;)Pe--}Pt(bt[Ot],En)===0?r(bt,Ot,Pe):r(bt,++Pe,dt),Pe<=It&&(Ot=Pe+1),It<=Pe&&(dt=Pe-1)}})(W,H,nt||0,ut||W.length-1,_t||s)}function r(W,H,nt){var ut=W[H];W[H]=W[nt],W[nt]=ut}function s(W,H){return WH?1:0}var l=function(W){W===void 0&&(W=9),this._maxEntries=Math.max(4,W),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function p(W,H,nt){if(!nt)return H.indexOf(W);for(var ut=0;ut=W.minX&&H.maxY>=W.minY}function et(W){return{children:W,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function at(W,H,nt,ut,_t){for(var ct=[H,nt];ct.length;)if(!((nt=ct.pop())-(H=ct.pop())<=ut)){var bt=H+Math.ceil((nt-H)/ut/2)*ut;n(W,bt,H,nt,_t),ct.push(H,bt,bt,nt)}}return l.prototype.all=function(){return this._all(this.data,[])},l.prototype.search=function(W){var H=this.data,nt=[];if(!Y(W,H))return nt;for(var ut=this.toBBox,_t=[];H;){for(var ct=0;ct=0&&_t[H].children.length>this._maxEntries;)this._split(_t,H),H--;this._adjustParentBBoxes(ut,_t,H)},l.prototype._split=function(W,H){var nt=W[H],ut=nt.children.length,_t=this._minEntries;this._chooseSplitAxis(nt,_t,ut);var ct=this._chooseSplitIndex(nt,_t,ut),bt=et(nt.children.splice(ct,nt.children.length-ct));bt.height=nt.height,bt.leaf=nt.leaf,c(nt,this.toBBox),c(bt,this.toBBox),H?W[H-1].children.push(bt):this._splitRoot(nt,bt)},l.prototype._splitRoot=function(W,H){this.data=et([W,H]),this.data.height=W.height+1,this.data.leaf=!1,c(this.data,this.toBBox)},l.prototype._chooseSplitIndex=function(W,H,nt){for(var ut,_t,ct,bt,It,Ot,dt,Pt=1/0,Qt=1/0,Et=H;Et<=nt-H;Et++){var oe=y(W,0,Et,this.toBBox),ge=y(W,Et,nt,this.toBBox),Te=(_t=oe,ct=ge,bt=void 0,It=void 0,Ot=void 0,dt=void 0,bt=Math.max(_t.minX,ct.minX),It=Math.max(_t.minY,ct.minY),Ot=Math.min(_t.maxX,ct.maxX),dt=Math.min(_t.maxY,ct.maxY),Math.max(0,Ot-bt)*Math.max(0,dt-It)),Fe=A(oe)+A(ge);Te=H;Pt--){var Qt=W.children[Pt];w(bt,W.leaf?_t(Qt):Qt),It+=z(bt)}return It},l.prototype._adjustParentBBoxes=function(W,H,nt){for(var ut=nt;ut>=0;ut--)w(H[ut],W)},l.prototype._condense=function(W){for(var H=W.length-1,nt=void 0;H>=0;H--)W[H].children.length===0?H>0?(nt=W[H-1].children).splice(nt.indexOf(W[H]),1):this.clear():c(W[H],this.toBBox)},l})})(eI);var o4=eI.exports;const s4=ny(jN),a4=ny(e4),l4=ny(WD);var Za=o4,nI=s4,rI=a4,Uh=l4.default,u4=rI.featureEach;rI.coordEach;nI.polygon;var s2=nI.featureCollection;function iI(e){var t=new Za(e);return t.insert=function(n){if(n.type!=="Feature")throw new Error("invalid feature");return n.bbox=n.bbox?n.bbox:Uh(n),Za.prototype.insert.call(this,n)},t.load=function(n){var r=[];return Array.isArray(n)?n.forEach(function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:Uh(s),r.push(s)}):u4(n,function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:Uh(s),r.push(s)}),Za.prototype.load.call(this,r)},t.remove=function(n,r){if(n.type!=="Feature")throw new Error("invalid feature");return n.bbox=n.bbox?n.bbox:Uh(n),Za.prototype.remove.call(this,n,r)},t.clear=function(){return Za.prototype.clear.call(this)},t.search=function(n){var r=Za.prototype.search.call(this,this.toBBox(n));return s2(r)},t.collides=function(n){return Za.prototype.collides.call(this,this.toBBox(n))},t.all=function(){var n=Za.prototype.all.call(this);return s2(n)},t.toJSON=function(){return Za.prototype.toJSON.call(this)},t.fromJSON=function(n){return Za.prototype.fromJSON.call(this,n)},t.toBBox=function(n){var r;if(n.bbox)r=n.bbox;else if(Array.isArray(n)&&n.length===4)r=n;else if(Array.isArray(n)&&n.length===6)r=[n[0],n[1],n[3],n[4]];else if(n.type==="Feature")r=Uh(n);else if(n.type==="FeatureCollection")r=Uh(n);else throw new Error("invalid geojson");return{minX:r[0],minY:r[1],maxX:r[2],maxY:r[3]}},t}X0.exports=iI;X0.exports.default=iI;var c4=X0.exports;const h4=$v(c4);function p4(e,t){var n={},r=[];if(e.type==="LineString"&&(e=oa(e)),t.type==="LineString"&&(t=oa(t)),e.type==="Feature"&&t.type==="Feature"&&e.geometry!==null&&t.geometry!==null&&e.geometry.type==="LineString"&&t.geometry.type==="LineString"&&e.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var s=a2(e,t);return s&&r.push(s),Mc(r)}var l=h4();return l.load(o2(t)),ey(o2(e),function(p){ey(l.search(p),function(c){var y=a2(p,c);if(y){var w=xp(y).join(",");n[w]||(n[w]=!0,r.push(y))}})}),Mc(r)}function a2(e,t){var n=xp(e),r=xp(t);if(n.length!==2)throw new Error(" line1 must only contain 2 coordinates");if(r.length!==2)throw new Error(" line2 must only contain 2 coordinates");var s=n[0][0],l=n[0][1],p=n[1][0],c=n[1][1],y=r[0][0],w=r[0][1],T=r[1][0],L=r[1][1],A=(L-w)*(p-s)-(T-y)*(c-l),z=(T-y)*(l-w)-(L-w)*(s-y),B=(p-s)*(l-w)-(c-l)*(s-y);if(A===0)return null;var Y=z/A,et=B/A;if(Y>=0&&Y<=1&&et>=0&&et<=1){var at=s+Y*(p-s),W=l+Y*(c-l);return qo([at,W])}return null}function f4(e,t,n){n===void 0&&(n={});var r=qo([1/0,1/0],{dist:1/0}),s=0;return Rp(e,function(l){for(var p=xp(l),c=0;c0&&(et=Y.features[0],et.properties.dist=Gf(t,et,n),et.properties.location=s+Gf(y,et,n)),y.properties.dist{if(this.active&&!this.dragFrom)this.recalculateHovering(t);else if(this.active&&this.dragFrom){if(this.hover=="polygon"){let n=this.dragFrom[0]-t.lngLat.lng,r=this.dragFrom[1]-t.lngLat.lat;for(let s of this.points)s[0]-=n,s[1]-=r}else this.points[this.hover]=t.lngLat.toArray();this.dragFrom=t.lngLat.toArray(),this.redraw()}});ai(this,"onClick",t=>{if(this.beforeUpdate(),this.active&&this.cursor){let n=[];if(l2(this.points).forEach((r,s)=>{n.push([s+1,f4(r,this.cursor).properties.dist])}),n.sort((r,s)=>r[1]-s[1]),n.length>0){let r=n[0][0];this.points.splice(r,0,this.cursor.geometry.coordinates),this.hover=r}else this.points.push(this.cursor.geometry.coordinates),this.hover=this.points.length-1;this.redraw(),this.pointsUpdated()}else this.active&&typeof this.hover=="number"&&(this.points.splice(this.hover,1),this.hover=null,this.redraw(),this.pointsUpdated(),this.recalculateHovering(t))});ai(this,"onDoubleClick",t=>{this.active&&(t.preventDefault(),this.cursor=iv(t.lngLat.toArray()),this.onClick(t),this.finish())});ai(this,"onMouseDown",t=>{this.active&&!this.dragFrom&&this.hover!=null&&(t.preventDefault(),this.cursor=null,this.dragFrom=t.lngLat.toArray(),this.beforeUpdate(),this.redraw())});ai(this,"onMouseUp",()=>{this.active&&this.dragFrom&&(this.dragFrom=null,this.redraw(),this.pointsUpdated())});ai(this,"onKeypress",t=>{this.active&&(t.key=="Enter"?(t.stopPropagation(),this.finish()):t.key=="z"&&t.ctrlKey&&this.undo())});ai(this,"onKeyDown",t=>{this.active&&t.key=="Escape"&&(t.stopPropagation(),this.cancel())});this.map=t,this.active=!1,this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[],this.points=[],this.cursor=null,this.hover=null,this.dragFrom=null,this.previousStates=[],this.map.on("mousemove",this.onMouseMove),this.map.on("click",this.onClick),this.map.on("dblclick",this.onDoubleClick),this.map.on("mousedown",this.onMouseDown),this.map.on("mouseup",this.onMouseUp),document.addEventListener("keypress",this.onKeypress),document.addEventListener("keydown",this.onKeyDown)}tearDown(){this.map.off("mousemove",this.onMouseMove),this.map.off("click",this.onClick),this.map.off("dblclick",this.onDoubleClick),this.map.off("mousedown",this.onMouseDown),this.map.off("mouseup",this.onMouseUp),document.removeEventListener("keypress",this.onKeypress),document.removeEventListener("keydown",this.onKeyDown)}finish(){let t=this.polygonFeature();if(t)for(let n of this.eventListenersSuccess)n(t);else for(let n of this.eventListenersFailure)n();this.stop()}cancel(){for(let t of this.eventListenersFailure)t();this.stop()}addEventListenerSuccess(t){this.eventListenersSuccess.push(t)}addEventListenerUpdated(t){this.eventListenersUpdated.push(t)}addEventListenerFailure(t){this.eventListenersFailure.push(t)}clearEventListeners(){this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[]}startNew(){this.active=!0,this.map.doubleClickZoom.disable()}editExisting(t){this.active=!0,this.map.doubleClickZoom.disable(),this.points=JSON.parse(JSON.stringify(t.geometry.coordinates[0])),this.points.pop(),this.redraw()}stop(){this.map.doubleClickZoom.enable(),this.points=[],this.cursor=null,this.active=!1,this.hover=null,this.dragFrom=null,this.previousStates=[],this.redraw(),this.map.getCanvas().style.cursor="inherit"}undo(){this.dragFrom!=null||this.previousStates.length==0||(this.points=this.previousStates.pop(),this.hover=null,this.redraw())}redraw(){let t={type:"FeatureCollection",features:[]};this.points.forEach((s,l)=>{let p=iv(s);p.properties.hover=this.hover==l,p.properties.idx=l,t.features.push(p)}),t.features=t.features.concat(l2(this.points));let n=this.polygonFeature();n&&(n.properties.hover=this.hover=="polygon",t.features.push(n)),sI.set(t);let r="crosshair";this.hover!=null&&(r=this.dragFrom?"grabbing":"pointer"),this.map.getCanvas().style.cursor=r,aI.set(this.previousStates.length)}pointsUpdated(){let t=this.polygonFeature();if(t)for(let n of this.eventListenersUpdated)n(t)}recalculateHovering(t){this.cursor=null,this.hover=null;for(let n of this.map.queryRenderedFeatures(t.point,{layers:["edit-polygon-fill","edit-polygon-vertices"]}))if(n.geometry.type=="Polygon"){this.hover="polygon";break}else if(n.geometry.type=="Point"&&Object.hasOwn(n.properties,"idx")){this.hover=n.properties.idx;break}this.hover==null&&(this.cursor=iv(t.lngLat.toArray())),this.redraw()}polygonFeature(){if(this.points.length<3)return null;let t=this.points.map(oI),n=[JSON.parse(JSON.stringify(t))];return n[0].push(JSON.parse(JSON.stringify(n[0][0]))),{type:"Feature",geometry:{type:"Polygon",coordinates:n},properties:{}}}beforeUpdate(){this.previousStates.push(JSON.parse(JSON.stringify(this.points))),this.previousStates.length>y4&&this.previousStates.shift()}}function l2(e){let t=[];for(let n=0;n=3&&t.push({type:"Feature",geometry:{type:"LineString",coordinates:[e[e.length-1],e[0]]},properties:{}}),t}function v4(e){let t,n,r;return{c(){t=Wn("Undo ("),n=Wn(e[1]),r=Wn(")")},m(s,l){de(s,t,l),de(s,n,l),de(s,r,l)},p(s,l){l&2&&Vl(n,s[1])},d(s){s&&(fe(t),fe(n),fe(r))}}}function b4(e){let t;return{c(){t=Wn("Undo")},m(n,r){de(n,t,r)},p:Oe,d(n){n&&fe(t)}}}function x4(e){let t,n,r,s,l,p,c,y,w,T,L;function A(Y,et){return Y[1]==0?b4:v4}let z=A(e),B=z(e);return{c(){t=ae("div"),n=ae("button"),n.textContent="Finish",r=Ve(),s=ae("button"),s.textContent="Cancel",l=Ve(),p=ae("button"),B.c(),y=Ve(),w=ae("ul"),w.innerHTML=`
  • Click the map to add a vertex
  • Click a vertex to delete it
  • Drag a vertex or the polygon to move it
  • Press Control+Z @@ -614,7 +614,7 @@ and limitations under the License. or double click to finish
  • Press Escape - to cancel
  • `,p.disabled=c=e[1]==0,hc(t,"display","flex"),hc(t,"justify-content","space-between")},m(Y,et){de(Y,t,et),Wt(t,n),Wt(t,r),Wt(t,s),Wt(t,l),Wt(t,p),B.m(p,null),de(Y,y,et),de(Y,w,et),T||(L=[an(n,"click",e[2]),an(s,"click",e[3]),an(p,"click",e[4])],T=!0)},p(Y,[et]){z===(z=A(Y))&&B?B.p(Y,et):(B.d(1),B=z(Y),B&&(B.c(),B.m(p,null))),et&2&&c!==(c=Y[1]==0)&&(p.disabled=c)},i:Oe,o:Oe,d(Y){Y&&(fe(t),fe(y),fe(w)),B.d(),T=!1,Fi(L)}}}function w4(e,t,n){let r;Zn(e,aI,y=>n(1,r=y));let{polygonTool:s}=t;const l=()=>s.finish(),p=()=>s.cancel(),c=()=>s.undo();return e.$$set=y=>{"polygonTool"in y&&n(0,s=y.polygonTool)},[s,r,l,p,c]}class S4 extends Pn{constructor(t){super(),Ln(this,t,w4,x4,vn,{polygonTool:0})}}function E4(e){let t,n,r,s,l,p;return t=new Dd({props:{id:"edit-polygon-fill",filter:d4,paint:{"fill-color":"red","fill-opacity":["case",["boolean",["get","hover"],"false"],1,.5]}}}),r=new P2({props:{id:"edit-polygon-lines",filter:g4,paint:{"line-color":"black","line-width":8,"line-opacity":.5}}}),l=new AT({props:{id:"edit-polygon-vertices",filter:m4,paint:{"circle-color":"black","circle-opacity":["case",["has","hovered"],1,.5],"circle-radius":10}}}),{c(){nn(t.$$.fragment),n=Ve(),nn(r.$$.fragment),s=Ve(),nn(l.$$.fragment)},m(c,y){$e(t,c,y),de(c,n,y),$e(r,c,y),de(c,s,y),$e(l,c,y),p=!0},p:Oe,i(c){p||(ee(t.$$.fragment,c),ee(r.$$.fragment,c),ee(l.$$.fragment,c),p=!0)},o(c){le(t.$$.fragment,c),le(r.$$.fragment,c),le(l.$$.fragment,c),p=!1},d(c){c&&(fe(n),fe(s)),tn(t,c),tn(r,c),tn(l,c)}}}function I4(e){let t,n;return t=new Ip({props:{data:e[0],$$slots:{default:[E4]},$$scope:{ctx:e}}}),{c(){nn(t.$$.fragment)},m(r,s){$e(t,r,s),n=!0},p(r,[s]){const l={};s&1&&(l.data=r[0]),s&2&&(l.$$scope={dirty:s,ctx:r}),t.$set(l)},i(r){n||(ee(t.$$.fragment,r),n=!0)},o(r){le(t.$$.fragment,r),n=!1},d(r){tn(t,r)}}}function C4(e,t,n){let r;return Zn(e,sI,s=>n(0,r=s)),[r]}class T4 extends Pn{constructor(t){super(),Ln(this,t,C4,I4,vn,{})}}function lI(e,t){let n=document.createElement("a");n.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),n.setAttribute("download",e),document.body.appendChild(n),n.click(),document.body.removeChild(n)}function Wd(){return{type:"FeatureCollection",features:[]}}function uI(e){return ZS(e)}const L4=e=>({}),u2=e=>({}),P4=e=>({}),c2=e=>({});function M4(e){let t,n,r,s;const l=e[1].left,p=Ws(l,e,e[0],c2),c=e[1].main,y=Ws(c,e,e[0],u2);return{c(){t=ae("div"),p&&p.c(),n=Ve(),r=ae("div"),y&&y.c(),zt(t,"class","left svelte-194izft"),zt(r,"class","main svelte-194izft")},m(w,T){de(w,t,T),p&&p.m(t,null),de(w,n,T),de(w,r,T),y&&y.m(r,null),s=!0},p(w,[T]){p&&p.p&&(!s||T&1)&&Hs(p,l,w,w[0],s?Zs(l,w[0],T,P4):Xs(w[0]),c2),y&&y.p&&(!s||T&1)&&Hs(y,c,w,w[0],s?Zs(c,w[0],T,L4):Xs(w[0]),u2)},i(w){s||(ee(p,w),ee(y,w),s=!0)},o(w){le(p,w),le(y,w),s=!1},d(w){w&&(fe(t),fe(n),fe(r)),p&&p.d(w),y&&y.d(w)}}}function A4(e,t,n){let{$$slots:r={},$$scope:s}=t;return e.$$set=l=>{"$$scope"in l&&n(0,s=l.$$scope)},[s,r]}class TO extends Pn{constructor(t){super(),Ln(this,t,A4,M4,vn,{})}}function h2(e){let t,n,r,s,l,p,c,y,w;t=new A2({}),r=new M2({props:{position:"bottom-right",visualizePitch:!0}}),l=new T4({}),c=new CN({props:{map:e[0],apiKey:O2}});const T=e[5].default,L=Ws(T,e,e[9],null);return{c(){nn(t.$$.fragment),n=Ve(),nn(r.$$.fragment),s=Ve(),nn(l.$$.fragment),p=Ve(),nn(c.$$.fragment),y=Ve(),L&&L.c()},m(A,z){$e(t,A,z),de(A,n,z),$e(r,A,z),de(A,s,z),$e(l,A,z),de(A,p,z),$e(c,A,z),de(A,y,z),L&&L.m(A,z),w=!0},p(A,z){const B={};z&1&&(B.map=A[0]),c.$set(B),L&&L.p&&(!w||z&512)&&Hs(L,T,A,A[9],w?Zs(T,A[9],z,null):Xs(A[9]),null)},i(A){w||(ee(t.$$.fragment,A),ee(r.$$.fragment,A),ee(l.$$.fragment,A),ee(c.$$.fragment,A),ee(L,A),w=!0)},o(A){le(t.$$.fragment,A),le(r.$$.fragment,A),le(l.$$.fragment,A),le(c.$$.fragment,A),le(L,A),w=!1},d(A){A&&(fe(n),fe(s),fe(p),fe(y)),tn(t,A),tn(r,A),tn(l,A),tn(c,A),L&&L.d(A)}}}function k4(e){let t,n,r=e[3]&&h2(e);return{c(){r&&r.c(),t=ll()},m(s,l){r&&r.m(s,l),de(s,t,l),n=!0},p(s,l){s[3]?r?(r.p(s,l),l&8&&ee(r,1)):(r=h2(s),r.c(),ee(r,1),r.m(t.parentNode,t)):r&&(Wo(),le(r,1,1,()=>{r=null}),Zo())},i(s){n||(ee(r),n=!0)},o(s){le(r),n=!1},d(s){s&&fe(t),r&&r.d(s)}}}function D4(e){let t,n,r,s,l;function p(w){e[6](w)}function c(w){e[7](w)}let y={style:e[4](e[2]),hash:!0,$$slots:{default:[k4]},$$scope:{ctx:e}};return e[0]!==void 0&&(y.map=e[0]),e[1]!==void 0&&(y.loaded=e[1]),n=new nL({props:y}),Di.push(()=>Jo(n,"map",p)),Di.push(()=>Jo(n,"loaded",c)),n.$on("error",e[8]),{c(){t=ae("div"),nn(n.$$.fragment),zt(t,"class","svelte-cexkjr")},m(w,T){de(w,t,T),$e(n,t,null),l=!0},p(w,[T]){const L={};T&4&&(L.style=w[4](w[2])),T&521&&(L.$$scope={dirty:T,ctx:w}),!r&&T&1&&(r=!0,L.map=w[0],Ko(()=>r=!1)),!s&&T&2&&(s=!0,L.loaded=w[1],Ko(()=>s=!1)),n.$set(L)},i(w){l||(ee(n.$$.fragment,w),l=!0)},o(w){le(n.$$.fragment,w),l=!1},d(w){w&&fe(t),tn(n)}}}function R4(e,t,n){let r,s;Zn(e,IL,z=>n(2,r=z)),Zn(e,Kh,z=>n(3,s=z));let{$$slots:l={},$$scope:p}=t,c,y=!1;function w(z){return z=="blank"?{version:8,sources:{},layers:[]}:`https://api.maptiler.com/maps/${z}/style.json?key=${O2}`}function T(z){c=z,n(0,c)}function L(z){y=z,n(1,y)}const A=z=>{console.log(z.detail.error)};return e.$$set=z=>{"$$scope"in z&&n(9,p=z.$$scope)},e.$$.update=()=>{e.$$.dirty&3&&y&&Kh.set(c)},[c,y,r,s,w,l,T,L,A,p]}let LO=class extends Pn{constructor(t){super(),Ln(this,t,R4,D4,vn,{})}};const{window:N4}=Jv;function p2(e){let t,n,r,s,l,p,c,y,w,T,L;return w=b2(e[5][0]),{c(){t=ae("div"),n=ae("label"),r=ae("input"),s=Wn(` + to cancel`,p.disabled=c=e[1]==0,hc(t,"display","flex"),hc(t,"justify-content","space-between")},m(Y,et){de(Y,t,et),Wt(t,n),Wt(t,r),Wt(t,s),Wt(t,l),Wt(t,p),B.m(p,null),de(Y,y,et),de(Y,w,et),T||(L=[an(n,"click",e[2]),an(s,"click",e[3]),an(p,"click",e[4])],T=!0)},p(Y,[et]){z===(z=A(Y))&&B?B.p(Y,et):(B.d(1),B=z(Y),B&&(B.c(),B.m(p,null))),et&2&&c!==(c=Y[1]==0)&&(p.disabled=c)},i:Oe,o:Oe,d(Y){Y&&(fe(t),fe(y),fe(w)),B.d(),T=!1,Fi(L)}}}function w4(e,t,n){let r;Zn(e,aI,y=>n(1,r=y));let{polygonTool:s}=t;const l=()=>s.finish(),p=()=>s.cancel(),c=()=>s.undo();return e.$$set=y=>{"polygonTool"in y&&n(0,s=y.polygonTool)},[s,r,l,p,c]}class S4 extends Pn{constructor(t){super(),Ln(this,t,w4,x4,vn,{polygonTool:0})}}function E4(e){let t,n,r,s,l,p;return t=new Dd({props:{id:"edit-polygon-fill",filter:d4,paint:{"fill-color":"red","fill-opacity":["case",["boolean",["get","hover"],"false"],1,.5]}}}),r=new P2({props:{id:"edit-polygon-lines",filter:g4,paint:{"line-color":"black","line-width":8,"line-opacity":.5}}}),l=new AT({props:{id:"edit-polygon-vertices",filter:m4,paint:{"circle-color":"black","circle-opacity":["case",["has","hovered"],1,.5],"circle-radius":10}}}),{c(){nn(t.$$.fragment),n=Ve(),nn(r.$$.fragment),s=Ve(),nn(l.$$.fragment)},m(c,y){$e(t,c,y),de(c,n,y),$e(r,c,y),de(c,s,y),$e(l,c,y),p=!0},p:Oe,i(c){p||(ee(t.$$.fragment,c),ee(r.$$.fragment,c),ee(l.$$.fragment,c),p=!0)},o(c){le(t.$$.fragment,c),le(r.$$.fragment,c),le(l.$$.fragment,c),p=!1},d(c){c&&(fe(n),fe(s)),tn(t,c),tn(r,c),tn(l,c)}}}function I4(e){let t,n;return t=new Ip({props:{data:e[0],$$slots:{default:[E4]},$$scope:{ctx:e}}}),{c(){nn(t.$$.fragment)},m(r,s){$e(t,r,s),n=!0},p(r,[s]){const l={};s&1&&(l.data=r[0]),s&2&&(l.$$scope={dirty:s,ctx:r}),t.$set(l)},i(r){n||(ee(t.$$.fragment,r),n=!0)},o(r){le(t.$$.fragment,r),n=!1},d(r){tn(t,r)}}}function C4(e,t,n){let r;return Zn(e,sI,s=>n(0,r=s)),[r]}class T4 extends Pn{constructor(t){super(),Ln(this,t,C4,I4,vn,{})}}function wp(e,t,n){let r=["match",e];for(let[s,l]of Object.entries(t))r.push(s),r.push(l);return r.push(n),r}function lI(e,t){let n=document.createElement("a");n.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),n.setAttribute("download",e),document.body.appendChild(n),n.click(),document.body.removeChild(n)}function Wd(){return{type:"FeatureCollection",features:[]}}function uI(e){return ZS(e)}const L4=e=>({}),u2=e=>({}),P4=e=>({}),c2=e=>({});function M4(e){let t,n,r,s;const l=e[1].left,p=Ws(l,e,e[0],c2),c=e[1].main,y=Ws(c,e,e[0],u2);return{c(){t=ae("div"),p&&p.c(),n=Ve(),r=ae("div"),y&&y.c(),zt(t,"class","left svelte-194izft"),zt(r,"class","main svelte-194izft")},m(w,T){de(w,t,T),p&&p.m(t,null),de(w,n,T),de(w,r,T),y&&y.m(r,null),s=!0},p(w,[T]){p&&p.p&&(!s||T&1)&&Hs(p,l,w,w[0],s?Zs(l,w[0],T,P4):Xs(w[0]),c2),y&&y.p&&(!s||T&1)&&Hs(y,c,w,w[0],s?Zs(c,w[0],T,L4):Xs(w[0]),u2)},i(w){s||(ee(p,w),ee(y,w),s=!0)},o(w){le(p,w),le(y,w),s=!1},d(w){w&&(fe(t),fe(n),fe(r)),p&&p.d(w),y&&y.d(w)}}}function A4(e,t,n){let{$$slots:r={},$$scope:s}=t;return e.$$set=l=>{"$$scope"in l&&n(0,s=l.$$scope)},[s,r]}class TO extends Pn{constructor(t){super(),Ln(this,t,A4,M4,vn,{})}}function h2(e){let t,n,r,s,l,p,c,y,w;t=new A2({}),r=new M2({props:{position:"bottom-right",visualizePitch:!0}}),l=new T4({}),c=new CN({props:{map:e[0],apiKey:O2}});const T=e[5].default,L=Ws(T,e,e[9],null);return{c(){nn(t.$$.fragment),n=Ve(),nn(r.$$.fragment),s=Ve(),nn(l.$$.fragment),p=Ve(),nn(c.$$.fragment),y=Ve(),L&&L.c()},m(A,z){$e(t,A,z),de(A,n,z),$e(r,A,z),de(A,s,z),$e(l,A,z),de(A,p,z),$e(c,A,z),de(A,y,z),L&&L.m(A,z),w=!0},p(A,z){const B={};z&1&&(B.map=A[0]),c.$set(B),L&&L.p&&(!w||z&512)&&Hs(L,T,A,A[9],w?Zs(T,A[9],z,null):Xs(A[9]),null)},i(A){w||(ee(t.$$.fragment,A),ee(r.$$.fragment,A),ee(l.$$.fragment,A),ee(c.$$.fragment,A),ee(L,A),w=!0)},o(A){le(t.$$.fragment,A),le(r.$$.fragment,A),le(l.$$.fragment,A),le(c.$$.fragment,A),le(L,A),w=!1},d(A){A&&(fe(n),fe(s),fe(p),fe(y)),tn(t,A),tn(r,A),tn(l,A),tn(c,A),L&&L.d(A)}}}function k4(e){let t,n,r=e[3]&&h2(e);return{c(){r&&r.c(),t=ll()},m(s,l){r&&r.m(s,l),de(s,t,l),n=!0},p(s,l){s[3]?r?(r.p(s,l),l&8&&ee(r,1)):(r=h2(s),r.c(),ee(r,1),r.m(t.parentNode,t)):r&&(Wo(),le(r,1,1,()=>{r=null}),Zo())},i(s){n||(ee(r),n=!0)},o(s){le(r),n=!1},d(s){s&&fe(t),r&&r.d(s)}}}function D4(e){let t,n,r,s,l;function p(w){e[6](w)}function c(w){e[7](w)}let y={style:e[4](e[2]),hash:!0,$$slots:{default:[k4]},$$scope:{ctx:e}};return e[0]!==void 0&&(y.map=e[0]),e[1]!==void 0&&(y.loaded=e[1]),n=new nL({props:y}),Di.push(()=>Jo(n,"map",p)),Di.push(()=>Jo(n,"loaded",c)),n.$on("error",e[8]),{c(){t=ae("div"),nn(n.$$.fragment),zt(t,"class","svelte-cexkjr")},m(w,T){de(w,t,T),$e(n,t,null),l=!0},p(w,[T]){const L={};T&4&&(L.style=w[4](w[2])),T&521&&(L.$$scope={dirty:T,ctx:w}),!r&&T&1&&(r=!0,L.map=w[0],Ko(()=>r=!1)),!s&&T&2&&(s=!0,L.loaded=w[1],Ko(()=>s=!1)),n.$set(L)},i(w){l||(ee(n.$$.fragment,w),l=!0)},o(w){le(n.$$.fragment,w),l=!1},d(w){w&&fe(t),tn(n)}}}function R4(e,t,n){let r,s;Zn(e,IL,z=>n(2,r=z)),Zn(e,Kh,z=>n(3,s=z));let{$$slots:l={},$$scope:p}=t,c,y=!1;function w(z){return z=="blank"?{version:8,sources:{},layers:[]}:`https://api.maptiler.com/maps/${z}/style.json?key=${O2}`}function T(z){c=z,n(0,c)}function L(z){y=z,n(1,y)}const A=z=>{console.log(z.detail.error)};return e.$$set=z=>{"$$scope"in z&&n(9,p=z.$$scope)},e.$$.update=()=>{e.$$.dirty&3&&y&&Kh.set(c)},[c,y,r,s,w,l,T,L,A,p]}let LO=class extends Pn{constructor(t){super(),Ln(this,t,R4,D4,vn,{})}};const{window:N4}=Jv;function p2(e){let t,n,r,s,l,p,c,y,w,T,L;return w=b2(e[5][0]),{c(){t=ae("div"),n=ae("label"),r=ae("input"),s=Wn(` Google StreetView`),l=Ve(),p=ae("label"),c=ae("input"),y=Wn(` Bing Streetside`),zt(r,"type","radio"),r.__value="google",ds(r,r.__value),zt(c,"type","radio"),c.__value="bing",ds(c,c.__value),hc(t,"background","grey"),w.p(r,c)},m(A,z){de(A,t,z),Wt(t,n),Wt(n,r),r.checked=r.__value===e[1],Wt(n,s),Wt(t,l),Wt(t,p),Wt(p,c),c.checked=c.__value===e[1],Wt(p,y),T||(L=[an(r,"change",e[4]),an(c,"change",e[6])],T=!0)},p(A,z){z&2&&(r.checked=r.__value===A[1]),z&2&&(c.checked=c.__value===A[1])},d(A){A&&fe(t),w.r(),T=!1,Fi(L)}}}function O4(e){let t,n,r,s,l,p,c,y=e[0]&&p2(e);return{c(){t=ae("label"),n=ae("input"),r=Wn(` StreetView`),s=Ve(),y&&y.c(),l=ll(),zt(n,"type","checkbox")},m(w,T){de(w,t,T),Wt(t,n),n.checked=e[0],Wt(t,r),de(w,s,T),y&&y.m(w,T),de(w,l,T),p||(c=[an(N4,"keydown",e[2]),an(n,"change",e[3])],p=!0)},p(w,[T]){T&1&&(n.checked=w[0]),w[0]?y?y.p(w,T):(y=p2(w),y.c(),y.m(l.parentNode,l)):y&&(y.d(1),y=null)},i:Oe,o:Oe,d(w){w&&(fe(t),fe(s),fe(l)),y&&y.d(w),p=!1,Fi(c)}}}function z4(e,t,n){let r;Zn(e,Kh,B=>n(7,r=B));let{enabled:s=!1}=t,l="google";function p(){r.on("click",y),r.getCanvas().style.cursor="zoom-in"}function c(){r.off("click",y),r.getCanvas().style.cursor="auto"}Ul(c);function y(B){let Y=B.lngLat.lng,et=B.lngLat.lat;l=="google"?window.open(`http://maps.google.com/maps?q=&layer=c&cbll=${et},${Y}&cbp=11,0,0,0,0`,"_blank"):l=="bing"&&window.open(`https://www.bing.com/maps?cp=${et}~${Y}&style=x`,"_blank")}function w(B){s&&B.key=="Escape"&&n(0,s=!1)}const T=[[]];function L(){s=this.checked,n(0,s)}function A(){l=this.__value,n(1,l)}function z(){l=this.__value,n(1,l)}return e.$$set=B=>{"enabled"in B&&n(0,s=B.enabled)},e.$$.update=()=>{e.$$.dirty&1&&(s?p():c())},[s,l,w,L,A,T,z]}class MO extends Pn{constructor(t){super(),Ln(this,t,z4,O4,vn,{enabled:0})}}const{window:F4}=Jv;function f2(e,t,n){const r=e.slice();return r[8]=t[n],r}function d2(e){let t,n=e[8]+"",r,s;return{c(){t=ae("option"),r=Wn(n),t.__value=s=e[8],ds(t,t.__value)},m(l,p){de(l,t,p),Wt(t,r)},p(l,p){p&2&&n!==(n=l[8]+"")&&Vl(r,n),p&2&&s!==(s=l[8])&&(t.__value=s,ds(t,t.__value))},d(l){l&&fe(t)}}}function B4(e){let t,n,r,s,l,p,c,y,w,T,L,A,z=Em(e[1]),B=[];for(let Y=0;Ye[6].call(l)),y.disabled=T=e[0]=="none"},m(Y,et){de(Y,t,et),Wt(t,n),de(Y,s,et),de(Y,l,et),Wt(l,p);for(let at=0;at{let L=await fetch("/osm2streets//tests.json");n(1,l=await L.json()),s!="none"&&await p()});async function p(){if(s=="none"){r("resetToNone");return}try{r("loading","Loading built-in boundary and OSM XML");let z=(await(await fetch(`/osm2streets//tests/${s}/boundary.json`)).json()).features[0],Y=await(await fetch(`/osm2streets//tests/${s}/input.osm`)).text();r("load",{testCase:s,boundaryGj:z,osmXml:Y})}catch(L){r("error",L.toString())}}async function c(){let L=new URLSearchParams(window.location.search).get("test")||"none";console.log(`Navigated back in history -- changing test case from ${s} to ${L}`),n(0,s=L),await p()}async function y(){let L=l.indexOf(s);L!=-1&&L!=0&&(n(0,s=l[L-1]),await p())}async function w(){let L=l.indexOf(s);L!=-1&&L!=l.length-1&&(n(0,s=l[L+1]),await p())}function T(){s=x2(this),n(0,s),n(1,l)}return e.$$set=L=>{"testCase"in L&&n(0,s=L.testCase)},[s,l,p,c,y,w,T]}class U4 extends Pn{constructor(t){super(),Ln(this,t,V4,B4,vn,{testCase:0})}}function G4(e){let t,n,r,s,l,p,c;return{c(){t=ae("button"),t.textContent="Import current view",n=Ve(),r=ae("i"),r.textContent="or...",s=Ve(),l=ae("button"),l.textContent="Draw an area to import on the map",zt(t,"type","button"),zt(l,"type","button")},m(y,w){de(y,t,w),de(y,n,w),de(y,r,w),de(y,s,w),de(y,l,w),p||(c=[an(t,"click",e[2]),an(l,"click",e[1])],p=!0)},p:Oe,i:Oe,o:Oe,d(y){y&&(fe(t),fe(n),fe(r),fe(s),fe(l)),p=!1,Fi(c)}}}function j4(e){let t,n;return t=new S4({props:{polygonTool:e[0]}}),{c(){nn(t.$$.fragment)},m(r,s){$e(t,r,s),n=!0},p(r,s){const l={};s&1&&(l.polygonTool=r[0]),t.$set(l)},i(r){n||(ee(t.$$.fragment,r),n=!0)},o(r){le(t.$$.fragment,r),n=!1},d(r){tn(t,r)}}}function q4(e){let t,n,r,s;const l=[j4,G4],p=[];function c(y,w){return y[0]?0:1}return t=c(e),n=p[t]=l[t](e),{c(){n.c(),r=ll()},m(y,w){p[t].m(y,w),de(y,r,w),s=!0},p(y,[w]){let T=t;t=c(y),t===T?p[t].p(y,w):(Wo(),le(p[T],1,1,()=>{p[T]=null}),Zo(),n=p[t],n?n.p(y,w):(n=p[t]=l[t](y),n.c()),ee(n,1),n.m(r.parentNode,r))},i(y){s||(ee(n),s=!0)},o(y){le(n),s=!1},d(y){y&&fe(r),p[t].d(y)}}}function W4(e){let t='poly:"';for(let[r,s]of e.geometry.coordinates[0])t+=`${s} ${r} `;return t=t.slice(0,-1)+'"',`https://overpass-api.de/api/interpreter?data=${`(nwr(${t}); node(w)->.x; <;); out meta;`}`}function jf(e){return[e.lng,e.lat]}function Z4(e,t,n){let{map:r}=t,s=null,l=Ld();function p(){r&&(n(0,s=new _4(r)),s.startNew(),s.addEventListenerSuccess(async T=>{n(0,s=null),await c(T)}),s.addEventListenerFailure(()=>{n(0,s=null)}))}async function c(T){try{l("loading","Loading from Overpass");let A=await(await fetch(W4(T))).text();l("load",{testCase:"none",boundaryGj:T,osmXml:A})}catch(L){l("error",L.toString())}}function y(){let T=r.getBounds();return{type:"Feature",properties:{},geometry:{coordinates:[[jf(T.getSouthWest()),jf(T.getNorthWest()),jf(T.getNorthEast()),jf(T.getSouthEast()),jf(T.getSouthWest())]],type:"Polygon"}}}async function w(){if(r){if(r.getZoom()<15){l("error","Zoom in more to import (or draw a custom area)");return}await c(y())}}return e.$$set=T=>{"map"in T&&n(3,r=T.map)},[s,p,w,r,c]}class H4 extends Pn{constructor(t){super(),Ln(this,t,Z4,q4,vn,{map:3,importPolygon:4})}get importPolygon(){return this.$$.ctx[4]}}function X4(e){let t,n,r,s,l,p,c,y,w,T,L,A,z,B,Y,et,at,W,H,nt,ut,_t,ct,bt,It,Ot,dt,Pt,Qt,Et,oe,ge,Te,Fe,rn,En;return Fe=b2(e[6][0]),{c(){t=ae("details"),n=ae("summary"),n.textContent="Processing Options",r=Ve(),s=ae("label"),l=ae("input"),p=Wn(` @@ -625,4 +625,4 @@ and limitations under the License. use mapped footways`),ut=Ve(),_t=ae("label"),ct=ae("input"),bt=Wn(` infer on roads`),It=Ve(),Ot=ae("label"),dt=ae("input"),Pt=Wn(` Infer kerbs`),Qt=Ve(),Et=ae("div"),oe=Wn(`Change the time and date: - `),ge=ae("label"),Te=ae("input"),zt(n,"class","svelte-1c5zxm"),zt(l,"type","checkbox"),zt(s,"class","svelte-1c5zxm"),zt(w,"type","checkbox"),zt(y,"class","svelte-1c5zxm"),zt(z,"type","checkbox"),zt(A,"class","svelte-1c5zxm"),zt(H,"type","radio"),H.__value=!1,ds(H,H.__value),zt(W,"class","svelte-1c5zxm"),zt(ct,"type","radio"),ct.__value=!0,ds(ct,ct.__value),zt(_t,"class","svelte-1c5zxm"),zt(et,"class","svelte-1c5zxm"),zt(dt,"type","checkbox"),zt(Ot,"class","svelte-1c5zxm"),zt(Te,"type","datetime-local"),zt(ge,"class","svelte-1c5zxm"),zt(Et,"class","svelte-1c5zxm"),zt(t,"class","svelte-1c5zxm"),Fe.p(H,ct)},m(Me,Pe){de(Me,t,Pe),Wt(t,n),Wt(t,r),Wt(t,s),Wt(s,l),l.checked=e[0].debug_each_step,Wt(s,p),Wt(t,c),Wt(t,y),Wt(y,w),w.checked=e[0].dual_carriageway_experiment,Wt(y,T),Wt(t,L),Wt(t,A),Wt(A,z),z.checked=e[0].sidepath_zipping_experiment,Wt(A,B),Wt(t,Y),Wt(t,et),Wt(et,at),Wt(et,W),Wt(W,H),H.checked=H.__value===e[0].inferred_sidewalks,Wt(W,nt),Wt(et,ut),Wt(et,_t),Wt(_t,ct),ct.checked=ct.__value===e[0].inferred_sidewalks,Wt(_t,bt),Wt(t,It),Wt(t,Ot),Wt(Ot,dt),dt.checked=e[0].inferred_kerbs,Wt(Ot,Pt),Wt(t,Qt),Wt(t,Et),Wt(Et,oe),Wt(Et,ge),Wt(ge,Te),ds(Te,e[1]),rn||(En=[an(l,"change",e[2]),an(w,"change",e[3]),an(z,"change",e[4]),an(H,"change",e[5]),an(ct,"change",e[7]),an(dt,"change",e[8]),an(Te,"input",e[9])],rn=!0)},p(Me,[Pe]){Pe&1&&(l.checked=Me[0].debug_each_step),Pe&1&&(w.checked=Me[0].dual_carriageway_experiment),Pe&1&&(z.checked=Me[0].sidepath_zipping_experiment),Pe&1&&(H.checked=H.__value===Me[0].inferred_sidewalks),Pe&1&&(ct.checked=ct.__value===Me[0].inferred_sidewalks),Pe&1&&(dt.checked=Me[0].inferred_kerbs),Pe&2&&ds(Te,Me[1])},i:Oe,o:Oe,d(Me){Me&&fe(t),Fe.r(),rn=!1,Fi(En)}}}function Y4(e,t,n){let{settings:r={debug_each_step:!1,dual_carriageway_experiment:!1,sidepath_zipping_experiment:!1,inferred_sidewalks:!1,inferred_kerbs:!0,date_time:void 0}}=t,s;const l=[[]];function p(){r.debug_each_step=this.checked,n(0,r),n(1,s)}function c(){r.dual_carriageway_experiment=this.checked,n(0,r),n(1,s)}function y(){r.sidepath_zipping_experiment=this.checked,n(0,r),n(1,s)}function w(){r.inferred_sidewalks=this.__value,n(0,r),n(1,s)}function T(){r.inferred_sidewalks=this.__value,n(0,r),n(1,s)}function L(){r.inferred_kerbs=this.checked,n(0,r),n(1,s)}function A(){s=this.value,n(1,s)}return e.$$set=z=>{"settings"in z&&n(0,r=z.settings)},e.$$.update=()=>{e.$$.dirty&2&&n(0,r.date_time=s&&s+":00",r)},[r,s,p,c,y,w,l,T,L,A]}class K4 extends Pn{constructor(t){super(),Ln(this,t,Y4,X4,vn,{settings:0})}}function J4(e){let t,n,r,s,l,p,c,y;return{c(){t=ae("div"),n=ae("button"),n.textContent="Update OSM data",r=Ve(),s=ae("button"),s.textContent="Download osm.xml",l=Ve(),p=ae("button"),p.textContent="Reset view",zt(n,"type","button"),zt(s,"type","button"),zt(p,"type","button")},m(w,T){de(w,t,T),Wt(t,n),Wt(t,r),Wt(t,s),Wt(t,l),Wt(t,p),c||(y=[an(n,"click",e[6]),an(s,"click",e[5]),an(p,"click",e[7])],c=!0)},p:Oe,i:Oe,o:Oe,d(w){w&&fe(t),c=!1,Fi(y)}}}function Q4(e){let t,n;return t=new PN({props:{loading:e[2].msg}}),{c(){nn(t.$$.fragment)},m(r,s){$e(t,r,s),n=!0},p(r,s){const l={};s&4&&(l.loading=r[2].msg),t.$set(l)},i(r){n||(ee(t.$$.fragment,r),n=!0)},o(r){le(t.$$.fragment,r),n=!1},d(r){tn(t,r)}}}function $4(e){let t;return{c(){t=ae("p"),t.textContent="Choose an option above to import somewhere"},m(n,r){de(n,t,r)},p:Oe,i:Oe,o:Oe,d(n){n&&fe(t)}}}function tO(e){let t,n,r,s,l,p,c,y,w,T,L,A,z,B,Y={map:e[4]};n=new H4({props:Y}),e[12](n),n.$on("loading",e[11]),n.$on("load",e[8]),n.$on("resetToNone",e[9]),n.$on("error",e[10]);function et(ct){e[13](ct)}let at={};e[1]!==void 0&&(at.testCase=e[1]),p=new U4({props:at}),Di.push(()=>Jo(p,"testCase",et)),p.$on("loading",e[11]),p.$on("load",e[8]),p.$on("resetToNone",e[9]),p.$on("error",e[10]);const W=[$4,Q4,J4],H=[];function nt(ct,bt){return ct[2].kind==="nothing"?0:ct[2].kind==="loading"?1:ct[2].kind==="done"?2:-1}~(w=nt(e))&&(T=H[w]=W[w](e));function ut(ct){e[14](ct)}let _t={};return e[0]!==void 0&&(_t.settings=e[0]),A=new K4({props:_t}),Di.push(()=>Jo(A,"settings",ut)),{c(){t=ae("div"),nn(n.$$.fragment),r=Ve(),s=ae("fieldset"),l=ae("legend"),nn(p.$$.fragment),y=Ve(),T&&T.c(),L=Ve(),nn(A.$$.fragment),zt(s,"class","svelte-1e8er7a"),zt(t,"class","controls svelte-1e8er7a")},m(ct,bt){de(ct,t,bt),$e(n,t,null),Wt(t,r),Wt(t,s),Wt(s,l),$e(p,l,null),Wt(s,y),~w&&H[w].m(s,null),Wt(t,L),$e(A,t,null),B=!0},p(ct,[bt]){const It={};bt&16&&(It.map=ct[4]),n.$set(It);const Ot={};!c&&bt&2&&(c=!0,Ot.testCase=ct[1],Ko(()=>c=!1)),p.$set(Ot);let dt=w;w=nt(ct),w===dt?~w&&H[w].p(ct,bt):(T&&(Wo(),le(H[dt],1,1,()=>{H[dt]=null}),Zo()),~w?(T=H[w],T?T.p(ct,bt):(T=H[w]=W[w](ct),T.c()),ee(T,1),T.m(s,null)):T=null);const Pt={};!z&&bt&1&&(z=!0,Pt.settings=ct[0],Ko(()=>z=!1)),A.$set(Pt)},i(ct){B||(ee(n.$$.fragment,ct),ee(p.$$.fragment,ct),ee(T),ee(A.$$.fragment,ct),B=!0)},o(ct){le(n.$$.fragment,ct),le(p.$$.fragment,ct),le(T),le(A.$$.fragment,ct),B=!1},d(ct){ct&&fe(t),e[12](null),tn(n),tn(p),~w&&H[w].d(),tn(A)}}}function eO(e,t,n){let r,s;Zn(e,k_,ut=>n(15,r=ut)),Zn(e,Kh,ut=>n(4,s=ut));let l={kind:"nothing"},p,c,y=new URLSearchParams(window.location.search).get("test")||"none";function w(ut){l.kind=="done"&&ut&&(console.log("Settings changed, re-importing"),T(l.osmXml,l.boundaryGj))}function T(ut,_t){try{n(2,l={kind:"loading",msg:"Running osm2streets"});let ct=new iy(new Uint8Array(new TextEncoder().encode(ut)),JSON.stringify(_t),p);n(2,l={kind:"done",boundaryGj:_t,osmXml:ut,network:ct}),Nl(k_,r++,r),mc.set(l.network),uv.set(l.boundaryGj)}catch(ct){window.alert(ct.toString()),n(2,l={kind:"nothing"})}}function L(){l.kind==="done"&&lI("osm.xml",l.osmXml)}function A(){l.kind==="done"&&c.importPolygon(l.boundaryGj)}function z(){l.kind==="done"&&s.fitBounds(uI(l.boundaryGj),{animate:!1,padding:10})}function B(ut){T(ut.detail.osmXml,ut.detail.boundaryGj),n(1,y=ut.detail.testCase)}function Y(ut){n(2,l={kind:"nothing"}),Nl(k_,r++,r),mc.set(null),uv.set(null)}function et(ut){window.alert(ut.detail),n(2,l={kind:"nothing"})}function at(ut){n(2,l={kind:"loading",msg:ut.detail})}function W(ut){Di[ut?"unshift":"push"](()=>{c=ut,n(3,c)})}function H(ut){y=ut,n(1,y)}function nt(ut){p=ut,n(0,p)}return e.$$.update=()=>{if(e.$$.dirty&1&&w(p),e.$$.dirty&2){let ut=new URL(window.location.href);y!="none"?ut.searchParams.set("test",y):ut.searchParams.delete("test"),window.history.pushState({},"",ut)}},[p,y,l,c,s,L,A,z,B,Y,et,at,W,H,nt]}class AO extends Pn{constructor(t){super(),Ln(this,t,eO,tO,vn,{})}}function g2(e){let t,n,r,s;return{c(){t=ae("button"),n=Wn("Download"),zt(t,"type","button"),t.disabled=e[3]},m(l,p){de(l,t,p),Wt(t,n),r||(s=an(t,"click",e[4]),r=!0)},p(l,p){p&8&&(t.disabled=l[3])},d(l){l&&fe(t),r=!1,s()}}}function nO(e){let t,n,r,s,l,p,c,y,w=e[2]&&g2(e);return{c(){t=ae("div"),n=ae("label"),r=ae("input"),s=Ve(),l=Wn(e[1]),p=Ve(),w&&w.c(),zt(r,"type","checkbox")},m(T,L){de(T,t,L),Wt(t,n),Wt(n,r),r.checked=e[0],Wt(n,s),Wt(n,l),Wt(t,p),w&&w.m(t,null),c||(y=an(r,"change",e[6]),c=!0)},p(T,[L]){L&1&&(r.checked=T[0]),L&2&&Vl(l,T[1]),T[2]?w?w.p(T,L):(w=g2(T),w.c(),w.m(t,null)):w&&(w.d(1),w=null)},i:Oe,o:Oe,d(T){T&&fe(t),w&&w.d(),c=!1,y()}}}function rO(e,t,n){let r,{gj:s}=t,{name:l}=t,{show:p}=t,{downloadable:c=!0}=t;function y(){lI(`${l}.geojson`,JSON.stringify(s))}function w(){p=this.checked,n(0,p)}return e.$$set=T=>{"gj"in T&&n(5,s=T.gj),"name"in T&&n(1,l=T.name),"show"in T&&n(0,p=T.show),"downloadable"in T&&n(2,c=T.downloadable)},e.$$.update=()=>{e.$$.dirty&32&&n(3,r=s.type=="FeatureCollection"&&s.features.length==0)},[p,l,c,r,y,s,w]}class Zd extends Pn{constructor(t){super(),Ln(this,t,rO,nO,vn,{gj:5,name:1,show:0,downloadable:2})}}function iO(e){let t,n;const r=[Nd("boundary"),{layout:{visibility:e[0]?"visible":"none"}},{paint:{"line-color":"blue","line-width":4}}];let s={};for(let l=0;lJo(r,"show",p)),{c(){nn(t.$$.fragment),n=Ve(),nn(r.$$.fragment)},m(y,w){$e(t,y,w),de(y,n,w),$e(r,y,w),l=!0},p(y,[w]){const T={};w&2&&(T.data=y[1]),w&33&&(T.$$scope={dirty:w,ctx:y}),t.$set(T);const L={};w&2&&(L.gj=y[1]),!s&&w&1&&(s=!0,L.show=y[0],Ko(()=>s=!1)),r.$set(L)},i(y){l||(ee(t.$$.fragment,y),ee(r.$$.fragment,y),l=!0)},o(y){le(t.$$.fragment,y),le(r.$$.fragment,y),l=!1},d(y){y&&fe(n),tn(t,y),tn(r,y)}}}function sO(e,t,n){let r,s,l;Zn(e,uv,y=>n(2,s=y)),Zn(e,Kh,y=>n(3,l=y));let p=!0;function c(y){p=y,n(0,p)}return e.$$.update=()=>{e.$$.dirty&4&&n(1,r=s??Wd()),e.$$.dirty&12&&s&&(l==null||l.fitBounds(uI(s),{animate:!1,padding:10}))},[p,r,s,l,c]}class kO extends Pn{constructor(t){super(),Ln(this,t,sO,oO,vn,{})}}function aO(e){let t,n;const r=[Nd("intersection-markings"),{layout:{visibility:e[0]?"visible":"none"}},{paint:{"fill-color":Jh("type",{"sidewalk corner":"#CCCCCC","marked crossing line":"white","unmarked crossing outline":"white"},"red"),"fill-opacity":.9}}];let s={};for(let l=0;lJo(r,"show",p)),{c(){nn(t.$$.fragment),n=Ve(),nn(r.$$.fragment)},m(y,w){$e(t,y,w),de(y,n,w),$e(r,y,w),l=!0},p(y,[w]){const T={};w&2&&(T.data=y[1]),w&17&&(T.$$scope={dirty:w,ctx:y}),t.$set(T);const L={};w&2&&(L.gj=y[1]),!s&&w&1&&(s=!0,L.show=y[0],Ko(()=>s=!1)),r.$set(L)},i(y){l||(ee(t.$$.fragment,y),ee(r.$$.fragment,y),l=!0)},o(y){le(t.$$.fragment,y),le(r.$$.fragment,y),l=!1},d(y){y&&fe(n),tn(t,y),tn(r,y)}}}function uO(e,t,n){let r,s;Zn(e,mc,c=>n(2,s=c));let l=!0;function p(c){l=c,n(0,l)}return e.$$.update=()=>{e.$$.dirty&4&&n(1,r=s?JSON.parse(s.toIntersectionMarkingsGeojson()):Wd())},[l,r,s,p]}class DO extends Pn{constructor(t){super(),Ln(this,t,uO,lO,vn,{})}}function cO(e){let t;const n=e[6].default,r=Ws(n,e,e[9],null);return{c(){r&&r.c()},m(s,l){r&&r.m(s,l),t=!0},p(s,l){r&&r.p&&(!t||l&512)&&Hs(r,n,s,s[9],t?Zs(n,s[9],l,null):Xs(s[9]),null)},i(s){t||(ee(r,s),t=!0)},o(s){le(r,s),t=!1},d(s){r&&r.d(s)}}}function hO(e){let t,n,r;const s=[Nd("intersection-polygons"),{layout:{visibility:e[1]?"visible":"none"}},{manageHoverState:!0},{hoverCursor:e[0]},{filter:["==",["get","type"],"intersection"]},{paint:{"fill-color":{debug:Jh("intersection_kind",{MapEdge:"#696",Terminus:"#999",Connection:"#666",Fork:"#669",Intersection:"#966"},"red"),realistic:"black"}[e[4]],"fill-opacity":av(.9,.4)}}];function l(c){e[7](c)}let p={$$slots:{default:[cO]},$$scope:{ctx:e}};for(let c=0;cJo(t,"hovered",l)),{c(){nn(t.$$.fragment)},m(c,y){$e(t,c,y),r=!0},p(c,y){const w=y&19?Pd(s,[s[0],y&2&&{layout:{visibility:c[1]?"visible":"none"}},s[2],y&1&&{hoverCursor:c[0]},s[4],y&16&&{paint:{"fill-color":{debug:Jh("intersection_kind",{MapEdge:"#696",Terminus:"#999",Connection:"#666",Fork:"#669",Intersection:"#966"},"red"),realistic:"black"}[c[4]],"fill-opacity":av(.9,.4)}}]):{};y&512&&(w.$$scope={dirty:y,ctx:c}),!n&&y&8&&(n=!0,w.hovered=c[3],Ko(()=>n=!1)),t.$set(w)},i(c){r||(ee(t.$$.fragment,c),r=!0)},o(c){le(t.$$.fragment,c),r=!1},d(c){tn(t,c)}}}function pO(e){let t,n,r,s,l;t=new Ip({props:{data:e[2],generateId:!0,$$slots:{default:[hO]},$$scope:{ctx:e}}});function p(y){e[8](y)}let c={gj:e[2],name:"Intersection polygons"};return e[1]!==void 0&&(c.show=e[1]),r=new Zd({props:c}),Di.push(()=>Jo(r,"show",p)),{c(){nn(t.$$.fragment),n=Ve(),nn(r.$$.fragment)},m(y,w){$e(t,y,w),de(y,n,w),$e(r,y,w),l=!0},p(y,[w]){const T={};w&4&&(T.data=y[2]),w&539&&(T.$$scope={dirty:w,ctx:y}),t.$set(T);const L={};w&4&&(L.gj=y[2]),!s&&w&2&&(s=!0,L.show=y[1],Ko(()=>s=!1)),r.$set(L)},i(y){l||(ee(t.$$.fragment,y),ee(r.$$.fragment,y),l=!0)},o(y){le(t.$$.fragment,y),le(r.$$.fragment,y),l=!1},d(y){y&&fe(n),tn(t,y),tn(r,y)}}}function fO(e,t,n){let r,s,l,p;Zn(e,mc,z=>n(5,s=z)),Zn(e,hv,z=>n(3,l=z)),Zn(e,CL,z=>n(4,p=z));let{$$slots:c={},$$scope:y}=t,{hoverCursor:w=void 0}=t,T=!0;function L(z){l=z,hv.set(l)}function A(z){T=z,n(1,T)}return e.$$set=z=>{"hoverCursor"in z&&n(0,w=z.hoverCursor),"$$scope"in z&&n(9,y=z.$$scope)},e.$$.update=()=>{e.$$.dirty&32&&n(2,r=s?JSON.parse(s.toGeojsonPlain()):Wd())},[w,T,r,l,p,s,c,L,A,y]}class RO extends Pn{constructor(t){super(),Ln(this,t,fO,pO,vn,{hoverCursor:0})}}function dO(e){let t,n;const r=[Nd("lane-markings"),{layout:{visibility:e[0]?"visible":"none"}},{paint:{"fill-color":Jh("type",{"center line":"yellow","lane separator":Os,"lane arrow":Os,"buffer edge":Os,"buffer stripe":Os,"parking hatch":Os,"vehicle stop line":Os,"sidewalk line":"#BBBBBB","bike stop line":"green","path outline":"black"},"red"),"fill-opacity":.9}}];let s={};for(let l=0;lJo(r,"show",p)),{c(){nn(t.$$.fragment),n=Ve(),nn(r.$$.fragment)},m(y,w){$e(t,y,w),de(y,n,w),$e(r,y,w),l=!0},p(y,[w]){const T={};w&2&&(T.data=y[1]),w&17&&(T.$$scope={dirty:w,ctx:y}),t.$set(T);const L={};w&2&&(L.gj=y[1]),!s&&w&1&&(s=!0,L.show=y[0],Ko(()=>s=!1)),r.$set(L)},i(y){l||(ee(t.$$.fragment,y),ee(r.$$.fragment,y),l=!0)},o(y){le(t.$$.fragment,y),le(r.$$.fragment,y),l=!1},d(y){y&&fe(n),tn(t,y),tn(r,y)}}}let Os="white";function mO(e,t,n){let r,s;Zn(e,mc,c=>n(2,s=c));let l=!0;function p(c){l=c,n(0,l)}return e.$$.update=()=>{e.$$.dirty&4&&n(1,r=s?JSON.parse(s.toLaneMarkingsGeojson()):Wd())},[l,r,s,p]}class NO extends Pn{constructor(t){super(),Ln(this,t,mO,gO,vn,{})}}function yO(e){let t;const n=e[5].default,r=Ws(n,e,e[9],null);return{c(){r&&r.c()},m(s,l){r&&r.m(s,l),t=!0},p(s,l){r&&r.p&&(!t||l&512)&&Hs(r,n,s,s[9],t?Zs(n,s[9],l,null):Xs(s[9]),null)},i(s){t||(ee(r,s),t=!0)},o(s){le(r,s),t=!1},d(s){r&&r.d(s)}}}function _O(e){let t,n,r;const s=[Nd("lane-polygons"),{layout:{visibility:e[1]?"visible":"none"}},{manageHoverState:!0},{hoverCursor:e[0]},{paint:{"fill-color":Jh("type",{Driving:"black","Parking(Parallel)":"#333333","Parking(Diagonal)":"#333333","Parking(Perpendicular)":"#333333",Sidewalk:"#CCCCCC",Shoulder:"#CCCCCC",Biking:"#0F7D4B",Bus:"#BE4A4C",SharedLeftTurn:"black",Construction:"#FF6D00",LightRail:"#844204",Footway:"#DDDDE8",SharedUse:"#DED68A","Buffer(Planters)":"#555555","Buffer(Curb)":"white"},"red"),"fill-opacity":av(.9,.4)}}];function l(c){e[6](c)}let p={$$slots:{default:[yO]},$$scope:{ctx:e}};for(let c=0;cJo(t,"hovered",l)),t.$on("click",e[7]),{c(){nn(t.$$.fragment)},m(c,y){$e(t,c,y),r=!0},p(c,y){const w=y&3?Pd(s,[s[0],y&2&&{layout:{visibility:c[1]?"visible":"none"}},s[2],y&1&&{hoverCursor:c[0]},s[4]]):{};y&512&&(w.$$scope={dirty:y,ctx:c}),!n&&y&8&&(n=!0,w.hovered=c[3],Ko(()=>n=!1)),t.$set(w)},i(c){r||(ee(t.$$.fragment,c),r=!0)},o(c){le(t.$$.fragment,c),r=!1},d(c){tn(t,c)}}}function vO(e){let t,n,r,s,l;t=new Ip({props:{data:e[2],generateId:!0,$$slots:{default:[_O]},$$scope:{ctx:e}}});function p(y){e[8](y)}let c={gj:e[2],name:"Lane polygons"};return e[1]!==void 0&&(c.show=e[1]),r=new Zd({props:c}),Di.push(()=>Jo(r,"show",p)),{c(){nn(t.$$.fragment),n=Ve(),nn(r.$$.fragment)},m(y,w){$e(t,y,w),de(y,n,w),$e(r,y,w),l=!0},p(y,[w]){const T={};w&4&&(T.data=y[2]),w&523&&(T.$$scope={dirty:w,ctx:y}),t.$set(T);const L={};w&4&&(L.gj=y[2]),!s&&w&2&&(s=!0,L.show=y[1],Ko(()=>s=!1)),r.$set(L)},i(y){l||(ee(t.$$.fragment,y),ee(r.$$.fragment,y),l=!0)},o(y){le(t.$$.fragment,y),le(r.$$.fragment,y),l=!1},d(y){y&&fe(n),tn(t,y),tn(r,y)}}}function bO(e,t,n){let r,s,l;Zn(e,mc,z=>n(4,s=z)),Zn(e,cv,z=>n(3,l=z));let{$$slots:p={},$$scope:c}=t,{hoverCursor:y=void 0}=t,w=!0;function T(z){l=z,cv.set(l)}function L(z){ni.call(this,e,z)}function A(z){w=z,n(1,w)}return e.$$set=z=>{"hoverCursor"in z&&n(0,y=z.hoverCursor),"$$scope"in z&&n(9,c=z.$$scope)},e.$$.update=()=>{e.$$.dirty&16&&n(2,r=s?JSON.parse(s.toLanePolygonsGeojson()):Wd())},[y,w,r,l,s,p,T,L,A,c]}class OO extends Pn{constructor(t){super(),Ln(this,t,bO,vO,vn,{hoverCursor:0})}}export{Fi as $,$e as A,Ko as B,tn as C,Md as D,ni as E,Em as F,Oe as G,iT as H,Ve as I,Wn as J,zt as K,t0 as L,hc as M,Wt as N,Vl as O,ds as P,ad as Q,Sm as R,Pn as S,an as T,IL as U,x2 as V,CL as W,mc as X,Wd as Y,ui as Z,Ip as _,de as a,Nd as a0,Jh as a1,av as a2,Sp as a3,Dd as a4,P2 as a5,Pd as a6,Zd as a7,hv as a8,cv as a9,Kh as aa,wT as ab,TO as ac,IO as ad,LO as ae,wL as af,AO as ag,kO as ah,RO as ai,DO as aj,OO as ak,NO as al,MO as am,k_ as an,lI as ao,dT as ap,SO as aq,le as b,Zo as c,fe as d,ll as e,wO as f,Wo as g,Ld as h,Ln as i,Zn as j,Ep as k,Ul as l,Ad as m,Nl as n,lT as o,ae as p,Ws as q,Xs as r,vn as s,ee as t,Hs as u,Zs as v,EO as w,Di as x,Jo as y,nn as z}; + `),ge=ae("label"),Te=ae("input"),zt(n,"class","svelte-1c5zxm"),zt(l,"type","checkbox"),zt(s,"class","svelte-1c5zxm"),zt(w,"type","checkbox"),zt(y,"class","svelte-1c5zxm"),zt(z,"type","checkbox"),zt(A,"class","svelte-1c5zxm"),zt(H,"type","radio"),H.__value=!1,ds(H,H.__value),zt(W,"class","svelte-1c5zxm"),zt(ct,"type","radio"),ct.__value=!0,ds(ct,ct.__value),zt(_t,"class","svelte-1c5zxm"),zt(et,"class","svelte-1c5zxm"),zt(dt,"type","checkbox"),zt(Ot,"class","svelte-1c5zxm"),zt(Te,"type","datetime-local"),zt(ge,"class","svelte-1c5zxm"),zt(Et,"class","svelte-1c5zxm"),zt(t,"class","svelte-1c5zxm"),Fe.p(H,ct)},m(Me,Pe){de(Me,t,Pe),Wt(t,n),Wt(t,r),Wt(t,s),Wt(s,l),l.checked=e[0].debug_each_step,Wt(s,p),Wt(t,c),Wt(t,y),Wt(y,w),w.checked=e[0].dual_carriageway_experiment,Wt(y,T),Wt(t,L),Wt(t,A),Wt(A,z),z.checked=e[0].sidepath_zipping_experiment,Wt(A,B),Wt(t,Y),Wt(t,et),Wt(et,at),Wt(et,W),Wt(W,H),H.checked=H.__value===e[0].inferred_sidewalks,Wt(W,nt),Wt(et,ut),Wt(et,_t),Wt(_t,ct),ct.checked=ct.__value===e[0].inferred_sidewalks,Wt(_t,bt),Wt(t,It),Wt(t,Ot),Wt(Ot,dt),dt.checked=e[0].inferred_kerbs,Wt(Ot,Pt),Wt(t,Qt),Wt(t,Et),Wt(Et,oe),Wt(Et,ge),Wt(ge,Te),ds(Te,e[1]),rn||(En=[an(l,"change",e[2]),an(w,"change",e[3]),an(z,"change",e[4]),an(H,"change",e[5]),an(ct,"change",e[7]),an(dt,"change",e[8]),an(Te,"input",e[9])],rn=!0)},p(Me,[Pe]){Pe&1&&(l.checked=Me[0].debug_each_step),Pe&1&&(w.checked=Me[0].dual_carriageway_experiment),Pe&1&&(z.checked=Me[0].sidepath_zipping_experiment),Pe&1&&(H.checked=H.__value===Me[0].inferred_sidewalks),Pe&1&&(ct.checked=ct.__value===Me[0].inferred_sidewalks),Pe&1&&(dt.checked=Me[0].inferred_kerbs),Pe&2&&ds(Te,Me[1])},i:Oe,o:Oe,d(Me){Me&&fe(t),Fe.r(),rn=!1,Fi(En)}}}function Y4(e,t,n){let{settings:r={debug_each_step:!1,dual_carriageway_experiment:!1,sidepath_zipping_experiment:!1,inferred_sidewalks:!1,inferred_kerbs:!0,date_time:void 0}}=t,s;const l=[[]];function p(){r.debug_each_step=this.checked,n(0,r),n(1,s)}function c(){r.dual_carriageway_experiment=this.checked,n(0,r),n(1,s)}function y(){r.sidepath_zipping_experiment=this.checked,n(0,r),n(1,s)}function w(){r.inferred_sidewalks=this.__value,n(0,r),n(1,s)}function T(){r.inferred_sidewalks=this.__value,n(0,r),n(1,s)}function L(){r.inferred_kerbs=this.checked,n(0,r),n(1,s)}function A(){s=this.value,n(1,s)}return e.$$set=z=>{"settings"in z&&n(0,r=z.settings)},e.$$.update=()=>{e.$$.dirty&2&&n(0,r.date_time=s&&s+":00",r)},[r,s,p,c,y,w,l,T,L,A]}class K4 extends Pn{constructor(t){super(),Ln(this,t,Y4,X4,vn,{settings:0})}}function J4(e){let t,n,r,s,l,p,c,y;return{c(){t=ae("div"),n=ae("button"),n.textContent="Update OSM data",r=Ve(),s=ae("button"),s.textContent="Download osm.xml",l=Ve(),p=ae("button"),p.textContent="Reset view",zt(n,"type","button"),zt(s,"type","button"),zt(p,"type","button")},m(w,T){de(w,t,T),Wt(t,n),Wt(t,r),Wt(t,s),Wt(t,l),Wt(t,p),c||(y=[an(n,"click",e[6]),an(s,"click",e[5]),an(p,"click",e[7])],c=!0)},p:Oe,i:Oe,o:Oe,d(w){w&&fe(t),c=!1,Fi(y)}}}function Q4(e){let t,n;return t=new PN({props:{loading:e[2].msg}}),{c(){nn(t.$$.fragment)},m(r,s){$e(t,r,s),n=!0},p(r,s){const l={};s&4&&(l.loading=r[2].msg),t.$set(l)},i(r){n||(ee(t.$$.fragment,r),n=!0)},o(r){le(t.$$.fragment,r),n=!1},d(r){tn(t,r)}}}function $4(e){let t;return{c(){t=ae("p"),t.textContent="Choose an option above to import somewhere"},m(n,r){de(n,t,r)},p:Oe,i:Oe,o:Oe,d(n){n&&fe(t)}}}function tO(e){let t,n,r,s,l,p,c,y,w,T,L,A,z,B,Y={map:e[4]};n=new H4({props:Y}),e[12](n),n.$on("loading",e[11]),n.$on("load",e[8]),n.$on("resetToNone",e[9]),n.$on("error",e[10]);function et(ct){e[13](ct)}let at={};e[1]!==void 0&&(at.testCase=e[1]),p=new U4({props:at}),Di.push(()=>Jo(p,"testCase",et)),p.$on("loading",e[11]),p.$on("load",e[8]),p.$on("resetToNone",e[9]),p.$on("error",e[10]);const W=[$4,Q4,J4],H=[];function nt(ct,bt){return ct[2].kind==="nothing"?0:ct[2].kind==="loading"?1:ct[2].kind==="done"?2:-1}~(w=nt(e))&&(T=H[w]=W[w](e));function ut(ct){e[14](ct)}let _t={};return e[0]!==void 0&&(_t.settings=e[0]),A=new K4({props:_t}),Di.push(()=>Jo(A,"settings",ut)),{c(){t=ae("div"),nn(n.$$.fragment),r=Ve(),s=ae("fieldset"),l=ae("legend"),nn(p.$$.fragment),y=Ve(),T&&T.c(),L=Ve(),nn(A.$$.fragment),zt(s,"class","svelte-1e8er7a"),zt(t,"class","controls svelte-1e8er7a")},m(ct,bt){de(ct,t,bt),$e(n,t,null),Wt(t,r),Wt(t,s),Wt(s,l),$e(p,l,null),Wt(s,y),~w&&H[w].m(s,null),Wt(t,L),$e(A,t,null),B=!0},p(ct,[bt]){const It={};bt&16&&(It.map=ct[4]),n.$set(It);const Ot={};!c&&bt&2&&(c=!0,Ot.testCase=ct[1],Ko(()=>c=!1)),p.$set(Ot);let dt=w;w=nt(ct),w===dt?~w&&H[w].p(ct,bt):(T&&(Wo(),le(H[dt],1,1,()=>{H[dt]=null}),Zo()),~w?(T=H[w],T?T.p(ct,bt):(T=H[w]=W[w](ct),T.c()),ee(T,1),T.m(s,null)):T=null);const Pt={};!z&&bt&1&&(z=!0,Pt.settings=ct[0],Ko(()=>z=!1)),A.$set(Pt)},i(ct){B||(ee(n.$$.fragment,ct),ee(p.$$.fragment,ct),ee(T),ee(A.$$.fragment,ct),B=!0)},o(ct){le(n.$$.fragment,ct),le(p.$$.fragment,ct),le(T),le(A.$$.fragment,ct),B=!1},d(ct){ct&&fe(t),e[12](null),tn(n),tn(p),~w&&H[w].d(),tn(A)}}}function eO(e,t,n){let r,s;Zn(e,k_,ut=>n(15,r=ut)),Zn(e,Kh,ut=>n(4,s=ut));let l={kind:"nothing"},p,c,y=new URLSearchParams(window.location.search).get("test")||"none";function w(ut){l.kind=="done"&&ut&&(console.log("Settings changed, re-importing"),T(l.osmXml,l.boundaryGj))}function T(ut,_t){try{n(2,l={kind:"loading",msg:"Running osm2streets"});let ct=new iy(new Uint8Array(new TextEncoder().encode(ut)),JSON.stringify(_t),p);n(2,l={kind:"done",boundaryGj:_t,osmXml:ut,network:ct}),Nl(k_,r++,r),mc.set(l.network),uv.set(l.boundaryGj)}catch(ct){window.alert(ct.toString()),n(2,l={kind:"nothing"})}}function L(){l.kind==="done"&&lI("osm.xml",l.osmXml)}function A(){l.kind==="done"&&c.importPolygon(l.boundaryGj)}function z(){l.kind==="done"&&s.fitBounds(uI(l.boundaryGj),{animate:!1,padding:10})}function B(ut){T(ut.detail.osmXml,ut.detail.boundaryGj),n(1,y=ut.detail.testCase)}function Y(ut){n(2,l={kind:"nothing"}),Nl(k_,r++,r),mc.set(null),uv.set(null)}function et(ut){window.alert(ut.detail),n(2,l={kind:"nothing"})}function at(ut){n(2,l={kind:"loading",msg:ut.detail})}function W(ut){Di[ut?"unshift":"push"](()=>{c=ut,n(3,c)})}function H(ut){y=ut,n(1,y)}function nt(ut){p=ut,n(0,p)}return e.$$.update=()=>{if(e.$$.dirty&1&&w(p),e.$$.dirty&2){let ut=new URL(window.location.href);y!="none"?ut.searchParams.set("test",y):ut.searchParams.delete("test"),window.history.pushState({},"",ut)}},[p,y,l,c,s,L,A,z,B,Y,et,at,W,H,nt]}class AO extends Pn{constructor(t){super(),Ln(this,t,eO,tO,vn,{})}}function g2(e){let t,n,r,s;return{c(){t=ae("button"),n=Wn("Download"),zt(t,"type","button"),t.disabled=e[3]},m(l,p){de(l,t,p),Wt(t,n),r||(s=an(t,"click",e[4]),r=!0)},p(l,p){p&8&&(t.disabled=l[3])},d(l){l&&fe(t),r=!1,s()}}}function nO(e){let t,n,r,s,l,p,c,y,w=e[2]&&g2(e);return{c(){t=ae("div"),n=ae("label"),r=ae("input"),s=Ve(),l=Wn(e[1]),p=Ve(),w&&w.c(),zt(r,"type","checkbox")},m(T,L){de(T,t,L),Wt(t,n),Wt(n,r),r.checked=e[0],Wt(n,s),Wt(n,l),Wt(t,p),w&&w.m(t,null),c||(y=an(r,"change",e[6]),c=!0)},p(T,[L]){L&1&&(r.checked=T[0]),L&2&&Vl(l,T[1]),T[2]?w?w.p(T,L):(w=g2(T),w.c(),w.m(t,null)):w&&(w.d(1),w=null)},i:Oe,o:Oe,d(T){T&&fe(t),w&&w.d(),c=!1,y()}}}function rO(e,t,n){let r,{gj:s}=t,{name:l}=t,{show:p}=t,{downloadable:c=!0}=t;function y(){lI(`${l}.geojson`,JSON.stringify(s))}function w(){p=this.checked,n(0,p)}return e.$$set=T=>{"gj"in T&&n(5,s=T.gj),"name"in T&&n(1,l=T.name),"show"in T&&n(0,p=T.show),"downloadable"in T&&n(2,c=T.downloadable)},e.$$.update=()=>{e.$$.dirty&32&&n(3,r=s.type=="FeatureCollection"&&s.features.length==0)},[p,l,c,r,y,s,w]}class Zd extends Pn{constructor(t){super(),Ln(this,t,rO,nO,vn,{gj:5,name:1,show:0,downloadable:2})}}function iO(e){let t,n;const r=[Nd("boundary"),{layout:{visibility:e[0]?"visible":"none"}},{paint:{"line-color":"blue","line-width":4}}];let s={};for(let l=0;lJo(r,"show",p)),{c(){nn(t.$$.fragment),n=Ve(),nn(r.$$.fragment)},m(y,w){$e(t,y,w),de(y,n,w),$e(r,y,w),l=!0},p(y,[w]){const T={};w&2&&(T.data=y[1]),w&33&&(T.$$scope={dirty:w,ctx:y}),t.$set(T);const L={};w&2&&(L.gj=y[1]),!s&&w&1&&(s=!0,L.show=y[0],Ko(()=>s=!1)),r.$set(L)},i(y){l||(ee(t.$$.fragment,y),ee(r.$$.fragment,y),l=!0)},o(y){le(t.$$.fragment,y),le(r.$$.fragment,y),l=!1},d(y){y&&fe(n),tn(t,y),tn(r,y)}}}function sO(e,t,n){let r,s,l;Zn(e,uv,y=>n(2,s=y)),Zn(e,Kh,y=>n(3,l=y));let p=!0;function c(y){p=y,n(0,p)}return e.$$.update=()=>{e.$$.dirty&4&&n(1,r=s??Wd()),e.$$.dirty&12&&s&&(l==null||l.fitBounds(uI(s),{animate:!1,padding:10}))},[p,r,s,l,c]}class kO extends Pn{constructor(t){super(),Ln(this,t,sO,oO,vn,{})}}function aO(e){let t,n;const r=[Nd("intersection-markings"),{layout:{visibility:e[0]?"visible":"none"}},{paint:{"fill-color":wp(["get","type"],{"sidewalk corner":"#CCCCCC","marked crossing line":"white","unmarked crossing outline":"white"},"red"),"fill-opacity":.9}}];let s={};for(let l=0;lJo(r,"show",p)),{c(){nn(t.$$.fragment),n=Ve(),nn(r.$$.fragment)},m(y,w){$e(t,y,w),de(y,n,w),$e(r,y,w),l=!0},p(y,[w]){const T={};w&2&&(T.data=y[1]),w&17&&(T.$$scope={dirty:w,ctx:y}),t.$set(T);const L={};w&2&&(L.gj=y[1]),!s&&w&1&&(s=!0,L.show=y[0],Ko(()=>s=!1)),r.$set(L)},i(y){l||(ee(t.$$.fragment,y),ee(r.$$.fragment,y),l=!0)},o(y){le(t.$$.fragment,y),le(r.$$.fragment,y),l=!1},d(y){y&&fe(n),tn(t,y),tn(r,y)}}}function uO(e,t,n){let r,s;Zn(e,mc,c=>n(2,s=c));let l=!0;function p(c){l=c,n(0,l)}return e.$$.update=()=>{e.$$.dirty&4&&n(1,r=s?JSON.parse(s.toIntersectionMarkingsGeojson()):Wd())},[l,r,s,p]}class DO extends Pn{constructor(t){super(),Ln(this,t,uO,lO,vn,{})}}function cO(e){let t;const n=e[6].default,r=Ws(n,e,e[9],null);return{c(){r&&r.c()},m(s,l){r&&r.m(s,l),t=!0},p(s,l){r&&r.p&&(!t||l&512)&&Hs(r,n,s,s[9],t?Zs(n,s[9],l,null):Xs(s[9]),null)},i(s){t||(ee(r,s),t=!0)},o(s){le(r,s),t=!1},d(s){r&&r.d(s)}}}function hO(e){let t,n,r;const s=[Nd("intersection-polygons"),{layout:{visibility:e[1]?"visible":"none"}},{manageHoverState:!0},{hoverCursor:e[0]},{filter:["==",["get","type"],"intersection"]},{paint:{"fill-color":{debug:wp(["get","intersection_kind"],{MapEdge:"#696",Terminus:"#999",Connection:"#666",Fork:"#669",Intersection:"#966"},"red"),realistic:"black"}[e[4]],"fill-opacity":av(.9,.4)}}];function l(c){e[7](c)}let p={$$slots:{default:[cO]},$$scope:{ctx:e}};for(let c=0;cJo(t,"hovered",l)),{c(){nn(t.$$.fragment)},m(c,y){$e(t,c,y),r=!0},p(c,y){const w=y&19?Pd(s,[s[0],y&2&&{layout:{visibility:c[1]?"visible":"none"}},s[2],y&1&&{hoverCursor:c[0]},s[4],y&16&&{paint:{"fill-color":{debug:wp(["get","intersection_kind"],{MapEdge:"#696",Terminus:"#999",Connection:"#666",Fork:"#669",Intersection:"#966"},"red"),realistic:"black"}[c[4]],"fill-opacity":av(.9,.4)}}]):{};y&512&&(w.$$scope={dirty:y,ctx:c}),!n&&y&8&&(n=!0,w.hovered=c[3],Ko(()=>n=!1)),t.$set(w)},i(c){r||(ee(t.$$.fragment,c),r=!0)},o(c){le(t.$$.fragment,c),r=!1},d(c){tn(t,c)}}}function pO(e){let t,n,r,s,l;t=new Ip({props:{data:e[2],generateId:!0,$$slots:{default:[hO]},$$scope:{ctx:e}}});function p(y){e[8](y)}let c={gj:e[2],name:"Intersection polygons"};return e[1]!==void 0&&(c.show=e[1]),r=new Zd({props:c}),Di.push(()=>Jo(r,"show",p)),{c(){nn(t.$$.fragment),n=Ve(),nn(r.$$.fragment)},m(y,w){$e(t,y,w),de(y,n,w),$e(r,y,w),l=!0},p(y,[w]){const T={};w&4&&(T.data=y[2]),w&539&&(T.$$scope={dirty:w,ctx:y}),t.$set(T);const L={};w&4&&(L.gj=y[2]),!s&&w&2&&(s=!0,L.show=y[1],Ko(()=>s=!1)),r.$set(L)},i(y){l||(ee(t.$$.fragment,y),ee(r.$$.fragment,y),l=!0)},o(y){le(t.$$.fragment,y),le(r.$$.fragment,y),l=!1},d(y){y&&fe(n),tn(t,y),tn(r,y)}}}function fO(e,t,n){let r,s,l,p;Zn(e,mc,z=>n(5,s=z)),Zn(e,hv,z=>n(3,l=z)),Zn(e,CL,z=>n(4,p=z));let{$$slots:c={},$$scope:y}=t,{hoverCursor:w=void 0}=t,T=!0;function L(z){l=z,hv.set(l)}function A(z){T=z,n(1,T)}return e.$$set=z=>{"hoverCursor"in z&&n(0,w=z.hoverCursor),"$$scope"in z&&n(9,y=z.$$scope)},e.$$.update=()=>{e.$$.dirty&32&&n(2,r=s?JSON.parse(s.toGeojsonPlain()):Wd())},[w,T,r,l,p,s,c,L,A,y]}class RO extends Pn{constructor(t){super(),Ln(this,t,fO,pO,vn,{hoverCursor:0})}}function dO(e){let t,n;const r=[Nd("lane-markings"),{layout:{visibility:e[0]?"visible":"none"}},{paint:{"fill-color":wp(["get","type"],{"center line":"yellow","lane separator":Os,"lane arrow":Os,"buffer edge":Os,"buffer stripe":Os,"parking hatch":Os,"vehicle stop line":Os,"sidewalk line":"#BBBBBB","bike stop line":"green","path outline":"black"},"red"),"fill-opacity":.9}}];let s={};for(let l=0;lJo(r,"show",p)),{c(){nn(t.$$.fragment),n=Ve(),nn(r.$$.fragment)},m(y,w){$e(t,y,w),de(y,n,w),$e(r,y,w),l=!0},p(y,[w]){const T={};w&2&&(T.data=y[1]),w&17&&(T.$$scope={dirty:w,ctx:y}),t.$set(T);const L={};w&2&&(L.gj=y[1]),!s&&w&1&&(s=!0,L.show=y[0],Ko(()=>s=!1)),r.$set(L)},i(y){l||(ee(t.$$.fragment,y),ee(r.$$.fragment,y),l=!0)},o(y){le(t.$$.fragment,y),le(r.$$.fragment,y),l=!1},d(y){y&&fe(n),tn(t,y),tn(r,y)}}}let Os="white";function mO(e,t,n){let r,s;Zn(e,mc,c=>n(2,s=c));let l=!0;function p(c){l=c,n(0,l)}return e.$$.update=()=>{e.$$.dirty&4&&n(1,r=s?JSON.parse(s.toLaneMarkingsGeojson()):Wd())},[l,r,s,p]}class NO extends Pn{constructor(t){super(),Ln(this,t,mO,gO,vn,{})}}function yO(e){let t;const n=e[5].default,r=Ws(n,e,e[9],null);return{c(){r&&r.c()},m(s,l){r&&r.m(s,l),t=!0},p(s,l){r&&r.p&&(!t||l&512)&&Hs(r,n,s,s[9],t?Zs(n,s[9],l,null):Xs(s[9]),null)},i(s){t||(ee(r,s),t=!0)},o(s){le(r,s),t=!1},d(s){r&&r.d(s)}}}function _O(e){let t,n,r;const s=[Nd("lane-polygons"),{layout:{visibility:e[1]?"visible":"none"}},{manageHoverState:!0},{hoverCursor:e[0]},{paint:{"fill-color":wp(["get","type"],{Driving:"black","Parking(Parallel)":"#333333","Parking(Diagonal)":"#333333","Parking(Perpendicular)":"#333333",Sidewalk:"#CCCCCC",Shoulder:"#CCCCCC",Biking:"#0F7D4B",Bus:"#BE4A4C",SharedLeftTurn:"black",Construction:"#FF6D00",LightRail:"#844204",Footway:"#DDDDE8",SharedUse:"#DED68A","Buffer(Planters)":"#555555","Buffer(Curb)":"white"},"red"),"fill-opacity":av(.9,.4)}}];function l(c){e[6](c)}let p={$$slots:{default:[yO]},$$scope:{ctx:e}};for(let c=0;cJo(t,"hovered",l)),t.$on("click",e[7]),{c(){nn(t.$$.fragment)},m(c,y){$e(t,c,y),r=!0},p(c,y){const w=y&3?Pd(s,[s[0],y&2&&{layout:{visibility:c[1]?"visible":"none"}},s[2],y&1&&{hoverCursor:c[0]},s[4]]):{};y&512&&(w.$$scope={dirty:y,ctx:c}),!n&&y&8&&(n=!0,w.hovered=c[3],Ko(()=>n=!1)),t.$set(w)},i(c){r||(ee(t.$$.fragment,c),r=!0)},o(c){le(t.$$.fragment,c),r=!1},d(c){tn(t,c)}}}function vO(e){let t,n,r,s,l;t=new Ip({props:{data:e[2],generateId:!0,$$slots:{default:[_O]},$$scope:{ctx:e}}});function p(y){e[8](y)}let c={gj:e[2],name:"Lane polygons"};return e[1]!==void 0&&(c.show=e[1]),r=new Zd({props:c}),Di.push(()=>Jo(r,"show",p)),{c(){nn(t.$$.fragment),n=Ve(),nn(r.$$.fragment)},m(y,w){$e(t,y,w),de(y,n,w),$e(r,y,w),l=!0},p(y,[w]){const T={};w&4&&(T.data=y[2]),w&523&&(T.$$scope={dirty:w,ctx:y}),t.$set(T);const L={};w&4&&(L.gj=y[2]),!s&&w&2&&(s=!0,L.show=y[1],Ko(()=>s=!1)),r.$set(L)},i(y){l||(ee(t.$$.fragment,y),ee(r.$$.fragment,y),l=!0)},o(y){le(t.$$.fragment,y),le(r.$$.fragment,y),l=!1},d(y){y&&fe(n),tn(t,y),tn(r,y)}}}function bO(e,t,n){let r,s,l;Zn(e,mc,z=>n(4,s=z)),Zn(e,cv,z=>n(3,l=z));let{$$slots:p={},$$scope:c}=t,{hoverCursor:y=void 0}=t,w=!0;function T(z){l=z,cv.set(l)}function L(z){ni.call(this,e,z)}function A(z){w=z,n(1,w)}return e.$$set=z=>{"hoverCursor"in z&&n(0,y=z.hoverCursor),"$$scope"in z&&n(9,c=z.$$scope)},e.$$.update=()=>{e.$$.dirty&16&&n(2,r=s?JSON.parse(s.toLanePolygonsGeojson()):Wd())},[y,w,r,l,s,p,T,L,A,c]}class OO extends Pn{constructor(t){super(),Ln(this,t,bO,vO,vn,{hoverCursor:0})}}export{Fi as $,$e as A,Ko as B,tn as C,Md as D,ni as E,Em as F,Oe as G,iT as H,Ve as I,Wn as J,zt as K,t0 as L,hc as M,Wt as N,Vl as O,ds as P,ad as Q,Sm as R,Pn as S,an as T,IL as U,x2 as V,CL as W,mc as X,Wd as Y,ui as Z,Ip as _,de as a,Nd as a0,wp as a1,av as a2,Sp as a3,Dd as a4,P2 as a5,Pd as a6,Zd as a7,hv as a8,cv as a9,Kh as aa,wT as ab,TO as ac,IO as ad,LO as ae,wL as af,AO as ag,kO as ah,RO as ai,DO as aj,OO as ak,NO as al,MO as am,k_ as an,lI as ao,dT as ap,SO as aq,le as b,Zo as c,fe as d,ll as e,wO as f,Wo as g,Ld as h,Ln as i,Zn as j,Ep as k,Ul as l,Ad as m,Nl as n,lT as o,ae as p,Ws as q,Xs as r,vn as s,ee as t,Hs as u,Zs as v,EO as w,Di as x,Jo as y,nn as z}; diff --git a/assets/main-85e3dba7.js b/assets/main-1e55cb9a.js similarity index 85% rename from assets/main-85e3dba7.js rename to assets/main-1e55cb9a.js index b177ae6b..bd96a3da 100644 --- a/assets/main-85e3dba7.js +++ b/assets/main-1e55cb9a.js @@ -1,8 +1,8 @@ -import{S as se,i as re,s as x,e as Ee,a as g,t as w,g as Ie,b as L,c as je,d as h,f as zt,h as Pt,m as Rt,j as U,o as Ot,k as Se,l as Ht,n as At,p as c,q as Lt,u as Mt,r as St,v as Tt,w as Dt,x as ve,L as Et,y as Fe,z as J,A as z,B as Ge,C as P,D as Ft,E as Me,F as ge,G as V,H as $e,I as v,J as R,K as q,M as lt,N as a,O as Qe,P as Te,Q as It,R as De,T as oe,U as ot,V as jt,W as st,X as ae,Y as Ne,Z as Nt,_ as We,$ as Bt,a0 as Re,a1 as rt,a2 as it,a3 as He,a4 as Xe,a5 as Gt,a6 as Ue,a7 as Ye,a8 as Jt,a9 as $t,aa as Wt,ab as Ut,ac as qt,ad as Vt,ae as Kt,af as Zt,ag as Qt,ah as Xt,ai as Yt,aj as xt,ak as en,al as tn,am as nn}from"./RenderLanePolygons-cf74ae20.js";const ln=s=>({features:s[0]&16,data:s[0]&16,map:s[0]&4,close:s[0]&1}),ut=s=>{var e;return{features:s[4],data:(e=s[4])==null?void 0:e[0],map:s[2],close:s[31]}};function ft(s){let e,n,t=(s[4]||s[3]instanceof Se.Marker)&&at(s);return{c(){e=c("div"),t&&t.c()},m(l,o){g(l,e,o),t&&t.m(e,null),s[32](e),n=!0},p(l,o){l[4]||l[3]instanceof Se.Marker?t?(t.p(l,o),o[0]&24&&w(t,1)):(t=at(l),t.c(),w(t,1),t.m(e,null)):t&&(Ie(),L(t,1,1,()=>{t=null}),je())},i(l){n||(w(t),n=!0)},o(l){L(t),n=!1},d(l){l&&h(e),t&&t.d(),s[32](null)}}}function at(s){let e;const n=s[30].default,t=Lt(n,s,s[29],ut);return{c(){t&&t.c()},m(l,o){t&&t.m(l,o),e=!0},p(l,o){t&&t.p&&(!e||o[0]&536870933)&&Mt(t,n,l,l[29],e?Tt(n,l[29],o,ln):St(l[29]),ut)},i(l){e||(w(t,l),e=!0)},o(l){L(t,l),e=!1},d(l){t&&t.d(l)}}}function on(s){let e,n,t=s[9].default&&ft(s);return{c(){t&&t.c(),e=Ee()},m(l,o){t&&t.m(l,o),g(l,e,o),n=!0},p(l,o){l[9].default?t?(t.p(l,o),o[0]&512&&w(t,1)):(t=ft(l),t.c(),w(t,1),t.m(e.parentNode,e)):t&&(Ie(),L(t,1,1,()=>{t=null}),je())},i(l){n||(w(t),n=!0)},o(l){L(t),n=!1},d(l){l&&h(e),t&&t.d(l)}}}function sn(s,e,n){let t,l,o,r,u,i,{$$slots:f={},$$scope:m}=e;const O=zt(f);let{closeButton:S=void 0}=e,{closeOnClickOutside:C=!0}=e,{closeOnClickInside:M=!1}=e,{closeOnMove:y=!1}=e,{openOn:j="click"}=e,{openIfTopMost:I=!0}=e,{focusAfterOpen:k=!0}=e,{anchor:N=void 0}=e,{offset:A=void 0}=e,{popupClass:Q=void 0}=e,{maxWidth:D=void 0}=e,{lngLat:G=void 0}=e,{html:W=void 0}=e,{open:E=!1}=e;const X=Pt(),{map:K,popupTarget:_,layerEvent:ee,layer:$,eventTopMost:te}=Rt();U(s,K,p=>n(2,o=p)),U(s,_,p=>n(3,u=p)),U(s,ee,p=>n(28,r=p)),U(s,$,p=>n(35,i=p));const F=["click","dblclick","contextmenu"];let d,b=!1,B;function ce(){if(!d)return;let p=d.getElement();!p||p===B||(B=p,j==="hover"&&(B.style.pointerEvents="none"),B.addEventListener("mouseenter",()=>{n(24,b=!0)},{passive:!0}),B.addEventListener("mouseleave",()=>{n(24,b=!1)},{passive:!0}),B.addEventListener("click",()=>{M&&n(0,E=!1)},{passive:!0}))}Ot(()=>{if(o)return o.on("click",ue),o.on("contextmenu",ue),typeof u=="string"&&(o.on("click",u,ie),o.on("dblclick",u,ie),o.on("contextmenu",u,ie),o.on("mousemove",u,_e),o.on("mouseleave",u,Ce),o.on("touchstart",u,we),o.on("touchend",u,be)),()=>{o!=null&&o.loaded()&&(d==null||d.remove(),o.off("click",ue),o.off("contextmenu",ue),u instanceof Se.Marker?u.getPopup()===d&&u.setPopup(void 0):typeof u=="string"&&(o.off("click",u,ie),o.off("dblclick",u,ie),o.off("contextmenu",u,ie),o.off("mousemove",u,_e),o.off("mouseleave",u,Ce),o.off("touchstart",u,we),o.off("touchend",u,be)))}});function he(p){return I?!("marker"in p)&&!Dt(p)&&te(p)!==i:!1}let ne=null,le="normal";function ie(p){p.type===j&&(he(p)||("layerType"in p?p.layerType==="deckgl"?(n(10,G=p.coordinate),n(4,ne=p.object?[p.object]:null)):(n(10,G=p.lngLat),n(4,ne=p.features??[])):(n(10,G=p.lngLat),n(4,ne=p.features??[])),setTimeout(()=>n(0,E=!0))))}let pe=null;function we(p){pe=p.point}function be(p){if(!pe||j!=="hover")return;let me=pe.dist(p.point);pe=null,me<3&&(n(10,G=p.lngLat),n(4,ne=p.features??[]),d.isOpen()?n(25,le="justOpened"):(n(25,le="opening"),n(0,E=!0)))}function Ce(p){j!=="hover"||pe||le!=="normal"||(n(0,E=!1),n(4,ne=null))}function _e(p){if(!(j!=="hover"||pe||le!=="normal")){if(he(p)){n(0,E=!1),n(4,ne=null);return}n(0,E=!0),n(4,ne=p.features??[]),n(10,G=p.lngLat)}}function ue(p){if(le==="justOpened"){n(25,le="normal");return}if(!C)return;let me=[B,u instanceof Se.Marker?u==null?void 0:u.getElement():null];E&&d.isOpen()&&!me.some(de=>de==null?void 0:de.contains(p.originalEvent.target))&&(p.type==="contextmenu"&&j==="contextmenu"||p.type!=="contextmenu")&&n(0,E=!1)}Ht(()=>{o&&(d!=null&&d.isOpen())&&d.remove()});let fe;const Ae=()=>n(0,E=!1);function ke(p){ve[p?"unshift":"push"](()=>{fe=p,n(1,fe)})}return s.$$set=p=>{"closeButton"in p&&n(11,S=p.closeButton),"closeOnClickOutside"in p&&n(12,C=p.closeOnClickOutside),"closeOnClickInside"in p&&n(13,M=p.closeOnClickInside),"closeOnMove"in p&&n(14,y=p.closeOnMove),"openOn"in p&&n(15,j=p.openOn),"openIfTopMost"in p&&n(16,I=p.openIfTopMost),"focusAfterOpen"in p&&n(17,k=p.focusAfterOpen),"anchor"in p&&n(18,N=p.anchor),"offset"in p&&n(19,A=p.offset),"popupClass"in p&&n(20,Q=p.popupClass),"maxWidth"in p&&n(21,D=p.maxWidth),"lngLat"in p&&n(10,G=p.lngLat),"html"in p&&n(22,W=p.html),"open"in p&&n(0,E=p.open),"$$scope"in p&&n(29,m=p.$$scope)},s.$$.update=()=>{if(s.$$.dirty[0]&14336&&n(27,t=S??(!C&&!M)),s.$$.dirty[0]&146685952&&(d||(n(23,d=new Se.Popup({closeButton:t,closeOnClick:!1,closeOnMove:y,focusAfterOpen:k,maxWidth:D,className:Q,anchor:N,offset:A})),B=d.getElement(),d.on("open",()=>{n(0,E=!0),ce(),X("open",d)}),d.on("close",()=>{n(0,E=!1),X("close",d)}),d.on("hover",()=>{X("hover",d)}))),s.$$.dirty[0]&8421384&&d&&u instanceof Se.Marker&&(j==="click"?u.setPopup(d):u.getPopup()===d&&u.setPopup(void 0)),s.$$.dirty[0]&268468224&&F.includes(j)&&(r==null?void 0:r.type)===j&&(ie(r),At(ee,r=null,r)),s.$$.dirty[0]&268468224&&n(26,l=j==="hover"&&((r==null?void 0:r.type)==="mousemove"||(r==null?void 0:r.type)==="mouseenter")),s.$$.dirty[0]&352354304&&j==="hover"&&ee&&(l&&r&&(r.layerType==="deckgl"?(n(10,G=r.coordinate),n(4,ne=r.object?[r.object]:null)):(n(10,G=r.lngLat),n(4,ne=r.features??[]))),n(0,E=(l||b)??!1)),s.$$.dirty[0]&12582914&&(fe?d.setDOMContent(fe):W&&d.setHTML(W)),s.$$.dirty[0]&8389632&&G&&d.setLngLat(G),s.$$.dirty[0]&41943045&&o){let p=d.isOpen();E&&!p?(d.addTo(o),le==="opening"&&n(25,le="justOpened")):!E&&p&&d.remove()}},[E,fe,o,u,ne,K,_,ee,$,O,G,S,C,M,y,j,I,k,N,A,Q,D,W,d,b,le,l,t,r,m,f,Ae,ke]}class qe extends se{constructor(e){super(),re(this,e,sn,on,x,{closeButton:11,closeOnClickOutside:12,closeOnClickInside:13,closeOnMove:14,openOn:15,openIfTopMost:16,focusAfterOpen:17,anchor:18,offset:19,popupClass:20,maxWidth:21,lngLat:10,html:22,open:0},null,[-1,-1])}}function rn(s){let e;const n=s[16].default,t=Lt(n,s,s[24],null);return{c(){t&&t.c()},m(l,o){t&&t.m(l,o),e=!0},p(l,o){t&&t.p&&(!e||o&16777216)&&Mt(t,n,l,l[24],e?Tt(n,l[24],o,null):St(l[24]),null)},i(l){e||(w(t,l),e=!0)},o(l){L(t,l),e=!1},d(l){t&&t.d(l)}}}function un(s){let e,n,t;function l(r){s[17](r)}let o={id:s[1],type:"symbol",source:s[2],sourceLayer:s[3],beforeId:s[4],beforeLayerType:s[5],paint:s[6],layout:s[7],filter:s[8],applyToClusters:s[9],minzoom:s[10],maxzoom:s[11],hoverCursor:s[12],manageHoverState:s[13],eventsIfTopMost:s[14],interactive:s[15],$$slots:{default:[rn]},$$scope:{ctx:s}};return s[0]!==void 0&&(o.hovered=s[0]),e=new Et({props:o}),ve.push(()=>Fe(e,"hovered",l)),e.$on("click",s[18]),e.$on("dblclick",s[19]),e.$on("contextmenu",s[20]),e.$on("mouseenter",s[21]),e.$on("mousemove",s[22]),e.$on("mouseleave",s[23]),{c(){J(e.$$.fragment)},m(r,u){z(e,r,u),t=!0},p(r,[u]){const i={};u&2&&(i.id=r[1]),u&4&&(i.source=r[2]),u&8&&(i.sourceLayer=r[3]),u&16&&(i.beforeId=r[4]),u&32&&(i.beforeLayerType=r[5]),u&64&&(i.paint=r[6]),u&128&&(i.layout=r[7]),u&256&&(i.filter=r[8]),u&512&&(i.applyToClusters=r[9]),u&1024&&(i.minzoom=r[10]),u&2048&&(i.maxzoom=r[11]),u&4096&&(i.hoverCursor=r[12]),u&8192&&(i.manageHoverState=r[13]),u&16384&&(i.eventsIfTopMost=r[14]),u&32768&&(i.interactive=r[15]),u&16777216&&(i.$$scope={dirty:u,ctx:r}),!n&&u&1&&(n=!0,i.hovered=r[0],Ge(()=>n=!1)),e.$set(i)},i(r){t||(w(e.$$.fragment,r),t=!0)},o(r){L(e.$$.fragment,r),t=!1},d(r){P(e,r)}}}function fn(s,e,n){let{$$slots:t={},$$scope:l}=e,{id:o=Ft("symbol")}=e,{source:r=void 0}=e,{sourceLayer:u=void 0}=e,{beforeId:i=void 0}=e,{beforeLayerType:f=void 0}=e,{paint:m=void 0}=e,{layout:O=void 0}=e,{filter:S=void 0}=e,{applyToClusters:C=void 0}=e,{minzoom:M=void 0}=e,{maxzoom:y=void 0}=e,{hoverCursor:j=void 0}=e,{manageHoverState:I=!1}=e,{hovered:k=null}=e,{eventsIfTopMost:N=!1}=e,{interactive:A=!0}=e;function Q(_){k=_,n(0,k)}function D(_){Me.call(this,s,_)}function G(_){Me.call(this,s,_)}function W(_){Me.call(this,s,_)}function E(_){Me.call(this,s,_)}function X(_){Me.call(this,s,_)}function K(_){Me.call(this,s,_)}return s.$$set=_=>{"id"in _&&n(1,o=_.id),"source"in _&&n(2,r=_.source),"sourceLayer"in _&&n(3,u=_.sourceLayer),"beforeId"in _&&n(4,i=_.beforeId),"beforeLayerType"in _&&n(5,f=_.beforeLayerType),"paint"in _&&n(6,m=_.paint),"layout"in _&&n(7,O=_.layout),"filter"in _&&n(8,S=_.filter),"applyToClusters"in _&&n(9,C=_.applyToClusters),"minzoom"in _&&n(10,M=_.minzoom),"maxzoom"in _&&n(11,y=_.maxzoom),"hoverCursor"in _&&n(12,j=_.hoverCursor),"manageHoverState"in _&&n(13,I=_.manageHoverState),"hovered"in _&&n(0,k=_.hovered),"eventsIfTopMost"in _&&n(14,N=_.eventsIfTopMost),"interactive"in _&&n(15,A=_.interactive),"$$scope"in _&&n(24,l=_.$$scope)},[k,o,r,u,i,f,m,O,S,C,M,y,j,I,N,A,t,Q,D,G,W,E,X,K,l]}class an extends se{constructor(e){super(),re(this,e,fn,un,x,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,applyToClusters:9,minzoom:10,maxzoom:11,hoverCursor:12,manageHoverState:13,hovered:0,eventsIfTopMost:14,interactive:15})}}function ct(s,e,n){const t=s.slice();return t[1]=e[n][0],t[2]=e[n][1],t}function pt(s){let e,n,t,l=s[1]+"",o,r;return{c(){e=c("li"),n=c("span"),t=v(),o=R(l),r=v(),q(n,"class","svelte-kzgqtg"),lt(n,"background",s[2])},m(u,i){g(u,e,i),a(e,n),a(e,t),a(e,o),a(e,r)},p(u,i){i&1&<(n,"background",u[2]),i&1&&l!==(l=u[1]+"")&&Qe(o,l)},d(u){u&&h(e)}}}function cn(s){let e,n=ge(s[0]),t=[];for(let l=0;l{"rows"in l&&n(0,t=l.rows)},[t]}class mn extends se{constructor(e){super(),re(this,e,pn,cn,x,{rows:0})}}function dn(s){let e,n,t,l,o,r,u,i,f,m;return{c(){e=c("div"),n=c("label"),t=R(`Basemap: +import{S as se,i as re,s as x,e as He,a as g,t as w,g as Ie,b as L,c as je,d as h,f as zt,h as Pt,m as Rt,j as U,o as Ot,k as Se,l as Et,n as At,p as c,q as Lt,u as Mt,r as St,v as Tt,w as Dt,x as ve,L as Ht,y as Fe,z as J,A as z,B as Ge,C as P,D as Ft,E as Me,F as ge,G as V,H as $e,I as v,J as R,K as q,M as lt,N as a,O as Qe,P as Te,Q as It,R as De,T as oe,U as ot,V as jt,W as st,X as ae,Y as Ne,Z as Nt,_ as We,$ as Bt,a0 as Re,a1 as rt,a2 as it,a3 as Ee,a4 as Xe,a5 as Gt,a6 as Ue,a7 as Ye,a8 as Jt,a9 as $t,aa as Wt,ab as Ut,ac as qt,ad as Vt,ae as Kt,af as Zt,ag as Qt,ah as Xt,ai as Yt,aj as xt,ak as en,al as tn,am as nn}from"./RenderLanePolygons-fdad512c.js";const ln=s=>({features:s[0]&16,data:s[0]&16,map:s[0]&4,close:s[0]&1}),ut=s=>{var e;return{features:s[4],data:(e=s[4])==null?void 0:e[0],map:s[2],close:s[31]}};function ft(s){let e,n,t=(s[4]||s[3]instanceof Se.Marker)&&at(s);return{c(){e=c("div"),t&&t.c()},m(l,o){g(l,e,o),t&&t.m(e,null),s[32](e),n=!0},p(l,o){l[4]||l[3]instanceof Se.Marker?t?(t.p(l,o),o[0]&24&&w(t,1)):(t=at(l),t.c(),w(t,1),t.m(e,null)):t&&(Ie(),L(t,1,1,()=>{t=null}),je())},i(l){n||(w(t),n=!0)},o(l){L(t),n=!1},d(l){l&&h(e),t&&t.d(),s[32](null)}}}function at(s){let e;const n=s[30].default,t=Lt(n,s,s[29],ut);return{c(){t&&t.c()},m(l,o){t&&t.m(l,o),e=!0},p(l,o){t&&t.p&&(!e||o[0]&536870933)&&Mt(t,n,l,l[29],e?Tt(n,l[29],o,ln):St(l[29]),ut)},i(l){e||(w(t,l),e=!0)},o(l){L(t,l),e=!1},d(l){t&&t.d(l)}}}function on(s){let e,n,t=s[9].default&&ft(s);return{c(){t&&t.c(),e=He()},m(l,o){t&&t.m(l,o),g(l,e,o),n=!0},p(l,o){l[9].default?t?(t.p(l,o),o[0]&512&&w(t,1)):(t=ft(l),t.c(),w(t,1),t.m(e.parentNode,e)):t&&(Ie(),L(t,1,1,()=>{t=null}),je())},i(l){n||(w(t),n=!0)},o(l){L(t),n=!1},d(l){l&&h(e),t&&t.d(l)}}}function sn(s,e,n){let t,l,o,r,u,i,{$$slots:f={},$$scope:m}=e;const O=zt(f);let{closeButton:S=void 0}=e,{closeOnClickOutside:C=!0}=e,{closeOnClickInside:M=!1}=e,{closeOnMove:y=!1}=e,{openOn:j="click"}=e,{openIfTopMost:I=!0}=e,{focusAfterOpen:k=!0}=e,{anchor:N=void 0}=e,{offset:A=void 0}=e,{popupClass:Q=void 0}=e,{maxWidth:D=void 0}=e,{lngLat:G=void 0}=e,{html:W=void 0}=e,{open:H=!1}=e;const X=Pt(),{map:K,popupTarget:_,layerEvent:ee,layer:$,eventTopMost:te}=Rt();U(s,K,p=>n(2,o=p)),U(s,_,p=>n(3,u=p)),U(s,ee,p=>n(28,r=p)),U(s,$,p=>n(35,i=p));const F=["click","dblclick","contextmenu"];let d,b=!1,B;function ce(){if(!d)return;let p=d.getElement();!p||p===B||(B=p,j==="hover"&&(B.style.pointerEvents="none"),B.addEventListener("mouseenter",()=>{n(24,b=!0)},{passive:!0}),B.addEventListener("mouseleave",()=>{n(24,b=!1)},{passive:!0}),B.addEventListener("click",()=>{M&&n(0,H=!1)},{passive:!0}))}Ot(()=>{if(o)return o.on("click",ue),o.on("contextmenu",ue),typeof u=="string"&&(o.on("click",u,ie),o.on("dblclick",u,ie),o.on("contextmenu",u,ie),o.on("mousemove",u,_e),o.on("mouseleave",u,Ce),o.on("touchstart",u,we),o.on("touchend",u,be)),()=>{o!=null&&o.loaded()&&(d==null||d.remove(),o.off("click",ue),o.off("contextmenu",ue),u instanceof Se.Marker?u.getPopup()===d&&u.setPopup(void 0):typeof u=="string"&&(o.off("click",u,ie),o.off("dblclick",u,ie),o.off("contextmenu",u,ie),o.off("mousemove",u,_e),o.off("mouseleave",u,Ce),o.off("touchstart",u,we),o.off("touchend",u,be)))}});function he(p){return I?!("marker"in p)&&!Dt(p)&&te(p)!==i:!1}let ne=null,le="normal";function ie(p){p.type===j&&(he(p)||("layerType"in p?p.layerType==="deckgl"?(n(10,G=p.coordinate),n(4,ne=p.object?[p.object]:null)):(n(10,G=p.lngLat),n(4,ne=p.features??[])):(n(10,G=p.lngLat),n(4,ne=p.features??[])),setTimeout(()=>n(0,H=!0))))}let pe=null;function we(p){pe=p.point}function be(p){if(!pe||j!=="hover")return;let me=pe.dist(p.point);pe=null,me<3&&(n(10,G=p.lngLat),n(4,ne=p.features??[]),d.isOpen()?n(25,le="justOpened"):(n(25,le="opening"),n(0,H=!0)))}function Ce(p){j!=="hover"||pe||le!=="normal"||(n(0,H=!1),n(4,ne=null))}function _e(p){if(!(j!=="hover"||pe||le!=="normal")){if(he(p)){n(0,H=!1),n(4,ne=null);return}n(0,H=!0),n(4,ne=p.features??[]),n(10,G=p.lngLat)}}function ue(p){if(le==="justOpened"){n(25,le="normal");return}if(!C)return;let me=[B,u instanceof Se.Marker?u==null?void 0:u.getElement():null];H&&d.isOpen()&&!me.some(de=>de==null?void 0:de.contains(p.originalEvent.target))&&(p.type==="contextmenu"&&j==="contextmenu"||p.type!=="contextmenu")&&n(0,H=!1)}Et(()=>{o&&(d!=null&&d.isOpen())&&d.remove()});let fe;const Ae=()=>n(0,H=!1);function ke(p){ve[p?"unshift":"push"](()=>{fe=p,n(1,fe)})}return s.$$set=p=>{"closeButton"in p&&n(11,S=p.closeButton),"closeOnClickOutside"in p&&n(12,C=p.closeOnClickOutside),"closeOnClickInside"in p&&n(13,M=p.closeOnClickInside),"closeOnMove"in p&&n(14,y=p.closeOnMove),"openOn"in p&&n(15,j=p.openOn),"openIfTopMost"in p&&n(16,I=p.openIfTopMost),"focusAfterOpen"in p&&n(17,k=p.focusAfterOpen),"anchor"in p&&n(18,N=p.anchor),"offset"in p&&n(19,A=p.offset),"popupClass"in p&&n(20,Q=p.popupClass),"maxWidth"in p&&n(21,D=p.maxWidth),"lngLat"in p&&n(10,G=p.lngLat),"html"in p&&n(22,W=p.html),"open"in p&&n(0,H=p.open),"$$scope"in p&&n(29,m=p.$$scope)},s.$$.update=()=>{if(s.$$.dirty[0]&14336&&n(27,t=S??(!C&&!M)),s.$$.dirty[0]&146685952&&(d||(n(23,d=new Se.Popup({closeButton:t,closeOnClick:!1,closeOnMove:y,focusAfterOpen:k,maxWidth:D,className:Q,anchor:N,offset:A})),B=d.getElement(),d.on("open",()=>{n(0,H=!0),ce(),X("open",d)}),d.on("close",()=>{n(0,H=!1),X("close",d)}),d.on("hover",()=>{X("hover",d)}))),s.$$.dirty[0]&8421384&&d&&u instanceof Se.Marker&&(j==="click"?u.setPopup(d):u.getPopup()===d&&u.setPopup(void 0)),s.$$.dirty[0]&268468224&&F.includes(j)&&(r==null?void 0:r.type)===j&&(ie(r),At(ee,r=null,r)),s.$$.dirty[0]&268468224&&n(26,l=j==="hover"&&((r==null?void 0:r.type)==="mousemove"||(r==null?void 0:r.type)==="mouseenter")),s.$$.dirty[0]&352354304&&j==="hover"&&ee&&(l&&r&&(r.layerType==="deckgl"?(n(10,G=r.coordinate),n(4,ne=r.object?[r.object]:null)):(n(10,G=r.lngLat),n(4,ne=r.features??[]))),n(0,H=(l||b)??!1)),s.$$.dirty[0]&12582914&&(fe?d.setDOMContent(fe):W&&d.setHTML(W)),s.$$.dirty[0]&8389632&&G&&d.setLngLat(G),s.$$.dirty[0]&41943045&&o){let p=d.isOpen();H&&!p?(d.addTo(o),le==="opening"&&n(25,le="justOpened")):!H&&p&&d.remove()}},[H,fe,o,u,ne,K,_,ee,$,O,G,S,C,M,y,j,I,k,N,A,Q,D,W,d,b,le,l,t,r,m,f,Ae,ke]}class qe extends se{constructor(e){super(),re(this,e,sn,on,x,{closeButton:11,closeOnClickOutside:12,closeOnClickInside:13,closeOnMove:14,openOn:15,openIfTopMost:16,focusAfterOpen:17,anchor:18,offset:19,popupClass:20,maxWidth:21,lngLat:10,html:22,open:0},null,[-1,-1])}}function rn(s){let e;const n=s[16].default,t=Lt(n,s,s[24],null);return{c(){t&&t.c()},m(l,o){t&&t.m(l,o),e=!0},p(l,o){t&&t.p&&(!e||o&16777216)&&Mt(t,n,l,l[24],e?Tt(n,l[24],o,null):St(l[24]),null)},i(l){e||(w(t,l),e=!0)},o(l){L(t,l),e=!1},d(l){t&&t.d(l)}}}function un(s){let e,n,t;function l(r){s[17](r)}let o={id:s[1],type:"symbol",source:s[2],sourceLayer:s[3],beforeId:s[4],beforeLayerType:s[5],paint:s[6],layout:s[7],filter:s[8],applyToClusters:s[9],minzoom:s[10],maxzoom:s[11],hoverCursor:s[12],manageHoverState:s[13],eventsIfTopMost:s[14],interactive:s[15],$$slots:{default:[rn]},$$scope:{ctx:s}};return s[0]!==void 0&&(o.hovered=s[0]),e=new Ht({props:o}),ve.push(()=>Fe(e,"hovered",l)),e.$on("click",s[18]),e.$on("dblclick",s[19]),e.$on("contextmenu",s[20]),e.$on("mouseenter",s[21]),e.$on("mousemove",s[22]),e.$on("mouseleave",s[23]),{c(){J(e.$$.fragment)},m(r,u){z(e,r,u),t=!0},p(r,[u]){const i={};u&2&&(i.id=r[1]),u&4&&(i.source=r[2]),u&8&&(i.sourceLayer=r[3]),u&16&&(i.beforeId=r[4]),u&32&&(i.beforeLayerType=r[5]),u&64&&(i.paint=r[6]),u&128&&(i.layout=r[7]),u&256&&(i.filter=r[8]),u&512&&(i.applyToClusters=r[9]),u&1024&&(i.minzoom=r[10]),u&2048&&(i.maxzoom=r[11]),u&4096&&(i.hoverCursor=r[12]),u&8192&&(i.manageHoverState=r[13]),u&16384&&(i.eventsIfTopMost=r[14]),u&32768&&(i.interactive=r[15]),u&16777216&&(i.$$scope={dirty:u,ctx:r}),!n&&u&1&&(n=!0,i.hovered=r[0],Ge(()=>n=!1)),e.$set(i)},i(r){t||(w(e.$$.fragment,r),t=!0)},o(r){L(e.$$.fragment,r),t=!1},d(r){P(e,r)}}}function fn(s,e,n){let{$$slots:t={},$$scope:l}=e,{id:o=Ft("symbol")}=e,{source:r=void 0}=e,{sourceLayer:u=void 0}=e,{beforeId:i=void 0}=e,{beforeLayerType:f=void 0}=e,{paint:m=void 0}=e,{layout:O=void 0}=e,{filter:S=void 0}=e,{applyToClusters:C=void 0}=e,{minzoom:M=void 0}=e,{maxzoom:y=void 0}=e,{hoverCursor:j=void 0}=e,{manageHoverState:I=!1}=e,{hovered:k=null}=e,{eventsIfTopMost:N=!1}=e,{interactive:A=!0}=e;function Q(_){k=_,n(0,k)}function D(_){Me.call(this,s,_)}function G(_){Me.call(this,s,_)}function W(_){Me.call(this,s,_)}function H(_){Me.call(this,s,_)}function X(_){Me.call(this,s,_)}function K(_){Me.call(this,s,_)}return s.$$set=_=>{"id"in _&&n(1,o=_.id),"source"in _&&n(2,r=_.source),"sourceLayer"in _&&n(3,u=_.sourceLayer),"beforeId"in _&&n(4,i=_.beforeId),"beforeLayerType"in _&&n(5,f=_.beforeLayerType),"paint"in _&&n(6,m=_.paint),"layout"in _&&n(7,O=_.layout),"filter"in _&&n(8,S=_.filter),"applyToClusters"in _&&n(9,C=_.applyToClusters),"minzoom"in _&&n(10,M=_.minzoom),"maxzoom"in _&&n(11,y=_.maxzoom),"hoverCursor"in _&&n(12,j=_.hoverCursor),"manageHoverState"in _&&n(13,I=_.manageHoverState),"hovered"in _&&n(0,k=_.hovered),"eventsIfTopMost"in _&&n(14,N=_.eventsIfTopMost),"interactive"in _&&n(15,A=_.interactive),"$$scope"in _&&n(24,l=_.$$scope)},[k,o,r,u,i,f,m,O,S,C,M,y,j,I,N,A,t,Q,D,G,W,H,X,K,l]}class an extends se{constructor(e){super(),re(this,e,fn,un,x,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,applyToClusters:9,minzoom:10,maxzoom:11,hoverCursor:12,manageHoverState:13,hovered:0,eventsIfTopMost:14,interactive:15})}}function ct(s,e,n){const t=s.slice();return t[1]=e[n][0],t[2]=e[n][1],t}function pt(s){let e,n,t,l=s[1]+"",o,r;return{c(){e=c("li"),n=c("span"),t=v(),o=R(l),r=v(),q(n,"class","svelte-kzgqtg"),lt(n,"background",s[2])},m(u,i){g(u,e,i),a(e,n),a(e,t),a(e,o),a(e,r)},p(u,i){i&1&<(n,"background",u[2]),i&1&&l!==(l=u[1]+"")&&Qe(o,l)},d(u){u&&h(e)}}}function cn(s){let e,n=ge(s[0]),t=[];for(let l=0;l{"rows"in l&&n(0,t=l.rows)},[t]}class mn extends se{constructor(e){super(),re(this,e,pn,cn,x,{rows:0})}}function dn(s){let e,n,t,l,o,r,u,i,f,m;return{c(){e=c("div"),n=c("label"),t=R(`Basemap: `),l=c("select"),o=c("option"),o.textContent="MapTiler Dataviz",r=c("option"),r.textContent="MapTiler Streets",u=c("option"),u.textContent="MapTiler Satellite",i=c("option"),i.textContent="Blank",o.__value="dataviz",Te(o,o.__value),r.__value="streets",Te(r,r.__value),u.__value="hybrid",Te(u,u.__value),i.__value="blank",Te(i,i.__value),s[0]===void 0&&It(()=>s[1].call(l))},m(O,S){g(O,e,S),a(e,n),a(n,t),a(n,l),a(l,o),a(l,r),a(l,u),a(l,i),De(l,s[0],!0),f||(m=oe(l,"change",s[1]),f=!0)},p(O,[S]){S&1&&De(l,O[0])},i:V,o:V,d(O){O&&h(e),f=!1,m()}}}function _n(s,e,n){let t;U(s,ot,o=>n(0,t=o));function l(){t=jt(this),ot.set(t)}return[t,l]}class gn extends se{constructor(e){super(),re(this,e,_n,dn,x,{})}}function hn(s){let e,n,t,l,o,r,u,i;return{c(){e=c("div"),n=c("label"),t=R(`Theme: - `),l=c("select"),o=c("option"),o.textContent="Debug",r=c("option"),r.textContent="Realistic",o.__value="debug",Te(o,o.__value),r.__value="realistic",Te(r,r.__value),s[0]===void 0&&It(()=>s[1].call(l))},m(f,m){g(f,e,m),a(e,n),a(n,t),a(n,l),a(l,o),a(l,r),De(l,s[0],!0),u||(i=oe(l,"change",s[1]),u=!0)},p(f,[m]){m&1&&De(l,f[0])},i:V,o:V,d(f){f&&h(e),u=!1,i()}}}function bn(s,e,n){let t;U(s,st,o=>n(0,t=o));function l(){t=jt(this),st.set(t)}return[t,l]}class kn extends se{constructor(e){super(),re(this,e,bn,hn,x,{})}}const Pe=Nt(Ne()),Ze=Nt(!1);ae.subscribe(s=>{Pe.set(Ne())});function yn(s){let e,n=s[11].properties.kind+"",t;return{c(){e=c("p"),t=R(n)},m(l,o){g(l,e,o),a(e,t)},p(l,o){o&2048&&n!==(n=l[11].properties.kind+"")&&Qe(t,n)},d(l){l&&h(e)}}}function vn(s){let e,n;return e=new qe({props:{openOn:"hover",$$slots:{default:[yn,({data:t})=>({11:t}),({data:t})=>t?2048:0]},$$scope:{ctx:s}}}),{c(){J(e.$$.fragment)},m(t,l){z(e,t,l),n=!0},p(t,l){const o={};l&6144&&(o.$$scope={dirty:l,ctx:t}),e.$set(o)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){L(e.$$.fragment,t),n=!1},d(t){P(e,t)}}}function wn(s){let e,n=JSON.stringify(s[11].properties,null," ")+"",t;return{c(){e=c("pre"),t=R(n)},m(l,o){g(l,e,o),a(e,t)},p(l,o){o&2048&&n!==(n=JSON.stringify(l[11].properties,null," ")+"")&&Qe(t,n)},d(l){l&&h(e)}}}function Cn(s){let e,n;return e=new qe({props:{openOn:"hover",$$slots:{default:[wn,({data:t})=>({11:t}),({data:t})=>t?2048:0]},$$scope:{ctx:s}}}),{c(){J(e.$$.fragment)},m(t,l){z(e,t,l),n=!0},p(t,l){const o={};l&6144&&(o.$$scope={dirty:l,ctx:t}),e.$set(o)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){L(e.$$.fragment,t),n=!1},d(t){P(e,t)}}}function On(s){let e,n,t,l;const o=[Re("block"),{filter:["==",["get","type"],"block"]},{manageHoverState:!0},{paint:{"fill-color":rt("kind",s[1],"red"),"fill-opacity":it(.8,.4)}}];let r={$$slots:{default:[vn]},$$scope:{ctx:s}};for(let f=0;f{I=null}),je())},i(k){M||(w(e.$$.fragment,k),w(I),M=!0)},o(k){L(e.$$.fragment,k),L(I),M=!1},d(k){k&&(h(n),h(t),h(S),h(C)),P(e,k),I&&I.d(k),y=!1,Bt(j)}}}function Mn(s,e,n){let t,l,o,r,u;U(s,Ze,M=>n(5,o=M)),U(s,ae,M=>n(8,r=M)),U(s,Pe,M=>n(0,u=M));function i(){Pe.set(Ne())}function f(M){Pe.set(JSON.parse(r.findAllBlocks(M))),Ze.set(M)}let m={LandUseBlock:"grey",RoadAndSidewalk:"green",RoadAndCycleLane:"orange",CycleLaneAndSidewalk:"yellow",DualCarriageway:"purple",Unknown:"blue"},O={LandUseBlock:"grey",RoadBundle:"green",IntersectionBundle:"orange",Unknown:"blue"};const S=()=>f(!1),C=()=>f(!0);return s.$$.update=()=>{s.$$.dirty&1&&n(2,t=u.features.length>0),s.$$.dirty&32&&n(1,l=o?O:m)},[u,l,t,i,f,o,S,C]}class Sn extends se{constructor(e){super(),re(this,e,Mn,Ln,x,{})}}function Tn(s){let e,n;const t=[Re("connected-roads"),{layout:{visibility:s[0]?"visible":"none"}},{paint:{"fill-color":"blue","fill-opacity":.5}}];let l={};for(let o=0;oFe(t,"show",r)),{c(){J(e.$$.fragment),n=v(),J(t.$$.fragment)},m(i,f){z(e,i,f),g(i,n,f),z(t,i,f),o=!0},p(i,[f]){const m={};f&2&&(m.data=i[1]),f&33&&(m.$$scope={dirty:f,ctx:i}),e.$set(m);const O={};f&2&&(O.gj=i[1]),!l&&f&1&&(l=!0,O.show=i[0],Ge(()=>l=!1)),t.$set(O)},i(i){o||(w(e.$$.fragment,i),w(t.$$.fragment,i),o=!0)},o(i){L(e.$$.fragment,i),L(t.$$.fragment,i),o=!1},d(i){i&&h(n),P(e,i),P(t,i)}}}function jn(s,e,n){let t,l,o;U(s,Jt,i=>n(2,l=i)),U(s,ae,i=>n(3,o=i));let r=!1;function u(i){r=i,n(0,r)}return s.$$.update=()=>{s.$$.dirty&12&&n(1,t=o&&l?JSON.parse(o.debugRoadsConnectedToIntersectionGeojson(l.properties.id)):Ne())},[r,t,l,o,u]}class Nn extends se{constructor(e){super(),re(this,e,jn,In,x,{})}}function Bn(s){let e,n;const t=[Re("movements"),{layout:{visibility:s[0]?"visible":"none"}},{paint:{"fill-color":"blue","fill-opacity":.5}}];let l={};for(let o=0;oFe(t,"show",r)),{c(){J(e.$$.fragment),n=v(),J(t.$$.fragment)},m(i,f){z(e,i,f),g(i,n,f),z(t,i,f),o=!0},p(i,[f]){const m={};f&2&&(m.data=i[1]),f&33&&(m.$$scope={dirty:f,ctx:i}),e.$set(m);const O={};f&2&&(O.gj=i[1]),!l&&f&1&&(l=!0,O.show=i[0],Ge(()=>l=!1)),t.$set(O)},i(i){o||(w(e.$$.fragment,i),w(t.$$.fragment,i),o=!0)},o(i){L(e.$$.fragment,i),L(t.$$.fragment,i),o=!1},d(i){i&&h(n),P(e,i),P(t,i)}}}function zn(s,e,n){let t,l,o;U(s,$t,i=>n(2,l=i)),U(s,ae,i=>n(3,o=i));let r=!0;function u(i){r=i,n(0,r)}return s.$$.update=()=>{s.$$.dirty&12&&n(1,t=o&&l?JSON.parse(o.debugMovementsFromLaneGeojson(l.properties.road,l.properties.index)):Ne())},[r,t,l,o,u]}class Pn extends se{constructor(e){super(),re(this,e,zn,Jn,x,{})}}function Rn(s){let e,n,t,l,o,r;return{c(){e=c("div"),n=c("label"),t=c("input"),l=R(` - Clockwise ordering of roads`),q(t,"type","checkbox")},m(u,i){g(u,e,i),a(e,n),a(n,t),t.checked=s[0],a(n,l),o||(r=oe(t,"change",s[5]),o=!0)},p(u,[i]){i&1&&(t.checked=u[0])},i:V,o:V,d(u){u&&h(e),o=!1,r()}}}function Hn(s,e,n){let t,l,o;U(s,Wt,f=>n(2,t=f)),U(s,Jt,f=>n(3,l=f)),U(s,ae,f=>n(4,o=f));let r=[],u=!1;function i(){u=this.checked,n(0,u)}return s.$$.update=()=>{if(s.$$.dirty&31){for(let f of r)f.remove();if(n(1,r=[]),u&&l){let f=JSON.parse(o.debugClockwiseOrderingForIntersectionGeojson(l.properties.id));for(let m of f.features)r.push(new Ut.Popup({closeButton:!1,closeOnClick:!1,focusAfterOpen:!1}).setLngLat(m.geometry.coordinates).setHTML(m.properties.label).addTo(t))}}},[u,r,t,l,o,i]}class An extends se{constructor(e){super(),re(this,e,Hn,Rn,x,{})}}function Dn(s){let e,n;const t=[Re("debug-ids"),{layout:{"text-field":["get","id"],visibility:s[0]?"visible":"none"}},{paint:{"text-halo-color":["case",["==",["get","type"],"intersection"],"red","cyan"],"text-halo-width":3}}];let l={};for(let o=0;oFe(t,"show",r)),{c(){J(e.$$.fragment),n=v(),J(t.$$.fragment)},m(i,f){z(e,i,f),g(i,n,f),z(t,i,f),o=!0},p(i,[f]){const m={};f&2&&(m.data=i[1]),f&17&&(m.$$scope={dirty:f,ctx:i}),e.$set(m);const O={};f&2&&(O.gj=i[1]),!l&&f&1&&(l=!0,O.show=i[0],Ge(()=>l=!1)),t.$set(O)},i(i){o||(w(e.$$.fragment,i),w(t.$$.fragment,i),o=!0)},o(i){L(e.$$.fragment,i),L(t.$$.fragment,i),o=!1},d(i){i&&h(n),P(e,i),P(t,i)}}}function Fn(s,e,n){let t,l;U(s,ae,u=>n(2,l=u));let o=!1;function r(u){o=u,n(0,o)}return s.$$.update=()=>{s.$$.dirty&4&&n(1,t=l?JSON.parse(l.toGeojsonPlain()):Ne())},[o,t,l,r]}class Gn extends se{constructor(e){super(),re(this,e,Fn,En,x,{})}}function dt(s,e,n){const t=s.slice();return t[5]=e[n],t}function _t(s){const e=s.slice(),n=JSON.parse(e[0].crossing);return e[8]=n,e}function $n(s){let e,n,t,l=s[8].kind+"",o,r,u=s[8].has_island&&Wn();return{c(){e=c("p"),n=c("u"),n.textContent="Crossing",t=R(": "),o=R(l),r=v(),u&&u.c()},m(i,f){g(i,e,f),a(e,n),a(e,t),a(e,o),a(e,r),u&&u.m(e,null)},p:V,d(i){i&&h(e),u&&u.d()}}}function Wn(s){let e;return{c(){e=R("(with an island)")},m(n,t){g(n,e,t)},d(n){n&&h(e)}}}function gt(s){let e,n=s[5]+"",t,l;return{c(){e=c("a"),t=R(n),l=R(","),q(e,"href","https://www.openstreetmap.org/node/"+s[5]),q(e,"target","_blank")},m(o,r){g(o,e,r),a(e,t),g(o,l,r)},p:V,d(o){o&&(h(e),h(l))}}}function Un(s){let e,n,t,l,o,r=s[0].intersection_kind+"",u,i,f,m,O,S=s[0].control+"",C,M,y,j,I,k=s[0].movements+"",N,A,Q,D,G,W,E,X,K,_,ee,$=s[0].crossing&&$n(_t(s)),te=ge(JSON.parse(s[0].osm_node_ids)),F=[];for(let d=0;dn(4,t=i));let{data:l}=e,{close:o}=e,r=l.properties;function u(){t.collapseIntersection(r.id),ae.set(t),o()}return s.$$set=i=>{"data"in i&&n(2,l=i.data),"close"in i&&n(3,o=i.close)},[r,u,l,o]}class Vn extends se{constructor(e){super(),re(this,e,qn,Un,x,{data:2,close:3})}}function ht(s,e,n){const t=s.slice();return t[12]=e[n],t}function bt(s,e,n){const t=s.slice();return t[15]=e[n][0],t[16]=e[n][1],t}function Kn(s){let e,n,t,l;return{c(){e=c("details"),n=c("summary"),n.textContent="Full Muv JSON",t=v(),l=c("pre"),l.textContent=`${JSON.stringify(JSON.parse(s[0].muv),null," ")}`},m(o,r){g(o,e,r),a(e,n),a(e,t),a(e,l)},p:V,d(o){o&&h(e)}}}function kt(s){let e,n,t;return{c(){e=c("tr"),n=c("td"),n.textContent=`${s[15]}`,t=c("td"),t.textContent=`${s[16]}`,q(n,"class","svelte-860yh4"),q(t,"class","svelte-860yh4")},m(l,o){g(l,e,o),a(e,n),a(e,t)},p:V,d(l){l&&h(e)}}}function yt(s){let e,n,t=s[12]+"",l,o,r,u,i,f,m,O=ge(Object.entries(JSON.parse(s[1].getOsmTagsForWay(BigInt(s[12]))))),S=[];for(let C=0;COSM ways:",Ce=v();for(let T=0;Tn(11,t=y));let{data:l}=e,{close:o}=e,r=l.properties,u=t;function i(){t.collapseShortRoad(r.road),ae.set(t),o()}function f(){t.zipSidepath(r.road),ae.set(t),o()}function m(y,j){try{Pe.set(JSON.parse(t.findBlock(r.road,y,j))),Ze.set(j),o()}catch(I){window.alert(I)}}const O=()=>m(!0,!1),S=()=>m(!1,!1),C=()=>m(!0,!0),M=()=>m(!1,!0);return s.$$set=y=>{"data"in y&&n(5,l=y.data),"close"in y&&n(6,o=y.close)},[r,u,i,f,m,l,o,O,S,C,M]}class Xn extends se{constructor(e){super(),re(this,e,Qn,Zn,x,{data:5,close:6})}}function vt(s){let e,n;return e=new Qt({}),{c(){J(e.$$.fragment)},m(t,l){z(e,t,l),n=!0},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){L(e.$$.fragment,t),n=!1},d(t){P(e,t)}}}function Yn(s){let e,n,t,l,o,r,u,i,f,m,O,S,C,M,y,j,I;l=new Vt({});let k=s[2]&&vt();return{c(){e=c("div"),n=c("h1"),n.textContent="osm2streets Street Explorer",t=v(),J(l.$$.fragment),o=v(),r=c("p"),r.innerHTML=`Understanding OSM streets & intersections with + `),l=c("select"),o=c("option"),o.textContent="Debug",r=c("option"),r.textContent="Realistic",o.__value="debug",Te(o,o.__value),r.__value="realistic",Te(r,r.__value),s[0]===void 0&&It(()=>s[1].call(l))},m(f,m){g(f,e,m),a(e,n),a(n,t),a(n,l),a(l,o),a(l,r),De(l,s[0],!0),u||(i=oe(l,"change",s[1]),u=!0)},p(f,[m]){m&1&&De(l,f[0])},i:V,o:V,d(f){f&&h(e),u=!1,i()}}}function bn(s,e,n){let t;U(s,st,o=>n(0,t=o));function l(){t=jt(this),st.set(t)}return[t,l]}class kn extends se{constructor(e){super(),re(this,e,bn,hn,x,{})}}const Pe=Nt(Ne()),Ze=Nt(!1);ae.subscribe(s=>{Pe.set(Ne())});function yn(s){let e,n=s[11].properties.kind+"",t;return{c(){e=c("p"),t=R(n)},m(l,o){g(l,e,o),a(e,t)},p(l,o){o&2048&&n!==(n=l[11].properties.kind+"")&&Qe(t,n)},d(l){l&&h(e)}}}function vn(s){let e,n;return e=new qe({props:{openOn:"hover",$$slots:{default:[yn,({data:t})=>({11:t}),({data:t})=>t?2048:0]},$$scope:{ctx:s}}}),{c(){J(e.$$.fragment)},m(t,l){z(e,t,l),n=!0},p(t,l){const o={};l&6144&&(o.$$scope={dirty:l,ctx:t}),e.$set(o)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){L(e.$$.fragment,t),n=!1},d(t){P(e,t)}}}function wn(s){let e,n=JSON.stringify(s[11].properties,null," ")+"",t;return{c(){e=c("pre"),t=R(n)},m(l,o){g(l,e,o),a(e,t)},p(l,o){o&2048&&n!==(n=JSON.stringify(l[11].properties,null," ")+"")&&Qe(t,n)},d(l){l&&h(e)}}}function Cn(s){let e,n;return e=new qe({props:{openOn:"hover",$$slots:{default:[wn,({data:t})=>({11:t}),({data:t})=>t?2048:0]},$$scope:{ctx:s}}}),{c(){J(e.$$.fragment)},m(t,l){z(e,t,l),n=!0},p(t,l){const o={};l&6144&&(o.$$scope={dirty:l,ctx:t}),e.$set(o)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){L(e.$$.fragment,t),n=!1},d(t){P(e,t)}}}function On(s){let e,n,t,l;const o=[Re("block"),{filter:["==",["get","type"],"block"]},{manageHoverState:!0},{paint:{"fill-color":rt(["get","kind"],s[1],"red"),"fill-opacity":it(.8,.4)}}];let r={$$slots:{default:[vn]},$$scope:{ctx:s}};for(let f=0;f{I=null}),je())},i(k){M||(w(e.$$.fragment,k),w(I),M=!0)},o(k){L(e.$$.fragment,k),L(I),M=!1},d(k){k&&(h(n),h(t),h(S),h(C)),P(e,k),I&&I.d(k),y=!1,Bt(j)}}}function Mn(s,e,n){let t,l,o,r,u;U(s,Ze,M=>n(5,o=M)),U(s,ae,M=>n(8,r=M)),U(s,Pe,M=>n(0,u=M));function i(){Pe.set(Ne())}function f(M){Pe.set(JSON.parse(r.findAllBlocks(M))),Ze.set(M)}let m={LandUseBlock:"grey",RoadAndSidewalk:"green",RoadAndCycleLane:"orange",CycleLaneAndSidewalk:"yellow",DualCarriageway:"purple",Unknown:"blue"},O={LandUseBlock:"grey",RoadBundle:"green",IntersectionBundle:"orange",Unknown:"blue"};const S=()=>f(!1),C=()=>f(!0);return s.$$.update=()=>{s.$$.dirty&1&&n(2,t=u.features.length>0),s.$$.dirty&32&&n(1,l=o?O:m)},[u,l,t,i,f,o,S,C]}class Sn extends se{constructor(e){super(),re(this,e,Mn,Ln,x,{})}}function Tn(s){let e,n;const t=[Re("connected-roads"),{layout:{visibility:s[0]?"visible":"none"}},{paint:{"fill-color":"blue","fill-opacity":.5}}];let l={};for(let o=0;oFe(t,"show",r)),{c(){J(e.$$.fragment),n=v(),J(t.$$.fragment)},m(i,f){z(e,i,f),g(i,n,f),z(t,i,f),o=!0},p(i,[f]){const m={};f&2&&(m.data=i[1]),f&33&&(m.$$scope={dirty:f,ctx:i}),e.$set(m);const O={};f&2&&(O.gj=i[1]),!l&&f&1&&(l=!0,O.show=i[0],Ge(()=>l=!1)),t.$set(O)},i(i){o||(w(e.$$.fragment,i),w(t.$$.fragment,i),o=!0)},o(i){L(e.$$.fragment,i),L(t.$$.fragment,i),o=!1},d(i){i&&h(n),P(e,i),P(t,i)}}}function jn(s,e,n){let t,l,o;U(s,Jt,i=>n(2,l=i)),U(s,ae,i=>n(3,o=i));let r=!1;function u(i){r=i,n(0,r)}return s.$$.update=()=>{s.$$.dirty&12&&n(1,t=o&&l?JSON.parse(o.debugRoadsConnectedToIntersectionGeojson(l.properties.id)):Ne())},[r,t,l,o,u]}class Nn extends se{constructor(e){super(),re(this,e,jn,In,x,{})}}function Bn(s){let e,n;const t=[Re("movements"),{layout:{visibility:s[0]?"visible":"none"}},{paint:{"fill-color":"blue","fill-opacity":.5}}];let l={};for(let o=0;oFe(t,"show",r)),{c(){J(e.$$.fragment),n=v(),J(t.$$.fragment)},m(i,f){z(e,i,f),g(i,n,f),z(t,i,f),o=!0},p(i,[f]){const m={};f&2&&(m.data=i[1]),f&33&&(m.$$scope={dirty:f,ctx:i}),e.$set(m);const O={};f&2&&(O.gj=i[1]),!l&&f&1&&(l=!0,O.show=i[0],Ge(()=>l=!1)),t.$set(O)},i(i){o||(w(e.$$.fragment,i),w(t.$$.fragment,i),o=!0)},o(i){L(e.$$.fragment,i),L(t.$$.fragment,i),o=!1},d(i){i&&h(n),P(e,i),P(t,i)}}}function zn(s,e,n){let t,l,o;U(s,$t,i=>n(2,l=i)),U(s,ae,i=>n(3,o=i));let r=!0;function u(i){r=i,n(0,r)}return s.$$.update=()=>{s.$$.dirty&12&&n(1,t=o&&l?JSON.parse(o.debugMovementsFromLaneGeojson(l.properties.road,l.properties.index)):Ne())},[r,t,l,o,u]}class Pn extends se{constructor(e){super(),re(this,e,zn,Jn,x,{})}}function Rn(s){let e,n,t,l,o,r;return{c(){e=c("div"),n=c("label"),t=c("input"),l=R(` + Clockwise ordering of roads`),q(t,"type","checkbox")},m(u,i){g(u,e,i),a(e,n),a(n,t),t.checked=s[0],a(n,l),o||(r=oe(t,"change",s[5]),o=!0)},p(u,[i]){i&1&&(t.checked=u[0])},i:V,o:V,d(u){u&&h(e),o=!1,r()}}}function En(s,e,n){let t,l,o;U(s,Wt,f=>n(2,t=f)),U(s,Jt,f=>n(3,l=f)),U(s,ae,f=>n(4,o=f));let r=[],u=!1;function i(){u=this.checked,n(0,u)}return s.$$.update=()=>{if(s.$$.dirty&31){for(let f of r)f.remove();if(n(1,r=[]),u&&l){let f=JSON.parse(o.debugClockwiseOrderingForIntersectionGeojson(l.properties.id));for(let m of f.features)r.push(new Ut.Popup({closeButton:!1,closeOnClick:!1,focusAfterOpen:!1}).setLngLat(m.geometry.coordinates).setHTML(m.properties.label).addTo(t))}}},[u,r,t,l,o,i]}class An extends se{constructor(e){super(),re(this,e,En,Rn,x,{})}}function Dn(s){let e,n;const t=[Re("debug-ids"),{layout:{"text-field":["get","id"],visibility:s[0]?"visible":"none"}},{paint:{"text-halo-color":["case",["==",["get","type"],"intersection"],"red","cyan"],"text-halo-width":3}}];let l={};for(let o=0;oFe(t,"show",r)),{c(){J(e.$$.fragment),n=v(),J(t.$$.fragment)},m(i,f){z(e,i,f),g(i,n,f),z(t,i,f),o=!0},p(i,[f]){const m={};f&2&&(m.data=i[1]),f&17&&(m.$$scope={dirty:f,ctx:i}),e.$set(m);const O={};f&2&&(O.gj=i[1]),!l&&f&1&&(l=!0,O.show=i[0],Ge(()=>l=!1)),t.$set(O)},i(i){o||(w(e.$$.fragment,i),w(t.$$.fragment,i),o=!0)},o(i){L(e.$$.fragment,i),L(t.$$.fragment,i),o=!1},d(i){i&&h(n),P(e,i),P(t,i)}}}function Fn(s,e,n){let t,l;U(s,ae,u=>n(2,l=u));let o=!1;function r(u){o=u,n(0,o)}return s.$$.update=()=>{s.$$.dirty&4&&n(1,t=l?JSON.parse(l.toGeojsonPlain()):Ne())},[o,t,l,r]}class Gn extends se{constructor(e){super(),re(this,e,Fn,Hn,x,{})}}function dt(s,e,n){const t=s.slice();return t[5]=e[n],t}function _t(s){const e=s.slice(),n=JSON.parse(e[0].crossing);return e[8]=n,e}function $n(s){let e,n,t,l=s[8].kind+"",o,r,u=s[8].has_island&&Wn();return{c(){e=c("p"),n=c("u"),n.textContent="Crossing",t=R(": "),o=R(l),r=v(),u&&u.c()},m(i,f){g(i,e,f),a(e,n),a(e,t),a(e,o),a(e,r),u&&u.m(e,null)},p:V,d(i){i&&h(e),u&&u.d()}}}function Wn(s){let e;return{c(){e=R("(with an island)")},m(n,t){g(n,e,t)},d(n){n&&h(e)}}}function gt(s){let e,n=s[5]+"",t,l;return{c(){e=c("a"),t=R(n),l=R(","),q(e,"href","https://www.openstreetmap.org/node/"+s[5]),q(e,"target","_blank")},m(o,r){g(o,e,r),a(e,t),g(o,l,r)},p:V,d(o){o&&(h(e),h(l))}}}function Un(s){let e,n,t,l,o,r=s[0].intersection_kind+"",u,i,f,m,O,S=s[0].control+"",C,M,y,j,I,k=s[0].movements+"",N,A,Q,D,G,W,H,X,K,_,ee,$=s[0].crossing&&$n(_t(s)),te=ge(JSON.parse(s[0].osm_node_ids)),F=[];for(let d=0;dn(4,t=i));let{data:l}=e,{close:o}=e,r=l.properties;function u(){t.collapseIntersection(r.id),ae.set(t),o()}return s.$$set=i=>{"data"in i&&n(2,l=i.data),"close"in i&&n(3,o=i.close)},[r,u,l,o]}class Vn extends se{constructor(e){super(),re(this,e,qn,Un,x,{data:2,close:3})}}function ht(s,e,n){const t=s.slice();return t[12]=e[n],t}function bt(s,e,n){const t=s.slice();return t[15]=e[n][0],t[16]=e[n][1],t}function Kn(s){let e,n,t,l;return{c(){e=c("details"),n=c("summary"),n.textContent="Full Muv JSON",t=v(),l=c("pre"),l.textContent=`${JSON.stringify(JSON.parse(s[0].muv),null," ")}`},m(o,r){g(o,e,r),a(e,n),a(e,t),a(e,l)},p:V,d(o){o&&h(e)}}}function kt(s){let e,n,t;return{c(){e=c("tr"),n=c("td"),n.textContent=`${s[15]}`,t=c("td"),t.textContent=`${s[16]}`,q(n,"class","svelte-860yh4"),q(t,"class","svelte-860yh4")},m(l,o){g(l,e,o),a(e,n),a(e,t)},p:V,d(l){l&&h(e)}}}function yt(s){let e,n,t=s[12]+"",l,o,r,u,i,f,m,O=ge(Object.entries(JSON.parse(s[1].getOsmTagsForWay(BigInt(s[12]))))),S=[];for(let C=0;COSM ways:",Ce=v();for(let T=0;Tn(11,t=y));let{data:l}=e,{close:o}=e,r=l.properties,u=t;function i(){t.collapseShortRoad(r.road),ae.set(t),o()}function f(){t.zipSidepath(r.road),ae.set(t),o()}function m(y,j){try{Pe.set(JSON.parse(t.findBlock(r.road,y,j))),Ze.set(j),o()}catch(I){window.alert(I)}}const O=()=>m(!0,!1),S=()=>m(!1,!1),C=()=>m(!0,!0),M=()=>m(!1,!0);return s.$$set=y=>{"data"in y&&n(5,l=y.data),"close"in y&&n(6,o=y.close)},[r,u,i,f,m,l,o,O,S,C,M]}class Xn extends se{constructor(e){super(),re(this,e,Qn,Zn,x,{data:5,close:6})}}function vt(s){let e,n;return e=new Qt({}),{c(){J(e.$$.fragment)},m(t,l){z(e,t,l),n=!0},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){L(e.$$.fragment,t),n=!1},d(t){P(e,t)}}}function Yn(s){let e,n,t,l,o,r,u,i,f,m,O,S,C,M,y,j,I;l=new Vt({});let k=s[2]&&vt();return{c(){e=c("div"),n=c("h1"),n.textContent="osm2streets Street Explorer",t=v(),J(l.$$.fragment),o=v(),r=c("p"),r.innerHTML=`Understanding OSM streets & intersections with osm2streets - and Muv.`,u=v(),i=c("hr"),f=v(),k&&k.c(),m=v(),O=c("br"),S=v(),C=c("details"),M=c("summary"),M.textContent="Layers",y=v(),j=c("div"),C.open=!0,q(C,"class","svelte-1n0zlav"),q(e,"slot","left")},m(N,A){g(N,e,A),a(e,n),a(e,t),z(l,e,null),a(e,o),a(e,r),a(e,u),a(e,i),a(e,f),k&&k.m(e,null),a(e,m),a(e,O),a(e,S),a(e,C),a(C,M),a(C,y),a(C,j),s[4](j),I=!0},p(N,A){N[2]?k?A&4&&w(k,1):(k=vt(),k.c(),w(k,1),k.m(e,m)):k&&(Ie(),L(k,1,1,()=>{k=null}),je())},i(N){I||(w(l.$$.fragment,N),w(k),I=!0)},o(N){L(l.$$.fragment,N),L(k),I=!1},d(N){N&&h(e),P(l),k&&k.d(),s[4](null)}}}function wt(s){let e,n;return e=new Vn({props:{data:s[5],close:s[6]}}),{c(){J(e.$$.fragment)},m(t,l){z(e,t,l),n=!0},p(t,l){const o={};l&32&&(o.data=t[5]),l&64&&(o.close=t[6]),e.$set(o)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){L(e.$$.fragment,t),n=!1},d(t){P(e,t)}}}function xn(s){let e=s[5],n,t,l=wt(s);return{c(){l.c(),n=Ee()},m(o,r){l.m(o,r),g(o,n,r),t=!0},p(o,r){r&32&&x(e,e=o[5])?(Ie(),L(l,1,1,V),je(),l=wt(o),l.c(),w(l,1),l.m(n.parentNode,n)):l.p(o,r)},i(o){t||(w(l),t=!0)},o(o){L(l),t=!1},d(o){o&&h(n),l.d(o)}}}function el(s){let e,n;return e=new qe({props:{openOn:"click",popupClass:"popup",$$slots:{default:[xn,({data:t,close:l})=>({5:t,6:l}),({data:t,close:l})=>(t?32:0)|(l?64:0)]},$$scope:{ctx:s}}}),{c(){J(e.$$.fragment)},m(t,l){z(e,t,l),n=!0},p(t,l){const o={};l&224&&(o.$$scope={dirty:l,ctx:t}),e.$set(o)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){L(e.$$.fragment,t),n=!1},d(t){P(e,t)}}}function Ct(s){let e,n;return e=new Xn({props:{data:s[5],close:s[6]}}),{c(){J(e.$$.fragment)},m(t,l){z(e,t,l),n=!0},p(t,l){const o={};l&32&&(o.data=t[5]),l&64&&(o.close=t[6]),e.$set(o)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){L(e.$$.fragment,t),n=!1},d(t){P(e,t)}}}function tl(s){let e=s[5],n,t,l=Ct(s);return{c(){l.c(),n=Ee()},m(o,r){l.m(o,r),g(o,n,r),t=!0},p(o,r){r&32&&x(e,e=o[5])?(Ie(),L(l,1,1,V),je(),l=Ct(o),l.c(),w(l,1),l.m(n.parentNode,n)):l.p(o,r)},i(o){t||(w(l),t=!0)},o(o){L(l),t=!1},d(o){o&&h(n),l.d(o)}}}function nl(s){let e,n;return e=new qe({props:{openOn:"click",popupClass:"popup",$$slots:{default:[tl,({data:t,close:l})=>({5:t,6:l}),({data:t,close:l})=>(t?32:0)|(l?64:0)]},$$scope:{ctx:s}}}),{c(){J(e.$$.fragment)},m(t,l){z(e,t,l),n=!0},p(t,l){const o={};l&224&&(o.$$scope={dirty:l,ctx:t}),e.$set(o)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){L(e.$$.fragment,t),n=!1},d(t){P(e,t)}}}function ll(s){let e,n,t,l,o,r,u,i,f,m,O,S,C,M,y,j,I,k,N,A,Q,D,G,W,E,X,K,_,ee,$,te,F,d;return n=new Xt({}),l=new Yt({props:{hoverCursor:"pointer",$$slots:{default:[el]},$$scope:{ctx:s}}}),r=new xt({}),i=new en({props:{hoverCursor:"pointer",$$slots:{default:[nl]},$$scope:{ctx:s}}}),m=new tn({}),M=new Sn({}),k=new Pn({}),A=new An({}),D=new Nn({}),W=new Gn({}),_=new gn({}),$=new kn({}),F=new nn({}),{c(){e=c("div"),J(n.$$.fragment),t=v(),J(l.$$.fragment),o=v(),J(r.$$.fragment),u=v(),J(i.$$.fragment),f=v(),J(m.$$.fragment),O=v(),S=c("hr"),C=v(),J(M.$$.fragment),y=v(),j=c("hr"),I=v(),J(k.$$.fragment),N=v(),J(A.$$.fragment),Q=v(),J(D.$$.fragment),G=v(),J(W.$$.fragment),E=v(),X=c("hr"),K=v(),J(_.$$.fragment),ee=v(),J($.$$.fragment),te=v(),J(F.$$.fragment)},m(b,B){g(b,e,B),z(n,e,null),a(e,t),z(l,e,null),a(e,o),z(r,e,null),a(e,u),z(i,e,null),a(e,f),z(m,e,null),a(e,O),a(e,S),a(e,C),z(M,e,null),a(e,y),a(e,j),a(e,I),z(k,e,null),a(e,N),z(A,e,null),a(e,Q),z(D,e,null),a(e,G),z(W,e,null),a(e,E),a(e,X),a(e,K),z(_,e,null),a(e,ee),z($,e,null),a(e,te),z(F,e,null),s[3](e),d=!0},p(b,B){const ce={};B&128&&(ce.$$scope={dirty:B,ctx:b}),l.$set(ce);const he={};B&128&&(he.$$scope={dirty:B,ctx:b}),i.$set(he)},i(b){d||(w(n.$$.fragment,b),w(l.$$.fragment,b),w(r.$$.fragment,b),w(i.$$.fragment,b),w(m.$$.fragment,b),w(M.$$.fragment,b),w(k.$$.fragment,b),w(A.$$.fragment,b),w(D.$$.fragment,b),w(W.$$.fragment,b),w(_.$$.fragment,b),w($.$$.fragment,b),w(F.$$.fragment,b),d=!0)},o(b){L(n.$$.fragment,b),L(l.$$.fragment,b),L(r.$$.fragment,b),L(i.$$.fragment,b),L(m.$$.fragment,b),L(M.$$.fragment,b),L(k.$$.fragment,b),L(A.$$.fragment,b),L(D.$$.fragment,b),L(W.$$.fragment,b),L(_.$$.fragment,b),L($.$$.fragment,b),L(F.$$.fragment,b),d=!1},d(b){b&&h(e),P(n),P(l),P(r),P(i),P(m),P(M),P(k),P(A),P(D),P(W),P(_),P($),P(F),s[3](null)}}}function ol(s){let e,n,t;return n=new Kt({props:{$$slots:{default:[ll]},$$scope:{ctx:s}}}),{c(){e=c("div"),J(n.$$.fragment),q(e,"slot","main")},m(l,o){g(l,e,o),z(n,e,null),t=!0},p(l,o){const r={};o&129&&(r.$$scope={dirty:o,ctx:l}),n.$set(r)},i(l){t||(w(n.$$.fragment,l),t=!0)},o(l){L(n.$$.fragment,l),t=!1},d(l){l&&h(e),P(n)}}}function sl(s){let e,n;return e=new qt({props:{$$slots:{main:[ol],left:[Yn]},$$scope:{ctx:s}}}),{c(){J(e.$$.fragment)},m(t,l){z(e,t,l),n=!0},p(t,[l]){const o={};l&135&&(o.$$scope={dirty:l,ctx:t}),e.$set(o)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){L(e.$$.fragment,t),n=!1},d(t){P(e,t)}}}function rl(s,e,n){let t=!1;Ot(async()=>{await Zt(),n(2,t=!0)});let l=null,o;function r(i){ve[i?"unshift":"push"](()=>{l=i,n(0,l)})}function u(i){ve[i?"unshift":"push"](()=>{o=i,n(1,o),n(0,l)})}return s.$$.update=()=>{s.$$.dirty&3&&l&&o&&(n(1,o.innerHTML="",o),o.appendChild(l))},[l,o,t,r,u]}class il extends se{constructor(e){super(),re(this,e,rl,sl,x,{})}}new il({target:document.getElementById("app")}); + and Muv.`,u=v(),i=c("hr"),f=v(),k&&k.c(),m=v(),O=c("br"),S=v(),C=c("details"),M=c("summary"),M.textContent="Layers",y=v(),j=c("div"),C.open=!0,q(C,"class","svelte-1n0zlav"),q(e,"slot","left")},m(N,A){g(N,e,A),a(e,n),a(e,t),z(l,e,null),a(e,o),a(e,r),a(e,u),a(e,i),a(e,f),k&&k.m(e,null),a(e,m),a(e,O),a(e,S),a(e,C),a(C,M),a(C,y),a(C,j),s[4](j),I=!0},p(N,A){N[2]?k?A&4&&w(k,1):(k=vt(),k.c(),w(k,1),k.m(e,m)):k&&(Ie(),L(k,1,1,()=>{k=null}),je())},i(N){I||(w(l.$$.fragment,N),w(k),I=!0)},o(N){L(l.$$.fragment,N),L(k),I=!1},d(N){N&&h(e),P(l),k&&k.d(),s[4](null)}}}function wt(s){let e,n;return e=new Vn({props:{data:s[5],close:s[6]}}),{c(){J(e.$$.fragment)},m(t,l){z(e,t,l),n=!0},p(t,l){const o={};l&32&&(o.data=t[5]),l&64&&(o.close=t[6]),e.$set(o)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){L(e.$$.fragment,t),n=!1},d(t){P(e,t)}}}function xn(s){let e=s[5],n,t,l=wt(s);return{c(){l.c(),n=He()},m(o,r){l.m(o,r),g(o,n,r),t=!0},p(o,r){r&32&&x(e,e=o[5])?(Ie(),L(l,1,1,V),je(),l=wt(o),l.c(),w(l,1),l.m(n.parentNode,n)):l.p(o,r)},i(o){t||(w(l),t=!0)},o(o){L(l),t=!1},d(o){o&&h(n),l.d(o)}}}function el(s){let e,n;return e=new qe({props:{openOn:"click",popupClass:"popup",$$slots:{default:[xn,({data:t,close:l})=>({5:t,6:l}),({data:t,close:l})=>(t?32:0)|(l?64:0)]},$$scope:{ctx:s}}}),{c(){J(e.$$.fragment)},m(t,l){z(e,t,l),n=!0},p(t,l){const o={};l&224&&(o.$$scope={dirty:l,ctx:t}),e.$set(o)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){L(e.$$.fragment,t),n=!1},d(t){P(e,t)}}}function Ct(s){let e,n;return e=new Xn({props:{data:s[5],close:s[6]}}),{c(){J(e.$$.fragment)},m(t,l){z(e,t,l),n=!0},p(t,l){const o={};l&32&&(o.data=t[5]),l&64&&(o.close=t[6]),e.$set(o)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){L(e.$$.fragment,t),n=!1},d(t){P(e,t)}}}function tl(s){let e=s[5],n,t,l=Ct(s);return{c(){l.c(),n=He()},m(o,r){l.m(o,r),g(o,n,r),t=!0},p(o,r){r&32&&x(e,e=o[5])?(Ie(),L(l,1,1,V),je(),l=Ct(o),l.c(),w(l,1),l.m(n.parentNode,n)):l.p(o,r)},i(o){t||(w(l),t=!0)},o(o){L(l),t=!1},d(o){o&&h(n),l.d(o)}}}function nl(s){let e,n;return e=new qe({props:{openOn:"click",popupClass:"popup",$$slots:{default:[tl,({data:t,close:l})=>({5:t,6:l}),({data:t,close:l})=>(t?32:0)|(l?64:0)]},$$scope:{ctx:s}}}),{c(){J(e.$$.fragment)},m(t,l){z(e,t,l),n=!0},p(t,l){const o={};l&224&&(o.$$scope={dirty:l,ctx:t}),e.$set(o)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){L(e.$$.fragment,t),n=!1},d(t){P(e,t)}}}function ll(s){let e,n,t,l,o,r,u,i,f,m,O,S,C,M,y,j,I,k,N,A,Q,D,G,W,H,X,K,_,ee,$,te,F,d;return n=new Xt({}),l=new Yt({props:{hoverCursor:"pointer",$$slots:{default:[el]},$$scope:{ctx:s}}}),r=new xt({}),i=new en({props:{hoverCursor:"pointer",$$slots:{default:[nl]},$$scope:{ctx:s}}}),m=new tn({}),M=new Sn({}),k=new Pn({}),A=new An({}),D=new Nn({}),W=new Gn({}),_=new gn({}),$=new kn({}),F=new nn({}),{c(){e=c("div"),J(n.$$.fragment),t=v(),J(l.$$.fragment),o=v(),J(r.$$.fragment),u=v(),J(i.$$.fragment),f=v(),J(m.$$.fragment),O=v(),S=c("hr"),C=v(),J(M.$$.fragment),y=v(),j=c("hr"),I=v(),J(k.$$.fragment),N=v(),J(A.$$.fragment),Q=v(),J(D.$$.fragment),G=v(),J(W.$$.fragment),H=v(),X=c("hr"),K=v(),J(_.$$.fragment),ee=v(),J($.$$.fragment),te=v(),J(F.$$.fragment)},m(b,B){g(b,e,B),z(n,e,null),a(e,t),z(l,e,null),a(e,o),z(r,e,null),a(e,u),z(i,e,null),a(e,f),z(m,e,null),a(e,O),a(e,S),a(e,C),z(M,e,null),a(e,y),a(e,j),a(e,I),z(k,e,null),a(e,N),z(A,e,null),a(e,Q),z(D,e,null),a(e,G),z(W,e,null),a(e,H),a(e,X),a(e,K),z(_,e,null),a(e,ee),z($,e,null),a(e,te),z(F,e,null),s[3](e),d=!0},p(b,B){const ce={};B&128&&(ce.$$scope={dirty:B,ctx:b}),l.$set(ce);const he={};B&128&&(he.$$scope={dirty:B,ctx:b}),i.$set(he)},i(b){d||(w(n.$$.fragment,b),w(l.$$.fragment,b),w(r.$$.fragment,b),w(i.$$.fragment,b),w(m.$$.fragment,b),w(M.$$.fragment,b),w(k.$$.fragment,b),w(A.$$.fragment,b),w(D.$$.fragment,b),w(W.$$.fragment,b),w(_.$$.fragment,b),w($.$$.fragment,b),w(F.$$.fragment,b),d=!0)},o(b){L(n.$$.fragment,b),L(l.$$.fragment,b),L(r.$$.fragment,b),L(i.$$.fragment,b),L(m.$$.fragment,b),L(M.$$.fragment,b),L(k.$$.fragment,b),L(A.$$.fragment,b),L(D.$$.fragment,b),L(W.$$.fragment,b),L(_.$$.fragment,b),L($.$$.fragment,b),L(F.$$.fragment,b),d=!1},d(b){b&&h(e),P(n),P(l),P(r),P(i),P(m),P(M),P(k),P(A),P(D),P(W),P(_),P($),P(F),s[3](null)}}}function ol(s){let e,n,t;return n=new Kt({props:{$$slots:{default:[ll]},$$scope:{ctx:s}}}),{c(){e=c("div"),J(n.$$.fragment),q(e,"slot","main")},m(l,o){g(l,e,o),z(n,e,null),t=!0},p(l,o){const r={};o&129&&(r.$$scope={dirty:o,ctx:l}),n.$set(r)},i(l){t||(w(n.$$.fragment,l),t=!0)},o(l){L(n.$$.fragment,l),t=!1},d(l){l&&h(e),P(n)}}}function sl(s){let e,n;return e=new qt({props:{$$slots:{main:[ol],left:[Yn]},$$scope:{ctx:s}}}),{c(){J(e.$$.fragment)},m(t,l){z(e,t,l),n=!0},p(t,[l]){const o={};l&135&&(o.$$scope={dirty:l,ctx:t}),e.$set(o)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){L(e.$$.fragment,t),n=!1},d(t){P(e,t)}}}function rl(s,e,n){let t=!1;Ot(async()=>{await Zt(),n(2,t=!0)});let l=null,o;function r(i){ve[i?"unshift":"push"](()=>{l=i,n(0,l)})}function u(i){ve[i?"unshift":"push"](()=>{o=i,n(1,o),n(0,l)})}return s.$$.update=()=>{s.$$.dirty&3&&l&&o&&(n(1,o.innerHTML="",o),o.appendChild(l))},[l,o,t,r,u]}class il extends se{constructor(e){super(),re(this,e,rl,sl,x,{})}}new il({target:document.getElementById("app")}); diff --git a/assets/nested-961ddcbc.js b/assets/nested-64b7e2e5.js similarity index 99% rename from assets/nested-961ddcbc.js rename to assets/nested-64b7e2e5.js index 93a56c90..3d26ed1e 100644 --- a/assets/nested-961ddcbc.js +++ b/assets/nested-64b7e2e5.js @@ -1,4 +1,4 @@ -import{S as P,i as H,s as J,p as y,J as j,I as h,K as E,a as k,N as m,T as R,O as x,G as L,d as b,j as F,X as G,an as ne,ao as le,F as K,ap as re,$ as ee,h as ae,P as A,aq as se,z as S,e as te,A as W,g as B,b as w,c as q,t as $,C as M,x as oe,ac as ie,o as ue,Y as fe,ad as ce,ae as de,af as pe,ag as me,am as _e,ah as ge,ai as $e,aj as ye,ak as he,al as we,_ as ke,M as be,aa as ve,a0 as Ce,a3 as Se,a4 as We}from"./RenderLanePolygons-cf74ae20.js";function Me(i){let e,t=i[0].size+"",n,l,r,s,f,u,p,c;return{c(){e=y("div"),n=j(t),l=j(" ways edited"),r=h(),s=y("button"),f=j("Download .osc"),E(s,"type","button"),s.disabled=u=i[0].size==0},m(d,g){k(d,e,g),m(e,n),m(e,l),k(d,r,g),k(d,s,g),m(s,f),p||(c=R(s,"click",i[1]),p=!0)},p(d,[g]){g&1&&t!==(t=d[0].size+"")&&x(n,t),g&1&&u!==(u=d[0].size==0)&&(s.disabled=u)},i:L,o:L,d(d){d&&(b(e),b(r),b(s)),p=!1,c()}}}function Oe(i,e,t){let n,l;F(i,G,u=>t(4,n=u)),F(i,ne,u=>t(3,l=u));let r=new Set;function s(u){r.add(u.detail),t(0,r),t(3,l)}function f(){let u=` +import{S as P,i as H,s as J,p as y,J as j,I as h,K as E,a as k,N as m,T as R,O as x,G as L,d as b,j as F,X as G,an as ne,ao as le,F as K,ap as re,$ as ee,h as ae,P as A,aq as se,z as S,e as te,A as W,g as B,b as w,c as q,t as $,C as M,x as oe,ac as ie,o as ue,Y as fe,ad as ce,ae as de,af as pe,ag as me,am as _e,ah as ge,ai as $e,aj as ye,ak as he,al as we,_ as ke,M as be,aa as ve,a0 as Ce,a3 as Se,a4 as We}from"./RenderLanePolygons-fdad512c.js";function Me(i){let e,t=i[0].size+"",n,l,r,s,f,u,p,c;return{c(){e=y("div"),n=j(t),l=j(" ways edited"),r=h(),s=y("button"),f=j("Download .osc"),E(s,"type","button"),s.disabled=u=i[0].size==0},m(d,g){k(d,e,g),m(e,n),m(e,l),k(d,r,g),k(d,s,g),m(s,f),p||(c=R(s,"click",i[1]),p=!0)},p(d,[g]){g&1&&t!==(t=d[0].size+"")&&x(n,t),g&1&&u!==(u=d[0].size==0)&&(s.disabled=u)},i:L,o:L,d(d){d&&(b(e),b(r),b(s)),p=!1,c()}}}function Oe(i,e,t){let n,l;F(i,G,u=>t(4,n=u)),F(i,ne,u=>t(3,l=u));let r=new Set;function s(u){r.add(u.detail),t(0,r),t(3,l)}function f(){let u=` `;u+=` `,u+=` `;for(let p of r)u+=n.wayToXml(p),u+=` diff --git a/index.html b/index.html index fd59e854..f6710b76 100644 --- a/index.html +++ b/index.html @@ -4,8 +4,8 @@ StreetExplorer - - + + diff --git a/lane_editor.html b/lane_editor.html index e9e72131..f94ea32c 100644 --- a/lane_editor.html +++ b/lane_editor.html @@ -4,8 +4,8 @@ osm2streets lane editor - - + +