| 3200 | `),Ht=$e.createShader($e.FRAGMENT_SHADER);if($e.isContextLost()){this.failedToCreate=!0;return}$e.shaderSource(Ht,dr),$e.compileShader(Ht),$e.attachShader(this.program,Ht);var sr=$e.createShader($e.VERTEX_SHADER);if($e.isContextLost()){this.failedToCreate=!0;return}$e.shaderSource(sr,ur),$e.compileShader(sr),$e.attachShader(this.program,sr),this.attributes={};var Vt={};this.numAttributes=wr.length;for(var Dr=0;Dr<this.numAttributes;Dr++)wr[Dr]&&($e.bindAttribLocation(this.program,Dr,wr[Dr]),this.attributes[wr[Dr]]=Dr);$e.linkProgram(this.program),$e.deleteShader(sr),$e.deleteShader(Ht);for(var Jr=0;Jr<kt.length;Jr++){var ga=kt[Jr];if(ga&&!Vt[ga]){var vi=$e.getUniformLocation(this.program,ga);vi&&(Vt[ga]=vi)}}this.fixedUniforms=Ge(K,Vt),this.binderUniforms=me?me.getUniforms(K,Vt):[]};gf.prototype.draw=function(K,_e,te,me,Ge,Le,$e,gt,jt,wr,Nr,pr,yt,kt,Bt,nr){var hr,lr=K.gl;if(!this.failedToCreate){K.program.set(this.program),K.setDepthMode(te),K.setStencilMode(me),K.setColorMode(Ge),K.setCullFace(Le);for(var dr in this.fixedUniforms)this.fixedUniforms[dr].set($e[dr]);kt&&kt.setUniforms(K,this.binderUniforms,pr,{zoom:yt});for(var ur=(hr={},hr[lr.LINES]=2,hr[lr.TRIANGLES]=3,hr[lr.LINE_STRIP]=1,hr)[_e],Ht=0,sr=Nr.get();Ht<sr.length;Ht+=1){var Vt=sr[Ht],Dr=Vt.vaos||(Vt.vaos={}),Jr=Dr[gt]||(Dr[gt]=new kc);Jr.bind(K,this,jt,kt?kt.getPaintVertexBuffers():[],wr,Vt.vertexOffset,Bt,nr),lr.drawElements(_e,Vt.primitiveLength*ur,lr.UNSIGNED_SHORT,Vt.primitiveOffset*ur*2)}}};function Wu(ve,K,_e){var te=1/as(_e,1,K.transform.tileZoom),me=Math.pow(2,_e.tileID.overscaledZ),Ge=_e.tileSize*Math.pow(2,K.transform.tileZoom)/me,Le=Ge*(_e.tileID.canonical.x+_e.tileID.wrap*me),$e=Ge*_e.tileID.canonical.y;return{u_image:0,u_texsize:_e.imageAtlasTexture.size,u_scale:[te,ve.fromScale,ve.toScale],u_fade:ve.t,u_pixel_coord_upper:[Le>>16,$e>>16],u_pixel_coord_lower:[Le&65535,$e&65535]}}function Kc(ve,K,_e,te){var me=_e.imageManager.getPattern(ve.from.toString()),Ge=_e.imageManager.getPattern(ve.to.toString()),Le=_e.imageManager.getPixelSize(),$e=Le.width,gt=Le.height,jt=Math.pow(2,te.tileID.overscaledZ),wr=te.tileSize*Math.pow(2,_e.transform.tileZoom)/jt,Nr=wr*(te.tileID.canonical.x+te.tileID.wrap*jt),pr=wr*te.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:me.tl,u_pattern_br_a:me.br,u_pattern_tl_b:Ge.tl,u_pattern_br_b:Ge.br,u_texsize:[$e,gt],u_mix:K.t,u_pattern_size_a:me.displaySize,u_pattern_size_b:Ge.displaySize,u_scale_a:K.fromScale,u_scale_b:K.toScale,u_tile_units_to_pixels:1/as(te,1,_e.transform.tileZoom),u_pixel_coord_upper:[Nr>>16,pr>>16],u_pixel_coord_lower:[Nr&65535,pr&65535]}}var Lf=function(ve,K){return{u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_lightpos:new e.Uniform3f(ve,K.u_lightpos),u_lightintensity:new e.Uniform1f(ve,K.u_lightintensity),u_lightcolor:new e.Uniform3f(ve,K.u_lightcolor),u_vertical_gradient:new e.Uniform1f(ve,K.u_vertical_gradient),u_opacity:new e.Uniform1f(ve,K.u_opacity)}},iu=function(ve,K){return{u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_lightpos:new e.Uniform3f(ve,K.u_lightpos),u_lightintensity:new e.Uniform1f(ve,K.u_lightintensity),u_lightcolor:new e.Uniform3f(ve,K.u_lightcolor),u_vertical_gradient:new e.Uniform1f(ve,K.u_vertical_gradient),u_height_factor:new e.Uniform1f(ve,K.u_height_factor),u_image:new e.Uniform1i(ve,K.u_image),u_texsize:new e.Uniform2f(ve,K.u_texsize),u_pixel_coord_upper:new e.Uniform2f(ve,K.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ve,K.u_pixel_coord_lower),u_scale:new e.Uniform3f(ve,K.u_scale),u_fade:new e.Uniform1f(ve,K.u_fade),u_opacity:new e.Uniform1f(ve,K.u_opacity)}},Vf=function(ve,K,_e,te){var me=K.style.light,Ge=me.properties.get("position"),Le=[Ge.x,Ge.y,Ge.z],$e=e.create$1();me.properties.get("anchor")==="viewport"&&e.fromRotation($e,-K.transform.angle),e.transformMat3(Le,Le,$e);var gt=me.properties.get("color");return{u_matrix:ve,u_lightpos:Le,u_lightintensity:me.properties.get("intensity"),u_lightcolor:[gt.r,gt.g,gt.b],u_vertical_gradient:+_e,u_opacity:te}},Xu=function(ve,K,_e,te,me,Ge,Le){return e.extend(Vf(ve,K,_e,te),Wu(Ge,K,Le),{u_height_factor:-Math.pow(2,me.overscaledZ)/Le.tileSize/8})},Cc=function(ve,K){return{u_matrix:new e.UniformMatrix4f(ve,K.u_matrix)}},gc=function(ve,K){return{u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_image:new e.Uniform1i(ve,K.u_image),u_texsize:new e.Uniform2f(ve,K.u_texsize),u_pixel_coord_upper:new e.Uniform2f(ve,K.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ve,K.u_pixel_coord_lower),u_scale:new e.Uniform3f(ve,K.u_scale),u_fade:new e.Uniform1f(ve,K.u_fade)}},ql=function(ve,K){return{u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_world:new e.Uniform2f(ve,K.u_world)}},xu=function(ve,K){return{u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_world:new e.Uniform2f(ve,K.u_world),u_image:new e.Uniform1i(ve,K.u_image),u_texsize:new e.Uniform2f(ve,K.u_texsize),u_pixel_coord_upper:new e.Uniform2f(ve,K.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ve,K.u_pixel_coord_lower),u_scale:new e.Uniform3f(ve,K.u_scale),u_fade:new e.Uniform1f(ve,K.u_fade)}},Lc=function(ve){return{u_matrix:ve}},Jc=function(ve,K,_e,te){return e.extend(Lc(ve),Wu(_e,K,te))},sc=function(ve,K){return{u_matrix:ve,u_world:K}},Pc=function(ve,K,_e,te,me){return e.extend(Jc(ve,K,_e,te),{u_world:me})},Qt=function(ve,K){return{u_camera_to_center_distance:new e.Uniform1f(ve,K.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(ve,K.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(ve,K.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(ve,K.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(ve,K.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(ve,K.u_matrix)}},br=function(ve,K,_e,te){var me=ve.transform,Ge,Le;if(te.paint.get("circle-pitch-alignment")==="map"){var $e=as(_e,1,me.zoom);Ge=!0,Le=[$e,$e]}else Ge=!1,Le=me.pixelsToGLUnits;return{u_camera_to_center_distance:me.cameraToCenterDistance,u_scale_with_map:+(te.paint.get("circle-pitch-scale")==="map"),u_matrix:ve.translatePosMatrix(K.posMatrix,_e,te.paint.get("circle-translate"),te.paint.get("circle-translate-anchor")),u_pitch_with_map:+Ge,u_device_pixel_ratio:e.browser.devicePixelRatio,u_extrude_scale:Le}},aa=function(ve,K){return{u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_camera_to_center_distance:new e.Uniform1f(ve,K.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(ve,K.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(ve,K.u_extrude_scale),u_overscale_factor:new e.Uniform1f(ve,K.u_overscale_factor)}},$r=function(ve,K){return{u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_inv_matrix:new e.UniformMatrix4f(ve,K.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(ve,K.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(ve,K.u_viewport_size)}},ka=function(ve,K,_e){var te=as(_e,1,K.zoom),me=Math.pow(2,K.zoom-_e.tileID.overscaledZ),Ge=_e.tileID.overscaleFactor();return{u_matrix:ve,u_camera_to_center_distance:K.cameraToCenterDistance,u_pixels_to_tile_units:te,u_extrude_scale:[K.pixelsToGLUnits[0]/(te*me),K.pixelsToGLUnits[1]/(te*me)],u_overscale_factor:Ge}},li=function(ve,K,_e){return{u_matrix:ve,u_inv_matrix:K,u_camera_to_center_distance:_e.cameraToCenterDistance,u_viewport_size:[_e.width,_e.height]}},Ci=function(ve,K){return{u_color:new e.UniformColor(ve,K.u_color),u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_overlay:new e.Uniform1i(ve,K.u_overlay),u_overlay_scale:new e.Uniform1f(ve,K.u_overlay_scale)}},Hi=function(ve,K,_e){return _e===void 0&&(_e=1),{u_matrix:ve,u_color:K,u_overlay:0,u_overlay_scale:_e}},Qi=function(ve,K){return{u_matrix:new e.UniformMatrix4f(ve,K.u_matrix)}},dn=function(ve){return{u_matrix:ve}},Pi=function(ve,K){return{u_extrude_scale:new e.Uniform1f(ve,K.u_extrude_scale),u_intensity:new e.Uniform1f(ve,K.u_intensity),u_matrix:new e.UniformMatrix4f(ve,K.u_matrix)}},Di=function(ve,K){return{u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_world:new e.Uniform2f(ve,K.u_world),u_image:new e.Uniform1i(ve,K.u_image),u_color_ramp:new e.Uniform1i(ve,K.u_color_ramp),u_opacity:new e.Uniform1f(ve,K.u_opacity)}},Ni=function(ve,K,_e,te){return{u_matrix:ve,u_extrude_scale:as(K,1,_e),u_intensity:te}},mi=function(ve,K,_e,te){var me=e.create();e.ortho(me,0,ve.width,ve.height,0,0,1);var Ge=ve.context.gl;return{u_matrix:me,u_world:[Ge.drawingBufferWidth,Ge.drawingBufferHeight],u_image:_e,u_color_ramp:te,u_opacity:K.paint.get("heatmap-opacity")}},Mn=function(ve,K){return{u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_image:new e.Uniform1i(ve,K.u_image),u_latrange:new e.Uniform2f(ve,K.u_latrange),u_light:new e.Uniform2f(ve,K.u_light),u_shadow:new e.UniformColor(ve,K.u_shadow),u_highlight:new e.UniformColor(ve,K.u_highlight),u_accent:new e.UniformColor(ve,K.u_accent)}},Qn=function(ve,K){return{u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_image:new e.Uniform1i(ve,K.u_image),u_dimension:new e.Uniform2f(ve,K.u_dimension),u_zoom:new e.Uniform1f(ve,K.u_zoom),u_unpack:new e.Uniform4f(ve,K.u_unpack)}},ao=function(ve,K,_e){var te=_e.paint.get("hillshade-shadow-color"),me=_e.paint.get("hillshade-highlight-color"),Ge=_e.paint.get("hillshade-accent-color"),Le=_e.paint.get("hillshade-illumination-direction")*(Math.PI/180);_e.paint.get("hillshade-illumination-anchor")==="viewport"&&(Le-=ve.transform.angle);var $e=!ve.options.moving;return{u_matrix:ve.transform.calculatePosMatrix(K.tileID.toUnwrapped(),$e),u_image:0,u_latrange:fo(ve,K.tileID),u_light:[_e.paint.get("hillshade-exaggeration"),Le],u_shadow:te,u_highlight:me,u_accent:Ge}},eo=function(ve,K){var _e=K.stride,te=e.create();return e.ortho(te,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(te,te,[0,-e.EXTENT,0]),{u_matrix:te,u_image:1,u_dimension:[_e,_e],u_zoom:ve.overscaledZ,u_unpack:K.getUnpackVector()}};function fo(ve,K){var _e=Math.pow(2,K.canonical.z),te=K.canonical.y;return[new e.MercatorCoordinate(0,te/_e).toLngLat().lat,new e.MercatorCoordinate(0,(te+1)/_e).toLngLat().lat]}var An=function(ve,K){return{u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_ratio:new e.Uniform1f(ve,K.u_ratio),u_device_pixel_ratio:new e.Uniform1f(ve,K.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(ve,K.u_units_to_pixels)}},un=function(ve,K){return{u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_ratio:new e.Uniform1f(ve,K.u_ratio),u_device_pixel_ratio:new e.Uniform1f(ve,K.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(ve,K.u_units_to_pixels),u_image:new e.Uniform1i(ve,K.u_image),u_image_height:new e.Uniform1f(ve,K.u_image_height)}},yo=function(ve,K){return{u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_texsize:new e.Uniform2f(ve,K.u_texsize),u_ratio:new e.Uniform1f(ve,K.u_ratio),u_device_pixel_ratio:new e.Uniform1f(ve,K.u_device_pixel_ratio),u_image:new e.Uniform1i(ve,K.u_image),u_units_to_pixels:new e.Uniform2f(ve,K.u_units_to_pixels),u_scale:new e.Uniform3f(ve,K.u_scale),u_fade:new e.Uniform1f(ve,K.u_fade)}},Ko=function(ve,K){return{u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_ratio:new e.Uniform1f(ve,K.u_ratio),u_device_pixel_ratio:new e.Uniform1f(ve,K.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(ve,K.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(ve,K.u_patternscale_a),u_patternscale_b:new e.Uniform2f(ve,K.u_patternscale_b),u_sdfgamma:new e.Uniform1f(ve,K.u_sdfgamma),u_image:new e.Uniform1i(ve,K.u_image),u_tex_y_a:new e.Uniform1f(ve,K.u_tex_y_a),u_tex_y_b:new e.Uniform1f(ve,K.u_tex_y_b),u_mix:new e.Uniform1f(ve,K.u_mix)}},Ss=function(ve,K,_e){var te=ve.transform;return{u_matrix:Fl(ve,K,_e),u_ratio:1/as(K,1,te.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_units_to_pixels:[1/te.pixelsToGLUnits[0],1/te.pixelsToGLUnits[1]]}},rl=function(ve,K,_e,te){return e.extend(Ss(ve,K,_e),{u_image:0,u_image_height:te})},Os=function(ve,K,_e,te){var me=ve.transform,Ge=bs(K,me);return{u_matrix:Fl(ve,K,_e),u_texsize:K.imageAtlasTexture.size,u_ratio:1/as(K,1,me.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_image:0,u_scale:[Ge,te.fromScale,te.toScale],u_fade:te.t,u_units_to_pixels:[1/me.pixelsToGLUnits[0],1/me.pixelsToGLUnits[1]]}},el=function(ve,K,_e,te,me){var Ge=ve.transform,Le=ve.lineAtlas,$e=bs(K,Ge),gt=_e.layout.get("line-cap")==="round",jt=Le.getDash(te.from,gt),wr=Le.getDash(te.to,gt),Nr=jt.width*me.fromScale,pr=wr.width*me.toScale;return e.extend(Ss(ve,K,_e),{u_patternscale_a:[$e/Nr,-jt.height/2],u_patternscale_b:[$e/pr,-wr.height/2],u_sdfgamma:Le.width/(Math.min(Nr,pr)*256*e.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:jt.y,u_tex_y_b:wr.y,u_mix:me.t})};function bs(ve,K){return 1/as(ve,1,K.tileZoom)}function Fl(ve,K,_e){return ve.translatePosMatrix(K.tileID.posMatrix,K,_e.paint.get("line-translate"),_e.paint.get("line-translate-anchor"))}var _l=function(ve,K){return{u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_tl_parent:new e.Uniform2f(ve,K.u_tl_parent),u_scale_parent:new e.Uniform1f(ve,K.u_scale_parent),u_buffer_scale:new e.Uniform1f(ve,K.u_buffer_scale),u_fade_t:new e.Uniform1f(ve,K.u_fade_t),u_opacity:new e.Uniform1f(ve,K.u_opacity),u_image0:new e.Uniform1i(ve,K.u_image0),u_image1:new e.Uniform1i(ve,K.u_image1),u_brightness_low:new e.Uniform1f(ve,K.u_brightness_low),u_brightness_high:new e.Uniform1f(ve,K.u_brightness_high),u_saturation_factor:new e.Uniform1f(ve,K.u_saturation_factor),u_contrast_factor:new e.Uniform1f(ve,K.u_contrast_factor),u_spin_weights:new e.Uniform3f(ve,K.u_spin_weights)}},ll=function(ve,K,_e,te,me){return{u_matrix:ve,u_tl_parent:K,u_scale_parent:_e,u_buffer_scale:1,u_fade_t:te.mix,u_opacity:te.opacity*me.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:me.paint.get("raster-brightness-min"),u_brightness_high:me.paint.get("raster-brightness-max"),u_saturation_factor:Js(me.paint.get("raster-saturation")),u_contrast_factor:Lo(me.paint.get("raster-contrast")),u_spin_weights:Un(me.paint.get("raster-hue-rotate"))}};function Un(ve){ve*=Math.PI/180;var K=Math.sin(ve),_e=Math.cos(ve);return[(2*_e+1)/3,(-Math.sqrt(3)*K-_e+1)/3,(Math.sqrt(3)*K-_e+1)/3]}function Lo(ve){return ve>0?1/(1-ve):1+ve}function Js(ve){return ve>0?1-1/(1.001-ve):-ve}var Rs=function(ve,K){return{u_is_size_zoom_constant:new e.Uniform1i(ve,K.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(ve,K.u_is_size_feature_constant),u_size_t:new e.Uniform1f(ve,K.u_size_t),u_size:new e.Uniform1f(ve,K.u_size),u_camera_to_center_distance:new e.Uniform1f(ve,K.u_camera_to_center_distance),u_pitch:new e.Uniform1f(ve,K.u_pitch),u_rotate_symbol:new e.Uniform1i(ve,K.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(ve,K.u_aspect_ratio),u_fade_change:new e.Uniform1f(ve,K.u_fade_change),u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(ve,K.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(ve,K.u_coord_matrix),u_is_text:new e.Uniform1i(ve,K.u_is_text),u_pitch_with_map:new e.Uniform1i(ve,K.u_pitch_with_map),u_texsize:new e.Uniform2f(ve,K.u_texsize),u_texture:new e.Uniform1i(ve,K.u_texture)}},uu=function(ve,K){return{u_is_size_zoom_constant:new e.Uniform1i(ve,K.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(ve,K.u_is_size_feature_constant),u_size_t:new e.Uniform1f(ve,K.u_size_t),u_size:new e.Uniform1f(ve,K.u_size),u_camera_to_center_distance:new e.Uniform1f(ve,K.u_camera_to_center_distance),u_pitch:new e.Uniform1f(ve,K.u_pitch),u_rotate_symbol:new e.Uniform1i(ve,K.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(ve,K.u_aspect_ratio),u_fade_change:new e.Uniform1f(ve,K.u_fade_change),u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(ve,K.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(ve,K.u_coord_matrix),u_is_text:new e.Uniform1i(ve,K.u_is_text),u_pitch_with_map:new e.Uniform1i(ve,K.u_pitch_with_map),u_texsize:new e.Uniform2f(ve,K.u_texsize),u_texture:new e.Uniform1i(ve,K.u_texture),u_gamma_scale:new e.Uniform1f(ve,K.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(ve,K.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(ve,K.u_is_halo)}},Iu=function(ve,K){return{u_is_size_zoom_constant:new e.Uniform1i(ve,K.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(ve,K.u_is_size_feature_constant),u_size_t:new e.Uniform1f(ve,K.u_size_t),u_size:new e.Uniform1f(ve,K.u_size),u_camera_to_center_distance:new e.Uniform1f(ve,K.u_camera_to_center_distance),u_pitch:new e.Uniform1f(ve,K.u_pitch),u_rotate_symbol:new e.Uniform1i(ve,K.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(ve,K.u_aspect_ratio),u_fade_change:new e.Uniform1f(ve,K.u_fade_change),u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(ve,K.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(ve,K.u_coord_matrix),u_is_text:new e.Uniform1i(ve,K.u_is_text),u_pitch_with_map:new e.Uniform1i(ve,K.u_pitch_with_map),u_texsize:new e.Uniform2f(ve,K.u_texsize),u_texsize_icon:new e.Uniform2f(ve,K.u_texsize_icon),u_texture:new e.Uniform1i(ve,K.u_texture),u_texture_icon:new e.Uniform1i(ve,K.u_texture_icon),u_gamma_scale:new e.Uniform1f(ve,K.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(ve,K.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(ve,K.u_is_halo)}},Zu=function(ve,K,_e,te,me,Ge,Le,$e,gt,jt){var wr=me.transform;return{u_is_size_zoom_constant:+(ve==="constant"||ve==="source"),u_is_size_feature_constant:+(ve==="constant"||ve==="camera"),u_size_t:K?K.uSizeT:0,u_size:K?K.uSize:0,u_camera_to_center_distance:wr.cameraToCenterDistance,u_pitch:wr.pitch/360*2*Math.PI,u_rotate_symbol:+_e,u_aspect_ratio:wr.width/wr.height,u_fade_change:me.options.fadeDuration?me.symbolFadeChange:1,u_matrix:Ge,u_label_plane_matrix:Le,u_coord_matrix:$e,u_is_text:+gt,u_pitch_with_map:+te,u_texsize:jt,u_texture:0}},Ic=function(ve,K,_e,te,me,Ge,Le,$e,gt,jt,wr){var Nr=me.transform;return e.extend(Zu(ve,K,_e,te,me,Ge,Le,$e,gt,jt),{u_gamma_scale:te?Math.cos(Nr._pitch)*Nr.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:+wr})},bu=function(ve,K,_e,te,me,Ge,Le,$e,gt,jt){return e.extend(Ic(ve,K,_e,te,me,Ge,Le,$e,!0,gt,!0),{u_texsize_icon:jt,u_texture_icon:1})},Rc=function(ve,K){return{u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_opacity:new e.Uniform1f(ve,K.u_opacity),u_color:new e.UniformColor(ve,K.u_color)}},Au=function(ve,K){return{u_matrix:new e.UniformMatrix4f(ve,K.u_matrix),u_opacity:new e.Uniform1f(ve,K.u_opacity),u_image:new e.Uniform1i(ve,K.u_image),u_pattern_tl_a:new e.Uniform2f(ve,K.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(ve,K.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(ve,K.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(ve,K.u_pattern_br_b),u_texsize:new e.Uniform2f(ve,K.u_texsize),u_mix:new e.Uniform1f(ve,K.u_mix),u_pattern_size_a:new e.Uniform2f(ve,K.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(ve,K.u_pattern_size_b),u_scale_a:new e.Uniform1f(ve,K.u_scale_a),u_scale_b:new e.Uniform1f(ve,K.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(ve,K.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ve,K.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(ve,K.u_tile_units_to_pixels)}},yc=function(ve,K,_e){return{u_matrix:ve,u_opacity:K,u_color:_e}},ho=function(ve,K,_e,te,me,Ge){return e.extend(Kc(te,Ge,_e,me),{u_matrix:ve,u_opacity:K})},Ro={fillExtrusion:Lf,fillExtrusionPattern:iu,fill:Cc,fillPattern:gc,fillOutline:ql,fillOutlinePattern:xu,circle:Qt,collisionBox:aa,collisionCircle:$r,debug:Ci,clippingMask:Qi,heatmap:Pi,heatmapTexture:Di,hillshade:Mn,hillshadePrepare:Qn,line:An,lineGradient:un,linePattern:yo,lineSDF:Ko,raster:_l,symbolIcon:Rs,symbolSDF:uu,symbolTextAndIcon:Iu,background:Rc,backgroundPattern:Au},Dc;function lc(ve,K,_e,te,me,Ge,Le){for(var $e=ve.context,gt=$e.gl,jt=ve.useProgram("collisionBox"),wr=[],Nr=0,pr=0,yt=0;yt<te.length;yt++){var kt=te[yt],Bt=K.getTile(kt),nr=Bt.getBucket(_e);if(nr){var hr=kt.posMatrix;(me[0]!==0||me[1]!==0)&&(hr=ve.translatePosMatrix(kt.posMatrix,Bt,me,Ge));var lr=Le?nr.textCollisionBox:nr.iconCollisionBox,dr=nr.collisionCircleArray;if(dr.length>0){var ur=e.create(),Ht=hr;e.mul(ur,nr.placementInvProjMatrix,ve.transform.glCoordMatrix),e.mul(ur,ur,nr.placementViewportMatrix),wr.push({circleArray:dr,circleOffset:pr,transform:Ht,invTransform:ur}),Nr+=dr.length/4,pr=Nr}lr&&jt.draw($e,gt.LINES,Ia.disabled,Ca.disabled,ve.colorModeForRenderPass(),Fr.disabled,ka(hr,ve.transform,Bt),_e.id,lr.layoutVertexBuffer,lr.indexBuffer,lr.segments,null,ve.transform.zoom,null,null,lr.collisionVertexBuffer)}}if(!(!Le||!wr.length)){var sr=ve.useProgram("collisionCircle"),Vt=new e.StructArrayLayout2f1f2i16;Vt.resize(Nr*4),Vt._trim();for(var Dr=0,Jr=0,ga=wr;Jr<ga.length;Jr+=1)for(var vi=ga[Jr],Ga=0;Ga<vi.circleArray.length/4;Ga++){var ai=Ga*4,Zi=vi.circleArray[ai+0],Fi=vi.circleArray[ai+1],ui=vi.circleArray[ai+2],_i=vi.circleArray[ai+3];Vt.emplace(Dr++,Zi,Fi,ui,_i,0),Vt.emplace(Dr++,Zi,Fi,ui,_i,1),Vt.emplace(Dr++,Zi,Fi,ui,_i,2),Vt.emplace(Dr++,Zi,Fi,ui,_i,3)}(!Dc||Dc.length<Nr*2)&&(Dc=Yu(Nr));for(var Si=$e.createIndexBuffer(Dc,!0),Ui=$e.createVertexBuffer(Vt,e.collisionCircleLayout.members,!0),fn=0,_o=wr;fn<_o.length;fn+=1){var Bo=_o[fn],Ps=li(Bo.transform,Bo.invTransform,ve.transform);sr.draw($e,gt.TRIANGLES,Ia.disabled,Ca.disabled,ve.colorModeForRenderPass(),Fr.disabled,Ps,_e.id,Ui,Si,e.SegmentVector.simpleSegment(0,Bo.circleOffset*2,Bo.circleArray.length,Bo.circleArray.length/2),null,ve.transform.zoom,null,null,null)}Ui.destroy(),Si.destroy()}}function Yu(ve){var K=ve*2,_e=new e.StructArrayLayout3ui6;_e.resize(K),_e._trim();for(var te=0;te<K;te++){var me=te*6;_e.uint16[me+0]=te*4+0,_e.uint16[me+1]=te*4+1,_e.uint16[me+2]=te*4+2,_e.uint16[me+3]=te*4+2,_e.uint16[me+4]=te*4+3,_e.uint16[me+5]=te*4+0}return _e}var Ue=e.identity(new Float32Array(16));function I(ve,K,_e,te,me){if(ve.renderPass==="translucent"){var Ge=Ca.disabled,Le=ve.colorModeForRenderPass(),$e=_e.layout.get("text-variable-anchor");$e&&we(te,ve,_e,K,_e.layout.get("text-rotation-alignment"),_e.layout.get("text-pitch-alignment"),me),_e.paint.get("icon-opacity").constantOr(1)!==0&&dt(ve,K,_e,te,!1,_e.paint.get("icon-translate"),_e.paint.get("icon-translate-anchor"),_e.layout.get("icon-rotation-alignment"),_e.layout.get("icon-pitch-alignment"),_e.layout.get("icon-keep-upright"),Ge,Le),_e.paint.get("text-opacity").constantOr(1)!==0&&dt(ve,K,_e,te,!0,_e.paint.get("text-translate"),_e.paint.get("text-translate-anchor"),_e.layout.get("text-rotation-alignment"),_e.layout.get("text-pitch-alignment"),_e.layout.get("text-keep-upright"),Ge,Le),K.map.showCollisionBoxes&&(lc(ve,K,_e,te,_e.paint.get("text-translate"),_e.paint.get("text-translate-anchor"),!0),lc(ve,K,_e,te,_e.paint.get("icon-translate"),_e.paint.get("icon-translate-anchor"),!1))}}function ie(ve,K,_e,te,me,Ge){var Le=e.getAnchorAlignment(ve),$e=Le.horizontalAlign,gt=Le.verticalAlign,jt=-($e-.5)*K,wr=-(gt-.5)*_e,Nr=e.evaluateVariableOffset(ve,te);return new e.Point((jt/me+Nr[0])*Ge,(wr/me+Nr[1])*Ge)}function we(ve,K,_e,te,me,Ge,Le){for(var $e=K.transform,gt=me==="map",jt=Ge==="map",wr=0,Nr=ve;wr<Nr.length;wr+=1){var pr=Nr[wr],yt=te.getTile(pr),kt=yt.getBucket(_e);if(!(!kt||!kt.text||!kt.text.segments.get().length)){var Bt=kt.textSizeData,nr=e.evaluateSizeForZoom(Bt,$e.zoom),hr=as(yt,1,K.transform.zoom),lr=Ta(pr.posMatrix,jt,gt,K.transform,hr),dr=_e.layout.get("icon-text-fit")!=="none"&&kt.hasIconData();if(nr){var ur=Math.pow(2,$e.zoom-yt.tileID.overscaledZ);Se(kt,gt,jt,Le,e.symbolSize,$e,lr,pr.posMatrix,ur,nr,dr)}}}}function Se(ve,K,_e,te,me,Ge,Le,$e,gt,jt,wr){var Nr=ve.text.placedSymbolArray,pr=ve.text.dynamicLayoutVertexArray,yt=ve.icon.dynamicLayoutVertexArray,kt={};pr.clear();for(var Bt=0;Bt<Nr.length;Bt++){var nr=Nr.get(Bt),hr=ve.allowVerticalPlacement&&!nr.placedOrientation,lr=!nr.hidden&&nr.crossTileID&&!hr?te[nr.crossTileID]:null;if(!lr)hs(nr.numGlyphs,pr);else{var dr=new e.Point(nr.anchorX,nr.anchorY),ur=ki(dr,_e?$e:Le),Ht=Ki(Ge.cameraToCenterDistance,ur.signedDistanceFromCamera),sr=me.evaluateSizeForFeature(ve.textSizeData,jt,nr)*Ht/e.ONE_EM;_e&&(sr*=ve.tilePixelRatio/gt);for(var Vt=lr.width,Dr=lr.height,Jr=lr.anchor,ga=lr.textOffset,vi=lr.textBoxScale,Ga=ie(Jr,Vt,Dr,ga,vi,sr),ai=_e?ki(dr.add(Ga),Le).point:ur.point.add(K?Ga.rotate(-Ge.angle):Ga),Zi=ve.allowVerticalPlacement&&nr.placedOrientation===e.WritingMode.vertical?Math.PI/2:0,Fi=0;Fi<nr.numGlyphs;Fi++)e.addDynamicAttributes(pr,ai,Zi);wr&&nr.associatedIconIndex>=0&&(kt[nr.associatedIconIndex]={shiftedAnchor:ai,angle:Zi})}}if(wr){yt.clear();for(var ui=ve.icon.placedSymbolArray,_i=0;_i<ui.length;_i++){var Si=ui.get(_i);if(Si.hidden)hs(Si.numGlyphs,yt);else{var Ui=kt[_i];if(!Ui)hs(Si.numGlyphs,yt);else for(var fn=0;fn<Si.numGlyphs;fn++)e.addDynamicAttributes(yt,Ui.shiftedAnchor,Ui.angle)}}ve.icon.dynamicLayoutVertexBuffer.updateData(yt)}ve.text.dynamicLayoutVertexBuffer.updateData(pr)}function Be(ve,K,_e){return _e.iconsInText&&K?"symbolTextAndIcon":ve?"symbolSDF":"symbolIcon"}function dt(ve,K,_e,te,me,Ge,Le,$e,gt,jt,wr,Nr){for(var pr=ve.context,yt=pr.gl,kt=ve.transform,Bt=$e==="map",nr=gt==="map",hr=Bt&&_e.layout.get("symbol-placement")!=="point",lr=Bt&&!nr&&!hr,dr=_e.layout.get("symbol-sort-key").constantOr(1)!==void 0,ur=!1,Ht=ve.depthModeForSublayer(0,Ia.ReadOnly),sr=_e.layout.get("text-variable-anchor"),Vt=[],Dr=0,Jr=te;Dr<Jr.length;Dr+=1){var ga=Jr[Dr],vi=K.getTile(ga),Ga=vi.getBucket(_e);if(Ga){var ai=me?Ga.text:Ga.icon;if(!(!ai||!ai.segments.get().length)){var Zi=ai.programConfigurations.get(_e.id),Fi=me||Ga.sdfIcons,ui=me?Ga.textSizeData:Ga.iconSizeData,_i=nr||kt.pitch!==0,Si=ve.useProgram(Be(Fi,me,Ga),Zi),Ui=e.evaluateSizeForZoom(ui,kt.zoom),fn=void 0,_o=[0,0],Bo=void 0,Ps=void 0,Do=null,Ms=void 0;if(me){if(Bo=vi.glyphAtlasTexture,Ps=yt.LINEAR,fn=vi.glyphAtlasTexture.size,Ga.iconsInText){_o=vi.imageAtlasTexture.size,Do=vi.imageAtlasTexture;var Ys=ui.kind==="composite"||ui.kind==="camera";Ms=_i||ve.options.rotating||ve.options.zooming||Ys?yt.LINEAR:yt.NEAREST}}else{var mu=_e.layout.get("icon-size").constantOr(0)!==1||Ga.iconsNeedLinear;Bo=vi.imageAtlasTexture,Ps=Fi||ve.options.rotating||ve.options.zooming||mu||_i?yt.LINEAR:yt.NEAREST,fn=vi.imageAtlasTexture.size}var Ep=as(vi,1,ve.transform.zoom),kp=Ta(ga.posMatrix,nr,Bt,ve.transform,Ep),Ph=Ai(ga.posMatrix,nr,Bt,ve.transform,Ep),qp=sr&&Ga.hasTextData(),qd=_e.layout.get("icon-text-fit")!=="none"&&qp&&Ga.hasIconData();hr&&Rn(Ga,ga.posMatrix,ve,me,kp,Ph,nr,jt);var ed=ve.translatePosMatrix(ga.posMatrix,vi,Ge,Le),Ih=hr||me&&sr||qd?Ue:kp,td=ve.translatePosMatrix(Ph,vi,Ge,Le,!0),Kh=Fi&&_e.paint.get(me?"text-halo-width":"icon-halo-width").constantOr(1)!==0,Rh=void 0;Fi?Ga.iconsInText?Rh=bu(ui.kind,Ui,lr,nr,ve,ed,Ih,td,fn,_o):Rh=Ic(ui.kind,Ui,lr,nr,ve,ed,Ih,td,me,fn,!0):Rh=Zu(ui.kind,Ui,lr,nr,ve,ed,Ih,td,me,fn);var Cp={program:Si,buffers:ai,uniformValues:Rh,atlasTexture:Bo,atlasTextureIcon:Do,atlasInterpolation:Ps,atlasInterpolationIcon:Ms,isSDF:Fi,hasHalo:Kh};if(dr&&Ga.canOverlap){ur=!0;for(var Vp=ai.segments.get(),Lp=0,Cv=Vp;Lp<Cv.length;Lp+=1){var Vd=Cv[Lp];Vt.push({segments:new e.SegmentVector([Vd]),sortKey:Vd.sortKey,state:Cp})}}else Vt.push({segments:ai.segments,sortKey:0,state:Cp})}}}ur&&Vt.sort(function(nm,om){return nm.sortKey-om.sortKey});for(var Gf=0,Gd=Vt;Gf<Gd.length;Gf+=1){var Lv=Gd[Gf],ph=Lv.state;if(pr.activeTexture.set(yt.TEXTURE0),ph.atlasTexture.bind(ph.atlasInterpolation,yt.CLAMP_TO_EDGE),ph.atlasTextureIcon&&(pr.activeTexture.set(yt.TEXTURE1),ph.atlasTextureIcon&&ph.atlasTextureIcon.bind(ph.atlasInterpolationIcon,yt.CLAMP_TO_EDGE)),ph.isSDF){var iv=ph.uniformValues;ph.hasHalo&&(iv.u_is_halo=1,St(ph.buffers,Lv.segments,_e,ve,ph.program,Ht,wr,Nr,iv)),iv.u_is_halo=0}St(ph.buffers,Lv.segments,_e,ve,ph.program,Ht,wr,Nr,ph.uniformValues)}}function St(ve,K,_e,te,me,Ge,Le,$e,gt){var jt=te.context,wr=jt.gl;me.draw(jt,wr.TRIANGLES,Ge,Le,$e,Fr.disabled,gt,_e.id,ve.layoutVertexBuffer,ve.indexBuffer,K,_e.paint,te.transform.zoom,ve.programConfigurations.get(_e.id),ve.dynamicLayoutVertexBuffer,ve.opacityVertexBuffer)}function Nt(ve,K,_e,te){if(ve.renderPass==="translucent"){var me=_e.paint.get("circle-opacity"),Ge=_e.paint.get("circle-stroke-width"),Le=_e.paint.get("circle-stroke-opacity"),$e=_e.layout.get("circle-sort-key").constantOr(1)!==void 0;if(!(me.constantOr(1)===0&&(Ge.constantOr(1)===0||Le.constantOr(1)===0))){for(var gt=ve.context,jt=gt.gl,wr=ve.depthModeForSublayer(0,Ia.ReadOnly),Nr=Ca.disabled,pr=ve.colorModeForRenderPass(),yt=[],kt=0;kt<te.length;kt++){var Bt=te[kt],nr=K.getTile(Bt),hr=nr.getBucket(_e);if(hr){var lr=hr.programConfigurations.get(_e.id),dr=ve.useProgram("circle",lr),ur=hr.layoutVertexBuffer,Ht=hr.indexBuffer,sr=br(ve,Bt,nr,_e),Vt={programConfiguration:lr,program:dr,layoutVertexBuffer:ur,indexBuffer:Ht,uniformValues:sr};if($e)for(var Dr=hr.segments.get(),Jr=0,ga=Dr;Jr<ga.length;Jr+=1){var vi=ga[Jr];yt.push({segments:new e.SegmentVector([vi]),sortKey:vi.sortKey,state:Vt})}else yt.push({segments:hr.segments,sortKey:0,state:Vt})}}$e&&yt.sort(function(Bo,Ps){return Bo.sortKey-Ps.sortKey});for(var Ga=0,ai=yt;Ga<ai.length;Ga+=1){var Zi=ai[Ga],Fi=Zi.state,ui=Fi.programConfiguration,_i=Fi.program,Si=Fi.layoutVertexBuffer,Ui=Fi.indexBuffer,fn=Fi.uniformValues,_o=Zi.segments;_i.draw(gt,jt.TRIANGLES,wr,Nr,pr,Fr.disabled,fn,_e.id,Si,Ui,_o,_e.paint,ve.transform.zoom,ui)}}}}function $t(ve,K,_e,te){if(_e.paint.get("heatmap-opacity")!==0)if(ve.renderPass==="offscreen"){var me=ve.context,Ge=me.gl,Le=Ca.disabled,$e=new Ft([Ge.ONE,Ge.ONE],e.Color.transparent,[!0,!0,!0,!0]);Tr(me,ve,_e),me.clear({color:e.Color.transparent});for(var gt=0;gt<te.length;gt++){var jt=te[gt];if(!K.hasRenderableParent(jt)){var wr=K.getTile(jt),Nr=wr.getBucket(_e);if(Nr){var pr=Nr.programConfigurations.get(_e.id),yt=ve.useProgram("heatmap",pr),kt=ve.transform,Bt=kt.zoom;yt.draw(me,Ge.TRIANGLES,Ia.disabled,Le,$e,Fr.disabled,Ni(jt.posMatrix,wr,Bt,_e.paint.get("heatmap-intensity")),_e.id,Nr.layoutVertexBuffer,Nr.indexBuffer,Nr.segments,_e.paint,ve.transform.zoom,pr)}}}me.viewport.set([0,0,ve.width,ve.height])}else ve.renderPass==="translucent"&&(ve.context.setColorMode(ve.colorModeForRenderPass()),Kr(ve,_e))}function Tr(ve,K,_e){var te=ve.gl;ve.activeTexture.set(te.TEXTURE1),ve.viewport.set([0,0,K.width/4,K.height/4]);var me=_e.heatmapFbo;if(me)te.bindTexture(te.TEXTURE_2D,me.colorAttachment.get()),ve.bindFramebuffer.set(me.framebuffer);else{var Ge=te.createTexture();te.bindTexture(te.TEXTURE_2D,Ge),te.texParameteri(te.TEXTURE_2D,te.TEXTURE_WRAP_S,te.CLAMP_TO_EDGE),te.texParameteri(te.TEXTURE_2D,te.TEXTURE_WRAP_T,te.CLAMP_TO_EDGE),te.texParameteri(te.TEXTURE_2D,te.TEXTURE_MIN_FILTER,te.LINEAR),te.texParameteri(te.TEXTURE_2D,te.TEXTURE_MAG_FILTER,te.LINEAR),me=_e.heatmapFbo=ve.createFramebuffer(K.width/4,K.height/4,!1),Ar(ve,K,Ge,me)}}function Ar(ve,K,_e,te){var me=ve.gl,Ge=ve.extRenderToTextureHalfFloat?ve.extTextureHalfFloat.HALF_FLOAT_OES:me.UNSIGNED_BYTE;me.texImage2D(me.TEXTURE_2D,0,me.RGBA,K.width/4,K.height/4,0,me.RGBA,Ge,null),te.colorAttachment.set(_e)}function Kr(ve,K){var _e=ve.context,te=_e.gl,me=K.heatmapFbo;if(me){_e.activeTexture.set(te.TEXTURE0),te.bindTexture(te.TEXTURE_2D,me.colorAttachment.get()),_e.activeTexture.set(te.TEXTURE1);var Ge=K.colorRampTexture;Ge||(Ge=K.colorRampTexture=new e.Texture(_e,K.colorRamp,te.RGBA)),Ge.bind(te.LINEAR,te.CLAMP_TO_EDGE),ve.useProgram("heatmapTexture").draw(_e,te.TRIANGLES,Ia.disabled,Ca.disabled,ve.colorModeForRenderPass(),Fr.disabled,mi(ve,K,0,1),K.id,ve.viewportBuffer,ve.quadTriangleIndexBuffer,ve.viewportSegments,K.paint,ve.transform.zoom)}}function na(ve,K,_e,te){if(ve.renderPass==="translucent"){var me=_e.paint.get("line-opacity"),Ge=_e.paint.get("line-width");if(!(me.constantOr(1)===0||Ge.constantOr(1)===0))for(var Le=ve.depthModeForSublayer(0,Ia.ReadOnly),$e=ve.colorModeForRenderPass(),gt=_e.paint.get("line-dasharray"),jt=_e.paint.get("line-pattern"),wr=jt.constantOr(1),Nr=_e.paint.get("line-gradient"),pr=_e.getCrossfadeParameters(),yt=wr?"linePattern":gt?"lineSDF":Nr?"lineGradient":"line",kt=ve.context,Bt=kt.gl,nr=!0,hr=0,lr=te;hr<lr.length;hr+=1){var dr=lr[hr],ur=K.getTile(dr);if(!(wr&&!ur.patternsLoaded())){var Ht=ur.getBucket(_e);if(Ht){var sr=Ht.programConfigurations.get(_e.id),Vt=ve.context.program.get(),Dr=ve.useProgram(yt,sr),Jr=nr||Dr.program!==Vt,ga=jt.constantOr(null);if(ga&&ur.imageAtlas){var vi=ur.imageAtlas,Ga=vi.patternPositions[ga.to.toString()],ai=vi.patternPositions[ga.from.toString()];Ga&&ai&&sr.setConstantPatternPositions(Ga,ai)}var Zi=wr?Os(ve,ur,_e,pr):gt?el(ve,ur,_e,gt,pr):Nr?rl(ve,ur,_e,Ht.lineClipsArray.length):Ss(ve,ur,_e);if(wr)kt.activeTexture.set(Bt.TEXTURE0),ur.imageAtlasTexture.bind(Bt.LINEAR,Bt.CLAMP_TO_EDGE),sr.updatePaintBuffers(pr);else if(gt&&(Jr||ve.lineAtlas.dirty))kt.activeTexture.set(Bt.TEXTURE0),ve.lineAtlas.bind(kt);else if(Nr){var Fi=Ht.gradients[_e.id],ui=Fi.texture;if(_e.gradientVersion!==Fi.version){var _i=256;if(_e.stepInterpolant){var Si=K.getSource().maxzoom,Ui=dr.canonical.z===Si?Math.ceil(1<<ve.transform.maxZoom-dr.canonical.z):1,fn=Ht.maxLineLength/e.EXTENT,_o=1024,Bo=fn*_o*Ui;_i=e.clamp(e.nextPowerOfTwo(Bo),256,kt.maxTextureSize)}Fi.gradient=e.renderColorRamp({expression:_e.gradientExpression(),evaluationKey:"lineProgress",resolution:_i,image:Fi.gradient||void 0,clips:Ht.lineClipsArray}),Fi.texture?Fi.texture.update(Fi.gradient):Fi.texture=new e.Texture(kt,Fi.gradient,Bt.RGBA),Fi.version=_e.gradientVersion,ui=Fi.texture}kt.activeTexture.set(Bt.TEXTURE0),ui.bind(_e.stepInterpolant?Bt.NEAREST:Bt.LINEAR,Bt.CLAMP_TO_EDGE)}Dr.draw(kt,Bt.TRIANGLES,Le,ve.stencilModeForClipping(dr),$e,Fr.disabled,Zi,_e.id,Ht.layoutVertexBuffer,Ht.indexBuffer,Ht.segments,_e.paint,ve.transform.zoom,sr,Ht.layoutVertexBuffer2),nr=!1}}}}}function He(ve,K,_e,te){var me=_e.paint.get("fill-color"),Ge=_e.paint.get("fill-opacity");if(Ge.constantOr(1)!==0){var Le=ve.colorModeForRenderPass(),$e=_e.paint.get("fill-pattern"),gt=ve.opaquePassEnabledForLayer()&&!$e.constantOr(1)&&me.constantOr(e.Color.transparent).a===1&&Ge.constantOr(0)===1?"opaque":"translucent";if(ve.renderPass===gt){var jt=ve.depthModeForSublayer(1,ve.renderPass==="opaque"?Ia.ReadWrite:Ia.ReadOnly);Je(ve,K,_e,te,jt,Le,!1)}if(ve.renderPass==="translucent"&&_e.paint.get("fill-antialias")){var wr=ve.depthModeForSublayer(_e.getPaintProperty("fill-outline-color")?2:0,Ia.ReadOnly);Je(ve,K,_e,te,wr,Le,!0)}}}function Je(ve,K,_e,te,me,Ge,Le){var $e=ve.context.gl,gt=_e.paint.get("fill-pattern"),jt=gt&>.constantOr(1),wr=_e.getCrossfadeParameters(),Nr,pr,yt,kt,Bt;Le?(pr=jt&&!_e.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Nr=$e.LINES):(pr=jt?"fillPattern":"fill",Nr=$e.TRIANGLES);for(var nr=0,hr=te;nr<hr.length;nr+=1){var lr=hr[nr],dr=K.getTile(lr);if(!(jt&&!dr.patternsLoaded())){var ur=dr.getBucket(_e);if(ur){var Ht=ur.programConfigurations.get(_e.id),sr=ve.useProgram(pr,Ht);jt&&(ve.context.activeTexture.set($e.TEXTURE0),dr.imageAtlasTexture.bind($e.LINEAR,$e.CLAMP_TO_EDGE),Ht.updatePaintBuffers(wr));var Vt=gt.constantOr(null);if(Vt&&dr.imageAtlas){var Dr=dr.imageAtlas,Jr=Dr.patternPositions[Vt.to.toString()],ga=Dr.patternPositions[Vt.from.toString()];Jr&&ga&&Ht.setConstantPatternPositions(Jr,ga)}var vi=ve.translatePosMatrix(lr.posMatrix,dr,_e.paint.get("fill-translate"),_e.paint.get("fill-translate-anchor"));if(!Le)kt=ur.indexBuffer,Bt=ur.segments,yt=jt?Jc(vi,ve,wr,dr):Lc(vi);else{kt=ur.indexBuffer2,Bt=ur.segments2;var Ga=[$e.drawingBufferWidth,$e.drawingBufferHeight];yt=pr==="fillOutlinePattern"&&jt?Pc(vi,ve,wr,dr,Ga):sc(vi,Ga)}sr.draw(ve.context,Nr,me,ve.stencilModeForClipping(lr),Ge,Fr.disabled,yt,_e.id,ur.layoutVertexBuffer,kt,Bt,_e.paint,ve.transform.zoom,Ht)}}}}function lt(ve,K,_e,te){var me=_e.paint.get("fill-extrusion-opacity");if(me!==0&&ve.renderPass==="translucent"){var Ge=new Ia(ve.context.gl.LEQUAL,Ia.ReadWrite,ve.depthRangeFor3D);if(me===1&&!_e.paint.get("fill-extrusion-pattern").constantOr(1)){var Le=ve.colorModeForRenderPass();vt(ve,K,_e,te,Ge,Ca.disabled,Le)}else vt(ve,K,_e,te,Ge,Ca.disabled,Ft.disabled),vt(ve,K,_e,te,Ge,ve.stencilModeFor3D(),ve.colorModeForRenderPass())}}function vt(ve,K,_e,te,me,Ge,Le){for(var $e=ve.context,gt=$e.gl,jt=_e.paint.get("fill-extrusion-pattern"),wr=jt.constantOr(1),Nr=_e.getCrossfadeParameters(),pr=_e.paint.get("fill-extrusion-opacity"),yt=0,kt=te;yt<kt.length;yt+=1){var Bt=kt[yt],nr=K.getTile(Bt),hr=nr.getBucket(_e);if(hr){var lr=hr.programConfigurations.get(_e.id),dr=ve.useProgram(wr?"fillExtrusionPattern":"fillExtrusion",lr);wr&&(ve.context.activeTexture.set(gt.TEXTURE0),nr.imageAtlasTexture.bind(gt.LINEAR,gt.CLAMP_TO_EDGE),lr.updatePaintBuffers(Nr));var ur=jt.constantOr(null);if(ur&&nr.imageAtlas){var Ht=nr.imageAtlas,sr=Ht.patternPositions[ur.to.toString()],Vt=Ht.patternPositions[ur.from.toString()];sr&&Vt&&lr.setConstantPatternPositions(sr,Vt)}var Dr=ve.translatePosMatrix(Bt.posMatrix,nr,_e.paint.get("fill-extrusion-translate"),_e.paint.get("fill-extrusion-translate-anchor")),Jr=_e.paint.get("fill-extrusion-vertical-gradient"),ga=wr?Xu(Dr,ve,Jr,pr,Bt,Nr,nr):Vf(Dr,ve,Jr,pr);dr.draw($e,$e.gl.TRIANGLES,me,Ge,Le,Fr.backCCW,ga,_e.id,hr.layoutVertexBuffer,hr.indexBuffer,hr.segments,_e.paint,ve.transform.zoom,lr)}}}function Lt(ve,K,_e,te){if(!(ve.renderPass!=="offscreen"&&ve.renderPass!=="translucent")){for(var me=ve.context,Ge=ve.depthModeForSublayer(0,Ia.ReadOnly),Le=ve.colorModeForRenderPass(),$e=ve.renderPass==="translucent"?ve.stencilConfigForOverlap(te):[{},te],gt=$e[0],jt=$e[1],wr=0,Nr=jt;wr<Nr.length;wr+=1){var pr=Nr[wr],yt=K.getTile(pr);yt.needsHillshadePrepare&&ve.renderPass==="offscreen"?zt(ve,yt,_e,Ge,Ca.disabled,Le):ve.renderPass==="translucent"&&At(ve,yt,_e,Ge,gt[pr.overscaledZ],Le)}me.viewport.set([0,0,ve.width,ve.height])}}function At(ve,K,_e,te,me,Ge){var Le=ve.context,$e=Le.gl,gt=K.fbo;if(gt){var jt=ve.useProgram("hillshade");Le.activeTexture.set($e.TEXTURE0),$e.bindTexture($e.TEXTURE_2D,gt.colorAttachment.get());var wr=ao(ve,K,_e);jt.draw(Le,$e.TRIANGLES,te,me,Ge,Fr.disabled,wr,_e.id,ve.rasterBoundsBuffer,ve.quadTriangleIndexBuffer,ve.rasterBoundsSegments)}}function zt(ve,K,_e,te,me,Ge){var Le=ve.context,$e=Le.gl,gt=K.dem;if(gt&>.data){var jt=gt.dim,wr=gt.stride,Nr=gt.getPixels();if(Le.activeTexture.set($e.TEXTURE1),Le.pixelStoreUnpackPremultiplyAlpha.set(!1),K.demTexture=K.demTexture||ve.getTileTexture(wr),K.demTexture){var pr=K.demTexture;pr.update(Nr,{premultiply:!1}),pr.bind($e.NEAREST,$e.CLAMP_TO_EDGE)}else K.demTexture=new e.Texture(Le,Nr,$e.RGBA,{premultiply:!1}),K.demTexture.bind($e.NEAREST,$e.CLAMP_TO_EDGE);Le.activeTexture.set($e.TEXTURE0);var yt=K.fbo;if(!yt){var kt=new e.Texture(Le,{width:jt,height:jt,data:null},$e.RGBA);kt.bind($e.LINEAR,$e.CLAMP_TO_EDGE),yt=K.fbo=Le.createFramebuffer(jt,jt,!0),yt.colorAttachment.set(kt.texture)}Le.bindFramebuffer.set(yt.framebuffer),Le.viewport.set([0,0,jt,jt]),ve.useProgram("hillshadePrepare").draw(Le,$e.TRIANGLES,te,me,Ge,Fr.disabled,eo(K.tileID,gt),_e.id,ve.rasterBoundsBuffer,ve.quadTriangleIndexBuffer,ve.rasterBoundsSegments),K.needsHillshadePrepare=!1}}function cr(ve,K,_e,te){if(ve.renderPass==="translucent"&&_e.paint.get("raster-opacity")!==0&&te.length)for(var me=ve.context,Ge=me.gl,Le=K.getSource(),$e=ve.useProgram("raster"),gt=ve.colorModeForRenderPass(),jt=Le instanceof le?[{},te]:ve.stencilConfigForOverlap(te),wr=jt[0],Nr=jt[1],pr=Nr[Nr.length-1].overscaledZ,yt=!ve.options.moving,kt=0,Bt=Nr;kt<Bt.length;kt+=1){var nr=Bt[kt],hr=ve.depthModeForSublayer(nr.overscaledZ-pr,_e.paint.get("raster-opacity")===1?Ia.ReadWrite:Ia.ReadOnly,Ge.LESS),lr=K.getTile(nr),dr=ve.transform.calculatePosMatrix(nr.toUnwrapped(),yt);lr.registerFadeDuration(_e.paint.get("raster-fade-duration"));var ur=K.findLoadedParent(nr,0),Ht=yr(lr,ur,K,_e,ve.transform),sr=void 0,Vt=void 0,Dr=_e.paint.get("raster-resampling")==="nearest"?Ge.NEAREST:Ge.LINEAR;me.activeTexture.set(Ge.TEXTURE0),lr.texture.bind(Dr,Ge.CLAMP_TO_EDGE,Ge.LINEAR_MIPMAP_NEAREST),me.activeTexture.set(Ge.TEXTURE1),ur?(ur.texture.bind(Dr,Ge.CLAMP_TO_EDGE,Ge.LINEAR_MIPMAP_NEAREST),sr=Math.pow(2,ur.tileID.overscaledZ-lr.tileID.overscaledZ),Vt=[lr.tileID.canonical.x*sr%1,lr.tileID.canonical.y*sr%1]):lr.texture.bind(Dr,Ge.CLAMP_TO_EDGE,Ge.LINEAR_MIPMAP_NEAREST);var Jr=ll(dr,Vt||[0,0],sr||1,Ht,_e);Le instanceof le?$e.draw(me,Ge.TRIANGLES,hr,Ca.disabled,gt,Fr.disabled,Jr,_e.id,Le.boundsBuffer,ve.quadTriangleIndexBuffer,Le.boundsSegments):$e.draw(me,Ge.TRIANGLES,hr,wr[nr.overscaledZ],gt,Fr.disabled,Jr,_e.id,ve.rasterBoundsBuffer,ve.quadTriangleIndexBuffer,ve.rasterBoundsSegments)}}function yr(ve,K,_e,te,me){var Ge=te.paint.get("raster-fade-duration");if(Ge>0){var Le=e.browser.now(),$e=(Le-ve.timeAdded)/Ge,gt=K?(Le-K.timeAdded)/Ge:-1,jt=_e.getSource(),wr=me.coveringZoomLevel({tileSize:jt.tileSize,roundZoom:jt.roundZoom}),Nr=!K||Math.abs(K.tileID.overscaledZ-wr)>Math.abs(ve.tileID.overscaledZ-wr),pr=Nr&&ve.refreshedUponExpiration?1:e.clamp(Nr?$e:1-gt,0,1);return ve.refreshedUponExpiration&&$e>=1&&(ve.refreshedUponExpiration=!1),K?{opacity:1,mix:1-pr}:{opacity:pr,mix:0}}else return{opacity:1,mix:0}}function Er(ve,K,_e){var te=_e.paint.get("background-color"),me=_e.paint.get("background-opacity");if(me!==0){var Ge=ve.context,Le=Ge.gl,$e=ve.transform,gt=$e.tileSize,jt=_e.paint.get("background-pattern");if(!ve.isPatternMissing(jt)){var wr=!jt&&te.a===1&&me===1&&ve.opaquePassEnabledForLayer()?"opaque":"translucent";if(ve.renderPass===wr){var Nr=Ca.disabled,pr=ve.depthModeForSublayer(0,wr==="opaque"?Ia.ReadWrite:Ia.ReadOnly),yt=ve.colorModeForRenderPass(),kt=ve.useProgram(jt?"backgroundPattern":"background"),Bt=$e.coveringTiles({tileSize:gt});jt&&(Ge.activeTexture.set(Le.TEXTURE0),ve.imageManager.bind(ve.context));for(var nr=_e.getCrossfadeParameters(),hr=0,lr=Bt;hr<lr.length;hr+=1){var dr=lr[hr],ur=ve.transform.calculatePosMatrix(dr.toUnwrapped()),Ht=jt?ho(ur,me,ve,jt,{tileID:dr,tileSize:gt},nr):yc(ur,me,te);kt.draw(Ge,Le.TRIANGLES,pr,Nr,yt,Fr.disabled,Ht,_e.id,ve.tileExtentBuffer,ve.quadTriangleIndexBuffer,ve.tileExtentSegments)}}}}}var jr=new e.Color(1,0,0,1),Qr=new e.Color(0,1,0,1),pa=new e.Color(0,0,1,1),Aa=new e.Color(1,0,1,1),za=new e.Color(0,1,1,1);function ci(ve){var K=ve.transform.padding,_e=3;ji(ve,ve.transform.height-(K.top||0),_e,jr),ji(ve,K.bottom||0,_e,Qr),nn(ve,K.left||0,_e,pa),nn(ve,ve.transform.width-(K.right||0),_e,Aa);var te=ve.transform.centerPoint;Vi(ve,te.x,ve.transform.height-te.y,za)}function Vi(ve,K,_e,te){var me=20,Ge=2;Sn(ve,K-Ge/2,_e-me/2,Ge,me,te),Sn(ve,K-me/2,_e-Ge/2,me,Ge,te)}function ji(ve,K,_e,te){Sn(ve,0,K+_e/2,ve.transform.width,_e,te)}function nn(ve,K,_e,te){Sn(ve,K-_e/2,0,_e,ve.transform.height,te)}function Sn(ve,K,_e,te,me,Ge){var Le=ve.context,$e=Le.gl;$e.enable($e.SCISSOR_TEST),$e.scissor(K*e.browser.devicePixelRatio,_e*e.browser.devicePixelRatio,te*e.browser.devicePixelRatio,me*e.browser.devicePixelRatio),Le.clear({color:Ge}),$e.disable($e.SCISSOR_TEST)}function Kn(ve,K,_e){for(var te=0;te<_e.length;te++)Bn(ve,K,_e[te])}function Bn(ve,K,_e){var te=ve.context,me=te.gl,Ge=_e.posMatrix,Le=ve.useProgram("debug"),$e=Ia.disabled,gt=Ca.disabled,jt=ve.colorModeForRenderPass(),wr="$debug";te.activeTexture.set(me.TEXTURE0),ve.emptyTexture.bind(me.LINEAR,me.CLAMP_TO_EDGE),Le.draw(te,me.LINE_STRIP,$e,gt,jt,Fr.disabled,Hi(Ge,e.Color.red),wr,ve.debugBuffer,ve.tileBorderIndexBuffer,ve.debugSegments);var Nr=K.getTileByID(_e.key).latestRawTileData,pr=Nr&&Nr.byteLength||0,yt=Math.floor(pr/1024),kt=K.getTile(_e).tileSize,Bt=512/Math.min(kt,512)*(_e.overscaledZ/ve.transform.zoom)*.5,nr=_e.canonical.toString();_e.overscaledZ!==_e.canonical.z&&(nr+=" => "+_e.overscaledZ);var hr=nr+" "+yt+"kb";wo(ve,hr),Le.draw(te,me.TRIANGLES,$e,gt,Ft.alphaBlended,Fr.disabled,Hi(Ge,e.Color.transparent,Bt),wr,ve.debugBuffer,ve.quadTriangleIndexBuffer,ve.debugSegments)}function wo(ve,K){ve.initDebugOverlayCanvas();var _e=ve.debugOverlayCanvas,te=ve.context.gl,me=ve.debugOverlayCanvas.getContext("2d");me.clearRect(0,0,_e.width,_e.height),me.shadowColor="white",me.shadowBlur=2,me.lineWidth=1.5,me.strokeStyle="white",me.textBaseline="top",me.font="bold 36px Open Sans, sans-serif",me.fillText(K,5,5),me.strokeText(K,5,5),ve.debugOverlayTexture.update(_e),ve.debugOverlayTexture.bind(te.LINEAR,te.CLAMP_TO_EDGE)}function is(ve,K,_e){var te=ve.context,me=_e.implementation;if(ve.renderPass==="offscreen"){var Ge=me.prerender;Ge&&(ve.setCustomLayerDefaults(),te.setColorMode(ve.colorModeForRenderPass()),Ge.call(me,te.gl,ve.transform.customLayerMatrix()),te.setDirty(),ve.setBaseState())}else if(ve.renderPass==="translucent"){ve.setCustomLayerDefaults(),te.setColorMode(ve.colorModeForRenderPass()),te.setStencilMode(Ca.disabled);var Le=me.renderingMode==="3d"?new Ia(ve.context.gl.LEQUAL,Ia.ReadWrite,ve.depthRangeFor3D):ve.depthModeForSublayer(0,Ia.ReadOnly);te.setDepthMode(Le),me.render(te.gl,ve.transform.customLayerMatrix()),te.setDirty(),ve.setBaseState(),te.bindFramebuffer.set(null)}}var Ao={symbol:I,circle:Nt,heatmap:$t,line:na,fill:He,"fill-extrusion":lt,hillshade:Lt,raster:cr,background:Er,debug:Kn,custom:is},Zo=function(K,_e){this.context=new ta(K),this.transform=_e,this._tileTextures={},this.setup(),this.numSublayers=ra.maxUnderzooming+ra.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new vl,this.gpuTimers={}};Zo.prototype.resize=function(K,_e){if(this.width=K*e.browser.devicePixelRatio,this.height=_e*e.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var te=0,me=this.style._order;te<me.length;te+=1){var Ge=me[te];this.style._layers[Ge].resize()}},Zo.prototype.setup=function(){var K=this.context,_e=new e.StructArrayLayout2i4;_e.emplaceBack(0,0),_e.emplaceBack(e.EXTENT,0),_e.emplaceBack(0,e.EXTENT),_e.emplaceBack(e.EXTENT,e.EXTENT),this.tileExtentBuffer=K.createVertexBuffer(_e,su.members),this.tileExtentSegments=e.SegmentVector.simpleSegment(0,0,4,2);var te=new e.StructArrayLayout2i4;te.emplaceBack(0,0),te.emplaceBack(e.EXTENT,0),te.emplaceBack(0,e.EXTENT),te.emplaceBack(e.EXTENT,e.EXTENT),this.debugBuffer=K.createVertexBuffer(te,su.members),this.debugSegments=e.SegmentVector.simpleSegment(0,0,4,5);var me=new e.StructArrayLayout4i8;me.emplaceBack(0,0,0,0),me.emplaceBack(e.EXTENT,0,e.EXTENT,0),me.emplaceBack(0,e.EXTENT,0,e.EXTENT),me.emplaceBack(e.EXTENT,e.EXTENT,e.EXTENT,e.EXTENT),this.rasterBoundsBuffer=K.createVertexBuffer(me,se.members),this.rasterBoundsSegments=e.SegmentVector.simpleSegment(0,0,4,2);var Ge=new e.StructArrayLayout2i4;Ge.emplaceBack(0,0),Ge.emplaceBack(1,0),Ge.emplaceBack(0,1),Ge.emplaceBack(1,1),this.viewportBuffer=K.createVertexBuffer(Ge,su.members),this.viewportSegments=e.SegmentVector.simpleSegment(0,0,4,2);var Le=new e.StructArrayLayout1ui2;Le.emplaceBack(0),Le.emplaceBack(1),Le.emplaceBack(3),Le.emplaceBack(2),Le.emplaceBack(0),this.tileBorderIndexBuffer=K.createIndexBuffer(Le);var $e=new e.StructArrayLayout3ui6;$e.emplaceBack(0,1,2),$e.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=K.createIndexBuffer($e),this.emptyTexture=new e.Texture(K,{width:1,height:1,data:new Uint8Array([0,0,0,0])},K.gl.RGBA);var gt=this.context.gl;this.stencilClearMode=new Ca({func:gt.ALWAYS,mask:0},0,255,gt.ZERO,gt.ZERO,gt.ZERO)},Zo.prototype.clearStencil=function(){var K=this.context,_e=K.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var te=e.create();e.ortho(te,0,this.width,this.height,0,0,1),e.scale(te,te,[_e.drawingBufferWidth,_e.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(K,_e.TRIANGLES,Ia.disabled,this.stencilClearMode,Ft.disabled,Fr.disabled,dn(te),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},Zo.prototype._renderTileClippingMasks=function(K,_e){if(!(this.currentStencilSource===K.source||!K.isTileClipped()||!_e||!_e.length)){this.currentStencilSource=K.source;var te=this.context,me=te.gl;this.nextStencilID+_e.length>256&&this.clearStencil(),te.setColorMode(Ft.disabled),te.setDepthMode(Ia.disabled);var Ge=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var Le=0,$e=_e;Le<$e.length;Le+=1){var gt=$e[Le],jt=this._tileClippingMaskIDs[gt.key]=this.nextStencilID++;Ge.draw(te,me.TRIANGLES,Ia.disabled,new Ca({func:me.ALWAYS,mask:0},jt,255,me.KEEP,me.KEEP,me.REPLACE),Ft.disabled,Fr.disabled,dn(gt.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},Zo.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var K=this.nextStencilID++,_e=this.context.gl;return new Ca({func:_e.NOTEQUAL,mask:255},K,255,_e.KEEP,_e.KEEP,_e.REPLACE)},Zo.prototype.stencilModeForClipping=function(K){var _e=this.context.gl;return new Ca({func:_e.EQUAL,mask:255},this._tileClippingMaskIDs[K.key],0,_e.KEEP,_e.KEEP,_e.REPLACE)},Zo.prototype.stencilConfigForOverlap=function(K){var _e,te=this.context.gl,me=K.sort(function(jt,wr){return wr.overscaledZ-jt.overscaledZ}),Ge=me[me.length-1].overscaledZ,Le=me[0].overscaledZ-Ge+1;if(Le>1){this.currentStencilSource=void 0,this.nextStencilID+Le>256&&this.clearStencil();for(var $e={},gt=0;gt<Le;gt++)$e[gt+Ge]=new Ca({func:te.GEQUAL,mask:255},gt+this.nextStencilID,255,te.KEEP,te.KEEP,te.REPLACE);return this.nextStencilID+=Le,[$e,me]}return[(_e={},_e[Ge]=Ca.disabled,_e),me]},Zo.prototype.colorModeForRenderPass=function(){var K=this.context.gl;if(this._showOverdrawInspector){var _e=8,te=1/_e;return new Ft([K.CONSTANT_COLOR,K.ONE],new e.Color(te,te,te,0),[!0,!0,!0,!0])}else return this.renderPass==="opaque"?Ft.unblended:Ft.alphaBlended},Zo.prototype.depthModeForSublayer=function(K,_e,te){if(!this.opaquePassEnabledForLayer())return Ia.disabled;var me=1-((1+this.currentLayer)*this.numSublayers+K)*this.depthEpsilon;return new Ia(te||this.context.gl.LEQUAL,_e,[me,me])},Zo.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},Zo.prototype.render=function(K,_e){var te=this;this.style=K,this.options=_e,this.lineAtlas=K.lineAtlas,this.imageManager=K.imageManager,this.glyphManager=K.glyphManager,this.symbolFadeChange=K.placement.symbolFadeChange(e.browser.now()),this.imageManager.beginFrame();var me=this.style._order,Ge=this.style.sourceCaches;for(var Le in Ge){var $e=Ge[Le];$e.used&&$e.prepare(this.context)}var gt={},jt={},wr={};for(var Nr in Ge){var pr=Ge[Nr];gt[Nr]=pr.getVisibleCoordinates(),jt[Nr]=gt[Nr].slice().reverse(),wr[Nr]=pr.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var yt=0;yt<me.length;yt++){var kt=me[yt];if(this.style._layers[kt].is3D()){this.opaquePassCutoff=yt;break}}this.renderPass="offscreen";for(var Bt=0,nr=me;Bt<nr.length;Bt+=1){var hr=nr[Bt],lr=this.style._layers[hr];if(!(!lr.hasOffscreenPass()||lr.isHidden(this.transform.zoom))){var dr=jt[lr.source];lr.type!=="custom"&&!dr.length||this.renderLayer(this,Ge[lr.source],lr,dr)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:_e.showOverdrawInspector?e.Color.black:e.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=_e.showOverdrawInspector,this.depthRangeFor3D=[0,1-(K._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=me.length-1;this.currentLayer>=0;this.currentLayer--){var ur=this.style._layers[me[this.currentLayer]],Ht=Ge[ur.source],sr=gt[ur.source];this._renderTileClippingMasks(ur,sr),this.renderLayer(this,Ht,ur,sr)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<me.length;this.currentLayer++){var Vt=this.style._layers[me[this.currentLayer]],Dr=Ge[Vt.source],Jr=(Vt.type==="symbol"?wr:jt)[Vt.source];this._renderTileClippingMasks(Vt,gt[Vt.source]),this.renderLayer(this,Dr,Vt,Jr)}if(this.options.showTileBoundaries){var ga,vi,Ga=e.values(this.style._layers);Ga.forEach(function(ai){ai.source&&!ai.isHidden(te.transform.zoom)&&(ai.source!==(vi&&vi.id)&&(vi=te.style.sourceCaches[ai.source]),(!ga||ga.getSource().maxzoom<vi.getSource().maxzoom)&&(ga=vi))}),ga&&Ao.debug(this,ga,ga.getVisibleCoordinates())}this.options.showPadding&&ci(this),this.context.setDefault()},Zo.prototype.renderLayer=function(K,_e,te,me){te.isHidden(this.transform.zoom)||te.type!=="background"&&te.type!=="custom"&&!me.length||(this.id=te.id,this.gpuTimingStart(te),Ao[te.type](K,_e,te,me,this.style.placement.variableOffsets),this.gpuTimingEnd())},Zo.prototype.gpuTimingStart=function(K){if(this.options.gpuTiming){var _e=this.context.extTimerQuery,te=this.gpuTimers[K.id];te||(te=this.gpuTimers[K.id]={calls:0,cpuTime:0,query:_e.createQueryEXT()}),te.calls++,_e.beginQueryEXT(_e.TIME_ELAPSED_EXT,te.query)}},Zo.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var K=this.context.extTimerQuery;K.endQueryEXT(K.TIME_ELAPSED_EXT)}},Zo.prototype.collectGpuTimers=function(){var K=this.gpuTimers;return this.gpuTimers={},K},Zo.prototype.queryGpuTimers=function(K){var _e={};for(var te in K){var me=K[te],Ge=this.context.extTimerQuery,Le=Ge.getQueryObjectEXT(me.query,Ge.QUERY_RESULT_EXT)/(1e3*1e3);Ge.deleteQueryEXT(me.query),_e[te]=Le}return _e},Zo.prototype.translatePosMatrix=function(K,_e,te,me,Ge){if(!te[0]&&!te[1])return K;var Le=Ge?me==="map"?this.transform.angle:0:me==="viewport"?-this.transform.angle:0;if(Le){var $e=Math.sin(Le),gt=Math.cos(Le);te=[te[0]*gt-te[1]*$e,te[0]*$e+te[1]*gt]}var jt=[Ge?te[0]:as(_e,te[0],this.transform.zoom),Ge?te[1]:as(_e,te[1],this.transform.zoom),0],wr=new Float32Array(16);return e.translate(wr,K,jt),wr},Zo.prototype.saveTileTexture=function(K){var _e=this._tileTextures[K.size[0]];_e?_e.push(K):this._tileTextures[K.size[0]]=[K]},Zo.prototype.getTileTexture=function(K){var _e=this._tileTextures[K];return _e&&_e.length>0?_e.pop():null},Zo.prototype.isPatternMissing=function(K){if(!K)return!1;if(!K.from||!K.to)return!0;var _e=this.imageManager.getPattern(K.from.toString()),te=this.imageManager.getPattern(K.to.toString());return!_e||!te},Zo.prototype.useProgram=function(K,_e){this.cache=this.cache||{};var te=""+K+(_e?_e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[te]||(this.cache[te]=new gf(this.context,K,uf[K],_e,Ro[K],this._showOverdrawInspector)),this.cache[te]},Zo.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Zo.prototype.setBaseState=function(){var K=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(K.FUNC_ADD)},Zo.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var K=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,K.RGBA)}},Zo.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var ps=function(K,_e){this.points=K,this.planes=_e};ps.fromInvProjectionMatrix=function(K,_e,te){var me=[[-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]],Ge=Math.pow(2,te),Le=me.map(function(jt){return e.transformMat4([],jt,K)}).map(function(jt){return e.scale$1([],jt,1/jt[3]/_e*Ge)}),$e=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],gt=$e.map(function(jt){var wr=e.sub([],Le[jt[0]],Le[jt[1]]),Nr=e.sub([],Le[jt[2]],Le[jt[1]]),pr=e.normalize([],e.cross([],wr,Nr)),yt=-e.dot(pr,Le[jt[1]]);return pr.concat(yt)});return new ps(Le,gt)};var ul=function(K,_e){this.min=K,this.max=_e,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};ul.prototype.quadrant=function(K){for(var _e=[K%2===0,K<2],te=e.clone$2(this.min),me=e.clone$2(this.max),Ge=0;Ge<_e.length;Ge++)te[Ge]=_e[Ge]?this.min[Ge]:this.center[Ge],me[Ge]=_e[Ge]?this.center[Ge]:this.max[Ge];return me[2]=this.max[2],new ul(te,me)},ul.prototype.distanceX=function(K){var _e=Math.max(Math.min(this.max[0],K[0]),this.min[0]);return _e-K[0]},ul.prototype.distanceY=function(K){var _e=Math.max(Math.min(this.max[1],K[1]),this.min[1]);return _e-K[1]},ul.prototype.intersects=function(K){for(var _e=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],te=!0,me=0;me<K.planes.length;me++){for(var Ge=K.planes[me],Le=0,$e=0;$e<_e.length;$e++)Le+=e.dot$1(Ge,_e[$e])>=0;if(Le===0)return 0;Le!==_e.length&&(te=!1)}if(te)return 2;for(var gt=0;gt<3;gt++){for(var jt=Number.MAX_VALUE,wr=-Number.MAX_VALUE,Nr=0;Nr<K.points.length;Nr++){var pr=K.points[Nr][gt]-this.min[gt];jt=Math.min(jt,pr),wr=Math.max(wr,pr)}if(wr<0||jt>this.max[gt]-this.min[gt])return 0}return 1};var tl=function(K,_e,te,me){if(K===void 0&&(K=0),_e===void 0&&(_e=0),te===void 0&&(te=0),me===void 0&&(me=0),isNaN(K)||K<0||isNaN(_e)||_e<0||isNaN(te)||te<0||isNaN(me)||me<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=K,this.bottom=_e,this.left=te,this.right=me};tl.prototype.interpolate=function(K,_e,te){return _e.top!=null&&K.top!=null&&(this.top=e.number(K.top,_e.top,te)),_e.bottom!=null&&K.bottom!=null&&(this.bottom=e.number(K.bottom,_e.bottom,te)),_e.left!=null&&K.left!=null&&(this.left=e.number(K.left,_e.left,te)),_e.right!=null&&K.right!=null&&(this.right=e.number(K.right,_e.right,te)),this},tl.prototype.getCenter=function(K,_e){var te=e.clamp((this.left+K-this.right)/2,0,K),me=e.clamp((this.top+_e-this.bottom)/2,0,_e);return new e.Point(te,me)},tl.prototype.equals=function(K){return this.top===K.top&&this.bottom===K.bottom&&this.left===K.left&&this.right===K.right},tl.prototype.clone=function(){return new tl(this.top,this.bottom,this.left,this.right)},tl.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Jo=function(K,_e,te,me,Ge){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=Ge===void 0?!0:Ge,this._minZoom=K||0,this._maxZoom=_e||22,this._minPitch=te??0,this._maxPitch=me??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new tl,this._posMatrixCache={},this._alignedPosMatrixCache={}},$o={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Jo.prototype.clone=function(){var K=new Jo(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return K.tileSize=this.tileSize,K.latRange=this.latRange,K.width=this.width,K.height=this.height,K._center=this._center,K.zoom=this.zoom,K.angle=this.angle,K._fov=this._fov,K._pitch=this._pitch,K._unmodified=this._unmodified,K._edgeInsets=this._edgeInsets.clone(),K._calcMatrices(),K},$o.minZoom.get=function(){return this._minZoom},$o.minZoom.set=function(ve){this._minZoom!==ve&&(this._minZoom=ve,this.zoom=Math.max(this.zoom,ve))},$o.maxZoom.get=function(){return this._maxZoom},$o.maxZoom.set=function(ve){this._maxZoom!==ve&&(this._maxZoom=ve,this.zoom=Math.min(this.zoom,ve))},$o.minPitch.get=function(){return this._minPitch},$o.minPitch.set=function(ve){this._minPitch!==ve&&(this._minPitch=ve,this.pitch=Math.max(this.pitch,ve))},$o.maxPitch.get=function(){return this._maxPitch},$o.maxPitch.set=function(ve){this._maxPitch!==ve&&(this._maxPitch=ve,this.pitch=Math.min(this.pitch,ve))},$o.renderWorldCopies.get=function(){return this._renderWorldCopies},$o.renderWorldCopies.set=function(ve){ve===void 0?ve=!0:ve===null&&(ve=!1),this._renderWorldCopies=ve},$o.worldSize.get=function(){return this.tileSize*this.scale},$o.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},$o.size.get=function(){return new e.Point(this.width,this.height)},$o.bearing.get=function(){return-this.angle/Math.PI*180},$o.bearing.set=function(ve){var K=-e.wrap(ve,-180,180)*Math.PI/180;this.angle!==K&&(this._unmodified=!1,this.angle=K,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},$o.pitch.get=function(){return this._pitch/Math.PI*180},$o.pitch.set=function(ve){var K=e.clamp(ve,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==K&&(this._unmodified=!1,this._pitch=K,this._calcMatrices())},$o.fov.get=function(){return this._fov/Math.PI*180},$o.fov.set=function(ve){ve=Math.max(.01,Math.min(60,ve)),this._fov!==ve&&(this._unmodified=!1,this._fov=ve/180*Math.PI,this._calcMatrices())},$o.zoom.get=function(){return this._zoom},$o.zoom.set=function(ve){var K=Math.min(Math.max(ve,this.minZoom),this.maxZoom);this._zoom!==K&&(this._unmodified=!1,this._zoom=K,this.scale=this.zoomScale(K),this.tileZoom=Math.floor(K),this.zoomFraction=K-this.tileZoom,this._constrain(),this._calcMatrices())},$o.center.get=function(){return this._center},$o.center.set=function(ve){ve.lat===this._center.lat&&ve.lng===this._center.lng||(this._unmodified=!1,this._center=ve,this._constrain(),this._calcMatrices())},$o.padding.get=function(){return this._edgeInsets.toJSON()},$o.padding.set=function(ve){this._edgeInsets.equals(ve)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,ve,1),this._calcMatrices())},$o.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Jo.prototype.isPaddingEqual=function(K){return this._edgeInsets.equals(K)},Jo.prototype.interpolatePadding=function(K,_e,te){this._unmodified=!1,this._edgeInsets.interpolate(K,_e,te),this._constrain(),this._calcMatrices()},Jo.prototype.coveringZoomLevel=function(K){var _e=(K.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/K.tileSize));return Math.max(0,_e)},Jo.prototype.getVisibleUnwrappedCoordinates=function(K){var _e=[new e.UnwrappedTileID(0,K)];if(this._renderWorldCopies)for(var te=this.pointCoordinate(new e.Point(0,0)),me=this.pointCoordinate(new e.Point(this.width,0)),Ge=this.pointCoordinate(new e.Point(this.width,this.height)),Le=this.pointCoordinate(new e.Point(0,this.height)),$e=Math.floor(Math.min(te.x,me.x,Ge.x,Le.x)),gt=Math.floor(Math.max(te.x,me.x,Ge.x,Le.x)),jt=1,wr=$e-jt;wr<=gt+jt;wr++)wr!==0&&_e.push(new e.UnwrappedTileID(wr,K));return _e},Jo.prototype.coveringTiles=function(K){var _e=this.coveringZoomLevel(K),te=_e;if(K.minzoom!==void 0&&_e<K.minzoom)return[];K.maxzoom!==void 0&&_e>K.maxzoom&&(_e=K.maxzoom);var me=e.MercatorCoordinate.fromLngLat(this.center),Ge=Math.pow(2,_e),Le=[Ge*me.x,Ge*me.y,0],$e=ps.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,_e),gt=K.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(gt=_e);var jt=3,wr=function(Ga){return{aabb:new ul([Ga*Ge,0,0],[(Ga+1)*Ge,Ge,0]),zoom:0,x:0,y:0,wrap:Ga,fullyVisible:!1}},Nr=[],pr=[],yt=_e,kt=K.reparseOverscaled?te:_e;if(this._renderWorldCopies)for(var Bt=1;Bt<=3;Bt++)Nr.push(wr(-Bt)),Nr.push(wr(Bt));for(Nr.push(wr(0));Nr.length>0;){var nr=Nr.pop(),hr=nr.x,lr=nr.y,dr=nr.fullyVisible;if(!dr){var ur=nr.aabb.intersects($e);if(ur===0)continue;dr=ur===2}var Ht=nr.aabb.distanceX(Le),sr=nr.aabb.distanceY(Le),Vt=Math.max(Math.abs(Ht),Math.abs(sr)),Dr=jt+(1<<yt-nr.zoom)-2;if(nr.zoom===yt||Vt>Dr&&nr.zoom>=gt){pr.push({tileID:new e.OverscaledTileID(nr.zoom===yt?kt:nr.zoom,nr.wrap,nr.zoom,hr,lr),distanceSq:e.sqrLen([Le[0]-.5-hr,Le[1]-.5-lr])});continue}for(var Jr=0;Jr<4;Jr++){var ga=(hr<<1)+Jr%2,vi=(lr<<1)+(Jr>>1);Nr.push({aabb:nr.aabb.quadrant(Jr),zoom:nr.zoom+1,x:ga,y:vi,wrap:nr.wrap,fullyVisible:dr})}}return pr.sort(function(Ga,ai){return Ga.distanceSq-ai.distanceSq}).map(function(Ga){return Ga.tileID})},Jo.prototype.resize=function(K,_e){this.width=K,this.height=_e,this.pixelsToGLUnits=[2/K,-2/_e],this._constrain(),this._calcMatrices()},$o.unmodified.get=function(){return this._unmodified},Jo.prototype.zoomScale=function(K){return Math.pow(2,K)},Jo.prototype.scaleZoom=function(K){return Math.log(K)/Math.LN2},Jo.prototype.project=function(K){var _e=e.clamp(K.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(K.lng)*this.worldSize,e.mercatorYfromLat(_e)*this.worldSize)},Jo.prototype.unproject=function(K){return new e.MercatorCoordinate(K.x/this.worldSize,K.y/this.worldSize).toLngLat()},$o.point.get=function(){return this.project(this.center)},Jo.prototype.setLocationAtPoint=function(K,_e){var te=this.pointCoordinate(_e),me=this.pointCoordinate(this.centerPoint),Ge=this.locationCoordinate(K),Le=new e.MercatorCoordinate(Ge.x-(te.x-me.x),Ge.y-(te.y-me.y));this.center=this.coordinateLocation(Le),this._renderWorldCopies&&(this.center=this.center.wrap())},Jo.prototype.locationPoint=function(K){return this.coordinatePoint(this.locationCoordinate(K))},Jo.prototype.pointLocation=function(K){return this.coordinateLocation(this.pointCoordinate(K))},Jo.prototype.locationCoordinate=function(K){return e.MercatorCoordinate.fromLngLat(K)},Jo.prototype.coordinateLocation=function(K){return K.toLngLat()},Jo.prototype.pointCoordinate=function(K){var _e=0,te=[K.x,K.y,0,1],me=[K.x,K.y,1,1];e.transformMat4(te,te,this.pixelMatrixInverse),e.transformMat4(me,me,this.pixelMatrixInverse);var Ge=te[3],Le=me[3],$e=te[0]/Ge,gt=me[0]/Le,jt=te[1]/Ge,wr=me[1]/Le,Nr=te[2]/Ge,pr=me[2]/Le,yt=Nr===pr?0:(_e-Nr)/(pr-Nr);return new e.MercatorCoordinate(e.number($e,gt,yt)/this.worldSize,e.number(jt,wr,yt)/this.worldSize)},Jo.prototype.coordinatePoint=function(K){var _e=[K.x*this.worldSize,K.y*this.worldSize,0,1];return e.transformMat4(_e,_e,this.pixelMatrix),new e.Point(_e[0]/_e[3],_e[1]/_e[3])},Jo.prototype.getBounds=function(){return new e.LngLatBounds().extend(this.pointLocation(new e.Point(0,0))).extend(this.pointLocation(new e.Point(this.width,0))).extend(this.pointLocation(new e.Point(this.width,this.height))).extend(this.pointLocation(new e.Point(0,this.height)))},Jo.prototype.getMaxBounds=function(){return!this.latRange||this.latRange.length!==2||!this.lngRange||this.lngRange.length!==2?null:new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]])},Jo.prototype.setMaxBounds=function(K){K?(this.lngRange=[K.getWest(),K.getEast()],this.latRange=[K.getSouth(),K.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Jo.prototype.calculatePosMatrix=function(K,_e){_e===void 0&&(_e=!1);var te=K.key,me=_e?this._alignedPosMatrixCache:this._posMatrixCache;if(me[te])return me[te];var Ge=K.canonical,Le=this.worldSize/this.zoomScale(Ge.z),$e=Ge.x+Math.pow(2,Ge.z)*K.wrap,gt=e.identity(new Float64Array(16));return e.translate(gt,gt,[$e*Le,Ge.y*Le,0]),e.scale(gt,gt,[Le/e.EXTENT,Le/e.EXTENT,1]),e.multiply(gt,_e?this.alignedProjMatrix:this.projMatrix,gt),me[te]=new Float32Array(gt),me[te]},Jo.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Jo.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var K=-90,_e=90,te=-180,me=180,Ge,Le,$e,gt,jt=this.size,wr=this._unmodified;if(this.latRange){var Nr=this.latRange;K=e.mercatorYfromLat(Nr[1])*this.worldSize,_e=e.mercatorYfromLat(Nr[0])*this.worldSize,Ge=_e-K<jt.y?jt.y/(_e-K):0}if(this.lngRange){var pr=this.lngRange;te=e.mercatorXfromLng(pr[0])*this.worldSize,me=e.mercatorXfromLng(pr[1])*this.worldSize,Le=me-te<jt.x?jt.x/(me-te):0}var yt=this.point,kt=Math.max(Le||0,Ge||0);if(kt){this.center=this.unproject(new e.Point(Le?(me+te)/2:yt.x,Ge?(_e+K)/2:yt.y)),this.zoom+=this.scaleZoom(kt),this._unmodified=wr,this._constraining=!1;return}if(this.latRange){var Bt=yt.y,nr=jt.y/2;Bt-nr<K&&(gt=K+nr),Bt+nr>_e&&(gt=_e-nr)}if(this.lngRange){var hr=yt.x,lr=jt.x/2;hr-lr<te&&($e=te+lr),hr+lr>me&&($e=me-lr)}($e!==void 0||gt!==void 0)&&(this.center=this.unproject(new e.Point($e!==void 0?$e:yt.x,gt!==void 0?gt:yt.y))),this._unmodified=wr,this._constraining=!1}},Jo.prototype._calcMatrices=function(){if(this.height){var K=this._fov/2,_e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(K)*this.height;var te=Math.PI/2+this._pitch,me=this._fov*(.5+_e.y/this.height),Ge=Math.sin(me)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-te-me,.01,Math.PI-.01)),Le=this.point,$e=Le.x,gt=Le.y,jt=Math.cos(Math.PI/2-this._pitch)*Ge+this.cameraToCenterDistance,wr=jt*1.01,Nr=this.height/50,pr=new Float64Array(16);e.perspective(pr,this._fov,this.width/this.height,Nr,wr),pr[8]=-_e.x*2/this.width,pr[9]=_e.y*2/this.height,e.scale(pr,pr,[1,-1,1]),e.translate(pr,pr,[0,0,-this.cameraToCenterDistance]),e.rotateX(pr,pr,this._pitch),e.rotateZ(pr,pr,this.angle),e.translate(pr,pr,[-$e,-gt,0]),this.mercatorMatrix=e.scale([],pr,[this.worldSize,this.worldSize,this.worldSize]),e.scale(pr,pr,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=pr,this.invProjMatrix=e.invert([],this.projMatrix);var yt=this.width%2/2,kt=this.height%2/2,Bt=Math.cos(this.angle),nr=Math.sin(this.angle),hr=$e-Math.round($e)+Bt*yt+nr*kt,lr=gt-Math.round(gt)+Bt*kt+nr*yt,dr=new Float64Array(pr);if(e.translate(dr,dr,[hr>.5?hr-1:hr,lr>.5?lr-1:lr,0]),this.alignedProjMatrix=dr,pr=e.create(),e.scale(pr,pr,[this.width/2,-this.height/2,1]),e.translate(pr,pr,[1,-1,0]),this.labelPlaneMatrix=pr,pr=e.create(),e.scale(pr,pr,[1,-1,1]),e.translate(pr,pr,[-1,-1,0]),e.scale(pr,pr,[2/this.width,2/this.height,1]),this.glCoordMatrix=pr,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),pr=e.invert(new Float64Array(16),this.pixelMatrix),!pr)throw new Error("failed to invert matrix");this.pixelMatrixInverse=pr,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Jo.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var K=this.pointCoordinate(new e.Point(0,0)),_e=[K.x*this.worldSize,K.y*this.worldSize,0,1],te=e.transformMat4(_e,_e,this.pixelMatrix);return te[3]/this.cameraToCenterDistance},Jo.prototype.getCameraPoint=function(){var K=this._pitch,_e=Math.tan(K)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,_e))},Jo.prototype.getCameraQueryGeometry=function(K){var _e=this.getCameraPoint();if(K.length===1)return[K[0],_e];for(var te=_e.x,me=_e.y,Ge=_e.x,Le=_e.y,$e=0,gt=K;$e<gt.length;$e+=1){var jt=gt[$e];te=Math.min(te,jt.x),me=Math.min(me,jt.y),Ge=Math.max(Ge,jt.x),Le=Math.max(Le,jt.y)}return[new e.Point(te,me),new e.Point(Ge,me),new e.Point(Ge,Le),new e.Point(te,Le),new e.Point(te,me)]},Object.defineProperties(Jo.prototype,$o);function Il(ve,K){var _e=!1,te=null,me=function(){te=null,_e&&(ve(),te=setTimeout(me,K),_e=!1)};return function(){return _e=!0,te||me(),te}}var eu=function(K){this._hashName=K&&encodeURIComponent(K),e.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Il(this._updateHashUnthrottled.bind(this),30*1e3/100)};eu.prototype.addTo=function(K){return this._map=K,e.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},eu.prototype.remove=function(){return e.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},eu.prototype.getHashString=function(K){var _e=this._map.getCenter(),te=Math.round(this._map.getZoom()*100)/100,me=Math.ceil((te*Math.LN2+Math.log(512/360/.5))/Math.LN10),Ge=Math.pow(10,me),Le=Math.round(_e.lng*Ge)/Ge,$e=Math.round(_e.lat*Ge)/Ge,gt=this._map.getBearing(),jt=this._map.getPitch(),wr="";if(K?wr+="/"+Le+"/"+$e+"/"+te:wr+=te+"/"+$e+"/"+Le,(gt||jt)&&(wr+="/"+Math.round(gt*10)/10),jt&&(wr+="/"+Math.round(jt)),this._hashName){var Nr=this._hashName,pr=!1,yt=e.window.location.hash.slice(1).split("&").map(function(kt){var Bt=kt.split("=")[0];return Bt===Nr?(pr=!0,Bt+"="+wr):kt}).filter(function(kt){return kt});return pr||yt.push(Nr+"="+wr),"#"+yt.join("&")}return"#"+wr},eu.prototype._getCurrentHash=function(){var K=this,_e=e.window.location.hash.replace("#","");if(this._hashName){var te;return _e.split("&").map(function(me){return me.split("=")}).forEach(function(me){me[0]===K._hashName&&(te=me)}),(te&&te[1]||"").split("/")}return _e.split("/")},eu.prototype._onHashChange=function(){var K=this._getCurrentHash();if(K.length>=3&&!K.some(function(te){return isNaN(te)})){var _e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(K[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+K[2],+K[1]],zoom:+K[0],bearing:_e,pitch:+(K[4]||0)}),!0}return!1},eu.prototype._updateHashUnthrottled=function(){var K=e.window.location.href.replace(/(#.+)?$/,this.getHashString());try{e.window.history.replaceState(e.window.history.state,null,K)}catch{}};var Ru={linearity:.3,easing:e.bezier(0,0,.3,1)},vu=e.extend({deceleration:2500,maxSpeed:1400},Ru),Tl=e.extend({deceleration:20,maxSpeed:1400},Ru),cu=e.extend({deceleration:1e3,maxSpeed:360},Ru),uc=e.extend({deceleration:1e3,maxSpeed:90},Ru),Vl=function(K){this._map=K,this.clear()};Vl.prototype.clear=function(){this._inertiaBuffer=[]},Vl.prototype.record=function(K){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.browser.now(),settings:K})},Vl.prototype._drainInertiaBuffer=function(){for(var K=this._inertiaBuffer,_e=e.browser.now(),te=160;K.length>0&&_e-K[0].time>te;)K.shift()},Vl.prototype._onMoveEnd=function(K){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var _e={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},te=0,me=this._inertiaBuffer;te<me.length;te+=1){var Ge=me[te],Le=Ge.settings;_e.zoom+=Le.zoomDelta||0,_e.bearing+=Le.bearingDelta||0,_e.pitch+=Le.pitchDelta||0,Le.panDelta&&_e.pan._add(Le.panDelta),Le.around&&(_e.around=Le.around),Le.pinchAround&&(_e.pinchAround=Le.pinchAround)}var $e=this._inertiaBuffer[this._inertiaBuffer.length-1],gt=$e.time-this._inertiaBuffer[0].time,jt={};if(_e.pan.mag()){var wr=de(_e.pan.mag(),gt,e.extend({},vu,K||{}));jt.offset=_e.pan.mult(wr.amount/_e.pan.mag()),jt.center=this._map.transform.center,Gl(jt,wr)}if(_e.zoom){var Nr=de(_e.zoom,gt,Tl);jt.zoom=this._map.transform.zoom+Nr.amount,Gl(jt,Nr)}if(_e.bearing){var pr=de(_e.bearing,gt,cu);jt.bearing=this._map.transform.bearing+e.clamp(pr.amount,-179,179),Gl(jt,pr)}if(_e.pitch){var yt=de(_e.pitch,gt,uc);jt.pitch=this._map.transform.pitch+yt.amount,Gl(jt,yt)}if(jt.zoom||jt.bearing){var kt=_e.pinchAround===void 0?_e.around:_e.pinchAround;jt.around=kt?this._map.unproject(kt):this._map.getCenter()}return this.clear(),e.extend(jt,{noMoveStart:!0})}};function Gl(ve,K){(!ve.duration||ve.duration<K.duration)&&(ve.duration=K.duration,ve.easing=K.easing)}function de(ve,K,_e){var te=_e.maxSpeed,me=_e.linearity,Ge=_e.deceleration,Le=e.clamp(ve*me/(K/1e3),-te,te),$e=Math.abs(Le)/(Ge*me);return{easing:_e.easing,duration:$e*1e3,amount:Le*($e/2)}}var Fe=function(ve){function K(te,me,Ge,Le){Le===void 0&&(Le={});var $e=r.mousePos(me.getCanvasContainer(),Ge),gt=me.unproject($e);ve.call(this,te,e.extend({point:$e,lngLat:gt,originalEvent:Ge},Le)),this._defaultPrevented=!1,this.target=me}ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K;var _e={defaultPrevented:{configurable:!0}};return K.prototype.preventDefault=function(){this._defaultPrevented=!0},_e.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(K.prototype,_e),K}(e.Event),et=function(ve){function K(te,me,Ge){var Le=te==="touchend"?Ge.changedTouches:Ge.touches,$e=r.touchPos(me.getCanvasContainer(),Le),gt=$e.map(function(Nr){return me.unproject(Nr)}),jt=$e.reduce(function(Nr,pr,yt,kt){return Nr.add(pr.div(kt.length))},new e.Point(0,0)),wr=me.unproject(jt);ve.call(this,te,{points:$e,point:jt,lngLats:gt,lngLat:wr,originalEvent:Ge}),this._defaultPrevented=!1}ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K;var _e={defaultPrevented:{configurable:!0}};return K.prototype.preventDefault=function(){this._defaultPrevented=!0},_e.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(K.prototype,_e),K}(e.Event),mt=function(ve){function K(te,me,Ge){ve.call(this,te,{originalEvent:Ge}),this._defaultPrevented=!1}ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K;var _e={defaultPrevented:{configurable:!0}};return K.prototype.preventDefault=function(){this._defaultPrevented=!0},_e.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(K.prototype,_e),K}(e.Event),bt=function(K,_e){this._map=K,this._clickTolerance=_e.clickTolerance};bt.prototype.reset=function(){delete this._mousedownPos},bt.prototype.wheel=function(K){return this._firePreventable(new mt(K.type,this._map,K))},bt.prototype.mousedown=function(K,_e){return this._mousedownPos=_e,this._firePreventable(new Fe(K.type,this._map,K))},bt.prototype.mouseup=function(K){this._map.fire(new Fe(K.type,this._map,K))},bt.prototype.click=function(K,_e){this._mousedownPos&&this._mousedownPos.dist(_e)>=this._clickTolerance||this._map.fire(new Fe(K.type,this._map,K))},bt.prototype.dblclick=function(K){return this._firePreventable(new Fe(K.type,this._map,K))},bt.prototype.mouseover=function(K){this._map.fire(new Fe(K.type,this._map,K))},bt.prototype.mouseout=function(K){this._map.fire(new Fe(K.type,this._map,K))},bt.prototype.touchstart=function(K){return this._firePreventable(new et(K.type,this._map,K))},bt.prototype.touchmove=function(K){this._map.fire(new et(K.type,this._map,K))},bt.prototype.touchend=function(K){this._map.fire(new et(K.type,this._map,K))},bt.prototype.touchcancel=function(K){this._map.fire(new et(K.type,this._map,K))},bt.prototype._firePreventable=function(K){if(this._map.fire(K),K.defaultPrevented)return{}},bt.prototype.isEnabled=function(){return!0},bt.prototype.isActive=function(){return!1},bt.prototype.enable=function(){},bt.prototype.disable=function(){};var Mt=function(K){this._map=K};Mt.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Mt.prototype.mousemove=function(K){this._map.fire(new Fe(K.type,this._map,K))},Mt.prototype.mousedown=function(){this._delayContextMenu=!0},Mt.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Fe("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Mt.prototype.contextmenu=function(K){this._delayContextMenu?this._contextMenuEvent=K:this._map.fire(new Fe(K.type,this._map,K)),this._map.listens("contextmenu")&&K.preventDefault()},Mt.prototype.isEnabled=function(){return!0},Mt.prototype.isActive=function(){return!1},Mt.prototype.enable=function(){},Mt.prototype.disable=function(){};var ar=function(K,_e){this._map=K,this._el=K.getCanvasContainer(),this._container=K.getContainer(),this._clickTolerance=_e.clickTolerance||1};ar.prototype.isEnabled=function(){return!!this._enabled},ar.prototype.isActive=function(){return!!this._active},ar.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},ar.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ar.prototype.mousedown=function(K,_e){this.isEnabled()&&K.shiftKey&&K.button===0&&(r.disableDrag(),this._startPos=this._lastPos=_e,this._active=!0)},ar.prototype.mousemoveWindow=function(K,_e){if(this._active){var te=_e;if(!(this._lastPos.equals(te)||!this._box&&te.dist(this._startPos)<this._clickTolerance)){var me=this._startPos;this._lastPos=te,this._box||(this._box=r.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",K));var Ge=Math.min(me.x,te.x),Le=Math.max(me.x,te.x),$e=Math.min(me.y,te.y),gt=Math.max(me.y,te.y);r.setTransform(this._box,"translate("+Ge+"px,"+$e+"px)"),this._box.style.width=Le-Ge+"px",this._box.style.height=gt-$e+"px"}}},ar.prototype.mouseupWindow=function(K,_e){var te=this;if(this._active&&K.button===0){var me=this._startPos,Ge=_e;if(this.reset(),r.suppressClick(),me.x===Ge.x&&me.y===Ge.y)this._fireEvent("boxzoomcancel",K);else return this._map.fire(new e.Event("boxzoomend",{originalEvent:K})),{cameraAnimation:function(Le){return Le.fitScreenCoordinates(me,Ge,te._map.getBearing(),{linear:!0})}}}},ar.prototype.keydown=function(K){this._active&&K.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",K))},ar.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos},ar.prototype._fireEvent=function(K,_e){return this._map.fire(new e.Event(K,{originalEvent:_e}))};function Ot(ve,K){for(var _e={},te=0;te<ve.length;te++)_e[ve[te].identifier]=K[te];return _e}function _r(ve){for(var K=new e.Point(0,0),_e=0,te=ve;_e<te.length;_e+=1){var me=te[_e];K._add(me)}return K.div(ve.length)}var Gr=500,Xr=500,xa=30,da=function(K){this.reset(),this.numTouches=K.numTouches};da.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},da.prototype.touchstart=function(K,_e,te){(this.centroid||te.length>this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=K.timeStamp),te.length===this.numTouches&&(this.centroid=_r(_e),this.touches=Ot(te,_e)))},da.prototype.touchmove=function(K,_e,te){if(!(this.aborted||!this.centroid)){var me=Ot(te,_e);for(var Ge in this.touches){var Le=this.touches[Ge],$e=me[Ge];(!$e||$e.dist(Le)>xa)&&(this.aborted=!0)}}},da.prototype.touchend=function(K,_e,te){if((!this.centroid||K.timeStamp-this.startTime>Xr)&&(this.aborted=!0),te.length===0){var me=!this.aborted&&this.centroid;if(this.reset(),me)return me}};var Ja=function(K){this.singleTap=new da(K),this.numTaps=K.numTaps,this.reset()};Ja.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Ja.prototype.touchstart=function(K,_e,te){this.singleTap.touchstart(K,_e,te)},Ja.prototype.touchmove=function(K,_e,te){this.singleTap.touchmove(K,_e,te)},Ja.prototype.touchend=function(K,_e,te){var me=this.singleTap.touchend(K,_e,te);if(me){var Ge=K.timeStamp-this.lastTime<Gr,Le=!this.lastTap||this.lastTap.dist(me)<xa;if((!Ge||!Le)&&this.reset(),this.count++,this.lastTime=K.timeStamp,this.lastTap=me,this.count===this.numTaps)return this.reset(),me}};var ti=function(){this._zoomIn=new Ja({numTouches:1,numTaps:2}),this._zoomOut=new Ja({numTouches:2,numTaps:1}),this.reset()};ti.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},ti.prototype.touchstart=function(K,_e,te){this._zoomIn.touchstart(K,_e,te),this._zoomOut.touchstart(K,_e,te)},ti.prototype.touchmove=function(K,_e,te){this._zoomIn.touchmove(K,_e,te),this._zoomOut.touchmove(K,_e,te)},ti.prototype.touchend=function(K,_e,te){var me=this,Ge=this._zoomIn.touchend(K,_e,te),Le=this._zoomOut.touchend(K,_e,te);if(Ge)return this._active=!0,K.preventDefault(),setTimeout(function(){return me.reset()},0),{cameraAnimation:function($e){return $e.easeTo({duration:300,zoom:$e.getZoom()+1,around:$e.unproject(Ge)},{originalEvent:K})}};if(Le)return this._active=!0,K.preventDefault(),setTimeout(function(){return me.reset()},0),{cameraAnimation:function($e){return $e.easeTo({duration:300,zoom:$e.getZoom()-1,around:$e.unproject(Le)},{originalEvent:K})}}},ti.prototype.touchcancel=function(){this.reset()},ti.prototype.enable=function(){this._enabled=!0},ti.prototype.disable=function(){this._enabled=!1,this.reset()},ti.prototype.isEnabled=function(){return this._enabled},ti.prototype.isActive=function(){return this._active};var Sa=0,Fa=2,Xa={};Xa[Sa]=1,Xa[Fa]=2;function fi(ve,K){var _e=Xa[K];return ve.buttons===void 0||(ve.buttons&_e)!==_e}var ni=function(K){this.reset(),this._clickTolerance=K.clickTolerance||1};ni.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},ni.prototype._correctButton=function(K,_e){return!1},ni.prototype._move=function(K,_e){return{}},ni.prototype.mousedown=function(K,_e){if(!this._lastPoint){var te=r.mouseButton(K);this._correctButton(K,te)&&(this._lastPoint=_e,this._eventButton=te)}},ni.prototype.mousemoveWindow=function(K,_e){var te=this._lastPoint;if(te){if(K.preventDefault(),fi(K,this._eventButton)){this.reset();return}if(!(!this._moved&&_e.dist(te)<this._clickTolerance))return this._moved=!0,this._lastPoint=_e,this._move(te,_e)}},ni.prototype.mouseupWindow=function(K){if(this._lastPoint){var _e=r.mouseButton(K);_e===this._eventButton&&(this._moved&&r.suppressClick(),this.reset())}},ni.prototype.enable=function(){this._enabled=!0},ni.prototype.disable=function(){this._enabled=!1,this.reset()},ni.prototype.isEnabled=function(){return this._enabled},ni.prototype.isActive=function(){return this._active};var La=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.mousedown=function(te,me){ve.prototype.mousedown.call(this,te,me),this._lastPoint&&(this._active=!0)},K.prototype._correctButton=function(te,me){return me===Sa&&!te.ctrlKey},K.prototype._move=function(te,me){return{around:me,panDelta:me.sub(te)}},K}(ni),sn=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype._correctButton=function(te,me){return me===Sa&&te.ctrlKey||me===Fa},K.prototype._move=function(te,me){var Ge=.8,Le=(me.x-te.x)*Ge;if(Le)return this._active=!0,{bearingDelta:Le}},K.prototype.contextmenu=function(te){te.preventDefault()},K}(ni),rn=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype._correctButton=function(te,me){return me===Sa&&te.ctrlKey||me===Fa},K.prototype._move=function(te,me){var Ge=-.5,Le=(me.y-te.y)*Ge;if(Le)return this._active=!0,{pitchDelta:Le}},K.prototype.contextmenu=function(te){te.preventDefault()},K}(ni),vn=function(K){this._minTouches=1,this._clickTolerance=K.clickTolerance||1,this.reset()};vn.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new e.Point(0,0)},vn.prototype.touchstart=function(K,_e,te){return this._calculateTransform(K,_e,te)},vn.prototype.touchmove=function(K,_e,te){if(!(!this._active||te.length<this._minTouches))return K.preventDefault(),this._calculateTransform(K,_e,te)},vn.prototype.touchend=function(K,_e,te){this._calculateTransform(K,_e,te),this._active&&te.length<this._minTouches&&this.reset()},vn.prototype.touchcancel=function(){this.reset()},vn.prototype._calculateTransform=function(K,_e,te){te.length>0&&(this._active=!0);var me=Ot(te,_e),Ge=new e.Point(0,0),Le=new e.Point(0,0),$e=0;for(var gt in me){var jt=me[gt],wr=this._touches[gt];wr&&(Ge._add(jt),Le._add(jt.sub(wr)),$e++,me[gt]=jt)}if(this._touches=me,!($e<this._minTouches||!Le.mag())){var Nr=Le.div($e);if(this._sum._add(Nr),!(this._sum.mag()<this._clickTolerance)){var pr=Ge.div($e);return{around:pr,panDelta:Nr}}}},vn.prototype.enable=function(){this._enabled=!0},vn.prototype.disable=function(){this._enabled=!1,this.reset()},vn.prototype.isEnabled=function(){return this._enabled},vn.prototype.isActive=function(){return this._active};var Pn=function(){this.reset()};Pn.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},Pn.prototype._start=function(K){},Pn.prototype._move=function(K,_e,te){return{}},Pn.prototype.touchstart=function(K,_e,te){this._firstTwoTouches||te.length<2||(this._firstTwoTouches=[te[0].identifier,te[1].identifier],this._start([_e[0],_e[1]]))},Pn.prototype.touchmove=function(K,_e,te){if(this._firstTwoTouches){K.preventDefault();var me=this._firstTwoTouches,Ge=me[0],Le=me[1],$e=Jn(te,_e,Ge),gt=Jn(te,_e,Le);if(!(!$e||!gt)){var jt=this._aroundCenter?null:$e.add(gt).div(2);return this._move([$e,gt],jt,K)}}},Pn.prototype.touchend=function(K,_e,te){if(this._firstTwoTouches){var me=this._firstTwoTouches,Ge=me[0],Le=me[1],$e=Jn(te,_e,Ge),gt=Jn(te,_e,Le);$e&>||(this._active&&r.suppressClick(),this.reset())}},Pn.prototype.touchcancel=function(){this.reset()},Pn.prototype.enable=function(K){this._enabled=!0,this._aroundCenter=!!K&&K.around==="center"},Pn.prototype.disable=function(){this._enabled=!1,this.reset()},Pn.prototype.isEnabled=function(){return this._enabled},Pn.prototype.isActive=function(){return this._active};function Jn(ve,K,_e){for(var te=0;te<ve.length;te++)if(ve[te].identifier===_e)return K[te]}var ro=.1;function Yo(ve,K){return Math.log(ve/K)/Math.LN2}var io=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.reset=function(){ve.prototype.reset.call(this),delete this._distance,delete this._startDistance},K.prototype._start=function(te){this._startDistance=this._distance=te[0].dist(te[1])},K.prototype._move=function(te,me){var Ge=this._distance;if(this._distance=te[0].dist(te[1]),!(!this._active&&Math.abs(Yo(this._distance,this._startDistance))<ro))return this._active=!0,{zoomDelta:Yo(this._distance,Ge),pinchAround:me}},K}(Pn),Ho=25;function cl(ve,K){return ve.angleWith(K)*180/Math.PI}var al=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.reset=function(){ve.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},K.prototype._start=function(te){this._startVector=this._vector=te[0].sub(te[1]),this._minDiameter=te[0].dist(te[1])},K.prototype._move=function(te,me){var Ge=this._vector;if(this._vector=te[0].sub(te[1]),!(!this._active&&this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:cl(this._vector,Ge),pinchAround:me}},K.prototype._isBelowThreshold=function(te){this._minDiameter=Math.min(this._minDiameter,te.mag());var me=Math.PI*this._minDiameter,Ge=Ho/me*360,Le=cl(te,this._startVector);return Math.abs(Le)<Ge},K}(Pn);function xl(ve){return Math.abs(ve.y)>Math.abs(ve.x)}var gn=100,vo=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.reset=function(){ve.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},K.prototype._start=function(te){this._lastPoints=te,xl(te[0].sub(te[1]))&&(this._valid=!1)},K.prototype._move=function(te,me,Ge){var Le=te[0].sub(this._lastPoints[0]),$e=te[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(Le,$e,Ge.timeStamp),!!this._valid){this._lastPoints=te,this._active=!0;var gt=(Le.y+$e.y)/2,jt=-.5;return{pitchDelta:gt*jt}}},K.prototype.gestureBeginsVertically=function(te,me,Ge){if(this._valid!==void 0)return this._valid;var Le=2,$e=te.mag()>=Le,gt=me.mag()>=Le;if(!(!$e&&!gt)){if(!$e||!gt)return this._firstMove===void 0&&(this._firstMove=Ge),Ge-this._firstMove<gn?void 0:!1;var jt=te.y>0==me.y>0;return xl(te)&&xl(me)&&jt}},K}(Pn),cs={panStep:100,bearingStep:15,pitchStep:10},ms=function(){var K=cs;this._panStep=K.panStep,this._bearingStep=K.bearingStep,this._pitchStep=K.pitchStep,this._rotationDisabled=!1};ms.prototype.reset=function(){this._active=!1},ms.prototype.keydown=function(K){var _e=this;if(!(K.altKey||K.ctrlKey||K.metaKey)){var te=0,me=0,Ge=0,Le=0,$e=0;switch(K.keyCode){case 61:case 107:case 171:case 187:te=1;break;case 189:case 109:case 173:te=-1;break;case 37:K.shiftKey?me=-1:(K.preventDefault(),Le=-1);break;case 39:K.shiftKey?me=1:(K.preventDefault(),Le=1);break;case 38:K.shiftKey?Ge=1:(K.preventDefault(),$e=-1);break;case 40:K.shiftKey?Ge=-1:(K.preventDefault(),$e=1);break;default:return}return this._rotationDisabled&&(me=0,Ge=0),{cameraAnimation:function(gt){var jt=gt.getZoom();gt.easeTo({duration:300,easeId:"keyboardHandler",easing:Al,zoom:te?Math.round(jt)+te*(K.shiftKey?2:1):jt,bearing:gt.getBearing()+me*_e._bearingStep,pitch:gt.getPitch()+Ge*_e._pitchStep,offset:[-Le*_e._panStep,-$e*_e._panStep],center:gt.getCenter()},{originalEvent:K})}}}},ms.prototype.enable=function(){this._enabled=!0},ms.prototype.disable=function(){this._enabled=!1,this.reset()},ms.prototype.isEnabled=function(){return this._enabled},ms.prototype.isActive=function(){return this._active},ms.prototype.disableRotation=function(){this._rotationDisabled=!0},ms.prototype.enableRotation=function(){this._rotationDisabled=!1};function Al(ve){return ve*(2-ve)}var Hl=4.000244140625,Su=1/100,Rl=1/450,_c=2,it=function(K,_e){this._map=K,this._el=K.getCanvasContainer(),this._handler=_e,this._delta=0,this._defaultZoomRate=Su,this._wheelZoomRate=Rl,e.bindAll(["_onTimeout"],this)};it.prototype.setZoomRate=function(K){this._defaultZoomRate=K},it.prototype.setWheelZoomRate=function(K){this._wheelZoomRate=K},it.prototype.isEnabled=function(){return!!this._enabled},it.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},it.prototype.isZooming=function(){return!!this._zooming},it.prototype.enable=function(K){this.isEnabled()||(this._enabled=!0,this._aroundCenter=K&&K.around==="center")},it.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},it.prototype.wheel=function(K){if(this.isEnabled()){var _e=K.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?K.deltaY*40:K.deltaY,te=e.browser.now(),me=te-(this._lastWheelEventTime||0);this._lastWheelEventTime=te,_e!==0&&_e%Hl===0?this._type="wheel":_e!==0&&Math.abs(_e)<4?this._type="trackpad":me>400?(this._type=null,this._lastValue=_e,this._timeout=setTimeout(this._onTimeout,40,K)):this._type||(this._type=Math.abs(me*_e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,_e+=this._lastValue)),K.shiftKey&&_e&&(_e=_e/4),this._type&&(this._lastWheelEvent=K,this._delta-=_e,this._active||this._start(K)),K.preventDefault()}},it.prototype._onTimeout=function(K){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(K)},it.prototype._start=function(K){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var _e=r.mousePos(this._el,K);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(_e)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},it.prototype.renderFrame=function(){var K=this;if(this._frameId&&(this._frameId=null,!!this.isActive())){var _e=this._map.transform;if(this._delta!==0){var te=this._type==="wheel"&&Math.abs(this._delta)>Hl?this._wheelZoomRate:this._defaultZoomRate,me=_c/(1+Math.exp(-Math.abs(this._delta*te)));this._delta<0&&me!==0&&(me=1/me);var Ge=typeof this._targetZoom=="number"?_e.zoomScale(this._targetZoom):_e.scale;this._targetZoom=Math.min(_e.maxZoom,Math.max(_e.minZoom,_e.scaleZoom(Ge*me))),this._type==="wheel"&&(this._startZoom=_e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var Le=typeof this._targetZoom=="number"?this._targetZoom:_e.zoom,$e=this._startZoom,gt=this._easing,jt=!1,wr;if(this._type==="wheel"&&$e&>){var Nr=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),pr=gt(Nr);wr=e.number($e,Le,pr),Nr<1?this._frameId||(this._frameId=!0):jt=!0}else wr=Le,jt=!0;return this._active=!0,jt&&(this._active=!1,this._finishTimeout=setTimeout(function(){K._zooming=!1,K._handler._triggerRenderFrame(),delete K._targetZoom,delete K._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!jt,zoomDelta:wr-_e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},it.prototype._smoothOutEasing=function(K){var _e=e.ease;if(this._prevEase){var te=this._prevEase,me=(e.browser.now()-te.start)/te.duration,Ge=te.easing(me+.01)-te.easing(me),Le=.27/Math.sqrt(Ge*Ge+1e-4)*.01,$e=Math.sqrt(.27*.27-Le*Le);_e=e.bezier(Le,$e,.25,1)}return this._prevEase={start:e.browser.now(),duration:K,easing:_e},_e},it.prototype.reset=function(){this._active=!1};var Zt=function(K,_e){this._clickZoom=K,this._tapZoom=_e};Zt.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Zt.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Zt.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Zt.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var fr=function(){this.reset()};fr.prototype.reset=function(){this._active=!1},fr.prototype.dblclick=function(K,_e){return K.preventDefault(),{cameraAnimation:function(te){te.easeTo({duration:300,zoom:te.getZoom()+(K.shiftKey?-1:1),around:te.unproject(_e)},{originalEvent:K})}}},fr.prototype.enable=function(){this._enabled=!0},fr.prototype.disable=function(){this._enabled=!1,this.reset()},fr.prototype.isEnabled=function(){return this._enabled},fr.prototype.isActive=function(){return this._active};var oa=function(){this._tap=new Ja({numTouches:1,numTaps:1}),this.reset()};oa.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},oa.prototype.touchstart=function(K,_e,te){this._swipePoint||(this._tapTime&&K.timeStamp-this._tapTime>Gr&&this.reset(),this._tapTime?te.length>0&&(this._swipePoint=_e[0],this._swipeTouch=te[0].identifier):this._tap.touchstart(K,_e,te))},oa.prototype.touchmove=function(K,_e,te){if(!this._tapTime)this._tap.touchmove(K,_e,te);else if(this._swipePoint){if(te[0].identifier!==this._swipeTouch)return;var me=_e[0],Ge=me.y-this._swipePoint.y;return this._swipePoint=me,K.preventDefault(),this._active=!0,{zoomDelta:Ge/128}}},oa.prototype.touchend=function(K,_e,te){if(this._tapTime)this._swipePoint&&te.length===0&&this.reset();else{var me=this._tap.touchend(K,_e,te);me&&(this._tapTime=K.timeStamp)}},oa.prototype.touchcancel=function(){this.reset()},oa.prototype.enable=function(){this._enabled=!0},oa.prototype.disable=function(){this._enabled=!1,this.reset()},oa.prototype.isEnabled=function(){return this._enabled},oa.prototype.isActive=function(){return this._active};var wa=function(K,_e,te){this._el=K,this._mousePan=_e,this._touchPan=te};wa.prototype.enable=function(K){this._inertiaOptions=K||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},wa.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},wa.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},wa.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var ma=function(K,_e,te){this._pitchWithRotate=K.pitchWithRotate,this._mouseRotate=_e,this._mousePitch=te};ma.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},ma.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},ma.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},ma.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var _a=function(K,_e,te,me){this._el=K,this._touchZoom=_e,this._touchRotate=te,this._tapDragZoom=me,this._rotationDisabled=!1,this._enabled=!0};_a.prototype.enable=function(K){this._touchZoom.enable(K),this._rotationDisabled||this._touchRotate.enable(K),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},_a.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},_a.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},_a.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},_a.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},_a.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Ya=function(ve){return ve.zoom||ve.drag||ve.pitch||ve.rotate},bi=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K}(e.Event);function yi(ve){return ve.panDelta&&ve.panDelta.mag()||ve.zoomDelta||ve.bearingDelta||ve.pitchDelta}var si=function(K,_e){this._map=K,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Vl(K),this._bearingSnap=_e.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(_e),e.bindAll(["handleEvent","handleWindowEvent"],this);var te=this._el;this._listeners=[[te,"touchstart",{passive:!0}],[te,"touchmove",{passive:!1}],[te,"touchend",void 0],[te,"touchcancel",void 0],[te,"mousedown",void 0],[te,"mousemove",void 0],[te,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[te,"mouseover",void 0],[te,"mouseout",void 0],[te,"dblclick",void 0],[te,"click",void 0],[te,"keydown",{capture:!1}],[te,"keyup",void 0],[te,"wheel",{passive:!1}],[te,"contextmenu",void 0],[e.window,"blur",void 0]];for(var me=0,Ge=this._listeners;me<Ge.length;me+=1){var Le=Ge[me],$e=Le[0],gt=Le[1],jt=Le[2];r.addEventListener($e,gt,$e===e.window.document?this.handleWindowEvent:this.handleEvent,jt)}};si.prototype.destroy=function(){for(var K=0,_e=this._listeners;K<_e.length;K+=1){var te=_e[K],me=te[0],Ge=te[1],Le=te[2];r.removeEventListener(me,Ge,me===e.window.document?this.handleWindowEvent:this.handleEvent,Le)}},si.prototype._addDefaultHandlers=function(K){var _e=this._map,te=_e.getCanvasContainer();this._add("mapEvent",new bt(_e,K));var me=_e.boxZoom=new ar(_e,K);this._add("boxZoom",me);var Ge=new ti,Le=new fr;_e.doubleClickZoom=new Zt(Le,Ge),this._add("tapZoom",Ge),this._add("clickZoom",Le);var $e=new oa;this._add("tapDragZoom",$e);var gt=_e.touchPitch=new vo;this._add("touchPitch",gt);var jt=new sn(K),wr=new rn(K);_e.dragRotate=new ma(K,jt,wr),this._add("mouseRotate",jt,["mousePitch"]),this._add("mousePitch",wr,["mouseRotate"]);var Nr=new La(K),pr=new vn(K);_e.dragPan=new wa(te,Nr,pr),this._add("mousePan",Nr),this._add("touchPan",pr,["touchZoom","touchRotate"]);var yt=new al,kt=new io;_e.touchZoomRotate=new _a(te,kt,yt,$e),this._add("touchRotate",yt,["touchPan","touchZoom"]),this._add("touchZoom",kt,["touchPan","touchRotate"]);var Bt=_e.scrollZoom=new it(_e,this);this._add("scrollZoom",Bt,["mousePan"]);var nr=_e.keyboard=new ms;this._add("keyboard",nr),this._add("blockableMapEvent",new Mt(_e));for(var hr=0,lr=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];hr<lr.length;hr+=1){var dr=lr[hr];K.interactive&&K[dr]&&_e[dr].enable(K[dr])}},si.prototype._add=function(K,_e,te){this._handlers.push({handlerName:K,handler:_e,allowed:te}),this._handlersById[K]=_e},si.prototype.stop=function(K){if(!this._updatingCamera){for(var _e=0,te=this._handlers;_e<te.length;_e+=1){var me=te[_e],Ge=me.handler;Ge.reset()}this._inertia.clear(),this._fireEvents({},{},K),this._changes=[]}},si.prototype.isActive=function(){for(var K=0,_e=this._handlers;K<_e.length;K+=1){var te=_e[K],me=te.handler;if(me.isActive())return!0}return!1},si.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},si.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},si.prototype.isMoving=function(){return!!Ya(this._eventsInProgress)||this.isZooming()},si.prototype._blockedByActive=function(K,_e,te){for(var me in K)if(me!==te&&(!_e||_e.indexOf(me)<0))return!0;return!1},si.prototype.handleWindowEvent=function(K){this.handleEvent(K,K.type+"Window")},si.prototype._getMapTouches=function(K){for(var _e=[],te=0,me=K;te<me.length;te+=1){var Ge=me[te],Le=Ge.target;this._el.contains(Le)&&_e.push(Ge)}return _e},si.prototype.handleEvent=function(K,_e){if(K.type==="blur"){this.stop(!0);return}this._updatingCamera=!0;for(var te=K.type==="renderFrame"?void 0:K,me={needsRenderFrame:!1},Ge={},Le={},$e=K.touches?this._getMapTouches(K.touches):void 0,gt=$e?r.touchPos(this._el,$e):r.mousePos(this._el,K),jt=0,wr=this._handlers;jt<wr.length;jt+=1){var Nr=wr[jt],pr=Nr.handlerName,yt=Nr.handler,kt=Nr.allowed;if(yt.isEnabled()){var Bt=void 0;this._blockedByActive(Le,kt,pr)?yt.reset():yt[_e||K.type]&&(Bt=yt[_e||K.type](K,gt,$e),this.mergeHandlerResult(me,Ge,Bt,pr,te),Bt&&Bt.needsRenderFrame&&this._triggerRenderFrame()),(Bt||yt.isActive())&&(Le[pr]=yt)}}var nr={};for(var hr in this._previousActiveHandlers)Le[hr]||(nr[hr]=te);this._previousActiveHandlers=Le,(Object.keys(nr).length||yi(me))&&(this._changes.push([me,Ge,nr]),this._triggerRenderFrame()),(Object.keys(Le).length||yi(me))&&this._map._stop(!0),this._updatingCamera=!1;var lr=me.cameraAnimation;lr&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],lr(this._map))},si.prototype.mergeHandlerResult=function(K,_e,te,me,Ge){if(te){e.extend(K,te);var Le={handlerName:me,originalEvent:te.originalEvent||Ge};te.zoomDelta!==void 0&&(_e.zoom=Le),te.panDelta!==void 0&&(_e.drag=Le),te.pitchDelta!==void 0&&(_e.pitch=Le),te.bearingDelta!==void 0&&(_e.rotate=Le)}},si.prototype._applyChanges=function(){for(var K={},_e={},te={},me=0,Ge=this._changes;me<Ge.length;me+=1){var Le=Ge[me],$e=Le[0],gt=Le[1],jt=Le[2];$e.panDelta&&(K.panDelta=(K.panDelta||new e.Point(0,0))._add($e.panDelta)),$e.zoomDelta&&(K.zoomDelta=(K.zoomDelta||0)+$e.zoomDelta),$e.bearingDelta&&(K.bearingDelta=(K.bearingDelta||0)+$e.bearingDelta),$e.pitchDelta&&(K.pitchDelta=(K.pitchDelta||0)+$e.pitchDelta),$e.around!==void 0&&(K.around=$e.around),$e.pinchAround!==void 0&&(K.pinchAround=$e.pinchAround),$e.noInertia&&(K.noInertia=$e.noInertia),e.extend(_e,gt),e.extend(te,jt)}this._updateMapTransform(K,_e,te),this._changes=[]},si.prototype._updateMapTransform=function(K,_e,te){var me=this._map,Ge=me.transform;if(!yi(K))return this._fireEvents(_e,te,!0);var Le=K.panDelta,$e=K.zoomDelta,gt=K.bearingDelta,jt=K.pitchDelta,wr=K.around,Nr=K.pinchAround;Nr!==void 0&&(wr=Nr),me._stop(!0),wr=wr||me.transform.centerPoint;var pr=Ge.pointLocation(Le?wr.sub(Le):wr);gt&&(Ge.bearing+=gt),jt&&(Ge.pitch+=jt),$e&&(Ge.zoom+=$e),Ge.setLocationAtPoint(pr,wr),this._map._update(),K.noInertia||this._inertia.record(K),this._fireEvents(_e,te,!0)},si.prototype._fireEvents=function(K,_e,te){var me=this,Ge=Ya(this._eventsInProgress),Le=Ya(K),$e={};for(var gt in K){var jt=K[gt],wr=jt.originalEvent;this._eventsInProgress[gt]||($e[gt+"start"]=wr),this._eventsInProgress[gt]=K[gt]}!Ge&&Le&&this._fireEvent("movestart",Le.originalEvent);for(var Nr in $e)this._fireEvent(Nr,$e[Nr]);Le&&this._fireEvent("move",Le.originalEvent);for(var pr in K){var yt=K[pr],kt=yt.originalEvent;this._fireEvent(pr,kt)}var Bt={},nr;for(var hr in this._eventsInProgress){var lr=this._eventsInProgress[hr],dr=lr.handlerName,ur=lr.originalEvent;this._handlersById[dr].isActive()||(delete this._eventsInProgress[hr],nr=_e[dr]||ur,Bt[hr+"end"]=nr)}for(var Ht in Bt)this._fireEvent(Ht,Bt[Ht]);var sr=Ya(this._eventsInProgress);if(te&&(Ge||Le)&&!sr){this._updatingCamera=!0;var Vt=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Dr=function(Jr){return Jr!==0&&-me._bearingSnap<Jr&&Jr<me._bearingSnap};Vt?(Dr(Vt.bearing||this._map.getBearing())&&(Vt.bearing=0),this._map.easeTo(Vt,{originalEvent:nr})):(this._map.fire(new e.Event("moveend",{originalEvent:nr})),Dr(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},si.prototype._fireEvent=function(K,_e){this._map.fire(new e.Event(K,_e?{originalEvent:_e}:{}))},si.prototype._requestFrame=function(){var K=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add(function(_e){delete K._frameId,K.handleEvent(new bi("renderFrame",{timeStamp:_e})),K._applyChanges()})},si.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var yn=function(ve){function K(_e,te){ve.call(this),this._moving=!1,this._zooming=!1,this.transform=_e,this._bearingSnap=te.bearingSnap,e.bindAll(["_renderFrameCallback"],this)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getCenter=function(){return new e.LngLat(this.transform.center.lng,this.transform.center.lat)},K.prototype.setCenter=function(te,me){return this.jumpTo({center:te},me)},K.prototype.panBy=function(te,me,Ge){return te=e.Point.convert(te).mult(-1),this.panTo(this.transform.center,e.extend({offset:te},me),Ge)},K.prototype.panTo=function(te,me,Ge){return this.easeTo(e.extend({center:te},me),Ge)},K.prototype.getZoom=function(){return this.transform.zoom},K.prototype.setZoom=function(te,me){return this.jumpTo({zoom:te},me),this},K.prototype.zoomTo=function(te,me,Ge){return this.easeTo(e.extend({zoom:te},me),Ge)},K.prototype.zoomIn=function(te,me){return this.zoomTo(this.getZoom()+1,te,me),this},K.prototype.zoomOut=function(te,me){return this.zoomTo(this.getZoom()-1,te,me),this},K.prototype.getBearing=function(){return this.transform.bearing},K.prototype.setBearing=function(te,me){return this.jumpTo({bearing:te},me),this},K.prototype.getPadding=function(){return this.transform.padding},K.prototype.setPadding=function(te,me){return this.jumpTo({padding:te},me),this},K.prototype.rotateTo=function(te,me,Ge){return this.easeTo(e.extend({bearing:te},me),Ge)},K.prototype.resetNorth=function(te,me){return this.rotateTo(0,e.extend({duration:1e3},te),me),this},K.prototype.resetNorthPitch=function(te,me){return this.easeTo(e.extend({bearing:0,pitch:0,duration:1e3},te),me),this},K.prototype.snapToNorth=function(te,me){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(te,me):this},K.prototype.getPitch=function(){return this.transform.pitch},K.prototype.setPitch=function(te,me){return this.jumpTo({pitch:te},me),this},K.prototype.cameraForBounds=function(te,me){te=e.LngLatBounds.convert(te);var Ge=me&&me.bearing||0;return this._cameraForBoxAndBearing(te.getNorthWest(),te.getSouthEast(),Ge,me)},K.prototype._cameraForBoxAndBearing=function(te,me,Ge,Le){var $e={top:0,bottom:0,right:0,left:0};if(Le=e.extend({padding:$e,offset:[0,0],maxZoom:this.transform.maxZoom},Le),typeof Le.padding=="number"){var gt=Le.padding;Le.padding={top:gt,bottom:gt,right:gt,left:gt}}Le.padding=e.extend($e,Le.padding);var jt=this.transform,wr=jt.padding,Nr=jt.project(e.LngLat.convert(te)),pr=jt.project(e.LngLat.convert(me)),yt=Nr.rotate(-Ge*Math.PI/180),kt=pr.rotate(-Ge*Math.PI/180),Bt=new e.Point(Math.max(yt.x,kt.x),Math.max(yt.y,kt.y)),nr=new e.Point(Math.min(yt.x,kt.x),Math.min(yt.y,kt.y)),hr=Bt.sub(nr),lr=(jt.width-(wr.left+wr.right+Le.padding.left+Le.padding.right))/hr.x,dr=(jt.height-(wr.top+wr.bottom+Le.padding.top+Le.padding.bottom))/hr.y;if(dr<0||lr<0){e.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");return}var ur=Math.min(jt.scaleZoom(jt.scale*Math.min(lr,dr)),Le.maxZoom),Ht=typeof Le.offset.x=="number"?new e.Point(Le.offset.x,Le.offset.y):e.Point.convert(Le.offset),sr=(Le.padding.left-Le.padding.right)/2,Vt=(Le.padding.top-Le.padding.bottom)/2,Dr=new e.Point(sr,Vt),Jr=Dr.rotate(Ge*Math.PI/180),ga=Ht.add(Jr),vi=ga.mult(jt.scale/jt.zoomScale(ur)),Ga=jt.unproject(Nr.add(pr).div(2).sub(vi));return{center:Ga,zoom:ur,bearing:Ge}},K.prototype.fitBounds=function(te,me,Ge){return this._fitInternal(this.cameraForBounds(te,me),me,Ge)},K.prototype.fitScreenCoordinates=function(te,me,Ge,Le,$e){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(e.Point.convert(te)),this.transform.pointLocation(e.Point.convert(me)),Ge,Le),Le,$e)},K.prototype._fitInternal=function(te,me,Ge){return te?(me=e.extend(te,me),delete me.padding,me.linear?this.easeTo(me,Ge):this.flyTo(me,Ge)):this},K.prototype.jumpTo=function(te,me){this.stop();var Ge=this.transform,Le=!1,$e=!1,gt=!1;return"zoom"in te&&Ge.zoom!==+te.zoom&&(Le=!0,Ge.zoom=+te.zoom),te.center!==void 0&&(Ge.center=e.LngLat.convert(te.center)),"bearing"in te&&Ge.bearing!==+te.bearing&&($e=!0,Ge.bearing=+te.bearing),"pitch"in te&&Ge.pitch!==+te.pitch&&(gt=!0,Ge.pitch=+te.pitch),te.padding!=null&&!Ge.isPaddingEqual(te.padding)&&(Ge.padding=te.padding),this.fire(new e.Event("movestart",me)).fire(new e.Event("move",me)),Le&&this.fire(new e.Event("zoomstart",me)).fire(new e.Event("zoom",me)).fire(new e.Event("zoomend",me)),$e&&this.fire(new e.Event("rotatestart",me)).fire(new e.Event("rotate",me)).fire(new e.Event("rotateend",me)),gt&&this.fire(new e.Event("pitchstart",me)).fire(new e.Event("pitch",me)).fire(new e.Event("pitchend",me)),this.fire(new e.Event("moveend",me))},K.prototype.easeTo=function(te,me){var Ge=this;this._stop(!1,te.easeId),te=e.extend({offset:[0,0],duration:500,easing:e.ease},te),(te.animate===!1||!te.essential&&e.browser.prefersReducedMotion)&&(te.duration=0);var Le=this.transform,$e=this.getZoom(),gt=this.getBearing(),jt=this.getPitch(),wr=this.getPadding(),Nr="zoom"in te?+te.zoom:$e,pr="bearing"in te?this._normalizeBearing(te.bearing,gt):gt,yt="pitch"in te?+te.pitch:jt,kt="padding"in te?te.padding:Le.padding,Bt=e.Point.convert(te.offset),nr=Le.centerPoint.add(Bt),hr=Le.pointLocation(nr),lr=e.LngLat.convert(te.center||hr);this._normalizeCenter(lr);var dr=Le.project(hr),ur=Le.project(lr).sub(dr),Ht=Le.zoomScale(Nr-$e),sr,Vt;te.around&&(sr=e.LngLat.convert(te.around),Vt=Le.locationPoint(sr));var Dr={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||Nr!==$e,this._rotating=this._rotating||gt!==pr,this._pitching=this._pitching||yt!==jt,this._padding=!Le.isPaddingEqual(kt),this._easeId=te.easeId,this._prepareEase(me,te.noMoveStart,Dr),this._ease(function(Jr){if(Ge._zooming&&(Le.zoom=e.number($e,Nr,Jr)),Ge._rotating&&(Le.bearing=e.number(gt,pr,Jr)),Ge._pitching&&(Le.pitch=e.number(jt,yt,Jr)),Ge._padding&&(Le.interpolatePadding(wr,kt,Jr),nr=Le.centerPoint.add(Bt)),sr)Le.setLocationAtPoint(sr,Vt);else{var ga=Le.zoomScale(Le.zoom-$e),vi=Nr>$e?Math.min(2,Ht):Math.max(.5,Ht),Ga=Math.pow(vi,1-Jr),ai=Le.unproject(dr.add(ur.mult(Jr*Ga)).mult(ga));Le.setLocationAtPoint(Le.renderWorldCopies?ai.wrap():ai,nr)}Ge._fireMoveEvents(me)},function(Jr){Ge._afterEase(me,Jr)},te),this},K.prototype._prepareEase=function(te,me,Ge){Ge===void 0&&(Ge={}),this._moving=!0,!me&&!Ge.moving&&this.fire(new e.Event("movestart",te)),this._zooming&&!Ge.zooming&&this.fire(new e.Event("zoomstart",te)),this._rotating&&!Ge.rotating&&this.fire(new e.Event("rotatestart",te)),this._pitching&&!Ge.pitching&&this.fire(new e.Event("pitchstart",te))},K.prototype._fireMoveEvents=function(te){this.fire(new e.Event("move",te)),this._zooming&&this.fire(new e.Event("zoom",te)),this._rotating&&this.fire(new e.Event("rotate",te)),this._pitching&&this.fire(new e.Event("pitch",te))},K.prototype._afterEase=function(te,me){if(!(this._easeId&&me&&this._easeId===me)){delete this._easeId;var Ge=this._zooming,Le=this._rotating,$e=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Ge&&this.fire(new e.Event("zoomend",te)),Le&&this.fire(new e.Event("rotateend",te)),$e&&this.fire(new e.Event("pitchend",te)),this.fire(new e.Event("moveend",te))}},K.prototype.flyTo=function(te,me){var Ge=this;if(!te.essential&&e.browser.prefersReducedMotion){var Le=e.pick(te,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Le,me)}this.stop(),te=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},te);var $e=this.transform,gt=this.getZoom(),jt=this.getBearing(),wr=this.getPitch(),Nr=this.getPadding(),pr="zoom"in te?e.clamp(+te.zoom,$e.minZoom,$e.maxZoom):gt,yt="bearing"in te?this._normalizeBearing(te.bearing,jt):jt,kt="pitch"in te?+te.pitch:wr,Bt="padding"in te?te.padding:$e.padding,nr=$e.zoomScale(pr-gt),hr=e.Point.convert(te.offset),lr=$e.centerPoint.add(hr),dr=$e.pointLocation(lr),ur=e.LngLat.convert(te.center||dr);this._normalizeCenter(ur);var Ht=$e.project(dr),sr=$e.project(ur).sub(Ht),Vt=te.curve,Dr=Math.max($e.width,$e.height),Jr=Dr/nr,ga=sr.mag();if("minZoom"in te){var vi=e.clamp(Math.min(te.minZoom,gt,pr),$e.minZoom,$e.maxZoom),Ga=Dr/$e.zoomScale(vi-gt);Vt=Math.sqrt(Ga/ga*2)}var ai=Vt*Vt;function Zi(Do){var Ms=(Jr*Jr-Dr*Dr+(Do?-1:1)*ai*ai*ga*ga)/(2*(Do?Jr:Dr)*ai*ga);return Math.log(Math.sqrt(Ms*Ms+1)-Ms)}function Fi(Do){return(Math.exp(Do)-Math.exp(-Do))/2}function ui(Do){return(Math.exp(Do)+Math.exp(-Do))/2}function _i(Do){return Fi(Do)/ui(Do)}var Si=Zi(0),Ui=function(Do){return ui(Si)/ui(Si+Vt*Do)},fn=function(Do){return Dr*((ui(Si)*_i(Si+Vt*Do)-Fi(Si))/ai)/ga},_o=(Zi(1)-Si)/Vt;if(Math.abs(ga)<1e-6||!isFinite(_o)){if(Math.abs(Dr-Jr)<1e-6)return this.easeTo(te,me);var Bo=Jr<Dr?-1:1;_o=Math.abs(Math.log(Jr/Dr))/Vt,fn=function(){return 0},Ui=function(Do){return Math.exp(Bo*Vt*Do)}}if("duration"in te)te.duration=+te.duration;else{var Ps="screenSpeed"in te?+te.screenSpeed/Vt:+te.speed;te.duration=1e3*_o/Ps}return te.maxDuration&&te.duration>te.maxDuration&&(te.duration=0),this._zooming=!0,this._rotating=jt!==yt,this._pitching=kt!==wr,this._padding=!$e.isPaddingEqual(Bt),this._prepareEase(me,!1),this._ease(function(Do){var Ms=Do*_o,Ys=1/Ui(Ms);$e.zoom=Do===1?pr:gt+$e.scaleZoom(Ys),Ge._rotating&&($e.bearing=e.number(jt,yt,Do)),Ge._pitching&&($e.pitch=e.number(wr,kt,Do)),Ge._padding&&($e.interpolatePadding(Nr,Bt,Do),lr=$e.centerPoint.add(hr));var mu=Do===1?ur:$e.unproject(Ht.add(sr.mult(fn(Ms))).mult(Ys));$e.setLocationAtPoint($e.renderWorldCopies?mu.wrap():mu,lr),Ge._fireMoveEvents(me)},function(){return Ge._afterEase(me)},te),this},K.prototype.isEasing=function(){return!!this._easeFrameId},K.prototype.stop=function(){return this._stop()},K.prototype._stop=function(te,me){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var Ge=this._onEaseEnd;delete this._onEaseEnd,Ge.call(this,me)}if(!te){var Le=this.handlers;Le&&Le.stop(!1)}return this},K.prototype._ease=function(te,me,Ge){Ge.animate===!1||Ge.duration===0?(te(1),me()):(this._easeStart=e.browser.now(),this._easeOptions=Ge,this._onEaseFrame=te,this._onEaseEnd=me,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},K.prototype._renderFrameCallback=function(){var te=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(te)),te<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},K.prototype._normalizeBearing=function(te,me){te=e.wrap(te,-180,180);var Ge=Math.abs(te-me);return Math.abs(te-360-me)<Ge&&(te-=360),Math.abs(te+360-me)<Ge&&(te+=360),te},K.prototype._normalizeCenter=function(te){var me=this.transform;if(!(!me.renderWorldCopies||me.lngRange)){var Ge=te.lng-me.center.lng;te.lng+=Ge>180?-360:Ge<-180?360:0}},K}(e.Evented),zi=function(K){K===void 0&&(K={}),this.options=K,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};zi.prototype.getDefaultPosition=function(){return"bottom-right"},zi.prototype.onAdd=function(K){var _e=this.options&&this.options.compact;return this._map=K,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),_e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),_e===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},zi.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},zi.prototype._setElementTitle=function(K,_e){var te=this._map._getUIString("AttributionControl."+_e);K.title=te,K.setAttribute("aria-label",te)},zi.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},zi.prototype._updateEditLink=function(){var K=this._editLink;K||(K=this._editLink=this._container.querySelector(".mapbox-improve-map"));var _e=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(K){var te=_e.reduce(function(me,Ge,Le){return Ge.value&&(me+=Ge.key+"="+Ge.value+(Le<_e.length-1?"&":"")),me},"?");K.href=e.config.FEEDBACK_URL+"/"+te+(this._map._hash?this._map._hash.getHashString(!0):""),K.rel="noopener nofollow",this._setElementTitle(K,"MapFeedback")}},zi.prototype._updateData=function(K){K&&(K.sourceDataType==="metadata"||K.sourceDataType==="visibility"||K.dataType==="style")&&(this._updateAttributions(),this._updateEditLink())},zi.prototype._updateAttributions=function(){if(this._map.style){var K=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?K=K.concat(this.options.customAttribution.map(function(gt){return typeof gt!="string"?"":gt})):typeof this.options.customAttribution=="string"&&K.push(this.options.customAttribution)),this._map.style.stylesheet){var _e=this._map.style.stylesheet;this.styleOwner=_e.owner,this.styleId=_e.id}var te=this._map.style.sourceCaches;for(var me in te){var Ge=te[me];if(Ge.used){var Le=Ge.getSource();Le.attribution&&K.indexOf(Le.attribution)<0&&K.push(Le.attribution)}}K.sort(function(gt,jt){return gt.length-jt.length}),K=K.filter(function(gt,jt){for(var wr=jt+1;wr<K.length;wr++)if(K[wr].indexOf(gt)>=0)return!1;return!0});var $e=K.join(" | ");$e!==this._attribHTML&&(this._attribHTML=$e,K.length?(this._innerContainer.innerHTML=$e,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},zi.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Ei=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};Ei.prototype.onAdd=function(K){this._map=K,this._container=r.create("div","mapboxgl-ctrl");var _e=r.create("a","mapboxgl-ctrl-logo");return _e.target="_blank",_e.rel="noopener nofollow",_e.href="https://www.mapbox.com/",_e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),_e.setAttribute("rel","noopener nofollow"),this._container.appendChild(_e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Ei.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Ei.prototype.getDefaultPosition=function(){return"bottom-left"},Ei.prototype._updateLogo=function(K){(!K||K.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},Ei.prototype._logoRequired=function(){if(this._map.style){var K=this._map.style.sourceCaches;for(var _e in K){var te=K[_e].getSource();if(te.mapbox_logo)return!0}return!1}},Ei.prototype._updateCompact=function(){var K=this._container.children;if(K.length){var _e=K[0];this._map.getCanvasContainer().offsetWidth<250?_e.classList.add("mapboxgl-compact"):_e.classList.remove("mapboxgl-compact")}};var Na=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Na.prototype.add=function(K){var _e=++this._id,te=this._queue;return te.push({callback:K,id:_e,cancelled:!1}),_e},Na.prototype.remove=function(K){for(var _e=this._currentlyRunning,te=_e?this._queue.concat(_e):this._queue,me=0,Ge=te;me<Ge.length;me+=1){var Le=Ge[me];if(Le.id===K){Le.cancelled=!0;return}}},Na.prototype.run=function(K){K===void 0&&(K=0);var _e=this._currentlyRunning=this._queue;this._queue=[];for(var te=0,me=_e;te<me.length;te+=1){var Ge=me[te];if(!Ge.cancelled&&(Ge.callback(K),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Na.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var ea={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},Ma=e.window.HTMLImageElement,Qa=e.window.HTMLElement,di=e.window.ImageBitmap,Va=-2,Bi=22,Li=0,pn=60,Ha={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:Va,maxZoom:Bi,minPitch:Li,maxPitch:pn,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Ua=function(ve){function K(te){var me=this;if(te=e.extend({},Ha,te),te.minZoom!=null&&te.maxZoom!=null&&te.minZoom>te.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(te.minPitch!=null&&te.maxPitch!=null&&te.minPitch>te.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(te.minPitch!=null&&te.minPitch<Li)throw new Error("minPitch must be greater than or equal to "+Li);if(te.maxPitch!=null&&te.maxPitch>pn)throw new Error("maxPitch must be less than or equal to "+pn);var Ge=new Jo(te.minZoom,te.maxZoom,te.minPitch,te.maxPitch,te.renderWorldCopies);if(ve.call(this,Ge,te),this._interactive=te.interactive,this._maxTileCacheSize=te.maxTileCacheSize,this._failIfMajorPerformanceCaveat=te.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=te.preserveDrawingBuffer,this._antialias=te.antialias,this._trackResize=te.trackResize,this._bearingSnap=te.bearingSnap,this._refreshExpiredTiles=te.refreshExpiredTiles,this._fadeDuration=te.fadeDuration,this._crossSourceCollisions=te.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=te.collectResourceTiming,this._renderTaskQueue=new Na,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},ea,te.locale),this._clickTolerance=te.clickTolerance,this._requestManager=new e.RequestManager(te.transformRequest,te.accessToken),typeof te.container=="string"){if(this._container=e.window.document.getElementById(te.container),!this._container)throw new Error("Container '"+te.container+"' not found.")}else if(te.container instanceof Qa)this._container=te.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(te.maxBounds&&this.setMaxBounds(te.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return me._update(!1)}),this.on("moveend",function(){return me._update(!1)}),this.on("zoom",function(){return me._update(!0)}),typeof e.window<"u"&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1),e.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new si(this,te);var Le=typeof te.hash=="string"&&te.hash||void 0;this._hash=te.hash&&new eu(Le).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:te.center,zoom:te.zoom,bearing:te.bearing,pitch:te.pitch}),te.bounds&&(this.resize(),this.fitBounds(te.bounds,e.extend({},te.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=te.localIdeographFontFamily,te.style&&this.setStyle(te.style,{localIdeographFontFamily:te.localIdeographFontFamily}),te.attributionControl&&this.addControl(new zi({customAttribution:te.customAttribution})),this.addControl(new Ei,te.logoPosition),this.on("style.load",function(){me.transform.unmodified&&me.jumpTo(me.style.stylesheet)}),this.on("data",function($e){me._update($e.dataType==="style"),me.fire(new e.Event($e.dataType+"data",$e))}),this.on("dataloading",function($e){me.fire(new e.Event($e.dataType+"dataloading",$e))})}ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K;var _e={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return K.prototype._getMapId=function(){return this._mapId},K.prototype.addControl=function(me,Ge){if(Ge===void 0&&(me.getDefaultPosition?Ge=me.getDefaultPosition():Ge="top-right"),!me||!me.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var Le=me.onAdd(this);this._controls.push(me);var $e=this._controlPositions[Ge];return Ge.indexOf("bottom")!==-1?$e.insertBefore(Le,$e.firstChild):$e.appendChild(Le),this},K.prototype.removeControl=function(me){if(!me||!me.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var Ge=this._controls.indexOf(me);return Ge>-1&&this._controls.splice(Ge,1),me.onRemove(this),this},K.prototype.hasControl=function(me){return this._controls.indexOf(me)>-1},K.prototype.resize=function(me){var Ge=this._containerDimensions(),Le=Ge[0],$e=Ge[1];this._resizeCanvas(Le,$e),this.transform.resize(Le,$e),this.painter.resize(Le,$e);var gt=!this._moving;return gt&&(this.stop(),this.fire(new e.Event("movestart",me)).fire(new e.Event("move",me))),this.fire(new e.Event("resize",me)),gt&&this.fire(new e.Event("moveend",me)),this},K.prototype.getBounds=function(){return this.transform.getBounds()},K.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},K.prototype.setMaxBounds=function(me){return this.transform.setMaxBounds(e.LngLatBounds.convert(me)),this._update()},K.prototype.setMinZoom=function(me){if(me=me??Va,me>=Va&&me<=this.transform.maxZoom)return this.transform.minZoom=me,this._update(),this.getZoom()<me&&this.setZoom(me),this;throw new Error("minZoom must be between "+Va+" and the current maxZoom, inclusive")},K.prototype.getMinZoom=function(){return this.transform.minZoom},K.prototype.setMaxZoom=function(me){if(me=me??Bi,me>=this.transform.minZoom)return this.transform.maxZoom=me,this._update(),this.getZoom()>me&&this.setZoom(me),this;throw new Error("maxZoom must be greater than the current minZoom")},K.prototype.getMaxZoom=function(){return this.transform.maxZoom},K.prototype.setMinPitch=function(me){if(me=me??Li,me<Li)throw new Error("minPitch must be greater than or equal to "+Li);if(me>=Li&&me<=this.transform.maxPitch)return this.transform.minPitch=me,this._update(),this.getPitch()<me&&this.setPitch(me),this;throw new Error("minPitch must be between "+Li+" and the current maxPitch, inclusive")},K.prototype.getMinPitch=function(){return this.transform.minPitch},K.prototype.setMaxPitch=function(me){if(me=me??pn,me>pn)throw new Error("maxPitch must be less than or equal to "+pn);if(me>=this.transform.minPitch)return this.transform.maxPitch=me,this._update(),this.getPitch()>me&&this.setPitch(me),this;throw new Error("maxPitch must be greater than the current minPitch")},K.prototype.getMaxPitch=function(){return this.transform.maxPitch},K.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},K.prototype.setRenderWorldCopies=function(me){return this.transform.renderWorldCopies=me,this._update()},K.prototype.project=function(me){return this.transform.locationPoint(e.LngLat.convert(me))},K.prototype.unproject=function(me){return this.transform.pointLocation(e.Point.convert(me))},K.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},K.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},K.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},K.prototype._createDelegatedListener=function(me,Ge,Le){var $e=this,gt;if(me==="mouseenter"||me==="mouseover"){var jt=!1,wr=function(nr){var hr=$e.getLayer(Ge)?$e.queryRenderedFeatures(nr.point,{layers:[Ge]}):[];hr.length?jt||(jt=!0,Le.call($e,new Fe(me,$e,nr.originalEvent,{features:hr}))):jt=!1},Nr=function(){jt=!1};return{layer:Ge,listener:Le,delegates:{mousemove:wr,mouseout:Nr}}}else if(me==="mouseleave"||me==="mouseout"){var pr=!1,yt=function(nr){var hr=$e.getLayer(Ge)?$e.queryRenderedFeatures(nr.point,{layers:[Ge]}):[];hr.length?pr=!0:pr&&(pr=!1,Le.call($e,new Fe(me,$e,nr.originalEvent)))},kt=function(nr){pr&&(pr=!1,Le.call($e,new Fe(me,$e,nr.originalEvent)))};return{layer:Ge,listener:Le,delegates:{mousemove:yt,mouseout:kt}}}else{var Bt=function(nr){var hr=$e.getLayer(Ge)?$e.queryRenderedFeatures(nr.point,{layers:[Ge]}):[];hr.length&&(nr.features=hr,Le.call($e,nr),delete nr.features)};return{layer:Ge,listener:Le,delegates:(gt={},gt[me]=Bt,gt)}}},K.prototype.on=function(me,Ge,Le){if(Le===void 0)return ve.prototype.on.call(this,me,Ge);var $e=this._createDelegatedListener(me,Ge,Le);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[me]=this._delegatedListeners[me]||[],this._delegatedListeners[me].push($e);for(var gt in $e.delegates)this.on(gt,$e.delegates[gt]);return this},K.prototype.once=function(me,Ge,Le){if(Le===void 0)return ve.prototype.once.call(this,me,Ge);var $e=this._createDelegatedListener(me,Ge,Le);for(var gt in $e.delegates)this.once(gt,$e.delegates[gt]);return this},K.prototype.off=function(me,Ge,Le){var $e=this;if(Le===void 0)return ve.prototype.off.call(this,me,Ge);var gt=function(jt){for(var wr=jt[me],Nr=0;Nr<wr.length;Nr++){var pr=wr[Nr];if(pr.layer===Ge&&pr.listener===Le){for(var yt in pr.delegates)$e.off(yt,pr.delegates[yt]);return wr.splice(Nr,1),$e}}};return this._delegatedListeners&&this._delegatedListeners[me]&>(this._delegatedListeners),this},K.prototype.queryRenderedFeatures=function(me,Ge){if(!this.style)return[];Ge===void 0&&me!==void 0&&!(me instanceof e.Point)&&!Array.isArray(me)&&(Ge=me,me=void 0),Ge=Ge||{},me=me||[[0,0],[this.transform.width,this.transform.height]];var Le;if(me instanceof e.Point||typeof me[0]=="number")Le=[e.Point.convert(me)];else{var $e=e.Point.convert(me[0]),gt=e.Point.convert(me[1]);Le=[$e,new e.Point(gt.x,$e.y),gt,new e.Point($e.x,gt.y),$e]}return this.style.queryRenderedFeatures(Le,Ge,this.transform)},K.prototype.querySourceFeatures=function(me,Ge){return this.style.querySourceFeatures(me,Ge)},K.prototype.setStyle=function(me,Ge){return Ge=e.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},Ge),Ge.diff!==!1&&Ge.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&me?(this._diffStyle(me,Ge),this):(this._localIdeographFontFamily=Ge.localIdeographFontFamily,this._updateStyle(me,Ge))},K.prototype._getUIString=function(me){var Ge=this._locale[me];if(Ge==null)throw new Error("Missing UI string '"+me+"'");return Ge},K.prototype._updateStyle=function(me,Ge){if(this.style&&(this.style.setEventedParent(null),this.style._remove()),me)this.style=new Nl(this,Ge||{});else return delete this.style,this;return this.style.setEventedParent(this,{style:this.style}),typeof me=="string"?this.style.loadURL(me):this.style.loadJSON(me),this},K.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new Nl(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},K.prototype._diffStyle=function(me,Ge){var Le=this;if(typeof me=="string"){var $e=this._requestManager.normalizeStyleURL(me),gt=this._requestManager.transformRequest($e,e.ResourceType.Style);e.getJSON(gt,function(jt,wr){jt?Le.fire(new e.ErrorEvent(jt)):wr&&Le._updateDiff(wr,Ge)})}else typeof me=="object"&&this._updateDiff(me,Ge)},K.prototype._updateDiff=function(me,Ge){try{this.style.setState(me)&&this._update(!0)}catch(Le){e.warnOnce("Unable to perform style diff: "+(Le.message||Le.error||Le)+". Rebuilding the style from scratch."),this._updateStyle(me,Ge)}},K.prototype.getStyle=function(){if(this.style)return this.style.serialize()},K.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():e.warnOnce("There is no style added to the map.")},K.prototype.addSource=function(me,Ge){return this._lazyInitEmptyStyle(),this.style.addSource(me,Ge),this._update(!0)},K.prototype.isSourceLoaded=function(me){var Ge=this.style&&this.style.sourceCaches[me];if(Ge===void 0){this.fire(new e.ErrorEvent(new Error("There is no source with ID '"+me+"'")));return}return Ge.loaded()},K.prototype.areTilesLoaded=function(){var me=this.style&&this.style.sourceCaches;for(var Ge in me){var Le=me[Ge],$e=Le._tiles;for(var gt in $e){var jt=$e[gt];if(!(jt.state==="loaded"||jt.state==="errored"))return!1}}return!0},K.prototype.addSourceType=function(me,Ge,Le){return this._lazyInitEmptyStyle(),this.style.addSourceType(me,Ge,Le)},K.prototype.removeSource=function(me){return this.style.removeSource(me),this._update(!0)},K.prototype.getSource=function(me){return this.style.getSource(me)},K.prototype.addImage=function(me,Ge,Le){Le===void 0&&(Le={});var $e=Le.pixelRatio;$e===void 0&&($e=1);var gt=Le.sdf;gt===void 0&&(gt=!1);var jt=Le.stretchX,wr=Le.stretchY,Nr=Le.content;this._lazyInitEmptyStyle();var pr=0;if(Ge instanceof Ma||di&&Ge instanceof di){var yt=e.browser.getImageData(Ge),kt=yt.width,Bt=yt.height,nr=yt.data;this.style.addImage(me,{data:new e.RGBAImage({width:kt,height:Bt},nr),pixelRatio:$e,stretchX:jt,stretchY:wr,content:Nr,sdf:gt,version:pr})}else{if(Ge.width===void 0||Ge.height===void 0)return this.fire(new e.ErrorEvent(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`")));var hr=Ge.width,lr=Ge.height,dr=Ge.data,ur=Ge;this.style.addImage(me,{data:new e.RGBAImage({width:hr,height:lr},new Uint8Array(dr)),pixelRatio:$e,stretchX:jt,stretchY:wr,content:Nr,sdf:gt,version:pr,userImage:ur}),ur.onAdd&&ur.onAdd(this,me)}},K.prototype.updateImage=function(me,Ge){var Le=this.style.getImage(me);if(!Le)return this.fire(new e.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var $e=Ge instanceof Ma||di&&Ge instanceof di?e.browser.getImageData(Ge):Ge,gt=$e.width,jt=$e.height,wr=$e.data;if(gt===void 0||jt===void 0)return this.fire(new e.ErrorEvent(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(gt!==Le.data.width||jt!==Le.data.height)return this.fire(new e.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));var Nr=!(Ge instanceof Ma||di&&Ge instanceof di);Le.data.replace(wr,Nr),this.style.updateImage(me,Le)},K.prototype.hasImage=function(me){return me?!!this.style.getImage(me):(this.fire(new e.ErrorEvent(new Error("Missing required image id"))),!1)},K.prototype.removeImage=function(me){this.style.removeImage(me)},K.prototype.loadImage=function(me,Ge){e.getImage(this._requestManager.transformRequest(me,e.ResourceType.Image),Ge)},K.prototype.listImages=function(){return this.style.listImages()},K.prototype.addLayer=function(me,Ge){return this._lazyInitEmptyStyle(),this.style.addLayer(me,Ge),this._update(!0)},K.prototype.moveLayer=function(me,Ge){return this.style.moveLayer(me,Ge),this._update(!0)},K.prototype.removeLayer=function(me){return this.style.removeLayer(me),this._update(!0)},K.prototype.getLayer=function(me){return this.style.getLayer(me)},K.prototype.setLayerZoomRange=function(me,Ge,Le){return this.style.setLayerZoomRange(me,Ge,Le),this._update(!0)},K.prototype.setFilter=function(me,Ge,Le){return Le===void 0&&(Le={}),this.style.setFilter(me,Ge,Le),this._update(!0)},K.prototype.getFilter=function(me){return this.style.getFilter(me)},K.prototype.setPaintProperty=function(me,Ge,Le,$e){return $e===void 0&&($e={}),this.style.setPaintProperty(me,Ge,Le,$e),this._update(!0)},K.prototype.getPaintProperty=function(me,Ge){return this.style.getPaintProperty(me,Ge)},K.prototype.setLayoutProperty=function(me,Ge,Le,$e){return $e===void 0&&($e={}),this.style.setLayoutProperty(me,Ge,Le,$e),this._update(!0)},K.prototype.getLayoutProperty=function(me,Ge){return this.style.getLayoutProperty(me,Ge)},K.prototype.setLight=function(me,Ge){return Ge===void 0&&(Ge={}),this._lazyInitEmptyStyle(),this.style.setLight(me,Ge),this._update(!0)},K.prototype.getLight=function(){return this.style.getLight()},K.prototype.setFeatureState=function(me,Ge){return this.style.setFeatureState(me,Ge),this._update()},K.prototype.removeFeatureState=function(me,Ge){return this.style.removeFeatureState(me,Ge),this._update()},K.prototype.getFeatureState=function(me){return this.style.getFeatureState(me)},K.prototype.getContainer=function(){return this._container},K.prototype.getCanvasContainer=function(){return this._canvasContainer},K.prototype.getCanvas=function(){return this._canvas},K.prototype._containerDimensions=function(){var me=0,Ge=0;return this._container&&(me=this._container.clientWidth||400,Ge=this._container.clientHeight||300),[me,Ge]},K.prototype._detectMissingCSS=function(){var me=e.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color");me!=="rgb(250, 128, 114)"&&e.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},K.prototype._setupContainer=function(){var me=this._container;me.classList.add("mapboxgl-map");var Ge=this._missingCSSCanary=r.create("div","mapboxgl-canary",me);Ge.style.visibility="hidden",this._detectMissingCSS();var Le=this._canvasContainer=r.create("div","mapboxgl-canvas-container",me);this._interactive&&Le.classList.add("mapboxgl-interactive"),this._canvas=r.create("canvas","mapboxgl-canvas",Le),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");var $e=this._containerDimensions();this._resizeCanvas($e[0],$e[1]);var gt=this._controlContainer=r.create("div","mapboxgl-control-container",me),jt=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(wr){jt[wr]=r.create("div","mapboxgl-ctrl-"+wr,gt)}),this._container.addEventListener("scroll",this._onMapScroll,!1)},K.prototype._resizeCanvas=function(me,Ge){var Le=e.browser.devicePixelRatio||1;this._canvas.width=Le*me,this._canvas.height=Le*Ge,this._canvas.style.width=me+"px",this._canvas.style.height=Ge+"px"},K.prototype._setupPainter=function(){var me=e.extend({},t.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),Ge=this._canvas.getContext("webgl",me)||this._canvas.getContext("experimental-webgl",me);if(!Ge){this.fire(new e.ErrorEvent(new Error("Failed to initialize WebGL")));return}this.painter=new Zo(Ge,this.transform),e.webpSupported.testSupport(Ge)},K.prototype._contextLost=function(me){me.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new e.Event("webglcontextlost",{originalEvent:me}))},K.prototype._contextRestored=function(me){this._setupPainter(),this.resize(),this._update(),this.fire(new e.Event("webglcontextrestored",{originalEvent:me}))},K.prototype._onMapScroll=function(me){if(me.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},K.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},K.prototype._update=function(me){return this.style?(this._styleDirty=this._styleDirty||me,this._sourcesDirty=!0,this.triggerRepaint(),this):this},K.prototype._requestRenderFrame=function(me){return this._update(),this._renderTaskQueue.add(me)},K.prototype._cancelRenderFrame=function(me){this._renderTaskQueue.remove(me)},K.prototype._render=function(me){var Ge=this,Le,$e=0,gt=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(Le=gt.createQueryEXT(),gt.beginQueryEXT(gt.TIME_ELAPSED_EXT,Le),$e=e.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(me),!this._removed){var jt=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var wr=this.transform.zoom,Nr=e.browser.now();this.style.zoomHistory.update(wr,Nr);var pr=new e.EvaluationParameters(wr,{now:Nr,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),yt=pr.crossFadingFactor();(yt!==1||yt!==this._crossFadingFactor)&&(jt=!0,this._crossFadingFactor=yt),this.style.update(pr)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new e.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new e.Event("load"))),this.style&&(this.style.hasTransitions()||jt)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var kt=e.browser.now()-$e;gt.endQueryEXT(gt.TIME_ELAPSED_EXT,Le),setTimeout(function(){var hr=gt.getQueryObjectEXT(Le,gt.QUERY_RESULT_EXT)/1e6;gt.deleteQueryEXT(Le),Ge.fire(new e.Event("gpu-timing-frame",{cpuTime:kt,gpuTime:hr}))},50)}if(this.listens("gpu-timing-layer")){var Bt=this.painter.collectGpuTimers();setTimeout(function(){var hr=Ge.painter.queryGpuTimers(Bt);Ge.fire(new e.Event("gpu-timing-layer",{layerTimes:hr}))},50)}var nr=this._sourcesDirty||this._styleDirty||this._placementDirty;return nr||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.Event("idle")),this._loaded&&!this._fullyLoaded&&!nr&&(this._fullyLoaded=!0),this}},K.prototype.remove=function(){this._hash&&this._hash.remove();for(var me=0,Ge=this._controls;me<Ge.length;me+=1){var Le=Ge[me];Le.onRemove(this)}this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof e.window<"u"&&(e.window.removeEventListener("resize",this._onWindowResize,!1),e.window.removeEventListener("orientationchange",this._onWindowResize,!1),e.window.removeEventListener("online",this._onWindowOnline,!1));var $e=this.painter.context.gl.getExtension("WEBGL_lose_context");$e&&$e.loseContext&&$e.loseContext(),Yi(this._canvasContainer),Yi(this._controlContainer),Yi(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new e.Event("remove"))},K.prototype.triggerRepaint=function(){var me=this;this.style&&!this._frame&&(this._frame=e.browser.frame(function(Ge){me._frame=null,me._render(Ge)}))},K.prototype._onWindowOnline=function(){this._update()},K.prototype._onWindowResize=function(me){this._trackResize&&this.resize({originalEvent:me})._update()},_e.showTileBoundaries.get=function(){return!!this._showTileBoundaries},_e.showTileBoundaries.set=function(te){this._showTileBoundaries!==te&&(this._showTileBoundaries=te,this._update())},_e.showPadding.get=function(){return!!this._showPadding},_e.showPadding.set=function(te){this._showPadding!==te&&(this._showPadding=te,this._update())},_e.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},_e.showCollisionBoxes.set=function(te){this._showCollisionBoxes!==te&&(this._showCollisionBoxes=te,te?this.style._generateCollisionBoxes():this._update())},_e.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},_e.showOverdrawInspector.set=function(te){this._showOverdrawInspector!==te&&(this._showOverdrawInspector=te,this._update())},_e.repaint.get=function(){return!!this._repaint},_e.repaint.set=function(te){this._repaint!==te&&(this._repaint=te,this.triggerRepaint())},_e.vertices.get=function(){return!!this._vertices},_e.vertices.set=function(te){this._vertices=te,this._update()},K.prototype._setCacheLimits=function(me,Ge){e.setCacheLimits(me,Ge)},_e.version.get=function(){return e.version},Object.defineProperties(K.prototype,_e),K}(yn);function Yi(ve){ve.parentNode&&ve.parentNode.removeChild(ve)}var Ri={showCompass:!0,showZoom:!0,visualizePitch:!1},Ti=function(K){var _e=this;this.options=e.extend({},Ri,K),this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(te){return te.preventDefault()}),this.options.showZoom&&(e.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",function(te){return _e._map.zoomIn({},{originalEvent:te})}),r.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",function(te){return _e._map.zoomOut({},{originalEvent:te})}),r.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(e.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",function(te){_e.options.visualizePitch?_e._map.resetNorthPitch({},{originalEvent:te}):_e._map.resetNorth({},{originalEvent:te})}),this._compassIcon=r.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Ti.prototype._updateZoomButtons=function(){var K=this._map.getZoom(),_e=K===this._map.getMaxZoom(),te=K===this._map.getMinZoom();this._zoomInButton.disabled=_e,this._zoomOutButton.disabled=te,this._zoomInButton.setAttribute("aria-disabled",_e.toString()),this._zoomOutButton.setAttribute("aria-disabled",te.toString())},Ti.prototype._rotateCompassArrow=function(){var K=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=K},Ti.prototype.onAdd=function(K){return this._map=K,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 xi(this._map,this._compass,this.options.visualizePitch)),this._container},Ti.prototype.onRemove=function(){r.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},Ti.prototype._createButton=function(K,_e){var te=r.create("button",K,this._container);return te.type="button",te.addEventListener("click",_e),te},Ti.prototype._setButtonTitle=function(K,_e){var te=this._map._getUIString("NavigationControl."+_e);K.title=te,K.setAttribute("aria-label",te)};var xi=function(K,_e,te){te===void 0&&(te=!1),this._clickTolerance=10,this.element=_e,this.mouseRotate=new sn({clickTolerance:K.dragRotate._mouseRotate._clickTolerance}),this.map=K,te&&(this.mousePitch=new rn({clickTolerance:K.dragRotate._mousePitch._clickTolerance})),e.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener(_e,"mousedown",this.mousedown),r.addEventListener(_e,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(_e,"touchmove",this.touchmove),r.addEventListener(_e,"touchend",this.touchend),r.addEventListener(_e,"touchcancel",this.reset)};xi.prototype.down=function(K,_e){this.mouseRotate.mousedown(K,_e),this.mousePitch&&this.mousePitch.mousedown(K,_e),r.disableDrag()},xi.prototype.move=function(K,_e){var te=this.map,me=this.mouseRotate.mousemoveWindow(K,_e);if(me&&me.bearingDelta&&te.setBearing(te.getBearing()+me.bearingDelta),this.mousePitch){var Ge=this.mousePitch.mousemoveWindow(K,_e);Ge&&Ge.pitchDelta&&te.setPitch(te.getPitch()+Ge.pitchDelta)}},xi.prototype.off=function(){var K=this.element;r.removeEventListener(K,"mousedown",this.mousedown),r.removeEventListener(K,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(K,"touchmove",this.touchmove),r.removeEventListener(K,"touchend",this.touchend),r.removeEventListener(K,"touchcancel",this.reset),this.offTemp()},xi.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(e.window,"mousemove",this.mousemove),r.removeEventListener(e.window,"mouseup",this.mouseup)},xi.prototype.mousedown=function(K){this.down(e.extend({},K,{ctrlKey:!0,preventDefault:function(){return K.preventDefault()}}),r.mousePos(this.element,K)),r.addEventListener(e.window,"mousemove",this.mousemove),r.addEventListener(e.window,"mouseup",this.mouseup)},xi.prototype.mousemove=function(K){this.move(K,r.mousePos(this.element,K))},xi.prototype.mouseup=function(K){this.mouseRotate.mouseupWindow(K),this.mousePitch&&this.mousePitch.mouseupWindow(K),this.offTemp()},xi.prototype.touchstart=function(K){K.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,K.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return K.preventDefault()}},this._startPos))},xi.prototype.touchmove=function(K){K.targetTouches.length!==1?this.reset():(this._lastPos=r.touchPos(this.element,K.targetTouches)[0],this.move({preventDefault:function(){return K.preventDefault()}},this._lastPos))},xi.prototype.touchend=function(K){K.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},xi.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};function Xi(ve,K,_e){if(ve=new e.LngLat(ve.lng,ve.lat),K){var te=new e.LngLat(ve.lng-360,ve.lat),me=new e.LngLat(ve.lng+360,ve.lat),Ge=_e.locationPoint(ve).distSqr(K);_e.locationPoint(te).distSqr(K)<Ge?ve=te:_e.locationPoint(me).distSqr(K)<Ge&&(ve=me)}for(;Math.abs(ve.lng-_e.center.lng)>180;){var Le=_e.locationPoint(ve);if(Le.x>=0&&Le.y>=0&&Le.x<=_e.width&&Le.y<=_e.height)break;ve.lng>_e.center.lng?ve.lng-=360:ve.lng+=360}return ve}var mn={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 In(ve,K,_e){var te=ve.classList;for(var me in mn)te.remove("mapboxgl-"+_e+"-anchor-"+me);te.add("mapboxgl-"+_e+"-anchor-"+K)}var Ii=function(ve){function K(_e,te){if(ve.call(this),(_e instanceof e.window.HTMLElement||te)&&(_e=e.extend({element:_e},te)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=_e&&_e.anchor||"center",this._color=_e&&_e.color||"#3FB1CE",this._scale=_e&&_e.scale||1,this._draggable=_e&&_e.draggable||!1,this._clickTolerance=_e&&_e.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=_e&&_e.rotation||0,this._rotationAlignment=_e&&_e.rotationAlignment||"auto",this._pitchAlignment=_e&&_e.pitchAlignment&&_e.pitchAlignment!=="auto"?_e.pitchAlignment:this._rotationAlignment,!_e||!_e.element){this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var me=r.createNS("http://www.w3.org/2000/svg","svg"),Ge=41,Le=27;me.setAttributeNS(null,"display","block"),me.setAttributeNS(null,"height",Ge+"px"),me.setAttributeNS(null,"width",Le+"px"),me.setAttributeNS(null,"viewBox","0 0 "+Le+" "+Ge);var $e=r.createNS("http://www.w3.org/2000/svg","g");$e.setAttributeNS(null,"stroke","none"),$e.setAttributeNS(null,"stroke-width","1"),$e.setAttributeNS(null,"fill","none"),$e.setAttributeNS(null,"fill-rule","evenodd");var gt=r.createNS("http://www.w3.org/2000/svg","g");gt.setAttributeNS(null,"fill-rule","nonzero");var jt=r.createNS("http://www.w3.org/2000/svg","g");jt.setAttributeNS(null,"transform","translate(3.0, 29.0)"),jt.setAttributeNS(null,"fill","#000000");for(var wr=[{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"}],Nr=0,pr=wr;Nr<pr.length;Nr+=1){var yt=pr[Nr],kt=r.createNS("http://www.w3.org/2000/svg","ellipse");kt.setAttributeNS(null,"opacity","0.04"),kt.setAttributeNS(null,"cx","10.5"),kt.setAttributeNS(null,"cy","5.80029008"),kt.setAttributeNS(null,"rx",yt.rx),kt.setAttributeNS(null,"ry",yt.ry),jt.appendChild(kt)}var Bt=r.createNS("http://www.w3.org/2000/svg","g");Bt.setAttributeNS(null,"fill",this._color);var nr=r.createNS("http://www.w3.org/2000/svg","path");nr.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"),Bt.appendChild(nr);var hr=r.createNS("http://www.w3.org/2000/svg","g");hr.setAttributeNS(null,"opacity","0.25"),hr.setAttributeNS(null,"fill","#000000");var lr=r.createNS("http://www.w3.org/2000/svg","path");lr.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"),hr.appendChild(lr);var dr=r.createNS("http://www.w3.org/2000/svg","g");dr.setAttributeNS(null,"transform","translate(6.0, 7.0)"),dr.setAttributeNS(null,"fill","#FFFFFF");var ur=r.createNS("http://www.w3.org/2000/svg","g");ur.setAttributeNS(null,"transform","translate(8.0, 8.0)");var Ht=r.createNS("http://www.w3.org/2000/svg","circle");Ht.setAttributeNS(null,"fill","#000000"),Ht.setAttributeNS(null,"opacity","0.25"),Ht.setAttributeNS(null,"cx","5.5"),Ht.setAttributeNS(null,"cy","5.5"),Ht.setAttributeNS(null,"r","5.4999962");var sr=r.createNS("http://www.w3.org/2000/svg","circle");sr.setAttributeNS(null,"fill","#FFFFFF"),sr.setAttributeNS(null,"cx","5.5"),sr.setAttributeNS(null,"cy","5.5"),sr.setAttributeNS(null,"r","5.4999962"),ur.appendChild(Ht),ur.appendChild(sr),gt.appendChild(jt),gt.appendChild(Bt),gt.appendChild(hr),gt.appendChild(dr),gt.appendChild(ur),me.appendChild(gt),me.setAttributeNS(null,"height",Ge*this._scale+"px"),me.setAttributeNS(null,"width",Le*this._scale+"px"),this._element.appendChild(me),this._offset=e.Point.convert(_e&&_e.offset||[0,-14])}else this._element=_e.element,this._offset=e.Point.convert(_e&&_e.offset||[0,0]);this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",function(Vt){Vt.preventDefault()}),this._element.addEventListener("mousedown",function(Vt){Vt.preventDefault()}),In(this._element,this._anchor,"marker"),this._popup=null}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.addTo=function(te){return this.remove(),this._map=te,te.getCanvasContainer().appendChild(this._element),te.on("move",this._update),te.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},K.prototype.remove=function(){return 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),r.remove(this._element),this._popup&&this._popup.remove(),this},K.prototype.getLngLat=function(){return this._lngLat},K.prototype.setLngLat=function(te){return this._lngLat=e.LngLat.convert(te),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},K.prototype.getElement=function(){return this._element},K.prototype.setPopup=function(te){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),te){if(!("offset"in te.options)){var me=38.1,Ge=13.5,Le=Math.sqrt(Math.pow(Ge,2)/2);te.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-me],"bottom-left":[Le,(me-Ge+Le)*-1],"bottom-right":[-Le,(me-Ge+Le)*-1],left:[Ge,(me-Ge)*-1],right:[-Ge,(me-Ge)*-1]}:this._offset}this._popup=te,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},K.prototype._onKeyPress=function(te){var me=te.code,Ge=te.charCode||te.keyCode;(me==="Space"||me==="Enter"||Ge===32||Ge===13)&&this.togglePopup()},K.prototype._onMapClick=function(te){var me=te.originalEvent.target,Ge=this._element;this._popup&&(me===Ge||Ge.contains(me))&&this.togglePopup()},K.prototype.getPopup=function(){return this._popup},K.prototype.togglePopup=function(){var te=this._popup;if(te)te.isOpen()?te.remove():te.addTo(this._map);else return this;return this},K.prototype._update=function(te){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Xi(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var me="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?me="rotateZ("+this._rotation+"deg)":this._rotationAlignment==="map"&&(me="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var Ge="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?Ge="rotateX(0deg)":this._pitchAlignment==="map"&&(Ge="rotateX("+this._map.getPitch()+"deg)"),(!te||te.type==="moveend")&&(this._pos=this._pos.round()),r.setTransform(this._element,mn[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+Ge+" "+me)}},K.prototype.getOffset=function(){return this._offset},K.prototype.setOffset=function(te){return this._offset=e.Point.convert(te),this._update(),this},K.prototype._onMove=function(te){if(!this._isDragging){var me=this._clickTolerance||this._map._clickTolerance;this._isDragging=te.point.dist(this._pointerdownPos)>=me}this._isDragging&&(this._pos=te.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 e.Event("dragstart"))),this.fire(new e.Event("drag")))},K.prototype._onUp=function(){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 e.Event("dragend")),this._state="inactive"},K.prototype._addDragHandler=function(te){this._element.contains(te.originalEvent.target)&&(te.preventDefault(),this._positionDelta=te.point.sub(this._pos).add(this._offset),this._pointerdownPos=te.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))},K.prototype.setDraggable=function(te){return this._draggable=!!te,this._map&&(te?(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},K.prototype.isDraggable=function(){return this._draggable},K.prototype.setRotation=function(te){return this._rotation=te||0,this._update(),this},K.prototype.getRotation=function(){return this._rotation},K.prototype.setRotationAlignment=function(te){return this._rotationAlignment=te||"auto",this._update(),this},K.prototype.getRotationAlignment=function(){return this._rotationAlignment},K.prototype.setPitchAlignment=function(te){return this._pitchAlignment=te&&te!=="auto"?te:this._rotationAlignment,this._update(),this},K.prototype.getPitchAlignment=function(){return this._pitchAlignment},K}(e.Evented),an={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},kn;function Dn(ve){kn!==void 0?ve(kn):e.window.navigator.permissions!==void 0?e.window.navigator.permissions.query({name:"geolocation"}).then(function(K){kn=K.state!=="denied",ve(kn)}):(kn=!!e.window.navigator.geolocation,ve(kn))}var Zn=0,Ds=!1,bl=function(ve){function K(_e){ve.call(this),this.options=e.extend({},an,_e),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.onAdd=function(te){return this._map=te,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),Dn(this._setupUI),this._container},K.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(e.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(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Zn=0,Ds=!1},K.prototype._isOutOfMapMaxBounds=function(te){var me=this._map.getMaxBounds(),Ge=te.coords;return me&&(Ge.longitude<me.getWest()||Ge.longitude>me.getEast()||Ge.latitude<me.getSouth()||Ge.latitude>me.getNorth())},K.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break}},K.prototype._onSuccess=function(te){if(this._map){if(this._isOutOfMapMaxBounds(te)){this._setErrorState(),this.fire(new e.Event("outofmaxbounds",te)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=te,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(te),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(te),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",te)),this._finish()}},K.prototype._updateCamera=function(te){var me=new e.LngLat(te.coords.longitude,te.coords.latitude),Ge=te.coords.accuracy,Le=this._map.getBearing(),$e=e.extend({bearing:Le},this.options.fitBoundsOptions);this._map.fitBounds(me.toBounds(Ge),$e,{geolocateSource:!0})},K.prototype._updateMarker=function(te){if(te){var me=new e.LngLat(te.coords.longitude,te.coords.latitude);this._accuracyCircleMarker.setLngLat(me).addTo(this._map),this._userLocationDotMarker.setLngLat(me).addTo(this._map),this._accuracy=te.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},K.prototype._updateCircleRadius=function(){var te=this._map._container.clientHeight/2,me=this._map.unproject([0,te]),Ge=this._map.unproject([1,te]),Le=me.distanceTo(Ge),$e=Math.ceil(2*this._accuracy/Le);this._circleElement.style.width=$e+"px",this._circleElement.style.height=$e+"px"},K.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},K.prototype._onError=function(te){if(this._map){if(this.options.trackUserLocation)if(te.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var me=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=me,this._geolocateButton.setAttribute("aria-label",me),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(te.code===3&&Ds)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",te)),this._finish()}},K.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},K.prototype._setupUI=function(te){var me=this;if(this._container.addEventListener("contextmenu",function($e){return $e.preventDefault()}),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",te===!1){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var Ge=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=Ge,this._geolocateButton.setAttribute("aria-label",Ge)}else{var Le=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=Le,this._geolocateButton.setAttribute("aria-label",Le)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Ii(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ii({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function($e){var gt=$e.originalEvent&&$e.originalEvent.type==="resize";!$e.geolocateSource&&me._watchState==="ACTIVE_LOCK"&&!gt&&(me._watchState="BACKGROUND",me._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),me._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),me.fire(new e.Event("trackuserlocationend")))})},K.prototype.trigger=function(){if(!this._setup)return e.warnOnce("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 e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Zn--,Ds=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event("trackuserlocationstart"));break}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");break}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Zn++;var te;Zn>1?(te={maximumAge:6e5,timeout:0},Ds=!0):(te=this.options.positionOptions,Ds=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,te)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},K.prototype._clearWatch=function(){e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},K}(e.Evented),po={maxWidth:100,unit:"metric"},Wl=function(K){this.options=e.extend({},po,K),e.bindAll(["_onMove","setUnit"],this)};Wl.prototype.getDefaultPosition=function(){return"bottom-left"},Wl.prototype._onMove=function(){fs(this._map,this._container,this.options)},Wl.prototype.onAdd=function(K){return this._map=K,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",K.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Wl.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Wl.prototype.setUnit=function(K){this.options.unit=K,fs(this._map,this._container,this.options)};function fs(ve,K,_e){var te=_e&&_e.maxWidth||100,me=ve._container.clientHeight/2,Ge=ve.unproject([0,me]),Le=ve.unproject([te,me]),$e=Ge.distanceTo(Le);if(_e&&_e.unit==="imperial"){var gt=3.2808*$e;if(gt>5280){var jt=gt/5280;Sl(K,te,jt,ve._getUIString("ScaleControl.Miles"))}else Sl(K,te,gt,ve._getUIString("ScaleControl.Feet"))}else if(_e&&_e.unit==="nautical"){var wr=$e/1852;Sl(K,te,wr,ve._getUIString("ScaleControl.NauticalMiles"))}else $e>=1e3?Sl(K,te,$e/1e3,ve._getUIString("ScaleControl.Kilometers")):Sl(K,te,$e,ve._getUIString("ScaleControl.Meters"))}function Sl(ve,K,_e,te){var me=tu(_e),Ge=me/_e;ve.style.width=K*Ge+"px",ve.innerHTML=me+" "+te}function kl(ve){var K=Math.pow(10,Math.ceil(-Math.log(ve)/Math.LN10));return Math.round(ve*K)/K}function tu(ve){var K=Math.pow(10,(""+Math.floor(ve)).length-1),_e=ve/K;return _e=_e>=10?10:_e>=5?5:_e>=3?3:_e>=2?2:_e>=1?1:kl(_e),K*_e}var qs=function(K){this._fullscreen=!1,K&&K.container&&(K.container instanceof e.window.HTMLElement?this._container=K.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in e.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in e.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in e.window.document&&(this._fullscreenchange="MSFullscreenChange")};qs.prototype.onAdd=function(K){return this._map=K,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},qs.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},qs.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},qs.prototype._setupUI=function(){var K=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",K).setAttribute("aria-hidden",!0),K.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},qs.prototype._updateTitle=function(){var K=this._getTitle();this._fullscreenButton.setAttribute("aria-label",K),this._fullscreenButton.title=K},qs.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},qs.prototype._isFullscreen=function(){return this._fullscreen},qs.prototype._changeIcon=function(){var K=e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement;K===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},qs.prototype._onClickFullscreen=function(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.mozCancelFullScreen?e.window.document.mozCancelFullScreen():e.window.document.msExitFullscreen?e.window.document.msExitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var pl={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},wl=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Yn=function(ve){function K(_e){ve.call(this),this.options=e.extend(Object.create(pl),_e),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.addTo=function(te){return this._map&&this.remove(),this._map=te,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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new e.Event("open")),this},K.prototype.isOpen=function(){return!!this._map},K.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.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),delete this._map),this.fire(new e.Event("close")),this},K.prototype.getLngLat=function(){return this._lngLat},K.prototype.setLngLat=function(te){return this._lngLat=e.LngLat.convert(te),this._pos=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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},K.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},K.prototype.getElement=function(){return this._container},K.prototype.setText=function(te){return this.setDOMContent(e.window.document.createTextNode(te))},K.prototype.setHTML=function(te){var me=e.window.document.createDocumentFragment(),Ge=e.window.document.createElement("body"),Le;for(Ge.innerHTML=te;Le=Ge.firstChild,!!Le;)me.appendChild(Le);return this.setDOMContent(me)},K.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},K.prototype.setMaxWidth=function(te){return this.options.maxWidth=te,this._update(),this},K.prototype.setDOMContent=function(te){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(te),this._createCloseButton(),this._update(),this._focusFirstElement(),this},K.prototype.addClassName=function(te){this._container&&this._container.classList.add(te)},K.prototype.removeClassName=function(te){this._container&&this._container.classList.remove(te)},K.prototype.setOffset=function(te){return this.options.offset=te,this._update(),this},K.prototype.toggleClassName=function(te){if(this._container)return this._container.classList.toggle(te)},K.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-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))},K.prototype._onMouseUp=function(te){this._update(te.point)},K.prototype._onMouseMove=function(te){this._update(te.point)},K.prototype._onDrag=function(te){this._update(te.point)},K.prototype._update=function(te){var me=this,Ge=this._lngLat||this._trackPointer;if(!(!this._map||!Ge||!this._content)&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(yt){return me._container.classList.add(yt)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Xi(this._lngLat,this._pos,this._map.transform)),!(this._trackPointer&&!te))){var Le=this._pos=this._trackPointer&&te?te:this._map.project(this._lngLat),$e=this.options.anchor,gt=Cl(this.options.offset);if(!$e){var jt=this._container.offsetWidth,wr=this._container.offsetHeight,Nr;Le.y+gt.bottom.y<wr?Nr=["top"]:Le.y>this._map.transform.height-wr?Nr=["bottom"]:Nr=[],Le.x<jt/2?Nr.push("left"):Le.x>this._map.transform.width-jt/2&&Nr.push("right"),Nr.length===0?$e="bottom":$e=Nr.join("-")}var pr=Le.add(gt[$e]).round();r.setTransform(this._container,mn[$e]+" translate("+pr.x+"px,"+pr.y+"px)"),In(this._container,$e,"popup")}},K.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var te=this._container.querySelector(wl);te&&te.focus()}},K.prototype._onClose=function(){this.remove()},K}(e.Evented);function Cl(ve){if(ve)if(typeof ve=="number"){var K=Math.round(Math.sqrt(.5*Math.pow(ve,2)));return{center:new e.Point(0,0),top:new e.Point(0,ve),"top-left":new e.Point(K,K),"top-right":new e.Point(-K,K),bottom:new e.Point(0,-ve),"bottom-left":new e.Point(K,-K),"bottom-right":new e.Point(-K,-K),left:new e.Point(ve,0),right:new e.Point(-ve,0)}}else if(ve instanceof e.Point||Array.isArray(ve)){var _e=e.Point.convert(ve);return{center:_e,top:_e,"top-left":_e,"top-right":_e,bottom:_e,"bottom-left":_e,"bottom-right":_e,left:_e,right:_e}}else return{center:e.Point.convert(ve.center||[0,0]),top:e.Point.convert(ve.top||[0,0]),"top-left":e.Point.convert(ve["top-left"]||[0,0]),"top-right":e.Point.convert(ve["top-right"]||[0,0]),bottom:e.Point.convert(ve.bottom||[0,0]),"bottom-left":e.Point.convert(ve["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(ve["bottom-right"]||[0,0]),left:e.Point.convert(ve.left||[0,0]),right:e.Point.convert(ve.right||[0,0])};else return Cl(new e.Point(0,0))}var Co={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:Ua,NavigationControl:Ti,GeolocateControl:bl,AttributionControl:zi,ScaleControl:Wl,FullscreenControl:qs,Popup:Yn,Marker:Ii,Style:Nl,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:on,clearPrewarmedResources:hn,get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(ve){e.config.ACCESS_TOKEN=ve},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(ve){e.config.API_URL=ve},get workerCount(){return ri.workerCount},set workerCount(ve){ri.workerCount=ve},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(ve){e.config.MAX_PARALLEL_IMAGE_REQUESTS=ve},clearStorage:function(K){e.clearTileCache(K)},workerUrl:""};return Co}),S})}}),gV=Xe({"src/plots/mapbox/layers.js"(Z,G){"use strict";var v=sa(),x=ou().sanitizeHTML,S=E6(),E=im();function e(n,i){this.subplot=n,this.uid=n.uid+"-"+i,this.index=i,this.idSource="source-"+this.uid,this.idLayer=E.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var t=e.prototype;t.update=function(i){this.visible?this.needsNewImage(i)?this.updateImage(i):this.needsNewSource(i)?(this.removeLayer(),this.updateSource(i),this.updateLayer(i)):this.needsNewLayer(i)?this.updateLayer(i):this.updateStyle(i):(this.updateSource(i),this.updateLayer(i)),this.visible=r(i)},t.needsNewImage=function(n){var i=this.subplot.map;return i.getSource(this.idSource)&&this.sourceType==="image"&&n.sourcetype==="image"&&(this.source!==n.source||JSON.stringify(this.coordinates)!==JSON.stringify(n.coordinates))},t.needsNewSource=function(n){return this.sourceType!==n.sourcetype||JSON.stringify(this.source)!==JSON.stringify(n.source)||this.layerType!==n.type},t.needsNewLayer=function(n){return this.layerType!==n.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(n){var i=this.subplot.map;i.getSource(this.idSource).updateImage({url:n.source,coordinates:n.coordinates});var s=this.findFollowingMapboxLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(n){var i=this.subplot.map;if(i.getSource(this.idSource)&&i.removeSource(this.idSource),this.sourceType=n.sourcetype,this.source=n.source,!!r(n)){var s=a(n);i.addSource(this.idSource,s)}},t.findFollowingMapboxLayerId=function(n){if(n==="traces")for(var i=this.subplot.getMapLayers(),s=0;s<i.length;s++){var h=i[s].id;if(typeof h=="string"&&h.indexOf(E.traceLayerPrefix)===0){n=h;break}}return n},t.updateLayer=function(n){var i=this.subplot,s=o(n),h=this.lookupBelow(),c=this.findFollowingMapboxLayerId(h);this.removeLayer(),r(n)&&i.addLayer({id:this.idLayer,source:this.idSource,"source-layer":n.sourcelayer||"",type:n.type,minzoom:n.minzoom,maxzoom:n.maxzoom,layout:s.layout,paint:s.paint},c),this.layerType=n.type,this.below=h},t.updateStyle=function(n){if(r(n)){var i=o(n);this.subplot.setOptions(this.idLayer,"setLayoutProperty",i.layout),this.subplot.setOptions(this.idLayer,"setPaintProperty",i.paint)}},t.removeLayer=function(){var n=this.subplot.map;n.getLayer(this.idLayer)&&n.removeLayer(this.idLayer)},t.dispose=function(){var n=this.subplot.map;n.getLayer(this.idLayer)&&n.removeLayer(this.idLayer),n.getSource(this.idSource)&&n.removeSource(this.idSource)};function r(n){if(!n.visible)return!1;var i=n.source;if(Array.isArray(i)&&i.length>0){for(var s=0;s<i.length;s++)if(typeof i[s]!="string"||i[s].length===0)return!1;return!0}return v.isPlainObject(i)||typeof i=="string"&&i.length>0}function o(n){var i={},s={};switch(n.type){case"circle":v.extendFlat(s,{"circle-radius":n.circle.radius,"circle-color":n.color,"circle-opacity":n.opacity});break;case"line":v.extendFlat(s,{"line-width":n.line.width,"line-color":n.color,"line-opacity":n.opacity,"line-dasharray":n.line.dash});break;case"fill":v.extendFlat(s,{"fill-color":n.color,"fill-outline-color":n.fill.outlinecolor,"fill-opacity":n.opacity});break;case"symbol":var h=n.symbol,c=S(h.textposition,h.iconsize);v.extendFlat(i,{"icon-image":h.icon+"-15","icon-size":h.iconsize/10,"text-field":h.text,"text-size":h.textfont.size,"text-anchor":c.anchor,"text-offset":c.offset,"symbol-placement":h.placement}),v.extendFlat(s,{"icon-color":n.color,"text-color":h.textfont.color,"text-opacity":n.opacity});break;case"raster":v.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":n.opacity});break}return{layout:i,paint:s}}function a(n){var i=n.sourcetype,s=n.source,h={type:i},c;return i==="geojson"?c="data":i==="vector"?c=typeof s=="string"?"url":"tiles":i==="raster"?(c="tiles",h.tileSize=256):i==="image"&&(c="url",h.coordinates=n.coordinates),h[c]=s,n.sourceattribution&&(h.attribution=x(n.sourceattribution)),h}G.exports=function(i,s,h){var c=new e(i,s);return c.update(h),c}}}),yV=Xe({"src/plots/mapbox/mapbox.js"(Z,G){"use strict";var v=k6(),x=sa(),S=g0(),E=so(),e=Go(),t=Ap(),r=rf(),o=Jd(),a=o.drawMode,n=o.selectMode,i=Af().prepSelect,s=Af().clearOutline,h=Af().clearSelectionsCache,c=Af().selectOnClick,m=im(),p=gV();function T(g,b){this.id=b,this.gd=g;var d=g._fullLayout,u=g._context;this.container=d._glcontainer.node(),this.isStatic=u.staticPlot,this.uid=d._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(d),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=T.prototype;l.plot=function(g,b,d){var u=this,y=b[u.id];u.map&&y.accesstoken!==u.accessToken&&(u.map.remove(),u.map=null,u.styleObj=null,u.traceHash={},u.layerList=[]);var f;u.map?f=new Promise(function(R,L){u.updateMap(g,b,R,L)}):f=new Promise(function(R,L){u.createMap(g,b,R,L)}),d.push(f)},l.createMap=function(g,b,d,u){var y=this,f=b[y.id],R=y.styleObj=w(f.style,b);y.accessToken=f.accesstoken;var L=f.bounds,z=L?[[L.west,L.south],[L.east,L.north]]:null,F=y.map=new v.Map({container:y.div,style:R.style,center:M(f.center),zoom:f.zoom,bearing:f.bearing,pitch:f.pitch,maxBounds:z,interactive:!y.isStatic,preserveDrawingBuffer:y.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new v.AttributionControl({compact:!0}));F._canvas.style.left="0px",F._canvas.style.top="0px",y.rejectOnError(u),y.isStatic||y.initFx(g,b);var N=[];N.push(new Promise(function(O){F.once("load",O)})),N=N.concat(S.fetchTraceGeoData(g)),Promise.all(N).then(function(){y.fillBelowLookup(g,b),y.updateData(g),y.updateLayout(b),y.resolveOnRender(d)}).catch(u)},l.updateMap=function(g,b,d,u){var y=this,f=y.map,R=b[this.id];y.rejectOnError(u);var L=[],z=w(R.style,b);JSON.stringify(y.styleObj)!==JSON.stringify(z)&&(y.styleObj=z,f.setStyle(z.style),y.traceHash={},L.push(new Promise(function(F){f.once("styledata",F)}))),L=L.concat(S.fetchTraceGeoData(g)),Promise.all(L).then(function(){y.fillBelowLookup(g,b),y.updateData(g),y.updateLayout(b),y.resolveOnRender(d)}).catch(u)},l.fillBelowLookup=function(g,b){var d=b[this.id],u=d.layers,y,f,R=this.belowLookup={},L=!1;for(y=0;y<g.length;y++){var z=g[y][0].trace,F=z._module;typeof z.below=="string"?f=z.below:F.getBelow&&(f=F.getBelow(z,this)),f===""&&(L=!0),R["trace-"+z.uid]=f||""}for(y=0;y<u.length;y++){var N=u[y];typeof N.below=="string"?f=N.below:L?f="traces":f="",R["layout-"+y]=f}var O={},P,U;for(P in R)f=R[P],O[f]?O[f].push(P):O[f]=[P];for(f in O){var B=O[f];if(B.length>1)for(y=0;y<B.length;y++)P=B[y],P.indexOf("trace-")===0?(U=P.split("trace-")[1],this.traceHash[U]&&(this.traceHash[U].below=null)):P.indexOf("layout-")===0&&(U=P.split("layout-")[1],this.layerList[U]&&(this.layerList[U].below=null))}};var _={choroplethmapbox:0,densitymapbox:1,scattermapbox:2};l.updateData=function(g){var b=this.traceHash,d,u,y,f,R=g.slice().sort(function(O,P){return _[O[0].trace.type]-_[P[0].trace.type]});for(y=0;y<R.length;y++){var L=R[y];u=L[0].trace,d=b[u.uid];var z=!1;d&&(d.type===u.type?(d.update(L),z=!0):d.dispose()),!z&&u._module&&(b[u.uid]=u._module.plot(this,L))}var F=Object.keys(b);e:for(y=0;y<F.length;y++){var N=F[y];for(f=0;f<g.length;f++)if(u=g[f][0].trace,N===u.uid)continue e;d=b[N],d.dispose(),delete b[N]}},l.updateLayout=function(g){var b=this.map,d=g[this.id];!this.dragging&&!this.wheeling&&(b.setCenter(M(d.center)),b.setZoom(d.zoom),b.setBearing(d.bearing),b.setPitch(d.pitch)),this.updateLayers(g),this.updateFramework(g),this.updateFx(g),this.map.resize(),this.gd._context._scrollZoom.mapbox?b.scrollZoom.enable():b.scrollZoom.disable()},l.resolveOnRender=function(g){var b=this.map;b.on("render",function d(){b.loaded()&&(b.off("render",d),setTimeout(g,10))})},l.rejectOnError=function(g){var b=this.map;function d(){g(new Error(m.mapOnErrorMsg))}b.once("error",d),b.once("style.error",d),b.once("source.error",d),b.once("tile.error",d),b.once("layer.error",d)},l.createFramework=function(g){var b=this,d=b.div=document.createElement("div");d.id=b.uid,d.style.position="absolute",b.container.appendChild(d),b.xaxis={_id:"x",c2p:function(u){return b.project(u).x}},b.yaxis={_id:"y",c2p:function(u){return b.project(u).y}},b.updateFramework(g),b.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},e.setConvert(b.mockAxis,g)},l.initFx=function(g,b){var d=this,u=d.gd,y=d.map;y.on("moveend",function(L){if(d.map){var z=u._fullLayout;if(L.originalEvent||d.wheeling){var F=z[d.id];E.call("_storeDirectGUIEdit",u.layout,z._preGUI,d.getViewEdits(F));var N=d.getView();F._input.center=F.center=N.center,F._input.zoom=F.zoom=N.zoom,F._input.bearing=F.bearing=N.bearing,F._input.pitch=F.pitch=N.pitch,u.emit("plotly_relayout",d.getViewEditsWithDerived(N))}L.originalEvent&&L.originalEvent.type==="mouseup"?d.dragging=!1:d.wheeling&&(d.wheeling=!1),z._rehover&&z._rehover()}}),y.on("wheel",function(){d.wheeling=!0}),y.on("mousemove",function(L){var z=d.div.getBoundingClientRect(),F=[L.originalEvent.offsetX,L.originalEvent.offsetY];L.target.getBoundingClientRect=function(){return z},d.xaxis.p2c=function(){return y.unproject(F).lng},d.yaxis.p2c=function(){return y.unproject(F).lat},u._fullLayout._rehover=function(){u._fullLayout._hoversubplot===d.id&&u._fullLayout[d.id]&&r.hover(u,L,d.id)},r.hover(u,L,d.id),u._fullLayout._hoversubplot=d.id});function f(){r.loneUnhover(b._hoverlayer)}y.on("dragstart",function(){d.dragging=!0,f()}),y.on("zoomstart",f),y.on("mouseout",function(){u._fullLayout._hoversubplot=null});function R(){var L=d.getView();u.emit("plotly_relayouting",d.getViewEditsWithDerived(L))}y.on("drag",R),y.on("zoom",R),y.on("dblclick",function(){var L=u._fullLayout[d.id];E.call("_storeDirectGUIEdit",u.layout,u._fullLayout._preGUI,d.getViewEdits(L));var z=d.viewInitial;y.setCenter(M(z.center)),y.setZoom(z.zoom),y.setBearing(z.bearing),y.setPitch(z.pitch);var F=d.getView();L._input.center=L.center=F.center,L._input.zoom=L.zoom=F.zoom,L._input.bearing=L.bearing=F.bearing,L._input.pitch=L.pitch=F.pitch,u.emit("plotly_doubleclick",null),u.emit("plotly_relayout",d.getViewEditsWithDerived(F))}),d.clearOutline=function(){h(d.dragOptions),s(d.dragOptions.gd)},d.onClickInPanFn=function(L){return function(z){var F=u._fullLayout.clickmode;F.indexOf("select")>-1&&c(z.originalEvent,u,[d.xaxis],[d.yaxis],d.id,L),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(g){var b=this,d=b.map,u=b.gd;if(b.isStatic)return;function y(z){var F=b.map.unproject(z);return[F.lng,F.lat]}var f=g.dragmode,R;R=function(z,F){if(F.isRect){var N=z.range={};N[b.id]=[y([F.xmin,F.ymin]),y([F.xmax,F.ymax])]}else{var O=z.lassoPoints={};O[b.id]=F.map(y)}};var L=b.dragOptions;b.dragOptions=x.extendDeep(L||{},{dragmode:g.dragmode,element:b.div,gd:u,plotinfo:{id:b.id,domain:g[b.id].domain,xaxis:b.xaxis,yaxis:b.yaxis,fillRangeItems:R},xaxes:[b.xaxis],yaxes:[b.yaxis],subplot:b.id}),d.off("click",b.onClickInPanHandler),n(f)||a(f)?(d.dragPan.disable(),d.on("zoomstart",b.clearOutline),b.dragOptions.prepFn=function(z,F,N){i(z,F,N,b.dragOptions,f)},t.init(b.dragOptions)):(d.dragPan.enable(),d.off("zoomstart",b.clearOutline),b.div.onmousedown=null,b.div.ontouchstart=null,b.div.removeEventListener("touchstart",b.div._ontouchstart),b.onClickInPanHandler=b.onClickInPanFn(b.dragOptions),d.on("click",b.onClickInPanHandler))},l.updateFramework=function(g){var b=g[this.id].domain,d=g._size,u=this.div.style;u.width=d.w*(b.x[1]-b.x[0])+"px",u.height=d.h*(b.y[1]-b.y[0])+"px",u.left=d.l+b.x[0]*d.w+"px",u.top=d.t+(1-b.y[1])*d.h+"px",this.xaxis._offset=d.l+b.x[0]*d.w,this.xaxis._length=d.w*(b.x[1]-b.x[0]),this.yaxis._offset=d.t+(1-b.y[1])*d.h,this.yaxis._length=d.h*(b.y[1]-b.y[0])},l.updateLayers=function(g){var b=g[this.id],d=b.layers,u=this.layerList,y;if(d.length!==u.length){for(y=0;y<u.length;y++)u[y].dispose();for(u=this.layerList=[],y=0;y<d.length;y++)u.push(p(this,y,d[y]))}else for(y=0;y<d.length;y++)u[y].update(d[y])},l.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},l.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},l.setOptions=function(g,b,d){for(var u in d)this.map[b](g,u,d[u])},l.getMapLayers=function(){return this.map.getStyle().layers},l.addLayer=function(g,b){var d=this.map;if(typeof b=="string"){if(b===""){d.addLayer(g,b);return}for(var u=this.getMapLayers(),y=0;y<u.length;y++)if(b===u[y].id){d.addLayer(g,b);return}x.warn(["Trying to add layer with *below* value",b,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}d.addLayer(g)},l.project=function(g){return this.map.project(new v.LngLat(g[0],g[1]))},l.getView=function(){var g=this.map,b=g.getCenter(),d=b.lng,u=b.lat,y={lon:d,lat:u},f=g.getCanvas(),R=parseInt(f.style.width),L=parseInt(f.style.height);return{center:y,zoom:g.getZoom(),bearing:g.getBearing(),pitch:g.getPitch(),_derived:{coordinates:[g.unproject([0,0]).toArray(),g.unproject([R,0]).toArray(),g.unproject([R,L]).toArray(),g.unproject([0,L]).toArray()]}}},l.getViewEdits=function(g){for(var b=this.id,d=["center","zoom","bearing","pitch"],u={},y=0;y<d.length;y++){var f=d[y];u[b+"."+f]=g[f]}return u},l.getViewEditsWithDerived=function(g){var b=this.id,d=this.getViewEdits(g);return d[b+"._derived"]=g._derived,d};function w(g,b){var d={};if(x.isPlainObject(g))d.id=g.id,d.style=g;else if(typeof g=="string")if(d.id=g,m.styleValuesMapbox.indexOf(g)!==-1)d.style=A(g);else if(m.stylesNonMapbox[g]){d.style=m.stylesNonMapbox[g];var u=d.style.sources["plotly-"+g],y=u?u.tiles:void 0;y&&y[0]&&y[0].slice(-9)==="?api_key="&&(y[0]+=b._mapboxAccessToken)}else d.style=g;else d.id=m.styleValueDflt,d.style=A(m.styleValueDflt);return d.transition={duration:0,delay:0},d}function A(g){return m.styleUrlPrefix+g+"-"+m.styleUrlSuffix}function M(g){return[g.lon,g.lat]}G.exports=T}}),_V=Xe({"src/plots/mapbox/layout_defaults.js"(Z,G){"use strict";var v=sa(),x=o0(),S=hp(),E=Ex();G.exports=function(o,a,n){x(o,a,n,{type:"mapbox",attributes:E,handleDefaults:e,partition:"y",accessToken:a._mapboxAccessToken})};function e(r,o,a,n){a("accesstoken",n.accessToken),a("style"),a("center.lon"),a("center.lat"),a("zoom"),a("bearing"),a("pitch");var i=a("bounds.west"),s=a("bounds.east"),h=a("bounds.south"),c=a("bounds.north");(i===void 0||s===void 0||h===void 0||c===void 0)&&delete o.bounds,S(r,o,{name:"layers",handleItemDefaults:t}),o._input=r}function t(r,o){function a(m,p){return v.coerce(r,o,E.layers,m,p)}var n=a("visible");if(n){var i=a("sourcetype"),s=i==="raster"||i==="image";a("source"),a("sourceattribution"),i==="vector"&&a("sourcelayer"),i==="image"&&a("coordinates");var h;s&&(h="raster");var c=a("type",h);s&&c!=="raster"&&(c=o.type="raster",v.log("Source types *raster* and *image* must drawn *raster* layer type.")),a("below"),a("color"),a("opacity"),a("minzoom"),a("maxzoom"),c==="circle"&&a("circle.radius"),c==="line"&&(a("line.width"),a("line.dash")),c==="fill"&&a("fill.outlinecolor"),c==="symbol"&&(a("symbol.icon"),a("symbol.iconsize"),a("symbol.text"),v.coerceFont(a,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),a("symbol.textposition"),a("symbol.placement"))}}}}),MT=Xe({"src/plots/mapbox/index.js"(Z){"use strict";var G=k6(),v=sa(),x=v.strTranslate,S=v.strScale,E=Hh().getSubplotCalcData,e=vd(),t=Hn(),r=es(),o=ou(),a=yV(),n="mapbox",i=Z.constants=im();Z.name=n,Z.attr="subplot",Z.idRoot=n,Z.idRegex=Z.attrRegex=v.counterRegex(n);var s=["mapbox subplots and traces are deprecated!","Please consider switching to `map` subplots and traces.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");Z.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},Z.layoutAttributes=Ex(),Z.supplyLayoutDefaults=_V();var h=!0;Z.plot=function(T){h&&(h=!1,v.warn(s));var l=T._fullLayout,_=T.calcdata,w=l._subplots[n];if(G.version!==i.requiredVersion)throw new Error(i.wrongVersionErrorMsg);var A=c(T,w);G.accessToken=A;for(var M=0;M<w.length;M++){var g=w[M],b=E(_,n,g),d=l[g],u=d._subplot;u||(u=new a(T,g),l[g]._subplot=u),u.viewInitial||(u.viewInitial={center:v.extendFlat({},d.center),zoom:d.zoom,bearing:d.bearing,pitch:d.pitch}),u.plot(b,l,T._promises)}},Z.clean=function(p,T,l,_){for(var w=_._subplots[n]||[],A=0;A<w.length;A++){var M=w[A];!T[M]&&_[M]._subplot&&_[M]._subplot.destroy()}},Z.toSVG=function(p){for(var T=p._fullLayout,l=T._subplots[n],_=T._size,w=0;w<l.length;w++){var A=T[l[w]],M=A.domain,g=A._subplot,b=g.toImage("png"),d=T._glimages.append("svg:image");d.attr({xmlns:e.svg,"xlink:href":b,x:_.l+_.w*M.x[0],y:_.t+_.h*(1-M.y[1]),width:_.w*(M.x[1]-M.x[0]),height:_.h*(M.y[1]-M.y[0]),preserveAspectRatio:"none"});var u=t.select(A._subplot.div),y=u.select(".mapboxgl-ctrl-logo").node().offsetParent===null;if(!y){var f=T._glimages.append("g");f.attr("transform",x(_.l+_.w*M.x[0]+10,_.t+_.h*(1-M.y[0])-31)),f.append("path").attr("d",i.mapboxLogo.path0).style({opacity:.9,fill:"#ffffff","enable-background":"new"}),f.append("path").attr("d",i.mapboxLogo.path1).style("opacity",.35).style("enable-background","new"),f.append("path").attr("d",i.mapboxLogo.path2).style("opacity",.35).style("enable-background","new"),f.append("polygon").attr("points",i.mapboxLogo.polygon).style({opacity:.9,fill:"#ffffff","enable-background":"new"})}var R=u.select(".mapboxgl-ctrl-attrib").text().replace("Improve this map",""),L=T._glimages.append("g"),z=L.append("text");z.text(R).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":R});var F=r.bBox(z.node()),N=_.w*(M.x[1]-M.x[0]);if(F.width>N/2){var O=R.split("|").join("<br>");z.text(O).attr("data-unformatted",O).call(o.convertToTspans,p),F=r.bBox(z.node())}z.attr("transform",x(-3,-F.height+8)),L.insert("rect",".static-attribution").attr({x:-F.width-6,y:-F.height-3,width:F.width+6,height:F.height+3,fill:"rgba(255, 255, 255, 0.75)"});var P=1;F.width+6>N&&(P=N/(F.width+6));var U=[_.l+_.w*M.x[1],_.t+_.h*(1-M.y[0])];L.attr("transform",x(U[0],U[1])+S(P))}};function c(p,T){var l=p._fullLayout,_=p._context;if(_.mapboxAccessToken==="")return"";for(var w=[],A=[],M=!1,g=!1,b=0;b<T.length;b++){var d=l[T[b]],u=d.accesstoken;m(d.style)&&(u?v.pushUnique(w,u):(m(d._input.style)&&(v.error("Uses Mapbox map style, but did not set an access token."),M=!0),g=!0)),u&&v.pushUnique(A,u)}if(g){var y=M?i.noAccessTokenErrorMsg:i.missingStyleErrorMsg;throw v.error(y),new Error(y)}return w.length?(w.length>1&&v.warn(i.multipleTokensErrorMsg),w[0]):(A.length&&v.log(["Listed mapbox access token(s)",A.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}function m(p){return typeof p=="string"&&(i.styleValuesMapbox.indexOf(p)!==-1||p.indexOf("mapbox://")===0||p.indexOf("stamen")===0)}Z.updateFx=function(p){for(var T=p._fullLayout,l=T._subplots[n],_=0;_<l.length;_++){var w=T[l[_]]._subplot;w.updateFx(T)}}}}),xV=Xe({"src/traces/scattermapbox/index.js"(Z,G){"use strict";var v=["*scattermapbox* trace is deprecated!","Please consider switching to the *scattermap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");G.exports={attributes:AT(),supplyDefaults:hV(),colorbar:pp(),formatLabels:M6(),calc:iT(),plot:dV(),hoverPoints:ST().hoverPoints,eventData:vV(),selectPoints:mV(),styleOnSelect:function(x,S){if(S){var E=S[0].trace;E._glTrace.update(S)}},moduleType:"trace",name:"scattermapbox",basePlotModule:MT(),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}}}),bV=Xe({"lib/scattermapbox.js"(Z,G){"use strict";G.exports=xV()}}),C6=Xe({"src/traces/choroplethmapbox/attributes.js"(Z,G){"use strict";var v=k1(),x=ku(),{hovertemplateAttrs:S,templatefallbackAttrs:E}=Jl(),e=ru(),t=Qo().extendFlat;G.exports=t({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:t({},v.featureidkey,{}),below:{valType:"string",editType:"plot"},text:v.text,hovertext:v.hovertext,marker:{line:{color:t({},v.marker.line.color,{editType:"plot"}),width:t({},v.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:t({},v.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:t({},v.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:t({},v.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:v.hoverinfo,hovertemplate:S({},{keys:["properties"]}),hovertemplatefallback:E(),showlegend:t({},e.showlegend,{dflt:!1})},x("",{cLetter:"z",editTypeOverride:"calc"}))}}),wV=Xe({"src/traces/choroplethmapbox/defaults.js"(Z,G){"use strict";var v=sa(),x=_h(),S=C6();G.exports=function(e,t,r,o){function a(c,m){return v.coerce(e,t,S,c,m)}var n=a("locations"),i=a("z"),s=a("geojson");if(!v.isArrayOrTypedArray(n)||!n.length||!v.isArrayOrTypedArray(i)||!i.length||!(typeof s=="string"&&s!==""||v.isPlainObject(s))){t.visible=!1;return}a("featureidkey"),t._length=Math.min(n.length,i.length),a("below"),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback");var h=a("marker.line.width");h&&a("marker.line.color"),a("marker.opacity"),x(e,t,o,a,{prefix:"",cLetter:"z"}),v.coerceSelectionMarkerOpacity(t,a)}}}),L6=Xe({"src/traces/choroplethmapbox/convert.js"(Z,G){"use strict";var v=rs(),x=sa(),S=rc(),E=es(),e=m0().makeBlank,t=g0();function r(a){var n=a[0].trace,i=n.visible===!0&&n._length!==0,s={layout:{visibility:"none"},paint:{}},h={layout:{visibility:"none"},paint:{}},c=n._opts={fill:s,line:h,geojson:e()};if(!i)return c;var m=t.extractTraceFeature(a);if(!m)return c;var p=S.makeColorScaleFuncFromTrace(n),T=n.marker,l=T.line||{},_;x.isArrayOrTypedArray(T.opacity)&&(_=function(y){var f=y.mo;return v(f)?+x.constrain(f,0,1):0});var w;x.isArrayOrTypedArray(l.color)&&(w=function(y){return y.mlc});var A;x.isArrayOrTypedArray(l.width)&&(A=function(y){return y.mlw});for(var M=0;M<a.length;M++){var g=a[M],b=g.fOut;if(b){var d=b.properties;d.fc=p(g.z),_&&(d.mo=_(g)),w&&(d.mlc=w(g)),A&&(d.mlw=A(g)),g.ct=d.ct,g._polygons=t.feature2polygons(b)}}var u=_?{type:"identity",property:"mo"}:T.opacity;return x.extendFlat(s.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":u}),x.extendFlat(h.paint,{"line-color":w?{type:"identity",property:"mlc"}:l.color,"line-width":A?{type:"identity",property:"mlw"}:l.width,"line-opacity":u}),s.layout.visibility="visible",h.layout.visibility="visible",c.geojson={type:"FeatureCollection",features:m},o(a),c}function o(a){var n=a[0].trace,i=n._opts,s;if(n.selectedpoints){for(var h=E.makeSelectedPointStyleFns(n),c=0;c<a.length;c++){var m=a[c];m.fOut&&(m.fOut.properties.mo2=h.selectedOpacityFn(m))}s={type:"identity",property:"mo2"}}else s=x.isArrayOrTypedArray(n.marker.opacity)?{type:"identity",property:"mo"}:n.marker.opacity;return x.extendFlat(i.fill.paint,{"fill-opacity":s}),x.extendFlat(i.line.paint,{"line-opacity":s}),i}G.exports={convert:r,convertOnSelect:o}}}),TV=Xe({"src/traces/choroplethmapbox/plot.js"(Z,G){"use strict";var v=L6().convert,x=L6().convertOnSelect,S=im().traceLayerPrefix;function E(t,r){this.type="choroplethmapbox",this.subplot=t,this.uid=r,this.sourceId="source-"+r,this.layerList=[["fill",S+r+"-fill"],["line",S+r+"-line"]],this.below=null}var e=E.prototype;e.update=function(t){this._update(v(t)),t[0].trace._glTrace=this},e.updateOnSelect=function(t){this._update(x(t))},e._update=function(t){var r=this.subplot,o=this.layerList,a=r.belowLookup["trace-"+this.uid];r.map.getSource(this.sourceId).setData(t.geojson),a!==this.below&&(this._removeLayers(),this._addLayers(t,a),this.below=a);for(var n=0;n<o.length;n++){var i=o[n],s=i[0],h=i[1],c=t[s];r.setOptions(h,"setLayoutProperty",c.layout),c.layout.visibility==="visible"&&r.setOptions(h,"setPaintProperty",c.paint)}},e._addLayers=function(t,r){for(var o=this.subplot,a=this.layerList,n=this.sourceId,i=0;i<a.length;i++){var s=a[i],h=s[0],c=t[h];o.addLayer({type:h,id:s[1],source:n,layout:c.layout,paint:c.paint},r)}},e._removeLayers=function(){for(var t=this.subplot.map,r=this.layerList,o=r.length-1;o>=0;o--)t.removeLayer(r[o][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},G.exports=function(r,o){var a=o[0].trace,n=new E(r,a.uid),i=n.sourceId,s=v(o),h=n.below=r.belowLookup["trace-"+a.uid];return r.map.addSource(i,{type:"geojson",data:s.geojson}),n._addLayers(s,h),o[0].trace._glTrace=n,n}}}),AV=Xe({"src/traces/choroplethmapbox/index.js"(Z,G){"use strict";var v=["*choroplethmapbox* trace is deprecated!","Please consider switching to the *choroplethmap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");G.exports={attributes:C6(),supplyDefaults:wV(),colorbar:n0(),calc:lT(),plot:TV(),hoverPoints:cT(),eventData:fT(),selectPoints:hT(),styleOnSelect:function(x,S){if(S){var E=S[0].trace;E._glTrace.updateOnSelect(S)}},getBelow:function(x,S){for(var E=S.getMapLayers(),e=E.length-2;e>=0;e--){var t=E[e].id;if(typeof t=="string"&&t.indexOf("water")===0){for(var r=e+1;r<E.length;r++)if(t=E[r].id,typeof t=="string"&&t.indexOf("plotly-")===-1)return t}}},moduleType:"trace",name:"choroplethmapbox",basePlotModule:MT(),categories:["mapbox","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_mapbox"}}}}),SV=Xe({"lib/choroplethmapbox.js"(Z,G){"use strict";G.exports=AV()}}),P6=Xe({"src/traces/densitymapbox/attributes.js"(Z,G){"use strict";var v=ku(),{hovertemplateAttrs:x,templatefallbackAttrs:S}=Jl(),E=ru(),e=AT(),t=Qo().extendFlat;G.exports=t({lon:e.lon,lat:e.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:e.text,hovertext:e.hovertext,hoverinfo:t({},E.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:x(),hovertemplatefallback:S(),showlegend:t({},E.showlegend,{dflt:!1})},v("",{cLetter:"z",editTypeOverride:"calc"}))}}),MV=Xe({"src/traces/densitymapbox/defaults.js"(Z,G){"use strict";var v=sa(),x=_h(),S=P6();G.exports=function(e,t,r,o){function a(h,c){return v.coerce(e,t,S,h,c)}var n=a("lon")||[],i=a("lat")||[],s=Math.min(n.length,i.length);if(!s){t.visible=!1;return}t._length=s,a("z"),a("radius"),a("below"),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),x(e,t,o,a,{prefix:"",cLetter:"z"})}}}),EV=Xe({"src/traces/densitymapbox/calc.js"(Z,G){"use strict";var v=rs(),x=sa().isArrayOrTypedArray,S=Hs().BADNUM,E=Tp(),e=sa()._;G.exports=function(r,o){for(var a=o._length,n=new Array(a),i=o.z,s=x(i)&&i.length,h=0;h<a;h++){var c=n[h]={},m=o.lon[h],p=o.lat[h];if(c.lonlat=v(m)&&v(p)?[+m,+p]:[S,S],s){var T=i[h];c.z=v(T)?T:S}}return E(r,o,{vals:s?i:[0,1],containerStr:"",cLetter:"z"}),a&&(n[0].t={labels:{lat:e(r,"lat:")+" ",lon:e(r,"lon:")+" "}}),n}}}),kV=Xe({"src/traces/densitymapbox/convert.js"(Z,G){"use strict";var v=rs(),x=sa(),S=$n(),E=rc(),e=Hs().BADNUM,t=m0().makeBlank;G.exports=function(o){var a=o[0].trace,n=a.visible===!0&&a._length!==0,i={layout:{visibility:"none"},paint:{}},s=a._opts={heatmap:i,geojson:t()};if(!n)return s;var h=[],c,m=a.z,p=a.radius,T=x.isArrayOrTypedArray(m)&&m.length,l=x.isArrayOrTypedArray(p);for(c=0;c<o.length;c++){var _=o[c],w=_.lonlat;if(w[0]!==e){var A={};if(T){var M=_.z;A.z=M!==e?M:0}l&&(A.r=v(p[c])&&p[c]>0?+p[c]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:w},properties:A})}}var g=E.extractOpts(a),b=g.reversescale?E.flipScale(g.colorscale):g.colorscale,d=b[0][1],u=S.opacity(d)<1?d:S.addOpacity(d,0),y=["interpolate",["linear"],["heatmap-density"],0,u];for(c=1;c<b.length;c++)y.push(b[c][0],b[c][1]);var f=["interpolate",["linear"],["get","z"],g.min,0,g.max,1];return x.extendFlat(s.heatmap.paint,{"heatmap-weight":T?f:1/(g.max-g.min),"heatmap-color":y,"heatmap-radius":l?{type:"identity",property:"r"}:a.radius,"heatmap-opacity":a.opacity}),s.geojson={type:"FeatureCollection",features:h},s.heatmap.layout.visibility="visible",s}}}),CV=Xe({"src/traces/densitymapbox/plot.js"(Z,G){"use strict";var v=kV(),x=im().traceLayerPrefix;function S(e,t){this.type="densitymapbox",this.subplot=e,this.uid=t,this.sourceId="source-"+t,this.layerList=[["heatmap",x+t+"-heatmap"]],this.below=null}var E=S.prototype;E.update=function(e){var t=this.subplot,r=this.layerList,o=v(e),a=t.belowLookup["trace-"+this.uid];t.map.getSource(this.sourceId).setData(o.geojson),a!==this.below&&(this._removeLayers(),this._addLayers(o,a),this.below=a);for(var n=0;n<r.length;n++){var i=r[n],s=i[0],h=i[1],c=o[s];t.setOptions(h,"setLayoutProperty",c.layout),c.layout.visibility==="visible"&&t.setOptions(h,"setPaintProperty",c.paint)}},E._addLayers=function(e,t){for(var r=this.subplot,o=this.layerList,a=this.sourceId,n=0;n<o.length;n++){var i=o[n],s=i[0],h=e[s];r.addLayer({type:s,id:i[1],source:a,layout:h.layout,paint:h.paint},t)}},E._removeLayers=function(){for(var e=this.subplot.map,t=this.layerList,r=t.length-1;r>=0;r--)e.removeLayer(t[r][1])},E.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},G.exports=function(t,r){var o=r[0].trace,a=new S(t,o.uid),n=a.sourceId,i=v(r),s=a.below=t.belowLookup["trace-"+o.uid];return t.map.addSource(n,{type:"geojson",data:i.geojson}),a._addLayers(i,s),a}}}),LV=Xe({"src/traces/densitymapbox/hover.js"(Z,G){"use strict";var v=Go(),x=ST().hoverPoints,S=ST().getExtraText;G.exports=function(e,t,r){var o=x(e,t,r);if(o){var a=o[0],n=a.cd,i=n[0].trace,s=n[a.index];if(delete a.color,"z"in s){var h=a.subplot.mockAxis;a.z=s.z,a.zLabel=v.tickText(h,h.c2l(s.z),"hover").text}return a.extraText=S(i,s,n[0].t.labels),[a]}}}}),PV=Xe({"src/traces/densitymapbox/event_data.js"(Z,G){"use strict";G.exports=function(x,S){return x.lon=S.lon,x.lat=S.lat,x.z=S.z,x}}}),IV=Xe({"src/traces/densitymapbox/index.js"(Z,G){"use strict";var v=["*densitymapbox* trace is deprecated!","Please consider switching to the *densitymap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");G.exports={attributes:P6(),supplyDefaults:MV(),colorbar:n0(),formatLabels:M6(),calc:EV(),plot:CV(),hoverPoints:LV(),eventData:PV(),getBelow:function(x,S){for(var E=S.getMapLayers(),e=0;e<E.length;e++){var t=E[e],r=t.id;if(t.type==="symbol"&&typeof r=="string"&&r.indexOf("plotly-")===-1)return r}},moduleType:"trace",name:"densitymapbox",basePlotModule:MT(),categories:["mapbox","gl","showLegend"],meta:{hr_name:"density_mapbox"}}}}),RV=Xe({"lib/densitymapbox.js"(Z,G){"use strict";G.exports=IV()}}),DV=Xe({"src/plots/map/styles/arcgis-sat-hybrid.js"(Z,G){G.exports={version:8,name:"orto",metadata:{"maputnik:renderer":"mlgljs"},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © <a href='http://www.esri.com'>ESRI</a>"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin} |