@openremote/or-map 1.34.0 → 1.35.0-snapshot.20261109113241
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.
|
@@ -814,7 +814,7 @@ uniform ${r} ${n} u_${o};
|
|
|
814
814
|
`),F=y.concat(ie.prelude.vertexSource,s.vertexSource,i.vertexSource).join(`
|
|
815
815
|
`),x=d.createShader(d.FRAGMENT_SHADER);if(d.isContextLost()){this.failedToCreate=!0;return}d.shaderSource(x,v),d.compileShader(x),d.attachShader(this.program,x);let w=d.createShader(d.VERTEX_SHADER);if(d.isContextLost()){this.failedToCreate=!0;return}d.shaderSource(w,F),d.compileShader(w),d.attachShader(this.program,w),this.attributes={};let k={};if(this.numAttributes=m.length,d.linkProgram(this.program),!d.getProgramParameter(this.program,d.LINK_STATUS)){if(d.isContextLost()){this.failedToCreate=!0;return}throw d.getShaderParameter(x,d.COMPILE_STATUS)?d.getShaderParameter(w,d.COMPILE_STATUS)?Error(`Program failed to link: ${d.getProgramInfoLog(this.program)}`):Error(`Could not compile vertex shader: ${d.getShaderInfoLog(w)}`):Error(`Could not compile fragment shader: ${d.getShaderInfoLog(x)}`)}!function(t,i){for(let[r,n]of Object.entries(i8)){let o=t.getUniformBlockIndex(i,r);o!==t.INVALID_INDEX&&t.uniformBlockBinding(i,o,n)}}(d,this.program);let M=function(t,i){let r=new Set([t.INT,t.INT_VEC2,t.INT_VEC3,t.INT_VEC4,t.UNSIGNED_INT,t.UNSIGNED_INT_VEC2,t.UNSIGNED_INT_VEC3,t.UNSIGNED_INT_VEC4]),n=new Set,o=t.getProgramParameter(i,t.ACTIVE_ATTRIBUTES);for(let a=0;a<o;a++){let o=t.getActiveAttrib(i,a);o&&r.has(o.type)&&n.add(o.name)}return n}(d,this.program);for(let t of m){if(!t)continue;let i=d.getAttribLocation(this.program,t);i>=0&&(this.attributes[t]={location:i,isInteger:M.has(t)})}for(let t of(d.deleteShader(w),d.deleteShader(x),b))if(t&&!k[t]){let i=d.getUniformLocation(this.program,t);i&&(k[t]=i)}this.fixedUniforms=n(t,k),this.terrainUniforms=((t,i)=>({u_depth:new E.At(t,i.u_depth),u_terrain:new E.At(t,i.u_terrain)}))(t,k),this.binderUniforms=r?r.getUniforms(t,k):[]}draw(t,i,r,n,o,a,s,l,c,d,u,h,m,f,p,_,g,b,y){var v,F;let x,w=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(o),t.setCullFace(a),l){let i;for(let i in t.activeTexture.set(w.TEXTURE2),w.bindTexture(w.TEXTURE_2D,l.depthTexture),t.activeTexture.set(w.TEXTURE3),w.bindTexture(w.TEXTURE_2D,l.texture),this.terrainUniforms)this.terrainUniforms[i].set(l[i]);v=t.terrainUniformBuffer,(i=v.pending).set(l.u_terrain_matrix,rn.u_terrain_matrix),i.set(l.u_terrain_unpack,rn.u_terrain_unpack),i[rn.u_terrain_dim]=l.u_terrain_dim,i[rn.u_terrain_exaggeration]=l.u_terrain_exaggeration,v.upload()}if(c&&(F=t.projectionUniformBuffer,(x=F.pending).set(c.mainMatrix,ri.u_projection_matrix),x.set(c.fallbackMatrix,ri.u_projection_fallback_matrix),x.set(c.tileMercatorCoords,ri.u_projection_tile_mercator_coords),x.set(c.clippingPlane,ri.u_projection_clipping_plane),x[ri.u_projection_transition]=c.projectionTransition,F.pendingWords[ri.u_projection_clip_antimeridian]=+!!c.clipAntimeridian,F.upload()),s)for(let t in this.fixedUniforms)this.fixedUniforms[t].set(s[t]);_&&_.setUniforms(t,this.binderUniforms,f,{zoom:p});let E=0;switch(i){case w.LINES:E=2;break;case w.TRIANGLES:E=3;break;case w.LINE_STRIP:E=1}for(let r of m.get())r.vaos||={},r.vaos[d]||=new i5,r.vaos[d].bind(t,this,u,_?_.getPaintVertexBuffers():[],h,r.vertexOffset,g,b,y),w.drawElements(i,r.primitiveLength*E,w.UNSIGNED_SHORT,r.primitiveOffset*E*2)}};function rs(t,i,r){let n=1/(0,E.Lr)(r,1,i.transform.tileZoom),o=2**r.tileID.overscaledZ,a=r.tileSize*2**i.transform.tileZoom/o,s=a*(r.tileID.canonical.x+r.tileID.wrap*o),l=a*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[n,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[s>>16,l>>16],u_pixel_coord_lower:[65535&s,65535&l]}}let rl=(t,i,r,n)=>{let o=t.style.light,a=o.getCartesianPosition(),s=(0,E.Ni)();"viewport"===o.properties.get("anchor")&&(0,E.Pi)(s,t.transform.bearingInRadians),(0,E.pi)(a,a,s);let l=t.transform.transformLightDirection(a),c=o.properties.get("color");return{u_lightpos:a,u_lightpos_globe:l,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+i,u_opacity:r,u_fill_translate:n}},rc=(t,i,r,n,o,a,s)=>(0,E.tr)(rl(t,i,r,n),rs(a,t,s),{u_height_factor:-(2**o.overscaledZ)/s.tileSize/8}),rd=(t,i,r,n,o)=>(0,E.tr)(rs(i,t,r),{u_fill_translate:n,u_sdf_pattern:+!!o}),ru=t=>({u_fill_translate:t}),rh=t=>({u_fill_translate:t}),rm=(t,i,r,n,o)=>rd(t,i,r,n,o),rf=(t,i,r,n,o)=>{let a=t.transform,s,l,c=0;if("map"===r.paint.get("circle-pitch-alignment")){let t=(0,E.Lr)(i,1,a.zoom);s=!0,l=[t,t],c=t/(8192*2**i.tileID.overscaledZ)*2*Math.PI*o}else s=!1,l=a.pixelsToGLUnits;return{u_scale_with_map:+("map"===r.paint.get("circle-pitch-scale")),u_pitch_with_map:+s,u_extrude_scale:l,u_globe_extrude_scale:c,u_translate:n}},rp=(t,i=1)=>({u_color:t,u_overlay:0,u_overlay_scale:i}),r_=(t,i,r,n)=>{let o=(0,E.Lr)(t,1,i)/(8192*2**t.tileID.overscaledZ)*2*Math.PI*n;return{u_extrude_scale:(0,E.Lr)(t,1,i),u_intensity:r,u_globe_extrude_scale:o}},rg=(t,i,r,n)=>{let o=(0,E.yi)();return(0,E.Ei)(o,0,t.width,t.height,0,0,1),{u_matrix:o,u_image:r,u_color_ramp:n,u_opacity:i.paint.get("heatmap-opacity")}},rb=(t,i,r)=>{var n;let o,a,s=r.paint.get("hillshade-accent-color"),l;switch(r.paint.get("hillshade-method")){case"basic":l=4;break;case"combined":l=1;break;case"igor":l=2;break;case"multidirectional":l=3;break;default:l=0}let c=r.getIlluminationProperties();for(let i=0;i<c.directionRadians.length;i++)"viewport"===r.paint.get("hillshade-illumination-anchor")&&(c.directionRadians[i]+=t.transform.bearingInRadians);return{u_image:0,u_latrange:(n=i.tileID,o=2**n.canonical.z,a=n.canonical.y,[new E.et(0,a/o).toLngLat().lat,new E.et(0,(a+1)/o).toLngLat().lat]),u_exaggeration:r.paint.get("hillshade-exaggeration"),u_altitudes:c.altitudeRadians,u_azimuths:c.directionRadians,u_accent:s,u_method:l,u_highlights:c.highlightColor,u_shadows:c.shadowColor}},ry=(t,i)=>{let r=i.stride,n=(0,E.yi)();return(0,E.Ei)(n,0,8192,-8192,0,0,1),(0,E.Mi)(n,n,[0,-8192,0]),{u_matrix:n,u_image:1,u_dimension:[r,r],u_zoom:t.overscaledZ,u_unpack:i.getUnpackVector()}},rv=(t,i,r=0)=>({u_image:0,u_unpack:i.getUnpackVector(),u_dimension:[i.stride,i.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:r,u_opacity:t.paint.get("color-relief-opacity")}),rF=(t,i,r,n)=>{let o=t.transform;return{u_translation:rD(t,i,r),u_ratio:n/(0,E.Lr)(i,1,o.zoom)}},rx=(t,i,r,n,o)=>(0,E.tr)(rF(t,i,r,n),{u_image:0,u_image_height:o}),rw=(t,i,r,n,o)=>{let a=t.transform,s=rM(i,a);return{u_translation:rD(t,i,r),u_texsize:i.imageAtlasTexture.size,u_ratio:n/(0,E.Lr)(i,1,a.zoom),u_image:0,u_scale:[s,o.fromScale,o.toScale],u_fade:o.t}},rE=(t,i,r,n,o)=>{let a=rM(i,t.transform);return(0,E.tr)(rF(t,i,r,n),{u_tileratio:a,u_crossfade_from:o.fromScale,u_crossfade_to:o.toScale,u_image:0,u_mix:o.t,u_lineatlas_width:t.lineAtlas.width,u_lineatlas_height:t.lineAtlas.height})},rk=(t,i,r,n,o,a)=>{let s=rM(i,t.transform);return(0,E.tr)(rF(t,i,r,n),{u_image:0,u_image_height:a,u_tileratio:s,u_crossfade_from:o.fromScale,u_crossfade_to:o.toScale,u_image_dash:1,u_mix:o.t,u_lineatlas_width:t.lineAtlas.width,u_lineatlas_height:t.lineAtlas.height})};function rM(t,i){return 1/(0,E.Lr)(t,1,i.tileZoom)}function rD(t,i,r){return(0,E.Mr)(t.transform,i,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}let rT=(t,i,r,n,o,a,s,l,c,d,u,h,m,f,p)=>({u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:i?i.uSizeT:0,u_size:i?i.uSize:0,u_rotate_symbol:+r,u_label_plane_matrix:l,u_coord_matrix:c,u_is_text:+u,u_pitch_with_map:+n,u_is_along_line:o,u_is_variable_anchor:a,u_texsize:h,u_texture:0,u_translation:d,u_pitched_scale:m,u_is_offset:f,u_height_anchor_ground:+p}),rA=(t,i,r,n,o,a,s,l,c,d,u,h,m,f,p,_)=>{let g=s.transform;return(0,E.tr)(rT(t,i,r,n,o,a,s,l,c,d,u,h,f,p,_),{u_gamma_scale:n?Math.cos(g.pitch*Math.PI/180)*g.cameraToCenterDistance:1,u_is_halo:+!!m,u_is_plain:1})},rC=(t,i,r,n,o,a,s,l,c,d,u,h,m,f,p)=>(0,E.tr)(rA(t,i,r,n,o,a,s,l,c,d,!0,u,!0,m,f,p),{u_texsize_icon:h,u_texture_icon:1}),rS=(t,i)=>({u_opacity:t,u_color:i}),rL=(t,i,r,n,o)=>(0,E.tr)(function(t,i,r,n){let o=r.patternAtlas.getPattern(t.from.toString()),a=r.patternAtlas.getPattern(t.to.toString()),{width:s,height:l}=r.patternAtlas.getPixelSize(),c=2**n.tileID.overscaledZ,d=n.tileSize*2**r.transform.tileZoom/c,u=d*(n.tileID.canonical.x+n.tileID.wrap*c),h=d*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:o.tl,u_pattern_br_a:o.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:i.t,u_pattern_size_a:o.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:i.fromScale,u_scale_b:i.toScale,u_tile_units_to_pixels:1/(0,E.Lr)(n,1,r.transform.tileZoom),u_pixel_coord_upper:[u>>16,h>>16],u_pixel_coord_lower:[65535&u,65535&h]}}(r,o,i,n),{u_opacity:t}),rP=(t,i)=>({}),rI={fillExtrusion:(t,i)=>({u_lightpos:new E.Mt(t,i.u_lightpos),u_lightpos_globe:new E.Mt(t,i.u_lightpos_globe),u_lightintensity:new E.kt(t,i.u_lightintensity),u_lightcolor:new E.Mt(t,i.u_lightcolor),u_vertical_gradient:new E.kt(t,i.u_vertical_gradient),u_opacity:new E.kt(t,i.u_opacity),u_fill_translate:new E.jt(t,i.u_fill_translate)}),fillExtrusionPattern:(t,i)=>({u_lightpos:new E.Mt(t,i.u_lightpos),u_lightpos_globe:new E.Mt(t,i.u_lightpos_globe),u_lightintensity:new E.kt(t,i.u_lightintensity),u_lightcolor:new E.Mt(t,i.u_lightcolor),u_vertical_gradient:new E.kt(t,i.u_vertical_gradient),u_height_factor:new E.kt(t,i.u_height_factor),u_opacity:new E.kt(t,i.u_opacity),u_fill_translate:new E.jt(t,i.u_fill_translate),u_image:new E.At(t,i.u_image),u_texsize:new E.jt(t,i.u_texsize),u_pixel_coord_upper:new E.jt(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new E.jt(t,i.u_pixel_coord_lower),u_scale:new E.Mt(t,i.u_scale),u_fade:new E.kt(t,i.u_fade)}),fill:(t,i)=>({u_fill_translate:new E.jt(t,i.u_fill_translate)}),fillPattern:(t,i)=>({u_image:new E.At(t,i.u_image),u_texsize:new E.jt(t,i.u_texsize),u_pixel_coord_upper:new E.jt(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new E.jt(t,i.u_pixel_coord_lower),u_scale:new E.Mt(t,i.u_scale),u_fade:new E.kt(t,i.u_fade),u_sdf_pattern:new E.At(t,i.u_sdf_pattern),u_fill_translate:new E.jt(t,i.u_fill_translate)}),fillOutline:(t,i)=>({u_fill_translate:new E.jt(t,i.u_fill_translate)}),fillOutlinePattern:(t,i)=>({u_image:new E.At(t,i.u_image),u_texsize:new E.jt(t,i.u_texsize),u_pixel_coord_upper:new E.jt(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new E.jt(t,i.u_pixel_coord_lower),u_scale:new E.Mt(t,i.u_scale),u_fade:new E.kt(t,i.u_fade),u_sdf_pattern:new E.At(t,i.u_sdf_pattern),u_fill_translate:new E.jt(t,i.u_fill_translate)}),circle:(t,i)=>({u_scale_with_map:new E.At(t,i.u_scale_with_map),u_pitch_with_map:new E.At(t,i.u_pitch_with_map),u_extrude_scale:new E.jt(t,i.u_extrude_scale),u_globe_extrude_scale:new E.kt(t,i.u_globe_extrude_scale),u_translate:new E.jt(t,i.u_translate)}),collisionBox:rP,collisionCircle:rP,debug:(t,i)=>({u_color:new E.Pt(t,i.u_color),u_overlay:new E.At(t,i.u_overlay),u_overlay_scale:new E.kt(t,i.u_overlay_scale)}),depth:rP,clippingMask:rP,heatmap:(t,i)=>({u_extrude_scale:new E.kt(t,i.u_extrude_scale),u_intensity:new E.kt(t,i.u_intensity),u_globe_extrude_scale:new E.kt(t,i.u_globe_extrude_scale)}),heatmapTexture:(t,i)=>({u_matrix:new E.Lt(t,i.u_matrix),u_image:new E.At(t,i.u_image),u_color_ramp:new E.At(t,i.u_color_ramp),u_opacity:new E.kt(t,i.u_opacity)}),hillshade:(t,i)=>({u_image:new E.At(t,i.u_image),u_latrange:new E.jt(t,i.u_latrange),u_exaggeration:new E.kt(t,i.u_exaggeration),u_altitudes:new E.It(t,i.u_altitudes),u_azimuths:new E.It(t,i.u_azimuths),u_accent:new E.Pt(t,i.u_accent),u_method:new E.At(t,i.u_method),u_shadows:new E.Ft(t,i.u_shadows),u_highlights:new E.Ft(t,i.u_highlights)}),hillshadePrepare:(t,i)=>({u_matrix:new E.Lt(t,i.u_matrix),u_image:new E.At(t,i.u_image),u_dimension:new E.jt(t,i.u_dimension),u_zoom:new E.kt(t,i.u_zoom),u_unpack:new E.Nt(t,i.u_unpack)}),colorRelief:(t,i)=>({u_image:new E.At(t,i.u_image),u_unpack:new E.Nt(t,i.u_unpack),u_dimension:new E.jt(t,i.u_dimension),u_elevation_stops:new E.At(t,i.u_elevation_stops),u_color_stops:new E.At(t,i.u_color_stops),u_color_ramp_size:new E.At(t,i.u_color_ramp_size),u_opacity:new E.kt(t,i.u_opacity)}),line:(t,i)=>({u_translation:new E.jt(t,i.u_translation),u_ratio:new E.kt(t,i.u_ratio)}),lineGradient:(t,i)=>({u_translation:new E.jt(t,i.u_translation),u_ratio:new E.kt(t,i.u_ratio),u_image:new E.At(t,i.u_image),u_image_height:new E.kt(t,i.u_image_height)}),linePattern:(t,i)=>({u_translation:new E.jt(t,i.u_translation),u_texsize:new E.jt(t,i.u_texsize),u_ratio:new E.kt(t,i.u_ratio),u_image:new E.At(t,i.u_image),u_scale:new E.Mt(t,i.u_scale),u_fade:new E.kt(t,i.u_fade)}),lineSDF:(t,i)=>({u_translation:new E.jt(t,i.u_translation),u_ratio:new E.kt(t,i.u_ratio),u_image:new E.At(t,i.u_image),u_mix:new E.kt(t,i.u_mix),u_tileratio:new E.kt(t,i.u_tileratio),u_crossfade_from:new E.kt(t,i.u_crossfade_from),u_crossfade_to:new E.kt(t,i.u_crossfade_to),u_lineatlas_width:new E.kt(t,i.u_lineatlas_width),u_lineatlas_height:new E.kt(t,i.u_lineatlas_height)}),lineGradientSDF:(t,i)=>({u_translation:new E.jt(t,i.u_translation),u_ratio:new E.kt(t,i.u_ratio),u_image:new E.At(t,i.u_image),u_image_height:new E.kt(t,i.u_image_height),u_tileratio:new E.kt(t,i.u_tileratio),u_crossfade_from:new E.kt(t,i.u_crossfade_from),u_crossfade_to:new E.kt(t,i.u_crossfade_to),u_image_dash:new E.At(t,i.u_image_dash),u_mix:new E.kt(t,i.u_mix),u_lineatlas_width:new E.kt(t,i.u_lineatlas_width),u_lineatlas_height:new E.kt(t,i.u_lineatlas_height)}),layerOpacity:(t,i)=>({u_image:new E.At(t,i.u_image),u_opacity:new E.kt(t,i.u_opacity)}),raster:(t,i)=>({u_tl_parent:new E.jt(t,i.u_tl_parent),u_scale_parent:new E.kt(t,i.u_scale_parent),u_buffer_scale:new E.kt(t,i.u_buffer_scale),u_image_warp:new E.Mt(t,i.u_image_warp),u_fade_t:new E.kt(t,i.u_fade_t),u_opacity:new E.kt(t,i.u_opacity),u_image0:new E.At(t,i.u_image0),u_image1:new E.At(t,i.u_image1),u_brightness_low:new E.kt(t,i.u_brightness_low),u_brightness_high:new E.kt(t,i.u_brightness_high),u_saturation_factor:new E.kt(t,i.u_saturation_factor),u_contrast_factor:new E.kt(t,i.u_contrast_factor),u_spin_weights:new E.Mt(t,i.u_spin_weights),u_coords_top:new E.Nt(t,i.u_coords_top),u_coords_bottom:new E.Nt(t,i.u_coords_bottom)}),symbolIcon:(t,i)=>({u_is_size_zoom_constant:new E.At(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new E.At(t,i.u_is_size_feature_constant),u_size_t:new E.kt(t,i.u_size_t),u_size:new E.kt(t,i.u_size),u_rotate_symbol:new E.At(t,i.u_rotate_symbol),u_label_plane_matrix:new E.Lt(t,i.u_label_plane_matrix),u_coord_matrix:new E.Lt(t,i.u_coord_matrix),u_is_text:new E.At(t,i.u_is_text),u_pitch_with_map:new E.At(t,i.u_pitch_with_map),u_is_along_line:new E.At(t,i.u_is_along_line),u_is_variable_anchor:new E.At(t,i.u_is_variable_anchor),u_texsize:new E.jt(t,i.u_texsize),u_texture:new E.At(t,i.u_texture),u_translation:new E.jt(t,i.u_translation),u_pitched_scale:new E.kt(t,i.u_pitched_scale),u_is_offset:new E.At(t,i.u_is_offset),u_height_anchor_ground:new E.At(t,i.u_height_anchor_ground)}),symbolSDF:(t,i)=>({u_is_size_zoom_constant:new E.At(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new E.At(t,i.u_is_size_feature_constant),u_size_t:new E.kt(t,i.u_size_t),u_size:new E.kt(t,i.u_size),u_rotate_symbol:new E.At(t,i.u_rotate_symbol),u_label_plane_matrix:new E.Lt(t,i.u_label_plane_matrix),u_coord_matrix:new E.Lt(t,i.u_coord_matrix),u_is_text:new E.At(t,i.u_is_text),u_pitch_with_map:new E.At(t,i.u_pitch_with_map),u_is_along_line:new E.At(t,i.u_is_along_line),u_is_variable_anchor:new E.At(t,i.u_is_variable_anchor),u_texsize:new E.jt(t,i.u_texsize),u_texture:new E.At(t,i.u_texture),u_gamma_scale:new E.kt(t,i.u_gamma_scale),u_is_halo:new E.At(t,i.u_is_halo),u_is_plain:new E.At(t,i.u_is_plain),u_translation:new E.jt(t,i.u_translation),u_pitched_scale:new E.kt(t,i.u_pitched_scale),u_is_offset:new E.At(t,i.u_is_offset),u_height_anchor_ground:new E.At(t,i.u_height_anchor_ground)}),symbolTextAndIcon:(t,i)=>({u_is_size_zoom_constant:new E.At(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new E.At(t,i.u_is_size_feature_constant),u_size_t:new E.kt(t,i.u_size_t),u_size:new E.kt(t,i.u_size),u_rotate_symbol:new E.At(t,i.u_rotate_symbol),u_label_plane_matrix:new E.Lt(t,i.u_label_plane_matrix),u_coord_matrix:new E.Lt(t,i.u_coord_matrix),u_is_text:new E.At(t,i.u_is_text),u_pitch_with_map:new E.At(t,i.u_pitch_with_map),u_is_along_line:new E.At(t,i.u_is_along_line),u_is_variable_anchor:new E.At(t,i.u_is_variable_anchor),u_texsize:new E.jt(t,i.u_texsize),u_texsize_icon:new E.jt(t,i.u_texsize_icon),u_texture:new E.At(t,i.u_texture),u_texture_icon:new E.At(t,i.u_texture_icon),u_gamma_scale:new E.kt(t,i.u_gamma_scale),u_is_halo:new E.At(t,i.u_is_halo),u_translation:new E.jt(t,i.u_translation),u_pitched_scale:new E.kt(t,i.u_pitched_scale),u_is_offset:new E.At(t,i.u_is_offset),u_height_anchor_ground:new E.At(t,i.u_height_anchor_ground)}),background:(t,i)=>({u_opacity:new E.kt(t,i.u_opacity),u_color:new E.Pt(t,i.u_color)}),backgroundPattern:(t,i)=>({u_opacity:new E.kt(t,i.u_opacity),u_image:new E.At(t,i.u_image),u_pattern_tl_a:new E.jt(t,i.u_pattern_tl_a),u_pattern_br_a:new E.jt(t,i.u_pattern_br_a),u_pattern_tl_b:new E.jt(t,i.u_pattern_tl_b),u_pattern_br_b:new E.jt(t,i.u_pattern_br_b),u_texsize:new E.jt(t,i.u_texsize),u_mix:new E.kt(t,i.u_mix),u_pattern_size_a:new E.jt(t,i.u_pattern_size_a),u_pattern_size_b:new E.jt(t,i.u_pattern_size_b),u_scale_a:new E.kt(t,i.u_scale_a),u_scale_b:new E.kt(t,i.u_scale_b),u_pixel_coord_upper:new E.jt(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new E.jt(t,i.u_pixel_coord_lower),u_tile_units_to_pixels:new E.kt(t,i.u_tile_units_to_pixels)}),terrain:(t,i)=>({u_texture:new E.At(t,i.u_texture),u_ele_delta:new E.kt(t,i.u_ele_delta),u_fog_matrix:new E.Lt(t,i.u_fog_matrix),u_fog_color:new E.Pt(t,i.u_fog_color),u_fog_ground_blend:new E.kt(t,i.u_fog_ground_blend),u_fog_ground_blend_opacity:new E.kt(t,i.u_fog_ground_blend_opacity),u_horizon_color:new E.Pt(t,i.u_horizon_color),u_horizon_fog_blend:new E.kt(t,i.u_horizon_fog_blend),u_is_globe_mode:new E.kt(t,i.u_is_globe_mode)}),terrainDepth:(t,i)=>({u_ele_delta:new E.kt(t,i.u_ele_delta)}),atmosphere:(t,i)=>({u_sun_pos:new E.Mt(t,i.u_sun_pos),u_atmosphere_blend:new E.kt(t,i.u_atmosphere_blend),u_globe_position:new E.Mt(t,i.u_globe_position),u_globe_radius:new E.kt(t,i.u_globe_radius),u_inv_proj_matrix:new E.Lt(t,i.u_inv_proj_matrix)}),sky:(t,i)=>({u_sky_color:new E.Pt(t,i.u_sky_color),u_horizon_color:new E.Pt(t,i.u_horizon_color),u_horizon:new E.jt(t,i.u_horizon),u_horizon_normal:new E.jt(t,i.u_horizon_normal),u_sky_horizon_blend:new E.kt(t,i.u_sky_horizon_blend),u_sky_blend:new E.kt(t,i.u_sky_blend),u_inv_proj_matrix:new E.Lt(t,i.u_inv_proj_matrix),u_globe_position:new E.Mt(t,i.u_globe_position),u_globe_radius:new E.kt(t,i.u_globe_radius)})};var rR=class{constructor(t,i,r){this.context=t;let n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=!!r,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,i.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||i.freeBufferAfterUpload()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){let i=this.context.gl;if(!this.dynamicDraw)throw Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),i.bufferSubData(i.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){let t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)}};let rB={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};var rO=class{constructor(t,i,r,n){this.length=i.length,this.attributes=r,this.itemSize=i.bytesPerElement,this.dynamicDraw=n,this.context=t;let o=t.gl;this.buffer=o.createBuffer(),t.bindVertexBuffer.set(this.buffer),o.bufferData(o.ARRAY_BUFFER,i.arrayBuffer,this.dynamicDraw?o.DYNAMIC_DRAW:o.STATIC_DRAW),this.dynamicDraw||i.freeBufferAfterUpload()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);let i=this.context.gl;this.bind(),i.bufferSubData(i.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,i){for(let r of this.attributes){let n=i.attributes[r.name];void 0!==n&&t.enableVertexAttribArray(n.location)}}setVertexAttribPointers(t,i,r){for(let n of this.attributes){let o=i.attributes[n.name];if(void 0!==o){let i=n.offset+this.itemSize*(r||0);o.isInteger?t.vertexAttribIPointer(o.location,n.components,t[rB[n.type]],this.itemSize,i):t.vertexAttribPointer(o.location,n.components,t[rB[n.type]],!1,this.itemSize,i)}}}destroy(){let t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)}},rz=class{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}},rY=class extends rz{getDefault(){return E.pn.transparent}set(t){let i=this.current;(t.r!==i.r||t.g!==i.g||t.b!==i.b||t.a!==i.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}},rj=class extends rz{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}},rN=class extends rz{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}},rU=class extends rz{getDefault(){return[!0,!0,!0,!0]}set(t){let i=this.current;(t[0]!==i[0]||t[1]!==i[1]||t[2]!==i[2]||t[3]!==i[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}},rH=class extends rz{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}},rV=class extends rz{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}},r$=class extends rz{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){let i=this.current;(t.func!==i.func||t.ref!==i.ref||t.mask!==i.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}},rq=class extends rz{getDefault(){let t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){let i=this.current;(t[0]!==i[0]||t[1]!==i[1]||t[2]!==i[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}},rG=class extends rz{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let i=this.gl;t?i.enable(i.STENCIL_TEST):i.disable(i.STENCIL_TEST),this.current=t,this.dirty=!1}},rW=class extends rz{getDefault(){return[0,1]}set(t){let i=this.current;(t[0]!==i[0]||t[1]!==i[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}},rZ=class extends rz{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let i=this.gl;t?i.enable(i.DEPTH_TEST):i.disable(i.DEPTH_TEST),this.current=t,this.dirty=!1}},rK=class extends rz{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}},rJ=class extends rz{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let i=this.gl;t?i.enable(i.BLEND):i.disable(i.BLEND),this.current=t,this.dirty=!1}},rX=class extends rz{getDefault(){let t=this.gl;return[t.ONE,t.ZERO]}set(t){let i=this.current;(t[0]!==i[0]||t[1]!==i[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}},rQ=class extends rz{getDefault(){return E.pn.transparent}set(t){let i=this.current;(t.r!==i.r||t.g!==i.g||t.b!==i.b||t.a!==i.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}},r0=class extends rz{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}},r1=class extends rz{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let i=this.gl;t?i.enable(i.CULL_FACE):i.disable(i.CULL_FACE),this.current=t,this.dirty=!1}},r2=class extends rz{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}},r3=class extends rz{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}},r5=class extends rz{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}},r4=class extends rz{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}},r6=class extends rz{getDefault(){let t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){let i=this.current;(t[0]!==i[0]||t[1]!==i[1]||t[2]!==i[2]||t[3]!==i[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}},r8=class extends rz{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let i=this.gl;i.bindFramebuffer(i.FRAMEBUFFER,t),this.current=t,this.dirty=!1}},r7=class extends rz{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let i=this.gl;i.bindRenderbuffer(i.RENDERBUFFER,t),this.current=t,this.dirty=!1}},r9=class extends rz{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let i=this.gl;i.bindTexture(i.TEXTURE_2D,t),this.current=t,this.dirty=!1}},ne=class extends rz{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let i=this.gl;i.bindBuffer(i.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},nt=class extends rz{getDefault(){return null}set(t){let i=this.gl;i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},ni=class extends rz{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.bindVertexArray(t),this.current=t,this.dirty=!1)}},nr=class extends rz{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;let i=this.gl;i.pixelStorei(i.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}},nn=class extends rz{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let i=this.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}},no=class extends rz{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let i=this.gl;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},na=class extends rz{constructor(t,i){super(t),this.context=t,this.parent=i}getDefault(){return null}},ns=class extends na{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let i=this.gl;i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},nl=class extends na{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let i=this.gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.RENDERBUFFER,t),this.current=t,this.dirty=!1}},nc=class extends na{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let i=this.gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,t),this.current=t,this.dirty=!1}},nd=class{constructor(t,i,r,n,o){this.context=t,this.width=i,this.height=r;let a=t.gl,s=this.framebuffer=a.createFramebuffer();if(this.colorAttachment=new ns(t,s),n)this.depthAttachment=o?new nc(t,s):new nl(t,s);else if(o)throw Error("Stencil cannot be set without depth")}destroy(){let t=this.context.gl,i=this.colorAttachment.get();if(i&&t.deleteTexture(i),this.depthAttachment){let i=this.depthAttachment.get();i&&t.deleteRenderbuffer(i)}t.deleteFramebuffer(this.framebuffer)}};let nu=i9([{name:"u_units_to_pixels",type:"vec2"},{name:"u_world_size",type:"vec2"},{name:"u_camera_to_center_distance",type:"float"},{name:"u_symbol_fade_change",type:"float"},{name:"u_aspect_ratio",type:"float"},{name:"u_device_pixel_ratio",type:"float"},{name:"u_viewport_size",type:"vec2"},{name:"u_pixel_extrude_scale",type:"vec2"},{name:"u_pitch",type:"float"}]),nh=nu.offsets;var nm=class{constructor(t,i,r){this.blendFunction=t,this.blendColor=i,this.mask=r}};nm.Replace=[1,0],nm.disabled=new nm(nm.Replace,E.pn.transparent,[!1,!1,!1,!1]),nm.unblended=new nm(nm.Replace,E.pn.transparent,[!0,!0,!0,!0]),nm.alphaBlended=new nm([1,771],E.pn.transparent,[!0,!0,!0,!0]);var nf=class{constructor(t){this.gl=t,this.clearColor=new rY(this),this.clearDepth=new rj(this),this.clearStencil=new rN(this),this.colorMask=new rU(this),this.depthMask=new rH(this),this.stencilMask=new rV(this),this.stencilFunc=new r$(this),this.stencilOp=new rq(this),this.stencilTest=new rG(this),this.depthRange=new rW(this),this.depthTest=new rZ(this),this.depthFunc=new rK(this),this.blend=new rJ(this),this.blendFunc=new rX(this),this.blendColor=new rQ(this),this.blendEquation=new r0(this),this.cullFace=new r1(this),this.cullFaceSide=new r2(this),this.frontFace=new r3(this),this.program=new r5(this),this.activeTexture=new r4(this),this.viewport=new r6(this),this.bindFramebuffer=new r8(this),this.bindRenderbuffer=new r7(this),this.bindTexture=new r9(this),this.bindVertexBuffer=new ne(this),this.bindElementBuffer=new nt(this),this.bindVertexArray=new ni(this),this.pixelStoreUnpack=new nr(this),this.pixelStoreUnpackPremultiplyAlpha=new nn(this),this.pixelStoreUnpackFlipY=new no(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),t.getExtension("EXT_color_buffer_half_float"),t.getExtension("EXT_color_buffer_float"),this.projectionUniformBuffer=function(t){return new re(t,i8.ProjectionUBO,rt)}(this),this.terrainUniformBuffer=function(t){return new re(t,i8.TerrainUBO,rr)}(this),this.frameUniformBuffer=function(t){return new re(t,i8.FrameUBO,nu)}(this)}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,this.projectionUniformBuffer.bindingDirty=!0,this.terrainUniformBuffer.bindingDirty=!0,this.frameUniformBuffer.bindingDirty=!0}setCustomLayerDefaults(){this.unbindVAO(),this.cullFace.setDefault(),this.activeTexture.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}createIndexBuffer(t,i){return new rR(this,t,i)}createVertexBuffer(t,i,r){return new rO(this,t,i,r)}createRenderbuffer(t,i,r){let n=this.gl,o=n.createRenderbuffer();return this.bindRenderbuffer.set(o),n.renderbufferStorage(n.RENDERBUFFER,t,i,r),this.bindRenderbuffer.set(null),o}createFramebuffer(t,i,r,n){return new nd(this,t,i,r,n)}clear({color:t,depth:i,stencil:r}){let n=this.gl,o=0;t&&(o|=n.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),void 0!==i&&(o|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(i),this.depthMask.set(!0)),void 0!==r&&(o|=n.STENCIL_BUFFER_BIT,this.clearStencil.set(r),this.stencilMask.set(255)),n.clear(o)}setCullFace(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){(0,E.Jn)(t.blendFunction,nm.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)}createVertexArray(){return this.gl.createVertexArray()}deleteVertexArray(t){this.gl.deleteVertexArray(t)}unbindVAO(){this.bindVertexArray.set(null)}},np=class{constructor(t,i,r){this.func=t,this.mask=i,this.range=r}};np.ReadOnly=!1,np.ReadWrite=!0,np.disabled=new np(519,np.ReadOnly,[0,1]);var n_=class{constructor(t,i,r,n,o,a){this.test=t,this.ref=i,this.mask=r,this.fail=n,this.depthFail=o,this.pass=a}};n_.disabled=new n_({func:519,mask:0},0,0,7680,7680,7680);var ng=class{constructor(t,i,r){this.enable=t,this.mode=i,this.frontFace=r}};function nb(t,i,r,n,o){let a=t.context,s=t.transform,l=a.gl,c=t.useProgram("collisionBox"),d=[],u=0,h=0;for(let m of n){let n=i.getTile(m).getBucket(r);if(!n)continue;let f=o?n.textCollisionBox:n.iconCollisionBox,p=n.collisionCircleArray;p.length>0&&(d.push({circleArray:p,circleOffset:h,coord:m}),u+=p.length/4,h=u),f&&c.draw(a,l.LINES,np.disabled,n_.disabled,t.colorModeForRenderPass(),ng.disabled,null,t.style.map.terrain?.getTerrainData(m),s.getProjectionData({overscaledTileID:m,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),r.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,null,t.transform.zoom,null,null,f.collisionVertexBuffer)}if(!o||!d.length)return;let f=t.useProgram("collisionCircle"),p=new E.Bt;p.resize(4*u),p._trim();let _=0;for(let t of d)for(let i=0;i<t.circleArray.length/4;i++){let r=4*i,n=t.circleArray[r+0],o=t.circleArray[r+1],a=t.circleArray[r+2],s=t.circleArray[r+3];p.emplace(_++,n,o,a,s,0),p.emplace(_++,n,o,a,s,1),p.emplace(_++,n,o,a,s,2),p.emplace(_++,n,o,a,s,3)}(!m||m.length<2*u)&&(m=function(t){let i=2*t,r=new E.Wt;r.resize(i),r._trim();for(let t=0;t<i;t++){let i=6*t;r.uint16[i+0]=4*t+0,r.uint16[i+1]=4*t+1,r.uint16[i+2]=4*t+2,r.uint16[i+3]=4*t+2,r.uint16[i+4]=4*t+3,r.uint16[i+5]=4*t+0}return r}(u));let g=a.createIndexBuffer(m,!0),b=a.createVertexBuffer(p,E.V.members,!0);for(let i of d)f.draw(a,l.TRIANGLES,np.disabled,n_.disabled,t.colorModeForRenderPass(),ng.disabled,null,t.style.map.terrain?.getTerrainData(i.coord),null,r.id,b,g,E.Rt.simpleSegment(0,2*i.circleOffset,i.circleArray.length,i.circleArray.length/2),null,t.transform.zoom,null,null,null);b.destroy(),g.destroy()}ng.disabled=new ng(!1,1029,2305),ng.backCCW=new ng(!0,1029,2305),ng.frontCCW=new ng(!0,1028,2305);let ny=(0,E.Ci)(new Float32Array(16));function nv(t,i,r,n,o,a,s,l,c,d,u,h,m){let f=t.context,p=f.gl,_=t.transform,g="map"===l,b="map"===c,y="viewport"!==l&&"point"!==r.layout.get("symbol-placement"),v=g&&!b&&!y,F=!r.layout.get("symbol-sort-key").isConstant(),x=!1,w=t.getDepthModeForSublayer(0,np.ReadOnly),k=r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"),M=[],D=_.getCircleRadiusCorrection();for(let l of n){let n=i.getTile(l),c=n.getBucket(r);if(!c)continue;let u=o?c.text:c.icon;if(!u?.segments.get().length||!u.hasVisibleVertices)continue;let h=u.programConfigurations.get(r.id),f=o||c.sdfIcons,w=o?c.textSizeData:c.iconSizeData,T=b||0!==_.pitch,A=t.useProgram(c.iconsInText&&o?"symbolTextAndIcon":f?"symbolSDF":"symbolIcon",h),C=(0,E.A)(w,_.zoom),S=t.style.map.terrain?.getTerrainData(l),L,P=[0,0],I,R,B=null,O;if(o){if(I=n.glyphAtlasTexture,R=p.LINEAR,L=n.glyphAtlasTexture.size,c.iconsInText){P=n.imageAtlasTexture.size,B=n.imageAtlasTexture;let i="composite"===w.kind||"camera"===w.kind;O=T||t.options.rotating||t.options.zooming||i?p.LINEAR:p.NEAREST}}else{let i=1!==r.layout.get("icon-size").constantOr(0)||c.iconsNeedLinear;I=n.imageAtlasTexture,R=f||t.options.rotating||t.options.zooming||i||T?p.LINEAR:p.NEAREST,L=n.imageAtlasTexture.size}let z=(0,E.Lr)(n,1,t.transform.zoom),Y=ty(g,t.transform,z),j=function(t,i,r,n){if(t){let t=(0,E.yi)();if(!i){let{vecSouth:i,vecEast:n}=tv(r);t[0]=n[0],t[1]=n[1],t[4]=i[0],t[5]=i[1]}return(0,E.ji)(t,t,[n,n,1]),t}return r.pixelsToClipSpaceMatrix}(b,g,t.transform,z),N=(0,E.Mr)(_,n,a,s),U=_.getProjectionData({overscaledTileID:l,applyGlobeMatrix:!m,applyTerrainMatrix:!0}),H=k&&c.hasTextData(),V="none"!==r.layout.get("icon-text-fit")&&H&&c.hasIconData(),$=r._unevaluatedLayout.hasValue("icon-offset"),q="ground"===r.layout.get("symbol-height-anchor");if(y){let i=(0,E.yi)();!function(t,i){let r=1/(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]),n=1/(i[8]*i[8]+i[9]*i[9]+i[10]*i[10]),o=i[0]*r,a=i[4]*r,s=i[8]*n,l=i[1]*r,c=i[5]*r,d=i[9]*n,u=i[2]*r,h=i[6]*r,m=i[10]*n;t[0]=o,t[1]=a,t[2]=s,t[4]=l,t[5]=c,t[6]=d,t[8]=u,t[9]=h,t[10]=m;let f=i[12],p=i[13],_=i[14];t[12]=-o*f-l*p-u*_,t[13]=-a*f-c*p-h*_,t[14]=-s*f-d*p-m*_,t[3]=0,t[7]=0,t[11]=0,t[15]=1}(i,Y);let n=t.style.map.terrain?(i,r)=>t.style.map.terrain.getElevation(l,i,r):void 0;!function(t,i,r,n,o,a,s,l,c,d,u,h,m){let f=r?t.textSizeData:t.iconSizeData,p=(0,E.A)(f,i.transform.zoom),_=[256/i.width*2+1,256/i.height*2+1],g=r?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;g.clear();let b=t.lineVertexArray,y=r?t.text.placedSymbolArray:t.icon.placedSymbolArray,v=i.transform.width/i.transform.height,F=!1;for(let r=0;r<y.length;r++){var x;let w=y.get(r);if(w.hidden||2===w.writingMode&&!F){tI(w.numGlyphs,g);continue}F=!1;let k=new E.Ri(w.anchorX,w.anchorY),M={getElevation:m,pitchedLabelPlaneMatrix:n,lineVertexArray:b,pitchWithMap:a,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:i.transform,tileAnchorPoint:k,unwrappedTileID:c,width:d,height:u,translation:h},D=tC(w.anchorX,w.anchorY,M);if(x=D.point,!(x.x>=-_[0]&&x.x<=_[0]&&x.y>=-_[1])||!(x.y<=_[1])){tI(w.numGlyphs,g);continue}let T=D.signedDistanceFromCamera,A=.5+i.transform.cameraToCenterDistance/T*.5,C=(0,E.k)(f,p,w),S=a?C*i.transform.getPitchedTextCorrection(w.anchorX,w.anchorY,c)/A:C*A,L=tk({projectionContext:M,pitchedLabelPlaneMatrixInverse:o,symbol:w,fontSize:S,flip:!1,keepUpright:s,glyphOffsetArray:t.glyphOffsetArray,dynamicLayoutVertexArray:g,aspectRatio:v,rotateToLine:l});F=L.useVertical,(L.notEnoughRoom||F||L.needsFlipping&&tk({projectionContext:M,pitchedLabelPlaneMatrixInverse:o,symbol:w,fontSize:S,flip:!0,keepUpright:s,glyphOffsetArray:t.glyphOffsetArray,dynamicLayoutVertexArray:g,aspectRatio:v,rotateToLine:l}).notEnoughRoom)&&tI(w.numGlyphs,g)}r?t.text.dynamicLayoutVertexBuffer.updateData(g):t.icon.dynamicLayoutVertexBuffer.updateData(g)}(c,t,o,Y,i,b,d,"map"===r.layout.get("text-rotation-alignment"),l.toUnwrapped(),_.width,_.height,N,n)}let G=o&&k||V,W=b?Y:t.transform.clipSpaceToPixelsMatrix,Z=y||G?ny:W,K=f&&0!==r.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1),J={program:A,buffers:u,uniformValues:f?c.iconsInText?rC(w.kind,C,v,b,y,G,t,Z,j,N,L,P,D,$,q):rA(w.kind,C,v,b,y,G,t,Z,j,N,o,L,K,D,$,q):rT(w.kind,C,v,b,y,G,t,Z,j,N,o,L,D,$,q),projectionData:U,atlasTexture:I,atlasTextureIcon:B,atlasInterpolation:R,atlasInterpolationIcon:O,isSDF:f,hasHalo:K};if(F&&c.canOverlap)for(let t of(x=!0,u.segments.get()))M.push({segments:new E.Rt([t]),sortKey:t.sortKey,state:J,terrainData:S});else M.push({segments:u.segments,sortKey:0,state:J,terrainData:S})}x&&M.sort((t,i)=>t.sortKey-i.sortKey);let T=r.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(null)??1/0,A=24*r.layout.get("text-letter-spacing").constantOr(0)<0||T>1;for(let i of M){let n=i.state;f.activeTexture.set(p.TEXTURE0),n.atlasTexture.bind(n.atlasInterpolation,p.CLAMP_TO_EDGE),n.atlasTextureIcon&&(f.activeTexture.set(p.TEXTURE1),n.atlasTextureIcon&&n.atlasTextureIcon.bind(n.atlasInterpolationIcon,p.CLAMP_TO_EDGE));let o=n.isSDF&&n.hasHalo;if(o){let o=n.uniformValues;o.u_is_halo=1,A&&(o.u_is_plain=0,nF(n.buffers,i.segments,r,t,n.program,w,u,h,o,n.projectionData,i.terrainData),o.u_is_halo=0,o.u_is_plain=1)}nF(n.buffers,i.segments,r,t,n.program,w,u,h,n.uniformValues,n.projectionData,i.terrainData),o&&!A&&(n.uniformValues.u_is_halo=0)}}function nF(t,i,r,n,o,a,s,l,c,d,u){let h=n.context,m=h.gl;o.draw(h,m.TRIANGLES,a,s,l,ng.backCCW,c,u,d,r.id,t.layoutVertexBuffer,t.indexBuffer,i,r.paint,n.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function nx(t,i,r){let n=t.gl,o=n.createTexture();n.bindTexture(n.TEXTURE_2D,o),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texStorage2D(n.TEXTURE_2D,1,n.RGBA16F,i,r);let a=t.createFramebuffer(i,r,!1,!1);return a.colorAttachment.set(o),a}function nw(t,i){return i.colorRampTexture||=new E.yt(t,i.colorRamp,t.gl.RGBA),i.colorRampTexture}function nE(t,i,r,n){let o=t.context,a=o.bindFramebuffer.get(),s=o.viewport.get(),[,,l,c]=s;return function(t,i,r){let n=t.context.gl;if(!t.layerOpacityFbo){let o=t.context.createFramebuffer(i,r,!0,!0),a=n.createTexture();n.bindTexture(n.TEXTURE_2D,a),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,i,r,0,n.RGBA,n.UNSIGNED_BYTE,null),o.colorAttachment.set(a),o.depthAttachment.set(t.context.createRenderbuffer(n.DEPTH_STENCIL,i,r)),t.layerOpacityFbo=o,t.context.bindFramebuffer.set(t.layerOpacityFbo.framebuffer);return}if(t.layerOpacityFbo.width===i&&t.layerOpacityFbo.height===r)return t.context.bindFramebuffer.set(t.layerOpacityFbo.framebuffer);let o=t.layerOpacityFbo;n.bindTexture(n.TEXTURE_2D,o.colorAttachment.get()),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,i,r,0,n.RGBA,n.UNSIGNED_BYTE,null),t.context.bindRenderbuffer.set(o.depthAttachment.get()),n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,i,r),t.context.bindRenderbuffer.set(null),o.width=i,o.height=r,t.context.bindFramebuffer.set(o.framebuffer)}(t,l,c),o.viewport.set([0,0,l,c]),o.clear({color:E.pn.transparent,depth:1,stencil:0}),t.currentStencilSource=void 0,t.renderTileClippingMasks(i,r,n),{compositeTarget:a,compositeViewport:s}}function nk(t,i,r,n){let o=t.context,a=o.gl;o.bindFramebuffer.set(r.compositeTarget),o.viewport.set(r.compositeViewport),o.activeTexture.set(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,t.layerOpacityFbo.colorAttachment.get()),t.useProgram("layerOpacity").draw(o,a.TRIANGLES,np.disabled,n_.disabled,t.colorModeForRenderPass(),ng.disabled,{u_image:0,u_opacity:i},null,null,n.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,n.paint,t.transform.zoom),t.currentStencilSource=void 0}function nM(t,i,r,n,o,a,s,l){let c=256;if(o.stepInterpolant){let n=i.getSource().maxzoom,o=s.canonical.z===n?Math.ceil(1<<t.transform.maxZoom-s.canonical.z):1,l=a.maxLineLength/8192*1024*o;c=(0,E.Vn)((0,E.vr)(l),256,r.maxTextureSize)}return l.gradient=(0,E.Ct)({expression:o.gradientExpression(),evaluationKey:"lineProgress",resolution:c,image:l.gradient||void 0,clips:a.lineClipsArray}),l.texture?l.texture.update(l.gradient):l.texture=new E.yt(r,l.gradient,n.RGBA),l.version=o.gradientVersion,l.texture}function nD(t,i,r,n,o,a){let{isRenderingToTexture:s}=o,l=t.getDepthModeForSublayer(0,np.ReadOnly),c=t.colorModeForRenderPass(),d=r.paint.get("line-dasharray"),u=d.constantOr(1),h=r.paint.get("line-pattern"),m=h.constantOr(1),f=r.paint.get("line-gradient"),p=r.getCrossfadeParameters(),_;_=m?"linePattern":u&&f?"lineGradientSDF":u?"lineSDF":f?"lineGradient":"line";let g=t.context,b=g.gl,y=t.transform,v=!0;for(let o of n){let n=i.getTile(o);if(m&&!n.patternsLoaded())continue;let F=n.getBucket(r);if(!F)continue;let x=F.programConfigurations.get(r.id),w=t.context.program.get(),E=t.useProgram(_,x),k=v||E.program!==w,M=a?t.getTerrainDataForTile(o,s):null,D=h.constantOr(null),T=d?.constantOr(null);if(D&&n.imageAtlas){let t=n.imageAtlas,i=t.patternPositions[D.to.toString()],r=t.patternPositions[D.from.toString()];i&&r&&x.setConstantPatternPositions(i,r)}else if(T){let i="round"===r.layout.get("line-cap").constantOr(null),n=t.lineAtlas.getDash(T.to,i),o=t.lineAtlas.getDash(T.from,i);x.setConstantDashPositions(n,o)}let A=y.getProjectionData({overscaledTileID:o,applyGlobeMatrix:!s,applyTerrainMatrix:!0}),C=y.getPixelScale(),S;m?(S=rw(t,n,r,C,p),g.activeTexture.set(b.TEXTURE0),n.imageAtlasTexture.bind(b.LINEAR,b.CLAMP_TO_EDGE),x.updatePaintBuffers(p)):u&&f?(S=rk(t,n,r,C,p,F.lineClipsArray.length),function(t,i,r,n,o,a,s,l,c){let d=a.gradients[o.id],u=d.texture;o.gradientVersion!==d.version&&(u=nM(t,i,r,n,o,a,s,d)),r.activeTexture.set(n.TEXTURE0),u.bind(o.stepInterpolant?n.NEAREST:n.LINEAR,n.CLAMP_TO_EDGE),r.activeTexture.set(n.TEXTURE1),t.lineAtlas.bind(r),l.updatePaintBuffers(c)}(t,i,g,b,r,F,o,x,p)):u?(S=rE(t,n,r,C,p),(k||t.lineAtlas.dirty)&&(g.activeTexture.set(b.TEXTURE0),t.lineAtlas.bind(g)),x.updatePaintBuffers(p)):f?(S=rx(t,n,r,C,F.lineClipsArray.length),function(t,i,r,n,o,a,s){let l=a.gradients[o.id],c=l.texture;o.gradientVersion!==l.version&&(c=nM(t,i,r,n,o,a,s,l)),r.activeTexture.set(n.TEXTURE0),c.bind(o.stepInterpolant?n.NEAREST:n.LINEAR,n.CLAMP_TO_EDGE)}(t,i,g,b,r,F,o)):S=rF(t,n,r,C);let L=t.stencilModeForClipping(o);E.draw(g,b.TRIANGLES,l,L,c,ng.disabled,S,M,A,r.id,F.layoutVertexBuffer,F.indexBuffer,F.segments,r.paint,t.transform.zoom,x,F.layoutVertexBuffer2),v=!1}}function nT(t,i,r,n,o){if(!r||!n?.imageAtlas)return;let a=n.imageAtlas.patternPositions,s=a[r.to.toString()],l=a[r.from.toString()];if(!s&&l&&(s=l),!l&&s&&(l=s),!s||!l){let t=o.getPaintProperty(i);s=a[t],l=a[t]}s&&l&&t.setConstantPatternPositions(s,l)}function nA(t,i,r,n,o){let{isRenderingToTexture:a}=o,s=t.colorModeForRenderPass();nS(t,i,r,n,t.getDepthModeForSublayer(1,np.ReadOnly),s,!1,a),nC(t,i,r,n,o)}function nC(t,i,r,n,o){if(!r.paint.get("fill-antialias"))return;let{isRenderingToTexture:a}=o,s=t.colorModeForRenderPass();nS(t,i,r,n,t.getDepthModeForSublayer(2*!!r.getPaintProperty("fill-outline-color"),np.ReadOnly),s,!0,a)}function nS(t,i,r,n,o,a,s,l){let c=t.context.gl,d="fill-pattern",u=r.paint.get(d),h=u?.constantOr(1),m=r.getCrossfadeParameters(),f,p,_,g,b,y=t.transform,v=r.paint.get("fill-translate"),F=r.paint.get("fill-translate-anchor");s?(p=h&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",f=c.LINES):(p=h?"fillPattern":"fill",f=c.TRIANGLES);let x=u.constantOr(null);for(let u of n){let n=i.getTile(u);if(h&&!n.patternsLoaded())continue;let w=n.getBucket(r);if(!w)continue;let k=w.sdfPatterns[r.id]??!1,M=w.programConfigurations.get(r.id),D=t.useProgram(p,M),T=t.getTerrainDataForTile(u,l);h&&(t.context.activeTexture.set(c.TEXTURE0),n.imageAtlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),M.updatePaintBuffers(m)),nT(M,d,x,n,r);let A=y.getProjectionData({overscaledTileID:u,applyGlobeMatrix:!l,applyTerrainMatrix:!0}),C=(0,E.Mr)(y,n,v,F);s?(g=w.indexBuffer2,b=w.segments2,_="fillOutlinePattern"===p&&h?rm(t,m,n,C,k):rh(C)):(g=w.indexBuffer,b=w.segments,_=h?rd(t,m,n,C,k):ru(C));let S=t.stencilModeForClipping(u);D.draw(t.context,f,o,S,a,ng.backCCW,_,T,A,r.id,w.layoutVertexBuffer,g,b,r.paint,t.transform.zoom,M)}}function nL(t,i,r,n,o,a,s,l){let c=t.context,d=c.gl,u="fill-extrusion-pattern",h=r.paint.get(u),m=h.constantOr(1),f=r.getCrossfadeParameters(),p=r.paint.get("fill-extrusion-opacity"),_=h.constantOr(null),g=t.transform;for(let h of n){let n=i.getTile(h),b=n.getBucket(r);if(!b)continue;let y=t.style.map.terrain?.getTerrainData(h),v=b.programConfigurations.get(r.id),F=t.useProgram(m?"fillExtrusionPattern":"fillExtrusion",v);m&&(t.context.activeTexture.set(d.TEXTURE0),n.imageAtlasTexture.bind(d.LINEAR,d.CLAMP_TO_EDGE),v.updatePaintBuffers(f));let x=g.getProjectionData({overscaledTileID:h,applyGlobeMatrix:!l,applyTerrainMatrix:!0});nT(v,u,_,n,r);let w=(0,E.Mr)(g,n,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),k=r.paint.get("fill-extrusion-vertical-gradient"),M=m?rc(t,k,p,w,h,f,n):rl(t,k,p,w);F.draw(c,c.gl.TRIANGLES,o,a,s,ng.backCCW,M,y,x,r.id,b.layoutVertexBuffer,b.indexBuffer,b.segments,r.paint,t.transform.zoom,v,t.style.map.terrain&&b.centroidVertexBuffer)}}function nP(t,i,r,n,o,a,s,l,c){let d=t.style.projection,u=t.context,h=t.transform,m=u.gl,f=[`#define NUM_ILLUMINATION_SOURCES ${r.paint.get("hillshade-highlight-color").values.length}`],p=t.useProgram("hillshade",null,!1,f),_=!t.options.moving;for(let f of n){let n=i.getTile(f),g=n.fbo;if(!g)continue;let b=d.getMeshFromTileID(u,f.canonical,l,!0,"raster"),y=t.getTerrainDataForTile(f,c);u.activeTexture.set(m.TEXTURE0),m.bindTexture(m.TEXTURE_2D,g.colorAttachment.get());let v=h.getProjectionData({overscaledTileID:f,aligned:_,applyGlobeMatrix:!c,applyTerrainMatrix:!0});p.draw(u,m.TRIANGLES,a,o[f.overscaledZ],s,ng.backCCW,rb(t,n,r),y,v,r.id,b.vertexBuffer,b.indexBuffer,b.segments)}}let nI=0;function nR(t,i,r,n,o,a,s,l,c){let d=t.style.projection,u=t.context,h=t.transform,m=u.gl,f=t.useProgram("colorRelief"),p=!t.options.moving,_="nearest"===r.paint.get("resampling")?m.NEAREST:m.LINEAR,g=!0,b=0;for(let y of n){let n=i.getTile(y),v=n.dem;if(!v?.data)continue;if(g){let t=nI||=m.getParameter(m.MAX_TEXTURE_SIZE),{elevationTexture:i,colorTexture:n}=r.getColorRampTextures(u,t,v.getUnpackVector());u.activeTexture.set(m.TEXTURE1),i.bind(m.NEAREST,m.CLAMP_TO_EDGE),u.activeTexture.set(m.TEXTURE4),n.bind(m.LINEAR,m.CLAMP_TO_EDGE),g=!1,b=i.size[0]}let F=v.stride;u.activeTexture.set(m.TEXTURE0),(!n.demTexture||n.needsColorReliefPrepare)&&(u.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture||=t.getTileTexture(F)??new E.yt(u,{width:F,height:F,data:null},m.RGBA),n.demTexture.update(v.getPixels(),{premultiply:!1}),n.needsColorReliefPrepare=!1),n.demTexture.bind(_,m.CLAMP_TO_EDGE);let x=d.getMeshFromTileID(u,y.canonical,l,!0,"raster"),w=t.getTerrainDataForTile(y,c),k=h.getProjectionData({overscaledTileID:y,aligned:p,applyGlobeMatrix:!c,applyTerrainMatrix:!0});f.draw(u,m.TRIANGLES,a,o[y.overscaledZ],s,ng.backCCW,rv(r,n.dem,b),w,k,r.id,x.vertexBuffer,x.indexBuffer,x.segments)}}let nB=[new E.Ri(0,0),new E.Ri(8192,0),new E.Ri(8192,8192),new E.Ri(0,8192)];function nO(t,i,r,n,o,a,s,l,c,d=!1,u=!1,h=null){let m=n[n.length-1].overscaledZ,f=t.context,p=f.gl,_=t.useProgram("raster"),g=t.transform,b=t.style.projection,y=t.colorModeForRenderPass(),v=!t.options.moving,F=r.paint.get("raster-opacity"),x="nearest"===r.paint.get("resampling")||"nearest"===r.paint.get("raster-resampling")?p.NEAREST:p.LINEAR,w=r.paint.get("raster-fade-duration"),k=!!t.style.map.terrain;for(let M of n){let n=t.getDepthModeForSublayer(M.overscaledZ-m,1===F?np.ReadWrite:np.ReadOnly,p.LESS),D=i.getTile(M);f.activeTexture.set(p.TEXTURE0),D.texture.bind(x,p.CLAMP_TO_EDGE,p.LINEAR_MIPMAP_NEAREST),f.activeTexture.set(p.TEXTURE1);let{parentTile:T,parentScaleBy:C,parentTopLeft:S,fadeValues:L}=function(t,i,r,n){let o={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(0===r||n)return o;if(t.fadingParentID){let n=i.getLoadedTile(t.fadingParentID);if(!n)return o;let a=2**(n.tileID.overscaledZ-t.tileID.overscaledZ);return{parentTile:n,parentScaleBy:a,parentTopLeft:[t.tileID.canonical.x*a%1,t.tileID.canonical.y*a%1],fadeValues:function(t,i,r){let n=A(),o=(n-t.timeAdded)/r,a=(n-i.timeAdded)/r,s=1===t.fadingDirection,l=(0,E.Vn)(o,0,1),c=(0,E.Vn)(1-a,0,1),d=s?l:c;return{tileOpacity:d,parentTileOpacity:s?c:l,fadeMix:{opacity:1,mix:1-d}}}(t,n,r)}}return t.selfFading?{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:function(t,i){let r=(A()-t.timeAdded)/i,n=(0,E.Vn)(r,0,1);return{tileOpacity:n,fadeMix:{opacity:n,mix:0}}}(t,r)}:o}(D,i,w,k);D.fadeOpacity=L.tileOpacity,T?(T.fadeOpacity=L.parentTileOpacity,T.texture.bind(x,p.CLAMP_TO_EDGE,p.LINEAR_MIPMAP_NEAREST)):D.texture.bind(x,p.CLAMP_TO_EDGE,p.LINEAR_MIPMAP_NEAREST),D.texture.useMipmap&&f.extTextureFilterAnisotropic&&t.transform.pitch>t.options.anisotropicFilterPitch&&p.texParameterf(p.TEXTURE_2D,f.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,f.extTextureFilterAnisotropicMax);let P=t.getTerrainDataForTile(M,u),I=g.getProjectionData({overscaledTileID:M,aligned:v,applyGlobeMatrix:!u,applyTerrainMatrix:!0}),R=eG(S,C,L.fadeMix,r,l,c),B=h??b.getMeshFromTileID(f,M.canonical,a,s,"raster"),O=o?o[M.overscaledZ]:n_.disabled;_.draw(f,p.TRIANGLES,n,O,y,d?ng.frontCCW:ng.backCCW,R,P,I,r.id,B.vertexBuffer,B.indexBuffer,B.segments)}}let nz=new E.pn(1,0,0,1),nY=new E.pn(0,1,0,1),nj=new E.pn(0,0,1,1),nN=new E.pn(1,0,1,1),nU=new E.pn(0,1,1,1);function nH(t,i,r,n){n$(t,0,i+r/2,t.transform.width,r,n)}function nV(t,i,r,n){n$(t,i-r/2,0,r,t.transform.height,n)}function n$(t,i,r,n,o,a){let s=t.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(i*t.pixelRatio,r*t.pixelRatio,n*t.pixelRatio,o*t.pixelRatio),s.clear({color:a}),l.disable(l.SCISSOR_TEST)}function nq(t,i){if(!i.mesh){let r=new E.Ut;r.emplaceBack(-1,-1),r.emplaceBack(1,-1),r.emplaceBack(1,1),r.emplaceBack(-1,1);let n=new E.Kt;n.emplaceBack(0,1,2),n.emplaceBack(0,2,3),i.mesh=new eW(t.createVertexBuffer(r,eZ.members),t.createIndexBuffer(n),E.Rt.simpleSegment(0,0,r.length,n.length))}return i.mesh}let nG={symbol:function(t,i,r,n,o,a){if("translucent"!==a.currentPass)return;let{isRenderingToTexture:s}=a,l=n_.disabled,c=t.colorModeForRenderPass();(r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(t,i,r,n,o,a,s,l,c){let d=i.transform,u=i.style.map.terrain,h="map"===o,m="map"===a;for(let o of t){let t=n.getTile(o),a=t.getBucket(r);if(!a?.text?.segments.get().length)continue;let f=a.textSizeData,p=(0,E.A)(f,d.zoom),_=(0,E.Lr)(t,1,i.transform.zoom),g=ty(h,i.transform,_),b="none"!==r.layout.get("icon-text-fit")&&a.hasIconData();if(p){let i=2**(d.zoom-t.tileID.overscaledZ),n=u?(t,i)=>u.getElevation(o,t,i):void 0;!function(t,i,r,n,o,a,s,l,c,d,u,h,m){let f=t.text.placedSymbolArray,p=t.text.dynamicLayoutVertexArray,_=t.icon.dynamicLayoutVertexArray,g={};p.clear();for(let _=0;_<f.length;_++){let b=f.get(_),y=t.allowVerticalPlacement&&!b.placedOrientation,v=b.hidden||!b.crossTileID||y?null:n[b.crossTileID];if(v){let n=new E.Ri(b.anchorX,b.anchorY),f={getElevation:h,heightOffset:b.heightOffset,heightAnchorGround:m,width:o.width,height:o.height,pitchedLabelPlaneMatrix:a,lineVertexArray:null,pitchWithMap:r,transform:o,projectionCache:null,tileAnchorPoint:n,translation:d,unwrappedTileID:u},_=r?tC(n.x,n.y,f):tT(n.x,n.y,f),y=.5+o.cameraToCenterDistance/_.signedDistanceFromCamera*.5,F=(0,E.k)(t.textSizeData,l,b)*y/24;r&&(F*=t.tilePixelRatio/s);let{width:x,height:w,anchor:k,textOffset:M,textBoxScale:D}=v,T=function(t,i,r,n,o,a){let{horizontalAlign:s,verticalAlign:l}=(0,E.M)(t);return new E.Ri((-(s-.5)*i/o+n[0])*a,(-(l-.5)*r/o+n[1])*a)}(k,x,w,M,D,F),A=o.getPitchedTextCorrection(n.x+d[0],n.y+d[1],u),C=function(t,i,r,n,o,a){let s=i.tileAnchorPoint.add(new E.Ri(i.translation[0],i.translation[1]));if(i.pitchWithMap){let t=n.mult(a);r||(t=t.rotate(-o));let l=s.add(t);return tx(l.x,l.y,i.pitchedLabelPlaneMatrix,tF(i,l.x,l.y)).point}if(r){let r=tT(i.tileAnchorPoint.x+1,i.tileAnchorPoint.y,i).point.sub(t),o=Math.atan(r.y/r.x)+(r.x<0?Math.PI:0);return t.add(n.rotate(o))}return t.add(n)}(_.point,f,i,T,-o.bearingInRadians,A),S=t.allowVerticalPlacement&&2===b.placedOrientation?Math.PI/2:0;for(let t=0;t<b.numGlyphs;t++)(0,E.C)(p,C,S);c&&b.associatedIconIndex>=0&&(g[b.associatedIconIndex]={shiftedAnchor:C,angle:S})}else tI(b.numGlyphs,p)}if(c){_.clear();let i=t.icon.placedSymbolArray;for(let t=0;t<i.length;t++){let r=i.get(t);if(r.hidden)tI(r.numGlyphs,_);else{let i=g[t];if(i)for(let t=0;t<r.numGlyphs;t++)(0,E.C)(_,i.shiftedAnchor,i.angle);else tI(r.numGlyphs,_)}}t.icon.dynamicLayoutVertexBuffer.updateData(_)}t.text.dynamicLayoutVertexBuffer.updateData(p)}(a,h,m,c,d,g,i,p,b,(0,E.Mr)(d,t,s,l),o.toUnwrapped(),n,"ground"===r.layout.get("symbol-height-anchor"))}}}(n,t,r,i,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),o),0!==r.paint.get("icon-opacity").constantOr(1)&&nv(t,i,r,n,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment").constantOr("viewport"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),l,c,s),0!==r.paint.get("text-opacity").constantOr(1)&&nv(t,i,r,n,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),l,c,s),i.map.showCollisionBoxes&&(nb(t,i,r,n,!0),nb(t,i,r,n,!1))},circle:function(t,i,r,n,o){if("translucent"!==o.currentPass)return;let{isRenderingToTexture:a}=o,s=r.paint.get("circle-opacity"),l=r.paint.get("circle-stroke-width"),c=r.paint.get("circle-stroke-opacity"),d=!r.layout.get("circle-sort-key").isConstant();if(0===s.constantOr(1)&&(0===l.constantOr(1)||0===c.constantOr(1)))return;let u=t.context,h=u.gl,m=t.transform,f=t.getDepthModeForSublayer(0,np.ReadOnly),p=n_.disabled,_=t.colorModeForRenderPass(),g=[],b=m.getCircleRadiusCorrection();for(let o of n){let n=i.getTile(o),s=n.getBucket(r);if(!s)continue;let l=r.paint.get("circle-translate"),c=r.paint.get("circle-translate-anchor"),u=(0,E.Mr)(m,n,l,c),h=s.programConfigurations.get(r.id),f=t.useProgram("circle",h),p=s.layoutVertexBuffer,_=s.indexBuffer,y=t.style.map.terrain?.getTerrainData(o),v={programConfiguration:h,program:f,layoutVertexBuffer:p,indexBuffer:_,uniformValues:rf(t,n,r,u,b),terrainData:y,projectionData:m.getProjectionData({overscaledTileID:o,applyGlobeMatrix:!a,applyTerrainMatrix:!0})};if(d)for(let t of s.segments.get())g.push({segments:new E.Rt([t]),sortKey:t.sortKey,state:v});else g.push({segments:s.segments,sortKey:0,state:v})}for(let i of(d&&g.sort((t,i)=>t.sortKey-i.sortKey),g)){let{programConfiguration:n,program:o,layoutVertexBuffer:a,indexBuffer:s,uniformValues:l,terrainData:c,projectionData:d}=i.state,m=i.segments;o.draw(u,h.TRIANGLES,f,p,_,ng.backCCW,l,c,d,r.id,a,s,m,r.paint,t.transform.zoom,n)}},heatmap:function(t,i,r,n,o){if(0===r.paint.get("heatmap-opacity"))return;let a=t.context,{isRenderingToTexture:s,isRenderingGlobe:l}=o;if(t.style.map.terrain){for(let a of n){let n=i.getTile(a);i.hasRenderableParent(a)||("offscreen"===o.currentPass?function(t,i,r,n,o){let a=t.context,s=a.gl,l=n_.disabled,c=new nm([s.ONE,s.ONE],E.pn.transparent,[!0,!0,!0,!0]),d=i.getBucket(r);if(!d)return;let u=n.key,h=r.heatmapFbos.get(u);h||(h=nx(a,i.tileSize,i.tileSize),r.heatmapFbos.set(u,h)),a.bindFramebuffer.set(h.framebuffer),a.viewport.set([0,0,i.tileSize,i.tileSize]),a.clear({color:E.pn.transparent});let m=d.programConfigurations.get(r.id),f=t.useProgram("heatmap",m,!o),p=t.transform.getProjectionData({overscaledTileID:i.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),_=t.style.map.terrain.getTerrainData(n);f.draw(a,s.TRIANGLES,np.disabled,l,c,ng.disabled,r_(i,t.transform.zoom,r.paint.get("heatmap-intensity"),1),_,p,r.id,d.layoutVertexBuffer,d.indexBuffer,d.segments,r.paint,t.transform.zoom,m)}(t,n,r,a,l):"translucent"===o.currentPass&&function(t,i,r,n,o){let a=t.context,s=a.gl,l=t.transform;a.setColorMode(t.colorModeForRenderPass());let c=nw(a,i),d=r.key,u=i.heatmapFbos.get(d);if(!u)return;a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,u.colorAttachment.get()),a.activeTexture.set(s.TEXTURE1),c.bind(s.LINEAR,s.CLAMP_TO_EDGE);let h=l.getProjectionData({overscaledTileID:r,applyTerrainMatrix:o,applyGlobeMatrix:!n});t.useProgram("heatmapTexture").draw(a,s.TRIANGLES,np.disabled,n_.disabled,t.colorModeForRenderPass(),ng.disabled,rg(t,i,0,1),null,h,i.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments,i.paint,l.zoom),u.destroy(),i.heatmapFbos.delete(d)}(t,r,a,s,l))}a.viewport.set([0,0,t.width,t.height])}else{var c,d;let a,s,l;"offscreen"===o.currentPass?function(t,i,r,n){var o,a,s;let l,c,d=t.context,u=d.gl,h=t.transform,m=n_.disabled,f=new nm([u.ONE,u.ONE],E.pn.transparent,[!0,!0,!0,!0]);for(let p of(o=d,a=t,s=r,l=o.gl,o.activeTexture.set(l.TEXTURE1),o.viewport.set([0,0,a.width/4,a.height/4]),(c=s.heatmapFbos.get("big-fb"))?(l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get()),o.bindFramebuffer.set(c.framebuffer)):(c=nx(o,a.width/4,a.height/4),s.heatmapFbos.set("big-fb",c)),d.clear({color:E.pn.transparent}),n)){if(i.hasRenderableParent(p))continue;let n=i.getTile(p),o=n.getBucket(r);if(!o)continue;let a=o.programConfigurations.get(r.id),s=t.useProgram("heatmap",a),l=h.getProjectionData({overscaledTileID:p,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),c=h.getCircleRadiusCorrection();s.draw(d,u.TRIANGLES,np.disabled,m,f,ng.backCCW,r_(n,h.zoom,r.paint.get("heatmap-intensity"),c),null,l,r.id,o.layoutVertexBuffer,o.indexBuffer,o.segments,r.paint,h.zoom,a)}d.viewport.set([0,0,t.width,t.height])}(t,i,r,n):"translucent"===o.currentPass&&(c=t,d=r,s=(a=c.context).gl,a.setColorMode(c.colorModeForRenderPass()),(l=d.heatmapFbos.get("big-fb"))&&(a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,l.colorAttachment.get()),a.activeTexture.set(s.TEXTURE1),nw(a,d).bind(s.LINEAR,s.CLAMP_TO_EDGE),c.useProgram("heatmapTexture").draw(a,s.TRIANGLES,np.disabled,n_.disabled,c.colorModeForRenderPass(),ng.disabled,rg(c,d,0,1),null,null,d.id,c.viewportBuffer,c.quadTriangleIndexBuffer,c.viewportSegments,d.paint,c.transform.zoom)))}},line:function(t,i,r,n,o){if("translucent"!==o.currentPass)return;let a=r.paint.get("line-opacity"),s=r.paint.get("line-width"),l=r.paint.get("line-layer-opacity");if(0===a.constantOr(1)||0===s.constantOr(1)||0===l)return;let c=!!t.style.map.terrain;if(l<1){let a=nE(t,r,n,c);nD(t,i,r,n,o,c),nk(t,l,a,r);return}nD(t,i,r,n,o,c)},fill:function(t,i,r,n,o){let a=r.paint.get("fill-color"),s=r.paint.get("fill-opacity"),l=r.paint.get("fill-layer-opacity");if(0===s.constantOr(1)||0===l)return;if(l<1){if("translucent"!==o.currentPass)return;let a=nE(t,r,n,!!t.style.map.terrain);nA(t,i,r,n,o),nk(t,l,a,r);return}let c=r.paint.get("fill-pattern"),d=t.opaquePassEnabledForLayer()&&!c.constantOr(1)&&1===a.constantOr(E.pn.transparent).a&&1===s.constantOr(0);if(d&&"opaque"===o.currentPass){let{isRenderingToTexture:a}=o,s=t.colorModeForRenderPass();nS(t,i,r,n,t.getDepthModeForSublayer(1,np.ReadWrite),s,!1,a);return}d&&"translucent"===o.currentPass?nC(t,i,r,n,o):"translucent"===o.currentPass&&nA(t,i,r,n,o)},fillExtrusion:function(t,i,r,n,o){let a=r.paint.get("fill-extrusion-opacity");if(0===a)return;let{isRenderingToTexture:s}=o;if("translucent"===o.currentPass){let l=new np(t.context.gl.LEQUAL,np.ReadWrite,o.depthRangeFor3D);if(1!==a||r.paint.get("fill-extrusion-pattern").constantOr(1))nL(t,i,r,n,l,n_.disabled,nm.disabled,s),nL(t,i,r,n,l,t.stencilModeFor3D(),t.colorModeForRenderPass(),s);else{let o=t.colorModeForRenderPass();nL(t,i,r,n,l,n_.disabled,o,s)}}},hillshade:function(t,i,r,n,o){if("offscreen"!==o.currentPass&&"translucent"!==o.currentPass)return;let{isRenderingToTexture:a}=o,s=t.context,l=t.style.projection.useSubdivision,c=t.getDepthModeForSublayer(0,np.ReadOnly),d=t.colorModeForRenderPass();if("offscreen"===o.currentPass)(function(t,i,r,n,o,a,s){let l=t.context,c=l.gl,d="nearest"===n.paint.get("resampling")?c.NEAREST:c.LINEAR;for(let u of r){let r=i.getTile(u),h=r.dem;if(!h?.data||!r.needsHillshadePrepare)continue;let m=h.dim+2,f=h.stride,p=h.getPixels();if(l.activeTexture.set(c.TEXTURE1),l.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture||=t.getTileTexture(f),r.demTexture){let t=r.demTexture;t.update(p,{premultiply:!1}),t.bind(c.NEAREST,c.CLAMP_TO_EDGE)}else r.demTexture=new E.yt(l,p,c.RGBA,{premultiply:!1}),r.demTexture.bind(c.NEAREST,c.CLAMP_TO_EDGE);l.activeTexture.set(c.TEXTURE0);let _=r.fbo;if(!_){let t=new E.yt(l,{width:m,height:m,data:null},c.RGBA);t.bind(d,c.CLAMP_TO_EDGE),(_=r.fbo=l.createFramebuffer(m,m,!0,!1)).colorAttachment.set(t.texture)}l.bindFramebuffer.set(_.framebuffer),l.viewport.set([0,0,m,m]),t.useProgram("hillshadePrepare").draw(l,c.TRIANGLES,o,a,s,ng.disabled,ry(r.tileID,h),null,null,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),r.needsHillshadePrepare=!1}})(t,i,n,r,c,n_.disabled,d),s.viewport.set([0,0,t.width,t.height]);else if("translucent"===o.currentPass)if(l){let[o,s,l]=t.stencilConfigForOverlapTwoPass(n);nP(t,i,r,l,o,c,d,!1,a),nP(t,i,r,l,s,c,d,!0,a)}else{let[o,s]=t.getStencilConfigForOverlapAndUpdateStencilID(n);nP(t,i,r,s,o,c,d,!1,a)}},colorRelief:function(t,i,r,n,o){if("translucent"!==o.currentPass||!n.length)return;let{isRenderingToTexture:a}=o,s=t.style.projection.useSubdivision,l=t.getDepthModeForSublayer(0,np.ReadOnly),c=t.colorModeForRenderPass();if(s){let[o,s,d]=t.stencilConfigForOverlapTwoPass(n);nR(t,i,r,d,o,l,c,!1,a),nR(t,i,r,d,s,l,c,!0,a)}else{let[o,s]=t.getStencilConfigForOverlapAndUpdateStencilID(n);nR(t,i,r,s,o,l,c,!1,a)}},raster:function(t,i,r,n,o){if("translucent"!==o.currentPass||0===r.paint.get("raster-opacity")||!n.length)return;let{isRenderingToTexture:a}=o,s=i.getSource(),l=t.style.projection.useSubdivision;if(s instanceof eX)nO(t,i,r,n,null,!1,!1,s.tileCoords,s.imageWarp,s.flippedWindingOrder,a,s.getMesh(t.context,l));else if(l){let[o,s,l]=t.stencilConfigForOverlapTwoPass(n);nO(t,i,r,l,o,!1,!0,nB,eq,!1,a),nO(t,i,r,l,s,!0,!0,nB,eq,!1,a)}else{let[o,s]=t.getStencilConfigForOverlapAndUpdateStencilID(n);nO(t,i,r,s,o,!1,!0,nB,eq,!1,a)}},background:function(t,i,r,n,o){let a=r.paint.get("background-color"),s=r.paint.get("background-opacity");if(0===s)return;let{isRenderingToTexture:l}=o,c=t.context,d=c.gl,u=t.style.projection,h=t.transform,m=h.tileSize,f=r.paint.get("background-pattern");if(t.isPatternMissing(f))return;let p=!f&&1===a.a&&1===s&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(o.currentPass!==p)return;let _=n_.disabled,g=t.getDepthModeForSublayer(0,"opaque"===p?np.ReadWrite:np.ReadOnly),b=t.colorModeForRenderPass(),y=t.useProgram(f?"backgroundPattern":"background"),v=n||tl(h,{tileSize:m,terrain:t.style.map.terrain});f&&(c.activeTexture.set(d.TEXTURE0),t.patternAtlas.bind(t.context));let F=r.getCrossfadeParameters();for(let i of v){let n=h.getProjectionData({overscaledTileID:i,applyGlobeMatrix:!l,applyTerrainMatrix:!0}),o=f?rL(s,t,f,{tileID:i,tileSize:m},F):rS(s,a),p=t.getTerrainDataForTile(i,l),v=u.getMeshFromTileID(c,i.canonical,!1,!0,"raster");y.draw(c,d.TRIANGLES,g,_,b,ng.backCCW,o,p,n,r.id,v.vertexBuffer,v.indexBuffer,v.segments)}},sky:function(t,i){var r,n;let o,a,s,l,c=t.context,d=c.gl,u=(r=t.transform,n=t.pixelRatio,o=Math.cos(r.rollInRadians),a=Math.sin(r.rollInRadians),s=(0,E.Y)(r),l=r.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition,{u_sky_color:i.properties.get("sky-color"),u_horizon_color:i.properties.get("horizon-color"),u_horizon:[(r.width/2-s*a)*n,(r.height/2+s*o)*n],u_horizon_normal:[-a,o],u_sky_horizon_blend:i.properties.get("sky-horizon-blend")*r.height/2*n,u_sky_blend:l,u_inv_proj_matrix:r.inverseProjectionMatrix,u_globe_position:iI(r),u_globe_radius:iP(r.worldSize,r.center.lat)}),h=new np(d.LEQUAL,np.ReadWrite,[0,1]),m=n_.disabled,f=t.colorModeForRenderPass(),p=t.useProgram("sky"),_=nq(c,i);p.draw(c,d.TRIANGLES,h,m,f,ng.disabled,u,null,void 0,"sky",_.vertexBuffer,_.indexBuffer,_.segments)},atmosphere:function(t,i,r){var n;let o,a,s=t.context,l=s.gl,c=t.useProgram("atmosphere"),d=new np(l.LEQUAL,np.ReadOnly,[0,1]),u=t.transform,h=(n=t.transform,o=r.getCartesianPosition(),(0,E.ii)(o,o),a=(0,E.Ci)(new Float64Array(16)),"map"===r.properties.get("anchor")&&((0,E.Ai)(a,a,n.rollInRadians),(0,E.Oi)(a,a,-n.pitchInRadians),(0,E.Ai)(a,a,n.bearingInRadians),(0,E.Oi)(a,a,n.center.lat*Math.PI/180),(0,E.ki)(a,a,-n.center.lng*Math.PI/180)),(0,E.mi)(o,o,a),o),m=u.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),f=i.properties.get("atmosphere-blend")*m.projectionTransition;if(0===f)return;let p=iP(u.worldSize,u.center.lat),_={u_sun_pos:h,u_atmosphere_blend:f,u_globe_position:iI(u),u_globe_radius:p,u_inv_proj_matrix:u.inverseProjectionMatrix},g=nq(s,i);c.draw(s,l.TRIANGLES,d,n_.disabled,nm.alphaBlended,ng.disabled,_,null,null,"atmosphere",g.vertexBuffer,g.indexBuffer,g.segments)},custom:function(t,i,r,n){let{isRenderingGlobe:o}=n,a=t.context,s=r.implementation,l=t.style.projection,c=t.transform,d=c.getProjectionDataForCustomLayer(o),u={farZ:c.farZ,nearZ:c.nearZ,fov:c.fov*Math.PI/180,modelViewProjectionMatrix:c.modelViewProjectionMatrix,projectionMatrix:c.projectionMatrix,shaderData:{variantName:l.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793;
|
|
816
816
|
uniform mat4 u_projection_matrix;
|
|
817
|
-
${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionData:d,getProjectionData:t=>c.getProjectionData({overscaledTileID:new E.d(t.tileID.canonical.z,t.tileID.wrap??0,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),aligned:t.aligned,applyGlobeMatrix:t.applyGlobeMatrix,applyTerrainMatrix:t.applyTerrainMatrix})},h=s.renderingMode?s.renderingMode:"2d";if("offscreen"===n.currentPass){let i=s.prerender;i&&(t.setCustomLayerDefaults(),a.setColorMode(t.colorModeForRenderPass()),i.call(s,a.gl,u),a.setDirty(),t.setBaseState())}else if("translucent"===n.currentPass){t.setCustomLayerDefaults(),a.setColorMode(t.colorModeForRenderPass()),a.setStencilMode(n_.disabled);let i="3d"===h?t.getDepthModeFor3D():t.getDepthModeForSublayer(0,np.ReadOnly);a.setDepthMode(i),s.render(a.gl,u),a.setDirty(),t.setBaseState(),a.bindFramebuffer.set(null)}},debug:function(t,i,r){for(let n of r)!function(t,i,r){let n=t.context,o=n.gl,a=t.useProgram("debug"),s=np.disabled,l=n_.disabled,c=t.colorModeForRenderPass(),d="$debug",u=t.style.map.terrain?.getTerrainData(r);n.activeTexture.set(o.TEXTURE0);let h=Math.floor((i.getTileByID(r.key).latestRawTileData?.byteLength||0)/1024),m=512/Math.min(i.getTile(r).tileSize,512)*(r.overscaledZ/t.transform.zoom)*.5,f=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(f+=` => ${r.overscaledZ}`),function(t,i){t.initDebugOverlayCanvas();let r=t.debugOverlayCanvas,n=t.context.gl,o=t.debugOverlayCanvas.getContext("2d");o.clearRect(0,0,r.width,r.height),o.shadowColor="white",o.shadowBlur=2,o.lineWidth=1.5,o.strokeStyle="white",o.textBaseline="top",o.font="bold 36px Open Sans, sans-serif",o.fillText(i,5,5),o.strokeText(i,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(t,`${f} ${h}kB`);let p=t.transform.getProjectionData({overscaledTileID:r,applyGlobeMatrix:!0,applyTerrainMatrix:!0});a.draw(n,o.TRIANGLES,s,l,nm.alphaBlended,ng.disabled,rp(E.pn.transparent,m),null,p,d,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),a.draw(n,o.LINE_STRIP,s,l,c,ng.disabled,rp(E.pn.red),u,p,d,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}(t,i,n)},debugPadding:function(t){var i,r,n,o;let a=t.transform.padding;nH(t,t.transform.height-(a.top||0),3,nz),nH(t,a.bottom||0,3,nY),nV(t,a.left||0,3,nj),nV(t,t.transform.width-(a.right||0),3,nN);let s=t.transform.centerPoint;i=t,r=s.x,n=t.transform.height-s.y,n$(i,r-1,n-10,2,20,o=nU),n$(i,r-10,n-1,20,2,o)},terrainDepth:function(t,i){let r=t.context,n=r.gl,o=t.transform,a=nm.unblended,s=new np(n.LEQUAL,np.ReadWrite,[0,1]),l=i.tileManager.getRenderableTiles(),c=t.useProgram("terrainDepth");for(let d of(r.bindFramebuffer.set(i.getFramebuffer().framebuffer),r.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),r.clear({color:E.pn.white,depth:1}),l)){let t=i.getTerrainMesh(d.tileID),l=i.getTerrainData(d.tileID),u=o.getProjectionData({overscaledTileID:d.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),h=i6(i.getSkirtLength(o.zoom));c.draw(r,n.TRIANGLES,s,n_.disabled,a,ng.backCCW,h,l,u,"terrain",t.vertexBuffer,t.indexBuffer,t.segments)}r.bindFramebuffer.set(null),r.viewport.set([0,0,t.width,t.height])}};var nW=class t{constructor(t,i){this.drawFunctions=nG,this.context=new nf(t),this.transform=i,this.layerOpacityFbo=null,this._tileTextures={},this._rttObjectRecyclePool=[],this._rttSharedFbo=null,this.terrainFacilitator={depthDirty:!0,matrix:(0,E.Ci)(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=tm.maxOverzooming+tm.maxUnderzooming+1,this.depthEpsilon=1/65536,this.crossTileSymbolIndex=new t5}resize(t,i,r){if(this.width=Math.floor(t*r),this.height=Math.floor(i*r),this.pixelRatio=r,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let t of this.style._order)this.style._layers[t].resize()}setup(){let t=this.context,i=new E.Ut;i.emplaceBack(0,0),i.emplaceBack(8192,0),i.emplaceBack(0,8192),i.emplaceBack(8192,8192),this.tileExtentBuffer=t.createVertexBuffer(i,eZ.members),this.tileExtentSegments=E.Rt.simpleSegment(0,0,4,2);let r=new E.Ut;r.emplaceBack(0,0),r.emplaceBack(8192,0),r.emplaceBack(0,8192),r.emplaceBack(8192,8192),this.debugBuffer=t.createVertexBuffer(r,eZ.members),this.debugSegments=E.Rt.simpleSegment(0,0,4,5);let n=new E.Gt;n.emplaceBack(0,0,0,0),n.emplaceBack(8192,0,8192,0),n.emplaceBack(0,8192,0,8192),n.emplaceBack(8192,8192,8192,8192),this.rasterBoundsBuffer=t.createVertexBuffer(n,i3.members),this.rasterBoundsSegments=E.Rt.simpleSegment(0,0,4,2);let o=new E.Ut;o.emplaceBack(0,0),o.emplaceBack(8192,0),o.emplaceBack(0,8192),o.emplaceBack(8192,8192),this.rasterBoundsBufferPosOnly=t.createVertexBuffer(o,eZ.members),this.rasterBoundsSegmentsPosOnly=E.Rt.simpleSegment(0,0,4,5);let a=new E.Ut;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(a,eZ.members),this.viewportSegments=E.Rt.simpleSegment(0,0,4,2);let s=new E.Vt;s.emplaceBack(0),s.emplaceBack(1),s.emplaceBack(3),s.emplaceBack(2),s.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(s);let l=new E.Kt;l.emplaceBack(1,0,2),l.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(l);let c=this.context.gl;this.stencilClearMode=new n_({func:c.ALWAYS,mask:0},0,255,c.ZERO,c.ZERO,c.ZERO),this.tileExtentMesh=new eW(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let t=this.context,i=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let r=(0,E.yi)();(0,E.Ei)(r,0,this.width,this.height,0,0,1),(0,E.ji)(r,r,[i.drawingBufferWidth,i.drawingBufferHeight,0]),this.useProgram("clippingMask",null,!0).draw(t,i.TRIANGLES,np.disabled,this.stencilClearMode,nm.disabled,ng.disabled,null,null,{mainMatrix:r,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:r,clipAntimeridian:!1},"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}renderTileClippingMasks(t,i,r){if(this.currentStencilSource===t.source||!t.isTileClipped()||!i?.length)return;this.currentStencilSource=t.source,this.nextStencilID+i.length>256&&this.clearStencil();let n=this.context;n.setColorMode(nm.disabled),n.setDepthMode(np.disabled);let o={};for(let t of i)o[t.key]=this.nextStencilID++;this.style.projection.useSubdivision&&this._renderTileMasks(o,i,r,!0),this._renderTileMasks(o,i,r,!1),this._tileClippingMaskIDs=o}_renderTileMasks(t,i,r,n){let o=this.context,a=o.gl,s=this.style.projection,l=this.transform,c=this.useProgram("clippingMask");for(let d of i){let i=t[d.key],u=this.getTerrainDataForTile(d,r),h=s.getMeshFromTileID(this.context,d.canonical,n,!0,"stencil"),m=l.getProjectionData({overscaledTileID:d,applyGlobeMatrix:!r,applyTerrainMatrix:!0});c.draw(o,a.TRIANGLES,np.disabled,new n_({func:a.ALWAYS,mask:0},i,255,a.KEEP,a.KEEP,a.REPLACE),nm.disabled,r?ng.disabled:ng.backCCW,null,u,m,"$clipping",h.vertexBuffer,h.indexBuffer,h.segments)}}getTerrainDataForTile(t,i){return i&&this.style.projection?.name==="mercator"?null:this.style.map.terrain?.getTerrainData(t)||null}_renderTilesDepthBuffer(){let t=this.context,i=t.gl,r=this.style.projection,n=this.transform,o=this.useProgram("depth"),a=this.getDepthModeFor3D();for(let s of tl(n,{tileSize:n.tileSize})){let l=this.style.map.terrain?.getTerrainData(s),c=r.getMeshFromTileID(this.context,s.canonical,!0,!0,"raster"),d=n.getProjectionData({overscaledTileID:s,applyGlobeMatrix:!0,applyTerrainMatrix:!0});o.draw(t,i.TRIANGLES,a,n_.disabled,nm.disabled,ng.backCCW,null,l,d,"$clipping",c.vertexBuffer,c.indexBuffer,c.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let t=this.nextStencilID++,i=this.context.gl;return new n_({func:i.NOTEQUAL,mask:255},t,255,i.KEEP,i.KEEP,i.REPLACE)}stencilModeForClipping(t){let i=this.context.gl;return new n_({func:i.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,i.KEEP,i.KEEP,i.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(t){let i=this.context.gl,r=t.sort((t,i)=>i.overscaledZ-t.overscaledZ),n=r[r.length-1].overscaledZ,o=r[0].overscaledZ-n+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();let t={};for(let r=0;r<o;r++)t[r+n]=new n_({func:i.GEQUAL,mask:255},r+this.nextStencilID,255,i.KEEP,i.KEEP,i.REPLACE);return this.nextStencilID+=o,[t,r]}return[{[n]:n_.disabled},r]}stencilConfigForOverlapTwoPass(t){let i=this.context.gl,r=t.sort((t,i)=>i.overscaledZ-t.overscaledZ),n=r[r.length-1].overscaledZ,o=r[0].overscaledZ-n+1;if(this.clearStencil(),o>1){let t={},a={};for(let r=0;r<o;r++)t[r+n]=new n_({func:i.GREATER,mask:255},o+1+r,255,i.KEEP,i.KEEP,i.REPLACE),a[r+n]=new n_({func:i.GREATER,mask:255},1+r,255,i.KEEP,i.KEEP,i.REPLACE);return this.nextStencilID=2*o+1,[t,a,r]}return this.nextStencilID=3,[{[n]:new n_({func:i.GREATER,mask:255},2,255,i.KEEP,i.KEEP,i.REPLACE)},{[n]:new n_({func:i.GREATER,mask:255},1,255,i.KEEP,i.KEEP,i.REPLACE)},r]}colorModeForRenderPass(){let t=this.context.gl;if(this._showOverdrawInspector){let i=1/8;return new nm([t.CONSTANT_COLOR,t.ONE],new E.pn(i,i,i,0),[!0,!0,!0,!0])}return"opaque"===this.renderOptions.currentPass?nm.unblended:nm.alphaBlended}getDepthModeForSublayer(t,i,r){if(!this.opaquePassEnabledForLayer())return np.disabled;let n=1-((1+this.renderOptions.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new np(r||this.context.gl.LEQUAL,i,[n,n])}getDepthModeFor3D(){return new np(this.context.gl.LEQUAL,np.ReadWrite,this.renderOptions.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.renderOptions.currentLayer<this.renderOptions.opaquePassCutoff}render(t,i){var r,n;let o;this.style=t,this.options=i;let a=this.renderOptions=(r=this.transform,n=t.projection,{currentPass:"offscreen",currentLayer:0,opaquePassCutoff:1/0,depthRangeFor3D:[0,1],isRenderingToTexture:!1,transform:r,terrain:t.map.terrain??null,projectionTransition:o=n?.transitionState??0,isRenderingGlobe:o>0});this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.patternAtlas=t.patternAtlas,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(A()),function(t,i){let r=t.pending,{transform:n}=i,o=i.context.gl;r[nh.u_units_to_pixels]=1/n.pixelsToGLUnits[0],r[nh.u_units_to_pixels+1]=1/n.pixelsToGLUnits[1],r[nh.u_world_size]=o.drawingBufferWidth,r[nh.u_world_size+1]=o.drawingBufferHeight,r[nh.u_camera_to_center_distance]=n.cameraToCenterDistance,r[nh.u_symbol_fade_change]=i.options.fadeDuration?i.symbolFadeChange:1,r[nh.u_aspect_ratio]=n.width/n.height,r[nh.u_device_pixel_ratio]=i.pixelRatio,r[nh.u_viewport_size]=n.width,r[nh.u_viewport_size+1]=n.height,r[nh.u_pixel_extrude_scale]=1/n.width,r[nh.u_pixel_extrude_scale+1]=1/n.height,r[nh.u_pitch]=n.pitch/360*2*Math.PI,t.upload()}(this.context.frameUniformBuffer,this),this.imageManager.beginFrame();let s=this.style._order,l=this.style.tileManagers,c={},d={},u={};for(let t in l){let i=l[t];i.used&&i.prepare(this.context),c[t]=i.getVisibleCoordinates(!1),d[t]=c[t].slice().reverse(),u[t]=i.getVisibleCoordinates(!0).reverse()}a.opaquePassCutoff=1/0;for(let t=0;t<s.length;t++){let i=s[t];if(this.style._layers[i].is3D()){a.opaquePassCutoff=t;break}}for(let t of(this.maybeDrawDepth(),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),a.opaquePassCutoff=0),a.currentPass="offscreen",s)){let i=this.style._layers[t];if(!i.hasOffscreenPass()||i.isHidden(this.transform.zoom))continue;let r=d[i.source];("custom"===i.type||r.length)&&this.renderLayer(this,l[i.source],i,r,a)}if(this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?E.pn.black:E.pn.transparent,depth:1}),this.clearStencil(),this.style.sky&&this.drawFunctions.sky(this,this.style.sky),this._showOverdrawInspector=i.showOverdrawInspector,a.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(a.currentPass="opaque",a.currentLayer=s.length-1;a.currentLayer>=0;a.currentLayer--){let t=this.style._layers[s[a.currentLayer]],i=l[t.source],r=c[t.source];this.renderTileClippingMasks(t,r,!1),this.renderLayer(this,i,t,r,a)}a.currentPass="translucent";let h=!1;for(a.currentLayer=0;a.currentLayer<s.length;a.currentLayer++){let t=this.style._layers[s[a.currentLayer]],i=l[t.source];if(this.renderToTexture?.renderLayer(t,a))continue;this.opaquePassEnabledForLayer()||h||(h=!0,a.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());let r=("symbol"===t.type?u:d)[t.source];this.renderTileClippingMasks(t,c[t.source],!!this.renderToTexture),this.renderLayer(this,i,t,r,a)}if(a.isRenderingGlobe&&this.drawFunctions.atmosphere(this,this.style.sky,this.style.light),this.options.showTileBoundaries){let t=function(t,i){let r=null,n=Object.values(t._layers).flatMap(r=>r.source&&!r.isHidden(i)?[t.tileManagers[r.source]]:[]),o=n.filter(t=>"vector"===t.getSource().type),a=n.filter(t=>"vector"!==t.getSource().type),s=t=>{(!r||r.getSource().maxzoom<t.getSource().maxzoom)&&(r=t)};for(let t of o)s(t);if(!r)for(let t of a)s(t);return r}(this.style,this.transform.zoom);t&&this.drawFunctions.debug(this,t,t.getVisibleCoordinates())}this.options.showPadding&&this.drawFunctions.debugPadding(this),this.context.setDefault()}maybeDrawDepth(){if(!this.style?.map?.terrain)return;let t=this.terrainFacilitator.matrix,i=this.transform.modelViewProjectionMatrix,r=this.terrainFacilitator.depthDirty;r||=!(0,E.bi)(t,i),(r||=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime))&&((0,E.vi)(t,i),this.terrainFacilitator.renderTime=A(),this.terrainFacilitator.depthDirty=!1,this.drawFunctions.terrainDepth(this,this.style.map.terrain))}renderLayer(t,i,r,n,o){if(r.isHidden(this.transform.zoom)||"background"!==r.type&&"custom"!==r.type&&!(n||[]).length)return;this.id=r.id;let a=this.drawFunctions;(0,E.x)(r)?a.symbol(t,i,r,n,this.style.placement.variableOffsets,o):(0,E.Et)(r)?a.circle(t,i,r,n,o):(0,E.St)(r)?a.heatmap(t,i,r,n,o):(0,E.H)(r)?a.line(t,i,r,n,o):(0,E.ft)(r)?a.fill(t,i,r,n,o):(0,E.W)(r)?a.fillExtrusion(t,i,r,n,o):(0,E.bt)(r)?a.hillshade(t,i,r,n,o):(0,E._t)(r)?a.colorRelief(t,i,r,n,o):(0,E.Jt)(r)?a.raster(t,i,r,n,o):(0,E.b)(r)?a.background(t,i,r,n,o):(0,E.v)(r)&&a.custom(t,i,r,o)}static{this.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50}saveTileTexture(i){let r=this._tileTextures[i.size[0]];r?r.length<t.MAX_TEXTURE_POOL_SIZE_PER_BUCKET?r.push(i):i.destroy():this._tileTextures[i.size[0]]=[i]}getTileTexture(t){let i=this._tileTextures[t];return i&&i.length>0?i.pop():null}acquireRTT(t){let i=this.context.gl,r=this._rttObjectRecyclePool.pop();if(r)return r.size!==t&&(r.texture.update({width:t,height:t,data:null},{premultiply:!1,useMipmap:!0}),r.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE,i.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&i.texParameterf(i.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),r.size=t),r;let n=new E.yt(this.context,{width:t,height:t,data:null},i.RGBA,{premultiply:!1,useMipmap:!0});return n.bind(i.LINEAR,i.CLAMP_TO_EDGE,i.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&i.texParameterf(i.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),{texture:n,size:t}}bindRTT(t){let i=this.context.gl,r=t.size;if(!this._rttSharedFbo){let t=this.context.createFramebuffer(r,r,!0,!0),n=this.context.createRenderbuffer(i.DEPTH_STENCIL,r,r);t.depthAttachment.set(n),this._rttSharedFbo={fbo:t,depthRenderbuffer:n,size:r}}this._rttSharedFbo.size!==r&&(this.context.bindRenderbuffer.set(this._rttSharedFbo.depthRenderbuffer),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,r,r),this.context.bindRenderbuffer.set(null),this._rttSharedFbo.fbo.width=r,this._rttSharedFbo.fbo.height=r,this._rttSharedFbo.size=r),this._rttSharedFbo.fbo.colorAttachment.set(t.texture.texture),this.context.bindFramebuffer.set(this._rttSharedFbo.fbo.framebuffer)}releaseRTT(t){this._rttObjectRecyclePool.push(t)}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;let i=this.patternAtlas.getPattern(t.from.toString()),r=this.patternAtlas.getPattern(t.to.toString());return!i||!r}useProgram(t,i,r=!1,n=[]){this.cache||={};let o=!!this.style.map.terrain,a=this.style.projection,s=r?ie.projectionMercator:a.shaderPreludeCode,l=r?ii:a.shaderDefine,c=`/${r?ir:a.shaderVariantName}`,d=t+(i?i.cacheKey:"")+c+(this._showOverdrawInspector?"/overdraw":"")+(o?"/terrain":"")+(n?`/${n.join("/")}`:"");return this.cache[d]||=new ra(this.context,ie[t],i,rI[t],this._showOverdrawInspector,o,s,l,n),this.cache[d]}setCustomLayerDefaults(){this.context.setCustomLayerDefaults()}setBaseState(){let t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;let t=this.context.gl;this.debugOverlayTexture=new E.yt(this.context,this.debugOverlayCanvas,t.RGBA)}}destroy(){if(this._tileTextures){for(let t in this._tileTextures){let i=this._tileTextures[t];if(i)for(let t of i)t.destroy()}this._tileTextures={}}for(let t of this._rttObjectRecyclePool)t.texture.destroy();if(this._rttObjectRecyclePool=[],this._rttSharedFbo){this._rttSharedFbo.fbo.colorAttachment.set(null),this._rttSharedFbo.fbo.depthAttachment.set(null);let t=this.context.gl;t.deleteRenderbuffer(this._rttSharedFbo.depthRenderbuffer),t.deleteFramebuffer(this._rttSharedFbo.fbo.framebuffer),this._rttSharedFbo=null}if(this.layerOpacityFbo?.destroy(),this.layerOpacityFbo=null,this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&this.tileExtentMesh.vertexBuffer?.destroy(),this.tileExtentMesh&&this.tileExtentMesh.indexBuffer?.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.context.projectionUniformBuffer.destroy(),this.context.terrainUniformBuffer.destroy(),this.context.frameUniformBuffer.destroy(),this.cache){for(let t in this.cache){let i=this.cache[t];i?.program&&this.context.gl.deleteProgram(i.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:i}=this.context.gl;return this.width!==t||this.height!==i}},nZ=class extends Error{constructor(t,i){super("WebGL2 is required to display this map. We are sorry, but it seems that your browser does not support WebGL2, a technology for rendering 3D graphics on the web. Read more on https://wiki.openstreetmap.org/wiki/This_map_requires_WebGL"),this.name="GPUInitializationError",this.requestedAttributes=t,this.statusMessage=i?.statusMessage??null}};function nK(t,i){let r=!1,n=null,o,a=()=>{n=null,r&&=(t(...o),n=setTimeout(a,i),!1)};return(...t)=>(r=!0,o=t,n||a(),n)}var nJ=class{constructor(t){this._getHashParams=()=>new URLSearchParams(window.location.hash.replace("#","")),this._getCurrentHash=()=>{let t=this._getHashParams();return this._hashName?(t.get(this._hashName)||"").split("/"):([...t.keys()][0]??"").split("/")},this._onHashChange=()=>{let t=this._getCurrentHash();if(!this._isValidHash(t))return!1;let i=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:i,pitch:+(t[4]||0)}),!0},this._updateHashUnthrottled=()=>{let t=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,t)},this._removeHash=()=>{let t=this._getHashParams();if(this._hashName)t.delete(this._hashName);else{let i=Array.from(t.keys());i.length>0&&t.delete(i[0])}let i=decodeURIComponent(t.toString()).replace(/=&/g,"&").replace(/=$/g,""),r=i?`#${i}`:"",n=window.location.href.replace(/(#.+)?$/,r);n=n.replace("&&","&"),window.history.replaceState(window.history.state,null,n)},this._updateHash=nK(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,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(t){let i=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,n=10**Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.round(i.lng*n)/n,a=Math.round(i.lat*n)/n,s=this._map.getBearing(),l=this._map.getPitch(),c="";if(c+=t?`/${o}/${a}/${r}`:`${r}/${a}/${o}`,(s||l)&&(c+=`/${Math.round(10*s)/10}`),l&&(c+=`/${Math.round(l)}`),this._hashName){let t=this._getHashParams();return t.set(this._hashName,c),`#${decodeURIComponent(t.toString()).replace(/=&/g,"&").replace(/=$/g,"")}`}return`#${c}`}_isValidHash(t){if(t.length<3||t.some(t=>isNaN(+t)))return!1;try{new E.st(+t[2],+t[1])}catch{return!1}let i=+t[0],r=+(t[3]||0),n=+(t[4]||0);return i>=this._map.getMinZoom()&&i<=this._map.getMaxZoom()&&r>=-180&&r<=180&&n>=this._map.getMinPitch()&&n<=this._map.getMaxPitch()}};let nX={linearity:.3,easing:(0,E.Bn)(0,0,.3,1)},nQ=(0,E.tr)({deceleration:2500,maxSpeed:1400},nX),n0=(0,E.tr)({deceleration:20,maxSpeed:1400},nX),n1=(0,E.tr)({deceleration:1e3,maxSpeed:360},nX),n2=(0,E.tr)({deceleration:1e3,maxSpeed:90},nX),n3=(0,E.tr)({deceleration:1e3,maxSpeed:360},nX);var n5=class{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:A(),settings:t})}_drainInertiaBuffer(){let t=this._inertiaBuffer,i=A();for(;t.length>0&&i-t[0].time>160;)t.shift()}_getVelocityEntries(){let t=this._inertiaBuffer,i=A()-60,r=Math.max(0,t.length-2);for(;r>0&&t[r-1].time>=i;)r--;return t.slice(r)}_onMoveEnd(t){this._drainInertiaBuffer();let i=this._getVelocityEntries();if(i.length<2)return void this.clear();let r={zoom:0,bearing:0,pitch:0,roll:0,pan:new E.Ri(0,0),pinchAround:void 0,around:void 0};for(let{settings:t}of i)t.around&&(r.around=t.around),t.pinchAround&&(r.pinchAround=t.pinchAround);for(let{settings:t}of i.slice(1))r.zoom+=t.zoomDelta||0,r.bearing+=t.bearingDelta||0,r.pitch+=t.pitchDelta||0,r.roll+=t.rollDelta||0,t.panDelta&&r.pan._add(t.panDelta);if(!r.pan.mag()&&!r.zoom&&!r.bearing&&!r.pitch&&!r.roll)return void this.clear();let n=A()-i[0].time,o={};if(r.pan.mag()){let i=n6(r.pan.mag(),n,(0,E.tr)({},nQ,t||{})),a=r.pan.mult(i.amount/r.pan.mag()),s=this._map._camera.cameraHelper.handlePanInertia(a,this._map._camera.transform);o.center=s.easingCenter,o.offset=s.easingOffset,n4(o,i)}if(r.zoom){let t=n6(r.zoom,n,n0);o.zoom=(0,E.er)(this._map.getZoom()+t.amount,this._map.getZoomSnap(),t.amount),n4(o,t)}if(r.bearing){let t=n6(r.bearing,n,n1);o.bearing=this._map.getBearing()+(0,E.Vn)(t.amount,-179,179),n4(o,t)}if(r.pitch){let t=n6(r.pitch,n,n2);o.pitch=this._map.getPitch()+t.amount,n4(o,t)}if(r.roll){let t=n6(r.roll,n,n3);o.roll=this._map.getRoll()+(0,E.Vn)(t.amount,-179,179),n4(o,t)}if(o.zoom||o.bearing){let t=void 0===r.pinchAround?r.around:r.pinchAround;o.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),(0,E.tr)(o,{noMoveStart:!0})}};function n4(t,i){(!t.duration||t.duration<i.duration)&&(t.duration=i.duration,t.easing=i.easing)}function n6(t,i,r){let{maxSpeed:n,linearity:o,deceleration:a}=r,s=(0,E.Vn)(t*o/(i/1e3),-n,n),l=Math.abs(s)/(a*o);return{easing:r.easing,duration:1e3*l,amount:l/2*s}}var n8=class{constructor(t,i){this._map=t,this._clickTolerance=i.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new U(this._map,t))}mousedown(t,i){return this._mousedownPos=i,this._firePreventable(new j(t.type,this._map,t))}mouseup(t){this._map.fire(new j(t.type,this._map,t))}click(t,i){this._mousedownPos&&this._mousedownPos.dist(i)>=this._clickTolerance||this._map.fire(new j(t.type,this._map,t))}dblclick(t){return this._firePreventable(new j(t.type,this._map,t))}mouseover(t){this._map.fire(new j(t.type,this._map,t))}mouseout(t){this._map.fire(new j(t.type,this._map,t))}touchstart(t){return this._firePreventable(new N(t.type,this._map,t))}touchmove(t){this._map.fire(new N(t.type,this._map,t))}touchend(t){this._map.fire(new N(t.type,this._map,t))}touchcancel(t){this._map.fire(new N(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},n7=class{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new j(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new j("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new j(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},n9=class{constructor(t,i,r){this._map=t,this._tr=r,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=i.clickTolerance||1,i.boxZoom&&"object"==typeof i.boxZoom&&(this._boxZoomEnd=i.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,i){this.isEnabled()&&t.shiftKey&&0===t.button&&(P.disableDrag(),this._startPos=this._lastPos=i,this._active=!0)}mousemoveWindow(t,i){if(!this._active||this._lastPos.equals(i)||!this._box&&i.dist(this._startPos)<this._clickTolerance)return;let r=this._startPos;this._lastPos=i,this._box||(this._box=P.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));let n=Math.min(r.x,i.x),o=Math.max(r.x,i.x),a=Math.min(r.y,i.y),s=Math.max(r.y,i.y);this._box.style.transform=`translate(${n}px,${a}px)`,this._box.style.width=`${o-n}px`,this._box.style.height=`${s-a}px`}mouseupWindow(t,i){if(!this._active||0!==t.button)return;let r=this._startPos;if(this.reset(),P.suppressClick(),r.x!==i.x||r.y!==i.y)return(this._map.fire(new H("boxzoomend",{originalEvent:t})),this._boxZoomEnd)?void this._boxZoomEnd(this._map,r,i,t):{cameraAnimation:t=>t.fitScreenCoordinates(r,i,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&=(this._box.remove(),null),P.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,i){return this._map.fire(new H(t,{originalEvent:i}))}};function oe(t,i){if(t.length!==i.length)throw Error(`The number of touches and points are not equal - touches ${t.length}, points ${i.length}`);let r={};for(let n=0;n<t.length;n++)r[t[n].identifier]=i[n];return r}var ot=class{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,i,r){(this.centroid||r.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),r.length===this.numTouches&&(this.centroid=function(t){let i=new E.Ri(0,0);for(let r of t)i._add(r);return i.div(t.length)}(i),this.touches=oe(r,i)))}touchmove(t,i,r){if(this.aborted||!this.centroid)return;let n=oe(r,i);for(let t in this.touches){let i=this.touches[t],r=n[t];(!r||r.dist(i)>30)&&(this.aborted=!0)}}touchend(t,i,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){let t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}},oi=class{constructor(t){this.singleTap=new ot(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,i,r){this.singleTap.touchstart(t,i,r)}touchmove(t,i,r){this.singleTap.touchmove(t,i,r)}touchend(t,i,r){let n=this.singleTap.touchend(t,i,r);if(n){let i=t.timeStamp-this.lastTime<500,r=!this.lastTap||30>this.lastTap.dist(n);if(i&&r||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}},or=class{constructor(t,i){this._tr=i,this._zoomIn=new oi({numTouches:1,numTaps:2}),this._zoomOut=new oi({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,i,r){this._zoomIn.touchstart(t,i,r),this._zoomOut.touchstart(t,i,r)}touchmove(t,i,r){this._zoomIn.touchmove(t,i,r),this._zoomOut.touchmove(t,i,r)}touchend(t,i,r){let n=this._zoomIn.touchend(t,i,r),o=this._zoomOut.touchend(t,i,r),a=this._tr;return n?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:i=>i.easeTo({duration:300,zoom:(0,E.er)(a.zoom+1,i.getZoomSnap()),around:a.unproject(n)},{originalEvent:t})}):o?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:i=>i.easeTo({duration:300,zoom:(0,E.er)(a.zoom-1,i.getZoomSnap()),around:a.unproject(o)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},on=class{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){let i=this._moveFunction(...t);if(i.bearingDelta||i.pitchDelta||i.rollDelta||i.around||i.panDelta)return this._active=!0,i}dragStart(t,i){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=Array.isArray(i)?i[0]:i,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,i){if(!this.isEnabled())return;let r=this._lastPoint;if(!r)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);let n=Array.isArray(i)?i[0]:i;if(!(!this._moved&&n.dist(r)<this._clickTolerance))return this._moved=!0,this._lastPoint=n,this._move(r,n)}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&P.suppressClick(),this.reset(t))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}};let oo={0:1,2:2};var oa=class{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){this._eventButton=t.button}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){let i;return i=oo[this._eventButton],void 0!==t.buttons&&(t.buttons&i)===i}isValidEndEvent(t){return t.button===this._eventButton}},os=class{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return 1===t.targetTouches.length}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}},ol=class{constructor(t=new oa({checkCorrectEvent:()=>!0}),i=new os){this.mouseMoveStateManager=t,this.oneFingerTouchMoveStateManager=i}_executeRelevantHandler(t,i,r){return t instanceof MouseEvent?i(t):"u">typeof TouchEvent&&t instanceof TouchEvent?r(t):void 0}startMove(t){this._executeRelevantHandler(t,t=>{this.mouseMoveStateManager.startMove(t)},t=>{this.oneFingerTouchMoveStateManager.startMove(t)})}endMove(t){this._executeRelevantHandler(t,t=>{this.mouseMoveStateManager.endMove(t)},t=>{this.oneFingerTouchMoveStateManager.endMove(t)})}isValidStartEvent(t){return!!this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidStartEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidStartEvent(t))}isValidMoveEvent(t){return!!this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidMoveEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(t))}isValidEndEvent(t){return!!this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidEndEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidEndEvent(t))}};let oc=t=>{t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=t=>{t.preventDefault()}};var od=class{constructor(t,i){this._clickTolerance=t.clickTolerance||1,this._map=i,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new E.Ri(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,i,r){return this._calculateTransform(t,i,r)}touchmove(t,i,r){if(this._active)return this._shouldBePrevented(r.length)?void this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t):(t.preventDefault(),this._calculateTransform(t,i,r))}touchend(t,i,r){this._calculateTransform(t,i,r),this._active&&this._shouldBePrevented(r.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,i,r){r.length>0&&(this._active=!0);let n=oe(r,i),o=new E.Ri(0,0),a=new E.Ri(0,0),s=0;for(let t in n){let i=n[t],r=this._touches[t];r&&(o._add(i),a._add(i.sub(r)),s++,n[t]=i)}if(this._touches=n,this._shouldBePrevented(s)||!a.mag())return;let l=a.div(s);if(this._sum._add(l),!(this._sum.mag()<this._clickTolerance))return{around:o.div(s),panDelta:l}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},ou=class{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,i,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([i[0],i[1]]))}touchmove(t,i,r){if(!this._firstTwoTouches)return;t.preventDefault();let[n,o]=this._firstTwoTouches,a=oh(r,i,n),s=oh(r,i,o);if(!a||!s)return;let l=this._aroundCenter?null:a.add(s).div(2);return this._move([a,s],l,t)}touchend(t,i,r){if(!this._firstTwoTouches)return;let[n,o]=this._firstTwoTouches,a=oh(r,i,n),s=oh(r,i,o);a&&s||(this._active&&P.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}};function oh(t,i,r){for(let n=0;n<t.length;n++)if(t[n].identifier===r)return i[n]}function om(t,i){return Math.log(t/i)/Math.LN2}var of=class extends ou{constructor(){super(),this._zoomRate=1,this._zoomThreshold=.1}setZoomRate(t){this._zoomRate=t??1}setZoomThreshold(t){this._zoomThreshold=t??.1}reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,i){let r=this._distance;if(this._distance=t[0].dist(t[1]),!(!this._active&&Math.abs(om(this._distance,this._startDistance))<this._zoomThreshold))return this._active=!0,{zoomDelta:om(this._distance,r)*this._zoomRate,pinchAround:i}}};function op(t,i){return 180*t.angleWith(i)/Math.PI}var o_=class extends ou{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,i,r){let n=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:op(this._vector,n),pinchAround:i}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());let i=25/(Math.PI*this._minDiameter)*360;return Math.abs(op(t,this._startVector))<i}};function og(t){return Math.abs(t.y)>Math.abs(t.x)}var ob=class extends ou{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,i,r){super.touchstart(t,i,r),this._currentTouchCount=r.length}_start(t){this._lastPoints=t,og(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,i,r){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let n=t[0].sub(this._lastPoints[0]),o=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,o,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:-((n.y+o.y)/2*.5)}}gestureBeginsVertically(t,i,r){if(void 0!==this._valid)return this._valid;let n=t.mag()>=2,o=i.mag()>=2;if(!n&&!o)return;if(!n||!o)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;let a=t.y>0==i.y>0;return og(t)&&og(i)&&a}};let oy=100,ov=15,oF=10;var ox=class{constructor(t,i){this._tr=i,this._panStep=oy,this._bearingStep=ov,this._pitchStep=oF,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let i=0,r=0,n=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:i=1;break;case 189:case 109:case 173:i=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,n=0),{cameraAnimation:s=>{let l=this._tr;s.easeTo({duration:300,easeId:"keyboardHandler",easing:ow,zoom:i?(0,E.er)(l.zoom+i*(t.shiftKey?2:1),s.getZoomSnap()):l.zoom,bearing:l.bearing+r*this._bearingStep,pitch:l.pitch+n*this._pitchStep,offset:[-o*this._panStep,-a*this._panStep],center:l.center},{originalEvent:t})}}}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 ow(t){return t*(2-t)}var oE=class{constructor(t,i,r){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},this._map=t,this._tr=r,this._triggerRenderFrame=i,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let i=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,r=A(),n=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==i&&i%4.000244140625==0?this._type="wheel":0!==i&&4>Math.abs(i)?this._type="trackpad":n>400?(this._type=null,this._lastValue=i,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=200>Math.abs(n*i)?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),t.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=t,this._delta-=i,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._needsRerender=!1,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let i=P.mousePos(this._map.getCanvas(),t),r=this._tr;this._aroundPoint=this._aroundCenter?r.transform.locationToScreenPoint(E.st.convert(r.center)):i,this._needsRerender||(this._needsRerender=!0,this._triggerRenderFrame())}renderFrame(){if(!this._needsRerender||(this._needsRerender=!1,!this.isActive()))return;let t=this._tr.transform;if("number"==typeof this._lastExpectedZoom){let i=t.zoom-this._lastExpectedZoom;"number"==typeof this._startZoom&&(this._startZoom+=i),"number"==typeof this._targetZoom&&(this._targetZoom+=i)}if(0!==this._delta){let i="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,r=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==r&&(r=1/r);let n="number"==typeof this._targetZoom?(0,E.Ir)(this._targetZoom):t.scale,o=t.applyConstrain(t.getCameraLngLat(),(0,E.Or)(n*r)).zoom,a=this._map.getZoomSnap();if("wheel"===this._type&&a>0){let i=(0,E.er)(t.zoom,a);this._targetZoom=(0,E.er)(o,a,o-i)}else this._targetZoom=o;"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let i="number"==typeof this._targetZoom?this._targetZoom:t.zoom,r=this._startZoom,n=this._easing,o=!1,a;if("wheel"===this._type&&r&&n){let t=Math.min((A()-this._lastWheelEventTime+5)/200,1),s=n(t);a=E.dn.number(r,i,s),t<1?this._needsRerender=!0:o=!0}else a=i,o=!0;return this._active=!0,o&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=a,{noInertia:!0,needsRenderFrame:!o,zoomDelta:a-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let i=E.Yn;if(this._prevEase){let t=this._prevEase,r=(A()-t.start)/t.duration,n=t.easing(r+.01)-t.easing(r),o=.27/Math.sqrt(n*n+1e-4)*.01,a=Math.sqrt(.0729-o*o);i=(0,E.Bn)(o,a,.25,1)}return this._prevEase={start:A(),duration:t,easing:i},i}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}},ok=class{constructor(t,i){this._clickZoom=t,this._tapZoom=i}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()}},oM=class{constructor(t,i){this._tr=i,this.reset()}reset(){this._active=!1}dblclick(t,i){return t.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:(0,E.er)(this._tr.zoom+(t.shiftKey?-1:1),r.getZoomSnap()),around:this._tr.unproject(i)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},oD=class{constructor(){this._tap=new oi({numTouches:1,numTaps:1}),this._zoomRate=1,this.reset()}setZoomRate(t){this._zoomRate=t??1}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,i,r){if(!this._swipePoint)if(this._tapTime){let n=i[0],o=t.timeStamp-this._tapTime<500,a=30>this._tapPoint.dist(n);o&&a?r.length>0&&(this._swipePoint=n,this._swipeTouch=r[0].identifier):this.reset()}else this._tap.touchstart(t,i,r)}touchmove(t,i,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;let n=i[0],o=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:o/128*this._zoomRate}}}else this._tap.touchmove(t,i,r)}touchend(t,i,r){if(this._tapTime)this._swipePoint&&0===r.length&&this.reset();else{let n=this._tap.touchend(t,i,r);n&&(this._tapTime=t.timeStamp,this._tapPoint=n)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},oT=class{constructor(t,i,r){this._el=t,this._mousePan=i,this._touchPan=r}enable(t){this._inertiaOptions=t||{},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()}},oA=class{constructor(t,i,r,n){this._pitchWithRotate=t.pitchWithRotate,this._rollEnabled=t.rollEnabled,this._mouseRotate=i,this._mousePitch=r,this._mouseRoll=n}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}},oC=class{constructor(t,i,r,n){this._el=t,this._touchZoom=i,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),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()}setZoomRate(t){this._touchZoom.setZoomRate(t),this._tapDragZoom.setZoomRate(t)}setZoomThreshold(t){this._touchZoom.setZoomThreshold(t)}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}},oS=class{constructor(t,i){this._bypassKey=navigator.userAgent.includes("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=i,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=P.create("div","maplibregl-cooperative-gesture-screen",t);let i=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(i=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let r=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),n=document.createElement("div");n.className="maplibregl-desktop-message",n.textContent=i,this._container.appendChild(n);let o=document.createElement("div");o.className="maplibregl-mobile-message",o.textContent=r,this._container.appendChild(o),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(this._container.remove(),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(t){return t[this._bypassKey]}notifyGestureBlocked(t,i){this._enabled&&(this._map.fire(new R("cooperativegestureprevented",{gestureType:t,originalEvent:i})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}},oL=class{constructor(t){this._camera=t}get transform(){return this._camera._requestedCameraState||this._camera.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(t){return this.transform.screenPointToLocation(E.Ri.convert(t),this._camera.terrain)}};let oP=t=>t.zoom||t.drag||t.roll||t.pitch||t.rotate;var oI=class extends E.vn{};function oR(t){return t.panDelta?.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta||t.rollDelta}var oB=class{get _ownerDocument(){return this._el?.ownerDocument||document}get _ownerWindow(){return this._el?.ownerDocument?.defaultView||window}constructor(t,i,r){this._terrainGestureAnchorElevation=null,this.handleWindowEvent=t=>{this.handleEvent(t,`${t.type}Window`)},this.handleEvent=(t,i)=>{if("blur"===t.type)return void this.stop(!0);this._updatingCamera=!0;let r="renderFrame"===t.type?void 0:t,n={needsRenderFrame:!1},o={},a={};for(let{handlerName:s,handler:l,allowed:c}of this._handlers){let d;if(l.isEnabled()){if(this._blockedByActive(a,c,s))l.reset();else if(l[i||t.type]){if((0,E.ur)(t,i||t.type)){let r=P.mousePos(this._map.getCanvas(),t);d=l[i||t.type](t,r)}else if((0,E.fr)(t,i||t.type)){let r=t.touches,n=this._getMapTouches(r),o=P.touchPos(this._map.getCanvas(),n);d=l[i||t.type](t,o,n)}else(0,E.pr)(i||t.type)||(d=l[i||t.type](t));this.mergeHandlerResult(n,o,d,s,r),d?.needsRenderFrame&&this._triggerRenderFrame()}(d||l.isActive())&&(a[s]=l)}}let s={};for(let t in this._previousActiveHandlers)a[t]||(s[t]=r);this._previousActiveHandlers=a,(Object.keys(s).length||oR(n))&&(this._changes.push([n,o,s]),this._triggerRenderFrame()),(Object.keys(a).length||oR(n))&&this._camera.stop(!0),this._updatingCamera=!1;let{cameraAnimation:l}=n;l&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],l(this._map))},this._map=t,this._camera=i,this._transformProvider=new oL(this._camera),this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new n5(t),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(r);let n=this._el;for(let[t,i,r]of(this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]],this._listeners))t.addEventListener(i,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,r)}destroy(){for(let[t,i,r]of this._listeners)t.removeEventListener(i,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,r)}_addDefaultHandlers(t){let i=this._map,r=i.getCanvasContainer();this._add("mapEvent",new n8(i,t));let n=i.boxZoom=new n9(i,t,this._transformProvider);this._add("boxZoom",n),t.interactive&&t.boxZoom&&n.enable();let o=i.cooperativeGestures=new oS(i,t.cooperativeGestures);this._add("cooperativeGestures",o),t.cooperativeGestures&&o.enable();let a=new or(i,this._transformProvider),s=new oM(i,this._transformProvider);i.doubleClickZoom=new ok(s,a),this._add("tapZoom",a),this._add("clickZoom",s),t.interactive&&t.doubleClickZoom&&i.doubleClickZoom.enable();let l=new oD;this._add("tapDragZoom",l);let c=i.touchPitch=new ob(i);this._add("touchPitch",c),t.interactive&&t.touchPitch&&i.touchPitch.enable(t.touchPitch);let d=()=>i.project(i.getCenter()),u=function({enable:t,clickTolerance:i,aroundCenter:r=!0,minPixelCenterThreshold:n=100,rotateSpeed:o=.8},a){return new on({clickTolerance:i,move:(t,i)=>{let s=a();if(r&&Math.abs(s.y-t.y)>n)return{bearingDelta:(0,E.ar)(new E.Ri(t.x,i.y),i,s)};let l=(i.x-t.x)*o;return r&&i.y<s.y&&(l=-l),{bearingDelta:l}},moveStateManager:new oa({checkCorrectEvent:t=>0===t.button&&t.ctrlKey||2===t.button&&!t.ctrlKey}),enable:t,assignEvents:oc})}(t,d),h=function({enable:t,clickTolerance:i,pitchSpeed:r=-.5}){return new on({clickTolerance:i,move:(t,i)=>({pitchDelta:(i.y-t.y)*r}),moveStateManager:new oa({checkCorrectEvent:t=>0===t.button&&t.ctrlKey||2===t.button}),enable:t,assignEvents:oc})}(t),m=function({enable:t,clickTolerance:i,rollDegreesPerPixelMoved:r=.3},n){return new on({clickTolerance:i,move:(t,i)=>{let o=n(),a=(i.x-t.x)*r;return i.y<o.y&&(a=-a),{rollDelta:a}},moveStateManager:new oa({checkCorrectEvent:t=>2===t.button&&t.ctrlKey}),enable:t,assignEvents:oc})}(t,d);i.dragRotate=new oA(t,u,h,m),this._add("mouseRotate",u,["mousePitch"]),this._add("mousePitch",h,["mouseRotate","mouseRoll"]),this._add("mouseRoll",m,["mousePitch"]),t.interactive&&t.dragRotate&&i.dragRotate.enable();let f=function({enable:t,clickTolerance:i}){return new on({clickTolerance:i,move:(t,i)=>({around:i,panDelta:i.sub(t)}),activateOnStart:!0,moveStateManager:new oa({checkCorrectEvent:t=>0===t.button&&!t.ctrlKey}),enable:t,assignEvents:oc})}(t),p=new od(t,i);i.dragPan=new oT(r,f,p),this._add("mousePan",f),this._add("touchPan",p,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&i.dragPan.enable(t.dragPan);let _=new o_,g=new of;i.touchZoomRotate=new oC(r,g,_,l),this._add("touchRotate",_,["touchPan","touchZoom"]),this._add("touchZoom",g,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&i.touchZoomRotate.enable(t.touchZoomRotate),this._add("blockableMapEvent",new n7(i));let b=i.scrollZoom=new oE(i,()=>this._triggerRenderFrame(),this._transformProvider);this._add("scrollZoom",b,["mousePan"]),t.interactive&&t.scrollZoom&&i.scrollZoom.enable(t.scrollZoom);let y=i.keyboard=new ox(i,this._transformProvider);this._add("keyboard",y),t.interactive&&t.keyboard&&i.keyboard.enable()}_add(t,i,r){this._handlers.push({handlerName:t,handler:i,allowed:r}),this._handlersById[t]=i}stop(t){if(!this._updatingCamera){for(let{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(let{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!oP(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,i,r){for(let n in t)if(n!==r&&!i?.includes(n))return!0;return!1}_getMapTouches(t){let i=[];for(let r of t){let t=r.target;this._el.contains(t)&&i.push(r)}return i}mergeHandlerResult(t,i,r,n,o){if(!r)return;(0,E.tr)(t,r);let a={handlerName:n,originalEvent:r.originalEvent||o};void 0!==r.zoomDelta&&(i.zoom=a),void 0!==r.panDelta&&(i.drag=a),void 0!==r.rollDelta&&(i.roll=a),void 0!==r.pitchDelta&&(i.pitch=a),void 0!==r.bearingDelta&&(i.rotate=a)}_applyChanges(){let t={},i={},r={};for(let[n,o,a]of this._changes)n.panDelta&&(t.panDelta=(t.panDelta||new E.Ri(0,0))._add(n.panDelta)),n.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+n.zoomDelta),n.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+n.bearingDelta),n.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+n.pitchDelta),n.rollDelta&&(t.rollDelta=(t.rollDelta||0)+n.rollDelta),void 0!==n.around&&(t.around=n.around),void 0!==n.pinchAround&&(t.pinchAround=n.pinchAround),n.noInertia&&(t.noInertia=n.noInertia),(0,E.tr)(i,o),(0,E.tr)(r,a);this._updateMapTransform(t,i,r),this._changes=[]}_updateMapTransform(t,i,r){let n=this._map,o=this._camera.getTransformForUpdate(),a=n.terrain;if(!oR(t)&&!(a&&this._terrainMovement))return void this._fireEvents(i,r,!0);this._camera.stop(!0);let{panDelta:s,zoomDelta:l,bearingDelta:c,pitchDelta:d,rollDelta:u}=t,{around:h,aroundOnSurface:m}=this._resolveAround(t,a,o),f=a?this._terrainGestureElevation(a,h,m,o,i):void 0,p={panDelta:s,zoomDelta:l,rollDelta:u,pitchDelta:d,bearingDelta:c,around:h,aroundElevation:f};this._camera.cameraHelper.useGlobeControls&&!o.isPointOnMapSurface(h)&&(h=o.centerPoint);let _=this._computePreZoomAroundLoc(o,h,s,f);this._handleMapControls({terrain:a,tr:o,deltasForHelper:p,preZoomAroundLoc:_,combinedEventsInProgress:i,panDelta:s}),this._camera.applyUpdatedTransform(o),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(i,r,!0)}_resolveAround(t,i,r){let n=void 0===t.pinchAround?t.around:t.pinchAround;return n||=this._camera.transform.centerPoint,i&&!r.isPointOnMapSurface(n)?{around:r.centerPoint,aroundOnSurface:!1}:{around:n,aroundOnSurface:!0}}_terrainGestureElevation(t,i,r,n,o){if(!r)return;if(!this._terrainMovement&&(o.drag||o.zoom)){let r=n.screenTerrainPointToMercatorCoordinate(i,t);this._terrainGestureAnchorElevation=r?r.z:null}if(null===this._terrainGestureAnchorElevation)return;let a=this._terrainGestureAnchorElevation;if(!(.01>i.distSqr(n.centerPoint))&&!(a-n.elevation>=.9*(n.getCameraAltitude()-n.elevation)))return a}_computePreZoomAroundLoc(t,i,r,n){if(.01>i.distSqr(t.centerPoint))return t.center;let o=r?i.sub(r):i;return void 0===n?t.screenPointToLocation(o):t.screenPointToLocationAtElevation(o,n)}_handleMapControls({terrain:t,tr:i,deltasForHelper:r,preZoomAroundLoc:n,combinedEventsInProgress:o,panDelta:a}){let s=this._camera.cameraHelper;if(s.handleMapControlsRollPitchBearingZoom(r,i),!t)return void s.handleMapControlsPan(r,i,n);if(s.useGlobeControls){!this._terrainMovement&&(o.drag||o.zoom)&&(this._terrainMovement=!0,this._camera.elevationFreeze=!0),s.handleMapControlsPan(r,i,n);return}if(!this._terrainMovement&&(o.drag||o.zoom)){this._terrainMovement=!0,this._camera.elevationFreeze=!0,s.handleMapControlsPan(r,i,n);return}void 0===r.aroundElevation&&o.drag&&this._terrainMovement&&a?i.setCenter(i.screenPointToLocation(i.centerPoint.sub(a))):s.handleMapControlsPan(r,i,n)}_fireEvents(t,i,r){let n=oP(this._eventsInProgress),o=oP(t),a={};for(let i in t){let{originalEvent:r}=t[i];this._eventsInProgress[i]||(a[`${i}start`]=r),this._eventsInProgress[i]=t[i]}for(let t in!n&&o&&this._fireEvent("movestart",o.originalEvent),a)this._fireEvent(t,a[t]);for(let i in o&&this._fireEvent("move",o.originalEvent),t){let{originalEvent:r}=t[i];this._fireEvent(i,r)}let s={},l;for(let t in this._eventsInProgress){let{handlerName:r,originalEvent:n}=this._eventsInProgress[t];this._handlersById[r].isActive()||(delete this._eventsInProgress[t],l=i[r]||n,s[`${t}end`]=l)}for(let t in s)this._fireEvent(t,s[t]);let c=oP(this._eventsInProgress),d=(n||o)&&!c;if(d&&this._terrainMovement){this._camera.elevationFreeze=!1,this._terrainMovement=!1,this._terrainGestureAnchorElevation=null;let t=this._camera.getTransformForUpdate();this._map.getCenterClampedToGround()&&t.recalculateZoomAndCenter(this._map.terrain),this._camera.applyUpdatedTransform(t)}if(r&&d){this._updatingCamera=!0;let t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=t=>0!==t&&-this._bearingSnap<t&&t<this._bearingSnap;t&&(t.essential||!D.prefersReducedMotion)?(i(t.bearing||this._map.getBearing())&&(t.bearing=0),t.freezeElevation=!0,this._map.easeTo(t,{originalEvent:l})):(this._map.fire(new B("moveend",{originalEvent:l})),i(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(t,i){this._map.fire(new B(t,i?{originalEvent:i}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(t=>{delete this._frameId,this.handleEvent(new oI("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}},oO=class extends E.yn{constructor(t){super(),this._renderFrameCallback=()=>{let t=Math.min((A()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this.transform=new iv,this.cameraHelper=new iM,void 0!==t.minZoom&&this.transform.setMinZoom(t.minZoom),void 0!==t.maxZoom&&this.transform.setMaxZoom(t.maxZoom),void 0!==t.minPitch&&this.transform.setMinPitch(t.minPitch),void 0!==t.maxPitch&&this.transform.setMaxPitch(t.maxPitch),void 0!==t.renderWorldCopies&&this.transform.setRenderWorldCopies(t.renderWorldCopies),null!==t.transformConstrain&&this.transform.setConstrainOverride(t.transformConstrain),this._moving=!1,this._zooming=!1,this._bearingSnap=t.bearingSnap,this._zoomSnap=t.zoomSnap,this._requestRenderFrame=t.requestRenderFrame,this._cancelRenderFrame=t.cancelRenderFrame,this.terrain=t.terrain,this._centerClampedToGround=t.centerClampedToGround??!0,this.transformCameraUpdate=t.transformCameraUpdate??null,this._stopHandlers=t.stopHandlers??(()=>{}),this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(t,i){t.apply(this.transform,!0),this.transform=t,this.cameraHelper=i}getCenter(){return new E.st(this.transform.center.lng,this.transform.center.lat)}setCenter(t,i){return this.jumpTo({center:t},i)}getCenterElevation(){return this.transform.elevation}setCenterElevation(t,i){return this.jumpTo({elevation:t},i),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(t){this._centerClampedToGround=t}panBy(t,i,r){return t=E.Ri.convert(t).mult(-1),this.panTo(this.transform.center,(0,E.tr)({offset:t},i),r)}panTo(t,i,r){return this.easeTo((0,E.tr)({center:t},i),r)}getZoom(){return this.transform.zoom}setZoom(t,i){return this.jumpTo({zoom:t},i),this}zoomTo(t,i,r){return this.easeTo((0,E.tr)({zoom:t},i),r)}zoomIn(t,i){return this.zoomTo((0,E.er)(this.getZoom()+1,this._zoomSnap),t,i),this}zoomOut(t,i){return this.zoomTo((0,E.er)(this.getZoom()-1,this._zoomSnap),t,i),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(t,i){return t!=this.transform.fov&&(this.transform.setFov(t),this.fire(new B("movestart",i)).fire(new B("move",i)).fire(new B("moveend",i))),this}getBearing(){return this.transform.bearing}setZoomSnap(t){return this._zoomSnap=t,this}getZoomSnap(){return this._zoomSnap}setBearing(t,i){return this.jumpTo({bearing:t},i),this}getPadding(){return this.transform.padding}setPadding(t,i){return this.jumpTo({padding:t},i),this}rotateTo(t,i,r){return this.easeTo((0,E.tr)({bearing:t},i),r)}resetNorth(t,i){return this.rotateTo(0,(0,E.tr)({duration:1e3},t),i),this}resetNorthPitch(t,i){return this.easeTo((0,E.tr)({bearing:0,pitch:0,roll:0,duration:1e3},t),i),this}snapToNorth(t,i){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,i):this}getPitch(){return this.transform.pitch}setPitch(t,i){return this.jumpTo({pitch:t},i),this}getRoll(){return this.transform.roll}setRoll(t,i){return this.jumpTo({roll:t},i),this}cameraForBounds(t,i){t=eB.convert(t).adjustAntiMeridian();let r=i?.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),r,i)}_cameraForBoxAndBearing(t,i,r,n){let o={top:0,bottom:0,right:0,left:0};if("number"==typeof(n=(0,E.tr)({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},n)).padding){let t=n.padding;n.padding={top:t,bottom:t,right:t,left:t}}let a=(0,E.tr)(o,n.padding);n.padding=a;let s=this.transform,l=new eB(t,i),c=this.cameraHelper.cameraForBoxAndBearing(n,a,l,r,s);return c&&this._zoomSnap&&(c.zoom=(0,E.er)(c.zoom,this._zoomSnap,-1)),c}fitBounds(t,i,r){return this._fitInternal(this.cameraForBounds(t,i),i,r)}fitScreenCoordinates(t,i,r,n,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(E.Ri.convert(t)),this.transform.screenPointToLocation(E.Ri.convert(i)),r,n),n,o)}_fitInternal(t,i,r){return t?(i=(0,E.tr)(t,i),delete i.padding,i.linear?this.easeTo(i,r):this.flyTo(i,r)):this}jumpTo(t,i){this.stop(),"zoom"in t&&this._zoomSnap&&(t.zoom=(0,E.er)(t.zoom,this._zoomSnap));let r=this.getTransformForUpdate(),n=!1,o=!1,a=!1,s=r.zoom;this.terrain&&r.setElevation(this.terrain.getElevationForLngLat(t.center?E.st.convert(t.center):r.center,r)),this.cameraHelper.handleJumpToCenterZoom(r,t);let l=r.zoom!==s;return"elevation"in t&&r.elevation!==+t.elevation&&r.setElevation(+t.elevation),"bearing"in t&&r.bearing!==+t.bearing&&(n=!0,r.setBearing(+t.bearing)),"pitch"in t&&r.pitch!==+t.pitch&&(o=!0,r.setPitch(+t.pitch)),"roll"in t&&r.roll!==+t.roll&&(a=!0,r.setRoll(+t.roll)),null==t.padding||r.isPaddingEqual(t.padding)||r.setPadding(t.padding),this.applyUpdatedTransform(r),this.fire(new B("movestart",i)).fire(new B("move",i)),l&&this.fire(new B("zoomstart",i)).fire(new B("zoom",i)).fire(new B("zoomend",i)),n&&this.fire(new B("rotatestart",i)).fire(new B("rotate",i)).fire(new B("rotateend",i)),o&&this.fire(new B("pitchstart",i)).fire(new B("pitch",i)).fire(new B("pitchend",i)),a&&this.fire(new B("rollstart",i)).fire(new B("roll",i)).fire(new B("rollend",i)),this.fire(new B("moveend",i))}calculateCameraOptionsFromCameraLngLatAltRotation(t,i,r,n,o){let a=this.transform.calculateCenterFromCameraLngLatAlt(t,i,r,n);return{center:a.center,elevation:a.elevation,zoom:a.zoom,bearing:r,pitch:n,roll:o}}easeTo(t,i){this._stop(!1,t.easeId),"zoom"in(t=(0,E.tr)({offset:[0,0],duration:500,easing:E.Yn},t))&&this._zoomSnap&&(t.zoom=(0,E.er)(t.zoom,this._zoomSnap)),(!1===t.animate||!t.essential&&D.prefersReducedMotion)&&(t.duration=0);let r=this.getTransformForUpdate(),n=this.getBearing(),o=r.pitch,a=r.roll,s="bearing"in t?this._normalizeBearing(t.bearing,n):n,l="pitch"in t?+t.pitch:o,c="roll"in t?this._normalizeBearing(t.roll,a):a,d="padding"in t?t.padding:r.padding,u=E.Ri.convert(t.offset),h,m;t.around&&(h=E.st.convert(t.around),m=r.locationToScreenPoint(h));let f={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},p=this.cameraHelper.handleEaseTo(r,{bearing:s,pitch:l,roll:c,padding:d,around:h,aroundPoint:m,offsetAsPoint:u,offset:t.offset,zoom:t.zoom,center:t.center});return this._rotating||=n!==s,this._pitching||=l!==o,this._rolling||=c!==a,this._padding=!r.isPaddingEqual(d),this._zooming||=p.isZooming,this._easeId=t.easeId,this._prepareEase(i,t.noMoveStart,f),this.terrain&&this._prepareElevation(p.elevationCenter),this._ease(n=>{p.easeFunc(n),this.terrain&&!t.freezeElevation&&this._updateElevation(n),this.applyUpdatedTransform(r),this._fireMoveEvents(i)},r=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(i,r)},t),this}_prepareEase(t,i,r={}){this._moving=!0,i||r.moving||this.fire(new B("movestart",t)),this._zooming&&!r.zooming&&this.fire(new B("zoomstart",t)),this._rotating&&!r.rotating&&this.fire(new B("rotatestart",t)),this._pitching&&!r.pitching&&this.fire(new B("pitchstart",t)),this._rolling&&!r.rolling&&this.fire(new B("rollstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLat(t,this.transform),this.elevationFreeze=!0}_updateElevation(t){(void 0===this._elevationStart||void 0===this._elevationCenter)&&this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));let i=this.terrain.getElevationForLngLat(this._elevationCenter,this.transform);if(t<1&&i!==this._elevationTarget){let r=this._elevationTarget-this._elevationStart,n=(i-(r*t+this._elevationStart))/(1-t);this._elevationStart+=t*(r-n),this._elevationTarget=i}this.transform.setElevation(E.dn.number(this._elevationStart,this._elevationTarget,t))}_finalizeElevation(){this.elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||=this.transform.clone(),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(t){if(!this.terrain&&t.elevation>=0&&t.pitch<=90)return{};let i=t.getCameraLngLat(),r=t.getCameraAltitude(),n=this.terrain?this.terrain.getElevationForLngLatZoom(i,t.zoom):0;if(r<n){let r=t.calculateCameraOptionsFromTo(i,n,t.center,t.elevation);return{pitch:r.pitch,zoom:r.zoom}}return{}}applyUpdatedTransform(t){let i=[];if(i.push(t=>this._elevateCameraIfInsideTerrain(t)),this.transformCameraUpdate&&i.push(t=>this.transformCameraUpdate(t)),!i.length)return;let r=t.clone();for(let t of i){let i=r.clone(),{center:n,zoom:o,roll:a,pitch:s,bearing:l,elevation:c}=t(i);n&&i.setCenter(n),void 0!==c&&i.setElevation(c),void 0!==o&&i.setZoom(o),void 0!==a&&i.setRoll(a),void 0!==s&&i.setPitch(s),void 0!==l&&i.setBearing(l),r.apply(i,!1)}this.transform.apply(r,!1)}_fireMoveEvents(t){this.fire(new B("move",t)),this._zooming&&this.fire(new B("zoom",t)),this._rotating&&this.fire(new B("rotate",t)),this._pitching&&this.fire(new B("pitch",t)),this._rolling&&this.fire(new B("roll",t))}_afterEase(t,i){if(this._easeId&&i&&this._easeId===i)return;delete this._easeId;let r=this._zooming,n=this._rotating,o=this._pitching,a=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,r&&this.fire(new B("zoomend",t)),n&&this.fire(new B("rotateend",t)),o&&this.fire(new B("pitchend",t)),a&&this.fire(new B("rollend",t)),this.fire(new B("moveend",t))}flyTo(t,i){if(!t.essential&&D.prefersReducedMotion){let r=(0,E.br)(t,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(r,i)}this.stop(),"zoom"in(t=(0,E.tr)({offset:[0,0],speed:1.2,curve:1.42,easing:E.Yn},t))&&this._zoomSnap&&(t.zoom=(0,E.er)(t.zoom,this._zoomSnap));let r=this.getTransformForUpdate(),n=r.bearing,o=r.pitch,a=r.roll,s=r.padding,l="bearing"in t?this._normalizeBearing(t.bearing,n):n,c="pitch"in t?+t.pitch:o,d="roll"in t?this._normalizeBearing(t.roll,a):a,u="padding"in t?t.padding:r.padding,h=E.Ri.convert(t.offset),m=r.centerPoint.add(h),f=r.screenPointToLocation(m),p=this.cameraHelper.handleFlyTo(r,{bearing:l,pitch:c,roll:d,padding:u,locationAtOffset:f,offsetAsPoint:h,center:t.center,minZoom:t.minZoom,zoom:t.zoom}),_=t.curve,g=Math.max(r.width,r.height),b=g/p.scaleOfZoom,y=p.pixelPathLength,v=g/p.scaleOfMinZoom,F=(_=Math.min(_,Math.sqrt(v/y*2)))*_;function x(t){let i=(b*b-g*g+(t?-1:1)*F*F*y*y)/(2*(t?b:g)*F*y);return Math.log(Math.sqrt(i*i+1)-i)}function w(t){return(Math.exp(t)-Math.exp(-t))/2}function k(t){return(Math.exp(t)+Math.exp(-t))/2}let M=x(!1),T=function(t){return k(M)/k(M+_*t)},A=function(t){var i;return g*((k(M)*(w(i=M+_*t)/k(i))-w(M))/F)/y},C=(x(!0)-M)/_;if(2e-6>Math.abs(y)||!isFinite(C)){if(1e-6>Math.abs(g-b))return this.easeTo(t,i);let r=b<g?-1:1;C=Math.abs(Math.log(b/g))/_,A=()=>0,T=t=>Math.exp(r*_*t)}if("duration"in t)t.duration=+t.duration;else{let i="screenSpeed"in t?t.screenSpeed/_:+t.speed;t.duration=1e3*C/i}return t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=n!==l,this._pitching=c!==o,this._rolling=d!==a,this._padding=!r.isPaddingEqual(u),this._prepareEase(i,!1),this.terrain&&this._prepareElevation(p.targetCenter),this._ease(f=>{let _=f*C,g=1/T(_),b=A(_);this._rotating&&r.setBearing(E.dn.number(n,l,f)),this._pitching&&r.setPitch(E.dn.number(o,c,f)),this._rolling&&r.setRoll(E.dn.number(a,d,f)),this._padding&&(r.interpolatePadding(s,u,f),m=r.centerPoint.add(h)),p.easeFunc(f,g,b,m),this.terrain&&!t.freezeElevation&&this._updateElevation(f),this.applyUpdatedTransform(r),this._fireMoveEvents(i)},()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(i)},t),this}isEasing(){return!!this._easeFrameId}stop(t){return this._stop(t)}_stop(t,i){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,i)}return t||this._stopHandlers(),this}_ease(t,i,r){!1===r.animate||0===r.duration?(t(1),i()):(this._easeStart=A(),this._easeOptions=r,this._onEaseFrame=t,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,i){let r=Math.abs((t=(0,E.Fr)(t,-180,180))-i);return Math.abs(t-360-i)<r&&(t-=360),Math.abs(t+360-i)<r&&(t+=360),t}isMoving(){return this._moving}isZooming(){return this._zooming}isRotating(){return this._rotating}};let oz={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};var oY=class{constructor(t=oz){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=t=>{t&&("terrain"===t.type||"style"===t.dataType||"source"===t.dataType&&("metadata"===t.sourceDataType||"visibility"===t.sourceDataType))&&this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?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=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=P.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=P.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=P.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(){this._container.remove(),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(t,i){let r=this._map._getUIString(`AttributionControl.${i}`);t.title=r,t.setAttribute("aria-label",r)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(t=>"string"==typeof t?t:"")):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){let t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}let i=this._map.style.tileManagers;for(let r in i){let n=i[r];if(n.used||n.usedForTerrain){let i=n.getSource();i.attribution&&!t.includes(i.attribution)&&t.push(i.attribution)}}(t=t.filter(t=>String(t).trim())).sort((t,i)=>t.length-i.length);let r=(t=t.filter((i,r)=>{for(let n=r+1;n<t.length;n++)if(t[n].includes(i))return!1;return!0})).join(" | ");r!==this._attribHTML&&(this._attribHTML=r,t.length?(this._innerContainer.innerHTML=P.sanitize(r),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}},oj=class{constructor(t={}){this._updateCompact=()=>{let t=this._container.children;if(t.length){let i=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&i.classList.add("maplibregl-compact"):i.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options?.compact,this._container=P.create("div","maplibregl-ctrl");let i=P.create("a","maplibregl-ctrl-logo");return i.target="_blank",i.rel="noopener nofollow",i.href="https://maplibre.org/",i.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),i.setAttribute("rel","noopener nofollow"),this._container.appendChild(i),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}},oN=class{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){let i=++this._id;return this._queue.push({callback:t,id:i,cancelled:!1}),i}remove(t){let i=this._currentlyRunning;for(let r of i?this._queue.concat(i):this._queue)if(r.id===t){r.cancelled=!0;return}}run(t=0){if(this._currentlyRunning)throw Error("Attempting to run(), but is already running.");let i=this._currentlyRunning=this._queue;this._queue=[];let r=!1,n;for(let o of i)if(!o.cancelled){try{o.callback(t)}catch(t){r||(r=!0,n=t)}if(this._cleared)break}if(this._cleared=!1,this._currentlyRunning=!1,r)throw n}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}},oU=class{constructor(t,i,r){this._tileKeys=t.map(t=>t.key).sort().join(),this._revision=i,this._zoom=r}equals(t){return this.equalsIgnoringZoom(t)&&this._zoom===t._zoom}equalsIgnoringZoom(t){return void 0!==t&&this._tileKeys===t._tileKeys&&this._revision===t._revision}};let oH={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};var oV=class{constructor(t,i){this.needsFollowUpFrame=!1,this.painter=t,this.terrain=i,this.rttSize=i.tileManager.tileSize*i.qualityFactor}getTexture(t){return t.getRTT(this._stacks.length-1).texture}prepareForRender(t,i){let r=i!==this._lastPrepareZoom;this._lastPrepareZoom=i,this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=t._order.filter(r=>!t._layers[r].isHidden(i));let n=new Set;for(let i of this._renderableLayerIds){let r=t._layers[i],o=r.source;o&&oH[r.type]&&n.add(o)}for(let r of(this._coordsAscending={},this._rttFingerprints={},n)){let n=t.tileManagers[r];if(!n)continue;this._coordsAscending[r]={};let o=this._coordsAscending[r],a=n.getSource(),s=a instanceof eX?a.terrainTileRanges:null;for(let t of n.getVisibleCoordinates()){let i=this.terrain.tileManager.getTerrainCoords(t,s);for(let t in i)o[t]||=[],o[t].push(i[t])}this._rttFingerprints[r]={};let l=this._rttFingerprints[r],c=n.getState().revision;for(let t in o)l[t]=new oU(o[t],c,i)}for(let t of(this.needsFollowUpFrame=!1,this._renderableTiles))for(let i in this._rttFingerprints){let n=this._rttFingerprints[i][t.tileID.key],o=t.rttFingerprint[i];n&&!n.equals(o)&&(r&&n.equalsIgnoringZoom(o)?this.needsFollowUpFrame=!0:t.releaseRTT(this.painter))}}renderLayer(t,i){if(t.isHidden(this.painter.transform.zoom))return!1;let r={...i,isRenderingToTexture:!0},n=t.type,o=this.painter,a=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(oH[n]&&(this._prevType&&oH[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(t.id),!a))return!0;if(oH[this._prevType]||oH[n]&&a){this._prevType=n;let t=this._stacks.length-1,i=this._stacks[t]||[];for(let n of this._renderableTiles){if(this._rttTiles.push(n),n.getRTT(t))continue;let a=n.acquireRTT(o,t,this.rttSize);for(let t of(o.bindRTT(a),o.context.clear({color:E.pn.transparent,stencil:0}),o.currentStencilSource=void 0,i)){let i=o.style._layers[t],a=i.source?this._coordsAscending[i.source][n.tileID.key]:[n.tileID];o.context.viewport.set([0,0,this.rttSize,this.rttSize]),o.renderTileClippingMasks(i,a,!0),o.renderLayer(o,o.style.tileManagers[i.source],i,a,r),i.source&&(n.rttFingerprint[i.source]=this._rttFingerprints[i.source][n.tileID.key])}a.texture.generateMipmap()}return function(t,i,r,n){let{isRenderingGlobe:o}=n,a=t.context,s=a.gl,l=t.transform,c=t.colorModeForRenderPass(),d=t.getDepthModeFor3D(),u=t.useProgram("terrain");for(let n of(a.bindFramebuffer.set(null),a.viewport.set([0,0,t.width,t.height]),r)){let r=i.getTerrainMesh(n.tileID),h=t.renderToTexture.getTexture(n),m=i.getTerrainData(n.tileID);a.activeTexture.set(s.TEXTURE0),h.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_LINEAR);let f=i4(i.getSkirtLength(l.zoom),l.calculateFogMatrix(n.tileID.toUnwrapped()),t.style.sky,l.pitch,o),p=l.getProjectionData({overscaledTileID:n.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});u.draw(a,s.TRIANGLES,d,n_.disabled,c,ng.backCCW,f,m,p,"terrain",r.vertexBuffer,r.indexBuffer,r.segments)}}(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],oH[n]}return!1}};let o$={"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":"Drag to rotate map, click to reset 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","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","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"},oq={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:oz,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 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],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:E.jn.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,rotateSpeed:.8,pitchSpeed:-.5,reduceMotion:void 0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,terrainSkirtLength:"auto",zoomLevelsToOverscale:4,anisotropicFilterPitch:20};var oG=class extends E.yn{get _ownerWindow(){return this._container?.ownerDocument?.defaultView||window}constructor(t){super(),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new oN,this._controls=[],this._mapId=(0,E.Nr)(),this._styleUrl=null,this._missingStyleImageResolver=null,this._lostContextStyle={style:null,images:null},this._contextLost=t=>{if(t.preventDefault(),this._frameRequest&&=(this._frameRequest.abort(),null),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),!this.style)return void this.fire(new q("webglcontextlost",{originalEvent:t}));for(let t of Object.values(this.style._layers))if("custom"===t.type&&console.warn(`Custom layer with id '${t.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),t._listeners)for(let[i]of Object.entries(t._listeners))console.warn(`Custom layer with id '${t.id}' had event listeners for event '${i}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.destroy(),this.style=null,this.fire(new q("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{if(this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&this.style)for(let t in this.style.imageManager.images=this._lostContextStyle.images,this._lostContextStyle.images){let i=this._lostContextStyle.images[t];i.isWebGLImage&&this.style.imageManager.updateImage(t,i,!1)}this._lostContextStyle={style:null,images:null};try{this._setupPainter()}catch(t){this.fire(new E._n(t));return}this.resize(),this._update(),this._resizeInternal(),this.fire(new q("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()};let i={...oq,...t,canvasContextAttributes:{...oq.canvasContextAttributes,...t.canvasContextAttributes}};if(null!=i.minZoom&&null!=i.maxZoom&&i.minZoom>i.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(null!=i.minPitch&&null!=i.maxPitch&&i.minPitch>i.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(null!=i.minPitch&&i.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(null!=i.maxPitch&&i.maxPitch>180)throw Error("maxPitch must be less than or equal to 180");this._camera=new oO({minZoom:i.minZoom,maxZoom:i.maxZoom,minPitch:i.minPitch,maxPitch:i.maxPitch,bearingSnap:i.bearingSnap,zoomSnap:i.zoomSnap,renderWorldCopies:i.renderWorldCopies,centerClampedToGround:i.centerClampedToGround,terrain:this.terrain,transformConstrain:i.transformConstrain,requestRenderFrame:t=>this._requestRenderFrame(t),cancelRenderFrame:t=>this._cancelRenderFrame(t),transformCameraUpdate:i.transformCameraUpdate,stopHandlers:()=>this._handlers?.stop(!1)}),this._camera.setEventedParent(this),this._interactive=i.interactive,this._maxTileCacheSize=i.maxTileCacheSize,this._maxTileCacheZoomLevels=i.maxTileCacheZoomLevels,this._canvasContextAttributes={...i.canvasContextAttributes},this._trackResize=!0===i.trackResize,this._terrainSkirtLength=i.terrainSkirtLength,this._refreshExpiredTiles=!0===i.refreshExpiredTiles,this._fadeDuration=i.fadeDuration,this._crossSourceCollisions=!0===i.crossSourceCollisions,this._collectResourceTiming=!0===i.collectResourceTiming,this._locale={...o$,...i.locale},this._clickTolerance=i.clickTolerance,this._overridePixelRatio=i.pixelRatio,this._maxCanvasSize=i.maxCanvasSize,this._zoomLevelsToOverscale=i.zoomLevelsToOverscale,this.cancelPendingTileRequestsWhileZooming=!0===i.cancelPendingTileRequestsWhileZooming,this.setAnisotropicFilterPitch(i.anisotropicFilterPitch),void 0!==i.reduceMotion&&(D.prefersReducedMotion=i.reduceMotion),this._requestManager=new I(i.transformRequest),this._container=this._resolveContainer(i.container),i.maxBounds&&this.setMaxBounds(i.maxBounds),this._setupContainer();try{this._setupPainter()}catch(t){throw this._cleanupContainer(),t}this._imageQueueHandle=s.addThrottleControl(()=>this.isMoving()),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.depthDirty=!0,this._update(!0)}),this.once("idle",()=>this._idleTriggered=!0),this._handlers=new oB(this,this._camera,i),"u">typeof window&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver());let r="string"==typeof i.hash&&i.hash||void 0;this._hash=i.hash?new nJ(r).addTo(this):void 0,this._hash?._onHashChange()||(this.jumpTo({center:i.center,elevation:i.elevation,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch,roll:i.roll}),i.bounds&&(this.resize(),this.fitBounds(i.bounds,(0,E.tr)({},i.fitBoundsOptions,{duration:0}))));let n="string"==typeof i.style||i.style?.projection?.type!=="globe";this.resize(null,n),this._localIdeographFontFamily=i.localIdeographFontFamily,this._validateStyle=i.validateStyle,i.style&&this.setStyle(i.style,{localIdeographFontFamily:i.localIdeographFontFamily}),i.attributionControl&&this.addControl(new oY("boolean"==typeof i.attributionControl?void 0:i.attributionControl)),i.maplibreLogo&&this.addControl(new oj,i.logoPosition),this.on("style.load",()=>{if(n||this._resizeTransform(),this._camera.transform.unmodified){let t=(0,E.br)(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(t)}}),this.on("data",t=>{this._update("style"===t.dataType),this.fire("style"===t.dataType?new z("styledata",t):new Y("sourcedata",t))}),this.on("dataloading",t=>{this.fire("style"===t.dataType?new z("styledataloading",t):new Y("sourcedataloading",t))}),this.on("dataabort",t=>{this.fire(new Y("sourcedataabort",t))})}_getMapId(){return this._mapId}setGlobalStateProperty(t,i){return this.style.setGlobalStateProperty(t,i),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(t,i){if(void 0===i&&(i=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t?.onAdd)return this.fire(new E._n(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let r=t.onAdd(this);this._controls.push(t);let n=this._controlPositions[i];return i.includes("bottom")?n.insertBefore(r,n.firstChild):n.appendChild(r),this}removeControl(t){if(!t?.onRemove)return this.fire(new E._n(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let i=this._controls.indexOf(t);return i>-1&&this._controls.splice(i,1),t.onRemove(this),this}hasControl(t){return this._controls.includes(t)}coveringTiles(t){return tl(this._camera.transform,t)}setTransformCameraUpdate(t){this._camera.transformCameraUpdate=t}getCenter(){return new E.st(this._camera.transform.center.lng,this._camera.transform.center.lat)}setCenter(t,i){return this._camera.setCenter(t,i),this}getCenterElevation(){return this._camera.transform.elevation}setCenterElevation(t,i){return this._camera.setCenterElevation(t,i),this}setCenterClampedToGround(t){this._camera.setCenterClampedToGround(t)}panBy(t,i,r){return this._camera.panBy(t,i,r),this}panTo(t,i,r){return this._camera.panTo(t,i,r),this}getZoom(){return this._camera.transform.zoom}setZoom(t,i){return this._camera.setZoom(t,i),this}zoomTo(t,i,r){return this._camera.zoomTo(t,i,r),this}zoomIn(t,i){return this._camera.zoomIn(t,i),this}zoomOut(t,i){return this._camera.zoomOut(t,i),this}getVerticalFieldOfView(){return this._camera.transform.fov}setVerticalFieldOfView(t,i){return this._camera.setVerticalFieldOfView(t,i),this}getBearing(){return this._camera.transform.bearing}setBearing(t,i){return this._camera.setBearing(t,i),this}getZoomSnap(){return this._camera.getZoomSnap()}setZoomSnap(t){return this._camera.setZoomSnap(t),this}getPadding(){return this._camera.transform.padding}setPadding(t,i){return this._camera.setPadding(t,i),this}rotateTo(t,i,r){return this._camera.rotateTo(t,i,r),this}resetNorth(t,i){return this._camera.resetNorth(t,i),this}resetNorthPitch(t,i){return this._camera.resetNorthPitch(t,i),this}snapToNorth(t,i){return this._camera.snapToNorth(t,i),this}getPitch(){return this._camera.transform.pitch}setPitch(t,i){return this._camera.setPitch(t,i),this}getRoll(){return this._camera.transform.roll}setRoll(t,i){return this._camera.setRoll(t,i),this}cameraForBounds(t,i){return this._camera.cameraForBounds(t,i)}fitBounds(t,i,r){return this._camera.fitBounds(t,i,r),this}fitScreenCoordinates(t,i,r,n,o){return this._camera.fitScreenCoordinates(t,i,r,n,o),this}jumpTo(t,i){return this._camera.jumpTo(t,i),this}calculateCameraOptionsFromCameraLngLatAltRotation(t,i,r,n,o){return this._camera.calculateCameraOptionsFromCameraLngLatAltRotation(t,i,r,n,o)}easeTo(t,i){return this._camera.easeTo(t,i),this}flyTo(t,i){return this._camera.flyTo(t,i),this}stop(){return this._camera.stop(),this}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLat(E.st.convert(t),this._camera.transform):null}getCenterClampedToGround(){return this._camera.getCenterClampedToGround()}calculateCameraOptionsFromTo(t,i,r,n){return null==n&&this.terrain&&(n=this.terrain.getElevationForLngLat(r,this._camera.transform)),this._camera.transform.calculateCameraOptionsFromTo(t,i,r,n??0)}resize(t,i=!0){if(null!==this._lostContextStyle.style)return this;this._resizeInternal(i);let r=!this._camera._moving;return r&&(this.stop(),this.fire(new B("movestart",t)).fire(new B("move",t))),this.fire(new R("resize",t)),r&&this.fire(new B("moveend",t)),this}_resizeInternal(t=!0){let[i,r]=this._containerDimensions(),n=this._getClampedPixelRatio(i,r);if(this._resizeCanvas(i,r,n),this.painter.resize(i,r,n),this.painter.overLimit()){let t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];let n=this._getClampedPixelRatio(i,r);this._resizeCanvas(i,r,n),this.painter.resize(i,r,n)}this._resizeTransform(t)}_resizeTransform(t=!0){let[i,r]=this._containerDimensions();this._camera.transform.resize(i,r,t),this._camera._requestedCameraState?.resize(i,r,t)}_getClampedPixelRatio(t,i){let{0:r,1:n}=this._maxCanvasSize,o=this.getPixelRatio(),a=t*o,s=i*o,l=Math.min(a>r?r/a:1,s>n?n/s:1);return l<1&&(0,E.Pr)("The canvas is larger than maxCanvasSize and is rendered at a lower pixel ratio to fit. Increase maxCanvasSize, within MAX_TEXTURE_SIZE, to render at full resolution."),l*o}getPixelRatio(){return this._overridePixelRatio??devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this._camera.transform.getBounds()}getMaxBounds(){return this._camera.transform.getMaxBounds()}setMaxBounds(t){return this._camera.transform.setMaxBounds(eB.convert(t)),this._update()}setMinZoom(t){if((t??=-2)>=-2&&t<=this._camera.transform.maxZoom){let i=this._camera.transform.zoom,r=this._camera.getTransformForUpdate();return r.setMinZoom(t),this._camera.applyUpdatedTransform(r),this._update(),i!==this._camera.transform.zoom&&this.fire(new B("zoomstart")).fire(new B("zoom")).fire(new B("zoomend")).fire(new B("movestart")).fire(new B("move")).fire(new B("moveend")),this}throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(t=!1){let i=this._camera.transform;return t?i.applyConstrain(i.center,i.minZoom).zoom:i.minZoom}setMaxZoom(t){if((t??=22)>=this._camera.transform.minZoom){let i=this._camera.transform.zoom,r=this._camera.getTransformForUpdate();return r.setMaxZoom(t),this._camera.applyUpdatedTransform(r),this._update(),i!==this._camera.transform.zoom&&this.fire(new B("zoomstart")).fire(new B("zoom")).fire(new B("zoomend")).fire(new B("movestart")).fire(new B("move")).fire(new B("moveend")),this}throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this._camera.transform.maxZoom}setMinPitch(t){if((t??=0)<0)throw Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this._camera.transform.maxPitch){let i=this._camera.transform.pitch,r=this._camera.getTransformForUpdate();return r.setMinPitch(t),this._camera.applyUpdatedTransform(r),this._update(),i!==this._camera.transform.pitch&&this.fire(new B("pitchstart")).fire(new B("pitch")).fire(new B("pitchend")).fire(new B("movestart")).fire(new B("move")).fire(new B("moveend")),this}throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this._camera.transform.minPitch}setMaxPitch(t){if((t??=60)>180)throw Error("maxPitch must be less than or equal to 180");if(t>=this._camera.transform.minPitch){let i=this._camera.transform.pitch,r=this._camera.getTransformForUpdate();return r.setMaxPitch(t),this._camera.applyUpdatedTransform(r),this._update(),i!==this._camera.transform.pitch&&this.fire(new B("pitchstart")).fire(new B("pitch")).fire(new B("pitchend")).fire(new B("movestart")).fire(new B("move")).fire(new B("moveend")),this}throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this._camera.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(t){if((t??=20)>180)throw Error("anisotropicFilterPitch must be less than or equal to 180");if(t<0)throw Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=t,this._update()}getRenderWorldCopies(){return this._camera.transform.renderWorldCopies}setRenderWorldCopies(t){return this._camera.transform.setRenderWorldCopies(t),this._update()}setTransformConstrain(t){return this._camera.transform.setConstrainOverride(t),this._update()}project(t){return this._camera.transform.locationToScreenPoint(E.st.convert(t),this.style&&this.terrain)}unproject(t){return this._camera.transform.screenPointToLocation(E.Ri.convert(t),this.terrain)}isMoving(){return this._camera.isMoving()||this._handlers?.isMoving()||!1}isZooming(){return this._camera.isZooming()||this._handlers?.isZooming()||!1}isRotating(){return this._camera.isRotating()||this._handlers?.isRotating()||!1}_createDelegatedListener(t,i,r){if("mouseenter"===t||"mouseover"===t){let n=!1;return{layers:i,listener:r,delegates:{mousemove:o=>{let a=i.filter(t=>this.getLayer(t)),s=0===a.length?[]:this.queryRenderedFeatures(o.point,{layers:a});s.length?n||(n=!0,r.call(this,new j(t,this,o.originalEvent,{features:s}))):n=!1},mouseout:()=>{n=!1}}}}if("mouseleave"===t||"mouseout"===t){let n=!1;return{layers:i,listener:r,delegates:{mousemove:o=>{let a=i.filter(t=>this.getLayer(t));(0===a.length?[]:this.queryRenderedFeatures(o.point,{layers:a})).length?n=!0:n&&(n=!1,r.call(this,new j(t,this,o.originalEvent)))},mouseout:i=>{n&&(n=!1,r.call(this,new j(t,this,i.originalEvent)))}}}}{let n=t=>{let n=i.filter(t=>this.getLayer(t)),o=0===n.length?[]:this.queryRenderedFeatures(t.point,{layers:n});o.length&&(t.features=o,r.call(this,t),delete t.features)};return{layers:i,listener:r,delegates:{[t]:n}}}}_saveDelegatedListener(t,i){this._delegatedListeners||={},this._delegatedListeners[t]||=[],this._delegatedListeners[t].push(i)}_removeDelegatedListener(t,i,r){if(!this._delegatedListeners?.[t])return;let n=this._delegatedListeners[t];for(let t=0;t<n.length;t++){let o=n[t];if(o.listener===r&&o.layers.length===i.length&&o.layers.every(t=>i.includes(t))){for(let t in o.delegates)this.off(t,o.delegates[t]);n.splice(t,1);return}}}on(t,i,r){if(void 0===r)return super.on(t,i);let n="string"==typeof i?[i]:i,o=this._createDelegatedListener(t,n,r);for(let i in this._saveDelegatedListener(t,o),o.delegates)this.on(i,o.delegates[i]);return{unsubscribe:()=>{this._removeDelegatedListener(t,n,r)}}}once(t,i,r){if(void 0===r)return super.once(t,i);let n="string"==typeof i?[i]:i,o=this._createDelegatedListener(t,n,r);for(let i in o.delegates){let a=o.delegates[i];o.delegates[i]=(...i)=>{this._removeDelegatedListener(t,n,r),a(...i)}}for(let i in this._saveDelegatedListener(t,o),o.delegates)this.once(i,o.delegates[i]);return this}off(t,i,r){if(void 0===r)return super.off(t,i);let n="string"==typeof i?[i]:i;return this._removeDelegatedListener(t,n,r),this}queryRenderedFeatures(t,i){if(!this.style)return[];let r,n=t instanceof E.Ri||Array.isArray(t),o=n?t:[[0,0],[this._camera.transform.width,this._camera.transform.height]];if(i||=(n?{}:t)||{},o instanceof E.Ri||"number"==typeof o[0])r=[E.Ri.convert(o)];else{let t=E.Ri.convert(o[0]),i=E.Ri.convert(o[1]);r=[t,new E.Ri(i.x,t.y),i,new E.Ri(t.x,i.y),t]}return this.style.queryRenderedFeatures(r,i,this._camera.transform)}querySourceFeatures(t,i){return this.style.querySourceFeatures(t,i)}setStyle(t,i){return i=(0,E.tr)({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},i),this._styleUrl="string"==typeof t?t:null,!1!==i.diff&&i.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,i),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._updateStyle(t,i))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){let i=this._locale[t];if(null==i)throw Error(`Missing UI string '${t}'`);return i}_updateStyle(t,i){if(this._diffStyleRequest?.abort(),this._diffStyleRequest=null,i.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(t,i));let r=this.style&&i.transformStyle?this.style.serialize():void 0;return(this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t)?(this.style=new i2(this,i||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t,i,r):this.style.loadJSON(t,i,r)):(this._frameRequest&&=(this._frameRequest.abort(),null),this.style?.projection?.destroy(),delete this.style),this}_lazyInitEmptyStyle(){this.style||(this.style=new i2(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}async _diffStyle(t,i){if(this._diffStyleRequest?.abort(),"string"==typeof t){this._diffStyleRequest=new AbortController;let r=this._diffStyleRequest;try{let n=await this._requestManager.transformRequest(t,"Style");if(r.signal.aborted){this._diffStyleRequest=null;return}let o=await (0,E.Cn)(n,r);this._diffStyleRequest=null,this._updateDiff(o.data,i)}catch(t){this._diffStyleRequest=null,(0,E.Nn)(t)||this.fire(new E._n((0,E.$n)(t)))}}else"object"==typeof t&&(this._diffStyleRequest=null,this._updateDiff(t,i))}_updateDiff(t,i){try{this.style.setState(t,i)&&this._update(!0)}catch(r){(0,E.Pr)(`Unable to perform style diff: ${(0,E.$n)(r).message}. Rebuilding the style from scratch.`),this._updateStyle(t,i)}}getStyle(){if(this.style)return this.style.serialize()}getStyleUrl(){return this._styleUrl}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){return this.style?this.style.loaded():void(0,E.Pr)("There is no style added to the map.")}addSource(t,i){return this._lazyInitEmptyStyle(),this.style.addSource(t,i),this._update(!0)}isSourceLoaded(t){let i=this.style?.tileManagers[t];return void 0===i?void this.fire(new E._n(Error(`There is no tile manager with ID '${t}'`))):i.loaded()}setTerrain(t,i={}){if(this.style._checkLoaded(),t&&(0,E.on)(this,E.sn.terrain,{value:t},i))return this;if(this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),t){let i=this.style.tileManagers[t.source];if(!i)throw Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);for(let r in null===this.terrain&&i.reload(),this.style._layers){let i=this.style._layers[r];"hillshade"===i.type&&i.source===t.source&&(0,E.Pr)("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),"color-relief"===i.type&&i.source===t.source&&(0,E.Pr)("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain&&this.terrain.destroy(),this.terrain=new ip(this.painter,i,t,this._terrainSkirtLength),this.painter.renderToTexture=new oV(this.painter,this.terrain),this._camera.terrain=this.terrain,this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform)),this._terrainDataCallback=i=>this._handleTerrainDataEvent(i,t.source),this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.destroy(),this.terrain=null,this.painter.renderToTexture=null,this._camera.terrain=null,this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0);return this.style.triggerSymbolPlacement(),this.fire(new V({terrain:t})),this}_handleTerrainDataEvent(t,i){if("style"===t.dataType)return void this.terrain.tileManager.releaseAllRTT();let r=t.sourceId===i;if(r&&(this.terrain.resetElevationCache(),this.style.triggerSymbolPlacement()),r&&t.tile&&!this._camera.elevationFreeze&&(this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this.getCenterClampedToGround()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform))),t.tile){if(t.source?.type==="image")return void this.terrain.tileManager.releaseAllRTT();this.terrain.tileManager.releaseRTT(t.tile.tileID)}}getTerrain(){return this.terrain?.options??null}areTilesLoaded(){for(let t of Object.values(this.style?.tileManagers))if(!t.areTilesLoaded())return!1;return!0}removeSource(t){return this.style.removeSource(t),this._update(!0)}getSource(t){return this.style?.getSource(t)}setSourceTileLodParams(t,i,r){if(r){let n=this.getSource(r);if(!n)throw Error(`There is no source with ID "${r}", cannot set LOD parameters`);n.calculateTileZoom=to(Math.max(1,t),Math.max(1,i))}else for(let r in this.style.tileManagers)this.style.tileManagers[r].getSource().calculateTileZoom=to(Math.max(1,t),Math.max(1,i));return this._update(!0),this}refreshTiles(t,i){let r=this.style.tileManagers[t];if(!r)throw Error(`There is no tile manager with ID "${t}", cannot refresh tile`);void 0===i?r.reload(!0):r.refreshTiles(i.map(t=>new E.u(t.z,t.x,t.y)))}addImage(t,i,r={}){this._lazyInitEmptyStyle();let n=this._createStyleImage(i,r);return n&&(this.style.addImage(t,n),n.userImage?.onAdd&&n.userImage.onAdd(this,t)),this}setMissingStyleImageResolver(t){return this._missingStyleImageResolver=t,this.style?.setMissingImageResolver(t),this}_createStyleImage(t,i={}){let{pixelRatio:r=1,sdf:n=!1,stretchX:o,stretchY:a,content:s,textFitWidth:l,textFitHeight:c}=i;if(t instanceof HTMLImageElement||(0,E.lr)(t)){let{width:i,height:d,data:u}=D.getImageData(t);return{data:new E.Tt({width:i,height:d},u),pixelRatio:r,stretchX:o,stretchY:a,content:s,textFitWidth:l,textFitHeight:c,sdf:n,version:0}}if(void 0===t.width||void 0===t.height)return this.fire(new E._n(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`"))),null;{let{width:i,height:d,data:u}=t,h=(0,E.I)(t.data);return{data:h?new E.Tt({width:i,height:d}):new E.Tt({width:i,height:d},new Uint8Array(u)),pixelRatio:r,stretchX:o,stretchY:a,content:s,textFitWidth:l,textFitHeight:c,sdf:n,version:0,isWebGLImage:h,userImage:t}}}updateImage(t,i){let r=this.style.getImage(t);if(!r)return this.fire(new E._n(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:n,height:o,data:a}=i instanceof HTMLImageElement||(0,E.lr)(i)?D.getImageData(i):i;if(void 0===n||void 0===o)return this.fire(new E._n(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(n!==r.data.width||o!==r.data.height)return this.fire(new E._n(Error("The width and height of the updated image must be that same as the previous version of the image")));if(r.isWebGLImage=(0,E.I)(a),r.isWebGLImage)r.userImage=i;else{let t=!(i instanceof HTMLImageElement||(0,E.lr)(i));r.data.replace(a,t)}return this.style.updateImage(t,r),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new E._n(Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}async loadImage(t){let i=await s.getImage(await this._requestManager.transformRequest(t,"Image"),new AbortController);if(!i.data)throw Error(`Could not load image ${t}: the response is empty`);return i}listImages(){return this.style?.listImages()??[]}addLayer(t,i){return this._lazyInitEmptyStyle(),this.style.addLayer(t,i),this._update(!0)}moveLayer(t,i){return this.style.moveLayer(t,i),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){return this.style?.getLayer(t)}getLayersOrder(){return this.style?.getLayersOrder()??[]}setLayerZoomRange(t,i,r){return this.style.setLayerZoomRange(t,i,r),this._update(!0)}setFilter(t,i,r={}){return this.style?.setFilter(t,i,r),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,i,r,n={}){return this.style?.setPaintProperty(t,i,r,n),this._update(!0)}getPaintProperty(t,i){return this.style.getPaintProperty(t,i)}setLayoutProperty(t,i,r,n={}){return this.style.setLayoutProperty(t,i,r,n),this._update(!0)}getLayoutProperty(t,i){return this.style.getLayoutProperty(t,i)}setGlyphs(t,i={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,i),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}setFontFaces(t){return this._lazyInitEmptyStyle(),this.style.setFontFaces(t),this._update(!0)}getFontFaces(){return this.style.getFontFaces()}addSprite(t,i,r={}){return this._lazyInitEmptyStyle(),this.style.addSprite(t,i,r,t=>{t||this._update(!0)}),this}removeSprite(t){return this._lazyInitEmptyStyle(),this.style.removeSprite(t),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(t,i={}){return this._lazyInitEmptyStyle(),this.style.setSprite(t,i,t=>{t||this._update(!0)}),this}setLight(t,i={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,i),this._update(!0)}getLight(){return this.style.getLight()}setSky(t,i={}){return this._lazyInitEmptyStyle(),this.style.setSky(t,i),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(t,i){return this.style.setFeatureState(t,i),this._update()}removeFeatureState(t,i){return this.style.removeFeatureState(t,i),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let t=0,i=0;return this._container&&(t=this._container.clientWidth||400,i=this._container.clientHeight||300),[t,i]}_setupResizeObserver(){let t=!1,i=nK(t=>{this._trackResize&&!this._removed&&(this.resize(t),this.redraw())},50),r=this._ownerWindow.ResizeObserver??ResizeObserver;this._resizeObserver=new r(r=>{if(!t){t=!0;return}i(r)}),this._resizeObserver.observe(this._container)}_resolveContainer(t){if("string"==typeof t){let i=document.getElementById(t);if(!i)throw Error(`Container '${t}' not found.`);return i}if(t instanceof HTMLElement||t&&"object"==typeof t&&1===t.nodeType)return t;throw Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){let t=this._container;t.classList.add("maplibregl-map");let i=this._canvasContainer=P.create("div","maplibregl-canvas-container",t);this._interactive&&i.classList.add("maplibregl-interactive"),this._canvas=P.create("canvas","maplibregl-canvas",i),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");let r=this._containerDimensions(),n=this._getClampedPixelRatio(r[0],r[1]);this._resizeCanvas(r[0],r[1],n);let o=this._controlContainer=P.create("div","maplibregl-control-container",t),a=this._controlPositions={};for(let t of["top-left","top-right","bottom-left","bottom-right"])a[t]=P.create("div",`maplibregl-ctrl-${t} `,o);this._container.addEventListener("scroll",this._onMapScroll,!1)}_cleanupContainer(){this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map")}_resizeCanvas(t,i,r){this._canvas.width=Math.floor(r*t),this._canvas.height=Math.floor(r*i),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${i}px`}_setupPainter(){let t={...this._canvasContextAttributes,alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0},i=null;this._canvas.addEventListener("webglcontextcreationerror",t=>{i=t},{once:!0});let r=this._canvas.getContext("webgl2",t);if(!r)throw new nZ(t,i);this.painter=new nW(r,this._camera.transform)}migrateProjection(t,i){this._camera.migrateProjection(t,i),this.painter.transform=t,this.fire(new $({newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style?._loaded&&(this._styleDirty||=t,this._sourcesDirty=!0,this.triggerRepaint()),this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_render(t){let i=this._idleTriggered?this._fadeDuration:0,r=this.style.projection?.transitionState>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let t=this._camera.transform.zoom,r=A();this.style.zoomHistory.update(t,r);let o=new E.$t(t,{now:r,fadeDuration:i,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),a=o.crossFadingFactor();(1!==a||a!==this._crossFadingFactor)&&(n=!0,this._crossFadingFactor=a),this.style.update(o)}let o=this.style.projection?.transitionState>0!==r;this._camera.transform.setTransitionState(this.style.projection?.transitionState),this.style&&(this._sourcesDirty||o)&&(this._sourcesDirty=!1,this.style._updateSources(this._camera.transform)),this.terrain?(this.terrain.tileManager.update(this._camera.transform,this.terrain)&&this.terrain.resetElevationCache(),this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),!this._camera.elevationFreeze&&this.getCenterClampedToGround()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform))):(this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0)),this._placementDirty=this.style?._updatePlacement(this._camera.transform,this.showCollisionBoxes,i,this._crossSourceCollisions,o),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:i,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new R("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new R("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let a=this._sourcesDirty||this._styleDirty||this._placementDirty||this.painter.renderToTexture?.needsFollowUpFrame;return a||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new R("idle")),!this._loaded||this._fullyLoaded||a||(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&=(this._frameRequest.abort(),null),this._render(0)),this}remove(){for(let t of(this._hash&&this._hash.remove(),this._controls))t.onRemove(this);this._controls=[],this._frameRequest&&=(this._frameRequest.abort(),null),this._renderTaskQueue.clear(),this._diffStyleRequest?.abort(),this.painter.destroy(),this._handlers.destroy(),this.setStyle(null),"u">typeof window&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),s.removeThrottleControl(this._imageQueueHandle),this._resizeObserver?.disconnect();let t=this.painter.context.gl.getExtension("WEBGL_lose_context");t?.loseContext&&t.loseContext(),this._cleanupContainer(),this._removed=!0,this.fire(new R("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,D.frame(this._frameRequest,t=>{this._frameRequest=null;try{this._render(t)}catch(t){if(!(0,E.Nn)(t))throw t}},()=>{},this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get version(){return k}getCameraTargetElevation(){return this._camera.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(t){return this._lazyInitEmptyStyle(),this.style.setProjection(t),this._update(!0)}};let oW={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};var oZ=class{constructor(t){this._updateZoomButtons=()=>{let t=this._map.getZoom(),i=t===this._map.getMaxZoom(),r=t===this._map.getMinZoom(!0);this._zoomInButton.disabled=i,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",i.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},this._rotateCompassArrow=()=>{let t=this._map.getPitch(),i=this._map.getRoll(),r=this._map.getBearing(),n=1/Math.cos((0,E.Xn)(t))**.5;if(this.options.visualizePitch&&this.options.visualizeRoll){this._compassIcon.style.transform=`scale(${n}) rotateZ(${-i}deg) rotateX(${t}deg) rotateZ(${-r}deg)`;return}if(this.options.visualizePitch){this._compassIcon.style.transform=`scale(${n}) rotateX(${t}deg) rotateZ(${-r}deg)`;return}if(this.options.visualizeRoll){this._compassIcon.style.transform=`rotate(${-r-i}deg)`;return}this._compassIcon.style.transform=`rotate(${-r}deg)`},this._setButtonTitle=(t,i)=>{let r=this._map._getUIString(`NavigationControl.${i}`);t.title=r,t.setAttribute("aria-label",r)},this.options=(0,E.tr)({},oW,t),this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),P.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),P.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=P.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("move",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new oK(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){this._container.remove(),this.options.showZoom&&this._map.off("move",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(t,i){let r=P.create("button",t,this._container);return r.type="button",r.addEventListener("click",i),r}},oK=class{constructor(t,i,r=!1){this.mousedown=t=>{this.startMove(t,P.mousePos(this.element,t)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)},this.mousemove=t=>{this.move(t,P.mousePos(this.element,t))},this.mouseup=t=>{this._rotatePitchHandler.dragEnd(t),this.offTemp()},this.touchstart=t=>{1===t.targetTouches.length?(this._startPos=this._lastPos=P.touchPos(this.element,t.targetTouches)[0],this.startMove(t,this._startPos),window.addEventListener("touchmove",this.touchmove,{passive:!1}),window.addEventListener("touchend",this.touchend)):this.reset()},this.touchmove=t=>{1===t.targetTouches.length?(this._lastPos=P.touchPos(this.element,t.targetTouches)[0],this.move(t,this._lastPos)):this.reset()},this.touchend=t=>{0===t.targetTouches.length&&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._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=i;let n=new ol;this._rotatePitchHandler=new on({clickTolerance:3,move:(t,n)=>{let o=i.getBoundingClientRect(),a=new E.Ri((o.bottom-o.top)/2,(o.right-o.left)/2);return{bearingDelta:(0,E.ar)(new E.Ri(t.x,n.y),n,a),pitchDelta:r?-((n.y-t.y)*.5):void 0}},moveStateManager:n,enable:!0,assignEvents:()=>{}}),this.map=t,i.addEventListener("mousedown",this.mousedown),i.addEventListener("touchstart",this.touchstart,{passive:!1}),i.addEventListener("touchcancel",this.reset)}startMove(t,i){this._rotatePitchHandler.dragStart(t,i),P.disableDrag()}move(t,i){let r=this.map,{bearingDelta:n,pitchDelta:o}=this._rotatePitchHandler.dragMove(t,i)||{};n&&r.setBearing(r.getBearing()+n),o&&r.setPitch(r.getPitch()+o)}off(){let t=this.element;t.removeEventListener("mousedown",this.mousedown),t.removeEventListener("touchstart",this.touchstart),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),t.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){P.enableDrag(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend)}};async function oJ(t=!1){if(void 0!==f&&!t)return f;if(void 0===window.navigator.permissions)return f=!!window.navigator.geolocation;try{f="denied"!==(await window.navigator.permissions.query({name:"geolocation"})).state}catch{f=!!window.navigator.geolocation}return f}function oX(t,i,r,n=!1){if(n||!r.getCoveringTilesDetailsProvider().allowWorldCopies())return t?.wrap();let o=new E.st(t.lng,t.lat);if(t=new E.st(t.lng,t.lat),i){let n=new E.st(t.lng-360,t.lat),o=new E.st(t.lng+360,t.lat),a=r.locationToScreenPoint(t).distSqr(i);r.locationToScreenPoint(n).distSqr(i)<a?t=n:r.locationToScreenPoint(o).distSqr(i)<a&&(t=o)}for(;Math.abs(t.lng-r.center.lng)>180;){let i=r.locationToScreenPoint(t);if(i.x>=0&&i.y>=0&&i.x<=r.width&&i.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t.lng!==o.lng&&r.isPointOnMapSurface(r.locationToScreenPoint(t))?t:o}let oQ={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 o0(t,i,r){let n=t.classList;for(let t in oQ)n.remove(`maplibregl-${r}-anchor-${t}`);n.add(`maplibregl-${r}-anchor-${i}`)}let o1={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]},o2="#3FB1CE";function o3(t,i,r=[]){let n=P.createNS("http://www.w3.org/2000/svg",t);for(let t in i)n.setAttributeNS(null,t,i[t]);for(let t of r)n.appendChild(t);return n}var o5=class extends E.vn{},o4=class extends E.vn{},o6=class extends E.yn{constructor(t){if(super(),this._onClick=t=>{this.fire(new o4("click",{originalEvent:t}))},this._onKeyPress=t=>{("Space"===t.code||"Enter"===t.code)&&this.togglePopup()},this._onKeyDown=t=>{if(!this._defaultMarker||!this._draggable||!this._map||!this._lngLat||t.composedPath()[0]!==this._element||t.altKey||t.ctrlKey||t.metaKey)return;let i=o1[t.key];if(!i)return;t.preventDefault(),t.stopPropagation();let r=t.shiftKey?10:1,n=this._map.project(this._lngLat);this.setLngLat(this._map.unproject(new E.Ri(n.x+i[0]*r,n.y+i[1]*r))),this._keyboardDragActive||(this._keyboardDragActive=!0,this.fire(new o5("dragstart"))),this.fire(new o5("drag"))},this._onKeyUp=t=>{o1[t.key]&&this._endKeyboardDrag()},this._onBlur=()=>{this._endKeyboardDrag()},this._onMapClick=t=>{let i=t.originalEvent.target,r=this._element;this._popup&&(i===r||r.contains(i))&&this.togglePopup()},this._update=t=>{if(!this._map)return;let i=this._map.loaded()&&!this._map.isMoving();t?.type!=="terrain"&&(t?.type!=="render"||i)||this._map.once("render",this._update),this._lngLat=oX(this._lngLat,this._flatPos,this._map._camera.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map._camera.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let r="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?r=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(r=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let n="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?n="rotateX(0deg)":"map"===this._pitchAlignment&&(n=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||t&&"moveend"!==t.type||(this._pos=this._pos.round()),this._element.style.transform=`${oQ[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${n} ${r}`,D.frameAsync(new AbortController,this._map._ownerWindow).then(()=>{this._updateOpacity(t?.type==="moveend")}).catch(()=>{})},this._onMove=t=>{if(!this._isDragging){let i=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=i}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new o5("dragstart"))),this.fire(new o5("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),"active"===this._state&&this.fire(new o5("dragend")),this._state="inactive"},this._addDragHandler=t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.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=t?.anchor||"center",this._color=t?.color||o2,this._scale=t?.scale||1,this._draggable=t?.draggable||!1,this._clickTolerance=t?.clickTolerance||0,this._subpixelPositioning=t?.subpixelPositioning||!1,this._isDragging=!1,this._roleManaged=!1,this._tabIndexManaged=!1,this._keyboardDragActive=!1,this._state="inactive",this._rotation=t?.rotation||0,this._rotationAlignment=t?.rotationAlignment||"auto",this._pitchAlignment=t?.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,this.setOpacity(t?.opacity,t?.opacityWhenCovered),t?.element)this._element=t.element,this._offset=E.Ri.convert(t?.offset||[0,0]);else{this._defaultMarker=!0,this._element=P.create("div");let i=(p||(p=o3("svg",{display:"block",height:"41px",width:"27px",viewBox:"0 0 27 41"},[o3("g",{"fill-rule":"nonzero"},[o3("g",{transform:"translate(3.0, 29.0)",fill:"#000000"},[["10.5","5.25002273"],["10.5","5.25002273"],["9.5","4.77275007"],["8.5","4.29549936"],["7.5","3.81822308"],["6.5","3.34094679"],["5.5","2.86367051"],["4.5","2.38636864"]].map(([t,i])=>o3("ellipse",{opacity:"0.04",cx:"10.5",cy:"5.80029008",rx:t,ry:i}))),o3("g",{fill:o2},[o3("path",{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"})]),o3("g",{opacity:"0.25",fill:"#000000"},[o3("path",{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"})]),o3("g",{transform:"translate(6.0, 7.0)",fill:"#FFFFFF"}),o3("g",{transform:"translate(8.0, 8.0)"},[o3("circle",{fill:"#000000",opacity:"0.25",cx:"5.5",cy:"5.5",r:"5.4999962"}),o3("circle",{fill:"#FFFFFF",cx:"5.5",cy:"5.5",r:"5.4999962"})])])]))).cloneNode(!0);i.setAttributeNS(null,"height",`${41*this._scale}px`),i.setAttributeNS(null,"width",`${27*this._scale}px`),(function(t){return t.firstElementChild.children[1]})(i).setAttributeNS(null,"fill",this._color),this._element.appendChild(i),this._offset=E.Ri.convert(t?.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",t=>{t.preventDefault()}),this._element.addEventListener("mousedown",t=>{t.preventDefault()}),o0(this._element,this._anchor,"marker"),t?.className)for(let i of t.className.split(" "))this._element.classList.add(i);this._popup=null}addTo(t){return this.remove(),this._map=t,this._defaultMarker&&!this._element.hasAttribute("aria-label")&&this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),this._updateAccessibilityRole(),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),t.on("projectiontransition",this._update),this._element.addEventListener("click",this._onClick),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("projectiontransition",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),this._element.removeEventListener("click",this._onClick),this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._element.removeEventListener("keypress",this._onKeyPress),this._keyboardDragActive=!1,this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=E.st.convert(t),this._pos=null,this._update(),this._popup&&this._popup.setLngLat(this._lngLat),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress)),t){if(!("offset"in t.options)){let i=13.5/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[i,-((24.6+i)*1)],"bottom-right":[-i,-((24.6+i)*1)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._element.addEventListener("keypress",this._onKeyPress)}return this._updateTabIndex(),this._updateAccessibilityRole(),this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}_endKeyboardDrag(){this._keyboardDragActive&&(this._keyboardDragActive=!1,this.fire(new o5("dragend")))}getPopup(){return this._popup}togglePopup(){let t=this._popup;return this._element.style.opacity===this._opacityWhenCovered||t&&(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map))),this}_updateOpacity(t=!1){let i=this._map?.terrain,r=this._map._camera.transform.isLocationOccluded(this._lngLat);if(!i||r){let t=r?this._opacityWhenCovered:this._opacity;this._element.style.opacity!==t&&(this._element.style.opacity=t,this._element.classList.toggle("maplibregl-marker-covered",r));return}if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let n=this._map,o=n.terrain.depthAtPoint(this._pos),a=n.terrain.getElevationForLngLat(this._lngLat,n._camera.transform);if(n._camera.transform.lngLatToCameraDepth(this._lngLat,a)-o<.006){this._element.style.opacity=this._opacity,this._element.classList.remove("maplibregl-marker-covered");return}let s=-this._offset.y/n._camera.transform.pixelsPerMeter,l=Math.sin(n.getPitch()*Math.PI/180)*s,c=n.terrain.depthAtPoint(new E.Ri(this._pos.x,this._pos.y-this._offset.y)),d=n._camera.transform.lngLatToCameraDepth(this._lngLat,a+l)-c>.006;this._popup?.isOpen()&&d&&this._popup.remove(),this._element.style.opacity=d?this._opacityWhenCovered:this._opacity,this._element.classList.toggle("maplibregl-marker-covered",d)}getOffset(){return this._offset}setOffset(t){return this._offset=E.Ri.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._element.classList.toggle("maplibregl-marker-draggable",this._draggable),this._map&&(t?(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._defaultMarker&&(this._draggable?(this._element.addEventListener("keydown",this._onKeyDown),this._element.addEventListener("keyup",this._onKeyUp),this._element.addEventListener("blur",this._onBlur)):(this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._endKeyboardDrag())),this._updateTabIndex(),this._updateAccessibilityRole(),this}isDraggable(){return this._draggable}_updateTabIndex(){this._popup||this._defaultMarker&&this._draggable?this._element.hasAttribute("tabindex")||(this._element.setAttribute("tabindex","0"),this._tabIndexManaged=!0):this._tabIndexManaged&&=("0"===this._element.getAttribute("tabindex")&&this._element.removeAttribute("tabindex"),!1)}_updateAccessibilityRole(){if(!this._defaultMarker||this._element.hasAttribute("role")&&!this._roleManaged)return;let t=this._draggable||this._popup?"button":"img";this._element.setAttribute("role",t),this._roleManaged=!0}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,i){return(void 0===this._opacity||void 0===t&&void 0===i)&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==t&&(this._opacity=String(t)),void 0!==i&&(this._opacityWhenCovered=String(i)),this._map&&this._updateOpacity(!0),this}};let o8={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},o7=0,o9=!1;var ae=class extends E.vn{},at=class extends E.vn{},ai=class extends E.vn{},ar=class extends E.yn{constructor(t){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t)){this._setErrorState(),this.fire(new at("outofmaxbounds",t)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,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 Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new at("geolocate",t)),this._finish()}},this._updateCamera=t=>{let i=new E.st(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy,n=this._map.getBearing(),o=(0,E.tr)({bearing:n},this.options.fitBoundsOptions),a=eB.fromLngLat(i,r);this._map.fitBounds(a,o,{geolocateSource:!0})},this._updateMarker=t=>{if(t){let i=new E.st(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=t.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=t=>{if(this._map){if(1===t.code){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;let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&o9)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new ai("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._onMoveStart=t=>{if(!this._map)return;let i=t?.[0]instanceof ResizeObserverEntry;t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||i||this._map.isZooming()||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new ae("trackuserlocationend")),this.fire(new ae("userlocationlostfocus")))},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",t=>{t.preventDefault()}),this._geolocateButton=P.create("button","maplibregl-ctrl-geolocate",this._container),P.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(!1===t){(0,E.Pr)("Geolocation support is not available so the GeolocateControl will be disabled.");let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{let t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=P.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new o6({element:this._dotElement}),this._circleElement=P.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new o6({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",this._onMoveStart)}},this.options=(0,E.tr)({},o8,t)}onAdd(t){return this._map=t,this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),oJ().then(t=>this._finishSetupUI(t)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(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(),this._container.remove(),this._map.off("movestart",this._onMoveStart),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,o7=0,o9=!1}_isOutOfMapMaxBounds(t){let i=this._map.getMaxBounds(),r=t.coords;return i&&(r.longitude<i.getWest()||r.longitude>i.getEast()||r.latitude<i.getSouth()||r.latitude>i.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":case"BACKGROUND_ERROR":case"OFF":case void 0:break;default:throw Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){let t=this._userLocationDotMarker.getLngLat();if(!this.options.showUserLocation||!this.options.showAccuracyCircle||!this._accuracy||!t)return;let i=this._map.project(t),r=this._map.unproject([i.x+100,i.y]),n=t.distanceTo(r)/100,o=2*this._accuracy/n;this._circleElement.style.width=`${o.toFixed(2)}px`,this._circleElement.style.height=`${o.toFixed(2)}px`}trigger(){if(!this._setup)return(0,E.Pr)("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 ae("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":o7--,o9=!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 ae("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 ae("trackuserlocationstart")),this.fire(new ae("userlocationfocus"));break;default:throw 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 Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let t;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++o7>1?(t={maximumAge:6e5,timeout:0},o9=!0):(t=this.options.positionOptions,o9=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}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)}};let an={maxWidth:100,unit:"metric"};var ao=class{constructor(t){this._onMove=()=>{aa(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,aa(this._map,this._container,this.options)},this.options={...an,...t}}getDefaultPosition(){return"bottom-left"}onAdd(t){return this._map=t,this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._onMove),this._map=void 0}};function aa(t,i,r){let n=r?.maxWidth||100,o=t._container.clientHeight/2,a=t._container.clientWidth/2,s=t.unproject([a-n/2,o]),l=t.unproject([a+n/2,o]),c=Math.min(n,Math.round(t.project(l).x-t.project(s).x),t._container.clientWidth),d=s.distanceTo(l);if(r?.unit==="imperial"){let r=3.2808*d;r>5280?as(i,c,r/5280,t._getUIString("ScaleControl.Miles")):as(i,c,r,t._getUIString("ScaleControl.Feet"))}else r?.unit==="nautical"?as(i,c,d/1852,t._getUIString("ScaleControl.NauticalMiles")):d>=1e3?as(i,c,d/1e3,t._getUIString("ScaleControl.Kilometers")):as(i,c,d,t._getUIString("ScaleControl.Meters"))}function as(t,i,r,n){var o,a;let s,l,c,d=(o=r,l=10**(`${Math.floor(o)}`.length-1),c=o/l,l*(c=c>=10?10:c>=5?5:c>=3?3:c>=2?2:c>=1?1:(a=c,s=10**Math.ceil(-Math.log(a)/Math.LN10),Math.round(a*s)/s))),u=d/r;t.style.width=`${i*u}px`,t.innerHTML=`${d} ${n}`}var al=class extends E.vn{},ac=class extends E.yn{constructor(t={}){super(),this._onFullscreenChange=()=>{let t=window.document.fullscreenElement||window.document.webkitFullscreenElement;for(;t?.shadowRoot?.fullscreenElement;)t=t.shadowRoot.fullscreenElement;t===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,this._pseudo=t.pseudo??!1,t?.container&&(t.container instanceof HTMLElement?this._container=t.container:(0,E.Pr)("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(t){return this._map=t,this._container||=this._map.getContainer(),this._controlContainer=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let t=this._fullscreenButton=P.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);P.create("span","maplibregl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t}_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 al("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new al("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){this._pseudo?this._togglePseudoFullScreen():window.document.exitFullscreen?window.document.exitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._pseudo?this._togglePseudoFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},ad=class{constructor(t){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=t}onAdd(t){return this._map=t,this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=P.create("button","maplibregl-ctrl-terrain",this._container),P.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(){this._container.remove(),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},au=class{constructor(){this._toggleProjection=()=>{let t=this._map.getProjection()?.type;"mercator"!==t&&t?this._map.setProjection({type:"mercator"}):this._map.setProjection({type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),this._map.getProjection()?.type==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(t){return this._map=t,this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=P.create("button","maplibregl-ctrl-globe",this._container),P.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._map.on("projectiontransition",this._updateGlobeIcon),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateGlobeIcon),this._map.off("projectiontransition",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}};let ah={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0};var am=class extends E.vn{},af=class extends E.yn{constructor(t){super(),this._updateOpacity=()=>{void 0!==this.options.locationOccludedOpacity&&(this._map._camera.transform.isLocationOccluded(this.getLngLat())?this._container.style.opacity=`${this.options.locationOccludedOpacity}`:this._container.style.opacity="")},this.remove=()=>(this._content&&this._content.remove(),this._container&&(this._container.remove(),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("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousemove",this._update),this._map.off("mouseup",this._update),this._map.off("drag",this._update),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new am("close"))),this),this._update=t=>{let i,r=this._lngLat||this._trackPointer;if(!this._map||!r||!this._content)return;if(!this._container){if(this._container=P.create("div","maplibregl-popup",this._map.getContainer()),this._tip=P.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let t of this.options.className.split(" "))this._container.classList.add(t);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._lngLat=oX(this._lngLat,this._flatPos,this._map._camera.transform,this._trackPointer),t&&"point"in t&&t.point&&(i=t.point),this._trackPointer&&!i)return;let n=this._flatPos=this._pos=this._trackPointer&&i?i:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&i?i:this._map._camera.transform.locationToScreenPoint(this._lngLat));let o=this.options.anchor,a=function t(i){if(!i)return t(new E.Ri(0,0));if("number"==typeof i){let t=Math.round(Math.abs(i)/Math.SQRT2);return{center:new E.Ri(0,0),top:new E.Ri(0,i),"top-left":new E.Ri(t,t),"top-right":new E.Ri(-t,t),bottom:new E.Ri(0,-i),"bottom-left":new E.Ri(t,-t),"bottom-right":new E.Ri(-t,-t),left:new E.Ri(i,0),right:new E.Ri(-i,0)}}if(i instanceof E.Ri||Array.isArray(i)){let t=E.Ri.convert(i);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:E.Ri.convert(i.center||[0,0]),top:E.Ri.convert(i.top||[0,0]),"top-left":E.Ri.convert(i["top-left"]||[0,0]),"top-right":E.Ri.convert(i["top-right"]||[0,0]),bottom:E.Ri.convert(i.bottom||[0,0]),"bottom-left":E.Ri.convert(i["bottom-left"]||[0,0]),"bottom-right":E.Ri.convert(i["bottom-right"]||[0,0]),left:E.Ri.convert(i.left||[0,0]),right:E.Ri.convert(i.right||[0,0])}}(this.options.offset);if(!o){var s;let t=this._container.offsetWidth,i=this._container.offsetHeight,r=(s=this.options.padding)?{top:s.top??0,right:s.right??0,bottom:s.bottom??0,left:s.left??0}:{top:0,right:0,bottom:0,left:0},l;l=n.y+a.bottom.y<i+r.top?["top"]:n.y>this._map._camera.transform.height-i-r.bottom?["bottom"]:[],n.x<t/2+r.left?l.push("left"):n.x>this._map._camera.transform.width-t/2-r.right&&l.push("right"),o=0===l.length?"bottom":l.join("-")}let l=n.add(a[o]);this.options.subpixelPositioning||(l=l.round()),this._container.style.transform=`${oQ[o]} translate(${l.x}px,${l.y}px)`,o0(this._container,o,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=(0,E.tr)(Object.create(ah),t)}addTo(t){return this._map&&this.remove(),this._map=t,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._map.on("terrain",this._update),this._map.on("projectiontransition",this._update),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._update),this._map.on("mouseup",this._update),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 am("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=E.st.convert(t),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._update),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._update),this._map.on("drag",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){let i=document.createDocumentFragment(),r=document.createElement("body"),n;for(r.innerHTML=t;n=r.firstChild;)i.appendChild(n);return this.setDOMContent(i)}getMaxWidth(){return this._container?.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=P.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){return this._container&&this._container.classList.add(t),this}removeClassName(t){return this._container&&this._container.classList.remove(t),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){if(this._container)return this._container.classList.toggle(t)}setSubpixelPositioning(t){this.options.subpixelPositioning=t}setPadding(t){this.options.padding=t,this._update()}_createCloseButton(){this.options.closeButton&&(this._closeButton=P.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;let t=this._container.querySelector("a[href], [tabindex]:not([tabindex='-1']), [contenteditable]:not([contenteditable='false']), button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])");t&&t.focus()}};function ap(t,i){return e7().setRTLTextPlugin(t,i)}function a_(){return e7().getRTLTextPluginStatus()}function ag(){return k}function ab(){return eM.workerCount}function ay(t){eM.workerCount=t}function av(){return E.jn.MAX_PARALLEL_IMAGE_REQUESTS}function aF(t){E.jn.MAX_PARALLEL_IMAGE_REQUESTS=t}function ax(){return E.jn.WORKER_URL}function aw(t){E.jn.WORKER_URL=t}async function aE(t){await eL().broadcast("IS",t)}r.d(i,{AJAXError:()=>E.bn,AttributionControl:()=>oY,BoxZoomHandler:()=>n9,CanvasSource:()=>e1,CooperativeGesturesHandler:()=>oS,DoubleClickZoomHandler:()=>ok,DragPanHandler:()=>oT,DragRotateHandler:()=>oA,EXTENT:()=>8192,EdgeInsets:()=>ia,ErrorEvent:()=>E._n,Event:()=>E.vn,Evented:()=>E.yn,FullscreenControl:()=>ac,FullscreenEvent:()=>al,GPUInitializationError:()=>nZ,GeoJSONSource:()=>e$,GeolocateControl:()=>ar,GeolocateErrorEvent:()=>ai,GeolocateEvent:()=>ae,GeolocatePositionEvent:()=>at,GlobeControl:()=>au,Hash:()=>nJ,ImageSource:()=>eX,KeyboardHandler:()=>ox,LngLat:()=>E.st,LngLatBounds:()=>eB,LogoControl:()=>oj,Map:()=>oG,MapBoxZoomEvent:()=>H,MapContextEvent:()=>q,MapLibreEvent:()=>R,MapLibreMap:()=>oG,MapMouseEvent:()=>j,MapMovementEvent:()=>B,MapProjectionEvent:()=>$,MapSourceDataEvent:()=>Y,MapStyleDataEvent:()=>z,MapStyleImageMissingEvent:()=>G,MapStyleLoadEvent:()=>O,MapTerrainEvent:()=>V,MapTouchEvent:()=>N,MapWheelEvent:()=>U,Marker:()=>o6,MarkerClickEvent:()=>o4,MarkerDragEvent:()=>o5,MercatorCoordinate:()=>E.et,NavigationControl:()=>oZ,Point:()=>E.Ri,Popup:()=>af,PopupEvent:()=>am,RasterDEMTileSource:()=>ej,RasterTileSource:()=>eY,ScaleControl:()=>ao,ScrollZoomHandler:()=>oE,Style:()=>i2,TerrainControl:()=>ad,TwoFingersTouchPitchHandler:()=>ob,TwoFingersTouchRotateHandler:()=>o_,TwoFingersTouchZoomHandler:()=>of,TwoFingersTouchZoomRotateHandler:()=>oC,VectorTileSource:()=>ez,VideoSource:()=>e0,addProtocol:()=>E.On,clearPrewarmedResources:()=>eC,config:()=>E.jn,createTileMesh:()=>eJ,getGlobalDispatcher:()=>eL,getMaxParallelImageRequests:()=>av,getRTLTextPluginStatus:()=>a_,getVersion:()=>ag,getWorkerCount:()=>ab,getWorkerUrl:()=>ax,importScriptInWorkers:()=>aE,isTimeFrozen:()=>L,now:()=>A,prewarm:()=>eA,removeProtocol:()=>E.An,restoreNow:()=>S,setMaxParallelImageRequests:()=>aF,setNow:()=>C,setRTLTextPlugin:()=>ap,setWorkerCount:()=>ay,setWorkerUrl:()=>aw},{addSourceType:e5})}},i={};function r(n){var o=i[n];if(void 0!==o)return o.exports;var a=i[n]={exports:{}};return t[n].call(a.exports,a,a.exports,r),a.exports}r.n=t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return r.d(i,{a:i}),i},r.d=(t,i,n)=>{var o=(i,n)=>{for(var o in i)r.o(i,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,[n]:i[o]})};o(i,"get"),o(n,"value")},r.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}})(),r.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),r.r=t=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var n={};(()=>{"use strict";let t,i,o,a,s,l,c,d,u;r.r(n),r.d(n,{DefaultConfig:()=>hF,LngLat:()=>sM.st,OrClusterMarker:()=>uL,OrMap:()=>hA,OrMapAssetCard:()=>hx,OrMapAssetCardLoadAssetEvent:()=>hv,OrMapClickedEvent:()=>hk,OrMapGeocoder:()=>uk,OrMapGeocoderChangeEvent:()=>uE,OrMapGeocoderControl:()=>uM,OrMapLegend:()=>u2,OrMapLegendControl:()=>u3,OrMapLegendEvent:()=>u1,OrMapLoadedEvent:()=>hE,OrMapLongPressEvent:()=>hM,OrMapMarker:()=>sI,OrMapMarkerAsset:()=>sq,OrMapMarkerChangedEvent:()=>sL,OrMapMarkerClickedEvent:()=>sP,OrMapMarkersChangedEvent:()=>hD,OrMapPresetFilter:()=>hd,OrMapPresetFilterControl:()=>hu,OrMapPresetFilterEvent:()=>hc,Util:()=>tS,geoJsonPointInputTemplateProvider:()=>hT,getMarkerConfigAttributeName:()=>s$,getMarkerConfigForAssetType:()=>sV});var h,m,f,p,_,g,b,y,v,F,x,w,E,k,M,D,T,A,C,S,L,P,I,R,B,O,z,Y,j,N,U,H,V,$,q,G,W,Z,K,J,X,Q,ee,et,ei,er,en,eo,ea,es,el,ec,ed,eu,eh,em,ef,ep,e_,eg,eb,ey,ev,eF,ex,ew,eE,ek,eM,eD,eT,eA,eC,eS,eL,eP,eI,eR,eB,eO,ez,eY,ej,eN,eU,eH,eV,e$,eq,eG,eW,eZ,eK,eJ,eX,eQ,e0,e1,e2,e3,e5,e4,e6,e8,e7,e9,te,tt,ti,tr,tn,to,ta,ts,tl,tc,td,tu,th,tm,tf,tp,t_,tg,tb,ty,tv,tF,tx,tw,tE,tk,tM,tD,tT,tA,tC={};r.r(tC),r.d(tC,{hasBrowserEnv:()=>rq,hasStandardBrowserEnv:()=>rW,hasStandardBrowserWebWorkerEnv:()=>rZ,navigator:()=>rG,origin:()=>rK});var tS={};r.r(tS),r.d(tS,{formatCount:()=>sB,getGeoJSONPoint:()=>sY,getLngLat:()=>sz,getLngLatBounds:()=>sj,getMarkerIconAndColorFromAssetType:()=>sN,isAssetWithLocation:()=>sU,metersToPixelsAtMaxZoom:()=>sO}),r(4532),(_=eD||(eD={})).CREATE="CREATE",_.UPDATE="UPDATE",_.DELETE="DELETE",_.DELETE_FINISHED="DELETE_FINISHED",(g=eT||(eT={})).LOW="LOW",g.MEDIUM="MEDIUM",g.HIGH="HIGH",(b=eA||(eA={})).MANUAL="MANUAL",b.CLIENT="CLIENT",b.GLOBAL_RULESET="GLOBAL_RULESET",b.REALM_RULESET="REALM_RULESET",b.ASSET_RULESET="ASSET_RULESET",b.AGENT="AGENT",(y=eC||(eC={})).OPEN="OPEN",y.ACKNOWLEDGED="ACKNOWLEDGED",y.IN_PROGRESS="IN_PROGRESS",y.RESOLVED="RESOLVED",y.CLOSED="CLOSED",(v=eS||(eS={})).BOTTOM_LEFT="BOTTOM_LEFT",v.BOTTOM_RIGHT="BOTTOM_RIGHT",v.TOP_LEFT="TOP_LEFT",v.TOP_RIGHT="TOP_RIGHT",(F=eL||(eL={})).CREATE="CREATE",F.READ="READ",F.UPDATE="UPDATE",F.DELETE="DELETE",(x=eP||(eP={})).NONE="NONE",x.FORECAST="FORECAST",x.SETPOINT="SETPOINT",(w=eI||(eI={})).DISCONNECTED="DISCONNECTED",w.CONNECTING="CONNECTING",w.DISCONNECTING="DISCONNECTING",w.CONNECTED="CONNECTED",w.DISABLED="DISABLED",w.WAITING="WAITING",w.ERROR="ERROR",w.STOPPED="STOPPED",(E=eR||(eR={})).REQUEST_START="REQUEST_START",E.REQUEST_REPEATING="REQUEST_REPEATING",E.REQUEST_CANCEL="REQUEST_CANCEL",E.READY="READY",E.COMPLETED="COMPLETED",E.RUNNING="RUNNING",E.CANCELLED="CANCELLED",(k=eB||(eB={})).TOGGLE="TOGGLE",k.INCREMENT="INCREMENT",k.DECREMENT="DECREMENT",k.NEGATE="NEGATE",(M=eO||(eO={})).ASSET_NOT_FOUND="ASSET_NOT_FOUND",M.ATTRIBUTE_NOT_FOUND="ATTRIBUTE_NOT_FOUND",M.INSUFFICIENT_ACCESS="INSUFFICIENT_ACCESS",M.INVALID_VALUE="INVALID_VALUE",M.INTERCEPTOR_FAILURE="INTERCEPTOR_FAILURE",M.STATE_STORAGE_FAILED="STATE_STORAGE_FAILED",M.CANNOT_PROCESS="CANNOT_PROCESS",M.QUEUE_FULL="QUEUE_FULL",M.UNKNOWN="UNKNOWN",M.ASSET_ID_MISSING="ASSET_ID_MISSING",M.ATTRIBUTE_NAME_MISSING="ATTRIBUTE_NAME_MISSING",(D=ez||(ez={})).PUBLIC="PUBLIC",D.SHARED="SHARED",D.PRIVATE="PRIVATE",(T=eY||(eY={})).OFF="OFF",T.ONE_MIN="ONE_MIN",T.FIVE_MIN="FIVE_MIN",T.QUARTER="QUARTER",T.ONE_HOUR="ONE_HOUR",(A=ej||(ej={})).WRAP_TO_SINGLE_COLUMN="WRAP_TO_SINGLE_COLUMN",A.KEEP_LAYOUT="KEEP_LAYOUT",A.REDIRECT="REDIRECT",A.BLOCK_DEVICE="BLOCK_DEVICE",(C=eN||(eN={})).CSV="CSV",C.CSV_CROSSTAB="CSV_CROSSTAB",C.CSV_CROSSTAB_MINUTE="CSV_CROSSTAB_MINUTE",(S=eU||(eU={})).MINUTE="MINUTE",S.HOUR="HOUR",S.DAY="DAY",S.WEEK="WEEK",S.MONTH="MONTH",S.YEAR="YEAR",(L=eH||(eH={})).MIN="MIN",L.AVG="AVG",L.MAX="MAX",L.DIFFERENCE="DIFFERENCE",L.COUNT="COUNT",L.SUM="SUM",L.MODE="MODE",L.MEDIAN="MEDIAN",(P=eV||(eV={})).TERMINATING="TERMINATING",P.DISABLED="DISABLED",P.ALREADY_CONNECTED="ALREADY_CONNECTED",P.UNRECOGNISED="UNRECOGNISED",P.PERMANENT_ERROR="PERMANENT_ERROR",P.SYNC_ERROR="SYNC_ERROR",(I=e$||(e$={})).HTTPS="HTTPS",I.HTTP="HTTP",I.TCP="TCP",(R=eq||(eq={})).GET="GET",R.POST="POST",R.PUT="PUT",R.DELETE="DELETE",R.OPTIONS="OPTIONS",R.PATCH="PATCH",(B=eG||(eG={})).KEYCLOAK="KEYCLOAK",B.NONE="NONE",(O=eW||(eW={})).WEBSOCKET="WEBSOCKET",O.POLLING="POLLING",(z=eZ||(eZ={})).INTERNAL="INTERNAL",z.CLIENT="CLIENT",z.GLOBAL_RULESET="GLOBAL_RULESET",z.REALM_RULESET="REALM_RULESET",z.ASSET_RULESET="ASSET_RULESET",(Y=eK||(eK={})).REALM="REALM",Y.USER="USER",Y.ASSET="ASSET",Y.CUSTOM="CUSTOM",(j=eJ||(eJ={})).NORMAL="NORMAL",j.HIGH="HIGH",(N=eX||(eX={})).DEVICE="DEVICE",N.TOPIC="TOPIC",N.CONDITION="CONDITION",(U=eQ||(eQ={})).ALWAYS="ALWAYS",U.ONCE="ONCE",U.HOURLY="HOURLY",U.DAILY="DAILY",U.WEEKLY="WEEKLY",U.MONTHLY="MONTHLY",U.ANNUALLY="ANNUALLY",(H=e0||(e0={})).TITLE="TITLE",H.SOURCE="SOURCE",H.STATUS="STATUS",H.SENT_ON="SENT_ON",H.DELIVERED_ON="DELIVERED_ON",(V=e1||(e1={})).MESSAGE_INVALID="MESSAGE_INVALID",V.CERTIFICATE_INVALID="CERTIFICATE_INVALID",V.UNAUTHORIZED="UNAUTHORIZED",V.FORBIDDEN="FORBIDDEN",V.UNIQUE_ID_MISMATCH="UNIQUE_ID_MISMATCH",V.CONFIG_DISABLED="CONFIG_DISABLED",V.USER_DISABLED="USER_DISABLED",V.SERVER_ERROR="SERVER_ERROR",V.ASSET_ERROR="ASSET_ERROR",V.SERVER_BUSY="SERVER_BUSY",($=e2||(e2={})).PRIVATE="PRIVATE",$.PROTECTED="PROTECTED",$.PUBLIC="PUBLIC",(q=e3||(e3={})).EXACT="EXACT",q.BEGIN="BEGIN",q.END="END",q.CONTAINS="CONTAINS",(G=e5||(e5={})).EQUALS="EQUALS",G.GREATER_THAN="GREATER_THAN",G.GREATER_EQUALS="GREATER_EQUALS",G.LESS_THAN="LESS_THAN",G.LESS_EQUALS="LESS_EQUALS",G.BETWEEN="BETWEEN",(W=e4||(e4={})).CREATED_ON="CREATED_ON",W.NAME="NAME",W.ASSET_TYPE="ASSET_TYPE",W.PARENT_ID="PARENT_ID",W.REALM="REALM",(Z=e6||(e6={})).RESTRICTED="RESTRICTED",Z.LINKED="LINKED",Z.REALM="REALM",(K=e8||(e8={})).AT_LEAST_ONE="AT_LEAST_ONE",K.ALL="ALL",K.NONE="NONE",(J=e7||(e7={})).AND="AND",J.OR="OR",(X=e9||(e9={})).CREATED_ON="CREATED_ON",X.FIRST_NAME="FIRST_NAME",X.LAST_NAME="LAST_NAME",X.USERNAME="USERNAME",X.EMAIL="EMAIL",(Q=te||(te={})).STOPPED="STOPPED",Q.RUNNING="RUNNING",Q.ERROR="ERROR",(ee=tt||(tt={})).JAVASCRIPT="JAVASCRIPT",ee.GROOVY="GROOVY",ee.JSON="JSON",ee.FLOW="FLOW",(et=ti||(ti={})).READY="READY",et.DEPLOYED="DEPLOYED",et.COMPILATION_ERROR="COMPILATION_ERROR",et.VALIDITY_PERIOD_ERROR="VALIDITY_PERIOD_ERROR",et.EXECUTION_ERROR="EXECUTION_ERROR",et.LOOP_ERROR="LOOP_ERROR",et.DISABLED="DISABLED",et.PAUSED="PAUSED",et.EXPIRED="EXPIRED",et.REMOVED="REMOVED",et.EMPTY="EMPTY",(ei=tr||(tr={})).SUNRISE="SUNRISE",ei.SUNSET="SUNSET",ei.TWILIGHT_MORNING_VISUAL="TWILIGHT_MORNING_VISUAL",ei.TWILIGHT_MORNING_VISUAL_LOWER="TWILIGHT_MORNING_VISUAL_LOWER",ei.TWILIGHT_MORNING_HORIZON="TWILIGHT_MORNING_HORIZON",ei.TWILIGHT_MORNING_CIVIL="TWILIGHT_MORNING_CIVIL",ei.TWILIGHT_MORNING_NAUTICAL="TWILIGHT_MORNING_NAUTICAL",ei.TWILIGHT_MORNING_ASTRONOMICAL="TWILIGHT_MORNING_ASTRONOMICAL",ei.TWILIGHT_MORNING_GOLDEN_HOUR="TWILIGHT_MORNING_GOLDEN_HOUR",ei.TWILIGHT_MORNING_BLUE_HOUR="TWILIGHT_MORNING_BLUE_HOUR",ei.TWILIGHT_MORNING_NIGHT_HOUR="TWILIGHT_MORNING_NIGHT_HOUR",ei.TWILIGHT_EVENING_VISUAL="TWILIGHT_EVENING_VISUAL",ei.TWILIGHT_EVENING_VISUAL_LOWER="TWILIGHT_EVENING_VISUAL_LOWER",ei.TWILIGHT_EVENING_HORIZON="TWILIGHT_EVENING_HORIZON",ei.TWILIGHT_EVENING_CIVIL="TWILIGHT_EVENING_CIVIL",ei.TWILIGHT_EVENING_NAUTICAL="TWILIGHT_EVENING_NAUTICAL",ei.TWILIGHT_EVENING_ASTRONOMICAL="TWILIGHT_EVENING_ASTRONOMICAL",ei.TWILIGHT_EVENING_GOLDEN_HOUR="TWILIGHT_EVENING_GOLDEN_HOUR",ei.TWILIGHT_EVENING_BLUE_HOUR="TWILIGHT_EVENING_BLUE_HOUR",ei.TWILIGHT_EVENING_NIGHT_HOUR="TWILIGHT_EVENING_NIGHT_HOUR",(er=tn||(tn={})).NUMBER="NUMBER",er.NUMBER_ARRAY="NUMBER_ARRAY",er.STRING="STRING",er.BOOLEAN="BOOLEAN",er.TRIGGER="TRIGGER",er.COLOR="COLOR",er.ANY="ANY",(en=to||(to={})).NEW_LINE="NEW_LINE",en.SPACER="SPACER",(eo=ta||(ta={})).INPUT="INPUT",eo.PROCESSOR="PROCESSOR",eo.OUTPUT="OUTPUT",eo.THEN="THEN",(ea=ts||(ts={})).TEXT="TEXT",ea.MULTILINE="MULTILINE",ea.NUMBER="NUMBER",ea.DROPDOWN="DROPDOWN",ea.DOUBLE_DROPDOWN="DOUBLE_DROPDOWN",ea.CHECKBOX="CHECKBOX",ea.ASSET_ATTRIBUTE="ASSET_ATTRIBUTE",ea.COLOR="COLOR",ea.DATE="DATE",(es=tl||(tl={})).ADD="ADD",es.ADD_OR_REPLACE="ADD_OR_REPLACE",es.REPLACE="REPLACE",es.DELETE="DELETE",es.CLEAR="CLEAR",(el=tc||(tc={})).PER_ASSET="PER_ASSET",el.GLOBAL="GLOBAL",(ec=td||(td={})).READ_ADMIN="read:admin",ec.READ_LOGS="read:logs",ec.READ_USERS="read:users",ec.READ_MAP="read:map",ec.READ_ASSETS="read:assets",ec.READ_RULES="read:rules",ec.READ_INSIGHTS="read:insights",ec.READ_ALARMS="read:alarms",ec.READ_NOTIFICATIONS="read:notifications",ec.READ_SERVICES="read:services",ec.READ_TUNNELS="read:tunnels",ec.WRITE_SERVICES="write:services",ec.WRITE_USER="write:user",ec.WRITE_ADMIN="write:admin",ec.WRITE_LOGS="write:logs",ec.WRITE_ASSETS="write:assets",ec.WRITE_ATTRIBUTES="write:attributes",ec.WRITE_RULES="write:rules",ec.WRITE_INSIGHTS="write:insights",ec.WRITE_ALARMS="write:alarms",ec.WRITE_NOTIFICATIONS="write:notifications",ec.WRITE_TUNNELS="write:tunnels",ec.READ="read",ec.WRITE="write",(ed=tu||(tu={})).REGISTER="REGISTER",ed.UPDATE="UPDATE",ed.DEREGISTER="DEREGISTER",(eu=th||(th={})).AVAILABLE="AVAILABLE",eu.UNAVAILABLE="UNAVAILABLE",(eh=tm||(tm={})).ASSET="ASSET",eh.AGENT="AGENT",eh.NOTIFICATION="NOTIFICATION",eh.ALARM="ALARM",eh.RULES="RULES",eh.PROTOCOL="PROTOCOL",eh.GATEWAY="GATEWAY",eh.MODEL_AND_VALUES="MODEL_AND_VALUES",eh.API="API",eh.DATA="DATA",(em=tf||(tf={})).INFO="INFO",em.WARN="WARN",em.ERROR="ERROR",(ef=tp||(tp={})).NUMERIC="numeric",ef.DIGIT_2="2-digit",ef.FULL="full",ef.LONG="long",ef.MEDIUM="medium",ef.SHORT="short",ef.NARROW="narrow",(ep=t_||(t_={})).SECONDLY="SECONDLY",ep.MINUTELY="MINUTELY",ep.HOURLY="HOURLY",ep.DAILY="DAILY",ep.WEEKLY="WEEKLY",ep.MONTHLY="MONTHLY",ep.YEARLY="YEARLY",(e_=tg||(tg={})).OMIT="OMIT",e_.BACKWARD="BACKWARD",e_.FORWARD="FORWARD",(eg=tb||(tb={})).JAPANESE="JAPANESE",eg.BUDDHIST="BUDDHIST",eg.ROC="ROC",eg.ISLAMIC="ISLAMIC",eg.ISO8601="ISO8601",eg.CHINESE="CHINESE",eg.ETHIOPIC="ETHIOPIC",eg.HEBREW="HEBREW",eg.GREGORIAN="GREGORIAN",(eb=ty||(ty={})).SU="SU",eb.MO="MO",eb.TU="TU",eb.WE="WE",eb.TH="TH",eb.FR="FR",eb.SA="SA",(ey=tv||(tv={})).PEOPLECOUNTERASSET="PeopleCounterAsset",ey.MAILAGENT="MailAgent",ey.UDPAGENT="UDPAgent",ey.ROOMASSET="RoomAsset",ey.CITYASSET="CityAsset",ey.VENTILATIONASSET="VentilationAsset",ey.TRADFRILIGHTASSET="TradfriLightAsset",ey.CONSOLEASSET="ConsoleAsset",ey.PRESENCESENSORASSET="PresenceSensorAsset",ey.OPENWEATHERMAPAGENT="OpenWeatherMapAgent",ey.LIGHTASSET="LightAsset",ey.KNXAGENT="KNXAgent",ey.THETHINGSSTACKAGENT="TheThingsStackAgent",ey.PLUGASSET="PlugAsset",ey.CHIRPSTACKAGENT="ChirpStackAgent",ey.WEATHERASSET="WeatherAsset",ey.THINGASSET="ThingAsset",ey.WEBSOCKETAGENT="WebsocketAgent",ey.TCPAGENT="TCPAgent",ey.GATEWAYASSET="GatewayAsset",ey.SERIALAGENT="SerialAgent",ey.BLUETOOTHMESHAGENT="BluetoothMeshAgent",ey.PARKINGASSET="ParkingAsset",ey.TRADFRIPLUGASSET="TradfriPlugAsset",ey.SIMULATORAGENT="SimulatorAgent",ey.SNMPAGENT="SNMPAgent",ey.GROUPASSET="GroupAsset",ey.BUILDINGASSET="BuildingAsset",ey.MODBUSSERIALAGENT="ModbusSerialAgent",ey.ENVIRONMENTSENSORASSET="EnvironmentSensorAsset",ey.MQTTAGENT="MQTTAgent",ey.VELBUSTCPAGENT="VelbusTCPAgent",ey.ARTNETLIGHTASSET="ArtnetLightAsset",ey.VELBUSSERIALAGENT="VelbusSerialAgent",ey.GROUNDWATERSENSORASSET="GroundwaterSensorAsset",ey.MICROPHONEASSET="MicrophoneAsset",ey.MODBUSTCPAGENT="ModbusTcpAgent",ey.ZWAVEAGENT="ZWaveAgent",ey.HTTPAGENT="HTTPAgent",ey.DOORASSET="DoorAsset",ey.THERMOSTATASSET="ThermostatAsset",ey.SHIPASSET="ShipAsset",(ev=tF||(tF={})).COLOURRGB="colourRGB",ev.WILDCARDSUBSCRIPTIONTOPICS="wildcardSubscriptionTopics",ev.PRICEHOURLY="priceHourly",ev.MQTTPORT="MQTTPort",ev.PINGDISABLED="pingDisabled",ev.FLOW="flow",ev.CHILDASSETTYPE="childAssetType",ev.LASTACCESS="lastAccess",ev.POSITION="position",ev.NETWORKKEY="networkKey",ev.UNIVERSE="universe",ev.ROUTINGMODE="routingMode",ev.MSSINUMBER="MSSINumber",ev.LASTWILLRETAIN="lastWillRetain",ev.LASTWILLTOPIC="lastWillTopic",ev.SERIALBAUDRATE="serialBaudrate",ev.SUBSCRIBEQOS="subscribeQos",ev.LEDCOUNT="lEDCount",ev.LOCKED="locked",ev.CLOUDCOVERAGE="cloudCoverage",ev.BASEURL="baseURL",ev.PROTOCOL="protocol",ev.REQUIREDVALUES="requiredValues",ev.REGION="region",ev.CONSOLEPLATFORM="consolePlatform",ev.GATEWAYSTATUS="gatewayStatus",ev.NO2LEVEL="NO2Level",ev.ATMOSPHERICPRESSURE="atmosphericPressure",ev.SERIALPORT="serialPort",ev.APPLICATIONID="applicationId",ev.TAGS="tags",ev.UNLOCK="unlock",ev.CHECKINTERVALSECONDS="checkIntervalSeconds",ev.LOCATION="location",ev.CLIENTSECRET="clientSecret",ev.WINDDIRECTION="windDirection",ev.WINDSPEED="windSpeed",ev.PARTICLESPM10="particlesPM10",ev.APPLICATIONKEY="applicationKey",ev.LENGTH="length",ev.PROBABILITYOFPRECIPITATION="probabilityOfPrecipitation",ev.USERNAMEPASSWORD="usernamePassword",ev.WATERLEVEL="waterLevel",ev.CONNECTHEADERS="connectHeaders",ev.CONSOLENAME="consoleName",ev.WEBSOCKETQUERY="websocketQuery",ev.PREFERHTML="preferHTML",ev.PARITY="parity",ev.COOLING="cooling",ev.POLLINGMILLIS="pollingMillis",ev.SOILTEMPERATURE="soilTemperature",ev.SUNIRRADIANCE="sunIrradiance",ev.MESSAGEMAXLENGTH="messageMaxLength",ev.WINDGUSTSPEED="windGustSpeed",ev.LIGHTID="lightId",ev.PROXYADDRESS="proxyAddress",ev.REQUESTQUERYPARAMETERS="requestQueryParameters",ev.MQTTHOST="MQTTHost",ev.SECUREGRPC="secureGRPC",ev.MODEL="model",ev.STREET="street",ev.MANUFACTURER="manufacturer",ev.DELETEPROCESSEDMAIL="deleteProcessedMail",ev.RESUMESESSION="resumeSession",ev.ONOFF="onOff",ev.APIKEY="ApiKey",ev.CITY="city",ev.PRESENCE="presence",ev.SPACESOCCUPIED="spacesOccupied",ev.STARTTLS="startTLS",ev.REQUESTTIMEOUTMILLIS="requestTimeoutMillis",ev.WEBSOCKETPATH="websocketPath",ev.AGENTSTATUS="agentStatus",ev.PRICEDAILY="priceDaily",ev.COUNTGROWTHMINUTE="countGrowthMinute",ev.IMONUMBER="IMONumber",ev.ATTRIBUTION="Attribution",ev.TENANTID="tenantId",ev.REQUESTHEADERS="requestHeaders",ev.HOST="host",ev.COUNTOUTMINUTE="countOutMinute",ev.MESSAGECHARSET="messageCharset",ev.CERTIFICATEALIAS="certificateAlias",ev.EMAIL="email",ev.BINDPORT="bindPort",ev.CONSOLEVERSION="consoleVersion",ev.PARTICLESPM1="particlesPM1",ev.MTU="mtu",ev.SPEED="speed",ev.MESSAGESTRIPDELIMITER="messageStripDelimiter",ev.AREA="area",ev.COUNTRY="country",ev.SHIPTYPE="shipType",ev.CONNECTSUBSCRIPTIONS="connectSubscriptions",ev.RELATIVEHUMIDITY="relativeHumidity",ev.SOURCEADDRESS="sourceAddress",ev.RAINFALL="rainfall",ev.OAUTHGRANT="oAuthGrant",ev.OZONELEVEL="ozoneLevel",ev.SEQUENCENUMBER="sequenceNumber",ev.COUNTINMINUTE="countInMinute",ev.PORT="port",ev.SUNALTITUDE="sunAltitude",ev.COUNTOUT="countOut",ev.ROOMNUMBER="roomNumber",ev.TUNNELINGSUPPORTED="tunnelingSupported",ev.ENINUMBER="ENINumber",ev.PARTICLESPM2_5="particlesPM2_5",ev.AGENTDISABLED="agentDisabled",ev.DISABLED="disabled",ev.COUNTIN="countIn",ev.MESSAGESOURCEADDRESS="messageSourceAddress",ev.PROVISIONWEATHERASSET="ProvisionWeatherAsset",ev.TIMEINJECTIONINTERVAL="timeInjectionInterval",ev.TEMPERATURESETPOINT="temperatureSetpoint",ev.CONSOLEPROVIDERS="consoleProviders",ev.COUNTTOTAL="countTotal",ev.SPACESBUFFER="spacesBuffer",ev.DEVICECONFIG="deviceConfig",ev.SPACESTOTAL="spacesTotal",ev.BINDHOST="bindHost",ev.FANSPEED="fanSpeed",ev.MESSAGECONVERTBINARY="messageConvertBinary",ev.NOTES="notes",ev.MAILFOLDERNAME="mailFolderName",ev.MESSAGEDELIMITERS="messageDelimiters",ev.TEMPERATURE="temperature",ev.SUNZENITH="sunZenith",ev.SNMPVERSIONVALUE="SNMPVersionValue",ev.BRIGHTNESS="brightness",ev.POSTALCODE="postalCode",ev.SPACESOPEN="spacesOpen",ev.HUMIDITY="humidity",ev.SOUNDLEVEL="soundLevel",ev.SECUREMODE="secureMode",ev.DIRECTION="direction",ev.STOPBITS="stopbits",ev.UVINDEX="uVIndex",ev.CONNECTURL="connectURL",ev.CLIENTID="clientId",ev.NATMODE="NATMode",ev.UPDATEONWRITE="updateOnWrite",ev.LASTWILLPAYLOAD="lastWillPayload",ev.GROUPID="groupId",ev.FOLLOWREDIRECTS="followRedirects",ev.SUNAZIMUTH="sunAzimuth",ev.MESSAGECONVERTHEX="messageConvertHex",ev.WEBSOCKETMODE="websocketMode",ev.COLOURTEMPERATURE="colourTemperature",ev.PUBLISHQOS="publishQos",ev.DATABITS="dataBits",(eF=tx||(tx={})).FORMAT="format",eF.DATAPOINTSMAXAGEDAYS="dataPointsMaxAgeDays",eF.ACCESSRESTRICTEDWRITE="accessRestrictedWrite",eF.SECRET="secret",eF.APPLYPREDICTEDDATAPOINTS="applyPredictedDataPoints",eF.ATTRIBUTELINKS="attributeLinks",eF.RULERESETIMMEDIATE="ruleResetImmediate",eF.RULESTATE="ruleState",eF.AGENTLINKCONFIG="agentLinkConfig",eF.HASPREDICTEDDATAPOINTS="hasPredictedDataPoints",eF.FORECAST="forecast",eF.STOREDATAPOINTS="storeDataPoints",eF.LABEL="label",eF.CONSTRAINTS="constraints",eF.UNITS="units",eF.USERCONNECTED="userConnected",eF.SHOWONDASHBOARD="showOnDashboard",eF.READONLY="readOnly",eF.MULTILINE="multiline",eF.ACCESSPUBLICWRITE="accessPublicWrite",eF.MOMENTARY="momentary",eF.AGENTLINK="agentLink",eF.ACCESSRESTRICTEDREAD="accessRestrictedRead",eF.ACCESSPUBLICREAD="accessPublicRead",(ex=tw||(tw={})).ASSETQUERY="assetQuery",ex.WSURL="WS_URL",ex.COLOURRGB="colourRGB",ex.VALUEFORMAT="valueFormat",ex.TEXT="text",ex.BYTE="byte",ex.USERNAMEANDPASSWORD="usernameAndPassword",ex.HTTPURL="HTTP_URL",ex.ATTRIBUTELINK="attributeLink",ex.ASSETID="assetID",ex.NUMBERMAP="numberMap",ex.HTTPMETHOD="HTTPMethod",ex.ATTRIBUTESTATE="attributeState",ex.POSITIVENUMBER="positiveNumber",ex.POSITIVEINTEGER="positiveInteger",ex.EXECUTIONSTATUS="executionStatus",ex.BIGINTEGER="bigInteger",ex.VALUEDESCRIPTOR="valueDescriptor",ex.PERIODDURATIONISO8601="periodDurationISO8601",ex.LONG="long",ex.DATEANDTIME="dateAndTime",ex.BOOLEANMAP="booleanMap",ex.MQTTQOS="MQTTQos",ex.NEGATIVEINTEGER="negativeInteger",ex.TCPIPPORTNUMBER="TCP_IPPortNumber",ex.GEOJSONPOINT="GEO_JSONPoint",ex.SNMPVERSION="SNMPVersion",ex.ASSETTYPE="assetType",ex.JSONOBJECT="JSONObject",ex.INTEGERMAP="integerMap",ex.BIGNUMBER="bigNumber",ex.IPADDRESS="IPAddress",ex.EMAIL="email",ex.TIMESTAMP="timestamp",ex.KNXMESSAGESOURCEADDRESS="kNXMessageSourceAddress",ex.ATTRIBUTEREFERENCE="attributeReference",ex.UUID="UUID",ex.INTEGER="integer",ex.OAUTHGRANT="oAuthGrant",ex.NUMBER="number",ex.DEVICECONFIGMAP="DeviceConfigMap",ex.TEXTMAP="textMap",ex.WEBSOCKETSUBSCRIPTION="websocketSubscription",ex.BOOLEAN="boolean",ex.TIMEANDPERIODDURATIONISO8601="timeAndPeriodDurationISO8601",ex.FORECASTCONFIGURATION="forecastConfiguration",ex.TIMEDURATIONISO8601="timeDurationISO8601",ex.TIMESTAMPISO8601="timestampISO8601",ex.CONSOLEPROVIDERS="consoleProviders",ex.MULTIVALUEDTEXTMAP="multivaluedTextMap",ex.NEGATIVENUMBER="negativeNumber",ex.PARITYBIT="Paritybit",ex.JSON="JSON",ex.CRONEXPRESSION="CRONExpression",ex.INTEGERBYTE="integerByte",ex.AGENTLINK="agentLink",ex.DIRECTION="direction",ex.HOSTORIPADDRESS="hostOrIPAddress",ex.STOPBITS="Stopbits",ex.CALENDAREVENT="calendarEvent",ex.CONNECTIONSTATUS="connectionStatus",ex.VALUECONSTRAINT="valueConstraint",(ew=tE||(tE={})).MONTH="month",ew.MILE_SCANDINAVIAN="mile_scandinavian",ew.VAR="var",ew.OUNCE="ounce",ew.HECTARE="hectare",ew.YARD="yard",ew.YEAR="year",ew.GIGA="giga",ew.JOULE="joule",ew.VOLT="volt",ew.HERTZ="hertz",ew.MILE="mile",ew.DEGREE="degree",ew.KILO="kilo",ew.BTU="btu",ew.TERA="tera",ew.FOOT="foot",ew.MEGA="mega",ew.KELVIN="kelvin",ew.CARBON="carbon",ew.DECIBEL_ATTENUATED="decibel_attenuated",ew.INCH="inch",ew.SQUARED="squared",ew.PERCENTAGE="percentage",ew.IN_HG="inch_mercury",ew.CENTI="centi",ew.GRAM="gram",ew.CUBED="cubed",ew.DAY="day",ew.RADIAN="radian",ew.OHM="ohm",ew.MINUTE="minute",ew.PART_PER_MILLION="ppm",ew.AMP="amp",ew.MASS_POUND="pound",ew.KNOT="knot",ew.METRE="metre",ew.LITRE="litre",ew.FLUID_OUNCE="fluid_ounce",ew.HOUR="hour",ew.ACRE="acre",ew.CELSIUS="celsius",ew.RPM="rpm",ew.PASCAL="pascal",ew.DECIBEL="decibel",ew.LUMEN="lumen",ew.WEEK="week",ew.FAHRENHEIT="fahrenheit",ew.WATT="watt",ew.GALLON="gallon",ew.LUX="lux",ew.MILLI="milli",ew.BAR="bar",ew.HECTO="hecto",ew.PEAK="peak",ew.SECOND="second",ew.MICRO="micro",ew.PER="per",ew.STONE="stone",tk||(tk={});class tL{static getAssetDescriptors(){return tL._assetTypeInfos.map(t=>t.assetDescriptor)}static getMetaItemDescriptors(){return[...this._metaItemDescriptors]}static getValueDescriptors(){return[...this._valueDescriptors]}static getAssetTypeInfos(){return[...this._assetTypeInfos]}static getAssetTypeInfo(t){if(t)return t.assetDescriptor?t:("string"!=typeof t&&(t=t.name),this._assetTypeInfos.find(i=>i.assetDescriptor.name===t))}static getAssetDescriptor(t){if(!t)return;if(t.assetDescriptor)return t.assetDescriptor;if("string"!=typeof t)return t;let i=this._assetTypeInfos.find(i=>i.assetDescriptor.name===t);return i?i.assetDescriptor:void 0}static getAttributeDescriptor(t,i){if(!t)return;let r=this.getAssetTypeInfo(i||"ThingAsset");if(r&&r.attributeDescriptors)return r.attributeDescriptors.find(i=>i.name===t)}static getValueDescriptor(t){let i;if(!t)return;if(t.endsWith("[]"))for(i=0;t.endsWith("[]");)t=t.substring(0,t.length-2),i++;let r=this._valueDescriptors.find(i=>i.name===t);return r&&i&&(r=Object.assign(Object.assign({},r),{arrayDimensions:i})),r}static resolveValueDescriptor(t,i){let r;return i&&("string"==typeof i&&(r=tL.getValueDescriptor(i)),r=i.jsonType?i:tL.getValueDescriptor(i.type)),!r&&t&&(r=tL.getValueDescriptor("JSON")),r}static resolveValueTypeFromValue(t){if(null!=t){if("number"==typeof t)return"number";if("string"==typeof t)return"text";if("boolean"==typeof t)return"boolean";if(Array.isArray(t)){let i=1,r=t.find(t=>null!=t);for(;Array.isArray(r);)r=r.find(t=>null!=t),i++;let n=this.resolveValueTypeFromValue(r);if(!n)return;for(;i>0;)n+="[]",i--;return n}if(t instanceof Date)return"dateAndTime"}}static getAttributeAndValueDescriptors(t,i,r){let n,o;if(i&&"string"!=typeof i)n=i;else{let o=this.getAssetTypeInfo(t||"ThingAsset");if(!o)return[void 0,void 0];"string"==typeof i&&(n=this.getAttributeDescriptor(i,o)),!n&&r&&(n={type:r.type,name:r.name,meta:r.meta})}return n&&(o=this.getValueDescriptor(n.type)),[n,o]}static getMetaItemDescriptor(t){if(t)return this._metaItemDescriptors.find(i=>i.name===t)}static getAssetDescriptorColour(t,i){let r=this.getAssetDescriptor(t);return r&&r.colour?r.colour:i}static getAssetDescriptorIcon(t,i){let r=this.getAssetDescriptor(t);return r&&r.icon?r.icon:i}}tL._assetTypeInfos=[],tL._metaItemDescriptors=[],tL._valueDescriptors=[];let tP=t=>"string"==typeof t,tI=()=>{let t,i,r=new Promise((r,n)=>{t=r,i=n});return r.resolve=t,r.reject=i,r},tR=t=>null==t?"":String(t),tB=/###/g,tO=t=>t&&t.includes("###")?t.replace(tB,"."):t,tz=t=>!t||tP(t),tY=(t,i,r)=>{let n=tP(i)?i.split("."):i,o=0;for(;o<n.length-1;){if(tz(t))return{};let i=tO(n[o]);!t[i]&&r&&(t[i]=new r),t=Object.prototype.hasOwnProperty.call(t,i)?t[i]:{},++o}return tz(t)?{}:{obj:t,k:tO(n[o])}},tj=(t,i,r)=>{let{obj:n,k:o}=tY(t,i,Object);if(void 0!==n||1===i.length){n[o]=r;return}let a=i[i.length-1],s=i.slice(0,i.length-1),l=tY(t,s,Object);for(;void 0===l.obj&&s.length;)a=`${s[s.length-1]}.${a}`,l=tY(t,s=s.slice(0,s.length-1),Object),l?.obj&&void 0!==l.obj[`${l.k}.${a}`]&&(l.obj=void 0);l.obj[`${l.k}.${a}`]=r},tN=(t,i)=>{let{obj:r,k:n}=tY(t,i);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},tU=(t,i,r)=>{for(let n in i)"__proto__"!==n&&"constructor"!==n&&(Object.prototype.hasOwnProperty.call(t,n)?tP(t[n])||t[n]instanceof String||tP(i[n])||i[n]instanceof String?r&&(t[n]=i[n]):tU(t[n],i[n],r):t[n]=i[n]);return t},tH={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},tV=t=>tP(t)?t.replace(/[&<>"'\/]/g,t=>tH[t]):t,t$=[" ",",","?","!",";"],tq=new class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){let i=this.regExpMap.get(t);if(void 0!==i)return i;let r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}(20),tG=(t,i,r=".")=>{if(!t)return;if(t[i]){if(!Object.prototype.hasOwnProperty.call(t,i))return;return t[i]}let n=i.split(r),o=t;for(let t=0;t<n.length;){let i;if(!o||"object"!=typeof o)return;let a="";for(let s=t;s<n.length;++s)if(s!==t&&(a+=r),a+=n[s],void 0!==(i=o[a])){if(["string","number","boolean"].includes(typeof i)&&s<n.length-1)continue;t+=s-t+1;break}o=i}return o},tW=t=>t?.replace(/_/g,"-"),tZ={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,i){console?.[t]?.apply?.(console,i)}};var tK=new class t{constructor(t,i={}){this.init(t,i)}init(t,i={}){this.prefix=i.prefix||"i18next:",this.logger=t||tZ,this.options=i,this.debug=i.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,i,r,n){return n&&!this.debug?null:(t=t.map(t=>tP(t)?t.replace(/[\r\n\x00-\x1F\x7F]/g," "):t),tP(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[i](t))}create(i){return new t(this.logger,{...{prefix:`${this.prefix}:${i}:`},...this.options})}clone(i){return(i=i||this.options).prefix=i.prefix||this.prefix,new t(this.logger,i)}};class tJ{constructor(){this.observers={}}on(t,i){return t.split(" ").forEach(t=>{this.observers[t]||(this.observers[t]=new Map);let r=this.observers[t].get(i)||0;this.observers[t].set(i,r+1)}),this}off(t,i){if(this.observers[t]){if(!i)return void delete this.observers[t];this.observers[t].delete(i)}}once(t,i){let r=(...n)=>{i(...n),this.off(t,r)};return this.on(t,r),this}emit(t,...i){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([t,r])=>{for(let n=0;n<r;n++)t(...i)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([r,n])=>{for(let o=0;o<n;o++)r(t,...i)})}}class tX extends tJ{constructor(t,i={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=i,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.includes(t)||this.options.ns.push(t)}removeNamespaces(t){let i=this.options.ns.indexOf(t);i>-1&&this.options.ns.splice(i,1)}getResource(t,i,r,n={}){let o,a=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,s=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;t.includes(".")?o=t.split("."):(o=[t,i],r&&(Array.isArray(r)?o.push(...r):tP(r)&&a?o.push(...r.split(a)):o.push(r)));let l=tN(this.data,o);return(!l&&!i&&!r&&t.includes(".")&&(t=o[0],i=o[1],r=o.slice(2).join(".")),!l&&s&&tP(r))?tG(this.data?.[t]?.[i],r,a):l}addResource(t,i,r,n,o={silent:!1}){let a=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,s=[t,i];r&&(s=s.concat(a?r.split(a):r)),t.includes(".")&&(s=t.split("."),n=i,i=s[1]),this.addNamespaces(i),tj(this.data,s,n),o.silent||this.emit("added",t,i,r,n)}addResources(t,i,r,n={silent:!1}){for(let n in r)(tP(r[n])||Array.isArray(r[n]))&&this.addResource(t,i,n,r[n],{silent:!0});n.silent||this.emit("added",t,i,r)}addResourceBundle(t,i,r,n,o,a={silent:!1,skipCopy:!1}){let s=[t,i];t.includes(".")&&(s=t.split("."),n=r,r=i,i=s[1]),this.addNamespaces(i);let l=tN(this.data,s)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),n?tU(l,r,o):l={...l,...r},tj(this.data,s,l),a.silent||this.emit("added",t,i,r)}removeResourceBundle(t,i){this.hasResourceBundle(t,i)&&delete this.data[t][i],this.removeNamespaces(i),this.emit("removed",t,i)}hasResourceBundle(t,i){return void 0!==this.getResource(t,i)}getResourceBundle(t,i){return i||(i=this.options.defaultNS),this.getResource(t,i)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){let i=this.getDataByLanguage(t);return!!(i&&Object.keys(i)||[]).find(t=>i[t]&&Object.keys(i[t]).length>0)}toJSON(){return this.data}}var tQ={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,i,r,n,o){return t.forEach(t=>{i=this.processors[t]?.process(i,r,n,o)??i}),i}};let t0=Symbol("i18next/PATH_KEY");function t1(t,i){let r,n,o,{[t0]:a}=t((n=[],(o=Object.create(null)).get=(t,i)=>(r?.revoke?.(),i===t0)?n:(n.push(i),(r=Proxy.revocable(t,o)).proxy),Proxy.revocable(Object.create(null),o).proxy)),s=i?.keySeparator??".",l=i?.nsSeparator??":",c=i?.enableSelector==="strict";if(a.length>1&&l){let t=i?.ns,r=c?Array.isArray(t)?t:t?[t]:null:Array.isArray(t)?t:null;if(r&&(c?r:r.length>1?r.slice(1):[]).includes(a[0]))return`${a[0]}${l}${a.slice(1).join(s)}`}return a.join(s)}let t2=t=>!tP(t)&&"boolean"!=typeof t&&"number"!=typeof t;class t3 extends tJ{constructor(t,i={}){super(),((t,i,r)=>{t.forEach(t=>{i[t]&&(r[t]=i[t])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=i,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=tK.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,i={interpolation:{}}){let r={...i};if(null==t)return!1;let n=this.resolve(t,r);if(n?.res===void 0)return!1;let o=t2(n.res);return!1!==r.returnObjects||!o}extractFromKey(t,i){let r=void 0!==i.nsSeparator?i.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");let n=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,o=i.ns||this.options.defaultNS||[],a=r&&t.includes(r),s=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!((t,i,r)=>{i=i||"",r=r||"";let n=t$.filter(t=>!i.includes(t)&&!r.includes(t));if(0===n.length)return!0;let o=tq.getRegExp(`(${n.map(t=>"?"===t?"\\?":t).join("|")})`),a=!o.test(t);if(!a){let i=t.indexOf(r);i>0&&!o.test(t.substring(0,i))&&(a=!0)}return a})(t,r,n);if(a&&!s){let i=t.match(this.interpolator.nestingRegexp);if(i&&i.length>0)return{key:t,namespaces:tP(o)?[o]:o};let a=t.split(r);(r!==n||r===n&&this.options.ns.includes(a[0]))&&(o=a.shift()),t=a.join(n)}return{key:t,namespaces:tP(o)?[o]:o}}translate(t,i,r){let n="object"==typeof i?{...i}:i;if("object"!=typeof n&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof n&&(n={...n}),n||(n={}),null==t)return"";"function"==typeof t&&(t=t1(t,{...this.options,...n})),Array.isArray(t)||(t=[String(t)]),t=t.map(t=>"function"==typeof t?t1(t,{...this.options,...n}):String(t));let o=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,a=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,{key:s,namespaces:l}=this.extractFromKey(t[t.length-1],n),c=l[l.length-1],d=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===d&&(d=":");let u=n.lng||this.language,h=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u?.toLowerCase()==="cimode")return h?o?{res:`${c}${d}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${d}${s}`:o?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:s;let m=this.resolve(t,n),f=m?.res,p=m?.usedKey||s,_=m?.exactUsedKey||s,g=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,y=void 0!==n.count&&!tP(n.count),v=t3.hasDefaultValue(n),F=y?this.pluralResolver.getSuffix(u,n.count,n):"",x=n.ordinal&&y?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",w=y&&!n.ordinal&&0===n.count,E=w&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${F}`]||n[`defaultValue${x}`]||n.defaultValue,k=f;b&&!f&&v&&(k=E);let M=t2(k),D=Object.prototype.toString.apply(k);if(b&&k&&M&&!["[object Number]","[object Function]","[object RegExp]"].includes(D)&&!(tP(g)&&Array.isArray(k))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,k,{...n,ns:l}):`key '${s} (${this.language})' returned an object instead of string.`;return o?(m.res=t,m.usedParams=this.getUsedParamsDetails(n),m):t}if(a){let t=Array.isArray(k),i=t?[]:{},r=t?_:p;for(let t in k)if(Object.prototype.hasOwnProperty.call(k,t)){let o=`${r}${a}${t}`;v&&!f?i[t]=this.translate(o,{...n,defaultValue:t2(E)?E[t]:void 0,...{joinArrays:!1,ns:l}}):i[t]=this.translate(o,{...n,joinArrays:!1,ns:l}),i[t]===o&&(i[t]=k[t])}f=i}}else if(b&&tP(g)&&Array.isArray(f))(f=f.join(g))&&(f=this.extendTranslation(f,t,n,r));else{let i=!1,o=!1;!this.isValidLookup(f)&&v&&(i=!0,f=E),this.isValidLookup(f)||(o=!0,f=s);let l=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:f,h=v&&E!==f&&this.options.updateMissing;if(o||i||h){if(this.logger.log(h?"updateKey":"missingKey",u,c,y&&!h?`${s}${this.pluralResolver.getSuffix(u,n.count,n)}`:s,h?E:f),a){let t=this.resolve(s,{...n,keySeparator:!1});t&&t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let t=[],i=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&i&&i[0])for(let r=0;r<i.length;r++)t.push(i[r]);else"all"===this.options.saveMissingTo?t=this.languageUtils.toResolveHierarchy(n.lng||this.language):t.push(n.lng||this.language);let r=(t,i,r)=>{let o=v&&r!==f?r:l;this.options.missingKeyHandler?this.options.missingKeyHandler(t,c,i,o,h,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(t,c,i,o,h,n),this.emit("missingKey",t,c,i,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&y?t.forEach(t=>{let i=this.pluralResolver.getSuffixes(t,n);w&&n[`defaultValue${this.options.pluralSeparator}zero`]&&!i.includes(`${this.options.pluralSeparator}zero`)&&i.push(`${this.options.pluralSeparator}zero`),i.forEach(i=>{r([t],s+i,n[`defaultValue${i}`]||E)})}):r(t,s,E))}f=this.extendTranslation(f,t,n,m,r),o&&f===s&&this.options.appendNamespaceToMissingKey&&(f=`${c}${d}${s}`),(o||i)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${d}${s}`:s,i?f:void 0,n))}return o?(m.res=f,m.usedParams=this.getUsedParamsDetails(n),m):f}extendTranslation(t,i,r,n,o){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){let a;r.interpolation&&this.interpolator.init({...r,...{interpolation:{...this.options.interpolation,...r.interpolation}}});let s=tP(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){let i=t.match(this.interpolator.nestingRegexp);a=i&&i.length}let l=r.replace&&!tP(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),t=this.interpolator.interpolate(t,l,r.lng||this.language||n.usedLng,r),s){let i=t.match(this.interpolator.nestingRegexp);a<(i&&i.length)&&(r.nest=!1)}!r.lng&&n&&n.res&&(r.lng=this.language||n.usedLng),!1!==r.nest&&(t=this.interpolator.nest(t,(...t)=>o?.[0]!==t[0]||r.context?this.translate(...t,i):(this.logger.warn(`It seems you are nesting recursively key: ${t[0]} in key: ${i[0]}`),null),r)),r.interpolation&&this.interpolator.reset()}let a=r.postProcess||this.options.postProcess,s=tP(a)?[a]:a;return null!=t&&s?.length&&!1!==r.applyPostProcessor&&(t=tQ.handle(s,t,i,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,i={}){let r,n,o,a,s;return tP(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(t=>"function"==typeof t?t1(t,{...this.options,...i}):t)),t.forEach(t=>{if(this.isValidLookup(r))return;let l=this.extractFromKey(t,i),c=l.key;n=c;let d=l.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));let u=void 0!==i.count&&!tP(i.count),h=u&&!i.ordinal&&0===i.count,m=void 0!==i.context&&(tP(i.context)||"number"==typeof i.context)&&""!==i.context,f=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);d.forEach(t=>{this.isValidLookup(r)||(s=t,!this.checkedLoadedFor[`${f[0]}-${t}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(this.checkedLoadedFor[`${f[0]}-${t}`]=!0,this.logger.warn(`key "${n}" for languages "${f.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach(n=>{let s;if(this.isValidLookup(r))return;a=n;let l=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(l,c,n,t,i);else{let t;u&&(t=this.pluralResolver.getSuffix(n,i.count,i));let r=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(i.ordinal&&t.startsWith(o)&&l.push(c+t.replace(o,this.options.pluralSeparator)),l.push(c+t),h&&l.push(c+r)),m){let n=`${c}${this.options.contextSeparator||"_"}${i.context}`;l.push(n),u&&(i.ordinal&&t.startsWith(o)&&l.push(n+t.replace(o,this.options.pluralSeparator)),l.push(n+t),h&&l.push(n+r))}}for(;s=l.pop();)this.isValidLookup(r)||(o=s,r=this.getResource(n,t,s,i))}))})}),{res:r,usedKey:n,exactUsedKey:o,usedLng:a,usedNS:s}}isValidLookup(t){return void 0!==t&&!(!this.options.returnNull&&null===t)&&!(!this.options.returnEmptyString&&""===t)}getResource(t,i,r,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,i,r,n):this.resourceStore.getResource(t,i,r,n)}getUsedParamsDetails(t={}){let i=t.replace&&!tP(t.replace),r=i?t.replace:t;if(i&&void 0!==t.count&&(r={...r,count:t.count}),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!i)for(let t of(r={...r},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete r[t];return r}static hasDefaultValue(t){for(let i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&i.startsWith("defaultValue")&&void 0!==t[i])return!0;return!1}}class t5{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=tK.create("languageUtils")}getScriptPartFromCode(t){if(!(t=tW(t))||!t.includes("-"))return null;let i=t.split("-");return 2===i.length||(i.pop(),"x"===i[i.length-1].toLowerCase())?null:this.formatLanguageCode(i.join("-"))}getLanguagePartFromCode(t){if(!(t=tW(t))||!t.includes("-"))return t;let i=t.split("-");return this.formatLanguageCode(i[0])}formatLanguageCode(t){if(tP(t)&&t.includes("-")){let i;try{i=Intl.getCanonicalLocales(t)[0]}catch(t){}return(i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i)?i:this.options.lowerCaseLng?t.toLowerCase():t}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(t)}getBestMatchFromCodes(t){let i;return t?(t.forEach(t=>{if(i)return;let r=this.formatLanguageCode(t);(!this.options.supportedLngs||this.isSupportedCode(r))&&(i=r)}),!i&&this.options.supportedLngs&&t.forEach(t=>{if(i)return;let r=this.getScriptPartFromCode(t);if(this.isSupportedCode(r))return i=r;let n=this.getLanguagePartFromCode(t);if(this.isSupportedCode(n))return i=n;i=this.options.supportedLngs.find(t=>t===n||(!!t.includes("-")||!!n.includes("-"))&&!!(t.includes("-")&&!n.includes("-")&&t.slice(0,t.indexOf("-"))===n||t.startsWith(n)&&n.length>1))}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i):null}getFallbackCodes(t,i){if(!t)return[];if("function"==typeof t&&(t=t(i)),tP(t)&&(t=[t]),Array.isArray(t))return t;if(!i)return t.default||[];let r=t[i];return r||(r=t[this.getScriptPartFromCode(i)]),r||(r=t[this.formatLanguageCode(i)]),r||(r=t[this.getLanguagePartFromCode(i)]),r||(r=t.default),r||[]}toResolveHierarchy(t,i){let r=this.getFallbackCodes((!1===i?[]:i)||this.options.fallbackLng||[],t),n=[],o=t=>{t&&(this.isSupportedCode(t)?n.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return tP(t)&&(t.includes("-")||t.includes("_"))?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(t))):tP(t)&&o(this.formatLanguageCode(t)),r.forEach(t=>{n.includes(t)||o(this.formatLanguageCode(t))}),n}}let t4={zero:0,one:1,two:2,few:3,many:4,other:5},t6={select:t=>1===t?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class t8{constructor(t,i={}){this.languageUtils=t,this.options=i,this.logger=tK.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,i={}){let r,n=tW("dev"===t?"en":t),o=i.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:o});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];try{r=new Intl.PluralRules(n,{type:o})}catch(o){if("u"<typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),t6;if(!t.match(/-|_/))return t6;let n=this.languageUtils.getLanguagePartFromCode(t);r=this.getRule(n,i)}return this.pluralRulesCache[a]=r,r}needsPlural(t,i={}){let r=this.getRule(t,i);return r||(r=this.getRule("dev",i)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,i,r={}){return this.getSuffixes(t,r).map(t=>`${i}${t}`)}getSuffixes(t,i={}){let r=this.getRule(t,i);return(r||(r=this.getRule("dev",i)),r)?r.resolvedOptions().pluralCategories.sort((t,i)=>t4[t]-t4[i]).map(t=>`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${t}`):[]}getSuffix(t,i,r={}){let n=this.getRule(t,r);return n?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${n.select(i)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",i,r))}}let t7=(t,i,r,n=".",o=!0)=>{let a,s=void 0!==(a=tN(t,r))?a:tN(i,r);return!s&&o&&tP(r)&&void 0===(s=tG(t,r,n))&&(s=tG(i,r,n)),s},t9=t=>t.replace(/\$/g,"$$$$");class ie{constructor(t={}){this.logger=tK.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(t=>t),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});let{escape:i,escapeValue:r,useRawValueToEscape:n,prefix:o,prefixEscaped:a,suffix:s,suffixEscaped:l,formatSeparator:c,unescapeSuffix:d,unescapePrefix:u,nestingPrefix:h,nestingPrefixEscaped:m,nestingSuffix:f,nestingSuffixEscaped:p,nestingOptionsSeparator:_,maxReplaces:g,alwaysFormat:b}=t.interpolation;this.escape=void 0!==i?i:tV,this.escapeValue=void 0===r||r,this.useRawValueToEscape=void 0!==n&&n,this.prefix=o?o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):a||"{{",this.suffix=s?s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=d?"":u?u.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):"-",this.unescapeSuffix=this.unescapePrefix?"":d?d.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):"",this.nestingPrefix=h?h.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):m||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=f?f.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):p||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=_||",",this.maxReplaces=g||1e3,this.alwaysFormat=void 0!==b&&b,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let t=(t,i)=>t?.source===i?(t.lastIndex=0,t):RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,i,r,n){let o,a,s,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=t=>{if(!t.includes(this.formatSeparator)){let o=t7(i,l,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,r,{...n,...i,interpolationkey:t}):o}let o=t.split(this.formatSeparator),a=o.shift().trim(),s=o.join(this.formatSeparator).trim();return this.format(t7(i,l,a,this.options.keySeparator,this.options.ignoreJSONStructure),s,r,{...n,...i,interpolationkey:a})};this.resetRegExp(),!this.escapeValue&&"string"==typeof t&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");let d=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:t=>t},{regex:this.regexp,safeValue:t=>this.escapeValue?this.escape(t):t}].forEach(i=>{for(s=0;o=i.regex.exec(t);){let r=o[1].trim();if(void 0===(a=c(r)))if("function"==typeof d){let i=d(t,o,n);a=tP(i)?i:""}else if(n&&Object.prototype.hasOwnProperty.call(n,r))a="";else if(u){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${r} for interpolating ${t}`),a="";else tP(a)||this.useRawValueToEscape||(a=tR(a));let l=i.safeValue(a);if(t=t.replace(o[0],t9(l)),u?(i.regex.lastIndex+=l.length,i.regex.lastIndex-=o[0].length):i.regex.lastIndex=0,++s>=this.maxReplaces)break}}),t}nest(t,i,r={}){let n,o,a,s=(t,i)=>{let r=this.nestingOptionsSeparator;if(!t.includes(r))return t;let n=t.split(RegExp(`${r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}[ ]*{`)),o=`{${n[1]}`;t=n[0];let s=(o=this.interpolate(o,a)).match(/'/g),l=o.match(/"/g);((s?.length??0)%2!=0||l)&&(l?.length??0)%2==0||(o=o.replace(/'/g,'"'));try{a=JSON.parse(o),i&&(a={...i,...a})}catch(i){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,i),`${t}${r}${o}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,t};for(;n=this.nestingRegexp.exec(t);){let l=[];(a=(a={...r}).replace&&!tP(a.replace)?a.replace:a).applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/s.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(-1!==c&&(l=n[1].slice(c).split(this.formatSeparator).map(t=>t.trim()).filter(Boolean),n[1]=n[1].slice(0,c)),(o=i(s.call(this,n[1].trim(),a),a))&&n[0]===t&&!tP(o))return o;tP(o)||(o=tR(o)),o||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${t}`),o=""),l.length&&(o=l.reduce((t,i)=>this.format(t,i,r.lng,{...r,interpolationkey:n[1].trim()}),o.trim())),t=t.replace(n[0],o),this.regexp.lastIndex=0}return t}}let it=t=>{let i={};return(r,n,o)=>{let a=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(a={...a,[o.interpolationkey]:void 0});let s=n+JSON.stringify(a),l=i[s];return l||(l=t(tW(n),o),i[s]=l),l(r)}},ii=t=>(i,r,n)=>t(tW(r),n)(i);class ir{constructor(t={}){this.logger=tK.create("formatter"),this.options=t,this.init(t)}init(t,i={interpolation:{}}){this.formatSeparator=i.interpolation.formatSeparator||",";let r=i.cacheInBuiltFormats?it:ii;this.formats={number:r((t,i)=>{let r=new Intl.NumberFormat(t,{...i});return t=>r.format(t)}),currency:r((t,i)=>{let r=new Intl.NumberFormat(t,{...i,style:"currency"});return t=>r.format(t)}),datetime:r((t,i)=>{let r=new Intl.DateTimeFormat(t,{...i});return t=>r.format(t)}),relativetime:r((t,i)=>{let r=new Intl.RelativeTimeFormat(t,{...i});return t=>r.format(t,i.range||"day")}),list:r((t,i)=>{let r=new Intl.ListFormat(t,{...i});return t=>r.format(t)})}}add(t,i){this.formats[t.toLowerCase().trim()]=i}addCached(t,i){this.formats[t.toLowerCase().trim()]=it(i)}format(t,i,r,n={}){if(!i||null==t)return t;let o=i.split(this.formatSeparator),a=[];for(let t=0;t<o.length;t++){let i=o[t];for(;i.indexOf("(")>-1&&!i.includes(")")&&t+1<o.length;)i=`${i}${this.formatSeparator}${o[++t]}`;a.push(i)}return a.reduce((t,i)=>{let{formatName:o,formatOptions:a}=(t=>{let i=t.toLowerCase().trim(),r={};if(t.includes("(")){let n=t.split("(");i=n[0].toLowerCase().trim();let o=n[1].slice(0,-1);"currency"!==i||o.includes(":")?"relativetime"!==i||o.includes(":")?o.split(";").forEach(t=>{if(t){let[i,...n]=t.split(":"),o=n.join(":").trim().replace(/^'+|'+$/g,""),a=i.trim();r[a]||(r[a]=o),"false"===o&&(r[a]=!1),"true"===o&&(r[a]=!0),isNaN(o)||(r[a]=parseInt(o,10))}}):r.range||(r.range=o.trim()):r.currency||(r.currency=o.trim())}return{formatName:i,formatOptions:r}})(i);if(this.formats[o]){let i=t;try{let s=n?.formatParams?.[n.interpolationkey]||{},l=s.locale||s.lng||n.locale||n.lng||r;i=this.formats[o](t,l,{...a,...n,...s})}catch(t){this.logger.warn(t)}return i}return this.logger.warn(`there was no format function for ${o}`),t},t)}}class io extends tJ{constructor(t,i,r,n={}){super(),this.backend=t,this.store=i,this.services=r,this.languageUtils=r.languageUtils,this.options=n,this.logger=tK.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,n.backend,n)}queueLoad(t,i,r,n){let o={},a={},s={},l={};return t.forEach(t=>{let n=!0;i.forEach(i=>{let s=`${t}|${i}`;!r.reload&&this.store.hasResourceBundle(t,i)?this.state[s]=2:this.state[s]<0||(1===this.state[s]?void 0===a[s]&&(a[s]=!0):(this.state[s]=1,n=!1,void 0===a[s]&&(a[s]=!0),void 0===o[s]&&(o[s]=!0),void 0===l[i]&&(l[i]=!0)))}),n||(s[t]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,i,r){let n=t.split("|"),o=n[0],a=n[1];i&&this.emit("failedLoading",o,a,i),!i&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=i?-1:2,i&&r&&(this.state[t]=0);let s={};this.queue.forEach(r=>{((t,i,r)=>{let{obj:n,k:o}=tY(t,i,Object);n[o]=n[o]||[],n[o].push(r)})(r.loaded,[o],a),void 0!==r.pending[t]&&(delete r.pending[t],r.pendingCount--),i&&r.errors.push(i),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach(t=>{s[t]||(s[t]={});let i=r.loaded[t];i.length&&i.forEach(i=>{void 0===s[t][i]&&(s[t][i]=!0)})}),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(t=>!t.done)}read(t,i,r,n=0,o=this.retryTimeout,a){if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:t,ns:i,fcName:r,tried:n,wait:o,callback:a});this.readingCalls++;let s=(s,l)=>{if(this.readingCalls--,this.waitingReads.length>0){let t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}s&&l&&n<this.maxRetries?setTimeout(()=>{this.read(t,i,r,n+1,2*o,a)},o):a(s,l)},l=this.backend[r].bind(this.backend);if(2===l.length){try{let r=l(t,i);r&&"function"==typeof r.then?r.then(t=>s(null,t)).catch(s):s(null,r)}catch(t){s(t)}return}return l(t,i,s)}prepareLoading(t,i,r={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();tP(t)&&(t=this.languageUtils.toResolveHierarchy(t)),tP(i)&&(i=[i]);let o=this.queueLoad(t,i,r,n);if(!o.toLoad.length)return o.pending.length||n(),null;o.toLoad.forEach(t=>{this.loadOne(t)})}load(t,i,r){this.prepareLoading(t,i,{},r)}reload(t,i,r){this.prepareLoading(t,i,{reload:!0},r)}loadOne(t,i=""){let r=t.split("|"),n=r[0],o=r[1];this.read(n,o,"read",void 0,void 0,(r,a)=>{r&&this.logger.warn(`${i}loading namespace ${o} for language ${n} failed`,r),!r&&a&&this.logger.log(`${i}loaded namespace ${o} for language ${n}`,a),this.loaded(t,r,a)})}saveMissing(t,i,r,n,o,a={},s=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(i))return void this.logger.warn(`did not save key "${r}" as the namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");if(null!=r&&""!==r){if(this.backend?.create){let l={...a,isUpdate:o},c=this.backend.create.bind(this.backend);if(c.length<6)try{let o;(o=5===c.length?c(t,i,r,n,l):c(t,i,r,n))&&"function"==typeof o.then?o.then(t=>s(null,t)).catch(s):s(null,o)}catch(t){s(t)}else c(t,i,r,n,s,l)}t&&t[0]&&this.store.addResource(t[0],i,r,n)}}}let ia=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let i={};if("object"==typeof t[1]&&(i=t[1]),tP(t[1])&&(i.defaultValue=t[1]),tP(t[2])&&(i.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){let r=t[3]||t[2];Object.keys(r).forEach(t=>{i[t]=r[t]})}return i},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),is=t=>(tP(t.ns)&&(t.ns=[t.ns]),tP(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),tP(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&!t.supportedLngs.includes("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),il=()=>{};class ic extends tJ{constructor(t={},i){if(super(),this.options=is(t),this.services={},this.logger=tK,this.modules={external:[]},(t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(i=>{"function"==typeof t[i]&&(t[i]=t[i].bind(t))})})(this),i&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,i),this;setTimeout(()=>{this.init(t,i)},0)}}init(t={},i){this.isInitializing=!0,"function"==typeof t&&(i=t,t={}),null==t.defaultNS&&t.ns&&(tP(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));let r=ia();this.options={...r,...this.options,...is(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler);let n=t=>t?"function"==typeof t?new t:t:null;if(!this.options.isClone){let t;this.modules.logger?tK.init(n(this.modules.logger),this.options):tK.init(null,this.options),t=this.modules.formatter?this.modules.formatter:ir;let i=new t5(this.options);this.store=new tX(this.options.resources,this.options);let r=this.services;r.logger=tK,r.resourceStore=this.store,r.languageUtils=i,r.pluralResolver=new t8(i,{prepend:this.options.pluralSeparator}),t&&(r.formatter=n(t),r.formatter.init&&r.formatter.init(r,this.options),this.options.interpolation.format=r.formatter.format.bind(r.formatter)),r.interpolator=new ie(this.options),r.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},r.backendConnector=new io(n(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",(t,...i)=>{this.emit(t,...i)}),this.modules.languageDetector&&(r.languageDetector=n(this.modules.languageDetector),r.languageDetector.init&&r.languageDetector.init(r,this.options.detection,this.options)),this.modules.i18nFormat&&(r.i18nFormat=n(this.modules.i18nFormat),r.i18nFormat.init&&r.i18nFormat.init(this)),this.translator=new t3(this.services,this.options),this.translator.on("*",(t,...i)=>{this.emit(t,...i)}),this.modules.external.forEach(t=>{t.init&&t.init(this)})}if(this.format=this.options.interpolation.format,i||(i=il),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(t=>{this[t]=(...i)=>this.store[t](...i)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(t=>{this[t]=(...i)=>(this.store[t](...i),this)});let o=tI(),a=()=>{let t=(t,r)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(r),i(t,r)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),o}loadResources(t,i=il){let r=i,n=tP(t)?t:this.language;if("function"==typeof t&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(n?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return r();let t=[],i=i=>{i&&"cimode"!==i&&this.services.languageUtils.toResolveHierarchy(i).forEach(i=>{"cimode"!==i&&(t.includes(i)||t.push(i))})};n?i(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(t=>i(t)),this.options.preload?.forEach?.(t=>i(t)),this.services.backendConnector.load(t,this.options.ns,t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),r(t)})}else r(null)}reloadResources(t,i,r){let n=tI();return"function"==typeof t&&(r=t,t=void 0),"function"==typeof i&&(r=i,i=void 0),t||(t=this.languages),i||(i=this.options.ns),r||(r=il),this.services.backendConnector.reload(t,i,t=>{n.resolve(),r(t)}),n}use(t){if(!t)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&tQ.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!["cimode","dev"].includes(t)){for(let t=0;t<this.languages.length;t++){let i=this.languages[t];if(!["cimode","dev"].includes(i)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&!this.languages.includes(t)&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,i){this.isLanguageChangingTo=t;let r=tI();this.emit("languageChanging",t);let n=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},o=(o,a)=>{a?this.isLanguageChangingTo===t&&(n(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit("languageChanged",a),this.logger.log("languageChanged",a)):this.isLanguageChangingTo=void 0,r.resolve((...t)=>this.t(...t)),i&&i(o,(...t)=>this.t(...t))},a=i=>{t||i||!this.services.languageDetector||(i=[]);let r=tP(i)?i:i&&i[0],a=this.store.hasLanguageSomeTranslations(r)?r:this.services.languageUtils.getBestMatchFromCodes(tP(i)?[i]:i);a&&(this.language||n(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,t=>{o(t,a)})};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t):a(this.services.languageDetector.detect()),r}getFixedT(t,i,r,n){let o=n?.scopeNs,a=(t,i,...n)=>{let s,l;(s="object"!=typeof i?this.options.overloadTranslationOptionHandler([t,i].concat(n)):{...i}).lng=s.lng||a.lng,s.lngs=s.lngs||a.lngs;let c=void 0!==s.ns&&null!==s.ns;s.ns=s.ns||a.ns,""!==s.keyPrefix&&(s.keyPrefix=s.keyPrefix||r||a.keyPrefix);let d={...this.options,...s};Array.isArray(o)&&!c&&(d.ns=o),"function"==typeof s.keyPrefix&&(s.keyPrefix=t1(s.keyPrefix,d));let u=this.options.keySeparator||".";return s.keyPrefix&&Array.isArray(t)?l=t.map(t=>("function"==typeof t&&(t=t1(t,d)),`${s.keyPrefix}${u}${t}`)):("function"==typeof t&&(t=t1(t,d)),l=s.keyPrefix?`${s.keyPrefix}${u}${t}`:t),this.t(l,s)};return tP(t)?a.lng=t:a.lngs=t,a.ns=i,a.keyPrefix=r,a}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,i={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let r=i.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;let a=(t,i)=>{let r=this.services.backendConnector.state[`${t}|${i}`];return -1===r||0===r||2===r};if(i.precheck){let t=i.precheck(this,a);if(void 0!==t)return t}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!n||a(o,t)))}loadNamespaces(t,i){let r=tI();return this.options.ns?(tP(t)&&(t=[t]),t.forEach(t=>{this.options.ns.includes(t)||this.options.ns.push(t)}),this.loadResources(t=>{r.resolve(),i&&i(t)}),r):(i&&i(),Promise.resolve())}loadLanguages(t,i){let r=tI();tP(t)&&(t=[t]);let n=this.options.preload||[],o=t.filter(t=>!n.includes(t)&&this.services.languageUtils.isSupportedCode(t));return o.length?(this.options.preload=n.concat(o),this.loadResources(t=>{r.resolve(),i&&i(t)}),r):(i&&i(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{let i=new Intl.Locale(t);if(i&&i.getTextInfo){let t=i.getTextInfo();if(t&&t.direction)return t.direction}}catch(t){}let i=this.services?.languageUtils||new t5(ia());return t.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].includes(i.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},i){let r=new ic(t,i);return r.createInstance=ic.createInstance,r}cloneInstance(t={},i=il){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let n={...this.options,...t,isClone:!0},o=new ic(n);if((void 0!==t.debug||void 0!==t.prefix)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(t=>{o[t]=this[t]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new tX(Object.keys(this.store.data).reduce((t,i)=>(t[i]={...this.store.data[i]},t[i]=Object.keys(t[i]).reduce((r,n)=>(r[n]={...t[i][n]},r),t[i]),t),{}),n),o.services.resourceStore=o.store),t.interpolation){let i={...ia().interpolation,...this.options.interpolation,...t.interpolation},r={...n,interpolation:i};o.services.interpolator=new ie(r)}return o.translator=new t3(o.services,n),o.translator.on("*",(t,...i)=>{o.emit(t,...i)}),o.init(n,i),o.translator.options=n,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let id=ic.createInstance();id.createInstance,id.dir,id.init,id.loadResources,id.reloadResources,id.use,id.changeLanguage,id.getFixedT,id.t,id.exists,id.setDefaultNamespace,id.hasLoadedNamespace,id.loadNamespaces,id.loadLanguages;var iu=r(4867),ih=r.n(iu);r(3472);class im{get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promise}constructor(){this._promise=new Promise((t,i)=>{this._resolve=t,this._reject=i}),Object.freeze(this)}}function ip(t,i,r=!0){if(null==t||null==i)return t===i;if(t.constructor!==i.constructor)return!1;if(t instanceof Function||t instanceof RegExp)return t===i;if(t===i||t.valueOf()===i.valueOf())return!0;if(Array.isArray(t)&&t.length!==i.length||t instanceof Date||!(t instanceof Object)||!(i instanceof Object))return!1;if(r){if(Array.isArray(t))return t.every((t,r)=>ip(t,i[r]));let r=Object.keys(t);return Object.keys(i).every(t=>-1!==r.indexOf(t))&&r.every(r=>ip(t[r],i[r]))}return!1}function i_(t){if(null==t)return"";let i=!1;return t.split(/([A-Z]|\d)/).map((t,r,n)=>{if(!t)return t;if(!i)return i=!0,t.charAt(0).toUpperCase()+t.slice(1);if("_"===t)return" ";if(1===t.length&&t===t.toUpperCase()){let i=!n[r-1]||"_"===n[r-1],o=r+1<n.length&&n[r+1]&&"_"!==n[r+1],a=r+3>n.length||!n[r+1]&&!n[r+3];(!i||o)&&(t=" "+t),!o&&(i||a)||(t=t.toLowerCase())}return t}).join("").trim()}function ig(t,i,r){let n="string"==typeof t?t:t.name;return i&&i.meta&&i.meta.hasOwnProperty(n)?i.meta[n]:r&&r.meta?r.meta[n]:void 0}function ib(t){return("string"==typeof t&&(t=tL.getAssetDescriptor(t)),t)?id.t("label.asset."+t.name,{defaultValue:i_(t.name)}):""}function iy(t,i,r,n,o,a){let s=function(t,i,r,n){let o="";if(null==t)o=n||"";else if("string"==typeof t)o=t;else if("number"==typeof t||"boolean"==typeof t||t instanceof Date){let n=i&&i();if(n&&0!==Object.keys(n).length)switch("number"==typeof t?n.asBoolean?t=!!t:n.asDate&&(t=new Date(t)):"boolean"==typeof t&&n.asNumber&&(t=+!!t),typeof t){case"number":o=new Intl.NumberFormat(r||id.language,n).format(t);break;case"boolean":n.asOnOff&&(o=t?id.t("on"):id.t("off")),n.asOpenClosed&&(o=t?id.t("open"):id.t("closed")),n.asPressedReleased&&(o=t?id.t("pressed"):id.t("released"));break;case"object":if(n.momentJsFormat)o=ih()(t).format(n.momentJsFormat);else if(n.iso8601)o=t.toISOString();else if(n.week){var a;let i,r=((a=new Date(Date.UTC((a=t).getFullYear(),a.getMonth(),a.getDate()))).setUTCDate(a.getUTCDate()+4-(a.getUTCDay()||7)),i=new Date(Date.UTC(a.getUTCFullYear(),0,1)),Math.ceil(((a.getTime()-i.getTime())/864e5+1)/7));o="2-digit"===n.week?String(r).padStart(2,"0"):Number(r).toString(10)}else o=new Intl.DateTimeFormat(r||id.language,n).format(t)}else o=Object(t).toString()}return o}(t?t.value:void 0,()=>iF("format",t,i,r,o),void 0,a),l=iF("units",t,i,r,!0);return n&&l&&l.length&&(s=iv(iF("units",t,i,r,o),s)),s}function iv(t,i){if(!t)return"";i||(i="");let r=t.map((t,r)=>{if(3!==t.length||t.toUpperCase()!==t)return id.t(["units."+t,"or:units."+t]);{let n=new Intl.NumberFormat(id.language,{currency:t,style:"currency"}).formatToParts();if(0!==r||"currency"!==n[0].type)return"currency"===n[0].type?n[0].value:n[n.length-1].value;if(!i)return n[0].value;i=n[0].value+i}}).join("");return i.length>0?i+" "+r:r}function iF(t,i,r,n,o){let a,s=[],l=ix(t,i&&"string"==typeof i?i:i?i.name:r?"string"==typeof r?r:r.name:void 0,r,n,o);if(l&&(a=JSON.parse(l)))if("format"!==t)return a;else s.push(a);if(i&&i.meta&&(a=ig(t,i,r)))if("format"!==t)return a;else s.push(a);if(r&&"string"!=typeof r&&r.hasOwnProperty(t)){if(a=r[t],"format"!==t)return a;s.push(a)}if(r&&r.type){if(a=tL.getValueDescriptor(r.type)[t],"format"!==t)return a;s.push(a)}if("format"!==t||0===s.length)return a;let c={};return s.reverse().forEach(t=>{c=Object.assign(Object.assign({},c),t)}),c}function ix(t,i,r,n,o,a){let s;if(i?s="string"==typeof i?i:i.name:r&&(s="string"==typeof r?r:r.name),!s)return;let l=[],c=t+"."+(o?"attribute":"meta")+".";if(n&&l.push(c+n+"."+s),r&&"string"!=typeof r&&(l.push(c+r.type+"."+s),l.push(c+r.type)),l.push(c+s),l.length>0)return id.t(l,{defaultValue:a||""})}function iw(t,i){let r=i.ref.name;if(t.attributes)if(i.deleted)delete t.attributes[r];else{let n=t.attributes[r];n&&(n.value=i.value,n.timestamp=i.timestamp)}return Object.assign({},t)}class iE{constructor(t){t&&Object.assign(this,t)}matches(t){var i,r,n,o,a,s,l;if((null==(i=this.ids)?void 0:i.length)&&(!t.id||!this.ids.includes(t.id))||(null==(r=this.types)?void 0:r.length)&&(!t.type||!this.types.includes(t.type))||(null==(n=this.realm)?void 0:n.name)&&t.realm!==this.realm.name||(null==(o=this.parents)?void 0:o.length)&&!this.parents.some(i=>!i.id||t.parentId===i.id))return!1;if(null==(a=this.paths)?void 0:a.length){let i=null!=(s=t.path)?s:[];if(!this.paths.some(t=>{var r;return(null!=(r=t.path)?r:[]).every((t,r)=>i[r]===t)}))return!1}return(null==(l=this.names)||!l.length||!!this.names.every(i=>iE._evalValuePredicate(t.name,i)))&&(!this.attributes||iE._evalGroup(t,this.attributes))}static getUnsupportedFields(t){return Object.keys(t).filter(t=>!iE._SUPPORTED_FIELDS.has(t))}collectAttributeNames(){return this.attributes?iE._collectNames(this.attributes):[]}static _evalValuePredicate(t,i){var r;switch(i.predicateType){case"string":{let n;if(null==t)return!1;let o=!1!==i.caseSensitive?String(t):String(t).toLowerCase(),a=!1!==i.caseSensitive?i.value:null==(r=i.value)?void 0:r.toLowerCase();switch(i.match){case"BEGIN":n=o.startsWith(a);break;case"END":n=o.endsWith(a);break;case"CONTAINS":n=o.includes(a);break;default:n=o===a}return i.negate?!n:n}case"boolean":return t===i.value;case"number":{let r;if("number"!=typeof t)return!1;switch(i.operator){case"GREATER_THAN":r=t>i.value;break;case"GREATER_EQUALS":r=t>=i.value;break;case"LESS_THAN":r=t<i.value;break;case"LESS_EQUALS":r=t<=i.value;break;case"BETWEEN":r=t>=i.value&&t<=i.rangeValue;break;default:r=t===i.value}return i.negate?!r:r}}return!1}static _evalPredicate(t,i){var r,n;let o=null==(r=i.name)?void 0:r.value;if(!o)return!0;let a=null==(n=t.attributes)?void 0:n[o];if(!a)return!!i.negated;let s=!i.value||iE._evalValuePredicate(a.value,i.value);return i.negated?!s:s}static _evalGroup(t,i){var r,n,o;let a=null!=(r=i.operator)?r:"AND",s=[...(null!=(n=i.items)?n:[]).map(i=>iE._evalPredicate(t,i)),...(null!=(o=i.groups)?o:[]).map(i=>iE._evalGroup(t,i))];return!s.length||("OR"===a?s.some(Boolean):s.every(Boolean))}static _collectNames(t){var i,r;return[...(null!=(i=t.items)?i:[]).map(t=>{var i;return null==(i=t.name)?void 0:i.value}).filter(t=>!!t),...(null!=(r=t.groups)?r:[]).flatMap(t=>iE._collectNames(t))]}}iE._SUPPORTED_FIELDS=new Set(["ids","types","names","parents","paths","realm","attributes"]);var ik=function(t,i,r,n){return new(r||(r=Promise))(function(o,a){function s(t){try{c(n.next(t))}catch(t){a(t)}}function l(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var i;t.done?o(t.value):((i=t.value)instanceof r?i:new r(function(t){t(i)})).then(s,l)}c((n=n.apply(t,i||[])).next())})};let iM=r(4461);class iD{constructor(t,i,r){this._autoEnable=!1,this._initialised=!1,this._initialiseInProgress=!1,this._pendingProviderPromises={},this._providerMessageListeners={},this._pendingProviderEnables=[],this._registrationTimer=null,this._realm=t,this._autoEnable=i,this._enableCompleteCallback=r,window.OpenRemoteConsole=this;let n=new URLSearchParams(window.location.search),o=n.get("consoleName"),a=n.get("consoleVersion"),s=n.get("consolePlatform"),l=n.get("consoleProviders"),c=n.get("consoleAutoEnable"),d=l&&l.length>0?l.split(" "):["push"];this._pendingProviderEnables=d;let u=iD._createConsoleRegistration(),h=window.localStorage.getItem(this._storageKey);if(h)try{let t=JSON.parse(h);t.id&&(u.id=t.id),t.name&&(u.name=t.name),t.providers&&(u.providers=t.providers),t.apps&&(u.apps=t.apps)}catch(t){console.error("Failed to deserialise console registration")}let m=u.providers;for(let t of(u.providers={},d)){let i=m&&m.hasOwnProperty(t)?m[t]:{enabled:!1,disabled:!1};u.providers[t]=i}let f=sk.getAppName();f.length>0&&0>u.apps.indexOf(f)&&u.apps.push(f),this._registration=u,o&&(u.name=o),a&&(u.version=a),s&&(u.platform=s),c&&(this._autoEnable="TRUE"===c||"true"===c)}get registration(){return this._registration}get autoEnable(){return this._autoEnable}get pendingProviderEnables(){return this._pendingProviderEnables.slice(0)}get shellApple(){let t=navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform:navigator.platform;return t&&("iP"===t.substring(0,2)||"Mac"===t.substring(0,3))&&window.webkit&&window.webkit.messageHandlers}get shellAndroid(){return!!window.MobileInterface}get isMobile(){return this.shellApple||this.shellAndroid}initialise(){return ik(this,void 0,void 0,function*(){if(!this._initialised&&!this._initialiseInProgress){console.debug("Console: initialising"),this._initialiseInProgress=!0;try{if(this._registration.providers)for(let t of Object.keys(this._registration.providers))yield this._initialiseProvider(t);this._registration.id||(yield this.sendRegistration()),this._initialised=!0,this._initialiseInProgress=!1,0===this._pendingProviderEnables.length?(yield this.sendRegistration(),this._callCompletedCallback()):this._autoEnable&&(yield this.enableProviders())}catch(t){console.error(t)}finally{this._initialiseInProgress=!1}}})}enableProviders(){return ik(this,void 0,void 0,function*(){if(!this._initialised)throw Error("Console must be initialised before enabling providers");for(let t=this._pendingProviderEnables.length-1;t>-1;t--){let i=this._pendingProviderEnables[t];yield this.enableProvider(i)}})}enableProvider(t,i){return ik(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before enabling providers");if(!this._registration.providers.hasOwnProperty(t))throw console.debug("Invalid console provider '"+t+"'"),Error("Invalid console provider '"+t+"'");console.debug("Console: enabling provider '"+t+"'");let r={provider:t,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:i},n=yield this.sendProviderMessage(r,!0);this._registration.providers[t].hasPermission=n.hasPermission,this._registration.providers[t].success=n.success,this._registration.providers[t].enabled=n.success,this._registration.providers[t].data=n.data;let o=this._pendingProviderEnables.indexOf(t);return o>=0&&(this._pendingProviderEnables.splice(o,1),0===this._pendingProviderEnables.length&&(this.sendRegistration().catch(()=>void 0),this._callCompletedCallback())),n})}disableProvider(t){return ik(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before disabling providers");if(!this._registration.providers.hasOwnProperty(t))throw console.debug("Invalid console provider '"+t+"'"),Error("Invalid console provider '"+t+"'");console.debug("Console: disabling provider '"+t+"'");let i=yield this.sendProviderMessage({provider:t,action:"PROVIDER_DISABLE"},!0);return this._registration.providers[t].disabled=!0,this._registration.providers[t].enabled=!1,i})}getProvider(t){return this._registration&&this._registration.providers?this._registration.providers[t]:void 0}sendProviderMessage(t,i){return ik(this,void 0,void 0,function*(){if("storage"!==t.provider&&!this._registration.providers.hasOwnProperty(t.provider))throw console.debug("Invalid console provider '"+t.provider+"'"),Error("Invalid console provider '"+t.provider+"'");if(!i)return void this._doSendProviderMessage(t);let r=t.provider+t.action;if(this._pendingProviderPromises[r])throw Error("Message already pending for provider '"+t.provider+"' with action '"+t.action+"'");let n=new im,o=()=>{delete this._pendingProviderPromises[r],n.reject("No response from provider")};return this._pendingProviderPromises[r]=[n,window.setTimeout(o,5e3)],this._doSendProviderMessage(t),n.promise})}sendRegistration(){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),new Promise((t,i)=>{this._registrationTimer=window.setTimeout(()=>ik(this,void 0,void 0,function*(){this._registrationTimer=null,console.debug("Console: updating registration");try{yield this._sendRegistration(!0),t()}catch(t){console.error("Failed to register console",t),i(t)}}))})}_sendRegistration(t){return ik(this,void 0,void 0,function*(){this._normaliseRegistration();let i=!!this._registration.id;try{let t=yield sk.rest.api.ConsoleResource.register(this._registration);if(200!==t.status)throw Error("Failed to register console");this._registration=t.data,console.debug("Console: registration successful"),console.debug("Console: updating locally stored registration"),window.localStorage.setItem(this._storageKey,JSON.stringify(this._registration))}catch(r){if(t&&i&&iD._isStaleRegistrationResponse(r)){console.warn("Console registration ID is stale or cannot be claimed; creating a new console registration"),window.localStorage.removeItem(this._storageKey),delete this._registration.id,yield this._sendRegistration(!1);return}throw r}})}_normaliseRegistration(){this._registration.name||(this._registration.name="Console"),this._registration.platform||(this._registration.platform="N/A"),this._registration.version||(this._registration.version="N/A"),this._registration.providers||(this._registration.providers={})}get _storageKey(){return"OpenRemoteConsole:"+this._realm}static _isStaleRegistrationResponse(t){let i=t&&t.response?t.response.status:void 0;return 403===i||409===i}storeData(t,i){this.sendProviderMessage({provider:"storage",action:"STORE",key:t,value:i},!1)}retrieveData(t){return ik(this,void 0,void 0,function*(){let i=this.sendProviderMessage({provider:"storage",action:"RETRIEVE",key:t},!0);try{let t=yield Promise.race([i,new Promise((t,i)=>setTimeout(i,2e3))]);if(t&&t.value){let i=t.value;return"null"===i?void 0:i}}catch(t){console.log("Failed to retrieve data from storage provider")}})}addProviderMessageListener(t,i){this._providerMessageListeners[t.provider+t.action]=i}removeProviderMessageListener(t){delete this._providerMessageListeners[t.provider+t.action]}_postNativeShellMessage(t){try{if(this.shellAndroid)return window.MobileInterface.postMessage(JSON.stringify(t));if(this.shellApple)return window.webkit.messageHandlers.int.postMessage(t)}catch(t){console.error("Failed to send shell message towards console",t)}}_doSendGenericMessage(t,i){let r={type:t,data:i};this.isMobile?this._postNativeShellMessage(r):console.warn("Failed to send generic message to console.",r)}_doSendProviderMessage(t){if(this.isMobile)this._postNativeShellMessage({type:"provider",data:t});else{if(!t.provider||!t.action)return;switch(t.provider.trim().toUpperCase()){case"PUSH":switch(t.action.trim().toUpperCase()){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"push",version:"web",enabled:!0,disabled:!1,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"push",hasPermission:!0,success:!0}));break;default:throw Error("Unsupported provider '"+t.provider+"' and action '"+t.action+"'")}break;case"STORAGE":switch(t.action){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"storage",version:"1.0.0",disabled:!1,enabled:!0,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"storage",hasPermission:!0,success:!0}));break;case"STORE":{let i=t.key?t.key.trim():null;if(!i||0===i.length)throw Error("Storage provider 'store' action requires a `key`");null===t.value?window.localStorage.removeItem(i):window.localStorage.setItem(i,JSON.stringify(t.value))}break;case"RETRIEVE":{let i=t.key?t.key.trim():null;if(!i||0===i.length)throw Error("Storage provider 'retrieve' action requires a `key`");let r=window.localStorage.getItem(i);if(null!==r)try{r=JSON.parse(r)}catch(t){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:i,value:r}))}break;default:throw Error("Unsupported provider '"+t.provider+"' and action '"+t.action+"'")}break;default:console.error("Unsupported provider: "+t.provider)}}}_handleProviderResponse(t){if(!t)return;let i=JSON.parse(t),r=i.provider,n=i.action,o=this._pendingProviderPromises[r+n];o&&(window.clearTimeout(o[1]),delete this._pendingProviderPromises[r+n],o[0].resolve(i));let a=this._providerMessageListeners[r+n];a&&a(i)}_callCompletedCallback(){let t=this._enableCompleteCallback;this._enableCompleteCallback=null,t&&window.setTimeout(()=>{t()},0)}static _createConsoleRegistration(){return{name:iM.name,version:iM.version,platform:iM.os.toString(),apps:[],model:((iM.manufacturer?iM.manufacturer+" ":"")+(iM.product?iM.product:"")).trim()}}_initialiseProvider(t){return ik(this,void 0,void 0,function*(){let i;console.debug("Console: initialising provider '"+t+"'");try{i=yield this.sendProviderMessage({provider:t,action:"PROVIDER_INIT"},!0),this._registration.providers[t].version=i.version,this._registration.providers[t].requiresPermission=i.requiresPermission,this._registration.providers[t].hasPermission=i.hasPermission,this._registration.providers[t].success=i.success,this._registration.providers[t].enabled=i.enabled,this._registration.providers[t].disabled=i.disabled,this._registration.providers[t].data=i.data}catch(t){console.error(t),i={action:"",disabled:!1,enabled:!1,hasPermission:!1,provider:"",requiresPermission:!1,version:"",success:!1}}if(i.success||(console.debug("Provider initialisation failed: '"+t+"'"),i.disabled=!0,this._registration.providers[t].disabled=!0),i.disabled||i.enabled){let i=this._pendingProviderEnables.indexOf(t);i>=0&&this._pendingProviderEnables.splice(i,1)}})}}function iT(t,i){return function(){return t.apply(i,arguments)}}let{toString:iA}=Object.prototype,{getPrototypeOf:iC}=Object,{iterator:iS,toStringTag:iL}=Symbol,iP=(({hasOwnProperty:t})=>(i,r)=>t.call(i,r))(Object.prototype),iI=t=>"string"==typeof t&&("__proto__"===t||"constructor"===t||"prototype"===t),iR=(t,i,r)=>t===Object.prototype||!r&&null===i,iB=(t,i)=>{let r=t,n=[];for(;null!=r&&-1===n.indexOf(r);){n.push(r);let o=iC(r);if(iR(r,o,r===t))break;if(iP(r,i))return!0;r=o}return!1},iO=(l=Object.create(null),t=>{let i=iA.call(t);return l[i]||(l[i]=i.slice(8,-1).toLowerCase())}),iz=t=>(t=t.toLowerCase(),i=>iO(i)===t),iY=t=>i=>typeof i===t,{isArray:ij}=Array,iN=iY("undefined");function iU(t){return null!==t&&!iN(t)&&null!==t.constructor&&!iN(t.constructor)&&i$(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}let iH=iz("ArrayBuffer"),iV=iY("string"),i$=iY("function"),iq=iY("number"),iG=t=>null!==t&&"object"==typeof t,iW=t=>{if(!iG(t))return!1;let i=iC(t);return(null===i||i===Object.prototype||null===iC(i))&&!iB(t,iL)&&!iB(t,iS)},iZ=iz("Date"),iK=iz("File"),iJ=iz("Blob"),iX=iz("FileList"),iQ=iz("Set"),i0="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},i1=void 0!==i0.FormData?i0.FormData:void 0,i2=iz("URLSearchParams"),[i3,i5,i4,i6]=["ReadableStream","Request","Response","Headers"].map(iz);function i8(t,i,{allOwnKeys:r=!1}={}){let n,o;if(null!=t)if("object"!=typeof t&&(t=[t]),ij(t))for(n=0,o=t.length;n<o;n++)i.call(null,t[n],n,t);else{let o;if(iU(t))return;let a=r?Object.getOwnPropertyNames(t):Object.keys(t),s=a.length;for(n=0;n<s;n++)o=a[n],i.call(null,t[o],o,t)}}function i7(t,i){let r;if(iU(t))return null;i=i.toLowerCase();let n=Object.keys(t),o=n.length;for(;o-- >0;)if(i===(r=n[o]).toLowerCase())return r;return null}let i9="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,re=t=>!iN(t)&&t!==i9,rt=(c="u">typeof Uint8Array&&iC(Uint8Array),t=>c&&t instanceof c),ri=iz("HTMLFormElement"),{propertyIsEnumerable:rr}=Object.prototype,rn=iz("RegExp"),ro=(t,i)=>{let r=Object.getOwnPropertyDescriptors(t),n={};i8(r,(r,o)=>{let a;!1!==(a=i(r,o,t))&&(n[o]=a||r)}),Object.defineProperties(t,n)},ra=iz("AsyncFunction"),rs=(h="function"==typeof setImmediate,m=i$(i9.postMessage),h?setImmediate:m?(f=`axios@${Math.random()}`,p=[],i9.addEventListener("message",({source:t,data:i})=>{t===i9&&i===f&&p.length&&p.shift()()},!1),t=>{p.push(t),i9.postMessage(f,"*")}):t=>setTimeout(t)),rl="u">typeof queueMicrotask?queueMicrotask.bind(i9):"u">typeof process&&process.nextTick||rs,rc=t=>null!=t&&i$(t[iS]),rd={isArray:ij,isArrayBuffer:iH,isBuffer:iU,isFormData:t=>{if(!t)return!1;if(i1&&t instanceof i1)return!0;let i=iC(t);if(!i||i===Object.prototype||!i$(t.append))return!1;let r=iO(t);return"formdata"===r||"object"===r&&i$(t.toString)&&"[object FormData]"===t.toString()},isArrayBufferView:function(t){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&iH(t.buffer)},isString:iV,isNumber:iq,isBoolean:t=>!0===t||!1===t,isObject:iG,isPlainObject:iW,isEmptyObject:t=>{if(!iG(t)||iU(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},isReadableStream:i3,isRequest:i5,isResponse:i4,isHeaders:i6,isUndefined:iN,isDate:iZ,isFile:iK,isReactNativeBlob:t=>!!(t&&void 0!==t.uri),isReactNative:t=>t&&void 0!==t.getParts,isBlob:iJ,isRegExp:rn,isFunction:i$,isStream:t=>iG(t)&&i$(t.pipe),isURLSearchParams:i2,isTypedArray:rt,isFileList:iX,forEach:i8,merge:function t(...i){let{caseless:r,skipUndefined:n}=re(this)&&this||{},o={},a=(i,a)=>{if("__proto__"===a||"constructor"===a||"prototype"===a)return;let s=r&&"string"==typeof a&&i7(o,a)||a,l=iP(o,s)?o[s]:void 0;iW(l)&&iW(i)?o[s]=t(l,i):iW(i)?o[s]=t({},i):ij(i)?o[s]=i.slice():n&&iN(i)||(o[s]=i)};for(let t=0,r=i.length;t<r;t++){let r=i[t];if(!r||iU(r)||(i8(r,a),"object"!=typeof r||ij(r)))continue;let n=Object.getOwnPropertySymbols(r);for(let t=0;t<n.length;t++){let i=n[t];rr.call(r,i)&&a(r[i],i)}}return o},extend:(t,i,r,{allOwnKeys:n}={})=>(i8(i,(i,n)=>{r&&i$(i)?Object.defineProperty(t,n,{__proto__:null,value:iT(i,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,n,{__proto__:null,value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,i,r,n)=>{t.prototype=Object.create(i.prototype,n),Object.defineProperty(t.prototype,"constructor",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{__proto__:null,value:i.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,i,r,n)=>{let o,a,s,l={};if(i=i||{},null==t)return i;do{for(a=(o=Object.getOwnPropertyNames(t)).length;a-- >0;)s=o[a],(!n||n(s,t,i))&&!l[s]&&(i[s]=t[s],l[s]=!0);t=!1!==r&&iC(t)}while(t&&(!r||r(t,i))&&t!==Object.prototype);return i},kindOf:iO,kindOfTest:iz,endsWith:(t,i,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=i.length;let n=t.indexOf(i,r);return -1!==n&&n===r},toArray:t=>{if(!t)return null;if(ij(t))return t;let i=t.length;if(!iq(i))return null;let r=Array(i);for(;i-- >0;)r[i]=t[i];return r},forEachEntry:(t,i)=>{let r,n=(t&&t[iS]).call(t);for(;(r=n.next())&&!r.done;){let n=r.value;i.call(t,n[0],n[1])}},matchAll:(t,i)=>{let r,n=[];for(;null!==(r=t.exec(i));)n.push(r);return n},isHTMLForm:ri,hasOwnProperty:iP,hasOwnProp:iP,hasOwnInPrototypeChain:iB,getSafeProp:(t,i)=>null!=t&&iB(t,i)?t[i]:void 0,toSafeFlatObject:t=>{if(null==t||"object"!=typeof t&&"function"!=typeof t)return t;let i=iC(t);if(null===i&&(t=>{if(!Object.isExtensible(t))return!1;let i=Object.getOwnPropertyNames(t);return Object.getOwnPropertySymbols&&i.push(...Object.getOwnPropertySymbols(t)),i.every(i=>{if(iI(i))return!1;let r=Object.getOwnPropertyDescriptor(t,i);return!!r&&r.configurable&&!0===r.writable})})(t))return t;let r=Object.create(null),n=Object.create(null),o=[],a=t;for(;null!=a&&-1===o.indexOf(a);){o.push(a);let s=a===t?i:iC(a);if(iR(a,s,a===t))break;let l=Object.getOwnPropertyNames(a);for(let i of(Object.getOwnPropertySymbols&&l.push(...Object.getOwnPropertySymbols(a)),l))!iI(i)&&(iP(n,i)||(r[i]=t[i],n[i]=!0));a=s}return r},reduceDescriptors:ro,freezeMethods:t=>{ro(t,(i,r)=>{if(i$(t)&&["arguments","caller","callee"].includes(r))return!1;if(i$(t[r])){if(i.enumerable=!1,"writable"in i){i.writable=!1;return}i.set||(i.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},toObjectSet:(t,i)=>{let r={};return(ij(t)?t:String(t).split(i)).forEach(t=>{r[t]=!0}),r},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,i,r){return i.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(t,i)=>null!=t&&Number.isFinite(t*=1)?t:i,findKey:i7,global:i9,isContextDefined:re,isSpecCompliantForm:function(t){return!!(t&&i$(t.append)&&"FormData"===t[iL]&&t[iS])},toJSONObject:t=>{let i=new WeakSet,r=t=>{if(iG(t)){if(i.has(t))return;if(iU(t))return t;if(!("toJSON"in t)){let n;if(i.add(t),iQ(t))for(let i of(n=[],t)){let t=r(i);iN(t)||n.push(t)}else n=ij(t)?[]:{},i8(t,(t,i)=>{let o=r(t);iN(o)||(n[i]=o)});return i.delete(t),n}}return t};return r(t)},isAsyncFn:ra,isThenable:t=>t&&(iG(t)||i$(t))&&i$(t.then)&&i$(t.catch),setImmediate:rs,asap:rl,isIterable:rc,isSafeIterable:t=>null!=t&&iB(t,iS)&&rc(t)},ru=rd.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"]),rh=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),rm=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function rf(t,i){return rd.isArray(t)?t.map(t=>rf(t,i)):function(t){let i=0,r=t.length;for(;i<r;){let r=t.charCodeAt(i);if(9!==r&&32!==r)break;i+=1}for(;r>i;){let i=t.charCodeAt(r-1);if(9!==i&&32!==i)break;r-=1}return 0===i&&r===t.length?t:t.slice(i,r)}(String(t).replace(i,""))}function rp(t){let i=Object.create(null);return rd.forEach(t.toJSON(),(t,r)=>{i[r]=rf(t,rm)}),i}let r_=Symbol("internals");function rg(t){return t&&String(t).trim().toLowerCase()}function rb(t){return!1===t||null==t?t:rd.isArray(t)?t.map(rb):rf(String(t),rh)}let ry=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function rv(t){let i=0,r=t.length;for(;i<r;){let r=t.charCodeAt(i);if(9!==r&&32!==r)break;i+=1}for(;r>i;){let i=t.charCodeAt(r-1);if(9!==i&&32!==i)break;r-=1}return 0===i&&r===t.length?t:t.slice(i,r)}function rF(t,i,r,n,o){if(rd.isFunction(n))return n.call(this,i,r);if(o&&(i=r),rd.isString(i)){if(rd.isString(n))return -1!==i.indexOf(n);if(rd.isRegExp(n))return n.test(i)}}class rx{constructor(t){t&&this.set(t)}set(t,i,r){let n=this;function o(t,i,r){let o=rg(i);if(!o)return;let a=rd.findKey(n,o);a&&void 0!==n[a]&&!0!==r&&(void 0!==r||!1===n[a])||(n[a||i]=rb(t))}let a=(t,i)=>rd.forEach(t,(t,r)=>o(t,r,i));if(rd.isPlainObject(t)||t instanceof this.constructor)a(t,i);else{let n;if(rd.isString(t)&&(t=t.trim())&&(n=t,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim()))){var s;let r,n,o,l;a((l={},(s=t)&&s.split("\n").forEach(function(t){o=t.indexOf(":"),r=t.substring(0,o).trim().toLowerCase(),n=t.substring(o+1).trim();let i=rd.hasOwnProp(l,r);!r||i&&rd.hasOwnProp(ru,r)||("set-cookie"===r?i?l[r].push(n):l[r]=[n]:l[r]=i?l[r]+", "+n:n)}),l),i)}else if(rd.isObject(t)&&rd.isSafeIterable(t)){let r=Object.create(null),n,o;for(let i of t){if(!rd.isArray(i))throw TypeError("Object iterator must return a key-value pair");o=i[0],rd.hasOwnProp(r,o)?(n=r[o],r[o]=rd.isArray(n)?[...n,i[1]]:[n,i[1]]):r[o]=i[1]}a(r,i)}else null!=t&&o(i,t,r)}return this}get(t,i){if(t=rg(t)){let r=rd.findKey(this,t);if(r){let t=this[r];if(!i)return t;if(!0===i){let i,r=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;i=n.exec(t);)r[i[1]]=i[2];return r}if(rd.isFunction(i))return i.call(this,t,r);if(rd.isRegExp(i))return i.exec(t);throw TypeError("parser must be boolean|regexp|function")}}}has(t,i){if(t=rg(t)){let r=rd.findKey(this,t);return!!(r&&void 0!==this[r]&&(!i||rF(this,this[r],r,i)))}return!1}delete(t,i){let r=this,n=!1;function o(t){if(t=rg(t)){let o=rd.findKey(r,t);o&&(!i||rF(r,r[o],o,i))&&(delete r[o],n=!0)}}return rd.isArray(t)?t.forEach(o):o(t),n}clear(t){let i=Object.keys(this),r=i.length,n=!1;for(;r--;){let o=i[r];(!t||rF(this,this[o],o,t,!0))&&(delete this[o],n=!0)}return n}normalize(t){let i=this,r={};return rd.forEach(this,(n,o)=>{let a=rd.findKey(r,o);if(a){i[a]=rb(n),delete i[o];return}let s=t?o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,i,r)=>i.toUpperCase()+r):String(o).trim();s!==o&&delete i[o],i[s]=rb(n),r[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let i=Object.create(null);return rd.forEach(this,(r,n)=>{null!=r&&!1!==r&&(i[n]=t&&rd.isArray(r)?r.join(", "):r)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,i])=>t+": "+i).join("\n")}getSetCookie(){let t=this.get("set-cookie");return rd.isArray(t)?t:null==t||!1===t?[]:[t]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static parseParameters(t){return function(t){let i=Object.create(null),r=String(t),n=0,o=!1,a=!1;function s(t){let o=rv(r.slice(n,t)),a=o.indexOf("=");if(a<1)return;let s=rv(o.slice(0,a));if(!ry.test(s))return;let l=s.toLowerCase();if("__proto__"===l||"constructor"===l||"prototype"===l)return;let c=rv(o.slice(a+1));i[l]=function(t){let i=t.length-1;if(i<1||34!==t.charCodeAt(0)||34!==t.charCodeAt(i))return t;let r="";for(let n=1;n<i;n++){let o=t.charCodeAt(n);if(34===o||92===o&&(n+=1)>=i)return t;r+=t[n]}return r}(c)}for(let t=0;t<r.length;t++){let i=r.charCodeAt(t);o?a?a=!1:92===i?a=!0:34===i&&(o=!1):34===i?o=!0:(44===i||59===i)&&(s(t),n=t+1)}return s(r.length),i}(t)}static concat(t,...i){let r=new this(t);return i.forEach(t=>r.set(t)),r}static accessor(t){let i=(this[r_]=this[r_]={accessors:{}}).accessors,r=this.prototype;function n(t){let n=rg(t);if(!i[n]){let o;o=rd.toCamelCase(" "+t),["get","set","has"].forEach(i=>{Object.defineProperty(r,i+o,{__proto__:null,value:function(r,n,o){return this[i].call(this,t,r,n,o)},configurable:!0})}),i[n]=!0}}return rd.isArray(t)?t.forEach(n):n(t),this}}rx.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),rd.reduceDescriptors(rx.prototype,({value:t},i)=>{let r=i[0].toUpperCase()+i.slice(1);return{get:()=>t,set(t){this[r]=t}}}),rd.freezeMethods(rx);let rw="[REDACTED ****]";function rE(t){try{return String(t)}catch(t){return""}}class rk extends Error{static from(t,i,r,n,o,a){let s=t.message;!s&&rd.isArray(t.errors)&&t.errors.length&&(s=t.errors.map(t=>{try{return t&&t.message?rE(t.message):rE(t)}catch(t){return""}}).filter(Boolean).join("; ")||t.name||"AggregateError");let l=new rk(s,i||t.code,r,n,o);return Object.defineProperty(l,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),l.name=t.name,null!=t.status&&null==l.status&&(l.status=t.status),a&&Object.assign(l,a),l}constructor(t,i,r,n,o){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,i&&(this.code=i),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status)}toJSON(){let t,i,r,n=this.config,o=n&&rd.hasOwnProp(n,"redact")?n.redact:void 0,a=rd.isArray(o)&&o.length>0?(t=new Set(o.map(t=>String(t).toLowerCase())),i=[],(r=n=>{let o;if(null===n||"object"!=typeof n||rd.isBuffer(n))return n;if(-1===i.indexOf(n)){if(n instanceof rx&&(n=n.toJSON()),i.push(n),rd.isArray(n))o=[],n.forEach((t,i)=>{let n=r(t);rd.isUndefined(n)||(o[i]=n)});else{if(!rd.isPlainObject(n)&&function(t){if(rd.hasOwnProp(t,"toJSON"))return!0;let i=Object.getPrototypeOf(t);for(;i&&i!==Object.prototype;){if(rd.hasOwnProp(i,"toJSON"))return!0;i=Object.getPrototypeOf(i)}return!1}(n))return i.pop(),n;for(let[i,a]of(o=Object.create(null),Object.entries(n))){let n=t.has(i.toLowerCase())?rw:r(a);rd.isUndefined(n)||(o[i]=n)}}return i.pop(),o}})(n)):rd.toJSONObject(n);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:a,code:this.code,status:this.status}}}rk.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",rk.ERR_BAD_OPTION="ERR_BAD_OPTION",rk.ECONNABORTED="ECONNABORTED",rk.ETIMEDOUT="ETIMEDOUT",rk.ECONNREFUSED="ECONNREFUSED",rk.ERR_NETWORK="ERR_NETWORK",rk.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",rk.ERR_DEPRECATED="ERR_DEPRECATED",rk.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",rk.ERR_BAD_REQUEST="ERR_BAD_REQUEST",rk.ERR_CANCELED="ERR_CANCELED",rk.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",rk.ERR_INVALID_URL="ERR_INVALID_URL",rk.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";let rM=rk;function rD(t){return rd.isPlainObject(t)||rd.isArray(t)}function rT(t){return rd.endsWith(t,"[]")?t.slice(0,-2):t}function rA(t,i,r){return t?t.concat(i).map(function(t,i){return t=rT(t),!r&&i?"["+t+"]":t}).join(r?".":""):i}let rC=rd.toFlatObject(rd,{},null,function(t){return/^is[A-Z]/.test(t)}),rS=function(t,i,r){if(!rd.isObject(t))throw TypeError("target must be an object");i=i||new FormData;let n=(t,i)=>{let n=rd.getSafeProp(r,t);return rd.isUndefined(n)?i:n},o=n("metaTokens",!0),a=n("visitor")||p,s=n("dots",!1),l=n("indexes",!1),c=n("Blob")||"u">typeof Blob&&Blob,d=n("maxDepth",100),u=c&&rd.isSpecCompliantForm(i),h=[];if(!rd.isFunction(a))throw TypeError("visitor must be a function");function m(t){if(null===t)return"";if(rd.isDate(t))return t.toISOString();if(rd.isBoolean(t))return t.toString();if(!u&&rd.isBlob(t))throw new rM("Blob is not supported. Use a Buffer instead.");if(rd.isArrayBuffer(t)||rd.isTypedArray(t)){if(u&&"function"==typeof c)return new c([t]);throw new rM("Blob is not supported. Use a Buffer instead.",rM.ERR_NOT_SUPPORT)}return t}function f(t){if(t>d)throw new rM("Object is too deeply nested ("+t+" levels). Max depth: "+d,rM.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(t,r,n){let a=t;if(rd.isReactNative(i)&&rd.isReactNativeBlob(t))return i.append(rA(n,r,s),m(t)),!1;if(t&&!n&&"object"==typeof t)if(rd.endsWith(r,"{}"))r=o?r:r.slice(0,-2),t=function(t){if(1/0===d)return JSON.stringify(t);let i=[];return JSON.stringify(t,function(t,r){if(!rd.isObject(r))return r;for(;i.length&&i[i.length-1]!==this;)i.pop();return i.push(r),f(1+i.length-1),r})}(t);else{var c;if(rd.isArray(t)&&(c=t,rd.isArray(c)&&!c.some(rD))||(rd.isFileList(t)||rd.endsWith(r,"[]"))&&(a=rd.toArray(t)))return r=rT(r),a.forEach(function(t,n){rd.isUndefined(t)||null===t||i.append(!0===l?rA([r],n,s):null===l?r:r+"[]",m(t))}),!1}return!!rD(t)||(i.append(rA(n,r,s),m(t)),!1)}let _=Object.assign(rC,{defaultVisitor:p,convertValue:m,isVisitable:rD});if(!rd.isObject(t))throw TypeError("data must be an object");return!function t(r,n,o=0){if(!rd.isUndefined(r)){if(f(o),-1!==h.indexOf(r))throw Error("Circular reference detected in "+n.join("."));h.push(r),rd.forEach(r,function(r,s){!0===(!(rd.isUndefined(r)||null===r)&&a.call(i,r,rd.isString(s)?s.trim():s,n,_))&&t(r,n?n.concat(s):[s],o+1)}),h.pop()}}(t),i};function rL(t){let i={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(t).replace(/[!'()~]|%20/g,function(t){return i[t]})}function rP(t,i){this._pairs=[],t&&rS(t,this,i)}let rI=rP.prototype;function rR(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function rB(t,i,r){let n;if(!i)return t;t=t||"";let o=rd.isFunction(r)?{serialize:r}:r,a=rd.getSafeProp(o,"encode")||rR,s=rd.getSafeProp(o,"serialize");if(n=s?s(i,o):rd.isURLSearchParams(i)?i.toString():new rP(i,o).toString(a)){let i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t}rI.append=function(t,i){this._pairs.push([t,i])},rI.toString=function(t){let i=t?i=>t.call(this,i,rL):rL;return this._pairs.map(function(t){return i(t[0])+"="+i(t[1])},"").join("&")};let rO=Symbol("internals");function rz(t){return t?t.length:0}function rY(t){if(t)for(;t.length&&null===t[t.length-1];)t.pop()}function rj(t,i){let r=t.handlers,n=rz(r);r!==i.handlersRef?(i.handlersRef=r,i.handlerEntries.clear()):n!==i.handlersLength&&(n?i.handlerEntries.forEach(function(t,n){r[t.index]!==t.handler&&i.handlerEntries.delete(n)}):i.handlerEntries.clear()),i.handlersLength=n}let rN=class{constructor(){this.handlers=[],this[rO]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(t,i,r){let n={fulfilled:t,rejected:i,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null},o=this[rO];null==this.handlers&&(this.handlers=[]),rj(this,o);let a=o.nextId++;return this.handlers.push(n),o.handlerEntries.set(a,{handler:n,index:this.handlers.length-1}),o.handlersLength=this.handlers.length,a}eject(t){let i=this[rO];rj(this,i);let r=i.handlerEntries.get(t);if(r){if(i.handlerEntries.delete(t),this.handlers[r.index]!==r.handler)return;this.handlers[r.index]=null,i.iterationDepth||(rY(this.handlers),i.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],rj(this,this[rO]))}forEach(t){let i=this[rO];rj(this,i),i.iterationDepth++;try{rd.forEach(this.handlers,function(i){null!==i&&t(i)})}finally{--i.iterationDepth||(rj(this,i),rY(this.handlers),i.handlersLength=rz(this.handlers))}}},rU={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},rH="u">typeof URLSearchParams?URLSearchParams:rP,rV="u">typeof FormData?FormData:null,r$="u">typeof Blob?Blob:null,rq="u">typeof window&&"u">typeof document,rG="object"==typeof navigator&&navigator||void 0,rW=rq&&(!rG||0>["ReactNative","NativeScript","NS"].indexOf(rG.product)),rZ="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,rK=rq&&window.location.href||"http://localhost",rJ={...tC,isBrowser:!0,classes:{URLSearchParams:rH,FormData:rV,Blob:r$},protocols:["http","https","file","blob","url","data"]};function rX(t){if(t>100)throw new rM("FormData field is too deeply nested ("+t+" levels). Max depth: 100",rM.ERR_FORM_DATA_DEPTH_EXCEEDED)}let rQ=function(t){if(rd.isFormData(t)&&rd.isFunction(t.entries)){let i={};return rd.forEachEntry(t,(t,r)=>{!function t(i,r,n,o){rX(o);let a=i[o++];if("__proto__"===a)return!0;let s=Number.isFinite(+a),l=o>=i.length;return(a=!a&&rd.isArray(n)?n.length:a,l)?rd.hasOwnProp(n,a)?n[a]=rd.isArray(n[a])?n[a].concat(r):[n[a],r]:n[a]=r:(rd.hasOwnProp(n,a)&&rd.isObject(n[a])||(n[a]=[]),t(i,r,n[a],o)&&rd.isArray(n[a])&&(n[a]=function(t){let i,r,n={},o=Object.keys(t),a=o.length;for(i=0;i<a;i++)n[r=o[i]]=t[r];return n}(n[a]))),!s}(function(t){let i,r=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;for(;null!==(i=n.exec(t));)rX(r.length),r.push("[]"===i[0]?"":i[1]||i[0]);return r}(t),r,i,0)}),i}return null},r0=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),r1=(t,i)=>null!=t&&rd.hasOwnProp(t,i)?t[i]:void 0,r2={transitional:rU,adapter:["xhr","http","fetch"],transformRequest:[function(t,i){let r,n=i.getContentType()||"",o=n.indexOf("application/json")>-1,a=rd.isObject(t);if(a&&rd.isHTMLForm(t)&&(t=new FormData(t)),rd.isFormData(t))return o?JSON.stringify(rQ(t)):t;if(rd.isArrayBuffer(t)||rd.isBuffer(t)||rd.isStream(t)||rd.isFile(t)||rd.isBlob(t)||rd.isReadableStream(t))return t;if(rd.isArrayBufferView(t))return t.buffer;if(rd.isURLSearchParams(t))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();if(a){let i=r1(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return rS(t,new rJ.classes.URLSearchParams,{visitor:function(t,i,r,n){return rJ.isNode&&rd.isBuffer(t)?(this.append(i,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...i}).toString();if((r=rd.isFileList(t))||n.indexOf("multipart/form-data")>-1){let n=r1(this,"env"),o=n&&n.FormData;return rS(r?{"files[]":t}:t,o&&new o,i)}}if(a||o){i.setContentType("application/json",!1);var s=t;if(rd.isString(s))try{return(0,JSON.parse)(s),rd.trim(s)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(s)}return t}],transformResponse:[function(t){let i=r1(this,"transitional")||r2.transitional,r=i&&i.forcedJSONParsing,n=r1(this,"responseType"),o="json"===n;if(rd.isResponse(t)||rd.isReadableStream(t))return t;if(t&&rd.isString(t)&&(r&&!n||o)){let r=i&&i.silentJSONParsing;try{return JSON.parse(t,r1(this,"parseReviver"))}catch(t){if(!r&&o){if("SyntaxError"===t.name)throw rM.from(t,rM.ERR_BAD_RESPONSE,this,null,r1(this,"response"));throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:rJ.classes.FormData,Blob:rJ.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function r3(t,i){let r=this||r2,n=i||r,o=rx.from(n.headers),a=n.data;return rd.forEach(t,function(t){a=t.call(r,a,o.normalize(),i?i.status:void 0)}),o.normalize(),a}function r5(t){return!!(t&&t.__CANCEL__)}rd.forEach(r0,t=>{r2.headers[t]={}});let r4=class extends rM{constructor(t,i,r){super(null==t?"canceled":t,rM.ERR_CANCELED,i,r),this.name="CanceledError",this.__CANCEL__=!0}};function r6(t,i,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):i(new rM("Request failed with status code "+r.status,r.status>=400&&r.status<500?rM.ERR_BAD_REQUEST:rM.ERR_BAD_RESPONSE,r.config,r.request,r))}let r8=/[\t\n\r]/g;function r7(t){if("string"!=typeof t)return t;let i=0;for(;i<t.length&&32>=t.charCodeAt(i);)i++;return t.slice(i).replace(r8,"")}function r9(t){let i=/^([-+\w]{1,25}):(?:\/\/)?/.exec(t);return i&&i[1]||""}let ne=function(t,i){let r,n=Array(t=t||10),o=Array(t),a=0,s=0;return i=void 0!==i?i:1e3,function(l){let c=Date.now(),d=o[s];r||(r=c),n[a]=l,o[a]=c;let u=s,h=0;for(;u!==a;)h+=n[u++],u%=t;if((a=(a+1)%t)===s&&(s=(s+1)%t),c-r<i)return;let m=d&&c-d;return m?Math.round(1e3*h/m):void 0}},nt=function(t,i){let r,n,o=0,a=1e3/i,s=(i,a=Date.now())=>{o=a,r=null,n&&(clearTimeout(n),n=null),t(...i)};return[(...t)=>{let i=Date.now(),l=i-o;l>=a?s(t,i):(r=t,n||(n=setTimeout(()=>{n=null,s(r)},a-l)))},()=>r&&s(r),(...t)=>s(t)]},ni=(t,i,r=3)=>{let n=0,o=ne(50,250);return nt(r=>{if(!r||!rd.isNumber(r.loaded))return;let a=r.loaded,s=r.lengthComputable?r.total:void 0,l=Math.max(0,null!=s?Math.min(a,s):a),c=Math.max(0,l-n),d=o(c);n=Math.max(n,l),t({loaded:l,total:s,progress:s?l/s:void 0,bytes:c,rate:d||void 0,estimated:d&&s?(s-l)/d:void 0,event:r,lengthComputable:null!=s,[i?"download":"upload"]:!0})},r)},nr=(t,i)=>{let r=null!=t;return[n=>i[0]({lengthComputable:r,total:t,loaded:n}),i[1]]},nn=(t,i=rd.asap)=>(...r)=>i(()=>t(...r)),no=rJ.hasStandardBrowserEnv?(d=new URL(rJ.origin),u=rJ.navigator&&/(msie|trident)/i.test(rJ.navigator.userAgent),t=>(t=new URL(t,rJ.origin),d.protocol===t.protocol&&d.host===t.host&&(u||d.port===t.port))):()=>!0,na=rJ.hasStandardBrowserEnv?{write(t,i,r,n,o,a,s){if("u"<typeof document)return;let l=[`${t}=${encodeURIComponent(i)}`];rd.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),rd.isString(n)&&l.push(`path=${n}`),rd.isString(o)&&l.push(`domain=${o}`),!0===a&&l.push("secure"),rd.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(t){if("u"<typeof document)return null;let i=document.cookie.split(";");for(let r=0;r<i.length;r++){let n=i[r].replace(/^\s+/,""),o=n.indexOf("=");if(-1!==o&&n.slice(0,o)===t)try{return decodeURIComponent(n.slice(o+1))}catch(t){return n.slice(o+1)}}return null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}},ns=/^https?:(?!\/\/)/i;function nl(t,i){if("string"==typeof t){let n=r7(t);if(ns.test(n)){var r;let t,o,a;throw new rM(`Invalid URL ${JSON.stringify((a=(-1===(o=(t=n.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${rw}@`)).indexOf("#"))?t:t.slice(0,o)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${rw}`),-1===o?a:`${a}#${!(r=t.slice(o+1))?r:r.replace(/(^|&)([^=&]*=)?[^&]+/g,(t,i,r="")=>`${i}${r}${rw}`)}`))}: missing "//" after protocol`,rM.ERR_INVALID_URL,i)}}}function nc(t,i,r,n){nl(i,n);let o=!("string"==typeof i&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i));if(t&&(o||!1===r)){nl(t,n);if(!i)return t;let r=t.length;for(;r>0&&47===t.charCodeAt(r-1);)r--;return t.slice(0,r)+"/"+i.replace(/^\/+/,"")}return i}let nd=t=>t instanceof rx?{...t}:t;function nu(t,i){var r;t=t||{},i=i||{};let n=Object.create(null);function o(t,i,r,n){return rd.isPlainObject(t)&&rd.isPlainObject(i)?rd.merge.call({caseless:n},t,i):rd.isPlainObject(i)?rd.merge({},i):rd.isArray(i)?i.slice():i}function a(t,i,r,n){return rd.isUndefined(i)?rd.isUndefined(t)?void 0:o(void 0,t,r,n):o(t,i,r,n)}function s(t,i){if(!rd.isUndefined(i))return o(void 0,i)}function l(t,i){return rd.isUndefined(i)?rd.isUndefined(t)?void 0:o(void 0,t):o(void 0,i)}function c(r,n,a){return rd.hasOwnProp(i,a)?o(r,n):rd.hasOwnProp(t,a)?o(void 0,r):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});let d={url:s,method:s,data:s,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutErrorMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,allowedSocketPaths:l,responseEncoding:l,validateStatus:c,headers:(t,i,r)=>a(nd(t),nd(i),r,!0)};return rd.forEach((r={...t,...i},Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(r).concat(Object.getOwnPropertySymbols(r).filter(t=>Object.getOwnPropertyDescriptor(r,t).enumerable)):Object.keys(r)),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;let o=rd.hasOwnProp(d,r)?d[r]:a,s=o(rd.hasOwnProp(t,r)?t[r]:void 0,rd.hasOwnProp(i,r)?i[r]:void 0,r);rd.isUndefined(s)&&o!==c||(n[r]=s)}),rd.hasOwnProp(i,"validateStatus")&&rd.isUndefined(i.validateStatus)&&!1===function(r){let n=rd.hasOwnProp(i,"transitional")?i.transitional:void 0;if(!rd.isUndefined(n)){if(!rd.isPlainObject(n))return;else if(rd.hasOwnProp(n,r))return n[r]}let o=rd.hasOwnProp(t,"transitional")?t.transitional:void 0;if(rd.isPlainObject(o)&&rd.hasOwnProp(o,r))return o[r]}("validateStatusUndefinedResolves")&&(rd.hasOwnProp(t,"validateStatus")?n.validateStatus=o(void 0,t.validateStatus):delete n.validateStatus),n}let nh=["content-type","content-length"],nm=function(t){let i=nu({},t),r=t=>rd.hasOwnProp(i,t)?i[t]:void 0,n=r("data"),o=r("withXSRFToken"),a=r("xsrfHeaderName"),s=r("xsrfCookieName"),l=r("headers"),c=r("auth"),d=r("baseURL"),u=r("allowAbsoluteUrls"),h=r("url");if(i.headers=l=rx.from(l),i.url=rB(nc(d,h,u,i),r("params"),r("paramsSerializer")),c){let i=rd.getSafeProp(c,"username")||"",r=rd.getSafeProp(c,"password")||"";try{l.set("Authorization","Basic "+btoa(i+":"+(r?encodeURIComponent(r).replace(/%([0-9A-F]{2})/gi,(t,i)=>String.fromCharCode(parseInt(i,16))):"")))}catch(i){throw rM.from(i,rM.ERR_BAD_OPTION_VALUE,t)}}if(rd.isFormData(n)){let t=rd.getSafeProp(n,"getHeaders");if(rJ.hasStandardBrowserEnv||rJ.hasStandardBrowserWebWorkerEnv||rd.isReactNative(n))l.setContentType(void 0);else{var m,f;rd.isFunction(t)&&(m=l,f=t.call(n),"content-only"!==r("formDataHeaderPolicy")?m.set(f):Object.entries(f||{}).forEach(([t,i])=>{nh.includes(t.toLowerCase())&&m.set(t,i)}))}}if(rJ.hasStandardBrowserEnv&&(rd.isFunction(o)&&(o=o(i)),!0===o||null==o&&no(i.url))){let t=a&&s&&na.read(s);t&&l.set(a,t)}return i},nf="u">typeof XMLHttpRequest&&function(t){return new Promise(function(i,r){let n,o,a,s,l,c,d=nm(t),u=d.data,h=rx.from(d.headers).normalize(),{responseType:m,onUploadProgress:f,onDownloadProgress:p}=d;function _(){s&&s(),l&&l(),d.cancelToken&&d.cancelToken.unsubscribe(n),d.signal&&d.signal.removeEventListener("abort",n)}let g=new XMLHttpRequest;function b(n){if(!g)return;if(0===g.status&&"file"!==(r9(r7(d.url))||r9(rJ.origin))&&!(g.responseURL&&g.responseURL.startsWith("file:"))){r(new rM("Request aborted",rM.ECONNABORTED,t,g)),_(),g=null;return}try{n?c&&c(n):l&&l()}catch(t){setTimeout(()=>{throw t})}if(!g)return;let o=rx.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());r6(function(t){i(t),_()},function(t){r(t),_()},{data:m&&"text"!==m&&"json"!==m?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:o,config:t,request:g}),g=null}g.open(d.method.toUpperCase(),d.url,!0),g.timeout=d.timeout,"onloadend"in g?g.onloadend=b:g.onreadystatechange=function(){!g||4!==g.readyState||(0!==g.status||g.responseURL&&g.responseURL.startsWith("file:"))&&setTimeout(b)},g.onabort=function(){g&&(r(new rM("Request aborted",rM.ECONNABORTED,t,g)),_(),g=null)},g.onerror=function(i){let n=new rM(i&&i.message?i.message:"Network Error",rM.ERR_NETWORK,t,g);n.event=i||null,r(n),_(),g=null},g.ontimeout=function(){let i=d.timeout?"timeout of "+d.timeout+"ms exceeded":"timeout exceeded",n=d.transitional||rU;d.timeoutErrorMessage&&(i=d.timeoutErrorMessage),r(new rM(i,n.clarifyTimeoutError?rM.ETIMEDOUT:rM.ECONNABORTED,t,g)),_(),g=null},void 0===u&&h.setContentType(null),"setRequestHeader"in g&&rd.forEach(rp(h),function(t,i){g.setRequestHeader(i,t)}),rd.isUndefined(d.withCredentials)||(g.withCredentials=!!d.withCredentials),m&&"json"!==m&&(g.responseType=d.responseType),p&&([a,l,c]=ni(p,!0),g.addEventListener("progress",a)),f&&g.upload&&([o,s]=ni(f),g.upload.addEventListener("progress",o),g.upload.addEventListener("loadend",s)),(d.cancelToken||d.signal)&&(n=i=>{g&&(r(!i||i.type?new r4(null,t,g):i),g.abort(),_(),g=null)},d.cancelToken&&d.cancelToken.subscribe(n),d.signal&&(d.signal.aborted?n():d.signal.addEventListener("abort",n)));let y=r9(d.url);if(y&&!rJ.protocols.includes(y)){r(new rM("Unsupported protocol "+y+":",rM.ERR_BAD_REQUEST,t)),_();return}g.send(u||null)})},np=function*(t,i){let r,n=t.byteLength;if(!i||n<i)return void(yield t);let o=0;for(;o<n;)r=o+i,yield t.slice(o,r),o=r},n_=async function*(t,i){for await(let r of ng(t))yield*np(r,i)},ng=async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);let i=t.getReader();try{for(;;){let{done:t,value:r}=await i.read();if(t)break;yield r}}finally{await i.cancel()}},nb=(t,i,r,n)=>{let o,a=n_(t,i),s=0,l=t=>{!o&&(o=!0,n&&n(t))};return new ReadableStream({async pull(t){try{let{done:i,value:n}=await a.next();if(i){l(),t.close();return}let o=n.byteLength;if(r){let t=s+=o;r(t)}t.enqueue(new Uint8Array(n))}catch(t){throw l(t),t}},cancel:t=>(l(t),a.return())},{highWaterMark:2})},ny=t=>t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102,nv=(t,i,r)=>i+2<r&&ny(t.charCodeAt(i+1))&&ny(t.charCodeAt(i+2)),nF=t=>t<=57?t-48:(223&t)-55,nx=t=>t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||43===t||47===t||45===t||95===t,nw=t=>9===t||10===t||12===t||13===t||32===t,nE=t=>{var i;let r,n,o=t.length,a=0,s=0,l=!1;for(let i=0;i<o;i++){let r=t.charCodeAt(i);if(37===r&&nv(t,i,o)&&(r=16*nF(t.charCodeAt(i+1))+nF(t.charCodeAt(i+2)),i+=2),!nw(r)){if(61===r){s++;continue}if(!nx(r)||s>0){l=!0;continue}a++}}if(l||s>2||s>0&&(a+s)%4!=0||a%4==1){let i,r;return i=t.length,r=0,i>0&&61===t.charCodeAt(i-1)&&(r++,i>1&&61===t.charCodeAt(i-2)&&r++),Math.floor((i-r)*3/4)}return r=Math.floor((i=a)/4),3*r+(2==(n=i%4)?1:2*(3===n))},nk={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:nM}=rd,nD=t=>{if(!rd.isString(t))return t;try{return decodeURIComponent(t)}catch(i){return t}},nT=(t,...i)=>{try{return!!t(...i)}catch(t){return!1}},nA=t=>{let i,r=void 0!==rd.global&&null!==rd.global?rd.global:globalThis,{ReadableStream:n,TextEncoder:o}=r,{fetch:a,Request:s,Response:l}=t=rd.merge.call({skipUndefined:!0},{Request:r.Request,Response:r.Response},t),c=a?nM(a):"function"==typeof fetch,d=nM(s),u=nM(l);if(!c)return!1;let h=c&&nM(n),m=c&&("function"==typeof o?(i=new o,t=>i.encode(t)):async t=>new Uint8Array(await new s(t).arrayBuffer())),f=d&&h&&nT(()=>{let t=!1,i=new s(rJ.origin,{body:new n,method:"POST",get duplex(){return t=!0,"half"}}),r=i.headers.has("Content-Type");return null!=i.body&&i.body.cancel(),t&&!r}),p=u&&h&&nT(()=>rd.isReadableStream(new l("").body)),_={stream:p&&(t=>t.body)};c&&["text","arrayBuffer","blob","formData","stream"].forEach(t=>{_[t]||(_[t]=(i,r)=>{let n=i&&i[t];if(n)return n.call(i);throw new rM(`Response type '${t}' is not supported`,rM.ERR_NOT_SUPPORT,r)})});let g=async t=>{if(null==t)return 0;if(rd.isBlob(t))return t.size;if(rd.isSpecCompliantForm(t)){let i=new s(rJ.origin,{method:"POST",body:t});return(await i.arrayBuffer()).byteLength}return rd.isArrayBufferView(t)||rd.isArrayBuffer(t)?t.byteLength:(rd.isURLSearchParams(t)&&(t+=""),rd.isString(t))?(await m(t)).byteLength:void 0},b=async(t,i)=>{let r=rd.toFiniteNumber(t.getContentLength());return null==r?g(i):r};return async t=>{let i,{url:r,method:n,data:c,signal:u,cancelToken:m,timeout:y,onDownloadProgress:v,onUploadProgress:F,responseType:x,headers:w,withCredentials:E="same-origin",fetchOptions:k,maxContentLength:M,maxBodyLength:D,maxRedirects:T}=nm(t),A=rd.isNumber(M)&&M>-1,C=rd.isNumber(D)&&D>-1,S=a||fetch;x=x?(x+"").toLowerCase():"text";let L=((t,i)=>{if(t=t?t.filter(Boolean):[],!i&&!t.length)return;let r=new AbortController,n=!1,o=function(t){if(!n){n=!0,s();let i=t instanceof Error?t:this.reason;r.abort(i instanceof rM?i:new r4(i instanceof Error?i.message:i))}},a=i&&setTimeout(()=>{a=null,o(new rM(`timeout of ${i}ms exceeded`,rM.ETIMEDOUT))},i),s=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)}),t=null)};t.forEach(t=>{if(!n){if(t.aborted)return void o.call(t);t.addEventListener("abort",o,{once:!0})}});let{signal:l}=r;return l.unsubscribe=()=>rd.asap(s),l})([u,m&&m.toAbortSignal()],y),P=null,I=L&&L.unsubscribe&&(()=>{L.unsubscribe()}),R=null,B=()=>new rM("Request body larger than maxBodyLength limit",rM.ERR_BAD_REQUEST,t,P);try{var O,z;let a,u,m,y,Y=(u="auth",rd.hasOwnProp(t,u)?t[u]:void 0);if(Y){let t=rd.getSafeProp(Y,"username")||"",i=rd.getSafeProp(Y,"password")||"";a={username:t,password:i}}if(m=(O=r).indexOf("://"),y=O,-1!==m&&(y=y.slice(m+3)),y.includes("@")||y.includes(":")){let t=new URL(r,rJ.origin);if(!a&&(t.username||t.password)){let i=nD(t.username),r=nD(t.password);a={username:i,password:r}}(t.username||t.password)&&(t.username="",t.password="",r=t.href)}if(a){let t;w.delete("authorization"),w.set("Authorization","Basic "+btoa((t=(a.username||"")+":"+(a.password||""),encodeURIComponent(t).replace(/%([0-9A-F]{2})/gi,(t,i)=>String.fromCharCode(parseInt(i,16))))))}if(A&&"string"==typeof r&&r.startsWith("data:")){let i;if(z=r,i="string"==typeof z?z.indexOf("#"):-1,((t,i)=>{if(!t||"string"!=typeof t||!t.startsWith("data:"))return 0;let r=t.indexOf(",");if(r<0)return 0;let n=t.slice(5,r),o=t.slice(r+1);if(/;base64/i.test(n))return i(o);let a=0;for(let t=0,i=o.length;t<i;t++){let r=o.charCodeAt(t);if(37===r&&nv(o,t,i))a+=1,t+=2;else if(r<128)a+=1;else if(r<2048)a+=2;else if(r>=55296&&r<=56319&&t+1<i){let i=o.charCodeAt(t+1);i>=56320&&i<=57343?(a+=4,t++):a+=3}else a+=3}return a})(-1===i?z:z.slice(0,i),nE)>M)throw new rM("maxContentLength size of "+M+" exceeded",rM.ERR_BAD_RESPONSE,t,P)}if(C&&"get"!==n&&"head"!==n){let t=await g(c);if("number"==typeof t&&isFinite(t)&&(i=t,t>D))throw B()}let j=C&&(rd.isReadableStream(c)||rd.isStream(c)),N=(t,i,r)=>nb(t,65536,t=>{if(C&&t>D)throw R=B();i&&i(t)},r);if(f&&"get"!==n&&"head"!==n&&(F||j)){if(i=null==i?await b(w,c):i,0!==i||j){let t,n=new s(r,{method:"POST",body:c,duplex:"half"});if(rd.isFormData(c)&&(t=n.headers.get("content-type"))&&w.setContentType(t),n.body){let[t,r]=F&&nr(i,ni(nn(F)))||[];c=N(n.body,t,r)}}}else if(j&&!d&&h&&"get"!==n&&"head"!==n)c=N(c);else if(j&&d&&!f&&"get"!==n&&"head"!==n)throw new rM("Stream request bodies are not supported by the current fetch implementation",rM.ERR_NOT_SUPPORT,t,P);rd.isString(E)||(E=E?"include":"omit");let U=d&&"credentials"in s.prototype;if(rd.isFormData(c)){let t=w.getContentType();t&&/^multipart\/form-data/i.test(t)&&!/boundary=/i.test(t)&&w.delete("content-type")}w.set("User-Agent","axios/1.20.0",!1);let H=null==k?k:Object.assign(Object.create(null),k);H&&(delete H.body,delete H.headers,delete H.method,delete H.signal,delete H.duplex,delete H.credentials);let V=Object.assign(Object.create(null),H,{signal:L,method:n.toUpperCase(),headers:rp(w.normalize()),body:c,duplex:"half",credentials:U?E:void 0});d&&(rd.forEach(nk,(t,i)=>{void 0===V[i]&&(V[i]=t)}),void 0===V.signal&&(V.signal=null),void 0===V.body&&(V.body=null)),0===T&&(V.redirect="manual",H&&(H.redirect="manual")),P=d&&new s(r,V);let $=await (d?S(P,H):S(r,V)),q=rx.from($.headers);if(A){let i=rd.toFiniteNumber(q.getContentLength());if(null!=i&&i>M)throw new rM("maxContentLength size of "+M+" exceeded",rM.ERR_BAD_RESPONSE,t,P)}let G=p&&("stream"===x||"response"===x);if(p&&$.body&&(v||A||G&&I)){let i={};["status","statusText","headers"].forEach(t=>{i[t]=$[t]});let r=rd.toFiniteNumber(q.getContentLength()),[n,o]=v&&nr(r,ni(nn(v),!0))||[];$=new l(nb($.body,65536,i=>{if(A&&i>M)throw new rM("maxContentLength size of "+M+" exceeded",rM.ERR_BAD_RESPONSE,t,P);n&&n(i)},()=>{o&&o(),I&&I()}),i)}x=x||"text";let W=await _[rd.findKey(_,x)||"text"]($,t);if(A&&!p&&!G){let i;if(null!=W&&("number"==typeof W.byteLength?i=W.byteLength:"number"==typeof W.size?i=W.size:"string"==typeof W&&(i="function"==typeof o?new o().encode(W).byteLength:W.length)),"number"==typeof i&&i>M)throw new rM("maxContentLength size of "+M+" exceeded",rM.ERR_BAD_RESPONSE,t,P)}return!G&&I&&I(),await new Promise((i,r)=>{r6(i,r,{data:W,headers:rx.from($.headers),status:$.status,statusText:$.statusText,config:t,request:P})})}catch(i){if(I&&I(),L&&L.aborted&&L.reason instanceof rM){let r=L.reason;throw r.config=t,P&&(r.request=P),i!==r&&Object.defineProperty(r,"cause",{__proto__:null,value:i,writable:!0,enumerable:!1,configurable:!0}),r}if(R)throw P&&!R.request&&(R.request=P),R;if(i instanceof rM)throw P&&!i.request&&(i.request=P),i;if(i&&"TypeError"===i.name&&/Load failed|fetch/i.test(i.message)){let r=new rM("Network Error",rM.ERR_NETWORK,t,P,i&&i.response);throw Object.defineProperty(r,"cause",{__proto__:null,value:i.cause||i,writable:!0,enumerable:!1,configurable:!0}),r}throw rM.from(i,i&&i.code,t,P,i&&i.response)}}},nC=new Map,nS=t=>{let i=t&&t.env||{},{fetch:r,Request:n,Response:o}=i,a=[n,o,r],s=a.length,l,c,d=nC;for(;s--;)l=a[s],void 0===(c=d.get(l))&&d.set(l,c=s?new Map:nA(i)),d=c;return c};nS();let nL={http:null,xhr:nf,fetch:{get:nS}};rd.forEach(nL,(t,i)=>{if(t){try{Object.defineProperty(t,"name",{__proto__:null,value:i})}catch(t){}Object.defineProperty(t,"adapterName",{__proto__:null,value:i})}});let nP=t=>`- ${t}`,nI=t=>rd.isFunction(t)||null===t||!1===t,nR=function(t,i){let r,n,{length:o}=t=rd.isArray(t)?t:[t],a={};for(let s=0;s<o;s++){let o;if(n=r=t[s],!nI(r)&&void 0===(n=nL[(o=String(r)).toLowerCase()]))throw new rM(`Unknown adapter '${o}'`);if(n&&(rd.isFunction(n)||(n=n.get(i))))break;a[o||"#"+s]=n}if(!n){let t=Object.entries(a).map(([t,i])=>`adapter ${t} `+(!1===i?"is not supported by the environment":"is not available in the build"));throw new rM("There is no suitable adapter to dispatch the request "+(o?t.length>1?"since :\n"+t.map(nP).join("\n"):" "+nP(t[0]):"as no adapter specified"),rM.ERR_NOT_SUPPORT)}return n};function nB(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new r4(null,t)}function nO(t){let i=rd.toSafeFlatObject(t);return nB(i),i.headers=rx.from(rd.getSafeProp(i,"headers")),i.data=r3.call(i,i.transformRequest),-1!==["post","put","patch"].indexOf(i.method)&&i.headers.setContentType("application/x-www-form-urlencoded",!1),nR(i.adapter||r2.adapter,i)(i).then(function(t){nB(i),i.response=t;try{t.data=r3.call(i,i.transformResponse,t)}finally{delete i.response}return t.headers=rx.from(t.headers),t},function(t){if(!r5(t)&&(nB(i),t&&t.response)){i.response=t.response;try{t.response.data=r3.call(i,i.transformResponse,t.response)}finally{delete i.response}t.response.headers=rx.from(t.response.headers)}return Promise.reject(t)})}let nz={};["object","boolean","number","function","string","symbol"].forEach((t,i)=>{nz[t]=function(r){return typeof r===t||"a"+(i<1?"n ":" ")+t}});let nY={};nz.transitional=function(t,i,r){function n(t,i){return"[Axios v1.20.0] Transitional option '"+t+"'"+i+(r?". "+r:"")}return(r,o,a)=>{if(!1===t)throw new rM(n(o," has been removed"+(i?" in "+i:"")),rM.ERR_DEPRECATED);return i&&!nY[o]&&(nY[o]=!0,console.warn(n(o," has been deprecated since v"+i+" and will be removed in the near future"))),!t||t(r,o,a)}},nz.spelling=function(t){return(i,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};let nj=function(t,i,r){if("object"!=typeof t||null===t)throw new rM("options must be an object",rM.ERR_BAD_OPTION_VALUE);let n=Object.keys(t),o=n.length;for(;o-- >0;){let a=n[o],s=Object.prototype.hasOwnProperty.call(i,a)?i[a]:void 0;if(s){let i=t[a],r=void 0===i||s(i,a,t);if(!0!==r)throw new rM("option "+a+" must be "+r,rM.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new rM("Unknown option "+a,rM.ERR_BAD_OPTION)}};class nN{constructor(t){this.defaults=t||{},this.interceptors={request:new rN,response:new rN}}async request(t,i){try{return await this._request(t,i)}catch(t){if(t instanceof Error)try{let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=Error();let r=i.stack,n="";if("string"==typeof r){let t=r.indexOf("\n");n=-1===t?"":r.slice(t+1)}if(t.stack){if(n){let i=n.indexOf("\n"),r=-1===i?-1:n.indexOf("\n",i+1),o=-1===r?"":n.slice(r+1);String(t.stack).endsWith(o)||(t.stack+="\n"+n)}}else t.stack=n}catch(t){}throw t}}_request(t,i){let r,n;"string"==typeof t?(i=i||{}).url=t:i=t||{};let{transitional:o,paramsSerializer:a,headers:s}=i=nu(this.defaults,i);void 0!==o&&nj(o,{silentJSONParsing:nz.transitional(nz.boolean),forcedJSONParsing:nz.transitional(nz.boolean),clarifyTimeoutError:nz.transitional(nz.boolean),legacyInterceptorReqResOrdering:nz.transitional(nz.boolean),advertiseZstdAcceptEncoding:nz.transitional(nz.boolean),validateStatusUndefinedResolves:nz.transitional(nz.boolean)},!1),null!=a&&(rd.isFunction(a)?i.paramsSerializer={serialize:a}:nj(a,{encode:nz.function,serialize:nz.function},!0)),void 0!==i.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),nj(i,{baseUrl:nz.spelling("baseURL"),withXsrfToken:nz.spelling("withXSRFToken")},!0),i.method=(rd.getSafeProp(i,"method")||rd.getSafeProp(this.defaults,"method")||"get").toLowerCase();let l=s&&rd.merge(s.common,s[i.method]);s&&rd.forEach(r0.concat("common"),t=>{delete s[t]}),i.headers=rx.concat(l,s);let c=[],d=!0;this.interceptors.request.forEach(function(t){if("function"==typeof t.runWhen&&!1===t.runWhen(i))return;d=d&&t.synchronous;let r=i.transitional||rU;r&&r.legacyInterceptorReqResOrdering?c.unshift(t.fulfilled,t.rejected):c.push(t.fulfilled,t.rejected)});let u=[];this.interceptors.response.forEach(function(t){u.push(t.fulfilled,t.rejected)});let h=0;if(!d){let t=[nO.bind(this),void 0];for(t.unshift(...c),t.push(...u),n=t.length,r=Promise.resolve(i);h<n;)r=r.then(t[h++],t[h++]);return r}n=c.length;let m=i;for(;h<n;){let t=c[h++],i=c[h++];try{m=t?t(m):m}catch(t){if(!i){r=Promise.reject(t);break}try{let n=i.call(this,t);rd.isThenable(n)&&(r=Promise.resolve(n).then(()=>nO.call(this,m)))}catch(t){r=Promise.reject(t)}break}}if(!r)try{r=nO.call(this,m)}catch(t){r=Promise.reject(t)}for(h=0,n=u.length;h<n;)r=r.then(u[h++],u[h++]);return r}getUri(t){return rB(nc((t=nu(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls,t),t.params,t.paramsSerializer)}}rd.forEach(["delete","get","head","options"],function(t){nN.prototype[t]=function(i,r){return this.request(nu(r||{},{method:t,url:i,data:r&&rd.hasOwnProp(r,"data")?r.data:void 0}))}}),rd.forEach(["post","put","patch","query"],function(t){function i(i){return function(r,n,o){return this.request(nu(o||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}nN.prototype[t]=i(),"query"!==t&&(nN.prototype[t+"Form"]=i(!0))});let nU=class t{constructor(t){let i;if("function"!=typeof t)throw TypeError("executor must be a function.");this.promise=new Promise(function(t){i=t});const r=this;this.promise.then(t=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](t);r._listeners=null}),this.promise.then=t=>{let i,n=new Promise(t=>{r.subscribe(t),i=t}).then(t);return n.cancel=function(){r.unsubscribe(i)},n},t(function(t,n,o){r.reason||(r.reason=new r4(t,n,o),i(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let i=this._listeners.indexOf(t);-1!==i&&this._listeners.splice(i,1)}toAbortSignal(){let t=new AbortController,i=i=>{t.abort(i)};return this.subscribe(i),t.signal.unsubscribe=()=>this.unsubscribe(i),t.signal}static source(){let i;return{token:new t(function(t){i=t}),cancel:i}}},nH={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(nH).forEach(([t,i])=>{void 0===nH[i]&&(nH[i]=t)});let nV=function t(i){let r=new nN(i),n=iT(nN.prototype.request,r);return rd.extend(n,nN.prototype,r,{allOwnKeys:!0}),rd.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return t(nu(i,r))},n}(r2);nV.Axios=nN,nV.CanceledError=r4,nV.CancelToken=nU,nV.isCancel=r5,nV.VERSION="1.20.0",nV.toFormData=rS,nV.AxiosError=rM,nV.Cancel=nV.CanceledError,nV.all=function(t){return Promise.all(t)},nV.spread=function(t){return function(i){return t.apply(null,i)}},nV.isAxiosError=function(t){return rd.isObject(t)&&!0===t.isAxiosError},nV.mergeConfig=nu,nV.AxiosHeaders=rx,nV.formToJSON=t=>rQ(rd.isHTMLForm(t)?new FormData(t):t),nV.getAdapter=nR,nV.HttpStatusCode=nH,nV.default=nV;class n${constructor(t){this.httpClient=t}create(t,i){return this.httpClient.request({method:"POST",url:or`realm`,data:t,options:i})}getAll(t){return this.httpClient.request({method:"GET",url:or`realm`,options:t})}getAccessible(t){return this.httpClient.request({method:"GET",url:or`realm/accessible`,options:t})}delete(t,i){return this.httpClient.request({method:"DELETE",url:or`realm/${t}`,options:i})}get(t,i){return this.httpClient.request({method:"GET",url:or`realm/${t}`,options:i})}update(t,i,r){return this.httpClient.request({method:"PUT",url:or`realm/${t}`,data:i,options:r})}}class nq{constructor(t){this.httpClient=t}doProtocolAssetDiscovery(t,i,r){return this.httpClient.request({method:"GET",url:or`agent/assetDiscovery/${t}`,queryParams:i,options:r})}doProtocolAssetImport(t,i,r,n){return this.httpClient.request({method:"POST",url:or`agent/assetImport/${t}`,queryParams:r,data:i,options:n})}doProtocolInstanceDiscovery(t,i,r){return this.httpClient.request({method:"GET",url:or`agent/instanceDiscovery/${t}`,queryParams:i,options:r})}}class nG{constructor(t){this.httpClient=t}getNotifications(t,i){return this.httpClient.request({method:"GET",url:or`notification`,queryParams:t,options:i})}removeNotifications(t,i){return this.httpClient.request({method:"DELETE",url:or`notification`,queryParams:t,options:i})}sendNotification(t,i){return this.httpClient.request({method:"POST",url:or`notification/alert`,data:t,options:i})}getNotificationsCount(t,i){return this.httpClient.request({method:"GET",url:or`notification/count`,queryParams:t,options:i})}removeNotification(t,i){return this.httpClient.request({method:"DELETE",url:or`notification/${t}`,options:i})}notificationAcknowledged(t,i,r,n){return this.httpClient.request({method:"PUT",url:or`notification/${t}/acknowledged`,queryParams:r,data:i,options:n})}notificationDelivered(t,i,r){return this.httpClient.request({method:"PUT",url:or`notification/${t}/delivered`,queryParams:i,options:r})}}class nW{constructor(t){this.httpClient=t}getManagerConfig(t){return this.httpClient.request({method:"GET",url:or`configuration/manager`,options:t})}update(t,i){return this.httpClient.request({method:"PUT",url:or`configuration/manager`,data:t,options:i})}imageUpload(t,i,r){return this.httpClient.request({method:"POST",url:or`configuration/manager/image`,queryParams:i,data:t,options:r})}getManagerConfigImage(t,i){return this.httpClient.request({method:"GET",url:or`configuration/manager/image/${t}`,options:i})}}class nZ{constructor(t){this.httpClient=t}startTunnel(t,i){return this.httpClient.request({method:"POST",url:or`gateway/tunnel`,data:t,options:i})}stopTunnel(t,i){return this.httpClient.request({method:"DELETE",url:or`gateway/tunnel`,data:t,options:i})}getAllActiveTunnelInfos(t,i){return this.httpClient.request({method:"GET",url:or`gateway/tunnel/${t}`,options:i})}getGatewayActiveTunnelInfos(t,i,r){return this.httpClient.request({method:"GET",url:or`gateway/tunnel/${t}/${i}`,options:r})}getActiveTunnelInfo(t,i,r,n,o){return this.httpClient.request({method:"GET",url:or`gateway/tunnel/${t}/${i}/${r}/${n}`,options:o})}}class nK{constructor(t){this.httpClient=t}createGlobalRuleset(t,i){return this.httpClient.request({method:"POST",url:or`rules`,data:t,options:i})}getGlobalRulesets(t,i){return this.httpClient.request({method:"GET",url:or`rules`,queryParams:t,options:i})}createAssetRuleset(t,i){return this.httpClient.request({method:"POST",url:or`rules/asset`,data:t,options:i})}getAssetRulesets(t,i,r){return this.httpClient.request({method:"GET",url:or`rules/asset/for/${t}`,queryParams:i,options:r})}deleteAssetRuleset(t,i){return this.httpClient.request({method:"DELETE",url:or`rules/asset/${t}`,options:i})}getAssetRuleset(t,i){return this.httpClient.request({method:"GET",url:or`rules/asset/${t}`,options:i})}updateAssetRuleset(t,i,r){return this.httpClient.request({method:"PUT",url:or`rules/asset/${t}`,data:i,options:r})}getAssetGeofences(t,i){return this.httpClient.request({method:"GET",url:or`rules/geofences/${t}`,options:i})}getAssetEngineInfo(t,i){return this.httpClient.request({method:"GET",url:or`rules/info/asset/${t}`,options:i})}getGlobalEngineInfo(t){return this.httpClient.request({method:"GET",url:or`rules/info/global`,options:t})}getRealmEngineInfo(t,i){return this.httpClient.request({method:"GET",url:or`rules/info/realm/${t}`,options:i})}createRealmRuleset(t,i){return this.httpClient.request({method:"POST",url:or`rules/realm`,data:t,options:i})}getRealmRulesets(t,i,r){return this.httpClient.request({method:"GET",url:or`rules/realm/for/${t}`,queryParams:i,options:r})}deleteRealmRuleset(t,i){return this.httpClient.request({method:"DELETE",url:or`rules/realm/${t}`,options:i})}getRealmRuleset(t,i){return this.httpClient.request({method:"GET",url:or`rules/realm/${t}`,options:i})}updateRealmRuleset(t,i,r){return this.httpClient.request({method:"PUT",url:or`rules/realm/${t}`,data:i,options:r})}deleteGlobalRuleset(t,i){return this.httpClient.request({method:"DELETE",url:or`rules/${t}`,options:i})}getGlobalRuleset(t,i){return this.httpClient.request({method:"GET",url:or`rules/${t}`,options:i})}updateGlobalRuleset(t,i,r){return this.httpClient.request({method:"PUT",url:or`rules/${t}`,data:i,options:r})}}class nJ{constructor(t){this.httpClient=t}create(t,i){return this.httpClient.request({method:"POST",url:or`asset`,data:t,options:i})}delete(t,i){return this.httpClient.request({method:"DELETE",url:or`asset`,queryParams:t,options:i})}writeAttributeValues(t,i){return this.httpClient.request({method:"PUT",url:or`asset/attributes`,data:t,options:i})}writeAttributeEvents(t,i){return this.httpClient.request({method:"PUT",url:or`asset/attributes/timestamp`,data:t,options:i})}queryCount(t,i){return this.httpClient.request({method:"POST",url:or`asset/count`,data:t,options:i})}updateNoneParent(t,i){return this.httpClient.request({method:"DELETE",url:or`asset/parent`,queryParams:t,options:i})}getPartial(t,i){return this.httpClient.request({method:"GET",url:or`asset/partial/${t}`,options:i})}queryAssets(t,i){return this.httpClient.request({method:"POST",url:or`asset/query`,data:t,options:i})}queryAssetTree(t,i){return this.httpClient.request({method:"POST",url:or`asset/tree`,data:t,options:i})}getCurrentUserAssets(t){return this.httpClient.request({method:"GET",url:or`asset/user/current`,options:t})}createUserAssetLinks(t,i){return this.httpClient.request({method:"POST",url:or`asset/user/link`,data:t,options:i})}getUserAssetLinks(t,i){return this.httpClient.request({method:"GET",url:or`asset/user/link`,queryParams:t,options:i})}deleteUserAssetLinks(t,i){return this.httpClient.request({method:"POST",url:or`asset/user/link/delete`,data:t,options:i})}deleteAllUserAssetLinks(t,i,r){return this.httpClient.request({method:"DELETE",url:or`asset/user/link/${t}/${i}`,options:r})}deleteUserAssetLink(t,i,r,n){return this.httpClient.request({method:"DELETE",url:or`asset/user/link/${t}/${i}/${r}`,options:n})}get(t,i){return this.httpClient.request({method:"GET",url:or`asset/${t}`,options:i})}update(t,i,r){return this.httpClient.request({method:"PUT",url:or`asset/${t}`,data:i,options:r})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(t,i,r,n){return this.httpClient.request({method:"PUT",url:or`asset/${t}/attribute/${i}`,data:r,options:n})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(t,i,r,n,o){return this.httpClient.request({method:"PUT",url:or`asset/${t}/attribute/${i}/${r}`,data:n,options:o})}updateParent(t,i,r){return this.httpClient.request({method:"PUT",url:or`asset/${t}/child`,queryParams:i,options:r})}}class nX{constructor(t){this.httpClient=t}updateCurrentUserLocale(t,i){return this.httpClient.request({method:"PUT",url:or`user/locale`,data:t,options:i})}query(t,i){return this.httpClient.request({method:"POST",url:or`user/query`,data:t,options:i})}requestPasswordResetCurrent(t){return this.httpClient.request({method:"PUT",url:or`user/request-password-reset`,options:t})}updatePasswordCurrent(t,i){return this.httpClient.request({method:"PUT",url:or`user/reset-password`,data:t,options:i})}updateCurrent(t,i){return this.httpClient.request({method:"PUT",url:or`user/update`,data:t,options:i})}getCurrent(t){return this.httpClient.request({method:"GET",url:or`user/user`,options:t})}getCurrentUserRealmRoles(t){return this.httpClient.request({method:"GET",url:or`user/userRealmRoles`,options:t})}getCurrentUserClientRoles(t,i){return this.httpClient.request({method:"GET",url:or`user/userRoles/${t}`,options:i})}disconnectUserSession(t,i,r){return this.httpClient.request({method:"DELETE",url:or`user/${t}/disconnect/${i}`,options:r})}requestPasswordReset(t,i,r){return this.httpClient.request({method:"PUT",url:or`user/${t}/request-password-reset/${i}`,options:r})}updatePassword(t,i,r,n){return this.httpClient.request({method:"PUT",url:or`user/${t}/reset-password/${i}`,data:r,options:n})}resetSecret(t,i,r){return this.httpClient.request({method:"GET",url:or`user/${t}/reset-secret/${i}`,options:r})}updateRoles(t,i,r){return this.httpClient.request({method:"PUT",url:or`user/${t}/roles`,data:i,options:r})}getUserRealmRoles(t,i,r){return this.httpClient.request({method:"GET",url:or`user/${t}/userRealmRoles/${i}`,options:r})}updateUserRealmRoles(t,i,r,n){return this.httpClient.request({method:"PUT",url:or`user/${t}/userRealmRoles/${i}`,data:r,options:n})}getUserClientRoles(t,i,r,n){return this.httpClient.request({method:"GET",url:or`user/${t}/userRoles/${i}/${r}`,options:n})}updateUserClientRoles(t,i,r,n,o){return this.httpClient.request({method:"PUT",url:or`user/${t}/userRoles/${i}/${r}`,data:n,options:o})}getUserSessions(t,i,r){return this.httpClient.request({method:"GET",url:or`user/${t}/userSessions/${i}`,options:r})}create(t,i,r){return this.httpClient.request({method:"POST",url:or`user/${t}/users`,data:i,options:r})}update(t,i,r){return this.httpClient.request({method:"PUT",url:or`user/${t}/users`,data:i,options:r})}delete(t,i,r){return this.httpClient.request({method:"DELETE",url:or`user/${t}/users/${i}`,options:r})}getClientRoles(t,i,r){return this.httpClient.request({method:"GET",url:or`user/${t}/${i}/roles`,options:r})}updateClientRoles(t,i,r,n){return this.httpClient.request({method:"PUT",url:or`user/${t}/${i}/roles`,data:r,options:n})}get(t,i,r){return this.httpClient.request({method:"GET",url:or`user/${t}/${i}`,options:r})}}class nQ{constructor(t){this.httpClient=t}getDatapointExport(t,i){return this.httpClient.request({method:"GET",url:or`asset/datapoint/export`,queryParams:t,options:i})}getDatapointPeriod(t,i){return this.httpClient.request({method:"GET",url:or`asset/datapoint/periods`,queryParams:t,options:i})}getDatapoints(t,i,r,n){return this.httpClient.request({method:"POST",url:or`asset/datapoint/${t}/${i}`,data:r,options:n})}}class n0{constructor(t){this.httpClient=t}getApps(t){return this.httpClient.request({method:"GET",url:or`apps`,options:t})}getConsoleConfig(t){return this.httpClient.request({method:"GET",url:or`apps/consoleConfig`,options:t})}getAppInfos(t){return this.httpClient.request({method:"GET",url:or`apps/info`,options:t})}}class n1{constructor(t){this.httpClient=t}getServices(t,i){return this.httpClient.request({method:"GET",url:or`service`,queryParams:t,options:i})}registerService(t,i){return this.httpClient.request({method:"POST",url:or`service`,data:t,options:i})}getGlobalServices(t){return this.httpClient.request({method:"GET",url:or`service/global`,options:t})}registerGlobalService(t,i){return this.httpClient.request({method:"POST",url:or`service/global`,data:t,options:i})}deregisterService(t,i,r){return this.httpClient.request({method:"DELETE",url:or`service/${t}/${i}`,options:r})}getService(t,i,r){return this.httpClient.request({method:"GET",url:or`service/${t}/${i}`,options:r})}heartbeat(t,i,r){return this.httpClient.request({method:"PUT",url:or`service/${t}/${i}`,options:r})}}class n2{constructor(t){this.httpClient=t}createAlarm(t,i,r){return this.httpClient.request({method:"POST",url:or`alarm`,queryParams:i,data:t,options:r})}getAlarms(t,i){return this.httpClient.request({method:"GET",url:or`alarm`,queryParams:t,options:i})}removeAlarms(t,i){return this.httpClient.request({method:"DELETE",url:or`alarm`,data:t,options:i})}setAssetLinks(t,i){return this.httpClient.request({method:"PUT",url:or`alarm/assets`,data:t,options:i})}getAlarm(t,i){return this.httpClient.request({method:"GET",url:or`alarm/${t}`,options:i})}removeAlarm(t,i){return this.httpClient.request({method:"DELETE",url:or`alarm/${t}`,options:i})}updateAlarm(t,i,r){return this.httpClient.request({method:"PUT",url:or`alarm/${t}`,data:i,options:r})}getAssetLinks(t,i,r){return this.httpClient.request({method:"GET",url:or`alarm/${t}/assets`,queryParams:i,options:r})}}class n3{constructor(t){this.httpClient=t}getAssetDescriptors(t,i){return this.httpClient.request({method:"GET",url:or`model/assetDescriptors`,queryParams:t,options:i})}getAssetInfo(t,i,r){return this.httpClient.request({method:"GET",url:or`model/assetInfo/${t}`,queryParams:i,options:r})}getAssetInfos(t,i){return this.httpClient.request({method:"GET",url:or`model/assetInfos`,queryParams:t,options:i})}getValueDescriptorSchema(t,i){return this.httpClient.request({method:"GET",url:or`model/getValueDescriptorSchema`,queryParams:t,options:i})}getMetaItemDescriptors(t,i){return this.httpClient.request({method:"GET",url:or`model/metaItemDescriptors`,queryParams:t,options:i})}getValueDescriptors(t,i){return this.httpClient.request({method:"GET",url:or`model/valueDescriptors`,queryParams:t,options:i})}}class n5{constructor(t){this.httpClient=t}register(t,i){return this.httpClient.request({method:"POST",url:or`console/register`,data:t,options:i})}}class n4{constructor(t){this.httpClient=t}createProvisioningConfig(t,i){return this.httpClient.request({method:"POST",url:or`provisioning`,data:t,options:i})}getProvisioningConfigs(t){return this.httpClient.request({method:"GET",url:or`provisioning`,options:t})}deleteProvisioningConfig(t,i){return this.httpClient.request({method:"DELETE",url:or`provisioning/${t}`,options:i})}updateProvisioningConfig(t,i,r){return this.httpClient.request({method:"PUT",url:or`provisioning/${t}`,data:i,options:r})}}class n6{constructor(t){this.httpClient=t}deleteConnections(t,i){return this.httpClient.request({method:"DELETE",url:or`gateway/connection`,queryParams:t,options:i})}getConnections(t){return this.httpClient.request({method:"GET",url:or`gateway/connection`,options:t})}deleteConnection(t,i){return this.httpClient.request({method:"DELETE",url:or`gateway/connection/${t}`,options:i})}getConnection(t,i){return this.httpClient.request({method:"GET",url:or`gateway/connection/${t}`,options:i})}setConnection(t,i,r){return this.httpClient.request({method:"PUT",url:or`gateway/connection/${t}`,data:i,options:r})}getConnectionStatus(t,i){return this.httpClient.request({method:"GET",url:or`gateway/status/${t}`,options:i})}}class n8{constructor(t){this.httpClient=t}getConfig(t){return this.httpClient.request({method:"GET",url:or`syslog/config`,options:t})}updateConfig(t,i){return this.httpClient.request({method:"PUT",url:or`syslog/config`,data:t,options:i})}clearEvents(t){return this.httpClient.request({method:"DELETE",url:or`syslog/event`,options:t})}getEvents(t,i){return this.httpClient.request({method:"GET",url:or`syslog/event`,queryParams:t,options:i})}}class n7{constructor(t){this.httpClient=t}getAllNodeDefinitions(t){return this.httpClient.request({method:"GET",url:or`flow`,options:t})}getNodeDefinition(t,i){return this.httpClient.request({method:"GET",url:or`flow/${t}`,options:i})}getAllNodeDefinitionsByType(t,i){return this.httpClient.request({method:"GET",url:or`flow/${t}`,options:i})}}class n9{constructor(t){this.httpClient=t}getPredictedDatapoints(t,i,r,n){return this.httpClient.request({method:"POST",url:or`asset/predicted/${t}/${i}`,data:r,options:n})}writePredictedDatapoints(t,i,r,n){return this.httpClient.request({method:"PUT",url:or`asset/predicted/${t}/${i}`,data:r,options:n})}}class oe{constructor(t){this.httpClient=t}create(t,i){return this.httpClient.request({method:"POST",url:or`dashboard`,data:t,options:i})}update(t,i){return this.httpClient.request({method:"PUT",url:or`dashboard`,data:t,options:i})}getAllRealmDashboards(t,i){return this.httpClient.request({method:"GET",url:or`dashboard/all/${t}`,options:i})}query(t,i){return this.httpClient.request({method:"POST",url:or`dashboard/query`,data:t,options:i})}delete(t,i,r){return this.httpClient.request({method:"DELETE",url:or`dashboard/${t}/${i}`,options:r})}get(t,i,r){return this.httpClient.request({method:"GET",url:or`dashboard/${t}/${i}`,options:r})}}class ot{constructor(t){this.httpClient=t}getSettings(t){return this.httpClient.request({method:"GET",url:or`map`,options:t})}saveSettings(t,i){return this.httpClient.request({method:"PUT",url:or`map`,data:t,options:i})}deleteMap(t){return this.httpClient.request({method:"DELETE",url:or`map/deleteMap`,options:t})}getCustomMapInfo(t){return this.httpClient.request({method:"GET",url:or`map/getCustomMapInfo`,options:t})}getTile(t,i,r,n){return this.httpClient.request({method:"GET",url:or`map/tile/${t}/${i}/${r}`,options:n})}uploadMap(t,i){return this.httpClient.request({method:"POST",url:or`map/upload`,queryParams:t,options:i})}}class oi{constructor(t){this.httpClient=t}getHealthStatus(t){return this.httpClient.request({method:"GET",url:or`health`,options:t})}getInfo(t){return this.httpClient.request({method:"GET",url:or`info`,options:t})}}function or(t,...i){let r="";for(let n=0;n<i.length;n++)r+=t[n],r+=encodeURIComponent(i[n]);return r+t[t.length-1]}class on{constructor(t,i=nV.create()){this._realmResource=new oa(t,i),this._agentResource=new os(t,i),this._notificationResource=new ol(t,i),this._configurationResource=new oc(t,i),this._gatewayServiceResource=new od(t,i),this._rulesResource=new ou(t,i),this._assetResource=new oh(t,i),this._userResource=new om(t,i),this._assetDatapointResource=new of(t,i),this._appResource=new op(t,i),this._externalServiceResource=new o_(t,i),this._alarmResource=new og(t,i),this._assetModelResource=new ob(t,i),this._consoleResource=new oy(t,i),this._provisioningResource=new ov(t,i),this._gatewayClientResource=new oF(t,i),this._syslogResource=new ox(t,i),this._flowResource=new ow(t,i),this._assetPredictedDatapointResource=new oE(t,i),this._dashboardResource=new ok(t,i),this._mapResource=new oM(t,i),this._statusResource=new oD(t,i),this._assetResource=new oh(t,i)}get RealmResource(){return this._realmResource}get AgentResource(){return this._agentResource}get NotificationResource(){return this._notificationResource}get ConfigurationResource(){return this._configurationResource}get GatewayServiceResource(){return this._gatewayServiceResource}get RulesResource(){return this._rulesResource}get AssetResource(){return this._assetResource}get UserResource(){return this._userResource}get AssetDatapointResource(){return this._assetDatapointResource}get AppResource(){return this._appResource}get ExternalServiceResource(){return this._externalServiceResource}get AlarmResource(){return this._alarmResource}get AssetModelResource(){return this._assetModelResource}get ConsoleResource(){return this._consoleResource}get ProvisioningResource(){return this._provisioningResource}get GatewayClientResource(){return this._gatewayClientResource}get SyslogResource(){return this._syslogResource}get FlowResource(){return this._flowResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get DashboardResource(){return this._dashboardResource}get MapResource(){return this._mapResource}get StatusResource(){return this._statusResource}}class oo{constructor(t){this.axios=t}request(t){let i={};i.method=t.method,i.url=t.url,i.params=t.queryParams,i.data=t.data,function(t,i){if(void 0!=i)for(let r in i)i.hasOwnProperty(r)&&(t[r]=i[r])}(i,t.options);let r=t.copyFn;return this.axios.request(i).then(t=>(r&&t.data&&(t.originalData=t.data,t.data=r(t.data)),t))}}class oa extends n${constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class os extends nq{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class ol extends nG{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class oc extends nW{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class od extends nZ{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class ou extends nK{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class oh extends nJ{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class om extends nX{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class of extends nQ{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class op extends n0{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class o_ extends n1{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class og extends n2{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class ob extends n3{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class oy extends n5{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class ov extends n4{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class oF extends n6{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class ox extends n8{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class ow extends n7{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class oE extends n9{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class ok extends oe{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class oM extends ot{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class oD extends oi{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}var oT=r(8183),oA=r.n(oT);nV.isAxiosError;let oC=new class{get api(){return this._client}constructor(){this._axiosInstance=nV.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(t=>(t.paramsSerializer=t=>oA().stringify(t,{arrayFormat:"repeat"}),t))}get axiosInstance(){return this._axiosInstance}get baseUrl(){return this._baseUrl}setTimeout(t){this._axiosInstance.defaults.timeout=t}addRequestInterceptor(t){this._axiosInstance.interceptors.request.use(t)}initialise(t){this._baseUrl=t,this._client=new on(t,this._axiosInstance)}};var oS=function(t,i,r,n){return new(r||(r=Promise))(function(o,a){function s(t){try{c(n.next(t))}catch(t){a(t)}}function l(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var i;t.done?o(t.value):((i=t.value)instanceof r?i:new r(function(t){t(i)})).then(s,l)}c((n=n.apply(t,i||[])).next())})};(eE=tM||(tM={})).DISCONNECTED="DISCONNECTED",eE.CONNECTED="CONNECTED",eE.CONNECTING="CONNECTING";let oL="SUBSCRIBED:",oP="UNAUTHORIZED:",oI="TRIGGERED:",oR="EVENT:";class oB{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=oO.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=tM.DISCONNECTED,this._connectingDeferred=null,this._statusCallbacks=[],this._pendingSubscription=null,this._queuedSubscriptions=[],this._subscriptionMap=new Map,this._assetEventCallbackMap=new Map,this._attributeEventCallbackMap=new Map,this._unloading=!1}get status(){return this._status}subscribeStatusChange(t){this._statusCallbacks.push(t)}unsubscribeStatusChange(t){!function(t,i){if(0===t.length)return;let r=t.indexOf(i);r>=0&&t.splice(r,1)}(this._statusCallbacks,t)}connect(){return(console.debug("Attempting to connect to events:",this.endpointUrl),this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._status===tM.CONNECTED)?(console.debug("Already connected to events!"),Promise.resolve(!0)):((this._disconnectRequested=!1,this._connectingDeferred)?console.warn("Already connecting to events, continuing the previous one."):(this._onStatusChanged(tM.CONNECTING),this._connectingDeferred=new im,this._doConnect().then(t=>{if(this._connectingDeferred){let i=this._connectingDeferred;t?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=oO.MIN_RECONNECT_DELAY,this._onStatusChanged(tM.CONNECTED),window.setTimeout(()=>{this._onConnect()},0)):console.debug("Failed to connect to event service: "+this.endpointUrl),i.resolve(t)}}).finally(()=>{this._connectingDeferred=null})),this._connectingDeferred.promise)}disconnect(){console.debug("Disconnecting from event service: "+this.endpointUrl),this._disconnectRequested||(this._disconnectRequested=!0,this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this.status!==tM.DISCONNECTED&&this._doDisconnect())}subscribe(t,i){let r={eventSubscription:t,callback:i,deferred:new im};return null!=this._pendingSubscription||this._status!==tM.CONNECTED?(this._queuedSubscriptions.push(r),r.deferred.promise):(this._pendingSubscription=r,this._doSubscribe(t).then(t=>{if(this._pendingSubscription){let i=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(t,i),this._processNextSubscription();let r=i.deferred;i.deferred=null,r&&r.resolve(t)}},t=>{if(console.error(t),this._pendingSubscription){let i=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();let r=i.deferred;i.deferred=null,r&&r.reject(t)}}),this._pendingSubscription.deferred.promise)}unsubscribe(t){return oS(this,void 0,void 0,function*(){if(this._subscriptionMap.delete(t))return void this._doUnsubscribe(t);if(this._assetEventCallbackMap.delete(t)){if(this._assetEventPromise&&0===this._assetEventCallbackMap.size){let t=yield this._assetEventPromise;this._assetEventPromise=void 0,this.unsubscribe(t)}return}if(this._attributeEventCallbackMap.delete(t)&&this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){let t=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(t)}})}sendEvent(t){this._status===tM.CONNECTED&&this._doSend(t)}sendEventWithReply(t){return this._status!==tM.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(t)}subscribeAssetEvents(t,i,r){return oS(this,void 0,void 0,function*(){let n=t&&"string"!=typeof t[0]?t.map(t=>t.id):t,o="AssetEvent"+oB._subscriptionCounter++;if(!this._assetEventPromise){let t;sk.authenticated||(t={filterType:"asset",realm:sk.displayRealm});let i={eventType:"asset",filter:t};this._assetEventPromise=this.subscribe(i,t=>{this._assetEventCallbackMap.forEach(i=>i(t))})}return this._assetEventCallbackMap.set(o,t=>{let i=t.asset.id;n?n.find(t=>i===t)&&r(t):t.asset.realm===sk.displayRealm&&r(t)}),this._assetEventPromise.then(()=>{try{if(n&&i){let t={messageID:"read-assets:"+n.join(",")+":"+o,eventType:"read-assets",assetQuery:{ids:n}};this.sendEventWithReply(t).then(t=>{t.assets&&this._assetEventCallbackMap.has(o)&&t.assets.forEach(t=>{r({eventType:"asset",asset:t,cause:"READ"})})})}}catch(i){throw console.error("Failed to subscribe to asset events for assets: "+t),o&&this.unsubscribe(o),i}return o})})}subscribeAttributeEvents(t,i,r){return oS(this,void 0,void 0,function*(){let n=t&&"string"!=typeof t[0],o=n?t.map(t=>t.id):t,a=n?t:void 0,s="AttributeEvent"+oB._subscriptionCounter++;if(!this._attributeEventPromise){let t;sk.authenticated||(t={filterType:"asset",realm:sk.displayRealm});let i={eventType:"attribute",filter:t};this._attributeEventPromise=this.subscribe(i,t=>{this._attributeEventCallbackMap.forEach(i=>i(t))})}let l=i=>{let a=i.ref;n?t.forEach(t=>{a.id===t.id&&a.name===t.name&&r(i)}):o?o.find(t=>a.id===t)&&r(i):i.realm===sk.displayRealm&&r(i)};return this._attributeEventCallbackMap.set(s,l),this._attributeEventPromise.then(()=>{try{if(i&&o){let t={messageID:"read-assets:"+o.join(",")+":"+s,eventType:"read-assets",assetQuery:{ids:o}};this.sendEventWithReply(t).then(t=>{t.assets&&this._attributeEventCallbackMap.has(s)&&t.assets.forEach(t=>{t.attributes&&Object.entries(t.attributes).forEach(([i,r])=>{(!a||a.find(r=>r.id===t.id&&r.name===i))&&l({eventType:"attribute",timestamp:r.timestamp,value:r.value,ref:{id:t.id,name:i}})})})})}}catch(i){throw console.error("Failed to subscribe to asset events for assets: "+t),s&&this.unsubscribe(s),i}return s})})}_processNextSubscription(){this._status===tM.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{let t=this._queuedSubscriptions.shift();t&&this.subscribe(t.eventSubscription,t.callback).then(i=>{let r=t.deferred;t.deferred=null,r&&r.resolve(i)},i=>{let r=t.deferred;t.deferred=null,r&&r.reject(i)})},0)}_onStatusChanged(t){t!==this._status&&(console.debug("Event provider status changed: "+t),this._status=t,this._unloading||window.setTimeout(()=>{this._statusCallbacks.forEach(i=>i(t))},0))}_onMessageReceived(t,i){let r=this._subscriptionMap.get(t);r&&r.callback(i)}_onConnect(){if(Object.keys(this._subscriptionMap).length>0){for(let t in this._subscriptionMap)this._subscriptionMap.has(t)&&this._queuedSubscriptions.unshift(this._subscriptionMap.get(t));this._subscriptionMap.clear()}this._processNextSubscription()}_onDisconnect(){this._status===tM.CONNECTED&&this._onStatusChanged(tM.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(tM.CONNECTING),this._scheduleReconnect()}_scheduleReconnect(){this._reconnectTimer||!this._disconnectRequested&&(console.debug("Event provider scheduling reconnect in "+this._reconnectDelayMillis+"ms"),this._reconnectTimer=window.setTimeout(()=>{this._disconnectRequested||this.connect()},this._reconnectDelayMillis),this._reconnectDelayMillis<oO.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(oO.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}oB.MIN_RECONNECT_DELAY=0,oB.MAX_RECONNECT_DELAY=3e4,oB._subscriptionCounter=0;class oO extends oB{get endpointUrl(){return this._endpointUrl}constructor(t){super(),this._webSocket=void 0,this._connectDeferred=null,this._subscribeDeferred=null,this._repliesDeferred=new Map,this._endpointUrl=(t.startsWith("https:")?"wss":"ws")+"://"+t.substr(t.indexOf("://")+3)+"/websocket/events",window.addEventListener("beforeunload",()=>{this._unloading=!0,this.disconnect()})}_doConnect(){let t=this._endpointUrl+"?Realm="+sk.config.realm;return this._connectDeferred=new im,(sk.authenticated?sk.retrieveAuthorizationHeader().then(i=>{t+="&Authorization="+i}):Promise.resolve()).finally(()=>{this._webSocket=new WebSocket(t),this._webSocket.onopen=t=>{if(this._connectDeferred){let t=this._connectDeferred;this._connectDeferred=null,t.resolve(!0)}},this._webSocket.onerror=t=>{if(console.error("Event provider error:",t),this._connectDeferred){let t=this._connectDeferred;this._connectDeferred=null,t.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onclose=()=>{if(console.warn("The WebSocket connection of the event provider has been closed."),this._webSocket=void 0,this._connectDeferred){let t=this._connectDeferred;this._connectDeferred=null,t.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onmessage=t=>{let i=t.data;if(i&&i.startsWith(oL)){let t=JSON.parse(i.substring(oL.length)),r=this._subscribeDeferred;this._subscribeDeferred=null,r&&r.resolve(t.subscriptionId)}else if(i.startsWith(oP)){let t=JSON.parse(i.substring(oP.length)),r=this._subscribeDeferred;this._subscribeDeferred=null,r&&(console.warn("Unauthorized event subscription: "+JSON.stringify(t,null,2)),r.reject("Unauthorized"))}else if(i.startsWith(oI)){let t=JSON.parse(i.substring(oI.length));t.events&&t.events.forEach(i=>{this._onMessageReceived(t.subscriptionId,i)})}else if(i.startsWith(oR)){let t=JSON.parse(i.substring(oR.length));if(t.messageID){let i=this._repliesDeferred.get(t.messageID);this._repliesDeferred.delete(t.messageID),i&&i.resolve(t)}}}}),this._connectDeferred.promise}_beforeDisconnect(){this._onDisconnect()}_doDisconnect(){var t;null==(t=this._webSocket)||t.close(),this._subscribeDeferred=null,this._repliesDeferred.clear()}_doSubscribe(t){return this._webSocket?this._subscribeDeferred?Promise.reject("There's already a pending subscription"):(this._subscribeDeferred=new im,t.subscriptionId||(t.subscriptionId=oO._subscriptionCounter+++""),this._webSocket.send("SUBSCRIBE:"+JSON.stringify(t)),this._subscribeDeferred.promise):Promise.reject("Not connected")}_doUnsubscribe(t){this._webSocket&&this._webSocket.send("UNSUBSCRIBE:"+JSON.stringify({subscriptionId:t}))}_doSend(t){let i=oR+JSON.stringify(t);this._webSocket.send(i)}_doSendWithReply(t){if(t.messageID||(t.messageID=(new Date().getTime()+10*Math.random()).toString(10)),this._repliesDeferred.has(t.messageID))return Promise.reject("There's already a pending send and reply with this ID");let i=new im;return this._repliesDeferred.set(t.messageID,i),this._webSocket.send(oR+JSON.stringify(t)),i.promise}}oO._subscriptionCounter=1;let oz=["__proto__","constructor","prototype"];function oY(t){return!("string"!=typeof t||0===t.length||t.length>128||oz.indexOf(t)>-1||t.indexOf("..")>-1||t.indexOf("\\")>-1||/[?#%:&=;\s]/.test(t)||/[\x00-\x1F\x7F]/.test(t))}function oj(t){return!(!oY(t)||t.indexOf("/")>-1||t.indexOf("@")>-1)}let oN={lng:oj,ns:function(t){return!(!oY(t)||t.indexOf("//")>-1)}};function oU(t){return"string"!=typeof t?t:t.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function oH(){return"function"==typeof XMLHttpRequest||"object"==typeof XMLHttpRequest}let oV=/\{\{(.+?)\}\}/g,o$=/^[/\\]{2}/;function oq(t,i){let r=!1,n=t.replace(oV,(t,n)=>{let o=n.trim();if(oz.indexOf(o)>-1)return t;let a=i[o];if(null==a)return t;let s=oN[o]||oj,l=String(a).split("+");for(let i of l)if(!s(i))return r=!0,t;return l.join("+")});return r||o$.test(n)&&!o$.test(t)?null:n}let oG="u">typeof globalThis?globalThis:"u">typeof global?global:"u">typeof window?window:void 0;"function"==typeof fetch?t=fetch:oG&&"function"==typeof oG.fetch&&(t=oG.fetch);let oW=oH()&&oG?oG.XMLHttpRequest:void 0,oZ="function"==typeof ActiveXObject&&oG?oG.ActiveXObject:void 0,oK=["__proto__","constructor","prototype"],oJ=(t,i)=>{if(i&&"object"==typeof i){let r="";for(let t of Object.keys(i))oK.indexOf(t)>-1||(r+="&"+encodeURIComponent(t)+"="+encodeURIComponent(i[t]));if(!r)return t;t=t+(-1!==t.indexOf("?")?"&":"?")+r.slice(1)}return t},oX=(i,r,n,o)=>{let a=t=>{if(!t.ok)return n(t.statusText||"Error",{status:t.status});t.text().then(i=>{n(null,{status:t.status,data:i})}).catch(n)};if(o){let t=o(i,r);if(t instanceof Promise)return void t.then(a).catch(n)}"function"==typeof fetch?fetch(i,r).then(a).catch(n):t(i,r).then(a).catch(n)},oQ=(i,r,n,o)=>{if("function"==typeof n&&(o=n,n=void 0),o=o||(()=>{}),t&&0!==r.indexOf("file:")){var a=r,s=n,l=o;i.queryStringParams&&(a=oJ(a,i.queryStringParams));let t={..."function"==typeof i.customHeaders?i.customHeaders():i.customHeaders};"u"<typeof window&&"u">typeof global&&void 0!==global.process&&global.process.versions&&global.process.versions.node&&(t["User-Agent"]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),s&&(t["Content-Type"]="application/json");let c="function"==typeof i.requestOptions?i.requestOptions(s):i.requestOptions,d={method:s?"POST":"GET",body:s?i.stringify(s):void 0,headers:t,...i._omitFetchOptions?{}:c},u="function"==typeof i.alternateFetch&&i.alternateFetch.length>=1?i.alternateFetch:void 0;try{oX(a,d,l,u)}catch(t){if(!c||0===Object.keys(c).length||!t.message||0>t.message.indexOf("not implemented"))return l(t);try{Object.keys(c).forEach(t=>{delete d[t]}),oX(a,d,l,u),i._omitFetchOptions=!0}catch(t){l(t)}}return}if(oH()||"function"==typeof ActiveXObject){var c=r,d=n,u=o;d&&"object"==typeof d&&(d=oJ("",d).slice(1)),i.queryStringParams&&(c=oJ(c,i.queryStringParams));try{let t=oW?new oW:new oZ("MSXML2.XMLHTTP.3.0");t.open(d?"POST":"GET",c,1),i.crossDomain||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=!!i.withCredentials,d&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.overrideMimeType&&t.overrideMimeType("application/json");let r=i.customHeaders;if(r="function"==typeof r?r():r)for(let i of Object.keys(r))oK.indexOf(i)>-1||t.setRequestHeader(i,r[i]);t.onreadystatechange=()=>{t.readyState>3&&u(t.status>=400?t.statusText:null,{status:t.status,data:t.responseText})},t.send(d)}catch(t){console&&console.log(t)}return}o(Error("No fetch and no xhr implementation found!"))};var o0=class{constructor(t,i={},r={}){this.services=t,this.options=i,this.allOptions=r,this.type="backend",this.init(t,i,r)}init(t,i={},r={}){if(this.services=t,this.options={...{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:t=>JSON.parse(t),stringify:JSON.stringify,parsePayload:(t,i,r)=>({[i]:r||""}),parseLoadPayload:(t,i)=>void 0,request:oQ,reloadInterval:"u"<typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}},...this.options||{},...i},this.allOptions=r,this.services&&this.options.reloadInterval){let t=setInterval(()=>this.reload(),this.options.reloadInterval);"object"==typeof t&&"function"==typeof t.unref&&t.unref()}}readMulti(t,i,r){this._readAny(t,t,i,i,r)}read(t,i,r){this._readAny([t],t,[i],i,r)}_readAny(t,i,r,n,o){var a,s;let l=this.options.loadPath;"function"==typeof this.options.loadPath&&(l=this.options.loadPath(t,r)),(l=(s=a=l)&&"function"==typeof s.then?a:Promise.resolve(a)).then(a=>{if(!a)return o(null,{});let s=oq(a,{lng:t.join("+"),ns:r.join("+")});if(null==s)return o(Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+t.map(oU).join(", ")+"] namespaces=["+r.map(oU).join(", ")+"]"),!1);this.loadUrl(s,o,i,n)})}loadUrl(t,i,r,n){let o=this.options.parseLoadPayload("string"==typeof r?[r]:r,"string"==typeof n?[n]:n),a=oU(function(t){if("string"!=typeof t||0===t.length)return t;try{let i=new URL(t);if(i.username||i.password)return i.username="",i.password="",i.toString();return t}catch(i){return t.replace(/(\/\/)[^/@\s]+@/g,"$1")}}(t));this.options.request(this.options,t,o,(t,o)=>{let s,l;if(o&&(o.status>=500&&o.status<600||!o.status))return i("failed loading "+a+"; status code: "+o.status,!0);if(o&&o.status>=400&&o.status<500)return i("failed loading "+a+"; status code: "+o.status,!1);if(!o&&t&&t.message){let r=t.message.toLowerCase();if(["failed","fetch","network","load"].find(t=>r.indexOf(t)>-1))return i("failed loading "+a+": "+oU(t.message),!0)}if(t)return i(t,!1);try{s="string"==typeof o.data?this.options.parse(o.data,r,n):o.data}catch(t){l="failed parsing "+a+" to json"}if(l)return i(l,!1);i(null,s)})}create(t,i,r,n,o){if(!this.options.addPath)return;"string"==typeof t&&(t=[t]);let a=this.options.parsePayload(i,r,n),s=0,l=[],c=[];t.forEach(r=>{let n=this.options.addPath;"function"==typeof this.options.addPath&&(n=this.options.addPath(r,i));let d=oq(n,{lng:r,ns:i});if(null==d){s+=1,o&&s===t.length&&o(l,c);return}this.options.request(this.options,d,a,(i,r)=>{s+=1,l.push(i),c.push(r),s===t.length&&"function"==typeof o&&o(l,c)})})}reload(){let{backendConnector:t,languageUtils:i,logger:r}=this.services,n=t.language;if(n&&"cimode"===n.toLowerCase())return;let o=[],a=t=>{i.toResolveHierarchy(t).forEach(t=>{0>o.indexOf(t)&&o.push(t)})};a(n),this.allOptions.preload&&this.allOptions.preload.forEach(t=>a(t)),o.forEach(i=>{this.allOptions.ns.forEach(n=>{t.read(i,n,"read",null,null,(o,a)=>{o&&r.warn(`loading namespace ${n} for language ${i} failed`,o),!o&&a&&r.log(`loaded namespace ${n} for language ${i}`,a),t.loaded(`${i}|${n}`,o,a)})})})}};o0.type="backend";let o1=globalThis,o2=o1.ShadowRoot&&(void 0===o1.ShadyCSS||o1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o3=Symbol(),o5=new WeakMap;class o4{constructor(t,i,r){if(this._$cssResult$=!0,r!==o3)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=i}get styleSheet(){let t=this.o,i=this.t;if(o2&&void 0===t){let r=void 0!==i&&1===i.length;r&&(t=o5.get(i)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&o5.set(i,t))}return t}toString(){return this.cssText}}let o6=t=>new o4("string"==typeof t?t:t+"",void 0,o3),o8=(t,...i)=>new o4(1===t.length?t[0]:i.reduce((i,r,n)=>i+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[n+1],t[0]),t,o3),o7=(t,i)=>{if(o2)t.adoptedStyleSheets=i.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let r of i){let i=document.createElement("style"),n=o1.litNonce;void 0!==n&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)}},o9=o2?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let i="";for(let r of t.cssRules)i+=r.cssText;return o6(i)})(t):t,{is:ae,defineProperty:at,getOwnPropertyDescriptor:ai,getOwnPropertyNames:ar,getOwnPropertySymbols:an,getPrototypeOf:ao}=Object,aa=globalThis,as=aa.trustedTypes,al=as?as.emptyScript:"",ac=aa.reactiveElementPolyfillSupport,ad={toAttribute(t,i){switch(i){case Boolean:t=t?al:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let r=t;switch(i){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(t){r=null}}return r}},au=(t,i)=>!ae(t,i),ah={attribute:!0,type:String,converter:ad,reflect:!1,useDefault:!1,hasChanged:au};Symbol.metadata??=Symbol("metadata"),aa.litPropertyMetadata??=new WeakMap;class am extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,i=ah){if(i.state&&(i.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((i=Object.create(i)).wrapped=!0),this.elementProperties.set(t,i),!i.noAccessor){let r=Symbol(),n=this.getPropertyDescriptor(t,r,i);void 0!==n&&at(this.prototype,t,n)}}static getPropertyDescriptor(t,i,r){let{get:n,set:o}=ai(this.prototype,t)??{get(){return this[i]},set(t){this[i]=t}};return{get:n,set(i){let a=n?.call(this);o?.call(this,i),this.requestUpdate(t,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??ah}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;let t=ao(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){let t=this.properties;for(let i of[...ar(t),...an(t)])this.createProperty(i,t[i])}let t=this[Symbol.metadata];if(null!==t){let i=litPropertyMetadata.get(t);if(void 0!==i)for(let[t,r]of i)this.elementProperties.set(t,r)}for(let[t,i]of(this._$Eh=new Map,this.elementProperties)){let r=this._$Eu(t,i);void 0!==r&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let i=[];if(Array.isArray(t))for(let r of new Set(t.flat(1/0).reverse()))i.unshift(o9(r));else void 0!==t&&i.push(o9(t));return i}static _$Eu(t,i){let r=i.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map;for(let i of this.constructor.elementProperties.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return o7(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,i,r){this._$AK(t,r)}_$ET(t,i){let r=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,r);if(void 0!==n&&!0===r.reflect){let o=(void 0!==r.converter?.toAttribute?r.converter:ad).toAttribute(i,r.type);this._$Em=t,null==o?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(t,i){let r=this.constructor,n=r._$Eh.get(t);if(void 0!==n&&this._$Em!==n){let t=r.getPropertyOptions(n),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:ad;this._$Em=n;let a=o.fromAttribute(i,t.type);this[n]=a??this._$Ej?.get(n)??a,this._$Em=null}}requestUpdate(t,i,r){if(void 0!==t){let n=this.constructor,o=this[t];if(!(((r??=n.getPropertyOptions(t)).hasChanged??au)(o,i)||r.useDefault&&r.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,r))))return;this.C(t,i,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,i,{useDefault:r,reflect:n,wrapped:o},a){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,a??i??this[t]),!0!==o||void 0!==a)||(this._$AL.has(t)||(this.hasUpdated||r||(i=void 0),this._$AL.set(t,i)),!0===n&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[t,i]of this._$Ep)this[t]=i;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[i,r]of t){let{wrapped:t}=r,n=this[i];!0!==t||this._$AL.has(i)||void 0===n||this.C(i,void 0,r,n)}}let t=!1,i=this._$AL;try{(t=this.shouldUpdate(i))?(this.willUpdate(i),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(i)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(i)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}am.elementStyles=[],am.shadowRootOptions={mode:"open"},am.elementProperties=new Map,am.finalized=new Map,ac?.({ReactiveElement:am}),(aa.reactiveElementVersions??=[]).push("2.1.1");let af=globalThis,ap=af.trustedTypes,a_=ap?ap.createPolicy("lit-html",{createHTML:t=>t}):void 0,ag="$lit$",ab=`lit$${Math.random().toFixed(9).slice(2)}$`,ay="?"+ab,av=`<${ay}>`,aF=document,ax=()=>aF.createComment(""),aw=t=>null===t||"object"!=typeof t&&"function"!=typeof t,aE=Array.isArray,ak=t=>aE(t)||"function"==typeof t?.[Symbol.iterator],aM="[ \n\f\r]",aD=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,aT=/-->/g,aA=/>/g,aC=RegExp(`>|${aM}(?:([^\\s"'>=/]+)(${aM}*=${aM}*(?:[^
|
|
817
|
+
${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionData:d,getProjectionData:t=>c.getProjectionData({overscaledTileID:new E.d(t.tileID.canonical.z,t.tileID.wrap??0,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),aligned:t.aligned,applyGlobeMatrix:t.applyGlobeMatrix,applyTerrainMatrix:t.applyTerrainMatrix})},h=s.renderingMode?s.renderingMode:"2d";if("offscreen"===n.currentPass){let i=s.prerender;i&&(t.setCustomLayerDefaults(),a.setColorMode(t.colorModeForRenderPass()),i.call(s,a.gl,u),a.setDirty(),t.setBaseState())}else if("translucent"===n.currentPass){t.setCustomLayerDefaults(),a.setColorMode(t.colorModeForRenderPass()),a.setStencilMode(n_.disabled);let i="3d"===h?t.getDepthModeFor3D():t.getDepthModeForSublayer(0,np.ReadOnly);a.setDepthMode(i),s.render(a.gl,u),a.setDirty(),t.setBaseState(),a.bindFramebuffer.set(null)}},debug:function(t,i,r){for(let n of r)!function(t,i,r){let n=t.context,o=n.gl,a=t.useProgram("debug"),s=np.disabled,l=n_.disabled,c=t.colorModeForRenderPass(),d="$debug",u=t.style.map.terrain?.getTerrainData(r);n.activeTexture.set(o.TEXTURE0);let h=Math.floor((i.getTileByID(r.key).latestRawTileData?.byteLength||0)/1024),m=512/Math.min(i.getTile(r).tileSize,512)*(r.overscaledZ/t.transform.zoom)*.5,f=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(f+=` => ${r.overscaledZ}`),function(t,i){t.initDebugOverlayCanvas();let r=t.debugOverlayCanvas,n=t.context.gl,o=t.debugOverlayCanvas.getContext("2d");o.clearRect(0,0,r.width,r.height),o.shadowColor="white",o.shadowBlur=2,o.lineWidth=1.5,o.strokeStyle="white",o.textBaseline="top",o.font="bold 36px Open Sans, sans-serif",o.fillText(i,5,5),o.strokeText(i,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(t,`${f} ${h}kB`);let p=t.transform.getProjectionData({overscaledTileID:r,applyGlobeMatrix:!0,applyTerrainMatrix:!0});a.draw(n,o.TRIANGLES,s,l,nm.alphaBlended,ng.disabled,rp(E.pn.transparent,m),null,p,d,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),a.draw(n,o.LINE_STRIP,s,l,c,ng.disabled,rp(E.pn.red),u,p,d,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}(t,i,n)},debugPadding:function(t){var i,r,n,o;let a=t.transform.padding;nH(t,t.transform.height-(a.top||0),3,nz),nH(t,a.bottom||0,3,nY),nV(t,a.left||0,3,nj),nV(t,t.transform.width-(a.right||0),3,nN);let s=t.transform.centerPoint;i=t,r=s.x,n=t.transform.height-s.y,n$(i,r-1,n-10,2,20,o=nU),n$(i,r-10,n-1,20,2,o)},terrainDepth:function(t,i){let r=t.context,n=r.gl,o=t.transform,a=nm.unblended,s=new np(n.LEQUAL,np.ReadWrite,[0,1]),l=i.tileManager.getRenderableTiles(),c=t.useProgram("terrainDepth");for(let d of(r.bindFramebuffer.set(i.getFramebuffer().framebuffer),r.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),r.clear({color:E.pn.white,depth:1}),l)){let t=i.getTerrainMesh(d.tileID),l=i.getTerrainData(d.tileID),u=o.getProjectionData({overscaledTileID:d.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),h=i6(i.getSkirtLength(o.zoom));c.draw(r,n.TRIANGLES,s,n_.disabled,a,ng.backCCW,h,l,u,"terrain",t.vertexBuffer,t.indexBuffer,t.segments)}r.bindFramebuffer.set(null),r.viewport.set([0,0,t.width,t.height])}};var nW=class t{constructor(t,i){this.drawFunctions=nG,this.context=new nf(t),this.transform=i,this.layerOpacityFbo=null,this._tileTextures={},this._rttObjectRecyclePool=[],this._rttSharedFbo=null,this.terrainFacilitator={depthDirty:!0,matrix:(0,E.Ci)(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=tm.maxOverzooming+tm.maxUnderzooming+1,this.depthEpsilon=1/65536,this.crossTileSymbolIndex=new t5}resize(t,i,r){if(this.width=Math.floor(t*r),this.height=Math.floor(i*r),this.pixelRatio=r,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let t of this.style._order)this.style._layers[t].resize()}setup(){let t=this.context,i=new E.Ut;i.emplaceBack(0,0),i.emplaceBack(8192,0),i.emplaceBack(0,8192),i.emplaceBack(8192,8192),this.tileExtentBuffer=t.createVertexBuffer(i,eZ.members),this.tileExtentSegments=E.Rt.simpleSegment(0,0,4,2);let r=new E.Ut;r.emplaceBack(0,0),r.emplaceBack(8192,0),r.emplaceBack(0,8192),r.emplaceBack(8192,8192),this.debugBuffer=t.createVertexBuffer(r,eZ.members),this.debugSegments=E.Rt.simpleSegment(0,0,4,5);let n=new E.Gt;n.emplaceBack(0,0,0,0),n.emplaceBack(8192,0,8192,0),n.emplaceBack(0,8192,0,8192),n.emplaceBack(8192,8192,8192,8192),this.rasterBoundsBuffer=t.createVertexBuffer(n,i3.members),this.rasterBoundsSegments=E.Rt.simpleSegment(0,0,4,2);let o=new E.Ut;o.emplaceBack(0,0),o.emplaceBack(8192,0),o.emplaceBack(0,8192),o.emplaceBack(8192,8192),this.rasterBoundsBufferPosOnly=t.createVertexBuffer(o,eZ.members),this.rasterBoundsSegmentsPosOnly=E.Rt.simpleSegment(0,0,4,5);let a=new E.Ut;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(a,eZ.members),this.viewportSegments=E.Rt.simpleSegment(0,0,4,2);let s=new E.Vt;s.emplaceBack(0),s.emplaceBack(1),s.emplaceBack(3),s.emplaceBack(2),s.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(s);let l=new E.Kt;l.emplaceBack(1,0,2),l.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(l);let c=this.context.gl;this.stencilClearMode=new n_({func:c.ALWAYS,mask:0},0,255,c.ZERO,c.ZERO,c.ZERO),this.tileExtentMesh=new eW(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let t=this.context,i=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let r=(0,E.yi)();(0,E.Ei)(r,0,this.width,this.height,0,0,1),(0,E.ji)(r,r,[i.drawingBufferWidth,i.drawingBufferHeight,0]),this.useProgram("clippingMask",null,!0).draw(t,i.TRIANGLES,np.disabled,this.stencilClearMode,nm.disabled,ng.disabled,null,null,{mainMatrix:r,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:r,clipAntimeridian:!1},"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}renderTileClippingMasks(t,i,r){if(this.currentStencilSource===t.source||!t.isTileClipped()||!i?.length)return;this.currentStencilSource=t.source,this.nextStencilID+i.length>256&&this.clearStencil();let n=this.context;n.setColorMode(nm.disabled),n.setDepthMode(np.disabled);let o={};for(let t of i)o[t.key]=this.nextStencilID++;this.style.projection.useSubdivision&&this._renderTileMasks(o,i,r,!0),this._renderTileMasks(o,i,r,!1),this._tileClippingMaskIDs=o}_renderTileMasks(t,i,r,n){let o=this.context,a=o.gl,s=this.style.projection,l=this.transform,c=this.useProgram("clippingMask");for(let d of i){let i=t[d.key],u=this.getTerrainDataForTile(d,r),h=s.getMeshFromTileID(this.context,d.canonical,n,!0,"stencil"),m=l.getProjectionData({overscaledTileID:d,applyGlobeMatrix:!r,applyTerrainMatrix:!0});c.draw(o,a.TRIANGLES,np.disabled,new n_({func:a.ALWAYS,mask:0},i,255,a.KEEP,a.KEEP,a.REPLACE),nm.disabled,r?ng.disabled:ng.backCCW,null,u,m,"$clipping",h.vertexBuffer,h.indexBuffer,h.segments)}}getTerrainDataForTile(t,i){return i&&this.style.projection?.name==="mercator"?null:this.style.map.terrain?.getTerrainData(t)||null}_renderTilesDepthBuffer(){let t=this.context,i=t.gl,r=this.style.projection,n=this.transform,o=this.useProgram("depth"),a=this.getDepthModeFor3D();for(let s of tl(n,{tileSize:n.tileSize})){let l=this.style.map.terrain?.getTerrainData(s),c=r.getMeshFromTileID(this.context,s.canonical,!0,!0,"raster"),d=n.getProjectionData({overscaledTileID:s,applyGlobeMatrix:!0,applyTerrainMatrix:!0});o.draw(t,i.TRIANGLES,a,n_.disabled,nm.disabled,ng.backCCW,null,l,d,"$clipping",c.vertexBuffer,c.indexBuffer,c.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let t=this.nextStencilID++,i=this.context.gl;return new n_({func:i.NOTEQUAL,mask:255},t,255,i.KEEP,i.KEEP,i.REPLACE)}stencilModeForClipping(t){let i=this.context.gl;return new n_({func:i.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,i.KEEP,i.KEEP,i.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(t){let i=this.context.gl,r=t.sort((t,i)=>i.overscaledZ-t.overscaledZ),n=r[r.length-1].overscaledZ,o=r[0].overscaledZ-n+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();let t={};for(let r=0;r<o;r++)t[r+n]=new n_({func:i.GEQUAL,mask:255},r+this.nextStencilID,255,i.KEEP,i.KEEP,i.REPLACE);return this.nextStencilID+=o,[t,r]}return[{[n]:n_.disabled},r]}stencilConfigForOverlapTwoPass(t){let i=this.context.gl,r=t.sort((t,i)=>i.overscaledZ-t.overscaledZ),n=r[r.length-1].overscaledZ,o=r[0].overscaledZ-n+1;if(this.clearStencil(),o>1){let t={},a={};for(let r=0;r<o;r++)t[r+n]=new n_({func:i.GREATER,mask:255},o+1+r,255,i.KEEP,i.KEEP,i.REPLACE),a[r+n]=new n_({func:i.GREATER,mask:255},1+r,255,i.KEEP,i.KEEP,i.REPLACE);return this.nextStencilID=2*o+1,[t,a,r]}return this.nextStencilID=3,[{[n]:new n_({func:i.GREATER,mask:255},2,255,i.KEEP,i.KEEP,i.REPLACE)},{[n]:new n_({func:i.GREATER,mask:255},1,255,i.KEEP,i.KEEP,i.REPLACE)},r]}colorModeForRenderPass(){let t=this.context.gl;if(this._showOverdrawInspector){let i=1/8;return new nm([t.CONSTANT_COLOR,t.ONE],new E.pn(i,i,i,0),[!0,!0,!0,!0])}return"opaque"===this.renderOptions.currentPass?nm.unblended:nm.alphaBlended}getDepthModeForSublayer(t,i,r){if(!this.opaquePassEnabledForLayer())return np.disabled;let n=1-((1+this.renderOptions.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new np(r||this.context.gl.LEQUAL,i,[n,n])}getDepthModeFor3D(){return new np(this.context.gl.LEQUAL,np.ReadWrite,this.renderOptions.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.renderOptions.currentLayer<this.renderOptions.opaquePassCutoff}render(t,i){var r,n;let o;this.style=t,this.options=i;let a=this.renderOptions=(r=this.transform,n=t.projection,{currentPass:"offscreen",currentLayer:0,opaquePassCutoff:1/0,depthRangeFor3D:[0,1],isRenderingToTexture:!1,transform:r,terrain:t.map.terrain??null,projectionTransition:o=n?.transitionState??0,isRenderingGlobe:o>0});this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.patternAtlas=t.patternAtlas,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(A()),function(t,i){let r=t.pending,{transform:n}=i,o=i.context.gl;r[nh.u_units_to_pixels]=1/n.pixelsToGLUnits[0],r[nh.u_units_to_pixels+1]=1/n.pixelsToGLUnits[1],r[nh.u_world_size]=o.drawingBufferWidth,r[nh.u_world_size+1]=o.drawingBufferHeight,r[nh.u_camera_to_center_distance]=n.cameraToCenterDistance,r[nh.u_symbol_fade_change]=i.options.fadeDuration?i.symbolFadeChange:1,r[nh.u_aspect_ratio]=n.width/n.height,r[nh.u_device_pixel_ratio]=i.pixelRatio,r[nh.u_viewport_size]=n.width,r[nh.u_viewport_size+1]=n.height,r[nh.u_pixel_extrude_scale]=1/n.width,r[nh.u_pixel_extrude_scale+1]=1/n.height,r[nh.u_pitch]=n.pitch/360*2*Math.PI,t.upload()}(this.context.frameUniformBuffer,this),this.imageManager.beginFrame();let s=this.style._order,l=this.style.tileManagers,c={},d={},u={};for(let t in l){let i=l[t];i.used&&i.prepare(this.context),c[t]=i.getVisibleCoordinates(!1),d[t]=c[t].slice().reverse(),u[t]=i.getVisibleCoordinates(!0).reverse()}a.opaquePassCutoff=1/0;for(let t=0;t<s.length;t++){let i=s[t];if(this.style._layers[i].is3D()){a.opaquePassCutoff=t;break}}for(let t of(this.maybeDrawDepth(),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),a.opaquePassCutoff=0),a.currentPass="offscreen",s)){let i=this.style._layers[t];if(!i.hasOffscreenPass()||i.isHidden(this.transform.zoom))continue;let r=d[i.source];("custom"===i.type||r.length)&&this.renderLayer(this,l[i.source],i,r,a)}if(this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?E.pn.black:E.pn.transparent,depth:1}),this.clearStencil(),this.style.sky&&this.drawFunctions.sky(this,this.style.sky),this._showOverdrawInspector=i.showOverdrawInspector,a.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(a.currentPass="opaque",a.currentLayer=s.length-1;a.currentLayer>=0;a.currentLayer--){let t=this.style._layers[s[a.currentLayer]],i=l[t.source],r=c[t.source];this.renderTileClippingMasks(t,r,!1),this.renderLayer(this,i,t,r,a)}a.currentPass="translucent";let h=!1;for(a.currentLayer=0;a.currentLayer<s.length;a.currentLayer++){let t=this.style._layers[s[a.currentLayer]],i=l[t.source];if(this.renderToTexture?.renderLayer(t,a))continue;this.opaquePassEnabledForLayer()||h||(h=!0,a.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());let r=("symbol"===t.type?u:d)[t.source];this.renderTileClippingMasks(t,c[t.source],!!this.renderToTexture),this.renderLayer(this,i,t,r,a)}if(a.isRenderingGlobe&&this.drawFunctions.atmosphere(this,this.style.sky,this.style.light),this.options.showTileBoundaries){let t=function(t,i){let r=null,n=Object.values(t._layers).flatMap(r=>r.source&&!r.isHidden(i)?[t.tileManagers[r.source]]:[]),o=n.filter(t=>"vector"===t.getSource().type),a=n.filter(t=>"vector"!==t.getSource().type),s=t=>{(!r||r.getSource().maxzoom<t.getSource().maxzoom)&&(r=t)};for(let t of o)s(t);if(!r)for(let t of a)s(t);return r}(this.style,this.transform.zoom);t&&this.drawFunctions.debug(this,t,t.getVisibleCoordinates())}this.options.showPadding&&this.drawFunctions.debugPadding(this),this.context.setDefault()}maybeDrawDepth(){if(!this.style?.map?.terrain)return;let t=this.terrainFacilitator.matrix,i=this.transform.modelViewProjectionMatrix,r=this.terrainFacilitator.depthDirty;r||=!(0,E.bi)(t,i),(r||=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime))&&((0,E.vi)(t,i),this.terrainFacilitator.renderTime=A(),this.terrainFacilitator.depthDirty=!1,this.drawFunctions.terrainDepth(this,this.style.map.terrain))}renderLayer(t,i,r,n,o){if(r.isHidden(this.transform.zoom)||"background"!==r.type&&"custom"!==r.type&&!(n||[]).length)return;this.id=r.id;let a=this.drawFunctions;(0,E.x)(r)?a.symbol(t,i,r,n,this.style.placement.variableOffsets,o):(0,E.Et)(r)?a.circle(t,i,r,n,o):(0,E.St)(r)?a.heatmap(t,i,r,n,o):(0,E.H)(r)?a.line(t,i,r,n,o):(0,E.ft)(r)?a.fill(t,i,r,n,o):(0,E.W)(r)?a.fillExtrusion(t,i,r,n,o):(0,E.bt)(r)?a.hillshade(t,i,r,n,o):(0,E._t)(r)?a.colorRelief(t,i,r,n,o):(0,E.Jt)(r)?a.raster(t,i,r,n,o):(0,E.b)(r)?a.background(t,i,r,n,o):(0,E.v)(r)&&a.custom(t,i,r,o)}static{this.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50}saveTileTexture(i){let r=this._tileTextures[i.size[0]];r?r.length<t.MAX_TEXTURE_POOL_SIZE_PER_BUCKET?r.push(i):i.destroy():this._tileTextures[i.size[0]]=[i]}getTileTexture(t){let i=this._tileTextures[t];return i&&i.length>0?i.pop():null}acquireRTT(t){let i=this.context.gl,r=this._rttObjectRecyclePool.pop();if(r)return r.size!==t&&(r.texture.update({width:t,height:t,data:null},{premultiply:!1,useMipmap:!0}),r.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE,i.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&i.texParameterf(i.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),r.size=t),r;let n=new E.yt(this.context,{width:t,height:t,data:null},i.RGBA,{premultiply:!1,useMipmap:!0});return n.bind(i.LINEAR,i.CLAMP_TO_EDGE,i.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&i.texParameterf(i.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),{texture:n,size:t}}bindRTT(t){let i=this.context.gl,r=t.size;if(!this._rttSharedFbo){let t=this.context.createFramebuffer(r,r,!0,!0),n=this.context.createRenderbuffer(i.DEPTH_STENCIL,r,r);t.depthAttachment.set(n),this._rttSharedFbo={fbo:t,depthRenderbuffer:n,size:r}}this._rttSharedFbo.size!==r&&(this.context.bindRenderbuffer.set(this._rttSharedFbo.depthRenderbuffer),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,r,r),this.context.bindRenderbuffer.set(null),this._rttSharedFbo.fbo.width=r,this._rttSharedFbo.fbo.height=r,this._rttSharedFbo.size=r),this._rttSharedFbo.fbo.colorAttachment.set(t.texture.texture),this.context.bindFramebuffer.set(this._rttSharedFbo.fbo.framebuffer)}releaseRTT(t){this._rttObjectRecyclePool.push(t)}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;let i=this.patternAtlas.getPattern(t.from.toString()),r=this.patternAtlas.getPattern(t.to.toString());return!i||!r}useProgram(t,i,r=!1,n=[]){this.cache||={};let o=!!this.style.map.terrain,a=this.style.projection,s=r?ie.projectionMercator:a.shaderPreludeCode,l=r?ii:a.shaderDefine,c=`/${r?ir:a.shaderVariantName}`,d=t+(i?i.cacheKey:"")+c+(this._showOverdrawInspector?"/overdraw":"")+(o?"/terrain":"")+(n?`/${n.join("/")}`:"");return this.cache[d]||=new ra(this.context,ie[t],i,rI[t],this._showOverdrawInspector,o,s,l,n),this.cache[d]}setCustomLayerDefaults(){this.context.setCustomLayerDefaults()}setBaseState(){let t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;let t=this.context.gl;this.debugOverlayTexture=new E.yt(this.context,this.debugOverlayCanvas,t.RGBA)}}destroy(){if(this._tileTextures){for(let t in this._tileTextures){let i=this._tileTextures[t];if(i)for(let t of i)t.destroy()}this._tileTextures={}}for(let t of this._rttObjectRecyclePool)t.texture.destroy();if(this._rttObjectRecyclePool=[],this._rttSharedFbo){this._rttSharedFbo.fbo.colorAttachment.set(null),this._rttSharedFbo.fbo.depthAttachment.set(null);let t=this.context.gl;t.deleteRenderbuffer(this._rttSharedFbo.depthRenderbuffer),t.deleteFramebuffer(this._rttSharedFbo.fbo.framebuffer),this._rttSharedFbo=null}if(this.layerOpacityFbo?.destroy(),this.layerOpacityFbo=null,this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&this.tileExtentMesh.vertexBuffer?.destroy(),this.tileExtentMesh&&this.tileExtentMesh.indexBuffer?.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.context.projectionUniformBuffer.destroy(),this.context.terrainUniformBuffer.destroy(),this.context.frameUniformBuffer.destroy(),this.cache){for(let t in this.cache){let i=this.cache[t];i?.program&&this.context.gl.deleteProgram(i.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:i}=this.context.gl;return this.width!==t||this.height!==i}},nZ=class extends Error{constructor(t,i){super("WebGL2 is required to display this map. We are sorry, but it seems that your browser does not support WebGL2, a technology for rendering 3D graphics on the web. Read more on https://wiki.openstreetmap.org/wiki/This_map_requires_WebGL"),this.name="GPUInitializationError",this.requestedAttributes=t,this.statusMessage=i?.statusMessage??null}};function nK(t,i){let r=!1,n=null,o,a=()=>{n=null,r&&=(t(...o),n=setTimeout(a,i),!1)};return(...t)=>(r=!0,o=t,n||a(),n)}var nJ=class{constructor(t){this._getHashParams=()=>new URLSearchParams(window.location.hash.replace("#","")),this._getCurrentHash=()=>{let t=this._getHashParams();return this._hashName?(t.get(this._hashName)||"").split("/"):([...t.keys()][0]??"").split("/")},this._onHashChange=()=>{let t=this._getCurrentHash();if(!this._isValidHash(t))return!1;let i=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:i,pitch:+(t[4]||0)}),!0},this._updateHashUnthrottled=()=>{let t=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,t)},this._removeHash=()=>{let t=this._getHashParams();if(this._hashName)t.delete(this._hashName);else{let i=Array.from(t.keys());i.length>0&&t.delete(i[0])}let i=decodeURIComponent(t.toString()).replace(/=&/g,"&").replace(/=$/g,""),r=i?`#${i}`:"",n=window.location.href.replace(/(#.+)?$/,r);n=n.replace("&&","&"),window.history.replaceState(window.history.state,null,n)},this._updateHash=nK(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,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(t){let i=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,n=10**Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.round(i.lng*n)/n,a=Math.round(i.lat*n)/n,s=this._map.getBearing(),l=this._map.getPitch(),c="";if(c+=t?`/${o}/${a}/${r}`:`${r}/${a}/${o}`,(s||l)&&(c+=`/${Math.round(10*s)/10}`),l&&(c+=`/${Math.round(l)}`),this._hashName){let t=this._getHashParams();return t.set(this._hashName,c),`#${decodeURIComponent(t.toString()).replace(/=&/g,"&").replace(/=$/g,"")}`}return`#${c}`}_isValidHash(t){if(t.length<3||t.some(t=>isNaN(+t)))return!1;try{new E.st(+t[2],+t[1])}catch{return!1}let i=+t[0],r=+(t[3]||0),n=+(t[4]||0);return i>=this._map.getMinZoom()&&i<=this._map.getMaxZoom()&&r>=-180&&r<=180&&n>=this._map.getMinPitch()&&n<=this._map.getMaxPitch()}};let nX={linearity:.3,easing:(0,E.Bn)(0,0,.3,1)},nQ=(0,E.tr)({deceleration:2500,maxSpeed:1400},nX),n0=(0,E.tr)({deceleration:20,maxSpeed:1400},nX),n1=(0,E.tr)({deceleration:1e3,maxSpeed:360},nX),n2=(0,E.tr)({deceleration:1e3,maxSpeed:90},nX),n3=(0,E.tr)({deceleration:1e3,maxSpeed:360},nX);var n5=class{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:A(),settings:t})}_drainInertiaBuffer(){let t=this._inertiaBuffer,i=A();for(;t.length>0&&i-t[0].time>160;)t.shift()}_getVelocityEntries(){let t=this._inertiaBuffer,i=A()-60,r=Math.max(0,t.length-2);for(;r>0&&t[r-1].time>=i;)r--;return t.slice(r)}_onMoveEnd(t){this._drainInertiaBuffer();let i=this._getVelocityEntries();if(i.length<2)return void this.clear();let r={zoom:0,bearing:0,pitch:0,roll:0,pan:new E.Ri(0,0),pinchAround:void 0,around:void 0};for(let{settings:t}of i)t.around&&(r.around=t.around),t.pinchAround&&(r.pinchAround=t.pinchAround);for(let{settings:t}of i.slice(1))r.zoom+=t.zoomDelta||0,r.bearing+=t.bearingDelta||0,r.pitch+=t.pitchDelta||0,r.roll+=t.rollDelta||0,t.panDelta&&r.pan._add(t.panDelta);if(!r.pan.mag()&&!r.zoom&&!r.bearing&&!r.pitch&&!r.roll)return void this.clear();let n=A()-i[0].time,o={};if(r.pan.mag()){let i=n6(r.pan.mag(),n,(0,E.tr)({},nQ,t||{})),a=r.pan.mult(i.amount/r.pan.mag()),s=this._map._camera.cameraHelper.handlePanInertia(a,this._map._camera.transform);o.center=s.easingCenter,o.offset=s.easingOffset,n4(o,i)}if(r.zoom){let t=n6(r.zoom,n,n0);o.zoom=(0,E.er)(this._map.getZoom()+t.amount,this._map.getZoomSnap(),t.amount),n4(o,t)}if(r.bearing){let t=n6(r.bearing,n,n1);o.bearing=this._map.getBearing()+(0,E.Vn)(t.amount,-179,179),n4(o,t)}if(r.pitch){let t=n6(r.pitch,n,n2);o.pitch=this._map.getPitch()+t.amount,n4(o,t)}if(r.roll){let t=n6(r.roll,n,n3);o.roll=this._map.getRoll()+(0,E.Vn)(t.amount,-179,179),n4(o,t)}if(o.zoom||o.bearing){let t=void 0===r.pinchAround?r.around:r.pinchAround;o.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),(0,E.tr)(o,{noMoveStart:!0})}};function n4(t,i){(!t.duration||t.duration<i.duration)&&(t.duration=i.duration,t.easing=i.easing)}function n6(t,i,r){let{maxSpeed:n,linearity:o,deceleration:a}=r,s=(0,E.Vn)(t*o/(i/1e3),-n,n),l=Math.abs(s)/(a*o);return{easing:r.easing,duration:1e3*l,amount:l/2*s}}var n8=class{constructor(t,i){this._map=t,this._clickTolerance=i.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new U(this._map,t))}mousedown(t,i){return this._mousedownPos=i,this._firePreventable(new j(t.type,this._map,t))}mouseup(t){this._map.fire(new j(t.type,this._map,t))}click(t,i){this._mousedownPos&&this._mousedownPos.dist(i)>=this._clickTolerance||this._map.fire(new j(t.type,this._map,t))}dblclick(t){return this._firePreventable(new j(t.type,this._map,t))}mouseover(t){this._map.fire(new j(t.type,this._map,t))}mouseout(t){this._map.fire(new j(t.type,this._map,t))}touchstart(t){return this._firePreventable(new N(t.type,this._map,t))}touchmove(t){this._map.fire(new N(t.type,this._map,t))}touchend(t){this._map.fire(new N(t.type,this._map,t))}touchcancel(t){this._map.fire(new N(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},n7=class{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new j(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new j("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new j(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},n9=class{constructor(t,i,r){this._map=t,this._tr=r,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=i.clickTolerance||1,i.boxZoom&&"object"==typeof i.boxZoom&&(this._boxZoomEnd=i.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,i){this.isEnabled()&&t.shiftKey&&0===t.button&&(P.disableDrag(),this._startPos=this._lastPos=i,this._active=!0)}mousemoveWindow(t,i){if(!this._active||this._lastPos.equals(i)||!this._box&&i.dist(this._startPos)<this._clickTolerance)return;let r=this._startPos;this._lastPos=i,this._box||(this._box=P.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));let n=Math.min(r.x,i.x),o=Math.max(r.x,i.x),a=Math.min(r.y,i.y),s=Math.max(r.y,i.y);this._box.style.transform=`translate(${n}px,${a}px)`,this._box.style.width=`${o-n}px`,this._box.style.height=`${s-a}px`}mouseupWindow(t,i){if(!this._active||0!==t.button)return;let r=this._startPos;if(this.reset(),P.suppressClick(),r.x!==i.x||r.y!==i.y)return(this._map.fire(new H("boxzoomend",{originalEvent:t})),this._boxZoomEnd)?void this._boxZoomEnd(this._map,r,i,t):{cameraAnimation:t=>t.fitScreenCoordinates(r,i,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&=(this._box.remove(),null),P.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,i){return this._map.fire(new H(t,{originalEvent:i}))}};function oe(t,i){if(t.length!==i.length)throw Error(`The number of touches and points are not equal - touches ${t.length}, points ${i.length}`);let r={};for(let n=0;n<t.length;n++)r[t[n].identifier]=i[n];return r}var ot=class{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,i,r){(this.centroid||r.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),r.length===this.numTouches&&(this.centroid=function(t){let i=new E.Ri(0,0);for(let r of t)i._add(r);return i.div(t.length)}(i),this.touches=oe(r,i)))}touchmove(t,i,r){if(this.aborted||!this.centroid)return;let n=oe(r,i);for(let t in this.touches){let i=this.touches[t],r=n[t];(!r||r.dist(i)>30)&&(this.aborted=!0)}}touchend(t,i,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){let t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}},oi=class{constructor(t){this.singleTap=new ot(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,i,r){this.singleTap.touchstart(t,i,r)}touchmove(t,i,r){this.singleTap.touchmove(t,i,r)}touchend(t,i,r){let n=this.singleTap.touchend(t,i,r);if(n){let i=t.timeStamp-this.lastTime<500,r=!this.lastTap||30>this.lastTap.dist(n);if(i&&r||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}},or=class{constructor(t,i){this._tr=i,this._zoomIn=new oi({numTouches:1,numTaps:2}),this._zoomOut=new oi({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,i,r){this._zoomIn.touchstart(t,i,r),this._zoomOut.touchstart(t,i,r)}touchmove(t,i,r){this._zoomIn.touchmove(t,i,r),this._zoomOut.touchmove(t,i,r)}touchend(t,i,r){let n=this._zoomIn.touchend(t,i,r),o=this._zoomOut.touchend(t,i,r),a=this._tr;return n?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:i=>i.easeTo({duration:300,zoom:(0,E.er)(a.zoom+1,i.getZoomSnap()),around:a.unproject(n)},{originalEvent:t})}):o?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:i=>i.easeTo({duration:300,zoom:(0,E.er)(a.zoom-1,i.getZoomSnap()),around:a.unproject(o)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},on=class{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){let i=this._moveFunction(...t);if(i.bearingDelta||i.pitchDelta||i.rollDelta||i.around||i.panDelta)return this._active=!0,i}dragStart(t,i){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=Array.isArray(i)?i[0]:i,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,i){if(!this.isEnabled())return;let r=this._lastPoint;if(!r)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);let n=Array.isArray(i)?i[0]:i;if(!(!this._moved&&n.dist(r)<this._clickTolerance))return this._moved=!0,this._lastPoint=n,this._move(r,n)}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&P.suppressClick(),this.reset(t))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}};let oo={0:1,2:2};var oa=class{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){this._eventButton=t.button}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){let i;return i=oo[this._eventButton],void 0!==t.buttons&&(t.buttons&i)===i}isValidEndEvent(t){return t.button===this._eventButton}},os=class{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return 1===t.targetTouches.length}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}},ol=class{constructor(t=new oa({checkCorrectEvent:()=>!0}),i=new os){this.mouseMoveStateManager=t,this.oneFingerTouchMoveStateManager=i}_executeRelevantHandler(t,i,r){return t instanceof MouseEvent?i(t):"u">typeof TouchEvent&&t instanceof TouchEvent?r(t):void 0}startMove(t){this._executeRelevantHandler(t,t=>{this.mouseMoveStateManager.startMove(t)},t=>{this.oneFingerTouchMoveStateManager.startMove(t)})}endMove(t){this._executeRelevantHandler(t,t=>{this.mouseMoveStateManager.endMove(t)},t=>{this.oneFingerTouchMoveStateManager.endMove(t)})}isValidStartEvent(t){return!!this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidStartEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidStartEvent(t))}isValidMoveEvent(t){return!!this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidMoveEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(t))}isValidEndEvent(t){return!!this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidEndEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidEndEvent(t))}};let oc=t=>{t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=t=>{t.preventDefault()}};var od=class{constructor(t,i){this._clickTolerance=t.clickTolerance||1,this._map=i,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new E.Ri(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,i,r){return this._calculateTransform(t,i,r)}touchmove(t,i,r){if(this._active)return this._shouldBePrevented(r.length)?void this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t):(t.preventDefault(),this._calculateTransform(t,i,r))}touchend(t,i,r){this._calculateTransform(t,i,r),this._active&&this._shouldBePrevented(r.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,i,r){r.length>0&&(this._active=!0);let n=oe(r,i),o=new E.Ri(0,0),a=new E.Ri(0,0),s=0;for(let t in n){let i=n[t],r=this._touches[t];r&&(o._add(i),a._add(i.sub(r)),s++,n[t]=i)}if(this._touches=n,this._shouldBePrevented(s)||!a.mag())return;let l=a.div(s);if(this._sum._add(l),!(this._sum.mag()<this._clickTolerance))return{around:o.div(s),panDelta:l}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},ou=class{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,i,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([i[0],i[1]]))}touchmove(t,i,r){if(!this._firstTwoTouches)return;t.preventDefault();let[n,o]=this._firstTwoTouches,a=oh(r,i,n),s=oh(r,i,o);if(!a||!s)return;let l=this._aroundCenter?null:a.add(s).div(2);return this._move([a,s],l,t)}touchend(t,i,r){if(!this._firstTwoTouches)return;let[n,o]=this._firstTwoTouches,a=oh(r,i,n),s=oh(r,i,o);a&&s||(this._active&&P.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}};function oh(t,i,r){for(let n=0;n<t.length;n++)if(t[n].identifier===r)return i[n]}function om(t,i){return Math.log(t/i)/Math.LN2}var of=class extends ou{constructor(){super(),this._zoomRate=1,this._zoomThreshold=.1}setZoomRate(t){this._zoomRate=t??1}setZoomThreshold(t){this._zoomThreshold=t??.1}reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,i){let r=this._distance;if(this._distance=t[0].dist(t[1]),!(!this._active&&Math.abs(om(this._distance,this._startDistance))<this._zoomThreshold))return this._active=!0,{zoomDelta:om(this._distance,r)*this._zoomRate,pinchAround:i}}};function op(t,i){return 180*t.angleWith(i)/Math.PI}var o_=class extends ou{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,i,r){let n=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:op(this._vector,n),pinchAround:i}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());let i=25/(Math.PI*this._minDiameter)*360;return Math.abs(op(t,this._startVector))<i}};function og(t){return Math.abs(t.y)>Math.abs(t.x)}var ob=class extends ou{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,i,r){super.touchstart(t,i,r),this._currentTouchCount=r.length}_start(t){this._lastPoints=t,og(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,i,r){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let n=t[0].sub(this._lastPoints[0]),o=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,o,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:-((n.y+o.y)/2*.5)}}gestureBeginsVertically(t,i,r){if(void 0!==this._valid)return this._valid;let n=t.mag()>=2,o=i.mag()>=2;if(!n&&!o)return;if(!n||!o)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;let a=t.y>0==i.y>0;return og(t)&&og(i)&&a}};let oy=100,ov=15,oF=10;var ox=class{constructor(t,i){this._tr=i,this._panStep=oy,this._bearingStep=ov,this._pitchStep=oF,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let i=0,r=0,n=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:i=1;break;case 189:case 109:case 173:i=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,n=0),{cameraAnimation:s=>{let l=this._tr;s.easeTo({duration:300,easeId:"keyboardHandler",easing:ow,zoom:i?(0,E.er)(l.zoom+i*(t.shiftKey?2:1),s.getZoomSnap()):l.zoom,bearing:l.bearing+r*this._bearingStep,pitch:l.pitch+n*this._pitchStep,offset:[-o*this._panStep,-a*this._panStep],center:l.center},{originalEvent:t})}}}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 ow(t){return t*(2-t)}var oE=class{constructor(t,i,r){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},this._map=t,this._tr=r,this._triggerRenderFrame=i,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let i=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,r=A(),n=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==i&&i%4.000244140625==0?this._type="wheel":0!==i&&4>Math.abs(i)?this._type="trackpad":n>400?(this._type=null,this._lastValue=i,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=200>Math.abs(n*i)?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),t.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=t,this._delta-=i,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._needsRerender=!1,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let i=P.mousePos(this._map.getCanvas(),t),r=this._tr;this._aroundPoint=this._aroundCenter?r.transform.locationToScreenPoint(E.st.convert(r.center)):i,this._needsRerender||(this._needsRerender=!0,this._triggerRenderFrame())}renderFrame(){if(!this._needsRerender||(this._needsRerender=!1,!this.isActive()))return;let t=this._tr.transform;if("number"==typeof this._lastExpectedZoom){let i=t.zoom-this._lastExpectedZoom;"number"==typeof this._startZoom&&(this._startZoom+=i),"number"==typeof this._targetZoom&&(this._targetZoom+=i)}if(0!==this._delta){let i="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,r=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==r&&(r=1/r);let n="number"==typeof this._targetZoom?(0,E.Ir)(this._targetZoom):t.scale,o=t.applyConstrain(t.getCameraLngLat(),(0,E.Or)(n*r)).zoom,a=this._map.getZoomSnap();if("wheel"===this._type&&a>0){let i=(0,E.er)(t.zoom,a);this._targetZoom=(0,E.er)(o,a,o-i)}else this._targetZoom=o;"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let i="number"==typeof this._targetZoom?this._targetZoom:t.zoom,r=this._startZoom,n=this._easing,o=!1,a;if("wheel"===this._type&&r&&n){let t=Math.min((A()-this._lastWheelEventTime+5)/200,1),s=n(t);a=E.dn.number(r,i,s),t<1?this._needsRerender=!0:o=!0}else a=i,o=!0;return this._active=!0,o&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=a,{noInertia:!0,needsRenderFrame:!o,zoomDelta:a-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let i=E.Yn;if(this._prevEase){let t=this._prevEase,r=(A()-t.start)/t.duration,n=t.easing(r+.01)-t.easing(r),o=.27/Math.sqrt(n*n+1e-4)*.01,a=Math.sqrt(.0729-o*o);i=(0,E.Bn)(o,a,.25,1)}return this._prevEase={start:A(),duration:t,easing:i},i}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}},ok=class{constructor(t,i){this._clickZoom=t,this._tapZoom=i}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()}},oM=class{constructor(t,i){this._tr=i,this.reset()}reset(){this._active=!1}dblclick(t,i){return t.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:(0,E.er)(this._tr.zoom+(t.shiftKey?-1:1),r.getZoomSnap()),around:this._tr.unproject(i)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},oD=class{constructor(){this._tap=new oi({numTouches:1,numTaps:1}),this._zoomRate=1,this.reset()}setZoomRate(t){this._zoomRate=t??1}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,i,r){if(!this._swipePoint)if(this._tapTime){let n=i[0],o=t.timeStamp-this._tapTime<500,a=30>this._tapPoint.dist(n);o&&a?r.length>0&&(this._swipePoint=n,this._swipeTouch=r[0].identifier):this.reset()}else this._tap.touchstart(t,i,r)}touchmove(t,i,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;let n=i[0],o=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:o/128*this._zoomRate}}}else this._tap.touchmove(t,i,r)}touchend(t,i,r){if(this._tapTime)this._swipePoint&&0===r.length&&this.reset();else{let n=this._tap.touchend(t,i,r);n&&(this._tapTime=t.timeStamp,this._tapPoint=n)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},oT=class{constructor(t,i,r){this._el=t,this._mousePan=i,this._touchPan=r}enable(t){this._inertiaOptions=t||{},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()}},oA=class{constructor(t,i,r,n){this._pitchWithRotate=t.pitchWithRotate,this._rollEnabled=t.rollEnabled,this._mouseRotate=i,this._mousePitch=r,this._mouseRoll=n}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}},oC=class{constructor(t,i,r,n){this._el=t,this._touchZoom=i,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),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()}setZoomRate(t){this._touchZoom.setZoomRate(t),this._tapDragZoom.setZoomRate(t)}setZoomThreshold(t){this._touchZoom.setZoomThreshold(t)}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}},oS=class{constructor(t,i){this._bypassKey=navigator.userAgent.includes("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=i,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=P.create("div","maplibregl-cooperative-gesture-screen",t);let i=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(i=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let r=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),n=document.createElement("div");n.className="maplibregl-desktop-message",n.textContent=i,this._container.appendChild(n);let o=document.createElement("div");o.className="maplibregl-mobile-message",o.textContent=r,this._container.appendChild(o),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(this._container.remove(),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(t){return t[this._bypassKey]}notifyGestureBlocked(t,i){this._enabled&&(this._map.fire(new R("cooperativegestureprevented",{gestureType:t,originalEvent:i})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}},oL=class{constructor(t){this._camera=t}get transform(){return this._camera._requestedCameraState||this._camera.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(t){return this.transform.screenPointToLocation(E.Ri.convert(t),this._camera.terrain)}};let oP=t=>t.zoom||t.drag||t.roll||t.pitch||t.rotate;var oI=class extends E.vn{};function oR(t){return t.panDelta?.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta||t.rollDelta}var oB=class{get _ownerDocument(){return this._el?.ownerDocument||document}get _ownerWindow(){return this._el?.ownerDocument?.defaultView||window}constructor(t,i,r){this._terrainGestureAnchorElevation=null,this.handleWindowEvent=t=>{this.handleEvent(t,`${t.type}Window`)},this.handleEvent=(t,i)=>{if("blur"===t.type)return void this.stop(!0);this._updatingCamera=!0;let r="renderFrame"===t.type?void 0:t,n={needsRenderFrame:!1},o={},a={};for(let{handlerName:s,handler:l,allowed:c}of this._handlers){let d;if(l.isEnabled()){if(this._blockedByActive(a,c,s))l.reset();else if(l[i||t.type]){if((0,E.ur)(t,i||t.type)){let r=P.mousePos(this._map.getCanvas(),t);d=l[i||t.type](t,r)}else if((0,E.fr)(t,i||t.type)){let r=t.touches,n=this._getMapTouches(r),o=P.touchPos(this._map.getCanvas(),n);d=l[i||t.type](t,o,n)}else(0,E.pr)(i||t.type)||(d=l[i||t.type](t));this.mergeHandlerResult(n,o,d,s,r),d?.needsRenderFrame&&this._triggerRenderFrame()}(d||l.isActive())&&(a[s]=l)}}let s={};for(let t in this._previousActiveHandlers)a[t]||(s[t]=r);this._previousActiveHandlers=a,(Object.keys(s).length||oR(n))&&(this._changes.push([n,o,s]),this._triggerRenderFrame()),(Object.keys(a).length||oR(n))&&this._camera.stop(!0),this._updatingCamera=!1;let{cameraAnimation:l}=n;l&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],l(this._map))},this._map=t,this._camera=i,this._transformProvider=new oL(this._camera),this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new n5(t),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(r);let n=this._el;for(let[t,i,r]of(this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]],this._listeners))t.addEventListener(i,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,r)}destroy(){for(let[t,i,r]of this._listeners)t.removeEventListener(i,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,r)}_addDefaultHandlers(t){let i=this._map,r=i.getCanvasContainer();this._add("mapEvent",new n8(i,t));let n=i.boxZoom=new n9(i,t,this._transformProvider);this._add("boxZoom",n),t.interactive&&t.boxZoom&&n.enable();let o=i.cooperativeGestures=new oS(i,t.cooperativeGestures);this._add("cooperativeGestures",o),t.cooperativeGestures&&o.enable();let a=new or(i,this._transformProvider),s=new oM(i,this._transformProvider);i.doubleClickZoom=new ok(s,a),this._add("tapZoom",a),this._add("clickZoom",s),t.interactive&&t.doubleClickZoom&&i.doubleClickZoom.enable();let l=new oD;this._add("tapDragZoom",l);let c=i.touchPitch=new ob(i);this._add("touchPitch",c),t.interactive&&t.touchPitch&&i.touchPitch.enable(t.touchPitch);let d=()=>i.project(i.getCenter()),u=function({enable:t,clickTolerance:i,aroundCenter:r=!0,minPixelCenterThreshold:n=100,rotateSpeed:o=.8},a){return new on({clickTolerance:i,move:(t,i)=>{let s=a();if(r&&Math.abs(s.y-t.y)>n)return{bearingDelta:(0,E.ar)(new E.Ri(t.x,i.y),i,s)};let l=(i.x-t.x)*o;return r&&i.y<s.y&&(l=-l),{bearingDelta:l}},moveStateManager:new oa({checkCorrectEvent:t=>0===t.button&&t.ctrlKey||2===t.button&&!t.ctrlKey}),enable:t,assignEvents:oc})}(t,d),h=function({enable:t,clickTolerance:i,pitchSpeed:r=-.5}){return new on({clickTolerance:i,move:(t,i)=>({pitchDelta:(i.y-t.y)*r}),moveStateManager:new oa({checkCorrectEvent:t=>0===t.button&&t.ctrlKey||2===t.button}),enable:t,assignEvents:oc})}(t),m=function({enable:t,clickTolerance:i,rollDegreesPerPixelMoved:r=.3},n){return new on({clickTolerance:i,move:(t,i)=>{let o=n(),a=(i.x-t.x)*r;return i.y<o.y&&(a=-a),{rollDelta:a}},moveStateManager:new oa({checkCorrectEvent:t=>2===t.button&&t.ctrlKey}),enable:t,assignEvents:oc})}(t,d);i.dragRotate=new oA(t,u,h,m),this._add("mouseRotate",u,["mousePitch"]),this._add("mousePitch",h,["mouseRotate","mouseRoll"]),this._add("mouseRoll",m,["mousePitch"]),t.interactive&&t.dragRotate&&i.dragRotate.enable();let f=function({enable:t,clickTolerance:i}){return new on({clickTolerance:i,move:(t,i)=>({around:i,panDelta:i.sub(t)}),activateOnStart:!0,moveStateManager:new oa({checkCorrectEvent:t=>0===t.button&&!t.ctrlKey}),enable:t,assignEvents:oc})}(t),p=new od(t,i);i.dragPan=new oT(r,f,p),this._add("mousePan",f),this._add("touchPan",p,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&i.dragPan.enable(t.dragPan);let _=new o_,g=new of;i.touchZoomRotate=new oC(r,g,_,l),this._add("touchRotate",_,["touchPan","touchZoom"]),this._add("touchZoom",g,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&i.touchZoomRotate.enable(t.touchZoomRotate),this._add("blockableMapEvent",new n7(i));let b=i.scrollZoom=new oE(i,()=>this._triggerRenderFrame(),this._transformProvider);this._add("scrollZoom",b,["mousePan"]),t.interactive&&t.scrollZoom&&i.scrollZoom.enable(t.scrollZoom);let y=i.keyboard=new ox(i,this._transformProvider);this._add("keyboard",y),t.interactive&&t.keyboard&&i.keyboard.enable()}_add(t,i,r){this._handlers.push({handlerName:t,handler:i,allowed:r}),this._handlersById[t]=i}stop(t){if(!this._updatingCamera){for(let{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(let{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!oP(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,i,r){for(let n in t)if(n!==r&&!i?.includes(n))return!0;return!1}_getMapTouches(t){let i=[];for(let r of t){let t=r.target;this._el.contains(t)&&i.push(r)}return i}mergeHandlerResult(t,i,r,n,o){if(!r)return;(0,E.tr)(t,r);let a={handlerName:n,originalEvent:r.originalEvent||o};void 0!==r.zoomDelta&&(i.zoom=a),void 0!==r.panDelta&&(i.drag=a),void 0!==r.rollDelta&&(i.roll=a),void 0!==r.pitchDelta&&(i.pitch=a),void 0!==r.bearingDelta&&(i.rotate=a)}_applyChanges(){let t={},i={},r={};for(let[n,o,a]of this._changes)n.panDelta&&(t.panDelta=(t.panDelta||new E.Ri(0,0))._add(n.panDelta)),n.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+n.zoomDelta),n.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+n.bearingDelta),n.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+n.pitchDelta),n.rollDelta&&(t.rollDelta=(t.rollDelta||0)+n.rollDelta),void 0!==n.around&&(t.around=n.around),void 0!==n.pinchAround&&(t.pinchAround=n.pinchAround),n.noInertia&&(t.noInertia=n.noInertia),(0,E.tr)(i,o),(0,E.tr)(r,a);this._updateMapTransform(t,i,r),this._changes=[]}_updateMapTransform(t,i,r){let n=this._map,o=this._camera.getTransformForUpdate(),a=n.terrain;if(!oR(t)&&!(a&&this._terrainMovement))return void this._fireEvents(i,r,!0);this._camera.stop(!0);let{panDelta:s,zoomDelta:l,bearingDelta:c,pitchDelta:d,rollDelta:u}=t,{around:h,aroundOnSurface:m}=this._resolveAround(t,a,o),f=a?this._terrainGestureElevation(a,h,m,o,i):void 0,p={panDelta:s,zoomDelta:l,rollDelta:u,pitchDelta:d,bearingDelta:c,around:h,aroundElevation:f};this._camera.cameraHelper.useGlobeControls&&!o.isPointOnMapSurface(h)&&(h=o.centerPoint);let _=this._computePreZoomAroundLoc(o,h,s,f);this._handleMapControls({terrain:a,tr:o,deltasForHelper:p,preZoomAroundLoc:_,combinedEventsInProgress:i,panDelta:s}),this._camera.applyUpdatedTransform(o),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(i,r,!0)}_resolveAround(t,i,r){let n=void 0===t.pinchAround?t.around:t.pinchAround;return n||=this._camera.transform.centerPoint,i&&!r.isPointOnMapSurface(n)?{around:r.centerPoint,aroundOnSurface:!1}:{around:n,aroundOnSurface:!0}}_terrainGestureElevation(t,i,r,n,o){if(!r)return;if(!this._terrainMovement&&(o.drag||o.zoom)){let r=n.screenTerrainPointToMercatorCoordinate(i,t);this._terrainGestureAnchorElevation=r?r.z:null}if(null===this._terrainGestureAnchorElevation)return;let a=this._terrainGestureAnchorElevation;if(!(.01>i.distSqr(n.centerPoint))&&!(a-n.elevation>=.9*(n.getCameraAltitude()-n.elevation)))return a}_computePreZoomAroundLoc(t,i,r,n){if(.01>i.distSqr(t.centerPoint))return t.center;let o=r?i.sub(r):i;return void 0===n?t.screenPointToLocation(o):t.screenPointToLocationAtElevation(o,n)}_handleMapControls({terrain:t,tr:i,deltasForHelper:r,preZoomAroundLoc:n,combinedEventsInProgress:o,panDelta:a}){let s=this._camera.cameraHelper;if(s.handleMapControlsRollPitchBearingZoom(r,i),!t)return void s.handleMapControlsPan(r,i,n);if(s.useGlobeControls){!this._terrainMovement&&(o.drag||o.zoom)&&(this._terrainMovement=!0,this._camera.elevationFreeze=!0),s.handleMapControlsPan(r,i,n);return}if(!this._terrainMovement&&(o.drag||o.zoom)){this._terrainMovement=!0,this._camera.elevationFreeze=!0,s.handleMapControlsPan(r,i,n);return}void 0===r.aroundElevation&&o.drag&&this._terrainMovement&&a?i.setCenter(i.screenPointToLocation(i.centerPoint.sub(a))):s.handleMapControlsPan(r,i,n)}_fireEvents(t,i,r){let n=oP(this._eventsInProgress),o=oP(t),a={};for(let i in t){let{originalEvent:r}=t[i];this._eventsInProgress[i]||(a[`${i}start`]=r),this._eventsInProgress[i]=t[i]}for(let t in!n&&o&&this._fireEvent("movestart",o.originalEvent),a)this._fireEvent(t,a[t]);for(let i in o&&this._fireEvent("move",o.originalEvent),t){let{originalEvent:r}=t[i];this._fireEvent(i,r)}let s={},l;for(let t in this._eventsInProgress){let{handlerName:r,originalEvent:n}=this._eventsInProgress[t];this._handlersById[r].isActive()||(delete this._eventsInProgress[t],l=i[r]||n,s[`${t}end`]=l)}for(let t in s)this._fireEvent(t,s[t]);let c=oP(this._eventsInProgress),d=(n||o)&&!c;if(d&&this._terrainMovement){this._camera.elevationFreeze=!1,this._terrainMovement=!1,this._terrainGestureAnchorElevation=null;let t=this._camera.getTransformForUpdate();this._map.getCenterClampedToGround()&&t.recalculateZoomAndCenter(this._map.terrain),this._camera.applyUpdatedTransform(t)}if(r&&d){this._updatingCamera=!0;let t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=t=>0!==t&&-this._bearingSnap<t&&t<this._bearingSnap;t&&(t.essential||!D.prefersReducedMotion)?(i(t.bearing||this._map.getBearing())&&(t.bearing=0),t.freezeElevation=!0,this._map.easeTo(t,{originalEvent:l})):(this._map.fire(new B("moveend",{originalEvent:l})),i(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(t,i){this._map.fire(new B(t,i?{originalEvent:i}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(t=>{delete this._frameId,this.handleEvent(new oI("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}},oO=class extends E.yn{constructor(t){super(),this._renderFrameCallback=()=>{let t=Math.min((A()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this.transform=new iv,this.cameraHelper=new iM,void 0!==t.minZoom&&this.transform.setMinZoom(t.minZoom),void 0!==t.maxZoom&&this.transform.setMaxZoom(t.maxZoom),void 0!==t.minPitch&&this.transform.setMinPitch(t.minPitch),void 0!==t.maxPitch&&this.transform.setMaxPitch(t.maxPitch),void 0!==t.renderWorldCopies&&this.transform.setRenderWorldCopies(t.renderWorldCopies),null!==t.transformConstrain&&this.transform.setConstrainOverride(t.transformConstrain),this._moving=!1,this._zooming=!1,this._bearingSnap=t.bearingSnap,this._zoomSnap=t.zoomSnap,this._requestRenderFrame=t.requestRenderFrame,this._cancelRenderFrame=t.cancelRenderFrame,this.terrain=t.terrain,this._centerClampedToGround=t.centerClampedToGround??!0,this.transformCameraUpdate=t.transformCameraUpdate??null,this._stopHandlers=t.stopHandlers??(()=>{}),this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(t,i){t.apply(this.transform,!0),this.transform=t,this.cameraHelper=i}getCenter(){return new E.st(this.transform.center.lng,this.transform.center.lat)}setCenter(t,i){return this.jumpTo({center:t},i)}getCenterElevation(){return this.transform.elevation}setCenterElevation(t,i){return this.jumpTo({elevation:t},i),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(t){this._centerClampedToGround=t}panBy(t,i,r){return t=E.Ri.convert(t).mult(-1),this.panTo(this.transform.center,(0,E.tr)({offset:t},i),r)}panTo(t,i,r){return this.easeTo((0,E.tr)({center:t},i),r)}getZoom(){return this.transform.zoom}setZoom(t,i){return this.jumpTo({zoom:t},i),this}zoomTo(t,i,r){return this.easeTo((0,E.tr)({zoom:t},i),r)}zoomIn(t,i){return this.zoomTo((0,E.er)(this.getZoom()+1,this._zoomSnap),t,i),this}zoomOut(t,i){return this.zoomTo((0,E.er)(this.getZoom()-1,this._zoomSnap),t,i),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(t,i){return t!=this.transform.fov&&(this.transform.setFov(t),this.fire(new B("movestart",i)).fire(new B("move",i)).fire(new B("moveend",i))),this}getBearing(){return this.transform.bearing}setZoomSnap(t){return this._zoomSnap=t,this}getZoomSnap(){return this._zoomSnap}setBearing(t,i){return this.jumpTo({bearing:t},i),this}getPadding(){return this.transform.padding}setPadding(t,i){return this.jumpTo({padding:t},i),this}rotateTo(t,i,r){return this.easeTo((0,E.tr)({bearing:t},i),r)}resetNorth(t,i){return this.rotateTo(0,(0,E.tr)({duration:1e3},t),i),this}resetNorthPitch(t,i){return this.easeTo((0,E.tr)({bearing:0,pitch:0,roll:0,duration:1e3},t),i),this}snapToNorth(t,i){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,i):this}getPitch(){return this.transform.pitch}setPitch(t,i){return this.jumpTo({pitch:t},i),this}getRoll(){return this.transform.roll}setRoll(t,i){return this.jumpTo({roll:t},i),this}cameraForBounds(t,i){t=eB.convert(t).adjustAntiMeridian();let r=i?.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),r,i)}_cameraForBoxAndBearing(t,i,r,n){let o={top:0,bottom:0,right:0,left:0};if("number"==typeof(n=(0,E.tr)({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},n)).padding){let t=n.padding;n.padding={top:t,bottom:t,right:t,left:t}}let a=(0,E.tr)(o,n.padding);n.padding=a;let s=this.transform,l=new eB(t,i),c=this.cameraHelper.cameraForBoxAndBearing(n,a,l,r,s);return c&&this._zoomSnap&&(c.zoom=(0,E.er)(c.zoom,this._zoomSnap,-1)),c}fitBounds(t,i,r){return this._fitInternal(this.cameraForBounds(t,i),i,r)}fitScreenCoordinates(t,i,r,n,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(E.Ri.convert(t)),this.transform.screenPointToLocation(E.Ri.convert(i)),r,n),n,o)}_fitInternal(t,i,r){return t?(i=(0,E.tr)(t,i),delete i.padding,i.linear?this.easeTo(i,r):this.flyTo(i,r)):this}jumpTo(t,i){this.stop(),"zoom"in t&&this._zoomSnap&&(t.zoom=(0,E.er)(t.zoom,this._zoomSnap));let r=this.getTransformForUpdate(),n=!1,o=!1,a=!1,s=r.zoom;this.terrain&&r.setElevation(this.terrain.getElevationForLngLat(t.center?E.st.convert(t.center):r.center,r)),this.cameraHelper.handleJumpToCenterZoom(r,t);let l=r.zoom!==s;return"elevation"in t&&r.elevation!==+t.elevation&&r.setElevation(+t.elevation),"bearing"in t&&r.bearing!==+t.bearing&&(n=!0,r.setBearing(+t.bearing)),"pitch"in t&&r.pitch!==+t.pitch&&(o=!0,r.setPitch(+t.pitch)),"roll"in t&&r.roll!==+t.roll&&(a=!0,r.setRoll(+t.roll)),null==t.padding||r.isPaddingEqual(t.padding)||r.setPadding(t.padding),this.applyUpdatedTransform(r),this.fire(new B("movestart",i)).fire(new B("move",i)),l&&this.fire(new B("zoomstart",i)).fire(new B("zoom",i)).fire(new B("zoomend",i)),n&&this.fire(new B("rotatestart",i)).fire(new B("rotate",i)).fire(new B("rotateend",i)),o&&this.fire(new B("pitchstart",i)).fire(new B("pitch",i)).fire(new B("pitchend",i)),a&&this.fire(new B("rollstart",i)).fire(new B("roll",i)).fire(new B("rollend",i)),this.fire(new B("moveend",i))}calculateCameraOptionsFromCameraLngLatAltRotation(t,i,r,n,o){let a=this.transform.calculateCenterFromCameraLngLatAlt(t,i,r,n);return{center:a.center,elevation:a.elevation,zoom:a.zoom,bearing:r,pitch:n,roll:o}}easeTo(t,i){this._stop(!1,t.easeId),"zoom"in(t=(0,E.tr)({offset:[0,0],duration:500,easing:E.Yn},t))&&this._zoomSnap&&(t.zoom=(0,E.er)(t.zoom,this._zoomSnap)),(!1===t.animate||!t.essential&&D.prefersReducedMotion)&&(t.duration=0);let r=this.getTransformForUpdate(),n=this.getBearing(),o=r.pitch,a=r.roll,s="bearing"in t?this._normalizeBearing(t.bearing,n):n,l="pitch"in t?+t.pitch:o,c="roll"in t?this._normalizeBearing(t.roll,a):a,d="padding"in t?t.padding:r.padding,u=E.Ri.convert(t.offset),h,m;t.around&&(h=E.st.convert(t.around),m=r.locationToScreenPoint(h));let f={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},p=this.cameraHelper.handleEaseTo(r,{bearing:s,pitch:l,roll:c,padding:d,around:h,aroundPoint:m,offsetAsPoint:u,offset:t.offset,zoom:t.zoom,center:t.center});return this._rotating||=n!==s,this._pitching||=l!==o,this._rolling||=c!==a,this._padding=!r.isPaddingEqual(d),this._zooming||=p.isZooming,this._easeId=t.easeId,this._prepareEase(i,t.noMoveStart,f),this.terrain&&this._prepareElevation(p.elevationCenter),this._ease(n=>{p.easeFunc(n),this.terrain&&!t.freezeElevation&&this._updateElevation(n),this.applyUpdatedTransform(r),this._fireMoveEvents(i)},r=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(i,r)},t),this}_prepareEase(t,i,r={}){this._moving=!0,i||r.moving||this.fire(new B("movestart",t)),this._zooming&&!r.zooming&&this.fire(new B("zoomstart",t)),this._rotating&&!r.rotating&&this.fire(new B("rotatestart",t)),this._pitching&&!r.pitching&&this.fire(new B("pitchstart",t)),this._rolling&&!r.rolling&&this.fire(new B("rollstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLat(t,this.transform),this.elevationFreeze=!0}_updateElevation(t){(void 0===this._elevationStart||void 0===this._elevationCenter)&&this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));let i=this.terrain.getElevationForLngLat(this._elevationCenter,this.transform);if(t<1&&i!==this._elevationTarget){let r=this._elevationTarget-this._elevationStart,n=(i-(r*t+this._elevationStart))/(1-t);this._elevationStart+=t*(r-n),this._elevationTarget=i}this.transform.setElevation(E.dn.number(this._elevationStart,this._elevationTarget,t))}_finalizeElevation(){this.elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||=this.transform.clone(),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(t){if(!this.terrain&&t.elevation>=0&&t.pitch<=90)return{};let i=t.getCameraLngLat(),r=t.getCameraAltitude(),n=this.terrain?this.terrain.getElevationForLngLatZoom(i,t.zoom):0;if(r<n){let r=t.calculateCameraOptionsFromTo(i,n,t.center,t.elevation);return{pitch:r.pitch,zoom:r.zoom}}return{}}applyUpdatedTransform(t){let i=[];if(i.push(t=>this._elevateCameraIfInsideTerrain(t)),this.transformCameraUpdate&&i.push(t=>this.transformCameraUpdate(t)),!i.length)return;let r=t.clone();for(let t of i){let i=r.clone(),{center:n,zoom:o,roll:a,pitch:s,bearing:l,elevation:c}=t(i);n&&i.setCenter(n),void 0!==c&&i.setElevation(c),void 0!==o&&i.setZoom(o),void 0!==a&&i.setRoll(a),void 0!==s&&i.setPitch(s),void 0!==l&&i.setBearing(l),r.apply(i,!1)}this.transform.apply(r,!1)}_fireMoveEvents(t){this.fire(new B("move",t)),this._zooming&&this.fire(new B("zoom",t)),this._rotating&&this.fire(new B("rotate",t)),this._pitching&&this.fire(new B("pitch",t)),this._rolling&&this.fire(new B("roll",t))}_afterEase(t,i){if(this._easeId&&i&&this._easeId===i)return;delete this._easeId;let r=this._zooming,n=this._rotating,o=this._pitching,a=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,r&&this.fire(new B("zoomend",t)),n&&this.fire(new B("rotateend",t)),o&&this.fire(new B("pitchend",t)),a&&this.fire(new B("rollend",t)),this.fire(new B("moveend",t))}flyTo(t,i){if(!t.essential&&D.prefersReducedMotion){let r=(0,E.br)(t,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(r,i)}this.stop(),"zoom"in(t=(0,E.tr)({offset:[0,0],speed:1.2,curve:1.42,easing:E.Yn},t))&&this._zoomSnap&&(t.zoom=(0,E.er)(t.zoom,this._zoomSnap));let r=this.getTransformForUpdate(),n=r.bearing,o=r.pitch,a=r.roll,s=r.padding,l="bearing"in t?this._normalizeBearing(t.bearing,n):n,c="pitch"in t?+t.pitch:o,d="roll"in t?this._normalizeBearing(t.roll,a):a,u="padding"in t?t.padding:r.padding,h=E.Ri.convert(t.offset),m=r.centerPoint.add(h),f=r.screenPointToLocation(m),p=this.cameraHelper.handleFlyTo(r,{bearing:l,pitch:c,roll:d,padding:u,locationAtOffset:f,offsetAsPoint:h,center:t.center,minZoom:t.minZoom,zoom:t.zoom}),_=t.curve,g=Math.max(r.width,r.height),b=g/p.scaleOfZoom,y=p.pixelPathLength,v=g/p.scaleOfMinZoom,F=(_=Math.min(_,Math.sqrt(v/y*2)))*_;function x(t){let i=(b*b-g*g+(t?-1:1)*F*F*y*y)/(2*(t?b:g)*F*y);return Math.log(Math.sqrt(i*i+1)-i)}function w(t){return(Math.exp(t)-Math.exp(-t))/2}function k(t){return(Math.exp(t)+Math.exp(-t))/2}let M=x(!1),T=function(t){return k(M)/k(M+_*t)},A=function(t){var i;return g*((k(M)*(w(i=M+_*t)/k(i))-w(M))/F)/y},C=(x(!0)-M)/_;if(2e-6>Math.abs(y)||!isFinite(C)){if(1e-6>Math.abs(g-b))return this.easeTo(t,i);let r=b<g?-1:1;C=Math.abs(Math.log(b/g))/_,A=()=>0,T=t=>Math.exp(r*_*t)}if("duration"in t)t.duration=+t.duration;else{let i="screenSpeed"in t?t.screenSpeed/_:+t.speed;t.duration=1e3*C/i}return t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=n!==l,this._pitching=c!==o,this._rolling=d!==a,this._padding=!r.isPaddingEqual(u),this._prepareEase(i,!1),this.terrain&&this._prepareElevation(p.targetCenter),this._ease(f=>{let _=f*C,g=1/T(_),b=A(_);this._rotating&&r.setBearing(E.dn.number(n,l,f)),this._pitching&&r.setPitch(E.dn.number(o,c,f)),this._rolling&&r.setRoll(E.dn.number(a,d,f)),this._padding&&(r.interpolatePadding(s,u,f),m=r.centerPoint.add(h)),p.easeFunc(f,g,b,m),this.terrain&&!t.freezeElevation&&this._updateElevation(f),this.applyUpdatedTransform(r),this._fireMoveEvents(i)},()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(i)},t),this}isEasing(){return!!this._easeFrameId}stop(t){return this._stop(t)}_stop(t,i){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,i)}return t||this._stopHandlers(),this}_ease(t,i,r){!1===r.animate||0===r.duration?(t(1),i()):(this._easeStart=A(),this._easeOptions=r,this._onEaseFrame=t,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,i){let r=Math.abs((t=(0,E.Fr)(t,-180,180))-i);return Math.abs(t-360-i)<r&&(t-=360),Math.abs(t+360-i)<r&&(t+=360),t}isMoving(){return this._moving}isZooming(){return this._zooming}isRotating(){return this._rotating}};let oz={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};var oY=class{constructor(t=oz){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=t=>{t&&("terrain"===t.type||"style"===t.dataType||"source"===t.dataType&&("metadata"===t.sourceDataType||"visibility"===t.sourceDataType))&&this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?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=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=P.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=P.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=P.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(){this._container.remove(),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(t,i){let r=this._map._getUIString(`AttributionControl.${i}`);t.title=r,t.setAttribute("aria-label",r)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(t=>"string"==typeof t?t:"")):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){let t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}let i=this._map.style.tileManagers;for(let r in i){let n=i[r];if(n.used||n.usedForTerrain){let i=n.getSource();i.attribution&&!t.includes(i.attribution)&&t.push(i.attribution)}}(t=t.filter(t=>String(t).trim())).sort((t,i)=>t.length-i.length);let r=(t=t.filter((i,r)=>{for(let n=r+1;n<t.length;n++)if(t[n].includes(i))return!1;return!0})).join(" | ");r!==this._attribHTML&&(this._attribHTML=r,t.length?(this._innerContainer.innerHTML=P.sanitize(r),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}},oj=class{constructor(t={}){this._updateCompact=()=>{let t=this._container.children;if(t.length){let i=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&i.classList.add("maplibregl-compact"):i.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options?.compact,this._container=P.create("div","maplibregl-ctrl");let i=P.create("a","maplibregl-ctrl-logo");return i.target="_blank",i.rel="noopener nofollow",i.href="https://maplibre.org/",i.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),i.setAttribute("rel","noopener nofollow"),this._container.appendChild(i),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}},oN=class{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){let i=++this._id;return this._queue.push({callback:t,id:i,cancelled:!1}),i}remove(t){let i=this._currentlyRunning;for(let r of i?this._queue.concat(i):this._queue)if(r.id===t){r.cancelled=!0;return}}run(t=0){if(this._currentlyRunning)throw Error("Attempting to run(), but is already running.");let i=this._currentlyRunning=this._queue;this._queue=[];let r=!1,n;for(let o of i)if(!o.cancelled){try{o.callback(t)}catch(t){r||(r=!0,n=t)}if(this._cleared)break}if(this._cleared=!1,this._currentlyRunning=!1,r)throw n}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}},oU=class{constructor(t,i,r){this._tileKeys=t.map(t=>t.key).sort().join(),this._revision=i,this._zoom=r}equals(t){return this.equalsIgnoringZoom(t)&&this._zoom===t._zoom}equalsIgnoringZoom(t){return void 0!==t&&this._tileKeys===t._tileKeys&&this._revision===t._revision}};let oH={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};var oV=class{constructor(t,i){this.needsFollowUpFrame=!1,this.painter=t,this.terrain=i,this.rttSize=i.tileManager.tileSize*i.qualityFactor}getTexture(t){return t.getRTT(this._stacks.length-1).texture}prepareForRender(t,i){let r=i!==this._lastPrepareZoom;this._lastPrepareZoom=i,this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=t._order.filter(r=>!t._layers[r].isHidden(i));let n=new Set;for(let i of this._renderableLayerIds){let r=t._layers[i],o=r.source;o&&oH[r.type]&&n.add(o)}for(let r of(this._coordsAscending={},this._rttFingerprints={},n)){let n=t.tileManagers[r];if(!n)continue;this._coordsAscending[r]={};let o=this._coordsAscending[r],a=n.getSource(),s=a instanceof eX?a.terrainTileRanges:null;for(let t of n.getVisibleCoordinates()){let i=this.terrain.tileManager.getTerrainCoords(t,s);for(let t in i)o[t]||=[],o[t].push(i[t])}this._rttFingerprints[r]={};let l=this._rttFingerprints[r],c=n.getState().revision;for(let t in o)l[t]=new oU(o[t],c,i)}for(let t of(this.needsFollowUpFrame=!1,this._renderableTiles))for(let i in this._rttFingerprints){let n=this._rttFingerprints[i][t.tileID.key],o=t.rttFingerprint[i];n&&!n.equals(o)&&(r&&n.equalsIgnoringZoom(o)?this.needsFollowUpFrame=!0:t.releaseRTT(this.painter))}}renderLayer(t,i){if(t.isHidden(this.painter.transform.zoom))return!1;let r={...i,isRenderingToTexture:!0},n=t.type,o=this.painter,a=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(oH[n]&&(this._prevType&&oH[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(t.id),!a))return!0;if(oH[this._prevType]||oH[n]&&a){this._prevType=n;let t=this._stacks.length-1,i=this._stacks[t]||[];for(let n of this._renderableTiles){if(this._rttTiles.push(n),n.getRTT(t))continue;let a=n.acquireRTT(o,t,this.rttSize);for(let t of(o.bindRTT(a),o.context.clear({color:E.pn.transparent,stencil:0}),o.currentStencilSource=void 0,i)){let i=o.style._layers[t],a=i.source?this._coordsAscending[i.source][n.tileID.key]:[n.tileID];o.context.viewport.set([0,0,this.rttSize,this.rttSize]),o.renderTileClippingMasks(i,a,!0),o.renderLayer(o,o.style.tileManagers[i.source],i,a,r),i.source&&(n.rttFingerprint[i.source]=this._rttFingerprints[i.source][n.tileID.key])}a.texture.generateMipmap()}return function(t,i,r,n){let{isRenderingGlobe:o}=n,a=t.context,s=a.gl,l=t.transform,c=t.colorModeForRenderPass(),d=t.getDepthModeFor3D(),u=t.useProgram("terrain");for(let n of(a.bindFramebuffer.set(null),a.viewport.set([0,0,t.width,t.height]),r)){let r=i.getTerrainMesh(n.tileID),h=t.renderToTexture.getTexture(n),m=i.getTerrainData(n.tileID);a.activeTexture.set(s.TEXTURE0),h.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_LINEAR);let f=i4(i.getSkirtLength(l.zoom),l.calculateFogMatrix(n.tileID.toUnwrapped()),t.style.sky,l.pitch,o),p=l.getProjectionData({overscaledTileID:n.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});u.draw(a,s.TRIANGLES,d,n_.disabled,c,ng.backCCW,f,m,p,"terrain",r.vertexBuffer,r.indexBuffer,r.segments)}}(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],oH[n]}return!1}};let o$={"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":"Drag to rotate map, click to reset 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","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","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"},oq={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:oz,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 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],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:E.jn.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,rotateSpeed:.8,pitchSpeed:-.5,reduceMotion:void 0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,terrainSkirtLength:"auto",zoomLevelsToOverscale:4,anisotropicFilterPitch:20};var oG=class extends E.yn{get _ownerWindow(){return this._container?.ownerDocument?.defaultView||window}constructor(t){super(),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new oN,this._controls=[],this._mapId=(0,E.Nr)(),this._styleUrl=null,this._missingStyleImageResolver=null,this._lostContextStyle={style:null,images:null},this._contextLost=t=>{if(t.preventDefault(),this._frameRequest&&=(this._frameRequest.abort(),null),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),!this.style)return void this.fire(new q("webglcontextlost",{originalEvent:t}));for(let t of Object.values(this.style._layers))if("custom"===t.type&&console.warn(`Custom layer with id '${t.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),t._listeners)for(let[i]of Object.entries(t._listeners))console.warn(`Custom layer with id '${t.id}' had event listeners for event '${i}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.destroy(),this.style=null,this.fire(new q("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{if(this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&this.style)for(let t in this.style.imageManager.images=this._lostContextStyle.images,this._lostContextStyle.images){let i=this._lostContextStyle.images[t];i.isWebGLImage&&this.style.imageManager.updateImage(t,i,!1)}this._lostContextStyle={style:null,images:null};try{this._setupPainter()}catch(t){this.fire(new E._n(t));return}this.resize(),this._update(),this._resizeInternal(),this.fire(new q("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()};let i={...oq,...t,canvasContextAttributes:{...oq.canvasContextAttributes,...t.canvasContextAttributes}};if(null!=i.minZoom&&null!=i.maxZoom&&i.minZoom>i.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(null!=i.minPitch&&null!=i.maxPitch&&i.minPitch>i.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(null!=i.minPitch&&i.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(null!=i.maxPitch&&i.maxPitch>180)throw Error("maxPitch must be less than or equal to 180");this._camera=new oO({minZoom:i.minZoom,maxZoom:i.maxZoom,minPitch:i.minPitch,maxPitch:i.maxPitch,bearingSnap:i.bearingSnap,zoomSnap:i.zoomSnap,renderWorldCopies:i.renderWorldCopies,centerClampedToGround:i.centerClampedToGround,terrain:this.terrain,transformConstrain:i.transformConstrain,requestRenderFrame:t=>this._requestRenderFrame(t),cancelRenderFrame:t=>this._cancelRenderFrame(t),transformCameraUpdate:i.transformCameraUpdate,stopHandlers:()=>this._handlers?.stop(!1)}),this._camera.setEventedParent(this),this._interactive=i.interactive,this._maxTileCacheSize=i.maxTileCacheSize,this._maxTileCacheZoomLevels=i.maxTileCacheZoomLevels,this._canvasContextAttributes={...i.canvasContextAttributes},this._trackResize=!0===i.trackResize,this._terrainSkirtLength=i.terrainSkirtLength,this._refreshExpiredTiles=!0===i.refreshExpiredTiles,this._fadeDuration=i.fadeDuration,this._crossSourceCollisions=!0===i.crossSourceCollisions,this._collectResourceTiming=!0===i.collectResourceTiming,this._locale={...o$,...i.locale},this._clickTolerance=i.clickTolerance,this._overridePixelRatio=i.pixelRatio,this._maxCanvasSize=i.maxCanvasSize,this._zoomLevelsToOverscale=i.zoomLevelsToOverscale,this.cancelPendingTileRequestsWhileZooming=!0===i.cancelPendingTileRequestsWhileZooming,this.setAnisotropicFilterPitch(i.anisotropicFilterPitch),void 0!==i.reduceMotion&&(D.prefersReducedMotion=i.reduceMotion),this._requestManager=new I(i.transformRequest),this._container=this._resolveContainer(i.container),i.maxBounds&&this.setMaxBounds(i.maxBounds),this._setupContainer();try{this._setupPainter()}catch(t){throw this._cleanupContainer(),t}this._imageQueueHandle=s.addThrottleControl(()=>this.isMoving()),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.depthDirty=!0,this._update(!0)}),this.once("idle",()=>this._idleTriggered=!0),this._handlers=new oB(this,this._camera,i),"u">typeof window&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver());let r="string"==typeof i.hash&&i.hash||void 0;this._hash=i.hash?new nJ(r).addTo(this):void 0,this._hash?._onHashChange()||(this.jumpTo({center:i.center,elevation:i.elevation,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch,roll:i.roll}),i.bounds&&(this.resize(),this.fitBounds(i.bounds,(0,E.tr)({},i.fitBoundsOptions,{duration:0}))));let n="string"==typeof i.style||i.style?.projection?.type!=="globe";this.resize(null,n),this._localIdeographFontFamily=i.localIdeographFontFamily,this._validateStyle=i.validateStyle,i.style&&this.setStyle(i.style,{localIdeographFontFamily:i.localIdeographFontFamily}),i.attributionControl&&this.addControl(new oY("boolean"==typeof i.attributionControl?void 0:i.attributionControl)),i.maplibreLogo&&this.addControl(new oj,i.logoPosition),this.on("style.load",()=>{if(n||this._resizeTransform(),this._camera.transform.unmodified){let t=(0,E.br)(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(t)}}),this.on("data",t=>{this._update("style"===t.dataType),this.fire("style"===t.dataType?new z("styledata",t):new Y("sourcedata",t))}),this.on("dataloading",t=>{this.fire("style"===t.dataType?new z("styledataloading",t):new Y("sourcedataloading",t))}),this.on("dataabort",t=>{this.fire(new Y("sourcedataabort",t))})}_getMapId(){return this._mapId}setGlobalStateProperty(t,i){return this.style.setGlobalStateProperty(t,i),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(t,i){if(void 0===i&&(i=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t?.onAdd)return this.fire(new E._n(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let r=t.onAdd(this);this._controls.push(t);let n=this._controlPositions[i];return i.includes("bottom")?n.insertBefore(r,n.firstChild):n.appendChild(r),this}removeControl(t){if(!t?.onRemove)return this.fire(new E._n(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let i=this._controls.indexOf(t);return i>-1&&this._controls.splice(i,1),t.onRemove(this),this}hasControl(t){return this._controls.includes(t)}coveringTiles(t){return tl(this._camera.transform,t)}setTransformCameraUpdate(t){this._camera.transformCameraUpdate=t}getCenter(){return new E.st(this._camera.transform.center.lng,this._camera.transform.center.lat)}setCenter(t,i){return this._camera.setCenter(t,i),this}getCenterElevation(){return this._camera.transform.elevation}setCenterElevation(t,i){return this._camera.setCenterElevation(t,i),this}setCenterClampedToGround(t){this._camera.setCenterClampedToGround(t)}panBy(t,i,r){return this._camera.panBy(t,i,r),this}panTo(t,i,r){return this._camera.panTo(t,i,r),this}getZoom(){return this._camera.transform.zoom}setZoom(t,i){return this._camera.setZoom(t,i),this}zoomTo(t,i,r){return this._camera.zoomTo(t,i,r),this}zoomIn(t,i){return this._camera.zoomIn(t,i),this}zoomOut(t,i){return this._camera.zoomOut(t,i),this}getVerticalFieldOfView(){return this._camera.transform.fov}setVerticalFieldOfView(t,i){return this._camera.setVerticalFieldOfView(t,i),this}getBearing(){return this._camera.transform.bearing}setBearing(t,i){return this._camera.setBearing(t,i),this}getZoomSnap(){return this._camera.getZoomSnap()}setZoomSnap(t){return this._camera.setZoomSnap(t),this}getPadding(){return this._camera.transform.padding}setPadding(t,i){return this._camera.setPadding(t,i),this}rotateTo(t,i,r){return this._camera.rotateTo(t,i,r),this}resetNorth(t,i){return this._camera.resetNorth(t,i),this}resetNorthPitch(t,i){return this._camera.resetNorthPitch(t,i),this}snapToNorth(t,i){return this._camera.snapToNorth(t,i),this}getPitch(){return this._camera.transform.pitch}setPitch(t,i){return this._camera.setPitch(t,i),this}getRoll(){return this._camera.transform.roll}setRoll(t,i){return this._camera.setRoll(t,i),this}cameraForBounds(t,i){return this._camera.cameraForBounds(t,i)}fitBounds(t,i,r){return this._camera.fitBounds(t,i,r),this}fitScreenCoordinates(t,i,r,n,o){return this._camera.fitScreenCoordinates(t,i,r,n,o),this}jumpTo(t,i){return this._camera.jumpTo(t,i),this}calculateCameraOptionsFromCameraLngLatAltRotation(t,i,r,n,o){return this._camera.calculateCameraOptionsFromCameraLngLatAltRotation(t,i,r,n,o)}easeTo(t,i){return this._camera.easeTo(t,i),this}flyTo(t,i){return this._camera.flyTo(t,i),this}stop(){return this._camera.stop(),this}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLat(E.st.convert(t),this._camera.transform):null}getCenterClampedToGround(){return this._camera.getCenterClampedToGround()}calculateCameraOptionsFromTo(t,i,r,n){return null==n&&this.terrain&&(n=this.terrain.getElevationForLngLat(r,this._camera.transform)),this._camera.transform.calculateCameraOptionsFromTo(t,i,r,n??0)}resize(t,i=!0){if(null!==this._lostContextStyle.style)return this;this._resizeInternal(i);let r=!this._camera._moving;return r&&(this.stop(),this.fire(new B("movestart",t)).fire(new B("move",t))),this.fire(new R("resize",t)),r&&this.fire(new B("moveend",t)),this}_resizeInternal(t=!0){let[i,r]=this._containerDimensions(),n=this._getClampedPixelRatio(i,r);if(this._resizeCanvas(i,r,n),this.painter.resize(i,r,n),this.painter.overLimit()){let t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];let n=this._getClampedPixelRatio(i,r);this._resizeCanvas(i,r,n),this.painter.resize(i,r,n)}this._resizeTransform(t)}_resizeTransform(t=!0){let[i,r]=this._containerDimensions();this._camera.transform.resize(i,r,t),this._camera._requestedCameraState?.resize(i,r,t)}_getClampedPixelRatio(t,i){let{0:r,1:n}=this._maxCanvasSize,o=this.getPixelRatio(),a=t*o,s=i*o,l=Math.min(a>r?r/a:1,s>n?n/s:1);return l<1&&(0,E.Pr)("The canvas is larger than maxCanvasSize and is rendered at a lower pixel ratio to fit. Increase maxCanvasSize, within MAX_TEXTURE_SIZE, to render at full resolution."),l*o}getPixelRatio(){return this._overridePixelRatio??devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this._camera.transform.getBounds()}getMaxBounds(){return this._camera.transform.getMaxBounds()}setMaxBounds(t){return this._camera.transform.setMaxBounds(eB.convert(t)),this._update()}setMinZoom(t){if((t??=-2)>=-2&&t<=this._camera.transform.maxZoom){let i=this._camera.transform.zoom,r=this._camera.getTransformForUpdate();return r.setMinZoom(t),this._camera.applyUpdatedTransform(r),this._update(),i!==this._camera.transform.zoom&&this.fire(new B("zoomstart")).fire(new B("zoom")).fire(new B("zoomend")).fire(new B("movestart")).fire(new B("move")).fire(new B("moveend")),this}throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(t=!1){let i=this._camera.transform;return t?i.applyConstrain(i.center,i.minZoom).zoom:i.minZoom}setMaxZoom(t){if((t??=22)>=this._camera.transform.minZoom){let i=this._camera.transform.zoom,r=this._camera.getTransformForUpdate();return r.setMaxZoom(t),this._camera.applyUpdatedTransform(r),this._update(),i!==this._camera.transform.zoom&&this.fire(new B("zoomstart")).fire(new B("zoom")).fire(new B("zoomend")).fire(new B("movestart")).fire(new B("move")).fire(new B("moveend")),this}throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this._camera.transform.maxZoom}setMinPitch(t){if((t??=0)<0)throw Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this._camera.transform.maxPitch){let i=this._camera.transform.pitch,r=this._camera.getTransformForUpdate();return r.setMinPitch(t),this._camera.applyUpdatedTransform(r),this._update(),i!==this._camera.transform.pitch&&this.fire(new B("pitchstart")).fire(new B("pitch")).fire(new B("pitchend")).fire(new B("movestart")).fire(new B("move")).fire(new B("moveend")),this}throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this._camera.transform.minPitch}setMaxPitch(t){if((t??=60)>180)throw Error("maxPitch must be less than or equal to 180");if(t>=this._camera.transform.minPitch){let i=this._camera.transform.pitch,r=this._camera.getTransformForUpdate();return r.setMaxPitch(t),this._camera.applyUpdatedTransform(r),this._update(),i!==this._camera.transform.pitch&&this.fire(new B("pitchstart")).fire(new B("pitch")).fire(new B("pitchend")).fire(new B("movestart")).fire(new B("move")).fire(new B("moveend")),this}throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this._camera.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(t){if((t??=20)>180)throw Error("anisotropicFilterPitch must be less than or equal to 180");if(t<0)throw Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=t,this._update()}getRenderWorldCopies(){return this._camera.transform.renderWorldCopies}setRenderWorldCopies(t){return this._camera.transform.setRenderWorldCopies(t),this._update()}setTransformConstrain(t){return this._camera.transform.setConstrainOverride(t),this._update()}project(t){return this._camera.transform.locationToScreenPoint(E.st.convert(t),this.style&&this.terrain)}unproject(t){return this._camera.transform.screenPointToLocation(E.Ri.convert(t),this.terrain)}isMoving(){return this._camera.isMoving()||this._handlers?.isMoving()||!1}isZooming(){return this._camera.isZooming()||this._handlers?.isZooming()||!1}isRotating(){return this._camera.isRotating()||this._handlers?.isRotating()||!1}_createDelegatedListener(t,i,r){if("mouseenter"===t||"mouseover"===t){let n=!1;return{layers:i,listener:r,delegates:{mousemove:o=>{let a=i.filter(t=>this.getLayer(t)),s=0===a.length?[]:this.queryRenderedFeatures(o.point,{layers:a});s.length?n||(n=!0,r.call(this,new j(t,this,o.originalEvent,{features:s}))):n=!1},mouseout:()=>{n=!1}}}}if("mouseleave"===t||"mouseout"===t){let n=!1;return{layers:i,listener:r,delegates:{mousemove:o=>{let a=i.filter(t=>this.getLayer(t));(0===a.length?[]:this.queryRenderedFeatures(o.point,{layers:a})).length?n=!0:n&&(n=!1,r.call(this,new j(t,this,o.originalEvent)))},mouseout:i=>{n&&(n=!1,r.call(this,new j(t,this,i.originalEvent)))}}}}{let n=t=>{let n=i.filter(t=>this.getLayer(t)),o=0===n.length?[]:this.queryRenderedFeatures(t.point,{layers:n});o.length&&(t.features=o,r.call(this,t),delete t.features)};return{layers:i,listener:r,delegates:{[t]:n}}}}_saveDelegatedListener(t,i){this._delegatedListeners||={},this._delegatedListeners[t]||=[],this._delegatedListeners[t].push(i)}_removeDelegatedListener(t,i,r){if(!this._delegatedListeners?.[t])return;let n=this._delegatedListeners[t];for(let t=0;t<n.length;t++){let o=n[t];if(o.listener===r&&o.layers.length===i.length&&o.layers.every(t=>i.includes(t))){for(let t in o.delegates)this.off(t,o.delegates[t]);n.splice(t,1);return}}}on(t,i,r){if(void 0===r)return super.on(t,i);let n="string"==typeof i?[i]:i,o=this._createDelegatedListener(t,n,r);for(let i in this._saveDelegatedListener(t,o),o.delegates)this.on(i,o.delegates[i]);return{unsubscribe:()=>{this._removeDelegatedListener(t,n,r)}}}once(t,i,r){if(void 0===r)return super.once(t,i);let n="string"==typeof i?[i]:i,o=this._createDelegatedListener(t,n,r);for(let i in o.delegates){let a=o.delegates[i];o.delegates[i]=(...i)=>{this._removeDelegatedListener(t,n,r),a(...i)}}for(let i in this._saveDelegatedListener(t,o),o.delegates)this.once(i,o.delegates[i]);return this}off(t,i,r){if(void 0===r)return super.off(t,i);let n="string"==typeof i?[i]:i;return this._removeDelegatedListener(t,n,r),this}queryRenderedFeatures(t,i){if(!this.style)return[];let r,n=t instanceof E.Ri||Array.isArray(t),o=n?t:[[0,0],[this._camera.transform.width,this._camera.transform.height]];if(i||=(n?{}:t)||{},o instanceof E.Ri||"number"==typeof o[0])r=[E.Ri.convert(o)];else{let t=E.Ri.convert(o[0]),i=E.Ri.convert(o[1]);r=[t,new E.Ri(i.x,t.y),i,new E.Ri(t.x,i.y),t]}return this.style.queryRenderedFeatures(r,i,this._camera.transform)}querySourceFeatures(t,i){return this.style.querySourceFeatures(t,i)}setStyle(t,i){return i=(0,E.tr)({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},i),this._styleUrl="string"==typeof t?t:null,!1!==i.diff&&i.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,i),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._updateStyle(t,i))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){let i=this._locale[t];if(null==i)throw Error(`Missing UI string '${t}'`);return i}_updateStyle(t,i){if(this._diffStyleRequest?.abort(),this._diffStyleRequest=null,i.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(t,i));let r=this.style&&i.transformStyle?this.style.serialize():void 0;return(this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t)?(this.style=new i2(this,i||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t,i,r):this.style.loadJSON(t,i,r)):(this._frameRequest&&=(this._frameRequest.abort(),null),this.style?.projection?.destroy(),delete this.style),this}_lazyInitEmptyStyle(){this.style||(this.style=new i2(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}async _diffStyle(t,i){if(this._diffStyleRequest?.abort(),"string"==typeof t){this._diffStyleRequest=new AbortController;let r=this._diffStyleRequest;try{let n=await this._requestManager.transformRequest(t,"Style");if(r.signal.aborted){this._diffStyleRequest=null;return}let o=await (0,E.Cn)(n,r);this._diffStyleRequest=null,this._updateDiff(o.data,i)}catch(t){this._diffStyleRequest=null,(0,E.Nn)(t)||this.fire(new E._n((0,E.$n)(t)))}}else"object"==typeof t&&(this._diffStyleRequest=null,this._updateDiff(t,i))}_updateDiff(t,i){try{this.style.setState(t,i)&&this._update(!0)}catch(r){(0,E.Pr)(`Unable to perform style diff: ${(0,E.$n)(r).message}. Rebuilding the style from scratch.`),this._updateStyle(t,i)}}getStyle(){if(this.style)return this.style.serialize()}getStyleUrl(){return this._styleUrl}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){return this.style?this.style.loaded():void(0,E.Pr)("There is no style added to the map.")}addSource(t,i){return this._lazyInitEmptyStyle(),this.style.addSource(t,i),this._update(!0)}isSourceLoaded(t){let i=this.style?.tileManagers[t];return void 0===i?void this.fire(new E._n(Error(`There is no tile manager with ID '${t}'`))):i.loaded()}setTerrain(t,i={}){if(this.style._checkLoaded(),t&&(0,E.on)(this,E.sn.terrain,{value:t},i))return this;if(this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),t){let i=this.style.tileManagers[t.source];if(!i)throw Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);for(let r in null===this.terrain&&i.reload(),this.style._layers){let i=this.style._layers[r];"hillshade"===i.type&&i.source===t.source&&(0,E.Pr)("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),"color-relief"===i.type&&i.source===t.source&&(0,E.Pr)("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain&&this.terrain.destroy(),this.terrain=new ip(this.painter,i,t,this._terrainSkirtLength),this.painter.renderToTexture=new oV(this.painter,this.terrain),this._camera.terrain=this.terrain,this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform)),this._terrainDataCallback=i=>this._handleTerrainDataEvent(i,t.source),this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.destroy(),this.terrain=null,this.painter.renderToTexture=null,this._camera.terrain=null,this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0);return this.style.triggerSymbolPlacement(),this.fire(new V({terrain:t})),this}_handleTerrainDataEvent(t,i){if("style"===t.dataType)return void this.terrain.tileManager.releaseAllRTT();let r=t.sourceId===i;if(r&&(this.terrain.resetElevationCache(),this.style.triggerSymbolPlacement()),r&&t.tile&&!this._camera.elevationFreeze&&(this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this.getCenterClampedToGround()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform))),t.tile){if(t.source?.type==="image")return void this.terrain.tileManager.releaseAllRTT();this.terrain.tileManager.releaseRTT(t.tile.tileID)}}getTerrain(){return this.terrain?.options??null}areTilesLoaded(){for(let t of Object.values(this.style?.tileManagers))if(!t.areTilesLoaded())return!1;return!0}removeSource(t){return this.style.removeSource(t),this._update(!0)}getSource(t){return this.style?.getSource(t)}setSourceTileLodParams(t,i,r){if(r){let n=this.getSource(r);if(!n)throw Error(`There is no source with ID "${r}", cannot set LOD parameters`);n.calculateTileZoom=to(Math.max(1,t),Math.max(1,i))}else for(let r in this.style.tileManagers)this.style.tileManagers[r].getSource().calculateTileZoom=to(Math.max(1,t),Math.max(1,i));return this._update(!0),this}refreshTiles(t,i){let r=this.style.tileManagers[t];if(!r)throw Error(`There is no tile manager with ID "${t}", cannot refresh tile`);void 0===i?r.reload(!0):r.refreshTiles(i.map(t=>new E.u(t.z,t.x,t.y)))}addImage(t,i,r={}){this._lazyInitEmptyStyle();let n=this._createStyleImage(i,r);return n&&(this.style.addImage(t,n),n.userImage?.onAdd&&n.userImage.onAdd(this,t)),this}setMissingStyleImageResolver(t){return this._missingStyleImageResolver=t,this.style?.setMissingImageResolver(t),this}_createStyleImage(t,i={}){let{pixelRatio:r=1,sdf:n=!1,stretchX:o,stretchY:a,content:s,textFitWidth:l,textFitHeight:c}=i;if(t instanceof HTMLImageElement||(0,E.lr)(t)){let{width:i,height:d,data:u}=D.getImageData(t);return{data:new E.Tt({width:i,height:d},u),pixelRatio:r,stretchX:o,stretchY:a,content:s,textFitWidth:l,textFitHeight:c,sdf:n,version:0}}if(void 0===t.width||void 0===t.height)return this.fire(new E._n(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`"))),null;{let{width:i,height:d,data:u}=t,h=(0,E.I)(t.data);return{data:h?new E.Tt({width:i,height:d}):new E.Tt({width:i,height:d},new Uint8Array(u)),pixelRatio:r,stretchX:o,stretchY:a,content:s,textFitWidth:l,textFitHeight:c,sdf:n,version:0,isWebGLImage:h,userImage:t}}}updateImage(t,i){let r=this.style.getImage(t);if(!r)return this.fire(new E._n(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:n,height:o,data:a}=i instanceof HTMLImageElement||(0,E.lr)(i)?D.getImageData(i):i;if(void 0===n||void 0===o)return this.fire(new E._n(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(n!==r.data.width||o!==r.data.height)return this.fire(new E._n(Error("The width and height of the updated image must be that same as the previous version of the image")));if(r.isWebGLImage=(0,E.I)(a),r.isWebGLImage)r.userImage=i;else{let t=!(i instanceof HTMLImageElement||(0,E.lr)(i));r.data.replace(a,t)}return this.style.updateImage(t,r),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new E._n(Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}async loadImage(t){let i=await s.getImage(await this._requestManager.transformRequest(t,"Image"),new AbortController);if(!i.data)throw Error(`Could not load image ${t}: the response is empty`);return i}listImages(){return this.style?.listImages()??[]}addLayer(t,i){return this._lazyInitEmptyStyle(),this.style.addLayer(t,i),this._update(!0)}moveLayer(t,i){return this.style.moveLayer(t,i),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){return this.style?.getLayer(t)}getLayersOrder(){return this.style?.getLayersOrder()??[]}setLayerZoomRange(t,i,r){return this.style.setLayerZoomRange(t,i,r),this._update(!0)}setFilter(t,i,r={}){return this.style?.setFilter(t,i,r),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,i,r,n={}){return this.style?.setPaintProperty(t,i,r,n),this._update(!0)}getPaintProperty(t,i){return this.style.getPaintProperty(t,i)}setLayoutProperty(t,i,r,n={}){return this.style.setLayoutProperty(t,i,r,n),this._update(!0)}getLayoutProperty(t,i){return this.style.getLayoutProperty(t,i)}setGlyphs(t,i={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,i),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}setFontFaces(t){return this._lazyInitEmptyStyle(),this.style.setFontFaces(t),this._update(!0)}getFontFaces(){return this.style.getFontFaces()}addSprite(t,i,r={}){return this._lazyInitEmptyStyle(),this.style.addSprite(t,i,r,t=>{t||this._update(!0)}),this}removeSprite(t){return this._lazyInitEmptyStyle(),this.style.removeSprite(t),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(t,i={}){return this._lazyInitEmptyStyle(),this.style.setSprite(t,i,t=>{t||this._update(!0)}),this}setLight(t,i={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,i),this._update(!0)}getLight(){return this.style.getLight()}setSky(t,i={}){return this._lazyInitEmptyStyle(),this.style.setSky(t,i),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(t,i){return this.style.setFeatureState(t,i),this._update()}removeFeatureState(t,i){return this.style.removeFeatureState(t,i),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let t=0,i=0;return this._container&&(t=this._container.clientWidth||400,i=this._container.clientHeight||300),[t,i]}_setupResizeObserver(){let t=!1,i=nK(t=>{this._trackResize&&!this._removed&&(this.resize(t),this.redraw())},50),r=this._ownerWindow.ResizeObserver??ResizeObserver;this._resizeObserver=new r(r=>{if(!t){t=!0;return}i(r)}),this._resizeObserver.observe(this._container)}_resolveContainer(t){if("string"==typeof t){let i=document.getElementById(t);if(!i)throw Error(`Container '${t}' not found.`);return i}if(t instanceof HTMLElement||t&&"object"==typeof t&&1===t.nodeType)return t;throw Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){let t=this._container;t.classList.add("maplibregl-map");let i=this._canvasContainer=P.create("div","maplibregl-canvas-container",t);this._interactive&&i.classList.add("maplibregl-interactive"),this._canvas=P.create("canvas","maplibregl-canvas",i),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");let r=this._containerDimensions(),n=this._getClampedPixelRatio(r[0],r[1]);this._resizeCanvas(r[0],r[1],n);let o=this._controlContainer=P.create("div","maplibregl-control-container",t),a=this._controlPositions={};for(let t of["top-left","top-right","bottom-left","bottom-right"])a[t]=P.create("div",`maplibregl-ctrl-${t} `,o);this._container.addEventListener("scroll",this._onMapScroll,!1)}_cleanupContainer(){this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map")}_resizeCanvas(t,i,r){this._canvas.width=Math.floor(r*t),this._canvas.height=Math.floor(r*i),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${i}px`}_setupPainter(){let t={...this._canvasContextAttributes,alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0},i=null;this._canvas.addEventListener("webglcontextcreationerror",t=>{i=t},{once:!0});let r=this._canvas.getContext("webgl2",t);if(!r)throw new nZ(t,i);this.painter=new nW(r,this._camera.transform)}migrateProjection(t,i){this._camera.migrateProjection(t,i),this.painter.transform=t,this.fire(new $({newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style?._loaded&&(this._styleDirty||=t,this._sourcesDirty=!0,this.triggerRepaint()),this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_render(t){let i=this._idleTriggered?this._fadeDuration:0,r=this.style.projection?.transitionState>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let t=this._camera.transform.zoom,r=A();this.style.zoomHistory.update(t,r);let o=new E.$t(t,{now:r,fadeDuration:i,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),a=o.crossFadingFactor();(1!==a||a!==this._crossFadingFactor)&&(n=!0,this._crossFadingFactor=a),this.style.update(o)}let o=this.style.projection?.transitionState>0!==r;this._camera.transform.setTransitionState(this.style.projection?.transitionState),this.style&&(this._sourcesDirty||o)&&(this._sourcesDirty=!1,this.style._updateSources(this._camera.transform)),this.terrain?(this.terrain.tileManager.update(this._camera.transform,this.terrain)&&this.terrain.resetElevationCache(),this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),!this._camera.elevationFreeze&&this.getCenterClampedToGround()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform))):(this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0)),this._placementDirty=this.style?._updatePlacement(this._camera.transform,this.showCollisionBoxes,i,this._crossSourceCollisions,o),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:i,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new R("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new R("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let a=this._sourcesDirty||this._styleDirty||this._placementDirty||this.painter.renderToTexture?.needsFollowUpFrame;return a||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new R("idle")),!this._loaded||this._fullyLoaded||a||(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&=(this._frameRequest.abort(),null),this._render(0)),this}remove(){for(let t of(this._hash&&this._hash.remove(),this._controls))t.onRemove(this);this._controls=[],this._frameRequest&&=(this._frameRequest.abort(),null),this._renderTaskQueue.clear(),this._diffStyleRequest?.abort(),this.painter.destroy(),this._handlers.destroy(),this.setStyle(null),"u">typeof window&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),s.removeThrottleControl(this._imageQueueHandle),this._resizeObserver?.disconnect();let t=this.painter.context.gl.getExtension("WEBGL_lose_context");t?.loseContext&&t.loseContext(),this._cleanupContainer(),this._removed=!0,this.fire(new R("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,D.frame(this._frameRequest,t=>{this._frameRequest=null;try{this._render(t)}catch(t){if(!(0,E.Nn)(t))throw t}},()=>{},this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get version(){return k}getCameraTargetElevation(){return this._camera.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(t){return this._lazyInitEmptyStyle(),this.style.setProjection(t),this._update(!0)}};let oW={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};var oZ=class{constructor(t){this._updateZoomButtons=()=>{let t=this._map.getZoom(),i=t===this._map.getMaxZoom(),r=t===this._map.getMinZoom(!0);this._zoomInButton.disabled=i,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",i.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},this._rotateCompassArrow=()=>{let t=this._map.getPitch(),i=this._map.getRoll(),r=this._map.getBearing(),n=1/Math.cos((0,E.Xn)(t))**.5;if(this.options.visualizePitch&&this.options.visualizeRoll){this._compassIcon.style.transform=`scale(${n}) rotateZ(${-i}deg) rotateX(${t}deg) rotateZ(${-r}deg)`;return}if(this.options.visualizePitch){this._compassIcon.style.transform=`scale(${n}) rotateX(${t}deg) rotateZ(${-r}deg)`;return}if(this.options.visualizeRoll){this._compassIcon.style.transform=`rotate(${-r-i}deg)`;return}this._compassIcon.style.transform=`rotate(${-r}deg)`},this._setButtonTitle=(t,i)=>{let r=this._map._getUIString(`NavigationControl.${i}`);t.title=r,t.setAttribute("aria-label",r)},this.options=(0,E.tr)({},oW,t),this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),P.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),P.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=P.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("move",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new oK(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){this._container.remove(),this.options.showZoom&&this._map.off("move",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(t,i){let r=P.create("button",t,this._container);return r.type="button",r.addEventListener("click",i),r}},oK=class{constructor(t,i,r=!1){this.mousedown=t=>{this.startMove(t,P.mousePos(this.element,t)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)},this.mousemove=t=>{this.move(t,P.mousePos(this.element,t))},this.mouseup=t=>{this._rotatePitchHandler.dragEnd(t),this.offTemp()},this.touchstart=t=>{1===t.targetTouches.length?(this._startPos=this._lastPos=P.touchPos(this.element,t.targetTouches)[0],this.startMove(t,this._startPos),window.addEventListener("touchmove",this.touchmove,{passive:!1}),window.addEventListener("touchend",this.touchend)):this.reset()},this.touchmove=t=>{1===t.targetTouches.length?(this._lastPos=P.touchPos(this.element,t.targetTouches)[0],this.move(t,this._lastPos)):this.reset()},this.touchend=t=>{0===t.targetTouches.length&&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._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=i;let n=new ol;this._rotatePitchHandler=new on({clickTolerance:3,move:(t,n)=>{let o=i.getBoundingClientRect(),a=new E.Ri((o.bottom-o.top)/2,(o.right-o.left)/2);return{bearingDelta:(0,E.ar)(new E.Ri(t.x,n.y),n,a),pitchDelta:r?-((n.y-t.y)*.5):void 0}},moveStateManager:n,enable:!0,assignEvents:()=>{}}),this.map=t,i.addEventListener("mousedown",this.mousedown),i.addEventListener("touchstart",this.touchstart,{passive:!1}),i.addEventListener("touchcancel",this.reset)}startMove(t,i){this._rotatePitchHandler.dragStart(t,i),P.disableDrag()}move(t,i){let r=this.map,{bearingDelta:n,pitchDelta:o}=this._rotatePitchHandler.dragMove(t,i)||{};n&&r.setBearing(r.getBearing()+n),o&&r.setPitch(r.getPitch()+o)}off(){let t=this.element;t.removeEventListener("mousedown",this.mousedown),t.removeEventListener("touchstart",this.touchstart),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),t.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){P.enableDrag(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend)}};async function oJ(t=!1){if(void 0!==f&&!t)return f;if(void 0===window.navigator.permissions)return f=!!window.navigator.geolocation;try{f="denied"!==(await window.navigator.permissions.query({name:"geolocation"})).state}catch{f=!!window.navigator.geolocation}return f}function oX(t,i,r,n=!1){if(n||!r.getCoveringTilesDetailsProvider().allowWorldCopies())return t?.wrap();let o=new E.st(t.lng,t.lat);if(t=new E.st(t.lng,t.lat),i){let n=new E.st(t.lng-360,t.lat),o=new E.st(t.lng+360,t.lat),a=r.locationToScreenPoint(t).distSqr(i);r.locationToScreenPoint(n).distSqr(i)<a?t=n:r.locationToScreenPoint(o).distSqr(i)<a&&(t=o)}for(;Math.abs(t.lng-r.center.lng)>180;){let i=r.locationToScreenPoint(t);if(i.x>=0&&i.y>=0&&i.x<=r.width&&i.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t.lng!==o.lng&&r.isPointOnMapSurface(r.locationToScreenPoint(t))?t:o}let oQ={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 o0(t,i,r){let n=t.classList;for(let t in oQ)n.remove(`maplibregl-${r}-anchor-${t}`);n.add(`maplibregl-${r}-anchor-${i}`)}let o1={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]},o2="#3FB1CE";function o3(t,i,r=[]){let n=P.createNS("http://www.w3.org/2000/svg",t);for(let t in i)n.setAttributeNS(null,t,i[t]);for(let t of r)n.appendChild(t);return n}var o5=class extends E.vn{},o4=class extends E.vn{},o6=class extends E.yn{constructor(t){if(super(),this._onClick=t=>{this.fire(new o4("click",{originalEvent:t}))},this._onKeyPress=t=>{("Space"===t.code||"Enter"===t.code)&&this.togglePopup()},this._onKeyDown=t=>{if(!this._defaultMarker||!this._draggable||!this._map||!this._lngLat||t.composedPath()[0]!==this._element||t.altKey||t.ctrlKey||t.metaKey)return;let i=o1[t.key];if(!i)return;t.preventDefault(),t.stopPropagation();let r=t.shiftKey?10:1,n=this._map.project(this._lngLat);this.setLngLat(this._map.unproject(new E.Ri(n.x+i[0]*r,n.y+i[1]*r))),this._keyboardDragActive||(this._keyboardDragActive=!0,this.fire(new o5("dragstart"))),this.fire(new o5("drag"))},this._onKeyUp=t=>{o1[t.key]&&this._endKeyboardDrag()},this._onBlur=()=>{this._endKeyboardDrag()},this._onMapClick=t=>{let i=t.originalEvent.target,r=this._element;this._popup&&(i===r||r.contains(i))&&this.togglePopup()},this._update=t=>{if(!this._map)return;let i=this._map.loaded()&&!this._map.isMoving();t?.type!=="terrain"&&(t?.type!=="render"||i)||this._map.once("render",this._update),this._lngLat=oX(this._lngLat,this._flatPos,this._map._camera.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map._camera.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let r="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?r=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(r=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let n="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?n="rotateX(0deg)":"map"===this._pitchAlignment&&(n=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||t&&"moveend"!==t.type||(this._pos=this._pos.round()),this._element.style.transform=`${oQ[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${n} ${r}`,D.frameAsync(new AbortController,this._map._ownerWindow).then(()=>{this._updateOpacity(t?.type==="moveend")}).catch(()=>{})},this._onMove=t=>{if(!this._isDragging){let i=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=i}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new o5("dragstart"))),this.fire(new o5("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),"active"===this._state&&this.fire(new o5("dragend")),this._state="inactive"},this._addDragHandler=t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.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=t?.anchor||"center",this._color=t?.color||o2,this._scale=t?.scale||1,this._draggable=t?.draggable||!1,this._clickTolerance=t?.clickTolerance||0,this._subpixelPositioning=t?.subpixelPositioning||!1,this._isDragging=!1,this._roleManaged=!1,this._tabIndexManaged=!1,this._keyboardDragActive=!1,this._state="inactive",this._rotation=t?.rotation||0,this._rotationAlignment=t?.rotationAlignment||"auto",this._pitchAlignment=t?.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,this.setOpacity(t?.opacity,t?.opacityWhenCovered),t?.element)this._element=t.element,this._offset=E.Ri.convert(t?.offset||[0,0]);else{this._defaultMarker=!0,this._element=P.create("div");let i=(p||(p=o3("svg",{display:"block",height:"41px",width:"27px",viewBox:"0 0 27 41"},[o3("g",{"fill-rule":"nonzero"},[o3("g",{transform:"translate(3.0, 29.0)",fill:"#000000"},[["10.5","5.25002273"],["10.5","5.25002273"],["9.5","4.77275007"],["8.5","4.29549936"],["7.5","3.81822308"],["6.5","3.34094679"],["5.5","2.86367051"],["4.5","2.38636864"]].map(([t,i])=>o3("ellipse",{opacity:"0.04",cx:"10.5",cy:"5.80029008",rx:t,ry:i}))),o3("g",{fill:o2},[o3("path",{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"})]),o3("g",{opacity:"0.25",fill:"#000000"},[o3("path",{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"})]),o3("g",{transform:"translate(6.0, 7.0)",fill:"#FFFFFF"}),o3("g",{transform:"translate(8.0, 8.0)"},[o3("circle",{fill:"#000000",opacity:"0.25",cx:"5.5",cy:"5.5",r:"5.4999962"}),o3("circle",{fill:"#FFFFFF",cx:"5.5",cy:"5.5",r:"5.4999962"})])])]))).cloneNode(!0);i.setAttributeNS(null,"height",`${41*this._scale}px`),i.setAttributeNS(null,"width",`${27*this._scale}px`),(function(t){return t.firstElementChild.children[1]})(i).setAttributeNS(null,"fill",this._color),this._element.appendChild(i),this._offset=E.Ri.convert(t?.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",t=>{t.preventDefault()}),this._element.addEventListener("mousedown",t=>{t.preventDefault()}),o0(this._element,this._anchor,"marker"),t?.className)for(let i of t.className.split(" "))this._element.classList.add(i);this._popup=null}addTo(t){return this.remove(),this._map=t,this._defaultMarker&&!this._element.hasAttribute("aria-label")&&this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),this._updateAccessibilityRole(),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),t.on("projectiontransition",this._update),this._element.addEventListener("click",this._onClick),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("projectiontransition",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),this._element.removeEventListener("click",this._onClick),this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._element.removeEventListener("keypress",this._onKeyPress),this._keyboardDragActive=!1,this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=E.st.convert(t),this._pos=null,this._update(),this._popup&&this._popup.setLngLat(this._lngLat),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress)),t){if(!("offset"in t.options)){let i=13.5/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[i,-((24.6+i)*1)],"bottom-right":[-i,-((24.6+i)*1)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._element.addEventListener("keypress",this._onKeyPress)}return this._updateTabIndex(),this._updateAccessibilityRole(),this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}_endKeyboardDrag(){this._keyboardDragActive&&(this._keyboardDragActive=!1,this.fire(new o5("dragend")))}getPopup(){return this._popup}togglePopup(){let t=this._popup;return this._element.style.opacity===this._opacityWhenCovered||t&&(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map))),this}_updateOpacity(t=!1){let i=this._map?.terrain,r=this._map._camera.transform.isLocationOccluded(this._lngLat);if(!i||r){let t=r?this._opacityWhenCovered:this._opacity;this._element.style.opacity!==t&&(this._element.style.opacity=t,this._element.classList.toggle("maplibregl-marker-covered",r));return}if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let n=this._map,o=n.terrain.depthAtPoint(this._pos),a=n.terrain.getElevationForLngLat(this._lngLat,n._camera.transform);if(n._camera.transform.lngLatToCameraDepth(this._lngLat,a)-o<.006){this._element.style.opacity=this._opacity,this._element.classList.remove("maplibregl-marker-covered");return}let s=-this._offset.y/n._camera.transform.pixelsPerMeter,l=Math.sin(n.getPitch()*Math.PI/180)*s,c=n.terrain.depthAtPoint(new E.Ri(this._pos.x,this._pos.y-this._offset.y)),d=n._camera.transform.lngLatToCameraDepth(this._lngLat,a+l)-c>.006;this._popup?.isOpen()&&d&&this._popup.remove(),this._element.style.opacity=d?this._opacityWhenCovered:this._opacity,this._element.classList.toggle("maplibregl-marker-covered",d)}getOffset(){return this._offset}setOffset(t){return this._offset=E.Ri.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._element.classList.toggle("maplibregl-marker-draggable",this._draggable),this._map&&(t?(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._defaultMarker&&(this._draggable?(this._element.addEventListener("keydown",this._onKeyDown),this._element.addEventListener("keyup",this._onKeyUp),this._element.addEventListener("blur",this._onBlur)):(this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._endKeyboardDrag())),this._updateTabIndex(),this._updateAccessibilityRole(),this}isDraggable(){return this._draggable}_updateTabIndex(){this._popup||this._defaultMarker&&this._draggable?this._element.hasAttribute("tabindex")||(this._element.setAttribute("tabindex","0"),this._tabIndexManaged=!0):this._tabIndexManaged&&=("0"===this._element.getAttribute("tabindex")&&this._element.removeAttribute("tabindex"),!1)}_updateAccessibilityRole(){if(!this._defaultMarker||this._element.hasAttribute("role")&&!this._roleManaged)return;let t=this._draggable||this._popup?"button":"img";this._element.setAttribute("role",t),this._roleManaged=!0}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,i){return(void 0===this._opacity||void 0===t&&void 0===i)&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==t&&(this._opacity=String(t)),void 0!==i&&(this._opacityWhenCovered=String(i)),this._map&&this._updateOpacity(!0),this}};let o8={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},o7=0,o9=!1;var ae=class extends E.vn{},at=class extends E.vn{},ai=class extends E.vn{},ar=class extends E.yn{constructor(t){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t)){this._setErrorState(),this.fire(new at("outofmaxbounds",t)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,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 Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new at("geolocate",t)),this._finish()}},this._updateCamera=t=>{let i=new E.st(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy,n=this._map.getBearing(),o=(0,E.tr)({bearing:n},this.options.fitBoundsOptions),a=eB.fromLngLat(i,r);this._map.fitBounds(a,o,{geolocateSource:!0})},this._updateMarker=t=>{if(t){let i=new E.st(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=t.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=t=>{if(this._map){if(1===t.code){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;let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&o9)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new ai("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._onMoveStart=t=>{if(!this._map)return;let i=t?.[0]instanceof ResizeObserverEntry;t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||i||this._map.isZooming()||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new ae("trackuserlocationend")),this.fire(new ae("userlocationlostfocus")))},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",t=>{t.preventDefault()}),this._geolocateButton=P.create("button","maplibregl-ctrl-geolocate",this._container),P.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(!1===t){(0,E.Pr)("Geolocation support is not available so the GeolocateControl will be disabled.");let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{let t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=P.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new o6({element:this._dotElement}),this._circleElement=P.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new o6({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",this._onMoveStart)}},this.options=(0,E.tr)({},o8,t)}onAdd(t){return this._map=t,this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),oJ().then(t=>this._finishSetupUI(t)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(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(),this._container.remove(),this._map.off("movestart",this._onMoveStart),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,o7=0,o9=!1}_isOutOfMapMaxBounds(t){let i=this._map.getMaxBounds(),r=t.coords;return i&&(r.longitude<i.getWest()||r.longitude>i.getEast()||r.latitude<i.getSouth()||r.latitude>i.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":case"BACKGROUND_ERROR":case"OFF":case void 0:break;default:throw Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){let t=this._userLocationDotMarker.getLngLat();if(!this.options.showUserLocation||!this.options.showAccuracyCircle||!this._accuracy||!t)return;let i=this._map.project(t),r=this._map.unproject([i.x+100,i.y]),n=t.distanceTo(r)/100,o=2*this._accuracy/n;this._circleElement.style.width=`${o.toFixed(2)}px`,this._circleElement.style.height=`${o.toFixed(2)}px`}trigger(){if(!this._setup)return(0,E.Pr)("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 ae("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":o7--,o9=!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 ae("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 ae("trackuserlocationstart")),this.fire(new ae("userlocationfocus"));break;default:throw 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 Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let t;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++o7>1?(t={maximumAge:6e5,timeout:0},o9=!0):(t=this.options.positionOptions,o9=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}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)}};let an={maxWidth:100,unit:"metric"};var ao=class{constructor(t){this._onMove=()=>{aa(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,aa(this._map,this._container,this.options)},this.options={...an,...t}}getDefaultPosition(){return"bottom-left"}onAdd(t){return this._map=t,this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._onMove),this._map=void 0}};function aa(t,i,r){let n=r?.maxWidth||100,o=t._container.clientHeight/2,a=t._container.clientWidth/2,s=t.unproject([a-n/2,o]),l=t.unproject([a+n/2,o]),c=Math.min(n,Math.round(t.project(l).x-t.project(s).x),t._container.clientWidth),d=s.distanceTo(l);if(r?.unit==="imperial"){let r=3.2808*d;r>5280?as(i,c,r/5280,t._getUIString("ScaleControl.Miles")):as(i,c,r,t._getUIString("ScaleControl.Feet"))}else r?.unit==="nautical"?as(i,c,d/1852,t._getUIString("ScaleControl.NauticalMiles")):d>=1e3?as(i,c,d/1e3,t._getUIString("ScaleControl.Kilometers")):as(i,c,d,t._getUIString("ScaleControl.Meters"))}function as(t,i,r,n){var o,a;let s,l,c,d=(o=r,l=10**(`${Math.floor(o)}`.length-1),c=o/l,l*(c=c>=10?10:c>=5?5:c>=3?3:c>=2?2:c>=1?1:(a=c,s=10**Math.ceil(-Math.log(a)/Math.LN10),Math.round(a*s)/s))),u=d/r;t.style.width=`${i*u}px`,t.innerHTML=`${d} ${n}`}var al=class extends E.vn{},ac=class extends E.yn{constructor(t={}){super(),this._onFullscreenChange=()=>{let t=window.document.fullscreenElement||window.document.webkitFullscreenElement;for(;t?.shadowRoot?.fullscreenElement;)t=t.shadowRoot.fullscreenElement;t===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,this._pseudo=t.pseudo??!1,t?.container&&(t.container instanceof HTMLElement?this._container=t.container:(0,E.Pr)("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(t){return this._map=t,this._container||=this._map.getContainer(),this._controlContainer=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let t=this._fullscreenButton=P.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);P.create("span","maplibregl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t}_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 al("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new al("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){this._pseudo?this._togglePseudoFullScreen():window.document.exitFullscreen?window.document.exitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._pseudo?this._togglePseudoFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},ad=class{constructor(t){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=t}onAdd(t){return this._map=t,this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=P.create("button","maplibregl-ctrl-terrain",this._container),P.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(){this._container.remove(),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},au=class{constructor(){this._toggleProjection=()=>{let t=this._map.getProjection()?.type;"mercator"!==t&&t?this._map.setProjection({type:"mercator"}):this._map.setProjection({type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),this._map.getProjection()?.type==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(t){return this._map=t,this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=P.create("button","maplibregl-ctrl-globe",this._container),P.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._map.on("projectiontransition",this._updateGlobeIcon),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateGlobeIcon),this._map.off("projectiontransition",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}};let ah={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0};var am=class extends E.vn{},af=class extends E.yn{constructor(t){super(),this._updateOpacity=()=>{void 0!==this.options.locationOccludedOpacity&&(this._map._camera.transform.isLocationOccluded(this.getLngLat())?this._container.style.opacity=`${this.options.locationOccludedOpacity}`:this._container.style.opacity="")},this.remove=()=>(this._content&&this._content.remove(),this._container&&(this._container.remove(),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("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousemove",this._update),this._map.off("mouseup",this._update),this._map.off("drag",this._update),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new am("close"))),this),this._update=t=>{let i,r=this._lngLat||this._trackPointer;if(!this._map||!r||!this._content)return;if(!this._container){if(this._container=P.create("div","maplibregl-popup",this._map.getContainer()),this._tip=P.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let t of this.options.className.split(" "))this._container.classList.add(t);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._lngLat=oX(this._lngLat,this._flatPos,this._map._camera.transform,this._trackPointer),t&&"point"in t&&t.point&&(i=t.point),this._trackPointer&&!i)return;let n=this._flatPos=this._pos=this._trackPointer&&i?i:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&i?i:this._map._camera.transform.locationToScreenPoint(this._lngLat));let o=this.options.anchor,a=function t(i){if(!i)return t(new E.Ri(0,0));if("number"==typeof i){let t=Math.round(Math.abs(i)/Math.SQRT2);return{center:new E.Ri(0,0),top:new E.Ri(0,i),"top-left":new E.Ri(t,t),"top-right":new E.Ri(-t,t),bottom:new E.Ri(0,-i),"bottom-left":new E.Ri(t,-t),"bottom-right":new E.Ri(-t,-t),left:new E.Ri(i,0),right:new E.Ri(-i,0)}}if(i instanceof E.Ri||Array.isArray(i)){let t=E.Ri.convert(i);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:E.Ri.convert(i.center||[0,0]),top:E.Ri.convert(i.top||[0,0]),"top-left":E.Ri.convert(i["top-left"]||[0,0]),"top-right":E.Ri.convert(i["top-right"]||[0,0]),bottom:E.Ri.convert(i.bottom||[0,0]),"bottom-left":E.Ri.convert(i["bottom-left"]||[0,0]),"bottom-right":E.Ri.convert(i["bottom-right"]||[0,0]),left:E.Ri.convert(i.left||[0,0]),right:E.Ri.convert(i.right||[0,0])}}(this.options.offset);if(!o){var s;let t=this._container.offsetWidth,i=this._container.offsetHeight,r=(s=this.options.padding)?{top:s.top??0,right:s.right??0,bottom:s.bottom??0,left:s.left??0}:{top:0,right:0,bottom:0,left:0},l;l=n.y+a.bottom.y<i+r.top?["top"]:n.y>this._map._camera.transform.height-i-r.bottom?["bottom"]:[],n.x<t/2+r.left?l.push("left"):n.x>this._map._camera.transform.width-t/2-r.right&&l.push("right"),o=0===l.length?"bottom":l.join("-")}let l=n.add(a[o]);this.options.subpixelPositioning||(l=l.round()),this._container.style.transform=`${oQ[o]} translate(${l.x}px,${l.y}px)`,o0(this._container,o,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=(0,E.tr)(Object.create(ah),t)}addTo(t){return this._map&&this.remove(),this._map=t,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._map.on("terrain",this._update),this._map.on("projectiontransition",this._update),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._update),this._map.on("mouseup",this._update),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 am("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=E.st.convert(t),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._update),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._update),this._map.on("drag",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){let i=document.createDocumentFragment(),r=document.createElement("body"),n;for(r.innerHTML=t;n=r.firstChild;)i.appendChild(n);return this.setDOMContent(i)}getMaxWidth(){return this._container?.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=P.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){return this._container&&this._container.classList.add(t),this}removeClassName(t){return this._container&&this._container.classList.remove(t),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){if(this._container)return this._container.classList.toggle(t)}setSubpixelPositioning(t){this.options.subpixelPositioning=t}setPadding(t){this.options.padding=t,this._update()}_createCloseButton(){this.options.closeButton&&(this._closeButton=P.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;let t=this._container.querySelector("a[href], [tabindex]:not([tabindex='-1']), [contenteditable]:not([contenteditable='false']), button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])");t&&t.focus()}};function ap(t,i){return e7().setRTLTextPlugin(t,i)}function a_(){return e7().getRTLTextPluginStatus()}function ag(){return k}function ab(){return eM.workerCount}function ay(t){eM.workerCount=t}function av(){return E.jn.MAX_PARALLEL_IMAGE_REQUESTS}function aF(t){E.jn.MAX_PARALLEL_IMAGE_REQUESTS=t}function ax(){return E.jn.WORKER_URL}function aw(t){E.jn.WORKER_URL=t}async function aE(t){await eL().broadcast("IS",t)}r.d(i,{AJAXError:()=>E.bn,AttributionControl:()=>oY,BoxZoomHandler:()=>n9,CanvasSource:()=>e1,CooperativeGesturesHandler:()=>oS,DoubleClickZoomHandler:()=>ok,DragPanHandler:()=>oT,DragRotateHandler:()=>oA,EXTENT:()=>8192,EdgeInsets:()=>ia,ErrorEvent:()=>E._n,Event:()=>E.vn,Evented:()=>E.yn,FullscreenControl:()=>ac,FullscreenEvent:()=>al,GPUInitializationError:()=>nZ,GeoJSONSource:()=>e$,GeolocateControl:()=>ar,GeolocateErrorEvent:()=>ai,GeolocateEvent:()=>ae,GeolocatePositionEvent:()=>at,GlobeControl:()=>au,Hash:()=>nJ,ImageSource:()=>eX,KeyboardHandler:()=>ox,LngLat:()=>E.st,LngLatBounds:()=>eB,LogoControl:()=>oj,Map:()=>oG,MapBoxZoomEvent:()=>H,MapContextEvent:()=>q,MapLibreEvent:()=>R,MapLibreMap:()=>oG,MapMouseEvent:()=>j,MapMovementEvent:()=>B,MapProjectionEvent:()=>$,MapSourceDataEvent:()=>Y,MapStyleDataEvent:()=>z,MapStyleImageMissingEvent:()=>G,MapStyleLoadEvent:()=>O,MapTerrainEvent:()=>V,MapTouchEvent:()=>N,MapWheelEvent:()=>U,Marker:()=>o6,MarkerClickEvent:()=>o4,MarkerDragEvent:()=>o5,MercatorCoordinate:()=>E.et,NavigationControl:()=>oZ,Point:()=>E.Ri,Popup:()=>af,PopupEvent:()=>am,RasterDEMTileSource:()=>ej,RasterTileSource:()=>eY,ScaleControl:()=>ao,ScrollZoomHandler:()=>oE,Style:()=>i2,TerrainControl:()=>ad,TwoFingersTouchPitchHandler:()=>ob,TwoFingersTouchRotateHandler:()=>o_,TwoFingersTouchZoomHandler:()=>of,TwoFingersTouchZoomRotateHandler:()=>oC,VectorTileSource:()=>ez,VideoSource:()=>e0,addProtocol:()=>E.On,clearPrewarmedResources:()=>eC,config:()=>E.jn,createTileMesh:()=>eJ,getGlobalDispatcher:()=>eL,getMaxParallelImageRequests:()=>av,getRTLTextPluginStatus:()=>a_,getVersion:()=>ag,getWorkerCount:()=>ab,getWorkerUrl:()=>ax,importScriptInWorkers:()=>aE,isTimeFrozen:()=>L,now:()=>A,prewarm:()=>eA,removeProtocol:()=>E.An,restoreNow:()=>S,setMaxParallelImageRequests:()=>aF,setNow:()=>C,setRTLTextPlugin:()=>ap,setWorkerCount:()=>ay,setWorkerUrl:()=>aw},{addSourceType:e5})}},i={};function r(n){var o=i[n];if(void 0!==o)return o.exports;var a=i[n]={exports:{}};return t[n].call(a.exports,a,a.exports,r),a.exports}r.n=t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return r.d(i,{a:i}),i},r.d=(t,i,n)=>{var o=(i,n)=>{for(var o in i)r.o(i,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,[n]:i[o]})};o(i,"get"),o(n,"value")},r.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}})(),r.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),r.r=t=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var n={};(()=>{"use strict";let t,i,o,a,s,l,c,d,u;r.r(n),r.d(n,{DefaultConfig:()=>hF,LngLat:()=>sM.st,OrClusterMarker:()=>uL,OrMap:()=>hA,OrMapAssetCard:()=>hx,OrMapAssetCardLoadAssetEvent:()=>hv,OrMapClickedEvent:()=>hk,OrMapGeocoder:()=>uk,OrMapGeocoderChangeEvent:()=>uE,OrMapGeocoderControl:()=>uM,OrMapLegend:()=>u2,OrMapLegendControl:()=>u3,OrMapLegendEvent:()=>u1,OrMapLoadedEvent:()=>hE,OrMapLongPressEvent:()=>hM,OrMapMarker:()=>sI,OrMapMarkerAsset:()=>sq,OrMapMarkerChangedEvent:()=>sL,OrMapMarkerClickedEvent:()=>sP,OrMapMarkersChangedEvent:()=>hD,OrMapPresetFilter:()=>hd,OrMapPresetFilterControl:()=>hu,OrMapPresetFilterEvent:()=>hc,Util:()=>tS,geoJsonPointInputTemplateProvider:()=>hT,getMarkerConfigAttributeName:()=>s$,getMarkerConfigForAssetType:()=>sV});var h,m,f,p,_,g,b,y,v,F,x,w,E,k,M,D,T,A,C,S,L,P,I,R,B,O,z,Y,j,N,U,H,V,$,q,G,W,Z,K,J,X,Q,ee,et,ei,er,en,eo,ea,es,el,ec,ed,eu,eh,em,ef,ep,e_,eg,eb,ey,ev,eF,ex,ew,eE,ek,eM,eD,eT,eA,eC,eS,eL,eP,eI,eR,eB,eO,ez,eY,ej,eN,eU,eH,eV,e$,eq,eG,eW,eZ,eK,eJ,eX,eQ,e0,e1,e2,e3,e5,e4,e6,e8,e7,e9,te,tt,ti,tr,tn,to,ta,ts,tl,tc,td,tu,th,tm,tf,tp,t_,tg,tb,ty,tv,tF,tx,tw,tE,tk,tM,tD,tT,tA,tC={};r.r(tC),r.d(tC,{hasBrowserEnv:()=>rq,hasStandardBrowserEnv:()=>rW,hasStandardBrowserWebWorkerEnv:()=>rZ,navigator:()=>rG,origin:()=>rK});var tS={};r.r(tS),r.d(tS,{formatCount:()=>sB,getGeoJSONPoint:()=>sY,getLngLat:()=>sz,getLngLatBounds:()=>sj,getMarkerIconAndColorFromAssetType:()=>sN,isAssetWithLocation:()=>sU,metersToPixelsAtMaxZoom:()=>sO}),r(4532),(_=eD||(eD={})).CREATE="CREATE",_.UPDATE="UPDATE",_.DELETE="DELETE",_.DELETE_FINISHED="DELETE_FINISHED",(g=eT||(eT={})).LOW="LOW",g.MEDIUM="MEDIUM",g.HIGH="HIGH",(b=eA||(eA={})).MANUAL="MANUAL",b.CLIENT="CLIENT",b.GLOBAL_RULESET="GLOBAL_RULESET",b.REALM_RULESET="REALM_RULESET",b.ASSET_RULESET="ASSET_RULESET",b.AGENT="AGENT",(y=eC||(eC={})).OPEN="OPEN",y.ACKNOWLEDGED="ACKNOWLEDGED",y.IN_PROGRESS="IN_PROGRESS",y.RESOLVED="RESOLVED",y.CLOSED="CLOSED",(v=eS||(eS={})).BOTTOM_LEFT="BOTTOM_LEFT",v.BOTTOM_RIGHT="BOTTOM_RIGHT",v.TOP_LEFT="TOP_LEFT",v.TOP_RIGHT="TOP_RIGHT",(F=eL||(eL={})).CREATE="CREATE",F.READ="READ",F.UPDATE="UPDATE",F.DELETE="DELETE",(x=eP||(eP={})).NONE="NONE",x.FORECAST="FORECAST",x.SETPOINT="SETPOINT",(w=eI||(eI={})).DISCONNECTED="DISCONNECTED",w.CONNECTING="CONNECTING",w.DISCONNECTING="DISCONNECTING",w.CONNECTED="CONNECTED",w.DISABLED="DISABLED",w.WAITING="WAITING",w.ERROR="ERROR",w.STOPPED="STOPPED",(E=eR||(eR={})).REQUEST_START="REQUEST_START",E.REQUEST_REPEATING="REQUEST_REPEATING",E.REQUEST_CANCEL="REQUEST_CANCEL",E.READY="READY",E.COMPLETED="COMPLETED",E.RUNNING="RUNNING",E.CANCELLED="CANCELLED",(k=eB||(eB={})).TOGGLE="TOGGLE",k.INCREMENT="INCREMENT",k.DECREMENT="DECREMENT",k.NEGATE="NEGATE",(M=eO||(eO={})).ASSET_NOT_FOUND="ASSET_NOT_FOUND",M.ATTRIBUTE_NOT_FOUND="ATTRIBUTE_NOT_FOUND",M.INSUFFICIENT_ACCESS="INSUFFICIENT_ACCESS",M.INVALID_VALUE="INVALID_VALUE",M.INTERCEPTOR_FAILURE="INTERCEPTOR_FAILURE",M.STATE_STORAGE_FAILED="STATE_STORAGE_FAILED",M.CANNOT_PROCESS="CANNOT_PROCESS",M.QUEUE_FULL="QUEUE_FULL",M.UNKNOWN="UNKNOWN",M.ASSET_ID_MISSING="ASSET_ID_MISSING",M.ATTRIBUTE_NAME_MISSING="ATTRIBUTE_NAME_MISSING",(D=ez||(ez={})).PUBLIC="PUBLIC",D.SHARED="SHARED",D.PRIVATE="PRIVATE",(T=eY||(eY={})).OFF="OFF",T.ONE_MIN="ONE_MIN",T.FIVE_MIN="FIVE_MIN",T.QUARTER="QUARTER",T.ONE_HOUR="ONE_HOUR",(A=ej||(ej={})).WRAP_TO_SINGLE_COLUMN="WRAP_TO_SINGLE_COLUMN",A.KEEP_LAYOUT="KEEP_LAYOUT",A.REDIRECT="REDIRECT",A.BLOCK_DEVICE="BLOCK_DEVICE",(C=eN||(eN={})).CSV="CSV",C.CSV_CROSSTAB="CSV_CROSSTAB",C.CSV_CROSSTAB_MINUTE="CSV_CROSSTAB_MINUTE",(S=eU||(eU={})).MINUTE="MINUTE",S.HOUR="HOUR",S.DAY="DAY",S.WEEK="WEEK",S.MONTH="MONTH",S.YEAR="YEAR",(L=eH||(eH={})).MIN="MIN",L.AVG="AVG",L.MAX="MAX",L.DIFFERENCE="DIFFERENCE",L.COUNT="COUNT",L.SUM="SUM",L.MODE="MODE",L.MEDIAN="MEDIAN",(P=eV||(eV={})).TERMINATING="TERMINATING",P.DISABLED="DISABLED",P.ALREADY_CONNECTED="ALREADY_CONNECTED",P.UNRECOGNISED="UNRECOGNISED",P.PERMANENT_ERROR="PERMANENT_ERROR",P.SYNC_ERROR="SYNC_ERROR",(I=e$||(e$={})).HTTPS="HTTPS",I.HTTP="HTTP",I.TCP="TCP",(R=eq||(eq={})).GET="GET",R.POST="POST",R.PUT="PUT",R.DELETE="DELETE",R.OPTIONS="OPTIONS",R.PATCH="PATCH",(B=eG||(eG={})).KEYCLOAK="KEYCLOAK",B.NONE="NONE",(O=eW||(eW={})).WEBSOCKET="WEBSOCKET",O.POLLING="POLLING",(z=eZ||(eZ={})).INTERNAL="INTERNAL",z.CLIENT="CLIENT",z.GLOBAL_RULESET="GLOBAL_RULESET",z.REALM_RULESET="REALM_RULESET",z.ASSET_RULESET="ASSET_RULESET",(Y=eK||(eK={})).REALM="REALM",Y.USER="USER",Y.ASSET="ASSET",Y.CUSTOM="CUSTOM",(j=eJ||(eJ={})).NORMAL="NORMAL",j.HIGH="HIGH",(N=eX||(eX={})).DEVICE="DEVICE",N.TOPIC="TOPIC",N.CONDITION="CONDITION",(U=eQ||(eQ={})).ALWAYS="ALWAYS",U.ONCE="ONCE",U.HOURLY="HOURLY",U.DAILY="DAILY",U.WEEKLY="WEEKLY",U.MONTHLY="MONTHLY",U.ANNUALLY="ANNUALLY",(H=e0||(e0={})).TITLE="TITLE",H.SOURCE="SOURCE",H.STATUS="STATUS",H.SENT_ON="SENT_ON",H.DELIVERED_ON="DELIVERED_ON",(V=e1||(e1={})).MESSAGE_INVALID="MESSAGE_INVALID",V.CERTIFICATE_INVALID="CERTIFICATE_INVALID",V.UNAUTHORIZED="UNAUTHORIZED",V.FORBIDDEN="FORBIDDEN",V.UNIQUE_ID_MISMATCH="UNIQUE_ID_MISMATCH",V.CONFIG_DISABLED="CONFIG_DISABLED",V.USER_DISABLED="USER_DISABLED",V.SERVER_ERROR="SERVER_ERROR",V.ASSET_ERROR="ASSET_ERROR",V.SERVER_BUSY="SERVER_BUSY",($=e2||(e2={})).PRIVATE="PRIVATE",$.PROTECTED="PROTECTED",$.PUBLIC="PUBLIC",(q=e3||(e3={})).EXACT="EXACT",q.BEGIN="BEGIN",q.END="END",q.CONTAINS="CONTAINS",(G=e5||(e5={})).EQUALS="EQUALS",G.GREATER_THAN="GREATER_THAN",G.GREATER_EQUALS="GREATER_EQUALS",G.LESS_THAN="LESS_THAN",G.LESS_EQUALS="LESS_EQUALS",G.BETWEEN="BETWEEN",(W=e4||(e4={})).CREATED_ON="CREATED_ON",W.NAME="NAME",W.ASSET_TYPE="ASSET_TYPE",W.PARENT_ID="PARENT_ID",W.REALM="REALM",(Z=e6||(e6={})).RESTRICTED="RESTRICTED",Z.LINKED="LINKED",Z.REALM="REALM",(K=e8||(e8={})).AT_LEAST_ONE="AT_LEAST_ONE",K.ALL="ALL",K.NONE="NONE",(J=e7||(e7={})).AND="AND",J.OR="OR",(X=e9||(e9={})).CREATED_ON="CREATED_ON",X.FIRST_NAME="FIRST_NAME",X.LAST_NAME="LAST_NAME",X.USERNAME="USERNAME",X.EMAIL="EMAIL",(Q=te||(te={})).STOPPED="STOPPED",Q.RUNNING="RUNNING",Q.ERROR="ERROR",(ee=tt||(tt={})).JAVASCRIPT="JAVASCRIPT",ee.GROOVY="GROOVY",ee.JSON="JSON",ee.FLOW="FLOW",(et=ti||(ti={})).READY="READY",et.DEPLOYED="DEPLOYED",et.COMPILATION_ERROR="COMPILATION_ERROR",et.VALIDITY_PERIOD_ERROR="VALIDITY_PERIOD_ERROR",et.EXECUTION_ERROR="EXECUTION_ERROR",et.LOOP_ERROR="LOOP_ERROR",et.DISABLED="DISABLED",et.PAUSED="PAUSED",et.EXPIRED="EXPIRED",et.REMOVED="REMOVED",et.EMPTY="EMPTY",(ei=tr||(tr={})).SUNRISE="SUNRISE",ei.SUNSET="SUNSET",ei.TWILIGHT_MORNING_VISUAL="TWILIGHT_MORNING_VISUAL",ei.TWILIGHT_MORNING_VISUAL_LOWER="TWILIGHT_MORNING_VISUAL_LOWER",ei.TWILIGHT_MORNING_HORIZON="TWILIGHT_MORNING_HORIZON",ei.TWILIGHT_MORNING_CIVIL="TWILIGHT_MORNING_CIVIL",ei.TWILIGHT_MORNING_NAUTICAL="TWILIGHT_MORNING_NAUTICAL",ei.TWILIGHT_MORNING_ASTRONOMICAL="TWILIGHT_MORNING_ASTRONOMICAL",ei.TWILIGHT_MORNING_GOLDEN_HOUR="TWILIGHT_MORNING_GOLDEN_HOUR",ei.TWILIGHT_MORNING_BLUE_HOUR="TWILIGHT_MORNING_BLUE_HOUR",ei.TWILIGHT_MORNING_NIGHT_HOUR="TWILIGHT_MORNING_NIGHT_HOUR",ei.TWILIGHT_EVENING_VISUAL="TWILIGHT_EVENING_VISUAL",ei.TWILIGHT_EVENING_VISUAL_LOWER="TWILIGHT_EVENING_VISUAL_LOWER",ei.TWILIGHT_EVENING_HORIZON="TWILIGHT_EVENING_HORIZON",ei.TWILIGHT_EVENING_CIVIL="TWILIGHT_EVENING_CIVIL",ei.TWILIGHT_EVENING_NAUTICAL="TWILIGHT_EVENING_NAUTICAL",ei.TWILIGHT_EVENING_ASTRONOMICAL="TWILIGHT_EVENING_ASTRONOMICAL",ei.TWILIGHT_EVENING_GOLDEN_HOUR="TWILIGHT_EVENING_GOLDEN_HOUR",ei.TWILIGHT_EVENING_BLUE_HOUR="TWILIGHT_EVENING_BLUE_HOUR",ei.TWILIGHT_EVENING_NIGHT_HOUR="TWILIGHT_EVENING_NIGHT_HOUR",(er=tn||(tn={})).NUMBER="NUMBER",er.NUMBER_ARRAY="NUMBER_ARRAY",er.STRING="STRING",er.BOOLEAN="BOOLEAN",er.TRIGGER="TRIGGER",er.COLOR="COLOR",er.ANY="ANY",(en=to||(to={})).NEW_LINE="NEW_LINE",en.SPACER="SPACER",(eo=ta||(ta={})).INPUT="INPUT",eo.PROCESSOR="PROCESSOR",eo.OUTPUT="OUTPUT",eo.THEN="THEN",(ea=ts||(ts={})).TEXT="TEXT",ea.MULTILINE="MULTILINE",ea.NUMBER="NUMBER",ea.DROPDOWN="DROPDOWN",ea.DOUBLE_DROPDOWN="DOUBLE_DROPDOWN",ea.CHECKBOX="CHECKBOX",ea.ASSET_ATTRIBUTE="ASSET_ATTRIBUTE",ea.COLOR="COLOR",ea.DATE="DATE",(es=tl||(tl={})).ADD="ADD",es.ADD_OR_REPLACE="ADD_OR_REPLACE",es.REPLACE="REPLACE",es.DELETE="DELETE",es.CLEAR="CLEAR",(el=tc||(tc={})).PER_ASSET="PER_ASSET",el.GLOBAL="GLOBAL",(ec=td||(td={})).READ_ADMIN="read:admin",ec.READ_LOGS="read:logs",ec.READ_USERS="read:users",ec.READ_MAP="read:map",ec.READ_ASSETS="read:assets",ec.READ_RULES="read:rules",ec.READ_INSIGHTS="read:insights",ec.READ_ALARMS="read:alarms",ec.READ_NOTIFICATIONS="read:notifications",ec.READ_SERVICES="read:services",ec.READ_TUNNELS="read:tunnels",ec.WRITE_SERVICES="write:services",ec.WRITE_USER="write:user",ec.WRITE_ADMIN="write:admin",ec.WRITE_LOGS="write:logs",ec.WRITE_ASSETS="write:assets",ec.WRITE_ATTRIBUTES="write:attributes",ec.WRITE_RULES="write:rules",ec.WRITE_INSIGHTS="write:insights",ec.WRITE_ALARMS="write:alarms",ec.WRITE_NOTIFICATIONS="write:notifications",ec.WRITE_TUNNELS="write:tunnels",ec.READ="read",ec.WRITE="write",(ed=tu||(tu={})).REGISTER="REGISTER",ed.UPDATE="UPDATE",ed.DEREGISTER="DEREGISTER",(eu=th||(th={})).AVAILABLE="AVAILABLE",eu.UNAVAILABLE="UNAVAILABLE",(eh=tm||(tm={})).ASSET="ASSET",eh.AGENT="AGENT",eh.NOTIFICATION="NOTIFICATION",eh.ALARM="ALARM",eh.RULES="RULES",eh.PROTOCOL="PROTOCOL",eh.GATEWAY="GATEWAY",eh.MODEL_AND_VALUES="MODEL_AND_VALUES",eh.API="API",eh.DATA="DATA",(em=tf||(tf={})).INFO="INFO",em.WARN="WARN",em.ERROR="ERROR",(ef=tp||(tp={})).NUMERIC="numeric",ef.DIGIT_2="2-digit",ef.FULL="full",ef.LONG="long",ef.MEDIUM="medium",ef.SHORT="short",ef.NARROW="narrow",(ep=t_||(t_={})).SECONDLY="SECONDLY",ep.MINUTELY="MINUTELY",ep.HOURLY="HOURLY",ep.DAILY="DAILY",ep.WEEKLY="WEEKLY",ep.MONTHLY="MONTHLY",ep.YEARLY="YEARLY",(e_=tg||(tg={})).OMIT="OMIT",e_.BACKWARD="BACKWARD",e_.FORWARD="FORWARD",(eg=tb||(tb={})).JAPANESE="JAPANESE",eg.BUDDHIST="BUDDHIST",eg.ROC="ROC",eg.ISLAMIC="ISLAMIC",eg.ISO8601="ISO8601",eg.CHINESE="CHINESE",eg.ETHIOPIC="ETHIOPIC",eg.HEBREW="HEBREW",eg.GREGORIAN="GREGORIAN",(eb=ty||(ty={})).SU="SU",eb.MO="MO",eb.TU="TU",eb.WE="WE",eb.TH="TH",eb.FR="FR",eb.SA="SA",(ey=tv||(tv={})).PEOPLECOUNTERASSET="PeopleCounterAsset",ey.MAILAGENT="MailAgent",ey.UDPAGENT="UDPAgent",ey.ROOMASSET="RoomAsset",ey.CITYASSET="CityAsset",ey.VENTILATIONASSET="VentilationAsset",ey.TRADFRILIGHTASSET="TradfriLightAsset",ey.CONSOLEASSET="ConsoleAsset",ey.PRESENCESENSORASSET="PresenceSensorAsset",ey.OPENWEATHERMAPAGENT="OpenWeatherMapAgent",ey.LIGHTASSET="LightAsset",ey.KNXAGENT="KNXAgent",ey.THETHINGSSTACKAGENT="TheThingsStackAgent",ey.PLUGASSET="PlugAsset",ey.CHIRPSTACKAGENT="ChirpStackAgent",ey.WEATHERASSET="WeatherAsset",ey.THINGASSET="ThingAsset",ey.WEBSOCKETAGENT="WebsocketAgent",ey.TCPAGENT="TCPAgent",ey.GATEWAYASSET="GatewayAsset",ey.SERIALAGENT="SerialAgent",ey.BLUETOOTHMESHAGENT="BluetoothMeshAgent",ey.PARKINGASSET="ParkingAsset",ey.TRADFRIPLUGASSET="TradfriPlugAsset",ey.SIMULATORAGENT="SimulatorAgent",ey.SNMPAGENT="SNMPAgent",ey.GROUPASSET="GroupAsset",ey.BUILDINGASSET="BuildingAsset",ey.MODBUSSERIALAGENT="ModbusSerialAgent",ey.ENVIRONMENTSENSORASSET="EnvironmentSensorAsset",ey.MQTTAGENT="MQTTAgent",ey.VELBUSTCPAGENT="VelbusTCPAgent",ey.ARTNETLIGHTASSET="ArtnetLightAsset",ey.VELBUSSERIALAGENT="VelbusSerialAgent",ey.GROUNDWATERSENSORASSET="GroundwaterSensorAsset",ey.MICROPHONEASSET="MicrophoneAsset",ey.MODBUSTCPAGENT="ModbusTcpAgent",ey.ZWAVEAGENT="ZWaveAgent",ey.HTTPAGENT="HTTPAgent",ey.DOORASSET="DoorAsset",ey.THERMOSTATASSET="ThermostatAsset",ey.SHIPASSET="ShipAsset",(ev=tF||(tF={})).COLOURRGB="colourRGB",ev.WILDCARDSUBSCRIPTIONTOPICS="wildcardSubscriptionTopics",ev.PRICEHOURLY="priceHourly",ev.MQTTPORT="MQTTPort",ev.PINGDISABLED="pingDisabled",ev.FLOW="flow",ev.CHILDASSETTYPE="childAssetType",ev.LASTACCESS="lastAccess",ev.POSITION="position",ev.NETWORKKEY="networkKey",ev.UNIVERSE="universe",ev.ROUTINGMODE="routingMode",ev.MSSINUMBER="MSSINumber",ev.LASTWILLRETAIN="lastWillRetain",ev.LASTWILLTOPIC="lastWillTopic",ev.SERIALBAUDRATE="serialBaudrate",ev.SUBSCRIBEQOS="subscribeQos",ev.LEDCOUNT="lEDCount",ev.LOCKED="locked",ev.CLOUDCOVERAGE="cloudCoverage",ev.BASEURL="baseURL",ev.PROTOCOL="protocol",ev.REQUIREDVALUES="requiredValues",ev.REGION="region",ev.CONSOLEPLATFORM="consolePlatform",ev.GATEWAYSTATUS="gatewayStatus",ev.NO2LEVEL="NO2Level",ev.ATMOSPHERICPRESSURE="atmosphericPressure",ev.SERIALPORT="serialPort",ev.APPLICATIONID="applicationId",ev.TAGS="tags",ev.UNLOCK="unlock",ev.CHECKINTERVALSECONDS="checkIntervalSeconds",ev.LOCATION="location",ev.CLIENTSECRET="clientSecret",ev.WINDDIRECTION="windDirection",ev.WINDSPEED="windSpeed",ev.PARTICLESPM10="particlesPM10",ev.APPLICATIONKEY="applicationKey",ev.LENGTH="length",ev.PROBABILITYOFPRECIPITATION="probabilityOfPrecipitation",ev.USERNAMEPASSWORD="usernamePassword",ev.WATERLEVEL="waterLevel",ev.CONNECTHEADERS="connectHeaders",ev.CONSOLENAME="consoleName",ev.WEBSOCKETQUERY="websocketQuery",ev.PREFERHTML="preferHTML",ev.PARITY="parity",ev.COOLING="cooling",ev.POLLINGMILLIS="pollingMillis",ev.SOILTEMPERATURE="soilTemperature",ev.SUNIRRADIANCE="sunIrradiance",ev.MESSAGEMAXLENGTH="messageMaxLength",ev.WINDGUSTSPEED="windGustSpeed",ev.LIGHTID="lightId",ev.PROXYADDRESS="proxyAddress",ev.REQUESTQUERYPARAMETERS="requestQueryParameters",ev.MQTTHOST="MQTTHost",ev.SECUREGRPC="secureGRPC",ev.MODEL="model",ev.STREET="street",ev.MANUFACTURER="manufacturer",ev.DELETEPROCESSEDMAIL="deleteProcessedMail",ev.RESUMESESSION="resumeSession",ev.ONOFF="onOff",ev.APIKEY="ApiKey",ev.CITY="city",ev.PRESENCE="presence",ev.SPACESOCCUPIED="spacesOccupied",ev.STARTTLS="startTLS",ev.REQUESTTIMEOUTMILLIS="requestTimeoutMillis",ev.WEBSOCKETPATH="websocketPath",ev.AGENTSTATUS="agentStatus",ev.PRICEDAILY="priceDaily",ev.COUNTGROWTHMINUTE="countGrowthMinute",ev.IMONUMBER="IMONumber",ev.ATTRIBUTION="Attribution",ev.TENANTID="tenantId",ev.REQUESTHEADERS="requestHeaders",ev.HOST="host",ev.COUNTOUTMINUTE="countOutMinute",ev.MESSAGECHARSET="messageCharset",ev.CERTIFICATEALIAS="certificateAlias",ev.EMAIL="email",ev.BINDPORT="bindPort",ev.CONSOLEVERSION="consoleVersion",ev.PARTICLESPM1="particlesPM1",ev.MTU="mtu",ev.SPEED="speed",ev.MESSAGESTRIPDELIMITER="messageStripDelimiter",ev.AREA="area",ev.COUNTRY="country",ev.SHIPTYPE="shipType",ev.CONNECTSUBSCRIPTIONS="connectSubscriptions",ev.RELATIVEHUMIDITY="relativeHumidity",ev.SOURCEADDRESS="sourceAddress",ev.RAINFALL="rainfall",ev.OAUTHGRANT="oAuthGrant",ev.OZONELEVEL="ozoneLevel",ev.SEQUENCENUMBER="sequenceNumber",ev.COUNTINMINUTE="countInMinute",ev.PORT="port",ev.SUNALTITUDE="sunAltitude",ev.COUNTOUT="countOut",ev.ROOMNUMBER="roomNumber",ev.TUNNELINGSUPPORTED="tunnelingSupported",ev.ENINUMBER="ENINumber",ev.PARTICLESPM2_5="particlesPM2_5",ev.AGENTDISABLED="agentDisabled",ev.DISABLED="disabled",ev.COUNTIN="countIn",ev.MESSAGESOURCEADDRESS="messageSourceAddress",ev.PROVISIONWEATHERASSET="ProvisionWeatherAsset",ev.TIMEINJECTIONINTERVAL="timeInjectionInterval",ev.TEMPERATURESETPOINT="temperatureSetpoint",ev.CONSOLEPROVIDERS="consoleProviders",ev.COUNTTOTAL="countTotal",ev.SPACESBUFFER="spacesBuffer",ev.DEVICECONFIG="deviceConfig",ev.SPACESTOTAL="spacesTotal",ev.BINDHOST="bindHost",ev.FANSPEED="fanSpeed",ev.MESSAGECONVERTBINARY="messageConvertBinary",ev.NOTES="notes",ev.MAILFOLDERNAME="mailFolderName",ev.MESSAGEDELIMITERS="messageDelimiters",ev.TEMPERATURE="temperature",ev.SUNZENITH="sunZenith",ev.SNMPVERSIONVALUE="SNMPVersionValue",ev.BRIGHTNESS="brightness",ev.POSTALCODE="postalCode",ev.SPACESOPEN="spacesOpen",ev.HUMIDITY="humidity",ev.SOUNDLEVEL="soundLevel",ev.SECUREMODE="secureMode",ev.DIRECTION="direction",ev.STOPBITS="stopbits",ev.UVINDEX="uVIndex",ev.CONNECTURL="connectURL",ev.CLIENTID="clientId",ev.NATMODE="NATMode",ev.UPDATEONWRITE="updateOnWrite",ev.LASTWILLPAYLOAD="lastWillPayload",ev.GROUPID="groupId",ev.FOLLOWREDIRECTS="followRedirects",ev.SUNAZIMUTH="sunAzimuth",ev.MESSAGECONVERTHEX="messageConvertHex",ev.WEBSOCKETMODE="websocketMode",ev.COLOURTEMPERATURE="colourTemperature",ev.PUBLISHQOS="publishQos",ev.DATABITS="dataBits",(eF=tx||(tx={})).FORMAT="format",eF.DATAPOINTSMAXAGEDAYS="dataPointsMaxAgeDays",eF.ACCESSRESTRICTEDWRITE="accessRestrictedWrite",eF.SECRET="secret",eF.APPLYPREDICTEDDATAPOINTS="applyPredictedDataPoints",eF.ATTRIBUTELINKS="attributeLinks",eF.RULERESETIMMEDIATE="ruleResetImmediate",eF.RULESTATE="ruleState",eF.AGENTLINKCONFIG="agentLinkConfig",eF.HASPREDICTEDDATAPOINTS="hasPredictedDataPoints",eF.FORECAST="forecast",eF.STOREDATAPOINTS="storeDataPoints",eF.LABEL="label",eF.CONSTRAINTS="constraints",eF.UNITS="units",eF.USERCONNECTED="userConnected",eF.SHOWONDASHBOARD="showOnDashboard",eF.READONLY="readOnly",eF.MULTILINE="multiline",eF.ACCESSPUBLICWRITE="accessPublicWrite",eF.MOMENTARY="momentary",eF.AGENTLINK="agentLink",eF.ACCESSRESTRICTEDREAD="accessRestrictedRead",eF.ACCESSPUBLICREAD="accessPublicRead",(ex=tw||(tw={})).ASSETQUERY="assetQuery",ex.WSURL="WS_URL",ex.COLOURRGB="colourRGB",ex.VALUEFORMAT="valueFormat",ex.TEXT="text",ex.BYTE="byte",ex.USERNAMEANDPASSWORD="usernameAndPassword",ex.HTTPURL="HTTP_URL",ex.ATTRIBUTELINK="attributeLink",ex.ASSETID="assetID",ex.NUMBERMAP="numberMap",ex.HTTPMETHOD="HTTPMethod",ex.ATTRIBUTESTATE="attributeState",ex.POSITIVENUMBER="positiveNumber",ex.POSITIVEINTEGER="positiveInteger",ex.EXECUTIONSTATUS="executionStatus",ex.BIGINTEGER="bigInteger",ex.VALUEDESCRIPTOR="valueDescriptor",ex.PERIODDURATIONISO8601="periodDurationISO8601",ex.LONG="long",ex.DATEANDTIME="dateAndTime",ex.BOOLEANMAP="booleanMap",ex.MQTTQOS="MQTTQos",ex.NEGATIVEINTEGER="negativeInteger",ex.TCPIPPORTNUMBER="TCP_IPPortNumber",ex.GEOJSONPOINT="GEO_JSONPoint",ex.SNMPVERSION="SNMPVersion",ex.ASSETTYPE="assetType",ex.JSONOBJECT="JSONObject",ex.INTEGERMAP="integerMap",ex.BIGNUMBER="bigNumber",ex.IPADDRESS="IPAddress",ex.EMAIL="email",ex.TIMESTAMP="timestamp",ex.KNXMESSAGESOURCEADDRESS="kNXMessageSourceAddress",ex.ATTRIBUTEREFERENCE="attributeReference",ex.UUID="UUID",ex.INTEGER="integer",ex.OAUTHGRANT="oAuthGrant",ex.NUMBER="number",ex.DEVICECONFIGMAP="DeviceConfigMap",ex.TEXTMAP="textMap",ex.WEBSOCKETSUBSCRIPTION="websocketSubscription",ex.BOOLEAN="boolean",ex.TIMEANDPERIODDURATIONISO8601="timeAndPeriodDurationISO8601",ex.FORECASTCONFIGURATION="forecastConfiguration",ex.TIMEDURATIONISO8601="timeDurationISO8601",ex.TIMESTAMPISO8601="timestampISO8601",ex.CONSOLEPROVIDERS="consoleProviders",ex.MULTIVALUEDTEXTMAP="multivaluedTextMap",ex.NEGATIVENUMBER="negativeNumber",ex.PARITYBIT="Paritybit",ex.JSON="JSON",ex.CRONEXPRESSION="CRONExpression",ex.INTEGERBYTE="integerByte",ex.AGENTLINK="agentLink",ex.DIRECTION="direction",ex.HOSTORIPADDRESS="hostOrIPAddress",ex.STOPBITS="Stopbits",ex.CALENDAREVENT="calendarEvent",ex.CONNECTIONSTATUS="connectionStatus",ex.VALUECONSTRAINT="valueConstraint",(ew=tE||(tE={})).MONTH="month",ew.MILE_SCANDINAVIAN="mile_scandinavian",ew.VAR="var",ew.OUNCE="ounce",ew.HECTARE="hectare",ew.YARD="yard",ew.YEAR="year",ew.GIGA="giga",ew.JOULE="joule",ew.VOLT="volt",ew.HERTZ="hertz",ew.MILE="mile",ew.DEGREE="degree",ew.KILO="kilo",ew.BTU="btu",ew.TERA="tera",ew.FOOT="foot",ew.MEGA="mega",ew.KELVIN="kelvin",ew.CARBON="carbon",ew.DECIBEL_ATTENUATED="decibel_attenuated",ew.INCH="inch",ew.SQUARED="squared",ew.PERCENTAGE="percentage",ew.IN_HG="inch_mercury",ew.CENTI="centi",ew.GRAM="gram",ew.CUBED="cubed",ew.DAY="day",ew.RADIAN="radian",ew.OHM="ohm",ew.MINUTE="minute",ew.PART_PER_MILLION="ppm",ew.AMP="amp",ew.MASS_POUND="pound",ew.KNOT="knot",ew.METRE="metre",ew.LITRE="litre",ew.FLUID_OUNCE="fluid_ounce",ew.HOUR="hour",ew.ACRE="acre",ew.CELSIUS="celsius",ew.RPM="rpm",ew.PASCAL="pascal",ew.DECIBEL="decibel",ew.LUMEN="lumen",ew.WEEK="week",ew.FAHRENHEIT="fahrenheit",ew.WATT="watt",ew.GALLON="gallon",ew.LUX="lux",ew.MILLI="milli",ew.BAR="bar",ew.HECTO="hecto",ew.PEAK="peak",ew.SECOND="second",ew.MICRO="micro",ew.PER="per",ew.STONE="stone",tk||(tk={});class tL{static getAssetDescriptors(){return tL._assetTypeInfos.map(t=>t.assetDescriptor)}static getMetaItemDescriptors(){return[...this._metaItemDescriptors]}static getValueDescriptors(){return[...this._valueDescriptors]}static getAssetTypeInfos(){return[...this._assetTypeInfos]}static getAssetTypeInfo(t){if(t)return t.assetDescriptor?t:("string"!=typeof t&&(t=t.name),this._assetTypeInfos.find(i=>i.assetDescriptor.name===t))}static getAssetDescriptor(t){if(!t)return;if(t.assetDescriptor)return t.assetDescriptor;if("string"!=typeof t)return t;let i=this._assetTypeInfos.find(i=>i.assetDescriptor.name===t);return i?i.assetDescriptor:void 0}static getAttributeDescriptor(t,i){if(!t)return;let r=this.getAssetTypeInfo(i||"ThingAsset");if(r&&r.attributeDescriptors)return r.attributeDescriptors.find(i=>i.name===t)}static getValueDescriptor(t){let i;if(!t)return;if(t.endsWith("[]"))for(i=0;t.endsWith("[]");)t=t.substring(0,t.length-2),i++;let r=this._valueDescriptors.find(i=>i.name===t);return r&&i&&(r=Object.assign(Object.assign({},r),{arrayDimensions:i})),r}static resolveValueDescriptor(t,i){let r;return i&&("string"==typeof i&&(r=tL.getValueDescriptor(i)),r=i.jsonType?i:tL.getValueDescriptor(i.type)),!r&&t&&(r=tL.getValueDescriptor("JSON")),r}static resolveValueTypeFromValue(t){if(null!=t){if("number"==typeof t)return"number";if("string"==typeof t)return"text";if("boolean"==typeof t)return"boolean";if(Array.isArray(t)){let i=1,r=t.find(t=>null!=t);for(;Array.isArray(r);)r=r.find(t=>null!=t),i++;let n=this.resolveValueTypeFromValue(r);if(!n)return;for(;i>0;)n+="[]",i--;return n}if(t instanceof Date)return"dateAndTime"}}static getAttributeAndValueDescriptors(t,i,r){let n,o;if(i&&"string"!=typeof i)n=i;else{let o=this.getAssetTypeInfo(t||"ThingAsset");if(!o)return[void 0,void 0];"string"==typeof i&&(n=this.getAttributeDescriptor(i,o)),!n&&r&&(n={type:r.type,name:r.name,meta:r.meta})}return n&&(o=this.getValueDescriptor(n.type)),[n,o]}static getMetaItemDescriptor(t){if(t)return this._metaItemDescriptors.find(i=>i.name===t)}static getAssetDescriptorColour(t,i){let r=this.getAssetDescriptor(t);return r&&r.colour?r.colour:i}static getAssetDescriptorIcon(t,i){let r=this.getAssetDescriptor(t);return r&&r.icon?r.icon:i}}tL._assetTypeInfos=[],tL._metaItemDescriptors=[],tL._valueDescriptors=[];let tP=t=>"string"==typeof t,tI=()=>{let t,i,r=new Promise((r,n)=>{t=r,i=n});return r.resolve=t,r.reject=i,r},tR=t=>null==t?"":String(t),tB=/###/g,tO=t=>t&&t.includes("###")?t.replace(tB,"."):t,tz=t=>!t||tP(t),tY=(t,i,r)=>{let n=tP(i)?i.split("."):i,o=0;for(;o<n.length-1;){if(tz(t))return{};let i=tO(n[o]);!t[i]&&r&&(t[i]=new r),t=Object.prototype.hasOwnProperty.call(t,i)?t[i]:{},++o}return tz(t)?{}:{obj:t,k:tO(n[o])}},tj=(t,i,r)=>{let{obj:n,k:o}=tY(t,i,Object);if(void 0!==n||1===i.length){n[o]=r;return}let a=i[i.length-1],s=i.slice(0,i.length-1),l=tY(t,s,Object);for(;void 0===l.obj&&s.length;)a=`${s[s.length-1]}.${a}`,l=tY(t,s=s.slice(0,s.length-1),Object),l?.obj&&void 0!==l.obj[`${l.k}.${a}`]&&(l.obj=void 0);l.obj[`${l.k}.${a}`]=r},tN=(t,i)=>{let{obj:r,k:n}=tY(t,i);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},tU=(t,i,r)=>{for(let n in i)"__proto__"!==n&&"constructor"!==n&&(Object.prototype.hasOwnProperty.call(t,n)?tP(t[n])||t[n]instanceof String||tP(i[n])||i[n]instanceof String?r&&(t[n]=i[n]):tU(t[n],i[n],r):t[n]=i[n]);return t},tH={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},tV=t=>tP(t)?t.replace(/[&<>"'\/]/g,t=>tH[t]):t,t$=[" ",",","?","!",";"],tq=new class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){let i=this.regExpMap.get(t);if(void 0!==i)return i;let r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}(20),tG=(t,i,r=".")=>{if(!t)return;if(t[i]){if(!Object.prototype.hasOwnProperty.call(t,i))return;return t[i]}let n=i.split(r),o=t;for(let t=0;t<n.length;){let i;if(!o||"object"!=typeof o)return;let a="";for(let s=t;s<n.length;++s)if(s!==t&&(a+=r),a+=n[s],void 0!==(i=o[a])){if(["string","number","boolean"].includes(typeof i)&&s<n.length-1)continue;t+=s-t+1;break}o=i}return o},tW=t=>t?.replace(/_/g,"-"),tZ={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,i){console?.[t]?.apply?.(console,i)}};var tK=new class t{constructor(t,i={}){this.init(t,i)}init(t,i={}){this.prefix=i.prefix||"i18next:",this.logger=t||tZ,this.options=i,this.debug=i.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,i,r,n){return n&&!this.debug?null:(t=t.map(t=>tP(t)?t.replace(/[\r\n\x00-\x1F\x7F]/g," "):t),tP(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[i](t))}create(i){return new t(this.logger,{...{prefix:`${this.prefix}:${i}:`},...this.options})}clone(i){return(i=i||this.options).prefix=i.prefix||this.prefix,new t(this.logger,i)}};class tJ{constructor(){this.observers={}}on(t,i){return t.split(" ").forEach(t=>{this.observers[t]||(this.observers[t]=new Map);let r=this.observers[t].get(i)||0;this.observers[t].set(i,r+1)}),this}off(t,i){if(this.observers[t]){if(!i)return void delete this.observers[t];this.observers[t].delete(i)}}once(t,i){let r=(...n)=>{i(...n),this.off(t,r)};return this.on(t,r),this}emit(t,...i){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([t,r])=>{for(let n=0;n<r;n++)t(...i)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([r,n])=>{for(let o=0;o<n;o++)r(t,...i)})}}class tX extends tJ{constructor(t,i={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=i,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.includes(t)||this.options.ns.push(t)}removeNamespaces(t){let i=this.options.ns.indexOf(t);i>-1&&this.options.ns.splice(i,1)}getResource(t,i,r,n={}){let o,a=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,s=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;t.includes(".")?o=t.split("."):(o=[t,i],r&&(Array.isArray(r)?o.push(...r):tP(r)&&a?o.push(...r.split(a)):o.push(r)));let l=tN(this.data,o);return(!l&&!i&&!r&&t.includes(".")&&(t=o[0],i=o[1],r=o.slice(2).join(".")),!l&&s&&tP(r))?tG(this.data?.[t]?.[i],r,a):l}addResource(t,i,r,n,o={silent:!1}){let a=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,s=[t,i];r&&(s=s.concat(a?r.split(a):r)),t.includes(".")&&(s=t.split("."),n=i,i=s[1]),this.addNamespaces(i),tj(this.data,s,n),o.silent||this.emit("added",t,i,r,n)}addResources(t,i,r,n={silent:!1}){for(let n in r)(tP(r[n])||Array.isArray(r[n]))&&this.addResource(t,i,n,r[n],{silent:!0});n.silent||this.emit("added",t,i,r)}addResourceBundle(t,i,r,n,o,a={silent:!1,skipCopy:!1}){let s=[t,i];t.includes(".")&&(s=t.split("."),n=r,r=i,i=s[1]),this.addNamespaces(i);let l=tN(this.data,s)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),n?tU(l,r,o):l={...l,...r},tj(this.data,s,l),a.silent||this.emit("added",t,i,r)}removeResourceBundle(t,i){this.hasResourceBundle(t,i)&&delete this.data[t][i],this.removeNamespaces(i),this.emit("removed",t,i)}hasResourceBundle(t,i){return void 0!==this.getResource(t,i)}getResourceBundle(t,i){return i||(i=this.options.defaultNS),this.getResource(t,i)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){let i=this.getDataByLanguage(t);return!!(i&&Object.keys(i)||[]).find(t=>i[t]&&Object.keys(i[t]).length>0)}toJSON(){return this.data}}var tQ={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,i,r,n,o){return t.forEach(t=>{i=this.processors[t]?.process(i,r,n,o)??i}),i}};let t0=Symbol("i18next/PATH_KEY");function t1(t,i){let r,n,o,{[t0]:a}=t((n=[],(o=Object.create(null)).get=(t,i)=>(r?.revoke?.(),i===t0)?n:(n.push(i),(r=Proxy.revocable(t,o)).proxy),Proxy.revocable(Object.create(null),o).proxy)),s=i?.keySeparator??".",l=i?.nsSeparator??":",c=i?.enableSelector==="strict";if(a.length>1&&l){let t=i?.ns,r=c?Array.isArray(t)?t:t?[t]:null:Array.isArray(t)?t:null;if(r&&(c?r:r.length>1?r.slice(1):[]).includes(a[0]))return`${a[0]}${l}${a.slice(1).join(s)}`}return a.join(s)}let t2=t=>!tP(t)&&"boolean"!=typeof t&&"number"!=typeof t;class t3 extends tJ{constructor(t,i={}){super(),((t,i,r)=>{t.forEach(t=>{i[t]&&(r[t]=i[t])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=i,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=tK.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,i={interpolation:{}}){let r={...i};if(null==t)return!1;let n=this.resolve(t,r);if(n?.res===void 0)return!1;let o=t2(n.res);return!1!==r.returnObjects||!o}extractFromKey(t,i){let r=void 0!==i.nsSeparator?i.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");let n=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,o=i.ns||this.options.defaultNS||[],a=r&&t.includes(r),s=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!((t,i,r)=>{i=i||"",r=r||"";let n=t$.filter(t=>!i.includes(t)&&!r.includes(t));if(0===n.length)return!0;let o=tq.getRegExp(`(${n.map(t=>"?"===t?"\\?":t).join("|")})`),a=!o.test(t);if(!a){let i=t.indexOf(r);i>0&&!o.test(t.substring(0,i))&&(a=!0)}return a})(t,r,n);if(a&&!s){let i=t.match(this.interpolator.nestingRegexp);if(i&&i.length>0)return{key:t,namespaces:tP(o)?[o]:o};let a=t.split(r);(r!==n||r===n&&this.options.ns.includes(a[0]))&&(o=a.shift()),t=a.join(n)}return{key:t,namespaces:tP(o)?[o]:o}}translate(t,i,r){let n="object"==typeof i?{...i}:i;if("object"!=typeof n&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof n&&(n={...n}),n||(n={}),null==t)return"";"function"==typeof t&&(t=t1(t,{...this.options,...n})),Array.isArray(t)||(t=[String(t)]),t=t.map(t=>"function"==typeof t?t1(t,{...this.options,...n}):String(t));let o=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,a=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,{key:s,namespaces:l}=this.extractFromKey(t[t.length-1],n),c=l[l.length-1],d=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===d&&(d=":");let u=n.lng||this.language,h=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u?.toLowerCase()==="cimode")return h?o?{res:`${c}${d}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${d}${s}`:o?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:s;let m=this.resolve(t,n),f=m?.res,p=m?.usedKey||s,_=m?.exactUsedKey||s,g=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,y=void 0!==n.count&&!tP(n.count),v=t3.hasDefaultValue(n),F=y?this.pluralResolver.getSuffix(u,n.count,n):"",x=n.ordinal&&y?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",w=y&&!n.ordinal&&0===n.count,E=w&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${F}`]||n[`defaultValue${x}`]||n.defaultValue,k=f;b&&!f&&v&&(k=E);let M=t2(k),D=Object.prototype.toString.apply(k);if(b&&k&&M&&!["[object Number]","[object Function]","[object RegExp]"].includes(D)&&!(tP(g)&&Array.isArray(k))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,k,{...n,ns:l}):`key '${s} (${this.language})' returned an object instead of string.`;return o?(m.res=t,m.usedParams=this.getUsedParamsDetails(n),m):t}if(a){let t=Array.isArray(k),i=t?[]:{},r=t?_:p;for(let t in k)if(Object.prototype.hasOwnProperty.call(k,t)){let o=`${r}${a}${t}`;v&&!f?i[t]=this.translate(o,{...n,defaultValue:t2(E)?E[t]:void 0,...{joinArrays:!1,ns:l}}):i[t]=this.translate(o,{...n,joinArrays:!1,ns:l}),i[t]===o&&(i[t]=k[t])}f=i}}else if(b&&tP(g)&&Array.isArray(f))(f=f.join(g))&&(f=this.extendTranslation(f,t,n,r));else{let i=!1,o=!1;!this.isValidLookup(f)&&v&&(i=!0,f=E),this.isValidLookup(f)||(o=!0,f=s);let l=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:f,h=v&&E!==f&&this.options.updateMissing;if(o||i||h){if(this.logger.log(h?"updateKey":"missingKey",u,c,y&&!h?`${s}${this.pluralResolver.getSuffix(u,n.count,n)}`:s,h?E:f),a){let t=this.resolve(s,{...n,keySeparator:!1});t&&t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let t=[],i=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&i&&i[0])for(let r=0;r<i.length;r++)t.push(i[r]);else"all"===this.options.saveMissingTo?t=this.languageUtils.toResolveHierarchy(n.lng||this.language):t.push(n.lng||this.language);let r=(t,i,r)=>{let o=v&&r!==f?r:l;this.options.missingKeyHandler?this.options.missingKeyHandler(t,c,i,o,h,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(t,c,i,o,h,n),this.emit("missingKey",t,c,i,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&y?t.forEach(t=>{let i=this.pluralResolver.getSuffixes(t,n);w&&n[`defaultValue${this.options.pluralSeparator}zero`]&&!i.includes(`${this.options.pluralSeparator}zero`)&&i.push(`${this.options.pluralSeparator}zero`),i.forEach(i=>{r([t],s+i,n[`defaultValue${i}`]||E)})}):r(t,s,E))}f=this.extendTranslation(f,t,n,m,r),o&&f===s&&this.options.appendNamespaceToMissingKey&&(f=`${c}${d}${s}`),(o||i)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${d}${s}`:s,i?f:void 0,n))}return o?(m.res=f,m.usedParams=this.getUsedParamsDetails(n),m):f}extendTranslation(t,i,r,n,o){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){let a;r.interpolation&&this.interpolator.init({...r,...{interpolation:{...this.options.interpolation,...r.interpolation}}});let s=tP(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){let i=t.match(this.interpolator.nestingRegexp);a=i&&i.length}let l=r.replace&&!tP(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),t=this.interpolator.interpolate(t,l,r.lng||this.language||n.usedLng,r),s){let i=t.match(this.interpolator.nestingRegexp);a<(i&&i.length)&&(r.nest=!1)}!r.lng&&n&&n.res&&(r.lng=this.language||n.usedLng),!1!==r.nest&&(t=this.interpolator.nest(t,(...t)=>o?.[0]!==t[0]||r.context?this.translate(...t,i):(this.logger.warn(`It seems you are nesting recursively key: ${t[0]} in key: ${i[0]}`),null),r)),r.interpolation&&this.interpolator.reset()}let a=r.postProcess||this.options.postProcess,s=tP(a)?[a]:a;return null!=t&&s?.length&&!1!==r.applyPostProcessor&&(t=tQ.handle(s,t,i,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,i={}){let r,n,o,a,s;return tP(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(t=>"function"==typeof t?t1(t,{...this.options,...i}):t)),t.forEach(t=>{if(this.isValidLookup(r))return;let l=this.extractFromKey(t,i),c=l.key;n=c;let d=l.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));let u=void 0!==i.count&&!tP(i.count),h=u&&!i.ordinal&&0===i.count,m=void 0!==i.context&&(tP(i.context)||"number"==typeof i.context)&&""!==i.context,f=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);d.forEach(t=>{this.isValidLookup(r)||(s=t,!this.checkedLoadedFor[`${f[0]}-${t}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(this.checkedLoadedFor[`${f[0]}-${t}`]=!0,this.logger.warn(`key "${n}" for languages "${f.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach(n=>{let s;if(this.isValidLookup(r))return;a=n;let l=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(l,c,n,t,i);else{let t;u&&(t=this.pluralResolver.getSuffix(n,i.count,i));let r=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(i.ordinal&&t.startsWith(o)&&l.push(c+t.replace(o,this.options.pluralSeparator)),l.push(c+t),h&&l.push(c+r)),m){let n=`${c}${this.options.contextSeparator||"_"}${i.context}`;l.push(n),u&&(i.ordinal&&t.startsWith(o)&&l.push(n+t.replace(o,this.options.pluralSeparator)),l.push(n+t),h&&l.push(n+r))}}for(;s=l.pop();)this.isValidLookup(r)||(o=s,r=this.getResource(n,t,s,i))}))})}),{res:r,usedKey:n,exactUsedKey:o,usedLng:a,usedNS:s}}isValidLookup(t){return void 0!==t&&!(!this.options.returnNull&&null===t)&&!(!this.options.returnEmptyString&&""===t)}getResource(t,i,r,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,i,r,n):this.resourceStore.getResource(t,i,r,n)}getUsedParamsDetails(t={}){let i=t.replace&&!tP(t.replace),r=i?t.replace:t;if(i&&void 0!==t.count&&(r={...r,count:t.count}),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!i)for(let t of(r={...r},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete r[t];return r}static hasDefaultValue(t){for(let i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&i.startsWith("defaultValue")&&void 0!==t[i])return!0;return!1}}class t5{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=tK.create("languageUtils")}getScriptPartFromCode(t){if(!(t=tW(t))||!t.includes("-"))return null;let i=t.split("-");return 2===i.length||(i.pop(),"x"===i[i.length-1].toLowerCase())?null:this.formatLanguageCode(i.join("-"))}getLanguagePartFromCode(t){if(!(t=tW(t))||!t.includes("-"))return t;let i=t.split("-");return this.formatLanguageCode(i[0])}formatLanguageCode(t){if(tP(t)&&t.includes("-")){let i;try{i=Intl.getCanonicalLocales(t)[0]}catch(t){}return(i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i)?i:this.options.lowerCaseLng?t.toLowerCase():t}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(t)}getBestMatchFromCodes(t){let i;return t?(t.forEach(t=>{if(i)return;let r=this.formatLanguageCode(t);(!this.options.supportedLngs||this.isSupportedCode(r))&&(i=r)}),!i&&this.options.supportedLngs&&t.forEach(t=>{if(i)return;let r=this.getScriptPartFromCode(t);if(this.isSupportedCode(r))return i=r;let n=this.getLanguagePartFromCode(t);if(this.isSupportedCode(n))return i=n;i=this.options.supportedLngs.find(t=>t===n||(!!t.includes("-")||!!n.includes("-"))&&!!(t.includes("-")&&!n.includes("-")&&t.slice(0,t.indexOf("-"))===n||t.startsWith(n)&&n.length>1))}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i):null}getFallbackCodes(t,i){if(!t)return[];if("function"==typeof t&&(t=t(i)),tP(t)&&(t=[t]),Array.isArray(t))return t;if(!i)return t.default||[];let r=t[i];return r||(r=t[this.getScriptPartFromCode(i)]),r||(r=t[this.formatLanguageCode(i)]),r||(r=t[this.getLanguagePartFromCode(i)]),r||(r=t.default),r||[]}toResolveHierarchy(t,i){let r=this.getFallbackCodes((!1===i?[]:i)||this.options.fallbackLng||[],t),n=[],o=t=>{t&&(this.isSupportedCode(t)?n.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return tP(t)&&(t.includes("-")||t.includes("_"))?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(t))):tP(t)&&o(this.formatLanguageCode(t)),r.forEach(t=>{n.includes(t)||o(this.formatLanguageCode(t))}),n}}let t4={zero:0,one:1,two:2,few:3,many:4,other:5},t6={select:t=>1===t?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class t8{constructor(t,i={}){this.languageUtils=t,this.options=i,this.logger=tK.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,i={}){let r,n=tW("dev"===t?"en":t),o=i.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:o});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];try{r=new Intl.PluralRules(n,{type:o})}catch(o){if("u"<typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),t6;if(!t.match(/-|_/))return t6;let n=this.languageUtils.getLanguagePartFromCode(t);r=this.getRule(n,i)}return this.pluralRulesCache[a]=r,r}needsPlural(t,i={}){let r=this.getRule(t,i);return r||(r=this.getRule("dev",i)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,i,r={}){return this.getSuffixes(t,r).map(t=>`${i}${t}`)}getSuffixes(t,i={}){let r=this.getRule(t,i);return(r||(r=this.getRule("dev",i)),r)?r.resolvedOptions().pluralCategories.sort((t,i)=>t4[t]-t4[i]).map(t=>`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${t}`):[]}getSuffix(t,i,r={}){let n=this.getRule(t,r);return n?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${n.select(i)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",i,r))}}let t7=(t,i,r,n=".",o=!0)=>{let a,s=void 0!==(a=tN(t,r))?a:tN(i,r);return!s&&o&&tP(r)&&void 0===(s=tG(t,r,n))&&(s=tG(i,r,n)),s},t9=t=>t.replace(/\$/g,"$$$$");class ie{constructor(t={}){this.logger=tK.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(t=>t),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});let{escape:i,escapeValue:r,useRawValueToEscape:n,prefix:o,prefixEscaped:a,suffix:s,suffixEscaped:l,formatSeparator:c,unescapeSuffix:d,unescapePrefix:u,nestingPrefix:h,nestingPrefixEscaped:m,nestingSuffix:f,nestingSuffixEscaped:p,nestingOptionsSeparator:_,maxReplaces:g,alwaysFormat:b}=t.interpolation;this.escape=void 0!==i?i:tV,this.escapeValue=void 0===r||r,this.useRawValueToEscape=void 0!==n&&n,this.prefix=o?o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):a||"{{",this.suffix=s?s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=d?"":u?u.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):"-",this.unescapeSuffix=this.unescapePrefix?"":d?d.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):"",this.nestingPrefix=h?h.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):m||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=f?f.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):p||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=_||",",this.maxReplaces=g||1e3,this.alwaysFormat=void 0!==b&&b,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let t=(t,i)=>t?.source===i?(t.lastIndex=0,t):RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,i,r,n){let o,a,s,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=t=>{if(!t.includes(this.formatSeparator)){let o=t7(i,l,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,r,{...n,...i,interpolationkey:t}):o}let o=t.split(this.formatSeparator),a=o.shift().trim(),s=o.join(this.formatSeparator).trim();return this.format(t7(i,l,a,this.options.keySeparator,this.options.ignoreJSONStructure),s,r,{...n,...i,interpolationkey:a})};this.resetRegExp(),!this.escapeValue&&"string"==typeof t&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");let d=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:t=>t},{regex:this.regexp,safeValue:t=>this.escapeValue?this.escape(t):t}].forEach(i=>{for(s=0;o=i.regex.exec(t);){let r=o[1].trim();if(void 0===(a=c(r)))if("function"==typeof d){let i=d(t,o,n);a=tP(i)?i:""}else if(n&&Object.prototype.hasOwnProperty.call(n,r))a="";else if(u){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${r} for interpolating ${t}`),a="";else tP(a)||this.useRawValueToEscape||(a=tR(a));let l=i.safeValue(a);if(t=t.replace(o[0],t9(l)),u?(i.regex.lastIndex+=l.length,i.regex.lastIndex-=o[0].length):i.regex.lastIndex=0,++s>=this.maxReplaces)break}}),t}nest(t,i,r={}){let n,o,a,s=(t,i)=>{let r=this.nestingOptionsSeparator;if(!t.includes(r))return t;let n=t.split(RegExp(`${r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}[ ]*{`)),o=`{${n[1]}`;t=n[0];let s=(o=this.interpolate(o,a)).match(/'/g),l=o.match(/"/g);((s?.length??0)%2!=0||l)&&(l?.length??0)%2==0||(o=o.replace(/'/g,'"'));try{a=JSON.parse(o),i&&(a={...i,...a})}catch(i){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,i),`${t}${r}${o}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,t};for(;n=this.nestingRegexp.exec(t);){let l=[];(a=(a={...r}).replace&&!tP(a.replace)?a.replace:a).applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/s.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(-1!==c&&(l=n[1].slice(c).split(this.formatSeparator).map(t=>t.trim()).filter(Boolean),n[1]=n[1].slice(0,c)),(o=i(s.call(this,n[1].trim(),a),a))&&n[0]===t&&!tP(o))return o;tP(o)||(o=tR(o)),o||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${t}`),o=""),l.length&&(o=l.reduce((t,i)=>this.format(t,i,r.lng,{...r,interpolationkey:n[1].trim()}),o.trim())),t=t.replace(n[0],o),this.regexp.lastIndex=0}return t}}let it=t=>{let i={};return(r,n,o)=>{let a=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(a={...a,[o.interpolationkey]:void 0});let s=n+JSON.stringify(a),l=i[s];return l||(l=t(tW(n),o),i[s]=l),l(r)}},ii=t=>(i,r,n)=>t(tW(r),n)(i);class ir{constructor(t={}){this.logger=tK.create("formatter"),this.options=t,this.init(t)}init(t,i={interpolation:{}}){this.formatSeparator=i.interpolation.formatSeparator||",";let r=i.cacheInBuiltFormats?it:ii;this.formats={number:r((t,i)=>{let r=new Intl.NumberFormat(t,{...i});return t=>r.format(t)}),currency:r((t,i)=>{let r=new Intl.NumberFormat(t,{...i,style:"currency"});return t=>r.format(t)}),datetime:r((t,i)=>{let r=new Intl.DateTimeFormat(t,{...i});return t=>r.format(t)}),relativetime:r((t,i)=>{let r=new Intl.RelativeTimeFormat(t,{...i});return t=>r.format(t,i.range||"day")}),list:r((t,i)=>{let r=new Intl.ListFormat(t,{...i});return t=>r.format(t)})}}add(t,i){this.formats[t.toLowerCase().trim()]=i}addCached(t,i){this.formats[t.toLowerCase().trim()]=it(i)}format(t,i,r,n={}){if(!i||null==t)return t;let o=i.split(this.formatSeparator),a=[];for(let t=0;t<o.length;t++){let i=o[t];for(;i.indexOf("(")>-1&&!i.includes(")")&&t+1<o.length;)i=`${i}${this.formatSeparator}${o[++t]}`;a.push(i)}return a.reduce((t,i)=>{let{formatName:o,formatOptions:a}=(t=>{let i=t.toLowerCase().trim(),r={};if(t.includes("(")){let n=t.split("(");i=n[0].toLowerCase().trim();let o=n[1].slice(0,-1);"currency"!==i||o.includes(":")?"relativetime"!==i||o.includes(":")?o.split(";").forEach(t=>{if(t){let[i,...n]=t.split(":"),o=n.join(":").trim().replace(/^'+|'+$/g,""),a=i.trim();r[a]||(r[a]=o),"false"===o&&(r[a]=!1),"true"===o&&(r[a]=!0),isNaN(o)||(r[a]=parseInt(o,10))}}):r.range||(r.range=o.trim()):r.currency||(r.currency=o.trim())}return{formatName:i,formatOptions:r}})(i);if(this.formats[o]){let i=t;try{let s=n?.formatParams?.[n.interpolationkey]||{},l=s.locale||s.lng||n.locale||n.lng||r;i=this.formats[o](t,l,{...a,...n,...s})}catch(t){this.logger.warn(t)}return i}return this.logger.warn(`there was no format function for ${o}`),t},t)}}class io extends tJ{constructor(t,i,r,n={}){super(),this.backend=t,this.store=i,this.services=r,this.languageUtils=r.languageUtils,this.options=n,this.logger=tK.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,n.backend,n)}queueLoad(t,i,r,n){let o={},a={},s={},l={};return t.forEach(t=>{let n=!0;i.forEach(i=>{let s=`${t}|${i}`;!r.reload&&this.store.hasResourceBundle(t,i)?this.state[s]=2:this.state[s]<0||(1===this.state[s]?void 0===a[s]&&(a[s]=!0):(this.state[s]=1,n=!1,void 0===a[s]&&(a[s]=!0),void 0===o[s]&&(o[s]=!0),void 0===l[i]&&(l[i]=!0)))}),n||(s[t]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,i,r){let n=t.split("|"),o=n[0],a=n[1];i&&this.emit("failedLoading",o,a,i),!i&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=i?-1:2,i&&r&&(this.state[t]=0);let s={};this.queue.forEach(r=>{((t,i,r)=>{let{obj:n,k:o}=tY(t,i,Object);n[o]=n[o]||[],n[o].push(r)})(r.loaded,[o],a),void 0!==r.pending[t]&&(delete r.pending[t],r.pendingCount--),i&&r.errors.push(i),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach(t=>{s[t]||(s[t]={});let i=r.loaded[t];i.length&&i.forEach(i=>{void 0===s[t][i]&&(s[t][i]=!0)})}),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(t=>!t.done)}read(t,i,r,n=0,o=this.retryTimeout,a){if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:t,ns:i,fcName:r,tried:n,wait:o,callback:a});this.readingCalls++;let s=(s,l)=>{if(this.readingCalls--,this.waitingReads.length>0){let t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}s&&l&&n<this.maxRetries?setTimeout(()=>{this.read(t,i,r,n+1,2*o,a)},o):a(s,l)},l=this.backend[r].bind(this.backend);if(2===l.length){try{let r=l(t,i);r&&"function"==typeof r.then?r.then(t=>s(null,t)).catch(s):s(null,r)}catch(t){s(t)}return}return l(t,i,s)}prepareLoading(t,i,r={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();tP(t)&&(t=this.languageUtils.toResolveHierarchy(t)),tP(i)&&(i=[i]);let o=this.queueLoad(t,i,r,n);if(!o.toLoad.length)return o.pending.length||n(),null;o.toLoad.forEach(t=>{this.loadOne(t)})}load(t,i,r){this.prepareLoading(t,i,{},r)}reload(t,i,r){this.prepareLoading(t,i,{reload:!0},r)}loadOne(t,i=""){let r=t.split("|"),n=r[0],o=r[1];this.read(n,o,"read",void 0,void 0,(r,a)=>{r&&this.logger.warn(`${i}loading namespace ${o} for language ${n} failed`,r),!r&&a&&this.logger.log(`${i}loaded namespace ${o} for language ${n}`,a),this.loaded(t,r,a)})}saveMissing(t,i,r,n,o,a={},s=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(i))return void this.logger.warn(`did not save key "${r}" as the namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");if(null!=r&&""!==r){if(this.backend?.create){let l={...a,isUpdate:o},c=this.backend.create.bind(this.backend);if(c.length<6)try{let o;(o=5===c.length?c(t,i,r,n,l):c(t,i,r,n))&&"function"==typeof o.then?o.then(t=>s(null,t)).catch(s):s(null,o)}catch(t){s(t)}else c(t,i,r,n,s,l)}t&&t[0]&&this.store.addResource(t[0],i,r,n)}}}let ia=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let i={};if("object"==typeof t[1]&&(i=t[1]),tP(t[1])&&(i.defaultValue=t[1]),tP(t[2])&&(i.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){let r=t[3]||t[2];Object.keys(r).forEach(t=>{i[t]=r[t]})}return i},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),is=t=>(tP(t.ns)&&(t.ns=[t.ns]),tP(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),tP(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&!t.supportedLngs.includes("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),il=()=>{};class ic extends tJ{constructor(t={},i){if(super(),this.options=is(t),this.services={},this.logger=tK,this.modules={external:[]},(t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(i=>{"function"==typeof t[i]&&(t[i]=t[i].bind(t))})})(this),i&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,i),this;setTimeout(()=>{this.init(t,i)},0)}}init(t={},i){this.isInitializing=!0,"function"==typeof t&&(i=t,t={}),null==t.defaultNS&&t.ns&&(tP(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));let r=ia();this.options={...r,...this.options,...is(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler);let n=t=>t?"function"==typeof t?new t:t:null;if(!this.options.isClone){let t;this.modules.logger?tK.init(n(this.modules.logger),this.options):tK.init(null,this.options),t=this.modules.formatter?this.modules.formatter:ir;let i=new t5(this.options);this.store=new tX(this.options.resources,this.options);let r=this.services;r.logger=tK,r.resourceStore=this.store,r.languageUtils=i,r.pluralResolver=new t8(i,{prepend:this.options.pluralSeparator}),t&&(r.formatter=n(t),r.formatter.init&&r.formatter.init(r,this.options),this.options.interpolation.format=r.formatter.format.bind(r.formatter)),r.interpolator=new ie(this.options),r.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},r.backendConnector=new io(n(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",(t,...i)=>{this.emit(t,...i)}),this.modules.languageDetector&&(r.languageDetector=n(this.modules.languageDetector),r.languageDetector.init&&r.languageDetector.init(r,this.options.detection,this.options)),this.modules.i18nFormat&&(r.i18nFormat=n(this.modules.i18nFormat),r.i18nFormat.init&&r.i18nFormat.init(this)),this.translator=new t3(this.services,this.options),this.translator.on("*",(t,...i)=>{this.emit(t,...i)}),this.modules.external.forEach(t=>{t.init&&t.init(this)})}if(this.format=this.options.interpolation.format,i||(i=il),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(t=>{this[t]=(...i)=>this.store[t](...i)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(t=>{this[t]=(...i)=>(this.store[t](...i),this)});let o=tI(),a=()=>{let t=(t,r)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(r),i(t,r)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),o}loadResources(t,i=il){let r=i,n=tP(t)?t:this.language;if("function"==typeof t&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(n?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return r();let t=[],i=i=>{i&&"cimode"!==i&&this.services.languageUtils.toResolveHierarchy(i).forEach(i=>{"cimode"!==i&&(t.includes(i)||t.push(i))})};n?i(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(t=>i(t)),this.options.preload?.forEach?.(t=>i(t)),this.services.backendConnector.load(t,this.options.ns,t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),r(t)})}else r(null)}reloadResources(t,i,r){let n=tI();return"function"==typeof t&&(r=t,t=void 0),"function"==typeof i&&(r=i,i=void 0),t||(t=this.languages),i||(i=this.options.ns),r||(r=il),this.services.backendConnector.reload(t,i,t=>{n.resolve(),r(t)}),n}use(t){if(!t)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&tQ.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!["cimode","dev"].includes(t)){for(let t=0;t<this.languages.length;t++){let i=this.languages[t];if(!["cimode","dev"].includes(i)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&!this.languages.includes(t)&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,i){this.isLanguageChangingTo=t;let r=tI();this.emit("languageChanging",t);let n=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},o=(o,a)=>{a?this.isLanguageChangingTo===t&&(n(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit("languageChanged",a),this.logger.log("languageChanged",a)):this.isLanguageChangingTo=void 0,r.resolve((...t)=>this.t(...t)),i&&i(o,(...t)=>this.t(...t))},a=i=>{t||i||!this.services.languageDetector||(i=[]);let r=tP(i)?i:i&&i[0],a=this.store.hasLanguageSomeTranslations(r)?r:this.services.languageUtils.getBestMatchFromCodes(tP(i)?[i]:i);a&&(this.language||n(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,t=>{o(t,a)})};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t):a(this.services.languageDetector.detect()),r}getFixedT(t,i,r,n){let o=n?.scopeNs,a=(t,i,...n)=>{let s,l;(s="object"!=typeof i?this.options.overloadTranslationOptionHandler([t,i].concat(n)):{...i}).lng=s.lng||a.lng,s.lngs=s.lngs||a.lngs;let c=void 0!==s.ns&&null!==s.ns;s.ns=s.ns||a.ns,""!==s.keyPrefix&&(s.keyPrefix=s.keyPrefix||r||a.keyPrefix);let d={...this.options,...s};Array.isArray(o)&&!c&&(d.ns=o),"function"==typeof s.keyPrefix&&(s.keyPrefix=t1(s.keyPrefix,d));let u=this.options.keySeparator||".";return s.keyPrefix&&Array.isArray(t)?l=t.map(t=>("function"==typeof t&&(t=t1(t,d)),`${s.keyPrefix}${u}${t}`)):("function"==typeof t&&(t=t1(t,d)),l=s.keyPrefix?`${s.keyPrefix}${u}${t}`:t),this.t(l,s)};return tP(t)?a.lng=t:a.lngs=t,a.ns=i,a.keyPrefix=r,a}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,i={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let r=i.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;let a=(t,i)=>{let r=this.services.backendConnector.state[`${t}|${i}`];return -1===r||0===r||2===r};if(i.precheck){let t=i.precheck(this,a);if(void 0!==t)return t}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!n||a(o,t)))}loadNamespaces(t,i){let r=tI();return this.options.ns?(tP(t)&&(t=[t]),t.forEach(t=>{this.options.ns.includes(t)||this.options.ns.push(t)}),this.loadResources(t=>{r.resolve(),i&&i(t)}),r):(i&&i(),Promise.resolve())}loadLanguages(t,i){let r=tI();tP(t)&&(t=[t]);let n=this.options.preload||[],o=t.filter(t=>!n.includes(t)&&this.services.languageUtils.isSupportedCode(t));return o.length?(this.options.preload=n.concat(o),this.loadResources(t=>{r.resolve(),i&&i(t)}),r):(i&&i(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{let i=new Intl.Locale(t);if(i&&i.getTextInfo){let t=i.getTextInfo();if(t&&t.direction)return t.direction}}catch(t){}let i=this.services?.languageUtils||new t5(ia());return t.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].includes(i.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},i){let r=new ic(t,i);return r.createInstance=ic.createInstance,r}cloneInstance(t={},i=il){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let n={...this.options,...t,isClone:!0},o=new ic(n);if((void 0!==t.debug||void 0!==t.prefix)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(t=>{o[t]=this[t]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new tX(Object.keys(this.store.data).reduce((t,i)=>(t[i]={...this.store.data[i]},t[i]=Object.keys(t[i]).reduce((r,n)=>(r[n]={...t[i][n]},r),t[i]),t),{}),n),o.services.resourceStore=o.store),t.interpolation){let i={...ia().interpolation,...this.options.interpolation,...t.interpolation},r={...n,interpolation:i};o.services.interpolator=new ie(r)}return o.translator=new t3(o.services,n),o.translator.on("*",(t,...i)=>{o.emit(t,...i)}),o.init(n,i),o.translator.options=n,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let id=ic.createInstance();id.createInstance,id.dir,id.init,id.loadResources,id.reloadResources,id.use,id.changeLanguage,id.getFixedT,id.t,id.exists,id.setDefaultNamespace,id.hasLoadedNamespace,id.loadNamespaces,id.loadLanguages;var iu=r(4867),ih=r.n(iu);r(3472);class im{get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promise}constructor(){this._promise=new Promise((t,i)=>{this._resolve=t,this._reject=i}),Object.freeze(this)}}function ip(t,i,r=!0){if(null==t||null==i)return t===i;if(t.constructor!==i.constructor)return!1;if(t instanceof Function||t instanceof RegExp)return t===i;if(t===i||t.valueOf()===i.valueOf())return!0;if(Array.isArray(t)&&t.length!==i.length||t instanceof Date||!(t instanceof Object)||!(i instanceof Object))return!1;if(r){if(Array.isArray(t))return t.every((t,r)=>ip(t,i[r]));let r=Object.keys(t);return Object.keys(i).every(t=>-1!==r.indexOf(t))&&r.every(r=>ip(t[r],i[r]))}return!1}function i_(t){if(null==t)return"";let i=!1;return t.split(/([A-Z]|\d)/).map((t,r,n)=>{if(!t)return t;if(!i)return i=!0,t.charAt(0).toUpperCase()+t.slice(1);if("_"===t)return" ";if(1===t.length&&t===t.toUpperCase()){let i=!n[r-1]||"_"===n[r-1],o=r+1<n.length&&n[r+1]&&"_"!==n[r+1],a=r+3>n.length||!n[r+1]&&!n[r+3];(!i||o)&&(t=" "+t),!o&&(i||a)||(t=t.toLowerCase())}return t}).join("").trim()}function ig(t,i,r){let n="string"==typeof t?t:t.name;return i&&i.meta&&i.meta.hasOwnProperty(n)?i.meta[n]:r&&r.meta?r.meta[n]:void 0}function ib(t){return("string"==typeof t&&(t=tL.getAssetDescriptor(t)),t)?id.t("label.asset."+t.name,{defaultValue:i_(t.name)}):""}function iy(t,i,r,n,o,a){let s=function(t,i,r,n){let o="";if(null==t)o=n||"";else if("string"==typeof t)o=t;else if("number"==typeof t||"boolean"==typeof t||t instanceof Date){let n=i&&i();if(n&&0!==Object.keys(n).length)switch("number"==typeof t?n.asBoolean?t=!!t:n.asDate&&(t=new Date(t)):"boolean"==typeof t&&n.asNumber&&(t=+!!t),typeof t){case"number":o=new Intl.NumberFormat(r||id.language,n).format(t);break;case"boolean":n.asOnOff&&(o=t?id.t("on"):id.t("off")),n.asOpenClosed&&(o=t?id.t("open"):id.t("closed")),n.asPressedReleased&&(o=t?id.t("pressed"):id.t("released"));break;case"object":if(n.momentJsFormat)o=ih()(t).format(n.momentJsFormat);else if(n.iso8601)o=t.toISOString();else if(n.week){var a;let i,r=((a=new Date(Date.UTC((a=t).getFullYear(),a.getMonth(),a.getDate()))).setUTCDate(a.getUTCDate()+4-(a.getUTCDay()||7)),i=new Date(Date.UTC(a.getUTCFullYear(),0,1)),Math.ceil(((a.getTime()-i.getTime())/864e5+1)/7));o="2-digit"===n.week?String(r).padStart(2,"0"):Number(r).toString(10)}else o=new Intl.DateTimeFormat(r||id.language,n).format(t)}else o=Object(t).toString()}return o}(t?t.value:void 0,()=>iF("format",t,i,r,o),void 0,a),l=iF("units",t,i,r,!0);return n&&l&&l.length&&(s=iv(iF("units",t,i,r,o),s)),s}function iv(t,i){if(!t)return"";i||(i="");let r=t.map((t,r)=>{if(3!==t.length||t.toUpperCase()!==t)return id.t(["units."+t,"or:units."+t]);{let n=new Intl.NumberFormat(id.language,{currency:t,style:"currency"}).formatToParts();if(0!==r||"currency"!==n[0].type)return"currency"===n[0].type?n[0].value:n[n.length-1].value;if(!i)return n[0].value;i=n[0].value+i}}).join("");return i.length>0?i+" "+r:r}function iF(t,i,r,n,o){let a,s=[],l=ix(t,i&&"string"==typeof i?i:i?i.name:r?"string"==typeof r?r:r.name:void 0,r,n,o);if(l&&(a=JSON.parse(l)))if("format"!==t)return a;else s.push(a);if(i&&i.meta&&(a=ig(t,i,r)))if("format"!==t)return a;else s.push(a);if(r&&"string"!=typeof r&&r.hasOwnProperty(t)){if(a=r[t],"format"!==t)return a;s.push(a)}if(r&&r.type){if(a=tL.getValueDescriptor(r.type)[t],"format"!==t)return a;s.push(a)}if("format"!==t||0===s.length)return a;let c={};return s.reverse().forEach(t=>{c=Object.assign(Object.assign({},c),t)}),c}function ix(t,i,r,n,o,a){let s;if(i?s="string"==typeof i?i:i.name:r&&(s="string"==typeof r?r:r.name),!s)return;let l=[],c=t+"."+(o?"attribute":"meta")+".";if(n&&l.push(c+n+"."+s),r&&"string"!=typeof r&&(l.push(c+r.type+"."+s),l.push(c+r.type)),l.push(c+s),l.length>0)return id.t(l,{defaultValue:a||""})}function iw(t,i){let r=i.ref.name;if(t.attributes)if(i.deleted)delete t.attributes[r];else{let n=t.attributes[r];n&&(n.value=i.value,n.timestamp=i.timestamp)}return Object.assign({},t)}class iE{constructor(t){t&&Object.assign(this,t)}matches(t){var i,r,n,o,a,s,l;if((null==(i=this.ids)?void 0:i.length)&&(!t.id||!this.ids.includes(t.id))||(null==(r=this.types)?void 0:r.length)&&(!t.type||!this.types.includes(t.type))||(null==(n=this.realm)?void 0:n.name)&&t.realm!==this.realm.name||(null==(o=this.parents)?void 0:o.length)&&!this.parents.some(i=>!i.id||t.parentId===i.id))return!1;if(null==(a=this.paths)?void 0:a.length){let i=null!=(s=t.path)?s:[];if(!this.paths.some(t=>{var r;return(null!=(r=t.path)?r:[]).every((t,r)=>i[r]===t)}))return!1}return(null==(l=this.names)||!l.length||!!this.names.every(i=>iE._evalValuePredicate(t.name,i)))&&(!this.attributes||iE._evalGroup(t,this.attributes))}static getUnsupportedFields(t){return Object.keys(t).filter(t=>!iE._SUPPORTED_FIELDS.has(t))}collectAttributeNames(){return this.attributes?iE._collectNames(this.attributes):[]}static _evalValuePredicate(t,i){var r;switch(i.predicateType){case"string":{let n;if(null==t)return!1;let o=!1!==i.caseSensitive?String(t):String(t).toLowerCase(),a=!1!==i.caseSensitive?i.value:null==(r=i.value)?void 0:r.toLowerCase();switch(i.match){case"BEGIN":n=o.startsWith(a);break;case"END":n=o.endsWith(a);break;case"CONTAINS":n=o.includes(a);break;default:n=o===a}return i.negate?!n:n}case"boolean":return t===i.value;case"number":{let r;if("number"!=typeof t)return!1;switch(i.operator){case"GREATER_THAN":r=t>i.value;break;case"GREATER_EQUALS":r=t>=i.value;break;case"LESS_THAN":r=t<i.value;break;case"LESS_EQUALS":r=t<=i.value;break;case"BETWEEN":r=t>=i.value&&t<=i.rangeValue;break;default:r=t===i.value}return i.negate?!r:r}}return!1}static _evalPredicate(t,i){var r,n;let o=null==(r=i.name)?void 0:r.value;if(!o)return!0;let a=null==(n=t.attributes)?void 0:n[o];if(!a)return!!i.negated;let s=!i.value||iE._evalValuePredicate(a.value,i.value);return i.negated?!s:s}static _evalGroup(t,i){var r,n,o;let a=null!=(r=i.operator)?r:"AND",s=[...(null!=(n=i.items)?n:[]).map(i=>iE._evalPredicate(t,i)),...(null!=(o=i.groups)?o:[]).map(i=>iE._evalGroup(t,i))];return!s.length||("OR"===a?s.some(Boolean):s.every(Boolean))}static _collectNames(t){var i,r;return[...(null!=(i=t.items)?i:[]).map(t=>{var i;return null==(i=t.name)?void 0:i.value}).filter(t=>!!t),...(null!=(r=t.groups)?r:[]).flatMap(t=>iE._collectNames(t))]}}iE._SUPPORTED_FIELDS=new Set(["ids","types","names","parents","paths","realm","attributes"]);var ik=function(t,i,r,n){return new(r||(r=Promise))(function(o,a){function s(t){try{c(n.next(t))}catch(t){a(t)}}function l(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var i;t.done?o(t.value):((i=t.value)instanceof r?i:new r(function(t){t(i)})).then(s,l)}c((n=n.apply(t,i||[])).next())})};let iM=r(4461);class iD{constructor(t,i,r){this._autoEnable=!1,this._initialised=!1,this._initialiseInProgress=!1,this._pendingProviderPromises={},this._providerMessageListeners={},this._pendingProviderEnables=[],this._registrationTimer=null,this._realm=t,this._autoEnable=i,this._enableCompleteCallback=r,window.OpenRemoteConsole=this;let n=new URLSearchParams(window.location.search),o=n.get("consoleName"),a=n.get("consoleVersion"),s=n.get("consolePlatform"),l=n.get("consoleProviders"),c=n.get("consoleAutoEnable"),d=l&&l.length>0?l.split(" "):["push"];this._pendingProviderEnables=d;let u=iD._createConsoleRegistration(),h=window.localStorage.getItem(this._storageKey);if(h)try{let t=JSON.parse(h);t.id&&(u.id=t.id),t.name&&(u.name=t.name),t.providers&&(u.providers=t.providers),t.apps&&(u.apps=t.apps)}catch(t){console.error("Failed to deserialise console registration")}let m=u.providers;for(let t of(u.providers={},d)){let i=m&&m.hasOwnProperty(t)?m[t]:{enabled:!1,disabled:!1};u.providers[t]=i}let f=sk.getAppName();f.length>0&&0>u.apps.indexOf(f)&&u.apps.push(f),this._registration=u,o&&(u.name=o),a&&(u.version=a),s&&(u.platform=s),c&&(this._autoEnable="TRUE"===c||"true"===c)}get registration(){return this._registration}get autoEnable(){return this._autoEnable}get pendingProviderEnables(){return this._pendingProviderEnables.slice(0)}get shellApple(){let t=navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform:navigator.platform;return t&&("iP"===t.substring(0,2)||"Mac"===t.substring(0,3))&&window.webkit&&window.webkit.messageHandlers}get shellAndroid(){return!!window.MobileInterface}get isMobile(){return this.shellApple||this.shellAndroid}initialise(){return ik(this,void 0,void 0,function*(){if(!this._initialised&&!this._initialiseInProgress){console.debug("Console: initialising"),this._initialiseInProgress=!0;try{if(this._registration.providers)for(let t of Object.keys(this._registration.providers))yield this._initialiseProvider(t);this._registration.id||(yield this.sendRegistration()),this._initialised=!0,this._initialiseInProgress=!1,0===this._pendingProviderEnables.length?(yield this.sendRegistration(),this._callCompletedCallback()):this._autoEnable&&(yield this.enableProviders())}catch(t){console.error(t)}finally{this._initialiseInProgress=!1}}})}enableProviders(){return ik(this,void 0,void 0,function*(){if(!this._initialised)throw Error("Console must be initialised before enabling providers");for(let t=this._pendingProviderEnables.length-1;t>-1;t--){let i=this._pendingProviderEnables[t];yield this.enableProvider(i)}})}enableProvider(t,i){return ik(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before enabling providers");if(!this._registration.providers.hasOwnProperty(t))throw console.debug("Invalid console provider '"+t+"'"),Error("Invalid console provider '"+t+"'");console.debug("Console: enabling provider '"+t+"'");let r={provider:t,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:i},n=yield this.sendProviderMessage(r,!0);this._registration.providers[t].hasPermission=n.hasPermission,this._registration.providers[t].success=n.success,this._registration.providers[t].enabled=n.success,this._registration.providers[t].data=n.data;let o=this._pendingProviderEnables.indexOf(t);return o>=0&&(this._pendingProviderEnables.splice(o,1),0===this._pendingProviderEnables.length&&(this.sendRegistration().catch(()=>void 0),this._callCompletedCallback())),n})}disableProvider(t){return ik(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before disabling providers");if(!this._registration.providers.hasOwnProperty(t))throw console.debug("Invalid console provider '"+t+"'"),Error("Invalid console provider '"+t+"'");console.debug("Console: disabling provider '"+t+"'");let i=yield this.sendProviderMessage({provider:t,action:"PROVIDER_DISABLE"},!0);return this._registration.providers[t].disabled=!0,this._registration.providers[t].enabled=!1,i})}getProvider(t){return this._registration&&this._registration.providers?this._registration.providers[t]:void 0}sendProviderMessage(t,i){return ik(this,void 0,void 0,function*(){if("storage"!==t.provider&&!this._registration.providers.hasOwnProperty(t.provider))throw console.debug("Invalid console provider '"+t.provider+"'"),Error("Invalid console provider '"+t.provider+"'");if(!i)return void this._doSendProviderMessage(t);let r=t.provider+t.action;if(this._pendingProviderPromises[r])throw Error("Message already pending for provider '"+t.provider+"' with action '"+t.action+"'");let n=new im,o=()=>{delete this._pendingProviderPromises[r],n.reject("No response from provider")};return this._pendingProviderPromises[r]=[n,window.setTimeout(o,5e3)],this._doSendProviderMessage(t),n.promise})}sendRegistration(){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),new Promise((t,i)=>{this._registrationTimer=window.setTimeout(()=>ik(this,void 0,void 0,function*(){this._registrationTimer=null,console.debug("Console: updating registration");try{yield this._sendRegistration(!0),t()}catch(t){console.error("Failed to register console",t),i(t)}}))})}_sendRegistration(t){return ik(this,void 0,void 0,function*(){this._normaliseRegistration();let i=!!this._registration.id;try{let t=yield sk.rest.api.ConsoleResource.register(this._registration);if(200!==t.status)throw Error("Failed to register console");this._registration=t.data,console.debug("Console: registration successful"),console.debug("Console: updating locally stored registration"),window.localStorage.setItem(this._storageKey,JSON.stringify(this._registration))}catch(r){if(t&&i&&iD._isStaleRegistrationResponse(r)){console.warn("Console registration ID is stale or cannot be claimed; creating a new console registration"),window.localStorage.removeItem(this._storageKey),delete this._registration.id,yield this._sendRegistration(!1);return}throw r}})}_normaliseRegistration(){this._registration.name||(this._registration.name="Console"),this._registration.platform||(this._registration.platform="N/A"),this._registration.version||(this._registration.version="N/A"),this._registration.providers||(this._registration.providers={})}get _storageKey(){return"OpenRemoteConsole:"+this._realm}static _isStaleRegistrationResponse(t){let i=t&&t.response?t.response.status:void 0;return 403===i||409===i}storeData(t,i){this.sendProviderMessage({provider:"storage",action:"STORE",key:t,value:i},!1)}retrieveData(t){return ik(this,void 0,void 0,function*(){let i=this.sendProviderMessage({provider:"storage",action:"RETRIEVE",key:t},!0);try{let t=yield Promise.race([i,new Promise((t,i)=>setTimeout(i,2e3))]);if(t&&t.value){let i=t.value;return"null"===i?void 0:i}}catch(t){console.log("Failed to retrieve data from storage provider")}})}addProviderMessageListener(t,i){this._providerMessageListeners[t.provider+t.action]=i}removeProviderMessageListener(t){delete this._providerMessageListeners[t.provider+t.action]}_postNativeShellMessage(t){try{if(this.shellAndroid)return window.MobileInterface.postMessage(JSON.stringify(t));if(this.shellApple)return window.webkit.messageHandlers.int.postMessage(t)}catch(t){console.error("Failed to send shell message towards console",t)}}_doSendGenericMessage(t,i){let r={type:t,data:i};this.isMobile?this._postNativeShellMessage(r):console.warn("Failed to send generic message to console.",r)}_doSendProviderMessage(t){if(this.isMobile)this._postNativeShellMessage({type:"provider",data:t});else{if(!t.provider||!t.action)return;switch(t.provider.trim().toUpperCase()){case"PUSH":switch(t.action.trim().toUpperCase()){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"push",version:"web",enabled:!0,disabled:!1,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"push",hasPermission:!0,success:!0}));break;default:throw Error("Unsupported provider '"+t.provider+"' and action '"+t.action+"'")}break;case"STORAGE":switch(t.action){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"storage",version:"1.0.0",disabled:!1,enabled:!0,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"storage",hasPermission:!0,success:!0}));break;case"STORE":{let i=t.key?t.key.trim():null;if(!i||0===i.length)throw Error("Storage provider 'store' action requires a `key`");null===t.value?window.localStorage.removeItem(i):window.localStorage.setItem(i,JSON.stringify(t.value))}break;case"RETRIEVE":{let i=t.key?t.key.trim():null;if(!i||0===i.length)throw Error("Storage provider 'retrieve' action requires a `key`");let r=window.localStorage.getItem(i);if(null!==r)try{r=JSON.parse(r)}catch(t){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:i,value:r}))}break;default:throw Error("Unsupported provider '"+t.provider+"' and action '"+t.action+"'")}break;default:console.error("Unsupported provider: "+t.provider)}}}_handleProviderResponse(t){if(!t)return;let i=JSON.parse(t),r=i.provider,n=i.action,o=this._pendingProviderPromises[r+n];o&&(window.clearTimeout(o[1]),delete this._pendingProviderPromises[r+n],o[0].resolve(i));let a=this._providerMessageListeners[r+n];a&&a(i)}_callCompletedCallback(){let t=this._enableCompleteCallback;this._enableCompleteCallback=null,t&&window.setTimeout(()=>{t()},0)}static _createConsoleRegistration(){return{name:iM.name,version:iM.version,platform:iM.os.toString(),apps:[],model:((iM.manufacturer?iM.manufacturer+" ":"")+(iM.product?iM.product:"")).trim()}}_initialiseProvider(t){return ik(this,void 0,void 0,function*(){let i;console.debug("Console: initialising provider '"+t+"'");try{i=yield this.sendProviderMessage({provider:t,action:"PROVIDER_INIT"},!0),this._registration.providers[t].version=i.version,this._registration.providers[t].requiresPermission=i.requiresPermission,this._registration.providers[t].hasPermission=i.hasPermission,this._registration.providers[t].success=i.success,this._registration.providers[t].enabled=i.enabled,this._registration.providers[t].disabled=i.disabled,this._registration.providers[t].data=i.data}catch(t){console.error(t),i={action:"",disabled:!1,enabled:!1,hasPermission:!1,provider:"",requiresPermission:!1,version:"",success:!1}}if(i.success||(console.debug("Provider initialisation failed: '"+t+"'"),i.disabled=!0,this._registration.providers[t].disabled=!0),i.disabled||i.enabled){let i=this._pendingProviderEnables.indexOf(t);i>=0&&this._pendingProviderEnables.splice(i,1)}})}}function iT(t,i){return function(){return t.apply(i,arguments)}}let{toString:iA}=Object.prototype,{getPrototypeOf:iC}=Object,{iterator:iS,toStringTag:iL}=Symbol,iP=(({hasOwnProperty:t})=>(i,r)=>t.call(i,r))(Object.prototype),iI=t=>"string"==typeof t&&("__proto__"===t||"constructor"===t||"prototype"===t),iR=(t,i,r)=>t===Object.prototype||!r&&null===i,iB=(t,i)=>{let r=t,n=[];for(;null!=r&&-1===n.indexOf(r);){n.push(r);let o=iC(r);if(iR(r,o,r===t))break;if(iP(r,i))return!0;r=o}return!1},iO=(l=Object.create(null),t=>{let i=iA.call(t);return l[i]||(l[i]=i.slice(8,-1).toLowerCase())}),iz=t=>(t=t.toLowerCase(),i=>iO(i)===t),iY=t=>i=>typeof i===t,{isArray:ij}=Array,iN=iY("undefined");function iU(t){return null!==t&&!iN(t)&&null!==t.constructor&&!iN(t.constructor)&&i$(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}let iH=iz("ArrayBuffer"),iV=iY("string"),i$=iY("function"),iq=iY("number"),iG=t=>null!==t&&"object"==typeof t,iW=t=>{if(!iG(t))return!1;let i=iC(t);return(null===i||i===Object.prototype||null===iC(i))&&!iB(t,iL)&&!iB(t,iS)},iZ=iz("Date"),iK=iz("File"),iJ=iz("Blob"),iX=iz("FileList"),iQ=iz("Set"),i0="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},i1=void 0!==i0.FormData?i0.FormData:void 0,i2=iz("URLSearchParams"),[i3,i5,i4,i6]=["ReadableStream","Request","Response","Headers"].map(iz);function i8(t,i,{allOwnKeys:r=!1}={}){let n,o;if(null!=t)if("object"!=typeof t&&(t=[t]),ij(t))for(n=0,o=t.length;n<o;n++)i.call(null,t[n],n,t);else{let o;if(iU(t))return;let a=r?Object.getOwnPropertyNames(t):Object.keys(t),s=a.length;for(n=0;n<s;n++)o=a[n],i.call(null,t[o],o,t)}}function i7(t,i){let r;if(iU(t))return null;i=i.toLowerCase();let n=Object.keys(t),o=n.length;for(;o-- >0;)if(i===(r=n[o]).toLowerCase())return r;return null}let i9="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,re=t=>!iN(t)&&t!==i9,rt=(c="u">typeof Uint8Array&&iC(Uint8Array),t=>c&&t instanceof c),ri=iz("HTMLFormElement"),{propertyIsEnumerable:rr}=Object.prototype,rn=iz("RegExp"),ro=(t,i)=>{let r=Object.getOwnPropertyDescriptors(t),n={};i8(r,(r,o)=>{let a;!1!==(a=i(r,o,t))&&(n[o]=a||r)}),Object.defineProperties(t,n)},ra=iz("AsyncFunction"),rs=(h="function"==typeof setImmediate,m=i$(i9.postMessage),h?setImmediate:m?(f=`axios@${Math.random()}`,p=[],i9.addEventListener("message",({source:t,data:i})=>{t===i9&&i===f&&p.length&&p.shift()()},!1),t=>{p.push(t),i9.postMessage(f,"*")}):t=>setTimeout(t)),rl="u">typeof queueMicrotask?queueMicrotask.bind(i9):"u">typeof process&&process.nextTick||rs,rc=t=>null!=t&&i$(t[iS]),rd={isArray:ij,isArrayBuffer:iH,isBuffer:iU,isFormData:t=>{if(!t)return!1;if(i1&&t instanceof i1)return!0;let i=iC(t);if(!i||i===Object.prototype||!i$(t.append))return!1;let r=iO(t);return"formdata"===r||"object"===r&&i$(t.toString)&&"[object FormData]"===t.toString()},isArrayBufferView:function(t){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&iH(t.buffer)},isString:iV,isNumber:iq,isBoolean:t=>!0===t||!1===t,isObject:iG,isPlainObject:iW,isEmptyObject:t=>{if(!iG(t)||iU(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},isReadableStream:i3,isRequest:i5,isResponse:i4,isHeaders:i6,isUndefined:iN,isDate:iZ,isFile:iK,isReactNativeBlob:t=>!!(t&&void 0!==t.uri),isReactNative:t=>t&&void 0!==t.getParts,isBlob:iJ,isRegExp:rn,isFunction:i$,isStream:t=>iG(t)&&i$(t.pipe),isURLSearchParams:i2,isTypedArray:rt,isFileList:iX,forEach:i8,merge:function t(...i){let{caseless:r,skipUndefined:n}=re(this)&&this||{},o={},a=(i,a)=>{if("__proto__"===a||"constructor"===a||"prototype"===a)return;let s=r&&"string"==typeof a&&i7(o,a)||a,l=iP(o,s)?o[s]:void 0;iW(l)&&iW(i)?o[s]=t(l,i):iW(i)?o[s]=t({},i):ij(i)?o[s]=i.slice():n&&iN(i)||(o[s]=i)};for(let t=0,r=i.length;t<r;t++){let r=i[t];if(!r||iU(r)||(i8(r,a),"object"!=typeof r||ij(r)))continue;let n=Object.getOwnPropertySymbols(r);for(let t=0;t<n.length;t++){let i=n[t];rr.call(r,i)&&a(r[i],i)}}return o},extend:(t,i,r,{allOwnKeys:n}={})=>(i8(i,(i,n)=>{r&&i$(i)?Object.defineProperty(t,n,{__proto__:null,value:iT(i,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,n,{__proto__:null,value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,i,r,n)=>{t.prototype=Object.create(i.prototype,n),Object.defineProperty(t.prototype,"constructor",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{__proto__:null,value:i.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,i,r,n)=>{let o,a,s,l={};if(i=i||{},null==t)return i;do{for(a=(o=Object.getOwnPropertyNames(t)).length;a-- >0;)s=o[a],(!n||n(s,t,i))&&!l[s]&&(i[s]=t[s],l[s]=!0);t=!1!==r&&iC(t)}while(t&&(!r||r(t,i))&&t!==Object.prototype);return i},kindOf:iO,kindOfTest:iz,endsWith:(t,i,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=i.length;let n=t.indexOf(i,r);return -1!==n&&n===r},toArray:t=>{if(!t)return null;if(ij(t))return t;let i=t.length;if(!iq(i))return null;let r=Array(i);for(;i-- >0;)r[i]=t[i];return r},forEachEntry:(t,i)=>{let r,n=(t&&t[iS]).call(t);for(;(r=n.next())&&!r.done;){let n=r.value;i.call(t,n[0],n[1])}},matchAll:(t,i)=>{let r,n=[];for(;null!==(r=t.exec(i));)n.push(r);return n},isHTMLForm:ri,hasOwnProperty:iP,hasOwnProp:iP,hasOwnInPrototypeChain:iB,getSafeProp:(t,i)=>null!=t&&iB(t,i)?t[i]:void 0,toSafeFlatObject:t=>{if(null==t||"object"!=typeof t&&"function"!=typeof t)return t;let i=iC(t);if(null===i&&(t=>{if(!Object.isExtensible(t))return!1;let i=Object.getOwnPropertyNames(t);return Object.getOwnPropertySymbols&&i.push(...Object.getOwnPropertySymbols(t)),i.every(i=>{if(iI(i))return!1;let r=Object.getOwnPropertyDescriptor(t,i);return!!r&&r.configurable&&!0===r.writable})})(t))return t;let r=Object.create(null),n=Object.create(null),o=[],a=t;for(;null!=a&&-1===o.indexOf(a);){o.push(a);let s=a===t?i:iC(a);if(iR(a,s,a===t))break;let l=Object.getOwnPropertyNames(a);for(let i of(Object.getOwnPropertySymbols&&l.push(...Object.getOwnPropertySymbols(a)),l))!iI(i)&&(iP(n,i)||(r[i]=t[i],n[i]=!0));a=s}return r},reduceDescriptors:ro,freezeMethods:t=>{ro(t,(i,r)=>{if(i$(t)&&["arguments","caller","callee"].includes(r))return!1;if(i$(t[r])){if(i.enumerable=!1,"writable"in i){i.writable=!1;return}i.set||(i.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},toObjectSet:(t,i)=>{let r={};return(ij(t)?t:String(t).split(i)).forEach(t=>{r[t]=!0}),r},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,i,r){return i.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(t,i)=>null!=t&&Number.isFinite(t*=1)?t:i,findKey:i7,global:i9,isContextDefined:re,isSpecCompliantForm:function(t){return!!(t&&i$(t.append)&&"FormData"===t[iL]&&t[iS])},toJSONObject:t=>{let i=new WeakSet,r=t=>{if(iG(t)){if(i.has(t))return;if(iU(t))return t;if(!("toJSON"in t)){let n;if(i.add(t),iQ(t))for(let i of(n=[],t)){let t=r(i);iN(t)||n.push(t)}else n=ij(t)?[]:{},i8(t,(t,i)=>{let o=r(t);iN(o)||(n[i]=o)});return i.delete(t),n}}return t};return r(t)},isAsyncFn:ra,isThenable:t=>t&&(iG(t)||i$(t))&&i$(t.then)&&i$(t.catch),setImmediate:rs,asap:rl,isIterable:rc,isSafeIterable:t=>null!=t&&iB(t,iS)&&rc(t)},ru=rd.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"]),rh=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),rm=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function rf(t,i){return rd.isArray(t)?t.map(t=>rf(t,i)):function(t){let i=0,r=t.length;for(;i<r;){let r=t.charCodeAt(i);if(9!==r&&32!==r)break;i+=1}for(;r>i;){let i=t.charCodeAt(r-1);if(9!==i&&32!==i)break;r-=1}return 0===i&&r===t.length?t:t.slice(i,r)}(String(t).replace(i,""))}function rp(t){let i=Object.create(null);return rd.forEach(t.toJSON(),(t,r)=>{i[r]=rf(t,rm)}),i}let r_=Symbol("internals");function rg(t){return t&&String(t).trim().toLowerCase()}function rb(t){return!1===t||null==t?t:rd.isArray(t)?t.map(rb):rf(String(t),rh)}let ry=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function rv(t){let i=0,r=t.length;for(;i<r;){let r=t.charCodeAt(i);if(9!==r&&32!==r)break;i+=1}for(;r>i;){let i=t.charCodeAt(r-1);if(9!==i&&32!==i)break;r-=1}return 0===i&&r===t.length?t:t.slice(i,r)}function rF(t,i,r,n,o){if(rd.isFunction(n))return n.call(this,i,r);if(o&&(i=r),rd.isString(i)){if(rd.isString(n))return -1!==i.indexOf(n);if(rd.isRegExp(n))return n.test(i)}}class rx{constructor(t){t&&this.set(t)}set(t,i,r){let n=this;function o(t,i,r){let o=rg(i);if(!o)return;let a=rd.findKey(n,o);a&&void 0!==n[a]&&!0!==r&&(void 0!==r||!1===n[a])||(n[a||i]=rb(t))}let a=(t,i)=>rd.forEach(t,(t,r)=>o(t,r,i));if(rd.isPlainObject(t)||t instanceof this.constructor)a(t,i);else{let n;if(rd.isString(t)&&(t=t.trim())&&(n=t,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim()))){var s;let r,n,o,l;a((l={},(s=t)&&s.split("\n").forEach(function(t){o=t.indexOf(":"),r=t.substring(0,o).trim().toLowerCase(),n=t.substring(o+1).trim();let i=rd.hasOwnProp(l,r);!r||i&&rd.hasOwnProp(ru,r)||("set-cookie"===r?i?l[r].push(n):l[r]=[n]:l[r]=i?l[r]+", "+n:n)}),l),i)}else if(rd.isObject(t)&&rd.isSafeIterable(t)){let r=Object.create(null),n,o;for(let i of t){if(!rd.isArray(i))throw TypeError("Object iterator must return a key-value pair");o=i[0],rd.hasOwnProp(r,o)?(n=r[o],r[o]=rd.isArray(n)?[...n,i[1]]:[n,i[1]]):r[o]=i[1]}a(r,i)}else null!=t&&o(i,t,r)}return this}get(t,i){if(t=rg(t)){let r=rd.findKey(this,t);if(r){let t=this[r];if(!i)return t;if(!0===i){let i,r=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;i=n.exec(t);)r[i[1]]=i[2];return r}if(rd.isFunction(i))return i.call(this,t,r);if(rd.isRegExp(i))return i.exec(t);throw TypeError("parser must be boolean|regexp|function")}}}has(t,i){if(t=rg(t)){let r=rd.findKey(this,t);return!!(r&&void 0!==this[r]&&(!i||rF(this,this[r],r,i)))}return!1}delete(t,i){let r=this,n=!1;function o(t){if(t=rg(t)){let o=rd.findKey(r,t);o&&(!i||rF(r,r[o],o,i))&&(delete r[o],n=!0)}}return rd.isArray(t)?t.forEach(o):o(t),n}clear(t){let i=Object.keys(this),r=i.length,n=!1;for(;r--;){let o=i[r];(!t||rF(this,this[o],o,t,!0))&&(delete this[o],n=!0)}return n}normalize(t){let i=this,r={};return rd.forEach(this,(n,o)=>{let a=rd.findKey(r,o);if(a){i[a]=rb(n),delete i[o];return}let s=t?o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,i,r)=>i.toUpperCase()+r):String(o).trim();s!==o&&delete i[o],i[s]=rb(n),r[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let i=Object.create(null);return rd.forEach(this,(r,n)=>{null!=r&&!1!==r&&(i[n]=t&&rd.isArray(r)?r.join(", "):r)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,i])=>t+": "+i).join("\n")}getSetCookie(){let t=this.get("set-cookie");return rd.isArray(t)?t:null==t||!1===t?[]:[t]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static parseParameters(t){return function(t){let i=Object.create(null),r=String(t),n=0,o=!1,a=!1;function s(t){let o=rv(r.slice(n,t)),a=o.indexOf("=");if(a<1)return;let s=rv(o.slice(0,a));if(!ry.test(s))return;let l=s.toLowerCase();if("__proto__"===l||"constructor"===l||"prototype"===l)return;let c=rv(o.slice(a+1));i[l]=function(t){let i=t.length-1;if(i<1||34!==t.charCodeAt(0)||34!==t.charCodeAt(i))return t;let r="";for(let n=1;n<i;n++){let o=t.charCodeAt(n);if(34===o||92===o&&(n+=1)>=i)return t;r+=t[n]}return r}(c)}for(let t=0;t<r.length;t++){let i=r.charCodeAt(t);o?a?a=!1:92===i?a=!0:34===i&&(o=!1):34===i?o=!0:(44===i||59===i)&&(s(t),n=t+1)}return s(r.length),i}(t)}static concat(t,...i){let r=new this(t);return i.forEach(t=>r.set(t)),r}static accessor(t){let i=(this[r_]=this[r_]={accessors:{}}).accessors,r=this.prototype;function n(t){let n=rg(t);if(!i[n]){let o;o=rd.toCamelCase(" "+t),["get","set","has"].forEach(i=>{Object.defineProperty(r,i+o,{__proto__:null,value:function(r,n,o){return this[i].call(this,t,r,n,o)},configurable:!0})}),i[n]=!0}}return rd.isArray(t)?t.forEach(n):n(t),this}}rx.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),rd.reduceDescriptors(rx.prototype,({value:t},i)=>{let r=i[0].toUpperCase()+i.slice(1);return{get:()=>t,set(t){this[r]=t}}}),rd.freezeMethods(rx);let rw="[REDACTED ****]";function rE(t){try{return String(t)}catch(t){return""}}class rk extends Error{static from(t,i,r,n,o,a){let s=t.message;!s&&rd.isArray(t.errors)&&t.errors.length&&(s=t.errors.map(t=>{try{return t&&t.message?rE(t.message):rE(t)}catch(t){return""}}).filter(Boolean).join("; ")||t.name||"AggregateError");let l=new rk(s,i||t.code,r,n,o);return Object.defineProperty(l,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),l.name=t.name,null!=t.status&&null==l.status&&(l.status=t.status),a&&Object.assign(l,a),l}constructor(t,i,r,n,o){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,i&&(this.code=i),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status)}toJSON(){let t,i,r,n=this.config,o=n&&rd.hasOwnProp(n,"redact")?n.redact:void 0,a=rd.isArray(o)&&o.length>0?(t=new Set(o.map(t=>String(t).toLowerCase())),i=[],(r=n=>{let o;if(null===n||"object"!=typeof n||rd.isBuffer(n))return n;if(-1===i.indexOf(n)){if(n instanceof rx&&(n=n.toJSON()),i.push(n),rd.isArray(n))o=[],n.forEach((t,i)=>{let n=r(t);rd.isUndefined(n)||(o[i]=n)});else{if(!rd.isPlainObject(n)&&function(t){if(rd.hasOwnProp(t,"toJSON"))return!0;let i=Object.getPrototypeOf(t);for(;i&&i!==Object.prototype;){if(rd.hasOwnProp(i,"toJSON"))return!0;i=Object.getPrototypeOf(i)}return!1}(n))return i.pop(),n;for(let[i,a]of(o=Object.create(null),Object.entries(n))){let n=t.has(i.toLowerCase())?rw:r(a);rd.isUndefined(n)||(o[i]=n)}}return i.pop(),o}})(n)):rd.toJSONObject(n);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:a,code:this.code,status:this.status}}}rk.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",rk.ERR_BAD_OPTION="ERR_BAD_OPTION",rk.ECONNABORTED="ECONNABORTED",rk.ETIMEDOUT="ETIMEDOUT",rk.ECONNREFUSED="ECONNREFUSED",rk.ERR_NETWORK="ERR_NETWORK",rk.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",rk.ERR_DEPRECATED="ERR_DEPRECATED",rk.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",rk.ERR_BAD_REQUEST="ERR_BAD_REQUEST",rk.ERR_CANCELED="ERR_CANCELED",rk.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",rk.ERR_INVALID_URL="ERR_INVALID_URL",rk.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";let rM=rk;function rD(t){return rd.isPlainObject(t)||rd.isArray(t)}function rT(t){return rd.endsWith(t,"[]")?t.slice(0,-2):t}function rA(t,i,r){return t?t.concat(i).map(function(t,i){return t=rT(t),!r&&i?"["+t+"]":t}).join(r?".":""):i}let rC=rd.toFlatObject(rd,{},null,function(t){return/^is[A-Z]/.test(t)}),rS=function(t,i,r){if(!rd.isObject(t))throw TypeError("target must be an object");i=i||new FormData;let n=(t,i)=>{let n=rd.getSafeProp(r,t);return rd.isUndefined(n)?i:n},o=n("metaTokens",!0),a=n("visitor")||p,s=n("dots",!1),l=n("indexes",!1),c=n("Blob")||"u">typeof Blob&&Blob,d=n("maxDepth",100),u=c&&rd.isSpecCompliantForm(i),h=[];if(!rd.isFunction(a))throw TypeError("visitor must be a function");function m(t){if(null===t)return"";if(rd.isDate(t))return t.toISOString();if(rd.isBoolean(t))return t.toString();if(!u&&rd.isBlob(t))throw new rM("Blob is not supported. Use a Buffer instead.");if(rd.isArrayBuffer(t)||rd.isTypedArray(t)){if(u&&"function"==typeof c)return new c([t]);throw new rM("Blob is not supported. Use a Buffer instead.",rM.ERR_NOT_SUPPORT)}return t}function f(t){if(t>d)throw new rM("Object is too deeply nested ("+t+" levels). Max depth: "+d,rM.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(t,r,n){let a=t;if(rd.isReactNative(i)&&rd.isReactNativeBlob(t))return i.append(rA(n,r,s),m(t)),!1;if(t&&!n&&"object"==typeof t)if(rd.endsWith(r,"{}"))r=o?r:r.slice(0,-2),t=function(t){if(1/0===d)return JSON.stringify(t);let i=[];return JSON.stringify(t,function(t,r){if(!rd.isObject(r))return r;for(;i.length&&i[i.length-1]!==this;)i.pop();return i.push(r),f(1+i.length-1),r})}(t);else{var c;if(rd.isArray(t)&&(c=t,rd.isArray(c)&&!c.some(rD))||(rd.isFileList(t)||rd.endsWith(r,"[]"))&&(a=rd.toArray(t)))return r=rT(r),a.forEach(function(t,n){rd.isUndefined(t)||null===t||i.append(!0===l?rA([r],n,s):null===l?r:r+"[]",m(t))}),!1}return!!rD(t)||(i.append(rA(n,r,s),m(t)),!1)}let _=Object.assign(rC,{defaultVisitor:p,convertValue:m,isVisitable:rD});if(!rd.isObject(t))throw TypeError("data must be an object");return!function t(r,n,o=0){if(!rd.isUndefined(r)){if(f(o),-1!==h.indexOf(r))throw Error("Circular reference detected in "+n.join("."));h.push(r),rd.forEach(r,function(r,s){!0===(!(rd.isUndefined(r)||null===r)&&a.call(i,r,rd.isString(s)?s.trim():s,n,_))&&t(r,n?n.concat(s):[s],o+1)}),h.pop()}}(t),i};function rL(t){let i={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(t).replace(/[!'()~]|%20/g,function(t){return i[t]})}function rP(t,i){this._pairs=[],t&&rS(t,this,i)}let rI=rP.prototype;function rR(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function rB(t,i,r){let n;if(!i)return t;t=t||"";let o=rd.isFunction(r)?{serialize:r}:r,a=rd.getSafeProp(o,"encode")||rR,s=rd.getSafeProp(o,"serialize");if(n=s?s(i,o):rd.isURLSearchParams(i)?i.toString():new rP(i,o).toString(a)){let i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t}rI.append=function(t,i){this._pairs.push([t,i])},rI.toString=function(t){let i=t?i=>t.call(this,i,rL):rL;return this._pairs.map(function(t){return i(t[0])+"="+i(t[1])},"").join("&")};let rO=Symbol("internals");function rz(t){return t?t.length:0}function rY(t){if(t)for(;t.length&&null===t[t.length-1];)t.pop()}function rj(t,i){let r=t.handlers,n=rz(r);r!==i.handlersRef?(i.handlersRef=r,i.handlerEntries.clear()):n!==i.handlersLength&&(n?i.handlerEntries.forEach(function(t,n){r[t.index]!==t.handler&&i.handlerEntries.delete(n)}):i.handlerEntries.clear()),i.handlersLength=n}let rN=class{constructor(){this.handlers=[],this[rO]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(t,i,r){let n={fulfilled:t,rejected:i,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null},o=this[rO];null==this.handlers&&(this.handlers=[]),rj(this,o);let a=o.nextId++;return this.handlers.push(n),o.handlerEntries.set(a,{handler:n,index:this.handlers.length-1}),o.handlersLength=this.handlers.length,a}eject(t){let i=this[rO];rj(this,i);let r=i.handlerEntries.get(t);if(r){if(i.handlerEntries.delete(t),this.handlers[r.index]!==r.handler)return;this.handlers[r.index]=null,i.iterationDepth||(rY(this.handlers),i.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],rj(this,this[rO]))}forEach(t){let i=this[rO];rj(this,i),i.iterationDepth++;try{rd.forEach(this.handlers,function(i){null!==i&&t(i)})}finally{--i.iterationDepth||(rj(this,i),rY(this.handlers),i.handlersLength=rz(this.handlers))}}},rU={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},rH="u">typeof URLSearchParams?URLSearchParams:rP,rV="u">typeof FormData?FormData:null,r$="u">typeof Blob?Blob:null,rq="u">typeof window&&"u">typeof document,rG="object"==typeof navigator&&navigator||void 0,rW=rq&&(!rG||0>["ReactNative","NativeScript","NS"].indexOf(rG.product)),rZ="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,rK=rq&&window.location.href||"http://localhost",rJ={...tC,isBrowser:!0,classes:{URLSearchParams:rH,FormData:rV,Blob:r$},protocols:["http","https","file","blob","url","data"]};function rX(t){if(t>100)throw new rM("FormData field is too deeply nested ("+t+" levels). Max depth: 100",rM.ERR_FORM_DATA_DEPTH_EXCEEDED)}let rQ=function(t){if(rd.isFormData(t)&&rd.isFunction(t.entries)){let i={};return rd.forEachEntry(t,(t,r)=>{!function t(i,r,n,o){rX(o);let a=i[o++];if("__proto__"===a)return!0;let s=Number.isFinite(+a),l=o>=i.length;return(a=!a&&rd.isArray(n)?n.length:a,l)?rd.hasOwnProp(n,a)?n[a]=rd.isArray(n[a])?n[a].concat(r):[n[a],r]:n[a]=r:(rd.hasOwnProp(n,a)&&rd.isObject(n[a])||(n[a]=[]),t(i,r,n[a],o)&&rd.isArray(n[a])&&(n[a]=function(t){let i,r,n={},o=Object.keys(t),a=o.length;for(i=0;i<a;i++)n[r=o[i]]=t[r];return n}(n[a]))),!s}(function(t){let i,r=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;for(;null!==(i=n.exec(t));)rX(r.length),r.push("[]"===i[0]?"":i[1]||i[0]);return r}(t),r,i,0)}),i}return null},r0=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),r1=(t,i)=>null!=t&&rd.hasOwnProp(t,i)?t[i]:void 0,r2={transitional:rU,adapter:["xhr","http","fetch"],transformRequest:[function(t,i){let r,n=i.getContentType()||"",o=n.indexOf("application/json")>-1,a=rd.isObject(t);if(a&&rd.isHTMLForm(t)&&(t=new FormData(t)),rd.isFormData(t))return o?JSON.stringify(rQ(t)):t;if(rd.isArrayBuffer(t)||rd.isBuffer(t)||rd.isStream(t)||rd.isFile(t)||rd.isBlob(t)||rd.isReadableStream(t))return t;if(rd.isArrayBufferView(t))return t.buffer;if(rd.isURLSearchParams(t))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();if(a){let i=r1(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return rS(t,new rJ.classes.URLSearchParams,{visitor:function(t,i,r,n){return rJ.isNode&&rd.isBuffer(t)?(this.append(i,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...i}).toString();if((r=rd.isFileList(t))||n.indexOf("multipart/form-data")>-1){let n=r1(this,"env"),o=n&&n.FormData;return rS(r?{"files[]":t}:t,o&&new o,i)}}if(a||o){i.setContentType("application/json",!1);var s=t;if(rd.isString(s))try{return(0,JSON.parse)(s),rd.trim(s)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(s)}return t}],transformResponse:[function(t){let i=r1(this,"transitional")||r2.transitional,r=i&&i.forcedJSONParsing,n=r1(this,"responseType"),o="json"===n;if(rd.isResponse(t)||rd.isReadableStream(t))return t;if(t&&rd.isString(t)&&(r&&!n||o)){let r=i&&i.silentJSONParsing;try{return JSON.parse(t,r1(this,"parseReviver"))}catch(t){if(!r&&o){if("SyntaxError"===t.name)throw rM.from(t,rM.ERR_BAD_RESPONSE,this,null,r1(this,"response"));throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:rJ.classes.FormData,Blob:rJ.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function r3(t,i){let r=this||r2,n=i||r,o=rx.from(n.headers),a=n.data;return rd.forEach(t,function(t){a=t.call(r,a,o.normalize(),i?i.status:void 0)}),o.normalize(),a}function r5(t){return!!(t&&t.__CANCEL__)}rd.forEach(r0,t=>{r2.headers[t]={}});let r4=class extends rM{constructor(t,i,r){super(null==t?"canceled":t,rM.ERR_CANCELED,i,r),this.name="CanceledError",this.__CANCEL__=!0}};function r6(t,i,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):i(new rM("Request failed with status code "+r.status,r.status>=400&&r.status<500?rM.ERR_BAD_REQUEST:rM.ERR_BAD_RESPONSE,r.config,r.request,r))}let r8=/[\t\n\r]/g;function r7(t){if("string"!=typeof t)return t;let i=0;for(;i<t.length&&32>=t.charCodeAt(i);)i++;return t.slice(i).replace(r8,"")}function r9(t){let i=/^([-+\w]{1,25}):(?:\/\/)?/.exec(t);return i&&i[1]||""}let ne=function(t,i){let r,n=Array(t=t||10),o=Array(t),a=0,s=0;return i=void 0!==i?i:1e3,function(l){let c=Date.now(),d=o[s];r||(r=c),n[a]=l,o[a]=c;let u=s,h=0;for(;u!==a;)h+=n[u++],u%=t;if((a=(a+1)%t)===s&&(s=(s+1)%t),c-r<i)return;let m=d&&c-d;return m?Math.round(1e3*h/m):void 0}},nt=function(t,i){let r,n,o=0,a=1e3/i,s=(i,a=Date.now())=>{o=a,r=null,n&&(clearTimeout(n),n=null),t(...i)};return[(...t)=>{let i=Date.now(),l=i-o;l>=a?s(t,i):(r=t,n||(n=setTimeout(()=>{n=null,s(r)},a-l)))},()=>r&&s(r),(...t)=>s(t)]},ni=(t,i,r=3)=>{let n=0,o=ne(50,250);return nt(r=>{if(!r||!rd.isNumber(r.loaded))return;let a=r.loaded,s=r.lengthComputable?r.total:void 0,l=Math.max(0,null!=s?Math.min(a,s):a),c=Math.max(0,l-n),d=o(c);n=Math.max(n,l),t({loaded:l,total:s,progress:s?l/s:void 0,bytes:c,rate:d||void 0,estimated:d&&s?(s-l)/d:void 0,event:r,lengthComputable:null!=s,[i?"download":"upload"]:!0})},r)},nr=(t,i)=>{let r=null!=t;return[n=>i[0]({lengthComputable:r,total:t,loaded:n}),i[1]]},nn=(t,i=rd.asap)=>(...r)=>i(()=>t(...r)),no=rJ.hasStandardBrowserEnv?(d=new URL(rJ.origin),u=rJ.navigator&&/(msie|trident)/i.test(rJ.navigator.userAgent),t=>(t=new URL(t,rJ.origin),d.protocol===t.protocol&&d.host===t.host&&(u||d.port===t.port))):()=>!0,na=rJ.hasStandardBrowserEnv?{write(t,i,r,n,o,a,s){if("u"<typeof document)return;let l=[`${t}=${encodeURIComponent(i)}`];rd.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),rd.isString(n)&&l.push(`path=${n}`),rd.isString(o)&&l.push(`domain=${o}`),!0===a&&l.push("secure"),rd.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(t){if("u"<typeof document)return null;let i=document.cookie.split(";");for(let r=0;r<i.length;r++){let n=i[r].replace(/^\s+/,""),o=n.indexOf("=");if(-1!==o&&n.slice(0,o)===t)try{return decodeURIComponent(n.slice(o+1))}catch(t){return n.slice(o+1)}}return null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}},ns=/^https?:(?!\/\/)/i;function nl(t,i){if("string"==typeof t){let n=r7(t);if(ns.test(n)){var r;let t,o,a;throw new rM(`Invalid URL ${JSON.stringify((a=(-1===(o=(t=n.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${rw}@`)).indexOf("#"))?t:t.slice(0,o)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${rw}`),-1===o?a:`${a}#${!(r=t.slice(o+1))?r:r.replace(/(^|&)([^=&]*=)?[^&]+/g,(t,i,r="")=>`${i}${r}${rw}`)}`))}: missing "//" after protocol`,rM.ERR_INVALID_URL,i)}}}function nc(t,i,r,n){nl(i,n);let o=!("string"==typeof i&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i));if(t&&(o||!1===r)){nl(t,n);if(!i)return t;let r=t.length;for(;r>0&&47===t.charCodeAt(r-1);)r--;return t.slice(0,r)+"/"+i.replace(/^\/+/,"")}return i}let nd=t=>t instanceof rx?{...t}:t;function nu(t,i){var r;t=t||{},i=i||{};let n=Object.create(null);function o(t,i,r,n){return rd.isPlainObject(t)&&rd.isPlainObject(i)?rd.merge.call({caseless:n},t,i):rd.isPlainObject(i)?rd.merge({},i):rd.isArray(i)?i.slice():i}function a(t,i,r,n){return rd.isUndefined(i)?rd.isUndefined(t)?void 0:o(void 0,t,r,n):o(t,i,r,n)}function s(t,i){if(!rd.isUndefined(i))return o(void 0,i)}function l(t,i){return rd.isUndefined(i)?rd.isUndefined(t)?void 0:o(void 0,t):o(void 0,i)}function c(r,n,a){return rd.hasOwnProp(i,a)?o(r,n):rd.hasOwnProp(t,a)?o(void 0,r):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});let d={url:s,method:s,data:s,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutErrorMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,allowedSocketPaths:l,responseEncoding:l,validateStatus:c,headers:(t,i,r)=>a(nd(t),nd(i),r,!0)};return rd.forEach((r={...t,...i},Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(r).concat(Object.getOwnPropertySymbols(r).filter(t=>Object.getOwnPropertyDescriptor(r,t).enumerable)):Object.keys(r)),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;let o=rd.hasOwnProp(d,r)?d[r]:a,s=o(rd.hasOwnProp(t,r)?t[r]:void 0,rd.hasOwnProp(i,r)?i[r]:void 0,r);rd.isUndefined(s)&&o!==c||(n[r]=s)}),rd.hasOwnProp(i,"validateStatus")&&rd.isUndefined(i.validateStatus)&&!1===function(r){let n=rd.hasOwnProp(i,"transitional")?i.transitional:void 0;if(!rd.isUndefined(n)){if(!rd.isPlainObject(n))return;else if(rd.hasOwnProp(n,r))return n[r]}let o=rd.hasOwnProp(t,"transitional")?t.transitional:void 0;if(rd.isPlainObject(o)&&rd.hasOwnProp(o,r))return o[r]}("validateStatusUndefinedResolves")&&(rd.hasOwnProp(t,"validateStatus")?n.validateStatus=o(void 0,t.validateStatus):delete n.validateStatus),n}let nh=["content-type","content-length"],nm=function(t){let i=nu({},t),r=t=>rd.hasOwnProp(i,t)?i[t]:void 0,n=r("data"),o=r("withXSRFToken"),a=r("xsrfHeaderName"),s=r("xsrfCookieName"),l=r("headers"),c=r("auth"),d=r("baseURL"),u=r("allowAbsoluteUrls"),h=r("url");if(i.headers=l=rx.from(l),i.url=rB(nc(d,h,u,i),r("params"),r("paramsSerializer")),c){let i=rd.getSafeProp(c,"username")||"",r=rd.getSafeProp(c,"password")||"";try{l.set("Authorization","Basic "+btoa(i+":"+(r?encodeURIComponent(r).replace(/%([0-9A-F]{2})/gi,(t,i)=>String.fromCharCode(parseInt(i,16))):"")))}catch(i){throw rM.from(i,rM.ERR_BAD_OPTION_VALUE,t)}}if(rd.isFormData(n)){let t=rd.getSafeProp(n,"getHeaders");if(rJ.hasStandardBrowserEnv||rJ.hasStandardBrowserWebWorkerEnv||rd.isReactNative(n))l.setContentType(void 0);else{var m,f;rd.isFunction(t)&&(m=l,f=t.call(n),"content-only"!==r("formDataHeaderPolicy")?m.set(f):Object.entries(f||{}).forEach(([t,i])=>{nh.includes(t.toLowerCase())&&m.set(t,i)}))}}if(rJ.hasStandardBrowserEnv&&(rd.isFunction(o)&&(o=o(i)),!0===o||null==o&&no(i.url))){let t=a&&s&&na.read(s);t&&l.set(a,t)}return i},nf="u">typeof XMLHttpRequest&&function(t){return new Promise(function(i,r){let n,o,a,s,l,c,d=nm(t),u=d.data,h=rx.from(d.headers).normalize(),{responseType:m,onUploadProgress:f,onDownloadProgress:p}=d;function _(){s&&s(),l&&l(),d.cancelToken&&d.cancelToken.unsubscribe(n),d.signal&&d.signal.removeEventListener("abort",n)}let g=new XMLHttpRequest;function b(n){if(!g)return;if(0===g.status&&"file"!==(r9(r7(d.url))||r9(rJ.origin))&&!(g.responseURL&&g.responseURL.startsWith("file:"))){r(new rM("Request aborted",rM.ECONNABORTED,t,g)),_(),g=null;return}try{n?c&&c(n):l&&l()}catch(t){setTimeout(()=>{throw t})}if(!g)return;let o=rx.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());r6(function(t){i(t),_()},function(t){r(t),_()},{data:m&&"text"!==m&&"json"!==m?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:o,config:t,request:g}),g=null}g.open(d.method.toUpperCase(),d.url,!0),g.timeout=d.timeout,"onloadend"in g?g.onloadend=b:g.onreadystatechange=function(){!g||4!==g.readyState||(0!==g.status||g.responseURL&&g.responseURL.startsWith("file:"))&&setTimeout(b)},g.onabort=function(){g&&(r(new rM("Request aborted",rM.ECONNABORTED,t,g)),_(),g=null)},g.onerror=function(i){let n=new rM(i&&i.message?i.message:"Network Error",rM.ERR_NETWORK,t,g);n.event=i||null,r(n),_(),g=null},g.ontimeout=function(){let i=d.timeout?"timeout of "+d.timeout+"ms exceeded":"timeout exceeded",n=d.transitional||rU;d.timeoutErrorMessage&&(i=d.timeoutErrorMessage),r(new rM(i,n.clarifyTimeoutError?rM.ETIMEDOUT:rM.ECONNABORTED,t,g)),_(),g=null},void 0===u&&h.setContentType(null),"setRequestHeader"in g&&rd.forEach(rp(h),function(t,i){g.setRequestHeader(i,t)}),rd.isUndefined(d.withCredentials)||(g.withCredentials=!!d.withCredentials),m&&"json"!==m&&(g.responseType=d.responseType),p&&([a,l,c]=ni(p,!0),g.addEventListener("progress",a)),f&&g.upload&&([o,s]=ni(f),g.upload.addEventListener("progress",o),g.upload.addEventListener("loadend",s)),(d.cancelToken||d.signal)&&(n=i=>{g&&(r(!i||i.type?new r4(null,t,g):i),g.abort(),_(),g=null)},d.cancelToken&&d.cancelToken.subscribe(n),d.signal&&(d.signal.aborted?n():d.signal.addEventListener("abort",n)));let y=r9(d.url);if(y&&!rJ.protocols.includes(y)){r(new rM("Unsupported protocol "+y+":",rM.ERR_BAD_REQUEST,t)),_();return}g.send(u||null)})},np=function*(t,i){let r,n=t.byteLength;if(!i||n<i)return void(yield t);let o=0;for(;o<n;)r=o+i,yield t.slice(o,r),o=r},n_=async function*(t,i){for await(let r of ng(t))yield*np(r,i)},ng=async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);let i=t.getReader();try{for(;;){let{done:t,value:r}=await i.read();if(t)break;yield r}}finally{await i.cancel()}},nb=(t,i,r,n)=>{let o,a=n_(t,i),s=0,l=t=>{!o&&(o=!0,n&&n(t))};return new ReadableStream({async pull(t){try{let{done:i,value:n}=await a.next();if(i){l(),t.close();return}let o=n.byteLength;if(r){let t=s+=o;r(t)}t.enqueue(new Uint8Array(n))}catch(t){throw l(t),t}},cancel:t=>(l(t),a.return())},{highWaterMark:2})},ny=t=>t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102,nv=(t,i,r)=>i+2<r&&ny(t.charCodeAt(i+1))&&ny(t.charCodeAt(i+2)),nF=t=>t<=57?t-48:(223&t)-55,nx=t=>t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||43===t||47===t||45===t||95===t,nw=t=>9===t||10===t||12===t||13===t||32===t,nE=t=>{var i;let r,n,o=t.length,a=0,s=0,l=!1;for(let i=0;i<o;i++){let r=t.charCodeAt(i);if(37===r&&nv(t,i,o)&&(r=16*nF(t.charCodeAt(i+1))+nF(t.charCodeAt(i+2)),i+=2),!nw(r)){if(61===r){s++;continue}if(!nx(r)||s>0){l=!0;continue}a++}}if(l||s>2||s>0&&(a+s)%4!=0||a%4==1){let i,r;return i=t.length,r=0,i>0&&61===t.charCodeAt(i-1)&&(r++,i>1&&61===t.charCodeAt(i-2)&&r++),Math.floor((i-r)*3/4)}return r=Math.floor((i=a)/4),3*r+(2==(n=i%4)?1:2*(3===n))},nk={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:nM}=rd,nD=t=>{if(!rd.isString(t))return t;try{return decodeURIComponent(t)}catch(i){return t}},nT=(t,...i)=>{try{return!!t(...i)}catch(t){return!1}},nA=t=>{let i,r=void 0!==rd.global&&null!==rd.global?rd.global:globalThis,{ReadableStream:n,TextEncoder:o}=r,{fetch:a,Request:s,Response:l}=t=rd.merge.call({skipUndefined:!0},{Request:r.Request,Response:r.Response},t),c=a?nM(a):"function"==typeof fetch,d=nM(s),u=nM(l);if(!c)return!1;let h=c&&nM(n),m=c&&("function"==typeof o?(i=new o,t=>i.encode(t)):async t=>new Uint8Array(await new s(t).arrayBuffer())),f=d&&h&&nT(()=>{let t=!1,i=new s(rJ.origin,{body:new n,method:"POST",get duplex(){return t=!0,"half"}}),r=i.headers.has("Content-Type");return null!=i.body&&i.body.cancel(),t&&!r}),p=u&&h&&nT(()=>rd.isReadableStream(new l("").body)),_={stream:p&&(t=>t.body)};c&&["text","arrayBuffer","blob","formData","stream"].forEach(t=>{_[t]||(_[t]=(i,r)=>{let n=i&&i[t];if(n)return n.call(i);throw new rM(`Response type '${t}' is not supported`,rM.ERR_NOT_SUPPORT,r)})});let g=async t=>{if(null==t)return 0;if(rd.isBlob(t))return t.size;if(rd.isSpecCompliantForm(t)){let i=new s(rJ.origin,{method:"POST",body:t});return(await i.arrayBuffer()).byteLength}return rd.isArrayBufferView(t)||rd.isArrayBuffer(t)?t.byteLength:(rd.isURLSearchParams(t)&&(t+=""),rd.isString(t))?(await m(t)).byteLength:void 0},b=async(t,i)=>{let r=rd.toFiniteNumber(t.getContentLength());return null==r?g(i):r};return async t=>{let i,{url:r,method:n,data:c,signal:u,cancelToken:m,timeout:y,onDownloadProgress:v,onUploadProgress:F,responseType:x,headers:w,withCredentials:E="same-origin",fetchOptions:k,maxContentLength:M,maxBodyLength:D,maxRedirects:T}=nm(t),A=rd.isNumber(M)&&M>-1,C=rd.isNumber(D)&&D>-1,S=a||fetch;x=x?(x+"").toLowerCase():"text";let L=((t,i)=>{if(t=t?t.filter(Boolean):[],!i&&!t.length)return;let r=new AbortController,n=!1,o=function(t){if(!n){n=!0,s();let i=t instanceof Error?t:this.reason;r.abort(i instanceof rM?i:new r4(i instanceof Error?i.message:i))}},a=i&&setTimeout(()=>{a=null,o(new rM(`timeout of ${i}ms exceeded`,rM.ETIMEDOUT))},i),s=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)}),t=null)};t.forEach(t=>{if(!n){if(t.aborted)return void o.call(t);t.addEventListener("abort",o,{once:!0})}});let{signal:l}=r;return l.unsubscribe=()=>rd.asap(s),l})([u,m&&m.toAbortSignal()],y),P=null,I=L&&L.unsubscribe&&(()=>{L.unsubscribe()}),R=null,B=()=>new rM("Request body larger than maxBodyLength limit",rM.ERR_BAD_REQUEST,t,P);try{var O,z;let a,u,m,y,Y=(u="auth",rd.hasOwnProp(t,u)?t[u]:void 0);if(Y){let t=rd.getSafeProp(Y,"username")||"",i=rd.getSafeProp(Y,"password")||"";a={username:t,password:i}}if(m=(O=r).indexOf("://"),y=O,-1!==m&&(y=y.slice(m+3)),y.includes("@")||y.includes(":")){let t=new URL(r,rJ.origin);if(!a&&(t.username||t.password)){let i=nD(t.username),r=nD(t.password);a={username:i,password:r}}(t.username||t.password)&&(t.username="",t.password="",r=t.href)}if(a){let t;w.delete("authorization"),w.set("Authorization","Basic "+btoa((t=(a.username||"")+":"+(a.password||""),encodeURIComponent(t).replace(/%([0-9A-F]{2})/gi,(t,i)=>String.fromCharCode(parseInt(i,16))))))}if(A&&"string"==typeof r&&r.startsWith("data:")){let i;if(z=r,i="string"==typeof z?z.indexOf("#"):-1,((t,i)=>{if(!t||"string"!=typeof t||!t.startsWith("data:"))return 0;let r=t.indexOf(",");if(r<0)return 0;let n=t.slice(5,r),o=t.slice(r+1);if(/;base64/i.test(n))return i(o);let a=0;for(let t=0,i=o.length;t<i;t++){let r=o.charCodeAt(t);if(37===r&&nv(o,t,i))a+=1,t+=2;else if(r<128)a+=1;else if(r<2048)a+=2;else if(r>=55296&&r<=56319&&t+1<i){let i=o.charCodeAt(t+1);i>=56320&&i<=57343?(a+=4,t++):a+=3}else a+=3}return a})(-1===i?z:z.slice(0,i),nE)>M)throw new rM("maxContentLength size of "+M+" exceeded",rM.ERR_BAD_RESPONSE,t,P)}if(C&&"get"!==n&&"head"!==n){let t=await g(c);if("number"==typeof t&&isFinite(t)&&(i=t,t>D))throw B()}let j=C&&(rd.isReadableStream(c)||rd.isStream(c)),N=(t,i,r)=>nb(t,65536,t=>{if(C&&t>D)throw R=B();i&&i(t)},r);if(f&&"get"!==n&&"head"!==n&&(F||j)){if(i=null==i?await b(w,c):i,0!==i||j){let t,n=new s(r,{method:"POST",body:c,duplex:"half"});if(rd.isFormData(c)&&(t=n.headers.get("content-type"))&&w.setContentType(t),n.body){let[t,r]=F&&nr(i,ni(nn(F)))||[];c=N(n.body,t,r)}}}else if(j&&!d&&h&&"get"!==n&&"head"!==n)c=N(c);else if(j&&d&&!f&&"get"!==n&&"head"!==n)throw new rM("Stream request bodies are not supported by the current fetch implementation",rM.ERR_NOT_SUPPORT,t,P);rd.isString(E)||(E=E?"include":"omit");let U=d&&"credentials"in s.prototype;if(rd.isFormData(c)){let t=w.getContentType();t&&/^multipart\/form-data/i.test(t)&&!/boundary=/i.test(t)&&w.delete("content-type")}w.set("User-Agent","axios/1.20.0",!1);let H=null==k?k:Object.assign(Object.create(null),k);H&&(delete H.body,delete H.headers,delete H.method,delete H.signal,delete H.duplex,delete H.credentials);let V=Object.assign(Object.create(null),H,{signal:L,method:n.toUpperCase(),headers:rp(w.normalize()),body:c,duplex:"half",credentials:U?E:void 0});d&&(rd.forEach(nk,(t,i)=>{void 0===V[i]&&(V[i]=t)}),void 0===V.signal&&(V.signal=null),void 0===V.body&&(V.body=null)),0===T&&(V.redirect="manual",H&&(H.redirect="manual")),P=d&&new s(r,V);let $=await (d?S(P,H):S(r,V)),q=rx.from($.headers);if(A){let i=rd.toFiniteNumber(q.getContentLength());if(null!=i&&i>M)throw new rM("maxContentLength size of "+M+" exceeded",rM.ERR_BAD_RESPONSE,t,P)}let G=p&&("stream"===x||"response"===x);if(p&&$.body&&(v||A||G&&I)){let i={};["status","statusText","headers"].forEach(t=>{i[t]=$[t]});let r=rd.toFiniteNumber(q.getContentLength()),[n,o]=v&&nr(r,ni(nn(v),!0))||[];$=new l(nb($.body,65536,i=>{if(A&&i>M)throw new rM("maxContentLength size of "+M+" exceeded",rM.ERR_BAD_RESPONSE,t,P);n&&n(i)},()=>{o&&o(),I&&I()}),i)}x=x||"text";let W=await _[rd.findKey(_,x)||"text"]($,t);if(A&&!p&&!G){let i;if(null!=W&&("number"==typeof W.byteLength?i=W.byteLength:"number"==typeof W.size?i=W.size:"string"==typeof W&&(i="function"==typeof o?new o().encode(W).byteLength:W.length)),"number"==typeof i&&i>M)throw new rM("maxContentLength size of "+M+" exceeded",rM.ERR_BAD_RESPONSE,t,P)}return!G&&I&&I(),await new Promise((i,r)=>{r6(i,r,{data:W,headers:rx.from($.headers),status:$.status,statusText:$.statusText,config:t,request:P})})}catch(i){if(I&&I(),L&&L.aborted&&L.reason instanceof rM){let r=L.reason;throw r.config=t,P&&(r.request=P),i!==r&&Object.defineProperty(r,"cause",{__proto__:null,value:i,writable:!0,enumerable:!1,configurable:!0}),r}if(R)throw P&&!R.request&&(R.request=P),R;if(i instanceof rM)throw P&&!i.request&&(i.request=P),i;if(i&&"TypeError"===i.name&&/Load failed|fetch/i.test(i.message)){let r=new rM("Network Error",rM.ERR_NETWORK,t,P,i&&i.response);throw Object.defineProperty(r,"cause",{__proto__:null,value:i.cause||i,writable:!0,enumerable:!1,configurable:!0}),r}throw rM.from(i,i&&i.code,t,P,i&&i.response)}}},nC=new Map,nS=t=>{let i=t&&t.env||{},{fetch:r,Request:n,Response:o}=i,a=[n,o,r],s=a.length,l,c,d=nC;for(;s--;)l=a[s],void 0===(c=d.get(l))&&d.set(l,c=s?new Map:nA(i)),d=c;return c};nS();let nL={http:null,xhr:nf,fetch:{get:nS}};rd.forEach(nL,(t,i)=>{if(t){try{Object.defineProperty(t,"name",{__proto__:null,value:i})}catch(t){}Object.defineProperty(t,"adapterName",{__proto__:null,value:i})}});let nP=t=>`- ${t}`,nI=t=>rd.isFunction(t)||null===t||!1===t,nR=function(t,i){let r,n,{length:o}=t=rd.isArray(t)?t:[t],a={};for(let s=0;s<o;s++){let o;if(n=r=t[s],!nI(r)&&void 0===(n=nL[(o=String(r)).toLowerCase()]))throw new rM(`Unknown adapter '${o}'`);if(n&&(rd.isFunction(n)||(n=n.get(i))))break;a[o||"#"+s]=n}if(!n){let t=Object.entries(a).map(([t,i])=>`adapter ${t} `+(!1===i?"is not supported by the environment":"is not available in the build"));throw new rM("There is no suitable adapter to dispatch the request "+(o?t.length>1?"since :\n"+t.map(nP).join("\n"):" "+nP(t[0]):"as no adapter specified"),rM.ERR_NOT_SUPPORT)}return n};function nB(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new r4(null,t)}function nO(t){let i=rd.toSafeFlatObject(t);return nB(i),i.headers=rx.from(rd.getSafeProp(i,"headers")),i.data=r3.call(i,i.transformRequest),-1!==["post","put","patch"].indexOf(i.method)&&i.headers.setContentType("application/x-www-form-urlencoded",!1),nR(i.adapter||r2.adapter,i)(i).then(function(t){nB(i),i.response=t;try{t.data=r3.call(i,i.transformResponse,t)}finally{delete i.response}return t.headers=rx.from(t.headers),t},function(t){if(!r5(t)&&(nB(i),t&&t.response)){i.response=t.response;try{t.response.data=r3.call(i,i.transformResponse,t.response)}finally{delete i.response}t.response.headers=rx.from(t.response.headers)}return Promise.reject(t)})}let nz={};["object","boolean","number","function","string","symbol"].forEach((t,i)=>{nz[t]=function(r){return typeof r===t||"a"+(i<1?"n ":" ")+t}});let nY={};nz.transitional=function(t,i,r){function n(t,i){return"[Axios v1.20.0] Transitional option '"+t+"'"+i+(r?". "+r:"")}return(r,o,a)=>{if(!1===t)throw new rM(n(o," has been removed"+(i?" in "+i:"")),rM.ERR_DEPRECATED);return i&&!nY[o]&&(nY[o]=!0,console.warn(n(o," has been deprecated since v"+i+" and will be removed in the near future"))),!t||t(r,o,a)}},nz.spelling=function(t){return(i,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};let nj=function(t,i,r){if("object"!=typeof t||null===t)throw new rM("options must be an object",rM.ERR_BAD_OPTION_VALUE);let n=Object.keys(t),o=n.length;for(;o-- >0;){let a=n[o],s=Object.prototype.hasOwnProperty.call(i,a)?i[a]:void 0;if(s){let i=t[a],r=void 0===i||s(i,a,t);if(!0!==r)throw new rM("option "+a+" must be "+r,rM.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new rM("Unknown option "+a,rM.ERR_BAD_OPTION)}};class nN{constructor(t){this.defaults=t||{},this.interceptors={request:new rN,response:new rN}}async request(t,i){try{return await this._request(t,i)}catch(t){if(t instanceof Error)try{let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=Error();let r=i.stack,n="";if("string"==typeof r){let t=r.indexOf("\n");n=-1===t?"":r.slice(t+1)}if(t.stack){if(n){let i=n.indexOf("\n"),r=-1===i?-1:n.indexOf("\n",i+1),o=-1===r?"":n.slice(r+1);String(t.stack).endsWith(o)||(t.stack+="\n"+n)}}else t.stack=n}catch(t){}throw t}}_request(t,i){let r,n;"string"==typeof t?(i=i||{}).url=t:i=t||{};let{transitional:o,paramsSerializer:a,headers:s}=i=nu(this.defaults,i);void 0!==o&&nj(o,{silentJSONParsing:nz.transitional(nz.boolean),forcedJSONParsing:nz.transitional(nz.boolean),clarifyTimeoutError:nz.transitional(nz.boolean),legacyInterceptorReqResOrdering:nz.transitional(nz.boolean),advertiseZstdAcceptEncoding:nz.transitional(nz.boolean),validateStatusUndefinedResolves:nz.transitional(nz.boolean)},!1),null!=a&&(rd.isFunction(a)?i.paramsSerializer={serialize:a}:nj(a,{encode:nz.function,serialize:nz.function},!0)),void 0!==i.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),nj(i,{baseUrl:nz.spelling("baseURL"),withXsrfToken:nz.spelling("withXSRFToken")},!0),i.method=(rd.getSafeProp(i,"method")||rd.getSafeProp(this.defaults,"method")||"get").toLowerCase();let l=s&&rd.merge(s.common,s[i.method]);s&&rd.forEach(r0.concat("common"),t=>{delete s[t]}),i.headers=rx.concat(l,s);let c=[],d=!0;this.interceptors.request.forEach(function(t){if("function"==typeof t.runWhen&&!1===t.runWhen(i))return;d=d&&t.synchronous;let r=i.transitional||rU;r&&r.legacyInterceptorReqResOrdering?c.unshift(t.fulfilled,t.rejected):c.push(t.fulfilled,t.rejected)});let u=[];this.interceptors.response.forEach(function(t){u.push(t.fulfilled,t.rejected)});let h=0;if(!d){let t=[nO.bind(this),void 0];for(t.unshift(...c),t.push(...u),n=t.length,r=Promise.resolve(i);h<n;)r=r.then(t[h++],t[h++]);return r}n=c.length;let m=i;for(;h<n;){let t=c[h++],i=c[h++];try{m=t?t(m):m}catch(t){if(!i){r=Promise.reject(t);break}try{let n=i.call(this,t);rd.isThenable(n)&&(r=Promise.resolve(n).then(()=>nO.call(this,m)))}catch(t){r=Promise.reject(t)}break}}if(!r)try{r=nO.call(this,m)}catch(t){r=Promise.reject(t)}for(h=0,n=u.length;h<n;)r=r.then(u[h++],u[h++]);return r}getUri(t){return rB(nc((t=nu(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls,t),t.params,t.paramsSerializer)}}rd.forEach(["delete","get","head","options"],function(t){nN.prototype[t]=function(i,r){return this.request(nu(r||{},{method:t,url:i,data:r&&rd.hasOwnProp(r,"data")?r.data:void 0}))}}),rd.forEach(["post","put","patch","query"],function(t){function i(i){return function(r,n,o){return this.request(nu(o||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}nN.prototype[t]=i(),"query"!==t&&(nN.prototype[t+"Form"]=i(!0))});let nU=class t{constructor(t){let i;if("function"!=typeof t)throw TypeError("executor must be a function.");this.promise=new Promise(function(t){i=t});const r=this;this.promise.then(t=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](t);r._listeners=null}),this.promise.then=t=>{let i,n=new Promise(t=>{r.subscribe(t),i=t}).then(t);return n.cancel=function(){r.unsubscribe(i)},n},t(function(t,n,o){r.reason||(r.reason=new r4(t,n,o),i(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let i=this._listeners.indexOf(t);-1!==i&&this._listeners.splice(i,1)}toAbortSignal(){let t=new AbortController,i=i=>{t.abort(i)};return this.subscribe(i),t.signal.unsubscribe=()=>this.unsubscribe(i),t.signal}static source(){let i;return{token:new t(function(t){i=t}),cancel:i}}},nH={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(nH).forEach(([t,i])=>{void 0===nH[i]&&(nH[i]=t)});let nV=function t(i){let r=new nN(i),n=iT(nN.prototype.request,r);return rd.extend(n,nN.prototype,r,{allOwnKeys:!0}),rd.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return t(nu(i,r))},n}(r2);nV.Axios=nN,nV.CanceledError=r4,nV.CancelToken=nU,nV.isCancel=r5,nV.VERSION="1.20.0",nV.toFormData=rS,nV.AxiosError=rM,nV.Cancel=nV.CanceledError,nV.all=function(t){return Promise.all(t)},nV.spread=function(t){return function(i){return t.apply(null,i)}},nV.isAxiosError=function(t){return rd.isObject(t)&&!0===t.isAxiosError},nV.mergeConfig=nu,nV.AxiosHeaders=rx,nV.formToJSON=t=>rQ(rd.isHTMLForm(t)?new FormData(t):t),nV.getAdapter=nR,nV.HttpStatusCode=nH,nV.default=nV;class n${constructor(t){this.httpClient=t}getConfig(t){return this.httpClient.request({method:"GET",url:or`syslog/config`,options:t})}updateConfig(t,i){return this.httpClient.request({method:"PUT",url:or`syslog/config`,data:t,options:i})}clearEvents(t){return this.httpClient.request({method:"DELETE",url:or`syslog/event`,options:t})}getEvents(t,i){return this.httpClient.request({method:"GET",url:or`syslog/event`,queryParams:t,options:i})}}class nq{constructor(t){this.httpClient=t}getAllNodeDefinitions(t){return this.httpClient.request({method:"GET",url:or`flow`,options:t})}getNodeDefinition(t,i){return this.httpClient.request({method:"GET",url:or`flow/${t}`,options:i})}getAllNodeDefinitionsByType(t,i){return this.httpClient.request({method:"GET",url:or`flow/${t}`,options:i})}}class nG{constructor(t){this.httpClient=t}getPredictedDatapoints(t,i,r,n){return this.httpClient.request({method:"POST",url:or`asset/predicted/${t}/${i}`,data:r,options:n})}writePredictedDatapoints(t,i,r,n){return this.httpClient.request({method:"PUT",url:or`asset/predicted/${t}/${i}`,data:r,options:n})}}class nW{constructor(t){this.httpClient=t}register(t,i){return this.httpClient.request({method:"POST",url:or`console/register`,data:t,options:i})}}class nZ{constructor(t){this.httpClient=t}deleteConnections(t,i){return this.httpClient.request({method:"DELETE",url:or`gateway/connection`,queryParams:t,options:i})}getConnections(t){return this.httpClient.request({method:"GET",url:or`gateway/connection`,options:t})}deleteConnection(t,i){return this.httpClient.request({method:"DELETE",url:or`gateway/connection/${t}`,options:i})}getConnection(t,i){return this.httpClient.request({method:"GET",url:or`gateway/connection/${t}`,options:i})}setConnection(t,i,r){return this.httpClient.request({method:"PUT",url:or`gateway/connection/${t}`,data:i,options:r})}getConnectionStatus(t,i){return this.httpClient.request({method:"GET",url:or`gateway/status/${t}`,options:i})}}class nK{constructor(t){this.httpClient=t}startTunnel(t,i){return this.httpClient.request({method:"POST",url:or`gateway/tunnel`,data:t,options:i})}stopTunnel(t,i){return this.httpClient.request({method:"DELETE",url:or`gateway/tunnel`,data:t,options:i})}getAllActiveTunnelInfos(t,i){return this.httpClient.request({method:"GET",url:or`gateway/tunnel/${t}`,options:i})}getGatewayActiveTunnelInfos(t,i,r){return this.httpClient.request({method:"GET",url:or`gateway/tunnel/${t}/${i}`,options:r})}getActiveTunnelInfo(t,i,r,n,o){return this.httpClient.request({method:"GET",url:or`gateway/tunnel/${t}/${i}/${r}/${n}`,options:o})}}class nJ{constructor(t){this.httpClient=t}create(t,i){return this.httpClient.request({method:"POST",url:or`asset`,data:t,options:i})}delete(t,i){return this.httpClient.request({method:"DELETE",url:or`asset`,queryParams:t,options:i})}writeAttributeValues(t,i){return this.httpClient.request({method:"PUT",url:or`asset/attributes`,data:t,options:i})}writeAttributeEvents(t,i){return this.httpClient.request({method:"PUT",url:or`asset/attributes/timestamp`,data:t,options:i})}queryCount(t,i){return this.httpClient.request({method:"POST",url:or`asset/count`,data:t,options:i})}updateNoneParent(t,i){return this.httpClient.request({method:"DELETE",url:or`asset/parent`,queryParams:t,options:i})}getPartial(t,i){return this.httpClient.request({method:"GET",url:or`asset/partial/${t}`,options:i})}queryAssets(t,i){return this.httpClient.request({method:"POST",url:or`asset/query`,data:t,options:i})}queryAssetTree(t,i){return this.httpClient.request({method:"POST",url:or`asset/tree`,data:t,options:i})}getCurrentUserAssets(t){return this.httpClient.request({method:"GET",url:or`asset/user/current`,options:t})}createUserAssetLinks(t,i){return this.httpClient.request({method:"POST",url:or`asset/user/link`,data:t,options:i})}getUserAssetLinks(t,i){return this.httpClient.request({method:"GET",url:or`asset/user/link`,queryParams:t,options:i})}deleteUserAssetLinks(t,i){return this.httpClient.request({method:"POST",url:or`asset/user/link/delete`,data:t,options:i})}deleteAllUserAssetLinks(t,i,r){return this.httpClient.request({method:"DELETE",url:or`asset/user/link/${t}/${i}`,options:r})}deleteUserAssetLink(t,i,r,n){return this.httpClient.request({method:"DELETE",url:or`asset/user/link/${t}/${i}/${r}`,options:n})}get(t,i){return this.httpClient.request({method:"GET",url:or`asset/${t}`,options:i})}update(t,i,r){return this.httpClient.request({method:"PUT",url:or`asset/${t}`,data:i,options:r})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(t,i,r,n){return this.httpClient.request({method:"PUT",url:or`asset/${t}/attribute/${i}`,data:r,options:n})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(t,i,r,n,o){return this.httpClient.request({method:"PUT",url:or`asset/${t}/attribute/${i}/${r}`,data:n,options:o})}updateParent(t,i,r){return this.httpClient.request({method:"PUT",url:or`asset/${t}/child`,queryParams:i,options:r})}}class nX{constructor(t){this.httpClient=t}create(t,i){return this.httpClient.request({method:"POST",url:or`dashboard`,data:t,options:i})}update(t,i){return this.httpClient.request({method:"PUT",url:or`dashboard`,data:t,options:i})}getAllRealmDashboards(t,i){return this.httpClient.request({method:"GET",url:or`dashboard/all/${t}`,options:i})}query(t,i){return this.httpClient.request({method:"POST",url:or`dashboard/query`,data:t,options:i})}delete(t,i,r){return this.httpClient.request({method:"DELETE",url:or`dashboard/${t}/${i}`,options:r})}get(t,i,r){return this.httpClient.request({method:"GET",url:or`dashboard/${t}/${i}`,options:r})}}class nQ{constructor(t){this.httpClient=t}getHealthStatus(t){return this.httpClient.request({method:"GET",url:or`health`,options:t})}getInfo(t){return this.httpClient.request({method:"GET",url:or`info`,options:t})}}class n0{constructor(t){this.httpClient=t}getServices(t,i){return this.httpClient.request({method:"GET",url:or`service`,queryParams:t,options:i})}registerService(t,i){return this.httpClient.request({method:"POST",url:or`service`,data:t,options:i})}getGlobalServices(t){return this.httpClient.request({method:"GET",url:or`service/global`,options:t})}registerGlobalService(t,i){return this.httpClient.request({method:"POST",url:or`service/global`,data:t,options:i})}deregisterService(t,i,r){return this.httpClient.request({method:"DELETE",url:or`service/${t}/${i}`,options:r})}getService(t,i,r){return this.httpClient.request({method:"GET",url:or`service/${t}/${i}`,options:r})}heartbeat(t,i,r){return this.httpClient.request({method:"PUT",url:or`service/${t}/${i}`,options:r})}}class n1{constructor(t){this.httpClient=t}getManagerConfig(t){return this.httpClient.request({method:"GET",url:or`configuration/manager`,options:t})}update(t,i){return this.httpClient.request({method:"PUT",url:or`configuration/manager`,data:t,options:i})}imageUpload(t,i,r){return this.httpClient.request({method:"POST",url:or`configuration/manager/image`,queryParams:i,data:t,options:r})}getManagerConfigImage(t,i){return this.httpClient.request({method:"GET",url:or`configuration/manager/image/${t}`,options:i})}}class n2{constructor(t){this.httpClient=t}updateCurrentUserLocale(t,i){return this.httpClient.request({method:"PUT",url:or`user/locale`,data:t,options:i})}query(t,i){return this.httpClient.request({method:"POST",url:or`user/query`,data:t,options:i})}requestPasswordResetCurrent(t){return this.httpClient.request({method:"PUT",url:or`user/request-password-reset`,options:t})}updatePasswordCurrent(t,i){return this.httpClient.request({method:"PUT",url:or`user/reset-password`,data:t,options:i})}updateCurrent(t,i){return this.httpClient.request({method:"PUT",url:or`user/update`,data:t,options:i})}getCurrent(t){return this.httpClient.request({method:"GET",url:or`user/user`,options:t})}getCurrentUserRealmRoles(t){return this.httpClient.request({method:"GET",url:or`user/userRealmRoles`,options:t})}getCurrentUserClientRoles(t,i){return this.httpClient.request({method:"GET",url:or`user/userRoles/${t}`,options:i})}disconnectUserSession(t,i,r){return this.httpClient.request({method:"DELETE",url:or`user/${t}/disconnect/${i}`,options:r})}requestPasswordReset(t,i,r){return this.httpClient.request({method:"PUT",url:or`user/${t}/request-password-reset/${i}`,options:r})}updatePassword(t,i,r,n){return this.httpClient.request({method:"PUT",url:or`user/${t}/reset-password/${i}`,data:r,options:n})}resetSecret(t,i,r){return this.httpClient.request({method:"GET",url:or`user/${t}/reset-secret/${i}`,options:r})}updateRoles(t,i,r){return this.httpClient.request({method:"PUT",url:or`user/${t}/roles`,data:i,options:r})}getUserRealmRoles(t,i,r){return this.httpClient.request({method:"GET",url:or`user/${t}/userRealmRoles/${i}`,options:r})}updateUserRealmRoles(t,i,r,n){return this.httpClient.request({method:"PUT",url:or`user/${t}/userRealmRoles/${i}`,data:r,options:n})}getUserClientRoles(t,i,r,n){return this.httpClient.request({method:"GET",url:or`user/${t}/userRoles/${i}/${r}`,options:n})}updateUserClientRoles(t,i,r,n,o){return this.httpClient.request({method:"PUT",url:or`user/${t}/userRoles/${i}/${r}`,data:n,options:o})}getUserSessions(t,i,r){return this.httpClient.request({method:"GET",url:or`user/${t}/userSessions/${i}`,options:r})}create(t,i,r){return this.httpClient.request({method:"POST",url:or`user/${t}/users`,data:i,options:r})}update(t,i,r){return this.httpClient.request({method:"PUT",url:or`user/${t}/users`,data:i,options:r})}delete(t,i,r){return this.httpClient.request({method:"DELETE",url:or`user/${t}/users/${i}`,options:r})}getClientRoles(t,i,r){return this.httpClient.request({method:"GET",url:or`user/${t}/${i}/roles`,options:r})}updateClientRoles(t,i,r,n){return this.httpClient.request({method:"PUT",url:or`user/${t}/${i}/roles`,data:r,options:n})}get(t,i,r){return this.httpClient.request({method:"GET",url:or`user/${t}/${i}`,options:r})}}class n3{constructor(t){this.httpClient=t}createGlobalRuleset(t,i){return this.httpClient.request({method:"POST",url:or`rules`,data:t,options:i})}getGlobalRulesets(t,i){return this.httpClient.request({method:"GET",url:or`rules`,queryParams:t,options:i})}createAssetRuleset(t,i){return this.httpClient.request({method:"POST",url:or`rules/asset`,data:t,options:i})}getAssetRulesets(t,i,r){return this.httpClient.request({method:"GET",url:or`rules/asset/for/${t}`,queryParams:i,options:r})}deleteAssetRuleset(t,i){return this.httpClient.request({method:"DELETE",url:or`rules/asset/${t}`,options:i})}getAssetRuleset(t,i){return this.httpClient.request({method:"GET",url:or`rules/asset/${t}`,options:i})}updateAssetRuleset(t,i,r){return this.httpClient.request({method:"PUT",url:or`rules/asset/${t}`,data:i,options:r})}getAssetGeofences(t,i){return this.httpClient.request({method:"GET",url:or`rules/geofences/${t}`,options:i})}getAssetEngineInfo(t,i){return this.httpClient.request({method:"GET",url:or`rules/info/asset/${t}`,options:i})}getGlobalEngineInfo(t){return this.httpClient.request({method:"GET",url:or`rules/info/global`,options:t})}getRealmEngineInfo(t,i){return this.httpClient.request({method:"GET",url:or`rules/info/realm/${t}`,options:i})}createRealmRuleset(t,i){return this.httpClient.request({method:"POST",url:or`rules/realm`,data:t,options:i})}getRealmRulesets(t,i,r){return this.httpClient.request({method:"GET",url:or`rules/realm/for/${t}`,queryParams:i,options:r})}deleteRealmRuleset(t,i){return this.httpClient.request({method:"DELETE",url:or`rules/realm/${t}`,options:i})}getRealmRuleset(t,i){return this.httpClient.request({method:"GET",url:or`rules/realm/${t}`,options:i})}updateRealmRuleset(t,i,r){return this.httpClient.request({method:"PUT",url:or`rules/realm/${t}`,data:i,options:r})}deleteGlobalRuleset(t,i){return this.httpClient.request({method:"DELETE",url:or`rules/${t}`,options:i})}getGlobalRuleset(t,i){return this.httpClient.request({method:"GET",url:or`rules/${t}`,options:i})}updateGlobalRuleset(t,i,r){return this.httpClient.request({method:"PUT",url:or`rules/${t}`,data:i,options:r})}}class n5{constructor(t){this.httpClient=t}create(t,i){return this.httpClient.request({method:"POST",url:or`realm`,data:t,options:i})}getAll(t){return this.httpClient.request({method:"GET",url:or`realm`,options:t})}getAccessible(t){return this.httpClient.request({method:"GET",url:or`realm/accessible`,options:t})}delete(t,i){return this.httpClient.request({method:"DELETE",url:or`realm/${t}`,options:i})}get(t,i){return this.httpClient.request({method:"GET",url:or`realm/${t}`,options:i})}update(t,i,r){return this.httpClient.request({method:"PUT",url:or`realm/${t}`,data:i,options:r})}}class n4{constructor(t){this.httpClient=t}getSettings(t){return this.httpClient.request({method:"GET",url:or`map`,options:t})}saveSettings(t,i){return this.httpClient.request({method:"PUT",url:or`map`,data:t,options:i})}deleteMap(t){return this.httpClient.request({method:"DELETE",url:or`map/deleteMap`,options:t})}getCustomMapInfo(t){return this.httpClient.request({method:"GET",url:or`map/getCustomMapInfo`,options:t})}getTile(t,i,r,n){return this.httpClient.request({method:"GET",url:or`map/tile/${t}/${i}/${r}`,options:n})}uploadMap(t,i){return this.httpClient.request({method:"POST",url:or`map/upload`,queryParams:t,options:i})}}class n6{constructor(t){this.httpClient=t}doProtocolAssetDiscovery(t,i,r){return this.httpClient.request({method:"GET",url:or`agent/assetDiscovery/${t}`,queryParams:i,options:r})}doProtocolAssetImport(t,i,r,n){return this.httpClient.request({method:"POST",url:or`agent/assetImport/${t}`,queryParams:r,data:i,options:n})}doProtocolInstanceDiscovery(t,i,r){return this.httpClient.request({method:"GET",url:or`agent/instanceDiscovery/${t}`,queryParams:i,options:r})}}class n8{constructor(t){this.httpClient=t}getApps(t){return this.httpClient.request({method:"GET",url:or`apps`,options:t})}getConsoleConfig(t){return this.httpClient.request({method:"GET",url:or`apps/consoleConfig`,options:t})}getAppInfos(t){return this.httpClient.request({method:"GET",url:or`apps/info`,options:t})}}class n7{constructor(t){this.httpClient=t}getDatapointExport(t,i){return this.httpClient.request({method:"GET",url:or`asset/datapoint/export`,queryParams:t,options:i})}getDatapointPeriod(t,i){return this.httpClient.request({method:"GET",url:or`asset/datapoint/periods`,queryParams:t,options:i})}getDatapoints(t,i,r,n){return this.httpClient.request({method:"POST",url:or`asset/datapoint/${t}/${i}`,data:r,options:n})}}class n9{constructor(t){this.httpClient=t}createAlarm(t,i,r){return this.httpClient.request({method:"POST",url:or`alarm`,queryParams:i,data:t,options:r})}getAlarms(t,i){return this.httpClient.request({method:"GET",url:or`alarm`,queryParams:t,options:i})}removeAlarms(t,i){return this.httpClient.request({method:"DELETE",url:or`alarm`,data:t,options:i})}setAssetLinks(t,i){return this.httpClient.request({method:"PUT",url:or`alarm/assets`,data:t,options:i})}getAlarm(t,i){return this.httpClient.request({method:"GET",url:or`alarm/${t}`,options:i})}removeAlarm(t,i){return this.httpClient.request({method:"DELETE",url:or`alarm/${t}`,options:i})}updateAlarm(t,i,r){return this.httpClient.request({method:"PUT",url:or`alarm/${t}`,data:i,options:r})}getAssetLinks(t,i,r){return this.httpClient.request({method:"GET",url:or`alarm/${t}/assets`,queryParams:i,options:r})}}class oe{constructor(t){this.httpClient=t}createProvisioningConfig(t,i){return this.httpClient.request({method:"POST",url:or`provisioning`,data:t,options:i})}getProvisioningConfigs(t){return this.httpClient.request({method:"GET",url:or`provisioning`,options:t})}deleteProvisioningConfig(t,i){return this.httpClient.request({method:"DELETE",url:or`provisioning/${t}`,options:i})}updateProvisioningConfig(t,i,r){return this.httpClient.request({method:"PUT",url:or`provisioning/${t}`,data:i,options:r})}}class ot{constructor(t){this.httpClient=t}getNotifications(t,i){return this.httpClient.request({method:"GET",url:or`notification`,queryParams:t,options:i})}removeNotifications(t,i){return this.httpClient.request({method:"DELETE",url:or`notification`,queryParams:t,options:i})}sendNotification(t,i){return this.httpClient.request({method:"POST",url:or`notification/alert`,data:t,options:i})}getNotificationsCount(t,i){return this.httpClient.request({method:"GET",url:or`notification/count`,queryParams:t,options:i})}removeNotification(t,i){return this.httpClient.request({method:"DELETE",url:or`notification/${t}`,options:i})}notificationAcknowledged(t,i,r,n){return this.httpClient.request({method:"PUT",url:or`notification/${t}/acknowledged`,queryParams:r,data:i,options:n})}notificationDelivered(t,i,r){return this.httpClient.request({method:"PUT",url:or`notification/${t}/delivered`,queryParams:i,options:r})}}class oi{constructor(t){this.httpClient=t}getAssetDescriptors(t,i){return this.httpClient.request({method:"GET",url:or`model/assetDescriptors`,queryParams:t,options:i})}getAssetInfo(t,i,r){return this.httpClient.request({method:"GET",url:or`model/assetInfo/${t}`,queryParams:i,options:r})}getAssetInfos(t,i){return this.httpClient.request({method:"GET",url:or`model/assetInfos`,queryParams:t,options:i})}getValueDescriptorSchema(t,i){return this.httpClient.request({method:"GET",url:or`model/getValueDescriptorSchema`,queryParams:t,options:i})}getMetaItemDescriptors(t,i){return this.httpClient.request({method:"GET",url:or`model/metaItemDescriptors`,queryParams:t,options:i})}getValueDescriptors(t,i){return this.httpClient.request({method:"GET",url:or`model/valueDescriptors`,queryParams:t,options:i})}}function or(t,...i){let r="";for(let n=0;n<i.length;n++)r+=t[n],r+=encodeURIComponent(i[n]);return r+t[t.length-1]}class on{constructor(t,i=nV.create()){this._syslogResource=new oa(t,i),this._flowResource=new os(t,i),this._assetPredictedDatapointResource=new ol(t,i),this._consoleResource=new oc(t,i),this._gatewayClientResource=new od(t,i),this._gatewayServiceResource=new ou(t,i),this._assetResource=new oh(t,i),this._dashboardResource=new om(t,i),this._statusResource=new of(t,i),this._externalServiceResource=new op(t,i),this._configurationResource=new o_(t,i),this._userResource=new og(t,i),this._rulesResource=new ob(t,i),this._realmResource=new oy(t,i),this._mapResource=new ov(t,i),this._agentResource=new oF(t,i),this._appResource=new ox(t,i),this._assetDatapointResource=new ow(t,i),this._alarmResource=new oE(t,i),this._provisioningResource=new ok(t,i),this._notificationResource=new oM(t,i),this._assetModelResource=new oD(t,i),this._assetResource=new oh(t,i)}get SyslogResource(){return this._syslogResource}get FlowResource(){return this._flowResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get ConsoleResource(){return this._consoleResource}get GatewayClientResource(){return this._gatewayClientResource}get GatewayServiceResource(){return this._gatewayServiceResource}get AssetResource(){return this._assetResource}get DashboardResource(){return this._dashboardResource}get StatusResource(){return this._statusResource}get ExternalServiceResource(){return this._externalServiceResource}get ConfigurationResource(){return this._configurationResource}get UserResource(){return this._userResource}get RulesResource(){return this._rulesResource}get RealmResource(){return this._realmResource}get MapResource(){return this._mapResource}get AgentResource(){return this._agentResource}get AppResource(){return this._appResource}get AssetDatapointResource(){return this._assetDatapointResource}get AlarmResource(){return this._alarmResource}get ProvisioningResource(){return this._provisioningResource}get NotificationResource(){return this._notificationResource}get AssetModelResource(){return this._assetModelResource}}class oo{constructor(t){this.axios=t}request(t){let i={};i.method=t.method,i.url=t.url,i.params=t.queryParams,i.data=t.data,function(t,i){if(void 0!=i)for(let r in i)i.hasOwnProperty(r)&&(t[r]=i[r])}(i,t.options);let r=t.copyFn;return this.axios.request(i).then(t=>(r&&t.data&&(t.originalData=t.data,t.data=r(t.data)),t))}}class oa extends n${constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class os extends nq{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class ol extends nG{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class oc extends nW{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class od extends nZ{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class ou extends nK{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class oh extends nJ{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class om extends nX{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class of extends nQ{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class op extends n0{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class o_ extends n1{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class og extends n2{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class ob extends n3{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class oy extends n5{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class ov extends n4{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class oF extends n6{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class ox extends n8{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class ow extends n7{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class oE extends n9{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class ok extends oe{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class oM extends ot{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}class oD extends oi{constructor(t,i=nV.create()){i.defaults.baseURL=t,super(new oo(i))}}var oT=r(8183),oA=r.n(oT);nV.isAxiosError;let oC=new class{get api(){return this._client}constructor(){this._axiosInstance=nV.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(t=>(t.paramsSerializer=t=>oA().stringify(t,{arrayFormat:"repeat"}),t))}get axiosInstance(){return this._axiosInstance}get baseUrl(){return this._baseUrl}setTimeout(t){this._axiosInstance.defaults.timeout=t}addRequestInterceptor(t){this._axiosInstance.interceptors.request.use(t)}initialise(t){this._baseUrl=t,this._client=new on(t,this._axiosInstance)}};var oS=function(t,i,r,n){return new(r||(r=Promise))(function(o,a){function s(t){try{c(n.next(t))}catch(t){a(t)}}function l(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var i;t.done?o(t.value):((i=t.value)instanceof r?i:new r(function(t){t(i)})).then(s,l)}c((n=n.apply(t,i||[])).next())})};(eE=tM||(tM={})).DISCONNECTED="DISCONNECTED",eE.CONNECTED="CONNECTED",eE.CONNECTING="CONNECTING";let oL="SUBSCRIBED:",oP="UNAUTHORIZED:",oI="TRIGGERED:",oR="EVENT:";class oB{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=oO.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=tM.DISCONNECTED,this._connectingDeferred=null,this._statusCallbacks=[],this._pendingSubscription=null,this._queuedSubscriptions=[],this._subscriptionMap=new Map,this._assetEventCallbackMap=new Map,this._attributeEventCallbackMap=new Map,this._unloading=!1}get status(){return this._status}subscribeStatusChange(t){this._statusCallbacks.push(t)}unsubscribeStatusChange(t){!function(t,i){if(0===t.length)return;let r=t.indexOf(i);r>=0&&t.splice(r,1)}(this._statusCallbacks,t)}connect(){return(console.debug("Attempting to connect to events:",this.endpointUrl),this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._status===tM.CONNECTED)?(console.debug("Already connected to events!"),Promise.resolve(!0)):((this._disconnectRequested=!1,this._connectingDeferred)?console.warn("Already connecting to events, continuing the previous one."):(this._onStatusChanged(tM.CONNECTING),this._connectingDeferred=new im,this._doConnect().then(t=>{if(this._connectingDeferred){let i=this._connectingDeferred;t?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=oO.MIN_RECONNECT_DELAY,this._onStatusChanged(tM.CONNECTED),window.setTimeout(()=>{this._onConnect()},0)):console.debug("Failed to connect to event service: "+this.endpointUrl),i.resolve(t)}}).finally(()=>{this._connectingDeferred=null})),this._connectingDeferred.promise)}disconnect(){console.debug("Disconnecting from event service: "+this.endpointUrl),this._disconnectRequested||(this._disconnectRequested=!0,this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this.status!==tM.DISCONNECTED&&this._doDisconnect())}subscribe(t,i){let r={eventSubscription:t,callback:i,deferred:new im};return null!=this._pendingSubscription||this._status!==tM.CONNECTED?(this._queuedSubscriptions.push(r),r.deferred.promise):(this._pendingSubscription=r,this._doSubscribe(t).then(t=>{if(this._pendingSubscription){let i=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(t,i),this._processNextSubscription();let r=i.deferred;i.deferred=null,r&&r.resolve(t)}},t=>{if(console.error(t),this._pendingSubscription){let i=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();let r=i.deferred;i.deferred=null,r&&r.reject(t)}}),this._pendingSubscription.deferred.promise)}unsubscribe(t){return oS(this,void 0,void 0,function*(){if(this._subscriptionMap.delete(t))return void this._doUnsubscribe(t);if(this._assetEventCallbackMap.delete(t)){if(this._assetEventPromise&&0===this._assetEventCallbackMap.size){let t=yield this._assetEventPromise;this._assetEventPromise=void 0,this.unsubscribe(t)}return}if(this._attributeEventCallbackMap.delete(t)&&this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){let t=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(t)}})}sendEvent(t){this._status===tM.CONNECTED&&this._doSend(t)}sendEventWithReply(t){return this._status!==tM.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(t)}subscribeAssetEvents(t,i,r){return oS(this,void 0,void 0,function*(){let n=t&&"string"!=typeof t[0]?t.map(t=>t.id):t,o="AssetEvent"+oB._subscriptionCounter++;if(!this._assetEventPromise){let t;sk.authenticated||(t={filterType:"asset",realm:sk.displayRealm});let i={eventType:"asset",filter:t};this._assetEventPromise=this.subscribe(i,t=>{this._assetEventCallbackMap.forEach(i=>i(t))})}return this._assetEventCallbackMap.set(o,t=>{let i=t.asset.id;n?n.find(t=>i===t)&&r(t):t.asset.realm===sk.displayRealm&&r(t)}),this._assetEventPromise.then(()=>{try{if(n&&i){let t={messageID:"read-assets:"+n.join(",")+":"+o,eventType:"read-assets",assetQuery:{ids:n}};this.sendEventWithReply(t).then(t=>{t.assets&&this._assetEventCallbackMap.has(o)&&t.assets.forEach(t=>{r({eventType:"asset",asset:t,cause:"READ"})})})}}catch(i){throw console.error("Failed to subscribe to asset events for assets: "+t),o&&this.unsubscribe(o),i}return o})})}subscribeAttributeEvents(t,i,r){return oS(this,void 0,void 0,function*(){let n=t&&"string"!=typeof t[0],o=n?t.map(t=>t.id):t,a=n?t:void 0,s="AttributeEvent"+oB._subscriptionCounter++;if(!this._attributeEventPromise){let t;sk.authenticated||(t={filterType:"asset",realm:sk.displayRealm});let i={eventType:"attribute",filter:t};this._attributeEventPromise=this.subscribe(i,t=>{this._attributeEventCallbackMap.forEach(i=>i(t))})}let l=i=>{let a=i.ref;n?t.forEach(t=>{a.id===t.id&&a.name===t.name&&r(i)}):o?o.find(t=>a.id===t)&&r(i):i.realm===sk.displayRealm&&r(i)};return this._attributeEventCallbackMap.set(s,l),this._attributeEventPromise.then(()=>{try{if(i&&o){let t={messageID:"read-assets:"+o.join(",")+":"+s,eventType:"read-assets",assetQuery:{ids:o}};this.sendEventWithReply(t).then(t=>{t.assets&&this._attributeEventCallbackMap.has(s)&&t.assets.forEach(t=>{t.attributes&&Object.entries(t.attributes).forEach(([i,r])=>{(!a||a.find(r=>r.id===t.id&&r.name===i))&&l({eventType:"attribute",timestamp:r.timestamp,value:r.value,ref:{id:t.id,name:i}})})})})}}catch(i){throw console.error("Failed to subscribe to asset events for assets: "+t),s&&this.unsubscribe(s),i}return s})})}_processNextSubscription(){this._status===tM.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{let t=this._queuedSubscriptions.shift();t&&this.subscribe(t.eventSubscription,t.callback).then(i=>{let r=t.deferred;t.deferred=null,r&&r.resolve(i)},i=>{let r=t.deferred;t.deferred=null,r&&r.reject(i)})},0)}_onStatusChanged(t){t!==this._status&&(console.debug("Event provider status changed: "+t),this._status=t,this._unloading||window.setTimeout(()=>{this._statusCallbacks.forEach(i=>i(t))},0))}_onMessageReceived(t,i){let r=this._subscriptionMap.get(t);r&&r.callback(i)}_onConnect(){if(Object.keys(this._subscriptionMap).length>0){for(let t in this._subscriptionMap)this._subscriptionMap.has(t)&&this._queuedSubscriptions.unshift(this._subscriptionMap.get(t));this._subscriptionMap.clear()}this._processNextSubscription()}_onDisconnect(){this._status===tM.CONNECTED&&this._onStatusChanged(tM.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(tM.CONNECTING),this._scheduleReconnect()}_scheduleReconnect(){this._reconnectTimer||!this._disconnectRequested&&(console.debug("Event provider scheduling reconnect in "+this._reconnectDelayMillis+"ms"),this._reconnectTimer=window.setTimeout(()=>{this._disconnectRequested||this.connect()},this._reconnectDelayMillis),this._reconnectDelayMillis<oO.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(oO.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}oB.MIN_RECONNECT_DELAY=0,oB.MAX_RECONNECT_DELAY=3e4,oB._subscriptionCounter=0;class oO extends oB{get endpointUrl(){return this._endpointUrl}constructor(t){super(),this._webSocket=void 0,this._connectDeferred=null,this._subscribeDeferred=null,this._repliesDeferred=new Map,this._endpointUrl=(t.startsWith("https:")?"wss":"ws")+"://"+t.substr(t.indexOf("://")+3)+"/websocket/events",window.addEventListener("beforeunload",()=>{this._unloading=!0,this.disconnect()})}_doConnect(){let t=this._endpointUrl+"?Realm="+sk.config.realm;return this._connectDeferred=new im,(sk.authenticated?sk.retrieveAuthorizationHeader().then(i=>{t+="&Authorization="+i}):Promise.resolve()).finally(()=>{this._webSocket=new WebSocket(t),this._webSocket.onopen=t=>{if(this._connectDeferred){let t=this._connectDeferred;this._connectDeferred=null,t.resolve(!0)}},this._webSocket.onerror=t=>{if(console.error("Event provider error:",t),this._connectDeferred){let t=this._connectDeferred;this._connectDeferred=null,t.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onclose=()=>{if(console.warn("The WebSocket connection of the event provider has been closed."),this._webSocket=void 0,this._connectDeferred){let t=this._connectDeferred;this._connectDeferred=null,t.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onmessage=t=>{let i=t.data;if(i&&i.startsWith(oL)){let t=JSON.parse(i.substring(oL.length)),r=this._subscribeDeferred;this._subscribeDeferred=null,r&&r.resolve(t.subscriptionId)}else if(i.startsWith(oP)){let t=JSON.parse(i.substring(oP.length)),r=this._subscribeDeferred;this._subscribeDeferred=null,r&&(console.warn("Unauthorized event subscription: "+JSON.stringify(t,null,2)),r.reject("Unauthorized"))}else if(i.startsWith(oI)){let t=JSON.parse(i.substring(oI.length));t.events&&t.events.forEach(i=>{this._onMessageReceived(t.subscriptionId,i)})}else if(i.startsWith(oR)){let t=JSON.parse(i.substring(oR.length));if(t.messageID){let i=this._repliesDeferred.get(t.messageID);this._repliesDeferred.delete(t.messageID),i&&i.resolve(t)}}}}),this._connectDeferred.promise}_beforeDisconnect(){this._onDisconnect()}_doDisconnect(){var t;null==(t=this._webSocket)||t.close(),this._subscribeDeferred=null,this._repliesDeferred.clear()}_doSubscribe(t){return this._webSocket?this._subscribeDeferred?Promise.reject("There's already a pending subscription"):(this._subscribeDeferred=new im,t.subscriptionId||(t.subscriptionId=oO._subscriptionCounter+++""),this._webSocket.send("SUBSCRIBE:"+JSON.stringify(t)),this._subscribeDeferred.promise):Promise.reject("Not connected")}_doUnsubscribe(t){this._webSocket&&this._webSocket.send("UNSUBSCRIBE:"+JSON.stringify({subscriptionId:t}))}_doSend(t){let i=oR+JSON.stringify(t);this._webSocket.send(i)}_doSendWithReply(t){if(t.messageID||(t.messageID=(new Date().getTime()+10*Math.random()).toString(10)),this._repliesDeferred.has(t.messageID))return Promise.reject("There's already a pending send and reply with this ID");let i=new im;return this._repliesDeferred.set(t.messageID,i),this._webSocket.send(oR+JSON.stringify(t)),i.promise}}oO._subscriptionCounter=1;let oz=["__proto__","constructor","prototype"];function oY(t){return!("string"!=typeof t||0===t.length||t.length>128||oz.indexOf(t)>-1||t.indexOf("..")>-1||t.indexOf("\\")>-1||/[?#%:&=;\s]/.test(t)||/[\x00-\x1F\x7F]/.test(t))}function oj(t){return!(!oY(t)||t.indexOf("/")>-1||t.indexOf("@")>-1)}let oN={lng:oj,ns:function(t){return!(!oY(t)||t.indexOf("//")>-1)}};function oU(t){return"string"!=typeof t?t:t.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function oH(){return"function"==typeof XMLHttpRequest||"object"==typeof XMLHttpRequest}let oV=/\{\{(.+?)\}\}/g,o$=/^[/\\]{2}/;function oq(t,i){let r=!1,n=t.replace(oV,(t,n)=>{let o=n.trim();if(oz.indexOf(o)>-1)return t;let a=i[o];if(null==a)return t;let s=oN[o]||oj,l=String(a).split("+");for(let i of l)if(!s(i))return r=!0,t;return l.join("+")});return r||o$.test(n)&&!o$.test(t)?null:n}let oG="u">typeof globalThis?globalThis:"u">typeof global?global:"u">typeof window?window:void 0;"function"==typeof fetch?t=fetch:oG&&"function"==typeof oG.fetch&&(t=oG.fetch);let oW=oH()&&oG?oG.XMLHttpRequest:void 0,oZ="function"==typeof ActiveXObject&&oG?oG.ActiveXObject:void 0,oK=["__proto__","constructor","prototype"],oJ=(t,i)=>{if(i&&"object"==typeof i){let r="";for(let t of Object.keys(i))oK.indexOf(t)>-1||(r+="&"+encodeURIComponent(t)+"="+encodeURIComponent(i[t]));if(!r)return t;t=t+(-1!==t.indexOf("?")?"&":"?")+r.slice(1)}return t},oX=(i,r,n,o)=>{let a=t=>{if(!t.ok)return n(t.statusText||"Error",{status:t.status});t.text().then(i=>{n(null,{status:t.status,data:i})}).catch(n)};if(o){let t=o(i,r);if(t instanceof Promise)return void t.then(a).catch(n)}"function"==typeof fetch?fetch(i,r).then(a).catch(n):t(i,r).then(a).catch(n)},oQ=(i,r,n,o)=>{if("function"==typeof n&&(o=n,n=void 0),o=o||(()=>{}),t&&0!==r.indexOf("file:")){var a=r,s=n,l=o;i.queryStringParams&&(a=oJ(a,i.queryStringParams));let t={..."function"==typeof i.customHeaders?i.customHeaders():i.customHeaders};"u"<typeof window&&"u">typeof global&&void 0!==global.process&&global.process.versions&&global.process.versions.node&&(t["User-Agent"]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),s&&(t["Content-Type"]="application/json");let c="function"==typeof i.requestOptions?i.requestOptions(s):i.requestOptions,d={method:s?"POST":"GET",body:s?i.stringify(s):void 0,headers:t,...i._omitFetchOptions?{}:c},u="function"==typeof i.alternateFetch&&i.alternateFetch.length>=1?i.alternateFetch:void 0;try{oX(a,d,l,u)}catch(t){if(!c||0===Object.keys(c).length||!t.message||0>t.message.indexOf("not implemented"))return l(t);try{Object.keys(c).forEach(t=>{delete d[t]}),oX(a,d,l,u),i._omitFetchOptions=!0}catch(t){l(t)}}return}if(oH()||"function"==typeof ActiveXObject){var c=r,d=n,u=o;d&&"object"==typeof d&&(d=oJ("",d).slice(1)),i.queryStringParams&&(c=oJ(c,i.queryStringParams));try{let t=oW?new oW:new oZ("MSXML2.XMLHTTP.3.0");t.open(d?"POST":"GET",c,1),i.crossDomain||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=!!i.withCredentials,d&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.overrideMimeType&&t.overrideMimeType("application/json");let r=i.customHeaders;if(r="function"==typeof r?r():r)for(let i of Object.keys(r))oK.indexOf(i)>-1||t.setRequestHeader(i,r[i]);t.onreadystatechange=()=>{t.readyState>3&&u(t.status>=400?t.statusText:null,{status:t.status,data:t.responseText})},t.send(d)}catch(t){console&&console.log(t)}return}o(Error("No fetch and no xhr implementation found!"))};var o0=class{constructor(t,i={},r={}){this.services=t,this.options=i,this.allOptions=r,this.type="backend",this.init(t,i,r)}init(t,i={},r={}){if(this.services=t,this.options={...{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:t=>JSON.parse(t),stringify:JSON.stringify,parsePayload:(t,i,r)=>({[i]:r||""}),parseLoadPayload:(t,i)=>void 0,request:oQ,reloadInterval:"u"<typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}},...this.options||{},...i},this.allOptions=r,this.services&&this.options.reloadInterval){let t=setInterval(()=>this.reload(),this.options.reloadInterval);"object"==typeof t&&"function"==typeof t.unref&&t.unref()}}readMulti(t,i,r){this._readAny(t,t,i,i,r)}read(t,i,r){this._readAny([t],t,[i],i,r)}_readAny(t,i,r,n,o){var a,s;let l=this.options.loadPath;"function"==typeof this.options.loadPath&&(l=this.options.loadPath(t,r)),(l=(s=a=l)&&"function"==typeof s.then?a:Promise.resolve(a)).then(a=>{if(!a)return o(null,{});let s=oq(a,{lng:t.join("+"),ns:r.join("+")});if(null==s)return o(Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+t.map(oU).join(", ")+"] namespaces=["+r.map(oU).join(", ")+"]"),!1);this.loadUrl(s,o,i,n)})}loadUrl(t,i,r,n){let o=this.options.parseLoadPayload("string"==typeof r?[r]:r,"string"==typeof n?[n]:n),a=oU(function(t){if("string"!=typeof t||0===t.length)return t;try{let i=new URL(t);if(i.username||i.password)return i.username="",i.password="",i.toString();return t}catch(i){return t.replace(/(\/\/)[^/@\s]+@/g,"$1")}}(t));this.options.request(this.options,t,o,(t,o)=>{let s,l;if(o&&(o.status>=500&&o.status<600||!o.status))return i("failed loading "+a+"; status code: "+o.status,!0);if(o&&o.status>=400&&o.status<500)return i("failed loading "+a+"; status code: "+o.status,!1);if(!o&&t&&t.message){let r=t.message.toLowerCase();if(["failed","fetch","network","load"].find(t=>r.indexOf(t)>-1))return i("failed loading "+a+": "+oU(t.message),!0)}if(t)return i(t,!1);try{s="string"==typeof o.data?this.options.parse(o.data,r,n):o.data}catch(t){l="failed parsing "+a+" to json"}if(l)return i(l,!1);i(null,s)})}create(t,i,r,n,o){if(!this.options.addPath)return;"string"==typeof t&&(t=[t]);let a=this.options.parsePayload(i,r,n),s=0,l=[],c=[];t.forEach(r=>{let n=this.options.addPath;"function"==typeof this.options.addPath&&(n=this.options.addPath(r,i));let d=oq(n,{lng:r,ns:i});if(null==d){s+=1,o&&s===t.length&&o(l,c);return}this.options.request(this.options,d,a,(i,r)=>{s+=1,l.push(i),c.push(r),s===t.length&&"function"==typeof o&&o(l,c)})})}reload(){let{backendConnector:t,languageUtils:i,logger:r}=this.services,n=t.language;if(n&&"cimode"===n.toLowerCase())return;let o=[],a=t=>{i.toResolveHierarchy(t).forEach(t=>{0>o.indexOf(t)&&o.push(t)})};a(n),this.allOptions.preload&&this.allOptions.preload.forEach(t=>a(t)),o.forEach(i=>{this.allOptions.ns.forEach(n=>{t.read(i,n,"read",null,null,(o,a)=>{o&&r.warn(`loading namespace ${n} for language ${i} failed`,o),!o&&a&&r.log(`loaded namespace ${n} for language ${i}`,a),t.loaded(`${i}|${n}`,o,a)})})})}};o0.type="backend";let o1=globalThis,o2=o1.ShadowRoot&&(void 0===o1.ShadyCSS||o1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o3=Symbol(),o5=new WeakMap;class o4{constructor(t,i,r){if(this._$cssResult$=!0,r!==o3)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=i}get styleSheet(){let t=this.o,i=this.t;if(o2&&void 0===t){let r=void 0!==i&&1===i.length;r&&(t=o5.get(i)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&o5.set(i,t))}return t}toString(){return this.cssText}}let o6=t=>new o4("string"==typeof t?t:t+"",void 0,o3),o8=(t,...i)=>new o4(1===t.length?t[0]:i.reduce((i,r,n)=>i+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[n+1],t[0]),t,o3),o7=(t,i)=>{if(o2)t.adoptedStyleSheets=i.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let r of i){let i=document.createElement("style"),n=o1.litNonce;void 0!==n&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)}},o9=o2?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let i="";for(let r of t.cssRules)i+=r.cssText;return o6(i)})(t):t,{is:ae,defineProperty:at,getOwnPropertyDescriptor:ai,getOwnPropertyNames:ar,getOwnPropertySymbols:an,getPrototypeOf:ao}=Object,aa=globalThis,as=aa.trustedTypes,al=as?as.emptyScript:"",ac=aa.reactiveElementPolyfillSupport,ad={toAttribute(t,i){switch(i){case Boolean:t=t?al:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let r=t;switch(i){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(t){r=null}}return r}},au=(t,i)=>!ae(t,i),ah={attribute:!0,type:String,converter:ad,reflect:!1,useDefault:!1,hasChanged:au};Symbol.metadata??=Symbol("metadata"),aa.litPropertyMetadata??=new WeakMap;class am extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,i=ah){if(i.state&&(i.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((i=Object.create(i)).wrapped=!0),this.elementProperties.set(t,i),!i.noAccessor){let r=Symbol(),n=this.getPropertyDescriptor(t,r,i);void 0!==n&&at(this.prototype,t,n)}}static getPropertyDescriptor(t,i,r){let{get:n,set:o}=ai(this.prototype,t)??{get(){return this[i]},set(t){this[i]=t}};return{get:n,set(i){let a=n?.call(this);o?.call(this,i),this.requestUpdate(t,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??ah}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;let t=ao(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){let t=this.properties;for(let i of[...ar(t),...an(t)])this.createProperty(i,t[i])}let t=this[Symbol.metadata];if(null!==t){let i=litPropertyMetadata.get(t);if(void 0!==i)for(let[t,r]of i)this.elementProperties.set(t,r)}for(let[t,i]of(this._$Eh=new Map,this.elementProperties)){let r=this._$Eu(t,i);void 0!==r&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let i=[];if(Array.isArray(t))for(let r of new Set(t.flat(1/0).reverse()))i.unshift(o9(r));else void 0!==t&&i.push(o9(t));return i}static _$Eu(t,i){let r=i.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map;for(let i of this.constructor.elementProperties.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return o7(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,i,r){this._$AK(t,r)}_$ET(t,i){let r=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,r);if(void 0!==n&&!0===r.reflect){let o=(void 0!==r.converter?.toAttribute?r.converter:ad).toAttribute(i,r.type);this._$Em=t,null==o?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(t,i){let r=this.constructor,n=r._$Eh.get(t);if(void 0!==n&&this._$Em!==n){let t=r.getPropertyOptions(n),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:ad;this._$Em=n;let a=o.fromAttribute(i,t.type);this[n]=a??this._$Ej?.get(n)??a,this._$Em=null}}requestUpdate(t,i,r){if(void 0!==t){let n=this.constructor,o=this[t];if(!(((r??=n.getPropertyOptions(t)).hasChanged??au)(o,i)||r.useDefault&&r.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,r))))return;this.C(t,i,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,i,{useDefault:r,reflect:n,wrapped:o},a){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,a??i??this[t]),!0!==o||void 0!==a)||(this._$AL.has(t)||(this.hasUpdated||r||(i=void 0),this._$AL.set(t,i)),!0===n&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[t,i]of this._$Ep)this[t]=i;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[i,r]of t){let{wrapped:t}=r,n=this[i];!0!==t||this._$AL.has(i)||void 0===n||this.C(i,void 0,r,n)}}let t=!1,i=this._$AL;try{(t=this.shouldUpdate(i))?(this.willUpdate(i),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(i)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(i)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}am.elementStyles=[],am.shadowRootOptions={mode:"open"},am.elementProperties=new Map,am.finalized=new Map,ac?.({ReactiveElement:am}),(aa.reactiveElementVersions??=[]).push("2.1.1");let af=globalThis,ap=af.trustedTypes,a_=ap?ap.createPolicy("lit-html",{createHTML:t=>t}):void 0,ag="$lit$",ab=`lit$${Math.random().toFixed(9).slice(2)}$`,ay="?"+ab,av=`<${ay}>`,aF=document,ax=()=>aF.createComment(""),aw=t=>null===t||"object"!=typeof t&&"function"!=typeof t,aE=Array.isArray,ak=t=>aE(t)||"function"==typeof t?.[Symbol.iterator],aM="[ \n\f\r]",aD=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,aT=/-->/g,aA=/>/g,aC=RegExp(`>|${aM}(?:([^\\s"'>=/]+)(${aM}*=${aM}*(?:[^
|
|
818
818
|
\f\r"'\`<>=]|("|')|))|$)`,"g"),aS=/'/g,aL=/"/g,aP=/^(?:script|style|textarea|title)$/i,aI=t=>(i,...r)=>({_$litType$:t,strings:i,values:r}),aR=aI(1),aB=aI(2),aO=Symbol.for("lit-noChange"),az=Symbol.for("lit-nothing"),aY=new WeakMap,aj=aF.createTreeWalker(aF,129);function aN(t,i){if(!aE(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==a_?a_.createHTML(i):i}let aU=(t,i)=>{let r=t.length-1,n=[],o,a=2===i?"<svg>":3===i?"<math>":"",s=aD;for(let i=0;i<r;i++){let r=t[i],l,c,d=-1,u=0;for(;u<r.length&&(s.lastIndex=u,null!==(c=s.exec(r)));)u=s.lastIndex,s===aD?"!--"===c[1]?s=aT:void 0!==c[1]?s=aA:void 0!==c[2]?(aP.test(c[2])&&(o=RegExp("</"+c[2],"g")),s=aC):void 0!==c[3]&&(s=aC):s===aC?">"===c[0]?(s=o??aD,d=-1):void 0===c[1]?d=-2:(d=s.lastIndex-c[2].length,l=c[1],s=void 0===c[3]?aC:'"'===c[3]?aL:aS):s===aL||s===aS?s=aC:s===aT||s===aA?s=aD:(s=aC,o=void 0);let h=s===aC&&t[i+1].startsWith("/>")?" ":"";a+=s===aD?r+av:d>=0?(n.push(l),r.slice(0,d)+ag+r.slice(d)+ab+h):r+ab+(-2===d?i:h)}return[aN(t,a+(t[r]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),n]};class aH{constructor({strings:t,_$litType$:i},r){let n;this.parts=[];let o=0,a=0;const s=t.length-1,l=this.parts,[c,d]=aU(t,i);if(this.el=aH.createElement(c,r),aj.currentNode=this.el.content,2===i||3===i){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=aj.nextNode())&&l.length<s;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(ag)){const i=d[a++],r=n.getAttribute(t).split(ab),s=/([.?@])?(.*)/.exec(i);l.push({type:1,index:o,name:s[2],strings:r,ctor:"."===s[1]?aW:"?"===s[1]?aZ:"@"===s[1]?aK:aG}),n.removeAttribute(t)}else t.startsWith(ab)&&(l.push({type:6,index:o}),n.removeAttribute(t));if(aP.test(n.tagName)){const t=n.textContent.split(ab),i=t.length-1;if(i>0){n.textContent=ap?ap.emptyScript:"";for(let r=0;r<i;r++)n.append(t[r],ax()),aj.nextNode(),l.push({type:2,index:++o});n.append(t[i],ax())}}}else if(8===n.nodeType)if(n.data===ay)l.push({type:2,index:o});else{let t=-1;for(;-1!==(t=n.data.indexOf(ab,t+1));)l.push({type:7,index:o}),t+=ab.length-1}o++}}static createElement(t,i){let r=aF.createElement("template");return r.innerHTML=t,r}}function aV(t,i,r=t,n){if(i===aO)return i;let o=void 0!==n?r._$Co?.[n]:r._$Cl,a=aw(i)?void 0:i._$litDirective$;return o?.constructor!==a&&(o?._$AO?.(!1),void 0===a?o=void 0:(o=new a(t))._$AT(t,r,n),void 0!==n?(r._$Co??=[])[n]=o:r._$Cl=o),void 0!==o&&(i=aV(t,o._$AS(t,i.values),o,n)),i}class a${constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:i},parts:r}=this._$AD,n=(t?.creationScope??aF).importNode(i,!0);aj.currentNode=n;let o=aj.nextNode(),a=0,s=0,l=r[0];for(;void 0!==l;){if(a===l.index){let i;2===l.type?i=new aq(o,o.nextSibling,this,t):1===l.type?i=new l.ctor(o,l.name,l.strings,this,t):6===l.type&&(i=new aJ(o,this,t)),this._$AV.push(i),l=r[++s]}a!==l?.index&&(o=aj.nextNode(),a++)}return aj.currentNode=aF,n}p(t){let i=0;for(let r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,i),i+=r.strings.length-2):r._$AI(t[i])),i++}}class aq{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,r,n){this.type=2,this._$AH=az,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){aw(t=aV(this,t,i))?t===az||null==t||""===t?(this._$AH!==az&&this._$AR(),this._$AH=az):t!==this._$AH&&t!==aO&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):ak(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==az&&aw(this._$AH)?this._$AA.nextSibling.data=t:this.T(aF.createTextNode(t)),this._$AH=t}$(t){let{values:i,_$litType$:r}=t,n="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=aH.createElement(aN(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(i);else{let t=new a$(n,this),r=t.u(this.options);t.p(i),this.T(r),this._$AH=t}}_$AC(t){let i=aY.get(t.strings);return void 0===i&&aY.set(t.strings,i=new aH(t)),i}k(t){aE(this._$AH)||(this._$AH=[],this._$AR());let i=this._$AH,r,n=0;for(let o of t)n===i.length?i.push(r=new aq(this.O(ax()),this.O(ax()),this,this.options)):r=i[n],r._$AI(o),n++;n<i.length&&(this._$AR(r&&r._$AB.nextSibling,n),i.length=n)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t!==this._$AB;){let i=t.nextSibling;t.remove(),t=i}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class aG{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,r,n,o){this.type=1,this._$AH=az,this._$AN=void 0,this.element=t,this.name=i,this._$AM=n,this.options=o,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=az}_$AI(t,i=this,r,n){let o=this.strings,a=!1;if(void 0===o)(a=!aw(t=aV(this,t,i,0))||t!==this._$AH&&t!==aO)&&(this._$AH=t);else{let n,s,l=t;for(t=o[0],n=0;n<o.length-1;n++)(s=aV(this,l[r+n],i,n))===aO&&(s=this._$AH[n]),a||=!aw(s)||s!==this._$AH[n],s===az?t=az:t!==az&&(t+=(s??"")+o[n+1]),this._$AH[n]=s}a&&!n&&this.j(t)}j(t){t===az?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class aW extends aG{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===az?void 0:t}}class aZ extends aG{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==az)}}class aK extends aG{constructor(t,i,r,n,o){super(t,i,r,n,o),this.type=5}_$AI(t,i=this){if((t=aV(this,t,i,0)??az)===aO)return;let r=this._$AH,n=t===az&&r!==az||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==az&&(r===az||n);n&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class aJ{constructor(t,i,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){aV(this,t)}}let aX=af.litHtmlPolyfillSupport;aX?.(aH,aq),(af.litHtmlVersions??=[]).push("3.3.1");let aQ=(t,i,r)=>{let n=r?.renderBefore??i,o=n._$litPart$;if(void 0===o){let t=r?.renderBefore??null;n._$litPart$=o=new aq(i.insertBefore(ax(),t),t,void 0,r??{})}return o._$AI(t),o},a0=globalThis;class a1 extends am{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=aQ(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return aO}}a1._$litElement$=!0,a1.finalized=!0,a0.litElementHydrateSupport?.({LitElement:a1});let a2=a0.litElementPolyfillSupport;a2?.({LitElement:a1}),(a0.litElementVersions??=[]).push("4.2.1");let a3=o8`
|
|
819
819
|
h4 {
|
|
820
820
|
margin: 0;
|
|
@@ -1245,7 +1245,7 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
|
|
|
1245
1245
|
</div>`:""}
|
|
1246
1246
|
<or-icon icon="or:marker"></or-icon>
|
|
1247
1247
|
<or-icon class="marker-icon" icon="${t||""}"></or-icon>
|
|
1248
|
-
`,sS([si({type:Number,reflect:!0,attribute:!0})],sI.prototype,"lat",void 0),sS([si({type:Number,reflect:!0})],sI.prototype,"lng",void 0),sS([si({type:Number,reflect:!0})],sI.prototype,"radius",void 0),sS([si({reflect:!0})],sI.prototype,"displayValue",void 0),sS([si({reflect:!0})],sI.prototype,"direction",void 0),sS([si({type:Boolean})],sI.prototype,"visible",void 0),sS([si({type:String})],sI.prototype,"icon",void 0),sS([si({type:String})],sI.prototype,"color",void 0),sS([si({type:String})],sI.prototype,"activeColor",void 0),sS([si({type:Boolean})],sI.prototype,"interactive",void 0),sS([si({type:Boolean})],sI.prototype,"active",void 0),sS([so("slot")],sI.prototype,"_slot",void 0),sI=tA=sS([se("or-map-marker")],sI);var sR=r(7776);function sB(t){return i||(i=new Intl.NumberFormat("en",{notation:"compact",compactDisplay:"short",maximumFractionDigits:1})),i.format(t).toLowerCase()}function sO(t,i){return t/.075/Math.cos(i*Math.PI/180)}function sz(t){if(t){if(t instanceof sM.st)return t;if(t.lat)return t.lon?{lng:t.lon,lat:t.lat}:{lng:t.lng,lat:t.lat};if(Array.isArray(t))return{lng:t[0],lat:t[1]};if(t.coordinates&&Array.isArray(t.coordinates)&&t.coordinates.length>=2)return sz(t.coordinates);if(t.attributes){let i=t.attributes.location;return i&&i.value?sz(i.value):void 0}if(t.value)return sz(t.value)}}function sY(t){if(t)return Array.isArray(t)?{type:"Point",coordinates:t}:{type:"Point",coordinates:[t.hasOwnProperty("lng")?t.lng:t.lon,t.lat]}}function sj(t){if(t){if(t instanceof sR.LngLatBounds)return t;if(2===t.length){let i=sz(t[0]),r=sz(t[1]);if(i&&r)return new sR.LngLatBounds(i,r)}if(4===t.length)return new sR.LngLatBounds([t[0],t[1],t[2],t[3]])}}function sN(t,i){if(!t)return;let r="string"==typeof t?tL.getAssetDescriptor(t):t,n=r&&r.icon?r.icon:"help-circle",o=r&&r.colour?r.colour:void 0;if(i&&i.markerConfig){let t=i.markerConfig,r=i.currentValue;if("range"===t.type&&t.ranges&&"number"==typeof r){let i=t.ranges;o=(i.sort((t,i)=>i.min-t.min).find(t=>r>=t.min)||i.reduce((t,i)=>i.min>t.min?t:i)).colour||void 0}else"boolean"===t.type?o=t[!!r+""]:"string"===t.type&&(o=t[r+""])}return{color:o,icon:n}}function sU(t){var i;if(!(null==t?void 0:t.attributes))return!1;let r=t.attributes.location;return!!(null==(i=null==r?void 0:r.value)?void 0:i.coordinates)&&(!r.meta||!("showOnDashboard"in r.meta)||!!ig("showOnDashboard",r))}var sH=function(t,i,r,n){var o,a=arguments.length,s=a<3?i:null===n?n=Object.getOwnPropertyDescriptor(i,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,r,n);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(s=(a<3?o(s):a>3?o(i,r,s):o(i,r))||s);return a>3&&s&&Object.defineProperty(i,r,s),s};function sV(t,i){if(t&&i&&t[i])return t[i]}function s$(t,i){let r=sV(t,i);if(r)return r.attributeName}let sq=class extends s_(sk)(sI){constructor(){super(),this.assetTypeAsIcon=!0,this.visible=!1}set type(t){let i,r=sV(this.config,t);if(r&&r.attributeName&&this.asset&&this.asset.attributes&&this.asset.attributes[r.attributeName]&&r.colours){let t=this.asset.attributes[r.attributeName].value;i={markerConfig:r.colours,currentValue:t}}let n=sN(t,i);if(!n){this.visible=!1;return}this.assetTypeAsIcon&&(this.icon=n.icon),this._markerColor=Array.isArray(n.color)?n.color[0].colour:n.color||void 0,this._updateColor(this.markerContainer),this.visible=!0}shouldUpdate(t){if(t.has("assetId")&&(this.lat=void 0,this.lng=void 0,this.type=void 0,this.direction=void 0,this.displayValue=void 0,this.assetIds=this.assetId&&this.assetId.length>0?[this.assetId]:void 0,1===Object.keys(t).length))return!1;if(t.has("asset"))try{this._onAssetChanged(this.asset)}catch(t){console.error(t)}return super.shouldUpdate(t)}_onEvent(t){if("attribute"===t.eventType)return"location"===t.ref.name?void this._updateLocation(t.value):void(this.asset&&(this.asset=iw(this.asset,t),this.requestUpdate()));if("asset"===t.eventType)switch(t.cause){case"READ":case"CREATE":case"UPDATE":this._onAssetChanged(t.asset);break;case"DELETE":this._onAssetChanged(void 0)}}_onAssetChanged(t){var i,r,n,o;return i=this,r=void 0,n=void 0,o=function*(){if(t){this.direction=void 0,this.displayValue=void 0;let r=t.attributes?t.attributes.location:void 0;this._updateLocation(r?r.value:null);let n=sV(this.config,t.type),o=!n||!n.hideDirection,a=n&&!0===n.showLabel&&!!n.attributeName,s=!!(n&&!1!==n.showUnits);if(a&&t.attributes&&t.attributes[null==n?void 0:n.attributeName]){var i;let r=t.attributes[n.attributeName],o=tL.getAttributeAndValueDescriptors(t.type,r.name,r);this.displayValue=(i=o[0],iy(r,i,t.type,s,!0,"-"))}if(o&&t.attributes&&t.attributes.direction){let i=t.attributes.direction.value;null!=i&&(this.direction=i.toString())}this.type=t.type}else this.lat=void 0,this.lng=void 0},new(n||(n=Promise))(function(t,a){function s(t){try{c(o.next(t))}catch(t){a(t)}}function l(t){try{c(o.throw(t))}catch(t){a(t)}}function c(i){var r;i.done?t(i.value):((r=i.value)instanceof n?r:new n(function(t){t(r)})).then(s,l)}c((o=o.apply(i,r||[])).next())})}_updateLocation(t){this.lat=t&&t.coordinates?t.coordinates[1]:void 0,this.lng=t&&t.coordinates?t.coordinates[0]:void 0}_getColor(){return this._markerColor&&!this.color?"#"+this._markerColor:super._getColor()}_getActiveColor(){return this._markerColor&&!this.activeColor?"#"+this._markerColor:super._getActiveColor()}};sH([si({type:String,reflect:!0,attribute:!0})],sq.prototype,"assetId",void 0),sH([si({type:Object,attribute:!0})],sq.prototype,"asset",void 0),sH([si()],sq.prototype,"config",void 0),sq=sH([se("or-map-marker-asset")],sq),window.Vaadin||={},window.Vaadin.featureFlags||={};let sG={};function sW(t,i="25.3.4"){if(Object.defineProperty(t,"version",{get:()=>i}),t.experimental){let i="string"==typeof t.experimental?t.experimental:`${t.is.split("-").slice(1).join("-").replace(/-[a-z]/gu,t=>t[1].toUpperCase())}Component`;if(window.Vaadin.featureFlags[i]||sG[i]){if(sG[i])return void sG[i].add(t)}else{sG[i]=new Set,sG[i].add(t),Object.defineProperty(window.Vaadin.featureFlags,i,{get:()=>0===sG[i].size,set(t){t&&sG[i].size>0&&(sG[i].forEach(t=>{customElements.define(t.is,t)}),sG[i].clear())}});return}}let r=customElements.get(t.is);if(r){let i=r.version;i&&t.version&&i===t.version?console.warn(`The component ${t.is} has been loaded twice`):console.error(`Tried to define ${t.is} version ${t.version} when version ${r.version} is already in use. Something will probably break.`)}else customElements.define(t.is,t)}let sZ=[];function sK(t,i,r=t.getAttribute("dir")){i?t.setAttribute("dir",i):null!=r&&t.removeAttribute("dir")}function sJ(){return document.documentElement.getAttribute("dir")}new MutationObserver(function(){let t=sJ();sZ.forEach(i=>{sK(i,t)})}).observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});let sX=t=>class extends t{static get properties(){return{dir:{type:String,value:"",reflectToAttribute:!0,converter:{fromAttribute:t=>t||"",toAttribute:t=>""===t?null:t}}}}get __isRTL(){return"rtl"===this.getAttribute("dir")}connectedCallback(){super.connectedCallback(),(!this.hasAttribute("dir")||this.__restoreSubscription)&&(this.__subscribe(),sK(this,sJ(),null))}attributeChangedCallback(t,i,r){if(super.attributeChangedCallback(t,i,r),"dir"!==t)return;let n=sJ(),o=r===n&&-1===sZ.indexOf(this),a=!r&&i&&-1===sZ.indexOf(this),s=r!==n&&i===n;o||a?(this.__subscribe(),sK(this,n,r)):s&&this.__unsubscribe()}disconnectedCallback(){super.disconnectedCallback(),this.__restoreSubscription=sZ.includes(this),this.__unsubscribe()}_valueToNodeAttribute(t,i,r){("dir"!==r||""!==i||t.hasAttribute("dir"))&&super._valueToNodeAttribute(t,i,r)}_attributeToProperty(t,i,r){"dir"!==t||i?super._attributeToProperty(t,i,r):this.dir=""}__subscribe(){sZ.includes(this)||sZ.push(this)}__unsubscribe(){sZ.includes(this)&&sZ.splice(sZ.indexOf(this),1)}},sQ=new WeakMap;function s0(t){return i=>{if(function(t,i){let r=i;for(;r;){if(sQ.get(r)===t)return!0;r=Object.getPrototypeOf(r)}return!1}(t,i))return i;let r=t(i);return sQ.set(r,t),r}}function s1(t,i){return t.split(".").reduce((t,i)=>t?t[i]:void 0,i)}let s2={},s3=/([A-Z])/gu;function s5(t){return s2[t]||(s2[t]=t.replace(s3,"-$1").toLowerCase()),s2[t]}function s4(t){return t[0].toUpperCase()+t.substring(1)}function s6(t){let[i,r]=t.split("(");return{method:i,observerProps:r.replace(")","").split(",").map(t=>t.trim())}}function s8(t,i){return Object.prototype.hasOwnProperty.call(t,i)||(t[i]=new Map(t[i])),t[i]}let s7=s0(t=>class extends t{static enabledWarnings=[];static createProperty(t,i){[String,Boolean,Number,Array].includes(i)&&(i={type:i}),i?.reflectToAttribute&&(i.reflect=!0),super.createProperty(t,i)}static getOrCreateMap(t){return s8(this,t)}static finalize(){if(window.litIssuedWarnings&&(window.litIssuedWarnings.add("no-override-create-property"),window.litIssuedWarnings.add("no-override-get-property-descriptor")),super.finalize(),Array.isArray(this.observers)){let t=this.getOrCreateMap("__complexObservers");this.observers.forEach(i=>{let{method:r,observerProps:n}=s6(i);t.set(r,n)})}}static addCheckedInitializer(t){super.addInitializer(i=>{i instanceof this&&t(i)})}static getPropertyDescriptor(t,i,r){let n=super.getPropertyDescriptor(t,i,r),o=n;if(this.getOrCreateMap("__propKeys").set(t,i),r.sync&&(o={get:n.get,set(n){let o=this[t];au(n,o)&&(this[i]=n,this.requestUpdate(t,o,r),this.hasUpdated&&this.performUpdate())},configurable:!0,enumerable:!0}),r.readOnly){let i=o.set;this.addCheckedInitializer(r=>{r[`_set${s4(t)}`]=function(t){i.call(r,t)}}),o={get:o.get,set(){},configurable:!0,enumerable:!0}}if("value"in r&&this.addCheckedInitializer(i=>{let n="function"==typeof r.value?r.value.call(i):r.value;r.readOnly?i[`_set${s4(t)}`](n):i[t]=n}),r.observer){let i=r.observer;this.getOrCreateMap("__observers").set(t,i),this.addCheckedInitializer(t=>{t[i]||console.warn(`observer method ${i} not defined`)})}if(r.notify){if(this.__notifyProps){if(!this.hasOwnProperty("__notifyProps")){let t=this.__notifyProps;this.__notifyProps=new Set(t)}}else this.__notifyProps=new Set;this.__notifyProps.add(t)}if(r.computed){let i=`__assignComputed${t}`,n=s6(r.computed);this.prototype[i]=function(...i){this[t]=this[n.method](...i)},this.getOrCreateMap("__computedObservers").set(i,n.observerProps)}return r.attribute||(r.attribute=s5(t)),o}static get polylitConfig(){return{asyncFirstRender:!1}}connectedCallback(){super.connectedCallback();let{polylitConfig:t}=this.constructor;this.hasUpdated||t.asyncFirstRender||this.performUpdate()}firstUpdated(){super.firstUpdated(),this.$||(this.$={}),this.renderRoot.querySelectorAll("[id]").forEach(t=>{this.$[t.id]=t})}ready(){}willUpdate(t){this.constructor.__computedObservers&&this.__runComplexObservers(t,this.constructor.__computedObservers)}updated(t){let i=this.__isReadyInvoked;this.__isReadyInvoked=!0,this.constructor.__observers&&this.__runObservers(t,this.constructor.__observers),this.constructor.__complexObservers&&this.__runComplexObservers(t,this.constructor.__complexObservers),this.__dynamicPropertyObservers&&this.__runDynamicObservers(t,this.__dynamicPropertyObservers),this.__dynamicMethodObservers&&this.__runComplexObservers(t,this.__dynamicMethodObservers),this.constructor.__notifyProps&&this.__runNotifyProps(t,this.constructor.__notifyProps),i||this.ready()}setProperties(t){Object.entries(t).forEach(([t,i])=>{let r=this.constructor.__propKeys.get(t),n=this[r];this[r]=i,this.requestUpdate(t,n)}),this.hasUpdated&&this.performUpdate()}_createMethodObserver(t){let i=s8(this,"__dynamicMethodObservers"),{method:r,observerProps:n}=s6(t);i.set(r,n)}_createPropertyObserver(t,i){s8(this,"__dynamicPropertyObservers").set(i,t)}__runComplexObservers(t,i){i.forEach((i,r)=>{i.some(i=>t.has(i))&&(this[r]?this[r](...i.map(t=>this[t])):console.warn(`observer method ${r} not defined`))})}__runDynamicObservers(t,i){i.forEach((i,r)=>{t.has(i)&&this[r]&&this[r](this[i],t.get(i))})}__runObservers(t,i){t.forEach((t,r)=>{let n=i.get(r);void 0!==n&&this[n]&&this[n](this[r],t)})}__runNotifyProps(t,i){t.forEach((t,r)=>{i.has(r)&&this.dispatchEvent(new CustomEvent(`${s5(r)}-changed`,{detail:{value:this[r]}}))})}_get(t,i){return s1(t,i)}_set(t,i,r){let n,o;o=(n=t.split(".")).pop(),n.reduce((t,i)=>t[i],r)[o]=i}});function s9(t){try{CSS.registerProperty(t)}catch(i){if(i instanceof DOMException&&"InvalidModificationError"===i.name)console.warn(`The CSS property ${t.name} has already been registered.`);else throw i}}class le extends EventTarget{#e;#t=new Set;#i;#r=!1;constructor(t){super(),this.#e=t,this.#i=new CSSStyleSheet}#n(t){let{propertyName:i}=t;this.#t.has(i)&&this.dispatchEvent(new CustomEvent("property-changed",{detail:{propertyName:i}}))}observe(t){this.connect(),this.#t.has(t)||(this.#t.add(t),this.#i.replaceSync(`
|
|
1248
|
+
`,sS([si({type:Number,reflect:!0,attribute:!0})],sI.prototype,"lat",void 0),sS([si({type:Number,reflect:!0})],sI.prototype,"lng",void 0),sS([si({type:Number,reflect:!0})],sI.prototype,"radius",void 0),sS([si({reflect:!0})],sI.prototype,"displayValue",void 0),sS([si({reflect:!0})],sI.prototype,"direction",void 0),sS([si({type:Boolean})],sI.prototype,"visible",void 0),sS([si({type:String})],sI.prototype,"icon",void 0),sS([si({type:String})],sI.prototype,"color",void 0),sS([si({type:String})],sI.prototype,"activeColor",void 0),sS([si({type:Boolean})],sI.prototype,"interactive",void 0),sS([si({type:Boolean})],sI.prototype,"active",void 0),sS([so("slot")],sI.prototype,"_slot",void 0),sI=tA=sS([se("or-map-marker")],sI);var sR=r(7776);function sB(t){return i||(i=new Intl.NumberFormat("en",{notation:"compact",compactDisplay:"short",maximumFractionDigits:1})),i.format(t).toLowerCase()}function sO(t,i){return t/.075/Math.cos(i*Math.PI/180)}function sz(t){if(t){if(t instanceof sM.st)return t;if(t.lat)return t.lon?{lng:t.lon,lat:t.lat}:{lng:t.lng,lat:t.lat};if(Array.isArray(t))return{lng:t[0],lat:t[1]};if(t.coordinates&&Array.isArray(t.coordinates)&&t.coordinates.length>=2)return sz(t.coordinates);if(t.attributes){let i=t.attributes.location;return i&&i.value?sz(i.value):void 0}if(t.value)return sz(t.value)}}function sY(t){if(t)return Array.isArray(t)?{type:"Point",coordinates:t}:{type:"Point",coordinates:[t.hasOwnProperty("lng")?t.lng:t.lon,t.lat]}}function sj(t){if(t){if(t instanceof sR.LngLatBounds)return t;if(2===t.length){let i=sz(t[0]),r=sz(t[1]);if(i&&r)return new sR.LngLatBounds(i,r)}if(4===t.length)return new sR.LngLatBounds([t[0],t[1],t[2],t[3]])}}function sN(t,i){if(!t)return;let r="string"==typeof t?tL.getAssetDescriptor(t):t,n=r&&r.icon?r.icon:"help-circle",o=r&&r.colour?r.colour:void 0;if(i&&i.markerConfig){let t=i.markerConfig,r=i.currentValue;if("range"===t.type&&t.ranges&&"number"==typeof r){let i=t.ranges;o=(i.sort((t,i)=>i.min-t.min).find(t=>r>=t.min)||i.reduce((t,i)=>i.min>t.min?t:i)).colour||void 0}else"boolean"===t.type?o=t[!!r+""]:"string"===t.type&&(o=t[r+""])}return{color:o,icon:n}}function sU(t){var i;if(!(null==t?void 0:t.attributes))return!1;let r=t.attributes.location;return!!(null==(i=null==r?void 0:r.value)?void 0:i.coordinates)&&(!r.meta||!("showOnDashboard"in r.meta)||!!ig("showOnDashboard",r))}var sH=function(t,i,r,n){var o,a=arguments.length,s=a<3?i:null===n?n=Object.getOwnPropertyDescriptor(i,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,r,n);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(s=(a<3?o(s):a>3?o(i,r,s):o(i,r))||s);return a>3&&s&&Object.defineProperty(i,r,s),s};function sV(t,i){if(t&&i&&t[i])return t[i]}function s$(t,i){let r=sV(t,i);if(r)return r.attributeName}let sq=class extends s_(sk)(sI){constructor(){super(),this.assetTypeAsIcon=!0,this.visible=!1}set type(t){let i,r=sV(this.config,t);if(r&&r.attributeName&&this.asset&&this.asset.attributes&&this.asset.attributes[r.attributeName]&&r.colours){let t=this.asset.attributes[r.attributeName].value;i={markerConfig:r.colours,currentValue:t}}let n=sN(t,i);if(!n){this.visible=!1;return}this.assetTypeAsIcon&&(this.icon=n.icon),this._markerColor=Array.isArray(n.color)?n.color[0].colour:n.color||void 0,this._updateColor(this.markerContainer),this.visible=!0}shouldUpdate(t){if(t.has("assetId")&&(this.lat=void 0,this.lng=void 0,this.type=void 0,this.direction=void 0,this.displayValue=void 0,this.assetIds=this.assetId&&this.assetId.length>0?[this.assetId]:void 0,1===Object.keys(t).length))return!1;if(t.has("asset"))try{this._onAssetChanged(this.asset)}catch(t){console.error(t)}return super.shouldUpdate(t)}_onEvent(t){if("attribute"===t.eventType)return"location"===t.ref.name?void this._updateLocation(t.value):void(this.asset&&(this.asset=iw(this.asset,t),this.requestUpdate()));if("asset"===t.eventType)switch(t.cause){case"READ":case"CREATE":case"UPDATE":this._onAssetChanged(t.asset);break;case"DELETE":this._onAssetChanged(void 0)}}_onAssetChanged(t){var i,r,n,o;return i=this,r=void 0,n=void 0,o=function*(){if(t){this.direction=void 0,this.displayValue=void 0;let r=t.attributes?t.attributes.location:void 0;this._updateLocation(r?r.value:null);let n=sV(this.config,t.type),o=!n||!n.hideDirection,a=n&&!0===n.showLabel&&!!n.attributeName,s=!!(n&&!1!==n.showUnits);if(a&&t.attributes&&t.attributes[null==n?void 0:n.attributeName]){var i;let r=t.attributes[n.attributeName],o=tL.getAttributeAndValueDescriptors(t.type,r.name,r);this.displayValue=(i=o[0],iy(r,i,t.type,s,!0,"-"))}if(o&&t.attributes&&t.attributes.direction){let i=t.attributes.direction.value;null!=i&&(this.direction=i.toString())}this.type=t.type}else this.lat=void 0,this.lng=void 0},new(n||(n=Promise))(function(t,a){function s(t){try{c(o.next(t))}catch(t){a(t)}}function l(t){try{c(o.throw(t))}catch(t){a(t)}}function c(i){var r;i.done?t(i.value):((r=i.value)instanceof n?r:new n(function(t){t(r)})).then(s,l)}c((o=o.apply(i,r||[])).next())})}_updateLocation(t){this.lat=t&&t.coordinates?t.coordinates[1]:void 0,this.lng=t&&t.coordinates?t.coordinates[0]:void 0}_getColor(){return this._markerColor&&!this.color?"#"+this._markerColor:super._getColor()}_getActiveColor(){return this._markerColor&&!this.activeColor?"#"+this._markerColor:super._getActiveColor()}};sH([si({type:String,reflect:!0,attribute:!0})],sq.prototype,"assetId",void 0),sH([si({type:Object,attribute:!0})],sq.prototype,"asset",void 0),sH([si()],sq.prototype,"config",void 0),sq=sH([se("or-map-marker-asset")],sq),window.Vaadin||={},window.Vaadin.featureFlags||={};let sG={};function sW(t,i="25.3.5"){if(Object.defineProperty(t,"version",{get:()=>i}),t.experimental){let i="string"==typeof t.experimental?t.experimental:`${t.is.split("-").slice(1).join("-").replace(/-[a-z]/gu,t=>t[1].toUpperCase())}Component`;if(window.Vaadin.featureFlags[i]||sG[i]){if(sG[i])return void sG[i].add(t)}else{sG[i]=new Set,sG[i].add(t),Object.defineProperty(window.Vaadin.featureFlags,i,{get:()=>0===sG[i].size,set(t){t&&sG[i].size>0&&(sG[i].forEach(t=>{customElements.define(t.is,t)}),sG[i].clear())}});return}}let r=customElements.get(t.is);if(r){let i=r.version;i&&t.version&&i===t.version?console.warn(`The component ${t.is} has been loaded twice`):console.error(`Tried to define ${t.is} version ${t.version} when version ${r.version} is already in use. Something will probably break.`)}else customElements.define(t.is,t)}let sZ=[];function sK(t,i,r=t.getAttribute("dir")){i?t.setAttribute("dir",i):null!=r&&t.removeAttribute("dir")}function sJ(){return document.documentElement.getAttribute("dir")}new MutationObserver(function(){let t=sJ();sZ.forEach(i=>{sK(i,t)})}).observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});let sX=t=>class extends t{static get properties(){return{dir:{type:String,value:"",reflectToAttribute:!0,converter:{fromAttribute:t=>t||"",toAttribute:t=>""===t?null:t}}}}get __isRTL(){return"rtl"===this.getAttribute("dir")}connectedCallback(){super.connectedCallback(),(!this.hasAttribute("dir")||this.__restoreSubscription)&&(this.__subscribe(),sK(this,sJ(),null))}attributeChangedCallback(t,i,r){if(super.attributeChangedCallback(t,i,r),"dir"!==t)return;let n=sJ(),o=r===n&&-1===sZ.indexOf(this),a=!r&&i&&-1===sZ.indexOf(this),s=r!==n&&i===n;o||a?(this.__subscribe(),sK(this,n,r)):s&&this.__unsubscribe()}disconnectedCallback(){super.disconnectedCallback(),this.__restoreSubscription=sZ.includes(this),this.__unsubscribe()}_valueToNodeAttribute(t,i,r){("dir"!==r||""!==i||t.hasAttribute("dir"))&&super._valueToNodeAttribute(t,i,r)}_attributeToProperty(t,i,r){"dir"!==t||i?super._attributeToProperty(t,i,r):this.dir=""}__subscribe(){sZ.includes(this)||sZ.push(this)}__unsubscribe(){sZ.includes(this)&&sZ.splice(sZ.indexOf(this),1)}},sQ=new WeakMap;function s0(t){return i=>{if(function(t,i){let r=i;for(;r;){if(sQ.get(r)===t)return!0;r=Object.getPrototypeOf(r)}return!1}(t,i))return i;let r=t(i);return sQ.set(r,t),r}}function s1(t,i){return t.split(".").reduce((t,i)=>t?t[i]:void 0,i)}let s2={},s3=/([A-Z])/gu;function s5(t){return s2[t]||(s2[t]=t.replace(s3,"-$1").toLowerCase()),s2[t]}function s4(t){return t[0].toUpperCase()+t.substring(1)}function s6(t){let[i,r]=t.split("(");return{method:i,observerProps:r.replace(")","").split(",").map(t=>t.trim())}}function s8(t,i){return Object.prototype.hasOwnProperty.call(t,i)||(t[i]=new Map(t[i])),t[i]}let s7=s0(t=>class extends t{static enabledWarnings=[];static createProperty(t,i){[String,Boolean,Number,Array].includes(i)&&(i={type:i}),i?.reflectToAttribute&&(i.reflect=!0),super.createProperty(t,i)}static getOrCreateMap(t){return s8(this,t)}static finalize(){if(window.litIssuedWarnings&&(window.litIssuedWarnings.add("no-override-create-property"),window.litIssuedWarnings.add("no-override-get-property-descriptor")),super.finalize(),Array.isArray(this.observers)){let t=this.getOrCreateMap("__complexObservers");this.observers.forEach(i=>{let{method:r,observerProps:n}=s6(i);t.set(r,n)})}}static addCheckedInitializer(t){super.addInitializer(i=>{i instanceof this&&t(i)})}static getPropertyDescriptor(t,i,r){let n=super.getPropertyDescriptor(t,i,r),o=n;if(this.getOrCreateMap("__propKeys").set(t,i),r.sync&&(o={get:n.get,set(n){let o=this[t];au(n,o)&&(this[i]=n,this.requestUpdate(t,o,r),this.hasUpdated&&this.performUpdate())},configurable:!0,enumerable:!0}),r.readOnly){let i=o.set;this.addCheckedInitializer(r=>{r[`_set${s4(t)}`]=function(t){i.call(r,t)}}),o={get:o.get,set(){},configurable:!0,enumerable:!0}}if("value"in r&&this.addCheckedInitializer(i=>{let n="function"==typeof r.value?r.value.call(i):r.value;r.readOnly?i[`_set${s4(t)}`](n):i[t]=n}),r.observer){let i=r.observer;this.getOrCreateMap("__observers").set(t,i),this.addCheckedInitializer(t=>{t[i]||console.warn(`observer method ${i} not defined`)})}if(r.notify){if(this.__notifyProps){if(!this.hasOwnProperty("__notifyProps")){let t=this.__notifyProps;this.__notifyProps=new Set(t)}}else this.__notifyProps=new Set;this.__notifyProps.add(t)}if(r.computed){let i=`__assignComputed${t}`,n=s6(r.computed);this.prototype[i]=function(...i){this[t]=this[n.method](...i)},this.getOrCreateMap("__computedObservers").set(i,n.observerProps)}return r.attribute||(r.attribute=s5(t)),o}static get polylitConfig(){return{asyncFirstRender:!1}}connectedCallback(){super.connectedCallback();let{polylitConfig:t}=this.constructor;this.hasUpdated||t.asyncFirstRender||this.performUpdate()}firstUpdated(){super.firstUpdated(),this.$||(this.$={}),this.renderRoot.querySelectorAll("[id]").forEach(t=>{this.$[t.id]=t})}ready(){}willUpdate(t){this.constructor.__computedObservers&&this.__runComplexObservers(t,this.constructor.__computedObservers)}updated(t){let i=this.__isReadyInvoked;this.__isReadyInvoked=!0,this.constructor.__observers&&this.__runObservers(t,this.constructor.__observers),this.constructor.__complexObservers&&this.__runComplexObservers(t,this.constructor.__complexObservers),this.__dynamicPropertyObservers&&this.__runDynamicObservers(t,this.__dynamicPropertyObservers),this.__dynamicMethodObservers&&this.__runComplexObservers(t,this.__dynamicMethodObservers),this.constructor.__notifyProps&&this.__runNotifyProps(t,this.constructor.__notifyProps),i||this.ready()}setProperties(t){Object.entries(t).forEach(([t,i])=>{let r=this.constructor.__propKeys.get(t),n=this[r];this[r]=i,this.requestUpdate(t,n)}),this.hasUpdated&&this.performUpdate()}_createMethodObserver(t){let i=s8(this,"__dynamicMethodObservers"),{method:r,observerProps:n}=s6(t);i.set(r,n)}_createPropertyObserver(t,i){s8(this,"__dynamicPropertyObservers").set(i,t)}__runComplexObservers(t,i){i.forEach((i,r)=>{i.some(i=>t.has(i))&&(this[r]?this[r](...i.map(t=>this[t])):console.warn(`observer method ${r} not defined`))})}__runDynamicObservers(t,i){i.forEach((i,r)=>{t.has(i)&&this[r]&&this[r](this[i],t.get(i))})}__runObservers(t,i){t.forEach((t,r)=>{let n=i.get(r);void 0!==n&&this[n]&&this[n](this[r],t)})}__runNotifyProps(t,i){t.forEach((t,r)=>{i.has(r)&&this.dispatchEvent(new CustomEvent(`${s5(r)}-changed`,{detail:{value:this[r]}}))})}_get(t,i){return s1(t,i)}_set(t,i,r){let n,o;o=(n=t.split(".")).pop(),n.reduce((t,i)=>t[i],r)[o]=i}});function s9(t){try{CSS.registerProperty(t)}catch(i){if(i instanceof DOMException&&"InvalidModificationError"===i.name)console.warn(`The CSS property ${t.name} has already been registered.`);else throw i}}class le extends EventTarget{#e;#t=new Set;#i;#r=!1;constructor(t){super(),this.#e=t,this.#i=new CSSStyleSheet}#n(t){let{propertyName:i}=t;this.#t.has(i)&&this.dispatchEvent(new CustomEvent("property-changed",{detail:{propertyName:i}}))}observe(t){this.connect(),this.#t.has(t)||(this.#t.add(t),this.#i.replaceSync(`
|
|
1249
1249
|
:root::before, :host::before {
|
|
1250
1250
|
content: '' !important;
|
|
1251
1251
|
position: absolute !important;
|
|
@@ -3367,7 +3367,7 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
|
|
|
3367
3367
|
:host([theme~='align-right']) ::slotted([slot='value']) {
|
|
3368
3368
|
justify-content: right;
|
|
3369
3369
|
}
|
|
3370
|
-
`;class hi{#W=null;constructor(t,i){this.query=t,this.callback=i}hostConnected(){this.#Z(),this.#W=window.matchMedia(this.query),this.#K(),this.#J(this.#W)}hostDisconnected(){this.#Z()}#K(){this.#W&&this.#W.addListener(this.#J)}#Z(){this.#W&&this.#W.removeListener(this.#J),this.#W=null}#J=t=>{"function"==typeof this.callback&&this.callback(t.matches)}}class hr extends lG{constructor(t){super(t,"value","vaadin-select-value-button",{initializer:(t,i)=>{i._setFocusElement(t),i.ariaTarget=t,i.stateTarget=t,t.setAttribute("aria-haspopup","listbox")}})}}let hn=t=>class extends l9(cb(ce(cg(t)))){static get properties(){return{items:{type:Array},opened:{type:Boolean,value:!1,notify:!0,observer:"_openedChanged",reflectToAttribute:!0,sync:!0},renderer:{type:Object},value:{type:String,value:"",notify:!0,observer:"_valueChanged",sync:!0},name:{type:String},placeholder:{type:String},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},noVerticalOverlap:{type:Boolean,value:!1},_phone:Boolean,_phoneMediaQuery:{value:"(max-width: 450px), (max-height: 450px)"},_inputContainer:Object,_items:Object,__slottedListBox:{type:Object,sync:!0}}}static get delegateAttrs(){return[...super.delegateAttrs,"invalid"]}static get observers(){return["_updateAriaExpanded(opened, focusElement)","_updateSelectedItem(value, _items, placeholder, focusElement)"]}constructor(){super(),this._itemId=`value-${this.localName}-${lq++}`,this._srLabelController=new cf(this),this._srLabelController.slotName="sr-label"}disconnectedCallback(){super.disconnectedCallback(),this.opened=!1}ready(){super.ready(),this._inputContainer=this.shadowRoot.querySelector('[part~="input-field"]'),this._overlayElement=this.$.overlay,this._valueButtonController=new hr(this),this.addController(this._valueButtonController),this.addController(this._srLabelController),this.addController(new hi(this._phoneMediaQuery,t=>{this._phone=t})),this._tooltipController=new lW(this),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.focusElement),this.addController(this._tooltipController)}updated(t){if(super.updated(t),t.has("_phone")&&this.toggleAttribute("phone",this._phone),(t.has("items")||t.has("renderer")||t.has("__slottedListBox"))&&this.__slottedListBox&&(this.items?.length||this.renderer))throw Error('A slotted <vaadin-select-list-box> cannot be used together with the "items" or "renderer" property.');if(t.has("items")&&this._overlayElement.requestContentUpdate(),t.has("__slottedListBox")){let i=this.__slottedListBox;i?this._assignMenuElement(i):t.get("__slottedListBox")&&(this._menuElement=null,this._items=null,this.__lastMenuElement=null)}t.has("accessibleName")&&this._srLabelController.setLabel(this.accessibleName),t.has("required")&&!1===this.required&&this._requestValidation()}requestContentUpdate(){this._overlayElement&&this._overlayElement.requestContentUpdate()}__onOverlaySlotChange(t){this.__slottedListBox=t.target.assignedElements().find(t=>t._hasVaadinListMixin)}_assignMenuElement(t){t&&t!==this.__lastMenuElement&&(this._menuElement=t,this.__initMenuItems(t),t.addEventListener("items-changed",()=>{this.__initMenuItems(t)}),t.addEventListener("selected-changed",()=>this.__updateValueButton()),t.addEventListener("keydown",t=>this._onKeyDownInside(t),!0),t.addEventListener("click",t=>{let i=t.composedPath().find(t=>t._hasVaadinItemMixin);this.__dispatchChangePending=i?.value!==void 0&&i.value!==this.value,this.opened=!1},!0),this.__lastMenuElement=t),this._menuElement&&this._menuElement.items&&this._updateSelectedItem(this.value,this._menuElement.items)}__initMenuItems(t){t.items&&(this._items=t.items)}_valueChanged(t,i){this.toggleAttribute("has-value",!!t),void 0===i||this.__dispatchChangePending||this._requestValidation()}_onClick(t){this.disabled||(t.preventDefault(),this.opened=!this.readonly)}_onEscape(t){this.opened&&(t.stopPropagation(),this.opened=!1)}_onToggleMouseDown(t){t.preventDefault(),this.opened||this.focusElement.focus()}_onKeyDown(t){if(super._onKeyDown(t),!t.altKey&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey&&t.target===this.focusElement&&!this.readonly&&!this.disabled&&!this.opened){if(/^(Enter|SpaceBar|\s|ArrowDown|Down|ArrowUp|Up)$/u.test(t.key))t.preventDefault(),this.opened=!0;else if(/[\p{L}\p{Nd}]/u.test(t.key)&&1===t.key.length){let i=this._menuElement.selected,r=this._menuElement._searchKey(i??-1,t.key);r>=0&&(this.__dispatchChangePending=!0,this._updateAriaLive(!0),this._menuElement.selected=r)}}}_onKeyDownInside(t){"Tab"===t.key&&(this.focusElement.setAttribute("tabindex","-1"),this._overlayElement.restoreFocusOnClose=!1,this.opened=!1,setTimeout(()=>{this.focusElement.setAttribute("tabindex","0"),this._overlayElement.restoreFocusOnClose=!0}))}_openedChanged(t,i){if(t){if(this.disabled||this.readonly){this.opened=!1;return}this._updateAriaLive(!1);let t=this.hasAttribute("focus-ring");this._openedWithFocusRing=t,t&&this.removeAttribute("focus-ring")}else i&&(this._openedWithFocusRing&&this.setAttribute("focus-ring",""),this.__dispatchChangePending||this._keyboardActive||this._requestValidation())}_updateAriaExpanded(t,i){i&&i.setAttribute("aria-expanded",t?"true":"false")}_updateAriaLive(t){this.focusElement&&lj(this.focusElement,"aria-live",t&&"polite")}__attachSelectedItem(t){let i,r=t.getAttribute("label");(i=r?this.__createItemElement({label:r}):t.cloneNode(!0))._sourceItem=t,this.__appendValueItemElement(i,this.focusElement)
|
|
3370
|
+
`;class hi{#W=null;constructor(t,i){this.query=t,this.callback=i}hostConnected(){this.#Z(),this.#W=window.matchMedia(this.query),this.#K(),this.#J(this.#W)}hostDisconnected(){this.#Z()}#K(){this.#W&&this.#W.addListener(this.#J)}#Z(){this.#W&&this.#W.removeListener(this.#J),this.#W=null}#J=t=>{"function"==typeof this.callback&&this.callback(t.matches)}}class hr extends lG{constructor(t){super(t,"value","vaadin-select-value-button",{initializer:(t,i)=>{i._setFocusElement(t),i.ariaTarget=t,i.stateTarget=t,t.setAttribute("aria-haspopup","listbox")}})}}let hn=t=>class extends l9(cb(ce(cg(t)))){static get properties(){return{items:{type:Array},opened:{type:Boolean,value:!1,notify:!0,observer:"_openedChanged",reflectToAttribute:!0,sync:!0},renderer:{type:Object},value:{type:String,value:"",notify:!0,observer:"_valueChanged",sync:!0},name:{type:String},placeholder:{type:String},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},noVerticalOverlap:{type:Boolean,value:!1},_phone:Boolean,_phoneMediaQuery:{value:"(max-width: 450px), (max-height: 450px)"},_inputContainer:Object,_items:Object,__slottedListBox:{type:Object,sync:!0}}}static get delegateAttrs(){return[...super.delegateAttrs,"invalid"]}static get observers(){return["_updateAriaExpanded(opened, focusElement)","_updateSelectedItem(value, _items, placeholder, focusElement)"]}constructor(){super(),this._itemId=`value-${this.localName}-${lq++}`,this._srLabelController=new cf(this),this._srLabelController.slotName="sr-label"}disconnectedCallback(){super.disconnectedCallback(),this.opened=!1}ready(){super.ready(),this._inputContainer=this.shadowRoot.querySelector('[part~="input-field"]'),this._overlayElement=this.$.overlay,this._valueButtonController=new hr(this),this.addController(this._valueButtonController),this.addController(this._srLabelController),this.addController(new hi(this._phoneMediaQuery,t=>{this._phone=t})),this._tooltipController=new lW(this),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.focusElement),this.addController(this._tooltipController)}updated(t){if(super.updated(t),t.has("_phone")&&this.toggleAttribute("phone",this._phone),(t.has("items")||t.has("renderer")||t.has("__slottedListBox"))&&this.__slottedListBox&&(this.items?.length||this.renderer))throw Error('A slotted <vaadin-select-list-box> cannot be used together with the "items" or "renderer" property.');if(t.has("items")&&this._overlayElement.requestContentUpdate(),t.has("__slottedListBox")){let i=this.__slottedListBox;i?this._assignMenuElement(i):t.get("__slottedListBox")&&(this._menuElement=null,this._items=null,this.__lastMenuElement=null)}t.has("accessibleName")&&this._srLabelController.setLabel(this.accessibleName),t.has("required")&&!1===this.required&&this._requestValidation()}requestContentUpdate(){this._overlayElement&&this._overlayElement.requestContentUpdate()}__onOverlaySlotChange(t){this.__slottedListBox=t.target.assignedElements().find(t=>t._hasVaadinListMixin)}_assignMenuElement(t){t&&t!==this.__lastMenuElement&&(this._menuElement=t,this.__initMenuItems(t),t.addEventListener("items-changed",()=>{this.__initMenuItems(t)}),t.addEventListener("selected-changed",()=>this.__updateValueButton()),t.addEventListener("keydown",t=>this._onKeyDownInside(t),!0),t.addEventListener("click",t=>{let i=t.composedPath().find(t=>t._hasVaadinItemMixin);this.__dispatchChangePending=i?.value!==void 0&&i.value!==this.value,this.opened=!1},!0),this.__lastMenuElement=t),this._menuElement&&this._menuElement.items&&this._updateSelectedItem(this.value,this._menuElement.items)}__initMenuItems(t){t.items&&(this._items=t.items)}_valueChanged(t,i){this.toggleAttribute("has-value",!!t),void 0===i||this.__dispatchChangePending||this._requestValidation()}_onClick(t){this.disabled||(t.preventDefault(),this.opened=!this.readonly)}_onEscape(t){this.opened&&(t.stopPropagation(),this.opened=!1)}_onToggleMouseDown(t){t.preventDefault(),this.opened||this.focusElement.focus()}_onKeyDown(t){if(super._onKeyDown(t),!t.altKey&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey&&t.target===this.focusElement&&!this.readonly&&!this.disabled&&!this.opened){if(/^(Enter|SpaceBar|\s|ArrowDown|Down|ArrowUp|Up)$/u.test(t.key))t.preventDefault(),this.opened=!0;else if(/[\p{L}\p{Nd}]/u.test(t.key)&&1===t.key.length){let i=this._menuElement.selected,r=this._menuElement._searchKey(i??-1,t.key);r>=0&&(this.__dispatchChangePending=!0,this._updateAriaLive(!0),this._menuElement.selected=r)}}}_onKeyDownInside(t){"Tab"===t.key&&(this.focusElement.setAttribute("tabindex","-1"),this._overlayElement.restoreFocusOnClose=!1,this.opened=!1,setTimeout(()=>{this.focusElement.setAttribute("tabindex","0"),this._overlayElement.restoreFocusOnClose=!0}))}_openedChanged(t,i){if(t){if(this.disabled||this.readonly){this.opened=!1;return}this._updateAriaLive(!1);let t=this.hasAttribute("focus-ring");this._openedWithFocusRing=t,t&&this.removeAttribute("focus-ring")}else i&&(this._openedWithFocusRing&&this.setAttribute("focus-ring",""),this.__dispatchChangePending||this._keyboardActive||this._requestValidation())}_updateAriaExpanded(t,i){i&&i.setAttribute("aria-expanded",t?"true":"false")}_updateAriaLive(t){this.focusElement&&lj(this.focusElement,"aria-live",t&&"polite")}__attachSelectedItem(t){let i,r=t.getAttribute("label");(i=r?this.__createItemElement({label:r}):t.cloneNode(!0))._sourceItem=t,this.__appendValueItemElement(i,this.focusElement)}__createItemElement(t){let i=document.createElement(t.component||"vaadin-select-item");return t.label&&(i.textContent=t.label),t.value&&(i.value=t.value),t.disabled&&(i.disabled=t.disabled),t.className&&(i.className=t.className),i}__appendValueItemElement(t,i){i.appendChild(t),t.removeAttribute("tabindex"),t.removeAttribute("selected"),t.removeAttribute("aria-selected"),t.removeAttribute("role"),t.removeAttribute("focused"),t.removeAttribute("focus-ring"),t.removeAttribute("active"),t.setAttribute("id",this._itemId)}__updateValueButton(){let t=this.focusElement;if(!t)return;t.innerHTML="";let i=this._items?this._items[this._menuElement.selected]:void 0;if(t.removeAttribute("placeholder"),this._hasContent(i))this.__attachSelectedItem(i);else if(this.placeholder){let i=this.__createItemElement({label:this.placeholder});this.__appendValueItemElement(i,t),t.setAttribute("placeholder","")}!this._valueChanging&&i&&(this._selectedChanging=!0,this.value=i.value||"",this.__dispatchChangePending&&this.__dispatchChange(),delete this._selectedChanging),this.__updateFieldAriaControllerLabelledBy()}_hasContent(t){if(!t)return!1;let i=!!(t.hasAttribute("label")?t.getAttribute("label"):t.textContent.trim()),r=t.childElementCount>0;return i||r}_updateSelectedItem(t,i,r){if(i){let r=null==t?t:t.toString();this._menuElement.selected=i.reduce((t,i,n)=>void 0===t&&i.value===r?n:t,void 0),this._selectedChanging||(this._valueChanging=!0,this.__updateValueButton(),delete this._valueChanging)}else r&&this.__updateValueButton()}_shouldRemoveFocus(t){return!this.contains(t.relatedTarget)}_setFocused(t){super._setFocused(t),!t&&document.hasFocus()&&this._requestValidation()}checkValidity(){return!this.required||this.readonly||!!this.value}__defaultRenderer(t,i){if(!this.items||0===this.items.length){t.textContent="";return}let r=t.firstElementChild;r||(r=document.createElement("vaadin-select-list-box"),t.appendChild(r)),r.textContent="",this.items.forEach(t=>{r.appendChild(this.__createItemElement(t))})}__dispatchChange(){this._requestValidation(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),this.__dispatchChangePending=!1}__updateFieldAriaControllerLabel(){}__updateFieldAriaControllerLabelledBy(){let t;this.accessibleNameRef?t=this.accessibleNameRef:this.accessibleName?t=this._srLabelController.defaultId:this.hasAttribute("has-label")&&(t=this._labelNode?.id);let i=[t,this._items?.[this._menuElement.selected]||this.placeholder?this._itemId:null].filter(Boolean);i.length>0?this._fieldAriaController.setLabelledBy(i.join(" ")):this._fieldAriaController.setLabelledBy(null)}};class ho extends hn(lO(l_(s7(lu(a1))))){static get is(){return"vaadin-select"}static get styles(){return[lJ,uN,ht]}render(){return aR`
|
|
3371
3371
|
<div class="vaadin-select-container">
|
|
3372
3372
|
<div part="label" @click="${this._onClick}">
|
|
3373
3373
|
<slot name="label"></slot>
|