@golstats/gsc-game-data 1.0.329 → 1.0.330
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{FilterConditions-cd420512-d91b496b.js → FilterConditions-cd420512-967455b3.js} +1 -1
- package/dist/{FilterConditions-cd420512-Cev6f4cg-e584d4df.js → FilterConditions-cd420512-Bp50MWq6-8e896cc6.js} +1 -1
- package/dist/{FilterField-a29b1541-fc887879.js → FilterField-a29b1541-7e40e1d8.js} +1 -1
- package/dist/{FilterField-a29b1541-C545B5gX-c01e352b.js → FilterField-a29b1541-BQDzMzcJ-d449a9e7.js} +1 -1
- package/dist/{FilterSubcategories-1f65c851-dfeefc6b.js → FilterSubcategories-1f65c851-2fdcb678.js} +1 -1
- package/dist/{FilterSubcategories-1f65c851-B6_S4qG3-73ef1808.js → FilterSubcategories-1f65c851-CThFvlMx-4ca2fece.js} +1 -1
- package/dist/gsc-game-data.js +1 -1
- package/dist/gsc-game-data.umd.cjs +1 -1
- package/dist/{index-07824dc4.js → index-b38a288e.js} +9 -9
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -8171,7 +8171,7 @@ uniform ${Fe} ${Ge} u_${at};
|
|
|
8171
8171
|
#endif
|
|
8172
8172
|
`}),staticAttributes:F,staticUniforms:ie}}class Na{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(c,p,F,j,q,ie,pe,be,Ae){this.context=c;let Fe=this.boundPaintVertexBuffers.length!==j.length;for(let Ge=0;!Fe&&Ge<j.length;Ge++)this.boundPaintVertexBuffers[Ge]!==j[Ge]&&(Fe=!0);!this.vao||this.boundProgram!==p||this.boundLayoutVertexBuffer!==F||Fe||this.boundIndexBuffer!==q||this.boundVertexOffset!==ie||this.boundDynamicVertexBuffer!==pe||this.boundDynamicVertexBuffer2!==be||this.boundDynamicVertexBuffer3!==Ae?this.freshBind(p,F,j,q,ie,pe,be,Ae):(c.bindVertexArray.set(this.vao),pe&&pe.bind(),q&&q.dynamicDraw&&q.bind(),be&&be.bind(),Ae&&Ae.bind())}freshBind(c,p,F,j,q,ie,pe,be){const Ae=c.numAttributes,Fe=this.context,Ge=Fe.gl;this.vao&&this.destroy(),this.vao=Fe.createVertexArray(),Fe.bindVertexArray.set(this.vao),this.boundProgram=c,this.boundLayoutVertexBuffer=p,this.boundPaintVertexBuffers=F,this.boundIndexBuffer=j,this.boundVertexOffset=q,this.boundDynamicVertexBuffer=ie,this.boundDynamicVertexBuffer2=pe,this.boundDynamicVertexBuffer3=be,p.enableAttributes(Ge,c);for(const at of F)at.enableAttributes(Ge,c);ie&&ie.enableAttributes(Ge,c),pe&&pe.enableAttributes(Ge,c),be&&be.enableAttributes(Ge,c),p.bind(),p.setVertexAttribPointers(Ge,c,q);for(const at of F)at.bind(),at.setVertexAttribPointers(Ge,c,q);ie&&(ie.bind(),ie.setVertexAttribPointers(Ge,c,q)),j&&j.bind(),pe&&(pe.bind(),pe.setVertexAttribPointers(Ge,c,q)),be&&(be.bind(),be.setVertexAttribPointers(Ge,c,q)),Fe.currentNumAttributes=Ae}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}const _n=(R,c,p,F,j)=>({u_matrix:R,u_texture:0,u_ele_delta:c,u_fog_matrix:p,u_fog_color:F?F.properties.get("fog-color"):n.aN.white,u_fog_ground_blend:F?F.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:F?F.calculateFogBlendOpacity(j):0,u_horizon_color:F?F.properties.get("horizon-color"):n.aN.white,u_horizon_fog_blend:F?F.properties.get("horizon-fog-blend"):1});function kn(R){const c=[];for(let p=0;p<R.length;p++){if(R[p]===null)continue;const F=R[p].split(" ");c.push(F.pop())}return c}class na{constructor(c,p,F,j,q,ie){const pe=c.gl;this.program=pe.createProgram();const be=kn(p.staticAttributes),Ae=F?F.getBinderAttributes():[],Fe=be.concat(Ae),Ge=ba.prelude.staticUniforms?kn(ba.prelude.staticUniforms):[],at=p.staticUniforms?kn(p.staticUniforms):[],ct=F?F.getBinderUniforms():[],pt=Ge.concat(at).concat(ct),xt=[];for(const Zt of pt)xt.indexOf(Zt)<0&&xt.push(Zt);const At=F?F.defines():[];q&&At.push("#define OVERDRAW_INSPECTOR;"),ie&&At.push("#define TERRAIN3D;");const Tt=At.concat(ba.prelude.fragmentSource,p.fragmentSource).join(`
|
|
8173
8173
|
`),Rt=At.concat(ba.prelude.vertexSource,p.vertexSource).join(`
|
|
8174
|
-
`),Et=pe.createShader(pe.FRAGMENT_SHADER);if(pe.isContextLost())return void(this.failedToCreate=!0);if(pe.shaderSource(Et,Tt),pe.compileShader(Et),!pe.getShaderParameter(Et,pe.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${pe.getShaderInfoLog(Et)}`);pe.attachShader(this.program,Et);const Yt=pe.createShader(pe.VERTEX_SHADER);if(pe.isContextLost())return void(this.failedToCreate=!0);if(pe.shaderSource(Yt,Rt),pe.compileShader(Yt),!pe.getShaderParameter(Yt,pe.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${pe.getShaderInfoLog(Yt)}`);pe.attachShader(this.program,Yt),this.attributes={};const Kt={};this.numAttributes=Fe.length;for(let Zt=0;Zt<this.numAttributes;Zt++)Fe[Zt]&&(pe.bindAttribLocation(this.program,Zt,Fe[Zt]),this.attributes[Fe[Zt]]=Zt);if(pe.linkProgram(this.program),!pe.getProgramParameter(this.program,pe.LINK_STATUS))throw new Error(`Program failed to link: ${pe.getProgramInfoLog(this.program)}`);pe.deleteShader(Yt),pe.deleteShader(Et);for(let Zt=0;Zt<xt.length;Zt++){const hn=xt[Zt];if(hn&&!Kt[hn]){const xn=pe.getUniformLocation(this.program,hn);xn&&(Kt[hn]=xn)}}this.fixedUniforms=j(c,Kt),this.terrainUniforms=((Zt,hn)=>({u_depth:new n.aI(Zt,hn.u_depth),u_terrain:new n.aI(Zt,hn.u_terrain),u_terrain_dim:new n.aJ(Zt,hn.u_terrain_dim),u_terrain_matrix:new n.aK(Zt,hn.u_terrain_matrix),u_terrain_unpack:new n.aL(Zt,hn.u_terrain_unpack),u_terrain_exaggeration:new n.aJ(Zt,hn.u_terrain_exaggeration)}))(c,Kt),this.binderUniforms=F?F.getUniforms(c,Kt):[]}draw(c,p,F,j,q,ie,pe,be,Ae,Fe,Ge,at,ct,pt,xt,At,Tt,Rt){const Et=c.gl;if(this.failedToCreate)return;if(c.program.set(this.program),c.setDepthMode(F),c.setStencilMode(j),c.setColorMode(q),c.setCullFace(ie),be){c.activeTexture.set(Et.TEXTURE2),Et.bindTexture(Et.TEXTURE_2D,be.depthTexture),c.activeTexture.set(Et.TEXTURE3),Et.bindTexture(Et.TEXTURE_2D,be.texture);for(const Kt in this.terrainUniforms)this.terrainUniforms[Kt].set(be[Kt])}for(const Kt in this.fixedUniforms)this.fixedUniforms[Kt].set(pe[Kt]);xt&&xt.setUniforms(c,this.binderUniforms,ct,{zoom:pt});let Yt=0;switch(p){case Et.LINES:Yt=2;break;case Et.TRIANGLES:Yt=3;break;case Et.LINE_STRIP:Yt=1}for(const Kt of at.get()){const Zt=Kt.vaos||(Kt.vaos={});(Zt[Ae]||(Zt[Ae]=new Na)).bind(c,this,Fe,xt?xt.getPaintVertexBuffers():[],Ge,Kt.vertexOffset,At,Tt,Rt),Et.drawElements(p,Kt.primitiveLength*Yt,Et.UNSIGNED_SHORT,Kt.primitiveOffset*Yt*2)}}}function jn(R,c,p){const F=1/St(p,1,c.transform.tileZoom),j=Math.pow(2,p.tileID.overscaledZ),q=p.tileSize*Math.pow(2,c.transform.tileZoom)/j,ie=q*(p.tileID.canonical.x+p.tileID.wrap*j),pe=q*p.tileID.canonical.y;return{u_image:0,u_texsize:p.imageAtlasTexture.size,u_scale:[F,R.fromScale,R.toScale],u_fade:R.t,u_pixel_coord_upper:[ie>>16,pe>>16],u_pixel_coord_lower:[65535&ie,65535&pe]}}const aa=(R,c,p,F)=>{const j=c.style.light,q=j.properties.get("position"),ie=[q.x,q.y,q.z],pe=function(){var Ae=new n.A(9);return n.A!=Float32Array&&(Ae[1]=0,Ae[2]=0,Ae[3]=0,Ae[5]=0,Ae[6]=0,Ae[7]=0),Ae[0]=1,Ae[4]=1,Ae[8]=1,Ae}();j.properties.get("anchor")==="viewport"&&function(Ae,Fe){var Ge=Math.sin(Fe),at=Math.cos(Fe);Ae[0]=at,Ae[1]=Ge,Ae[2]=0,Ae[3]=-Ge,Ae[4]=at,Ae[5]=0,Ae[6]=0,Ae[7]=0,Ae[8]=1}(pe,-c.transform.angle),function(Ae,Fe,Ge){var at=Fe[0],ct=Fe[1],pt=Fe[2];Ae[0]=at*Ge[0]+ct*Ge[3]+pt*Ge[6],Ae[1]=at*Ge[1]+ct*Ge[4]+pt*Ge[7],Ae[2]=at*Ge[2]+ct*Ge[5]+pt*Ge[8]}(ie,ie,pe);const be=j.properties.get("color");return{u_matrix:R,u_lightpos:ie,u_lightintensity:j.properties.get("intensity"),u_lightcolor:[be.r,be.g,be.b],u_vertical_gradient:+p,u_opacity:F}},_a=(R,c,p,F,j,q,ie)=>n.e(aa(R,c,p,F),jn(q,c,ie),{u_height_factor:-Math.pow(2,j.overscaledZ)/ie.tileSize/8}),ga=R=>({u_matrix:R}),za=(R,c,p,F)=>n.e(ga(R),jn(p,c,F)),Ua=(R,c)=>({u_matrix:R,u_world:c}),gn=(R,c,p,F,j)=>n.e(za(R,c,p,F),{u_world:j}),Un=(R,c,p,F)=>{const j=R.transform;let q,ie;if(F.paint.get("circle-pitch-alignment")==="map"){const pe=St(p,1,j.zoom);q=!0,ie=[pe,pe]}else q=!1,ie=j.pixelsToGLUnits;return{u_camera_to_center_distance:j.cameraToCenterDistance,u_scale_with_map:+(F.paint.get("circle-pitch-scale")==="map"),u_matrix:R.translatePosMatrix(c.posMatrix,p,F.paint.get("circle-translate"),F.paint.get("circle-translate-anchor")),u_pitch_with_map:+q,u_device_pixel_ratio:R.pixelRatio,u_extrude_scale:ie}},tn=(R,c)=>({u_matrix:c,u_pixel_extrude_scale:[1/R.width,1/R.height]}),un=(R,c,p)=>({u_matrix:R,u_inv_matrix:c,u_camera_to_center_distance:p.cameraToCenterDistance,u_viewport_size:[p.width,p.height]}),mn=(R,c,p=1)=>({u_matrix:R,u_color:c,u_overlay:0,u_overlay_scale:p}),Fn=R=>({u_matrix:R}),On=(R,c,p,F)=>({u_matrix:R,u_extrude_scale:St(c,1,p),u_intensity:F}),Yn=(R,c,p,F)=>{const j=n.H();n.aQ(j,0,R.width,R.height,0,0,1);const q=R.context.gl;return{u_matrix:j,u_world:[q.drawingBufferWidth,q.drawingBufferHeight],u_image:p,u_color_ramp:F,u_opacity:c.paint.get("heatmap-opacity")}},Vn=(R,c,p,F)=>{const j=p.paint.get("hillshade-shadow-color"),q=p.paint.get("hillshade-highlight-color"),ie=p.paint.get("hillshade-accent-color");let pe=p.paint.get("hillshade-illumination-direction")*(Math.PI/180);p.paint.get("hillshade-illumination-anchor")==="viewport"&&(pe-=R.transform.angle);const be=!R.options.moving;return{u_matrix:F?F.posMatrix:R.transform.calculatePosMatrix(c.tileID.toUnwrapped(),be),u_image:0,u_latrange:cn(0,c.tileID),u_light:[p.paint.get("hillshade-exaggeration"),pe],u_shadow:j,u_highlight:q,u_accent:ie}},Pn=(R,c)=>{const p=c.stride,F=n.H();return n.aQ(F,0,n.X,-n.X,0,0,1),n.J(F,F,[0,-n.X,0]),{u_matrix:F,u_image:1,u_dimension:[p,p],u_zoom:R.overscaledZ,u_unpack:c.getUnpackVector()}};function cn(R,c){const p=Math.pow(2,c.canonical.z),F=c.canonical.y;return[new n.Z(0,F/p).toLngLat().lat,new n.Z(0,(F+1)/p).toLngLat().lat]}const sn=(R,c,p,F)=>{const j=R.transform;return{u_matrix:ua(R,c,p,F),u_ratio:1/St(c,1,j.zoom),u_device_pixel_ratio:R.pixelRatio,u_units_to_pixels:[1/j.pixelsToGLUnits[0],1/j.pixelsToGLUnits[1]]}},Tn=(R,c,p,F,j)=>n.e(sn(R,c,p,j),{u_image:0,u_image_height:F}),Zn=(R,c,p,F,j)=>{const q=R.transform,ie=la(c,q);return{u_matrix:ua(R,c,p,j),u_texsize:c.imageAtlasTexture.size,u_ratio:1/St(c,1,q.zoom),u_device_pixel_ratio:R.pixelRatio,u_image:0,u_scale:[ie,F.fromScale,F.toScale],u_fade:F.t,u_units_to_pixels:[1/q.pixelsToGLUnits[0],1/q.pixelsToGLUnits[1]]}},ca=(R,c,p,F,j,q)=>{const ie=R.transform,pe=R.lineAtlas,be=la(c,ie),Ae=p.layout.get("line-cap")==="round",Fe=pe.getDash(F.from,Ae),Ge=pe.getDash(F.to,Ae),at=Fe.width*j.fromScale,ct=Ge.width*j.toScale;return n.e(sn(R,c,p,q),{u_patternscale_a:[be/at,-Fe.height/2],u_patternscale_b:[be/ct,-Ge.height/2],u_sdfgamma:pe.width/(256*Math.min(at,ct)*R.pixelRatio)/2,u_image:0,u_tex_y_a:Fe.y,u_tex_y_b:Ge.y,u_mix:j.t})};function la(R,c){return 1/St(R,1,c.tileZoom)}function ua(R,c,p,F){return R.translatePosMatrix(F?F.posMatrix:c.tileID.posMatrix,c,p.paint.get("line-translate"),p.paint.get("line-translate-anchor"))}const Aa=(R,c,p,F,j)=>{return{u_matrix:R,u_tl_parent:c,u_scale_parent:p,u_buffer_scale:1,u_fade_t:F.mix,u_opacity:F.opacity*j.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:j.paint.get("raster-brightness-min"),u_brightness_high:j.paint.get("raster-brightness-max"),u_saturation_factor:(ie=j.paint.get("raster-saturation"),ie>0?1-1/(1.001-ie):-ie),u_contrast_factor:(q=j.paint.get("raster-contrast"),q>0?1/(1-q):1+q),u_spin_weights:ka(j.paint.get("raster-hue-rotate"))};var q,ie};function ka(R){R*=Math.PI/180;const c=Math.sin(R),p=Math.cos(R);return[(2*p+1)/3,(-Math.sqrt(3)*c-p+1)/3,(Math.sqrt(3)*c-p+1)/3]}const Ba=(R,c,p,F,j,q,ie,pe,be,Ae,Fe,Ge,at,ct)=>{const pt=ie.transform;return{u_is_size_zoom_constant:+(R==="constant"||R==="source"),u_is_size_feature_constant:+(R==="constant"||R==="camera"),u_size_t:c?c.uSizeT:0,u_size:c?c.uSize:0,u_camera_to_center_distance:pt.cameraToCenterDistance,u_pitch:pt.pitch/360*2*Math.PI,u_rotate_symbol:+p,u_aspect_ratio:pt.width/pt.height,u_fade_change:ie.options.fadeDuration?ie.symbolFadeChange:1,u_matrix:pe,u_label_plane_matrix:be,u_coord_matrix:Ae,u_is_text:+Ge,u_pitch_with_map:+F,u_is_along_line:j,u_is_variable_anchor:q,u_texsize:at,u_texture:0,u_translation:Fe,u_pitched_scale:ct}},xa=(R,c,p,F,j,q,ie,pe,be,Ae,Fe,Ge,at,ct,pt)=>{const xt=ie.transform;return n.e(Ba(R,c,p,F,j,q,ie,pe,be,Ae,Fe,Ge,at,pt),{u_gamma_scale:F?Math.cos(xt._pitch)*xt.cameraToCenterDistance:1,u_device_pixel_ratio:ie.pixelRatio,u_is_halo:1})},Ca=(R,c,p,F,j,q,ie,pe,be,Ae,Fe,Ge,at,ct)=>n.e(xa(R,c,p,F,j,q,ie,pe,be,Ae,Fe,!0,Ge,!0,ct),{u_texsize_icon:at,u_texture_icon:1}),Fa=(R,c,p)=>({u_matrix:R,u_opacity:c,u_color:p}),Ja=(R,c,p,F,j,q)=>n.e(function(ie,pe,be,Ae){const Fe=be.imageManager.getPattern(ie.from.toString()),Ge=be.imageManager.getPattern(ie.to.toString()),{width:at,height:ct}=be.imageManager.getPixelSize(),pt=Math.pow(2,Ae.tileID.overscaledZ),xt=Ae.tileSize*Math.pow(2,be.transform.tileZoom)/pt,At=xt*(Ae.tileID.canonical.x+Ae.tileID.wrap*pt),Tt=xt*Ae.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Fe.tl,u_pattern_br_a:Fe.br,u_pattern_tl_b:Ge.tl,u_pattern_br_b:Ge.br,u_texsize:[at,ct],u_mix:pe.t,u_pattern_size_a:Fe.displaySize,u_pattern_size_b:Ge.displaySize,u_scale_a:pe.fromScale,u_scale_b:pe.toScale,u_tile_units_to_pixels:1/St(Ae,1,be.transform.tileZoom),u_pixel_coord_upper:[At>>16,Tt>>16],u_pixel_coord_lower:[65535&At,65535&Tt]}}(F,q,p,j),{u_matrix:R,u_opacity:c}),$a={fillExtrusion:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_lightpos:new n.aO(R,c.u_lightpos),u_lightintensity:new n.aJ(R,c.u_lightintensity),u_lightcolor:new n.aO(R,c.u_lightcolor),u_vertical_gradient:new n.aJ(R,c.u_vertical_gradient),u_opacity:new n.aJ(R,c.u_opacity)}),fillExtrusionPattern:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_lightpos:new n.aO(R,c.u_lightpos),u_lightintensity:new n.aJ(R,c.u_lightintensity),u_lightcolor:new n.aO(R,c.u_lightcolor),u_vertical_gradient:new n.aJ(R,c.u_vertical_gradient),u_height_factor:new n.aJ(R,c.u_height_factor),u_image:new n.aI(R,c.u_image),u_texsize:new n.aP(R,c.u_texsize),u_pixel_coord_upper:new n.aP(R,c.u_pixel_coord_upper),u_pixel_coord_lower:new n.aP(R,c.u_pixel_coord_lower),u_scale:new n.aO(R,c.u_scale),u_fade:new n.aJ(R,c.u_fade),u_opacity:new n.aJ(R,c.u_opacity)}),fill:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix)}),fillPattern:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_image:new n.aI(R,c.u_image),u_texsize:new n.aP(R,c.u_texsize),u_pixel_coord_upper:new n.aP(R,c.u_pixel_coord_upper),u_pixel_coord_lower:new n.aP(R,c.u_pixel_coord_lower),u_scale:new n.aO(R,c.u_scale),u_fade:new n.aJ(R,c.u_fade)}),fillOutline:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_world:new n.aP(R,c.u_world)}),fillOutlinePattern:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_world:new n.aP(R,c.u_world),u_image:new n.aI(R,c.u_image),u_texsize:new n.aP(R,c.u_texsize),u_pixel_coord_upper:new n.aP(R,c.u_pixel_coord_upper),u_pixel_coord_lower:new n.aP(R,c.u_pixel_coord_lower),u_scale:new n.aO(R,c.u_scale),u_fade:new n.aJ(R,c.u_fade)}),circle:(R,c)=>({u_camera_to_center_distance:new n.aJ(R,c.u_camera_to_center_distance),u_scale_with_map:new n.aI(R,c.u_scale_with_map),u_pitch_with_map:new n.aI(R,c.u_pitch_with_map),u_extrude_scale:new n.aP(R,c.u_extrude_scale),u_device_pixel_ratio:new n.aJ(R,c.u_device_pixel_ratio),u_matrix:new n.aK(R,c.u_matrix)}),collisionBox:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_pixel_extrude_scale:new n.aP(R,c.u_pixel_extrude_scale)}),collisionCircle:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_inv_matrix:new n.aK(R,c.u_inv_matrix),u_camera_to_center_distance:new n.aJ(R,c.u_camera_to_center_distance),u_viewport_size:new n.aP(R,c.u_viewport_size)}),debug:(R,c)=>({u_color:new n.aM(R,c.u_color),u_matrix:new n.aK(R,c.u_matrix),u_overlay:new n.aI(R,c.u_overlay),u_overlay_scale:new n.aJ(R,c.u_overlay_scale)}),clippingMask:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix)}),heatmap:(R,c)=>({u_extrude_scale:new n.aJ(R,c.u_extrude_scale),u_intensity:new n.aJ(R,c.u_intensity),u_matrix:new n.aK(R,c.u_matrix)}),heatmapTexture:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_world:new n.aP(R,c.u_world),u_image:new n.aI(R,c.u_image),u_color_ramp:new n.aI(R,c.u_color_ramp),u_opacity:new n.aJ(R,c.u_opacity)}),hillshade:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_image:new n.aI(R,c.u_image),u_latrange:new n.aP(R,c.u_latrange),u_light:new n.aP(R,c.u_light),u_shadow:new n.aM(R,c.u_shadow),u_highlight:new n.aM(R,c.u_highlight),u_accent:new n.aM(R,c.u_accent)}),hillshadePrepare:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_image:new n.aI(R,c.u_image),u_dimension:new n.aP(R,c.u_dimension),u_zoom:new n.aJ(R,c.u_zoom),u_unpack:new n.aL(R,c.u_unpack)}),line:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_ratio:new n.aJ(R,c.u_ratio),u_device_pixel_ratio:new n.aJ(R,c.u_device_pixel_ratio),u_units_to_pixels:new n.aP(R,c.u_units_to_pixels)}),lineGradient:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_ratio:new n.aJ(R,c.u_ratio),u_device_pixel_ratio:new n.aJ(R,c.u_device_pixel_ratio),u_units_to_pixels:new n.aP(R,c.u_units_to_pixels),u_image:new n.aI(R,c.u_image),u_image_height:new n.aJ(R,c.u_image_height)}),linePattern:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_texsize:new n.aP(R,c.u_texsize),u_ratio:new n.aJ(R,c.u_ratio),u_device_pixel_ratio:new n.aJ(R,c.u_device_pixel_ratio),u_image:new n.aI(R,c.u_image),u_units_to_pixels:new n.aP(R,c.u_units_to_pixels),u_scale:new n.aO(R,c.u_scale),u_fade:new n.aJ(R,c.u_fade)}),lineSDF:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_ratio:new n.aJ(R,c.u_ratio),u_device_pixel_ratio:new n.aJ(R,c.u_device_pixel_ratio),u_units_to_pixels:new n.aP(R,c.u_units_to_pixels),u_patternscale_a:new n.aP(R,c.u_patternscale_a),u_patternscale_b:new n.aP(R,c.u_patternscale_b),u_sdfgamma:new n.aJ(R,c.u_sdfgamma),u_image:new n.aI(R,c.u_image),u_tex_y_a:new n.aJ(R,c.u_tex_y_a),u_tex_y_b:new n.aJ(R,c.u_tex_y_b),u_mix:new n.aJ(R,c.u_mix)}),raster:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_tl_parent:new n.aP(R,c.u_tl_parent),u_scale_parent:new n.aJ(R,c.u_scale_parent),u_buffer_scale:new n.aJ(R,c.u_buffer_scale),u_fade_t:new n.aJ(R,c.u_fade_t),u_opacity:new n.aJ(R,c.u_opacity),u_image0:new n.aI(R,c.u_image0),u_image1:new n.aI(R,c.u_image1),u_brightness_low:new n.aJ(R,c.u_brightness_low),u_brightness_high:new n.aJ(R,c.u_brightness_high),u_saturation_factor:new n.aJ(R,c.u_saturation_factor),u_contrast_factor:new n.aJ(R,c.u_contrast_factor),u_spin_weights:new n.aO(R,c.u_spin_weights)}),symbolIcon:(R,c)=>({u_is_size_zoom_constant:new n.aI(R,c.u_is_size_zoom_constant),u_is_size_feature_constant:new n.aI(R,c.u_is_size_feature_constant),u_size_t:new n.aJ(R,c.u_size_t),u_size:new n.aJ(R,c.u_size),u_camera_to_center_distance:new n.aJ(R,c.u_camera_to_center_distance),u_pitch:new n.aJ(R,c.u_pitch),u_rotate_symbol:new n.aI(R,c.u_rotate_symbol),u_aspect_ratio:new n.aJ(R,c.u_aspect_ratio),u_fade_change:new n.aJ(R,c.u_fade_change),u_matrix:new n.aK(R,c.u_matrix),u_label_plane_matrix:new n.aK(R,c.u_label_plane_matrix),u_coord_matrix:new n.aK(R,c.u_coord_matrix),u_is_text:new n.aI(R,c.u_is_text),u_pitch_with_map:new n.aI(R,c.u_pitch_with_map),u_is_along_line:new n.aI(R,c.u_is_along_line),u_is_variable_anchor:new n.aI(R,c.u_is_variable_anchor),u_texsize:new n.aP(R,c.u_texsize),u_texture:new n.aI(R,c.u_texture),u_translation:new n.aP(R,c.u_translation),u_pitched_scale:new n.aJ(R,c.u_pitched_scale)}),symbolSDF:(R,c)=>({u_is_size_zoom_constant:new n.aI(R,c.u_is_size_zoom_constant),u_is_size_feature_constant:new n.aI(R,c.u_is_size_feature_constant),u_size_t:new n.aJ(R,c.u_size_t),u_size:new n.aJ(R,c.u_size),u_camera_to_center_distance:new n.aJ(R,c.u_camera_to_center_distance),u_pitch:new n.aJ(R,c.u_pitch),u_rotate_symbol:new n.aI(R,c.u_rotate_symbol),u_aspect_ratio:new n.aJ(R,c.u_aspect_ratio),u_fade_change:new n.aJ(R,c.u_fade_change),u_matrix:new n.aK(R,c.u_matrix),u_label_plane_matrix:new n.aK(R,c.u_label_plane_matrix),u_coord_matrix:new n.aK(R,c.u_coord_matrix),u_is_text:new n.aI(R,c.u_is_text),u_pitch_with_map:new n.aI(R,c.u_pitch_with_map),u_is_along_line:new n.aI(R,c.u_is_along_line),u_is_variable_anchor:new n.aI(R,c.u_is_variable_anchor),u_texsize:new n.aP(R,c.u_texsize),u_texture:new n.aI(R,c.u_texture),u_gamma_scale:new n.aJ(R,c.u_gamma_scale),u_device_pixel_ratio:new n.aJ(R,c.u_device_pixel_ratio),u_is_halo:new n.aI(R,c.u_is_halo),u_translation:new n.aP(R,c.u_translation),u_pitched_scale:new n.aJ(R,c.u_pitched_scale)}),symbolTextAndIcon:(R,c)=>({u_is_size_zoom_constant:new n.aI(R,c.u_is_size_zoom_constant),u_is_size_feature_constant:new n.aI(R,c.u_is_size_feature_constant),u_size_t:new n.aJ(R,c.u_size_t),u_size:new n.aJ(R,c.u_size),u_camera_to_center_distance:new n.aJ(R,c.u_camera_to_center_distance),u_pitch:new n.aJ(R,c.u_pitch),u_rotate_symbol:new n.aI(R,c.u_rotate_symbol),u_aspect_ratio:new n.aJ(R,c.u_aspect_ratio),u_fade_change:new n.aJ(R,c.u_fade_change),u_matrix:new n.aK(R,c.u_matrix),u_label_plane_matrix:new n.aK(R,c.u_label_plane_matrix),u_coord_matrix:new n.aK(R,c.u_coord_matrix),u_is_text:new n.aI(R,c.u_is_text),u_pitch_with_map:new n.aI(R,c.u_pitch_with_map),u_is_along_line:new n.aI(R,c.u_is_along_line),u_is_variable_anchor:new n.aI(R,c.u_is_variable_anchor),u_texsize:new n.aP(R,c.u_texsize),u_texsize_icon:new n.aP(R,c.u_texsize_icon),u_texture:new n.aI(R,c.u_texture),u_texture_icon:new n.aI(R,c.u_texture_icon),u_gamma_scale:new n.aJ(R,c.u_gamma_scale),u_device_pixel_ratio:new n.aJ(R,c.u_device_pixel_ratio),u_is_halo:new n.aI(R,c.u_is_halo),u_translation:new n.aP(R,c.u_translation),u_pitched_scale:new n.aJ(R,c.u_pitched_scale)}),background:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_opacity:new n.aJ(R,c.u_opacity),u_color:new n.aM(R,c.u_color)}),backgroundPattern:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_opacity:new n.aJ(R,c.u_opacity),u_image:new n.aI(R,c.u_image),u_pattern_tl_a:new n.aP(R,c.u_pattern_tl_a),u_pattern_br_a:new n.aP(R,c.u_pattern_br_a),u_pattern_tl_b:new n.aP(R,c.u_pattern_tl_b),u_pattern_br_b:new n.aP(R,c.u_pattern_br_b),u_texsize:new n.aP(R,c.u_texsize),u_mix:new n.aJ(R,c.u_mix),u_pattern_size_a:new n.aP(R,c.u_pattern_size_a),u_pattern_size_b:new n.aP(R,c.u_pattern_size_b),u_scale_a:new n.aJ(R,c.u_scale_a),u_scale_b:new n.aJ(R,c.u_scale_b),u_pixel_coord_upper:new n.aP(R,c.u_pixel_coord_upper),u_pixel_coord_lower:new n.aP(R,c.u_pixel_coord_lower),u_tile_units_to_pixels:new n.aJ(R,c.u_tile_units_to_pixels)}),terrain:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_texture:new n.aI(R,c.u_texture),u_ele_delta:new n.aJ(R,c.u_ele_delta),u_fog_matrix:new n.aK(R,c.u_fog_matrix),u_fog_color:new n.aM(R,c.u_fog_color),u_fog_ground_blend:new n.aJ(R,c.u_fog_ground_blend),u_fog_ground_blend_opacity:new n.aJ(R,c.u_fog_ground_blend_opacity),u_horizon_color:new n.aM(R,c.u_horizon_color),u_horizon_fog_blend:new n.aJ(R,c.u_horizon_fog_blend)}),terrainDepth:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_ele_delta:new n.aJ(R,c.u_ele_delta)}),terrainCoords:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_texture:new n.aI(R,c.u_texture),u_terrain_coords_id:new n.aJ(R,c.u_terrain_coords_id),u_ele_delta:new n.aJ(R,c.u_ele_delta)}),sky:(R,c)=>({u_sky_color:new n.aM(R,c.u_sky_color),u_horizon_color:new n.aM(R,c.u_horizon_color),u_horizon:new n.aJ(R,c.u_horizon),u_sky_horizon_blend:new n.aJ(R,c.u_sky_horizon_blend)})};class Oa{constructor(c,p,F){this.context=c;const j=c.gl;this.buffer=j.createBuffer(),this.dynamicDraw=!!F,this.context.unbindVAO(),c.bindElementBuffer.set(this.buffer),j.bufferData(j.ELEMENT_ARRAY_BUFFER,p.arrayBuffer,this.dynamicDraw?j.DYNAMIC_DRAW:j.STATIC_DRAW),this.dynamicDraw||delete p.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(c){const p=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),p.bufferSubData(p.ELEMENT_ARRAY_BUFFER,0,c.arrayBuffer)}destroy(){const c=this.context.gl;this.buffer&&(c.deleteBuffer(this.buffer),delete this.buffer)}}const Ha={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class ur{constructor(c,p,F,j){this.length=p.length,this.attributes=F,this.itemSize=p.bytesPerElement,this.dynamicDraw=j,this.context=c;const q=c.gl;this.buffer=q.createBuffer(),c.bindVertexBuffer.set(this.buffer),q.bufferData(q.ARRAY_BUFFER,p.arrayBuffer,this.dynamicDraw?q.DYNAMIC_DRAW:q.STATIC_DRAW),this.dynamicDraw||delete p.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(c){if(c.length!==this.length)throw new Error(`Length of new data is ${c.length}, which doesn't match current length of ${this.length}`);const p=this.context.gl;this.bind(),p.bufferSubData(p.ARRAY_BUFFER,0,c.arrayBuffer)}enableAttributes(c,p){for(let F=0;F<this.attributes.length;F++){const j=this.attributes[F],q=p.attributes[j.name];q!==void 0&&c.enableVertexAttribArray(q)}}setVertexAttribPointers(c,p,F){for(let j=0;j<this.attributes.length;j++){const q=this.attributes[j],ie=p.attributes[q.name];ie!==void 0&&c.vertexAttribPointer(ie,q.components,c[Ha[q.type]],!1,this.itemSize,q.offset+this.itemSize*(F||0))}}destroy(){const c=this.context.gl;this.buffer&&(c.deleteBuffer(this.buffer),delete this.buffer)}}const kr=new WeakMap;function mi(R){var c;if(kr.has(R))return kr.get(R);{const p=(c=R.getParameter(R.VERSION))===null||c===void 0?void 0:c.startsWith("WebGL 2.0");return kr.set(R,p),p}}class xr{constructor(c){this.gl=c.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(c){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class oo extends xr{getDefault(){return n.aN.transparent}set(c){const p=this.current;(c.r!==p.r||c.g!==p.g||c.b!==p.b||c.a!==p.a||this.dirty)&&(this.gl.clearColor(c.r,c.g,c.b,c.a),this.current=c,this.dirty=!1)}}class ki extends xr{getDefault(){return 1}set(c){(c!==this.current||this.dirty)&&(this.gl.clearDepth(c),this.current=c,this.dirty=!1)}}class Ui extends xr{getDefault(){return 0}set(c){(c!==this.current||this.dirty)&&(this.gl.clearStencil(c),this.current=c,this.dirty=!1)}}class Do extends xr{getDefault(){return[!0,!0,!0,!0]}set(c){const p=this.current;(c[0]!==p[0]||c[1]!==p[1]||c[2]!==p[2]||c[3]!==p[3]||this.dirty)&&(this.gl.colorMask(c[0],c[1],c[2],c[3]),this.current=c,this.dirty=!1)}}class ai extends xr{getDefault(){return!0}set(c){(c!==this.current||this.dirty)&&(this.gl.depthMask(c),this.current=c,this.dirty=!1)}}class si extends xr{getDefault(){return 255}set(c){(c!==this.current||this.dirty)&&(this.gl.stencilMask(c),this.current=c,this.dirty=!1)}}class Jo extends xr{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(c){const p=this.current;(c.func!==p.func||c.ref!==p.ref||c.mask!==p.mask||this.dirty)&&(this.gl.stencilFunc(c.func,c.ref,c.mask),this.current=c,this.dirty=!1)}}class fo extends xr{getDefault(){const c=this.gl;return[c.KEEP,c.KEEP,c.KEEP]}set(c){const p=this.current;(c[0]!==p[0]||c[1]!==p[1]||c[2]!==p[2]||this.dirty)&&(this.gl.stencilOp(c[0],c[1],c[2]),this.current=c,this.dirty=!1)}}class Vo extends xr{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;c?p.enable(p.STENCIL_TEST):p.disable(p.STENCIL_TEST),this.current=c,this.dirty=!1}}class os extends xr{getDefault(){return[0,1]}set(c){const p=this.current;(c[0]!==p[0]||c[1]!==p[1]||this.dirty)&&(this.gl.depthRange(c[0],c[1]),this.current=c,this.dirty=!1)}}class Mo extends xr{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;c?p.enable(p.DEPTH_TEST):p.disable(p.DEPTH_TEST),this.current=c,this.dirty=!1}}class Tl extends xr{getDefault(){return this.gl.LESS}set(c){(c!==this.current||this.dirty)&&(this.gl.depthFunc(c),this.current=c,this.dirty=!1)}}class Cl extends xr{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;c?p.enable(p.BLEND):p.disable(p.BLEND),this.current=c,this.dirty=!1}}class El extends xr{getDefault(){const c=this.gl;return[c.ONE,c.ZERO]}set(c){const p=this.current;(c[0]!==p[0]||c[1]!==p[1]||this.dirty)&&(this.gl.blendFunc(c[0],c[1]),this.current=c,this.dirty=!1)}}class Ro extends xr{getDefault(){return n.aN.transparent}set(c){const p=this.current;(c.r!==p.r||c.g!==p.g||c.b!==p.b||c.a!==p.a||this.dirty)&&(this.gl.blendColor(c.r,c.g,c.b,c.a),this.current=c,this.dirty=!1)}}class qs extends xr{getDefault(){return this.gl.FUNC_ADD}set(c){(c!==this.current||this.dirty)&&(this.gl.blendEquation(c),this.current=c,this.dirty=!1)}}class ms extends xr{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;c?p.enable(p.CULL_FACE):p.disable(p.CULL_FACE),this.current=c,this.dirty=!1}}class Si extends xr{getDefault(){return this.gl.BACK}set(c){(c!==this.current||this.dirty)&&(this.gl.cullFace(c),this.current=c,this.dirty=!1)}}class Xi extends xr{getDefault(){return this.gl.CCW}set(c){(c!==this.current||this.dirty)&&(this.gl.frontFace(c),this.current=c,this.dirty=!1)}}class Al extends xr{getDefault(){return null}set(c){(c!==this.current||this.dirty)&&(this.gl.useProgram(c),this.current=c,this.dirty=!1)}}class Ys extends xr{getDefault(){return this.gl.TEXTURE0}set(c){(c!==this.current||this.dirty)&&(this.gl.activeTexture(c),this.current=c,this.dirty=!1)}}class Ls extends xr{getDefault(){const c=this.gl;return[0,0,c.drawingBufferWidth,c.drawingBufferHeight]}set(c){const p=this.current;(c[0]!==p[0]||c[1]!==p[1]||c[2]!==p[2]||c[3]!==p[3]||this.dirty)&&(this.gl.viewport(c[0],c[1],c[2],c[3]),this.current=c,this.dirty=!1)}}class Ml extends xr{getDefault(){return null}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;p.bindFramebuffer(p.FRAMEBUFFER,c),this.current=c,this.dirty=!1}}class zs extends xr{getDefault(){return null}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;p.bindRenderbuffer(p.RENDERBUFFER,c),this.current=c,this.dirty=!1}}class Il extends xr{getDefault(){return null}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;p.bindTexture(p.TEXTURE_2D,c),this.current=c,this.dirty=!1}}class Pl extends xr{getDefault(){return null}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;p.bindBuffer(p.ARRAY_BUFFER,c),this.current=c,this.dirty=!1}}class Zs extends xr{getDefault(){return null}set(c){const p=this.gl;p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,c),this.current=c,this.dirty=!1}}class ko extends xr{getDefault(){return null}set(c){var p;if(c===this.current&&!this.dirty)return;const F=this.gl;mi(F)?F.bindVertexArray(c):(p=F.getExtension("OES_vertex_array_object"))===null||p===void 0||p.bindVertexArrayOES(c),this.current=c,this.dirty=!1}}class Uc extends xr{getDefault(){return 4}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;p.pixelStorei(p.UNPACK_ALIGNMENT,c),this.current=c,this.dirty=!1}}class Pc extends xr{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,c),this.current=c,this.dirty=!1}}class Wl extends xr{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,c),this.current=c,this.dirty=!1}}class Gc extends xr{constructor(c,p){super(c),this.context=c,this.parent=p}getDefault(){return null}}class Qc extends Gc{setDirty(){this.dirty=!0}set(c){if(c===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const p=this.gl;p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,p.TEXTURE_2D,c,0),this.current=c,this.dirty=!1}}class gs extends Gc{set(c){if(c===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const p=this.gl;p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_ATTACHMENT,p.RENDERBUFFER,c),this.current=c,this.dirty=!1}}class eu extends Gc{set(c){if(c===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const p=this.gl;p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_STENCIL_ATTACHMENT,p.RENDERBUFFER,c),this.current=c,this.dirty=!1}}class Pu{constructor(c,p,F,j,q){this.context=c,this.width=p,this.height=F;const ie=c.gl,pe=this.framebuffer=ie.createFramebuffer();if(this.colorAttachment=new Qc(c,pe),j)this.depthAttachment=q?new eu(c,pe):new gs(c,pe);else if(q)throw new Error("Stencil cannot be set without depth");if(ie.checkFramebufferStatus(ie.FRAMEBUFFER)!==ie.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){const c=this.context.gl,p=this.colorAttachment.get();if(p&&c.deleteTexture(p),this.depthAttachment){const F=this.depthAttachment.get();F&&c.deleteRenderbuffer(F)}c.deleteFramebuffer(this.framebuffer)}}class Ki{constructor(c,p,F){this.blendFunction=c,this.blendColor=p,this.mask=F}}Ki.Replace=[1,0],Ki.disabled=new Ki(Ki.Replace,n.aN.transparent,[!1,!1,!1,!1]),Ki.unblended=new Ki(Ki.Replace,n.aN.transparent,[!0,!0,!0,!0]),Ki.alphaBlended=new Ki([1,771],n.aN.transparent,[!0,!0,!0,!0]);class bc{constructor(c){var p,F;if(this.gl=c,this.clearColor=new oo(this),this.clearDepth=new ki(this),this.clearStencil=new Ui(this),this.colorMask=new Do(this),this.depthMask=new ai(this),this.stencilMask=new si(this),this.stencilFunc=new Jo(this),this.stencilOp=new fo(this),this.stencilTest=new Vo(this),this.depthRange=new os(this),this.depthTest=new Mo(this),this.depthFunc=new Tl(this),this.blend=new Cl(this),this.blendFunc=new El(this),this.blendColor=new Ro(this),this.blendEquation=new qs(this),this.cullFace=new ms(this),this.cullFaceSide=new Si(this),this.frontFace=new Xi(this),this.program=new Al(this),this.activeTexture=new Ys(this),this.viewport=new Ls(this),this.bindFramebuffer=new Ml(this),this.bindRenderbuffer=new zs(this),this.bindTexture=new Il(this),this.bindVertexBuffer=new Pl(this),this.bindElementBuffer=new Zs(this),this.bindVertexArray=new ko(this),this.pixelStoreUnpack=new Uc(this),this.pixelStoreUnpackPremultiplyAlpha=new Pc(this),this.pixelStoreUnpackFlipY=new Wl(this),this.extTextureFilterAnisotropic=c.getExtension("EXT_texture_filter_anisotropic")||c.getExtension("MOZ_EXT_texture_filter_anisotropic")||c.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=c.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=c.getParameter(c.MAX_TEXTURE_SIZE),mi(c)){this.HALF_FLOAT=c.HALF_FLOAT;const j=c.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(p=c.RGBA16F)!==null&&p!==void 0?p:j==null?void 0:j.RGBA16F_EXT,this.RGB16F=(F=c.RGB16F)!==null&&F!==void 0?F:j==null?void 0:j.RGB16F_EXT,c.getExtension("EXT_color_buffer_float")}else{c.getExtension("EXT_color_buffer_half_float"),c.getExtension("OES_texture_half_float_linear");const j=c.getExtension("OES_texture_half_float");this.HALF_FLOAT=j==null?void 0:j.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(c,p){return new Oa(this,c,p)}createVertexBuffer(c,p,F){return new ur(this,c,p,F)}createRenderbuffer(c,p,F){const j=this.gl,q=j.createRenderbuffer();return this.bindRenderbuffer.set(q),j.renderbufferStorage(j.RENDERBUFFER,c,p,F),this.bindRenderbuffer.set(null),q}createFramebuffer(c,p,F,j){return new Pu(this,c,p,F,j)}clear({color:c,depth:p,stencil:F}){const j=this.gl;let q=0;c&&(q|=j.COLOR_BUFFER_BIT,this.clearColor.set(c),this.colorMask.set([!0,!0,!0,!0])),p!==void 0&&(q|=j.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(p),this.depthMask.set(!0)),F!==void 0&&(q|=j.STENCIL_BUFFER_BIT,this.clearStencil.set(F),this.stencilMask.set(255)),j.clear(q)}setCullFace(c){c.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(c.mode),this.frontFace.set(c.frontFace))}setDepthMode(c){c.func!==this.gl.ALWAYS||c.mask?(this.depthTest.set(!0),this.depthFunc.set(c.func),this.depthMask.set(c.mask),this.depthRange.set(c.range)):this.depthTest.set(!1)}setStencilMode(c){c.test.func!==this.gl.ALWAYS||c.mask?(this.stencilTest.set(!0),this.stencilMask.set(c.mask),this.stencilOp.set([c.fail,c.depthFail,c.pass]),this.stencilFunc.set({func:c.test.func,ref:c.ref,mask:c.test.mask})):this.stencilTest.set(!1)}setColorMode(c){n.aF(c.blendFunction,Ki.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(c.blendFunction),this.blendColor.set(c.blendColor)),this.colorMask.set(c.mask)}createVertexArray(){var c;return mi(this.gl)?this.gl.createVertexArray():(c=this.gl.getExtension("OES_vertex_array_object"))===null||c===void 0?void 0:c.createVertexArrayOES()}deleteVertexArray(c){var p;return mi(this.gl)?this.gl.deleteVertexArray(c):(p=this.gl.getExtension("OES_vertex_array_object"))===null||p===void 0?void 0:p.deleteVertexArrayOES(c)}unbindVAO(){this.bindVertexArray.set(null)}}class Yr{constructor(c,p,F){this.func=c,this.mask=p,this.range=F}}Yr.ReadOnly=!1,Yr.ReadWrite=!0,Yr.disabled=new Yr(519,Yr.ReadOnly,[0,1]);const ql=7680;class bi{constructor(c,p,F,j,q,ie){this.test=c,this.ref=p,this.mask=F,this.fail=j,this.depthFail=q,this.pass=ie}}bi.disabled=new bi({func:519,mask:0},0,0,ql,ql,ql);class xi{constructor(c,p,F){this.enable=c,this.mode=p,this.frontFace=F}}let ys;function Ko(R,c,p,F,j){const q=R.context,ie=q.gl,pe=R.useProgram("collisionBox"),be=[];let Ae=0,Fe=0;for(let At=0;At<F.length;At++){const Tt=F[At],Rt=c.getTile(Tt).getBucket(p);if(!Rt)continue;const Et=j?Rt.textCollisionBox:Rt.iconCollisionBox,Yt=Rt.collisionCircleArray;if(Yt.length>0){const Kt=n.H();n.aR(Kt,Rt.placementInvProjMatrix,R.transform.glCoordMatrix),n.aR(Kt,Kt,Rt.placementViewportMatrix),be.push({circleArray:Yt,circleOffset:Fe,transform:Tt.posMatrix,invTransform:Kt,coord:Tt}),Ae+=Yt.length/4,Fe=Ae}Et&&pe.draw(q,ie.LINES,Yr.disabled,bi.disabled,R.colorModeForRenderPass(),xi.disabled,tn(R.transform,Tt.posMatrix),R.style.map.terrain&&R.style.map.terrain.getTerrainData(Tt),p.id,Et.layoutVertexBuffer,Et.indexBuffer,Et.segments,null,R.transform.zoom,null,null,Et.collisionVertexBuffer)}if(!j||!be.length)return;const Ge=R.useProgram("collisionCircle"),at=new n.aS;at.resize(4*Ae),at._trim();let ct=0;for(const At of be)for(let Tt=0;Tt<At.circleArray.length/4;Tt++){const Rt=4*Tt,Et=At.circleArray[Rt+0],Yt=At.circleArray[Rt+1],Kt=At.circleArray[Rt+2],Zt=At.circleArray[Rt+3];at.emplace(ct++,Et,Yt,Kt,Zt,0),at.emplace(ct++,Et,Yt,Kt,Zt,1),at.emplace(ct++,Et,Yt,Kt,Zt,2),at.emplace(ct++,Et,Yt,Kt,Zt,3)}(!ys||ys.length<2*Ae)&&(ys=function(At){const Tt=2*At,Rt=new n.aU;Rt.resize(Tt),Rt._trim();for(let Et=0;Et<Tt;Et++){const Yt=6*Et;Rt.uint16[Yt+0]=4*Et+0,Rt.uint16[Yt+1]=4*Et+1,Rt.uint16[Yt+2]=4*Et+2,Rt.uint16[Yt+3]=4*Et+2,Rt.uint16[Yt+4]=4*Et+3,Rt.uint16[Yt+5]=4*Et+0}return Rt}(Ae));const pt=q.createIndexBuffer(ys,!0),xt=q.createVertexBuffer(at,n.aT.members,!0);for(const At of be){const Tt=un(At.transform,At.invTransform,R.transform);Ge.draw(q,ie.TRIANGLES,Yr.disabled,bi.disabled,R.colorModeForRenderPass(),xi.disabled,Tt,R.style.map.terrain&&R.style.map.terrain.getTerrainData(At.coord),p.id,xt,pt,n.a0.simpleSegment(0,2*At.circleOffset,At.circleArray.length,At.circleArray.length/2),null,R.transform.zoom,null,null,null)}xt.destroy(),pt.destroy()}xi.disabled=new xi(!1,1029,2305),xi.backCCW=new xi(!0,1029,2305);const xc=n.ao(new Float32Array(16));function Bl(R,c,p,F,j){if(R.renderPass!=="translucent")return;const q=bi.disabled,ie=R.colorModeForRenderPass();(p._unevaluatedLayout.hasValue("text-variable-anchor")||p._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(pe,be,Ae,Fe,Ge,at,ct,pt,xt){const At=be.transform,Tt=Bn(),Rt=Ge==="map",Et=at==="map";for(const Yt of pe){const Kt=Fe.getTile(Yt),Zt=Kt.getBucket(Ae);if(!Zt||!Zt.text||!Zt.text.segments.get().length)continue;const hn=Zt.textSizeData,xn=n.ah(hn,At.zoom),Nn=St(Kt,1,be.transform.zoom),Dn=Vt(Yt.posMatrix,Et,Rt,be.transform,Nn),Gn=Ae.layout.get("icon-text-fit")!=="none"&&Zt.hasIconData();if(xn){const Kn=Math.pow(2,At.zoom-Kt.tileID.overscaledZ),ya=be.style.map.terrain?(wa,ia)=>be.style.map.terrain.getElevation(Yt,wa,ia):null,ea=Tt.translatePosition(At,Kt,ct,pt);mo(Zt,Rt,Et,xt,At,Dn,Yt.posMatrix,Kn,xn,Gn,Tt,ea,Yt.toUnwrapped(),ya)}}}(F,R,p,c,p.layout.get("text-rotation-alignment"),p.layout.get("text-pitch-alignment"),p.paint.get("text-translate"),p.paint.get("text-translate-anchor"),j),p.paint.get("icon-opacity").constantOr(1)!==0&&ic(R,c,p,F,!1,p.paint.get("icon-translate"),p.paint.get("icon-translate-anchor"),p.layout.get("icon-rotation-alignment"),p.layout.get("icon-pitch-alignment"),p.layout.get("icon-keep-upright"),q,ie),p.paint.get("text-opacity").constantOr(1)!==0&&ic(R,c,p,F,!0,p.paint.get("text-translate"),p.paint.get("text-translate-anchor"),p.layout.get("text-rotation-alignment"),p.layout.get("text-pitch-alignment"),p.layout.get("text-keep-upright"),q,ie),c.map.showCollisionBoxes&&(Ko(R,c,p,F,!0),Ko(R,c,p,F,!1))}function Qo(R,c,p,F,j,q){const{horizontalAlign:ie,verticalAlign:pe}=n.av(R),be=-(ie-.5)*c,Ae=-(pe-.5)*p;return new n.P((be/j+F[0])*q,(Ae/j+F[1])*q)}function ss(R,c,p,F,j,q){const ie=c.tileAnchorPoint.add(new n.P(c.translation[0],c.translation[1]));if(c.pitchWithMap){let pe=F.mult(q);return p||(pe=pe.rotate(-j)),Ut(ie.add(pe),c.labelPlaneMatrix,c.getElevation).point}if(p){const pe=Ye(c.tileAnchorPoint.x+1,c.tileAnchorPoint.y,c).point.sub(R),be=Math.atan(pe.y/pe.x)+(pe.x<0?Math.PI:0);return R.add(F.rotate(be))}return R.add(F)}function mo(R,c,p,F,j,q,ie,pe,be,Ae,Fe,Ge,at,ct){const pt=R.text.placedSymbolArray,xt=R.text.dynamicLayoutVertexArray,At=R.icon.dynamicLayoutVertexArray,Tt={};xt.clear();for(let Rt=0;Rt<pt.length;Rt++){const Et=pt.get(Rt),Yt=R.allowVerticalPlacement&&!Et.placedOrientation,Kt=Et.hidden||!Et.crossTileID||Yt?null:F[Et.crossTileID];if(Kt){const Zt=new n.P(Et.anchorX,Et.anchorY),hn={getElevation:ct,width:j.width,height:j.height,labelPlaneMatrix:q,pitchWithMap:p,projection:Fe,tileAnchorPoint:Zt,translation:Ge,unwrappedTileID:at},xn=p?Ut(Zt,ie,ct):Ye(Zt.x,Zt.y,hn),Nn=ot(j.cameraToCenterDistance,xn.signedDistanceFromCamera);let Dn=n.aj(R.textSizeData,be,Et)*Nn/n.aq;p&&(Dn*=R.tilePixelRatio/pe);const{width:Gn,height:Kn,anchor:ya,textOffset:ea,textBoxScale:wa}=Kt,ia=Qo(ya,Gn,Kn,ea,wa,Dn),Ta=Fe.getPitchedTextCorrection(j,Zt.add(new n.P(Ge[0],Ge[1])),at),fa=ss(xn.point,hn,c,ia,j.angle,Ta),Ia=R.allowVerticalPlacement&&Et.placedOrientation===n.ai.vertical?Math.PI/2:0;for(let qa=0;qa<Et.numGlyphs;qa++)n.ak(xt,fa,Ia);Ae&&Et.associatedIconIndex>=0&&(Tt[Et.associatedIconIndex]={shiftedAnchor:fa,angle:Ia})}else Dt(Et.numGlyphs,xt)}if(Ae){At.clear();const Rt=R.icon.placedSymbolArray;for(let Et=0;Et<Rt.length;Et++){const Yt=Rt.get(Et);if(Yt.hidden)Dt(Yt.numGlyphs,At);else{const Kt=Tt[Et];if(Kt)for(let Zt=0;Zt<Yt.numGlyphs;Zt++)n.ak(At,Kt.shiftedAnchor,Kt.angle);else Dt(Yt.numGlyphs,At)}}R.icon.dynamicLayoutVertexBuffer.updateData(At)}R.text.dynamicLayoutVertexBuffer.updateData(xt)}function ei(R,c,p){return p.iconsInText&&c?"symbolTextAndIcon":R?"symbolSDF":"symbolIcon"}function ic(R,c,p,F,j,q,ie,pe,be,Ae,Fe,Ge){const at=R.context,ct=at.gl,pt=R.transform,xt=Bn(),At=pe==="map",Tt=be==="map",Rt=pe!=="viewport"&&p.layout.get("symbol-placement")!=="point",Et=At&&!Tt&&!Rt,Yt=!Tt&&Rt,Kt=!p.layout.get("symbol-sort-key").isConstant();let Zt=!1;const hn=R.depthModeForSublayer(0,Yr.ReadOnly),xn=p._unevaluatedLayout.hasValue("text-variable-anchor")||p._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Nn=[],Dn=xt.getCircleRadiusCorrection(pt);for(const Gn of F){const Kn=c.getTile(Gn),ya=Kn.getBucket(p);if(!ya)continue;const ea=j?ya.text:ya.icon;if(!ea||!ea.segments.get().length||!ea.hasVisibleVertices)continue;const wa=ea.programConfigurations.get(p.id),ia=j||ya.sdfIcons,Ta=j?ya.textSizeData:ya.iconSizeData,fa=Tt||pt.pitch!==0,Ia=R.useProgram(ei(ia,j,ya),wa),qa=n.ah(Ta,pt.zoom),Ma=R.style.map.terrain&&R.style.map.terrain.getTerrainData(Gn);let Ga,nr,zr,yr,Gr=[0,0],$r=null;if(j){if(nr=Kn.glyphAtlasTexture,zr=ct.LINEAR,Ga=Kn.glyphAtlasTexture.size,ya.iconsInText){Gr=Kn.imageAtlasTexture.size,$r=Kn.imageAtlasTexture;const Or=Ta.kind==="composite"||Ta.kind==="camera";yr=fa||R.options.rotating||R.options.zooming||Or?ct.LINEAR:ct.NEAREST}}else{const Or=p.layout.get("icon-size").constantOr(0)!==1||ya.iconsNeedLinear;nr=Kn.imageAtlasTexture,zr=ia||R.options.rotating||R.options.zooming||Or||fa?ct.LINEAR:ct.NEAREST,Ga=Kn.imageAtlasTexture.size}const Zr=St(Kn,1,R.transform.zoom),oi=Yt?Gn.posMatrix:xc,Ri=Vt(oi,Tt,At,R.transform,Zr),Li=$t(oi,Tt,At,R.transform,Zr),no=$t(Gn.posMatrix,Tt,At,R.transform,Zr),ci=xt.translatePosition(R.transform,Kn,q,ie),Jr=xn&&ya.hasTextData(),Ei=p.layout.get("icon-text-fit")!=="none"&&Jr&&ya.hasIconData();if(Rt){const Or=R.style.map.terrain?(Zi,us)=>R.style.map.terrain.getElevation(Gn,Zi,us):null,_o=p.layout.get("text-rotation-alignment")==="map";ht(ya,Gn.posMatrix,R,j,Ri,no,Tt,Ae,_o,xt,Gn.toUnwrapped(),pt.width,pt.height,ci,Or)}const pi=Gn.posMatrix,ni=j&&xn||Ei,ui=Rt||ni?xc:Ri,_i=Li,Kr=ia&&p.paint.get(j?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let As;As=ia?ya.iconsInText?Ca(Ta.kind,qa,Et,Tt,Rt,ni,R,pi,ui,_i,ci,Ga,Gr,Dn):xa(Ta.kind,qa,Et,Tt,Rt,ni,R,pi,ui,_i,ci,j,Ga,!0,Dn):Ba(Ta.kind,qa,Et,Tt,Rt,ni,R,pi,ui,_i,ci,j,Ga,Dn);const Gi={program:Ia,buffers:ea,uniformValues:As,atlasTexture:nr,atlasTextureIcon:$r,atlasInterpolation:zr,atlasInterpolationIcon:yr,isSDF:ia,hasHalo:Kr};if(Kt&&ya.canOverlap){Zt=!0;const Or=ea.segments.get();for(const _o of Or)Nn.push({segments:new n.a0([_o]),sortKey:_o.sortKey,state:Gi,terrainData:Ma})}else Nn.push({segments:ea.segments,sortKey:0,state:Gi,terrainData:Ma})}Zt&&Nn.sort((Gn,Kn)=>Gn.sortKey-Kn.sortKey);for(const Gn of Nn){const Kn=Gn.state;if(at.activeTexture.set(ct.TEXTURE0),Kn.atlasTexture.bind(Kn.atlasInterpolation,ct.CLAMP_TO_EDGE),Kn.atlasTextureIcon&&(at.activeTexture.set(ct.TEXTURE1),Kn.atlasTextureIcon&&Kn.atlasTextureIcon.bind(Kn.atlasInterpolationIcon,ct.CLAMP_TO_EDGE)),Kn.isSDF){const ya=Kn.uniformValues;Kn.hasHalo&&(ya.u_is_halo=1,tu(Kn.buffers,Gn.segments,p,R,Kn.program,hn,Fe,Ge,ya,Gn.terrainData)),ya.u_is_halo=0}tu(Kn.buffers,Gn.segments,p,R,Kn.program,hn,Fe,Ge,Kn.uniformValues,Gn.terrainData)}}function tu(R,c,p,F,j,q,ie,pe,be,Ae){const Fe=F.context,Ge=Fe.gl;j.draw(Fe,Ge.TRIANGLES,q,ie,pe,xi.disabled,be,Ae,p.id,R.layoutVertexBuffer,R.indexBuffer,c,p.paint,F.transform.zoom,R.programConfigurations.get(p.id),R.dynamicLayoutVertexBuffer,R.opacityVertexBuffer)}function Ll(R,c,p,F){if(p.paint.get("heatmap-opacity")!==0)if(R.renderPass==="offscreen"){const j=R.context,q=j.gl,ie=bi.disabled,pe=new Ki([q.ONE,q.ONE],n.aN.transparent,[!0,!0,!0,!0]);(function(be,Ae,Fe){const Ge=be.gl;be.activeTexture.set(Ge.TEXTURE1),be.viewport.set([0,0,Ae.width/4,Ae.height/4]);let at=Fe.heatmapFbo;if(at)Ge.bindTexture(Ge.TEXTURE_2D,at.colorAttachment.get()),be.bindFramebuffer.set(at.framebuffer);else{const ct=Ge.createTexture();Ge.bindTexture(Ge.TEXTURE_2D,ct),Ge.texParameteri(Ge.TEXTURE_2D,Ge.TEXTURE_WRAP_S,Ge.CLAMP_TO_EDGE),Ge.texParameteri(Ge.TEXTURE_2D,Ge.TEXTURE_WRAP_T,Ge.CLAMP_TO_EDGE),Ge.texParameteri(Ge.TEXTURE_2D,Ge.TEXTURE_MIN_FILTER,Ge.LINEAR),Ge.texParameteri(Ge.TEXTURE_2D,Ge.TEXTURE_MAG_FILTER,Ge.LINEAR),at=Fe.heatmapFbo=be.createFramebuffer(Ae.width/4,Ae.height/4,!1,!1),function(pt,xt,At,Tt){var Rt,Et;const Yt=pt.gl,Kt=(Rt=pt.HALF_FLOAT)!==null&&Rt!==void 0?Rt:Yt.UNSIGNED_BYTE,Zt=(Et=pt.RGBA16F)!==null&&Et!==void 0?Et:Yt.RGBA;Yt.texImage2D(Yt.TEXTURE_2D,0,Zt,xt.width/4,xt.height/4,0,Yt.RGBA,Kt,null),Tt.colorAttachment.set(At)}(be,Ae,ct,at)}})(j,R,p),j.clear({color:n.aN.transparent});for(let be=0;be<F.length;be++){const Ae=F[be];if(c.hasRenderableParent(Ae))continue;const Fe=c.getTile(Ae),Ge=Fe.getBucket(p);if(!Ge)continue;const at=Ge.programConfigurations.get(p.id),ct=R.useProgram("heatmap",at),{zoom:pt}=R.transform;ct.draw(j,q.TRIANGLES,Yr.disabled,ie,pe,xi.disabled,On(Ae.posMatrix,Fe,pt,p.paint.get("heatmap-intensity")),null,p.id,Ge.layoutVertexBuffer,Ge.indexBuffer,Ge.segments,p.paint,R.transform.zoom,at)}j.viewport.set([0,0,R.width,R.height])}else R.renderPass==="translucent"&&(R.context.setColorMode(R.colorModeForRenderPass()),function(j,q){const ie=j.context,pe=ie.gl,be=q.heatmapFbo;if(!be)return;ie.activeTexture.set(pe.TEXTURE0),pe.bindTexture(pe.TEXTURE_2D,be.colorAttachment.get()),ie.activeTexture.set(pe.TEXTURE1);let Ae=q.colorRampTexture;Ae||(Ae=q.colorRampTexture=new L(ie,q.colorRamp,pe.RGBA)),Ae.bind(pe.LINEAR,pe.CLAMP_TO_EDGE),j.useProgram("heatmapTexture").draw(ie,pe.TRIANGLES,Yr.disabled,bi.disabled,j.colorModeForRenderPass(),xi.disabled,Yn(j,q,0,1),null,q.id,j.viewportBuffer,j.quadTriangleIndexBuffer,j.viewportSegments,q.paint,j.transform.zoom)}(R,p))}function zl(R,c,p,F,j){if(!p||!F||!F.imageAtlas)return;const q=F.imageAtlas.patternPositions;let ie=q[p.to.toString()],pe=q[p.from.toString()];if(!ie&&pe&&(ie=pe),!pe&&ie&&(pe=ie),!ie||!pe){const be=j.getPaintProperty(c);ie=q[be],pe=q[be]}ie&&pe&&R.setConstantPatternPositions(ie,pe)}function Bc(R,c,p,F,j,q,ie){const pe=R.context.gl,be="fill-pattern",Ae=p.paint.get(be),Fe=Ae&&Ae.constantOr(1),Ge=p.getCrossfadeParameters();let at,ct,pt,xt,At;ie?(ct=Fe&&!p.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",at=pe.LINES):(ct=Fe?"fillPattern":"fill",at=pe.TRIANGLES);const Tt=Ae.constantOr(null);for(const Rt of F){const Et=c.getTile(Rt);if(Fe&&!Et.patternsLoaded())continue;const Yt=Et.getBucket(p);if(!Yt)continue;const Kt=Yt.programConfigurations.get(p.id),Zt=R.useProgram(ct,Kt),hn=R.style.map.terrain&&R.style.map.terrain.getTerrainData(Rt);Fe&&(R.context.activeTexture.set(pe.TEXTURE0),Et.imageAtlasTexture.bind(pe.LINEAR,pe.CLAMP_TO_EDGE),Kt.updatePaintBuffers(Ge)),zl(Kt,be,Tt,Et,p);const xn=hn?Rt:null,Nn=xn?xn.posMatrix:Rt.posMatrix,Dn=R.translatePosMatrix(Nn,Et,p.paint.get("fill-translate"),p.paint.get("fill-translate-anchor"));if(ie){xt=Yt.indexBuffer2,At=Yt.segments2;const Gn=[pe.drawingBufferWidth,pe.drawingBufferHeight];pt=ct==="fillOutlinePattern"&&Fe?gn(Dn,R,Ge,Et,Gn):Ua(Dn,Gn)}else xt=Yt.indexBuffer,At=Yt.segments,pt=Fe?za(Dn,R,Ge,Et):ga(Dn);Zt.draw(R.context,at,j,R.stencilModeForClipping(Rt),q,xi.disabled,pt,hn,p.id,Yt.layoutVertexBuffer,xt,At,p.paint,R.transform.zoom,Kt)}}function wc(R,c,p,F,j,q,ie){const pe=R.context,be=pe.gl,Ae="fill-extrusion-pattern",Fe=p.paint.get(Ae),Ge=Fe.constantOr(1),at=p.getCrossfadeParameters(),ct=p.paint.get("fill-extrusion-opacity"),pt=Fe.constantOr(null);for(const xt of F){const At=c.getTile(xt),Tt=At.getBucket(p);if(!Tt)continue;const Rt=R.style.map.terrain&&R.style.map.terrain.getTerrainData(xt),Et=Tt.programConfigurations.get(p.id),Yt=R.useProgram(Ge?"fillExtrusionPattern":"fillExtrusion",Et);Ge&&(R.context.activeTexture.set(be.TEXTURE0),At.imageAtlasTexture.bind(be.LINEAR,be.CLAMP_TO_EDGE),Et.updatePaintBuffers(at)),zl(Et,Ae,pt,At,p);const Kt=R.translatePosMatrix(xt.posMatrix,At,p.paint.get("fill-extrusion-translate"),p.paint.get("fill-extrusion-translate-anchor")),Zt=p.paint.get("fill-extrusion-vertical-gradient"),hn=Ge?_a(Kt,R,Zt,ct,xt,at,At):aa(Kt,R,Zt,ct);Yt.draw(pe,pe.gl.TRIANGLES,j,q,ie,xi.backCCW,hn,Rt,p.id,Tt.layoutVertexBuffer,Tt.indexBuffer,Tt.segments,p.paint,R.transform.zoom,Et,R.style.map.terrain&&Tt.centroidVertexBuffer)}}function kc(R,c,p,F,j,q,ie){const pe=R.context,be=pe.gl,Ae=p.fbo;if(!Ae)return;const Fe=R.useProgram("hillshade"),Ge=R.style.map.terrain&&R.style.map.terrain.getTerrainData(c);pe.activeTexture.set(be.TEXTURE0),be.bindTexture(be.TEXTURE_2D,Ae.colorAttachment.get());const at=Ge?c:null;Fe.draw(pe,be.TRIANGLES,j,q,ie,xi.disabled,Vn(R,p,F,at),Ge,F.id,R.rasterBoundsBuffer,R.quadTriangleIndexBuffer,R.rasterBoundsSegments)}function hu(R,c,p,F,j,q){const ie=R.context,pe=ie.gl,be=c.dem;if(be&&be.data){const Ae=be.dim,Fe=be.stride,Ge=be.getPixels();if(ie.activeTexture.set(pe.TEXTURE1),ie.pixelStoreUnpackPremultiplyAlpha.set(!1),c.demTexture=c.demTexture||R.getTileTexture(Fe),c.demTexture){const ct=c.demTexture;ct.update(Ge,{premultiply:!1}),ct.bind(pe.NEAREST,pe.CLAMP_TO_EDGE)}else c.demTexture=new L(ie,Ge,pe.RGBA,{premultiply:!1}),c.demTexture.bind(pe.NEAREST,pe.CLAMP_TO_EDGE);ie.activeTexture.set(pe.TEXTURE0);let at=c.fbo;if(!at){const ct=new L(ie,{width:Ae,height:Ae,data:null},pe.RGBA);ct.bind(pe.LINEAR,pe.CLAMP_TO_EDGE),at=c.fbo=ie.createFramebuffer(Ae,Ae,!0,!1),at.colorAttachment.set(ct.texture)}ie.bindFramebuffer.set(at.framebuffer),ie.viewport.set([0,0,Ae,Ae]),R.useProgram("hillshadePrepare").draw(ie,pe.TRIANGLES,F,j,q,xi.disabled,Pn(c.tileID,be),null,p.id,R.rasterBoundsBuffer,R.quadTriangleIndexBuffer,R.rasterBoundsSegments),c.needsHillshadePrepare=!1}}function vs(R,c,p,F,j,q){const ie=F.paint.get("raster-fade-duration");if(!q&&ie>0){const pe=u.now(),be=(pe-R.timeAdded)/ie,Ae=c?(pe-c.timeAdded)/ie:-1,Fe=p.getSource(),Ge=j.coveringZoomLevel({tileSize:Fe.tileSize,roundZoom:Fe.roundZoom}),at=!c||Math.abs(c.tileID.overscaledZ-Ge)>Math.abs(R.tileID.overscaledZ-Ge),ct=at&&R.refreshedUponExpiration?1:n.ad(at?be:1-Ae,0,1);return R.refreshedUponExpiration&&be>=1&&(R.refreshedUponExpiration=!1),c?{opacity:1,mix:1-ct}:{opacity:ct,mix:0}}return{opacity:1,mix:0}}const Os=new n.aN(1,0,0,1),Ol=new n.aN(0,1,0,1),_s=new n.aN(0,0,1,1),ti=new n.aN(1,0,1,1),Hc=new n.aN(0,1,1,1);function Wc(R){const c=R.transform.padding;Lc(R,R.transform.height-(c.top||0),3,Os),Lc(R,c.bottom||0,3,Ol),So(R,c.left||0,3,_s),So(R,R.transform.width-(c.right||0),3,ti);const p=R.transform.centerPoint;(function(F,j,q,ie){Sc(F,j-1,q-10,2,20,ie),Sc(F,j-10,q-1,20,2,ie)})(R,p.x,R.transform.height-p.y,Hc)}function Lc(R,c,p,F){Sc(R,0,c+p/2,R.transform.width,p,F)}function So(R,c,p,F){Sc(R,c-p/2,0,p,R.transform.height,F)}function Sc(R,c,p,F,j,q){const ie=R.context,pe=ie.gl;pe.enable(pe.SCISSOR_TEST),pe.scissor(c*R.pixelRatio,p*R.pixelRatio,F*R.pixelRatio,j*R.pixelRatio),ie.clear({color:q}),pe.disable(pe.SCISSOR_TEST)}function xu(R,c,p){const F=R.context,j=F.gl,q=p.posMatrix,ie=R.useProgram("debug"),pe=Yr.disabled,be=bi.disabled,Ae=R.colorModeForRenderPass(),Fe="$debug",Ge=R.style.map.terrain&&R.style.map.terrain.getTerrainData(p);F.activeTexture.set(j.TEXTURE0);const at=c.getTileByID(p.key).latestRawTileData,ct=at&&at.byteLength||0,pt=Math.floor(ct/1024),xt=c.getTile(p).tileSize,At=512/Math.min(xt,512)*(p.overscaledZ/R.transform.zoom)*.5;let Tt=p.canonical.toString();p.overscaledZ!==p.canonical.z&&(Tt+=` => ${p.overscaledZ}`),function(Rt,Et){Rt.initDebugOverlayCanvas();const Yt=Rt.debugOverlayCanvas,Kt=Rt.context.gl,Zt=Rt.debugOverlayCanvas.getContext("2d");Zt.clearRect(0,0,Yt.width,Yt.height),Zt.shadowColor="white",Zt.shadowBlur=2,Zt.lineWidth=1.5,Zt.strokeStyle="white",Zt.textBaseline="top",Zt.font="bold 36px Open Sans, sans-serif",Zt.fillText(Et,5,5),Zt.strokeText(Et,5,5),Rt.debugOverlayTexture.update(Yt),Rt.debugOverlayTexture.bind(Kt.LINEAR,Kt.CLAMP_TO_EDGE)}(R,`${Tt} ${pt}kB`),ie.draw(F,j.TRIANGLES,pe,be,Ki.alphaBlended,xi.disabled,mn(q,n.aN.transparent,At),null,Fe,R.debugBuffer,R.quadTriangleIndexBuffer,R.debugSegments),ie.draw(F,j.LINE_STRIP,pe,be,Ae,xi.disabled,mn(q,n.aN.red),Ge,Fe,R.debugBuffer,R.tileBorderIndexBuffer,R.debugSegments)}function oc(R,c,p){const F=R.context,j=F.gl,q=R.colorModeForRenderPass(),ie=new Yr(j.LEQUAL,Yr.ReadWrite,R.depthRangeFor3D),pe=R.useProgram("terrain"),be=c.getTerrainMesh();F.bindFramebuffer.set(null),F.viewport.set([0,0,R.width,R.height]);for(const Ae of p){const Fe=R.renderToTexture.getTexture(Ae),Ge=c.getTerrainData(Ae.tileID);F.activeTexture.set(j.TEXTURE0),j.bindTexture(j.TEXTURE_2D,Fe.texture);const at=R.transform.calculatePosMatrix(Ae.tileID.toUnwrapped()),ct=c.getMeshFrameDelta(R.transform.zoom),pt=R.transform.calculateFogMatrix(Ae.tileID.toUnwrapped()),xt=_n(at,ct,pt,R.style.sky,R.transform.pitch);pe.draw(F,j.TRIANGLES,ie,bi.disabled,q,xi.backCCW,xt,Ge,"terrain",be.vertexBuffer,be.indexBuffer,be.segments)}}class sc{constructor(c,p,F){this.vertexBuffer=c,this.indexBuffer=p,this.segments=F}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class lc{constructor(c,p){this.context=new bc(c),this.transform=p,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:n.ao(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=He.maxUnderzooming+He.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ta}resize(c,p,F){if(this.width=Math.floor(c*F),this.height=Math.floor(p*F),this.pixelRatio=F,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const j of this.style._order)this.style._layers[j].resize()}setup(){const c=this.context,p=new n.aX;p.emplaceBack(0,0),p.emplaceBack(n.X,0),p.emplaceBack(0,n.X),p.emplaceBack(n.X,n.X),this.tileExtentBuffer=c.createVertexBuffer(p,va.members),this.tileExtentSegments=n.a0.simpleSegment(0,0,4,2);const F=new n.aX;F.emplaceBack(0,0),F.emplaceBack(n.X,0),F.emplaceBack(0,n.X),F.emplaceBack(n.X,n.X),this.debugBuffer=c.createVertexBuffer(F,va.members),this.debugSegments=n.a0.simpleSegment(0,0,4,5);const j=new n.$;j.emplaceBack(0,0,0,0),j.emplaceBack(n.X,0,n.X,0),j.emplaceBack(0,n.X,0,n.X),j.emplaceBack(n.X,n.X,n.X,n.X),this.rasterBoundsBuffer=c.createVertexBuffer(j,De.members),this.rasterBoundsSegments=n.a0.simpleSegment(0,0,4,2);const q=new n.aX;q.emplaceBack(0,0),q.emplaceBack(1,0),q.emplaceBack(0,1),q.emplaceBack(1,1),this.viewportBuffer=c.createVertexBuffer(q,va.members),this.viewportSegments=n.a0.simpleSegment(0,0,4,2);const ie=new n.aZ;ie.emplaceBack(0),ie.emplaceBack(1),ie.emplaceBack(3),ie.emplaceBack(2),ie.emplaceBack(0),this.tileBorderIndexBuffer=c.createIndexBuffer(ie);const pe=new n.aY;pe.emplaceBack(0,1,2),pe.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=c.createIndexBuffer(pe);const be=this.context.gl;this.stencilClearMode=new bi({func:be.ALWAYS,mask:0},0,255,be.ZERO,be.ZERO,be.ZERO)}clearStencil(){const c=this.context,p=c.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const F=n.H();n.aQ(F,0,this.width,this.height,0,0,1),n.K(F,F,[p.drawingBufferWidth,p.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(c,p.TRIANGLES,Yr.disabled,this.stencilClearMode,Ki.disabled,xi.disabled,Fn(F),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(c,p){if(this.currentStencilSource===c.source||!c.isTileClipped()||!p||!p.length)return;this.currentStencilSource=c.source;const F=this.context,j=F.gl;this.nextStencilID+p.length>256&&this.clearStencil(),F.setColorMode(Ki.disabled),F.setDepthMode(Yr.disabled);const q=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const ie of p){const pe=this._tileClippingMaskIDs[ie.key]=this.nextStencilID++,be=this.style.map.terrain&&this.style.map.terrain.getTerrainData(ie);q.draw(F,j.TRIANGLES,Yr.disabled,new bi({func:j.ALWAYS,mask:0},pe,255,j.KEEP,j.KEEP,j.REPLACE),Ki.disabled,xi.disabled,Fn(ie.posMatrix),be,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const c=this.nextStencilID++,p=this.context.gl;return new bi({func:p.NOTEQUAL,mask:255},c,255,p.KEEP,p.KEEP,p.REPLACE)}stencilModeForClipping(c){const p=this.context.gl;return new bi({func:p.EQUAL,mask:255},this._tileClippingMaskIDs[c.key],0,p.KEEP,p.KEEP,p.REPLACE)}stencilConfigForOverlap(c){const p=this.context.gl,F=c.sort((ie,pe)=>pe.overscaledZ-ie.overscaledZ),j=F[F.length-1].overscaledZ,q=F[0].overscaledZ-j+1;if(q>1){this.currentStencilSource=void 0,this.nextStencilID+q>256&&this.clearStencil();const ie={};for(let pe=0;pe<q;pe++)ie[pe+j]=new bi({func:p.GEQUAL,mask:255},pe+this.nextStencilID,255,p.KEEP,p.KEEP,p.REPLACE);return this.nextStencilID+=q,[ie,F]}return[{[j]:bi.disabled},F]}colorModeForRenderPass(){const c=this.context.gl;return this._showOverdrawInspector?new Ki([c.CONSTANT_COLOR,c.ONE],new n.aN(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Ki.unblended:Ki.alphaBlended}depthModeForSublayer(c,p,F){if(!this.opaquePassEnabledForLayer())return Yr.disabled;const j=1-((1+this.currentLayer)*this.numSublayers+c)*this.depthEpsilon;return new Yr(F||this.context.gl.LEQUAL,p,[j,j])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(c,p){var F;this.style=c,this.options=p,this.lineAtlas=c.lineAtlas,this.imageManager=c.imageManager,this.glyphManager=c.glyphManager,this.symbolFadeChange=c.placement.symbolFadeChange(u.now()),this.imageManager.beginFrame();const j=this.style._order,q=this.style.sourceCaches,ie={},pe={},be={};for(const Ae in q){const Fe=q[Ae];Fe.used&&Fe.prepare(this.context),ie[Ae]=Fe.getVisibleCoordinates(),pe[Ae]=ie[Ae].slice().reverse(),be[Ae]=Fe.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let Ae=0;Ae<j.length;Ae++){const Fe=j[Ae];if(this.style._layers[Fe].is3D()){this.opaquePassCutoff=Ae;break}}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const Ae of j){const Fe=this.style._layers[Ae];if(!Fe.hasOffscreenPass()||Fe.isHidden(this.transform.zoom))continue;const Ge=pe[Fe.source];(Fe.type==="custom"||Ge.length)&&this.renderLayer(this,q[Fe.source],Fe,Ge)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:p.showOverdrawInspector?n.aN.black:n.aN.transparent,depth:1}),this.clearStencil(),!((F=this.style.stylesheet)===null||F===void 0)&&F.sky&&function(Ae,Fe){const Ge=Ae.context,at=Ge.gl,ct=((Rt,Et,Yt)=>({u_sky_color:Rt.properties.get("sky-color"),u_horizon_color:Rt.properties.get("horizon-color"),u_horizon:(Et.height/2+Et.getHorizon())*Yt,u_sky_horizon_blend:Rt.properties.get("sky-horizon-blend")*Et.height/2*Yt}))(Fe,Ae.style.map.transform,Ae.pixelRatio),pt=new Yr(at.LEQUAL,Yr.ReadWrite,[0,1]),xt=bi.disabled,At=Ae.colorModeForRenderPass(),Tt=Ae.useProgram("sky");if(!Fe.mesh){const Rt=new n.aX;Rt.emplaceBack(-1,-1),Rt.emplaceBack(1,-1),Rt.emplaceBack(1,1),Rt.emplaceBack(-1,1);const Et=new n.aY;Et.emplaceBack(0,1,2),Et.emplaceBack(0,2,3),Fe.mesh=new sc(Ge.createVertexBuffer(Rt,va.members),Ge.createIndexBuffer(Et),n.a0.simpleSegment(0,0,Rt.length,Et.length))}Tt.draw(Ge,at.TRIANGLES,pt,xt,At,xi.disabled,ct,void 0,"sky",Fe.mesh.vertexBuffer,Fe.mesh.indexBuffer,Fe.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=p.showOverdrawInspector,this.depthRangeFor3D=[0,1-(c._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=j.length-1;this.currentLayer>=0;this.currentLayer--){const Ae=this.style._layers[j[this.currentLayer]],Fe=q[Ae.source],Ge=ie[Ae.source];this._renderTileClippingMasks(Ae,Ge),this.renderLayer(this,Fe,Ae,Ge)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<j.length;this.currentLayer++){const Ae=this.style._layers[j[this.currentLayer]],Fe=q[Ae.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(Ae))continue;const Ge=(Ae.type==="symbol"?be:pe)[Ae.source];this._renderTileClippingMasks(Ae,ie[Ae.source]),this.renderLayer(this,Fe,Ae,Ge)}if(this.options.showTileBoundaries){const Ae=function(Fe,Ge){let at=null;const ct=Object.values(Fe._layers).flatMap(Tt=>Tt.source&&!Tt.isHidden(Ge)?[Fe.sourceCaches[Tt.source]]:[]),pt=ct.filter(Tt=>Tt.getSource().type==="vector"),xt=ct.filter(Tt=>Tt.getSource().type!=="vector"),At=Tt=>{(!at||at.getSource().maxzoom<Tt.getSource().maxzoom)&&(at=Tt)};return pt.forEach(Tt=>At(Tt)),at||xt.forEach(Tt=>At(Tt)),at}(this.style,this.transform.zoom);Ae&&function(Fe,Ge,at){for(let ct=0;ct<at.length;ct++)xu(Fe,Ge,at[ct])}(this,Ae,Ae.getVisibleCoordinates())}this.options.showPadding&&Wc(this),this.context.setDefault()}maybeDrawDepthAndCoords(c){if(!this.style||!this.style.map||!this.style.map.terrain)return;const p=this.terrainFacilitator.matrix,F=this.transform.modelViewProjectionMatrix;let j=this.terrainFacilitator.dirty;j||(j=c?!n.a_(p,F):!n.a$(p,F)),j||(j=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),j&&(n.b0(p,F),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(q,ie){const pe=q.context,be=pe.gl,Ae=Ki.unblended,Fe=new Yr(be.LEQUAL,Yr.ReadWrite,[0,1]),Ge=ie.getTerrainMesh(),at=ie.sourceCache.getRenderableTiles(),ct=q.useProgram("terrainDepth");pe.bindFramebuffer.set(ie.getFramebuffer("depth").framebuffer),pe.viewport.set([0,0,q.width/devicePixelRatio,q.height/devicePixelRatio]),pe.clear({color:n.aN.transparent,depth:1});for(const pt of at){const xt=ie.getTerrainData(pt.tileID),At={u_matrix:q.transform.calculatePosMatrix(pt.tileID.toUnwrapped()),u_ele_delta:ie.getMeshFrameDelta(q.transform.zoom)};ct.draw(pe,be.TRIANGLES,Fe,bi.disabled,Ae,xi.backCCW,At,xt,"terrain",Ge.vertexBuffer,Ge.indexBuffer,Ge.segments)}pe.bindFramebuffer.set(null),pe.viewport.set([0,0,q.width,q.height])}(this,this.style.map.terrain),function(q,ie){const pe=q.context,be=pe.gl,Ae=Ki.unblended,Fe=new Yr(be.LEQUAL,Yr.ReadWrite,[0,1]),Ge=ie.getTerrainMesh(),at=ie.getCoordsTexture(),ct=ie.sourceCache.getRenderableTiles(),pt=q.useProgram("terrainCoords");pe.bindFramebuffer.set(ie.getFramebuffer("coords").framebuffer),pe.viewport.set([0,0,q.width/devicePixelRatio,q.height/devicePixelRatio]),pe.clear({color:n.aN.transparent,depth:1}),ie.coordsIndex=[];for(const xt of ct){const At=ie.getTerrainData(xt.tileID);pe.activeTexture.set(be.TEXTURE0),be.bindTexture(be.TEXTURE_2D,at.texture);const Tt={u_matrix:q.transform.calculatePosMatrix(xt.tileID.toUnwrapped()),u_terrain_coords_id:(255-ie.coordsIndex.length)/255,u_texture:0,u_ele_delta:ie.getMeshFrameDelta(q.transform.zoom)};pt.draw(pe,be.TRIANGLES,Fe,bi.disabled,Ae,xi.backCCW,Tt,At,"terrain",Ge.vertexBuffer,Ge.indexBuffer,Ge.segments),ie.coordsIndex.push(xt.tileID.key)}pe.bindFramebuffer.set(null),pe.viewport.set([0,0,q.width,q.height])}(this,this.style.map.terrain))}renderLayer(c,p,F,j){if(!F.isHidden(this.transform.zoom)&&(F.type==="background"||F.type==="custom"||(j||[]).length))switch(this.id=F.id,F.type){case"symbol":Bl(c,p,F,j,this.style.placement.variableOffsets);break;case"circle":(function(q,ie,pe,be){if(q.renderPass!=="translucent")return;const Ae=pe.paint.get("circle-opacity"),Fe=pe.paint.get("circle-stroke-width"),Ge=pe.paint.get("circle-stroke-opacity"),at=!pe.layout.get("circle-sort-key").isConstant();if(Ae.constantOr(1)===0&&(Fe.constantOr(1)===0||Ge.constantOr(1)===0))return;const ct=q.context,pt=ct.gl,xt=q.depthModeForSublayer(0,Yr.ReadOnly),At=bi.disabled,Tt=q.colorModeForRenderPass(),Rt=[];for(let Et=0;Et<be.length;Et++){const Yt=be[Et],Kt=ie.getTile(Yt),Zt=Kt.getBucket(pe);if(!Zt)continue;const hn=Zt.programConfigurations.get(pe.id),xn=q.useProgram("circle",hn),Nn=Zt.layoutVertexBuffer,Dn=Zt.indexBuffer,Gn=q.style.map.terrain&&q.style.map.terrain.getTerrainData(Yt),Kn={programConfiguration:hn,program:xn,layoutVertexBuffer:Nn,indexBuffer:Dn,uniformValues:Un(q,Yt,Kt,pe),terrainData:Gn};if(at){const ya=Zt.segments.get();for(const ea of ya)Rt.push({segments:new n.a0([ea]),sortKey:ea.sortKey,state:Kn})}else Rt.push({segments:Zt.segments,sortKey:0,state:Kn})}at&&Rt.sort((Et,Yt)=>Et.sortKey-Yt.sortKey);for(const Et of Rt){const{programConfiguration:Yt,program:Kt,layoutVertexBuffer:Zt,indexBuffer:hn,uniformValues:xn,terrainData:Nn}=Et.state,Dn=Et.segments;Kt.draw(ct,pt.TRIANGLES,xt,At,Tt,xi.disabled,xn,Nn,pe.id,Zt,hn,Dn,pe.paint,q.transform.zoom,Yt)}})(c,p,F,j);break;case"heatmap":Ll(c,p,F,j);break;case"line":(function(q,ie,pe,be){if(q.renderPass!=="translucent")return;const Ae=pe.paint.get("line-opacity"),Fe=pe.paint.get("line-width");if(Ae.constantOr(1)===0||Fe.constantOr(1)===0)return;const Ge=q.depthModeForSublayer(0,Yr.ReadOnly),at=q.colorModeForRenderPass(),ct=pe.paint.get("line-dasharray"),pt=pe.paint.get("line-pattern"),xt=pt.constantOr(1),At=pe.paint.get("line-gradient"),Tt=pe.getCrossfadeParameters(),Rt=xt?"linePattern":ct?"lineSDF":At?"lineGradient":"line",Et=q.context,Yt=Et.gl;let Kt=!0;for(const Zt of be){const hn=ie.getTile(Zt);if(xt&&!hn.patternsLoaded())continue;const xn=hn.getBucket(pe);if(!xn)continue;const Nn=xn.programConfigurations.get(pe.id),Dn=q.context.program.get(),Gn=q.useProgram(Rt,Nn),Kn=Kt||Gn.program!==Dn,ya=q.style.map.terrain&&q.style.map.terrain.getTerrainData(Zt),ea=pt.constantOr(null);if(ea&&hn.imageAtlas){const Ta=hn.imageAtlas,fa=Ta.patternPositions[ea.to.toString()],Ia=Ta.patternPositions[ea.from.toString()];fa&&Ia&&Nn.setConstantPatternPositions(fa,Ia)}const wa=ya?Zt:null,ia=xt?Zn(q,hn,pe,Tt,wa):ct?ca(q,hn,pe,ct,Tt,wa):At?Tn(q,hn,pe,xn.lineClipsArray.length,wa):sn(q,hn,pe,wa);if(xt)Et.activeTexture.set(Yt.TEXTURE0),hn.imageAtlasTexture.bind(Yt.LINEAR,Yt.CLAMP_TO_EDGE),Nn.updatePaintBuffers(Tt);else if(ct&&(Kn||q.lineAtlas.dirty))Et.activeTexture.set(Yt.TEXTURE0),q.lineAtlas.bind(Et);else if(At){const Ta=xn.gradients[pe.id];let fa=Ta.texture;if(pe.gradientVersion!==Ta.version){let Ia=256;if(pe.stepInterpolant){const qa=ie.getSource().maxzoom,Ma=Zt.canonical.z===qa?Math.ceil(1<<q.transform.maxZoom-Zt.canonical.z):1,Ga=xn.maxLineLength/n.X*1024*Ma;Ia=n.ad(n.aV(Ga),256,Et.maxTextureSize)}Ta.gradient=n.aW({expression:pe.gradientExpression(),evaluationKey:"lineProgress",resolution:Ia,image:Ta.gradient||void 0,clips:xn.lineClipsArray}),Ta.texture?Ta.texture.update(Ta.gradient):Ta.texture=new L(Et,Ta.gradient,Yt.RGBA),Ta.version=pe.gradientVersion,fa=Ta.texture}Et.activeTexture.set(Yt.TEXTURE0),fa.bind(pe.stepInterpolant?Yt.NEAREST:Yt.LINEAR,Yt.CLAMP_TO_EDGE)}Gn.draw(Et,Yt.TRIANGLES,Ge,q.stencilModeForClipping(Zt),at,xi.disabled,ia,ya,pe.id,xn.layoutVertexBuffer,xn.indexBuffer,xn.segments,pe.paint,q.transform.zoom,Nn,xn.layoutVertexBuffer2),Kt=!1}})(c,p,F,j);break;case"fill":(function(q,ie,pe,be){const Ae=pe.paint.get("fill-color"),Fe=pe.paint.get("fill-opacity");if(Fe.constantOr(1)===0)return;const Ge=q.colorModeForRenderPass(),at=pe.paint.get("fill-pattern"),ct=q.opaquePassEnabledForLayer()&&!at.constantOr(1)&&Ae.constantOr(n.aN.transparent).a===1&&Fe.constantOr(0)===1?"opaque":"translucent";if(q.renderPass===ct){const pt=q.depthModeForSublayer(1,q.renderPass==="opaque"?Yr.ReadWrite:Yr.ReadOnly);Bc(q,ie,pe,be,pt,Ge,!1)}if(q.renderPass==="translucent"&&pe.paint.get("fill-antialias")){const pt=q.depthModeForSublayer(pe.getPaintProperty("fill-outline-color")?2:0,Yr.ReadOnly);Bc(q,ie,pe,be,pt,Ge,!0)}})(c,p,F,j);break;case"fill-extrusion":(function(q,ie,pe,be){const Ae=pe.paint.get("fill-extrusion-opacity");if(Ae!==0&&q.renderPass==="translucent"){const Fe=new Yr(q.context.gl.LEQUAL,Yr.ReadWrite,q.depthRangeFor3D);if(Ae!==1||pe.paint.get("fill-extrusion-pattern").constantOr(1))wc(q,ie,pe,be,Fe,bi.disabled,Ki.disabled),wc(q,ie,pe,be,Fe,q.stencilModeFor3D(),q.colorModeForRenderPass());else{const Ge=q.colorModeForRenderPass();wc(q,ie,pe,be,Fe,bi.disabled,Ge)}}})(c,p,F,j);break;case"hillshade":(function(q,ie,pe,be){if(q.renderPass!=="offscreen"&&q.renderPass!=="translucent")return;const Ae=q.context,Fe=q.depthModeForSublayer(0,Yr.ReadOnly),Ge=q.colorModeForRenderPass(),[at,ct]=q.renderPass==="translucent"?q.stencilConfigForOverlap(be):[{},be];for(const pt of ct){const xt=ie.getTile(pt);xt.needsHillshadePrepare!==void 0&&xt.needsHillshadePrepare&&q.renderPass==="offscreen"?hu(q,xt,pe,Fe,bi.disabled,Ge):q.renderPass==="translucent"&&kc(q,pt,xt,pe,Fe,at[pt.overscaledZ],Ge)}Ae.viewport.set([0,0,q.width,q.height])})(c,p,F,j);break;case"raster":(function(q,ie,pe,be){if(q.renderPass!=="translucent"||pe.paint.get("raster-opacity")===0||!be.length)return;const Ae=q.context,Fe=Ae.gl,Ge=ie.getSource(),at=q.useProgram("raster"),ct=q.colorModeForRenderPass(),[pt,xt]=Ge instanceof Be?[{},be]:q.stencilConfigForOverlap(be),At=xt[xt.length-1].overscaledZ,Tt=!q.options.moving;for(const Rt of xt){const Et=q.depthModeForSublayer(Rt.overscaledZ-At,pe.paint.get("raster-opacity")===1?Yr.ReadWrite:Yr.ReadOnly,Fe.LESS),Yt=ie.getTile(Rt);Yt.registerFadeDuration(pe.paint.get("raster-fade-duration"));const Kt=ie.findLoadedParent(Rt,0),Zt=ie.findLoadedSibling(Rt),hn=vs(Yt,Kt||Zt||null,ie,pe,q.transform,q.style.map.terrain);let xn,Nn;const Dn=pe.paint.get("raster-resampling")==="nearest"?Fe.NEAREST:Fe.LINEAR;Ae.activeTexture.set(Fe.TEXTURE0),Yt.texture.bind(Dn,Fe.CLAMP_TO_EDGE,Fe.LINEAR_MIPMAP_NEAREST),Ae.activeTexture.set(Fe.TEXTURE1),Kt?(Kt.texture.bind(Dn,Fe.CLAMP_TO_EDGE,Fe.LINEAR_MIPMAP_NEAREST),xn=Math.pow(2,Kt.tileID.overscaledZ-Yt.tileID.overscaledZ),Nn=[Yt.tileID.canonical.x*xn%1,Yt.tileID.canonical.y*xn%1]):Yt.texture.bind(Dn,Fe.CLAMP_TO_EDGE,Fe.LINEAR_MIPMAP_NEAREST),Yt.texture.useMipmap&&Ae.extTextureFilterAnisotropic&&q.transform.pitch>20&&Fe.texParameterf(Fe.TEXTURE_2D,Ae.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,Ae.extTextureFilterAnisotropicMax);const Gn=q.style.map.terrain&&q.style.map.terrain.getTerrainData(Rt),Kn=Gn?Rt:null,ya=Kn?Kn.posMatrix:q.transform.calculatePosMatrix(Rt.toUnwrapped(),Tt),ea=Aa(ya,Nn||[0,0],xn||1,hn,pe);Ge instanceof Be?at.draw(Ae,Fe.TRIANGLES,Et,bi.disabled,ct,xi.disabled,ea,Gn,pe.id,Ge.boundsBuffer,q.quadTriangleIndexBuffer,Ge.boundsSegments):at.draw(Ae,Fe.TRIANGLES,Et,pt[Rt.overscaledZ],ct,xi.disabled,ea,Gn,pe.id,q.rasterBoundsBuffer,q.quadTriangleIndexBuffer,q.rasterBoundsSegments)}})(c,p,F,j);break;case"background":(function(q,ie,pe,be){const Ae=pe.paint.get("background-color"),Fe=pe.paint.get("background-opacity");if(Fe===0)return;const Ge=q.context,at=Ge.gl,ct=q.transform,pt=ct.tileSize,xt=pe.paint.get("background-pattern");if(q.isPatternMissing(xt))return;const At=!xt&&Ae.a===1&&Fe===1&&q.opaquePassEnabledForLayer()?"opaque":"translucent";if(q.renderPass!==At)return;const Tt=bi.disabled,Rt=q.depthModeForSublayer(0,At==="opaque"?Yr.ReadWrite:Yr.ReadOnly),Et=q.colorModeForRenderPass(),Yt=q.useProgram(xt?"backgroundPattern":"background"),Kt=be||ct.coveringTiles({tileSize:pt,terrain:q.style.map.terrain});xt&&(Ge.activeTexture.set(at.TEXTURE0),q.imageManager.bind(q.context));const Zt=pe.getCrossfadeParameters();for(const hn of Kt){const xn=be?hn.posMatrix:q.transform.calculatePosMatrix(hn.toUnwrapped()),Nn=xt?Ja(xn,Fe,q,xt,{tileID:hn,tileSize:pt},Zt):Fa(xn,Fe,Ae),Dn=q.style.map.terrain&&q.style.map.terrain.getTerrainData(hn);Yt.draw(Ge,at.TRIANGLES,Rt,Tt,Et,xi.disabled,Nn,Dn,pe.id,q.tileExtentBuffer,q.quadTriangleIndexBuffer,q.tileExtentSegments)}})(c,0,F,j);break;case"custom":(function(q,ie,pe){const be=q.context,Ae=pe.implementation;if(q.renderPass==="offscreen"){const Fe=Ae.prerender;Fe&&(q.setCustomLayerDefaults(),be.setColorMode(q.colorModeForRenderPass()),Fe.call(Ae,be.gl,q.transform.customLayerMatrix()),be.setDirty(),q.setBaseState())}else if(q.renderPass==="translucent"){q.setCustomLayerDefaults(),be.setColorMode(q.colorModeForRenderPass()),be.setStencilMode(bi.disabled);const Fe=Ae.renderingMode==="3d"?new Yr(q.context.gl.LEQUAL,Yr.ReadWrite,q.depthRangeFor3D):q.depthModeForSublayer(0,Yr.ReadOnly);be.setDepthMode(Fe),Ae.render(be.gl,q.transform.customLayerMatrix(),{farZ:q.transform.farZ,nearZ:q.transform.nearZ,fov:q.transform._fov,modelViewProjectionMatrix:q.transform.modelViewProjectionMatrix,projectionMatrix:q.transform.projectionMatrix}),be.setDirty(),q.setBaseState(),be.bindFramebuffer.set(null)}})(c,0,F)}}translatePosMatrix(c,p,F,j,q){if(!F[0]&&!F[1])return c;const ie=q?j==="map"?this.transform.angle:0:j==="viewport"?-this.transform.angle:0;if(ie){const Ae=Math.sin(ie),Fe=Math.cos(ie);F=[F[0]*Fe-F[1]*Ae,F[0]*Ae+F[1]*Fe]}const pe=[q?F[0]:St(p,F[0],this.transform.zoom),q?F[1]:St(p,F[1],this.transform.zoom),0],be=new Float32Array(16);return n.J(be,c,pe),be}saveTileTexture(c){const p=this._tileTextures[c.size[0]];p?p.push(c):this._tileTextures[c.size[0]]=[c]}getTileTexture(c){const p=this._tileTextures[c];return p&&p.length>0?p.pop():null}isPatternMissing(c){if(!c)return!1;if(!c.from||!c.to)return!0;const p=this.imageManager.getPattern(c.from.toString()),F=this.imageManager.getPattern(c.to.toString());return!p||!F}useProgram(c,p){this.cache=this.cache||{};const F=c+(p?p.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[F]||(this.cache[F]=new na(this.context,ba[c],p,$a[c],this._showOverdrawInspector,this.style.map.terrain)),this.cache[F]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const c=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(c.FUNC_ADD)}initDebugOverlayCanvas(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;const c=this.context.gl;this.debugOverlayTexture=new L(this.context,this.debugOverlayCanvas,c.RGBA)}}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:c,drawingBufferHeight:p}=this.context.gl;return this.width!==c||this.height!==p}}class Fs{constructor(c,p){this.points=c,this.planes=p}static fromInvProjectionMatrix(c,p,F){const j=Math.pow(2,F),q=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(pe=>{const be=1/(pe=n.ag([],pe,c))[3]/p*j;return n.b1(pe,pe,[be,be,1/pe[3],be])}),ie=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(pe=>{const be=function(at,ct){var pt=ct[0],xt=ct[1],At=ct[2],Tt=pt*pt+xt*xt+At*At;return Tt>0&&(Tt=1/Math.sqrt(Tt)),at[0]=ct[0]*Tt,at[1]=ct[1]*Tt,at[2]=ct[2]*Tt,at}([],function(at,ct,pt){var xt=ct[0],At=ct[1],Tt=ct[2],Rt=pt[0],Et=pt[1],Yt=pt[2];return at[0]=At*Yt-Tt*Et,at[1]=Tt*Rt-xt*Yt,at[2]=xt*Et-At*Rt,at}([],B([],q[pe[0]],q[pe[1]]),B([],q[pe[2]],q[pe[1]]))),Ae=(Fe=be,Ge=q[pe[1]],-(Fe[0]*Ge[0]+Fe[1]*Ge[1]+Fe[2]*Ge[2]));var Fe,Ge;return be.concat(Ae)});return new Fs(q,ie)}}class bs{constructor(c,p){this.min=c,this.max=p,this.center=function(F,j,q){return F[0]=j[0]*q,F[1]=j[1]*q,F[2]=j[2]*q,F}([],function(F,j,q){return F[0]=j[0]+q[0],F[1]=j[1]+q[1],F[2]=j[2]+q[2],F}([],this.min,this.max),.5)}quadrant(c){const p=[c%2==0,c<2],F=C(this.min),j=C(this.max);for(let q=0;q<p.length;q++)F[q]=p[q]?this.min[q]:this.center[q],j[q]=p[q]?this.center[q]:this.max[q];return j[2]=this.max[2],new bs(F,j)}distanceX(c){return Math.max(Math.min(this.max[0],c[0]),this.min[0])-c[0]}distanceY(c){return Math.max(Math.min(this.max[1],c[1]),this.min[1])-c[1]}intersects(c){const p=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]];let F=!0;for(let j=0;j<c.planes.length;j++){const q=c.planes[j];let ie=0;for(let pe=0;pe<p.length;pe++)n.b2(q,p[pe])>=0&&ie++;if(ie===0)return 0;ie!==p.length&&(F=!1)}if(F)return 2;for(let j=0;j<3;j++){let q=Number.MAX_VALUE,ie=-Number.MAX_VALUE;for(let pe=0;pe<c.points.length;pe++){const be=c.points[pe][j]-this.min[j];q=Math.min(q,be),ie=Math.max(ie,be)}if(ie<0||q>this.max[j]-this.min[j])return 0}return 1}}class Fl{constructor(c=0,p=0,F=0,j=0){if(isNaN(c)||c<0||isNaN(p)||p<0||isNaN(F)||F<0||isNaN(j)||j<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=c,this.bottom=p,this.left=F,this.right=j}interpolate(c,p,F){return p.top!=null&&c.top!=null&&(this.top=n.z.number(c.top,p.top,F)),p.bottom!=null&&c.bottom!=null&&(this.bottom=n.z.number(c.bottom,p.bottom,F)),p.left!=null&&c.left!=null&&(this.left=n.z.number(c.left,p.left,F)),p.right!=null&&c.right!=null&&(this.right=n.z.number(c.right,p.right,F)),this}getCenter(c,p){const F=n.ad((this.left+c-this.right)/2,0,c),j=n.ad((this.top+p-this.bottom)/2,0,p);return new n.P(F,j)}equals(c){return this.top===c.top&&this.bottom===c.bottom&&this.left===c.left&&this.right===c.right}clone(){return new Fl(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Tc=85.051129;class di{constructor(c,p,F,j,q){this.tileSize=512,this._renderWorldCopies=q===void 0||!!q,this._minZoom=c||0,this._maxZoom=p||22,this._minPitch=F??0,this._maxPitch=j??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new n.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Fl,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const c=new di(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return c.apply(this),c}apply(c){this.tileSize=c.tileSize,this.latRange=c.latRange,this.width=c.width,this.height=c.height,this._center=c._center,this._elevation=c._elevation,this.minElevationForCurrentTile=c.minElevationForCurrentTile,this.zoom=c.zoom,this.angle=c.angle,this._fov=c._fov,this._pitch=c._pitch,this._unmodified=c._unmodified,this._edgeInsets=c._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(c){this._minZoom!==c&&(this._minZoom=c,this.zoom=Math.max(this.zoom,c))}get maxZoom(){return this._maxZoom}set maxZoom(c){this._maxZoom!==c&&(this._maxZoom=c,this.zoom=Math.min(this.zoom,c))}get minPitch(){return this._minPitch}set minPitch(c){this._minPitch!==c&&(this._minPitch=c,this.pitch=Math.max(this.pitch,c))}get maxPitch(){return this._maxPitch}set maxPitch(c){this._maxPitch!==c&&(this._maxPitch=c,this.pitch=Math.min(this.pitch,c))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(c){c===void 0?c=!0:c===null&&(c=!1),this._renderWorldCopies=c}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new n.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(c){const p=-n.b3(c,-180,180)*Math.PI/180;this.angle!==p&&(this._unmodified=!1,this.angle=p,this._calcMatrices(),this.rotationMatrix=function(){var F=new n.A(4);return n.A!=Float32Array&&(F[1]=0,F[2]=0),F[0]=1,F[3]=1,F}(),function(F,j,q){var ie=j[0],pe=j[1],be=j[2],Ae=j[3],Fe=Math.sin(q),Ge=Math.cos(q);F[0]=ie*Ge+be*Fe,F[1]=pe*Ge+Ae*Fe,F[2]=ie*-Fe+be*Ge,F[3]=pe*-Fe+Ae*Ge}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(c){const p=n.ad(c,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==p&&(this._unmodified=!1,this._pitch=p,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(c){c=Math.max(.01,Math.min(60,c)),this._fov!==c&&(this._unmodified=!1,this._fov=c/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(c){const p=Math.min(Math.max(c,this.minZoom),this.maxZoom);this._zoom!==p&&(this._unmodified=!1,this._zoom=p,this.tileZoom=Math.max(0,Math.floor(p)),this.scale=this.zoomScale(p),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(c){c.lat===this._center.lat&&c.lng===this._center.lng||(this._unmodified=!1,this._center=c,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(c){c!==this._elevation&&(this._elevation=c,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(c){this._edgeInsets.equals(c)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,c,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(c){return this._edgeInsets.equals(c)}interpolatePadding(c,p,F){this._unmodified=!1,this._edgeInsets.interpolate(c,p,F),this._constrain(),this._calcMatrices()}coveringZoomLevel(c){const p=(c.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/c.tileSize));return Math.max(0,p)}getVisibleUnwrappedCoordinates(c){const p=[new n.b4(0,c)];if(this._renderWorldCopies){const F=this.pointCoordinate(new n.P(0,0)),j=this.pointCoordinate(new n.P(this.width,0)),q=this.pointCoordinate(new n.P(this.width,this.height)),ie=this.pointCoordinate(new n.P(0,this.height)),pe=Math.floor(Math.min(F.x,j.x,q.x,ie.x)),be=Math.floor(Math.max(F.x,j.x,q.x,ie.x)),Ae=1;for(let Fe=pe-Ae;Fe<=be+Ae;Fe++)Fe!==0&&p.push(new n.b4(Fe,c))}return p}coveringTiles(c){var p,F;let j=this.coveringZoomLevel(c);const q=j;if(c.minzoom!==void 0&&j<c.minzoom)return[];c.maxzoom!==void 0&&j>c.maxzoom&&(j=c.maxzoom);const ie=this.pointCoordinate(this.getCameraPoint()),pe=n.Z.fromLngLat(this.center),be=Math.pow(2,j),Ae=[be*ie.x,be*ie.y,0],Fe=[be*pe.x,be*pe.y,0],Ge=Fs.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,j);let at=c.minzoom||0;!c.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(at=j);const ct=c.terrain?2/Math.min(this.tileSize,c.tileSize)*this.tileSize:3,pt=Et=>({aabb:new bs([Et*be,0,0],[(Et+1)*be,be,0]),zoom:0,x:0,y:0,wrap:Et,fullyVisible:!1}),xt=[],At=[],Tt=j,Rt=c.reparseOverscaled?q:j;if(this._renderWorldCopies)for(let Et=1;Et<=3;Et++)xt.push(pt(-Et)),xt.push(pt(Et));for(xt.push(pt(0));xt.length>0;){const Et=xt.pop(),Yt=Et.x,Kt=Et.y;let Zt=Et.fullyVisible;if(!Zt){const Kn=Et.aabb.intersects(Ge);if(Kn===0)continue;Zt=Kn===2}const hn=c.terrain?Ae:Fe,xn=Et.aabb.distanceX(hn),Nn=Et.aabb.distanceY(hn),Dn=Math.max(Math.abs(xn),Math.abs(Nn)),Gn=ct+(1<<Tt-Et.zoom)-2;if(Et.zoom===Tt||Dn>Gn&&Et.zoom>=at){const Kn=Tt-Et.zoom,ya=Ae[0]-.5-(Yt<<Kn),ea=Ae[1]-.5-(Kt<<Kn);At.push({tileID:new n.S(Et.zoom===Tt?Rt:Et.zoom,Et.wrap,Et.zoom,Yt,Kt),distanceSq:E([Fe[0]-.5-Yt,Fe[1]-.5-Kt]),tileDistanceToCamera:Math.sqrt(ya*ya+ea*ea)})}else for(let Kn=0;Kn<4;Kn++){const ya=(Yt<<1)+Kn%2,ea=(Kt<<1)+(Kn>>1),wa=Et.zoom+1;let ia=Et.aabb.quadrant(Kn);if(c.terrain){const Ta=new n.S(wa,Et.wrap,wa,ya,ea),fa=c.terrain.getMinMaxElevation(Ta),Ia=(p=fa.minElevation)!==null&&p!==void 0?p:this.elevation,qa=(F=fa.maxElevation)!==null&&F!==void 0?F:this.elevation;ia=new bs([ia.min[0],ia.min[1],Ia],[ia.max[0],ia.max[1],qa])}xt.push({aabb:ia,zoom:wa,x:ya,y:ea,wrap:Et.wrap,fullyVisible:Zt})}}return At.sort((Et,Yt)=>Et.distanceSq-Yt.distanceSq).map(Et=>Et.tileID)}resize(c,p){this.width=c,this.height=p,this.pixelsToGLUnits=[2/c,-2/p],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(c){return Math.pow(2,c)}scaleZoom(c){return Math.log(c)/Math.LN2}project(c){const p=n.ad(c.lat,-85.051129,Tc);return new n.P(n.O(c.lng)*this.worldSize,n.Q(p)*this.worldSize)}unproject(c){return new n.Z(c.x/this.worldSize,c.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(c){const p=this.elevation,F=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,j=this.pointLocation(this.centerPoint,c),q=c.getElevationForLngLatZoom(j,this.tileZoom);if(!(this.elevation-q))return;const ie=F+p-q,pe=Math.cos(this._pitch)*this.cameraToCenterDistance/ie/n.b5(1,j.lat)/this.tileSize,be=this.scaleZoom(pe);this._elevation=q,this._center=j,this.zoom=be}setLocationAtPoint(c,p){const F=this.pointCoordinate(p),j=this.pointCoordinate(this.centerPoint),q=this.locationCoordinate(c),ie=new n.Z(q.x-(F.x-j.x),q.y-(F.y-j.y));this.center=this.coordinateLocation(ie),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(c,p){return p?this.coordinatePoint(this.locationCoordinate(c),p.getElevationForLngLatZoom(c,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(c))}pointLocation(c,p){return this.coordinateLocation(this.pointCoordinate(c,p))}locationCoordinate(c){return n.Z.fromLngLat(c)}coordinateLocation(c){return c&&c.toLngLat()}pointCoordinate(c,p){if(p){const pt=p.pointCoordinate(c);if(pt!=null)return pt}const F=[c.x,c.y,0,1],j=[c.x,c.y,1,1];n.ag(F,F,this.pixelMatrixInverse),n.ag(j,j,this.pixelMatrixInverse);const q=F[3],ie=j[3],pe=F[0]/q,be=j[0]/ie,Ae=F[1]/q,Fe=j[1]/ie,Ge=F[2]/q,at=j[2]/ie,ct=Ge===at?0:(0-Ge)/(at-Ge);return new n.Z(n.z.number(pe,be,ct)/this.worldSize,n.z.number(Ae,Fe,ct)/this.worldSize)}coordinatePoint(c,p=0,F=this.pixelMatrix){const j=[c.x*this.worldSize,c.y*this.worldSize,p,1];return n.ag(j,j,F),new n.P(j[0]/j[3],j[1]/j[3])}getBounds(){const c=Math.max(0,this.height/2-this.getHorizon());return new Te().extend(this.pointLocation(new n.P(0,c))).extend(this.pointLocation(new n.P(this.width,c))).extend(this.pointLocation(new n.P(this.width,this.height))).extend(this.pointLocation(new n.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new Te([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(c){c?(this.lngRange=[c.getWest(),c.getEast()],this.latRange=[c.getSouth(),c.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Tc])}calculateTileMatrix(c){const p=c.canonical,F=this.worldSize/this.zoomScale(p.z),j=p.x+Math.pow(2,p.z)*c.wrap,q=n.ao(new Float64Array(16));return n.J(q,q,[j*F,p.y*F,0]),n.K(q,q,[F/n.X,F/n.X,1]),q}calculatePosMatrix(c,p=!1){const F=c.key,j=p?this._alignedPosMatrixCache:this._posMatrixCache;if(j[F])return j[F];const q=this.calculateTileMatrix(c);return n.L(q,p?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,q),j[F]=new Float32Array(q),j[F]}calculateFogMatrix(c){const p=c.key,F=this._fogMatrixCache;if(F[p])return F[p];const j=this.calculateTileMatrix(c);return n.L(j,this.fogMatrix,j),F[p]=new Float32Array(j),F[p]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(c,p){p=n.ad(+p,this.minZoom,this.maxZoom);const F={center:new n.N(c.lng,c.lat),zoom:p};let j=this.lngRange;if(!this._renderWorldCopies&&j===null){const Et=179.9999999999;j=[-Et,Et]}const q=this.tileSize*this.zoomScale(F.zoom);let ie=0,pe=q,be=0,Ae=q,Fe=0,Ge=0;const{x:at,y:ct}=this.size;if(this.latRange){const Et=this.latRange;ie=n.Q(Et[1])*q,pe=n.Q(Et[0])*q,pe-ie<ct&&(Fe=ct/(pe-ie))}j&&(be=n.b3(n.O(j[0])*q,0,q),Ae=n.b3(n.O(j[1])*q,0,q),Ae<be&&(Ae+=q),Ae-be<at&&(Ge=at/(Ae-be)));const{x:pt,y:xt}=this.project.call({worldSize:q},c);let At,Tt;const Rt=Math.max(Ge||0,Fe||0);if(Rt){const Et=new n.P(Ge?(Ae+be)/2:pt,Fe?(pe+ie)/2:xt);return F.center=this.unproject.call({worldSize:q},Et).wrap(),F.zoom+=this.scaleZoom(Rt),F}if(this.latRange){const Et=ct/2;xt-Et<ie&&(Tt=ie+Et),xt+Et>pe&&(Tt=pe-Et)}if(j){const Et=(be+Ae)/2;let Yt=pt;this._renderWorldCopies&&(Yt=n.b3(pt,Et-q/2,Et+q/2));const Kt=at/2;Yt-Kt<be&&(At=be+Kt),Yt+Kt>Ae&&(At=Ae-Kt)}if(At!==void 0||Tt!==void 0){const Et=new n.P(At??pt,Tt??xt);F.center=this.unproject.call({worldSize:q},Et).wrap()}return F}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const c=this._unmodified,{center:p,zoom:F}=this.getConstrained(this.center,this.zoom);this.center=p,this.zoom=F,this._unmodified=c,this._constraining=!1}_calcMatrices(){if(!this.height)return;const c=this._fov/2,p=this.centerOffset,F=this.point.x,j=this.point.y;this.cameraToCenterDistance=.5/Math.tan(c)*this.height,this._pixelPerMeter=n.b5(1,this.center.lat)*this.worldSize;let q=n.ao(new Float64Array(16));n.K(q,q,[this.width/2,-this.height/2,1]),n.J(q,q,[1,-1,0]),this.labelPlaneMatrix=q,q=n.ao(new Float64Array(16)),n.K(q,q,[1,-1,1]),n.J(q,q,[-1,-1,0]),n.K(q,q,[2/this.width,2/this.height,1]),this.glCoordMatrix=q;const ie=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),pe=Math.min(this.elevation,this.minElevationForCurrentTile),be=ie-pe*this._pixelPerMeter/Math.cos(this._pitch),Ae=pe<0?be:ie,Fe=Math.PI/2+this._pitch,Ge=this._fov*(.5+p.y/this.height),at=Math.sin(Ge)*Ae/Math.sin(n.ad(Math.PI-Fe-Ge,.01,Math.PI-.01)),ct=this.getHorizon(),pt=2*Math.atan(ct/this.cameraToCenterDistance)*(.5+p.y/(2*ct)),xt=Math.sin(pt)*Ae/Math.sin(n.ad(Math.PI-Fe-pt,.01,Math.PI-.01)),At=Math.min(at,xt);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*At+Ae),this.nearZ=this.height/50,q=new Float64Array(16),n.b6(q,this._fov,this.width/this.height,this.nearZ,this.farZ),q[8]=2*-p.x/this.width,q[9]=2*p.y/this.height,this.projectionMatrix=n.af(q),n.K(q,q,[1,-1,1]),n.J(q,q,[0,0,-this.cameraToCenterDistance]),n.b7(q,q,this._pitch),n.ae(q,q,this.angle),n.J(q,q,[-F,-j,0]),this.mercatorMatrix=n.K([],q,[this.worldSize,this.worldSize,this.worldSize]),n.K(q,q,[1,1,this._pixelPerMeter]),this.pixelMatrix=n.L(new Float64Array(16),this.labelPlaneMatrix,q),n.J(q,q,[0,0,-this.elevation]),this.modelViewProjectionMatrix=q,this.invModelViewProjectionMatrix=n.at([],q),this.fogMatrix=new Float64Array(16),n.b6(this.fogMatrix,this._fov,this.width/this.height,ie,this.farZ),this.fogMatrix[8]=2*-p.x/this.width,this.fogMatrix[9]=2*p.y/this.height,n.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),n.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),n.b7(this.fogMatrix,this.fogMatrix,this._pitch),n.ae(this.fogMatrix,this.fogMatrix,this.angle),n.J(this.fogMatrix,this.fogMatrix,[-F,-j,0]),n.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),n.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=n.L(new Float64Array(16),this.labelPlaneMatrix,q);const Tt=this.width%2/2,Rt=this.height%2/2,Et=Math.cos(this.angle),Yt=Math.sin(this.angle),Kt=F-Math.round(F)+Et*Tt+Yt*Rt,Zt=j-Math.round(j)+Et*Rt+Yt*Tt,hn=new Float64Array(q);if(n.J(hn,hn,[Kt>.5?Kt-1:Kt,Zt>.5?Zt-1:Zt,0]),this.alignedModelViewProjectionMatrix=hn,q=n.at(new Float64Array(16),this.pixelMatrix),!q)throw new Error("failed to invert matrix");this.pixelMatrixInverse=q,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const c=this.pointCoordinate(new n.P(0,0)),p=[c.x*this.worldSize,c.y*this.worldSize,0,1];return n.ag(p,p,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const c=this._pitch,p=Math.tan(c)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new n.P(0,p))}getCameraQueryGeometry(c){const p=this.getCameraPoint();if(c.length===1)return[c[0],p];{let F=p.x,j=p.y,q=p.x,ie=p.y;for(const pe of c)F=Math.min(F,pe.x),j=Math.min(j,pe.y),q=Math.max(q,pe.x),ie=Math.max(ie,pe.y);return[new n.P(F,j),new n.P(q,j),new n.P(q,ie),new n.P(F,ie),new n.P(F,j)]}}lngLatToCameraDepth(c,p){const F=this.locationCoordinate(c),j=[F.x*this.worldSize,F.y*this.worldSize,p,1];return n.ag(j,j,this.modelViewProjectionMatrix),j[2]/j[3]}}function Ns(R,c){let p,F=!1,j=null,q=null;const ie=()=>{j=null,F&&(R.apply(q,p),j=setTimeout(ie,c),F=!1)};return(...pe)=>(F=!0,q=this,p=pe,j||ie(),j)}class Qi{constructor(c){this._getCurrentHash=()=>{const p=window.location.hash.replace("#","");if(this._hashName){let F;return p.split("&").map(j=>j.split("=")).forEach(j=>{j[0]===this._hashName&&(F=j)}),(F&&F[1]||"").split("/")}return p.split("/")},this._onHashChange=()=>{const p=this._getCurrentHash();if(p.length>=3&&!p.some(F=>isNaN(F))){const F=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(p[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+p[2],+p[1]],zoom:+p[0],bearing:F,pitch:+(p[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const p=window.location.href.replace(/(#.+)?$/,this.getHashString());window.history.replaceState(window.history.state,null,p)},this._removeHash=()=>{const p=this._getCurrentHash();if(p.length===0)return;const F=p.join("/");let j=F;j.split("&").length>0&&(j=j.split("&")[0]),this._hashName&&(j=`${this._hashName}=${F}`);let q=window.location.hash.replace(j,"");q.startsWith("#&")?q=q.slice(0,1)+q.slice(2):q==="#"&&(q="");let ie=window.location.href.replace(/(#.+)?$/,q);ie=ie.replace("&&","&"),window.history.replaceState(window.history.state,null,ie)},this._updateHash=Ns(this._updateHashUnthrottled,300),this._hashName=c&&encodeURIComponent(c)}addTo(c){return this._map=c,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(c){const p=this._map.getCenter(),F=Math.round(100*this._map.getZoom())/100,j=Math.ceil((F*Math.LN2+Math.log(512/360/.5))/Math.LN10),q=Math.pow(10,j),ie=Math.round(p.lng*q)/q,pe=Math.round(p.lat*q)/q,be=this._map.getBearing(),Ae=this._map.getPitch();let Fe="";if(Fe+=c?`/${ie}/${pe}/${F}`:`${F}/${pe}/${ie}`,(be||Ae)&&(Fe+="/"+Math.round(10*be)/10),Ae&&(Fe+=`/${Math.round(Ae)}`),this._hashName){const Ge=this._hashName;let at=!1;const ct=window.location.hash.slice(1).split("&").map(pt=>{const xt=pt.split("=")[0];return xt===Ge?(at=!0,`${xt}=${Fe}`):pt}).filter(pt=>pt);return at||ct.push(`${Ge}=${Fe}`),`#${ct.join("&")}`}return`#${Fe}`}}const jo={linearity:.3,easing:n.b8(0,0,.3,1)},li=n.e({deceleration:2500,maxSpeed:1400},jo),hi=n.e({deceleration:20,maxSpeed:1400},jo),xs=n.e({deceleration:1e3,maxSpeed:360},jo),Cc=n.e({deceleration:1e3,maxSpeed:90},jo);class cc{constructor(c){this._map=c,this.clear()}clear(){this._inertiaBuffer=[]}record(c){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:u.now(),settings:c})}_drainInertiaBuffer(){const c=this._inertiaBuffer,p=u.now();for(;c.length>0&&p-c[0].time>160;)c.shift()}_onMoveEnd(c){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const p={zoom:0,bearing:0,pitch:0,pan:new n.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:q}of this._inertiaBuffer)p.zoom+=q.zoomDelta||0,p.bearing+=q.bearingDelta||0,p.pitch+=q.pitchDelta||0,q.panDelta&&p.pan._add(q.panDelta),q.around&&(p.around=q.around),q.pinchAround&&(p.pinchAround=q.pinchAround);const F=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,j={};if(p.pan.mag()){const q=Zl(p.pan.mag(),F,n.e({},li,c||{}));j.offset=p.pan.mult(q.amount/p.pan.mag()),j.center=this._map.transform.center,Yl(j,q)}if(p.zoom){const q=Zl(p.zoom,F,hi);j.zoom=this._map.transform.zoom+q.amount,Yl(j,q)}if(p.bearing){const q=Zl(p.bearing,F,xs);j.bearing=this._map.transform.bearing+n.ad(q.amount,-179,179),Yl(j,q)}if(p.pitch){const q=Zl(p.pitch,F,Cc);j.pitch=this._map.transform.pitch+q.amount,Yl(j,q)}if(j.zoom||j.bearing){const q=p.pinchAround===void 0?p.around:p.pinchAround;j.around=q?this._map.unproject(q):this._map.getCenter()}return this.clear(),n.e(j,{noMoveStart:!0})}}function Yl(R,c){(!R.duration||R.duration<c.duration)&&(R.duration=c.duration,R.easing=c.easing)}function Zl(R,c,p){const{maxSpeed:F,linearity:j,deceleration:q}=p,ie=n.ad(R*j/(c/1e3),-F,F),pe=Math.abs(ie)/(q*j);return{easing:p.easing,duration:1e3*pe,amount:ie*(pe/2)}}class To extends n.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(c,p,F,j={}){const q=r.mousePos(p.getCanvas(),F),ie=p.unproject(q);super(c,n.e({point:q,lngLat:ie,originalEvent:F},j)),this._defaultPrevented=!1,this.target=p}}class go extends n.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(c,p,F){const j=c==="touchend"?F.changedTouches:F.touches,q=r.touchPos(p.getCanvasContainer(),j),ie=q.map(be=>p.unproject(be)),pe=q.reduce((be,Ae,Fe,Ge)=>be.add(Ae.div(Ge.length)),new n.P(0,0));super(c,{points:q,point:pe,lngLats:ie,lngLat:p.unproject(pe),originalEvent:F}),this._defaultPrevented=!1}}class Xs extends n.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(c,p,F){super(c,{originalEvent:F}),this._defaultPrevented=!1}}class uc{constructor(c,p){this._map=c,this._clickTolerance=p.clickTolerance}reset(){delete this._mousedownPos}wheel(c){return this._firePreventable(new Xs(c.type,this._map,c))}mousedown(c,p){return this._mousedownPos=p,this._firePreventable(new To(c.type,this._map,c))}mouseup(c){this._map.fire(new To(c.type,this._map,c))}click(c,p){this._mousedownPos&&this._mousedownPos.dist(p)>=this._clickTolerance||this._map.fire(new To(c.type,this._map,c))}dblclick(c){return this._firePreventable(new To(c.type,this._map,c))}mouseover(c){this._map.fire(new To(c.type,this._map,c))}mouseout(c){this._map.fire(new To(c.type,this._map,c))}touchstart(c){return this._firePreventable(new go(c.type,this._map,c))}touchmove(c){this._map.fire(new go(c.type,this._map,c))}touchend(c){this._map.fire(new go(c.type,this._map,c))}touchcancel(c){this._map.fire(new go(c.type,this._map,c))}_firePreventable(c){if(this._map.fire(c),c.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Io{constructor(c){this._map=c}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(c){this._map.fire(new To(c.type,this._map,c))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new To("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(c){this._delayContextMenu?this._contextMenuEvent=c:this._ignoreContextMenu||this._map.fire(new To(c.type,this._map,c)),this._map.listens("contextmenu")&&c.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ti{constructor(c){this._map=c}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(c){return this.transform.pointLocation(n.P.convert(c),this._map.terrain)}}class yo{constructor(c,p){this._map=c,this._tr=new Ti(c),this._el=c.getCanvasContainer(),this._container=c.getContainer(),this._clickTolerance=p.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(c,p){this.isEnabled()&&c.shiftKey&&c.button===0&&(r.disableDrag(),this._startPos=this._lastPos=p,this._active=!0)}mousemoveWindow(c,p){if(!this._active)return;const F=p;if(this._lastPos.equals(F)||!this._box&&F.dist(this._startPos)<this._clickTolerance)return;const j=this._startPos;this._lastPos=F,this._box||(this._box=r.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",c));const q=Math.min(j.x,F.x),ie=Math.max(j.x,F.x),pe=Math.min(j.y,F.y),be=Math.max(j.y,F.y);r.setTransform(this._box,`translate(${q}px,${pe}px)`),this._box.style.width=ie-q+"px",this._box.style.height=be-pe+"px"}mouseupWindow(c,p){if(!this._active||c.button!==0)return;const F=this._startPos,j=p;if(this.reset(),r.suppressClick(),F.x!==j.x||F.y!==j.y)return this._map.fire(new n.k("boxzoomend",{originalEvent:c})),{cameraAnimation:q=>q.fitScreenCoordinates(F,j,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",c)}keydown(c){this._active&&c.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",c))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(c,p){return this._map.fire(new n.k(c,{originalEvent:p}))}}function gi(R,c){if(R.length!==c.length)throw new Error(`The number of touches and points are not equal - touches ${R.length}, points ${c.length}`);const p={};for(let F=0;F<R.length;F++)p[R[F].identifier]=c[F];return p}class eo{constructor(c){this.reset(),this.numTouches=c.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(c,p,F){(this.centroid||F.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=c.timeStamp),F.length===this.numTouches&&(this.centroid=function(j){const q=new n.P(0,0);for(const ie of j)q._add(ie);return q.div(j.length)}(p),this.touches=gi(F,p)))}touchmove(c,p,F){if(this.aborted||!this.centroid)return;const j=gi(F,p);for(const q in this.touches){const ie=this.touches[q],pe=j[q];(!pe||pe.dist(ie)>30)&&(this.aborted=!0)}}touchend(c,p,F){if((!this.centroid||c.timeStamp-this.startTime>500)&&(this.aborted=!0),F.length===0){const j=!this.aborted&&this.centroid;if(this.reset(),j)return j}}}class yi{constructor(c){this.singleTap=new eo(c),this.numTaps=c.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(c,p,F){this.singleTap.touchstart(c,p,F)}touchmove(c,p,F){this.singleTap.touchmove(c,p,F)}touchend(c,p,F){const j=this.singleTap.touchend(c,p,F);if(j){const q=c.timeStamp-this.lastTime<500,ie=!this.lastTap||this.lastTap.dist(j)<30;if(q&&ie||this.reset(),this.count++,this.lastTime=c.timeStamp,this.lastTap=j,this.count===this.numTaps)return this.reset(),j}}}class so{constructor(c){this._tr=new Ti(c),this._zoomIn=new yi({numTouches:1,numTaps:2}),this._zoomOut=new yi({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(c,p,F){this._zoomIn.touchstart(c,p,F),this._zoomOut.touchstart(c,p,F)}touchmove(c,p,F){this._zoomIn.touchmove(c,p,F),this._zoomOut.touchmove(c,p,F)}touchend(c,p,F){const j=this._zoomIn.touchend(c,p,F),q=this._zoomOut.touchend(c,p,F),ie=this._tr;return j?(this._active=!0,c.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:pe=>pe.easeTo({duration:300,zoom:ie.zoom+1,around:ie.unproject(j)},{originalEvent:c})}):q?(this._active=!0,c.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:pe=>pe.easeTo({duration:300,zoom:ie.zoom-1,around:ie.unproject(q)},{originalEvent:c})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class vo{constructor(c){this._enabled=!!c.enable,this._moveStateManager=c.moveStateManager,this._clickTolerance=c.clickTolerance||1,this._moveFunction=c.move,this._activateOnStart=!!c.activateOnStart,c.assignEvents(this),this.reset()}reset(c){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(c)}_move(...c){const p=this._moveFunction(...c);if(p.bearingDelta||p.pitchDelta||p.around||p.panDelta)return this._active=!0,p}dragStart(c,p){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(c)&&(this._moveStateManager.startMove(c),this._lastPoint=p.length?p[0]:p,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(c,p){if(!this.isEnabled())return;const F=this._lastPoint;if(!F)return;if(c.preventDefault(),!this._moveStateManager.isValidMoveEvent(c))return void this.reset(c);const j=p.length?p[0]:p;return!this._moved&&j.dist(F)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=j,this._move(F,j))}dragEnd(c){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(c)&&(this._moved&&r.suppressClick(),this.reset(c))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Js={0:1,2:2};class es{constructor(c){this._correctEvent=c.checkCorrectEvent}startMove(c){const p=r.mouseButton(c);this._eventButton=p}endMove(c){delete this._eventButton}isValidStartEvent(c){return this._correctEvent(c)}isValidMoveEvent(c){return!function(p,F){const j=Js[F];return p.buttons===void 0||(p.buttons&j)!==j}(c,this._eventButton)}isValidEndEvent(c){return r.mouseButton(c)===this._eventButton}}class Nl{constructor(){this._firstTouch=void 0}_isOneFingerTouch(c){return c.targetTouches.length===1}_isSameTouchEvent(c){return c.targetTouches[0].identifier===this._firstTouch}startMove(c){const p=c.targetTouches[0].identifier;this._firstTouch=p}endMove(c){delete this._firstTouch}isValidStartEvent(c){return this._isOneFingerTouch(c)}isValidMoveEvent(c){return this._isOneFingerTouch(c)&&this._isSameTouchEvent(c)}isValidEndEvent(c){return this._isOneFingerTouch(c)&&this._isSameTouchEvent(c)}}const Co=R=>{R.mousedown=R.dragStart,R.mousemoveWindow=R.dragMove,R.mouseup=R.dragEnd,R.contextmenu=c=>{c.preventDefault()}},Xl=({enable:R,clickTolerance:c,bearingDegreesPerPixelMoved:p=.8})=>{const F=new es({checkCorrectEvent:j=>r.mouseButton(j)===0&&j.ctrlKey||r.mouseButton(j)===2});return new vo({clickTolerance:c,move:(j,q)=>({bearingDelta:(q.x-j.x)*p}),moveStateManager:F,enable:R,assignEvents:Co})},Ks=({enable:R,clickTolerance:c,pitchDegreesPerPixelMoved:p=-.5})=>{const F=new es({checkCorrectEvent:j=>r.mouseButton(j)===0&&j.ctrlKey||r.mouseButton(j)===2});return new vo({clickTolerance:c,move:(j,q)=>({pitchDelta:(q.y-j.y)*p}),moveStateManager:F,enable:R,assignEvents:Co})};class ws{constructor(c,p){this._clickTolerance=c.clickTolerance||1,this._map=p,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new n.P(0,0)}_shouldBePrevented(c){return c<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(c,p,F){return this._calculateTransform(c,p,F)}touchmove(c,p,F){if(this._active){if(!this._shouldBePrevented(F.length))return c.preventDefault(),this._calculateTransform(c,p,F);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",c)}}touchend(c,p,F){this._calculateTransform(c,p,F),this._active&&this._shouldBePrevented(F.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(c,p,F){F.length>0&&(this._active=!0);const j=gi(F,p),q=new n.P(0,0),ie=new n.P(0,0);let pe=0;for(const Ae in j){const Fe=j[Ae],Ge=this._touches[Ae];Ge&&(q._add(Fe),ie._add(Fe.sub(Ge)),pe++,j[Ae]=Fe)}if(this._touches=j,this._shouldBePrevented(pe)||!ie.mag())return;const be=ie.div(pe);return this._sum._add(be),this._sum.mag()<this._clickTolerance?void 0:{around:q.div(pe),panDelta:be}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class lo{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(c,p,F){this._firstTwoTouches||F.length<2||(this._firstTwoTouches=[F[0].identifier,F[1].identifier],this._start([p[0],p[1]]))}touchmove(c,p,F){if(!this._firstTwoTouches)return;c.preventDefault();const[j,q]=this._firstTwoTouches,ie=vi(F,p,j),pe=vi(F,p,q);if(!ie||!pe)return;const be=this._aroundCenter?null:ie.add(pe).div(2);return this._move([ie,pe],be,c)}touchend(c,p,F){if(!this._firstTwoTouches)return;const[j,q]=this._firstTwoTouches,ie=vi(F,p,j),pe=vi(F,p,q);ie&&pe||(this._active&&r.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(c){this._enabled=!0,this._aroundCenter=!!c&&c.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function vi(R,c,p){for(let F=0;F<R.length;F++)if(R[F].identifier===p)return c[F]}function ks(R,c){return Math.log(R/c)/Math.LN2}class sr extends lo{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(c){this._startDistance=this._distance=c[0].dist(c[1])}_move(c,p){const F=this._distance;if(this._distance=c[0].dist(c[1]),this._active||!(Math.abs(ks(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:ks(this._distance,F),pinchAround:p}}}function Ec(R,c){return 180*R.angleWith(c)/Math.PI}class qc extends lo{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(c){this._startVector=this._vector=c[0].sub(c[1]),this._minDiameter=c[0].dist(c[1])}_move(c,p,F){const j=this._vector;if(this._vector=c[0].sub(c[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Ec(this._vector,j),pinchAround:p}}_isBelowThreshold(c){this._minDiameter=Math.min(this._minDiameter,c.mag());const p=25/(Math.PI*this._minDiameter)*360,F=Ec(c,this._startVector);return Math.abs(F)<p}}function Qs(R){return Math.abs(R.y)>Math.abs(R.x)}class Dl extends lo{constructor(c){super(),this._currentTouchCount=0,this._map=c}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(c,p,F){super.touchstart(c,p,F),this._currentTouchCount=F.length}_start(c){this._lastPoints=c,Qs(c[0].sub(c[1]))&&(this._valid=!1)}_move(c,p,F){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const j=c[0].sub(this._lastPoints[0]),q=c[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(j,q,F.timeStamp),this._valid?(this._lastPoints=c,this._active=!0,{pitchDelta:(j.y+q.y)/2*-.5}):void 0}gestureBeginsVertically(c,p,F){if(this._valid!==void 0)return this._valid;const j=c.mag()>=2,q=p.mag()>=2;if(!j&&!q)return;if(!j||!q)return this._firstMove===void 0&&(this._firstMove=F),F-this._firstMove<100&&void 0;const ie=c.y>0==p.y>0;return Qs(c)&&Qs(p)&&ie}}const Sl={panStep:100,bearingStep:15,pitchStep:10};class dc{constructor(c){this._tr=new Ti(c);const p=Sl;this._panStep=p.panStep,this._bearingStep=p.bearingStep,this._pitchStep=p.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(c){if(c.altKey||c.ctrlKey||c.metaKey)return;let p=0,F=0,j=0,q=0,ie=0;switch(c.keyCode){case 61:case 107:case 171:case 187:p=1;break;case 189:case 109:case 173:p=-1;break;case 37:c.shiftKey?F=-1:(c.preventDefault(),q=-1);break;case 39:c.shiftKey?F=1:(c.preventDefault(),q=1);break;case 38:c.shiftKey?j=1:(c.preventDefault(),ie=-1);break;case 40:c.shiftKey?j=-1:(c.preventDefault(),ie=1);break;default:return}return this._rotationDisabled&&(F=0,j=0),{cameraAnimation:pe=>{const be=this._tr;pe.easeTo({duration:300,easeId:"keyboardHandler",easing:Wa,zoom:p?Math.round(be.zoom)+p*(c.shiftKey?2:1):be.zoom,bearing:be.bearing+F*this._bearingStep,pitch:be.pitch+j*this._pitchStep,offset:[-q*this._panStep,-ie*this._panStep],center:be.center},{originalEvent:c})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Wa(R){return R*(2-R)}const ts=4.000244140625;class el{constructor(c,p){this._onTimeout=F=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(F)},this._map=c,this._tr=new Ti(c),this._triggerRenderFrame=p,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(c){this._defaultZoomRate=c}setWheelZoomRate(c){this._wheelZoomRate=c}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(c){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!c&&c.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(c){return!!this._map.cooperativeGestures.isEnabled()&&!(c.ctrlKey||this._map.cooperativeGestures.isBypassed(c))}wheel(c){if(!this.isEnabled())return;if(this._shouldBePrevented(c))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",c);let p=c.deltaMode===WheelEvent.DOM_DELTA_LINE?40*c.deltaY:c.deltaY;const F=u.now(),j=F-(this._lastWheelEventTime||0);this._lastWheelEventTime=F,p!==0&&p%ts==0?this._type="wheel":p!==0&&Math.abs(p)<4?this._type="trackpad":j>400?(this._type=null,this._lastValue=p,this._timeout=setTimeout(this._onTimeout,40,c)):this._type||(this._type=Math.abs(j*p)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,p+=this._lastValue)),c.shiftKey&&p&&(p/=4),this._type&&(this._lastWheelEvent=c,this._delta-=p,this._active||this._start(c)),c.preventDefault()}_start(c){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const p=r.mousePos(this._map.getCanvas(),c),F=this._tr;p.y>F.transform.height/2-F.transform.getHorizon()?this._around=n.N.convert(this._aroundCenter?F.center:F.unproject(p)):this._around=n.N.convert(F.center),this._aroundPoint=F.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const c=this._tr.transform;if(this._delta!==0){const be=this._type==="wheel"&&Math.abs(this._delta)>ts?this._wheelZoomRate:this._defaultZoomRate;let Ae=2/(1+Math.exp(-Math.abs(this._delta*be)));this._delta<0&&Ae!==0&&(Ae=1/Ae);const Fe=typeof this._targetZoom=="number"?c.zoomScale(this._targetZoom):c.scale;this._targetZoom=Math.min(c.maxZoom,Math.max(c.minZoom,c.scaleZoom(Fe*Ae))),this._type==="wheel"&&(this._startZoom=c.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const p=typeof this._targetZoom=="number"?this._targetZoom:c.zoom,F=this._startZoom,j=this._easing;let q,ie=!1;const pe=u.now()-this._lastWheelEventTime;if(this._type==="wheel"&&F&&j&&pe){const be=Math.min(pe/200,1),Ae=j(be);q=n.z.number(F,p,Ae),be<1?this._frameId||(this._frameId=!0):ie=!0}else q=p,ie=!0;return this._active=!0,ie&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!ie,zoomDelta:q-c.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(c){let p=n.b9;if(this._prevEase){const F=this._prevEase,j=(u.now()-F.start)/F.duration,q=F.easing(j+.01)-F.easing(j),ie=.27/Math.sqrt(q*q+1e-4)*.01,pe=Math.sqrt(.0729-ie*ie);p=n.b8(ie,pe,.25,1)}return this._prevEase={start:u.now(),duration:c,easing:p},p}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Ci{constructor(c,p){this._clickZoom=c,this._tapZoom=p}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class $o{constructor(c){this._tr=new Ti(c),this.reset()}reset(){this._active=!1}dblclick(c,p){return c.preventDefault(),{cameraAnimation:F=>{F.easeTo({duration:300,zoom:this._tr.zoom+(c.shiftKey?-1:1),around:this._tr.unproject(p)},{originalEvent:c})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class tl{constructor(){this._tap=new yi({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(c,p,F){if(!this._swipePoint)if(this._tapTime){const j=p[0],q=c.timeStamp-this._tapTime<500,ie=this._tapPoint.dist(j)<30;q&&ie?F.length>0&&(this._swipePoint=j,this._swipeTouch=F[0].identifier):this.reset()}else this._tap.touchstart(c,p,F)}touchmove(c,p,F){if(this._tapTime){if(this._swipePoint){if(F[0].identifier!==this._swipeTouch)return;const j=p[0],q=j.y-this._swipePoint.y;return this._swipePoint=j,c.preventDefault(),this._active=!0,{zoomDelta:q/128}}}else this._tap.touchmove(c,p,F)}touchend(c,p,F){if(this._tapTime)this._swipePoint&&F.length===0&&this.reset();else{const j=this._tap.touchend(c,p,F);j&&(this._tapTime=c.timeStamp,this._tapPoint=j)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ss{constructor(c,p,F){this._el=c,this._mousePan=p,this._touchPan=F}enable(c){this._inertiaOptions=c||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Po{constructor(c,p,F){this._pitchWithRotate=c.pitchWithRotate,this._mouseRotate=p,this._mousePitch=F}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class nl{constructor(c,p,F,j){this._el=c,this._touchZoom=p,this._touchRotate=F,this._tapDragZoom=j,this._rotationDisabled=!1,this._enabled=!0}enable(c){this._touchZoom.enable(c),this._rotationDisabled||this._touchRotate.enable(c),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class ls{constructor(c,p){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=c,this._options=p,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const c=this._map.getCanvasContainer();c.classList.add("maplibregl-cooperative-gestures"),this._container=r.create("div","maplibregl-cooperative-gesture-screen",c);let p=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(p=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const F=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),j=document.createElement("div");j.className="maplibregl-desktop-message",j.textContent=p,this._container.appendChild(j);const q=document.createElement("div");q.className="maplibregl-mobile-message",q.textContent=F,this._container.appendChild(q),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(r.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(c){return c[this._bypassKey]}notifyGestureBlocked(c,p){this._enabled&&(this._map.fire(new n.k("cooperativegestureprevented",{gestureType:c,originalEvent:p})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Uo=R=>R.zoom||R.drag||R.pitch||R.rotate;class Ts extends n.k{}function ar(R){return R.panDelta&&R.panDelta.mag()||R.zoomDelta||R.bearingDelta||R.pitchDelta}class ri{constructor(c,p){this.handleWindowEvent=j=>{this.handleEvent(j,`${j.type}Window`)},this.handleEvent=(j,q)=>{if(j.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const ie=j.type==="renderFrame"?void 0:j,pe={needsRenderFrame:!1},be={},Ae={},Fe=j.touches,Ge=Fe?this._getMapTouches(Fe):void 0,at=Ge?r.touchPos(this._map.getCanvas(),Ge):r.mousePos(this._map.getCanvas(),j);for(const{handlerName:xt,handler:At,allowed:Tt}of this._handlers){if(!At.isEnabled())continue;let Rt;this._blockedByActive(Ae,Tt,xt)?At.reset():At[q||j.type]&&(Rt=At[q||j.type](j,at,Ge),this.mergeHandlerResult(pe,be,Rt,xt,ie),Rt&&Rt.needsRenderFrame&&this._triggerRenderFrame()),(Rt||At.isActive())&&(Ae[xt]=At)}const ct={};for(const xt in this._previousActiveHandlers)Ae[xt]||(ct[xt]=ie);this._previousActiveHandlers=Ae,(Object.keys(ct).length||ar(pe))&&(this._changes.push([pe,be,ct]),this._triggerRenderFrame()),(Object.keys(Ae).length||ar(pe))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:pt}=pe;pt&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],pt(this._map))},this._map=c,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new cc(c),this._bearingSnap=p.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(p);const F=this._el;this._listeners=[[F,"touchstart",{passive:!0}],[F,"touchmove",{passive:!1}],[F,"touchend",void 0],[F,"touchcancel",void 0],[F,"mousedown",void 0],[F,"mousemove",void 0],[F,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[F,"mouseover",void 0],[F,"mouseout",void 0],[F,"dblclick",void 0],[F,"click",void 0],[F,"keydown",{capture:!1}],[F,"keyup",void 0],[F,"wheel",{passive:!1}],[F,"contextmenu",void 0],[window,"blur",void 0]];for(const[j,q,ie]of this._listeners)r.addEventListener(j,q,j===document?this.handleWindowEvent:this.handleEvent,ie)}destroy(){for(const[c,p,F]of this._listeners)r.removeEventListener(c,p,c===document?this.handleWindowEvent:this.handleEvent,F)}_addDefaultHandlers(c){const p=this._map,F=p.getCanvasContainer();this._add("mapEvent",new uc(p,c));const j=p.boxZoom=new yo(p,c);this._add("boxZoom",j),c.interactive&&c.boxZoom&&j.enable();const q=p.cooperativeGestures=new ls(p,c.cooperativeGestures);this._add("cooperativeGestures",q),c.cooperativeGestures&&q.enable();const ie=new so(p),pe=new $o(p);p.doubleClickZoom=new Ci(pe,ie),this._add("tapZoom",ie),this._add("clickZoom",pe),c.interactive&&c.doubleClickZoom&&p.doubleClickZoom.enable();const be=new tl;this._add("tapDragZoom",be);const Ae=p.touchPitch=new Dl(p);this._add("touchPitch",Ae),c.interactive&&c.touchPitch&&p.touchPitch.enable(c.touchPitch);const Fe=Xl(c),Ge=Ks(c);p.dragRotate=new Po(c,Fe,Ge),this._add("mouseRotate",Fe,["mousePitch"]),this._add("mousePitch",Ge,["mouseRotate"]),c.interactive&&c.dragRotate&&p.dragRotate.enable();const at=(({enable:Rt,clickTolerance:Et})=>{const Yt=new es({checkCorrectEvent:Kt=>r.mouseButton(Kt)===0&&!Kt.ctrlKey});return new vo({clickTolerance:Et,move:(Kt,Zt)=>({around:Zt,panDelta:Zt.sub(Kt)}),activateOnStart:!0,moveStateManager:Yt,enable:Rt,assignEvents:Co})})(c),ct=new ws(c,p);p.dragPan=new Ss(F,at,ct),this._add("mousePan",at),this._add("touchPan",ct,["touchZoom","touchRotate"]),c.interactive&&c.dragPan&&p.dragPan.enable(c.dragPan);const pt=new qc,xt=new sr;p.touchZoomRotate=new nl(F,xt,pt,be),this._add("touchRotate",pt,["touchPan","touchZoom"]),this._add("touchZoom",xt,["touchPan","touchRotate"]),c.interactive&&c.touchZoomRotate&&p.touchZoomRotate.enable(c.touchZoomRotate);const At=p.scrollZoom=new el(p,()=>this._triggerRenderFrame());this._add("scrollZoom",At,["mousePan"]),c.interactive&&c.scrollZoom&&p.scrollZoom.enable(c.scrollZoom);const Tt=p.keyboard=new dc(p);this._add("keyboard",Tt),c.interactive&&c.keyboard&&p.keyboard.enable(),this._add("blockableMapEvent",new Io(p))}_add(c,p,F){this._handlers.push({handlerName:c,handler:p,allowed:F}),this._handlersById[c]=p}stop(c){if(!this._updatingCamera){for(const{handler:p}of this._handlers)p.reset();this._inertia.clear(),this._fireEvents({},{},c),this._changes=[]}}isActive(){for(const{handler:c}of this._handlers)if(c.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Uo(this._eventsInProgress)||this.isZooming()}_blockedByActive(c,p,F){for(const j in c)if(j!==F&&(!p||p.indexOf(j)<0))return!0;return!1}_getMapTouches(c){const p=[];for(const F of c){const j=F.target;this._el.contains(j)&&p.push(F)}return p}mergeHandlerResult(c,p,F,j,q){if(!F)return;n.e(c,F);const ie={handlerName:j,originalEvent:F.originalEvent||q};F.zoomDelta!==void 0&&(p.zoom=ie),F.panDelta!==void 0&&(p.drag=ie),F.pitchDelta!==void 0&&(p.pitch=ie),F.bearingDelta!==void 0&&(p.rotate=ie)}_applyChanges(){const c={},p={},F={};for(const[j,q,ie]of this._changes)j.panDelta&&(c.panDelta=(c.panDelta||new n.P(0,0))._add(j.panDelta)),j.zoomDelta&&(c.zoomDelta=(c.zoomDelta||0)+j.zoomDelta),j.bearingDelta&&(c.bearingDelta=(c.bearingDelta||0)+j.bearingDelta),j.pitchDelta&&(c.pitchDelta=(c.pitchDelta||0)+j.pitchDelta),j.around!==void 0&&(c.around=j.around),j.pinchAround!==void 0&&(c.pinchAround=j.pinchAround),j.noInertia&&(c.noInertia=j.noInertia),n.e(p,q),n.e(F,ie);this._updateMapTransform(c,p,F),this._changes=[]}_updateMapTransform(c,p,F){const j=this._map,q=j._getTransformForUpdate(),ie=j.terrain;if(!(ar(c)||ie&&this._terrainMovement))return this._fireEvents(p,F,!0);let{panDelta:pe,zoomDelta:be,bearingDelta:Ae,pitchDelta:Fe,around:Ge,pinchAround:at}=c;at!==void 0&&(Ge=at),j._stop(!0),Ge=Ge||j.transform.centerPoint;const ct=q.pointLocation(pe?Ge.sub(pe):Ge);Ae&&(q.bearing+=Ae),Fe&&(q.pitch+=Fe),be&&(q.zoom+=be),ie?this._terrainMovement||!p.drag&&!p.zoom?p.drag&&this._terrainMovement?q.center=q.pointLocation(q.centerPoint.sub(pe)):q.setLocationAtPoint(ct,Ge):(this._terrainMovement=!0,this._map._elevationFreeze=!0,q.setLocationAtPoint(ct,Ge)):q.setLocationAtPoint(ct,Ge),j._applyUpdatedTransform(q),this._map._update(),c.noInertia||this._inertia.record(c),this._fireEvents(p,F,!0)}_fireEvents(c,p,F){const j=Uo(this._eventsInProgress),q=Uo(c),ie={};for(const Ge in c){const{originalEvent:at}=c[Ge];this._eventsInProgress[Ge]||(ie[`${Ge}start`]=at),this._eventsInProgress[Ge]=c[Ge]}!j&&q&&this._fireEvent("movestart",q.originalEvent);for(const Ge in ie)this._fireEvent(Ge,ie[Ge]);q&&this._fireEvent("move",q.originalEvent);for(const Ge in c){const{originalEvent:at}=c[Ge];this._fireEvent(Ge,at)}const pe={};let be;for(const Ge in this._eventsInProgress){const{handlerName:at,originalEvent:ct}=this._eventsInProgress[Ge];this._handlersById[at].isActive()||(delete this._eventsInProgress[Ge],be=p[at]||ct,pe[`${Ge}end`]=be)}for(const Ge in pe)this._fireEvent(Ge,pe[Ge]);const Ae=Uo(this._eventsInProgress),Fe=(j||q)&&!Ae;if(Fe&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const Ge=this._map._getTransformForUpdate();Ge.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(Ge)}if(F&&Fe){this._updatingCamera=!0;const Ge=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),at=ct=>ct!==0&&-this._bearingSnap<ct&&ct<this._bearingSnap;!Ge||!Ge.essential&&u.prefersReducedMotion?(this._map.fire(new n.k("moveend",{originalEvent:be})),at(this._map.getBearing())&&this._map.resetNorth()):(at(Ge.bearing||this._map.getBearing())&&(Ge.bearing=0),Ge.freezeElevation=!0,this._map.easeTo(Ge,{originalEvent:be})),this._updatingCamera=!1}}_fireEvent(c,p){this._map.fire(new n.k(c,p?{originalEvent:p}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(c=>{delete this._frameId,this.handleEvent(new Ts("renderFrame",{timeStamp:c})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class to extends n.E{constructor(c,p){super(),this._renderFrameCallback=()=>{const F=Math.min((u.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(F)),F<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=c,this._bearingSnap=p.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new n.N(this.transform.center.lng,this.transform.center.lat)}setCenter(c,p){return this.jumpTo({center:c},p)}panBy(c,p,F){return c=n.P.convert(c).mult(-1),this.panTo(this.transform.center,n.e({offset:c},p),F)}panTo(c,p,F){return this.easeTo(n.e({center:c},p),F)}getZoom(){return this.transform.zoom}setZoom(c,p){return this.jumpTo({zoom:c},p),this}zoomTo(c,p,F){return this.easeTo(n.e({zoom:c},p),F)}zoomIn(c,p){return this.zoomTo(this.getZoom()+1,c,p),this}zoomOut(c,p){return this.zoomTo(this.getZoom()-1,c,p),this}getBearing(){return this.transform.bearing}setBearing(c,p){return this.jumpTo({bearing:c},p),this}getPadding(){return this.transform.padding}setPadding(c,p){return this.jumpTo({padding:c},p),this}rotateTo(c,p,F){return this.easeTo(n.e({bearing:c},p),F)}resetNorth(c,p){return this.rotateTo(0,n.e({duration:1e3},c),p),this}resetNorthPitch(c,p){return this.easeTo(n.e({bearing:0,pitch:0,duration:1e3},c),p),this}snapToNorth(c,p){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(c,p):this}getPitch(){return this.transform.pitch}setPitch(c,p){return this.jumpTo({pitch:c},p),this}cameraForBounds(c,p){c=Te.convert(c);const F=p&&p.bearing||0;return this._cameraForBoxAndBearing(c.getNorthWest(),c.getSouthEast(),F,p)}_cameraForBoxAndBearing(c,p,F,j){const q={top:0,bottom:0,right:0,left:0};if(typeof(j=n.e({padding:q,offset:[0,0],maxZoom:this.transform.maxZoom},j)).padding=="number"){const ya=j.padding;j.padding={top:ya,bottom:ya,right:ya,left:ya}}j.padding=n.e(q,j.padding);const ie=this.transform,pe=ie.padding,be=new Te(c,p),Ae=ie.project(be.getNorthWest()),Fe=ie.project(be.getNorthEast()),Ge=ie.project(be.getSouthEast()),at=ie.project(be.getSouthWest()),ct=n.ba(-F),pt=Ae.rotate(ct),xt=Fe.rotate(ct),At=Ge.rotate(ct),Tt=at.rotate(ct),Rt=new n.P(Math.max(pt.x,xt.x,Tt.x,At.x),Math.max(pt.y,xt.y,Tt.y,At.y)),Et=new n.P(Math.min(pt.x,xt.x,Tt.x,At.x),Math.min(pt.y,xt.y,Tt.y,At.y)),Yt=Rt.sub(Et),Kt=(ie.width-(pe.left+pe.right+j.padding.left+j.padding.right))/Yt.x,Zt=(ie.height-(pe.top+pe.bottom+j.padding.top+j.padding.bottom))/Yt.y;if(Zt<0||Kt<0)return void n.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");const hn=Math.min(ie.scaleZoom(ie.scale*Math.min(Kt,Zt)),j.maxZoom),xn=n.P.convert(j.offset),Nn=(j.padding.left-j.padding.right)/2,Dn=(j.padding.top-j.padding.bottom)/2,Gn=new n.P(Nn,Dn).rotate(n.ba(F)),Kn=xn.add(Gn).mult(ie.scale/ie.zoomScale(hn));return{center:ie.unproject(Ae.add(Ge).div(2).sub(Kn)),zoom:hn,bearing:F}}fitBounds(c,p,F){return this._fitInternal(this.cameraForBounds(c,p),p,F)}fitScreenCoordinates(c,p,F,j,q){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(n.P.convert(c)),this.transform.pointLocation(n.P.convert(p)),F,j),j,q)}_fitInternal(c,p,F){return c?(delete(p=n.e(c,p)).padding,p.linear?this.easeTo(p,F):this.flyTo(p,F)):this}jumpTo(c,p){this.stop();const F=this._getTransformForUpdate();let j=!1,q=!1,ie=!1;return"zoom"in c&&F.zoom!==+c.zoom&&(j=!0,F.zoom=+c.zoom),c.center!==void 0&&(F.center=n.N.convert(c.center)),"bearing"in c&&F.bearing!==+c.bearing&&(q=!0,F.bearing=+c.bearing),"pitch"in c&&F.pitch!==+c.pitch&&(ie=!0,F.pitch=+c.pitch),c.padding==null||F.isPaddingEqual(c.padding)||(F.padding=c.padding),this._applyUpdatedTransform(F),this.fire(new n.k("movestart",p)).fire(new n.k("move",p)),j&&this.fire(new n.k("zoomstart",p)).fire(new n.k("zoom",p)).fire(new n.k("zoomend",p)),q&&this.fire(new n.k("rotatestart",p)).fire(new n.k("rotate",p)).fire(new n.k("rotateend",p)),ie&&this.fire(new n.k("pitchstart",p)).fire(new n.k("pitch",p)).fire(new n.k("pitchend",p)),this.fire(new n.k("moveend",p))}calculateCameraOptionsFromTo(c,p,F,j=0){const q=n.Z.fromLngLat(c,p),ie=n.Z.fromLngLat(F,j),pe=ie.x-q.x,be=ie.y-q.y,Ae=ie.z-q.z,Fe=Math.hypot(pe,be,Ae);if(Fe===0)throw new Error("Can't calculate camera options with same From and To");const Ge=Math.hypot(pe,be),at=this.transform.scaleZoom(this.transform.cameraToCenterDistance/Fe/this.transform.tileSize),ct=180*Math.atan2(pe,-be)/Math.PI;let pt=180*Math.acos(Ge/Fe)/Math.PI;return pt=Ae<0?90-pt:90+pt,{center:ie.toLngLat(),zoom:at,pitch:pt,bearing:ct}}easeTo(c,p){var F;this._stop(!1,c.easeId),((c=n.e({offset:[0,0],duration:500,easing:n.b9},c)).animate===!1||!c.essential&&u.prefersReducedMotion)&&(c.duration=0);const j=this._getTransformForUpdate(),q=j.zoom,ie=j.bearing,pe=j.pitch,be=j.padding,Ae="bearing"in c?this._normalizeBearing(c.bearing,ie):ie,Fe="pitch"in c?+c.pitch:pe,Ge="padding"in c?c.padding:j.padding,at=n.P.convert(c.offset);let ct=j.centerPoint.add(at);const pt=j.pointLocation(ct),{center:xt,zoom:At}=j.getConstrained(n.N.convert(c.center||pt),(F=c.zoom)!==null&&F!==void 0?F:q);this._normalizeCenter(xt,j);const Tt=j.project(pt),Rt=j.project(xt).sub(Tt),Et=j.zoomScale(At-q);let Yt,Kt;c.around&&(Yt=n.N.convert(c.around),Kt=j.locationPoint(Yt));const Zt={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||At!==q,this._rotating=this._rotating||ie!==Ae,this._pitching=this._pitching||Fe!==pe,this._padding=!j.isPaddingEqual(Ge),this._easeId=c.easeId,this._prepareEase(p,c.noMoveStart,Zt),this.terrain&&this._prepareElevation(xt),this._ease(hn=>{if(this._zooming&&(j.zoom=n.z.number(q,At,hn)),this._rotating&&(j.bearing=n.z.number(ie,Ae,hn)),this._pitching&&(j.pitch=n.z.number(pe,Fe,hn)),this._padding&&(j.interpolatePadding(be,Ge,hn),ct=j.centerPoint.add(at)),this.terrain&&!c.freezeElevation&&this._updateElevation(hn),Yt)j.setLocationAtPoint(Yt,Kt);else{const xn=j.zoomScale(j.zoom-q),Nn=At>q?Math.min(2,Et):Math.max(.5,Et),Dn=Math.pow(Nn,1-hn),Gn=j.unproject(Tt.add(Rt.mult(hn*Dn)).mult(xn));j.setLocationAtPoint(j.renderWorldCopies?Gn.wrap():Gn,ct)}this._applyUpdatedTransform(j),this._fireMoveEvents(p)},hn=>{this.terrain&&c.freezeElevation&&this._finalizeElevation(),this._afterEase(p,hn)},c),this}_prepareEase(c,p,F={}){this._moving=!0,p||F.moving||this.fire(new n.k("movestart",c)),this._zooming&&!F.zooming&&this.fire(new n.k("zoomstart",c)),this._rotating&&!F.rotating&&this.fire(new n.k("rotatestart",c)),this._pitching&&!F.pitching&&this.fire(new n.k("pitchstart",c))}_prepareElevation(c){this._elevationCenter=c,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(c,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(c){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const p=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(c<1&&p!==this._elevationTarget){const F=this._elevationTarget-this._elevationStart,j=(p-(F*c+this._elevationStart))/(1-c);this._elevationStart+=c*(F-j),this._elevationTarget=p}this.transform.elevation=n.z.number(this._elevationStart,this._elevationTarget,c)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(c){const p=c.getCameraPosition(),F=this.terrain.getElevationForLngLatZoom(p.lngLat,c.zoom);if(p.altitude<F){const j=this.calculateCameraOptionsFromTo(p.lngLat,F,c.center,c.elevation);return{pitch:j.pitch,zoom:j.zoom}}return{}}_applyUpdatedTransform(c){const p=[];if(this.terrain&&p.push(j=>this._elevateCameraIfInsideTerrain(j)),this.transformCameraUpdate&&p.push(j=>this.transformCameraUpdate(j)),!p.length)return;const F=c.clone();for(const j of p){const q=F.clone(),{center:ie,zoom:pe,pitch:be,bearing:Ae,elevation:Fe}=j(q);ie&&(q.center=ie),pe!==void 0&&(q.zoom=pe),be!==void 0&&(q.pitch=be),Ae!==void 0&&(q.bearing=Ae),Fe!==void 0&&(q.elevation=Fe),F.apply(q)}this.transform.apply(F)}_fireMoveEvents(c){this.fire(new n.k("move",c)),this._zooming&&this.fire(new n.k("zoom",c)),this._rotating&&this.fire(new n.k("rotate",c)),this._pitching&&this.fire(new n.k("pitch",c))}_afterEase(c,p){if(this._easeId&&p&&this._easeId===p)return;delete this._easeId;const F=this._zooming,j=this._rotating,q=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,F&&this.fire(new n.k("zoomend",c)),j&&this.fire(new n.k("rotateend",c)),q&&this.fire(new n.k("pitchend",c)),this.fire(new n.k("moveend",c))}flyTo(c,p){var F;if(!c.essential&&u.prefersReducedMotion){const ia=n.M(c,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ia,p)}this.stop(),c=n.e({offset:[0,0],speed:1.2,curve:1.42,easing:n.b9},c);const j=this._getTransformForUpdate(),q=j.zoom,ie=j.bearing,pe=j.pitch,be=j.padding,Ae="bearing"in c?this._normalizeBearing(c.bearing,ie):ie,Fe="pitch"in c?+c.pitch:pe,Ge="padding"in c?c.padding:j.padding,at=n.P.convert(c.offset);let ct=j.centerPoint.add(at);const pt=j.pointLocation(ct),{center:xt,zoom:At}=j.getConstrained(n.N.convert(c.center||pt),(F=c.zoom)!==null&&F!==void 0?F:q);this._normalizeCenter(xt,j);const Tt=j.zoomScale(At-q),Rt=j.project(pt),Et=j.project(xt).sub(Rt);let Yt=c.curve;const Kt=Math.max(j.width,j.height),Zt=Kt/Tt,hn=Et.mag();if("minZoom"in c){const ia=n.ad(Math.min(c.minZoom,q,At),j.minZoom,j.maxZoom),Ta=Kt/j.zoomScale(ia-q);Yt=Math.sqrt(Ta/hn*2)}const xn=Yt*Yt;function Nn(ia){const Ta=(Zt*Zt-Kt*Kt+(ia?-1:1)*xn*xn*hn*hn)/(2*(ia?Zt:Kt)*xn*hn);return Math.log(Math.sqrt(Ta*Ta+1)-Ta)}function Dn(ia){return(Math.exp(ia)-Math.exp(-ia))/2}function Gn(ia){return(Math.exp(ia)+Math.exp(-ia))/2}const Kn=Nn(!1);let ya=function(ia){return Gn(Kn)/Gn(Kn+Yt*ia)},ea=function(ia){return Kt*((Gn(Kn)*(Dn(Ta=Kn+Yt*ia)/Gn(Ta))-Dn(Kn))/xn)/hn;var Ta},wa=(Nn(!0)-Kn)/Yt;if(Math.abs(hn)<1e-6||!isFinite(wa)){if(Math.abs(Kt-Zt)<1e-6)return this.easeTo(c,p);const ia=Zt<Kt?-1:1;wa=Math.abs(Math.log(Zt/Kt))/Yt,ea=()=>0,ya=Ta=>Math.exp(ia*Yt*Ta)}if("duration"in c)c.duration=+c.duration;else{const ia="screenSpeed"in c?+c.screenSpeed/Yt:+c.speed;c.duration=1e3*wa/ia}return c.maxDuration&&c.duration>c.maxDuration&&(c.duration=0),this._zooming=!0,this._rotating=ie!==Ae,this._pitching=Fe!==pe,this._padding=!j.isPaddingEqual(Ge),this._prepareEase(p,!1),this.terrain&&this._prepareElevation(xt),this._ease(ia=>{const Ta=ia*wa,fa=1/ya(Ta);j.zoom=ia===1?At:q+j.scaleZoom(fa),this._rotating&&(j.bearing=n.z.number(ie,Ae,ia)),this._pitching&&(j.pitch=n.z.number(pe,Fe,ia)),this._padding&&(j.interpolatePadding(be,Ge,ia),ct=j.centerPoint.add(at)),this.terrain&&!c.freezeElevation&&this._updateElevation(ia);const Ia=ia===1?xt:j.unproject(Rt.add(Et.mult(ea(Ta))).mult(fa));j.setLocationAtPoint(j.renderWorldCopies?Ia.wrap():Ia,ct),this._applyUpdatedTransform(j),this._fireMoveEvents(p)},()=>{this.terrain&&c.freezeElevation&&this._finalizeElevation(),this._afterEase(p)},c),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(c,p){var F;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const j=this._onEaseEnd;delete this._onEaseEnd,j.call(this,p)}return c||(F=this.handlers)===null||F===void 0||F.stop(!1),this}_ease(c,p,F){F.animate===!1||F.duration===0?(c(1),p()):(this._easeStart=u.now(),this._easeOptions=F,this._onEaseFrame=c,this._onEaseEnd=p,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(c,p){c=n.b3(c,-180,180);const F=Math.abs(c-p);return Math.abs(c-360-p)<F&&(c-=360),Math.abs(c+360-p)<F&&(c+=360),c}_normalizeCenter(c,p){if(!p.renderWorldCopies||p.lngRange)return;const F=c.lng-p.center.lng;c.lng+=F>180?-360:F<-180?360:0}queryTerrainElevation(c){return this.terrain?this.terrain.getElevationForLngLatZoom(n.N.convert(c),this.transform.tileZoom)-this.transform.elevation:null}}const Bo={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class ns{constructor(c=Bo){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=p=>{!p||p.sourceDataType!=="metadata"&&p.sourceDataType!=="visibility"&&p.dataType!=="style"&&p.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=c}getDefaultPosition(){return"bottom-right"}onAdd(c){return this._map=c,this._compact=this.options.compact,this._container=r.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=r.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(c,p){const F=this._map._getUIString(`AttributionControl.${p}`);c.title=F,c.setAttribute("aria-label",F)}_updateAttributions(){if(!this._map.style)return;let c=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?c=c.concat(this.options.customAttribution.map(j=>typeof j!="string"?"":j)):typeof this.options.customAttribution=="string"&&c.push(this.options.customAttribution)),this._map.style.stylesheet){const j=this._map.style.stylesheet;this.styleOwner=j.owner,this.styleId=j.id}const p=this._map.style.sourceCaches;for(const j in p){const q=p[j];if(q.used||q.usedForTerrain){const ie=q.getSource();ie.attribution&&c.indexOf(ie.attribution)<0&&c.push(ie.attribution)}}c=c.filter(j=>String(j).trim()),c.sort((j,q)=>j.length-q.length),c=c.filter((j,q)=>{for(let ie=q+1;ie<c.length;ie++)if(c[ie].indexOf(j)>=0)return!1;return!0});const F=c.join(" | ");F!==this._attribHTML&&(this._attribHTML=F,c.length?(this._innerContainer.innerHTML=F,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class co{constructor(c={}){this._updateCompact=()=>{const p=this._container.children;if(p.length){const F=p[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&F.classList.add("maplibregl-compact"):F.classList.remove("maplibregl-compact")}},this.options=c}getDefaultPosition(){return"bottom-left"}onAdd(c){this._map=c,this._compact=this.options&&this.options.compact,this._container=r.create("div","maplibregl-ctrl");const p=r.create("a","maplibregl-ctrl-logo");return p.target="_blank",p.rel="noopener nofollow",p.href="https://maplibre.org/",p.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),p.setAttribute("rel","noopener nofollow"),this._container.appendChild(p),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){r.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Ac{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(c){const p=++this._id;return this._queue.push({callback:c,id:p,cancelled:!1}),p}remove(c){const p=this._currentlyRunning,F=p?this._queue.concat(p):this._queue;for(const j of F)if(j.id===c)return void(j.cancelled=!0)}run(c=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const p=this._currentlyRunning=this._queue;this._queue=[];for(const F of p)if(!F.cancelled&&(F.callback(c),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var er=n.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Lo extends n.E{constructor(c){super(),this.sourceCache=c,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,c.usedForTerrain=!0,c.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(c,p){this.sourceCache.update(c,p),this._renderableTilesKeys=[];const F={};for(const j of c.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:p}))F[j.key]=!0,this._renderableTilesKeys.push(j.key),this._tiles[j.key]||(j.posMatrix=new Float64Array(16),n.aQ(j.posMatrix,0,n.X,0,n.X,0,1),this._tiles[j.key]=new we(j,this.tileSize));for(const j in this._tiles)F[j]||delete this._tiles[j]}freeRtt(c){for(const p in this._tiles){const F=this._tiles[p];(!c||F.tileID.equals(c)||F.tileID.isChildOf(c)||c.isChildOf(F.tileID))&&(F.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(c=>this.getTileByID(c))}getTileByID(c){return this._tiles[c]}getTerrainCoords(c){const p={};for(const F of this._renderableTilesKeys){const j=this._tiles[F].tileID;if(j.canonical.equals(c.canonical)){const q=c.clone();q.posMatrix=new Float64Array(16),n.aQ(q.posMatrix,0,n.X,0,n.X,0,1),p[F]=q}else if(j.canonical.isChildOf(c.canonical)){const q=c.clone();q.posMatrix=new Float64Array(16);const ie=j.canonical.z-c.canonical.z,pe=j.canonical.x-(j.canonical.x>>ie<<ie),be=j.canonical.y-(j.canonical.y>>ie<<ie),Ae=n.X>>ie;n.aQ(q.posMatrix,0,Ae,0,Ae,0,1),n.J(q.posMatrix,q.posMatrix,[-pe*Ae,-be*Ae,0]),p[F]=q}else if(c.canonical.isChildOf(j.canonical)){const q=c.clone();q.posMatrix=new Float64Array(16);const ie=c.canonical.z-j.canonical.z,pe=c.canonical.x-(c.canonical.x>>ie<<ie),be=c.canonical.y-(c.canonical.y>>ie<<ie),Ae=n.X>>ie;n.aQ(q.posMatrix,0,n.X,0,n.X,0,1),n.J(q.posMatrix,q.posMatrix,[pe*Ae,be*Ae,0]),n.K(q.posMatrix,q.posMatrix,[1/2**ie,1/2**ie,0]),p[F]=q}}return p}getSourceTile(c,p){const F=this.sourceCache._source;let j=c.overscaledZ-this.deltaZoom;if(j>F.maxzoom&&(j=F.maxzoom),j<F.minzoom)return null;this._sourceTileCache[c.key]||(this._sourceTileCache[c.key]=c.scaledTo(j).key);let q=this.sourceCache.getTileByID(this._sourceTileCache[c.key]);if((!q||!q.dem)&&p)for(;j>=F.minzoom&&(!q||!q.dem);)q=this.sourceCache.getTileByID(c.scaledTo(j--).key);return q}tilesAfterTime(c=Date.now()){return Object.values(this._tiles).filter(p=>p.timeAdded>=c)}}class ii{constructor(c,p,F){this.painter=c,this.sourceCache=new Lo(p),this.options=F,this.exaggeration=typeof F.exaggeration=="number"?F.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(c,p,F,j=n.X){var q;if(!(p>=0&&p<j&&F>=0&&F<j))return 0;const ie=this.getTerrainData(c),pe=(q=ie.tile)===null||q===void 0?void 0:q.dem;if(!pe)return 0;const be=function(pt,xt,At){var Tt=xt[0],Rt=xt[1];return pt[0]=At[0]*Tt+At[4]*Rt+At[12],pt[1]=At[1]*Tt+At[5]*Rt+At[13],pt}([],[p/j*n.X,F/j*n.X],ie.u_terrain_matrix),Ae=[be[0]*pe.dim,be[1]*pe.dim],Fe=Math.floor(Ae[0]),Ge=Math.floor(Ae[1]),at=Ae[0]-Fe,ct=Ae[1]-Ge;return pe.get(Fe,Ge)*(1-at)*(1-ct)+pe.get(Fe+1,Ge)*at*(1-ct)+pe.get(Fe,Ge+1)*(1-at)*ct+pe.get(Fe+1,Ge+1)*at*ct}getElevationForLngLatZoom(c,p){const{tileID:F,mercatorX:j,mercatorY:q}=this._getOverscaledTileIDFromLngLatZoom(c,p);return this.getElevation(F,j%n.X,q%n.X,n.X)}getElevation(c,p,F,j=n.X){return this.getDEMElevation(c,p,F,j)*this.exaggeration}getTerrainData(c){if(!this._emptyDemTexture){const j=this.painter.context,q=new n.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new L(j,q,j.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new L(j,new n.R({width:1,height:1}),j.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(j.gl.NEAREST,j.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=n.ao([])}const p=this.sourceCache.getSourceTile(c,!0);if(p&&p.dem&&(!p.demTexture||p.needsTerrainPrepare)){const j=this.painter.context;p.demTexture=this.painter.getTileTexture(p.dem.stride),p.demTexture?p.demTexture.update(p.dem.getPixels(),{premultiply:!1}):p.demTexture=new L(j,p.dem.getPixels(),j.gl.RGBA,{premultiply:!1}),p.demTexture.bind(j.gl.NEAREST,j.gl.CLAMP_TO_EDGE),p.needsTerrainPrepare=!1}const F=p&&p+p.tileID.key+c.key;if(F&&!this._demMatrixCache[F]){const j=this.sourceCache.sourceCache._source.maxzoom;let q=c.canonical.z-p.tileID.canonical.z;c.overscaledZ>c.canonical.z&&(c.canonical.z>=j?q=c.canonical.z-j:n.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const ie=c.canonical.x-(c.canonical.x>>q<<q),pe=c.canonical.y-(c.canonical.y>>q<<q),be=n.bb(new Float64Array(16),[1/(n.X<<q),1/(n.X<<q),0]);n.J(be,be,[ie*n.X,pe*n.X,0]),this._demMatrixCache[c.key]={matrix:be,coord:c}}return{u_depth:2,u_terrain:3,u_terrain_dim:p&&p.dem&&p.dem.dim||1,u_terrain_matrix:F?this._demMatrixCache[c.key].matrix:this._emptyDemMatrix,u_terrain_unpack:p&&p.dem&&p.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(p&&p.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:p}}getFramebuffer(c){const p=this.painter,F=p.width/devicePixelRatio,j=p.height/devicePixelRatio;return!this._fbo||this._fbo.width===F&&this._fbo.height===j||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new L(p.context,{width:F,height:j,data:null},p.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(p.context.gl.NEAREST,p.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new L(p.context,{width:F,height:j,data:null},p.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(p.context.gl.NEAREST,p.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=p.context.createFramebuffer(F,j,!0,!1),this._fbo.depthAttachment.set(p.context.createRenderbuffer(p.context.gl.DEPTH_COMPONENT16,F,j))),this._fbo.colorAttachment.set(c==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const c=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const p=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let q=0,ie=0;q<this._coordsTextureSize;q++)for(let pe=0;pe<this._coordsTextureSize;pe++,ie+=4)p[ie+0]=255&pe,p[ie+1]=255&q,p[ie+2]=pe>>8<<4|q>>8,p[ie+3]=0;const F=new n.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(p.buffer)),j=new L(c,F,c.gl.RGBA,{premultiply:!1});return j.bind(c.gl.NEAREST,c.gl.CLAMP_TO_EDGE),this._coordsTexture=j,j}pointCoordinate(c){this.painter.maybeDrawDepthAndCoords(!0);const p=new Uint8Array(4),F=this.painter.context,j=F.gl,q=Math.round(c.x*this.painter.pixelRatio/devicePixelRatio),ie=Math.round(c.y*this.painter.pixelRatio/devicePixelRatio),pe=Math.round(this.painter.height/devicePixelRatio);F.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),j.readPixels(q,pe-ie-1,1,1,j.RGBA,j.UNSIGNED_BYTE,p),F.bindFramebuffer.set(null);const be=p[0]+(p[2]>>4<<8),Ae=p[1]+((15&p[2])<<8),Fe=this.coordsIndex[255-p[3]],Ge=Fe&&this.sourceCache.getTileByID(Fe);if(!Ge)return null;const at=this._coordsTextureSize,ct=(1<<Ge.tileID.canonical.z)*at;return new n.Z((Ge.tileID.canonical.x*at+be)/ct+Ge.tileID.wrap,(Ge.tileID.canonical.y*at+Ae)/ct,this.getElevation(Ge.tileID,be,Ae,at))}depthAtPoint(c){const p=new Uint8Array(4),F=this.painter.context,j=F.gl;return F.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),j.readPixels(c.x,this.painter.height/devicePixelRatio-c.y-1,1,1,j.RGBA,j.UNSIGNED_BYTE,p),F.bindFramebuffer.set(null),(p[0]/16777216+p[1]/65536+p[2]/256+p[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;const c=this.painter.context,p=new n.bc,F=new n.aY,j=this.meshSize,q=n.X/j,ie=j*j;for(let Ge=0;Ge<=j;Ge++)for(let at=0;at<=j;at++)p.emplaceBack(at*q,Ge*q,0);for(let Ge=0;Ge<ie;Ge+=j+1)for(let at=0;at<j;at++)F.emplaceBack(at+Ge,j+at+Ge+1,j+at+Ge+2),F.emplaceBack(at+Ge,j+at+Ge+2,at+Ge+1);const pe=p.length,be=pe+2*(j+1);for(const Ge of[0,1])for(let at=0;at<=j;at++)for(const ct of[0,1])p.emplaceBack(at*q,Ge*n.X,ct);for(let Ge=0;Ge<2*j;Ge+=2)F.emplaceBack(be+Ge,be+Ge+1,be+Ge+3),F.emplaceBack(be+Ge,be+Ge+3,be+Ge+2),F.emplaceBack(pe+Ge,pe+Ge+3,pe+Ge+1),F.emplaceBack(pe+Ge,pe+Ge+2,pe+Ge+3);const Ae=p.length,Fe=Ae+2*(j+1);for(const Ge of[0,1])for(let at=0;at<=j;at++)for(const ct of[0,1])p.emplaceBack(Ge*n.X,at*q,ct);for(let Ge=0;Ge<2*j;Ge+=2)F.emplaceBack(Ae+Ge,Ae+Ge+1,Ae+Ge+3),F.emplaceBack(Ae+Ge,Ae+Ge+3,Ae+Ge+2),F.emplaceBack(Fe+Ge,Fe+Ge+3,Fe+Ge+1),F.emplaceBack(Fe+Ge,Fe+Ge+2,Fe+Ge+3);return this._mesh=new sc(c.createVertexBuffer(p,er.members),c.createIndexBuffer(F),n.a0.simpleSegment(0,0,p.length,F.length)),this._mesh}getMeshFrameDelta(c){return 2*Math.PI*n.bd/Math.pow(2,c)/5}getMinTileElevationForLngLatZoom(c,p){var F;const{tileID:j}=this._getOverscaledTileIDFromLngLatZoom(c,p);return(F=this.getMinMaxElevation(j).minElevation)!==null&&F!==void 0?F:0}getMinMaxElevation(c){const p=this.getTerrainData(c).tile,F={minElevation:null,maxElevation:null};return p&&p.dem&&(F.minElevation=p.dem.min*this.exaggeration,F.maxElevation=p.dem.max*this.exaggeration),F}_getOverscaledTileIDFromLngLatZoom(c,p){const F=n.Z.fromLngLat(c.wrap()),j=(1<<p)*n.X,q=F.x*j,ie=F.y*j,pe=Math.floor(q/n.X),be=Math.floor(ie/n.X);return{tileID:new n.S(p,0,p,pe,be),mercatorX:q,mercatorY:ie}}}class Rl{constructor(c,p,F){this._context=c,this._size=p,this._tileSize=F,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const c of this._objects)c.texture.destroy(),c.fbo.destroy()}_createObject(c){const p=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),F=new L(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return F.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),p.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),p.colorAttachment.set(F.texture),{id:c,fbo:p,texture:F,stamp:-1,inUse:!1}}getObjectForId(c){return this._objects[c]}useObject(c){c.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(p=>c.id!==p),this._recentlyUsed.push(c.id)}stampObject(c){c.stamp=++this._stamp}getOrCreateFreeObject(){for(const p of this._recentlyUsed)if(!this._objects[p].inUse)return this._objects[p];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const c=this._createObject(this._objects.length);return this._objects.push(c),c}freeObject(c){c.inUse=!1}freeAllObjects(){for(const c of this._objects)this.freeObject(c)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(c=>!c.inUse)===!1}}const cs={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Ds{constructor(c,p){this.painter=c,this.terrain=p,this.pool=new Rl(c.context,30,p.sourceCache.tileSize*p.qualityFactor)}destruct(){this.pool.destruct()}getTexture(c){return this.pool.getObjectForId(c.rtt[this._stacks.length-1].id).texture}prepareForRender(c,p){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=c._order.filter(F=>!c._layers[F].isHidden(p)),this._coordsDescendingInv={};for(const F in c.sourceCaches){this._coordsDescendingInv[F]={};const j=c.sourceCaches[F].getVisibleCoordinates();for(const q of j){const ie=this.terrain.sourceCache.getTerrainCoords(q);for(const pe in ie)this._coordsDescendingInv[F][pe]||(this._coordsDescendingInv[F][pe]=[]),this._coordsDescendingInv[F][pe].push(ie[pe])}}this._coordsDescendingInvStr={};for(const F of c._order){const j=c._layers[F],q=j.source;if(cs[j.type]&&!this._coordsDescendingInvStr[q]){this._coordsDescendingInvStr[q]={};for(const ie in this._coordsDescendingInv[q])this._coordsDescendingInvStr[q][ie]=this._coordsDescendingInv[q][ie].map(pe=>pe.key).sort().join()}}for(const F of this._renderableTiles)for(const j in this._coordsDescendingInvStr){const q=this._coordsDescendingInvStr[j][F.tileID.key];q&&q!==F.rttCoords[j]&&(F.rtt=[])}}renderLayer(c){if(c.isHidden(this.painter.transform.zoom))return!1;const p=c.type,F=this.painter,j=this._renderableLayerIds[this._renderableLayerIds.length-1]===c.id;if(cs[p]&&(this._prevType&&cs[this._prevType]||this._stacks.push([]),this._prevType=p,this._stacks[this._stacks.length-1].push(c.id),!j))return!0;if(cs[this._prevType]||cs[p]&&j){this._prevType=p;const q=this._stacks.length-1,ie=this._stacks[q]||[];for(const pe of this._renderableTiles){if(this.pool.isFull()&&(oc(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(pe),pe.rtt[q]){const Ae=this.pool.getObjectForId(pe.rtt[q].id);if(Ae.stamp===pe.rtt[q].stamp){this.pool.useObject(Ae);continue}}const be=this.pool.getOrCreateFreeObject();this.pool.useObject(be),this.pool.stampObject(be),pe.rtt[q]={id:be.id,stamp:be.stamp},F.context.bindFramebuffer.set(be.fbo.framebuffer),F.context.clear({color:n.aN.transparent,stencil:0}),F.currentStencilSource=void 0;for(let Ae=0;Ae<ie.length;Ae++){const Fe=F.style._layers[ie[Ae]],Ge=Fe.source?this._coordsDescendingInv[Fe.source][pe.tileID.key]:[pe.tileID];F.context.viewport.set([0,0,be.fbo.width,be.fbo.height]),F._renderTileClippingMasks(Fe,Ge),F.renderLayer(F,F.style.sourceCaches[Fe.source],Fe,Ge),Fe.source&&(pe.rttCoords[Fe.source]=this._coordsDescendingInvStr[Fe.source][pe.tileID.key])}}return oc(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),cs[p]}return!1}}const zc={"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":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},Mc=x,al={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Bo,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,refreshExpiredTiles:!0,scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],zoom:0,bearing:0,pitch:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:n.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0},Ai=R=>{R.touchstart=R.dragStart,R.touchmoveWindow=R.dragMove,R.touchend=R.dragEnd},Cs={showCompass:!0,showZoom:!0,visualizePitch:!1};class Ya{constructor(c,p,F=!1){this.mousedown=ie=>{this.startMouse(n.e({},ie,{ctrlKey:!0,preventDefault:()=>ie.preventDefault()}),r.mousePos(this.element,ie)),r.addEventListener(window,"mousemove",this.mousemove),r.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=ie=>{this.moveMouse(ie,r.mousePos(this.element,ie))},this.mouseup=ie=>{this.mouseRotate.dragEnd(ie),this.mousePitch&&this.mousePitch.dragEnd(ie),this.offTemp()},this.touchstart=ie=>{ie.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,ie.targetTouches)[0],this.startTouch(ie,this._startPos),r.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),r.addEventListener(window,"touchend",this.touchend))},this.touchmove=ie=>{ie.targetTouches.length!==1?this.reset():(this._lastPos=r.touchPos(this.element,ie.targetTouches)[0],this.moveTouch(ie,this._lastPos))},this.touchend=ie=>{ie.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const j=c.dragRotate._mouseRotate.getClickTolerance(),q=c.dragRotate._mousePitch.getClickTolerance();this.element=p,this.mouseRotate=Xl({clickTolerance:j,enable:!0}),this.touchRotate=(({enable:ie,clickTolerance:pe,bearingDegreesPerPixelMoved:be=.8})=>{const Ae=new Nl;return new vo({clickTolerance:pe,move:(Fe,Ge)=>({bearingDelta:(Ge.x-Fe.x)*be}),moveStateManager:Ae,enable:ie,assignEvents:Ai})})({clickTolerance:j,enable:!0}),this.map=c,F&&(this.mousePitch=Ks({clickTolerance:q,enable:!0}),this.touchPitch=(({enable:ie,clickTolerance:pe,pitchDegreesPerPixelMoved:be=-.5})=>{const Ae=new Nl;return new vo({clickTolerance:pe,move:(Fe,Ge)=>({pitchDelta:(Ge.y-Fe.y)*be}),moveStateManager:Ae,enable:ie,assignEvents:Ai})})({clickTolerance:q,enable:!0})),r.addEventListener(p,"mousedown",this.mousedown),r.addEventListener(p,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(p,"touchcancel",this.reset)}startMouse(c,p){this.mouseRotate.dragStart(c,p),this.mousePitch&&this.mousePitch.dragStart(c,p),r.disableDrag()}startTouch(c,p){this.touchRotate.dragStart(c,p),this.touchPitch&&this.touchPitch.dragStart(c,p),r.disableDrag()}moveMouse(c,p){const F=this.map,{bearingDelta:j}=this.mouseRotate.dragMove(c,p)||{};if(j&&F.setBearing(F.getBearing()+j),this.mousePitch){const{pitchDelta:q}=this.mousePitch.dragMove(c,p)||{};q&&F.setPitch(F.getPitch()+q)}}moveTouch(c,p){const F=this.map,{bearingDelta:j}=this.touchRotate.dragMove(c,p)||{};if(j&&F.setBearing(F.getBearing()+j),this.touchPitch){const{pitchDelta:q}=this.touchPitch.dragMove(c,p)||{};q&&F.setPitch(F.getPitch()+q)}}off(){const c=this.element;r.removeEventListener(c,"mousedown",this.mousedown),r.removeEventListener(c,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),r.removeEventListener(window,"touchend",this.touchend),r.removeEventListener(c,"touchcancel",this.reset),this.offTemp()}offTemp(){r.enableDrag(),r.removeEventListener(window,"mousemove",this.mousemove),r.removeEventListener(window,"mouseup",this.mouseup),r.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),r.removeEventListener(window,"touchend",this.touchend)}}let gr;function Go(R,c,p){const F=new n.N(R.lng,R.lat);if(R=new n.N(R.lng,R.lat),c){const j=new n.N(R.lng-360,R.lat),q=new n.N(R.lng+360,R.lat),ie=p.locationPoint(R).distSqr(c);p.locationPoint(j).distSqr(c)<ie?R=j:p.locationPoint(q).distSqr(c)<ie&&(R=q)}for(;Math.abs(R.lng-p.center.lng)>180;){const j=p.locationPoint(R);if(j.x>=0&&j.y>=0&&j.x<=p.width&&j.y<=p.height)break;R.lng>p.center.lng?R.lng-=360:R.lng+=360}return R.lng!==F.lng&&p.locationPoint(R).y>p.height/2-p.getHorizon()?R:F}const Es={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 rl(R,c,p){const F=R.classList;for(const j in Es)F.remove(`maplibregl-${p}-anchor-${j}`);F.add(`maplibregl-${p}-anchor-${c}`)}class zi extends n.E{constructor(c){if(super(),this._onKeyPress=p=>{const F=p.code,j=p.charCode||p.keyCode;F!=="Space"&&F!=="Enter"&&j!==32&&j!==13||this.togglePopup()},this._onMapClick=p=>{const F=p.originalEvent.target,j=this._element;this._popup&&(F===j||j.contains(F))&&this.togglePopup()},this._update=p=>{var F;if(!this._map)return;const j=this._map.loaded()&&!this._map.isMoving();((p==null?void 0:p.type)==="terrain"||(p==null?void 0:p.type)==="render"&&!j)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies?this._lngLat=Go(this._lngLat,this._flatPos,this._map.transform):this._lngLat=(F=this._lngLat)===null||F===void 0?void 0:F.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let q="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?q=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(q=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let ie="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?ie="rotateX(0deg)":this._pitchAlignment==="map"&&(ie=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||p&&p.type!=="moveend"||(this._pos=this._pos.round()),r.setTransform(this._element,`${Es[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${ie} ${q}`),u.frameAsync(new AbortController).then(()=>{this._updateOpacity(p&&p.type==="moveend")}).catch(()=>{})},this._onMove=p=>{if(!this._isDragging){const F=this._clickTolerance||this._map._clickTolerance;this._isDragging=p.point.dist(this._pointerdownPos)>=F}this._isDragging&&(this._pos=p.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 n.k("dragstart"))),this.fire(new n.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new n.k("dragend")),this._state="inactive"},this._addDragHandler=p=>{this._element.contains(p.originalEvent.target)&&(p.preventDefault(),this._positionDelta=p.point.sub(this._pos).add(this._offset),this._pointerdownPos=p.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=c&&c.anchor||"center",this._color=c&&c.color||"#3FB1CE",this._scale=c&&c.scale||1,this._draggable=c&&c.draggable||!1,this._clickTolerance=c&&c.clickTolerance||0,this._subpixelPositioning=c&&c.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=c&&c.rotation||0,this._rotationAlignment=c&&c.rotationAlignment||"auto",this._pitchAlignment=c&&c.pitchAlignment&&c.pitchAlignment!=="auto"?c.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(c==null?void 0:c.opacity,c==null?void 0:c.opacityWhenCovered),c&&c.element)this._element=c.element,this._offset=n.P.convert(c&&c.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div");const p=r.createNS("http://www.w3.org/2000/svg","svg"),F=41,j=27;p.setAttributeNS(null,"display","block"),p.setAttributeNS(null,"height",`${F}px`),p.setAttributeNS(null,"width",`${j}px`),p.setAttributeNS(null,"viewBox",`0 0 ${j} ${F}`);const q=r.createNS("http://www.w3.org/2000/svg","g");q.setAttributeNS(null,"stroke","none"),q.setAttributeNS(null,"stroke-width","1"),q.setAttributeNS(null,"fill","none"),q.setAttributeNS(null,"fill-rule","evenodd");const ie=r.createNS("http://www.w3.org/2000/svg","g");ie.setAttributeNS(null,"fill-rule","nonzero");const pe=r.createNS("http://www.w3.org/2000/svg","g");pe.setAttributeNS(null,"transform","translate(3.0, 29.0)"),pe.setAttributeNS(null,"fill","#000000");const be=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const Tt of be){const Rt=r.createNS("http://www.w3.org/2000/svg","ellipse");Rt.setAttributeNS(null,"opacity","0.04"),Rt.setAttributeNS(null,"cx","10.5"),Rt.setAttributeNS(null,"cy","5.80029008"),Rt.setAttributeNS(null,"rx",Tt.rx),Rt.setAttributeNS(null,"ry",Tt.ry),pe.appendChild(Rt)}const Ae=r.createNS("http://www.w3.org/2000/svg","g");Ae.setAttributeNS(null,"fill",this._color);const Fe=r.createNS("http://www.w3.org/2000/svg","path");Fe.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"),Ae.appendChild(Fe);const Ge=r.createNS("http://www.w3.org/2000/svg","g");Ge.setAttributeNS(null,"opacity","0.25"),Ge.setAttributeNS(null,"fill","#000000");const at=r.createNS("http://www.w3.org/2000/svg","path");at.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"),Ge.appendChild(at);const ct=r.createNS("http://www.w3.org/2000/svg","g");ct.setAttributeNS(null,"transform","translate(6.0, 7.0)"),ct.setAttributeNS(null,"fill","#FFFFFF");const pt=r.createNS("http://www.w3.org/2000/svg","g");pt.setAttributeNS(null,"transform","translate(8.0, 8.0)");const xt=r.createNS("http://www.w3.org/2000/svg","circle");xt.setAttributeNS(null,"fill","#000000"),xt.setAttributeNS(null,"opacity","0.25"),xt.setAttributeNS(null,"cx","5.5"),xt.setAttributeNS(null,"cy","5.5"),xt.setAttributeNS(null,"r","5.4999962");const At=r.createNS("http://www.w3.org/2000/svg","circle");At.setAttributeNS(null,"fill","#FFFFFF"),At.setAttributeNS(null,"cx","5.5"),At.setAttributeNS(null,"cy","5.5"),At.setAttributeNS(null,"r","5.4999962"),pt.appendChild(xt),pt.appendChild(At),ie.appendChild(pe),ie.appendChild(Ae),ie.appendChild(Ge),ie.appendChild(ct),ie.appendChild(pt),p.appendChild(ie),p.setAttributeNS(null,"height",F*this._scale+"px"),p.setAttributeNS(null,"width",j*this._scale+"px"),this._element.appendChild(p),this._offset=n.P.convert(c&&c.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",p=>{p.preventDefault()}),this._element.addEventListener("mousedown",p=>{p.preventDefault()}),rl(this._element,this._anchor,"marker"),c&&c.className)for(const p of c.className.split(" "))this._element.classList.add(p);this._popup=null}addTo(c){return this.remove(),this._map=c,this._element.setAttribute("aria-label",c._getUIString("Marker.Title")),c.getCanvasContainer().appendChild(this._element),c.on("move",this._update),c.on("moveend",this._update),c.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",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}getLngLat(){return this._lngLat}setLngLat(c){return this._lngLat=n.N.convert(c),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(c){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),c){if(!("offset"in c.options)){const p=Math.abs(13.5)/Math.SQRT2;c.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[p,-1*(24.6+p)],"bottom-right":[-p,-1*(24.6+p)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=c,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(c){return this._subpixelPositioning=c,this}getPopup(){return this._popup}togglePopup(){const c=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:c?(c.isOpen()?c.remove():(c.setLngLat(this._lngLat),c.addTo(this._map)),this):this}_updateOpacity(c=!1){var p,F;if(!(!((p=this._map)===null||p===void 0)&&p.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(c)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const j=this._map,q=j.terrain.depthAtPoint(this._pos),ie=j.terrain.getElevationForLngLatZoom(this._lngLat,j.transform.tileZoom);if(j.transform.lngLatToCameraDepth(this._lngLat,ie)-q<.006)return void(this._element.style.opacity=this._opacity);const pe=-this._offset.y/j.transform._pixelPerMeter,be=Math.sin(j.getPitch()*Math.PI/180)*pe,Ae=j.terrain.depthAtPoint(new n.P(this._pos.x,this._pos.y-this._offset.y)),Fe=j.transform.lngLatToCameraDepth(this._lngLat,ie+be)-Ae>.006;!((F=this._popup)===null||F===void 0)&&F.isOpen()&&Fe&&this._popup.remove(),this._element.style.opacity=Fe?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(c){return this._offset=n.P.convert(c),this._update(),this}addClassName(c){this._element.classList.add(c)}removeClassName(c){this._element.classList.remove(c)}toggleClassName(c){return this._element.classList.toggle(c)}setDraggable(c){return this._draggable=!!c,this._map&&(c?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(c){return this._rotation=c||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(c){return this._rotationAlignment=c||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(c){return this._pitchAlignment=c&&c!=="auto"?c:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(c,p){return c===void 0&&p===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),c!==void 0&&(this._opacity=c),p!==void 0&&(this._opacityWhenCovered=p),this._map&&this._updateOpacity(!0),this}}const Vl={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Xr=0,Jl=!1;class ir extends n.E{constructor(c){super(),this._onSuccess=p=>{if(this._map){if(this._isOutOfMapMaxBounds(p))return this._setErrorState(),this.fire(new n.k("outofmaxbounds",p)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=p,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(p),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(p),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new n.k("geolocate",p)),this._finish()}},this._updateCamera=p=>{const F=new n.N(p.coords.longitude,p.coords.latitude),j=p.coords.accuracy,q=this._map.getBearing(),ie=n.e({bearing:q},this.options.fitBoundsOptions),pe=Te.fromLngLat(F,j);this._map.fitBounds(pe,ie,{geolocateSource:!0})},this._updateMarker=p=>{if(p){const F=new n.N(p.coords.longitude,p.coords.latitude);this._accuracyCircleMarker.setLngLat(F).addTo(this._map),this._userLocationDotMarker.setLngLat(F).addTo(this._map),this._accuracy=p.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=p=>{if(this._map){if(this.options.trackUserLocation)if(p.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const F=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=F,this._geolocateButton.setAttribute("aria-label",F),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(p.code===3&&Jl)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new n.k("error",p)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",p=>p.preventDefault()),this._geolocateButton=r.create("button","maplibregl-ctrl-geolocate",this._container),r.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=p=>{if(this._map){if(p===!1){n.w("Geolocation support is not available so the GeolocateControl will be disabled.");const F=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=F,this._geolocateButton.setAttribute("aria-label",F)}else{const F=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=F,this._geolocateButton.setAttribute("aria-label",F)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new zi({element:this._dotElement}),this._circleElement=r.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new zi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",F=>{const j=F.originalEvent&&F.originalEvent.type==="resize";F.geolocateSource||this._watchState!=="ACTIVE_LOCK"||j||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new n.k("trackuserlocationend")),this.fire(new n.k("userlocationlostfocus")))})}},this.options=n.e({},Vl,c)}onAdd(c){return this._map=c,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return n._(this,arguments,void 0,function*(p=!1){if(gr!==void 0&&!p)return gr;if(window.navigator.permissions===void 0)return gr=!!window.navigator.geolocation,gr;try{gr=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{gr=!!window.navigator.geolocation}return gr})}().then(p=>this._finishSetupUI(p)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Xr=0,Jl=!1}_isOutOfMapMaxBounds(c){const p=this._map.getMaxBounds(),F=c.coords;return p&&(F.longitude<p.getWest()||F.longitude>p.getEast()||F.latitude<p.getSouth()||F.latitude>p.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const c=this._map.getBounds(),p=c.getSouthEast(),F=c.getNorthEast(),j=p.distanceTo(F),q=this._map._container.clientHeight,ie=Math.ceil(this._accuracy/(j/q)*2);this._circleElement.style.width=`${ie}px`,this._circleElement.style.height=`${ie}px`}trigger(){if(!this._setup)return n.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new n.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Xr--,Jl=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new n.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new n.k("trackuserlocationstart")),this.fire(new n.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let c;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Xr++,Xr>1?(c={maximumAge:6e5,timeout:0},Jl=!0):(c=this.options.positionOptions,Jl=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,c)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}}const tr={maxWidth:100,unit:"metric"};function wi(R,c,p){const F=p&&p.maxWidth||100,j=R._container.clientHeight/2,q=R.unproject([0,j]),ie=R.unproject([F,j]),pe=q.distanceTo(ie);if(p&&p.unit==="imperial"){const be=3.2808*pe;be>5280?uo(c,F,be/5280,R._getUIString("ScaleControl.Miles")):uo(c,F,be,R._getUIString("ScaleControl.Feet"))}else p&&p.unit==="nautical"?uo(c,F,pe/1852,R._getUIString("ScaleControl.NauticalMiles")):pe>=1e3?uo(c,F,pe/1e3,R._getUIString("ScaleControl.Kilometers")):uo(c,F,pe,R._getUIString("ScaleControl.Meters"))}function uo(R,c,p,F){const j=function(ie){const pe=Math.pow(10,`${Math.floor(ie)}`.length-1);let be=ie/pe;return be=be>=10?10:be>=5?5:be>=3?3:be>=2?2:be>=1?1:function(Ae){const Fe=Math.pow(10,Math.ceil(-Math.log(Ae)/Math.LN10));return Math.round(Ae*Fe)/Fe}(be),pe*be}(p),q=j/p;R.style.width=c*q+"px",R.innerHTML=`${j} ${F}`}class jl extends n.E{constructor(c={}){super(),this._onFullscreenChange=()=>{var p;let F=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((p=F==null?void 0:F.shadowRoot)===null||p===void 0)&&p.fullscreenElement;)F=F.shadowRoot.fullscreenElement;F===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,c&&c.container&&(c.container instanceof HTMLElement?this._container=c.container:n.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(c){return this._map=c,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){r.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const c=this._fullscreenButton=r.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);r.create("span","maplibregl-ctrl-icon",c).setAttribute("aria-hidden","true"),c.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const c=this._getTitle();this._fullscreenButton.setAttribute("aria-label",c),this._fullscreenButton.title=c}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new n.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new n.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}}const Ho={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},yt=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");class wt extends n.E{constructor(c){super(),this.remove=()=>(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),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new n.k("close"))),this),this._onMouseUp=p=>{this._update(p.point)},this._onMouseMove=p=>{this._update(p.point)},this._onDrag=p=>{this._update(p.point)},this._update=p=>{var F;const j=this._lngLat||this._trackPointer;if(!this._map||!j||!this._content)return;if(!this._container){if(this._container=r.create("div","maplibregl-popup",this._map.getContainer()),this._tip=r.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const Ae of this.options.className.split(" "))this._container.classList.add(Ae);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer?this._lngLat=Go(this._lngLat,this._flatPos,this._map.transform):this._lngLat=(F=this._lngLat)===null||F===void 0?void 0:F.wrap(),this._trackPointer&&!p)return;const q=this._flatPos=this._pos=this._trackPointer&&p?p:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&p?p:this._map.transform.locationPoint(this._lngLat));let ie=this.options.anchor;const pe=Lt(this.options.offset);if(!ie){const Ae=this._container.offsetWidth,Fe=this._container.offsetHeight;let Ge;Ge=q.y+pe.bottom.y<Fe?["top"]:q.y>this._map.transform.height-Fe?["bottom"]:[],q.x<Ae/2?Ge.push("left"):q.x>this._map.transform.width-Ae/2&&Ge.push("right"),ie=Ge.length===0?"bottom":Ge.join("-")}let be=q.add(pe[ie]);this.options.subpixelPositioning||(be=be.round()),r.setTransform(this._container,`${Es[ie]} translate(${be.x}px,${be.y}px)`),rl(this._container,ie,"popup")},this._onClose=()=>{this.remove()},this.options=n.e(Object.create(Ho),c)}addTo(c){return this._map&&this.remove(),this._map=c,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new n.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(c){return this._lngLat=n.N.convert(c),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(c){return this.setDOMContent(document.createTextNode(c))}setHTML(c){const p=document.createDocumentFragment(),F=document.createElement("body");let j;for(F.innerHTML=c;j=F.firstChild,j;)p.appendChild(j);return this.setDOMContent(p)}getMaxWidth(){var c;return(c=this._container)===null||c===void 0?void 0:c.style.maxWidth}setMaxWidth(c){return this.options.maxWidth=c,this._update(),this}setDOMContent(c){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(c),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(c){return this._container&&this._container.classList.add(c),this}removeClassName(c){return this._container&&this._container.classList.remove(c),this}setOffset(c){return this.options.offset=c,this._update(),this}toggleClassName(c){if(this._container)return this._container.classList.toggle(c)}setSubpixelPositioning(c){this.options.subpixelPositioning=c}_createCloseButton(){this.options.closeButton&&(this._closeButton=r.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const c=this._container.querySelector(yt);c&&c.focus()}}function Lt(R){if(R){if(typeof R=="number"){const c=Math.round(Math.abs(R)/Math.SQRT2);return{center:new n.P(0,0),top:new n.P(0,R),"top-left":new n.P(c,c),"top-right":new n.P(-c,c),bottom:new n.P(0,-R),"bottom-left":new n.P(c,-c),"bottom-right":new n.P(-c,-c),left:new n.P(R,0),right:new n.P(-R,0)}}if(R instanceof n.P||Array.isArray(R)){const c=n.P.convert(R);return{center:c,top:c,"top-left":c,"top-right":c,bottom:c,"bottom-left":c,"bottom-right":c,left:c,right:c}}return{center:n.P.convert(R.center||[0,0]),top:n.P.convert(R.top||[0,0]),"top-left":n.P.convert(R["top-left"]||[0,0]),"top-right":n.P.convert(R["top-right"]||[0,0]),bottom:n.P.convert(R.bottom||[0,0]),"bottom-left":n.P.convert(R["bottom-left"]||[0,0]),"bottom-right":n.P.convert(R["bottom-right"]||[0,0]),left:n.P.convert(R.left||[0,0]),right:n.P.convert(R.right||[0,0])}}return Lt(new n.P(0,0))}const ne=x;h.AJAXError=n.bg,h.Evented=n.E,h.LngLat=n.N,h.MercatorCoordinate=n.Z,h.Point=n.P,h.addProtocol=n.bh,h.config=n.a,h.removeProtocol=n.bi,h.AttributionControl=ns,h.BoxZoomHandler=yo,h.CanvasSource=Me,h.CooperativeGesturesHandler=ls,h.DoubleClickZoomHandler=Ci,h.DragPanHandler=Ss,h.DragRotateHandler=Po,h.EdgeInsets=Fl,h.FullscreenControl=jl,h.GeoJSONSource=Ie,h.GeolocateControl=ir,h.Hash=Qi,h.ImageSource=Be,h.KeyboardHandler=dc,h.LngLatBounds=Te,h.LogoControl=co,h.Map=class extends to{constructor(R){n.be.mark(n.bf.create);const c=Object.assign(Object.assign({},al),R);if(c.minZoom!=null&&c.maxZoom!=null&&c.minZoom>c.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(c.minPitch!=null&&c.maxPitch!=null&&c.minPitch>c.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(c.minPitch!=null&&c.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(c.maxPitch!=null&&c.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new di(c.minZoom,c.maxZoom,c.minPitch,c.maxPitch,c.renderWorldCopies),{bearingSnap:c.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Ac,this._controls=[],this._mapId=n.a4(),this._contextLost=F=>{F.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new n.k("webglcontextlost",{originalEvent:F}))},this._contextRestored=F=>{this._setupPainter(),this.resize(),this._update(),this.fire(new n.k("webglcontextrestored",{originalEvent:F}))},this._onMapScroll=F=>{if(F.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=c.interactive,this._maxTileCacheSize=c.maxTileCacheSize,this._maxTileCacheZoomLevels=c.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=c.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=c.preserveDrawingBuffer===!0,this._antialias=c.antialias===!0,this._trackResize=c.trackResize===!0,this._bearingSnap=c.bearingSnap,this._refreshExpiredTiles=c.refreshExpiredTiles===!0,this._fadeDuration=c.fadeDuration,this._crossSourceCollisions=c.crossSourceCollisions===!0,this._collectResourceTiming=c.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},zc),c.locale),this._clickTolerance=c.clickTolerance,this._overridePixelRatio=c.pixelRatio,this._maxCanvasSize=c.maxCanvasSize,this.transformCameraUpdate=c.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=c.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=T.addThrottleControl(()=>this.isMoving()),this._requestManager=new A(c.transformRequest),typeof c.container=="string"){if(this._container=document.getElementById(c.container),!this._container)throw new Error(`Container '${c.container}' not found.`)}else{if(!(c.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=c.container}if(c.maxBounds&&this.setMaxBounds(c.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let F=!1;const j=Ns(q=>{this._trackResize&&!this._removed&&this.resize(q)._update()},50);this._resizeObserver=new ResizeObserver(q=>{F?j(q):F=!0}),this._resizeObserver.observe(this._container)}this.handlers=new ri(this,c);const p=typeof c.hash=="string"&&c.hash||void 0;this._hash=c.hash&&new Qi(p).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:c.center,zoom:c.zoom,bearing:c.bearing,pitch:c.pitch}),c.bounds&&(this.resize(),this.fitBounds(c.bounds,n.e({},c.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=c.localIdeographFontFamily,this._validateStyle=c.validateStyle,c.style&&this.setStyle(c.style,{localIdeographFontFamily:c.localIdeographFontFamily}),c.attributionControl&&this.addControl(new ns(typeof c.attributionControl=="boolean"?void 0:c.attributionControl)),c.maplibreLogo&&this.addControl(new co,c.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",F=>{this._update(F.dataType==="style"),this.fire(new n.k(`${F.dataType}data`,F))}),this.on("dataloading",F=>{this.fire(new n.k(`${F.dataType}dataloading`,F))}),this.on("dataabort",F=>{this.fire(new n.k("sourcedataabort",F))})}_getMapId(){return this._mapId}addControl(R,c){if(c===void 0&&(c=R.getDefaultPosition?R.getDefaultPosition():"top-right"),!R||!R.onAdd)return this.fire(new n.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const p=R.onAdd(this);this._controls.push(R);const F=this._controlPositions[c];return c.indexOf("bottom")!==-1?F.insertBefore(p,F.firstChild):F.appendChild(p),this}removeControl(R){if(!R||!R.onRemove)return this.fire(new n.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const c=this._controls.indexOf(R);return c>-1&&this._controls.splice(c,1),R.onRemove(this),this}hasControl(R){return this._controls.indexOf(R)>-1}calculateCameraOptionsFromTo(R,c,p,F){return F==null&&this.terrain&&(F=this.terrain.getElevationForLngLatZoom(p,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(R,c,p,F)}resize(R){var c;const p=this._containerDimensions(),F=p[0],j=p[1],q=this._getClampedPixelRatio(F,j);if(this._resizeCanvas(F,j,q),this.painter.resize(F,j,q),this.painter.overLimit()){const pe=this.painter.context.gl;this._maxCanvasSize=[pe.drawingBufferWidth,pe.drawingBufferHeight];const be=this._getClampedPixelRatio(F,j);this._resizeCanvas(F,j,be),this.painter.resize(F,j,be)}this.transform.resize(F,j),(c=this._requestedCameraState)===null||c===void 0||c.resize(F,j);const ie=!this._moving;return ie&&(this.stop(),this.fire(new n.k("movestart",R)).fire(new n.k("move",R))),this.fire(new n.k("resize",R)),ie&&this.fire(new n.k("moveend",R)),this}_getClampedPixelRatio(R,c){const{0:p,1:F}=this._maxCanvasSize,j=this.getPixelRatio(),q=R*j,ie=c*j,pe=q>p?p/q:1,be=ie>F?F/ie:1;return Math.min(pe,be)*j}getPixelRatio(){var R;return(R=this._overridePixelRatio)!==null&&R!==void 0?R:devicePixelRatio}setPixelRatio(R){this._overridePixelRatio=R,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(R){return this.transform.setMaxBounds(Te.convert(R)),this._update()}setMinZoom(R){if((R=R??-2)>=-2&&R<=this.transform.maxZoom)return this.transform.minZoom=R,this._update(),this.getZoom()<R&&this.setZoom(R),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(R){if((R=R??22)>=this.transform.minZoom)return this.transform.maxZoom=R,this._update(),this.getZoom()>R&&this.setZoom(R),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(R){if((R=R??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(R>=0&&R<=this.transform.maxPitch)return this.transform.minPitch=R,this._update(),this.getPitch()<R&&this.setPitch(R),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(R){if((R=R??60)>85)throw new Error("maxPitch must be less than or equal to 85");if(R>=this.transform.minPitch)return this.transform.maxPitch=R,this._update(),this.getPitch()>R&&this.setPitch(R),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(R){return this.transform.renderWorldCopies=R,this._update()}project(R){return this.transform.locationPoint(n.N.convert(R),this.style&&this.terrain)}unproject(R){return this.transform.pointLocation(n.P.convert(R),this.terrain)}isMoving(){var R;return this._moving||((R=this.handlers)===null||R===void 0?void 0:R.isMoving())}isZooming(){var R;return this._zooming||((R=this.handlers)===null||R===void 0?void 0:R.isZooming())}isRotating(){var R;return this._rotating||((R=this.handlers)===null||R===void 0?void 0:R.isRotating())}_createDelegatedListener(R,c,p){if(R==="mouseenter"||R==="mouseover"){let F=!1;return{layer:c,listener:p,delegates:{mousemove:j=>{const q=this.getLayer(c)?this.queryRenderedFeatures(j.point,{layers:[c]}):[];q.length?F||(F=!0,p.call(this,new To(R,this,j.originalEvent,{features:q}))):F=!1},mouseout:()=>{F=!1}}}}if(R==="mouseleave"||R==="mouseout"){let F=!1;return{layer:c,listener:p,delegates:{mousemove:j=>{(this.getLayer(c)?this.queryRenderedFeatures(j.point,{layers:[c]}):[]).length?F=!0:F&&(F=!1,p.call(this,new To(R,this,j.originalEvent)))},mouseout:j=>{F&&(F=!1,p.call(this,new To(R,this,j.originalEvent)))}}}}{const F=j=>{const q=this.getLayer(c)?this.queryRenderedFeatures(j.point,{layers:[c]}):[];q.length&&(j.features=q,p.call(this,j),delete j.features)};return{layer:c,listener:p,delegates:{[R]:F}}}}on(R,c,p){if(p===void 0)return super.on(R,c);const F=this._createDelegatedListener(R,c,p);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[R]=this._delegatedListeners[R]||[],this._delegatedListeners[R].push(F);for(const j in F.delegates)this.on(j,F.delegates[j]);return this}once(R,c,p){if(p===void 0)return super.once(R,c);const F=this._createDelegatedListener(R,c,p);for(const j in F.delegates)this.once(j,F.delegates[j]);return this}off(R,c,p){return p===void 0?super.off(R,c):(this._delegatedListeners&&this._delegatedListeners[R]&&(F=>{const j=F[R];for(let q=0;q<j.length;q++){const ie=j[q];if(ie.layer===c&&ie.listener===p){for(const pe in ie.delegates)this.off(pe,ie.delegates[pe]);return j.splice(q,1),this}}})(this._delegatedListeners),this)}queryRenderedFeatures(R,c){if(!this.style)return[];let p;const F=R instanceof n.P||Array.isArray(R),j=F?R:[[0,0],[this.transform.width,this.transform.height]];if(c=c||(F?{}:R)||{},j instanceof n.P||typeof j[0]=="number")p=[n.P.convert(j)];else{const q=n.P.convert(j[0]),ie=n.P.convert(j[1]);p=[q,new n.P(ie.x,q.y),ie,new n.P(q.x,ie.y),q]}return this.style.queryRenderedFeatures(p,c,this.transform)}querySourceFeatures(R,c){return this.style.querySourceFeatures(R,c)}setStyle(R,c){return(c=n.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},c)).diff!==!1&&c.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&R?(this._diffStyle(R,c),this):(this._localIdeographFontFamily=c.localIdeographFontFamily,this._updateStyle(R,c))}setTransformRequest(R){return this._requestManager.setTransformRequest(R),this}_getUIString(R){const c=this._locale[R];if(c==null)throw new Error(`Missing UI string '${R}'`);return c}_updateStyle(R,c){if(c.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(R,c));const p=this.style&&c.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!R)),R?(this.style=new ja(this,c||{}),this.style.setEventedParent(this,{style:this.style}),typeof R=="string"?this.style.loadURL(R,c,p):this.style.loadJSON(R,c,p),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new ja(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(R,c){if(typeof R=="string"){const p=R,F=this._requestManager.transformRequest(p,"Style");n.h(F,new AbortController).then(j=>{this._updateDiff(j.data,c)}).catch(j=>{j&&this.fire(new n.j(j))})}else typeof R=="object"&&this._updateDiff(R,c)}_updateDiff(R,c){try{this.style.setState(R,c)&&this._update(!0)}catch(p){n.w(`Unable to perform style diff: ${p.message||p.error||p}. Rebuilding the style from scratch.`),this._updateStyle(R,c)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():n.w("There is no style added to the map.")}addSource(R,c){return this._lazyInitEmptyStyle(),this.style.addSource(R,c),this._update(!0)}isSourceLoaded(R){const c=this.style&&this.style.sourceCaches[R];if(c!==void 0)return c.loaded();this.fire(new n.j(new Error(`There is no source with ID '${R}'`)))}setTerrain(R){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),R){const c=this.style.sourceCaches[R.source];if(!c)throw new Error(`cannot load terrain, because there exists no source with ID: ${R.source}`);this.terrain===null&&c.reload();for(const p in this.style._layers){const F=this.style._layers[p];F.type==="hillshade"&&F.source===R.source&&n.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new ii(this.painter,c,R),this.painter.renderToTexture=new Ds(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=p=>{p.dataType==="style"?this.terrain.sourceCache.freeRtt():p.dataType==="source"&&p.tile&&(p.sourceId!==R.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(p.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new n.k("terrain",{terrain:R})),this}getTerrain(){var R,c;return(c=(R=this.terrain)===null||R===void 0?void 0:R.options)!==null&&c!==void 0?c:null}areTilesLoaded(){const R=this.style&&this.style.sourceCaches;for(const c in R){const p=R[c]._tiles;for(const F in p){const j=p[F];if(j.state!=="loaded"&&j.state!=="errored")return!1}}return!0}removeSource(R){return this.style.removeSource(R),this._update(!0)}getSource(R){return this.style.getSource(R)}addImage(R,c,p={}){const{pixelRatio:F=1,sdf:j=!1,stretchX:q,stretchY:ie,content:pe,textFitWidth:be,textFitHeight:Ae}=p;if(this._lazyInitEmptyStyle(),!(c instanceof HTMLImageElement||n.b(c))){if(c.width===void 0||c.height===void 0)return this.fire(new n.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:Fe,height:Ge,data:at}=c,ct=c;return this.style.addImage(R,{data:new n.R({width:Fe,height:Ge},new Uint8Array(at)),pixelRatio:F,stretchX:q,stretchY:ie,content:pe,textFitWidth:be,textFitHeight:Ae,sdf:j,version:0,userImage:ct}),ct.onAdd&&ct.onAdd(this,R),this}}{const{width:Fe,height:Ge,data:at}=u.getImageData(c);this.style.addImage(R,{data:new n.R({width:Fe,height:Ge},at),pixelRatio:F,stretchX:q,stretchY:ie,content:pe,textFitWidth:be,textFitHeight:Ae,sdf:j,version:0})}}updateImage(R,c){const p=this.style.getImage(R);if(!p)return this.fire(new n.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const F=c instanceof HTMLImageElement||n.b(c)?u.getImageData(c):c,{width:j,height:q,data:ie}=F;if(j===void 0||q===void 0)return this.fire(new n.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(j!==p.data.width||q!==p.data.height)return this.fire(new n.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const pe=!(c instanceof HTMLImageElement||n.b(c));return p.data.replace(ie,pe),this.style.updateImage(R,p),this}getImage(R){return this.style.getImage(R)}hasImage(R){return R?!!this.style.getImage(R):(this.fire(new n.j(new Error("Missing required image id"))),!1)}removeImage(R){this.style.removeImage(R)}loadImage(R){return T.getImage(this._requestManager.transformRequest(R,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(R,c){return this._lazyInitEmptyStyle(),this.style.addLayer(R,c),this._update(!0)}moveLayer(R,c){return this.style.moveLayer(R,c),this._update(!0)}removeLayer(R){return this.style.removeLayer(R),this._update(!0)}getLayer(R){return this.style.getLayer(R)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(R,c,p){return this.style.setLayerZoomRange(R,c,p),this._update(!0)}setFilter(R,c,p={}){return this.style.setFilter(R,c,p),this._update(!0)}getFilter(R){return this.style.getFilter(R)}setPaintProperty(R,c,p,F={}){return this.style.setPaintProperty(R,c,p,F),this._update(!0)}getPaintProperty(R,c){return this.style.getPaintProperty(R,c)}setLayoutProperty(R,c,p,F={}){return this.style.setLayoutProperty(R,c,p,F),this._update(!0)}getLayoutProperty(R,c){return this.style.getLayoutProperty(R,c)}setGlyphs(R,c={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(R,c),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(R,c,p={}){return this._lazyInitEmptyStyle(),this.style.addSprite(R,c,p,F=>{F||this._update(!0)}),this}removeSprite(R){return this._lazyInitEmptyStyle(),this.style.removeSprite(R),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(R,c={}){return this._lazyInitEmptyStyle(),this.style.setSprite(R,c,p=>{p||this._update(!0)}),this}setLight(R,c={}){return this._lazyInitEmptyStyle(),this.style.setLight(R,c),this._update(!0)}getLight(){return this.style.getLight()}setSky(R){return this._lazyInitEmptyStyle(),this.style.setSky(R),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(R,c){return this.style.setFeatureState(R,c),this._update()}removeFeatureState(R,c){return this.style.removeFeatureState(R,c),this._update()}getFeatureState(R){return this.style.getFeatureState(R)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let R=0,c=0;return this._container&&(R=this._container.clientWidth||400,c=this._container.clientHeight||300),[R,c]}_setupContainer(){const R=this._container;R.classList.add("maplibregl-map");const c=this._canvasContainer=r.create("div","maplibregl-canvas-container",R);this._interactive&&c.classList.add("maplibregl-interactive"),this._canvas=r.create("canvas","maplibregl-canvas",c),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const p=this._containerDimensions(),F=this._getClampedPixelRatio(p[0],p[1]);this._resizeCanvas(p[0],p[1],F);const j=this._controlContainer=r.create("div","maplibregl-control-container",R),q=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(ie=>{q[ie]=r.create("div",`maplibregl-ctrl-${ie} `,j)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(R,c,p){this._canvas.width=Math.floor(p*R),this._canvas.height=Math.floor(p*c),this._canvas.style.width=`${R}px`,this._canvas.style.height=`${c}px`}_setupPainter(){const R={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let c=null;this._canvas.addEventListener("webglcontextcreationerror",F=>{c={requestedAttributes:R},F&&(c.statusMessage=F.statusMessage,c.type=F.type)},{once:!0});const p=this._canvas.getContext("webgl2",R)||this._canvas.getContext("webgl",R);if(!p){const F="Failed to initialize WebGL";throw c?(c.message=F,new Error(JSON.stringify(c))):new Error(F)}this.painter=new lc(p,this.transform),i.testSupport(p)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(R){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||R,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(R){return this._update(),this._renderTaskQueue.add(R)}_cancelRenderFrame(R){this._renderTaskQueue.remove(R)}_render(R){const c=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(R),this._removed)return;let p=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const j=this.transform.zoom,q=u.now();this.style.zoomHistory.update(j,q);const ie=new n.a9(j,{now:q,fadeDuration:c,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),pe=ie.crossFadingFactor();pe===1&&pe===this._crossFadingFactor||(p=!0,this._crossFadingFactor=pe),this.style.update(ie)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,c,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:c,showPadding:this.showPadding}),this.fire(new n.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,n.be.mark(n.bf.load),this.fire(new n.k("load"))),this.style&&(this.style.hasTransitions()||p)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const F=this._sourcesDirty||this._styleDirty||this._placementDirty;return F||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new n.k("idle")),!this._loaded||this._fullyLoaded||F||(this._fullyLoaded=!0,n.be.mark(n.bf.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var R;this._hash&&this._hash.remove();for(const p of this._controls)p.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),T.removeThrottleControl(this._imageQueueHandle),(R=this._resizeObserver)===null||R===void 0||R.disconnect();const c=this.painter.context.gl.getExtension("WEBGL_lose_context");c!=null&&c.loseContext&&c.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),r.remove(this._canvasContainer),r.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),n.be.clearMetrics(),this._removed=!0,this.fire(new n.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,u.frameAsync(this._frameRequest).then(R=>{n.be.frame(R),this._frameRequest=null,this._render(R)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(R){this._showTileBoundaries!==R&&(this._showTileBoundaries=R,this._update())}get showPadding(){return!!this._showPadding}set showPadding(R){this._showPadding!==R&&(this._showPadding=R,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(R){this._showCollisionBoxes!==R&&(this._showCollisionBoxes=R,R?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(R){this._showOverdrawInspector!==R&&(this._showOverdrawInspector=R,this._update())}get repaint(){return!!this._repaint}set repaint(R){this._repaint!==R&&(this._repaint=R,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(R){this._vertices=R,this._update()}get version(){return Mc}getCameraTargetElevation(){return this.transform.elevation}},h.MapMouseEvent=To,h.MapTouchEvent=go,h.MapWheelEvent=Xs,h.Marker=zi,h.NavigationControl=class{constructor(R){this._updateZoomButtons=()=>{const c=this._map.getZoom(),p=c===this._map.getMaxZoom(),F=c===this._map.getMinZoom();this._zoomInButton.disabled=p,this._zoomOutButton.disabled=F,this._zoomInButton.setAttribute("aria-disabled",p.toString()),this._zoomOutButton.setAttribute("aria-disabled",F.toString())},this._rotateCompassArrow=()=>{const c=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=c},this._setButtonTitle=(c,p)=>{const F=this._map._getUIString(`NavigationControl.${p}`);c.title=F,c.setAttribute("aria-label",F)},this.options=n.e({},Cs,R),this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",c=>c.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",c=>this._map.zoomIn({},{originalEvent:c})),r.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",c=>this._map.zoomOut({},{originalEvent:c})),r.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",c=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:c}):this._map.resetNorth({},{originalEvent:c})}),this._compassIcon=r.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(R){return this._map=R,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 Ya(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){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}_createButton(R,c){const p=r.create("button",R,this._container);return p.type="button",p.addEventListener("click",c),p}},h.Popup=wt,h.RasterDEMTileSource=Ve,h.RasterTileSource=Le,h.ScaleControl=class{constructor(R){this._onMove=()=>{wi(this._map,this._container,this.options)},this.setUnit=c=>{this.options.unit=c,wi(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},tr),R)}getDefaultPosition(){return"bottom-left"}onAdd(R){return this._map=R,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-scale",R.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},h.ScrollZoomHandler=el,h.Style=ja,h.TerrainControl=class{constructor(R){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=R}onAdd(R){return this._map=R,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=r.create("button","maplibregl-ctrl-terrain",this._container),r.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){r.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},h.TwoFingersTouchPitchHandler=Dl,h.TwoFingersTouchRotateHandler=qc,h.TwoFingersTouchZoomHandler=sr,h.TwoFingersTouchZoomRotateHandler=nl,h.VectorTileSource=Pe,h.VideoSource=ye,h.addSourceType=(R,c)=>n._(void 0,void 0,void 0,function*(){if(je(R))throw new Error(`A source type called "${R}" already exists.`);((p,F)=>{ke[p]=F})(R,c)}),h.clearPrewarmedResources=function(){const R=fe;R&&(R.isPreloaded()&&R.numActive()===1?(R.release(ce),fe=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},h.getMaxParallelImageRequests=function(){return n.a.MAX_PARALLEL_IMAGE_REQUESTS},h.getRTLTextPluginStatus=function(){return Xe().getRTLTextPluginStatus()},h.getVersion=function(){return ne},h.getWorkerCount=function(){return de.workerCount},h.getWorkerUrl=function(){return n.a.WORKER_URL},h.importScriptInWorkers=function(R){return me().broadcast("IS",R)},h.prewarm=function(){le().acquire(ce)},h.setMaxParallelImageRequests=function(R){n.a.MAX_PARALLEL_IMAGE_REQUESTS=R},h.setRTLTextPlugin=function(R,c){return Xe().setRTLTextPlugin(R,c)},h.setWorkerCount=function(R){de.workerCount=R},h.setWorkerUrl=function(R){n.a.WORKER_URL=R}}),g}()},88640:function(b,g,a){function y(xe,Ce,Te){xe.prototype=Ce.prototype=Te,Te.constructor=xe}function h(xe,Ce){var Te=Object.create(xe.prototype);for(var Ee in Ce)Te[Ee]=Ce[Ee];return Te}function n(){}a.d(g,{GW:function(){return ge},Dj:function(){return de}});var x=.7,_=1/x,v="\\s*([+-]?\\d+)\\s*",u="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",r="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",i=/^#([0-9a-f]{3,8})$/,d=new RegExp("^rgb\\(".concat(v,",").concat(v,",").concat(v,"\\)$")),l=new RegExp("^rgb\\(".concat(r,",").concat(r,",").concat(r,"\\)$")),f=new RegExp("^rgba\\(".concat(v,",").concat(v,",").concat(v,",").concat(u,"\\)$")),m=new RegExp("^rgba\\(".concat(r,",").concat(r,",").concat(r,",").concat(u,"\\)$")),w=new RegExp("^hsl\\(".concat(u,",").concat(r,",").concat(r,"\\)$")),T=new RegExp("^hsla\\(".concat(u,",").concat(r,",").concat(r,",").concat(u,"\\)$")),A={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function C(){return this.rgb().formatHex()}function P(){return this.rgb().formatRgb()}function B(xe){var Ce,Te;return xe=(xe+"").trim().toLowerCase(),(Ce=i.exec(xe))?(Te=Ce[1].length,Ce=parseInt(Ce[1],16),Te===6?E(Ce):Te===3?new S(Ce>>8&15|Ce>>4&240,Ce>>4&15|240&Ce,(15&Ce)<<4|15&Ce,1):Te===8?I(Ce>>24&255,Ce>>16&255,Ce>>8&255,(255&Ce)/255):Te===4?I(Ce>>12&15|Ce>>8&240,Ce>>8&15|Ce>>4&240,Ce>>4&15|240&Ce,((15&Ce)<<4|15&Ce)/255):null):(Ce=d.exec(xe))?new S(Ce[1],Ce[2],Ce[3],1):(Ce=l.exec(xe))?new S(255*Ce[1]/100,255*Ce[2]/100,255*Ce[3]/100,1):(Ce=f.exec(xe))?I(Ce[1],Ce[2],Ce[3],Ce[4]):(Ce=m.exec(xe))?I(255*Ce[1]/100,255*Ce[2]/100,255*Ce[3]/100,Ce[4]):(Ce=w.exec(xe))?$(Ce[1],Ce[2]/100,Ce[3]/100,1):(Ce=T.exec(xe))?$(Ce[1],Ce[2]/100,Ce[3]/100,Ce[4]):A.hasOwnProperty(xe)?E(A[xe]):xe==="transparent"?new S(NaN,NaN,NaN,0):null}function E(xe){return new S(xe>>16&255,xe>>8&255,255&xe,1)}function I(xe,Ce,Te,Ee){return Ee<=0&&(xe=Ce=Te=NaN),new S(xe,Ce,Te,Ee)}function M(xe,Ce,Te,Ee){return arguments.length===1?((Pe=xe)instanceof n||(Pe=B(Pe)),Pe?new S((Pe=Pe.rgb()).r,Pe.g,Pe.b,Pe.opacity):new S):new S(xe,Ce,Te,Ee??1);var Pe}function S(xe,Ce,Te,Ee){this.r=+xe,this.g=+Ce,this.b=+Te,this.opacity=+Ee}function L(){return"#".concat(V(this.r)).concat(V(this.g)).concat(V(this.b))}function k(){var xe=z(this.opacity);return"".concat(xe===1?"rgb(":"rgba(").concat(N(this.r),", ").concat(N(this.g),", ").concat(N(this.b)).concat(xe===1?")":", ".concat(xe,")"))}function z(xe){return isNaN(xe)?1:Math.max(0,Math.min(1,xe))}function N(xe){return Math.max(0,Math.min(255,Math.round(xe)||0))}function V(xe){return((xe=N(xe))<16?"0":"")+xe.toString(16)}function $(xe,Ce,Te,Ee){return Ee<=0?xe=Ce=Te=NaN:Te<=0||Te>=1?xe=Ce=NaN:Ce<=0&&(xe=NaN),new U(xe,Ce,Te,Ee)}function G(xe){if(xe instanceof U)return new U(xe.h,xe.s,xe.l,xe.opacity);if(xe instanceof n||(xe=B(xe)),!xe)return new U;if(xe instanceof U)return xe;var Ce=(xe=xe.rgb()).r/255,Te=xe.g/255,Ee=xe.b/255,Pe=Math.min(Ce,Te,Ee),Le=Math.max(Ce,Te,Ee),Ve=NaN,Ie=Le-Pe,De=(Le+Pe)/2;return Ie?(Ve=Ce===Le?(Te-Ee)/Ie+6*(Te<Ee):Te===Le?(Ee-Ce)/Ie+2:(Ce-Te)/Ie+4,Ie/=De<.5?Le+Pe:2-Le-Pe,Ve*=60):Ie=De>0&&De<1?0:Ve,new U(Ve,Ie,De,xe.opacity)}function U(xe,Ce,Te,Ee){this.h=+xe,this.s=+Ce,this.l=+Te,this.opacity=+Ee}function J(xe){return(xe=(xe||0)%360)<0?xe+360:xe}function ae(xe){return Math.max(0,Math.min(1,xe||0))}function Y(xe,Ce,Te){return 255*(xe<60?Ce+(Te-Ce)*xe/60:xe<180?Te:xe<240?Ce+(Te-Ce)*(240-xe)/60:Ce)}y(n,B,{copy:function(xe){return Object.assign(new this.constructor,this,xe)},displayable:function(){return this.rgb().displayable()},hex:C,formatHex:C,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return G(this).formatHsl()},formatRgb:P,toString:P}),y(S,M,h(n,{brighter:function(xe){return xe=xe==null?_:Math.pow(_,xe),new S(this.r*xe,this.g*xe,this.b*xe,this.opacity)},darker:function(xe){return xe=xe==null?x:Math.pow(x,xe),new S(this.r*xe,this.g*xe,this.b*xe,this.opacity)},rgb:function(){return this},clamp:function(){return new S(N(this.r),N(this.g),N(this.b),z(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:L,formatHex:L,formatHex8:function(){return"#".concat(V(this.r)).concat(V(this.g)).concat(V(this.b)).concat(V(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:k,toString:k})),y(U,function(xe,Ce,Te,Ee){return arguments.length===1?G(xe):new U(xe,Ce,Te,Ee??1)},h(n,{brighter:function(xe){return xe=xe==null?_:Math.pow(_,xe),new U(this.h,this.s,this.l*xe,this.opacity)},darker:function(xe){return xe=xe==null?x:Math.pow(x,xe),new U(this.h,this.s,this.l*xe,this.opacity)},rgb:function(){var xe=this.h%360+360*(this.h<0),Ce=isNaN(xe)||isNaN(this.s)?0:this.s,Te=this.l,Ee=Te+(Te<.5?Te:1-Te)*Ce,Pe=2*Te-Ee;return new S(Y(xe>=240?xe-240:xe+120,Pe,Ee),Y(xe,Pe,Ee),Y(xe<120?xe+240:xe-120,Pe,Ee),this.opacity)},clamp:function(){return new U(J(this.h),ae(this.s),ae(this.l),z(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var xe=z(this.opacity);return"".concat(xe===1?"hsl(":"hsla(").concat(J(this.h),", ").concat(100*ae(this.s),"%, ").concat(100*ae(this.l),"%").concat(xe===1?")":", ".concat(xe,")"))}}));var te=function(xe){return function(){return xe}};function ee(xe,Ce){var Te=Ce-xe;return Te?function(Ee,Pe){return function(Le){return Ee+Le*Pe}}(xe,Te):te(isNaN(xe)?Ce:xe)}var Z=function xe(Ce){var Te=function(Pe){return(Pe=+Pe)==1?ee:function(Le,Ve){return Ve-Le?function(Ie,De,Be){return Ie=Math.pow(Ie,Be),De=Math.pow(De,Be)-Ie,Be=1/Be,function(ye){return Math.pow(Ie+ye*De,Be)}}(Le,Ve,Pe):te(isNaN(Le)?Ve:Le)}}(Ce);function Ee(Pe,Le){var Ve=Te((Pe=M(Pe)).r,(Le=M(Le)).r),Ie=Te(Pe.g,Le.g),De=Te(Pe.b,Le.b),Be=ee(Pe.opacity,Le.opacity);return function(ye){return Pe.r=Ve(ye),Pe.g=Ie(ye),Pe.b=De(ye),Pe.opacity=Be(ye),Pe+""}}return Ee.gamma=xe,Ee}(1);function K(xe,Ce){var Te,Ee=Ce?Ce.length:0,Pe=xe?Math.min(Ee,xe.length):0,Le=new Array(Pe),Ve=new Array(Ee);for(Te=0;Te<Pe;++Te)Le[Te]=ge(xe[Te],Ce[Te]);for(;Te<Ee;++Te)Ve[Te]=Ce[Te];return function(Ie){for(Te=0;Te<Pe;++Te)Ve[Te]=Le[Te](Ie);return Ve}}function ce(xe,Ce){var Te=new Date;return xe=+xe,Ce=+Ce,function(Ee){return Te.setTime(xe*(1-Ee)+Ce*Ee),Te}}function de(xe,Ce){return xe=+xe,Ce=+Ce,function(Te){return xe*(1-Te)+Ce*Te}}function he(xe){return he=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ce){return typeof Ce}:function(Ce){return Ce&&typeof Symbol=="function"&&Ce.constructor===Symbol&&Ce!==Symbol.prototype?"symbol":typeof Ce},he(xe)}function fe(xe,Ce){var Te,Ee={},Pe={};for(Te in xe!==null&&he(xe)==="object"||(xe={}),Ce!==null&&he(Ce)==="object"||(Ce={}),Ce)Te in xe?Ee[Te]=ge(xe[Te],Ce[Te]):Pe[Te]=Ce[Te];return function(Le){for(Te in Ee)Pe[Te]=Ee[Te](Le);return Pe}}var re=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,le=new RegExp(re.source,"g");function se(xe,Ce){var Te,Ee,Pe,Le=re.lastIndex=le.lastIndex=0,Ve=-1,Ie=[],De=[];for(xe+="",Ce+="";(Te=re.exec(xe))&&(Ee=le.exec(Ce));)(Pe=Ee.index)>Le&&(Pe=Ce.slice(Le,Pe),Ie[Ve]?Ie[Ve]+=Pe:Ie[++Ve]=Pe),(Te=Te[0])===(Ee=Ee[0])?Ie[Ve]?Ie[Ve]+=Ee:Ie[++Ve]=Ee:(Ie[++Ve]=null,De.push({i:Ve,x:de(Te,Ee)})),Le=le.lastIndex;return Le<Ce.length&&(Pe=Ce.slice(Le),Ie[Ve]?Ie[Ve]+=Pe:Ie[++Ve]=Pe),Ie.length<2?De[0]?function(Be){return function(ye){return Be(ye)+""}}(De[0].x):function(Be){return function(){return Be}}(Ce):(Ce=De.length,function(Be){for(var ye,Me=0;Me<Ce;++Me)Ie[(ye=De[Me]).i]=ye.x(Be);return Ie.join("")})}function me(xe,Ce){Ce||(Ce=[]);var Te,Ee=xe?Math.min(Ce.length,xe.length):0,Pe=Ce.slice();return function(Le){for(Te=0;Te<Ee;++Te)Pe[Te]=xe[Te]*(1-Le)+Ce[Te]*Le;return Pe}}function _e(xe){return _e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ce){return typeof Ce}:function(Ce){return Ce&&typeof Symbol=="function"&&Ce.constructor===Symbol&&Ce!==Symbol.prototype?"symbol":typeof Ce},_e(xe)}function ge(xe,Ce){var Te,Ee,Pe=_e(Ce);return Ce==null||Pe==="boolean"?te(Ce):(Pe==="number"?de:Pe==="string"?(Te=B(Ce))?(Ce=Te,Z):se:Ce instanceof B?Z:Ce instanceof Date?ce:(Ee=Ce,!ArrayBuffer.isView(Ee)||Ee instanceof DataView?Array.isArray(Ce)?K:typeof Ce.valueOf!="function"&&typeof Ce.toString!="function"||isNaN(Ce)?fe:de:me))(xe,Ce)}},23648:function(b){b.exports=JSON.parse('["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]')},2362:function(b){b.exports=JSON.parse('["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]')},87486:function(b){b.exports=JSON.parse('["normal","italic","oblique"]')},99803:function(b){b.exports=JSON.parse('["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]')},54324:function(b){b.exports=JSON.parse('["inherit","initial","unset"]')},94316:function(b){b.exports=JSON.parse('["caption","icon","menu","message-box","small-caption","status-bar"]')},37071:function(b){b.exports=JSON.parse(`{"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":0.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,0.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,0.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,0.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,0.8],[20,4]]},"line-opacity":0.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,0.9],[10,0.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":[0.5,0.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,0.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,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":0.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":[0.5,0.25],"line-width":{"base":1.2,"stops":[[5,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":0.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,0.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,0.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,0.5],[20,18]]},"line-opacity":0.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,0.5],[20,18]]},"line-opacity":0.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,0.4],[15,0.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,0.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":0.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,0.6]]},"line-width":{"base":1.2,"stops":[[7,0],[8,0.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,0.5]]},"line-width":{"base":1.2,"stops":[[5,0],[6,0.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,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":{"stops":[[4,0],[5,0.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,0.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":0.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,0.5],[20,13]]},"line-opacity":0.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,0.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,0.5],[20,18]]},"line-opacity":0.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,0.5],[20,18]]},"line-opacity":0.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,0.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":[0.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,0.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":[0.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,0.4],[15,0.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":[0.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,0.4],[6,0.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,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":0.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,0.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,0.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,0.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,0.5],[20,18]]},"line-opacity":0.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,0.4],[15,0.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":[0.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,0.4],[5,1],[12,3]]},"line-opacity":0.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,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,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,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":0.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}\\n{name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":0.2},"paint":{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{"id":"water-name-ocean","type":"symbol","source":"openmaptiles","source-layer":"water_name","filter":["all",["==","$type","Point"],["==","class","ocean"]],"layout":{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":0.2},"paint":{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{"id":"water-name-other","type":"symbol","source":"openmaptiles","source-layer":"water_name","filter":["all",["==","$type","Point"],["!in","class","ocean"]],"layout":{"text-font":["Noto Sans Italic"],"text-size":{"stops":[[0,10],[6,14]]},"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":0.2,"visibility":"visible"},"paint":{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{"id":"poi-level-3","type":"symbol","source":"openmaptiles","source-layer":"poi","minzoom":16,"filter":["all",["==","$type","Point"],[">=","rank",25]],"layout":{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\\n{name:nonlatin}","text-offset":[0,0.6],"text-size":12,"text-max-width":9},"paint":{"text-halo-blur":0.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{"id":"poi-level-2","type":"symbol","source":"openmaptiles","source-layer":"poi","minzoom":15,"filter":["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],"layout":{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\\n{name:nonlatin}","text-offset":[0,0.6],"text-size":12,"text-max-width":9},"paint":{"text-halo-blur":0.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{"id":"poi-level-1","type":"symbol","source":"openmaptiles","source-layer":"poi","minzoom":14,"filter":["all",["==","$type","Point"],["<=","rank",14],["has","name"]],"layout":{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\\n{name:nonlatin}","text-offset":[0,0.6],"text-size":11,"text-max-width":9},"paint":{"text-halo-blur":0.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{"id":"poi-railway","type":"symbol","source":"openmaptiles","source-layer":"poi","minzoom":13,"filter":["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],"layout":{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\\n{name:nonlatin}","text-offset":[0,0.6],"text-size":12,"text-max-width":9,"icon-optional":false,"icon-ignore-placement":false,"icon-allow-overlap":false,"text-ignore-placement":false,"text-allow-overlap":false,"text-optional":true},"paint":{"text-halo-blur":0.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{"id":"road_oneway","type":"symbol","source":"openmaptiles","source-layer":"transportation","minzoom":15,"filter":["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],"layout":{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{"stops":[[15,0.5],[19,1]]}},"paint":{"icon-opacity":0.5}},{"id":"road_oneway_opposite","type":"symbol","source":"openmaptiles","source-layer":"transportation","minzoom":15,"filter":["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],"layout":{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{"stops":[[15,0.5],[19,1]]}},"paint":{"icon-opacity":0.5}},{"id":"highway-name-path","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":15.5,"filter":["==","class","path"],"layout":{"text-size":{"base":1,"stops":[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},"paint":{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":0.5}},{"id":"highway-name-minor","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":15,"filter":["all",["==","$type","LineString"],["in","class","minor","service","track"]],"layout":{"text-size":{"base":1,"stops":[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},"paint":{"text-halo-blur":0.5,"text-color":"#765","text-halo-width":1}},{"id":"highway-name-major","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":12.2,"filter":["in","class","primary","secondary","tertiary","trunk"],"layout":{"text-size":{"base":1,"stops":[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},"paint":{"text-halo-blur":0.5,"text-color":"#765","text-halo-width":1}},{"id":"highway-shield","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":8,"filter":["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],"layout":{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{"base":1,"stops":[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},"paint":{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":0.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{"id":"highway-shield-us-interstate","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":7,"filter":["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],"layout":{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{"base":1,"stops":[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},"paint":{"text-color":"rgba(0, 0, 0, 1)"}},{"id":"highway-shield-us-other","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":9,"filter":["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],"layout":{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{"base":1,"stops":[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},"paint":{"text-color":"rgba(0, 0, 0, 1)"}},{"id":"place-other","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","minzoom":12,"filter":["!in","class","city","town","village","country","continent"],"layout":{"text-letter-spacing":0.1,"text-size":{"base":1.2,"stops":[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":"{name:latin}\\n{name:nonlatin}","text-transform":"uppercase","text-max-width":9,"visibility":"visible"},"paint":{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{"id":"place-village","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","minzoom":10,"filter":["==","class","village"],"layout":{"text-font":["Noto Sans Regular"],"text-size":{"base":1.2,"stops":[[10,12],[15,16]]},"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":8,"visibility":"visible"},"paint":{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{"id":"place-town","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["==","class","town"],"layout":{"text-font":["Noto Sans Regular"],"text-size":{"base":1.2,"stops":[[10,14],[15,24]]},"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":8,"visibility":"visible"},"paint":{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{"id":"place-city","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["!=","capital",2],["==","class","city"]],"layout":{"text-font":["Noto Sans Regular"],"text-size":{"base":1.2,"stops":[[7,14],[11,24]]},"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":8,"visibility":"visible"},"paint":{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-city-capital","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["==","capital",2],["==","class","city"]],"layout":{"text-font":["Noto Sans Regular"],"text-size":{"base":1.2,"stops":[[7,14],[11,24]]},"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":8,"icon-image":"star_11","text-offset":[0.4,0],"icon-size":0.8,"text-anchor":"left","visibility":"visible"},"paint":{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-country-other","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],"layout":{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{"stops":[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,"visibility":"visible"},"paint":{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-country-3","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],"layout":{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{"stops":[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,"visibility":"visible"},"paint":{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-country-2","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],"layout":{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{"stops":[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,"visibility":"visible"},"paint":{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-country-1","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],"layout":{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{"stops":[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,"visibility":"visible"},"paint":{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-continent","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","maxzoom":1,"filter":["==","class","continent"],"layout":{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase","visibility":"visible"},"paint":{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],"id":"qebnlkra6"}`)},51962:function(b){b.exports=JSON.parse(`{"version":8,"name":"orto","metadata":{},"center":[1.537786,41.837539],"zoom":12,"bearing":0,"pitch":0,"light":{"anchor":"viewport","color":"white","intensity":0.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"}}]}`)}},O={};function W(b){var g=O[b];if(g!==void 0)return g.exports;var a=O[b]={id:b,exports:{}};return s[b].call(a.exports,a,a.exports,W),a.exports}return W.m=s,W.n=function(b){var g=b&&b.__esModule?function(){return b.default}:function(){return b};return W.d(g,{a:g}),g},W.d=function(b,g){for(var a in g)W.o(g,a)&&!W.o(b,a)&&Object.defineProperty(b,a,{enumerable:!0,get:g[a]})},W.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),W.o=function(b,g){return Object.prototype.hasOwnProperty.call(b,g)},W.r=function(b){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(b,"__esModule",{value:!0})},W.b=document.baseURI||self.location.href,W.nc=void 0,W(20260)}()})})(sU);var iOt=sU.exports;const lU=rOt(iOt),oOt={id:"main-container"},sOt={id:"surface-container"},M5=39,qm=76,lOt=0,cU=2,uU=4,dU=5,hU=6,pU=7,cOt=8,uOt=9,fU=10,mU=11,gU=13,dOt=14,hOt=15,pOt=18,h1=19,fOt=800,yU=300,uT=.1208,vU=5,mOt=2,gOt=3,yOt=4,vOt=7,_Ot=-46,_U=100,bU=-14,bOt={__name:"CardField",props:{selected_category:{type:Number,default:31},selected_team:{type:[Array,Number],default:()=>[]},showBallPosition:{type:Boolean,default:!0},showPlayersPosition:{type:Boolean,default:!0},widthContainer:{type:Number,default:1280},dataPaintInfo:{type:Object,default:()=>{}},showTracks:{type:Boolean,default:!1},touches:{type:Number,default:1},showPlayersEndPosition:{type:Boolean,default:!1},secondStart:{type:Number,default:0},operationStart:{type:Number,default:0},secondEnd:{type:Number,default:1},operationEnd:{type:Number,default:1},inFavor:{type:Boolean,default:!0}},emits:["changelateralidad"],setup(e,{emit:o}){var s;let O=.75,W=t.ref("left");const b=o,g=t.ref(null),a=t.ref(null),y=t.ref(0),h=t.ref(null),n=new Set([583,585,587,589]),x=new Set([584,586,588,590]),_=new Set([122,128,136,142]),v=new Set([125,131,139,145]),u=new Set([124,130,138,144]),r=new Set([123,129,137,143]),i=e;let d=null;t.watch(()=>y.value,G=>{f(G),a.value&&(a.value.style.height=`${m(G)}px`),h.value&&(h.value.style.top=`${w(m(G))}px`)}),t.watch(()=>i.selected_category,G=>{G==32?W.value="right":W.value="left"});function l(){d=new ResizeObserver(G=>{for(const U of G)y.value=U.contentRect.width}),d.observe(g.value)}function f(G){lU.relayout(g.value,{width:G,height:m(G)})}function m(G){return Math.round(yU/fOt*G,0)}function w(G){return bU+(G-_U)/(yU-_U)*(_Ot-bU)}t.watch(()=>i.dataPaintInfo,G=>{N(G)},{deep:!0}),t.watch(()=>i.selected_team,G=>{G.data.length>0&&N(G)}),t.watch(()=>i.secondStart,G=>{N(G)});function T(G,U){let J=.01321,ae=.00929,Y=0,te=0,ee=[];const Z=U.length;let K=Math.floor(Z/10);for(;Y<qm;)te=U.filter(ce=>ce[0]>=Y*J&&ce[0]<=(Y+1)*J&&ce[1]>=G*ae&&ce[1]<=(G+1)*ae).map(ce=>ce[1]).length,K=K===0?1:K,ee.push(parseFloat((te/K).toFixed(4))),Y++;return ee.reverse()}function A(G,U){let J=.01321,ae=.01009,Y=0,te=0,ee=[];const Z=U.length;let K=Math.floor(Z/10);for(;Y<qm;)te=U.filter(ce=>ce[0]>=Y*J&&ce[0]<=(Y+1)*J&&ce[1]>=G*ae&&ce[1]<=(G+1)*ae).map(ce=>ce[1]).length,K=K===0?1:K,ee.push(parseFloat((te/K).toFixed(4))),Y++;return ee.reverse()}function C(G){let U=[B(qm),B(qm)],J=[],ae=M5;for(;ae>0&&ae<=M5;)J=T(ae,G),U.push(J),ae--;return U.push(B(qm),B(qm)),U}function P(G){let U=[B(qm),B(qm)],J=[],ae=M5;for(;ae>0&&ae<=M5;)J=A(ae,G),U.push(J),ae--;return U.push(B(qm),B(qm)),U}function B(G){return Array.from({length:G},()=>0)}function E(G,U,J){const ae=[];let Y=0,te=0;ae.push(G[0]);for(let ee=1;ee<J-1;ee++){const Z=[];Z.push(G[ee][0]);for(let K=1;K<U-1;K++)Y=G[ee][K-1],te=G[ee][K+1],Z.push(Y+.5*(G[ee][K]+te-Y));Z.push(G[ee][U-1]),ae.push(Z)}ae.push(G[J-1]);for(let ee=1;ee<U-1;ee++)for(let Z=1;Z<J-1;Z++)Y=ae[Z-1][ee],te=ae[Z+1][ee],ae[Z][ee]=Y+.5*(ae[Z][ee]+te-Y);return ae}function I(G){var U=[];let J=.14333333333333334;for(var ae=0;ae<G.length;ae++)if(G[ae][h1]==0&&G[ae][uU]===i.selected_category){let Y=G[ae][mU]-(J-uT);U.push([G[ae][fU],Y])}return U}function M(G,U,J=1){let ae=[],Y=[];return G.forEach(te=>{if(te[uU]===i.selected_category){let ee=G.filter(Z=>te[0]===Z[pOt]&&Z[h1]<=J).sort((Z,K)=>Z[h1]-K[h1]);ee.length>0&&ae.push(ee),te[h1]===0&&Y.push([te[lOt],te[gU],te[dOt],te[hOt]])}}),{sequences:ae,main_plays:Y}}function S(G,U,J,ae,Y){let te=.1,ee=ae*4,Z=ae*3,K=[],ce=[],de=[],he=[],fe=[],re=[],le=[],se=[],me=[],_e=[],ge=[],xe=[],Ce=[];const Te=.7,Ee="rgba(253, 101, 36, 1)",Pe="rgba(249, 189, 50, 1)",Le="rgba(145, 108, 255,1)",Ve="rgba(255, 255, 255,1)",Ie="rgba(203, 238, 107, 1)",De="rgba(55, 181, 252, 1)",Be="rgba(55, 252, 217, 1)",ye="rgba(195, 198, 201, 1)",Me=new Map([[n,{color:Ie,symbol:"circle"}],[x,{color:De,symbol:"circle"}],[_,{color:Be,symbol:"circle"}],[v,{color:ye,symbol:"x"}],[u,{color:Ee,symbol:"square"}],[r,{color:Pe,symbol:"triangle-up"}]]);return G.forEach(ke=>{if(ke.length===1){if(ke[0][h1]===0)return;let je=ke[0][hU]*J,Oe=ke[0][pU]*ee-Z,Ue=ae*uT,We=ae*te,Xe=Oe+Ue+We;if(Xe=Xe>=ae?ae-1:Xe,ce.push(je),de.push(Xe-Te),he.push(je),fe.push(Xe),Y===1){let we=ke[0][dU].split(","),Ne=!1;we=we.map(Number);for(const[Re,He]of Me)if(we.some(tt=>Re.has(tt))){re.push(He.color),le.push(He.symbol),Ne=!0;break}Ne||(re.push(Le),le.push("circle"))}else ke[0][cU]===U?re.push(Ve):re.push(Ee)}else ke.forEach((je,Oe)=>{if(je[h1]===0)return;let Ue=je[hU]*J,We=je[pU]*ee-Z,Xe=ae*uT,we=ae*te,Ne=We+Xe+we;if(Ne=Ne>=ae?ae-1:Ne,ce.push(Ue),de.push(Ne-Te),he.push(Ue),fe.push(Ne),Y===1){let Re=ke[0][dU].split(","),He=!1;Re=Re.map(Number);for(const[tt,Qe]of Me)if(Re.some(dt=>tt.has(dt))){re.push(Qe.color),le.push(Qe.symbol),He=!0;break}He||(re.push(Le),le.push("circle"))}else{let Re=je[cOt]*J,He=je[uOt]*ee-Z+Xe+we;He=He>=ae?ae-1:He;let tt=je[fU]*J,Qe=je[mU]*ee-Z+Xe+we;Qe=Qe>=ae?ae-1:Qe,je[cU]===U?re.push(Ve):re.push(Ee),_e.push(Ue,Re,null),ge.push(Ne,He,null),se.push(Ue,Re),me.push(Ne,He),ke.length-1===Oe&&(se.push(tt,null),me.push(Qe,null),xe.push(tt),Ce.push(Qe))}})}),K.shadowXPoints=ce,K.shadowYPoints=de,K.playerXPoints=he,K.playerYPoints=fe,K.playerColorPoints=re,K.trackX=se,K.trackY=me,K.sprintX=_e,K.sprintY=ge,K.arrowX=xe,K.arrowY=Ce,K.symbols=le,K}function L(G,U){return G.map((J,ae)=>J.map((Y,te)=>{if(te===U){let[ee,Z,K]=Y.split(/[:.]/);return parseInt(ee)*60+parseInt(Z)}else return Y}))}function k(G,U,J,ae,Y=0,te){let ee=[];return ae.forEach(Z=>{let K=Y===0?parseInt(Z[1])-parseInt(J):parseInt(Z[1])+parseInt(J);G.filter(ce=>Z[0]===ce[vOt]&&K===ce[vU]&&U===ce[mOt]).forEach(ce=>{let de=ce[gOt],he=ce[yOt];he<=te&&ee.push([de,he])})}),ee}function z(G){return G.flat().every(U=>U===0)}function N(G){G.data=L(G.data,gU),G.field_positions=L(G.field_positions,vU);let U=M(G.data,O,i.touches),J=I(G.data),ae=k(G.field_positions,i.selected_team,i.secondStart,U.main_plays,i.operationStart,O),Y=k(G.field_positions,i.selected_team,i.secondEnd,U.main_plays,i.operationEnd,O),te=P(J),ee=C(ae),Z=C(Y),K=te[0].length,ce=te.length;te=E(E(te,K,ce),K,ce),ee=E(E(ee,K,ce),K,ce),Z=E(E(Z,K,ce),K,ce),K=te[0].length,ce=te.length;let de=S(U.sequences,i.selected_team,K,ce,i.touches);var he=[[0,"rgba(12,31,82,0)"],[.2,"rgba(14, 55, 115, 0.8)"],[.4,"rgba(33, 85, 160, 0.8)"],[.6,"rgba(16, 124, 170, 0.8)"],[.8,"rgba(32, 154, 207, 0.8)"],[1,"rgba(32, 174, 207, 0.8)"]],fe=[[0,"rgba(12,31,82,0)"],[.2,"rgba(73, 13, 67, 0.8)"],[.4,"rgba(98, 32, 91, 0.8)"],[.6,"rgba(121, 52, 114, 0.8)"],[.8,"rgba(176, 36, 121, 0.8)"],[1,"rgba(230, 49, 158, 0.8)"]],re=[[0,"rgba(12,31,82,0)"],[.2,"rgba(94, 111, 79, 1)"],[.4,"rgba(111, 142, 28, 1)"],[.6,"rgba(142, 177, 50, 1)"],[.8,"rgba(169, 211, 57, 1)"],[1,"rgba(195, 229, 105, 1)"]],le=[{z:te,type:"heatmap",connectgaps:!0,opacity:1,colorscale:re,autoscale:!1,showscale:!1,zsmooth:"best",showgrid:!1,showline:!1}],se=[{z:ee,type:"heatmap",connectgaps:!0,opacity:1,colorscale:he,autoscale:!1,showscale:!1,zsmooth:"best",showgrid:!1,showline:!1}],me=[{z:Z,type:"heatmap",connectgaps:!0,opacity:1,colorscale:fe,autoscale:!1,showscale:!1,zsmooth:"best",showgrid:!1,showline:!1}],_e={x:de.shadowXPoints,y:de.shadowYPoints,mode:"markers",marker:{symbol:de.symbols,color:"rgba(0, 0, 0, 0.5)",size:9}},ge={x:de.playerXPoints,y:de.playerYPoints,mode:"markers",marker:{symbol:de.symbols,color:de.playerColorPoints,size:8}},xe={x:de.trackX,y:de.trackY,mode:"lines",line:{color:"rgba(255, 255, 255, 1)",width:1,dash:"2px 2px",arrowhead:"end"}},Ce={x:de.sprintX,y:de.sprintY,mode:"lines",line:{color:"rgba(255, 255, 255, 1)",width:1}},Te={x:de.arrowX,y:de.arrowY,mode:"markers",marker:{symbol:"triangle-up",size:10,color:"rgba(255, 255, 255, 1)",angle:120}},Ee=[];i.showTracks&&i.touches>1&&Ee.push(Ce,xe,Te),i.showTracks&&Ee.push(_e,ge),i.showPlayersEndPosition&&!z(Z)&&Ee.push(...me),i.showPlayersPosition&&!z(ee)&&Ee.push(...se),i.showBallPosition&&!z(te)&&Ee.push(...le);const Pe=[0,K],Le=[0,ce];s={showlegend:!1,width:y.value,height:m(y.value),xaxis:{title:"",showgrid:!1,showline:!1,zeroline:!1,showticklabels:!1,ticks:"",showbackground:!1,backgroundcolor:"transparent",range:Pe},yaxis:{title:"",showgrid:!1,showline:!1,zeroline:!1,showticklabels:!1,ticks:"",showbackground:!1,backgroundcolor:"transparent",range:Le},margin:{l:0,r:0,b:0,t:5}},lU.newPlot("surface-plot-heatmap",Ee,s,{displayModeBar:!1,staticPlot:!0},{responsive:!0})}const V=()=>{};function $(G){W.value=G,b("changelateralidad",W.value)}return t.onBeforeUnmount(()=>{window.removeEventListener("resize",V)}),t.onMounted(()=>{g.value&&(g.value.style.pointerEvents="none"),window.addEventListener("resize",V),l()}),(G,U)=>(t.openBlock(),t.createElementBlock("div",oOt,[t.createElementVNode("div",sOt,[i.dataPaintInfo.data.length==0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(e.widthContainer<768?"class-not-result-field-movil":"class-not-result-field")},[e.widthContainer<768?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[U[2]||(U[2]=t.createTextVNode("No se muestran resultados debido",-1)),U[3]||(U[3]=t.createElementVNode("br",null,null,-1)),U[4]||(U[4]=t.createTextVNode(" a los filtros aplicados.",-1))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("No se muestran resultados debido a los filtros aplicados.")],64))],2)):t.createCommentVNode("",!0),t.createElementVNode("div",{id:"label-left-zone",style:t.normalizeStyle(t.unref(W)=="left"?"":"opacity: 0.6"),onClick:U[0]||(U[0]=J=>$("left"))},null,4),t.createElementVNode("div",{id:"label-right-zone",style:t.normalizeStyle(t.unref(W)=="right"?"":"opacity: 0.6"),onClick:U[1]||(U[1]=J=>$("right"))},null,4),t.createElementVNode("div",{ref_key:"surfacePlot",ref:g,id:"surface-plot-heatmap",class:t.normalizeClass(e.inFavor?"":"against")},null,2)])]))}},xU="/arrowbtn.png",xOt={components:{GSCTrendMenuBall:ILt,GSCCheckbox:pv,GSCTrendPosition:aOt,CardField:bOt},props:{acronymHome:{type:String,default:""},acronymAway:{type:String,default:""},typePlay:{type:String,default:"A favor"},tournamentSelected:{type:Object,default:()=>({})},widthContainer:{type:Number,default:1280},touchAllData:{type:Array,default:()=>[]},playersData:{type:Object,default:()=>{}},homeTeam:{type:Number,default:0},awayTeam:{type:Number,default:0},selected_category:{type:Number,default:31},team:{type:Number,default:0},forGame:{type:Boolean,required:!1},teamsData:{type:Object,default:()=>{}},fieldPositionsAll:{type:Array,default:()=>[]},inFavor:{type:Boolean,required:!1},isTacticVisible:{type:Boolean,required:!1}},data(){return{type:"ball",show:!1,game:62276,trajectories:[],rival:3014,totalCorners:0,typepositioning:"Posición",BallOnOff:"OFF",numberTouches:1,playersList:{},timepositioning:-1,checkedBallGo:!0,checkedHeatMap:!0,filterFieldPositions:[],timepositioningFinal:-1,arrayPlayers:{},season:1325,timepositioningend:1,zonesFilter:[],touchFilter:{},token:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"}},watch:{touchAllData:{handler(){this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},deep:!0},zonesFilter:{handler(){this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},deep:!0},typepositioning:{handler(){this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},deep:!0},timepositioning:{handler(){this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},deep:!0},timepositioningend:{handler(){this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},deep:!0}},computed:{firstTeam(){return this.homeTeam===this.team?this.acronymHome:this.acronymAway},secondTeam(){return this.homeTeam===this.team?this.acronymAway:this.acronymHome},firstTeam1Touch(){return this.inFavor?this.homeTeam===this.team?this.acronymHome:this.acronymAway:this.homeTeam===this.team?this.acronymAway:this.acronymHome},secondTeam1Touch(){return this.inFavor?this.homeTeam===this.team?this.acronymAway:this.acronymHome:this.homeTeam===this.team?this.acronymHome:this.acronymAway},reftrendteamsTouches(){const e=this.widthContainer;return e<=480?"ref-trend-teams-touches480":e<=768?"ref-trend-teams-touches768":"ref-trend-teams-touches"},reftrendteamslocal(){const e=this.widthContainer;return e<=480?"ref-trend-teams-local480":e<=768?"ref-trend-teams-local768":"ref-trend-teams-local"},reftrendteamsrival(){return this.widthContainer<=768?"ref-trend-teams-rival768":"ref-trend-teams-rival"},reftrendteamsall(){const e=this.widthContainer;return e<=480?"ref-trend-teams-all480":e<=768?"ref-trend-teams-all768":"ref-trend-teams-all"},refpointlebeltext(){const e=this.widthContainer;return e<=390?"ref-point-lebel-text390":e<=480?"ref-point-lebel-text480":e<=768?"ref-point-lebel-text768":e<=860?"ref-point-lebel-text870":"ref-point-lebel-text"},trendcontentcontrols(){return this.widthContainer<=768?"trend-content-controls768":["trend-content-controls","to-right"]},trendtitle(){return this.widthContainer<=768?"trend-title768":"trend-title"},trendtitlecontainer(){return this.widthContainer<=768?"trend-titlecontainer768":"trend-titlecontainer"},trendcontentcontrolscontainer(){const e=this.widthContainer;return e<=400?"trend-content-controls-container400":e<=860?"trend-content-controls-container860":"trend-content-controls-container"},trendcontentcontrolsleyendcheckscontent(){const e=this.widthContainer;return e<=400?"trend-content-controls-leyend-checkscontent400":e<=768?"trend-content-controls-leyend-checkscontent768":e<=1e3?"trend-content-controls-leyend-checkscontent1000":"trend-content-controls-leyend-checkscontent"},trendcontentcontrolsleyend(){const e=this.widthContainer;return e<=768?"trend-content-controls-leyend768":e<=1e3?"trend-content-controls-leyend1000":"trend-content-controls-leyend"},contDataClass(){return this.widthContainer<=768?"cont-data768":"cont-data"},contDataClass2(){return this.widthContainer<=768?"cont-data-ref768":"cont-data-ref"},contCollectorsClass(){const e=this.widthContainer;return e<=768?"cont-collectors768":e<=900?"cont-collectors900":"cont-collectors"},contCollectorsClass2(){const e=this.widthContainer;return e<=768?"cont-collectors-ref768":e<=900?"cont-collectors-ref900":"cont-collectors-ref"},contWhoCnnectedClass(){const e=this.widthContainer;return e<=768?"cont-who-connected768":e<=900?"cont-who-connected900":"cont-who-connected"},contWhoCnnectedClass2(){const e=this.widthContainer;return e<=768?"cont-who-connected-ref768":e<=900?"cont-who-connected-ref900":"cont-who-connected-ref"}},methods:{changelateralidad(e){this.$emit("changelateralidad",e)},changeTouchesnum(e){this.numberTouches=e},checkBallGo(){this.checkedBallGo=!this.checkedBallGo},checkHeatMap(){this.checkedHeatMap=!this.checkedHeatMap},changeBallOnOff(e){typeof e=="string"&&(this.BallOnOff=e)},getDataPosition(){if(this.touchAllData.length>0){const o=this.touchAllData.filter(n=>n[19]===0).map(n=>this.tiempoASegundosEnteros(n[13]));let s=[];this.timepositioning>=0?s=o.map(n=>n+this.timepositioning):s=o.map(n=>n-this.timepositioning);const O=this.fieldPositionsAll.filter(n=>s.includes(this.tiempoASegundosEnteros(n[5]))&&n[2]===this.team),W=this.contarYAgruparPorPosicion(O);let b=[];this.zonesFilter.length!=35?b=this.fieldPositionsAll.filter(n=>this.zonesFilter.includes(n[6])&&n[2]===this.team):b=this.fieldPositionsAll.filter(n=>this.zonesFilter.includes(n[6])&&n[2]===this.team),this.filterFieldPositions=b;let g=[],a=[];for(var e in this.arrayPlayers)this.arrayPlayers[e].selected&&g.push(this.arrayPlayers[e].id),a.push(this.arrayPlayers[e].id);g.length>0&&(this.filterFieldPositions=this.filterFieldPositions.filter(n=>g.includes(n[1])));const y=b.filter(n=>s.includes(this.tiempoASegundosEnteros(n[5]))&&n[2]===this.team),h=this.contarYAgruparPorPosicion(y);this.arrayPlayers={};for(let n=0;n<W.length;n++){const x=h.filter(function(_){return _.id_player==W[n].id_player});this.arrayPlayers[W[n].id_player]={id:W[n].id_player,corners:W[n].corners,cornersfilter:x[0]?x[0].corners:0,data:this.playersData[W[n].id_player]?this.playersData[W[n].id_player]:{name:"-",img:"-",position:11,id:"-",team:"-",nationality_id:"-",nationality_flag:"https://golstatsimages.blob.core.windows.net/flags/undefined.jpg",jersey:"-"},selected:Object.keys(this.arrayPlayers).length>0&&a.includes(W[n].id_player)?!!g.includes(W[n].id_player):!0}}}else this.arrayPlayers={},this.filterFieldPositions=[]},getDataTrajectory(){if(this.touchAllData.length>0){const o=this.touchAllData.filter(v=>v[19]===0).map(v=>this.tiempoASegundosEnteros(v[13]));let s=[];this.timepositioning>=0?s=o.map(v=>v+Math.abs(this.timepositioning)):s=o.map(v=>v-Math.abs(this.timepositioning));let O=[];this.timepositioningend>=0?O=o.map(v=>v+Math.abs(this.timepositioningend)):O=o.map(v=>v-Math.abs(this.timepositioningend));const W=this.fieldPositionsAll.filter(v=>this.zonesFilter.includes(v[6])&&v[2]===this.team);this.filterFieldPositions=W;let b=[],g=[];for(var e in this.arrayPlayers)this.arrayPlayers[e].selected&&b.push(this.arrayPlayers[e].id),g.push(this.arrayPlayers[e].id);b.length>0&&(this.filterFieldPositions=this.filterFieldPositions.filter(v=>b.includes(v[1])));const a=this.fieldPositionsAll.filter(v=>o.includes(this.tiempoASegundosEnteros(v[5]))&&v[2]===this.team),y=W.filter(v=>s.includes(this.tiempoASegundosEnteros(v[5]))&&v[2]===this.team),h=W.filter(v=>O.includes(this.tiempoASegundosEnteros(v[5]))&&v[2]===this.team),n=this.contarYAgruparPorPosicion(a),x=this.contarYAgruparPorPosicion(y),_=this.contarYAgruparPorPosicion(h);for(let v=0;v<n.length;v++){const u=x.filter(function(i){return i.id_player==n[v].id_player}),r=_.filter(function(i){return i.id_player==n[v].id_player});this.arrayPlayers[n[v].id_player]={id:n[v].id_player,corners:n[v].corners,cornersfilter:u[0]?u[0].corners:0,cornersfilterfinal:r[0]?r[0].corners:0,data:this.playersData[n[v].id_player]?this.playersData[n[v].id_player]:{name:"-",img:"-",position:11,id:"-",team:"-",nationality_id:"-",nationality_flag:"https://golstatsimages.blob.core.windows.net/flags/undefined.jpg",jersey:"-"},selected:Object.keys(this.arrayPlayers).length>0&&g.includes(n[v].id_player)?!!b.includes(n[v].id_player):!0}}}else this.arrayPlayers={},this.filterFieldPositions=[]},contarYAgruparPorPosicion(e){const o=e.reduce((s,O)=>{const W=O[1];return s[W]?s[W]+=1:s[W]=1,s},{});return Object.keys(o).map(s=>({id_player:parseInt(s,10),corners:o[s]}))},tiempoASegundosEnteros(e){let o=e.split(":"),s=parseInt(o[0],10),O=parseFloat(o[1]);return s*60+Math.floor(O)},getTimePositioning(e){this.timepositioning=e},getTimePositioningEnd(e){this.timepositioningend=e},getTypePositioning(e){this.typepositioning=e},getArrayZonesField(e){this.zonesFilter=e},selectcheckplayerall(e){for(let o in this.arrayPlayers)this.arrayPlayers[o].selected=e;this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},selectcheckplayer(e){this.arrayPlayers[e].selected=!this.arrayPlayers[e].selected,this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},clickTypeButton(e){this.type=e},clickAdvanced(){this.show=!this.show},async getData(){}},mounted(){}},wOt={class:"text-diferent"},kOt={key:0,class:"btnAdvance",src:xU},SOt={key:1,class:"btnAdvanceHide",src:xU},TOt={class:"menu-advanced-container"},COt={class:"container-buttons-menu"},EOt={key:1,class:"position-only"},AOt={class:"buttons-menu-select-data"},MOt={key:0,class:"ref-trend-ball-player-container"},IOt={class:"ref-trend-ball-player"},POt={class:"ref-trend-ball-player-label"},BOt={key:1,class:"ref-trend-ball-player-container-route"},LOt={class:"ref-trend-teams-rival-container-table"},zOt={class:"ref-trend-teams-rival-container-row1"},OOt={class:"ref-trend-teams-rival-container-row2"},FOt={class:"ref-trend-teams-rival-container-table"};function NOt(e,o,s,O,W,b){const g=t.resolveComponent("GSCCheckbox"),a=t.resolveComponent("GSCTrendMenuBall"),y=t.resolveComponent("GSCTrendPosition"),h=t.resolveComponent("CardField");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(s.widthContainer<=768?"gsc-trend-movil":"gsc-trend-plays")},[t.createElementVNode("div",{class:t.normalizeClass(b.trendtitlecontainer)},[t.createElementVNode("div",{class:t.normalizeClass(b.trendtitle)},[o[5]||(o[5]=t.createTextVNode(" Tendencia General ",-1)),t.createElementVNode("span",wOt,"("+t.toDisplayString(s.inFavor?"A favor":"En contra")+")",1)],2),t.createElementVNode("div",{class:t.normalizeClass(b.trendcontentcontrols)},[t.createElementVNode("div",{class:t.normalizeClass(b.trendcontentcontrolsleyend)},[s.widthContainer>1e3||s.widthContainer<=768?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Elige que quieres ver: ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[o[6]||(o[6]=t.createTextVNode("Elige que ",-1)),o[7]||(o[7]=t.createElementVNode("br",null,null,-1)),o[8]||(o[8]=t.createTextVNode("quieres ver:",-1))],64))],2),t.createElementVNode("div",{class:t.normalizeClass(b.trendcontentcontrolsleyendcheckscontent)},[t.createElementVNode("div",{class:t.normalizeClass(b.trendcontentcontrolscontainer)},[t.createVNode(g,{label:"¿A dónde fue el balón?",fontFamily:"Poppins-Regular",labelFontSize:s.widthContainer>=870?"13px":"12px","label-color":"#FFF","model-value":W.checkedBallGo,"onUpdate:modelValue":o[0]||(o[0]=n=>b.checkBallGo())},null,8,["labelFontSize","model-value"])],2),t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(b.trendcontentcontrolscontainer)},[t.createVNode(g,{label:s.tournamentSelected.is_female==1?"Jugadoras ofensivas":"Jugadores ofensivos",fontFamily:"Poppins-Regular",labelFontSize:s.widthContainer>=870?"13px":"12px","label-color":"#FFF",boxBackgroundColor:"#15a9e0","model-value":W.checkedHeatMap,"onUpdate:modelValue":o[1]||(o[1]=n=>b.checkHeatMap())},null,8,["label","labelFontSize","model-value"])],2),[[t.vShow,s.isTacticVisible]])],2)],2)],2),t.createElementVNode("div",{class:t.normalizeClass(b.contDataClass)},[t.createElementVNode("div",{class:t.normalizeClass(b.contCollectorsClass)},[t.createElementVNode("div",{class:t.normalizeClass(s.widthContainer<=768?"button-avanced-movil":"button-avanced"),onClick:o[2]||(o[2]=(...n)=>b.clickAdvanced&&b.clickAdvanced(...n))},[W.show?(t.openBlock(),t.createElementBlock("img",kOt)):t.createCommentVNode("",!0),o[9]||(o[9]=t.createTextVNode("Avanzado",-1)),W.show?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("img",SOt))],2),t.withDirectives(t.createElementVNode("div",TOt,[t.createElementVNode("div",COt,[s.isTacticVisible?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",{class:t.normalizeClass(["buttons-menu",W.type=="ball"?"active":""]),onClick:o[3]||(o[3]=n=>b.clickTypeButton("ball"))}," A dónde fue el balón ",2),t.createElementVNode("div",{class:t.normalizeClass(["buttons-menu",W.type=="position"?"active":""]),onClick:o[4]||(o[4]=n=>b.clickTypeButton("position"))}," Posicionamiento ",2)],64)):(t.openBlock(),t.createElementBlock("div",EOt,"Posicionamiento"))]),t.createElementVNode("div",AOt,[t.withDirectives(t.createVNode(a,{"Ball-on-off":W.BallOnOff,onChangeBallOnOff:b.changeBallOnOff,onTouchesnum:b.changeTouchesnum},null,8,["Ball-on-off","onChangeBallOnOff","onTouchesnum"]),[[t.vShow,W.type=="ball"]]),t.withDirectives(t.createVNode(y,{onSelectcheckplayer:b.selectcheckplayer,onSelectcheckplayerall:b.selectcheckplayerall,data:W.arrayPlayers,onShowfield:b.getArrayZonesField,onTypepositioning:b.getTypePositioning,"width-container":s.widthContainer,onTimepositioning:b.getTimePositioning,onTimepositioningend:b.getTimePositioningEnd},null,8,["onSelectcheckplayer","onSelectcheckplayerall","data","onShowfield","onTypepositioning","width-container","onTimepositioning","onTimepositioningend"]),[[t.vShow,s.isTacticVisible&&W.type==="position"]])])],512),[[t.vShow,W.show]])],2),t.createElementVNode("div",{class:t.normalizeClass(b.contWhoCnnectedClass)},[t.createVNode(h,{"width-container":s.widthContainer,selected_team:s.team,"show-ball-position":W.checkedBallGo,"show-players-position":W.checkedHeatMap,selected_category:s.selected_category,"show-tracks":W.BallOnOff=="ON",touches:W.numberTouches,"operation-start":W.timepositioning>0?1:0,"second-start":Math.abs(W.timepositioning),"second-end":W.timepositioningend>0?1:0,"operation-end":Math.abs(W.timepositioningend),onChangelateralidad:b.changelateralidad,"show-players-end-position":W.typepositioning=="Recorrido","in-favor":s.inFavor,"data-paint-info":{data:s.touchAllData,field_positions:W.filterFieldPositions,home_atk_direction:1}},null,8,["width-container","selected_team","show-ball-position","show-players-position","selected_category","show-tracks","touches","operation-start","second-start","second-end","operation-end","onChangelateralidad","show-players-end-position","in-favor","data-paint-info"])],2)],2),t.createElementVNode("div",{class:t.normalizeClass(b.contDataClass2)},[t.createElementVNode("div",{class:t.normalizeClass(b.contCollectorsClass2)},[W.typepositioning==="Posición"?(t.openBlock(),t.createElementBlock("div",MOt,[o[11]||(o[11]=t.createElementVNode("div",{class:"ref-trend-ball-ball"},[t.createElementVNode("div",{class:"ref-trend-ball-ball-point"}),t.createElementVNode("div",{class:"ref-trend-ball-ball-label"},"BALÓN")],-1)),t.createElementVNode("div",IOt,[o[10]||(o[10]=t.createElementVNode("div",{class:"ref-trend-ball-playe-point"},null,-1)),t.createElementVNode("div",POt,[s.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("JUGADORAS OFENSIVAS")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("JUGADORES OFENSIVOS")],64))])])])):(t.openBlock(),t.createElementBlock("div",BOt,o[12]||(o[12]=[t.createStaticVNode('<div class="ref-trend-ball-ball" data-v-8bab9b8d><div class="ref-trend-ball-ball-point" data-v-8bab9b8d></div><div class="ref-trend-ball-ball-label" data-v-8bab9b8d>BALÓN</div></div><div class="ref-trend-ball-player-route" data-v-8bab9b8d><div class="ref-trend-ball-player-label" data-v-8bab9b8d>RECORRIDOS: </div><div class="ref-trend-ball-playe-point" data-v-8bab9b8d></div><div class="ref-trend-ball-player-label" data-v-8bab9b8d>INICIO </div><div class="ref-trend-ball-playe-point-end" data-v-8bab9b8d></div><div class="ref-trend-ball-player-label" data-v-8bab9b8d>FINAL</div></div>',2)])))],2),W.BallOnOff=="ON"?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(b.contWhoCnnectedClass2),style:t.normalizeStyle(W.numberTouches>1?"margin-left: 0%; display: flex; justify-content: center;":"")},[W.numberTouches>1?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(b.reftrendteamsTouches)},[t.createElementVNode("div",{class:"ref-trend-teams-rival-label-title",style:t.normalizeStyle(s.widthContainer<=768?"justify-content: center !important;":"")}," COORDENADAS: ",4),t.createElementVNode("div",LOt,[t.createElementVNode("div",zOt,[o[13]||(o[13]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/circle-my-team.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(b.refpointlebeltext),style:{"font-size":"9px"}},[s.forGame?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(b.firstTeam),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(s.teamsData[s.team].acronym),1)],64))],2)]),t.createElementVNode("div",OOt,[o[14]||(o[14]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(/circle-other-team.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(b.refpointlebeltext),style:{"font-size":"9px"}},[s.forGame?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(b.secondTeam),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Rival")],64))],2)])])],2)):(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(b.reftrendteamsall)},[t.createElementVNode("div",{class:t.normalizeClass(b.reftrendteamslocal)},[t.createElementVNode("div",{class:"ref-trend-teams-local-label-title",style:t.normalizeStyle(s.widthContainer<=768?"justify-content: center !important;":"")},[s.forGame?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(b.firstTeam1Touch),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(s.inFavor?s.teamsData[s.team].acronym:"Rival"),1)],64))],4),t.createElementVNode("div",{class:t.normalizeClass(s.widthContainer<=980?"ref-trend-teams-local-container-table-movil":"ref-trend-teams-local-container-table")},[t.createElementVNode("div",{class:"ref-trend-teams-local-container-row1",style:t.normalizeStyle(s.widthContainer<=980?"display: inline-block !important;":"")},[o[16]||(o[16]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/rematado-gol.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(b.refpointlebeltext)},o[15]||(o[15]=[t.createTextVNode("Remata destino ",-1),t.createElementVNode("br",null,null,-1),t.createTextVNode("portería fue gol",-1)]),2)],4),t.createElementVNode("div",{class:"ref-trend-teams-local-container-row2",style:t.normalizeStyle(s.widthContainer<=980?"display: inline-block !important;":"")},[o[18]||(o[18]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/rematado-con-destino.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(b.refpointlebeltext)},o[17]||(o[17]=[t.createTextVNode("Rematado destino ",-1),t.createElementVNode("br",null,null,-1),t.createTextVNode("a portería no fue gol",-1)]),2)],4),t.createElementVNode("div",{class:"ref-trend-teams-local-container-row3",style:t.normalizeStyle(s.widthContainer<=980?"display: inline-block !important;":"")},[o[20]||(o[20]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/rematado-sin-destino.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(b.refpointlebeltext)},o[19]||(o[19]=[t.createTextVNode("Rematado sin ",-1),t.createElementVNode("br",null,null,-1),t.createTextVNode("destino a portería",-1)]),2)],4),t.createElementVNode("div",{class:"ref-trend-teams-local-container-row4",style:t.normalizeStyle(s.widthContainer<=980?"display: inline-block !important;":"")},[o[22]||(o[22]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/raso.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(b.refpointlebeltext)},o[21]||(o[21]=[t.createTextVNode("Raso al área/",-1),t.createElementVNode("br",null,null,-1),t.createTextVNode("En corto",-1)]),2)],4),t.createElementVNode("div",{class:"ref-trend-teams-local-container-row5",style:t.normalizeStyle(s.widthContainer<=980?"display: inline-block !important;":"")},[o[23]||(o[23]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/sin-destino.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(b.refpointlebeltext)},"Sin destino",2)],4)],2)],2),t.createElementVNode("div",{class:t.normalizeClass(b.reftrendteamsrival)},[t.createElementVNode("div",{class:"ref-trend-teams-rival-label-title",style:t.normalizeStyle(s.widthContainer<=768?"justify-content: center;":"")},[s.forGame?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(b.secondTeam1Touch),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(s.inFavor?"Rival":s.teamsData[s.team].acronym),1)],64))],4),t.createElementVNode("div",FOt,[t.createElementVNode("div",{class:"ref-trend-teams-rival-container-row1",style:t.normalizeStyle(s.widthContainer<=980&&s.widthContainer>=768?"display: inline-block !important;":"")},[o[32]||(o[32]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/ganados-jugador-rival.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(b.refpointlebeltext)},[s.widthContainer<=768?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[s.inFavor?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[o[24]||(o[24]=t.createTextVNode("Ganados ",-1)),s.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Jugadora ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Jugador ")],64)),o[25]||(o[25]=t.createTextVNode("rival",-1))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Ganados por defensivo")],64))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[s.inFavor?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[o[29]||(o[29]=t.createTextVNode("Ganados ",-1)),o[30]||(o[30]=t.createElementVNode("br",null,null,-1)),s.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Jugadora ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Jugador ")],64)),o[31]||(o[31]=t.createTextVNode(" rival",-1))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[o[26]||(o[26]=t.createTextVNode("Ganados por",-1)),o[27]||(o[27]=t.createElementVNode("br",null,null,-1)),o[28]||(o[28]=t.createTextVNode("defensivo",-1))],64))],64))],2)],4),t.createElementVNode("div",{class:"ref-trend-teams-rival-container-row2",style:t.normalizeStyle(s.widthContainer<=980&&s.widthContainer>=768?"display: inline-block !important;":"")},[o[42]||(o[42]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/ganados-portero.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(b.refpointlebeltext)},[s.widthContainer<=768?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[s.inFavor?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[o[34]||(o[34]=t.createTextVNode("Ganados ",-1)),s.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Portera ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Portero ")],64)),o[35]||(o[35]=t.createTextVNode("rival",-1))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[o[33]||(o[33]=t.createTextVNode("Ganados por ",-1)),s.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("portera")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("portero")],64))],64))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[s.inFavor?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[o[39]||(o[39]=t.createTextVNode("Ganados ",-1)),o[40]||(o[40]=t.createElementVNode("br",null,null,-1)),s.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Portera ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Portero ")],64)),o[41]||(o[41]=t.createTextVNode("rival",-1))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[o[36]||(o[36]=t.createTextVNode("Ganados por",-1)),o[37]||(o[37]=t.createElementVNode("br",null,null,-1)),o[38]||(o[38]=t.createTextVNode("portero",-1))],64))],64))],2)],4)])],2)],2))],6)):t.createCommentVNode("",!0)],2)],2)}const DOt=cu(xOt,[["render",NOt],["__scopeId","data-v-8bab9b8d"]]),dT={components:{GSCConnectionsSetPiece:Txt,GSCHeaderSetPiece:DAt,GSCDataToHighlight:TMt,GSCModalBreakdown:xIt,GSCSpecificPlays:xLt,GSCTrend:DOt},props:{game:{type:Object,required:!0},forSeason:{type:Boolean,default:!1},forTeam:{type:Boolean,default:!1},tournamentSelected:{type:Object,default:()=>({})},forGame:{type:Boolean,default:!1},team:{type:Number,default:0},isTacticVisible:{type:Boolean,default:!0},isSynchronization:{type:Boolean,default:!1},seasonSelected:{type:Object,default:()=>({})},canPlayVideos:{type:Boolean,default:!0},clientPrivilegesBySeasons:{type:Object,default:()=>null},videoPrivilegesPlayingAs:{type:Set,default:()=>new Set([1,2])}},data(){return{lastGamesBySeasonUrl:"",inFavorResponses:null,againstResponses:null,homeTeamResponses:null,awayTeamResponses:null,isSpecificPlaysVisible:!1,token:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE",touchAllDataHome:[],touchAllDataAway:[],regularflag:null,filters:{isMoment:!1,final:[1,2,3],moment:[1,2,3],playingAs:[1,2],sections:[1,2,3,4,5,6],games:[],players:[],cornertype:31,howWas:[120,126,327,133],zona:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],whathappened:[583,585,587,589,584,586,588,590,122,128,136,142,123,129,137,143,124,130,138,144,125,131,139,14,146,147,327,133],isWhatHappenedFull:!0,isZoneFull:!0},containerWidth:0,openModal:!1,playersData:{},teamsData:{},teamCorners:{corners:0,cornersAgainst:0},gamesAllHome:[],gamesAllAway:[],teamSelected:0,touchDataSelected:[],auxChangeFilterPlayer:!0,auxChangeFilterGames:!0,positionsDataSelected:[],copyLastFilters:{},seasonId:0,totalDataCollection:{},seasonsByGame:{},matchesByGame:{},rivalsByGame:{},updateConnections:0,showCorners:0,filterPlayersAvailable:[],filterGamesAvailable:[],updateTrend:0,lateralidad:"left",updateFilter:0,copyplayers:[],infavoragainst:!0,typePlay:"A favor",modalInitialData:{},areFiltersOpen:!1,heightFilters:"123px",isLoading:!1,adjustedPlays:new Set}},watch:{isLoading(e){this.isSpecificPlaysVisible=!e},game:{immediate:!0,handler(e){this.getDataCorners(e),this.createStorageGame()}},teamSelected:{immediate:!0,handler(){this.fillFilterGamesReset(),this.fillFilterPlayersReset(),this.updateConnections+=1}},infavoragainst:{immediate:!0,handler(){this.fillFilterGamesReset(),this.fillFilterPlayersReset(),this.updateConnections+=1}},calculationTouchesData:{immediate:!0,handler(){this.showCorners=this.calculationTouchesData.filter(e=>e[19]==0).length}}},computed:{isGameOnly(){return this.forGame&&!this.forSeason&&!this.forTeam},calculateTotal(){return this.touchDataSelected.filter(e=>e[19]==0).length},calculationPositionsData(){return this.positionsDataSelected},calculationTouchesData(){let e=[],o=[];if(this.touchDataSelected.length>0){this.updateCopyfilter(),this.filters.isMoment?o=this.touchDataSelected.filter(O=>this.filters.moment.includes(O[17])&&this.filters.playingAs.includes(O[14])&&this.filters.sections.includes(O[20])&&O[19]==0):o=this.touchDataSelected.filter(O=>this.filters.final.includes(O[16])&&this.filters.playingAs.includes(O[14])&&this.filters.sections.includes(O[20])&&O[19]==0),this.updateGamesListFilter({corners:o}),this.filters.games.length>0&&(o=o.filter(O=>this.filters.games.includes(O[3]))),this.infavoragainst&&(this.updatePlayerListFilter({corners:o,players:this.filters.players}),this.filters.players.length>0&&(o=o.filter(O=>this.filters.players.includes(O[1])))),o=o.filter(O=>this.filters.cornertype==O[4]),this.filters.zona.length!=35&&(o=o.filter(O=>this.filters.zona.includes(O[12]))),o=o.filter(O=>O[5].split(",").map(W=>parseInt(W)).some(W=>this.filters.howWas.includes(W))),this.filters.whathappened.length!=24&&(o=o.filter(O=>O[5].split(",").map(W=>parseInt(W)).some(W=>this.filters.whathappened.includes(W))));const s=o.map(O=>O[18]);if(e=this.touchDataSelected.filter(O=>s.includes(O[18])),e.length>0){let O=null,W=null,b=new Set;e.forEach(g=>{g[19]===0?(O=g[18],W=g):(g[18]===O&&W&&!b.has(g[18])&&(g[6]=1-W[10],g[7]=1-W[11],b.add(g[18])),W=g)}),e.forEach(g=>{const a=g[5].split(",").map(n=>n.trim()),y=["125","139","131","145"],h=g[0];a.some(n=>y.includes(n))&&!this.adjustedPlays.has(h)&&this.adjustedPlays.add(h)})}}return e},cornersInFavor(){return"-"},cornersAgainst(){return"-"},isMovil(){return this.containerWidth<=768}},methods:{setHeaderStickyListener(){const e=this.$refs.header.getBoundingClientRect().top-1+(window.scrollY||window.pageYOffset);window.onscroll=()=>{(window.scrollY||window.pageYOffset)>e?(this.$refs.header.classList.add("sticky"),this.areFiltersOpen?this.heightFilters="282px":this.isMovil?this.forTeam?this.heightFilters="170px":this.heightFilters="222px":this.heightFilters="123px"):this.$refs.header.classList.remove("sticky")}},setCornersSide(e){this.lateralidad=e},onChangeShowFilters(e){this.areFiltersOpen=e},fillFilterPlayersReset(){setTimeout(()=>{if(this.infavoragainst){const e=this.forGame?this.infavoragainst?this.teamSelected:this.teamSelected==this.game.home_team?this.game.away_team:this.game.home_team:this.teamSelected,o=this.touchDataSelected.filter(O=>O[19]==0&&e).map(O=>O[1]),s=[...new Set(o)];this.getFilterTakenCorners({players:s})}},100)},fillFilterGamesReset(){setTimeout(()=>{const e=this.touchDataSelected.filter(s=>s[19]==0).map(s=>s[3]),o=[...new Set(e)];this.getFilterGames({games:o})},100)},updateCopyfilter(){this.copyLastFilters=this.filters},fillGameDataTeam(e){return{teamsIds:[e.home_team,e.visiting_team],label:`${e.matchday_abbreviation.replace("M","J")} ${this.teamsData[this.game.home_team].acronym} vs ${this.game.home_team==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym}`,id:e.game_id,isSelected:!0,dateTimeMillis:Date.parse(e.date_time_utc),rivalTeam:{logo:this.game.home_team==e.home_team?this.teamsData[e.visiting_team].img:this.teamsData[e.home_team].img,team_id:this.game.home_team==e.home_team?e.visiting_team:e.home_team,provisional_logo:this.game.home_team==e.home_team?this.teamsData[e.visiting_team].img:this.teamsData[e.home_team].img,colloquial_name:this.game.home_team==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym,acronym:this.game.home_team==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym,team_name:this.game.home_team==e.home_team?this.teamsData[e.visiting_team].name:this.teamsData[e.home_team].name},roundAbbreviation:e.matchday_abbreviation.replace("M","J")}},fillGameData(e){return{teamsIds:[e.home_team,e.visiting_team],label:`${e.matchday_abbreviation.replace("M","J")} ${this.teamsData[this.teamSelected].acronym} vs ${this.teamSelected==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym}`,id:e.game_id,isSelected:!0,dateTimeMillis:Date.parse(e.date_time_utc),rivalTeam:{logo:this.teamSelected==e.home_team?this.teamsData[e.visiting_team].img:this.teamsData[e.home_team].img,team_id:this.teamSelected==e.home_team?e.visiting_team:e.home_team,provisional_logo:this.teamSelected==e.home_team?this.teamsData[e.visiting_team].img:this.teamsData[e.home_team].img,colloquial_name:this.teamSelected==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym,acronym:this.teamSelected==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym,team_name:this.teamSelected==e.home_team?this.teamsData[e.visiting_team].name:this.teamsData[e.home_team].name},roundAbbreviation:e.matchday_abbreviation.replace("M","J")}},updatePlayerListFilter(e){if(this.infavoragainst){let o={},s=[];for(let O=0;O<e.corners.length;O++){const W=e.corners[O];if(W[19]===0&&W[2]===this.teamSelected){const b=W[1],g=this.playersData[b];b in o||(o[b]=g,s.push(g))}}if(this.filterPlayersAvailable=s,e.players.length>0&&this.filterPlayersAvailable.length>0)for(let O=0;O<this.filterPlayersAvailable.length;O++)e.players.includes(this.filterPlayersAvailable[O].id)?this.filterPlayersAvailable[O].isSelected=!0:this.filterPlayersAvailable[O].isSelected=!1}},updateGamesListFilter(e){if(!this.forGame){this.filterGamesAvailable=[];const o=this.obtenerIDsGames(e.corners);this.forSeason?this.teamSelected==this.game.home_team?this.filterGamesAvailable=o.map(s=>{let O=this.gamesAllHome.find(W=>W.game_id===s);if(O)return this.fillGameData(O)}):this.filterGamesAvailable=o.map(s=>{let O=this.gamesAllAway.find(W=>W.game_id===s);if(O)return this.fillGameData(O)}):this.filterGamesAvailable=o.map(s=>{let O=this.gamesAllHome.find(W=>W.game_id===s);if(O)return this.fillGameDataTeam(O)})}if(this.filters.games.length>0&&this.filterGamesAvailable.length>0)for(let o=0;o<this.filterGamesAvailable.length;o++)this.filters.games.includes(this.filterGamesAvailable[o].id)?this.filterGamesAvailable[o].isSelected=!0:this.filterGamesAvailable[o].isSelected=!1},getResetPlayers(){for(let e in this.playersData)this.playersData[e].isSelected=!0},getFilterZone(e){this.filters.zona=e,this.filters.isZoneFull=e.length===35},getFilterHowWasCorner(e){e.cornertype==31&&(this.lateralidad="left"),e.cornertype==32&&(this.lateralidad="right"),this.filters.cornertype=e.cornertype,this.filters.howWas=e.howWas},getFilterTakenCorners(e){this.arraysAreEqual(this.filters.players,e.players)||(this.filters.players=e.players)},arraysAreEqual(e,o){if(e.length!==o.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!==o[s])return!1;return!0},getFilterGames(e){this.areGamesIdsArraysContentEqual(this.filters.games,e.games)||(this.filters.games=e.games,this.fillFilterPlayersReset())},areGamesIdsArraysContentEqual(e,o){return e.length===o.length&&e.every((s,O)=>s===o[O])},getFilterDetails(e){this.filters.playingAs=e.playingAs,this.filters.sections=e.sections,this.fillFilterGamesReset(),this.fillFilterPlayersReset()},getFilterResultsByTime(e){this.filters.final=e.final,this.filters.isMoment=e.isMoment,this.filters.moment=e.moment,this.fillFilterGamesReset(),this.fillFilterPlayersReset()},getFilterWhatHappened(e){this.filters.whathappened=e,this.filters.isWhatHappenedFull=e.length===24},obtenerIDsGames(e){return[...new Set(e.map(o=>o[3]))]},async getInFavorAgainstTeam(e){this.updateTrend+=1,this.infavoragainst=e,this.validateDataLocalStorage({team:this.teamSelected,inFavor:this.infavoragainst,game:this.game})&&(this.teamSelected==this.game.home_team?await this.requestOrchestrator({games:this.gamesAllHome,team:this.teamSelected,inFavor:this.infavoragainst,game:this.game}):await this.requestOrchestrator({games:this.gamesAllAway,team:this.teamSelected,inFavor:this.infavoragainst,game:this.game}))},async getTeamSelected(e){this.teamSelected!=e&&(this.updateConnections+=1,this.updateTrend+=1,this.teamSelected=e,this.touchDataSelected=[],this.gamesAllHome.length!=0&&this.gamesAllAway.length!=0&&(this.teamSelected==this.game.home_team?this.validateDataLocalStorage({team:this.teamSelected,inFavor:this.infavoragainst,game:this.game})&&await this.requestOrchestrator({games:this.gamesAllHome,team:this.teamSelected,inFavor:this.infavoragainst,game:this.game}):this.validateDataLocalStorage({team:this.teamSelected,inFavor:this.infavoragainst,game:this.game})&&await this.requestOrchestrator({games:this.gamesAllAway,team:this.teamSelected,inFavor:this.infavoragainst,game:this.game})))},async fetchDataTeam(e,o){document.body.classList.add("no-scroll");try{return(await o.get(e)).data}catch(s){throw console.error("Error al obtener datos:",s),s}},async requestOrchestrator(e){let o=!1;this.forGame&&(o=this.teamSelected===this.game.home_team);let s=[],O=[];const W=du.create({headers:{Authorization:`${this.token}`}});if(this.forGame&&(o||!o)||!this.forGame&&(e.inFavor&&!this.inFavorResponses||!e.inFavor&&!this.againstResponses)){for(let a=0;a<e.games.length;a++)this.seasonId=e.games[a].season_id,s.push(e.inFavor?"https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/"+e.games[a].season_id+"/corners/trends/teams/"+e.team+"/"+e.games[a].game_id:"https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/"+e.games[a].season_id+"/corners/trends/teams/"+e.team+"/"+e.games[a].game_id+"?isR=1");O=s.map(a=>this.fetchDataTeam(a,W))}let b=[],g=[];try{this.isLoading=!0;const a=this.forGame?o?await Promise.all(O):await Promise.all(O):this.inFavor?this.inFavorResponses||await Promise.all(O):this.againstResponses||await Promise.all(O);this.forGame?o?this.homeTeamResponses||(this.homeTeamResponses=a):this.awayTeamResponses||(this.awayTeamResponses=a):e.inFavor?this.inFavorResponses||(this.inFavorResponses=a):this.againstResponses||(this.againstResponses=a);for(let y=0;y<a.length;y++)a[y].data=this.changeLateralityCoordenatesPlays(a[y].data,!1),a[y].field_positions=this.changeLateralityCoordenatesPlays(a[y].field_positions,!0),b=b.concat(a[y].data),g=g.concat(a[y].field_positions),this.getDataPlayers(a[y].players),this.getDataPlayers(a[y].rival_players),this.getDataTeams(a[y].teams),this.getSeasonByGame({season:a[y]&&a[y].hasOwnProperty("season_name")?a[y].season_name:"",game:a[y].data[0]?a[y].data[0][3]:0}),this.getMatchByGame({match:a[y]&&a[y].hasOwnProperty("matchday_abbreviation")?a[y].matchday_abbreviation:"",game:a[y].data[0]?a[y].data[0][3]:0}),this.getRivalsByGame({rival:this.infavoragainst?this.teamSelected==a[y].teams[0].team_id?a[y].teams[1].name:a[y].teams[0].name:this.teamSelected==a[y].teams[0].team_id?a[y].teams[0].name:a[y].teams[1].name,game:a[y].data[0]?a[y].data[0][3]:0,team:this.teamSelected,favor:this.infavoragainst});this.touchDataSelected=b,this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].touch=b,this.positionsDataSelected=g,this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].positions=g}catch(a){console.error("Error al obtener datos:",a)}finally{this.isLoading=!1,document.body.classList.remove("no-scroll")}},getRowMatrix(e,o){let s=.01351,O=.02439,W=0,b=0,g=[];const a=o.length;let y=Math.floor(a/10);for(;W<74;)b=o.filter(h=>h[0]>=W*s&&h[0]<=(W+1)*s&&h[1]>=e*O&&h[1]<=(e+1)*O).map(h=>h[1]).length,y=y===0?1:y,g.push(parseFloat((b/y).toFixed(4))),W++;return g.reverse()},getEmptyArray(e){return Array.from({length:e},()=>0)},getMatrix(e){let o=[this.getEmptyArray(74),this.getEmptyArray(74)],s=[],O=39;for(;O>0&&O<=39;)s=this.getRowMatrix(O,e),o.push(s),O--;return o.push(this.getEmptyArray(74),this.getEmptyArray(74)),o},getSoftData(e,o,s){const O=[];let W=0,b=0;O.push(e[0]);for(let g=1;g<s-1;g++){const a=[];a.push(e[g][0]);for(let y=1;y<o-1;y++)W=e[g][y-1],b=e[g][y+1],a.push(W+.5*(e[g][y]+b-W));a.push(e[g][o-1]),O.push(a)}O.push(e[s-1]);for(let g=1;g<o-1;g++)for(let a=1;a<s-1;a++)W=O[a-1][g],b=O[a+1][g],O[a][g]=W+.5*(O[a][g]+b-W);return O},changeLateralityCoordenatesPlays(e,o){return o?e.forEach((s,O)=>{let W=0,b=0;this.infavoragainst?(W=s[2]===this.teamSelected?1-s[3]:s[3],b=s[2]===this.teamSelected?1-s[4]:s[4]):(W=s[2]===this.teamSelected?s[3]:1-s[3],b=s[2]===this.teamSelected?s[4]:1-s[4]),e[O][3]=W,e[O][4]=b}):e.forEach((s,O)=>{let W=0,b=0,g=0,a=0,y=0,h=0;s[19]!=0?this.infavoragainst?(W=s[2]===this.teamSelected?s[6]:1-s[6],b=s[2]===this.teamSelected?1-s[7]:s[7],g=s[2]===this.teamSelected?s[8]:1-s[8],a=s[2]===this.teamSelected?1-s[9]:s[9],y=s[2]===this.teamSelected?s[10]:1-s[10],h=s[2]===this.teamSelected?1-s[11]:s[11]):(W=s[2]===this.teamSelected?1-s[6]:s[6],b=s[2]===this.teamSelected?s[7]:1-s[7],g=s[2]===this.teamSelected?1-s[8]:s[8],a=s[2]===this.teamSelected?1-s[9]:s[9],y=s[2]===this.teamSelected?1-s[10]:s[10],h=s[2]===this.teamSelected?1-s[11]:s[11]):(W=1-s[6],b=s[7],g=1-s[8],a=s[9],y=1-s[10],h=s[11]),e[O][6]=W,e[O][7]=b,e[O][8]=g,e[O][9]=a,e[O][10]=y,e[O][11]=h}),e},changeLateralityPlays(e){e.field_positions=e.field_positions.map(s=>[...s.slice(0,3),s[4],s[3],...s.slice(5)]);let o=[];return e.data.forEach(s=>{s[19]===0&&o.push([s[0],s[13],s[14],s[15]])}),o.forEach(s=>{e.field_positions.filter(O=>s[0]===O[7]&&this.teamSelected===O[2]).forEach(O=>{let W=O[3],b=O[4];(e.homeTeamAtkDirection===1&&s[3]===1||e.homeTeamAtkDirection===2&&s[3]===2||e.homeTeamAtkDirection===1&&s[3]===3||e.homeTeamAtkDirection===2&&s[3]===4)&&(W=1-W,b=1-b),O[3]=W,O[4]=b})}),e.field_positions},createStorageGame(){this.totalDataCollection[this.game.id]={},this.totalDataCollection[this.game.id][this.game.home_team]={},this.totalDataCollection[this.game.id][this.game.home_team].InFavor={},this.totalDataCollection[this.game.id][this.game.home_team].InFavor.touch=[],this.totalDataCollection[this.game.id][this.game.home_team].InFavor.positions=[],this.totalDataCollection[this.game.id][this.game.home_team].Against={},this.totalDataCollection[this.game.id][this.game.home_team].Against.touch=[],this.totalDataCollection[this.game.id][this.game.home_team].Against.positions=[],(this.forGame||this.forSeason)&&(this.totalDataCollection[this.game.id][this.game.away_team]={},this.totalDataCollection[this.game.id][this.game.away_team].InFavor={},this.totalDataCollection[this.game.id][this.game.away_team].InFavor.touch=[],this.totalDataCollection[this.game.id][this.game.away_team].InFavor.positions=[],this.totalDataCollection[this.game.id][this.game.away_team].Against={},this.totalDataCollection[this.game.id][this.game.away_team].Against.touch=[],this.totalDataCollection[this.game.id][this.game.away_team].Against.positions=[])},validateDataLocalStorage(e){return this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].touch.length>0&&this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].positions.length>0?(this.touchDataSelected=this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].touch,this.positionsDataSelected=this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].positions,!1):!0},getGamesByTeam(e){this.forSeason?e.type=="home"?this.gamesAllHome=e.games.filter(function(o){return(o.home_team==e.idTeam||o.visiting_team==e.idTeam)&&o.game_status==1}):this.gamesAllAway=e.games.filter(function(o){return(o.home_team==e.idTeam||o.visiting_team==e.idTeam)&&o.game_status==1}):this.forGame?e.type=="home"?this.gamesAllHome=e.games.filter(function(o){return o.game_id==e.game.id}):this.gamesAllAway=e.games.filter(function(o){return o.game_id==e.game.id}):this.gamesAllHome=e.games.filter(function(o){return(o.home_team==e.idTeam||o.visiting_team==e.idTeam)&&o.game_status==1})},async getDataCorners(e){const o=du.create({headers:{Authorization:`${this.token}`}}),s="https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?seasons="+e.season;if(this.lastGamesBySeasonUrl===s)return;this.lastGamesBySeasonUrl=s;let O=await o.get(s);O.data.data[0].games.filter(W=>W.game_status===1).length===0?(this.regularflag=!0,O=await o.get("https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?seasons="+this.game.regularSeasonId)):this.regularflag=!1,this.forSeason?(this.getGamesByTeam({games:O.data.data[0].games,idTeam:e.home_team,type:"home"}),this.getGamesByTeam({games:O.data.data[0].games,idTeam:e.away_team,type:"away"}),this.validateDataLocalStorage({team:this.game.home_team,inFavor:!0,game:this.game})&&await this.requestOrchestrator({games:this.gamesAllHome,team:this.game.home_team,inFavor:!0,game:this.game})):this.forGame?(this.getGamesByTeam({games:O.data.data[0].games,idTeam:e.home_team,game:this.game,type:"home"}),this.getGamesByTeam({games:O.data.data[0].games,idTeam:e.away_team,game:this.game,type:"away"}),this.validateDataLocalStorage({team:this.game.home_team,inFavor:!0,game:this.game})&&await this.requestOrchestrator({games:this.gamesAllHome,team:this.game.home_team,inFavor:!0,game:this.game})):(this.getGamesByTeam({games:O.data.data[0].games,idTeam:e.home_team,type:"home"}),this.validateDataLocalStorage({team:e.home_team,inFavor:!0,game:this.game})&&await this.requestOrchestrator({games:this.gamesAllHome,team:this.game.home_team,inFavor:!0,game:this.game}))},obtenerNombreAbreviado(e){let o=e.split(", ");if(o.length!==2)return e;let s=o[0],O=o[1],W=s.split(" ")[0];return O.charAt(0).toUpperCase()+". "+W},getDataPlayers(e){for(let o=0;o<e.length;o++)this.playersData.hasOwnProperty(e[o].player_id)||(this.playersData[e[o].player_id]={name:this.obtenerNombreAbreviado(e[o].name),last_name:e[o].name.includes(",")?e[o].name.split(",")[0].trim():"",first_name:e[o].name.includes(",")?e[o].name.split(",")[1].trim():"",img:e[o].photo,photo:e[o].photo,position:e[o].position_id,positions:[e[o].position_id],id:e[o].player_id,player_id:e[o].player_id,team_id:e[o].team_id,team:e[o].team_id,nationality_id:e[o].nationality_id,nationality_flag:"https://golstatsimages.blob.core.windows.net/flags/"+e[o].nationality_id+".jpg",jersey:e[o].jersey,isSelected:!0})},getSeasonByGame(e){e.season!=""?this.seasonsByGame[e.game]=e.season:this.seasonsByGame[e.game]="-"},getMatchByGame(e){e.match!=""?this.matchesByGame[e.game]=e.match.replace("M","J"):this.matchesByGame[e.game]="-"},getRivalsByGame(e){this.rivalsByGame[e.favor?"InFavor":"Against"]?this.rivalsByGame[e.favor?"InFavor":"Against"][e.team]?this.rivalsByGame[e.favor?"InFavor":"Against"][e.team][e.game]=e.rival:(this.rivalsByGame[e.favor?"InFavor":"Against"][e.team]={},this.rivalsByGame[e.favor?"InFavor":"Against"][e.team][e.game]=e.rival):(this.rivalsByGame[e.favor?"InFavor":"Against"]={},this.rivalsByGame[e.favor?"InFavor":"Against"][e.team]={},this.rivalsByGame[e.favor?"InFavor":"Against"][e.team][e.game]=e.rival)},getDataTeams(e){for(let o=0;o<e.length;o++)this.teamsData.hasOwnProperty(e[o].team_id)||(this.teamsData[e[o].team_id]={name:e[o].name,acronym:e[o].acronym,img:"https://golstatsimages.blob.core.windows.net/teams-80/"+e[o].team_id+".png",id:e[o].team_id})},getTypePlay(e){typeof e=="string"&&(this.typePlay=e)},clickOpenModal(){this.openModal=!this.openModal,document.body.classList.add("no-scroll")},clickCloseFinal(){this.openModal=!1,document.body.classList.remove("no-scroll")},onCornersFilled({corners:e,cornersAgainst:o}){this.teamCorners={corners:e,cornersAgainst:o}},onOpenMediaPlayer(e){this.$emit("open-media-player",e)},onOpenMediaPlayerJson(e){let o={seasonId:this.seasonId,mainSectionType:1,playListType:3,categoryIds:[e.id],gameIds:this.forGame?[this.game.id]:null,playerIds:[],goalkeeperIds:[],teamId:this.teamSelected,matchResult:[1,2,3],playData:{},advancedFilter:{playListTitle:""}};this.$emit("open-media-player",o)}},mounted(){this.isLoading=!0,document.body.classList.add("no-scroll"),this.setHeaderStickyListener();const e=()=>{const o=document.querySelector(".gsc-set-piece");o?this.containerWidth=o.clientWidth:setTimeout(()=>{},400)};window.addEventListener("resize",e),this.$nextTick(e)}},wU=()=>{t.useCssVars(e=>({"07fdde92":e.heightFilters}))},kU=dT.setup;dT.setup=kU?(e,o)=>(wU(),kU(e,o)):wU;const ROt={class:"gsc-set-piece"},VOt={key:0,class:"overlay-loading"},jOt={ref:"header",class:"gsc-set-piece__header"};function $Ot(e,o,s,O,W,b){const g=t.resolveComponent("GSCHeaderSetPiece"),a=t.resolveComponent("GSCDataToHighlight"),y=t.resolveComponent("GSCTrend"),h=t.resolveComponent("GSCConnectionsSetPiece"),n=t.resolveComponent("GSCModalBreakdown"),x=t.resolveComponent("GSCSpecificPlays");return t.openBlock(),t.createElementBlock("div",ROt,[W.isLoading?(t.openBlock(),t.createElementBlock("div",VOt,o[0]||(o[0]=[t.createElementVNode("div",{class:"overlay-loading__spinner"},[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/balon_liga.png",alt:""})],-1),t.createElementVNode("div",{class:"overlay-loading__text"},"Loading...",-1)]))):t.createCommentVNode("",!0),t.createElementVNode("div",jOt,[(t.openBlock(),t.createBlock(g,{"width-container":W.containerWidth,type:s.forTeam?0:3,"teams-data":W.teamsData,"tournament-selected":s.tournamentSelected,"game-info":s.game,"total-corners":b.calculateTotal,"show-corners":W.showCorners,"in-favor":W.infavoragainst,"corners-in-favor":W.teamCorners.corners,"corners-against":W.teamCorners.cornersAgainst,"for-game":s.forGame,key:W.updateFilter,lateralidad:W.lateralidad,"available-players":W.filterPlayersAvailable,"available-games":W.filterGamesAvailable,"is-synchronization":s.isSynchronization,onChangeShowFilters:b.onChangeShowFilters,onChangetypePlay:b.getTypePlay,onOpenModal:b.clickOpenModal,onTeamselected:b.getTeamSelected,onInfavoragainstteam:b.getInFavorAgainstTeam,onFilter_results_by_time:b.getFilterResultsByTime,onFilter_details:b.getFilterDetails,onFilter_games:b.getFilterGames,onFilter_takencorners:b.getFilterTakenCorners,onFilter_howwascorner:b.getFilterHowWasCorner,onFilter_zone:b.getFilterZone,onFilter_whathappened:b.getFilterWhatHappened},null,8,["width-container","type","teams-data","tournament-selected","game-info","total-corners","show-corners","in-favor","corners-in-favor","corners-against","for-game","lateralidad","available-players","available-games","is-synchronization","onChangeShowFilters","onChangetypePlay","onOpenModal","onTeamselected","onInfavoragainstteam","onFilter_results_by_time","onFilter_details","onFilter_games","onFilter_takencorners","onFilter_howwascorner","onFilter_zone","onFilter_whathappened"]))],512),!s.isSynchronization&&W.teamSelected>0&&W.regularflag!==null&&!(s.seasonSelected.incomplete_season==1&&s.game.game_status==4)?(t.openBlock(),t.createBlock(a,{key:1,team:W.teamSelected,season:s.game.season,game:s.game,"flag-regular":W.regularflag,"in-favor":W.infavoragainst,"width-container":W.containerWidth},null,8,["team","season","game","flag-regular","in-favor","width-container"])):t.createCommentVNode("",!0),s.isSynchronization?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(y,{"players-data":W.playersData,"teams-data":W.teamsData,"tournament-selected":s.tournamentSelected,"touch-all-data":b.calculationTouchesData,"field-positions-all":b.calculationPositionsData,"width-container":W.containerWidth,"in-favor":W.infavoragainst,"for-game":s.forGame,"home-team":s.game.home_team,"away-team":s.game.away_team,"acronym-home":s.game.home_acronym,"acronym-away":s.game.away_acronym,team:W.teamSelected,"type-play":W.typePlay,selected_category:W.filters.cornertype,"is-tactic-visible":s.isTacticVisible,key:W.updateTrend,onChangelateralidad:b.setCornersSide},null,8,["players-data","teams-data","tournament-selected","touch-all-data","field-positions-all","width-container","in-favor","for-game","home-team","away-team","acronym-home","acronym-away","team","type-play","selected_category","is-tactic-visible","onChangelateralidad"])),!s.isSynchronization&&W.teamSelected>0?(t.openBlock(),t.createBlock(h,{"seasons-by-game":W.seasonsByGame,"matches-by-game":W.matchesByGame,"rivals-by-game":W.rivalsByGame,"width-container":W.containerWidth,selected_category:W.filters.cornertype,"players-data":W.playersData,"tournament-selected":s.tournamentSelected,"teams-data":W.teamsData,onChangelateralidad:b.setCornersSide,"touch-all-data":b.calculationTouchesData,"team-id":s.forGame?W.infavoragainst?W.teamSelected:W.teamSelected==s.game.home_team?s.game.away_team:s.game.home_team:W.teamSelected,"in-favor":W.infavoragainst,"for-game":s.forGame,key:W.updateConnections},null,8,["seasons-by-game","matches-by-game","rivals-by-game","width-container","selected_category","players-data","tournament-selected","teams-data","onChangelateralidad","touch-all-data","team-id","in-favor","for-game"])):t.createCommentVNode("",!0),W.openModal?(t.openBlock(),t.createBlock(n,{key:4,"component-width":W.containerWidth,onClickClose:b.clickCloseFinal,"show-modal-prop":W.openModal,id:W.teamSelected,"season-id":s.game.season,game:s.game.id,onClickPlay:b.onOpenMediaPlayerJson,prematch:!!s.forGame},null,8,["component-width","onClickClose","show-modal-prop","id","season-id","game","onClickPlay","prematch"])):t.createCommentVNode("",!0),W.isSpecificPlaysVisible&&W.teamSelected&&s.game.season?(t.openBlock(),t.createBlock(x,{key:5,"team-id-for-analysis":W.teamSelected,"season-id-for-analysis":s.game?s.game.season:W.seasonId,"width-container":W.containerWidth,filters:W.filters,"is-game-only":b.isGameOnly,"tournament-selected":s.tournamentSelected,selected_category:W.filters.cornertype,game:s.game,"is-against-mode":!W.infavoragainst,"are-filters-open":W.areFiltersOpen,"is-tactic-visible":s.isTacticVisible,"is-synchronization":s.isSynchronization,"can-play-videos":s.canPlayVideos,"video-privileges-playing-as":s.videoPrivilegesPlayingAs,onChangelateralidad:b.setCornersSide,onOpenMediaPlayer:b.onOpenMediaPlayer,onCornersFilled:b.onCornersFilled},null,8,["team-id-for-analysis","season-id-for-analysis","width-container","filters","is-game-only","tournament-selected","selected_category","game","is-against-mode","are-filters-open","is-tactic-visible","is-synchronization","can-play-videos","video-privileges-playing-as","onChangelateralidad","onOpenMediaPlayer","onCornersFilled"])):t.createCommentVNode("",!0)])}const UOt=cu(dT,[["render",$Ot],["__scopeId","data-v-cd6570b5"]]),QJt="",eKt="",GOt={class:"datagame-container"},HOt=Ji({__name:"GSCTacticaFijaMain",props:{game:{type:Object,default:()=>({})},isTacticVisible:{type:Boolean,default:!0},isSynchronization:{type:Boolean,default:!1},seasonSelected:{type:Object,default:()=>({})},tournamentSelected:{type:Object,default:()=>({})},canPlayVideos:{type:Boolean,default:!0},videoPrivilegesPlayingAs:{type:Set,default:()=>new Set([1,2])}},emits:["open-media-player"],setup(e,{emit:o}){function s(O){o("open-media-player",O)}return(O,W)=>(t.openBlock(),t.createElementBlock("div",GOt,[t.createVNode(t.unref(UOt),{game:{id:e.game.gameId,home_team:e.game.homeTeam.team_id,away_team:e.game.awayTeam.team_id,season:e.game.seasonId,regularSeasonId:e.game.regularSeasonId,game_status:e.game.game_status,home_acronym:e.game.homeTeam.acronym,away_acronym:e.game.awayTeam.acronym,logo_home:"https://golstatsimages.blob.core.windows.net/teams-80/"+e.game.homeTeam.team_id+".png",logo_away:"https://golstatsimages.blob.core.windows.net/teams-80/"+e.game.awayTeam.team_id+".png"},seasonSelected:e.seasonSelected,"tournament-selected":e.tournamentSelected,"for-season":e.game.game_status===4,"for-team":!1,"for-game":e.game.game_status!==4,"is-tactic-visible":e.isTacticVisible,"is-synchronization":e.isSynchronization,"can-play-videos":e.canPlayVideos,"video-privileges-playing-as":e.videoPrivilegesPlayingAs,onOpenMediaPlayer:s},null,8,["game","seasonSelected","tournament-selected","for-season","for-game","is-tactic-visible","is-synchronization","can-play-videos","video-privileges-playing-as"])]))}},[["__scopeId","data-v-1d2fe878"]]),l_=(e,o)=>{const s=e.__vccOpts||e;for(const[O,W]of o)s[O]=W;return s},WOt={__name:"ButtonCustom",props:{text:{type:String,default:""},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},padding:{type:String,default:"0px"},borderRadius:{type:String,default:"0px"},borderWidth:{type:String,default:"1px"},borderColor:{type:String,default:"#d9d9d9"},backgroundColor:{type:String,default:"#FFFFFF"},activeBackgroundColor:{type:String,default:""},activeBorderColor:{type:String,default:""},activeBorderWidth:{type:String,default:"1px"},activeFontColor:{type:String,default:""},fontColor:{type:String,default:"#000000"},fontSize:{type:String,default:"16px"},fontFamily:{type:String,default:"Poppins-Regular, sans-serif"},isActive:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:o}){const s=e,O=t.computed(()=>({"--height":s.height,"--width":s.width,"--padding":s.padding,"--border-radius":s.borderRadius,"--border":`solid ${s.borderWidth} ${s.borderColor}`,"--background-color":s.backgroundColor,"--font-color":s.fontColor,"--font-size":s.fontSize,"--font-family":s.fontFamily,"--active-background-color":s.activeBackgroundColor||s.backgroundColor,"--active-border-color":s.activeBorderColor||s.borderColor,"--active-font-color":s.activeFontColor||s.fontColor}));function W(){o("click")}return(b,g)=>(t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["button",{active:e.isActive}]),style:t.normalizeStyle(O.value),onClick:W},t.toDisplayString(e.text),7))}},qOt=l_(WOt,[["__scopeId","data-v-ea76c1c1"]]);function SU(e,o){return function(){return e.apply(o,arguments)}}const{toString:YOt}=Object.prototype,{getPrototypeOf:hT}=Object,I5=(e=>o=>{const s=YOt.call(o);return e[s]||(e[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),Of=e=>(e=e.toLowerCase(),o=>I5(o)===e),P5=e=>o=>typeof o===e,{isArray:fv}=Array,c_=P5("undefined");function ZOt(e){return e!==null&&!c_(e)&&e.constructor!==null&&!c_(e.constructor)&&xp(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const TU=Of("ArrayBuffer");function XOt(e){let o;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?o=ArrayBuffer.isView(e):o=e&&e.buffer&&TU(e.buffer),o}const JOt=P5("string"),xp=P5("function"),CU=P5("number"),B5=e=>e!==null&&typeof e=="object",KOt=e=>e===!0||e===!1,L5=e=>{if(I5(e)!=="object")return!1;const o=hT(e);return(o===null||o===Object.prototype||Object.getPrototypeOf(o)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},QOt=Of("Date"),eFt=Of("File"),tFt=Of("Blob"),nFt=Of("FileList"),aFt=e=>B5(e)&&xp(e.pipe),rFt=e=>{let o;return e&&(typeof FormData=="function"&&e instanceof FormData||xp(e.append)&&((o=I5(e))==="formdata"||o==="object"&&xp(e.toString)&&e.toString()==="[object FormData]"))},iFt=Of("URLSearchParams"),[oFt,sFt,lFt,cFt]=["ReadableStream","Request","Response","Headers"].map(Of),uFt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function u_(e,o,{allOwnKeys:s=!1}={}){if(e===null||typeof e>"u")return;let O,W;if(typeof e!="object"&&(e=[e]),fv(e))for(O=0,W=e.length;O<W;O++)o.call(null,e[O],O,e);else{const b=s?Object.getOwnPropertyNames(e):Object.keys(e),g=b.length;let a;for(O=0;O<g;O++)a=b[O],o.call(null,e[a],a,e)}}function EU(e,o){o=o.toLowerCase();const s=Object.keys(e);let O=s.length,W;for(;O-- >0;)if(W=s[O],o===W.toLowerCase())return W;return null}const p1=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),AU=e=>!c_(e)&&e!==p1;function pT(){const{caseless:e}=AU(this)&&this||{},o={},s=(O,W)=>{const b=e&&EU(o,W)||W;L5(o[b])&&L5(O)?o[b]=pT(o[b],O):L5(O)?o[b]=pT({},O):fv(O)?o[b]=O.slice():o[b]=O};for(let O=0,W=arguments.length;O<W;O++)arguments[O]&&u_(arguments[O],s);return o}const dFt=(e,o,s,{allOwnKeys:O}={})=>(u_(o,(W,b)=>{s&&xp(W)?e[b]=SU(W,s):e[b]=W},{allOwnKeys:O}),e),hFt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),pFt=(e,o,s,O)=>{e.prototype=Object.create(o.prototype,O),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:o.prototype}),s&&Object.assign(e.prototype,s)},fFt=(e,o,s,O)=>{let W,b,g;const a={};if(o=o||{},e==null)return o;do{for(W=Object.getOwnPropertyNames(e),b=W.length;b-- >0;)g=W[b],(!O||O(g,e,o))&&!a[g]&&(o[g]=e[g],a[g]=!0);e=s!==!1&&hT(e)}while(e&&(!s||s(e,o))&&e!==Object.prototype);return o},mFt=(e,o,s)=>{e=String(e),(s===void 0||s>e.length)&&(s=e.length),s-=o.length;const O=e.indexOf(o,s);return O!==-1&&O===s},gFt=e=>{if(!e)return null;if(fv(e))return e;let o=e.length;if(!CU(o))return null;const s=new Array(o);for(;o-- >0;)s[o]=e[o];return s},yFt=(e=>o=>e&&o instanceof e)(typeof Uint8Array<"u"&&hT(Uint8Array)),vFt=(e,o)=>{const s=(e&&e[Symbol.iterator]).call(e);let O;for(;(O=s.next())&&!O.done;){const W=O.value;o.call(e,W[0],W[1])}},_Ft=(e,o)=>{let s;const O=[];for(;(s=e.exec(o))!==null;)O.push(s);return O},bFt=Of("HTMLFormElement"),xFt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,s,O){return s.toUpperCase()+O}),MU=(({hasOwnProperty:e})=>(o,s)=>e.call(o,s))(Object.prototype),wFt=Of("RegExp"),IU=(e,o)=>{const s=Object.getOwnPropertyDescriptors(e),O={};u_(s,(W,b)=>{let g;(g=o(W,b,e))!==!1&&(O[b]=g||W)}),Object.defineProperties(e,O)},kFt=e=>{IU(e,(o,s)=>{if(xp(e)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;const O=e[s];if(xp(O)){if(o.enumerable=!1,"writable"in o){o.writable=!1;return}o.set||(o.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},SFt=(e,o)=>{const s={},O=W=>{W.forEach(b=>{s[b]=!0})};return fv(e)?O(e):O(String(e).split(o)),s},TFt=()=>{},CFt=(e,o)=>e!=null&&Number.isFinite(e=+e)?e:o,fT="abcdefghijklmnopqrstuvwxyz",PU="0123456789",BU={DIGIT:PU,ALPHA:fT,ALPHA_DIGIT:fT+fT.toUpperCase()+PU},EFt=(e=16,o=BU.ALPHA_DIGIT)=>{let s="";const{length:O}=o;for(;e--;)s+=o[Math.random()*O|0];return s};function AFt(e){return!!(e&&xp(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const MFt=e=>{const o=new Array(10),s=(O,W)=>{if(B5(O)){if(o.indexOf(O)>=0)return;if(!("toJSON"in O)){o[W]=O;const b=fv(O)?[]:{};return u_(O,(g,a)=>{const y=s(g,W+1);!c_(y)&&(b[a]=y)}),o[W]=void 0,b}}return O};return s(e,0)},IFt=Of("AsyncFunction"),PFt=e=>e&&(B5(e)||xp(e))&&xp(e.then)&&xp(e.catch),LU=((e,o)=>e?setImmediate:o?((s,O)=>(p1.addEventListener("message",({source:W,data:b})=>{W===p1&&b===s&&O.length&&O.shift()()},!1),W=>{O.push(W),p1.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",xp(p1.postMessage)),BFt=typeof queueMicrotask<"u"?queueMicrotask.bind(p1):typeof process<"u"&&process.nextTick||LU,jr={isArray:fv,isArrayBuffer:TU,isBuffer:ZOt,isFormData:rFt,isArrayBufferView:XOt,isString:JOt,isNumber:CU,isBoolean:KOt,isObject:B5,isPlainObject:L5,isReadableStream:oFt,isRequest:sFt,isResponse:lFt,isHeaders:cFt,isUndefined:c_,isDate:QOt,isFile:eFt,isBlob:tFt,isRegExp:wFt,isFunction:xp,isStream:aFt,isURLSearchParams:iFt,isTypedArray:yFt,isFileList:nFt,forEach:u_,merge:pT,extend:dFt,trim:uFt,stripBOM:hFt,inherits:pFt,toFlatObject:fFt,kindOf:I5,kindOfTest:Of,endsWith:mFt,toArray:gFt,forEachEntry:vFt,matchAll:_Ft,isHTMLForm:bFt,hasOwnProperty:MU,hasOwnProp:MU,reduceDescriptors:IU,freezeMethods:kFt,toObjectSet:SFt,toCamelCase:xFt,noop:TFt,toFiniteNumber:CFt,findKey:EU,global:p1,isContextDefined:AU,ALPHABET:BU,generateString:EFt,isSpecCompliantForm:AFt,toJSONObject:MFt,isAsyncFn:IFt,isThenable:PFt,setImmediate:LU,asap:BFt};function kl(e,o,s,O,W){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",o&&(this.code=o),s&&(this.config=s),O&&(this.request=O),W&&(this.response=W,this.status=W.status?W.status:null)}jr.inherits(kl,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:jr.toJSONObject(this.config),code:this.code,status:this.status}}});const zU=kl.prototype,OU={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{OU[e]={value:e}}),Object.defineProperties(kl,OU),Object.defineProperty(zU,"isAxiosError",{value:!0}),kl.from=(e,o,s,O,W,b)=>{const g=Object.create(zU);return jr.toFlatObject(e,g,function(a){return a!==Error.prototype},a=>a!=="isAxiosError"),kl.call(g,e.message,o,s,O,W),g.cause=e,g.name=e.name,b&&Object.assign(g,b),g};const LFt=null;function mT(e){return jr.isPlainObject(e)||jr.isArray(e)}function FU(e){return jr.endsWith(e,"[]")?e.slice(0,-2):e}function NU(e,o,s){return e?e.concat(o).map(function(O,W){return O=FU(O),!s&&W?"["+O+"]":O}).join(s?".":""):o}function zFt(e){return jr.isArray(e)&&!e.some(mT)}const OFt=jr.toFlatObject(jr,{},null,function(e){return/^is[A-Z]/.test(e)});function z5(e,o,s){if(!jr.isObject(e))throw new TypeError("target must be an object");o=o||new FormData,s=jr.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,u){return!jr.isUndefined(u[v])});const O=s.metaTokens,W=s.visitor||h,b=s.dots,g=s.indexes,a=(s.Blob||typeof Blob<"u"&&Blob)&&jr.isSpecCompliantForm(o);if(!jr.isFunction(W))throw new TypeError("visitor must be a function");function y(v){if(v===null)return"";if(jr.isDate(v))return v.toISOString();if(!a&&jr.isBlob(v))throw new kl("Blob is not supported. Use a Buffer instead.");return jr.isArrayBuffer(v)||jr.isTypedArray(v)?a&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function h(v,u,r){let i=v;if(v&&!r&&typeof v=="object"){if(jr.endsWith(u,"{}"))u=O?u:u.slice(0,-2),v=JSON.stringify(v);else if(jr.isArray(v)&&zFt(v)||(jr.isFileList(v)||jr.endsWith(u,"[]"))&&(i=jr.toArray(v)))return u=FU(u),i.forEach(function(d,l){!(jr.isUndefined(d)||d===null)&&o.append(g===!0?NU([u],l,b):g===null?u:u+"[]",y(d))}),!1}return mT(v)?!0:(o.append(NU(r,u,b),y(v)),!1)}const n=[],x=Object.assign(OFt,{defaultVisitor:h,convertValue:y,isVisitable:mT});function _(v,u){if(!jr.isUndefined(v)){if(n.indexOf(v)!==-1)throw Error("Circular reference detected in "+u.join("."));n.push(v),jr.forEach(v,function(r,i){(!(jr.isUndefined(r)||r===null)&&W.call(o,r,jr.isString(i)?i.trim():i,u,x))===!0&&_(r,u?u.concat(i):[i])}),n.pop()}}if(!jr.isObject(e))throw new TypeError("data must be an object");return _(e),o}function DU(e){const o={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return o[s]})}function gT(e,o){this._pairs=[],e&&z5(e,this,o)}const RU=gT.prototype;RU.append=function(e,o){this._pairs.push([e,o])},RU.toString=function(e){const o=e?function(s){return e.call(this,s,DU)}:DU;return this._pairs.map(function(s){return o(s[0])+"="+o(s[1])},"").join("&")};function FFt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function VU(e,o,s){if(!o)return e;const O=s&&s.encode||FFt;jr.isFunction(s)&&(s={serialize:s});const W=s&&s.serialize;let b;if(W?b=W(o,s):b=jr.isURLSearchParams(o)?o.toString():new gT(o,s).toString(O),b){const g=e.indexOf("#");g!==-1&&(e=e.slice(0,g)),e+=(e.indexOf("?")===-1?"?":"&")+b}return e}class NFt{constructor(){this.handlers=[]}use(o,s,O){return this.handlers.push({fulfilled:o,rejected:s,synchronous:O?O.synchronous:!1,runWhen:O?O.runWhen:null}),this.handlers.length-1}eject(o){this.handlers[o]&&(this.handlers[o]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(o){jr.forEach(this.handlers,function(s){s!==null&&o(s)})}}const jU=NFt,$U={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},DFt=typeof URLSearchParams<"u"?URLSearchParams:gT,RFt=typeof FormData<"u"?FormData:null,VFt=typeof Blob<"u"?Blob:null,jFt={isBrowser:!0,classes:{URLSearchParams:DFt,FormData:RFt,Blob:VFt},protocols:["http","https","file","blob","url","data"]},yT=typeof window<"u"&&typeof document<"u",vT=typeof navigator=="object"&&navigator||void 0,$Ft=yT&&(!vT||["ReactNative","NativeScript","NS"].indexOf(vT.product)<0),UFt=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),GFt=yT&&window.location.href||"http://localhost",HFt=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:yT,hasStandardBrowserEnv:$Ft,hasStandardBrowserWebWorkerEnv:UFt,navigator:vT,origin:GFt},Symbol.toStringTag,{value:"Module"})),xh={...HFt,...jFt};function WFt(e,o){return z5(e,new xh.classes.URLSearchParams,Object.assign({visitor:function(s,O,W,b){return xh.isNode&&jr.isBuffer(s)?(this.append(O,s.toString("base64")),!1):b.defaultVisitor.apply(this,arguments)}},o))}function qFt(e){return jr.matchAll(/\w+|\[(\w*)]/g,e).map(o=>o[0]==="[]"?"":o[1]||o[0])}function YFt(e){const o={},s=Object.keys(e);let O;const W=s.length;let b;for(O=0;O<W;O++)b=s[O],o[b]=e[b];return o}function UU(e){function o(s,O,W,b){let g=s[b++];if(g==="__proto__")return!0;const a=Number.isFinite(+g),y=b>=s.length;return g=!g&&jr.isArray(W)?W.length:g,y?(jr.hasOwnProp(W,g)?W[g]=[W[g],O]:W[g]=O,!a):((!W[g]||!jr.isObject(W[g]))&&(W[g]=[]),o(s,O,W[g],b)&&jr.isArray(W[g])&&(W[g]=YFt(W[g])),!a)}if(jr.isFormData(e)&&jr.isFunction(e.entries)){const s={};return jr.forEachEntry(e,(O,W)=>{o(qFt(O),W,s,0)}),s}return null}function ZFt(e,o,s){if(jr.isString(e))try{return(o||JSON.parse)(e),jr.trim(e)}catch(O){if(O.name!=="SyntaxError")throw O}return(s||JSON.stringify)(e)}const _T={transitional:$U,adapter:["xhr","http","fetch"],transformRequest:[function(e,o){const s=o.getContentType()||"",O=s.indexOf("application/json")>-1,W=jr.isObject(e);if(W&&jr.isHTMLForm(e)&&(e=new FormData(e)),jr.isFormData(e))return O?JSON.stringify(UU(e)):e;if(jr.isArrayBuffer(e)||jr.isBuffer(e)||jr.isStream(e)||jr.isFile(e)||jr.isBlob(e)||jr.isReadableStream(e))return e;if(jr.isArrayBufferView(e))return e.buffer;if(jr.isURLSearchParams(e))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let b;if(W){if(s.indexOf("application/x-www-form-urlencoded")>-1)return WFt(e,this.formSerializer).toString();if((b=jr.isFileList(e))||s.indexOf("multipart/form-data")>-1){const g=this.env&&this.env.FormData;return z5(b?{"files[]":e}:e,g&&new g,this.formSerializer)}}return W||O?(o.setContentType("application/json",!1),ZFt(e)):e}],transformResponse:[function(e){const o=this.transitional||_T.transitional,s=o&&o.forcedJSONParsing,O=this.responseType==="json";if(jr.isResponse(e)||jr.isReadableStream(e))return e;if(e&&jr.isString(e)&&(s&&!this.responseType||O)){const W=!(o&&o.silentJSONParsing)&&O;try{return JSON.parse(e)}catch(b){if(W)throw b.name==="SyntaxError"?kl.from(b,kl.ERR_BAD_RESPONSE,this,null,this.response):b}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:xh.classes.FormData,Blob:xh.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};jr.forEach(["delete","get","head","post","put","patch"],e=>{_T.headers[e]={}});const bT=_T,XFt=jr.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),JFt=e=>{const o={};let s,O,W;return e&&e.split(`
|
|
8174
|
+
`),Et=pe.createShader(pe.FRAGMENT_SHADER);if(pe.isContextLost())return void(this.failedToCreate=!0);if(pe.shaderSource(Et,Tt),pe.compileShader(Et),!pe.getShaderParameter(Et,pe.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${pe.getShaderInfoLog(Et)}`);pe.attachShader(this.program,Et);const Yt=pe.createShader(pe.VERTEX_SHADER);if(pe.isContextLost())return void(this.failedToCreate=!0);if(pe.shaderSource(Yt,Rt),pe.compileShader(Yt),!pe.getShaderParameter(Yt,pe.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${pe.getShaderInfoLog(Yt)}`);pe.attachShader(this.program,Yt),this.attributes={};const Kt={};this.numAttributes=Fe.length;for(let Zt=0;Zt<this.numAttributes;Zt++)Fe[Zt]&&(pe.bindAttribLocation(this.program,Zt,Fe[Zt]),this.attributes[Fe[Zt]]=Zt);if(pe.linkProgram(this.program),!pe.getProgramParameter(this.program,pe.LINK_STATUS))throw new Error(`Program failed to link: ${pe.getProgramInfoLog(this.program)}`);pe.deleteShader(Yt),pe.deleteShader(Et);for(let Zt=0;Zt<xt.length;Zt++){const hn=xt[Zt];if(hn&&!Kt[hn]){const xn=pe.getUniformLocation(this.program,hn);xn&&(Kt[hn]=xn)}}this.fixedUniforms=j(c,Kt),this.terrainUniforms=((Zt,hn)=>({u_depth:new n.aI(Zt,hn.u_depth),u_terrain:new n.aI(Zt,hn.u_terrain),u_terrain_dim:new n.aJ(Zt,hn.u_terrain_dim),u_terrain_matrix:new n.aK(Zt,hn.u_terrain_matrix),u_terrain_unpack:new n.aL(Zt,hn.u_terrain_unpack),u_terrain_exaggeration:new n.aJ(Zt,hn.u_terrain_exaggeration)}))(c,Kt),this.binderUniforms=F?F.getUniforms(c,Kt):[]}draw(c,p,F,j,q,ie,pe,be,Ae,Fe,Ge,at,ct,pt,xt,At,Tt,Rt){const Et=c.gl;if(this.failedToCreate)return;if(c.program.set(this.program),c.setDepthMode(F),c.setStencilMode(j),c.setColorMode(q),c.setCullFace(ie),be){c.activeTexture.set(Et.TEXTURE2),Et.bindTexture(Et.TEXTURE_2D,be.depthTexture),c.activeTexture.set(Et.TEXTURE3),Et.bindTexture(Et.TEXTURE_2D,be.texture);for(const Kt in this.terrainUniforms)this.terrainUniforms[Kt].set(be[Kt])}for(const Kt in this.fixedUniforms)this.fixedUniforms[Kt].set(pe[Kt]);xt&&xt.setUniforms(c,this.binderUniforms,ct,{zoom:pt});let Yt=0;switch(p){case Et.LINES:Yt=2;break;case Et.TRIANGLES:Yt=3;break;case Et.LINE_STRIP:Yt=1}for(const Kt of at.get()){const Zt=Kt.vaos||(Kt.vaos={});(Zt[Ae]||(Zt[Ae]=new Na)).bind(c,this,Fe,xt?xt.getPaintVertexBuffers():[],Ge,Kt.vertexOffset,At,Tt,Rt),Et.drawElements(p,Kt.primitiveLength*Yt,Et.UNSIGNED_SHORT,Kt.primitiveOffset*Yt*2)}}}function jn(R,c,p){const F=1/St(p,1,c.transform.tileZoom),j=Math.pow(2,p.tileID.overscaledZ),q=p.tileSize*Math.pow(2,c.transform.tileZoom)/j,ie=q*(p.tileID.canonical.x+p.tileID.wrap*j),pe=q*p.tileID.canonical.y;return{u_image:0,u_texsize:p.imageAtlasTexture.size,u_scale:[F,R.fromScale,R.toScale],u_fade:R.t,u_pixel_coord_upper:[ie>>16,pe>>16],u_pixel_coord_lower:[65535&ie,65535&pe]}}const aa=(R,c,p,F)=>{const j=c.style.light,q=j.properties.get("position"),ie=[q.x,q.y,q.z],pe=function(){var Ae=new n.A(9);return n.A!=Float32Array&&(Ae[1]=0,Ae[2]=0,Ae[3]=0,Ae[5]=0,Ae[6]=0,Ae[7]=0),Ae[0]=1,Ae[4]=1,Ae[8]=1,Ae}();j.properties.get("anchor")==="viewport"&&function(Ae,Fe){var Ge=Math.sin(Fe),at=Math.cos(Fe);Ae[0]=at,Ae[1]=Ge,Ae[2]=0,Ae[3]=-Ge,Ae[4]=at,Ae[5]=0,Ae[6]=0,Ae[7]=0,Ae[8]=1}(pe,-c.transform.angle),function(Ae,Fe,Ge){var at=Fe[0],ct=Fe[1],pt=Fe[2];Ae[0]=at*Ge[0]+ct*Ge[3]+pt*Ge[6],Ae[1]=at*Ge[1]+ct*Ge[4]+pt*Ge[7],Ae[2]=at*Ge[2]+ct*Ge[5]+pt*Ge[8]}(ie,ie,pe);const be=j.properties.get("color");return{u_matrix:R,u_lightpos:ie,u_lightintensity:j.properties.get("intensity"),u_lightcolor:[be.r,be.g,be.b],u_vertical_gradient:+p,u_opacity:F}},_a=(R,c,p,F,j,q,ie)=>n.e(aa(R,c,p,F),jn(q,c,ie),{u_height_factor:-Math.pow(2,j.overscaledZ)/ie.tileSize/8}),ga=R=>({u_matrix:R}),za=(R,c,p,F)=>n.e(ga(R),jn(p,c,F)),Ua=(R,c)=>({u_matrix:R,u_world:c}),gn=(R,c,p,F,j)=>n.e(za(R,c,p,F),{u_world:j}),Un=(R,c,p,F)=>{const j=R.transform;let q,ie;if(F.paint.get("circle-pitch-alignment")==="map"){const pe=St(p,1,j.zoom);q=!0,ie=[pe,pe]}else q=!1,ie=j.pixelsToGLUnits;return{u_camera_to_center_distance:j.cameraToCenterDistance,u_scale_with_map:+(F.paint.get("circle-pitch-scale")==="map"),u_matrix:R.translatePosMatrix(c.posMatrix,p,F.paint.get("circle-translate"),F.paint.get("circle-translate-anchor")),u_pitch_with_map:+q,u_device_pixel_ratio:R.pixelRatio,u_extrude_scale:ie}},tn=(R,c)=>({u_matrix:c,u_pixel_extrude_scale:[1/R.width,1/R.height]}),un=(R,c,p)=>({u_matrix:R,u_inv_matrix:c,u_camera_to_center_distance:p.cameraToCenterDistance,u_viewport_size:[p.width,p.height]}),mn=(R,c,p=1)=>({u_matrix:R,u_color:c,u_overlay:0,u_overlay_scale:p}),Fn=R=>({u_matrix:R}),On=(R,c,p,F)=>({u_matrix:R,u_extrude_scale:St(c,1,p),u_intensity:F}),Yn=(R,c,p,F)=>{const j=n.H();n.aQ(j,0,R.width,R.height,0,0,1);const q=R.context.gl;return{u_matrix:j,u_world:[q.drawingBufferWidth,q.drawingBufferHeight],u_image:p,u_color_ramp:F,u_opacity:c.paint.get("heatmap-opacity")}},Vn=(R,c,p,F)=>{const j=p.paint.get("hillshade-shadow-color"),q=p.paint.get("hillshade-highlight-color"),ie=p.paint.get("hillshade-accent-color");let pe=p.paint.get("hillshade-illumination-direction")*(Math.PI/180);p.paint.get("hillshade-illumination-anchor")==="viewport"&&(pe-=R.transform.angle);const be=!R.options.moving;return{u_matrix:F?F.posMatrix:R.transform.calculatePosMatrix(c.tileID.toUnwrapped(),be),u_image:0,u_latrange:cn(0,c.tileID),u_light:[p.paint.get("hillshade-exaggeration"),pe],u_shadow:j,u_highlight:q,u_accent:ie}},Pn=(R,c)=>{const p=c.stride,F=n.H();return n.aQ(F,0,n.X,-n.X,0,0,1),n.J(F,F,[0,-n.X,0]),{u_matrix:F,u_image:1,u_dimension:[p,p],u_zoom:R.overscaledZ,u_unpack:c.getUnpackVector()}};function cn(R,c){const p=Math.pow(2,c.canonical.z),F=c.canonical.y;return[new n.Z(0,F/p).toLngLat().lat,new n.Z(0,(F+1)/p).toLngLat().lat]}const sn=(R,c,p,F)=>{const j=R.transform;return{u_matrix:ua(R,c,p,F),u_ratio:1/St(c,1,j.zoom),u_device_pixel_ratio:R.pixelRatio,u_units_to_pixels:[1/j.pixelsToGLUnits[0],1/j.pixelsToGLUnits[1]]}},Tn=(R,c,p,F,j)=>n.e(sn(R,c,p,j),{u_image:0,u_image_height:F}),Zn=(R,c,p,F,j)=>{const q=R.transform,ie=la(c,q);return{u_matrix:ua(R,c,p,j),u_texsize:c.imageAtlasTexture.size,u_ratio:1/St(c,1,q.zoom),u_device_pixel_ratio:R.pixelRatio,u_image:0,u_scale:[ie,F.fromScale,F.toScale],u_fade:F.t,u_units_to_pixels:[1/q.pixelsToGLUnits[0],1/q.pixelsToGLUnits[1]]}},ca=(R,c,p,F,j,q)=>{const ie=R.transform,pe=R.lineAtlas,be=la(c,ie),Ae=p.layout.get("line-cap")==="round",Fe=pe.getDash(F.from,Ae),Ge=pe.getDash(F.to,Ae),at=Fe.width*j.fromScale,ct=Ge.width*j.toScale;return n.e(sn(R,c,p,q),{u_patternscale_a:[be/at,-Fe.height/2],u_patternscale_b:[be/ct,-Ge.height/2],u_sdfgamma:pe.width/(256*Math.min(at,ct)*R.pixelRatio)/2,u_image:0,u_tex_y_a:Fe.y,u_tex_y_b:Ge.y,u_mix:j.t})};function la(R,c){return 1/St(R,1,c.tileZoom)}function ua(R,c,p,F){return R.translatePosMatrix(F?F.posMatrix:c.tileID.posMatrix,c,p.paint.get("line-translate"),p.paint.get("line-translate-anchor"))}const Aa=(R,c,p,F,j)=>{return{u_matrix:R,u_tl_parent:c,u_scale_parent:p,u_buffer_scale:1,u_fade_t:F.mix,u_opacity:F.opacity*j.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:j.paint.get("raster-brightness-min"),u_brightness_high:j.paint.get("raster-brightness-max"),u_saturation_factor:(ie=j.paint.get("raster-saturation"),ie>0?1-1/(1.001-ie):-ie),u_contrast_factor:(q=j.paint.get("raster-contrast"),q>0?1/(1-q):1+q),u_spin_weights:ka(j.paint.get("raster-hue-rotate"))};var q,ie};function ka(R){R*=Math.PI/180;const c=Math.sin(R),p=Math.cos(R);return[(2*p+1)/3,(-Math.sqrt(3)*c-p+1)/3,(Math.sqrt(3)*c-p+1)/3]}const Ba=(R,c,p,F,j,q,ie,pe,be,Ae,Fe,Ge,at,ct)=>{const pt=ie.transform;return{u_is_size_zoom_constant:+(R==="constant"||R==="source"),u_is_size_feature_constant:+(R==="constant"||R==="camera"),u_size_t:c?c.uSizeT:0,u_size:c?c.uSize:0,u_camera_to_center_distance:pt.cameraToCenterDistance,u_pitch:pt.pitch/360*2*Math.PI,u_rotate_symbol:+p,u_aspect_ratio:pt.width/pt.height,u_fade_change:ie.options.fadeDuration?ie.symbolFadeChange:1,u_matrix:pe,u_label_plane_matrix:be,u_coord_matrix:Ae,u_is_text:+Ge,u_pitch_with_map:+F,u_is_along_line:j,u_is_variable_anchor:q,u_texsize:at,u_texture:0,u_translation:Fe,u_pitched_scale:ct}},xa=(R,c,p,F,j,q,ie,pe,be,Ae,Fe,Ge,at,ct,pt)=>{const xt=ie.transform;return n.e(Ba(R,c,p,F,j,q,ie,pe,be,Ae,Fe,Ge,at,pt),{u_gamma_scale:F?Math.cos(xt._pitch)*xt.cameraToCenterDistance:1,u_device_pixel_ratio:ie.pixelRatio,u_is_halo:1})},Ca=(R,c,p,F,j,q,ie,pe,be,Ae,Fe,Ge,at,ct)=>n.e(xa(R,c,p,F,j,q,ie,pe,be,Ae,Fe,!0,Ge,!0,ct),{u_texsize_icon:at,u_texture_icon:1}),Fa=(R,c,p)=>({u_matrix:R,u_opacity:c,u_color:p}),Ja=(R,c,p,F,j,q)=>n.e(function(ie,pe,be,Ae){const Fe=be.imageManager.getPattern(ie.from.toString()),Ge=be.imageManager.getPattern(ie.to.toString()),{width:at,height:ct}=be.imageManager.getPixelSize(),pt=Math.pow(2,Ae.tileID.overscaledZ),xt=Ae.tileSize*Math.pow(2,be.transform.tileZoom)/pt,At=xt*(Ae.tileID.canonical.x+Ae.tileID.wrap*pt),Tt=xt*Ae.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Fe.tl,u_pattern_br_a:Fe.br,u_pattern_tl_b:Ge.tl,u_pattern_br_b:Ge.br,u_texsize:[at,ct],u_mix:pe.t,u_pattern_size_a:Fe.displaySize,u_pattern_size_b:Ge.displaySize,u_scale_a:pe.fromScale,u_scale_b:pe.toScale,u_tile_units_to_pixels:1/St(Ae,1,be.transform.tileZoom),u_pixel_coord_upper:[At>>16,Tt>>16],u_pixel_coord_lower:[65535&At,65535&Tt]}}(F,q,p,j),{u_matrix:R,u_opacity:c}),$a={fillExtrusion:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_lightpos:new n.aO(R,c.u_lightpos),u_lightintensity:new n.aJ(R,c.u_lightintensity),u_lightcolor:new n.aO(R,c.u_lightcolor),u_vertical_gradient:new n.aJ(R,c.u_vertical_gradient),u_opacity:new n.aJ(R,c.u_opacity)}),fillExtrusionPattern:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_lightpos:new n.aO(R,c.u_lightpos),u_lightintensity:new n.aJ(R,c.u_lightintensity),u_lightcolor:new n.aO(R,c.u_lightcolor),u_vertical_gradient:new n.aJ(R,c.u_vertical_gradient),u_height_factor:new n.aJ(R,c.u_height_factor),u_image:new n.aI(R,c.u_image),u_texsize:new n.aP(R,c.u_texsize),u_pixel_coord_upper:new n.aP(R,c.u_pixel_coord_upper),u_pixel_coord_lower:new n.aP(R,c.u_pixel_coord_lower),u_scale:new n.aO(R,c.u_scale),u_fade:new n.aJ(R,c.u_fade),u_opacity:new n.aJ(R,c.u_opacity)}),fill:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix)}),fillPattern:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_image:new n.aI(R,c.u_image),u_texsize:new n.aP(R,c.u_texsize),u_pixel_coord_upper:new n.aP(R,c.u_pixel_coord_upper),u_pixel_coord_lower:new n.aP(R,c.u_pixel_coord_lower),u_scale:new n.aO(R,c.u_scale),u_fade:new n.aJ(R,c.u_fade)}),fillOutline:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_world:new n.aP(R,c.u_world)}),fillOutlinePattern:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_world:new n.aP(R,c.u_world),u_image:new n.aI(R,c.u_image),u_texsize:new n.aP(R,c.u_texsize),u_pixel_coord_upper:new n.aP(R,c.u_pixel_coord_upper),u_pixel_coord_lower:new n.aP(R,c.u_pixel_coord_lower),u_scale:new n.aO(R,c.u_scale),u_fade:new n.aJ(R,c.u_fade)}),circle:(R,c)=>({u_camera_to_center_distance:new n.aJ(R,c.u_camera_to_center_distance),u_scale_with_map:new n.aI(R,c.u_scale_with_map),u_pitch_with_map:new n.aI(R,c.u_pitch_with_map),u_extrude_scale:new n.aP(R,c.u_extrude_scale),u_device_pixel_ratio:new n.aJ(R,c.u_device_pixel_ratio),u_matrix:new n.aK(R,c.u_matrix)}),collisionBox:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_pixel_extrude_scale:new n.aP(R,c.u_pixel_extrude_scale)}),collisionCircle:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_inv_matrix:new n.aK(R,c.u_inv_matrix),u_camera_to_center_distance:new n.aJ(R,c.u_camera_to_center_distance),u_viewport_size:new n.aP(R,c.u_viewport_size)}),debug:(R,c)=>({u_color:new n.aM(R,c.u_color),u_matrix:new n.aK(R,c.u_matrix),u_overlay:new n.aI(R,c.u_overlay),u_overlay_scale:new n.aJ(R,c.u_overlay_scale)}),clippingMask:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix)}),heatmap:(R,c)=>({u_extrude_scale:new n.aJ(R,c.u_extrude_scale),u_intensity:new n.aJ(R,c.u_intensity),u_matrix:new n.aK(R,c.u_matrix)}),heatmapTexture:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_world:new n.aP(R,c.u_world),u_image:new n.aI(R,c.u_image),u_color_ramp:new n.aI(R,c.u_color_ramp),u_opacity:new n.aJ(R,c.u_opacity)}),hillshade:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_image:new n.aI(R,c.u_image),u_latrange:new n.aP(R,c.u_latrange),u_light:new n.aP(R,c.u_light),u_shadow:new n.aM(R,c.u_shadow),u_highlight:new n.aM(R,c.u_highlight),u_accent:new n.aM(R,c.u_accent)}),hillshadePrepare:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_image:new n.aI(R,c.u_image),u_dimension:new n.aP(R,c.u_dimension),u_zoom:new n.aJ(R,c.u_zoom),u_unpack:new n.aL(R,c.u_unpack)}),line:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_ratio:new n.aJ(R,c.u_ratio),u_device_pixel_ratio:new n.aJ(R,c.u_device_pixel_ratio),u_units_to_pixels:new n.aP(R,c.u_units_to_pixels)}),lineGradient:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_ratio:new n.aJ(R,c.u_ratio),u_device_pixel_ratio:new n.aJ(R,c.u_device_pixel_ratio),u_units_to_pixels:new n.aP(R,c.u_units_to_pixels),u_image:new n.aI(R,c.u_image),u_image_height:new n.aJ(R,c.u_image_height)}),linePattern:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_texsize:new n.aP(R,c.u_texsize),u_ratio:new n.aJ(R,c.u_ratio),u_device_pixel_ratio:new n.aJ(R,c.u_device_pixel_ratio),u_image:new n.aI(R,c.u_image),u_units_to_pixels:new n.aP(R,c.u_units_to_pixels),u_scale:new n.aO(R,c.u_scale),u_fade:new n.aJ(R,c.u_fade)}),lineSDF:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_ratio:new n.aJ(R,c.u_ratio),u_device_pixel_ratio:new n.aJ(R,c.u_device_pixel_ratio),u_units_to_pixels:new n.aP(R,c.u_units_to_pixels),u_patternscale_a:new n.aP(R,c.u_patternscale_a),u_patternscale_b:new n.aP(R,c.u_patternscale_b),u_sdfgamma:new n.aJ(R,c.u_sdfgamma),u_image:new n.aI(R,c.u_image),u_tex_y_a:new n.aJ(R,c.u_tex_y_a),u_tex_y_b:new n.aJ(R,c.u_tex_y_b),u_mix:new n.aJ(R,c.u_mix)}),raster:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_tl_parent:new n.aP(R,c.u_tl_parent),u_scale_parent:new n.aJ(R,c.u_scale_parent),u_buffer_scale:new n.aJ(R,c.u_buffer_scale),u_fade_t:new n.aJ(R,c.u_fade_t),u_opacity:new n.aJ(R,c.u_opacity),u_image0:new n.aI(R,c.u_image0),u_image1:new n.aI(R,c.u_image1),u_brightness_low:new n.aJ(R,c.u_brightness_low),u_brightness_high:new n.aJ(R,c.u_brightness_high),u_saturation_factor:new n.aJ(R,c.u_saturation_factor),u_contrast_factor:new n.aJ(R,c.u_contrast_factor),u_spin_weights:new n.aO(R,c.u_spin_weights)}),symbolIcon:(R,c)=>({u_is_size_zoom_constant:new n.aI(R,c.u_is_size_zoom_constant),u_is_size_feature_constant:new n.aI(R,c.u_is_size_feature_constant),u_size_t:new n.aJ(R,c.u_size_t),u_size:new n.aJ(R,c.u_size),u_camera_to_center_distance:new n.aJ(R,c.u_camera_to_center_distance),u_pitch:new n.aJ(R,c.u_pitch),u_rotate_symbol:new n.aI(R,c.u_rotate_symbol),u_aspect_ratio:new n.aJ(R,c.u_aspect_ratio),u_fade_change:new n.aJ(R,c.u_fade_change),u_matrix:new n.aK(R,c.u_matrix),u_label_plane_matrix:new n.aK(R,c.u_label_plane_matrix),u_coord_matrix:new n.aK(R,c.u_coord_matrix),u_is_text:new n.aI(R,c.u_is_text),u_pitch_with_map:new n.aI(R,c.u_pitch_with_map),u_is_along_line:new n.aI(R,c.u_is_along_line),u_is_variable_anchor:new n.aI(R,c.u_is_variable_anchor),u_texsize:new n.aP(R,c.u_texsize),u_texture:new n.aI(R,c.u_texture),u_translation:new n.aP(R,c.u_translation),u_pitched_scale:new n.aJ(R,c.u_pitched_scale)}),symbolSDF:(R,c)=>({u_is_size_zoom_constant:new n.aI(R,c.u_is_size_zoom_constant),u_is_size_feature_constant:new n.aI(R,c.u_is_size_feature_constant),u_size_t:new n.aJ(R,c.u_size_t),u_size:new n.aJ(R,c.u_size),u_camera_to_center_distance:new n.aJ(R,c.u_camera_to_center_distance),u_pitch:new n.aJ(R,c.u_pitch),u_rotate_symbol:new n.aI(R,c.u_rotate_symbol),u_aspect_ratio:new n.aJ(R,c.u_aspect_ratio),u_fade_change:new n.aJ(R,c.u_fade_change),u_matrix:new n.aK(R,c.u_matrix),u_label_plane_matrix:new n.aK(R,c.u_label_plane_matrix),u_coord_matrix:new n.aK(R,c.u_coord_matrix),u_is_text:new n.aI(R,c.u_is_text),u_pitch_with_map:new n.aI(R,c.u_pitch_with_map),u_is_along_line:new n.aI(R,c.u_is_along_line),u_is_variable_anchor:new n.aI(R,c.u_is_variable_anchor),u_texsize:new n.aP(R,c.u_texsize),u_texture:new n.aI(R,c.u_texture),u_gamma_scale:new n.aJ(R,c.u_gamma_scale),u_device_pixel_ratio:new n.aJ(R,c.u_device_pixel_ratio),u_is_halo:new n.aI(R,c.u_is_halo),u_translation:new n.aP(R,c.u_translation),u_pitched_scale:new n.aJ(R,c.u_pitched_scale)}),symbolTextAndIcon:(R,c)=>({u_is_size_zoom_constant:new n.aI(R,c.u_is_size_zoom_constant),u_is_size_feature_constant:new n.aI(R,c.u_is_size_feature_constant),u_size_t:new n.aJ(R,c.u_size_t),u_size:new n.aJ(R,c.u_size),u_camera_to_center_distance:new n.aJ(R,c.u_camera_to_center_distance),u_pitch:new n.aJ(R,c.u_pitch),u_rotate_symbol:new n.aI(R,c.u_rotate_symbol),u_aspect_ratio:new n.aJ(R,c.u_aspect_ratio),u_fade_change:new n.aJ(R,c.u_fade_change),u_matrix:new n.aK(R,c.u_matrix),u_label_plane_matrix:new n.aK(R,c.u_label_plane_matrix),u_coord_matrix:new n.aK(R,c.u_coord_matrix),u_is_text:new n.aI(R,c.u_is_text),u_pitch_with_map:new n.aI(R,c.u_pitch_with_map),u_is_along_line:new n.aI(R,c.u_is_along_line),u_is_variable_anchor:new n.aI(R,c.u_is_variable_anchor),u_texsize:new n.aP(R,c.u_texsize),u_texsize_icon:new n.aP(R,c.u_texsize_icon),u_texture:new n.aI(R,c.u_texture),u_texture_icon:new n.aI(R,c.u_texture_icon),u_gamma_scale:new n.aJ(R,c.u_gamma_scale),u_device_pixel_ratio:new n.aJ(R,c.u_device_pixel_ratio),u_is_halo:new n.aI(R,c.u_is_halo),u_translation:new n.aP(R,c.u_translation),u_pitched_scale:new n.aJ(R,c.u_pitched_scale)}),background:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_opacity:new n.aJ(R,c.u_opacity),u_color:new n.aM(R,c.u_color)}),backgroundPattern:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_opacity:new n.aJ(R,c.u_opacity),u_image:new n.aI(R,c.u_image),u_pattern_tl_a:new n.aP(R,c.u_pattern_tl_a),u_pattern_br_a:new n.aP(R,c.u_pattern_br_a),u_pattern_tl_b:new n.aP(R,c.u_pattern_tl_b),u_pattern_br_b:new n.aP(R,c.u_pattern_br_b),u_texsize:new n.aP(R,c.u_texsize),u_mix:new n.aJ(R,c.u_mix),u_pattern_size_a:new n.aP(R,c.u_pattern_size_a),u_pattern_size_b:new n.aP(R,c.u_pattern_size_b),u_scale_a:new n.aJ(R,c.u_scale_a),u_scale_b:new n.aJ(R,c.u_scale_b),u_pixel_coord_upper:new n.aP(R,c.u_pixel_coord_upper),u_pixel_coord_lower:new n.aP(R,c.u_pixel_coord_lower),u_tile_units_to_pixels:new n.aJ(R,c.u_tile_units_to_pixels)}),terrain:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_texture:new n.aI(R,c.u_texture),u_ele_delta:new n.aJ(R,c.u_ele_delta),u_fog_matrix:new n.aK(R,c.u_fog_matrix),u_fog_color:new n.aM(R,c.u_fog_color),u_fog_ground_blend:new n.aJ(R,c.u_fog_ground_blend),u_fog_ground_blend_opacity:new n.aJ(R,c.u_fog_ground_blend_opacity),u_horizon_color:new n.aM(R,c.u_horizon_color),u_horizon_fog_blend:new n.aJ(R,c.u_horizon_fog_blend)}),terrainDepth:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_ele_delta:new n.aJ(R,c.u_ele_delta)}),terrainCoords:(R,c)=>({u_matrix:new n.aK(R,c.u_matrix),u_texture:new n.aI(R,c.u_texture),u_terrain_coords_id:new n.aJ(R,c.u_terrain_coords_id),u_ele_delta:new n.aJ(R,c.u_ele_delta)}),sky:(R,c)=>({u_sky_color:new n.aM(R,c.u_sky_color),u_horizon_color:new n.aM(R,c.u_horizon_color),u_horizon:new n.aJ(R,c.u_horizon),u_sky_horizon_blend:new n.aJ(R,c.u_sky_horizon_blend)})};class Oa{constructor(c,p,F){this.context=c;const j=c.gl;this.buffer=j.createBuffer(),this.dynamicDraw=!!F,this.context.unbindVAO(),c.bindElementBuffer.set(this.buffer),j.bufferData(j.ELEMENT_ARRAY_BUFFER,p.arrayBuffer,this.dynamicDraw?j.DYNAMIC_DRAW:j.STATIC_DRAW),this.dynamicDraw||delete p.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(c){const p=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),p.bufferSubData(p.ELEMENT_ARRAY_BUFFER,0,c.arrayBuffer)}destroy(){const c=this.context.gl;this.buffer&&(c.deleteBuffer(this.buffer),delete this.buffer)}}const Ha={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class ur{constructor(c,p,F,j){this.length=p.length,this.attributes=F,this.itemSize=p.bytesPerElement,this.dynamicDraw=j,this.context=c;const q=c.gl;this.buffer=q.createBuffer(),c.bindVertexBuffer.set(this.buffer),q.bufferData(q.ARRAY_BUFFER,p.arrayBuffer,this.dynamicDraw?q.DYNAMIC_DRAW:q.STATIC_DRAW),this.dynamicDraw||delete p.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(c){if(c.length!==this.length)throw new Error(`Length of new data is ${c.length}, which doesn't match current length of ${this.length}`);const p=this.context.gl;this.bind(),p.bufferSubData(p.ARRAY_BUFFER,0,c.arrayBuffer)}enableAttributes(c,p){for(let F=0;F<this.attributes.length;F++){const j=this.attributes[F],q=p.attributes[j.name];q!==void 0&&c.enableVertexAttribArray(q)}}setVertexAttribPointers(c,p,F){for(let j=0;j<this.attributes.length;j++){const q=this.attributes[j],ie=p.attributes[q.name];ie!==void 0&&c.vertexAttribPointer(ie,q.components,c[Ha[q.type]],!1,this.itemSize,q.offset+this.itemSize*(F||0))}}destroy(){const c=this.context.gl;this.buffer&&(c.deleteBuffer(this.buffer),delete this.buffer)}}const kr=new WeakMap;function mi(R){var c;if(kr.has(R))return kr.get(R);{const p=(c=R.getParameter(R.VERSION))===null||c===void 0?void 0:c.startsWith("WebGL 2.0");return kr.set(R,p),p}}class xr{constructor(c){this.gl=c.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(c){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class oo extends xr{getDefault(){return n.aN.transparent}set(c){const p=this.current;(c.r!==p.r||c.g!==p.g||c.b!==p.b||c.a!==p.a||this.dirty)&&(this.gl.clearColor(c.r,c.g,c.b,c.a),this.current=c,this.dirty=!1)}}class ki extends xr{getDefault(){return 1}set(c){(c!==this.current||this.dirty)&&(this.gl.clearDepth(c),this.current=c,this.dirty=!1)}}class Ui extends xr{getDefault(){return 0}set(c){(c!==this.current||this.dirty)&&(this.gl.clearStencil(c),this.current=c,this.dirty=!1)}}class Do extends xr{getDefault(){return[!0,!0,!0,!0]}set(c){const p=this.current;(c[0]!==p[0]||c[1]!==p[1]||c[2]!==p[2]||c[3]!==p[3]||this.dirty)&&(this.gl.colorMask(c[0],c[1],c[2],c[3]),this.current=c,this.dirty=!1)}}class ai extends xr{getDefault(){return!0}set(c){(c!==this.current||this.dirty)&&(this.gl.depthMask(c),this.current=c,this.dirty=!1)}}class si extends xr{getDefault(){return 255}set(c){(c!==this.current||this.dirty)&&(this.gl.stencilMask(c),this.current=c,this.dirty=!1)}}class Jo extends xr{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(c){const p=this.current;(c.func!==p.func||c.ref!==p.ref||c.mask!==p.mask||this.dirty)&&(this.gl.stencilFunc(c.func,c.ref,c.mask),this.current=c,this.dirty=!1)}}class fo extends xr{getDefault(){const c=this.gl;return[c.KEEP,c.KEEP,c.KEEP]}set(c){const p=this.current;(c[0]!==p[0]||c[1]!==p[1]||c[2]!==p[2]||this.dirty)&&(this.gl.stencilOp(c[0],c[1],c[2]),this.current=c,this.dirty=!1)}}class Vo extends xr{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;c?p.enable(p.STENCIL_TEST):p.disable(p.STENCIL_TEST),this.current=c,this.dirty=!1}}class os extends xr{getDefault(){return[0,1]}set(c){const p=this.current;(c[0]!==p[0]||c[1]!==p[1]||this.dirty)&&(this.gl.depthRange(c[0],c[1]),this.current=c,this.dirty=!1)}}class Mo extends xr{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;c?p.enable(p.DEPTH_TEST):p.disable(p.DEPTH_TEST),this.current=c,this.dirty=!1}}class Tl extends xr{getDefault(){return this.gl.LESS}set(c){(c!==this.current||this.dirty)&&(this.gl.depthFunc(c),this.current=c,this.dirty=!1)}}class Cl extends xr{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;c?p.enable(p.BLEND):p.disable(p.BLEND),this.current=c,this.dirty=!1}}class El extends xr{getDefault(){const c=this.gl;return[c.ONE,c.ZERO]}set(c){const p=this.current;(c[0]!==p[0]||c[1]!==p[1]||this.dirty)&&(this.gl.blendFunc(c[0],c[1]),this.current=c,this.dirty=!1)}}class Ro extends xr{getDefault(){return n.aN.transparent}set(c){const p=this.current;(c.r!==p.r||c.g!==p.g||c.b!==p.b||c.a!==p.a||this.dirty)&&(this.gl.blendColor(c.r,c.g,c.b,c.a),this.current=c,this.dirty=!1)}}class qs extends xr{getDefault(){return this.gl.FUNC_ADD}set(c){(c!==this.current||this.dirty)&&(this.gl.blendEquation(c),this.current=c,this.dirty=!1)}}class ms extends xr{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;c?p.enable(p.CULL_FACE):p.disable(p.CULL_FACE),this.current=c,this.dirty=!1}}class Si extends xr{getDefault(){return this.gl.BACK}set(c){(c!==this.current||this.dirty)&&(this.gl.cullFace(c),this.current=c,this.dirty=!1)}}class Xi extends xr{getDefault(){return this.gl.CCW}set(c){(c!==this.current||this.dirty)&&(this.gl.frontFace(c),this.current=c,this.dirty=!1)}}class Al extends xr{getDefault(){return null}set(c){(c!==this.current||this.dirty)&&(this.gl.useProgram(c),this.current=c,this.dirty=!1)}}class Ys extends xr{getDefault(){return this.gl.TEXTURE0}set(c){(c!==this.current||this.dirty)&&(this.gl.activeTexture(c),this.current=c,this.dirty=!1)}}class Ls extends xr{getDefault(){const c=this.gl;return[0,0,c.drawingBufferWidth,c.drawingBufferHeight]}set(c){const p=this.current;(c[0]!==p[0]||c[1]!==p[1]||c[2]!==p[2]||c[3]!==p[3]||this.dirty)&&(this.gl.viewport(c[0],c[1],c[2],c[3]),this.current=c,this.dirty=!1)}}class Ml extends xr{getDefault(){return null}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;p.bindFramebuffer(p.FRAMEBUFFER,c),this.current=c,this.dirty=!1}}class zs extends xr{getDefault(){return null}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;p.bindRenderbuffer(p.RENDERBUFFER,c),this.current=c,this.dirty=!1}}class Il extends xr{getDefault(){return null}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;p.bindTexture(p.TEXTURE_2D,c),this.current=c,this.dirty=!1}}class Pl extends xr{getDefault(){return null}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;p.bindBuffer(p.ARRAY_BUFFER,c),this.current=c,this.dirty=!1}}class Zs extends xr{getDefault(){return null}set(c){const p=this.gl;p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,c),this.current=c,this.dirty=!1}}class ko extends xr{getDefault(){return null}set(c){var p;if(c===this.current&&!this.dirty)return;const F=this.gl;mi(F)?F.bindVertexArray(c):(p=F.getExtension("OES_vertex_array_object"))===null||p===void 0||p.bindVertexArrayOES(c),this.current=c,this.dirty=!1}}class Uc extends xr{getDefault(){return 4}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;p.pixelStorei(p.UNPACK_ALIGNMENT,c),this.current=c,this.dirty=!1}}class Pc extends xr{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,c),this.current=c,this.dirty=!1}}class Wl extends xr{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;const p=this.gl;p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,c),this.current=c,this.dirty=!1}}class Gc extends xr{constructor(c,p){super(c),this.context=c,this.parent=p}getDefault(){return null}}class Qc extends Gc{setDirty(){this.dirty=!0}set(c){if(c===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const p=this.gl;p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,p.TEXTURE_2D,c,0),this.current=c,this.dirty=!1}}class gs extends Gc{set(c){if(c===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const p=this.gl;p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_ATTACHMENT,p.RENDERBUFFER,c),this.current=c,this.dirty=!1}}class eu extends Gc{set(c){if(c===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const p=this.gl;p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_STENCIL_ATTACHMENT,p.RENDERBUFFER,c),this.current=c,this.dirty=!1}}class Pu{constructor(c,p,F,j,q){this.context=c,this.width=p,this.height=F;const ie=c.gl,pe=this.framebuffer=ie.createFramebuffer();if(this.colorAttachment=new Qc(c,pe),j)this.depthAttachment=q?new eu(c,pe):new gs(c,pe);else if(q)throw new Error("Stencil cannot be set without depth");if(ie.checkFramebufferStatus(ie.FRAMEBUFFER)!==ie.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){const c=this.context.gl,p=this.colorAttachment.get();if(p&&c.deleteTexture(p),this.depthAttachment){const F=this.depthAttachment.get();F&&c.deleteRenderbuffer(F)}c.deleteFramebuffer(this.framebuffer)}}class Ki{constructor(c,p,F){this.blendFunction=c,this.blendColor=p,this.mask=F}}Ki.Replace=[1,0],Ki.disabled=new Ki(Ki.Replace,n.aN.transparent,[!1,!1,!1,!1]),Ki.unblended=new Ki(Ki.Replace,n.aN.transparent,[!0,!0,!0,!0]),Ki.alphaBlended=new Ki([1,771],n.aN.transparent,[!0,!0,!0,!0]);class bc{constructor(c){var p,F;if(this.gl=c,this.clearColor=new oo(this),this.clearDepth=new ki(this),this.clearStencil=new Ui(this),this.colorMask=new Do(this),this.depthMask=new ai(this),this.stencilMask=new si(this),this.stencilFunc=new Jo(this),this.stencilOp=new fo(this),this.stencilTest=new Vo(this),this.depthRange=new os(this),this.depthTest=new Mo(this),this.depthFunc=new Tl(this),this.blend=new Cl(this),this.blendFunc=new El(this),this.blendColor=new Ro(this),this.blendEquation=new qs(this),this.cullFace=new ms(this),this.cullFaceSide=new Si(this),this.frontFace=new Xi(this),this.program=new Al(this),this.activeTexture=new Ys(this),this.viewport=new Ls(this),this.bindFramebuffer=new Ml(this),this.bindRenderbuffer=new zs(this),this.bindTexture=new Il(this),this.bindVertexBuffer=new Pl(this),this.bindElementBuffer=new Zs(this),this.bindVertexArray=new ko(this),this.pixelStoreUnpack=new Uc(this),this.pixelStoreUnpackPremultiplyAlpha=new Pc(this),this.pixelStoreUnpackFlipY=new Wl(this),this.extTextureFilterAnisotropic=c.getExtension("EXT_texture_filter_anisotropic")||c.getExtension("MOZ_EXT_texture_filter_anisotropic")||c.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=c.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=c.getParameter(c.MAX_TEXTURE_SIZE),mi(c)){this.HALF_FLOAT=c.HALF_FLOAT;const j=c.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(p=c.RGBA16F)!==null&&p!==void 0?p:j==null?void 0:j.RGBA16F_EXT,this.RGB16F=(F=c.RGB16F)!==null&&F!==void 0?F:j==null?void 0:j.RGB16F_EXT,c.getExtension("EXT_color_buffer_float")}else{c.getExtension("EXT_color_buffer_half_float"),c.getExtension("OES_texture_half_float_linear");const j=c.getExtension("OES_texture_half_float");this.HALF_FLOAT=j==null?void 0:j.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(c,p){return new Oa(this,c,p)}createVertexBuffer(c,p,F){return new ur(this,c,p,F)}createRenderbuffer(c,p,F){const j=this.gl,q=j.createRenderbuffer();return this.bindRenderbuffer.set(q),j.renderbufferStorage(j.RENDERBUFFER,c,p,F),this.bindRenderbuffer.set(null),q}createFramebuffer(c,p,F,j){return new Pu(this,c,p,F,j)}clear({color:c,depth:p,stencil:F}){const j=this.gl;let q=0;c&&(q|=j.COLOR_BUFFER_BIT,this.clearColor.set(c),this.colorMask.set([!0,!0,!0,!0])),p!==void 0&&(q|=j.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(p),this.depthMask.set(!0)),F!==void 0&&(q|=j.STENCIL_BUFFER_BIT,this.clearStencil.set(F),this.stencilMask.set(255)),j.clear(q)}setCullFace(c){c.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(c.mode),this.frontFace.set(c.frontFace))}setDepthMode(c){c.func!==this.gl.ALWAYS||c.mask?(this.depthTest.set(!0),this.depthFunc.set(c.func),this.depthMask.set(c.mask),this.depthRange.set(c.range)):this.depthTest.set(!1)}setStencilMode(c){c.test.func!==this.gl.ALWAYS||c.mask?(this.stencilTest.set(!0),this.stencilMask.set(c.mask),this.stencilOp.set([c.fail,c.depthFail,c.pass]),this.stencilFunc.set({func:c.test.func,ref:c.ref,mask:c.test.mask})):this.stencilTest.set(!1)}setColorMode(c){n.aF(c.blendFunction,Ki.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(c.blendFunction),this.blendColor.set(c.blendColor)),this.colorMask.set(c.mask)}createVertexArray(){var c;return mi(this.gl)?this.gl.createVertexArray():(c=this.gl.getExtension("OES_vertex_array_object"))===null||c===void 0?void 0:c.createVertexArrayOES()}deleteVertexArray(c){var p;return mi(this.gl)?this.gl.deleteVertexArray(c):(p=this.gl.getExtension("OES_vertex_array_object"))===null||p===void 0?void 0:p.deleteVertexArrayOES(c)}unbindVAO(){this.bindVertexArray.set(null)}}class Yr{constructor(c,p,F){this.func=c,this.mask=p,this.range=F}}Yr.ReadOnly=!1,Yr.ReadWrite=!0,Yr.disabled=new Yr(519,Yr.ReadOnly,[0,1]);const ql=7680;class bi{constructor(c,p,F,j,q,ie){this.test=c,this.ref=p,this.mask=F,this.fail=j,this.depthFail=q,this.pass=ie}}bi.disabled=new bi({func:519,mask:0},0,0,ql,ql,ql);class xi{constructor(c,p,F){this.enable=c,this.mode=p,this.frontFace=F}}let ys;function Ko(R,c,p,F,j){const q=R.context,ie=q.gl,pe=R.useProgram("collisionBox"),be=[];let Ae=0,Fe=0;for(let At=0;At<F.length;At++){const Tt=F[At],Rt=c.getTile(Tt).getBucket(p);if(!Rt)continue;const Et=j?Rt.textCollisionBox:Rt.iconCollisionBox,Yt=Rt.collisionCircleArray;if(Yt.length>0){const Kt=n.H();n.aR(Kt,Rt.placementInvProjMatrix,R.transform.glCoordMatrix),n.aR(Kt,Kt,Rt.placementViewportMatrix),be.push({circleArray:Yt,circleOffset:Fe,transform:Tt.posMatrix,invTransform:Kt,coord:Tt}),Ae+=Yt.length/4,Fe=Ae}Et&&pe.draw(q,ie.LINES,Yr.disabled,bi.disabled,R.colorModeForRenderPass(),xi.disabled,tn(R.transform,Tt.posMatrix),R.style.map.terrain&&R.style.map.terrain.getTerrainData(Tt),p.id,Et.layoutVertexBuffer,Et.indexBuffer,Et.segments,null,R.transform.zoom,null,null,Et.collisionVertexBuffer)}if(!j||!be.length)return;const Ge=R.useProgram("collisionCircle"),at=new n.aS;at.resize(4*Ae),at._trim();let ct=0;for(const At of be)for(let Tt=0;Tt<At.circleArray.length/4;Tt++){const Rt=4*Tt,Et=At.circleArray[Rt+0],Yt=At.circleArray[Rt+1],Kt=At.circleArray[Rt+2],Zt=At.circleArray[Rt+3];at.emplace(ct++,Et,Yt,Kt,Zt,0),at.emplace(ct++,Et,Yt,Kt,Zt,1),at.emplace(ct++,Et,Yt,Kt,Zt,2),at.emplace(ct++,Et,Yt,Kt,Zt,3)}(!ys||ys.length<2*Ae)&&(ys=function(At){const Tt=2*At,Rt=new n.aU;Rt.resize(Tt),Rt._trim();for(let Et=0;Et<Tt;Et++){const Yt=6*Et;Rt.uint16[Yt+0]=4*Et+0,Rt.uint16[Yt+1]=4*Et+1,Rt.uint16[Yt+2]=4*Et+2,Rt.uint16[Yt+3]=4*Et+2,Rt.uint16[Yt+4]=4*Et+3,Rt.uint16[Yt+5]=4*Et+0}return Rt}(Ae));const pt=q.createIndexBuffer(ys,!0),xt=q.createVertexBuffer(at,n.aT.members,!0);for(const At of be){const Tt=un(At.transform,At.invTransform,R.transform);Ge.draw(q,ie.TRIANGLES,Yr.disabled,bi.disabled,R.colorModeForRenderPass(),xi.disabled,Tt,R.style.map.terrain&&R.style.map.terrain.getTerrainData(At.coord),p.id,xt,pt,n.a0.simpleSegment(0,2*At.circleOffset,At.circleArray.length,At.circleArray.length/2),null,R.transform.zoom,null,null,null)}xt.destroy(),pt.destroy()}xi.disabled=new xi(!1,1029,2305),xi.backCCW=new xi(!0,1029,2305);const xc=n.ao(new Float32Array(16));function Bl(R,c,p,F,j){if(R.renderPass!=="translucent")return;const q=bi.disabled,ie=R.colorModeForRenderPass();(p._unevaluatedLayout.hasValue("text-variable-anchor")||p._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(pe,be,Ae,Fe,Ge,at,ct,pt,xt){const At=be.transform,Tt=Bn(),Rt=Ge==="map",Et=at==="map";for(const Yt of pe){const Kt=Fe.getTile(Yt),Zt=Kt.getBucket(Ae);if(!Zt||!Zt.text||!Zt.text.segments.get().length)continue;const hn=Zt.textSizeData,xn=n.ah(hn,At.zoom),Nn=St(Kt,1,be.transform.zoom),Dn=Vt(Yt.posMatrix,Et,Rt,be.transform,Nn),Gn=Ae.layout.get("icon-text-fit")!=="none"&&Zt.hasIconData();if(xn){const Kn=Math.pow(2,At.zoom-Kt.tileID.overscaledZ),ya=be.style.map.terrain?(wa,ia)=>be.style.map.terrain.getElevation(Yt,wa,ia):null,ea=Tt.translatePosition(At,Kt,ct,pt);mo(Zt,Rt,Et,xt,At,Dn,Yt.posMatrix,Kn,xn,Gn,Tt,ea,Yt.toUnwrapped(),ya)}}}(F,R,p,c,p.layout.get("text-rotation-alignment"),p.layout.get("text-pitch-alignment"),p.paint.get("text-translate"),p.paint.get("text-translate-anchor"),j),p.paint.get("icon-opacity").constantOr(1)!==0&&ic(R,c,p,F,!1,p.paint.get("icon-translate"),p.paint.get("icon-translate-anchor"),p.layout.get("icon-rotation-alignment"),p.layout.get("icon-pitch-alignment"),p.layout.get("icon-keep-upright"),q,ie),p.paint.get("text-opacity").constantOr(1)!==0&&ic(R,c,p,F,!0,p.paint.get("text-translate"),p.paint.get("text-translate-anchor"),p.layout.get("text-rotation-alignment"),p.layout.get("text-pitch-alignment"),p.layout.get("text-keep-upright"),q,ie),c.map.showCollisionBoxes&&(Ko(R,c,p,F,!0),Ko(R,c,p,F,!1))}function Qo(R,c,p,F,j,q){const{horizontalAlign:ie,verticalAlign:pe}=n.av(R),be=-(ie-.5)*c,Ae=-(pe-.5)*p;return new n.P((be/j+F[0])*q,(Ae/j+F[1])*q)}function ss(R,c,p,F,j,q){const ie=c.tileAnchorPoint.add(new n.P(c.translation[0],c.translation[1]));if(c.pitchWithMap){let pe=F.mult(q);return p||(pe=pe.rotate(-j)),Ut(ie.add(pe),c.labelPlaneMatrix,c.getElevation).point}if(p){const pe=Ye(c.tileAnchorPoint.x+1,c.tileAnchorPoint.y,c).point.sub(R),be=Math.atan(pe.y/pe.x)+(pe.x<0?Math.PI:0);return R.add(F.rotate(be))}return R.add(F)}function mo(R,c,p,F,j,q,ie,pe,be,Ae,Fe,Ge,at,ct){const pt=R.text.placedSymbolArray,xt=R.text.dynamicLayoutVertexArray,At=R.icon.dynamicLayoutVertexArray,Tt={};xt.clear();for(let Rt=0;Rt<pt.length;Rt++){const Et=pt.get(Rt),Yt=R.allowVerticalPlacement&&!Et.placedOrientation,Kt=Et.hidden||!Et.crossTileID||Yt?null:F[Et.crossTileID];if(Kt){const Zt=new n.P(Et.anchorX,Et.anchorY),hn={getElevation:ct,width:j.width,height:j.height,labelPlaneMatrix:q,pitchWithMap:p,projection:Fe,tileAnchorPoint:Zt,translation:Ge,unwrappedTileID:at},xn=p?Ut(Zt,ie,ct):Ye(Zt.x,Zt.y,hn),Nn=ot(j.cameraToCenterDistance,xn.signedDistanceFromCamera);let Dn=n.aj(R.textSizeData,be,Et)*Nn/n.aq;p&&(Dn*=R.tilePixelRatio/pe);const{width:Gn,height:Kn,anchor:ya,textOffset:ea,textBoxScale:wa}=Kt,ia=Qo(ya,Gn,Kn,ea,wa,Dn),Ta=Fe.getPitchedTextCorrection(j,Zt.add(new n.P(Ge[0],Ge[1])),at),fa=ss(xn.point,hn,c,ia,j.angle,Ta),Ia=R.allowVerticalPlacement&&Et.placedOrientation===n.ai.vertical?Math.PI/2:0;for(let qa=0;qa<Et.numGlyphs;qa++)n.ak(xt,fa,Ia);Ae&&Et.associatedIconIndex>=0&&(Tt[Et.associatedIconIndex]={shiftedAnchor:fa,angle:Ia})}else Dt(Et.numGlyphs,xt)}if(Ae){At.clear();const Rt=R.icon.placedSymbolArray;for(let Et=0;Et<Rt.length;Et++){const Yt=Rt.get(Et);if(Yt.hidden)Dt(Yt.numGlyphs,At);else{const Kt=Tt[Et];if(Kt)for(let Zt=0;Zt<Yt.numGlyphs;Zt++)n.ak(At,Kt.shiftedAnchor,Kt.angle);else Dt(Yt.numGlyphs,At)}}R.icon.dynamicLayoutVertexBuffer.updateData(At)}R.text.dynamicLayoutVertexBuffer.updateData(xt)}function ei(R,c,p){return p.iconsInText&&c?"symbolTextAndIcon":R?"symbolSDF":"symbolIcon"}function ic(R,c,p,F,j,q,ie,pe,be,Ae,Fe,Ge){const at=R.context,ct=at.gl,pt=R.transform,xt=Bn(),At=pe==="map",Tt=be==="map",Rt=pe!=="viewport"&&p.layout.get("symbol-placement")!=="point",Et=At&&!Tt&&!Rt,Yt=!Tt&&Rt,Kt=!p.layout.get("symbol-sort-key").isConstant();let Zt=!1;const hn=R.depthModeForSublayer(0,Yr.ReadOnly),xn=p._unevaluatedLayout.hasValue("text-variable-anchor")||p._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Nn=[],Dn=xt.getCircleRadiusCorrection(pt);for(const Gn of F){const Kn=c.getTile(Gn),ya=Kn.getBucket(p);if(!ya)continue;const ea=j?ya.text:ya.icon;if(!ea||!ea.segments.get().length||!ea.hasVisibleVertices)continue;const wa=ea.programConfigurations.get(p.id),ia=j||ya.sdfIcons,Ta=j?ya.textSizeData:ya.iconSizeData,fa=Tt||pt.pitch!==0,Ia=R.useProgram(ei(ia,j,ya),wa),qa=n.ah(Ta,pt.zoom),Ma=R.style.map.terrain&&R.style.map.terrain.getTerrainData(Gn);let Ga,nr,zr,yr,Gr=[0,0],$r=null;if(j){if(nr=Kn.glyphAtlasTexture,zr=ct.LINEAR,Ga=Kn.glyphAtlasTexture.size,ya.iconsInText){Gr=Kn.imageAtlasTexture.size,$r=Kn.imageAtlasTexture;const Or=Ta.kind==="composite"||Ta.kind==="camera";yr=fa||R.options.rotating||R.options.zooming||Or?ct.LINEAR:ct.NEAREST}}else{const Or=p.layout.get("icon-size").constantOr(0)!==1||ya.iconsNeedLinear;nr=Kn.imageAtlasTexture,zr=ia||R.options.rotating||R.options.zooming||Or||fa?ct.LINEAR:ct.NEAREST,Ga=Kn.imageAtlasTexture.size}const Zr=St(Kn,1,R.transform.zoom),oi=Yt?Gn.posMatrix:xc,Ri=Vt(oi,Tt,At,R.transform,Zr),Li=$t(oi,Tt,At,R.transform,Zr),no=$t(Gn.posMatrix,Tt,At,R.transform,Zr),ci=xt.translatePosition(R.transform,Kn,q,ie),Jr=xn&&ya.hasTextData(),Ei=p.layout.get("icon-text-fit")!=="none"&&Jr&&ya.hasIconData();if(Rt){const Or=R.style.map.terrain?(Zi,us)=>R.style.map.terrain.getElevation(Gn,Zi,us):null,_o=p.layout.get("text-rotation-alignment")==="map";ht(ya,Gn.posMatrix,R,j,Ri,no,Tt,Ae,_o,xt,Gn.toUnwrapped(),pt.width,pt.height,ci,Or)}const pi=Gn.posMatrix,ni=j&&xn||Ei,ui=Rt||ni?xc:Ri,_i=Li,Kr=ia&&p.paint.get(j?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let As;As=ia?ya.iconsInText?Ca(Ta.kind,qa,Et,Tt,Rt,ni,R,pi,ui,_i,ci,Ga,Gr,Dn):xa(Ta.kind,qa,Et,Tt,Rt,ni,R,pi,ui,_i,ci,j,Ga,!0,Dn):Ba(Ta.kind,qa,Et,Tt,Rt,ni,R,pi,ui,_i,ci,j,Ga,Dn);const Gi={program:Ia,buffers:ea,uniformValues:As,atlasTexture:nr,atlasTextureIcon:$r,atlasInterpolation:zr,atlasInterpolationIcon:yr,isSDF:ia,hasHalo:Kr};if(Kt&&ya.canOverlap){Zt=!0;const Or=ea.segments.get();for(const _o of Or)Nn.push({segments:new n.a0([_o]),sortKey:_o.sortKey,state:Gi,terrainData:Ma})}else Nn.push({segments:ea.segments,sortKey:0,state:Gi,terrainData:Ma})}Zt&&Nn.sort((Gn,Kn)=>Gn.sortKey-Kn.sortKey);for(const Gn of Nn){const Kn=Gn.state;if(at.activeTexture.set(ct.TEXTURE0),Kn.atlasTexture.bind(Kn.atlasInterpolation,ct.CLAMP_TO_EDGE),Kn.atlasTextureIcon&&(at.activeTexture.set(ct.TEXTURE1),Kn.atlasTextureIcon&&Kn.atlasTextureIcon.bind(Kn.atlasInterpolationIcon,ct.CLAMP_TO_EDGE)),Kn.isSDF){const ya=Kn.uniformValues;Kn.hasHalo&&(ya.u_is_halo=1,tu(Kn.buffers,Gn.segments,p,R,Kn.program,hn,Fe,Ge,ya,Gn.terrainData)),ya.u_is_halo=0}tu(Kn.buffers,Gn.segments,p,R,Kn.program,hn,Fe,Ge,Kn.uniformValues,Gn.terrainData)}}function tu(R,c,p,F,j,q,ie,pe,be,Ae){const Fe=F.context,Ge=Fe.gl;j.draw(Fe,Ge.TRIANGLES,q,ie,pe,xi.disabled,be,Ae,p.id,R.layoutVertexBuffer,R.indexBuffer,c,p.paint,F.transform.zoom,R.programConfigurations.get(p.id),R.dynamicLayoutVertexBuffer,R.opacityVertexBuffer)}function Ll(R,c,p,F){if(p.paint.get("heatmap-opacity")!==0)if(R.renderPass==="offscreen"){const j=R.context,q=j.gl,ie=bi.disabled,pe=new Ki([q.ONE,q.ONE],n.aN.transparent,[!0,!0,!0,!0]);(function(be,Ae,Fe){const Ge=be.gl;be.activeTexture.set(Ge.TEXTURE1),be.viewport.set([0,0,Ae.width/4,Ae.height/4]);let at=Fe.heatmapFbo;if(at)Ge.bindTexture(Ge.TEXTURE_2D,at.colorAttachment.get()),be.bindFramebuffer.set(at.framebuffer);else{const ct=Ge.createTexture();Ge.bindTexture(Ge.TEXTURE_2D,ct),Ge.texParameteri(Ge.TEXTURE_2D,Ge.TEXTURE_WRAP_S,Ge.CLAMP_TO_EDGE),Ge.texParameteri(Ge.TEXTURE_2D,Ge.TEXTURE_WRAP_T,Ge.CLAMP_TO_EDGE),Ge.texParameteri(Ge.TEXTURE_2D,Ge.TEXTURE_MIN_FILTER,Ge.LINEAR),Ge.texParameteri(Ge.TEXTURE_2D,Ge.TEXTURE_MAG_FILTER,Ge.LINEAR),at=Fe.heatmapFbo=be.createFramebuffer(Ae.width/4,Ae.height/4,!1,!1),function(pt,xt,At,Tt){var Rt,Et;const Yt=pt.gl,Kt=(Rt=pt.HALF_FLOAT)!==null&&Rt!==void 0?Rt:Yt.UNSIGNED_BYTE,Zt=(Et=pt.RGBA16F)!==null&&Et!==void 0?Et:Yt.RGBA;Yt.texImage2D(Yt.TEXTURE_2D,0,Zt,xt.width/4,xt.height/4,0,Yt.RGBA,Kt,null),Tt.colorAttachment.set(At)}(be,Ae,ct,at)}})(j,R,p),j.clear({color:n.aN.transparent});for(let be=0;be<F.length;be++){const Ae=F[be];if(c.hasRenderableParent(Ae))continue;const Fe=c.getTile(Ae),Ge=Fe.getBucket(p);if(!Ge)continue;const at=Ge.programConfigurations.get(p.id),ct=R.useProgram("heatmap",at),{zoom:pt}=R.transform;ct.draw(j,q.TRIANGLES,Yr.disabled,ie,pe,xi.disabled,On(Ae.posMatrix,Fe,pt,p.paint.get("heatmap-intensity")),null,p.id,Ge.layoutVertexBuffer,Ge.indexBuffer,Ge.segments,p.paint,R.transform.zoom,at)}j.viewport.set([0,0,R.width,R.height])}else R.renderPass==="translucent"&&(R.context.setColorMode(R.colorModeForRenderPass()),function(j,q){const ie=j.context,pe=ie.gl,be=q.heatmapFbo;if(!be)return;ie.activeTexture.set(pe.TEXTURE0),pe.bindTexture(pe.TEXTURE_2D,be.colorAttachment.get()),ie.activeTexture.set(pe.TEXTURE1);let Ae=q.colorRampTexture;Ae||(Ae=q.colorRampTexture=new L(ie,q.colorRamp,pe.RGBA)),Ae.bind(pe.LINEAR,pe.CLAMP_TO_EDGE),j.useProgram("heatmapTexture").draw(ie,pe.TRIANGLES,Yr.disabled,bi.disabled,j.colorModeForRenderPass(),xi.disabled,Yn(j,q,0,1),null,q.id,j.viewportBuffer,j.quadTriangleIndexBuffer,j.viewportSegments,q.paint,j.transform.zoom)}(R,p))}function zl(R,c,p,F,j){if(!p||!F||!F.imageAtlas)return;const q=F.imageAtlas.patternPositions;let ie=q[p.to.toString()],pe=q[p.from.toString()];if(!ie&&pe&&(ie=pe),!pe&&ie&&(pe=ie),!ie||!pe){const be=j.getPaintProperty(c);ie=q[be],pe=q[be]}ie&&pe&&R.setConstantPatternPositions(ie,pe)}function Bc(R,c,p,F,j,q,ie){const pe=R.context.gl,be="fill-pattern",Ae=p.paint.get(be),Fe=Ae&&Ae.constantOr(1),Ge=p.getCrossfadeParameters();let at,ct,pt,xt,At;ie?(ct=Fe&&!p.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",at=pe.LINES):(ct=Fe?"fillPattern":"fill",at=pe.TRIANGLES);const Tt=Ae.constantOr(null);for(const Rt of F){const Et=c.getTile(Rt);if(Fe&&!Et.patternsLoaded())continue;const Yt=Et.getBucket(p);if(!Yt)continue;const Kt=Yt.programConfigurations.get(p.id),Zt=R.useProgram(ct,Kt),hn=R.style.map.terrain&&R.style.map.terrain.getTerrainData(Rt);Fe&&(R.context.activeTexture.set(pe.TEXTURE0),Et.imageAtlasTexture.bind(pe.LINEAR,pe.CLAMP_TO_EDGE),Kt.updatePaintBuffers(Ge)),zl(Kt,be,Tt,Et,p);const xn=hn?Rt:null,Nn=xn?xn.posMatrix:Rt.posMatrix,Dn=R.translatePosMatrix(Nn,Et,p.paint.get("fill-translate"),p.paint.get("fill-translate-anchor"));if(ie){xt=Yt.indexBuffer2,At=Yt.segments2;const Gn=[pe.drawingBufferWidth,pe.drawingBufferHeight];pt=ct==="fillOutlinePattern"&&Fe?gn(Dn,R,Ge,Et,Gn):Ua(Dn,Gn)}else xt=Yt.indexBuffer,At=Yt.segments,pt=Fe?za(Dn,R,Ge,Et):ga(Dn);Zt.draw(R.context,at,j,R.stencilModeForClipping(Rt),q,xi.disabled,pt,hn,p.id,Yt.layoutVertexBuffer,xt,At,p.paint,R.transform.zoom,Kt)}}function wc(R,c,p,F,j,q,ie){const pe=R.context,be=pe.gl,Ae="fill-extrusion-pattern",Fe=p.paint.get(Ae),Ge=Fe.constantOr(1),at=p.getCrossfadeParameters(),ct=p.paint.get("fill-extrusion-opacity"),pt=Fe.constantOr(null);for(const xt of F){const At=c.getTile(xt),Tt=At.getBucket(p);if(!Tt)continue;const Rt=R.style.map.terrain&&R.style.map.terrain.getTerrainData(xt),Et=Tt.programConfigurations.get(p.id),Yt=R.useProgram(Ge?"fillExtrusionPattern":"fillExtrusion",Et);Ge&&(R.context.activeTexture.set(be.TEXTURE0),At.imageAtlasTexture.bind(be.LINEAR,be.CLAMP_TO_EDGE),Et.updatePaintBuffers(at)),zl(Et,Ae,pt,At,p);const Kt=R.translatePosMatrix(xt.posMatrix,At,p.paint.get("fill-extrusion-translate"),p.paint.get("fill-extrusion-translate-anchor")),Zt=p.paint.get("fill-extrusion-vertical-gradient"),hn=Ge?_a(Kt,R,Zt,ct,xt,at,At):aa(Kt,R,Zt,ct);Yt.draw(pe,pe.gl.TRIANGLES,j,q,ie,xi.backCCW,hn,Rt,p.id,Tt.layoutVertexBuffer,Tt.indexBuffer,Tt.segments,p.paint,R.transform.zoom,Et,R.style.map.terrain&&Tt.centroidVertexBuffer)}}function kc(R,c,p,F,j,q,ie){const pe=R.context,be=pe.gl,Ae=p.fbo;if(!Ae)return;const Fe=R.useProgram("hillshade"),Ge=R.style.map.terrain&&R.style.map.terrain.getTerrainData(c);pe.activeTexture.set(be.TEXTURE0),be.bindTexture(be.TEXTURE_2D,Ae.colorAttachment.get());const at=Ge?c:null;Fe.draw(pe,be.TRIANGLES,j,q,ie,xi.disabled,Vn(R,p,F,at),Ge,F.id,R.rasterBoundsBuffer,R.quadTriangleIndexBuffer,R.rasterBoundsSegments)}function hu(R,c,p,F,j,q){const ie=R.context,pe=ie.gl,be=c.dem;if(be&&be.data){const Ae=be.dim,Fe=be.stride,Ge=be.getPixels();if(ie.activeTexture.set(pe.TEXTURE1),ie.pixelStoreUnpackPremultiplyAlpha.set(!1),c.demTexture=c.demTexture||R.getTileTexture(Fe),c.demTexture){const ct=c.demTexture;ct.update(Ge,{premultiply:!1}),ct.bind(pe.NEAREST,pe.CLAMP_TO_EDGE)}else c.demTexture=new L(ie,Ge,pe.RGBA,{premultiply:!1}),c.demTexture.bind(pe.NEAREST,pe.CLAMP_TO_EDGE);ie.activeTexture.set(pe.TEXTURE0);let at=c.fbo;if(!at){const ct=new L(ie,{width:Ae,height:Ae,data:null},pe.RGBA);ct.bind(pe.LINEAR,pe.CLAMP_TO_EDGE),at=c.fbo=ie.createFramebuffer(Ae,Ae,!0,!1),at.colorAttachment.set(ct.texture)}ie.bindFramebuffer.set(at.framebuffer),ie.viewport.set([0,0,Ae,Ae]),R.useProgram("hillshadePrepare").draw(ie,pe.TRIANGLES,F,j,q,xi.disabled,Pn(c.tileID,be),null,p.id,R.rasterBoundsBuffer,R.quadTriangleIndexBuffer,R.rasterBoundsSegments),c.needsHillshadePrepare=!1}}function vs(R,c,p,F,j,q){const ie=F.paint.get("raster-fade-duration");if(!q&&ie>0){const pe=u.now(),be=(pe-R.timeAdded)/ie,Ae=c?(pe-c.timeAdded)/ie:-1,Fe=p.getSource(),Ge=j.coveringZoomLevel({tileSize:Fe.tileSize,roundZoom:Fe.roundZoom}),at=!c||Math.abs(c.tileID.overscaledZ-Ge)>Math.abs(R.tileID.overscaledZ-Ge),ct=at&&R.refreshedUponExpiration?1:n.ad(at?be:1-Ae,0,1);return R.refreshedUponExpiration&&be>=1&&(R.refreshedUponExpiration=!1),c?{opacity:1,mix:1-ct}:{opacity:ct,mix:0}}return{opacity:1,mix:0}}const Os=new n.aN(1,0,0,1),Ol=new n.aN(0,1,0,1),_s=new n.aN(0,0,1,1),ti=new n.aN(1,0,1,1),Hc=new n.aN(0,1,1,1);function Wc(R){const c=R.transform.padding;Lc(R,R.transform.height-(c.top||0),3,Os),Lc(R,c.bottom||0,3,Ol),So(R,c.left||0,3,_s),So(R,R.transform.width-(c.right||0),3,ti);const p=R.transform.centerPoint;(function(F,j,q,ie){Sc(F,j-1,q-10,2,20,ie),Sc(F,j-10,q-1,20,2,ie)})(R,p.x,R.transform.height-p.y,Hc)}function Lc(R,c,p,F){Sc(R,0,c+p/2,R.transform.width,p,F)}function So(R,c,p,F){Sc(R,c-p/2,0,p,R.transform.height,F)}function Sc(R,c,p,F,j,q){const ie=R.context,pe=ie.gl;pe.enable(pe.SCISSOR_TEST),pe.scissor(c*R.pixelRatio,p*R.pixelRatio,F*R.pixelRatio,j*R.pixelRatio),ie.clear({color:q}),pe.disable(pe.SCISSOR_TEST)}function xu(R,c,p){const F=R.context,j=F.gl,q=p.posMatrix,ie=R.useProgram("debug"),pe=Yr.disabled,be=bi.disabled,Ae=R.colorModeForRenderPass(),Fe="$debug",Ge=R.style.map.terrain&&R.style.map.terrain.getTerrainData(p);F.activeTexture.set(j.TEXTURE0);const at=c.getTileByID(p.key).latestRawTileData,ct=at&&at.byteLength||0,pt=Math.floor(ct/1024),xt=c.getTile(p).tileSize,At=512/Math.min(xt,512)*(p.overscaledZ/R.transform.zoom)*.5;let Tt=p.canonical.toString();p.overscaledZ!==p.canonical.z&&(Tt+=` => ${p.overscaledZ}`),function(Rt,Et){Rt.initDebugOverlayCanvas();const Yt=Rt.debugOverlayCanvas,Kt=Rt.context.gl,Zt=Rt.debugOverlayCanvas.getContext("2d");Zt.clearRect(0,0,Yt.width,Yt.height),Zt.shadowColor="white",Zt.shadowBlur=2,Zt.lineWidth=1.5,Zt.strokeStyle="white",Zt.textBaseline="top",Zt.font="bold 36px Open Sans, sans-serif",Zt.fillText(Et,5,5),Zt.strokeText(Et,5,5),Rt.debugOverlayTexture.update(Yt),Rt.debugOverlayTexture.bind(Kt.LINEAR,Kt.CLAMP_TO_EDGE)}(R,`${Tt} ${pt}kB`),ie.draw(F,j.TRIANGLES,pe,be,Ki.alphaBlended,xi.disabled,mn(q,n.aN.transparent,At),null,Fe,R.debugBuffer,R.quadTriangleIndexBuffer,R.debugSegments),ie.draw(F,j.LINE_STRIP,pe,be,Ae,xi.disabled,mn(q,n.aN.red),Ge,Fe,R.debugBuffer,R.tileBorderIndexBuffer,R.debugSegments)}function oc(R,c,p){const F=R.context,j=F.gl,q=R.colorModeForRenderPass(),ie=new Yr(j.LEQUAL,Yr.ReadWrite,R.depthRangeFor3D),pe=R.useProgram("terrain"),be=c.getTerrainMesh();F.bindFramebuffer.set(null),F.viewport.set([0,0,R.width,R.height]);for(const Ae of p){const Fe=R.renderToTexture.getTexture(Ae),Ge=c.getTerrainData(Ae.tileID);F.activeTexture.set(j.TEXTURE0),j.bindTexture(j.TEXTURE_2D,Fe.texture);const at=R.transform.calculatePosMatrix(Ae.tileID.toUnwrapped()),ct=c.getMeshFrameDelta(R.transform.zoom),pt=R.transform.calculateFogMatrix(Ae.tileID.toUnwrapped()),xt=_n(at,ct,pt,R.style.sky,R.transform.pitch);pe.draw(F,j.TRIANGLES,ie,bi.disabled,q,xi.backCCW,xt,Ge,"terrain",be.vertexBuffer,be.indexBuffer,be.segments)}}class sc{constructor(c,p,F){this.vertexBuffer=c,this.indexBuffer=p,this.segments=F}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class lc{constructor(c,p){this.context=new bc(c),this.transform=p,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:n.ao(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=He.maxUnderzooming+He.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ta}resize(c,p,F){if(this.width=Math.floor(c*F),this.height=Math.floor(p*F),this.pixelRatio=F,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const j of this.style._order)this.style._layers[j].resize()}setup(){const c=this.context,p=new n.aX;p.emplaceBack(0,0),p.emplaceBack(n.X,0),p.emplaceBack(0,n.X),p.emplaceBack(n.X,n.X),this.tileExtentBuffer=c.createVertexBuffer(p,va.members),this.tileExtentSegments=n.a0.simpleSegment(0,0,4,2);const F=new n.aX;F.emplaceBack(0,0),F.emplaceBack(n.X,0),F.emplaceBack(0,n.X),F.emplaceBack(n.X,n.X),this.debugBuffer=c.createVertexBuffer(F,va.members),this.debugSegments=n.a0.simpleSegment(0,0,4,5);const j=new n.$;j.emplaceBack(0,0,0,0),j.emplaceBack(n.X,0,n.X,0),j.emplaceBack(0,n.X,0,n.X),j.emplaceBack(n.X,n.X,n.X,n.X),this.rasterBoundsBuffer=c.createVertexBuffer(j,De.members),this.rasterBoundsSegments=n.a0.simpleSegment(0,0,4,2);const q=new n.aX;q.emplaceBack(0,0),q.emplaceBack(1,0),q.emplaceBack(0,1),q.emplaceBack(1,1),this.viewportBuffer=c.createVertexBuffer(q,va.members),this.viewportSegments=n.a0.simpleSegment(0,0,4,2);const ie=new n.aZ;ie.emplaceBack(0),ie.emplaceBack(1),ie.emplaceBack(3),ie.emplaceBack(2),ie.emplaceBack(0),this.tileBorderIndexBuffer=c.createIndexBuffer(ie);const pe=new n.aY;pe.emplaceBack(0,1,2),pe.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=c.createIndexBuffer(pe);const be=this.context.gl;this.stencilClearMode=new bi({func:be.ALWAYS,mask:0},0,255,be.ZERO,be.ZERO,be.ZERO)}clearStencil(){const c=this.context,p=c.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const F=n.H();n.aQ(F,0,this.width,this.height,0,0,1),n.K(F,F,[p.drawingBufferWidth,p.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(c,p.TRIANGLES,Yr.disabled,this.stencilClearMode,Ki.disabled,xi.disabled,Fn(F),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(c,p){if(this.currentStencilSource===c.source||!c.isTileClipped()||!p||!p.length)return;this.currentStencilSource=c.source;const F=this.context,j=F.gl;this.nextStencilID+p.length>256&&this.clearStencil(),F.setColorMode(Ki.disabled),F.setDepthMode(Yr.disabled);const q=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const ie of p){const pe=this._tileClippingMaskIDs[ie.key]=this.nextStencilID++,be=this.style.map.terrain&&this.style.map.terrain.getTerrainData(ie);q.draw(F,j.TRIANGLES,Yr.disabled,new bi({func:j.ALWAYS,mask:0},pe,255,j.KEEP,j.KEEP,j.REPLACE),Ki.disabled,xi.disabled,Fn(ie.posMatrix),be,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const c=this.nextStencilID++,p=this.context.gl;return new bi({func:p.NOTEQUAL,mask:255},c,255,p.KEEP,p.KEEP,p.REPLACE)}stencilModeForClipping(c){const p=this.context.gl;return new bi({func:p.EQUAL,mask:255},this._tileClippingMaskIDs[c.key],0,p.KEEP,p.KEEP,p.REPLACE)}stencilConfigForOverlap(c){const p=this.context.gl,F=c.sort((ie,pe)=>pe.overscaledZ-ie.overscaledZ),j=F[F.length-1].overscaledZ,q=F[0].overscaledZ-j+1;if(q>1){this.currentStencilSource=void 0,this.nextStencilID+q>256&&this.clearStencil();const ie={};for(let pe=0;pe<q;pe++)ie[pe+j]=new bi({func:p.GEQUAL,mask:255},pe+this.nextStencilID,255,p.KEEP,p.KEEP,p.REPLACE);return this.nextStencilID+=q,[ie,F]}return[{[j]:bi.disabled},F]}colorModeForRenderPass(){const c=this.context.gl;return this._showOverdrawInspector?new Ki([c.CONSTANT_COLOR,c.ONE],new n.aN(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Ki.unblended:Ki.alphaBlended}depthModeForSublayer(c,p,F){if(!this.opaquePassEnabledForLayer())return Yr.disabled;const j=1-((1+this.currentLayer)*this.numSublayers+c)*this.depthEpsilon;return new Yr(F||this.context.gl.LEQUAL,p,[j,j])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(c,p){var F;this.style=c,this.options=p,this.lineAtlas=c.lineAtlas,this.imageManager=c.imageManager,this.glyphManager=c.glyphManager,this.symbolFadeChange=c.placement.symbolFadeChange(u.now()),this.imageManager.beginFrame();const j=this.style._order,q=this.style.sourceCaches,ie={},pe={},be={};for(const Ae in q){const Fe=q[Ae];Fe.used&&Fe.prepare(this.context),ie[Ae]=Fe.getVisibleCoordinates(),pe[Ae]=ie[Ae].slice().reverse(),be[Ae]=Fe.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let Ae=0;Ae<j.length;Ae++){const Fe=j[Ae];if(this.style._layers[Fe].is3D()){this.opaquePassCutoff=Ae;break}}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const Ae of j){const Fe=this.style._layers[Ae];if(!Fe.hasOffscreenPass()||Fe.isHidden(this.transform.zoom))continue;const Ge=pe[Fe.source];(Fe.type==="custom"||Ge.length)&&this.renderLayer(this,q[Fe.source],Fe,Ge)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:p.showOverdrawInspector?n.aN.black:n.aN.transparent,depth:1}),this.clearStencil(),!((F=this.style.stylesheet)===null||F===void 0)&&F.sky&&function(Ae,Fe){const Ge=Ae.context,at=Ge.gl,ct=((Rt,Et,Yt)=>({u_sky_color:Rt.properties.get("sky-color"),u_horizon_color:Rt.properties.get("horizon-color"),u_horizon:(Et.height/2+Et.getHorizon())*Yt,u_sky_horizon_blend:Rt.properties.get("sky-horizon-blend")*Et.height/2*Yt}))(Fe,Ae.style.map.transform,Ae.pixelRatio),pt=new Yr(at.LEQUAL,Yr.ReadWrite,[0,1]),xt=bi.disabled,At=Ae.colorModeForRenderPass(),Tt=Ae.useProgram("sky");if(!Fe.mesh){const Rt=new n.aX;Rt.emplaceBack(-1,-1),Rt.emplaceBack(1,-1),Rt.emplaceBack(1,1),Rt.emplaceBack(-1,1);const Et=new n.aY;Et.emplaceBack(0,1,2),Et.emplaceBack(0,2,3),Fe.mesh=new sc(Ge.createVertexBuffer(Rt,va.members),Ge.createIndexBuffer(Et),n.a0.simpleSegment(0,0,Rt.length,Et.length))}Tt.draw(Ge,at.TRIANGLES,pt,xt,At,xi.disabled,ct,void 0,"sky",Fe.mesh.vertexBuffer,Fe.mesh.indexBuffer,Fe.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=p.showOverdrawInspector,this.depthRangeFor3D=[0,1-(c._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=j.length-1;this.currentLayer>=0;this.currentLayer--){const Ae=this.style._layers[j[this.currentLayer]],Fe=q[Ae.source],Ge=ie[Ae.source];this._renderTileClippingMasks(Ae,Ge),this.renderLayer(this,Fe,Ae,Ge)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<j.length;this.currentLayer++){const Ae=this.style._layers[j[this.currentLayer]],Fe=q[Ae.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(Ae))continue;const Ge=(Ae.type==="symbol"?be:pe)[Ae.source];this._renderTileClippingMasks(Ae,ie[Ae.source]),this.renderLayer(this,Fe,Ae,Ge)}if(this.options.showTileBoundaries){const Ae=function(Fe,Ge){let at=null;const ct=Object.values(Fe._layers).flatMap(Tt=>Tt.source&&!Tt.isHidden(Ge)?[Fe.sourceCaches[Tt.source]]:[]),pt=ct.filter(Tt=>Tt.getSource().type==="vector"),xt=ct.filter(Tt=>Tt.getSource().type!=="vector"),At=Tt=>{(!at||at.getSource().maxzoom<Tt.getSource().maxzoom)&&(at=Tt)};return pt.forEach(Tt=>At(Tt)),at||xt.forEach(Tt=>At(Tt)),at}(this.style,this.transform.zoom);Ae&&function(Fe,Ge,at){for(let ct=0;ct<at.length;ct++)xu(Fe,Ge,at[ct])}(this,Ae,Ae.getVisibleCoordinates())}this.options.showPadding&&Wc(this),this.context.setDefault()}maybeDrawDepthAndCoords(c){if(!this.style||!this.style.map||!this.style.map.terrain)return;const p=this.terrainFacilitator.matrix,F=this.transform.modelViewProjectionMatrix;let j=this.terrainFacilitator.dirty;j||(j=c?!n.a_(p,F):!n.a$(p,F)),j||(j=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),j&&(n.b0(p,F),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(q,ie){const pe=q.context,be=pe.gl,Ae=Ki.unblended,Fe=new Yr(be.LEQUAL,Yr.ReadWrite,[0,1]),Ge=ie.getTerrainMesh(),at=ie.sourceCache.getRenderableTiles(),ct=q.useProgram("terrainDepth");pe.bindFramebuffer.set(ie.getFramebuffer("depth").framebuffer),pe.viewport.set([0,0,q.width/devicePixelRatio,q.height/devicePixelRatio]),pe.clear({color:n.aN.transparent,depth:1});for(const pt of at){const xt=ie.getTerrainData(pt.tileID),At={u_matrix:q.transform.calculatePosMatrix(pt.tileID.toUnwrapped()),u_ele_delta:ie.getMeshFrameDelta(q.transform.zoom)};ct.draw(pe,be.TRIANGLES,Fe,bi.disabled,Ae,xi.backCCW,At,xt,"terrain",Ge.vertexBuffer,Ge.indexBuffer,Ge.segments)}pe.bindFramebuffer.set(null),pe.viewport.set([0,0,q.width,q.height])}(this,this.style.map.terrain),function(q,ie){const pe=q.context,be=pe.gl,Ae=Ki.unblended,Fe=new Yr(be.LEQUAL,Yr.ReadWrite,[0,1]),Ge=ie.getTerrainMesh(),at=ie.getCoordsTexture(),ct=ie.sourceCache.getRenderableTiles(),pt=q.useProgram("terrainCoords");pe.bindFramebuffer.set(ie.getFramebuffer("coords").framebuffer),pe.viewport.set([0,0,q.width/devicePixelRatio,q.height/devicePixelRatio]),pe.clear({color:n.aN.transparent,depth:1}),ie.coordsIndex=[];for(const xt of ct){const At=ie.getTerrainData(xt.tileID);pe.activeTexture.set(be.TEXTURE0),be.bindTexture(be.TEXTURE_2D,at.texture);const Tt={u_matrix:q.transform.calculatePosMatrix(xt.tileID.toUnwrapped()),u_terrain_coords_id:(255-ie.coordsIndex.length)/255,u_texture:0,u_ele_delta:ie.getMeshFrameDelta(q.transform.zoom)};pt.draw(pe,be.TRIANGLES,Fe,bi.disabled,Ae,xi.backCCW,Tt,At,"terrain",Ge.vertexBuffer,Ge.indexBuffer,Ge.segments),ie.coordsIndex.push(xt.tileID.key)}pe.bindFramebuffer.set(null),pe.viewport.set([0,0,q.width,q.height])}(this,this.style.map.terrain))}renderLayer(c,p,F,j){if(!F.isHidden(this.transform.zoom)&&(F.type==="background"||F.type==="custom"||(j||[]).length))switch(this.id=F.id,F.type){case"symbol":Bl(c,p,F,j,this.style.placement.variableOffsets);break;case"circle":(function(q,ie,pe,be){if(q.renderPass!=="translucent")return;const Ae=pe.paint.get("circle-opacity"),Fe=pe.paint.get("circle-stroke-width"),Ge=pe.paint.get("circle-stroke-opacity"),at=!pe.layout.get("circle-sort-key").isConstant();if(Ae.constantOr(1)===0&&(Fe.constantOr(1)===0||Ge.constantOr(1)===0))return;const ct=q.context,pt=ct.gl,xt=q.depthModeForSublayer(0,Yr.ReadOnly),At=bi.disabled,Tt=q.colorModeForRenderPass(),Rt=[];for(let Et=0;Et<be.length;Et++){const Yt=be[Et],Kt=ie.getTile(Yt),Zt=Kt.getBucket(pe);if(!Zt)continue;const hn=Zt.programConfigurations.get(pe.id),xn=q.useProgram("circle",hn),Nn=Zt.layoutVertexBuffer,Dn=Zt.indexBuffer,Gn=q.style.map.terrain&&q.style.map.terrain.getTerrainData(Yt),Kn={programConfiguration:hn,program:xn,layoutVertexBuffer:Nn,indexBuffer:Dn,uniformValues:Un(q,Yt,Kt,pe),terrainData:Gn};if(at){const ya=Zt.segments.get();for(const ea of ya)Rt.push({segments:new n.a0([ea]),sortKey:ea.sortKey,state:Kn})}else Rt.push({segments:Zt.segments,sortKey:0,state:Kn})}at&&Rt.sort((Et,Yt)=>Et.sortKey-Yt.sortKey);for(const Et of Rt){const{programConfiguration:Yt,program:Kt,layoutVertexBuffer:Zt,indexBuffer:hn,uniformValues:xn,terrainData:Nn}=Et.state,Dn=Et.segments;Kt.draw(ct,pt.TRIANGLES,xt,At,Tt,xi.disabled,xn,Nn,pe.id,Zt,hn,Dn,pe.paint,q.transform.zoom,Yt)}})(c,p,F,j);break;case"heatmap":Ll(c,p,F,j);break;case"line":(function(q,ie,pe,be){if(q.renderPass!=="translucent")return;const Ae=pe.paint.get("line-opacity"),Fe=pe.paint.get("line-width");if(Ae.constantOr(1)===0||Fe.constantOr(1)===0)return;const Ge=q.depthModeForSublayer(0,Yr.ReadOnly),at=q.colorModeForRenderPass(),ct=pe.paint.get("line-dasharray"),pt=pe.paint.get("line-pattern"),xt=pt.constantOr(1),At=pe.paint.get("line-gradient"),Tt=pe.getCrossfadeParameters(),Rt=xt?"linePattern":ct?"lineSDF":At?"lineGradient":"line",Et=q.context,Yt=Et.gl;let Kt=!0;for(const Zt of be){const hn=ie.getTile(Zt);if(xt&&!hn.patternsLoaded())continue;const xn=hn.getBucket(pe);if(!xn)continue;const Nn=xn.programConfigurations.get(pe.id),Dn=q.context.program.get(),Gn=q.useProgram(Rt,Nn),Kn=Kt||Gn.program!==Dn,ya=q.style.map.terrain&&q.style.map.terrain.getTerrainData(Zt),ea=pt.constantOr(null);if(ea&&hn.imageAtlas){const Ta=hn.imageAtlas,fa=Ta.patternPositions[ea.to.toString()],Ia=Ta.patternPositions[ea.from.toString()];fa&&Ia&&Nn.setConstantPatternPositions(fa,Ia)}const wa=ya?Zt:null,ia=xt?Zn(q,hn,pe,Tt,wa):ct?ca(q,hn,pe,ct,Tt,wa):At?Tn(q,hn,pe,xn.lineClipsArray.length,wa):sn(q,hn,pe,wa);if(xt)Et.activeTexture.set(Yt.TEXTURE0),hn.imageAtlasTexture.bind(Yt.LINEAR,Yt.CLAMP_TO_EDGE),Nn.updatePaintBuffers(Tt);else if(ct&&(Kn||q.lineAtlas.dirty))Et.activeTexture.set(Yt.TEXTURE0),q.lineAtlas.bind(Et);else if(At){const Ta=xn.gradients[pe.id];let fa=Ta.texture;if(pe.gradientVersion!==Ta.version){let Ia=256;if(pe.stepInterpolant){const qa=ie.getSource().maxzoom,Ma=Zt.canonical.z===qa?Math.ceil(1<<q.transform.maxZoom-Zt.canonical.z):1,Ga=xn.maxLineLength/n.X*1024*Ma;Ia=n.ad(n.aV(Ga),256,Et.maxTextureSize)}Ta.gradient=n.aW({expression:pe.gradientExpression(),evaluationKey:"lineProgress",resolution:Ia,image:Ta.gradient||void 0,clips:xn.lineClipsArray}),Ta.texture?Ta.texture.update(Ta.gradient):Ta.texture=new L(Et,Ta.gradient,Yt.RGBA),Ta.version=pe.gradientVersion,fa=Ta.texture}Et.activeTexture.set(Yt.TEXTURE0),fa.bind(pe.stepInterpolant?Yt.NEAREST:Yt.LINEAR,Yt.CLAMP_TO_EDGE)}Gn.draw(Et,Yt.TRIANGLES,Ge,q.stencilModeForClipping(Zt),at,xi.disabled,ia,ya,pe.id,xn.layoutVertexBuffer,xn.indexBuffer,xn.segments,pe.paint,q.transform.zoom,Nn,xn.layoutVertexBuffer2),Kt=!1}})(c,p,F,j);break;case"fill":(function(q,ie,pe,be){const Ae=pe.paint.get("fill-color"),Fe=pe.paint.get("fill-opacity");if(Fe.constantOr(1)===0)return;const Ge=q.colorModeForRenderPass(),at=pe.paint.get("fill-pattern"),ct=q.opaquePassEnabledForLayer()&&!at.constantOr(1)&&Ae.constantOr(n.aN.transparent).a===1&&Fe.constantOr(0)===1?"opaque":"translucent";if(q.renderPass===ct){const pt=q.depthModeForSublayer(1,q.renderPass==="opaque"?Yr.ReadWrite:Yr.ReadOnly);Bc(q,ie,pe,be,pt,Ge,!1)}if(q.renderPass==="translucent"&&pe.paint.get("fill-antialias")){const pt=q.depthModeForSublayer(pe.getPaintProperty("fill-outline-color")?2:0,Yr.ReadOnly);Bc(q,ie,pe,be,pt,Ge,!0)}})(c,p,F,j);break;case"fill-extrusion":(function(q,ie,pe,be){const Ae=pe.paint.get("fill-extrusion-opacity");if(Ae!==0&&q.renderPass==="translucent"){const Fe=new Yr(q.context.gl.LEQUAL,Yr.ReadWrite,q.depthRangeFor3D);if(Ae!==1||pe.paint.get("fill-extrusion-pattern").constantOr(1))wc(q,ie,pe,be,Fe,bi.disabled,Ki.disabled),wc(q,ie,pe,be,Fe,q.stencilModeFor3D(),q.colorModeForRenderPass());else{const Ge=q.colorModeForRenderPass();wc(q,ie,pe,be,Fe,bi.disabled,Ge)}}})(c,p,F,j);break;case"hillshade":(function(q,ie,pe,be){if(q.renderPass!=="offscreen"&&q.renderPass!=="translucent")return;const Ae=q.context,Fe=q.depthModeForSublayer(0,Yr.ReadOnly),Ge=q.colorModeForRenderPass(),[at,ct]=q.renderPass==="translucent"?q.stencilConfigForOverlap(be):[{},be];for(const pt of ct){const xt=ie.getTile(pt);xt.needsHillshadePrepare!==void 0&&xt.needsHillshadePrepare&&q.renderPass==="offscreen"?hu(q,xt,pe,Fe,bi.disabled,Ge):q.renderPass==="translucent"&&kc(q,pt,xt,pe,Fe,at[pt.overscaledZ],Ge)}Ae.viewport.set([0,0,q.width,q.height])})(c,p,F,j);break;case"raster":(function(q,ie,pe,be){if(q.renderPass!=="translucent"||pe.paint.get("raster-opacity")===0||!be.length)return;const Ae=q.context,Fe=Ae.gl,Ge=ie.getSource(),at=q.useProgram("raster"),ct=q.colorModeForRenderPass(),[pt,xt]=Ge instanceof Be?[{},be]:q.stencilConfigForOverlap(be),At=xt[xt.length-1].overscaledZ,Tt=!q.options.moving;for(const Rt of xt){const Et=q.depthModeForSublayer(Rt.overscaledZ-At,pe.paint.get("raster-opacity")===1?Yr.ReadWrite:Yr.ReadOnly,Fe.LESS),Yt=ie.getTile(Rt);Yt.registerFadeDuration(pe.paint.get("raster-fade-duration"));const Kt=ie.findLoadedParent(Rt,0),Zt=ie.findLoadedSibling(Rt),hn=vs(Yt,Kt||Zt||null,ie,pe,q.transform,q.style.map.terrain);let xn,Nn;const Dn=pe.paint.get("raster-resampling")==="nearest"?Fe.NEAREST:Fe.LINEAR;Ae.activeTexture.set(Fe.TEXTURE0),Yt.texture.bind(Dn,Fe.CLAMP_TO_EDGE,Fe.LINEAR_MIPMAP_NEAREST),Ae.activeTexture.set(Fe.TEXTURE1),Kt?(Kt.texture.bind(Dn,Fe.CLAMP_TO_EDGE,Fe.LINEAR_MIPMAP_NEAREST),xn=Math.pow(2,Kt.tileID.overscaledZ-Yt.tileID.overscaledZ),Nn=[Yt.tileID.canonical.x*xn%1,Yt.tileID.canonical.y*xn%1]):Yt.texture.bind(Dn,Fe.CLAMP_TO_EDGE,Fe.LINEAR_MIPMAP_NEAREST),Yt.texture.useMipmap&&Ae.extTextureFilterAnisotropic&&q.transform.pitch>20&&Fe.texParameterf(Fe.TEXTURE_2D,Ae.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,Ae.extTextureFilterAnisotropicMax);const Gn=q.style.map.terrain&&q.style.map.terrain.getTerrainData(Rt),Kn=Gn?Rt:null,ya=Kn?Kn.posMatrix:q.transform.calculatePosMatrix(Rt.toUnwrapped(),Tt),ea=Aa(ya,Nn||[0,0],xn||1,hn,pe);Ge instanceof Be?at.draw(Ae,Fe.TRIANGLES,Et,bi.disabled,ct,xi.disabled,ea,Gn,pe.id,Ge.boundsBuffer,q.quadTriangleIndexBuffer,Ge.boundsSegments):at.draw(Ae,Fe.TRIANGLES,Et,pt[Rt.overscaledZ],ct,xi.disabled,ea,Gn,pe.id,q.rasterBoundsBuffer,q.quadTriangleIndexBuffer,q.rasterBoundsSegments)}})(c,p,F,j);break;case"background":(function(q,ie,pe,be){const Ae=pe.paint.get("background-color"),Fe=pe.paint.get("background-opacity");if(Fe===0)return;const Ge=q.context,at=Ge.gl,ct=q.transform,pt=ct.tileSize,xt=pe.paint.get("background-pattern");if(q.isPatternMissing(xt))return;const At=!xt&&Ae.a===1&&Fe===1&&q.opaquePassEnabledForLayer()?"opaque":"translucent";if(q.renderPass!==At)return;const Tt=bi.disabled,Rt=q.depthModeForSublayer(0,At==="opaque"?Yr.ReadWrite:Yr.ReadOnly),Et=q.colorModeForRenderPass(),Yt=q.useProgram(xt?"backgroundPattern":"background"),Kt=be||ct.coveringTiles({tileSize:pt,terrain:q.style.map.terrain});xt&&(Ge.activeTexture.set(at.TEXTURE0),q.imageManager.bind(q.context));const Zt=pe.getCrossfadeParameters();for(const hn of Kt){const xn=be?hn.posMatrix:q.transform.calculatePosMatrix(hn.toUnwrapped()),Nn=xt?Ja(xn,Fe,q,xt,{tileID:hn,tileSize:pt},Zt):Fa(xn,Fe,Ae),Dn=q.style.map.terrain&&q.style.map.terrain.getTerrainData(hn);Yt.draw(Ge,at.TRIANGLES,Rt,Tt,Et,xi.disabled,Nn,Dn,pe.id,q.tileExtentBuffer,q.quadTriangleIndexBuffer,q.tileExtentSegments)}})(c,0,F,j);break;case"custom":(function(q,ie,pe){const be=q.context,Ae=pe.implementation;if(q.renderPass==="offscreen"){const Fe=Ae.prerender;Fe&&(q.setCustomLayerDefaults(),be.setColorMode(q.colorModeForRenderPass()),Fe.call(Ae,be.gl,q.transform.customLayerMatrix()),be.setDirty(),q.setBaseState())}else if(q.renderPass==="translucent"){q.setCustomLayerDefaults(),be.setColorMode(q.colorModeForRenderPass()),be.setStencilMode(bi.disabled);const Fe=Ae.renderingMode==="3d"?new Yr(q.context.gl.LEQUAL,Yr.ReadWrite,q.depthRangeFor3D):q.depthModeForSublayer(0,Yr.ReadOnly);be.setDepthMode(Fe),Ae.render(be.gl,q.transform.customLayerMatrix(),{farZ:q.transform.farZ,nearZ:q.transform.nearZ,fov:q.transform._fov,modelViewProjectionMatrix:q.transform.modelViewProjectionMatrix,projectionMatrix:q.transform.projectionMatrix}),be.setDirty(),q.setBaseState(),be.bindFramebuffer.set(null)}})(c,0,F)}}translatePosMatrix(c,p,F,j,q){if(!F[0]&&!F[1])return c;const ie=q?j==="map"?this.transform.angle:0:j==="viewport"?-this.transform.angle:0;if(ie){const Ae=Math.sin(ie),Fe=Math.cos(ie);F=[F[0]*Fe-F[1]*Ae,F[0]*Ae+F[1]*Fe]}const pe=[q?F[0]:St(p,F[0],this.transform.zoom),q?F[1]:St(p,F[1],this.transform.zoom),0],be=new Float32Array(16);return n.J(be,c,pe),be}saveTileTexture(c){const p=this._tileTextures[c.size[0]];p?p.push(c):this._tileTextures[c.size[0]]=[c]}getTileTexture(c){const p=this._tileTextures[c];return p&&p.length>0?p.pop():null}isPatternMissing(c){if(!c)return!1;if(!c.from||!c.to)return!0;const p=this.imageManager.getPattern(c.from.toString()),F=this.imageManager.getPattern(c.to.toString());return!p||!F}useProgram(c,p){this.cache=this.cache||{};const F=c+(p?p.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[F]||(this.cache[F]=new na(this.context,ba[c],p,$a[c],this._showOverdrawInspector,this.style.map.terrain)),this.cache[F]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const c=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(c.FUNC_ADD)}initDebugOverlayCanvas(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;const c=this.context.gl;this.debugOverlayTexture=new L(this.context,this.debugOverlayCanvas,c.RGBA)}}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:c,drawingBufferHeight:p}=this.context.gl;return this.width!==c||this.height!==p}}class Fs{constructor(c,p){this.points=c,this.planes=p}static fromInvProjectionMatrix(c,p,F){const j=Math.pow(2,F),q=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(pe=>{const be=1/(pe=n.ag([],pe,c))[3]/p*j;return n.b1(pe,pe,[be,be,1/pe[3],be])}),ie=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(pe=>{const be=function(at,ct){var pt=ct[0],xt=ct[1],At=ct[2],Tt=pt*pt+xt*xt+At*At;return Tt>0&&(Tt=1/Math.sqrt(Tt)),at[0]=ct[0]*Tt,at[1]=ct[1]*Tt,at[2]=ct[2]*Tt,at}([],function(at,ct,pt){var xt=ct[0],At=ct[1],Tt=ct[2],Rt=pt[0],Et=pt[1],Yt=pt[2];return at[0]=At*Yt-Tt*Et,at[1]=Tt*Rt-xt*Yt,at[2]=xt*Et-At*Rt,at}([],B([],q[pe[0]],q[pe[1]]),B([],q[pe[2]],q[pe[1]]))),Ae=(Fe=be,Ge=q[pe[1]],-(Fe[0]*Ge[0]+Fe[1]*Ge[1]+Fe[2]*Ge[2]));var Fe,Ge;return be.concat(Ae)});return new Fs(q,ie)}}class bs{constructor(c,p){this.min=c,this.max=p,this.center=function(F,j,q){return F[0]=j[0]*q,F[1]=j[1]*q,F[2]=j[2]*q,F}([],function(F,j,q){return F[0]=j[0]+q[0],F[1]=j[1]+q[1],F[2]=j[2]+q[2],F}([],this.min,this.max),.5)}quadrant(c){const p=[c%2==0,c<2],F=C(this.min),j=C(this.max);for(let q=0;q<p.length;q++)F[q]=p[q]?this.min[q]:this.center[q],j[q]=p[q]?this.center[q]:this.max[q];return j[2]=this.max[2],new bs(F,j)}distanceX(c){return Math.max(Math.min(this.max[0],c[0]),this.min[0])-c[0]}distanceY(c){return Math.max(Math.min(this.max[1],c[1]),this.min[1])-c[1]}intersects(c){const p=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]];let F=!0;for(let j=0;j<c.planes.length;j++){const q=c.planes[j];let ie=0;for(let pe=0;pe<p.length;pe++)n.b2(q,p[pe])>=0&&ie++;if(ie===0)return 0;ie!==p.length&&(F=!1)}if(F)return 2;for(let j=0;j<3;j++){let q=Number.MAX_VALUE,ie=-Number.MAX_VALUE;for(let pe=0;pe<c.points.length;pe++){const be=c.points[pe][j]-this.min[j];q=Math.min(q,be),ie=Math.max(ie,be)}if(ie<0||q>this.max[j]-this.min[j])return 0}return 1}}class Fl{constructor(c=0,p=0,F=0,j=0){if(isNaN(c)||c<0||isNaN(p)||p<0||isNaN(F)||F<0||isNaN(j)||j<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=c,this.bottom=p,this.left=F,this.right=j}interpolate(c,p,F){return p.top!=null&&c.top!=null&&(this.top=n.z.number(c.top,p.top,F)),p.bottom!=null&&c.bottom!=null&&(this.bottom=n.z.number(c.bottom,p.bottom,F)),p.left!=null&&c.left!=null&&(this.left=n.z.number(c.left,p.left,F)),p.right!=null&&c.right!=null&&(this.right=n.z.number(c.right,p.right,F)),this}getCenter(c,p){const F=n.ad((this.left+c-this.right)/2,0,c),j=n.ad((this.top+p-this.bottom)/2,0,p);return new n.P(F,j)}equals(c){return this.top===c.top&&this.bottom===c.bottom&&this.left===c.left&&this.right===c.right}clone(){return new Fl(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Tc=85.051129;class di{constructor(c,p,F,j,q){this.tileSize=512,this._renderWorldCopies=q===void 0||!!q,this._minZoom=c||0,this._maxZoom=p||22,this._minPitch=F??0,this._maxPitch=j??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new n.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Fl,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const c=new di(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return c.apply(this),c}apply(c){this.tileSize=c.tileSize,this.latRange=c.latRange,this.width=c.width,this.height=c.height,this._center=c._center,this._elevation=c._elevation,this.minElevationForCurrentTile=c.minElevationForCurrentTile,this.zoom=c.zoom,this.angle=c.angle,this._fov=c._fov,this._pitch=c._pitch,this._unmodified=c._unmodified,this._edgeInsets=c._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(c){this._minZoom!==c&&(this._minZoom=c,this.zoom=Math.max(this.zoom,c))}get maxZoom(){return this._maxZoom}set maxZoom(c){this._maxZoom!==c&&(this._maxZoom=c,this.zoom=Math.min(this.zoom,c))}get minPitch(){return this._minPitch}set minPitch(c){this._minPitch!==c&&(this._minPitch=c,this.pitch=Math.max(this.pitch,c))}get maxPitch(){return this._maxPitch}set maxPitch(c){this._maxPitch!==c&&(this._maxPitch=c,this.pitch=Math.min(this.pitch,c))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(c){c===void 0?c=!0:c===null&&(c=!1),this._renderWorldCopies=c}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new n.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(c){const p=-n.b3(c,-180,180)*Math.PI/180;this.angle!==p&&(this._unmodified=!1,this.angle=p,this._calcMatrices(),this.rotationMatrix=function(){var F=new n.A(4);return n.A!=Float32Array&&(F[1]=0,F[2]=0),F[0]=1,F[3]=1,F}(),function(F,j,q){var ie=j[0],pe=j[1],be=j[2],Ae=j[3],Fe=Math.sin(q),Ge=Math.cos(q);F[0]=ie*Ge+be*Fe,F[1]=pe*Ge+Ae*Fe,F[2]=ie*-Fe+be*Ge,F[3]=pe*-Fe+Ae*Ge}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(c){const p=n.ad(c,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==p&&(this._unmodified=!1,this._pitch=p,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(c){c=Math.max(.01,Math.min(60,c)),this._fov!==c&&(this._unmodified=!1,this._fov=c/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(c){const p=Math.min(Math.max(c,this.minZoom),this.maxZoom);this._zoom!==p&&(this._unmodified=!1,this._zoom=p,this.tileZoom=Math.max(0,Math.floor(p)),this.scale=this.zoomScale(p),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(c){c.lat===this._center.lat&&c.lng===this._center.lng||(this._unmodified=!1,this._center=c,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(c){c!==this._elevation&&(this._elevation=c,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(c){this._edgeInsets.equals(c)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,c,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(c){return this._edgeInsets.equals(c)}interpolatePadding(c,p,F){this._unmodified=!1,this._edgeInsets.interpolate(c,p,F),this._constrain(),this._calcMatrices()}coveringZoomLevel(c){const p=(c.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/c.tileSize));return Math.max(0,p)}getVisibleUnwrappedCoordinates(c){const p=[new n.b4(0,c)];if(this._renderWorldCopies){const F=this.pointCoordinate(new n.P(0,0)),j=this.pointCoordinate(new n.P(this.width,0)),q=this.pointCoordinate(new n.P(this.width,this.height)),ie=this.pointCoordinate(new n.P(0,this.height)),pe=Math.floor(Math.min(F.x,j.x,q.x,ie.x)),be=Math.floor(Math.max(F.x,j.x,q.x,ie.x)),Ae=1;for(let Fe=pe-Ae;Fe<=be+Ae;Fe++)Fe!==0&&p.push(new n.b4(Fe,c))}return p}coveringTiles(c){var p,F;let j=this.coveringZoomLevel(c);const q=j;if(c.minzoom!==void 0&&j<c.minzoom)return[];c.maxzoom!==void 0&&j>c.maxzoom&&(j=c.maxzoom);const ie=this.pointCoordinate(this.getCameraPoint()),pe=n.Z.fromLngLat(this.center),be=Math.pow(2,j),Ae=[be*ie.x,be*ie.y,0],Fe=[be*pe.x,be*pe.y,0],Ge=Fs.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,j);let at=c.minzoom||0;!c.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(at=j);const ct=c.terrain?2/Math.min(this.tileSize,c.tileSize)*this.tileSize:3,pt=Et=>({aabb:new bs([Et*be,0,0],[(Et+1)*be,be,0]),zoom:0,x:0,y:0,wrap:Et,fullyVisible:!1}),xt=[],At=[],Tt=j,Rt=c.reparseOverscaled?q:j;if(this._renderWorldCopies)for(let Et=1;Et<=3;Et++)xt.push(pt(-Et)),xt.push(pt(Et));for(xt.push(pt(0));xt.length>0;){const Et=xt.pop(),Yt=Et.x,Kt=Et.y;let Zt=Et.fullyVisible;if(!Zt){const Kn=Et.aabb.intersects(Ge);if(Kn===0)continue;Zt=Kn===2}const hn=c.terrain?Ae:Fe,xn=Et.aabb.distanceX(hn),Nn=Et.aabb.distanceY(hn),Dn=Math.max(Math.abs(xn),Math.abs(Nn)),Gn=ct+(1<<Tt-Et.zoom)-2;if(Et.zoom===Tt||Dn>Gn&&Et.zoom>=at){const Kn=Tt-Et.zoom,ya=Ae[0]-.5-(Yt<<Kn),ea=Ae[1]-.5-(Kt<<Kn);At.push({tileID:new n.S(Et.zoom===Tt?Rt:Et.zoom,Et.wrap,Et.zoom,Yt,Kt),distanceSq:E([Fe[0]-.5-Yt,Fe[1]-.5-Kt]),tileDistanceToCamera:Math.sqrt(ya*ya+ea*ea)})}else for(let Kn=0;Kn<4;Kn++){const ya=(Yt<<1)+Kn%2,ea=(Kt<<1)+(Kn>>1),wa=Et.zoom+1;let ia=Et.aabb.quadrant(Kn);if(c.terrain){const Ta=new n.S(wa,Et.wrap,wa,ya,ea),fa=c.terrain.getMinMaxElevation(Ta),Ia=(p=fa.minElevation)!==null&&p!==void 0?p:this.elevation,qa=(F=fa.maxElevation)!==null&&F!==void 0?F:this.elevation;ia=new bs([ia.min[0],ia.min[1],Ia],[ia.max[0],ia.max[1],qa])}xt.push({aabb:ia,zoom:wa,x:ya,y:ea,wrap:Et.wrap,fullyVisible:Zt})}}return At.sort((Et,Yt)=>Et.distanceSq-Yt.distanceSq).map(Et=>Et.tileID)}resize(c,p){this.width=c,this.height=p,this.pixelsToGLUnits=[2/c,-2/p],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(c){return Math.pow(2,c)}scaleZoom(c){return Math.log(c)/Math.LN2}project(c){const p=n.ad(c.lat,-85.051129,Tc);return new n.P(n.O(c.lng)*this.worldSize,n.Q(p)*this.worldSize)}unproject(c){return new n.Z(c.x/this.worldSize,c.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(c){const p=this.elevation,F=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,j=this.pointLocation(this.centerPoint,c),q=c.getElevationForLngLatZoom(j,this.tileZoom);if(!(this.elevation-q))return;const ie=F+p-q,pe=Math.cos(this._pitch)*this.cameraToCenterDistance/ie/n.b5(1,j.lat)/this.tileSize,be=this.scaleZoom(pe);this._elevation=q,this._center=j,this.zoom=be}setLocationAtPoint(c,p){const F=this.pointCoordinate(p),j=this.pointCoordinate(this.centerPoint),q=this.locationCoordinate(c),ie=new n.Z(q.x-(F.x-j.x),q.y-(F.y-j.y));this.center=this.coordinateLocation(ie),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(c,p){return p?this.coordinatePoint(this.locationCoordinate(c),p.getElevationForLngLatZoom(c,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(c))}pointLocation(c,p){return this.coordinateLocation(this.pointCoordinate(c,p))}locationCoordinate(c){return n.Z.fromLngLat(c)}coordinateLocation(c){return c&&c.toLngLat()}pointCoordinate(c,p){if(p){const pt=p.pointCoordinate(c);if(pt!=null)return pt}const F=[c.x,c.y,0,1],j=[c.x,c.y,1,1];n.ag(F,F,this.pixelMatrixInverse),n.ag(j,j,this.pixelMatrixInverse);const q=F[3],ie=j[3],pe=F[0]/q,be=j[0]/ie,Ae=F[1]/q,Fe=j[1]/ie,Ge=F[2]/q,at=j[2]/ie,ct=Ge===at?0:(0-Ge)/(at-Ge);return new n.Z(n.z.number(pe,be,ct)/this.worldSize,n.z.number(Ae,Fe,ct)/this.worldSize)}coordinatePoint(c,p=0,F=this.pixelMatrix){const j=[c.x*this.worldSize,c.y*this.worldSize,p,1];return n.ag(j,j,F),new n.P(j[0]/j[3],j[1]/j[3])}getBounds(){const c=Math.max(0,this.height/2-this.getHorizon());return new Te().extend(this.pointLocation(new n.P(0,c))).extend(this.pointLocation(new n.P(this.width,c))).extend(this.pointLocation(new n.P(this.width,this.height))).extend(this.pointLocation(new n.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new Te([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(c){c?(this.lngRange=[c.getWest(),c.getEast()],this.latRange=[c.getSouth(),c.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Tc])}calculateTileMatrix(c){const p=c.canonical,F=this.worldSize/this.zoomScale(p.z),j=p.x+Math.pow(2,p.z)*c.wrap,q=n.ao(new Float64Array(16));return n.J(q,q,[j*F,p.y*F,0]),n.K(q,q,[F/n.X,F/n.X,1]),q}calculatePosMatrix(c,p=!1){const F=c.key,j=p?this._alignedPosMatrixCache:this._posMatrixCache;if(j[F])return j[F];const q=this.calculateTileMatrix(c);return n.L(q,p?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,q),j[F]=new Float32Array(q),j[F]}calculateFogMatrix(c){const p=c.key,F=this._fogMatrixCache;if(F[p])return F[p];const j=this.calculateTileMatrix(c);return n.L(j,this.fogMatrix,j),F[p]=new Float32Array(j),F[p]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(c,p){p=n.ad(+p,this.minZoom,this.maxZoom);const F={center:new n.N(c.lng,c.lat),zoom:p};let j=this.lngRange;if(!this._renderWorldCopies&&j===null){const Et=179.9999999999;j=[-Et,Et]}const q=this.tileSize*this.zoomScale(F.zoom);let ie=0,pe=q,be=0,Ae=q,Fe=0,Ge=0;const{x:at,y:ct}=this.size;if(this.latRange){const Et=this.latRange;ie=n.Q(Et[1])*q,pe=n.Q(Et[0])*q,pe-ie<ct&&(Fe=ct/(pe-ie))}j&&(be=n.b3(n.O(j[0])*q,0,q),Ae=n.b3(n.O(j[1])*q,0,q),Ae<be&&(Ae+=q),Ae-be<at&&(Ge=at/(Ae-be)));const{x:pt,y:xt}=this.project.call({worldSize:q},c);let At,Tt;const Rt=Math.max(Ge||0,Fe||0);if(Rt){const Et=new n.P(Ge?(Ae+be)/2:pt,Fe?(pe+ie)/2:xt);return F.center=this.unproject.call({worldSize:q},Et).wrap(),F.zoom+=this.scaleZoom(Rt),F}if(this.latRange){const Et=ct/2;xt-Et<ie&&(Tt=ie+Et),xt+Et>pe&&(Tt=pe-Et)}if(j){const Et=(be+Ae)/2;let Yt=pt;this._renderWorldCopies&&(Yt=n.b3(pt,Et-q/2,Et+q/2));const Kt=at/2;Yt-Kt<be&&(At=be+Kt),Yt+Kt>Ae&&(At=Ae-Kt)}if(At!==void 0||Tt!==void 0){const Et=new n.P(At??pt,Tt??xt);F.center=this.unproject.call({worldSize:q},Et).wrap()}return F}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const c=this._unmodified,{center:p,zoom:F}=this.getConstrained(this.center,this.zoom);this.center=p,this.zoom=F,this._unmodified=c,this._constraining=!1}_calcMatrices(){if(!this.height)return;const c=this._fov/2,p=this.centerOffset,F=this.point.x,j=this.point.y;this.cameraToCenterDistance=.5/Math.tan(c)*this.height,this._pixelPerMeter=n.b5(1,this.center.lat)*this.worldSize;let q=n.ao(new Float64Array(16));n.K(q,q,[this.width/2,-this.height/2,1]),n.J(q,q,[1,-1,0]),this.labelPlaneMatrix=q,q=n.ao(new Float64Array(16)),n.K(q,q,[1,-1,1]),n.J(q,q,[-1,-1,0]),n.K(q,q,[2/this.width,2/this.height,1]),this.glCoordMatrix=q;const ie=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),pe=Math.min(this.elevation,this.minElevationForCurrentTile),be=ie-pe*this._pixelPerMeter/Math.cos(this._pitch),Ae=pe<0?be:ie,Fe=Math.PI/2+this._pitch,Ge=this._fov*(.5+p.y/this.height),at=Math.sin(Ge)*Ae/Math.sin(n.ad(Math.PI-Fe-Ge,.01,Math.PI-.01)),ct=this.getHorizon(),pt=2*Math.atan(ct/this.cameraToCenterDistance)*(.5+p.y/(2*ct)),xt=Math.sin(pt)*Ae/Math.sin(n.ad(Math.PI-Fe-pt,.01,Math.PI-.01)),At=Math.min(at,xt);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*At+Ae),this.nearZ=this.height/50,q=new Float64Array(16),n.b6(q,this._fov,this.width/this.height,this.nearZ,this.farZ),q[8]=2*-p.x/this.width,q[9]=2*p.y/this.height,this.projectionMatrix=n.af(q),n.K(q,q,[1,-1,1]),n.J(q,q,[0,0,-this.cameraToCenterDistance]),n.b7(q,q,this._pitch),n.ae(q,q,this.angle),n.J(q,q,[-F,-j,0]),this.mercatorMatrix=n.K([],q,[this.worldSize,this.worldSize,this.worldSize]),n.K(q,q,[1,1,this._pixelPerMeter]),this.pixelMatrix=n.L(new Float64Array(16),this.labelPlaneMatrix,q),n.J(q,q,[0,0,-this.elevation]),this.modelViewProjectionMatrix=q,this.invModelViewProjectionMatrix=n.at([],q),this.fogMatrix=new Float64Array(16),n.b6(this.fogMatrix,this._fov,this.width/this.height,ie,this.farZ),this.fogMatrix[8]=2*-p.x/this.width,this.fogMatrix[9]=2*p.y/this.height,n.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),n.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),n.b7(this.fogMatrix,this.fogMatrix,this._pitch),n.ae(this.fogMatrix,this.fogMatrix,this.angle),n.J(this.fogMatrix,this.fogMatrix,[-F,-j,0]),n.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),n.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=n.L(new Float64Array(16),this.labelPlaneMatrix,q);const Tt=this.width%2/2,Rt=this.height%2/2,Et=Math.cos(this.angle),Yt=Math.sin(this.angle),Kt=F-Math.round(F)+Et*Tt+Yt*Rt,Zt=j-Math.round(j)+Et*Rt+Yt*Tt,hn=new Float64Array(q);if(n.J(hn,hn,[Kt>.5?Kt-1:Kt,Zt>.5?Zt-1:Zt,0]),this.alignedModelViewProjectionMatrix=hn,q=n.at(new Float64Array(16),this.pixelMatrix),!q)throw new Error("failed to invert matrix");this.pixelMatrixInverse=q,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const c=this.pointCoordinate(new n.P(0,0)),p=[c.x*this.worldSize,c.y*this.worldSize,0,1];return n.ag(p,p,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const c=this._pitch,p=Math.tan(c)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new n.P(0,p))}getCameraQueryGeometry(c){const p=this.getCameraPoint();if(c.length===1)return[c[0],p];{let F=p.x,j=p.y,q=p.x,ie=p.y;for(const pe of c)F=Math.min(F,pe.x),j=Math.min(j,pe.y),q=Math.max(q,pe.x),ie=Math.max(ie,pe.y);return[new n.P(F,j),new n.P(q,j),new n.P(q,ie),new n.P(F,ie),new n.P(F,j)]}}lngLatToCameraDepth(c,p){const F=this.locationCoordinate(c),j=[F.x*this.worldSize,F.y*this.worldSize,p,1];return n.ag(j,j,this.modelViewProjectionMatrix),j[2]/j[3]}}function Ns(R,c){let p,F=!1,j=null,q=null;const ie=()=>{j=null,F&&(R.apply(q,p),j=setTimeout(ie,c),F=!1)};return(...pe)=>(F=!0,q=this,p=pe,j||ie(),j)}class Qi{constructor(c){this._getCurrentHash=()=>{const p=window.location.hash.replace("#","");if(this._hashName){let F;return p.split("&").map(j=>j.split("=")).forEach(j=>{j[0]===this._hashName&&(F=j)}),(F&&F[1]||"").split("/")}return p.split("/")},this._onHashChange=()=>{const p=this._getCurrentHash();if(p.length>=3&&!p.some(F=>isNaN(F))){const F=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(p[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+p[2],+p[1]],zoom:+p[0],bearing:F,pitch:+(p[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const p=window.location.href.replace(/(#.+)?$/,this.getHashString());window.history.replaceState(window.history.state,null,p)},this._removeHash=()=>{const p=this._getCurrentHash();if(p.length===0)return;const F=p.join("/");let j=F;j.split("&").length>0&&(j=j.split("&")[0]),this._hashName&&(j=`${this._hashName}=${F}`);let q=window.location.hash.replace(j,"");q.startsWith("#&")?q=q.slice(0,1)+q.slice(2):q==="#"&&(q="");let ie=window.location.href.replace(/(#.+)?$/,q);ie=ie.replace("&&","&"),window.history.replaceState(window.history.state,null,ie)},this._updateHash=Ns(this._updateHashUnthrottled,300),this._hashName=c&&encodeURIComponent(c)}addTo(c){return this._map=c,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(c){const p=this._map.getCenter(),F=Math.round(100*this._map.getZoom())/100,j=Math.ceil((F*Math.LN2+Math.log(512/360/.5))/Math.LN10),q=Math.pow(10,j),ie=Math.round(p.lng*q)/q,pe=Math.round(p.lat*q)/q,be=this._map.getBearing(),Ae=this._map.getPitch();let Fe="";if(Fe+=c?`/${ie}/${pe}/${F}`:`${F}/${pe}/${ie}`,(be||Ae)&&(Fe+="/"+Math.round(10*be)/10),Ae&&(Fe+=`/${Math.round(Ae)}`),this._hashName){const Ge=this._hashName;let at=!1;const ct=window.location.hash.slice(1).split("&").map(pt=>{const xt=pt.split("=")[0];return xt===Ge?(at=!0,`${xt}=${Fe}`):pt}).filter(pt=>pt);return at||ct.push(`${Ge}=${Fe}`),`#${ct.join("&")}`}return`#${Fe}`}}const jo={linearity:.3,easing:n.b8(0,0,.3,1)},li=n.e({deceleration:2500,maxSpeed:1400},jo),hi=n.e({deceleration:20,maxSpeed:1400},jo),xs=n.e({deceleration:1e3,maxSpeed:360},jo),Cc=n.e({deceleration:1e3,maxSpeed:90},jo);class cc{constructor(c){this._map=c,this.clear()}clear(){this._inertiaBuffer=[]}record(c){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:u.now(),settings:c})}_drainInertiaBuffer(){const c=this._inertiaBuffer,p=u.now();for(;c.length>0&&p-c[0].time>160;)c.shift()}_onMoveEnd(c){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const p={zoom:0,bearing:0,pitch:0,pan:new n.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:q}of this._inertiaBuffer)p.zoom+=q.zoomDelta||0,p.bearing+=q.bearingDelta||0,p.pitch+=q.pitchDelta||0,q.panDelta&&p.pan._add(q.panDelta),q.around&&(p.around=q.around),q.pinchAround&&(p.pinchAround=q.pinchAround);const F=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,j={};if(p.pan.mag()){const q=Zl(p.pan.mag(),F,n.e({},li,c||{}));j.offset=p.pan.mult(q.amount/p.pan.mag()),j.center=this._map.transform.center,Yl(j,q)}if(p.zoom){const q=Zl(p.zoom,F,hi);j.zoom=this._map.transform.zoom+q.amount,Yl(j,q)}if(p.bearing){const q=Zl(p.bearing,F,xs);j.bearing=this._map.transform.bearing+n.ad(q.amount,-179,179),Yl(j,q)}if(p.pitch){const q=Zl(p.pitch,F,Cc);j.pitch=this._map.transform.pitch+q.amount,Yl(j,q)}if(j.zoom||j.bearing){const q=p.pinchAround===void 0?p.around:p.pinchAround;j.around=q?this._map.unproject(q):this._map.getCenter()}return this.clear(),n.e(j,{noMoveStart:!0})}}function Yl(R,c){(!R.duration||R.duration<c.duration)&&(R.duration=c.duration,R.easing=c.easing)}function Zl(R,c,p){const{maxSpeed:F,linearity:j,deceleration:q}=p,ie=n.ad(R*j/(c/1e3),-F,F),pe=Math.abs(ie)/(q*j);return{easing:p.easing,duration:1e3*pe,amount:ie*(pe/2)}}class To extends n.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(c,p,F,j={}){const q=r.mousePos(p.getCanvas(),F),ie=p.unproject(q);super(c,n.e({point:q,lngLat:ie,originalEvent:F},j)),this._defaultPrevented=!1,this.target=p}}class go extends n.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(c,p,F){const j=c==="touchend"?F.changedTouches:F.touches,q=r.touchPos(p.getCanvasContainer(),j),ie=q.map(be=>p.unproject(be)),pe=q.reduce((be,Ae,Fe,Ge)=>be.add(Ae.div(Ge.length)),new n.P(0,0));super(c,{points:q,point:pe,lngLats:ie,lngLat:p.unproject(pe),originalEvent:F}),this._defaultPrevented=!1}}class Xs extends n.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(c,p,F){super(c,{originalEvent:F}),this._defaultPrevented=!1}}class uc{constructor(c,p){this._map=c,this._clickTolerance=p.clickTolerance}reset(){delete this._mousedownPos}wheel(c){return this._firePreventable(new Xs(c.type,this._map,c))}mousedown(c,p){return this._mousedownPos=p,this._firePreventable(new To(c.type,this._map,c))}mouseup(c){this._map.fire(new To(c.type,this._map,c))}click(c,p){this._mousedownPos&&this._mousedownPos.dist(p)>=this._clickTolerance||this._map.fire(new To(c.type,this._map,c))}dblclick(c){return this._firePreventable(new To(c.type,this._map,c))}mouseover(c){this._map.fire(new To(c.type,this._map,c))}mouseout(c){this._map.fire(new To(c.type,this._map,c))}touchstart(c){return this._firePreventable(new go(c.type,this._map,c))}touchmove(c){this._map.fire(new go(c.type,this._map,c))}touchend(c){this._map.fire(new go(c.type,this._map,c))}touchcancel(c){this._map.fire(new go(c.type,this._map,c))}_firePreventable(c){if(this._map.fire(c),c.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Io{constructor(c){this._map=c}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(c){this._map.fire(new To(c.type,this._map,c))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new To("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(c){this._delayContextMenu?this._contextMenuEvent=c:this._ignoreContextMenu||this._map.fire(new To(c.type,this._map,c)),this._map.listens("contextmenu")&&c.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ti{constructor(c){this._map=c}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(c){return this.transform.pointLocation(n.P.convert(c),this._map.terrain)}}class yo{constructor(c,p){this._map=c,this._tr=new Ti(c),this._el=c.getCanvasContainer(),this._container=c.getContainer(),this._clickTolerance=p.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(c,p){this.isEnabled()&&c.shiftKey&&c.button===0&&(r.disableDrag(),this._startPos=this._lastPos=p,this._active=!0)}mousemoveWindow(c,p){if(!this._active)return;const F=p;if(this._lastPos.equals(F)||!this._box&&F.dist(this._startPos)<this._clickTolerance)return;const j=this._startPos;this._lastPos=F,this._box||(this._box=r.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",c));const q=Math.min(j.x,F.x),ie=Math.max(j.x,F.x),pe=Math.min(j.y,F.y),be=Math.max(j.y,F.y);r.setTransform(this._box,`translate(${q}px,${pe}px)`),this._box.style.width=ie-q+"px",this._box.style.height=be-pe+"px"}mouseupWindow(c,p){if(!this._active||c.button!==0)return;const F=this._startPos,j=p;if(this.reset(),r.suppressClick(),F.x!==j.x||F.y!==j.y)return this._map.fire(new n.k("boxzoomend",{originalEvent:c})),{cameraAnimation:q=>q.fitScreenCoordinates(F,j,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",c)}keydown(c){this._active&&c.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",c))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(c,p){return this._map.fire(new n.k(c,{originalEvent:p}))}}function gi(R,c){if(R.length!==c.length)throw new Error(`The number of touches and points are not equal - touches ${R.length}, points ${c.length}`);const p={};for(let F=0;F<R.length;F++)p[R[F].identifier]=c[F];return p}class eo{constructor(c){this.reset(),this.numTouches=c.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(c,p,F){(this.centroid||F.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=c.timeStamp),F.length===this.numTouches&&(this.centroid=function(j){const q=new n.P(0,0);for(const ie of j)q._add(ie);return q.div(j.length)}(p),this.touches=gi(F,p)))}touchmove(c,p,F){if(this.aborted||!this.centroid)return;const j=gi(F,p);for(const q in this.touches){const ie=this.touches[q],pe=j[q];(!pe||pe.dist(ie)>30)&&(this.aborted=!0)}}touchend(c,p,F){if((!this.centroid||c.timeStamp-this.startTime>500)&&(this.aborted=!0),F.length===0){const j=!this.aborted&&this.centroid;if(this.reset(),j)return j}}}class yi{constructor(c){this.singleTap=new eo(c),this.numTaps=c.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(c,p,F){this.singleTap.touchstart(c,p,F)}touchmove(c,p,F){this.singleTap.touchmove(c,p,F)}touchend(c,p,F){const j=this.singleTap.touchend(c,p,F);if(j){const q=c.timeStamp-this.lastTime<500,ie=!this.lastTap||this.lastTap.dist(j)<30;if(q&&ie||this.reset(),this.count++,this.lastTime=c.timeStamp,this.lastTap=j,this.count===this.numTaps)return this.reset(),j}}}class so{constructor(c){this._tr=new Ti(c),this._zoomIn=new yi({numTouches:1,numTaps:2}),this._zoomOut=new yi({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(c,p,F){this._zoomIn.touchstart(c,p,F),this._zoomOut.touchstart(c,p,F)}touchmove(c,p,F){this._zoomIn.touchmove(c,p,F),this._zoomOut.touchmove(c,p,F)}touchend(c,p,F){const j=this._zoomIn.touchend(c,p,F),q=this._zoomOut.touchend(c,p,F),ie=this._tr;return j?(this._active=!0,c.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:pe=>pe.easeTo({duration:300,zoom:ie.zoom+1,around:ie.unproject(j)},{originalEvent:c})}):q?(this._active=!0,c.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:pe=>pe.easeTo({duration:300,zoom:ie.zoom-1,around:ie.unproject(q)},{originalEvent:c})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class vo{constructor(c){this._enabled=!!c.enable,this._moveStateManager=c.moveStateManager,this._clickTolerance=c.clickTolerance||1,this._moveFunction=c.move,this._activateOnStart=!!c.activateOnStart,c.assignEvents(this),this.reset()}reset(c){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(c)}_move(...c){const p=this._moveFunction(...c);if(p.bearingDelta||p.pitchDelta||p.around||p.panDelta)return this._active=!0,p}dragStart(c,p){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(c)&&(this._moveStateManager.startMove(c),this._lastPoint=p.length?p[0]:p,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(c,p){if(!this.isEnabled())return;const F=this._lastPoint;if(!F)return;if(c.preventDefault(),!this._moveStateManager.isValidMoveEvent(c))return void this.reset(c);const j=p.length?p[0]:p;return!this._moved&&j.dist(F)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=j,this._move(F,j))}dragEnd(c){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(c)&&(this._moved&&r.suppressClick(),this.reset(c))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Js={0:1,2:2};class es{constructor(c){this._correctEvent=c.checkCorrectEvent}startMove(c){const p=r.mouseButton(c);this._eventButton=p}endMove(c){delete this._eventButton}isValidStartEvent(c){return this._correctEvent(c)}isValidMoveEvent(c){return!function(p,F){const j=Js[F];return p.buttons===void 0||(p.buttons&j)!==j}(c,this._eventButton)}isValidEndEvent(c){return r.mouseButton(c)===this._eventButton}}class Nl{constructor(){this._firstTouch=void 0}_isOneFingerTouch(c){return c.targetTouches.length===1}_isSameTouchEvent(c){return c.targetTouches[0].identifier===this._firstTouch}startMove(c){const p=c.targetTouches[0].identifier;this._firstTouch=p}endMove(c){delete this._firstTouch}isValidStartEvent(c){return this._isOneFingerTouch(c)}isValidMoveEvent(c){return this._isOneFingerTouch(c)&&this._isSameTouchEvent(c)}isValidEndEvent(c){return this._isOneFingerTouch(c)&&this._isSameTouchEvent(c)}}const Co=R=>{R.mousedown=R.dragStart,R.mousemoveWindow=R.dragMove,R.mouseup=R.dragEnd,R.contextmenu=c=>{c.preventDefault()}},Xl=({enable:R,clickTolerance:c,bearingDegreesPerPixelMoved:p=.8})=>{const F=new es({checkCorrectEvent:j=>r.mouseButton(j)===0&&j.ctrlKey||r.mouseButton(j)===2});return new vo({clickTolerance:c,move:(j,q)=>({bearingDelta:(q.x-j.x)*p}),moveStateManager:F,enable:R,assignEvents:Co})},Ks=({enable:R,clickTolerance:c,pitchDegreesPerPixelMoved:p=-.5})=>{const F=new es({checkCorrectEvent:j=>r.mouseButton(j)===0&&j.ctrlKey||r.mouseButton(j)===2});return new vo({clickTolerance:c,move:(j,q)=>({pitchDelta:(q.y-j.y)*p}),moveStateManager:F,enable:R,assignEvents:Co})};class ws{constructor(c,p){this._clickTolerance=c.clickTolerance||1,this._map=p,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new n.P(0,0)}_shouldBePrevented(c){return c<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(c,p,F){return this._calculateTransform(c,p,F)}touchmove(c,p,F){if(this._active){if(!this._shouldBePrevented(F.length))return c.preventDefault(),this._calculateTransform(c,p,F);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",c)}}touchend(c,p,F){this._calculateTransform(c,p,F),this._active&&this._shouldBePrevented(F.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(c,p,F){F.length>0&&(this._active=!0);const j=gi(F,p),q=new n.P(0,0),ie=new n.P(0,0);let pe=0;for(const Ae in j){const Fe=j[Ae],Ge=this._touches[Ae];Ge&&(q._add(Fe),ie._add(Fe.sub(Ge)),pe++,j[Ae]=Fe)}if(this._touches=j,this._shouldBePrevented(pe)||!ie.mag())return;const be=ie.div(pe);return this._sum._add(be),this._sum.mag()<this._clickTolerance?void 0:{around:q.div(pe),panDelta:be}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class lo{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(c,p,F){this._firstTwoTouches||F.length<2||(this._firstTwoTouches=[F[0].identifier,F[1].identifier],this._start([p[0],p[1]]))}touchmove(c,p,F){if(!this._firstTwoTouches)return;c.preventDefault();const[j,q]=this._firstTwoTouches,ie=vi(F,p,j),pe=vi(F,p,q);if(!ie||!pe)return;const be=this._aroundCenter?null:ie.add(pe).div(2);return this._move([ie,pe],be,c)}touchend(c,p,F){if(!this._firstTwoTouches)return;const[j,q]=this._firstTwoTouches,ie=vi(F,p,j),pe=vi(F,p,q);ie&&pe||(this._active&&r.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(c){this._enabled=!0,this._aroundCenter=!!c&&c.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function vi(R,c,p){for(let F=0;F<R.length;F++)if(R[F].identifier===p)return c[F]}function ks(R,c){return Math.log(R/c)/Math.LN2}class sr extends lo{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(c){this._startDistance=this._distance=c[0].dist(c[1])}_move(c,p){const F=this._distance;if(this._distance=c[0].dist(c[1]),this._active||!(Math.abs(ks(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:ks(this._distance,F),pinchAround:p}}}function Ec(R,c){return 180*R.angleWith(c)/Math.PI}class qc extends lo{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(c){this._startVector=this._vector=c[0].sub(c[1]),this._minDiameter=c[0].dist(c[1])}_move(c,p,F){const j=this._vector;if(this._vector=c[0].sub(c[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Ec(this._vector,j),pinchAround:p}}_isBelowThreshold(c){this._minDiameter=Math.min(this._minDiameter,c.mag());const p=25/(Math.PI*this._minDiameter)*360,F=Ec(c,this._startVector);return Math.abs(F)<p}}function Qs(R){return Math.abs(R.y)>Math.abs(R.x)}class Dl extends lo{constructor(c){super(),this._currentTouchCount=0,this._map=c}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(c,p,F){super.touchstart(c,p,F),this._currentTouchCount=F.length}_start(c){this._lastPoints=c,Qs(c[0].sub(c[1]))&&(this._valid=!1)}_move(c,p,F){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const j=c[0].sub(this._lastPoints[0]),q=c[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(j,q,F.timeStamp),this._valid?(this._lastPoints=c,this._active=!0,{pitchDelta:(j.y+q.y)/2*-.5}):void 0}gestureBeginsVertically(c,p,F){if(this._valid!==void 0)return this._valid;const j=c.mag()>=2,q=p.mag()>=2;if(!j&&!q)return;if(!j||!q)return this._firstMove===void 0&&(this._firstMove=F),F-this._firstMove<100&&void 0;const ie=c.y>0==p.y>0;return Qs(c)&&Qs(p)&&ie}}const Sl={panStep:100,bearingStep:15,pitchStep:10};class dc{constructor(c){this._tr=new Ti(c);const p=Sl;this._panStep=p.panStep,this._bearingStep=p.bearingStep,this._pitchStep=p.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(c){if(c.altKey||c.ctrlKey||c.metaKey)return;let p=0,F=0,j=0,q=0,ie=0;switch(c.keyCode){case 61:case 107:case 171:case 187:p=1;break;case 189:case 109:case 173:p=-1;break;case 37:c.shiftKey?F=-1:(c.preventDefault(),q=-1);break;case 39:c.shiftKey?F=1:(c.preventDefault(),q=1);break;case 38:c.shiftKey?j=1:(c.preventDefault(),ie=-1);break;case 40:c.shiftKey?j=-1:(c.preventDefault(),ie=1);break;default:return}return this._rotationDisabled&&(F=0,j=0),{cameraAnimation:pe=>{const be=this._tr;pe.easeTo({duration:300,easeId:"keyboardHandler",easing:Wa,zoom:p?Math.round(be.zoom)+p*(c.shiftKey?2:1):be.zoom,bearing:be.bearing+F*this._bearingStep,pitch:be.pitch+j*this._pitchStep,offset:[-q*this._panStep,-ie*this._panStep],center:be.center},{originalEvent:c})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Wa(R){return R*(2-R)}const ts=4.000244140625;class el{constructor(c,p){this._onTimeout=F=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(F)},this._map=c,this._tr=new Ti(c),this._triggerRenderFrame=p,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(c){this._defaultZoomRate=c}setWheelZoomRate(c){this._wheelZoomRate=c}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(c){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!c&&c.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(c){return!!this._map.cooperativeGestures.isEnabled()&&!(c.ctrlKey||this._map.cooperativeGestures.isBypassed(c))}wheel(c){if(!this.isEnabled())return;if(this._shouldBePrevented(c))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",c);let p=c.deltaMode===WheelEvent.DOM_DELTA_LINE?40*c.deltaY:c.deltaY;const F=u.now(),j=F-(this._lastWheelEventTime||0);this._lastWheelEventTime=F,p!==0&&p%ts==0?this._type="wheel":p!==0&&Math.abs(p)<4?this._type="trackpad":j>400?(this._type=null,this._lastValue=p,this._timeout=setTimeout(this._onTimeout,40,c)):this._type||(this._type=Math.abs(j*p)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,p+=this._lastValue)),c.shiftKey&&p&&(p/=4),this._type&&(this._lastWheelEvent=c,this._delta-=p,this._active||this._start(c)),c.preventDefault()}_start(c){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const p=r.mousePos(this._map.getCanvas(),c),F=this._tr;p.y>F.transform.height/2-F.transform.getHorizon()?this._around=n.N.convert(this._aroundCenter?F.center:F.unproject(p)):this._around=n.N.convert(F.center),this._aroundPoint=F.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const c=this._tr.transform;if(this._delta!==0){const be=this._type==="wheel"&&Math.abs(this._delta)>ts?this._wheelZoomRate:this._defaultZoomRate;let Ae=2/(1+Math.exp(-Math.abs(this._delta*be)));this._delta<0&&Ae!==0&&(Ae=1/Ae);const Fe=typeof this._targetZoom=="number"?c.zoomScale(this._targetZoom):c.scale;this._targetZoom=Math.min(c.maxZoom,Math.max(c.minZoom,c.scaleZoom(Fe*Ae))),this._type==="wheel"&&(this._startZoom=c.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const p=typeof this._targetZoom=="number"?this._targetZoom:c.zoom,F=this._startZoom,j=this._easing;let q,ie=!1;const pe=u.now()-this._lastWheelEventTime;if(this._type==="wheel"&&F&&j&&pe){const be=Math.min(pe/200,1),Ae=j(be);q=n.z.number(F,p,Ae),be<1?this._frameId||(this._frameId=!0):ie=!0}else q=p,ie=!0;return this._active=!0,ie&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!ie,zoomDelta:q-c.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(c){let p=n.b9;if(this._prevEase){const F=this._prevEase,j=(u.now()-F.start)/F.duration,q=F.easing(j+.01)-F.easing(j),ie=.27/Math.sqrt(q*q+1e-4)*.01,pe=Math.sqrt(.0729-ie*ie);p=n.b8(ie,pe,.25,1)}return this._prevEase={start:u.now(),duration:c,easing:p},p}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Ci{constructor(c,p){this._clickZoom=c,this._tapZoom=p}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class $o{constructor(c){this._tr=new Ti(c),this.reset()}reset(){this._active=!1}dblclick(c,p){return c.preventDefault(),{cameraAnimation:F=>{F.easeTo({duration:300,zoom:this._tr.zoom+(c.shiftKey?-1:1),around:this._tr.unproject(p)},{originalEvent:c})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class tl{constructor(){this._tap=new yi({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(c,p,F){if(!this._swipePoint)if(this._tapTime){const j=p[0],q=c.timeStamp-this._tapTime<500,ie=this._tapPoint.dist(j)<30;q&&ie?F.length>0&&(this._swipePoint=j,this._swipeTouch=F[0].identifier):this.reset()}else this._tap.touchstart(c,p,F)}touchmove(c,p,F){if(this._tapTime){if(this._swipePoint){if(F[0].identifier!==this._swipeTouch)return;const j=p[0],q=j.y-this._swipePoint.y;return this._swipePoint=j,c.preventDefault(),this._active=!0,{zoomDelta:q/128}}}else this._tap.touchmove(c,p,F)}touchend(c,p,F){if(this._tapTime)this._swipePoint&&F.length===0&&this.reset();else{const j=this._tap.touchend(c,p,F);j&&(this._tapTime=c.timeStamp,this._tapPoint=j)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ss{constructor(c,p,F){this._el=c,this._mousePan=p,this._touchPan=F}enable(c){this._inertiaOptions=c||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Po{constructor(c,p,F){this._pitchWithRotate=c.pitchWithRotate,this._mouseRotate=p,this._mousePitch=F}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class nl{constructor(c,p,F,j){this._el=c,this._touchZoom=p,this._touchRotate=F,this._tapDragZoom=j,this._rotationDisabled=!1,this._enabled=!0}enable(c){this._touchZoom.enable(c),this._rotationDisabled||this._touchRotate.enable(c),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class ls{constructor(c,p){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=c,this._options=p,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const c=this._map.getCanvasContainer();c.classList.add("maplibregl-cooperative-gestures"),this._container=r.create("div","maplibregl-cooperative-gesture-screen",c);let p=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(p=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const F=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),j=document.createElement("div");j.className="maplibregl-desktop-message",j.textContent=p,this._container.appendChild(j);const q=document.createElement("div");q.className="maplibregl-mobile-message",q.textContent=F,this._container.appendChild(q),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(r.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(c){return c[this._bypassKey]}notifyGestureBlocked(c,p){this._enabled&&(this._map.fire(new n.k("cooperativegestureprevented",{gestureType:c,originalEvent:p})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Uo=R=>R.zoom||R.drag||R.pitch||R.rotate;class Ts extends n.k{}function ar(R){return R.panDelta&&R.panDelta.mag()||R.zoomDelta||R.bearingDelta||R.pitchDelta}class ri{constructor(c,p){this.handleWindowEvent=j=>{this.handleEvent(j,`${j.type}Window`)},this.handleEvent=(j,q)=>{if(j.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const ie=j.type==="renderFrame"?void 0:j,pe={needsRenderFrame:!1},be={},Ae={},Fe=j.touches,Ge=Fe?this._getMapTouches(Fe):void 0,at=Ge?r.touchPos(this._map.getCanvas(),Ge):r.mousePos(this._map.getCanvas(),j);for(const{handlerName:xt,handler:At,allowed:Tt}of this._handlers){if(!At.isEnabled())continue;let Rt;this._blockedByActive(Ae,Tt,xt)?At.reset():At[q||j.type]&&(Rt=At[q||j.type](j,at,Ge),this.mergeHandlerResult(pe,be,Rt,xt,ie),Rt&&Rt.needsRenderFrame&&this._triggerRenderFrame()),(Rt||At.isActive())&&(Ae[xt]=At)}const ct={};for(const xt in this._previousActiveHandlers)Ae[xt]||(ct[xt]=ie);this._previousActiveHandlers=Ae,(Object.keys(ct).length||ar(pe))&&(this._changes.push([pe,be,ct]),this._triggerRenderFrame()),(Object.keys(Ae).length||ar(pe))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:pt}=pe;pt&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],pt(this._map))},this._map=c,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new cc(c),this._bearingSnap=p.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(p);const F=this._el;this._listeners=[[F,"touchstart",{passive:!0}],[F,"touchmove",{passive:!1}],[F,"touchend",void 0],[F,"touchcancel",void 0],[F,"mousedown",void 0],[F,"mousemove",void 0],[F,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[F,"mouseover",void 0],[F,"mouseout",void 0],[F,"dblclick",void 0],[F,"click",void 0],[F,"keydown",{capture:!1}],[F,"keyup",void 0],[F,"wheel",{passive:!1}],[F,"contextmenu",void 0],[window,"blur",void 0]];for(const[j,q,ie]of this._listeners)r.addEventListener(j,q,j===document?this.handleWindowEvent:this.handleEvent,ie)}destroy(){for(const[c,p,F]of this._listeners)r.removeEventListener(c,p,c===document?this.handleWindowEvent:this.handleEvent,F)}_addDefaultHandlers(c){const p=this._map,F=p.getCanvasContainer();this._add("mapEvent",new uc(p,c));const j=p.boxZoom=new yo(p,c);this._add("boxZoom",j),c.interactive&&c.boxZoom&&j.enable();const q=p.cooperativeGestures=new ls(p,c.cooperativeGestures);this._add("cooperativeGestures",q),c.cooperativeGestures&&q.enable();const ie=new so(p),pe=new $o(p);p.doubleClickZoom=new Ci(pe,ie),this._add("tapZoom",ie),this._add("clickZoom",pe),c.interactive&&c.doubleClickZoom&&p.doubleClickZoom.enable();const be=new tl;this._add("tapDragZoom",be);const Ae=p.touchPitch=new Dl(p);this._add("touchPitch",Ae),c.interactive&&c.touchPitch&&p.touchPitch.enable(c.touchPitch);const Fe=Xl(c),Ge=Ks(c);p.dragRotate=new Po(c,Fe,Ge),this._add("mouseRotate",Fe,["mousePitch"]),this._add("mousePitch",Ge,["mouseRotate"]),c.interactive&&c.dragRotate&&p.dragRotate.enable();const at=(({enable:Rt,clickTolerance:Et})=>{const Yt=new es({checkCorrectEvent:Kt=>r.mouseButton(Kt)===0&&!Kt.ctrlKey});return new vo({clickTolerance:Et,move:(Kt,Zt)=>({around:Zt,panDelta:Zt.sub(Kt)}),activateOnStart:!0,moveStateManager:Yt,enable:Rt,assignEvents:Co})})(c),ct=new ws(c,p);p.dragPan=new Ss(F,at,ct),this._add("mousePan",at),this._add("touchPan",ct,["touchZoom","touchRotate"]),c.interactive&&c.dragPan&&p.dragPan.enable(c.dragPan);const pt=new qc,xt=new sr;p.touchZoomRotate=new nl(F,xt,pt,be),this._add("touchRotate",pt,["touchPan","touchZoom"]),this._add("touchZoom",xt,["touchPan","touchRotate"]),c.interactive&&c.touchZoomRotate&&p.touchZoomRotate.enable(c.touchZoomRotate);const At=p.scrollZoom=new el(p,()=>this._triggerRenderFrame());this._add("scrollZoom",At,["mousePan"]),c.interactive&&c.scrollZoom&&p.scrollZoom.enable(c.scrollZoom);const Tt=p.keyboard=new dc(p);this._add("keyboard",Tt),c.interactive&&c.keyboard&&p.keyboard.enable(),this._add("blockableMapEvent",new Io(p))}_add(c,p,F){this._handlers.push({handlerName:c,handler:p,allowed:F}),this._handlersById[c]=p}stop(c){if(!this._updatingCamera){for(const{handler:p}of this._handlers)p.reset();this._inertia.clear(),this._fireEvents({},{},c),this._changes=[]}}isActive(){for(const{handler:c}of this._handlers)if(c.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Uo(this._eventsInProgress)||this.isZooming()}_blockedByActive(c,p,F){for(const j in c)if(j!==F&&(!p||p.indexOf(j)<0))return!0;return!1}_getMapTouches(c){const p=[];for(const F of c){const j=F.target;this._el.contains(j)&&p.push(F)}return p}mergeHandlerResult(c,p,F,j,q){if(!F)return;n.e(c,F);const ie={handlerName:j,originalEvent:F.originalEvent||q};F.zoomDelta!==void 0&&(p.zoom=ie),F.panDelta!==void 0&&(p.drag=ie),F.pitchDelta!==void 0&&(p.pitch=ie),F.bearingDelta!==void 0&&(p.rotate=ie)}_applyChanges(){const c={},p={},F={};for(const[j,q,ie]of this._changes)j.panDelta&&(c.panDelta=(c.panDelta||new n.P(0,0))._add(j.panDelta)),j.zoomDelta&&(c.zoomDelta=(c.zoomDelta||0)+j.zoomDelta),j.bearingDelta&&(c.bearingDelta=(c.bearingDelta||0)+j.bearingDelta),j.pitchDelta&&(c.pitchDelta=(c.pitchDelta||0)+j.pitchDelta),j.around!==void 0&&(c.around=j.around),j.pinchAround!==void 0&&(c.pinchAround=j.pinchAround),j.noInertia&&(c.noInertia=j.noInertia),n.e(p,q),n.e(F,ie);this._updateMapTransform(c,p,F),this._changes=[]}_updateMapTransform(c,p,F){const j=this._map,q=j._getTransformForUpdate(),ie=j.terrain;if(!(ar(c)||ie&&this._terrainMovement))return this._fireEvents(p,F,!0);let{panDelta:pe,zoomDelta:be,bearingDelta:Ae,pitchDelta:Fe,around:Ge,pinchAround:at}=c;at!==void 0&&(Ge=at),j._stop(!0),Ge=Ge||j.transform.centerPoint;const ct=q.pointLocation(pe?Ge.sub(pe):Ge);Ae&&(q.bearing+=Ae),Fe&&(q.pitch+=Fe),be&&(q.zoom+=be),ie?this._terrainMovement||!p.drag&&!p.zoom?p.drag&&this._terrainMovement?q.center=q.pointLocation(q.centerPoint.sub(pe)):q.setLocationAtPoint(ct,Ge):(this._terrainMovement=!0,this._map._elevationFreeze=!0,q.setLocationAtPoint(ct,Ge)):q.setLocationAtPoint(ct,Ge),j._applyUpdatedTransform(q),this._map._update(),c.noInertia||this._inertia.record(c),this._fireEvents(p,F,!0)}_fireEvents(c,p,F){const j=Uo(this._eventsInProgress),q=Uo(c),ie={};for(const Ge in c){const{originalEvent:at}=c[Ge];this._eventsInProgress[Ge]||(ie[`${Ge}start`]=at),this._eventsInProgress[Ge]=c[Ge]}!j&&q&&this._fireEvent("movestart",q.originalEvent);for(const Ge in ie)this._fireEvent(Ge,ie[Ge]);q&&this._fireEvent("move",q.originalEvent);for(const Ge in c){const{originalEvent:at}=c[Ge];this._fireEvent(Ge,at)}const pe={};let be;for(const Ge in this._eventsInProgress){const{handlerName:at,originalEvent:ct}=this._eventsInProgress[Ge];this._handlersById[at].isActive()||(delete this._eventsInProgress[Ge],be=p[at]||ct,pe[`${Ge}end`]=be)}for(const Ge in pe)this._fireEvent(Ge,pe[Ge]);const Ae=Uo(this._eventsInProgress),Fe=(j||q)&&!Ae;if(Fe&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const Ge=this._map._getTransformForUpdate();Ge.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(Ge)}if(F&&Fe){this._updatingCamera=!0;const Ge=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),at=ct=>ct!==0&&-this._bearingSnap<ct&&ct<this._bearingSnap;!Ge||!Ge.essential&&u.prefersReducedMotion?(this._map.fire(new n.k("moveend",{originalEvent:be})),at(this._map.getBearing())&&this._map.resetNorth()):(at(Ge.bearing||this._map.getBearing())&&(Ge.bearing=0),Ge.freezeElevation=!0,this._map.easeTo(Ge,{originalEvent:be})),this._updatingCamera=!1}}_fireEvent(c,p){this._map.fire(new n.k(c,p?{originalEvent:p}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(c=>{delete this._frameId,this.handleEvent(new Ts("renderFrame",{timeStamp:c})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class to extends n.E{constructor(c,p){super(),this._renderFrameCallback=()=>{const F=Math.min((u.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(F)),F<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=c,this._bearingSnap=p.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new n.N(this.transform.center.lng,this.transform.center.lat)}setCenter(c,p){return this.jumpTo({center:c},p)}panBy(c,p,F){return c=n.P.convert(c).mult(-1),this.panTo(this.transform.center,n.e({offset:c},p),F)}panTo(c,p,F){return this.easeTo(n.e({center:c},p),F)}getZoom(){return this.transform.zoom}setZoom(c,p){return this.jumpTo({zoom:c},p),this}zoomTo(c,p,F){return this.easeTo(n.e({zoom:c},p),F)}zoomIn(c,p){return this.zoomTo(this.getZoom()+1,c,p),this}zoomOut(c,p){return this.zoomTo(this.getZoom()-1,c,p),this}getBearing(){return this.transform.bearing}setBearing(c,p){return this.jumpTo({bearing:c},p),this}getPadding(){return this.transform.padding}setPadding(c,p){return this.jumpTo({padding:c},p),this}rotateTo(c,p,F){return this.easeTo(n.e({bearing:c},p),F)}resetNorth(c,p){return this.rotateTo(0,n.e({duration:1e3},c),p),this}resetNorthPitch(c,p){return this.easeTo(n.e({bearing:0,pitch:0,duration:1e3},c),p),this}snapToNorth(c,p){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(c,p):this}getPitch(){return this.transform.pitch}setPitch(c,p){return this.jumpTo({pitch:c},p),this}cameraForBounds(c,p){c=Te.convert(c);const F=p&&p.bearing||0;return this._cameraForBoxAndBearing(c.getNorthWest(),c.getSouthEast(),F,p)}_cameraForBoxAndBearing(c,p,F,j){const q={top:0,bottom:0,right:0,left:0};if(typeof(j=n.e({padding:q,offset:[0,0],maxZoom:this.transform.maxZoom},j)).padding=="number"){const ya=j.padding;j.padding={top:ya,bottom:ya,right:ya,left:ya}}j.padding=n.e(q,j.padding);const ie=this.transform,pe=ie.padding,be=new Te(c,p),Ae=ie.project(be.getNorthWest()),Fe=ie.project(be.getNorthEast()),Ge=ie.project(be.getSouthEast()),at=ie.project(be.getSouthWest()),ct=n.ba(-F),pt=Ae.rotate(ct),xt=Fe.rotate(ct),At=Ge.rotate(ct),Tt=at.rotate(ct),Rt=new n.P(Math.max(pt.x,xt.x,Tt.x,At.x),Math.max(pt.y,xt.y,Tt.y,At.y)),Et=new n.P(Math.min(pt.x,xt.x,Tt.x,At.x),Math.min(pt.y,xt.y,Tt.y,At.y)),Yt=Rt.sub(Et),Kt=(ie.width-(pe.left+pe.right+j.padding.left+j.padding.right))/Yt.x,Zt=(ie.height-(pe.top+pe.bottom+j.padding.top+j.padding.bottom))/Yt.y;if(Zt<0||Kt<0)return void n.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");const hn=Math.min(ie.scaleZoom(ie.scale*Math.min(Kt,Zt)),j.maxZoom),xn=n.P.convert(j.offset),Nn=(j.padding.left-j.padding.right)/2,Dn=(j.padding.top-j.padding.bottom)/2,Gn=new n.P(Nn,Dn).rotate(n.ba(F)),Kn=xn.add(Gn).mult(ie.scale/ie.zoomScale(hn));return{center:ie.unproject(Ae.add(Ge).div(2).sub(Kn)),zoom:hn,bearing:F}}fitBounds(c,p,F){return this._fitInternal(this.cameraForBounds(c,p),p,F)}fitScreenCoordinates(c,p,F,j,q){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(n.P.convert(c)),this.transform.pointLocation(n.P.convert(p)),F,j),j,q)}_fitInternal(c,p,F){return c?(delete(p=n.e(c,p)).padding,p.linear?this.easeTo(p,F):this.flyTo(p,F)):this}jumpTo(c,p){this.stop();const F=this._getTransformForUpdate();let j=!1,q=!1,ie=!1;return"zoom"in c&&F.zoom!==+c.zoom&&(j=!0,F.zoom=+c.zoom),c.center!==void 0&&(F.center=n.N.convert(c.center)),"bearing"in c&&F.bearing!==+c.bearing&&(q=!0,F.bearing=+c.bearing),"pitch"in c&&F.pitch!==+c.pitch&&(ie=!0,F.pitch=+c.pitch),c.padding==null||F.isPaddingEqual(c.padding)||(F.padding=c.padding),this._applyUpdatedTransform(F),this.fire(new n.k("movestart",p)).fire(new n.k("move",p)),j&&this.fire(new n.k("zoomstart",p)).fire(new n.k("zoom",p)).fire(new n.k("zoomend",p)),q&&this.fire(new n.k("rotatestart",p)).fire(new n.k("rotate",p)).fire(new n.k("rotateend",p)),ie&&this.fire(new n.k("pitchstart",p)).fire(new n.k("pitch",p)).fire(new n.k("pitchend",p)),this.fire(new n.k("moveend",p))}calculateCameraOptionsFromTo(c,p,F,j=0){const q=n.Z.fromLngLat(c,p),ie=n.Z.fromLngLat(F,j),pe=ie.x-q.x,be=ie.y-q.y,Ae=ie.z-q.z,Fe=Math.hypot(pe,be,Ae);if(Fe===0)throw new Error("Can't calculate camera options with same From and To");const Ge=Math.hypot(pe,be),at=this.transform.scaleZoom(this.transform.cameraToCenterDistance/Fe/this.transform.tileSize),ct=180*Math.atan2(pe,-be)/Math.PI;let pt=180*Math.acos(Ge/Fe)/Math.PI;return pt=Ae<0?90-pt:90+pt,{center:ie.toLngLat(),zoom:at,pitch:pt,bearing:ct}}easeTo(c,p){var F;this._stop(!1,c.easeId),((c=n.e({offset:[0,0],duration:500,easing:n.b9},c)).animate===!1||!c.essential&&u.prefersReducedMotion)&&(c.duration=0);const j=this._getTransformForUpdate(),q=j.zoom,ie=j.bearing,pe=j.pitch,be=j.padding,Ae="bearing"in c?this._normalizeBearing(c.bearing,ie):ie,Fe="pitch"in c?+c.pitch:pe,Ge="padding"in c?c.padding:j.padding,at=n.P.convert(c.offset);let ct=j.centerPoint.add(at);const pt=j.pointLocation(ct),{center:xt,zoom:At}=j.getConstrained(n.N.convert(c.center||pt),(F=c.zoom)!==null&&F!==void 0?F:q);this._normalizeCenter(xt,j);const Tt=j.project(pt),Rt=j.project(xt).sub(Tt),Et=j.zoomScale(At-q);let Yt,Kt;c.around&&(Yt=n.N.convert(c.around),Kt=j.locationPoint(Yt));const Zt={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||At!==q,this._rotating=this._rotating||ie!==Ae,this._pitching=this._pitching||Fe!==pe,this._padding=!j.isPaddingEqual(Ge),this._easeId=c.easeId,this._prepareEase(p,c.noMoveStart,Zt),this.terrain&&this._prepareElevation(xt),this._ease(hn=>{if(this._zooming&&(j.zoom=n.z.number(q,At,hn)),this._rotating&&(j.bearing=n.z.number(ie,Ae,hn)),this._pitching&&(j.pitch=n.z.number(pe,Fe,hn)),this._padding&&(j.interpolatePadding(be,Ge,hn),ct=j.centerPoint.add(at)),this.terrain&&!c.freezeElevation&&this._updateElevation(hn),Yt)j.setLocationAtPoint(Yt,Kt);else{const xn=j.zoomScale(j.zoom-q),Nn=At>q?Math.min(2,Et):Math.max(.5,Et),Dn=Math.pow(Nn,1-hn),Gn=j.unproject(Tt.add(Rt.mult(hn*Dn)).mult(xn));j.setLocationAtPoint(j.renderWorldCopies?Gn.wrap():Gn,ct)}this._applyUpdatedTransform(j),this._fireMoveEvents(p)},hn=>{this.terrain&&c.freezeElevation&&this._finalizeElevation(),this._afterEase(p,hn)},c),this}_prepareEase(c,p,F={}){this._moving=!0,p||F.moving||this.fire(new n.k("movestart",c)),this._zooming&&!F.zooming&&this.fire(new n.k("zoomstart",c)),this._rotating&&!F.rotating&&this.fire(new n.k("rotatestart",c)),this._pitching&&!F.pitching&&this.fire(new n.k("pitchstart",c))}_prepareElevation(c){this._elevationCenter=c,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(c,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(c){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const p=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(c<1&&p!==this._elevationTarget){const F=this._elevationTarget-this._elevationStart,j=(p-(F*c+this._elevationStart))/(1-c);this._elevationStart+=c*(F-j),this._elevationTarget=p}this.transform.elevation=n.z.number(this._elevationStart,this._elevationTarget,c)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(c){const p=c.getCameraPosition(),F=this.terrain.getElevationForLngLatZoom(p.lngLat,c.zoom);if(p.altitude<F){const j=this.calculateCameraOptionsFromTo(p.lngLat,F,c.center,c.elevation);return{pitch:j.pitch,zoom:j.zoom}}return{}}_applyUpdatedTransform(c){const p=[];if(this.terrain&&p.push(j=>this._elevateCameraIfInsideTerrain(j)),this.transformCameraUpdate&&p.push(j=>this.transformCameraUpdate(j)),!p.length)return;const F=c.clone();for(const j of p){const q=F.clone(),{center:ie,zoom:pe,pitch:be,bearing:Ae,elevation:Fe}=j(q);ie&&(q.center=ie),pe!==void 0&&(q.zoom=pe),be!==void 0&&(q.pitch=be),Ae!==void 0&&(q.bearing=Ae),Fe!==void 0&&(q.elevation=Fe),F.apply(q)}this.transform.apply(F)}_fireMoveEvents(c){this.fire(new n.k("move",c)),this._zooming&&this.fire(new n.k("zoom",c)),this._rotating&&this.fire(new n.k("rotate",c)),this._pitching&&this.fire(new n.k("pitch",c))}_afterEase(c,p){if(this._easeId&&p&&this._easeId===p)return;delete this._easeId;const F=this._zooming,j=this._rotating,q=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,F&&this.fire(new n.k("zoomend",c)),j&&this.fire(new n.k("rotateend",c)),q&&this.fire(new n.k("pitchend",c)),this.fire(new n.k("moveend",c))}flyTo(c,p){var F;if(!c.essential&&u.prefersReducedMotion){const ia=n.M(c,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ia,p)}this.stop(),c=n.e({offset:[0,0],speed:1.2,curve:1.42,easing:n.b9},c);const j=this._getTransformForUpdate(),q=j.zoom,ie=j.bearing,pe=j.pitch,be=j.padding,Ae="bearing"in c?this._normalizeBearing(c.bearing,ie):ie,Fe="pitch"in c?+c.pitch:pe,Ge="padding"in c?c.padding:j.padding,at=n.P.convert(c.offset);let ct=j.centerPoint.add(at);const pt=j.pointLocation(ct),{center:xt,zoom:At}=j.getConstrained(n.N.convert(c.center||pt),(F=c.zoom)!==null&&F!==void 0?F:q);this._normalizeCenter(xt,j);const Tt=j.zoomScale(At-q),Rt=j.project(pt),Et=j.project(xt).sub(Rt);let Yt=c.curve;const Kt=Math.max(j.width,j.height),Zt=Kt/Tt,hn=Et.mag();if("minZoom"in c){const ia=n.ad(Math.min(c.minZoom,q,At),j.minZoom,j.maxZoom),Ta=Kt/j.zoomScale(ia-q);Yt=Math.sqrt(Ta/hn*2)}const xn=Yt*Yt;function Nn(ia){const Ta=(Zt*Zt-Kt*Kt+(ia?-1:1)*xn*xn*hn*hn)/(2*(ia?Zt:Kt)*xn*hn);return Math.log(Math.sqrt(Ta*Ta+1)-Ta)}function Dn(ia){return(Math.exp(ia)-Math.exp(-ia))/2}function Gn(ia){return(Math.exp(ia)+Math.exp(-ia))/2}const Kn=Nn(!1);let ya=function(ia){return Gn(Kn)/Gn(Kn+Yt*ia)},ea=function(ia){return Kt*((Gn(Kn)*(Dn(Ta=Kn+Yt*ia)/Gn(Ta))-Dn(Kn))/xn)/hn;var Ta},wa=(Nn(!0)-Kn)/Yt;if(Math.abs(hn)<1e-6||!isFinite(wa)){if(Math.abs(Kt-Zt)<1e-6)return this.easeTo(c,p);const ia=Zt<Kt?-1:1;wa=Math.abs(Math.log(Zt/Kt))/Yt,ea=()=>0,ya=Ta=>Math.exp(ia*Yt*Ta)}if("duration"in c)c.duration=+c.duration;else{const ia="screenSpeed"in c?+c.screenSpeed/Yt:+c.speed;c.duration=1e3*wa/ia}return c.maxDuration&&c.duration>c.maxDuration&&(c.duration=0),this._zooming=!0,this._rotating=ie!==Ae,this._pitching=Fe!==pe,this._padding=!j.isPaddingEqual(Ge),this._prepareEase(p,!1),this.terrain&&this._prepareElevation(xt),this._ease(ia=>{const Ta=ia*wa,fa=1/ya(Ta);j.zoom=ia===1?At:q+j.scaleZoom(fa),this._rotating&&(j.bearing=n.z.number(ie,Ae,ia)),this._pitching&&(j.pitch=n.z.number(pe,Fe,ia)),this._padding&&(j.interpolatePadding(be,Ge,ia),ct=j.centerPoint.add(at)),this.terrain&&!c.freezeElevation&&this._updateElevation(ia);const Ia=ia===1?xt:j.unproject(Rt.add(Et.mult(ea(Ta))).mult(fa));j.setLocationAtPoint(j.renderWorldCopies?Ia.wrap():Ia,ct),this._applyUpdatedTransform(j),this._fireMoveEvents(p)},()=>{this.terrain&&c.freezeElevation&&this._finalizeElevation(),this._afterEase(p)},c),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(c,p){var F;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const j=this._onEaseEnd;delete this._onEaseEnd,j.call(this,p)}return c||(F=this.handlers)===null||F===void 0||F.stop(!1),this}_ease(c,p,F){F.animate===!1||F.duration===0?(c(1),p()):(this._easeStart=u.now(),this._easeOptions=F,this._onEaseFrame=c,this._onEaseEnd=p,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(c,p){c=n.b3(c,-180,180);const F=Math.abs(c-p);return Math.abs(c-360-p)<F&&(c-=360),Math.abs(c+360-p)<F&&(c+=360),c}_normalizeCenter(c,p){if(!p.renderWorldCopies||p.lngRange)return;const F=c.lng-p.center.lng;c.lng+=F>180?-360:F<-180?360:0}queryTerrainElevation(c){return this.terrain?this.terrain.getElevationForLngLatZoom(n.N.convert(c),this.transform.tileZoom)-this.transform.elevation:null}}const Bo={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class ns{constructor(c=Bo){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=p=>{!p||p.sourceDataType!=="metadata"&&p.sourceDataType!=="visibility"&&p.dataType!=="style"&&p.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=c}getDefaultPosition(){return"bottom-right"}onAdd(c){return this._map=c,this._compact=this.options.compact,this._container=r.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=r.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(c,p){const F=this._map._getUIString(`AttributionControl.${p}`);c.title=F,c.setAttribute("aria-label",F)}_updateAttributions(){if(!this._map.style)return;let c=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?c=c.concat(this.options.customAttribution.map(j=>typeof j!="string"?"":j)):typeof this.options.customAttribution=="string"&&c.push(this.options.customAttribution)),this._map.style.stylesheet){const j=this._map.style.stylesheet;this.styleOwner=j.owner,this.styleId=j.id}const p=this._map.style.sourceCaches;for(const j in p){const q=p[j];if(q.used||q.usedForTerrain){const ie=q.getSource();ie.attribution&&c.indexOf(ie.attribution)<0&&c.push(ie.attribution)}}c=c.filter(j=>String(j).trim()),c.sort((j,q)=>j.length-q.length),c=c.filter((j,q)=>{for(let ie=q+1;ie<c.length;ie++)if(c[ie].indexOf(j)>=0)return!1;return!0});const F=c.join(" | ");F!==this._attribHTML&&(this._attribHTML=F,c.length?(this._innerContainer.innerHTML=F,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class co{constructor(c={}){this._updateCompact=()=>{const p=this._container.children;if(p.length){const F=p[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&F.classList.add("maplibregl-compact"):F.classList.remove("maplibregl-compact")}},this.options=c}getDefaultPosition(){return"bottom-left"}onAdd(c){this._map=c,this._compact=this.options&&this.options.compact,this._container=r.create("div","maplibregl-ctrl");const p=r.create("a","maplibregl-ctrl-logo");return p.target="_blank",p.rel="noopener nofollow",p.href="https://maplibre.org/",p.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),p.setAttribute("rel","noopener nofollow"),this._container.appendChild(p),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){r.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Ac{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(c){const p=++this._id;return this._queue.push({callback:c,id:p,cancelled:!1}),p}remove(c){const p=this._currentlyRunning,F=p?this._queue.concat(p):this._queue;for(const j of F)if(j.id===c)return void(j.cancelled=!0)}run(c=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const p=this._currentlyRunning=this._queue;this._queue=[];for(const F of p)if(!F.cancelled&&(F.callback(c),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var er=n.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Lo extends n.E{constructor(c){super(),this.sourceCache=c,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,c.usedForTerrain=!0,c.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(c,p){this.sourceCache.update(c,p),this._renderableTilesKeys=[];const F={};for(const j of c.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:p}))F[j.key]=!0,this._renderableTilesKeys.push(j.key),this._tiles[j.key]||(j.posMatrix=new Float64Array(16),n.aQ(j.posMatrix,0,n.X,0,n.X,0,1),this._tiles[j.key]=new we(j,this.tileSize));for(const j in this._tiles)F[j]||delete this._tiles[j]}freeRtt(c){for(const p in this._tiles){const F=this._tiles[p];(!c||F.tileID.equals(c)||F.tileID.isChildOf(c)||c.isChildOf(F.tileID))&&(F.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(c=>this.getTileByID(c))}getTileByID(c){return this._tiles[c]}getTerrainCoords(c){const p={};for(const F of this._renderableTilesKeys){const j=this._tiles[F].tileID;if(j.canonical.equals(c.canonical)){const q=c.clone();q.posMatrix=new Float64Array(16),n.aQ(q.posMatrix,0,n.X,0,n.X,0,1),p[F]=q}else if(j.canonical.isChildOf(c.canonical)){const q=c.clone();q.posMatrix=new Float64Array(16);const ie=j.canonical.z-c.canonical.z,pe=j.canonical.x-(j.canonical.x>>ie<<ie),be=j.canonical.y-(j.canonical.y>>ie<<ie),Ae=n.X>>ie;n.aQ(q.posMatrix,0,Ae,0,Ae,0,1),n.J(q.posMatrix,q.posMatrix,[-pe*Ae,-be*Ae,0]),p[F]=q}else if(c.canonical.isChildOf(j.canonical)){const q=c.clone();q.posMatrix=new Float64Array(16);const ie=c.canonical.z-j.canonical.z,pe=c.canonical.x-(c.canonical.x>>ie<<ie),be=c.canonical.y-(c.canonical.y>>ie<<ie),Ae=n.X>>ie;n.aQ(q.posMatrix,0,n.X,0,n.X,0,1),n.J(q.posMatrix,q.posMatrix,[pe*Ae,be*Ae,0]),n.K(q.posMatrix,q.posMatrix,[1/2**ie,1/2**ie,0]),p[F]=q}}return p}getSourceTile(c,p){const F=this.sourceCache._source;let j=c.overscaledZ-this.deltaZoom;if(j>F.maxzoom&&(j=F.maxzoom),j<F.minzoom)return null;this._sourceTileCache[c.key]||(this._sourceTileCache[c.key]=c.scaledTo(j).key);let q=this.sourceCache.getTileByID(this._sourceTileCache[c.key]);if((!q||!q.dem)&&p)for(;j>=F.minzoom&&(!q||!q.dem);)q=this.sourceCache.getTileByID(c.scaledTo(j--).key);return q}tilesAfterTime(c=Date.now()){return Object.values(this._tiles).filter(p=>p.timeAdded>=c)}}class ii{constructor(c,p,F){this.painter=c,this.sourceCache=new Lo(p),this.options=F,this.exaggeration=typeof F.exaggeration=="number"?F.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(c,p,F,j=n.X){var q;if(!(p>=0&&p<j&&F>=0&&F<j))return 0;const ie=this.getTerrainData(c),pe=(q=ie.tile)===null||q===void 0?void 0:q.dem;if(!pe)return 0;const be=function(pt,xt,At){var Tt=xt[0],Rt=xt[1];return pt[0]=At[0]*Tt+At[4]*Rt+At[12],pt[1]=At[1]*Tt+At[5]*Rt+At[13],pt}([],[p/j*n.X,F/j*n.X],ie.u_terrain_matrix),Ae=[be[0]*pe.dim,be[1]*pe.dim],Fe=Math.floor(Ae[0]),Ge=Math.floor(Ae[1]),at=Ae[0]-Fe,ct=Ae[1]-Ge;return pe.get(Fe,Ge)*(1-at)*(1-ct)+pe.get(Fe+1,Ge)*at*(1-ct)+pe.get(Fe,Ge+1)*(1-at)*ct+pe.get(Fe+1,Ge+1)*at*ct}getElevationForLngLatZoom(c,p){const{tileID:F,mercatorX:j,mercatorY:q}=this._getOverscaledTileIDFromLngLatZoom(c,p);return this.getElevation(F,j%n.X,q%n.X,n.X)}getElevation(c,p,F,j=n.X){return this.getDEMElevation(c,p,F,j)*this.exaggeration}getTerrainData(c){if(!this._emptyDemTexture){const j=this.painter.context,q=new n.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new L(j,q,j.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new L(j,new n.R({width:1,height:1}),j.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(j.gl.NEAREST,j.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=n.ao([])}const p=this.sourceCache.getSourceTile(c,!0);if(p&&p.dem&&(!p.demTexture||p.needsTerrainPrepare)){const j=this.painter.context;p.demTexture=this.painter.getTileTexture(p.dem.stride),p.demTexture?p.demTexture.update(p.dem.getPixels(),{premultiply:!1}):p.demTexture=new L(j,p.dem.getPixels(),j.gl.RGBA,{premultiply:!1}),p.demTexture.bind(j.gl.NEAREST,j.gl.CLAMP_TO_EDGE),p.needsTerrainPrepare=!1}const F=p&&p+p.tileID.key+c.key;if(F&&!this._demMatrixCache[F]){const j=this.sourceCache.sourceCache._source.maxzoom;let q=c.canonical.z-p.tileID.canonical.z;c.overscaledZ>c.canonical.z&&(c.canonical.z>=j?q=c.canonical.z-j:n.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const ie=c.canonical.x-(c.canonical.x>>q<<q),pe=c.canonical.y-(c.canonical.y>>q<<q),be=n.bb(new Float64Array(16),[1/(n.X<<q),1/(n.X<<q),0]);n.J(be,be,[ie*n.X,pe*n.X,0]),this._demMatrixCache[c.key]={matrix:be,coord:c}}return{u_depth:2,u_terrain:3,u_terrain_dim:p&&p.dem&&p.dem.dim||1,u_terrain_matrix:F?this._demMatrixCache[c.key].matrix:this._emptyDemMatrix,u_terrain_unpack:p&&p.dem&&p.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(p&&p.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:p}}getFramebuffer(c){const p=this.painter,F=p.width/devicePixelRatio,j=p.height/devicePixelRatio;return!this._fbo||this._fbo.width===F&&this._fbo.height===j||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new L(p.context,{width:F,height:j,data:null},p.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(p.context.gl.NEAREST,p.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new L(p.context,{width:F,height:j,data:null},p.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(p.context.gl.NEAREST,p.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=p.context.createFramebuffer(F,j,!0,!1),this._fbo.depthAttachment.set(p.context.createRenderbuffer(p.context.gl.DEPTH_COMPONENT16,F,j))),this._fbo.colorAttachment.set(c==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const c=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const p=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let q=0,ie=0;q<this._coordsTextureSize;q++)for(let pe=0;pe<this._coordsTextureSize;pe++,ie+=4)p[ie+0]=255&pe,p[ie+1]=255&q,p[ie+2]=pe>>8<<4|q>>8,p[ie+3]=0;const F=new n.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(p.buffer)),j=new L(c,F,c.gl.RGBA,{premultiply:!1});return j.bind(c.gl.NEAREST,c.gl.CLAMP_TO_EDGE),this._coordsTexture=j,j}pointCoordinate(c){this.painter.maybeDrawDepthAndCoords(!0);const p=new Uint8Array(4),F=this.painter.context,j=F.gl,q=Math.round(c.x*this.painter.pixelRatio/devicePixelRatio),ie=Math.round(c.y*this.painter.pixelRatio/devicePixelRatio),pe=Math.round(this.painter.height/devicePixelRatio);F.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),j.readPixels(q,pe-ie-1,1,1,j.RGBA,j.UNSIGNED_BYTE,p),F.bindFramebuffer.set(null);const be=p[0]+(p[2]>>4<<8),Ae=p[1]+((15&p[2])<<8),Fe=this.coordsIndex[255-p[3]],Ge=Fe&&this.sourceCache.getTileByID(Fe);if(!Ge)return null;const at=this._coordsTextureSize,ct=(1<<Ge.tileID.canonical.z)*at;return new n.Z((Ge.tileID.canonical.x*at+be)/ct+Ge.tileID.wrap,(Ge.tileID.canonical.y*at+Ae)/ct,this.getElevation(Ge.tileID,be,Ae,at))}depthAtPoint(c){const p=new Uint8Array(4),F=this.painter.context,j=F.gl;return F.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),j.readPixels(c.x,this.painter.height/devicePixelRatio-c.y-1,1,1,j.RGBA,j.UNSIGNED_BYTE,p),F.bindFramebuffer.set(null),(p[0]/16777216+p[1]/65536+p[2]/256+p[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;const c=this.painter.context,p=new n.bc,F=new n.aY,j=this.meshSize,q=n.X/j,ie=j*j;for(let Ge=0;Ge<=j;Ge++)for(let at=0;at<=j;at++)p.emplaceBack(at*q,Ge*q,0);for(let Ge=0;Ge<ie;Ge+=j+1)for(let at=0;at<j;at++)F.emplaceBack(at+Ge,j+at+Ge+1,j+at+Ge+2),F.emplaceBack(at+Ge,j+at+Ge+2,at+Ge+1);const pe=p.length,be=pe+2*(j+1);for(const Ge of[0,1])for(let at=0;at<=j;at++)for(const ct of[0,1])p.emplaceBack(at*q,Ge*n.X,ct);for(let Ge=0;Ge<2*j;Ge+=2)F.emplaceBack(be+Ge,be+Ge+1,be+Ge+3),F.emplaceBack(be+Ge,be+Ge+3,be+Ge+2),F.emplaceBack(pe+Ge,pe+Ge+3,pe+Ge+1),F.emplaceBack(pe+Ge,pe+Ge+2,pe+Ge+3);const Ae=p.length,Fe=Ae+2*(j+1);for(const Ge of[0,1])for(let at=0;at<=j;at++)for(const ct of[0,1])p.emplaceBack(Ge*n.X,at*q,ct);for(let Ge=0;Ge<2*j;Ge+=2)F.emplaceBack(Ae+Ge,Ae+Ge+1,Ae+Ge+3),F.emplaceBack(Ae+Ge,Ae+Ge+3,Ae+Ge+2),F.emplaceBack(Fe+Ge,Fe+Ge+3,Fe+Ge+1),F.emplaceBack(Fe+Ge,Fe+Ge+2,Fe+Ge+3);return this._mesh=new sc(c.createVertexBuffer(p,er.members),c.createIndexBuffer(F),n.a0.simpleSegment(0,0,p.length,F.length)),this._mesh}getMeshFrameDelta(c){return 2*Math.PI*n.bd/Math.pow(2,c)/5}getMinTileElevationForLngLatZoom(c,p){var F;const{tileID:j}=this._getOverscaledTileIDFromLngLatZoom(c,p);return(F=this.getMinMaxElevation(j).minElevation)!==null&&F!==void 0?F:0}getMinMaxElevation(c){const p=this.getTerrainData(c).tile,F={minElevation:null,maxElevation:null};return p&&p.dem&&(F.minElevation=p.dem.min*this.exaggeration,F.maxElevation=p.dem.max*this.exaggeration),F}_getOverscaledTileIDFromLngLatZoom(c,p){const F=n.Z.fromLngLat(c.wrap()),j=(1<<p)*n.X,q=F.x*j,ie=F.y*j,pe=Math.floor(q/n.X),be=Math.floor(ie/n.X);return{tileID:new n.S(p,0,p,pe,be),mercatorX:q,mercatorY:ie}}}class Rl{constructor(c,p,F){this._context=c,this._size=p,this._tileSize=F,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const c of this._objects)c.texture.destroy(),c.fbo.destroy()}_createObject(c){const p=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),F=new L(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return F.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),p.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),p.colorAttachment.set(F.texture),{id:c,fbo:p,texture:F,stamp:-1,inUse:!1}}getObjectForId(c){return this._objects[c]}useObject(c){c.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(p=>c.id!==p),this._recentlyUsed.push(c.id)}stampObject(c){c.stamp=++this._stamp}getOrCreateFreeObject(){for(const p of this._recentlyUsed)if(!this._objects[p].inUse)return this._objects[p];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const c=this._createObject(this._objects.length);return this._objects.push(c),c}freeObject(c){c.inUse=!1}freeAllObjects(){for(const c of this._objects)this.freeObject(c)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(c=>!c.inUse)===!1}}const cs={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Ds{constructor(c,p){this.painter=c,this.terrain=p,this.pool=new Rl(c.context,30,p.sourceCache.tileSize*p.qualityFactor)}destruct(){this.pool.destruct()}getTexture(c){return this.pool.getObjectForId(c.rtt[this._stacks.length-1].id).texture}prepareForRender(c,p){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=c._order.filter(F=>!c._layers[F].isHidden(p)),this._coordsDescendingInv={};for(const F in c.sourceCaches){this._coordsDescendingInv[F]={};const j=c.sourceCaches[F].getVisibleCoordinates();for(const q of j){const ie=this.terrain.sourceCache.getTerrainCoords(q);for(const pe in ie)this._coordsDescendingInv[F][pe]||(this._coordsDescendingInv[F][pe]=[]),this._coordsDescendingInv[F][pe].push(ie[pe])}}this._coordsDescendingInvStr={};for(const F of c._order){const j=c._layers[F],q=j.source;if(cs[j.type]&&!this._coordsDescendingInvStr[q]){this._coordsDescendingInvStr[q]={};for(const ie in this._coordsDescendingInv[q])this._coordsDescendingInvStr[q][ie]=this._coordsDescendingInv[q][ie].map(pe=>pe.key).sort().join()}}for(const F of this._renderableTiles)for(const j in this._coordsDescendingInvStr){const q=this._coordsDescendingInvStr[j][F.tileID.key];q&&q!==F.rttCoords[j]&&(F.rtt=[])}}renderLayer(c){if(c.isHidden(this.painter.transform.zoom))return!1;const p=c.type,F=this.painter,j=this._renderableLayerIds[this._renderableLayerIds.length-1]===c.id;if(cs[p]&&(this._prevType&&cs[this._prevType]||this._stacks.push([]),this._prevType=p,this._stacks[this._stacks.length-1].push(c.id),!j))return!0;if(cs[this._prevType]||cs[p]&&j){this._prevType=p;const q=this._stacks.length-1,ie=this._stacks[q]||[];for(const pe of this._renderableTiles){if(this.pool.isFull()&&(oc(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(pe),pe.rtt[q]){const Ae=this.pool.getObjectForId(pe.rtt[q].id);if(Ae.stamp===pe.rtt[q].stamp){this.pool.useObject(Ae);continue}}const be=this.pool.getOrCreateFreeObject();this.pool.useObject(be),this.pool.stampObject(be),pe.rtt[q]={id:be.id,stamp:be.stamp},F.context.bindFramebuffer.set(be.fbo.framebuffer),F.context.clear({color:n.aN.transparent,stencil:0}),F.currentStencilSource=void 0;for(let Ae=0;Ae<ie.length;Ae++){const Fe=F.style._layers[ie[Ae]],Ge=Fe.source?this._coordsDescendingInv[Fe.source][pe.tileID.key]:[pe.tileID];F.context.viewport.set([0,0,be.fbo.width,be.fbo.height]),F._renderTileClippingMasks(Fe,Ge),F.renderLayer(F,F.style.sourceCaches[Fe.source],Fe,Ge),Fe.source&&(pe.rttCoords[Fe.source]=this._coordsDescendingInvStr[Fe.source][pe.tileID.key])}}return oc(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),cs[p]}return!1}}const zc={"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":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},Mc=x,al={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Bo,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,refreshExpiredTiles:!0,scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],zoom:0,bearing:0,pitch:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:n.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0},Ai=R=>{R.touchstart=R.dragStart,R.touchmoveWindow=R.dragMove,R.touchend=R.dragEnd},Cs={showCompass:!0,showZoom:!0,visualizePitch:!1};class Ya{constructor(c,p,F=!1){this.mousedown=ie=>{this.startMouse(n.e({},ie,{ctrlKey:!0,preventDefault:()=>ie.preventDefault()}),r.mousePos(this.element,ie)),r.addEventListener(window,"mousemove",this.mousemove),r.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=ie=>{this.moveMouse(ie,r.mousePos(this.element,ie))},this.mouseup=ie=>{this.mouseRotate.dragEnd(ie),this.mousePitch&&this.mousePitch.dragEnd(ie),this.offTemp()},this.touchstart=ie=>{ie.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,ie.targetTouches)[0],this.startTouch(ie,this._startPos),r.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),r.addEventListener(window,"touchend",this.touchend))},this.touchmove=ie=>{ie.targetTouches.length!==1?this.reset():(this._lastPos=r.touchPos(this.element,ie.targetTouches)[0],this.moveTouch(ie,this._lastPos))},this.touchend=ie=>{ie.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const j=c.dragRotate._mouseRotate.getClickTolerance(),q=c.dragRotate._mousePitch.getClickTolerance();this.element=p,this.mouseRotate=Xl({clickTolerance:j,enable:!0}),this.touchRotate=(({enable:ie,clickTolerance:pe,bearingDegreesPerPixelMoved:be=.8})=>{const Ae=new Nl;return new vo({clickTolerance:pe,move:(Fe,Ge)=>({bearingDelta:(Ge.x-Fe.x)*be}),moveStateManager:Ae,enable:ie,assignEvents:Ai})})({clickTolerance:j,enable:!0}),this.map=c,F&&(this.mousePitch=Ks({clickTolerance:q,enable:!0}),this.touchPitch=(({enable:ie,clickTolerance:pe,pitchDegreesPerPixelMoved:be=-.5})=>{const Ae=new Nl;return new vo({clickTolerance:pe,move:(Fe,Ge)=>({pitchDelta:(Ge.y-Fe.y)*be}),moveStateManager:Ae,enable:ie,assignEvents:Ai})})({clickTolerance:q,enable:!0})),r.addEventListener(p,"mousedown",this.mousedown),r.addEventListener(p,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(p,"touchcancel",this.reset)}startMouse(c,p){this.mouseRotate.dragStart(c,p),this.mousePitch&&this.mousePitch.dragStart(c,p),r.disableDrag()}startTouch(c,p){this.touchRotate.dragStart(c,p),this.touchPitch&&this.touchPitch.dragStart(c,p),r.disableDrag()}moveMouse(c,p){const F=this.map,{bearingDelta:j}=this.mouseRotate.dragMove(c,p)||{};if(j&&F.setBearing(F.getBearing()+j),this.mousePitch){const{pitchDelta:q}=this.mousePitch.dragMove(c,p)||{};q&&F.setPitch(F.getPitch()+q)}}moveTouch(c,p){const F=this.map,{bearingDelta:j}=this.touchRotate.dragMove(c,p)||{};if(j&&F.setBearing(F.getBearing()+j),this.touchPitch){const{pitchDelta:q}=this.touchPitch.dragMove(c,p)||{};q&&F.setPitch(F.getPitch()+q)}}off(){const c=this.element;r.removeEventListener(c,"mousedown",this.mousedown),r.removeEventListener(c,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),r.removeEventListener(window,"touchend",this.touchend),r.removeEventListener(c,"touchcancel",this.reset),this.offTemp()}offTemp(){r.enableDrag(),r.removeEventListener(window,"mousemove",this.mousemove),r.removeEventListener(window,"mouseup",this.mouseup),r.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),r.removeEventListener(window,"touchend",this.touchend)}}let gr;function Go(R,c,p){const F=new n.N(R.lng,R.lat);if(R=new n.N(R.lng,R.lat),c){const j=new n.N(R.lng-360,R.lat),q=new n.N(R.lng+360,R.lat),ie=p.locationPoint(R).distSqr(c);p.locationPoint(j).distSqr(c)<ie?R=j:p.locationPoint(q).distSqr(c)<ie&&(R=q)}for(;Math.abs(R.lng-p.center.lng)>180;){const j=p.locationPoint(R);if(j.x>=0&&j.y>=0&&j.x<=p.width&&j.y<=p.height)break;R.lng>p.center.lng?R.lng-=360:R.lng+=360}return R.lng!==F.lng&&p.locationPoint(R).y>p.height/2-p.getHorizon()?R:F}const Es={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 rl(R,c,p){const F=R.classList;for(const j in Es)F.remove(`maplibregl-${p}-anchor-${j}`);F.add(`maplibregl-${p}-anchor-${c}`)}class zi extends n.E{constructor(c){if(super(),this._onKeyPress=p=>{const F=p.code,j=p.charCode||p.keyCode;F!=="Space"&&F!=="Enter"&&j!==32&&j!==13||this.togglePopup()},this._onMapClick=p=>{const F=p.originalEvent.target,j=this._element;this._popup&&(F===j||j.contains(F))&&this.togglePopup()},this._update=p=>{var F;if(!this._map)return;const j=this._map.loaded()&&!this._map.isMoving();((p==null?void 0:p.type)==="terrain"||(p==null?void 0:p.type)==="render"&&!j)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies?this._lngLat=Go(this._lngLat,this._flatPos,this._map.transform):this._lngLat=(F=this._lngLat)===null||F===void 0?void 0:F.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let q="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?q=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(q=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let ie="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?ie="rotateX(0deg)":this._pitchAlignment==="map"&&(ie=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||p&&p.type!=="moveend"||(this._pos=this._pos.round()),r.setTransform(this._element,`${Es[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${ie} ${q}`),u.frameAsync(new AbortController).then(()=>{this._updateOpacity(p&&p.type==="moveend")}).catch(()=>{})},this._onMove=p=>{if(!this._isDragging){const F=this._clickTolerance||this._map._clickTolerance;this._isDragging=p.point.dist(this._pointerdownPos)>=F}this._isDragging&&(this._pos=p.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 n.k("dragstart"))),this.fire(new n.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new n.k("dragend")),this._state="inactive"},this._addDragHandler=p=>{this._element.contains(p.originalEvent.target)&&(p.preventDefault(),this._positionDelta=p.point.sub(this._pos).add(this._offset),this._pointerdownPos=p.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=c&&c.anchor||"center",this._color=c&&c.color||"#3FB1CE",this._scale=c&&c.scale||1,this._draggable=c&&c.draggable||!1,this._clickTolerance=c&&c.clickTolerance||0,this._subpixelPositioning=c&&c.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=c&&c.rotation||0,this._rotationAlignment=c&&c.rotationAlignment||"auto",this._pitchAlignment=c&&c.pitchAlignment&&c.pitchAlignment!=="auto"?c.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(c==null?void 0:c.opacity,c==null?void 0:c.opacityWhenCovered),c&&c.element)this._element=c.element,this._offset=n.P.convert(c&&c.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div");const p=r.createNS("http://www.w3.org/2000/svg","svg"),F=41,j=27;p.setAttributeNS(null,"display","block"),p.setAttributeNS(null,"height",`${F}px`),p.setAttributeNS(null,"width",`${j}px`),p.setAttributeNS(null,"viewBox",`0 0 ${j} ${F}`);const q=r.createNS("http://www.w3.org/2000/svg","g");q.setAttributeNS(null,"stroke","none"),q.setAttributeNS(null,"stroke-width","1"),q.setAttributeNS(null,"fill","none"),q.setAttributeNS(null,"fill-rule","evenodd");const ie=r.createNS("http://www.w3.org/2000/svg","g");ie.setAttributeNS(null,"fill-rule","nonzero");const pe=r.createNS("http://www.w3.org/2000/svg","g");pe.setAttributeNS(null,"transform","translate(3.0, 29.0)"),pe.setAttributeNS(null,"fill","#000000");const be=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const Tt of be){const Rt=r.createNS("http://www.w3.org/2000/svg","ellipse");Rt.setAttributeNS(null,"opacity","0.04"),Rt.setAttributeNS(null,"cx","10.5"),Rt.setAttributeNS(null,"cy","5.80029008"),Rt.setAttributeNS(null,"rx",Tt.rx),Rt.setAttributeNS(null,"ry",Tt.ry),pe.appendChild(Rt)}const Ae=r.createNS("http://www.w3.org/2000/svg","g");Ae.setAttributeNS(null,"fill",this._color);const Fe=r.createNS("http://www.w3.org/2000/svg","path");Fe.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"),Ae.appendChild(Fe);const Ge=r.createNS("http://www.w3.org/2000/svg","g");Ge.setAttributeNS(null,"opacity","0.25"),Ge.setAttributeNS(null,"fill","#000000");const at=r.createNS("http://www.w3.org/2000/svg","path");at.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"),Ge.appendChild(at);const ct=r.createNS("http://www.w3.org/2000/svg","g");ct.setAttributeNS(null,"transform","translate(6.0, 7.0)"),ct.setAttributeNS(null,"fill","#FFFFFF");const pt=r.createNS("http://www.w3.org/2000/svg","g");pt.setAttributeNS(null,"transform","translate(8.0, 8.0)");const xt=r.createNS("http://www.w3.org/2000/svg","circle");xt.setAttributeNS(null,"fill","#000000"),xt.setAttributeNS(null,"opacity","0.25"),xt.setAttributeNS(null,"cx","5.5"),xt.setAttributeNS(null,"cy","5.5"),xt.setAttributeNS(null,"r","5.4999962");const At=r.createNS("http://www.w3.org/2000/svg","circle");At.setAttributeNS(null,"fill","#FFFFFF"),At.setAttributeNS(null,"cx","5.5"),At.setAttributeNS(null,"cy","5.5"),At.setAttributeNS(null,"r","5.4999962"),pt.appendChild(xt),pt.appendChild(At),ie.appendChild(pe),ie.appendChild(Ae),ie.appendChild(Ge),ie.appendChild(ct),ie.appendChild(pt),p.appendChild(ie),p.setAttributeNS(null,"height",F*this._scale+"px"),p.setAttributeNS(null,"width",j*this._scale+"px"),this._element.appendChild(p),this._offset=n.P.convert(c&&c.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",p=>{p.preventDefault()}),this._element.addEventListener("mousedown",p=>{p.preventDefault()}),rl(this._element,this._anchor,"marker"),c&&c.className)for(const p of c.className.split(" "))this._element.classList.add(p);this._popup=null}addTo(c){return this.remove(),this._map=c,this._element.setAttribute("aria-label",c._getUIString("Marker.Title")),c.getCanvasContainer().appendChild(this._element),c.on("move",this._update),c.on("moveend",this._update),c.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",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}getLngLat(){return this._lngLat}setLngLat(c){return this._lngLat=n.N.convert(c),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(c){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),c){if(!("offset"in c.options)){const p=Math.abs(13.5)/Math.SQRT2;c.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[p,-1*(24.6+p)],"bottom-right":[-p,-1*(24.6+p)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=c,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(c){return this._subpixelPositioning=c,this}getPopup(){return this._popup}togglePopup(){const c=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:c?(c.isOpen()?c.remove():(c.setLngLat(this._lngLat),c.addTo(this._map)),this):this}_updateOpacity(c=!1){var p,F;if(!(!((p=this._map)===null||p===void 0)&&p.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(c)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const j=this._map,q=j.terrain.depthAtPoint(this._pos),ie=j.terrain.getElevationForLngLatZoom(this._lngLat,j.transform.tileZoom);if(j.transform.lngLatToCameraDepth(this._lngLat,ie)-q<.006)return void(this._element.style.opacity=this._opacity);const pe=-this._offset.y/j.transform._pixelPerMeter,be=Math.sin(j.getPitch()*Math.PI/180)*pe,Ae=j.terrain.depthAtPoint(new n.P(this._pos.x,this._pos.y-this._offset.y)),Fe=j.transform.lngLatToCameraDepth(this._lngLat,ie+be)-Ae>.006;!((F=this._popup)===null||F===void 0)&&F.isOpen()&&Fe&&this._popup.remove(),this._element.style.opacity=Fe?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(c){return this._offset=n.P.convert(c),this._update(),this}addClassName(c){this._element.classList.add(c)}removeClassName(c){this._element.classList.remove(c)}toggleClassName(c){return this._element.classList.toggle(c)}setDraggable(c){return this._draggable=!!c,this._map&&(c?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(c){return this._rotation=c||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(c){return this._rotationAlignment=c||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(c){return this._pitchAlignment=c&&c!=="auto"?c:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(c,p){return c===void 0&&p===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),c!==void 0&&(this._opacity=c),p!==void 0&&(this._opacityWhenCovered=p),this._map&&this._updateOpacity(!0),this}}const Vl={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Xr=0,Jl=!1;class ir extends n.E{constructor(c){super(),this._onSuccess=p=>{if(this._map){if(this._isOutOfMapMaxBounds(p))return this._setErrorState(),this.fire(new n.k("outofmaxbounds",p)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=p,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(p),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(p),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new n.k("geolocate",p)),this._finish()}},this._updateCamera=p=>{const F=new n.N(p.coords.longitude,p.coords.latitude),j=p.coords.accuracy,q=this._map.getBearing(),ie=n.e({bearing:q},this.options.fitBoundsOptions),pe=Te.fromLngLat(F,j);this._map.fitBounds(pe,ie,{geolocateSource:!0})},this._updateMarker=p=>{if(p){const F=new n.N(p.coords.longitude,p.coords.latitude);this._accuracyCircleMarker.setLngLat(F).addTo(this._map),this._userLocationDotMarker.setLngLat(F).addTo(this._map),this._accuracy=p.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=p=>{if(this._map){if(this.options.trackUserLocation)if(p.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const F=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=F,this._geolocateButton.setAttribute("aria-label",F),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(p.code===3&&Jl)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new n.k("error",p)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",p=>p.preventDefault()),this._geolocateButton=r.create("button","maplibregl-ctrl-geolocate",this._container),r.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=p=>{if(this._map){if(p===!1){n.w("Geolocation support is not available so the GeolocateControl will be disabled.");const F=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=F,this._geolocateButton.setAttribute("aria-label",F)}else{const F=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=F,this._geolocateButton.setAttribute("aria-label",F)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new zi({element:this._dotElement}),this._circleElement=r.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new zi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",F=>{const j=F.originalEvent&&F.originalEvent.type==="resize";F.geolocateSource||this._watchState!=="ACTIVE_LOCK"||j||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new n.k("trackuserlocationend")),this.fire(new n.k("userlocationlostfocus")))})}},this.options=n.e({},Vl,c)}onAdd(c){return this._map=c,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return n._(this,arguments,void 0,function*(p=!1){if(gr!==void 0&&!p)return gr;if(window.navigator.permissions===void 0)return gr=!!window.navigator.geolocation,gr;try{gr=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{gr=!!window.navigator.geolocation}return gr})}().then(p=>this._finishSetupUI(p)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Xr=0,Jl=!1}_isOutOfMapMaxBounds(c){const p=this._map.getMaxBounds(),F=c.coords;return p&&(F.longitude<p.getWest()||F.longitude>p.getEast()||F.latitude<p.getSouth()||F.latitude>p.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const c=this._map.getBounds(),p=c.getSouthEast(),F=c.getNorthEast(),j=p.distanceTo(F),q=this._map._container.clientHeight,ie=Math.ceil(this._accuracy/(j/q)*2);this._circleElement.style.width=`${ie}px`,this._circleElement.style.height=`${ie}px`}trigger(){if(!this._setup)return n.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new n.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Xr--,Jl=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new n.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new n.k("trackuserlocationstart")),this.fire(new n.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let c;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Xr++,Xr>1?(c={maximumAge:6e5,timeout:0},Jl=!0):(c=this.options.positionOptions,Jl=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,c)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}}const tr={maxWidth:100,unit:"metric"};function wi(R,c,p){const F=p&&p.maxWidth||100,j=R._container.clientHeight/2,q=R.unproject([0,j]),ie=R.unproject([F,j]),pe=q.distanceTo(ie);if(p&&p.unit==="imperial"){const be=3.2808*pe;be>5280?uo(c,F,be/5280,R._getUIString("ScaleControl.Miles")):uo(c,F,be,R._getUIString("ScaleControl.Feet"))}else p&&p.unit==="nautical"?uo(c,F,pe/1852,R._getUIString("ScaleControl.NauticalMiles")):pe>=1e3?uo(c,F,pe/1e3,R._getUIString("ScaleControl.Kilometers")):uo(c,F,pe,R._getUIString("ScaleControl.Meters"))}function uo(R,c,p,F){const j=function(ie){const pe=Math.pow(10,`${Math.floor(ie)}`.length-1);let be=ie/pe;return be=be>=10?10:be>=5?5:be>=3?3:be>=2?2:be>=1?1:function(Ae){const Fe=Math.pow(10,Math.ceil(-Math.log(Ae)/Math.LN10));return Math.round(Ae*Fe)/Fe}(be),pe*be}(p),q=j/p;R.style.width=c*q+"px",R.innerHTML=`${j} ${F}`}class jl extends n.E{constructor(c={}){super(),this._onFullscreenChange=()=>{var p;let F=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((p=F==null?void 0:F.shadowRoot)===null||p===void 0)&&p.fullscreenElement;)F=F.shadowRoot.fullscreenElement;F===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,c&&c.container&&(c.container instanceof HTMLElement?this._container=c.container:n.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(c){return this._map=c,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){r.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const c=this._fullscreenButton=r.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);r.create("span","maplibregl-ctrl-icon",c).setAttribute("aria-hidden","true"),c.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const c=this._getTitle();this._fullscreenButton.setAttribute("aria-label",c),this._fullscreenButton.title=c}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new n.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new n.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}}const Ho={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},yt=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");class wt extends n.E{constructor(c){super(),this.remove=()=>(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),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new n.k("close"))),this),this._onMouseUp=p=>{this._update(p.point)},this._onMouseMove=p=>{this._update(p.point)},this._onDrag=p=>{this._update(p.point)},this._update=p=>{var F;const j=this._lngLat||this._trackPointer;if(!this._map||!j||!this._content)return;if(!this._container){if(this._container=r.create("div","maplibregl-popup",this._map.getContainer()),this._tip=r.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const Ae of this.options.className.split(" "))this._container.classList.add(Ae);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer?this._lngLat=Go(this._lngLat,this._flatPos,this._map.transform):this._lngLat=(F=this._lngLat)===null||F===void 0?void 0:F.wrap(),this._trackPointer&&!p)return;const q=this._flatPos=this._pos=this._trackPointer&&p?p:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&p?p:this._map.transform.locationPoint(this._lngLat));let ie=this.options.anchor;const pe=Lt(this.options.offset);if(!ie){const Ae=this._container.offsetWidth,Fe=this._container.offsetHeight;let Ge;Ge=q.y+pe.bottom.y<Fe?["top"]:q.y>this._map.transform.height-Fe?["bottom"]:[],q.x<Ae/2?Ge.push("left"):q.x>this._map.transform.width-Ae/2&&Ge.push("right"),ie=Ge.length===0?"bottom":Ge.join("-")}let be=q.add(pe[ie]);this.options.subpixelPositioning||(be=be.round()),r.setTransform(this._container,`${Es[ie]} translate(${be.x}px,${be.y}px)`),rl(this._container,ie,"popup")},this._onClose=()=>{this.remove()},this.options=n.e(Object.create(Ho),c)}addTo(c){return this._map&&this.remove(),this._map=c,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new n.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(c){return this._lngLat=n.N.convert(c),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(c){return this.setDOMContent(document.createTextNode(c))}setHTML(c){const p=document.createDocumentFragment(),F=document.createElement("body");let j;for(F.innerHTML=c;j=F.firstChild,j;)p.appendChild(j);return this.setDOMContent(p)}getMaxWidth(){var c;return(c=this._container)===null||c===void 0?void 0:c.style.maxWidth}setMaxWidth(c){return this.options.maxWidth=c,this._update(),this}setDOMContent(c){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(c),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(c){return this._container&&this._container.classList.add(c),this}removeClassName(c){return this._container&&this._container.classList.remove(c),this}setOffset(c){return this.options.offset=c,this._update(),this}toggleClassName(c){if(this._container)return this._container.classList.toggle(c)}setSubpixelPositioning(c){this.options.subpixelPositioning=c}_createCloseButton(){this.options.closeButton&&(this._closeButton=r.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const c=this._container.querySelector(yt);c&&c.focus()}}function Lt(R){if(R){if(typeof R=="number"){const c=Math.round(Math.abs(R)/Math.SQRT2);return{center:new n.P(0,0),top:new n.P(0,R),"top-left":new n.P(c,c),"top-right":new n.P(-c,c),bottom:new n.P(0,-R),"bottom-left":new n.P(c,-c),"bottom-right":new n.P(-c,-c),left:new n.P(R,0),right:new n.P(-R,0)}}if(R instanceof n.P||Array.isArray(R)){const c=n.P.convert(R);return{center:c,top:c,"top-left":c,"top-right":c,bottom:c,"bottom-left":c,"bottom-right":c,left:c,right:c}}return{center:n.P.convert(R.center||[0,0]),top:n.P.convert(R.top||[0,0]),"top-left":n.P.convert(R["top-left"]||[0,0]),"top-right":n.P.convert(R["top-right"]||[0,0]),bottom:n.P.convert(R.bottom||[0,0]),"bottom-left":n.P.convert(R["bottom-left"]||[0,0]),"bottom-right":n.P.convert(R["bottom-right"]||[0,0]),left:n.P.convert(R.left||[0,0]),right:n.P.convert(R.right||[0,0])}}return Lt(new n.P(0,0))}const ne=x;h.AJAXError=n.bg,h.Evented=n.E,h.LngLat=n.N,h.MercatorCoordinate=n.Z,h.Point=n.P,h.addProtocol=n.bh,h.config=n.a,h.removeProtocol=n.bi,h.AttributionControl=ns,h.BoxZoomHandler=yo,h.CanvasSource=Me,h.CooperativeGesturesHandler=ls,h.DoubleClickZoomHandler=Ci,h.DragPanHandler=Ss,h.DragRotateHandler=Po,h.EdgeInsets=Fl,h.FullscreenControl=jl,h.GeoJSONSource=Ie,h.GeolocateControl=ir,h.Hash=Qi,h.ImageSource=Be,h.KeyboardHandler=dc,h.LngLatBounds=Te,h.LogoControl=co,h.Map=class extends to{constructor(R){n.be.mark(n.bf.create);const c=Object.assign(Object.assign({},al),R);if(c.minZoom!=null&&c.maxZoom!=null&&c.minZoom>c.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(c.minPitch!=null&&c.maxPitch!=null&&c.minPitch>c.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(c.minPitch!=null&&c.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(c.maxPitch!=null&&c.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new di(c.minZoom,c.maxZoom,c.minPitch,c.maxPitch,c.renderWorldCopies),{bearingSnap:c.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Ac,this._controls=[],this._mapId=n.a4(),this._contextLost=F=>{F.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new n.k("webglcontextlost",{originalEvent:F}))},this._contextRestored=F=>{this._setupPainter(),this.resize(),this._update(),this.fire(new n.k("webglcontextrestored",{originalEvent:F}))},this._onMapScroll=F=>{if(F.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=c.interactive,this._maxTileCacheSize=c.maxTileCacheSize,this._maxTileCacheZoomLevels=c.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=c.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=c.preserveDrawingBuffer===!0,this._antialias=c.antialias===!0,this._trackResize=c.trackResize===!0,this._bearingSnap=c.bearingSnap,this._refreshExpiredTiles=c.refreshExpiredTiles===!0,this._fadeDuration=c.fadeDuration,this._crossSourceCollisions=c.crossSourceCollisions===!0,this._collectResourceTiming=c.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},zc),c.locale),this._clickTolerance=c.clickTolerance,this._overridePixelRatio=c.pixelRatio,this._maxCanvasSize=c.maxCanvasSize,this.transformCameraUpdate=c.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=c.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=T.addThrottleControl(()=>this.isMoving()),this._requestManager=new A(c.transformRequest),typeof c.container=="string"){if(this._container=document.getElementById(c.container),!this._container)throw new Error(`Container '${c.container}' not found.`)}else{if(!(c.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=c.container}if(c.maxBounds&&this.setMaxBounds(c.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let F=!1;const j=Ns(q=>{this._trackResize&&!this._removed&&this.resize(q)._update()},50);this._resizeObserver=new ResizeObserver(q=>{F?j(q):F=!0}),this._resizeObserver.observe(this._container)}this.handlers=new ri(this,c);const p=typeof c.hash=="string"&&c.hash||void 0;this._hash=c.hash&&new Qi(p).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:c.center,zoom:c.zoom,bearing:c.bearing,pitch:c.pitch}),c.bounds&&(this.resize(),this.fitBounds(c.bounds,n.e({},c.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=c.localIdeographFontFamily,this._validateStyle=c.validateStyle,c.style&&this.setStyle(c.style,{localIdeographFontFamily:c.localIdeographFontFamily}),c.attributionControl&&this.addControl(new ns(typeof c.attributionControl=="boolean"?void 0:c.attributionControl)),c.maplibreLogo&&this.addControl(new co,c.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",F=>{this._update(F.dataType==="style"),this.fire(new n.k(`${F.dataType}data`,F))}),this.on("dataloading",F=>{this.fire(new n.k(`${F.dataType}dataloading`,F))}),this.on("dataabort",F=>{this.fire(new n.k("sourcedataabort",F))})}_getMapId(){return this._mapId}addControl(R,c){if(c===void 0&&(c=R.getDefaultPosition?R.getDefaultPosition():"top-right"),!R||!R.onAdd)return this.fire(new n.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const p=R.onAdd(this);this._controls.push(R);const F=this._controlPositions[c];return c.indexOf("bottom")!==-1?F.insertBefore(p,F.firstChild):F.appendChild(p),this}removeControl(R){if(!R||!R.onRemove)return this.fire(new n.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const c=this._controls.indexOf(R);return c>-1&&this._controls.splice(c,1),R.onRemove(this),this}hasControl(R){return this._controls.indexOf(R)>-1}calculateCameraOptionsFromTo(R,c,p,F){return F==null&&this.terrain&&(F=this.terrain.getElevationForLngLatZoom(p,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(R,c,p,F)}resize(R){var c;const p=this._containerDimensions(),F=p[0],j=p[1],q=this._getClampedPixelRatio(F,j);if(this._resizeCanvas(F,j,q),this.painter.resize(F,j,q),this.painter.overLimit()){const pe=this.painter.context.gl;this._maxCanvasSize=[pe.drawingBufferWidth,pe.drawingBufferHeight];const be=this._getClampedPixelRatio(F,j);this._resizeCanvas(F,j,be),this.painter.resize(F,j,be)}this.transform.resize(F,j),(c=this._requestedCameraState)===null||c===void 0||c.resize(F,j);const ie=!this._moving;return ie&&(this.stop(),this.fire(new n.k("movestart",R)).fire(new n.k("move",R))),this.fire(new n.k("resize",R)),ie&&this.fire(new n.k("moveend",R)),this}_getClampedPixelRatio(R,c){const{0:p,1:F}=this._maxCanvasSize,j=this.getPixelRatio(),q=R*j,ie=c*j,pe=q>p?p/q:1,be=ie>F?F/ie:1;return Math.min(pe,be)*j}getPixelRatio(){var R;return(R=this._overridePixelRatio)!==null&&R!==void 0?R:devicePixelRatio}setPixelRatio(R){this._overridePixelRatio=R,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(R){return this.transform.setMaxBounds(Te.convert(R)),this._update()}setMinZoom(R){if((R=R??-2)>=-2&&R<=this.transform.maxZoom)return this.transform.minZoom=R,this._update(),this.getZoom()<R&&this.setZoom(R),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(R){if((R=R??22)>=this.transform.minZoom)return this.transform.maxZoom=R,this._update(),this.getZoom()>R&&this.setZoom(R),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(R){if((R=R??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(R>=0&&R<=this.transform.maxPitch)return this.transform.minPitch=R,this._update(),this.getPitch()<R&&this.setPitch(R),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(R){if((R=R??60)>85)throw new Error("maxPitch must be less than or equal to 85");if(R>=this.transform.minPitch)return this.transform.maxPitch=R,this._update(),this.getPitch()>R&&this.setPitch(R),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(R){return this.transform.renderWorldCopies=R,this._update()}project(R){return this.transform.locationPoint(n.N.convert(R),this.style&&this.terrain)}unproject(R){return this.transform.pointLocation(n.P.convert(R),this.terrain)}isMoving(){var R;return this._moving||((R=this.handlers)===null||R===void 0?void 0:R.isMoving())}isZooming(){var R;return this._zooming||((R=this.handlers)===null||R===void 0?void 0:R.isZooming())}isRotating(){var R;return this._rotating||((R=this.handlers)===null||R===void 0?void 0:R.isRotating())}_createDelegatedListener(R,c,p){if(R==="mouseenter"||R==="mouseover"){let F=!1;return{layer:c,listener:p,delegates:{mousemove:j=>{const q=this.getLayer(c)?this.queryRenderedFeatures(j.point,{layers:[c]}):[];q.length?F||(F=!0,p.call(this,new To(R,this,j.originalEvent,{features:q}))):F=!1},mouseout:()=>{F=!1}}}}if(R==="mouseleave"||R==="mouseout"){let F=!1;return{layer:c,listener:p,delegates:{mousemove:j=>{(this.getLayer(c)?this.queryRenderedFeatures(j.point,{layers:[c]}):[]).length?F=!0:F&&(F=!1,p.call(this,new To(R,this,j.originalEvent)))},mouseout:j=>{F&&(F=!1,p.call(this,new To(R,this,j.originalEvent)))}}}}{const F=j=>{const q=this.getLayer(c)?this.queryRenderedFeatures(j.point,{layers:[c]}):[];q.length&&(j.features=q,p.call(this,j),delete j.features)};return{layer:c,listener:p,delegates:{[R]:F}}}}on(R,c,p){if(p===void 0)return super.on(R,c);const F=this._createDelegatedListener(R,c,p);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[R]=this._delegatedListeners[R]||[],this._delegatedListeners[R].push(F);for(const j in F.delegates)this.on(j,F.delegates[j]);return this}once(R,c,p){if(p===void 0)return super.once(R,c);const F=this._createDelegatedListener(R,c,p);for(const j in F.delegates)this.once(j,F.delegates[j]);return this}off(R,c,p){return p===void 0?super.off(R,c):(this._delegatedListeners&&this._delegatedListeners[R]&&(F=>{const j=F[R];for(let q=0;q<j.length;q++){const ie=j[q];if(ie.layer===c&&ie.listener===p){for(const pe in ie.delegates)this.off(pe,ie.delegates[pe]);return j.splice(q,1),this}}})(this._delegatedListeners),this)}queryRenderedFeatures(R,c){if(!this.style)return[];let p;const F=R instanceof n.P||Array.isArray(R),j=F?R:[[0,0],[this.transform.width,this.transform.height]];if(c=c||(F?{}:R)||{},j instanceof n.P||typeof j[0]=="number")p=[n.P.convert(j)];else{const q=n.P.convert(j[0]),ie=n.P.convert(j[1]);p=[q,new n.P(ie.x,q.y),ie,new n.P(q.x,ie.y),q]}return this.style.queryRenderedFeatures(p,c,this.transform)}querySourceFeatures(R,c){return this.style.querySourceFeatures(R,c)}setStyle(R,c){return(c=n.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},c)).diff!==!1&&c.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&R?(this._diffStyle(R,c),this):(this._localIdeographFontFamily=c.localIdeographFontFamily,this._updateStyle(R,c))}setTransformRequest(R){return this._requestManager.setTransformRequest(R),this}_getUIString(R){const c=this._locale[R];if(c==null)throw new Error(`Missing UI string '${R}'`);return c}_updateStyle(R,c){if(c.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(R,c));const p=this.style&&c.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!R)),R?(this.style=new ja(this,c||{}),this.style.setEventedParent(this,{style:this.style}),typeof R=="string"?this.style.loadURL(R,c,p):this.style.loadJSON(R,c,p),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new ja(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(R,c){if(typeof R=="string"){const p=R,F=this._requestManager.transformRequest(p,"Style");n.h(F,new AbortController).then(j=>{this._updateDiff(j.data,c)}).catch(j=>{j&&this.fire(new n.j(j))})}else typeof R=="object"&&this._updateDiff(R,c)}_updateDiff(R,c){try{this.style.setState(R,c)&&this._update(!0)}catch(p){n.w(`Unable to perform style diff: ${p.message||p.error||p}. Rebuilding the style from scratch.`),this._updateStyle(R,c)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():n.w("There is no style added to the map.")}addSource(R,c){return this._lazyInitEmptyStyle(),this.style.addSource(R,c),this._update(!0)}isSourceLoaded(R){const c=this.style&&this.style.sourceCaches[R];if(c!==void 0)return c.loaded();this.fire(new n.j(new Error(`There is no source with ID '${R}'`)))}setTerrain(R){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),R){const c=this.style.sourceCaches[R.source];if(!c)throw new Error(`cannot load terrain, because there exists no source with ID: ${R.source}`);this.terrain===null&&c.reload();for(const p in this.style._layers){const F=this.style._layers[p];F.type==="hillshade"&&F.source===R.source&&n.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new ii(this.painter,c,R),this.painter.renderToTexture=new Ds(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=p=>{p.dataType==="style"?this.terrain.sourceCache.freeRtt():p.dataType==="source"&&p.tile&&(p.sourceId!==R.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(p.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new n.k("terrain",{terrain:R})),this}getTerrain(){var R,c;return(c=(R=this.terrain)===null||R===void 0?void 0:R.options)!==null&&c!==void 0?c:null}areTilesLoaded(){const R=this.style&&this.style.sourceCaches;for(const c in R){const p=R[c]._tiles;for(const F in p){const j=p[F];if(j.state!=="loaded"&&j.state!=="errored")return!1}}return!0}removeSource(R){return this.style.removeSource(R),this._update(!0)}getSource(R){return this.style.getSource(R)}addImage(R,c,p={}){const{pixelRatio:F=1,sdf:j=!1,stretchX:q,stretchY:ie,content:pe,textFitWidth:be,textFitHeight:Ae}=p;if(this._lazyInitEmptyStyle(),!(c instanceof HTMLImageElement||n.b(c))){if(c.width===void 0||c.height===void 0)return this.fire(new n.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:Fe,height:Ge,data:at}=c,ct=c;return this.style.addImage(R,{data:new n.R({width:Fe,height:Ge},new Uint8Array(at)),pixelRatio:F,stretchX:q,stretchY:ie,content:pe,textFitWidth:be,textFitHeight:Ae,sdf:j,version:0,userImage:ct}),ct.onAdd&&ct.onAdd(this,R),this}}{const{width:Fe,height:Ge,data:at}=u.getImageData(c);this.style.addImage(R,{data:new n.R({width:Fe,height:Ge},at),pixelRatio:F,stretchX:q,stretchY:ie,content:pe,textFitWidth:be,textFitHeight:Ae,sdf:j,version:0})}}updateImage(R,c){const p=this.style.getImage(R);if(!p)return this.fire(new n.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const F=c instanceof HTMLImageElement||n.b(c)?u.getImageData(c):c,{width:j,height:q,data:ie}=F;if(j===void 0||q===void 0)return this.fire(new n.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(j!==p.data.width||q!==p.data.height)return this.fire(new n.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const pe=!(c instanceof HTMLImageElement||n.b(c));return p.data.replace(ie,pe),this.style.updateImage(R,p),this}getImage(R){return this.style.getImage(R)}hasImage(R){return R?!!this.style.getImage(R):(this.fire(new n.j(new Error("Missing required image id"))),!1)}removeImage(R){this.style.removeImage(R)}loadImage(R){return T.getImage(this._requestManager.transformRequest(R,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(R,c){return this._lazyInitEmptyStyle(),this.style.addLayer(R,c),this._update(!0)}moveLayer(R,c){return this.style.moveLayer(R,c),this._update(!0)}removeLayer(R){return this.style.removeLayer(R),this._update(!0)}getLayer(R){return this.style.getLayer(R)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(R,c,p){return this.style.setLayerZoomRange(R,c,p),this._update(!0)}setFilter(R,c,p={}){return this.style.setFilter(R,c,p),this._update(!0)}getFilter(R){return this.style.getFilter(R)}setPaintProperty(R,c,p,F={}){return this.style.setPaintProperty(R,c,p,F),this._update(!0)}getPaintProperty(R,c){return this.style.getPaintProperty(R,c)}setLayoutProperty(R,c,p,F={}){return this.style.setLayoutProperty(R,c,p,F),this._update(!0)}getLayoutProperty(R,c){return this.style.getLayoutProperty(R,c)}setGlyphs(R,c={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(R,c),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(R,c,p={}){return this._lazyInitEmptyStyle(),this.style.addSprite(R,c,p,F=>{F||this._update(!0)}),this}removeSprite(R){return this._lazyInitEmptyStyle(),this.style.removeSprite(R),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(R,c={}){return this._lazyInitEmptyStyle(),this.style.setSprite(R,c,p=>{p||this._update(!0)}),this}setLight(R,c={}){return this._lazyInitEmptyStyle(),this.style.setLight(R,c),this._update(!0)}getLight(){return this.style.getLight()}setSky(R){return this._lazyInitEmptyStyle(),this.style.setSky(R),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(R,c){return this.style.setFeatureState(R,c),this._update()}removeFeatureState(R,c){return this.style.removeFeatureState(R,c),this._update()}getFeatureState(R){return this.style.getFeatureState(R)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let R=0,c=0;return this._container&&(R=this._container.clientWidth||400,c=this._container.clientHeight||300),[R,c]}_setupContainer(){const R=this._container;R.classList.add("maplibregl-map");const c=this._canvasContainer=r.create("div","maplibregl-canvas-container",R);this._interactive&&c.classList.add("maplibregl-interactive"),this._canvas=r.create("canvas","maplibregl-canvas",c),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const p=this._containerDimensions(),F=this._getClampedPixelRatio(p[0],p[1]);this._resizeCanvas(p[0],p[1],F);const j=this._controlContainer=r.create("div","maplibregl-control-container",R),q=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(ie=>{q[ie]=r.create("div",`maplibregl-ctrl-${ie} `,j)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(R,c,p){this._canvas.width=Math.floor(p*R),this._canvas.height=Math.floor(p*c),this._canvas.style.width=`${R}px`,this._canvas.style.height=`${c}px`}_setupPainter(){const R={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let c=null;this._canvas.addEventListener("webglcontextcreationerror",F=>{c={requestedAttributes:R},F&&(c.statusMessage=F.statusMessage,c.type=F.type)},{once:!0});const p=this._canvas.getContext("webgl2",R)||this._canvas.getContext("webgl",R);if(!p){const F="Failed to initialize WebGL";throw c?(c.message=F,new Error(JSON.stringify(c))):new Error(F)}this.painter=new lc(p,this.transform),i.testSupport(p)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(R){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||R,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(R){return this._update(),this._renderTaskQueue.add(R)}_cancelRenderFrame(R){this._renderTaskQueue.remove(R)}_render(R){const c=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(R),this._removed)return;let p=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const j=this.transform.zoom,q=u.now();this.style.zoomHistory.update(j,q);const ie=new n.a9(j,{now:q,fadeDuration:c,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),pe=ie.crossFadingFactor();pe===1&&pe===this._crossFadingFactor||(p=!0,this._crossFadingFactor=pe),this.style.update(ie)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,c,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:c,showPadding:this.showPadding}),this.fire(new n.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,n.be.mark(n.bf.load),this.fire(new n.k("load"))),this.style&&(this.style.hasTransitions()||p)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const F=this._sourcesDirty||this._styleDirty||this._placementDirty;return F||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new n.k("idle")),!this._loaded||this._fullyLoaded||F||(this._fullyLoaded=!0,n.be.mark(n.bf.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var R;this._hash&&this._hash.remove();for(const p of this._controls)p.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),T.removeThrottleControl(this._imageQueueHandle),(R=this._resizeObserver)===null||R===void 0||R.disconnect();const c=this.painter.context.gl.getExtension("WEBGL_lose_context");c!=null&&c.loseContext&&c.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),r.remove(this._canvasContainer),r.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),n.be.clearMetrics(),this._removed=!0,this.fire(new n.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,u.frameAsync(this._frameRequest).then(R=>{n.be.frame(R),this._frameRequest=null,this._render(R)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(R){this._showTileBoundaries!==R&&(this._showTileBoundaries=R,this._update())}get showPadding(){return!!this._showPadding}set showPadding(R){this._showPadding!==R&&(this._showPadding=R,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(R){this._showCollisionBoxes!==R&&(this._showCollisionBoxes=R,R?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(R){this._showOverdrawInspector!==R&&(this._showOverdrawInspector=R,this._update())}get repaint(){return!!this._repaint}set repaint(R){this._repaint!==R&&(this._repaint=R,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(R){this._vertices=R,this._update()}get version(){return Mc}getCameraTargetElevation(){return this.transform.elevation}},h.MapMouseEvent=To,h.MapTouchEvent=go,h.MapWheelEvent=Xs,h.Marker=zi,h.NavigationControl=class{constructor(R){this._updateZoomButtons=()=>{const c=this._map.getZoom(),p=c===this._map.getMaxZoom(),F=c===this._map.getMinZoom();this._zoomInButton.disabled=p,this._zoomOutButton.disabled=F,this._zoomInButton.setAttribute("aria-disabled",p.toString()),this._zoomOutButton.setAttribute("aria-disabled",F.toString())},this._rotateCompassArrow=()=>{const c=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=c},this._setButtonTitle=(c,p)=>{const F=this._map._getUIString(`NavigationControl.${p}`);c.title=F,c.setAttribute("aria-label",F)},this.options=n.e({},Cs,R),this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",c=>c.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",c=>this._map.zoomIn({},{originalEvent:c})),r.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",c=>this._map.zoomOut({},{originalEvent:c})),r.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",c=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:c}):this._map.resetNorth({},{originalEvent:c})}),this._compassIcon=r.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(R){return this._map=R,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 Ya(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){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}_createButton(R,c){const p=r.create("button",R,this._container);return p.type="button",p.addEventListener("click",c),p}},h.Popup=wt,h.RasterDEMTileSource=Ve,h.RasterTileSource=Le,h.ScaleControl=class{constructor(R){this._onMove=()=>{wi(this._map,this._container,this.options)},this.setUnit=c=>{this.options.unit=c,wi(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},tr),R)}getDefaultPosition(){return"bottom-left"}onAdd(R){return this._map=R,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-scale",R.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},h.ScrollZoomHandler=el,h.Style=ja,h.TerrainControl=class{constructor(R){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=R}onAdd(R){return this._map=R,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=r.create("button","maplibregl-ctrl-terrain",this._container),r.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){r.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},h.TwoFingersTouchPitchHandler=Dl,h.TwoFingersTouchRotateHandler=qc,h.TwoFingersTouchZoomHandler=sr,h.TwoFingersTouchZoomRotateHandler=nl,h.VectorTileSource=Pe,h.VideoSource=ye,h.addSourceType=(R,c)=>n._(void 0,void 0,void 0,function*(){if(je(R))throw new Error(`A source type called "${R}" already exists.`);((p,F)=>{ke[p]=F})(R,c)}),h.clearPrewarmedResources=function(){const R=fe;R&&(R.isPreloaded()&&R.numActive()===1?(R.release(ce),fe=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},h.getMaxParallelImageRequests=function(){return n.a.MAX_PARALLEL_IMAGE_REQUESTS},h.getRTLTextPluginStatus=function(){return Xe().getRTLTextPluginStatus()},h.getVersion=function(){return ne},h.getWorkerCount=function(){return de.workerCount},h.getWorkerUrl=function(){return n.a.WORKER_URL},h.importScriptInWorkers=function(R){return me().broadcast("IS",R)},h.prewarm=function(){le().acquire(ce)},h.setMaxParallelImageRequests=function(R){n.a.MAX_PARALLEL_IMAGE_REQUESTS=R},h.setRTLTextPlugin=function(R,c){return Xe().setRTLTextPlugin(R,c)},h.setWorkerCount=function(R){de.workerCount=R},h.setWorkerUrl=function(R){n.a.WORKER_URL=R}}),g}()},88640:function(b,g,a){function y(xe,Ce,Te){xe.prototype=Ce.prototype=Te,Te.constructor=xe}function h(xe,Ce){var Te=Object.create(xe.prototype);for(var Ee in Ce)Te[Ee]=Ce[Ee];return Te}function n(){}a.d(g,{GW:function(){return ge},Dj:function(){return de}});var x=.7,_=1/x,v="\\s*([+-]?\\d+)\\s*",u="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",r="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",i=/^#([0-9a-f]{3,8})$/,d=new RegExp("^rgb\\(".concat(v,",").concat(v,",").concat(v,"\\)$")),l=new RegExp("^rgb\\(".concat(r,",").concat(r,",").concat(r,"\\)$")),f=new RegExp("^rgba\\(".concat(v,",").concat(v,",").concat(v,",").concat(u,"\\)$")),m=new RegExp("^rgba\\(".concat(r,",").concat(r,",").concat(r,",").concat(u,"\\)$")),w=new RegExp("^hsl\\(".concat(u,",").concat(r,",").concat(r,"\\)$")),T=new RegExp("^hsla\\(".concat(u,",").concat(r,",").concat(r,",").concat(u,"\\)$")),A={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function C(){return this.rgb().formatHex()}function P(){return this.rgb().formatRgb()}function B(xe){var Ce,Te;return xe=(xe+"").trim().toLowerCase(),(Ce=i.exec(xe))?(Te=Ce[1].length,Ce=parseInt(Ce[1],16),Te===6?E(Ce):Te===3?new S(Ce>>8&15|Ce>>4&240,Ce>>4&15|240&Ce,(15&Ce)<<4|15&Ce,1):Te===8?I(Ce>>24&255,Ce>>16&255,Ce>>8&255,(255&Ce)/255):Te===4?I(Ce>>12&15|Ce>>8&240,Ce>>8&15|Ce>>4&240,Ce>>4&15|240&Ce,((15&Ce)<<4|15&Ce)/255):null):(Ce=d.exec(xe))?new S(Ce[1],Ce[2],Ce[3],1):(Ce=l.exec(xe))?new S(255*Ce[1]/100,255*Ce[2]/100,255*Ce[3]/100,1):(Ce=f.exec(xe))?I(Ce[1],Ce[2],Ce[3],Ce[4]):(Ce=m.exec(xe))?I(255*Ce[1]/100,255*Ce[2]/100,255*Ce[3]/100,Ce[4]):(Ce=w.exec(xe))?$(Ce[1],Ce[2]/100,Ce[3]/100,1):(Ce=T.exec(xe))?$(Ce[1],Ce[2]/100,Ce[3]/100,Ce[4]):A.hasOwnProperty(xe)?E(A[xe]):xe==="transparent"?new S(NaN,NaN,NaN,0):null}function E(xe){return new S(xe>>16&255,xe>>8&255,255&xe,1)}function I(xe,Ce,Te,Ee){return Ee<=0&&(xe=Ce=Te=NaN),new S(xe,Ce,Te,Ee)}function M(xe,Ce,Te,Ee){return arguments.length===1?((Pe=xe)instanceof n||(Pe=B(Pe)),Pe?new S((Pe=Pe.rgb()).r,Pe.g,Pe.b,Pe.opacity):new S):new S(xe,Ce,Te,Ee??1);var Pe}function S(xe,Ce,Te,Ee){this.r=+xe,this.g=+Ce,this.b=+Te,this.opacity=+Ee}function L(){return"#".concat(V(this.r)).concat(V(this.g)).concat(V(this.b))}function k(){var xe=z(this.opacity);return"".concat(xe===1?"rgb(":"rgba(").concat(N(this.r),", ").concat(N(this.g),", ").concat(N(this.b)).concat(xe===1?")":", ".concat(xe,")"))}function z(xe){return isNaN(xe)?1:Math.max(0,Math.min(1,xe))}function N(xe){return Math.max(0,Math.min(255,Math.round(xe)||0))}function V(xe){return((xe=N(xe))<16?"0":"")+xe.toString(16)}function $(xe,Ce,Te,Ee){return Ee<=0?xe=Ce=Te=NaN:Te<=0||Te>=1?xe=Ce=NaN:Ce<=0&&(xe=NaN),new U(xe,Ce,Te,Ee)}function G(xe){if(xe instanceof U)return new U(xe.h,xe.s,xe.l,xe.opacity);if(xe instanceof n||(xe=B(xe)),!xe)return new U;if(xe instanceof U)return xe;var Ce=(xe=xe.rgb()).r/255,Te=xe.g/255,Ee=xe.b/255,Pe=Math.min(Ce,Te,Ee),Le=Math.max(Ce,Te,Ee),Ve=NaN,Ie=Le-Pe,De=(Le+Pe)/2;return Ie?(Ve=Ce===Le?(Te-Ee)/Ie+6*(Te<Ee):Te===Le?(Ee-Ce)/Ie+2:(Ce-Te)/Ie+4,Ie/=De<.5?Le+Pe:2-Le-Pe,Ve*=60):Ie=De>0&&De<1?0:Ve,new U(Ve,Ie,De,xe.opacity)}function U(xe,Ce,Te,Ee){this.h=+xe,this.s=+Ce,this.l=+Te,this.opacity=+Ee}function J(xe){return(xe=(xe||0)%360)<0?xe+360:xe}function ae(xe){return Math.max(0,Math.min(1,xe||0))}function Y(xe,Ce,Te){return 255*(xe<60?Ce+(Te-Ce)*xe/60:xe<180?Te:xe<240?Ce+(Te-Ce)*(240-xe)/60:Ce)}y(n,B,{copy:function(xe){return Object.assign(new this.constructor,this,xe)},displayable:function(){return this.rgb().displayable()},hex:C,formatHex:C,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return G(this).formatHsl()},formatRgb:P,toString:P}),y(S,M,h(n,{brighter:function(xe){return xe=xe==null?_:Math.pow(_,xe),new S(this.r*xe,this.g*xe,this.b*xe,this.opacity)},darker:function(xe){return xe=xe==null?x:Math.pow(x,xe),new S(this.r*xe,this.g*xe,this.b*xe,this.opacity)},rgb:function(){return this},clamp:function(){return new S(N(this.r),N(this.g),N(this.b),z(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:L,formatHex:L,formatHex8:function(){return"#".concat(V(this.r)).concat(V(this.g)).concat(V(this.b)).concat(V(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:k,toString:k})),y(U,function(xe,Ce,Te,Ee){return arguments.length===1?G(xe):new U(xe,Ce,Te,Ee??1)},h(n,{brighter:function(xe){return xe=xe==null?_:Math.pow(_,xe),new U(this.h,this.s,this.l*xe,this.opacity)},darker:function(xe){return xe=xe==null?x:Math.pow(x,xe),new U(this.h,this.s,this.l*xe,this.opacity)},rgb:function(){var xe=this.h%360+360*(this.h<0),Ce=isNaN(xe)||isNaN(this.s)?0:this.s,Te=this.l,Ee=Te+(Te<.5?Te:1-Te)*Ce,Pe=2*Te-Ee;return new S(Y(xe>=240?xe-240:xe+120,Pe,Ee),Y(xe,Pe,Ee),Y(xe<120?xe+240:xe-120,Pe,Ee),this.opacity)},clamp:function(){return new U(J(this.h),ae(this.s),ae(this.l),z(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var xe=z(this.opacity);return"".concat(xe===1?"hsl(":"hsla(").concat(J(this.h),", ").concat(100*ae(this.s),"%, ").concat(100*ae(this.l),"%").concat(xe===1?")":", ".concat(xe,")"))}}));var te=function(xe){return function(){return xe}};function ee(xe,Ce){var Te=Ce-xe;return Te?function(Ee,Pe){return function(Le){return Ee+Le*Pe}}(xe,Te):te(isNaN(xe)?Ce:xe)}var Z=function xe(Ce){var Te=function(Pe){return(Pe=+Pe)==1?ee:function(Le,Ve){return Ve-Le?function(Ie,De,Be){return Ie=Math.pow(Ie,Be),De=Math.pow(De,Be)-Ie,Be=1/Be,function(ye){return Math.pow(Ie+ye*De,Be)}}(Le,Ve,Pe):te(isNaN(Le)?Ve:Le)}}(Ce);function Ee(Pe,Le){var Ve=Te((Pe=M(Pe)).r,(Le=M(Le)).r),Ie=Te(Pe.g,Le.g),De=Te(Pe.b,Le.b),Be=ee(Pe.opacity,Le.opacity);return function(ye){return Pe.r=Ve(ye),Pe.g=Ie(ye),Pe.b=De(ye),Pe.opacity=Be(ye),Pe+""}}return Ee.gamma=xe,Ee}(1);function K(xe,Ce){var Te,Ee=Ce?Ce.length:0,Pe=xe?Math.min(Ee,xe.length):0,Le=new Array(Pe),Ve=new Array(Ee);for(Te=0;Te<Pe;++Te)Le[Te]=ge(xe[Te],Ce[Te]);for(;Te<Ee;++Te)Ve[Te]=Ce[Te];return function(Ie){for(Te=0;Te<Pe;++Te)Ve[Te]=Le[Te](Ie);return Ve}}function ce(xe,Ce){var Te=new Date;return xe=+xe,Ce=+Ce,function(Ee){return Te.setTime(xe*(1-Ee)+Ce*Ee),Te}}function de(xe,Ce){return xe=+xe,Ce=+Ce,function(Te){return xe*(1-Te)+Ce*Te}}function he(xe){return he=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ce){return typeof Ce}:function(Ce){return Ce&&typeof Symbol=="function"&&Ce.constructor===Symbol&&Ce!==Symbol.prototype?"symbol":typeof Ce},he(xe)}function fe(xe,Ce){var Te,Ee={},Pe={};for(Te in xe!==null&&he(xe)==="object"||(xe={}),Ce!==null&&he(Ce)==="object"||(Ce={}),Ce)Te in xe?Ee[Te]=ge(xe[Te],Ce[Te]):Pe[Te]=Ce[Te];return function(Le){for(Te in Ee)Pe[Te]=Ee[Te](Le);return Pe}}var re=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,le=new RegExp(re.source,"g");function se(xe,Ce){var Te,Ee,Pe,Le=re.lastIndex=le.lastIndex=0,Ve=-1,Ie=[],De=[];for(xe+="",Ce+="";(Te=re.exec(xe))&&(Ee=le.exec(Ce));)(Pe=Ee.index)>Le&&(Pe=Ce.slice(Le,Pe),Ie[Ve]?Ie[Ve]+=Pe:Ie[++Ve]=Pe),(Te=Te[0])===(Ee=Ee[0])?Ie[Ve]?Ie[Ve]+=Ee:Ie[++Ve]=Ee:(Ie[++Ve]=null,De.push({i:Ve,x:de(Te,Ee)})),Le=le.lastIndex;return Le<Ce.length&&(Pe=Ce.slice(Le),Ie[Ve]?Ie[Ve]+=Pe:Ie[++Ve]=Pe),Ie.length<2?De[0]?function(Be){return function(ye){return Be(ye)+""}}(De[0].x):function(Be){return function(){return Be}}(Ce):(Ce=De.length,function(Be){for(var ye,Me=0;Me<Ce;++Me)Ie[(ye=De[Me]).i]=ye.x(Be);return Ie.join("")})}function me(xe,Ce){Ce||(Ce=[]);var Te,Ee=xe?Math.min(Ce.length,xe.length):0,Pe=Ce.slice();return function(Le){for(Te=0;Te<Ee;++Te)Pe[Te]=xe[Te]*(1-Le)+Ce[Te]*Le;return Pe}}function _e(xe){return _e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ce){return typeof Ce}:function(Ce){return Ce&&typeof Symbol=="function"&&Ce.constructor===Symbol&&Ce!==Symbol.prototype?"symbol":typeof Ce},_e(xe)}function ge(xe,Ce){var Te,Ee,Pe=_e(Ce);return Ce==null||Pe==="boolean"?te(Ce):(Pe==="number"?de:Pe==="string"?(Te=B(Ce))?(Ce=Te,Z):se:Ce instanceof B?Z:Ce instanceof Date?ce:(Ee=Ce,!ArrayBuffer.isView(Ee)||Ee instanceof DataView?Array.isArray(Ce)?K:typeof Ce.valueOf!="function"&&typeof Ce.toString!="function"||isNaN(Ce)?fe:de:me))(xe,Ce)}},23648:function(b){b.exports=JSON.parse('["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]')},2362:function(b){b.exports=JSON.parse('["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]')},87486:function(b){b.exports=JSON.parse('["normal","italic","oblique"]')},99803:function(b){b.exports=JSON.parse('["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]')},54324:function(b){b.exports=JSON.parse('["inherit","initial","unset"]')},94316:function(b){b.exports=JSON.parse('["caption","icon","menu","message-box","small-caption","status-bar"]')},37071:function(b){b.exports=JSON.parse(`{"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":0.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,0.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,0.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,0.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,0.8],[20,4]]},"line-opacity":0.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,0.9],[10,0.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":[0.5,0.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,0.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,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":0.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":[0.5,0.25],"line-width":{"base":1.2,"stops":[[5,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":0.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,0.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,0.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,0.5],[20,18]]},"line-opacity":0.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,0.5],[20,18]]},"line-opacity":0.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,0.4],[15,0.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,0.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":0.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,0.6]]},"line-width":{"base":1.2,"stops":[[7,0],[8,0.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,0.5]]},"line-width":{"base":1.2,"stops":[[5,0],[6,0.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,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":{"stops":[[4,0],[5,0.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,0.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":0.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,0.5],[20,13]]},"line-opacity":0.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,0.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,0.5],[20,18]]},"line-opacity":0.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,0.5],[20,18]]},"line-opacity":0.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,0.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":[0.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,0.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":[0.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,0.4],[15,0.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":[0.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,0.4],[6,0.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,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":0.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,0.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,0.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,0.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,0.5],[20,18]]},"line-opacity":0.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,0.4],[15,0.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":[0.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,0.4],[5,1],[12,3]]},"line-opacity":0.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,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,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,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":0.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}\\n{name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":0.2},"paint":{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{"id":"water-name-ocean","type":"symbol","source":"openmaptiles","source-layer":"water_name","filter":["all",["==","$type","Point"],["==","class","ocean"]],"layout":{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":0.2},"paint":{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{"id":"water-name-other","type":"symbol","source":"openmaptiles","source-layer":"water_name","filter":["all",["==","$type","Point"],["!in","class","ocean"]],"layout":{"text-font":["Noto Sans Italic"],"text-size":{"stops":[[0,10],[6,14]]},"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":0.2,"visibility":"visible"},"paint":{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{"id":"poi-level-3","type":"symbol","source":"openmaptiles","source-layer":"poi","minzoom":16,"filter":["all",["==","$type","Point"],[">=","rank",25]],"layout":{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\\n{name:nonlatin}","text-offset":[0,0.6],"text-size":12,"text-max-width":9},"paint":{"text-halo-blur":0.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{"id":"poi-level-2","type":"symbol","source":"openmaptiles","source-layer":"poi","minzoom":15,"filter":["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],"layout":{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\\n{name:nonlatin}","text-offset":[0,0.6],"text-size":12,"text-max-width":9},"paint":{"text-halo-blur":0.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{"id":"poi-level-1","type":"symbol","source":"openmaptiles","source-layer":"poi","minzoom":14,"filter":["all",["==","$type","Point"],["<=","rank",14],["has","name"]],"layout":{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\\n{name:nonlatin}","text-offset":[0,0.6],"text-size":11,"text-max-width":9},"paint":{"text-halo-blur":0.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{"id":"poi-railway","type":"symbol","source":"openmaptiles","source-layer":"poi","minzoom":13,"filter":["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],"layout":{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\\n{name:nonlatin}","text-offset":[0,0.6],"text-size":12,"text-max-width":9,"icon-optional":false,"icon-ignore-placement":false,"icon-allow-overlap":false,"text-ignore-placement":false,"text-allow-overlap":false,"text-optional":true},"paint":{"text-halo-blur":0.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{"id":"road_oneway","type":"symbol","source":"openmaptiles","source-layer":"transportation","minzoom":15,"filter":["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],"layout":{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{"stops":[[15,0.5],[19,1]]}},"paint":{"icon-opacity":0.5}},{"id":"road_oneway_opposite","type":"symbol","source":"openmaptiles","source-layer":"transportation","minzoom":15,"filter":["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],"layout":{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{"stops":[[15,0.5],[19,1]]}},"paint":{"icon-opacity":0.5}},{"id":"highway-name-path","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":15.5,"filter":["==","class","path"],"layout":{"text-size":{"base":1,"stops":[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},"paint":{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":0.5}},{"id":"highway-name-minor","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":15,"filter":["all",["==","$type","LineString"],["in","class","minor","service","track"]],"layout":{"text-size":{"base":1,"stops":[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},"paint":{"text-halo-blur":0.5,"text-color":"#765","text-halo-width":1}},{"id":"highway-name-major","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":12.2,"filter":["in","class","primary","secondary","tertiary","trunk"],"layout":{"text-size":{"base":1,"stops":[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},"paint":{"text-halo-blur":0.5,"text-color":"#765","text-halo-width":1}},{"id":"highway-shield","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":8,"filter":["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],"layout":{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{"base":1,"stops":[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},"paint":{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":0.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{"id":"highway-shield-us-interstate","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":7,"filter":["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],"layout":{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{"base":1,"stops":[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},"paint":{"text-color":"rgba(0, 0, 0, 1)"}},{"id":"highway-shield-us-other","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":9,"filter":["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],"layout":{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{"base":1,"stops":[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},"paint":{"text-color":"rgba(0, 0, 0, 1)"}},{"id":"place-other","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","minzoom":12,"filter":["!in","class","city","town","village","country","continent"],"layout":{"text-letter-spacing":0.1,"text-size":{"base":1.2,"stops":[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":"{name:latin}\\n{name:nonlatin}","text-transform":"uppercase","text-max-width":9,"visibility":"visible"},"paint":{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{"id":"place-village","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","minzoom":10,"filter":["==","class","village"],"layout":{"text-font":["Noto Sans Regular"],"text-size":{"base":1.2,"stops":[[10,12],[15,16]]},"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":8,"visibility":"visible"},"paint":{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{"id":"place-town","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["==","class","town"],"layout":{"text-font":["Noto Sans Regular"],"text-size":{"base":1.2,"stops":[[10,14],[15,24]]},"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":8,"visibility":"visible"},"paint":{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{"id":"place-city","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["!=","capital",2],["==","class","city"]],"layout":{"text-font":["Noto Sans Regular"],"text-size":{"base":1.2,"stops":[[7,14],[11,24]]},"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":8,"visibility":"visible"},"paint":{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-city-capital","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["==","capital",2],["==","class","city"]],"layout":{"text-font":["Noto Sans Regular"],"text-size":{"base":1.2,"stops":[[7,14],[11,24]]},"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":8,"icon-image":"star_11","text-offset":[0.4,0],"icon-size":0.8,"text-anchor":"left","visibility":"visible"},"paint":{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-country-other","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],"layout":{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{"stops":[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,"visibility":"visible"},"paint":{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-country-3","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],"layout":{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{"stops":[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,"visibility":"visible"},"paint":{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-country-2","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],"layout":{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{"stops":[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,"visibility":"visible"},"paint":{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-country-1","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],"layout":{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{"stops":[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,"visibility":"visible"},"paint":{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-continent","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","maxzoom":1,"filter":["==","class","continent"],"layout":{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase","visibility":"visible"},"paint":{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],"id":"qebnlkra6"}`)},51962:function(b){b.exports=JSON.parse(`{"version":8,"name":"orto","metadata":{},"center":[1.537786,41.837539],"zoom":12,"bearing":0,"pitch":0,"light":{"anchor":"viewport","color":"white","intensity":0.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"}}]}`)}},O={};function W(b){var g=O[b];if(g!==void 0)return g.exports;var a=O[b]={id:b,exports:{}};return s[b].call(a.exports,a,a.exports,W),a.exports}return W.m=s,W.n=function(b){var g=b&&b.__esModule?function(){return b.default}:function(){return b};return W.d(g,{a:g}),g},W.d=function(b,g){for(var a in g)W.o(g,a)&&!W.o(b,a)&&Object.defineProperty(b,a,{enumerable:!0,get:g[a]})},W.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),W.o=function(b,g){return Object.prototype.hasOwnProperty.call(b,g)},W.r=function(b){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(b,"__esModule",{value:!0})},W.b=document.baseURI||self.location.href,W.nc=void 0,W(20260)}()})})(sU);var iOt=sU.exports;const lU=rOt(iOt),oOt={id:"main-container"},sOt={id:"surface-container"},M5=39,qm=76,lOt=0,cU=2,uU=4,dU=5,hU=6,pU=7,cOt=8,uOt=9,fU=10,mU=11,gU=13,dOt=14,hOt=15,pOt=18,h1=19,fOt=800,yU=300,uT=.1208,vU=5,mOt=2,gOt=3,yOt=4,vOt=7,_Ot=-46,_U=100,bU=-14,bOt={__name:"CardField",props:{selected_category:{type:Number,default:31},selected_team:{type:[Array,Number],default:()=>[]},showBallPosition:{type:Boolean,default:!0},showPlayersPosition:{type:Boolean,default:!0},widthContainer:{type:Number,default:1280},dataPaintInfo:{type:Object,default:()=>{}},showTracks:{type:Boolean,default:!1},touches:{type:Number,default:1},showPlayersEndPosition:{type:Boolean,default:!1},secondStart:{type:Number,default:0},operationStart:{type:Number,default:0},secondEnd:{type:Number,default:1},operationEnd:{type:Number,default:1},inFavor:{type:Boolean,default:!0}},emits:["changelateralidad"],setup(e,{emit:o}){var s;let O=.75,W=t.ref("left");const b=o,g=t.ref(null),a=t.ref(null),y=t.ref(0),h=t.ref(null),n=new Set([583,585,587,589]),x=new Set([584,586,588,590]),_=new Set([122,128,136,142]),v=new Set([125,131,139,145]),u=new Set([124,130,138,144]),r=new Set([123,129,137,143]),i=e;let d=null;t.watch(()=>y.value,G=>{f(G),a.value&&(a.value.style.height=`${m(G)}px`),h.value&&(h.value.style.top=`${w(m(G))}px`)}),t.watch(()=>i.selected_category,G=>{G==32?W.value="right":W.value="left"});function l(){d=new ResizeObserver(G=>{for(const U of G)y.value=U.contentRect.width}),d.observe(g.value)}function f(G){lU.relayout(g.value,{width:G,height:m(G)})}function m(G){return Math.round(yU/fOt*G,0)}function w(G){return bU+(G-_U)/(yU-_U)*(_Ot-bU)}t.watch(()=>i.dataPaintInfo,G=>{N(G)},{deep:!0}),t.watch(()=>i.selected_team,G=>{G.data.length>0&&N(G)}),t.watch(()=>i.secondStart,G=>{N(G)});function T(G,U){let J=.01321,ae=.00929,Y=0,te=0,ee=[];const Z=U.length;let K=Math.floor(Z/10);for(;Y<qm;)te=U.filter(ce=>ce[0]>=Y*J&&ce[0]<=(Y+1)*J&&ce[1]>=G*ae&&ce[1]<=(G+1)*ae).map(ce=>ce[1]).length,K=K===0?1:K,ee.push(parseFloat((te/K).toFixed(4))),Y++;return ee.reverse()}function A(G,U){let J=.01321,ae=.01009,Y=0,te=0,ee=[];const Z=U.length;let K=Math.floor(Z/10);for(;Y<qm;)te=U.filter(ce=>ce[0]>=Y*J&&ce[0]<=(Y+1)*J&&ce[1]>=G*ae&&ce[1]<=(G+1)*ae).map(ce=>ce[1]).length,K=K===0?1:K,ee.push(parseFloat((te/K).toFixed(4))),Y++;return ee.reverse()}function C(G){let U=[B(qm),B(qm)],J=[],ae=M5;for(;ae>0&&ae<=M5;)J=T(ae,G),U.push(J),ae--;return U.push(B(qm),B(qm)),U}function P(G){let U=[B(qm),B(qm)],J=[],ae=M5;for(;ae>0&&ae<=M5;)J=A(ae,G),U.push(J),ae--;return U.push(B(qm),B(qm)),U}function B(G){return Array.from({length:G},()=>0)}function E(G,U,J){const ae=[];let Y=0,te=0;ae.push(G[0]);for(let ee=1;ee<J-1;ee++){const Z=[];Z.push(G[ee][0]);for(let K=1;K<U-1;K++)Y=G[ee][K-1],te=G[ee][K+1],Z.push(Y+.5*(G[ee][K]+te-Y));Z.push(G[ee][U-1]),ae.push(Z)}ae.push(G[J-1]);for(let ee=1;ee<U-1;ee++)for(let Z=1;Z<J-1;Z++)Y=ae[Z-1][ee],te=ae[Z+1][ee],ae[Z][ee]=Y+.5*(ae[Z][ee]+te-Y);return ae}function I(G){var U=[];let J=.14333333333333334;for(var ae=0;ae<G.length;ae++)if(G[ae][h1]==0&&G[ae][uU]===i.selected_category){let Y=G[ae][mU]-(J-uT);U.push([G[ae][fU],Y])}return U}function M(G,U,J=1){let ae=[],Y=[];return G.forEach(te=>{if(te[uU]===i.selected_category){let ee=G.filter(Z=>te[0]===Z[pOt]&&Z[h1]<=J).sort((Z,K)=>Z[h1]-K[h1]);ee.length>0&&ae.push(ee),te[h1]===0&&Y.push([te[lOt],te[gU],te[dOt],te[hOt]])}}),{sequences:ae,main_plays:Y}}function S(G,U,J,ae,Y){let te=.1,ee=ae*4,Z=ae*3,K=[],ce=[],de=[],he=[],fe=[],re=[],le=[],se=[],me=[],_e=[],ge=[],xe=[],Ce=[];const Te=.7,Ee="rgba(253, 101, 36, 1)",Pe="rgba(249, 189, 50, 1)",Le="rgba(145, 108, 255,1)",Ve="rgba(255, 255, 255,1)",Ie="rgba(203, 238, 107, 1)",De="rgba(55, 181, 252, 1)",Be="rgba(55, 252, 217, 1)",ye="rgba(195, 198, 201, 1)",Me=new Map([[n,{color:Ie,symbol:"circle"}],[x,{color:De,symbol:"circle"}],[_,{color:Be,symbol:"circle"}],[v,{color:ye,symbol:"x"}],[u,{color:Ee,symbol:"square"}],[r,{color:Pe,symbol:"triangle-up"}]]);return G.forEach(ke=>{if(ke.length===1){if(ke[0][h1]===0)return;let je=ke[0][hU]*J,Oe=ke[0][pU]*ee-Z,Ue=ae*uT,We=ae*te,Xe=Oe+Ue+We;if(Xe=Xe>=ae?ae-1:Xe,ce.push(je),de.push(Xe-Te),he.push(je),fe.push(Xe),Y===1){let we=ke[0][dU].split(","),Ne=!1;we=we.map(Number);for(const[Re,He]of Me)if(we.some(tt=>Re.has(tt))){re.push(He.color),le.push(He.symbol),Ne=!0;break}Ne||(re.push(Le),le.push("circle"))}else ke[0][cU]===U?re.push(Ve):re.push(Ee)}else ke.forEach((je,Oe)=>{if(je[h1]===0)return;let Ue=je[hU]*J,We=je[pU]*ee-Z,Xe=ae*uT,we=ae*te,Ne=We+Xe+we;if(Ne=Ne>=ae?ae-1:Ne,ce.push(Ue),de.push(Ne-Te),he.push(Ue),fe.push(Ne),Y===1){let Re=ke[0][dU].split(","),He=!1;Re=Re.map(Number);for(const[tt,Qe]of Me)if(Re.some(dt=>tt.has(dt))){re.push(Qe.color),le.push(Qe.symbol),He=!0;break}He||(re.push(Le),le.push("circle"))}else{let Re=je[cOt]*J,He=je[uOt]*ee-Z+Xe+we;He=He>=ae?ae-1:He;let tt=je[fU]*J,Qe=je[mU]*ee-Z+Xe+we;Qe=Qe>=ae?ae-1:Qe,je[cU]===U?re.push(Ve):re.push(Ee),_e.push(Ue,Re,null),ge.push(Ne,He,null),se.push(Ue,Re),me.push(Ne,He),ke.length-1===Oe&&(se.push(tt,null),me.push(Qe,null),xe.push(tt),Ce.push(Qe))}})}),K.shadowXPoints=ce,K.shadowYPoints=de,K.playerXPoints=he,K.playerYPoints=fe,K.playerColorPoints=re,K.trackX=se,K.trackY=me,K.sprintX=_e,K.sprintY=ge,K.arrowX=xe,K.arrowY=Ce,K.symbols=le,K}function L(G,U){return G.map((J,ae)=>J.map((Y,te)=>{if(te===U){let[ee,Z,K]=Y.split(/[:.]/);return parseInt(ee)*60+parseInt(Z)}else return Y}))}function k(G,U,J,ae,Y=0,te){let ee=[];return ae.forEach(Z=>{let K=Y===0?parseInt(Z[1])-parseInt(J):parseInt(Z[1])+parseInt(J);G.filter(ce=>Z[0]===ce[vOt]&&K===ce[vU]&&U===ce[mOt]).forEach(ce=>{let de=ce[gOt],he=ce[yOt];he<=te&&ee.push([de,he])})}),ee}function z(G){return G.flat().every(U=>U===0)}function N(G){G.data=L(G.data,gU),G.field_positions=L(G.field_positions,vU);let U=M(G.data,O,i.touches),J=I(G.data),ae=k(G.field_positions,i.selected_team,i.secondStart,U.main_plays,i.operationStart,O),Y=k(G.field_positions,i.selected_team,i.secondEnd,U.main_plays,i.operationEnd,O),te=P(J),ee=C(ae),Z=C(Y),K=te[0].length,ce=te.length;te=E(E(te,K,ce),K,ce),ee=E(E(ee,K,ce),K,ce),Z=E(E(Z,K,ce),K,ce),K=te[0].length,ce=te.length;let de=S(U.sequences,i.selected_team,K,ce,i.touches);var he=[[0,"rgba(12,31,82,0)"],[.2,"rgba(14, 55, 115, 0.8)"],[.4,"rgba(33, 85, 160, 0.8)"],[.6,"rgba(16, 124, 170, 0.8)"],[.8,"rgba(32, 154, 207, 0.8)"],[1,"rgba(32, 174, 207, 0.8)"]],fe=[[0,"rgba(12,31,82,0)"],[.2,"rgba(73, 13, 67, 0.8)"],[.4,"rgba(98, 32, 91, 0.8)"],[.6,"rgba(121, 52, 114, 0.8)"],[.8,"rgba(176, 36, 121, 0.8)"],[1,"rgba(230, 49, 158, 0.8)"]],re=[[0,"rgba(12,31,82,0)"],[.2,"rgba(94, 111, 79, 1)"],[.4,"rgba(111, 142, 28, 1)"],[.6,"rgba(142, 177, 50, 1)"],[.8,"rgba(169, 211, 57, 1)"],[1,"rgba(195, 229, 105, 1)"]],le=[{z:te,type:"heatmap",connectgaps:!0,opacity:1,colorscale:re,autoscale:!1,showscale:!1,zsmooth:"best",showgrid:!1,showline:!1}],se=[{z:ee,type:"heatmap",connectgaps:!0,opacity:1,colorscale:he,autoscale:!1,showscale:!1,zsmooth:"best",showgrid:!1,showline:!1}],me=[{z:Z,type:"heatmap",connectgaps:!0,opacity:1,colorscale:fe,autoscale:!1,showscale:!1,zsmooth:"best",showgrid:!1,showline:!1}],_e={x:de.shadowXPoints,y:de.shadowYPoints,mode:"markers",marker:{symbol:de.symbols,color:"rgba(0, 0, 0, 0.5)",size:9}},ge={x:de.playerXPoints,y:de.playerYPoints,mode:"markers",marker:{symbol:de.symbols,color:de.playerColorPoints,size:8}},xe={x:de.trackX,y:de.trackY,mode:"lines",line:{color:"rgba(255, 255, 255, 1)",width:1,dash:"2px 2px",arrowhead:"end"}},Ce={x:de.sprintX,y:de.sprintY,mode:"lines",line:{color:"rgba(255, 255, 255, 1)",width:1}},Te={x:de.arrowX,y:de.arrowY,mode:"markers",marker:{symbol:"triangle-up",size:10,color:"rgba(255, 255, 255, 1)",angle:120}},Ee=[];i.showTracks&&i.touches>1&&Ee.push(Ce,xe,Te),i.showTracks&&Ee.push(_e,ge),i.showPlayersEndPosition&&!z(Z)&&Ee.push(...me),i.showPlayersPosition&&!z(ee)&&Ee.push(...se),i.showBallPosition&&!z(te)&&Ee.push(...le);const Pe=[0,K],Le=[0,ce];s={showlegend:!1,width:y.value,height:m(y.value),xaxis:{title:"",showgrid:!1,showline:!1,zeroline:!1,showticklabels:!1,ticks:"",showbackground:!1,backgroundcolor:"transparent",range:Pe},yaxis:{title:"",showgrid:!1,showline:!1,zeroline:!1,showticklabels:!1,ticks:"",showbackground:!1,backgroundcolor:"transparent",range:Le},margin:{l:0,r:0,b:0,t:5}},lU.newPlot("surface-plot-heatmap",Ee,s,{displayModeBar:!1,staticPlot:!0},{responsive:!0})}const V=()=>{};function $(G){W.value=G,b("changelateralidad",W.value)}return t.onBeforeUnmount(()=>{window.removeEventListener("resize",V)}),t.onMounted(()=>{g.value&&(g.value.style.pointerEvents="none"),window.addEventListener("resize",V),l()}),(G,U)=>(t.openBlock(),t.createElementBlock("div",oOt,[t.createElementVNode("div",sOt,[i.dataPaintInfo.data.length==0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(e.widthContainer<768?"class-not-result-field-movil":"class-not-result-field")},[e.widthContainer<768?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[U[2]||(U[2]=t.createTextVNode("No se muestran resultados debido",-1)),U[3]||(U[3]=t.createElementVNode("br",null,null,-1)),U[4]||(U[4]=t.createTextVNode(" a los filtros aplicados.",-1))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("No se muestran resultados debido a los filtros aplicados.")],64))],2)):t.createCommentVNode("",!0),t.createElementVNode("div",{id:"label-left-zone",style:t.normalizeStyle(t.unref(W)=="left"?"":"opacity: 0.6"),onClick:U[0]||(U[0]=J=>$("left"))},null,4),t.createElementVNode("div",{id:"label-right-zone",style:t.normalizeStyle(t.unref(W)=="right"?"":"opacity: 0.6"),onClick:U[1]||(U[1]=J=>$("right"))},null,4),t.createElementVNode("div",{ref_key:"surfacePlot",ref:g,id:"surface-plot-heatmap",class:t.normalizeClass(e.inFavor?"":"against")},null,2)])]))}},xU="/arrowbtn.png",xOt={components:{GSCTrendMenuBall:ILt,GSCCheckbox:pv,GSCTrendPosition:aOt,CardField:bOt},props:{acronymHome:{type:String,default:""},acronymAway:{type:String,default:""},typePlay:{type:String,default:"A favor"},tournamentSelected:{type:Object,default:()=>({})},widthContainer:{type:Number,default:1280},touchAllData:{type:Array,default:()=>[]},playersData:{type:Object,default:()=>{}},homeTeam:{type:Number,default:0},awayTeam:{type:Number,default:0},selected_category:{type:Number,default:31},team:{type:Number,default:0},forGame:{type:Boolean,required:!1},teamsData:{type:Object,default:()=>{}},fieldPositionsAll:{type:Array,default:()=>[]},inFavor:{type:Boolean,required:!1},isTacticVisible:{type:Boolean,required:!1}},data(){return{type:"ball",show:!1,game:62276,trajectories:[],rival:3014,totalCorners:0,typepositioning:"Posición",BallOnOff:"OFF",numberTouches:1,playersList:{},timepositioning:-1,checkedBallGo:!0,checkedHeatMap:!0,filterFieldPositions:[],timepositioningFinal:-1,arrayPlayers:{},season:1325,timepositioningend:1,zonesFilter:[],touchFilter:{},token:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"}},watch:{touchAllData:{handler(){this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},deep:!0},zonesFilter:{handler(){this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},deep:!0},typepositioning:{handler(){this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},deep:!0},timepositioning:{handler(){this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},deep:!0},timepositioningend:{handler(){this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},deep:!0}},computed:{firstTeam(){return this.homeTeam===this.team?this.acronymHome:this.acronymAway},secondTeam(){return this.homeTeam===this.team?this.acronymAway:this.acronymHome},firstTeam1Touch(){return this.inFavor?this.homeTeam===this.team?this.acronymHome:this.acronymAway:this.homeTeam===this.team?this.acronymAway:this.acronymHome},secondTeam1Touch(){return this.inFavor?this.homeTeam===this.team?this.acronymAway:this.acronymHome:this.homeTeam===this.team?this.acronymHome:this.acronymAway},reftrendteamsTouches(){const e=this.widthContainer;return e<=480?"ref-trend-teams-touches480":e<=768?"ref-trend-teams-touches768":"ref-trend-teams-touches"},reftrendteamslocal(){const e=this.widthContainer;return e<=480?"ref-trend-teams-local480":e<=768?"ref-trend-teams-local768":"ref-trend-teams-local"},reftrendteamsrival(){return this.widthContainer<=768?"ref-trend-teams-rival768":"ref-trend-teams-rival"},reftrendteamsall(){const e=this.widthContainer;return e<=480?"ref-trend-teams-all480":e<=768?"ref-trend-teams-all768":"ref-trend-teams-all"},refpointlebeltext(){const e=this.widthContainer;return e<=390?"ref-point-lebel-text390":e<=480?"ref-point-lebel-text480":e<=768?"ref-point-lebel-text768":e<=860?"ref-point-lebel-text870":"ref-point-lebel-text"},trendcontentcontrols(){return this.widthContainer<=768?"trend-content-controls768":["trend-content-controls","to-right"]},trendtitle(){return this.widthContainer<=768?"trend-title768":"trend-title"},trendtitlecontainer(){return this.widthContainer<=768?"trend-titlecontainer768":"trend-titlecontainer"},trendcontentcontrolscontainer(){const e=this.widthContainer;return e<=400?"trend-content-controls-container400":e<=860?"trend-content-controls-container860":"trend-content-controls-container"},trendcontentcontrolsleyendcheckscontent(){const e=this.widthContainer;return e<=400?"trend-content-controls-leyend-checkscontent400":e<=768?"trend-content-controls-leyend-checkscontent768":e<=1e3?"trend-content-controls-leyend-checkscontent1000":"trend-content-controls-leyend-checkscontent"},trendcontentcontrolsleyend(){const e=this.widthContainer;return e<=768?"trend-content-controls-leyend768":e<=1e3?"trend-content-controls-leyend1000":"trend-content-controls-leyend"},contDataClass(){return this.widthContainer<=768?"cont-data768":"cont-data"},contDataClass2(){return this.widthContainer<=768?"cont-data-ref768":"cont-data-ref"},contCollectorsClass(){const e=this.widthContainer;return e<=768?"cont-collectors768":e<=900?"cont-collectors900":"cont-collectors"},contCollectorsClass2(){const e=this.widthContainer;return e<=768?"cont-collectors-ref768":e<=900?"cont-collectors-ref900":"cont-collectors-ref"},contWhoCnnectedClass(){const e=this.widthContainer;return e<=768?"cont-who-connected768":e<=900?"cont-who-connected900":"cont-who-connected"},contWhoCnnectedClass2(){const e=this.widthContainer;return e<=768?"cont-who-connected-ref768":e<=900?"cont-who-connected-ref900":"cont-who-connected-ref"}},methods:{changelateralidad(e){this.$emit("changelateralidad",e)},changeTouchesnum(e){this.numberTouches=e},checkBallGo(){this.checkedBallGo=!this.checkedBallGo},checkHeatMap(){this.checkedHeatMap=!this.checkedHeatMap},changeBallOnOff(e){typeof e=="string"&&(this.BallOnOff=e)},getDataPosition(){if(this.touchAllData.length>0){const o=this.touchAllData.filter(n=>n[19]===0).map(n=>this.tiempoASegundosEnteros(n[13]));let s=[];this.timepositioning>=0?s=o.map(n=>n+this.timepositioning):s=o.map(n=>n-this.timepositioning);const O=this.fieldPositionsAll.filter(n=>s.includes(this.tiempoASegundosEnteros(n[5]))&&n[2]===this.team),W=this.contarYAgruparPorPosicion(O);let b=[];this.zonesFilter.length!=35?b=this.fieldPositionsAll.filter(n=>this.zonesFilter.includes(n[6])&&n[2]===this.team):b=this.fieldPositionsAll.filter(n=>this.zonesFilter.includes(n[6])&&n[2]===this.team),this.filterFieldPositions=b;let g=[],a=[];for(var e in this.arrayPlayers)this.arrayPlayers[e].selected&&g.push(this.arrayPlayers[e].id),a.push(this.arrayPlayers[e].id);g.length>0&&(this.filterFieldPositions=this.filterFieldPositions.filter(n=>g.includes(n[1])));const y=b.filter(n=>s.includes(this.tiempoASegundosEnteros(n[5]))&&n[2]===this.team),h=this.contarYAgruparPorPosicion(y);this.arrayPlayers={};for(let n=0;n<W.length;n++){const x=h.filter(function(_){return _.id_player==W[n].id_player});this.arrayPlayers[W[n].id_player]={id:W[n].id_player,corners:W[n].corners,cornersfilter:x[0]?x[0].corners:0,data:this.playersData[W[n].id_player]?this.playersData[W[n].id_player]:{name:"-",img:"-",position:11,id:"-",team:"-",nationality_id:"-",nationality_flag:"https://golstatsimages.blob.core.windows.net/flags/undefined.jpg",jersey:"-"},selected:Object.keys(this.arrayPlayers).length>0&&a.includes(W[n].id_player)?!!g.includes(W[n].id_player):!0}}}else this.arrayPlayers={},this.filterFieldPositions=[]},getDataTrajectory(){if(this.touchAllData.length>0){const o=this.touchAllData.filter(v=>v[19]===0).map(v=>this.tiempoASegundosEnteros(v[13]));let s=[];this.timepositioning>=0?s=o.map(v=>v+Math.abs(this.timepositioning)):s=o.map(v=>v-Math.abs(this.timepositioning));let O=[];this.timepositioningend>=0?O=o.map(v=>v+Math.abs(this.timepositioningend)):O=o.map(v=>v-Math.abs(this.timepositioningend));const W=this.fieldPositionsAll.filter(v=>this.zonesFilter.includes(v[6])&&v[2]===this.team);this.filterFieldPositions=W;let b=[],g=[];for(var e in this.arrayPlayers)this.arrayPlayers[e].selected&&b.push(this.arrayPlayers[e].id),g.push(this.arrayPlayers[e].id);b.length>0&&(this.filterFieldPositions=this.filterFieldPositions.filter(v=>b.includes(v[1])));const a=this.fieldPositionsAll.filter(v=>o.includes(this.tiempoASegundosEnteros(v[5]))&&v[2]===this.team),y=W.filter(v=>s.includes(this.tiempoASegundosEnteros(v[5]))&&v[2]===this.team),h=W.filter(v=>O.includes(this.tiempoASegundosEnteros(v[5]))&&v[2]===this.team),n=this.contarYAgruparPorPosicion(a),x=this.contarYAgruparPorPosicion(y),_=this.contarYAgruparPorPosicion(h);for(let v=0;v<n.length;v++){const u=x.filter(function(i){return i.id_player==n[v].id_player}),r=_.filter(function(i){return i.id_player==n[v].id_player});this.arrayPlayers[n[v].id_player]={id:n[v].id_player,corners:n[v].corners,cornersfilter:u[0]?u[0].corners:0,cornersfilterfinal:r[0]?r[0].corners:0,data:this.playersData[n[v].id_player]?this.playersData[n[v].id_player]:{name:"-",img:"-",position:11,id:"-",team:"-",nationality_id:"-",nationality_flag:"https://golstatsimages.blob.core.windows.net/flags/undefined.jpg",jersey:"-"},selected:Object.keys(this.arrayPlayers).length>0&&g.includes(n[v].id_player)?!!b.includes(n[v].id_player):!0}}}else this.arrayPlayers={},this.filterFieldPositions=[]},contarYAgruparPorPosicion(e){const o=e.reduce((s,O)=>{const W=O[1];return s[W]?s[W]+=1:s[W]=1,s},{});return Object.keys(o).map(s=>({id_player:parseInt(s,10),corners:o[s]}))},tiempoASegundosEnteros(e){let o=e.split(":"),s=parseInt(o[0],10),O=parseFloat(o[1]);return s*60+Math.floor(O)},getTimePositioning(e){this.timepositioning=e},getTimePositioningEnd(e){this.timepositioningend=e},getTypePositioning(e){this.typepositioning=e},getArrayZonesField(e){this.zonesFilter=e},selectcheckplayerall(e){for(let o in this.arrayPlayers)this.arrayPlayers[o].selected=e;this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},selectcheckplayer(e){this.arrayPlayers[e].selected=!this.arrayPlayers[e].selected,this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},clickTypeButton(e){this.type=e},clickAdvanced(){this.show=!this.show},async getData(){}},mounted(){}},wOt={class:"text-diferent"},kOt={key:0,class:"btnAdvance",src:xU},SOt={key:1,class:"btnAdvanceHide",src:xU},TOt={class:"menu-advanced-container"},COt={class:"container-buttons-menu"},EOt={key:1,class:"position-only"},AOt={class:"buttons-menu-select-data"},MOt={key:0,class:"ref-trend-ball-player-container"},IOt={class:"ref-trend-ball-player"},POt={class:"ref-trend-ball-player-label"},BOt={key:1,class:"ref-trend-ball-player-container-route"},LOt={class:"ref-trend-teams-rival-container-table"},zOt={class:"ref-trend-teams-rival-container-row1"},OOt={class:"ref-trend-teams-rival-container-row2"},FOt={class:"ref-trend-teams-rival-container-table"};function NOt(e,o,s,O,W,b){const g=t.resolveComponent("GSCCheckbox"),a=t.resolveComponent("GSCTrendMenuBall"),y=t.resolveComponent("GSCTrendPosition"),h=t.resolveComponent("CardField");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(s.widthContainer<=768?"gsc-trend-movil":"gsc-trend-plays")},[t.createElementVNode("div",{class:t.normalizeClass(b.trendtitlecontainer)},[t.createElementVNode("div",{class:t.normalizeClass(b.trendtitle)},[o[5]||(o[5]=t.createTextVNode(" Tendencia General ",-1)),t.createElementVNode("span",wOt,"("+t.toDisplayString(s.inFavor?"A favor":"En contra")+")",1)],2),t.createElementVNode("div",{class:t.normalizeClass(b.trendcontentcontrols)},[t.createElementVNode("div",{class:t.normalizeClass(b.trendcontentcontrolsleyend)},[s.widthContainer>1e3||s.widthContainer<=768?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Elige que quieres ver: ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[o[6]||(o[6]=t.createTextVNode("Elige que ",-1)),o[7]||(o[7]=t.createElementVNode("br",null,null,-1)),o[8]||(o[8]=t.createTextVNode("quieres ver:",-1))],64))],2),t.createElementVNode("div",{class:t.normalizeClass(b.trendcontentcontrolsleyendcheckscontent)},[t.createElementVNode("div",{class:t.normalizeClass(b.trendcontentcontrolscontainer)},[t.createVNode(g,{label:"¿A dónde fue el balón?",fontFamily:"Poppins-Regular",labelFontSize:s.widthContainer>=870?"13px":"12px","label-color":"#FFF","model-value":W.checkedBallGo,"onUpdate:modelValue":o[0]||(o[0]=n=>b.checkBallGo())},null,8,["labelFontSize","model-value"])],2),t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(b.trendcontentcontrolscontainer)},[t.createVNode(g,{label:s.tournamentSelected.is_female==1?"Jugadoras ofensivas":"Jugadores ofensivos",fontFamily:"Poppins-Regular",labelFontSize:s.widthContainer>=870?"13px":"12px","label-color":"#FFF",boxBackgroundColor:"#15a9e0","model-value":W.checkedHeatMap,"onUpdate:modelValue":o[1]||(o[1]=n=>b.checkHeatMap())},null,8,["label","labelFontSize","model-value"])],2),[[t.vShow,s.isTacticVisible]])],2)],2)],2),t.createElementVNode("div",{class:t.normalizeClass(b.contDataClass)},[t.createElementVNode("div",{class:t.normalizeClass(b.contCollectorsClass)},[t.createElementVNode("div",{class:t.normalizeClass(s.widthContainer<=768?"button-avanced-movil":"button-avanced"),onClick:o[2]||(o[2]=(...n)=>b.clickAdvanced&&b.clickAdvanced(...n))},[W.show?(t.openBlock(),t.createElementBlock("img",kOt)):t.createCommentVNode("",!0),o[9]||(o[9]=t.createTextVNode("Avanzado",-1)),W.show?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("img",SOt))],2),t.withDirectives(t.createElementVNode("div",TOt,[t.createElementVNode("div",COt,[s.isTacticVisible?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",{class:t.normalizeClass(["buttons-menu",W.type=="ball"?"active":""]),onClick:o[3]||(o[3]=n=>b.clickTypeButton("ball"))}," A dónde fue el balón ",2),t.createElementVNode("div",{class:t.normalizeClass(["buttons-menu",W.type=="position"?"active":""]),onClick:o[4]||(o[4]=n=>b.clickTypeButton("position"))}," Posicionamiento ",2)],64)):(t.openBlock(),t.createElementBlock("div",EOt,"Posicionamiento"))]),t.createElementVNode("div",AOt,[t.withDirectives(t.createVNode(a,{"Ball-on-off":W.BallOnOff,onChangeBallOnOff:b.changeBallOnOff,onTouchesnum:b.changeTouchesnum},null,8,["Ball-on-off","onChangeBallOnOff","onTouchesnum"]),[[t.vShow,W.type=="ball"]]),t.withDirectives(t.createVNode(y,{onSelectcheckplayer:b.selectcheckplayer,onSelectcheckplayerall:b.selectcheckplayerall,data:W.arrayPlayers,onShowfield:b.getArrayZonesField,onTypepositioning:b.getTypePositioning,"width-container":s.widthContainer,onTimepositioning:b.getTimePositioning,onTimepositioningend:b.getTimePositioningEnd},null,8,["onSelectcheckplayer","onSelectcheckplayerall","data","onShowfield","onTypepositioning","width-container","onTimepositioning","onTimepositioningend"]),[[t.vShow,s.isTacticVisible&&W.type==="position"]])])],512),[[t.vShow,W.show]])],2),t.createElementVNode("div",{class:t.normalizeClass(b.contWhoCnnectedClass)},[t.createVNode(h,{"width-container":s.widthContainer,selected_team:s.team,"show-ball-position":W.checkedBallGo,"show-players-position":W.checkedHeatMap,selected_category:s.selected_category,"show-tracks":W.BallOnOff=="ON",touches:W.numberTouches,"operation-start":W.timepositioning>0?1:0,"second-start":Math.abs(W.timepositioning),"second-end":W.timepositioningend>0?1:0,"operation-end":Math.abs(W.timepositioningend),onChangelateralidad:b.changelateralidad,"show-players-end-position":W.typepositioning=="Recorrido","in-favor":s.inFavor,"data-paint-info":{data:s.touchAllData,field_positions:W.filterFieldPositions,home_atk_direction:1}},null,8,["width-container","selected_team","show-ball-position","show-players-position","selected_category","show-tracks","touches","operation-start","second-start","second-end","operation-end","onChangelateralidad","show-players-end-position","in-favor","data-paint-info"])],2)],2),t.createElementVNode("div",{class:t.normalizeClass(b.contDataClass2)},[t.createElementVNode("div",{class:t.normalizeClass(b.contCollectorsClass2)},[W.typepositioning==="Posición"?(t.openBlock(),t.createElementBlock("div",MOt,[o[11]||(o[11]=t.createElementVNode("div",{class:"ref-trend-ball-ball"},[t.createElementVNode("div",{class:"ref-trend-ball-ball-point"}),t.createElementVNode("div",{class:"ref-trend-ball-ball-label"},"BALÓN")],-1)),t.createElementVNode("div",IOt,[o[10]||(o[10]=t.createElementVNode("div",{class:"ref-trend-ball-playe-point"},null,-1)),t.createElementVNode("div",POt,[s.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("JUGADORAS OFENSIVAS")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("JUGADORES OFENSIVOS")],64))])])])):(t.openBlock(),t.createElementBlock("div",BOt,o[12]||(o[12]=[t.createStaticVNode('<div class="ref-trend-ball-ball" data-v-8bab9b8d><div class="ref-trend-ball-ball-point" data-v-8bab9b8d></div><div class="ref-trend-ball-ball-label" data-v-8bab9b8d>BALÓN</div></div><div class="ref-trend-ball-player-route" data-v-8bab9b8d><div class="ref-trend-ball-player-label" data-v-8bab9b8d>RECORRIDOS: </div><div class="ref-trend-ball-playe-point" data-v-8bab9b8d></div><div class="ref-trend-ball-player-label" data-v-8bab9b8d>INICIO </div><div class="ref-trend-ball-playe-point-end" data-v-8bab9b8d></div><div class="ref-trend-ball-player-label" data-v-8bab9b8d>FINAL</div></div>',2)])))],2),W.BallOnOff=="ON"?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(b.contWhoCnnectedClass2),style:t.normalizeStyle(W.numberTouches>1?"margin-left: 0%; display: flex; justify-content: center;":"")},[W.numberTouches>1?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(b.reftrendteamsTouches)},[t.createElementVNode("div",{class:"ref-trend-teams-rival-label-title",style:t.normalizeStyle(s.widthContainer<=768?"justify-content: center !important;":"")}," COORDENADAS: ",4),t.createElementVNode("div",LOt,[t.createElementVNode("div",zOt,[o[13]||(o[13]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/circle-my-team.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(b.refpointlebeltext),style:{"font-size":"9px"}},[s.forGame?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(b.firstTeam),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(s.teamsData[s.team].acronym),1)],64))],2)]),t.createElementVNode("div",OOt,[o[14]||(o[14]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(/circle-other-team.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(b.refpointlebeltext),style:{"font-size":"9px"}},[s.forGame?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(b.secondTeam),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Rival")],64))],2)])])],2)):(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(b.reftrendteamsall)},[t.createElementVNode("div",{class:t.normalizeClass(b.reftrendteamslocal)},[t.createElementVNode("div",{class:"ref-trend-teams-local-label-title",style:t.normalizeStyle(s.widthContainer<=768?"justify-content: center !important;":"")},[s.forGame?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(b.firstTeam1Touch),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(s.inFavor?s.teamsData[s.team].acronym:"Rival"),1)],64))],4),t.createElementVNode("div",{class:t.normalizeClass(s.widthContainer<=980?"ref-trend-teams-local-container-table-movil":"ref-trend-teams-local-container-table")},[t.createElementVNode("div",{class:"ref-trend-teams-local-container-row1",style:t.normalizeStyle(s.widthContainer<=980?"display: inline-block !important;":"")},[o[16]||(o[16]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/rematado-gol.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(b.refpointlebeltext)},o[15]||(o[15]=[t.createTextVNode("Remata destino ",-1),t.createElementVNode("br",null,null,-1),t.createTextVNode("portería fue gol",-1)]),2)],4),t.createElementVNode("div",{class:"ref-trend-teams-local-container-row2",style:t.normalizeStyle(s.widthContainer<=980?"display: inline-block !important;":"")},[o[18]||(o[18]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/rematado-con-destino.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(b.refpointlebeltext)},o[17]||(o[17]=[t.createTextVNode("Rematado destino ",-1),t.createElementVNode("br",null,null,-1),t.createTextVNode("a portería no fue gol",-1)]),2)],4),t.createElementVNode("div",{class:"ref-trend-teams-local-container-row3",style:t.normalizeStyle(s.widthContainer<=980?"display: inline-block !important;":"")},[o[20]||(o[20]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/rematado-sin-destino.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(b.refpointlebeltext)},o[19]||(o[19]=[t.createTextVNode("Rematado sin ",-1),t.createElementVNode("br",null,null,-1),t.createTextVNode("destino a portería",-1)]),2)],4),t.createElementVNode("div",{class:"ref-trend-teams-local-container-row4",style:t.normalizeStyle(s.widthContainer<=980?"display: inline-block !important;":"")},[o[22]||(o[22]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/raso.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(b.refpointlebeltext)},o[21]||(o[21]=[t.createTextVNode("Raso al área/",-1),t.createElementVNode("br",null,null,-1),t.createTextVNode("En corto",-1)]),2)],4),t.createElementVNode("div",{class:"ref-trend-teams-local-container-row5",style:t.normalizeStyle(s.widthContainer<=980?"display: inline-block !important;":"")},[o[23]||(o[23]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/sin-destino.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(b.refpointlebeltext)},"Sin destino",2)],4)],2)],2),t.createElementVNode("div",{class:t.normalizeClass(b.reftrendteamsrival)},[t.createElementVNode("div",{class:"ref-trend-teams-rival-label-title",style:t.normalizeStyle(s.widthContainer<=768?"justify-content: center;":"")},[s.forGame?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(b.secondTeam1Touch),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(s.inFavor?"Rival":s.teamsData[s.team].acronym),1)],64))],4),t.createElementVNode("div",FOt,[t.createElementVNode("div",{class:"ref-trend-teams-rival-container-row1",style:t.normalizeStyle(s.widthContainer<=980&&s.widthContainer>=768?"display: inline-block !important;":"")},[o[32]||(o[32]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/ganados-jugador-rival.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(b.refpointlebeltext)},[s.widthContainer<=768?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[s.inFavor?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[o[24]||(o[24]=t.createTextVNode("Ganados ",-1)),s.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Jugadora ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Jugador ")],64)),o[25]||(o[25]=t.createTextVNode("rival",-1))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Ganados por defensivo")],64))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[s.inFavor?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[o[29]||(o[29]=t.createTextVNode("Ganados ",-1)),o[30]||(o[30]=t.createElementVNode("br",null,null,-1)),s.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Jugadora ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Jugador ")],64)),o[31]||(o[31]=t.createTextVNode(" rival",-1))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[o[26]||(o[26]=t.createTextVNode("Ganados por",-1)),o[27]||(o[27]=t.createElementVNode("br",null,null,-1)),o[28]||(o[28]=t.createTextVNode("defensivo",-1))],64))],64))],2)],4),t.createElementVNode("div",{class:"ref-trend-teams-rival-container-row2",style:t.normalizeStyle(s.widthContainer<=980&&s.widthContainer>=768?"display: inline-block !important;":"")},[o[42]||(o[42]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/ganados-portero.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(b.refpointlebeltext)},[s.widthContainer<=768?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[s.inFavor?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[o[34]||(o[34]=t.createTextVNode("Ganados ",-1)),s.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Portera ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Portero ")],64)),o[35]||(o[35]=t.createTextVNode("rival",-1))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[o[33]||(o[33]=t.createTextVNode("Ganados por ",-1)),s.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("portera")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("portero")],64))],64))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[s.inFavor?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[o[39]||(o[39]=t.createTextVNode("Ganados ",-1)),o[40]||(o[40]=t.createElementVNode("br",null,null,-1)),s.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Portera ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Portero ")],64)),o[41]||(o[41]=t.createTextVNode("rival",-1))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[o[36]||(o[36]=t.createTextVNode("Ganados por",-1)),o[37]||(o[37]=t.createElementVNode("br",null,null,-1)),o[38]||(o[38]=t.createTextVNode("portero",-1))],64))],64))],2)],4)])],2)],2))],6)):t.createCommentVNode("",!0)],2)],2)}const DOt=cu(xOt,[["render",NOt],["__scopeId","data-v-8bab9b8d"]]),dT={components:{GSCConnectionsSetPiece:Txt,GSCHeaderSetPiece:DAt,GSCDataToHighlight:TMt,GSCModalBreakdown:xIt,GSCSpecificPlays:xLt,GSCTrend:DOt},props:{game:{type:Object,required:!0},forSeason:{type:Boolean,default:!1},forTeam:{type:Boolean,default:!1},tournamentSelected:{type:Object,default:()=>({})},forGame:{type:Boolean,default:!1},team:{type:Number,default:0},isTacticVisible:{type:Boolean,default:!0},isSynchronization:{type:Boolean,default:!1},seasonSelected:{type:Object,default:()=>({})},canPlayVideos:{type:Boolean,default:!0},clientPrivilegesBySeasons:{type:Object,default:()=>null},videoPrivilegesPlayingAs:{type:Set,default:()=>new Set([1,2])}},data(){return{lastGamesBySeasonUrl:"",inFavorResponses:null,againstResponses:null,homeTeamResponses:null,awayTeamResponses:null,isSpecificPlaysVisible:!1,token:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE",touchAllDataHome:[],touchAllDataAway:[],regularflag:null,filters:{isMoment:!1,final:[1,2,3],moment:[1,2,3],playingAs:[1,2],sections:[1,2,3,4,5,6],games:[],players:[],cornertype:31,howWas:[120,126,327,133],zona:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],whathappened:[583,585,587,589,584,586,588,590,122,128,136,142,123,129,137,143,124,130,138,144,125,131,139,14,146,147,327,133],isWhatHappenedFull:!0,isZoneFull:!0},containerWidth:0,openModal:!1,playersData:{},teamsData:{},teamCorners:{corners:0,cornersAgainst:0},gamesAllHome:[],gamesAllAway:[],teamSelected:0,touchDataSelected:[],auxChangeFilterPlayer:!0,auxChangeFilterGames:!0,positionsDataSelected:[],copyLastFilters:{},seasonId:0,totalDataCollection:{},seasonsByGame:{},matchesByGame:{},rivalsByGame:{},updateConnections:0,showCorners:0,filterPlayersAvailable:[],filterGamesAvailable:[],updateTrend:0,lateralidad:"left",updateFilter:0,copyplayers:[],infavoragainst:!0,typePlay:"A favor",modalInitialData:{},areFiltersOpen:!1,heightFilters:"123px",isLoading:!1,adjustedPlays:new Set}},watch:{isLoading(e){this.isSpecificPlaysVisible=!e},game:{immediate:!0,handler(e){this.getDataCorners(e),this.createStorageGame()}},teamSelected:{immediate:!0,handler(){this.fillFilterGamesReset(),this.fillFilterPlayersReset(),this.updateConnections+=1}},infavoragainst:{immediate:!0,handler(){this.fillFilterGamesReset(),this.fillFilterPlayersReset(),this.updateConnections+=1}},calculationTouchesData:{immediate:!0,handler(){this.showCorners=this.calculationTouchesData.filter(e=>e[19]==0).length}}},computed:{isGameOnly(){return this.forGame&&!this.forSeason&&!this.forTeam},calculateTotal(){return this.touchDataSelected.filter(e=>e[19]==0).length},calculationPositionsData(){return this.positionsDataSelected},calculationTouchesData(){let e=[],o=[];if(this.touchDataSelected.length>0){this.updateCopyfilter(),this.filters.isMoment?o=this.touchDataSelected.filter(O=>this.filters.moment.includes(O[17])&&this.filters.playingAs.includes(O[14])&&this.filters.sections.includes(O[20])&&O[19]==0):o=this.touchDataSelected.filter(O=>this.filters.final.includes(O[16])&&this.filters.playingAs.includes(O[14])&&this.filters.sections.includes(O[20])&&O[19]==0),this.updateGamesListFilter({corners:o}),this.filters.games.length>0&&(o=o.filter(O=>this.filters.games.includes(O[3]))),this.infavoragainst&&(this.updatePlayerListFilter({corners:o,players:this.filters.players}),this.filters.players.length>0&&(o=o.filter(O=>this.filters.players.includes(O[1])))),o=o.filter(O=>this.filters.cornertype==O[4]),this.filters.zona.length!=35&&(o=o.filter(O=>this.filters.zona.includes(O[12]))),o=o.filter(O=>O[5].split(",").map(W=>parseInt(W)).some(W=>this.filters.howWas.includes(W))),this.filters.whathappened.length!=24&&(o=o.filter(O=>O[5].split(",").map(W=>parseInt(W)).some(W=>this.filters.whathappened.includes(W))));const s=o.map(O=>O[18]);if(e=this.touchDataSelected.filter(O=>s.includes(O[18])),e.length>0){let O=null,W=null,b=new Set;e.forEach(g=>{g[19]===0?(O=g[18],W=g):(g[18]===O&&W&&!b.has(g[18])&&(g[6]=1-W[10],g[7]=1-W[11],b.add(g[18])),W=g)}),e.forEach(g=>{const a=g[5].split(",").map(n=>n.trim()),y=["125","139","131","145"],h=g[0];a.some(n=>y.includes(n))&&!this.adjustedPlays.has(h)&&this.adjustedPlays.add(h)})}}return e},cornersInFavor(){return"-"},cornersAgainst(){return"-"},isMovil(){return this.containerWidth<=768}},methods:{setHeaderStickyListener(){const e=this.$refs.header.getBoundingClientRect().top-1+(window.scrollY||window.pageYOffset);window.onscroll=()=>{(window.scrollY||window.pageYOffset)>e?(this.$refs.header.classList.add("sticky"),this.areFiltersOpen?this.heightFilters="282px":this.isMovil?this.forTeam?this.heightFilters="170px":this.heightFilters="222px":this.heightFilters="123px"):this.$refs.header.classList.remove("sticky")}},setCornersSide(e){this.lateralidad=e},onChangeShowFilters(e){this.areFiltersOpen=e},fillFilterPlayersReset(){setTimeout(()=>{if(this.infavoragainst){const e=this.forGame?this.infavoragainst?this.teamSelected:this.teamSelected==this.game.home_team?this.game.away_team:this.game.home_team:this.teamSelected,o=this.touchDataSelected.filter(O=>O[19]==0&&e).map(O=>O[1]),s=[...new Set(o)];this.getFilterTakenCorners({players:s})}},100)},fillFilterGamesReset(){setTimeout(()=>{const e=this.touchDataSelected.filter(s=>s[19]==0).map(s=>s[3]),o=[...new Set(e)];this.getFilterGames({games:o})},100)},updateCopyfilter(){this.copyLastFilters=this.filters},fillGameDataTeam(e){return{teamsIds:[e.home_team,e.visiting_team],label:`${e.matchday_abbreviation.replace("M","J")} ${this.teamsData[this.game.home_team].acronym} vs ${this.game.home_team==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym}`,id:e.game_id,isSelected:!0,dateTimeMillis:Date.parse(e.date_time_utc),rivalTeam:{logo:this.game.home_team==e.home_team?this.teamsData[e.visiting_team].img:this.teamsData[e.home_team].img,team_id:this.game.home_team==e.home_team?e.visiting_team:e.home_team,provisional_logo:this.game.home_team==e.home_team?this.teamsData[e.visiting_team].img:this.teamsData[e.home_team].img,colloquial_name:this.game.home_team==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym,acronym:this.game.home_team==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym,team_name:this.game.home_team==e.home_team?this.teamsData[e.visiting_team].name:this.teamsData[e.home_team].name},roundAbbreviation:e.matchday_abbreviation.replace("M","J")}},fillGameData(e){return{teamsIds:[e.home_team,e.visiting_team],label:`${e.matchday_abbreviation.replace("M","J")} ${this.teamsData[this.teamSelected].acronym} vs ${this.teamSelected==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym}`,id:e.game_id,isSelected:!0,dateTimeMillis:Date.parse(e.date_time_utc),rivalTeam:{logo:this.teamSelected==e.home_team?this.teamsData[e.visiting_team].img:this.teamsData[e.home_team].img,team_id:this.teamSelected==e.home_team?e.visiting_team:e.home_team,provisional_logo:this.teamSelected==e.home_team?this.teamsData[e.visiting_team].img:this.teamsData[e.home_team].img,colloquial_name:this.teamSelected==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym,acronym:this.teamSelected==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym,team_name:this.teamSelected==e.home_team?this.teamsData[e.visiting_team].name:this.teamsData[e.home_team].name},roundAbbreviation:e.matchday_abbreviation.replace("M","J")}},updatePlayerListFilter(e){if(this.infavoragainst){let o={},s=[];for(let O=0;O<e.corners.length;O++){const W=e.corners[O];if(W[19]===0&&W[2]===this.teamSelected){const b=W[1],g=this.playersData[b];b in o||(o[b]=g,s.push(g))}}if(this.filterPlayersAvailable=s,e.players.length>0&&this.filterPlayersAvailable.length>0)for(let O=0;O<this.filterPlayersAvailable.length;O++)e.players.includes(this.filterPlayersAvailable[O].id)?this.filterPlayersAvailable[O].isSelected=!0:this.filterPlayersAvailable[O].isSelected=!1}},updateGamesListFilter(e){if(!this.forGame){this.filterGamesAvailable=[];const o=this.obtenerIDsGames(e.corners);this.forSeason?this.teamSelected==this.game.home_team?this.filterGamesAvailable=o.map(s=>{let O=this.gamesAllHome.find(W=>W.game_id===s);if(O)return this.fillGameData(O)}):this.filterGamesAvailable=o.map(s=>{let O=this.gamesAllAway.find(W=>W.game_id===s);if(O)return this.fillGameData(O)}):this.filterGamesAvailable=o.map(s=>{let O=this.gamesAllHome.find(W=>W.game_id===s);if(O)return this.fillGameDataTeam(O)})}if(this.filters.games.length>0&&this.filterGamesAvailable.length>0)for(let o=0;o<this.filterGamesAvailable.length;o++)this.filters.games.includes(this.filterGamesAvailable[o].id)?this.filterGamesAvailable[o].isSelected=!0:this.filterGamesAvailable[o].isSelected=!1},getResetPlayers(){for(let e in this.playersData)this.playersData[e].isSelected=!0},getFilterZone(e){this.filters.zona=e,this.filters.isZoneFull=e.length===35},getFilterHowWasCorner(e){e.cornertype==31&&(this.lateralidad="left"),e.cornertype==32&&(this.lateralidad="right"),this.filters.cornertype=e.cornertype,this.filters.howWas=e.howWas},getFilterTakenCorners(e){this.arraysAreEqual(this.filters.players,e.players)||(this.filters.players=e.players)},arraysAreEqual(e,o){if(e.length!==o.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!==o[s])return!1;return!0},getFilterGames(e){this.areGamesIdsArraysContentEqual(this.filters.games,e.games)||(this.filters.games=e.games,this.fillFilterPlayersReset())},areGamesIdsArraysContentEqual(e,o){return e.length===o.length&&e.every((s,O)=>s===o[O])},getFilterDetails(e){this.filters.playingAs=e.playingAs,this.filters.sections=e.sections,this.fillFilterGamesReset(),this.fillFilterPlayersReset()},getFilterResultsByTime(e){this.filters.final=e.final,this.filters.isMoment=e.isMoment,this.filters.moment=e.moment,this.fillFilterGamesReset(),this.fillFilterPlayersReset()},getFilterWhatHappened(e){this.filters.whathappened=e,this.filters.isWhatHappenedFull=e.length===24},obtenerIDsGames(e){return[...new Set(e.map(o=>o[3]))]},async getInFavorAgainstTeam(e){this.updateTrend+=1,this.infavoragainst=e,this.validateDataLocalStorage({team:this.teamSelected,inFavor:this.infavoragainst,game:this.game})&&(this.teamSelected==this.game.home_team?await this.requestOrchestrator({games:this.gamesAllHome,team:this.teamSelected,inFavor:this.infavoragainst,game:this.game}):await this.requestOrchestrator({games:this.gamesAllAway,team:this.teamSelected,inFavor:this.infavoragainst,game:this.game}))},async getTeamSelected(e){this.teamSelected!=e&&(this.updateConnections+=1,this.updateTrend+=1,this.teamSelected=e,this.touchDataSelected=[],this.gamesAllHome.length!=0&&this.gamesAllAway.length!=0&&(this.teamSelected==this.game.home_team?this.validateDataLocalStorage({team:this.teamSelected,inFavor:this.infavoragainst,game:this.game})&&await this.requestOrchestrator({games:this.gamesAllHome,team:this.teamSelected,inFavor:this.infavoragainst,game:this.game}):this.validateDataLocalStorage({team:this.teamSelected,inFavor:this.infavoragainst,game:this.game})&&await this.requestOrchestrator({games:this.gamesAllAway,team:this.teamSelected,inFavor:this.infavoragainst,game:this.game})))},async fetchDataTeam(e,o){document.body.classList.add("no-scroll");try{return(await o.get(e)).data}catch(s){throw console.error("Error al obtener datos:",s),s}},async requestOrchestrator(e){let o=!1;this.forGame&&(o=this.teamSelected===this.game.home_team);let s=[],O=[];const W=du.create({headers:{Authorization:`${this.token}`}});if(this.forGame&&(o||!o)||!this.forGame&&(e.inFavor&&!this.inFavorResponses||!e.inFavor&&!this.againstResponses)){for(let a=0;a<e.games.length;a++)this.seasonId=e.games[a].season_id,s.push(e.inFavor?"https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/"+e.games[a].season_id+"/corners/trends/teams/"+e.team+"/"+e.games[a].game_id:"https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/"+e.games[a].season_id+"/corners/trends/teams/"+e.team+"/"+e.games[a].game_id+"?isR=1");O=s.map(a=>this.fetchDataTeam(a,W))}let b=[],g=[];try{this.isLoading=!0;const a=this.forGame?o?await Promise.all(O):await Promise.all(O):this.inFavor?this.inFavorResponses||await Promise.all(O):this.againstResponses||await Promise.all(O);this.forGame?o?this.homeTeamResponses||(this.homeTeamResponses=a):this.awayTeamResponses||(this.awayTeamResponses=a):e.inFavor?this.inFavorResponses||(this.inFavorResponses=a):this.againstResponses||(this.againstResponses=a);for(let y=0;y<a.length;y++)a[y].data=this.changeLateralityCoordenatesPlays(a[y].data,!1),a[y].field_positions=this.changeLateralityCoordenatesPlays(a[y].field_positions,!0),b=b.concat(a[y].data),g=g.concat(a[y].field_positions),this.getDataPlayers(a[y].players),this.getDataPlayers(a[y].rival_players),this.getDataTeams(a[y].teams),this.getSeasonByGame({season:a[y]&&a[y].hasOwnProperty("season_name")?a[y].season_name:"",game:a[y].data[0]?a[y].data[0][3]:0}),this.getMatchByGame({match:a[y]&&a[y].hasOwnProperty("matchday_abbreviation")?a[y].matchday_abbreviation:"",game:a[y].data[0]?a[y].data[0][3]:0}),this.getRivalsByGame({rival:this.infavoragainst?this.teamSelected==a[y].teams[0].team_id?a[y].teams[1].name:a[y].teams[0].name:this.teamSelected==a[y].teams[0].team_id?a[y].teams[0].name:a[y].teams[1].name,game:a[y].data[0]?a[y].data[0][3]:0,team:this.teamSelected,favor:this.infavoragainst});this.touchDataSelected=b,this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].touch=b,this.positionsDataSelected=g,this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].positions=g}catch(a){console.error("Error al obtener datos:",a)}finally{this.isLoading=!1,document.body.classList.remove("no-scroll")}},getRowMatrix(e,o){let s=.01351,O=.02439,W=0,b=0,g=[];const a=o.length;let y=Math.floor(a/10);for(;W<74;)b=o.filter(h=>h[0]>=W*s&&h[0]<=(W+1)*s&&h[1]>=e*O&&h[1]<=(e+1)*O).map(h=>h[1]).length,y=y===0?1:y,g.push(parseFloat((b/y).toFixed(4))),W++;return g.reverse()},getEmptyArray(e){return Array.from({length:e},()=>0)},getMatrix(e){let o=[this.getEmptyArray(74),this.getEmptyArray(74)],s=[],O=39;for(;O>0&&O<=39;)s=this.getRowMatrix(O,e),o.push(s),O--;return o.push(this.getEmptyArray(74),this.getEmptyArray(74)),o},getSoftData(e,o,s){const O=[];let W=0,b=0;O.push(e[0]);for(let g=1;g<s-1;g++){const a=[];a.push(e[g][0]);for(let y=1;y<o-1;y++)W=e[g][y-1],b=e[g][y+1],a.push(W+.5*(e[g][y]+b-W));a.push(e[g][o-1]),O.push(a)}O.push(e[s-1]);for(let g=1;g<o-1;g++)for(let a=1;a<s-1;a++)W=O[a-1][g],b=O[a+1][g],O[a][g]=W+.5*(O[a][g]+b-W);return O},changeLateralityCoordenatesPlays(e,o){return o?e.forEach((s,O)=>{let W=0,b=0;this.infavoragainst?(W=s[2]===this.teamSelected?1-s[3]:s[3],b=s[2]===this.teamSelected?1-s[4]:s[4]):(W=s[2]===this.teamSelected?s[3]:1-s[3],b=s[2]===this.teamSelected?s[4]:1-s[4]),e[O][3]=W,e[O][4]=b}):e.forEach((s,O)=>{let W=0,b=0,g=0,a=0,y=0,h=0;s[19]!=0?this.infavoragainst?(W=s[2]===this.teamSelected?s[6]:1-s[6],b=s[2]===this.teamSelected?1-s[7]:s[7],g=s[2]===this.teamSelected?s[8]:1-s[8],a=s[2]===this.teamSelected?1-s[9]:s[9],y=s[2]===this.teamSelected?s[10]:1-s[10],h=s[2]===this.teamSelected?1-s[11]:s[11]):(W=s[2]===this.teamSelected?1-s[6]:s[6],b=s[2]===this.teamSelected?s[7]:1-s[7],g=s[2]===this.teamSelected?1-s[8]:s[8],a=s[2]===this.teamSelected?1-s[9]:s[9],y=s[2]===this.teamSelected?1-s[10]:s[10],h=s[2]===this.teamSelected?1-s[11]:s[11]):(W=1-s[6],b=s[7],g=1-s[8],a=s[9],y=1-s[10],h=s[11]),e[O][6]=W,e[O][7]=b,e[O][8]=g,e[O][9]=a,e[O][10]=y,e[O][11]=h}),e},changeLateralityPlays(e){e.field_positions=e.field_positions.map(s=>[...s.slice(0,3),s[4],s[3],...s.slice(5)]);let o=[];return e.data.forEach(s=>{s[19]===0&&o.push([s[0],s[13],s[14],s[15]])}),o.forEach(s=>{e.field_positions.filter(O=>s[0]===O[7]&&this.teamSelected===O[2]).forEach(O=>{let W=O[3],b=O[4];(e.homeTeamAtkDirection===1&&s[3]===1||e.homeTeamAtkDirection===2&&s[3]===2||e.homeTeamAtkDirection===1&&s[3]===3||e.homeTeamAtkDirection===2&&s[3]===4)&&(W=1-W,b=1-b),O[3]=W,O[4]=b})}),e.field_positions},createStorageGame(){this.totalDataCollection[this.game.id]={},this.totalDataCollection[this.game.id][this.game.home_team]={},this.totalDataCollection[this.game.id][this.game.home_team].InFavor={},this.totalDataCollection[this.game.id][this.game.home_team].InFavor.touch=[],this.totalDataCollection[this.game.id][this.game.home_team].InFavor.positions=[],this.totalDataCollection[this.game.id][this.game.home_team].Against={},this.totalDataCollection[this.game.id][this.game.home_team].Against.touch=[],this.totalDataCollection[this.game.id][this.game.home_team].Against.positions=[],(this.forGame||this.forSeason)&&(this.totalDataCollection[this.game.id][this.game.away_team]={},this.totalDataCollection[this.game.id][this.game.away_team].InFavor={},this.totalDataCollection[this.game.id][this.game.away_team].InFavor.touch=[],this.totalDataCollection[this.game.id][this.game.away_team].InFavor.positions=[],this.totalDataCollection[this.game.id][this.game.away_team].Against={},this.totalDataCollection[this.game.id][this.game.away_team].Against.touch=[],this.totalDataCollection[this.game.id][this.game.away_team].Against.positions=[])},validateDataLocalStorage(e){return this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].touch.length>0&&this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].positions.length>0?(this.touchDataSelected=this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].touch,this.positionsDataSelected=this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].positions,!1):!0},getGamesByTeam(e){this.forSeason?e.type=="home"?this.gamesAllHome=e.games.filter(function(o){return(o.home_team==e.idTeam||o.visiting_team==e.idTeam)&&o.game_status==1}):this.gamesAllAway=e.games.filter(function(o){return(o.home_team==e.idTeam||o.visiting_team==e.idTeam)&&o.game_status==1}):this.forGame?e.type=="home"?this.gamesAllHome=e.games.filter(function(o){return o.game_id==e.game.id}):this.gamesAllAway=e.games.filter(function(o){return o.game_id==e.game.id}):this.gamesAllHome=e.games.filter(function(o){return(o.home_team==e.idTeam||o.visiting_team==e.idTeam)&&o.game_status==1})},async getDataCorners(e){const o=du.create({headers:{Authorization:`${this.token}`}}),s="https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?seasons="+e.season;if(this.lastGamesBySeasonUrl===s)return;this.lastGamesBySeasonUrl=s;let O=await o.get(s);O.data.data[0].games.filter(W=>W.game_status===1).length===0?(this.regularflag=!0,O=await o.get("https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?seasons="+this.game.regularSeasonId)):this.regularflag=!1,this.forSeason?(this.getGamesByTeam({games:O.data.data[0].games,idTeam:e.home_team,type:"home"}),this.getGamesByTeam({games:O.data.data[0].games,idTeam:e.away_team,type:"away"}),this.validateDataLocalStorage({team:this.game.home_team,inFavor:!0,game:this.game})&&await this.requestOrchestrator({games:this.gamesAllHome,team:this.game.home_team,inFavor:!0,game:this.game})):this.forGame?(this.getGamesByTeam({games:O.data.data[0].games,idTeam:e.home_team,game:this.game,type:"home"}),this.getGamesByTeam({games:O.data.data[0].games,idTeam:e.away_team,game:this.game,type:"away"}),this.validateDataLocalStorage({team:this.game.home_team,inFavor:!0,game:this.game})&&await this.requestOrchestrator({games:this.gamesAllHome,team:this.game.home_team,inFavor:!0,game:this.game})):(this.getGamesByTeam({games:O.data.data[0].games,idTeam:e.home_team,type:"home"}),this.validateDataLocalStorage({team:e.home_team,inFavor:!0,game:this.game})&&await this.requestOrchestrator({games:this.gamesAllHome,team:this.game.home_team,inFavor:!0,game:this.game}))},obtenerNombreAbreviado(e){let o=e.split(", ");if(o.length!==2)return e;let s=o[0],O=o[1],W=s.split(" ")[0];return O.charAt(0).toUpperCase()+". "+W},getDataPlayers(e){for(let o=0;o<e.length;o++)this.playersData.hasOwnProperty(e[o].player_id)||(this.playersData[e[o].player_id]={name:this.obtenerNombreAbreviado(e[o].name),last_name:e[o].name.includes(",")?e[o].name.split(",")[0].trim():"",first_name:e[o].name.includes(",")?e[o].name.split(",")[1].trim():"",img:e[o].photo,photo:e[o].photo,position:e[o].position_id,positions:[e[o].position_id],id:e[o].player_id,player_id:e[o].player_id,team_id:e[o].team_id,team:e[o].team_id,nationality_id:e[o].nationality_id,nationality_flag:"https://golstatsimages.blob.core.windows.net/flags/"+e[o].nationality_id+".jpg",jersey:e[o].jersey,isSelected:!0})},getSeasonByGame(e){e.season!=""?this.seasonsByGame[e.game]=e.season:this.seasonsByGame[e.game]="-"},getMatchByGame(e){e.match!=""?this.matchesByGame[e.game]=e.match.replace("M","J"):this.matchesByGame[e.game]="-"},getRivalsByGame(e){this.rivalsByGame[e.favor?"InFavor":"Against"]?this.rivalsByGame[e.favor?"InFavor":"Against"][e.team]?this.rivalsByGame[e.favor?"InFavor":"Against"][e.team][e.game]=e.rival:(this.rivalsByGame[e.favor?"InFavor":"Against"][e.team]={},this.rivalsByGame[e.favor?"InFavor":"Against"][e.team][e.game]=e.rival):(this.rivalsByGame[e.favor?"InFavor":"Against"]={},this.rivalsByGame[e.favor?"InFavor":"Against"][e.team]={},this.rivalsByGame[e.favor?"InFavor":"Against"][e.team][e.game]=e.rival)},getDataTeams(e){for(let o=0;o<e.length;o++)this.teamsData.hasOwnProperty(e[o].team_id)||(this.teamsData[e[o].team_id]={name:e[o].name,acronym:e[o].acronym,img:"https://golstatsimages.blob.core.windows.net/teams-80/"+e[o].team_id+".png",id:e[o].team_id})},getTypePlay(e){typeof e=="string"&&(this.typePlay=e)},clickOpenModal(){this.openModal=!this.openModal,document.body.classList.add("no-scroll")},clickCloseFinal(){this.openModal=!1,document.body.classList.remove("no-scroll")},onCornersFilled({corners:e,cornersAgainst:o}){this.teamCorners={corners:e,cornersAgainst:o}},onOpenMediaPlayer(e){this.$emit("open-media-player",e)},onOpenMediaPlayerJson(e){let o={seasonId:this.seasonId,mainSectionType:1,playListType:3,categoryIds:[e.id],gameIds:this.forGame?[this.game.id]:null,playerIds:[],goalkeeperIds:[],teamId:this.teamSelected,matchResult:[1,2,3],playData:{},advancedFilter:{playListTitle:""}};this.$emit("open-media-player",o)}},mounted(){this.isLoading=!0,document.body.classList.add("no-scroll"),this.setHeaderStickyListener();const e=()=>{const o=document.querySelector(".gsc-set-piece");o?this.containerWidth=o.clientWidth:setTimeout(()=>{},400)};window.addEventListener("resize",e),this.$nextTick(e)}},wU=()=>{t.useCssVars(e=>({"2bfb0002":e.heightFilters}))},kU=dT.setup;dT.setup=kU?(e,o)=>(wU(),kU(e,o)):wU;const ROt={class:"gsc-set-piece"},VOt={key:0,class:"overlay-loading"},jOt={ref:"header",class:"gsc-set-piece__header"};function $Ot(e,o,s,O,W,b){const g=t.resolveComponent("GSCHeaderSetPiece"),a=t.resolveComponent("GSCDataToHighlight"),y=t.resolveComponent("GSCTrend"),h=t.resolveComponent("GSCConnectionsSetPiece"),n=t.resolveComponent("GSCModalBreakdown"),x=t.resolveComponent("GSCSpecificPlays");return t.openBlock(),t.createElementBlock("div",ROt,[W.isLoading?(t.openBlock(),t.createElementBlock("div",VOt,o[0]||(o[0]=[t.createElementVNode("div",{class:"overlay-loading__spinner"},[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/balon_liga.png",alt:""})],-1),t.createElementVNode("div",{class:"overlay-loading__text"},"Loading...",-1)]))):t.createCommentVNode("",!0),t.createElementVNode("div",jOt,[(t.openBlock(),t.createBlock(g,{"width-container":W.containerWidth,type:s.forTeam?0:3,"teams-data":W.teamsData,"tournament-selected":s.tournamentSelected,"game-info":s.game,"total-corners":b.calculateTotal,"show-corners":W.showCorners,"in-favor":W.infavoragainst,"corners-in-favor":W.teamCorners.corners,"corners-against":W.teamCorners.cornersAgainst,"for-game":s.forGame,key:W.updateFilter,lateralidad:W.lateralidad,"available-players":W.filterPlayersAvailable,"available-games":W.filterGamesAvailable,"is-synchronization":s.isSynchronization,onChangeShowFilters:b.onChangeShowFilters,onChangetypePlay:b.getTypePlay,onOpenModal:b.clickOpenModal,onTeamselected:b.getTeamSelected,onInfavoragainstteam:b.getInFavorAgainstTeam,onFilter_results_by_time:b.getFilterResultsByTime,onFilter_details:b.getFilterDetails,onFilter_games:b.getFilterGames,onFilter_takencorners:b.getFilterTakenCorners,onFilter_howwascorner:b.getFilterHowWasCorner,onFilter_zone:b.getFilterZone,onFilter_whathappened:b.getFilterWhatHappened},null,8,["width-container","type","teams-data","tournament-selected","game-info","total-corners","show-corners","in-favor","corners-in-favor","corners-against","for-game","lateralidad","available-players","available-games","is-synchronization","onChangeShowFilters","onChangetypePlay","onOpenModal","onTeamselected","onInfavoragainstteam","onFilter_results_by_time","onFilter_details","onFilter_games","onFilter_takencorners","onFilter_howwascorner","onFilter_zone","onFilter_whathappened"]))],512),!s.isSynchronization&&W.teamSelected>0&&W.regularflag!==null&&s.seasonSelected.incomplete_season!=1?(t.openBlock(),t.createBlock(a,{key:1,team:W.teamSelected,season:s.game.season,game:s.game,"flag-regular":W.regularflag,"in-favor":W.infavoragainst,"width-container":W.containerWidth},null,8,["team","season","game","flag-regular","in-favor","width-container"])):t.createCommentVNode("",!0),s.isSynchronization?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(y,{"players-data":W.playersData,"teams-data":W.teamsData,"tournament-selected":s.tournamentSelected,"touch-all-data":b.calculationTouchesData,"field-positions-all":b.calculationPositionsData,"width-container":W.containerWidth,"in-favor":W.infavoragainst,"for-game":s.forGame,"home-team":s.game.home_team,"away-team":s.game.away_team,"acronym-home":s.game.home_acronym,"acronym-away":s.game.away_acronym,team:W.teamSelected,"type-play":W.typePlay,selected_category:W.filters.cornertype,"is-tactic-visible":s.isTacticVisible,key:W.updateTrend,onChangelateralidad:b.setCornersSide},null,8,["players-data","teams-data","tournament-selected","touch-all-data","field-positions-all","width-container","in-favor","for-game","home-team","away-team","acronym-home","acronym-away","team","type-play","selected_category","is-tactic-visible","onChangelateralidad"])),!s.isSynchronization&&W.teamSelected>0?(t.openBlock(),t.createBlock(h,{"seasons-by-game":W.seasonsByGame,"matches-by-game":W.matchesByGame,"rivals-by-game":W.rivalsByGame,"width-container":W.containerWidth,selected_category:W.filters.cornertype,"players-data":W.playersData,"tournament-selected":s.tournamentSelected,"teams-data":W.teamsData,onChangelateralidad:b.setCornersSide,"touch-all-data":b.calculationTouchesData,"team-id":s.forGame?W.infavoragainst?W.teamSelected:W.teamSelected==s.game.home_team?s.game.away_team:s.game.home_team:W.teamSelected,"in-favor":W.infavoragainst,"for-game":s.forGame,key:W.updateConnections},null,8,["seasons-by-game","matches-by-game","rivals-by-game","width-container","selected_category","players-data","tournament-selected","teams-data","onChangelateralidad","touch-all-data","team-id","in-favor","for-game"])):t.createCommentVNode("",!0),W.openModal?(t.openBlock(),t.createBlock(n,{key:4,"component-width":W.containerWidth,onClickClose:b.clickCloseFinal,"show-modal-prop":W.openModal,id:W.teamSelected,"season-id":s.game.season,game:s.game.id,onClickPlay:b.onOpenMediaPlayerJson,prematch:!!s.forGame},null,8,["component-width","onClickClose","show-modal-prop","id","season-id","game","onClickPlay","prematch"])):t.createCommentVNode("",!0),W.isSpecificPlaysVisible&&W.teamSelected&&s.game.season?(t.openBlock(),t.createBlock(x,{key:5,"team-id-for-analysis":W.teamSelected,"season-id-for-analysis":s.game?s.game.season:W.seasonId,"width-container":W.containerWidth,filters:W.filters,"is-game-only":b.isGameOnly,"tournament-selected":s.tournamentSelected,selected_category:W.filters.cornertype,game:s.game,"is-against-mode":!W.infavoragainst,"are-filters-open":W.areFiltersOpen,"is-tactic-visible":s.isTacticVisible,"is-synchronization":s.isSynchronization,"can-play-videos":s.canPlayVideos,"video-privileges-playing-as":s.videoPrivilegesPlayingAs,onChangelateralidad:b.setCornersSide,onOpenMediaPlayer:b.onOpenMediaPlayer,onCornersFilled:b.onCornersFilled},null,8,["team-id-for-analysis","season-id-for-analysis","width-container","filters","is-game-only","tournament-selected","selected_category","game","is-against-mode","are-filters-open","is-tactic-visible","is-synchronization","can-play-videos","video-privileges-playing-as","onChangelateralidad","onOpenMediaPlayer","onCornersFilled"])):t.createCommentVNode("",!0)])}const UOt=cu(dT,[["render",$Ot],["__scopeId","data-v-27fb5bc4"]]),QJt="",eKt="",GOt={class:"datagame-container"},HOt=Ji({__name:"GSCTacticaFijaMain",props:{game:{type:Object,default:()=>({})},isTacticVisible:{type:Boolean,default:!0},isSynchronization:{type:Boolean,default:!1},seasonSelected:{type:Object,default:()=>({})},tournamentSelected:{type:Object,default:()=>({})},canPlayVideos:{type:Boolean,default:!0},videoPrivilegesPlayingAs:{type:Set,default:()=>new Set([1,2])}},emits:["open-media-player"],setup(e,{emit:o}){function s(O){o("open-media-player",O)}return(O,W)=>(t.openBlock(),t.createElementBlock("div",GOt,[t.createVNode(t.unref(UOt),{game:{id:e.game.gameId,home_team:e.game.homeTeam.team_id,away_team:e.game.awayTeam.team_id,season:e.game.seasonId,regularSeasonId:e.game.regularSeasonId,game_status:e.game.game_status,home_acronym:e.game.homeTeam.acronym,away_acronym:e.game.awayTeam.acronym,logo_home:"https://golstatsimages.blob.core.windows.net/teams-80/"+e.game.homeTeam.team_id+".png",logo_away:"https://golstatsimages.blob.core.windows.net/teams-80/"+e.game.awayTeam.team_id+".png"},seasonSelected:e.seasonSelected,"tournament-selected":e.tournamentSelected,"for-season":e.game.game_status===4,"for-team":!1,"for-game":e.game.game_status!==4,"is-tactic-visible":e.isTacticVisible,"is-synchronization":e.isSynchronization,"can-play-videos":e.canPlayVideos,"video-privileges-playing-as":e.videoPrivilegesPlayingAs,onOpenMediaPlayer:s},null,8,["game","seasonSelected","tournament-selected","for-season","for-game","is-tactic-visible","is-synchronization","can-play-videos","video-privileges-playing-as"])]))}},[["__scopeId","data-v-1d2fe878"]]),l_=(e,o)=>{const s=e.__vccOpts||e;for(const[O,W]of o)s[O]=W;return s},WOt={__name:"ButtonCustom",props:{text:{type:String,default:""},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},padding:{type:String,default:"0px"},borderRadius:{type:String,default:"0px"},borderWidth:{type:String,default:"1px"},borderColor:{type:String,default:"#d9d9d9"},backgroundColor:{type:String,default:"#FFFFFF"},activeBackgroundColor:{type:String,default:""},activeBorderColor:{type:String,default:""},activeBorderWidth:{type:String,default:"1px"},activeFontColor:{type:String,default:""},fontColor:{type:String,default:"#000000"},fontSize:{type:String,default:"16px"},fontFamily:{type:String,default:"Poppins-Regular, sans-serif"},isActive:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:o}){const s=e,O=t.computed(()=>({"--height":s.height,"--width":s.width,"--padding":s.padding,"--border-radius":s.borderRadius,"--border":`solid ${s.borderWidth} ${s.borderColor}`,"--background-color":s.backgroundColor,"--font-color":s.fontColor,"--font-size":s.fontSize,"--font-family":s.fontFamily,"--active-background-color":s.activeBackgroundColor||s.backgroundColor,"--active-border-color":s.activeBorderColor||s.borderColor,"--active-font-color":s.activeFontColor||s.fontColor}));function W(){o("click")}return(b,g)=>(t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["button",{active:e.isActive}]),style:t.normalizeStyle(O.value),onClick:W},t.toDisplayString(e.text),7))}},qOt=l_(WOt,[["__scopeId","data-v-ea76c1c1"]]);function SU(e,o){return function(){return e.apply(o,arguments)}}const{toString:YOt}=Object.prototype,{getPrototypeOf:hT}=Object,I5=(e=>o=>{const s=YOt.call(o);return e[s]||(e[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),Of=e=>(e=e.toLowerCase(),o=>I5(o)===e),P5=e=>o=>typeof o===e,{isArray:fv}=Array,c_=P5("undefined");function ZOt(e){return e!==null&&!c_(e)&&e.constructor!==null&&!c_(e.constructor)&&xp(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const TU=Of("ArrayBuffer");function XOt(e){let o;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?o=ArrayBuffer.isView(e):o=e&&e.buffer&&TU(e.buffer),o}const JOt=P5("string"),xp=P5("function"),CU=P5("number"),B5=e=>e!==null&&typeof e=="object",KOt=e=>e===!0||e===!1,L5=e=>{if(I5(e)!=="object")return!1;const o=hT(e);return(o===null||o===Object.prototype||Object.getPrototypeOf(o)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},QOt=Of("Date"),eFt=Of("File"),tFt=Of("Blob"),nFt=Of("FileList"),aFt=e=>B5(e)&&xp(e.pipe),rFt=e=>{let o;return e&&(typeof FormData=="function"&&e instanceof FormData||xp(e.append)&&((o=I5(e))==="formdata"||o==="object"&&xp(e.toString)&&e.toString()==="[object FormData]"))},iFt=Of("URLSearchParams"),[oFt,sFt,lFt,cFt]=["ReadableStream","Request","Response","Headers"].map(Of),uFt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function u_(e,o,{allOwnKeys:s=!1}={}){if(e===null||typeof e>"u")return;let O,W;if(typeof e!="object"&&(e=[e]),fv(e))for(O=0,W=e.length;O<W;O++)o.call(null,e[O],O,e);else{const b=s?Object.getOwnPropertyNames(e):Object.keys(e),g=b.length;let a;for(O=0;O<g;O++)a=b[O],o.call(null,e[a],a,e)}}function EU(e,o){o=o.toLowerCase();const s=Object.keys(e);let O=s.length,W;for(;O-- >0;)if(W=s[O],o===W.toLowerCase())return W;return null}const p1=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),AU=e=>!c_(e)&&e!==p1;function pT(){const{caseless:e}=AU(this)&&this||{},o={},s=(O,W)=>{const b=e&&EU(o,W)||W;L5(o[b])&&L5(O)?o[b]=pT(o[b],O):L5(O)?o[b]=pT({},O):fv(O)?o[b]=O.slice():o[b]=O};for(let O=0,W=arguments.length;O<W;O++)arguments[O]&&u_(arguments[O],s);return o}const dFt=(e,o,s,{allOwnKeys:O}={})=>(u_(o,(W,b)=>{s&&xp(W)?e[b]=SU(W,s):e[b]=W},{allOwnKeys:O}),e),hFt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),pFt=(e,o,s,O)=>{e.prototype=Object.create(o.prototype,O),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:o.prototype}),s&&Object.assign(e.prototype,s)},fFt=(e,o,s,O)=>{let W,b,g;const a={};if(o=o||{},e==null)return o;do{for(W=Object.getOwnPropertyNames(e),b=W.length;b-- >0;)g=W[b],(!O||O(g,e,o))&&!a[g]&&(o[g]=e[g],a[g]=!0);e=s!==!1&&hT(e)}while(e&&(!s||s(e,o))&&e!==Object.prototype);return o},mFt=(e,o,s)=>{e=String(e),(s===void 0||s>e.length)&&(s=e.length),s-=o.length;const O=e.indexOf(o,s);return O!==-1&&O===s},gFt=e=>{if(!e)return null;if(fv(e))return e;let o=e.length;if(!CU(o))return null;const s=new Array(o);for(;o-- >0;)s[o]=e[o];return s},yFt=(e=>o=>e&&o instanceof e)(typeof Uint8Array<"u"&&hT(Uint8Array)),vFt=(e,o)=>{const s=(e&&e[Symbol.iterator]).call(e);let O;for(;(O=s.next())&&!O.done;){const W=O.value;o.call(e,W[0],W[1])}},_Ft=(e,o)=>{let s;const O=[];for(;(s=e.exec(o))!==null;)O.push(s);return O},bFt=Of("HTMLFormElement"),xFt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,s,O){return s.toUpperCase()+O}),MU=(({hasOwnProperty:e})=>(o,s)=>e.call(o,s))(Object.prototype),wFt=Of("RegExp"),IU=(e,o)=>{const s=Object.getOwnPropertyDescriptors(e),O={};u_(s,(W,b)=>{let g;(g=o(W,b,e))!==!1&&(O[b]=g||W)}),Object.defineProperties(e,O)},kFt=e=>{IU(e,(o,s)=>{if(xp(e)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;const O=e[s];if(xp(O)){if(o.enumerable=!1,"writable"in o){o.writable=!1;return}o.set||(o.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},SFt=(e,o)=>{const s={},O=W=>{W.forEach(b=>{s[b]=!0})};return fv(e)?O(e):O(String(e).split(o)),s},TFt=()=>{},CFt=(e,o)=>e!=null&&Number.isFinite(e=+e)?e:o,fT="abcdefghijklmnopqrstuvwxyz",PU="0123456789",BU={DIGIT:PU,ALPHA:fT,ALPHA_DIGIT:fT+fT.toUpperCase()+PU},EFt=(e=16,o=BU.ALPHA_DIGIT)=>{let s="";const{length:O}=o;for(;e--;)s+=o[Math.random()*O|0];return s};function AFt(e){return!!(e&&xp(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const MFt=e=>{const o=new Array(10),s=(O,W)=>{if(B5(O)){if(o.indexOf(O)>=0)return;if(!("toJSON"in O)){o[W]=O;const b=fv(O)?[]:{};return u_(O,(g,a)=>{const y=s(g,W+1);!c_(y)&&(b[a]=y)}),o[W]=void 0,b}}return O};return s(e,0)},IFt=Of("AsyncFunction"),PFt=e=>e&&(B5(e)||xp(e))&&xp(e.then)&&xp(e.catch),LU=((e,o)=>e?setImmediate:o?((s,O)=>(p1.addEventListener("message",({source:W,data:b})=>{W===p1&&b===s&&O.length&&O.shift()()},!1),W=>{O.push(W),p1.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",xp(p1.postMessage)),BFt=typeof queueMicrotask<"u"?queueMicrotask.bind(p1):typeof process<"u"&&process.nextTick||LU,jr={isArray:fv,isArrayBuffer:TU,isBuffer:ZOt,isFormData:rFt,isArrayBufferView:XOt,isString:JOt,isNumber:CU,isBoolean:KOt,isObject:B5,isPlainObject:L5,isReadableStream:oFt,isRequest:sFt,isResponse:lFt,isHeaders:cFt,isUndefined:c_,isDate:QOt,isFile:eFt,isBlob:tFt,isRegExp:wFt,isFunction:xp,isStream:aFt,isURLSearchParams:iFt,isTypedArray:yFt,isFileList:nFt,forEach:u_,merge:pT,extend:dFt,trim:uFt,stripBOM:hFt,inherits:pFt,toFlatObject:fFt,kindOf:I5,kindOfTest:Of,endsWith:mFt,toArray:gFt,forEachEntry:vFt,matchAll:_Ft,isHTMLForm:bFt,hasOwnProperty:MU,hasOwnProp:MU,reduceDescriptors:IU,freezeMethods:kFt,toObjectSet:SFt,toCamelCase:xFt,noop:TFt,toFiniteNumber:CFt,findKey:EU,global:p1,isContextDefined:AU,ALPHABET:BU,generateString:EFt,isSpecCompliantForm:AFt,toJSONObject:MFt,isAsyncFn:IFt,isThenable:PFt,setImmediate:LU,asap:BFt};function kl(e,o,s,O,W){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",o&&(this.code=o),s&&(this.config=s),O&&(this.request=O),W&&(this.response=W,this.status=W.status?W.status:null)}jr.inherits(kl,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:jr.toJSONObject(this.config),code:this.code,status:this.status}}});const zU=kl.prototype,OU={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{OU[e]={value:e}}),Object.defineProperties(kl,OU),Object.defineProperty(zU,"isAxiosError",{value:!0}),kl.from=(e,o,s,O,W,b)=>{const g=Object.create(zU);return jr.toFlatObject(e,g,function(a){return a!==Error.prototype},a=>a!=="isAxiosError"),kl.call(g,e.message,o,s,O,W),g.cause=e,g.name=e.name,b&&Object.assign(g,b),g};const LFt=null;function mT(e){return jr.isPlainObject(e)||jr.isArray(e)}function FU(e){return jr.endsWith(e,"[]")?e.slice(0,-2):e}function NU(e,o,s){return e?e.concat(o).map(function(O,W){return O=FU(O),!s&&W?"["+O+"]":O}).join(s?".":""):o}function zFt(e){return jr.isArray(e)&&!e.some(mT)}const OFt=jr.toFlatObject(jr,{},null,function(e){return/^is[A-Z]/.test(e)});function z5(e,o,s){if(!jr.isObject(e))throw new TypeError("target must be an object");o=o||new FormData,s=jr.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,u){return!jr.isUndefined(u[v])});const O=s.metaTokens,W=s.visitor||h,b=s.dots,g=s.indexes,a=(s.Blob||typeof Blob<"u"&&Blob)&&jr.isSpecCompliantForm(o);if(!jr.isFunction(W))throw new TypeError("visitor must be a function");function y(v){if(v===null)return"";if(jr.isDate(v))return v.toISOString();if(!a&&jr.isBlob(v))throw new kl("Blob is not supported. Use a Buffer instead.");return jr.isArrayBuffer(v)||jr.isTypedArray(v)?a&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function h(v,u,r){let i=v;if(v&&!r&&typeof v=="object"){if(jr.endsWith(u,"{}"))u=O?u:u.slice(0,-2),v=JSON.stringify(v);else if(jr.isArray(v)&&zFt(v)||(jr.isFileList(v)||jr.endsWith(u,"[]"))&&(i=jr.toArray(v)))return u=FU(u),i.forEach(function(d,l){!(jr.isUndefined(d)||d===null)&&o.append(g===!0?NU([u],l,b):g===null?u:u+"[]",y(d))}),!1}return mT(v)?!0:(o.append(NU(r,u,b),y(v)),!1)}const n=[],x=Object.assign(OFt,{defaultVisitor:h,convertValue:y,isVisitable:mT});function _(v,u){if(!jr.isUndefined(v)){if(n.indexOf(v)!==-1)throw Error("Circular reference detected in "+u.join("."));n.push(v),jr.forEach(v,function(r,i){(!(jr.isUndefined(r)||r===null)&&W.call(o,r,jr.isString(i)?i.trim():i,u,x))===!0&&_(r,u?u.concat(i):[i])}),n.pop()}}if(!jr.isObject(e))throw new TypeError("data must be an object");return _(e),o}function DU(e){const o={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return o[s]})}function gT(e,o){this._pairs=[],e&&z5(e,this,o)}const RU=gT.prototype;RU.append=function(e,o){this._pairs.push([e,o])},RU.toString=function(e){const o=e?function(s){return e.call(this,s,DU)}:DU;return this._pairs.map(function(s){return o(s[0])+"="+o(s[1])},"").join("&")};function FFt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function VU(e,o,s){if(!o)return e;const O=s&&s.encode||FFt;jr.isFunction(s)&&(s={serialize:s});const W=s&&s.serialize;let b;if(W?b=W(o,s):b=jr.isURLSearchParams(o)?o.toString():new gT(o,s).toString(O),b){const g=e.indexOf("#");g!==-1&&(e=e.slice(0,g)),e+=(e.indexOf("?")===-1?"?":"&")+b}return e}class NFt{constructor(){this.handlers=[]}use(o,s,O){return this.handlers.push({fulfilled:o,rejected:s,synchronous:O?O.synchronous:!1,runWhen:O?O.runWhen:null}),this.handlers.length-1}eject(o){this.handlers[o]&&(this.handlers[o]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(o){jr.forEach(this.handlers,function(s){s!==null&&o(s)})}}const jU=NFt,$U={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},DFt=typeof URLSearchParams<"u"?URLSearchParams:gT,RFt=typeof FormData<"u"?FormData:null,VFt=typeof Blob<"u"?Blob:null,jFt={isBrowser:!0,classes:{URLSearchParams:DFt,FormData:RFt,Blob:VFt},protocols:["http","https","file","blob","url","data"]},yT=typeof window<"u"&&typeof document<"u",vT=typeof navigator=="object"&&navigator||void 0,$Ft=yT&&(!vT||["ReactNative","NativeScript","NS"].indexOf(vT.product)<0),UFt=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),GFt=yT&&window.location.href||"http://localhost",HFt=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:yT,hasStandardBrowserEnv:$Ft,hasStandardBrowserWebWorkerEnv:UFt,navigator:vT,origin:GFt},Symbol.toStringTag,{value:"Module"})),xh={...HFt,...jFt};function WFt(e,o){return z5(e,new xh.classes.URLSearchParams,Object.assign({visitor:function(s,O,W,b){return xh.isNode&&jr.isBuffer(s)?(this.append(O,s.toString("base64")),!1):b.defaultVisitor.apply(this,arguments)}},o))}function qFt(e){return jr.matchAll(/\w+|\[(\w*)]/g,e).map(o=>o[0]==="[]"?"":o[1]||o[0])}function YFt(e){const o={},s=Object.keys(e);let O;const W=s.length;let b;for(O=0;O<W;O++)b=s[O],o[b]=e[b];return o}function UU(e){function o(s,O,W,b){let g=s[b++];if(g==="__proto__")return!0;const a=Number.isFinite(+g),y=b>=s.length;return g=!g&&jr.isArray(W)?W.length:g,y?(jr.hasOwnProp(W,g)?W[g]=[W[g],O]:W[g]=O,!a):((!W[g]||!jr.isObject(W[g]))&&(W[g]=[]),o(s,O,W[g],b)&&jr.isArray(W[g])&&(W[g]=YFt(W[g])),!a)}if(jr.isFormData(e)&&jr.isFunction(e.entries)){const s={};return jr.forEachEntry(e,(O,W)=>{o(qFt(O),W,s,0)}),s}return null}function ZFt(e,o,s){if(jr.isString(e))try{return(o||JSON.parse)(e),jr.trim(e)}catch(O){if(O.name!=="SyntaxError")throw O}return(s||JSON.stringify)(e)}const _T={transitional:$U,adapter:["xhr","http","fetch"],transformRequest:[function(e,o){const s=o.getContentType()||"",O=s.indexOf("application/json")>-1,W=jr.isObject(e);if(W&&jr.isHTMLForm(e)&&(e=new FormData(e)),jr.isFormData(e))return O?JSON.stringify(UU(e)):e;if(jr.isArrayBuffer(e)||jr.isBuffer(e)||jr.isStream(e)||jr.isFile(e)||jr.isBlob(e)||jr.isReadableStream(e))return e;if(jr.isArrayBufferView(e))return e.buffer;if(jr.isURLSearchParams(e))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let b;if(W){if(s.indexOf("application/x-www-form-urlencoded")>-1)return WFt(e,this.formSerializer).toString();if((b=jr.isFileList(e))||s.indexOf("multipart/form-data")>-1){const g=this.env&&this.env.FormData;return z5(b?{"files[]":e}:e,g&&new g,this.formSerializer)}}return W||O?(o.setContentType("application/json",!1),ZFt(e)):e}],transformResponse:[function(e){const o=this.transitional||_T.transitional,s=o&&o.forcedJSONParsing,O=this.responseType==="json";if(jr.isResponse(e)||jr.isReadableStream(e))return e;if(e&&jr.isString(e)&&(s&&!this.responseType||O)){const W=!(o&&o.silentJSONParsing)&&O;try{return JSON.parse(e)}catch(b){if(W)throw b.name==="SyntaxError"?kl.from(b,kl.ERR_BAD_RESPONSE,this,null,this.response):b}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:xh.classes.FormData,Blob:xh.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};jr.forEach(["delete","get","head","post","put","patch"],e=>{_T.headers[e]={}});const bT=_T,XFt=jr.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),JFt=e=>{const o={};let s,O,W;return e&&e.split(`
|
|
8175
8175
|
`).forEach(function(b){W=b.indexOf(":"),s=b.substring(0,W).trim().toLowerCase(),O=b.substring(W+1).trim(),!(!s||o[s]&&XFt[s])&&(s==="set-cookie"?o[s]?o[s].push(O):o[s]=[O]:o[s]=o[s]?o[s]+", "+O:O)}),o},GU=Symbol("internals");function d_(e){return e&&String(e).trim().toLowerCase()}function O5(e){return e===!1||e==null?e:jr.isArray(e)?e.map(O5):String(e)}function KFt(e){const o=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let O;for(;O=s.exec(e);)o[O[1]]=O[2];return o}const QFt=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function xT(e,o,s,O,W){if(jr.isFunction(O))return O.call(this,o,s);if(W&&(o=s),!!jr.isString(o)){if(jr.isString(O))return o.indexOf(O)!==-1;if(jr.isRegExp(O))return O.test(o)}}function eNt(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(o,s,O)=>s.toUpperCase()+O)}function tNt(e,o){const s=jr.toCamelCase(" "+o);["get","set","has"].forEach(O=>{Object.defineProperty(e,O+s,{value:function(W,b,g){return this[O].call(this,o,W,b,g)},configurable:!0})})}class F5{constructor(o){o&&this.set(o)}set(o,s,O){const W=this;function b(a,y,h){const n=d_(y);if(!n)throw new Error("header name must be a non-empty string");const x=jr.findKey(W,n);(!x||W[x]===void 0||h===!0||h===void 0&&W[x]!==!1)&&(W[x||y]=O5(a))}const g=(a,y)=>jr.forEach(a,(h,n)=>b(h,n,y));if(jr.isPlainObject(o)||o instanceof this.constructor)g(o,s);else if(jr.isString(o)&&(o=o.trim())&&!QFt(o))g(JFt(o),s);else if(jr.isHeaders(o))for(const[a,y]of o.entries())b(y,a,O);else o!=null&&b(s,o,O);return this}get(o,s){if(o=d_(o),o){const O=jr.findKey(this,o);if(O){const W=this[O];if(!s)return W;if(s===!0)return KFt(W);if(jr.isFunction(s))return s.call(this,W,O);if(jr.isRegExp(s))return s.exec(W);throw new TypeError("parser must be boolean|regexp|function")}}}has(o,s){if(o=d_(o),o){const O=jr.findKey(this,o);return!!(O&&this[O]!==void 0&&(!s||xT(this,this[O],O,s)))}return!1}delete(o,s){const O=this;let W=!1;function b(g){if(g=d_(g),g){const a=jr.findKey(O,g);a&&(!s||xT(O,O[a],a,s))&&(delete O[a],W=!0)}}return jr.isArray(o)?o.forEach(b):b(o),W}clear(o){const s=Object.keys(this);let O=s.length,W=!1;for(;O--;){const b=s[O];(!o||xT(this,this[b],b,o,!0))&&(delete this[b],W=!0)}return W}normalize(o){const s=this,O={};return jr.forEach(this,(W,b)=>{const g=jr.findKey(O,b);if(g){s[g]=O5(W),delete s[b];return}const a=o?eNt(b):String(b).trim();a!==b&&delete s[b],s[a]=O5(W),O[a]=!0}),this}concat(...o){return this.constructor.concat(this,...o)}toJSON(o){const s=Object.create(null);return jr.forEach(this,(O,W)=>{O!=null&&O!==!1&&(s[W]=o&&jr.isArray(O)?O.join(", "):O)}),s}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([o,s])=>o+": "+s).join(`
|
|
8176
8176
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(o){return o instanceof this?o:new this(o)}static concat(o,...s){const O=new this(o);return s.forEach(W=>O.set(W)),O}static accessor(o){const s=(this[GU]=this[GU]={accessors:{}}).accessors,O=this.prototype;function W(b){const g=d_(b);s[g]||(tNt(O,b),s[g]=!0)}return jr.isArray(o)?o.forEach(W):W(o),this}}F5.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),jr.reduceDescriptors(F5.prototype,({value:e},o)=>{let s=o[0].toUpperCase()+o.slice(1);return{get:()=>e,set(O){this[s]=O}}}),jr.freezeMethods(F5);const Ff=F5;function wT(e,o){const s=this||bT,O=o||s,W=Ff.from(O.headers);let b=O.data;return jr.forEach(e,function(g){b=g.call(s,b,W.normalize(),o?o.status:void 0)}),W.normalize(),b}function HU(e){return!!(e&&e.__CANCEL__)}function mv(e,o,s){kl.call(this,e??"canceled",kl.ERR_CANCELED,o,s),this.name="CanceledError"}jr.inherits(mv,kl,{__CANCEL__:!0});function WU(e,o,s){const O=s.config.validateStatus;!s.status||!O||O(s.status)?e(s):o(new kl("Request failed with status code "+s.status,[kl.ERR_BAD_REQUEST,kl.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}function nNt(e){const o=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return o&&o[1]||""}function aNt(e,o){e=e||10;const s=new Array(e),O=new Array(e);let W=0,b=0,g;return o=o!==void 0?o:1e3,function(a){const y=Date.now(),h=O[b];g||(g=y),s[W]=a,O[W]=y;let n=b,x=0;for(;n!==W;)x+=s[n++],n=n%e;if(W=(W+1)%e,W===b&&(b=(b+1)%e),y-g<o)return;const _=h&&y-h;return _?Math.round(x*1e3/_):void 0}}function rNt(e,o){let s=0,O=1e3/o,W,b;const g=(a,y=Date.now())=>{s=y,W=null,b&&(clearTimeout(b),b=null),e.apply(null,a)};return[(...a)=>{const y=Date.now(),h=y-s;h>=O?g(a,y):(W=a,b||(b=setTimeout(()=>{b=null,g(W)},O-h)))},()=>W&&g(W)]}const N5=(e,o,s=3)=>{let O=0;const W=aNt(50,250);return rNt(b=>{const g=b.loaded,a=b.lengthComputable?b.total:void 0,y=g-O,h=W(y),n=g<=a;O=g;const x={loaded:g,total:a,progress:a?g/a:void 0,bytes:y,rate:h||void 0,estimated:h&&a&&n?(a-g)/h:void 0,event:b,lengthComputable:a!=null,[o?"download":"upload"]:!0};e(x)},s)},qU=(e,o)=>{const s=e!=null;return[O=>o[0]({lengthComputable:s,total:e,loaded:O}),o[1]]},YU=e=>(...o)=>jr.asap(()=>e(...o)),iNt=xh.hasStandardBrowserEnv?((e,o)=>s=>(s=new URL(s,xh.origin),e.protocol===s.protocol&&e.host===s.host&&(o||e.port===s.port)))(new URL(xh.origin),xh.navigator&&/(msie|trident)/i.test(xh.navigator.userAgent)):()=>!0,oNt=xh.hasStandardBrowserEnv?{write(e,o,s,O,W,b){const g=[e+"="+encodeURIComponent(o)];jr.isNumber(s)&&g.push("expires="+new Date(s).toGMTString()),jr.isString(O)&&g.push("path="+O),jr.isString(W)&&g.push("domain="+W),b===!0&&g.push("secure"),document.cookie=g.join("; ")},read(e){const o=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return o?decodeURIComponent(o[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function sNt(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function lNt(e,o){return o?e.replace(/\/?\/$/,"")+"/"+o.replace(/^\/+/,""):e}function ZU(e,o){return e&&!sNt(o)?lNt(e,o):o}const XU=e=>e instanceof Ff?{...e}:e;function f1(e,o){o=o||{};const s={};function O(h,n,x,_){return jr.isPlainObject(h)&&jr.isPlainObject(n)?jr.merge.call({caseless:_},h,n):jr.isPlainObject(n)?jr.merge({},n):jr.isArray(n)?n.slice():n}function W(h,n,x,_){if(jr.isUndefined(n)){if(!jr.isUndefined(h))return O(void 0,h,x,_)}else return O(h,n,x,_)}function b(h,n){if(!jr.isUndefined(n))return O(void 0,n)}function g(h,n){if(jr.isUndefined(n)){if(!jr.isUndefined(h))return O(void 0,h)}else return O(void 0,n)}function a(h,n,x){if(x in o)return O(h,n);if(x in e)return O(void 0,h)}const y={url:b,method:b,data:b,baseURL:g,transformRequest:g,transformResponse:g,paramsSerializer:g,timeout:g,timeoutMessage:g,withCredentials:g,withXSRFToken:g,adapter:g,responseType:g,xsrfCookieName:g,xsrfHeaderName:g,onUploadProgress:g,onDownloadProgress:g,decompress:g,maxContentLength:g,maxBodyLength:g,beforeRedirect:g,transport:g,httpAgent:g,httpsAgent:g,cancelToken:g,socketPath:g,responseEncoding:g,validateStatus:a,headers:(h,n,x)=>W(XU(h),XU(n),x,!0)};return jr.forEach(Object.keys(Object.assign({},e,o)),function(h){const n=y[h]||W,x=n(e[h],o[h],h);jr.isUndefined(x)&&n!==a||(s[h]=x)}),s}const JU=e=>{const o=f1({},e);let{data:s,withXSRFToken:O,xsrfHeaderName:W,xsrfCookieName:b,headers:g,auth:a}=o;o.headers=g=Ff.from(g),o.url=VU(ZU(o.baseURL,o.url),e.params,e.paramsSerializer),a&&g.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let y;if(jr.isFormData(s)){if(xh.hasStandardBrowserEnv||xh.hasStandardBrowserWebWorkerEnv)g.setContentType(void 0);else if((y=g.getContentType())!==!1){const[h,...n]=y?y.split(";").map(x=>x.trim()).filter(Boolean):[];g.setContentType([h||"multipart/form-data",...n].join("; "))}}if(xh.hasStandardBrowserEnv&&(O&&jr.isFunction(O)&&(O=O(o)),O||O!==!1&&iNt(o.url))){const h=W&&b&&oNt.read(b);h&&g.set(W,h)}return o},cNt=typeof XMLHttpRequest<"u",uNt=cNt&&function(e){return new Promise(function(o,s){const O=JU(e);let W=O.data;const b=Ff.from(O.headers).normalize();let{responseType:g,onUploadProgress:a,onDownloadProgress:y}=O,h,n,x,_,v;function u(){_&&_(),v&&v(),O.cancelToken&&O.cancelToken.unsubscribe(h),O.signal&&O.signal.removeEventListener("abort",h)}let r=new XMLHttpRequest;r.open(O.method.toUpperCase(),O.url,!0),r.timeout=O.timeout;function i(){if(!r)return;const l=Ff.from("getAllResponseHeaders"in r&&r.getAllResponseHeaders()),f={data:!g||g==="text"||g==="json"?r.responseText:r.response,status:r.status,statusText:r.statusText,headers:l,config:e,request:r};WU(function(m){o(m),u()},function(m){s(m),u()},f),r=null}"onloadend"in r?r.onloadend=i:r.onreadystatechange=function(){!r||r.readyState!==4||r.status===0&&!(r.responseURL&&r.responseURL.indexOf("file:")===0)||setTimeout(i)},r.onabort=function(){r&&(s(new kl("Request aborted",kl.ECONNABORTED,e,r)),r=null)},r.onerror=function(){s(new kl("Network Error",kl.ERR_NETWORK,e,r)),r=null},r.ontimeout=function(){let l=O.timeout?"timeout of "+O.timeout+"ms exceeded":"timeout exceeded";const f=O.transitional||$U;O.timeoutErrorMessage&&(l=O.timeoutErrorMessage),s(new kl(l,f.clarifyTimeoutError?kl.ETIMEDOUT:kl.ECONNABORTED,e,r)),r=null},W===void 0&&b.setContentType(null),"setRequestHeader"in r&&jr.forEach(b.toJSON(),function(l,f){r.setRequestHeader(f,l)}),jr.isUndefined(O.withCredentials)||(r.withCredentials=!!O.withCredentials),g&&g!=="json"&&(r.responseType=O.responseType),y&&([x,v]=N5(y,!0),r.addEventListener("progress",x)),a&&r.upload&&([n,_]=N5(a),r.upload.addEventListener("progress",n),r.upload.addEventListener("loadend",_)),(O.cancelToken||O.signal)&&(h=l=>{r&&(s(!l||l.type?new mv(null,e,r):l),r.abort(),r=null)},O.cancelToken&&O.cancelToken.subscribe(h),O.signal&&(O.signal.aborted?h():O.signal.addEventListener("abort",h)));const d=nNt(O.url);if(d&&xh.protocols.indexOf(d)===-1){s(new kl("Unsupported protocol "+d+":",kl.ERR_BAD_REQUEST,e));return}r.send(W||null)})},dNt=(e,o)=>{const{length:s}=e=e?e.filter(Boolean):[];if(o||s){let O=new AbortController,W;const b=function(h){if(!W){W=!0,a();const n=h instanceof Error?h:this.reason;O.abort(n instanceof kl?n:new mv(n instanceof Error?n.message:n))}};let g=o&&setTimeout(()=>{g=null,b(new kl(`timeout ${o} of ms exceeded`,kl.ETIMEDOUT))},o);const a=()=>{e&&(g&&clearTimeout(g),g=null,e.forEach(h=>{h.unsubscribe?h.unsubscribe(b):h.removeEventListener("abort",b)}),e=null)};e.forEach(h=>h.addEventListener("abort",b));const{signal:y}=O;return y.unsubscribe=()=>jr.asap(a),y}},hNt=dNt,pNt=function*(e,o){let s=e.byteLength;if(!o||s<o){yield e;return}let O=0,W;for(;O<s;)W=O+o,yield e.slice(O,W),O=W},fNt=async function*(e,o){for await(const s of mNt(e))yield*pNt(s,o)},mNt=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const o=e.getReader();try{for(;;){const{done:s,value:O}=await o.read();if(s)break;yield O}}finally{await o.cancel()}},KU=(e,o,s,O)=>{const W=fNt(e,o);let b=0,g,a=y=>{g||(g=!0,O&&O(y))};return new ReadableStream({async pull(y){try{const{done:h,value:n}=await W.next();if(h){a(),y.close();return}let x=n.byteLength;if(s){let _=b+=x;s(_)}y.enqueue(new Uint8Array(n))}catch(h){throw a(h),h}},cancel(y){return a(y),W.return()}},{highWaterMark:2})},D5=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",QU=D5&&typeof ReadableStream=="function",gNt=D5&&(typeof TextEncoder=="function"?(e=>o=>e.encode(o))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),eG=(e,...o)=>{try{return!!e(...o)}catch{return!1}},yNt=QU&&eG(()=>{let e=!1;const o=new Request(xh.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!o}),tG=64*1024,kT=QU&&eG(()=>jr.isReadableStream(new Response("").body)),R5={stream:kT&&(e=>e.body)};D5&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(o=>{!R5[o]&&(R5[o]=jr.isFunction(e[o])?s=>s[o]():(s,O)=>{throw new kl(`Response type '${o}' is not supported`,kl.ERR_NOT_SUPPORT,O)})})})(new Response);const vNt=async e=>{if(e==null)return 0;if(jr.isBlob(e))return e.size;if(jr.isSpecCompliantForm(e))return(await new Request(xh.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(jr.isArrayBufferView(e)||jr.isArrayBuffer(e))return e.byteLength;if(jr.isURLSearchParams(e)&&(e=e+""),jr.isString(e))return(await gNt(e)).byteLength},_Nt=async(e,o)=>jr.toFiniteNumber(e.getContentLength())??vNt(o),bNt=D5&&(async e=>{let{url:o,method:s,data:O,signal:W,cancelToken:b,timeout:g,onDownloadProgress:a,onUploadProgress:y,responseType:h,headers:n,withCredentials:x="same-origin",fetchOptions:_}=JU(e);h=h?(h+"").toLowerCase():"text";let v=hNt([W,b&&b.toAbortSignal()],g),u;const r=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let i;try{if(y&&yNt&&s!=="get"&&s!=="head"&&(i=await _Nt(n,O))!==0){let w=new Request(o,{method:"POST",body:O,duplex:"half"}),T;if(jr.isFormData(O)&&(T=w.headers.get("content-type"))&&n.setContentType(T),w.body){const[A,C]=qU(i,N5(YU(y)));O=KU(w.body,tG,A,C)}}jr.isString(x)||(x=x?"include":"omit");const d="credentials"in Request.prototype;u=new Request(o,{..._,signal:v,method:s.toUpperCase(),headers:n.normalize().toJSON(),body:O,duplex:"half",credentials:d?x:void 0});let l=await fetch(u);const f=kT&&(h==="stream"||h==="response");if(kT&&(a||f&&r)){const w={};["status","statusText","headers"].forEach(P=>{w[P]=l[P]});const T=jr.toFiniteNumber(l.headers.get("content-length")),[A,C]=a&&qU(T,N5(YU(a),!0))||[];l=new Response(KU(l.body,tG,A,()=>{C&&C(),r&&r()}),w)}h=h||"text";let m=await R5[jr.findKey(R5,h)||"text"](l,e);return!f&&r&&r(),await new Promise((w,T)=>{WU(w,T,{data:m,headers:Ff.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:u})})}catch(d){throw r&&r(),d&&d.name==="TypeError"&&/fetch/i.test(d.message)?Object.assign(new kl("Network Error",kl.ERR_NETWORK,e,u),{cause:d.cause||d}):kl.from(d,d&&d.code,e,u)}}),ST={http:LFt,xhr:uNt,fetch:bNt};jr.forEach(ST,(e,o)=>{if(e){try{Object.defineProperty(e,"name",{value:o})}catch{}Object.defineProperty(e,"adapterName",{value:o})}});const nG=e=>`- ${e}`,xNt=e=>jr.isFunction(e)||e===null||e===!1,aG={getAdapter:e=>{e=jr.isArray(e)?e:[e];const{length:o}=e;let s,O;const W={};for(let b=0;b<o;b++){s=e[b];let g;if(O=s,!xNt(s)&&(O=ST[(g=String(s)).toLowerCase()],O===void 0))throw new kl(`Unknown adapter '${g}'`);if(O)break;W[g||"#"+b]=O}if(!O){const b=Object.entries(W).map(([a,y])=>`adapter ${a} `+(y===!1?"is not supported by the environment":"is not available in the build"));let g=o?b.length>1?`since :
|
|
8177
8177
|
`+b.map(nG).join(`
|