@openremote/or-attribute-input 1.9.0-snapshot.20250919113633 → 1.9.0-snapshot.20250922103504
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/umd/index.orbundle.js +127 -127
- package/dist/umd/index.orbundle.js.map +1 -1
- package/package.json +8 -8
|
@@ -54,7 +54,7 @@ uniform ${n} ${i} u_${r};
|
|
|
54
54
|
#else
|
|
55
55
|
${n} ${i} ${r} = u_${r};
|
|
56
56
|
#endif
|
|
57
|
-
`}),staticAttributes:i,staticUniforms:a}}class e4{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,t,n,i,r,o,a,s,l){this.context=e;let c=this.boundPaintVertexBuffers.length!==i.length;for(let e=0;!c&&e<i.length;e++)this.boundPaintVertexBuffers[e]!==i[e]&&(c=!0);!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==n||c||this.boundIndexBuffer!==r||this.boundVertexOffset!==o||this.boundDynamicVertexBuffer!==a||this.boundDynamicVertexBuffer2!==s||this.boundDynamicVertexBuffer3!==l?this.freshBind(t,n,i,r,o,a,s,l):(e.bindVertexArray.set(this.vao),a&&a.bind(),r&&r.dynamicDraw&&r.bind(),s&&s.bind(),l&&l.bind())}freshBind(e,t,n,i,r,o,a,s){let l=e.numAttributes,c=this.context,d=c.gl;for(let l of(this.vao&&this.destroy(),this.vao=c.createVertexArray(),c.bindVertexArray.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=i,this.boundVertexOffset=r,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=a,this.boundDynamicVertexBuffer3=s,t.enableAttributes(d,e),n))l.enableAttributes(d,e);for(let i of(o&&o.enableAttributes(d,e),a&&a.enableAttributes(d,e),s&&s.enableAttributes(d,e),t.bind(),t.setVertexAttribPointers(d,e,r),n))i.bind(),i.setVertexAttribPointers(d,e,r);o&&(o.bind(),o.setVertexAttribPointers(d,e,r)),i&&i.bind(),a&&(a.bind(),a.setVertexAttribPointers(d,e,r)),s&&(s.bind(),s.setVertexAttribPointers(d,e,r)),c.currentNumAttributes=l}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}function e6(e){let t=[];for(let n=0;n<e.length;n++){if(null===e[n])continue;let i=e[n].split(" ");t.push(i.pop())}return t}class e8{constructor(e,n,i,r,o,a){let s=e.gl;this.program=s.createProgram();let l=e6(n.staticAttributes),c=i?i.getBinderAttributes():[],d=l.concat(c),u=e5.prelude.staticUniforms?e6(e5.prelude.staticUniforms):[],h=n.staticUniforms?e6(n.staticUniforms):[],m=i?i.getBinderUniforms():[],f=u.concat(h).concat(m),p=[];for(let e of f)0>p.indexOf(e)&&p.push(e);let g=i?i.defines():[];o&&g.push("#define OVERDRAW_INSPECTOR;"),a&&g.push("#define TERRAIN3D;");let b=g.concat(e5.prelude.fragmentSource,n.fragmentSource).join("\n"),_=g.concat(e5.prelude.vertexSource,n.vertexSource).join("\n"),y=s.createShader(s.FRAGMENT_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);if(s.shaderSource(y,b),s.compileShader(y),!s.getShaderParameter(y,s.COMPILE_STATUS))throw Error(`Could not compile fragment shader: ${s.getShaderInfoLog(y)}`);s.attachShader(this.program,y);let v=s.createShader(s.VERTEX_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);if(s.shaderSource(v,_),s.compileShader(v),!s.getShaderParameter(v,s.COMPILE_STATUS))throw Error(`Could not compile vertex shader: ${s.getShaderInfoLog(v)}`);s.attachShader(this.program,v),this.attributes={};let x={};this.numAttributes=d.length;for(let e=0;e<this.numAttributes;e++)d[e]&&(s.bindAttribLocation(this.program,e,d[e]),this.attributes[d[e]]=e);if(s.linkProgram(this.program),!s.getProgramParameter(this.program,s.LINK_STATUS))throw Error(`Program failed to link: ${s.getProgramInfoLog(this.program)}`);s.deleteShader(v),s.deleteShader(y);for(let e=0;e<p.length;e++){let t=p[e];if(t&&!x[t]){let e=s.getUniformLocation(this.program,t);e&&(x[t]=e)}}this.fixedUniforms=r(e,x),this.terrainUniforms=((e,n)=>({u_depth:new t.aG(e,n.u_depth),u_terrain:new t.aG(e,n.u_terrain),u_terrain_dim:new t.aH(e,n.u_terrain_dim),u_terrain_matrix:new t.aI(e,n.u_terrain_matrix),u_terrain_unpack:new t.aJ(e,n.u_terrain_unpack),u_terrain_exaggeration:new t.aH(e,n.u_terrain_exaggeration)}))(e,x),this.binderUniforms=i?i.getUniforms(e,x):[]}draw(e,t,n,i,r,o,a,s,l,c,d,u,h,m,f,p,g,b){let _=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(n),e.setStencilMode(i),e.setColorMode(r),e.setCullFace(o),s)for(let t in e.activeTexture.set(_.TEXTURE2),_.bindTexture(_.TEXTURE_2D,s.depthTexture),e.activeTexture.set(_.TEXTURE3),_.bindTexture(_.TEXTURE_2D,s.texture),this.terrainUniforms)this.terrainUniforms[t].set(s[t]);for(let e in this.fixedUniforms)this.fixedUniforms[e].set(a[e]);f&&f.setUniforms(e,this.binderUniforms,h,{zoom:m});let y=0;switch(t){case _.LINES:y=2;break;case _.TRIANGLES:y=3;break;case _.LINE_STRIP:y=1}for(let n of u.get()){let i=n.vaos||(n.vaos={});(i[l]||(i[l]=new e4)).bind(e,this,c,f?f.getPaintVertexBuffers():[],d,n.vertexOffset,p,g,b),_.drawElements(t,n.primitiveLength*y,_.UNSIGNED_SHORT,n.primitiveOffset*y*2)}}}function e7(e,t,n){let i=1/eD(n,1,t.transform.tileZoom),r=Math.pow(2,n.tileID.overscaledZ),o=n.tileSize*Math.pow(2,t.transform.tileZoom)/r,a=o*(n.tileID.canonical.x+n.tileID.wrap*r),s=o*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[i,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[a>>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}let e9=(e,n,i,r)=>{var o,a,s,l,c,d,u;let h=n.style.light,m=h.properties.get("position"),f=[m.x,m.y,m.z],p=(o=new t.A(9),t.A!=Float32Array&&(o[1]=0,o[2]=0,o[3]=0,o[5]=0,o[6]=0,o[7]=0),o[0]=1,o[4]=1,o[8]=1,o);"viewport"===h.properties.get("anchor")&&(s=Math.sin(a=-n.transform.angle),l=Math.cos(a),p[0]=l,p[1]=s,p[2]=0,p[3]=-s,p[4]=l,p[5]=0,p[6]=0,p[7]=0,p[8]=1),c=f[0],d=f[1],u=f[2],f[0]=c*p[0]+d*p[3]+u*p[6],f[1]=c*p[1]+d*p[4]+u*p[7],f[2]=c*p[2]+d*p[5]+u*p[8];let g=h.properties.get("color");return{u_matrix:e,u_lightpos:f,u_lightintensity:h.properties.get("intensity"),u_lightcolor:[g.r,g.g,g.b],u_vertical_gradient:+i,u_opacity:r}},te=(e,n,i,r,o,a,s)=>t.e(e9(e,n,i,r),e7(a,n,s),{u_height_factor:-Math.pow(2,o.overscaledZ)/s.tileSize/8}),tt=e=>({u_matrix:e}),tn=(e,n,i,r)=>t.e(tt(e),e7(i,n,r)),ti=(e,t)=>({u_matrix:e,u_world:t}),tr=(e,n,i,r,o)=>t.e(tn(e,n,i,r),{u_world:o}),to=(e,t,n,i)=>{let r,o,a=e.transform;if("map"===i.paint.get("circle-pitch-alignment")){let e=eD(n,1,a.zoom);r=!0,o=[e,e]}else r=!1,o=a.pixelsToGLUnits;return{u_camera_to_center_distance:a.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(t.posMatrix,n,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+r,u_device_pixel_ratio:e.pixelRatio,u_extrude_scale:o}},ta=(e,t,n)=>{let i=eD(n,1,t.zoom),r=Math.pow(2,t.zoom-n.tileID.overscaledZ),o=n.tileID.overscaleFactor();return{u_matrix:e,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:i,u_extrude_scale:[t.pixelsToGLUnits[0]/(i*r),t.pixelsToGLUnits[1]/(i*r)],u_overscale_factor:o}},ts=(e,t,n=1)=>({u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:n}),tl=e=>({u_matrix:e}),tc=(e,t,n,i)=>({u_matrix:e,u_extrude_scale:eD(t,1,n),u_intensity:i}),td=(e,t,n,i)=>{let r=e.transform;return{u_matrix:tp(e,t,n,i),u_ratio:1/eD(t,1,r.zoom),u_device_pixel_ratio:e.pixelRatio,u_units_to_pixels:[1/r.pixelsToGLUnits[0],1/r.pixelsToGLUnits[1]]}},tu=(e,n,i,r,o)=>t.e(td(e,n,i,o),{u_image:0,u_image_height:r}),th=(e,t,n,i,r)=>{let o=e.transform,a=tf(t,o);return{u_matrix:tp(e,t,n,r),u_texsize:t.imageAtlasTexture.size,u_ratio:1/eD(t,1,o.zoom),u_device_pixel_ratio:e.pixelRatio,u_image:0,u_scale:[a,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},tm=(e,n,i,r,o,a)=>{let s=e.lineAtlas,l=tf(n,e.transform),c="round"===i.layout.get("line-cap"),d=s.getDash(r.from,c),u=s.getDash(r.to,c),h=d.width*o.fromScale,m=u.width*o.toScale;return t.e(td(e,n,i,a),{u_patternscale_a:[l/h,-d.height/2],u_patternscale_b:[l/m,-u.height/2],u_sdfgamma:s.width/(256*Math.min(h,m)*e.pixelRatio)/2,u_image:0,u_tex_y_a:d.y,u_tex_y_b:u.y,u_mix:o.t})};function tf(e,t){return 1/eD(e,1,t.tileZoom)}function tp(e,t,n,i){return e.translatePosMatrix(i?i.posMatrix:t.tileID.posMatrix,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}let tg=(e,t,n,i,r)=>{var o,a;return{u_matrix:e,u_tl_parent:t,u_scale_parent:n,u_buffer_scale:1,u_fade_t:i.mix,u_opacity:i.opacity*r.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:r.paint.get("raster-brightness-min"),u_brightness_high:r.paint.get("raster-brightness-max"),u_saturation_factor:(a=r.paint.get("raster-saturation"))>0?1-1/(1.001-a):-a,u_contrast_factor:(o=r.paint.get("raster-contrast"))>0?1/(1-o):1+o,u_spin_weights:function(e){let t=Math.sin(e*=Math.PI/180),n=Math.cos(e);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}(r.paint.get("raster-hue-rotate"))}},tb=(e,t,n,i,r,o,a,s,l,c)=>{let d=r.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:d.cameraToCenterDistance,u_pitch:d.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:d.width/d.height,u_fade_change:r.options.fadeDuration?r.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+i,u_texsize:c,u_texture:0}},t_=(e,n,i,r,o,a,s,l,c,d,u)=>{let h=o.transform;return t.e(tb(e,n,i,r,o,a,s,l,c,d),{u_gamma_scale:r?Math.cos(h._pitch)*h.cameraToCenterDistance:1,u_device_pixel_ratio:o.pixelRatio,u_is_halo:+u})},ty=(e,n,i,r,o,a,s,l,c,d)=>t.e(t_(e,n,i,r,o,a,s,l,!0,c,!0),{u_texsize_icon:d,u_texture_icon:1}),tv=(e,t,n)=>({u_matrix:e,u_opacity:t,u_color:n}),tx=(e,n,i,r,o,a)=>t.e(function(e,t,n,i){let r=n.imageManager.getPattern(e.from.toString()),o=n.imageManager.getPattern(e.to.toString()),{width:a,height:s}=n.imageManager.getPixelSize(),l=Math.pow(2,i.tileID.overscaledZ),c=i.tileSize*Math.pow(2,n.transform.tileZoom)/l,d=c*(i.tileID.canonical.x+i.tileID.wrap*l),u=c*i.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:r.tl,u_pattern_br_a:r.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[a,s],u_mix:t.t,u_pattern_size_a:r.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/eD(i,1,n.transform.tileZoom),u_pixel_coord_upper:[d>>16,u>>16],u_pixel_coord_lower:[65535&d,65535&u]}}(r,a,i,o),{u_matrix:e,u_opacity:n}),tw={fillExtrusion:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_lightpos:new t.aK(e,n.u_lightpos),u_lightintensity:new t.aH(e,n.u_lightintensity),u_lightcolor:new t.aK(e,n.u_lightcolor),u_vertical_gradient:new t.aH(e,n.u_vertical_gradient),u_opacity:new t.aH(e,n.u_opacity)}),fillExtrusionPattern:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_lightpos:new t.aK(e,n.u_lightpos),u_lightintensity:new t.aH(e,n.u_lightintensity),u_lightcolor:new t.aK(e,n.u_lightcolor),u_vertical_gradient:new t.aH(e,n.u_vertical_gradient),u_height_factor:new t.aH(e,n.u_height_factor),u_image:new t.aG(e,n.u_image),u_texsize:new t.aL(e,n.u_texsize),u_pixel_coord_upper:new t.aL(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.aL(e,n.u_pixel_coord_lower),u_scale:new t.aK(e,n.u_scale),u_fade:new t.aH(e,n.u_fade),u_opacity:new t.aH(e,n.u_opacity)}),fill:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix)}),fillPattern:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_image:new t.aG(e,n.u_image),u_texsize:new t.aL(e,n.u_texsize),u_pixel_coord_upper:new t.aL(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.aL(e,n.u_pixel_coord_lower),u_scale:new t.aK(e,n.u_scale),u_fade:new t.aH(e,n.u_fade)}),fillOutline:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_world:new t.aL(e,n.u_world)}),fillOutlinePattern:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_world:new t.aL(e,n.u_world),u_image:new t.aG(e,n.u_image),u_texsize:new t.aL(e,n.u_texsize),u_pixel_coord_upper:new t.aL(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.aL(e,n.u_pixel_coord_lower),u_scale:new t.aK(e,n.u_scale),u_fade:new t.aH(e,n.u_fade)}),circle:(e,n)=>({u_camera_to_center_distance:new t.aH(e,n.u_camera_to_center_distance),u_scale_with_map:new t.aG(e,n.u_scale_with_map),u_pitch_with_map:new t.aG(e,n.u_pitch_with_map),u_extrude_scale:new t.aL(e,n.u_extrude_scale),u_device_pixel_ratio:new t.aH(e,n.u_device_pixel_ratio),u_matrix:new t.aI(e,n.u_matrix)}),collisionBox:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_camera_to_center_distance:new t.aH(e,n.u_camera_to_center_distance),u_pixels_to_tile_units:new t.aH(e,n.u_pixels_to_tile_units),u_extrude_scale:new t.aL(e,n.u_extrude_scale),u_overscale_factor:new t.aH(e,n.u_overscale_factor)}),collisionCircle:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_inv_matrix:new t.aI(e,n.u_inv_matrix),u_camera_to_center_distance:new t.aH(e,n.u_camera_to_center_distance),u_viewport_size:new t.aL(e,n.u_viewport_size)}),debug:(e,n)=>({u_color:new t.aM(e,n.u_color),u_matrix:new t.aI(e,n.u_matrix),u_overlay:new t.aG(e,n.u_overlay),u_overlay_scale:new t.aH(e,n.u_overlay_scale)}),clippingMask:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix)}),heatmap:(e,n)=>({u_extrude_scale:new t.aH(e,n.u_extrude_scale),u_intensity:new t.aH(e,n.u_intensity),u_matrix:new t.aI(e,n.u_matrix)}),heatmapTexture:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_world:new t.aL(e,n.u_world),u_image:new t.aG(e,n.u_image),u_color_ramp:new t.aG(e,n.u_color_ramp),u_opacity:new t.aH(e,n.u_opacity)}),hillshade:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_image:new t.aG(e,n.u_image),u_latrange:new t.aL(e,n.u_latrange),u_light:new t.aL(e,n.u_light),u_shadow:new t.aM(e,n.u_shadow),u_highlight:new t.aM(e,n.u_highlight),u_accent:new t.aM(e,n.u_accent)}),hillshadePrepare:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_image:new t.aG(e,n.u_image),u_dimension:new t.aL(e,n.u_dimension),u_zoom:new t.aH(e,n.u_zoom),u_unpack:new t.aJ(e,n.u_unpack)}),line:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_ratio:new t.aH(e,n.u_ratio),u_device_pixel_ratio:new t.aH(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.aL(e,n.u_units_to_pixels)}),lineGradient:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_ratio:new t.aH(e,n.u_ratio),u_device_pixel_ratio:new t.aH(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.aL(e,n.u_units_to_pixels),u_image:new t.aG(e,n.u_image),u_image_height:new t.aH(e,n.u_image_height)}),linePattern:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_texsize:new t.aL(e,n.u_texsize),u_ratio:new t.aH(e,n.u_ratio),u_device_pixel_ratio:new t.aH(e,n.u_device_pixel_ratio),u_image:new t.aG(e,n.u_image),u_units_to_pixels:new t.aL(e,n.u_units_to_pixels),u_scale:new t.aK(e,n.u_scale),u_fade:new t.aH(e,n.u_fade)}),lineSDF:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_ratio:new t.aH(e,n.u_ratio),u_device_pixel_ratio:new t.aH(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.aL(e,n.u_units_to_pixels),u_patternscale_a:new t.aL(e,n.u_patternscale_a),u_patternscale_b:new t.aL(e,n.u_patternscale_b),u_sdfgamma:new t.aH(e,n.u_sdfgamma),u_image:new t.aG(e,n.u_image),u_tex_y_a:new t.aH(e,n.u_tex_y_a),u_tex_y_b:new t.aH(e,n.u_tex_y_b),u_mix:new t.aH(e,n.u_mix)}),raster:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_tl_parent:new t.aL(e,n.u_tl_parent),u_scale_parent:new t.aH(e,n.u_scale_parent),u_buffer_scale:new t.aH(e,n.u_buffer_scale),u_fade_t:new t.aH(e,n.u_fade_t),u_opacity:new t.aH(e,n.u_opacity),u_image0:new t.aG(e,n.u_image0),u_image1:new t.aG(e,n.u_image1),u_brightness_low:new t.aH(e,n.u_brightness_low),u_brightness_high:new t.aH(e,n.u_brightness_high),u_saturation_factor:new t.aH(e,n.u_saturation_factor),u_contrast_factor:new t.aH(e,n.u_contrast_factor),u_spin_weights:new t.aK(e,n.u_spin_weights)}),symbolIcon:(e,n)=>({u_is_size_zoom_constant:new t.aG(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aG(e,n.u_is_size_feature_constant),u_size_t:new t.aH(e,n.u_size_t),u_size:new t.aH(e,n.u_size),u_camera_to_center_distance:new t.aH(e,n.u_camera_to_center_distance),u_pitch:new t.aH(e,n.u_pitch),u_rotate_symbol:new t.aG(e,n.u_rotate_symbol),u_aspect_ratio:new t.aH(e,n.u_aspect_ratio),u_fade_change:new t.aH(e,n.u_fade_change),u_matrix:new t.aI(e,n.u_matrix),u_label_plane_matrix:new t.aI(e,n.u_label_plane_matrix),u_coord_matrix:new t.aI(e,n.u_coord_matrix),u_is_text:new t.aG(e,n.u_is_text),u_pitch_with_map:new t.aG(e,n.u_pitch_with_map),u_texsize:new t.aL(e,n.u_texsize),u_texture:new t.aG(e,n.u_texture)}),symbolSDF:(e,n)=>({u_is_size_zoom_constant:new t.aG(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aG(e,n.u_is_size_feature_constant),u_size_t:new t.aH(e,n.u_size_t),u_size:new t.aH(e,n.u_size),u_camera_to_center_distance:new t.aH(e,n.u_camera_to_center_distance),u_pitch:new t.aH(e,n.u_pitch),u_rotate_symbol:new t.aG(e,n.u_rotate_symbol),u_aspect_ratio:new t.aH(e,n.u_aspect_ratio),u_fade_change:new t.aH(e,n.u_fade_change),u_matrix:new t.aI(e,n.u_matrix),u_label_plane_matrix:new t.aI(e,n.u_label_plane_matrix),u_coord_matrix:new t.aI(e,n.u_coord_matrix),u_is_text:new t.aG(e,n.u_is_text),u_pitch_with_map:new t.aG(e,n.u_pitch_with_map),u_texsize:new t.aL(e,n.u_texsize),u_texture:new t.aG(e,n.u_texture),u_gamma_scale:new t.aH(e,n.u_gamma_scale),u_device_pixel_ratio:new t.aH(e,n.u_device_pixel_ratio),u_is_halo:new t.aG(e,n.u_is_halo)}),symbolTextAndIcon:(e,n)=>({u_is_size_zoom_constant:new t.aG(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aG(e,n.u_is_size_feature_constant),u_size_t:new t.aH(e,n.u_size_t),u_size:new t.aH(e,n.u_size),u_camera_to_center_distance:new t.aH(e,n.u_camera_to_center_distance),u_pitch:new t.aH(e,n.u_pitch),u_rotate_symbol:new t.aG(e,n.u_rotate_symbol),u_aspect_ratio:new t.aH(e,n.u_aspect_ratio),u_fade_change:new t.aH(e,n.u_fade_change),u_matrix:new t.aI(e,n.u_matrix),u_label_plane_matrix:new t.aI(e,n.u_label_plane_matrix),u_coord_matrix:new t.aI(e,n.u_coord_matrix),u_is_text:new t.aG(e,n.u_is_text),u_pitch_with_map:new t.aG(e,n.u_pitch_with_map),u_texsize:new t.aL(e,n.u_texsize),u_texsize_icon:new t.aL(e,n.u_texsize_icon),u_texture:new t.aG(e,n.u_texture),u_texture_icon:new t.aG(e,n.u_texture_icon),u_gamma_scale:new t.aH(e,n.u_gamma_scale),u_device_pixel_ratio:new t.aH(e,n.u_device_pixel_ratio),u_is_halo:new t.aG(e,n.u_is_halo)}),background:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_opacity:new t.aH(e,n.u_opacity),u_color:new t.aM(e,n.u_color)}),backgroundPattern:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_opacity:new t.aH(e,n.u_opacity),u_image:new t.aG(e,n.u_image),u_pattern_tl_a:new t.aL(e,n.u_pattern_tl_a),u_pattern_br_a:new t.aL(e,n.u_pattern_br_a),u_pattern_tl_b:new t.aL(e,n.u_pattern_tl_b),u_pattern_br_b:new t.aL(e,n.u_pattern_br_b),u_texsize:new t.aL(e,n.u_texsize),u_mix:new t.aH(e,n.u_mix),u_pattern_size_a:new t.aL(e,n.u_pattern_size_a),u_pattern_size_b:new t.aL(e,n.u_pattern_size_b),u_scale_a:new t.aH(e,n.u_scale_a),u_scale_b:new t.aH(e,n.u_scale_b),u_pixel_coord_upper:new t.aL(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.aL(e,n.u_pixel_coord_lower),u_tile_units_to_pixels:new t.aH(e,n.u_tile_units_to_pixels)}),terrain:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_texture:new t.aG(e,n.u_texture),u_ele_delta:new t.aH(e,n.u_ele_delta)}),terrainDepth:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_ele_delta:new t.aH(e,n.u_ele_delta)}),terrainCoords:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_texture:new t.aG(e,n.u_texture),u_terrain_coords_id:new t.aH(e,n.u_terrain_coords_id),u_ele_delta:new t.aH(e,n.u_ele_delta)})};class tF{constructor(e,t,n){this.context=e;let i=e.gl;this.buffer=i.createBuffer(),this.dynamicDraw=!!n,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){let t=this.context.gl;if(!this.dynamicDraw)throw Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let tk={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class tE{constructor(e,t,n,i){this.length=t.length,this.attributes=n,this.itemSize=t.bytesPerElement,this.dynamicDraw=i,this.context=e;let r=e.gl;this.buffer=r.createBuffer(),e.bindVertexBuffer.set(this.buffer),r.bufferData(r.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);let t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,t){for(let n=0;n<this.attributes.length;n++){let i=t.attributes[this.attributes[n].name];void 0!==i&&e.enableVertexAttribArray(i)}}setVertexAttribPointers(e,t,n){for(let i=0;i<this.attributes.length;i++){let r=this.attributes[i],o=t.attributes[r.name];void 0!==o&&e.vertexAttribPointer(o,r.components,e[tk[r.type]],!1,this.itemSize,r.offset+this.itemSize*(n||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let tA=new WeakMap;function tC(e){var t;if(tA.has(e))return tA.get(e);{let n=null==(t=e.getParameter(e.VERSION))?void 0:t.startsWith("WebGL 2.0");return tA.set(e,n),n}}class tT{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class tS extends tT{getDefault(){return t.aO.transparent}set(e){let t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class tM extends tT{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class tL extends tT{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class tD extends tT{getDefault(){return[!0,!0,!0,!0]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class tI extends tT{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class tR extends tT{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class tO extends tT{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){let t=this.current;(e.func!==t.func||e.ref!==t.ref||e.mask!==t.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class tP extends tT{getDefault(){let e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class t$ extends tT{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}}class tN extends tT{getDefault(){return[0,1]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class tB extends tT{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}}class tz extends tT{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class tj extends tT{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}}class tY extends tT{getDefault(){let e=this.gl;return[e.ONE,e.ZERO]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}class tH extends tT{getDefault(){return t.aO.transparent}set(e){let t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class tU extends tT{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class tV extends tT{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}}class tW extends tT{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class tG extends tT{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}class tq extends tT{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}}class tK extends tT{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class tX extends tT{getDefault(){let e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class tZ extends tT{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class tJ extends tT{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class tQ extends tT{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class t0 extends tT{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class t1 extends tT{getDefault(){return null}set(e){let t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class t2 extends tT{getDefault(){return null}set(e){var t;if(e===this.current&&!this.dirty)return;let n=this.gl;tC(n)?n.bindVertexArray(e):null==(t=n.getExtension("OES_vertex_array_object"))||t.bindVertexArrayOES(e),this.current=e,this.dirty=!1}}class t5 extends tT{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class t3 extends tT{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class t4 extends tT{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class t6 extends tT{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}}class t8 extends t6{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class t7 extends t6{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class t9 extends t6{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class ne{constructor(e,t,n,i,r){this.context=e,this.width=t,this.height=n;let o=e.gl,a=this.framebuffer=o.createFramebuffer();if(this.colorAttachment=new t8(e,a),i)this.depthAttachment=r?new t9(e,a):new t7(e,a);else if(r)throw Error("Stencil cannot be set without depth");if(o.checkFramebufferStatus(o.FRAMEBUFFER)!==o.FRAMEBUFFER_COMPLETE)throw Error("Framebuffer is not complete")}destroy(){let e=this.context.gl,t=this.colorAttachment.get();if(t&&e.deleteTexture(t),this.depthAttachment){let t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}e.deleteFramebuffer(this.framebuffer)}}class nt{constructor(e,t,n){this.blendFunction=e,this.blendColor=t,this.mask=n}}nt.Replace=[1,0],nt.disabled=new nt(nt.Replace,t.aO.transparent,[!1,!1,!1,!1]),nt.unblended=new nt(nt.Replace,t.aO.transparent,[!0,!0,!0,!0]),nt.alphaBlended=new nt([1,771],t.aO.transparent,[!0,!0,!0,!0]);class nn{constructor(e){var t,n;if(this.gl=e,this.clearColor=new tS(this),this.clearDepth=new tM(this),this.clearStencil=new tL(this),this.colorMask=new tD(this),this.depthMask=new tI(this),this.stencilMask=new tR(this),this.stencilFunc=new tO(this),this.stencilOp=new tP(this),this.stencilTest=new t$(this),this.depthRange=new tN(this),this.depthTest=new tB(this),this.depthFunc=new tz(this),this.blend=new tj(this),this.blendFunc=new tY(this),this.blendColor=new tH(this),this.blendEquation=new tU(this),this.cullFace=new tV(this),this.cullFaceSide=new tW(this),this.frontFace=new tG(this),this.program=new tq(this),this.activeTexture=new tK(this),this.viewport=new tX(this),this.bindFramebuffer=new tZ(this),this.bindRenderbuffer=new tJ(this),this.bindTexture=new tQ(this),this.bindVertexBuffer=new t0(this),this.bindElementBuffer=new t1(this),this.bindVertexArray=new t2(this),this.pixelStoreUnpack=new t5(this),this.pixelStoreUnpackPremultiplyAlpha=new t3(this),this.pixelStoreUnpackFlipY=new t4(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),tC(e)){this.HALF_FLOAT=e.HALF_FLOAT;let i=e.getExtension("EXT_color_buffer_half_float");this.RGBA16F=null!=(t=e.RGBA16F)?t:null==i?void 0:i.RGBA16F_EXT,this.RGB16F=null!=(n=e.RGB16F)?n:null==i?void 0:i.RGB16F_EXT,e.getExtension("EXT_color_buffer_float")}else{e.getExtension("EXT_color_buffer_half_float"),e.getExtension("OES_texture_half_float_linear");let t=e.getExtension("OES_texture_half_float");this.HALF_FLOAT=null==t?void 0:t.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,t){return new tF(this,e,t)}createVertexBuffer(e,t,n){return new tE(this,e,t,n)}createRenderbuffer(e,t,n){let i=this.gl,r=i.createRenderbuffer();return this.bindRenderbuffer.set(r),i.renderbufferStorage(i.RENDERBUFFER,e,t,n),this.bindRenderbuffer.set(null),r}createFramebuffer(e,t,n,i){return new ne(this,e,t,n,i)}clear({color:e,depth:t,stencil:n}){let i=this.gl,r=0;e&&(r|=i.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==t&&(r|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),void 0!==n&&(r|=i.STENCIL_BUFFER_BIT,this.clearStencil.set(n),this.stencilMask.set(255)),i.clear(r)}setCullFace(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(e){t.aD(e.blendFunction,nt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){var e;return tC(this.gl)?this.gl.createVertexArray():null==(e=this.gl.getExtension("OES_vertex_array_object"))?void 0:e.createVertexArrayOES()}deleteVertexArray(e){var t;return tC(this.gl)?this.gl.deleteVertexArray(e):null==(t=this.gl.getExtension("OES_vertex_array_object"))?void 0:t.deleteVertexArrayOES(e)}unbindVAO(){this.bindVertexArray.set(null)}}class ni{constructor(e,t,n){this.func=e,this.mask=t,this.range=n}}ni.ReadOnly=!1,ni.ReadWrite=!0,ni.disabled=new ni(519,ni.ReadOnly,[0,1]);class nr{constructor(e,t,n,i,r,o){this.test=e,this.ref=t,this.mask=n,this.fail=i,this.depthFail=r,this.pass=o}}nr.disabled=new nr({func:519,mask:0},0,0,7680,7680,7680);class no{constructor(e,t,n){this.enable=e,this.mode=t,this.frontFace=n}}function na(e,n,i,r,o,a,l){var c;let d=e.context,u=d.gl,h=e.useProgram("collisionBox"),m=[],f=0,p=0;for(let s=0;s<r.length;s++){let c=r[s],g=n.getTile(c),b=g.getBucket(i);if(!b)continue;let _=c.posMatrix;0===o[0]&&0===o[1]||(_=e.translatePosMatrix(c.posMatrix,g,o,a));let y=l?b.textCollisionBox:b.iconCollisionBox,v=b.collisionCircleArray;if(v.length>0){let n=t.F(),i=_;t.aP(n,b.placementInvProjMatrix,e.transform.glCoordMatrix),t.aP(n,n,b.placementViewportMatrix),m.push({circleArray:v,circleOffset:p,transform:i,invTransform:n,coord:c}),f+=v.length/4,p=f}y&&h.draw(d,u.LINES,ni.disabled,nr.disabled,e.colorModeForRenderPass(),no.disabled,ta(_,e.transform,g),e.style.map.terrain&&e.style.map.terrain.getTerrainData(c),i.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,null,e.transform.zoom,null,null,y.collisionVertexBuffer)}if(!l||!m.length)return;let g=e.useProgram("collisionCircle"),b=new t.aQ;b.resize(4*f),b._trim();let _=0;for(let e of m)for(let t=0;t<e.circleArray.length/4;t++){let n=4*t,i=e.circleArray[n+0],r=e.circleArray[n+1],o=e.circleArray[n+2],a=e.circleArray[n+3];b.emplace(_++,i,r,o,a,0),b.emplace(_++,i,r,o,a,1),b.emplace(_++,i,r,o,a,2),b.emplace(_++,i,r,o,a,3)}(!s||s.length<2*f)&&(s=function(e){let n=2*e,i=new t.aS;i.resize(n),i._trim();for(let e=0;e<n;e++){let t=6*e;i.uint16[t+0]=4*e+0,i.uint16[t+1]=4*e+1,i.uint16[t+2]=4*e+2,i.uint16[t+3]=4*e+2,i.uint16[t+4]=4*e+3,i.uint16[t+5]=4*e+0}return i}(f));let y=d.createIndexBuffer(s,!0),v=d.createVertexBuffer(b,t.aR.members,!0);for(let n of m){let r={u_matrix:n.transform,u_inv_matrix:n.invTransform,u_camera_to_center_distance:(c=e.transform).cameraToCenterDistance,u_viewport_size:[c.width,c.height]};g.draw(d,u.TRIANGLES,ni.disabled,nr.disabled,e.colorModeForRenderPass(),no.disabled,r,e.style.map.terrain&&e.style.map.terrain.getTerrainData(n.coord),i.id,v,y,t.$.simpleSegment(0,2*n.circleOffset,n.circleArray.length,n.circleArray.length/2),null,e.transform.zoom,null,null,null)}v.destroy(),y.destroy()}no.disabled=new no(!1,1029,2305),no.backCCW=new no(!0,1029,2305);let ns=t.an(new Float32Array(16));function nl(e,n,i,r,o,a,s,l,c,d,u,h){let m=e.context,f=m.gl,p=e.transform,g="map"===l,b="map"===c,_="viewport"!==l&&"point"!==i.layout.get("symbol-placement"),y=g&&!b&&!_,v=!i.layout.get("symbol-sort-key").isConstant(),x=!1,w=e.depthModeForSublayer(0,ni.ReadOnly),F=i._unevaluatedLayout.hasValue("text-variable-anchor")||i._unevaluatedLayout.hasValue("text-variable-anchor-offset"),k=[];for(let l of r){let r=n.getTile(l),c=r.getBucket(i);if(!c)continue;let u=o?c.text:c.icon;if(!u||!u.segments.get().length||!u.hasVisibleVertices)continue;let h=u.programConfigurations.get(i.id),m=o||c.sdfIcons,w=o?c.textSizeData:c.iconSizeData,E=b||0!==p.pitch,A=e.useProgram(c.iconsInText&&o?"symbolTextAndIcon":m?"symbolSDF":"symbolIcon",h),C=t.ag(w,p.zoom),T=e.style.map.terrain&&e.style.map.terrain.getTerrainData(l),S,M,D,I,R=[0,0],O=null;if(o)M=r.glyphAtlasTexture,D=f.LINEAR,S=r.glyphAtlasTexture.size,c.iconsInText&&(R=r.imageAtlasTexture.size,O=r.imageAtlasTexture,I=E||e.options.rotating||e.options.zooming||"composite"===w.kind||"camera"===w.kind?f.LINEAR:f.NEAREST);else{let t=1!==i.layout.get("icon-size").constantOr(0)||c.iconsNeedLinear;M=r.imageAtlasTexture,D=m||e.options.rotating||e.options.zooming||t||E?f.LINEAR:f.NEAREST,S=r.imageAtlasTexture.size}let P=eD(r,1,e.transform.zoom),$=eb(l.posMatrix,b,g,e.transform,P),N=e_(l.posMatrix,b,g,e.transform,P),B=F&&c.hasTextData(),z="none"!==i.layout.get("icon-text-fit")&&B&&c.hasIconData();if(_){let n=e.style.map.terrain?(t,n)=>e.style.map.terrain.getElevation(l,t,n):null,r="map"===i.layout.get("text-rotation-alignment");!function(e,n,i,r,o,a,s,l,c,d){let u=r?e.textSizeData:e.iconSizeData,h=t.ag(u,i.transform.zoom),m=[256/i.width*2+1,256/i.height*2+1],f=r?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;f.clear();let p=e.lineVertexArray,g=r?e.text.placedSymbolArray:e.icon.placedSymbolArray,b=i.transform.width/i.transform.height,_=!1;for(let r=0;r<g.length;r++){let y,v=g.get(r);if(v.hidden||v.writingMode===t.ah.vertical&&!_||(_=!1,d?(y=[v.anchorX,v.anchorY,d(v.anchorX,v.anchorY),1],t.af(y,y,n)):eM(y=[v.anchorX,v.anchorY,0,1],y,n),!function(e,t){let n=e[0]/e[3],i=e[1]/e[3];return n>=-t[0]&&n<=t[0]&&i>=-t[1]&&i<=t[1]}(y,m))){eS(v.numGlyphs,f);continue}let x=ev(i.transform.cameraToCenterDistance,y[3]),w=t.ai(u,h,v),F=s?w/x:w*x,k=new t.P(v.anchorX,v.anchorY),E=ey(k,o,d).point,A={projections:{},offsets:{}},C=eF(v,F,!1,l,n,o,a,e.glyphOffsetArray,p,f,E,k,A,b,c,d);_=C.useVertical,(C.notEnoughRoom||_||C.needsFlipping&&eF(v,F,!0,l,n,o,a,e.glyphOffsetArray,p,f,E,k,A,b,c,d).notEnoughRoom)&&eS(v.numGlyphs,f)}r?e.text.dynamicLayoutVertexBuffer.updateData(f):e.icon.dynamicLayoutVertexBuffer.updateData(f)}(c,l.posMatrix,e,o,$,N,b,d,r,n)}let j=e.translatePosMatrix(l.posMatrix,r,a,s),Y=_||o&&F||z?ns:$,H=e.translatePosMatrix(N,r,a,s,!0),U=m&&0!==i.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1),V={program:A,buffers:u,uniformValues:m?c.iconsInText?ty(w.kind,C,y,b,e,j,Y,H,S,R):t_(w.kind,C,y,b,e,j,Y,H,o,S,!0):tb(w.kind,C,y,b,e,j,Y,H,o,S),atlasTexture:M,atlasTextureIcon:O,atlasInterpolation:D,atlasInterpolationIcon:I,isSDF:m,hasHalo:U};if(v&&c.canOverlap)for(let e of(x=!0,u.segments.get()))k.push({segments:new t.$([e]),sortKey:e.sortKey,state:V,terrainData:T});else k.push({segments:u.segments,sortKey:0,state:V,terrainData:T})}for(let t of(x&&k.sort((e,t)=>e.sortKey-t.sortKey),k)){let n=t.state;if(m.activeTexture.set(f.TEXTURE0),n.atlasTexture.bind(n.atlasInterpolation,f.CLAMP_TO_EDGE),n.atlasTextureIcon&&(m.activeTexture.set(f.TEXTURE1),n.atlasTextureIcon&&n.atlasTextureIcon.bind(n.atlasInterpolationIcon,f.CLAMP_TO_EDGE)),n.isSDF){let r=n.uniformValues;n.hasHalo&&(r.u_is_halo=1,nc(n.buffers,t.segments,i,e,n.program,w,u,h,r,t.terrainData)),r.u_is_halo=0}nc(n.buffers,t.segments,i,e,n.program,w,u,h,n.uniformValues,t.terrainData)}}function nc(e,t,n,i,r,o,a,s,l,c){let d=i.context;r.draw(d,d.gl.TRIANGLES,o,a,s,no.disabled,l,c,n.id,e.layoutVertexBuffer,e.indexBuffer,t,n.paint,i.transform.zoom,e.programConfigurations.get(n.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function nd(e,t,n,i,r){if(!n||!i||!i.imageAtlas)return;let o=i.imageAtlas.patternPositions,a=o[n.to.toString()],s=o[n.from.toString()];if(!a&&s&&(a=s),!s&&a&&(s=a),!a||!s){let e=r.getPaintProperty(t);a=o[e],s=o[e]}a&&s&&e.setConstantPatternPositions(a,s)}function nu(e,t,n,i,r,o,a){let s,l,c,d,u,h=e.context.gl,m="fill-pattern",f=n.paint.get(m),p=f&&f.constantOr(1),g=n.getCrossfadeParameters();a?(l=p&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=h.LINES):(l=p?"fillPattern":"fill",s=h.TRIANGLES);let b=f.constantOr(null);for(let f of i){let i=t.getTile(f);if(p&&!i.patternsLoaded())continue;let _=i.getBucket(n);if(!_)continue;let y=_.programConfigurations.get(n.id),v=e.useProgram(l,y),x=e.style.map.terrain&&e.style.map.terrain.getTerrainData(f);p&&(e.context.activeTexture.set(h.TEXTURE0),i.imageAtlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),y.updatePaintBuffers(g)),nd(y,m,b,i,n);let w=x?f:null,F=e.translatePosMatrix(w?w.posMatrix:f.posMatrix,i,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(a){d=_.indexBuffer2,u=_.segments2;let t=[h.drawingBufferWidth,h.drawingBufferHeight];c="fillOutlinePattern"===l&&p?tr(F,e,g,i,t):ti(F,t)}else d=_.indexBuffer,u=_.segments,c=p?tn(F,e,g,i):tt(F);v.draw(e.context,s,r,e.stencilModeForClipping(f),o,no.disabled,c,x,n.id,_.layoutVertexBuffer,d,u,n.paint,e.transform.zoom,y)}}function nh(e,t,n,i,r,o,a){let s=e.context,l=s.gl,c="fill-extrusion-pattern",d=n.paint.get(c),u=d.constantOr(1),h=n.getCrossfadeParameters(),m=n.paint.get("fill-extrusion-opacity"),f=d.constantOr(null);for(let d of i){let i=t.getTile(d),p=i.getBucket(n);if(!p)continue;let g=e.style.map.terrain&&e.style.map.terrain.getTerrainData(d),b=p.programConfigurations.get(n.id),_=e.useProgram(u?"fillExtrusionPattern":"fillExtrusion",b);u&&(e.context.activeTexture.set(l.TEXTURE0),i.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),b.updatePaintBuffers(h)),nd(b,c,f,i,n);let y=e.translatePosMatrix(d.posMatrix,i,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),v=n.paint.get("fill-extrusion-vertical-gradient"),x=u?te(y,e,v,m,d,h,i):e9(y,e,v,m);_.draw(s,s.gl.TRIANGLES,r,o,a,no.backCCW,x,g,n.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,n.paint,e.transform.zoom,b,e.style.map.terrain&&p.centroidVertexBuffer)}}let nm=new t.aO(1,0,0,1),nf=new t.aO(0,1,0,1),np=new t.aO(0,0,1,1),ng=new t.aO(1,0,1,1),nb=new t.aO(0,1,1,1);function n_(e,t,n,i){nv(e,0,t+n/2,e.transform.width,n,i)}function ny(e,t,n,i){nv(e,t-n/2,0,n,e.transform.height,i)}function nv(e,t,n,i,r,o){let a=e.context,s=a.gl;s.enable(s.SCISSOR_TEST),s.scissor(t*e.pixelRatio,n*e.pixelRatio,i*e.pixelRatio,r*e.pixelRatio),a.clear({color:o}),s.disable(s.SCISSOR_TEST)}function nx(e,t,n){let i=e.context,r=i.gl,o=e.colorModeForRenderPass(),a=new ni(r.LEQUAL,ni.ReadWrite,e.depthRangeFor3D),s=e.useProgram("terrain"),l=t.getTerrainMesh();for(let c of(i.bindFramebuffer.set(null),i.viewport.set([0,0,e.width,e.height]),n)){let n=e.renderToTexture.getTexture(c),d=t.getTerrainData(c.tileID);i.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,n.texture);let u={u_matrix:e.transform.calculatePosMatrix(c.tileID.toUnwrapped()),u_texture:0,u_ele_delta:t.getMeshFrameDelta(e.transform.zoom)};s.draw(i,r.TRIANGLES,a,nr.disabled,o,no.backCCW,u,d,"terrain",l.vertexBuffer,l.indexBuffer,l.segments)}}class nw{constructor(e,n){this.context=new nn(e),this.transform=n,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:t.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=eu.maxUnderzooming+eu.maxOverzooming+1,this.depthEpsilon=1/65536,this.crossTileSymbolIndex=new eZ}resize(e,t,n){if(this.width=Math.floor(e*n),this.height=Math.floor(t*n),this.pixelRatio=n,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let e of this.style._order)this.style._layers[e].resize()}setup(){let e=this.context,n=new t.aV;n.emplaceBack(0,0),n.emplaceBack(t.W,0),n.emplaceBack(0,t.W),n.emplaceBack(t.W,t.W),this.tileExtentBuffer=e.createVertexBuffer(n,e1.members),this.tileExtentSegments=t.$.simpleSegment(0,0,4,2);let i=new t.aV;i.emplaceBack(0,0),i.emplaceBack(t.W,0),i.emplaceBack(0,t.W),i.emplaceBack(t.W,t.W),this.debugBuffer=e.createVertexBuffer(i,e1.members),this.debugSegments=t.$.simpleSegment(0,0,4,5);let r=new t.Z;r.emplaceBack(0,0,0,0),r.emplaceBack(t.W,0,t.W,0),r.emplaceBack(0,t.W,0,t.W),r.emplaceBack(t.W,t.W,t.W,t.W),this.rasterBoundsBuffer=e.createVertexBuffer(r,J.members),this.rasterBoundsSegments=t.$.simpleSegment(0,0,4,2);let o=new t.aV;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(o,e1.members),this.viewportSegments=t.$.simpleSegment(0,0,4,2);let a=new t.aW;a.emplaceBack(0),a.emplaceBack(1),a.emplaceBack(3),a.emplaceBack(2),a.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(a);let s=new t.aX;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s);let l=this.context.gl;this.stencilClearMode=new nr({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)}clearStencil(){let e=this.context,n=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let i=t.F();t.aN(i,0,this.width,this.height,0,0,1),t.J(i,i,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,n.TRIANGLES,ni.disabled,this.stencilClearMode,nt.disabled,no.disabled,tl(i),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,t){if(this.currentStencilSource===e.source||!e.isTileClipped()||!t||!t.length)return;this.currentStencilSource=e.source;let n=this.context,i=n.gl;this.nextStencilID+t.length>256&&this.clearStencil(),n.setColorMode(nt.disabled),n.setDepthMode(ni.disabled);let r=this.useProgram("clippingMask");for(let e of(this._tileClippingMaskIDs={},t)){let t=this._tileClippingMaskIDs[e.key]=this.nextStencilID++,o=this.style.map.terrain&&this.style.map.terrain.getTerrainData(e);r.draw(n,i.TRIANGLES,ni.disabled,new nr({func:i.ALWAYS,mask:0},t,255,i.KEEP,i.KEEP,i.REPLACE),nt.disabled,no.disabled,tl(e.posMatrix),o,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let e=this.nextStencilID++,t=this.context.gl;return new nr({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){let t=this.context.gl;return new nr({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}stencilConfigForOverlap(e){let t=this.context.gl,n=e.sort((e,t)=>t.overscaledZ-e.overscaledZ),i=n[n.length-1].overscaledZ,r=n[0].overscaledZ-i+1;if(r>1){this.currentStencilSource=void 0,this.nextStencilID+r>256&&this.clearStencil();let e={};for(let n=0;n<r;n++)e[n+i]=new nr({func:t.GEQUAL,mask:255},n+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=r,[e,n]}return[{[i]:nr.disabled},n]}colorModeForRenderPass(){let e=this.context.gl;if(this._showOverdrawInspector){let n=1/8;return new nt([e.CONSTANT_COLOR,e.ONE],new t.aO(n,n,n,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?nt.unblended:nt.alphaBlended}depthModeForSublayer(e,t,n){if(!this.opaquePassEnabledForLayer())return ni.disabled;let i=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new ni(n||this.context.gl.LEQUAL,t,[i,i])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,n){this.style=e,this.options=n,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(u.now()),this.imageManager.beginFrame();let i=this.style._order,r=this.style.sourceCaches,o={},a={},s={};for(let e in r){let t=r[e];t.used&&t.prepare(this.context),o[e]=t.getVisibleCoordinates(),a[e]=o[e].slice().reverse(),s[e]=t.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let e=0;e<i.length;e++)if(this.style._layers[i[e]].is3D()){this.opaquePassCutoff=e;break}for(let e of(this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen",i)){let t=this.style._layers[e];if(!t.hasOffscreenPass()||t.isHidden(this.transform.zoom))continue;let n=a[t.source];("custom"===t.type||n.length)&&this.renderLayer(this,r[t.source],t,n)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:n.showOverdrawInspector?t.aO.black:t.aO.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=n.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=i.length-1;this.currentLayer>=0;this.currentLayer--){let e=this.style._layers[i[this.currentLayer]],t=r[e.source],n=o[e.source];this._renderTileClippingMasks(e,n),this.renderLayer(this,t,e,n)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){let e=this.style._layers[i[this.currentLayer]],t=r[e.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(e))continue;let n=("symbol"===e.type?s:a)[e.source];this._renderTileClippingMasks(e,o[e.source]),this.renderLayer(this,t,e,n)}if(this.options.showTileBoundaries){let e=function(e,t){let n=null,i=Object.values(e._layers).flatMap(n=>n.source&&!n.isHidden(t)?[e.sourceCaches[n.source]]:[]),r=i.filter(e=>"vector"===e.getSource().type),o=i.filter(e=>"vector"!==e.getSource().type),a=e=>{(!n||n.getSource().maxzoom<e.getSource().maxzoom)&&(n=e)};return r.forEach(e=>a(e)),n||o.forEach(e=>a(e)),n}(this.style,this.transform.zoom);e&&function(e,n,i){for(let r=0;r<i.length;r++)!function(e,n,i){let r=e.context,o=r.gl,a=i.posMatrix,s=e.useProgram("debug"),l=ni.disabled,c=nr.disabled,d=e.colorModeForRenderPass(),u="$debug",h=e.style.map.terrain&&e.style.map.terrain.getTerrainData(i);r.activeTexture.set(o.TEXTURE0);let m=n.getTileByID(i.key).latestRawTileData,f=Math.floor((m&&m.byteLength||0)/1024),p=512/Math.min(n.getTile(i).tileSize,512)*(i.overscaledZ/e.transform.zoom)*.5,g=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(g+=` => ${i.overscaledZ}`),function(e,t){e.initDebugOverlayCanvas();let n=e.debugOverlayCanvas,i=e.context.gl,r=e.debugOverlayCanvas.getContext("2d");r.clearRect(0,0,n.width,n.height),r.shadowColor="white",r.shadowBlur=2,r.lineWidth=1.5,r.strokeStyle="white",r.textBaseline="top",r.font="bold 36px Open Sans, sans-serif",r.fillText(t,5,5),r.strokeText(t,5,5),e.debugOverlayTexture.update(n),e.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}(e,`${g} ${f}kB`),s.draw(r,o.TRIANGLES,l,c,nt.alphaBlended,no.disabled,ts(a,t.aO.transparent,p),null,u,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments),s.draw(r,o.LINE_STRIP,l,c,d,no.disabled,ts(a,t.aO.red),h,u,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments)}(e,n,i[r])}(this,e,e.getVisibleCoordinates())}this.options.showPadding&&function(e){var t,n;let i=e.transform.padding;n_(e,e.transform.height-(i.top||0),3,nm),n_(e,i.bottom||0,3,nf),ny(e,i.left||0,3,np),ny(e,e.transform.width-(i.right||0),3,ng);let r=e.transform.centerPoint;t=r.x,n=e.transform.height-r.y,nv(e,t-1,n-10,2,20,nb),nv(e,t-10,n-1,20,2,nb)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(e){if(!this.style||!this.style.map||!this.style.map.terrain)return;let n=this.terrainFacilitator.matrix,i=this.transform.projMatrix,r=this.terrainFacilitator.dirty;r||(r=e?!t.aY(n,i):!t.aZ(n,i)),r||(r=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),r&&(t.a_(n,i),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(e,n){let i=e.context,r=i.gl,o=nt.unblended,a=new ni(r.LEQUAL,ni.ReadWrite,[0,1]),s=n.getTerrainMesh(),l=n.sourceCache.getRenderableTiles(),c=e.useProgram("terrainDepth");for(let d of(i.bindFramebuffer.set(n.getFramebuffer("depth").framebuffer),i.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),i.clear({color:t.aO.transparent,depth:1}),l)){let t=n.getTerrainData(d.tileID),l={u_matrix:e.transform.calculatePosMatrix(d.tileID.toUnwrapped()),u_ele_delta:n.getMeshFrameDelta(e.transform.zoom)};c.draw(i,r.TRIANGLES,a,nr.disabled,o,no.backCCW,l,t,"terrain",s.vertexBuffer,s.indexBuffer,s.segments)}i.bindFramebuffer.set(null),i.viewport.set([0,0,e.width,e.height])}(this,this.style.map.terrain),function(e,n){let i=e.context,r=i.gl,o=nt.unblended,a=new ni(r.LEQUAL,ni.ReadWrite,[0,1]),s=n.getTerrainMesh(),l=n.getCoordsTexture(),c=n.sourceCache.getRenderableTiles(),d=e.useProgram("terrainCoords");for(let u of(i.bindFramebuffer.set(n.getFramebuffer("coords").framebuffer),i.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),i.clear({color:t.aO.transparent,depth:1}),n.coordsIndex=[],c)){let t=n.getTerrainData(u.tileID);i.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,l.texture);let c={u_matrix:e.transform.calculatePosMatrix(u.tileID.toUnwrapped()),u_terrain_coords_id:(255-n.coordsIndex.length)/255,u_texture:0,u_ele_delta:n.getMeshFrameDelta(e.transform.zoom)};d.draw(i,r.TRIANGLES,a,nr.disabled,o,no.backCCW,c,t,"terrain",s.vertexBuffer,s.indexBuffer,s.segments),n.coordsIndex.push(u.tileID.key)}i.bindFramebuffer.set(null),i.viewport.set([0,0,e.width,e.height])}(this,this.style.map.terrain))}renderLayer(e,n,i,r){if(!i.isHidden(this.transform.zoom)&&("background"===i.type||"custom"===i.type||(r||[]).length))switch(this.id=i.id,i.type){case"symbol":!function(e,n,i,r,o){if("translucent"!==e.renderPass)return;let a=nr.disabled,s=e.colorModeForRenderPass();(i._unevaluatedLayout.hasValue("text-variable-anchor")||i._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(e,n,i,r,o,a,s){let l=n.transform,c="map"===o,d="map"===a;for(let o of e){let e=r.getTile(o),a=e.getBucket(i);if(!a||!a.text||!a.text.segments.get().length)continue;let u=t.ag(a.textSizeData,l.zoom),h=eD(e,1,n.transform.zoom),m=eb(o.posMatrix,d,c,n.transform,h),f="none"!==i.layout.get("icon-text-fit")&&a.hasIconData();if(u){let i=Math.pow(2,l.zoom-e.tileID.overscaledZ);!function(e,n,i,r,o,a,s,l,c,d,u){let h=e.text.placedSymbolArray,m=e.text.dynamicLayoutVertexArray,f=e.icon.dynamicLayoutVertexArray,p={};m.clear();for(let f=0;f<h.length;f++){let g=h.get(f),b=g.hidden||!g.crossTileID||e.allowVerticalPlacement&&!g.placedOrientation?null:r[g.crossTileID];if(b){let r=new t.P(g.anchorX,g.anchorY),h=ey(r,i?s:a,u),f=ev(o.cameraToCenterDistance,h.signedDistanceFromCamera),_=t.ai(e.textSizeData,c,g)*f/t.ao;i&&(_*=e.tilePixelRatio/l);let{width:y,height:v,anchor:x,textOffset:w,textBoxScale:F}=b,k=function(e,n,i,r,o,a){let{horizontalAlign:s,verticalAlign:l}=t.at(e);return new t.P((-(s-.5)*n/o+r[0])*a,(-(l-.5)*i/o+r[1])*a)}(x,y,v,w,F,_),E=i?ey(r.add(k),a,u).point:h.point.add(n?k.rotate(-o.angle):k),A=e.allowVerticalPlacement&&g.placedOrientation===t.ah.vertical?Math.PI/2:0;for(let e=0;e<g.numGlyphs;e++)t.aj(m,E,A);d&&g.associatedIconIndex>=0&&(p[g.associatedIconIndex]={shiftedAnchor:E,angle:A})}else eS(g.numGlyphs,m)}if(d){f.clear();let n=e.icon.placedSymbolArray;for(let e=0;e<n.length;e++){let i=n.get(e);if(i.hidden)eS(i.numGlyphs,f);else{let n=p[e];if(n)for(let e=0;e<i.numGlyphs;e++)t.aj(f,n.shiftedAnchor,n.angle);else eS(i.numGlyphs,f)}}e.icon.dynamicLayoutVertexBuffer.updateData(f)}e.text.dynamicLayoutVertexBuffer.updateData(m)}(a,c,d,s,l,m,o.posMatrix,i,u,f,n.style.map.terrain?(e,t)=>n.style.map.terrain.getElevation(o,e,t):null)}}}(r,e,i,n,i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),o),0!==i.paint.get("icon-opacity").constantOr(1)&&nl(e,n,i,r,!1,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),i.layout.get("icon-rotation-alignment"),i.layout.get("icon-pitch-alignment"),i.layout.get("icon-keep-upright"),a,s),0!==i.paint.get("text-opacity").constantOr(1)&&nl(e,n,i,r,!0,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.layout.get("text-keep-upright"),a,s),n.map.showCollisionBoxes&&(na(e,n,i,r,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),!0),na(e,n,i,r,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),!1))}(e,n,i,r,this.style.placement.variableOffsets);break;case"circle":!function(e,n,i,r){if("translucent"!==e.renderPass)return;let o=i.paint.get("circle-opacity"),a=i.paint.get("circle-stroke-width"),s=i.paint.get("circle-stroke-opacity"),l=!i.layout.get("circle-sort-key").isConstant();if(0===o.constantOr(1)&&(0===a.constantOr(1)||0===s.constantOr(1)))return;let c=e.context,d=c.gl,u=e.depthModeForSublayer(0,ni.ReadOnly),h=nr.disabled,m=e.colorModeForRenderPass(),f=[];for(let o=0;o<r.length;o++){let a=r[o],s=n.getTile(a),c=s.getBucket(i);if(!c)continue;let d=c.programConfigurations.get(i.id),u=e.useProgram("circle",d),h=c.layoutVertexBuffer,m=c.indexBuffer,p=e.style.map.terrain&&e.style.map.terrain.getTerrainData(a),g={programConfiguration:d,program:u,layoutVertexBuffer:h,indexBuffer:m,uniformValues:to(e,a,s,i),terrainData:p};if(l)for(let e of c.segments.get())f.push({segments:new t.$([e]),sortKey:e.sortKey,state:g});else f.push({segments:c.segments,sortKey:0,state:g})}for(let t of(l&&f.sort((e,t)=>e.sortKey-t.sortKey),f)){let{programConfiguration:n,program:r,layoutVertexBuffer:o,indexBuffer:a,uniformValues:s,terrainData:l}=t.state;r.draw(c,d.TRIANGLES,u,h,m,no.disabled,s,l,i.id,o,a,t.segments,i.paint,e.transform.zoom,n)}}(e,n,i,r);break;case"heatmap":!function(e,n,i,r){if(0!==i.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){let o=e.context,a=o.gl,s=nr.disabled,l=new nt([a.ONE,a.ONE],t.aO.transparent,[!0,!0,!0,!0]);!function(e,t,n){let i=e.gl;e.activeTexture.set(i.TEXTURE1),e.viewport.set([0,0,t.width/4,t.height/4]);let r=n.heatmapFbo;if(r)i.bindTexture(i.TEXTURE_2D,r.colorAttachment.get()),e.bindFramebuffer.set(r.framebuffer);else{let o=i.createTexture();i.bindTexture(i.TEXTURE_2D,o),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),r=n.heatmapFbo=e.createFramebuffer(t.width/4,t.height/4,!1,!1),function(e,t,n,i){var r,o;let a=e.gl,s=null!=(r=e.HALF_FLOAT)?r:a.UNSIGNED_BYTE,l=null!=(o=e.RGBA16F)?o:a.RGBA;a.texImage2D(a.TEXTURE_2D,0,l,t.width/4,t.height/4,0,a.RGBA,s,null),i.colorAttachment.set(n)}(e,t,o,r)}}(o,e,i),o.clear({color:t.aO.transparent});for(let t=0;t<r.length;t++){let c=r[t];if(n.hasRenderableParent(c))continue;let d=n.getTile(c),u=d.getBucket(i);if(!u)continue;let h=u.programConfigurations.get(i.id),m=e.useProgram("heatmap",h),{zoom:f}=e.transform;m.draw(o,a.TRIANGLES,ni.disabled,s,l,no.disabled,tc(c.posMatrix,d,f,i.paint.get("heatmap-intensity")),null,i.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,i.paint,e.transform.zoom,h)}o.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,n){let i=e.context,r=i.gl,o=n.heatmapFbo;if(!o)return;i.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,o.colorAttachment.get()),i.activeTexture.set(r.TEXTURE1);let a=n.colorRampTexture;a||(a=n.colorRampTexture=new S(i,n.colorRamp,r.RGBA)),a.bind(r.LINEAR,r.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(i,r.TRIANGLES,ni.disabled,nr.disabled,e.colorModeForRenderPass(),no.disabled,((e,n,i,r)=>{let o=t.F();t.aN(o,0,e.width,e.height,0,0,1);let a=e.context.gl;return{u_matrix:o,u_world:[a.drawingBufferWidth,a.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:n.paint.get("heatmap-opacity")}})(e,n),null,n.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,n.paint,e.transform.zoom)}(e,i))}(e,n,i,r);break;case"line":!function(e,n,i,r){if("translucent"!==e.renderPass)return;let o=i.paint.get("line-opacity"),a=i.paint.get("line-width");if(0===o.constantOr(1)||0===a.constantOr(1))return;let s=e.depthModeForSublayer(0,ni.ReadOnly),l=e.colorModeForRenderPass(),c=i.paint.get("line-dasharray"),d=i.paint.get("line-pattern"),u=d.constantOr(1),h=i.paint.get("line-gradient"),m=i.getCrossfadeParameters(),f=u?"linePattern":c?"lineSDF":h?"lineGradient":"line",p=e.context,g=p.gl,b=!0;for(let o of r){let r=n.getTile(o);if(u&&!r.patternsLoaded())continue;let a=r.getBucket(i);if(!a)continue;let _=a.programConfigurations.get(i.id),y=e.context.program.get(),v=e.useProgram(f,_),x=b||v.program!==y,w=e.style.map.terrain&&e.style.map.terrain.getTerrainData(o),F=d.constantOr(null);if(F&&r.imageAtlas){let e=r.imageAtlas,t=e.patternPositions[F.to.toString()],n=e.patternPositions[F.from.toString()];t&&n&&_.setConstantPatternPositions(t,n)}let k=w?o:null,E=u?th(e,r,i,m,k):c?tm(e,r,i,c,m,k):h?tu(e,r,i,a.lineClipsArray.length,k):td(e,r,i,k);if(u)p.activeTexture.set(g.TEXTURE0),r.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),_.updatePaintBuffers(m);else if(c&&(x||e.lineAtlas.dirty))p.activeTexture.set(g.TEXTURE0),e.lineAtlas.bind(p);else if(h){let r=a.gradients[i.id],s=r.texture;if(i.gradientVersion!==r.version){let l=256;if(i.stepInterpolant){let i=n.getSource().maxzoom,r=o.canonical.z===i?Math.ceil(1<<e.transform.maxZoom-o.canonical.z):1;l=t.ac(t.aT(a.maxLineLength/t.W*1024*r),256,p.maxTextureSize)}r.gradient=t.aU({expression:i.gradientExpression(),evaluationKey:"lineProgress",resolution:l,image:r.gradient||void 0,clips:a.lineClipsArray}),r.texture?r.texture.update(r.gradient):r.texture=new S(p,r.gradient,g.RGBA),r.version=i.gradientVersion,s=r.texture}p.activeTexture.set(g.TEXTURE0),s.bind(i.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}v.draw(p,g.TRIANGLES,s,e.stencilModeForClipping(o),l,no.disabled,E,w,i.id,a.layoutVertexBuffer,a.indexBuffer,a.segments,i.paint,e.transform.zoom,_,a.layoutVertexBuffer2),b=!1}}(e,n,i,r);break;case"fill":!function(e,n,i,r){let o=i.paint.get("fill-color"),a=i.paint.get("fill-opacity");if(0===a.constantOr(1))return;let s=e.colorModeForRenderPass(),l=i.paint.get("fill-pattern"),c=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===o.constantOr(t.aO.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";if(e.renderPass===c){let t=e.depthModeForSublayer(1,"opaque"===e.renderPass?ni.ReadWrite:ni.ReadOnly);nu(e,n,i,r,t,s,!1)}if("translucent"===e.renderPass&&i.paint.get("fill-antialias")){let t=e.depthModeForSublayer(2*!!i.getPaintProperty("fill-outline-color"),ni.ReadOnly);nu(e,n,i,r,t,s,!0)}}(e,n,i,r);break;case"fill-extrusion":let o=i.paint.get("fill-extrusion-opacity");if(0!==o&&"translucent"===e.renderPass){let t=new ni(e.context.gl.LEQUAL,ni.ReadWrite,e.depthRangeFor3D);if(1!==o||i.paint.get("fill-extrusion-pattern").constantOr(1))nh(e,n,i,r,t,nr.disabled,nt.disabled),nh(e,n,i,r,t,e.stencilModeFor3D(),e.colorModeForRenderPass());else{let o=e.colorModeForRenderPass();nh(e,n,i,r,t,nr.disabled,o)}}break;case"hillshade":!function(e,n,i,r){if("offscreen"!==e.renderPass&&"translucent"!==e.renderPass)return;let o=e.context,a=e.depthModeForSublayer(0,ni.ReadOnly),s=e.colorModeForRenderPass(),[l,c]="translucent"===e.renderPass?e.stencilConfigForOverlap(r):[{},r];for(let r of c){let o=n.getTile(r);void 0!==o.needsHillshadePrepare&&o.needsHillshadePrepare&&"offscreen"===e.renderPass?function(e,n,i,r,o,a){let s=e.context,l=s.gl,c=n.dem;if(c&&c.data){let d=c.dim,u=c.stride,h=c.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||e.getTileTexture(u),n.demTexture){let e=n.demTexture;e.update(h,{premultiply:!1}),e.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else n.demTexture=new S(s,h,l.RGBA,{premultiply:!1}),n.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);let m=n.fbo;if(!m){let e=new S(s,{width:d,height:d,data:null},l.RGBA);e.bind(l.LINEAR,l.CLAMP_TO_EDGE),(m=n.fbo=s.createFramebuffer(d,d,!0,!1)).colorAttachment.set(e.texture)}s.bindFramebuffer.set(m.framebuffer),s.viewport.set([0,0,d,d]),e.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,r,o,a,no.disabled,((e,n)=>{let i=n.stride,r=t.F();return t.aN(r,0,t.W,-t.W,0,0,1),t.H(r,r,[0,-t.W,0]),{u_matrix:r,u_image:1,u_dimension:[i,i],u_zoom:e.overscaledZ,u_unpack:n.getUnpackVector()}})(n.tileID,c),null,i.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),n.needsHillshadePrepare=!1}}(e,o,i,a,nr.disabled,s):"translucent"===e.renderPass&&function(e,n,i,r,o,a,s){let l=e.context,c=l.gl,d=i.fbo;if(!d)return;let u=e.useProgram("hillshade"),h=e.style.map.terrain&&e.style.map.terrain.getTerrainData(n);l.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,d.colorAttachment.get()),u.draw(l,c.TRIANGLES,o,a,s,no.disabled,((e,n,i,r)=>{let o=i.paint.get("hillshade-shadow-color"),a=i.paint.get("hillshade-highlight-color"),s=i.paint.get("hillshade-accent-color"),l=i.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===i.paint.get("hillshade-illumination-anchor")&&(l-=e.transform.angle);let c=!e.options.moving;return{u_matrix:r?r.posMatrix:e.transform.calculatePosMatrix(n.tileID.toUnwrapped(),c),u_image:0,u_latrange:function(e,n){let i=Math.pow(2,n.canonical.z),r=n.canonical.y;return[new t.Y(0,r/i).toLngLat().lat,new t.Y(0,(r+1)/i).toLngLat().lat]}(0,n.tileID),u_light:[i.paint.get("hillshade-exaggeration"),l],u_shadow:o,u_highlight:a,u_accent:s}})(e,i,r,h?n:null),h,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}(e,r,o,i,a,l[r.overscaledZ],s)}o.viewport.set([0,0,e.width,e.height])}(e,n,i,r);break;case"raster":!function(e,n,i,r){if("translucent"!==e.renderPass||0===i.paint.get("raster-opacity")||!r.length)return;let o=e.context,a=o.gl,s=n.getSource(),l=e.useProgram("raster"),c=e.colorModeForRenderPass(),[d,h]=s instanceof Q?[{},r]:e.stencilConfigForOverlap(r),m=h[h.length-1].overscaledZ,f=!e.options.moving;for(let r of h){let h,p,g=e.depthModeForSublayer(r.overscaledZ-m,1===i.paint.get("raster-opacity")?ni.ReadWrite:ni.ReadOnly,a.LESS),b=n.getTile(r);b.registerFadeDuration(i.paint.get("raster-fade-duration"));let _=n.findLoadedParent(r,0),y=function(e,n,i,r,o,a){let s=r.paint.get("raster-fade-duration");if(!a&&s>0){let r=u.now(),a=(r-e.timeAdded)/s,l=n?(r-n.timeAdded)/s:-1,c=i.getSource(),d=o.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!n||Math.abs(n.tileID.overscaledZ-d)>Math.abs(e.tileID.overscaledZ-d),m=h&&e.refreshedUponExpiration?1:t.ac(h?a:1-l,0,1);return e.refreshedUponExpiration&&a>=1&&(e.refreshedUponExpiration=!1),n?{opacity:1,mix:1-m}:{opacity:m,mix:0}}return{opacity:1,mix:0}}(b,_,n,i,e.transform,e.style.map.terrain),v="nearest"===i.paint.get("raster-resampling")?a.NEAREST:a.LINEAR;o.activeTexture.set(a.TEXTURE0),b.texture.bind(v,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),o.activeTexture.set(a.TEXTURE1),_?(_.texture.bind(v,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),h=Math.pow(2,_.tileID.overscaledZ-b.tileID.overscaledZ),p=[b.tileID.canonical.x*h%1,b.tileID.canonical.y*h%1]):b.texture.bind(v,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST);let x=e.style.map.terrain&&e.style.map.terrain.getTerrainData(r),w=x?r:null,F=tg(w?w.posMatrix:e.transform.calculatePosMatrix(r.toUnwrapped(),f),p||[0,0],h||1,y,i);s instanceof Q?l.draw(o,a.TRIANGLES,g,nr.disabled,c,no.disabled,F,x,i.id,s.boundsBuffer,e.quadTriangleIndexBuffer,s.boundsSegments):l.draw(o,a.TRIANGLES,g,d[r.overscaledZ],c,no.disabled,F,x,i.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}(e,n,i,r);break;case"background":!function(e,t,n,i){let r=n.paint.get("background-color"),o=n.paint.get("background-opacity");if(0===o)return;let a=e.context,s=a.gl,l=e.transform,c=l.tileSize,d=n.paint.get("background-pattern");if(e.isPatternMissing(d))return;let u=!d&&1===r.a&&1===o&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass!==u)return;let h=nr.disabled,m=e.depthModeForSublayer(0,"opaque"===u?ni.ReadWrite:ni.ReadOnly),f=e.colorModeForRenderPass(),p=e.useProgram(d?"backgroundPattern":"background"),g=i||l.coveringTiles({tileSize:c,terrain:e.style.map.terrain});d&&(a.activeTexture.set(s.TEXTURE0),e.imageManager.bind(e.context));let b=n.getCrossfadeParameters();for(let t of g){let l=i?t.posMatrix:e.transform.calculatePosMatrix(t.toUnwrapped()),u=d?tx(l,o,e,d,{tileID:t,tileSize:c},b):tv(l,o,r),g=e.style.map.terrain&&e.style.map.terrain.getTerrainData(t);p.draw(a,s.TRIANGLES,m,h,f,no.disabled,u,g,n.id,e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments)}}(e,0,i,r);break;case"custom":let a=e.context,s=i.implementation;if("offscreen"===e.renderPass){let t=s.prerender;t&&(e.setCustomLayerDefaults(),a.setColorMode(e.colorModeForRenderPass()),t.call(s,a.gl,e.transform.customLayerMatrix()),a.setDirty(),e.setBaseState())}else if("translucent"===e.renderPass){e.setCustomLayerDefaults(),a.setColorMode(e.colorModeForRenderPass()),a.setStencilMode(nr.disabled);let t="3d"===s.renderingMode?new ni(e.context.gl.LEQUAL,ni.ReadWrite,e.depthRangeFor3D):e.depthModeForSublayer(0,ni.ReadOnly);a.setDepthMode(t),s.render(a.gl,e.transform.customLayerMatrix()),a.setDirty(),e.setBaseState(),a.bindFramebuffer.set(null)}}}translatePosMatrix(e,n,i,r,o){if(!i[0]&&!i[1])return e;let a=o?"map"===r?this.transform.angle:0:"viewport"===r?-this.transform.angle:0;if(a){let e=Math.sin(a),t=Math.cos(a);i=[i[0]*t-i[1]*e,i[0]*e+i[1]*t]}let s=[o?i[0]:eD(n,i[0],this.transform.zoom),o?i[1]:eD(n,i[1],this.transform.zoom),0],l=new Float32Array(16);return t.H(l,e,s),l}saveTileTexture(e){let t=this._tileTextures[e.size[0]];t?t.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){let t=this._tileTextures[e];return t&&t.length>0?t.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;let t=this.imageManager.getPattern(e.from.toString()),n=this.imageManager.getPattern(e.to.toString());return!t||!n}useProgram(e,t){this.cache=this.cache||{};let n=e+(t?t.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[n]||(this.cache[n]=new e8(this.context,e5[e],t,tw[e],this._showOverdrawInspector,this.style.map.terrain)),this.cache[n]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new S(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:e,drawingBufferHeight:t}=this.context.gl;return this.width!==e||this.height!==t}}class nF{constructor(e,t){this.points=e,this.planes=t}static fromInvProjectionMatrix(e,n,i){let r=Math.pow(2,i),o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(i=>{let o=1/(i=t.af([],i,e))[3]/n*r;return t.a$(i,i,[o,o,1/i[3],o])}),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(e=>{var t,n,i,r,a,s,l,c,d,u,h,m,f,p,g,b;let _=(h=[],f=(n=[],i=A([],o[e[0]],o[e[1]]),r=A([],o[e[2]],o[e[1]]),a=i[0],s=i[1],l=i[2],c=r[0],d=r[1],u=r[2],n[0]=s*u-l*d,n[1]=l*c-a*u,n[2]=a*d-s*c,m=n)[0],(b=f*f+(p=m[1])*p+(g=m[2])*g)>0&&(b=1/Math.sqrt(b)),h[0]=m[0]*b,h[1]=m[1]*b,h[2]=m[2]*b,h),y=-(_[0]*(t=o[e[1]])[0]+_[1]*t[1]+_[2]*t[2]);return _.concat(y)});return new nF(o,a)}}class nk{constructor(e,t){this.min=e,this.max=t,this.center=function(e,t,n){return e[0]=.5*t[0],e[1]=.5*t[1],e[2]=.5*t[2],e}([],function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}([],this.min,this.max))}quadrant(e){let t=[e%2==0,e<2],n=x(this.min),i=x(this.max);for(let e=0;e<t.length;e++)n[e]=t[e]?this.min[e]:this.center[e],i[e]=t[e]?this.center[e]:this.max[e];return i[2]=this.max[2],new nk(n,i)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}intersects(e){let n=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]],i=!0;for(let r=0;r<e.planes.length;r++){let o=e.planes[r],a=0;for(let e=0;e<n.length;e++)t.b0(o,n[e])>=0&&a++;if(0===a)return 0;a!==n.length&&(i=!1)}if(i)return 2;for(let t=0;t<3;t++){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE;for(let r=0;r<e.points.length;r++){let o=e.points[r][t]-this.min[t];n=Math.min(n,o),i=Math.max(i,o)}if(i<0||n>this.max[t]-this.min[t])return 0}return 1}}class nE{constructor(e=0,t=0,n=0,i=0){if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(n)||n<0||isNaN(i)||i<0)throw Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=n,this.right=i}interpolate(e,n,i){return null!=n.top&&null!=e.top&&(this.top=t.z.number(e.top,n.top,i)),null!=n.bottom&&null!=e.bottom&&(this.bottom=t.z.number(e.bottom,n.bottom,i)),null!=n.left&&null!=e.left&&(this.left=t.z.number(e.left,n.left,i)),null!=n.right&&null!=e.right&&(this.right=t.z.number(e.right,n.right,i)),this}getCenter(e,n){let i=t.ac((this.left+e-this.right)/2,0,e),r=t.ac((this.top+n-this.bottom)/2,0,n);return new t.P(i,r)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new nE(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class nA{constructor(e,n,i,r,o){this.tileSize=512,this._renderWorldCopies=void 0===o||!!o,this._minZoom=e||0,this._maxZoom=n||22,this._minPitch=null==i?0:i,this._maxPitch=null==r?60:r,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.M(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new nE,this._posMatrixCache={},this._alignedPosMatrixCache={},this.minElevationForCurrentTile=0}clone(){let e=new nA(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.apply(this),e}apply(e){this.tileSize=e.tileSize,this.latRange=e.latRange,this.width=e.width,this.height=e.height,this._center=e._center,this._elevation=e._elevation,this.minElevationForCurrentTile=e.minElevationForCurrentTile,this.zoom=e.zoom,this.angle=e.angle,this._fov=e._fov,this._pitch=e._pitch,this._unmodified=e._unmodified,this._edgeInsets=e._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new t.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(e){var n,i,r,o,a,s,l,c,d,u;let h=-t.b1(e,-180,180)*Math.PI/180;this.angle!==h&&(this._unmodified=!1,this.angle=h,this._calcMatrices(),this.rotationMatrix=(n=new t.A(4),t.A!=Float32Array&&(n[1]=0,n[2]=0),n[0]=1,n[3]=1,n),i=this.rotationMatrix,r=this.rotationMatrix,o=this.angle,a=r[0],s=r[1],l=r[2],c=r[3],d=Math.sin(o),u=Math.cos(o),i[0]=a*u+l*d,i[1]=s*u+c*d,i[2]=-(a*d)+l*u,i[3]=-(s*d)+c*u)}get pitch(){return this._pitch/Math.PI*180}set pitch(e){let n=t.ac(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(e){let t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.tileZoom=Math.max(0,Math.floor(t)),this.scale=this.zoomScale(t),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,n){this._unmodified=!1,this._edgeInsets.interpolate(e,t,n),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){return Math.max(0,(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize)))}getVisibleUnwrappedCoordinates(e){let n=[new t.b2(0,e)];if(this._renderWorldCopies){let i=this.pointCoordinate(new t.P(0,0)),r=this.pointCoordinate(new t.P(this.width,0)),o=this.pointCoordinate(new t.P(this.width,this.height)),a=this.pointCoordinate(new t.P(0,this.height)),s=Math.floor(Math.min(i.x,r.x,o.x,a.x)),l=Math.floor(Math.max(i.x,r.x,o.x,a.x));for(let i=s-1;i<=l+1;i++)0!==i&&n.push(new t.b2(i,e))}return n}coveringTiles(e){var n,i;let r=this.coveringZoomLevel(e),o=r;if(void 0!==e.minzoom&&r<e.minzoom)return[];void 0!==e.maxzoom&&r>e.maxzoom&&(r=e.maxzoom);let a=this.pointCoordinate(this.getCameraPoint()),s=t.Y.fromLngLat(this.center),l=Math.pow(2,r),c=[l*a.x,l*a.y,0],d=[l*s.x,l*s.y,0],u=nF.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),h=e.minzoom||0;!e.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(h=r);let m=e.terrain?2/Math.min(this.tileSize,e.tileSize)*this.tileSize:3,f=e=>({aabb:new nk([e*l,0,0],[(e+1)*l,l,0]),zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}),p=[],g=[],b=r,_=e.reparseOverscaled?o:r;if(this._renderWorldCopies)for(let e=1;e<=3;e++)p.push(f(-e)),p.push(f(e));for(p.push(f(0));p.length>0;){let r=p.pop(),o=r.x,a=r.y,s=r.fullyVisible;if(!s){let e=r.aabb.intersects(u);if(0===e)continue;s=2===e}let l=e.terrain?c:d,f=Math.max(Math.abs(r.aabb.distanceX(l)),Math.abs(r.aabb.distanceY(l)));if(r.zoom===b||f>m+(1<<b-r.zoom)-2&&r.zoom>=h){let e=b-r.zoom,n=c[0]-.5-(o<<e),i=c[1]-.5-(a<<e);g.push({tileID:new t.Q(r.zoom===b?_:r.zoom,r.wrap,r.zoom,o,a),distanceSq:C([d[0]-.5-o,d[1]-.5-a]),tileDistanceToCamera:Math.sqrt(n*n+i*i)})}else for(let l=0;l<4;l++){let c=(o<<1)+l%2,d=(a<<1)+(l>>1),u=r.zoom+1,h=r.aabb.quadrant(l);if(e.terrain){let o=new t.Q(u,r.wrap,u,c,d),a=e.terrain.getMinMaxElevation(o),s=null!=(n=a.minElevation)?n:this.elevation,l=null!=(i=a.maxElevation)?i:this.elevation;h=new nk([h.min[0],h.min[1],s],[h.max[0],h.max[1],l])}p.push({aabb:h,zoom:u,x:c,y:d,wrap:r.wrap,fullyVisible:s})}}return g.sort((e,t)=>e.distanceSq-t.distanceSq).map(e=>e.tileID)}resize(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(e){let n=t.ac(e.lat,-85.051129,85.051129);return new t.P(t.N(e.lng)*this.worldSize,t.O(n)*this.worldSize)}unproject(e){return new t.Y(e.x/this.worldSize,e.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(e){let n=this.elevation,i=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,r=this.pointLocation(this.centerPoint,e),o=e.getElevationForLngLatZoom(r,this.tileZoom);if(!(this.elevation-o))return;let a=Math.cos(this._pitch)*this.cameraToCenterDistance/(i+n-o)/t.b3(1,r.lat),s=this.scaleZoom(a/this.tileSize);this._elevation=o,this._center=r,this.zoom=s}setLocationAtPoint(e,n){let i=this.pointCoordinate(n),r=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(e),a=new t.Y(o.x-(i.x-r.x),o.y-(i.y-r.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(e,t){return t?this.coordinatePoint(this.locationCoordinate(e),t.getElevationForLngLatZoom(e,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(e))}pointLocation(e,t){return this.coordinateLocation(this.pointCoordinate(e,t))}locationCoordinate(e){return t.Y.fromLngLat(e)}coordinateLocation(e){return e&&e.toLngLat()}pointCoordinate(e,n){if(n){let t=n.pointCoordinate(e);if(null!=t)return t}let i=[e.x,e.y,0,1],r=[e.x,e.y,1,1];t.af(i,i,this.pixelMatrixInverse),t.af(r,r,this.pixelMatrixInverse);let o=i[3],a=r[3],s=i[1]/o,l=r[1]/a,c=i[2]/o,d=r[2]/a,u=c===d?0:(0-c)/(d-c);return new t.Y(t.z.number(i[0]/o,r[0]/a,u)/this.worldSize,t.z.number(s,l,u)/this.worldSize)}coordinatePoint(e,n=0,i=this.pixelMatrix){let r=[e.x*this.worldSize,e.y*this.worldSize,n,1];return t.af(r,r,i),new t.P(r[0]/r[3],r[1]/r[3])}getBounds(){let e=Math.max(0,this.height/2-this.getHorizon());return(new W).extend(this.pointLocation(new t.P(0,e))).extend(this.pointLocation(new t.P(this.width,e))).extend(this.pointLocation(new t.P(this.width,this.height))).extend(this.pointLocation(new t.P(0,this.height)))}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new W([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,85.051129])}calculatePosMatrix(e,n=!1){let i=e.key,r=n?this._alignedPosMatrixCache:this._posMatrixCache;if(r[i])return r[i];let o=e.canonical,a=this.worldSize/this.zoomScale(o.z),s=o.x+Math.pow(2,o.z)*e.wrap,l=t.an(new Float64Array(16));return t.H(l,l,[s*a,o.y*a,0]),t.J(l,l,[a/t.W,a/t.W,1]),t.K(l,n?this.alignedProjMatrix:this.projMatrix,l),r[i]=new Float32Array(l),r[i]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(e,n){let i,r;n=t.ac(+n,this.minZoom,this.maxZoom);let o={center:new t.M(e.lng,e.lat),zoom:n},a=this.lngRange;this._renderWorldCopies||null!==a||(a=[-(180-1e-10),180-1e-10]);let s=this.tileSize*this.zoomScale(o.zoom),l=0,c=s,d=0,u=s,h=0,m=0,{x:f,y:p}=this.size;if(this.latRange){let e=this.latRange;l=t.O(e[1])*s,(c=t.O(e[0])*s)-l<p&&(h=p/(c-l))}a&&(d=t.b1(t.N(a[0])*s,0,s),(u=t.b1(t.N(a[1])*s,0,s))<d&&(u+=s),u-d<f&&(m=f/(u-d)));let{x:g,y:b}=this.project.call({worldSize:s},e),_=Math.max(m||0,h||0);if(_){let e=new t.P(m?(u+d)/2:g,h?(c+l)/2:b);return o.center=this.unproject.call({worldSize:s},e).wrap(),o.zoom+=this.scaleZoom(_),o}if(this.latRange){let e=p/2;b-e<l&&(r=l+e),b+e>c&&(r=c-e)}if(a){let e=(d+u)/2,n=g;this._renderWorldCopies&&(n=t.b1(g,e-s/2,e+s/2));let r=f/2;n-r<d&&(i=d+r),n+r>u&&(i=u-r)}if(void 0!==i||void 0!==r){let e=new t.P(null!=i?i:g,null!=r?r:b);o.center=this.unproject.call({worldSize:s},e).wrap()}return o}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let e=this._unmodified,{center:t,zoom:n}=this.getConstrained(this.center,this.zoom);this.center=t,this.zoom=n,this._unmodified=e,this._constraining=!1}_calcMatrices(){if(!this.height)return;let e=this.centerOffset,n=this.point.x,i=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=t.b3(1,this.center.lat)*this.worldSize;let r=t.an(new Float64Array(16));t.J(r,r,[this.width/2,-this.height/2,1]),t.H(r,r,[1,-1,0]),this.labelPlaneMatrix=r,r=t.an(new Float64Array(16)),t.J(r,r,[1,-1,1]),t.H(r,r,[-1,-1,0]),t.J(r,r,[2/this.width,2/this.height,1]),this.glCoordMatrix=r;let o=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),a=Math.min(this.elevation,this.minElevationForCurrentTile),s=o-a*this._pixelPerMeter/Math.cos(this._pitch),l=a<0?s:o,c=Math.PI/2+this._pitch,d=this._fov*(.5+e.y/this.height),u=Math.sin(d)*l/Math.sin(t.ac(Math.PI-c-d,.01,Math.PI-.01)),h=this.getHorizon(),m=2*Math.atan(h/this.cameraToCenterDistance)*(.5+e.y/(2*h)),f=Math.min(u,Math.sin(m)*l/Math.sin(t.ac(Math.PI-c-m,.01,Math.PI-.01))),p=1.01*(Math.cos(Math.PI/2-this._pitch)*f+l),g=this.height/50;r=new Float64Array(16),t.b4(r,this._fov,this.width/this.height,g,p),r[8]=-(2*e.x)/this.width,r[9]=2*e.y/this.height,t.J(r,r,[1,-1,1]),t.H(r,r,[0,0,-this.cameraToCenterDistance]),t.b5(r,r,this._pitch),t.ad(r,r,this.angle),t.H(r,r,[-n,-i,0]),this.mercatorMatrix=t.J([],r,[this.worldSize,this.worldSize,this.worldSize]),t.J(r,r,[1,1,this._pixelPerMeter]),this.pixelMatrix=t.K(new Float64Array(16),this.labelPlaneMatrix,r),t.H(r,r,[0,0,-this.elevation]),this.projMatrix=r,this.invProjMatrix=t.ar([],r),this.pixelMatrix3D=t.K(new Float64Array(16),this.labelPlaneMatrix,r);let b=this.width%2/2,_=this.height%2/2,y=Math.cos(this.angle),v=Math.sin(this.angle),x=n-Math.round(n)+y*b+v*_,w=i-Math.round(i)+y*_+v*b,F=new Float64Array(r);if(t.H(F,F,[x>.5?x-1:x,w>.5?w-1:w,0]),this.alignedProjMatrix=F,!(r=t.ar(new Float64Array(16),this.pixelMatrix)))throw Error("failed to invert matrix");this.pixelMatrixInverse=r,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let e=this.pointCoordinate(new t.P(0,0)),n=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.af(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.P(0,e))}getCameraQueryGeometry(e){let n=this.getCameraPoint();if(1===e.length)return[e[0],n];{let i=n.x,r=n.y,o=n.x,a=n.y;for(let t of e)i=Math.min(i,t.x),r=Math.min(r,t.y),o=Math.max(o,t.x),a=Math.max(a,t.y);return[new t.P(i,r),new t.P(o,r),new t.P(o,a),new t.P(i,a),new t.P(i,r)]}}lngLatToCameraDepth(e,n){let i=this.locationCoordinate(e),r=[i.x*this.worldSize,i.y*this.worldSize,n,1];return t.af(r,r,this.projMatrix),r[2]/r[3]}}function nC(e,t){let n,i=!1,r=null,o=null,a=()=>{r=null,i&&(e.apply(o,n),r=setTimeout(a,t),i=!1)};return(...e)=>(i=!0,o=this,n=e,r||a(),r)}class nT{constructor(e){this._getCurrentHash=()=>{let e=window.location.hash.replace("#","");if(this._hashName){let t;return e.split("&").map(e=>e.split("=")).forEach(e=>{e[0]===this._hashName&&(t=e)}),(t&&t[1]||"").split("/")}return e.split("/")},this._onHashChange=()=>{let e=this._getCurrentHash();if(e.length>=3&&!e.some(e=>isNaN(e))){let t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let e=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,e)}catch(e){}},this._updateHash=nC(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(e){let t=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,i=Math.pow(10,Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10)),r=Math.round(t.lng*i)/i,o=Math.round(t.lat*i)/i,a=this._map.getBearing(),s=this._map.getPitch(),l="";if(l+=e?`/${r}/${o}/${n}`:`${n}/${o}/${r}`,(a||s)&&(l+="/"+Math.round(10*a)/10),s&&(l+=`/${Math.round(s)}`),this._hashName){let e=this._hashName,t=!1,n=window.location.hash.slice(1).split("&").map(n=>{let i=n.split("=")[0];return i===e?(t=!0,`${i}=${l}`):n}).filter(e=>e);return t||n.push(`${e}=${l}`),`#${n.join("&")}`}return`#${l}`}}let nS={linearity:.3,easing:t.b6(0,0,.3,1)},nM=t.e({deceleration:2500,maxSpeed:1400},nS),nL=t.e({deceleration:20,maxSpeed:1400},nS),nD=t.e({deceleration:1e3,maxSpeed:360},nS),nI=t.e({deceleration:1e3,maxSpeed:90},nS);class nR{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:u.now(),settings:e})}_drainInertiaBuffer(){let e=this._inertiaBuffer,t=u.now();for(;e.length>0&&t-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let n={zoom:0,bearing:0,pitch:0,pan:new t.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:e}of this._inertiaBuffer)n.zoom+=e.zoomDelta||0,n.bearing+=e.bearingDelta||0,n.pitch+=e.pitchDelta||0,e.panDelta&&n.pan._add(e.panDelta),e.around&&(n.around=e.around),e.pinchAround&&(n.pinchAround=e.pinchAround);let i=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,r={};if(n.pan.mag()){let o=nP(n.pan.mag(),i,t.e({},nM,e||{}));r.offset=n.pan.mult(o.amount/n.pan.mag()),r.center=this._map.transform.center,nO(r,o)}if(n.zoom){let e=nP(n.zoom,i,nL);r.zoom=this._map.transform.zoom+e.amount,nO(r,e)}if(n.bearing){let e=nP(n.bearing,i,nD);r.bearing=this._map.transform.bearing+t.ac(e.amount,-179,179),nO(r,e)}if(n.pitch){let e=nP(n.pitch,i,nI);r.pitch=this._map.transform.pitch+e.amount,nO(r,e)}if(r.zoom||r.bearing){let e=void 0===n.pinchAround?n.around:n.pinchAround;r.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),t.e(r,{noMoveStart:!0})}}function nO(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function nP(e,n,i){let{maxSpeed:r,linearity:o,deceleration:a}=i,s=t.ac(e*o/(n/1e3),-r,r),l=Math.abs(s)/(a*o);return{easing:i.easing,duration:1e3*l,amount:l/2*s}}class n$ extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,n,i,r={}){let o=h.mousePos(n.getCanvas(),i);super(e,t.e({point:o,lngLat:n.unproject(o),originalEvent:i},r)),this._defaultPrevented=!1,this.target=n}}class nN extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,n,i){let r="touchend"===e?i.changedTouches:i.touches,o=h.touchPos(n.getCanvasContainer(),r),a=o.map(e=>n.unproject(e)),s=o.reduce((e,t,n,i)=>e.add(t.div(i.length)),new t.P(0,0));super(e,{points:o,point:s,lngLats:a,lngLat:n.unproject(s),originalEvent:i}),this._defaultPrevented=!1}}class nB extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,n){super(e,{originalEvent:n}),this._defaultPrevented=!1}}class nz{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new nB(e.type,this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new n$(e.type,this._map,e))}mouseup(e){this._map.fire(new n$(e.type,this._map,e))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new n$(e.type,this._map,e))}dblclick(e){return this._firePreventable(new n$(e.type,this._map,e))}mouseover(e){this._map.fire(new n$(e.type,this._map,e))}mouseout(e){this._map.fire(new n$(e.type,this._map,e))}touchstart(e){return this._firePreventable(new nN(e.type,this._map,e))}touchmove(e){this._map.fire(new nN(e.type,this._map,e))}touchend(e){this._map.fire(new nN(e.type,this._map,e))}touchcancel(e){this._map.fire(new nN(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class nj{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new n$(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new n$("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new n$(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class nY{constructor(e){this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.pointLocation(t.P.convert(e),this._map.terrain)}}class nH{constructor(e,t){this._map=e,this._tr=new nY(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(h.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active||this._lastPos.equals(t)||!this._box&&t.dist(this._startPos)<this._clickTolerance)return;let n=this._startPos;this._lastPos=t,this._box||(this._box=h.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));let i=Math.min(n.x,t.x),r=Math.max(n.x,t.x),o=Math.min(n.y,t.y),a=Math.max(n.y,t.y);h.setTransform(this._box,`translate(${i}px,${o}px)`),this._box.style.width=r-i+"px",this._box.style.height=a-o+"px"}mouseupWindow(e,n){if(!this._active||0!==e.button)return;let i=this._startPos;if(this.reset(),h.suppressClick(),i.x!==n.x||i.y!==n.y)return this._map.fire(new t.k("boxzoomend",{originalEvent:e})),{cameraAnimation:e=>e.fitScreenCoordinates(i,n,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(h.remove(this._box),this._box=null),h.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,n){return this._map.fire(new t.k(e,{originalEvent:n}))}}function nU(e,t){if(e.length!==t.length)throw Error(`The number of touches and points are not equal - touches ${e.length}, points ${t.length}`);let n={};for(let i=0;i<e.length;i++)n[e[i].identifier]=t[i];return n}class nV{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,n,i){(this.centroid||i.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),i.length===this.numTouches&&(this.centroid=function(e){let n=new t.P(0,0);for(let t of e)n._add(t);return n.div(e.length)}(n),this.touches=nU(i,n)))}touchmove(e,t,n){if(this.aborted||!this.centroid)return;let i=nU(n,t);for(let e in this.touches){let t=i[e];(!t||t.dist(this.touches[e])>30)&&(this.aborted=!0)}}touchend(e,t,n){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===n.length){let e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class nW{constructor(e){this.singleTap=new nV(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,t,n){this.singleTap.touchstart(e,t,n)}touchmove(e,t,n){this.singleTap.touchmove(e,t,n)}touchend(e,t,n){let i=this.singleTap.touchend(e,t,n);if(i){let t=e.timeStamp-this.lastTime<500,n=!this.lastTap||30>this.lastTap.dist(i);if(t&&n||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=i,this.count===this.numTaps)return this.reset(),i}}}class nG{constructor(e){this._tr=new nY(e),this._zoomIn=new nW({numTouches:1,numTaps:2}),this._zoomOut=new nW({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,n){this._zoomIn.touchstart(e,t,n),this._zoomOut.touchstart(e,t,n)}touchmove(e,t,n){this._zoomIn.touchmove(e,t,n),this._zoomOut.touchmove(e,t,n)}touchend(e,t,n){let i=this._zoomIn.touchend(e,t,n),r=this._zoomOut.touchend(e,t,n),o=this._tr;return i?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:o.zoom+1,around:o.unproject(i)},{originalEvent:e})}):r?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:o.zoom-1,around:o.unproject(r)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class nq{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){let t=this._moveFunction(...e);if(t.bearingDelta||t.pitchDelta||t.around||t.panDelta)return this._active=!0,t}dragStart(e,t){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=t.length?t[0]:t,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,t){if(!this.isEnabled())return;let n=this._lastPoint;if(!n)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);let i=t.length?t[0]:t;return!this._moved&&i.dist(n)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=i,this._move(n,i))}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&h.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}let nK={0:1,2:2};class nX{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){let t=h.mouseButton(e);this._eventButton=t}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!function(e,t){let n=nK[t];return void 0===e.buttons||(e.buttons&n)!==n}(e,this._eventButton)}isValidEndEvent(e){return h.mouseButton(e)===this._eventButton}}class nZ{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return 1===e.targetTouches.length}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){this._firstTouch=e.targetTouches[0].identifier}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}}let nJ=e=>{e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=function(e){e.preventDefault()}},nQ=({enable:e,clickTolerance:t,bearingDegreesPerPixelMoved:n=.8})=>new nq({clickTolerance:t,move:(e,t)=>({bearingDelta:(t.x-e.x)*n}),moveStateManager:new nX({checkCorrectEvent:e=>0===h.mouseButton(e)&&e.ctrlKey||2===h.mouseButton(e)}),enable:e,assignEvents:nJ}),n0=({enable:e,clickTolerance:t,pitchDegreesPerPixelMoved:n=-.5})=>new nq({clickTolerance:t,move:(e,t)=>({pitchDelta:(t.y-e.y)*n}),moveStateManager:new nX({checkCorrectEvent:e=>0===h.mouseButton(e)&&e.ctrlKey||2===h.mouseButton(e)}),enable:e,assignEvents:nJ});class n1{constructor(e,t){this._clickTolerance=e.clickTolerance||1,this._map=t,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new t.P(0,0)}minTouchs(){return this._map.cooperativeGestures.isEnabled()?2:1}touchstart(e,t,n){return this._calculateTransform(e,t,n)}touchmove(e,t,n){if(this._active&&!(n.length<this.minTouchs()))return e.preventDefault(),this._calculateTransform(e,t,n)}touchend(e,t,n){this._calculateTransform(e,t,n),this._active&&n.length<this.minTouchs()&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,n,i){i.length>0&&(this._active=!0);let r=nU(i,n),o=new t.P(0,0),a=new t.P(0,0),s=0;for(let e in r){let t=r[e],n=this._touches[e];n&&(o._add(t),a._add(t.sub(n)),s++,r[e]=t)}if(this._touches=r,s<this.minTouchs()||!a.mag())return;let l=a.div(s);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:o.div(s),panDelta:l}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class n2{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,t,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,n){if(!this._firstTwoTouches)return;e.preventDefault();let[i,r]=this._firstTwoTouches,o=n5(n,t,i),a=n5(n,t,r);if(!o||!a)return;let s=this._aroundCenter?null:o.add(a).div(2);return this._move([o,a],s,e)}touchend(e,t,n){if(!this._firstTwoTouches)return;let[i,r]=this._firstTwoTouches,o=n5(n,t,i),a=n5(n,t,r);o&&a||(this._active&&h.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function n5(e,t,n){for(let i=0;i<e.length;i++)if(e[i].identifier===n)return t[i]}function n3(e,t){return Math.log(e/t)/Math.LN2}class n4 extends n2{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){let n=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(.1>Math.abs(n3(this._distance,this._startDistance))))return this._active=!0,{zoomDelta:n3(this._distance,n),pinchAround:t}}}function n6(e,t){return 180*e.angleWith(t)/Math.PI}class n8 extends n2{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t,n){let i=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:n6(this._vector,i),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());let t=25/(Math.PI*this._minDiameter)*360;return Math.abs(n6(e,this._startVector))<t}}function n7(e){return Math.abs(e.y)>Math.abs(e.x)}class n9 extends n2{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,t,n){super.touchstart(e,t,n),this._currentTouchCount=n.length}_start(e){this._lastPoints=e,n7(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,t,n){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let i=e[0].sub(this._lastPoints[0]),r=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(i,r,n.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:-((i.y+r.y)/2*.5)}):void 0}gestureBeginsVertically(e,t,n){if(void 0!==this._valid)return this._valid;let i=e.mag()>=2,r=t.mag()>=2;if(!i&&!r)return;if(!i||!r)return void 0===this._firstMove&&(this._firstMove=n),n-this._firstMove<100&&void 0;let o=e.y>0==t.y>0;return n7(e)&&n7(t)&&o}}let ie=100,it=15,ii=10;class ir{constructor(e){this._tr=new nY(e),this._panStep=ie,this._bearingStep=it,this._pitchStep=ii,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,n=0,i=0,r=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?n=-1:(e.preventDefault(),r=-1);break;case 39:e.shiftKey?n=1:(e.preventDefault(),r=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(n=0,i=0),{cameraAnimation:a=>{let s=this._tr;a.easeTo({duration:300,easeId:"keyboardHandler",easing:io,zoom:t?Math.round(s.zoom)+t*(e.shiftKey?2:1):s.zoom,bearing:s.bearing+n*this._bearingStep,pitch:s.pitch+i*this._pitchStep,offset:[-r*this._panStep,-o*this._panStep],center:s.center},{originalEvent:e})}}}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 io(e){return e*(2-e)}class ia{constructor(e,t){this._onTimeout=e=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)},this._map=e,this._tr=new nY(e),this._triggerRenderFrame=t,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around)}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(e){if(!this.isEnabled()||this._map.cooperativeGestures.isEnabled()&&!e[this._map.cooperativeGestures._bypassKey])return;let t=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=u.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==t&&t%4.000244140625==0?this._type="wheel":0!==t&&4>Math.abs(t)?this._type="trackpad":i>400?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=200>Math.abs(i*t)?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,t+=this._lastValue)),e.shiftKey&&t&&(t/=4),this._type&&(this._lastWheelEvent=e,this._delta-=t,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let n=h.mousePos(this._map.getCanvas(),e),i=this._tr;this._around=n.y>i.transform.height/2-i.transform.getHorizon()?t.M.convert(this._aroundCenter?i.center:i.unproject(n)):t.M.convert(i.center),this._aroundPoint=i.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let e=this._tr.transform;if(0!==this._delta){let t="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,n=2/(1+Math.exp(-Math.abs(this._delta*t)));this._delta<0&&0!==n&&(n=1/n);let i="number"==typeof this._targetZoom?e.zoomScale(this._targetZoom):e.scale;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(i*n))),"wheel"===this._type&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let n="number"==typeof this._targetZoom?this._targetZoom:e.zoom,i=this._startZoom,r=this._easing,o,a=!1;if("wheel"===this._type&&i&&r){let e=Math.min((u.now()-this._lastWheelEventTime)/200,1),s=r(e);o=t.z.number(i,n,s),e<1?this._frameId||(this._frameId=!0):a=!0}else o=n,a=!0;return this._active=!0,a&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!a,zoomDelta:o-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let n=t.b7;if(this._prevEase){let e=this._prevEase,i=(u.now()-e.start)/e.duration,r=e.easing(i+.01)-e.easing(i),o=.27/Math.sqrt(r*r+1e-4)*.01,a=Math.sqrt(.0729-o*o);n=t.b6(o,a,.25,1)}return this._prevEase={start:u.now(),duration:e,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class is{constructor(e,t){this._clickZoom=e,this._tapZoom=t}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class il{constructor(e){this._tr=new nY(e),this.reset()}reset(){this._active=!1}dblclick(e,t){return e.preventDefault(),{cameraAnimation:n=>{n.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ic{constructor(){this._tap=new nW({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,t,n){if(!this._swipePoint)if(this._tapTime){let i=t[0],r=e.timeStamp-this._tapTime<500,o=30>this._tapPoint.dist(i);r&&o?n.length>0&&(this._swipePoint=i,this._swipeTouch=n[0].identifier):this.reset()}else this._tap.touchstart(e,t,n)}touchmove(e,t,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;let i=t[0],r=i.y-this._swipePoint.y;return this._swipePoint=i,e.preventDefault(),this._active=!0,{zoomDelta:r/128}}}else this._tap.touchmove(e,t,n)}touchend(e,t,n){if(this._tapTime)this._swipePoint&&0===n.length&&this.reset();else{let i=this._tap.touchend(e,t,n);i&&(this._tapTime=e.timeStamp,this._tapPoint=i)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class id{constructor(e,t,n){this._el=e,this._mousePan=t,this._touchPan=n}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class iu{constructor(e,t,n){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=n}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class ih{constructor(e,t,n,i){this._el=e,this._touchZoom=t,this._touchRotate=n,this._tapDragZoom=i,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class im{constructor(e,t){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=e,this._options=t,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=h.create("div","maplibregl-cooperative-gesture-screen",e);let t=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(t=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let n=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),i=document.createElement("div");i.className="maplibregl-desktop-message",i.textContent=t,this._container.appendChild(i);let r=document.createElement("div");r.className="maplibregl-mobile-message",r.textContent=n,this._container.appendChild(r),this._container.setAttribute("aria-hidden","true")}_destoryUI(){this._container&&(h.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destoryUI()}isEnabled(){return this._enabled}touchmove(e){this._onCooperativeGesture(1===e.touches.length)}wheel(e){this._map.scrollZoom.isEnabled()&&this._onCooperativeGesture(!e[this._bypassKey])}_onCooperativeGesture(e){this._enabled&&e&&(this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let ip=e=>e.zoom||e.drag||e.pitch||e.rotate;class ig extends t.k{}function ib(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class i_{constructor(e,t){this.handleWindowEvent=e=>{this.handleEvent(e,`${e.type}Window`)},this.handleEvent=(e,t)=>{if("blur"===e.type)return void this.stop(!0);this._updatingCamera=!0;let n="renderFrame"===e.type?void 0:e,i={needsRenderFrame:!1},r={},o={},a=e.touches,s=a?this._getMapTouches(a):void 0,l=s?h.touchPos(this._map.getCanvas(),s):h.mousePos(this._map.getCanvas(),e);for(let{handlerName:a,handler:c,allowed:d}of this._handlers){let u;c.isEnabled()&&(this._blockedByActive(o,d,a)?c.reset():c[t||e.type]&&(u=c[t||e.type](e,l,s),this.mergeHandlerResult(i,r,u,a,n),u&&u.needsRenderFrame&&this._triggerRenderFrame()),(u||c.isActive())&&(o[a]=c))}let c={};for(let e in this._previousActiveHandlers)o[e]||(c[e]=n);this._previousActiveHandlers=o,(Object.keys(c).length||ib(i))&&(this._changes.push([i,r,c]),this._triggerRenderFrame()),(Object.keys(o).length||ib(i))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:d}=i;d&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],d(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new nR(e),this._bearingSnap=t.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(t);let n=this._el;for(let[e,t,i]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],[document,"mousemove",{capture:!0}],[document,"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],[window,"blur",void 0]],this._listeners))h.addEventListener(e,t,e===document?this.handleWindowEvent:this.handleEvent,i)}destroy(){for(let[e,t,n]of this._listeners)h.removeEventListener(e,t,e===document?this.handleWindowEvent:this.handleEvent,n)}_addDefaultHandlers(e){let t=this._map,n=t.getCanvasContainer();this._add("mapEvent",new nz(t,e));let i=t.boxZoom=new nH(t,e);this._add("boxZoom",i),e.interactive&&e.boxZoom&&i.enable();let r=t.cooperativeGestures=new im(t,e.cooperativeGestures);this._add("cooperativeGestures",r),e.cooperativeGestures&&r.enable();let o=new nG(t),a=new il(t);t.doubleClickZoom=new is(a,o),this._add("tapZoom",o),this._add("clickZoom",a),e.interactive&&e.doubleClickZoom&&t.doubleClickZoom.enable();let s=new ic;this._add("tapDragZoom",s);let l=t.touchPitch=new n9(t);this._add("touchPitch",l),e.interactive&&e.touchPitch&&t.touchPitch.enable(e.touchPitch);let c=nQ(e),d=n0(e);t.dragRotate=new iu(e,c,d),this._add("mouseRotate",c,["mousePitch"]),this._add("mousePitch",d,["mouseRotate"]),e.interactive&&e.dragRotate&&t.dragRotate.enable();let u=(({enable:e,clickTolerance:t})=>new nq({clickTolerance:t,move:(e,t)=>({around:t,panDelta:t.sub(e)}),activateOnStart:!0,moveStateManager:new nX({checkCorrectEvent:e=>0===h.mouseButton(e)&&!e.ctrlKey}),enable:e,assignEvents:nJ}))(e),m=new n1(e,t);t.dragPan=new id(n,u,m),this._add("mousePan",u),this._add("touchPan",m,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&t.dragPan.enable(e.dragPan);let f=new n8,p=new n4;t.touchZoomRotate=new ih(n,p,f,s),this._add("touchRotate",f,["touchPan","touchZoom"]),this._add("touchZoom",p,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&t.touchZoomRotate.enable(e.touchZoomRotate);let g=t.scrollZoom=new ia(t,()=>this._triggerRenderFrame());this._add("scrollZoom",g,["mousePan"]),e.interactive&&e.scrollZoom&&t.scrollZoom.enable(e.scrollZoom);let b=t.keyboard=new ir(t);this._add("keyboard",b),e.interactive&&e.keyboard&&t.keyboard.enable(),this._add("blockableMapEvent",new nj(t))}_add(e,t,n){this._handlers.push({handlerName:e,handler:t,allowed:n}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(let{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(let{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!ip(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,t,n){for(let i in e)if(i!==n&&(!t||0>t.indexOf(i)))return!0;return!1}_getMapTouches(e){let t=[];for(let n of e)this._el.contains(n.target)&&t.push(n);return t}mergeHandlerResult(e,n,i,r,o){if(!i)return;t.e(e,i);let a={handlerName:r,originalEvent:i.originalEvent||o};void 0!==i.zoomDelta&&(n.zoom=a),void 0!==i.panDelta&&(n.drag=a),void 0!==i.pitchDelta&&(n.pitch=a),void 0!==i.bearingDelta&&(n.rotate=a)}_applyChanges(){let e={},n={},i={};for(let[r,o,a]of this._changes)r.panDelta&&(e.panDelta=(e.panDelta||new t.P(0,0))._add(r.panDelta)),r.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+r.zoomDelta),r.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+r.bearingDelta),r.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+r.pitchDelta),void 0!==r.around&&(e.around=r.around),void 0!==r.pinchAround&&(e.pinchAround=r.pinchAround),r.noInertia&&(e.noInertia=r.noInertia),t.e(n,o),t.e(i,a);this._updateMapTransform(e,n,i),this._changes=[]}_updateMapTransform(e,t,n){let i=this._map,r=i._getTransformForUpdate(),o=i.terrain;if(!(ib(e)||o&&this._terrainMovement))return this._fireEvents(t,n,!0);let{panDelta:a,zoomDelta:s,bearingDelta:l,pitchDelta:c,around:d,pinchAround:u}=e;void 0!==u&&(d=u),i._stop(!0),d=d||i.transform.centerPoint;let h=r.pointLocation(a?d.sub(a):d);l&&(r.bearing+=l),c&&(r.pitch+=c),s&&(r.zoom+=s),o?!this._terrainMovement&&(t.drag||t.zoom)?(this._terrainMovement=!0,this._map._elevationFreeze=!0,r.setLocationAtPoint(h,d),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,r.recalculateZoom(i.terrain)})):t.drag&&this._terrainMovement?r.center=r.pointLocation(r.centerPoint.sub(a)):r.setLocationAtPoint(h,d):r.setLocationAtPoint(h,d),i._applyUpdatedTransform(r),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(t,n,!0)}_fireEvents(e,n,i){let r,o=ip(this._eventsInProgress),a=ip(e),s={};for(let t in e){let{originalEvent:n}=e[t];this._eventsInProgress[t]||(s[`${t}start`]=n),this._eventsInProgress[t]=e[t]}for(let e in!o&&a&&this._fireEvent("movestart",a.originalEvent),s)this._fireEvent(e,s[e]);for(let t in a&&this._fireEvent("move",a.originalEvent),e){let{originalEvent:n}=e[t];this._fireEvent(t,n)}let l={};for(let e in this._eventsInProgress){let{handlerName:t,originalEvent:i}=this._eventsInProgress[e];this._handlersById[t].isActive()||(delete this._eventsInProgress[e],r=n[t]||i,l[`${e}end`]=r)}for(let e in l)this._fireEvent(e,l[e]);let c=ip(this._eventsInProgress);if(i&&(o||a)&&!c){this._updatingCamera=!0;let e=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),n=e=>0!==e&&-this._bearingSnap<e&&e<this._bearingSnap;e&&(e.essential||!u.prefersReducedMotion)?(n(e.bearing||this._map.getBearing())&&(e.bearing=0),e.freezeElevation=!0,this._map.easeTo(e,{originalEvent:r})):(this._map.fire(new t.k("moveend",{originalEvent:r})),n(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(e,n){this._map.fire(new t.k(e,n?{originalEvent:n}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{delete this._frameId,this.handleEvent(new ig("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class iy extends t.E{constructor(e,t){super(),this._renderFrameCallback=()=>{let e=Math.min((u.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=t.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new t.M(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}panBy(e,n,i){return e=t.P.convert(e).mult(-1),this.panTo(this.transform.center,t.e({offset:e},n),i)}panTo(e,n,i){return this.easeTo(t.e({center:e},n),i)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(e,n,i){return this.easeTo(t.e({zoom:e},n),i)}zoomIn(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}zoomOut(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}getBearing(){return this.transform.bearing}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(e,n,i){return this.easeTo(t.e({bearing:e},n),i)}resetNorth(e,n){return this.rotateTo(0,t.e({duration:1e3},e),n),this}resetNorthPitch(e,n){return this.easeTo(t.e({bearing:0,pitch:0,duration:1e3},e),n),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}cameraForBounds(e,t){e=W.convert(e);let n=t&&t.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),n,t)}_cameraForBoxAndBearing(e,n,i,r){let o={top:0,bottom:0,right:0,left:0};if("number"==typeof(r=t.e({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},r)).padding){let e=r.padding;r.padding={top:e,bottom:e,right:e,left:e}}r.padding=t.e(o,r.padding);let a=this.transform,s=a.padding,l=new W(e,n),c=a.project(l.getNorthWest()),d=a.project(l.getNorthEast()),u=a.project(l.getSouthEast()),h=a.project(l.getSouthWest()),m=t.b8(-i),f=c.rotate(m),p=d.rotate(m),g=u.rotate(m),b=h.rotate(m),_=new t.P(Math.max(f.x,p.x,b.x,g.x),Math.max(f.y,p.y,b.y,g.y)),y=new t.P(Math.min(f.x,p.x,b.x,g.x),Math.min(f.y,p.y,b.y,g.y)),v=_.sub(y),x=(a.width-(s.left+s.right+r.padding.left+r.padding.right))/v.x,w=(a.height-(s.top+s.bottom+r.padding.top+r.padding.bottom))/v.y;if(w<0||x<0)return void t.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");let F=Math.min(a.scaleZoom(a.scale*Math.min(x,w)),r.maxZoom),k=t.P.convert(r.offset),E=new t.P((r.padding.left-r.padding.right)/2,(r.padding.top-r.padding.bottom)/2).rotate(t.b8(i)),A=k.add(E).mult(a.scale/a.zoomScale(F));return{center:a.unproject(c.add(u).div(2).sub(A)),zoom:F,bearing:i}}fitBounds(e,t,n){return this._fitInternal(this.cameraForBounds(e,t),t,n)}fitScreenCoordinates(e,n,i,r,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.P.convert(e)),this.transform.pointLocation(t.P.convert(n)),i,r),r,o)}_fitInternal(e,n,i){return e?(delete(n=t.e(e,n)).padding,n.linear?this.easeTo(n,i):this.flyTo(n,i)):this}jumpTo(e,n){this.stop();let i=this._getTransformForUpdate(),r=!1,o=!1,a=!1;return"zoom"in e&&i.zoom!==+e.zoom&&(r=!0,i.zoom=+e.zoom),void 0!==e.center&&(i.center=t.M.convert(e.center)),"bearing"in e&&i.bearing!==+e.bearing&&(o=!0,i.bearing=+e.bearing),"pitch"in e&&i.pitch!==+e.pitch&&(a=!0,i.pitch=+e.pitch),null==e.padding||i.isPaddingEqual(e.padding)||(i.padding=e.padding),this._applyUpdatedTransform(i),this.fire(new t.k("movestart",n)).fire(new t.k("move",n)),r&&this.fire(new t.k("zoomstart",n)).fire(new t.k("zoom",n)).fire(new t.k("zoomend",n)),o&&this.fire(new t.k("rotatestart",n)).fire(new t.k("rotate",n)).fire(new t.k("rotateend",n)),a&&this.fire(new t.k("pitchstart",n)).fire(new t.k("pitch",n)).fire(new t.k("pitchend",n)),this.fire(new t.k("moveend",n))}calculateCameraOptionsFromTo(e,n,i,r=0){let o=t.Y.fromLngLat(e,n),a=t.Y.fromLngLat(i,r),s=a.x-o.x,l=a.y-o.y,c=a.z-o.z,d=Math.hypot(s,l,c);if(0===d)throw Error("Can't calculate camera options with same From and To");let u=Math.hypot(s,l),h=this.transform.scaleZoom(this.transform.cameraToCenterDistance/d/this.transform.tileSize),m=180*Math.atan2(s,-l)/Math.PI,f=180*Math.acos(u/d)/Math.PI;return f=c<0?90-f:90+f,{center:a.toLngLat(),zoom:h,pitch:f,bearing:m}}easeTo(e,n){var i;let r,o;this._stop(!1,e.easeId),(!1===(e=t.e({offset:[0,0],duration:500,easing:t.b7},e)).animate||!e.essential&&u.prefersReducedMotion)&&(e.duration=0);let a=this._getTransformForUpdate(),s=this.getZoom(),l=this.getBearing(),c=this.getPitch(),d=this.getPadding(),h="bearing"in e?this._normalizeBearing(e.bearing,l):l,m="pitch"in e?+e.pitch:c,f="padding"in e?e.padding:a.padding,p=t.P.convert(e.offset),g=a.centerPoint.add(p),b=a.pointLocation(g),{center:_,zoom:y}=a.getConstrained(t.M.convert(e.center||b),null!=(i=e.zoom)?i:s);this._normalizeCenter(_);let v=a.project(b),x=a.project(_).sub(v),w=a.zoomScale(y-s);e.around&&(r=t.M.convert(e.around),o=a.locationPoint(r));let F={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||y!==s,this._rotating=this._rotating||l!==h,this._pitching=this._pitching||m!==c,this._padding=!a.isPaddingEqual(f),this._easeId=e.easeId,this._prepareEase(n,e.noMoveStart,F),this.terrain&&this._prepareElevation(_),this._ease(i=>{if(this._zooming&&(a.zoom=t.z.number(s,y,i)),this._rotating&&(a.bearing=t.z.number(l,h,i)),this._pitching&&(a.pitch=t.z.number(c,m,i)),this._padding&&(a.interpolatePadding(d,f,i),g=a.centerPoint.add(p)),this.terrain&&!e.freezeElevation&&this._updateElevation(i),r)a.setLocationAtPoint(r,o);else{let e=a.zoomScale(a.zoom-s),t=Math.pow(y>s?Math.min(2,w):Math.max(.5,w),1-i),n=a.unproject(v.add(x.mult(i*t)).mult(e));a.setLocationAtPoint(a.renderWorldCopies?n.wrap():n,g)}this._applyUpdatedTransform(a),this._fireMoveEvents(n)},e=>{this.terrain&&this._finalizeElevation(),this._afterEase(n,e)},e),this}_prepareEase(e,n,i={}){this._moving=!0,n||i.moving||this.fire(new t.k("movestart",e)),this._zooming&&!i.zooming&&this.fire(new t.k("zoomstart",e)),this._rotating&&!i.rotating&&this.fire(new t.k("rotatestart",e)),this._pitching&&!i.pitching&&this.fire(new t.k("pitchstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let n=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&n!==this._elevationTarget){let t=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(t-(n-(t*e+this._elevationStart))/(1-e)),this._elevationTarget=n}this.transform.elevation=t.z.number(this._elevationStart,this._elevationTarget,e)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(e){if(!this.transformCameraUpdate)return;let t=e.clone(),{center:n,zoom:i,pitch:r,bearing:o,elevation:a}=this.transformCameraUpdate(t);n&&(t.center=n),void 0!==i&&(t.zoom=i),void 0!==r&&(t.pitch=r),void 0!==o&&(t.bearing=o),void 0!==a&&(t.elevation=a),this.transform.apply(t)}_fireMoveEvents(e){this.fire(new t.k("move",e)),this._zooming&&this.fire(new t.k("zoom",e)),this._rotating&&this.fire(new t.k("rotate",e)),this._pitching&&this.fire(new t.k("pitch",e))}_afterEase(e,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;let i=this._zooming,r=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,i&&this.fire(new t.k("zoomend",e)),r&&this.fire(new t.k("rotateend",e)),o&&this.fire(new t.k("pitchend",e)),this.fire(new t.k("moveend",e))}flyTo(e,n){var i;if(!e.essential&&u.prefersReducedMotion){let i=t.L(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,n)}this.stop(),e=t.e({offset:[0,0],speed:1.2,curve:1.42,easing:t.b7},e);let r=this._getTransformForUpdate(),o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),l=this.getPadding(),c="bearing"in e?this._normalizeBearing(e.bearing,a):a,d="pitch"in e?+e.pitch:s,h="padding"in e?e.padding:r.padding,m=t.P.convert(e.offset),f=r.centerPoint.add(m),p=r.pointLocation(f),{center:g,zoom:b}=r.getConstrained(t.M.convert(e.center||p),null!=(i=e.zoom)?i:o);this._normalizeCenter(g);let _=r.zoomScale(b-o),y=r.project(p),v=r.project(g).sub(y),x=e.curve,w=Math.max(r.width,r.height),F=w/_,k=v.mag();if("minZoom"in e){let n=t.ac(Math.min(e.minZoom,o,b),r.minZoom,r.maxZoom);x=Math.sqrt(w/r.zoomScale(n-o)/k*2)}let E=x*x;function A(e){let t=(F*F-w*w+(e?-1:1)*E*E*k*k)/(2*(e?F:w)*E*k);return Math.log(Math.sqrt(t*t+1)-t)}function C(e){return(Math.exp(e)-Math.exp(-e))/2}function T(e){return(Math.exp(e)+Math.exp(-e))/2}let S=A(!1),M=function(e){return T(S)/T(S+x*e)},D=function(e){var t;return w*((T(S)*(C(t=S+x*e)/T(t))-C(S))/E)/k},I=(A(!0)-S)/x;if(1e-6>Math.abs(k)||!isFinite(I)){if(1e-6>Math.abs(w-F))return this.easeTo(e,n);let t=F<w?-1:1;I=Math.abs(Math.log(F/w))/x,D=function(){return 0},M=function(e){return Math.exp(t*x*e)}}return e.duration="duration"in e?+e.duration:1e3*I/("screenSpeed"in e?e.screenSpeed/x:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=a!==c,this._pitching=d!==s,this._padding=!r.isPaddingEqual(h),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(g),this._ease(i=>{let u=i*I,p=1/M(u);r.zoom=1===i?b:o+r.scaleZoom(p),this._rotating&&(r.bearing=t.z.number(a,c,i)),this._pitching&&(r.pitch=t.z.number(s,d,i)),this._padding&&(r.interpolatePadding(l,h,i),f=r.centerPoint.add(m)),this.terrain&&!e.freezeElevation&&this._updateElevation(i);let _=1===i?g:r.unproject(y.add(v.mult(D(u))).mult(p));r.setLocationAtPoint(r.renderWorldCopies?_.wrap():_,f),this._applyUpdatedTransform(r),this._fireMoveEvents(n)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(n)},e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let e=this._onEaseEnd;delete this._onEaseEnd,e.call(this,t)}if(!e){let e=this.handlers;e&&e.stop(!1)}return this}_ease(e,t,n){!1===n.animate||0===n.duration?(e(1),t()):(this._easeStart=u.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=t,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,n){let i=Math.abs((e=t.b1(e,-180,180))-n);return Math.abs(e-360-n)<i&&(e-=360),Math.abs(e+360-n)<i&&(e+=360),e}_normalizeCenter(e){let t=this.transform;if(!t.renderWorldCopies||t.lngRange)return;let n=e.lng-t.center.lng;e.lng+=n>180?-360:360*(n<-180)}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(t.M.convert(e),this.transform.tileZoom)-this.transform.elevation:null}}let iv={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class ix{constructor(e=iv){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=e=>{e&&("metadata"===e.sourceDataType||"visibility"===e.sourceDataType||"style"===e.dataType||"terrain"===e.type)&&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=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=h.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=h.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=h.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(){h.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,t){let n=this._map._getUIString(`AttributionControl.${t}`);e.title=n,e.setAttribute("aria-label",n)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(e=>"string"!=typeof e?"":e)):"string"==typeof this.options.customAttribution&&e.push(this.options.customAttribution)),this._map.style.stylesheet){let e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}let t=this._map.style.sourceCaches;for(let n in t){let i=t[n];if(i.used||i.usedForTerrain){let t=i.getSource();t.attribution&&0>e.indexOf(t.attribution)&&e.push(t.attribution)}}(e=e.filter(e=>String(e).trim())).sort((e,t)=>e.length-t.length);let n=(e=e.filter((t,n)=>{for(let i=n+1;i<e.length;i++)if(e[i].indexOf(t)>=0)return!1;return!0})).join(" | ");n!==this._attribHTML&&(this._attribHTML=n,e.length?(this._innerContainer.innerHTML=n,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class iw{constructor(e={}){this._updateCompact=()=>{let e=this._container.children;if(e.length){let t=e[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&t.classList.add("maplibregl-compact"):t.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=h.create("div","maplibregl-ctrl");let t=h.create("a","maplibregl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://maplibre.org/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){h.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class iF{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){let t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){let t=this._currentlyRunning;for(let n of t?this._queue.concat(t):this._queue)if(n.id===e)return void(n.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw Error("Attempting to run(), but is already running.");let t=this._currentlyRunning=this._queue;for(let n of(this._queue=[],t))if(!n.cancelled&&(n.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var ik=t.X([{name:"a_pos3d",type:"Int16",components:3}]);class iE extends t.E{constructor(e){super(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,e.usedForTerrain=!0,e.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,n){this.sourceCache.update(e,n),this._renderableTilesKeys=[];let i={};for(let r of e.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n}))i[r.key]=!0,this._renderableTilesKeys.push(r.key),this._tiles[r.key]||(r.posMatrix=new Float64Array(16),t.aN(r.posMatrix,0,t.W,0,t.W,0,1),this._tiles[r.key]=new el(r,this.tileSize));for(let e in this._tiles)i[e]||delete this._tiles[e]}freeRtt(e){for(let t in this._tiles){let n=this._tiles[t];(!e||n.tileID.equals(e)||n.tileID.isChildOf(e)||e.isChildOf(n.tileID))&&(n.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e){let n={};for(let i of this._renderableTilesKeys){let r=this._tiles[i].tileID;if(r.canonical.equals(e.canonical)){let r=e.clone();r.posMatrix=new Float64Array(16),t.aN(r.posMatrix,0,t.W,0,t.W,0,1),n[i]=r}else if(r.canonical.isChildOf(e.canonical)){let o=e.clone();o.posMatrix=new Float64Array(16);let a=r.canonical.z-e.canonical.z,s=r.canonical.x-(r.canonical.x>>a<<a),l=r.canonical.y-(r.canonical.y>>a<<a),c=t.W>>a;t.aN(o.posMatrix,0,c,0,c,0,1),t.H(o.posMatrix,o.posMatrix,[-s*c,-l*c,0]),n[i]=o}else if(e.canonical.isChildOf(r.canonical)){let o=e.clone();o.posMatrix=new Float64Array(16);let a=e.canonical.z-r.canonical.z,s=e.canonical.x-(e.canonical.x>>a<<a),l=e.canonical.y-(e.canonical.y>>a<<a),c=t.W>>a;t.aN(o.posMatrix,0,t.W,0,t.W,0,1),t.H(o.posMatrix,o.posMatrix,[s*c,l*c,0]),t.J(o.posMatrix,o.posMatrix,[1/2**a,1/2**a,0]),n[i]=o}}return n}getSourceTile(e,t){let n=this.sourceCache._source,i=e.overscaledZ-this.deltaZoom;if(i>n.maxzoom&&(i=n.maxzoom),i<n.minzoom)return null;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(i).key);let r=this.sourceCache.getTileByID(this._sourceTileCache[e.key]);if((!r||!r.dem)&&t)for(;i>=n.minzoom&&(!r||!r.dem);)r=this.sourceCache.getTileByID(e.scaledTo(i--).key);return r}tilesAfterTime(e=Date.now()){return Object.values(this._tiles).filter(t=>t.timeAdded>=e)}}class iA{constructor(e,t,n){this.painter=e,this.sourceCache=new iE(t),this.options=n,this.exaggeration="number"==typeof n.exaggeration?n.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,n,i,r=t.W){var o,a,s,l,c,d;if(!(n>=0&&n<r&&i>=0&&i<r))return 0;let u=this.getTerrainData(e),h=null==(o=u.tile)?void 0:o.dem;if(!h)return 0;let m=(a=[],s=[n/r*t.W,i/r*t.W],l=u.u_terrain_matrix,c=s[0],d=s[1],a[0]=l[0]*c+l[4]*d+l[12],a[1]=l[1]*c+l[5]*d+l[13],a),f=[m[0]*h.dim,m[1]*h.dim],p=Math.floor(f[0]),g=Math.floor(f[1]),b=f[0]-p,_=f[1]-g;return h.get(p,g)*(1-b)*(1-_)+h.get(p+1,g)*b*(1-_)+h.get(p,g+1)*(1-b)*_+h.get(p+1,g+1)*b*_}getElevationForLngLatZoom(e,n){let{tileID:i,mercatorX:r,mercatorY:o}=this._getOverscaledTileIDFromLngLatZoom(e,n);return this.getElevation(i,r%t.W,o%t.W,t.W)}getElevation(e,n,i,r=t.W){return this.getDEMElevation(e,n,i,r)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){let e=this.painter.context,n=new t.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new S(e,n,e.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new S(e,new t.R({width:1,height:1}),e.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=t.an([])}let n=this.sourceCache.getSourceTile(e,!0);if(n&&n.dem&&(!n.demTexture||n.needsTerrainPrepare)){let e=this.painter.context;n.demTexture=this.painter.getTileTexture(n.dem.stride),n.demTexture?n.demTexture.update(n.dem.getPixels(),{premultiply:!1}):n.demTexture=new S(e,n.dem.getPixels(),e.gl.RGBA,{premultiply:!1}),n.demTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),n.needsTerrainPrepare=!1}let i=n&&n+n.tileID.key+e.key;if(i&&!this._demMatrixCache[i]){let i=this.sourceCache.sourceCache._source.maxzoom,r=e.canonical.z-n.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=i?r=e.canonical.z-i:t.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let o=e.canonical.x-(e.canonical.x>>r<<r),a=e.canonical.y-(e.canonical.y>>r<<r),s=t.b9(new Float64Array(16),[1/(t.W<<r),1/(t.W<<r),0]);t.H(s,s,[o*t.W,a*t.W,0]),this._demMatrixCache[e.key]={matrix:s,coord:e}}return{u_depth:2,u_terrain:3,u_terrain_dim:n&&n.dem&&n.dem.dim||1,u_terrain_matrix:i?this._demMatrixCache[e.key].matrix:this._emptyDemMatrix,u_terrain_unpack:n&&n.dem&&n.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(n&&n.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:n}}getFramebuffer(e){let t=this.painter,n=t.width/devicePixelRatio,i=t.height/devicePixelRatio;return this._fbo&&(this._fbo.width!==n||this._fbo.height!==i)&&(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new S(t.context,{width:n,height:i,data:null},t.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(t.context.gl.NEAREST,t.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new S(t.context,{width:n,height:i,data:null},t.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(t.context.gl.NEAREST,t.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=t.context.createFramebuffer(n,i,!0,!1),this._fbo.depthAttachment.set(t.context.createRenderbuffer(t.context.gl.DEPTH_COMPONENT16,n,i))),this._fbo.colorAttachment.set("coords"===e?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let n=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let e=0,t=0;e<this._coordsTextureSize;e++)for(let i=0;i<this._coordsTextureSize;i++,t+=4)n[t+0]=255&i,n[t+1]=255&e,n[t+2]=i>>8<<4|e>>8,n[t+3]=0;let i=new S(e,new t.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),e.gl.RGBA,{premultiply:!1});return i.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=i,i}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);let n=new Uint8Array(4),i=this.painter.context,r=i.gl;i.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),r.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,r.RGBA,r.UNSIGNED_BYTE,n),i.bindFramebuffer.set(null);let o=n[0]+(n[2]>>4<<8),a=n[1]+((15&n[2])<<8),s=this.coordsIndex[255-n[3]],l=s&&this.sourceCache.getTileByID(s);if(!l)return null;let c=this._coordsTextureSize,d=(1<<l.tileID.canonical.z)*c;return new t.Y((l.tileID.canonical.x*c+o)/d+l.tileID.wrap,(l.tileID.canonical.y*c+a)/d,this.getElevation(l.tileID,o,a,c))}depthAtPoint(e){let t=new Uint8Array(4),n=this.painter.context,i=n.gl;return n.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),i.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,i.RGBA,i.UNSIGNED_BYTE,t),n.bindFramebuffer.set(null),(t[0]/0x1000000+t[1]/65536+t[2]/256+t[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;let e=this.painter.context,n=new t.ba,i=new t.aX,r=this.meshSize,o=t.W/r,a=r*r;for(let e=0;e<=r;e++)for(let t=0;t<=r;t++)n.emplaceBack(t*o,e*o,0);for(let e=0;e<a;e+=r+1)for(let t=0;t<r;t++)i.emplaceBack(t+e,r+t+e+1,r+t+e+2),i.emplaceBack(t+e,r+t+e+2,t+e+1);let s=n.length,l=s+2*(r+1);for(let e of[0,1])for(let i=0;i<=r;i++)for(let r of[0,1])n.emplaceBack(i*o,e*t.W,r);for(let e=0;e<2*r;e+=2)i.emplaceBack(l+e,l+e+1,l+e+3),i.emplaceBack(l+e,l+e+3,l+e+2),i.emplaceBack(s+e,s+e+3,s+e+1),i.emplaceBack(s+e,s+e+2,s+e+3);let c=n.length,d=c+2*(r+1);for(let e of[0,1])for(let i=0;i<=r;i++)for(let r of[0,1])n.emplaceBack(e*t.W,i*o,r);for(let e=0;e<2*r;e+=2)i.emplaceBack(c+e,c+e+1,c+e+3),i.emplaceBack(c+e,c+e+3,c+e+2),i.emplaceBack(d+e,d+e+3,d+e+1),i.emplaceBack(d+e,d+e+2,d+e+3);return this._mesh={indexBuffer:e.createIndexBuffer(i),vertexBuffer:e.createVertexBuffer(n,ik.members),segments:t.$.simpleSegment(0,0,n.length,i.length)},this._mesh}getMeshFrameDelta(e){return 2*Math.PI*t.bb/Math.pow(2,e)/5}getMinTileElevationForLngLatZoom(e,t){var n;let{tileID:i}=this._getOverscaledTileIDFromLngLatZoom(e,t);return null!=(n=this.getMinMaxElevation(i).minElevation)?n:0}getMinMaxElevation(e){let t=this.getTerrainData(e).tile,n={minElevation:null,maxElevation:null};return t&&t.dem&&(n.minElevation=t.dem.min*this.exaggeration,n.maxElevation=t.dem.max*this.exaggeration),n}_getOverscaledTileIDFromLngLatZoom(e,n){let i=t.Y.fromLngLat(e.wrap()),r=(1<<n)*t.W,o=i.x*r,a=i.y*r,s=Math.floor(o/t.W),l=Math.floor(a/t.W);return{tileID:new t.Q(n,0,n,s,l),mercatorX:o,mercatorY:a}}}class iC{constructor(e,t,n){this._context=e,this._size=t,this._tileSize=n,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let e of this._objects)e.texture.destroy(),e.fbo.destroy()}_createObject(e){let t=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),n=new S(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return n.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),t.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),t.colorAttachment.set(n.texture),{id:e,fbo:t,texture:n,stamp:-1,inUse:!1}}getObjectForId(e){return this._objects[e]}useObject(e){e.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(t=>e.id!==t),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(let e of this._recentlyUsed)if(!this._objects[e].inUse)return this._objects[e];if(this._objects.length>=this._size)throw Error("No free RenderPool available, call freeAllObjects() required!");let e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(let e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length<this._size)&&!1===this._objects.some(e=>!e.inUse)}}let iT={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class iS{constructor(e,t){this.painter=e,this.terrain=t,this.pool=new iC(e.context,30,t.sourceCache.tileSize*t.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,t){for(let n in this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter(n=>!e._layers[n].isHidden(t)),this._coordsDescendingInv={},e.sourceCaches)for(let t of(this._coordsDescendingInv[n]={},e.sourceCaches[n].getVisibleCoordinates())){let e=this.terrain.sourceCache.getTerrainCoords(t);for(let t in e)this._coordsDescendingInv[n][t]||(this._coordsDescendingInv[n][t]=[]),this._coordsDescendingInv[n][t].push(e[t])}for(let t of(this._coordsDescendingInvStr={},e._order)){let n=e._layers[t],i=n.source;if(iT[n.type]&&!this._coordsDescendingInvStr[i])for(let e in this._coordsDescendingInvStr[i]={},this._coordsDescendingInv[i])this._coordsDescendingInvStr[i][e]=this._coordsDescendingInv[i][e].map(e=>e.key).sort().join()}for(let e of this._renderableTiles)for(let t in this._coordsDescendingInvStr){let n=this._coordsDescendingInvStr[t][e.tileID.key];n&&n!==e.rttCoords[t]&&(e.rtt=[])}}renderLayer(e){if(e.isHidden(this.painter.transform.zoom))return!1;let n=e.type,i=this.painter,r=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(iT[n]&&(this._prevType&&iT[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(e.id),!r))return!0;if(iT[this._prevType]||iT[n]&&r){this._prevType=n;let e=this._stacks.length-1,r=this._stacks[e]||[];for(let n of this._renderableTiles){if(this.pool.isFull()&&(nx(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(n),n.rtt[e]){let t=this.pool.getObjectForId(n.rtt[e].id);if(t.stamp===n.rtt[e].stamp){this.pool.useObject(t);continue}}let o=this.pool.getOrCreateFreeObject();this.pool.useObject(o),this.pool.stampObject(o),n.rtt[e]={id:o.id,stamp:o.stamp},i.context.bindFramebuffer.set(o.fbo.framebuffer),i.context.clear({color:t.aO.transparent,stencil:0}),i.currentStencilSource=void 0;for(let e=0;e<r.length;e++){let t=i.style._layers[r[e]],a=t.source?this._coordsDescendingInv[t.source][n.tileID.key]:[n.tileID];i.context.viewport.set([0,0,o.fbo.width,o.fbo.height]),i._renderTileClippingMasks(t,a),i.renderLayer(i,i.style.sourceCaches[t.source],t,a),t.source&&(n.rttCoords[t.source]=this._coordsDescendingInvStr[t.source][n.tileID.key])}}return nx(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),iT[n]}return!1}}let iM={"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","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","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"},iL={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:iv,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:t.a.MAX_TILE_CACHE_ZOOM_LEVELS,localIdeographFontFamily:"sans-serif",transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,validateStyle:!0,maxCanvasSize:[4096,4096]},iD=e=>{e.touchstart=e.dragStart,e.touchmoveWindow=e.dragMove,e.touchend=e.dragEnd},iI={showCompass:!0,showZoom:!0,visualizePitch:!1};class iR{constructor(e,n,i=!1){this.mousedown=e=>{this.startMouse(t.e({},e,{ctrlKey:!0,preventDefault:()=>e.preventDefault()}),h.mousePos(this.element,e)),h.addEventListener(window,"mousemove",this.mousemove),h.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=e=>{this.moveMouse(e,h.mousePos(this.element,e))},this.mouseup=e=>{this.mouseRotate.dragEnd(e),this.mousePitch&&this.mousePitch.dragEnd(e),this.offTemp()},this.touchstart=e=>{1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=h.touchPos(this.element,e.targetTouches)[0],this.startTouch(e,this._startPos),h.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),h.addEventListener(window,"touchend",this.touchend))},this.touchmove=e=>{1!==e.targetTouches.length?this.reset():(this._lastPos=h.touchPos(this.element,e.targetTouches)[0],this.moveTouch(e,this._lastPos))},this.touchend=e=>{0===e.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.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;let r=e.dragRotate._mouseRotate.getClickTolerance(),o=e.dragRotate._mousePitch.getClickTolerance();this.element=n,this.mouseRotate=nQ({clickTolerance:r,enable:!0}),this.touchRotate=(({enable:e,clickTolerance:t,bearingDegreesPerPixelMoved:n=.8})=>new nq({clickTolerance:t,move:(e,t)=>({bearingDelta:(t.x-e.x)*n}),moveStateManager:new nZ,enable:e,assignEvents:iD}))({clickTolerance:r,enable:!0}),this.map=e,i&&(this.mousePitch=n0({clickTolerance:o,enable:!0}),this.touchPitch=(({enable:e,clickTolerance:t,pitchDegreesPerPixelMoved:n=-.5})=>new nq({clickTolerance:t,move:(e,t)=>({pitchDelta:(t.y-e.y)*n}),moveStateManager:new nZ,enable:e,assignEvents:iD}))({clickTolerance:o,enable:!0})),h.addEventListener(n,"mousedown",this.mousedown),h.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),h.addEventListener(n,"touchcancel",this.reset)}startMouse(e,t){this.mouseRotate.dragStart(e,t),this.mousePitch&&this.mousePitch.dragStart(e,t),h.disableDrag()}startTouch(e,t){this.touchRotate.dragStart(e,t),this.touchPitch&&this.touchPitch.dragStart(e,t),h.disableDrag()}moveMouse(e,t){let n=this.map,{bearingDelta:i}=this.mouseRotate.dragMove(e,t)||{};if(i&&n.setBearing(n.getBearing()+i),this.mousePitch){let{pitchDelta:i}=this.mousePitch.dragMove(e,t)||{};i&&n.setPitch(n.getPitch()+i)}}moveTouch(e,t){let n=this.map,{bearingDelta:i}=this.touchRotate.dragMove(e,t)||{};if(i&&n.setBearing(n.getBearing()+i),this.touchPitch){let{pitchDelta:i}=this.touchPitch.dragMove(e,t)||{};i&&n.setPitch(n.getPitch()+i)}}off(){let e=this.element;h.removeEventListener(e,"mousedown",this.mousedown),h.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),h.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),h.removeEventListener(window,"touchend",this.touchend),h.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){h.enableDrag(),h.removeEventListener(window,"mousemove",this.mousemove),h.removeEventListener(window,"mouseup",this.mouseup),h.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),h.removeEventListener(window,"touchend",this.touchend)}}function iO(e,n,i){let r=new t.M(e.lng,e.lat);if(e=new t.M(e.lng,e.lat),n){let r=new t.M(e.lng-360,e.lat),o=new t.M(e.lng+360,e.lat),a=i.locationPoint(e).distSqr(n);i.locationPoint(r).distSqr(n)<a?e=r:i.locationPoint(o).distSqr(n)<a&&(e=o)}for(;Math.abs(e.lng-i.center.lng)>180;){let t=i.locationPoint(e);if(t.x>=0&&t.y>=0&&t.x<=i.width&&t.y<=i.height)break;e.lng>i.center.lng?e.lng-=360:e.lng+=360}return e.lng!==r.lng&&i.locationPoint(e).y>i.height/2-i.getHorizon()?e:r}let iP={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 i$(e,t,n){let i=e.classList;for(let e in iP)i.remove(`maplibregl-${n}-anchor-${e}`);i.add(`maplibregl-${n}-anchor-${t}`)}class iN extends t.E{constructor(e){if(super(),this._onKeyPress=e=>{let t=e.code,n=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==n&&13!==n||this.togglePopup()},this._onMapClick=e=>{let t=e.originalEvent.target,n=this._element;this._popup&&(t===n||n.contains(t))&&this.togglePopup()},this._update=e=>{var t;if(!this._map)return;let n=this._map.loaded()&&!this._map.isMoving();"terrain"!==(null==e?void 0:e.type)&&("render"!==(null==e?void 0:e.type)||n)||this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?iO(this._lngLat,this._flatPos,this._map.transform):null==(t=this._lngLat)?void 0:t.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let i="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?i=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(i=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let r="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?r="rotateX(0deg)":"map"===this._pitchAlignment&&(r=`rotateX(${this._map.getPitch()}deg)`),e&&"moveend"!==e.type||(this._pos=this._pos.round()),h.setTransform(this._element,`${iP[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${r} ${i}`),u.frameAsync(new AbortController).then(()=>{this._updateOpacity(e&&"moveend"===e.type)}).catch(()=>{})},this._onMove=e=>{if(!this._isDragging){let t=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=t}this._isDragging&&(this._pos=e.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 t.k("dragstart"))),this.fire(new t.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.k("dragend")),this._state="inactive"},this._addDragHandler=e=>{this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.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=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&"auto"!==e.pitchAlignment?e.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(null==e?void 0:e.opacity,null==e?void 0:e.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=t.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=h.create("div"),this._element.setAttribute("aria-label","Map marker");let n=h.createNS("http://www.w3.org/2000/svg","svg");n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height","41px"),n.setAttributeNS(null,"width","27px"),n.setAttributeNS(null,"viewBox","0 0 27 41");let i=h.createNS("http://www.w3.org/2000/svg","g");i.setAttributeNS(null,"stroke","none"),i.setAttributeNS(null,"stroke-width","1"),i.setAttributeNS(null,"fill","none"),i.setAttributeNS(null,"fill-rule","evenodd");let r=h.createNS("http://www.w3.org/2000/svg","g");r.setAttributeNS(null,"fill-rule","nonzero");let o=h.createNS("http://www.w3.org/2000/svg","g");for(let e of(o.setAttributeNS(null,"transform","translate(3.0, 29.0)"),o.setAttributeNS(null,"fill","#000000"),[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}])){let t=h.createNS("http://www.w3.org/2000/svg","ellipse");t.setAttributeNS(null,"opacity","0.04"),t.setAttributeNS(null,"cx","10.5"),t.setAttributeNS(null,"cy","5.80029008"),t.setAttributeNS(null,"rx",e.rx),t.setAttributeNS(null,"ry",e.ry),o.appendChild(t)}let a=h.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"fill",this._color);let s=h.createNS("http://www.w3.org/2000/svg","path");s.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),a.appendChild(s);let l=h.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"opacity","0.25"),l.setAttributeNS(null,"fill","#000000");let c=h.createNS("http://www.w3.org/2000/svg","path");c.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),l.appendChild(c);let d=h.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"transform","translate(6.0, 7.0)"),d.setAttributeNS(null,"fill","#FFFFFF");let u=h.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"transform","translate(8.0, 8.0)");let m=h.createNS("http://www.w3.org/2000/svg","circle");m.setAttributeNS(null,"fill","#000000"),m.setAttributeNS(null,"opacity","0.25"),m.setAttributeNS(null,"cx","5.5"),m.setAttributeNS(null,"cy","5.5"),m.setAttributeNS(null,"r","5.4999962");let f=h.createNS("http://www.w3.org/2000/svg","circle");f.setAttributeNS(null,"fill","#FFFFFF"),f.setAttributeNS(null,"cx","5.5"),f.setAttributeNS(null,"cy","5.5"),f.setAttributeNS(null,"r","5.4999962"),u.appendChild(m),u.appendChild(f),r.appendChild(o),r.appendChild(a),r.appendChild(l),r.appendChild(d),r.appendChild(u),n.appendChild(r),n.setAttributeNS(null,"height",41*this._scale+"px"),n.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(n),this._offset=t.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",e=>{e.preventDefault()}),this._element.addEventListener("mousedown",e=>{e.preventDefault()}),i$(this._element,this._anchor,"marker"),e&&e.className)for(let t of e.className.split(" "))this._element.classList.add(t);this._popup=null}addTo(e){return this.remove(),this._map=e,e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),h.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=t.M.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){let t=Math.abs(13.5)/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[t,-1*(24.6+t)],"bottom-right":[-t,-1*(24.6+t)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}getPopup(){return this._popup}togglePopup(){let e=this._popup;return this._element.style.opacity===this._opacityWhenCovered||e&&(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map))),this}_updateOpacity(e=!1){var n,i;if(!(null==(n=this._map)?void 0:n.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let r=this._map,o=r.terrain.depthAtPoint(this._pos),a=r.terrain.getElevationForLngLatZoom(this._lngLat,r.transform.tileZoom);if(r.transform.lngLatToCameraDepth(this._lngLat,a)-o<.006)return void(this._element.style.opacity=this._opacity);let s=-this._offset.y/r.transform._pixelPerMeter,l=Math.sin(r.getPitch()*Math.PI/180)*s,c=r.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),d=r.transform.lngLatToCameraDepth(this._lngLat,a+l)-c>.006;(null==(i=this._popup)?void 0:i.isOpen())&&d&&this._popup.remove(),this._element.style.opacity=d?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=t.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&"auto"!==e?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,t){return void 0===e&&void 0===t&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==e&&(this._opacity=e),void 0!==t&&(this._opacityWhenCovered=t),this._map&&this._updateOpacity(!0),this}}let iB={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},iz=0,ij=!1,iY={maxWidth:100,unit:"metric"};function iH(e,t,n){let i=n&&n.maxWidth||100,r=e._container.clientHeight/2,o=e.unproject([0,r]),a=e.unproject([i,r]),s=o.distanceTo(a);if(n&&"imperial"===n.unit){let n=3.2808*s;n>5280?iU(t,i,n/5280,e._getUIString("ScaleControl.Miles")):iU(t,i,n,e._getUIString("ScaleControl.Feet"))}else n&&"nautical"===n.unit?iU(t,i,s/1852,e._getUIString("ScaleControl.NauticalMiles")):s>=1e3?iU(t,i,s/1e3,e._getUIString("ScaleControl.Kilometers")):iU(t,i,s,e._getUIString("ScaleControl.Meters"))}function iU(e,t,n,i){let r=function(e){let t=Math.pow(10,`${Math.floor(e)}`.length-1),n=e/t;return t*(n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:n>=1?1:function(e){let t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(n))}(n);e.style.width=r/n*t+"px",e.innerHTML=`${r} ${i}`}let iV={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1};e.AJAXError=t.be,e.Evented=t.E,e.LngLat=t.M,e.MercatorCoordinate=t.Y,e.Point=t.P,e.addProtocol=t.bf,e.config=t.a,e.removeProtocol=t.bg,e.AttributionControl=ix,e.BoxZoomHandler=nH,e.CanvasSource=et,e.CooperativeGesturesHandler=im,e.DoubleClickZoomHandler=is,e.DragPanHandler=id,e.DragRotateHandler=iu,e.EdgeInsets=nE,e.FullscreenControl=class extends t.E{constructor(e={}){super(),this._onFullscreenChange=()=>{var e;let t=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;null==(e=null==t?void 0:t.shadowRoot)?void 0:e.fullscreenElement;)t=t.shadowRoot.fullscreenElement;t===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,e&&e.container&&(e.container instanceof HTMLElement?this._container=e.container:t.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){h.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let e=this._fullscreenButton=h.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);h.create("span","maplibregl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e}_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 t.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new t.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},e.GeoJSONSource=Z,e.GeolocateControl=class extends t.E{constructor(e){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.k("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,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(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new t.k("geolocate",e)),this._finish()}},this._updateCamera=e=>{let n=new t.M(e.coords.longitude,e.coords.latitude),i=e.coords.accuracy,r=this._map.getBearing(),o=t.e({bearing:r},this.options.fitBoundsOptions),a=W.fromLngLat(n,i);this._map.fitBounds(a,o,{geolocateSource:!0})},this._updateMarker=e=>{if(e){let n=new t.M(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=e=>{if(this._map){if(this.options.trackUserLocation)if(1===e.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 e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&ij)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new t.k("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=e=>{if(this._map){if(this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=h.create("button","maplibregl-ctrl-geolocate",this._container),h.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===e){t.w("Geolocation support is not available so the GeolocateControl will be disabled.");let e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}else{let e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=h.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new iN({element:this._dotElement}),this._circleElement=h.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new iN({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",e=>{e.geolocateSource||"ACTIVE_LOCK"!==this._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new t.k("trackuserlocationend")))})}},this.options=t.e({},iB,e)}onAdd(e){return this._map=e,this._container=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),(function(){return t._(this,arguments,void 0,function*(e=!1){if(void 0!==l&&!e)return l;if(void 0===window.navigator.permissions)return l=!!window.navigator.geolocation;try{let e=yield window.navigator.permissions.query({name:"geolocation"});l="denied"!==e.state}catch(e){l=!!window.navigator.geolocation}return l})})().then(e=>this._setupUI(e)),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(),h.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,iz=0,ij=!1}_isOutOfMapMaxBounds(e){let t=this._map.getMaxBounds(),n=e.coords;return t&&(n.longitude<t.getWest()||n.longitude>t.getEast()||n.latitude<t.getSouth()||n.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){let e=this._map.getBounds(),t=e.getSouthEast(),n=e.getNorthEast(),i=t.distanceTo(n),r=Math.ceil(this._accuracy/(i/this._map._container.clientHeight)*2);this._circleElement.style.width=`${r}px`,this._circleElement.style.height=`${r}px`}trigger(){if(!this._setup)return t.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":iz--,ij=!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 t.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.k("trackuserlocationstart"));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 e;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++iz>1?(e={maximumAge:6e5,timeout:0},ij=!0):(e=this.options.positionOptions,ij=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}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)}},e.Hash=nT,e.ImageSource=Q,e.KeyboardHandler=ir,e.LngLatBounds=W,e.LogoControl=iw,e.Map=class extends iy{constructor(e){if(t.bc.mark(t.bd.create),null!=(e=t.e({},iL,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>85)throw Error("maxPitch must be less than or equal to 85");if(super(new nA(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies),{bearingSnap:e.bearingSnap}),this._contextLost=e=>{e.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new t.k("webglcontextlost",{originalEvent:e}))},this._contextRestored=e=>{this._setupPainter(),this.resize(),this._update(),this.fire(new t.k("webglcontextrestored",{originalEvent:e}))},this._onMapScroll=e=>{if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._maxTileCacheZoomLevels=e.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new iF,this._controls=[],this._mapId=t.a3(),this._locale=t.e({},iM,e.locale),this._clickTolerance=e.clickTolerance,this._overridePixelRatio=e.pixelRatio,this._maxCanvasSize=e.maxCanvasSize,this.transformCameraUpdate=e.transformCameraUpdate,this._imageQueueHandle=F.addThrottleControl(()=>this.isMoving()),this._requestManager=new y(e.transformRequest),"string"==typeof e.container){if(this._container=document.getElementById(e.container),!this._container)throw Error(`Container '${e.container}' not found.`)}else{if(!(e.container instanceof HTMLElement))throw Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),"undefined"!=typeof window){addEventListener("online",this._onWindowOnline,!1);let e=!1,t=nC(e=>{this._trackResize&&!this._removed&&this.resize(e)._update()},50);this._resizeObserver=new ResizeObserver(n=>{e?t(n):e=!0}),this._resizeObserver.observe(this._container)}this.handlers=new i_(this,e),this._hash=e.hash&&new nT("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.e({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,this._validateStyle=e.validateStyle,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new ix("boolean"==typeof e.attributionControl?void 0:e.attributionControl)),e.maplibreLogo&&this.addControl(new iw,e.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",e=>{this._update("style"===e.dataType),this.fire(new t.k(`${e.dataType}data`,e))}),this.on("dataloading",e=>{this.fire(new t.k(`${e.dataType}dataloading`,e))}),this.on("dataabort",e=>{this.fire(new t.k("sourcedataabort",e))})}_getMapId(){return this._mapId}addControl(e,n){if(void 0===n&&(n=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.j(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let i=e.onAdd(this);this._controls.push(e);let r=this._controlPositions[n];return -1!==n.indexOf("bottom")?r.insertBefore(i,r.firstChild):r.appendChild(i),this}removeControl(e){if(!e||!e.onRemove)return this.fire(new t.j(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let n=this._controls.indexOf(e);return n>-1&&this._controls.splice(n,1),e.onRemove(this),this}hasControl(e){return this._controls.indexOf(e)>-1}calculateCameraOptionsFromTo(e,t,n,i){return null==i&&this.terrain&&(i=this.terrain.getElevationForLngLatZoom(n,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(e,t,n,i)}resize(e){var n;let i=this._containerDimensions(),r=i[0],o=i[1],a=this._getClampedPixelRatio(r,o);if(this._resizeCanvas(r,o,a),this.painter.resize(r,o,a),this.painter.overLimit()){let e=this.painter.context.gl;this._maxCanvasSize=[e.drawingBufferWidth,e.drawingBufferHeight];let t=this._getClampedPixelRatio(r,o);this._resizeCanvas(r,o,t),this.painter.resize(r,o,t)}this.transform.resize(r,o),null==(n=this._requestedCameraState)||n.resize(r,o);let s=!this._moving;return s&&(this.stop(),this.fire(new t.k("movestart",e)).fire(new t.k("move",e))),this.fire(new t.k("resize",e)),s&&this.fire(new t.k("moveend",e)),this}_getClampedPixelRatio(e,t){let{0:n,1:i}=this._maxCanvasSize,r=this.getPixelRatio(),o=e*r,a=t*r;return Math.min(o>n?n/o:1,a>i?i/a:1)*r}getPixelRatio(){var e;return null!=(e=this._overridePixelRatio)?e:devicePixelRatio}setPixelRatio(e){this._overridePixelRatio=e,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(e){return this.transform.setMaxBounds(W.convert(e)),this._update()}setMinZoom(e){if((e=null==e?-2:e)>=-2&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()<e&&this.setZoom(e),this;throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(e){if((e=null==e?22:e)>=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(e){if((e=null==e?0:e)<0)throw Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this._update(),this.getPitch()<e&&this.setPitch(e),this;throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(e){if((e=null==e?60:e)>85)throw Error("maxPitch must be less than or equal to 85");if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e&&this.setPitch(e),this;throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){return this.transform.renderWorldCopies=e,this._update()}project(e){return this.transform.locationPoint(t.M.convert(e),this.style&&this.terrain)}unproject(e){return this.transform.pointLocation(t.P.convert(e),this.terrain)}isMoving(){var e;return this._moving||(null==(e=this.handlers)?void 0:e.isMoving())}isZooming(){var e;return this._zooming||(null==(e=this.handlers)?void 0:e.isZooming())}isRotating(){var e;return this._rotating||(null==(e=this.handlers)?void 0:e.isRotating())}_createDelegatedListener(e,t,n){if("mouseenter"===e||"mouseover"===e){let i=!1,r=r=>{let o=this.getLayer(t)?this.queryRenderedFeatures(r.point,{layers:[t]}):[];o.length?i||(i=!0,n.call(this,new n$(e,this,r.originalEvent,{features:o}))):i=!1};return{layer:t,listener:n,delegates:{mousemove:r,mouseout:()=>{i=!1}}}}if("mouseleave"===e||"mouseout"===e){let i=!1,r=r=>{(this.getLayer(t)?this.queryRenderedFeatures(r.point,{layers:[t]}):[]).length?i=!0:i&&(i=!1,n.call(this,new n$(e,this,r.originalEvent)))},o=t=>{i&&(i=!1,n.call(this,new n$(e,this,t.originalEvent)))};return{layer:t,listener:n,delegates:{mousemove:r,mouseout:o}}}{let i=e=>{let i=this.getLayer(t)?this.queryRenderedFeatures(e.point,{layers:[t]}):[];i.length&&(e.features=i,n.call(this,e),delete e.features)};return{layer:t,listener:n,delegates:{[e]:i}}}}on(e,t,n){if(void 0===n)return super.on(e,t);let i=this._createDelegatedListener(e,t,n);for(let t in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(i),i.delegates)this.on(t,i.delegates[t]);return this}once(e,t,n){if(void 0===n)return super.once(e,t);let i=this._createDelegatedListener(e,t,n);for(let e in i.delegates)this.once(e,i.delegates[e]);return this}off(e,t,n){return void 0===n?super.off(e,t):(this._delegatedListeners&&this._delegatedListeners[e]&&(i=>{let r=this._delegatedListeners[e];for(let e=0;e<r.length;e++){let i=r[e];if(i.layer===t&&i.listener===n){for(let e in i.delegates)this.off(e,i.delegates[e]);return r.splice(e,1),this}}})(),this)}queryRenderedFeatures(e,n){let i;if(!this.style)return[];let r=e instanceof t.P||Array.isArray(e),o=r?e:[[0,0],[this.transform.width,this.transform.height]];if(n=n||(r?{}:e)||{},o instanceof t.P||"number"==typeof o[0])i=[t.P.convert(o)];else{let e=t.P.convert(o[0]),n=t.P.convert(o[1]);i=[e,new t.P(n.x,e.y),n,new t.P(e.x,n.y),e]}return this.style.queryRenderedFeatures(i,n,this.transform)}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}setStyle(e,n){return!1!==(n=t.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},n)).diff&&n.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,n),this):(this._localIdeographFontFamily=n.localIdeographFontFamily,this._updateStyle(e,n))}setTransformRequest(e){return this._requestManager.setTransformRequest(e),this}_getUIString(e){let t=this._locale[e];if(null==t)throw Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){if(t.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(e,t));let n=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!e)),e?(this.style=new e0(this,t||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof e?this.style.loadURL(e,t,n):this.style.loadJSON(e,t,n)):delete this.style,this}_lazyInitEmptyStyle(){this.style||(this.style=new e0(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(e,n){if("string"==typeof e){let i=this._requestManager.transformRequest(e,k.Style);t.h(i,new AbortController).then(e=>{this._updateDiff(e.data,n)}).catch(e=>{e&&this.fire(new t.j(e))})}else"object"==typeof e&&this._updateDiff(e,n)}_updateDiff(e,n){try{this.style.setState(e,n)&&this._update(!0)}catch(i){t.w(`Unable to perform style diff: ${i.message||i.error||i}. Rebuilding the style from scratch.`),this._updateStyle(e,n)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():t.w("There is no style added to the map.")}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(e){let n=this.style&&this.style.sourceCaches[e];if(void 0!==n)return n.loaded();this.fire(new t.j(Error(`There is no source with ID '${e}'`)))}setTerrain(e){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),e){let n=this.style.sourceCaches[e.source];if(!n)throw Error(`cannot load terrain, because there exists no source with ID: ${e.source}`);for(let i in null===this.terrain&&n.reload(),this.style._layers){let n=this.style._layers[i];"hillshade"===n.type&&n.source===e.source&&t.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new iA(this.painter,n,e),this.painter.renderToTexture=new iS(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=t=>{"style"===t.dataType?this.terrain.sourceCache.freeRtt():"source"===t.dataType&&t.tile&&(t.sourceId!==e.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(t.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new t.k("terrain",{terrain:e})),this}getTerrain(){var e,t;return null!=(t=null==(e=this.terrain)?void 0:e.options)?t:null}areTilesLoaded(){let e=this.style&&this.style.sourceCaches;for(let t in e){let n=e[t]._tiles;for(let e in n){let t=n[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}}return!0}removeSource(e){return this.style.removeSource(e),this._update(!0)}getSource(e){return this.style.getSource(e)}addImage(e,n,i={}){let{pixelRatio:r=1,sdf:o=!1,stretchX:a,stretchY:s,content:l}=i;if(this._lazyInitEmptyStyle(),!(n instanceof HTMLImageElement||t.b(n))){if(void 0===n.width||void 0===n.height)return this.fire(new t.j(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`")));{let{width:i,height:c,data:d}=n;return this.style.addImage(e,{data:new t.R({width:i,height:c},new Uint8Array(d)),pixelRatio:r,stretchX:a,stretchY:s,content:l,sdf:o,version:0,userImage:n}),n.onAdd&&n.onAdd(this,e),this}}{let{width:i,height:c,data:d}=u.getImageData(n);this.style.addImage(e,{data:new t.R({width:i,height:c},d),pixelRatio:r,stretchX:a,stretchY:s,content:l,sdf:o,version:0})}}updateImage(e,n){let i=this.style.getImage(e);if(!i)return this.fire(new t.j(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:r,height:o,data:a}=n instanceof HTMLImageElement||t.b(n)?u.getImageData(n):n;if(void 0===r||void 0===o)return this.fire(new t.j(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(r!==i.data.width||o!==i.data.height)return this.fire(new t.j(Error("The width and height of the updated image must be that same as the previous version of the image")));let s=!(n instanceof HTMLImageElement||t.b(n));return i.data.replace(a,s),this.style.updateImage(e,i),this}getImage(e){return this.style.getImage(e)}hasImage(e){return e?!!this.style.getImage(e):(this.fire(new t.j(Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}loadImage(e){return F.getImage(this._requestManager.transformRequest(e,k.Image),new AbortController)}listImages(){return this.style.listImages()}addLayer(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}moveLayer(e,t){return this.style.moveLayer(e,t),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){return this.style.getLayer(e)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(e,t,n){return this.style.setLayerZoomRange(e,t,n),this._update(!0)}setFilter(e,t,n={}){return this.style.setFilter(e,t,n),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,n,i={}){return this.style.setPaintProperty(e,t,n,i),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,n,i={}){return this.style.setLayoutProperty(e,t,n,i),this._update(!0)}getLayoutProperty(e,t){return this.style.getLayoutProperty(e,t)}setGlyphs(e,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(e,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(e,t,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(e,t,n,e=>{e||this._update(!0)}),this}removeSprite(e){return this._lazyInitEmptyStyle(),this.style.removeSprite(e),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(e,t,e=>{e||this._update(!0)}),this}setLight(e,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(e,t){return this.style.setFeatureState(e,t),this._update()}removeFeatureState(e,t){return this.style.removeFeatureState(e,t),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let e=0,t=0;return this._container&&(e=this._container.clientWidth||400,t=this._container.clientHeight||300),[e,t]}_setupContainer(){let e=this._container;e.classList.add("maplibregl-map");let t=this._canvasContainer=h.create("div","maplibregl-canvas-container",e);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=h.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");let n=this._containerDimensions(),i=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],i);let r=this._controlContainer=h.create("div","maplibregl-control-container",e),o=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(e=>{o[e]=h.create("div",`maplibregl-ctrl-${e} `,r)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(e,t,n){this._canvas.width=Math.floor(n*e),this._canvas.height=Math.floor(n*t),this._canvas.style.width=`${e}px`,this._canvas.style.height=`${t}px`}_setupPainter(){let e={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},t=null;this._canvas.addEventListener("webglcontextcreationerror",n=>{t={requestedAttributes:e},n&&(t.statusMessage=n.statusMessage,t.type=n.type)},{once:!0});let n=this._canvas.getContext("webgl2",e)||this._canvas.getContext("webgl",e);if(!n){let e="Failed to initialize WebGL";throw t?(t.message=e,Error(JSON.stringify(t))):Error(e)}this.painter=new nw(n,this.transform),m.testSupport(n)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){return this.style&&this.style._loaded&&(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint()),this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_render(e){let n=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),this._removed)return;let i=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let e=this.transform.zoom,r=u.now();this.style.zoomHistory.update(e,r);let o=new t.a8(e,{now:r,fadeDuration:n,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),a=o.crossFadingFactor();1===a&&a===this._crossFadingFactor||(i=!0,this._crossFadingFactor=a),this.style.update(o)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,n,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:n,showPadding:this.showPadding}),this.fire(new t.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,t.bc.mark(t.bd.load),this.fire(new t.k("load"))),this.style&&(this.style.hasTransitions()||i)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let r=this._sourcesDirty||this._styleDirty||this._placementDirty;return r||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.k("idle")),!this._loaded||this._fullyLoaded||r||(this._fullyLoaded=!0,t.bc.mark(t.bd.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var e;for(let e of(this._hash&&this._hash.remove(),this._controls))e.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),"undefined"!=typeof window&&removeEventListener("online",this._onWindowOnline,!1),F.removeThrottleControl(this._imageQueueHandle),null==(e=this._resizeObserver)||e.disconnect();let n=this.painter.context.gl.getExtension("WEBGL_lose_context");n&&n.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),h.remove(this._canvasContainer),h.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),t.bc.clearMetrics(),this._removed=!0,this.fire(new t.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,u.frameAsync(this._frameRequest).then(e=>{t.bc.frame(e),this._frameRequest=null,this._render(e)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get version(){return d}getCameraTargetElevation(){return this.transform.elevation}},e.MapMouseEvent=n$,e.MapTouchEvent=nN,e.MapWheelEvent=nB,e.Marker=iN,e.NavigationControl=class{constructor(e){this._updateZoomButtons=()=>{let e=this._map.getZoom(),t=e===this._map.getMaxZoom(),n=e===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())},this._rotateCompassArrow=()=>{let e=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=e},this._setButtonTitle=(e,t)=>{let n=this._map._getUIString(`NavigationControl.${t}`);e.title=n,e.setAttribute("aria-label",n)},this.options=t.e({},iI,e),this._container=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",e=>this._map.zoomIn({},{originalEvent:e})),h.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",e=>this._map.zoomOut({},{originalEvent:e})),h.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})}),this._compassIcon=h.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new iR(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){h.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(e,t){let n=h.create("button",e,this._container);return n.type="button",n.addEventListener("click",t),n}},e.Popup=class extends t.E{constructor(e){super(),this.remove=()=>(this._content&&h.remove(this._content),this._container&&(h.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new t.k("close"))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{var n;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=h.create("div","maplibregl-popup",this._map.getContainer()),this._tip=h.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let e of this.options.className.split(" "))this._container.classList.add(e);this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?iO(this._lngLat,this._flatPos,this._map.transform):null==(n=this._lngLat)?void 0:n.wrap(),this._trackPointer&&!e)return;let i=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationPoint(this._lngLat));let r=this.options.anchor,o=function e(n){if(n){if("number"==typeof n){let e=Math.round(Math.abs(n)/Math.SQRT2);return{center:new t.P(0,0),top:new t.P(0,n),"top-left":new t.P(e,e),"top-right":new t.P(-e,e),bottom:new t.P(0,-n),"bottom-left":new t.P(e,-e),"bottom-right":new t.P(-e,-e),left:new t.P(n,0),right:new t.P(-n,0)}}if(n instanceof t.P||Array.isArray(n)){let e=t.P.convert(n);return{center:e,top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}return{center:t.P.convert(n.center||[0,0]),top:t.P.convert(n.top||[0,0]),"top-left":t.P.convert(n["top-left"]||[0,0]),"top-right":t.P.convert(n["top-right"]||[0,0]),bottom:t.P.convert(n.bottom||[0,0]),"bottom-left":t.P.convert(n["bottom-left"]||[0,0]),"bottom-right":t.P.convert(n["bottom-right"]||[0,0]),left:t.P.convert(n.left||[0,0]),right:t.P.convert(n.right||[0,0])}}return e(new t.P(0,0))}(this.options.offset);if(!r){let e,t=this._container.offsetWidth,n=this._container.offsetHeight;e=i.y+o.bottom.y<n?["top"]:i.y>this._map.transform.height-n?["bottom"]:[],i.x<t/2?e.push("left"):i.x>this._map.transform.width-t/2&&e.push("right"),r=0===e.length?"bottom":e.join("-")}let a=i.add(o[r]);this.options.subpixelPositioning||(a=a.round()),h.setTransform(this._container,`${iP[r]} translate(${a.x}px,${a.y}px)`),i$(this._container,r,"popup")},this._onClose=()=>{this.remove()},this.options=t.e(Object.create(iV),e)}addTo(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new t.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=t.M.convert(e),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){let t,n=document.createDocumentFragment(),i=document.createElement("body");for(i.innerHTML=e;t=i.firstChild;)n.appendChild(t);return this.setDOMContent(n)}getMaxWidth(){var e;return null==(e=this._container)?void 0:e.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=h.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(e){this._container&&this._container.classList.add(e)}removeClassName(e){this._container&&this._container.classList.remove(e)}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){if(this._container)return this._container.classList.toggle(e)}setSubpixelPositioning(e){this.options.subpixelPositioning=e}_createCloseButton(){this.options.closeButton&&(this._closeButton=h.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let e=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])");e&&e.focus()}},e.RasterDEMTileSource=X,e.RasterTileSource=K,e.ScaleControl=class{constructor(e){this._onMove=()=>{iH(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,iH(this._map,this._container,this.options)},this.options=t.e({},iY,e)}getDefaultPosition(){return"bottom-left"}onAdd(e){return this._map=e,this._container=h.create("div","maplibregl-ctrl maplibregl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){h.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},e.ScrollZoomHandler=ia,e.Style=e0,e.TerrainControl=class{constructor(e){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=e}onAdd(e){return this._map=e,this._container=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=h.create("button","maplibregl-ctrl-terrain",this._container),h.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(){h.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},e.TwoFingersTouchPitchHandler=n9,e.TwoFingersTouchRotateHandler=n8,e.TwoFingersTouchZoomHandler=n4,e.TwoFingersTouchZoomRotateHandler=ih,e.VectorTileSource=q,e.VideoSource=ee,e.addSourceType=(e,n)=>t._(void 0,void 0,void 0,function*(){if(ei(e))throw Error(`A source type called "${e}" already exists.`);en[e]=n}),e.clearPrewarmedResources=function(){let e=o;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(N),o=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},e.getMaxParallelImageRequests=function(){return t.a.MAX_PARALLEL_IMAGE_REQUESTS},e.getRTLTextPluginStatus=function(){return es().getRTLTextPluginStatus()},e.getVersion=function(){return d},e.getWorkerCount=function(){return B.workerCount},e.getWorkerUrl=function(){return t.a.WORKER_URL},e.importScriptInWorkers=function(e){return H().broadcast("importScript",e)},e.prewarm=function(){j().acquire(N)},e.setMaxParallelImageRequests=function(e){t.a.MAX_PARALLEL_IMAGE_REQUESTS=e},e.setRTLTextPlugin=function(e,t){return es().setRTLTextPlugin(e,t)},e.setWorkerCount=function(e){B.workerCount=e},e.setWorkerUrl=function(e){t.a.WORKER_URL=e}}),e}()},75548:function(e){"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},5430:function(e){"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={id:i,loaded:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;n.t=function(i,r){if(1&r&&(i=this(i)),8&r||"object"==typeof i&&i&&(4&r&&i.__esModule||16&r&&"function"==typeof i.then))return i;var o=Object.create(null);n.r(o);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&i;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>{a[e]=()=>i[e]});return a.default=()=>i,n.d(o,a),o}})(),n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var i={};return(()=>{"use strict";let e,t,r;n.r(i),n.d(i,{getHelperText:()=>uO,OrAttributeInput:()=>uN,OrAttributeInputChangedEvent:()=>uI,jsonFormsInputTemplateProvider:()=>u$,getAttributeInputWrapper:()=>uR});let o=globalThis,a=o.ShadowRoot&&(void 0===o.ShadyCSS||o.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),l=new WeakMap;class c{constructor(e,t,n){if(this._$cssResult$=!0,n!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(a&&void 0===e){let n=void 0!==t&&1===t.length;n&&(e=l.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&l.set(t,e))}return e}toString(){return this.cssText}}let d=e=>new c("string"==typeof e?e:e+"",void 0,s),u=(e,...t)=>new c(1===e.length?e[0]:t.reduce((t,n,i)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[i+1],e[0]),e,s),h=a?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return d(t)})(e):e,{is:m,defineProperty:f,getOwnPropertyDescriptor:p,getOwnPropertyNames:g,getOwnPropertySymbols:b,getPrototypeOf:_}=Object,y=globalThis,v=y.trustedTypes,x=v?v.emptyScript:"",w=y.reactiveElementPolyfillSupport,F={toAttribute(e,t){switch(t){case Boolean:e=e?x:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},k=(e,t)=>!m(e,t),E={attribute:!0,type:String,converter:F,reflect:!1,useDefault:!1,hasChanged:k};Symbol.metadata??=Symbol("metadata"),y.litPropertyMetadata??=new WeakMap;class A extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=E){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),i=this.getPropertyDescriptor(e,n,t);void 0!==i&&f(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){let{get:i,set:r}=p(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:i,set(t){let o=i?.call(this);r?.call(this,t),this.requestUpdate(e,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??E}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;let e=_(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){let e=this.properties;for(let t of[...g(e),...b(e)])this.createProperty(t,e[t])}let e=this[Symbol.metadata];if(null!==e){let t=litPropertyMetadata.get(e);if(void 0!==t)for(let[e,n]of t)this.elementProperties.set(e,n)}for(let[e,t]of(this._$Eh=new Map,this.elementProperties)){let n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e))for(let n of new Set(e.flat(1/0).reverse()))t.unshift(h(n));else void 0!==e&&t.push(h(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.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(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map;for(let t of this.constructor.elementProperties.keys())this.hasOwnProperty(t)&&(e.set(t,this[t]),delete this[t]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(a)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of t){let t=document.createElement("style"),i=o.litNonce;void 0!==i&&t.setAttribute("nonce",i),t.textContent=n.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(void 0!==i&&!0===n.reflect){let r=(void 0!==n.converter?.toAttribute?n.converter:F).toAttribute(t,n.type);this._$Em=e,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(e,t){let n=this.constructor,i=n._$Eh.get(e);if(void 0!==i&&this._$Em!==i){let e=n.getPropertyOptions(i),r="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:F;this._$Em=i;let o=r.fromAttribute(t,e.type);this[i]=o??this._$Ej?.get(i)??o,this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){let i=this.constructor,r=this[e];if(!(((n??=i.getPropertyOptions(e)).hasChanged??k)(r,t)||n.useDefault&&n.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:i,wrapped:r},o){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),!0!==r||void 0!==o)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,i=this[t];!0!==e||this._$AL.has(t)||void 0===i||this.C(t,void 0,n,i)}}let e=!1,t=this._$AL;try{(e=this.shouldUpdate(t))?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}}A.elementStyles=[],A.shadowRootOptions={mode:"open"},A.elementProperties=new Map,A.finalized=new Map,w?.({ReactiveElement:A}),(y.reactiveElementVersions??=[]).push("2.1.1");let C=globalThis,T=C.trustedTypes,S=T?T.createPolicy("lit-html",{createHTML:e=>e}):void 0,M="$lit$",D=`lit$${Math.random().toFixed(9).slice(2)}$`,I="?"+D,R=`<${I}>`,O=document,P=()=>O.createComment(""),$=e=>null===e||"object"!=typeof e&&"function"!=typeof e,N=Array.isArray,B=e=>N(e)||"function"==typeof e?.[Symbol.iterator],z="[ \n\f\r]",j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Y=/-->/g,H=/>/g,U=RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^
|
|
57
|
+
`}),staticAttributes:i,staticUniforms:a}}class e4{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,t,n,i,r,o,a,s,l){this.context=e;let c=this.boundPaintVertexBuffers.length!==i.length;for(let e=0;!c&&e<i.length;e++)this.boundPaintVertexBuffers[e]!==i[e]&&(c=!0);!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==n||c||this.boundIndexBuffer!==r||this.boundVertexOffset!==o||this.boundDynamicVertexBuffer!==a||this.boundDynamicVertexBuffer2!==s||this.boundDynamicVertexBuffer3!==l?this.freshBind(t,n,i,r,o,a,s,l):(e.bindVertexArray.set(this.vao),a&&a.bind(),r&&r.dynamicDraw&&r.bind(),s&&s.bind(),l&&l.bind())}freshBind(e,t,n,i,r,o,a,s){let l=e.numAttributes,c=this.context,d=c.gl;for(let l of(this.vao&&this.destroy(),this.vao=c.createVertexArray(),c.bindVertexArray.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=i,this.boundVertexOffset=r,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=a,this.boundDynamicVertexBuffer3=s,t.enableAttributes(d,e),n))l.enableAttributes(d,e);for(let i of(o&&o.enableAttributes(d,e),a&&a.enableAttributes(d,e),s&&s.enableAttributes(d,e),t.bind(),t.setVertexAttribPointers(d,e,r),n))i.bind(),i.setVertexAttribPointers(d,e,r);o&&(o.bind(),o.setVertexAttribPointers(d,e,r)),i&&i.bind(),a&&(a.bind(),a.setVertexAttribPointers(d,e,r)),s&&(s.bind(),s.setVertexAttribPointers(d,e,r)),c.currentNumAttributes=l}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}function e6(e){let t=[];for(let n=0;n<e.length;n++){if(null===e[n])continue;let i=e[n].split(" ");t.push(i.pop())}return t}class e8{constructor(e,n,i,r,o,a){let s=e.gl;this.program=s.createProgram();let l=e6(n.staticAttributes),c=i?i.getBinderAttributes():[],d=l.concat(c),u=e5.prelude.staticUniforms?e6(e5.prelude.staticUniforms):[],h=n.staticUniforms?e6(n.staticUniforms):[],m=i?i.getBinderUniforms():[],f=u.concat(h).concat(m),p=[];for(let e of f)0>p.indexOf(e)&&p.push(e);let g=i?i.defines():[];o&&g.push("#define OVERDRAW_INSPECTOR;"),a&&g.push("#define TERRAIN3D;");let b=g.concat(e5.prelude.fragmentSource,n.fragmentSource).join("\n"),_=g.concat(e5.prelude.vertexSource,n.vertexSource).join("\n"),y=s.createShader(s.FRAGMENT_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);if(s.shaderSource(y,b),s.compileShader(y),!s.getShaderParameter(y,s.COMPILE_STATUS))throw Error(`Could not compile fragment shader: ${s.getShaderInfoLog(y)}`);s.attachShader(this.program,y);let v=s.createShader(s.VERTEX_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);if(s.shaderSource(v,_),s.compileShader(v),!s.getShaderParameter(v,s.COMPILE_STATUS))throw Error(`Could not compile vertex shader: ${s.getShaderInfoLog(v)}`);s.attachShader(this.program,v),this.attributes={};let x={};this.numAttributes=d.length;for(let e=0;e<this.numAttributes;e++)d[e]&&(s.bindAttribLocation(this.program,e,d[e]),this.attributes[d[e]]=e);if(s.linkProgram(this.program),!s.getProgramParameter(this.program,s.LINK_STATUS))throw Error(`Program failed to link: ${s.getProgramInfoLog(this.program)}`);s.deleteShader(v),s.deleteShader(y);for(let e=0;e<p.length;e++){let t=p[e];if(t&&!x[t]){let e=s.getUniformLocation(this.program,t);e&&(x[t]=e)}}this.fixedUniforms=r(e,x),this.terrainUniforms=((e,n)=>({u_depth:new t.aG(e,n.u_depth),u_terrain:new t.aG(e,n.u_terrain),u_terrain_dim:new t.aH(e,n.u_terrain_dim),u_terrain_matrix:new t.aI(e,n.u_terrain_matrix),u_terrain_unpack:new t.aJ(e,n.u_terrain_unpack),u_terrain_exaggeration:new t.aH(e,n.u_terrain_exaggeration)}))(e,x),this.binderUniforms=i?i.getUniforms(e,x):[]}draw(e,t,n,i,r,o,a,s,l,c,d,u,h,m,f,p,g,b){let _=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(n),e.setStencilMode(i),e.setColorMode(r),e.setCullFace(o),s)for(let t in e.activeTexture.set(_.TEXTURE2),_.bindTexture(_.TEXTURE_2D,s.depthTexture),e.activeTexture.set(_.TEXTURE3),_.bindTexture(_.TEXTURE_2D,s.texture),this.terrainUniforms)this.terrainUniforms[t].set(s[t]);for(let e in this.fixedUniforms)this.fixedUniforms[e].set(a[e]);f&&f.setUniforms(e,this.binderUniforms,h,{zoom:m});let y=0;switch(t){case _.LINES:y=2;break;case _.TRIANGLES:y=3;break;case _.LINE_STRIP:y=1}for(let n of u.get()){let i=n.vaos||(n.vaos={});(i[l]||(i[l]=new e4)).bind(e,this,c,f?f.getPaintVertexBuffers():[],d,n.vertexOffset,p,g,b),_.drawElements(t,n.primitiveLength*y,_.UNSIGNED_SHORT,n.primitiveOffset*y*2)}}}function e7(e,t,n){let i=1/eD(n,1,t.transform.tileZoom),r=Math.pow(2,n.tileID.overscaledZ),o=n.tileSize*Math.pow(2,t.transform.tileZoom)/r,a=o*(n.tileID.canonical.x+n.tileID.wrap*r),s=o*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[i,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[a>>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}let e9=(e,n,i,r)=>{var o,a,s,l,c,d,u;let h=n.style.light,m=h.properties.get("position"),f=[m.x,m.y,m.z],p=(o=new t.A(9),t.A!=Float32Array&&(o[1]=0,o[2]=0,o[3]=0,o[5]=0,o[6]=0,o[7]=0),o[0]=1,o[4]=1,o[8]=1,o);"viewport"===h.properties.get("anchor")&&(s=Math.sin(a=-n.transform.angle),l=Math.cos(a),p[0]=l,p[1]=s,p[2]=0,p[3]=-s,p[4]=l,p[5]=0,p[6]=0,p[7]=0,p[8]=1),c=f[0],d=f[1],u=f[2],f[0]=c*p[0]+d*p[3]+u*p[6],f[1]=c*p[1]+d*p[4]+u*p[7],f[2]=c*p[2]+d*p[5]+u*p[8];let g=h.properties.get("color");return{u_matrix:e,u_lightpos:f,u_lightintensity:h.properties.get("intensity"),u_lightcolor:[g.r,g.g,g.b],u_vertical_gradient:+i,u_opacity:r}},te=(e,n,i,r,o,a,s)=>t.e(e9(e,n,i,r),e7(a,n,s),{u_height_factor:-Math.pow(2,o.overscaledZ)/s.tileSize/8}),tt=e=>({u_matrix:e}),tn=(e,n,i,r)=>t.e(tt(e),e7(i,n,r)),ti=(e,t)=>({u_matrix:e,u_world:t}),tr=(e,n,i,r,o)=>t.e(tn(e,n,i,r),{u_world:o}),to=(e,t,n,i)=>{let r,o,a=e.transform;if("map"===i.paint.get("circle-pitch-alignment")){let e=eD(n,1,a.zoom);r=!0,o=[e,e]}else r=!1,o=a.pixelsToGLUnits;return{u_camera_to_center_distance:a.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(t.posMatrix,n,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+r,u_device_pixel_ratio:e.pixelRatio,u_extrude_scale:o}},ta=(e,t,n)=>{let i=eD(n,1,t.zoom),r=Math.pow(2,t.zoom-n.tileID.overscaledZ),o=n.tileID.overscaleFactor();return{u_matrix:e,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:i,u_extrude_scale:[t.pixelsToGLUnits[0]/(i*r),t.pixelsToGLUnits[1]/(i*r)],u_overscale_factor:o}},ts=(e,t,n=1)=>({u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:n}),tl=e=>({u_matrix:e}),tc=(e,t,n,i)=>({u_matrix:e,u_extrude_scale:eD(t,1,n),u_intensity:i}),td=(e,t,n,i)=>{let r=e.transform;return{u_matrix:tp(e,t,n,i),u_ratio:1/eD(t,1,r.zoom),u_device_pixel_ratio:e.pixelRatio,u_units_to_pixels:[1/r.pixelsToGLUnits[0],1/r.pixelsToGLUnits[1]]}},tu=(e,n,i,r,o)=>t.e(td(e,n,i,o),{u_image:0,u_image_height:r}),th=(e,t,n,i,r)=>{let o=e.transform,a=tf(t,o);return{u_matrix:tp(e,t,n,r),u_texsize:t.imageAtlasTexture.size,u_ratio:1/eD(t,1,o.zoom),u_device_pixel_ratio:e.pixelRatio,u_image:0,u_scale:[a,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},tm=(e,n,i,r,o,a)=>{let s=e.lineAtlas,l=tf(n,e.transform),c="round"===i.layout.get("line-cap"),d=s.getDash(r.from,c),u=s.getDash(r.to,c),h=d.width*o.fromScale,m=u.width*o.toScale;return t.e(td(e,n,i,a),{u_patternscale_a:[l/h,-d.height/2],u_patternscale_b:[l/m,-u.height/2],u_sdfgamma:s.width/(256*Math.min(h,m)*e.pixelRatio)/2,u_image:0,u_tex_y_a:d.y,u_tex_y_b:u.y,u_mix:o.t})};function tf(e,t){return 1/eD(e,1,t.tileZoom)}function tp(e,t,n,i){return e.translatePosMatrix(i?i.posMatrix:t.tileID.posMatrix,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}let tg=(e,t,n,i,r)=>{var o,a;return{u_matrix:e,u_tl_parent:t,u_scale_parent:n,u_buffer_scale:1,u_fade_t:i.mix,u_opacity:i.opacity*r.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:r.paint.get("raster-brightness-min"),u_brightness_high:r.paint.get("raster-brightness-max"),u_saturation_factor:(a=r.paint.get("raster-saturation"))>0?1-1/(1.001-a):-a,u_contrast_factor:(o=r.paint.get("raster-contrast"))>0?1/(1-o):1+o,u_spin_weights:function(e){let t=Math.sin(e*=Math.PI/180),n=Math.cos(e);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}(r.paint.get("raster-hue-rotate"))}},tb=(e,t,n,i,r,o,a,s,l,c)=>{let d=r.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:d.cameraToCenterDistance,u_pitch:d.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:d.width/d.height,u_fade_change:r.options.fadeDuration?r.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+i,u_texsize:c,u_texture:0}},t_=(e,n,i,r,o,a,s,l,c,d,u)=>{let h=o.transform;return t.e(tb(e,n,i,r,o,a,s,l,c,d),{u_gamma_scale:r?Math.cos(h._pitch)*h.cameraToCenterDistance:1,u_device_pixel_ratio:o.pixelRatio,u_is_halo:+u})},ty=(e,n,i,r,o,a,s,l,c,d)=>t.e(t_(e,n,i,r,o,a,s,l,!0,c,!0),{u_texsize_icon:d,u_texture_icon:1}),tv=(e,t,n)=>({u_matrix:e,u_opacity:t,u_color:n}),tx=(e,n,i,r,o,a)=>t.e(function(e,t,n,i){let r=n.imageManager.getPattern(e.from.toString()),o=n.imageManager.getPattern(e.to.toString()),{width:a,height:s}=n.imageManager.getPixelSize(),l=Math.pow(2,i.tileID.overscaledZ),c=i.tileSize*Math.pow(2,n.transform.tileZoom)/l,d=c*(i.tileID.canonical.x+i.tileID.wrap*l),u=c*i.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:r.tl,u_pattern_br_a:r.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[a,s],u_mix:t.t,u_pattern_size_a:r.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/eD(i,1,n.transform.tileZoom),u_pixel_coord_upper:[d>>16,u>>16],u_pixel_coord_lower:[65535&d,65535&u]}}(r,a,i,o),{u_matrix:e,u_opacity:n}),tw={fillExtrusion:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_lightpos:new t.aK(e,n.u_lightpos),u_lightintensity:new t.aH(e,n.u_lightintensity),u_lightcolor:new t.aK(e,n.u_lightcolor),u_vertical_gradient:new t.aH(e,n.u_vertical_gradient),u_opacity:new t.aH(e,n.u_opacity)}),fillExtrusionPattern:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_lightpos:new t.aK(e,n.u_lightpos),u_lightintensity:new t.aH(e,n.u_lightintensity),u_lightcolor:new t.aK(e,n.u_lightcolor),u_vertical_gradient:new t.aH(e,n.u_vertical_gradient),u_height_factor:new t.aH(e,n.u_height_factor),u_image:new t.aG(e,n.u_image),u_texsize:new t.aL(e,n.u_texsize),u_pixel_coord_upper:new t.aL(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.aL(e,n.u_pixel_coord_lower),u_scale:new t.aK(e,n.u_scale),u_fade:new t.aH(e,n.u_fade),u_opacity:new t.aH(e,n.u_opacity)}),fill:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix)}),fillPattern:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_image:new t.aG(e,n.u_image),u_texsize:new t.aL(e,n.u_texsize),u_pixel_coord_upper:new t.aL(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.aL(e,n.u_pixel_coord_lower),u_scale:new t.aK(e,n.u_scale),u_fade:new t.aH(e,n.u_fade)}),fillOutline:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_world:new t.aL(e,n.u_world)}),fillOutlinePattern:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_world:new t.aL(e,n.u_world),u_image:new t.aG(e,n.u_image),u_texsize:new t.aL(e,n.u_texsize),u_pixel_coord_upper:new t.aL(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.aL(e,n.u_pixel_coord_lower),u_scale:new t.aK(e,n.u_scale),u_fade:new t.aH(e,n.u_fade)}),circle:(e,n)=>({u_camera_to_center_distance:new t.aH(e,n.u_camera_to_center_distance),u_scale_with_map:new t.aG(e,n.u_scale_with_map),u_pitch_with_map:new t.aG(e,n.u_pitch_with_map),u_extrude_scale:new t.aL(e,n.u_extrude_scale),u_device_pixel_ratio:new t.aH(e,n.u_device_pixel_ratio),u_matrix:new t.aI(e,n.u_matrix)}),collisionBox:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_camera_to_center_distance:new t.aH(e,n.u_camera_to_center_distance),u_pixels_to_tile_units:new t.aH(e,n.u_pixels_to_tile_units),u_extrude_scale:new t.aL(e,n.u_extrude_scale),u_overscale_factor:new t.aH(e,n.u_overscale_factor)}),collisionCircle:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_inv_matrix:new t.aI(e,n.u_inv_matrix),u_camera_to_center_distance:new t.aH(e,n.u_camera_to_center_distance),u_viewport_size:new t.aL(e,n.u_viewport_size)}),debug:(e,n)=>({u_color:new t.aM(e,n.u_color),u_matrix:new t.aI(e,n.u_matrix),u_overlay:new t.aG(e,n.u_overlay),u_overlay_scale:new t.aH(e,n.u_overlay_scale)}),clippingMask:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix)}),heatmap:(e,n)=>({u_extrude_scale:new t.aH(e,n.u_extrude_scale),u_intensity:new t.aH(e,n.u_intensity),u_matrix:new t.aI(e,n.u_matrix)}),heatmapTexture:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_world:new t.aL(e,n.u_world),u_image:new t.aG(e,n.u_image),u_color_ramp:new t.aG(e,n.u_color_ramp),u_opacity:new t.aH(e,n.u_opacity)}),hillshade:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_image:new t.aG(e,n.u_image),u_latrange:new t.aL(e,n.u_latrange),u_light:new t.aL(e,n.u_light),u_shadow:new t.aM(e,n.u_shadow),u_highlight:new t.aM(e,n.u_highlight),u_accent:new t.aM(e,n.u_accent)}),hillshadePrepare:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_image:new t.aG(e,n.u_image),u_dimension:new t.aL(e,n.u_dimension),u_zoom:new t.aH(e,n.u_zoom),u_unpack:new t.aJ(e,n.u_unpack)}),line:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_ratio:new t.aH(e,n.u_ratio),u_device_pixel_ratio:new t.aH(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.aL(e,n.u_units_to_pixels)}),lineGradient:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_ratio:new t.aH(e,n.u_ratio),u_device_pixel_ratio:new t.aH(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.aL(e,n.u_units_to_pixels),u_image:new t.aG(e,n.u_image),u_image_height:new t.aH(e,n.u_image_height)}),linePattern:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_texsize:new t.aL(e,n.u_texsize),u_ratio:new t.aH(e,n.u_ratio),u_device_pixel_ratio:new t.aH(e,n.u_device_pixel_ratio),u_image:new t.aG(e,n.u_image),u_units_to_pixels:new t.aL(e,n.u_units_to_pixels),u_scale:new t.aK(e,n.u_scale),u_fade:new t.aH(e,n.u_fade)}),lineSDF:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_ratio:new t.aH(e,n.u_ratio),u_device_pixel_ratio:new t.aH(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.aL(e,n.u_units_to_pixels),u_patternscale_a:new t.aL(e,n.u_patternscale_a),u_patternscale_b:new t.aL(e,n.u_patternscale_b),u_sdfgamma:new t.aH(e,n.u_sdfgamma),u_image:new t.aG(e,n.u_image),u_tex_y_a:new t.aH(e,n.u_tex_y_a),u_tex_y_b:new t.aH(e,n.u_tex_y_b),u_mix:new t.aH(e,n.u_mix)}),raster:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_tl_parent:new t.aL(e,n.u_tl_parent),u_scale_parent:new t.aH(e,n.u_scale_parent),u_buffer_scale:new t.aH(e,n.u_buffer_scale),u_fade_t:new t.aH(e,n.u_fade_t),u_opacity:new t.aH(e,n.u_opacity),u_image0:new t.aG(e,n.u_image0),u_image1:new t.aG(e,n.u_image1),u_brightness_low:new t.aH(e,n.u_brightness_low),u_brightness_high:new t.aH(e,n.u_brightness_high),u_saturation_factor:new t.aH(e,n.u_saturation_factor),u_contrast_factor:new t.aH(e,n.u_contrast_factor),u_spin_weights:new t.aK(e,n.u_spin_weights)}),symbolIcon:(e,n)=>({u_is_size_zoom_constant:new t.aG(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aG(e,n.u_is_size_feature_constant),u_size_t:new t.aH(e,n.u_size_t),u_size:new t.aH(e,n.u_size),u_camera_to_center_distance:new t.aH(e,n.u_camera_to_center_distance),u_pitch:new t.aH(e,n.u_pitch),u_rotate_symbol:new t.aG(e,n.u_rotate_symbol),u_aspect_ratio:new t.aH(e,n.u_aspect_ratio),u_fade_change:new t.aH(e,n.u_fade_change),u_matrix:new t.aI(e,n.u_matrix),u_label_plane_matrix:new t.aI(e,n.u_label_plane_matrix),u_coord_matrix:new t.aI(e,n.u_coord_matrix),u_is_text:new t.aG(e,n.u_is_text),u_pitch_with_map:new t.aG(e,n.u_pitch_with_map),u_texsize:new t.aL(e,n.u_texsize),u_texture:new t.aG(e,n.u_texture)}),symbolSDF:(e,n)=>({u_is_size_zoom_constant:new t.aG(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aG(e,n.u_is_size_feature_constant),u_size_t:new t.aH(e,n.u_size_t),u_size:new t.aH(e,n.u_size),u_camera_to_center_distance:new t.aH(e,n.u_camera_to_center_distance),u_pitch:new t.aH(e,n.u_pitch),u_rotate_symbol:new t.aG(e,n.u_rotate_symbol),u_aspect_ratio:new t.aH(e,n.u_aspect_ratio),u_fade_change:new t.aH(e,n.u_fade_change),u_matrix:new t.aI(e,n.u_matrix),u_label_plane_matrix:new t.aI(e,n.u_label_plane_matrix),u_coord_matrix:new t.aI(e,n.u_coord_matrix),u_is_text:new t.aG(e,n.u_is_text),u_pitch_with_map:new t.aG(e,n.u_pitch_with_map),u_texsize:new t.aL(e,n.u_texsize),u_texture:new t.aG(e,n.u_texture),u_gamma_scale:new t.aH(e,n.u_gamma_scale),u_device_pixel_ratio:new t.aH(e,n.u_device_pixel_ratio),u_is_halo:new t.aG(e,n.u_is_halo)}),symbolTextAndIcon:(e,n)=>({u_is_size_zoom_constant:new t.aG(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aG(e,n.u_is_size_feature_constant),u_size_t:new t.aH(e,n.u_size_t),u_size:new t.aH(e,n.u_size),u_camera_to_center_distance:new t.aH(e,n.u_camera_to_center_distance),u_pitch:new t.aH(e,n.u_pitch),u_rotate_symbol:new t.aG(e,n.u_rotate_symbol),u_aspect_ratio:new t.aH(e,n.u_aspect_ratio),u_fade_change:new t.aH(e,n.u_fade_change),u_matrix:new t.aI(e,n.u_matrix),u_label_plane_matrix:new t.aI(e,n.u_label_plane_matrix),u_coord_matrix:new t.aI(e,n.u_coord_matrix),u_is_text:new t.aG(e,n.u_is_text),u_pitch_with_map:new t.aG(e,n.u_pitch_with_map),u_texsize:new t.aL(e,n.u_texsize),u_texsize_icon:new t.aL(e,n.u_texsize_icon),u_texture:new t.aG(e,n.u_texture),u_texture_icon:new t.aG(e,n.u_texture_icon),u_gamma_scale:new t.aH(e,n.u_gamma_scale),u_device_pixel_ratio:new t.aH(e,n.u_device_pixel_ratio),u_is_halo:new t.aG(e,n.u_is_halo)}),background:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_opacity:new t.aH(e,n.u_opacity),u_color:new t.aM(e,n.u_color)}),backgroundPattern:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_opacity:new t.aH(e,n.u_opacity),u_image:new t.aG(e,n.u_image),u_pattern_tl_a:new t.aL(e,n.u_pattern_tl_a),u_pattern_br_a:new t.aL(e,n.u_pattern_br_a),u_pattern_tl_b:new t.aL(e,n.u_pattern_tl_b),u_pattern_br_b:new t.aL(e,n.u_pattern_br_b),u_texsize:new t.aL(e,n.u_texsize),u_mix:new t.aH(e,n.u_mix),u_pattern_size_a:new t.aL(e,n.u_pattern_size_a),u_pattern_size_b:new t.aL(e,n.u_pattern_size_b),u_scale_a:new t.aH(e,n.u_scale_a),u_scale_b:new t.aH(e,n.u_scale_b),u_pixel_coord_upper:new t.aL(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.aL(e,n.u_pixel_coord_lower),u_tile_units_to_pixels:new t.aH(e,n.u_tile_units_to_pixels)}),terrain:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_texture:new t.aG(e,n.u_texture),u_ele_delta:new t.aH(e,n.u_ele_delta)}),terrainDepth:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_ele_delta:new t.aH(e,n.u_ele_delta)}),terrainCoords:(e,n)=>({u_matrix:new t.aI(e,n.u_matrix),u_texture:new t.aG(e,n.u_texture),u_terrain_coords_id:new t.aH(e,n.u_terrain_coords_id),u_ele_delta:new t.aH(e,n.u_ele_delta)})};class tF{constructor(e,t,n){this.context=e;let i=e.gl;this.buffer=i.createBuffer(),this.dynamicDraw=!!n,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){let t=this.context.gl;if(!this.dynamicDraw)throw Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let tk={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class tE{constructor(e,t,n,i){this.length=t.length,this.attributes=n,this.itemSize=t.bytesPerElement,this.dynamicDraw=i,this.context=e;let r=e.gl;this.buffer=r.createBuffer(),e.bindVertexBuffer.set(this.buffer),r.bufferData(r.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);let t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,t){for(let n=0;n<this.attributes.length;n++){let i=t.attributes[this.attributes[n].name];void 0!==i&&e.enableVertexAttribArray(i)}}setVertexAttribPointers(e,t,n){for(let i=0;i<this.attributes.length;i++){let r=this.attributes[i],o=t.attributes[r.name];void 0!==o&&e.vertexAttribPointer(o,r.components,e[tk[r.type]],!1,this.itemSize,r.offset+this.itemSize*(n||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let tA=new WeakMap;function tC(e){var t;if(tA.has(e))return tA.get(e);{let n=null==(t=e.getParameter(e.VERSION))?void 0:t.startsWith("WebGL 2.0");return tA.set(e,n),n}}class tT{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class tS extends tT{getDefault(){return t.aO.transparent}set(e){let t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class tM extends tT{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class tL extends tT{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class tD extends tT{getDefault(){return[!0,!0,!0,!0]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class tI extends tT{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class tR extends tT{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class tO extends tT{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){let t=this.current;(e.func!==t.func||e.ref!==t.ref||e.mask!==t.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class tP extends tT{getDefault(){let e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class t$ extends tT{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}}class tN extends tT{getDefault(){return[0,1]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class tB extends tT{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}}class tz extends tT{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class tj extends tT{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}}class tY extends tT{getDefault(){let e=this.gl;return[e.ONE,e.ZERO]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}class tH extends tT{getDefault(){return t.aO.transparent}set(e){let t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class tU extends tT{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class tV extends tT{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}}class tW extends tT{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class tG extends tT{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}class tq extends tT{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}}class tK extends tT{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class tX extends tT{getDefault(){let e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class tZ extends tT{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class tJ extends tT{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class tQ extends tT{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class t0 extends tT{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class t1 extends tT{getDefault(){return null}set(e){let t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class t2 extends tT{getDefault(){return null}set(e){var t;if(e===this.current&&!this.dirty)return;let n=this.gl;tC(n)?n.bindVertexArray(e):null==(t=n.getExtension("OES_vertex_array_object"))||t.bindVertexArrayOES(e),this.current=e,this.dirty=!1}}class t5 extends tT{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class t3 extends tT{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class t4 extends tT{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class t6 extends tT{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}}class t8 extends t6{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class t7 extends t6{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class t9 extends t6{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class ne{constructor(e,t,n,i,r){this.context=e,this.width=t,this.height=n;let o=e.gl,a=this.framebuffer=o.createFramebuffer();if(this.colorAttachment=new t8(e,a),i)this.depthAttachment=r?new t9(e,a):new t7(e,a);else if(r)throw Error("Stencil cannot be set without depth");if(o.checkFramebufferStatus(o.FRAMEBUFFER)!==o.FRAMEBUFFER_COMPLETE)throw Error("Framebuffer is not complete")}destroy(){let e=this.context.gl,t=this.colorAttachment.get();if(t&&e.deleteTexture(t),this.depthAttachment){let t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}e.deleteFramebuffer(this.framebuffer)}}class nt{constructor(e,t,n){this.blendFunction=e,this.blendColor=t,this.mask=n}}nt.Replace=[1,0],nt.disabled=new nt(nt.Replace,t.aO.transparent,[!1,!1,!1,!1]),nt.unblended=new nt(nt.Replace,t.aO.transparent,[!0,!0,!0,!0]),nt.alphaBlended=new nt([1,771],t.aO.transparent,[!0,!0,!0,!0]);class nn{constructor(e){var t,n;if(this.gl=e,this.clearColor=new tS(this),this.clearDepth=new tM(this),this.clearStencil=new tL(this),this.colorMask=new tD(this),this.depthMask=new tI(this),this.stencilMask=new tR(this),this.stencilFunc=new tO(this),this.stencilOp=new tP(this),this.stencilTest=new t$(this),this.depthRange=new tN(this),this.depthTest=new tB(this),this.depthFunc=new tz(this),this.blend=new tj(this),this.blendFunc=new tY(this),this.blendColor=new tH(this),this.blendEquation=new tU(this),this.cullFace=new tV(this),this.cullFaceSide=new tW(this),this.frontFace=new tG(this),this.program=new tq(this),this.activeTexture=new tK(this),this.viewport=new tX(this),this.bindFramebuffer=new tZ(this),this.bindRenderbuffer=new tJ(this),this.bindTexture=new tQ(this),this.bindVertexBuffer=new t0(this),this.bindElementBuffer=new t1(this),this.bindVertexArray=new t2(this),this.pixelStoreUnpack=new t5(this),this.pixelStoreUnpackPremultiplyAlpha=new t3(this),this.pixelStoreUnpackFlipY=new t4(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),tC(e)){this.HALF_FLOAT=e.HALF_FLOAT;let i=e.getExtension("EXT_color_buffer_half_float");this.RGBA16F=null!=(t=e.RGBA16F)?t:null==i?void 0:i.RGBA16F_EXT,this.RGB16F=null!=(n=e.RGB16F)?n:null==i?void 0:i.RGB16F_EXT,e.getExtension("EXT_color_buffer_float")}else{e.getExtension("EXT_color_buffer_half_float"),e.getExtension("OES_texture_half_float_linear");let t=e.getExtension("OES_texture_half_float");this.HALF_FLOAT=null==t?void 0:t.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,t){return new tF(this,e,t)}createVertexBuffer(e,t,n){return new tE(this,e,t,n)}createRenderbuffer(e,t,n){let i=this.gl,r=i.createRenderbuffer();return this.bindRenderbuffer.set(r),i.renderbufferStorage(i.RENDERBUFFER,e,t,n),this.bindRenderbuffer.set(null),r}createFramebuffer(e,t,n,i){return new ne(this,e,t,n,i)}clear({color:e,depth:t,stencil:n}){let i=this.gl,r=0;e&&(r|=i.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==t&&(r|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),void 0!==n&&(r|=i.STENCIL_BUFFER_BIT,this.clearStencil.set(n),this.stencilMask.set(255)),i.clear(r)}setCullFace(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(e){t.aD(e.blendFunction,nt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){var e;return tC(this.gl)?this.gl.createVertexArray():null==(e=this.gl.getExtension("OES_vertex_array_object"))?void 0:e.createVertexArrayOES()}deleteVertexArray(e){var t;return tC(this.gl)?this.gl.deleteVertexArray(e):null==(t=this.gl.getExtension("OES_vertex_array_object"))?void 0:t.deleteVertexArrayOES(e)}unbindVAO(){this.bindVertexArray.set(null)}}class ni{constructor(e,t,n){this.func=e,this.mask=t,this.range=n}}ni.ReadOnly=!1,ni.ReadWrite=!0,ni.disabled=new ni(519,ni.ReadOnly,[0,1]);class nr{constructor(e,t,n,i,r,o){this.test=e,this.ref=t,this.mask=n,this.fail=i,this.depthFail=r,this.pass=o}}nr.disabled=new nr({func:519,mask:0},0,0,7680,7680,7680);class no{constructor(e,t,n){this.enable=e,this.mode=t,this.frontFace=n}}function na(e,n,i,r,o,a,l){var c;let d=e.context,u=d.gl,h=e.useProgram("collisionBox"),m=[],f=0,p=0;for(let s=0;s<r.length;s++){let c=r[s],g=n.getTile(c),b=g.getBucket(i);if(!b)continue;let _=c.posMatrix;0===o[0]&&0===o[1]||(_=e.translatePosMatrix(c.posMatrix,g,o,a));let y=l?b.textCollisionBox:b.iconCollisionBox,v=b.collisionCircleArray;if(v.length>0){let n=t.F(),i=_;t.aP(n,b.placementInvProjMatrix,e.transform.glCoordMatrix),t.aP(n,n,b.placementViewportMatrix),m.push({circleArray:v,circleOffset:p,transform:i,invTransform:n,coord:c}),f+=v.length/4,p=f}y&&h.draw(d,u.LINES,ni.disabled,nr.disabled,e.colorModeForRenderPass(),no.disabled,ta(_,e.transform,g),e.style.map.terrain&&e.style.map.terrain.getTerrainData(c),i.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,null,e.transform.zoom,null,null,y.collisionVertexBuffer)}if(!l||!m.length)return;let g=e.useProgram("collisionCircle"),b=new t.aQ;b.resize(4*f),b._trim();let _=0;for(let e of m)for(let t=0;t<e.circleArray.length/4;t++){let n=4*t,i=e.circleArray[n+0],r=e.circleArray[n+1],o=e.circleArray[n+2],a=e.circleArray[n+3];b.emplace(_++,i,r,o,a,0),b.emplace(_++,i,r,o,a,1),b.emplace(_++,i,r,o,a,2),b.emplace(_++,i,r,o,a,3)}(!s||s.length<2*f)&&(s=function(e){let n=2*e,i=new t.aS;i.resize(n),i._trim();for(let e=0;e<n;e++){let t=6*e;i.uint16[t+0]=4*e+0,i.uint16[t+1]=4*e+1,i.uint16[t+2]=4*e+2,i.uint16[t+3]=4*e+2,i.uint16[t+4]=4*e+3,i.uint16[t+5]=4*e+0}return i}(f));let y=d.createIndexBuffer(s,!0),v=d.createVertexBuffer(b,t.aR.members,!0);for(let n of m){let r={u_matrix:n.transform,u_inv_matrix:n.invTransform,u_camera_to_center_distance:(c=e.transform).cameraToCenterDistance,u_viewport_size:[c.width,c.height]};g.draw(d,u.TRIANGLES,ni.disabled,nr.disabled,e.colorModeForRenderPass(),no.disabled,r,e.style.map.terrain&&e.style.map.terrain.getTerrainData(n.coord),i.id,v,y,t.$.simpleSegment(0,2*n.circleOffset,n.circleArray.length,n.circleArray.length/2),null,e.transform.zoom,null,null,null)}v.destroy(),y.destroy()}no.disabled=new no(!1,1029,2305),no.backCCW=new no(!0,1029,2305);let ns=t.an(new Float32Array(16));function nl(e,n,i,r,o,a,s,l,c,d,u,h){let m=e.context,f=m.gl,p=e.transform,g="map"===l,b="map"===c,_="viewport"!==l&&"point"!==i.layout.get("symbol-placement"),y=g&&!b&&!_,v=!i.layout.get("symbol-sort-key").isConstant(),x=!1,w=e.depthModeForSublayer(0,ni.ReadOnly),F=i._unevaluatedLayout.hasValue("text-variable-anchor")||i._unevaluatedLayout.hasValue("text-variable-anchor-offset"),k=[];for(let l of r){let r=n.getTile(l),c=r.getBucket(i);if(!c)continue;let u=o?c.text:c.icon;if(!u||!u.segments.get().length||!u.hasVisibleVertices)continue;let h=u.programConfigurations.get(i.id),m=o||c.sdfIcons,w=o?c.textSizeData:c.iconSizeData,E=b||0!==p.pitch,A=e.useProgram(c.iconsInText&&o?"symbolTextAndIcon":m?"symbolSDF":"symbolIcon",h),C=t.ag(w,p.zoom),T=e.style.map.terrain&&e.style.map.terrain.getTerrainData(l),S,M,D,I,R=[0,0],O=null;if(o)M=r.glyphAtlasTexture,D=f.LINEAR,S=r.glyphAtlasTexture.size,c.iconsInText&&(R=r.imageAtlasTexture.size,O=r.imageAtlasTexture,I=E||e.options.rotating||e.options.zooming||"composite"===w.kind||"camera"===w.kind?f.LINEAR:f.NEAREST);else{let t=1!==i.layout.get("icon-size").constantOr(0)||c.iconsNeedLinear;M=r.imageAtlasTexture,D=m||e.options.rotating||e.options.zooming||t||E?f.LINEAR:f.NEAREST,S=r.imageAtlasTexture.size}let P=eD(r,1,e.transform.zoom),$=eb(l.posMatrix,b,g,e.transform,P),N=e_(l.posMatrix,b,g,e.transform,P),B=F&&c.hasTextData(),z="none"!==i.layout.get("icon-text-fit")&&B&&c.hasIconData();if(_){let n=e.style.map.terrain?(t,n)=>e.style.map.terrain.getElevation(l,t,n):null,r="map"===i.layout.get("text-rotation-alignment");!function(e,n,i,r,o,a,s,l,c,d){let u=r?e.textSizeData:e.iconSizeData,h=t.ag(u,i.transform.zoom),m=[256/i.width*2+1,256/i.height*2+1],f=r?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;f.clear();let p=e.lineVertexArray,g=r?e.text.placedSymbolArray:e.icon.placedSymbolArray,b=i.transform.width/i.transform.height,_=!1;for(let r=0;r<g.length;r++){let y,v=g.get(r);if(v.hidden||v.writingMode===t.ah.vertical&&!_||(_=!1,d?(y=[v.anchorX,v.anchorY,d(v.anchorX,v.anchorY),1],t.af(y,y,n)):eM(y=[v.anchorX,v.anchorY,0,1],y,n),!function(e,t){let n=e[0]/e[3],i=e[1]/e[3];return n>=-t[0]&&n<=t[0]&&i>=-t[1]&&i<=t[1]}(y,m))){eS(v.numGlyphs,f);continue}let x=ev(i.transform.cameraToCenterDistance,y[3]),w=t.ai(u,h,v),F=s?w/x:w*x,k=new t.P(v.anchorX,v.anchorY),E=ey(k,o,d).point,A={projections:{},offsets:{}},C=eF(v,F,!1,l,n,o,a,e.glyphOffsetArray,p,f,E,k,A,b,c,d);_=C.useVertical,(C.notEnoughRoom||_||C.needsFlipping&&eF(v,F,!0,l,n,o,a,e.glyphOffsetArray,p,f,E,k,A,b,c,d).notEnoughRoom)&&eS(v.numGlyphs,f)}r?e.text.dynamicLayoutVertexBuffer.updateData(f):e.icon.dynamicLayoutVertexBuffer.updateData(f)}(c,l.posMatrix,e,o,$,N,b,d,r,n)}let j=e.translatePosMatrix(l.posMatrix,r,a,s),Y=_||o&&F||z?ns:$,H=e.translatePosMatrix(N,r,a,s,!0),U=m&&0!==i.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1),V={program:A,buffers:u,uniformValues:m?c.iconsInText?ty(w.kind,C,y,b,e,j,Y,H,S,R):t_(w.kind,C,y,b,e,j,Y,H,o,S,!0):tb(w.kind,C,y,b,e,j,Y,H,o,S),atlasTexture:M,atlasTextureIcon:O,atlasInterpolation:D,atlasInterpolationIcon:I,isSDF:m,hasHalo:U};if(v&&c.canOverlap)for(let e of(x=!0,u.segments.get()))k.push({segments:new t.$([e]),sortKey:e.sortKey,state:V,terrainData:T});else k.push({segments:u.segments,sortKey:0,state:V,terrainData:T})}for(let t of(x&&k.sort((e,t)=>e.sortKey-t.sortKey),k)){let n=t.state;if(m.activeTexture.set(f.TEXTURE0),n.atlasTexture.bind(n.atlasInterpolation,f.CLAMP_TO_EDGE),n.atlasTextureIcon&&(m.activeTexture.set(f.TEXTURE1),n.atlasTextureIcon&&n.atlasTextureIcon.bind(n.atlasInterpolationIcon,f.CLAMP_TO_EDGE)),n.isSDF){let r=n.uniformValues;n.hasHalo&&(r.u_is_halo=1,nc(n.buffers,t.segments,i,e,n.program,w,u,h,r,t.terrainData)),r.u_is_halo=0}nc(n.buffers,t.segments,i,e,n.program,w,u,h,n.uniformValues,t.terrainData)}}function nc(e,t,n,i,r,o,a,s,l,c){let d=i.context;r.draw(d,d.gl.TRIANGLES,o,a,s,no.disabled,l,c,n.id,e.layoutVertexBuffer,e.indexBuffer,t,n.paint,i.transform.zoom,e.programConfigurations.get(n.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function nd(e,t,n,i,r){if(!n||!i||!i.imageAtlas)return;let o=i.imageAtlas.patternPositions,a=o[n.to.toString()],s=o[n.from.toString()];if(!a&&s&&(a=s),!s&&a&&(s=a),!a||!s){let e=r.getPaintProperty(t);a=o[e],s=o[e]}a&&s&&e.setConstantPatternPositions(a,s)}function nu(e,t,n,i,r,o,a){let s,l,c,d,u,h=e.context.gl,m="fill-pattern",f=n.paint.get(m),p=f&&f.constantOr(1),g=n.getCrossfadeParameters();a?(l=p&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=h.LINES):(l=p?"fillPattern":"fill",s=h.TRIANGLES);let b=f.constantOr(null);for(let f of i){let i=t.getTile(f);if(p&&!i.patternsLoaded())continue;let _=i.getBucket(n);if(!_)continue;let y=_.programConfigurations.get(n.id),v=e.useProgram(l,y),x=e.style.map.terrain&&e.style.map.terrain.getTerrainData(f);p&&(e.context.activeTexture.set(h.TEXTURE0),i.imageAtlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),y.updatePaintBuffers(g)),nd(y,m,b,i,n);let w=x?f:null,F=e.translatePosMatrix(w?w.posMatrix:f.posMatrix,i,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(a){d=_.indexBuffer2,u=_.segments2;let t=[h.drawingBufferWidth,h.drawingBufferHeight];c="fillOutlinePattern"===l&&p?tr(F,e,g,i,t):ti(F,t)}else d=_.indexBuffer,u=_.segments,c=p?tn(F,e,g,i):tt(F);v.draw(e.context,s,r,e.stencilModeForClipping(f),o,no.disabled,c,x,n.id,_.layoutVertexBuffer,d,u,n.paint,e.transform.zoom,y)}}function nh(e,t,n,i,r,o,a){let s=e.context,l=s.gl,c="fill-extrusion-pattern",d=n.paint.get(c),u=d.constantOr(1),h=n.getCrossfadeParameters(),m=n.paint.get("fill-extrusion-opacity"),f=d.constantOr(null);for(let d of i){let i=t.getTile(d),p=i.getBucket(n);if(!p)continue;let g=e.style.map.terrain&&e.style.map.terrain.getTerrainData(d),b=p.programConfigurations.get(n.id),_=e.useProgram(u?"fillExtrusionPattern":"fillExtrusion",b);u&&(e.context.activeTexture.set(l.TEXTURE0),i.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),b.updatePaintBuffers(h)),nd(b,c,f,i,n);let y=e.translatePosMatrix(d.posMatrix,i,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),v=n.paint.get("fill-extrusion-vertical-gradient"),x=u?te(y,e,v,m,d,h,i):e9(y,e,v,m);_.draw(s,s.gl.TRIANGLES,r,o,a,no.backCCW,x,g,n.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,n.paint,e.transform.zoom,b,e.style.map.terrain&&p.centroidVertexBuffer)}}let nm=new t.aO(1,0,0,1),nf=new t.aO(0,1,0,1),np=new t.aO(0,0,1,1),ng=new t.aO(1,0,1,1),nb=new t.aO(0,1,1,1);function n_(e,t,n,i){nv(e,0,t+n/2,e.transform.width,n,i)}function ny(e,t,n,i){nv(e,t-n/2,0,n,e.transform.height,i)}function nv(e,t,n,i,r,o){let a=e.context,s=a.gl;s.enable(s.SCISSOR_TEST),s.scissor(t*e.pixelRatio,n*e.pixelRatio,i*e.pixelRatio,r*e.pixelRatio),a.clear({color:o}),s.disable(s.SCISSOR_TEST)}function nx(e,t,n){let i=e.context,r=i.gl,o=e.colorModeForRenderPass(),a=new ni(r.LEQUAL,ni.ReadWrite,e.depthRangeFor3D),s=e.useProgram("terrain"),l=t.getTerrainMesh();for(let c of(i.bindFramebuffer.set(null),i.viewport.set([0,0,e.width,e.height]),n)){let n=e.renderToTexture.getTexture(c),d=t.getTerrainData(c.tileID);i.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,n.texture);let u={u_matrix:e.transform.calculatePosMatrix(c.tileID.toUnwrapped()),u_texture:0,u_ele_delta:t.getMeshFrameDelta(e.transform.zoom)};s.draw(i,r.TRIANGLES,a,nr.disabled,o,no.backCCW,u,d,"terrain",l.vertexBuffer,l.indexBuffer,l.segments)}}class nw{constructor(e,n){this.context=new nn(e),this.transform=n,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:t.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=eu.maxUnderzooming+eu.maxOverzooming+1,this.depthEpsilon=1/65536,this.crossTileSymbolIndex=new eZ}resize(e,t,n){if(this.width=Math.floor(e*n),this.height=Math.floor(t*n),this.pixelRatio=n,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let e of this.style._order)this.style._layers[e].resize()}setup(){let e=this.context,n=new t.aV;n.emplaceBack(0,0),n.emplaceBack(t.W,0),n.emplaceBack(0,t.W),n.emplaceBack(t.W,t.W),this.tileExtentBuffer=e.createVertexBuffer(n,e1.members),this.tileExtentSegments=t.$.simpleSegment(0,0,4,2);let i=new t.aV;i.emplaceBack(0,0),i.emplaceBack(t.W,0),i.emplaceBack(0,t.W),i.emplaceBack(t.W,t.W),this.debugBuffer=e.createVertexBuffer(i,e1.members),this.debugSegments=t.$.simpleSegment(0,0,4,5);let r=new t.Z;r.emplaceBack(0,0,0,0),r.emplaceBack(t.W,0,t.W,0),r.emplaceBack(0,t.W,0,t.W),r.emplaceBack(t.W,t.W,t.W,t.W),this.rasterBoundsBuffer=e.createVertexBuffer(r,J.members),this.rasterBoundsSegments=t.$.simpleSegment(0,0,4,2);let o=new t.aV;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(o,e1.members),this.viewportSegments=t.$.simpleSegment(0,0,4,2);let a=new t.aW;a.emplaceBack(0),a.emplaceBack(1),a.emplaceBack(3),a.emplaceBack(2),a.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(a);let s=new t.aX;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s);let l=this.context.gl;this.stencilClearMode=new nr({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)}clearStencil(){let e=this.context,n=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let i=t.F();t.aN(i,0,this.width,this.height,0,0,1),t.J(i,i,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,n.TRIANGLES,ni.disabled,this.stencilClearMode,nt.disabled,no.disabled,tl(i),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,t){if(this.currentStencilSource===e.source||!e.isTileClipped()||!t||!t.length)return;this.currentStencilSource=e.source;let n=this.context,i=n.gl;this.nextStencilID+t.length>256&&this.clearStencil(),n.setColorMode(nt.disabled),n.setDepthMode(ni.disabled);let r=this.useProgram("clippingMask");for(let e of(this._tileClippingMaskIDs={},t)){let t=this._tileClippingMaskIDs[e.key]=this.nextStencilID++,o=this.style.map.terrain&&this.style.map.terrain.getTerrainData(e);r.draw(n,i.TRIANGLES,ni.disabled,new nr({func:i.ALWAYS,mask:0},t,255,i.KEEP,i.KEEP,i.REPLACE),nt.disabled,no.disabled,tl(e.posMatrix),o,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let e=this.nextStencilID++,t=this.context.gl;return new nr({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){let t=this.context.gl;return new nr({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}stencilConfigForOverlap(e){let t=this.context.gl,n=e.sort((e,t)=>t.overscaledZ-e.overscaledZ),i=n[n.length-1].overscaledZ,r=n[0].overscaledZ-i+1;if(r>1){this.currentStencilSource=void 0,this.nextStencilID+r>256&&this.clearStencil();let e={};for(let n=0;n<r;n++)e[n+i]=new nr({func:t.GEQUAL,mask:255},n+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=r,[e,n]}return[{[i]:nr.disabled},n]}colorModeForRenderPass(){let e=this.context.gl;if(this._showOverdrawInspector){let n=1/8;return new nt([e.CONSTANT_COLOR,e.ONE],new t.aO(n,n,n,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?nt.unblended:nt.alphaBlended}depthModeForSublayer(e,t,n){if(!this.opaquePassEnabledForLayer())return ni.disabled;let i=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new ni(n||this.context.gl.LEQUAL,t,[i,i])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,n){this.style=e,this.options=n,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(u.now()),this.imageManager.beginFrame();let i=this.style._order,r=this.style.sourceCaches,o={},a={},s={};for(let e in r){let t=r[e];t.used&&t.prepare(this.context),o[e]=t.getVisibleCoordinates(),a[e]=o[e].slice().reverse(),s[e]=t.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let e=0;e<i.length;e++)if(this.style._layers[i[e]].is3D()){this.opaquePassCutoff=e;break}for(let e of(this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen",i)){let t=this.style._layers[e];if(!t.hasOffscreenPass()||t.isHidden(this.transform.zoom))continue;let n=a[t.source];("custom"===t.type||n.length)&&this.renderLayer(this,r[t.source],t,n)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:n.showOverdrawInspector?t.aO.black:t.aO.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=n.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=i.length-1;this.currentLayer>=0;this.currentLayer--){let e=this.style._layers[i[this.currentLayer]],t=r[e.source],n=o[e.source];this._renderTileClippingMasks(e,n),this.renderLayer(this,t,e,n)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){let e=this.style._layers[i[this.currentLayer]],t=r[e.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(e))continue;let n=("symbol"===e.type?s:a)[e.source];this._renderTileClippingMasks(e,o[e.source]),this.renderLayer(this,t,e,n)}if(this.options.showTileBoundaries){let e=function(e,t){let n=null,i=Object.values(e._layers).flatMap(n=>n.source&&!n.isHidden(t)?[e.sourceCaches[n.source]]:[]),r=i.filter(e=>"vector"===e.getSource().type),o=i.filter(e=>"vector"!==e.getSource().type),a=e=>{(!n||n.getSource().maxzoom<e.getSource().maxzoom)&&(n=e)};return r.forEach(e=>a(e)),n||o.forEach(e=>a(e)),n}(this.style,this.transform.zoom);e&&function(e,n,i){for(let r=0;r<i.length;r++)!function(e,n,i){let r=e.context,o=r.gl,a=i.posMatrix,s=e.useProgram("debug"),l=ni.disabled,c=nr.disabled,d=e.colorModeForRenderPass(),u="$debug",h=e.style.map.terrain&&e.style.map.terrain.getTerrainData(i);r.activeTexture.set(o.TEXTURE0);let m=n.getTileByID(i.key).latestRawTileData,f=Math.floor((m&&m.byteLength||0)/1024),p=512/Math.min(n.getTile(i).tileSize,512)*(i.overscaledZ/e.transform.zoom)*.5,g=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(g+=` => ${i.overscaledZ}`),function(e,t){e.initDebugOverlayCanvas();let n=e.debugOverlayCanvas,i=e.context.gl,r=e.debugOverlayCanvas.getContext("2d");r.clearRect(0,0,n.width,n.height),r.shadowColor="white",r.shadowBlur=2,r.lineWidth=1.5,r.strokeStyle="white",r.textBaseline="top",r.font="bold 36px Open Sans, sans-serif",r.fillText(t,5,5),r.strokeText(t,5,5),e.debugOverlayTexture.update(n),e.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}(e,`${g} ${f}kB`),s.draw(r,o.TRIANGLES,l,c,nt.alphaBlended,no.disabled,ts(a,t.aO.transparent,p),null,u,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments),s.draw(r,o.LINE_STRIP,l,c,d,no.disabled,ts(a,t.aO.red),h,u,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments)}(e,n,i[r])}(this,e,e.getVisibleCoordinates())}this.options.showPadding&&function(e){var t,n;let i=e.transform.padding;n_(e,e.transform.height-(i.top||0),3,nm),n_(e,i.bottom||0,3,nf),ny(e,i.left||0,3,np),ny(e,e.transform.width-(i.right||0),3,ng);let r=e.transform.centerPoint;t=r.x,n=e.transform.height-r.y,nv(e,t-1,n-10,2,20,nb),nv(e,t-10,n-1,20,2,nb)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(e){if(!this.style||!this.style.map||!this.style.map.terrain)return;let n=this.terrainFacilitator.matrix,i=this.transform.projMatrix,r=this.terrainFacilitator.dirty;r||(r=e?!t.aY(n,i):!t.aZ(n,i)),r||(r=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),r&&(t.a_(n,i),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(e,n){let i=e.context,r=i.gl,o=nt.unblended,a=new ni(r.LEQUAL,ni.ReadWrite,[0,1]),s=n.getTerrainMesh(),l=n.sourceCache.getRenderableTiles(),c=e.useProgram("terrainDepth");for(let d of(i.bindFramebuffer.set(n.getFramebuffer("depth").framebuffer),i.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),i.clear({color:t.aO.transparent,depth:1}),l)){let t=n.getTerrainData(d.tileID),l={u_matrix:e.transform.calculatePosMatrix(d.tileID.toUnwrapped()),u_ele_delta:n.getMeshFrameDelta(e.transform.zoom)};c.draw(i,r.TRIANGLES,a,nr.disabled,o,no.backCCW,l,t,"terrain",s.vertexBuffer,s.indexBuffer,s.segments)}i.bindFramebuffer.set(null),i.viewport.set([0,0,e.width,e.height])}(this,this.style.map.terrain),function(e,n){let i=e.context,r=i.gl,o=nt.unblended,a=new ni(r.LEQUAL,ni.ReadWrite,[0,1]),s=n.getTerrainMesh(),l=n.getCoordsTexture(),c=n.sourceCache.getRenderableTiles(),d=e.useProgram("terrainCoords");for(let u of(i.bindFramebuffer.set(n.getFramebuffer("coords").framebuffer),i.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),i.clear({color:t.aO.transparent,depth:1}),n.coordsIndex=[],c)){let t=n.getTerrainData(u.tileID);i.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,l.texture);let c={u_matrix:e.transform.calculatePosMatrix(u.tileID.toUnwrapped()),u_terrain_coords_id:(255-n.coordsIndex.length)/255,u_texture:0,u_ele_delta:n.getMeshFrameDelta(e.transform.zoom)};d.draw(i,r.TRIANGLES,a,nr.disabled,o,no.backCCW,c,t,"terrain",s.vertexBuffer,s.indexBuffer,s.segments),n.coordsIndex.push(u.tileID.key)}i.bindFramebuffer.set(null),i.viewport.set([0,0,e.width,e.height])}(this,this.style.map.terrain))}renderLayer(e,n,i,r){if(!i.isHidden(this.transform.zoom)&&("background"===i.type||"custom"===i.type||(r||[]).length))switch(this.id=i.id,i.type){case"symbol":!function(e,n,i,r,o){if("translucent"!==e.renderPass)return;let a=nr.disabled,s=e.colorModeForRenderPass();(i._unevaluatedLayout.hasValue("text-variable-anchor")||i._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(e,n,i,r,o,a,s){let l=n.transform,c="map"===o,d="map"===a;for(let o of e){let e=r.getTile(o),a=e.getBucket(i);if(!a||!a.text||!a.text.segments.get().length)continue;let u=t.ag(a.textSizeData,l.zoom),h=eD(e,1,n.transform.zoom),m=eb(o.posMatrix,d,c,n.transform,h),f="none"!==i.layout.get("icon-text-fit")&&a.hasIconData();if(u){let i=Math.pow(2,l.zoom-e.tileID.overscaledZ);!function(e,n,i,r,o,a,s,l,c,d,u){let h=e.text.placedSymbolArray,m=e.text.dynamicLayoutVertexArray,f=e.icon.dynamicLayoutVertexArray,p={};m.clear();for(let f=0;f<h.length;f++){let g=h.get(f),b=g.hidden||!g.crossTileID||e.allowVerticalPlacement&&!g.placedOrientation?null:r[g.crossTileID];if(b){let r=new t.P(g.anchorX,g.anchorY),h=ey(r,i?s:a,u),f=ev(o.cameraToCenterDistance,h.signedDistanceFromCamera),_=t.ai(e.textSizeData,c,g)*f/t.ao;i&&(_*=e.tilePixelRatio/l);let{width:y,height:v,anchor:x,textOffset:w,textBoxScale:F}=b,k=function(e,n,i,r,o,a){let{horizontalAlign:s,verticalAlign:l}=t.at(e);return new t.P((-(s-.5)*n/o+r[0])*a,(-(l-.5)*i/o+r[1])*a)}(x,y,v,w,F,_),E=i?ey(r.add(k),a,u).point:h.point.add(n?k.rotate(-o.angle):k),A=e.allowVerticalPlacement&&g.placedOrientation===t.ah.vertical?Math.PI/2:0;for(let e=0;e<g.numGlyphs;e++)t.aj(m,E,A);d&&g.associatedIconIndex>=0&&(p[g.associatedIconIndex]={shiftedAnchor:E,angle:A})}else eS(g.numGlyphs,m)}if(d){f.clear();let n=e.icon.placedSymbolArray;for(let e=0;e<n.length;e++){let i=n.get(e);if(i.hidden)eS(i.numGlyphs,f);else{let n=p[e];if(n)for(let e=0;e<i.numGlyphs;e++)t.aj(f,n.shiftedAnchor,n.angle);else eS(i.numGlyphs,f)}}e.icon.dynamicLayoutVertexBuffer.updateData(f)}e.text.dynamicLayoutVertexBuffer.updateData(m)}(a,c,d,s,l,m,o.posMatrix,i,u,f,n.style.map.terrain?(e,t)=>n.style.map.terrain.getElevation(o,e,t):null)}}}(r,e,i,n,i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),o),0!==i.paint.get("icon-opacity").constantOr(1)&&nl(e,n,i,r,!1,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),i.layout.get("icon-rotation-alignment"),i.layout.get("icon-pitch-alignment"),i.layout.get("icon-keep-upright"),a,s),0!==i.paint.get("text-opacity").constantOr(1)&&nl(e,n,i,r,!0,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.layout.get("text-keep-upright"),a,s),n.map.showCollisionBoxes&&(na(e,n,i,r,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),!0),na(e,n,i,r,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),!1))}(e,n,i,r,this.style.placement.variableOffsets);break;case"circle":!function(e,n,i,r){if("translucent"!==e.renderPass)return;let o=i.paint.get("circle-opacity"),a=i.paint.get("circle-stroke-width"),s=i.paint.get("circle-stroke-opacity"),l=!i.layout.get("circle-sort-key").isConstant();if(0===o.constantOr(1)&&(0===a.constantOr(1)||0===s.constantOr(1)))return;let c=e.context,d=c.gl,u=e.depthModeForSublayer(0,ni.ReadOnly),h=nr.disabled,m=e.colorModeForRenderPass(),f=[];for(let o=0;o<r.length;o++){let a=r[o],s=n.getTile(a),c=s.getBucket(i);if(!c)continue;let d=c.programConfigurations.get(i.id),u=e.useProgram("circle",d),h=c.layoutVertexBuffer,m=c.indexBuffer,p=e.style.map.terrain&&e.style.map.terrain.getTerrainData(a),g={programConfiguration:d,program:u,layoutVertexBuffer:h,indexBuffer:m,uniformValues:to(e,a,s,i),terrainData:p};if(l)for(let e of c.segments.get())f.push({segments:new t.$([e]),sortKey:e.sortKey,state:g});else f.push({segments:c.segments,sortKey:0,state:g})}for(let t of(l&&f.sort((e,t)=>e.sortKey-t.sortKey),f)){let{programConfiguration:n,program:r,layoutVertexBuffer:o,indexBuffer:a,uniformValues:s,terrainData:l}=t.state;r.draw(c,d.TRIANGLES,u,h,m,no.disabled,s,l,i.id,o,a,t.segments,i.paint,e.transform.zoom,n)}}(e,n,i,r);break;case"heatmap":!function(e,n,i,r){if(0!==i.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){let o=e.context,a=o.gl,s=nr.disabled,l=new nt([a.ONE,a.ONE],t.aO.transparent,[!0,!0,!0,!0]);!function(e,t,n){let i=e.gl;e.activeTexture.set(i.TEXTURE1),e.viewport.set([0,0,t.width/4,t.height/4]);let r=n.heatmapFbo;if(r)i.bindTexture(i.TEXTURE_2D,r.colorAttachment.get()),e.bindFramebuffer.set(r.framebuffer);else{let o=i.createTexture();i.bindTexture(i.TEXTURE_2D,o),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),r=n.heatmapFbo=e.createFramebuffer(t.width/4,t.height/4,!1,!1),function(e,t,n,i){var r,o;let a=e.gl,s=null!=(r=e.HALF_FLOAT)?r:a.UNSIGNED_BYTE,l=null!=(o=e.RGBA16F)?o:a.RGBA;a.texImage2D(a.TEXTURE_2D,0,l,t.width/4,t.height/4,0,a.RGBA,s,null),i.colorAttachment.set(n)}(e,t,o,r)}}(o,e,i),o.clear({color:t.aO.transparent});for(let t=0;t<r.length;t++){let c=r[t];if(n.hasRenderableParent(c))continue;let d=n.getTile(c),u=d.getBucket(i);if(!u)continue;let h=u.programConfigurations.get(i.id),m=e.useProgram("heatmap",h),{zoom:f}=e.transform;m.draw(o,a.TRIANGLES,ni.disabled,s,l,no.disabled,tc(c.posMatrix,d,f,i.paint.get("heatmap-intensity")),null,i.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,i.paint,e.transform.zoom,h)}o.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,n){let i=e.context,r=i.gl,o=n.heatmapFbo;if(!o)return;i.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,o.colorAttachment.get()),i.activeTexture.set(r.TEXTURE1);let a=n.colorRampTexture;a||(a=n.colorRampTexture=new S(i,n.colorRamp,r.RGBA)),a.bind(r.LINEAR,r.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(i,r.TRIANGLES,ni.disabled,nr.disabled,e.colorModeForRenderPass(),no.disabled,((e,n,i,r)=>{let o=t.F();t.aN(o,0,e.width,e.height,0,0,1);let a=e.context.gl;return{u_matrix:o,u_world:[a.drawingBufferWidth,a.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:n.paint.get("heatmap-opacity")}})(e,n),null,n.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,n.paint,e.transform.zoom)}(e,i))}(e,n,i,r);break;case"line":!function(e,n,i,r){if("translucent"!==e.renderPass)return;let o=i.paint.get("line-opacity"),a=i.paint.get("line-width");if(0===o.constantOr(1)||0===a.constantOr(1))return;let s=e.depthModeForSublayer(0,ni.ReadOnly),l=e.colorModeForRenderPass(),c=i.paint.get("line-dasharray"),d=i.paint.get("line-pattern"),u=d.constantOr(1),h=i.paint.get("line-gradient"),m=i.getCrossfadeParameters(),f=u?"linePattern":c?"lineSDF":h?"lineGradient":"line",p=e.context,g=p.gl,b=!0;for(let o of r){let r=n.getTile(o);if(u&&!r.patternsLoaded())continue;let a=r.getBucket(i);if(!a)continue;let _=a.programConfigurations.get(i.id),y=e.context.program.get(),v=e.useProgram(f,_),x=b||v.program!==y,w=e.style.map.terrain&&e.style.map.terrain.getTerrainData(o),F=d.constantOr(null);if(F&&r.imageAtlas){let e=r.imageAtlas,t=e.patternPositions[F.to.toString()],n=e.patternPositions[F.from.toString()];t&&n&&_.setConstantPatternPositions(t,n)}let k=w?o:null,E=u?th(e,r,i,m,k):c?tm(e,r,i,c,m,k):h?tu(e,r,i,a.lineClipsArray.length,k):td(e,r,i,k);if(u)p.activeTexture.set(g.TEXTURE0),r.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),_.updatePaintBuffers(m);else if(c&&(x||e.lineAtlas.dirty))p.activeTexture.set(g.TEXTURE0),e.lineAtlas.bind(p);else if(h){let r=a.gradients[i.id],s=r.texture;if(i.gradientVersion!==r.version){let l=256;if(i.stepInterpolant){let i=n.getSource().maxzoom,r=o.canonical.z===i?Math.ceil(1<<e.transform.maxZoom-o.canonical.z):1;l=t.ac(t.aT(a.maxLineLength/t.W*1024*r),256,p.maxTextureSize)}r.gradient=t.aU({expression:i.gradientExpression(),evaluationKey:"lineProgress",resolution:l,image:r.gradient||void 0,clips:a.lineClipsArray}),r.texture?r.texture.update(r.gradient):r.texture=new S(p,r.gradient,g.RGBA),r.version=i.gradientVersion,s=r.texture}p.activeTexture.set(g.TEXTURE0),s.bind(i.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}v.draw(p,g.TRIANGLES,s,e.stencilModeForClipping(o),l,no.disabled,E,w,i.id,a.layoutVertexBuffer,a.indexBuffer,a.segments,i.paint,e.transform.zoom,_,a.layoutVertexBuffer2),b=!1}}(e,n,i,r);break;case"fill":!function(e,n,i,r){let o=i.paint.get("fill-color"),a=i.paint.get("fill-opacity");if(0===a.constantOr(1))return;let s=e.colorModeForRenderPass(),l=i.paint.get("fill-pattern"),c=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===o.constantOr(t.aO.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";if(e.renderPass===c){let t=e.depthModeForSublayer(1,"opaque"===e.renderPass?ni.ReadWrite:ni.ReadOnly);nu(e,n,i,r,t,s,!1)}if("translucent"===e.renderPass&&i.paint.get("fill-antialias")){let t=e.depthModeForSublayer(2*!!i.getPaintProperty("fill-outline-color"),ni.ReadOnly);nu(e,n,i,r,t,s,!0)}}(e,n,i,r);break;case"fill-extrusion":let o=i.paint.get("fill-extrusion-opacity");if(0!==o&&"translucent"===e.renderPass){let t=new ni(e.context.gl.LEQUAL,ni.ReadWrite,e.depthRangeFor3D);if(1!==o||i.paint.get("fill-extrusion-pattern").constantOr(1))nh(e,n,i,r,t,nr.disabled,nt.disabled),nh(e,n,i,r,t,e.stencilModeFor3D(),e.colorModeForRenderPass());else{let o=e.colorModeForRenderPass();nh(e,n,i,r,t,nr.disabled,o)}}break;case"hillshade":!function(e,n,i,r){if("offscreen"!==e.renderPass&&"translucent"!==e.renderPass)return;let o=e.context,a=e.depthModeForSublayer(0,ni.ReadOnly),s=e.colorModeForRenderPass(),[l,c]="translucent"===e.renderPass?e.stencilConfigForOverlap(r):[{},r];for(let r of c){let o=n.getTile(r);void 0!==o.needsHillshadePrepare&&o.needsHillshadePrepare&&"offscreen"===e.renderPass?function(e,n,i,r,o,a){let s=e.context,l=s.gl,c=n.dem;if(c&&c.data){let d=c.dim,u=c.stride,h=c.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||e.getTileTexture(u),n.demTexture){let e=n.demTexture;e.update(h,{premultiply:!1}),e.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else n.demTexture=new S(s,h,l.RGBA,{premultiply:!1}),n.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);let m=n.fbo;if(!m){let e=new S(s,{width:d,height:d,data:null},l.RGBA);e.bind(l.LINEAR,l.CLAMP_TO_EDGE),(m=n.fbo=s.createFramebuffer(d,d,!0,!1)).colorAttachment.set(e.texture)}s.bindFramebuffer.set(m.framebuffer),s.viewport.set([0,0,d,d]),e.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,r,o,a,no.disabled,((e,n)=>{let i=n.stride,r=t.F();return t.aN(r,0,t.W,-t.W,0,0,1),t.H(r,r,[0,-t.W,0]),{u_matrix:r,u_image:1,u_dimension:[i,i],u_zoom:e.overscaledZ,u_unpack:n.getUnpackVector()}})(n.tileID,c),null,i.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),n.needsHillshadePrepare=!1}}(e,o,i,a,nr.disabled,s):"translucent"===e.renderPass&&function(e,n,i,r,o,a,s){let l=e.context,c=l.gl,d=i.fbo;if(!d)return;let u=e.useProgram("hillshade"),h=e.style.map.terrain&&e.style.map.terrain.getTerrainData(n);l.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,d.colorAttachment.get()),u.draw(l,c.TRIANGLES,o,a,s,no.disabled,((e,n,i,r)=>{let o=i.paint.get("hillshade-shadow-color"),a=i.paint.get("hillshade-highlight-color"),s=i.paint.get("hillshade-accent-color"),l=i.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===i.paint.get("hillshade-illumination-anchor")&&(l-=e.transform.angle);let c=!e.options.moving;return{u_matrix:r?r.posMatrix:e.transform.calculatePosMatrix(n.tileID.toUnwrapped(),c),u_image:0,u_latrange:function(e,n){let i=Math.pow(2,n.canonical.z),r=n.canonical.y;return[new t.Y(0,r/i).toLngLat().lat,new t.Y(0,(r+1)/i).toLngLat().lat]}(0,n.tileID),u_light:[i.paint.get("hillshade-exaggeration"),l],u_shadow:o,u_highlight:a,u_accent:s}})(e,i,r,h?n:null),h,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}(e,r,o,i,a,l[r.overscaledZ],s)}o.viewport.set([0,0,e.width,e.height])}(e,n,i,r);break;case"raster":!function(e,n,i,r){if("translucent"!==e.renderPass||0===i.paint.get("raster-opacity")||!r.length)return;let o=e.context,a=o.gl,s=n.getSource(),l=e.useProgram("raster"),c=e.colorModeForRenderPass(),[d,h]=s instanceof Q?[{},r]:e.stencilConfigForOverlap(r),m=h[h.length-1].overscaledZ,f=!e.options.moving;for(let r of h){let h,p,g=e.depthModeForSublayer(r.overscaledZ-m,1===i.paint.get("raster-opacity")?ni.ReadWrite:ni.ReadOnly,a.LESS),b=n.getTile(r);b.registerFadeDuration(i.paint.get("raster-fade-duration"));let _=n.findLoadedParent(r,0),y=function(e,n,i,r,o,a){let s=r.paint.get("raster-fade-duration");if(!a&&s>0){let r=u.now(),a=(r-e.timeAdded)/s,l=n?(r-n.timeAdded)/s:-1,c=i.getSource(),d=o.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!n||Math.abs(n.tileID.overscaledZ-d)>Math.abs(e.tileID.overscaledZ-d),m=h&&e.refreshedUponExpiration?1:t.ac(h?a:1-l,0,1);return e.refreshedUponExpiration&&a>=1&&(e.refreshedUponExpiration=!1),n?{opacity:1,mix:1-m}:{opacity:m,mix:0}}return{opacity:1,mix:0}}(b,_,n,i,e.transform,e.style.map.terrain),v="nearest"===i.paint.get("raster-resampling")?a.NEAREST:a.LINEAR;o.activeTexture.set(a.TEXTURE0),b.texture.bind(v,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),o.activeTexture.set(a.TEXTURE1),_?(_.texture.bind(v,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),h=Math.pow(2,_.tileID.overscaledZ-b.tileID.overscaledZ),p=[b.tileID.canonical.x*h%1,b.tileID.canonical.y*h%1]):b.texture.bind(v,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST);let x=e.style.map.terrain&&e.style.map.terrain.getTerrainData(r),w=x?r:null,F=tg(w?w.posMatrix:e.transform.calculatePosMatrix(r.toUnwrapped(),f),p||[0,0],h||1,y,i);s instanceof Q?l.draw(o,a.TRIANGLES,g,nr.disabled,c,no.disabled,F,x,i.id,s.boundsBuffer,e.quadTriangleIndexBuffer,s.boundsSegments):l.draw(o,a.TRIANGLES,g,d[r.overscaledZ],c,no.disabled,F,x,i.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}(e,n,i,r);break;case"background":!function(e,t,n,i){let r=n.paint.get("background-color"),o=n.paint.get("background-opacity");if(0===o)return;let a=e.context,s=a.gl,l=e.transform,c=l.tileSize,d=n.paint.get("background-pattern");if(e.isPatternMissing(d))return;let u=!d&&1===r.a&&1===o&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass!==u)return;let h=nr.disabled,m=e.depthModeForSublayer(0,"opaque"===u?ni.ReadWrite:ni.ReadOnly),f=e.colorModeForRenderPass(),p=e.useProgram(d?"backgroundPattern":"background"),g=i||l.coveringTiles({tileSize:c,terrain:e.style.map.terrain});d&&(a.activeTexture.set(s.TEXTURE0),e.imageManager.bind(e.context));let b=n.getCrossfadeParameters();for(let t of g){let l=i?t.posMatrix:e.transform.calculatePosMatrix(t.toUnwrapped()),u=d?tx(l,o,e,d,{tileID:t,tileSize:c},b):tv(l,o,r),g=e.style.map.terrain&&e.style.map.terrain.getTerrainData(t);p.draw(a,s.TRIANGLES,m,h,f,no.disabled,u,g,n.id,e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments)}}(e,0,i,r);break;case"custom":let a=e.context,s=i.implementation;if("offscreen"===e.renderPass){let t=s.prerender;t&&(e.setCustomLayerDefaults(),a.setColorMode(e.colorModeForRenderPass()),t.call(s,a.gl,e.transform.customLayerMatrix()),a.setDirty(),e.setBaseState())}else if("translucent"===e.renderPass){e.setCustomLayerDefaults(),a.setColorMode(e.colorModeForRenderPass()),a.setStencilMode(nr.disabled);let t="3d"===s.renderingMode?new ni(e.context.gl.LEQUAL,ni.ReadWrite,e.depthRangeFor3D):e.depthModeForSublayer(0,ni.ReadOnly);a.setDepthMode(t),s.render(a.gl,e.transform.customLayerMatrix()),a.setDirty(),e.setBaseState(),a.bindFramebuffer.set(null)}}}translatePosMatrix(e,n,i,r,o){if(!i[0]&&!i[1])return e;let a=o?"map"===r?this.transform.angle:0:"viewport"===r?-this.transform.angle:0;if(a){let e=Math.sin(a),t=Math.cos(a);i=[i[0]*t-i[1]*e,i[0]*e+i[1]*t]}let s=[o?i[0]:eD(n,i[0],this.transform.zoom),o?i[1]:eD(n,i[1],this.transform.zoom),0],l=new Float32Array(16);return t.H(l,e,s),l}saveTileTexture(e){let t=this._tileTextures[e.size[0]];t?t.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){let t=this._tileTextures[e];return t&&t.length>0?t.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;let t=this.imageManager.getPattern(e.from.toString()),n=this.imageManager.getPattern(e.to.toString());return!t||!n}useProgram(e,t){this.cache=this.cache||{};let n=e+(t?t.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[n]||(this.cache[n]=new e8(this.context,e5[e],t,tw[e],this._showOverdrawInspector,this.style.map.terrain)),this.cache[n]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new S(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:e,drawingBufferHeight:t}=this.context.gl;return this.width!==e||this.height!==t}}class nF{constructor(e,t){this.points=e,this.planes=t}static fromInvProjectionMatrix(e,n,i){let r=Math.pow(2,i),o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(i=>{let o=1/(i=t.af([],i,e))[3]/n*r;return t.a$(i,i,[o,o,1/i[3],o])}),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(e=>{var t,n,i,r,a,s,l,c,d,u,h,m,f,p,g,b;let _=(h=[],f=(n=[],i=A([],o[e[0]],o[e[1]]),r=A([],o[e[2]],o[e[1]]),a=i[0],s=i[1],l=i[2],c=r[0],d=r[1],u=r[2],n[0]=s*u-l*d,n[1]=l*c-a*u,n[2]=a*d-s*c,m=n)[0],(b=f*f+(p=m[1])*p+(g=m[2])*g)>0&&(b=1/Math.sqrt(b)),h[0]=m[0]*b,h[1]=m[1]*b,h[2]=m[2]*b,h),y=-(_[0]*(t=o[e[1]])[0]+_[1]*t[1]+_[2]*t[2]);return _.concat(y)});return new nF(o,a)}}class nk{constructor(e,t){this.min=e,this.max=t,this.center=function(e,t,n){return e[0]=.5*t[0],e[1]=.5*t[1],e[2]=.5*t[2],e}([],function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}([],this.min,this.max))}quadrant(e){let t=[e%2==0,e<2],n=x(this.min),i=x(this.max);for(let e=0;e<t.length;e++)n[e]=t[e]?this.min[e]:this.center[e],i[e]=t[e]?this.center[e]:this.max[e];return i[2]=this.max[2],new nk(n,i)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}intersects(e){let n=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]],i=!0;for(let r=0;r<e.planes.length;r++){let o=e.planes[r],a=0;for(let e=0;e<n.length;e++)t.b0(o,n[e])>=0&&a++;if(0===a)return 0;a!==n.length&&(i=!1)}if(i)return 2;for(let t=0;t<3;t++){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE;for(let r=0;r<e.points.length;r++){let o=e.points[r][t]-this.min[t];n=Math.min(n,o),i=Math.max(i,o)}if(i<0||n>this.max[t]-this.min[t])return 0}return 1}}class nE{constructor(e=0,t=0,n=0,i=0){if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(n)||n<0||isNaN(i)||i<0)throw Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=n,this.right=i}interpolate(e,n,i){return null!=n.top&&null!=e.top&&(this.top=t.z.number(e.top,n.top,i)),null!=n.bottom&&null!=e.bottom&&(this.bottom=t.z.number(e.bottom,n.bottom,i)),null!=n.left&&null!=e.left&&(this.left=t.z.number(e.left,n.left,i)),null!=n.right&&null!=e.right&&(this.right=t.z.number(e.right,n.right,i)),this}getCenter(e,n){let i=t.ac((this.left+e-this.right)/2,0,e),r=t.ac((this.top+n-this.bottom)/2,0,n);return new t.P(i,r)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new nE(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class nA{constructor(e,n,i,r,o){this.tileSize=512,this._renderWorldCopies=void 0===o||!!o,this._minZoom=e||0,this._maxZoom=n||22,this._minPitch=null==i?0:i,this._maxPitch=null==r?60:r,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.M(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new nE,this._posMatrixCache={},this._alignedPosMatrixCache={},this.minElevationForCurrentTile=0}clone(){let e=new nA(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.apply(this),e}apply(e){this.tileSize=e.tileSize,this.latRange=e.latRange,this.width=e.width,this.height=e.height,this._center=e._center,this._elevation=e._elevation,this.minElevationForCurrentTile=e.minElevationForCurrentTile,this.zoom=e.zoom,this.angle=e.angle,this._fov=e._fov,this._pitch=e._pitch,this._unmodified=e._unmodified,this._edgeInsets=e._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new t.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(e){var n,i,r,o,a,s,l,c,d,u;let h=-t.b1(e,-180,180)*Math.PI/180;this.angle!==h&&(this._unmodified=!1,this.angle=h,this._calcMatrices(),this.rotationMatrix=(n=new t.A(4),t.A!=Float32Array&&(n[1]=0,n[2]=0),n[0]=1,n[3]=1,n),i=this.rotationMatrix,r=this.rotationMatrix,o=this.angle,a=r[0],s=r[1],l=r[2],c=r[3],d=Math.sin(o),u=Math.cos(o),i[0]=a*u+l*d,i[1]=s*u+c*d,i[2]=-(a*d)+l*u,i[3]=-(s*d)+c*u)}get pitch(){return this._pitch/Math.PI*180}set pitch(e){let n=t.ac(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(e){let t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.tileZoom=Math.max(0,Math.floor(t)),this.scale=this.zoomScale(t),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,n){this._unmodified=!1,this._edgeInsets.interpolate(e,t,n),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){return Math.max(0,(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize)))}getVisibleUnwrappedCoordinates(e){let n=[new t.b2(0,e)];if(this._renderWorldCopies){let i=this.pointCoordinate(new t.P(0,0)),r=this.pointCoordinate(new t.P(this.width,0)),o=this.pointCoordinate(new t.P(this.width,this.height)),a=this.pointCoordinate(new t.P(0,this.height)),s=Math.floor(Math.min(i.x,r.x,o.x,a.x)),l=Math.floor(Math.max(i.x,r.x,o.x,a.x));for(let i=s-1;i<=l+1;i++)0!==i&&n.push(new t.b2(i,e))}return n}coveringTiles(e){var n,i;let r=this.coveringZoomLevel(e),o=r;if(void 0!==e.minzoom&&r<e.minzoom)return[];void 0!==e.maxzoom&&r>e.maxzoom&&(r=e.maxzoom);let a=this.pointCoordinate(this.getCameraPoint()),s=t.Y.fromLngLat(this.center),l=Math.pow(2,r),c=[l*a.x,l*a.y,0],d=[l*s.x,l*s.y,0],u=nF.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),h=e.minzoom||0;!e.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(h=r);let m=e.terrain?2/Math.min(this.tileSize,e.tileSize)*this.tileSize:3,f=e=>({aabb:new nk([e*l,0,0],[(e+1)*l,l,0]),zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}),p=[],g=[],b=r,_=e.reparseOverscaled?o:r;if(this._renderWorldCopies)for(let e=1;e<=3;e++)p.push(f(-e)),p.push(f(e));for(p.push(f(0));p.length>0;){let r=p.pop(),o=r.x,a=r.y,s=r.fullyVisible;if(!s){let e=r.aabb.intersects(u);if(0===e)continue;s=2===e}let l=e.terrain?c:d,f=Math.max(Math.abs(r.aabb.distanceX(l)),Math.abs(r.aabb.distanceY(l)));if(r.zoom===b||f>m+(1<<b-r.zoom)-2&&r.zoom>=h){let e=b-r.zoom,n=c[0]-.5-(o<<e),i=c[1]-.5-(a<<e);g.push({tileID:new t.Q(r.zoom===b?_:r.zoom,r.wrap,r.zoom,o,a),distanceSq:C([d[0]-.5-o,d[1]-.5-a]),tileDistanceToCamera:Math.sqrt(n*n+i*i)})}else for(let l=0;l<4;l++){let c=(o<<1)+l%2,d=(a<<1)+(l>>1),u=r.zoom+1,h=r.aabb.quadrant(l);if(e.terrain){let o=new t.Q(u,r.wrap,u,c,d),a=e.terrain.getMinMaxElevation(o),s=null!=(n=a.minElevation)?n:this.elevation,l=null!=(i=a.maxElevation)?i:this.elevation;h=new nk([h.min[0],h.min[1],s],[h.max[0],h.max[1],l])}p.push({aabb:h,zoom:u,x:c,y:d,wrap:r.wrap,fullyVisible:s})}}return g.sort((e,t)=>e.distanceSq-t.distanceSq).map(e=>e.tileID)}resize(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(e){let n=t.ac(e.lat,-85.051129,85.051129);return new t.P(t.N(e.lng)*this.worldSize,t.O(n)*this.worldSize)}unproject(e){return new t.Y(e.x/this.worldSize,e.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(e){let n=this.elevation,i=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,r=this.pointLocation(this.centerPoint,e),o=e.getElevationForLngLatZoom(r,this.tileZoom);if(!(this.elevation-o))return;let a=Math.cos(this._pitch)*this.cameraToCenterDistance/(i+n-o)/t.b3(1,r.lat),s=this.scaleZoom(a/this.tileSize);this._elevation=o,this._center=r,this.zoom=s}setLocationAtPoint(e,n){let i=this.pointCoordinate(n),r=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(e),a=new t.Y(o.x-(i.x-r.x),o.y-(i.y-r.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(e,t){return t?this.coordinatePoint(this.locationCoordinate(e),t.getElevationForLngLatZoom(e,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(e))}pointLocation(e,t){return this.coordinateLocation(this.pointCoordinate(e,t))}locationCoordinate(e){return t.Y.fromLngLat(e)}coordinateLocation(e){return e&&e.toLngLat()}pointCoordinate(e,n){if(n){let t=n.pointCoordinate(e);if(null!=t)return t}let i=[e.x,e.y,0,1],r=[e.x,e.y,1,1];t.af(i,i,this.pixelMatrixInverse),t.af(r,r,this.pixelMatrixInverse);let o=i[3],a=r[3],s=i[1]/o,l=r[1]/a,c=i[2]/o,d=r[2]/a,u=c===d?0:(0-c)/(d-c);return new t.Y(t.z.number(i[0]/o,r[0]/a,u)/this.worldSize,t.z.number(s,l,u)/this.worldSize)}coordinatePoint(e,n=0,i=this.pixelMatrix){let r=[e.x*this.worldSize,e.y*this.worldSize,n,1];return t.af(r,r,i),new t.P(r[0]/r[3],r[1]/r[3])}getBounds(){let e=Math.max(0,this.height/2-this.getHorizon());return(new W).extend(this.pointLocation(new t.P(0,e))).extend(this.pointLocation(new t.P(this.width,e))).extend(this.pointLocation(new t.P(this.width,this.height))).extend(this.pointLocation(new t.P(0,this.height)))}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new W([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,85.051129])}calculatePosMatrix(e,n=!1){let i=e.key,r=n?this._alignedPosMatrixCache:this._posMatrixCache;if(r[i])return r[i];let o=e.canonical,a=this.worldSize/this.zoomScale(o.z),s=o.x+Math.pow(2,o.z)*e.wrap,l=t.an(new Float64Array(16));return t.H(l,l,[s*a,o.y*a,0]),t.J(l,l,[a/t.W,a/t.W,1]),t.K(l,n?this.alignedProjMatrix:this.projMatrix,l),r[i]=new Float32Array(l),r[i]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(e,n){let i,r;n=t.ac(+n,this.minZoom,this.maxZoom);let o={center:new t.M(e.lng,e.lat),zoom:n},a=this.lngRange;this._renderWorldCopies||null!==a||(a=[-(180-1e-10),180-1e-10]);let s=this.tileSize*this.zoomScale(o.zoom),l=0,c=s,d=0,u=s,h=0,m=0,{x:f,y:p}=this.size;if(this.latRange){let e=this.latRange;l=t.O(e[1])*s,(c=t.O(e[0])*s)-l<p&&(h=p/(c-l))}a&&(d=t.b1(t.N(a[0])*s,0,s),(u=t.b1(t.N(a[1])*s,0,s))<d&&(u+=s),u-d<f&&(m=f/(u-d)));let{x:g,y:b}=this.project.call({worldSize:s},e),_=Math.max(m||0,h||0);if(_){let e=new t.P(m?(u+d)/2:g,h?(c+l)/2:b);return o.center=this.unproject.call({worldSize:s},e).wrap(),o.zoom+=this.scaleZoom(_),o}if(this.latRange){let e=p/2;b-e<l&&(r=l+e),b+e>c&&(r=c-e)}if(a){let e=(d+u)/2,n=g;this._renderWorldCopies&&(n=t.b1(g,e-s/2,e+s/2));let r=f/2;n-r<d&&(i=d+r),n+r>u&&(i=u-r)}if(void 0!==i||void 0!==r){let e=new t.P(null!=i?i:g,null!=r?r:b);o.center=this.unproject.call({worldSize:s},e).wrap()}return o}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let e=this._unmodified,{center:t,zoom:n}=this.getConstrained(this.center,this.zoom);this.center=t,this.zoom=n,this._unmodified=e,this._constraining=!1}_calcMatrices(){if(!this.height)return;let e=this.centerOffset,n=this.point.x,i=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=t.b3(1,this.center.lat)*this.worldSize;let r=t.an(new Float64Array(16));t.J(r,r,[this.width/2,-this.height/2,1]),t.H(r,r,[1,-1,0]),this.labelPlaneMatrix=r,r=t.an(new Float64Array(16)),t.J(r,r,[1,-1,1]),t.H(r,r,[-1,-1,0]),t.J(r,r,[2/this.width,2/this.height,1]),this.glCoordMatrix=r;let o=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),a=Math.min(this.elevation,this.minElevationForCurrentTile),s=o-a*this._pixelPerMeter/Math.cos(this._pitch),l=a<0?s:o,c=Math.PI/2+this._pitch,d=this._fov*(.5+e.y/this.height),u=Math.sin(d)*l/Math.sin(t.ac(Math.PI-c-d,.01,Math.PI-.01)),h=this.getHorizon(),m=2*Math.atan(h/this.cameraToCenterDistance)*(.5+e.y/(2*h)),f=Math.min(u,Math.sin(m)*l/Math.sin(t.ac(Math.PI-c-m,.01,Math.PI-.01))),p=1.01*(Math.cos(Math.PI/2-this._pitch)*f+l),g=this.height/50;r=new Float64Array(16),t.b4(r,this._fov,this.width/this.height,g,p),r[8]=-(2*e.x)/this.width,r[9]=2*e.y/this.height,t.J(r,r,[1,-1,1]),t.H(r,r,[0,0,-this.cameraToCenterDistance]),t.b5(r,r,this._pitch),t.ad(r,r,this.angle),t.H(r,r,[-n,-i,0]),this.mercatorMatrix=t.J([],r,[this.worldSize,this.worldSize,this.worldSize]),t.J(r,r,[1,1,this._pixelPerMeter]),this.pixelMatrix=t.K(new Float64Array(16),this.labelPlaneMatrix,r),t.H(r,r,[0,0,-this.elevation]),this.projMatrix=r,this.invProjMatrix=t.ar([],r),this.pixelMatrix3D=t.K(new Float64Array(16),this.labelPlaneMatrix,r);let b=this.width%2/2,_=this.height%2/2,y=Math.cos(this.angle),v=Math.sin(this.angle),x=n-Math.round(n)+y*b+v*_,w=i-Math.round(i)+y*_+v*b,F=new Float64Array(r);if(t.H(F,F,[x>.5?x-1:x,w>.5?w-1:w,0]),this.alignedProjMatrix=F,!(r=t.ar(new Float64Array(16),this.pixelMatrix)))throw Error("failed to invert matrix");this.pixelMatrixInverse=r,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let e=this.pointCoordinate(new t.P(0,0)),n=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.af(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.P(0,e))}getCameraQueryGeometry(e){let n=this.getCameraPoint();if(1===e.length)return[e[0],n];{let i=n.x,r=n.y,o=n.x,a=n.y;for(let t of e)i=Math.min(i,t.x),r=Math.min(r,t.y),o=Math.max(o,t.x),a=Math.max(a,t.y);return[new t.P(i,r),new t.P(o,r),new t.P(o,a),new t.P(i,a),new t.P(i,r)]}}lngLatToCameraDepth(e,n){let i=this.locationCoordinate(e),r=[i.x*this.worldSize,i.y*this.worldSize,n,1];return t.af(r,r,this.projMatrix),r[2]/r[3]}}function nC(e,t){let n,i=!1,r=null,o=null,a=()=>{r=null,i&&(e.apply(o,n),r=setTimeout(a,t),i=!1)};return(...e)=>(i=!0,o=this,n=e,r||a(),r)}class nT{constructor(e){this._getCurrentHash=()=>{let e=window.location.hash.replace("#","");if(this._hashName){let t;return e.split("&").map(e=>e.split("=")).forEach(e=>{e[0]===this._hashName&&(t=e)}),(t&&t[1]||"").split("/")}return e.split("/")},this._onHashChange=()=>{let e=this._getCurrentHash();if(e.length>=3&&!e.some(e=>isNaN(e))){let t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let e=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,e)}catch(e){}},this._updateHash=nC(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(e){let t=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,i=Math.pow(10,Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10)),r=Math.round(t.lng*i)/i,o=Math.round(t.lat*i)/i,a=this._map.getBearing(),s=this._map.getPitch(),l="";if(l+=e?`/${r}/${o}/${n}`:`${n}/${o}/${r}`,(a||s)&&(l+="/"+Math.round(10*a)/10),s&&(l+=`/${Math.round(s)}`),this._hashName){let e=this._hashName,t=!1,n=window.location.hash.slice(1).split("&").map(n=>{let i=n.split("=")[0];return i===e?(t=!0,`${i}=${l}`):n}).filter(e=>e);return t||n.push(`${e}=${l}`),`#${n.join("&")}`}return`#${l}`}}let nS={linearity:.3,easing:t.b6(0,0,.3,1)},nM=t.e({deceleration:2500,maxSpeed:1400},nS),nL=t.e({deceleration:20,maxSpeed:1400},nS),nD=t.e({deceleration:1e3,maxSpeed:360},nS),nI=t.e({deceleration:1e3,maxSpeed:90},nS);class nR{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:u.now(),settings:e})}_drainInertiaBuffer(){let e=this._inertiaBuffer,t=u.now();for(;e.length>0&&t-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let n={zoom:0,bearing:0,pitch:0,pan:new t.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:e}of this._inertiaBuffer)n.zoom+=e.zoomDelta||0,n.bearing+=e.bearingDelta||0,n.pitch+=e.pitchDelta||0,e.panDelta&&n.pan._add(e.panDelta),e.around&&(n.around=e.around),e.pinchAround&&(n.pinchAround=e.pinchAround);let i=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,r={};if(n.pan.mag()){let o=nP(n.pan.mag(),i,t.e({},nM,e||{}));r.offset=n.pan.mult(o.amount/n.pan.mag()),r.center=this._map.transform.center,nO(r,o)}if(n.zoom){let e=nP(n.zoom,i,nL);r.zoom=this._map.transform.zoom+e.amount,nO(r,e)}if(n.bearing){let e=nP(n.bearing,i,nD);r.bearing=this._map.transform.bearing+t.ac(e.amount,-179,179),nO(r,e)}if(n.pitch){let e=nP(n.pitch,i,nI);r.pitch=this._map.transform.pitch+e.amount,nO(r,e)}if(r.zoom||r.bearing){let e=void 0===n.pinchAround?n.around:n.pinchAround;r.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),t.e(r,{noMoveStart:!0})}}function nO(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function nP(e,n,i){let{maxSpeed:r,linearity:o,deceleration:a}=i,s=t.ac(e*o/(n/1e3),-r,r),l=Math.abs(s)/(a*o);return{easing:i.easing,duration:1e3*l,amount:l/2*s}}class n$ extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,n,i,r={}){let o=h.mousePos(n.getCanvas(),i);super(e,t.e({point:o,lngLat:n.unproject(o),originalEvent:i},r)),this._defaultPrevented=!1,this.target=n}}class nN extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,n,i){let r="touchend"===e?i.changedTouches:i.touches,o=h.touchPos(n.getCanvasContainer(),r),a=o.map(e=>n.unproject(e)),s=o.reduce((e,t,n,i)=>e.add(t.div(i.length)),new t.P(0,0));super(e,{points:o,point:s,lngLats:a,lngLat:n.unproject(s),originalEvent:i}),this._defaultPrevented=!1}}class nB extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,n){super(e,{originalEvent:n}),this._defaultPrevented=!1}}class nz{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new nB(e.type,this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new n$(e.type,this._map,e))}mouseup(e){this._map.fire(new n$(e.type,this._map,e))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new n$(e.type,this._map,e))}dblclick(e){return this._firePreventable(new n$(e.type,this._map,e))}mouseover(e){this._map.fire(new n$(e.type,this._map,e))}mouseout(e){this._map.fire(new n$(e.type,this._map,e))}touchstart(e){return this._firePreventable(new nN(e.type,this._map,e))}touchmove(e){this._map.fire(new nN(e.type,this._map,e))}touchend(e){this._map.fire(new nN(e.type,this._map,e))}touchcancel(e){this._map.fire(new nN(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class nj{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new n$(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new n$("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new n$(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class nY{constructor(e){this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.pointLocation(t.P.convert(e),this._map.terrain)}}class nH{constructor(e,t){this._map=e,this._tr=new nY(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(h.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active||this._lastPos.equals(t)||!this._box&&t.dist(this._startPos)<this._clickTolerance)return;let n=this._startPos;this._lastPos=t,this._box||(this._box=h.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));let i=Math.min(n.x,t.x),r=Math.max(n.x,t.x),o=Math.min(n.y,t.y),a=Math.max(n.y,t.y);h.setTransform(this._box,`translate(${i}px,${o}px)`),this._box.style.width=r-i+"px",this._box.style.height=a-o+"px"}mouseupWindow(e,n){if(!this._active||0!==e.button)return;let i=this._startPos;if(this.reset(),h.suppressClick(),i.x!==n.x||i.y!==n.y)return this._map.fire(new t.k("boxzoomend",{originalEvent:e})),{cameraAnimation:e=>e.fitScreenCoordinates(i,n,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(h.remove(this._box),this._box=null),h.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,n){return this._map.fire(new t.k(e,{originalEvent:n}))}}function nU(e,t){if(e.length!==t.length)throw Error(`The number of touches and points are not equal - touches ${e.length}, points ${t.length}`);let n={};for(let i=0;i<e.length;i++)n[e[i].identifier]=t[i];return n}class nV{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,n,i){(this.centroid||i.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),i.length===this.numTouches&&(this.centroid=function(e){let n=new t.P(0,0);for(let t of e)n._add(t);return n.div(e.length)}(n),this.touches=nU(i,n)))}touchmove(e,t,n){if(this.aborted||!this.centroid)return;let i=nU(n,t);for(let e in this.touches){let t=i[e];(!t||t.dist(this.touches[e])>30)&&(this.aborted=!0)}}touchend(e,t,n){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===n.length){let e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class nW{constructor(e){this.singleTap=new nV(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,t,n){this.singleTap.touchstart(e,t,n)}touchmove(e,t,n){this.singleTap.touchmove(e,t,n)}touchend(e,t,n){let i=this.singleTap.touchend(e,t,n);if(i){let t=e.timeStamp-this.lastTime<500,n=!this.lastTap||30>this.lastTap.dist(i);if(t&&n||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=i,this.count===this.numTaps)return this.reset(),i}}}class nG{constructor(e){this._tr=new nY(e),this._zoomIn=new nW({numTouches:1,numTaps:2}),this._zoomOut=new nW({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,n){this._zoomIn.touchstart(e,t,n),this._zoomOut.touchstart(e,t,n)}touchmove(e,t,n){this._zoomIn.touchmove(e,t,n),this._zoomOut.touchmove(e,t,n)}touchend(e,t,n){let i=this._zoomIn.touchend(e,t,n),r=this._zoomOut.touchend(e,t,n),o=this._tr;return i?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:o.zoom+1,around:o.unproject(i)},{originalEvent:e})}):r?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:o.zoom-1,around:o.unproject(r)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class nq{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){let t=this._moveFunction(...e);if(t.bearingDelta||t.pitchDelta||t.around||t.panDelta)return this._active=!0,t}dragStart(e,t){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=t.length?t[0]:t,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,t){if(!this.isEnabled())return;let n=this._lastPoint;if(!n)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);let i=t.length?t[0]:t;return!this._moved&&i.dist(n)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=i,this._move(n,i))}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&h.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}let nK={0:1,2:2};class nX{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){let t=h.mouseButton(e);this._eventButton=t}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!function(e,t){let n=nK[t];return void 0===e.buttons||(e.buttons&n)!==n}(e,this._eventButton)}isValidEndEvent(e){return h.mouseButton(e)===this._eventButton}}class nZ{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return 1===e.targetTouches.length}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){this._firstTouch=e.targetTouches[0].identifier}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}}let nJ=e=>{e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=function(e){e.preventDefault()}},nQ=({enable:e,clickTolerance:t,bearingDegreesPerPixelMoved:n=.8})=>new nq({clickTolerance:t,move:(e,t)=>({bearingDelta:(t.x-e.x)*n}),moveStateManager:new nX({checkCorrectEvent:e=>0===h.mouseButton(e)&&e.ctrlKey||2===h.mouseButton(e)}),enable:e,assignEvents:nJ}),n0=({enable:e,clickTolerance:t,pitchDegreesPerPixelMoved:n=-.5})=>new nq({clickTolerance:t,move:(e,t)=>({pitchDelta:(t.y-e.y)*n}),moveStateManager:new nX({checkCorrectEvent:e=>0===h.mouseButton(e)&&e.ctrlKey||2===h.mouseButton(e)}),enable:e,assignEvents:nJ});class n1{constructor(e,t){this._clickTolerance=e.clickTolerance||1,this._map=t,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new t.P(0,0)}minTouchs(){return this._map.cooperativeGestures.isEnabled()?2:1}touchstart(e,t,n){return this._calculateTransform(e,t,n)}touchmove(e,t,n){if(this._active&&!(n.length<this.minTouchs()))return e.preventDefault(),this._calculateTransform(e,t,n)}touchend(e,t,n){this._calculateTransform(e,t,n),this._active&&n.length<this.minTouchs()&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,n,i){i.length>0&&(this._active=!0);let r=nU(i,n),o=new t.P(0,0),a=new t.P(0,0),s=0;for(let e in r){let t=r[e],n=this._touches[e];n&&(o._add(t),a._add(t.sub(n)),s++,r[e]=t)}if(this._touches=r,s<this.minTouchs()||!a.mag())return;let l=a.div(s);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:o.div(s),panDelta:l}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class n2{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,t,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,n){if(!this._firstTwoTouches)return;e.preventDefault();let[i,r]=this._firstTwoTouches,o=n5(n,t,i),a=n5(n,t,r);if(!o||!a)return;let s=this._aroundCenter?null:o.add(a).div(2);return this._move([o,a],s,e)}touchend(e,t,n){if(!this._firstTwoTouches)return;let[i,r]=this._firstTwoTouches,o=n5(n,t,i),a=n5(n,t,r);o&&a||(this._active&&h.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function n5(e,t,n){for(let i=0;i<e.length;i++)if(e[i].identifier===n)return t[i]}function n3(e,t){return Math.log(e/t)/Math.LN2}class n4 extends n2{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){let n=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(.1>Math.abs(n3(this._distance,this._startDistance))))return this._active=!0,{zoomDelta:n3(this._distance,n),pinchAround:t}}}function n6(e,t){return 180*e.angleWith(t)/Math.PI}class n8 extends n2{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t,n){let i=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:n6(this._vector,i),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());let t=25/(Math.PI*this._minDiameter)*360;return Math.abs(n6(e,this._startVector))<t}}function n7(e){return Math.abs(e.y)>Math.abs(e.x)}class n9 extends n2{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,t,n){super.touchstart(e,t,n),this._currentTouchCount=n.length}_start(e){this._lastPoints=e,n7(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,t,n){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let i=e[0].sub(this._lastPoints[0]),r=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(i,r,n.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:-((i.y+r.y)/2*.5)}):void 0}gestureBeginsVertically(e,t,n){if(void 0!==this._valid)return this._valid;let i=e.mag()>=2,r=t.mag()>=2;if(!i&&!r)return;if(!i||!r)return void 0===this._firstMove&&(this._firstMove=n),n-this._firstMove<100&&void 0;let o=e.y>0==t.y>0;return n7(e)&&n7(t)&&o}}let ie=100,it=15,ii=10;class ir{constructor(e){this._tr=new nY(e),this._panStep=ie,this._bearingStep=it,this._pitchStep=ii,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,n=0,i=0,r=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?n=-1:(e.preventDefault(),r=-1);break;case 39:e.shiftKey?n=1:(e.preventDefault(),r=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(n=0,i=0),{cameraAnimation:a=>{let s=this._tr;a.easeTo({duration:300,easeId:"keyboardHandler",easing:io,zoom:t?Math.round(s.zoom)+t*(e.shiftKey?2:1):s.zoom,bearing:s.bearing+n*this._bearingStep,pitch:s.pitch+i*this._pitchStep,offset:[-r*this._panStep,-o*this._panStep],center:s.center},{originalEvent:e})}}}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 io(e){return e*(2-e)}class ia{constructor(e,t){this._onTimeout=e=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)},this._map=e,this._tr=new nY(e),this._triggerRenderFrame=t,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around)}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(e){if(!this.isEnabled()||this._map.cooperativeGestures.isEnabled()&&!e[this._map.cooperativeGestures._bypassKey])return;let t=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=u.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==t&&t%4.000244140625==0?this._type="wheel":0!==t&&4>Math.abs(t)?this._type="trackpad":i>400?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=200>Math.abs(i*t)?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,t+=this._lastValue)),e.shiftKey&&t&&(t/=4),this._type&&(this._lastWheelEvent=e,this._delta-=t,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let n=h.mousePos(this._map.getCanvas(),e),i=this._tr;this._around=n.y>i.transform.height/2-i.transform.getHorizon()?t.M.convert(this._aroundCenter?i.center:i.unproject(n)):t.M.convert(i.center),this._aroundPoint=i.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let e=this._tr.transform;if(0!==this._delta){let t="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,n=2/(1+Math.exp(-Math.abs(this._delta*t)));this._delta<0&&0!==n&&(n=1/n);let i="number"==typeof this._targetZoom?e.zoomScale(this._targetZoom):e.scale;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(i*n))),"wheel"===this._type&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let n="number"==typeof this._targetZoom?this._targetZoom:e.zoom,i=this._startZoom,r=this._easing,o,a=!1;if("wheel"===this._type&&i&&r){let e=Math.min((u.now()-this._lastWheelEventTime)/200,1),s=r(e);o=t.z.number(i,n,s),e<1?this._frameId||(this._frameId=!0):a=!0}else o=n,a=!0;return this._active=!0,a&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!a,zoomDelta:o-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let n=t.b7;if(this._prevEase){let e=this._prevEase,i=(u.now()-e.start)/e.duration,r=e.easing(i+.01)-e.easing(i),o=.27/Math.sqrt(r*r+1e-4)*.01,a=Math.sqrt(.0729-o*o);n=t.b6(o,a,.25,1)}return this._prevEase={start:u.now(),duration:e,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class is{constructor(e,t){this._clickZoom=e,this._tapZoom=t}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class il{constructor(e){this._tr=new nY(e),this.reset()}reset(){this._active=!1}dblclick(e,t){return e.preventDefault(),{cameraAnimation:n=>{n.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ic{constructor(){this._tap=new nW({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,t,n){if(!this._swipePoint)if(this._tapTime){let i=t[0],r=e.timeStamp-this._tapTime<500,o=30>this._tapPoint.dist(i);r&&o?n.length>0&&(this._swipePoint=i,this._swipeTouch=n[0].identifier):this.reset()}else this._tap.touchstart(e,t,n)}touchmove(e,t,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;let i=t[0],r=i.y-this._swipePoint.y;return this._swipePoint=i,e.preventDefault(),this._active=!0,{zoomDelta:r/128}}}else this._tap.touchmove(e,t,n)}touchend(e,t,n){if(this._tapTime)this._swipePoint&&0===n.length&&this.reset();else{let i=this._tap.touchend(e,t,n);i&&(this._tapTime=e.timeStamp,this._tapPoint=i)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class id{constructor(e,t,n){this._el=e,this._mousePan=t,this._touchPan=n}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class iu{constructor(e,t,n){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=n}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class ih{constructor(e,t,n,i){this._el=e,this._touchZoom=t,this._touchRotate=n,this._tapDragZoom=i,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class im{constructor(e,t){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=e,this._options=t,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=h.create("div","maplibregl-cooperative-gesture-screen",e);let t=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(t=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let n=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),i=document.createElement("div");i.className="maplibregl-desktop-message",i.textContent=t,this._container.appendChild(i);let r=document.createElement("div");r.className="maplibregl-mobile-message",r.textContent=n,this._container.appendChild(r),this._container.setAttribute("aria-hidden","true")}_destoryUI(){this._container&&(h.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destoryUI()}isEnabled(){return this._enabled}touchmove(e){this._onCooperativeGesture(1===e.touches.length)}wheel(e){this._map.scrollZoom.isEnabled()&&this._onCooperativeGesture(!e[this._bypassKey])}_onCooperativeGesture(e){this._enabled&&e&&(this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let ip=e=>e.zoom||e.drag||e.pitch||e.rotate;class ig extends t.k{}function ib(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class i_{constructor(e,t){this.handleWindowEvent=e=>{this.handleEvent(e,`${e.type}Window`)},this.handleEvent=(e,t)=>{if("blur"===e.type)return void this.stop(!0);this._updatingCamera=!0;let n="renderFrame"===e.type?void 0:e,i={needsRenderFrame:!1},r={},o={},a=e.touches,s=a?this._getMapTouches(a):void 0,l=s?h.touchPos(this._map.getCanvas(),s):h.mousePos(this._map.getCanvas(),e);for(let{handlerName:a,handler:c,allowed:d}of this._handlers){let u;c.isEnabled()&&(this._blockedByActive(o,d,a)?c.reset():c[t||e.type]&&(u=c[t||e.type](e,l,s),this.mergeHandlerResult(i,r,u,a,n),u&&u.needsRenderFrame&&this._triggerRenderFrame()),(u||c.isActive())&&(o[a]=c))}let c={};for(let e in this._previousActiveHandlers)o[e]||(c[e]=n);this._previousActiveHandlers=o,(Object.keys(c).length||ib(i))&&(this._changes.push([i,r,c]),this._triggerRenderFrame()),(Object.keys(o).length||ib(i))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:d}=i;d&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],d(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new nR(e),this._bearingSnap=t.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(t);let n=this._el;for(let[e,t,i]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],[document,"mousemove",{capture:!0}],[document,"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],[window,"blur",void 0]],this._listeners))h.addEventListener(e,t,e===document?this.handleWindowEvent:this.handleEvent,i)}destroy(){for(let[e,t,n]of this._listeners)h.removeEventListener(e,t,e===document?this.handleWindowEvent:this.handleEvent,n)}_addDefaultHandlers(e){let t=this._map,n=t.getCanvasContainer();this._add("mapEvent",new nz(t,e));let i=t.boxZoom=new nH(t,e);this._add("boxZoom",i),e.interactive&&e.boxZoom&&i.enable();let r=t.cooperativeGestures=new im(t,e.cooperativeGestures);this._add("cooperativeGestures",r),e.cooperativeGestures&&r.enable();let o=new nG(t),a=new il(t);t.doubleClickZoom=new is(a,o),this._add("tapZoom",o),this._add("clickZoom",a),e.interactive&&e.doubleClickZoom&&t.doubleClickZoom.enable();let s=new ic;this._add("tapDragZoom",s);let l=t.touchPitch=new n9(t);this._add("touchPitch",l),e.interactive&&e.touchPitch&&t.touchPitch.enable(e.touchPitch);let c=nQ(e),d=n0(e);t.dragRotate=new iu(e,c,d),this._add("mouseRotate",c,["mousePitch"]),this._add("mousePitch",d,["mouseRotate"]),e.interactive&&e.dragRotate&&t.dragRotate.enable();let u=(({enable:e,clickTolerance:t})=>new nq({clickTolerance:t,move:(e,t)=>({around:t,panDelta:t.sub(e)}),activateOnStart:!0,moveStateManager:new nX({checkCorrectEvent:e=>0===h.mouseButton(e)&&!e.ctrlKey}),enable:e,assignEvents:nJ}))(e),m=new n1(e,t);t.dragPan=new id(n,u,m),this._add("mousePan",u),this._add("touchPan",m,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&t.dragPan.enable(e.dragPan);let f=new n8,p=new n4;t.touchZoomRotate=new ih(n,p,f,s),this._add("touchRotate",f,["touchPan","touchZoom"]),this._add("touchZoom",p,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&t.touchZoomRotate.enable(e.touchZoomRotate);let g=t.scrollZoom=new ia(t,()=>this._triggerRenderFrame());this._add("scrollZoom",g,["mousePan"]),e.interactive&&e.scrollZoom&&t.scrollZoom.enable(e.scrollZoom);let b=t.keyboard=new ir(t);this._add("keyboard",b),e.interactive&&e.keyboard&&t.keyboard.enable(),this._add("blockableMapEvent",new nj(t))}_add(e,t,n){this._handlers.push({handlerName:e,handler:t,allowed:n}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(let{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(let{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!ip(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,t,n){for(let i in e)if(i!==n&&(!t||0>t.indexOf(i)))return!0;return!1}_getMapTouches(e){let t=[];for(let n of e)this._el.contains(n.target)&&t.push(n);return t}mergeHandlerResult(e,n,i,r,o){if(!i)return;t.e(e,i);let a={handlerName:r,originalEvent:i.originalEvent||o};void 0!==i.zoomDelta&&(n.zoom=a),void 0!==i.panDelta&&(n.drag=a),void 0!==i.pitchDelta&&(n.pitch=a),void 0!==i.bearingDelta&&(n.rotate=a)}_applyChanges(){let e={},n={},i={};for(let[r,o,a]of this._changes)r.panDelta&&(e.panDelta=(e.panDelta||new t.P(0,0))._add(r.panDelta)),r.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+r.zoomDelta),r.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+r.bearingDelta),r.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+r.pitchDelta),void 0!==r.around&&(e.around=r.around),void 0!==r.pinchAround&&(e.pinchAround=r.pinchAround),r.noInertia&&(e.noInertia=r.noInertia),t.e(n,o),t.e(i,a);this._updateMapTransform(e,n,i),this._changes=[]}_updateMapTransform(e,t,n){let i=this._map,r=i._getTransformForUpdate(),o=i.terrain;if(!(ib(e)||o&&this._terrainMovement))return this._fireEvents(t,n,!0);let{panDelta:a,zoomDelta:s,bearingDelta:l,pitchDelta:c,around:d,pinchAround:u}=e;void 0!==u&&(d=u),i._stop(!0),d=d||i.transform.centerPoint;let h=r.pointLocation(a?d.sub(a):d);l&&(r.bearing+=l),c&&(r.pitch+=c),s&&(r.zoom+=s),o?!this._terrainMovement&&(t.drag||t.zoom)?(this._terrainMovement=!0,this._map._elevationFreeze=!0,r.setLocationAtPoint(h,d),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,r.recalculateZoom(i.terrain)})):t.drag&&this._terrainMovement?r.center=r.pointLocation(r.centerPoint.sub(a)):r.setLocationAtPoint(h,d):r.setLocationAtPoint(h,d),i._applyUpdatedTransform(r),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(t,n,!0)}_fireEvents(e,n,i){let r,o=ip(this._eventsInProgress),a=ip(e),s={};for(let t in e){let{originalEvent:n}=e[t];this._eventsInProgress[t]||(s[`${t}start`]=n),this._eventsInProgress[t]=e[t]}for(let e in!o&&a&&this._fireEvent("movestart",a.originalEvent),s)this._fireEvent(e,s[e]);for(let t in a&&this._fireEvent("move",a.originalEvent),e){let{originalEvent:n}=e[t];this._fireEvent(t,n)}let l={};for(let e in this._eventsInProgress){let{handlerName:t,originalEvent:i}=this._eventsInProgress[e];this._handlersById[t].isActive()||(delete this._eventsInProgress[e],r=n[t]||i,l[`${e}end`]=r)}for(let e in l)this._fireEvent(e,l[e]);let c=ip(this._eventsInProgress);if(i&&(o||a)&&!c){this._updatingCamera=!0;let e=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),n=e=>0!==e&&-this._bearingSnap<e&&e<this._bearingSnap;e&&(e.essential||!u.prefersReducedMotion)?(n(e.bearing||this._map.getBearing())&&(e.bearing=0),e.freezeElevation=!0,this._map.easeTo(e,{originalEvent:r})):(this._map.fire(new t.k("moveend",{originalEvent:r})),n(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(e,n){this._map.fire(new t.k(e,n?{originalEvent:n}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{delete this._frameId,this.handleEvent(new ig("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class iy extends t.E{constructor(e,t){super(),this._renderFrameCallback=()=>{let e=Math.min((u.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=t.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new t.M(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}panBy(e,n,i){return e=t.P.convert(e).mult(-1),this.panTo(this.transform.center,t.e({offset:e},n),i)}panTo(e,n,i){return this.easeTo(t.e({center:e},n),i)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(e,n,i){return this.easeTo(t.e({zoom:e},n),i)}zoomIn(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}zoomOut(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}getBearing(){return this.transform.bearing}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(e,n,i){return this.easeTo(t.e({bearing:e},n),i)}resetNorth(e,n){return this.rotateTo(0,t.e({duration:1e3},e),n),this}resetNorthPitch(e,n){return this.easeTo(t.e({bearing:0,pitch:0,duration:1e3},e),n),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}cameraForBounds(e,t){e=W.convert(e);let n=t&&t.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),n,t)}_cameraForBoxAndBearing(e,n,i,r){let o={top:0,bottom:0,right:0,left:0};if("number"==typeof(r=t.e({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},r)).padding){let e=r.padding;r.padding={top:e,bottom:e,right:e,left:e}}r.padding=t.e(o,r.padding);let a=this.transform,s=a.padding,l=new W(e,n),c=a.project(l.getNorthWest()),d=a.project(l.getNorthEast()),u=a.project(l.getSouthEast()),h=a.project(l.getSouthWest()),m=t.b8(-i),f=c.rotate(m),p=d.rotate(m),g=u.rotate(m),b=h.rotate(m),_=new t.P(Math.max(f.x,p.x,b.x,g.x),Math.max(f.y,p.y,b.y,g.y)),y=new t.P(Math.min(f.x,p.x,b.x,g.x),Math.min(f.y,p.y,b.y,g.y)),v=_.sub(y),x=(a.width-(s.left+s.right+r.padding.left+r.padding.right))/v.x,w=(a.height-(s.top+s.bottom+r.padding.top+r.padding.bottom))/v.y;if(w<0||x<0)return void t.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");let F=Math.min(a.scaleZoom(a.scale*Math.min(x,w)),r.maxZoom),k=t.P.convert(r.offset),E=new t.P((r.padding.left-r.padding.right)/2,(r.padding.top-r.padding.bottom)/2).rotate(t.b8(i)),A=k.add(E).mult(a.scale/a.zoomScale(F));return{center:a.unproject(c.add(u).div(2).sub(A)),zoom:F,bearing:i}}fitBounds(e,t,n){return this._fitInternal(this.cameraForBounds(e,t),t,n)}fitScreenCoordinates(e,n,i,r,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.P.convert(e)),this.transform.pointLocation(t.P.convert(n)),i,r),r,o)}_fitInternal(e,n,i){return e?(delete(n=t.e(e,n)).padding,n.linear?this.easeTo(n,i):this.flyTo(n,i)):this}jumpTo(e,n){this.stop();let i=this._getTransformForUpdate(),r=!1,o=!1,a=!1;return"zoom"in e&&i.zoom!==+e.zoom&&(r=!0,i.zoom=+e.zoom),void 0!==e.center&&(i.center=t.M.convert(e.center)),"bearing"in e&&i.bearing!==+e.bearing&&(o=!0,i.bearing=+e.bearing),"pitch"in e&&i.pitch!==+e.pitch&&(a=!0,i.pitch=+e.pitch),null==e.padding||i.isPaddingEqual(e.padding)||(i.padding=e.padding),this._applyUpdatedTransform(i),this.fire(new t.k("movestart",n)).fire(new t.k("move",n)),r&&this.fire(new t.k("zoomstart",n)).fire(new t.k("zoom",n)).fire(new t.k("zoomend",n)),o&&this.fire(new t.k("rotatestart",n)).fire(new t.k("rotate",n)).fire(new t.k("rotateend",n)),a&&this.fire(new t.k("pitchstart",n)).fire(new t.k("pitch",n)).fire(new t.k("pitchend",n)),this.fire(new t.k("moveend",n))}calculateCameraOptionsFromTo(e,n,i,r=0){let o=t.Y.fromLngLat(e,n),a=t.Y.fromLngLat(i,r),s=a.x-o.x,l=a.y-o.y,c=a.z-o.z,d=Math.hypot(s,l,c);if(0===d)throw Error("Can't calculate camera options with same From and To");let u=Math.hypot(s,l),h=this.transform.scaleZoom(this.transform.cameraToCenterDistance/d/this.transform.tileSize),m=180*Math.atan2(s,-l)/Math.PI,f=180*Math.acos(u/d)/Math.PI;return f=c<0?90-f:90+f,{center:a.toLngLat(),zoom:h,pitch:f,bearing:m}}easeTo(e,n){var i;let r,o;this._stop(!1,e.easeId),(!1===(e=t.e({offset:[0,0],duration:500,easing:t.b7},e)).animate||!e.essential&&u.prefersReducedMotion)&&(e.duration=0);let a=this._getTransformForUpdate(),s=this.getZoom(),l=this.getBearing(),c=this.getPitch(),d=this.getPadding(),h="bearing"in e?this._normalizeBearing(e.bearing,l):l,m="pitch"in e?+e.pitch:c,f="padding"in e?e.padding:a.padding,p=t.P.convert(e.offset),g=a.centerPoint.add(p),b=a.pointLocation(g),{center:_,zoom:y}=a.getConstrained(t.M.convert(e.center||b),null!=(i=e.zoom)?i:s);this._normalizeCenter(_);let v=a.project(b),x=a.project(_).sub(v),w=a.zoomScale(y-s);e.around&&(r=t.M.convert(e.around),o=a.locationPoint(r));let F={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||y!==s,this._rotating=this._rotating||l!==h,this._pitching=this._pitching||m!==c,this._padding=!a.isPaddingEqual(f),this._easeId=e.easeId,this._prepareEase(n,e.noMoveStart,F),this.terrain&&this._prepareElevation(_),this._ease(i=>{if(this._zooming&&(a.zoom=t.z.number(s,y,i)),this._rotating&&(a.bearing=t.z.number(l,h,i)),this._pitching&&(a.pitch=t.z.number(c,m,i)),this._padding&&(a.interpolatePadding(d,f,i),g=a.centerPoint.add(p)),this.terrain&&!e.freezeElevation&&this._updateElevation(i),r)a.setLocationAtPoint(r,o);else{let e=a.zoomScale(a.zoom-s),t=Math.pow(y>s?Math.min(2,w):Math.max(.5,w),1-i),n=a.unproject(v.add(x.mult(i*t)).mult(e));a.setLocationAtPoint(a.renderWorldCopies?n.wrap():n,g)}this._applyUpdatedTransform(a),this._fireMoveEvents(n)},e=>{this.terrain&&this._finalizeElevation(),this._afterEase(n,e)},e),this}_prepareEase(e,n,i={}){this._moving=!0,n||i.moving||this.fire(new t.k("movestart",e)),this._zooming&&!i.zooming&&this.fire(new t.k("zoomstart",e)),this._rotating&&!i.rotating&&this.fire(new t.k("rotatestart",e)),this._pitching&&!i.pitching&&this.fire(new t.k("pitchstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let n=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&n!==this._elevationTarget){let t=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(t-(n-(t*e+this._elevationStart))/(1-e)),this._elevationTarget=n}this.transform.elevation=t.z.number(this._elevationStart,this._elevationTarget,e)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(e){if(!this.transformCameraUpdate)return;let t=e.clone(),{center:n,zoom:i,pitch:r,bearing:o,elevation:a}=this.transformCameraUpdate(t);n&&(t.center=n),void 0!==i&&(t.zoom=i),void 0!==r&&(t.pitch=r),void 0!==o&&(t.bearing=o),void 0!==a&&(t.elevation=a),this.transform.apply(t)}_fireMoveEvents(e){this.fire(new t.k("move",e)),this._zooming&&this.fire(new t.k("zoom",e)),this._rotating&&this.fire(new t.k("rotate",e)),this._pitching&&this.fire(new t.k("pitch",e))}_afterEase(e,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;let i=this._zooming,r=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,i&&this.fire(new t.k("zoomend",e)),r&&this.fire(new t.k("rotateend",e)),o&&this.fire(new t.k("pitchend",e)),this.fire(new t.k("moveend",e))}flyTo(e,n){var i;if(!e.essential&&u.prefersReducedMotion){let i=t.L(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,n)}this.stop(),e=t.e({offset:[0,0],speed:1.2,curve:1.42,easing:t.b7},e);let r=this._getTransformForUpdate(),o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),l=this.getPadding(),c="bearing"in e?this._normalizeBearing(e.bearing,a):a,d="pitch"in e?+e.pitch:s,h="padding"in e?e.padding:r.padding,m=t.P.convert(e.offset),f=r.centerPoint.add(m),p=r.pointLocation(f),{center:g,zoom:b}=r.getConstrained(t.M.convert(e.center||p),null!=(i=e.zoom)?i:o);this._normalizeCenter(g);let _=r.zoomScale(b-o),y=r.project(p),v=r.project(g).sub(y),x=e.curve,w=Math.max(r.width,r.height),F=w/_,k=v.mag();if("minZoom"in e){let n=t.ac(Math.min(e.minZoom,o,b),r.minZoom,r.maxZoom);x=Math.sqrt(w/r.zoomScale(n-o)/k*2)}let E=x*x;function A(e){let t=(F*F-w*w+(e?-1:1)*E*E*k*k)/(2*(e?F:w)*E*k);return Math.log(Math.sqrt(t*t+1)-t)}function C(e){return(Math.exp(e)-Math.exp(-e))/2}function T(e){return(Math.exp(e)+Math.exp(-e))/2}let S=A(!1),M=function(e){return T(S)/T(S+x*e)},D=function(e){var t;return w*((T(S)*(C(t=S+x*e)/T(t))-C(S))/E)/k},I=(A(!0)-S)/x;if(1e-6>Math.abs(k)||!isFinite(I)){if(1e-6>Math.abs(w-F))return this.easeTo(e,n);let t=F<w?-1:1;I=Math.abs(Math.log(F/w))/x,D=function(){return 0},M=function(e){return Math.exp(t*x*e)}}return e.duration="duration"in e?+e.duration:1e3*I/("screenSpeed"in e?e.screenSpeed/x:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=a!==c,this._pitching=d!==s,this._padding=!r.isPaddingEqual(h),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(g),this._ease(i=>{let u=i*I,p=1/M(u);r.zoom=1===i?b:o+r.scaleZoom(p),this._rotating&&(r.bearing=t.z.number(a,c,i)),this._pitching&&(r.pitch=t.z.number(s,d,i)),this._padding&&(r.interpolatePadding(l,h,i),f=r.centerPoint.add(m)),this.terrain&&!e.freezeElevation&&this._updateElevation(i);let _=1===i?g:r.unproject(y.add(v.mult(D(u))).mult(p));r.setLocationAtPoint(r.renderWorldCopies?_.wrap():_,f),this._applyUpdatedTransform(r),this._fireMoveEvents(n)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(n)},e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let e=this._onEaseEnd;delete this._onEaseEnd,e.call(this,t)}if(!e){let e=this.handlers;e&&e.stop(!1)}return this}_ease(e,t,n){!1===n.animate||0===n.duration?(e(1),t()):(this._easeStart=u.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=t,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,n){let i=Math.abs((e=t.b1(e,-180,180))-n);return Math.abs(e-360-n)<i&&(e-=360),Math.abs(e+360-n)<i&&(e+=360),e}_normalizeCenter(e){let t=this.transform;if(!t.renderWorldCopies||t.lngRange)return;let n=e.lng-t.center.lng;e.lng+=n>180?-360:360*(n<-180)}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(t.M.convert(e),this.transform.tileZoom)-this.transform.elevation:null}}let iv={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class ix{constructor(e=iv){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=e=>{e&&("metadata"===e.sourceDataType||"visibility"===e.sourceDataType||"style"===e.dataType||"terrain"===e.type)&&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=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=h.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=h.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=h.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(){h.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,t){let n=this._map._getUIString(`AttributionControl.${t}`);e.title=n,e.setAttribute("aria-label",n)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(e=>"string"!=typeof e?"":e)):"string"==typeof this.options.customAttribution&&e.push(this.options.customAttribution)),this._map.style.stylesheet){let e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}let t=this._map.style.sourceCaches;for(let n in t){let i=t[n];if(i.used||i.usedForTerrain){let t=i.getSource();t.attribution&&0>e.indexOf(t.attribution)&&e.push(t.attribution)}}(e=e.filter(e=>String(e).trim())).sort((e,t)=>e.length-t.length);let n=(e=e.filter((t,n)=>{for(let i=n+1;i<e.length;i++)if(e[i].indexOf(t)>=0)return!1;return!0})).join(" | ");n!==this._attribHTML&&(this._attribHTML=n,e.length?(this._innerContainer.innerHTML=n,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class iw{constructor(e={}){this._updateCompact=()=>{let e=this._container.children;if(e.length){let t=e[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&t.classList.add("maplibregl-compact"):t.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=h.create("div","maplibregl-ctrl");let t=h.create("a","maplibregl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://maplibre.org/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){h.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class iF{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){let t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){let t=this._currentlyRunning;for(let n of t?this._queue.concat(t):this._queue)if(n.id===e)return void(n.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw Error("Attempting to run(), but is already running.");let t=this._currentlyRunning=this._queue;for(let n of(this._queue=[],t))if(!n.cancelled&&(n.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var ik=t.X([{name:"a_pos3d",type:"Int16",components:3}]);class iE extends t.E{constructor(e){super(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,e.usedForTerrain=!0,e.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,n){this.sourceCache.update(e,n),this._renderableTilesKeys=[];let i={};for(let r of e.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n}))i[r.key]=!0,this._renderableTilesKeys.push(r.key),this._tiles[r.key]||(r.posMatrix=new Float64Array(16),t.aN(r.posMatrix,0,t.W,0,t.W,0,1),this._tiles[r.key]=new el(r,this.tileSize));for(let e in this._tiles)i[e]||delete this._tiles[e]}freeRtt(e){for(let t in this._tiles){let n=this._tiles[t];(!e||n.tileID.equals(e)||n.tileID.isChildOf(e)||e.isChildOf(n.tileID))&&(n.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e){let n={};for(let i of this._renderableTilesKeys){let r=this._tiles[i].tileID;if(r.canonical.equals(e.canonical)){let r=e.clone();r.posMatrix=new Float64Array(16),t.aN(r.posMatrix,0,t.W,0,t.W,0,1),n[i]=r}else if(r.canonical.isChildOf(e.canonical)){let o=e.clone();o.posMatrix=new Float64Array(16);let a=r.canonical.z-e.canonical.z,s=r.canonical.x-(r.canonical.x>>a<<a),l=r.canonical.y-(r.canonical.y>>a<<a),c=t.W>>a;t.aN(o.posMatrix,0,c,0,c,0,1),t.H(o.posMatrix,o.posMatrix,[-s*c,-l*c,0]),n[i]=o}else if(e.canonical.isChildOf(r.canonical)){let o=e.clone();o.posMatrix=new Float64Array(16);let a=e.canonical.z-r.canonical.z,s=e.canonical.x-(e.canonical.x>>a<<a),l=e.canonical.y-(e.canonical.y>>a<<a),c=t.W>>a;t.aN(o.posMatrix,0,t.W,0,t.W,0,1),t.H(o.posMatrix,o.posMatrix,[s*c,l*c,0]),t.J(o.posMatrix,o.posMatrix,[1/2**a,1/2**a,0]),n[i]=o}}return n}getSourceTile(e,t){let n=this.sourceCache._source,i=e.overscaledZ-this.deltaZoom;if(i>n.maxzoom&&(i=n.maxzoom),i<n.minzoom)return null;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(i).key);let r=this.sourceCache.getTileByID(this._sourceTileCache[e.key]);if((!r||!r.dem)&&t)for(;i>=n.minzoom&&(!r||!r.dem);)r=this.sourceCache.getTileByID(e.scaledTo(i--).key);return r}tilesAfterTime(e=Date.now()){return Object.values(this._tiles).filter(t=>t.timeAdded>=e)}}class iA{constructor(e,t,n){this.painter=e,this.sourceCache=new iE(t),this.options=n,this.exaggeration="number"==typeof n.exaggeration?n.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,n,i,r=t.W){var o,a,s,l,c,d;if(!(n>=0&&n<r&&i>=0&&i<r))return 0;let u=this.getTerrainData(e),h=null==(o=u.tile)?void 0:o.dem;if(!h)return 0;let m=(a=[],s=[n/r*t.W,i/r*t.W],l=u.u_terrain_matrix,c=s[0],d=s[1],a[0]=l[0]*c+l[4]*d+l[12],a[1]=l[1]*c+l[5]*d+l[13],a),f=[m[0]*h.dim,m[1]*h.dim],p=Math.floor(f[0]),g=Math.floor(f[1]),b=f[0]-p,_=f[1]-g;return h.get(p,g)*(1-b)*(1-_)+h.get(p+1,g)*b*(1-_)+h.get(p,g+1)*(1-b)*_+h.get(p+1,g+1)*b*_}getElevationForLngLatZoom(e,n){let{tileID:i,mercatorX:r,mercatorY:o}=this._getOverscaledTileIDFromLngLatZoom(e,n);return this.getElevation(i,r%t.W,o%t.W,t.W)}getElevation(e,n,i,r=t.W){return this.getDEMElevation(e,n,i,r)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){let e=this.painter.context,n=new t.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new S(e,n,e.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new S(e,new t.R({width:1,height:1}),e.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=t.an([])}let n=this.sourceCache.getSourceTile(e,!0);if(n&&n.dem&&(!n.demTexture||n.needsTerrainPrepare)){let e=this.painter.context;n.demTexture=this.painter.getTileTexture(n.dem.stride),n.demTexture?n.demTexture.update(n.dem.getPixels(),{premultiply:!1}):n.demTexture=new S(e,n.dem.getPixels(),e.gl.RGBA,{premultiply:!1}),n.demTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),n.needsTerrainPrepare=!1}let i=n&&n+n.tileID.key+e.key;if(i&&!this._demMatrixCache[i]){let i=this.sourceCache.sourceCache._source.maxzoom,r=e.canonical.z-n.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=i?r=e.canonical.z-i:t.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let o=e.canonical.x-(e.canonical.x>>r<<r),a=e.canonical.y-(e.canonical.y>>r<<r),s=t.b9(new Float64Array(16),[1/(t.W<<r),1/(t.W<<r),0]);t.H(s,s,[o*t.W,a*t.W,0]),this._demMatrixCache[e.key]={matrix:s,coord:e}}return{u_depth:2,u_terrain:3,u_terrain_dim:n&&n.dem&&n.dem.dim||1,u_terrain_matrix:i?this._demMatrixCache[e.key].matrix:this._emptyDemMatrix,u_terrain_unpack:n&&n.dem&&n.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(n&&n.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:n}}getFramebuffer(e){let t=this.painter,n=t.width/devicePixelRatio,i=t.height/devicePixelRatio;return this._fbo&&(this._fbo.width!==n||this._fbo.height!==i)&&(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new S(t.context,{width:n,height:i,data:null},t.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(t.context.gl.NEAREST,t.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new S(t.context,{width:n,height:i,data:null},t.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(t.context.gl.NEAREST,t.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=t.context.createFramebuffer(n,i,!0,!1),this._fbo.depthAttachment.set(t.context.createRenderbuffer(t.context.gl.DEPTH_COMPONENT16,n,i))),this._fbo.colorAttachment.set("coords"===e?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let n=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let e=0,t=0;e<this._coordsTextureSize;e++)for(let i=0;i<this._coordsTextureSize;i++,t+=4)n[t+0]=255&i,n[t+1]=255&e,n[t+2]=i>>8<<4|e>>8,n[t+3]=0;let i=new S(e,new t.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),e.gl.RGBA,{premultiply:!1});return i.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=i,i}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);let n=new Uint8Array(4),i=this.painter.context,r=i.gl;i.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),r.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,r.RGBA,r.UNSIGNED_BYTE,n),i.bindFramebuffer.set(null);let o=n[0]+(n[2]>>4<<8),a=n[1]+((15&n[2])<<8),s=this.coordsIndex[255-n[3]],l=s&&this.sourceCache.getTileByID(s);if(!l)return null;let c=this._coordsTextureSize,d=(1<<l.tileID.canonical.z)*c;return new t.Y((l.tileID.canonical.x*c+o)/d+l.tileID.wrap,(l.tileID.canonical.y*c+a)/d,this.getElevation(l.tileID,o,a,c))}depthAtPoint(e){let t=new Uint8Array(4),n=this.painter.context,i=n.gl;return n.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),i.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,i.RGBA,i.UNSIGNED_BYTE,t),n.bindFramebuffer.set(null),(t[0]/0x1000000+t[1]/65536+t[2]/256+t[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;let e=this.painter.context,n=new t.ba,i=new t.aX,r=this.meshSize,o=t.W/r,a=r*r;for(let e=0;e<=r;e++)for(let t=0;t<=r;t++)n.emplaceBack(t*o,e*o,0);for(let e=0;e<a;e+=r+1)for(let t=0;t<r;t++)i.emplaceBack(t+e,r+t+e+1,r+t+e+2),i.emplaceBack(t+e,r+t+e+2,t+e+1);let s=n.length,l=s+2*(r+1);for(let e of[0,1])for(let i=0;i<=r;i++)for(let r of[0,1])n.emplaceBack(i*o,e*t.W,r);for(let e=0;e<2*r;e+=2)i.emplaceBack(l+e,l+e+1,l+e+3),i.emplaceBack(l+e,l+e+3,l+e+2),i.emplaceBack(s+e,s+e+3,s+e+1),i.emplaceBack(s+e,s+e+2,s+e+3);let c=n.length,d=c+2*(r+1);for(let e of[0,1])for(let i=0;i<=r;i++)for(let r of[0,1])n.emplaceBack(e*t.W,i*o,r);for(let e=0;e<2*r;e+=2)i.emplaceBack(c+e,c+e+1,c+e+3),i.emplaceBack(c+e,c+e+3,c+e+2),i.emplaceBack(d+e,d+e+3,d+e+1),i.emplaceBack(d+e,d+e+2,d+e+3);return this._mesh={indexBuffer:e.createIndexBuffer(i),vertexBuffer:e.createVertexBuffer(n,ik.members),segments:t.$.simpleSegment(0,0,n.length,i.length)},this._mesh}getMeshFrameDelta(e){return 2*Math.PI*t.bb/Math.pow(2,e)/5}getMinTileElevationForLngLatZoom(e,t){var n;let{tileID:i}=this._getOverscaledTileIDFromLngLatZoom(e,t);return null!=(n=this.getMinMaxElevation(i).minElevation)?n:0}getMinMaxElevation(e){let t=this.getTerrainData(e).tile,n={minElevation:null,maxElevation:null};return t&&t.dem&&(n.minElevation=t.dem.min*this.exaggeration,n.maxElevation=t.dem.max*this.exaggeration),n}_getOverscaledTileIDFromLngLatZoom(e,n){let i=t.Y.fromLngLat(e.wrap()),r=(1<<n)*t.W,o=i.x*r,a=i.y*r,s=Math.floor(o/t.W),l=Math.floor(a/t.W);return{tileID:new t.Q(n,0,n,s,l),mercatorX:o,mercatorY:a}}}class iC{constructor(e,t,n){this._context=e,this._size=t,this._tileSize=n,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let e of this._objects)e.texture.destroy(),e.fbo.destroy()}_createObject(e){let t=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),n=new S(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return n.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),t.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),t.colorAttachment.set(n.texture),{id:e,fbo:t,texture:n,stamp:-1,inUse:!1}}getObjectForId(e){return this._objects[e]}useObject(e){e.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(t=>e.id!==t),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(let e of this._recentlyUsed)if(!this._objects[e].inUse)return this._objects[e];if(this._objects.length>=this._size)throw Error("No free RenderPool available, call freeAllObjects() required!");let e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(let e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length<this._size)&&!1===this._objects.some(e=>!e.inUse)}}let iT={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class iS{constructor(e,t){this.painter=e,this.terrain=t,this.pool=new iC(e.context,30,t.sourceCache.tileSize*t.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,t){for(let n in this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter(n=>!e._layers[n].isHidden(t)),this._coordsDescendingInv={},e.sourceCaches)for(let t of(this._coordsDescendingInv[n]={},e.sourceCaches[n].getVisibleCoordinates())){let e=this.terrain.sourceCache.getTerrainCoords(t);for(let t in e)this._coordsDescendingInv[n][t]||(this._coordsDescendingInv[n][t]=[]),this._coordsDescendingInv[n][t].push(e[t])}for(let t of(this._coordsDescendingInvStr={},e._order)){let n=e._layers[t],i=n.source;if(iT[n.type]&&!this._coordsDescendingInvStr[i])for(let e in this._coordsDescendingInvStr[i]={},this._coordsDescendingInv[i])this._coordsDescendingInvStr[i][e]=this._coordsDescendingInv[i][e].map(e=>e.key).sort().join()}for(let e of this._renderableTiles)for(let t in this._coordsDescendingInvStr){let n=this._coordsDescendingInvStr[t][e.tileID.key];n&&n!==e.rttCoords[t]&&(e.rtt=[])}}renderLayer(e){if(e.isHidden(this.painter.transform.zoom))return!1;let n=e.type,i=this.painter,r=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(iT[n]&&(this._prevType&&iT[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(e.id),!r))return!0;if(iT[this._prevType]||iT[n]&&r){this._prevType=n;let e=this._stacks.length-1,r=this._stacks[e]||[];for(let n of this._renderableTiles){if(this.pool.isFull()&&(nx(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(n),n.rtt[e]){let t=this.pool.getObjectForId(n.rtt[e].id);if(t.stamp===n.rtt[e].stamp){this.pool.useObject(t);continue}}let o=this.pool.getOrCreateFreeObject();this.pool.useObject(o),this.pool.stampObject(o),n.rtt[e]={id:o.id,stamp:o.stamp},i.context.bindFramebuffer.set(o.fbo.framebuffer),i.context.clear({color:t.aO.transparent,stencil:0}),i.currentStencilSource=void 0;for(let e=0;e<r.length;e++){let t=i.style._layers[r[e]],a=t.source?this._coordsDescendingInv[t.source][n.tileID.key]:[n.tileID];i.context.viewport.set([0,0,o.fbo.width,o.fbo.height]),i._renderTileClippingMasks(t,a),i.renderLayer(i,i.style.sourceCaches[t.source],t,a),t.source&&(n.rttCoords[t.source]=this._coordsDescendingInvStr[t.source][n.tileID.key])}}return nx(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),iT[n]}return!1}}let iM={"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","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","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"},iL={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:iv,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:t.a.MAX_TILE_CACHE_ZOOM_LEVELS,localIdeographFontFamily:"sans-serif",transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,validateStyle:!0,maxCanvasSize:[4096,4096]},iD=e=>{e.touchstart=e.dragStart,e.touchmoveWindow=e.dragMove,e.touchend=e.dragEnd},iI={showCompass:!0,showZoom:!0,visualizePitch:!1};class iR{constructor(e,n,i=!1){this.mousedown=e=>{this.startMouse(t.e({},e,{ctrlKey:!0,preventDefault:()=>e.preventDefault()}),h.mousePos(this.element,e)),h.addEventListener(window,"mousemove",this.mousemove),h.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=e=>{this.moveMouse(e,h.mousePos(this.element,e))},this.mouseup=e=>{this.mouseRotate.dragEnd(e),this.mousePitch&&this.mousePitch.dragEnd(e),this.offTemp()},this.touchstart=e=>{1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=h.touchPos(this.element,e.targetTouches)[0],this.startTouch(e,this._startPos),h.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),h.addEventListener(window,"touchend",this.touchend))},this.touchmove=e=>{1!==e.targetTouches.length?this.reset():(this._lastPos=h.touchPos(this.element,e.targetTouches)[0],this.moveTouch(e,this._lastPos))},this.touchend=e=>{0===e.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.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;let r=e.dragRotate._mouseRotate.getClickTolerance(),o=e.dragRotate._mousePitch.getClickTolerance();this.element=n,this.mouseRotate=nQ({clickTolerance:r,enable:!0}),this.touchRotate=(({enable:e,clickTolerance:t,bearingDegreesPerPixelMoved:n=.8})=>new nq({clickTolerance:t,move:(e,t)=>({bearingDelta:(t.x-e.x)*n}),moveStateManager:new nZ,enable:e,assignEvents:iD}))({clickTolerance:r,enable:!0}),this.map=e,i&&(this.mousePitch=n0({clickTolerance:o,enable:!0}),this.touchPitch=(({enable:e,clickTolerance:t,pitchDegreesPerPixelMoved:n=-.5})=>new nq({clickTolerance:t,move:(e,t)=>({pitchDelta:(t.y-e.y)*n}),moveStateManager:new nZ,enable:e,assignEvents:iD}))({clickTolerance:o,enable:!0})),h.addEventListener(n,"mousedown",this.mousedown),h.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),h.addEventListener(n,"touchcancel",this.reset)}startMouse(e,t){this.mouseRotate.dragStart(e,t),this.mousePitch&&this.mousePitch.dragStart(e,t),h.disableDrag()}startTouch(e,t){this.touchRotate.dragStart(e,t),this.touchPitch&&this.touchPitch.dragStart(e,t),h.disableDrag()}moveMouse(e,t){let n=this.map,{bearingDelta:i}=this.mouseRotate.dragMove(e,t)||{};if(i&&n.setBearing(n.getBearing()+i),this.mousePitch){let{pitchDelta:i}=this.mousePitch.dragMove(e,t)||{};i&&n.setPitch(n.getPitch()+i)}}moveTouch(e,t){let n=this.map,{bearingDelta:i}=this.touchRotate.dragMove(e,t)||{};if(i&&n.setBearing(n.getBearing()+i),this.touchPitch){let{pitchDelta:i}=this.touchPitch.dragMove(e,t)||{};i&&n.setPitch(n.getPitch()+i)}}off(){let e=this.element;h.removeEventListener(e,"mousedown",this.mousedown),h.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),h.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),h.removeEventListener(window,"touchend",this.touchend),h.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){h.enableDrag(),h.removeEventListener(window,"mousemove",this.mousemove),h.removeEventListener(window,"mouseup",this.mouseup),h.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),h.removeEventListener(window,"touchend",this.touchend)}}function iO(e,n,i){let r=new t.M(e.lng,e.lat);if(e=new t.M(e.lng,e.lat),n){let r=new t.M(e.lng-360,e.lat),o=new t.M(e.lng+360,e.lat),a=i.locationPoint(e).distSqr(n);i.locationPoint(r).distSqr(n)<a?e=r:i.locationPoint(o).distSqr(n)<a&&(e=o)}for(;Math.abs(e.lng-i.center.lng)>180;){let t=i.locationPoint(e);if(t.x>=0&&t.y>=0&&t.x<=i.width&&t.y<=i.height)break;e.lng>i.center.lng?e.lng-=360:e.lng+=360}return e.lng!==r.lng&&i.locationPoint(e).y>i.height/2-i.getHorizon()?e:r}let iP={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 i$(e,t,n){let i=e.classList;for(let e in iP)i.remove(`maplibregl-${n}-anchor-${e}`);i.add(`maplibregl-${n}-anchor-${t}`)}class iN extends t.E{constructor(e){if(super(),this._onKeyPress=e=>{let t=e.code,n=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==n&&13!==n||this.togglePopup()},this._onMapClick=e=>{let t=e.originalEvent.target,n=this._element;this._popup&&(t===n||n.contains(t))&&this.togglePopup()},this._update=e=>{var t;if(!this._map)return;let n=this._map.loaded()&&!this._map.isMoving();"terrain"!==(null==e?void 0:e.type)&&("render"!==(null==e?void 0:e.type)||n)||this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?iO(this._lngLat,this._flatPos,this._map.transform):null==(t=this._lngLat)?void 0:t.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let i="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?i=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(i=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let r="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?r="rotateX(0deg)":"map"===this._pitchAlignment&&(r=`rotateX(${this._map.getPitch()}deg)`),e&&"moveend"!==e.type||(this._pos=this._pos.round()),h.setTransform(this._element,`${iP[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${r} ${i}`),u.frameAsync(new AbortController).then(()=>{this._updateOpacity(e&&"moveend"===e.type)}).catch(()=>{})},this._onMove=e=>{if(!this._isDragging){let t=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=t}this._isDragging&&(this._pos=e.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 t.k("dragstart"))),this.fire(new t.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.k("dragend")),this._state="inactive"},this._addDragHandler=e=>{this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.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=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&"auto"!==e.pitchAlignment?e.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(null==e?void 0:e.opacity,null==e?void 0:e.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=t.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=h.create("div"),this._element.setAttribute("aria-label","Map marker");let n=h.createNS("http://www.w3.org/2000/svg","svg");n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height","41px"),n.setAttributeNS(null,"width","27px"),n.setAttributeNS(null,"viewBox","0 0 27 41");let i=h.createNS("http://www.w3.org/2000/svg","g");i.setAttributeNS(null,"stroke","none"),i.setAttributeNS(null,"stroke-width","1"),i.setAttributeNS(null,"fill","none"),i.setAttributeNS(null,"fill-rule","evenodd");let r=h.createNS("http://www.w3.org/2000/svg","g");r.setAttributeNS(null,"fill-rule","nonzero");let o=h.createNS("http://www.w3.org/2000/svg","g");for(let e of(o.setAttributeNS(null,"transform","translate(3.0, 29.0)"),o.setAttributeNS(null,"fill","#000000"),[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}])){let t=h.createNS("http://www.w3.org/2000/svg","ellipse");t.setAttributeNS(null,"opacity","0.04"),t.setAttributeNS(null,"cx","10.5"),t.setAttributeNS(null,"cy","5.80029008"),t.setAttributeNS(null,"rx",e.rx),t.setAttributeNS(null,"ry",e.ry),o.appendChild(t)}let a=h.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"fill",this._color);let s=h.createNS("http://www.w3.org/2000/svg","path");s.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),a.appendChild(s);let l=h.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"opacity","0.25"),l.setAttributeNS(null,"fill","#000000");let c=h.createNS("http://www.w3.org/2000/svg","path");c.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),l.appendChild(c);let d=h.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"transform","translate(6.0, 7.0)"),d.setAttributeNS(null,"fill","#FFFFFF");let u=h.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"transform","translate(8.0, 8.0)");let m=h.createNS("http://www.w3.org/2000/svg","circle");m.setAttributeNS(null,"fill","#000000"),m.setAttributeNS(null,"opacity","0.25"),m.setAttributeNS(null,"cx","5.5"),m.setAttributeNS(null,"cy","5.5"),m.setAttributeNS(null,"r","5.4999962");let f=h.createNS("http://www.w3.org/2000/svg","circle");f.setAttributeNS(null,"fill","#FFFFFF"),f.setAttributeNS(null,"cx","5.5"),f.setAttributeNS(null,"cy","5.5"),f.setAttributeNS(null,"r","5.4999962"),u.appendChild(m),u.appendChild(f),r.appendChild(o),r.appendChild(a),r.appendChild(l),r.appendChild(d),r.appendChild(u),n.appendChild(r),n.setAttributeNS(null,"height",41*this._scale+"px"),n.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(n),this._offset=t.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",e=>{e.preventDefault()}),this._element.addEventListener("mousedown",e=>{e.preventDefault()}),i$(this._element,this._anchor,"marker"),e&&e.className)for(let t of e.className.split(" "))this._element.classList.add(t);this._popup=null}addTo(e){return this.remove(),this._map=e,e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),h.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=t.M.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){let t=Math.abs(13.5)/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[t,-1*(24.6+t)],"bottom-right":[-t,-1*(24.6+t)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}getPopup(){return this._popup}togglePopup(){let e=this._popup;return this._element.style.opacity===this._opacityWhenCovered||e&&(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map))),this}_updateOpacity(e=!1){var n,i;if(!(null==(n=this._map)?void 0:n.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let r=this._map,o=r.terrain.depthAtPoint(this._pos),a=r.terrain.getElevationForLngLatZoom(this._lngLat,r.transform.tileZoom);if(r.transform.lngLatToCameraDepth(this._lngLat,a)-o<.006)return void(this._element.style.opacity=this._opacity);let s=-this._offset.y/r.transform._pixelPerMeter,l=Math.sin(r.getPitch()*Math.PI/180)*s,c=r.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),d=r.transform.lngLatToCameraDepth(this._lngLat,a+l)-c>.006;(null==(i=this._popup)?void 0:i.isOpen())&&d&&this._popup.remove(),this._element.style.opacity=d?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=t.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&"auto"!==e?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,t){return void 0===e&&void 0===t&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==e&&(this._opacity=e),void 0!==t&&(this._opacityWhenCovered=t),this._map&&this._updateOpacity(!0),this}}let iB={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},iz=0,ij=!1,iY={maxWidth:100,unit:"metric"};function iH(e,t,n){let i=n&&n.maxWidth||100,r=e._container.clientHeight/2,o=e.unproject([0,r]),a=e.unproject([i,r]),s=o.distanceTo(a);if(n&&"imperial"===n.unit){let n=3.2808*s;n>5280?iU(t,i,n/5280,e._getUIString("ScaleControl.Miles")):iU(t,i,n,e._getUIString("ScaleControl.Feet"))}else n&&"nautical"===n.unit?iU(t,i,s/1852,e._getUIString("ScaleControl.NauticalMiles")):s>=1e3?iU(t,i,s/1e3,e._getUIString("ScaleControl.Kilometers")):iU(t,i,s,e._getUIString("ScaleControl.Meters"))}function iU(e,t,n,i){let r=function(e){let t=Math.pow(10,`${Math.floor(e)}`.length-1),n=e/t;return t*(n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:n>=1?1:function(e){let t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(n))}(n);e.style.width=r/n*t+"px",e.innerHTML=`${r} ${i}`}let iV={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1};e.AJAXError=t.be,e.Evented=t.E,e.LngLat=t.M,e.MercatorCoordinate=t.Y,e.Point=t.P,e.addProtocol=t.bf,e.config=t.a,e.removeProtocol=t.bg,e.AttributionControl=ix,e.BoxZoomHandler=nH,e.CanvasSource=et,e.CooperativeGesturesHandler=im,e.DoubleClickZoomHandler=is,e.DragPanHandler=id,e.DragRotateHandler=iu,e.EdgeInsets=nE,e.FullscreenControl=class extends t.E{constructor(e={}){super(),this._onFullscreenChange=()=>{var e;let t=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;null==(e=null==t?void 0:t.shadowRoot)?void 0:e.fullscreenElement;)t=t.shadowRoot.fullscreenElement;t===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,e&&e.container&&(e.container instanceof HTMLElement?this._container=e.container:t.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){h.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let e=this._fullscreenButton=h.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);h.create("span","maplibregl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e}_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 t.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new t.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},e.GeoJSONSource=Z,e.GeolocateControl=class extends t.E{constructor(e){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.k("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,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(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new t.k("geolocate",e)),this._finish()}},this._updateCamera=e=>{let n=new t.M(e.coords.longitude,e.coords.latitude),i=e.coords.accuracy,r=this._map.getBearing(),o=t.e({bearing:r},this.options.fitBoundsOptions),a=W.fromLngLat(n,i);this._map.fitBounds(a,o,{geolocateSource:!0})},this._updateMarker=e=>{if(e){let n=new t.M(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=e=>{if(this._map){if(this.options.trackUserLocation)if(1===e.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 e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&ij)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new t.k("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=e=>{if(this._map){if(this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=h.create("button","maplibregl-ctrl-geolocate",this._container),h.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===e){t.w("Geolocation support is not available so the GeolocateControl will be disabled.");let e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}else{let e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=h.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new iN({element:this._dotElement}),this._circleElement=h.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new iN({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",e=>{e.geolocateSource||"ACTIVE_LOCK"!==this._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new t.k("trackuserlocationend")))})}},this.options=t.e({},iB,e)}onAdd(e){return this._map=e,this._container=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),(function(){return t._(this,arguments,void 0,function*(e=!1){if(void 0!==l&&!e)return l;if(void 0===window.navigator.permissions)return l=!!window.navigator.geolocation;try{let e=yield window.navigator.permissions.query({name:"geolocation"});l="denied"!==e.state}catch(e){l=!!window.navigator.geolocation}return l})})().then(e=>this._setupUI(e)),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(),h.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,iz=0,ij=!1}_isOutOfMapMaxBounds(e){let t=this._map.getMaxBounds(),n=e.coords;return t&&(n.longitude<t.getWest()||n.longitude>t.getEast()||n.latitude<t.getSouth()||n.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){let e=this._map.getBounds(),t=e.getSouthEast(),n=e.getNorthEast(),i=t.distanceTo(n),r=Math.ceil(this._accuracy/(i/this._map._container.clientHeight)*2);this._circleElement.style.width=`${r}px`,this._circleElement.style.height=`${r}px`}trigger(){if(!this._setup)return t.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":iz--,ij=!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 t.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.k("trackuserlocationstart"));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 e;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++iz>1?(e={maximumAge:6e5,timeout:0},ij=!0):(e=this.options.positionOptions,ij=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}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)}},e.Hash=nT,e.ImageSource=Q,e.KeyboardHandler=ir,e.LngLatBounds=W,e.LogoControl=iw,e.Map=class extends iy{constructor(e){if(t.bc.mark(t.bd.create),null!=(e=t.e({},iL,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>85)throw Error("maxPitch must be less than or equal to 85");if(super(new nA(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies),{bearingSnap:e.bearingSnap}),this._contextLost=e=>{e.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new t.k("webglcontextlost",{originalEvent:e}))},this._contextRestored=e=>{this._setupPainter(),this.resize(),this._update(),this.fire(new t.k("webglcontextrestored",{originalEvent:e}))},this._onMapScroll=e=>{if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._maxTileCacheZoomLevels=e.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new iF,this._controls=[],this._mapId=t.a3(),this._locale=t.e({},iM,e.locale),this._clickTolerance=e.clickTolerance,this._overridePixelRatio=e.pixelRatio,this._maxCanvasSize=e.maxCanvasSize,this.transformCameraUpdate=e.transformCameraUpdate,this._imageQueueHandle=F.addThrottleControl(()=>this.isMoving()),this._requestManager=new y(e.transformRequest),"string"==typeof e.container){if(this._container=document.getElementById(e.container),!this._container)throw Error(`Container '${e.container}' not found.`)}else{if(!(e.container instanceof HTMLElement))throw Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),"undefined"!=typeof window){addEventListener("online",this._onWindowOnline,!1);let e=!1,t=nC(e=>{this._trackResize&&!this._removed&&this.resize(e)._update()},50);this._resizeObserver=new ResizeObserver(n=>{e?t(n):e=!0}),this._resizeObserver.observe(this._container)}this.handlers=new i_(this,e),this._hash=e.hash&&new nT("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.e({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,this._validateStyle=e.validateStyle,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new ix("boolean"==typeof e.attributionControl?void 0:e.attributionControl)),e.maplibreLogo&&this.addControl(new iw,e.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",e=>{this._update("style"===e.dataType),this.fire(new t.k(`${e.dataType}data`,e))}),this.on("dataloading",e=>{this.fire(new t.k(`${e.dataType}dataloading`,e))}),this.on("dataabort",e=>{this.fire(new t.k("sourcedataabort",e))})}_getMapId(){return this._mapId}addControl(e,n){if(void 0===n&&(n=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.j(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let i=e.onAdd(this);this._controls.push(e);let r=this._controlPositions[n];return -1!==n.indexOf("bottom")?r.insertBefore(i,r.firstChild):r.appendChild(i),this}removeControl(e){if(!e||!e.onRemove)return this.fire(new t.j(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let n=this._controls.indexOf(e);return n>-1&&this._controls.splice(n,1),e.onRemove(this),this}hasControl(e){return this._controls.indexOf(e)>-1}calculateCameraOptionsFromTo(e,t,n,i){return null==i&&this.terrain&&(i=this.terrain.getElevationForLngLatZoom(n,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(e,t,n,i)}resize(e){var n;let i=this._containerDimensions(),r=i[0],o=i[1],a=this._getClampedPixelRatio(r,o);if(this._resizeCanvas(r,o,a),this.painter.resize(r,o,a),this.painter.overLimit()){let e=this.painter.context.gl;this._maxCanvasSize=[e.drawingBufferWidth,e.drawingBufferHeight];let t=this._getClampedPixelRatio(r,o);this._resizeCanvas(r,o,t),this.painter.resize(r,o,t)}this.transform.resize(r,o),null==(n=this._requestedCameraState)||n.resize(r,o);let s=!this._moving;return s&&(this.stop(),this.fire(new t.k("movestart",e)).fire(new t.k("move",e))),this.fire(new t.k("resize",e)),s&&this.fire(new t.k("moveend",e)),this}_getClampedPixelRatio(e,t){let{0:n,1:i}=this._maxCanvasSize,r=this.getPixelRatio(),o=e*r,a=t*r;return Math.min(o>n?n/o:1,a>i?i/a:1)*r}getPixelRatio(){var e;return null!=(e=this._overridePixelRatio)?e:devicePixelRatio}setPixelRatio(e){this._overridePixelRatio=e,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(e){return this.transform.setMaxBounds(W.convert(e)),this._update()}setMinZoom(e){if((e=null==e?-2:e)>=-2&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()<e&&this.setZoom(e),this;throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(e){if((e=null==e?22:e)>=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(e){if((e=null==e?0:e)<0)throw Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this._update(),this.getPitch()<e&&this.setPitch(e),this;throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(e){if((e=null==e?60:e)>85)throw Error("maxPitch must be less than or equal to 85");if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e&&this.setPitch(e),this;throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){return this.transform.renderWorldCopies=e,this._update()}project(e){return this.transform.locationPoint(t.M.convert(e),this.style&&this.terrain)}unproject(e){return this.transform.pointLocation(t.P.convert(e),this.terrain)}isMoving(){var e;return this._moving||(null==(e=this.handlers)?void 0:e.isMoving())}isZooming(){var e;return this._zooming||(null==(e=this.handlers)?void 0:e.isZooming())}isRotating(){var e;return this._rotating||(null==(e=this.handlers)?void 0:e.isRotating())}_createDelegatedListener(e,t,n){if("mouseenter"===e||"mouseover"===e){let i=!1,r=r=>{let o=this.getLayer(t)?this.queryRenderedFeatures(r.point,{layers:[t]}):[];o.length?i||(i=!0,n.call(this,new n$(e,this,r.originalEvent,{features:o}))):i=!1};return{layer:t,listener:n,delegates:{mousemove:r,mouseout:()=>{i=!1}}}}if("mouseleave"===e||"mouseout"===e){let i=!1,r=r=>{(this.getLayer(t)?this.queryRenderedFeatures(r.point,{layers:[t]}):[]).length?i=!0:i&&(i=!1,n.call(this,new n$(e,this,r.originalEvent)))},o=t=>{i&&(i=!1,n.call(this,new n$(e,this,t.originalEvent)))};return{layer:t,listener:n,delegates:{mousemove:r,mouseout:o}}}{let i=e=>{let i=this.getLayer(t)?this.queryRenderedFeatures(e.point,{layers:[t]}):[];i.length&&(e.features=i,n.call(this,e),delete e.features)};return{layer:t,listener:n,delegates:{[e]:i}}}}on(e,t,n){if(void 0===n)return super.on(e,t);let i=this._createDelegatedListener(e,t,n);for(let t in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(i),i.delegates)this.on(t,i.delegates[t]);return this}once(e,t,n){if(void 0===n)return super.once(e,t);let i=this._createDelegatedListener(e,t,n);for(let e in i.delegates)this.once(e,i.delegates[e]);return this}off(e,t,n){return void 0===n?super.off(e,t):(this._delegatedListeners&&this._delegatedListeners[e]&&(i=>{let r=this._delegatedListeners[e];for(let e=0;e<r.length;e++){let i=r[e];if(i.layer===t&&i.listener===n){for(let e in i.delegates)this.off(e,i.delegates[e]);return r.splice(e,1),this}}})(),this)}queryRenderedFeatures(e,n){let i;if(!this.style)return[];let r=e instanceof t.P||Array.isArray(e),o=r?e:[[0,0],[this.transform.width,this.transform.height]];if(n=n||(r?{}:e)||{},o instanceof t.P||"number"==typeof o[0])i=[t.P.convert(o)];else{let e=t.P.convert(o[0]),n=t.P.convert(o[1]);i=[e,new t.P(n.x,e.y),n,new t.P(e.x,n.y),e]}return this.style.queryRenderedFeatures(i,n,this.transform)}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}setStyle(e,n){return!1!==(n=t.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},n)).diff&&n.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,n),this):(this._localIdeographFontFamily=n.localIdeographFontFamily,this._updateStyle(e,n))}setTransformRequest(e){return this._requestManager.setTransformRequest(e),this}_getUIString(e){let t=this._locale[e];if(null==t)throw Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){if(t.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(e,t));let n=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!e)),e?(this.style=new e0(this,t||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof e?this.style.loadURL(e,t,n):this.style.loadJSON(e,t,n)):delete this.style,this}_lazyInitEmptyStyle(){this.style||(this.style=new e0(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(e,n){if("string"==typeof e){let i=this._requestManager.transformRequest(e,k.Style);t.h(i,new AbortController).then(e=>{this._updateDiff(e.data,n)}).catch(e=>{e&&this.fire(new t.j(e))})}else"object"==typeof e&&this._updateDiff(e,n)}_updateDiff(e,n){try{this.style.setState(e,n)&&this._update(!0)}catch(i){t.w(`Unable to perform style diff: ${i.message||i.error||i}. Rebuilding the style from scratch.`),this._updateStyle(e,n)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():t.w("There is no style added to the map.")}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(e){let n=this.style&&this.style.sourceCaches[e];if(void 0!==n)return n.loaded();this.fire(new t.j(Error(`There is no source with ID '${e}'`)))}setTerrain(e){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),e){let n=this.style.sourceCaches[e.source];if(!n)throw Error(`cannot load terrain, because there exists no source with ID: ${e.source}`);for(let i in null===this.terrain&&n.reload(),this.style._layers){let n=this.style._layers[i];"hillshade"===n.type&&n.source===e.source&&t.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new iA(this.painter,n,e),this.painter.renderToTexture=new iS(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=t=>{"style"===t.dataType?this.terrain.sourceCache.freeRtt():"source"===t.dataType&&t.tile&&(t.sourceId!==e.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(t.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new t.k("terrain",{terrain:e})),this}getTerrain(){var e,t;return null!=(t=null==(e=this.terrain)?void 0:e.options)?t:null}areTilesLoaded(){let e=this.style&&this.style.sourceCaches;for(let t in e){let n=e[t]._tiles;for(let e in n){let t=n[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}}return!0}removeSource(e){return this.style.removeSource(e),this._update(!0)}getSource(e){return this.style.getSource(e)}addImage(e,n,i={}){let{pixelRatio:r=1,sdf:o=!1,stretchX:a,stretchY:s,content:l}=i;if(this._lazyInitEmptyStyle(),!(n instanceof HTMLImageElement||t.b(n))){if(void 0===n.width||void 0===n.height)return this.fire(new t.j(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`")));{let{width:i,height:c,data:d}=n;return this.style.addImage(e,{data:new t.R({width:i,height:c},new Uint8Array(d)),pixelRatio:r,stretchX:a,stretchY:s,content:l,sdf:o,version:0,userImage:n}),n.onAdd&&n.onAdd(this,e),this}}{let{width:i,height:c,data:d}=u.getImageData(n);this.style.addImage(e,{data:new t.R({width:i,height:c},d),pixelRatio:r,stretchX:a,stretchY:s,content:l,sdf:o,version:0})}}updateImage(e,n){let i=this.style.getImage(e);if(!i)return this.fire(new t.j(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:r,height:o,data:a}=n instanceof HTMLImageElement||t.b(n)?u.getImageData(n):n;if(void 0===r||void 0===o)return this.fire(new t.j(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(r!==i.data.width||o!==i.data.height)return this.fire(new t.j(Error("The width and height of the updated image must be that same as the previous version of the image")));let s=!(n instanceof HTMLImageElement||t.b(n));return i.data.replace(a,s),this.style.updateImage(e,i),this}getImage(e){return this.style.getImage(e)}hasImage(e){return e?!!this.style.getImage(e):(this.fire(new t.j(Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}loadImage(e){return F.getImage(this._requestManager.transformRequest(e,k.Image),new AbortController)}listImages(){return this.style.listImages()}addLayer(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}moveLayer(e,t){return this.style.moveLayer(e,t),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){return this.style.getLayer(e)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(e,t,n){return this.style.setLayerZoomRange(e,t,n),this._update(!0)}setFilter(e,t,n={}){return this.style.setFilter(e,t,n),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,n,i={}){return this.style.setPaintProperty(e,t,n,i),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,n,i={}){return this.style.setLayoutProperty(e,t,n,i),this._update(!0)}getLayoutProperty(e,t){return this.style.getLayoutProperty(e,t)}setGlyphs(e,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(e,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(e,t,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(e,t,n,e=>{e||this._update(!0)}),this}removeSprite(e){return this._lazyInitEmptyStyle(),this.style.removeSprite(e),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(e,t,e=>{e||this._update(!0)}),this}setLight(e,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(e,t){return this.style.setFeatureState(e,t),this._update()}removeFeatureState(e,t){return this.style.removeFeatureState(e,t),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let e=0,t=0;return this._container&&(e=this._container.clientWidth||400,t=this._container.clientHeight||300),[e,t]}_setupContainer(){let e=this._container;e.classList.add("maplibregl-map");let t=this._canvasContainer=h.create("div","maplibregl-canvas-container",e);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=h.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");let n=this._containerDimensions(),i=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],i);let r=this._controlContainer=h.create("div","maplibregl-control-container",e),o=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(e=>{o[e]=h.create("div",`maplibregl-ctrl-${e} `,r)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(e,t,n){this._canvas.width=Math.floor(n*e),this._canvas.height=Math.floor(n*t),this._canvas.style.width=`${e}px`,this._canvas.style.height=`${t}px`}_setupPainter(){let e={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},t=null;this._canvas.addEventListener("webglcontextcreationerror",n=>{t={requestedAttributes:e},n&&(t.statusMessage=n.statusMessage,t.type=n.type)},{once:!0});let n=this._canvas.getContext("webgl2",e)||this._canvas.getContext("webgl",e);if(!n){let e="Failed to initialize WebGL";throw t?(t.message=e,Error(JSON.stringify(t))):Error(e)}this.painter=new nw(n,this.transform),m.testSupport(n)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){return this.style&&this.style._loaded&&(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint()),this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_render(e){let n=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),this._removed)return;let i=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let e=this.transform.zoom,r=u.now();this.style.zoomHistory.update(e,r);let o=new t.a8(e,{now:r,fadeDuration:n,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),a=o.crossFadingFactor();1===a&&a===this._crossFadingFactor||(i=!0,this._crossFadingFactor=a),this.style.update(o)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,n,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:n,showPadding:this.showPadding}),this.fire(new t.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,t.bc.mark(t.bd.load),this.fire(new t.k("load"))),this.style&&(this.style.hasTransitions()||i)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let r=this._sourcesDirty||this._styleDirty||this._placementDirty;return r||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.k("idle")),!this._loaded||this._fullyLoaded||r||(this._fullyLoaded=!0,t.bc.mark(t.bd.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var e;for(let e of(this._hash&&this._hash.remove(),this._controls))e.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),"undefined"!=typeof window&&removeEventListener("online",this._onWindowOnline,!1),F.removeThrottleControl(this._imageQueueHandle),null==(e=this._resizeObserver)||e.disconnect();let n=this.painter.context.gl.getExtension("WEBGL_lose_context");n&&n.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),h.remove(this._canvasContainer),h.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),t.bc.clearMetrics(),this._removed=!0,this.fire(new t.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,u.frameAsync(this._frameRequest).then(e=>{t.bc.frame(e),this._frameRequest=null,this._render(e)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get version(){return d}getCameraTargetElevation(){return this.transform.elevation}},e.MapMouseEvent=n$,e.MapTouchEvent=nN,e.MapWheelEvent=nB,e.Marker=iN,e.NavigationControl=class{constructor(e){this._updateZoomButtons=()=>{let e=this._map.getZoom(),t=e===this._map.getMaxZoom(),n=e===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())},this._rotateCompassArrow=()=>{let e=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=e},this._setButtonTitle=(e,t)=>{let n=this._map._getUIString(`NavigationControl.${t}`);e.title=n,e.setAttribute("aria-label",n)},this.options=t.e({},iI,e),this._container=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",e=>this._map.zoomIn({},{originalEvent:e})),h.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",e=>this._map.zoomOut({},{originalEvent:e})),h.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})}),this._compassIcon=h.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new iR(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){h.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(e,t){let n=h.create("button",e,this._container);return n.type="button",n.addEventListener("click",t),n}},e.Popup=class extends t.E{constructor(e){super(),this.remove=()=>(this._content&&h.remove(this._content),this._container&&(h.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new t.k("close"))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{var n;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=h.create("div","maplibregl-popup",this._map.getContainer()),this._tip=h.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let e of this.options.className.split(" "))this._container.classList.add(e);this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?iO(this._lngLat,this._flatPos,this._map.transform):null==(n=this._lngLat)?void 0:n.wrap(),this._trackPointer&&!e)return;let i=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationPoint(this._lngLat));let r=this.options.anchor,o=function e(n){if(n){if("number"==typeof n){let e=Math.round(Math.abs(n)/Math.SQRT2);return{center:new t.P(0,0),top:new t.P(0,n),"top-left":new t.P(e,e),"top-right":new t.P(-e,e),bottom:new t.P(0,-n),"bottom-left":new t.P(e,-e),"bottom-right":new t.P(-e,-e),left:new t.P(n,0),right:new t.P(-n,0)}}if(n instanceof t.P||Array.isArray(n)){let e=t.P.convert(n);return{center:e,top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}return{center:t.P.convert(n.center||[0,0]),top:t.P.convert(n.top||[0,0]),"top-left":t.P.convert(n["top-left"]||[0,0]),"top-right":t.P.convert(n["top-right"]||[0,0]),bottom:t.P.convert(n.bottom||[0,0]),"bottom-left":t.P.convert(n["bottom-left"]||[0,0]),"bottom-right":t.P.convert(n["bottom-right"]||[0,0]),left:t.P.convert(n.left||[0,0]),right:t.P.convert(n.right||[0,0])}}return e(new t.P(0,0))}(this.options.offset);if(!r){let e,t=this._container.offsetWidth,n=this._container.offsetHeight;e=i.y+o.bottom.y<n?["top"]:i.y>this._map.transform.height-n?["bottom"]:[],i.x<t/2?e.push("left"):i.x>this._map.transform.width-t/2&&e.push("right"),r=0===e.length?"bottom":e.join("-")}let a=i.add(o[r]);this.options.subpixelPositioning||(a=a.round()),h.setTransform(this._container,`${iP[r]} translate(${a.x}px,${a.y}px)`),i$(this._container,r,"popup")},this._onClose=()=>{this.remove()},this.options=t.e(Object.create(iV),e)}addTo(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new t.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=t.M.convert(e),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){let t,n=document.createDocumentFragment(),i=document.createElement("body");for(i.innerHTML=e;t=i.firstChild;)n.appendChild(t);return this.setDOMContent(n)}getMaxWidth(){var e;return null==(e=this._container)?void 0:e.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=h.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(e){this._container&&this._container.classList.add(e)}removeClassName(e){this._container&&this._container.classList.remove(e)}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){if(this._container)return this._container.classList.toggle(e)}setSubpixelPositioning(e){this.options.subpixelPositioning=e}_createCloseButton(){this.options.closeButton&&(this._closeButton=h.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let e=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])");e&&e.focus()}},e.RasterDEMTileSource=X,e.RasterTileSource=K,e.ScaleControl=class{constructor(e){this._onMove=()=>{iH(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,iH(this._map,this._container,this.options)},this.options=t.e({},iY,e)}getDefaultPosition(){return"bottom-left"}onAdd(e){return this._map=e,this._container=h.create("div","maplibregl-ctrl maplibregl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){h.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},e.ScrollZoomHandler=ia,e.Style=e0,e.TerrainControl=class{constructor(e){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=e}onAdd(e){return this._map=e,this._container=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=h.create("button","maplibregl-ctrl-terrain",this._container),h.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(){h.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},e.TwoFingersTouchPitchHandler=n9,e.TwoFingersTouchRotateHandler=n8,e.TwoFingersTouchZoomHandler=n4,e.TwoFingersTouchZoomRotateHandler=ih,e.VectorTileSource=q,e.VideoSource=ee,e.addSourceType=(e,n)=>t._(void 0,void 0,void 0,function*(){if(ei(e))throw Error(`A source type called "${e}" already exists.`);en[e]=n}),e.clearPrewarmedResources=function(){let e=o;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(N),o=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},e.getMaxParallelImageRequests=function(){return t.a.MAX_PARALLEL_IMAGE_REQUESTS},e.getRTLTextPluginStatus=function(){return es().getRTLTextPluginStatus()},e.getVersion=function(){return d},e.getWorkerCount=function(){return B.workerCount},e.getWorkerUrl=function(){return t.a.WORKER_URL},e.importScriptInWorkers=function(e){return H().broadcast("importScript",e)},e.prewarm=function(){j().acquire(N)},e.setMaxParallelImageRequests=function(e){t.a.MAX_PARALLEL_IMAGE_REQUESTS=e},e.setRTLTextPlugin=function(e,t){return es().setRTLTextPlugin(e,t)},e.setWorkerCount=function(e){B.workerCount=e},e.setWorkerUrl=function(e){t.a.WORKER_URL=e}}),e}()},75548:function(e){"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},5430:function(e){"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={id:i,loaded:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;n.t=function(i,r){if(1&r&&(i=this(i)),8&r||"object"==typeof i&&i&&(4&r&&i.__esModule||16&r&&"function"==typeof i.then))return i;var o=Object.create(null);n.r(o);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&i;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>{a[e]=()=>i[e]});return a.default=()=>i,n.d(o,a),o}})(),n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var i={};return(()=>{"use strict";let e,t,r;n.r(i),n.d(i,{getHelperText:()=>uB,OrAttributeInput:()=>uY,OrAttributeInputChangedEvent:()=>u$,jsonFormsInputTemplateProvider:()=>uj,getAttributeInputWrapper:()=>uN});let o=globalThis,a=o.ShadowRoot&&(void 0===o.ShadyCSS||o.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),l=new WeakMap;class c{constructor(e,t,n){if(this._$cssResult$=!0,n!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(a&&void 0===e){let n=void 0!==t&&1===t.length;n&&(e=l.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&l.set(t,e))}return e}toString(){return this.cssText}}let d=e=>new c("string"==typeof e?e:e+"",void 0,s),u=(e,...t)=>new c(1===e.length?e[0]:t.reduce((t,n,i)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[i+1],e[0]),e,s),h=a?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return d(t)})(e):e,{is:m,defineProperty:f,getOwnPropertyDescriptor:p,getOwnPropertyNames:g,getOwnPropertySymbols:b,getPrototypeOf:_}=Object,y=globalThis,v=y.trustedTypes,x=v?v.emptyScript:"",w=y.reactiveElementPolyfillSupport,F={toAttribute(e,t){switch(t){case Boolean:e=e?x:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},k=(e,t)=>!m(e,t),E={attribute:!0,type:String,converter:F,reflect:!1,useDefault:!1,hasChanged:k};Symbol.metadata??=Symbol("metadata"),y.litPropertyMetadata??=new WeakMap;class A extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=E){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),i=this.getPropertyDescriptor(e,n,t);void 0!==i&&f(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){let{get:i,set:r}=p(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:i,set(t){let o=i?.call(this);r?.call(this,t),this.requestUpdate(e,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??E}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;let e=_(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){let e=this.properties;for(let t of[...g(e),...b(e)])this.createProperty(t,e[t])}let e=this[Symbol.metadata];if(null!==e){let t=litPropertyMetadata.get(e);if(void 0!==t)for(let[e,n]of t)this.elementProperties.set(e,n)}for(let[e,t]of(this._$Eh=new Map,this.elementProperties)){let n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e))for(let n of new Set(e.flat(1/0).reverse()))t.unshift(h(n));else void 0!==e&&t.push(h(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.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(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map;for(let t of this.constructor.elementProperties.keys())this.hasOwnProperty(t)&&(e.set(t,this[t]),delete this[t]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(a)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of t){let t=document.createElement("style"),i=o.litNonce;void 0!==i&&t.setAttribute("nonce",i),t.textContent=n.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(void 0!==i&&!0===n.reflect){let r=(void 0!==n.converter?.toAttribute?n.converter:F).toAttribute(t,n.type);this._$Em=e,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(e,t){let n=this.constructor,i=n._$Eh.get(e);if(void 0!==i&&this._$Em!==i){let e=n.getPropertyOptions(i),r="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:F;this._$Em=i;let o=r.fromAttribute(t,e.type);this[i]=o??this._$Ej?.get(i)??o,this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){let i=this.constructor,r=this[e];if(!(((n??=i.getPropertyOptions(e)).hasChanged??k)(r,t)||n.useDefault&&n.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:i,wrapped:r},o){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),!0!==r||void 0!==o)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,i=this[t];!0!==e||this._$AL.has(t)||void 0===i||this.C(t,void 0,n,i)}}let e=!1,t=this._$AL;try{(e=this.shouldUpdate(t))?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}}A.elementStyles=[],A.shadowRootOptions={mode:"open"},A.elementProperties=new Map,A.finalized=new Map,w?.({ReactiveElement:A}),(y.reactiveElementVersions??=[]).push("2.1.1");let C=globalThis,T=C.trustedTypes,S=T?T.createPolicy("lit-html",{createHTML:e=>e}):void 0,M="$lit$",D=`lit$${Math.random().toFixed(9).slice(2)}$`,I="?"+D,R=`<${I}>`,O=document,P=()=>O.createComment(""),$=e=>null===e||"object"!=typeof e&&"function"!=typeof e,N=Array.isArray,B=e=>N(e)||"function"==typeof e?.[Symbol.iterator],z="[ \n\f\r]",j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Y=/-->/g,H=/>/g,U=RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^
|
|
58
58
|
\f\r"'\`<>=]|("|')|))|$)`,"g"),V=/'/g,W=/"/g,G=/^(?:script|style|textarea|title)$/i,q=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),K=q(1),X=(q(2),q(3),Symbol.for("lit-noChange")),Z=Symbol.for("lit-nothing"),J=new WeakMap,Q=O.createTreeWalker(O,129);function ee(e,t){if(!N(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==S?S.createHTML(t):t}let et=(e,t)=>{let n=e.length-1,i=[],r,o=2===t?"<svg>":3===t?"<math>":"",a=j;for(let t=0;t<n;t++){let n=e[t],s,l,c=-1,d=0;for(;d<n.length&&(a.lastIndex=d,null!==(l=a.exec(n)));)d=a.lastIndex,a===j?"!--"===l[1]?a=Y:void 0!==l[1]?a=H:void 0!==l[2]?(G.test(l[2])&&(r=RegExp("</"+l[2],"g")),a=U):void 0!==l[3]&&(a=U):a===U?">"===l[0]?(a=r??j,c=-1):void 0===l[1]?c=-2:(c=a.lastIndex-l[2].length,s=l[1],a=void 0===l[3]?U:'"'===l[3]?W:V):a===W||a===V?a=U:a===Y||a===H?a=j:(a=U,r=void 0);let u=a===U&&e[t+1].startsWith("/>")?" ":"";o+=a===j?n+R:c>=0?(i.push(s),n.slice(0,c)+M+n.slice(c)+D+u):n+D+(-2===c?t:u)}return[ee(e,o+(e[n]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),i]};class en{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let r=0,o=0,a=e.length-1,s=this.parts,[l,c]=et(e,t);if(this.el=en.createElement(l,n),Q.currentNode=this.el.content,2===t||3===t){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(i=Q.nextNode())&&s.length<a;){if(1===i.nodeType){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(M)){let t=c[o++],n=i.getAttribute(e).split(D),a=/([.?@])?(.*)/.exec(t);s.push({type:1,index:r,name:a[2],strings:n,ctor:"."===a[1]?es:"?"===a[1]?el:"@"===a[1]?ec:ea}),i.removeAttribute(e)}else e.startsWith(D)&&(s.push({type:6,index:r}),i.removeAttribute(e));if(G.test(i.tagName)){let e=i.textContent.split(D),t=e.length-1;if(t>0){i.textContent=T?T.emptyScript:"";for(let n=0;n<t;n++)i.append(e[n],P()),Q.nextNode(),s.push({type:2,index:++r});i.append(e[t],P())}}}else if(8===i.nodeType)if(i.data===I)s.push({type:2,index:r});else{let e=-1;for(;-1!==(e=i.data.indexOf(D,e+1));)s.push({type:7,index:r}),e+=D.length-1}r++}}static createElement(e,t){let n=O.createElement("template");return n.innerHTML=e,n}}function ei(e,t,n=e,i){if(t===X)return t;let r=void 0!==i?n._$Co?.[i]:n._$Cl,o=$(t)?void 0:t._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),void 0===o?r=void 0:(r=new o(e))._$AT(e,n,i),void 0!==i?(n._$Co??=[])[i]=r:n._$Cl=r),void 0!==r&&(t=ei(e,r._$AS(e,t.values),r,i)),t}class er{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,i=(e?.creationScope??O).importNode(t,!0);Q.currentNode=i;let r=Q.nextNode(),o=0,a=0,s=n[0];for(;void 0!==s;){if(o===s.index){let t;2===s.type?t=new eo(r,r.nextSibling,this,e):1===s.type?t=new s.ctor(r,s.name,s.strings,this,e):6===s.type&&(t=new ed(r,this,e)),this._$AV.push(t),s=n[++a]}o!==s?.index&&(r=Q.nextNode(),o++)}return Q.currentNode=O,i}p(e){let t=0;for(let n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class eo{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,i){this.type=2,this._$AH=Z,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){$(e=ei(this,e,t))?e===Z||null==e||""===e?(this._$AH!==Z&&this._$AR(),this._$AH=Z):e!==this._$AH&&e!==X&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):B(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==Z&&$(this._$AH)?this._$AA.nextSibling.data=e:this.T(O.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,i="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=en.createElement(ee(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(t);else{let e=new er(i,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=J.get(e.strings);return void 0===t&&J.set(e.strings,t=new en(e)),t}k(e){N(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,i=0;for(let r of e)i===t.length?t.push(n=new eo(this.O(P()),this.O(P()),this,this.options)):n=t[i],n._$AI(r),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class ea{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,i,r){this.type=1,this._$AH=Z,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=r,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Z}_$AI(e,t=this,n,i){let r=this.strings,o=!1;if(void 0===r)(o=!$(e=ei(this,e,t,0))||e!==this._$AH&&e!==X)&&(this._$AH=e);else{let i,a,s=e;for(e=r[0],i=0;i<r.length-1;i++)(a=ei(this,s[n+i],t,i))===X&&(a=this._$AH[i]),o||=!$(a)||a!==this._$AH[i],a===Z?e=Z:e!==Z&&(e+=(a??"")+r[i+1]),this._$AH[i]=a}o&&!i&&this.j(e)}j(e){e===Z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class es extends ea{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Z?void 0:e}}class el extends ea{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Z)}}class ec extends ea{constructor(e,t,n,i,r){super(e,t,n,i,r),this.type=5}_$AI(e,t=this){if((e=ei(this,e,t,0)??Z)===X)return;let n=this._$AH,i=e===Z&&n!==Z||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,r=e!==Z&&(n===Z||i);i&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class ed{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){ei(this,e)}}let eu=C.litHtmlPolyfillSupport;eu?.(en,eo),(C.litHtmlVersions??=[]).push("3.3.1");let eh=globalThis;class em extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{let i=n?.renderBefore??t,r=i._$litPart$;if(void 0===r){let e=n?.renderBefore??null;i._$litPart$=r=new eo(t.insertBefore(P(),e),e,void 0,n??{})}return r._$AI(e),r})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return X}}em._$litElement$=!0,em.finalized=!0,eh.litElementHydrateSupport?.({LitElement:em});let ef=eh.litElementPolyfillSupport;ef?.({LitElement:em}),(eh.litElementVersions??=[]).push("4.2.1");let ep=e=>(t,n)=>{void 0!==n?n.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},eg={attribute:!0,type:String,converter:F,reflect:!1,hasChanged:k};function eb(e){return(t,n)=>"object"==typeof n?((e=eg,t,n)=>{let{kind:i,metadata:r}=n,o=globalThis.litPropertyMetadata.get(r);if(void 0===o&&globalThis.litPropertyMetadata.set(r,o=new Map),"setter"===i&&((e=Object.create(e)).wrapped=!0),o.set(n.name,e),"accessor"===i){let{name:i}=n;return{set(n){let r=t.get.call(this);t.set.call(this,n),this.requestUpdate(i,r,e)},init(t){return void 0!==t&&this.C(i,void 0,e,t),t}}}if("setter"===i){let{name:i}=n;return function(n){let r=this[i];t.call(this,n),this.requestUpdate(i,r,e)}}throw Error("Unsupported decorator location: "+i)})(e,t,n):((e,t,n)=>{let i=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),i?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function e_(e){return eb({...e,state:!0,attribute:!1})}let ey=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,n),n);function ev(e,t){return(n,i,r)=>{let o=t=>t.renderRoot?.querySelector(e)??null;if(t){let{get:e,set:t}="object"==typeof i?n:r??(()=>{let e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})();return ey(n,i,{get(){let n=e.call(this);return void 0===n&&(null!==(n=o(this))||this.hasUpdated)&&t.call(this,n),n}})}return ey(n,i,{get(){return o(this)}})}}let{I:ex}={M:M,P:D,A:I,C:1,L:et,R:er,D:B,V:ei,I:eo,H:ea,N:el,U:ec,B:es,F:ed},ew={ATTRIBUTE:1,CHILD:2},eF=e=>(...t)=>({_$litDirective$:e,values:t});class ek{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}let eE=(e,t)=>{let n=e._$AN;if(void 0===n)return!1;for(let e of n)e._$AO?.(t,!1),eE(e,t);return!0},eA=e=>{let t,n;do{if(void 0===(t=e._$AM))break;(n=t._$AN).delete(e),e=t}while(0===n?.size)},eC=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(void 0===n)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),eM(t)}};function eT(e){void 0!==this._$AN?(eA(this),this._$AM=e,eC(this)):this._$AM=e}function eS(e,t=!1,n=0){let i=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(t)if(Array.isArray(i))for(let e=n;e<i.length;e++)eE(i[e],!1),eA(i[e]);else null!=i&&(eE(i,!1),eA(i));else eE(this,e)}let eM=e=>{e.type==ew.CHILD&&(e._$AP??=eS,e._$AQ??=eT)};class eL extends ek{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),eC(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(eE(this,e),eA(this))}setValue(e){if(void 0===this._$Ct.strings)this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}class eD{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}}class eI{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise(e=>this.Z=e)}resume(){this.Z?.(),this.Y=this.Z=void 0}}let eR=e=>!(e=>null===e||"object"!=typeof e&&"function"!=typeof e)(e)&&"function"==typeof e.then,eO=eF(class extends eL{constructor(){super(...arguments),this._$Cwt=0x3fffffff,this._$Cbt=[],this._$CK=new eD(this),this._$CX=new eI}render(...e){return e.find(e=>!eR(e))??X}update(e,t){let n=this._$Cbt,i=n.length;this._$Cbt=t;let r=this._$CK,o=this._$CX;this.isConnected||this.disconnected();for(let e=0;e<t.length&&!(e>this._$Cwt);e++){let a=t[e];if(!eR(a))return this._$Cwt=e,a;e<i&&a===n[e]||(this._$Cwt=0x3fffffff,i=0,Promise.resolve(a).then(async e=>{for(;o.get();)await o.get();let t=r.deref();if(void 0!==t){let n=t._$Cbt.indexOf(a);n>-1&&n<t._$Cwt&&(t._$Cwt=n,t.setValue(e))}}))}return X}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}}),eP=()=>new e$;class e${}let eN=new WeakMap,eB=eF(class extends eL{render(e){return Z}update(e,[t]){let n=t!==this.G;return n&&void 0!==this.G&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),Z}rt(e){if(this.isConnected||(e=void 0),"function"==typeof this.G){let t=this.ht??globalThis,n=eN.get(t);void 0===n&&(n=new WeakMap,eN.set(t,n)),void 0!==n.get(this.G)&&this.G.call(this.ht,void 0),n.set(this.G,e),void 0!==e&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return"function"==typeof this.G?eN.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),ez=e=>t=>class extends t{constructor(){super(...arguments),this._i18nextJustInitialized=!1,this.initCallback=e=>{this._i18nextJustInitialized=!0,this.requestUpdate&&this.requestUpdate()},this.langChangedCallback=()=>{this.requestUpdate&&this.requestUpdate()}}connectedCallback(){e.language||e.on("initialized",this.initCallback),e.on("languageChanged",this.langChangedCallback),super.connectedCallback&&super.connectedCallback()}disconnectedCallback(){e.off("initialized",this.initCallback),e.off("languageChanged",this.langChangedCallback),super.disconnectedCallback&&super.disconnectedCallback()}shouldUpdate(e){return this._i18nextJustInitialized?(this._i18nextJustInitialized=!1,!0):super.shouldUpdate&&super.shouldUpdate(e)}};function ej(e){return(ej="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eY(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function eH(e){var t=function(e,t){if("object"!=ej(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=ej(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ej(t)?t:String(t)}function eU(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,eH(i.key),i)}}function eV(e,t,n){return t&&eU(e.prototype,t),n&&eU(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function eW(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eG(e,t){return(eG=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function eq(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eG(e,t)}function eK(e,t){if(t&&("object"===ej(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return eW(e)}function eX(e){return(eX=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eZ(e,t,n){return(t=eH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eJ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function eQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function e0(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eQ(Object(n),!0).forEach(function(t){eZ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eQ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var e1,e2,e5,e3={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},e4=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};eY(this,e),this.init(t,n)}return eV(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||e3,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,i){return i&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,e0(e0({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}()),e6=function(){function e(){eY(this,e),this.observers={}}return eV(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach(function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)}),this}},{key:"off",value:function(e,t){if(this.observers[e]){if(!t)return void delete this.observers[e];this.observers[e]=this.observers[e].filter(function(e){return e!==t})}}},{key:"emit",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];this.observers[e]&&[].concat(this.observers[e]).forEach(function(e){e.apply(void 0,n)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(function(t){t.apply(t,[e].concat(n))})}}]),e}();function e8(){var e,t,n=new Promise(function(n,i){e=n,t=i});return n.resolve=e,n.reject=t,n}function e7(e){return null==e?"":""+e}function e9(e,t,n){function i(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function r(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(r())return{};var a=i(o.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return r()?{}:{obj:e,k:i(o.shift())}}function te(e,t,n){var i=e9(e,t,Object);i.obj[i.k]=n}function tt(e,t){var n=e9(e,t),i=n.obj,r=n.k;if(i)return i[r]}function tn(e,t,n){var i=tt(e,n);return void 0!==i?i:tt(t,n)}function ti(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var tr={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function to(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return tr[e]}):e}var ta="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,ts=[" ",",","?","!",";"];function tl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function tc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tl(Object(n),!0).forEach(function(t){eZ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var td=function(e){eq(i,e);var t,n=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=eX(i);return e=t?Reflect.construct(n,arguments,eX(this).constructor):n.apply(this,arguments),eK(this,e)});function i(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return eY(this,i),t=n.call(this),ta&&e6.call(eW(t)),t.data=e||{},t.options=r,void 0===t.options.keySeparator&&(t.options.keySeparator="."),void 0===t.options.ignoreJSONStructure&&(t.options.ignoreJSONStructure=!0),t}return eV(i,[{key:"addNamespaces",value:function(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,o=void 0!==i.ignoreJSONStructure?i.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(r?n.split(r):n)),e.indexOf(".")>-1&&(a=e.split("."));var s=tt(this.data,a);return s||!o||"string"!=typeof n?s:function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(t){if(t[n])return t[n];for(var r=n.split(i),o=t,a=0;a<r.length;++a){if(!o||"string"==typeof o[r[a]]&&a+1<r.length)return;if(void 0===o[r[a]]){for(var s=2,l=r.slice(a,a+s).join(i),c=o[l];void 0===c&&r.length>a+s;)s++,c=o[l=r.slice(a,a+s).join(i)];if(void 0===c)return;if(null===c)return null;if(n.endsWith(l)){if("string"==typeof c)return c;if(l&&"string"==typeof c[l])return c[l]}var d=r.slice(a+s).join(i);if(d)return e(c,d,i);return}o=o[r[a]]}return o}}(this.data&&this.data[e]&&this.data[e][t],n,r)}},{key:"addResource",value:function(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var a=[e,t];n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."),i=t,t=a[1]),this.addNamespaces(t),te(this.data,a,i),r.silent||this.emit("added",e,t,n,i)}},{key:"addResources",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var r in n)("string"==typeof n[r]||"[object Array]"===Object.prototype.toString.apply(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});i.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),i=n,n=t,t=a[1]),this.addNamespaces(t);var s=tt(this.data,a)||{};i?function e(t,n,i){for(var r in n)"__proto__"!==r&&"constructor"!==r&&(r in t?"string"==typeof t[r]||t[r]instanceof String||"string"==typeof n[r]||n[r]instanceof String?i&&(t[r]=n[r]):e(t[r],n[r],i):t[r]=n[r]);return t}(s,n,r):s=tc(tc({},s),n),te(this.data,a,s),o.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return(t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI)?tc(tc({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(function(e){return t[e]&&Object.keys(t[e]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),i}(e6),tu={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,i,r){var o=this;return e.forEach(function(e){o.processors[e]&&(t=o.processors[e].process(t,n,i,r))}),t}};function th(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function tm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?th(Object(n),!0).forEach(function(t){eZ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):th(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var tf={},tp=function(e){eq(i,e);var t,n=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=eX(i);return e=t?Reflect.construct(n,arguments,eX(this).constructor):n.apply(this,arguments),eK(this,e)});function i(e){var t,r,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return eY(this,i),o=n.call(this),ta&&e6.call(eW(o)),t=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r=eW(o),t.forEach(function(t){e[t]&&(r[t]=e[t])}),o.options=a,void 0===o.options.keySeparator&&(o.options.keySeparator="."),o.logger=e4.create("translator"),o}return eV(i,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,r=t.ns||this.options.defaultNS||[],o=n&&e.indexOf(n)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!function(e,t,n){t=t||"",n=n||"";var i=ts.filter(function(e){return 0>t.indexOf(e)&&0>n.indexOf(e)});if(0===i.length)return!0;var r=new RegExp("(".concat(i.map(function(e){return"?"===e?"\\?":e}).join("|"),")")),o=!r.test(e);if(!o){var a=e.indexOf(n);a>0&&!r.test(e.substring(0,a))&&(o=!0)}return o}(e,n,i);if(o&&!a){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:r};var l=e.split(n);(n!==i||n===i&&this.options.ns.indexOf(l[0])>-1)&&(r=l.shift()),e=l.join(i)}return"string"==typeof r&&(r=[r]),{key:e,namespaces:r}}},{key:"translate",value:function(e,t,n){var r=this;if("object"!==ej(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var o=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],t),l=s.key,c=s.namespaces,d=c[c.length-1],u=t.lng||this.language,h=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(h){var m=t.nsSeparator||this.options.nsSeparator;return o?(f.res="".concat(d).concat(m).concat(l),f):"".concat(d).concat(m).concat(l)}return o?(f.res=l,f):l}var f=this.resolve(e,t),p=f&&f.res,g=f&&f.usedKey||l,b=f&&f.exactUsedKey||l,_=Object.prototype.toString.apply(p),y=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,x="string"!=typeof p&&"boolean"!=typeof p&&"number"!=typeof p;if(v&&p&&x&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(_)&&("string"!=typeof y||"[object Array]"!==_)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var w=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,p,tm(tm({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return o?(f.res=w,f):w}if(a){var F="[object Array]"===_,k=F?[]:{},E=F?b:g;for(var A in p)if(Object.prototype.hasOwnProperty.call(p,A)){var C="".concat(E).concat(a).concat(A);k[A]=this.translate(C,tm(tm({},t),{joinArrays:!1,ns:c})),k[A]===C&&(k[A]=p[A])}p=k}}else if(v&&"string"==typeof y&&"[object Array]"===_)(p=p.join(y))&&(p=this.extendTranslation(p,e,t,n));else{var T=!1,S=!1,M=void 0!==t.count&&"string"!=typeof t.count,D=i.hasDefaultValue(t),I=M?this.pluralResolver.getSuffix(u,t.count,t):"",R=t["defaultValue".concat(I)]||t.defaultValue;!this.isValidLookup(p)&&D&&(T=!0,p=R),this.isValidLookup(p)||(S=!0,p=l);var O=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&S?void 0:p,P=D&&R!==p&&this.options.updateMissing;if(S||T||P){if(this.logger.log(P?"updateKey":"missingKey",u,d,l,P?R:p),a){var $=this.resolve(l,tm(tm({},t),{},{keySeparator:!1}));$&&$.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.")}var N=[],B=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&B&&B[0])for(var z=0;z<B.length;z++)N.push(B[z]);else"all"===this.options.saveMissingTo?N=this.languageUtils.toResolveHierarchy(t.lng||this.language):N.push(t.lng||this.language);var j=function(e,n,i){var o=D&&i!==p?i:O;r.options.missingKeyHandler?r.options.missingKeyHandler(e,d,n,o,P,t):r.backendConnector&&r.backendConnector.saveMissing&&r.backendConnector.saveMissing(e,d,n,o,P,t),r.emit("missingKey",e,d,n,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&M?N.forEach(function(e){r.pluralResolver.getSuffixes(e,t).forEach(function(n){j([e],l+n,t["defaultValue".concat(n)]||R)})}):j(N,l,R))}p=this.extendTranslation(p,e,t,f,n),S&&p===l&&this.options.appendNamespaceToMissingKey&&(p="".concat(d,":").concat(l)),(S||T)&&this.options.parseMissingKeyHandler&&(p="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(d,":").concat(l):l,T?p:void 0):this.options.parseMissingKeyHandler(p))}return o?(f.res=p,f):p}},{key:"extendTranslation",value:function(e,t,n,i,r){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,tm(tm({},this.options.interpolation.defaultVariables),n),i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(tm(tm({},n),{interpolation:tm(tm({},this.options.interpolation),n.interpolation)}));var a,s="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){var l=e.match(this.interpolator.nestingRegexp);a=l&&l.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=tm(tm({},this.options.interpolation.defaultVariables),c)),e=this.interpolator.interpolate(e,c,n.lng||this.language,n),s){var d=e.match(this.interpolator.nestingRegexp);a<(d&&d.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,function(){for(var e=arguments.length,i=Array(e),a=0;a<e;a++)i[a]=arguments[a];return r&&r[0]===i[0]&&!n.context?(o.logger.warn("It seems you are nesting recursively key: ".concat(i[0]," in key: ").concat(t[0])),null):o.translate.apply(o,i.concat([t]))},n)),n.interpolation&&this.interpolator.reset()}var u=n.postProcess||this.options.postProcess,h="string"==typeof u?[u]:u;return null!=e&&h&&h.length&&!1!==n.applyPostProcessor&&(e=tu.handle(h,e,t,this.options&&this.options.postProcessPassResolved?tm({i18nResolved:i},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,i,r,o,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach(function(e){if(!a.isValidLookup(t)){var l=a.extractFromKey(e,s),c=l.key;n=c;var d=l.namespaces;a.options.fallbackNS&&(d=d.concat(a.options.fallbackNS));var u=void 0!==s.count&&"string"!=typeof s.count,h=u&&!s.ordinal&&0===s.count&&a.pluralResolver.shouldUseIntlApi(),m=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,f=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);d.forEach(function(e){a.isValidLookup(t)||(o=e,!tf["".concat(f[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(o)&&(tf["".concat(f[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(o,'" 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(function(n){if(!a.isValidLookup(t)){r=n;var o,l=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(l,c,n,e,s);else{u&&(d=a.pluralResolver.getSuffix(n,s.count,s));var d,f="".concat(a.options.pluralSeparator,"zero");if(u&&(l.push(c+d),h&&l.push(c+f)),m){var p="".concat(c).concat(a.options.contextSeparator).concat(s.context);l.push(p),u&&(l.push(p+d),h&&l.push(p+f))}}for(;o=l.pop();)a.isValidLookup(t)||(i=o,t=a.getResource(n,e,o,s))}}))})}}),{res:t,usedKey:n,exactUsedKey:i,usedLng:r,usedNS:o}}},{key:"isValidLookup",value:function(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,i):this.resourceStore.getResource(e,t,n,i)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),i}(e6);function tg(e){return e.charAt(0).toUpperCase()+e.slice(1)}var tb=function(){function e(t){eY(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=e4.create("languageUtils")}return eV(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||0>e.indexOf("-"))return null;var t=e.split("-");return 2===t.length||(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||0>e.indexOf("-"))return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map(function(e){return e.toLowerCase()}):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=tg(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=tg(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=tg(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach(function(e){if(!t){var i=n.formatLanguageCode(e);(!n.options.supportedLngs||n.isSupportedCode(i))&&(t=i)}}),!t&&this.options.supportedLngs&&e.forEach(function(e){if(!t){var i=n.getLanguagePartFromCode(e);if(n.isSupportedCode(i))return t=i;t=n.options.supportedLngs.find(function(e){if(0===e.indexOf(i))return e})}}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,i=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],o=function(e){e&&(n.isSupportedCode(e)?r.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),i.forEach(function(e){0>r.indexOf(e)&&o(n.formatLanguageCode(e))}),r}}]),e}(),t_=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],ty={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(+(1!=e&&(e%10!=1||e%100==11)))},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:3*(e%100==3||e%100==4))},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},tv=["v1","v2","v3"],tx={zero:0,one:1,two:2,few:3,many:4,other:5},tw=function(){function e(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};eY(this,e),this.languageUtils=t,this.options=i,this.logger=e4.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(n={},t_.forEach(function(e){e.lngs.forEach(function(t){n[t]={numbers:e.nr,plurals:ty[e.fc]}})}),n)}return eV(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map(function(e){return"".concat(t).concat(e)})}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.getRule(e,n);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort(function(e,t){return tx[e]-tx[t]}).map(function(e){return"".concat(t.options.prepend).concat(e)}):i.numbers.map(function(i){return t.getSuffix(e,i,n)}):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.getRule(e,n);return i?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(i.select(t)):this.getSuffixRetroCompatible(i,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,i=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),r=e.numbers[i];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));var o=function(){return n.options.prepend&&r.toString()?n.options.prepend+r.toString():r.toString()};return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?"_plural_".concat(r.toString()):o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}},{key:"shouldUseIntlApi",value:function(){return!tv.includes(this.options.compatibilityJSON)}}]),e}();function tF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function tk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tF(Object(n),!0).forEach(function(t){eZ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var tE=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};eY(this,e),this.logger=e4.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return eV(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:to,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?ti(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?ti(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?ti(t.nestingPrefix):t.nestingPrefixEscaped||ti("$t("),this.nestingSuffix=t.nestingSuffix?ti(t.nestingSuffix):t.nestingSuffixEscaped||ti(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,i){var r,o,a,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var d=function(e){if(0>e.indexOf(s.formatSeparator)){var r=tn(t,l,e);return s.alwaysFormat?s.format(r,void 0,n,tk(tk(tk({},i),t),{},{interpolationkey:e})):r}var o=e.split(s.formatSeparator),a=o.shift().trim(),c=o.join(s.formatSeparator).trim();return s.format(tn(t,l,a),c,n,tk(tk(tk({},i),t),{},{interpolationkey:a}))};this.resetRegExp();var u=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,h=i&&i.interpolation&&void 0!==i.interpolation.skipOnVariables?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?c(s.escape(e)):c(e)}}].forEach(function(t){for(a=0;r=t.regex.exec(e);){var n=r[1].trim();if(void 0===(o=d(n)))if("function"==typeof u){var l=u(e,r,i);o="string"==typeof l?l:""}else if(i&&i.hasOwnProperty(n))o="";else if(h){o=r[0];continue}else s.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),o="";else"string"==typeof o||s.useRawValueToEscape||(o=e7(o));var c=t.safeValue(o);if(e=e.replace(r[0],c),h?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=r[0].length):t.regex.lastIndex=0,++a>=s.maxReplaces)break}}),e}},{key:"nest",value:function(e,t){var n,i,r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=tk({},o);function s(e,t){var n=this.nestingOptionsSeparator;if(0>e.indexOf(n))return e;var i=e.split(new RegExp("".concat(n,"[ ]*{"))),r="{".concat(i[1]);e=i[0];var o=(r=this.interpolate(r,a)).match(/'/g),s=r.match(/"/g);(o&&o.length%2==0&&!s||s.length%2!=0)&&(r=r.replace(/'/g,'"'));try{a=JSON.parse(r),t&&(a=tk(tk({},t),a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(r)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(e);){var l=[],c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var d=n[1].split(this.formatSeparator).map(function(e){return e.trim()});n[1]=d.shift(),l=d,c=!0}if((i=t(s.call(this,n[1].trim(),a),a))&&n[0]===e&&"string"!=typeof i)return i;"string"!=typeof i&&(i=e7(i)),i||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),i=""),c&&(i=l.reduce(function(e,t){return r.format(e,t,o.lng,tk(tk({},o),{},{interpolationkey:n[1].trim()}))},i.trim())),e=e.replace(n[0],i),this.regexp.lastIndex=0}return e}}]),e}();function tA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function tC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tA(Object(n),!0).forEach(function(t){eZ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tT(e){var t={};return function(n,i,r){var o=i+JSON.stringify(r),a=t[o];return a||(a=e(i,r),t[o]=a),a(n)}}var tS=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};eY(this,e),this.logger=e4.create("formatter"),this.options=t,this.formats={number:tT(function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}}),currency:tT(function(e,t){var n=new Intl.NumberFormat(e,tC(tC({},t),{},{style:"currency"}));return function(e){return n.format(e)}}),datetime:tT(function(e,t){var n=new Intl.DateTimeFormat(e,tC({},t));return function(e){return n.format(e)}}),relativetime:tT(function(e,t){var n=new Intl.RelativeTimeFormat(e,tC({},t));return function(e){return n.format(e,t.range||"day")}}),list:tT(function(e,t){var n=new Intl.ListFormat(e,tC({},t));return function(e){return n.format(e)}})},this.init(t)}return eV(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=tT(t)}},{key:"format",value:function(e,t,n,i){var r=this;return t.split(this.formatSeparator).reduce(function(e,t){var o=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var i=e.split("(");t=i[0].toLowerCase().trim();var r=i[1].substring(0,i[1].length-1);"currency"===t&&0>r.indexOf(":")?n.currency||(n.currency=r.trim()):"relativetime"===t&&0>r.indexOf(":")?n.range||(n.range=r.trim()):r.split(";").forEach(function(e){if(e){var t,i=function(e){if(Array.isArray(e))return e}(t=e.split(":"))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return eJ(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eJ(e,void 0)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=i[0],o=i.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=o),"false"===o&&(n[r.trim()]=!1),"true"===o&&(n[r.trim()]=!0),isNaN(o)||(n[r.trim()]=parseInt(o,10))}})}return{formatName:t,formatOptions:n}}(t),a=o.formatName,s=o.formatOptions;if(r.formats[a]){var l=e;try{var c=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},d=c.locale||c.lng||i.locale||i.lng||n;l=r.formats[a](e,d,tC(tC(tC({},s),i),c))}catch(e){r.logger.warn(e)}return l}return r.logger.warn("there was no format function for ".concat(a)),e},e)}}]),e}();function tM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function tL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tM(Object(n),!0).forEach(function(t){eZ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var tD=function(e){eq(i,e);var t,n=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=eX(i);return e=t?Reflect.construct(n,arguments,eX(this).constructor):n.apply(this,arguments),eK(this,e)});function i(e,t,r){var o,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return eY(this,i),o=n.call(this),ta&&e6.call(eW(o)),o.backend=e,o.store=t,o.services=r,o.languageUtils=r.languageUtils,o.options=a,o.logger=e4.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=a.maxParallelReads||10,o.readingCalls=0,o.maxRetries=a.maxRetries>=0?a.maxRetries:5,o.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(r,a.backend,a),o}return eV(i,[{key:"queueLoad",value:function(e,t,n,i){var r=this,o={},a={},s={},l={};return e.forEach(function(e){var i=!0;t.forEach(function(t){var s="".concat(e,"|").concat(t);!n.reload&&r.store.hasResourceBundle(e,t)?r.state[s]=2:r.state[s]<0||(1===r.state[s]?void 0===a[s]&&(a[s]=!0):(r.state[s]=1,i=!1,void 0===a[s]&&(a[s]=!0),void 0===o[s]&&(o[s]=!0),void 0===l[t]&&(l[t]=!0)))}),i||(s[e]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,n){var i=e.split("|"),r=i[0],o=i[1];t&&this.emit("failedLoading",r,o,t),n&&this.store.addResourceBundle(r,o,n),this.state[e]=t?-1:2;var a={};this.queue.forEach(function(n){var i,s,l,c,d;i=n.loaded,(c=(l=e9(i,[r],Object)).obj)[d=l.k]=c[d]||[],s||c[d].push(o),void 0!==n.pending[e]&&(delete n.pending[e],n.pendingCount--),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(function(e){a[e]||(a[e]={});var t=n.loaded[e];t.length&&t.forEach(function(t){void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(function(e){return!e.done})}},{key:"read",value:function(e,t,n){var i=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:a}):(this.readingCalls++,this.backend[n](e,t,function(s,l){if(i.readingCalls--,i.waitingReads.length>0){var c=i.waitingReads.shift();i.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}if(s&&l&&r<i.maxRetries)return void setTimeout(function(){i.read.call(i,e,t,n,r+1,2*o,a)},o);a(s,l)})):a(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,i,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(function(e){n.loadOne(e)})}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=e.split("|"),r=i[0],o=i[1];this.read(r,o,"read",void 0,void 0,function(i,a){i&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(r," failed"),i),!i&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(r),a),t.loaded(e,i,a)})}},{key:"saveMissing",value:function(e,t,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))return void this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" 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!!!");null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,i,null,tL(tL({},o),{},{isUpdate:r})),e&&e[0]&&this.store.addResource(e[0],t,n,i))}}]),i}(e6);function tI(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&0>e.supportedLngs.indexOf("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function tR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function tO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tR(Object(n),!0).forEach(function(t){eZ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tP(){}var t$=function(e){eq(i,e);var t,n=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=eX(i);return e=t?Reflect.construct(n,arguments,eX(this).constructor):n.apply(this,arguments),eK(this,e)});function i(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(eY(this,i),t=n.call(this),ta&&e6.call(eW(t)),t.options=tI(r),t.services={},t.logger=e4,t.modules={external:[]},Object.getOwnPropertyNames(Object.getPrototypeOf(e=eW(t))).forEach(function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}),o&&!t.isInitialized&&!r.isClone){if(!t.options.initImmediate)return t.init(r,o),eK(t,eW(t));setTimeout(function(){t.init(r,o)},0)}return t}return eV(i,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:0>t.ns.indexOf("translation")&&(t.defaultNS=t.ns[0]));var i={debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===ej(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===ej(e[2])||"object"===ej(e[3])){var n=e[3]||e[2];Object.keys(n).forEach(function(e){t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:function(e,t,n,i){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}};function r(e){return e?"function"==typeof e?new e:e:null}if(this.options=tO(tO(tO({},i),this.options),tI(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=tO(tO({},i.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){this.modules.logger?e4.init(r(this.modules.logger),this.options):e4.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=tS);var o,a=new tb(this.options);this.store=new td(this.options.resources,this.options);var s=this.services;s.logger=e4,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new tw(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),o&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(s.formatter=r(o),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new tE(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new tD(r(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",function(t){for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];e.emit.apply(e,[t].concat(i))}),this.modules.languageDetector&&(s.languageDetector=r(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=r(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new tp(this.services,this.options),this.translator.on("*",function(t){for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];e.emit.apply(e,[t].concat(i))}),this.modules.external.forEach(function(t){t.init&&t.init(e)})}if(this.format=this.options.interpolation.format,n||(n=tP),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&"dev"!==l[0]&&(this.options.lng=l[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(function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}});var c=e8(),d=function(){var t=function(t,i){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),c.resolve(i),n(t,i)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?d():setTimeout(d,0),c}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tP,i=n,r="string"==typeof e?e:this.language;if("function"==typeof e&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase())return i();var o=[],a=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach(function(e){0>o.indexOf(e)&&o.push(e)})};r?a(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(function(e){return a(e)}),this.options.preload&&this.options.preload.forEach(function(e){return a(e)}),this.services.backendConnector.load(o,this.options.ns,function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),i(e)})}else i(null)}},{key:"reloadResources",value:function(e,t,n){var i=e8();return e||(e=this.languages),t||(t=this.options.ns),n||(n=tP),this.services.backendConnector.reload(e,t,function(e){i.resolve(),n(e)}),i}},{key:"use",value:function(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&tu.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var i=e8();this.emit("languageChanging",e);var r=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},o=function(e,o){o?(r(o),n.translator.changeLanguage(o),n.isLanguageChangingTo=void 0,n.emit("languageChanged",o),n.logger.log("languageChanged",o)):n.isLanguageChangingTo=void 0,i.resolve(function(){return n.t.apply(n,arguments)}),t&&t(e,function(){return n.t.apply(n,arguments)})},a=function(t){e||t||!n.services.languageDetector||(t=[]);var i="string"==typeof t?t:n.services.languageUtils.getBestMatchFromCodes(t);i&&(n.language||r(i),n.translator.language||n.translator.changeLanguage(i),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(i)),n.loadResources(i,function(e){o(e,i)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),i}},{key:"getFixedT",value:function(e,t,n){var i=this,r=function e(t,r){if("object"!==ej(r)){for(var o,a=arguments.length,s=Array(a>2?a-2:0),l=2;l<a;l++)s[l-2]=arguments[l];o=i.options.overloadTranslationOptionHandler([t,r].concat(s))}else o=tO({},r);o.lng=o.lng||e.lng,o.lngs=o.lngs||e.lngs,o.ns=o.ns||e.ns,o.keyPrefix=o.keyPrefix||n||e.keyPrefix;var c=i.options.keySeparator||".",d=o.keyPrefix?"".concat(o.keyPrefix).concat(c).concat(t):t;return i.t(d,o)};return"string"==typeof e?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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;var i=this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===i.toLowerCase())return!0;var a=function(e,n){var i=t.services.backendConnector.state["".concat(e,"|").concat(n)];return -1===i||2===i};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(i,e)&&(!r||a(o,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,i=e8();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach(function(e){0>n.options.ns.indexOf(e)&&n.options.ns.push(e)}),this.loadResources(function(e){i.resolve(),t&&t(e)}),i):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=e8();"string"==typeof e&&(e=[e]);var i=this.options.preload||[],r=e.filter(function(e){return 0>i.indexOf(e)});return r.length?(this.options.preload=i.concat(r),this.loadResources(function(e){n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){return(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),e)?["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"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr":"rtl"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tP,r=tO(tO(tO({},this.options),t),{isClone:!0}),o=new i(r);return(void 0!==t.debug||void 0!==t.prefix)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(function(t){o[t]=e[t]}),o.services=tO({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new tp(o.services,o.options),o.translator.on("*",function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];o.emit.apply(o,[e].concat(n))}),o.init(r,n),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),i}(e6);eZ(t$,"createInstance",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new t$(e,t)});var tN=t$.createInstance();tN.createInstance=t$.createInstance,tN.createInstance,tN.init,tN.loadResources,tN.reloadResources,tN.use,tN.changeLanguage,tN.getFixedT,tN.t,tN.exists,tN.setDefaultNamespace,tN.hasLoadedNamespace,tN.loadNamespaces,tN.loadLanguages;let tB=tN;var tz=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let tj=class extends ez(tB)(em){render(){return K`
|
|
59
59
|
${this._getTranslatedValue()}
|
|
60
60
|
`}_getTranslatedValue(){return this.value?tB.isInitialized?tB.t(this.value,this.options):this.value:""}};tj.styles=u`
|
|
@@ -65,7 +65,7 @@ uniform ${n} ${i} u_${r};
|
|
|
65
65
|
:host([hidden]) {
|
|
66
66
|
display: none;
|
|
67
67
|
}
|
|
68
|
-
`,tz([eb({type:String})],tj.prototype,"value",void 0),tz([eb({type:Object})],tj.prototype,"options",void 0),tj=tz([ep("or-translate")],tj),function(e){e.CREATE="CREATE",e.UPDATE="UPDATE",e.DELETE="DELETE"}(aL||(aL={})),function(e){e.LOW="LOW",e.MEDIUM="MEDIUM",e.HIGH="HIGH"}(aD||(aD={})),function(e){e.MANUAL="MANUAL",e.CLIENT="CLIENT",e.GLOBAL_RULESET="GLOBAL_RULESET",e.REALM_RULESET="REALM_RULESET",e.ASSET_RULESET="ASSET_RULESET",e.AGENT="AGENT"}(aI||(aI={})),function(e){e.OPEN="OPEN",e.ACKNOWLEDGED="ACKNOWLEDGED",e.IN_PROGRESS="IN_PROGRESS",e.RESOLVED="RESOLVED",e.CLOSED="CLOSED"}(aR||(aR={})),function(e){e.BOTTOM_LEFT="BOTTOM_LEFT",e.BOTTOM_RIGHT="BOTTOM_RIGHT",e.TOP_LEFT="TOP_LEFT",e.TOP_RIGHT="TOP_RIGHT"}(aO||(aO={})),function(e){e.CREATE="CREATE",e.READ="READ",e.UPDATE="UPDATE",e.DELETE="DELETE"}(aP||(aP={})),function(e){e.NONE="NONE",e.FORECAST="FORECAST",e.SETPOINT="SETPOINT"}(a$||(a$={})),function(e){e.DISCONNECTED="DISCONNECTED",e.CONNECTING="CONNECTING",e.DISCONNECTING="DISCONNECTING",e.CONNECTED="CONNECTED",e.DISABLED="DISABLED",e.WAITING="WAITING",e.ERROR="ERROR",e.STOPPED="STOPPED"}(aN||(aN={})),function(e){e.EV="EV",e.PHEV="PHEV"}(aB||(aB={})),function(e){e.YAZAKI="YAZAKI",e.MENNEKES="MENNEKES",e.LE_GRAND="LE_GRAND",e.CHADEMO="CHADEMO",e.COMBO="COMBO",e.SCHUKO="SCHUKO",e.ENERGYLOCK="ENERGYLOCK"}(az||(az={})),function(e){e.SOUTH="SOUTH",e.EAST_WEST="EAST_WEST"}(aj||(aj={})),function(e){e.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"}(aY||(aY={})),function(e){e.TOGGLE="TOGGLE",e.INCREMENT="INCREMENT",e.DECREMENT="DECREMENT",e.NEGATE="NEGATE"}(aH||(aH={})),function(e){e.ASSET_NOT_FOUND="ASSET_NOT_FOUND",e.ATTRIBUTE_NOT_FOUND="ATTRIBUTE_NOT_FOUND",e.INSUFFICIENT_ACCESS="INSUFFICIENT_ACCESS",e.INVALID_VALUE="INVALID_VALUE",e.INTERCEPTOR_FAILURE="INTERCEPTOR_FAILURE",e.STATE_STORAGE_FAILED="STATE_STORAGE_FAILED",e.CANNOT_PROCESS="CANNOT_PROCESS",e.QUEUE_FULL="QUEUE_FULL",e.UNKNOWN="UNKNOWN",e.ASSET_ID_MISSING="ASSET_ID_MISSING",e.ATTRIBUTE_NAME_MISSING="ATTRIBUTE_NAME_MISSING"}(aU||(aU={})),function(e){e.PUBLIC="PUBLIC",e.SHARED="SHARED",e.PRIVATE="PRIVATE"}(aV||(aV={})),function(e){e.OFF="OFF",e.ONE_MIN="ONE_MIN",e.FIVE_MIN="FIVE_MIN",e.QUARTER="QUARTER",e.ONE_HOUR="ONE_HOUR"}(aW||(aW={})),function(e){e.WRAP_TO_SINGLE_COLUMN="WRAP_TO_SINGLE_COLUMN",e.KEEP_LAYOUT="KEEP_LAYOUT",e.REDIRECT="REDIRECT",e.BLOCK_DEVICE="BLOCK_DEVICE"}(aG||(aG={})),function(e){e.MINUTE="MINUTE",e.HOUR="HOUR",e.DAY="DAY",e.WEEK="WEEK",e.MONTH="MONTH",e.YEAR="YEAR"}(aq||(aq={})),function(e){e.MIN="MIN",e.AVG="AVG",e.MAX="MAX",e.DIFFERENCE="DIFFERENCE",e.COUNT="COUNT",e.SUM="SUM",e.MODE="MODE",e.MEDIAN="MEDIAN"}(aK||(aK={})),function(e){e.TERMINATING="TERMINATING",e.DISABLED="DISABLED",e.ALREADY_CONNECTED="ALREADY_CONNECTED",e.UNRECOGNISED="UNRECOGNISED",e.PERMANENT_ERROR="PERMANENT_ERROR",e.SYNC_ERROR="SYNC_ERROR"}(aX||(aX={})),function(e){e.HTTPS="HTTPS",e.HTTP="HTTP",e.TCP="TCP"}(aZ||(aZ={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.OPTIONS="OPTIONS",e.PATCH="PATCH"}(aJ||(aJ={})),function(e){e.KEYCLOAK="KEYCLOAK",e.BASIC="BASIC",e.NONE="NONE"}(aQ||(aQ={})),function(e){e.WEBSOCKET="WEBSOCKET",e.POLLING="POLLING"}(a0||(a0={})),function(e){e.VECTOR="VECTOR",e.RASTER="RASTER"}(a1||(a1={})),function(e){e.INTERNAL="INTERNAL",e.CLIENT="CLIENT",e.GLOBAL_RULESET="GLOBAL_RULESET",e.REALM_RULESET="REALM_RULESET",e.ASSET_RULESET="ASSET_RULESET"}(a2||(a2={})),function(e){e.REALM="REALM",e.USER="USER",e.ASSET="ASSET",e.CUSTOM="CUSTOM"}(a5||(a5={})),function(e){e.NORMAL="NORMAL",e.HIGH="HIGH"}(a3||(a3={})),function(e){e.DEVICE="DEVICE",e.TOPIC="TOPIC",e.CONDITION="CONDITION"}(a4||(a4={})),function(e){e.ALWAYS="ALWAYS",e.ONCE="ONCE",e.HOURLY="HOURLY",e.DAILY="DAILY",e.WEEKLY="WEEKLY",e.MONTHLY="MONTHLY",e.ANNUALLY="ANNUALLY"}(a6||(a6={})),function(e){e.MESSAGE_INVALID="MESSAGE_INVALID",e.CERTIFICATE_INVALID="CERTIFICATE_INVALID",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.UNIQUE_ID_MISMATCH="UNIQUE_ID_MISMATCH",e.CONFIG_DISABLED="CONFIG_DISABLED",e.USER_DISABLED="USER_DISABLED",e.SERVER_ERROR="SERVER_ERROR",e.ASSET_ERROR="ASSET_ERROR",e.SERVER_BUSY="SERVER_BUSY"}(a8||(a8={})),function(e){e.PRIVATE="PRIVATE",e.PROTECTED="PROTECTED",e.PUBLIC="PUBLIC"}(a7||(a7={})),function(e){e.EXACT="EXACT",e.BEGIN="BEGIN",e.END="END",e.CONTAINS="CONTAINS"}(a9||(a9={})),function(e){e.EQUALS="EQUALS",e.GREATER_THAN="GREATER_THAN",e.GREATER_EQUALS="GREATER_EQUALS",e.LESS_THAN="LESS_THAN",e.LESS_EQUALS="LESS_EQUALS",e.BETWEEN="BETWEEN"}(se||(se={})),function(e){e.CREATED_ON="CREATED_ON",e.NAME="NAME",e.ASSET_TYPE="ASSET_TYPE",e.PARENT_ID="PARENT_ID",e.REALM="REALM"}(st||(st={})),function(e){e.RESTRICTED="RESTRICTED",e.LINKED="LINKED",e.REALM="REALM"}(sn||(sn={})),function(e){e.AT_LEAST_ONE="AT_LEAST_ONE",e.ALL="ALL",e.NONE="NONE"}(si||(si={})),function(e){e.AND="AND",e.OR="OR"}(sr||(sr={})),function(e){e.CREATED_ON="CREATED_ON",e.FIRST_NAME="FIRST_NAME",e.LAST_NAME="LAST_NAME",e.USERNAME="USERNAME",e.EMAIL="EMAIL"}(so||(so={})),function(e){e.STOPPED="STOPPED",e.RUNNING="RUNNING",e.ERROR="ERROR"}(sa||(sa={})),function(e){e.JAVASCRIPT="JAVASCRIPT",e.GROOVY="GROOVY",e.JSON="JSON",e.FLOW="FLOW"}(ss||(ss={})),function(e){e.READY="READY",e.DEPLOYED="DEPLOYED",e.COMPILATION_ERROR="COMPILATION_ERROR",e.VALIDITY_PERIOD_ERROR="VALIDITY_PERIOD_ERROR",e.EXECUTION_ERROR="EXECUTION_ERROR",e.LOOP_ERROR="LOOP_ERROR",e.DISABLED="DISABLED",e.PAUSED="PAUSED",e.EXPIRED="EXPIRED",e.REMOVED="REMOVED",e.EMPTY="EMPTY"}(sl||(sl={})),function(e){e.SUNRISE="SUNRISE",e.SUNSET="SUNSET",e.TWILIGHT_MORNING_VISUAL="TWILIGHT_MORNING_VISUAL",e.TWILIGHT_MORNING_VISUAL_LOWER="TWILIGHT_MORNING_VISUAL_LOWER",e.TWILIGHT_MORNING_HORIZON="TWILIGHT_MORNING_HORIZON",e.TWILIGHT_MORNING_CIVIL="TWILIGHT_MORNING_CIVIL",e.TWILIGHT_MORNING_NAUTICAL="TWILIGHT_MORNING_NAUTICAL",e.TWILIGHT_MORNING_ASTRONOMICAL="TWILIGHT_MORNING_ASTRONOMICAL",e.TWILIGHT_MORNING_GOLDEN_HOUR="TWILIGHT_MORNING_GOLDEN_HOUR",e.TWILIGHT_MORNING_BLUE_HOUR="TWILIGHT_MORNING_BLUE_HOUR",e.TWILIGHT_MORNING_NIGHT_HOUR="TWILIGHT_MORNING_NIGHT_HOUR",e.TWILIGHT_EVENING_VISUAL="TWILIGHT_EVENING_VISUAL",e.TWILIGHT_EVENING_VISUAL_LOWER="TWILIGHT_EVENING_VISUAL_LOWER",e.TWILIGHT_EVENING_HORIZON="TWILIGHT_EVENING_HORIZON",e.TWILIGHT_EVENING_CIVIL="TWILIGHT_EVENING_CIVIL",e.TWILIGHT_EVENING_NAUTICAL="TWILIGHT_EVENING_NAUTICAL",e.TWILIGHT_EVENING_ASTRONOMICAL="TWILIGHT_EVENING_ASTRONOMICAL",e.TWILIGHT_EVENING_GOLDEN_HOUR="TWILIGHT_EVENING_GOLDEN_HOUR",e.TWILIGHT_EVENING_BLUE_HOUR="TWILIGHT_EVENING_BLUE_HOUR",e.TWILIGHT_EVENING_NIGHT_HOUR="TWILIGHT_EVENING_NIGHT_HOUR"}(sc||(sc={})),function(e){e.NUMBER="NUMBER",e.NUMBER_ARRAY="NUMBER_ARRAY",e.STRING="STRING",e.BOOLEAN="BOOLEAN",e.TRIGGER="TRIGGER",e.COLOR="COLOR",e.ANY="ANY"}(sd||(sd={})),function(e){e.NEW_LINE="NEW_LINE",e.SPACER="SPACER"}(su||(su={})),function(e){e.INPUT="INPUT",e.PROCESSOR="PROCESSOR",e.OUTPUT="OUTPUT",e.THEN="THEN"}(sh||(sh={})),function(e){e.TEXT="TEXT",e.MULTILINE="MULTILINE",e.NUMBER="NUMBER",e.DROPDOWN="DROPDOWN",e.DOUBLE_DROPDOWN="DOUBLE_DROPDOWN",e.CHECKBOX="CHECKBOX",e.ASSET_ATTRIBUTE="ASSET_ATTRIBUTE",e.COLOR="COLOR",e.DATE="DATE"}(sm||(sm={})),function(e){e.ADD="ADD",e.ADD_OR_REPLACE="ADD_OR_REPLACE",e.REPLACE="REPLACE",e.DELETE="DELETE",e.CLEAR="CLEAR"}(sf||(sf={})),function(e){e.PER_ASSET="PER_ASSET",e.GLOBAL="GLOBAL"}(sp||(sp={})),function(e){e.READ_ADMIN="read:admin",e.READ_LOGS="read:logs",e.READ_USERS="read:users",e.READ_MAP="read:map",e.READ_ASSETS="read:assets",e.READ_RULES="read:rules",e.READ_INSIGHTS="read:insights",e.READ_ALARMS="read:alarms",e.WRITE_USER="write:user",e.WRITE_ADMIN="write:admin",e.WRITE_LOGS="write:logs",e.WRITE_ASSETS="write:assets",e.WRITE_ATTRIBUTES="write:attributes",e.WRITE_RULES="write:rules",e.WRITE_INSIGHTS="write:insights",e.WRITE_ALARMS="write:alarms",e.READ="read",e.WRITE="write"}(sg||(sg={})),function(e){e.ASSET="ASSET",e.AGENT="AGENT",e.NOTIFICATION="NOTIFICATION",e.ALARM="ALARM",e.RULES="RULES",e.PROTOCOL="PROTOCOL",e.GATEWAY="GATEWAY",e.MODEL_AND_VALUES="MODEL_AND_VALUES",e.API="API",e.DATA="DATA"}(sb||(sb={})),function(e){e.INFO="INFO",e.WARN="WARN",e.ERROR="ERROR"}(s_||(s_={})),function(e){e.NUMERIC="numeric",e.DIGIT_2="2-digit",e.FULL="full",e.LONG="long",e.MEDIUM="medium",e.SHORT="short",e.NARROW="narrow"}(sy||(sy={})),function(e){e.SECONDLY="SECONDLY",e.MINUTELY="MINUTELY",e.HOURLY="HOURLY",e.DAILY="DAILY",e.WEEKLY="WEEKLY",e.MONTHLY="MONTHLY",e.YEARLY="YEARLY"}(sv||(sv={})),function(e){e.OMIT="OMIT",e.BACKWARD="BACKWARD",e.FORWARD="FORWARD"}(sx||(sx={})),function(e){e.JAPANESE="JAPANESE",e.BUDDHIST="BUDDHIST",e.ROC="ROC",e.ISLAMIC="ISLAMIC",e.ISO8601="ISO8601",e.CHINESE="CHINESE",e.ETHIOPIC="ETHIOPIC",e.HEBREW="HEBREW",e.GREGORIAN="GREGORIAN"}(sw||(sw={})),function(e){e.SU="SU",e.MO="MO",e.TU="TU",e.WE="WE",e.TH="TH",e.FR="FR",e.SA="SA"}(sF||(sF={})),function(e){e.PEOPLECOUNTERASSET="PeopleCounterAsset",e.STORAGESIMULATORAGENT="StorageSimulatorAgent",e.CITYASSET="CityAsset",e.ELECTRICITYCONSUMERASSET="ElectricityConsumerAsset",e.ELECTRICVEHICLEASSET="ElectricVehicleAsset",e.CONSOLEASSET="ConsoleAsset",e.PRESENCESENSORASSET="PresenceSensorAsset",e.LIGHTASSET="LightAsset",e.PLUGASSET="PlugAsset",e.ELECTRICITYCHARGERASSET="ElectricityChargerAsset",e.ELECTRICITYBATTERYASSET="ElectricityBatteryAsset",e.ELECTRICITYSUPPLIERASSET="ElectricitySupplierAsset",e.TCPAGENT="TCPAgent",e.SERIALAGENT="SerialAgent",e.BLUETOOTHMESHAGENT="BluetoothMeshAgent",e.SNMPAGENT="SNMPAgent",e.GROUPASSET="GroupAsset",e.BUILDINGASSET="BuildingAsset",e.ELECTRICITYPRODUCERWINDASSET="ElectricityProducerWindAsset",e.ENVIRONMENTSENSORASSET="EnvironmentSensorAsset",e.MQTTAGENT="MQTTAgent",e.MICROPHONEASSET="MicrophoneAsset",e.MODBUSTCPAGENT="ModbusTcpAgent",e.HTTPAGENT="HTTPAgent",e.DOORASSET="DoorAsset",e.ELECTRICITYPRODUCERASSET="ElectricityProducerAsset",e.MAILAGENT="MailAgent",e.UDPAGENT="UDPAgent",e.ROOMASSET="RoomAsset",e.VENTILATIONASSET="VentilationAsset",e.TRADFRILIGHTASSET="TradfriLightAsset",e.KNXAGENT="KNXAgent",e.WEATHERASSET="WeatherAsset",e.THINGASSET="ThingAsset",e.WEBSOCKETAGENT="WebsocketAgent",e.GATEWAYASSET="GatewayAsset",e.PARKINGASSET="ParkingAsset",e.TRADFRIPLUGASSET="TradfriPlugAsset",e.SIMULATORAGENT="SimulatorAgent",e.MODBUSSERIALAGENT="ModbusSerialAgent",e.ELECTRICVEHICLEFLEETGROUPASSET="ElectricVehicleFleetGroupAsset",e.VELBUSTCPAGENT="VelbusTCPAgent",e.ARTNETLIGHTASSET="ArtnetLightAsset",e.VELBUSSERIALAGENT="VelbusSerialAgent",e.GROUNDWATERSENSORASSET="GroundwaterSensorAsset",e.ELECTRICITYPRODUCERSOLARASSET="ElectricityProducerSolarAsset",e.ENERGYOPTIMISATIONASSET="EnergyOptimisationAsset",e.ZWAVEAGENT="ZWaveAgent",e.THERMOSTATASSET="ThermostatAsset",e.SHIPASSET="ShipAsset"}(sk||(sk={})),function(e){e.SUPPORTSEXPORT="supportsExport",e.ENERGYSELFCONSUMPTION="energySelfConsumption",e.LASTACCESS="lastAccess",e.CHARGERID="chargerID",e.POSITION="position",e.CARBONSAVING="carbonSaving",e.ROUTINGMODE="routingMode",e.LASTWILLRETAIN="lastWillRetain",e.LASTWILLTOPIC="lastWillTopic",e.SERIALBAUDRATE="serialBaudrate",e.BASEURL="baseURL",e.REQUIREDVALUES="requiredValues",e.FINANCIALSAVING="financialSaving",e.FLEETCATEGORY="fleetCategory",e.GATEWAYSTATUS="gatewayStatus",e.NO2LEVEL="NO2Level",e.TAGS="tags",e.UNLOCK="unlock",e.MILEAGEMIN="mileageMin",e.CHECKINTERVALSECONDS="checkIntervalSeconds",e.LOCATION="location",e.CLIENTSECRET="clientSecret",e.WINDDIRECTION="windDirection",e.WINDSPEED="windSpeed",e.PARTICLESPM10="particlesPM10",e.APPLICATIONKEY="applicationKey",e.POWEREXPORTMAX="powerExportMax",e.SETWINDACTUALVALUEWITHFORECAST="setWindActualValueWithForecast",e.WATERLEVEL="waterLevel",e.CONSOLENAME="consoleName",e.CONNECTHEADERS="connectHeaders",e.WEBSOCKETQUERY="websocketQuery",e.PREFERHTML="preferHTML",e.COOLING="cooling",e.POLLINGMILLIS="pollingMillis",e.SOILTEMPERATURE="soilTemperature",e.SUNIRRADIANCE="sunIrradiance",e.ODOMETER="odometer",e.SUPPORTSIMPORT="supportsImport",e.MESSAGEMAXLENGTH="messageMaxLength",e.ENERGYLEVELPERCENTAGEMIN="energyLevelPercentageMin",e.LIGHTID="lightId",e.POWER="power",e.STREET="street",e.DELETEPROCESSEDMAIL="deleteProcessedMail",e.WINDSPEEDMIN="windSpeedMin",e.POWERSETPOINT="powerSetpoint",e.PRESENCE="presence",e.SPACESOCCUPIED="spacesOccupied",e.STARTTLS="startTLS",e.AGENTSTATUS="agentStatus",e.MESSAGECHARSET="messageCharset",e.CERTIFICATEALIAS="certificateAlias",e.PANELPITCH="panelPitch",e.EMAIL="email",e.BINDPORT="bindPort",e.PARTICLESPM1="particlesPM1",e.SPEED="speed",e.ENERGYLEVELPERCENTAGEMAX="energyLevelPercentageMax",e.MESSAGESTRIPDELIMITER="messageStripDelimiter",e.AREA="area",e.COUNTRY="country",e.SHIPTYPE="shipType",e.CONNECTSUBSCRIPTIONS="connectSubscriptions",e.RELATIVEHUMIDITY="relativeHumidity",e.INCLUDEFORECASTWINDSERVICE="includeForecastWindService",e.SOURCEADDRESS="sourceAddress",e.RAINFALL="rainfall",e.ENERGYIMPORTTOTAL="energyImportTotal",e.OAUTHGRANT="oAuthGrant",e.OZONELEVEL="ozoneLevel",e.COUNTINMINUTE="countInMinute",e.PORT="port",e.TUNNELINGSUPPORTED="tunnelingSupported",e.ENINUMBER="ENINumber",e.AGENTDISABLED="agentDisabled",e.DISABLED="disabled",e.FORCECHARGE="forceCharge",e.TIMEINJECTIONINTERVAL="timeInjectionInterval",e.FINANCIALWEIGHTING="financialWeighting",e.ENERGYLEVELPERCENTAGE="energyLevelPercentage",e.SPACESBUFFER="spacesBuffer",e.VEHICLECATEGORY="vehicleCategory",e.FANSPEED="fanSpeed",e.FINANCIALCOST="financialCost",e.NOTES="notes",e.MAILFOLDERNAME="mailFolderName",e.TEMPERATURE="temperature",e.AVAILABLECHARGINGSPACES="availableChargingSpaces",e.ENERGYCAPACITY="energyCapacity",e.POWERIMPORTMIN="powerImportMin",e.INTERVALSIZE="intervalSize",e.SNMPVERSIONVALUE="SNMPVersionValue",e.SOUNDLEVEL="soundLevel",e.UNITID="unitId",e.STOPBITS="stopBits",e.CONNECTURL="connectURL",e.CLIENTID="clientId",e.VEHICLEID="vehicleID",e.SUNAZIMUTH="sunAzimuth",e.AVAILABLEDISCHARGINGSPACES="availableDischargingSpaces",e.WEBSOCKETMODE="websocketMode",e.COLOURTEMPERATURE="colourTemperature",e.VEHICLECONNECTED="vehicleConnected",e.DATABITS="dataBits",e.MILEAGEMINIMUM="mileageMinimum",e.COLOURRGB="colourRGB",e.CARBONIMPORT="carbonImport",e.WILDCARDSUBSCRIPTIONTOPICS="wildcardSubscriptionTopics",e.PRICEHOURLY="priceHourly",e.WINDSPEEDMAX="windSpeedMax",e.PINGDISABLED="pingDisabled",e.FLOW="flow",e.CHILDASSETTYPE="childAssetType",e.NETWORKKEY="networkKey",e.UNIVERSE="universe",e.MSSINUMBER="MSSINumber",e.SUBSCRIBEQOS="subscribeQos",e.LEDCOUNT="lEDCount",e.LOCKED="locked",e.PROTOCOL="protocol",e.TARIFFIMPORT="tariffImport",e.ENERGYRENEWABLESHARE="energyRenewableShare",e.REGION="region",e.CONSOLEPLATFORM="consolePlatform",e.POWEREXPORTMIN="powerExportMin",e.EFFICIENCYEXPORT="efficiencyExport",e.CHARGECYCLES="chargeCycles",e.SERIALPORT="serialPort",e.PANELORIENTATION="panelOrientation",e.LENGTH="length",e.USERNAMEPASSWORD="usernamePassword",e.POWERFORECAST="powerForecast",e.SETACTUALSOLARVALUEWITHFORECAST="setActualSolarValueWithForecast",e.REQUESTQUERYPARAMETERS="requestQueryParameters",e.PROXYADDRESS="proxyAddress",e.ENERGYLOCAL="energyLocal",e.ENERGYAUTARKY="energyAutarky",e.MODEL="model",e.MANUFACTURER="manufacturer",e.ONOFF="onOff",e.RESUMESESSION="resumeSession",e.TARIFFEXPORT="tariffExport",e.CITY="city",e.CONNECTORTYPE="connectorType",e.ENERGYEXPORTTOTAL="energyExportTotal",e.CARBONEXPORT="carbonExport",e.REQUESTTIMEOUTMILLIS="requestTimeoutMillis",e.ENERGYLEVEL="energyLevel",e.OPTIMISATIONDISABLED="optimisationDisabled",e.WEBSOCKETPATH="websocketPath",e.WINDSPEEDREFERENCE="windSpeedReference",e.PRICEDAILY="priceDaily",e.COUNTGROWTHMINUTE="countGrowthMinute",e.IMONUMBER="IMONumber",e.INCLUDEFORECASTSOLARSERVICE="includeForecastSolarService",e.REQUESTHEADERS="requestHeaders",e.HOST="host",e.COUNTOUTMINUTE="countOutMinute",e.ENERGYTYPE="energyType",e.CONSOLEVERSION="consoleVersion",e.MTU="mtu",e.PANELAZIMUTH="panelAzimuth",e.SEQUENCENUMBER="sequenceNumber",e.SUNALTITUDE="sunAltitude",e.COUNTOUT="countOut",e.CHARGERCONNECTED="chargerConnected",e.ROOMNUMBER="roomNumber",e.PARTICLESPM2_5="particlesPM2_5",e.MESSAGESOURCEADDRESS="messageSourceAddress",e.COUNTIN="countIn",e.MILEAGECHARGED="mileageCharged",e.TEMPERATURESETPOINT="temperatureSetpoint",e.CONSOLEPROVIDERS="consoleProviders",e.POWERIMPORTMAX="powerImportMax",e.COUNTTOTAL="countTotal",e.SPACESTOTAL="spacesTotal",e.BINDHOST="bindHost",e.MESSAGECONVERTBINARY="messageConvertBinary",e.MESSAGEDELIMITERS="messageDelimiters",e.EFFICIENCYIMPORT="efficiencyImport",e.SUNZENITH="sunZenith",e.BRIGHTNESS="brightness",e.POSTALCODE="postalCode",e.SPACESOPEN="spacesOpen",e.HUMIDITY="humidity",e.SECUREMODE="secureMode",e.MILEAGECAPACITY="mileageCapacity",e.DIRECTION="direction",e.ENERGYLEVELSCHEDULE="energyLevelSchedule",e.UVINDEX="uVIndex",e.NATMODE="NATMode",e.UPDATEONWRITE="updateOnWrite",e.LASTWILLPAYLOAD="lastWillPayload",e.GROUPID="groupId",e.FOLLOWREDIRECTS="followRedirects",e.CARBONCOST="carbonCost",e.MESSAGECONVERTHEX="messageConvertHex",e.PUBLISHQOS="publishQos"}(sE||(sE={})),function(e){e.FORMAT="format",e.RULESTATE="ruleState",e.HASPREDICTEDDATAPOINTS="hasPredictedDataPoints",e.STOREDATAPOINTS="storeDataPoints",e.LABEL="label",e.CONSTRAINTS="constraints",e.SHOWONDASHBOARD="showOnDashboard",e.READONLY="readOnly",e.MULTILINE="multiline",e.ACCESSPUBLICWRITE="accessPublicWrite",e.MOMENTARY="momentary",e.AGENTLINK="agentLink",e.ACCESSRESTRICTEDREAD="accessRestrictedRead",e.DATAPOINTSMAXAGEDAYS="dataPointsMaxAgeDays",e.ACCESSRESTRICTEDWRITE="accessRestrictedWrite",e.SECRET="secret",e.ATTRIBUTELINKS="attributeLinks",e.RULERESETIMMEDIATE="ruleResetImmediate",e.FORECAST="forecast",e.UNITS="units",e.USERCONNECTED="userConnected",e.ACCESSPUBLICREAD="accessPublicRead"}(sA||(sA={})),function(e){e.WSURL="WS_URL",e.POSITIVENUMBER="positiveNumber",e.VALUEDESCRIPTOR="valueDescriptor",e.LONG="long",e.BOOLEANMAP="booleanMap",e.MQTTQOS="MQTTQos",e.GEOJSONPOINT="GEO_JSONPoint",e.SNMPVERSION="SNMPVersion",e.ASSETTYPE="assetType",e.JSONOBJECT="JSONObject",e.BIGNUMBER="bigNumber",e.IPADDRESS="IPAddress",e.EMAIL="email",e.KNXMESSAGESOURCEADDRESS="kNXMessageSourceAddress",e.ATTRIBUTEREFERENCE="attributeReference",e.INTEGER="integer",e.OAUTHGRANT="oAuthGrant",e.NUMBER="number",e.TEXTMAP="textMap",e.WEBSOCKETSUBSCRIPTION="websocketSubscription",e.BOOLEAN="boolean",e.TIMEANDPERIODDURATIONISO8601="timeAndPeriodDurationISO8601",e.TIMESTAMPISO8601="timestampISO8601",e.MULTIVALUEDTEXTMAP="multivaluedTextMap",e.JSON="JSON",e.INTEGERBYTE="integerByte",e.AGENTLINK="agentLink",e.CALENDAREVENT="calendarEvent",e.CONNECTIONSTATUS="connectionStatus",e.VALUECONSTRAINT="valueConstraint",e.ASSETQUERY="assetQuery",e.COLOURRGB="colourRGB",e.VALUEFORMAT="valueFormat",e.TEXT="text",e.BYTE="byte",e.USERNAMEANDPASSWORD="usernameAndPassword",e.HTTPURL="HTTP_URL",e.ATTRIBUTELINK="attributeLink",e.ASSETID="assetID",e.NUMBERMAP="numberMap",e.HTTPMETHOD="HTTPMethod",e.PANELORIENTATION="panelOrientation",e.ATTRIBUTESTATE="attributeState",e.POSITIVEINTEGER="positiveInteger",e.EXECUTIONSTATUS="executionStatus",e.BIGINTEGER="bigInteger",e.PERIODDURATIONISO8601="periodDurationISO8601",e.DATEANDTIME="dateAndTime",e.CONNECTORTYPE="connectorType",e.NEGATIVEINTEGER="negativeInteger",e.TCPIPPORTNUMBER="TCP_IPPortNumber",e.INTEGERMAP="integerMap",e.ENERGYTYPE="energyType",e.TIMESTAMP="timestamp",e.UUID="UUID",e.FORECASTCONFIGURATION="forecastConfiguration",e.TIMEDURATIONISO8601="timeDurationISO8601",e.CONSOLEPROVIDERS="consoleProviders",e.NEGATIVENUMBER="negativeNumber",e.CRONEXPRESSION="CRONExpression",e.DIRECTION="direction",e.HOSTORIPADDRESS="hostOrIPAddress"}(sC||(sC={})),function(e){e.MONTH="month",e.MILE_SCANDINAVIAN="mile_scandinavian",e.YEAR="year",e.VOLT="volt",e.HERTZ="hertz",e.MILE="mile",e.BTU="btu",e.FOOT="foot",e.MEGA="mega",e.INCH="inch",e.IN_HG="inch_mercury",e.CENTI="centi",e.GRAM="gram",e.KNOT="knot",e.METRE="metre",e.LITRE="litre",e.FLUID_OUNCE="fluid_ounce",e.CELSIUS="celsius",e.DECIBEL="decibel",e.FAHRENHEIT="fahrenheit",e.WATT="watt",e.PEAK="peak",e.MICRO="micro",e.PER="per",e.STONE="stone",e.VAR="var",e.OUNCE="ounce",e.HECTARE="hectare",e.YARD="yard",e.JOULE="joule",e.DEGREE="degree",e.KILO="kilo",e.KELVIN="kelvin",e.CARBON="carbon",e.DECIBEL_ATTENUATED="decibel_attenuated",e.SQUARED="squared",e.PERCENTAGE="percentage",e.CUBED="cubed",e.DAY="day",e.RADIAN="radian",e.OHM="ohm",e.MINUTE="minute",e.PART_PER_MILLION="ppm",e.AMP="amp",e.MASS_POUND="pound",e.HOUR="hour",e.ACRE="acre",e.RPM="rpm",e.PASCAL="pascal",e.LUMEN="lumen",e.WEEK="week",e.GALLON="gallon",e.LUX="lux",e.MILLI="milli",e.BAR="bar",e.HECTO="hecto",e.SECOND="second"}(sT||(sT={})),sS||(sS={});class tY{static getAssetDescriptors(){return tY._assetTypeInfos.map(e=>e.assetDescriptor)}static getMetaItemDescriptors(){return[...this._metaItemDescriptors]}static getValueDescriptors(){return[...this._valueDescriptors]}static getAssetTypeInfos(){return[...this._assetTypeInfos]}static getAssetTypeInfo(e){if(e)return e.assetDescriptor?e:("string"!=typeof e&&(e=e.name),this._assetTypeInfos.find(t=>t.assetDescriptor.name===e))}static getAssetDescriptor(e){if(!e)return;if(e.assetDescriptor)return e.assetDescriptor;if("string"!=typeof e)return e;let t=this._assetTypeInfos.find(t=>t.assetDescriptor.name===e);return t?t.assetDescriptor:void 0}static getAttributeDescriptor(e,t){if(!e)return;let n=this.getAssetTypeInfo(t||"ThingAsset");if(n&&n.attributeDescriptors)return n.attributeDescriptors.find(t=>t.name===e)}static getValueDescriptor(e){let t;if(!e)return;if(e.endsWith("[]"))for(t=0;e.endsWith("[]");)e=e.substring(0,e.length-2),t++;let n=this._valueDescriptors.find(t=>t.name===e);return n&&t&&(n=Object.assign(Object.assign({},n),{arrayDimensions:t})),n}static resolveValueDescriptor(e,t){let n;return t&&("string"==typeof t&&(n=tY.getValueDescriptor(t)),n=t.jsonType?t:tY.getValueDescriptor(t.type)),!n&&e&&(n=tY.getValueDescriptor("JSON")),n}static resolveValueTypeFromValue(e){if(null!=e){if("number"==typeof e)return"number";if("string"==typeof e)return"text";if("boolean"==typeof e)return"boolean";if(Array.isArray(e)){let t=1,n=e.find(e=>null!=e);for(;Array.isArray(n);)n=n.find(e=>null!=e),t++;let i=this.resolveValueTypeFromValue(n);if(!i)return;for(;t>0;)i+="[]",t--;return i}if(e instanceof Date)return"dateAndTime"}}static getAttributeAndValueDescriptors(e,t,n){let i,r;if(t&&"string"!=typeof t)i=t;else{let r=this.getAssetTypeInfo(e||"ThingAsset");if(!r)return[void 0,void 0];"string"==typeof t&&(i=this.getAttributeDescriptor(t,r)),!i&&n&&(i={type:n.type,name:n.name,meta:n.meta})}return i&&(r=this.getValueDescriptor(i.type)),[i,r]}static getMetaItemDescriptor(e){if(e)return this._metaItemDescriptors.find(t=>t.name===e)}static getAssetDescriptorColour(e,t){let n=this.getAssetDescriptor(e);return n&&n.colour?n.colour:t}static getAssetDescriptorIcon(e,t){let n=this.getAssetDescriptor(e);return n&&n.icon?n.icon:t}}tY._assetTypeInfos=[],tY._metaItemDescriptors=[],tY._valueDescriptors=[],n(50488);var tH=n(33348),tU=n.n(tH),tV=n(53806),tW=n.n(tV),tG=n(92891);class tq{get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promise}constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t}),Object.freeze(this)}}function tK(e,t,n=!0){if(null==e||null==t)return e===t;if(e.constructor!==t.constructor)return!1;if(e instanceof Function||e instanceof RegExp)return e===t;if(e===t||e.valueOf()===t.valueOf())return!0;if(Array.isArray(e)&&e.length!==t.length||e instanceof Date||!(e instanceof Object)||!(t instanceof Object))return!1;if(n){let n=Object.keys(e);return Object.keys(t).every(e=>-1!==n.indexOf(e))&&n.every(n=>tK(e[n],t[n]))}return!1}function tX(e){if(null==e)return"";let t=!1;return e.split(/([A-Z]|\d)/).map((e,n,i)=>{if(!e)return e;if(!t)return t=!0,e.charAt(0).toUpperCase()+e.slice(1);if("_"===e)return" ";if(1===e.length&&e===e.toUpperCase()){let t=!i[n-1]||"_"===i[n-1],r=n+1<i.length&&i[n+1]&&"_"!==i[n+1],o=n+3>i.length||!i[n+1]&&!i[n+3];(!t||r)&&(e=" "+e),!r&&(t||o)||(e=e.toLowerCase())}return e}).join("").trim()}function tZ(e,t,n){let i="string"==typeof e?e:e.name;return t&&t.meta&&t.meta.hasOwnProperty(i)?t.meta[i]:n&&n.meta?n.meta[i]:void 0}function tJ(e,t){let n="string"==typeof e?tY.getMetaItemDescriptor(e):e;return n?{name:n.name,type:n.type,value:t}:{name:typeof e,type:tY.resolveValueTypeFromValue(t),value:t}}function tQ(e,t,n,i,r,o){let a=t3("label",e,t,n,r),s="";if(a||(a=tZ("label",e,t&&t.meta?t:void 0)),i&&(s=t2(t5("units",e,t,n,r))),!a){let n=e?e.name:t?"string"==typeof t?t:t.name:void 0;a=o||(n?tX(n):void 0)}return a?a+(s?" ("+s+")":""):s}function t0(e,t,n,i,r,o){let a=t1(e?e.value:void 0,()=>t5("format",e,t,n,r),void 0,o),s=t5("units",e,t,n,!0);return i&&s&&s.length&&(a=t2(t5("units",e,t,n,r),a)),a}function t1(e,t,n,i){let r="";if(null==e)r=i||"";else if("string"==typeof e)r=e;else if("number"==typeof e||"boolean"==typeof e||e instanceof Date){let i=t&&t();if(i&&0!==Object.keys(i).length)switch("number"==typeof e?i.asBoolean?e=!!e:i.asDate&&(e=new Date(e)):"boolean"==typeof e&&i.asNumber&&(e=+!!e),typeof e){case"number":r=new Intl.NumberFormat(n||tB.language,i).format(e);break;case"boolean":i.asOnOff&&(r=e?tB.t("on"):tB.t("off")),i.asOpenClosed&&(r=e?tB.t("open"):tB.t("closed")),i.asPressedReleased&&(r=e?tB.t("pressed"):tB.t("released"));break;case"object":if(i.momentJsFormat)r=tW()(e).format(i.momentJsFormat);else if(i.iso8601)r=e.toISOString();else if(i.week){var o;let t,n=((o=new Date(Date.UTC((o=e).getFullYear(),o.getMonth(),o.getDate()))).setUTCDate(o.getUTCDate()+4-(o.getUTCDay()||7)),t=new Date(Date.UTC(o.getUTCFullYear(),0,1)),Math.ceil(((o.getTime()-t.getTime())/864e5+1)/7));r="2-digit"===i.week?String(n).padStart(2,"0"):Number(n).toString(10)}else r=new Intl.DateTimeFormat(n||tB.language,i).format(e)}else r=Object(e).toString()}return r}function t2(e,t){if(!e)return"";t||(t="");let n=e.map((e,n)=>{if(3!==e.length||e.toUpperCase()!==e)return tB.t(["units."+e,"or:units."+e]);{let i=new Intl.NumberFormat(tB.language,{currency:e,style:"currency"}).formatToParts();if(0!==n||"currency"!==i[0].type)return"currency"===i[0].type?i[0].value:i[i.length-1].value;if(!t)return i[0].value;t=i[0].value+t}}).join("");return t.length>0?t+" "+n:n}function t5(e,t,n,i,r){let o,a=[],s=t3(e,t&&"string"==typeof t?t:t?t.name:n?"string"==typeof n?n:n.name:void 0,n,i,r);if(s&&(o=JSON.parse(s)))if("format"!==e)return o;else a.push(o);if(t&&t.meta&&(o=tZ(e,t,n)))if("format"!==e)return o;else a.push(o);if(n&&"string"!=typeof n&&n.hasOwnProperty(e)){if(o=n[e],"format"!==e)return o;a.push(o)}if(n&&n.type){if(o=tY.getValueDescriptor(n.type)[e],"format"!==e)return o;a.push(o)}if("format"!==e||0===a.length)return o;let l={};return a.reverse().forEach(e=>{l=Object.assign(Object.assign({},l),e)}),l}function t3(e,t,n,i,r,o){let a;if(t?a="string"==typeof t?t:t.name:n&&(a="string"==typeof n?n:n.name),!a)return;let s=[],l=e+"."+(r?"attribute":"meta")+".";if(i&&s.push(l+i+"."+a),n&&"string"!=typeof n&&(s.push(l+n.type+"."+a),s.push(l+n.type)),s.push(l+a),s.length>0)return tB.t(s,{defaultValue:o||""})}function t4(e,t){let n=t.ref.name;if(e.attributes)if(t.deleted)delete e.attributes[n];else{let i=e.attributes[n];i&&(i.value=t.value,i.timestamp=t.timestamp)}return Object.assign({},e)}var t6=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})};let t8=n(89916);class t7{constructor(e,t,n){this._autoEnable=!1,this._initialised=!1,this._initialiseInProgress=!1,this._pendingProviderPromises={},this._providerMessageListeners={},this._pendingProviderEnables=[],this._registrationTimer=null,this._realm=e,this._autoEnable=t,this._enableCompleteCallback=n,window.OpenRemoteConsole=this;let i=new URLSearchParams(window.location.search),r=i.get("consoleName"),o=i.get("consoleVersion"),a=i.get("consolePlatform"),s=i.get("consoleProviders"),l=i.get("consoleAutoEnable"),c=s&&s.length>0?s.split(" "):["push"];this._pendingProviderEnables=c;let d=t7._createConsoleRegistration(),u=window.localStorage.getItem("OpenRemoteConsole:"+e);if(u)try{let e=JSON.parse(u);e.id&&(d.id=e.id),e.name&&(d.name=e.name),e.providers&&(d.providers=e.providers),e.apps&&(d.apps=e.apps)}catch(e){console.error("Failed to deserialise console registration")}let h=d.providers;for(let e of(d.providers={},c)){let t=h&&h.hasOwnProperty(e)?h[e]:{enabled:!1,disabled:!1};d.providers[e]=t}let m=iI.getAppName();m.length>0&&0>d.apps.indexOf(m)&&d.apps.push(m),this._registration=d,r&&(d.name=r),o&&(d.version=o),a&&(d.platform=a),l&&(this._autoEnable="TRUE"===l||"true"===l)}get registration(){return this._registration}get autoEnable(){return this._autoEnable}get pendingProviderEnables(){return this._pendingProviderEnables.slice(0)}get shellApple(){let e=navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform:navigator.platform;return e&&("iP"===e.substring(0,2)||"Mac"===e.substring(0,3))&&window.webkit&&window.webkit.messageHandlers}get shellAndroid(){return!!window.MobileInterface}get isMobile(){return this.shellApple||this.shellAndroid}initialise(){return t6(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 e of Object.keys(this._registration.providers))yield this._initialiseProvider(e);this._registration.id||(yield this.sendRegistration(0)),this._initialised=!0,this._initialiseInProgress=!1,0===this._pendingProviderEnables.length?(yield this.sendRegistration(),this._callCompletedCallback()):this._autoEnable&&(yield this.enableProviders())}catch(e){console.error(e)}finally{this._initialiseInProgress=!1}}})}enableProviders(){return t6(this,void 0,void 0,function*(){if(!this._initialised)throw Error("Console must be initialised before enabling providers");for(let e=this._pendingProviderEnables.length-1;e>-1;e--){let t=this._pendingProviderEnables[e];yield this.enableProvider(t)}})}enableProvider(e,t){return t6(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(e))throw console.debug("Invalid console provider '"+e+"'"),Error("Invalid console provider '"+e+"'");console.debug("Console: enabling provider '"+e+"'");let n={provider:e,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:t},i=yield this.sendProviderMessage(n,!0);this._registration.providers[e].hasPermission=i.hasPermission,this._registration.providers[e].success=i.success,this._registration.providers[e].enabled=i.success,this._registration.providers[e].data=i.data;let r=this._pendingProviderEnables.indexOf(e);return r>=0&&(this._pendingProviderEnables.splice(r,1),0===this._pendingProviderEnables.length&&(this.sendRegistration(),this._callCompletedCallback())),i})}disableProvider(e){return t6(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(e))throw console.debug("Invalid console provider '"+e+"'"),Error("Invalid console provider '"+e+"'");console.debug("Console: disabling provider '"+e+"'");let t=yield this.sendProviderMessage({provider:e,action:"PROVIDER_DISABLE"},!0);return this._registration.providers[e].disabled=!0,this._registration.providers[e].enabled=!1,t})}getProvider(e){return this._registration&&this._registration.providers?this._registration.providers[e]:void 0}sendProviderMessage(e,t){return t6(this,void 0,void 0,function*(){if("storage"!==e.provider&&!this._registration.providers.hasOwnProperty(e.provider))throw console.debug("Invalid console provider '"+e.provider+"'"),Error("Invalid console provider '"+e.provider+"'");if(!t)return void this._doSendProviderMessage(e);let n=e.provider+e.action;if(this._pendingProviderPromises[n])throw Error("Message already pending for provider '"+e.provider+"' with action '"+e.action+"'");let i=new tq,r=()=>{delete this._pendingProviderPromises[n],i.reject("No response from provider")};return this._pendingProviderPromises[n]=[i,window.setTimeout(r,5e3)],this._doSendProviderMessage(e),i.promise})}sendRegistration(e){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),console.debug("Sending registration in: "+(e=void 0!==e?e:2e3)+"ms"),new Promise((e,t)=>{this._registrationTimer=window.setTimeout(()=>{this._registrationTimer=null,console.debug("Console: updating registration");try{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={}),iI.rest.api.ConsoleResource.register(this._registration).then(t=>{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("OpenRemoteConsole:"+this._realm,JSON.stringify(this._registration)),e()})}catch(e){console.error("Failed to register console"),t("Failed to register console")}})})}storeData(e,t){this.sendProviderMessage({provider:"storage",action:"STORE",key:e,value:t},!1)}retrieveData(e){return t6(this,void 0,void 0,function*(){let t=this.sendProviderMessage({provider:"storage",action:"RETRIEVE",key:e},!0);try{let e=yield Promise.race([t,new Promise((e,t)=>setTimeout(t,2e3))]);if(e&&e.value){let t=e.value;return"null"===t?void 0:t}}catch(e){console.log("Failed to retrieve data from storage provider")}})}addProviderMessageListener(e,t){this._providerMessageListeners[e.provider+e.action]=t}removeProviderMessageListener(e){delete this._providerMessageListeners[e.provider+e.action]}_postNativeShellMessage(e){try{if(this.shellAndroid)return window.MobileInterface.postMessage(JSON.stringify(e));if(this.shellApple)return window.webkit.messageHandlers.int.postMessage(e)}catch(e){console.error("Failed to send shell message towards console",e)}}_doSendGenericMessage(e,t){let n={type:e,data:t};this.isMobile?this._postNativeShellMessage(n):console.warn("Failed to send generic message to console.",n)}_doSendProviderMessage(e){if(this.isMobile)this._postNativeShellMessage({type:"provider",data:e});else{if(!e.provider||!e.action)return;switch(e.provider.trim().toUpperCase()){case"PUSH":switch(e.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 '"+e.provider+"' and action '"+e.action+"'")}break;case"STORAGE":switch(e.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 t=e.key?e.key.trim():null;if(!t||0===t.length)throw Error("Storage provider 'store' action requires a `key`");null===e.value?window.localStorage.removeItem(t):window.localStorage.setItem(t,JSON.stringify(e.value))}break;case"RETRIEVE":{let t=e.key?e.key.trim():null;if(!t||0===t.length)throw Error("Storage provider 'retrieve' action requires a `key`");let n=window.localStorage.getItem(t);if(null!==n)try{n=JSON.parse(n)}catch(e){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:t,value:n}))}break;default:throw Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;default:console.error("Unsupported provider: "+e.provider)}}}_handleProviderResponse(e){if(!e)return;let t=JSON.parse(e),n=t.provider,i=t.action,r=this._pendingProviderPromises[n+i];r&&(window.clearTimeout(r[1]),delete this._pendingProviderPromises[n+i],r[0].resolve(t));let o=this._providerMessageListeners[n+i];o&&o(t)}_callCompletedCallback(){let e=this._enableCompleteCallback;this._enableCompleteCallback=null,e&&window.setTimeout(()=>{e()},0)}static _createConsoleRegistration(){return{name:t8.name,version:t8.version,platform:t8.os.toString(),apps:[],model:((t8.manufacturer?t8.manufacturer+" ":"")+(t8.product?t8.product:"")).trim()}}_initialiseProvider(e){return t6(this,void 0,void 0,function*(){let t;console.debug("Console: initialising provider '"+e+"'");try{t=yield this.sendProviderMessage({provider:e,action:"PROVIDER_INIT"},!0),this._registration.providers[e].version=t.version,this._registration.providers[e].requiresPermission=t.requiresPermission,this._registration.providers[e].hasPermission=t.hasPermission,this._registration.providers[e].success=t.success,this._registration.providers[e].enabled=t.enabled,this._registration.providers[e].disabled=t.disabled,this._registration.providers[e].data=t.data}catch(e){console.error(e),t={action:"",disabled:!1,enabled:!1,hasPermission:!1,provider:"",requiresPermission:!1,version:"",success:!1}}if(t.success||(console.debug("Provider initialisation failed: '"+e+"'"),t.disabled=!0,this._registration.providers[e].disabled=!0),t.disabled||t.enabled){let t=this._pendingProviderEnables.indexOf(e);t>=0&&this._pendingProviderEnables.splice(t,1)}})}}var t9=n(43653),ne=n.n(t9);class nt{constructor(e){this.httpClient=e}getPredictedDatapoints(e,t,n,i){return this.httpClient.request({method:"POST",url:nw`asset/predicted/${e}/${t}`,data:n,options:i})}writePredictedDatapoints(e,t,n,i){return this.httpClient.request({method:"PUT",url:nw`asset/predicted/${e}/${t}`,data:n,options:i})}}class nn{constructor(e){this.httpClient=e}getApps(e){return this.httpClient.request({method:"GET",url:nw`apps`,options:e})}getConsoleConfig(e){return this.httpClient.request({method:"GET",url:nw`apps/consoleConfig`,options:e})}getAppInfos(e){return this.httpClient.request({method:"GET",url:nw`apps/info`,options:e})}}class ni{constructor(e){this.httpClient=e}startTunnel(e,t){return this.httpClient.request({method:"POST",url:nw`gateway/tunnel`,data:e,options:t})}stopTunnel(e,t){return this.httpClient.request({method:"DELETE",url:nw`gateway/tunnel`,data:e,options:t})}getAllActiveTunnelInfos(e,t){return this.httpClient.request({method:"GET",url:nw`gateway/tunnel/${e}`,options:t})}getGatewayActiveTunnelInfos(e,t,n){return this.httpClient.request({method:"GET",url:nw`gateway/tunnel/${e}/${t}`,options:n})}getActiveTunnelInfo(e,t,n,i,r){return this.httpClient.request({method:"GET",url:nw`gateway/tunnel/${e}/${t}/${n}/${i}`,options:r})}}class nr{constructor(e){this.httpClient=e}getDatapointExport(e,t){return this.httpClient.request({method:"GET",url:nw`asset/datapoint/export`,queryParams:e,options:t})}getDatapointPeriod(e,t){return this.httpClient.request({method:"GET",url:nw`asset/datapoint/periods`,queryParams:e,options:t})}getDatapoints(e,t,n,i){return this.httpClient.request({method:"POST",url:nw`asset/datapoint/${e}/${t}`,data:n,options:i})}}class no{constructor(e){this.httpClient=e}getAssetDescriptors(e,t){return this.httpClient.request({method:"GET",url:nw`model/assetDescriptors`,queryParams:e,options:t})}getAssetInfo(e,t,n){return this.httpClient.request({method:"GET",url:nw`model/assetInfo/${e}`,queryParams:t,options:n})}getAssetInfos(e,t){return this.httpClient.request({method:"GET",url:nw`model/assetInfos`,queryParams:e,options:t})}getMetaItemDescriptors(e,t){return this.httpClient.request({method:"GET",url:nw`model/metaItemDescriptors`,queryParams:e,options:t})}getValueDescriptors(e,t){return this.httpClient.request({method:"GET",url:nw`model/valueDescriptors`,queryParams:e,options:t})}}class na{constructor(e){this.httpClient=e}getManagerConfig(e){return this.httpClient.request({method:"GET",url:nw`configuration/manager`,options:e})}update(e,t){return this.httpClient.request({method:"PUT",url:nw`configuration/manager`,data:e,options:t})}fileUpload(e,t,n){return this.httpClient.request({method:"POST",url:nw`configuration/manager/file`,queryParams:t,data:e,options:n})}getManagerConfigImage(e,t){return this.httpClient.request({method:"GET",url:nw`configuration/manager/image/${e}`,options:t})}}class ns{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:nw`realm`,data:e,options:t})}getAll(e){return this.httpClient.request({method:"GET",url:nw`realm`,options:e})}getAccessible(e){return this.httpClient.request({method:"GET",url:nw`realm/accessible`,options:e})}delete(e,t){return this.httpClient.request({method:"DELETE",url:nw`realm/${e}`,options:t})}get(e,t){return this.httpClient.request({method:"GET",url:nw`realm/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:nw`realm/${e}`,data:t,options:n})}}class nl{constructor(e){this.httpClient=e}getHealthStatus(e){return this.httpClient.request({method:"GET",url:nw`health`,options:e})}getInfo(e){return this.httpClient.request({method:"GET",url:nw`info`,options:e})}}class nc{constructor(e){this.httpClient=e}updateCurrentUserLocale(e,t){return this.httpClient.request({method:"PUT",url:nw`user/locale`,data:e,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:nw`user/query`,data:e,options:t})}requestPasswordResetCurrent(e){return this.httpClient.request({method:"PUT",url:nw`user/request-password-reset`,options:e})}updatePasswordCurrent(e,t){return this.httpClient.request({method:"PUT",url:nw`user/reset-password`,data:e,options:t})}updateCurrent(e,t){return this.httpClient.request({method:"PUT",url:nw`user/update`,data:e,options:t})}getCurrent(e){return this.httpClient.request({method:"GET",url:nw`user/user`,options:e})}getCurrentUserRealmRoles(e){return this.httpClient.request({method:"GET",url:nw`user/userRealmRoles`,options:e})}getCurrentUserClientRoles(e,t){return this.httpClient.request({method:"GET",url:nw`user/userRoles/${e}`,options:t})}disconnectUserSession(e,t,n){return this.httpClient.request({method:"GET",url:nw`user/${e}/disconnect/${t}`,options:n})}requestPasswordReset(e,t,n){return this.httpClient.request({method:"PUT",url:nw`user/${e}/request-password-reset/${t}`,options:n})}updatePassword(e,t,n,i){return this.httpClient.request({method:"PUT",url:nw`user/${e}/reset-password/${t}`,data:n,options:i})}resetSecret(e,t,n){return this.httpClient.request({method:"GET",url:nw`user/${e}/reset-secret/${t}`,options:n})}updateRoles(e,t,n){return this.httpClient.request({method:"PUT",url:nw`user/${e}/roles`,data:t,options:n})}getUserRealmRoles(e,t,n){return this.httpClient.request({method:"GET",url:nw`user/${e}/userRealmRoles/${t}`,options:n})}updateUserRealmRoles(e,t,n,i){return this.httpClient.request({method:"PUT",url:nw`user/${e}/userRealmRoles/${t}`,data:n,options:i})}getUserClientRoles(e,t,n,i){return this.httpClient.request({method:"GET",url:nw`user/${e}/userRoles/${t}/${n}`,options:i})}updateUserClientRoles(e,t,n,i,r){return this.httpClient.request({method:"PUT",url:nw`user/${e}/userRoles/${t}/${n}`,data:i,options:r})}getUserSessions(e,t,n){return this.httpClient.request({method:"GET",url:nw`user/${e}/userSessions/${t}`,options:n})}create(e,t,n){return this.httpClient.request({method:"POST",url:nw`user/${e}/users`,data:t,options:n})}update(e,t,n){return this.httpClient.request({method:"PUT",url:nw`user/${e}/users`,data:t,options:n})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:nw`user/${e}/users/${t}`,options:n})}getClientRoles(e,t,n){return this.httpClient.request({method:"GET",url:nw`user/${e}/${t}/roles`,options:n})}updateClientRoles(e,t,n,i){return this.httpClient.request({method:"PUT",url:nw`user/${e}/${t}/roles`,data:n,options:i})}get(e,t,n){return this.httpClient.request({method:"GET",url:nw`user/${e}/${t}`,options:n})}}class nd{constructor(e){this.httpClient=e}createGlobalRuleset(e,t){return this.httpClient.request({method:"POST",url:nw`rules`,data:e,options:t})}getGlobalRulesets(e,t){return this.httpClient.request({method:"GET",url:nw`rules`,queryParams:e,options:t})}createAssetRuleset(e,t){return this.httpClient.request({method:"POST",url:nw`rules/asset`,data:e,options:t})}getAssetRulesets(e,t,n){return this.httpClient.request({method:"GET",url:nw`rules/asset/for/${e}`,queryParams:t,options:n})}deleteAssetRuleset(e,t){return this.httpClient.request({method:"DELETE",url:nw`rules/asset/${e}`,options:t})}getAssetRuleset(e,t){return this.httpClient.request({method:"GET",url:nw`rules/asset/${e}`,options:t})}updateAssetRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:nw`rules/asset/${e}`,data:t,options:n})}getAssetGeofences(e,t){return this.httpClient.request({method:"GET",url:nw`rules/geofences/${e}`,options:t})}getAssetEngineInfo(e,t){return this.httpClient.request({method:"GET",url:nw`rules/info/asset/${e}`,options:t})}getGlobalEngineInfo(e){return this.httpClient.request({method:"GET",url:nw`rules/info/global`,options:e})}getRealmEngineInfo(e,t){return this.httpClient.request({method:"GET",url:nw`rules/info/realm/${e}`,options:t})}createRealmRuleset(e,t){return this.httpClient.request({method:"POST",url:nw`rules/realm`,data:e,options:t})}getRealmRulesets(e,t,n){return this.httpClient.request({method:"GET",url:nw`rules/realm/for/${e}`,queryParams:t,options:n})}deleteRealmRuleset(e,t){return this.httpClient.request({method:"DELETE",url:nw`rules/realm/${e}`,options:t})}getRealmRuleset(e,t){return this.httpClient.request({method:"GET",url:nw`rules/realm/${e}`,options:t})}updateRealmRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:nw`rules/realm/${e}`,data:t,options:n})}deleteGlobalRuleset(e,t){return this.httpClient.request({method:"DELETE",url:nw`rules/${e}`,options:t})}getGlobalRuleset(e,t){return this.httpClient.request({method:"GET",url:nw`rules/${e}`,options:t})}updateGlobalRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:nw`rules/${e}`,data:t,options:n})}}class nu{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:nw`asset`,data:e,options:t})}delete(e,t){return this.httpClient.request({method:"DELETE",url:nw`asset`,queryParams:e,options:t})}writeAttributeValues(e,t){return this.httpClient.request({method:"PUT",url:nw`asset/attributes`,data:e,options:t})}writeAttributeEvents(e,t){return this.httpClient.request({method:"PUT",url:nw`asset/attributes/timestamp`,data:e,options:t})}updateNoneParent(e,t){return this.httpClient.request({method:"DELETE",url:nw`asset/parent`,queryParams:e,options:t})}getPartial(e,t){return this.httpClient.request({method:"GET",url:nw`asset/partial/${e}`,options:t})}queryAssets(e,t){return this.httpClient.request({method:"POST",url:nw`asset/query`,data:e,options:t})}getCurrentUserAssets(e){return this.httpClient.request({method:"GET",url:nw`asset/user/current`,options:e})}createUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:nw`asset/user/link`,data:e,options:t})}getUserAssetLinks(e,t){return this.httpClient.request({method:"GET",url:nw`asset/user/link`,queryParams:e,options:t})}deleteUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:nw`asset/user/link/delete`,data:e,options:t})}deleteAllUserAssetLinks(e,t,n){return this.httpClient.request({method:"DELETE",url:nw`asset/user/link/${e}/${t}`,options:n})}deleteUserAssetLink(e,t,n,i){return this.httpClient.request({method:"DELETE",url:nw`asset/user/link/${e}/${t}/${n}`,options:i})}get(e,t){return this.httpClient.request({method:"GET",url:nw`asset/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:nw`asset/${e}`,data:t,options:n})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(e,t,n,i){return this.httpClient.request({method:"PUT",url:nw`asset/${e}/attribute/${t}`,data:n,options:i})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(e,t,n,i,r){return this.httpClient.request({method:"PUT",url:nw`asset/${e}/attribute/${t}/${n}`,data:i,options:r})}updateParent(e,t,n){return this.httpClient.request({method:"PUT",url:nw`asset/${e}/child`,queryParams:t,options:n})}}class nh{constructor(e){this.httpClient=e}createProvisioningConfig(e,t){return this.httpClient.request({method:"POST",url:nw`provisioning`,data:e,options:t})}getProvisioningConfigs(e){return this.httpClient.request({method:"GET",url:nw`provisioning`,options:e})}deleteProvisioningConfig(e,t){return this.httpClient.request({method:"DELETE",url:nw`provisioning/${e}`,options:t})}updateProvisioningConfig(e,t,n){return this.httpClient.request({method:"PUT",url:nw`provisioning/${e}`,data:t,options:n})}}class nm{constructor(e){this.httpClient=e}getConfig(e){return this.httpClient.request({method:"GET",url:nw`syslog/config`,options:e})}updateConfig(e,t){return this.httpClient.request({method:"PUT",url:nw`syslog/config`,data:e,options:t})}clearEvents(e){return this.httpClient.request({method:"DELETE",url:nw`syslog/event`,options:e})}getEvents(e,t){return this.httpClient.request({method:"GET",url:nw`syslog/event`,queryParams:e,options:t})}}class nf{constructor(e){this.httpClient=e}createAlarm(e,t,n){return this.httpClient.request({method:"POST",url:nw`alarm`,queryParams:t,data:e,options:n})}getAlarms(e,t){return this.httpClient.request({method:"GET",url:nw`alarm`,queryParams:e,options:t})}removeAlarms(e,t){return this.httpClient.request({method:"DELETE",url:nw`alarm`,data:e,options:t})}setAssetLinks(e,t){return this.httpClient.request({method:"PUT",url:nw`alarm/assets`,data:e,options:t})}getAlarm(e,t){return this.httpClient.request({method:"GET",url:nw`alarm/${e}`,options:t})}removeAlarm(e,t){return this.httpClient.request({method:"DELETE",url:nw`alarm/${e}`,options:t})}updateAlarm(e,t,n){return this.httpClient.request({method:"PUT",url:nw`alarm/${e}`,data:t,options:n})}getAssetLinks(e,t,n){return this.httpClient.request({method:"GET",url:nw`alarm/${e}/assets`,queryParams:t,options:n})}}class np{constructor(e){this.httpClient=e}getSettings(e){return this.httpClient.request({method:"GET",url:nw`map`,options:e})}saveSettings(e,t){return this.httpClient.request({method:"PUT",url:nw`map`,data:e,options:t})}deleteMap(e){return this.httpClient.request({method:"DELETE",url:nw`map/deleteMap`,options:e})}getCustomMapInfo(e){return this.httpClient.request({method:"GET",url:nw`map/getCustomMapInfo`,options:e})}getSettingsJs(e){return this.httpClient.request({method:"GET",url:nw`map/js`,options:e})}getTile(e,t,n,i){return this.httpClient.request({method:"GET",url:nw`map/tile/${e}/${t}/${n}`,options:i})}uploadMap(e,t){return this.httpClient.request({method:"POST",url:nw`map/upload`,queryParams:e,options:t})}}class ng{constructor(e){this.httpClient=e}register(e,t){return this.httpClient.request({method:"POST",url:nw`console/register`,data:e,options:t})}}class nb{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:nw`dashboard`,data:e,options:t})}update(e,t){return this.httpClient.request({method:"PUT",url:nw`dashboard`,data:e,options:t})}getAllRealmDashboards(e,t){return this.httpClient.request({method:"GET",url:nw`dashboard/all/${e}`,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:nw`dashboard/query`,data:e,options:t})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:nw`dashboard/${e}/${t}`,options:n})}get(e,t,n){return this.httpClient.request({method:"GET",url:nw`dashboard/${e}/${t}`,options:n})}}class n_{constructor(e){this.httpClient=e}getAllNodeDefinitions(e){return this.httpClient.request({method:"GET",url:nw`flow`,options:e})}getNodeDefinition(e,t){return this.httpClient.request({method:"GET",url:nw`flow/${e}`,options:t})}getAllNodeDefinitionsByType(e,t){return this.httpClient.request({method:"GET",url:nw`flow/${e}`,options:t})}}class ny{constructor(e){this.httpClient=e}doProtocolAssetDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:nw`agent/assetDiscovery/${e}`,queryParams:t,options:n})}doProtocolAssetImport(e,t,n,i){return this.httpClient.request({method:"POST",url:nw`agent/assetImport/${e}`,queryParams:n,data:t,options:i})}doProtocolInstanceDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:nw`agent/instanceDiscovery/${e}`,queryParams:t,options:n})}}class nv{constructor(e){this.httpClient=e}getNotifications(e,t){return this.httpClient.request({method:"GET",url:nw`notification`,queryParams:e,options:t})}removeNotifications(e,t){return this.httpClient.request({method:"DELETE",url:nw`notification`,queryParams:e,options:t})}sendNotification(e,t){return this.httpClient.request({method:"POST",url:nw`notification/alert`,data:e,options:t})}removeNotification(e,t){return this.httpClient.request({method:"DELETE",url:nw`notification/${e}`,options:t})}notificationAcknowledged(e,t,n,i){return this.httpClient.request({method:"PUT",url:nw`notification/${e}/acknowledged`,queryParams:n,data:t,options:i})}notificationDelivered(e,t,n){return this.httpClient.request({method:"PUT",url:nw`notification/${e}/delivered`,queryParams:t,options:n})}}class nx{constructor(e){this.httpClient=e}deleteConnections(e,t){return this.httpClient.request({method:"DELETE",url:nw`gateway/connection`,queryParams:e,options:t})}getConnections(e){return this.httpClient.request({method:"GET",url:nw`gateway/connection`,options:e})}deleteConnection(e,t){return this.httpClient.request({method:"DELETE",url:nw`gateway/connection/${e}`,options:t})}getConnection(e,t){return this.httpClient.request({method:"GET",url:nw`gateway/connection/${e}`,options:t})}setConnection(e,t,n){return this.httpClient.request({method:"PUT",url:nw`gateway/connection/${e}`,data:t,options:n})}getConnectionStatus(e,t){return this.httpClient.request({method:"GET",url:nw`gateway/status/${e}`,options:t})}}function nw(e,...t){let n="";for(let i=0;i<t.length;i++)n+=e[i],n+=encodeURIComponent(t[i]);return n+e[e.length-1]}class nF{constructor(e,t=ne().create()){this._assetPredictedDatapointResource=new nE(e,t),this._appResource=new nA(e,t),this._gatewayServiceResource=new nC(e,t),this._assetDatapointResource=new nT(e,t),this._assetModelResource=new nS(e,t),this._configurationResource=new nM(e,t),this._realmResource=new nL(e,t),this._statusResource=new nD(e,t),this._userResource=new nI(e,t),this._rulesResource=new nR(e,t),this._assetResource=new nO(e,t),this._provisioningResource=new nP(e,t),this._syslogResource=new n$(e,t),this._alarmResource=new nN(e,t),this._mapResource=new nB(e,t),this._consoleResource=new nz(e,t),this._dashboardResource=new nj(e,t),this._flowResource=new nY(e,t),this._agentResource=new nH(e,t),this._notificationResource=new nU(e,t),this._gatewayClientResource=new nV(e,t),this._assetResource=new nO(e,t)}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get AppResource(){return this._appResource}get GatewayServiceResource(){return this._gatewayServiceResource}get AssetDatapointResource(){return this._assetDatapointResource}get AssetModelResource(){return this._assetModelResource}get ConfigurationResource(){return this._configurationResource}get RealmResource(){return this._realmResource}get StatusResource(){return this._statusResource}get UserResource(){return this._userResource}get RulesResource(){return this._rulesResource}get AssetResource(){return this._assetResource}get ProvisioningResource(){return this._provisioningResource}get SyslogResource(){return this._syslogResource}get AlarmResource(){return this._alarmResource}get MapResource(){return this._mapResource}get ConsoleResource(){return this._consoleResource}get DashboardResource(){return this._dashboardResource}get FlowResource(){return this._flowResource}get AgentResource(){return this._agentResource}get NotificationResource(){return this._notificationResource}get GatewayClientResource(){return this._gatewayClientResource}}class nk{constructor(e){this.axios=e}request(e){let t={};t.method=e.method,t.url=e.url,t.params=e.queryParams,t.data=e.data,function(e,t){if(void 0!=t)for(let n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}(t,e.options);let n=e.copyFn;return this.axios.request(t).then(e=>(n&&e.data&&(e.originalData=e.data,e.data=n(e.data)),e))}}class nE extends nt{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}class nA extends nn{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}class nC extends ni{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}class nT extends nr{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}class nS extends no{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}class nM extends na{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}class nL extends ns{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}class nD extends nl{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}class nI extends nc{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}class nR extends nd{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}class nO extends nu{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}class nP extends nh{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}class n$ extends nm{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}class nN extends nf{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}class nB extends np{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}class nz extends ng{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}class nj extends nb{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}class nY extends n_{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}class nH extends ny{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}class nU extends nv{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}class nV extends nx{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nk(t))}}ne().isAxiosError;let nW=new class{get api(){return this._client}constructor(){this._axiosInstance=ne().create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(e=>(e.paramsSerializer=e=>tU().stringify(e,{arrayFormat:"repeat"}),e))}get axiosInstance(){return this._axiosInstance}get baseUrl(){return this._baseUrl}setTimeout(e){this._axiosInstance.defaults.timeout=e}addRequestInterceptor(e){this._axiosInstance.interceptors.request.use(e)}initialise(e){this._baseUrl=e,this._client=new nF(e,this._axiosInstance)}};var nG=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})};!function(e){e.DISCONNECTED="DISCONNECTED",e.CONNECTED="CONNECTED",e.CONNECTING="CONNECTING"}(sM||(sM={}));let nq="SUBSCRIBED:",nK="UNAUTHORIZED:",nX="TRIGGERED:",nZ="EVENT:";class nJ{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=nQ.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=sM.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(e){this._statusCallbacks.push(e)}unsubscribeStatusChange(e){!function(e,t){if(0===e.length)return;let n=e.indexOf(t);n>=0&&e.splice(n,1)}(this._statusCallbacks,e)}connect(){return(this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._status===sM.CONNECTED)?Promise.resolve(!0):(this._disconnectRequested=!1,this._connectingDeferred||(this._onStatusChanged(sM.CONNECTING),this._connectingDeferred=new tq,this._doConnect().then(e=>{if(this._connectingDeferred){let t=this._connectingDeferred;this._connectingDeferred=null,e?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=nQ.MIN_RECONNECT_DELAY,this._onStatusChanged(sM.CONNECTED),window.setTimeout(()=>{this._onConnect()},0)):(console.debug("Failed to connect to event service: "+this.endpointUrl),this._scheduleReconnect()),t.resolve(e)}})),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!==sM.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){let n={eventSubscription:e,callback:t,deferred:new tq};return null!=this._pendingSubscription||this._status!==sM.CONNECTED?(this._queuedSubscriptions.push(n),n.deferred.promise):(this._pendingSubscription=n,this._doSubscribe(e).then(e=>{if(this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(e,t),this._processNextSubscription();let n=t.deferred;t.deferred=null,n&&n.resolve(e)}},e=>{if(this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();let n=t.deferred;t.deferred=null,n&&n.reject(e)}}),this._pendingSubscription.deferred.promise)}unsubscribe(e){return nG(this,void 0,void 0,function*(){if(this._subscriptionMap.delete(e))return void this._doUnsubscribe(e);if(this._assetEventCallbackMap.delete(e)){if(this._assetEventPromise&&0===this._assetEventCallbackMap.size){let e=yield this._assetEventPromise;this._assetEventPromise=void 0,this.unsubscribe(e)}return}if(this._attributeEventCallbackMap.delete(e)){if(this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){let e=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(e)}return}})}sendEvent(e){this._status===sM.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==sM.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,n){return nG(this,void 0,void 0,function*(){let i=e&&"string"!=typeof e[0]?e.map(e=>e.id):e,r="AssetEvent"+nJ._subscriptionCounter++;if(!this._assetEventPromise){let e;iI.authenticated||(e={filterType:"asset",realm:iI.displayRealm});let t={eventType:"asset",filter:e};this._assetEventPromise=this.subscribe(t,e=>{this._assetEventCallbackMap.forEach(t=>t(e))})}return this._assetEventCallbackMap.set(r,e=>{let t=e.asset.id;i?i.find(e=>t===e)&&n(e):e.asset.realm===iI.displayRealm&&n(e)}),this._assetEventPromise.then(()=>{try{if(i&&t){let e={messageID:"read-assets:"+i.join(",")+":"+r,eventType:"read-assets",assetQuery:{ids:i}};this.sendEventWithReply(e).then(e=>{e.assets&&this._assetEventCallbackMap.has(r)&&e.assets.forEach(e=>{n({eventType:"asset",asset:e,cause:"READ"})})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),r&&this.unsubscribe(r),t}return r})})}subscribeAttributeEvents(e,t,n){return nG(this,void 0,void 0,function*(){let i=e&&"string"!=typeof e[0],r=i?e.map(e=>e.id):e,o=i?e:void 0,a="AttributeEvent"+nJ._subscriptionCounter++;if(!this._attributeEventPromise){let e;iI.authenticated||(e={filterType:"asset",realm:iI.displayRealm});let t={eventType:"attribute",filter:e};this._attributeEventPromise=this.subscribe(t,e=>{this._attributeEventCallbackMap.forEach(t=>t(e))})}let s=t=>{let o=t.ref;i?e.forEach(e=>{o.id===e.id&&o.name===e.name&&n(t)}):r?r.find(e=>o.id===e)&&n(t):t.realm===iI.displayRealm&&n(t)};return this._attributeEventCallbackMap.set(a,s),this._attributeEventPromise.then(()=>{try{if(t&&r){let e={messageID:"read-assets:"+r.join(",")+":"+a,eventType:"read-assets",assetQuery:{ids:r}};this.sendEventWithReply(e).then(e=>{e.assets&&this._attributeEventCallbackMap.has(a)&&e.assets.forEach(e=>{e.attributes&&Object.entries(e.attributes).forEach(([t,n])=>{(!o||o.find(n=>n.id===e.id&&n.name===t))&&s({eventType:"attribute",timestamp:n.timestamp,value:n.value,ref:{id:e.id,name:t}})})})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),a&&this.unsubscribe(a),t}return a})})}_processNextSubscription(){this._status===sM.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{let e=this._queuedSubscriptions.shift();e&&this.subscribe(e.eventSubscription,e.callback).then(t=>{let n=e.deferred;e.deferred=null,n&&n.resolve(t)},t=>{let n=e.deferred;e.deferred=null,n&&n.reject(t)})},0)}_onStatusChanged(e){e!==this._status&&(console.debug("Event provider status changed: "+e),this._status=e,this._unloading||window.setTimeout(()=>{this._statusCallbacks.forEach(t=>t(e))},0))}_onMessageReceived(e,t){let n=this._subscriptionMap.get(e);n&&n.callback(t)}_onConnect(){if(Object.keys(this._subscriptionMap).length>0){for(let e in this._subscriptionMap)this._subscriptionMap.has(e)&&this._queuedSubscriptions.unshift(this._subscriptionMap.get(e));this._subscriptionMap.clear()}this._processNextSubscription()}_onDisconnect(){this._status===sM.CONNECTED&&this._onStatusChanged(sM.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(sM.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<nQ.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(nQ.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}nJ.MIN_RECONNECT_DELAY=0,nJ.MAX_RECONNECT_DELAY=3e4,nJ._subscriptionCounter=0;class nQ extends nJ{get endpointUrl(){return this._endpointUrl}constructor(e){super(),this._webSocket=void 0,this._connectDeferred=null,this._subscribeDeferred=null,this._repliesDeferred=new Map,this._endpointUrl=(e.startsWith("https:")?"wss":"ws")+"://"+e.substr(e.indexOf("://")+3)+"/websocket/events",window.addEventListener("beforeunload",()=>{this._unloading=!0,this.disconnect()})}_doConnect(){let e=this._endpointUrl+"?Realm="+iI.config.realm;return iI.authenticated&&(e+="&Authorization="+iI.getAuthorizationHeader()),this._webSocket=new WebSocket(e),this._connectDeferred=new tq,this._webSocket.onopen=()=>{if(this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!0)}},this._webSocket.onerror=e=>{if(this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else console.debug("Event provider error"),this._beforeDisconnect()},this._webSocket.onclose=()=>{if(this._webSocket=void 0,this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onmessage=e=>{let t=e.data;if(t&&t.startsWith(nq)){let e=JSON.parse(t.substring(nq.length)),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&n.resolve(e.subscriptionId)}else if(t.startsWith(nK)){let e=JSON.parse(t.substring(nK.length)),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&(console.warn("Unauthorized event subscription: "+JSON.stringify(e,null,2)),n.reject("Unauthorized"))}else if(t.startsWith(nX)){let e=JSON.parse(t.substring(nX.length));e.events&&e.events.forEach(t=>{this._onMessageReceived(e.subscriptionId,t)})}else if(t.startsWith(nZ)){let e=JSON.parse(t.substring(nZ.length));if(e.messageID){let t=this._repliesDeferred.get(e.messageID);this._repliesDeferred.delete(e.messageID),t&&t.resolve(e)}}},this._connectDeferred.promise}_beforeDisconnect(){this._onDisconnect()}_doDisconnect(){var e;null==(e=this._webSocket)||e.close(),this._subscribeDeferred=null,this._repliesDeferred.clear()}_doSubscribe(e){return this._webSocket?this._subscribeDeferred?Promise.reject("There's already a pending subscription"):(this._subscribeDeferred=new tq,e.subscriptionId||(e.subscriptionId=nQ._subscriptionCounter+++""),this._webSocket.send("SUBSCRIBE:"+JSON.stringify(e)),this._subscribeDeferred.promise):Promise.reject("Not connected")}_doUnsubscribe(e){this._webSocket&&this._webSocket.send("UNSUBSCRIBE:"+JSON.stringify({subscriptionId:e}))}_doSend(e){let t=nZ+JSON.stringify(e);this._webSocket.send(t)}_doSendWithReply(e){if(e.messageID||(e.messageID=(new Date().getTime()+10*Math.random()).toString(10)),this._repliesDeferred.has(e.messageID))return Promise.reject("There's already a pending send and reply with this ID");let t=new tq;return this._repliesDeferred.set(e.messageID,t),this._webSocket.send(nZ+JSON.stringify(e)),t.promise}}function n0(e){return(n0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}nQ._subscriptionCounter=1;var n1=[],n2=n1.forEach,n5=n1.slice;function n3(e){return n2.call(n5.call(arguments,1),function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])}),e}function n4(){return"function"==typeof XMLHttpRequest||("undefined"==typeof XMLHttpRequest?"undefined":n0(XMLHttpRequest))==="object"}var n6=n(46850),n8=n.t(n6,2);function n7(e){return(n7="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}"function"==typeof fetch&&(sL="undefined"!=typeof global&&global.fetch?global.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),n4()&&("undefined"!=typeof global&&global.XMLHttpRequest?sD=global.XMLHttpRequest:"undefined"!=typeof window&&window.XMLHttpRequest&&(sD=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("undefined"!=typeof global&&global.ActiveXObject?sI=global.ActiveXObject:"undefined"!=typeof window&&window.ActiveXObject&&(sI=window.ActiveXObject)),sL||!n8||sD||sI||(sL=n6||n8),"function"!=typeof sL&&(sL=void 0);var n9=function(e,t){if(t&&"object"===n7(t)){var n="";for(var i in t)n+="&"+encodeURIComponent(i)+"="+encodeURIComponent(t[i]);if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},ie=function(e,t,n){sL(e,t).then(function(e){if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then(function(t){n(null,{status:e.status,data:t})}).catch(n)}).catch(n)},it=!1,ii=function(e,t,n,i){e.queryStringParams&&(t=n9(t,e.queryStringParams));var r=n3({},"function"==typeof e.customHeaders?e.customHeaders():e.customHeaders);n&&(r["Content-Type"]="application/json");var o="function"==typeof e.requestOptions?e.requestOptions(n):e.requestOptions,a=n3({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:r},it?{}:o);try{ie(t,a,i)}catch(e){if(!o||0===Object.keys(o).length||!e.message||0>e.message.indexOf("not implemented"))return i(e);try{Object.keys(o).forEach(function(e){delete a[e]}),ie(t,a,i),it=!0}catch(e){i(e)}}},ir=function(e,t,n,i){n&&"object"===n7(n)&&(n=n9("",n).slice(1)),e.queryStringParams&&(t=n9(t,e.queryStringParams));try{(r=sD?new sD:new sI("MSXML2.XMLHTTP.3.0")).open(n?"POST":"GET",t,1),e.crossDomain||r.setRequestHeader("X-Requested-With","XMLHttpRequest"),r.withCredentials=!!e.withCredentials,n&&r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),r.overrideMimeType&&r.overrideMimeType("application/json");var r,o=e.customHeaders;if(o="function"==typeof o?o():o)for(var a in o)r.setRequestHeader(a,o[a]);r.onreadystatechange=function(){r.readyState>3&&i(r.status>=400?r.statusText:null,{status:r.status,data:r.responseText})},r.send(n)}catch(e){console&&console.log(e)}};let io=function(e,t,n,i){return("function"==typeof n&&(i=n,n=void 0),i=i||function(){},sL)?ii(e,t,n,i):n4()||"function"==typeof ActiveXObject?ir(e,t,n,i):void i(Error("No fetch and no xhr implementation found!"))};var ia=function(){var e;function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(this instanceof t))throw TypeError("Cannot call a class as a function");this.services=e,this.options=n,this.allOptions=i,this.type="backend",this.init(e,n,i)}return e=[{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=n3(n,this.options||{},{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(e){return JSON.parse(e)},stringify:JSON.stringify,parsePayload:function(e,t,n){var i,r;return i={},r=n||"",t in i?Object.defineProperty(i,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):i[t]=r,i},request:io,reloadInterval:"undefined"==typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}),this.allOptions=i,this.services&&this.options.reloadInterval&&setInterval(function(){return t.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(e,t,n){this._readAny(e,e,t,t,n)}},{key:"read",value:function(e,t,n){this._readAny([e],e,[t],t,n)}},{key:"_readAny",value:function(e,t,n,i,r){var o,a,s=this,l=this.options.loadPath;"function"==typeof this.options.loadPath&&(l=this.options.loadPath(e,n)),(l=(a=o=l)&&"function"==typeof a.then?o:Promise.resolve(o)).then(function(o){if(!o)return r(null,{});var a=s.services.interpolator.interpolate(o,{lng:e.join("+"),ns:n.join("+")});s.loadUrl(a,r,t,i)})}},{key:"loadUrl",value:function(e,t,n,i){var r=this;this.options.request(this.options,e,void 0,function(o,a){var s,l;if(a&&(a.status>=500&&a.status<600||!a.status))return t("failed loading "+e+"; status code: "+a.status,!0);if(a&&a.status>=400&&a.status<500)return t("failed loading "+e+"; status code: "+a.status,!1);if(!a&&o&&o.message&&o.message.indexOf("Failed to fetch")>-1)return t("failed loading "+e+": "+o.message,!0);if(o)return t(o,!1);try{s="string"==typeof a.data?r.options.parse(a.data,n,i):a.data}catch(t){l="failed parsing "+e+" to json"}if(l)return t(l,!1);t(null,s)})}},{key:"create",value:function(e,t,n,i,r){var o=this;if(this.options.addPath){"string"==typeof e&&(e=[e]);var a=this.options.parsePayload(t,n,i),s=0,l=[],c=[];e.forEach(function(n){var i=o.options.addPath;"function"==typeof o.options.addPath&&(i=o.options.addPath(n,t));var d=o.services.interpolator.interpolate(i,{lng:n,ns:t});o.options.request(o.options,d,a,function(t,n){s+=1,l.push(t),c.push(n),s===e.length&&r&&r(l,c)})})}}},{key:"reload",value:function(){var e=this,t=this.services,n=t.backendConnector,i=t.languageUtils,r=t.logger,o=n.language;if(!o||"cimode"!==o.toLowerCase()){var a=[],s=function(e){i.toResolveHierarchy(e).forEach(function(e){0>a.indexOf(e)&&a.push(e)})};s(o),this.allOptions.preload&&this.allOptions.preload.forEach(function(e){return s(e)}),a.forEach(function(t){e.allOptions.ns.forEach(function(e){n.read(t,e,"read",null,null,function(i,o){i&&r.warn("loading namespace ".concat(e," for language ").concat(t," failed"),i),!i&&o&&r.log("loaded namespace ".concat(e," for language ").concat(t),o),n.loaded("".concat(t,"|").concat(e),i,o)})})})}}}],function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}();ia.type="backend";class is extends ek{constructor(e){if(super(e),this.it=Z,e.type!==ew.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===Z||null==e)return this._t=void 0,this.it=e;if(e===X)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}is.directiveName="unsafeHTML",is.resultType=1,eF(is);class il extends is{}il.directiveName="unsafeSVG",il.resultType=2;let ic=eF(il),id={size:24,icons:{logo:'<path style=\'pointer-events: var(--or-icon-pointer-events, none);\' fill="#C4D600" d="m11.96125,23.85096c-6.56773,0 -11.90971,-5.34202 -11.90971,-11.90862l2.49411,0c0,5.19176 4.22389,9.41568 9.41561,9.41568c5.19053,0 9.41561,-4.22392 9.41561,-9.41568c0,-5.19176 -4.22389,-9.41568 -9.41561,-9.41568l0,-2.49413c6.56655,0 11.90971,5.34439 11.90971,11.9098c0,6.5666 -5.34316,11.90862 -11.90971,11.90862l0,0z" /><path fill="#4E9D2D" d="m10.25094,20.38647c-2.26848,-0.47231 -4.21822,-1.80199 -5.48741,-3.74009s-1.70892,-4.25777 -1.23545,-6.52625c0.47347,-2.26965 1.80315,-4.21822 3.74242,-5.48857c1.93926,-1.27035 4.25661,-1.70892 6.52625,-1.23545c4.68471,0.97719 7.70121,5.5828 6.72286,10.26635l-2.39994,-0.49907c0.70149,-3.36085 -1.4623,-6.66585 -4.82431,-7.36734c-1.62866,-0.33969 -3.29105,-0.02559 -4.68238,0.88645c-1.39134,0.91088 -2.34526,2.3092 -2.68495,3.93786c-0.33853,1.62633 -0.02443,3.28988 0.88645,4.68122c0.91088,1.39134 2.3092,2.34526 3.93786,2.68379l-0.50139,2.4011l0,0z"/><path fill="#1D5632"d="m12.03064,17.49616c-0.09524,0 -0.19048,-0.00116 -0.28457,-0.00465c-1.49833,-0.0755 -2.87818,-0.72942 -3.88636,-1.84097c-1.00818,-1.11271 -1.52156,-2.54948 -1.44722,-4.05013l2.44378,0.12196c-0.04181,0.84557 0.24856,1.65745 0.81769,2.28466c0.56681,0.62721 1.34733,0.99656 2.1929,1.03838c0.84208,0.03833 1.65629,-0.2474 2.2835,-0.81653c0.62837,-0.56797 0.99656,-1.34617 1.03954,-2.19174c0.08711,-1.74573 -1.26371,-3.23708 -3.00943,-3.3242l0.12196,-2.44378c3.09422,0.15332 5.4869,2.79455 5.33358,5.88877c-0.07434,1.49949 -0.72942,2.87818 -1.84097,3.8852c-1.04186,0.94313 -2.36945,1.45303 -3.7644,1.45303l0,0z"/>',"logo-plain":"m11.9925,23.91349c-6.58498,0 -11.94099,-5.35605 -11.94099,-11.9399l2.50066,0c0,5.20539 4.23498,9.44041 9.44033,9.44041c5.20416,0 9.44033,-4.23502 9.44033,-9.44041c0,-5.20539 -4.23498,-9.44041 -9.44033,-9.44041l0,-2.50068c6.5838,0 11.94099,5.35842 11.94099,11.94108c0,6.58385 -5.35719,11.9399 -11.94099,11.9399l0,0zm-1.80787,-3.27769c-2.31323,-0.48163 -4.30141,-1.83755 -5.59563,-3.81389s-1.74263,-4.34178 -1.25982,-6.65502c0.48281,-2.31443 1.83872,-4.30145 3.81623,-5.59686c1.97751,-1.29542 4.34056,-1.74264 6.65497,-1.25983c4.77711,0.99647 7.8531,5.69295 6.85545,10.46891l-2.44727,-0.50891c0.71532,-3.42716 -1.49114,-6.79738 -4.91946,-7.5127c-1.66078,-0.34639 -3.35596,-0.0261 -4.77474,0.90394c-1.41878,0.92886 -2.39152,2.35476 -2.73791,4.01555c-0.3452,1.65842 -0.02491,3.3548 0.90394,4.77359c0.92885,1.41879 2.35475,2.39154 4.01552,2.73675l-0.51128,2.44848l0,0zm1.81499,-2.92536c-0.09727,0 -0.19455,-0.00119 -0.29064,-0.00475c-1.53029,-0.07711 -2.93958,-0.74498 -3.96926,-1.88025c-1.02968,-1.13646 -1.55401,-2.60388 -1.47809,-4.13655l2.49591,0.12456c-0.04271,0.86361 0.25386,1.69282 0.83513,2.33341c0.5789,0.64059 1.37607,1.01783 2.23968,1.06053c0.86005,0.03915 1.69162,-0.25268 2.33221,-0.83395c0.64177,-0.58009 1.01782,-1.3749 1.06171,-2.23851c0.08897,-1.78298 -1.29066,-3.30616 -3.07362,-3.39513l0.12456,-2.49593c3.16022,0.15659 5.60394,2.85419 5.44735,6.01443c-0.07592,1.53149 -0.74498,2.9396 -1.88024,3.9681c-1.06408,0.96326 -2.41999,1.48403 -3.8447,1.48403l0,0z",marker:'<ellipse fill="#000" opacity="0.2" ry="1.5" rx="4" cy="22.5" cx="12" /><path style=\'pointer-events: var(--or-icon-pointer-events, none);\' d="m11.999999,0a8.437501,8.344057 0 0 1 8.437501,8.344057c0,6.500779 -5.798864,6.280799 -8.437501,14.412461c-2.638637,-8.131662 -8.437501,-7.911683 -8.437501,-14.412461a8.437501,8.344057 0 0 1 8.437501,-8.344057z" />'}};var iu=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let ih=n(7319);class im extends CustomEvent{constructor(){super(im.NAME,{bubbles:!0,composed:!0})}}im.NAME="or-iconset-added";let ip=new class{constructor(){this._icons={}}addIconSet(e,t){this._icons[e]=t,this._defaultIconSet||(this._defaultIconSet=t),t.onAdd&&t.onAdd(),window.dispatchEvent(new im)}getIconSet(e){return this._icons[e]}getIconTemplate(e){if(!e)return K``;let t=(e||"").split(":"),n=t.pop(),i=t.pop(),r=this._defaultIconSet;return(i&&(r=this.getIconSet(i)),n&&r)?r.getIconTemplate(n):K``}},ig=class extends em{constructor(){super(...arguments),this._handler=e=>{this._updateIcon()}}static get styles(){return[u`
|
|
68
|
+
`,tz([eb({type:String})],tj.prototype,"value",void 0),tz([eb({type:Object})],tj.prototype,"options",void 0),tj=tz([ep("or-translate")],tj),function(e){e.CREATE="CREATE",e.UPDATE="UPDATE",e.DELETE="DELETE"}(aI||(aI={})),function(e){e.LOW="LOW",e.MEDIUM="MEDIUM",e.HIGH="HIGH"}(aR||(aR={})),function(e){e.MANUAL="MANUAL",e.CLIENT="CLIENT",e.GLOBAL_RULESET="GLOBAL_RULESET",e.REALM_RULESET="REALM_RULESET",e.ASSET_RULESET="ASSET_RULESET",e.AGENT="AGENT"}(aO||(aO={})),function(e){e.OPEN="OPEN",e.ACKNOWLEDGED="ACKNOWLEDGED",e.IN_PROGRESS="IN_PROGRESS",e.RESOLVED="RESOLVED",e.CLOSED="CLOSED"}(aP||(aP={})),function(e){e.BOTTOM_LEFT="BOTTOM_LEFT",e.BOTTOM_RIGHT="BOTTOM_RIGHT",e.TOP_LEFT="TOP_LEFT",e.TOP_RIGHT="TOP_RIGHT"}(a$||(a$={})),function(e){e.CREATE="CREATE",e.READ="READ",e.UPDATE="UPDATE",e.DELETE="DELETE"}(aN||(aN={})),function(e){e.NONE="NONE",e.FORECAST="FORECAST",e.SETPOINT="SETPOINT"}(aB||(aB={})),function(e){e.DISCONNECTED="DISCONNECTED",e.CONNECTING="CONNECTING",e.DISCONNECTING="DISCONNECTING",e.CONNECTED="CONNECTED",e.DISABLED="DISABLED",e.WAITING="WAITING",e.ERROR="ERROR",e.STOPPED="STOPPED"}(az||(az={})),function(e){e.EV="EV",e.PHEV="PHEV"}(aj||(aj={})),function(e){e.YAZAKI="YAZAKI",e.MENNEKES="MENNEKES",e.LE_GRAND="LE_GRAND",e.CHADEMO="CHADEMO",e.COMBO="COMBO",e.SCHUKO="SCHUKO",e.ENERGYLOCK="ENERGYLOCK"}(aY||(aY={})),function(e){e.SOUTH="SOUTH",e.EAST_WEST="EAST_WEST"}(aH||(aH={})),function(e){e.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"}(aU||(aU={})),function(e){e.TOGGLE="TOGGLE",e.INCREMENT="INCREMENT",e.DECREMENT="DECREMENT",e.NEGATE="NEGATE"}(aV||(aV={})),function(e){e.ASSET_NOT_FOUND="ASSET_NOT_FOUND",e.ATTRIBUTE_NOT_FOUND="ATTRIBUTE_NOT_FOUND",e.INSUFFICIENT_ACCESS="INSUFFICIENT_ACCESS",e.INVALID_VALUE="INVALID_VALUE",e.INTERCEPTOR_FAILURE="INTERCEPTOR_FAILURE",e.STATE_STORAGE_FAILED="STATE_STORAGE_FAILED",e.CANNOT_PROCESS="CANNOT_PROCESS",e.QUEUE_FULL="QUEUE_FULL",e.UNKNOWN="UNKNOWN",e.ASSET_ID_MISSING="ASSET_ID_MISSING",e.ATTRIBUTE_NAME_MISSING="ATTRIBUTE_NAME_MISSING"}(aW||(aW={})),function(e){e.PUBLIC="PUBLIC",e.SHARED="SHARED",e.PRIVATE="PRIVATE"}(aG||(aG={})),function(e){e.OFF="OFF",e.ONE_MIN="ONE_MIN",e.FIVE_MIN="FIVE_MIN",e.QUARTER="QUARTER",e.ONE_HOUR="ONE_HOUR"}(aq||(aq={})),function(e){e.WRAP_TO_SINGLE_COLUMN="WRAP_TO_SINGLE_COLUMN",e.KEEP_LAYOUT="KEEP_LAYOUT",e.REDIRECT="REDIRECT",e.BLOCK_DEVICE="BLOCK_DEVICE"}(aK||(aK={})),function(e){e.MINUTE="MINUTE",e.HOUR="HOUR",e.DAY="DAY",e.WEEK="WEEK",e.MONTH="MONTH",e.YEAR="YEAR"}(aX||(aX={})),function(e){e.MIN="MIN",e.AVG="AVG",e.MAX="MAX",e.DIFFERENCE="DIFFERENCE",e.COUNT="COUNT",e.SUM="SUM",e.MODE="MODE",e.MEDIAN="MEDIAN"}(aZ||(aZ={})),function(e){e.TERMINATING="TERMINATING",e.DISABLED="DISABLED",e.ALREADY_CONNECTED="ALREADY_CONNECTED",e.UNRECOGNISED="UNRECOGNISED",e.PERMANENT_ERROR="PERMANENT_ERROR",e.SYNC_ERROR="SYNC_ERROR"}(aJ||(aJ={})),function(e){e.HTTPS="HTTPS",e.HTTP="HTTP",e.TCP="TCP"}(aQ||(aQ={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.OPTIONS="OPTIONS",e.PATCH="PATCH"}(a0||(a0={})),function(e){e.KEYCLOAK="KEYCLOAK",e.BASIC="BASIC",e.NONE="NONE"}(a1||(a1={})),function(e){e.WEBSOCKET="WEBSOCKET",e.POLLING="POLLING"}(a2||(a2={})),function(e){e.VECTOR="VECTOR",e.RASTER="RASTER"}(a5||(a5={})),function(e){e.INTERNAL="INTERNAL",e.CLIENT="CLIENT",e.GLOBAL_RULESET="GLOBAL_RULESET",e.REALM_RULESET="REALM_RULESET",e.ASSET_RULESET="ASSET_RULESET"}(a3||(a3={})),function(e){e.REALM="REALM",e.USER="USER",e.ASSET="ASSET",e.CUSTOM="CUSTOM"}(a4||(a4={})),function(e){e.NORMAL="NORMAL",e.HIGH="HIGH"}(a6||(a6={})),function(e){e.DEVICE="DEVICE",e.TOPIC="TOPIC",e.CONDITION="CONDITION"}(a8||(a8={})),function(e){e.ALWAYS="ALWAYS",e.ONCE="ONCE",e.HOURLY="HOURLY",e.DAILY="DAILY",e.WEEKLY="WEEKLY",e.MONTHLY="MONTHLY",e.ANNUALLY="ANNUALLY"}(a7||(a7={})),function(e){e.MESSAGE_INVALID="MESSAGE_INVALID",e.CERTIFICATE_INVALID="CERTIFICATE_INVALID",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.UNIQUE_ID_MISMATCH="UNIQUE_ID_MISMATCH",e.CONFIG_DISABLED="CONFIG_DISABLED",e.USER_DISABLED="USER_DISABLED",e.SERVER_ERROR="SERVER_ERROR",e.ASSET_ERROR="ASSET_ERROR",e.SERVER_BUSY="SERVER_BUSY"}(a9||(a9={})),function(e){e.PRIVATE="PRIVATE",e.PROTECTED="PROTECTED",e.PUBLIC="PUBLIC"}(se||(se={})),function(e){e.EXACT="EXACT",e.BEGIN="BEGIN",e.END="END",e.CONTAINS="CONTAINS"}(st||(st={})),function(e){e.EQUALS="EQUALS",e.GREATER_THAN="GREATER_THAN",e.GREATER_EQUALS="GREATER_EQUALS",e.LESS_THAN="LESS_THAN",e.LESS_EQUALS="LESS_EQUALS",e.BETWEEN="BETWEEN"}(sn||(sn={})),function(e){e.CREATED_ON="CREATED_ON",e.NAME="NAME",e.ASSET_TYPE="ASSET_TYPE",e.PARENT_ID="PARENT_ID",e.REALM="REALM"}(si||(si={})),function(e){e.RESTRICTED="RESTRICTED",e.LINKED="LINKED",e.REALM="REALM"}(sr||(sr={})),function(e){e.AT_LEAST_ONE="AT_LEAST_ONE",e.ALL="ALL",e.NONE="NONE"}(so||(so={})),function(e){e.AND="AND",e.OR="OR"}(sa||(sa={})),function(e){e.CREATED_ON="CREATED_ON",e.FIRST_NAME="FIRST_NAME",e.LAST_NAME="LAST_NAME",e.USERNAME="USERNAME",e.EMAIL="EMAIL"}(ss||(ss={})),function(e){e.STOPPED="STOPPED",e.RUNNING="RUNNING",e.ERROR="ERROR"}(sl||(sl={})),function(e){e.JAVASCRIPT="JAVASCRIPT",e.GROOVY="GROOVY",e.JSON="JSON",e.FLOW="FLOW"}(sc||(sc={})),function(e){e.READY="READY",e.DEPLOYED="DEPLOYED",e.COMPILATION_ERROR="COMPILATION_ERROR",e.VALIDITY_PERIOD_ERROR="VALIDITY_PERIOD_ERROR",e.EXECUTION_ERROR="EXECUTION_ERROR",e.LOOP_ERROR="LOOP_ERROR",e.DISABLED="DISABLED",e.PAUSED="PAUSED",e.EXPIRED="EXPIRED",e.REMOVED="REMOVED",e.EMPTY="EMPTY"}(sd||(sd={})),function(e){e.SUNRISE="SUNRISE",e.SUNSET="SUNSET",e.TWILIGHT_MORNING_VISUAL="TWILIGHT_MORNING_VISUAL",e.TWILIGHT_MORNING_VISUAL_LOWER="TWILIGHT_MORNING_VISUAL_LOWER",e.TWILIGHT_MORNING_HORIZON="TWILIGHT_MORNING_HORIZON",e.TWILIGHT_MORNING_CIVIL="TWILIGHT_MORNING_CIVIL",e.TWILIGHT_MORNING_NAUTICAL="TWILIGHT_MORNING_NAUTICAL",e.TWILIGHT_MORNING_ASTRONOMICAL="TWILIGHT_MORNING_ASTRONOMICAL",e.TWILIGHT_MORNING_GOLDEN_HOUR="TWILIGHT_MORNING_GOLDEN_HOUR",e.TWILIGHT_MORNING_BLUE_HOUR="TWILIGHT_MORNING_BLUE_HOUR",e.TWILIGHT_MORNING_NIGHT_HOUR="TWILIGHT_MORNING_NIGHT_HOUR",e.TWILIGHT_EVENING_VISUAL="TWILIGHT_EVENING_VISUAL",e.TWILIGHT_EVENING_VISUAL_LOWER="TWILIGHT_EVENING_VISUAL_LOWER",e.TWILIGHT_EVENING_HORIZON="TWILIGHT_EVENING_HORIZON",e.TWILIGHT_EVENING_CIVIL="TWILIGHT_EVENING_CIVIL",e.TWILIGHT_EVENING_NAUTICAL="TWILIGHT_EVENING_NAUTICAL",e.TWILIGHT_EVENING_ASTRONOMICAL="TWILIGHT_EVENING_ASTRONOMICAL",e.TWILIGHT_EVENING_GOLDEN_HOUR="TWILIGHT_EVENING_GOLDEN_HOUR",e.TWILIGHT_EVENING_BLUE_HOUR="TWILIGHT_EVENING_BLUE_HOUR",e.TWILIGHT_EVENING_NIGHT_HOUR="TWILIGHT_EVENING_NIGHT_HOUR"}(su||(su={})),function(e){e.NUMBER="NUMBER",e.NUMBER_ARRAY="NUMBER_ARRAY",e.STRING="STRING",e.BOOLEAN="BOOLEAN",e.TRIGGER="TRIGGER",e.COLOR="COLOR",e.ANY="ANY"}(sh||(sh={})),function(e){e.NEW_LINE="NEW_LINE",e.SPACER="SPACER"}(sm||(sm={})),function(e){e.INPUT="INPUT",e.PROCESSOR="PROCESSOR",e.OUTPUT="OUTPUT",e.THEN="THEN"}(sf||(sf={})),function(e){e.TEXT="TEXT",e.MULTILINE="MULTILINE",e.NUMBER="NUMBER",e.DROPDOWN="DROPDOWN",e.DOUBLE_DROPDOWN="DOUBLE_DROPDOWN",e.CHECKBOX="CHECKBOX",e.ASSET_ATTRIBUTE="ASSET_ATTRIBUTE",e.COLOR="COLOR",e.DATE="DATE"}(sp||(sp={})),function(e){e.ADD="ADD",e.ADD_OR_REPLACE="ADD_OR_REPLACE",e.REPLACE="REPLACE",e.DELETE="DELETE",e.CLEAR="CLEAR"}(sg||(sg={})),function(e){e.PER_ASSET="PER_ASSET",e.GLOBAL="GLOBAL"}(sb||(sb={})),function(e){e.READ_ADMIN="read:admin",e.READ_LOGS="read:logs",e.READ_USERS="read:users",e.READ_MAP="read:map",e.READ_ASSETS="read:assets",e.READ_RULES="read:rules",e.READ_INSIGHTS="read:insights",e.READ_ALARMS="read:alarms",e.READ_SERVICES="read:services",e.WRITE_SERVICES="write:services",e.WRITE_USER="write:user",e.WRITE_ADMIN="write:admin",e.WRITE_LOGS="write:logs",e.WRITE_ASSETS="write:assets",e.WRITE_ATTRIBUTES="write:attributes",e.WRITE_RULES="write:rules",e.WRITE_INSIGHTS="write:insights",e.WRITE_ALARMS="write:alarms",e.READ="read",e.WRITE="write"}(s_||(s_={})),function(e){e.REGISTER="REGISTER",e.UPDATE="UPDATE",e.DEREGISTER="DEREGISTER"}(sy||(sy={})),function(e){e.AVAILABLE="AVAILABLE",e.UNAVAILABLE="UNAVAILABLE"}(sv||(sv={})),function(e){e.ASSET="ASSET",e.AGENT="AGENT",e.NOTIFICATION="NOTIFICATION",e.ALARM="ALARM",e.RULES="RULES",e.PROTOCOL="PROTOCOL",e.GATEWAY="GATEWAY",e.MODEL_AND_VALUES="MODEL_AND_VALUES",e.API="API",e.DATA="DATA"}(sx||(sx={})),function(e){e.INFO="INFO",e.WARN="WARN",e.ERROR="ERROR"}(sw||(sw={})),function(e){e.NUMERIC="numeric",e.DIGIT_2="2-digit",e.FULL="full",e.LONG="long",e.MEDIUM="medium",e.SHORT="short",e.NARROW="narrow"}(sF||(sF={})),function(e){e.SECONDLY="SECONDLY",e.MINUTELY="MINUTELY",e.HOURLY="HOURLY",e.DAILY="DAILY",e.WEEKLY="WEEKLY",e.MONTHLY="MONTHLY",e.YEARLY="YEARLY"}(sk||(sk={})),function(e){e.OMIT="OMIT",e.BACKWARD="BACKWARD",e.FORWARD="FORWARD"}(sE||(sE={})),function(e){e.JAPANESE="JAPANESE",e.BUDDHIST="BUDDHIST",e.ROC="ROC",e.ISLAMIC="ISLAMIC",e.ISO8601="ISO8601",e.CHINESE="CHINESE",e.ETHIOPIC="ETHIOPIC",e.HEBREW="HEBREW",e.GREGORIAN="GREGORIAN"}(sA||(sA={})),function(e){e.SU="SU",e.MO="MO",e.TU="TU",e.WE="WE",e.TH="TH",e.FR="FR",e.SA="SA"}(sC||(sC={})),function(e){e.PEOPLECOUNTERASSET="PeopleCounterAsset",e.STORAGESIMULATORAGENT="StorageSimulatorAgent",e.CITYASSET="CityAsset",e.ELECTRICITYCONSUMERASSET="ElectricityConsumerAsset",e.ELECTRICVEHICLEASSET="ElectricVehicleAsset",e.CONSOLEASSET="ConsoleAsset",e.PRESENCESENSORASSET="PresenceSensorAsset",e.LIGHTASSET="LightAsset",e.PLUGASSET="PlugAsset",e.ELECTRICITYCHARGERASSET="ElectricityChargerAsset",e.ELECTRICITYBATTERYASSET="ElectricityBatteryAsset",e.ELECTRICITYSUPPLIERASSET="ElectricitySupplierAsset",e.TCPAGENT="TCPAgent",e.SERIALAGENT="SerialAgent",e.BLUETOOTHMESHAGENT="BluetoothMeshAgent",e.SNMPAGENT="SNMPAgent",e.GROUPASSET="GroupAsset",e.BUILDINGASSET="BuildingAsset",e.ELECTRICITYPRODUCERWINDASSET="ElectricityProducerWindAsset",e.ENVIRONMENTSENSORASSET="EnvironmentSensorAsset",e.MQTTAGENT="MQTTAgent",e.MICROPHONEASSET="MicrophoneAsset",e.MODBUSTCPAGENT="ModbusTcpAgent",e.HTTPAGENT="HTTPAgent",e.DOORASSET="DoorAsset",e.ELECTRICITYPRODUCERASSET="ElectricityProducerAsset",e.MAILAGENT="MailAgent",e.UDPAGENT="UDPAgent",e.ROOMASSET="RoomAsset",e.VENTILATIONASSET="VentilationAsset",e.TRADFRILIGHTASSET="TradfriLightAsset",e.KNXAGENT="KNXAgent",e.WEATHERASSET="WeatherAsset",e.THINGASSET="ThingAsset",e.WEBSOCKETAGENT="WebsocketAgent",e.GATEWAYASSET="GatewayAsset",e.PARKINGASSET="ParkingAsset",e.TRADFRIPLUGASSET="TradfriPlugAsset",e.SIMULATORAGENT="SimulatorAgent",e.MODBUSSERIALAGENT="ModbusSerialAgent",e.ELECTRICVEHICLEFLEETGROUPASSET="ElectricVehicleFleetGroupAsset",e.VELBUSTCPAGENT="VelbusTCPAgent",e.ARTNETLIGHTASSET="ArtnetLightAsset",e.VELBUSSERIALAGENT="VelbusSerialAgent",e.GROUNDWATERSENSORASSET="GroundwaterSensorAsset",e.ELECTRICITYPRODUCERSOLARASSET="ElectricityProducerSolarAsset",e.ENERGYOPTIMISATIONASSET="EnergyOptimisationAsset",e.ZWAVEAGENT="ZWaveAgent",e.THERMOSTATASSET="ThermostatAsset",e.SHIPASSET="ShipAsset"}(sT||(sT={})),function(e){e.SUPPORTSEXPORT="supportsExport",e.ENERGYSELFCONSUMPTION="energySelfConsumption",e.LASTACCESS="lastAccess",e.CHARGERID="chargerID",e.POSITION="position",e.CARBONSAVING="carbonSaving",e.ROUTINGMODE="routingMode",e.LASTWILLRETAIN="lastWillRetain",e.LASTWILLTOPIC="lastWillTopic",e.SERIALBAUDRATE="serialBaudrate",e.BASEURL="baseURL",e.REQUIREDVALUES="requiredValues",e.FINANCIALSAVING="financialSaving",e.FLEETCATEGORY="fleetCategory",e.GATEWAYSTATUS="gatewayStatus",e.NO2LEVEL="NO2Level",e.TAGS="tags",e.UNLOCK="unlock",e.MILEAGEMIN="mileageMin",e.CHECKINTERVALSECONDS="checkIntervalSeconds",e.LOCATION="location",e.CLIENTSECRET="clientSecret",e.WINDDIRECTION="windDirection",e.WINDSPEED="windSpeed",e.PARTICLESPM10="particlesPM10",e.APPLICATIONKEY="applicationKey",e.POWEREXPORTMAX="powerExportMax",e.SETWINDACTUALVALUEWITHFORECAST="setWindActualValueWithForecast",e.WATERLEVEL="waterLevel",e.CONSOLENAME="consoleName",e.CONNECTHEADERS="connectHeaders",e.WEBSOCKETQUERY="websocketQuery",e.PREFERHTML="preferHTML",e.COOLING="cooling",e.POLLINGMILLIS="pollingMillis",e.SOILTEMPERATURE="soilTemperature",e.SUNIRRADIANCE="sunIrradiance",e.ODOMETER="odometer",e.SUPPORTSIMPORT="supportsImport",e.MESSAGEMAXLENGTH="messageMaxLength",e.ENERGYLEVELPERCENTAGEMIN="energyLevelPercentageMin",e.LIGHTID="lightId",e.POWER="power",e.STREET="street",e.DELETEPROCESSEDMAIL="deleteProcessedMail",e.WINDSPEEDMIN="windSpeedMin",e.POWERSETPOINT="powerSetpoint",e.PRESENCE="presence",e.SPACESOCCUPIED="spacesOccupied",e.STARTTLS="startTLS",e.AGENTSTATUS="agentStatus",e.MESSAGECHARSET="messageCharset",e.CERTIFICATEALIAS="certificateAlias",e.PANELPITCH="panelPitch",e.EMAIL="email",e.BINDPORT="bindPort",e.PARTICLESPM1="particlesPM1",e.SPEED="speed",e.ENERGYLEVELPERCENTAGEMAX="energyLevelPercentageMax",e.MESSAGESTRIPDELIMITER="messageStripDelimiter",e.AREA="area",e.COUNTRY="country",e.SHIPTYPE="shipType",e.CONNECTSUBSCRIPTIONS="connectSubscriptions",e.RELATIVEHUMIDITY="relativeHumidity",e.INCLUDEFORECASTWINDSERVICE="includeForecastWindService",e.SOURCEADDRESS="sourceAddress",e.RAINFALL="rainfall",e.ENERGYIMPORTTOTAL="energyImportTotal",e.OAUTHGRANT="oAuthGrant",e.OZONELEVEL="ozoneLevel",e.COUNTINMINUTE="countInMinute",e.PORT="port",e.TUNNELINGSUPPORTED="tunnelingSupported",e.ENINUMBER="ENINumber",e.AGENTDISABLED="agentDisabled",e.DISABLED="disabled",e.FORCECHARGE="forceCharge",e.TIMEINJECTIONINTERVAL="timeInjectionInterval",e.FINANCIALWEIGHTING="financialWeighting",e.ENERGYLEVELPERCENTAGE="energyLevelPercentage",e.SPACESBUFFER="spacesBuffer",e.VEHICLECATEGORY="vehicleCategory",e.FANSPEED="fanSpeed",e.FINANCIALCOST="financialCost",e.NOTES="notes",e.MAILFOLDERNAME="mailFolderName",e.TEMPERATURE="temperature",e.AVAILABLECHARGINGSPACES="availableChargingSpaces",e.ENERGYCAPACITY="energyCapacity",e.POWERIMPORTMIN="powerImportMin",e.INTERVALSIZE="intervalSize",e.SNMPVERSIONVALUE="SNMPVersionValue",e.SOUNDLEVEL="soundLevel",e.UNITID="unitId",e.STOPBITS="stopBits",e.CONNECTURL="connectURL",e.CLIENTID="clientId",e.VEHICLEID="vehicleID",e.SUNAZIMUTH="sunAzimuth",e.AVAILABLEDISCHARGINGSPACES="availableDischargingSpaces",e.WEBSOCKETMODE="websocketMode",e.COLOURTEMPERATURE="colourTemperature",e.VEHICLECONNECTED="vehicleConnected",e.DATABITS="dataBits",e.MILEAGEMINIMUM="mileageMinimum",e.COLOURRGB="colourRGB",e.CARBONIMPORT="carbonImport",e.WILDCARDSUBSCRIPTIONTOPICS="wildcardSubscriptionTopics",e.PRICEHOURLY="priceHourly",e.WINDSPEEDMAX="windSpeedMax",e.PINGDISABLED="pingDisabled",e.FLOW="flow",e.CHILDASSETTYPE="childAssetType",e.NETWORKKEY="networkKey",e.UNIVERSE="universe",e.MSSINUMBER="MSSINumber",e.SUBSCRIBEQOS="subscribeQos",e.LEDCOUNT="lEDCount",e.LOCKED="locked",e.PROTOCOL="protocol",e.TARIFFIMPORT="tariffImport",e.ENERGYRENEWABLESHARE="energyRenewableShare",e.REGION="region",e.CONSOLEPLATFORM="consolePlatform",e.POWEREXPORTMIN="powerExportMin",e.EFFICIENCYEXPORT="efficiencyExport",e.CHARGECYCLES="chargeCycles",e.SERIALPORT="serialPort",e.PANELORIENTATION="panelOrientation",e.LENGTH="length",e.USERNAMEPASSWORD="usernamePassword",e.POWERFORECAST="powerForecast",e.SETACTUALSOLARVALUEWITHFORECAST="setActualSolarValueWithForecast",e.REQUESTQUERYPARAMETERS="requestQueryParameters",e.PROXYADDRESS="proxyAddress",e.ENERGYLOCAL="energyLocal",e.ENERGYAUTARKY="energyAutarky",e.MODEL="model",e.MANUFACTURER="manufacturer",e.ONOFF="onOff",e.RESUMESESSION="resumeSession",e.TARIFFEXPORT="tariffExport",e.CITY="city",e.CONNECTORTYPE="connectorType",e.ENERGYEXPORTTOTAL="energyExportTotal",e.CARBONEXPORT="carbonExport",e.REQUESTTIMEOUTMILLIS="requestTimeoutMillis",e.ENERGYLEVEL="energyLevel",e.OPTIMISATIONDISABLED="optimisationDisabled",e.WEBSOCKETPATH="websocketPath",e.WINDSPEEDREFERENCE="windSpeedReference",e.PRICEDAILY="priceDaily",e.COUNTGROWTHMINUTE="countGrowthMinute",e.IMONUMBER="IMONumber",e.INCLUDEFORECASTSOLARSERVICE="includeForecastSolarService",e.REQUESTHEADERS="requestHeaders",e.HOST="host",e.COUNTOUTMINUTE="countOutMinute",e.ENERGYTYPE="energyType",e.CONSOLEVERSION="consoleVersion",e.MTU="mtu",e.PANELAZIMUTH="panelAzimuth",e.SEQUENCENUMBER="sequenceNumber",e.SUNALTITUDE="sunAltitude",e.COUNTOUT="countOut",e.CHARGERCONNECTED="chargerConnected",e.ROOMNUMBER="roomNumber",e.PARTICLESPM2_5="particlesPM2_5",e.MESSAGESOURCEADDRESS="messageSourceAddress",e.COUNTIN="countIn",e.MILEAGECHARGED="mileageCharged",e.TEMPERATURESETPOINT="temperatureSetpoint",e.CONSOLEPROVIDERS="consoleProviders",e.POWERIMPORTMAX="powerImportMax",e.COUNTTOTAL="countTotal",e.SPACESTOTAL="spacesTotal",e.BINDHOST="bindHost",e.MESSAGECONVERTBINARY="messageConvertBinary",e.MESSAGEDELIMITERS="messageDelimiters",e.EFFICIENCYIMPORT="efficiencyImport",e.SUNZENITH="sunZenith",e.BRIGHTNESS="brightness",e.POSTALCODE="postalCode",e.SPACESOPEN="spacesOpen",e.HUMIDITY="humidity",e.SECUREMODE="secureMode",e.MILEAGECAPACITY="mileageCapacity",e.DIRECTION="direction",e.ENERGYLEVELSCHEDULE="energyLevelSchedule",e.UVINDEX="uVIndex",e.NATMODE="NATMode",e.UPDATEONWRITE="updateOnWrite",e.LASTWILLPAYLOAD="lastWillPayload",e.GROUPID="groupId",e.FOLLOWREDIRECTS="followRedirects",e.CARBONCOST="carbonCost",e.MESSAGECONVERTHEX="messageConvertHex",e.PUBLISHQOS="publishQos"}(sS||(sS={})),function(e){e.FORMAT="format",e.RULESTATE="ruleState",e.HASPREDICTEDDATAPOINTS="hasPredictedDataPoints",e.STOREDATAPOINTS="storeDataPoints",e.LABEL="label",e.CONSTRAINTS="constraints",e.SHOWONDASHBOARD="showOnDashboard",e.READONLY="readOnly",e.MULTILINE="multiline",e.ACCESSPUBLICWRITE="accessPublicWrite",e.MOMENTARY="momentary",e.AGENTLINK="agentLink",e.ACCESSRESTRICTEDREAD="accessRestrictedRead",e.DATAPOINTSMAXAGEDAYS="dataPointsMaxAgeDays",e.ACCESSRESTRICTEDWRITE="accessRestrictedWrite",e.SECRET="secret",e.ATTRIBUTELINKS="attributeLinks",e.RULERESETIMMEDIATE="ruleResetImmediate",e.FORECAST="forecast",e.UNITS="units",e.USERCONNECTED="userConnected",e.ACCESSPUBLICREAD="accessPublicRead"}(sM||(sM={})),function(e){e.WSURL="WS_URL",e.POSITIVENUMBER="positiveNumber",e.VALUEDESCRIPTOR="valueDescriptor",e.LONG="long",e.BOOLEANMAP="booleanMap",e.MQTTQOS="MQTTQos",e.GEOJSONPOINT="GEO_JSONPoint",e.SNMPVERSION="SNMPVersion",e.ASSETTYPE="assetType",e.JSONOBJECT="JSONObject",e.BIGNUMBER="bigNumber",e.IPADDRESS="IPAddress",e.EMAIL="email",e.KNXMESSAGESOURCEADDRESS="kNXMessageSourceAddress",e.ATTRIBUTEREFERENCE="attributeReference",e.INTEGER="integer",e.OAUTHGRANT="oAuthGrant",e.NUMBER="number",e.TEXTMAP="textMap",e.WEBSOCKETSUBSCRIPTION="websocketSubscription",e.BOOLEAN="boolean",e.TIMEANDPERIODDURATIONISO8601="timeAndPeriodDurationISO8601",e.TIMESTAMPISO8601="timestampISO8601",e.MULTIVALUEDTEXTMAP="multivaluedTextMap",e.JSON="JSON",e.INTEGERBYTE="integerByte",e.AGENTLINK="agentLink",e.CALENDAREVENT="calendarEvent",e.CONNECTIONSTATUS="connectionStatus",e.VALUECONSTRAINT="valueConstraint",e.ASSETQUERY="assetQuery",e.COLOURRGB="colourRGB",e.VALUEFORMAT="valueFormat",e.TEXT="text",e.BYTE="byte",e.USERNAMEANDPASSWORD="usernameAndPassword",e.HTTPURL="HTTP_URL",e.ATTRIBUTELINK="attributeLink",e.ASSETID="assetID",e.NUMBERMAP="numberMap",e.HTTPMETHOD="HTTPMethod",e.PANELORIENTATION="panelOrientation",e.ATTRIBUTESTATE="attributeState",e.POSITIVEINTEGER="positiveInteger",e.EXECUTIONSTATUS="executionStatus",e.BIGINTEGER="bigInteger",e.PERIODDURATIONISO8601="periodDurationISO8601",e.DATEANDTIME="dateAndTime",e.CONNECTORTYPE="connectorType",e.NEGATIVEINTEGER="negativeInteger",e.TCPIPPORTNUMBER="TCP_IPPortNumber",e.INTEGERMAP="integerMap",e.ENERGYTYPE="energyType",e.TIMESTAMP="timestamp",e.UUID="UUID",e.FORECASTCONFIGURATION="forecastConfiguration",e.TIMEDURATIONISO8601="timeDurationISO8601",e.CONSOLEPROVIDERS="consoleProviders",e.NEGATIVENUMBER="negativeNumber",e.CRONEXPRESSION="CRONExpression",e.DIRECTION="direction",e.HOSTORIPADDRESS="hostOrIPAddress"}(sL||(sL={})),function(e){e.MONTH="month",e.MILE_SCANDINAVIAN="mile_scandinavian",e.YEAR="year",e.VOLT="volt",e.HERTZ="hertz",e.MILE="mile",e.BTU="btu",e.FOOT="foot",e.MEGA="mega",e.INCH="inch",e.IN_HG="inch_mercury",e.CENTI="centi",e.GRAM="gram",e.KNOT="knot",e.METRE="metre",e.LITRE="litre",e.FLUID_OUNCE="fluid_ounce",e.CELSIUS="celsius",e.DECIBEL="decibel",e.FAHRENHEIT="fahrenheit",e.WATT="watt",e.PEAK="peak",e.MICRO="micro",e.PER="per",e.STONE="stone",e.VAR="var",e.OUNCE="ounce",e.HECTARE="hectare",e.YARD="yard",e.JOULE="joule",e.DEGREE="degree",e.KILO="kilo",e.KELVIN="kelvin",e.CARBON="carbon",e.DECIBEL_ATTENUATED="decibel_attenuated",e.SQUARED="squared",e.PERCENTAGE="percentage",e.CUBED="cubed",e.DAY="day",e.RADIAN="radian",e.OHM="ohm",e.MINUTE="minute",e.PART_PER_MILLION="ppm",e.AMP="amp",e.MASS_POUND="pound",e.HOUR="hour",e.ACRE="acre",e.RPM="rpm",e.PASCAL="pascal",e.LUMEN="lumen",e.WEEK="week",e.GALLON="gallon",e.LUX="lux",e.MILLI="milli",e.BAR="bar",e.HECTO="hecto",e.SECOND="second"}(sD||(sD={})),sI||(sI={});class tY{static getAssetDescriptors(){return tY._assetTypeInfos.map(e=>e.assetDescriptor)}static getMetaItemDescriptors(){return[...this._metaItemDescriptors]}static getValueDescriptors(){return[...this._valueDescriptors]}static getAssetTypeInfos(){return[...this._assetTypeInfos]}static getAssetTypeInfo(e){if(e)return e.assetDescriptor?e:("string"!=typeof e&&(e=e.name),this._assetTypeInfos.find(t=>t.assetDescriptor.name===e))}static getAssetDescriptor(e){if(!e)return;if(e.assetDescriptor)return e.assetDescriptor;if("string"!=typeof e)return e;let t=this._assetTypeInfos.find(t=>t.assetDescriptor.name===e);return t?t.assetDescriptor:void 0}static getAttributeDescriptor(e,t){if(!e)return;let n=this.getAssetTypeInfo(t||"ThingAsset");if(n&&n.attributeDescriptors)return n.attributeDescriptors.find(t=>t.name===e)}static getValueDescriptor(e){let t;if(!e)return;if(e.endsWith("[]"))for(t=0;e.endsWith("[]");)e=e.substring(0,e.length-2),t++;let n=this._valueDescriptors.find(t=>t.name===e);return n&&t&&(n=Object.assign(Object.assign({},n),{arrayDimensions:t})),n}static resolveValueDescriptor(e,t){let n;return t&&("string"==typeof t&&(n=tY.getValueDescriptor(t)),n=t.jsonType?t:tY.getValueDescriptor(t.type)),!n&&e&&(n=tY.getValueDescriptor("JSON")),n}static resolveValueTypeFromValue(e){if(null!=e){if("number"==typeof e)return"number";if("string"==typeof e)return"text";if("boolean"==typeof e)return"boolean";if(Array.isArray(e)){let t=1,n=e.find(e=>null!=e);for(;Array.isArray(n);)n=n.find(e=>null!=e),t++;let i=this.resolveValueTypeFromValue(n);if(!i)return;for(;t>0;)i+="[]",t--;return i}if(e instanceof Date)return"dateAndTime"}}static getAttributeAndValueDescriptors(e,t,n){let i,r;if(t&&"string"!=typeof t)i=t;else{let r=this.getAssetTypeInfo(e||"ThingAsset");if(!r)return[void 0,void 0];"string"==typeof t&&(i=this.getAttributeDescriptor(t,r)),!i&&n&&(i={type:n.type,name:n.name,meta:n.meta})}return i&&(r=this.getValueDescriptor(i.type)),[i,r]}static getMetaItemDescriptor(e){if(e)return this._metaItemDescriptors.find(t=>t.name===e)}static getAssetDescriptorColour(e,t){let n=this.getAssetDescriptor(e);return n&&n.colour?n.colour:t}static getAssetDescriptorIcon(e,t){let n=this.getAssetDescriptor(e);return n&&n.icon?n.icon:t}}tY._assetTypeInfos=[],tY._metaItemDescriptors=[],tY._valueDescriptors=[],n(50488);var tH=n(33348),tU=n.n(tH),tV=n(53806),tW=n.n(tV),tG=n(92891);class tq{get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promise}constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t}),Object.freeze(this)}}function tK(e,t,n=!0){if(null==e||null==t)return e===t;if(e.constructor!==t.constructor)return!1;if(e instanceof Function||e instanceof RegExp)return e===t;if(e===t||e.valueOf()===t.valueOf())return!0;if(Array.isArray(e)&&e.length!==t.length||e instanceof Date||!(e instanceof Object)||!(t instanceof Object))return!1;if(n){let n=Object.keys(e);return Object.keys(t).every(e=>-1!==n.indexOf(e))&&n.every(n=>tK(e[n],t[n]))}return!1}function tX(e){if(null==e)return"";let t=!1;return e.split(/([A-Z]|\d)/).map((e,n,i)=>{if(!e)return e;if(!t)return t=!0,e.charAt(0).toUpperCase()+e.slice(1);if("_"===e)return" ";if(1===e.length&&e===e.toUpperCase()){let t=!i[n-1]||"_"===i[n-1],r=n+1<i.length&&i[n+1]&&"_"!==i[n+1],o=n+3>i.length||!i[n+1]&&!i[n+3];(!t||r)&&(e=" "+e),!r&&(t||o)||(e=e.toLowerCase())}return e}).join("").trim()}function tZ(e,t,n){let i="string"==typeof e?e:e.name;return t&&t.meta&&t.meta.hasOwnProperty(i)?t.meta[i]:n&&n.meta?n.meta[i]:void 0}function tJ(e,t){let n="string"==typeof e?tY.getMetaItemDescriptor(e):e;return n?{name:n.name,type:n.type,value:t}:{name:typeof e,type:tY.resolveValueTypeFromValue(t),value:t}}function tQ(e,t,n,i,r,o){let a=t3("label",e,t,n,r),s="";if(a||(a=tZ("label",e,t&&t.meta?t:void 0)),i&&(s=t2(t5("units",e,t,n,r))),!a){let n=e?e.name:t?"string"==typeof t?t:t.name:void 0;a=o||(n?tX(n):void 0)}return a?a+(s?" ("+s+")":""):s}function t0(e,t,n,i,r,o){let a=t1(e?e.value:void 0,()=>t5("format",e,t,n,r),void 0,o),s=t5("units",e,t,n,!0);return i&&s&&s.length&&(a=t2(t5("units",e,t,n,r),a)),a}function t1(e,t,n,i){let r="";if(null==e)r=i||"";else if("string"==typeof e)r=e;else if("number"==typeof e||"boolean"==typeof e||e instanceof Date){let i=t&&t();if(i&&0!==Object.keys(i).length)switch("number"==typeof e?i.asBoolean?e=!!e:i.asDate&&(e=new Date(e)):"boolean"==typeof e&&i.asNumber&&(e=+!!e),typeof e){case"number":r=new Intl.NumberFormat(n||tB.language,i).format(e);break;case"boolean":i.asOnOff&&(r=e?tB.t("on"):tB.t("off")),i.asOpenClosed&&(r=e?tB.t("open"):tB.t("closed")),i.asPressedReleased&&(r=e?tB.t("pressed"):tB.t("released"));break;case"object":if(i.momentJsFormat)r=tW()(e).format(i.momentJsFormat);else if(i.iso8601)r=e.toISOString();else if(i.week){var o;let t,n=((o=new Date(Date.UTC((o=e).getFullYear(),o.getMonth(),o.getDate()))).setUTCDate(o.getUTCDate()+4-(o.getUTCDay()||7)),t=new Date(Date.UTC(o.getUTCFullYear(),0,1)),Math.ceil(((o.getTime()-t.getTime())/864e5+1)/7));r="2-digit"===i.week?String(n).padStart(2,"0"):Number(n).toString(10)}else r=new Intl.DateTimeFormat(n||tB.language,i).format(e)}else r=Object(e).toString()}return r}function t2(e,t){if(!e)return"";t||(t="");let n=e.map((e,n)=>{if(3!==e.length||e.toUpperCase()!==e)return tB.t(["units."+e,"or:units."+e]);{let i=new Intl.NumberFormat(tB.language,{currency:e,style:"currency"}).formatToParts();if(0!==n||"currency"!==i[0].type)return"currency"===i[0].type?i[0].value:i[i.length-1].value;if(!t)return i[0].value;t=i[0].value+t}}).join("");return t.length>0?t+" "+n:n}function t5(e,t,n,i,r){let o,a=[],s=t3(e,t&&"string"==typeof t?t:t?t.name:n?"string"==typeof n?n:n.name:void 0,n,i,r);if(s&&(o=JSON.parse(s)))if("format"!==e)return o;else a.push(o);if(t&&t.meta&&(o=tZ(e,t,n)))if("format"!==e)return o;else a.push(o);if(n&&"string"!=typeof n&&n.hasOwnProperty(e)){if(o=n[e],"format"!==e)return o;a.push(o)}if(n&&n.type){if(o=tY.getValueDescriptor(n.type)[e],"format"!==e)return o;a.push(o)}if("format"!==e||0===a.length)return o;let l={};return a.reverse().forEach(e=>{l=Object.assign(Object.assign({},l),e)}),l}function t3(e,t,n,i,r,o){let a;if(t?a="string"==typeof t?t:t.name:n&&(a="string"==typeof n?n:n.name),!a)return;let s=[],l=e+"."+(r?"attribute":"meta")+".";if(i&&s.push(l+i+"."+a),n&&"string"!=typeof n&&(s.push(l+n.type+"."+a),s.push(l+n.type)),s.push(l+a),s.length>0)return tB.t(s,{defaultValue:o||""})}function t4(e,t){let n=t.ref.name;if(e.attributes)if(t.deleted)delete e.attributes[n];else{let i=e.attributes[n];i&&(i.value=t.value,i.timestamp=t.timestamp)}return Object.assign({},e)}var t6=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})};let t8=n(89916);class t7{constructor(e,t,n){this._autoEnable=!1,this._initialised=!1,this._initialiseInProgress=!1,this._pendingProviderPromises={},this._providerMessageListeners={},this._pendingProviderEnables=[],this._registrationTimer=null,this._realm=e,this._autoEnable=t,this._enableCompleteCallback=n,window.OpenRemoteConsole=this;let i=new URLSearchParams(window.location.search),r=i.get("consoleName"),o=i.get("consoleVersion"),a=i.get("consolePlatform"),s=i.get("consoleProviders"),l=i.get("consoleAutoEnable"),c=s&&s.length>0?s.split(" "):["push"];this._pendingProviderEnables=c;let d=t7._createConsoleRegistration(),u=window.localStorage.getItem("OpenRemoteConsole:"+e);if(u)try{let e=JSON.parse(u);e.id&&(d.id=e.id),e.name&&(d.name=e.name),e.providers&&(d.providers=e.providers),e.apps&&(d.apps=e.apps)}catch(e){console.error("Failed to deserialise console registration")}let h=d.providers;for(let e of(d.providers={},c)){let t=h&&h.hasOwnProperty(e)?h[e]:{enabled:!1,disabled:!1};d.providers[e]=t}let m=iO.getAppName();m.length>0&&0>d.apps.indexOf(m)&&d.apps.push(m),this._registration=d,r&&(d.name=r),o&&(d.version=o),a&&(d.platform=a),l&&(this._autoEnable="TRUE"===l||"true"===l)}get registration(){return this._registration}get autoEnable(){return this._autoEnable}get pendingProviderEnables(){return this._pendingProviderEnables.slice(0)}get shellApple(){let e=navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform:navigator.platform;return e&&("iP"===e.substring(0,2)||"Mac"===e.substring(0,3))&&window.webkit&&window.webkit.messageHandlers}get shellAndroid(){return!!window.MobileInterface}get isMobile(){return this.shellApple||this.shellAndroid}initialise(){return t6(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 e of Object.keys(this._registration.providers))yield this._initialiseProvider(e);this._registration.id||(yield this.sendRegistration(0)),this._initialised=!0,this._initialiseInProgress=!1,0===this._pendingProviderEnables.length?(yield this.sendRegistration(),this._callCompletedCallback()):this._autoEnable&&(yield this.enableProviders())}catch(e){console.error(e)}finally{this._initialiseInProgress=!1}}})}enableProviders(){return t6(this,void 0,void 0,function*(){if(!this._initialised)throw Error("Console must be initialised before enabling providers");for(let e=this._pendingProviderEnables.length-1;e>-1;e--){let t=this._pendingProviderEnables[e];yield this.enableProvider(t)}})}enableProvider(e,t){return t6(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(e))throw console.debug("Invalid console provider '"+e+"'"),Error("Invalid console provider '"+e+"'");console.debug("Console: enabling provider '"+e+"'");let n={provider:e,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:t},i=yield this.sendProviderMessage(n,!0);this._registration.providers[e].hasPermission=i.hasPermission,this._registration.providers[e].success=i.success,this._registration.providers[e].enabled=i.success,this._registration.providers[e].data=i.data;let r=this._pendingProviderEnables.indexOf(e);return r>=0&&(this._pendingProviderEnables.splice(r,1),0===this._pendingProviderEnables.length&&(this.sendRegistration(),this._callCompletedCallback())),i})}disableProvider(e){return t6(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(e))throw console.debug("Invalid console provider '"+e+"'"),Error("Invalid console provider '"+e+"'");console.debug("Console: disabling provider '"+e+"'");let t=yield this.sendProviderMessage({provider:e,action:"PROVIDER_DISABLE"},!0);return this._registration.providers[e].disabled=!0,this._registration.providers[e].enabled=!1,t})}getProvider(e){return this._registration&&this._registration.providers?this._registration.providers[e]:void 0}sendProviderMessage(e,t){return t6(this,void 0,void 0,function*(){if("storage"!==e.provider&&!this._registration.providers.hasOwnProperty(e.provider))throw console.debug("Invalid console provider '"+e.provider+"'"),Error("Invalid console provider '"+e.provider+"'");if(!t)return void this._doSendProviderMessage(e);let n=e.provider+e.action;if(this._pendingProviderPromises[n])throw Error("Message already pending for provider '"+e.provider+"' with action '"+e.action+"'");let i=new tq,r=()=>{delete this._pendingProviderPromises[n],i.reject("No response from provider")};return this._pendingProviderPromises[n]=[i,window.setTimeout(r,5e3)],this._doSendProviderMessage(e),i.promise})}sendRegistration(e){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),console.debug("Sending registration in: "+(e=void 0!==e?e:2e3)+"ms"),new Promise((e,t)=>{this._registrationTimer=window.setTimeout(()=>{this._registrationTimer=null,console.debug("Console: updating registration");try{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={}),iO.rest.api.ConsoleResource.register(this._registration).then(t=>{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("OpenRemoteConsole:"+this._realm,JSON.stringify(this._registration)),e()})}catch(e){console.error("Failed to register console"),t("Failed to register console")}})})}storeData(e,t){this.sendProviderMessage({provider:"storage",action:"STORE",key:e,value:t},!1)}retrieveData(e){return t6(this,void 0,void 0,function*(){let t=this.sendProviderMessage({provider:"storage",action:"RETRIEVE",key:e},!0);try{let e=yield Promise.race([t,new Promise((e,t)=>setTimeout(t,2e3))]);if(e&&e.value){let t=e.value;return"null"===t?void 0:t}}catch(e){console.log("Failed to retrieve data from storage provider")}})}addProviderMessageListener(e,t){this._providerMessageListeners[e.provider+e.action]=t}removeProviderMessageListener(e){delete this._providerMessageListeners[e.provider+e.action]}_postNativeShellMessage(e){try{if(this.shellAndroid)return window.MobileInterface.postMessage(JSON.stringify(e));if(this.shellApple)return window.webkit.messageHandlers.int.postMessage(e)}catch(e){console.error("Failed to send shell message towards console",e)}}_doSendGenericMessage(e,t){let n={type:e,data:t};this.isMobile?this._postNativeShellMessage(n):console.warn("Failed to send generic message to console.",n)}_doSendProviderMessage(e){if(this.isMobile)this._postNativeShellMessage({type:"provider",data:e});else{if(!e.provider||!e.action)return;switch(e.provider.trim().toUpperCase()){case"PUSH":switch(e.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 '"+e.provider+"' and action '"+e.action+"'")}break;case"STORAGE":switch(e.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 t=e.key?e.key.trim():null;if(!t||0===t.length)throw Error("Storage provider 'store' action requires a `key`");null===e.value?window.localStorage.removeItem(t):window.localStorage.setItem(t,JSON.stringify(e.value))}break;case"RETRIEVE":{let t=e.key?e.key.trim():null;if(!t||0===t.length)throw Error("Storage provider 'retrieve' action requires a `key`");let n=window.localStorage.getItem(t);if(null!==n)try{n=JSON.parse(n)}catch(e){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:t,value:n}))}break;default:throw Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;default:console.error("Unsupported provider: "+e.provider)}}}_handleProviderResponse(e){if(!e)return;let t=JSON.parse(e),n=t.provider,i=t.action,r=this._pendingProviderPromises[n+i];r&&(window.clearTimeout(r[1]),delete this._pendingProviderPromises[n+i],r[0].resolve(t));let o=this._providerMessageListeners[n+i];o&&o(t)}_callCompletedCallback(){let e=this._enableCompleteCallback;this._enableCompleteCallback=null,e&&window.setTimeout(()=>{e()},0)}static _createConsoleRegistration(){return{name:t8.name,version:t8.version,platform:t8.os.toString(),apps:[],model:((t8.manufacturer?t8.manufacturer+" ":"")+(t8.product?t8.product:"")).trim()}}_initialiseProvider(e){return t6(this,void 0,void 0,function*(){let t;console.debug("Console: initialising provider '"+e+"'");try{t=yield this.sendProviderMessage({provider:e,action:"PROVIDER_INIT"},!0),this._registration.providers[e].version=t.version,this._registration.providers[e].requiresPermission=t.requiresPermission,this._registration.providers[e].hasPermission=t.hasPermission,this._registration.providers[e].success=t.success,this._registration.providers[e].enabled=t.enabled,this._registration.providers[e].disabled=t.disabled,this._registration.providers[e].data=t.data}catch(e){console.error(e),t={action:"",disabled:!1,enabled:!1,hasPermission:!1,provider:"",requiresPermission:!1,version:"",success:!1}}if(t.success||(console.debug("Provider initialisation failed: '"+e+"'"),t.disabled=!0,this._registration.providers[e].disabled=!0),t.disabled||t.enabled){let t=this._pendingProviderEnables.indexOf(e);t>=0&&this._pendingProviderEnables.splice(t,1)}})}}var t9=n(43653),ne=n.n(t9);class nt{constructor(e){this.httpClient=e}getApps(e){return this.httpClient.request({method:"GET",url:nF`apps`,options:e})}getConsoleConfig(e){return this.httpClient.request({method:"GET",url:nF`apps/consoleConfig`,options:e})}getAppInfos(e){return this.httpClient.request({method:"GET",url:nF`apps/info`,options:e})}}class nn{constructor(e){this.httpClient=e}getSettings(e){return this.httpClient.request({method:"GET",url:nF`map`,options:e})}saveSettings(e,t){return this.httpClient.request({method:"PUT",url:nF`map`,data:e,options:t})}deleteMap(e){return this.httpClient.request({method:"DELETE",url:nF`map/deleteMap`,options:e})}getCustomMapInfo(e){return this.httpClient.request({method:"GET",url:nF`map/getCustomMapInfo`,options:e})}getSettingsJs(e){return this.httpClient.request({method:"GET",url:nF`map/js`,options:e})}getTile(e,t,n,i){return this.httpClient.request({method:"GET",url:nF`map/tile/${e}/${t}/${n}`,options:i})}uploadMap(e,t){return this.httpClient.request({method:"POST",url:nF`map/upload`,queryParams:e,options:t})}}class ni{constructor(e){this.httpClient=e}getConfig(e){return this.httpClient.request({method:"GET",url:nF`syslog/config`,options:e})}updateConfig(e,t){return this.httpClient.request({method:"PUT",url:nF`syslog/config`,data:e,options:t})}clearEvents(e){return this.httpClient.request({method:"DELETE",url:nF`syslog/event`,options:e})}getEvents(e,t){return this.httpClient.request({method:"GET",url:nF`syslog/event`,queryParams:e,options:t})}}class nr{constructor(e){this.httpClient=e}doProtocolAssetDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:nF`agent/assetDiscovery/${e}`,queryParams:t,options:n})}doProtocolAssetImport(e,t,n,i){return this.httpClient.request({method:"POST",url:nF`agent/assetImport/${e}`,queryParams:n,data:t,options:i})}doProtocolInstanceDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:nF`agent/instanceDiscovery/${e}`,queryParams:t,options:n})}}class no{constructor(e){this.httpClient=e}startTunnel(e,t){return this.httpClient.request({method:"POST",url:nF`gateway/tunnel`,data:e,options:t})}stopTunnel(e,t){return this.httpClient.request({method:"DELETE",url:nF`gateway/tunnel`,data:e,options:t})}getAllActiveTunnelInfos(e,t){return this.httpClient.request({method:"GET",url:nF`gateway/tunnel/${e}`,options:t})}getGatewayActiveTunnelInfos(e,t,n){return this.httpClient.request({method:"GET",url:nF`gateway/tunnel/${e}/${t}`,options:n})}getActiveTunnelInfo(e,t,n,i,r){return this.httpClient.request({method:"GET",url:nF`gateway/tunnel/${e}/${t}/${n}/${i}`,options:r})}}class na{constructor(e){this.httpClient=e}getAllNodeDefinitions(e){return this.httpClient.request({method:"GET",url:nF`flow`,options:e})}getNodeDefinition(e,t){return this.httpClient.request({method:"GET",url:nF`flow/${e}`,options:t})}getAllNodeDefinitionsByType(e,t){return this.httpClient.request({method:"GET",url:nF`flow/${e}`,options:t})}}class ns{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:nF`asset`,data:e,options:t})}delete(e,t){return this.httpClient.request({method:"DELETE",url:nF`asset`,queryParams:e,options:t})}writeAttributeValues(e,t){return this.httpClient.request({method:"PUT",url:nF`asset/attributes`,data:e,options:t})}writeAttributeEvents(e,t){return this.httpClient.request({method:"PUT",url:nF`asset/attributes/timestamp`,data:e,options:t})}updateNoneParent(e,t){return this.httpClient.request({method:"DELETE",url:nF`asset/parent`,queryParams:e,options:t})}getPartial(e,t){return this.httpClient.request({method:"GET",url:nF`asset/partial/${e}`,options:t})}queryAssets(e,t){return this.httpClient.request({method:"POST",url:nF`asset/query`,data:e,options:t})}getCurrentUserAssets(e){return this.httpClient.request({method:"GET",url:nF`asset/user/current`,options:e})}createUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:nF`asset/user/link`,data:e,options:t})}getUserAssetLinks(e,t){return this.httpClient.request({method:"GET",url:nF`asset/user/link`,queryParams:e,options:t})}deleteUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:nF`asset/user/link/delete`,data:e,options:t})}deleteAllUserAssetLinks(e,t,n){return this.httpClient.request({method:"DELETE",url:nF`asset/user/link/${e}/${t}`,options:n})}deleteUserAssetLink(e,t,n,i){return this.httpClient.request({method:"DELETE",url:nF`asset/user/link/${e}/${t}/${n}`,options:i})}get(e,t){return this.httpClient.request({method:"GET",url:nF`asset/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:nF`asset/${e}`,data:t,options:n})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(e,t,n,i){return this.httpClient.request({method:"PUT",url:nF`asset/${e}/attribute/${t}`,data:n,options:i})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(e,t,n,i,r){return this.httpClient.request({method:"PUT",url:nF`asset/${e}/attribute/${t}/${n}`,data:i,options:r})}updateParent(e,t,n){return this.httpClient.request({method:"PUT",url:nF`asset/${e}/child`,queryParams:t,options:n})}}class nl{constructor(e){this.httpClient=e}deleteConnections(e,t){return this.httpClient.request({method:"DELETE",url:nF`gateway/connection`,queryParams:e,options:t})}getConnections(e){return this.httpClient.request({method:"GET",url:nF`gateway/connection`,options:e})}deleteConnection(e,t){return this.httpClient.request({method:"DELETE",url:nF`gateway/connection/${e}`,options:t})}getConnection(e,t){return this.httpClient.request({method:"GET",url:nF`gateway/connection/${e}`,options:t})}setConnection(e,t,n){return this.httpClient.request({method:"PUT",url:nF`gateway/connection/${e}`,data:t,options:n})}getConnectionStatus(e,t){return this.httpClient.request({method:"GET",url:nF`gateway/status/${e}`,options:t})}}class nc{constructor(e){this.httpClient=e}getAssetDescriptors(e,t){return this.httpClient.request({method:"GET",url:nF`model/assetDescriptors`,queryParams:e,options:t})}getAssetInfo(e,t,n){return this.httpClient.request({method:"GET",url:nF`model/assetInfo/${e}`,queryParams:t,options:n})}getAssetInfos(e,t){return this.httpClient.request({method:"GET",url:nF`model/assetInfos`,queryParams:e,options:t})}getMetaItemDescriptors(e,t){return this.httpClient.request({method:"GET",url:nF`model/metaItemDescriptors`,queryParams:e,options:t})}getValueDescriptors(e,t){return this.httpClient.request({method:"GET",url:nF`model/valueDescriptors`,queryParams:e,options:t})}}class nd{constructor(e){this.httpClient=e}updateCurrentUserLocale(e,t){return this.httpClient.request({method:"PUT",url:nF`user/locale`,data:e,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:nF`user/query`,data:e,options:t})}requestPasswordResetCurrent(e){return this.httpClient.request({method:"PUT",url:nF`user/request-password-reset`,options:e})}updatePasswordCurrent(e,t){return this.httpClient.request({method:"PUT",url:nF`user/reset-password`,data:e,options:t})}updateCurrent(e,t){return this.httpClient.request({method:"PUT",url:nF`user/update`,data:e,options:t})}getCurrent(e){return this.httpClient.request({method:"GET",url:nF`user/user`,options:e})}getCurrentUserRealmRoles(e){return this.httpClient.request({method:"GET",url:nF`user/userRealmRoles`,options:e})}getCurrentUserClientRoles(e,t){return this.httpClient.request({method:"GET",url:nF`user/userRoles/${e}`,options:t})}disconnectUserSession(e,t,n){return this.httpClient.request({method:"GET",url:nF`user/${e}/disconnect/${t}`,options:n})}requestPasswordReset(e,t,n){return this.httpClient.request({method:"PUT",url:nF`user/${e}/request-password-reset/${t}`,options:n})}updatePassword(e,t,n,i){return this.httpClient.request({method:"PUT",url:nF`user/${e}/reset-password/${t}`,data:n,options:i})}resetSecret(e,t,n){return this.httpClient.request({method:"GET",url:nF`user/${e}/reset-secret/${t}`,options:n})}updateRoles(e,t,n){return this.httpClient.request({method:"PUT",url:nF`user/${e}/roles`,data:t,options:n})}getUserRealmRoles(e,t,n){return this.httpClient.request({method:"GET",url:nF`user/${e}/userRealmRoles/${t}`,options:n})}updateUserRealmRoles(e,t,n,i){return this.httpClient.request({method:"PUT",url:nF`user/${e}/userRealmRoles/${t}`,data:n,options:i})}getUserClientRoles(e,t,n,i){return this.httpClient.request({method:"GET",url:nF`user/${e}/userRoles/${t}/${n}`,options:i})}updateUserClientRoles(e,t,n,i,r){return this.httpClient.request({method:"PUT",url:nF`user/${e}/userRoles/${t}/${n}`,data:i,options:r})}getUserSessions(e,t,n){return this.httpClient.request({method:"GET",url:nF`user/${e}/userSessions/${t}`,options:n})}create(e,t,n){return this.httpClient.request({method:"POST",url:nF`user/${e}/users`,data:t,options:n})}update(e,t,n){return this.httpClient.request({method:"PUT",url:nF`user/${e}/users`,data:t,options:n})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:nF`user/${e}/users/${t}`,options:n})}getClientRoles(e,t,n){return this.httpClient.request({method:"GET",url:nF`user/${e}/${t}/roles`,options:n})}updateClientRoles(e,t,n,i){return this.httpClient.request({method:"PUT",url:nF`user/${e}/${t}/roles`,data:n,options:i})}get(e,t,n){return this.httpClient.request({method:"GET",url:nF`user/${e}/${t}`,options:n})}}class nu{constructor(e){this.httpClient=e}createProvisioningConfig(e,t){return this.httpClient.request({method:"POST",url:nF`provisioning`,data:e,options:t})}getProvisioningConfigs(e){return this.httpClient.request({method:"GET",url:nF`provisioning`,options:e})}deleteProvisioningConfig(e,t){return this.httpClient.request({method:"DELETE",url:nF`provisioning/${e}`,options:t})}updateProvisioningConfig(e,t,n){return this.httpClient.request({method:"PUT",url:nF`provisioning/${e}`,data:t,options:n})}}class nh{constructor(e){this.httpClient=e}getNotifications(e,t){return this.httpClient.request({method:"GET",url:nF`notification`,queryParams:e,options:t})}removeNotifications(e,t){return this.httpClient.request({method:"DELETE",url:nF`notification`,queryParams:e,options:t})}sendNotification(e,t){return this.httpClient.request({method:"POST",url:nF`notification/alert`,data:e,options:t})}removeNotification(e,t){return this.httpClient.request({method:"DELETE",url:nF`notification/${e}`,options:t})}notificationAcknowledged(e,t,n,i){return this.httpClient.request({method:"PUT",url:nF`notification/${e}/acknowledged`,queryParams:n,data:t,options:i})}notificationDelivered(e,t,n){return this.httpClient.request({method:"PUT",url:nF`notification/${e}/delivered`,queryParams:t,options:n})}}class nm{constructor(e){this.httpClient=e}getDatapointExport(e,t){return this.httpClient.request({method:"GET",url:nF`asset/datapoint/export`,queryParams:e,options:t})}getDatapointPeriod(e,t){return this.httpClient.request({method:"GET",url:nF`asset/datapoint/periods`,queryParams:e,options:t})}getDatapoints(e,t,n,i){return this.httpClient.request({method:"POST",url:nF`asset/datapoint/${e}/${t}`,data:n,options:i})}}class nf{constructor(e){this.httpClient=e}getHealthStatus(e){return this.httpClient.request({method:"GET",url:nF`health`,options:e})}getInfo(e){return this.httpClient.request({method:"GET",url:nF`info`,options:e})}}class np{constructor(e){this.httpClient=e}getPredictedDatapoints(e,t,n,i){return this.httpClient.request({method:"POST",url:nF`asset/predicted/${e}/${t}`,data:n,options:i})}writePredictedDatapoints(e,t,n,i){return this.httpClient.request({method:"PUT",url:nF`asset/predicted/${e}/${t}`,data:n,options:i})}}class ng{constructor(e){this.httpClient=e}getManagerConfig(e){return this.httpClient.request({method:"GET",url:nF`configuration/manager`,options:e})}update(e,t){return this.httpClient.request({method:"PUT",url:nF`configuration/manager`,data:e,options:t})}fileUpload(e,t,n){return this.httpClient.request({method:"POST",url:nF`configuration/manager/file`,queryParams:t,data:e,options:n})}getManagerConfigImage(e,t){return this.httpClient.request({method:"GET",url:nF`configuration/manager/image/${e}`,options:t})}}class nb{constructor(e){this.httpClient=e}createGlobalRuleset(e,t){return this.httpClient.request({method:"POST",url:nF`rules`,data:e,options:t})}getGlobalRulesets(e,t){return this.httpClient.request({method:"GET",url:nF`rules`,queryParams:e,options:t})}createAssetRuleset(e,t){return this.httpClient.request({method:"POST",url:nF`rules/asset`,data:e,options:t})}getAssetRulesets(e,t,n){return this.httpClient.request({method:"GET",url:nF`rules/asset/for/${e}`,queryParams:t,options:n})}deleteAssetRuleset(e,t){return this.httpClient.request({method:"DELETE",url:nF`rules/asset/${e}`,options:t})}getAssetRuleset(e,t){return this.httpClient.request({method:"GET",url:nF`rules/asset/${e}`,options:t})}updateAssetRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:nF`rules/asset/${e}`,data:t,options:n})}getAssetGeofences(e,t){return this.httpClient.request({method:"GET",url:nF`rules/geofences/${e}`,options:t})}getAssetEngineInfo(e,t){return this.httpClient.request({method:"GET",url:nF`rules/info/asset/${e}`,options:t})}getGlobalEngineInfo(e){return this.httpClient.request({method:"GET",url:nF`rules/info/global`,options:e})}getRealmEngineInfo(e,t){return this.httpClient.request({method:"GET",url:nF`rules/info/realm/${e}`,options:t})}createRealmRuleset(e,t){return this.httpClient.request({method:"POST",url:nF`rules/realm`,data:e,options:t})}getRealmRulesets(e,t,n){return this.httpClient.request({method:"GET",url:nF`rules/realm/for/${e}`,queryParams:t,options:n})}deleteRealmRuleset(e,t){return this.httpClient.request({method:"DELETE",url:nF`rules/realm/${e}`,options:t})}getRealmRuleset(e,t){return this.httpClient.request({method:"GET",url:nF`rules/realm/${e}`,options:t})}updateRealmRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:nF`rules/realm/${e}`,data:t,options:n})}deleteGlobalRuleset(e,t){return this.httpClient.request({method:"DELETE",url:nF`rules/${e}`,options:t})}getGlobalRuleset(e,t){return this.httpClient.request({method:"GET",url:nF`rules/${e}`,options:t})}updateGlobalRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:nF`rules/${e}`,data:t,options:n})}}class n_{constructor(e){this.httpClient=e}register(e,t){return this.httpClient.request({method:"POST",url:nF`console/register`,data:e,options:t})}}class ny{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:nF`realm`,data:e,options:t})}getAll(e){return this.httpClient.request({method:"GET",url:nF`realm`,options:e})}getAccessible(e){return this.httpClient.request({method:"GET",url:nF`realm/accessible`,options:e})}delete(e,t){return this.httpClient.request({method:"DELETE",url:nF`realm/${e}`,options:t})}get(e,t){return this.httpClient.request({method:"GET",url:nF`realm/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:nF`realm/${e}`,data:t,options:n})}}class nv{constructor(e){this.httpClient=e}createAlarm(e,t,n){return this.httpClient.request({method:"POST",url:nF`alarm`,queryParams:t,data:e,options:n})}getAlarms(e,t){return this.httpClient.request({method:"GET",url:nF`alarm`,queryParams:e,options:t})}removeAlarms(e,t){return this.httpClient.request({method:"DELETE",url:nF`alarm`,data:e,options:t})}setAssetLinks(e,t){return this.httpClient.request({method:"PUT",url:nF`alarm/assets`,data:e,options:t})}getAlarm(e,t){return this.httpClient.request({method:"GET",url:nF`alarm/${e}`,options:t})}removeAlarm(e,t){return this.httpClient.request({method:"DELETE",url:nF`alarm/${e}`,options:t})}updateAlarm(e,t,n){return this.httpClient.request({method:"PUT",url:nF`alarm/${e}`,data:t,options:n})}getAssetLinks(e,t,n){return this.httpClient.request({method:"GET",url:nF`alarm/${e}/assets`,queryParams:t,options:n})}}class nx{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:nF`dashboard`,data:e,options:t})}update(e,t){return this.httpClient.request({method:"PUT",url:nF`dashboard`,data:e,options:t})}getAllRealmDashboards(e,t){return this.httpClient.request({method:"GET",url:nF`dashboard/all/${e}`,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:nF`dashboard/query`,data:e,options:t})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:nF`dashboard/${e}/${t}`,options:n})}get(e,t,n){return this.httpClient.request({method:"GET",url:nF`dashboard/${e}/${t}`,options:n})}}class nw{constructor(e){this.httpClient=e}getServices(e,t){return this.httpClient.request({method:"GET",url:nF`service`,queryParams:e,options:t})}registerService(e,t){return this.httpClient.request({method:"POST",url:nF`service`,data:e,options:t})}getGlobalServices(e){return this.httpClient.request({method:"GET",url:nF`service/global`,options:e})}registerGlobalService(e,t){return this.httpClient.request({method:"POST",url:nF`service/global`,data:e,options:t})}deregisterService(e,t,n){return this.httpClient.request({method:"DELETE",url:nF`service/${e}/${t}`,options:n})}getService(e,t,n){return this.httpClient.request({method:"GET",url:nF`service/${e}/${t}`,options:n})}heartbeat(e,t,n){return this.httpClient.request({method:"PUT",url:nF`service/${e}/${t}`,options:n})}}function nF(e,...t){let n="";for(let i=0;i<t.length;i++)n+=e[i],n+=encodeURIComponent(t[i]);return n+e[e.length-1]}class nk{constructor(e,t=ne().create()){this._appResource=new nA(e,t),this._mapResource=new nC(e,t),this._syslogResource=new nT(e,t),this._agentResource=new nS(e,t),this._gatewayServiceResource=new nM(e,t),this._flowResource=new nL(e,t),this._assetResource=new nD(e,t),this._gatewayClientResource=new nI(e,t),this._assetModelResource=new nR(e,t),this._userResource=new nO(e,t),this._provisioningResource=new nP(e,t),this._notificationResource=new n$(e,t),this._assetDatapointResource=new nN(e,t),this._statusResource=new nB(e,t),this._assetPredictedDatapointResource=new nz(e,t),this._configurationResource=new nj(e,t),this._rulesResource=new nY(e,t),this._consoleResource=new nH(e,t),this._realmResource=new nU(e,t),this._alarmResource=new nV(e,t),this._dashboardResource=new nW(e,t),this._externalServiceResource=new nG(e,t),this._assetResource=new nD(e,t)}get AppResource(){return this._appResource}get MapResource(){return this._mapResource}get SyslogResource(){return this._syslogResource}get AgentResource(){return this._agentResource}get GatewayServiceResource(){return this._gatewayServiceResource}get FlowResource(){return this._flowResource}get AssetResource(){return this._assetResource}get GatewayClientResource(){return this._gatewayClientResource}get AssetModelResource(){return this._assetModelResource}get UserResource(){return this._userResource}get ProvisioningResource(){return this._provisioningResource}get NotificationResource(){return this._notificationResource}get AssetDatapointResource(){return this._assetDatapointResource}get StatusResource(){return this._statusResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get ConfigurationResource(){return this._configurationResource}get RulesResource(){return this._rulesResource}get ConsoleResource(){return this._consoleResource}get RealmResource(){return this._realmResource}get AlarmResource(){return this._alarmResource}get DashboardResource(){return this._dashboardResource}get ExternalServiceResource(){return this._externalServiceResource}}class nE{constructor(e){this.axios=e}request(e){let t={};t.method=e.method,t.url=e.url,t.params=e.queryParams,t.data=e.data,function(e,t){if(void 0!=t)for(let n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}(t,e.options);let n=e.copyFn;return this.axios.request(t).then(e=>(n&&e.data&&(e.originalData=e.data,e.data=n(e.data)),e))}}class nA extends nt{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class nC extends nn{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class nT extends ni{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class nS extends nr{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class nM extends no{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class nL extends na{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class nD extends ns{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class nI extends nl{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class nR extends nc{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class nO extends nd{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class nP extends nu{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class n$ extends nh{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class nN extends nm{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class nB extends nf{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class nz extends np{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class nj extends ng{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class nY extends nb{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class nH extends n_{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class nU extends ny{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class nV extends nv{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class nW extends nx{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}class nG extends nw{constructor(e,t=ne().create()){t.defaults.baseURL=e,super(new nE(t))}}ne().isAxiosError;let nq=new class{get api(){return this._client}constructor(){this._axiosInstance=ne().create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(e=>(e.paramsSerializer=e=>tU().stringify(e,{arrayFormat:"repeat"}),e))}get axiosInstance(){return this._axiosInstance}get baseUrl(){return this._baseUrl}setTimeout(e){this._axiosInstance.defaults.timeout=e}addRequestInterceptor(e){this._axiosInstance.interceptors.request.use(e)}initialise(e){this._baseUrl=e,this._client=new nk(e,this._axiosInstance)}};var nK=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})};!function(e){e.DISCONNECTED="DISCONNECTED",e.CONNECTED="CONNECTED",e.CONNECTING="CONNECTING"}(sR||(sR={}));let nX="SUBSCRIBED:",nZ="UNAUTHORIZED:",nJ="TRIGGERED:",nQ="EVENT:";class n0{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=n1.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=sR.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(e){this._statusCallbacks.push(e)}unsubscribeStatusChange(e){!function(e,t){if(0===e.length)return;let n=e.indexOf(t);n>=0&&e.splice(n,1)}(this._statusCallbacks,e)}connect(){return(this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._status===sR.CONNECTED)?Promise.resolve(!0):(this._disconnectRequested=!1,this._connectingDeferred||(this._onStatusChanged(sR.CONNECTING),this._connectingDeferred=new tq,this._doConnect().then(e=>{if(this._connectingDeferred){let t=this._connectingDeferred;this._connectingDeferred=null,e?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=n1.MIN_RECONNECT_DELAY,this._onStatusChanged(sR.CONNECTED),window.setTimeout(()=>{this._onConnect()},0)):(console.debug("Failed to connect to event service: "+this.endpointUrl),this._scheduleReconnect()),t.resolve(e)}})),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!==sR.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){let n={eventSubscription:e,callback:t,deferred:new tq};return null!=this._pendingSubscription||this._status!==sR.CONNECTED?(this._queuedSubscriptions.push(n),n.deferred.promise):(this._pendingSubscription=n,this._doSubscribe(e).then(e=>{if(this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(e,t),this._processNextSubscription();let n=t.deferred;t.deferred=null,n&&n.resolve(e)}},e=>{if(this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();let n=t.deferred;t.deferred=null,n&&n.reject(e)}}),this._pendingSubscription.deferred.promise)}unsubscribe(e){return nK(this,void 0,void 0,function*(){if(this._subscriptionMap.delete(e))return void this._doUnsubscribe(e);if(this._assetEventCallbackMap.delete(e)){if(this._assetEventPromise&&0===this._assetEventCallbackMap.size){let e=yield this._assetEventPromise;this._assetEventPromise=void 0,this.unsubscribe(e)}return}if(this._attributeEventCallbackMap.delete(e)){if(this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){let e=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(e)}return}})}sendEvent(e){this._status===sR.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==sR.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,n){return nK(this,void 0,void 0,function*(){let i=e&&"string"!=typeof e[0]?e.map(e=>e.id):e,r="AssetEvent"+n0._subscriptionCounter++;if(!this._assetEventPromise){let e;iO.authenticated||(e={filterType:"asset",realm:iO.displayRealm});let t={eventType:"asset",filter:e};this._assetEventPromise=this.subscribe(t,e=>{this._assetEventCallbackMap.forEach(t=>t(e))})}return this._assetEventCallbackMap.set(r,e=>{let t=e.asset.id;i?i.find(e=>t===e)&&n(e):e.asset.realm===iO.displayRealm&&n(e)}),this._assetEventPromise.then(()=>{try{if(i&&t){let e={messageID:"read-assets:"+i.join(",")+":"+r,eventType:"read-assets",assetQuery:{ids:i}};this.sendEventWithReply(e).then(e=>{e.assets&&this._assetEventCallbackMap.has(r)&&e.assets.forEach(e=>{n({eventType:"asset",asset:e,cause:"READ"})})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),r&&this.unsubscribe(r),t}return r})})}subscribeAttributeEvents(e,t,n){return nK(this,void 0,void 0,function*(){let i=e&&"string"!=typeof e[0],r=i?e.map(e=>e.id):e,o=i?e:void 0,a="AttributeEvent"+n0._subscriptionCounter++;if(!this._attributeEventPromise){let e;iO.authenticated||(e={filterType:"asset",realm:iO.displayRealm});let t={eventType:"attribute",filter:e};this._attributeEventPromise=this.subscribe(t,e=>{this._attributeEventCallbackMap.forEach(t=>t(e))})}let s=t=>{let o=t.ref;i?e.forEach(e=>{o.id===e.id&&o.name===e.name&&n(t)}):r?r.find(e=>o.id===e)&&n(t):t.realm===iO.displayRealm&&n(t)};return this._attributeEventCallbackMap.set(a,s),this._attributeEventPromise.then(()=>{try{if(t&&r){let e={messageID:"read-assets:"+r.join(",")+":"+a,eventType:"read-assets",assetQuery:{ids:r}};this.sendEventWithReply(e).then(e=>{e.assets&&this._attributeEventCallbackMap.has(a)&&e.assets.forEach(e=>{e.attributes&&Object.entries(e.attributes).forEach(([t,n])=>{(!o||o.find(n=>n.id===e.id&&n.name===t))&&s({eventType:"attribute",timestamp:n.timestamp,value:n.value,ref:{id:e.id,name:t}})})})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),a&&this.unsubscribe(a),t}return a})})}_processNextSubscription(){this._status===sR.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{let e=this._queuedSubscriptions.shift();e&&this.subscribe(e.eventSubscription,e.callback).then(t=>{let n=e.deferred;e.deferred=null,n&&n.resolve(t)},t=>{let n=e.deferred;e.deferred=null,n&&n.reject(t)})},0)}_onStatusChanged(e){e!==this._status&&(console.debug("Event provider status changed: "+e),this._status=e,this._unloading||window.setTimeout(()=>{this._statusCallbacks.forEach(t=>t(e))},0))}_onMessageReceived(e,t){let n=this._subscriptionMap.get(e);n&&n.callback(t)}_onConnect(){if(Object.keys(this._subscriptionMap).length>0){for(let e in this._subscriptionMap)this._subscriptionMap.has(e)&&this._queuedSubscriptions.unshift(this._subscriptionMap.get(e));this._subscriptionMap.clear()}this._processNextSubscription()}_onDisconnect(){this._status===sR.CONNECTED&&this._onStatusChanged(sR.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(sR.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<n1.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(n1.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}n0.MIN_RECONNECT_DELAY=0,n0.MAX_RECONNECT_DELAY=3e4,n0._subscriptionCounter=0;class n1 extends n0{get endpointUrl(){return this._endpointUrl}constructor(e){super(),this._webSocket=void 0,this._connectDeferred=null,this._subscribeDeferred=null,this._repliesDeferred=new Map,this._endpointUrl=(e.startsWith("https:")?"wss":"ws")+"://"+e.substr(e.indexOf("://")+3)+"/websocket/events",window.addEventListener("beforeunload",()=>{this._unloading=!0,this.disconnect()})}_doConnect(){let e=this._endpointUrl+"?Realm="+iO.config.realm;return iO.authenticated&&(e+="&Authorization="+iO.getAuthorizationHeader()),this._webSocket=new WebSocket(e),this._connectDeferred=new tq,this._webSocket.onopen=()=>{if(this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!0)}},this._webSocket.onerror=e=>{if(this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else console.debug("Event provider error"),this._beforeDisconnect()},this._webSocket.onclose=()=>{if(this._webSocket=void 0,this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onmessage=e=>{let t=e.data;if(t&&t.startsWith(nX)){let e=JSON.parse(t.substring(nX.length)),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&n.resolve(e.subscriptionId)}else if(t.startsWith(nZ)){let e=JSON.parse(t.substring(nZ.length)),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&(console.warn("Unauthorized event subscription: "+JSON.stringify(e,null,2)),n.reject("Unauthorized"))}else if(t.startsWith(nJ)){let e=JSON.parse(t.substring(nJ.length));e.events&&e.events.forEach(t=>{this._onMessageReceived(e.subscriptionId,t)})}else if(t.startsWith(nQ)){let e=JSON.parse(t.substring(nQ.length));if(e.messageID){let t=this._repliesDeferred.get(e.messageID);this._repliesDeferred.delete(e.messageID),t&&t.resolve(e)}}},this._connectDeferred.promise}_beforeDisconnect(){this._onDisconnect()}_doDisconnect(){var e;null==(e=this._webSocket)||e.close(),this._subscribeDeferred=null,this._repliesDeferred.clear()}_doSubscribe(e){return this._webSocket?this._subscribeDeferred?Promise.reject("There's already a pending subscription"):(this._subscribeDeferred=new tq,e.subscriptionId||(e.subscriptionId=n1._subscriptionCounter+++""),this._webSocket.send("SUBSCRIBE:"+JSON.stringify(e)),this._subscribeDeferred.promise):Promise.reject("Not connected")}_doUnsubscribe(e){this._webSocket&&this._webSocket.send("UNSUBSCRIBE:"+JSON.stringify({subscriptionId:e}))}_doSend(e){let t=nQ+JSON.stringify(e);this._webSocket.send(t)}_doSendWithReply(e){if(e.messageID||(e.messageID=(new Date().getTime()+10*Math.random()).toString(10)),this._repliesDeferred.has(e.messageID))return Promise.reject("There's already a pending send and reply with this ID");let t=new tq;return this._repliesDeferred.set(e.messageID,t),this._webSocket.send(nQ+JSON.stringify(e)),t.promise}}function n2(e){return(n2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n1._subscriptionCounter=1;var n5=[],n3=n5.forEach,n4=n5.slice;function n6(e){return n3.call(n4.call(arguments,1),function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])}),e}function n8(){return"function"==typeof XMLHttpRequest||("undefined"==typeof XMLHttpRequest?"undefined":n2(XMLHttpRequest))==="object"}var n7=n(46850),n9=n.t(n7,2);function ie(e){return(ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}"function"==typeof fetch&&(sO="undefined"!=typeof global&&global.fetch?global.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),n8()&&("undefined"!=typeof global&&global.XMLHttpRequest?sP=global.XMLHttpRequest:"undefined"!=typeof window&&window.XMLHttpRequest&&(sP=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("undefined"!=typeof global&&global.ActiveXObject?s$=global.ActiveXObject:"undefined"!=typeof window&&window.ActiveXObject&&(s$=window.ActiveXObject)),sO||!n9||sP||s$||(sO=n7||n9),"function"!=typeof sO&&(sO=void 0);var it=function(e,t){if(t&&"object"===ie(t)){var n="";for(var i in t)n+="&"+encodeURIComponent(i)+"="+encodeURIComponent(t[i]);if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},ii=function(e,t,n){sO(e,t).then(function(e){if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then(function(t){n(null,{status:e.status,data:t})}).catch(n)}).catch(n)},ir=!1,io=function(e,t,n,i){e.queryStringParams&&(t=it(t,e.queryStringParams));var r=n6({},"function"==typeof e.customHeaders?e.customHeaders():e.customHeaders);n&&(r["Content-Type"]="application/json");var o="function"==typeof e.requestOptions?e.requestOptions(n):e.requestOptions,a=n6({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:r},ir?{}:o);try{ii(t,a,i)}catch(e){if(!o||0===Object.keys(o).length||!e.message||0>e.message.indexOf("not implemented"))return i(e);try{Object.keys(o).forEach(function(e){delete a[e]}),ii(t,a,i),ir=!0}catch(e){i(e)}}},ia=function(e,t,n,i){n&&"object"===ie(n)&&(n=it("",n).slice(1)),e.queryStringParams&&(t=it(t,e.queryStringParams));try{(r=sP?new sP:new s$("MSXML2.XMLHTTP.3.0")).open(n?"POST":"GET",t,1),e.crossDomain||r.setRequestHeader("X-Requested-With","XMLHttpRequest"),r.withCredentials=!!e.withCredentials,n&&r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),r.overrideMimeType&&r.overrideMimeType("application/json");var r,o=e.customHeaders;if(o="function"==typeof o?o():o)for(var a in o)r.setRequestHeader(a,o[a]);r.onreadystatechange=function(){r.readyState>3&&i(r.status>=400?r.statusText:null,{status:r.status,data:r.responseText})},r.send(n)}catch(e){console&&console.log(e)}};let is=function(e,t,n,i){return("function"==typeof n&&(i=n,n=void 0),i=i||function(){},sO)?io(e,t,n,i):n8()||"function"==typeof ActiveXObject?ia(e,t,n,i):void i(Error("No fetch and no xhr implementation found!"))};var il=function(){var e;function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(this instanceof t))throw TypeError("Cannot call a class as a function");this.services=e,this.options=n,this.allOptions=i,this.type="backend",this.init(e,n,i)}return e=[{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=n6(n,this.options||{},{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(e){return JSON.parse(e)},stringify:JSON.stringify,parsePayload:function(e,t,n){var i,r;return i={},r=n||"",t in i?Object.defineProperty(i,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):i[t]=r,i},request:is,reloadInterval:"undefined"==typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}),this.allOptions=i,this.services&&this.options.reloadInterval&&setInterval(function(){return t.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(e,t,n){this._readAny(e,e,t,t,n)}},{key:"read",value:function(e,t,n){this._readAny([e],e,[t],t,n)}},{key:"_readAny",value:function(e,t,n,i,r){var o,a,s=this,l=this.options.loadPath;"function"==typeof this.options.loadPath&&(l=this.options.loadPath(e,n)),(l=(a=o=l)&&"function"==typeof a.then?o:Promise.resolve(o)).then(function(o){if(!o)return r(null,{});var a=s.services.interpolator.interpolate(o,{lng:e.join("+"),ns:n.join("+")});s.loadUrl(a,r,t,i)})}},{key:"loadUrl",value:function(e,t,n,i){var r=this;this.options.request(this.options,e,void 0,function(o,a){var s,l;if(a&&(a.status>=500&&a.status<600||!a.status))return t("failed loading "+e+"; status code: "+a.status,!0);if(a&&a.status>=400&&a.status<500)return t("failed loading "+e+"; status code: "+a.status,!1);if(!a&&o&&o.message&&o.message.indexOf("Failed to fetch")>-1)return t("failed loading "+e+": "+o.message,!0);if(o)return t(o,!1);try{s="string"==typeof a.data?r.options.parse(a.data,n,i):a.data}catch(t){l="failed parsing "+e+" to json"}if(l)return t(l,!1);t(null,s)})}},{key:"create",value:function(e,t,n,i,r){var o=this;if(this.options.addPath){"string"==typeof e&&(e=[e]);var a=this.options.parsePayload(t,n,i),s=0,l=[],c=[];e.forEach(function(n){var i=o.options.addPath;"function"==typeof o.options.addPath&&(i=o.options.addPath(n,t));var d=o.services.interpolator.interpolate(i,{lng:n,ns:t});o.options.request(o.options,d,a,function(t,n){s+=1,l.push(t),c.push(n),s===e.length&&r&&r(l,c)})})}}},{key:"reload",value:function(){var e=this,t=this.services,n=t.backendConnector,i=t.languageUtils,r=t.logger,o=n.language;if(!o||"cimode"!==o.toLowerCase()){var a=[],s=function(e){i.toResolveHierarchy(e).forEach(function(e){0>a.indexOf(e)&&a.push(e)})};s(o),this.allOptions.preload&&this.allOptions.preload.forEach(function(e){return s(e)}),a.forEach(function(t){e.allOptions.ns.forEach(function(e){n.read(t,e,"read",null,null,function(i,o){i&&r.warn("loading namespace ".concat(e," for language ").concat(t," failed"),i),!i&&o&&r.log("loaded namespace ".concat(e," for language ").concat(t),o),n.loaded("".concat(t,"|").concat(e),i,o)})})})}}}],function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}();il.type="backend";class ic extends ek{constructor(e){if(super(e),this.it=Z,e.type!==ew.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===Z||null==e)return this._t=void 0,this.it=e;if(e===X)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}ic.directiveName="unsafeHTML",ic.resultType=1,eF(ic);class id extends ic{}id.directiveName="unsafeSVG",id.resultType=2;let iu=eF(id),ih={size:24,icons:{logo:'<path style=\'pointer-events: var(--or-icon-pointer-events, none);\' fill="#C4D600" d="m11.96125,23.85096c-6.56773,0 -11.90971,-5.34202 -11.90971,-11.90862l2.49411,0c0,5.19176 4.22389,9.41568 9.41561,9.41568c5.19053,0 9.41561,-4.22392 9.41561,-9.41568c0,-5.19176 -4.22389,-9.41568 -9.41561,-9.41568l0,-2.49413c6.56655,0 11.90971,5.34439 11.90971,11.9098c0,6.5666 -5.34316,11.90862 -11.90971,11.90862l0,0z" /><path fill="#4E9D2D" d="m10.25094,20.38647c-2.26848,-0.47231 -4.21822,-1.80199 -5.48741,-3.74009s-1.70892,-4.25777 -1.23545,-6.52625c0.47347,-2.26965 1.80315,-4.21822 3.74242,-5.48857c1.93926,-1.27035 4.25661,-1.70892 6.52625,-1.23545c4.68471,0.97719 7.70121,5.5828 6.72286,10.26635l-2.39994,-0.49907c0.70149,-3.36085 -1.4623,-6.66585 -4.82431,-7.36734c-1.62866,-0.33969 -3.29105,-0.02559 -4.68238,0.88645c-1.39134,0.91088 -2.34526,2.3092 -2.68495,3.93786c-0.33853,1.62633 -0.02443,3.28988 0.88645,4.68122c0.91088,1.39134 2.3092,2.34526 3.93786,2.68379l-0.50139,2.4011l0,0z"/><path fill="#1D5632"d="m12.03064,17.49616c-0.09524,0 -0.19048,-0.00116 -0.28457,-0.00465c-1.49833,-0.0755 -2.87818,-0.72942 -3.88636,-1.84097c-1.00818,-1.11271 -1.52156,-2.54948 -1.44722,-4.05013l2.44378,0.12196c-0.04181,0.84557 0.24856,1.65745 0.81769,2.28466c0.56681,0.62721 1.34733,0.99656 2.1929,1.03838c0.84208,0.03833 1.65629,-0.2474 2.2835,-0.81653c0.62837,-0.56797 0.99656,-1.34617 1.03954,-2.19174c0.08711,-1.74573 -1.26371,-3.23708 -3.00943,-3.3242l0.12196,-2.44378c3.09422,0.15332 5.4869,2.79455 5.33358,5.88877c-0.07434,1.49949 -0.72942,2.87818 -1.84097,3.8852c-1.04186,0.94313 -2.36945,1.45303 -3.7644,1.45303l0,0z"/>',"logo-plain":"m11.9925,23.91349c-6.58498,0 -11.94099,-5.35605 -11.94099,-11.9399l2.50066,0c0,5.20539 4.23498,9.44041 9.44033,9.44041c5.20416,0 9.44033,-4.23502 9.44033,-9.44041c0,-5.20539 -4.23498,-9.44041 -9.44033,-9.44041l0,-2.50068c6.5838,0 11.94099,5.35842 11.94099,11.94108c0,6.58385 -5.35719,11.9399 -11.94099,11.9399l0,0zm-1.80787,-3.27769c-2.31323,-0.48163 -4.30141,-1.83755 -5.59563,-3.81389s-1.74263,-4.34178 -1.25982,-6.65502c0.48281,-2.31443 1.83872,-4.30145 3.81623,-5.59686c1.97751,-1.29542 4.34056,-1.74264 6.65497,-1.25983c4.77711,0.99647 7.8531,5.69295 6.85545,10.46891l-2.44727,-0.50891c0.71532,-3.42716 -1.49114,-6.79738 -4.91946,-7.5127c-1.66078,-0.34639 -3.35596,-0.0261 -4.77474,0.90394c-1.41878,0.92886 -2.39152,2.35476 -2.73791,4.01555c-0.3452,1.65842 -0.02491,3.3548 0.90394,4.77359c0.92885,1.41879 2.35475,2.39154 4.01552,2.73675l-0.51128,2.44848l0,0zm1.81499,-2.92536c-0.09727,0 -0.19455,-0.00119 -0.29064,-0.00475c-1.53029,-0.07711 -2.93958,-0.74498 -3.96926,-1.88025c-1.02968,-1.13646 -1.55401,-2.60388 -1.47809,-4.13655l2.49591,0.12456c-0.04271,0.86361 0.25386,1.69282 0.83513,2.33341c0.5789,0.64059 1.37607,1.01783 2.23968,1.06053c0.86005,0.03915 1.69162,-0.25268 2.33221,-0.83395c0.64177,-0.58009 1.01782,-1.3749 1.06171,-2.23851c0.08897,-1.78298 -1.29066,-3.30616 -3.07362,-3.39513l0.12456,-2.49593c3.16022,0.15659 5.60394,2.85419 5.44735,6.01443c-0.07592,1.53149 -0.74498,2.9396 -1.88024,3.9681c-1.06408,0.96326 -2.41999,1.48403 -3.8447,1.48403l0,0z",marker:'<ellipse fill="#000" opacity="0.2" ry="1.5" rx="4" cy="22.5" cx="12" /><path style=\'pointer-events: var(--or-icon-pointer-events, none);\' d="m11.999999,0a8.437501,8.344057 0 0 1 8.437501,8.344057c0,6.500779 -5.798864,6.280799 -8.437501,14.412461c-2.638637,-8.131662 -8.437501,-7.911683 -8.437501,-14.412461a8.437501,8.344057 0 0 1 8.437501,-8.344057z" />'}};var im=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let ip=n(7319);class ig extends CustomEvent{constructor(){super(ig.NAME,{bubbles:!0,composed:!0})}}ig.NAME="or-iconset-added";let ib=new class{constructor(){this._icons={}}addIconSet(e,t){this._icons[e]=t,this._defaultIconSet||(this._defaultIconSet=t),t.onAdd&&t.onAdd(),window.dispatchEvent(new ig)}getIconSet(e){return this._icons[e]}getIconTemplate(e){if(!e)return K``;let t=(e||"").split(":"),n=t.pop(),i=t.pop(),r=this._defaultIconSet;return(i&&(r=this.getIconSet(i)),n&&r)?r.getIconTemplate(n):K``}},i_=class extends em{constructor(){super(...arguments),this._handler=e=>{this._updateIcon()}}static get styles(){return[u`
|
|
69
69
|
:host {
|
|
70
70
|
--internal-or-icon-width: var(--or-icon-width, 24px);
|
|
71
71
|
--internal-or-icon-height: var(--or-icon-height, 24px);
|
|
@@ -108,16 +108,16 @@ uniform ${n} ${i} u_${r};
|
|
|
108
108
|
width: var(--internal-or-icon-width);
|
|
109
109
|
height: var(--internal-or-icon-height);
|
|
110
110
|
}
|
|
111
|
-
`,u`${d(ih)}`]}render(){return this._iconTemplate||K``}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(im.NAME,this._handler)}shouldUpdate(e){return e.has("icon")&&this._updateIcon(),!0}_updateIcon(){this._iconTemplate=void 0,window.removeEventListener(im.NAME,this._handler),this._iconTemplate=ip.getIconTemplate(this.icon),this.icon&&!this._iconTemplate&&window.addEventListener(im.NAME,this._handler)}};iu([eb({type:String,reflect:!0})],ig.prototype,"icon",void 0),iu([e_()],ig.prototype,"_iconTemplate",void 0),ig=iu([ep("or-icon")],ig);var ib=n(50921);class i_ extends Error{}function iy(e,t){let n;if("string"!=typeof e)throw new i_("Invalid token specified: must be a string");t||(t={});let i=+(!0!==t.header),r=e.split(".")[i];if("string"!=typeof r)throw new i_(`Invalid token specified: missing part #${i+1}`);try{n=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("base64 string is not of the correct length")}try{var n;return n=t,decodeURIComponent(atob(n).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}catch(e){return atob(t)}}(r)}catch(e){throw new i_(`Invalid token specified: invalid base64 for part #${i+1} (${e.message})`)}try{return JSON.parse(n)}catch(e){throw new i_(`Invalid token specified: invalid json for part #${i+1} (${e.message})`)}}if(i_.prototype.name="InvalidTokenError","undefined"==typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function iv(e){if(!(this instanceof iv))throw Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,n,i=this,r=[],o={enable:!0,callbackList:[],interval:5},a=document.getElementsByTagName("script"),s=0;s<a.length;s++)(-1!==a[s].src.indexOf("keycloak.js")||-1!==a[s].src.indexOf("keycloak.min.js"))&&-1!==a[s].src.indexOf("version=")&&(i.iframeVersion=a[s].src.substring(a[s].src.indexOf("version=")+8).split("&")[0]);var l=!0,c=C(console.info),d=C(console.warn);function u(e,t){for(var n=function(e){var t=null,n=window.crypto||window.msCrypto;if(n&&n.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),n.getRandomValues(t),t;t=Array(e);for(var i=0;i<t.length;i++)t[i]=Math.floor(256*Math.random());return t}(e),i=Array(e),r=0;r<e;r++)i[r]=t.charCodeAt(n[r]%t.length);return String.fromCharCode.apply(null,i)}function h(){return void 0===i.authServerUrl?void 0:"/"==i.authServerUrl.charAt(i.authServerUrl.length-1)?i.authServerUrl+"realms/"+encodeURIComponent(i.realm):i.authServerUrl+"/realms/"+encodeURIComponent(i.realm)}function m(e,t){var n=e.code,r=e.error,o=e.prompt,a=new Date().getTime();if(e.kc_action_status&&i.onActionUpdate&&i.onActionUpdate(e.kc_action_status),r){if("none"!=o)if(e.error_description&&"authentication_expired"===e.error_description)i.login(e.loginOptions);else{var s={error:r,error_description:e.error_description};i.onAuthError&&i.onAuthError(s),t&&t.setError(s)}else t&&t.setSuccess();return}if("standard"!=i.flow&&(e.access_token||e.id_token)&&m(e.access_token,null,e.id_token,!0),"implicit"!=i.flow&&n){var d="code="+n+"&grant_type=authorization_code",u=i.endpoints.token(),h=new XMLHttpRequest;h.open("POST",u,!0),h.setRequestHeader("Content-type","application/x-www-form-urlencoded"),d+="&client_id="+encodeURIComponent(i.clientId)+"&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(d+="&code_verifier="+e.pkceCodeVerifier),h.withCredentials=!0,h.onreadystatechange=function(){if(4==h.readyState)if(200==h.status){var e=JSON.parse(h.responseText);m(e.access_token,e.refresh_token,e.id_token,"standard"===i.flow),x()}else i.onAuthError&&i.onAuthError(),t&&t.setError()},h.send(d)}function m(n,r,o,s){p(n,r,o,a=(a+new Date().getTime())/2),l&&i.idTokenParsed&&i.idTokenParsed.nonce!=e.storedNonce?(c("[KEYCLOAK] Invalid nonce, clearing token"),i.clearToken(),t&&t.setError()):s&&(i.onAuthSuccess&&i.onAuthSuccess(),t&&t.setSuccess())}}function f(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function p(e,t,n,r){if(i.tokenTimeoutHandle&&(clearTimeout(i.tokenTimeoutHandle),i.tokenTimeoutHandle=null),t?(i.refreshToken=t,i.refreshTokenParsed=iy(t)):(delete i.refreshToken,delete i.refreshTokenParsed),n?(i.idToken=n,i.idTokenParsed=iy(n)):(delete i.idToken,delete i.idTokenParsed),e){if(i.token=e,i.tokenParsed=iy(e),i.sessionId=i.tokenParsed.sid,i.authenticated=!0,i.subject=i.tokenParsed.sub,i.realmAccess=i.tokenParsed.realm_access,i.resourceAccess=i.tokenParsed.resource_access,r&&(i.timeSkew=Math.floor(r/1e3)-i.tokenParsed.iat),null!=i.timeSkew&&(c("[KEYCLOAK] Estimated time difference between browser and server is "+i.timeSkew+" seconds"),i.onTokenExpired)){var o=(i.tokenParsed.exp-new Date().getTime()/1e3+i.timeSkew)*1e3;c("[KEYCLOAK] Token expires in "+Math.round(o/1e3)+" s"),o<=0?i.onTokenExpired():i.tokenTimeoutHandle=setTimeout(i.onTokenExpired,o)}}else delete i.token,delete i.tokenParsed,delete i.subject,delete i.realmAccess,delete i.resourceAccess,i.authenticated=!1}function g(){var e="0123456789abcdef",t=u(36,e).split("");return t[14]="4",t[19]=e.substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function b(e){var t=function(e){switch(i.flow){case"standard":t=["code","state","session_state","kc_action_status","iss"];break;case"implicit":t=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":t=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"]}t.push("error"),t.push("error_description"),t.push("error_uri");var t,n,r,o=e.indexOf("?"),a=e.indexOf("#");if("query"===i.responseMode&&-1!==o?(n=e.substring(0,o),""!==(r=_(e.substring(o+1,-1!==a?a:e.length),t)).paramsString&&(n+="?"+r.paramsString),-1!==a&&(n+=e.substring(a))):"fragment"===i.responseMode&&-1!==a&&(n=e.substring(0,a),""!==(r=_(e.substring(a+1),t)).paramsString&&(n+="#"+r.paramsString)),r&&r.oauthParams){if("standard"===i.flow||"hybrid"===i.flow){if((r.oauthParams.code||r.oauthParams.error)&&r.oauthParams.state)return r.oauthParams.newUrl=n,r.oauthParams}else if("implicit"===i.flow&&(r.oauthParams.access_token||r.oauthParams.error)&&r.oauthParams.state)return r.oauthParams.newUrl=n,r.oauthParams}}(e);if(t){var r=n.get(t.state);return r&&(t.valid=!0,t.redirectUri=r.redirectUri,t.storedNonce=r.nonce,t.prompt=r.prompt,t.pkceCodeVerifier=r.pkceCodeVerifier,t.loginOptions=r.loginOptions),t}}function _(e,t){for(var n=e.split("&"),i={paramsString:"",oauthParams:{}},r=0;r<n.length;r++){var o=n[r].indexOf("="),a=n[r].slice(0,o);-1!==t.indexOf(a)?i.oauthParams[a]=n[r].slice(o+1):(""!==i.paramsString&&(i.paramsString+="&"),i.paramsString+=n[r])}return i}function y(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new Promise(function(t,n){e.resolve=t,e.reject=n}),e}function v(){var e=y();if(!o.enable||o.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");o.iframe=t,t.onload=function(){var t=i.endpoints.authorize();"/"===t.charAt(0)?o.iframeOrigin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""):o.iframeOrigin=t.substring(0,t.indexOf("/",8)),e.setSuccess()};var n=i.endpoints.checkSessionIframe();return t.setAttribute("src",n),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-session-iframe"),t.style.display="none",document.body.appendChild(t),window.addEventListener("message",function(e){if(e.origin===o.iframeOrigin&&o.iframe.contentWindow===e.source&&("unchanged"==e.data||"changed"==e.data||"error"==e.data)){"unchanged"!=e.data&&i.clearToken();for(var t=o.callbackList.splice(0,o.callbackList.length),n=t.length-1;n>=0;--n){var r=t[n];"error"==e.data?r.setError():r.setSuccess("unchanged"==e.data)}}},!1),e.promise}function x(){o.enable&&i.token&&setTimeout(function(){w().then(function(e){e&&x()})},1e3*o.interval)}function w(){var e=y();if(o.iframe&&o.iframeOrigin){var t=i.clientId+" "+(i.sessionId?i.sessionId:"");o.callbackList.push(e);var n=o.iframeOrigin;1==o.callbackList.length&&o.iframe.contentWindow.postMessage(t,n)}else e.setSuccess();return e.promise}function F(){var e,t,n,r=y();if(o.enable||i.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",i.endpoints.thirdPartyCookiesIframe()),a.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-3p-check-iframe"),a.style.display="none",document.body.appendChild(a);var s=function(e){a.contentWindow===e.source&&("supported"===e.data||"unsupported"===e.data)&&("unsupported"===e.data&&(d("[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:\n\n - It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).\n - It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).\n\nFor more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers"),o.enable=!1,i.silentCheckSsoFallback&&(i.silentCheckSsoRedirectUri=!1)),document.body.removeChild(a),window.removeEventListener("message",s),r.setSuccess())};window.addEventListener("message",s,!1)}else r.setSuccess();return e=r.promise,t=i.messageReceiveTimeout,n=null,Promise.race([e,new Promise(function(e,i){n=setTimeout(function(){i({error:"Timeout when waiting for 3rd party check iframe message."})},t)})]).finally(function(){clearTimeout(n)})}function k(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(i.createLoginUrl(e)),y().promise},logout:async function(e){if("GET"===(e?.logoutMethod??i.logoutMethod))return void window.location.replace(i.createLogoutUrl(e));let n=i.createLogoutUrl(e),r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:i.idToken,client_id:i.clientId,post_logout_redirect_uri:t.redirectUri(e,!1)})});if(r.redirected){window.location.href=r.url;return}if(r.ok)return void window.location.reload();throw Error("Logout failed, request returned an error code.")},register:function(e){return window.location.assign(i.createRegisterUrl(e)),y().promise},accountManagement:function(){var e=i.createAccountUrl();if(void 0!==e)window.location.href=e;else throw"Not supported by the OIDC server";return y().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:i.redirectUri?i.redirectUri:location.href}};if("cordova"==e){o.enable=!1;var n=function(e,t,n){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,n):window.open(e,t,n)},r=function(e){var t=e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce(function(t,n){return t[n]=e.cordovaOptions[n],t},{}):{};return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),Object.keys(t).reduce(function(e,n){return e.push(n+"="+t[n]),e},[]).join(",")},a=function(){return i.redirectUri||"http://localhost"};return{login:function(e){var t=y(),o=r(e),s=n(i.createLoginUrl(e),"_blank",o),l=!1,c=!1,d=function(){c=!0,s.close()};return s.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(m(b(e.url),t),d(),l=!0)}),s.addEventListener("loaderror",function(e){l||(0==e.url.indexOf(a())?(m(b(e.url),t),d(),l=!0):(t.setError(),d()))}),s.addEventListener("exit",function(e){c||t.setError({reason:"closed_by_user"})}),t.promise},logout:function(e){var t,r=y(),o=n(i.createLogoutUrl(e),"_blank","location=no,hidden=yes,clearcache=yes");return o.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&o.close()}),o.addEventListener("loaderror",function(e){0==e.url.indexOf(a())||(t=!0),o.close()}),o.addEventListener("exit",function(e){t?r.setError():(i.clearToken(),r.setSuccess())}),r.promise},register:function(e){var t=y(),o=n(i.createRegisterUrl(),"_blank",r(e));return o.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(o.close(),m(b(e.url),t))}),t.promise},accountManagement:function(){var e=i.createAccountUrl();if(void 0!==e){var t=n(e,"_blank","location=no");t.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&t.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(e){return a()}}}if("cordova-native"==e)return o.enable=!1,{login:function(e){var t=y(),n=i.createLoginUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),m(b(e.url),t)}),window.cordova.plugins.browsertab.openUrl(n),t.promise},logout:function(e){var t=y(),n=i.createLogoutUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),i.clearToken(),t.setSuccess()}),window.cordova.plugins.browsertab.openUrl(n),t.promise},register:function(e){var t=y(),n=i.createRegisterUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),m(b(e.url),t)}),window.cordova.plugins.browsertab.openUrl(n),t.promise},accountManagement:function(){var e=i.createAccountUrl();if(void 0!==e)window.cordova.plugins.browsertab.openUrl(e);else throw"Not supported by the OIDC server"},redirectUri:function(e){return e&&e.redirectUri?e.redirectUri:i.redirectUri?i.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}i.init=function(r){if(i.didInitialize)throw Error("A 'Keycloak' instance can only be initialized once.");if(i.didInitialize=!0,i.authenticated=!1,n=function(){try{return new E}catch(e){}return new A}(),t=r&&["default","cordova","cordova-native"].indexOf(r.adapter)>-1?k(r.adapter):r&&"object"==typeof r.adapter?r.adapter:window.Cordova||window.cordova?k("cordova"):k(),r){if(void 0!==r.useNonce&&(l=r.useNonce),void 0!==r.checkLoginIframe&&(o.enable=r.checkLoginIframe),r.checkLoginIframeInterval&&(o.interval=r.checkLoginIframeInterval),"login-required"===r.onLoad&&(i.loginRequired=!0),r.responseMode)if("query"===r.responseMode||"fragment"===r.responseMode)i.responseMode=r.responseMode;else throw"Invalid value for responseMode";if(r.flow){switch(r.flow){case"standard":i.responseType="code";break;case"implicit":i.responseType="id_token token";break;case"hybrid":i.responseType="code id_token token";break;default:throw"Invalid value for flow"}i.flow=r.flow}if(null!=r.timeSkew&&(i.timeSkew=r.timeSkew),r.redirectUri&&(i.redirectUri=r.redirectUri),r.silentCheckSsoRedirectUri&&(i.silentCheckSsoRedirectUri=r.silentCheckSsoRedirectUri),"boolean"==typeof r.silentCheckSsoFallback?i.silentCheckSsoFallback=r.silentCheckSsoFallback:i.silentCheckSsoFallback=!0,void 0!==r.pkceMethod){if("S256"!==r.pkceMethod&&!1!==r.pkceMethod)throw TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${r.pkceMethod}.`);i.pkceMethod=r.pkceMethod}else i.pkceMethod="S256";"boolean"==typeof r.enableLogging?i.enableLogging=r.enableLogging:i.enableLogging=!1,"POST"===r.logoutMethod?i.logoutMethod="POST":i.logoutMethod="GET","string"==typeof r.scope&&(i.scope=r.scope),"string"==typeof r.acrValues&&(i.acrValues=r.acrValues),"number"==typeof r.messageReceiveTimeout&&r.messageReceiveTimeout>0?i.messageReceiveTimeout=r.messageReceiveTimeout:i.messageReceiveTimeout=1e4}i.responseMode||(i.responseMode="fragment"),i.responseType||(i.responseType="code",i.flow="standard");var a=y(),s=y();s.promise.then(function(){i.onReady&&i.onReady(i.authenticated),a.setSuccess(i.authenticated)}).catch(function(e){a.setError(e)});var c=function(t){var n=y();function r(e){e?i.endpoints={authorize:function(){return e.authorization_endpoint},token:function(){return e.token_endpoint},logout:function(){if(!e.end_session_endpoint)throw"Not supported by the OIDC server";return e.end_session_endpoint},checkSessionIframe:function(){if(!e.check_session_iframe)throw"Not supported by the OIDC server";return e.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!e.userinfo_endpoint)throw"Not supported by the OIDC server";return e.userinfo_endpoint}}:i.endpoints={authorize:function(){return h()+"/protocol/openid-connect/auth"},token:function(){return h()+"/protocol/openid-connect/token"},logout:function(){return h()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=h()+"/protocol/openid-connect/login-status-iframe.html";return i.iframeVersion&&(e=e+"?version="+i.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=h()+"/protocol/openid-connect/3p-cookies/step1.html";return i.iframeVersion&&(e=e+"?version="+i.iframeVersion),e},register:function(){return h()+"/protocol/openid-connect/registrations"},userinfo:function(){return h()+"/protocol/openid-connect/userinfo"}}}if(e?"string"==typeof e&&(s=e):s="keycloak.json",s){var o=new XMLHttpRequest;o.open("GET",s,!0),o.setRequestHeader("Accept","application/json"),o.onreadystatechange=function(){if(4==o.readyState)if(200==o.status||f(o)){var e=JSON.parse(o.responseText);i.authServerUrl=e["auth-server-url"],i.realm=e.realm,i.clientId=e.resource,r(null),n.setSuccess()}else n.setError()},o.send()}else{if(!e.clientId)throw"clientId missing";i.clientId=e.clientId;var a=e.oidcProvider;if(a)if("string"==typeof a){var s,l="/"==a.charAt(a.length-1)?a+".well-known/openid-configuration":a+"/.well-known/openid-configuration",o=new XMLHttpRequest;o.open("GET",l,!0),o.setRequestHeader("Accept","application/json"),o.onreadystatechange=function(){4==o.readyState&&(200==o.status||f(o)?(r(JSON.parse(o.responseText)),n.setSuccess()):n.setError())},o.send()}else r(a),n.setSuccess();else{if(!e.url){for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++)if(c[d].src.match(/.*keycloak\.js/)){e.url=c[d].src.substr(0,c[d].src.indexOf("/js/keycloak.js"));break}}if(!e.realm)throw"realm missing";i.authServerUrl=e.url,i.realm=e.realm,r(null),n.setSuccess()}}return n.promise}();function d(){var e=function(e){e||(n.prompt="none"),r&&r.locale&&(n.locale=r.locale),i.login(n).then(function(){s.setSuccess()}).catch(function(e){s.setError(e)})},t=function(){var e=document.createElement("iframe"),t=i.createLoginUrl({prompt:"none",redirectUri:i.silentCheckSsoRedirectUri});e.setAttribute("src",t),e.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),e.setAttribute("title","keycloak-silent-check-sso"),e.style.display="none",document.body.appendChild(e);var n=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(m(b(t.data),s),document.body.removeChild(e),window.removeEventListener("message",n))};window.addEventListener("message",n)},n={};switch(r.onLoad){case"check-sso":o.enable?v().then(function(){w().then(function(n){n?s.setSuccess():i.silentCheckSsoRedirectUri?t():e(!1)}).catch(function(e){s.setError(e)})}):i.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function u(){var e=b(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return v().then(function(){m(e,s)}).catch(function(e){s.setError(e)});r?r.token&&r.refreshToken?(p(r.token,r.refreshToken,r.idToken),o.enable?v().then(function(){w().then(function(e){e?(i.onAuthSuccess&&i.onAuthSuccess(),s.setSuccess(),x()):s.setSuccess()}).catch(function(e){s.setError(e)})}):i.updateToken(-1).then(function(){i.onAuthSuccess&&i.onAuthSuccess(),s.setSuccess()}).catch(function(e){i.onAuthError&&i.onAuthError(),r.onLoad?d():s.setError(e)})):r.onLoad?d():s.setSuccess():s.setSuccess()}return c.then(function(){var e,t;(e=y(),t=function(){("interactive"===document.readyState||"complete"===document.readyState)&&(document.removeEventListener("readystatechange",t),e.setSuccess())},document.addEventListener("readystatechange",t),t(),e.promise).then(F).then(u).catch(function(e){a.setError(e)})}),c.catch(function(e){a.setError(e)}),a.promise},i.login=function(e){return t.login(e)},i.createLoginUrl=function(e){var r,o=g(),a=g(),s=t.redirectUri(e),c={state:o,nonce:a,redirectUri:encodeURIComponent(s),loginOptions:e};e&&e.prompt&&(c.prompt=e.prompt),r=e&&"register"==e.action?i.endpoints.register():i.endpoints.authorize();var d=e&&e.scope||i.scope;d?-1===d.indexOf("openid")&&(d="openid "+d):d="openid";var h=r+"?client_id="+encodeURIComponent(i.clientId)+"&redirect_uri="+encodeURIComponent(s)+"&state="+encodeURIComponent(o)+"&response_mode="+encodeURIComponent(i.responseMode)+"&response_type="+encodeURIComponent(i.responseType)+"&scope="+encodeURIComponent(d);if(l&&(h=h+"&nonce="+encodeURIComponent(a)),e&&e.prompt&&(h+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(h+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(h+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(h+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(h+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(h+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr&&(h+="&claims="+encodeURIComponent(JSON.stringify({id_token:{acr:e.acr}}))),(e&&e.acrValues||i.acrValues)&&(h+="&acr_values="+encodeURIComponent(e.acrValues||i.acrValues)),i.pkceMethod){var m=u(96,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");c.pkceCodeVerifier=m,h+="&code_challenge="+function(e,t){if("S256"!==e)throw TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${e}'.`);return btoa(String.fromCodePoint(...new Uint8Array(ib.arrayBuffer(t)))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}(i.pkceMethod,m)+"&code_challenge_method="+i.pkceMethod}return n.add(c),h},i.logout=function(e){return t.logout(e)},i.createLogoutUrl=function(e){if("POST"===(e?.logoutMethod??i.logoutMethod))return i.endpoints.logout();var n=i.endpoints.logout()+"?client_id="+encodeURIComponent(i.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return i.idToken&&(n+="&id_token_hint="+encodeURIComponent(i.idToken)),n},i.register=function(e){return t.register(e)},i.createRegisterUrl=function(e){return e||(e={}),e.action="register",i.createLoginUrl(e)},i.createAccountUrl=function(e){var n=h(),r=void 0;return void 0!==n&&(r=n+"/account?referrer="+encodeURIComponent(i.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),r},i.accountManagement=function(){return t.accountManagement()},i.hasRealmRole=function(e){var t=i.realmAccess;return!!t&&t.roles.indexOf(e)>=0},i.hasResourceRole=function(e,t){if(!i.resourceAccess)return!1;var n=i.resourceAccess[t||i.clientId];return!!n&&n.roles.indexOf(e)>=0},i.loadUserProfile=function(){var e=h()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+i.token);var n=y();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(i.profile=JSON.parse(t.responseText),n.setSuccess(i.profile)):n.setError())},t.send(),n.promise},i.loadUserInfo=function(){var e=i.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+i.token);var n=y();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(i.userInfo=JSON.parse(t.responseText),n.setSuccess(i.userInfo)):n.setError())},t.send(),n.promise},i.isTokenExpired=function(e){if(!i.tokenParsed||!i.refreshToken&&"implicit"!=i.flow)throw"Not authenticated";if(null==i.timeSkew)return c("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=i.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+i.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},i.updateToken=function(e){var t=y();if(!i.refreshToken)return t.setError(),t.promise;e=e||5;var n=function(){var n=!1;if(-1==e?(n=!0,c("[KEYCLOAK] Refreshing token: forced refresh")):(!i.tokenParsed||i.isTokenExpired(e))&&(n=!0,c("[KEYCLOAK] Refreshing token: token expired")),n){var o="grant_type=refresh_token&refresh_token="+i.refreshToken,a=i.endpoints.token();if(r.push(t),1==r.length){var s=new XMLHttpRequest;s.open("POST",a,!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.withCredentials=!0,o+="&client_id="+encodeURIComponent(i.clientId);var l=new Date().getTime();s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status){c("[KEYCLOAK] Token refreshed"),l=(l+new Date().getTime())/2;var e=JSON.parse(s.responseText);p(e.access_token,e.refresh_token,e.id_token,l),i.onAuthRefreshSuccess&&i.onAuthRefreshSuccess();for(var t=r.pop();null!=t;t=r.pop())t.setSuccess(!0)}else{d("[KEYCLOAK] Failed to refresh token"),400==s.status&&i.clearToken(),i.onAuthRefreshError&&i.onAuthRefreshError();for(var t=r.pop();null!=t;t=r.pop())t.setError(!0)}},s.send(o)}}else t.setSuccess(!1)};return o.enable?w().then(function(){n()}).catch(function(e){t.setError(e)}):n(),t.promise},i.clearToken=function(){i.token&&(p(null,null,null),i.onAuthLogout&&i.onAuthLogout(),i.loginRequired&&i.login())};var E=function(){if(!(this instanceof E))return new E;function e(){for(var e=new Date().getTime(),t=0;t<localStorage.length;t++){var n=localStorage.key(t);if(n&&0==n.indexOf("kc-callback-")){var i=localStorage.getItem(n);if(i)try{var r=JSON.parse(i).expires;(!r||r<e)&&localStorage.removeItem(n)}catch(e){localStorage.removeItem(n)}}}}localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test"),this.get=function(t){if(t){var n="kc-callback-"+t,i=localStorage.getItem(n);return i&&(localStorage.removeItem(n),i=JSON.parse(i)),e(),i}},this.add=function(t){e();var n="kc-callback-"+t.state;t.expires=new Date().getTime()+36e5,localStorage.setItem(n,JSON.stringify(t))}},A=function(){if(!(this instanceof A))return new A;this.get=function(i){if(i){var r=t("kc-callback-"+i);if(n("kc-callback-"+i,"",e(-100)),r)return JSON.parse(r)}},this.add=function(t){n("kc-callback-"+t.state,JSON.stringify(t),e(60))},this.removeItem=function(t){n(t,"",e(-100))};var e=function(e){var t=new Date;return t.setTime(t.getTime()+60*e*1e3),t},t=function(e){for(var t=e+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){for(var r=n[i];" "==r.charAt(0);)r=r.substring(1);if(0==r.indexOf(t))return r.substring(t.length,r.length)}return""},n=function(e,t,n){var i=e+"="+t+"; expires="+n.toUTCString()+"; ";document.cookie=i}};function C(e){return function(){i.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}var ix=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})};let iw=e=>t=>class extends t{constructor(){super(...arguments),this._connectRequested=!1,this._status=sM.DISCONNECTED,this._statusCallback=e=>this._onEventProviderStatusChanged(e)}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this.connectEvents()}disconnectedCallback(){this.disconnectEvents(),super.disconnectedCallback&&super.disconnectedCallback()}connectEvents(){if(!e.getEventProvider())return void console.log("No event provider available so cannot subscribe");this._connectRequested||(this._connectRequested=!0,e.getEventProvider().subscribeStatusChange(this._statusCallback),this._doConnect())}disconnectEvents(){this._connectRequested&&(this._connectRequested=!1,e.getEventProvider().unsubscribeStatusChange(this._statusCallback),this._onEventsDisconnect())}_doConnect(){return ix(this,void 0,void 0,function*(){this.eventsConnected&&this._onEventsConnect()})}get eventsConnected(){return this._connectRequested&&e.getEventProvider().status===sM.CONNECTED}_onEventProviderStatusChanged(e){switch(e){case sM.DISCONNECTED:this._onEventsDisconnect();break;case sM.CONNECTED:this._doConnect()}}_onEventsConnect(){this._addEventSubscriptions(),this.onEventsConnect()}_onEventsDisconnect(){this._removeEventSubscriptions(),this.onEventsDisconnect()}_addEventSubscriptions(){return ix(this,void 0,void 0,function*(){let t=!!this._attributeRefs,n=!!this._assetIds,i=this._attributeRefs?this._attributeRefs:this._assetIds;if(i&&i.length>0){if(this._subscriptionIds=[],n){let t=yield e.getEventProvider().subscribeAssetEvents(i,!0,e=>this._onEvent(e)),n=this._attributeRefs?this._attributeRefs:this._assetIds;if(!this._subscriptionIds||!tK(i,n))return void e.getEventProvider().unsubscribe(t);this._subscriptionIds.push(t)}let r=yield e.getEventProvider().subscribeAttributeEvents(i,t,e=>this._onEvent(e)),o=this._attributeRefs?this._attributeRefs:this._assetIds;if(!this._subscriptionIds||!tK(i,o))return void e.getEventProvider().unsubscribe(r);this._subscriptionIds.push(r)}})}_removeEventSubscriptions(){this._subscriptionIds&&(this._subscriptionIds.forEach(t=>{e.getEventProvider().unsubscribe(t)}),this._subscriptionIds=void 0)}_refreshEventSubscriptions(){this._removeEventSubscriptions(),this._addEventSubscriptions()}set assetIds(e){tK(this._assetIds,e)||(this._assetIds=e,this._refreshEventSubscriptions(),this.requestUpdate("assetIds"))}get assetIds(){return this._assetIds}set attributeRefs(e){tK(this._attributeRefs,e)||(this._attributeRefs=e,this._refreshEventSubscriptions())}get attributeRefs(){return this._attributeRefs}_sendEvent(t){e.getEventProvider().sendEvent(t)}_sendEventWithReply(t){return e.getEventProvider().sendEventWithReply(t)}onEventsConnect(){}onEventsDisconnect(){}_onEvent(e){}},iF="#4d9d2a",ik="#FFFFFF",iE="#CCCCCC",iA="#FFFFFF",iC="#4c4c4c",iT="0 1px 3px 0 rgba(0,0,0,0.21)";var iS=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})};let iM="openremote";!function(e){e.MANAGER_FAILED_TO_LOAD="MANAGER_FAILED_TO_LOAD",e.AUTH_FAILED="AUTH_FAILED",e.AUTH_TYPE_UNSUPPORTED="AUTH_TYPE_UNSUPPORTED",e.CONSOLE_ERROR="CONSOLE_INIT_ERROR",e.EVENTS_CONNECTION_ERROR="EVENTS_CONNECTION_ERROR",e.TRANSLATION_ERROR="TRANSLATION_ERROR"}(sR||(sR={})),function(e){e.ERROR="ERROR",e.READY="READY",e.ONLINE="ONLINE",e.OFFLINE="OFFLINE",e.CONNECTING="CONNECTING",e.CONSOLE_INIT="CONSOLE_INIT",e.CONSOLE_READY="CONSOLE_READY",e.TRANSLATE_INIT="TRANSLATE_INIT",e.TRANSLATE_LANGUAGE_CHANGED="TRANSLATE_LANGUAGE_CHANGED",e.DISPLAY_REALM_CHANGED="DISPLAY_REALM_CHANGED"}(sO||(sO={}));class iL{constructor(){this._authenticated=!1,this._ready=!1,this._name="",this._username="",this._keycloakUpdateTokenInterval=void 0,this._managerVersion="",this._authServerUrl="",this._listeners=[],this._disconnected=!1}get username(){return this._username}get error(){return this._error}get authenticated(){return this._authenticated}get ready(){return this._ready}get config(){return this._config}get roles(){let e=new Map;return this._keycloak?this._keycloak.resourceAccess&&this._config.clientId&&this._keycloak.resourceAccess&&Object.entries(this._keycloak.resourceAccess).forEach(([t,n])=>{let i=n.roles;e.set(t,i)}):this._basicIdentity&&this._basicIdentity.roles&&e.set(this._config.clientId,this._basicIdentity.roles),e}get managerVersion(){return this._managerVersion}get isManagerAvailable(){return this._managerVersion&&""!==this._managerVersion}get managerUrl(){var e;return null==(e=this._config)?void 0:e.managerUrl}get keycloakUrl(){var e;return null==(e=this._config)?void 0:e.keycloakUrl}get isError(){return!!this._error}get connectionStatus(){return this._events&&this._events.status}get console(){return this._console}get consoleAppConfig(){return this._consoleAppConfig}get events(){return this._events}get rest(){return nW}get language(){return tB.language}set language(e){console.debug(`Changing language to ${e}.`),e&&(tB.changeLanguage(e),this.console.storeData("LANGUAGE",e),this.authenticated&&this.updateKeycloakUserLanguage(e).catch(e=>console.error(e)))}get displayRealm(){return this._displayRealm||this._config.realm}set displayRealm(e){this.isSuperUser()&&this._displayRealm!==e&&(this._displayRealm=e,this._emitEvent(sO.DISPLAY_REALM_CHANGED))}get clientId(){return this._config.clientId||iM}getEventProvider(){return this.events}get mapType(){return this._config.mapType||"VECTOR"}isManagerSameOrigin(){if(!this.ready)return!1;let e=new URL(this._config.managerUrl),t=window.location;return e.protocol===t.protocol&&e.hostname===t.hostname&&e.port===t.port}addListener(e){0>this._listeners.indexOf(e)&&this._listeners.push(e)}removeListener(e){let t=this._listeners.indexOf(e);t>=0&&this._listeners.splice(t,1)}init(e){return iS(this,void 0,void 0,function*(){let t;this._config&&console.debug("Already initialised"),this._config=((t=e?Object.assign({},e):{}).managerUrl&&""!==t.managerUrl?t.managerUrl=t.managerUrl.replace(/\/+$/,""):t.managerUrl=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")+window.location.pathname.replace(/\/[^/]+\/?$/,""),t.realm&&""!==t.realm||(t.realm="master"),t.auth||(t.auth="KEYCLOAK"),void 0===t.consoleAutoEnable&&(t.consoleAutoEnable=!0),void 0===t.applyConfigToAdmin&&(t.applyConfigToAdmin=!0),t.eventProviderType||(t.eventProviderType="WEBSOCKET"),(!t.pollingIntervalMillis||t.pollingIntervalMillis<5e3)&&(t.pollingIntervalMillis=1e4),void 0===t.loadIcons&&(t.loadIcons=!0),void 0===t.loadTranslations&&(t.loadTranslations=["or"]),void 0===t.translationsLoadPath&&(t.translationsLoadPath="locales/{{lng}}/{{ns}}.json"),void 0===t.loadDescriptors&&(t.loadDescriptors=!0),void 0===t.clientId&&(t.clientId=iM),t);let n=yield this.loadManagerInfo(),i=new t7(this._config.realm,this._config.consoleAutoEnable,()=>{this._emitEvent(sO.CONSOLE_READY)});if(this._console=i,"BASIC"===this._config.auth)n=(yield this.doTranslateInit())&&n,n=yield this.doAuthInit();else if("KEYCLOAK"===this._config.auth){if(!this._config.keycloakUrl&&this._authServerUrl){let e,t=new URL(this._config.managerUrl);this._authServerUrl.startsWith("//")&&(this._authServerUrl=t.protocol+this._authServerUrl);try{e=new URL(this._authServerUrl)}catch(n){(e=new URL(t)).pathname=this._authServerUrl}e.protocol||(e.protocol=t.protocol),e.hostname||(e.hostname=t.hostname),e.port||(e.port=t.port),this._config.keycloakUrl=e.toString()}this._config.keycloakUrl||(this._config.keycloakUrl=this._config.managerUrl+"/auth"),this._config.keycloakUrl=this._config.keycloakUrl.replace(/\/+$/,""),(n=yield this.doAuthInit())||this._config.skipFallbackToBasicAuth||(console.debug("Falling back to basic auth"),this._config.auth="BASIC",n=yield this.doAuthInit())}return!!n&&(n&&(n=this.doRestApiInit()),(yield this.doConsoleInit())&&this._clearWebHistory(),(n=(yield this.doTranslateInit())&&n)&&(n=yield this.doDescriptorsInit(),n=yield this.getConsoleAppConfig()),this.doIconInit(),n?(n=yield this.doEventsSubscriptionInit(),this._readyCallback&&(yield this._readyCallback()),this._ready=!0,this._emitEvent(sO.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",n)})}loadManagerInfo(){return iS(this,void 0,void 0,function*(){try{let e=yield new Promise((e,t)=>{let n=new XMLHttpRequest;n.addEventListener("load",()=>{e(JSON.parse(n.responseText))}),n.addEventListener("error",()=>{t(Error("Failed to contact the manager"))}),n.open("GET",this._config.managerUrl+"/api/master/info"),n.send()});return this._managerVersion=e&&e.version?e.version:"",this._authServerUrl=e&&e.authServerUrl?e.authServerUrl:"",!0}catch(e){return console.error("Failed to contact the manager",e),this._setError(sR.MANAGER_FAILED_TO_LOAD),!1}})}doTranslateInit(){return iS(this,void 0,void 0,function*(){if(tB.isInitialized)return!0;tB.on("initialized",e=>{this._emitEvent(sO.TRANSLATE_INIT)}),tB.on("languageChanged",e=>{tW().locale(e),this._emitEvent(sO.TRANSLATE_LANGUAGE_CHANGED)});let e={lng:(yield this.getConsolePreferredLanguage())||(yield this.getUserPreferredLanguage())||this.config.defaultLanguage||"en",fallbackLng:"en",defaultNS:"app",fallbackNS:"or",ns:this.config.loadTranslations,interpolation:{format:(e,t,n)=>"uppercase"===t?e.toUpperCase():e instanceof Date?tW()(e).format(t):e},backend:{loadPath:(e,t)=>1===t.length&&"or"===t[0]?this.config.managerUrl+"/shared/locales/{{lng}}/{{ns}}.json":this.config.translationsLoadPath?this.config.translationsLoadPath:"locales/{{lng}}/{{ns}}.json"}};this.config.configureTranslationsOptions&&this.config.configureTranslationsOptions(e);try{yield tB.use(ia).init(e)}catch(e){return console.error(e),this._setError(sR.TRANSLATION_ERROR),!1}return!0})}doDescriptorsInit(){return iS(this,void 0,void 0,function*(){if(!this.config.loadDescriptors)return!0;try{let e=yield nW.api.AssetModelResource.getAssetInfos(),t=yield nW.api.AssetModelResource.getMetaItemDescriptors(),n=yield nW.api.AssetModelResource.getValueDescriptors();tY._assetTypeInfos=e.data,tY._metaItemDescriptors=Object.values(t.data),tY._valueDescriptors=Object.values(n.data)}catch(e){return console.error(e),!1}return!0})}doAuthInit(){return iS(this,void 0,void 0,function*(){let e=!0;switch(this._config.auth){case"BASIC":e=yield this.initialiseBasicAuth();break;case"KEYCLOAK":e=yield this.loadAndInitialiseKeycloak();break;case"NONE":return!0;default:return this._setError(sR.AUTH_TYPE_UNSUPPORTED),!1}return!!e&&(nW.addRequestInterceptor(e=>{if(!e.headers.Authorization){let t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e}),e)})}doRestApiInit(){return nW.setTimeout(2e4),nW.initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return iS(this,void 0,void 0,function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new nQ(this._config.managerUrl),this._events.subscribeStatusChange(e=>this._onEventProviderStatusChanged(e)),e=yield this._events.connect()),e||this._setError(sR.EVENTS_CONNECTION_ERROR),e})}_connectEvents(){var e;(null==(e=this.events)?void 0:e.status)===sM.DISCONNECTED?this.events.connect().catch(e=>{console.error("Failed to connect EventProvider."),console.error(e)}):console.warn("Tried to connect EventProvider, but it wasn't disconnected!")}_onEventProviderStatusChanged(e){switch(e){case sM.DISCONNECTED:this._onDisconnect();break;case sM.CONNECTED:break;case sM.CONNECTING:this._emitEvent(sO.CONNECTING)}}doConsoleInit(){return iS(this,void 0,void 0,function*(){try{return yield this.console.initialise(),this._emitEvent(sO.CONSOLE_INIT),!0}catch(e){return this._setError(sR.CONSOLE_ERROR),!1}})}doIconInit(){var e,t,n;this._config.loadIcons&&(ip.addIconSet("mdi",(e=iD.managerUrl,{getIconTemplate:e=>K`<span style="font-family: 'Material Design Icons';" class="mdi-${e}"></span>`,onAdd(){let t=document.createElement("style");t.id="mdiFontStyle",t.textContent='@font-face {\n font-family: "Material Design Icons";\n src: url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.eot");\n src: url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.eot") format("embedded-opentype"), url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff2") format("woff2"), url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff") format("woff"), url("'+e+'/shared/fonts/Material Design Icons//fonts/materialdesignicons-webfont.ttf") format("truetype");\n font-weight: normal;\n font-style: normal;\n}',document.head.appendChild(t)}})),ip.addIconSet("or",(t=id.size,n=id.icons,{getIconTemplate:e=>{let i=n[e];return i?K`
|
|
111
|
+
`,u`${d(ip)}`]}render(){return this._iconTemplate||K``}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(ig.NAME,this._handler)}shouldUpdate(e){return e.has("icon")&&this._updateIcon(),!0}_updateIcon(){this._iconTemplate=void 0,window.removeEventListener(ig.NAME,this._handler),this._iconTemplate=ib.getIconTemplate(this.icon),this.icon&&!this._iconTemplate&&window.addEventListener(ig.NAME,this._handler)}};im([eb({type:String,reflect:!0})],i_.prototype,"icon",void 0),im([e_()],i_.prototype,"_iconTemplate",void 0),i_=im([ep("or-icon")],i_);var iy=n(50921);class iv extends Error{}function ix(e,t){let n;if("string"!=typeof e)throw new iv("Invalid token specified: must be a string");t||(t={});let i=+(!0!==t.header),r=e.split(".")[i];if("string"!=typeof r)throw new iv(`Invalid token specified: missing part #${i+1}`);try{n=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("base64 string is not of the correct length")}try{var n;return n=t,decodeURIComponent(atob(n).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}catch(e){return atob(t)}}(r)}catch(e){throw new iv(`Invalid token specified: invalid base64 for part #${i+1} (${e.message})`)}try{return JSON.parse(n)}catch(e){throw new iv(`Invalid token specified: invalid json for part #${i+1} (${e.message})`)}}if(iv.prototype.name="InvalidTokenError","undefined"==typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function iw(e){if(!(this instanceof iw))throw Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,n,i=this,r=[],o={enable:!0,callbackList:[],interval:5},a=document.getElementsByTagName("script"),s=0;s<a.length;s++)(-1!==a[s].src.indexOf("keycloak.js")||-1!==a[s].src.indexOf("keycloak.min.js"))&&-1!==a[s].src.indexOf("version=")&&(i.iframeVersion=a[s].src.substring(a[s].src.indexOf("version=")+8).split("&")[0]);var l=!0,c=C(console.info),d=C(console.warn);function u(e,t){for(var n=function(e){var t=null,n=window.crypto||window.msCrypto;if(n&&n.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),n.getRandomValues(t),t;t=Array(e);for(var i=0;i<t.length;i++)t[i]=Math.floor(256*Math.random());return t}(e),i=Array(e),r=0;r<e;r++)i[r]=t.charCodeAt(n[r]%t.length);return String.fromCharCode.apply(null,i)}function h(){return void 0===i.authServerUrl?void 0:"/"==i.authServerUrl.charAt(i.authServerUrl.length-1)?i.authServerUrl+"realms/"+encodeURIComponent(i.realm):i.authServerUrl+"/realms/"+encodeURIComponent(i.realm)}function m(e,t){var n=e.code,r=e.error,o=e.prompt,a=new Date().getTime();if(e.kc_action_status&&i.onActionUpdate&&i.onActionUpdate(e.kc_action_status),r){if("none"!=o)if(e.error_description&&"authentication_expired"===e.error_description)i.login(e.loginOptions);else{var s={error:r,error_description:e.error_description};i.onAuthError&&i.onAuthError(s),t&&t.setError(s)}else t&&t.setSuccess();return}if("standard"!=i.flow&&(e.access_token||e.id_token)&&m(e.access_token,null,e.id_token,!0),"implicit"!=i.flow&&n){var d="code="+n+"&grant_type=authorization_code",u=i.endpoints.token(),h=new XMLHttpRequest;h.open("POST",u,!0),h.setRequestHeader("Content-type","application/x-www-form-urlencoded"),d+="&client_id="+encodeURIComponent(i.clientId)+"&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(d+="&code_verifier="+e.pkceCodeVerifier),h.withCredentials=!0,h.onreadystatechange=function(){if(4==h.readyState)if(200==h.status){var e=JSON.parse(h.responseText);m(e.access_token,e.refresh_token,e.id_token,"standard"===i.flow),x()}else i.onAuthError&&i.onAuthError(),t&&t.setError()},h.send(d)}function m(n,r,o,s){p(n,r,o,a=(a+new Date().getTime())/2),l&&i.idTokenParsed&&i.idTokenParsed.nonce!=e.storedNonce?(c("[KEYCLOAK] Invalid nonce, clearing token"),i.clearToken(),t&&t.setError()):s&&(i.onAuthSuccess&&i.onAuthSuccess(),t&&t.setSuccess())}}function f(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function p(e,t,n,r){if(i.tokenTimeoutHandle&&(clearTimeout(i.tokenTimeoutHandle),i.tokenTimeoutHandle=null),t?(i.refreshToken=t,i.refreshTokenParsed=ix(t)):(delete i.refreshToken,delete i.refreshTokenParsed),n?(i.idToken=n,i.idTokenParsed=ix(n)):(delete i.idToken,delete i.idTokenParsed),e){if(i.token=e,i.tokenParsed=ix(e),i.sessionId=i.tokenParsed.sid,i.authenticated=!0,i.subject=i.tokenParsed.sub,i.realmAccess=i.tokenParsed.realm_access,i.resourceAccess=i.tokenParsed.resource_access,r&&(i.timeSkew=Math.floor(r/1e3)-i.tokenParsed.iat),null!=i.timeSkew&&(c("[KEYCLOAK] Estimated time difference between browser and server is "+i.timeSkew+" seconds"),i.onTokenExpired)){var o=(i.tokenParsed.exp-new Date().getTime()/1e3+i.timeSkew)*1e3;c("[KEYCLOAK] Token expires in "+Math.round(o/1e3)+" s"),o<=0?i.onTokenExpired():i.tokenTimeoutHandle=setTimeout(i.onTokenExpired,o)}}else delete i.token,delete i.tokenParsed,delete i.subject,delete i.realmAccess,delete i.resourceAccess,i.authenticated=!1}function g(){var e="0123456789abcdef",t=u(36,e).split("");return t[14]="4",t[19]=e.substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function b(e){var t=function(e){switch(i.flow){case"standard":t=["code","state","session_state","kc_action_status","iss"];break;case"implicit":t=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":t=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"]}t.push("error"),t.push("error_description"),t.push("error_uri");var t,n,r,o=e.indexOf("?"),a=e.indexOf("#");if("query"===i.responseMode&&-1!==o?(n=e.substring(0,o),""!==(r=_(e.substring(o+1,-1!==a?a:e.length),t)).paramsString&&(n+="?"+r.paramsString),-1!==a&&(n+=e.substring(a))):"fragment"===i.responseMode&&-1!==a&&(n=e.substring(0,a),""!==(r=_(e.substring(a+1),t)).paramsString&&(n+="#"+r.paramsString)),r&&r.oauthParams){if("standard"===i.flow||"hybrid"===i.flow){if((r.oauthParams.code||r.oauthParams.error)&&r.oauthParams.state)return r.oauthParams.newUrl=n,r.oauthParams}else if("implicit"===i.flow&&(r.oauthParams.access_token||r.oauthParams.error)&&r.oauthParams.state)return r.oauthParams.newUrl=n,r.oauthParams}}(e);if(t){var r=n.get(t.state);return r&&(t.valid=!0,t.redirectUri=r.redirectUri,t.storedNonce=r.nonce,t.prompt=r.prompt,t.pkceCodeVerifier=r.pkceCodeVerifier,t.loginOptions=r.loginOptions),t}}function _(e,t){for(var n=e.split("&"),i={paramsString:"",oauthParams:{}},r=0;r<n.length;r++){var o=n[r].indexOf("="),a=n[r].slice(0,o);-1!==t.indexOf(a)?i.oauthParams[a]=n[r].slice(o+1):(""!==i.paramsString&&(i.paramsString+="&"),i.paramsString+=n[r])}return i}function y(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new Promise(function(t,n){e.resolve=t,e.reject=n}),e}function v(){var e=y();if(!o.enable||o.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");o.iframe=t,t.onload=function(){var t=i.endpoints.authorize();"/"===t.charAt(0)?o.iframeOrigin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""):o.iframeOrigin=t.substring(0,t.indexOf("/",8)),e.setSuccess()};var n=i.endpoints.checkSessionIframe();return t.setAttribute("src",n),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-session-iframe"),t.style.display="none",document.body.appendChild(t),window.addEventListener("message",function(e){if(e.origin===o.iframeOrigin&&o.iframe.contentWindow===e.source&&("unchanged"==e.data||"changed"==e.data||"error"==e.data)){"unchanged"!=e.data&&i.clearToken();for(var t=o.callbackList.splice(0,o.callbackList.length),n=t.length-1;n>=0;--n){var r=t[n];"error"==e.data?r.setError():r.setSuccess("unchanged"==e.data)}}},!1),e.promise}function x(){o.enable&&i.token&&setTimeout(function(){w().then(function(e){e&&x()})},1e3*o.interval)}function w(){var e=y();if(o.iframe&&o.iframeOrigin){var t=i.clientId+" "+(i.sessionId?i.sessionId:"");o.callbackList.push(e);var n=o.iframeOrigin;1==o.callbackList.length&&o.iframe.contentWindow.postMessage(t,n)}else e.setSuccess();return e.promise}function F(){var e,t,n,r=y();if(o.enable||i.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",i.endpoints.thirdPartyCookiesIframe()),a.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-3p-check-iframe"),a.style.display="none",document.body.appendChild(a);var s=function(e){a.contentWindow===e.source&&("supported"===e.data||"unsupported"===e.data)&&("unsupported"===e.data&&(d("[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:\n\n - It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).\n - It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).\n\nFor more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers"),o.enable=!1,i.silentCheckSsoFallback&&(i.silentCheckSsoRedirectUri=!1)),document.body.removeChild(a),window.removeEventListener("message",s),r.setSuccess())};window.addEventListener("message",s,!1)}else r.setSuccess();return e=r.promise,t=i.messageReceiveTimeout,n=null,Promise.race([e,new Promise(function(e,i){n=setTimeout(function(){i({error:"Timeout when waiting for 3rd party check iframe message."})},t)})]).finally(function(){clearTimeout(n)})}function k(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(i.createLoginUrl(e)),y().promise},logout:async function(e){if("GET"===(e?.logoutMethod??i.logoutMethod))return void window.location.replace(i.createLogoutUrl(e));let n=i.createLogoutUrl(e),r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:i.idToken,client_id:i.clientId,post_logout_redirect_uri:t.redirectUri(e,!1)})});if(r.redirected){window.location.href=r.url;return}if(r.ok)return void window.location.reload();throw Error("Logout failed, request returned an error code.")},register:function(e){return window.location.assign(i.createRegisterUrl(e)),y().promise},accountManagement:function(){var e=i.createAccountUrl();if(void 0!==e)window.location.href=e;else throw"Not supported by the OIDC server";return y().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:i.redirectUri?i.redirectUri:location.href}};if("cordova"==e){o.enable=!1;var n=function(e,t,n){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,n):window.open(e,t,n)},r=function(e){var t=e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce(function(t,n){return t[n]=e.cordovaOptions[n],t},{}):{};return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),Object.keys(t).reduce(function(e,n){return e.push(n+"="+t[n]),e},[]).join(",")},a=function(){return i.redirectUri||"http://localhost"};return{login:function(e){var t=y(),o=r(e),s=n(i.createLoginUrl(e),"_blank",o),l=!1,c=!1,d=function(){c=!0,s.close()};return s.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(m(b(e.url),t),d(),l=!0)}),s.addEventListener("loaderror",function(e){l||(0==e.url.indexOf(a())?(m(b(e.url),t),d(),l=!0):(t.setError(),d()))}),s.addEventListener("exit",function(e){c||t.setError({reason:"closed_by_user"})}),t.promise},logout:function(e){var t,r=y(),o=n(i.createLogoutUrl(e),"_blank","location=no,hidden=yes,clearcache=yes");return o.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&o.close()}),o.addEventListener("loaderror",function(e){0==e.url.indexOf(a())||(t=!0),o.close()}),o.addEventListener("exit",function(e){t?r.setError():(i.clearToken(),r.setSuccess())}),r.promise},register:function(e){var t=y(),o=n(i.createRegisterUrl(),"_blank",r(e));return o.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(o.close(),m(b(e.url),t))}),t.promise},accountManagement:function(){var e=i.createAccountUrl();if(void 0!==e){var t=n(e,"_blank","location=no");t.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&t.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(e){return a()}}}if("cordova-native"==e)return o.enable=!1,{login:function(e){var t=y(),n=i.createLoginUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),m(b(e.url),t)}),window.cordova.plugins.browsertab.openUrl(n),t.promise},logout:function(e){var t=y(),n=i.createLogoutUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),i.clearToken(),t.setSuccess()}),window.cordova.plugins.browsertab.openUrl(n),t.promise},register:function(e){var t=y(),n=i.createRegisterUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),m(b(e.url),t)}),window.cordova.plugins.browsertab.openUrl(n),t.promise},accountManagement:function(){var e=i.createAccountUrl();if(void 0!==e)window.cordova.plugins.browsertab.openUrl(e);else throw"Not supported by the OIDC server"},redirectUri:function(e){return e&&e.redirectUri?e.redirectUri:i.redirectUri?i.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}i.init=function(r){if(i.didInitialize)throw Error("A 'Keycloak' instance can only be initialized once.");if(i.didInitialize=!0,i.authenticated=!1,n=function(){try{return new E}catch(e){}return new A}(),t=r&&["default","cordova","cordova-native"].indexOf(r.adapter)>-1?k(r.adapter):r&&"object"==typeof r.adapter?r.adapter:window.Cordova||window.cordova?k("cordova"):k(),r){if(void 0!==r.useNonce&&(l=r.useNonce),void 0!==r.checkLoginIframe&&(o.enable=r.checkLoginIframe),r.checkLoginIframeInterval&&(o.interval=r.checkLoginIframeInterval),"login-required"===r.onLoad&&(i.loginRequired=!0),r.responseMode)if("query"===r.responseMode||"fragment"===r.responseMode)i.responseMode=r.responseMode;else throw"Invalid value for responseMode";if(r.flow){switch(r.flow){case"standard":i.responseType="code";break;case"implicit":i.responseType="id_token token";break;case"hybrid":i.responseType="code id_token token";break;default:throw"Invalid value for flow"}i.flow=r.flow}if(null!=r.timeSkew&&(i.timeSkew=r.timeSkew),r.redirectUri&&(i.redirectUri=r.redirectUri),r.silentCheckSsoRedirectUri&&(i.silentCheckSsoRedirectUri=r.silentCheckSsoRedirectUri),"boolean"==typeof r.silentCheckSsoFallback?i.silentCheckSsoFallback=r.silentCheckSsoFallback:i.silentCheckSsoFallback=!0,void 0!==r.pkceMethod){if("S256"!==r.pkceMethod&&!1!==r.pkceMethod)throw TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${r.pkceMethod}.`);i.pkceMethod=r.pkceMethod}else i.pkceMethod="S256";"boolean"==typeof r.enableLogging?i.enableLogging=r.enableLogging:i.enableLogging=!1,"POST"===r.logoutMethod?i.logoutMethod="POST":i.logoutMethod="GET","string"==typeof r.scope&&(i.scope=r.scope),"string"==typeof r.acrValues&&(i.acrValues=r.acrValues),"number"==typeof r.messageReceiveTimeout&&r.messageReceiveTimeout>0?i.messageReceiveTimeout=r.messageReceiveTimeout:i.messageReceiveTimeout=1e4}i.responseMode||(i.responseMode="fragment"),i.responseType||(i.responseType="code",i.flow="standard");var a=y(),s=y();s.promise.then(function(){i.onReady&&i.onReady(i.authenticated),a.setSuccess(i.authenticated)}).catch(function(e){a.setError(e)});var c=function(t){var n=y();function r(e){e?i.endpoints={authorize:function(){return e.authorization_endpoint},token:function(){return e.token_endpoint},logout:function(){if(!e.end_session_endpoint)throw"Not supported by the OIDC server";return e.end_session_endpoint},checkSessionIframe:function(){if(!e.check_session_iframe)throw"Not supported by the OIDC server";return e.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!e.userinfo_endpoint)throw"Not supported by the OIDC server";return e.userinfo_endpoint}}:i.endpoints={authorize:function(){return h()+"/protocol/openid-connect/auth"},token:function(){return h()+"/protocol/openid-connect/token"},logout:function(){return h()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=h()+"/protocol/openid-connect/login-status-iframe.html";return i.iframeVersion&&(e=e+"?version="+i.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=h()+"/protocol/openid-connect/3p-cookies/step1.html";return i.iframeVersion&&(e=e+"?version="+i.iframeVersion),e},register:function(){return h()+"/protocol/openid-connect/registrations"},userinfo:function(){return h()+"/protocol/openid-connect/userinfo"}}}if(e?"string"==typeof e&&(s=e):s="keycloak.json",s){var o=new XMLHttpRequest;o.open("GET",s,!0),o.setRequestHeader("Accept","application/json"),o.onreadystatechange=function(){if(4==o.readyState)if(200==o.status||f(o)){var e=JSON.parse(o.responseText);i.authServerUrl=e["auth-server-url"],i.realm=e.realm,i.clientId=e.resource,r(null),n.setSuccess()}else n.setError()},o.send()}else{if(!e.clientId)throw"clientId missing";i.clientId=e.clientId;var a=e.oidcProvider;if(a)if("string"==typeof a){var s,l="/"==a.charAt(a.length-1)?a+".well-known/openid-configuration":a+"/.well-known/openid-configuration",o=new XMLHttpRequest;o.open("GET",l,!0),o.setRequestHeader("Accept","application/json"),o.onreadystatechange=function(){4==o.readyState&&(200==o.status||f(o)?(r(JSON.parse(o.responseText)),n.setSuccess()):n.setError())},o.send()}else r(a),n.setSuccess();else{if(!e.url){for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++)if(c[d].src.match(/.*keycloak\.js/)){e.url=c[d].src.substr(0,c[d].src.indexOf("/js/keycloak.js"));break}}if(!e.realm)throw"realm missing";i.authServerUrl=e.url,i.realm=e.realm,r(null),n.setSuccess()}}return n.promise}();function d(){var e=function(e){e||(n.prompt="none"),r&&r.locale&&(n.locale=r.locale),i.login(n).then(function(){s.setSuccess()}).catch(function(e){s.setError(e)})},t=function(){var e=document.createElement("iframe"),t=i.createLoginUrl({prompt:"none",redirectUri:i.silentCheckSsoRedirectUri});e.setAttribute("src",t),e.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),e.setAttribute("title","keycloak-silent-check-sso"),e.style.display="none",document.body.appendChild(e);var n=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(m(b(t.data),s),document.body.removeChild(e),window.removeEventListener("message",n))};window.addEventListener("message",n)},n={};switch(r.onLoad){case"check-sso":o.enable?v().then(function(){w().then(function(n){n?s.setSuccess():i.silentCheckSsoRedirectUri?t():e(!1)}).catch(function(e){s.setError(e)})}):i.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function u(){var e=b(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return v().then(function(){m(e,s)}).catch(function(e){s.setError(e)});r?r.token&&r.refreshToken?(p(r.token,r.refreshToken,r.idToken),o.enable?v().then(function(){w().then(function(e){e?(i.onAuthSuccess&&i.onAuthSuccess(),s.setSuccess(),x()):s.setSuccess()}).catch(function(e){s.setError(e)})}):i.updateToken(-1).then(function(){i.onAuthSuccess&&i.onAuthSuccess(),s.setSuccess()}).catch(function(e){i.onAuthError&&i.onAuthError(),r.onLoad?d():s.setError(e)})):r.onLoad?d():s.setSuccess():s.setSuccess()}return c.then(function(){var e,t;(e=y(),t=function(){("interactive"===document.readyState||"complete"===document.readyState)&&(document.removeEventListener("readystatechange",t),e.setSuccess())},document.addEventListener("readystatechange",t),t(),e.promise).then(F).then(u).catch(function(e){a.setError(e)})}),c.catch(function(e){a.setError(e)}),a.promise},i.login=function(e){return t.login(e)},i.createLoginUrl=function(e){var r,o=g(),a=g(),s=t.redirectUri(e),c={state:o,nonce:a,redirectUri:encodeURIComponent(s),loginOptions:e};e&&e.prompt&&(c.prompt=e.prompt),r=e&&"register"==e.action?i.endpoints.register():i.endpoints.authorize();var d=e&&e.scope||i.scope;d?-1===d.indexOf("openid")&&(d="openid "+d):d="openid";var h=r+"?client_id="+encodeURIComponent(i.clientId)+"&redirect_uri="+encodeURIComponent(s)+"&state="+encodeURIComponent(o)+"&response_mode="+encodeURIComponent(i.responseMode)+"&response_type="+encodeURIComponent(i.responseType)+"&scope="+encodeURIComponent(d);if(l&&(h=h+"&nonce="+encodeURIComponent(a)),e&&e.prompt&&(h+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(h+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(h+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(h+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(h+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(h+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr&&(h+="&claims="+encodeURIComponent(JSON.stringify({id_token:{acr:e.acr}}))),(e&&e.acrValues||i.acrValues)&&(h+="&acr_values="+encodeURIComponent(e.acrValues||i.acrValues)),i.pkceMethod){var m=u(96,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");c.pkceCodeVerifier=m,h+="&code_challenge="+function(e,t){if("S256"!==e)throw TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${e}'.`);return btoa(String.fromCodePoint(...new Uint8Array(iy.arrayBuffer(t)))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}(i.pkceMethod,m)+"&code_challenge_method="+i.pkceMethod}return n.add(c),h},i.logout=function(e){return t.logout(e)},i.createLogoutUrl=function(e){if("POST"===(e?.logoutMethod??i.logoutMethod))return i.endpoints.logout();var n=i.endpoints.logout()+"?client_id="+encodeURIComponent(i.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return i.idToken&&(n+="&id_token_hint="+encodeURIComponent(i.idToken)),n},i.register=function(e){return t.register(e)},i.createRegisterUrl=function(e){return e||(e={}),e.action="register",i.createLoginUrl(e)},i.createAccountUrl=function(e){var n=h(),r=void 0;return void 0!==n&&(r=n+"/account?referrer="+encodeURIComponent(i.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),r},i.accountManagement=function(){return t.accountManagement()},i.hasRealmRole=function(e){var t=i.realmAccess;return!!t&&t.roles.indexOf(e)>=0},i.hasResourceRole=function(e,t){if(!i.resourceAccess)return!1;var n=i.resourceAccess[t||i.clientId];return!!n&&n.roles.indexOf(e)>=0},i.loadUserProfile=function(){var e=h()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+i.token);var n=y();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(i.profile=JSON.parse(t.responseText),n.setSuccess(i.profile)):n.setError())},t.send(),n.promise},i.loadUserInfo=function(){var e=i.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+i.token);var n=y();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(i.userInfo=JSON.parse(t.responseText),n.setSuccess(i.userInfo)):n.setError())},t.send(),n.promise},i.isTokenExpired=function(e){if(!i.tokenParsed||!i.refreshToken&&"implicit"!=i.flow)throw"Not authenticated";if(null==i.timeSkew)return c("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=i.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+i.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},i.updateToken=function(e){var t=y();if(!i.refreshToken)return t.setError(),t.promise;e=e||5;var n=function(){var n=!1;if(-1==e?(n=!0,c("[KEYCLOAK] Refreshing token: forced refresh")):(!i.tokenParsed||i.isTokenExpired(e))&&(n=!0,c("[KEYCLOAK] Refreshing token: token expired")),n){var o="grant_type=refresh_token&refresh_token="+i.refreshToken,a=i.endpoints.token();if(r.push(t),1==r.length){var s=new XMLHttpRequest;s.open("POST",a,!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.withCredentials=!0,o+="&client_id="+encodeURIComponent(i.clientId);var l=new Date().getTime();s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status){c("[KEYCLOAK] Token refreshed"),l=(l+new Date().getTime())/2;var e=JSON.parse(s.responseText);p(e.access_token,e.refresh_token,e.id_token,l),i.onAuthRefreshSuccess&&i.onAuthRefreshSuccess();for(var t=r.pop();null!=t;t=r.pop())t.setSuccess(!0)}else{d("[KEYCLOAK] Failed to refresh token"),400==s.status&&i.clearToken(),i.onAuthRefreshError&&i.onAuthRefreshError();for(var t=r.pop();null!=t;t=r.pop())t.setError(!0)}},s.send(o)}}else t.setSuccess(!1)};return o.enable?w().then(function(){n()}).catch(function(e){t.setError(e)}):n(),t.promise},i.clearToken=function(){i.token&&(p(null,null,null),i.onAuthLogout&&i.onAuthLogout(),i.loginRequired&&i.login())};var E=function(){if(!(this instanceof E))return new E;function e(){for(var e=new Date().getTime(),t=0;t<localStorage.length;t++){var n=localStorage.key(t);if(n&&0==n.indexOf("kc-callback-")){var i=localStorage.getItem(n);if(i)try{var r=JSON.parse(i).expires;(!r||r<e)&&localStorage.removeItem(n)}catch(e){localStorage.removeItem(n)}}}}localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test"),this.get=function(t){if(t){var n="kc-callback-"+t,i=localStorage.getItem(n);return i&&(localStorage.removeItem(n),i=JSON.parse(i)),e(),i}},this.add=function(t){e();var n="kc-callback-"+t.state;t.expires=new Date().getTime()+36e5,localStorage.setItem(n,JSON.stringify(t))}},A=function(){if(!(this instanceof A))return new A;this.get=function(i){if(i){var r=t("kc-callback-"+i);if(n("kc-callback-"+i,"",e(-100)),r)return JSON.parse(r)}},this.add=function(t){n("kc-callback-"+t.state,JSON.stringify(t),e(60))},this.removeItem=function(t){n(t,"",e(-100))};var e=function(e){var t=new Date;return t.setTime(t.getTime()+60*e*1e3),t},t=function(e){for(var t=e+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){for(var r=n[i];" "==r.charAt(0);)r=r.substring(1);if(0==r.indexOf(t))return r.substring(t.length,r.length)}return""},n=function(e,t,n){var i=e+"="+t+"; expires="+n.toUTCString()+"; ";document.cookie=i}};function C(e){return function(){i.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}var iF=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})};let ik=e=>t=>class extends t{constructor(){super(...arguments),this._connectRequested=!1,this._status=sR.DISCONNECTED,this._statusCallback=e=>this._onEventProviderStatusChanged(e)}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this.connectEvents()}disconnectedCallback(){this.disconnectEvents(),super.disconnectedCallback&&super.disconnectedCallback()}connectEvents(){if(!e.getEventProvider())return void console.log("No event provider available so cannot subscribe");this._connectRequested||(this._connectRequested=!0,e.getEventProvider().subscribeStatusChange(this._statusCallback),this._doConnect())}disconnectEvents(){this._connectRequested&&(this._connectRequested=!1,e.getEventProvider().unsubscribeStatusChange(this._statusCallback),this._onEventsDisconnect())}_doConnect(){return iF(this,void 0,void 0,function*(){this.eventsConnected&&this._onEventsConnect()})}get eventsConnected(){return this._connectRequested&&e.getEventProvider().status===sR.CONNECTED}_onEventProviderStatusChanged(e){switch(e){case sR.DISCONNECTED:this._onEventsDisconnect();break;case sR.CONNECTED:this._doConnect()}}_onEventsConnect(){this._addEventSubscriptions(),this.onEventsConnect()}_onEventsDisconnect(){this._removeEventSubscriptions(),this.onEventsDisconnect()}_addEventSubscriptions(){return iF(this,void 0,void 0,function*(){let t=!!this._attributeRefs,n=!!this._assetIds,i=this._attributeRefs?this._attributeRefs:this._assetIds;if(i&&i.length>0){if(this._subscriptionIds=[],n){let t=yield e.getEventProvider().subscribeAssetEvents(i,!0,e=>this._onEvent(e)),n=this._attributeRefs?this._attributeRefs:this._assetIds;if(!this._subscriptionIds||!tK(i,n))return void e.getEventProvider().unsubscribe(t);this._subscriptionIds.push(t)}let r=yield e.getEventProvider().subscribeAttributeEvents(i,t,e=>this._onEvent(e)),o=this._attributeRefs?this._attributeRefs:this._assetIds;if(!this._subscriptionIds||!tK(i,o))return void e.getEventProvider().unsubscribe(r);this._subscriptionIds.push(r)}})}_removeEventSubscriptions(){this._subscriptionIds&&(this._subscriptionIds.forEach(t=>{e.getEventProvider().unsubscribe(t)}),this._subscriptionIds=void 0)}_refreshEventSubscriptions(){this._removeEventSubscriptions(),this._addEventSubscriptions()}set assetIds(e){tK(this._assetIds,e)||(this._assetIds=e,this._refreshEventSubscriptions(),this.requestUpdate("assetIds"))}get assetIds(){return this._assetIds}set attributeRefs(e){tK(this._attributeRefs,e)||(this._attributeRefs=e,this._refreshEventSubscriptions())}get attributeRefs(){return this._attributeRefs}_sendEvent(t){e.getEventProvider().sendEvent(t)}_sendEventWithReply(t){return e.getEventProvider().sendEventWithReply(t)}onEventsConnect(){}onEventsDisconnect(){}_onEvent(e){}},iE="#4d9d2a",iA="#FFFFFF",iC="#CCCCCC",iT="#FFFFFF",iS="#4c4c4c",iM="0 1px 3px 0 rgba(0,0,0,0.21)";var iL=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})};let iD="openremote";!function(e){e.MANAGER_FAILED_TO_LOAD="MANAGER_FAILED_TO_LOAD",e.AUTH_FAILED="AUTH_FAILED",e.AUTH_TYPE_UNSUPPORTED="AUTH_TYPE_UNSUPPORTED",e.CONSOLE_ERROR="CONSOLE_INIT_ERROR",e.EVENTS_CONNECTION_ERROR="EVENTS_CONNECTION_ERROR",e.TRANSLATION_ERROR="TRANSLATION_ERROR"}(sN||(sN={})),function(e){e.ERROR="ERROR",e.READY="READY",e.ONLINE="ONLINE",e.OFFLINE="OFFLINE",e.CONNECTING="CONNECTING",e.CONSOLE_INIT="CONSOLE_INIT",e.CONSOLE_READY="CONSOLE_READY",e.TRANSLATE_INIT="TRANSLATE_INIT",e.TRANSLATE_LANGUAGE_CHANGED="TRANSLATE_LANGUAGE_CHANGED",e.DISPLAY_REALM_CHANGED="DISPLAY_REALM_CHANGED"}(sB||(sB={}));class iI{constructor(){this._authenticated=!1,this._ready=!1,this._name="",this._username="",this._keycloakUpdateTokenInterval=void 0,this._managerVersion="",this._authServerUrl="",this._listeners=[],this._disconnected=!1}get username(){return this._username}get error(){return this._error}get authenticated(){return this._authenticated}get ready(){return this._ready}get config(){return this._config}get roles(){let e=new Map;return this._keycloak?this._keycloak.resourceAccess&&this._config.clientId&&this._keycloak.resourceAccess&&Object.entries(this._keycloak.resourceAccess).forEach(([t,n])=>{let i=n.roles;e.set(t,i)}):this._basicIdentity&&this._basicIdentity.roles&&e.set(this._config.clientId,this._basicIdentity.roles),e}get managerVersion(){return this._managerVersion}get isManagerAvailable(){return this._managerVersion&&""!==this._managerVersion}get managerUrl(){var e;return null==(e=this._config)?void 0:e.managerUrl}get keycloakUrl(){var e;return null==(e=this._config)?void 0:e.keycloakUrl}get isError(){return!!this._error}get connectionStatus(){return this._events&&this._events.status}get console(){return this._console}get consoleAppConfig(){return this._consoleAppConfig}get events(){return this._events}get rest(){return nq}get language(){return tB.language}set language(e){console.debug(`Changing language to ${e}.`),e&&(tB.changeLanguage(e),this.console.storeData("LANGUAGE",e),this.authenticated&&this.updateKeycloakUserLanguage(e).catch(e=>console.error(e)))}get displayRealm(){return this._displayRealm||this._config.realm}set displayRealm(e){this.isSuperUser()&&this._displayRealm!==e&&(this._displayRealm=e,this._emitEvent(sB.DISPLAY_REALM_CHANGED))}get clientId(){return this._config.clientId||iD}getEventProvider(){return this.events}get mapType(){return this._config.mapType||"VECTOR"}isManagerSameOrigin(){if(!this.ready)return!1;let e=new URL(this._config.managerUrl),t=window.location;return e.protocol===t.protocol&&e.hostname===t.hostname&&e.port===t.port}addListener(e){0>this._listeners.indexOf(e)&&this._listeners.push(e)}removeListener(e){let t=this._listeners.indexOf(e);t>=0&&this._listeners.splice(t,1)}init(e){return iL(this,void 0,void 0,function*(){let t;this._config&&console.debug("Already initialised"),this._config=((t=e?Object.assign({},e):{}).managerUrl&&""!==t.managerUrl?t.managerUrl=t.managerUrl.replace(/\/+$/,""):t.managerUrl=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")+window.location.pathname.replace(/\/[^/]+\/?$/,""),t.realm&&""!==t.realm||(t.realm="master"),t.auth||(t.auth="KEYCLOAK"),void 0===t.consoleAutoEnable&&(t.consoleAutoEnable=!0),void 0===t.applyConfigToAdmin&&(t.applyConfigToAdmin=!0),t.eventProviderType||(t.eventProviderType="WEBSOCKET"),(!t.pollingIntervalMillis||t.pollingIntervalMillis<5e3)&&(t.pollingIntervalMillis=1e4),void 0===t.loadIcons&&(t.loadIcons=!0),void 0===t.loadTranslations&&(t.loadTranslations=["or"]),void 0===t.translationsLoadPath&&(t.translationsLoadPath="locales/{{lng}}/{{ns}}.json"),void 0===t.loadDescriptors&&(t.loadDescriptors=!0),void 0===t.clientId&&(t.clientId=iD),t);let n=yield this.loadManagerInfo(),i=new t7(this._config.realm,this._config.consoleAutoEnable,()=>{this._emitEvent(sB.CONSOLE_READY)});if(this._console=i,"BASIC"===this._config.auth)n=(yield this.doTranslateInit())&&n,n=yield this.doAuthInit();else if("KEYCLOAK"===this._config.auth){if(!this._config.keycloakUrl&&this._authServerUrl){let e,t=new URL(this._config.managerUrl);this._authServerUrl.startsWith("//")&&(this._authServerUrl=t.protocol+this._authServerUrl);try{e=new URL(this._authServerUrl)}catch(n){(e=new URL(t)).pathname=this._authServerUrl}e.protocol||(e.protocol=t.protocol),e.hostname||(e.hostname=t.hostname),e.port||(e.port=t.port),this._config.keycloakUrl=e.toString()}this._config.keycloakUrl||(this._config.keycloakUrl=this._config.managerUrl+"/auth"),this._config.keycloakUrl=this._config.keycloakUrl.replace(/\/+$/,""),(n=yield this.doAuthInit())||this._config.skipFallbackToBasicAuth||(console.debug("Falling back to basic auth"),this._config.auth="BASIC",n=yield this.doAuthInit())}return!!n&&(n&&(n=this.doRestApiInit()),(yield this.doConsoleInit())&&this._clearWebHistory(),(n=(yield this.doTranslateInit())&&n)&&(n=yield this.doDescriptorsInit(),n=yield this.getConsoleAppConfig()),this.doIconInit(),n?(n=yield this.doEventsSubscriptionInit(),this._readyCallback&&(yield this._readyCallback()),this._ready=!0,this._emitEvent(sB.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",n)})}loadManagerInfo(){return iL(this,void 0,void 0,function*(){try{let e=yield new Promise((e,t)=>{let n=new XMLHttpRequest;n.addEventListener("load",()=>{e(JSON.parse(n.responseText))}),n.addEventListener("error",()=>{t(Error("Failed to contact the manager"))}),n.open("GET",this._config.managerUrl+"/api/master/info"),n.send()});return this._managerVersion=e&&e.version?e.version:"",this._authServerUrl=e&&e.authServerUrl?e.authServerUrl:"",!0}catch(e){return console.error("Failed to contact the manager",e),this._setError(sN.MANAGER_FAILED_TO_LOAD),!1}})}doTranslateInit(){return iL(this,void 0,void 0,function*(){if(tB.isInitialized)return!0;tB.on("initialized",e=>{this._emitEvent(sB.TRANSLATE_INIT)}),tB.on("languageChanged",e=>{tW().locale(e),this._emitEvent(sB.TRANSLATE_LANGUAGE_CHANGED)});let e={lng:(yield this.getConsolePreferredLanguage())||(yield this.getUserPreferredLanguage())||this.config.defaultLanguage||"en",fallbackLng:"en",defaultNS:"app",fallbackNS:"or",ns:this.config.loadTranslations,interpolation:{format:(e,t,n)=>"uppercase"===t?e.toUpperCase():e instanceof Date?tW()(e).format(t):e},backend:{loadPath:(e,t)=>1===t.length&&"or"===t[0]?this.config.managerUrl+"/shared/locales/{{lng}}/{{ns}}.json":this.config.translationsLoadPath?this.config.translationsLoadPath:"locales/{{lng}}/{{ns}}.json"}};this.config.configureTranslationsOptions&&this.config.configureTranslationsOptions(e);try{yield tB.use(il).init(e)}catch(e){return console.error(e),this._setError(sN.TRANSLATION_ERROR),!1}return!0})}doDescriptorsInit(){return iL(this,void 0,void 0,function*(){if(!this.config.loadDescriptors)return!0;try{let e=yield nq.api.AssetModelResource.getAssetInfos(),t=yield nq.api.AssetModelResource.getMetaItemDescriptors(),n=yield nq.api.AssetModelResource.getValueDescriptors();tY._assetTypeInfos=e.data,tY._metaItemDescriptors=Object.values(t.data),tY._valueDescriptors=Object.values(n.data)}catch(e){return console.error(e),!1}return!0})}doAuthInit(){return iL(this,void 0,void 0,function*(){let e=!0;switch(this._config.auth){case"BASIC":e=yield this.initialiseBasicAuth();break;case"KEYCLOAK":e=yield this.loadAndInitialiseKeycloak();break;case"NONE":return!0;default:return this._setError(sN.AUTH_TYPE_UNSUPPORTED),!1}return!!e&&(nq.addRequestInterceptor(e=>{if(!e.headers.Authorization){let t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e}),e)})}doRestApiInit(){return nq.setTimeout(2e4),nq.initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return iL(this,void 0,void 0,function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new n1(this._config.managerUrl),this._events.subscribeStatusChange(e=>this._onEventProviderStatusChanged(e)),e=yield this._events.connect()),e||this._setError(sN.EVENTS_CONNECTION_ERROR),e})}_connectEvents(){var e;(null==(e=this.events)?void 0:e.status)===sR.DISCONNECTED?this.events.connect().catch(e=>{console.error("Failed to connect EventProvider."),console.error(e)}):console.warn("Tried to connect EventProvider, but it wasn't disconnected!")}_onEventProviderStatusChanged(e){switch(e){case sR.DISCONNECTED:this._onDisconnect();break;case sR.CONNECTED:break;case sR.CONNECTING:this._emitEvent(sB.CONNECTING)}}doConsoleInit(){return iL(this,void 0,void 0,function*(){try{return yield this.console.initialise(),this._emitEvent(sB.CONSOLE_INIT),!0}catch(e){return this._setError(sN.CONSOLE_ERROR),!1}})}doIconInit(){var e,t,n;this._config.loadIcons&&(ib.addIconSet("mdi",(e=iR.managerUrl,{getIconTemplate:e=>K`<span style="font-family: 'Material Design Icons';" class="mdi-${e}"></span>`,onAdd(){let t=document.createElement("style");t.id="mdiFontStyle",t.textContent='@font-face {\n font-family: "Material Design Icons";\n src: url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.eot");\n src: url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.eot") format("embedded-opentype"), url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff2") format("woff2"), url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff") format("woff"), url("'+e+'/shared/fonts/Material Design Icons//fonts/materialdesignicons-webfont.ttf") format("truetype");\n font-weight: normal;\n font-style: normal;\n}',document.head.appendChild(t)}})),ib.addIconSet("or",(t=ih.size,n=ih.icons,{getIconTemplate:e=>{let i=n[e];return i?K`
|
|
112
112
|
<svg xmlns="http://www.w3.org/2000/svg"
|
|
113
113
|
viewBox="0 0 ${t} ${t}" preserveAspectRatio="xMidYMid meet" focusable="false">
|
|
114
|
-
${
|
|
114
|
+
${iu(i.startsWith("<")?i:'<path xmlns="http://www.w3.org/2000/svg" d="'+i+'" />')}
|
|
115
115
|
</svg>
|
|
116
|
-
`:K``},onAdd:void 0})))}getConsoleAppConfig(){return iS(this,void 0,void 0,function*(){var e;try{let t=yield fetch((null!=(e=iD.managerUrl)?e:"")+"/consoleappconfig/"+iD.displayRealm+".json");return this._consoleAppConfig=yield t.json(),!0}catch(e){return!0}})}getConsolePreferredLanguage(){return iS(this,arguments,void 0,function*(e=this.console){return e.retrieveData("LANGUAGE")})}getUserPreferredLanguage(){return iS(this,arguments,void 0,function*(e=this._keycloak){if(e&&e.authenticated){let t=(null==e?void 0:e.profile)||(yield null==e?void 0:e.loadUserProfile());if(null==t?void 0:t.attributes){let e=new Map(Object.entries(t.attributes));if(e.has("locale")){let t=e.get("locale");if("string"==typeof t[0])return t[0]}console.warn("Could not get user language from keycloak: no user attributes were found.")}else console.warn("Could not get user language from keycloak: no valid keycloak user profile was found.")}})}updateKeycloakUserLanguage(e){return iS(this,arguments,void 0,function*(e,t=this.rest){return this.authenticated?t?void(yield t.api.UserResource.updateCurrentUserLocale(e,{headers:{"Content-Type":"application/json"}})):void console.warn("Tried updating user language, but the REST API is not initialized yet."):void console.warn("Tried updating user language, but the user is not authenticated.")})}logout(e){this._authenticated&&(this._authenticated=!0,this._keycloak?(this.isMobile()&&this.console.storeData("REFRESH_TOKEN",null),this._keycloakUpdateTokenInterval&&(window.clearTimeout(this._keycloakUpdateTokenInterval),this._keycloakUpdateTokenInterval=void 0),this._keycloak.logout(e&&""!==e?{redirectUri:e}:void 0)):this._basicIdentity&&(this._basicIdentity=void 0,e?window.location.href=e:window.location.reload()))}login(e){switch(this._config.auth){case"BASIC":e&&e.credentials&&(this._config.credentials=Object.assign({},e.credentials)),this.doBasicLogin();break;case"KEYCLOAK":if(this._keycloak){let t={};e&&e.redirectUrl&&""!==e.redirectUrl&&(t.redirectUri=e.redirectUrl),(null==e?void 0:e.action)&&""!==e.action&&(t.action=e.action),this.isMobile()&&(t.scope="offline_access"),this._keycloak.login(t)}}}initialiseBasicAuth(){return iS(this,void 0,void 0,function*(){return this.config.basicLoginProvider?(this.config.autoLogin&&(this._readyCallback=()=>this.doBasicLogin()),!0):(console.debug("No basicLoginProvider defined on config so cannot display login UI"),!1)})}doBasicLogin(){return iS(this,void 0,void 0,function*(){var e,t,n,i;if(!this.config.basicLoginProvider)return;let r={username:(null==(e=this.config.credentials)?void 0:e.username)?null==(t=this.config.credentials)?void 0:t.username:"",password:(null==(n=this.config.credentials)?void 0:n.password)?null==(i=this.config.credentials)?void 0:i.password:"",cancel:!1},o=!1;for(this._basicIdentity={roles:void 0,token:void 0,user:void 0};!o;){if((r=yield this.config.basicLoginProvider(r.username,r.password)).cancel){console.debug("Basic authentication cancelled by user");break}if(!r.username||!r.password)continue;this._basicIdentity.token=btoa(r.username+":"+r.password);let e=!1;try{let t=yield nW.api.UserResource.getCurrent();200===t.status&&(e=!0,this._basicIdentity.user=t.data),e||401!==t.status&&403!==t.status||console.debug("Basic authentication invalid credentials, trying again")}catch(e){console.error("Basic auth failed: ",e)}if(e){console.debug("Basic authentication successful"),o=!0;let e=yield nW.api.UserResource.getCurrentUserClientRoles(this.clientId);this._basicIdentity.roles=e.data}else{console.debug("Unknown response so aborting"),this._basicIdentity=void 0;break}}o&&this._onAuthenticated()})}isSuperUser(){return!!(this.getRealm()&&"master"===this.getRealm()&&this.hasRealmRole("admin"))}isRestrictedUser(){return!!this.hasRealmRole("restricted_user")}getApiBaseUrl(){return this._config.managerUrl+"/api/"+this._config.realm+"/"}getAppName(){let e=location.pathname.split("/");return e.length>=1?e[1]:""}hasRealmRole(e){return this.isKeycloak()&&this._keycloak.hasRealmRole(e)}hasRole(e,t=this._config.clientId){let n=this.roles;return n&&n.has(t)&&n.get(t).indexOf(e)>=0}getAuthorizationHeader(){return this.getKeycloakToken()?"Bearer "+this.getKeycloakToken():this.getBasicToken()?"Basic "+this.getBasicToken():void 0}getKeycloakToken(){if(this.isKeycloak())return this._keycloak.token}getBasicToken(){return this._basicIdentity?this._basicIdentity.token:void 0}getRealm(){if(this._config)return this._config.realm}isMobile(){return this.console&&this.console.isMobile}isKeycloak(){return!!this._keycloak}_onAuthenticated(){this._authenticated=!0}loadAndInitialiseKeycloak(){return iS(this,void 0,void 0,function*(){var e,t,n,i;try{this._keycloak=new iv({clientId:this._config.clientId,realm:this._config.realm,url:this._config.keycloakUrl});let r=yield this._getNativeOfflineRefreshToken(),o=yield this._keycloak.init({checkLoginIframe:!1,onLoad:"check-sso"});if(!o&&r)try{console.error("SETTING OFFLINE TOKEN"),this._keycloak.refreshToken=r,o=yield this._updateKeycloakAccessToken()}catch(e){console.error("Failed to authenticate using offline token")}if(o)this._name=null==(e=this._keycloak.tokenParsed)?void 0:e.name,this._username=null==(t=this._keycloak.tokenParsed)?void 0:t.preferred_username,this._createTokenUpdateInterval(),this.isMobile()&&(null==(i=null==(n=this._keycloak)?void 0:n.refreshTokenParsed)?void 0:i.typ)==="Offline"&&(console.debug("Storing offline refresh token"),this.console.storeData("REFRESH_TOKEN",this._keycloak.refreshToken)),this._onAuthenticated();else if(this.config.autoLogin)return this.login(),!1;return!0}catch(e){return this._authenticated=!1,this._setError(sR.AUTH_FAILED),console.error("Failed to initialise Keycloak: "+e),!1}})}_createTokenUpdateInterval(){this._keycloakUpdateTokenInterval||(this._keycloakUpdateTokenInterval=window.setInterval(()=>iS(this,void 0,void 0,function*(){yield this._updateKeycloakAccessToken().catch(()=>{console.debug("Keycloak failed to refresh the access token"),this._onDisconnect()})}),1e4))}_updateKeycloakAccessToken(){return iS(this,void 0,void 0,function*(){let e=yield this._keycloak.updateToken(20);return console.debug("Access token update success, refreshed from server: "+e),e&&this._onAuthenticated(),e})}_getNativeOfflineRefreshToken(){return iS(this,void 0,void 0,function*(){if(this.isMobile())return yield this.console.retrieveData("REFRESH_TOKEN")})}_emitEvent(e){window.setTimeout(()=>{for(let t of this._listeners)t(e)},0)}_setError(e){this._error=e,this._emitEvent(sO.ERROR),console.warn("Error set: "+e)}_clearWebHistory(){var e;null==(e=this.console)||e._doSendGenericMessage("CLEAR_WEB_HISTORY",void 0)}_onDisconnect(){return iS(this,void 0,void 0,function*(){this._disconnected||(console.debug("Disconnected"),this._disconnected=!0,this._keycloakUpdateTokenInterval&&(window.clearTimeout(this._keycloakUpdateTokenInterval),this._keycloakUpdateTokenInterval=void 0),this._emitEvent(sO.OFFLINE),this.reconnect())})}_onReconnected(){console.debug("Reconnected"),this._disconnected=!1,this._createTokenUpdateInterval(),this._emitEvent(sO.ONLINE)}reconnect(){return iS(this,arguments,void 0,function*(e=3e3){if(!this._disconnected)return;this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=void 0);let t=()=>iS(this,void 0,void 0,function*(){var e;if(console.debug("Attempting reconnect"),!(yield this.isKeycloakReachable()))return console.debug("Keycloak is unreachable"),!1;console.debug("Keycloak is reachable"),console.debug("Checking keycloak access token");try{yield this._updateKeycloakAccessToken()}catch(t){let e=yield this._getNativeOfflineRefreshToken();this._keycloak.refreshToken=e;try{yield this._updateKeycloakAccessToken()}catch(e){console.debug("Cannot update access token so sending to login"),this.login();return}return console.debug("Keycloak access token is valid"),!0}let t=this.events&&this.events.status===sM.CONNECTING;return console.debug("If event provider offline then attempting reconnect: offline="+t),!t||(yield null==(e=this.events)?void 0:e.connect())}),n=yield t();if(void 0!==n){if(!n){console.debug("Scheduling another reconnect attempt in (ms): "+(e=Math.min(iL.MAX_RECONNECT_DELAY,e+3e3))),this._reconnectTimer=window.setTimeout(()=>this.reconnect(e),e);return}this._onReconnected()}})}isKeycloakReachable(){return iS(this,arguments,void 0,function*(e=2e3){let t=new AbortController,n=setTimeout(()=>t.abort(),e);try{let e=this._keycloak.endpoints.token(),n=yield fetch(e,{method:"OPTIONS",signal:t.signal});return 200===n.status}catch(e){return!1}finally{clearTimeout(n)}})}}iL.MAX_RECONNECT_DELAY=45e3;let iD=new iL,iI=iD,iR=eF(class extends ek{constructor(e){if(super(e),e.type!==ew.ATTRIBUTE||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){if(void 0===this.st){for(let n in this.st=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(e=>""!==e))),t)t[n]&&!this.nt?.has(n)&&this.st.add(n);return this.render(t)}let n=e.element.classList;for(let e of this.st)e in t||(n.remove(e),this.st.delete(e));for(let e in t){let i=!!t[e];i===this.st.has(e)||this.nt?.has(e)||(i?(n.add(e),this.st.add(e)):(n.remove(e),this.st.delete(e)))}return X}});var iO=function(e,t){return(iO=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function iP(e,t){function n(){this.constructor=e}iO(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i$=function(){return(i$=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function iN(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function iB(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}(arguments[t]));return e}var iz=function(){function e(e){void 0===e&&(e={}),this.adapter=e}return Object.defineProperty(e,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),e.prototype.init=function(){},e.prototype.destroy=function(){},e}(),ij=function(){function e(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.root=e,this.initialize.apply(this,iB(n)),this.foundation=void 0===t?this.getDefaultFoundation():t,this.foundation.init(),this.initialSyncWithDOM()}return e.attachTo=function(t){return new e(t,new iz({}))},e.prototype.initialize=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.getDefaultFoundation=function(){throw Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},e.prototype.initialSyncWithDOM=function(){},e.prototype.destroy=function(){this.foundation.destroy()},e.prototype.listen=function(e,t,n){this.root.addEventListener(e,t,n)},e.prototype.unlisten=function(e,t,n){this.root.removeEventListener(e,t,n)},e.prototype.emit=function(e,t,n){var i;void 0===n&&(n=!1),"function"==typeof CustomEvent?i=new CustomEvent(e,{bubbles:n,detail:t}):(i=document.createEvent("CustomEvent")).initCustomEvent(e,n,!1,t),this.root.dispatchEvent(i)},e}();function iY(e){return void 0===e&&(e=window),!!function(e){void 0===e&&(e=window);var t=!1;try{var n={get passive(){return t=!0,!1}},i=function(){};e.document.addEventListener("test",i,n),e.document.removeEventListener("test",i,n)}catch(e){t=!1}return t}(e)&&{passive:!0}}function iH(e,t){if(e.closest)return e.closest(t);for(var n=e;n;){if(iU(n,t))return n;n=n.parentElement}return null}function iU(e,t){return(e.matches||e.webkitMatchesSelector||e.msMatchesSelector).call(e,t)}var iV={LABEL_FLOAT_ABOVE:"mdc-floating-label--float-above",LABEL_REQUIRED:"mdc-floating-label--required",LABEL_SHAKE:"mdc-floating-label--shake",ROOT:"mdc-floating-label"},iW=function(e){function t(n){var i=e.call(this,i$(i$({},t.defaultAdapter),n))||this;return i.shakeAnimationEndHandler_=function(){return i.handleShakeAnimationEnd_()},i}return iP(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return iV},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},getWidth:function(){return 0},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){this.adapter.registerInteractionHandler("animationend",this.shakeAnimationEndHandler_)},t.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("animationend",this.shakeAnimationEndHandler_)},t.prototype.getWidth=function(){return this.adapter.getWidth()},t.prototype.shake=function(e){var n=t.cssClasses.LABEL_SHAKE;e?this.adapter.addClass(n):this.adapter.removeClass(n)},t.prototype.float=function(e){var n=t.cssClasses,i=n.LABEL_FLOAT_ABOVE,r=n.LABEL_SHAKE;e?this.adapter.addClass(i):(this.adapter.removeClass(i),this.adapter.removeClass(r))},t.prototype.setRequired=function(e){var n=t.cssClasses.LABEL_REQUIRED;e?this.adapter.addClass(n):this.adapter.removeClass(n)},t.prototype.handleShakeAnimationEnd_=function(){var e=t.cssClasses.LABEL_SHAKE;this.adapter.removeClass(e)},t}(iz),iG=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iP(t,e),t.attachTo=function(e){return new t(e)},t.prototype.shake=function(e){this.foundation.shake(e)},t.prototype.float=function(e){this.foundation.float(e)},t.prototype.setRequired=function(e){this.foundation.setRequired(e)},t.prototype.getWidth=function(){return this.foundation.getWidth()},t.prototype.getDefaultFoundation=function(){var e=this;return new iW({addClass:function(t){return e.root.classList.add(t)},removeClass:function(t){return e.root.classList.remove(t)},getWidth:function(){var t=e.root;if(null!==t.offsetParent)return t.scrollWidth;var n=t.cloneNode(!0);n.style.setProperty("position","absolute"),n.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(n);var i=n.scrollWidth;return document.documentElement.removeChild(n),i},registerInteractionHandler:function(t,n){return e.listen(t,n)},deregisterInteractionHandler:function(t,n){return e.unlisten(t,n)}})},t}(ij),iq={LINE_RIPPLE_ACTIVE:"mdc-line-ripple--active",LINE_RIPPLE_DEACTIVATING:"mdc-line-ripple--deactivating"},iK=function(e){function t(n){var i=e.call(this,i$(i$({},t.defaultAdapter),n))||this;return i.transitionEndHandler_=function(e){return i.handleTransitionEnd(e)},i}return iP(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return iq},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setStyle:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){this.adapter.registerEventHandler("transitionend",this.transitionEndHandler_)},t.prototype.destroy=function(){this.adapter.deregisterEventHandler("transitionend",this.transitionEndHandler_)},t.prototype.activate=function(){this.adapter.removeClass(iq.LINE_RIPPLE_DEACTIVATING),this.adapter.addClass(iq.LINE_RIPPLE_ACTIVE)},t.prototype.setRippleCenter=function(e){this.adapter.setStyle("transform-origin",e+"px center")},t.prototype.deactivate=function(){this.adapter.addClass(iq.LINE_RIPPLE_DEACTIVATING)},t.prototype.handleTransitionEnd=function(e){var t=this.adapter.hasClass(iq.LINE_RIPPLE_DEACTIVATING);"opacity"===e.propertyName&&t&&(this.adapter.removeClass(iq.LINE_RIPPLE_ACTIVE),this.adapter.removeClass(iq.LINE_RIPPLE_DEACTIVATING))},t}(iz),iX=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iP(t,e),t.attachTo=function(e){return new t(e)},t.prototype.activate=function(){this.foundation.activate()},t.prototype.deactivate=function(){this.foundation.deactivate()},t.prototype.setRippleCenter=function(e){this.foundation.setRippleCenter(e)},t.prototype.getDefaultFoundation=function(){var e=this;return new iK({addClass:function(t){return e.root.classList.add(t)},removeClass:function(t){return e.root.classList.remove(t)},hasClass:function(t){return e.root.classList.contains(t)},setStyle:function(t,n){return e.root.style.setProperty(t,n)},registerEventHandler:function(t,n){return e.listen(t,n)},deregisterEventHandler:function(t,n){return e.unlisten(t,n)}})},t}(ij),iZ={NOTCH_ELEMENT_SELECTOR:".mdc-notched-outline__notch"},iJ={NOTCH_ELEMENT_PADDING:8},iQ={NO_LABEL:"mdc-notched-outline--no-label",OUTLINE_NOTCHED:"mdc-notched-outline--notched",OUTLINE_UPGRADED:"mdc-notched-outline--upgraded"},i0=function(e){function t(n){return e.call(this,i$(i$({},t.defaultAdapter),n))||this}return iP(t,e),Object.defineProperty(t,"strings",{get:function(){return iZ},enumerable:!0,configurable:!0}),Object.defineProperty(t,"cssClasses",{get:function(){return iQ},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return iJ},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNotchWidthProperty:function(){},removeNotchWidthProperty:function(){}}},enumerable:!0,configurable:!0}),t.prototype.notch=function(e){var n=t.cssClasses.OUTLINE_NOTCHED;e>0&&(e+=iJ.NOTCH_ELEMENT_PADDING),this.adapter.setNotchWidthProperty(e),this.adapter.addClass(n)},t.prototype.closeNotch=function(){var e=t.cssClasses.OUTLINE_NOTCHED;this.adapter.removeClass(e),this.adapter.removeNotchWidthProperty()},t}(iz),i1=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iP(t,e),t.attachTo=function(e){return new t(e)},t.prototype.initialSyncWithDOM=function(){this.notchElement_=this.root.querySelector(iZ.NOTCH_ELEMENT_SELECTOR);var e=this.root.querySelector("."+iW.cssClasses.ROOT);e?(e.style.transitionDuration="0s",this.root.classList.add(iQ.OUTLINE_UPGRADED),requestAnimationFrame(function(){e.style.transitionDuration=""})):this.root.classList.add(iQ.NO_LABEL)},t.prototype.notch=function(e){this.foundation.notch(e)},t.prototype.closeNotch=function(){this.foundation.closeNotch()},t.prototype.getDefaultFoundation=function(){var e=this;return new i0({addClass:function(t){return e.root.classList.add(t)},removeClass:function(t){return e.root.classList.remove(t)},setNotchWidthProperty:function(t){return e.notchElement_.style.setProperty("width",t+"px")},removeNotchWidthProperty:function(){return e.notchElement_.style.removeProperty("width")}})},t}(ij),i2={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},i5={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},i3={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300},i4=["touchstart","pointerdown","mousedown","keydown"],i6=["touchend","pointerup","mouseup","contextmenu"],i8=[],i7=function(e){function t(n){var i=e.call(this,i$(i$({},t.defaultAdapter),n))||this;return i.activationAnimationHasEnded_=!1,i.activationTimer_=0,i.fgDeactivationRemovalTimer_=0,i.fgScale_="0",i.frame_={width:0,height:0},i.initialSize_=0,i.layoutFrame_=0,i.maxRadius_=0,i.unboundedCoords_={left:0,top:0},i.activationState_=i.defaultActivationState_(),i.activationTimerCallback_=function(){i.activationAnimationHasEnded_=!0,i.runDeactivationUXLogicIfReady_()},i.activateHandler_=function(e){return i.activate_(e)},i.deactivateHandler_=function(){return i.deactivate_()},i.focusHandler_=function(){return i.handleFocus()},i.blurHandler_=function(){return i.handleBlur()},i.resizeHandler_=function(){return i.layout()},i}return iP(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return i2},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return i5},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return i3},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){var e=this,n=this.supportsPressRipple_();if(this.registerRootHandlers_(n),n){var i=t.cssClasses,r=i.ROOT,o=i.UNBOUNDED;requestAnimationFrame(function(){e.adapter.addClass(r),e.adapter.isUnbounded()&&(e.adapter.addClass(o),e.layoutInternal_())})}},t.prototype.destroy=function(){var e=this;if(this.supportsPressRipple_()){this.activationTimer_&&(clearTimeout(this.activationTimer_),this.activationTimer_=0,this.adapter.removeClass(t.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer_&&(clearTimeout(this.fgDeactivationRemovalTimer_),this.fgDeactivationRemovalTimer_=0,this.adapter.removeClass(t.cssClasses.FG_DEACTIVATION));var n=t.cssClasses,i=n.ROOT,r=n.UNBOUNDED;requestAnimationFrame(function(){e.adapter.removeClass(i),e.adapter.removeClass(r),e.removeCssVars_()})}this.deregisterRootHandlers_(),this.deregisterDeactivationHandlers_()},t.prototype.activate=function(e){this.activate_(e)},t.prototype.deactivate=function(){this.deactivate_()},t.prototype.layout=function(){var e=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame(function(){e.layoutInternal_(),e.layoutFrame_=0})},t.prototype.setUnbounded=function(e){var n=t.cssClasses.UNBOUNDED;e?this.adapter.addClass(n):this.adapter.removeClass(n)},t.prototype.handleFocus=function(){var e=this;requestAnimationFrame(function(){return e.adapter.addClass(t.cssClasses.BG_FOCUSED)})},t.prototype.handleBlur=function(){var e=this;requestAnimationFrame(function(){return e.adapter.removeClass(t.cssClasses.BG_FOCUSED)})},t.prototype.supportsPressRipple_=function(){return this.adapter.browserSupportsCssVars()},t.prototype.defaultActivationState_=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},t.prototype.registerRootHandlers_=function(e){var t=this;e&&(i4.forEach(function(e){t.adapter.registerInteractionHandler(e,t.activateHandler_)}),this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler_)),this.adapter.registerInteractionHandler("focus",this.focusHandler_),this.adapter.registerInteractionHandler("blur",this.blurHandler_)},t.prototype.registerDeactivationHandlers_=function(e){var t=this;"keydown"===e.type?this.adapter.registerInteractionHandler("keyup",this.deactivateHandler_):i6.forEach(function(e){t.adapter.registerDocumentInteractionHandler(e,t.deactivateHandler_)})},t.prototype.deregisterRootHandlers_=function(){var e=this;i4.forEach(function(t){e.adapter.deregisterInteractionHandler(t,e.activateHandler_)}),this.adapter.deregisterInteractionHandler("focus",this.focusHandler_),this.adapter.deregisterInteractionHandler("blur",this.blurHandler_),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler_)},t.prototype.deregisterDeactivationHandlers_=function(){var e=this;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler_),i6.forEach(function(t){e.adapter.deregisterDocumentInteractionHandler(t,e.deactivateHandler_)})},t.prototype.removeCssVars_=function(){var e=this,n=t.strings;Object.keys(n).forEach(function(t){0===t.indexOf("VAR_")&&e.adapter.updateCssVariable(n[t],null)})},t.prototype.activate_=function(e){var t=this;if(!this.adapter.isSurfaceDisabled()){var n=this.activationState_;if(!n.isActivated){var i=this.previousActivationEvent_;if(!(i&&void 0!==e&&i.type!==e.type)){if(n.isActivated=!0,n.isProgrammatic=void 0===e,n.activationEvent=e,n.wasActivatedByPointer=!n.isProgrammatic&&void 0!==e&&("mousedown"===e.type||"touchstart"===e.type||"pointerdown"===e.type),void 0!==e&&i8.length>0&&i8.some(function(e){return t.adapter.containsEventTarget(e)}))return void this.resetActivationState_();void 0!==e&&(i8.push(e.target),this.registerDeactivationHandlers_(e)),n.wasElementMadeActive=this.checkElementMadeActive_(e),n.wasElementMadeActive&&this.animateActivation_(),requestAnimationFrame(function(){i8=[],!n.wasElementMadeActive&&void 0!==e&&(" "===e.key||32===e.keyCode)&&(n.wasElementMadeActive=t.checkElementMadeActive_(e),n.wasElementMadeActive&&t.animateActivation_()),n.wasElementMadeActive||(t.activationState_=t.defaultActivationState_())})}}}},t.prototype.checkElementMadeActive_=function(e){return void 0===e||"keydown"!==e.type||this.adapter.isSurfaceActive()},t.prototype.animateActivation_=function(){var e=this,n=t.strings,i=n.VAR_FG_TRANSLATE_START,r=n.VAR_FG_TRANSLATE_END,o=t.cssClasses,a=o.FG_DEACTIVATION,s=o.FG_ACTIVATION,l=t.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal_();var c="",d="";if(!this.adapter.isUnbounded()){var u=this.getFgTranslationCoordinates_(),h=u.startPoint,m=u.endPoint;c=h.x+"px, "+h.y+"px",d=m.x+"px, "+m.y+"px"}this.adapter.updateCssVariable(i,c),this.adapter.updateCssVariable(r,d),clearTimeout(this.activationTimer_),clearTimeout(this.fgDeactivationRemovalTimer_),this.rmBoundedActivationClasses_(),this.adapter.removeClass(a),this.adapter.computeBoundingRect(),this.adapter.addClass(s),this.activationTimer_=setTimeout(function(){return e.activationTimerCallback_()},l)},t.prototype.getFgTranslationCoordinates_=function(){var e,t=this.activationState_,n=t.activationEvent;return{startPoint:e={x:(e=t.wasActivatedByPointer?function(e,t,n){if(!e)return{x:0,y:0};var i,r,o=t.x,a=t.y,s=o+n.left,l=a+n.top;return"touchstart"===e.type?(i=e.changedTouches[0].pageX-s,r=e.changedTouches[0].pageY-l):(i=e.pageX-s,r=e.pageY-l),{x:i,y:r}}(n,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):{x:this.frame_.width/2,y:this.frame_.height/2}).x-this.initialSize_/2,y:e.y-this.initialSize_/2},endPoint:{x:this.frame_.width/2-this.initialSize_/2,y:this.frame_.height/2-this.initialSize_/2}}},t.prototype.runDeactivationUXLogicIfReady_=function(){var e=this,n=t.cssClasses.FG_DEACTIVATION,i=this.activationState_,r=i.hasDeactivationUXRun,o=i.isActivated;(r||!o)&&this.activationAnimationHasEnded_&&(this.rmBoundedActivationClasses_(),this.adapter.addClass(n),this.fgDeactivationRemovalTimer_=setTimeout(function(){e.adapter.removeClass(n)},i3.FG_DEACTIVATION_MS))},t.prototype.rmBoundedActivationClasses_=function(){var e=t.cssClasses.FG_ACTIVATION;this.adapter.removeClass(e),this.activationAnimationHasEnded_=!1,this.adapter.computeBoundingRect()},t.prototype.resetActivationState_=function(){var e=this;this.previousActivationEvent_=this.activationState_.activationEvent,this.activationState_=this.defaultActivationState_(),setTimeout(function(){return e.previousActivationEvent_=void 0},t.numbers.TAP_DELAY_MS)},t.prototype.deactivate_=function(){var e=this,t=this.activationState_;if(t.isActivated){var n=i$({},t);t.isProgrammatic?(requestAnimationFrame(function(){return e.animateDeactivation_(n)}),this.resetActivationState_()):(this.deregisterDeactivationHandlers_(),requestAnimationFrame(function(){e.activationState_.hasDeactivationUXRun=!0,e.animateDeactivation_(n),e.resetActivationState_()}))}},t.prototype.animateDeactivation_=function(e){var t=e.wasActivatedByPointer,n=e.wasElementMadeActive;(t||n)&&this.runDeactivationUXLogicIfReady_()},t.prototype.layoutInternal_=function(){this.frame_=this.adapter.computeBoundingRect();var e=Math.max(this.frame_.height,this.frame_.width);this.maxRadius_=this.adapter.isUnbounded()?e:Math.sqrt(Math.pow(this.frame_.width,2)+Math.pow(this.frame_.height,2))+t.numbers.PADDING;var n=Math.floor(e*t.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&n%2!=0?this.initialSize_=n-1:this.initialSize_=n,this.fgScale_=""+this.maxRadius_/this.initialSize_,this.updateLayoutCssVars_()},t.prototype.updateLayoutCssVars_=function(){var e=t.strings,n=e.VAR_FG_SIZE,i=e.VAR_LEFT,r=e.VAR_TOP,o=e.VAR_FG_SCALE;this.adapter.updateCssVariable(n,this.initialSize_+"px"),this.adapter.updateCssVariable(o,this.fgScale_),this.adapter.isUnbounded()&&(this.unboundedCoords_={left:Math.round(this.frame_.width/2-this.initialSize_/2),top:Math.round(this.frame_.height/2-this.initialSize_/2)},this.adapter.updateCssVariable(i,this.unboundedCoords_.left+"px"),this.adapter.updateCssVariable(r,this.unboundedCoords_.top+"px"))},t}(iz),i9=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.disabled=!1,t}return iP(t,e),t.attachTo=function(e,n){void 0===n&&(n={isUnbounded:void 0});var i=new t(e);return void 0!==n.isUnbounded&&(i.unbounded=n.isUnbounded),i},t.createAdapter=function(e){return{addClass:function(t){return e.root.classList.add(t)},browserSupportsCssVars:function(){return function(e,t){void 0===t&&(t=!1);var n=e.CSS,i=sP;if("boolean"==typeof sP&&!t)return sP;if(!(n&&"function"==typeof n.supports))return!1;var r=n.supports("--css-vars","yes"),o=n.supports("(--css-vars: yes)")&&n.supports("color","#00000000");return i=r||o,t||(sP=i),i}(window)},computeBoundingRect:function(){return e.root.getBoundingClientRect()},containsEventTarget:function(t){return e.root.contains(t)},deregisterDocumentInteractionHandler:function(e,t){return document.documentElement.removeEventListener(e,t,iY())},deregisterInteractionHandler:function(t,n){return e.root.removeEventListener(t,n,iY())},deregisterResizeHandler:function(e){return window.removeEventListener("resize",e)},getWindowPageOffset:function(){return{x:window.pageXOffset,y:window.pageYOffset}},isSurfaceActive:function(){return iU(e.root,":active")},isSurfaceDisabled:function(){return!!e.disabled},isUnbounded:function(){return!!e.unbounded},registerDocumentInteractionHandler:function(e,t){return document.documentElement.addEventListener(e,t,iY())},registerInteractionHandler:function(t,n){return e.root.addEventListener(t,n,iY())},registerResizeHandler:function(e){return window.addEventListener("resize",e)},removeClass:function(t){return e.root.classList.remove(t)},updateCssVariable:function(t,n){return e.root.style.setProperty(t,n)}}},Object.defineProperty(t.prototype,"unbounded",{get:function(){return!!this.unbounded_},set:function(e){this.unbounded_=!!e,this.setUnbounded_()},enumerable:!0,configurable:!0}),t.prototype.activate=function(){this.foundation.activate()},t.prototype.deactivate=function(){this.foundation.deactivate()},t.prototype.layout=function(){this.foundation.layout()},t.prototype.getDefaultFoundation=function(){return new i7(t.createAdapter(this))},t.prototype.initialSyncWithDOM=function(){var e=this.root;this.unbounded="mdcRippleIsUnbounded"in e.dataset},t.prototype.setUnbounded_=function(){this.foundation.setUnbounded(!!this.unbounded_)},t}(ij),re={ROOT:"mdc-text-field-character-counter"},rt={ROOT_SELECTOR:"."+re.ROOT},rn=function(e){function t(n){return e.call(this,i$(i$({},t.defaultAdapter),n))||this}return iP(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return re},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return rt},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{setContent:function(){}}},enumerable:!0,configurable:!0}),t.prototype.setCounterValue=function(e,t){e=Math.min(e,t),this.adapter.setContent(e+" / "+t)},t}(iz),ri=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iP(t,e),t.attachTo=function(e){return new t(e)},Object.defineProperty(t.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),t.prototype.getDefaultFoundation=function(){var e=this;return new rn({setContent:function(t){e.root.textContent=t}})},t}(ij),rr={ARIA_CONTROLS:"aria-controls",ARIA_DESCRIBEDBY:"aria-describedby",INPUT_SELECTOR:".mdc-text-field__input",LABEL_SELECTOR:".mdc-floating-label",LEADING_ICON_SELECTOR:".mdc-text-field__icon--leading",LINE_RIPPLE_SELECTOR:".mdc-line-ripple",OUTLINE_SELECTOR:".mdc-notched-outline",PREFIX_SELECTOR:".mdc-text-field__affix--prefix",SUFFIX_SELECTOR:".mdc-text-field__affix--suffix",TRAILING_ICON_SELECTOR:".mdc-text-field__icon--trailing"},ro={DISABLED:"mdc-text-field--disabled",FOCUSED:"mdc-text-field--focused",HELPER_LINE:"mdc-text-field-helper-line",INVALID:"mdc-text-field--invalid",LABEL_FLOATING:"mdc-text-field--label-floating",NO_LABEL:"mdc-text-field--no-label",OUTLINED:"mdc-text-field--outlined",ROOT:"mdc-text-field",TEXTAREA:"mdc-text-field--textarea",WITH_LEADING_ICON:"mdc-text-field--with-leading-icon",WITH_TRAILING_ICON:"mdc-text-field--with-trailing-icon"},ra={LABEL_SCALE:.75},rs=["pattern","min","max","required","step","minlength","maxlength"],rl=["color","date","datetime-local","month","range","time","week"],rc=["mousedown","touchstart"],rd=["click","keydown"],ru=function(e){function t(n,i){void 0===i&&(i={});var r=e.call(this,i$(i$({},t.defaultAdapter),n))||this;return r.isFocused_=!1,r.receivedUserInput_=!1,r.isValid_=!0,r.useNativeValidation_=!0,r.validateOnValueChange_=!0,r.helperText_=i.helperText,r.characterCounter_=i.characterCounter,r.leadingIcon_=i.leadingIcon,r.trailingIcon_=i.trailingIcon,r.inputFocusHandler_=function(){return r.activateFocus()},r.inputBlurHandler_=function(){return r.deactivateFocus()},r.inputInputHandler_=function(){return r.handleInput()},r.setPointerXOffset_=function(e){return r.setTransformOrigin(e)},r.textFieldInteractionHandler_=function(){return r.handleTextFieldInteraction()},r.validationAttributeChangeHandler_=function(e){return r.handleValidationAttributeChange(e)},r}return iP(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return ro},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return rr},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return ra},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldAlwaysFloat_",{get:function(){var e=this.getNativeInput_().type;return rl.indexOf(e)>=0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldFloat",{get:function(){return this.shouldAlwaysFloat_||this.isFocused_||!!this.getValue()||this.isBadInput_()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldShake",{get:function(){return!this.isFocused_&&!this.isValid()&&!!this.getValue()},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!0},setInputAttr:function(){},removeInputAttr:function(){},registerTextFieldInteractionHandler:function(){},deregisterTextFieldInteractionHandler:function(){},registerInputInteractionHandler:function(){},deregisterInputInteractionHandler:function(){},registerValidationAttributeChangeHandler:function(){return new MutationObserver(function(){})},deregisterValidationAttributeChangeHandler:function(){},getNativeInput:function(){return null},isFocused:function(){return!1},activateLineRipple:function(){},deactivateLineRipple:function(){},setLineRippleTransformOrigin:function(){},shakeLabel:function(){},floatLabel:function(){},setLabelRequired:function(){},hasLabel:function(){return!1},getLabelWidth:function(){return 0},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){var e=this;this.adapter.hasLabel()&&this.getNativeInput_().required&&this.adapter.setLabelRequired(!0),this.adapter.isFocused()?this.inputFocusHandler_():this.adapter.hasLabel()&&this.shouldFloat&&(this.notchOutline(!0),this.adapter.floatLabel(!0),this.styleFloating_(!0)),this.adapter.registerInputInteractionHandler("focus",this.inputFocusHandler_),this.adapter.registerInputInteractionHandler("blur",this.inputBlurHandler_),this.adapter.registerInputInteractionHandler("input",this.inputInputHandler_),rc.forEach(function(t){e.adapter.registerInputInteractionHandler(t,e.setPointerXOffset_)}),rd.forEach(function(t){e.adapter.registerTextFieldInteractionHandler(t,e.textFieldInteractionHandler_)}),this.validationObserver_=this.adapter.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_),this.setCharacterCounter_(this.getValue().length)},t.prototype.destroy=function(){var e=this;this.adapter.deregisterInputInteractionHandler("focus",this.inputFocusHandler_),this.adapter.deregisterInputInteractionHandler("blur",this.inputBlurHandler_),this.adapter.deregisterInputInteractionHandler("input",this.inputInputHandler_),rc.forEach(function(t){e.adapter.deregisterInputInteractionHandler(t,e.setPointerXOffset_)}),rd.forEach(function(t){e.adapter.deregisterTextFieldInteractionHandler(t,e.textFieldInteractionHandler_)}),this.adapter.deregisterValidationAttributeChangeHandler(this.validationObserver_)},t.prototype.handleTextFieldInteraction=function(){var e=this.adapter.getNativeInput();e&&e.disabled||(this.receivedUserInput_=!0)},t.prototype.handleValidationAttributeChange=function(e){var t=this;e.some(function(e){return rs.indexOf(e)>-1&&(t.styleValidity_(!0),t.adapter.setLabelRequired(t.getNativeInput_().required),!0)}),e.indexOf("maxlength")>-1&&this.setCharacterCounter_(this.getValue().length)},t.prototype.notchOutline=function(e){if(this.adapter.hasOutline()&&this.adapter.hasLabel())if(e){var t=this.adapter.getLabelWidth()*ra.LABEL_SCALE;this.adapter.notchOutline(t)}else this.adapter.closeOutline()},t.prototype.activateFocus=function(){this.isFocused_=!0,this.styleFocused_(this.isFocused_),this.adapter.activateLineRipple(),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake)),this.helperText_&&(this.helperText_.isPersistent()||!this.helperText_.isValidation()||!this.isValid_)&&this.helperText_.showToScreenReader()},t.prototype.setTransformOrigin=function(e){if(!(this.isDisabled()||this.adapter.hasOutline())){var t=e.touches,n=t?t[0]:e,i=n.target.getBoundingClientRect(),r=n.clientX-i.left;this.adapter.setLineRippleTransformOrigin(r)}},t.prototype.handleInput=function(){this.autoCompleteFocus(),this.setCharacterCounter_(this.getValue().length)},t.prototype.autoCompleteFocus=function(){this.receivedUserInput_||this.activateFocus()},t.prototype.deactivateFocus=function(){this.isFocused_=!1,this.adapter.deactivateLineRipple();var e=this.isValid();this.styleValidity_(e),this.styleFocused_(this.isFocused_),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake)),this.shouldFloat||(this.receivedUserInput_=!1)},t.prototype.getValue=function(){return this.getNativeInput_().value},t.prototype.setValue=function(e){if(this.getValue()!==e&&(this.getNativeInput_().value=e),this.setCharacterCounter_(e.length),this.validateOnValueChange_){var t=this.isValid();this.styleValidity_(t)}this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.validateOnValueChange_&&this.adapter.shakeLabel(this.shouldShake))},t.prototype.isValid=function(){return this.useNativeValidation_?this.isNativeInputValid_():this.isValid_},t.prototype.setValid=function(e){this.isValid_=e,this.styleValidity_(e);var t=!e&&!this.isFocused_&&!!this.getValue();this.adapter.hasLabel()&&this.adapter.shakeLabel(t)},t.prototype.setValidateOnValueChange=function(e){this.validateOnValueChange_=e},t.prototype.getValidateOnValueChange=function(){return this.validateOnValueChange_},t.prototype.setUseNativeValidation=function(e){this.useNativeValidation_=e},t.prototype.isDisabled=function(){return this.getNativeInput_().disabled},t.prototype.setDisabled=function(e){this.getNativeInput_().disabled=e,this.styleDisabled_(e)},t.prototype.setHelperTextContent=function(e){this.helperText_&&this.helperText_.setContent(e)},t.prototype.setLeadingIconAriaLabel=function(e){this.leadingIcon_&&this.leadingIcon_.setAriaLabel(e)},t.prototype.setLeadingIconContent=function(e){this.leadingIcon_&&this.leadingIcon_.setContent(e)},t.prototype.setTrailingIconAriaLabel=function(e){this.trailingIcon_&&this.trailingIcon_.setAriaLabel(e)},t.prototype.setTrailingIconContent=function(e){this.trailingIcon_&&this.trailingIcon_.setContent(e)},t.prototype.setCharacterCounter_=function(e){if(this.characterCounter_){var t=this.getNativeInput_().maxLength;if(-1===t)throw Error("MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.");this.characterCounter_.setCounterValue(e,t)}},t.prototype.isBadInput_=function(){return this.getNativeInput_().validity.badInput||!1},t.prototype.isNativeInputValid_=function(){return this.getNativeInput_().validity.valid},t.prototype.styleValidity_=function(e){var n=t.cssClasses.INVALID;if(e?this.adapter.removeClass(n):this.adapter.addClass(n),this.helperText_){if(this.helperText_.setValidity(e),!this.helperText_.isValidation())return;var i=this.helperText_.isVisible(),r=this.helperText_.getId();i&&r?this.adapter.setInputAttr(rr.ARIA_DESCRIBEDBY,r):this.adapter.removeInputAttr(rr.ARIA_DESCRIBEDBY)}},t.prototype.styleFocused_=function(e){var n=t.cssClasses.FOCUSED;e?this.adapter.addClass(n):this.adapter.removeClass(n)},t.prototype.styleDisabled_=function(e){var n=t.cssClasses,i=n.DISABLED,r=n.INVALID;e?(this.adapter.addClass(i),this.adapter.removeClass(r)):this.adapter.removeClass(i),this.leadingIcon_&&this.leadingIcon_.setDisabled(e),this.trailingIcon_&&this.trailingIcon_.setDisabled(e)},t.prototype.styleFloating_=function(e){var n=t.cssClasses.LABEL_FLOATING;e?this.adapter.addClass(n):this.adapter.removeClass(n)},t.prototype.getNativeInput_=function(){return(this.adapter?this.adapter.getNativeInput():null)||{disabled:!1,maxLength:-1,required:!1,type:"input",validity:{badInput:!1,valid:!0},value:""}},t}(iz),rh={HELPER_TEXT_PERSISTENT:"mdc-text-field-helper-text--persistent",HELPER_TEXT_VALIDATION_MSG:"mdc-text-field-helper-text--validation-msg",ROOT:"mdc-text-field-helper-text"},rm={ARIA_HIDDEN:"aria-hidden",ROLE:"role",ROOT_SELECTOR:"."+rh.ROOT},rf=function(e){function t(n){return e.call(this,i$(i$({},t.defaultAdapter),n))||this}return iP(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return rh},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return rm},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){}}},enumerable:!0,configurable:!0}),t.prototype.getId=function(){return this.adapter.getAttr("id")},t.prototype.isVisible=function(){return"true"!==this.adapter.getAttr(rm.ARIA_HIDDEN)},t.prototype.setContent=function(e){this.adapter.setContent(e)},t.prototype.isPersistent=function(){return this.adapter.hasClass(rh.HELPER_TEXT_PERSISTENT)},t.prototype.setPersistent=function(e){e?this.adapter.addClass(rh.HELPER_TEXT_PERSISTENT):this.adapter.removeClass(rh.HELPER_TEXT_PERSISTENT)},t.prototype.isValidation=function(){return this.adapter.hasClass(rh.HELPER_TEXT_VALIDATION_MSG)},t.prototype.setValidation=function(e){e?this.adapter.addClass(rh.HELPER_TEXT_VALIDATION_MSG):this.adapter.removeClass(rh.HELPER_TEXT_VALIDATION_MSG)},t.prototype.showToScreenReader=function(){this.adapter.removeAttr(rm.ARIA_HIDDEN)},t.prototype.setValidity=function(e){var t=this.adapter.hasClass(rh.HELPER_TEXT_PERSISTENT),n=this.adapter.hasClass(rh.HELPER_TEXT_VALIDATION_MSG)&&!e;n?(this.showToScreenReader(),this.adapter.setAttr(rm.ROLE,"alert")):this.adapter.removeAttr(rm.ROLE),t||n||this.hide_()},t.prototype.hide_=function(){this.adapter.setAttr(rm.ARIA_HIDDEN,"true")},t}(iz),rp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iP(t,e),t.attachTo=function(e){return new t(e)},Object.defineProperty(t.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),t.prototype.getDefaultFoundation=function(){var e=this;return new rf({addClass:function(t){return e.root.classList.add(t)},removeClass:function(t){return e.root.classList.remove(t)},hasClass:function(t){return e.root.classList.contains(t)},getAttr:function(t){return e.root.getAttribute(t)},setAttr:function(t,n){return e.root.setAttribute(t,n)},removeAttr:function(t){return e.root.removeAttribute(t)},setContent:function(t){e.root.textContent=t}})},t}(ij),rg={ICON_EVENT:"MDCTextField:icon",ICON_ROLE:"button"},rb={ROOT:"mdc-text-field__icon"},r_=["click","keydown"],ry=function(e){function t(n){var i=e.call(this,i$(i$({},t.defaultAdapter),n))||this;return i.savedTabIndex_=null,i.interactionHandler_=function(e){return i.handleInteraction(e)},i}return iP(t,e),Object.defineProperty(t,"strings",{get:function(){return rg},enumerable:!0,configurable:!0}),Object.defineProperty(t,"cssClasses",{get:function(){return rb},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},notifyIconAction:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){var e=this;this.savedTabIndex_=this.adapter.getAttr("tabindex"),r_.forEach(function(t){e.adapter.registerInteractionHandler(t,e.interactionHandler_)})},t.prototype.destroy=function(){var e=this;r_.forEach(function(t){e.adapter.deregisterInteractionHandler(t,e.interactionHandler_)})},t.prototype.setDisabled=function(e){this.savedTabIndex_&&(e?(this.adapter.setAttr("tabindex","-1"),this.adapter.removeAttr("role")):(this.adapter.setAttr("tabindex",this.savedTabIndex_),this.adapter.setAttr("role",rg.ICON_ROLE)))},t.prototype.setAriaLabel=function(e){this.adapter.setAttr("aria-label",e)},t.prototype.setContent=function(e){this.adapter.setContent(e)},t.prototype.handleInteraction=function(e){var t="Enter"===e.key||13===e.keyCode;("click"===e.type||t)&&(e.preventDefault(),this.adapter.notifyIconAction())},t}(iz),rv=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iP(t,e),t.attachTo=function(e){return new t(e)},Object.defineProperty(t.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),t.prototype.getDefaultFoundation=function(){var e=this;return new ry({getAttr:function(t){return e.root.getAttribute(t)},setAttr:function(t,n){return e.root.setAttribute(t,n)},removeAttr:function(t){return e.root.removeAttribute(t)},setContent:function(t){e.root.textContent=t},registerInteractionHandler:function(t,n){return e.listen(t,n)},deregisterInteractionHandler:function(t,n){return e.unlisten(t,n)},notifyIconAction:function(){return e.emit(ry.strings.ICON_EVENT,{},!0)}})},t}(ij),rx=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iP(t,e),t.attachTo=function(e){return new t(e)},t.prototype.initialize=function(e,t,n,i,r,o,a){void 0===e&&(e=function(e,t){return new i9(e,t)}),void 0===t&&(t=function(e){return new iX(e)}),void 0===n&&(n=function(e){return new rp(e)}),void 0===i&&(i=function(e){return new ri(e)}),void 0===r&&(r=function(e){return new rv(e)}),void 0===o&&(o=function(e){return new iG(e)}),void 0===a&&(a=function(e){return new i1(e)}),this.input_=this.root.querySelector(rr.INPUT_SELECTOR);var s=this.root.querySelector(rr.LABEL_SELECTOR);this.label_=s?o(s):null;var l=this.root.querySelector(rr.LINE_RIPPLE_SELECTOR);this.lineRipple_=l?t(l):null;var c=this.root.querySelector(rr.OUTLINE_SELECTOR);this.outline_=c?a(c):null;var d=rf.strings,u=this.root.nextElementSibling,h=u&&u.classList.contains(ro.HELPER_LINE),m=h&&u&&u.querySelector(d.ROOT_SELECTOR);this.helperText_=m?n(m):null;var f=rn.strings,p=this.root.querySelector(f.ROOT_SELECTOR);!p&&h&&u&&(p=u.querySelector(f.ROOT_SELECTOR)),this.characterCounter_=p?i(p):null;var g=this.root.querySelector(rr.LEADING_ICON_SELECTOR);this.leadingIcon_=g?r(g):null;var b=this.root.querySelector(rr.TRAILING_ICON_SELECTOR);this.trailingIcon_=b?r(b):null,this.prefix_=this.root.querySelector(rr.PREFIX_SELECTOR),this.suffix_=this.root.querySelector(rr.SUFFIX_SELECTOR),this.ripple=this.createRipple_(e)},t.prototype.destroy=function(){this.ripple&&this.ripple.destroy(),this.lineRipple_&&this.lineRipple_.destroy(),this.helperText_&&this.helperText_.destroy(),this.characterCounter_&&this.characterCounter_.destroy(),this.leadingIcon_&&this.leadingIcon_.destroy(),this.trailingIcon_&&this.trailingIcon_.destroy(),this.label_&&this.label_.destroy(),this.outline_&&this.outline_.destroy(),e.prototype.destroy.call(this)},t.prototype.initialSyncWithDOM=function(){this.disabled=this.input_.disabled},Object.defineProperty(t.prototype,"value",{get:function(){return this.foundation.getValue()},set:function(e){this.foundation.setValue(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this.foundation.isDisabled()},set:function(e){this.foundation.setDisabled(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valid",{get:function(){return this.foundation.isValid()},set:function(e){this.foundation.setValid(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"required",{get:function(){return this.input_.required},set:function(e){this.input_.required=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pattern",{get:function(){return this.input_.pattern},set:function(e){this.input_.pattern=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minLength",{get:function(){return this.input_.minLength},set:function(e){this.input_.minLength=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxLength",{get:function(){return this.input_.maxLength},set:function(e){e<0?this.input_.removeAttribute("maxLength"):this.input_.maxLength=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"min",{get:function(){return this.input_.min},set:function(e){this.input_.min=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"max",{get:function(){return this.input_.max},set:function(e){this.input_.max=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"step",{get:function(){return this.input_.step},set:function(e){this.input_.step=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"helperTextContent",{set:function(e){this.foundation.setHelperTextContent(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"leadingIconAriaLabel",{set:function(e){this.foundation.setLeadingIconAriaLabel(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"leadingIconContent",{set:function(e){this.foundation.setLeadingIconContent(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"trailingIconAriaLabel",{set:function(e){this.foundation.setTrailingIconAriaLabel(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"trailingIconContent",{set:function(e){this.foundation.setTrailingIconContent(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useNativeValidation",{set:function(e){this.foundation.setUseNativeValidation(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"prefixText",{get:function(){return this.prefix_?this.prefix_.textContent:null},set:function(e){this.prefix_&&(this.prefix_.textContent=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"suffixText",{get:function(){return this.suffix_?this.suffix_.textContent:null},set:function(e){this.suffix_&&(this.suffix_.textContent=e)},enumerable:!0,configurable:!0}),t.prototype.focus=function(){this.input_.focus()},t.prototype.layout=function(){var e=this.foundation.shouldFloat;this.foundation.notchOutline(e)},t.prototype.getDefaultFoundation=function(){return new ru(i$(i$(i$(i$(i$({},this.getRootAdapterMethods_()),this.getInputAdapterMethods_()),this.getLabelAdapterMethods_()),this.getLineRippleAdapterMethods_()),this.getOutlineAdapterMethods_()),this.getFoundationMap_())},t.prototype.getRootAdapterMethods_=function(){var e=this;return{addClass:function(t){return e.root.classList.add(t)},removeClass:function(t){return e.root.classList.remove(t)},hasClass:function(t){return e.root.classList.contains(t)},registerTextFieldInteractionHandler:function(t,n){e.listen(t,n)},deregisterTextFieldInteractionHandler:function(t,n){e.unlisten(t,n)},registerValidationAttributeChangeHandler:function(t){var n=new MutationObserver(function(e){return t(e.map(function(e){return e.attributeName}).filter(function(e){return e}))});return n.observe(e.input_,{attributes:!0}),n},deregisterValidationAttributeChangeHandler:function(e){e.disconnect()}}},t.prototype.getInputAdapterMethods_=function(){var e=this;return{getNativeInput:function(){return e.input_},setInputAttr:function(t,n){e.input_.setAttribute(t,n)},removeInputAttr:function(t){e.input_.removeAttribute(t)},isFocused:function(){return document.activeElement===e.input_},registerInputInteractionHandler:function(t,n){e.input_.addEventListener(t,n,iY())},deregisterInputInteractionHandler:function(t,n){e.input_.removeEventListener(t,n,iY())}}},t.prototype.getLabelAdapterMethods_=function(){var e=this;return{floatLabel:function(t){return e.label_&&e.label_.float(t)},getLabelWidth:function(){return e.label_?e.label_.getWidth():0},hasLabel:function(){return!!e.label_},shakeLabel:function(t){return e.label_&&e.label_.shake(t)},setLabelRequired:function(t){return e.label_&&e.label_.setRequired(t)}}},t.prototype.getLineRippleAdapterMethods_=function(){var e=this;return{activateLineRipple:function(){e.lineRipple_&&e.lineRipple_.activate()},deactivateLineRipple:function(){e.lineRipple_&&e.lineRipple_.deactivate()},setLineRippleTransformOrigin:function(t){e.lineRipple_&&e.lineRipple_.setRippleCenter(t)}}},t.prototype.getOutlineAdapterMethods_=function(){var e=this;return{closeOutline:function(){return e.outline_&&e.outline_.closeNotch()},hasOutline:function(){return!!e.outline_},notchOutline:function(t){return e.outline_&&e.outline_.notch(t)}}},t.prototype.getFoundationMap_=function(){return{characterCounter:this.characterCounter_?this.characterCounter_.foundationForTextField:void 0,helperText:this.helperText_?this.helperText_.foundationForTextField:void 0,leadingIcon:this.leadingIcon_?this.leadingIcon_.foundationForTextField:void 0,trailingIcon:this.trailingIcon_?this.trailingIcon_.foundationForTextField:void 0}},t.prototype.createRipple_=function(e){var t=this,n=this.root.classList.contains(ro.TEXTAREA),i=this.root.classList.contains(ro.OUTLINED);if(n||i)return null;var r=i$(i$({},i9.createAdapter(this)),{isSurfaceActive:function(){return iU(t.input_,":active")},registerInteractionHandler:function(e,n){return t.input_.addEventListener(e,n,iY())},deregisterInteractionHandler:function(e,n){return t.input_.removeEventListener(e,n,iY())}});return e(this.root,new i7(r))},t}(ij),rw={animation:{prefixed:"-webkit-animation",standard:"animation"},transform:{prefixed:"-webkit-transform",standard:"transform"},transition:{prefixed:"-webkit-transition",standard:"transition"}},rF={animationend:{cssProperty:"animation",prefixed:"webkitAnimationEnd",standard:"animationend"},animationiteration:{cssProperty:"animation",prefixed:"webkitAnimationIteration",standard:"animationiteration"},animationstart:{cssProperty:"animation",prefixed:"webkitAnimationStart",standard:"animationstart"},transitionend:{cssProperty:"transition",prefixed:"webkitTransitionEnd",standard:"transitionend"}};function rk(e){return!!e.document&&"function"==typeof e.document.createElement}function rE(e,t){if(rk(e)&&t in rw){var n=e.document.createElement("div"),i=rw[t],r=i.standard,o=i.prefixed;return r in n.style?r:o}return t}function rA(e,t){if(rk(e)&&t in rF){var n=e.document.createElement("div"),i=rF[t],r=i.standard,o=i.prefixed;return i.cssProperty in n.style?r:o}return t}var rC={ANIM_CHECKED_INDETERMINATE:"mdc-checkbox--anim-checked-indeterminate",ANIM_CHECKED_UNCHECKED:"mdc-checkbox--anim-checked-unchecked",ANIM_INDETERMINATE_CHECKED:"mdc-checkbox--anim-indeterminate-checked",ANIM_INDETERMINATE_UNCHECKED:"mdc-checkbox--anim-indeterminate-unchecked",ANIM_UNCHECKED_CHECKED:"mdc-checkbox--anim-unchecked-checked",ANIM_UNCHECKED_INDETERMINATE:"mdc-checkbox--anim-unchecked-indeterminate",BACKGROUND:"mdc-checkbox__background",CHECKED:"mdc-checkbox--checked",CHECKMARK:"mdc-checkbox__checkmark",CHECKMARK_PATH:"mdc-checkbox__checkmark-path",DISABLED:"mdc-checkbox--disabled",INDETERMINATE:"mdc-checkbox--indeterminate",MIXEDMARK:"mdc-checkbox__mixedmark",NATIVE_CONTROL:"mdc-checkbox__native-control",ROOT:"mdc-checkbox",SELECTED:"mdc-checkbox--selected",UPGRADED:"mdc-checkbox--upgraded"},rT={ARIA_CHECKED_ATTR:"aria-checked",ARIA_CHECKED_INDETERMINATE_VALUE:"mixed",DATA_INDETERMINATE_ATTR:"data-indeterminate",NATIVE_CONTROL_SELECTOR:".mdc-checkbox__native-control",TRANSITION_STATE_CHECKED:"checked",TRANSITION_STATE_INDETERMINATE:"indeterminate",TRANSITION_STATE_INIT:"init",TRANSITION_STATE_UNCHECKED:"unchecked"},rS={ANIM_END_LATCH_MS:250},rM=function(e){function t(n){var i=e.call(this,i$(i$({},t.defaultAdapter),n))||this;return i.currentCheckState_=rT.TRANSITION_STATE_INIT,i.currentAnimationClass_="",i.animEndLatchTimer_=0,i.enableAnimationEndHandler_=!1,i}return iP(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return rC},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return rT},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return rS},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},forceLayout:function(){},hasNativeControl:function(){return!1},isAttachedToDOM:function(){return!1},isChecked:function(){return!1},isIndeterminate:function(){return!1},removeClass:function(){},removeNativeControlAttr:function(){},setNativeControlAttr:function(){},setNativeControlDisabled:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){this.currentCheckState_=this.determineCheckState_(),this.updateAriaChecked_(),this.adapter.addClass(rC.UPGRADED)},t.prototype.destroy=function(){clearTimeout(this.animEndLatchTimer_)},t.prototype.setDisabled=function(e){this.adapter.setNativeControlDisabled(e),e?this.adapter.addClass(rC.DISABLED):this.adapter.removeClass(rC.DISABLED)},t.prototype.handleAnimationEnd=function(){var e=this;this.enableAnimationEndHandler_&&(clearTimeout(this.animEndLatchTimer_),this.animEndLatchTimer_=setTimeout(function(){e.adapter.removeClass(e.currentAnimationClass_),e.enableAnimationEndHandler_=!1},rS.ANIM_END_LATCH_MS))},t.prototype.handleChange=function(){this.transitionCheckState_()},t.prototype.transitionCheckState_=function(){if(this.adapter.hasNativeControl()){var e=this.currentCheckState_,t=this.determineCheckState_();if(e!==t){this.updateAriaChecked_();var n=rT.TRANSITION_STATE_UNCHECKED,i=rC.SELECTED;t===n?this.adapter.removeClass(i):this.adapter.addClass(i),this.currentAnimationClass_.length>0&&(clearTimeout(this.animEndLatchTimer_),this.adapter.forceLayout(),this.adapter.removeClass(this.currentAnimationClass_)),this.currentAnimationClass_=this.getTransitionAnimationClass_(e,t),this.currentCheckState_=t,this.adapter.isAttachedToDOM()&&this.currentAnimationClass_.length>0&&(this.adapter.addClass(this.currentAnimationClass_),this.enableAnimationEndHandler_=!0)}}},t.prototype.determineCheckState_=function(){var e=rT.TRANSITION_STATE_INDETERMINATE,t=rT.TRANSITION_STATE_CHECKED,n=rT.TRANSITION_STATE_UNCHECKED;return this.adapter.isIndeterminate()?e:this.adapter.isChecked()?t:n},t.prototype.getTransitionAnimationClass_=function(e,n){var i=rT.TRANSITION_STATE_INIT,r=rT.TRANSITION_STATE_CHECKED,o=rT.TRANSITION_STATE_UNCHECKED,a=t.cssClasses,s=a.ANIM_UNCHECKED_CHECKED,l=a.ANIM_UNCHECKED_INDETERMINATE,c=a.ANIM_CHECKED_UNCHECKED,d=a.ANIM_CHECKED_INDETERMINATE,u=a.ANIM_INDETERMINATE_CHECKED,h=a.ANIM_INDETERMINATE_UNCHECKED;switch(e){case i:if(n===o)return"";return n===r?u:h;case o:return n===r?s:l;case r:return n===o?c:d;default:return n===r?u:h}},t.prototype.updateAriaChecked_=function(){this.adapter.isIndeterminate()?this.adapter.setNativeControlAttr(rT.ARIA_CHECKED_ATTR,rT.ARIA_CHECKED_INDETERMINATE_VALUE):this.adapter.removeNativeControlAttr(rT.ARIA_CHECKED_ATTR)},t}(iz),rL=["checked","indeterminate"],rD=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.ripple_=t.createRipple_(),t}return iP(t,e),t.attachTo=function(e){return new t(e)},Object.defineProperty(t.prototype,"ripple",{get:function(){return this.ripple_},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"checked",{get:function(){return this.nativeControl_.checked},set:function(e){this.nativeControl_.checked=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"indeterminate",{get:function(){return this.nativeControl_.indeterminate},set:function(e){this.nativeControl_.indeterminate=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this.nativeControl_.disabled},set:function(e){this.foundation.setDisabled(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.nativeControl_.value},set:function(e){this.nativeControl_.value=e},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){var e=rT.DATA_INDETERMINATE_ATTR;this.nativeControl_.indeterminate="true"===this.nativeControl_.getAttribute(e),this.nativeControl_.removeAttribute(e)},t.prototype.initialSyncWithDOM=function(){var e=this;this.handleChange_=function(){return e.foundation.handleChange()},this.handleAnimationEnd_=function(){return e.foundation.handleAnimationEnd()},this.nativeControl_.addEventListener("change",this.handleChange_),this.listen(rA(window,"animationend"),this.handleAnimationEnd_),this.installPropertyChangeHooks_()},t.prototype.destroy=function(){this.ripple_.destroy(),this.nativeControl_.removeEventListener("change",this.handleChange_),this.unlisten(rA(window,"animationend"),this.handleAnimationEnd_),this.uninstallPropertyChangeHooks_(),e.prototype.destroy.call(this)},t.prototype.getDefaultFoundation=function(){var e=this;return new rM({addClass:function(t){return e.root.classList.add(t)},forceLayout:function(){return e.root.offsetWidth},hasNativeControl:function(){return!!e.nativeControl_},isAttachedToDOM:function(){return!!e.root.parentNode},isChecked:function(){return e.checked},isIndeterminate:function(){return e.indeterminate},removeClass:function(t){e.root.classList.remove(t)},removeNativeControlAttr:function(t){e.nativeControl_.removeAttribute(t)},setNativeControlAttr:function(t,n){e.nativeControl_.setAttribute(t,n)},setNativeControlDisabled:function(t){e.nativeControl_.disabled=t}})},t.prototype.createRipple_=function(){var e=this,t=i$(i$({},i9.createAdapter(this)),{deregisterInteractionHandler:function(t,n){return e.nativeControl_.removeEventListener(t,n,iY())},isSurfaceActive:function(){return iU(e.nativeControl_,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(t,n){return e.nativeControl_.addEventListener(t,n,iY())}});return new i9(this.root,new i7(t))},t.prototype.installPropertyChangeHooks_=function(){var e=this,t=this.nativeControl_,n=Object.getPrototypeOf(t);rL.forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);if(rI(r)){var o=r.get,a={configurable:r.configurable,enumerable:r.enumerable,get:o,set:function(n){r.set.call(t,n),e.foundation.handleChange()}};Object.defineProperty(t,i,a)}})},t.prototype.uninstallPropertyChangeHooks_=function(){var e=this.nativeControl_,t=Object.getPrototypeOf(e);rL.forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);rI(i)&&Object.defineProperty(e,n,i)})},Object.defineProperty(t.prototype,"nativeControl_",{get:function(){var e=rT.NATIVE_CONTROL_SELECTOR,t=this.root.querySelector(e);if(!t)throw Error("Checkbox component requires a "+e+" element");return t},enumerable:!0,configurable:!0}),t}(ij);function rI(e){return!!e&&"function"==typeof e.set}var rR={CHECKED:"mdc-switch--checked",DISABLED:"mdc-switch--disabled"},rO={ARIA_CHECKED_ATTR:"aria-checked",NATIVE_CONTROL_SELECTOR:".mdc-switch__native-control",RIPPLE_SURFACE_SELECTOR:".mdc-switch__thumb-underlay"},rP=function(e){function t(n){return e.call(this,i$(i$({},t.defaultAdapter),n))||this}return iP(t,e),Object.defineProperty(t,"strings",{get:function(){return rO},enumerable:!0,configurable:!0}),Object.defineProperty(t,"cssClasses",{get:function(){return rR},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNativeControlChecked:function(){},setNativeControlDisabled:function(){},setNativeControlAttr:function(){}}},enumerable:!0,configurable:!0}),t.prototype.setChecked=function(e){this.adapter.setNativeControlChecked(e),this.updateAriaChecked_(e),this.updateCheckedStyling_(e)},t.prototype.setDisabled=function(e){this.adapter.setNativeControlDisabled(e),e?this.adapter.addClass(rR.DISABLED):this.adapter.removeClass(rR.DISABLED)},t.prototype.handleChange=function(e){var t=e.target;this.updateAriaChecked_(t.checked),this.updateCheckedStyling_(t.checked)},t.prototype.updateCheckedStyling_=function(e){e?this.adapter.addClass(rR.CHECKED):this.adapter.removeClass(rR.CHECKED)},t.prototype.updateAriaChecked_=function(e){this.adapter.setNativeControlAttr(rO.ARIA_CHECKED_ATTR,""+!!e)},t}(iz),r$=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.ripple_=t.createRipple_(),t}return iP(t,e),t.attachTo=function(e){return new t(e)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.ripple_.destroy(),this.nativeControl_.removeEventListener("change",this.changeHandler_)},t.prototype.initialSyncWithDOM=function(){var e=this;this.changeHandler_=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return(t=e.foundation).handleChange.apply(t,iB(n))},this.nativeControl_.addEventListener("change",this.changeHandler_),this.checked=this.checked},t.prototype.getDefaultFoundation=function(){var e=this;return new rP({addClass:function(t){return e.root.classList.add(t)},removeClass:function(t){return e.root.classList.remove(t)},setNativeControlChecked:function(t){return e.nativeControl_.checked=t},setNativeControlDisabled:function(t){return e.nativeControl_.disabled=t},setNativeControlAttr:function(t,n){return e.nativeControl_.setAttribute(t,n)}})},Object.defineProperty(t.prototype,"ripple",{get:function(){return this.ripple_},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"checked",{get:function(){return this.nativeControl_.checked},set:function(e){this.foundation.setChecked(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this.nativeControl_.disabled},set:function(e){this.foundation.setDisabled(e)},enumerable:!0,configurable:!0}),t.prototype.createRipple_=function(){var e=this,t=rP.strings.RIPPLE_SURFACE_SELECTOR,n=this.root.querySelector(t),i=i$(i$({},i9.createAdapter(this)),{addClass:function(e){return n.classList.add(e)},computeBoundingRect:function(){return n.getBoundingClientRect()},deregisterInteractionHandler:function(t,n){e.nativeControl_.removeEventListener(t,n,iY())},isSurfaceActive:function(){return iU(e.nativeControl_,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(t,n){e.nativeControl_.addEventListener(t,n,iY())},removeClass:function(e){n.classList.remove(e)},updateCssVariable:function(e,t){n.style.setProperty(e,t)}});return new i9(this.root,new i7(i))},Object.defineProperty(t.prototype,"nativeControl_",{get:function(){var e=rP.strings.NATIVE_CONTROL_SELECTOR;return this.root.querySelector(e)},enumerable:!0,configurable:!0}),t}(ij),rN={DISABLED:"mdc-slider--disabled",DISCRETE:"mdc-slider--discrete",INPUT:"mdc-slider__input",RANGE:"mdc-slider--range",THUMB:"mdc-slider__thumb",THUMB_KNOB:"mdc-slider__thumb-knob",THUMB_TOP:"mdc-slider__thumb--top",THUMB_WITH_INDICATOR:"mdc-slider__thumb--with-indicator",TICK_MARKS:"mdc-slider--tick-marks",TICK_MARKS_CONTAINER:"mdc-slider__tick-marks",TICK_MARK_ACTIVE:"mdc-slider__tick-mark--active",TICK_MARK_INACTIVE:"mdc-slider__tick-mark--inactive",TRACK:"mdc-slider__track",TRACK_ACTIVE:"mdc-slider__track--active_fill",VALUE_INDICATOR_TEXT:"mdc-slider__value-indicator-text"},rB={STEP_SIZE:1,THUMB_UPDATE_MIN_PX:5},rz={ARIA_VALUETEXT:"aria-valuetext",INPUT_DISABLED:"disabled",INPUT_MIN:"min",INPUT_MAX:"max",INPUT_VALUE:"value",INPUT_STEP:"step"},rj={CHANGE:"MDCSlider:change",INPUT:"MDCSlider:input"};!function(e){e[e.ACTIVE=0]="ACTIVE",e[e.INACTIVE=1]="INACTIVE"}(s$||(s$={})),function(e){e[e.START=1]="START",e[e.END=2]="END"}(sN||(sN={}));var rY="undefined"!=typeof window,rH=function(e){function t(n){var i=e.call(this,i$(i$({},t.defaultAdapter),n))||this;return i.initialStylesRemoved=!1,i.isDisabled=!1,i.isDiscrete=!1,i.step=rB.STEP_SIZE,i.hasTickMarks=!1,i.isRange=!1,i.thumb=null,i.downEventClientX=null,i.startThumbKnobWidth=0,i.endThumbKnobWidth=0,i}return iP(t,e),Object.defineProperty(t,"defaultAdapter",{get:function(){return{hasClass:function(){return!1},addClass:function(){},removeClass:function(){},addThumbClass:function(){},removeThumbClass:function(){},getAttribute:function(){return null},getInputValue:function(){return""},setInputValue:function(){},getInputAttribute:function(){return null},setInputAttribute:function(){return null},removeInputAttribute:function(){return null},focusInput:function(){},isInputFocused:function(){return!1},getThumbKnobWidth:function(){return 0},getThumbBoundingClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},getBoundingClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},isRTL:function(){return!1},setThumbStyleProperty:function(){},removeThumbStyleProperty:function(){},setTrackActiveStyleProperty:function(){},removeTrackActiveStyleProperty:function(){},setValueIndicatorText:function(){},getValueToAriaValueTextFn:function(){return null},updateTickMarks:function(){},setPointerCapture:function(){},emitChangeEvent:function(){},emitInputEvent:function(){},emitDragStartEvent:function(){},emitDragEndEvent:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){},registerThumbEventHandler:function(){},deregisterThumbEventHandler:function(){},registerInputEventHandler:function(){},deregisterInputEventHandler:function(){},registerBodyEventHandler:function(){},deregisterBodyEventHandler:function(){},registerWindowEventHandler:function(){},deregisterWindowEventHandler:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){var e=this;this.isDisabled=this.adapter.hasClass(rN.DISABLED),this.isDiscrete=this.adapter.hasClass(rN.DISCRETE),this.hasTickMarks=this.adapter.hasClass(rN.TICK_MARKS),this.isRange=this.adapter.hasClass(rN.RANGE);var t=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(rz.INPUT_MIN,this.isRange?sN.START:sN.END),rz.INPUT_MIN),n=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(rz.INPUT_MAX,sN.END),rz.INPUT_MAX),i=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(rz.INPUT_VALUE,sN.END),rz.INPUT_VALUE),r=this.isRange?this.convertAttributeValueToNumber(this.adapter.getInputAttribute(rz.INPUT_VALUE,sN.START),rz.INPUT_VALUE):t;this.validateProperties({min:t,max:n,value:i,valueStart:r}),this.min=t,this.max=n,this.value=i,this.valueStart=r,this.valueBeforeDownEvent=i,this.valueStartBeforeDownEvent=r;var o=this.adapter.getInputAttribute(rz.INPUT_STEP,sN.END);if(o&&(this.step=this.convertAttributeValueToNumber(o,rz.INPUT_STEP)),this.step<=0)throw Error("MDCSliderFoundation: step must be a positive number. Current step: "+this.step);this.mousedownOrTouchstartListener=this.handleMousedownOrTouchstart.bind(this),this.moveListener=this.handleMove.bind(this),this.pointerdownListener=this.handlePointerdown.bind(this),this.pointerupListener=this.handlePointerup.bind(this),this.thumbMouseenterListener=this.handleThumbMouseenter.bind(this),this.thumbMouseleaveListener=this.handleThumbMouseleave.bind(this),this.inputStartChangeListener=function(){e.handleInputChange(sN.START)},this.inputEndChangeListener=function(){e.handleInputChange(sN.END)},this.inputStartFocusListener=function(){e.handleInputFocus(sN.START)},this.inputEndFocusListener=function(){e.handleInputFocus(sN.END)},this.inputStartBlurListener=function(){e.handleInputBlur(sN.START)},this.inputEndBlurListener=function(){e.handleInputBlur(sN.END)},this.resizeListener=this.handleResize.bind(this),this.registerEventHandlers()},t.prototype.destroy=function(){this.deregisterEventHandlers()},t.prototype.getMin=function(){return this.min},t.prototype.getMax=function(){return this.max},t.prototype.getValue=function(){return this.value},t.prototype.setValue=function(e){if(this.isRange&&e<this.valueStart)throw Error("end thumb value ("+e+") must be >= start thumb value ("+this.valueStart+")");this.updateValue(e,sN.END)},t.prototype.getValueStart=function(){if(!this.isRange)throw Error("`valueStart` is only applicable for range sliders.");return this.valueStart},t.prototype.setValueStart=function(e){if(!this.isRange)throw Error("`valueStart` is only applicable for range sliders.");if(this.isRange&&e>this.value)throw Error("start thumb value ("+e+") must be <= end thumb value ("+this.value+")");this.updateValue(e,sN.START)},t.prototype.getStep=function(){return this.step},t.prototype.getDisabled=function(){return this.isDisabled},t.prototype.setDisabled=function(e){this.isDisabled=e,e?(this.adapter.addClass(rN.DISABLED),this.isRange&&this.adapter.setInputAttribute(rz.INPUT_DISABLED,"",sN.START),this.adapter.setInputAttribute(rz.INPUT_DISABLED,"",sN.END)):(this.adapter.removeClass(rN.DISABLED),this.isRange&&this.adapter.removeInputAttribute(rz.INPUT_DISABLED,sN.START),this.adapter.removeInputAttribute(rz.INPUT_DISABLED,sN.END))},t.prototype.getIsRange=function(){return this.isRange},t.prototype.layout=function(e){var t=(void 0===e?{}:e).skipUpdateUI;this.rect=this.adapter.getBoundingClientRect(),this.isRange&&(this.startThumbKnobWidth=this.adapter.getThumbKnobWidth(sN.START),this.endThumbKnobWidth=this.adapter.getThumbKnobWidth(sN.END)),t||this.updateUI()},t.prototype.handleResize=function(){this.layout()},t.prototype.handleDown=function(e){if(!this.isDisabled){this.valueStartBeforeDownEvent=this.valueStart,this.valueBeforeDownEvent=this.value;var t=null!=e.clientX?e.clientX:e.targetTouches[0].clientX;this.downEventClientX=t;var n=this.mapClientXOnSliderScale(t);this.thumb=this.getThumbFromDownEvent(t,n),null!==this.thumb&&(this.handleDragStart(e,n,this.thumb),this.isRange&&n>=this.valueStart&&n<=this.value||this.updateValue(n,this.thumb,{emitInputEvent:!0}))}},t.prototype.handleMove=function(e){if(!this.isDisabled){e.preventDefault();var t=null!=e.clientX?e.clientX:e.targetTouches[0].clientX,n=null!=this.thumb;if(this.thumb=this.getThumbFromMoveEvent(t),null!==this.thumb){var i=this.mapClientXOnSliderScale(t);n||(this.handleDragStart(e,i,this.thumb),this.adapter.emitDragStartEvent(i,this.thumb)),this.updateValue(i,this.thumb,{emitInputEvent:!0})}}},t.prototype.handleUp=function(){if(!this.isDisabled&&null!==this.thumb){var e=this.thumb===sN.START?this.valueStartBeforeDownEvent:this.valueBeforeDownEvent,t=this.thumb===sN.START?this.valueStart:this.value;e!==t&&this.adapter.emitChangeEvent(t,this.thumb),this.adapter.emitDragEndEvent(t,this.thumb),this.thumb=null}},t.prototype.handleThumbMouseenter=function(){this.isDiscrete&&this.isRange&&(this.adapter.addThumbClass(rN.THUMB_WITH_INDICATOR,sN.START),this.adapter.addThumbClass(rN.THUMB_WITH_INDICATOR,sN.END))},t.prototype.handleThumbMouseleave=function(){this.isDiscrete&&this.isRange&&(this.adapter.isInputFocused(sN.START)||this.adapter.isInputFocused(sN.END)||(this.adapter.removeThumbClass(rN.THUMB_WITH_INDICATOR,sN.START),this.adapter.removeThumbClass(rN.THUMB_WITH_INDICATOR,sN.END)))},t.prototype.handleMousedownOrTouchstart=function(e){var t=this,n="mousedown"===e.type?"mousemove":"touchmove";this.adapter.registerBodyEventHandler(n,this.moveListener);var i=function(){t.handleUp(),t.adapter.deregisterBodyEventHandler(n,t.moveListener),t.adapter.deregisterEventHandler("mouseup",i),t.adapter.deregisterEventHandler("touchend",i)};this.adapter.registerBodyEventHandler("mouseup",i),this.adapter.registerBodyEventHandler("touchend",i),this.handleDown(e)},t.prototype.handlePointerdown=function(e){this.adapter.setPointerCapture(e.pointerId),this.adapter.registerEventHandler("pointermove",this.moveListener),this.handleDown(e)},t.prototype.handleInputChange=function(e){var t=Number(this.adapter.getInputValue(e));e===sN.START?this.setValueStart(t):this.setValue(t)},t.prototype.handleInputFocus=function(e){if(this.isDiscrete&&(this.adapter.addThumbClass(rN.THUMB_WITH_INDICATOR,e),this.isRange)){var t=e===sN.START?sN.END:sN.START;this.adapter.addThumbClass(rN.THUMB_WITH_INDICATOR,t)}},t.prototype.handleInputBlur=function(e){if(this.isDiscrete&&(this.adapter.removeThumbClass(rN.THUMB_WITH_INDICATOR,e),this.isRange)){var t=e===sN.START?sN.END:sN.START;this.adapter.removeThumbClass(rN.THUMB_WITH_INDICATOR,t)}},t.prototype.handleDragStart=function(e,t,n){this.adapter.focusInput(n),e.preventDefault(),this.adapter.emitDragStartEvent(t,n)},t.prototype.getThumbFromDownEvent=function(e,t){if(!this.isRange)return sN.END;var n=this.adapter.getThumbBoundingClientRect(sN.START),i=this.adapter.getThumbBoundingClientRect(sN.END),r=e>=n.left&&e<=n.right,o=e>=i.left&&e<=i.right;return r&&o?null:r?sN.START:o?sN.END:t<this.valueStart?sN.START:t>this.value?sN.END:null},t.prototype.getThumbFromMoveEvent=function(e){if(null!==this.thumb)return this.thumb;if(null===this.downEventClientX)throw Error("`downEventClientX` is null after move event.");return Math.abs(this.downEventClientX-e)<rB.THUMB_UPDATE_MIN_PX?this.thumb:e<this.downEventClientX?this.adapter.isRTL()?sN.END:sN.START:this.adapter.isRTL()?sN.START:sN.END},t.prototype.updateUI=function(e){this.updateThumbAndInputAttributes(e),this.updateThumbAndTrackUI(e),this.updateValueIndicatorUI(e),this.updateTickMarksUI()},t.prototype.updateThumbAndInputAttributes=function(e){if(e){var t=this.isRange&&e===sN.START?this.valueStart:this.value,n=String(t);this.adapter.setInputAttribute(rz.INPUT_VALUE,n,e),this.isRange&&e===sN.START?this.adapter.setInputAttribute(rz.INPUT_MIN,n,sN.END):this.isRange&&e===sN.END&&this.adapter.setInputAttribute(rz.INPUT_MAX,n,sN.START),this.adapter.getInputValue(e)!==n&&this.adapter.setInputValue(n,e);var i=this.adapter.getValueToAriaValueTextFn();i&&this.adapter.setInputAttribute(rz.ARIA_VALUETEXT,i(t),e)}},t.prototype.updateValueIndicatorUI=function(e){if(this.isDiscrete){var t=this.isRange&&e===sN.START?this.valueStart:this.value;this.adapter.setValueIndicatorText(t,e===sN.START?sN.START:sN.END),!e&&this.isRange&&this.adapter.setValueIndicatorText(this.valueStart,sN.START)}},t.prototype.updateTickMarksUI=function(){if(this.isDiscrete&&this.hasTickMarks){var e=(this.valueStart-this.min)/this.step,t=(this.value-this.valueStart)/this.step+1,n=(this.max-this.value)/this.step,i=Array.from({length:e}).fill(s$.INACTIVE),r=Array.from({length:t}).fill(s$.ACTIVE),o=Array.from({length:n}).fill(s$.INACTIVE);this.adapter.updateTickMarks(i.concat(r).concat(o))}},t.prototype.mapClientXOnSliderScale=function(e){var t=(e-this.rect.left)/this.rect.width;this.adapter.isRTL()&&(t=1-t);var n=this.min+t*(this.max-this.min);return n===this.max||n===this.min?n:this.quantize(n)},t.prototype.updateValue=function(e,t,n){var i=void 0===n?{}:n,r=i.emitInputEvent,o=i.emitChangeEvent;if(e=this.clampValue(e,t),this.isRange&&t===sN.START){if(this.valueStart===e)return;this.valueStart=e}else{if(this.value===e)return;this.value=e}this.updateUI(t),r&&this.adapter.emitInputEvent(t===sN.START?this.valueStart:this.value,t),o&&this.adapter.emitChangeEvent(t===sN.START?this.valueStart:this.value,t)},t.prototype.quantize=function(e){return Math.round(e/this.step)*this.step},t.prototype.clampValue=function(e,t){return(e=Math.min(Math.max(e,this.min),this.max),this.isRange&&t===sN.START&&e>this.value)?this.value:this.isRange&&t===sN.END&&e<this.valueStart?this.valueStart:e},t.prototype.updateThumbAndTrackUI=function(e){var t=this,n=this.max,i=this.min,r=(this.value-this.valueStart)/(n-i),o=r*this.rect.width,a=this.adapter.isRTL(),s=rY?rE(window,"transform"):"transform";if(this.isRange){var l=this.adapter.isRTL()?(n-this.value)/(n-i)*this.rect.width:(this.valueStart-i)/(n-i)*this.rect.width,c=l+o;requestAnimationFrame(function(){!a&&e===sN.START||a&&e!==sN.START?(t.adapter.setTrackActiveStyleProperty("transform-origin","right"),t.adapter.setTrackActiveStyleProperty("left","unset"),t.adapter.setTrackActiveStyleProperty("right",t.rect.width-c+"px")):(t.adapter.setTrackActiveStyleProperty("transform-origin","left"),t.adapter.setTrackActiveStyleProperty("right","unset"),t.adapter.setTrackActiveStyleProperty("left",l+"px")),t.adapter.setTrackActiveStyleProperty(s,"scaleX("+r+")");var n=a?c:l,i=t.adapter.isRTL()?l:c;e!==sN.START&&e&&t.initialStylesRemoved||t.adapter.setThumbStyleProperty(s,"translateX("+n+"px)",sN.START),e!==sN.END&&e&&t.initialStylesRemoved||t.adapter.setThumbStyleProperty(s,"translateX("+i+"px)",sN.END),t.removeInitialStyles(a),t.updateOverlappingThumbsUI(n,i,e)})}else requestAnimationFrame(function(){var e=a?t.rect.width-o:o;t.adapter.setThumbStyleProperty(s,"translateX("+e+"px)",sN.END),t.adapter.setTrackActiveStyleProperty(s,"scaleX("+r+")"),t.removeInitialStyles(a)})},t.prototype.removeInitialStyles=function(e){if(!this.initialStylesRemoved){var t=e?"right":"left";this.adapter.removeThumbStyleProperty(t,sN.END),this.isRange&&this.adapter.removeThumbStyleProperty(t,sN.START),this.initialStylesRemoved=!0,this.resetTrackAndThumbAnimation()}},t.prototype.resetTrackAndThumbAnimation=function(){var e=this;if(this.isDiscrete){var t=rY?rE(window,"transition"):"transition",n="all 0s ease 0s";this.adapter.setThumbStyleProperty(t,n,sN.END),this.isRange&&this.adapter.setThumbStyleProperty(t,n,sN.START),this.adapter.setTrackActiveStyleProperty(t,n),requestAnimationFrame(function(){e.adapter.removeThumbStyleProperty(t,sN.END),e.adapter.removeTrackActiveStyleProperty(t),e.isRange&&e.adapter.removeThumbStyleProperty(t,sN.START)})}},t.prototype.updateOverlappingThumbsUI=function(e,t,n){var i=!1;if(this.adapter.isRTL()){var r=e-this.startThumbKnobWidth/2;i=t+this.endThumbKnobWidth/2>=r}else i=e+this.startThumbKnobWidth/2>=t-this.endThumbKnobWidth/2;i?(this.adapter.addThumbClass(rN.THUMB_TOP,n||sN.END),this.adapter.removeThumbClass(rN.THUMB_TOP,n===sN.START?sN.END:sN.START)):(this.adapter.removeThumbClass(rN.THUMB_TOP,sN.START),this.adapter.removeThumbClass(rN.THUMB_TOP,sN.END))},t.prototype.convertAttributeValueToNumber=function(e,t){if(null===e)throw Error("MDCSliderFoundation: `"+t+"` must be non-null.");var n=Number(e);if(isNaN(n))throw Error("MDCSliderFoundation: `"+t+"` value is `"+e+"`, but must be a number.");return n},t.prototype.validateProperties=function(e){var t=e.min,n=e.max,i=e.value,r=e.valueStart;if(t>=n)throw Error("MDCSliderFoundation: min must be strictly less than max. "+("Current: [min: "+t+", max: ")+n+"]");if(this.isRange){if(i<t||i>n||r<t||r>n)throw Error("MDCSliderFoundation: values must be in [min, max] range. "+("Current values: [start value: "+r+", end value: ")+i+"]");if(r>i)throw Error("MDCSliderFoundation: start value must be <= end value. "+("Current values: [start value: "+r+", end value: ")+i+"]")}else if(i<t||i>n)throw Error("MDCSliderFoundation: value must be in [min, max] range. Current value: "+i)},t.prototype.registerEventHandlers=function(){this.adapter.registerWindowEventHandler("resize",this.resizeListener),t.SUPPORTS_POINTER_EVENTS?(this.adapter.registerEventHandler("pointerdown",this.pointerdownListener),this.adapter.registerEventHandler("pointerup",this.pointerupListener)):(this.adapter.registerEventHandler("mousedown",this.mousedownOrTouchstartListener),this.adapter.registerEventHandler("touchstart",this.mousedownOrTouchstartListener)),this.isRange&&(this.adapter.registerThumbEventHandler(sN.START,"mouseenter",this.thumbMouseenterListener),this.adapter.registerThumbEventHandler(sN.START,"mouseleave",this.thumbMouseleaveListener),this.adapter.registerInputEventHandler(sN.START,"change",this.inputStartChangeListener),this.adapter.registerInputEventHandler(sN.START,"focus",this.inputStartFocusListener),this.adapter.registerInputEventHandler(sN.START,"blur",this.inputStartBlurListener)),this.adapter.registerThumbEventHandler(sN.END,"mouseenter",this.thumbMouseenterListener),this.adapter.registerThumbEventHandler(sN.END,"mouseleave",this.thumbMouseleaveListener),this.adapter.registerInputEventHandler(sN.END,"change",this.inputEndChangeListener),this.adapter.registerInputEventHandler(sN.END,"focus",this.inputEndFocusListener),this.adapter.registerInputEventHandler(sN.END,"blur",this.inputEndBlurListener)},t.prototype.deregisterEventHandlers=function(){this.adapter.deregisterWindowEventHandler("resize",this.resizeListener),t.SUPPORTS_POINTER_EVENTS?(this.adapter.deregisterEventHandler("pointerdown",this.pointerdownListener),this.adapter.deregisterEventHandler("pointerup",this.pointerupListener)):(this.adapter.deregisterEventHandler("mousedown",this.mousedownOrTouchstartListener),this.adapter.deregisterEventHandler("touchstart",this.mousedownOrTouchstartListener)),this.isRange&&(this.adapter.deregisterThumbEventHandler(sN.START,"mouseenter",this.thumbMouseenterListener),this.adapter.deregisterThumbEventHandler(sN.START,"mouseleave",this.thumbMouseleaveListener),this.adapter.deregisterInputEventHandler(sN.START,"change",this.inputStartChangeListener),this.adapter.deregisterInputEventHandler(sN.START,"focus",this.inputStartFocusListener),this.adapter.deregisterInputEventHandler(sN.START,"blur",this.inputStartBlurListener)),this.adapter.deregisterThumbEventHandler(sN.END,"mouseenter",this.thumbMouseenterListener),this.adapter.deregisterThumbEventHandler(sN.END,"mouseleave",this.thumbMouseleaveListener),this.adapter.deregisterInputEventHandler(sN.END,"change",this.inputEndChangeListener),this.adapter.deregisterInputEventHandler(sN.END,"focus",this.inputEndFocusListener),this.adapter.deregisterInputEventHandler(sN.END,"blur",this.inputEndBlurListener)},t.prototype.handlePointerup=function(){this.handleUp(),this.adapter.deregisterEventHandler("pointermove",this.moveListener)},t.SUPPORTS_POINTER_EVENTS=rY&&!!window.PointerEvent,t}(iz),rU=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.skipInitialUIUpdate=!1,t.valueToAriaValueTextFn=null,t}return iP(t,e),t.attachTo=function(e,n){return void 0===n&&(n={}),new t(e,void 0,n)},t.prototype.getDefaultFoundation=function(){var e=this;return new rH({hasClass:function(t){return e.root.classList.contains(t)},addClass:function(t){e.root.classList.add(t)},removeClass:function(t){e.root.classList.remove(t)},addThumbClass:function(t,n){e.getThumbEl(n).classList.add(t)},removeThumbClass:function(t,n){e.getThumbEl(n).classList.remove(t)},getAttribute:function(t){return e.root.getAttribute(t)},getInputValue:function(t){return e.getInput(t).value},setInputValue:function(t,n){e.getInput(n).value=t},getInputAttribute:function(t,n){return e.getInput(n).getAttribute(t)},setInputAttribute:function(t,n,i){e.getInput(i).setAttribute(t,n)},removeInputAttribute:function(t,n){e.getInput(n).removeAttribute(t)},focusInput:function(t){e.getInput(t).focus()},isInputFocused:function(t){return e.getInput(t)===document.activeElement},getThumbKnobWidth:function(t){return e.getThumbEl(t).querySelector("."+rN.THUMB_KNOB).getBoundingClientRect().width},getThumbBoundingClientRect:function(t){return e.getThumbEl(t).getBoundingClientRect()},getBoundingClientRect:function(){return e.root.getBoundingClientRect()},isRTL:function(){return"rtl"===getComputedStyle(e.root).direction},setThumbStyleProperty:function(t,n,i){e.getThumbEl(i).style.setProperty(t,n)},removeThumbStyleProperty:function(t,n){e.getThumbEl(n).style.removeProperty(t)},setTrackActiveStyleProperty:function(t,n){e.trackActive.style.setProperty(t,n)},removeTrackActiveStyleProperty:function(t){e.trackActive.style.removeProperty(t)},setValueIndicatorText:function(t,n){e.getThumbEl(n).querySelector("."+rN.VALUE_INDICATOR_TEXT).textContent=String(t)},getValueToAriaValueTextFn:function(){return e.valueToAriaValueTextFn},updateTickMarks:function(t){var n=e.root.querySelector("."+rN.TICK_MARKS_CONTAINER);n||((n=document.createElement("div")).classList.add(rN.TICK_MARKS_CONTAINER),e.root.querySelector("."+rN.TRACK).appendChild(n)),t.length!==n.children.length?(n.innerHTML="",e.addTickMarks(n,t)):e.updateTickMarks(n,t)},setPointerCapture:function(t){e.root.setPointerCapture(t)},emitChangeEvent:function(t,n){e.emit(rj.CHANGE,{value:t,thumb:n})},emitInputEvent:function(t,n){e.emit(rj.INPUT,{value:t,thumb:n})},emitDragStartEvent:function(t,n){e.getRipple(n).activate()},emitDragEndEvent:function(t,n){e.getRipple(n).deactivate()},registerEventHandler:function(t,n){e.listen(t,n)},deregisterEventHandler:function(t,n){e.unlisten(t,n)},registerThumbEventHandler:function(t,n,i){e.getThumbEl(t).addEventListener(n,i)},deregisterThumbEventHandler:function(t,n,i){e.getThumbEl(t).removeEventListener(n,i)},registerInputEventHandler:function(t,n,i){e.getInput(t).addEventListener(n,i)},deregisterInputEventHandler:function(t,n,i){e.getInput(t).removeEventListener(n,i)},registerBodyEventHandler:function(e,t){document.body.addEventListener(e,t)},deregisterBodyEventHandler:function(e,t){document.body.removeEventListener(e,t)},registerWindowEventHandler:function(e,t){window.addEventListener(e,t)},deregisterWindowEventHandler:function(e,t){window.removeEventListener(e,t)}})},t.prototype.initialize=function(e){var t=(void 0===e?{}:e).skipInitialUIUpdate;this.inputs=[].slice.call(this.root.querySelectorAll("."+rN.INPUT)),this.thumbs=[].slice.call(this.root.querySelectorAll("."+rN.THUMB)),this.trackActive=this.root.querySelector("."+rN.TRACK_ACTIVE),this.ripples=this.createRipples(),t&&(this.skipInitialUIUpdate=!0)},t.prototype.initialSyncWithDOM=function(){this.foundation.layout({skipUpdateUI:this.skipInitialUIUpdate})},t.prototype.layout=function(){this.foundation.layout()},t.prototype.getValueStart=function(){return this.foundation.getValueStart()},t.prototype.setValueStart=function(e){this.foundation.setValueStart(e)},t.prototype.getValue=function(){return this.foundation.getValue()},t.prototype.setValue=function(e){this.foundation.setValue(e)},t.prototype.getDisabled=function(){return this.foundation.getDisabled()},t.prototype.setDisabled=function(e){this.foundation.setDisabled(e)},t.prototype.setValueToAriaValueTextFn=function(e){this.valueToAriaValueTextFn=e},t.prototype.getThumbEl=function(e){return e===sN.END?this.thumbs[this.thumbs.length-1]:this.thumbs[0]},t.prototype.getInput=function(e){return e===sN.END?this.inputs[this.inputs.length-1]:this.inputs[0]},t.prototype.getRipple=function(e){return e===sN.END?this.ripples[this.ripples.length-1]:this.ripples[0]},t.prototype.addTickMarks=function(e,t){for(var n=document.createDocumentFragment(),i=0;i<t.length;i++){var r=document.createElement("div"),o=t[i]===s$.ACTIVE?rN.TICK_MARK_ACTIVE:rN.TICK_MARK_INACTIVE;r.classList.add(o),n.appendChild(r)}e.appendChild(n)},t.prototype.updateTickMarks=function(e,t){for(var n=Array.from(e.children),i=0;i<n.length;i++)t[i]===s$.ACTIVE?(n[i].classList.add(rN.TICK_MARK_ACTIVE),n[i].classList.remove(rN.TICK_MARK_INACTIVE)):(n[i].classList.add(rN.TICK_MARK_INACTIVE),n[i].classList.remove(rN.TICK_MARK_ACTIVE))},t.prototype.createRipples=function(){for(var e=[],t=[].slice.call(this.root.querySelectorAll("."+rN.THUMB)),n=this,i=0;i<t.length;i++)!function(i){var r=t[i],o=n.inputs[i],a=i$(i$({},i9.createAdapter(n)),{addClass:function(e){r.classList.add(e)},computeBoundingRect:function(){return r.getBoundingClientRect()},deregisterInteractionHandler:function(e,t){o.removeEventListener(e,t)},isSurfaceActive:function(){return iU(o,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(e,t){o.addEventListener(e,t)},removeClass:function(e){r.classList.remove(e)},updateCssVariable:function(e,t){r.style.setProperty(e,t)}}),s=new i9(r,new i7(a));s.unbounded=!0,e.push(s)}(i);return e},t}(ij),rV={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surface--animating-closed",ANIMATING_OPEN:"mdc-menu-surface--animating-open",FIXED:"mdc-menu-surface--fixed",IS_OPEN_BELOW:"mdc-menu-surface--is-open-below",OPEN:"mdc-menu-surface--open",ROOT:"mdc-menu-surface"},rW={CLOSED_EVENT:"MDCMenuSurface:closed",OPENED_EVENT:"MDCMenuSurface:opened",FOCUSABLE_ELEMENTS:'button:not(:disabled), [href]:not([aria-disabled="true"]), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'},rG={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67};!function(e){e[e.BOTTOM=1]="BOTTOM",e[e.CENTER=2]="CENTER",e[e.RIGHT=4]="RIGHT",e[e.FLIP_RTL=8]="FLIP_RTL"}(sB||(sB={})),function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=4]="TOP_RIGHT",e[e.BOTTOM_LEFT=1]="BOTTOM_LEFT",e[e.BOTTOM_RIGHT=5]="BOTTOM_RIGHT",e[e.TOP_START=8]="TOP_START",e[e.TOP_END=12]="TOP_END",e[e.BOTTOM_START=9]="BOTTOM_START",e[e.BOTTOM_END=13]="BOTTOM_END"}(sz||(sz={}));var rq={LIST_ITEM_ACTIVATED_CLASS:"mdc-list-item--activated",LIST_ITEM_CLASS:"mdc-list-item",LIST_ITEM_DISABLED_CLASS:"mdc-list-item--disabled",LIST_ITEM_SELECTED_CLASS:"mdc-list-item--selected",LIST_ITEM_TEXT_CLASS:"mdc-list-item__text",LIST_ITEM_PRIMARY_TEXT_CLASS:"mdc-list-item__primary-text",ROOT:"mdc-list"},rK={ACTION_EVENT:"MDCList:action",ARIA_CHECKED:"aria-checked",ARIA_CHECKED_CHECKBOX_SELECTOR:'[role="checkbox"][aria-checked="true"]',ARIA_CHECKED_RADIO_SELECTOR:'[role="radio"][aria-checked="true"]',ARIA_CURRENT:"aria-current",ARIA_DISABLED:"aria-disabled",ARIA_ORIENTATION:"aria-orientation",ARIA_ORIENTATION_HORIZONTAL:"horizontal",ARIA_ROLE_CHECKBOX_SELECTOR:'[role="checkbox"]',ARIA_SELECTED:"aria-selected",CHECKBOX_RADIO_SELECTOR:'input[type="checkbox"], input[type="radio"]',CHECKBOX_SELECTOR:'input[type="checkbox"]',CHILD_ELEMENTS_TO_TOGGLE_TABINDEX:"\n ."+rq.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+rq.LIST_ITEM_CLASS+" a\n ",FOCUSABLE_CHILD_ELEMENTS:"\n ."+rq.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+rq.LIST_ITEM_CLASS+" a,\n ."+rq.LIST_ITEM_CLASS+' input[type="radio"]:not(:disabled),\n .'+rq.LIST_ITEM_CLASS+' input[type="checkbox"]:not(:disabled)\n ',RADIO_SELECTOR:'input[type="radio"]'},rX={UNSET_INDEX:-1,TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS:300},rZ={UNKNOWN:"Unknown",BACKSPACE:"Backspace",ENTER:"Enter",SPACEBAR:"Spacebar",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",END:"End",HOME:"Home",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",DELETE:"Delete",ESCAPE:"Escape"},rJ=new Set;rJ.add(rZ.BACKSPACE),rJ.add(rZ.ENTER),rJ.add(rZ.SPACEBAR),rJ.add(rZ.PAGE_UP),rJ.add(rZ.PAGE_DOWN),rJ.add(rZ.END),rJ.add(rZ.HOME),rJ.add(rZ.ARROW_LEFT),rJ.add(rZ.ARROW_UP),rJ.add(rZ.ARROW_RIGHT),rJ.add(rZ.ARROW_DOWN),rJ.add(rZ.DELETE),rJ.add(rZ.ESCAPE);var rQ={BACKSPACE:8,ENTER:13,SPACEBAR:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,DELETE:46,ESCAPE:27},r0=new Map;r0.set(rQ.BACKSPACE,rZ.BACKSPACE),r0.set(rQ.ENTER,rZ.ENTER),r0.set(rQ.SPACEBAR,rZ.SPACEBAR),r0.set(rQ.PAGE_UP,rZ.PAGE_UP),r0.set(rQ.PAGE_DOWN,rZ.PAGE_DOWN),r0.set(rQ.END,rZ.END),r0.set(rQ.HOME,rZ.HOME),r0.set(rQ.ARROW_LEFT,rZ.ARROW_LEFT),r0.set(rQ.ARROW_UP,rZ.ARROW_UP),r0.set(rQ.ARROW_RIGHT,rZ.ARROW_RIGHT),r0.set(rQ.ARROW_DOWN,rZ.ARROW_DOWN),r0.set(rQ.DELETE,rZ.DELETE),r0.set(rQ.ESCAPE,rZ.ESCAPE);var r1=new Set;function r2(e){var t=e.key;if(rJ.has(t))return t;var n=r0.get(e.keyCode);return n||rZ.UNKNOWN}r1.add(rZ.PAGE_UP),r1.add(rZ.PAGE_DOWN),r1.add(rZ.END),r1.add(rZ.HOME),r1.add(rZ.ARROW_LEFT),r1.add(rZ.ARROW_UP),r1.add(rZ.ARROW_RIGHT),r1.add(rZ.ARROW_DOWN);var r5=["input","button","textarea","select"],r3=function(e){var t=e.target;if(t){var n=(""+t.tagName).toLowerCase();-1===r5.indexOf(n)&&e.preventDefault()}};function r4(e,t){var n,i=e.nextChar,r=e.focusItemAtIndex,o=e.sortedIndexByFirstChar,a=e.focusedItemIndex,s=e.skipFocus,l=e.isItemAtIndexDisabled;return clearTimeout(t.bufferClearTimeout),t.bufferClearTimeout=setTimeout(function(){r8(t)},rX.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS),t.typeaheadBuffer=t.typeaheadBuffer+i,-1===(n=1===t.typeaheadBuffer.length?function(e,t,n,i){var r,o=i.typeaheadBuffer[0],a=e.get(o);if(!a)return -1;if(o===i.currentFirstChar&&a[i.sortedIndexCursor].index===t){i.sortedIndexCursor=(i.sortedIndexCursor+1)%a.length;var s=a[i.sortedIndexCursor].index;if(!n(s))return s}i.currentFirstChar=o;var l=-1;for(r=0;r<a.length;r++)if(!n(a[r].index)){l=r;break}for(;r<a.length;r++)if(a[r].index>t&&!n(a[r].index)){l=r;break}return -1!==l?(i.sortedIndexCursor=l,a[i.sortedIndexCursor].index):-1}(o,a,l,t):function(e,t,n){var i=n.typeaheadBuffer[0],r=e.get(i);if(!r)return -1;var o=r[n.sortedIndexCursor];if(0===o.text.lastIndexOf(n.typeaheadBuffer,0)&&!t(o.index))return o.index;for(var a=(n.sortedIndexCursor+1)%r.length,s=-1;a!==n.sortedIndexCursor;){var l=r[a],c=0===l.text.lastIndexOf(n.typeaheadBuffer,0),d=!t(l.index);if(c&&d){s=a;break}a=(a+1)%r.length}return -1!==s?(n.sortedIndexCursor=s,r[n.sortedIndexCursor].index):-1}(o,l,t))||s||r(n),n}function r6(e){return e.typeaheadBuffer.length>0}function r8(e){e.typeaheadBuffer=""}function r7(e,t){var n=e.event,i=e.isTargetListItem,r=e.focusedItemIndex,o=e.focusItemAtIndex,a=e.sortedIndexByFirstChar,s=e.isItemAtIndexDisabled,l="ArrowLeft"===r2(n),c="ArrowUp"===r2(n),d="ArrowRight"===r2(n),u="ArrowDown"===r2(n),h="Home"===r2(n),m="End"===r2(n),f="Enter"===r2(n),p="Spacebar"===r2(n);if(l||c||d||u||h||m||f)return -1;if(!p&&1===n.key.length){r3(n);var g={focusItemAtIndex:o,focusedItemIndex:r,nextChar:n.key.toLowerCase(),sortedIndexByFirstChar:a,skipFocus:!1,isItemAtIndexDisabled:s};return r4(g,t)}if(!p)return -1;if(i&&r3(n),i&&r6(t)){var g={focusItemAtIndex:o,focusedItemIndex:r,nextChar:" ",sortedIndexByFirstChar:a,skipFocus:!1,isItemAtIndexDisabled:s};return r4(g,t)}return -1}var r9=function(e){function t(n){var i=e.call(this,i$(i$({},t.defaultAdapter),n))||this;return i.wrapFocus_=!1,i.isVertical_=!0,i.isSingleSelectionList_=!1,i.selectedIndex_=rX.UNSET_INDEX,i.focusedItemIndex=rX.UNSET_INDEX,i.useActivatedClass_=!1,i.useSelectedAttr_=!1,i.ariaCurrentAttrValue_=null,i.isCheckboxList_=!1,i.isRadioList_=!1,i.hasTypeahead=!1,i.typeaheadState={bufferClearTimeout:0,currentFirstChar:"",sortedIndexCursor:0,typeaheadBuffer:""},i.sortedIndexByFirstChar=new Map,i}return iP(t,e),Object.defineProperty(t,"strings",{get:function(){return rK},enumerable:!0,configurable:!0}),Object.defineProperty(t,"cssClasses",{get:function(){return rq},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return rX},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClassForElementIndex:function(){},focusItemAtIndex:function(){},getAttributeForElementIndex:function(){return null},getFocusedElementIndex:function(){return 0},getListItemCount:function(){return 0},hasCheckboxAtIndex:function(){return!1},hasRadioAtIndex:function(){return!1},isCheckboxCheckedAtIndex:function(){return!1},isFocusInsideList:function(){return!1},isRootFocused:function(){return!1},listItemAtIndexHasClass:function(){return!1},notifyAction:function(){},removeClassForElementIndex:function(){},setAttributeForElementIndex:function(){},setCheckedCheckboxOrRadioAtIndex:function(){},setTabIndexForListItemChildren:function(){},getPrimaryTextAtIndex:function(){return""}}},enumerable:!0,configurable:!0}),t.prototype.layout=function(){0!==this.adapter.getListItemCount()&&(this.adapter.hasCheckboxAtIndex(0)?this.isCheckboxList_=!0:this.adapter.hasRadioAtIndex(0)?this.isRadioList_=!0:this.maybeInitializeSingleSelection(),this.hasTypeahead&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex()))},t.prototype.setWrapFocus=function(e){this.wrapFocus_=e},t.prototype.setVerticalOrientation=function(e){this.isVertical_=e},t.prototype.setSingleSelection=function(e){this.isSingleSelectionList_=e,e&&this.maybeInitializeSingleSelection()},t.prototype.maybeInitializeSingleSelection=function(){for(var e=0;e<this.adapter.getListItemCount();e++){var t=this.adapter.listItemAtIndexHasClass(e,rq.LIST_ITEM_SELECTED_CLASS),n=this.adapter.listItemAtIndexHasClass(e,rq.LIST_ITEM_ACTIVATED_CLASS);if(t||n){n&&this.setUseActivatedClass(!0),this.isSingleSelectionList_=!0,this.selectedIndex_=e;return}}},t.prototype.setHasTypeahead=function(e){this.hasTypeahead=e,e&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex())},t.prototype.isTypeaheadInProgress=function(){return this.hasTypeahead&&r6(this.typeaheadState)},t.prototype.setUseActivatedClass=function(e){this.useActivatedClass_=e},t.prototype.setUseSelectedAttribute=function(e){this.useSelectedAttr_=e},t.prototype.getSelectedIndex=function(){return this.selectedIndex_},t.prototype.setSelectedIndex=function(e){this.isIndexValid_(e)&&(this.isCheckboxList_?this.setCheckboxAtIndex_(e):this.isRadioList_?this.setRadioAtIndex_(e):this.setSingleSelectionAtIndex_(e))},t.prototype.handleFocusIn=function(e,t){t>=0&&(this.focusedItemIndex=t,this.adapter.setAttributeForElementIndex(t,"tabindex","0"),this.adapter.setTabIndexForListItemChildren(t,"0"))},t.prototype.handleFocusOut=function(e,t){var n=this;t>=0&&(this.adapter.setAttributeForElementIndex(t,"tabindex","-1"),this.adapter.setTabIndexForListItemChildren(t,"-1")),setTimeout(function(){n.adapter.isFocusInsideList()||n.setTabindexToFirstSelectedOrFocusedItem()},0)},t.prototype.handleKeydown=function(e,t,n){var i=this,r="ArrowLeft"===r2(e),o="ArrowUp"===r2(e),a="ArrowRight"===r2(e),s="ArrowDown"===r2(e),l="Home"===r2(e),c="End"===r2(e),d="Enter"===r2(e),u="Spacebar"===r2(e),h="A"===e.key||"a"===e.key;if(this.adapter.isRootFocused()){if(o||c?(e.preventDefault(),this.focusLastElement()):(s||l)&&(e.preventDefault(),this.focusFirstElement()),this.hasTypeahead){var m={event:e,focusItemAtIndex:function(e){i.focusItemAtIndex(e)},focusedItemIndex:-1,isTargetListItem:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(e){return i.adapter.listItemAtIndexHasClass(e,rq.LIST_ITEM_DISABLED_CLASS)}};r7(m,this.typeaheadState)}return}var f=this.adapter.getFocusedElementIndex();if(-1!==f||!((f=n)<0)){if(this.isVertical_&&s||!this.isVertical_&&a)r3(e),this.focusNextElement(f);else if(this.isVertical_&&o||!this.isVertical_&&r)r3(e),this.focusPrevElement(f);else if(l)r3(e),this.focusFirstElement();else if(c)r3(e),this.focusLastElement();else if(h&&e.ctrlKey&&this.isCheckboxList_)e.preventDefault(),this.toggleAll(this.selectedIndex_===rX.UNSET_INDEX?[]:this.selectedIndex_);else if((d||u)&&t){var p=e.target;if(p&&"A"===p.tagName&&d||(r3(e),this.adapter.listItemAtIndexHasClass(f,rq.LIST_ITEM_DISABLED_CLASS)))return;this.isTypeaheadInProgress()||(this.isSelectableList_()&&this.setSelectedIndexOnAction_(f),this.adapter.notifyAction(f))}if(this.hasTypeahead){var m={event:e,focusItemAtIndex:function(e){i.focusItemAtIndex(e)},focusedItemIndex:this.focusedItemIndex,isTargetListItem:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(e){return i.adapter.listItemAtIndexHasClass(e,rq.LIST_ITEM_DISABLED_CLASS)}};r7(m,this.typeaheadState)}}},t.prototype.handleClick=function(e,t){e!==rX.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(e,rq.LIST_ITEM_DISABLED_CLASS)||(this.isSelectableList_()&&this.setSelectedIndexOnAction_(e,t),this.adapter.notifyAction(e)))},t.prototype.focusNextElement=function(e){var t=this.adapter.getListItemCount(),n=e+1;if(n>=t)if(!this.wrapFocus_)return e;else n=0;return this.focusItemAtIndex(n),n},t.prototype.focusPrevElement=function(e){var t=e-1;if(t<0)if(!this.wrapFocus_)return e;else t=this.adapter.getListItemCount()-1;return this.focusItemAtIndex(t),t},t.prototype.focusFirstElement=function(){return this.focusItemAtIndex(0),0},t.prototype.focusLastElement=function(){var e=this.adapter.getListItemCount()-1;return this.focusItemAtIndex(e),e},t.prototype.focusInitialElement=function(){var e=this.getFirstSelectedOrFocusedItemIndex();return this.focusItemAtIndex(e),e},t.prototype.setEnabled=function(e,t){this.isIndexValid_(e)&&(t?(this.adapter.removeClassForElementIndex(e,rq.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(e,rK.ARIA_DISABLED,"false")):(this.adapter.addClassForElementIndex(e,rq.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(e,rK.ARIA_DISABLED,"true")))},t.prototype.setSingleSelectionAtIndex_=function(e){if(this.selectedIndex_!==e){var t=rq.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass_&&(t=rq.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex_!==rX.UNSET_INDEX&&this.adapter.removeClassForElementIndex(this.selectedIndex_,t),this.setAriaForSingleSelectionAtIndex_(e),this.setTabindexAtIndex(e),e!==rX.UNSET_INDEX&&this.adapter.addClassForElementIndex(e,t),this.selectedIndex_=e}},t.prototype.setAriaForSingleSelectionAtIndex_=function(e){this.selectedIndex_===rX.UNSET_INDEX&&(this.ariaCurrentAttrValue_=this.adapter.getAttributeForElementIndex(e,rK.ARIA_CURRENT));var t=null!==this.ariaCurrentAttrValue_,n=t?rK.ARIA_CURRENT:rK.ARIA_SELECTED;if(this.selectedIndex_!==rX.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex_,n,"false"),e!==rX.UNSET_INDEX){var i=t?this.ariaCurrentAttrValue_:"true";this.adapter.setAttributeForElementIndex(e,n,i)}},t.prototype.getSelectionAttribute=function(){return this.useSelectedAttr_?rK.ARIA_SELECTED:rK.ARIA_CHECKED},t.prototype.setRadioAtIndex_=function(e){var t=this.getSelectionAttribute();this.adapter.setCheckedCheckboxOrRadioAtIndex(e,!0),this.selectedIndex_!==rX.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex_,t,"false"),this.adapter.setAttributeForElementIndex(e,t,"true"),this.selectedIndex_=e},t.prototype.setCheckboxAtIndex_=function(e){for(var t=this.getSelectionAttribute(),n=0;n<this.adapter.getListItemCount();n++){var i=!1;e.indexOf(n)>=0&&(i=!0),this.adapter.setCheckedCheckboxOrRadioAtIndex(n,i),this.adapter.setAttributeForElementIndex(n,t,i?"true":"false")}this.selectedIndex_=e},t.prototype.setTabindexAtIndex=function(e){this.focusedItemIndex===rX.UNSET_INDEX&&0!==e?this.adapter.setAttributeForElementIndex(0,"tabindex","-1"):this.focusedItemIndex>=0&&this.focusedItemIndex!==e&&this.adapter.setAttributeForElementIndex(this.focusedItemIndex,"tabindex","-1"),this.selectedIndex_ instanceof Array||this.selectedIndex_===e||this.adapter.setAttributeForElementIndex(this.selectedIndex_,"tabindex","-1"),e!==rX.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(e,"tabindex","0")},t.prototype.isSelectableList_=function(){return this.isSingleSelectionList_||this.isCheckboxList_||this.isRadioList_},t.prototype.setTabindexToFirstSelectedOrFocusedItem=function(){var e=this.getFirstSelectedOrFocusedItemIndex();this.setTabindexAtIndex(e)},t.prototype.getFirstSelectedOrFocusedItemIndex=function(){var e=this.focusedItemIndex>=0?this.focusedItemIndex:0;return this.isSelectableList_()&&("number"==typeof this.selectedIndex_&&this.selectedIndex_!==rX.UNSET_INDEX?e=this.selectedIndex_:this.selectedIndex_ instanceof Array&&this.selectedIndex_.length>0&&(e=this.selectedIndex_.reduce(function(e,t){return Math.min(e,t)}))),e},t.prototype.isIndexValid_=function(e){var t=this;if(e instanceof Array){if(!this.isCheckboxList_)throw Error("MDCListFoundation: Array of index is only supported for checkbox based list");return 0===e.length||e.some(function(e){return t.isIndexInRange_(e)})}if("number"!=typeof e)return!1;if(this.isCheckboxList_)throw Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+e);return this.isIndexInRange_(e)||this.isSingleSelectionList_&&e===rX.UNSET_INDEX},t.prototype.isIndexInRange_=function(e){var t=this.adapter.getListItemCount();return e>=0&&e<t},t.prototype.setSelectedIndexOnAction_=function(e,t){void 0===t&&(t=!0),this.isCheckboxList_?this.toggleCheckboxAtIndex_(e,t):this.setSelectedIndex(e)},t.prototype.toggleCheckboxAtIndex_=function(e,t){var n=this.getSelectionAttribute(),i=this.adapter.isCheckboxCheckedAtIndex(e);t&&(i=!i,this.adapter.setCheckedCheckboxOrRadioAtIndex(e,i)),this.adapter.setAttributeForElementIndex(e,n,i?"true":"false");var r=this.selectedIndex_===rX.UNSET_INDEX?[]:this.selectedIndex_.slice();i?r.push(e):r=r.filter(function(t){return t!==e}),this.selectedIndex_=r},t.prototype.focusItemAtIndex=function(e){this.adapter.focusItemAtIndex(e),this.focusedItemIndex=e},t.prototype.toggleAll=function(e){var t=this.adapter.getListItemCount();if(e.length===t)this.setCheckboxAtIndex_([]);else{for(var n=[],i=0;i<t;i++)(!this.adapter.listItemAtIndexHasClass(i,rq.LIST_ITEM_DISABLED_CLASS)||e.indexOf(i)>-1)&&n.push(i);this.setCheckboxAtIndex_(n)}},t.prototype.typeaheadMatchItem=function(e,t,n){var i=this;return void 0===n&&(n=!1),r4({focusItemAtIndex:function(e){i.focusItemAtIndex(e)},focusedItemIndex:t||this.focusedItemIndex,nextChar:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:n,isItemAtIndexDisabled:function(e){return i.adapter.listItemAtIndexHasClass(e,rq.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState)},t.prototype.typeaheadInitSortedIndex=function(){return function(e,t){for(var n=new Map,i=0;i<e;i++){var r=t(i).trim();if(r){var o=r[0].toLowerCase();n.has(o)||n.set(o,[]),n.get(o).push({text:r.toLowerCase(),index:i})}}return n.forEach(function(e){e.sort(function(e,t){return e.index-t.index})}),n}(this.adapter.getListItemCount(),this.adapter.getPrimaryTextAtIndex)},t.prototype.clearTypeaheadBuffer=function(){r8(this.typeaheadState)},t}(iz),oe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iP(t,e),Object.defineProperty(t.prototype,"vertical",{set:function(e){this.foundation.setVerticalOrientation(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"listElements",{get:function(){return[].slice.call(this.root.querySelectorAll("."+rq.LIST_ITEM_CLASS))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"wrapFocus",{set:function(e){this.foundation.setWrapFocus(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"typeaheadInProgress",{get:function(){return this.foundation.isTypeaheadInProgress()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasTypeahead",{set:function(e){this.foundation.setHasTypeahead(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"singleSelection",{set:function(e){this.foundation.setSingleSelection(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(e){this.foundation.setSelectedIndex(e)},enumerable:!0,configurable:!0}),t.attachTo=function(e){return new t(e)},t.prototype.initialSyncWithDOM=function(){this.handleClick_=this.handleClickEvent_.bind(this),this.handleKeydown_=this.handleKeydownEvent_.bind(this),this.focusInEventListener_=this.handleFocusInEvent_.bind(this),this.focusOutEventListener_=this.handleFocusOutEvent_.bind(this),this.listen("keydown",this.handleKeydown_),this.listen("click",this.handleClick_),this.listen("focusin",this.focusInEventListener_),this.listen("focusout",this.focusOutEventListener_),this.layout(),this.initializeListType()},t.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown_),this.unlisten("click",this.handleClick_),this.unlisten("focusin",this.focusInEventListener_),this.unlisten("focusout",this.focusOutEventListener_)},t.prototype.layout=function(){var e=this.root.getAttribute(rK.ARIA_ORIENTATION);this.vertical=e!==rK.ARIA_ORIENTATION_HORIZONTAL,[].slice.call(this.root.querySelectorAll(".mdc-list-item:not([tabindex])")).forEach(function(e){e.setAttribute("tabindex","-1")}),[].slice.call(this.root.querySelectorAll(rK.FOCUSABLE_CHILD_ELEMENTS)).forEach(function(e){return e.setAttribute("tabindex","-1")}),this.foundation.layout()},t.prototype.getPrimaryText=function(e){var t=e.querySelector("."+rq.LIST_ITEM_PRIMARY_TEXT_CLASS);if(t)return t.textContent||"";var n=e.querySelector("."+rq.LIST_ITEM_TEXT_CLASS);return n&&n.textContent||""},t.prototype.initializeListType=function(){var e=this,t=this.root.querySelectorAll(rK.ARIA_ROLE_CHECKBOX_SELECTOR),n=this.root.querySelector(rK.ARIA_CHECKED_RADIO_SELECTOR);if(t.length){var i=this.root.querySelectorAll(rK.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=[].map.call(i,function(t){return e.listElements.indexOf(t)})}else n&&(this.selectedIndex=this.listElements.indexOf(n))},t.prototype.setEnabled=function(e,t){this.foundation.setEnabled(e,t)},t.prototype.typeaheadMatchItem=function(e,t){return this.foundation.typeaheadMatchItem(e,t,!0)},t.prototype.getDefaultFoundation=function(){var e=this;return new r9({addClassForElementIndex:function(t,n){var i=e.listElements[t];i&&i.classList.add(n)},focusItemAtIndex:function(t){var n=e.listElements[t];n&&n.focus()},getAttributeForElementIndex:function(t,n){return e.listElements[t].getAttribute(n)},getFocusedElementIndex:function(){return e.listElements.indexOf(document.activeElement)},getListItemCount:function(){return e.listElements.length},getPrimaryTextAtIndex:function(t){return e.getPrimaryText(e.listElements[t])},hasCheckboxAtIndex:function(t){return!!e.listElements[t].querySelector(rK.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(t){return!!e.listElements[t].querySelector(rK.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(t){return e.listElements[t].querySelector(rK.CHECKBOX_SELECTOR).checked},isFocusInsideList:function(){return e.root!==document.activeElement&&e.root.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===e.root},listItemAtIndexHasClass:function(t,n){return e.listElements[t].classList.contains(n)},notifyAction:function(t){e.emit(rK.ACTION_EVENT,{index:t},!0)},removeClassForElementIndex:function(t,n){var i=e.listElements[t];i&&i.classList.remove(n)},setAttributeForElementIndex:function(t,n,i){var r=e.listElements[t];r&&r.setAttribute(n,i)},setCheckedCheckboxOrRadioAtIndex:function(t,n){var i=e.listElements[t].querySelector(rK.CHECKBOX_RADIO_SELECTOR);i.checked=n;var r=document.createEvent("Event");r.initEvent("change",!0,!0),i.dispatchEvent(r)},setTabIndexForListItemChildren:function(t,n){var i=e.listElements[t];[].slice.call(i.querySelectorAll(rK.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX)).forEach(function(e){return e.setAttribute("tabindex",n)})}})},t.prototype.getListItemIndex_=function(e){var t=iH(e.target,"."+rq.LIST_ITEM_CLASS+", ."+rq.ROOT);return t&&iU(t,"."+rq.LIST_ITEM_CLASS)?this.listElements.indexOf(t):-1},t.prototype.handleFocusInEvent_=function(e){var t=this.getListItemIndex_(e);this.foundation.handleFocusIn(e,t)},t.prototype.handleFocusOutEvent_=function(e){var t=this.getListItemIndex_(e);this.foundation.handleFocusOut(e,t)},t.prototype.handleKeydownEvent_=function(e){var t=this.getListItemIndex_(e),n=e.target;this.foundation.handleKeydown(e,n.classList.contains(rq.LIST_ITEM_CLASS),t)},t.prototype.handleClickEvent_=function(e){var t=this.getListItemIndex_(e),n=!iU(e.target,rK.CHECKBOX_RADIO_SELECTOR);this.foundation.handleClick(t,n)},t}(ij),ot=function(e){function t(n){var i=e.call(this,i$(i$({},t.defaultAdapter),n))||this;return i.isSurfaceOpen=!1,i.isQuickOpen=!1,i.isHoistedElement=!1,i.isFixedPosition=!1,i.openAnimationEndTimerId=0,i.closeAnimationEndTimerId=0,i.animationRequestId=0,i.anchorCorner=sz.TOP_START,i.originCorner=sz.TOP_START,i.anchorMargin={top:0,right:0,bottom:0,left:0},i.position={x:0,y:0},i}return iP(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return rV},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return rW},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return rG},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Corner",{get:function(){return sz},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},hasAnchor:function(){return!1},isElementInContainer:function(){return!1},isFocused:function(){return!1},isRtl:function(){return!1},getInnerDimensions:function(){return{height:0,width:0}},getAnchorDimensions:function(){return null},getWindowDimensions:function(){return{height:0,width:0}},getBodyDimensions:function(){return{height:0,width:0}},getWindowScroll:function(){return{x:0,y:0}},setPosition:function(){},setMaxHeight:function(){},setTransformOrigin:function(){},saveFocus:function(){},restoreFocus:function(){},notifyClose:function(){},notifyOpen:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){var e=t.cssClasses,n=e.ROOT,i=e.OPEN;if(!this.adapter.hasClass(n))throw Error(n+" class required in root element.");this.adapter.hasClass(i)&&(this.isSurfaceOpen=!0)},t.prototype.destroy=function(){clearTimeout(this.openAnimationEndTimerId),clearTimeout(this.closeAnimationEndTimerId),cancelAnimationFrame(this.animationRequestId)},t.prototype.setAnchorCorner=function(e){this.anchorCorner=e},t.prototype.flipCornerHorizontally=function(){this.originCorner=this.originCorner^sB.RIGHT},t.prototype.setAnchorMargin=function(e){this.anchorMargin.top=e.top||0,this.anchorMargin.right=e.right||0,this.anchorMargin.bottom=e.bottom||0,this.anchorMargin.left=e.left||0},t.prototype.setIsHoisted=function(e){this.isHoistedElement=e},t.prototype.setFixedPosition=function(e){this.isFixedPosition=e},t.prototype.setAbsolutePosition=function(e,t){this.position.x=this.isFinite(e)?e:0,this.position.y=this.isFinite(t)?t:0},t.prototype.setQuickOpen=function(e){this.isQuickOpen=e},t.prototype.isOpen=function(){return this.isSurfaceOpen},t.prototype.open=function(){var e=this;this.isSurfaceOpen||(this.adapter.saveFocus(),this.isQuickOpen?(this.isSurfaceOpen=!0,this.adapter.addClass(t.cssClasses.OPEN),this.dimensions=this.adapter.getInnerDimensions(),this.autoposition(),this.adapter.notifyOpen()):(this.adapter.addClass(t.cssClasses.ANIMATING_OPEN),this.animationRequestId=requestAnimationFrame(function(){e.adapter.addClass(t.cssClasses.OPEN),e.dimensions=e.adapter.getInnerDimensions(),e.autoposition(),e.openAnimationEndTimerId=setTimeout(function(){e.openAnimationEndTimerId=0,e.adapter.removeClass(t.cssClasses.ANIMATING_OPEN),e.adapter.notifyOpen()},rG.TRANSITION_OPEN_DURATION)}),this.isSurfaceOpen=!0))},t.prototype.close=function(e){var n=this;void 0===e&&(e=!1),this.isSurfaceOpen&&(this.isQuickOpen?(this.isSurfaceOpen=!1,e||this.maybeRestoreFocus(),this.adapter.removeClass(t.cssClasses.OPEN),this.adapter.removeClass(t.cssClasses.IS_OPEN_BELOW),this.adapter.notifyClose()):(this.adapter.addClass(t.cssClasses.ANIMATING_CLOSED),requestAnimationFrame(function(){n.adapter.removeClass(t.cssClasses.OPEN),n.adapter.removeClass(t.cssClasses.IS_OPEN_BELOW),n.closeAnimationEndTimerId=setTimeout(function(){n.closeAnimationEndTimerId=0,n.adapter.removeClass(t.cssClasses.ANIMATING_CLOSED),n.adapter.notifyClose()},rG.TRANSITION_CLOSE_DURATION)}),this.isSurfaceOpen=!1,e||this.maybeRestoreFocus()))},t.prototype.handleBodyClick=function(e){var t=e.target;this.adapter.isElementInContainer(t)||this.close()},t.prototype.handleKeydown=function(e){var t=e.keyCode;("Escape"===e.key||27===t)&&this.close()},t.prototype.autoposition=function(){this.measurements=this.getAutoLayoutmeasurements();var e,n=this.getoriginCorner(),i=this.getMenuSurfaceMaxHeight(n),r=this.hasBit(n,sB.BOTTOM)?"bottom":"top",o=this.hasBit(n,sB.RIGHT)?"right":"left",a=this.getHorizontalOriginOffset(n),s=this.getVerticalOriginOffset(n),l=this.measurements,c=l.anchorSize,d=l.surfaceSize,u=((e={})[o]=a,e[r]=s,e);c.width/d.width>rG.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(o="center"),(this.isHoistedElement||this.isFixedPosition)&&this.adjustPositionForHoistedElement(u),this.adapter.setTransformOrigin(o+" "+r),this.adapter.setPosition(u),this.adapter.setMaxHeight(i?i+"px":""),this.hasBit(n,sB.BOTTOM)||this.adapter.addClass(t.cssClasses.IS_OPEN_BELOW)},t.prototype.getAutoLayoutmeasurements=function(){var e=this.adapter.getAnchorDimensions(),t=this.adapter.getBodyDimensions(),n=this.adapter.getWindowDimensions(),i=this.adapter.getWindowScroll();return e||(e={top:this.position.y,right:this.position.x,bottom:this.position.y,left:this.position.x,width:0,height:0}),{anchorSize:e,bodySize:t,surfaceSize:this.dimensions,viewportDistance:{top:e.top,right:n.width-e.right,bottom:n.height-e.bottom,left:e.left},viewportSize:n,windowScroll:i}},t.prototype.getoriginCorner=function(){var e,n,i,r,o=this.originCorner,a=this.measurements,s=a.viewportDistance,l=a.anchorSize,c=a.surfaceSize,d=t.numbers.MARGIN_TO_EDGE;this.hasBit(this.anchorCorner,sB.BOTTOM)?(e=s.top-d+l.height+this.anchorMargin.bottom,n=s.bottom-d-this.anchorMargin.bottom):(e=s.top-d+this.anchorMargin.top,n=s.bottom-d+l.height-this.anchorMargin.top),!(n-c.height>0)&&e>=n&&(o=this.setBit(o,sB.BOTTOM));var u=this.adapter.isRtl(),h=this.hasBit(this.anchorCorner,sB.FLIP_RTL),m=this.hasBit(this.anchorCorner,sB.RIGHT)||this.hasBit(o,sB.RIGHT),f=!1;(f=u&&h?!m:m)?(i=s.left+l.width+this.anchorMargin.right,r=s.right-this.anchorMargin.right):(i=s.left+this.anchorMargin.left,r=s.right+l.width-this.anchorMargin.left);var p=i-c.width>0,g=r-c.width>0,b=this.hasBit(o,sB.FLIP_RTL)&&this.hasBit(o,sB.RIGHT);return g&&b&&u||!p&&b?o=this.unsetBit(o,sB.RIGHT):(p&&f&&u||p&&!f&&m||!g&&i>=r)&&(o=this.setBit(o,sB.RIGHT)),o},t.prototype.getMenuSurfaceMaxHeight=function(e){var n=this.measurements.viewportDistance,i=0,r=this.hasBit(e,sB.BOTTOM),o=this.hasBit(this.anchorCorner,sB.BOTTOM),a=t.numbers.MARGIN_TO_EDGE;return r?(i=n.top+this.anchorMargin.top-a,o||(i+=this.measurements.anchorSize.height)):(i=n.bottom-this.anchorMargin.bottom+this.measurements.anchorSize.height-a,o&&(i-=this.measurements.anchorSize.height)),i},t.prototype.getHorizontalOriginOffset=function(e){var t=this.measurements.anchorSize,n=this.hasBit(e,sB.RIGHT),i=this.hasBit(this.anchorCorner,sB.RIGHT);if(n){var r=i?t.width-this.anchorMargin.left:this.anchorMargin.right;return this.isHoistedElement||this.isFixedPosition?r-(this.measurements.viewportSize.width-this.measurements.bodySize.width):r}return i?t.width-this.anchorMargin.right:this.anchorMargin.left},t.prototype.getVerticalOriginOffset=function(e){var t=this.measurements.anchorSize,n=this.hasBit(e,sB.BOTTOM),i=this.hasBit(this.anchorCorner,sB.BOTTOM);return n?i?t.height-this.anchorMargin.top:-this.anchorMargin.bottom:i?t.height+this.anchorMargin.bottom:this.anchorMargin.top},t.prototype.adjustPositionForHoistedElement=function(e){var t,n,i=this.measurements,r=i.windowScroll,o=i.viewportDistance,a=Object.keys(e);try{for(var s=iN(a),l=s.next();!l.done;l=s.next()){var c=l.value,d=e[c]||0;d+=o[c],this.isFixedPosition||("top"===c?d+=r.y:"bottom"===c?d-=r.y:"left"===c?d+=r.x:d-=r.x),e[c]=d}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}},t.prototype.maybeRestoreFocus=function(){var e=this.adapter.isFocused(),t=document.activeElement&&this.adapter.isElementInContainer(document.activeElement);(e||t)&&this.adapter.restoreFocus()},t.prototype.hasBit=function(e,t){return!!(e&t)},t.prototype.setBit=function(e,t){return e|t},t.prototype.unsetBit=function(e,t){return e^t},t.prototype.isFinite=function(e){return"number"==typeof e&&isFinite(e)},t}(iz),on=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iP(t,e),t.attachTo=function(e){return new t(e)},t.prototype.initialSyncWithDOM=function(){var e=this,t=this.root.parentElement;this.anchorElement=t&&t.classList.contains(rV.ANCHOR)?t:null,this.root.classList.contains(rV.FIXED)&&this.setFixedPosition(!0),this.handleKeydown=function(t){e.foundation.handleKeydown(t)},this.handleBodyClick=function(t){e.foundation.handleBodyClick(t)},this.registerBodyClickListener=function(){document.body.addEventListener("click",e.handleBodyClick,{capture:!0})},this.deregisterBodyClickListener=function(){document.body.removeEventListener("click",e.handleBodyClick,{capture:!0})},this.listen("keydown",this.handleKeydown),this.listen(rW.OPENED_EVENT,this.registerBodyClickListener),this.listen(rW.CLOSED_EVENT,this.deregisterBodyClickListener)},t.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten(rW.OPENED_EVENT,this.registerBodyClickListener),this.unlisten(rW.CLOSED_EVENT,this.deregisterBodyClickListener),e.prototype.destroy.call(this)},t.prototype.isOpen=function(){return this.foundation.isOpen()},t.prototype.open=function(){this.foundation.open()},t.prototype.close=function(e){void 0===e&&(e=!1),this.foundation.close(e)},Object.defineProperty(t.prototype,"quickOpen",{set:function(e){this.foundation.setQuickOpen(e)},enumerable:!0,configurable:!0}),t.prototype.setIsHoisted=function(e){this.foundation.setIsHoisted(e)},t.prototype.setMenuSurfaceAnchorElement=function(e){this.anchorElement=e},t.prototype.setFixedPosition=function(e){e?this.root.classList.add(rV.FIXED):this.root.classList.remove(rV.FIXED),this.foundation.setFixedPosition(e)},t.prototype.setAbsolutePosition=function(e,t){this.foundation.setAbsolutePosition(e,t),this.setIsHoisted(!0)},t.prototype.setAnchorCorner=function(e){this.foundation.setAnchorCorner(e)},t.prototype.setAnchorMargin=function(e){this.foundation.setAnchorMargin(e)},t.prototype.getDefaultFoundation=function(){var e=this;return new ot({addClass:function(t){return e.root.classList.add(t)},removeClass:function(t){return e.root.classList.remove(t)},hasClass:function(t){return e.root.classList.contains(t)},hasAnchor:function(){return!!e.anchorElement},notifyClose:function(){return e.emit(ot.strings.CLOSED_EVENT,{})},notifyOpen:function(){return e.emit(ot.strings.OPENED_EVENT,{})},isElementInContainer:function(t){return e.root.contains(t)},isRtl:function(){return"rtl"===getComputedStyle(e.root).getPropertyValue("direction")},setTransformOrigin:function(t){var n,i,r=(n=window,void 0===i&&(i=!1),(void 0===sj||i)&&(sj="transform"in n.document.createElement("div").style?"transform":"webkitTransform"),sj+"-origin");e.root.style.setProperty(r,t)},isFocused:function(){return document.activeElement===e.root},saveFocus:function(){e.previousFocus=document.activeElement},restoreFocus:function(){e.root.contains(document.activeElement)&&e.previousFocus&&e.previousFocus.focus&&e.previousFocus.focus()},getInnerDimensions:function(){return{width:e.root.offsetWidth,height:e.root.offsetHeight}},getAnchorDimensions:function(){return e.anchorElement?e.anchorElement.getBoundingClientRect():null},getWindowDimensions:function(){return{width:window.innerWidth,height:window.innerHeight}},getBodyDimensions:function(){return{width:document.body.clientWidth,height:document.body.clientHeight}},getWindowScroll:function(){return{x:window.pageXOffset,y:window.pageYOffset}},setPosition:function(t){var n=e.root;n.style.left="left"in t?t.left+"px":"",n.style.right="right"in t?t.right+"px":"",n.style.top="top"in t?t.top+"px":"",n.style.bottom="bottom"in t?t.bottom+"px":""},setMaxHeight:function(t){e.root.style.maxHeight=t}})},t}(ij),oi={MENU_SELECTED_LIST_ITEM:"mdc-menu-item--selected",MENU_SELECTION_GROUP:"mdc-menu__selection-group",ROOT:"mdc-menu"},or={ARIA_CHECKED_ATTR:"aria-checked",ARIA_DISABLED_ATTR:"aria-disabled",CHECKBOX_SELECTOR:'input[type="checkbox"]',LIST_SELECTOR:".mdc-list",SELECTED_EVENT:"MDCMenu:selected"},oo={FOCUS_ROOT_INDEX:-1};!function(e){e[e.NONE=0]="NONE",e[e.LIST_ROOT=1]="LIST_ROOT",e[e.FIRST_ITEM=2]="FIRST_ITEM",e[e.LAST_ITEM=3]="LAST_ITEM"}(sY||(sY={}));var oa=function(e){function t(n){var i=e.call(this,i$(i$({},t.defaultAdapter),n))||this;return i.closeAnimationEndTimerId_=0,i.defaultFocusState_=sY.LIST_ROOT,i}return iP(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return oi},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return or},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return oo},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClassToElementAtIndex:function(){},removeClassFromElementAtIndex:function(){},addAttributeToElementAtIndex:function(){},removeAttributeFromElementAtIndex:function(){},elementContainsClass:function(){return!1},closeSurface:function(){},getElementIndex:function(){return -1},notifySelected:function(){},getMenuItemCount:function(){return 0},focusItemAtIndex:function(){},focusListRoot:function(){},getSelectedSiblingOfItemAtIndex:function(){return -1},isSelectableItemAtIndex:function(){return!1}}},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){this.closeAnimationEndTimerId_&&clearTimeout(this.closeAnimationEndTimerId_),this.adapter.closeSurface()},t.prototype.handleKeydown=function(e){var t=e.key,n=e.keyCode;("Tab"===t||9===n)&&this.adapter.closeSurface(!0)},t.prototype.handleItemAction=function(e){var t=this,n=this.adapter.getElementIndex(e);n<0||(this.adapter.notifySelected({index:n}),this.adapter.closeSurface(),this.closeAnimationEndTimerId_=setTimeout(function(){var n=t.adapter.getElementIndex(e);n>=0&&t.adapter.isSelectableItemAtIndex(n)&&t.setSelectedIndex(n)},ot.numbers.TRANSITION_CLOSE_DURATION))},t.prototype.handleMenuSurfaceOpened=function(){switch(this.defaultFocusState_){case sY.FIRST_ITEM:this.adapter.focusItemAtIndex(0);break;case sY.LAST_ITEM:this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount()-1);break;case sY.NONE:break;default:this.adapter.focusListRoot()}},t.prototype.setDefaultFocusState=function(e){this.defaultFocusState_=e},t.prototype.setSelectedIndex=function(e){if(this.validatedIndex_(e),!this.adapter.isSelectableItemAtIndex(e))throw Error("MDCMenuFoundation: No selection group at specified index.");var t=this.adapter.getSelectedSiblingOfItemAtIndex(e);t>=0&&(this.adapter.removeAttributeFromElementAtIndex(t,or.ARIA_CHECKED_ATTR),this.adapter.removeClassFromElementAtIndex(t,oi.MENU_SELECTED_LIST_ITEM)),this.adapter.addClassToElementAtIndex(e,oi.MENU_SELECTED_LIST_ITEM),this.adapter.addAttributeToElementAtIndex(e,or.ARIA_CHECKED_ATTR,"true")},t.prototype.setEnabled=function(e,t){this.validatedIndex_(e),t?(this.adapter.removeClassFromElementAtIndex(e,rq.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(e,or.ARIA_DISABLED_ATTR,"false")):(this.adapter.addClassToElementAtIndex(e,rq.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(e,or.ARIA_DISABLED_ATTR,"true"))},t.prototype.validatedIndex_=function(e){var t=this.adapter.getMenuItemCount();if(!(e>=0&&e<t))throw Error("MDCMenuFoundation: No list item at specified index.")},t}(iz),os=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iP(t,e),t.attachTo=function(e){return new t(e)},t.prototype.initialize=function(e,t){void 0===e&&(e=function(e){return new on(e)}),void 0===t&&(t=function(e){return new oe(e)}),this.menuSurfaceFactory_=e,this.listFactory_=t},t.prototype.initialSyncWithDOM=function(){var e=this;this.menuSurface_=this.menuSurfaceFactory_(this.root);var t=this.root.querySelector(or.LIST_SELECTOR);t?(this.list_=this.listFactory_(t),this.list_.wrapFocus=!0):this.list_=null,this.handleKeydown_=function(t){return e.foundation.handleKeydown(t)},this.handleItemAction_=function(t){return e.foundation.handleItemAction(e.items[t.detail.index])},this.handleMenuSurfaceOpened_=function(){return e.foundation.handleMenuSurfaceOpened()},this.menuSurface_.listen(ot.strings.OPENED_EVENT,this.handleMenuSurfaceOpened_),this.listen("keydown",this.handleKeydown_),this.listen(r9.strings.ACTION_EVENT,this.handleItemAction_)},t.prototype.destroy=function(){this.list_&&this.list_.destroy(),this.menuSurface_.destroy(),this.menuSurface_.unlisten(ot.strings.OPENED_EVENT,this.handleMenuSurfaceOpened_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(r9.strings.ACTION_EVENT,this.handleItemAction_),e.prototype.destroy.call(this)},Object.defineProperty(t.prototype,"open",{get:function(){return this.menuSurface_.isOpen()},set:function(e){e?this.menuSurface_.open():this.menuSurface_.close()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"wrapFocus",{get:function(){return!!this.list_&&this.list_.wrapFocus},set:function(e){this.list_&&(this.list_.wrapFocus=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasTypeahead",{set:function(e){this.list_&&(this.list_.hasTypeahead=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"typeaheadInProgress",{get:function(){return!!this.list_&&this.list_.typeaheadInProgress},enumerable:!0,configurable:!0}),t.prototype.typeaheadMatchItem=function(e,t){return this.list_?this.list_.typeaheadMatchItem(e,t):-1},t.prototype.layout=function(){this.list_&&this.list_.layout()},Object.defineProperty(t.prototype,"items",{get:function(){return this.list_?this.list_.listElements:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"singleSelection",{set:function(e){this.list_&&(this.list_.singleSelection=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectedIndex",{get:function(){return this.list_?this.list_.selectedIndex:rX.UNSET_INDEX},set:function(e){this.list_&&(this.list_.selectedIndex=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"quickOpen",{set:function(e){this.menuSurface_.quickOpen=e},enumerable:!0,configurable:!0}),t.prototype.setDefaultFocusState=function(e){this.foundation.setDefaultFocusState(e)},t.prototype.setAnchorCorner=function(e){this.menuSurface_.setAnchorCorner(e)},t.prototype.setAnchorMargin=function(e){this.menuSurface_.setAnchorMargin(e)},t.prototype.setSelectedIndex=function(e){this.foundation.setSelectedIndex(e)},t.prototype.setEnabled=function(e,t){this.foundation.setEnabled(e,t)},t.prototype.getOptionByIndex=function(e){return e<this.items.length?this.items[e]:null},t.prototype.getPrimaryTextAtIndex=function(e){var t=this.getOptionByIndex(e);return t&&this.list_&&this.list_.getPrimaryText(t)||""},t.prototype.setFixedPosition=function(e){this.menuSurface_.setFixedPosition(e)},t.prototype.setIsHoisted=function(e){this.menuSurface_.setIsHoisted(e)},t.prototype.setAbsolutePosition=function(e,t){this.menuSurface_.setAbsolutePosition(e,t)},t.prototype.setAnchorElement=function(e){this.menuSurface_.anchorElement=e},t.prototype.getDefaultFoundation=function(){var e=this;return new oa({addClassToElementAtIndex:function(t,n){e.items[t].classList.add(n)},removeClassFromElementAtIndex:function(t,n){e.items[t].classList.remove(n)},addAttributeToElementAtIndex:function(t,n,i){e.items[t].setAttribute(n,i)},removeAttributeFromElementAtIndex:function(t,n){e.items[t].removeAttribute(n)},elementContainsClass:function(e,t){return e.classList.contains(t)},closeSurface:function(t){return e.menuSurface_.close(t)},getElementIndex:function(t){return e.items.indexOf(t)},notifySelected:function(t){return e.emit(or.SELECTED_EVENT,{index:t.index,item:e.items[t.index]})},getMenuItemCount:function(){return e.items.length},focusItemAtIndex:function(t){return e.items[t].focus()},focusListRoot:function(){return e.root.querySelector(or.LIST_SELECTOR).focus()},isSelectableItemAtIndex:function(t){return!!iH(e.items[t],"."+oi.MENU_SELECTION_GROUP)},getSelectedSiblingOfItemAtIndex:function(t){var n=iH(e.items[t],"."+oi.MENU_SELECTION_GROUP).querySelector("."+oi.MENU_SELECTED_LIST_ITEM);return n?e.items.indexOf(n):-1}})},t}(ij),ol={ACTIVATED:"mdc-select--activated",DISABLED:"mdc-select--disabled",FOCUSED:"mdc-select--focused",INVALID:"mdc-select--invalid",MENU_INVALID:"mdc-select__menu--invalid",OUTLINED:"mdc-select--outlined",REQUIRED:"mdc-select--required",ROOT:"mdc-select",WITH_LEADING_ICON:"mdc-select--with-leading-icon"},oc={ARIA_CONTROLS:"aria-controls",ARIA_DESCRIBEDBY:"aria-describedby",ARIA_SELECTED_ATTR:"aria-selected",CHANGE_EVENT:"MDCSelect:change",HIDDEN_INPUT_SELECTOR:'input[type="hidden"]',LABEL_SELECTOR:".mdc-floating-label",LEADING_ICON_SELECTOR:".mdc-select__icon",LINE_RIPPLE_SELECTOR:".mdc-line-ripple",MENU_SELECTOR:".mdc-select__menu",OUTLINE_SELECTOR:".mdc-notched-outline",SELECTED_TEXT_SELECTOR:".mdc-select__selected-text",SELECT_ANCHOR_SELECTOR:".mdc-select__anchor",VALUE_ATTR:"data-value"},od={LABEL_SCALE:.75,UNSET_INDEX:-1,CLICK_DEBOUNCE_TIMEOUT_MS:330},ou=function(e){function t(n,i){void 0===i&&(i={});var r=e.call(this,i$(i$({},t.defaultAdapter),n))||this;return r.disabled=!1,r.isMenuOpen=!1,r.useDefaultValidation=!0,r.customValidity=!0,r.lastSelectedIndex=od.UNSET_INDEX,r.clickDebounceTimeout=0,r.recentlyClicked=!1,r.leadingIcon=i.leadingIcon,r.helperText=i.helperText,r}return iP(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return ol},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return od},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return oc},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},activateBottomLine:function(){},deactivateBottomLine:function(){},getSelectedIndex:function(){return -1},setSelectedIndex:function(){},hasLabel:function(){return!1},floatLabel:function(){},getLabelWidth:function(){return 0},setLabelRequired:function(){},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){},setRippleCenter:function(){},notifyChange:function(){},setSelectedText:function(){},isSelectAnchorFocused:function(){return!1},getSelectAnchorAttr:function(){return""},setSelectAnchorAttr:function(){},removeSelectAnchorAttr:function(){},addMenuClass:function(){},removeMenuClass:function(){},openMenu:function(){},closeMenu:function(){},getAnchorElement:function(){return null},setMenuAnchorElement:function(){},setMenuAnchorCorner:function(){},setMenuWrapFocus:function(){},focusMenuItemAtIndex:function(){},getMenuItemCount:function(){return 0},getMenuItemValues:function(){return[]},getMenuItemTextAtIndex:function(){return""},isTypeaheadInProgress:function(){return!1},typeaheadMatchItem:function(){return -1}}},enumerable:!0,configurable:!0}),t.prototype.getSelectedIndex=function(){return this.adapter.getSelectedIndex()},t.prototype.setSelectedIndex=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1),e>=this.adapter.getMenuItemCount()||(e===od.UNSET_INDEX?this.adapter.setSelectedText(""):this.adapter.setSelectedText(this.adapter.getMenuItemTextAtIndex(e).trim()),this.adapter.setSelectedIndex(e),t&&this.adapter.closeMenu(),n||this.lastSelectedIndex===e||this.handleChange(),this.lastSelectedIndex=e)},t.prototype.setValue=function(e,t){void 0===t&&(t=!1);var n=this.adapter.getMenuItemValues().indexOf(e);this.setSelectedIndex(n,!1,t)},t.prototype.getValue=function(){var e=this.adapter.getSelectedIndex(),t=this.adapter.getMenuItemValues();return e!==od.UNSET_INDEX?t[e]:""},t.prototype.getDisabled=function(){return this.disabled},t.prototype.setDisabled=function(e){this.disabled=e,this.disabled?(this.adapter.addClass(ol.DISABLED),this.adapter.closeMenu()):this.adapter.removeClass(ol.DISABLED),this.leadingIcon&&this.leadingIcon.setDisabled(this.disabled),this.disabled?this.adapter.removeSelectAnchorAttr("tabindex"):this.adapter.setSelectAnchorAttr("tabindex","0"),this.adapter.setSelectAnchorAttr("aria-disabled",this.disabled.toString())},t.prototype.openMenu=function(){this.adapter.addClass(ol.ACTIVATED),this.adapter.openMenu(),this.isMenuOpen=!0,this.adapter.setSelectAnchorAttr("aria-expanded","true")},t.prototype.setHelperTextContent=function(e){this.helperText&&this.helperText.setContent(e)},t.prototype.layout=function(){if(this.adapter.hasLabel()){var e=this.getValue().length>0,t=this.adapter.hasClass(ol.FOCUSED),n=e||t,i=this.adapter.hasClass(ol.REQUIRED);this.notchOutline(n),this.adapter.floatLabel(n),this.adapter.setLabelRequired(i)}},t.prototype.layoutOptions=function(){var e=this.adapter.getMenuItemValues().indexOf(this.getValue());this.setSelectedIndex(e,!1,!0)},t.prototype.handleMenuOpened=function(){if(0!==this.adapter.getMenuItemValues().length){var e=this.getSelectedIndex();this.adapter.focusMenuItemAtIndex(e>=0?e:0)}},t.prototype.handleMenuClosed=function(){this.adapter.removeClass(ol.ACTIVATED),this.isMenuOpen=!1,this.adapter.setSelectAnchorAttr("aria-expanded","false"),this.adapter.isSelectAnchorFocused()||this.blur()},t.prototype.handleChange=function(){this.layout(),this.adapter.notifyChange(this.getValue()),this.adapter.hasClass(ol.REQUIRED)&&this.useDefaultValidation&&this.setValid(this.isValid())},t.prototype.handleMenuItemAction=function(e){this.setSelectedIndex(e,!0)},t.prototype.handleFocus=function(){this.adapter.addClass(ol.FOCUSED),this.layout(),this.adapter.activateBottomLine()},t.prototype.handleBlur=function(){this.isMenuOpen||this.blur()},t.prototype.handleClick=function(e){if(!this.disabled&&!this.recentlyClicked){if(this.setClickDebounceTimeout(),this.isMenuOpen)return void this.adapter.closeMenu();this.adapter.setRippleCenter(e),this.openMenu()}},t.prototype.handleKeydown=function(e){if(!this.isMenuOpen&&this.adapter.hasClass(ol.FOCUSED)){var t=r2(e)===rZ.ENTER,n=r2(e)===rZ.SPACEBAR,i=r2(e)===rZ.ARROW_UP,r=r2(e)===rZ.ARROW_DOWN;if(!n&&e.key&&1===e.key.length||n&&this.adapter.isTypeaheadInProgress()){var o=n?" ":e.key,a=this.adapter.typeaheadMatchItem(o,this.getSelectedIndex());a>=0&&this.setSelectedIndex(a),e.preventDefault();return}(t||n||i||r)&&(i&&this.getSelectedIndex()>0?this.setSelectedIndex(this.getSelectedIndex()-1):r&&this.getSelectedIndex()<this.adapter.getMenuItemCount()-1&&this.setSelectedIndex(this.getSelectedIndex()+1),this.openMenu(),e.preventDefault())}},t.prototype.notchOutline=function(e){if(this.adapter.hasOutline()){var t=this.adapter.hasClass(ol.FOCUSED);if(e){var n=od.LABEL_SCALE,i=this.adapter.getLabelWidth()*n;this.adapter.notchOutline(i)}else t||this.adapter.closeOutline()}},t.prototype.setLeadingIconAriaLabel=function(e){this.leadingIcon&&this.leadingIcon.setAriaLabel(e)},t.prototype.setLeadingIconContent=function(e){this.leadingIcon&&this.leadingIcon.setContent(e)},t.prototype.setUseDefaultValidation=function(e){this.useDefaultValidation=e},t.prototype.setValid=function(e){this.useDefaultValidation||(this.customValidity=e),this.adapter.setSelectAnchorAttr("aria-invalid",(!e).toString()),e?(this.adapter.removeClass(ol.INVALID),this.adapter.removeMenuClass(ol.MENU_INVALID)):(this.adapter.addClass(ol.INVALID),this.adapter.addMenuClass(ol.MENU_INVALID)),this.syncHelperTextValidity(e)},t.prototype.isValid=function(){return this.useDefaultValidation&&this.adapter.hasClass(ol.REQUIRED)&&!this.adapter.hasClass(ol.DISABLED)?this.getSelectedIndex()!==od.UNSET_INDEX&&(0!==this.getSelectedIndex()||!!this.getValue()):this.customValidity},t.prototype.setRequired=function(e){e?this.adapter.addClass(ol.REQUIRED):this.adapter.removeClass(ol.REQUIRED),this.adapter.setSelectAnchorAttr("aria-required",e.toString()),this.adapter.setLabelRequired(e)},t.prototype.getRequired=function(){return"true"===this.adapter.getSelectAnchorAttr("aria-required")},t.prototype.init=function(){var e=this.adapter.getAnchorElement();e&&(this.adapter.setMenuAnchorElement(e),this.adapter.setMenuAnchorCorner(sz.BOTTOM_START)),this.adapter.setMenuWrapFocus(!1),this.setDisabled(this.adapter.hasClass(ol.DISABLED)),this.syncHelperTextValidity(!this.adapter.hasClass(ol.INVALID)),this.layout(),this.layoutOptions()},t.prototype.blur=function(){this.adapter.removeClass(ol.FOCUSED),this.layout(),this.adapter.deactivateBottomLine(),this.adapter.hasClass(ol.REQUIRED)&&this.useDefaultValidation&&this.setValid(this.isValid())},t.prototype.syncHelperTextValidity=function(e){if(this.helperText){this.helperText.setValidity(e);var t=this.helperText.isVisible(),n=this.helperText.getId();t&&n?this.adapter.setSelectAnchorAttr(oc.ARIA_DESCRIBEDBY,n):this.adapter.removeSelectAnchorAttr(oc.ARIA_DESCRIBEDBY)}},t.prototype.setClickDebounceTimeout=function(){var e=this;clearTimeout(this.clickDebounceTimeout),this.clickDebounceTimeout=setTimeout(function(){e.recentlyClicked=!1},od.CLICK_DEBOUNCE_TIMEOUT_MS),this.recentlyClicked=!0},t}(iz),oh={ARIA_HIDDEN:"aria-hidden",ROLE:"role"},om={HELPER_TEXT_VALIDATION_MSG:"mdc-select-helper-text--validation-msg",HELPER_TEXT_VALIDATION_MSG_PERSISTENT:"mdc-select-helper-text--validation-msg-persistent"},of=function(e){function t(n){return e.call(this,i$(i$({},t.defaultAdapter),n))||this}return iP(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return om},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return oh},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setAttr:function(){},getAttr:function(){return null},removeAttr:function(){},setContent:function(){}}},enumerable:!0,configurable:!0}),t.prototype.getId=function(){return this.adapter.getAttr("id")},t.prototype.isVisible=function(){return"true"!==this.adapter.getAttr(oh.ARIA_HIDDEN)},t.prototype.setContent=function(e){this.adapter.setContent(e)},t.prototype.setValidation=function(e){e?this.adapter.addClass(om.HELPER_TEXT_VALIDATION_MSG):this.adapter.removeClass(om.HELPER_TEXT_VALIDATION_MSG)},t.prototype.setValidationMsgPersistent=function(e){e?this.adapter.addClass(om.HELPER_TEXT_VALIDATION_MSG_PERSISTENT):this.adapter.removeClass(om.HELPER_TEXT_VALIDATION_MSG_PERSISTENT)},t.prototype.setValidity=function(e){if(this.adapter.hasClass(om.HELPER_TEXT_VALIDATION_MSG)){var t=this.adapter.hasClass(om.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);if(!e||t){this.showToScreenReader(),e?this.adapter.removeAttr(oh.ROLE):this.adapter.setAttr(oh.ROLE,"alert");return}this.adapter.removeAttr(oh.ROLE),this.hide()}},t.prototype.showToScreenReader=function(){this.adapter.removeAttr(oh.ARIA_HIDDEN)},t.prototype.hide=function(){this.adapter.setAttr(oh.ARIA_HIDDEN,"true")},t}(iz),op=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iP(t,e),t.attachTo=function(e){return new t(e)},Object.defineProperty(t.prototype,"foundationForSelect",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),t.prototype.getDefaultFoundation=function(){var e=this;return new of({addClass:function(t){return e.root.classList.add(t)},removeClass:function(t){return e.root.classList.remove(t)},hasClass:function(t){return e.root.classList.contains(t)},getAttr:function(t){return e.root.getAttribute(t)},setAttr:function(t,n){return e.root.setAttribute(t,n)},removeAttr:function(t){return e.root.removeAttribute(t)},setContent:function(t){e.root.textContent=t}})},t}(ij),og={ICON_EVENT:"MDCSelect:icon",ICON_ROLE:"button"},ob=["click","keydown"],o_=function(e){function t(n){var i=e.call(this,i$(i$({},t.defaultAdapter),n))||this;return i.savedTabIndex_=null,i.interactionHandler_=function(e){return i.handleInteraction(e)},i}return iP(t,e),Object.defineProperty(t,"strings",{get:function(){return og},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},notifyIconAction:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){var e=this;this.savedTabIndex_=this.adapter.getAttr("tabindex"),ob.forEach(function(t){e.adapter.registerInteractionHandler(t,e.interactionHandler_)})},t.prototype.destroy=function(){var e=this;ob.forEach(function(t){e.adapter.deregisterInteractionHandler(t,e.interactionHandler_)})},t.prototype.setDisabled=function(e){this.savedTabIndex_&&(e?(this.adapter.setAttr("tabindex","-1"),this.adapter.removeAttr("role")):(this.adapter.setAttr("tabindex",this.savedTabIndex_),this.adapter.setAttr("role",og.ICON_ROLE)))},t.prototype.setAriaLabel=function(e){this.adapter.setAttr("aria-label",e)},t.prototype.setContent=function(e){this.adapter.setContent(e)},t.prototype.handleInteraction=function(e){var t="Enter"===e.key||13===e.keyCode;("click"===e.type||t)&&this.adapter.notifyIconAction()},t}(iz),oy=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iP(t,e),t.attachTo=function(e){return new t(e)},Object.defineProperty(t.prototype,"foundationForSelect",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),t.prototype.getDefaultFoundation=function(){var e=this;return new o_({getAttr:function(t){return e.root.getAttribute(t)},setAttr:function(t,n){return e.root.setAttribute(t,n)},removeAttr:function(t){return e.root.removeAttribute(t)},setContent:function(t){e.root.textContent=t},registerInteractionHandler:function(t,n){return e.listen(t,n)},deregisterInteractionHandler:function(t,n){return e.unlisten(t,n)},notifyIconAction:function(){return e.emit(o_.strings.ICON_EVENT,{},!0)}})},t}(ij),ov=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iP(t,e),t.attachTo=function(e){return new t(e)},t.prototype.initialize=function(e,t,n,i,r,o){if(void 0===e&&(e=function(e){return new iG(e)}),void 0===t&&(t=function(e){return new iX(e)}),void 0===n&&(n=function(e){return new i1(e)}),void 0===i&&(i=function(e){return new os(e)}),void 0===r&&(r=function(e){return new oy(e)}),void 0===o&&(o=function(e){return new op(e)}),this.selectAnchor=this.root.querySelector(oc.SELECT_ANCHOR_SELECTOR),this.selectedText=this.root.querySelector(oc.SELECTED_TEXT_SELECTOR),this.hiddenInput=this.root.querySelector(oc.HIDDEN_INPUT_SELECTOR),!this.selectedText)throw Error("MDCSelect: Missing required element: The following selector must be present: '"+oc.SELECTED_TEXT_SELECTOR+"'");if(this.selectAnchor.hasAttribute(oc.ARIA_CONTROLS)){var a=document.getElementById(this.selectAnchor.getAttribute(oc.ARIA_CONTROLS));a&&(this.helperText=o(a))}this.menuSetup(i);var s=this.root.querySelector(oc.LABEL_SELECTOR);this.label=s?e(s):null;var l=this.root.querySelector(oc.LINE_RIPPLE_SELECTOR);this.lineRipple=l?t(l):null;var c=this.root.querySelector(oc.OUTLINE_SELECTOR);this.outline=c?n(c):null;var d=this.root.querySelector(oc.LEADING_ICON_SELECTOR);d&&(this.leadingIcon=r(d)),this.root.classList.contains(ol.OUTLINED)||(this.ripple=this.createRipple())},t.prototype.initialSyncWithDOM=function(){var e=this;if(this.handleFocus=function(){e.foundation.handleFocus()},this.handleBlur=function(){e.foundation.handleBlur()},this.handleClick=function(t){e.selectAnchor.focus(),e.foundation.handleClick(e.getNormalizedXCoordinate(t))},this.handleKeydown=function(t){e.foundation.handleKeydown(t)},this.handleMenuItemAction=function(t){e.foundation.handleMenuItemAction(t.detail.index)},this.handleMenuOpened=function(){e.foundation.handleMenuOpened()},this.handleMenuClosed=function(){e.foundation.handleMenuClosed()},this.selectAnchor.addEventListener("focus",this.handleFocus),this.selectAnchor.addEventListener("blur",this.handleBlur),this.selectAnchor.addEventListener("click",this.handleClick),this.selectAnchor.addEventListener("keydown",this.handleKeydown),this.menu.listen(rW.CLOSED_EVENT,this.handleMenuClosed),this.menu.listen(rW.OPENED_EVENT,this.handleMenuOpened),this.menu.listen(or.SELECTED_EVENT,this.handleMenuItemAction),this.hiddenInput){if(this.hiddenInput.value){this.foundation.setValue(this.hiddenInput.value,!0),this.foundation.layout();return}this.hiddenInput.value=this.value}},t.prototype.destroy=function(){this.selectAnchor.removeEventListener("focus",this.handleFocus),this.selectAnchor.removeEventListener("blur",this.handleBlur),this.selectAnchor.removeEventListener("keydown",this.handleKeydown),this.selectAnchor.removeEventListener("click",this.handleClick),this.menu.unlisten(rW.CLOSED_EVENT,this.handleMenuClosed),this.menu.unlisten(rW.OPENED_EVENT,this.handleMenuOpened),this.menu.unlisten(or.SELECTED_EVENT,this.handleMenuItemAction),this.menu.destroy(),this.ripple&&this.ripple.destroy(),this.outline&&this.outline.destroy(),this.leadingIcon&&this.leadingIcon.destroy(),this.helperText&&this.helperText.destroy(),e.prototype.destroy.call(this)},Object.defineProperty(t.prototype,"value",{get:function(){return this.foundation.getValue()},set:function(e){this.foundation.setValue(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(e){this.foundation.setSelectedIndex(e,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this.foundation.getDisabled()},set:function(e){this.foundation.setDisabled(e),this.hiddenInput&&(this.hiddenInput.disabled=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"leadingIconAriaLabel",{set:function(e){this.foundation.setLeadingIconAriaLabel(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"leadingIconContent",{set:function(e){this.foundation.setLeadingIconContent(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"helperTextContent",{set:function(e){this.foundation.setHelperTextContent(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useDefaultValidation",{set:function(e){this.foundation.setUseDefaultValidation(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valid",{get:function(){return this.foundation.isValid()},set:function(e){this.foundation.setValid(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"required",{get:function(){return this.foundation.getRequired()},set:function(e){this.foundation.setRequired(e)},enumerable:!0,configurable:!0}),t.prototype.layout=function(){this.foundation.layout()},t.prototype.layoutOptions=function(){this.foundation.layoutOptions(),this.menu.layout(),this.menuItemValues=this.menu.items.map(function(e){return e.getAttribute(oc.VALUE_ATTR)||""}),this.hiddenInput&&(this.hiddenInput.value=this.value)},t.prototype.getDefaultFoundation=function(){return new ou(i$(i$(i$(i$({},this.getSelectAdapterMethods()),this.getCommonAdapterMethods()),this.getOutlineAdapterMethods()),this.getLabelAdapterMethods()),this.getFoundationMap())},t.prototype.menuSetup=function(e){this.menuElement=this.root.querySelector(oc.MENU_SELECTOR),this.menu=e(this.menuElement),this.menu.hasTypeahead=!0,this.menu.singleSelection=!0,this.menuItemValues=this.menu.items.map(function(e){return e.getAttribute(oc.VALUE_ATTR)||""})},t.prototype.createRipple=function(){var e=this,t=i$(i$({},i9.createAdapter({root:this.selectAnchor})),{registerInteractionHandler:function(t,n){e.selectAnchor.addEventListener(t,n)},deregisterInteractionHandler:function(t,n){e.selectAnchor.removeEventListener(t,n)}});return new i9(this.selectAnchor,new i7(t))},t.prototype.getSelectAdapterMethods=function(){var e=this;return{getMenuItemAttr:function(e,t){return e.getAttribute(t)},setSelectedText:function(t){e.selectedText.textContent=t},isSelectAnchorFocused:function(){return document.activeElement===e.selectAnchor},getSelectAnchorAttr:function(t){return e.selectAnchor.getAttribute(t)},setSelectAnchorAttr:function(t,n){e.selectAnchor.setAttribute(t,n)},removeSelectAnchorAttr:function(t){e.selectAnchor.removeAttribute(t)},addMenuClass:function(t){e.menuElement.classList.add(t)},removeMenuClass:function(t){e.menuElement.classList.remove(t)},openMenu:function(){e.menu.open=!0},closeMenu:function(){e.menu.open=!1},getAnchorElement:function(){return e.root.querySelector(oc.SELECT_ANCHOR_SELECTOR)},setMenuAnchorElement:function(t){e.menu.setAnchorElement(t)},setMenuAnchorCorner:function(t){e.menu.setAnchorCorner(t)},setMenuWrapFocus:function(t){e.menu.wrapFocus=t},getSelectedIndex:function(){var t=e.menu.selectedIndex;return t instanceof Array?t[0]:t},setSelectedIndex:function(t){e.menu.selectedIndex=t},focusMenuItemAtIndex:function(t){e.menu.items[t].focus()},getMenuItemCount:function(){return e.menu.items.length},getMenuItemValues:function(){return e.menuItemValues},getMenuItemTextAtIndex:function(t){return e.menu.getPrimaryTextAtIndex(t)},isTypeaheadInProgress:function(){return e.menu.typeaheadInProgress},typeaheadMatchItem:function(t,n){return e.menu.typeaheadMatchItem(t,n)}}},t.prototype.getCommonAdapterMethods=function(){var e=this;return{addClass:function(t){e.root.classList.add(t)},removeClass:function(t){e.root.classList.remove(t)},hasClass:function(t){return e.root.classList.contains(t)},setRippleCenter:function(t){e.lineRipple&&e.lineRipple.setRippleCenter(t)},activateBottomLine:function(){e.lineRipple&&e.lineRipple.activate()},deactivateBottomLine:function(){e.lineRipple&&e.lineRipple.deactivate()},notifyChange:function(t){var n=e.selectedIndex;e.emit(oc.CHANGE_EVENT,{value:t,index:n},!0),e.hiddenInput&&(e.hiddenInput.value=t)}}},t.prototype.getOutlineAdapterMethods=function(){var e=this;return{hasOutline:function(){return!!e.outline},notchOutline:function(t){e.outline&&e.outline.notch(t)},closeOutline:function(){e.outline&&e.outline.closeNotch()}}},t.prototype.getLabelAdapterMethods=function(){var e=this;return{hasLabel:function(){return!!e.label},floatLabel:function(t){e.label&&e.label.float(t)},getLabelWidth:function(){return e.label?e.label.getWidth():0},setLabelRequired:function(t){e.label&&e.label.setRequired(t)}}},t.prototype.getNormalizedXCoordinate=function(e){var t=e.target.getBoundingClientRect();return(this.isTouchEvent(e)?e.touches[0].clientX:e.clientX)-t.left},t.prototype.isTouchEvent=function(e){return!!e.touches},t.prototype.getFoundationMap=function(){return{helperText:this.helperText?this.helperText.foundationForSelect:void 0,leadingIcon:this.leadingIcon?this.leadingIcon.foundationForSelect:void 0}},t}(ij),ox={ROOT:"mdc-form-field"},ow={LABEL_SELECTOR:".mdc-form-field > label"},oF=function(e){function t(n){var i=e.call(this,i$(i$({},t.defaultAdapter),n))||this;return i.click=function(){i.handleClick()},i}return iP(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return ox},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return ow},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{activateInputRipple:function(){},deactivateInputRipple:function(){},deregisterInteractionHandler:function(){},registerInteractionHandler:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){this.adapter.registerInteractionHandler("click",this.click)},t.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("click",this.click)},t.prototype.handleClick=function(){var e=this;this.adapter.activateInputRipple(),requestAnimationFrame(function(){e.adapter.deactivateInputRipple()})},t}(iz),ok=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iP(t,e),t.attachTo=function(e){return new t(e)},t.prototype.labelEl=function(){var e=oF.strings.LABEL_SELECTOR;return this.root.querySelector(e)},t.prototype.getDefaultFoundation=function(){var e=this;return new oF({activateInputRipple:function(){e.input&&e.input.ripple&&e.input.ripple.activate()},deactivateInputRipple:function(){e.input&&e.input.ripple&&e.input.ripple.deactivate()},deregisterInteractionHandler:function(t,n){var i=e.labelEl();i&&i.removeEventListener(t,n)},registerInteractionHandler:function(t,n){var i=e.labelEl();i&&i.addEventListener(t,n)}})},t}(ij),oE={ICON_BUTTON_ON:"mdc-icon-button--on",ROOT:"mdc-icon-button"},oA={ARIA_LABEL:"aria-label",ARIA_PRESSED:"aria-pressed",DATA_ARIA_LABEL_OFF:"data-aria-label-off",DATA_ARIA_LABEL_ON:"data-aria-label-on",CHANGE_EVENT:"MDCIconButtonToggle:change"},oC=function(e){function t(n){var i=e.call(this,i$(i$({},t.defaultAdapter),n))||this;return i.hasToggledAriaLabel=!1,i}return iP(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return oE},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return oA},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},hasClass:function(){return!1},notifyChange:function(){},removeClass:function(){},getAttr:function(){return null},setAttr:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){var e=this.adapter.getAttr(oA.DATA_ARIA_LABEL_ON),t=this.adapter.getAttr(oA.DATA_ARIA_LABEL_OFF);if(e&&t){if(null!==this.adapter.getAttr(oA.ARIA_PRESSED))throw Error("MDCIconButtonToggleFoundation: Button should not set `aria-pressed` if it has a toggled aria label.");this.hasToggledAriaLabel=!0}else this.adapter.setAttr(oA.ARIA_PRESSED,String(this.isOn()))},t.prototype.handleClick=function(){this.toggle(),this.adapter.notifyChange({isOn:this.isOn()})},t.prototype.isOn=function(){return this.adapter.hasClass(oE.ICON_BUTTON_ON)},t.prototype.toggle=function(e){if(void 0===e&&(e=!this.isOn()),e?this.adapter.addClass(oE.ICON_BUTTON_ON):this.adapter.removeClass(oE.ICON_BUTTON_ON),this.hasToggledAriaLabel){var t=e?this.adapter.getAttr(oA.DATA_ARIA_LABEL_ON):this.adapter.getAttr(oA.DATA_ARIA_LABEL_OFF);this.adapter.setAttr(oA.ARIA_LABEL,t||"")}else this.adapter.setAttr(oA.ARIA_PRESSED,""+e)},t}(iz),oT=oC.strings,oS=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.rippleComponent=t.createRipple(),t}return iP(t,e),t.attachTo=function(e){return new t(e)},t.prototype.initialSyncWithDOM=function(){var e=this;this.handleClick=function(){e.foundation.handleClick()},this.listen("click",this.handleClick)},t.prototype.destroy=function(){this.unlisten("click",this.handleClick),this.ripple.destroy(),e.prototype.destroy.call(this)},t.prototype.getDefaultFoundation=function(){var e=this;return new oC({addClass:function(t){return e.root.classList.add(t)},hasClass:function(t){return e.root.classList.contains(t)},notifyChange:function(t){e.emit(oT.CHANGE_EVENT,t)},removeClass:function(t){return e.root.classList.remove(t)},getAttr:function(t){return e.root.getAttribute(t)},setAttr:function(t,n){return e.root.setAttribute(t,n)}})},Object.defineProperty(t.prototype,"ripple",{get:function(){return this.rippleComponent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"on",{get:function(){return this.foundation.isOn()},set:function(e){this.foundation.toggle(e)},enumerable:!0,configurable:!0}),t.prototype.createRipple=function(){var e=new i9(this.root);return e.unbounded=!0,e},t}(ij);let oM="important",oL=" !"+oM,oD=eF(class extends ek{constructor(e){if(super(e),e.type!==ew.ATTRIBUTE||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,n)=>{let i=e[n];return null==i?t:t+`${n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(e,[t]){let{style:n}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(let e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?n.removeProperty(e):n[e]=null);for(let e in t){let i=t[e];if(null!=i){this.ft.add(e);let t="string"==typeof i&&i.endsWith(oL);e.includes("-")||t?n.setProperty(e,t?i.slice(0,-11):i,t?oM:""):n[e]=i}}return X}});var oI=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let oR=n(73041),oO=n(61526);class oP extends CustomEvent{constructor(e){super(oP.NAME,{detail:e,bubbles:!0,composed:!0})}}function o$(e,t,n,i,r){switch(i=i||"listbox",e){case sH.RADIO:i="radiogroup";break;case sH.MULTI_CHECKBOX:i="group"}return K`
|
|
116
|
+
`:K``},onAdd:void 0})))}getConsoleAppConfig(){return iL(this,void 0,void 0,function*(){var e;try{let t=yield fetch((null!=(e=iR.managerUrl)?e:"")+"/consoleappconfig/"+iR.displayRealm+".json");return this._consoleAppConfig=yield t.json(),!0}catch(e){return!0}})}getConsolePreferredLanguage(){return iL(this,arguments,void 0,function*(e=this.console){return e.retrieveData("LANGUAGE")})}getUserPreferredLanguage(){return iL(this,arguments,void 0,function*(e=this._keycloak){if(e&&e.authenticated){let t=(null==e?void 0:e.profile)||(yield null==e?void 0:e.loadUserProfile());if(null==t?void 0:t.attributes){let e=new Map(Object.entries(t.attributes));if(e.has("locale")){let t=e.get("locale");if("string"==typeof t[0])return t[0]}console.warn("Could not get user language from keycloak: no user attributes were found.")}else console.warn("Could not get user language from keycloak: no valid keycloak user profile was found.")}})}updateKeycloakUserLanguage(e){return iL(this,arguments,void 0,function*(e,t=this.rest){return this.authenticated?t?void(yield t.api.UserResource.updateCurrentUserLocale(e,{headers:{"Content-Type":"application/json"}})):void console.warn("Tried updating user language, but the REST API is not initialized yet."):void console.warn("Tried updating user language, but the user is not authenticated.")})}logout(e){this._authenticated&&(this._authenticated=!0,this._keycloak?(this.isMobile()&&this.console.storeData("REFRESH_TOKEN",null),this._keycloakUpdateTokenInterval&&(window.clearTimeout(this._keycloakUpdateTokenInterval),this._keycloakUpdateTokenInterval=void 0),this._keycloak.logout(e&&""!==e?{redirectUri:e}:void 0)):this._basicIdentity&&(this._basicIdentity=void 0,e?window.location.href=e:window.location.reload()))}login(e){switch(this._config.auth){case"BASIC":e&&e.credentials&&(this._config.credentials=Object.assign({},e.credentials)),this.doBasicLogin();break;case"KEYCLOAK":if(this._keycloak){let t={};e&&e.redirectUrl&&""!==e.redirectUrl&&(t.redirectUri=e.redirectUrl),(null==e?void 0:e.action)&&""!==e.action&&(t.action=e.action),this.isMobile()&&(t.scope="offline_access"),this._keycloak.login(t)}}}initialiseBasicAuth(){return iL(this,void 0,void 0,function*(){return this.config.basicLoginProvider?(this.config.autoLogin&&(this._readyCallback=()=>this.doBasicLogin()),!0):(console.debug("No basicLoginProvider defined on config so cannot display login UI"),!1)})}doBasicLogin(){return iL(this,void 0,void 0,function*(){var e,t,n,i;if(!this.config.basicLoginProvider)return;let r={username:(null==(e=this.config.credentials)?void 0:e.username)?null==(t=this.config.credentials)?void 0:t.username:"",password:(null==(n=this.config.credentials)?void 0:n.password)?null==(i=this.config.credentials)?void 0:i.password:"",cancel:!1},o=!1;for(this._basicIdentity={roles:void 0,token:void 0,user:void 0};!o;){if((r=yield this.config.basicLoginProvider(r.username,r.password)).cancel){console.debug("Basic authentication cancelled by user");break}if(!r.username||!r.password)continue;this._basicIdentity.token=btoa(r.username+":"+r.password);let e=!1;try{let t=yield nq.api.UserResource.getCurrent();200===t.status&&(e=!0,this._basicIdentity.user=t.data),e||401!==t.status&&403!==t.status||console.debug("Basic authentication invalid credentials, trying again")}catch(e){console.error("Basic auth failed: ",e)}if(e){console.debug("Basic authentication successful"),o=!0;let e=yield nq.api.UserResource.getCurrentUserClientRoles(this.clientId);this._basicIdentity.roles=e.data}else{console.debug("Unknown response so aborting"),this._basicIdentity=void 0;break}}o&&this._onAuthenticated()})}isSuperUser(){return!!(this.getRealm()&&"master"===this.getRealm()&&this.hasRealmRole("admin"))}isRestrictedUser(){return!!this.hasRealmRole("restricted_user")}getApiBaseUrl(){return this._config.managerUrl+"/api/"+this._config.realm+"/"}getAppName(){let e=location.pathname.split("/");return e.length>=1?e[1]:""}hasRealmRole(e){return this.isKeycloak()&&this._keycloak.hasRealmRole(e)}hasRole(e,t=this._config.clientId){let n=this.roles;return n&&n.has(t)&&n.get(t).indexOf(e)>=0}getAuthorizationHeader(){return this.getKeycloakToken()?"Bearer "+this.getKeycloakToken():this.getBasicToken()?"Basic "+this.getBasicToken():void 0}getKeycloakToken(){if(this.isKeycloak())return this._keycloak.token}getBasicToken(){return this._basicIdentity?this._basicIdentity.token:void 0}getRealm(){if(this._config)return this._config.realm}isMobile(){return this.console&&this.console.isMobile}isKeycloak(){return!!this._keycloak}_onAuthenticated(){this._authenticated=!0}loadAndInitialiseKeycloak(){return iL(this,void 0,void 0,function*(){var e,t,n,i;try{this._keycloak=new iw({clientId:this._config.clientId,realm:this._config.realm,url:this._config.keycloakUrl});let r=yield this._getNativeOfflineRefreshToken(),o=yield this._keycloak.init({checkLoginIframe:!1,onLoad:"check-sso"});if(!o&&r)try{console.error("SETTING OFFLINE TOKEN"),this._keycloak.refreshToken=r,o=yield this._updateKeycloakAccessToken()}catch(e){console.error("Failed to authenticate using offline token")}if(o)this._name=null==(e=this._keycloak.tokenParsed)?void 0:e.name,this._username=null==(t=this._keycloak.tokenParsed)?void 0:t.preferred_username,this._createTokenUpdateInterval(),this.isMobile()&&(null==(i=null==(n=this._keycloak)?void 0:n.refreshTokenParsed)?void 0:i.typ)==="Offline"&&(console.debug("Storing offline refresh token"),this.console.storeData("REFRESH_TOKEN",this._keycloak.refreshToken)),this._onAuthenticated();else if(this.config.autoLogin)return this.login(),!1;return!0}catch(e){return this._authenticated=!1,this._setError(sN.AUTH_FAILED),console.error("Failed to initialise Keycloak: "+e),!1}})}_createTokenUpdateInterval(){this._keycloakUpdateTokenInterval||(this._keycloakUpdateTokenInterval=window.setInterval(()=>iL(this,void 0,void 0,function*(){yield this._updateKeycloakAccessToken().catch(()=>{console.debug("Keycloak failed to refresh the access token"),this._onDisconnect()})}),1e4))}_updateKeycloakAccessToken(){return iL(this,void 0,void 0,function*(){let e=yield this._keycloak.updateToken(20);return console.debug("Access token update success, refreshed from server: "+e),e&&this._onAuthenticated(),e})}_getNativeOfflineRefreshToken(){return iL(this,void 0,void 0,function*(){if(this.isMobile())return yield this.console.retrieveData("REFRESH_TOKEN")})}_emitEvent(e){window.setTimeout(()=>{for(let t of this._listeners)t(e)},0)}_setError(e){this._error=e,this._emitEvent(sB.ERROR),console.warn("Error set: "+e)}_clearWebHistory(){var e;null==(e=this.console)||e._doSendGenericMessage("CLEAR_WEB_HISTORY",void 0)}_onDisconnect(){return iL(this,void 0,void 0,function*(){this._disconnected||(console.debug("Disconnected"),this._disconnected=!0,this._keycloakUpdateTokenInterval&&(window.clearTimeout(this._keycloakUpdateTokenInterval),this._keycloakUpdateTokenInterval=void 0),this._emitEvent(sB.OFFLINE),this.reconnect())})}_onReconnected(){console.debug("Reconnected"),this._disconnected=!1,this._createTokenUpdateInterval(),this._emitEvent(sB.ONLINE)}reconnect(){return iL(this,arguments,void 0,function*(e=3e3){if(!this._disconnected)return;this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=void 0);let t=()=>iL(this,void 0,void 0,function*(){var e;if(console.debug("Attempting reconnect"),!(yield this.isKeycloakReachable()))return console.debug("Keycloak is unreachable"),!1;console.debug("Keycloak is reachable"),console.debug("Checking keycloak access token");try{yield this._updateKeycloakAccessToken()}catch(t){let e=yield this._getNativeOfflineRefreshToken();this._keycloak.refreshToken=e;try{yield this._updateKeycloakAccessToken()}catch(e){console.debug("Cannot update access token so sending to login"),this.login();return}return console.debug("Keycloak access token is valid"),!0}let t=this.events&&this.events.status===sR.CONNECTING;return console.debug("If event provider offline then attempting reconnect: offline="+t),!t||(yield null==(e=this.events)?void 0:e.connect())}),n=yield t();if(void 0!==n){if(!n){console.debug("Scheduling another reconnect attempt in (ms): "+(e=Math.min(iI.MAX_RECONNECT_DELAY,e+3e3))),this._reconnectTimer=window.setTimeout(()=>this.reconnect(e),e);return}this._onReconnected()}})}isKeycloakReachable(){return iL(this,arguments,void 0,function*(e=2e3){let t=new AbortController,n=setTimeout(()=>t.abort(),e);try{let e=this._keycloak.endpoints.token(),n=yield fetch(e,{method:"OPTIONS",signal:t.signal});return 200===n.status}catch(e){return!1}finally{clearTimeout(n)}})}}iI.MAX_RECONNECT_DELAY=45e3;let iR=new iI,iO=iR,iP=eF(class extends ek{constructor(e){if(super(e),e.type!==ew.ATTRIBUTE||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){if(void 0===this.st){for(let n in this.st=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(e=>""!==e))),t)t[n]&&!this.nt?.has(n)&&this.st.add(n);return this.render(t)}let n=e.element.classList;for(let e of this.st)e in t||(n.remove(e),this.st.delete(e));for(let e in t){let i=!!t[e];i===this.st.has(e)||this.nt?.has(e)||(i?(n.add(e),this.st.add(e)):(n.remove(e),this.st.delete(e)))}return X}});var i$=function(e,t){return(i$=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function iN(e,t){function n(){this.constructor=e}i$(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var iB=function(){return(iB=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function iz(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ij(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}(arguments[t]));return e}var iY=function(){function e(e){void 0===e&&(e={}),this.adapter=e}return Object.defineProperty(e,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),e.prototype.init=function(){},e.prototype.destroy=function(){},e}(),iH=function(){function e(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.root=e,this.initialize.apply(this,ij(n)),this.foundation=void 0===t?this.getDefaultFoundation():t,this.foundation.init(),this.initialSyncWithDOM()}return e.attachTo=function(t){return new e(t,new iY({}))},e.prototype.initialize=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.getDefaultFoundation=function(){throw Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},e.prototype.initialSyncWithDOM=function(){},e.prototype.destroy=function(){this.foundation.destroy()},e.prototype.listen=function(e,t,n){this.root.addEventListener(e,t,n)},e.prototype.unlisten=function(e,t,n){this.root.removeEventListener(e,t,n)},e.prototype.emit=function(e,t,n){var i;void 0===n&&(n=!1),"function"==typeof CustomEvent?i=new CustomEvent(e,{bubbles:n,detail:t}):(i=document.createEvent("CustomEvent")).initCustomEvent(e,n,!1,t),this.root.dispatchEvent(i)},e}();function iU(e){return void 0===e&&(e=window),!!function(e){void 0===e&&(e=window);var t=!1;try{var n={get passive(){return t=!0,!1}},i=function(){};e.document.addEventListener("test",i,n),e.document.removeEventListener("test",i,n)}catch(e){t=!1}return t}(e)&&{passive:!0}}function iV(e,t){if(e.closest)return e.closest(t);for(var n=e;n;){if(iW(n,t))return n;n=n.parentElement}return null}function iW(e,t){return(e.matches||e.webkitMatchesSelector||e.msMatchesSelector).call(e,t)}var iG={LABEL_FLOAT_ABOVE:"mdc-floating-label--float-above",LABEL_REQUIRED:"mdc-floating-label--required",LABEL_SHAKE:"mdc-floating-label--shake",ROOT:"mdc-floating-label"},iq=function(e){function t(n){var i=e.call(this,iB(iB({},t.defaultAdapter),n))||this;return i.shakeAnimationEndHandler_=function(){return i.handleShakeAnimationEnd_()},i}return iN(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return iG},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},getWidth:function(){return 0},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){this.adapter.registerInteractionHandler("animationend",this.shakeAnimationEndHandler_)},t.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("animationend",this.shakeAnimationEndHandler_)},t.prototype.getWidth=function(){return this.adapter.getWidth()},t.prototype.shake=function(e){var n=t.cssClasses.LABEL_SHAKE;e?this.adapter.addClass(n):this.adapter.removeClass(n)},t.prototype.float=function(e){var n=t.cssClasses,i=n.LABEL_FLOAT_ABOVE,r=n.LABEL_SHAKE;e?this.adapter.addClass(i):(this.adapter.removeClass(i),this.adapter.removeClass(r))},t.prototype.setRequired=function(e){var n=t.cssClasses.LABEL_REQUIRED;e?this.adapter.addClass(n):this.adapter.removeClass(n)},t.prototype.handleShakeAnimationEnd_=function(){var e=t.cssClasses.LABEL_SHAKE;this.adapter.removeClass(e)},t}(iY),iK=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iN(t,e),t.attachTo=function(e){return new t(e)},t.prototype.shake=function(e){this.foundation.shake(e)},t.prototype.float=function(e){this.foundation.float(e)},t.prototype.setRequired=function(e){this.foundation.setRequired(e)},t.prototype.getWidth=function(){return this.foundation.getWidth()},t.prototype.getDefaultFoundation=function(){var e=this;return new iq({addClass:function(t){return e.root.classList.add(t)},removeClass:function(t){return e.root.classList.remove(t)},getWidth:function(){var t=e.root;if(null!==t.offsetParent)return t.scrollWidth;var n=t.cloneNode(!0);n.style.setProperty("position","absolute"),n.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(n);var i=n.scrollWidth;return document.documentElement.removeChild(n),i},registerInteractionHandler:function(t,n){return e.listen(t,n)},deregisterInteractionHandler:function(t,n){return e.unlisten(t,n)}})},t}(iH),iX={LINE_RIPPLE_ACTIVE:"mdc-line-ripple--active",LINE_RIPPLE_DEACTIVATING:"mdc-line-ripple--deactivating"},iZ=function(e){function t(n){var i=e.call(this,iB(iB({},t.defaultAdapter),n))||this;return i.transitionEndHandler_=function(e){return i.handleTransitionEnd(e)},i}return iN(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return iX},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setStyle:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){this.adapter.registerEventHandler("transitionend",this.transitionEndHandler_)},t.prototype.destroy=function(){this.adapter.deregisterEventHandler("transitionend",this.transitionEndHandler_)},t.prototype.activate=function(){this.adapter.removeClass(iX.LINE_RIPPLE_DEACTIVATING),this.adapter.addClass(iX.LINE_RIPPLE_ACTIVE)},t.prototype.setRippleCenter=function(e){this.adapter.setStyle("transform-origin",e+"px center")},t.prototype.deactivate=function(){this.adapter.addClass(iX.LINE_RIPPLE_DEACTIVATING)},t.prototype.handleTransitionEnd=function(e){var t=this.adapter.hasClass(iX.LINE_RIPPLE_DEACTIVATING);"opacity"===e.propertyName&&t&&(this.adapter.removeClass(iX.LINE_RIPPLE_ACTIVE),this.adapter.removeClass(iX.LINE_RIPPLE_DEACTIVATING))},t}(iY),iJ=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iN(t,e),t.attachTo=function(e){return new t(e)},t.prototype.activate=function(){this.foundation.activate()},t.prototype.deactivate=function(){this.foundation.deactivate()},t.prototype.setRippleCenter=function(e){this.foundation.setRippleCenter(e)},t.prototype.getDefaultFoundation=function(){var e=this;return new iZ({addClass:function(t){return e.root.classList.add(t)},removeClass:function(t){return e.root.classList.remove(t)},hasClass:function(t){return e.root.classList.contains(t)},setStyle:function(t,n){return e.root.style.setProperty(t,n)},registerEventHandler:function(t,n){return e.listen(t,n)},deregisterEventHandler:function(t,n){return e.unlisten(t,n)}})},t}(iH),iQ={NOTCH_ELEMENT_SELECTOR:".mdc-notched-outline__notch"},i0={NOTCH_ELEMENT_PADDING:8},i1={NO_LABEL:"mdc-notched-outline--no-label",OUTLINE_NOTCHED:"mdc-notched-outline--notched",OUTLINE_UPGRADED:"mdc-notched-outline--upgraded"},i2=function(e){function t(n){return e.call(this,iB(iB({},t.defaultAdapter),n))||this}return iN(t,e),Object.defineProperty(t,"strings",{get:function(){return iQ},enumerable:!0,configurable:!0}),Object.defineProperty(t,"cssClasses",{get:function(){return i1},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return i0},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNotchWidthProperty:function(){},removeNotchWidthProperty:function(){}}},enumerable:!0,configurable:!0}),t.prototype.notch=function(e){var n=t.cssClasses.OUTLINE_NOTCHED;e>0&&(e+=i0.NOTCH_ELEMENT_PADDING),this.adapter.setNotchWidthProperty(e),this.adapter.addClass(n)},t.prototype.closeNotch=function(){var e=t.cssClasses.OUTLINE_NOTCHED;this.adapter.removeClass(e),this.adapter.removeNotchWidthProperty()},t}(iY),i5=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iN(t,e),t.attachTo=function(e){return new t(e)},t.prototype.initialSyncWithDOM=function(){this.notchElement_=this.root.querySelector(iQ.NOTCH_ELEMENT_SELECTOR);var e=this.root.querySelector("."+iq.cssClasses.ROOT);e?(e.style.transitionDuration="0s",this.root.classList.add(i1.OUTLINE_UPGRADED),requestAnimationFrame(function(){e.style.transitionDuration=""})):this.root.classList.add(i1.NO_LABEL)},t.prototype.notch=function(e){this.foundation.notch(e)},t.prototype.closeNotch=function(){this.foundation.closeNotch()},t.prototype.getDefaultFoundation=function(){var e=this;return new i2({addClass:function(t){return e.root.classList.add(t)},removeClass:function(t){return e.root.classList.remove(t)},setNotchWidthProperty:function(t){return e.notchElement_.style.setProperty("width",t+"px")},removeNotchWidthProperty:function(){return e.notchElement_.style.removeProperty("width")}})},t}(iH),i3={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},i4={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},i6={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300},i8=["touchstart","pointerdown","mousedown","keydown"],i7=["touchend","pointerup","mouseup","contextmenu"],i9=[],re=function(e){function t(n){var i=e.call(this,iB(iB({},t.defaultAdapter),n))||this;return i.activationAnimationHasEnded_=!1,i.activationTimer_=0,i.fgDeactivationRemovalTimer_=0,i.fgScale_="0",i.frame_={width:0,height:0},i.initialSize_=0,i.layoutFrame_=0,i.maxRadius_=0,i.unboundedCoords_={left:0,top:0},i.activationState_=i.defaultActivationState_(),i.activationTimerCallback_=function(){i.activationAnimationHasEnded_=!0,i.runDeactivationUXLogicIfReady_()},i.activateHandler_=function(e){return i.activate_(e)},i.deactivateHandler_=function(){return i.deactivate_()},i.focusHandler_=function(){return i.handleFocus()},i.blurHandler_=function(){return i.handleBlur()},i.resizeHandler_=function(){return i.layout()},i}return iN(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return i3},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return i4},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return i6},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){var e=this,n=this.supportsPressRipple_();if(this.registerRootHandlers_(n),n){var i=t.cssClasses,r=i.ROOT,o=i.UNBOUNDED;requestAnimationFrame(function(){e.adapter.addClass(r),e.adapter.isUnbounded()&&(e.adapter.addClass(o),e.layoutInternal_())})}},t.prototype.destroy=function(){var e=this;if(this.supportsPressRipple_()){this.activationTimer_&&(clearTimeout(this.activationTimer_),this.activationTimer_=0,this.adapter.removeClass(t.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer_&&(clearTimeout(this.fgDeactivationRemovalTimer_),this.fgDeactivationRemovalTimer_=0,this.adapter.removeClass(t.cssClasses.FG_DEACTIVATION));var n=t.cssClasses,i=n.ROOT,r=n.UNBOUNDED;requestAnimationFrame(function(){e.adapter.removeClass(i),e.adapter.removeClass(r),e.removeCssVars_()})}this.deregisterRootHandlers_(),this.deregisterDeactivationHandlers_()},t.prototype.activate=function(e){this.activate_(e)},t.prototype.deactivate=function(){this.deactivate_()},t.prototype.layout=function(){var e=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame(function(){e.layoutInternal_(),e.layoutFrame_=0})},t.prototype.setUnbounded=function(e){var n=t.cssClasses.UNBOUNDED;e?this.adapter.addClass(n):this.adapter.removeClass(n)},t.prototype.handleFocus=function(){var e=this;requestAnimationFrame(function(){return e.adapter.addClass(t.cssClasses.BG_FOCUSED)})},t.prototype.handleBlur=function(){var e=this;requestAnimationFrame(function(){return e.adapter.removeClass(t.cssClasses.BG_FOCUSED)})},t.prototype.supportsPressRipple_=function(){return this.adapter.browserSupportsCssVars()},t.prototype.defaultActivationState_=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},t.prototype.registerRootHandlers_=function(e){var t=this;e&&(i8.forEach(function(e){t.adapter.registerInteractionHandler(e,t.activateHandler_)}),this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler_)),this.adapter.registerInteractionHandler("focus",this.focusHandler_),this.adapter.registerInteractionHandler("blur",this.blurHandler_)},t.prototype.registerDeactivationHandlers_=function(e){var t=this;"keydown"===e.type?this.adapter.registerInteractionHandler("keyup",this.deactivateHandler_):i7.forEach(function(e){t.adapter.registerDocumentInteractionHandler(e,t.deactivateHandler_)})},t.prototype.deregisterRootHandlers_=function(){var e=this;i8.forEach(function(t){e.adapter.deregisterInteractionHandler(t,e.activateHandler_)}),this.adapter.deregisterInteractionHandler("focus",this.focusHandler_),this.adapter.deregisterInteractionHandler("blur",this.blurHandler_),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler_)},t.prototype.deregisterDeactivationHandlers_=function(){var e=this;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler_),i7.forEach(function(t){e.adapter.deregisterDocumentInteractionHandler(t,e.deactivateHandler_)})},t.prototype.removeCssVars_=function(){var e=this,n=t.strings;Object.keys(n).forEach(function(t){0===t.indexOf("VAR_")&&e.adapter.updateCssVariable(n[t],null)})},t.prototype.activate_=function(e){var t=this;if(!this.adapter.isSurfaceDisabled()){var n=this.activationState_;if(!n.isActivated){var i=this.previousActivationEvent_;if(!(i&&void 0!==e&&i.type!==e.type)){if(n.isActivated=!0,n.isProgrammatic=void 0===e,n.activationEvent=e,n.wasActivatedByPointer=!n.isProgrammatic&&void 0!==e&&("mousedown"===e.type||"touchstart"===e.type||"pointerdown"===e.type),void 0!==e&&i9.length>0&&i9.some(function(e){return t.adapter.containsEventTarget(e)}))return void this.resetActivationState_();void 0!==e&&(i9.push(e.target),this.registerDeactivationHandlers_(e)),n.wasElementMadeActive=this.checkElementMadeActive_(e),n.wasElementMadeActive&&this.animateActivation_(),requestAnimationFrame(function(){i9=[],!n.wasElementMadeActive&&void 0!==e&&(" "===e.key||32===e.keyCode)&&(n.wasElementMadeActive=t.checkElementMadeActive_(e),n.wasElementMadeActive&&t.animateActivation_()),n.wasElementMadeActive||(t.activationState_=t.defaultActivationState_())})}}}},t.prototype.checkElementMadeActive_=function(e){return void 0===e||"keydown"!==e.type||this.adapter.isSurfaceActive()},t.prototype.animateActivation_=function(){var e=this,n=t.strings,i=n.VAR_FG_TRANSLATE_START,r=n.VAR_FG_TRANSLATE_END,o=t.cssClasses,a=o.FG_DEACTIVATION,s=o.FG_ACTIVATION,l=t.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal_();var c="",d="";if(!this.adapter.isUnbounded()){var u=this.getFgTranslationCoordinates_(),h=u.startPoint,m=u.endPoint;c=h.x+"px, "+h.y+"px",d=m.x+"px, "+m.y+"px"}this.adapter.updateCssVariable(i,c),this.adapter.updateCssVariable(r,d),clearTimeout(this.activationTimer_),clearTimeout(this.fgDeactivationRemovalTimer_),this.rmBoundedActivationClasses_(),this.adapter.removeClass(a),this.adapter.computeBoundingRect(),this.adapter.addClass(s),this.activationTimer_=setTimeout(function(){return e.activationTimerCallback_()},l)},t.prototype.getFgTranslationCoordinates_=function(){var e,t=this.activationState_,n=t.activationEvent;return{startPoint:e={x:(e=t.wasActivatedByPointer?function(e,t,n){if(!e)return{x:0,y:0};var i,r,o=t.x,a=t.y,s=o+n.left,l=a+n.top;return"touchstart"===e.type?(i=e.changedTouches[0].pageX-s,r=e.changedTouches[0].pageY-l):(i=e.pageX-s,r=e.pageY-l),{x:i,y:r}}(n,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):{x:this.frame_.width/2,y:this.frame_.height/2}).x-this.initialSize_/2,y:e.y-this.initialSize_/2},endPoint:{x:this.frame_.width/2-this.initialSize_/2,y:this.frame_.height/2-this.initialSize_/2}}},t.prototype.runDeactivationUXLogicIfReady_=function(){var e=this,n=t.cssClasses.FG_DEACTIVATION,i=this.activationState_,r=i.hasDeactivationUXRun,o=i.isActivated;(r||!o)&&this.activationAnimationHasEnded_&&(this.rmBoundedActivationClasses_(),this.adapter.addClass(n),this.fgDeactivationRemovalTimer_=setTimeout(function(){e.adapter.removeClass(n)},i6.FG_DEACTIVATION_MS))},t.prototype.rmBoundedActivationClasses_=function(){var e=t.cssClasses.FG_ACTIVATION;this.adapter.removeClass(e),this.activationAnimationHasEnded_=!1,this.adapter.computeBoundingRect()},t.prototype.resetActivationState_=function(){var e=this;this.previousActivationEvent_=this.activationState_.activationEvent,this.activationState_=this.defaultActivationState_(),setTimeout(function(){return e.previousActivationEvent_=void 0},t.numbers.TAP_DELAY_MS)},t.prototype.deactivate_=function(){var e=this,t=this.activationState_;if(t.isActivated){var n=iB({},t);t.isProgrammatic?(requestAnimationFrame(function(){return e.animateDeactivation_(n)}),this.resetActivationState_()):(this.deregisterDeactivationHandlers_(),requestAnimationFrame(function(){e.activationState_.hasDeactivationUXRun=!0,e.animateDeactivation_(n),e.resetActivationState_()}))}},t.prototype.animateDeactivation_=function(e){var t=e.wasActivatedByPointer,n=e.wasElementMadeActive;(t||n)&&this.runDeactivationUXLogicIfReady_()},t.prototype.layoutInternal_=function(){this.frame_=this.adapter.computeBoundingRect();var e=Math.max(this.frame_.height,this.frame_.width);this.maxRadius_=this.adapter.isUnbounded()?e:Math.sqrt(Math.pow(this.frame_.width,2)+Math.pow(this.frame_.height,2))+t.numbers.PADDING;var n=Math.floor(e*t.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&n%2!=0?this.initialSize_=n-1:this.initialSize_=n,this.fgScale_=""+this.maxRadius_/this.initialSize_,this.updateLayoutCssVars_()},t.prototype.updateLayoutCssVars_=function(){var e=t.strings,n=e.VAR_FG_SIZE,i=e.VAR_LEFT,r=e.VAR_TOP,o=e.VAR_FG_SCALE;this.adapter.updateCssVariable(n,this.initialSize_+"px"),this.adapter.updateCssVariable(o,this.fgScale_),this.adapter.isUnbounded()&&(this.unboundedCoords_={left:Math.round(this.frame_.width/2-this.initialSize_/2),top:Math.round(this.frame_.height/2-this.initialSize_/2)},this.adapter.updateCssVariable(i,this.unboundedCoords_.left+"px"),this.adapter.updateCssVariable(r,this.unboundedCoords_.top+"px"))},t}(iY),rt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.disabled=!1,t}return iN(t,e),t.attachTo=function(e,n){void 0===n&&(n={isUnbounded:void 0});var i=new t(e);return void 0!==n.isUnbounded&&(i.unbounded=n.isUnbounded),i},t.createAdapter=function(e){return{addClass:function(t){return e.root.classList.add(t)},browserSupportsCssVars:function(){return function(e,t){void 0===t&&(t=!1);var n=e.CSS,i=sz;if("boolean"==typeof sz&&!t)return sz;if(!(n&&"function"==typeof n.supports))return!1;var r=n.supports("--css-vars","yes"),o=n.supports("(--css-vars: yes)")&&n.supports("color","#00000000");return i=r||o,t||(sz=i),i}(window)},computeBoundingRect:function(){return e.root.getBoundingClientRect()},containsEventTarget:function(t){return e.root.contains(t)},deregisterDocumentInteractionHandler:function(e,t){return document.documentElement.removeEventListener(e,t,iU())},deregisterInteractionHandler:function(t,n){return e.root.removeEventListener(t,n,iU())},deregisterResizeHandler:function(e){return window.removeEventListener("resize",e)},getWindowPageOffset:function(){return{x:window.pageXOffset,y:window.pageYOffset}},isSurfaceActive:function(){return iW(e.root,":active")},isSurfaceDisabled:function(){return!!e.disabled},isUnbounded:function(){return!!e.unbounded},registerDocumentInteractionHandler:function(e,t){return document.documentElement.addEventListener(e,t,iU())},registerInteractionHandler:function(t,n){return e.root.addEventListener(t,n,iU())},registerResizeHandler:function(e){return window.addEventListener("resize",e)},removeClass:function(t){return e.root.classList.remove(t)},updateCssVariable:function(t,n){return e.root.style.setProperty(t,n)}}},Object.defineProperty(t.prototype,"unbounded",{get:function(){return!!this.unbounded_},set:function(e){this.unbounded_=!!e,this.setUnbounded_()},enumerable:!0,configurable:!0}),t.prototype.activate=function(){this.foundation.activate()},t.prototype.deactivate=function(){this.foundation.deactivate()},t.prototype.layout=function(){this.foundation.layout()},t.prototype.getDefaultFoundation=function(){return new re(t.createAdapter(this))},t.prototype.initialSyncWithDOM=function(){var e=this.root;this.unbounded="mdcRippleIsUnbounded"in e.dataset},t.prototype.setUnbounded_=function(){this.foundation.setUnbounded(!!this.unbounded_)},t}(iH),rn={ROOT:"mdc-text-field-character-counter"},ri={ROOT_SELECTOR:"."+rn.ROOT},rr=function(e){function t(n){return e.call(this,iB(iB({},t.defaultAdapter),n))||this}return iN(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return rn},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return ri},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{setContent:function(){}}},enumerable:!0,configurable:!0}),t.prototype.setCounterValue=function(e,t){e=Math.min(e,t),this.adapter.setContent(e+" / "+t)},t}(iY),ro=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iN(t,e),t.attachTo=function(e){return new t(e)},Object.defineProperty(t.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),t.prototype.getDefaultFoundation=function(){var e=this;return new rr({setContent:function(t){e.root.textContent=t}})},t}(iH),ra={ARIA_CONTROLS:"aria-controls",ARIA_DESCRIBEDBY:"aria-describedby",INPUT_SELECTOR:".mdc-text-field__input",LABEL_SELECTOR:".mdc-floating-label",LEADING_ICON_SELECTOR:".mdc-text-field__icon--leading",LINE_RIPPLE_SELECTOR:".mdc-line-ripple",OUTLINE_SELECTOR:".mdc-notched-outline",PREFIX_SELECTOR:".mdc-text-field__affix--prefix",SUFFIX_SELECTOR:".mdc-text-field__affix--suffix",TRAILING_ICON_SELECTOR:".mdc-text-field__icon--trailing"},rs={DISABLED:"mdc-text-field--disabled",FOCUSED:"mdc-text-field--focused",HELPER_LINE:"mdc-text-field-helper-line",INVALID:"mdc-text-field--invalid",LABEL_FLOATING:"mdc-text-field--label-floating",NO_LABEL:"mdc-text-field--no-label",OUTLINED:"mdc-text-field--outlined",ROOT:"mdc-text-field",TEXTAREA:"mdc-text-field--textarea",WITH_LEADING_ICON:"mdc-text-field--with-leading-icon",WITH_TRAILING_ICON:"mdc-text-field--with-trailing-icon"},rl={LABEL_SCALE:.75},rc=["pattern","min","max","required","step","minlength","maxlength"],rd=["color","date","datetime-local","month","range","time","week"],ru=["mousedown","touchstart"],rh=["click","keydown"],rm=function(e){function t(n,i){void 0===i&&(i={});var r=e.call(this,iB(iB({},t.defaultAdapter),n))||this;return r.isFocused_=!1,r.receivedUserInput_=!1,r.isValid_=!0,r.useNativeValidation_=!0,r.validateOnValueChange_=!0,r.helperText_=i.helperText,r.characterCounter_=i.characterCounter,r.leadingIcon_=i.leadingIcon,r.trailingIcon_=i.trailingIcon,r.inputFocusHandler_=function(){return r.activateFocus()},r.inputBlurHandler_=function(){return r.deactivateFocus()},r.inputInputHandler_=function(){return r.handleInput()},r.setPointerXOffset_=function(e){return r.setTransformOrigin(e)},r.textFieldInteractionHandler_=function(){return r.handleTextFieldInteraction()},r.validationAttributeChangeHandler_=function(e){return r.handleValidationAttributeChange(e)},r}return iN(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return rs},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return ra},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return rl},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldAlwaysFloat_",{get:function(){var e=this.getNativeInput_().type;return rd.indexOf(e)>=0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldFloat",{get:function(){return this.shouldAlwaysFloat_||this.isFocused_||!!this.getValue()||this.isBadInput_()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldShake",{get:function(){return!this.isFocused_&&!this.isValid()&&!!this.getValue()},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!0},setInputAttr:function(){},removeInputAttr:function(){},registerTextFieldInteractionHandler:function(){},deregisterTextFieldInteractionHandler:function(){},registerInputInteractionHandler:function(){},deregisterInputInteractionHandler:function(){},registerValidationAttributeChangeHandler:function(){return new MutationObserver(function(){})},deregisterValidationAttributeChangeHandler:function(){},getNativeInput:function(){return null},isFocused:function(){return!1},activateLineRipple:function(){},deactivateLineRipple:function(){},setLineRippleTransformOrigin:function(){},shakeLabel:function(){},floatLabel:function(){},setLabelRequired:function(){},hasLabel:function(){return!1},getLabelWidth:function(){return 0},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){var e=this;this.adapter.hasLabel()&&this.getNativeInput_().required&&this.adapter.setLabelRequired(!0),this.adapter.isFocused()?this.inputFocusHandler_():this.adapter.hasLabel()&&this.shouldFloat&&(this.notchOutline(!0),this.adapter.floatLabel(!0),this.styleFloating_(!0)),this.adapter.registerInputInteractionHandler("focus",this.inputFocusHandler_),this.adapter.registerInputInteractionHandler("blur",this.inputBlurHandler_),this.adapter.registerInputInteractionHandler("input",this.inputInputHandler_),ru.forEach(function(t){e.adapter.registerInputInteractionHandler(t,e.setPointerXOffset_)}),rh.forEach(function(t){e.adapter.registerTextFieldInteractionHandler(t,e.textFieldInteractionHandler_)}),this.validationObserver_=this.adapter.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_),this.setCharacterCounter_(this.getValue().length)},t.prototype.destroy=function(){var e=this;this.adapter.deregisterInputInteractionHandler("focus",this.inputFocusHandler_),this.adapter.deregisterInputInteractionHandler("blur",this.inputBlurHandler_),this.adapter.deregisterInputInteractionHandler("input",this.inputInputHandler_),ru.forEach(function(t){e.adapter.deregisterInputInteractionHandler(t,e.setPointerXOffset_)}),rh.forEach(function(t){e.adapter.deregisterTextFieldInteractionHandler(t,e.textFieldInteractionHandler_)}),this.adapter.deregisterValidationAttributeChangeHandler(this.validationObserver_)},t.prototype.handleTextFieldInteraction=function(){var e=this.adapter.getNativeInput();e&&e.disabled||(this.receivedUserInput_=!0)},t.prototype.handleValidationAttributeChange=function(e){var t=this;e.some(function(e){return rc.indexOf(e)>-1&&(t.styleValidity_(!0),t.adapter.setLabelRequired(t.getNativeInput_().required),!0)}),e.indexOf("maxlength")>-1&&this.setCharacterCounter_(this.getValue().length)},t.prototype.notchOutline=function(e){if(this.adapter.hasOutline()&&this.adapter.hasLabel())if(e){var t=this.adapter.getLabelWidth()*rl.LABEL_SCALE;this.adapter.notchOutline(t)}else this.adapter.closeOutline()},t.prototype.activateFocus=function(){this.isFocused_=!0,this.styleFocused_(this.isFocused_),this.adapter.activateLineRipple(),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake)),this.helperText_&&(this.helperText_.isPersistent()||!this.helperText_.isValidation()||!this.isValid_)&&this.helperText_.showToScreenReader()},t.prototype.setTransformOrigin=function(e){if(!(this.isDisabled()||this.adapter.hasOutline())){var t=e.touches,n=t?t[0]:e,i=n.target.getBoundingClientRect(),r=n.clientX-i.left;this.adapter.setLineRippleTransformOrigin(r)}},t.prototype.handleInput=function(){this.autoCompleteFocus(),this.setCharacterCounter_(this.getValue().length)},t.prototype.autoCompleteFocus=function(){this.receivedUserInput_||this.activateFocus()},t.prototype.deactivateFocus=function(){this.isFocused_=!1,this.adapter.deactivateLineRipple();var e=this.isValid();this.styleValidity_(e),this.styleFocused_(this.isFocused_),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake)),this.shouldFloat||(this.receivedUserInput_=!1)},t.prototype.getValue=function(){return this.getNativeInput_().value},t.prototype.setValue=function(e){if(this.getValue()!==e&&(this.getNativeInput_().value=e),this.setCharacterCounter_(e.length),this.validateOnValueChange_){var t=this.isValid();this.styleValidity_(t)}this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.validateOnValueChange_&&this.adapter.shakeLabel(this.shouldShake))},t.prototype.isValid=function(){return this.useNativeValidation_?this.isNativeInputValid_():this.isValid_},t.prototype.setValid=function(e){this.isValid_=e,this.styleValidity_(e);var t=!e&&!this.isFocused_&&!!this.getValue();this.adapter.hasLabel()&&this.adapter.shakeLabel(t)},t.prototype.setValidateOnValueChange=function(e){this.validateOnValueChange_=e},t.prototype.getValidateOnValueChange=function(){return this.validateOnValueChange_},t.prototype.setUseNativeValidation=function(e){this.useNativeValidation_=e},t.prototype.isDisabled=function(){return this.getNativeInput_().disabled},t.prototype.setDisabled=function(e){this.getNativeInput_().disabled=e,this.styleDisabled_(e)},t.prototype.setHelperTextContent=function(e){this.helperText_&&this.helperText_.setContent(e)},t.prototype.setLeadingIconAriaLabel=function(e){this.leadingIcon_&&this.leadingIcon_.setAriaLabel(e)},t.prototype.setLeadingIconContent=function(e){this.leadingIcon_&&this.leadingIcon_.setContent(e)},t.prototype.setTrailingIconAriaLabel=function(e){this.trailingIcon_&&this.trailingIcon_.setAriaLabel(e)},t.prototype.setTrailingIconContent=function(e){this.trailingIcon_&&this.trailingIcon_.setContent(e)},t.prototype.setCharacterCounter_=function(e){if(this.characterCounter_){var t=this.getNativeInput_().maxLength;if(-1===t)throw Error("MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.");this.characterCounter_.setCounterValue(e,t)}},t.prototype.isBadInput_=function(){return this.getNativeInput_().validity.badInput||!1},t.prototype.isNativeInputValid_=function(){return this.getNativeInput_().validity.valid},t.prototype.styleValidity_=function(e){var n=t.cssClasses.INVALID;if(e?this.adapter.removeClass(n):this.adapter.addClass(n),this.helperText_){if(this.helperText_.setValidity(e),!this.helperText_.isValidation())return;var i=this.helperText_.isVisible(),r=this.helperText_.getId();i&&r?this.adapter.setInputAttr(ra.ARIA_DESCRIBEDBY,r):this.adapter.removeInputAttr(ra.ARIA_DESCRIBEDBY)}},t.prototype.styleFocused_=function(e){var n=t.cssClasses.FOCUSED;e?this.adapter.addClass(n):this.adapter.removeClass(n)},t.prototype.styleDisabled_=function(e){var n=t.cssClasses,i=n.DISABLED,r=n.INVALID;e?(this.adapter.addClass(i),this.adapter.removeClass(r)):this.adapter.removeClass(i),this.leadingIcon_&&this.leadingIcon_.setDisabled(e),this.trailingIcon_&&this.trailingIcon_.setDisabled(e)},t.prototype.styleFloating_=function(e){var n=t.cssClasses.LABEL_FLOATING;e?this.adapter.addClass(n):this.adapter.removeClass(n)},t.prototype.getNativeInput_=function(){return(this.adapter?this.adapter.getNativeInput():null)||{disabled:!1,maxLength:-1,required:!1,type:"input",validity:{badInput:!1,valid:!0},value:""}},t}(iY),rf={HELPER_TEXT_PERSISTENT:"mdc-text-field-helper-text--persistent",HELPER_TEXT_VALIDATION_MSG:"mdc-text-field-helper-text--validation-msg",ROOT:"mdc-text-field-helper-text"},rp={ARIA_HIDDEN:"aria-hidden",ROLE:"role",ROOT_SELECTOR:"."+rf.ROOT},rg=function(e){function t(n){return e.call(this,iB(iB({},t.defaultAdapter),n))||this}return iN(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return rf},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return rp},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){}}},enumerable:!0,configurable:!0}),t.prototype.getId=function(){return this.adapter.getAttr("id")},t.prototype.isVisible=function(){return"true"!==this.adapter.getAttr(rp.ARIA_HIDDEN)},t.prototype.setContent=function(e){this.adapter.setContent(e)},t.prototype.isPersistent=function(){return this.adapter.hasClass(rf.HELPER_TEXT_PERSISTENT)},t.prototype.setPersistent=function(e){e?this.adapter.addClass(rf.HELPER_TEXT_PERSISTENT):this.adapter.removeClass(rf.HELPER_TEXT_PERSISTENT)},t.prototype.isValidation=function(){return this.adapter.hasClass(rf.HELPER_TEXT_VALIDATION_MSG)},t.prototype.setValidation=function(e){e?this.adapter.addClass(rf.HELPER_TEXT_VALIDATION_MSG):this.adapter.removeClass(rf.HELPER_TEXT_VALIDATION_MSG)},t.prototype.showToScreenReader=function(){this.adapter.removeAttr(rp.ARIA_HIDDEN)},t.prototype.setValidity=function(e){var t=this.adapter.hasClass(rf.HELPER_TEXT_PERSISTENT),n=this.adapter.hasClass(rf.HELPER_TEXT_VALIDATION_MSG)&&!e;n?(this.showToScreenReader(),this.adapter.setAttr(rp.ROLE,"alert")):this.adapter.removeAttr(rp.ROLE),t||n||this.hide_()},t.prototype.hide_=function(){this.adapter.setAttr(rp.ARIA_HIDDEN,"true")},t}(iY),rb=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iN(t,e),t.attachTo=function(e){return new t(e)},Object.defineProperty(t.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),t.prototype.getDefaultFoundation=function(){var e=this;return new rg({addClass:function(t){return e.root.classList.add(t)},removeClass:function(t){return e.root.classList.remove(t)},hasClass:function(t){return e.root.classList.contains(t)},getAttr:function(t){return e.root.getAttribute(t)},setAttr:function(t,n){return e.root.setAttribute(t,n)},removeAttr:function(t){return e.root.removeAttribute(t)},setContent:function(t){e.root.textContent=t}})},t}(iH),r_={ICON_EVENT:"MDCTextField:icon",ICON_ROLE:"button"},ry={ROOT:"mdc-text-field__icon"},rv=["click","keydown"],rx=function(e){function t(n){var i=e.call(this,iB(iB({},t.defaultAdapter),n))||this;return i.savedTabIndex_=null,i.interactionHandler_=function(e){return i.handleInteraction(e)},i}return iN(t,e),Object.defineProperty(t,"strings",{get:function(){return r_},enumerable:!0,configurable:!0}),Object.defineProperty(t,"cssClasses",{get:function(){return ry},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},notifyIconAction:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){var e=this;this.savedTabIndex_=this.adapter.getAttr("tabindex"),rv.forEach(function(t){e.adapter.registerInteractionHandler(t,e.interactionHandler_)})},t.prototype.destroy=function(){var e=this;rv.forEach(function(t){e.adapter.deregisterInteractionHandler(t,e.interactionHandler_)})},t.prototype.setDisabled=function(e){this.savedTabIndex_&&(e?(this.adapter.setAttr("tabindex","-1"),this.adapter.removeAttr("role")):(this.adapter.setAttr("tabindex",this.savedTabIndex_),this.adapter.setAttr("role",r_.ICON_ROLE)))},t.prototype.setAriaLabel=function(e){this.adapter.setAttr("aria-label",e)},t.prototype.setContent=function(e){this.adapter.setContent(e)},t.prototype.handleInteraction=function(e){var t="Enter"===e.key||13===e.keyCode;("click"===e.type||t)&&(e.preventDefault(),this.adapter.notifyIconAction())},t}(iY),rw=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iN(t,e),t.attachTo=function(e){return new t(e)},Object.defineProperty(t.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),t.prototype.getDefaultFoundation=function(){var e=this;return new rx({getAttr:function(t){return e.root.getAttribute(t)},setAttr:function(t,n){return e.root.setAttribute(t,n)},removeAttr:function(t){return e.root.removeAttribute(t)},setContent:function(t){e.root.textContent=t},registerInteractionHandler:function(t,n){return e.listen(t,n)},deregisterInteractionHandler:function(t,n){return e.unlisten(t,n)},notifyIconAction:function(){return e.emit(rx.strings.ICON_EVENT,{},!0)}})},t}(iH),rF=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iN(t,e),t.attachTo=function(e){return new t(e)},t.prototype.initialize=function(e,t,n,i,r,o,a){void 0===e&&(e=function(e,t){return new rt(e,t)}),void 0===t&&(t=function(e){return new iJ(e)}),void 0===n&&(n=function(e){return new rb(e)}),void 0===i&&(i=function(e){return new ro(e)}),void 0===r&&(r=function(e){return new rw(e)}),void 0===o&&(o=function(e){return new iK(e)}),void 0===a&&(a=function(e){return new i5(e)}),this.input_=this.root.querySelector(ra.INPUT_SELECTOR);var s=this.root.querySelector(ra.LABEL_SELECTOR);this.label_=s?o(s):null;var l=this.root.querySelector(ra.LINE_RIPPLE_SELECTOR);this.lineRipple_=l?t(l):null;var c=this.root.querySelector(ra.OUTLINE_SELECTOR);this.outline_=c?a(c):null;var d=rg.strings,u=this.root.nextElementSibling,h=u&&u.classList.contains(rs.HELPER_LINE),m=h&&u&&u.querySelector(d.ROOT_SELECTOR);this.helperText_=m?n(m):null;var f=rr.strings,p=this.root.querySelector(f.ROOT_SELECTOR);!p&&h&&u&&(p=u.querySelector(f.ROOT_SELECTOR)),this.characterCounter_=p?i(p):null;var g=this.root.querySelector(ra.LEADING_ICON_SELECTOR);this.leadingIcon_=g?r(g):null;var b=this.root.querySelector(ra.TRAILING_ICON_SELECTOR);this.trailingIcon_=b?r(b):null,this.prefix_=this.root.querySelector(ra.PREFIX_SELECTOR),this.suffix_=this.root.querySelector(ra.SUFFIX_SELECTOR),this.ripple=this.createRipple_(e)},t.prototype.destroy=function(){this.ripple&&this.ripple.destroy(),this.lineRipple_&&this.lineRipple_.destroy(),this.helperText_&&this.helperText_.destroy(),this.characterCounter_&&this.characterCounter_.destroy(),this.leadingIcon_&&this.leadingIcon_.destroy(),this.trailingIcon_&&this.trailingIcon_.destroy(),this.label_&&this.label_.destroy(),this.outline_&&this.outline_.destroy(),e.prototype.destroy.call(this)},t.prototype.initialSyncWithDOM=function(){this.disabled=this.input_.disabled},Object.defineProperty(t.prototype,"value",{get:function(){return this.foundation.getValue()},set:function(e){this.foundation.setValue(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this.foundation.isDisabled()},set:function(e){this.foundation.setDisabled(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valid",{get:function(){return this.foundation.isValid()},set:function(e){this.foundation.setValid(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"required",{get:function(){return this.input_.required},set:function(e){this.input_.required=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pattern",{get:function(){return this.input_.pattern},set:function(e){this.input_.pattern=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minLength",{get:function(){return this.input_.minLength},set:function(e){this.input_.minLength=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxLength",{get:function(){return this.input_.maxLength},set:function(e){e<0?this.input_.removeAttribute("maxLength"):this.input_.maxLength=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"min",{get:function(){return this.input_.min},set:function(e){this.input_.min=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"max",{get:function(){return this.input_.max},set:function(e){this.input_.max=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"step",{get:function(){return this.input_.step},set:function(e){this.input_.step=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"helperTextContent",{set:function(e){this.foundation.setHelperTextContent(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"leadingIconAriaLabel",{set:function(e){this.foundation.setLeadingIconAriaLabel(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"leadingIconContent",{set:function(e){this.foundation.setLeadingIconContent(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"trailingIconAriaLabel",{set:function(e){this.foundation.setTrailingIconAriaLabel(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"trailingIconContent",{set:function(e){this.foundation.setTrailingIconContent(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useNativeValidation",{set:function(e){this.foundation.setUseNativeValidation(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"prefixText",{get:function(){return this.prefix_?this.prefix_.textContent:null},set:function(e){this.prefix_&&(this.prefix_.textContent=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"suffixText",{get:function(){return this.suffix_?this.suffix_.textContent:null},set:function(e){this.suffix_&&(this.suffix_.textContent=e)},enumerable:!0,configurable:!0}),t.prototype.focus=function(){this.input_.focus()},t.prototype.layout=function(){var e=this.foundation.shouldFloat;this.foundation.notchOutline(e)},t.prototype.getDefaultFoundation=function(){return new rm(iB(iB(iB(iB(iB({},this.getRootAdapterMethods_()),this.getInputAdapterMethods_()),this.getLabelAdapterMethods_()),this.getLineRippleAdapterMethods_()),this.getOutlineAdapterMethods_()),this.getFoundationMap_())},t.prototype.getRootAdapterMethods_=function(){var e=this;return{addClass:function(t){return e.root.classList.add(t)},removeClass:function(t){return e.root.classList.remove(t)},hasClass:function(t){return e.root.classList.contains(t)},registerTextFieldInteractionHandler:function(t,n){e.listen(t,n)},deregisterTextFieldInteractionHandler:function(t,n){e.unlisten(t,n)},registerValidationAttributeChangeHandler:function(t){var n=new MutationObserver(function(e){return t(e.map(function(e){return e.attributeName}).filter(function(e){return e}))});return n.observe(e.input_,{attributes:!0}),n},deregisterValidationAttributeChangeHandler:function(e){e.disconnect()}}},t.prototype.getInputAdapterMethods_=function(){var e=this;return{getNativeInput:function(){return e.input_},setInputAttr:function(t,n){e.input_.setAttribute(t,n)},removeInputAttr:function(t){e.input_.removeAttribute(t)},isFocused:function(){return document.activeElement===e.input_},registerInputInteractionHandler:function(t,n){e.input_.addEventListener(t,n,iU())},deregisterInputInteractionHandler:function(t,n){e.input_.removeEventListener(t,n,iU())}}},t.prototype.getLabelAdapterMethods_=function(){var e=this;return{floatLabel:function(t){return e.label_&&e.label_.float(t)},getLabelWidth:function(){return e.label_?e.label_.getWidth():0},hasLabel:function(){return!!e.label_},shakeLabel:function(t){return e.label_&&e.label_.shake(t)},setLabelRequired:function(t){return e.label_&&e.label_.setRequired(t)}}},t.prototype.getLineRippleAdapterMethods_=function(){var e=this;return{activateLineRipple:function(){e.lineRipple_&&e.lineRipple_.activate()},deactivateLineRipple:function(){e.lineRipple_&&e.lineRipple_.deactivate()},setLineRippleTransformOrigin:function(t){e.lineRipple_&&e.lineRipple_.setRippleCenter(t)}}},t.prototype.getOutlineAdapterMethods_=function(){var e=this;return{closeOutline:function(){return e.outline_&&e.outline_.closeNotch()},hasOutline:function(){return!!e.outline_},notchOutline:function(t){return e.outline_&&e.outline_.notch(t)}}},t.prototype.getFoundationMap_=function(){return{characterCounter:this.characterCounter_?this.characterCounter_.foundationForTextField:void 0,helperText:this.helperText_?this.helperText_.foundationForTextField:void 0,leadingIcon:this.leadingIcon_?this.leadingIcon_.foundationForTextField:void 0,trailingIcon:this.trailingIcon_?this.trailingIcon_.foundationForTextField:void 0}},t.prototype.createRipple_=function(e){var t=this,n=this.root.classList.contains(rs.TEXTAREA),i=this.root.classList.contains(rs.OUTLINED);if(n||i)return null;var r=iB(iB({},rt.createAdapter(this)),{isSurfaceActive:function(){return iW(t.input_,":active")},registerInteractionHandler:function(e,n){return t.input_.addEventListener(e,n,iU())},deregisterInteractionHandler:function(e,n){return t.input_.removeEventListener(e,n,iU())}});return e(this.root,new re(r))},t}(iH),rk={animation:{prefixed:"-webkit-animation",standard:"animation"},transform:{prefixed:"-webkit-transform",standard:"transform"},transition:{prefixed:"-webkit-transition",standard:"transition"}},rE={animationend:{cssProperty:"animation",prefixed:"webkitAnimationEnd",standard:"animationend"},animationiteration:{cssProperty:"animation",prefixed:"webkitAnimationIteration",standard:"animationiteration"},animationstart:{cssProperty:"animation",prefixed:"webkitAnimationStart",standard:"animationstart"},transitionend:{cssProperty:"transition",prefixed:"webkitTransitionEnd",standard:"transitionend"}};function rA(e){return!!e.document&&"function"==typeof e.document.createElement}function rC(e,t){if(rA(e)&&t in rk){var n=e.document.createElement("div"),i=rk[t],r=i.standard,o=i.prefixed;return r in n.style?r:o}return t}function rT(e,t){if(rA(e)&&t in rE){var n=e.document.createElement("div"),i=rE[t],r=i.standard,o=i.prefixed;return i.cssProperty in n.style?r:o}return t}var rS={ANIM_CHECKED_INDETERMINATE:"mdc-checkbox--anim-checked-indeterminate",ANIM_CHECKED_UNCHECKED:"mdc-checkbox--anim-checked-unchecked",ANIM_INDETERMINATE_CHECKED:"mdc-checkbox--anim-indeterminate-checked",ANIM_INDETERMINATE_UNCHECKED:"mdc-checkbox--anim-indeterminate-unchecked",ANIM_UNCHECKED_CHECKED:"mdc-checkbox--anim-unchecked-checked",ANIM_UNCHECKED_INDETERMINATE:"mdc-checkbox--anim-unchecked-indeterminate",BACKGROUND:"mdc-checkbox__background",CHECKED:"mdc-checkbox--checked",CHECKMARK:"mdc-checkbox__checkmark",CHECKMARK_PATH:"mdc-checkbox__checkmark-path",DISABLED:"mdc-checkbox--disabled",INDETERMINATE:"mdc-checkbox--indeterminate",MIXEDMARK:"mdc-checkbox__mixedmark",NATIVE_CONTROL:"mdc-checkbox__native-control",ROOT:"mdc-checkbox",SELECTED:"mdc-checkbox--selected",UPGRADED:"mdc-checkbox--upgraded"},rM={ARIA_CHECKED_ATTR:"aria-checked",ARIA_CHECKED_INDETERMINATE_VALUE:"mixed",DATA_INDETERMINATE_ATTR:"data-indeterminate",NATIVE_CONTROL_SELECTOR:".mdc-checkbox__native-control",TRANSITION_STATE_CHECKED:"checked",TRANSITION_STATE_INDETERMINATE:"indeterminate",TRANSITION_STATE_INIT:"init",TRANSITION_STATE_UNCHECKED:"unchecked"},rL={ANIM_END_LATCH_MS:250},rD=function(e){function t(n){var i=e.call(this,iB(iB({},t.defaultAdapter),n))||this;return i.currentCheckState_=rM.TRANSITION_STATE_INIT,i.currentAnimationClass_="",i.animEndLatchTimer_=0,i.enableAnimationEndHandler_=!1,i}return iN(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return rS},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return rM},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return rL},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},forceLayout:function(){},hasNativeControl:function(){return!1},isAttachedToDOM:function(){return!1},isChecked:function(){return!1},isIndeterminate:function(){return!1},removeClass:function(){},removeNativeControlAttr:function(){},setNativeControlAttr:function(){},setNativeControlDisabled:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){this.currentCheckState_=this.determineCheckState_(),this.updateAriaChecked_(),this.adapter.addClass(rS.UPGRADED)},t.prototype.destroy=function(){clearTimeout(this.animEndLatchTimer_)},t.prototype.setDisabled=function(e){this.adapter.setNativeControlDisabled(e),e?this.adapter.addClass(rS.DISABLED):this.adapter.removeClass(rS.DISABLED)},t.prototype.handleAnimationEnd=function(){var e=this;this.enableAnimationEndHandler_&&(clearTimeout(this.animEndLatchTimer_),this.animEndLatchTimer_=setTimeout(function(){e.adapter.removeClass(e.currentAnimationClass_),e.enableAnimationEndHandler_=!1},rL.ANIM_END_LATCH_MS))},t.prototype.handleChange=function(){this.transitionCheckState_()},t.prototype.transitionCheckState_=function(){if(this.adapter.hasNativeControl()){var e=this.currentCheckState_,t=this.determineCheckState_();if(e!==t){this.updateAriaChecked_();var n=rM.TRANSITION_STATE_UNCHECKED,i=rS.SELECTED;t===n?this.adapter.removeClass(i):this.adapter.addClass(i),this.currentAnimationClass_.length>0&&(clearTimeout(this.animEndLatchTimer_),this.adapter.forceLayout(),this.adapter.removeClass(this.currentAnimationClass_)),this.currentAnimationClass_=this.getTransitionAnimationClass_(e,t),this.currentCheckState_=t,this.adapter.isAttachedToDOM()&&this.currentAnimationClass_.length>0&&(this.adapter.addClass(this.currentAnimationClass_),this.enableAnimationEndHandler_=!0)}}},t.prototype.determineCheckState_=function(){var e=rM.TRANSITION_STATE_INDETERMINATE,t=rM.TRANSITION_STATE_CHECKED,n=rM.TRANSITION_STATE_UNCHECKED;return this.adapter.isIndeterminate()?e:this.adapter.isChecked()?t:n},t.prototype.getTransitionAnimationClass_=function(e,n){var i=rM.TRANSITION_STATE_INIT,r=rM.TRANSITION_STATE_CHECKED,o=rM.TRANSITION_STATE_UNCHECKED,a=t.cssClasses,s=a.ANIM_UNCHECKED_CHECKED,l=a.ANIM_UNCHECKED_INDETERMINATE,c=a.ANIM_CHECKED_UNCHECKED,d=a.ANIM_CHECKED_INDETERMINATE,u=a.ANIM_INDETERMINATE_CHECKED,h=a.ANIM_INDETERMINATE_UNCHECKED;switch(e){case i:if(n===o)return"";return n===r?u:h;case o:return n===r?s:l;case r:return n===o?c:d;default:return n===r?u:h}},t.prototype.updateAriaChecked_=function(){this.adapter.isIndeterminate()?this.adapter.setNativeControlAttr(rM.ARIA_CHECKED_ATTR,rM.ARIA_CHECKED_INDETERMINATE_VALUE):this.adapter.removeNativeControlAttr(rM.ARIA_CHECKED_ATTR)},t}(iY),rI=["checked","indeterminate"],rR=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.ripple_=t.createRipple_(),t}return iN(t,e),t.attachTo=function(e){return new t(e)},Object.defineProperty(t.prototype,"ripple",{get:function(){return this.ripple_},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"checked",{get:function(){return this.nativeControl_.checked},set:function(e){this.nativeControl_.checked=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"indeterminate",{get:function(){return this.nativeControl_.indeterminate},set:function(e){this.nativeControl_.indeterminate=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this.nativeControl_.disabled},set:function(e){this.foundation.setDisabled(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.nativeControl_.value},set:function(e){this.nativeControl_.value=e},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){var e=rM.DATA_INDETERMINATE_ATTR;this.nativeControl_.indeterminate="true"===this.nativeControl_.getAttribute(e),this.nativeControl_.removeAttribute(e)},t.prototype.initialSyncWithDOM=function(){var e=this;this.handleChange_=function(){return e.foundation.handleChange()},this.handleAnimationEnd_=function(){return e.foundation.handleAnimationEnd()},this.nativeControl_.addEventListener("change",this.handleChange_),this.listen(rT(window,"animationend"),this.handleAnimationEnd_),this.installPropertyChangeHooks_()},t.prototype.destroy=function(){this.ripple_.destroy(),this.nativeControl_.removeEventListener("change",this.handleChange_),this.unlisten(rT(window,"animationend"),this.handleAnimationEnd_),this.uninstallPropertyChangeHooks_(),e.prototype.destroy.call(this)},t.prototype.getDefaultFoundation=function(){var e=this;return new rD({addClass:function(t){return e.root.classList.add(t)},forceLayout:function(){return e.root.offsetWidth},hasNativeControl:function(){return!!e.nativeControl_},isAttachedToDOM:function(){return!!e.root.parentNode},isChecked:function(){return e.checked},isIndeterminate:function(){return e.indeterminate},removeClass:function(t){e.root.classList.remove(t)},removeNativeControlAttr:function(t){e.nativeControl_.removeAttribute(t)},setNativeControlAttr:function(t,n){e.nativeControl_.setAttribute(t,n)},setNativeControlDisabled:function(t){e.nativeControl_.disabled=t}})},t.prototype.createRipple_=function(){var e=this,t=iB(iB({},rt.createAdapter(this)),{deregisterInteractionHandler:function(t,n){return e.nativeControl_.removeEventListener(t,n,iU())},isSurfaceActive:function(){return iW(e.nativeControl_,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(t,n){return e.nativeControl_.addEventListener(t,n,iU())}});return new rt(this.root,new re(t))},t.prototype.installPropertyChangeHooks_=function(){var e=this,t=this.nativeControl_,n=Object.getPrototypeOf(t);rI.forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);if(rO(r)){var o=r.get,a={configurable:r.configurable,enumerable:r.enumerable,get:o,set:function(n){r.set.call(t,n),e.foundation.handleChange()}};Object.defineProperty(t,i,a)}})},t.prototype.uninstallPropertyChangeHooks_=function(){var e=this.nativeControl_,t=Object.getPrototypeOf(e);rI.forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);rO(i)&&Object.defineProperty(e,n,i)})},Object.defineProperty(t.prototype,"nativeControl_",{get:function(){var e=rM.NATIVE_CONTROL_SELECTOR,t=this.root.querySelector(e);if(!t)throw Error("Checkbox component requires a "+e+" element");return t},enumerable:!0,configurable:!0}),t}(iH);function rO(e){return!!e&&"function"==typeof e.set}var rP={CHECKED:"mdc-switch--checked",DISABLED:"mdc-switch--disabled"},r$={ARIA_CHECKED_ATTR:"aria-checked",NATIVE_CONTROL_SELECTOR:".mdc-switch__native-control",RIPPLE_SURFACE_SELECTOR:".mdc-switch__thumb-underlay"},rN=function(e){function t(n){return e.call(this,iB(iB({},t.defaultAdapter),n))||this}return iN(t,e),Object.defineProperty(t,"strings",{get:function(){return r$},enumerable:!0,configurable:!0}),Object.defineProperty(t,"cssClasses",{get:function(){return rP},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNativeControlChecked:function(){},setNativeControlDisabled:function(){},setNativeControlAttr:function(){}}},enumerable:!0,configurable:!0}),t.prototype.setChecked=function(e){this.adapter.setNativeControlChecked(e),this.updateAriaChecked_(e),this.updateCheckedStyling_(e)},t.prototype.setDisabled=function(e){this.adapter.setNativeControlDisabled(e),e?this.adapter.addClass(rP.DISABLED):this.adapter.removeClass(rP.DISABLED)},t.prototype.handleChange=function(e){var t=e.target;this.updateAriaChecked_(t.checked),this.updateCheckedStyling_(t.checked)},t.prototype.updateCheckedStyling_=function(e){e?this.adapter.addClass(rP.CHECKED):this.adapter.removeClass(rP.CHECKED)},t.prototype.updateAriaChecked_=function(e){this.adapter.setNativeControlAttr(r$.ARIA_CHECKED_ATTR,""+!!e)},t}(iY),rB=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.ripple_=t.createRipple_(),t}return iN(t,e),t.attachTo=function(e){return new t(e)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.ripple_.destroy(),this.nativeControl_.removeEventListener("change",this.changeHandler_)},t.prototype.initialSyncWithDOM=function(){var e=this;this.changeHandler_=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return(t=e.foundation).handleChange.apply(t,ij(n))},this.nativeControl_.addEventListener("change",this.changeHandler_),this.checked=this.checked},t.prototype.getDefaultFoundation=function(){var e=this;return new rN({addClass:function(t){return e.root.classList.add(t)},removeClass:function(t){return e.root.classList.remove(t)},setNativeControlChecked:function(t){return e.nativeControl_.checked=t},setNativeControlDisabled:function(t){return e.nativeControl_.disabled=t},setNativeControlAttr:function(t,n){return e.nativeControl_.setAttribute(t,n)}})},Object.defineProperty(t.prototype,"ripple",{get:function(){return this.ripple_},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"checked",{get:function(){return this.nativeControl_.checked},set:function(e){this.foundation.setChecked(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this.nativeControl_.disabled},set:function(e){this.foundation.setDisabled(e)},enumerable:!0,configurable:!0}),t.prototype.createRipple_=function(){var e=this,t=rN.strings.RIPPLE_SURFACE_SELECTOR,n=this.root.querySelector(t),i=iB(iB({},rt.createAdapter(this)),{addClass:function(e){return n.classList.add(e)},computeBoundingRect:function(){return n.getBoundingClientRect()},deregisterInteractionHandler:function(t,n){e.nativeControl_.removeEventListener(t,n,iU())},isSurfaceActive:function(){return iW(e.nativeControl_,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(t,n){e.nativeControl_.addEventListener(t,n,iU())},removeClass:function(e){n.classList.remove(e)},updateCssVariable:function(e,t){n.style.setProperty(e,t)}});return new rt(this.root,new re(i))},Object.defineProperty(t.prototype,"nativeControl_",{get:function(){var e=rN.strings.NATIVE_CONTROL_SELECTOR;return this.root.querySelector(e)},enumerable:!0,configurable:!0}),t}(iH),rz={DISABLED:"mdc-slider--disabled",DISCRETE:"mdc-slider--discrete",INPUT:"mdc-slider__input",RANGE:"mdc-slider--range",THUMB:"mdc-slider__thumb",THUMB_KNOB:"mdc-slider__thumb-knob",THUMB_TOP:"mdc-slider__thumb--top",THUMB_WITH_INDICATOR:"mdc-slider__thumb--with-indicator",TICK_MARKS:"mdc-slider--tick-marks",TICK_MARKS_CONTAINER:"mdc-slider__tick-marks",TICK_MARK_ACTIVE:"mdc-slider__tick-mark--active",TICK_MARK_INACTIVE:"mdc-slider__tick-mark--inactive",TRACK:"mdc-slider__track",TRACK_ACTIVE:"mdc-slider__track--active_fill",VALUE_INDICATOR_TEXT:"mdc-slider__value-indicator-text"},rj={STEP_SIZE:1,THUMB_UPDATE_MIN_PX:5},rY={ARIA_VALUETEXT:"aria-valuetext",INPUT_DISABLED:"disabled",INPUT_MIN:"min",INPUT_MAX:"max",INPUT_VALUE:"value",INPUT_STEP:"step"},rH={CHANGE:"MDCSlider:change",INPUT:"MDCSlider:input"};!function(e){e[e.ACTIVE=0]="ACTIVE",e[e.INACTIVE=1]="INACTIVE"}(sj||(sj={})),function(e){e[e.START=1]="START",e[e.END=2]="END"}(sY||(sY={}));var rU="undefined"!=typeof window,rV=function(e){function t(n){var i=e.call(this,iB(iB({},t.defaultAdapter),n))||this;return i.initialStylesRemoved=!1,i.isDisabled=!1,i.isDiscrete=!1,i.step=rj.STEP_SIZE,i.hasTickMarks=!1,i.isRange=!1,i.thumb=null,i.downEventClientX=null,i.startThumbKnobWidth=0,i.endThumbKnobWidth=0,i}return iN(t,e),Object.defineProperty(t,"defaultAdapter",{get:function(){return{hasClass:function(){return!1},addClass:function(){},removeClass:function(){},addThumbClass:function(){},removeThumbClass:function(){},getAttribute:function(){return null},getInputValue:function(){return""},setInputValue:function(){},getInputAttribute:function(){return null},setInputAttribute:function(){return null},removeInputAttribute:function(){return null},focusInput:function(){},isInputFocused:function(){return!1},getThumbKnobWidth:function(){return 0},getThumbBoundingClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},getBoundingClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},isRTL:function(){return!1},setThumbStyleProperty:function(){},removeThumbStyleProperty:function(){},setTrackActiveStyleProperty:function(){},removeTrackActiveStyleProperty:function(){},setValueIndicatorText:function(){},getValueToAriaValueTextFn:function(){return null},updateTickMarks:function(){},setPointerCapture:function(){},emitChangeEvent:function(){},emitInputEvent:function(){},emitDragStartEvent:function(){},emitDragEndEvent:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){},registerThumbEventHandler:function(){},deregisterThumbEventHandler:function(){},registerInputEventHandler:function(){},deregisterInputEventHandler:function(){},registerBodyEventHandler:function(){},deregisterBodyEventHandler:function(){},registerWindowEventHandler:function(){},deregisterWindowEventHandler:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){var e=this;this.isDisabled=this.adapter.hasClass(rz.DISABLED),this.isDiscrete=this.adapter.hasClass(rz.DISCRETE),this.hasTickMarks=this.adapter.hasClass(rz.TICK_MARKS),this.isRange=this.adapter.hasClass(rz.RANGE);var t=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(rY.INPUT_MIN,this.isRange?sY.START:sY.END),rY.INPUT_MIN),n=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(rY.INPUT_MAX,sY.END),rY.INPUT_MAX),i=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(rY.INPUT_VALUE,sY.END),rY.INPUT_VALUE),r=this.isRange?this.convertAttributeValueToNumber(this.adapter.getInputAttribute(rY.INPUT_VALUE,sY.START),rY.INPUT_VALUE):t;this.validateProperties({min:t,max:n,value:i,valueStart:r}),this.min=t,this.max=n,this.value=i,this.valueStart=r,this.valueBeforeDownEvent=i,this.valueStartBeforeDownEvent=r;var o=this.adapter.getInputAttribute(rY.INPUT_STEP,sY.END);if(o&&(this.step=this.convertAttributeValueToNumber(o,rY.INPUT_STEP)),this.step<=0)throw Error("MDCSliderFoundation: step must be a positive number. Current step: "+this.step);this.mousedownOrTouchstartListener=this.handleMousedownOrTouchstart.bind(this),this.moveListener=this.handleMove.bind(this),this.pointerdownListener=this.handlePointerdown.bind(this),this.pointerupListener=this.handlePointerup.bind(this),this.thumbMouseenterListener=this.handleThumbMouseenter.bind(this),this.thumbMouseleaveListener=this.handleThumbMouseleave.bind(this),this.inputStartChangeListener=function(){e.handleInputChange(sY.START)},this.inputEndChangeListener=function(){e.handleInputChange(sY.END)},this.inputStartFocusListener=function(){e.handleInputFocus(sY.START)},this.inputEndFocusListener=function(){e.handleInputFocus(sY.END)},this.inputStartBlurListener=function(){e.handleInputBlur(sY.START)},this.inputEndBlurListener=function(){e.handleInputBlur(sY.END)},this.resizeListener=this.handleResize.bind(this),this.registerEventHandlers()},t.prototype.destroy=function(){this.deregisterEventHandlers()},t.prototype.getMin=function(){return this.min},t.prototype.getMax=function(){return this.max},t.prototype.getValue=function(){return this.value},t.prototype.setValue=function(e){if(this.isRange&&e<this.valueStart)throw Error("end thumb value ("+e+") must be >= start thumb value ("+this.valueStart+")");this.updateValue(e,sY.END)},t.prototype.getValueStart=function(){if(!this.isRange)throw Error("`valueStart` is only applicable for range sliders.");return this.valueStart},t.prototype.setValueStart=function(e){if(!this.isRange)throw Error("`valueStart` is only applicable for range sliders.");if(this.isRange&&e>this.value)throw Error("start thumb value ("+e+") must be <= end thumb value ("+this.value+")");this.updateValue(e,sY.START)},t.prototype.getStep=function(){return this.step},t.prototype.getDisabled=function(){return this.isDisabled},t.prototype.setDisabled=function(e){this.isDisabled=e,e?(this.adapter.addClass(rz.DISABLED),this.isRange&&this.adapter.setInputAttribute(rY.INPUT_DISABLED,"",sY.START),this.adapter.setInputAttribute(rY.INPUT_DISABLED,"",sY.END)):(this.adapter.removeClass(rz.DISABLED),this.isRange&&this.adapter.removeInputAttribute(rY.INPUT_DISABLED,sY.START),this.adapter.removeInputAttribute(rY.INPUT_DISABLED,sY.END))},t.prototype.getIsRange=function(){return this.isRange},t.prototype.layout=function(e){var t=(void 0===e?{}:e).skipUpdateUI;this.rect=this.adapter.getBoundingClientRect(),this.isRange&&(this.startThumbKnobWidth=this.adapter.getThumbKnobWidth(sY.START),this.endThumbKnobWidth=this.adapter.getThumbKnobWidth(sY.END)),t||this.updateUI()},t.prototype.handleResize=function(){this.layout()},t.prototype.handleDown=function(e){if(!this.isDisabled){this.valueStartBeforeDownEvent=this.valueStart,this.valueBeforeDownEvent=this.value;var t=null!=e.clientX?e.clientX:e.targetTouches[0].clientX;this.downEventClientX=t;var n=this.mapClientXOnSliderScale(t);this.thumb=this.getThumbFromDownEvent(t,n),null!==this.thumb&&(this.handleDragStart(e,n,this.thumb),this.isRange&&n>=this.valueStart&&n<=this.value||this.updateValue(n,this.thumb,{emitInputEvent:!0}))}},t.prototype.handleMove=function(e){if(!this.isDisabled){e.preventDefault();var t=null!=e.clientX?e.clientX:e.targetTouches[0].clientX,n=null!=this.thumb;if(this.thumb=this.getThumbFromMoveEvent(t),null!==this.thumb){var i=this.mapClientXOnSliderScale(t);n||(this.handleDragStart(e,i,this.thumb),this.adapter.emitDragStartEvent(i,this.thumb)),this.updateValue(i,this.thumb,{emitInputEvent:!0})}}},t.prototype.handleUp=function(){if(!this.isDisabled&&null!==this.thumb){var e=this.thumb===sY.START?this.valueStartBeforeDownEvent:this.valueBeforeDownEvent,t=this.thumb===sY.START?this.valueStart:this.value;e!==t&&this.adapter.emitChangeEvent(t,this.thumb),this.adapter.emitDragEndEvent(t,this.thumb),this.thumb=null}},t.prototype.handleThumbMouseenter=function(){this.isDiscrete&&this.isRange&&(this.adapter.addThumbClass(rz.THUMB_WITH_INDICATOR,sY.START),this.adapter.addThumbClass(rz.THUMB_WITH_INDICATOR,sY.END))},t.prototype.handleThumbMouseleave=function(){this.isDiscrete&&this.isRange&&(this.adapter.isInputFocused(sY.START)||this.adapter.isInputFocused(sY.END)||(this.adapter.removeThumbClass(rz.THUMB_WITH_INDICATOR,sY.START),this.adapter.removeThumbClass(rz.THUMB_WITH_INDICATOR,sY.END)))},t.prototype.handleMousedownOrTouchstart=function(e){var t=this,n="mousedown"===e.type?"mousemove":"touchmove";this.adapter.registerBodyEventHandler(n,this.moveListener);var i=function(){t.handleUp(),t.adapter.deregisterBodyEventHandler(n,t.moveListener),t.adapter.deregisterEventHandler("mouseup",i),t.adapter.deregisterEventHandler("touchend",i)};this.adapter.registerBodyEventHandler("mouseup",i),this.adapter.registerBodyEventHandler("touchend",i),this.handleDown(e)},t.prototype.handlePointerdown=function(e){this.adapter.setPointerCapture(e.pointerId),this.adapter.registerEventHandler("pointermove",this.moveListener),this.handleDown(e)},t.prototype.handleInputChange=function(e){var t=Number(this.adapter.getInputValue(e));e===sY.START?this.setValueStart(t):this.setValue(t)},t.prototype.handleInputFocus=function(e){if(this.isDiscrete&&(this.adapter.addThumbClass(rz.THUMB_WITH_INDICATOR,e),this.isRange)){var t=e===sY.START?sY.END:sY.START;this.adapter.addThumbClass(rz.THUMB_WITH_INDICATOR,t)}},t.prototype.handleInputBlur=function(e){if(this.isDiscrete&&(this.adapter.removeThumbClass(rz.THUMB_WITH_INDICATOR,e),this.isRange)){var t=e===sY.START?sY.END:sY.START;this.adapter.removeThumbClass(rz.THUMB_WITH_INDICATOR,t)}},t.prototype.handleDragStart=function(e,t,n){this.adapter.focusInput(n),e.preventDefault(),this.adapter.emitDragStartEvent(t,n)},t.prototype.getThumbFromDownEvent=function(e,t){if(!this.isRange)return sY.END;var n=this.adapter.getThumbBoundingClientRect(sY.START),i=this.adapter.getThumbBoundingClientRect(sY.END),r=e>=n.left&&e<=n.right,o=e>=i.left&&e<=i.right;return r&&o?null:r?sY.START:o?sY.END:t<this.valueStart?sY.START:t>this.value?sY.END:null},t.prototype.getThumbFromMoveEvent=function(e){if(null!==this.thumb)return this.thumb;if(null===this.downEventClientX)throw Error("`downEventClientX` is null after move event.");return Math.abs(this.downEventClientX-e)<rj.THUMB_UPDATE_MIN_PX?this.thumb:e<this.downEventClientX?this.adapter.isRTL()?sY.END:sY.START:this.adapter.isRTL()?sY.START:sY.END},t.prototype.updateUI=function(e){this.updateThumbAndInputAttributes(e),this.updateThumbAndTrackUI(e),this.updateValueIndicatorUI(e),this.updateTickMarksUI()},t.prototype.updateThumbAndInputAttributes=function(e){if(e){var t=this.isRange&&e===sY.START?this.valueStart:this.value,n=String(t);this.adapter.setInputAttribute(rY.INPUT_VALUE,n,e),this.isRange&&e===sY.START?this.adapter.setInputAttribute(rY.INPUT_MIN,n,sY.END):this.isRange&&e===sY.END&&this.adapter.setInputAttribute(rY.INPUT_MAX,n,sY.START),this.adapter.getInputValue(e)!==n&&this.adapter.setInputValue(n,e);var i=this.adapter.getValueToAriaValueTextFn();i&&this.adapter.setInputAttribute(rY.ARIA_VALUETEXT,i(t),e)}},t.prototype.updateValueIndicatorUI=function(e){if(this.isDiscrete){var t=this.isRange&&e===sY.START?this.valueStart:this.value;this.adapter.setValueIndicatorText(t,e===sY.START?sY.START:sY.END),!e&&this.isRange&&this.adapter.setValueIndicatorText(this.valueStart,sY.START)}},t.prototype.updateTickMarksUI=function(){if(this.isDiscrete&&this.hasTickMarks){var e=(this.valueStart-this.min)/this.step,t=(this.value-this.valueStart)/this.step+1,n=(this.max-this.value)/this.step,i=Array.from({length:e}).fill(sj.INACTIVE),r=Array.from({length:t}).fill(sj.ACTIVE),o=Array.from({length:n}).fill(sj.INACTIVE);this.adapter.updateTickMarks(i.concat(r).concat(o))}},t.prototype.mapClientXOnSliderScale=function(e){var t=(e-this.rect.left)/this.rect.width;this.adapter.isRTL()&&(t=1-t);var n=this.min+t*(this.max-this.min);return n===this.max||n===this.min?n:this.quantize(n)},t.prototype.updateValue=function(e,t,n){var i=void 0===n?{}:n,r=i.emitInputEvent,o=i.emitChangeEvent;if(e=this.clampValue(e,t),this.isRange&&t===sY.START){if(this.valueStart===e)return;this.valueStart=e}else{if(this.value===e)return;this.value=e}this.updateUI(t),r&&this.adapter.emitInputEvent(t===sY.START?this.valueStart:this.value,t),o&&this.adapter.emitChangeEvent(t===sY.START?this.valueStart:this.value,t)},t.prototype.quantize=function(e){return Math.round(e/this.step)*this.step},t.prototype.clampValue=function(e,t){return(e=Math.min(Math.max(e,this.min),this.max),this.isRange&&t===sY.START&&e>this.value)?this.value:this.isRange&&t===sY.END&&e<this.valueStart?this.valueStart:e},t.prototype.updateThumbAndTrackUI=function(e){var t=this,n=this.max,i=this.min,r=(this.value-this.valueStart)/(n-i),o=r*this.rect.width,a=this.adapter.isRTL(),s=rU?rC(window,"transform"):"transform";if(this.isRange){var l=this.adapter.isRTL()?(n-this.value)/(n-i)*this.rect.width:(this.valueStart-i)/(n-i)*this.rect.width,c=l+o;requestAnimationFrame(function(){!a&&e===sY.START||a&&e!==sY.START?(t.adapter.setTrackActiveStyleProperty("transform-origin","right"),t.adapter.setTrackActiveStyleProperty("left","unset"),t.adapter.setTrackActiveStyleProperty("right",t.rect.width-c+"px")):(t.adapter.setTrackActiveStyleProperty("transform-origin","left"),t.adapter.setTrackActiveStyleProperty("right","unset"),t.adapter.setTrackActiveStyleProperty("left",l+"px")),t.adapter.setTrackActiveStyleProperty(s,"scaleX("+r+")");var n=a?c:l,i=t.adapter.isRTL()?l:c;e!==sY.START&&e&&t.initialStylesRemoved||t.adapter.setThumbStyleProperty(s,"translateX("+n+"px)",sY.START),e!==sY.END&&e&&t.initialStylesRemoved||t.adapter.setThumbStyleProperty(s,"translateX("+i+"px)",sY.END),t.removeInitialStyles(a),t.updateOverlappingThumbsUI(n,i,e)})}else requestAnimationFrame(function(){var e=a?t.rect.width-o:o;t.adapter.setThumbStyleProperty(s,"translateX("+e+"px)",sY.END),t.adapter.setTrackActiveStyleProperty(s,"scaleX("+r+")"),t.removeInitialStyles(a)})},t.prototype.removeInitialStyles=function(e){if(!this.initialStylesRemoved){var t=e?"right":"left";this.adapter.removeThumbStyleProperty(t,sY.END),this.isRange&&this.adapter.removeThumbStyleProperty(t,sY.START),this.initialStylesRemoved=!0,this.resetTrackAndThumbAnimation()}},t.prototype.resetTrackAndThumbAnimation=function(){var e=this;if(this.isDiscrete){var t=rU?rC(window,"transition"):"transition",n="all 0s ease 0s";this.adapter.setThumbStyleProperty(t,n,sY.END),this.isRange&&this.adapter.setThumbStyleProperty(t,n,sY.START),this.adapter.setTrackActiveStyleProperty(t,n),requestAnimationFrame(function(){e.adapter.removeThumbStyleProperty(t,sY.END),e.adapter.removeTrackActiveStyleProperty(t),e.isRange&&e.adapter.removeThumbStyleProperty(t,sY.START)})}},t.prototype.updateOverlappingThumbsUI=function(e,t,n){var i=!1;if(this.adapter.isRTL()){var r=e-this.startThumbKnobWidth/2;i=t+this.endThumbKnobWidth/2>=r}else i=e+this.startThumbKnobWidth/2>=t-this.endThumbKnobWidth/2;i?(this.adapter.addThumbClass(rz.THUMB_TOP,n||sY.END),this.adapter.removeThumbClass(rz.THUMB_TOP,n===sY.START?sY.END:sY.START)):(this.adapter.removeThumbClass(rz.THUMB_TOP,sY.START),this.adapter.removeThumbClass(rz.THUMB_TOP,sY.END))},t.prototype.convertAttributeValueToNumber=function(e,t){if(null===e)throw Error("MDCSliderFoundation: `"+t+"` must be non-null.");var n=Number(e);if(isNaN(n))throw Error("MDCSliderFoundation: `"+t+"` value is `"+e+"`, but must be a number.");return n},t.prototype.validateProperties=function(e){var t=e.min,n=e.max,i=e.value,r=e.valueStart;if(t>=n)throw Error("MDCSliderFoundation: min must be strictly less than max. "+("Current: [min: "+t+", max: ")+n+"]");if(this.isRange){if(i<t||i>n||r<t||r>n)throw Error("MDCSliderFoundation: values must be in [min, max] range. "+("Current values: [start value: "+r+", end value: ")+i+"]");if(r>i)throw Error("MDCSliderFoundation: start value must be <= end value. "+("Current values: [start value: "+r+", end value: ")+i+"]")}else if(i<t||i>n)throw Error("MDCSliderFoundation: value must be in [min, max] range. Current value: "+i)},t.prototype.registerEventHandlers=function(){this.adapter.registerWindowEventHandler("resize",this.resizeListener),t.SUPPORTS_POINTER_EVENTS?(this.adapter.registerEventHandler("pointerdown",this.pointerdownListener),this.adapter.registerEventHandler("pointerup",this.pointerupListener)):(this.adapter.registerEventHandler("mousedown",this.mousedownOrTouchstartListener),this.adapter.registerEventHandler("touchstart",this.mousedownOrTouchstartListener)),this.isRange&&(this.adapter.registerThumbEventHandler(sY.START,"mouseenter",this.thumbMouseenterListener),this.adapter.registerThumbEventHandler(sY.START,"mouseleave",this.thumbMouseleaveListener),this.adapter.registerInputEventHandler(sY.START,"change",this.inputStartChangeListener),this.adapter.registerInputEventHandler(sY.START,"focus",this.inputStartFocusListener),this.adapter.registerInputEventHandler(sY.START,"blur",this.inputStartBlurListener)),this.adapter.registerThumbEventHandler(sY.END,"mouseenter",this.thumbMouseenterListener),this.adapter.registerThumbEventHandler(sY.END,"mouseleave",this.thumbMouseleaveListener),this.adapter.registerInputEventHandler(sY.END,"change",this.inputEndChangeListener),this.adapter.registerInputEventHandler(sY.END,"focus",this.inputEndFocusListener),this.adapter.registerInputEventHandler(sY.END,"blur",this.inputEndBlurListener)},t.prototype.deregisterEventHandlers=function(){this.adapter.deregisterWindowEventHandler("resize",this.resizeListener),t.SUPPORTS_POINTER_EVENTS?(this.adapter.deregisterEventHandler("pointerdown",this.pointerdownListener),this.adapter.deregisterEventHandler("pointerup",this.pointerupListener)):(this.adapter.deregisterEventHandler("mousedown",this.mousedownOrTouchstartListener),this.adapter.deregisterEventHandler("touchstart",this.mousedownOrTouchstartListener)),this.isRange&&(this.adapter.deregisterThumbEventHandler(sY.START,"mouseenter",this.thumbMouseenterListener),this.adapter.deregisterThumbEventHandler(sY.START,"mouseleave",this.thumbMouseleaveListener),this.adapter.deregisterInputEventHandler(sY.START,"change",this.inputStartChangeListener),this.adapter.deregisterInputEventHandler(sY.START,"focus",this.inputStartFocusListener),this.adapter.deregisterInputEventHandler(sY.START,"blur",this.inputStartBlurListener)),this.adapter.deregisterThumbEventHandler(sY.END,"mouseenter",this.thumbMouseenterListener),this.adapter.deregisterThumbEventHandler(sY.END,"mouseleave",this.thumbMouseleaveListener),this.adapter.deregisterInputEventHandler(sY.END,"change",this.inputEndChangeListener),this.adapter.deregisterInputEventHandler(sY.END,"focus",this.inputEndFocusListener),this.adapter.deregisterInputEventHandler(sY.END,"blur",this.inputEndBlurListener)},t.prototype.handlePointerup=function(){this.handleUp(),this.adapter.deregisterEventHandler("pointermove",this.moveListener)},t.SUPPORTS_POINTER_EVENTS=rU&&!!window.PointerEvent,t}(iY),rW=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.skipInitialUIUpdate=!1,t.valueToAriaValueTextFn=null,t}return iN(t,e),t.attachTo=function(e,n){return void 0===n&&(n={}),new t(e,void 0,n)},t.prototype.getDefaultFoundation=function(){var e=this;return new rV({hasClass:function(t){return e.root.classList.contains(t)},addClass:function(t){e.root.classList.add(t)},removeClass:function(t){e.root.classList.remove(t)},addThumbClass:function(t,n){e.getThumbEl(n).classList.add(t)},removeThumbClass:function(t,n){e.getThumbEl(n).classList.remove(t)},getAttribute:function(t){return e.root.getAttribute(t)},getInputValue:function(t){return e.getInput(t).value},setInputValue:function(t,n){e.getInput(n).value=t},getInputAttribute:function(t,n){return e.getInput(n).getAttribute(t)},setInputAttribute:function(t,n,i){e.getInput(i).setAttribute(t,n)},removeInputAttribute:function(t,n){e.getInput(n).removeAttribute(t)},focusInput:function(t){e.getInput(t).focus()},isInputFocused:function(t){return e.getInput(t)===document.activeElement},getThumbKnobWidth:function(t){return e.getThumbEl(t).querySelector("."+rz.THUMB_KNOB).getBoundingClientRect().width},getThumbBoundingClientRect:function(t){return e.getThumbEl(t).getBoundingClientRect()},getBoundingClientRect:function(){return e.root.getBoundingClientRect()},isRTL:function(){return"rtl"===getComputedStyle(e.root).direction},setThumbStyleProperty:function(t,n,i){e.getThumbEl(i).style.setProperty(t,n)},removeThumbStyleProperty:function(t,n){e.getThumbEl(n).style.removeProperty(t)},setTrackActiveStyleProperty:function(t,n){e.trackActive.style.setProperty(t,n)},removeTrackActiveStyleProperty:function(t){e.trackActive.style.removeProperty(t)},setValueIndicatorText:function(t,n){e.getThumbEl(n).querySelector("."+rz.VALUE_INDICATOR_TEXT).textContent=String(t)},getValueToAriaValueTextFn:function(){return e.valueToAriaValueTextFn},updateTickMarks:function(t){var n=e.root.querySelector("."+rz.TICK_MARKS_CONTAINER);n||((n=document.createElement("div")).classList.add(rz.TICK_MARKS_CONTAINER),e.root.querySelector("."+rz.TRACK).appendChild(n)),t.length!==n.children.length?(n.innerHTML="",e.addTickMarks(n,t)):e.updateTickMarks(n,t)},setPointerCapture:function(t){e.root.setPointerCapture(t)},emitChangeEvent:function(t,n){e.emit(rH.CHANGE,{value:t,thumb:n})},emitInputEvent:function(t,n){e.emit(rH.INPUT,{value:t,thumb:n})},emitDragStartEvent:function(t,n){e.getRipple(n).activate()},emitDragEndEvent:function(t,n){e.getRipple(n).deactivate()},registerEventHandler:function(t,n){e.listen(t,n)},deregisterEventHandler:function(t,n){e.unlisten(t,n)},registerThumbEventHandler:function(t,n,i){e.getThumbEl(t).addEventListener(n,i)},deregisterThumbEventHandler:function(t,n,i){e.getThumbEl(t).removeEventListener(n,i)},registerInputEventHandler:function(t,n,i){e.getInput(t).addEventListener(n,i)},deregisterInputEventHandler:function(t,n,i){e.getInput(t).removeEventListener(n,i)},registerBodyEventHandler:function(e,t){document.body.addEventListener(e,t)},deregisterBodyEventHandler:function(e,t){document.body.removeEventListener(e,t)},registerWindowEventHandler:function(e,t){window.addEventListener(e,t)},deregisterWindowEventHandler:function(e,t){window.removeEventListener(e,t)}})},t.prototype.initialize=function(e){var t=(void 0===e?{}:e).skipInitialUIUpdate;this.inputs=[].slice.call(this.root.querySelectorAll("."+rz.INPUT)),this.thumbs=[].slice.call(this.root.querySelectorAll("."+rz.THUMB)),this.trackActive=this.root.querySelector("."+rz.TRACK_ACTIVE),this.ripples=this.createRipples(),t&&(this.skipInitialUIUpdate=!0)},t.prototype.initialSyncWithDOM=function(){this.foundation.layout({skipUpdateUI:this.skipInitialUIUpdate})},t.prototype.layout=function(){this.foundation.layout()},t.prototype.getValueStart=function(){return this.foundation.getValueStart()},t.prototype.setValueStart=function(e){this.foundation.setValueStart(e)},t.prototype.getValue=function(){return this.foundation.getValue()},t.prototype.setValue=function(e){this.foundation.setValue(e)},t.prototype.getDisabled=function(){return this.foundation.getDisabled()},t.prototype.setDisabled=function(e){this.foundation.setDisabled(e)},t.prototype.setValueToAriaValueTextFn=function(e){this.valueToAriaValueTextFn=e},t.prototype.getThumbEl=function(e){return e===sY.END?this.thumbs[this.thumbs.length-1]:this.thumbs[0]},t.prototype.getInput=function(e){return e===sY.END?this.inputs[this.inputs.length-1]:this.inputs[0]},t.prototype.getRipple=function(e){return e===sY.END?this.ripples[this.ripples.length-1]:this.ripples[0]},t.prototype.addTickMarks=function(e,t){for(var n=document.createDocumentFragment(),i=0;i<t.length;i++){var r=document.createElement("div"),o=t[i]===sj.ACTIVE?rz.TICK_MARK_ACTIVE:rz.TICK_MARK_INACTIVE;r.classList.add(o),n.appendChild(r)}e.appendChild(n)},t.prototype.updateTickMarks=function(e,t){for(var n=Array.from(e.children),i=0;i<n.length;i++)t[i]===sj.ACTIVE?(n[i].classList.add(rz.TICK_MARK_ACTIVE),n[i].classList.remove(rz.TICK_MARK_INACTIVE)):(n[i].classList.add(rz.TICK_MARK_INACTIVE),n[i].classList.remove(rz.TICK_MARK_ACTIVE))},t.prototype.createRipples=function(){for(var e=[],t=[].slice.call(this.root.querySelectorAll("."+rz.THUMB)),n=this,i=0;i<t.length;i++)!function(i){var r=t[i],o=n.inputs[i],a=iB(iB({},rt.createAdapter(n)),{addClass:function(e){r.classList.add(e)},computeBoundingRect:function(){return r.getBoundingClientRect()},deregisterInteractionHandler:function(e,t){o.removeEventListener(e,t)},isSurfaceActive:function(){return iW(o,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(e,t){o.addEventListener(e,t)},removeClass:function(e){r.classList.remove(e)},updateCssVariable:function(e,t){r.style.setProperty(e,t)}}),s=new rt(r,new re(a));s.unbounded=!0,e.push(s)}(i);return e},t}(iH),rG={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surface--animating-closed",ANIMATING_OPEN:"mdc-menu-surface--animating-open",FIXED:"mdc-menu-surface--fixed",IS_OPEN_BELOW:"mdc-menu-surface--is-open-below",OPEN:"mdc-menu-surface--open",ROOT:"mdc-menu-surface"},rq={CLOSED_EVENT:"MDCMenuSurface:closed",OPENED_EVENT:"MDCMenuSurface:opened",FOCUSABLE_ELEMENTS:'button:not(:disabled), [href]:not([aria-disabled="true"]), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'},rK={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67};!function(e){e[e.BOTTOM=1]="BOTTOM",e[e.CENTER=2]="CENTER",e[e.RIGHT=4]="RIGHT",e[e.FLIP_RTL=8]="FLIP_RTL"}(sH||(sH={})),function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=4]="TOP_RIGHT",e[e.BOTTOM_LEFT=1]="BOTTOM_LEFT",e[e.BOTTOM_RIGHT=5]="BOTTOM_RIGHT",e[e.TOP_START=8]="TOP_START",e[e.TOP_END=12]="TOP_END",e[e.BOTTOM_START=9]="BOTTOM_START",e[e.BOTTOM_END=13]="BOTTOM_END"}(sU||(sU={}));var rX={LIST_ITEM_ACTIVATED_CLASS:"mdc-list-item--activated",LIST_ITEM_CLASS:"mdc-list-item",LIST_ITEM_DISABLED_CLASS:"mdc-list-item--disabled",LIST_ITEM_SELECTED_CLASS:"mdc-list-item--selected",LIST_ITEM_TEXT_CLASS:"mdc-list-item__text",LIST_ITEM_PRIMARY_TEXT_CLASS:"mdc-list-item__primary-text",ROOT:"mdc-list"},rZ={ACTION_EVENT:"MDCList:action",ARIA_CHECKED:"aria-checked",ARIA_CHECKED_CHECKBOX_SELECTOR:'[role="checkbox"][aria-checked="true"]',ARIA_CHECKED_RADIO_SELECTOR:'[role="radio"][aria-checked="true"]',ARIA_CURRENT:"aria-current",ARIA_DISABLED:"aria-disabled",ARIA_ORIENTATION:"aria-orientation",ARIA_ORIENTATION_HORIZONTAL:"horizontal",ARIA_ROLE_CHECKBOX_SELECTOR:'[role="checkbox"]',ARIA_SELECTED:"aria-selected",CHECKBOX_RADIO_SELECTOR:'input[type="checkbox"], input[type="radio"]',CHECKBOX_SELECTOR:'input[type="checkbox"]',CHILD_ELEMENTS_TO_TOGGLE_TABINDEX:"\n ."+rX.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+rX.LIST_ITEM_CLASS+" a\n ",FOCUSABLE_CHILD_ELEMENTS:"\n ."+rX.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+rX.LIST_ITEM_CLASS+" a,\n ."+rX.LIST_ITEM_CLASS+' input[type="radio"]:not(:disabled),\n .'+rX.LIST_ITEM_CLASS+' input[type="checkbox"]:not(:disabled)\n ',RADIO_SELECTOR:'input[type="radio"]'},rJ={UNSET_INDEX:-1,TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS:300},rQ={UNKNOWN:"Unknown",BACKSPACE:"Backspace",ENTER:"Enter",SPACEBAR:"Spacebar",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",END:"End",HOME:"Home",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",DELETE:"Delete",ESCAPE:"Escape"},r0=new Set;r0.add(rQ.BACKSPACE),r0.add(rQ.ENTER),r0.add(rQ.SPACEBAR),r0.add(rQ.PAGE_UP),r0.add(rQ.PAGE_DOWN),r0.add(rQ.END),r0.add(rQ.HOME),r0.add(rQ.ARROW_LEFT),r0.add(rQ.ARROW_UP),r0.add(rQ.ARROW_RIGHT),r0.add(rQ.ARROW_DOWN),r0.add(rQ.DELETE),r0.add(rQ.ESCAPE);var r1={BACKSPACE:8,ENTER:13,SPACEBAR:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,DELETE:46,ESCAPE:27},r2=new Map;r2.set(r1.BACKSPACE,rQ.BACKSPACE),r2.set(r1.ENTER,rQ.ENTER),r2.set(r1.SPACEBAR,rQ.SPACEBAR),r2.set(r1.PAGE_UP,rQ.PAGE_UP),r2.set(r1.PAGE_DOWN,rQ.PAGE_DOWN),r2.set(r1.END,rQ.END),r2.set(r1.HOME,rQ.HOME),r2.set(r1.ARROW_LEFT,rQ.ARROW_LEFT),r2.set(r1.ARROW_UP,rQ.ARROW_UP),r2.set(r1.ARROW_RIGHT,rQ.ARROW_RIGHT),r2.set(r1.ARROW_DOWN,rQ.ARROW_DOWN),r2.set(r1.DELETE,rQ.DELETE),r2.set(r1.ESCAPE,rQ.ESCAPE);var r5=new Set;function r3(e){var t=e.key;if(r0.has(t))return t;var n=r2.get(e.keyCode);return n||rQ.UNKNOWN}r5.add(rQ.PAGE_UP),r5.add(rQ.PAGE_DOWN),r5.add(rQ.END),r5.add(rQ.HOME),r5.add(rQ.ARROW_LEFT),r5.add(rQ.ARROW_UP),r5.add(rQ.ARROW_RIGHT),r5.add(rQ.ARROW_DOWN);var r4=["input","button","textarea","select"],r6=function(e){var t=e.target;if(t){var n=(""+t.tagName).toLowerCase();-1===r4.indexOf(n)&&e.preventDefault()}};function r8(e,t){var n,i=e.nextChar,r=e.focusItemAtIndex,o=e.sortedIndexByFirstChar,a=e.focusedItemIndex,s=e.skipFocus,l=e.isItemAtIndexDisabled;return clearTimeout(t.bufferClearTimeout),t.bufferClearTimeout=setTimeout(function(){r9(t)},rJ.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS),t.typeaheadBuffer=t.typeaheadBuffer+i,-1===(n=1===t.typeaheadBuffer.length?function(e,t,n,i){var r,o=i.typeaheadBuffer[0],a=e.get(o);if(!a)return -1;if(o===i.currentFirstChar&&a[i.sortedIndexCursor].index===t){i.sortedIndexCursor=(i.sortedIndexCursor+1)%a.length;var s=a[i.sortedIndexCursor].index;if(!n(s))return s}i.currentFirstChar=o;var l=-1;for(r=0;r<a.length;r++)if(!n(a[r].index)){l=r;break}for(;r<a.length;r++)if(a[r].index>t&&!n(a[r].index)){l=r;break}return -1!==l?(i.sortedIndexCursor=l,a[i.sortedIndexCursor].index):-1}(o,a,l,t):function(e,t,n){var i=n.typeaheadBuffer[0],r=e.get(i);if(!r)return -1;var o=r[n.sortedIndexCursor];if(0===o.text.lastIndexOf(n.typeaheadBuffer,0)&&!t(o.index))return o.index;for(var a=(n.sortedIndexCursor+1)%r.length,s=-1;a!==n.sortedIndexCursor;){var l=r[a],c=0===l.text.lastIndexOf(n.typeaheadBuffer,0),d=!t(l.index);if(c&&d){s=a;break}a=(a+1)%r.length}return -1!==s?(n.sortedIndexCursor=s,r[n.sortedIndexCursor].index):-1}(o,l,t))||s||r(n),n}function r7(e){return e.typeaheadBuffer.length>0}function r9(e){e.typeaheadBuffer=""}function oe(e,t){var n=e.event,i=e.isTargetListItem,r=e.focusedItemIndex,o=e.focusItemAtIndex,a=e.sortedIndexByFirstChar,s=e.isItemAtIndexDisabled,l="ArrowLeft"===r3(n),c="ArrowUp"===r3(n),d="ArrowRight"===r3(n),u="ArrowDown"===r3(n),h="Home"===r3(n),m="End"===r3(n),f="Enter"===r3(n),p="Spacebar"===r3(n);if(l||c||d||u||h||m||f)return -1;if(!p&&1===n.key.length){r6(n);var g={focusItemAtIndex:o,focusedItemIndex:r,nextChar:n.key.toLowerCase(),sortedIndexByFirstChar:a,skipFocus:!1,isItemAtIndexDisabled:s};return r8(g,t)}if(!p)return -1;if(i&&r6(n),i&&r7(t)){var g={focusItemAtIndex:o,focusedItemIndex:r,nextChar:" ",sortedIndexByFirstChar:a,skipFocus:!1,isItemAtIndexDisabled:s};return r8(g,t)}return -1}var ot=function(e){function t(n){var i=e.call(this,iB(iB({},t.defaultAdapter),n))||this;return i.wrapFocus_=!1,i.isVertical_=!0,i.isSingleSelectionList_=!1,i.selectedIndex_=rJ.UNSET_INDEX,i.focusedItemIndex=rJ.UNSET_INDEX,i.useActivatedClass_=!1,i.useSelectedAttr_=!1,i.ariaCurrentAttrValue_=null,i.isCheckboxList_=!1,i.isRadioList_=!1,i.hasTypeahead=!1,i.typeaheadState={bufferClearTimeout:0,currentFirstChar:"",sortedIndexCursor:0,typeaheadBuffer:""},i.sortedIndexByFirstChar=new Map,i}return iN(t,e),Object.defineProperty(t,"strings",{get:function(){return rZ},enumerable:!0,configurable:!0}),Object.defineProperty(t,"cssClasses",{get:function(){return rX},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return rJ},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClassForElementIndex:function(){},focusItemAtIndex:function(){},getAttributeForElementIndex:function(){return null},getFocusedElementIndex:function(){return 0},getListItemCount:function(){return 0},hasCheckboxAtIndex:function(){return!1},hasRadioAtIndex:function(){return!1},isCheckboxCheckedAtIndex:function(){return!1},isFocusInsideList:function(){return!1},isRootFocused:function(){return!1},listItemAtIndexHasClass:function(){return!1},notifyAction:function(){},removeClassForElementIndex:function(){},setAttributeForElementIndex:function(){},setCheckedCheckboxOrRadioAtIndex:function(){},setTabIndexForListItemChildren:function(){},getPrimaryTextAtIndex:function(){return""}}},enumerable:!0,configurable:!0}),t.prototype.layout=function(){0!==this.adapter.getListItemCount()&&(this.adapter.hasCheckboxAtIndex(0)?this.isCheckboxList_=!0:this.adapter.hasRadioAtIndex(0)?this.isRadioList_=!0:this.maybeInitializeSingleSelection(),this.hasTypeahead&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex()))},t.prototype.setWrapFocus=function(e){this.wrapFocus_=e},t.prototype.setVerticalOrientation=function(e){this.isVertical_=e},t.prototype.setSingleSelection=function(e){this.isSingleSelectionList_=e,e&&this.maybeInitializeSingleSelection()},t.prototype.maybeInitializeSingleSelection=function(){for(var e=0;e<this.adapter.getListItemCount();e++){var t=this.adapter.listItemAtIndexHasClass(e,rX.LIST_ITEM_SELECTED_CLASS),n=this.adapter.listItemAtIndexHasClass(e,rX.LIST_ITEM_ACTIVATED_CLASS);if(t||n){n&&this.setUseActivatedClass(!0),this.isSingleSelectionList_=!0,this.selectedIndex_=e;return}}},t.prototype.setHasTypeahead=function(e){this.hasTypeahead=e,e&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex())},t.prototype.isTypeaheadInProgress=function(){return this.hasTypeahead&&r7(this.typeaheadState)},t.prototype.setUseActivatedClass=function(e){this.useActivatedClass_=e},t.prototype.setUseSelectedAttribute=function(e){this.useSelectedAttr_=e},t.prototype.getSelectedIndex=function(){return this.selectedIndex_},t.prototype.setSelectedIndex=function(e){this.isIndexValid_(e)&&(this.isCheckboxList_?this.setCheckboxAtIndex_(e):this.isRadioList_?this.setRadioAtIndex_(e):this.setSingleSelectionAtIndex_(e))},t.prototype.handleFocusIn=function(e,t){t>=0&&(this.focusedItemIndex=t,this.adapter.setAttributeForElementIndex(t,"tabindex","0"),this.adapter.setTabIndexForListItemChildren(t,"0"))},t.prototype.handleFocusOut=function(e,t){var n=this;t>=0&&(this.adapter.setAttributeForElementIndex(t,"tabindex","-1"),this.adapter.setTabIndexForListItemChildren(t,"-1")),setTimeout(function(){n.adapter.isFocusInsideList()||n.setTabindexToFirstSelectedOrFocusedItem()},0)},t.prototype.handleKeydown=function(e,t,n){var i=this,r="ArrowLeft"===r3(e),o="ArrowUp"===r3(e),a="ArrowRight"===r3(e),s="ArrowDown"===r3(e),l="Home"===r3(e),c="End"===r3(e),d="Enter"===r3(e),u="Spacebar"===r3(e),h="A"===e.key||"a"===e.key;if(this.adapter.isRootFocused()){if(o||c?(e.preventDefault(),this.focusLastElement()):(s||l)&&(e.preventDefault(),this.focusFirstElement()),this.hasTypeahead){var m={event:e,focusItemAtIndex:function(e){i.focusItemAtIndex(e)},focusedItemIndex:-1,isTargetListItem:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(e){return i.adapter.listItemAtIndexHasClass(e,rX.LIST_ITEM_DISABLED_CLASS)}};oe(m,this.typeaheadState)}return}var f=this.adapter.getFocusedElementIndex();if(-1!==f||!((f=n)<0)){if(this.isVertical_&&s||!this.isVertical_&&a)r6(e),this.focusNextElement(f);else if(this.isVertical_&&o||!this.isVertical_&&r)r6(e),this.focusPrevElement(f);else if(l)r6(e),this.focusFirstElement();else if(c)r6(e),this.focusLastElement();else if(h&&e.ctrlKey&&this.isCheckboxList_)e.preventDefault(),this.toggleAll(this.selectedIndex_===rJ.UNSET_INDEX?[]:this.selectedIndex_);else if((d||u)&&t){var p=e.target;if(p&&"A"===p.tagName&&d||(r6(e),this.adapter.listItemAtIndexHasClass(f,rX.LIST_ITEM_DISABLED_CLASS)))return;this.isTypeaheadInProgress()||(this.isSelectableList_()&&this.setSelectedIndexOnAction_(f),this.adapter.notifyAction(f))}if(this.hasTypeahead){var m={event:e,focusItemAtIndex:function(e){i.focusItemAtIndex(e)},focusedItemIndex:this.focusedItemIndex,isTargetListItem:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(e){return i.adapter.listItemAtIndexHasClass(e,rX.LIST_ITEM_DISABLED_CLASS)}};oe(m,this.typeaheadState)}}},t.prototype.handleClick=function(e,t){e!==rJ.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(e,rX.LIST_ITEM_DISABLED_CLASS)||(this.isSelectableList_()&&this.setSelectedIndexOnAction_(e,t),this.adapter.notifyAction(e)))},t.prototype.focusNextElement=function(e){var t=this.adapter.getListItemCount(),n=e+1;if(n>=t)if(!this.wrapFocus_)return e;else n=0;return this.focusItemAtIndex(n),n},t.prototype.focusPrevElement=function(e){var t=e-1;if(t<0)if(!this.wrapFocus_)return e;else t=this.adapter.getListItemCount()-1;return this.focusItemAtIndex(t),t},t.prototype.focusFirstElement=function(){return this.focusItemAtIndex(0),0},t.prototype.focusLastElement=function(){var e=this.adapter.getListItemCount()-1;return this.focusItemAtIndex(e),e},t.prototype.focusInitialElement=function(){var e=this.getFirstSelectedOrFocusedItemIndex();return this.focusItemAtIndex(e),e},t.prototype.setEnabled=function(e,t){this.isIndexValid_(e)&&(t?(this.adapter.removeClassForElementIndex(e,rX.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(e,rZ.ARIA_DISABLED,"false")):(this.adapter.addClassForElementIndex(e,rX.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(e,rZ.ARIA_DISABLED,"true")))},t.prototype.setSingleSelectionAtIndex_=function(e){if(this.selectedIndex_!==e){var t=rX.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass_&&(t=rX.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex_!==rJ.UNSET_INDEX&&this.adapter.removeClassForElementIndex(this.selectedIndex_,t),this.setAriaForSingleSelectionAtIndex_(e),this.setTabindexAtIndex(e),e!==rJ.UNSET_INDEX&&this.adapter.addClassForElementIndex(e,t),this.selectedIndex_=e}},t.prototype.setAriaForSingleSelectionAtIndex_=function(e){this.selectedIndex_===rJ.UNSET_INDEX&&(this.ariaCurrentAttrValue_=this.adapter.getAttributeForElementIndex(e,rZ.ARIA_CURRENT));var t=null!==this.ariaCurrentAttrValue_,n=t?rZ.ARIA_CURRENT:rZ.ARIA_SELECTED;if(this.selectedIndex_!==rJ.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex_,n,"false"),e!==rJ.UNSET_INDEX){var i=t?this.ariaCurrentAttrValue_:"true";this.adapter.setAttributeForElementIndex(e,n,i)}},t.prototype.getSelectionAttribute=function(){return this.useSelectedAttr_?rZ.ARIA_SELECTED:rZ.ARIA_CHECKED},t.prototype.setRadioAtIndex_=function(e){var t=this.getSelectionAttribute();this.adapter.setCheckedCheckboxOrRadioAtIndex(e,!0),this.selectedIndex_!==rJ.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex_,t,"false"),this.adapter.setAttributeForElementIndex(e,t,"true"),this.selectedIndex_=e},t.prototype.setCheckboxAtIndex_=function(e){for(var t=this.getSelectionAttribute(),n=0;n<this.adapter.getListItemCount();n++){var i=!1;e.indexOf(n)>=0&&(i=!0),this.adapter.setCheckedCheckboxOrRadioAtIndex(n,i),this.adapter.setAttributeForElementIndex(n,t,i?"true":"false")}this.selectedIndex_=e},t.prototype.setTabindexAtIndex=function(e){this.focusedItemIndex===rJ.UNSET_INDEX&&0!==e?this.adapter.setAttributeForElementIndex(0,"tabindex","-1"):this.focusedItemIndex>=0&&this.focusedItemIndex!==e&&this.adapter.setAttributeForElementIndex(this.focusedItemIndex,"tabindex","-1"),this.selectedIndex_ instanceof Array||this.selectedIndex_===e||this.adapter.setAttributeForElementIndex(this.selectedIndex_,"tabindex","-1"),e!==rJ.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(e,"tabindex","0")},t.prototype.isSelectableList_=function(){return this.isSingleSelectionList_||this.isCheckboxList_||this.isRadioList_},t.prototype.setTabindexToFirstSelectedOrFocusedItem=function(){var e=this.getFirstSelectedOrFocusedItemIndex();this.setTabindexAtIndex(e)},t.prototype.getFirstSelectedOrFocusedItemIndex=function(){var e=this.focusedItemIndex>=0?this.focusedItemIndex:0;return this.isSelectableList_()&&("number"==typeof this.selectedIndex_&&this.selectedIndex_!==rJ.UNSET_INDEX?e=this.selectedIndex_:this.selectedIndex_ instanceof Array&&this.selectedIndex_.length>0&&(e=this.selectedIndex_.reduce(function(e,t){return Math.min(e,t)}))),e},t.prototype.isIndexValid_=function(e){var t=this;if(e instanceof Array){if(!this.isCheckboxList_)throw Error("MDCListFoundation: Array of index is only supported for checkbox based list");return 0===e.length||e.some(function(e){return t.isIndexInRange_(e)})}if("number"!=typeof e)return!1;if(this.isCheckboxList_)throw Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+e);return this.isIndexInRange_(e)||this.isSingleSelectionList_&&e===rJ.UNSET_INDEX},t.prototype.isIndexInRange_=function(e){var t=this.adapter.getListItemCount();return e>=0&&e<t},t.prototype.setSelectedIndexOnAction_=function(e,t){void 0===t&&(t=!0),this.isCheckboxList_?this.toggleCheckboxAtIndex_(e,t):this.setSelectedIndex(e)},t.prototype.toggleCheckboxAtIndex_=function(e,t){var n=this.getSelectionAttribute(),i=this.adapter.isCheckboxCheckedAtIndex(e);t&&(i=!i,this.adapter.setCheckedCheckboxOrRadioAtIndex(e,i)),this.adapter.setAttributeForElementIndex(e,n,i?"true":"false");var r=this.selectedIndex_===rJ.UNSET_INDEX?[]:this.selectedIndex_.slice();i?r.push(e):r=r.filter(function(t){return t!==e}),this.selectedIndex_=r},t.prototype.focusItemAtIndex=function(e){this.adapter.focusItemAtIndex(e),this.focusedItemIndex=e},t.prototype.toggleAll=function(e){var t=this.adapter.getListItemCount();if(e.length===t)this.setCheckboxAtIndex_([]);else{for(var n=[],i=0;i<t;i++)(!this.adapter.listItemAtIndexHasClass(i,rX.LIST_ITEM_DISABLED_CLASS)||e.indexOf(i)>-1)&&n.push(i);this.setCheckboxAtIndex_(n)}},t.prototype.typeaheadMatchItem=function(e,t,n){var i=this;return void 0===n&&(n=!1),r8({focusItemAtIndex:function(e){i.focusItemAtIndex(e)},focusedItemIndex:t||this.focusedItemIndex,nextChar:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:n,isItemAtIndexDisabled:function(e){return i.adapter.listItemAtIndexHasClass(e,rX.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState)},t.prototype.typeaheadInitSortedIndex=function(){return function(e,t){for(var n=new Map,i=0;i<e;i++){var r=t(i).trim();if(r){var o=r[0].toLowerCase();n.has(o)||n.set(o,[]),n.get(o).push({text:r.toLowerCase(),index:i})}}return n.forEach(function(e){e.sort(function(e,t){return e.index-t.index})}),n}(this.adapter.getListItemCount(),this.adapter.getPrimaryTextAtIndex)},t.prototype.clearTypeaheadBuffer=function(){r9(this.typeaheadState)},t}(iY),on=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iN(t,e),Object.defineProperty(t.prototype,"vertical",{set:function(e){this.foundation.setVerticalOrientation(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"listElements",{get:function(){return[].slice.call(this.root.querySelectorAll("."+rX.LIST_ITEM_CLASS))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"wrapFocus",{set:function(e){this.foundation.setWrapFocus(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"typeaheadInProgress",{get:function(){return this.foundation.isTypeaheadInProgress()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasTypeahead",{set:function(e){this.foundation.setHasTypeahead(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"singleSelection",{set:function(e){this.foundation.setSingleSelection(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(e){this.foundation.setSelectedIndex(e)},enumerable:!0,configurable:!0}),t.attachTo=function(e){return new t(e)},t.prototype.initialSyncWithDOM=function(){this.handleClick_=this.handleClickEvent_.bind(this),this.handleKeydown_=this.handleKeydownEvent_.bind(this),this.focusInEventListener_=this.handleFocusInEvent_.bind(this),this.focusOutEventListener_=this.handleFocusOutEvent_.bind(this),this.listen("keydown",this.handleKeydown_),this.listen("click",this.handleClick_),this.listen("focusin",this.focusInEventListener_),this.listen("focusout",this.focusOutEventListener_),this.layout(),this.initializeListType()},t.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown_),this.unlisten("click",this.handleClick_),this.unlisten("focusin",this.focusInEventListener_),this.unlisten("focusout",this.focusOutEventListener_)},t.prototype.layout=function(){var e=this.root.getAttribute(rZ.ARIA_ORIENTATION);this.vertical=e!==rZ.ARIA_ORIENTATION_HORIZONTAL,[].slice.call(this.root.querySelectorAll(".mdc-list-item:not([tabindex])")).forEach(function(e){e.setAttribute("tabindex","-1")}),[].slice.call(this.root.querySelectorAll(rZ.FOCUSABLE_CHILD_ELEMENTS)).forEach(function(e){return e.setAttribute("tabindex","-1")}),this.foundation.layout()},t.prototype.getPrimaryText=function(e){var t=e.querySelector("."+rX.LIST_ITEM_PRIMARY_TEXT_CLASS);if(t)return t.textContent||"";var n=e.querySelector("."+rX.LIST_ITEM_TEXT_CLASS);return n&&n.textContent||""},t.prototype.initializeListType=function(){var e=this,t=this.root.querySelectorAll(rZ.ARIA_ROLE_CHECKBOX_SELECTOR),n=this.root.querySelector(rZ.ARIA_CHECKED_RADIO_SELECTOR);if(t.length){var i=this.root.querySelectorAll(rZ.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=[].map.call(i,function(t){return e.listElements.indexOf(t)})}else n&&(this.selectedIndex=this.listElements.indexOf(n))},t.prototype.setEnabled=function(e,t){this.foundation.setEnabled(e,t)},t.prototype.typeaheadMatchItem=function(e,t){return this.foundation.typeaheadMatchItem(e,t,!0)},t.prototype.getDefaultFoundation=function(){var e=this;return new ot({addClassForElementIndex:function(t,n){var i=e.listElements[t];i&&i.classList.add(n)},focusItemAtIndex:function(t){var n=e.listElements[t];n&&n.focus()},getAttributeForElementIndex:function(t,n){return e.listElements[t].getAttribute(n)},getFocusedElementIndex:function(){return e.listElements.indexOf(document.activeElement)},getListItemCount:function(){return e.listElements.length},getPrimaryTextAtIndex:function(t){return e.getPrimaryText(e.listElements[t])},hasCheckboxAtIndex:function(t){return!!e.listElements[t].querySelector(rZ.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(t){return!!e.listElements[t].querySelector(rZ.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(t){return e.listElements[t].querySelector(rZ.CHECKBOX_SELECTOR).checked},isFocusInsideList:function(){return e.root!==document.activeElement&&e.root.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===e.root},listItemAtIndexHasClass:function(t,n){return e.listElements[t].classList.contains(n)},notifyAction:function(t){e.emit(rZ.ACTION_EVENT,{index:t},!0)},removeClassForElementIndex:function(t,n){var i=e.listElements[t];i&&i.classList.remove(n)},setAttributeForElementIndex:function(t,n,i){var r=e.listElements[t];r&&r.setAttribute(n,i)},setCheckedCheckboxOrRadioAtIndex:function(t,n){var i=e.listElements[t].querySelector(rZ.CHECKBOX_RADIO_SELECTOR);i.checked=n;var r=document.createEvent("Event");r.initEvent("change",!0,!0),i.dispatchEvent(r)},setTabIndexForListItemChildren:function(t,n){var i=e.listElements[t];[].slice.call(i.querySelectorAll(rZ.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX)).forEach(function(e){return e.setAttribute("tabindex",n)})}})},t.prototype.getListItemIndex_=function(e){var t=iV(e.target,"."+rX.LIST_ITEM_CLASS+", ."+rX.ROOT);return t&&iW(t,"."+rX.LIST_ITEM_CLASS)?this.listElements.indexOf(t):-1},t.prototype.handleFocusInEvent_=function(e){var t=this.getListItemIndex_(e);this.foundation.handleFocusIn(e,t)},t.prototype.handleFocusOutEvent_=function(e){var t=this.getListItemIndex_(e);this.foundation.handleFocusOut(e,t)},t.prototype.handleKeydownEvent_=function(e){var t=this.getListItemIndex_(e),n=e.target;this.foundation.handleKeydown(e,n.classList.contains(rX.LIST_ITEM_CLASS),t)},t.prototype.handleClickEvent_=function(e){var t=this.getListItemIndex_(e),n=!iW(e.target,rZ.CHECKBOX_RADIO_SELECTOR);this.foundation.handleClick(t,n)},t}(iH),oi=function(e){function t(n){var i=e.call(this,iB(iB({},t.defaultAdapter),n))||this;return i.isSurfaceOpen=!1,i.isQuickOpen=!1,i.isHoistedElement=!1,i.isFixedPosition=!1,i.openAnimationEndTimerId=0,i.closeAnimationEndTimerId=0,i.animationRequestId=0,i.anchorCorner=sU.TOP_START,i.originCorner=sU.TOP_START,i.anchorMargin={top:0,right:0,bottom:0,left:0},i.position={x:0,y:0},i}return iN(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return rG},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return rq},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return rK},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Corner",{get:function(){return sU},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},hasAnchor:function(){return!1},isElementInContainer:function(){return!1},isFocused:function(){return!1},isRtl:function(){return!1},getInnerDimensions:function(){return{height:0,width:0}},getAnchorDimensions:function(){return null},getWindowDimensions:function(){return{height:0,width:0}},getBodyDimensions:function(){return{height:0,width:0}},getWindowScroll:function(){return{x:0,y:0}},setPosition:function(){},setMaxHeight:function(){},setTransformOrigin:function(){},saveFocus:function(){},restoreFocus:function(){},notifyClose:function(){},notifyOpen:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){var e=t.cssClasses,n=e.ROOT,i=e.OPEN;if(!this.adapter.hasClass(n))throw Error(n+" class required in root element.");this.adapter.hasClass(i)&&(this.isSurfaceOpen=!0)},t.prototype.destroy=function(){clearTimeout(this.openAnimationEndTimerId),clearTimeout(this.closeAnimationEndTimerId),cancelAnimationFrame(this.animationRequestId)},t.prototype.setAnchorCorner=function(e){this.anchorCorner=e},t.prototype.flipCornerHorizontally=function(){this.originCorner=this.originCorner^sH.RIGHT},t.prototype.setAnchorMargin=function(e){this.anchorMargin.top=e.top||0,this.anchorMargin.right=e.right||0,this.anchorMargin.bottom=e.bottom||0,this.anchorMargin.left=e.left||0},t.prototype.setIsHoisted=function(e){this.isHoistedElement=e},t.prototype.setFixedPosition=function(e){this.isFixedPosition=e},t.prototype.setAbsolutePosition=function(e,t){this.position.x=this.isFinite(e)?e:0,this.position.y=this.isFinite(t)?t:0},t.prototype.setQuickOpen=function(e){this.isQuickOpen=e},t.prototype.isOpen=function(){return this.isSurfaceOpen},t.prototype.open=function(){var e=this;this.isSurfaceOpen||(this.adapter.saveFocus(),this.isQuickOpen?(this.isSurfaceOpen=!0,this.adapter.addClass(t.cssClasses.OPEN),this.dimensions=this.adapter.getInnerDimensions(),this.autoposition(),this.adapter.notifyOpen()):(this.adapter.addClass(t.cssClasses.ANIMATING_OPEN),this.animationRequestId=requestAnimationFrame(function(){e.adapter.addClass(t.cssClasses.OPEN),e.dimensions=e.adapter.getInnerDimensions(),e.autoposition(),e.openAnimationEndTimerId=setTimeout(function(){e.openAnimationEndTimerId=0,e.adapter.removeClass(t.cssClasses.ANIMATING_OPEN),e.adapter.notifyOpen()},rK.TRANSITION_OPEN_DURATION)}),this.isSurfaceOpen=!0))},t.prototype.close=function(e){var n=this;void 0===e&&(e=!1),this.isSurfaceOpen&&(this.isQuickOpen?(this.isSurfaceOpen=!1,e||this.maybeRestoreFocus(),this.adapter.removeClass(t.cssClasses.OPEN),this.adapter.removeClass(t.cssClasses.IS_OPEN_BELOW),this.adapter.notifyClose()):(this.adapter.addClass(t.cssClasses.ANIMATING_CLOSED),requestAnimationFrame(function(){n.adapter.removeClass(t.cssClasses.OPEN),n.adapter.removeClass(t.cssClasses.IS_OPEN_BELOW),n.closeAnimationEndTimerId=setTimeout(function(){n.closeAnimationEndTimerId=0,n.adapter.removeClass(t.cssClasses.ANIMATING_CLOSED),n.adapter.notifyClose()},rK.TRANSITION_CLOSE_DURATION)}),this.isSurfaceOpen=!1,e||this.maybeRestoreFocus()))},t.prototype.handleBodyClick=function(e){var t=e.target;this.adapter.isElementInContainer(t)||this.close()},t.prototype.handleKeydown=function(e){var t=e.keyCode;("Escape"===e.key||27===t)&&this.close()},t.prototype.autoposition=function(){this.measurements=this.getAutoLayoutmeasurements();var e,n=this.getoriginCorner(),i=this.getMenuSurfaceMaxHeight(n),r=this.hasBit(n,sH.BOTTOM)?"bottom":"top",o=this.hasBit(n,sH.RIGHT)?"right":"left",a=this.getHorizontalOriginOffset(n),s=this.getVerticalOriginOffset(n),l=this.measurements,c=l.anchorSize,d=l.surfaceSize,u=((e={})[o]=a,e[r]=s,e);c.width/d.width>rK.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(o="center"),(this.isHoistedElement||this.isFixedPosition)&&this.adjustPositionForHoistedElement(u),this.adapter.setTransformOrigin(o+" "+r),this.adapter.setPosition(u),this.adapter.setMaxHeight(i?i+"px":""),this.hasBit(n,sH.BOTTOM)||this.adapter.addClass(t.cssClasses.IS_OPEN_BELOW)},t.prototype.getAutoLayoutmeasurements=function(){var e=this.adapter.getAnchorDimensions(),t=this.adapter.getBodyDimensions(),n=this.adapter.getWindowDimensions(),i=this.adapter.getWindowScroll();return e||(e={top:this.position.y,right:this.position.x,bottom:this.position.y,left:this.position.x,width:0,height:0}),{anchorSize:e,bodySize:t,surfaceSize:this.dimensions,viewportDistance:{top:e.top,right:n.width-e.right,bottom:n.height-e.bottom,left:e.left},viewportSize:n,windowScroll:i}},t.prototype.getoriginCorner=function(){var e,n,i,r,o=this.originCorner,a=this.measurements,s=a.viewportDistance,l=a.anchorSize,c=a.surfaceSize,d=t.numbers.MARGIN_TO_EDGE;this.hasBit(this.anchorCorner,sH.BOTTOM)?(e=s.top-d+l.height+this.anchorMargin.bottom,n=s.bottom-d-this.anchorMargin.bottom):(e=s.top-d+this.anchorMargin.top,n=s.bottom-d+l.height-this.anchorMargin.top),!(n-c.height>0)&&e>=n&&(o=this.setBit(o,sH.BOTTOM));var u=this.adapter.isRtl(),h=this.hasBit(this.anchorCorner,sH.FLIP_RTL),m=this.hasBit(this.anchorCorner,sH.RIGHT)||this.hasBit(o,sH.RIGHT),f=!1;(f=u&&h?!m:m)?(i=s.left+l.width+this.anchorMargin.right,r=s.right-this.anchorMargin.right):(i=s.left+this.anchorMargin.left,r=s.right+l.width-this.anchorMargin.left);var p=i-c.width>0,g=r-c.width>0,b=this.hasBit(o,sH.FLIP_RTL)&&this.hasBit(o,sH.RIGHT);return g&&b&&u||!p&&b?o=this.unsetBit(o,sH.RIGHT):(p&&f&&u||p&&!f&&m||!g&&i>=r)&&(o=this.setBit(o,sH.RIGHT)),o},t.prototype.getMenuSurfaceMaxHeight=function(e){var n=this.measurements.viewportDistance,i=0,r=this.hasBit(e,sH.BOTTOM),o=this.hasBit(this.anchorCorner,sH.BOTTOM),a=t.numbers.MARGIN_TO_EDGE;return r?(i=n.top+this.anchorMargin.top-a,o||(i+=this.measurements.anchorSize.height)):(i=n.bottom-this.anchorMargin.bottom+this.measurements.anchorSize.height-a,o&&(i-=this.measurements.anchorSize.height)),i},t.prototype.getHorizontalOriginOffset=function(e){var t=this.measurements.anchorSize,n=this.hasBit(e,sH.RIGHT),i=this.hasBit(this.anchorCorner,sH.RIGHT);if(n){var r=i?t.width-this.anchorMargin.left:this.anchorMargin.right;return this.isHoistedElement||this.isFixedPosition?r-(this.measurements.viewportSize.width-this.measurements.bodySize.width):r}return i?t.width-this.anchorMargin.right:this.anchorMargin.left},t.prototype.getVerticalOriginOffset=function(e){var t=this.measurements.anchorSize,n=this.hasBit(e,sH.BOTTOM),i=this.hasBit(this.anchorCorner,sH.BOTTOM);return n?i?t.height-this.anchorMargin.top:-this.anchorMargin.bottom:i?t.height+this.anchorMargin.bottom:this.anchorMargin.top},t.prototype.adjustPositionForHoistedElement=function(e){var t,n,i=this.measurements,r=i.windowScroll,o=i.viewportDistance,a=Object.keys(e);try{for(var s=iz(a),l=s.next();!l.done;l=s.next()){var c=l.value,d=e[c]||0;d+=o[c],this.isFixedPosition||("top"===c?d+=r.y:"bottom"===c?d-=r.y:"left"===c?d+=r.x:d-=r.x),e[c]=d}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}},t.prototype.maybeRestoreFocus=function(){var e=this.adapter.isFocused(),t=document.activeElement&&this.adapter.isElementInContainer(document.activeElement);(e||t)&&this.adapter.restoreFocus()},t.prototype.hasBit=function(e,t){return!!(e&t)},t.prototype.setBit=function(e,t){return e|t},t.prototype.unsetBit=function(e,t){return e^t},t.prototype.isFinite=function(e){return"number"==typeof e&&isFinite(e)},t}(iY),or=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iN(t,e),t.attachTo=function(e){return new t(e)},t.prototype.initialSyncWithDOM=function(){var e=this,t=this.root.parentElement;this.anchorElement=t&&t.classList.contains(rG.ANCHOR)?t:null,this.root.classList.contains(rG.FIXED)&&this.setFixedPosition(!0),this.handleKeydown=function(t){e.foundation.handleKeydown(t)},this.handleBodyClick=function(t){e.foundation.handleBodyClick(t)},this.registerBodyClickListener=function(){document.body.addEventListener("click",e.handleBodyClick,{capture:!0})},this.deregisterBodyClickListener=function(){document.body.removeEventListener("click",e.handleBodyClick,{capture:!0})},this.listen("keydown",this.handleKeydown),this.listen(rq.OPENED_EVENT,this.registerBodyClickListener),this.listen(rq.CLOSED_EVENT,this.deregisterBodyClickListener)},t.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten(rq.OPENED_EVENT,this.registerBodyClickListener),this.unlisten(rq.CLOSED_EVENT,this.deregisterBodyClickListener),e.prototype.destroy.call(this)},t.prototype.isOpen=function(){return this.foundation.isOpen()},t.prototype.open=function(){this.foundation.open()},t.prototype.close=function(e){void 0===e&&(e=!1),this.foundation.close(e)},Object.defineProperty(t.prototype,"quickOpen",{set:function(e){this.foundation.setQuickOpen(e)},enumerable:!0,configurable:!0}),t.prototype.setIsHoisted=function(e){this.foundation.setIsHoisted(e)},t.prototype.setMenuSurfaceAnchorElement=function(e){this.anchorElement=e},t.prototype.setFixedPosition=function(e){e?this.root.classList.add(rG.FIXED):this.root.classList.remove(rG.FIXED),this.foundation.setFixedPosition(e)},t.prototype.setAbsolutePosition=function(e,t){this.foundation.setAbsolutePosition(e,t),this.setIsHoisted(!0)},t.prototype.setAnchorCorner=function(e){this.foundation.setAnchorCorner(e)},t.prototype.setAnchorMargin=function(e){this.foundation.setAnchorMargin(e)},t.prototype.getDefaultFoundation=function(){var e=this;return new oi({addClass:function(t){return e.root.classList.add(t)},removeClass:function(t){return e.root.classList.remove(t)},hasClass:function(t){return e.root.classList.contains(t)},hasAnchor:function(){return!!e.anchorElement},notifyClose:function(){return e.emit(oi.strings.CLOSED_EVENT,{})},notifyOpen:function(){return e.emit(oi.strings.OPENED_EVENT,{})},isElementInContainer:function(t){return e.root.contains(t)},isRtl:function(){return"rtl"===getComputedStyle(e.root).getPropertyValue("direction")},setTransformOrigin:function(t){var n,i,r=(n=window,void 0===i&&(i=!1),(void 0===sV||i)&&(sV="transform"in n.document.createElement("div").style?"transform":"webkitTransform"),sV+"-origin");e.root.style.setProperty(r,t)},isFocused:function(){return document.activeElement===e.root},saveFocus:function(){e.previousFocus=document.activeElement},restoreFocus:function(){e.root.contains(document.activeElement)&&e.previousFocus&&e.previousFocus.focus&&e.previousFocus.focus()},getInnerDimensions:function(){return{width:e.root.offsetWidth,height:e.root.offsetHeight}},getAnchorDimensions:function(){return e.anchorElement?e.anchorElement.getBoundingClientRect():null},getWindowDimensions:function(){return{width:window.innerWidth,height:window.innerHeight}},getBodyDimensions:function(){return{width:document.body.clientWidth,height:document.body.clientHeight}},getWindowScroll:function(){return{x:window.pageXOffset,y:window.pageYOffset}},setPosition:function(t){var n=e.root;n.style.left="left"in t?t.left+"px":"",n.style.right="right"in t?t.right+"px":"",n.style.top="top"in t?t.top+"px":"",n.style.bottom="bottom"in t?t.bottom+"px":""},setMaxHeight:function(t){e.root.style.maxHeight=t}})},t}(iH),oo={MENU_SELECTED_LIST_ITEM:"mdc-menu-item--selected",MENU_SELECTION_GROUP:"mdc-menu__selection-group",ROOT:"mdc-menu"},oa={ARIA_CHECKED_ATTR:"aria-checked",ARIA_DISABLED_ATTR:"aria-disabled",CHECKBOX_SELECTOR:'input[type="checkbox"]',LIST_SELECTOR:".mdc-list",SELECTED_EVENT:"MDCMenu:selected"},os={FOCUS_ROOT_INDEX:-1};!function(e){e[e.NONE=0]="NONE",e[e.LIST_ROOT=1]="LIST_ROOT",e[e.FIRST_ITEM=2]="FIRST_ITEM",e[e.LAST_ITEM=3]="LAST_ITEM"}(sW||(sW={}));var ol=function(e){function t(n){var i=e.call(this,iB(iB({},t.defaultAdapter),n))||this;return i.closeAnimationEndTimerId_=0,i.defaultFocusState_=sW.LIST_ROOT,i}return iN(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return oo},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return oa},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return os},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClassToElementAtIndex:function(){},removeClassFromElementAtIndex:function(){},addAttributeToElementAtIndex:function(){},removeAttributeFromElementAtIndex:function(){},elementContainsClass:function(){return!1},closeSurface:function(){},getElementIndex:function(){return -1},notifySelected:function(){},getMenuItemCount:function(){return 0},focusItemAtIndex:function(){},focusListRoot:function(){},getSelectedSiblingOfItemAtIndex:function(){return -1},isSelectableItemAtIndex:function(){return!1}}},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){this.closeAnimationEndTimerId_&&clearTimeout(this.closeAnimationEndTimerId_),this.adapter.closeSurface()},t.prototype.handleKeydown=function(e){var t=e.key,n=e.keyCode;("Tab"===t||9===n)&&this.adapter.closeSurface(!0)},t.prototype.handleItemAction=function(e){var t=this,n=this.adapter.getElementIndex(e);n<0||(this.adapter.notifySelected({index:n}),this.adapter.closeSurface(),this.closeAnimationEndTimerId_=setTimeout(function(){var n=t.adapter.getElementIndex(e);n>=0&&t.adapter.isSelectableItemAtIndex(n)&&t.setSelectedIndex(n)},oi.numbers.TRANSITION_CLOSE_DURATION))},t.prototype.handleMenuSurfaceOpened=function(){switch(this.defaultFocusState_){case sW.FIRST_ITEM:this.adapter.focusItemAtIndex(0);break;case sW.LAST_ITEM:this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount()-1);break;case sW.NONE:break;default:this.adapter.focusListRoot()}},t.prototype.setDefaultFocusState=function(e){this.defaultFocusState_=e},t.prototype.setSelectedIndex=function(e){if(this.validatedIndex_(e),!this.adapter.isSelectableItemAtIndex(e))throw Error("MDCMenuFoundation: No selection group at specified index.");var t=this.adapter.getSelectedSiblingOfItemAtIndex(e);t>=0&&(this.adapter.removeAttributeFromElementAtIndex(t,oa.ARIA_CHECKED_ATTR),this.adapter.removeClassFromElementAtIndex(t,oo.MENU_SELECTED_LIST_ITEM)),this.adapter.addClassToElementAtIndex(e,oo.MENU_SELECTED_LIST_ITEM),this.adapter.addAttributeToElementAtIndex(e,oa.ARIA_CHECKED_ATTR,"true")},t.prototype.setEnabled=function(e,t){this.validatedIndex_(e),t?(this.adapter.removeClassFromElementAtIndex(e,rX.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(e,oa.ARIA_DISABLED_ATTR,"false")):(this.adapter.addClassToElementAtIndex(e,rX.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(e,oa.ARIA_DISABLED_ATTR,"true"))},t.prototype.validatedIndex_=function(e){var t=this.adapter.getMenuItemCount();if(!(e>=0&&e<t))throw Error("MDCMenuFoundation: No list item at specified index.")},t}(iY),oc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iN(t,e),t.attachTo=function(e){return new t(e)},t.prototype.initialize=function(e,t){void 0===e&&(e=function(e){return new or(e)}),void 0===t&&(t=function(e){return new on(e)}),this.menuSurfaceFactory_=e,this.listFactory_=t},t.prototype.initialSyncWithDOM=function(){var e=this;this.menuSurface_=this.menuSurfaceFactory_(this.root);var t=this.root.querySelector(oa.LIST_SELECTOR);t?(this.list_=this.listFactory_(t),this.list_.wrapFocus=!0):this.list_=null,this.handleKeydown_=function(t){return e.foundation.handleKeydown(t)},this.handleItemAction_=function(t){return e.foundation.handleItemAction(e.items[t.detail.index])},this.handleMenuSurfaceOpened_=function(){return e.foundation.handleMenuSurfaceOpened()},this.menuSurface_.listen(oi.strings.OPENED_EVENT,this.handleMenuSurfaceOpened_),this.listen("keydown",this.handleKeydown_),this.listen(ot.strings.ACTION_EVENT,this.handleItemAction_)},t.prototype.destroy=function(){this.list_&&this.list_.destroy(),this.menuSurface_.destroy(),this.menuSurface_.unlisten(oi.strings.OPENED_EVENT,this.handleMenuSurfaceOpened_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(ot.strings.ACTION_EVENT,this.handleItemAction_),e.prototype.destroy.call(this)},Object.defineProperty(t.prototype,"open",{get:function(){return this.menuSurface_.isOpen()},set:function(e){e?this.menuSurface_.open():this.menuSurface_.close()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"wrapFocus",{get:function(){return!!this.list_&&this.list_.wrapFocus},set:function(e){this.list_&&(this.list_.wrapFocus=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasTypeahead",{set:function(e){this.list_&&(this.list_.hasTypeahead=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"typeaheadInProgress",{get:function(){return!!this.list_&&this.list_.typeaheadInProgress},enumerable:!0,configurable:!0}),t.prototype.typeaheadMatchItem=function(e,t){return this.list_?this.list_.typeaheadMatchItem(e,t):-1},t.prototype.layout=function(){this.list_&&this.list_.layout()},Object.defineProperty(t.prototype,"items",{get:function(){return this.list_?this.list_.listElements:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"singleSelection",{set:function(e){this.list_&&(this.list_.singleSelection=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectedIndex",{get:function(){return this.list_?this.list_.selectedIndex:rJ.UNSET_INDEX},set:function(e){this.list_&&(this.list_.selectedIndex=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"quickOpen",{set:function(e){this.menuSurface_.quickOpen=e},enumerable:!0,configurable:!0}),t.prototype.setDefaultFocusState=function(e){this.foundation.setDefaultFocusState(e)},t.prototype.setAnchorCorner=function(e){this.menuSurface_.setAnchorCorner(e)},t.prototype.setAnchorMargin=function(e){this.menuSurface_.setAnchorMargin(e)},t.prototype.setSelectedIndex=function(e){this.foundation.setSelectedIndex(e)},t.prototype.setEnabled=function(e,t){this.foundation.setEnabled(e,t)},t.prototype.getOptionByIndex=function(e){return e<this.items.length?this.items[e]:null},t.prototype.getPrimaryTextAtIndex=function(e){var t=this.getOptionByIndex(e);return t&&this.list_&&this.list_.getPrimaryText(t)||""},t.prototype.setFixedPosition=function(e){this.menuSurface_.setFixedPosition(e)},t.prototype.setIsHoisted=function(e){this.menuSurface_.setIsHoisted(e)},t.prototype.setAbsolutePosition=function(e,t){this.menuSurface_.setAbsolutePosition(e,t)},t.prototype.setAnchorElement=function(e){this.menuSurface_.anchorElement=e},t.prototype.getDefaultFoundation=function(){var e=this;return new ol({addClassToElementAtIndex:function(t,n){e.items[t].classList.add(n)},removeClassFromElementAtIndex:function(t,n){e.items[t].classList.remove(n)},addAttributeToElementAtIndex:function(t,n,i){e.items[t].setAttribute(n,i)},removeAttributeFromElementAtIndex:function(t,n){e.items[t].removeAttribute(n)},elementContainsClass:function(e,t){return e.classList.contains(t)},closeSurface:function(t){return e.menuSurface_.close(t)},getElementIndex:function(t){return e.items.indexOf(t)},notifySelected:function(t){return e.emit(oa.SELECTED_EVENT,{index:t.index,item:e.items[t.index]})},getMenuItemCount:function(){return e.items.length},focusItemAtIndex:function(t){return e.items[t].focus()},focusListRoot:function(){return e.root.querySelector(oa.LIST_SELECTOR).focus()},isSelectableItemAtIndex:function(t){return!!iV(e.items[t],"."+oo.MENU_SELECTION_GROUP)},getSelectedSiblingOfItemAtIndex:function(t){var n=iV(e.items[t],"."+oo.MENU_SELECTION_GROUP).querySelector("."+oo.MENU_SELECTED_LIST_ITEM);return n?e.items.indexOf(n):-1}})},t}(iH),od={ACTIVATED:"mdc-select--activated",DISABLED:"mdc-select--disabled",FOCUSED:"mdc-select--focused",INVALID:"mdc-select--invalid",MENU_INVALID:"mdc-select__menu--invalid",OUTLINED:"mdc-select--outlined",REQUIRED:"mdc-select--required",ROOT:"mdc-select",WITH_LEADING_ICON:"mdc-select--with-leading-icon"},ou={ARIA_CONTROLS:"aria-controls",ARIA_DESCRIBEDBY:"aria-describedby",ARIA_SELECTED_ATTR:"aria-selected",CHANGE_EVENT:"MDCSelect:change",HIDDEN_INPUT_SELECTOR:'input[type="hidden"]',LABEL_SELECTOR:".mdc-floating-label",LEADING_ICON_SELECTOR:".mdc-select__icon",LINE_RIPPLE_SELECTOR:".mdc-line-ripple",MENU_SELECTOR:".mdc-select__menu",OUTLINE_SELECTOR:".mdc-notched-outline",SELECTED_TEXT_SELECTOR:".mdc-select__selected-text",SELECT_ANCHOR_SELECTOR:".mdc-select__anchor",VALUE_ATTR:"data-value"},oh={LABEL_SCALE:.75,UNSET_INDEX:-1,CLICK_DEBOUNCE_TIMEOUT_MS:330},om=function(e){function t(n,i){void 0===i&&(i={});var r=e.call(this,iB(iB({},t.defaultAdapter),n))||this;return r.disabled=!1,r.isMenuOpen=!1,r.useDefaultValidation=!0,r.customValidity=!0,r.lastSelectedIndex=oh.UNSET_INDEX,r.clickDebounceTimeout=0,r.recentlyClicked=!1,r.leadingIcon=i.leadingIcon,r.helperText=i.helperText,r}return iN(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return od},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return oh},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return ou},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},activateBottomLine:function(){},deactivateBottomLine:function(){},getSelectedIndex:function(){return -1},setSelectedIndex:function(){},hasLabel:function(){return!1},floatLabel:function(){},getLabelWidth:function(){return 0},setLabelRequired:function(){},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){},setRippleCenter:function(){},notifyChange:function(){},setSelectedText:function(){},isSelectAnchorFocused:function(){return!1},getSelectAnchorAttr:function(){return""},setSelectAnchorAttr:function(){},removeSelectAnchorAttr:function(){},addMenuClass:function(){},removeMenuClass:function(){},openMenu:function(){},closeMenu:function(){},getAnchorElement:function(){return null},setMenuAnchorElement:function(){},setMenuAnchorCorner:function(){},setMenuWrapFocus:function(){},focusMenuItemAtIndex:function(){},getMenuItemCount:function(){return 0},getMenuItemValues:function(){return[]},getMenuItemTextAtIndex:function(){return""},isTypeaheadInProgress:function(){return!1},typeaheadMatchItem:function(){return -1}}},enumerable:!0,configurable:!0}),t.prototype.getSelectedIndex=function(){return this.adapter.getSelectedIndex()},t.prototype.setSelectedIndex=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1),e>=this.adapter.getMenuItemCount()||(e===oh.UNSET_INDEX?this.adapter.setSelectedText(""):this.adapter.setSelectedText(this.adapter.getMenuItemTextAtIndex(e).trim()),this.adapter.setSelectedIndex(e),t&&this.adapter.closeMenu(),n||this.lastSelectedIndex===e||this.handleChange(),this.lastSelectedIndex=e)},t.prototype.setValue=function(e,t){void 0===t&&(t=!1);var n=this.adapter.getMenuItemValues().indexOf(e);this.setSelectedIndex(n,!1,t)},t.prototype.getValue=function(){var e=this.adapter.getSelectedIndex(),t=this.adapter.getMenuItemValues();return e!==oh.UNSET_INDEX?t[e]:""},t.prototype.getDisabled=function(){return this.disabled},t.prototype.setDisabled=function(e){this.disabled=e,this.disabled?(this.adapter.addClass(od.DISABLED),this.adapter.closeMenu()):this.adapter.removeClass(od.DISABLED),this.leadingIcon&&this.leadingIcon.setDisabled(this.disabled),this.disabled?this.adapter.removeSelectAnchorAttr("tabindex"):this.adapter.setSelectAnchorAttr("tabindex","0"),this.adapter.setSelectAnchorAttr("aria-disabled",this.disabled.toString())},t.prototype.openMenu=function(){this.adapter.addClass(od.ACTIVATED),this.adapter.openMenu(),this.isMenuOpen=!0,this.adapter.setSelectAnchorAttr("aria-expanded","true")},t.prototype.setHelperTextContent=function(e){this.helperText&&this.helperText.setContent(e)},t.prototype.layout=function(){if(this.adapter.hasLabel()){var e=this.getValue().length>0,t=this.adapter.hasClass(od.FOCUSED),n=e||t,i=this.adapter.hasClass(od.REQUIRED);this.notchOutline(n),this.adapter.floatLabel(n),this.adapter.setLabelRequired(i)}},t.prototype.layoutOptions=function(){var e=this.adapter.getMenuItemValues().indexOf(this.getValue());this.setSelectedIndex(e,!1,!0)},t.prototype.handleMenuOpened=function(){if(0!==this.adapter.getMenuItemValues().length){var e=this.getSelectedIndex();this.adapter.focusMenuItemAtIndex(e>=0?e:0)}},t.prototype.handleMenuClosed=function(){this.adapter.removeClass(od.ACTIVATED),this.isMenuOpen=!1,this.adapter.setSelectAnchorAttr("aria-expanded","false"),this.adapter.isSelectAnchorFocused()||this.blur()},t.prototype.handleChange=function(){this.layout(),this.adapter.notifyChange(this.getValue()),this.adapter.hasClass(od.REQUIRED)&&this.useDefaultValidation&&this.setValid(this.isValid())},t.prototype.handleMenuItemAction=function(e){this.setSelectedIndex(e,!0)},t.prototype.handleFocus=function(){this.adapter.addClass(od.FOCUSED),this.layout(),this.adapter.activateBottomLine()},t.prototype.handleBlur=function(){this.isMenuOpen||this.blur()},t.prototype.handleClick=function(e){if(!this.disabled&&!this.recentlyClicked){if(this.setClickDebounceTimeout(),this.isMenuOpen)return void this.adapter.closeMenu();this.adapter.setRippleCenter(e),this.openMenu()}},t.prototype.handleKeydown=function(e){if(!this.isMenuOpen&&this.adapter.hasClass(od.FOCUSED)){var t=r3(e)===rQ.ENTER,n=r3(e)===rQ.SPACEBAR,i=r3(e)===rQ.ARROW_UP,r=r3(e)===rQ.ARROW_DOWN;if(!n&&e.key&&1===e.key.length||n&&this.adapter.isTypeaheadInProgress()){var o=n?" ":e.key,a=this.adapter.typeaheadMatchItem(o,this.getSelectedIndex());a>=0&&this.setSelectedIndex(a),e.preventDefault();return}(t||n||i||r)&&(i&&this.getSelectedIndex()>0?this.setSelectedIndex(this.getSelectedIndex()-1):r&&this.getSelectedIndex()<this.adapter.getMenuItemCount()-1&&this.setSelectedIndex(this.getSelectedIndex()+1),this.openMenu(),e.preventDefault())}},t.prototype.notchOutline=function(e){if(this.adapter.hasOutline()){var t=this.adapter.hasClass(od.FOCUSED);if(e){var n=oh.LABEL_SCALE,i=this.adapter.getLabelWidth()*n;this.adapter.notchOutline(i)}else t||this.adapter.closeOutline()}},t.prototype.setLeadingIconAriaLabel=function(e){this.leadingIcon&&this.leadingIcon.setAriaLabel(e)},t.prototype.setLeadingIconContent=function(e){this.leadingIcon&&this.leadingIcon.setContent(e)},t.prototype.setUseDefaultValidation=function(e){this.useDefaultValidation=e},t.prototype.setValid=function(e){this.useDefaultValidation||(this.customValidity=e),this.adapter.setSelectAnchorAttr("aria-invalid",(!e).toString()),e?(this.adapter.removeClass(od.INVALID),this.adapter.removeMenuClass(od.MENU_INVALID)):(this.adapter.addClass(od.INVALID),this.adapter.addMenuClass(od.MENU_INVALID)),this.syncHelperTextValidity(e)},t.prototype.isValid=function(){return this.useDefaultValidation&&this.adapter.hasClass(od.REQUIRED)&&!this.adapter.hasClass(od.DISABLED)?this.getSelectedIndex()!==oh.UNSET_INDEX&&(0!==this.getSelectedIndex()||!!this.getValue()):this.customValidity},t.prototype.setRequired=function(e){e?this.adapter.addClass(od.REQUIRED):this.adapter.removeClass(od.REQUIRED),this.adapter.setSelectAnchorAttr("aria-required",e.toString()),this.adapter.setLabelRequired(e)},t.prototype.getRequired=function(){return"true"===this.adapter.getSelectAnchorAttr("aria-required")},t.prototype.init=function(){var e=this.adapter.getAnchorElement();e&&(this.adapter.setMenuAnchorElement(e),this.adapter.setMenuAnchorCorner(sU.BOTTOM_START)),this.adapter.setMenuWrapFocus(!1),this.setDisabled(this.adapter.hasClass(od.DISABLED)),this.syncHelperTextValidity(!this.adapter.hasClass(od.INVALID)),this.layout(),this.layoutOptions()},t.prototype.blur=function(){this.adapter.removeClass(od.FOCUSED),this.layout(),this.adapter.deactivateBottomLine(),this.adapter.hasClass(od.REQUIRED)&&this.useDefaultValidation&&this.setValid(this.isValid())},t.prototype.syncHelperTextValidity=function(e){if(this.helperText){this.helperText.setValidity(e);var t=this.helperText.isVisible(),n=this.helperText.getId();t&&n?this.adapter.setSelectAnchorAttr(ou.ARIA_DESCRIBEDBY,n):this.adapter.removeSelectAnchorAttr(ou.ARIA_DESCRIBEDBY)}},t.prototype.setClickDebounceTimeout=function(){var e=this;clearTimeout(this.clickDebounceTimeout),this.clickDebounceTimeout=setTimeout(function(){e.recentlyClicked=!1},oh.CLICK_DEBOUNCE_TIMEOUT_MS),this.recentlyClicked=!0},t}(iY),of={ARIA_HIDDEN:"aria-hidden",ROLE:"role"},op={HELPER_TEXT_VALIDATION_MSG:"mdc-select-helper-text--validation-msg",HELPER_TEXT_VALIDATION_MSG_PERSISTENT:"mdc-select-helper-text--validation-msg-persistent"},og=function(e){function t(n){return e.call(this,iB(iB({},t.defaultAdapter),n))||this}return iN(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return op},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return of},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setAttr:function(){},getAttr:function(){return null},removeAttr:function(){},setContent:function(){}}},enumerable:!0,configurable:!0}),t.prototype.getId=function(){return this.adapter.getAttr("id")},t.prototype.isVisible=function(){return"true"!==this.adapter.getAttr(of.ARIA_HIDDEN)},t.prototype.setContent=function(e){this.adapter.setContent(e)},t.prototype.setValidation=function(e){e?this.adapter.addClass(op.HELPER_TEXT_VALIDATION_MSG):this.adapter.removeClass(op.HELPER_TEXT_VALIDATION_MSG)},t.prototype.setValidationMsgPersistent=function(e){e?this.adapter.addClass(op.HELPER_TEXT_VALIDATION_MSG_PERSISTENT):this.adapter.removeClass(op.HELPER_TEXT_VALIDATION_MSG_PERSISTENT)},t.prototype.setValidity=function(e){if(this.adapter.hasClass(op.HELPER_TEXT_VALIDATION_MSG)){var t=this.adapter.hasClass(op.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);if(!e||t){this.showToScreenReader(),e?this.adapter.removeAttr(of.ROLE):this.adapter.setAttr(of.ROLE,"alert");return}this.adapter.removeAttr(of.ROLE),this.hide()}},t.prototype.showToScreenReader=function(){this.adapter.removeAttr(of.ARIA_HIDDEN)},t.prototype.hide=function(){this.adapter.setAttr(of.ARIA_HIDDEN,"true")},t}(iY),ob=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iN(t,e),t.attachTo=function(e){return new t(e)},Object.defineProperty(t.prototype,"foundationForSelect",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),t.prototype.getDefaultFoundation=function(){var e=this;return new og({addClass:function(t){return e.root.classList.add(t)},removeClass:function(t){return e.root.classList.remove(t)},hasClass:function(t){return e.root.classList.contains(t)},getAttr:function(t){return e.root.getAttribute(t)},setAttr:function(t,n){return e.root.setAttribute(t,n)},removeAttr:function(t){return e.root.removeAttribute(t)},setContent:function(t){e.root.textContent=t}})},t}(iH),o_={ICON_EVENT:"MDCSelect:icon",ICON_ROLE:"button"},oy=["click","keydown"],ov=function(e){function t(n){var i=e.call(this,iB(iB({},t.defaultAdapter),n))||this;return i.savedTabIndex_=null,i.interactionHandler_=function(e){return i.handleInteraction(e)},i}return iN(t,e),Object.defineProperty(t,"strings",{get:function(){return o_},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},notifyIconAction:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){var e=this;this.savedTabIndex_=this.adapter.getAttr("tabindex"),oy.forEach(function(t){e.adapter.registerInteractionHandler(t,e.interactionHandler_)})},t.prototype.destroy=function(){var e=this;oy.forEach(function(t){e.adapter.deregisterInteractionHandler(t,e.interactionHandler_)})},t.prototype.setDisabled=function(e){this.savedTabIndex_&&(e?(this.adapter.setAttr("tabindex","-1"),this.adapter.removeAttr("role")):(this.adapter.setAttr("tabindex",this.savedTabIndex_),this.adapter.setAttr("role",o_.ICON_ROLE)))},t.prototype.setAriaLabel=function(e){this.adapter.setAttr("aria-label",e)},t.prototype.setContent=function(e){this.adapter.setContent(e)},t.prototype.handleInteraction=function(e){var t="Enter"===e.key||13===e.keyCode;("click"===e.type||t)&&this.adapter.notifyIconAction()},t}(iY),ox=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iN(t,e),t.attachTo=function(e){return new t(e)},Object.defineProperty(t.prototype,"foundationForSelect",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),t.prototype.getDefaultFoundation=function(){var e=this;return new ov({getAttr:function(t){return e.root.getAttribute(t)},setAttr:function(t,n){return e.root.setAttribute(t,n)},removeAttr:function(t){return e.root.removeAttribute(t)},setContent:function(t){e.root.textContent=t},registerInteractionHandler:function(t,n){return e.listen(t,n)},deregisterInteractionHandler:function(t,n){return e.unlisten(t,n)},notifyIconAction:function(){return e.emit(ov.strings.ICON_EVENT,{},!0)}})},t}(iH),ow=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iN(t,e),t.attachTo=function(e){return new t(e)},t.prototype.initialize=function(e,t,n,i,r,o){if(void 0===e&&(e=function(e){return new iK(e)}),void 0===t&&(t=function(e){return new iJ(e)}),void 0===n&&(n=function(e){return new i5(e)}),void 0===i&&(i=function(e){return new oc(e)}),void 0===r&&(r=function(e){return new ox(e)}),void 0===o&&(o=function(e){return new ob(e)}),this.selectAnchor=this.root.querySelector(ou.SELECT_ANCHOR_SELECTOR),this.selectedText=this.root.querySelector(ou.SELECTED_TEXT_SELECTOR),this.hiddenInput=this.root.querySelector(ou.HIDDEN_INPUT_SELECTOR),!this.selectedText)throw Error("MDCSelect: Missing required element: The following selector must be present: '"+ou.SELECTED_TEXT_SELECTOR+"'");if(this.selectAnchor.hasAttribute(ou.ARIA_CONTROLS)){var a=document.getElementById(this.selectAnchor.getAttribute(ou.ARIA_CONTROLS));a&&(this.helperText=o(a))}this.menuSetup(i);var s=this.root.querySelector(ou.LABEL_SELECTOR);this.label=s?e(s):null;var l=this.root.querySelector(ou.LINE_RIPPLE_SELECTOR);this.lineRipple=l?t(l):null;var c=this.root.querySelector(ou.OUTLINE_SELECTOR);this.outline=c?n(c):null;var d=this.root.querySelector(ou.LEADING_ICON_SELECTOR);d&&(this.leadingIcon=r(d)),this.root.classList.contains(od.OUTLINED)||(this.ripple=this.createRipple())},t.prototype.initialSyncWithDOM=function(){var e=this;if(this.handleFocus=function(){e.foundation.handleFocus()},this.handleBlur=function(){e.foundation.handleBlur()},this.handleClick=function(t){e.selectAnchor.focus(),e.foundation.handleClick(e.getNormalizedXCoordinate(t))},this.handleKeydown=function(t){e.foundation.handleKeydown(t)},this.handleMenuItemAction=function(t){e.foundation.handleMenuItemAction(t.detail.index)},this.handleMenuOpened=function(){e.foundation.handleMenuOpened()},this.handleMenuClosed=function(){e.foundation.handleMenuClosed()},this.selectAnchor.addEventListener("focus",this.handleFocus),this.selectAnchor.addEventListener("blur",this.handleBlur),this.selectAnchor.addEventListener("click",this.handleClick),this.selectAnchor.addEventListener("keydown",this.handleKeydown),this.menu.listen(rq.CLOSED_EVENT,this.handleMenuClosed),this.menu.listen(rq.OPENED_EVENT,this.handleMenuOpened),this.menu.listen(oa.SELECTED_EVENT,this.handleMenuItemAction),this.hiddenInput){if(this.hiddenInput.value){this.foundation.setValue(this.hiddenInput.value,!0),this.foundation.layout();return}this.hiddenInput.value=this.value}},t.prototype.destroy=function(){this.selectAnchor.removeEventListener("focus",this.handleFocus),this.selectAnchor.removeEventListener("blur",this.handleBlur),this.selectAnchor.removeEventListener("keydown",this.handleKeydown),this.selectAnchor.removeEventListener("click",this.handleClick),this.menu.unlisten(rq.CLOSED_EVENT,this.handleMenuClosed),this.menu.unlisten(rq.OPENED_EVENT,this.handleMenuOpened),this.menu.unlisten(oa.SELECTED_EVENT,this.handleMenuItemAction),this.menu.destroy(),this.ripple&&this.ripple.destroy(),this.outline&&this.outline.destroy(),this.leadingIcon&&this.leadingIcon.destroy(),this.helperText&&this.helperText.destroy(),e.prototype.destroy.call(this)},Object.defineProperty(t.prototype,"value",{get:function(){return this.foundation.getValue()},set:function(e){this.foundation.setValue(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(e){this.foundation.setSelectedIndex(e,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this.foundation.getDisabled()},set:function(e){this.foundation.setDisabled(e),this.hiddenInput&&(this.hiddenInput.disabled=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"leadingIconAriaLabel",{set:function(e){this.foundation.setLeadingIconAriaLabel(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"leadingIconContent",{set:function(e){this.foundation.setLeadingIconContent(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"helperTextContent",{set:function(e){this.foundation.setHelperTextContent(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useDefaultValidation",{set:function(e){this.foundation.setUseDefaultValidation(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valid",{get:function(){return this.foundation.isValid()},set:function(e){this.foundation.setValid(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"required",{get:function(){return this.foundation.getRequired()},set:function(e){this.foundation.setRequired(e)},enumerable:!0,configurable:!0}),t.prototype.layout=function(){this.foundation.layout()},t.prototype.layoutOptions=function(){this.foundation.layoutOptions(),this.menu.layout(),this.menuItemValues=this.menu.items.map(function(e){return e.getAttribute(ou.VALUE_ATTR)||""}),this.hiddenInput&&(this.hiddenInput.value=this.value)},t.prototype.getDefaultFoundation=function(){return new om(iB(iB(iB(iB({},this.getSelectAdapterMethods()),this.getCommonAdapterMethods()),this.getOutlineAdapterMethods()),this.getLabelAdapterMethods()),this.getFoundationMap())},t.prototype.menuSetup=function(e){this.menuElement=this.root.querySelector(ou.MENU_SELECTOR),this.menu=e(this.menuElement),this.menu.hasTypeahead=!0,this.menu.singleSelection=!0,this.menuItemValues=this.menu.items.map(function(e){return e.getAttribute(ou.VALUE_ATTR)||""})},t.prototype.createRipple=function(){var e=this,t=iB(iB({},rt.createAdapter({root:this.selectAnchor})),{registerInteractionHandler:function(t,n){e.selectAnchor.addEventListener(t,n)},deregisterInteractionHandler:function(t,n){e.selectAnchor.removeEventListener(t,n)}});return new rt(this.selectAnchor,new re(t))},t.prototype.getSelectAdapterMethods=function(){var e=this;return{getMenuItemAttr:function(e,t){return e.getAttribute(t)},setSelectedText:function(t){e.selectedText.textContent=t},isSelectAnchorFocused:function(){return document.activeElement===e.selectAnchor},getSelectAnchorAttr:function(t){return e.selectAnchor.getAttribute(t)},setSelectAnchorAttr:function(t,n){e.selectAnchor.setAttribute(t,n)},removeSelectAnchorAttr:function(t){e.selectAnchor.removeAttribute(t)},addMenuClass:function(t){e.menuElement.classList.add(t)},removeMenuClass:function(t){e.menuElement.classList.remove(t)},openMenu:function(){e.menu.open=!0},closeMenu:function(){e.menu.open=!1},getAnchorElement:function(){return e.root.querySelector(ou.SELECT_ANCHOR_SELECTOR)},setMenuAnchorElement:function(t){e.menu.setAnchorElement(t)},setMenuAnchorCorner:function(t){e.menu.setAnchorCorner(t)},setMenuWrapFocus:function(t){e.menu.wrapFocus=t},getSelectedIndex:function(){var t=e.menu.selectedIndex;return t instanceof Array?t[0]:t},setSelectedIndex:function(t){e.menu.selectedIndex=t},focusMenuItemAtIndex:function(t){e.menu.items[t].focus()},getMenuItemCount:function(){return e.menu.items.length},getMenuItemValues:function(){return e.menuItemValues},getMenuItemTextAtIndex:function(t){return e.menu.getPrimaryTextAtIndex(t)},isTypeaheadInProgress:function(){return e.menu.typeaheadInProgress},typeaheadMatchItem:function(t,n){return e.menu.typeaheadMatchItem(t,n)}}},t.prototype.getCommonAdapterMethods=function(){var e=this;return{addClass:function(t){e.root.classList.add(t)},removeClass:function(t){e.root.classList.remove(t)},hasClass:function(t){return e.root.classList.contains(t)},setRippleCenter:function(t){e.lineRipple&&e.lineRipple.setRippleCenter(t)},activateBottomLine:function(){e.lineRipple&&e.lineRipple.activate()},deactivateBottomLine:function(){e.lineRipple&&e.lineRipple.deactivate()},notifyChange:function(t){var n=e.selectedIndex;e.emit(ou.CHANGE_EVENT,{value:t,index:n},!0),e.hiddenInput&&(e.hiddenInput.value=t)}}},t.prototype.getOutlineAdapterMethods=function(){var e=this;return{hasOutline:function(){return!!e.outline},notchOutline:function(t){e.outline&&e.outline.notch(t)},closeOutline:function(){e.outline&&e.outline.closeNotch()}}},t.prototype.getLabelAdapterMethods=function(){var e=this;return{hasLabel:function(){return!!e.label},floatLabel:function(t){e.label&&e.label.float(t)},getLabelWidth:function(){return e.label?e.label.getWidth():0},setLabelRequired:function(t){e.label&&e.label.setRequired(t)}}},t.prototype.getNormalizedXCoordinate=function(e){var t=e.target.getBoundingClientRect();return(this.isTouchEvent(e)?e.touches[0].clientX:e.clientX)-t.left},t.prototype.isTouchEvent=function(e){return!!e.touches},t.prototype.getFoundationMap=function(){return{helperText:this.helperText?this.helperText.foundationForSelect:void 0,leadingIcon:this.leadingIcon?this.leadingIcon.foundationForSelect:void 0}},t}(iH),oF={ROOT:"mdc-form-field"},ok={LABEL_SELECTOR:".mdc-form-field > label"},oE=function(e){function t(n){var i=e.call(this,iB(iB({},t.defaultAdapter),n))||this;return i.click=function(){i.handleClick()},i}return iN(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return oF},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return ok},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{activateInputRipple:function(){},deactivateInputRipple:function(){},deregisterInteractionHandler:function(){},registerInteractionHandler:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){this.adapter.registerInteractionHandler("click",this.click)},t.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("click",this.click)},t.prototype.handleClick=function(){var e=this;this.adapter.activateInputRipple(),requestAnimationFrame(function(){e.adapter.deactivateInputRipple()})},t}(iY),oA=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iN(t,e),t.attachTo=function(e){return new t(e)},t.prototype.labelEl=function(){var e=oE.strings.LABEL_SELECTOR;return this.root.querySelector(e)},t.prototype.getDefaultFoundation=function(){var e=this;return new oE({activateInputRipple:function(){e.input&&e.input.ripple&&e.input.ripple.activate()},deactivateInputRipple:function(){e.input&&e.input.ripple&&e.input.ripple.deactivate()},deregisterInteractionHandler:function(t,n){var i=e.labelEl();i&&i.removeEventListener(t,n)},registerInteractionHandler:function(t,n){var i=e.labelEl();i&&i.addEventListener(t,n)}})},t}(iH),oC={ICON_BUTTON_ON:"mdc-icon-button--on",ROOT:"mdc-icon-button"},oT={ARIA_LABEL:"aria-label",ARIA_PRESSED:"aria-pressed",DATA_ARIA_LABEL_OFF:"data-aria-label-off",DATA_ARIA_LABEL_ON:"data-aria-label-on",CHANGE_EVENT:"MDCIconButtonToggle:change"},oS=function(e){function t(n){var i=e.call(this,iB(iB({},t.defaultAdapter),n))||this;return i.hasToggledAriaLabel=!1,i}return iN(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return oC},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return oT},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},hasClass:function(){return!1},notifyChange:function(){},removeClass:function(){},getAttr:function(){return null},setAttr:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){var e=this.adapter.getAttr(oT.DATA_ARIA_LABEL_ON),t=this.adapter.getAttr(oT.DATA_ARIA_LABEL_OFF);if(e&&t){if(null!==this.adapter.getAttr(oT.ARIA_PRESSED))throw Error("MDCIconButtonToggleFoundation: Button should not set `aria-pressed` if it has a toggled aria label.");this.hasToggledAriaLabel=!0}else this.adapter.setAttr(oT.ARIA_PRESSED,String(this.isOn()))},t.prototype.handleClick=function(){this.toggle(),this.adapter.notifyChange({isOn:this.isOn()})},t.prototype.isOn=function(){return this.adapter.hasClass(oC.ICON_BUTTON_ON)},t.prototype.toggle=function(e){if(void 0===e&&(e=!this.isOn()),e?this.adapter.addClass(oC.ICON_BUTTON_ON):this.adapter.removeClass(oC.ICON_BUTTON_ON),this.hasToggledAriaLabel){var t=e?this.adapter.getAttr(oT.DATA_ARIA_LABEL_ON):this.adapter.getAttr(oT.DATA_ARIA_LABEL_OFF);this.adapter.setAttr(oT.ARIA_LABEL,t||"")}else this.adapter.setAttr(oT.ARIA_PRESSED,""+e)},t}(iY),oM=oS.strings,oL=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.rippleComponent=t.createRipple(),t}return iN(t,e),t.attachTo=function(e){return new t(e)},t.prototype.initialSyncWithDOM=function(){var e=this;this.handleClick=function(){e.foundation.handleClick()},this.listen("click",this.handleClick)},t.prototype.destroy=function(){this.unlisten("click",this.handleClick),this.ripple.destroy(),e.prototype.destroy.call(this)},t.prototype.getDefaultFoundation=function(){var e=this;return new oS({addClass:function(t){return e.root.classList.add(t)},hasClass:function(t){return e.root.classList.contains(t)},notifyChange:function(t){e.emit(oM.CHANGE_EVENT,t)},removeClass:function(t){return e.root.classList.remove(t)},getAttr:function(t){return e.root.getAttribute(t)},setAttr:function(t,n){return e.root.setAttribute(t,n)}})},Object.defineProperty(t.prototype,"ripple",{get:function(){return this.rippleComponent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"on",{get:function(){return this.foundation.isOn()},set:function(e){this.foundation.toggle(e)},enumerable:!0,configurable:!0}),t.prototype.createRipple=function(){var e=new rt(this.root);return e.unbounded=!0,e},t}(iH);let oD="important",oI=" !"+oD,oR=eF(class extends ek{constructor(e){if(super(e),e.type!==ew.ATTRIBUTE||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,n)=>{let i=e[n];return null==i?t:t+`${n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(e,[t]){let{style:n}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(let e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?n.removeProperty(e):n[e]=null);for(let e in t){let i=t[e];if(null!=i){this.ft.add(e);let t="string"==typeof i&&i.endsWith(oI);e.includes("-")||t?n.setProperty(e,t?i.slice(0,-11):i,t?oD:""):n[e]=i}}return X}});var oO=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let oP=n(73041),o$=n(61526);class oN extends CustomEvent{constructor(e){super(oN.NAME,{detail:e,bubbles:!0,composed:!0})}}function oB(e,t,n,i,r){switch(i=i||"listbox",e){case sG.RADIO:i="radiogroup";break;case sG.MULTI_CHECKBOX:i="group"}return K`
|
|
117
117
|
<ul id="list" class="mdc-list${n?" mdc-list--two-line":""}" role="${i??Z}" @MDCList:action="${e=>r&&r(e)}" aria-hidden="true" aria-orientation="vertical" tabindex="-1">
|
|
118
118
|
${t}
|
|
119
119
|
</ul>
|
|
120
|
-
`}function
|
|
120
|
+
`}function oz(e,t,n,i,r,o){let a,s,l;if(null===e)return K`<li role="separator" class="mdc-list-divider"></li>`;let c=i===sG.MULTI_CHECKBOX||i===sG.MULTI_TICK,d=e.value,u=i!==sG.PLAIN&&n.length>0&&n.some(e=>e===d),h=void 0!==e.text?e.text:e.value,m=e.secondaryText,f="menuitem",p="",g="",b="",_=e.icon,y="mdc-list-item--selected";switch(r=r||e.translate,c&&i===sG.MULTI_TICK&&(_=u?"checkbox-marked":"checkbox-blank-outline"),(i===sG.MULTI_TICK||_)&&(g=K`
|
|
121
121
|
<span class="mdc-list-item__graphic">
|
|
122
122
|
<or-icon icon="${_}"></or-icon>
|
|
123
123
|
</span>
|
|
@@ -125,7 +125,7 @@ uniform ${n} ${i} u_${r};
|
|
|
125
125
|
<span class="mdc-list-item__meta" aria-hidden="true">
|
|
126
126
|
<or-icon icon="${e.trailingIcon}"></or-icon>
|
|
127
127
|
</span>
|
|
128
|
-
`),i){case
|
|
128
|
+
`),i){case sG.SELECT:a=u?"true":"false",l=u||(!n||0===n.length)&&0===t?"0":void 0,f="option";break;case sG.RADIO:s=u?"true":"false",f="radio",g=K`
|
|
129
129
|
<span class="mdc-list-item__graphic">
|
|
130
130
|
<div class="mdc-radio">
|
|
131
131
|
<input class="mdc-radio__native-control" id="radio-item-${t+1}" type="radio" value="${d}" />
|
|
@@ -135,7 +135,7 @@ uniform ${n} ${i} u_${r};
|
|
|
135
135
|
</div>
|
|
136
136
|
</div>
|
|
137
137
|
</span>
|
|
138
|
-
`;break;case
|
|
138
|
+
`;break;case sG.MULTI_CHECKBOX:s=u?"true":"false",f="checkbox",g=K`
|
|
139
139
|
<div class="mdc-checkbox">
|
|
140
140
|
<input type="checkbox" class="mdc-checkbox__native-control" />
|
|
141
141
|
<div class="mdc-checkbox__background">
|
|
@@ -145,23 +145,23 @@ uniform ${n} ${i} u_${r};
|
|
|
145
145
|
<div class="mdc-checkbox__mixedmark"></div>
|
|
146
146
|
</div>
|
|
147
147
|
</div>
|
|
148
|
-
`;break;case
|
|
148
|
+
`;break;case sG.MULTI_TICK:s=u?"true":"false",y="mdc-list-item--selected"}return h&&(p=void 0!==m?K`
|
|
149
149
|
<span class="mdc-list-item__text">
|
|
150
150
|
<span class="mdc-list-item__primary-text">${r&&h?K`<or-translate value="${h}"></or-translate>`:h}</span>
|
|
151
151
|
<span class="mdc-list-item__secondary-text">${r&&m?K`<or-translate value="${m}"></or-translate>`:m}</span>
|
|
152
152
|
</span>
|
|
153
|
-
`:i===
|
|
154
|
-
<li @click="${t=>{o&&o(t,e)}}" style="${e.styleMap?
|
|
153
|
+
`:i===sG.RADIO?K`<label class="mdc-list-item__text" for="radio-item-${t+1}">${r&&h?K`<or-translate value="${h}"></or-translate>`:h}</label>`:K`<span class="mdc-list-item__text" title="${r&&h?tB.t(h):h}">${r&&h?K`<or-translate value="${h}"></or-translate>`:h}</span>`),K`
|
|
154
|
+
<li @click="${t=>{o&&o(t,e)}}" style="${e.styleMap?oR(e.styleMap):""}" class="mdc-list-item ${u?y:""}" role="${f??Z}" tabindex="${l??Z}" aria-checked="${s??Z}" aria-selected="${a??Z}" data-value="${d}">
|
|
155
155
|
<span class="mdc-list-item__ripple"></span>
|
|
156
156
|
${g}
|
|
157
157
|
${p}
|
|
158
158
|
${b}
|
|
159
159
|
</li>
|
|
160
|
-
`}
|
|
160
|
+
`}oN.NAME="or-mwc-list-changed",function(e){e.PLAIN="PLAIN",e.SELECT="SELECT",e.RADIO="RADIO",e.MULTI_CHECKBOX="MULTI_CHECKBOX",e.MULTI_TICK="MULTI_TICK"}(sG||(sG={}));let oj=u`
|
|
161
161
|
:host {
|
|
162
162
|
white-space: nowrap;
|
|
163
|
-
--internal-or-mwc-input-color: var(--or-mwc-input-color, var(--or-app-color4, ${d(
|
|
164
|
-
--internal-or-mwc-input-text-color: var(--or-mwc-input-text-color, var(--or-app-color8, ${d(
|
|
163
|
+
--internal-or-mwc-input-color: var(--or-mwc-input-color, var(--or-app-color4, ${d(iE)}));
|
|
164
|
+
--internal-or-mwc-input-text-color: var(--or-mwc-input-text-color, var(--or-app-color8, ${d(iT)}));
|
|
165
165
|
|
|
166
166
|
--mdc-theme-primary: var(--internal-or-mwc-input-color);
|
|
167
167
|
--mdc-theme-on-primary: var(--internal-or-mwc-input-text-color);
|
|
@@ -176,12 +176,12 @@ uniform ${n} ${i} u_${r};
|
|
|
176
176
|
text-decoration: none;
|
|
177
177
|
color: rgba(0, 0, 0, 0.87);
|
|
178
178
|
}
|
|
179
|
-
`,
|
|
179
|
+
`,oY=class extends em{static get styles(){return[u`${d(oP)}`,u`${d(o$)}`,oj]}constructor(){super(),this.type=sG.SELECT}disconnectedCallback(){super.disconnectedCallback(),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0)}shouldUpdate(e){if(this._mdcComponent&&e.has("values")&&!tK(this.values,e.get("values"))){let e=this.values?Array.isArray(this.values)?this.values:[this.values]:[];this.setSelectedItems(this.values&&this.listItems?this.listItems.filter(t=>t&&(null==e?void 0:e.includes(t.value))):void 0)}return!0}render(){let e=this.listItems?K`${this.listItems.map((e,t)=>oz(e,t,Array.isArray(this.values)?this.values:this.values?[this.values]:[],this.type))}`:K``,t=this.listItems&&this.listItems.some(e=>e&&!!e.secondaryText);return oB(this.type,e,t,void 0,e=>this._onSelected(e))}firstUpdated(e){super.firstUpdated(e),this._mdcElem&&(this._mdcComponent=new on(this._mdcElem),(this.type===sG.SELECT||this.type===sG.RADIO)&&(this._mdcComponent.singleSelection=!0))}get selectedItems(){if(!this._mdcComponent)return[];let e=Array.isArray(this._mdcComponent.selectedIndex)?this._mdcComponent.selectedIndex:[this._mdcComponent.selectedIndex],t=this.listItems?this.listItems.filter(e=>null!==e):[];return e.map(e=>t[e])}setSelectedItems(e){if(!this._mdcComponent||!this.listItems)return;if(!e){this._mdcComponent.selectedIndex=-1;return}let t=(!Array.isArray(e)?[e]:e).map(e=>"string"==typeof e?e:e.value),n=this.listItems.filter(e=>null!==e).reduce((e,n,i)=>(n&&t.includes(n.value)&&e.push(i),e),[]);this._mdcComponent.selectedIndex=this.type===sG.MULTI_CHECKBOX?n:n.length>=1?n[0]:-1}_onSelected(e){this.values=this.selectedItems.map(e=>e.value),e.stopPropagation(),this.dispatchEvent(new oN(this.selectedItems))}};oO([eb({type:Array})],oY.prototype,"listItems",void 0),oO([eb({type:Array})],oY.prototype,"values",void 0),oO([eb({type:String,attribute:!0})],oY.prototype,"type",void 0),oO([ev("#wrapper")],oY.prototype,"_wrapperElem",void 0),oO([ev("#list")],oY.prototype,"_mdcElem",void 0),oY=oO([ep("or-mwc-list")],oY);var oH=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},oU=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})};let oV=n(67444),oW=n(44202),oG=n(56584),oq=n(79224),oK=n(31174),oX=n(58140),oZ=n(82611),oJ=n(7229),oQ=n(61526),o0=n(95816),o1=n(89439),o2=n(20332),o5=n(73041),o3=n(6401),o4=n(172),o6=n(43881);class o8 extends CustomEvent{constructor(e,t,n){super(o8.NAME,{detail:{value:e,previousValue:t,enterPressed:n},bubbles:!0,composed:!0})}}function o7(e){return e===sq.NUMBER||e===sq.BIG_INT||e===sq.TELEPHONE||e===sq.TEXT||e===sq.PASSWORD||e===sq.DATE||e===sq.DATETIME||e===sq.EMAIL||e===sq.JSON||e===sq.JSON_OBJECT||e===sq.MONTH||e===sq.TEXTAREA||e===sq.TIME||e===sq.URL||e===sq.WEEK}function o9(e){return o7(e)||e===sq.SELECT}o8.NAME="or-mwc-input-changed",!function(e){e.BUTTON="button",e.BUTTON_TOGGLE="button-toggle",e.BUTTON_MOMENTARY="button-momentary",e.CHECKBOX="checkbox",e.CHECKBOX_LIST="checkbox-list",e.COLOUR="color",e.DATE="date",e.DATETIME="datetime-local",e.EMAIL="email",e.JSON="json",e.JSON_OBJECT="json-object",e.MONTH="month",e.NUMBER="number",e.BIG_INT="big-int",e.PASSWORD="password",e.RADIO="radio",e.SWITCH="switch",e.RANGE="range",e.TELEPHONE="tel",e.TEXT="text",e.TEXTAREA="textarea",e.TIME="time",e.URL="url",e.WEEK="week",e.SELECT="select",e.LIST="list",e.CRON="cron",e.DURATION="duration",e.DURATION_TIME="duration-time",e.DURATION_PERIOD="duration-period"}(sq||(sq={}));let ae=u`
|
|
180
180
|
|
|
181
181
|
:host {
|
|
182
182
|
display: inline-block;
|
|
183
|
-
--internal-or-mwc-input-color: var(--or-mwc-input-color, var(--or-app-color4, ${d(
|
|
184
|
-
--internal-or-mwc-input-text-color: var(--or-mwc-input-text-color, var(--or-app-color8, ${d(
|
|
183
|
+
--internal-or-mwc-input-color: var(--or-mwc-input-color, var(--or-app-color4, ${d(iE)}));
|
|
184
|
+
--internal-or-mwc-input-text-color: var(--or-mwc-input-text-color, var(--or-app-color8, ${d(iT)}));
|
|
185
185
|
|
|
186
186
|
--mdc-theme-primary: var(--internal-or-mwc-input-color);
|
|
187
187
|
--mdc-theme-on-primary: var(--internal-or-mwc-input-text-color);
|
|
@@ -272,7 +272,7 @@ uniform ${n} ${i} u_${r};
|
|
|
272
272
|
|
|
273
273
|
#select-searchable {
|
|
274
274
|
background-color: transparent;
|
|
275
|
-
border: 1px solid var(--or-app-color5, ${d(
|
|
275
|
+
border: 1px solid var(--or-app-color5, ${d(iC)});
|
|
276
276
|
margin: 8px;
|
|
277
277
|
width: calc(100% - 16px);
|
|
278
278
|
border-radius: 4px;
|
|
@@ -374,7 +374,7 @@ uniform ${n} ${i} u_${r};
|
|
|
374
374
|
.mdc-list-item__graphic > or-icon {
|
|
375
375
|
pointer-events: none;
|
|
376
376
|
}
|
|
377
|
-
`,
|
|
377
|
+
`,at=class extends em{constructor(){super(...arguments),this.readonly=!1,this.required=!1,this.checked=!1,this.indeterminate=!1,this.multiple=!1,this.searchLabel="search",this.compact=!1,this.comfortable=!1,this.raised=!1,this.action=!1,this.unElevated=!1,this.outlined=!1,this.rounded=!1,this.disableSliderNumberInput=!1,this.fullWidth=!1,this.helperPersistent=!1,this.autoValidate=!1,this.charCounter=!1,this.disabled=!1,this.continuous=!1,this.resizeVertical=!1,this.censored=!1,this.advertised=!1,this._selectedIndex=-1,this.isUiValid=!0}static get styles(){return[u`${d(oG)}`,u`${d(oV)}`,u`${d(oW)}`,u`${d(oq)}`,u`${d(oK)}`,u`${d(oX)}`,u`${d(oZ)}`,u`${d(oJ)}`,u`${d(oQ)}`,u`${d(o0)}`,u`${d(o1)}`,u`${d(o2)}`,u`${d(o5)}`,u`${d(o4)}`,u`${d(o3)}`,u`${d(o6)}`,ae]}get nativeValue(){if(this._mdcComponent)return this._mdcComponent.value}disconnectedCallback(){var e,t;super.disconnectedCallback(),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0,null==(e=this._menuObserver)||e.disconnect()),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0,null==(t=this._menuObserver)||t.disconnect())}shouldUpdate(e){return e.has("indeterminate")&&this._mdcComponent&&this.type===sq.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),e.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===sq.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),e.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===sq.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=sq.DATETIME:"boolean"==typeof this.value?this.type=sq.CHECKBOX:"number"==typeof this.value?this.type=sq.NUMBER:"string"==typeof this.value?this.type=sq.TEXT:this.type=sq.JSON),!0}focus(){this.type===sq.RANGE&&this._mdcComponent2?this._mdcComponent2.focus():this._mdcComponent&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}render(){if(this.type){let o=!this.fullWidth&&this.label,a=!this.fullWidth&&this.outlined,s=!!this.helperText,l=!this.isUiValid&&(!!this.errorMessage||!!this.validationMessage),c={"mdc-text-field-helper-text--persistent":!l&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":l},d=null!==this.value&&void 0!==this.value||!1===this.value,u=o?K`<span class="mdc-floating-label ${d?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case sq.RADIO:let h=this.resolveOptions(this.options);return this._selectedIndex=-1,K`
|
|
378
378
|
<div class="mdc-radio-container">
|
|
379
379
|
${h?h.map(([e,t],n)=>(this.value===e&&(this._selectedIndex=n),K`
|
|
380
380
|
<div id="field" class="mdc-form-field">
|
|
@@ -399,10 +399,10 @@ uniform ${n} ${i} u_${r};
|
|
|
399
399
|
|
|
400
400
|
`)):""}
|
|
401
401
|
</div>
|
|
402
|
-
`;case
|
|
402
|
+
`;case sq.SWITCH:let m={"mdc-switch--disabled":this.disabled||this.readonly,"mdc-switch--full-width":this.fullWidth,"mdc-switch--checked":this.value};return K`
|
|
403
403
|
<span id="wrapper">
|
|
404
404
|
${this.label?K`<label for="elem" class="${this.disabled?"mdc-switch--disabled":""}">${this.label}</label>`:""}
|
|
405
|
-
<div id="component" class="mdc-switch ${
|
|
405
|
+
<div id="component" class="mdc-switch ${iP(m)}">
|
|
406
406
|
<div class="mdc-switch__track"></div>
|
|
407
407
|
<div class="mdc-switch__thumb-underlay">
|
|
408
408
|
<div class="mdc-switch__thumb">
|
|
@@ -416,16 +416,16 @@ uniform ${n} ${i} u_${r};
|
|
|
416
416
|
</div>
|
|
417
417
|
</div>
|
|
418
418
|
</span>
|
|
419
|
-
`;case
|
|
420
|
-
<div id="component" class="mdc-list mdc-select ${
|
|
419
|
+
`;case sq.LIST:let f={"mdc-select--outlined":a,"mdc-select--disabled":this.disabled,"mdc-select--required":this.required,"mdc-select--dense":!1,"mdc-select--no-label":!this.label,"mdc-select--with-leading-icon":!!this.icon},p=this.resolveOptions(this.options);return this._selectedIndex=-1,K`
|
|
420
|
+
<div id="component" class="mdc-list mdc-select ${iP(f)}" @MDCList:action="${e=>this.onValueChange(void 0,-1===e.detail.index?void 0:Array.isArray(this.options[e.detail.index])?this.options[e.detail.index][0]:this.options[e.detail.index])}">
|
|
421
421
|
<ul class="mdc-list">
|
|
422
|
-
${p?p.map(([e,t],n)=>(this.value===e&&(this._selectedIndex=n),K`<li class="${
|
|
422
|
+
${p?p.map(([e,t],n)=>(this.value===e&&(this._selectedIndex=n),K`<li class="${iP({"mdc-list-item":!0,"mdc-list-item--selected":this.value===e})}" role="option" data-value="${e}"><or-translate value="${t}"></or-translate></li>`)):""}
|
|
423
423
|
</ul>
|
|
424
424
|
</div>
|
|
425
|
-
`;case
|
|
425
|
+
`;case sq.SELECT:var e,t,n,i,r;let g,b={"mdc-select--outlined":a,"mdc-select--filled":!a,"mdc-select--disabled":this.disabled||this.readonly,"mdc-select--required":this.required,"mdc-select--dense":!1,"dense-comfortable":this.comfortable,"mdc-select--no-label":!this.label,"mdc-select--with-leading-icon":!!this.icon,"or-mwc-input--rounded":this.rounded};g=void 0!=this.searchProvider?this.searchProvider(this.searchableValue):this.resolveOptions(this.options);let _=(e,t)=>{var n;let i=t.value;if(this.multiple){e.stopPropagation();let t=null!=(n=this._tempValue)?n:Array.isArray(this.value)?[...this.value]:void 0!==this.value?[this.value]:[],r=t.findIndex(e=>e===i);r>=0?t.splice(r,1):t.push(i);let o=e.composedPath()[0].closest("li"),a=o.getElementsByTagName("or-icon")[0];o&&(r>=0?o.classList.remove("mdc-list-item--selected"):o.classList.add("mdc-list-item--selected")),a&&(a.icon=r>=0?"checkbox-blank-outline":"checkbox-marked"),this._tempValue=t}else void 0==this.searchProvider&&Array.isArray(g)||this.onValueChange(void 0,t.value)},y=()=>{var e;let t=null!=(e=this._tempValue)?e:this.value;if(window.setTimeout(()=>{this._mdcComponent&&this._mdcComponent.foundation.adapter.floatLabel(t&&(!Array.isArray(t)||t.length>0))}),!this._tempValue)return;let n=[...this._tempValue];this._tempValue=void 0,this.onValueChange(void 0,n)},v=e=>void 0==this.searchProvider||e&&0!=e.length?oB(this.multiple?sG.MULTI_TICK:sG.SELECT,K`${null==e?void 0:e.map(([e,t],n)=>oz({text:t,value:e},n,Array.isArray(this.value)?this.value:this.value?[this.value]:[],this.multiple?sG.MULTI_TICK:sG.SELECT,!1,_))}`,!1,void 0):K`<span class="mdc-text-field-helper-line" style="margin: 8px 8px 8px 0;">${tB.t("noResults")}</span>`;return K`
|
|
426
426
|
<div id="component"
|
|
427
|
-
class="mdc-select ${
|
|
428
|
-
@MDCSelect:change="${e=>
|
|
427
|
+
class="mdc-select ${iP(b)}"
|
|
428
|
+
@MDCSelect:change="${e=>oU(this,void 0,void 0,function*(){let t=Array.isArray(g)?g:yield g;this.onValueChange(void 0,-1===e.detail.index?void 0:Array.isArray(t[e.detail.index])?t[e.detail.index][0]:t[e.detail.index])})}">
|
|
429
429
|
<div class="mdc-select__anchor" role="button"
|
|
430
430
|
aria-haspopup="listbox"
|
|
431
431
|
aria-expanded="false"
|
|
@@ -467,14 +467,14 @@ uniform ${n} ${i} u_${r};
|
|
|
467
467
|
/>
|
|
468
468
|
</label>
|
|
469
469
|
`,e?t(e):void 0}
|
|
470
|
-
${n=Array.isArray(g),i=()=>v(g),r=()=>eO(new Promise(e=>
|
|
470
|
+
${n=Array.isArray(g),i=()=>v(g),r=()=>eO(new Promise(e=>oU(this,void 0,void 0,function*(){e(v((yield g)))})),K`<span class="mdc-text-field-helper-line" style="margin: 8px 8px 8px 0;">${tB.t("loading")}</span>`),n?i(n):r?.(n)}
|
|
471
471
|
</div>
|
|
472
472
|
${s||l?K`
|
|
473
|
-
<p id="component-helper-text" class="mdc-select-helper-text ${
|
|
473
|
+
<p id="component-helper-text" class="mdc-select-helper-text ${iP(c)}" aria-hidden="true">
|
|
474
474
|
${l?this.errorMessage||this.validationMessage:this.helperText}
|
|
475
475
|
</p>`:""}
|
|
476
476
|
</div>
|
|
477
|
-
`;case
|
|
477
|
+
`;case sq.BUTTON_TOGGLE:return K`
|
|
478
478
|
<button id="component" class="mdc-icon-button ${this.value?"mdc-icon-button--on":""}"
|
|
479
479
|
?readonly="${this.readonly}"
|
|
480
480
|
?disabled="${this.disabled}"
|
|
@@ -482,8 +482,8 @@ uniform ${n} ${i} u_${r};
|
|
|
482
482
|
${this.icon?K`<or-icon class="mdc-icon-button__icon" aria-hidden="true" icon="${this.icon}"></or-icon>`:""}
|
|
483
483
|
${this.iconOn?K`<or-icon class="mdc-icon-button__icon mdc-icon-button__icon--on" aria-hidden="true" icon="${this.iconOn}"></or-icon>`:""}
|
|
484
484
|
</button>
|
|
485
|
-
`;case
|
|
486
|
-
<button id="component" class="${
|
|
485
|
+
`;case sq.BUTTON:case sq.BUTTON_MOMENTARY:{let e=e=>{this.disabled&&e.stopPropagation(),i&&this.dispatchEvent(new o8(!0,null))},t=e=>{this.disabled&&e.stopPropagation(),i&&this.dispatchEvent(new o8(!1,!0))},n=e=>{this.disabled&&e.stopPropagation(),i||this.dispatchEvent(new o8(!0,null))},i=this.type===sq.BUTTON_MOMENTARY,r=!this.action&&!this.label;!r||this.iconTrailing||this.icon||(this.icon="circle");let o={"mdc-icon-button":r,"mdc-fab":!r&&this.action,"mdc-fab--extended":!r&&this.action&&!!this.label,"mdc-fab--mini":!r&&this.action&&(this.compact||this.comfortable),"mdc-button":!r&&!this.action,"mdc-button--raised":!r&&!this.action&&this.raised,"mdc-button--unelevated":!r&&!this.action&&this.unElevated,"mdc-button--outlined":!r&&!this.action&&(this.outlined||i),"mdc-button--rounded":!r&&!this.action&&this.rounded,"mdc-button--fullwidth":this.fullWidth};return K`
|
|
486
|
+
<button id="component" class="${iP(o)}"
|
|
487
487
|
?readonly="${this.readonly}"
|
|
488
488
|
?disabled="${this.disabled}"
|
|
489
489
|
@click="${e=>n(e)}"
|
|
@@ -493,7 +493,7 @@ uniform ${n} ${i} u_${r};
|
|
|
493
493
|
${this.label?K`<span class="${this.action?"mdc-fab__label":"mdc-button__label"}"><or-translate .value="${this.label}"></or-translate></span>`:""}
|
|
494
494
|
${!r&&this.iconTrailing?K`<or-icon class="${this.action?"mdc-fab__icon":"mdc-button__icon"}" aria-hidden="true" icon="${this.iconTrailing}"></or-icon>`:""}
|
|
495
495
|
</button>
|
|
496
|
-
`}case
|
|
496
|
+
`}case sq.CHECKBOX_LIST:Array.isArray(this.value)||(null===this.value||void 0===this.value?this.value=[]:this.value=[this.value]);let x=this.resolveOptions(this.options);return this._selectedIndex=-1,K`
|
|
497
497
|
<div class="mdc-checkbox-list">
|
|
498
498
|
${x?x.map(([e,t],n)=>(this.value===e&&(this._selectedIndex=n),K`
|
|
499
499
|
<div id="field" class="mdc-form-field">
|
|
@@ -513,9 +513,9 @@ uniform ${n} ${i} u_${r};
|
|
|
513
513
|
|
|
514
514
|
`)):""}
|
|
515
515
|
</div>
|
|
516
|
-
`;case
|
|
516
|
+
`;case sq.CHECKBOX:let w={"mdc-checkbox":!0,"mdc-checkbox--disabled":this.disabled||this.readonly};return K`
|
|
517
517
|
<div id="field" class="mdc-form-field">
|
|
518
|
-
<div id="component" class="${
|
|
518
|
+
<div id="component" class="${iP(w)}">
|
|
519
519
|
<input type="checkbox"
|
|
520
520
|
id="elem"
|
|
521
521
|
data-indeterminate="${this.indeterminate}"
|
|
@@ -534,7 +534,7 @@ uniform ${n} ${i} u_${r};
|
|
|
534
534
|
</div>
|
|
535
535
|
<label class="mdc-checkbox-circle" for="elem">${this.label}</label>
|
|
536
536
|
</div>
|
|
537
|
-
`;case
|
|
537
|
+
`;case sq.COLOUR:return K`
|
|
538
538
|
<div id="component" style="width: 100%; display: inline-flex; align-items: center; padding: 8px 0;">
|
|
539
539
|
<input type="color" id="elem" style="border: none; height: 31px; width: 31px; padding: 1px 3px; min-height: 22px; min-width: 30px;cursor: pointer" value="${this.value}"
|
|
540
540
|
?disabled="${this.disabled||this.readonly}"
|
|
@@ -543,7 +543,7 @@ uniform ${n} ${i} u_${r};
|
|
|
543
543
|
/>
|
|
544
544
|
<label style="margin-left: 10px; cursor: pointer" for="elem">${this.label}</label>
|
|
545
545
|
</div>
|
|
546
|
-
`;case
|
|
546
|
+
`;case sq.NUMBER:case sq.RANGE:case sq.DATE:case sq.DATETIME:case sq.TIME:case sq.MONTH:case sq.WEEK:case sq.EMAIL:case sq.PASSWORD:case sq.TELEPHONE:case sq.URL:case sq.TEXT:case sq.TEXTAREA:case sq.JSON:case sq.JSON_OBJECT:{let e,t=[void 0===this.value||null===this.value?void 0:this.value,this.min,this.max];if(t.some(e=>"string"!=typeof e))if(this.type===sq.JSON||this.type===sq.JSON_OBJECT)if(void 0!==t[0]){if("string"!=typeof t[0]||null===t[0])try{t[0]=JSON.stringify(t[0],null,2)}catch(e){console.warn("Failed to parse JSON expression for input control"),t[0]=""}}else t[0]="";else{let e=this.format?Object.assign({},this.format):{};switch(this.type){case sq.TIME:e.asDate=!0,e.hour12=!1,e.timeStyle=this.step&&this.step<60?"medium":"short";break;case sq.DATE:e.asDate=!0,e.momentJsFormat="YYYY-MM-DD";break;case sq.WEEK:e.asDate=!0,e.momentJsFormat="YYYY-[W]WW";break;case sq.MONTH:e.asDate=!0,e.momentJsFormat="YYYY-MM";break;case sq.DATETIME:e.asDate=!0,e.momentJsFormat="YYYY-MM-DDTHH:mm";break;case sq.NUMBER:null!=e.maximumFractionDigits||(e.maximumFractionDigits=20)}e.useGrouping=!1,t=t.map(t=>void 0!==t?t1(t,()=>e,"en-GB"):void 0)}let n=this.label,i=this.type,r="component";if(this.type===sq.RANGE&&(n=void 0,a=!1,s=!1,i=sq.NUMBER,r="number"),!(this.type===sq.RANGE&&this.disableSliderNumberInput)){this.censored&&(i=sq.PASSWORD),this.type===sq.PASSWORD&&this.advertised&&(i=sq.TEXT);let o={"mdc-text-field":!0,"mdc-text-field--invalid":!this.valid,"mdc-text-field--filled":!a,"mdc-text-field--outlined":a,"mdc-text-field--textarea":i===sq.TEXTAREA||i===sq.JSON||i===sq.JSON_OBJECT,"mdc-text-field--disabled":this.disabled,"mdc-text-field--fullwidth":this.fullWidth&&!a,"dense-comfortable":this.comfortable&&i!==sq.TEXTAREA&&i!==sq.JSON&&i!==sq.JSON_OBJECT,"dense-compact":!this.comfortable&&this.compact,"mdc-text-field--label-floating":d,"mdc-text-field--no-label":!this.label,"mdc-text-field--with-leading-icon":!!this.icon,"mdc-text-field--with-trailing-icon":!!this.iconTrailing,"or-mwc-input--rounded":this.rounded};e=i===sq.TEXTAREA||i===sq.JSON||i===sq.JSON_OBJECT?K`
|
|
547
547
|
<textarea id="elem" class="mdc-text-field__input ${this.resizeVertical?"resize-vertical":""}" ?required="${this.required}"
|
|
548
548
|
?readonly="${this.readonly}" ?disabled="${this.disabled}" minlength="${this.minLength??Z}"
|
|
549
549
|
maxlength="${this.maxLength??Z}" rows="${this.rows?this.rows:5}"
|
|
@@ -559,25 +559,25 @@ uniform ${n} ${i} u_${r};
|
|
|
559
559
|
@keydown="${e=>{("Enter"===e.code||"NumpadEnter"===e.code)&&this.onValueChange(e.target,e.target.value,!0)}}"
|
|
560
560
|
@blur="${e=>{""===e.target.value&&this.reportValidity()}}"
|
|
561
561
|
@change="${e=>this.onValueChange(e.target,e.target.value)}" />`,e=K`
|
|
562
|
-
<label id="${r}" class="${
|
|
562
|
+
<label id="${r}" class="${iP(o)}">
|
|
563
563
|
${this.icon?K`<or-icon class="mdc-text-field__icon mdc-text-field__icon--leading" style="color: ${this.iconColor?"#"+this.iconColor:"unset"}" aria-hidden="true" icon="${this.icon}"></or-icon>`:""}
|
|
564
564
|
${a?"":K`<span class="mdc-text-field__ripple"></span>`}
|
|
565
565
|
${e}
|
|
566
566
|
${a?this.renderOutlined(u):u}
|
|
567
567
|
${a?"":K`<span class="mdc-line-ripple"></span>`}
|
|
568
|
-
${this.type===
|
|
568
|
+
${this.type===sq.PASSWORD&&!this.censored?K`<or-icon class="mdc-text-field__icon mdc-text-field__icon--trailing" aria-hidden="true" icon=${this.advertised?"eye":"eye-off"} style="pointer-events: auto;" @click=${()=>this.advertised=!this.advertised}></or-icon>`:""}
|
|
569
569
|
${this.iconTrailing?K`<or-icon class="mdc-text-field__icon mdc-text-field__icon--trailing" aria-hidden="true" icon="${this.iconTrailing}"></or-icon>`:""}
|
|
570
570
|
</label>
|
|
571
571
|
${s||l?K`
|
|
572
572
|
<div class="mdc-text-field-helper-line">
|
|
573
|
-
<div class="mdc-text-field-helper-text ${
|
|
573
|
+
<div class="mdc-text-field-helper-text ${iP(c)}">${l?this.errorMessage||this.validationMessage:this.helperText}</div>
|
|
574
574
|
${this.charCounter&&!this.readonly?K`<div class="mdc-text-field-character-counter"></div>`:""}
|
|
575
575
|
</div>
|
|
576
576
|
`:""}
|
|
577
|
-
`}if(this.type===
|
|
577
|
+
`}if(this.type===sq.RANGE){let n={"mdc-slider":!0,"mdc-slider--range":this.continuous,"mdc-slider--discreet":!this.continuous,"mdc-slider--disabled":this.disabled||this.readonly};e=K`
|
|
578
578
|
<span id="wrapper">
|
|
579
579
|
${this.label?K`<label for="component" class="${this.disabled?"mdc-switch--disabled":""}">${this.label}</label>`:""}
|
|
580
|
-
<div id="component" class="${
|
|
580
|
+
<div id="component" class="${iP(n)}" @MDCSlider:change="${e=>this.onValueChange(void 0,e.detail.value)}">
|
|
581
581
|
<input id="elem" class="mdc-slider__input" type="range" min="${t[1]??Z}" max="${t[2]??Z}" value="${t[0]||t[1]||0}" name="slider" step="${this.step||1}" ?readonly="${this.readonly}" ?disabled="${this.disabled}" aria-label="${this.label??Z}" />
|
|
582
582
|
<div class="mdc-slider__track">
|
|
583
583
|
<div class="mdc-slider__track--inactive"></div>
|
|
@@ -598,7 +598,7 @@ uniform ${n} ${i} u_${r};
|
|
|
598
598
|
</div>
|
|
599
599
|
${e?K`<div style="min-width: 70px; width: 70px;">${e}</div>`:""}
|
|
600
600
|
</span>
|
|
601
|
-
`}return e}}}return K`<span>INPUT TYPE NOT IMPLEMENTED</span>`}_getFormat(){if(this.format)return this.format}update(e){if(e.has("autoValidate")&&this._mdcComponent){let e=this._mdcComponent;e.foundation&&e.foundation.setValidateOnValueChange&&e.foundation.setValidateOnValueChange(this.autoValidate)}super.update(e)}firstUpdated(e){super.firstUpdated(e),this.autoValidate&&this.reportValidity()}updated(e){var t,n;if(super.updated(e),e.has("type")){let e=this.shadowRoot.getElementById("component");if(this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0),e&&this.type){switch(this.type){case
|
|
601
|
+
`}return e}}}return K`<span>INPUT TYPE NOT IMPLEMENTED</span>`}_getFormat(){if(this.format)return this.format}update(e){if(e.has("autoValidate")&&this._mdcComponent){let e=this._mdcComponent;e.foundation&&e.foundation.setValidateOnValueChange&&e.foundation.setValidateOnValueChange(this.autoValidate)}super.update(e)}firstUpdated(e){super.firstUpdated(e),this.autoValidate&&this.reportValidity()}updated(e){var t,n;if(super.updated(e),e.has("type")){let e=this.shadowRoot.getElementById("component");if(this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0),e&&this.type){switch(this.type){case sq.LIST:let t=new on(e);this._mdcComponent=t,t.selectedIndex=this._selectedIndex;break;case sq.SELECT:let n=new ow(e);this._mdcComponent=n,(null===this.value||void 0===this.value)&&(n.selectedIndex=-1),this.multiple&&(this._mdcComponent.foundation.adapter.getSelectedIndex=()=>{if(!Array.isArray(this.value)||0===this.value.length)return -1;let e=this.value[0];return this._mdcComponent.foundation.adapter.getMenuItemValues().indexOf(e)}),n.useDefaultValidation=!this.multiple,n.valid=!this.required||!this.multiple&&n.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;let i=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(i),this._mdcComponent.foundation.adapter.floatLabel(!!i),this._menuObserver||(this._menuObserver=new IntersectionObserver((e,t)=>{var n,i;e[0].target.style.minWidth!=(null==(n=e[0].target.parentElement)?void 0:n.clientWidth)+"px"&&(e[0].target.style.minWidth=(null==(i=e[0].target.parentElement)?void 0:i.clientWidth)+"px")}),this._menuObserver.observe(this.shadowRoot.getElementById("mdc-select-menu")));let r=void 0!==this.searchProvider,o=this.multiple;n.menu.menuSurface_.foundation.handleBodyClick=function(e){let t=e.composedPath()[0];if(this.adapter.isElementInContainer(t)){if(!r)return;else if(t instanceof Element&&!t.className.includes("mdc-list-item"))return;else if(o)return}n.menu.menuSurface_.close()};break;case sq.RADIO:case sq.CHECKBOX_LIST:case sq.COLOUR:break;case sq.BUTTON:case sq.BUTTON_MOMENTARY:let a=!this.action&&!this.label,s=new rt(e);a&&(s.unbounded=!0),this._mdcComponent=s;break;case sq.BUTTON_TOGGLE:this._mdcComponent=new oL(e);break;case sq.CHECKBOX:this._mdcComponent=new rR(e);let l=this.shadowRoot.getElementById("field");if(l){let e=new oA(l);e.input=this._mdcComponent,this._mdcComponent2=e}break;case sq.SWITCH:this._mdcComponent=new rB(e);break;case sq.RANGE:this._mdcComponent=new rW(e);let c=this.shadowRoot.getElementById("number");if(c){let e=new rF(c);e.useNativeValidation=!1,this._mdcComponent2=e}break;default:let d=new rF(e);d.useNativeValidation=!1,this._mdcComponent=d}this._mdcComponent&&this.focused&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}}else{if(this.type===sq.SELECT&&this._mdcComponent){e.has("options")&&this._mdcComponent.layoutOptions(),this._mdcComponent.disabled=!!(this.disabled||this.readonly),this._mdcComponent.useDefaultValidation=!this.multiple,this._mdcComponent.valid=!this.required||!this.multiple&&this._mdcComponent.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;let t=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(t),this._mdcComponent.foundation.adapter.floatLabel(!!t)}else if(this.type===sq.RANGE&&this._mdcComponent){let e=this._mdcComponent;e.setDisabled(this.disabled||this.readonly),e.setValue(this.value)}else if(this.type===sq.SWITCH&&this._mdcComponent)this._mdcComponent.checked=this.value;else if(this.type===sq.CHECKBOX&&this._mdcComponent){let e=this._mdcComponent;e.checked=!!this.value,e.disabled=!!(this.disabled||this.readonly)}this._mdcComponent&&(this._mdcComponent.required=!!this.required)}e.has("label")&&(null==(n=null==(t=this._mdcComponent)?void 0:t.layout)||n.call(t)),this.autoValidate&&this.reportValidity()}renderOutlined(e){return K`
|
|
602
602
|
<span class="mdc-notched-outline">
|
|
603
603
|
<span class="mdc-notched-outline__leading"></span>
|
|
604
604
|
${e?K`
|
|
@@ -608,7 +608,7 @@ uniform ${n} ${i} u_${r};
|
|
|
608
608
|
`:""}
|
|
609
609
|
<span class="mdc-notched-outline__trailing"></span>
|
|
610
610
|
</span>
|
|
611
|
-
`}setCustomValidity(e){this.errorMessage=e;let t=this.shadowRoot.getElementById("elem");t&&t.setCustomValidity&&t.setCustomValidity(null!=e?e:""),this.reportValidity()}checkValidity(){let e=this.shadowRoot.getElementById("elem"),t=!0;return e&&e.validity&&(t=e.validity.valid),t&&(this.type===
|
|
611
|
+
`}setCustomValidity(e){this.errorMessage=e;let t=this.shadowRoot.getElementById("elem");t&&t.setCustomValidity&&t.setCustomValidity(null!=e?e:""),this.reportValidity()}checkValidity(){let e=this.shadowRoot.getElementById("elem"),t=!0;return e&&e.validity&&(t=e.validity.valid),t&&(this.type===sq.JSON||this.type===sq.JSON_OBJECT)&&void 0!==this.value&&null!==this.value&&""===this._mdcComponent.value&&(t=!1),t}reportValidity(){let e=this.checkValidity();return this.isUiValid=e,this._mdcComponent&&(this._mdcComponent.valid=e),e}onValueChange(e,t,n){var i,r;let o,a=this.value;if("undefined"===t&&(a=null,t=void 0),"null"===t&&(a=void 0,t=null),"string"==typeof t)switch(this.type){case sq.CHECKBOX:case sq.SWITCH:t="on"===t;break;case sq.JSON:case sq.JSON_OBJECT:case sq.NUMBER:case sq.RANGE:if(""===t)t=null;else try{t=JSON.parse(t),this.type===sq.JSON_OBJECT&&("object"!=typeof t||Array.isArray(t))&&(t=this.value,o=tB.t("validation.invalidJSON"))}catch(e){t=this.value,o=this.type===sq.JSON||this.type==sq.JSON_OBJECT?tB.t("validation.invalidJSON"):tB.t("validation.invalidNumber")}break;case sq.DATETIME:if(""===t)t=null;else try{t=Date.parse(t)}catch(e){t=this.value,o=tB.t("validation.invalidDate")}}if(this.value=t,this.setCustomValidity(o),this.reportValidity(),this.type!==sq.CHECKBOX_LIST&&t!==a&&(this.type===sq.RANGE&&(this._mdcComponent.setValue(t),this._mdcComponent2&&(this._mdcComponent2.value=t)),this.dispatchEvent(new o8(this.value,a,n))),void 0!=this.searchProvider&&this.type===sq.SELECT){let e=null==(r=null==(i=this.shadowRoot)?void 0:i.getElementById("select-searchable"))?void 0:r.children[1];e&&(this.searchableValue=void 0,e.value="")}this.type!==sq.CHECKBOX_LIST||tK(t,a,!0)||this.dispatchEvent(new o8(t,a,n))}get valid(){let e=this.shadowRoot.getElementById("elem");return!e||!e.checkValidity||e.checkValidity()}get currentValue(){let e=this.shadowRoot.getElementById("elem");if(e&&e.value)return e.value}resolveOptions(e){let t;return e&&e.length>0&&(t=e.map(e=>{if(Array.isArray(e))return e;{let t=""+e;return[e,tB.t(t,{defaultValue:tX(t)})]}})),t}getSelectedTextValue(e){let t=this.value,n=Array.isArray(t)?t:null!=t?[t]:void 0;if(!n)return"";let i=e||this.resolveOptions(this.options);return i&&n?n.map(e=>i.find(([t,n],i)=>e===t)).map(e=>e?e[1]:"").join(", "):""}};oH([eb({type:Boolean})],at.prototype,"focused",void 0),oH([eb()],at.prototype,"value",void 0),oH([eb({type:String})],at.prototype,"type",void 0),oH([eb({type:String})],at.prototype,"name",void 0),oH([eb({type:Boolean})],at.prototype,"readonly",void 0),oH([eb({type:Boolean})],at.prototype,"required",void 0),oH([eb()],at.prototype,"max",void 0),oH([eb()],at.prototype,"min",void 0),oH([eb({type:Number})],at.prototype,"step",void 0),oH([eb({type:Boolean})],at.prototype,"checked",void 0),oH([eb({type:Boolean})],at.prototype,"indeterminate",void 0),oH([eb({type:Number})],at.prototype,"maxLength",void 0),oH([eb({type:Number})],at.prototype,"minLength",void 0),oH([eb({type:Number})],at.prototype,"rows",void 0),oH([eb({type:Number})],at.prototype,"cols",void 0),oH([eb({type:Boolean})],at.prototype,"multiple",void 0),oH([eb({type:String,attribute:!0,reflect:!1})],at.prototype,"pattern",void 0),oH([eb({type:String})],at.prototype,"placeHolder",void 0),oH([eb({type:Array})],at.prototype,"options",void 0),oH([eb({type:Boolean})],at.prototype,"autoSelect",void 0),oH([eb({type:Object})],at.prototype,"searchProvider",void 0),oH([eb({type:String})],at.prototype,"searchLabel",void 0),oH([eb({type:String})],at.prototype,"icon",void 0),oH([eb({type:String})],at.prototype,"iconColor",void 0),oH([eb({type:String})],at.prototype,"iconOn",void 0),oH([eb({type:String})],at.prototype,"iconTrailing",void 0),oH([eb({type:Boolean})],at.prototype,"compact",void 0),oH([eb({type:Boolean})],at.prototype,"comfortable",void 0),oH([eb({type:Boolean})],at.prototype,"raised",void 0),oH([eb({type:Boolean})],at.prototype,"action",void 0),oH([eb({type:Boolean})],at.prototype,"unElevated",void 0),oH([eb({type:Boolean})],at.prototype,"outlined",void 0),oH([eb({type:Boolean})],at.prototype,"rounded",void 0),oH([eb({type:Object})],at.prototype,"format",void 0),oH([eb({type:Boolean})],at.prototype,"disableSliderNumberInput",void 0),oH([eb({type:Boolean})],at.prototype,"fullWidth",void 0),oH([eb({type:String})],at.prototype,"helperText",void 0),oH([eb({type:Boolean})],at.prototype,"helperPersistent",void 0),oH([eb({type:String,attribute:!0})],at.prototype,"validationMessage",void 0),oH([eb({type:Boolean})],at.prototype,"autoValidate",void 0),oH([eb({type:Boolean})],at.prototype,"charCounter",void 0),oH([eb({type:String})],at.prototype,"label",void 0),oH([eb({type:Boolean})],at.prototype,"disabled",void 0),oH([eb({type:Boolean})],at.prototype,"continuous",void 0),oH([eb({type:Boolean})],at.prototype,"resizeVertical",void 0),oH([eb({type:Boolean})],at.prototype,"censored",void 0),oH([eb({type:Boolean,reflect:!0})],at.prototype,"advertised",void 0),oH([e_()],at.prototype,"isUiValid",void 0),oH([e_()],at.prototype,"searchableValue",void 0),oH([e_()],at.prototype,"errorMessage",void 0),at=oH([ep("or-mwc-input")],at);let an=u`
|
|
612
612
|
|
|
613
613
|
/* https://codepen.io/finnhvman/pen/bmNdNr */
|
|
614
614
|
.pure-material-progress-circular {
|
|
@@ -621,7 +621,7 @@ uniform ${n} ${i} u_${r};
|
|
|
621
621
|
padding: 0.25em;
|
|
622
622
|
width: 3em;
|
|
623
623
|
height: 3em;
|
|
624
|
-
color: var(--or-app-color4, ${d(
|
|
624
|
+
color: var(--or-app-color4, ${d(iE)});
|
|
625
625
|
background-color: transparent;
|
|
626
626
|
font-size: 16px;
|
|
627
627
|
overflow: hidden;
|
|
@@ -728,7 +728,7 @@ uniform ${n} ${i} u_${r};
|
|
|
728
728
|
transform: rotate(225deg);
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
|
-
`;var
|
|
731
|
+
`;var ai=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let ar=class extends em{constructor(){super(...arguments),this.loadDom=!0,this.fadeContent=!1,this.loading=!1}static get styles(){return u`
|
|
732
732
|
:host {
|
|
733
733
|
display: block;
|
|
734
734
|
}
|
|
@@ -759,16 +759,16 @@ uniform ${n} ${i} u_${r};
|
|
|
759
759
|
${this.content||""}
|
|
760
760
|
</div>`:""}
|
|
761
761
|
</div>
|
|
762
|
-
`}};function ai(e,t,n){return{index:e,removed:t,addedCount:n}}at([eb({type:Number})],an.prototype,"loadingHeight",void 0),at([eb({type:Boolean})],an.prototype,"loadDom",void 0),at([eb({type:Boolean})],an.prototype,"fadeContent",void 0),at([eb({type:Boolean})],an.prototype,"loading",void 0),at([eb({type:Object,attribute:!1})],an.prototype,"content",void 0),an=at([ep("or-loading-wrapper")],an),window.JSCompiler_renameProperty=function(e,t){return e};let ar=0,ao=0,aa=[],as=0,al=!1,ac=document.createTextNode("");new window.MutationObserver(function(){al=!1;let e=aa.length;for(let t=0;t<e;t++){let e=aa[t];if(e)try{e()}catch(e){setTimeout(()=>{throw e})}}aa.splice(0,e),ao+=e}).observe(ac,{characterData:!0});let ad={run:e=>(al||(al=!0,ac.textContent=as++),aa.push(e),ar++),cancel(e){let t=e-ao;if(t>=0){if(!aa[t])throw Error("invalid async handle: "+e);aa[t]=null}}},au=window.ShadyDOM&&window.ShadyDOM.noPatch&&window.ShadyDOM.wrap?window.ShadyDOM.wrap:window.ShadyDOM?e=>ShadyDOM.patch(e):e=>e;function ah(e){return"slot"===e.localName}let am=class{static getFlattenedNodes(e){let t=au(e);return ah(e)?t.assignedNodes({flatten:!0}):Array.from(t.childNodes).map(e=>ah(e)?au(e).assignedNodes({flatten:!0}):[e]).reduce((e,t)=>e.concat(t),[])}constructor(e,t){this._shadyChildrenObserver=null,this._nativeChildrenObserver=null,this._connected=!1,this._target=e,this.callback=t,this._effectiveNodes=[],this._observer=null,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){ah(this._target)?this._listenSlots([this._target]):au(this._target).children&&(this._listenSlots(au(this._target).children),window.ShadyDOM?this._shadyChildrenObserver=window.ShadyDOM.observeChildren(this._target,e=>{this._processMutations(e)}):(this._nativeChildrenObserver=new MutationObserver(e=>{this._processMutations(e)}),this._nativeChildrenObserver.observe(this._target,{childList:!0}))),this._connected=!0}disconnect(){ah(this._target)?this._unlistenSlots([this._target]):au(this._target).children&&(this._unlistenSlots(au(this._target).children),window.ShadyDOM&&this._shadyChildrenObserver?(window.ShadyDOM.unobserveChildren(this._shadyChildrenObserver),this._shadyChildrenObserver=null):this._nativeChildrenObserver&&(this._nativeChildrenObserver.disconnect(),this._nativeChildrenObserver=null)),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,ad.run(()=>this.flush()))}_processMutations(e){this._processSlotMutations(e),this.flush()}_processSlotMutations(e){if(e)for(let t=0;t<e.length;t++){let n=e[t];n.addedNodes&&this._listenSlots(n.addedNodes),n.removedNodes&&this._unlistenSlots(n.removedNodes)}}flush(){var e;if(!this._connected)return!1;window.ShadyDOM&&ShadyDOM.flush(),this._nativeChildrenObserver?this._processSlotMutations(this._nativeChildrenObserver.takeRecords()):this._shadyChildrenObserver&&this._processSlotMutations(this._shadyChildrenObserver.takeRecords()),this._scheduled=!1;let t={target:this._target,addedNodes:[],removedNodes:[]},n=this.constructor.getFlattenedNodes(this._target),i=(e=this._effectiveNodes,function(e,t,n,i,r,o){let a,s=0,l=0,c=Math.min(n-t,o-r);if(0==t&&0==r&&(s=function(e,t,n){for(let r=0;r<n;r++){var i;if(i=e[r],i!==t[r])return r}return n}(e,i,c)),n==e.length&&o==i.length&&(l=function(e,t,n){var i;let r=e.length,o=t.length,a=0;for(;a<n&&(i=e[--r],i===t[--o]);)a++;return a}(e,i,c-s)),t+=s,r+=s,n-=l,o-=l,n-t==0&&o-r==0)return[];if(t==n){for(a=ai(t,[],0);r<o;)a.removed.push(i[r++]);return[a]}if(r==o)return[ai(t,[],n-t)];let d=function(e){let t=e.length-1,n=e[0].length-1,i=e[t][n],r=[];for(;t>0||n>0;){let o;if(0==t){r.push(2),n--;continue}if(0==n){r.push(3),t--;continue}let a=e[t-1][n-1],s=e[t-1][n],l=e[t][n-1];(o=s<l?s<a?s:a:l<a?l:a)==a?(a==i?r.push(0):(r.push(1),i=a),t--,n--):o==s?(r.push(3),t--,i=s):(r.push(2),n--,i=l)}return r.reverse(),r}(function(e,t,n,i,r,o){let a=o-r+1,s=n-t+1,l=Array(a);for(let e=0;e<a;e++)l[e]=Array(s),l[e][0]=e;for(let e=0;e<s;e++)l[0][e]=e;for(let n=1;n<a;n++)for(let o=1;o<s;o++){var c;if(c=e[t+o-1],c===i[r+n-1])l[n][o]=l[n-1][o-1];else{let e=l[n-1][o]+1,t=l[n][o-1]+1;l[n][o]=e<t?e:t}}return l}(e,t,n,i,r,o));a=void 0;let u=[],h=t,m=r;for(let e=0;e<d.length;e++)switch(d[e]){case 0:a&&(u.push(a),a=void 0),h++,m++;break;case 1:a||(a=ai(h,[],0)),a.addedCount++,h++,a.removed.push(i[m]),m++;break;case 2:a||(a=ai(h,[],0)),a.addedCount++,h++;break;case 3:a||(a=ai(h,[],0)),a.removed.push(i[m]),m++}return a&&u.push(a),u}(n,0,n.length,e,0,e.length));for(let e=0,n;e<i.length&&(n=i[e]);e++)for(let e=0,i;e<n.removed.length&&(i=n.removed[e]);e++)t.removedNodes.push(i);for(let e=0,r;e<i.length&&(r=i[e]);e++)for(let e=r.index;e<r.index+r.addedCount;e++)t.addedNodes.push(n[e]);this._effectiveNodes=n;let r=!1;return(t.addedNodes.length||t.removedNodes.length)&&(r=!0,this.callback.call(this._target,t)),r}_listenSlots(e){for(let t=0;t<e.length;t++){let n=e[t];ah(n)&&n.addEventListener("slotchange",this._boundSchedule)}}_unlistenSlots(e){for(let t=0;t<e.length;t++){let n=e[t];ah(n)&&n.removeEventListener("slotchange",this._boundSchedule)}}};var af=n(77266),ap=n.n(af),ag=n(19230),ab=n.n(ag);function a_(e){if(e){if(e instanceof af.LngLat)return e;if(e.lat)return e.lon?{lng:e.lon,lat:e.lat}:{lng:e.lng,lat:e.lat};if(Array.isArray(e))return{lng:e[0],lat:e[1]};if(e.coordinates&&Array.isArray(e.coordinates)&&e.coordinates.length>=2)return a_(e.coordinates);if(e.attributes){let t=e.attributes.location;return t&&t.value?a_(t.value):void 0}if(e.value)return a_(e.value)}}function ay(e,t){if(!e)return;let n="string"==typeof e?tY.getAssetDescriptor(e):e,i=n&&n.icon?n.icon:"help-circle",r=n&&n.colour?n.colour:void 0;if(t&&t.markerConfig){let e=t.markerConfig,n=t.currentValue;if("range"===e.type&&e.ranges&&"number"==typeof n){let t=e.ranges;r=(t.sort((e,t)=>t.min-e.min).find(e=>n>=e.min)||t.reduce((e,t)=>t.min>e.min?e:t)).colour||void 0}else"boolean"===e.type?r=e[!!n+""]:"string"===e.type&&(r=e[n+""])}return{color:r,icon:i}}function av(e){let t=e.match(/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/);if(!t)throw Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function ax(e,t){let n=av("https://api.mapbox.com");e.protocol=n.protocol,e.authority=n.authority,e.params.push(`access_token=${t}`);let i=e.params.length?`?${e.params.join("&")}`:"";return`${e.protocol}://${e.authority}${e.path}${i}`}n(14811);var aw=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})};let aF=n(77278),ak=n(64569),aE=n(14811);class aA{constructor(e,t,n,i=!1,r=!1,o=!0,a=!0){this._loaded=!1,this._markersJs=new Map,this._markersGl=new Map,this._geoJsonSources=[],this._geoJsonLayers=new Map,this._showGeoCodingControl=!1,this._showBoundaryBox=!1,this._useZoomControls=!0,this._showGeoJson=!0,this._clickHandlers=new Map,this._type=e,this._styleParent=t,this._mapContainer=n,this._showGeoCodingControl=i,this._showBoundaryBox=r,this._useZoomControls=o,this._showGeoJson=a}setCenter(e){switch(this._center=a_(e),this._type){case"RASTER":if(this._mapJs){let e=a_(this._center)||(this._viewSettings?a_(this._viewSettings.center):void 0);e&&this._mapJs.setView(e,void 0,{pan:{animate:!1},zoom:{animate:!1}})}break;case"VECTOR":this._mapGl&&this._center&&this._mapGl.setCenter(this._center)}return this}flyTo(e,t){switch(this._type){case"RASTER":this._mapJs;break;case"VECTOR":e||(e=this._center?this._center:this._viewSettings?this._viewSettings.center:void 0),t||(t=this._zoom?this._zoom:this._viewSettings&&this._viewSettings.zoom?this._viewSettings.zoom:void 0),this._mapGl?e&&this._mapGl.flyTo({center:e,zoom:t}):(this._center=e,this._zoom=t)}return this}resize(){switch(this._type){case"RASTER":this._mapJs;break;case"VECTOR":this._mapGl&&this._mapGl.resize()}return this}setZoom(e){switch(this._zoom=e,this._type){case"RASTER":this._mapJs&&this._zoom&&this._mapJs.setZoom(this._zoom,{animate:!1});break;case"VECTOR":this._mapGl&&this._zoom&&this._mapGl.setZoom(this._zoom)}return this}setControls(e){return this._controls=e,this._mapGl&&(this._controls?this._controls.forEach(e=>{Array.isArray(e)?this._mapGl.addControl(e[0],e[1]):this._mapGl.addControl(e)}):this._mapGl.addControl(new af.NavigationControl)),this}setGeoJson(e){var t;return this._geoJsonConfig=e,this._mapGl&&(this._geoJsonConfig?this.loadGeoJSON(this._geoJsonConfig):this.loadGeoJSON(null==(t=this._viewSettings)?void 0:t.geoJson)),this}loadViewSettings(){return aw(this,void 0,void 0,function*(){var e;let t=("RASTER"===this._type?yield iI.rest.api.MapResource.getSettingsJs():yield iI.rest.api.MapResource.getSettings()).data;if(t.override)return t.override;let n=iI.displayRealm||"default";return this._viewSettings=t.options?t.options[n]?t.options[n]:t.options.default:null,this._viewSettings&&(this._mapGl&&(this._mapGl.setMinZoom(this._viewSettings.minZoom),this._mapGl.setMaxZoom(this._viewSettings.maxZoom),this._viewSettings.bounds&&this._mapGl.setMaxBounds(this._viewSettings.bounds),this._geoJsonConfig?yield this.loadGeoJSON(this._geoJsonConfig):yield this.loadGeoJSON(null==(e=this._viewSettings)?void 0:e.geoJson)),this._center?this.setCenter(this._center):this.setCenter(this._viewSettings.center)),t})}load(){return aw(this,void 0,void 0,function*(){var t;if(!this._loaded){if("RASTER"===this._type){let e,t=document.createElement("style");t.id="mapboxJsStyle",t.textContent=aF,this._styleParent.appendChild(t);let n=yield this.loadViewSettings();if(this._viewSettings){if((e={}).zoom=this._viewSettings.zoom?this._viewSettings.zoom+1:void 0,this._useZoomControls&&(e.maxZoom=this._viewSettings.maxZoom?this._viewSettings.maxZoom-1:void 0,e.minZoom=this._viewSettings.minZoom?this._viewSettings.minZoom+1:void 0),e.boxZoom=this._viewSettings.boxZoom,this._viewSettings.bounds&&(e.maxBounds=function(e){let t=function(e){if(e){if(e instanceof af.LngLatBounds)return e;if(2===e.length){let t=a_(e[0]),n=a_(e[1]);if(t&&n)return new af.LngLatBounds(t,n)}if(4===e.length)return new af.LngLatBounds([e[0],e[1],e[2],e[3]])}}(e);if(t)return L.latLngBounds(t.getNorthEast(),t.getSouthWest())}(this._viewSettings.bounds)),this._viewSettings.center){let t=a_(this._viewSettings.center);e.center=t?L.latLng(t.lat,t.lng):void 0}if(this._center){let t=a_(this._center);e.center=t?L.latLng(t.lat,t.lng):void 0}this._zoom&&(e.zoom=this._zoom+1)}if(this._mapJs=L.mapbox.map(this._mapContainer,n,e),this._mapJs.on("click",e=>{this._onMapClick(e.latlng)}),e&&e.maxBounds){let t=this._mapJs.getBoundsZoom(e.maxBounds,!0);(!e.minZoom||e.minZoom<t)&&this._mapJs.setMinZoom(t)}}else{let i=document.createElement("style");i.id="maplibreGlStyle",i.textContent=ak,this._styleParent.appendChild(i),(i=document.createElement("style")).id="maplibreGeoCoderStyles",i.textContent=aE,this._styleParent.appendChild(i);let r=yield Promise.resolve().then(n.t.bind(n,77266,23)),o=yield this.loadViewSettings(),a={attributionControl:{compact:!0},container:this._mapContainer,style:o,transformRequest:(t,n)=>{var i,r,o,a,s,l,c,d,u;let h,m,f,p,g,b,_,y;return(e||(e=new URL(t).searchParams.get("access_token")||""),0===t.indexOf("mapbox:"))?(i=e,t.indexOf("/styles/")>-1&&-1===t.indexOf("/sprite")?{url:(r=t,o=i,(h=av(r)).path=`/styles/v1${h.path}`,ax(h,o))}:t.indexOf("/sprites/")>-1?{url:(a=t,s=i,p=(f=(m=av(a)).path.split("."))[0],g=f[1],b="",p.indexOf("@2x")&&(p=p.split("@2x")[0],b="@2x"),m.path=`/styles/v1${p}/sprite${b}.${g}`,ax(m,s))}:t.indexOf("/fonts/")>-1?{url:(l=t,c=i,(_=av(l)).path=`/fonts/v1${_.path}`,ax(_,c))}:t.indexOf("/v4/")>-1||"Source"===n?{url:(d=t,u=i,(y=av(d)).path=`/v4/${y.authority}.json`,y.params.push("secure"),ax(y,u))}:void 0):{headers:new URL(window.origin).hostname===new URL(t).hostname?{Authorization:iI.getAuthorizationHeader()}:{},url:t}}};if(this._viewSettings&&(this._useZoomControls&&(a.maxZoom=this._viewSettings.maxZoom,a.minZoom=this._viewSettings.minZoom),this._viewSettings.bounds&&!this._showBoundaryBox&&(a.maxBounds=this._viewSettings.bounds),a.boxZoom=this._viewSettings.boxZoom,a.zoom=this._viewSettings.zoom,a.center=this._viewSettings.center),this._center=this._center||(this._viewSettings?this._viewSettings.center:void 0),a.center=this._center,this._zoom&&(a.zoom=this._zoom),!this.isWebglSupported())return void console.warn("WebGL is not supported in this environment. The map cannot be initialized.");this._mapGl=new r.Map(a),yield this.styleLoaded(),this._mapGl.on("click",e=>{this._onMapClick(e.lngLat)}),this._mapGl.on("dblclick",e=>{this._onMapClick(e.lngLat,!0)}),this._showGeoCodingControl&&this._viewSettings&&this._viewSettings.geocodeUrl&&(this._geocoder=new(ab())({forwardGeocode:this._forwardGeocode.bind(this),reverseGeocode:this._reverseGeocode},{maplibregl:ap(),showResultsWhileTyping:!0}),this._geocoder._onKeyDown=(0,tG.debounce)(e=>{if(27===e.keyCode&&this._geocoder.options.clearAndBlurOnEsc)return this._geocoder._clear(e),this._geocoder._inputEl.blur();var t=this._geocoder._inputEl.value||e.key;if(!t)return this._geocoder.fresh=!0,9!==e.keyCode&&this._geocoder.clear(e),this._geocoder._clearEl.style.display="none";if(!e.metaKey&&-1===[9,27,37,39,38,40].indexOf(e.keyCode)){if(13===e.keyCode)if(this._geocoder.options.showResultsWhileTyping){this._geocoder.options.showResultMarkers&&this._geocoder._fitBoundsForMarkers(),this._geocoder._inputEl.value=this._geocoder._typeahead.query,this._geocoder.lastSelected=null,this._geocoder._typeahead.selected=null;return}else this._geocoder._typeahead.list.selectingListItem||this._geocoder._geocode(t);t.length>=this._geocoder.options.minLength&&this._geocoder.options.showResultsWhileTyping&&this._geocoder._geocode(t)}},300),this._mapGl.addControl(this._geocoder,"top-left"),this._geocoder._inputEl.addEventListener("change",()=>{var e=this._geocoder._typeahead.selected;this._onGeocodeChange(e)})),this._controls?this._controls.forEach(e=>{Array.isArray(e)?this._mapGl.addControl(e[0],e[1]):this._mapGl.addControl(e)}):(this._mapGl.addControl(new af.NavigationControl),this._mapGl.addControl(new af.GeolocateControl({positionOptions:{enableHighAccuracy:!0},showAccuracyCircle:!0,showUserLocation:!0}))),this._geoJsonConfig?yield this.loadGeoJSON(this._geoJsonConfig):yield this.loadGeoJSON(null==(t=this._viewSettings)?void 0:t.geoJson),this._initLongPressEvent()}this._mapContainer.dispatchEvent(new ld),this._loaded=!0,this.createBoundaryBox()}})}styleLoaded(){return new Promise(e=>{this._mapGl&&this._mapGl.once("style.load",()=>{e()})})}unload(){this._mapGl&&(this._mapGl.remove(),this._mapGl=void 0),this._mapJs&&(this._mapJs.remove(),this._mapJs=void 0)}_onMapClick(e,t=!1){this._mapContainer.dispatchEvent(new lu(e,t))}loadGeoJSON(e){return aw(this,void 0,void 0,function*(){if(this._geoJsonLayers.size>0&&(this._geoJsonLayers.forEach((e,t)=>this._mapGl.removeLayer(t)),this._geoJsonLayers=new Map),this._geoJsonSources.length>0&&(this._geoJsonSources.forEach(e=>this._mapGl.removeSource(e)),this._geoJsonSources=[]),this._showGeoJson&&e)if("FeatureCollection"==e.source.type){let t=this.groupSourcesByGeometryType(e.source);null==t||t.forEach((e,t)=>{let n=this.addGeoJSONSource({type:"geojson",data:{type:"FeatureCollection",features:e}});n&&this.addGeoJSONLayer(t,n.sourceId)})}else if("Feature"==e.source.type){let t=this.addGeoJSONSource(e.source);t&&this.addGeoJSONLayer(t.source.type,t.sourceId)}else console.error("Could not create layer since source type is neither 'FeatureCollection' nor 'Feature'.")})}groupSourcesByGeometryType(e){let t=new Map;return e.features.forEach(e=>{let n=t.get(e.geometry.type);void 0==n&&(n=[]),n.push(e),t.set(e.geometry.type,n)}),t}addGeoJSONSource(e){if(!this._mapGl)return void console.error("mapGl instance not found!");let t=Date.now()+"-"+(this._geoJsonSources.length+1);return this._mapGl.addSource(t,e),this._geoJsonSources.push(t),{source:e,sourceId:t}}addGeoJSONLayer(e,t){if(!this._mapGl)return void console.error("mapGl instance not found!");let n=t+"-"+e;if(void 0==this._geoJsonLayers.get(n)){let i=getComputedStyle(this._mapContainer).getPropertyValue("--or-app-color4");(void 0==i||0==i.length)&&(i=iF);let r={id:n,source:t};switch(e){case"Point":case"MultiPoint":r.type="circle",r.paint={"circle-radius":12,"circle-color":i},this._geoJsonLayers.set(n,r),this._mapGl.addLayer(r);break;case"LineString":case"MultiLineString":r.type="line",r.paint={"line-color":i,"line-width":4},this._geoJsonLayers.set(n,r),this._mapGl.addLayer(r);break;case"Polygon":case"MultiPolygon":{r.type="fill",r.paint={"fill-color":i,"fill-opacity":.3},this._geoJsonLayers.set(n,r),this._mapGl.addLayer(r);let e=n+"-outline",o={id:e,source:t,type:"line",paint:{"line-color":i,"line-width":2}};this._geoJsonLayers.set(e,o),this._mapGl.addLayer(o);break}case"GeometryCollection":return void console.error("GeometryCollection GeoJSON is not implemented yet!")}}}addMarker(e){e.hasPosition()&&this._updateMarkerElement(e,!0)}removeMarker(e){this._removeMarkerRadius(e),this._updateMarkerElement(e,!1)}onMarkerChanged(e,t){if(this._loaded)switch(t){case"lat":case"lng":case"radius":e.hasPosition()?e._actualMarkerElement?this._updateMarkerPosition(e):this._updateMarkerElement(e,!0):e._actualMarkerElement&&this._updateMarkerElement(e,!1)}}_updateMarkerPosition(e){switch(this._type){case"RASTER":let t=this._markersJs.get(e);t&&t.setLatLng([e.lat,e.lng]);break;case"VECTOR":let n=this._markersGl.get(e);n&&n.setLngLat([e.lng,e.lat])}this._createMarkerRadius(e)}_updateMarkerElement(e,t){switch(this._type){case"RASTER":let n=this._markersJs.get(e);if(n&&(this._removeMarkerClickHandler(e,e.markerContainer),e._actualMarkerElement=void 0,n.removeFrom(this._mapJs),this._markersJs.delete(e)),t){let t=e._createMarkerElement();if(t){let i=L.divIcon({html:t.outerHTML,className:"or-marker-raster"});(n=L.marker([e.lat,e.lng],{icon:i,clickable:e.interactive})).addTo(this._mapJs),e._actualMarkerElement=n.getElement()?n.getElement().firstElementChild:void 0,e.interactive&&this._addMarkerClickHandler(e,e.markerContainer),this._markersJs.set(e,n)}e.radius&&this._createMarkerRadius(e)}break;case"VECTOR":let i=this._markersGl.get(e);if(i&&(e._actualMarkerElement=void 0,this._removeMarkerClickHandler(e,i.getElement()),i.remove(),this._markersGl.delete(e)),t){let t=e._createMarkerElement();t&&(i=new af.Marker({element:t,anchor:"top-left"}).setLngLat([e.lng,e.lat]).addTo(this._mapGl),this._markersGl.set(e,i),e._actualMarkerElement=i.getElement(),e.interactive&&this._addMarkerClickHandler(e,i.getElement())),e.radius&&this._createMarkerRadius(e)}}}_removeMarkerRadius(e){this._mapGl&&this._loaded&&e.radius&&e.lat&&e.lng&&this._mapGl.getSource("circleData")&&(this._mapGl.removeLayer("marker-radius-circle"),this._mapGl.removeSource("circleData"))}_createMarkerRadius(e){this._mapGl&&this._loaded&&e.radius&&e.lat&&e.lng&&(this._removeMarkerRadius(e),this._mapGl.addSource("circleData",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[e.lng,e.lat]},properties:{title:"You Found Me"}}]}}),this._mapGl.addLayer({id:"marker-radius-circle",type:"circle",source:"circleData",paint:{"circle-radius":["interpolate",["linear"],["zoom"],0,0,20,e.radius/.075/Math.cos(e.lat*Math.PI/180)],"circle-color":"red","circle-opacity":.3}}))}createBoundaryBox(e=[]){var t,n;if(this._mapGl&&this._loaded&&this._showBoundaryBox&&(null==(t=this._viewSettings)?void 0:t.bounds)){this._mapGl.getSource("bounds")&&(this._mapGl.removeLayer("bounds"),this._mapGl.removeSource("bounds")),4!==e.length&&(e=null==(n=this._viewSettings)?void 0:n.bounds.toString().split(","));var i=[[[e[0],e[3]],[e[2],e[3]],[e[2],e[1]],[e[0],e[1]],[e[0],e[3]]]];this._mapGl.fitBounds([parseFloat(e[0])+.01,parseFloat(e[1])-.01,parseFloat(e[2])-.01,parseFloat(e[3])+.01]),this._mapGl.addSource("bounds",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:i}}}),this._mapGl.addLayer({id:"bounds",type:"fill",source:"bounds",paint:{"fill-color":"#FF0000","fill-opacity":.4}})}}_addMarkerClickHandler(e,t){if(t){let n=t=>{t.stopPropagation(),e._onClick(t)};this._clickHandlers.set(e,n),t.addEventListener("click",n)}}_removeMarkerClickHandler(e,t){let n=this._clickHandlers.get(e);n&&t&&(t.removeEventListener("click",n),this._clickHandlers.delete(e))}_forwardGeocode(e){return aw(this,void 0,void 0,function*(){let t=[];try{let n=this._viewSettings.geocodeUrl+"/search?q="+e.query+"&format=geojson&polygon_geojson=1&addressdetails=1",i=yield fetch(n);for(let e of(yield i.json()).features){let n=[e.bbox[0]+(e.bbox[2]-e.bbox[0])/2,e.bbox[1]+(e.bbox[3]-e.bbox[1])/2],i={type:"Feature",geometry:{type:"Point",coordinates:n},place_name:e.properties.display_name,properties:e.properties,text:e.properties.display_name,place_type:["place"],center:n};t.push(i)}}catch(e){console.error(`Failed to forwardGeocode with error: ${e}`)}return{features:t}})}_reverseGeocode(e){return aw(this,void 0,void 0,function*(){let t=[];try{let n=this._viewSettings.geocodeUrl+"/reverse?lat="+e.lat+"&lon="+e.lon+"&format=geojson&polygon_geojson=1&addressdetails=1",i=yield fetch(n);for(let e of(yield i.json()).features){let n=[e.bbox[0]+(e.bbox[2]-e.bbox[0])/2,e.bbox[1]+(e.bbox[3]-e.bbox[1])/2],i={type:"Feature",geometry:{type:"Point",coordinates:n},place_name:e.properties.display_name,properties:e.properties,text:e.properties.display_name,place_type:["place"],center:n};t.push(i)}}catch(e){console.error(`Failed to reverseGeocode with error: ${e}`)}return{features:t}})}_initLongPressEvent(){if(this._mapGl){let e,t,n=()=>{e&&clearTimeout(e),e=null};this._mapGl.on("touchstart",n=>{n.originalEvent.touches.length>1||(t=n.lngLat,e=setTimeout(()=>{this._onLongPress(t)},500))}),this._mapGl.on("mousedown",n=>{e||(t=n.lngLat,e=setTimeout(()=>{this._onLongPress(t),e=null},500))}),this._mapGl.on("dragstart",n),this._mapGl.on("mouseup",n),this._mapGl.on("touchend",n),this._mapGl.on("touchcancel",n),this._mapGl.on("touchmove",n),this._mapGl.on("moveend",n),this._mapGl.on("gesturestart",n),this._mapGl.on("gesturechange",n),this._mapGl.on("gestureend",n)}}_onLongPress(e){this._mapContainer.dispatchEvent(new lh(e))}_onGeocodeChange(e){this._mapContainer.dispatchEvent(new lm(e))}isWebglSupported(){if(window.WebGLRenderingContext){let e=document.createElement("canvas");try{let t=e.getContext("webgl2")||e.getContext("webgl");if(t&&"function"==typeof t.getParameter)return!0}catch(e){}}return!1}}let aC="--internal-or-map-marker-color",aT="--internal-or-map-marker-active-color",aS=u`
|
|
762
|
+
`}};function ao(e,t,n){return{index:e,removed:t,addedCount:n}}ai([eb({type:Number})],ar.prototype,"loadingHeight",void 0),ai([eb({type:Boolean})],ar.prototype,"loadDom",void 0),ai([eb({type:Boolean})],ar.prototype,"fadeContent",void 0),ai([eb({type:Boolean})],ar.prototype,"loading",void 0),ai([eb({type:Object,attribute:!1})],ar.prototype,"content",void 0),ar=ai([ep("or-loading-wrapper")],ar),window.JSCompiler_renameProperty=function(e,t){return e};let aa=0,as=0,al=[],ac=0,ad=!1,au=document.createTextNode("");new window.MutationObserver(function(){ad=!1;let e=al.length;for(let t=0;t<e;t++){let e=al[t];if(e)try{e()}catch(e){setTimeout(()=>{throw e})}}al.splice(0,e),as+=e}).observe(au,{characterData:!0});let ah={run:e=>(ad||(ad=!0,au.textContent=ac++),al.push(e),aa++),cancel(e){let t=e-as;if(t>=0){if(!al[t])throw Error("invalid async handle: "+e);al[t]=null}}},am=window.ShadyDOM&&window.ShadyDOM.noPatch&&window.ShadyDOM.wrap?window.ShadyDOM.wrap:window.ShadyDOM?e=>ShadyDOM.patch(e):e=>e;function af(e){return"slot"===e.localName}let ap=class{static getFlattenedNodes(e){let t=am(e);return af(e)?t.assignedNodes({flatten:!0}):Array.from(t.childNodes).map(e=>af(e)?am(e).assignedNodes({flatten:!0}):[e]).reduce((e,t)=>e.concat(t),[])}constructor(e,t){this._shadyChildrenObserver=null,this._nativeChildrenObserver=null,this._connected=!1,this._target=e,this.callback=t,this._effectiveNodes=[],this._observer=null,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){af(this._target)?this._listenSlots([this._target]):am(this._target).children&&(this._listenSlots(am(this._target).children),window.ShadyDOM?this._shadyChildrenObserver=window.ShadyDOM.observeChildren(this._target,e=>{this._processMutations(e)}):(this._nativeChildrenObserver=new MutationObserver(e=>{this._processMutations(e)}),this._nativeChildrenObserver.observe(this._target,{childList:!0}))),this._connected=!0}disconnect(){af(this._target)?this._unlistenSlots([this._target]):am(this._target).children&&(this._unlistenSlots(am(this._target).children),window.ShadyDOM&&this._shadyChildrenObserver?(window.ShadyDOM.unobserveChildren(this._shadyChildrenObserver),this._shadyChildrenObserver=null):this._nativeChildrenObserver&&(this._nativeChildrenObserver.disconnect(),this._nativeChildrenObserver=null)),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,ah.run(()=>this.flush()))}_processMutations(e){this._processSlotMutations(e),this.flush()}_processSlotMutations(e){if(e)for(let t=0;t<e.length;t++){let n=e[t];n.addedNodes&&this._listenSlots(n.addedNodes),n.removedNodes&&this._unlistenSlots(n.removedNodes)}}flush(){var e;if(!this._connected)return!1;window.ShadyDOM&&ShadyDOM.flush(),this._nativeChildrenObserver?this._processSlotMutations(this._nativeChildrenObserver.takeRecords()):this._shadyChildrenObserver&&this._processSlotMutations(this._shadyChildrenObserver.takeRecords()),this._scheduled=!1;let t={target:this._target,addedNodes:[],removedNodes:[]},n=this.constructor.getFlattenedNodes(this._target),i=(e=this._effectiveNodes,function(e,t,n,i,r,o){let a,s=0,l=0,c=Math.min(n-t,o-r);if(0==t&&0==r&&(s=function(e,t,n){for(let r=0;r<n;r++){var i;if(i=e[r],i!==t[r])return r}return n}(e,i,c)),n==e.length&&o==i.length&&(l=function(e,t,n){var i;let r=e.length,o=t.length,a=0;for(;a<n&&(i=e[--r],i===t[--o]);)a++;return a}(e,i,c-s)),t+=s,r+=s,n-=l,o-=l,n-t==0&&o-r==0)return[];if(t==n){for(a=ao(t,[],0);r<o;)a.removed.push(i[r++]);return[a]}if(r==o)return[ao(t,[],n-t)];let d=function(e){let t=e.length-1,n=e[0].length-1,i=e[t][n],r=[];for(;t>0||n>0;){let o;if(0==t){r.push(2),n--;continue}if(0==n){r.push(3),t--;continue}let a=e[t-1][n-1],s=e[t-1][n],l=e[t][n-1];(o=s<l?s<a?s:a:l<a?l:a)==a?(a==i?r.push(0):(r.push(1),i=a),t--,n--):o==s?(r.push(3),t--,i=s):(r.push(2),n--,i=l)}return r.reverse(),r}(function(e,t,n,i,r,o){let a=o-r+1,s=n-t+1,l=Array(a);for(let e=0;e<a;e++)l[e]=Array(s),l[e][0]=e;for(let e=0;e<s;e++)l[0][e]=e;for(let n=1;n<a;n++)for(let o=1;o<s;o++){var c;if(c=e[t+o-1],c===i[r+n-1])l[n][o]=l[n-1][o-1];else{let e=l[n-1][o]+1,t=l[n][o-1]+1;l[n][o]=e<t?e:t}}return l}(e,t,n,i,r,o));a=void 0;let u=[],h=t,m=r;for(let e=0;e<d.length;e++)switch(d[e]){case 0:a&&(u.push(a),a=void 0),h++,m++;break;case 1:a||(a=ao(h,[],0)),a.addedCount++,h++,a.removed.push(i[m]),m++;break;case 2:a||(a=ao(h,[],0)),a.addedCount++,h++;break;case 3:a||(a=ao(h,[],0)),a.removed.push(i[m]),m++}return a&&u.push(a),u}(n,0,n.length,e,0,e.length));for(let e=0,n;e<i.length&&(n=i[e]);e++)for(let e=0,i;e<n.removed.length&&(i=n.removed[e]);e++)t.removedNodes.push(i);for(let e=0,r;e<i.length&&(r=i[e]);e++)for(let e=r.index;e<r.index+r.addedCount;e++)t.addedNodes.push(n[e]);this._effectiveNodes=n;let r=!1;return(t.addedNodes.length||t.removedNodes.length)&&(r=!0,this.callback.call(this._target,t)),r}_listenSlots(e){for(let t=0;t<e.length;t++){let n=e[t];af(n)&&n.addEventListener("slotchange",this._boundSchedule)}}_unlistenSlots(e){for(let t=0;t<e.length;t++){let n=e[t];af(n)&&n.removeEventListener("slotchange",this._boundSchedule)}}};var ag=n(77266),ab=n.n(ag),a_=n(19230),ay=n.n(a_);function av(e){if(e){if(e instanceof ag.LngLat)return e;if(e.lat)return e.lon?{lng:e.lon,lat:e.lat}:{lng:e.lng,lat:e.lat};if(Array.isArray(e))return{lng:e[0],lat:e[1]};if(e.coordinates&&Array.isArray(e.coordinates)&&e.coordinates.length>=2)return av(e.coordinates);if(e.attributes){let t=e.attributes.location;return t&&t.value?av(t.value):void 0}if(e.value)return av(e.value)}}function ax(e,t){if(!e)return;let n="string"==typeof e?tY.getAssetDescriptor(e):e,i=n&&n.icon?n.icon:"help-circle",r=n&&n.colour?n.colour:void 0;if(t&&t.markerConfig){let e=t.markerConfig,n=t.currentValue;if("range"===e.type&&e.ranges&&"number"==typeof n){let t=e.ranges;r=(t.sort((e,t)=>t.min-e.min).find(e=>n>=e.min)||t.reduce((e,t)=>t.min>e.min?e:t)).colour||void 0}else"boolean"===e.type?r=e[!!n+""]:"string"===e.type&&(r=e[n+""])}return{color:r,icon:i}}function aw(e){let t=e.match(/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/);if(!t)throw Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function aF(e,t){let n=aw("https://api.mapbox.com");e.protocol=n.protocol,e.authority=n.authority,e.params.push(`access_token=${t}`);let i=e.params.length?`?${e.params.join("&")}`:"";return`${e.protocol}://${e.authority}${e.path}${i}`}n(14811);var ak=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})};let aE=n(77278),aA=n(64569),aC=n(14811);class aT{constructor(e,t,n,i=!1,r=!1,o=!0,a=!0){this._loaded=!1,this._markersJs=new Map,this._markersGl=new Map,this._geoJsonSources=[],this._geoJsonLayers=new Map,this._showGeoCodingControl=!1,this._showBoundaryBox=!1,this._useZoomControls=!0,this._showGeoJson=!0,this._clickHandlers=new Map,this._type=e,this._styleParent=t,this._mapContainer=n,this._showGeoCodingControl=i,this._showBoundaryBox=r,this._useZoomControls=o,this._showGeoJson=a}setCenter(e){switch(this._center=av(e),this._type){case"RASTER":if(this._mapJs){let e=av(this._center)||(this._viewSettings?av(this._viewSettings.center):void 0);e&&this._mapJs.setView(e,void 0,{pan:{animate:!1},zoom:{animate:!1}})}break;case"VECTOR":this._mapGl&&this._center&&this._mapGl.setCenter(this._center)}return this}flyTo(e,t){switch(this._type){case"RASTER":this._mapJs;break;case"VECTOR":e||(e=this._center?this._center:this._viewSettings?this._viewSettings.center:void 0),t||(t=this._zoom?this._zoom:this._viewSettings&&this._viewSettings.zoom?this._viewSettings.zoom:void 0),this._mapGl?e&&this._mapGl.flyTo({center:e,zoom:t}):(this._center=e,this._zoom=t)}return this}resize(){switch(this._type){case"RASTER":this._mapJs;break;case"VECTOR":this._mapGl&&this._mapGl.resize()}return this}setZoom(e){switch(this._zoom=e,this._type){case"RASTER":this._mapJs&&this._zoom&&this._mapJs.setZoom(this._zoom,{animate:!1});break;case"VECTOR":this._mapGl&&this._zoom&&this._mapGl.setZoom(this._zoom)}return this}setControls(e){return this._controls=e,this._mapGl&&(this._controls?this._controls.forEach(e=>{Array.isArray(e)?this._mapGl.addControl(e[0],e[1]):this._mapGl.addControl(e)}):this._mapGl.addControl(new ag.NavigationControl)),this}setGeoJson(e){var t;return this._geoJsonConfig=e,this._mapGl&&(this._geoJsonConfig?this.loadGeoJSON(this._geoJsonConfig):this.loadGeoJSON(null==(t=this._viewSettings)?void 0:t.geoJson)),this}loadViewSettings(){return ak(this,void 0,void 0,function*(){var e;let t=("RASTER"===this._type?yield iO.rest.api.MapResource.getSettingsJs():yield iO.rest.api.MapResource.getSettings()).data;if(t.override)return t.override;let n=iO.displayRealm||"default";return this._viewSettings=t.options?t.options[n]?t.options[n]:t.options.default:null,this._viewSettings&&(this._mapGl&&(this._mapGl.setMinZoom(this._viewSettings.minZoom),this._mapGl.setMaxZoom(this._viewSettings.maxZoom),this._viewSettings.bounds&&this._mapGl.setMaxBounds(this._viewSettings.bounds),this._geoJsonConfig?yield this.loadGeoJSON(this._geoJsonConfig):yield this.loadGeoJSON(null==(e=this._viewSettings)?void 0:e.geoJson)),this._center?this.setCenter(this._center):this.setCenter(this._viewSettings.center)),t})}load(){return ak(this,void 0,void 0,function*(){var t;if(!this._loaded){if("RASTER"===this._type){let e,t=document.createElement("style");t.id="mapboxJsStyle",t.textContent=aE,this._styleParent.appendChild(t);let n=yield this.loadViewSettings();if(this._viewSettings){if((e={}).zoom=this._viewSettings.zoom?this._viewSettings.zoom+1:void 0,this._useZoomControls&&(e.maxZoom=this._viewSettings.maxZoom?this._viewSettings.maxZoom-1:void 0,e.minZoom=this._viewSettings.minZoom?this._viewSettings.minZoom+1:void 0),e.boxZoom=this._viewSettings.boxZoom,this._viewSettings.bounds&&(e.maxBounds=function(e){let t=function(e){if(e){if(e instanceof ag.LngLatBounds)return e;if(2===e.length){let t=av(e[0]),n=av(e[1]);if(t&&n)return new ag.LngLatBounds(t,n)}if(4===e.length)return new ag.LngLatBounds([e[0],e[1],e[2],e[3]])}}(e);if(t)return L.latLngBounds(t.getNorthEast(),t.getSouthWest())}(this._viewSettings.bounds)),this._viewSettings.center){let t=av(this._viewSettings.center);e.center=t?L.latLng(t.lat,t.lng):void 0}if(this._center){let t=av(this._center);e.center=t?L.latLng(t.lat,t.lng):void 0}this._zoom&&(e.zoom=this._zoom+1)}if(this._mapJs=L.mapbox.map(this._mapContainer,n,e),this._mapJs.on("click",e=>{this._onMapClick(e.latlng)}),e&&e.maxBounds){let t=this._mapJs.getBoundsZoom(e.maxBounds,!0);(!e.minZoom||e.minZoom<t)&&this._mapJs.setMinZoom(t)}}else{let i=document.createElement("style");i.id="maplibreGlStyle",i.textContent=aA,this._styleParent.appendChild(i),(i=document.createElement("style")).id="maplibreGeoCoderStyles",i.textContent=aC,this._styleParent.appendChild(i);let r=yield Promise.resolve().then(n.t.bind(n,77266,23)),o=yield this.loadViewSettings(),a={attributionControl:{compact:!0},container:this._mapContainer,style:o,transformRequest:(t,n)=>{var i,r,o,a,s,l,c,d,u;let h,m,f,p,g,b,_,y;return(e||(e=new URL(t).searchParams.get("access_token")||""),0===t.indexOf("mapbox:"))?(i=e,t.indexOf("/styles/")>-1&&-1===t.indexOf("/sprite")?{url:(r=t,o=i,(h=aw(r)).path=`/styles/v1${h.path}`,aF(h,o))}:t.indexOf("/sprites/")>-1?{url:(a=t,s=i,p=(f=(m=aw(a)).path.split("."))[0],g=f[1],b="",p.indexOf("@2x")&&(p=p.split("@2x")[0],b="@2x"),m.path=`/styles/v1${p}/sprite${b}.${g}`,aF(m,s))}:t.indexOf("/fonts/")>-1?{url:(l=t,c=i,(_=aw(l)).path=`/fonts/v1${_.path}`,aF(_,c))}:t.indexOf("/v4/")>-1||"Source"===n?{url:(d=t,u=i,(y=aw(d)).path=`/v4/${y.authority}.json`,y.params.push("secure"),aF(y,u))}:void 0):{headers:new URL(window.origin).hostname===new URL(t).hostname?{Authorization:iO.getAuthorizationHeader()}:{},url:t}}};if(this._viewSettings&&(this._useZoomControls&&(a.maxZoom=this._viewSettings.maxZoom,a.minZoom=this._viewSettings.minZoom),this._viewSettings.bounds&&!this._showBoundaryBox&&(a.maxBounds=this._viewSettings.bounds),a.boxZoom=this._viewSettings.boxZoom,a.zoom=this._viewSettings.zoom,a.center=this._viewSettings.center),this._center=this._center||(this._viewSettings?this._viewSettings.center:void 0),a.center=this._center,this._zoom&&(a.zoom=this._zoom),!this.isWebglSupported())return void console.warn("WebGL is not supported in this environment. The map cannot be initialized.");this._mapGl=new r.Map(a),yield this.styleLoaded(),this._mapGl.on("click",e=>{this._onMapClick(e.lngLat)}),this._mapGl.on("dblclick",e=>{this._onMapClick(e.lngLat,!0)}),this._showGeoCodingControl&&this._viewSettings&&this._viewSettings.geocodeUrl&&(this._geocoder=new(ay())({forwardGeocode:this._forwardGeocode.bind(this),reverseGeocode:this._reverseGeocode},{maplibregl:ab(),showResultsWhileTyping:!0}),this._geocoder._onKeyDown=(0,tG.debounce)(e=>{if(27===e.keyCode&&this._geocoder.options.clearAndBlurOnEsc)return this._geocoder._clear(e),this._geocoder._inputEl.blur();var t=this._geocoder._inputEl.value||e.key;if(!t)return this._geocoder.fresh=!0,9!==e.keyCode&&this._geocoder.clear(e),this._geocoder._clearEl.style.display="none";if(!e.metaKey&&-1===[9,27,37,39,38,40].indexOf(e.keyCode)){if(13===e.keyCode)if(this._geocoder.options.showResultsWhileTyping){this._geocoder.options.showResultMarkers&&this._geocoder._fitBoundsForMarkers(),this._geocoder._inputEl.value=this._geocoder._typeahead.query,this._geocoder.lastSelected=null,this._geocoder._typeahead.selected=null;return}else this._geocoder._typeahead.list.selectingListItem||this._geocoder._geocode(t);t.length>=this._geocoder.options.minLength&&this._geocoder.options.showResultsWhileTyping&&this._geocoder._geocode(t)}},300),this._mapGl.addControl(this._geocoder,"top-left"),this._geocoder._inputEl.addEventListener("change",()=>{var e=this._geocoder._typeahead.selected;this._onGeocodeChange(e)})),this._controls?this._controls.forEach(e=>{Array.isArray(e)?this._mapGl.addControl(e[0],e[1]):this._mapGl.addControl(e)}):(this._mapGl.addControl(new ag.NavigationControl),this._mapGl.addControl(new ag.GeolocateControl({positionOptions:{enableHighAccuracy:!0},showAccuracyCircle:!0,showUserLocation:!0}))),this._geoJsonConfig?yield this.loadGeoJSON(this._geoJsonConfig):yield this.loadGeoJSON(null==(t=this._viewSettings)?void 0:t.geoJson),this._initLongPressEvent()}this._mapContainer.dispatchEvent(new lf),this._loaded=!0,this.createBoundaryBox()}})}styleLoaded(){return new Promise(e=>{this._mapGl&&this._mapGl.once("style.load",()=>{e()})})}unload(){this._mapGl&&(this._mapGl.remove(),this._mapGl=void 0),this._mapJs&&(this._mapJs.remove(),this._mapJs=void 0)}_onMapClick(e,t=!1){this._mapContainer.dispatchEvent(new lp(e,t))}loadGeoJSON(e){return ak(this,void 0,void 0,function*(){if(this._geoJsonLayers.size>0&&(this._geoJsonLayers.forEach((e,t)=>this._mapGl.removeLayer(t)),this._geoJsonLayers=new Map),this._geoJsonSources.length>0&&(this._geoJsonSources.forEach(e=>this._mapGl.removeSource(e)),this._geoJsonSources=[]),this._showGeoJson&&e)if("FeatureCollection"==e.source.type){let t=this.groupSourcesByGeometryType(e.source);null==t||t.forEach((e,t)=>{let n=this.addGeoJSONSource({type:"geojson",data:{type:"FeatureCollection",features:e}});n&&this.addGeoJSONLayer(t,n.sourceId)})}else if("Feature"==e.source.type){let t=this.addGeoJSONSource(e.source);t&&this.addGeoJSONLayer(t.source.type,t.sourceId)}else console.error("Could not create layer since source type is neither 'FeatureCollection' nor 'Feature'.")})}groupSourcesByGeometryType(e){let t=new Map;return e.features.forEach(e=>{let n=t.get(e.geometry.type);void 0==n&&(n=[]),n.push(e),t.set(e.geometry.type,n)}),t}addGeoJSONSource(e){if(!this._mapGl)return void console.error("mapGl instance not found!");let t=Date.now()+"-"+(this._geoJsonSources.length+1);return this._mapGl.addSource(t,e),this._geoJsonSources.push(t),{source:e,sourceId:t}}addGeoJSONLayer(e,t){if(!this._mapGl)return void console.error("mapGl instance not found!");let n=t+"-"+e;if(void 0==this._geoJsonLayers.get(n)){let i=getComputedStyle(this._mapContainer).getPropertyValue("--or-app-color4");(void 0==i||0==i.length)&&(i=iE);let r={id:n,source:t};switch(e){case"Point":case"MultiPoint":r.type="circle",r.paint={"circle-radius":12,"circle-color":i},this._geoJsonLayers.set(n,r),this._mapGl.addLayer(r);break;case"LineString":case"MultiLineString":r.type="line",r.paint={"line-color":i,"line-width":4},this._geoJsonLayers.set(n,r),this._mapGl.addLayer(r);break;case"Polygon":case"MultiPolygon":{r.type="fill",r.paint={"fill-color":i,"fill-opacity":.3},this._geoJsonLayers.set(n,r),this._mapGl.addLayer(r);let e=n+"-outline",o={id:e,source:t,type:"line",paint:{"line-color":i,"line-width":2}};this._geoJsonLayers.set(e,o),this._mapGl.addLayer(o);break}case"GeometryCollection":return void console.error("GeometryCollection GeoJSON is not implemented yet!")}}}addMarker(e){e.hasPosition()&&this._updateMarkerElement(e,!0)}removeMarker(e){this._removeMarkerRadius(e),this._updateMarkerElement(e,!1)}onMarkerChanged(e,t){if(this._loaded)switch(t){case"lat":case"lng":case"radius":e.hasPosition()?e._actualMarkerElement?this._updateMarkerPosition(e):this._updateMarkerElement(e,!0):e._actualMarkerElement&&this._updateMarkerElement(e,!1)}}_updateMarkerPosition(e){switch(this._type){case"RASTER":let t=this._markersJs.get(e);t&&t.setLatLng([e.lat,e.lng]);break;case"VECTOR":let n=this._markersGl.get(e);n&&n.setLngLat([e.lng,e.lat])}this._createMarkerRadius(e)}_updateMarkerElement(e,t){switch(this._type){case"RASTER":let n=this._markersJs.get(e);if(n&&(this._removeMarkerClickHandler(e,e.markerContainer),e._actualMarkerElement=void 0,n.removeFrom(this._mapJs),this._markersJs.delete(e)),t){let t=e._createMarkerElement();if(t){let i=L.divIcon({html:t.outerHTML,className:"or-marker-raster"});(n=L.marker([e.lat,e.lng],{icon:i,clickable:e.interactive})).addTo(this._mapJs),e._actualMarkerElement=n.getElement()?n.getElement().firstElementChild:void 0,e.interactive&&this._addMarkerClickHandler(e,e.markerContainer),this._markersJs.set(e,n)}e.radius&&this._createMarkerRadius(e)}break;case"VECTOR":let i=this._markersGl.get(e);if(i&&(e._actualMarkerElement=void 0,this._removeMarkerClickHandler(e,i.getElement()),i.remove(),this._markersGl.delete(e)),t){let t=e._createMarkerElement();t&&(i=new ag.Marker({element:t,anchor:"top-left"}).setLngLat([e.lng,e.lat]).addTo(this._mapGl),this._markersGl.set(e,i),e._actualMarkerElement=i.getElement(),e.interactive&&this._addMarkerClickHandler(e,i.getElement())),e.radius&&this._createMarkerRadius(e)}}}_removeMarkerRadius(e){this._mapGl&&this._loaded&&e.radius&&e.lat&&e.lng&&this._mapGl.getSource("circleData")&&(this._mapGl.removeLayer("marker-radius-circle"),this._mapGl.removeSource("circleData"))}_createMarkerRadius(e){this._mapGl&&this._loaded&&e.radius&&e.lat&&e.lng&&(this._removeMarkerRadius(e),this._mapGl.addSource("circleData",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[e.lng,e.lat]},properties:{title:"You Found Me"}}]}}),this._mapGl.addLayer({id:"marker-radius-circle",type:"circle",source:"circleData",paint:{"circle-radius":["interpolate",["linear"],["zoom"],0,0,20,e.radius/.075/Math.cos(e.lat*Math.PI/180)],"circle-color":"red","circle-opacity":.3}}))}createBoundaryBox(e=[]){var t,n;if(this._mapGl&&this._loaded&&this._showBoundaryBox&&(null==(t=this._viewSettings)?void 0:t.bounds)){this._mapGl.getSource("bounds")&&(this._mapGl.removeLayer("bounds"),this._mapGl.removeSource("bounds")),4!==e.length&&(e=null==(n=this._viewSettings)?void 0:n.bounds.toString().split(","));var i=[[[e[0],e[3]],[e[2],e[3]],[e[2],e[1]],[e[0],e[1]],[e[0],e[3]]]];this._mapGl.fitBounds([parseFloat(e[0])+.01,parseFloat(e[1])-.01,parseFloat(e[2])-.01,parseFloat(e[3])+.01]),this._mapGl.addSource("bounds",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:i}}}),this._mapGl.addLayer({id:"bounds",type:"fill",source:"bounds",paint:{"fill-color":"#FF0000","fill-opacity":.4}})}}_addMarkerClickHandler(e,t){if(t){let n=t=>{t.stopPropagation(),e._onClick(t)};this._clickHandlers.set(e,n),t.addEventListener("click",n)}}_removeMarkerClickHandler(e,t){let n=this._clickHandlers.get(e);n&&t&&(t.removeEventListener("click",n),this._clickHandlers.delete(e))}_forwardGeocode(e){return ak(this,void 0,void 0,function*(){let t=[];try{let n=this._viewSettings.geocodeUrl+"/search?q="+e.query+"&format=geojson&polygon_geojson=1&addressdetails=1",i=yield fetch(n);for(let e of(yield i.json()).features){let n=[e.bbox[0]+(e.bbox[2]-e.bbox[0])/2,e.bbox[1]+(e.bbox[3]-e.bbox[1])/2],i={type:"Feature",geometry:{type:"Point",coordinates:n},place_name:e.properties.display_name,properties:e.properties,text:e.properties.display_name,place_type:["place"],center:n};t.push(i)}}catch(e){console.error(`Failed to forwardGeocode with error: ${e}`)}return{features:t}})}_reverseGeocode(e){return ak(this,void 0,void 0,function*(){let t=[];try{let n=this._viewSettings.geocodeUrl+"/reverse?lat="+e.lat+"&lon="+e.lon+"&format=geojson&polygon_geojson=1&addressdetails=1",i=yield fetch(n);for(let e of(yield i.json()).features){let n=[e.bbox[0]+(e.bbox[2]-e.bbox[0])/2,e.bbox[1]+(e.bbox[3]-e.bbox[1])/2],i={type:"Feature",geometry:{type:"Point",coordinates:n},place_name:e.properties.display_name,properties:e.properties,text:e.properties.display_name,place_type:["place"],center:n};t.push(i)}}catch(e){console.error(`Failed to reverseGeocode with error: ${e}`)}return{features:t}})}_initLongPressEvent(){if(this._mapGl){let e,t,n=()=>{e&&clearTimeout(e),e=null};this._mapGl.on("touchstart",n=>{n.originalEvent.touches.length>1||(t=n.lngLat,e=setTimeout(()=>{this._onLongPress(t)},500))}),this._mapGl.on("mousedown",n=>{e||(t=n.lngLat,e=setTimeout(()=>{this._onLongPress(t),e=null},500))}),this._mapGl.on("dragstart",n),this._mapGl.on("mouseup",n),this._mapGl.on("touchend",n),this._mapGl.on("touchcancel",n),this._mapGl.on("touchmove",n),this._mapGl.on("moveend",n),this._mapGl.on("gesturestart",n),this._mapGl.on("gesturechange",n),this._mapGl.on("gestureend",n)}}_onLongPress(e){this._mapContainer.dispatchEvent(new lg(e))}_onGeocodeChange(e){this._mapContainer.dispatchEvent(new lb(e))}isWebglSupported(){if(window.WebGLRenderingContext){let e=document.createElement("canvas");try{let t=e.getContext("webgl2")||e.getContext("webgl");if(t&&"function"==typeof t.getParameter)return!0}catch(e){}}return!1}}let aS="--internal-or-map-marker-color",aM="--internal-or-map-marker-active-color",aL=u`
|
|
763
763
|
:host {
|
|
764
764
|
--internal-or-map-width: var(--or-map-width, 100%);
|
|
765
765
|
--internal-or-map-min-height: var(--or-map-min-height, 300px);
|
|
766
766
|
--internal-or-map-marker-transform: var(--or-map-marker-transform, translate(-16px, -29px));
|
|
767
767
|
--internal-or-map-marker-width: var(--or-map-marker-width, 32px);
|
|
768
768
|
--internal-or-map-marker-height: var(--or-map-marker-height, 32px);
|
|
769
|
-
--internal-or-map-marker-color: var(--or-map-marker-color, var(--or-app-color4, ${d(
|
|
769
|
+
--internal-or-map-marker-color: var(--or-map-marker-color, var(--or-app-color4, ${d(iE)}));
|
|
770
770
|
--internal-or-map-marker-stroke: var(--or-map-marker-stroke, none);
|
|
771
|
-
--internal-or-map-marker-icon-color: var(--or-map-marker-icon-color, var(--or-app-color1, ${d(
|
|
771
|
+
--internal-or-map-marker-icon-color: var(--or-map-marker-icon-color, var(--or-app-color1, ${d(iA)}));
|
|
772
772
|
--internal-or-map-marker-icon-stroke: var(--or-map-marker-icon-stroke, none);
|
|
773
773
|
--internal-or-map-marker-icon-width: var(--or-map-marker-icon-width, 16px);
|
|
774
774
|
--internal-or-map-marker-icon-height: var(--or-map-marker-icon-height, 16px);
|
|
@@ -776,9 +776,9 @@ uniform ${n} ${i} u_${r};
|
|
|
776
776
|
--internal-or-map-marker-active-transform: var(--or-map-marker-active-transform, translate(-24px, -44px));
|
|
777
777
|
--internal-or-map-marker-active-width: var(--or-map-marker-active-width, 48px);
|
|
778
778
|
--internal-or-map-marker-active-height: var(--or-map-marker-active-height, 48px);
|
|
779
|
-
--internal-or-map-marker-active-color: var(--or-map-marker-active-color, var(--or-app-color4, ${d(
|
|
779
|
+
--internal-or-map-marker-active-color: var(--or-map-marker-active-color, var(--or-app-color4, ${d(iE)}));
|
|
780
780
|
--internal-or-map-marker-active-stroke: var(--or-map-marker-active-stroke, 2px);
|
|
781
|
-
--internal-or-map-marker-icon-active-color: var(--or-map-marker-icon-active-color, var(--or-app-color1, ${d(
|
|
781
|
+
--internal-or-map-marker-icon-active-color: var(--or-map-marker-icon-active-color, var(--or-app-color1, ${d(iA)}));
|
|
782
782
|
--internal-or-map-marker-icon-active-stroke: var(--or-map-marker-icon-active-stroke, none);
|
|
783
783
|
--internal-or-map-marker-icon-active-width: var(--or-map-marker-icon-active-width, 24px);
|
|
784
784
|
--internal-or-map-marker-icon-active-height: var(--or-map-marker-icon-active-height, 24px);
|
|
@@ -903,13 +903,13 @@ uniform ${n} ${i} u_${r};
|
|
|
903
903
|
right: 12px;
|
|
904
904
|
}
|
|
905
905
|
}
|
|
906
|
-
`,
|
|
906
|
+
`,aD=u`
|
|
907
907
|
:host {
|
|
908
|
-
--internal-or-map-asset-card-header-color: var(--or-map-asset-card-header-color, var(--or-app-color4, ${d(
|
|
909
|
-
--internal-or-map-asset-card-header-text-color: var(--or-map-asset-card-header-text-color, var(--or-app-color1, ${d(
|
|
908
|
+
--internal-or-map-asset-card-header-color: var(--or-map-asset-card-header-color, var(--or-app-color4, ${d(iE)}));
|
|
909
|
+
--internal-or-map-asset-card-header-text-color: var(--or-map-asset-card-header-text-color, var(--or-app-color1, ${d(iA)}));
|
|
910
910
|
--internal-or-map-asset-card-header-height: var(--or-map-asset-card-header-height, calc(${d("50px")} - 10px));
|
|
911
|
-
--internal-or-map-asset-card-background-color: var(--or-map-asset-card-background-color, var(--or-app-color1, ${d(
|
|
912
|
-
--internal-or-map-asset-card-background-text-color: var(--or-map-asset-card-background-text-color, var(--or-app-color3, ${d(
|
|
911
|
+
--internal-or-map-asset-card-background-color: var(--or-map-asset-card-background-color, var(--or-app-color1, ${d(iA)}));
|
|
912
|
+
--internal-or-map-asset-card-background-text-color: var(--or-map-asset-card-background-text-color, var(--or-app-color3, ${d(iS)}));
|
|
913
913
|
--internal-or-map-asset-card-separator-color: var(--or-map-asset-card-separator-color, var(--or-app-color2, ${d("#F9F9F9")}));
|
|
914
914
|
|
|
915
915
|
display: block;
|
|
@@ -929,7 +929,7 @@ uniform ${n} ${i} u_${r};
|
|
|
929
929
|
height: var(--internal-or-map-asset-card-header-height);
|
|
930
930
|
background-color: var(--internal-or-map-asset-card-header-color);
|
|
931
931
|
line-height: var(--internal-or-map-asset-card-header-height);
|
|
932
|
-
border-bottom: 1px solid ${d(
|
|
932
|
+
border-bottom: 1px solid ${d(iC)};
|
|
933
933
|
text-align: center;
|
|
934
934
|
color: var(--internal-or-map-asset-card-header-text-color);
|
|
935
935
|
--or-icon-fill: var(--internal-or-map-asset-card-header-text-color);
|
|
@@ -993,7 +993,7 @@ uniform ${n} ${i} u_${r};
|
|
|
993
993
|
min-height: 134px;
|
|
994
994
|
}
|
|
995
995
|
}
|
|
996
|
-
`;var
|
|
996
|
+
`;var aI,aR,aO,aP,a$,aN,aB,az,aj,aY,aH,aU,aV,aW,aG,aq,aK,aX,aZ,aJ,aQ,a0,a1,a2,a5,a3,a4,a6,a8,a7,a9,se,st,sn,si,sr,so,sa,ss,sl,sc,sd,su,sh,sm,sf,sp,sg,sb,s_,sy,sv,sx,sw,sF,sk,sE,sA,sC,sT,sS,sM,sL,sD,sI,sR,sO,sP,s$,sN,sB,sz,sj,sY,sH,sU,sV,sW,sG,sq,sK,sX=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};class sZ extends CustomEvent{constructor(e,t){super(sZ.NAME,{detail:{marker:e,property:t},bubbles:!0,composed:!0})}}sZ.NAME="or-map-marker-changed";class sJ extends CustomEvent{constructor(e){super(sJ.NAME,{detail:{marker:e},bubbles:!0,composed:!0})}}sJ.NAME="or-map-marker-clicked";let sQ=sK=class extends em{constructor(){super(...arguments),this.visible=!0,this.interactive=!0,this.active=!1}static get styles(){return u`
|
|
997
997
|
.label {
|
|
998
998
|
background-color: white;
|
|
999
999
|
width: auto;
|
|
@@ -1005,9 +1005,9 @@ uniform ${n} ${i} u_${r};
|
|
|
1005
1005
|
transform: translate(-50%, -50%);
|
|
1006
1006
|
text-align: center;
|
|
1007
1007
|
border-radius: 3px;
|
|
1008
|
-
-webkit-box-shadow: ${d(
|
|
1009
|
-
-moz-box-shadow: ${d(
|
|
1010
|
-
box-shadow: ${d(
|
|
1008
|
+
-webkit-box-shadow: ${d(iM)};
|
|
1009
|
+
-moz-box-shadow: ${d(iM)};
|
|
1010
|
+
box-shadow: ${d(iM)};
|
|
1011
1011
|
}
|
|
1012
1012
|
.label > span {
|
|
1013
1013
|
white-space: nowrap;
|
|
@@ -1060,9 +1060,9 @@ uniform ${n} ${i} u_${r};
|
|
|
1060
1060
|
r: 18px;
|
|
1061
1061
|
stroke-width: 4px;
|
|
1062
1062
|
}
|
|
1063
|
-
`}get markerContainer(){if(this._actualMarkerElement)return this._actualMarkerElement.firstElementChild}_onClick(e){this.dispatchEvent(new
|
|
1063
|
+
`}get markerContainer(){if(this._actualMarkerElement)return this._actualMarkerElement.firstElementChild}_onClick(e){this.dispatchEvent(new sJ(this))}_createMarkerElement(){let e=document.createElement("div"),t=document.createElement("div");e.appendChild(t),this.addMarkerClassNames(e),this.addMarkerContainerClassNames(t);let n=this.createMarkerContent();return n||(e.classList.add("or-map-marker-default"),n=this.createDefaultMarkerContent()),t.appendChild(n),this.updateInteractive(e),this.updateVisibility(e),this.updateColor(t),this.updateActive(e),e}createMarkerContent(){let e=!1,t=document.createElement("div");if(this._slot&&this._slot.assignedNodes({flatten:!0}).forEach(n=>{n instanceof HTMLElement&&(t.appendChild(n.cloneNode(!0)),e=!0)}),e)return t}shouldUpdate(e){return(e.has("icon")||e.has("displayValue")||e.has("direction"))&&this.refreshMarkerContent(),(e.has("color")||e.has("activeColor"))&&this.updateColor(this.markerContainer),e.has("visible")&&this.updateVisibility(this._actualMarkerElement),e.has("interactive")&&this.updateInteractive(this._actualMarkerElement),e.has("active")&&(this.updateActive(this._actualMarkerElement),this.updateColor(this.markerContainer)),e.forEach((e,t)=>this._raisePropertyChange(t)),!1}updateVisibility(e){e&&(this.visible?e.removeAttribute("hidden"):e.setAttribute("hidden","true"))}getColor(){return this.color&&"unset"!==this.color?this.color:void 0}getActiveColor(){return this.activeColor&&"unset"!==this.activeColor?this.activeColor:void 0}updateColor(e){if(e){e.style.removeProperty(aS),e.style.removeProperty(aM);let t=this.getColor(),n=this.getActiveColor();t&&e.style.setProperty(aS,t),n&&e.style.setProperty(aM,n)}}updateActive(e){e&&(this.active?e.classList.add("active"):e.classList.remove("active"))}updateInteractive(e){e&&(this.interactive?e.classList.add("interactive"):e.classList.remove("interactive"))}refreshMarkerContent(){if(this.markerContainer){let e=this.createMarkerContent();e?this._actualMarkerElement.classList.remove("or-map-marker-default"):(this._actualMarkerElement.classList.add("or-map-marker-default"),e=this.createDefaultMarkerContent()),this.markerContainer.children.length>0&&this.markerContainer.removeChild(this.markerContainer.children[0]),this.markerContainer.appendChild(e)}}render(){return K`
|
|
1064
1064
|
<slot></slot>
|
|
1065
|
-
`}_raisePropertyChange(e){this.dispatchEvent(new
|
|
1065
|
+
`}_raisePropertyChange(e){this.dispatchEvent(new sZ(this,e))}addMarkerClassNames(e){e.classList.add("or-map-marker")}addMarkerContainerClassNames(e){e.classList.add("marker-container")}createDefaultMarkerContent(){let e=document.createElement("div");return e.innerHTML=sK._defaultTemplate(this.icon,{displayValue:this.displayValue,direction:this.direction}),e}hasPosition(){return"number"==typeof this.lat&&"number"==typeof this.lng&&this.lat>=-90&&this.lat<90&&this.lng>=-180&&this.lng<180}};sQ._defaultTemplate=(e,t)=>`
|
|
1066
1066
|
${t&&void 0!==t.displayValue?`<div class="label"><span>${t.displayValue}</span></div>`:""}
|
|
1067
1067
|
${t&&t.direction?`<div class="direction-icon-wrapper" style="transform: rotate(${t.direction}deg);">
|
|
1068
1068
|
<svg class="direction-circle">
|
|
@@ -1072,7 +1072,7 @@ uniform ${n} ${i} u_${r};
|
|
|
1072
1072
|
</div>`:""}
|
|
1073
1073
|
<or-icon icon="or:marker"></or-icon>
|
|
1074
1074
|
<or-icon class="marker-icon" icon="${e||""}"></or-icon>
|
|
1075
|
-
`,sW([eb({type:Number,reflect:!0,attribute:!0})],sK.prototype,"lat",void 0),sW([eb({type:Number,reflect:!0})],sK.prototype,"lng",void 0),sW([eb({type:Number,reflect:!0})],sK.prototype,"radius",void 0),sW([eb({reflect:!0})],sK.prototype,"displayValue",void 0),sW([eb({reflect:!0})],sK.prototype,"direction",void 0),sW([eb({type:Boolean})],sK.prototype,"visible",void 0),sW([eb({type:String})],sK.prototype,"icon",void 0),sW([eb({type:String})],sK.prototype,"color",void 0),sW([eb({type:String})],sK.prototype,"activeColor",void 0),sW([eb({type:Boolean})],sK.prototype,"interactive",void 0),sW([eb({type:Boolean})],sK.prototype,"active",void 0),sW([ev("slot")],sK.prototype,"_slot",void 0),sK=sV=sW([ep("or-map-marker")],sK);var sX=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};function sZ(e,t){if(e&&t&&e[t])return e[t]}let sJ=class extends iw(iI)(sK){constructor(){super(),this.assetTypeAsIcon=!0,this.visible=!1}set type(e){let t,n=sZ(this.config,e);if(n&&n.attributeName&&this.asset&&this.asset.attributes&&this.asset.attributes[n.attributeName]&&n.colours){let e=this.asset.attributes[n.attributeName].value;t={markerConfig:n.colours,currentValue:e}}let i=ay(e,t);if(!i){this.visible=!1;return}this.assetTypeAsIcon&&(this.icon=i.icon),this.markerColor=Array.isArray(i.color)?i.color[0].colour:i.color||void 0,this.updateColor(this.markerContainer),this.visible=!0}shouldUpdate(e){if(e.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(e).length))return!1;if(e.has("asset"))try{this.onAssetChanged(this.asset)}catch(e){console.error(e)}return super.shouldUpdate(e)}_onEvent(e){if("attribute"===e.eventType)return"location"===e.ref.name?void this._updateLocation(e.value):void(this.asset&&(this.asset=t4(this.asset,e),this.requestUpdate()));if("asset"===e.eventType)switch(e.cause){case"READ":case"CREATE":case"UPDATE":this.onAssetChanged(e.asset);break;case"DELETE":this.onAssetChanged(void 0)}}onAssetChanged(e){var t,n,i,r;return t=this,n=void 0,i=void 0,r=function*(){if(e){this.direction=void 0,this.displayValue=void 0;let i=e.attributes?e.attributes.location:void 0;this._updateLocation(i?i.value:null);let r=sZ(this.config,e.type),o=!r||!r.hideDirection,a=r&&!0===r.showLabel&&!!r.attributeName,s=!!(r&&!1!==r.showUnits);if(a&&e.attributes&&e.attributes[null==r?void 0:r.attributeName]){var t,n;let i=e.attributes[r.attributeName],o=tY.getAttributeAndValueDescriptors(e.type,i.name,i);this.displayValue=(t=o[0],n=e.type,t0(i,t,n,s,!0,"-"))}if(o&&e.attributes&&e.attributes.direction){let t=e.attributes.direction.value;null!=t&&(this.direction=t.toString())}this.type=e.type}else this.lat=void 0,this.lng=void 0},new(i||(i=Promise))(function(e,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):((n=t.value)instanceof i?n:new i(function(e){e(n)})).then(a,s)}l((r=r.apply(t,n||[])).next())})}_updateLocation(e){this.lat=e&&e.coordinates?e.coordinates[1]:void 0,this.lng=e&&e.coordinates?e.coordinates[0]:void 0}getColor(){return this.markerColor&&!this.color?"#"+this.markerColor:super.getColor()}getActiveColor(){return this.markerColor&&!this.activeColor?"#"+this.markerColor:super.getActiveColor()}};sX([eb({type:String,reflect:!0,attribute:!0})],sJ.prototype,"assetId",void 0),sX([eb({type:Object,attribute:!0})],sJ.prototype,"asset",void 0),sX([eb()],sJ.prototype,"config",void 0),sJ=sX([ep("or-map-marker-asset")],sJ);var sQ="mdc-dom-focus-sentinel",s0=function(){function e(e,t){void 0===t&&(t={}),this.root=e,this.options=t,this.elFocusedBeforeTrapFocus=null}return e.prototype.trapFocus=function(){var e=this.getFocusableElements(this.root);if(0===e.length)throw Error("FocusTrap: Element must have at least one focusable child.");this.elFocusedBeforeTrapFocus=document.activeElement instanceof HTMLElement?document.activeElement:null,this.wrapTabFocus(this.root,e),this.options.skipInitialFocus||this.focusInitialElement(e,this.options.initialFocusEl)},e.prototype.releaseFocus=function(){[].slice.call(this.root.querySelectorAll("."+sQ)).forEach(function(e){e.parentElement.removeChild(e)}),this.elFocusedBeforeTrapFocus&&this.elFocusedBeforeTrapFocus.focus()},e.prototype.wrapTabFocus=function(e,t){var n=this.createSentinel(),i=this.createSentinel();n.addEventListener("focus",function(){t.length>0&&t[t.length-1].focus()}),i.addEventListener("focus",function(){t.length>0&&t[0].focus()}),e.insertBefore(n,e.children[0]),e.appendChild(i)},e.prototype.focusInitialElement=function(e,t){var n=0;t&&(n=Math.max(e.indexOf(t),0)),e[n].focus()},e.prototype.getFocusableElements=function(e){return[].slice.call(e.querySelectorAll("[autofocus], [tabindex], a, input, textarea, select, button")).filter(function(e){var t="true"===e.getAttribute("aria-disabled")||null!=e.getAttribute("disabled")||null!=e.getAttribute("hidden")||"true"===e.getAttribute("aria-hidden"),n=e.tabIndex>=0&&e.getBoundingClientRect().width>0&&!e.classList.contains(sQ)&&!t,i=!1;if(n){var r=getComputedStyle(e);i="none"===r.display||"hidden"===r.visibility}return n&&!i})},e.prototype.createSentinel=function(){var e=document.createElement("div");return e.setAttribute("tabindex","0"),e.setAttribute("aria-hidden","true"),e.classList.add(sQ),e},e}(),s1={CLOSING:"mdc-dialog--closing",OPEN:"mdc-dialog--open",OPENING:"mdc-dialog--opening",SCROLLABLE:"mdc-dialog--scrollable",SCROLL_LOCK:"mdc-dialog-scroll-lock",STACKED:"mdc-dialog--stacked"},s2={ACTION_ATTRIBUTE:"data-mdc-dialog-action",BUTTON_DEFAULT_ATTRIBUTE:"data-mdc-dialog-button-default",BUTTON_SELECTOR:".mdc-dialog__button",CLOSED_EVENT:"MDCDialog:closed",CLOSE_ACTION:"close",CLOSING_EVENT:"MDCDialog:closing",CONTAINER_SELECTOR:".mdc-dialog__container",CONTENT_SELECTOR:".mdc-dialog__content",DESTROY_ACTION:"destroy",INITIAL_FOCUS_ATTRIBUTE:"data-mdc-dialog-initial-focus",OPENED_EVENT:"MDCDialog:opened",OPENING_EVENT:"MDCDialog:opening",SCRIM_SELECTOR:".mdc-dialog__scrim",SUPPRESS_DEFAULT_PRESS_SELECTOR:"textarea, .mdc-menu .mdc-list-item",SURFACE_SELECTOR:".mdc-dialog__surface"},s5={DIALOG_ANIMATION_CLOSE_TIME_MS:75,DIALOG_ANIMATION_OPEN_TIME_MS:150},s3=function(e){function t(n){var i=e.call(this,i$(i$({},t.defaultAdapter),n))||this;return i.isOpen_=!1,i.animationFrame_=0,i.animationTimer_=0,i.layoutFrame_=0,i.escapeKeyAction_=s2.CLOSE_ACTION,i.scrimClickAction_=s2.CLOSE_ACTION,i.autoStackButtons_=!0,i.areButtonsStacked_=!1,i.suppressDefaultPressSelector=s2.SUPPRESS_DEFAULT_PRESS_SELECTOR,i}return iP(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return s1},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return s2},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return s5},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addBodyClass:function(){},addClass:function(){},areButtonsStacked:function(){return!1},clickDefaultButton:function(){},eventTargetMatches:function(){return!1},getActionFromEvent:function(){return""},getInitialFocusEl:function(){return null},hasClass:function(){return!1},isContentScrollable:function(){return!1},notifyClosed:function(){},notifyClosing:function(){},notifyOpened:function(){},notifyOpening:function(){},releaseFocus:function(){},removeBodyClass:function(){},removeClass:function(){},reverseButtons:function(){},trapFocus:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){this.adapter.hasClass(s1.STACKED)&&this.setAutoStackButtons(!1)},t.prototype.destroy=function(){this.isOpen_&&this.close(s2.DESTROY_ACTION),this.animationTimer_&&(clearTimeout(this.animationTimer_),this.handleAnimationTimerEnd_()),this.layoutFrame_&&(cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=0)},t.prototype.open=function(){var e=this;this.isOpen_=!0,this.adapter.notifyOpening(),this.adapter.addClass(s1.OPENING),this.runNextAnimationFrame_(function(){e.adapter.addClass(s1.OPEN),e.adapter.addBodyClass(s1.SCROLL_LOCK),e.layout(),e.animationTimer_=setTimeout(function(){e.handleAnimationTimerEnd_(),e.adapter.trapFocus(e.adapter.getInitialFocusEl()),e.adapter.notifyOpened()},s5.DIALOG_ANIMATION_OPEN_TIME_MS)})},t.prototype.close=function(e){var t=this;void 0===e&&(e=""),this.isOpen_&&(this.isOpen_=!1,this.adapter.notifyClosing(e),this.adapter.addClass(s1.CLOSING),this.adapter.removeClass(s1.OPEN),this.adapter.removeBodyClass(s1.SCROLL_LOCK),cancelAnimationFrame(this.animationFrame_),this.animationFrame_=0,clearTimeout(this.animationTimer_),this.animationTimer_=setTimeout(function(){t.adapter.releaseFocus(),t.handleAnimationTimerEnd_(),t.adapter.notifyClosed(e)},s5.DIALOG_ANIMATION_CLOSE_TIME_MS))},t.prototype.isOpen=function(){return this.isOpen_},t.prototype.getEscapeKeyAction=function(){return this.escapeKeyAction_},t.prototype.setEscapeKeyAction=function(e){this.escapeKeyAction_=e},t.prototype.getScrimClickAction=function(){return this.scrimClickAction_},t.prototype.setScrimClickAction=function(e){this.scrimClickAction_=e},t.prototype.getAutoStackButtons=function(){return this.autoStackButtons_},t.prototype.setAutoStackButtons=function(e){this.autoStackButtons_=e},t.prototype.getSuppressDefaultPressSelector=function(){return this.suppressDefaultPressSelector},t.prototype.setSuppressDefaultPressSelector=function(e){this.suppressDefaultPressSelector=e},t.prototype.layout=function(){var e=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame(function(){e.layoutInternal_(),e.layoutFrame_=0})},t.prototype.handleClick=function(e){if(this.adapter.eventTargetMatches(e.target,s2.SCRIM_SELECTOR)&&""!==this.scrimClickAction_)this.close(this.scrimClickAction_);else{var t=this.adapter.getActionFromEvent(e);t&&this.close(t)}},t.prototype.handleKeydown=function(e){var t="Enter"===e.key||13===e.keyCode;if(t&&!this.adapter.getActionFromEvent(e)){var n=e.composedPath?e.composedPath()[0]:e.target,i=!this.adapter.eventTargetMatches(n,this.suppressDefaultPressSelector);t&&i&&this.adapter.clickDefaultButton()}},t.prototype.handleDocumentKeydown=function(e){("Escape"===e.key||27===e.keyCode)&&""!==this.escapeKeyAction_&&this.close(this.escapeKeyAction_)},t.prototype.layoutInternal_=function(){this.autoStackButtons_&&this.detectStackedButtons_(),this.detectScrollableContent_()},t.prototype.handleAnimationTimerEnd_=function(){this.animationTimer_=0,this.adapter.removeClass(s1.OPENING),this.adapter.removeClass(s1.CLOSING)},t.prototype.runNextAnimationFrame_=function(e){var t=this;cancelAnimationFrame(this.animationFrame_),this.animationFrame_=requestAnimationFrame(function(){t.animationFrame_=0,clearTimeout(t.animationTimer_),t.animationTimer_=setTimeout(e,0)})},t.prototype.detectStackedButtons_=function(){this.adapter.removeClass(s1.STACKED);var e=this.adapter.areButtonsStacked();e&&this.adapter.addClass(s1.STACKED),e!==this.areButtonsStacked_&&(this.adapter.reverseButtons(),this.areButtonsStacked_=e)},t.prototype.detectScrollableContent_=function(){this.adapter.removeClass(s1.SCROLLABLE),this.adapter.isContentScrollable()&&this.adapter.addClass(s1.SCROLLABLE)},t}(iz),s4=s3.strings,s6=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iP(t,e),Object.defineProperty(t.prototype,"isOpen",{get:function(){return this.foundation.isOpen()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"escapeKeyAction",{get:function(){return this.foundation.getEscapeKeyAction()},set:function(e){this.foundation.setEscapeKeyAction(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scrimClickAction",{get:function(){return this.foundation.getScrimClickAction()},set:function(e){this.foundation.setScrimClickAction(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"autoStackButtons",{get:function(){return this.foundation.getAutoStackButtons()},set:function(e){this.foundation.setAutoStackButtons(e)},enumerable:!0,configurable:!0}),t.attachTo=function(e){return new t(e)},t.prototype.initialize=function(e){void 0===e&&(e=function(e,t){return new s0(e,t)});var t,n,i=this.root.querySelector(s4.CONTAINER_SELECTOR);if(!i)throw Error("Dialog component requires a "+s4.CONTAINER_SELECTOR+" container element");this.container_=i,this.content_=this.root.querySelector(s4.CONTENT_SELECTOR),this.buttons_=[].slice.call(this.root.querySelectorAll(s4.BUTTON_SELECTOR)),this.defaultButton_=this.root.querySelector("["+s4.BUTTON_DEFAULT_ATTRIBUTE+"]"),this.focusTrapFactory_=e,this.buttonRipples_=[];try{for(var r=iN(this.buttons_),o=r.next();!o.done;o=r.next()){var a=o.value;this.buttonRipples_.push(new i9(a))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},t.prototype.initialSyncWithDOM=function(){var e,t=this;this.focusTrap_=(e=this.container_,(0,this.focusTrapFactory_)(e,{initialFocusEl:this.getInitialFocusEl_()||void 0})),this.handleClick_=this.foundation.handleClick.bind(this.foundation),this.handleKeydown_=this.foundation.handleKeydown.bind(this.foundation),this.handleDocumentKeydown_=this.foundation.handleDocumentKeydown.bind(this.foundation),this.handleLayout_=this.layout.bind(this);var n=["resize","orientationchange"];this.handleOpening_=function(){n.forEach(function(e){return window.addEventListener(e,t.handleLayout_)}),document.addEventListener("keydown",t.handleDocumentKeydown_)},this.handleClosing_=function(){n.forEach(function(e){return window.removeEventListener(e,t.handleLayout_)}),document.removeEventListener("keydown",t.handleDocumentKeydown_)},this.listen("click",this.handleClick_),this.listen("keydown",this.handleKeydown_),this.listen(s4.OPENING_EVENT,this.handleOpening_),this.listen(s4.CLOSING_EVENT,this.handleClosing_)},t.prototype.destroy=function(){this.unlisten("click",this.handleClick_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(s4.OPENING_EVENT,this.handleOpening_),this.unlisten(s4.CLOSING_EVENT,this.handleClosing_),this.handleClosing_(),this.buttonRipples_.forEach(function(e){return e.destroy()}),e.prototype.destroy.call(this)},t.prototype.layout=function(){this.foundation.layout()},t.prototype.open=function(){this.foundation.open()},t.prototype.close=function(e){void 0===e&&(e=""),this.foundation.close(e)},t.prototype.getDefaultFoundation=function(){var e=this;return new s3({addBodyClass:function(e){return document.body.classList.add(e)},addClass:function(t){return e.root.classList.add(t)},areButtonsStacked:function(){var t,n;return t=e.buttons_,n=new Set,[].forEach.call(t,function(e){return n.add(e.offsetTop)}),n.size>1},clickDefaultButton:function(){return e.defaultButton_&&e.defaultButton_.click()},eventTargetMatches:function(e,t){return!!e&&iU(e,t)},getActionFromEvent:function(e){if(!e.target)return"";var t=iH(e.target,"["+s4.ACTION_ATTRIBUTE+"]");return t&&t.getAttribute(s4.ACTION_ATTRIBUTE)},getInitialFocusEl:function(){return e.getInitialFocusEl_()},hasClass:function(t){return e.root.classList.contains(t)},isContentScrollable:function(){var t;return!!(t=e.content_)&&t.scrollHeight>t.offsetHeight},notifyClosed:function(t){return e.emit(s4.CLOSED_EVENT,t?{action:t}:{})},notifyClosing:function(t){return e.emit(s4.CLOSING_EVENT,t?{action:t}:{})},notifyOpened:function(){return e.emit(s4.OPENED_EVENT,{})},notifyOpening:function(){return e.emit(s4.OPENING_EVENT,{})},releaseFocus:function(){return e.focusTrap_.releaseFocus()},removeBodyClass:function(e){return document.body.classList.remove(e)},removeClass:function(t){return e.root.classList.remove(t)},reverseButtons:function(){e.buttons_.reverse(),e.buttons_.forEach(function(e){e.parentElement.appendChild(e)})},trapFocus:function(){return e.focusTrap_.trapFocus()}})},t.prototype.getInitialFocusEl_=function(){return this.root.querySelector("["+s4.INITIAL_FOCUS_ATTRIBUTE+"]")},t}(ij),s8=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let s7=n(99253),s9=n(73041);class le extends CustomEvent{constructor(){super(le.NAME,{bubbles:!0,composed:!0})}}le.NAME="or-mwc-dialog-opened";class lt extends CustomEvent{constructor(e){super(lt.NAME,{detail:e,bubbles:!0,composed:!0})}}function ln(e,t){return t||(t=lr.DialogHostElement||document.body),e.setOpen(!0),e.addEventListener(le.NAME,e=>{e.stopPropagation()}),e.addEventListener(lt.NAME,t=>{t.stopPropagation(),window.setTimeout(()=>{e.parentElement&&e.parentElement.removeChild(e)},0)}),t.append(e),e}lt.NAME="or-mwc-dialog-closed";let li=u`
|
|
1075
|
+
`,sX([eb({type:Number,reflect:!0,attribute:!0})],sQ.prototype,"lat",void 0),sX([eb({type:Number,reflect:!0})],sQ.prototype,"lng",void 0),sX([eb({type:Number,reflect:!0})],sQ.prototype,"radius",void 0),sX([eb({reflect:!0})],sQ.prototype,"displayValue",void 0),sX([eb({reflect:!0})],sQ.prototype,"direction",void 0),sX([eb({type:Boolean})],sQ.prototype,"visible",void 0),sX([eb({type:String})],sQ.prototype,"icon",void 0),sX([eb({type:String})],sQ.prototype,"color",void 0),sX([eb({type:String})],sQ.prototype,"activeColor",void 0),sX([eb({type:Boolean})],sQ.prototype,"interactive",void 0),sX([eb({type:Boolean})],sQ.prototype,"active",void 0),sX([ev("slot")],sQ.prototype,"_slot",void 0),sQ=sK=sX([ep("or-map-marker")],sQ);var s0=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};function s1(e,t){if(e&&t&&e[t])return e[t]}let s2=class extends ik(iO)(sQ){constructor(){super(),this.assetTypeAsIcon=!0,this.visible=!1}set type(e){let t,n=s1(this.config,e);if(n&&n.attributeName&&this.asset&&this.asset.attributes&&this.asset.attributes[n.attributeName]&&n.colours){let e=this.asset.attributes[n.attributeName].value;t={markerConfig:n.colours,currentValue:e}}let i=ax(e,t);if(!i){this.visible=!1;return}this.assetTypeAsIcon&&(this.icon=i.icon),this.markerColor=Array.isArray(i.color)?i.color[0].colour:i.color||void 0,this.updateColor(this.markerContainer),this.visible=!0}shouldUpdate(e){if(e.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(e).length))return!1;if(e.has("asset"))try{this.onAssetChanged(this.asset)}catch(e){console.error(e)}return super.shouldUpdate(e)}_onEvent(e){if("attribute"===e.eventType)return"location"===e.ref.name?void this._updateLocation(e.value):void(this.asset&&(this.asset=t4(this.asset,e),this.requestUpdate()));if("asset"===e.eventType)switch(e.cause){case"READ":case"CREATE":case"UPDATE":this.onAssetChanged(e.asset);break;case"DELETE":this.onAssetChanged(void 0)}}onAssetChanged(e){var t,n,i,r;return t=this,n=void 0,i=void 0,r=function*(){if(e){this.direction=void 0,this.displayValue=void 0;let i=e.attributes?e.attributes.location:void 0;this._updateLocation(i?i.value:null);let r=s1(this.config,e.type),o=!r||!r.hideDirection,a=r&&!0===r.showLabel&&!!r.attributeName,s=!!(r&&!1!==r.showUnits);if(a&&e.attributes&&e.attributes[null==r?void 0:r.attributeName]){var t,n;let i=e.attributes[r.attributeName],o=tY.getAttributeAndValueDescriptors(e.type,i.name,i);this.displayValue=(t=o[0],n=e.type,t0(i,t,n,s,!0,"-"))}if(o&&e.attributes&&e.attributes.direction){let t=e.attributes.direction.value;null!=t&&(this.direction=t.toString())}this.type=e.type}else this.lat=void 0,this.lng=void 0},new(i||(i=Promise))(function(e,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):((n=t.value)instanceof i?n:new i(function(e){e(n)})).then(a,s)}l((r=r.apply(t,n||[])).next())})}_updateLocation(e){this.lat=e&&e.coordinates?e.coordinates[1]:void 0,this.lng=e&&e.coordinates?e.coordinates[0]:void 0}getColor(){return this.markerColor&&!this.color?"#"+this.markerColor:super.getColor()}getActiveColor(){return this.markerColor&&!this.activeColor?"#"+this.markerColor:super.getActiveColor()}};s0([eb({type:String,reflect:!0,attribute:!0})],s2.prototype,"assetId",void 0),s0([eb({type:Object,attribute:!0})],s2.prototype,"asset",void 0),s0([eb()],s2.prototype,"config",void 0),s2=s0([ep("or-map-marker-asset")],s2);var s5="mdc-dom-focus-sentinel",s3=function(){function e(e,t){void 0===t&&(t={}),this.root=e,this.options=t,this.elFocusedBeforeTrapFocus=null}return e.prototype.trapFocus=function(){var e=this.getFocusableElements(this.root);if(0===e.length)throw Error("FocusTrap: Element must have at least one focusable child.");this.elFocusedBeforeTrapFocus=document.activeElement instanceof HTMLElement?document.activeElement:null,this.wrapTabFocus(this.root,e),this.options.skipInitialFocus||this.focusInitialElement(e,this.options.initialFocusEl)},e.prototype.releaseFocus=function(){[].slice.call(this.root.querySelectorAll("."+s5)).forEach(function(e){e.parentElement.removeChild(e)}),this.elFocusedBeforeTrapFocus&&this.elFocusedBeforeTrapFocus.focus()},e.prototype.wrapTabFocus=function(e,t){var n=this.createSentinel(),i=this.createSentinel();n.addEventListener("focus",function(){t.length>0&&t[t.length-1].focus()}),i.addEventListener("focus",function(){t.length>0&&t[0].focus()}),e.insertBefore(n,e.children[0]),e.appendChild(i)},e.prototype.focusInitialElement=function(e,t){var n=0;t&&(n=Math.max(e.indexOf(t),0)),e[n].focus()},e.prototype.getFocusableElements=function(e){return[].slice.call(e.querySelectorAll("[autofocus], [tabindex], a, input, textarea, select, button")).filter(function(e){var t="true"===e.getAttribute("aria-disabled")||null!=e.getAttribute("disabled")||null!=e.getAttribute("hidden")||"true"===e.getAttribute("aria-hidden"),n=e.tabIndex>=0&&e.getBoundingClientRect().width>0&&!e.classList.contains(s5)&&!t,i=!1;if(n){var r=getComputedStyle(e);i="none"===r.display||"hidden"===r.visibility}return n&&!i})},e.prototype.createSentinel=function(){var e=document.createElement("div");return e.setAttribute("tabindex","0"),e.setAttribute("aria-hidden","true"),e.classList.add(s5),e},e}(),s4={CLOSING:"mdc-dialog--closing",OPEN:"mdc-dialog--open",OPENING:"mdc-dialog--opening",SCROLLABLE:"mdc-dialog--scrollable",SCROLL_LOCK:"mdc-dialog-scroll-lock",STACKED:"mdc-dialog--stacked"},s6={ACTION_ATTRIBUTE:"data-mdc-dialog-action",BUTTON_DEFAULT_ATTRIBUTE:"data-mdc-dialog-button-default",BUTTON_SELECTOR:".mdc-dialog__button",CLOSED_EVENT:"MDCDialog:closed",CLOSE_ACTION:"close",CLOSING_EVENT:"MDCDialog:closing",CONTAINER_SELECTOR:".mdc-dialog__container",CONTENT_SELECTOR:".mdc-dialog__content",DESTROY_ACTION:"destroy",INITIAL_FOCUS_ATTRIBUTE:"data-mdc-dialog-initial-focus",OPENED_EVENT:"MDCDialog:opened",OPENING_EVENT:"MDCDialog:opening",SCRIM_SELECTOR:".mdc-dialog__scrim",SUPPRESS_DEFAULT_PRESS_SELECTOR:"textarea, .mdc-menu .mdc-list-item",SURFACE_SELECTOR:".mdc-dialog__surface"},s8={DIALOG_ANIMATION_CLOSE_TIME_MS:75,DIALOG_ANIMATION_OPEN_TIME_MS:150},s7=function(e){function t(n){var i=e.call(this,iB(iB({},t.defaultAdapter),n))||this;return i.isOpen_=!1,i.animationFrame_=0,i.animationTimer_=0,i.layoutFrame_=0,i.escapeKeyAction_=s6.CLOSE_ACTION,i.scrimClickAction_=s6.CLOSE_ACTION,i.autoStackButtons_=!0,i.areButtonsStacked_=!1,i.suppressDefaultPressSelector=s6.SUPPRESS_DEFAULT_PRESS_SELECTOR,i}return iN(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return s4},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return s6},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return s8},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addBodyClass:function(){},addClass:function(){},areButtonsStacked:function(){return!1},clickDefaultButton:function(){},eventTargetMatches:function(){return!1},getActionFromEvent:function(){return""},getInitialFocusEl:function(){return null},hasClass:function(){return!1},isContentScrollable:function(){return!1},notifyClosed:function(){},notifyClosing:function(){},notifyOpened:function(){},notifyOpening:function(){},releaseFocus:function(){},removeBodyClass:function(){},removeClass:function(){},reverseButtons:function(){},trapFocus:function(){}}},enumerable:!0,configurable:!0}),t.prototype.init=function(){this.adapter.hasClass(s4.STACKED)&&this.setAutoStackButtons(!1)},t.prototype.destroy=function(){this.isOpen_&&this.close(s6.DESTROY_ACTION),this.animationTimer_&&(clearTimeout(this.animationTimer_),this.handleAnimationTimerEnd_()),this.layoutFrame_&&(cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=0)},t.prototype.open=function(){var e=this;this.isOpen_=!0,this.adapter.notifyOpening(),this.adapter.addClass(s4.OPENING),this.runNextAnimationFrame_(function(){e.adapter.addClass(s4.OPEN),e.adapter.addBodyClass(s4.SCROLL_LOCK),e.layout(),e.animationTimer_=setTimeout(function(){e.handleAnimationTimerEnd_(),e.adapter.trapFocus(e.adapter.getInitialFocusEl()),e.adapter.notifyOpened()},s8.DIALOG_ANIMATION_OPEN_TIME_MS)})},t.prototype.close=function(e){var t=this;void 0===e&&(e=""),this.isOpen_&&(this.isOpen_=!1,this.adapter.notifyClosing(e),this.adapter.addClass(s4.CLOSING),this.adapter.removeClass(s4.OPEN),this.adapter.removeBodyClass(s4.SCROLL_LOCK),cancelAnimationFrame(this.animationFrame_),this.animationFrame_=0,clearTimeout(this.animationTimer_),this.animationTimer_=setTimeout(function(){t.adapter.releaseFocus(),t.handleAnimationTimerEnd_(),t.adapter.notifyClosed(e)},s8.DIALOG_ANIMATION_CLOSE_TIME_MS))},t.prototype.isOpen=function(){return this.isOpen_},t.prototype.getEscapeKeyAction=function(){return this.escapeKeyAction_},t.prototype.setEscapeKeyAction=function(e){this.escapeKeyAction_=e},t.prototype.getScrimClickAction=function(){return this.scrimClickAction_},t.prototype.setScrimClickAction=function(e){this.scrimClickAction_=e},t.prototype.getAutoStackButtons=function(){return this.autoStackButtons_},t.prototype.setAutoStackButtons=function(e){this.autoStackButtons_=e},t.prototype.getSuppressDefaultPressSelector=function(){return this.suppressDefaultPressSelector},t.prototype.setSuppressDefaultPressSelector=function(e){this.suppressDefaultPressSelector=e},t.prototype.layout=function(){var e=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame(function(){e.layoutInternal_(),e.layoutFrame_=0})},t.prototype.handleClick=function(e){if(this.adapter.eventTargetMatches(e.target,s6.SCRIM_SELECTOR)&&""!==this.scrimClickAction_)this.close(this.scrimClickAction_);else{var t=this.adapter.getActionFromEvent(e);t&&this.close(t)}},t.prototype.handleKeydown=function(e){var t="Enter"===e.key||13===e.keyCode;if(t&&!this.adapter.getActionFromEvent(e)){var n=e.composedPath?e.composedPath()[0]:e.target,i=!this.adapter.eventTargetMatches(n,this.suppressDefaultPressSelector);t&&i&&this.adapter.clickDefaultButton()}},t.prototype.handleDocumentKeydown=function(e){("Escape"===e.key||27===e.keyCode)&&""!==this.escapeKeyAction_&&this.close(this.escapeKeyAction_)},t.prototype.layoutInternal_=function(){this.autoStackButtons_&&this.detectStackedButtons_(),this.detectScrollableContent_()},t.prototype.handleAnimationTimerEnd_=function(){this.animationTimer_=0,this.adapter.removeClass(s4.OPENING),this.adapter.removeClass(s4.CLOSING)},t.prototype.runNextAnimationFrame_=function(e){var t=this;cancelAnimationFrame(this.animationFrame_),this.animationFrame_=requestAnimationFrame(function(){t.animationFrame_=0,clearTimeout(t.animationTimer_),t.animationTimer_=setTimeout(e,0)})},t.prototype.detectStackedButtons_=function(){this.adapter.removeClass(s4.STACKED);var e=this.adapter.areButtonsStacked();e&&this.adapter.addClass(s4.STACKED),e!==this.areButtonsStacked_&&(this.adapter.reverseButtons(),this.areButtonsStacked_=e)},t.prototype.detectScrollableContent_=function(){this.adapter.removeClass(s4.SCROLLABLE),this.adapter.isContentScrollable()&&this.adapter.addClass(s4.SCROLLABLE)},t}(iY),s9=s7.strings,le=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return iN(t,e),Object.defineProperty(t.prototype,"isOpen",{get:function(){return this.foundation.isOpen()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"escapeKeyAction",{get:function(){return this.foundation.getEscapeKeyAction()},set:function(e){this.foundation.setEscapeKeyAction(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scrimClickAction",{get:function(){return this.foundation.getScrimClickAction()},set:function(e){this.foundation.setScrimClickAction(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"autoStackButtons",{get:function(){return this.foundation.getAutoStackButtons()},set:function(e){this.foundation.setAutoStackButtons(e)},enumerable:!0,configurable:!0}),t.attachTo=function(e){return new t(e)},t.prototype.initialize=function(e){void 0===e&&(e=function(e,t){return new s3(e,t)});var t,n,i=this.root.querySelector(s9.CONTAINER_SELECTOR);if(!i)throw Error("Dialog component requires a "+s9.CONTAINER_SELECTOR+" container element");this.container_=i,this.content_=this.root.querySelector(s9.CONTENT_SELECTOR),this.buttons_=[].slice.call(this.root.querySelectorAll(s9.BUTTON_SELECTOR)),this.defaultButton_=this.root.querySelector("["+s9.BUTTON_DEFAULT_ATTRIBUTE+"]"),this.focusTrapFactory_=e,this.buttonRipples_=[];try{for(var r=iz(this.buttons_),o=r.next();!o.done;o=r.next()){var a=o.value;this.buttonRipples_.push(new rt(a))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},t.prototype.initialSyncWithDOM=function(){var e,t=this;this.focusTrap_=(e=this.container_,(0,this.focusTrapFactory_)(e,{initialFocusEl:this.getInitialFocusEl_()||void 0})),this.handleClick_=this.foundation.handleClick.bind(this.foundation),this.handleKeydown_=this.foundation.handleKeydown.bind(this.foundation),this.handleDocumentKeydown_=this.foundation.handleDocumentKeydown.bind(this.foundation),this.handleLayout_=this.layout.bind(this);var n=["resize","orientationchange"];this.handleOpening_=function(){n.forEach(function(e){return window.addEventListener(e,t.handleLayout_)}),document.addEventListener("keydown",t.handleDocumentKeydown_)},this.handleClosing_=function(){n.forEach(function(e){return window.removeEventListener(e,t.handleLayout_)}),document.removeEventListener("keydown",t.handleDocumentKeydown_)},this.listen("click",this.handleClick_),this.listen("keydown",this.handleKeydown_),this.listen(s9.OPENING_EVENT,this.handleOpening_),this.listen(s9.CLOSING_EVENT,this.handleClosing_)},t.prototype.destroy=function(){this.unlisten("click",this.handleClick_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(s9.OPENING_EVENT,this.handleOpening_),this.unlisten(s9.CLOSING_EVENT,this.handleClosing_),this.handleClosing_(),this.buttonRipples_.forEach(function(e){return e.destroy()}),e.prototype.destroy.call(this)},t.prototype.layout=function(){this.foundation.layout()},t.prototype.open=function(){this.foundation.open()},t.prototype.close=function(e){void 0===e&&(e=""),this.foundation.close(e)},t.prototype.getDefaultFoundation=function(){var e=this;return new s7({addBodyClass:function(e){return document.body.classList.add(e)},addClass:function(t){return e.root.classList.add(t)},areButtonsStacked:function(){var t,n;return t=e.buttons_,n=new Set,[].forEach.call(t,function(e){return n.add(e.offsetTop)}),n.size>1},clickDefaultButton:function(){return e.defaultButton_&&e.defaultButton_.click()},eventTargetMatches:function(e,t){return!!e&&iW(e,t)},getActionFromEvent:function(e){if(!e.target)return"";var t=iV(e.target,"["+s9.ACTION_ATTRIBUTE+"]");return t&&t.getAttribute(s9.ACTION_ATTRIBUTE)},getInitialFocusEl:function(){return e.getInitialFocusEl_()},hasClass:function(t){return e.root.classList.contains(t)},isContentScrollable:function(){var t;return!!(t=e.content_)&&t.scrollHeight>t.offsetHeight},notifyClosed:function(t){return e.emit(s9.CLOSED_EVENT,t?{action:t}:{})},notifyClosing:function(t){return e.emit(s9.CLOSING_EVENT,t?{action:t}:{})},notifyOpened:function(){return e.emit(s9.OPENED_EVENT,{})},notifyOpening:function(){return e.emit(s9.OPENING_EVENT,{})},releaseFocus:function(){return e.focusTrap_.releaseFocus()},removeBodyClass:function(e){return document.body.classList.remove(e)},removeClass:function(t){return e.root.classList.remove(t)},reverseButtons:function(){e.buttons_.reverse(),e.buttons_.forEach(function(e){e.parentElement.appendChild(e)})},trapFocus:function(){return e.focusTrap_.trapFocus()}})},t.prototype.getInitialFocusEl_=function(){return this.root.querySelector("["+s9.INITIAL_FOCUS_ATTRIBUTE+"]")},t}(iH),lt=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let ln=n(99253),li=n(73041);class lr extends CustomEvent{constructor(){super(lr.NAME,{bubbles:!0,composed:!0})}}lr.NAME="or-mwc-dialog-opened";class lo extends CustomEvent{constructor(e){super(lo.NAME,{detail:e,bubbles:!0,composed:!0})}}function la(e,t){return t||(t=ll.DialogHostElement||document.body),e.setOpen(!0),e.addEventListener(lr.NAME,e=>{e.stopPropagation()}),e.addEventListener(lo.NAME,t=>{t.stopPropagation(),window.setTimeout(()=>{e.parentElement&&e.parentElement.removeChild(e)},0)}),t.append(e),e}lo.NAME="or-mwc-dialog-closed";let ls=u`
|
|
1076
1076
|
:host {
|
|
1077
1077
|
position: relative;
|
|
1078
1078
|
}
|
|
@@ -1099,7 +1099,7 @@ uniform ${n} ${i} u_${r};
|
|
|
1099
1099
|
max-width: 1024px;
|
|
1100
1100
|
}
|
|
1101
1101
|
}
|
|
1102
|
-
`,
|
|
1102
|
+
`,ll=class extends em{constructor(){super(...arguments),this._open=!1,this._popstateEventBind=e=>this._onBrowserNavigate(e)}static get styles(){return[u`${d(ln)}`,u`${d(li)}`,ls]}get isOpen(){return!!this._mdcComponent&&this._mdcComponent.isOpen}setOpen(e){return this._open=!0,this}setHeading(e){return this.heading=e,this}setContent(e){return this.content=e,this}setActions(e){return this.actions=e,this}setDismissAction(e){return this.dismissAction=e,this}setStyles(e){return this.styles=e,this}setAvatar(e){return this.avatar=e,this}open(){this._mdcElem&&!this._mdcComponent&&(this._mdcComponent=new le(this._mdcElem),this._mdcComponent.scrimClickAction=this.dismissAction||null===this.dismissAction?"close":""),this._mdcComponent&&this._mdcComponent.open()}close(e){this._mdcComponent&&this._mdcComponent.close(e)}connectedCallback(){super.connectedCallback(),window.addEventListener("popstate",this._popstateEventBind)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("popstate",this._popstateEventBind),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0)}render(){return K`
|
|
1103
1103
|
${"string"==typeof this.styles?K`<style>${this.styles}</style>`:this.styles||""}
|
|
1104
1104
|
|
|
1105
1105
|
<div id="dialog"
|
|
@@ -1120,7 +1120,7 @@ uniform ${n} ${i} u_${r};
|
|
|
1120
1120
|
<footer class="mdc-dialog__actions">
|
|
1121
1121
|
${this.actions?this.actions.map(e=>K`
|
|
1122
1122
|
<div class="mdc-button mdc-dialog__button" ?data-mdc-dialog-button-default="${e.default}" data-mdc-dialog-action="${e.disabled?void 0:e.actionName}">
|
|
1123
|
-
${"string"==typeof e.content?K`<or-mwc-input .type="${
|
|
1123
|
+
${"string"==typeof e.content?K`<or-mwc-input .type="${sq.BUTTON}" @or-mwc-input-changed="${e=>{e.currentTarget.disabled&&e.stopPropagation()}}" .disabled="${e.disabled}" .label="${e.content}"></or-mwc-input>`:e.content}
|
|
1124
1124
|
</div>`):""}
|
|
1125
1125
|
</footer>
|
|
1126
1126
|
`:K`
|
|
@@ -1132,7 +1132,7 @@ uniform ${n} ${i} u_${r};
|
|
|
1132
1132
|
</div>
|
|
1133
1133
|
<div class="mdc-dialog__scrim"></div>
|
|
1134
1134
|
</div>
|
|
1135
|
-
`}updated(e){super.updated(e),e.has("_open")&&this._open&&this.open()}_onDialogOpened(){this.dispatchEvent(new
|
|
1135
|
+
`}updated(e){super.updated(e),e.has("_open")&&this._open&&this.open()}_onDialogOpened(){this.dispatchEvent(new lr)}_onDialogClosed(e){if("close"===e&&this.dismissAction&&this.dismissAction.action)this.dismissAction.action(this);else if(e&&this.actions){let t=this.actions.find(t=>t.actionName===e);t&&t.action&&t.action(this)}this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this.dispatchEvent(new lo(e))}_onBrowserNavigate(e){this.close("close")}};lt([eb({type:String})],ll.prototype,"heading",void 0),lt([eb({type:Object,attribute:!1})],ll.prototype,"content",void 0),lt([eb({type:Array,attribute:!1})],ll.prototype,"actions",void 0),lt([eb({type:Object,attribute:!1})],ll.prototype,"dismissAction",void 0),lt([eb({type:Boolean})],ll.prototype,"avatar",void 0),lt([eb()],ll.prototype,"styles",void 0),lt([eb({attribute:!1})],ll.prototype,"_open",void 0),lt([ev("#dialog")],ll.prototype,"_mdcElem",void 0),ll=lt([ep("or-mwc-dialog")],ll);var lc=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};class ld extends CustomEvent{constructor(e){super(ld.NAME,{bubbles:!0,composed:!0,detail:e})}}ld.NAME="or-map-asset-card-load-asset";let lu={default:{exclude:["notes"]},assetTypes:{}},lh=class extends ik(iO)(em){constructor(){super(...arguments),this.useAssetColor=!0}static get styles(){return aD}shouldUpdate(e){return(!e.has("assetId")||(this.title="",this.assetIds=this.assetId&&this.assetId.length>0?[this.assetId]:void 0,1!==e.size))&&super.shouldUpdate(e)}_onEvent(e){if("asset"===e.eventType)switch(e.cause){case"READ":case"CREATE":case"UPDATE":this.asset=e.asset;break;case"DELETE":this.asset=void 0}"attribute"===e.eventType&&this.asset&&(this.asset=t4(this.asset,e),this.requestUpdate())}getCardConfig(){let e=this.config||lu;return this.asset&&e.assetTypes&&e.assetTypes.hasOwnProperty(this.asset.type)?e.assetTypes[this.asset.type]:e.default}render(){var e;if(!this.asset)return K``;let t=this.getIcon(),n=this.getColor(),i=this.getCardConfig(),r=Object.values(this.asset.attributes).filter(e=>"location"!==e.name),o=i&&i.include?i.include:void 0,a=i&&i.exclude?i.exclude:[],s=r.filter(e=>(!o||o.indexOf(e.name)>=0)&&(!a||0>a.indexOf(e.name))&&(!e.meta||!e.meta.hasOwnProperty("showOnDashboard")||!!tZ("showOnDashboard",e))).sort((e=e=>e.name,(t,n)=>{let i=e(t),r=e(n);return i||r?i&&!r?1:!i&&r?-1:i.localeCompare(r):0})),l=function(e,t){let n=s1(e,t);if(n)return n.attributeName}(this.markerconfig,this.asset.type);return K`
|
|
1136
1136
|
<div id="card-container" style="${n?"--internal-or-map-asset-card-header-color: #"+n+";":""}">
|
|
1137
1137
|
<div id="header">
|
|
1138
1138
|
${t?K`<or-icon icon="${t}"></or-icon>`:""}
|
|
@@ -1140,16 +1140,16 @@ uniform ${n} ${i} u_${r};
|
|
|
1140
1140
|
</div>
|
|
1141
1141
|
<div id="attribute-list">
|
|
1142
1142
|
<ul>
|
|
1143
|
-
${s.map(e=>{if(!this.asset||!this.asset.type)return;let t=tY.getAttributeAndValueDescriptors(this.asset.type,e.name,e);if(t&&t.length){var n,i,r;let o=(n=t[0],tQ(e,n,this.asset.type,!0,!0,void 0)),a=(i=t[0],r=this.asset.type,t0(e,i,r,!1,!0,"-")),s={highlighted:l===e.name};return K`<li class="${
|
|
1143
|
+
${s.map(e=>{if(!this.asset||!this.asset.type)return;let t=tY.getAttributeAndValueDescriptors(this.asset.type,e.name,e);if(t&&t.length){var n,i,r;let o=(n=t[0],tQ(e,n,this.asset.type,!0,!0,void 0)),a=(i=t[0],r=this.asset.type,t0(e,i,r,!1,!0,"-")),s={highlighted:l===e.name};return K`<li class="${iP(s)}"><span class="attribute-name">${o}</span><span class="attribute-value">${a}</span></li>`}})}
|
|
1144
1144
|
</ul>
|
|
1145
1145
|
</div>
|
|
1146
1146
|
${i&&i.hideViewAsset?K``:K`
|
|
1147
1147
|
<div id="footer">
|
|
1148
|
-
<or-mwc-input .type="${
|
|
1148
|
+
<or-mwc-input .type="${sq.BUTTON}" label="viewAsset" @or-mwc-input-changed="${e=>{e.preventDefault(),this._loadAsset(this.asset.id)}}"></or-mwc-input>
|
|
1149
1149
|
</div>
|
|
1150
1150
|
`}
|
|
1151
1151
|
</div>
|
|
1152
|
-
`}_loadAsset(e){this.dispatchEvent(new
|
|
1152
|
+
`}_loadAsset(e){this.dispatchEvent(new ld(e))}getIcon(){var e;if(this.asset)return(null==(e=ax(tY.getAssetDescriptor(this.asset.type)))?void 0:e.icon)||void 0}getColor(){var e;if(this.asset){let t=null==(e=ax(tY.getAssetDescriptor(this.asset.type)))?void 0:e.color;if(t)return"string"==typeof t?t:t[0].colour}}};lc([eb({type:String,reflect:!0,attribute:!0})],lh.prototype,"assetId",void 0),lc([eb({type:Object,attribute:!0})],lh.prototype,"asset",void 0),lc([eb({type:Object})],lh.prototype,"config",void 0),lc([eb({type:Object})],lh.prototype,"markerconfig",void 0),lc([eb({type:Boolean,attribute:!0})],lh.prototype,"useAssetColor",void 0),lh=lc([ep("or-map-asset-card")],lh);var lm=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};class lf extends CustomEvent{constructor(){super(lf.NAME,{bubbles:!0,composed:!0})}}lf.NAME="or-map-loaded";class lp extends CustomEvent{constructor(e,t=!1){super(lp.NAME,{detail:{doubleClick:t,lngLat:e},bubbles:!0,composed:!0})}}lp.NAME="or-map-clicked";class lg extends CustomEvent{constructor(e){super(lg.NAME,{detail:{doubleClick:!1,lngLat:e},bubbles:!0,composed:!0})}}lg.NAME="or-map-long-press";class lb extends CustomEvent{constructor(e){super(lb.NAME,{detail:{geocode:e},bubbles:!0,composed:!0})}}lb.NAME="or-map-geocoder-change";class l_{onAdd(e){this.map=e;let t=document.createElement("div");t.classList.add("maplibregl-ctrl"),t.classList.add("maplibregl-ctrl-group");let n=document.createElement("button");n.className="maplibregl-ctrl-compass",n.addEventListener("click",t=>e.flyTo({center:this.pos,zoom:e.getZoom()}));let i=document.createElement("span");return i.className="maplibregl-ctrl-icon",n.appendChild(i),t.appendChild(n),this.elem=t,t}onRemove(e){this.map=void 0,this.elem=void 0}}let ly="^[ ]*(?:Lat: )?(-?\\d+\\.?\\d*)[, ]+(?:Lng: )?(-?\\d+\\.?\\d*)[ ]*$";function lv(e){return t=>{if("Enter"===t.code||"NumpadEnter"===t.code){let n=t.target.value,i=n?{}:void 0;if(n){let e=n.split(/[ ,]/).filter(e=>!!e);2===e.length&&(i=new ag.LngLat(Number.parseFloat(e[0]),Number.parseFloat(e[1])))}e(i)}}}class lx{constructor(e=!1,t){this._readonly=!1,this._readonly=e,this._valueChangedHandler=t}onAdd(e){this.map=e;let t=document.createElement("div");t.classList.add("maplibregl-ctrl"),t.classList.add("maplibregl-ctrl-group");let n=new at;return n.type=sq.TEXT,n.outlined=!0,n.compact=!0,n.readonly=this._readonly,n.icon="crosshairs-gps",n.value=this._value,n.pattern=ly,n.onkeyup=lv(this._valueChangedHandler),t.appendChild(n),this.elem=t,this.input=n,t}onRemove(e){this.map=void 0,this.elem=void 0}set readonly(e){this._readonly=e,this.input&&(this.input.readonly=e)}set value(e){this._value=e,this.input&&(this.input.value=e)}}let lw=class extends em{constructor(){super(),this.type=iO.mapType,this._markerStyles=[],this.showGeoCodingControl=!1,this.showBoundaryBoxControl=!1,this.useZoomControl=!0,this.showGeoJson=!0,this.boundary=[],this._loaded=!1,this._markers=[],this.addEventListener(sZ.NAME,this._onMarkerChangedEvent)}firstUpdated(e){super.firstUpdated(e),iO.ready&&this.loadMap()}get markers(){return this._markers}connectedCallback(){super.connectedCallback()}disconnectedCallback(){var e;super.disconnectedCallback(),this._observer&&this._observer.disconnect(),this._resizeObserver&&this._resizeObserver.disconnect(),null==(e=this._map)||e.unload()}render(){return K`
|
|
1153
1153
|
<div id="container">
|
|
1154
1154
|
<div id="map"></div>
|
|
1155
1155
|
<slot></slot>
|
|
@@ -1157,7 +1157,7 @@ uniform ${n} ${i} u_${r};
|
|
|
1157
1157
|
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAABGdBTUEAAYagMeiWXwAAAAJiS0dEAP+Hj8y/AAAESUlEQVRIx5XVbWzdZRnH8c//f07POe36sK7SrYXZjYGzbBokOqd4QtKATdnMDFFSkoFzmWGRQOAFSoYnsBSzxBdmGsN4Y7LEFwZkUdHpDoja/AnJjBvp1sm2upW5PtAV+zBS+7Tz//tiLe0emPF+d9/39fvmunJf9+8K3HBF1drFzurVn5+5XkTwPwBNOt1s0pCjDnnT+Xzy/wOa5jaXnLLfLwzlF0WENwaYckyvUTHS1tnjl+6JFqk+JoMOqqy2JqjPVpXP1k7U1+Ty8paBPk97NX/pYwEdgZUetNkdlirDrHGnyv6y5r3lm4M2WVzwpJfz8XUBHTntnrJO6qqLWE9u/125zBNq0WebN/PXAjqq/cBOVWDasCEsd5MsmEzt/3xP+S6fwNsezPdfBejI6fCEDMa95oAT/t31pVxDQ6p6oy2WYSb18w0D2V3Klez2w3y8CNAR2G6vShxXUCxMkXLvS7Y6E/5+3emaJ92JqezzG+8M2nHW/flTi59xladU4phtfluYgnsDWUt8Nv7+8UfO73UUuenvDLxuCKu0RQt90BFo14wxzzpamD8uExtHSsu5HSP7XMCtZ5uTPyO0SdVCBlXahHjNG4WFrGY9Y4tXzODL7zb7NYJS64eHzWK92xYAa9yBKa8Wphf0xaQ4XOz0qF9JhMnXh//mIm4dnDSMOusWALepwQUnrm2t4pi9hrGyP+ccloxV6kOZFemoWi2mOpclaQycqGlt9R8XHS/GixinnVWvbDpjDEEpNpdnWrtd+HvZWzMQT9xjj1iXzUau6MPS9X9NKOeTmqzPpZWwfMkEKnza2ivimqxCKZjQa9BMmFI2D+gxibql4z7EiobYOSy1o7V6Xt1aYacGvD/7lse1+GZ9t0Zc8kHaGcOa1K6o+FePL1iy7K7wYHy70FZa9+qVWOm7tgslfpecKcy46GS0xXKM6g6d14VU+RfTnRJ8Y223w8j4tkMOOeR1j6nAMT8tzkCUcvlbn3ImbJn0RyWC+1af1Iv6ukcbf+aIRKDR3b5ipVCiy+PenaupWRsSfzCWim0ftUmdiqrJwWLpbmk3196UfXG0X6NKIWKDXva0I0UQZT2nRaDfc/mhgCj0PS9ImZzefbg5fliIvuTA++/0ZaYDTDqqpzhn6lHoW36iSuLHnslfCiBqdMBGDI6/0LUhfkgGiWFbC29c+epRaJMX3YJuD+R75l15wG4DaKh5dsPJsj0GXLaawavkWY/MyUcU/JOPHCkK7fAjNZiIf/PeX/vWx1814muF0Y/EKWs95mFVuKhgX352EYAoY5vnNSDRF/9p/MgHfQ2dldNIqbPeJm2aBBix20vzg26RpUUpLfb43FxZU4YMmEJGoxXKQeIfCg4uzMkrTDVitZ0ecst1B05i0Cv26Vk8H68JjFKabXa/Zkul5w5Lxp120EHdlyu/AQCiQI1P+YxaGcwY1+20kasnM/wXCa5/Ik1hKTEAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTktMDgtMjBUMTU6MTc6NTUrMDA6MDCwJSdSAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE5LTA4LTIwVDE1OjE3OjU1KzAwOjAwwXif7gAAAABJRU5ErkJggg==" />
|
|
1158
1158
|
</a>
|
|
1159
1159
|
</div>
|
|
1160
|
-
`}updated(e){var t;super.updated(e),(e.has("center")||e.has("zoom"))&&this.flyTo(this.center,this.zoom),e.has("boundary")&&this.showBoundaryBoxControl&&(null==(t=this._map)||t.createBoundaryBox(this.boundary))}refresh(){this._map&&this._map.loadViewSettings().then(()=>{this._map&&(this._map.setCenter(),this._map.flyTo())})}loadMap(){this._loaded||(this._mapContainer&&this._slotElement&&(this._map=new aA(this.type,this.shadowRoot,this._mapContainer,this.showGeoCodingControl,this.showBoundaryBoxControl,this.useZoomControl,this.showGeoJson).setCenter(this.center).setZoom(this.zoom).setControls(this.controls).setGeoJson(this.geoJson),this._map.load().then(()=>{this._observer=new am(this._slotElement,e=>{this._processNewMarkers(e.addedNodes),this._processRemovedMarkers(e.removedNodes)}),null==(e=this._resizeObserver)||e.disconnect(),this._resizeObserver=new ResizeObserver((0,tG.debounce)(()=>{this.resize()},200));var e,t,n=null==(t=this._mapContainer)?void 0:t.parentElement;n&&this._resizeObserver.observe(n)})),this._loaded=!0)}resize(){this._map&&this._map.resize()}flyTo(e,t){this._map&&this._map.flyTo(e,t)}_onMarkerChangedEvent(e){this._map&&this._map.onMarkerChanged(e.detail.marker,e.detail.property)}_processNewMarkers(e){e.forEach(e=>{if(this._map&&e instanceof sK){this._markers.push(e);let t=e.constructor.name;if(0>this._markerStyles.indexOf(t)){let n=e.constructor.styles,i=[];n&&(Array.isArray(n)?i=n:i.push(n),i.forEach(e=>{let t=document.createElement("style");t.textContent=String(e.toString()),this._mapContainer.children.length>0?this._mapContainer.insertBefore(t,this._mapContainer.children[0]):this._mapContainer.appendChild(t)})),this._markerStyles.push(t)}this._map.addMarker(e)}})}_processRemovedMarkers(e){e.forEach(e=>{if(this._map&&e instanceof sK){let t=this._markers.indexOf(e);t>=0&&this._markers.splice(t,1),this._map.removeMarker(e)}})}};l_.styles=aS,lc([eb({type:String})],l_.prototype,"type",void 0),lc([eb({type:String,converter:{fromAttribute(e,t){if(!e)return;let n=e.split(",");if(2===n.length)return new af.LngLat(Number(n[0]),Number(n[1]))},toAttribute(e,t){let n=a_(e);return n?""+n.lng+","+n.lat:""}}})],l_.prototype,"center",void 0),lc([eb({type:Number})],l_.prototype,"zoom",void 0),lc([eb({type:Boolean})],l_.prototype,"showGeoCodingControl",void 0),lc([eb({type:Boolean})],l_.prototype,"showBoundaryBoxControl",void 0),lc([eb({type:Boolean})],l_.prototype,"useZoomControl",void 0),lc([eb({type:Object})],l_.prototype,"geoJson",void 0),lc([eb({type:Boolean})],l_.prototype,"showGeoJson",void 0),lc([eb({type:Array})],l_.prototype,"boundary",void 0),lc([ev("#map")],l_.prototype,"_mapContainer",void 0),lc([ev("slot")],l_.prototype,"_slotElement",void 0),l_=lc([ep("or-map")],l_);var ly=n(86834),lv=n.n(ly),lx=n(24340),lw=n.n(lx),lF=n(52635),lk=n.n(lF),lE=n(99717),lA=n.n(lE),lC=n(33795),lT=n.n(lC),lS=n(23973),lM=n.n(lS),lL=n(56786),lD=n.n(lL),lI=n(77236),lR=n.n(lI),lO=n(66901),lP=n.n(lO),l$=n(72115),lN=n.n(l$),lB=n(56817),lz=n.n(lB),lj=n(86330),lY=n.n(lj),lH=n(89793),lU=n.n(lH),lV=n(86349),lW=n.n(lV),lG=n(99381),lq=n.n(lG),lK=n(4626),lX=n.n(lK),lZ=n(86580),lJ=n.n(lZ),lQ=n(93839),l0=n.n(lQ),l1=n(80340),l2=n.n(l1);n(43913),n(81788),n(22972),n(20520),n(16334),n(72720);let l5="additionalProperties",l3="required";class l4{constructor(e){this.findOption=e,this.schemaObject=e=>{let t=this.properties(e),n={type:"object",properties:t,additionalProperties:this.findOption(t)(l5)},i=this.findOption(t)(l3);return i.length>0&&(n.required=i),n},this.properties=e=>Object.keys(e).reduce((t,n)=>(t[n]=this.property(e[n]),t),{}),this.property=e=>{switch(typeof e){case"string":return{type:"string"};case"boolean":return{type:"boolean"};case"number":if(Number.isInteger(e))return{type:"integer"};return{type:"number"};case"object":if(null==e)return{type:"null"};return this.schemaObjectOrArray(e);default:return{}}},this.schemaObjectOrArray=e=>e instanceof Array?this.schemaArray(e):this.schemaObject(e),this.schemaArray=e=>{if(!(e.length>0))return{type:"array",items:{}};{let t=((e,t)=>{let n={};return e.filter(e=>{let i=t(e);return!Object.prototype.hasOwnProperty.call(n,i)&&(n[i]=!0,!0)})})(e.map(this.property),e=>JSON.stringify(e));return 1===t.length?{type:"array",items:t[0]}:{type:"array",items:{oneOf:t}}}}}}let l6=(e,t={})=>new l4(e=>n=>{switch(n){case l5:if(Object.prototype.hasOwnProperty.call(t,l5))return t[l5];return!0;case l3:if(Object.prototype.hasOwnProperty.call(t,l3))return t[l3](e);return Object.keys(e);default:return}}).schemaObject(e),l8=new Set,l7=(e,t)=>t<=1?e:e+t.toString(),l9=(e,t)=>{let n=l7(e,t);return!l8.has(n)},ce=e=>l8.delete(e),ct=(e,t)=>{let n=e;return(lv()(e)||lv()(t)||t.startsWith("[")||(n=e+"."),lv()(n))?t:lv()(t)?n:`${n}${t}`},cn=e=>e?.replace(/~1/g,"/").replace(/~0/,"~"),ci=(e,t)=>{if(t&&"string"==typeof t.title)return t.title;if("string"==typeof e.scope){let t=e.scope,n=cn(t.substr(t.lastIndexOf("/")+1));return lw()(n)}return""},cr=(e,t)=>({text:e,show:t}),co=(e,t)=>lv()(t)?e:t.split(".").reduce((e,t)=>{if(e&&Object.prototype.hasOwnProperty.call(e,t))return e[t]},e),ca=(e,t,n)=>cs(e,t?.split("/").map(cn),n),cs=(e,t,n)=>{if(lv()(e))return;if("string"==typeof e.$ref&&(e=ca(n,e.$ref,n)),!t||0===t.length)return e;let[i,...r]=t;if((e=>"#"===e||void 0===e||""===e)(i))return cs(e,r,n);let o=cs(lT()(e,i),r,n);if(o)return o;if("properties"===i||"items"===i){let t;for(let o of[].concat(e.oneOf??[],e.allOf??[],e.anyOf??[],e.then??[],e.else??[]))if(t=cs(o,[i,...r],n))break;return t}};!function(e){e.HIDE="HIDE",e.SHOW="SHOW",e.ENABLE="ENABLE",e.DISABLE="DISABLE"}(e1||(e1={}));let cl=(e,t)=>{if(!cd(e))return t??"";let n=(e=>{let t=e.replace(/(anyOf|allOf|oneOf)\/[\d]+\//g,"").replace(/(then|else)\//g,"").split("/").map(cn),n="#"===t[0]||""===t[0];return lA()(n?2:1,t.length,2).map(e=>t[e])})(e.scope);return lv()(n)?t??"":ct(t,n.join("."))},cc=e=>"object"==typeof e&&null!==e&&"string"==typeof e.i18n,cd=e=>(e=>!!e&&"object"==typeof e)(e)&&"string"==typeof e.scope,cu=(e,t)=>cl(e,t),ch=(e,t,n,i)=>{if("AND"===t.type)return t.conditions.reduce((t,r)=>t&&ch(e,r,n,i),!0);if("OR"===t.type)return t.conditions.reduce((t,r)=>t||ch(e,r,n,i),!1);if("LEAF"===t.type)return co(e,cu(t,n))===t.expectedValue;if(!lM()(t,"schema"))return!0;{let r=co(e,cu(t,n));return(!t.failWhenUndefined||void 0!==r)&&i.validate(t.schema,r)}},cm=(e,t,n,i)=>ch(t,e.rule.condition,n,i),cf=e=>!!e.rule&&(e.rule.effect===e1.SHOW||e.rule.effect===e1.HIDE),cp=(e,t,n,i)=>!e.rule||((e,t,n,i)=>{let r=cm(e,t,n,i);switch(e.rule.effect){case e1.HIDE:return!r;case e1.SHOW:return r;default:return!0}})(e,t,n,i),cg=e=>!!e&&Object.prototype.hasOwnProperty.call(e,"oneOf")&&e.oneOf&&e.oneOf.every(e=>void 0!==e.const),cb=(e,t)=>lP()(c_(e),t),c_=e=>{if(lv()(e))return[];if(!lv()(e.type)&&"string"==typeof e.type)return[e.type];if(lR()(e.type))return e.type;if(!lv()(e.properties)||!lv()(e.additionalProperties))return["object"];if(!lv()(e.items))return["array"];if(!lv()(e.enum)){let t=new Set;return e.enum.forEach(e=>{"string"==typeof e?t.add("string"):c_(e).forEach(e=>t.add(e))}),Array.from(t)}if(!lv()(e.allOf)){let t=lD()(e.allOf,e=>0!==c_(e).length);if(t)return c_(t)}return[]},cy={schema:ca,data:co},cv={compose:ct},cx=e=>{let t=new(lN())({allErrors:!0,verbose:!0,strict:!1,addUsedSchema:!1,...e});return lz()(t),t},cw=(e,t)=>void 0===e||e(t)?[]:e.errors,cF=e=>{let t=e.dataPath||e.instancePath||"";t=t.replace(/\//g,".");let n=(e=>{switch(e.keyword){case"required":case"dependencies":return e.params.missingProperty;case"additionalProperties":return e.params.additionalProperty;default:return}})(e);return void 0===n||t.endsWith(n)||(t=`${t}.${n}`),t=cn(t=t.replace(/^./,""))},ck=["additionalProperties","allOf","anyOf","oneOf"],cE=e=>({type:e,elements:[]}),cA=e=>({type:"Control",scope:e}),cC=(e,t,n,i,r,o)=>{if(!lv()(e)&&void 0!==e.$ref)return cC(ca(o,e.$ref,o),t,n,i,r,o);if((e=>!lv()(e)&&(!lv()(e.oneOf)||!lv()(e.anyOf)||!lv()(e.allOf)))(e)){let e=cA(n);return t.push(e),e}let a=c_(e);if(0===a.length)return null;if(a.length>1){let e=cA(n);return t.push(e),e}if("#"===n&&"object"===a[0]){let a=cE(r);if(t.push(a),e.properties&&lk()(e.properties).length>1&&((e,t)=>{if(!lv()(t)){let n=lw()(t);"Group"===e.type?e.label=n:e.elements.push({type:"Label",text:n})}})(a,i),!lv()(e.properties)){let t=n+"/properties";Object.keys(e.properties).map(n=>{let i,s=e.properties[n],l=`${t}/${(i=n,i?.replace(/~/g,"~0").replace(/\//g,"~1"))}`;void 0!==s.$ref&&(s=ca(o,s.$ref,o)),cC(s,a.elements,l,n,r,o)})}return a}switch(a[0]){case"object":case"array":case"string":case"number":case"integer":case"null":case"boolean":{let e=cA(n);return t.push(e),e}default:throw Error("Unknown type: "+JSON.stringify(e))}},cT=(e,t="VerticalLayout",n="#",i=e)=>((e,t)=>{if(!lv()(e)&&void 0===e.elements){let n=cE(t);return n.elements.push(e),n}return e})(cC(e,[],n,"",t,i),t),cS={uiSchema:cT},cM="jsonforms/INIT",cL="jsonforms/UPDATE_CORE",cD="jsonforms/SET_AJV",cI="jsonforms/UPDATE",cR="jsonforms/UPDATE_ERRORS",cO="jsonforms/ADD_RENDERER",cP="jsonforms/REMOVE_RENDERER",c$="jsonforms/ADD_CELL",cN="jsonforms/REMOVE_CELL",cB="jsonforms/SET_CONFIG",cz="jsonforms/ADD_UI_SCHEMA",cj="jsonforms/REMOVE_UI_SCHEMA",cY="jsonforms/SET_SCHEMA",cH="jsonforms/SET_UISCHEMA",cU="jsonforms/SET_VALIDATION_MODE",cV="jsonforms/SET_LOCALE",cW="jsonforms/SET_TRANSLATOR",cG="jsonforms/UPDATE_I18N",cq="jsonforms/ADD_DEFAULT_DATA",cK="jsonforms/REMOVE_DEFAULT_DATA",cX=(e,t,n)=>({type:cI,path:e,updater:t,context:n}),cZ=e=>({type:cB,config:e});var cJ=Object.freeze({__proto__:null,INIT:cM,UPDATE_CORE:cL,SET_AJV:cD,UPDATE_DATA:cI,UPDATE_ERRORS:cR,VALIDATE:"jsonforms/VALIDATE",ADD_RENDERER:cO,REMOVE_RENDERER:cP,ADD_CELL:c$,REMOVE_CELL:cN,SET_CONFIG:cB,ADD_UI_SCHEMA:cz,REMOVE_UI_SCHEMA:cj,SET_SCHEMA:cY,SET_UISCHEMA:cH,SET_VALIDATION_MODE:cU,SET_LOCALE:cV,SET_TRANSLATOR:cW,UPDATE_I18N:cG,ADD_DEFAULT_DATA:cq,REMOVE_DEFAULT_DATA:cK,isUpdateArrayContext:e=>{if(!("type"in e)||"string"!=typeof e.type)return!1;switch(e.type){case"ADD":return"values"in e&&Array.isArray(e.values)&&e.values.length>0;case"REMOVE":return"indices"in e&&Array.isArray(e.indices)&&e.indices.length>0&&e.indices.every(e=>"number"==typeof e);case"MOVE":return"moves"in e&&Array.isArray(e.moves)&&e.moves.length>0&&e.moves.every(e=>"object"==typeof e&&null!==e&&"from"in e&&"to"in e&&"number"==typeof e.from&&"number"==typeof e.to);default:return!1}},init:(e,t=l6(e),n,i)=>({type:cM,data:e,schema:t,uischema:"object"==typeof n?n:cT(t),options:i}),updateCore:(e,t,n,i)=>({type:cL,data:e,schema:t,uischema:n,options:i}),registerDefaultData:(e,t)=>({type:cq,schemaPath:e,data:t}),unregisterDefaultData:e=>({type:cK,schemaPath:e}),setAjv:e=>({type:cD,ajv:e}),update:cX,updateErrors:e=>({type:cR,errors:e}),registerRenderer:(e,t)=>({type:cO,tester:e,renderer:t}),registerCell:(e,t)=>({type:c$,tester:e,cell:t}),unregisterCell:(e,t)=>({type:cN,tester:e,cell:t}),unregisterRenderer:(e,t)=>({type:cP,tester:e,renderer:t}),setConfig:cZ,setValidationMode:e=>({type:cU,validationMode:e}),registerUISchema:(e,t)=>({type:cz,tester:e,uischema:t}),unregisterUISchema:e=>({type:cj,tester:e}),setLocale:e=>({type:cV,locale:e}),setSchema:e=>({type:cY,schema:e}),setTranslator:(e,t)=>({type:cW,translator:e,errorTranslator:t}),updateI18n:(e,t,n)=>({type:cG,locale:e,translator:t,errorTranslator:n}),setUISchema:e=>({type:cH,uischema:e})});let cQ={restrict:!1,trim:!1,showUnfocusedDescription:!1,hideRequiredAsterisk:!1},c0=(e={})=>lW()({},cQ,e),c1={data:{},schema:{},uischema:void 0,errors:[],validator:void 0,ajv:void 0,validationMode:"ValidateAndShow",additionalErrors:[]},c2=(e,t)=>t&&c5(t.options)?t.options.validationMode:e.validationMode,c5=e=>!!e&&void 0!==e.validationMode,c3=(e,t)=>t&&(e=>!!e&&void 0!==e.additionalErrors)(t.options)?t.options.additionalErrors:e.additionalErrors,c4=(e,t)=>{if(t){if(c6(t.options))return t.options.ajv;else if(void 0!==t.options&&l0()(t.options.compile))return t.options}return e.ajv?e.ajv:cx()},c6=e=>!!e&&void 0!==e.ajv;!function(e){e.addTooltip="addTooltip",e.addAriaLabel="addAriaLabel",e.removeTooltip="removeTooltip",e.upAriaLabel="upAriaLabel",e.downAriaLabel="downAriaLabel",e.noSelection="noSelection",e.removeAriaLabel="removeAriaLabel",e.noDataMessage="noDataMessage",e.deleteDialogTitle="deleteDialogTitle",e.deleteDialogMessage="deleteDialogMessage",e.deleteDialogAccept="deleteDialogAccept",e.deleteDialogDecline="deleteDialogDecline",e.up="up",e.down="down"}(e2||(e2={})),e2.addTooltip,e2.addAriaLabel,e2.removeTooltip,e2.removeAriaLabel,e2.upAriaLabel,e2.up,e2.down,e2.downAriaLabel,e2.noDataMessage,e2.noSelection,e2.deleteDialogTitle,e2.deleteDialogMessage,e2.deleteDialogAccept,e2.deleteDialogDecline,function(e){e.clearDialogTitle="clearDialogTitle",e.clearDialogMessage="clearDialogMessage",e.clearDialogAccept="clearDialogAccept",e.clearDialogDecline="clearDialogDecline"}(e5||(e5={})),e5.clearDialogTitle,e5.clearDialogMessage,e5.clearDialogAccept,e5.clearDialogDecline;let c8=(e,t)=>cc(t)?t.i18n:e?.i18n??void 0,c7=(e,t,n)=>c8(e,t)??(n?.split(".").filter(e=>!/^\d+$/.test(e)).join(".")||"root"),c9=(e,t,n,i)=>`${c7(e,t,n)}.${i}`,de=(e,t)=>t,dt=(e,t,n)=>{let i=t(c9(e.parentSchema,n,cF(e),`error.${e.keyword}`),void 0,{error:e});if(void 0!==i)return i;let r=t(`error.${e.keyword}`,void 0,{error:e});if(void 0!==r)return r;let o=t(e.message,void 0,{error:e});return void 0!==o?o:"required"===e.keyword&&e.message?.startsWith("must have required property")?t("is a required property","is a required property",{error:e}):e.message},dn=()=>e=>(e=>void 0===e?de:e.translate)(lT()(e,"jsonforms.i18n")),di=e=>!lv()(e)&&void 0!==e.scope,dr=e=>(t,n,i)=>{if(lv()(t)||!di(t)||lv()(n))return!1;let r=t.scope;if(lv()(r))return!1;let o=n;return cb(n,"object")&&(o=ca(n,r,i?.rootSchema)),void 0!==o&&e(o,i?.rootSchema)},da=(e,t)=>(n,i,r)=>{if(lv()(n)||!di(n))return!1;let o=n.scope,a=i;return cb(i,"object")&&(a=ca(i,o,r?.rootSchema)),void 0!==(a=lT()(a,e))&&t(a,r?.rootSchema)},ds=e=>dr(t=>!lv()(t)&&cb(t,e)),dl=e=>dr(t=>!lv()(t)&&t.format===e&&cb(t,"string")),dc=e=>t=>!lv()(t)&&t.type===e,dd=(e,t)=>n=>{if(lv()(n))return!1;let i=n.options;return!lv()(i)&&i[e]===t},du=(...e)=>(t,n,i)=>e.reduce((e,r)=>e&&r(t,n,i),!0),dh=(...e)=>(t,n,i)=>e.reduce((e,r)=>e||r(t,n,i),!1),dm=(e,t)=>(n,i,r)=>t(n,i,r)?e:-1,df=du(dc("Control"),ds("boolean")),dp=du(dc("Control"),ds("object")),dg=du(dc("Control"),dr(e=>Object.prototype.hasOwnProperty.call(e,"allOf"))),db=du(dc("Control"),dr(e=>Object.prototype.hasOwnProperty.call(e,"anyOf"))),d_=du(dc("Control"),dr(e=>Object.prototype.hasOwnProperty.call(e,"oneOf"))),dy=du(dc("Control"),dr(e=>(e=>!!e&&"object"==typeof e&&(Object.prototype.hasOwnProperty.call(e,"enum")||Object.prototype.hasOwnProperty.call(e,"const")))(e))),dv=du(dc("Control"),dr(e=>cg(e))),dx=du(dc("Control"),ds("integer")),dw=du(dc("Control"),ds("number")),dF=du(dc("Control"),ds("string"));du(dc("Control"),dd("multi",!0));let dk=du(dc("Control"),dh(dl("date"),dd("format","date"))),dE=du(dc("Control"),dh(dl("time"),dd("format","time"))),dA=du(dc("Control"),dh(dl("date-time"),dd("format","date-time"))),dC=du(dr((e,t)=>cb(e,"array")&&!Array.isArray(ca(e,"items",t))),da("items",(e,t)=>cb(e.$ref?ca(t,e.$ref,t):e,"object")));du(dc("Control"),dC),du(dc("Control"),dr((e,t)=>0!==c_(e).length&&!Array.isArray(ca(e,"items",t))),da("items",(e,t)=>{let n=c_(e.$ref?ca(t,e.$ref,t):e);return 1===n.length&&lP()(["integer","number","boolean","string"],n[0])})),du(dc("Control"),dh(ds("number"),ds("integer")),dr(e=>Object.prototype.hasOwnProperty.call(e,"maximum")&&Object.prototype.hasOwnProperty.call(e,"minimum")&&Object.prototype.hasOwnProperty.call(e,"default")),dd("slider",!0)),du(dc("Control"),ds("integer"),dd("format",!0));let dT=(e,t,n,i,r="VerticalLayout",o,a)=>{if(o&&o.options&&o.options.detail){if("string"==typeof o.options.detail){if("GENERATE"===o.options.detail.toUpperCase())return"function"==typeof r?r():cS.uiSchema(t,r,void 0,a)}else if("object"==typeof o.options.detail&&o.options.detail.type&&"string"==typeof o.options.detail.type)return o.options.detail}let s=((t,n,i)=>{let r=l2()(e,e=>e.tester(t,n,i));if(void 0!==r&&-1!==r.tester(t,n,i))return r.uischema})(t,n,i);return void 0===s?"function"==typeof r?r():cS.uiSchema(t,r,"#",a):s},dS=e=>dI(lT()(e,"jsonforms.core")),dM=e=>dR(lT()(e,"jsonforms.core")),dL=e=>dO(lT()(e,"jsonforms.core")),dD=e=>lT()(e,"jsonforms.renderers"),dI=e=>lT()(e,"data"),dR=e=>lT()(e,"schema"),dO=e=>lT()(e,"ajv"),dP=(e,t,n,i,r,o)=>!e?.jsonforms?.readonly&&(n&&(e=>!!e.rule&&(e.rule.effect===e1.ENABLE||e.rule.effect===e1.DISABLE))(n)?((e,t,n,i)=>!e.rule||((e,t,n,i)=>{let r=cm(e,t,n,i);switch(e.rule.effect){case e1.DISABLE:return!r;case e1.ENABLE:return r;default:return!0}})(e,t,n,i))(n,r,t?.path,dL(e)):"boolean"==typeof n?.options?.readonly?!n.options.readonly:"boolean"==typeof n?.options?.readOnly?!n.options.readOnly:"boolean"==typeof o?.readonly?!o.readonly:"boolean"==typeof o?.readOnly?!o.readOnly:i?.readOnly!==!0&&("boolean"!=typeof t?.enabled||t.enabled)),d$=(e,t,n)=>{let i=t+n;if(i<0||i>=e.length)return;let r=[t,i].sort((e,t)=>e-t);e.splice(r[0],2,e[r[1]],e[r[0]])},dN=(e,t,n)=>`${e??""}${t&&!n?"*":""}`,dB=(e,t)=>{let n=dz(e,t);return void 0===n?{}:n},dz=(e,t)=>{let n="string"==typeof e.$ref?cy.schema(t,e.$ref,t):e;if(void 0!==n.default)return dY(n,t);if(cb(n,"string"))return"date-time"===n.format||"date"===n.format||"time"===n.format?((e,t)=>{let n=e.toISOString();if("date-time"===t);else if("date"===t)return n.split("T")[0];else if("time"===t)return n.split("T")[1].split(".")[0];return n})(new Date,n.format):"";if(cb(n,"integer")||cb(n,"number"))return 0;if(cb(n,"boolean"))return!1;if(cb(n,"array"))return[];if(cb(n,"object"))return dY(n,t);if(cb(n,"null"))return null;for(let n of["oneOf","anyOf","allOf"])if(e[n]&&Array.isArray(e[n])){let i=dj(e[n],t);if(void 0!==i)return i}},dj=(e,t)=>{if(e.length>0)for(let n of e){let e=dz(n,t);if(void 0!==e)return e}},dY=(e,t)=>{if(cb(e,"object")&&void 0===e.default){let n={};for(let i in e.properties){let r=e.properties[i],o=r.$ref?cy.schema(t,r.$ref,t):r;o&&void 0!==o.default&&(n[i]=lq()(o.default))}return e.allOf&&Array.isArray(e.allOf)&&e.allOf.forEach(e=>{if(e&&e.properties)for(let i in e.properties){let r=e.properties[i],o=r.$ref?cy.schema(t,r.$ref,t):r;o&&void 0!==o.default&&(n[i]=lq()(o.default))}}),n}return lq()(e.default)},dH=(e,t)=>{let n,{uischema:i}=t,r=dS(e),o=cl(i,t.path),a=void 0===t.visible||cf(i)?cp(i,r,t.path,dL(e)):t.visible,s=t.id,l=dM(e),c=void 0!==i.scope&&((e,t,n)=>{let i=t.split("/"),r=cn(i[i.length-1]),o=i.slice(0,i.length-2).join("/"),a=cy.schema(e,o,n);return void 0!==a&&void 0!==a.required&&-1!==a.required.indexOf(r)})(t.schema,i.scope,l),d=cy.schema(t.schema||l,i.scope,l),u=(e=>((e,t)=>{let n;return n=t=>t===e,i=>{let r=i.errors??[],o=i.additionalErrors??[];return(i=>{let r=lY()(i,e=>"oneOf"===e.keyword||"anyOf"===e.keyword).map(e=>cF(e));return lY()(i,i=>{if(-1!==ck.indexOf(i.keyword)&&!cg(i.parentSchema))return!1;let o=n(cF(i)),a=i.parentSchema;return!o||(e=>e?.type==="object"||!!e?.properties)(a)||cg(a)||-1===r.findIndex(t=>e.startsWith(t))||(o=o&&lU()(a,t)),o})})("ValidateAndHide"===i.validationMode?o:[...r,...o])}})(o,d)(e.jsonforms.core))(e),h=void 0!==d?d.description:"",m=cy.data(r,o),f=((e,t)=>{let n=e.label;return"boolean"==typeof n?cr(ci(e,t),n):"string"==typeof n?cr(n,!0):"object"==typeof n?cr("string"==typeof n.text?n.text:ci(e,t),"boolean"!=typeof n.show||n.show):cr(ci(e,t),!0)})(i,d),p=f.show?f.text:"",g=e.jsonforms.config,b=dP(e,t,i,d||l,r,g),_=d??l,y=dn()(e),v=(n=e,(e=>void 0===e?dt:e.translateError)(lT()(n,"jsonforms.i18n"))),x=c7(_,i,o),w=y(c9(_,i,o,"label"),p,{schema:_,uischema:i,path:o,errors:u});return{data:m,description:y(c9(_,i,o,"description"),h,{schema:_,uischema:i,path:o,errors:u}),errors:((e,t,n,i,r,o)=>{if(e.length>0&&n){let t=n(c9(i,r,o,"error.custom"),void 0,{schema:i,uischema:r,path:o,errors:e});if(void 0!==t)return t}return(e=>null==e?"":e.join("\n"))(e.map(e=>t(e,n,r)))})(u,v,y,_,i,o),label:w,visible:a,enabled:b,id:s,path:o,required:c,uischema:i,schema:_,config:e.jsonforms.config,cells:t.cells||e.jsonforms.cells,rootSchema:l,i18nKeyPrefix:x}},dU=e=>({handleChange(t,n){e(cX(t,()=>n))}}),dV=(e,t)=>{let{...n}=dH(e,t);return{...n,uischemas:e.jsonforms.uischemas}},dW={visible:!0,enabled:!0,path:"",direction:"column"};({...dW,errors:[]});var dG=n(38339),dq=n.n(dG);n(22111),n(51976),n(82414);var dK=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};class dX extends CustomEvent{constructor(e,t){super(dX.NAME,{bubbles:!0,composed:!0,detail:{value:e,valid:t}})}}dX.NAME="or-ace-editor-changed";class dZ extends CustomEvent{constructor(){super(dZ.NAME,{bubbles:!0,composed:!0})}}dZ.NAME="or-ace-editor-edit";let dJ=class extends em{constructor(){super(...arguments),this.mode="ace/mode/json",this._lastValue="",this._editing=!1}static get styles(){return u`
|
|
1160
|
+
`}updated(e){var t;super.updated(e),(e.has("center")||e.has("zoom"))&&this.flyTo(this.center,this.zoom),e.has("boundary")&&this.showBoundaryBoxControl&&(null==(t=this._map)||t.createBoundaryBox(this.boundary))}refresh(){this._map&&this._map.loadViewSettings().then(()=>{this._map&&(this._map.setCenter(),this._map.flyTo())})}loadMap(){this._loaded||(this._mapContainer&&this._slotElement&&(this._map=new aT(this.type,this.shadowRoot,this._mapContainer,this.showGeoCodingControl,this.showBoundaryBoxControl,this.useZoomControl,this.showGeoJson).setCenter(this.center).setZoom(this.zoom).setControls(this.controls).setGeoJson(this.geoJson),this._map.load().then(()=>{this._observer=new ap(this._slotElement,e=>{this._processNewMarkers(e.addedNodes),this._processRemovedMarkers(e.removedNodes)}),null==(e=this._resizeObserver)||e.disconnect(),this._resizeObserver=new ResizeObserver((0,tG.debounce)(()=>{this.resize()},200));var e,t,n=null==(t=this._mapContainer)?void 0:t.parentElement;n&&this._resizeObserver.observe(n)})),this._loaded=!0)}resize(){this._map&&this._map.resize()}flyTo(e,t){this._map&&this._map.flyTo(e,t)}_onMarkerChangedEvent(e){this._map&&this._map.onMarkerChanged(e.detail.marker,e.detail.property)}_processNewMarkers(e){e.forEach(e=>{if(this._map&&e instanceof sQ){this._markers.push(e);let t=e.constructor.name;if(0>this._markerStyles.indexOf(t)){let n=e.constructor.styles,i=[];n&&(Array.isArray(n)?i=n:i.push(n),i.forEach(e=>{let t=document.createElement("style");t.textContent=String(e.toString()),this._mapContainer.children.length>0?this._mapContainer.insertBefore(t,this._mapContainer.children[0]):this._mapContainer.appendChild(t)})),this._markerStyles.push(t)}this._map.addMarker(e)}})}_processRemovedMarkers(e){e.forEach(e=>{if(this._map&&e instanceof sQ){let t=this._markers.indexOf(e);t>=0&&this._markers.splice(t,1),this._map.removeMarker(e)}})}};lw.styles=aL,lm([eb({type:String})],lw.prototype,"type",void 0),lm([eb({type:String,converter:{fromAttribute(e,t){if(!e)return;let n=e.split(",");if(2===n.length)return new ag.LngLat(Number(n[0]),Number(n[1]))},toAttribute(e,t){let n=av(e);return n?""+n.lng+","+n.lat:""}}})],lw.prototype,"center",void 0),lm([eb({type:Number})],lw.prototype,"zoom",void 0),lm([eb({type:Boolean})],lw.prototype,"showGeoCodingControl",void 0),lm([eb({type:Boolean})],lw.prototype,"showBoundaryBoxControl",void 0),lm([eb({type:Boolean})],lw.prototype,"useZoomControl",void 0),lm([eb({type:Object})],lw.prototype,"geoJson",void 0),lm([eb({type:Boolean})],lw.prototype,"showGeoJson",void 0),lm([eb({type:Array})],lw.prototype,"boundary",void 0),lm([ev("#map")],lw.prototype,"_mapContainer",void 0),lm([ev("slot")],lw.prototype,"_slotElement",void 0),lw=lm([ep("or-map")],lw);var lF=n(86834),lk=n.n(lF),lE=n(24340),lA=n.n(lE),lC=n(52635),lT=n.n(lC),lS=n(99717),lM=n.n(lS),lL=n(33795),lD=n.n(lL),lI=n(23973),lR=n.n(lI),lO=n(56786),lP=n.n(lO),l$=n(77236),lN=n.n(l$),lB=n(66901),lz=n.n(lB),lj=n(72115),lY=n.n(lj),lH=n(56817),lU=n.n(lH),lV=n(86330),lW=n.n(lV),lG=n(89793),lq=n.n(lG),lK=n(86349),lX=n.n(lK),lZ=n(99381),lJ=n.n(lZ),lQ=n(4626),l0=n.n(lQ),l1=n(86580),l2=n.n(l1),l5=n(93839),l3=n.n(l5),l4=n(80340),l6=n.n(l4);n(43913),n(81788),n(22972),n(20520),n(16334),n(72720);let l8="additionalProperties",l7="required";class l9{constructor(e){this.findOption=e,this.schemaObject=e=>{let t=this.properties(e),n={type:"object",properties:t,additionalProperties:this.findOption(t)(l8)},i=this.findOption(t)(l7);return i.length>0&&(n.required=i),n},this.properties=e=>Object.keys(e).reduce((t,n)=>(t[n]=this.property(e[n]),t),{}),this.property=e=>{switch(typeof e){case"string":return{type:"string"};case"boolean":return{type:"boolean"};case"number":if(Number.isInteger(e))return{type:"integer"};return{type:"number"};case"object":if(null==e)return{type:"null"};return this.schemaObjectOrArray(e);default:return{}}},this.schemaObjectOrArray=e=>e instanceof Array?this.schemaArray(e):this.schemaObject(e),this.schemaArray=e=>{if(!(e.length>0))return{type:"array",items:{}};{let t=((e,t)=>{let n={};return e.filter(e=>{let i=t(e);return!Object.prototype.hasOwnProperty.call(n,i)&&(n[i]=!0,!0)})})(e.map(this.property),e=>JSON.stringify(e));return 1===t.length?{type:"array",items:t[0]}:{type:"array",items:{oneOf:t}}}}}}let ce=(e,t={})=>new l9(e=>n=>{switch(n){case l8:if(Object.prototype.hasOwnProperty.call(t,l8))return t[l8];return!0;case l7:if(Object.prototype.hasOwnProperty.call(t,l7))return t[l7](e);return Object.keys(e);default:return}}).schemaObject(e),ct=new Set,cn=(e,t)=>t<=1?e:e+t.toString(),ci=(e,t)=>{let n=cn(e,t);return!ct.has(n)},cr=e=>ct.delete(e),co=(e,t)=>{let n=e;return(lk()(e)||lk()(t)||t.startsWith("[")||(n=e+"."),lk()(n))?t:lk()(t)?n:`${n}${t}`},ca=e=>e?.replace(/~1/g,"/").replace(/~0/,"~"),cs=(e,t)=>{if(t&&"string"==typeof t.title)return t.title;if("string"==typeof e.scope){let t=e.scope,n=ca(t.substr(t.lastIndexOf("/")+1));return lA()(n)}return""},cl=(e,t)=>({text:e,show:t}),cc=(e,t)=>lk()(t)?e:t.split(".").reduce((e,t)=>{if(e&&Object.prototype.hasOwnProperty.call(e,t))return e[t]},e),cd=(e,t,n)=>cu(e,t?.split("/").map(ca),n),cu=(e,t,n)=>{if(lk()(e))return;if("string"==typeof e.$ref&&(e=cd(n,e.$ref,n)),!t||0===t.length)return e;let[i,...r]=t;if((e=>"#"===e||void 0===e||""===e)(i))return cu(e,r,n);let o=cu(lD()(e,i),r,n);if(o)return o;if("properties"===i||"items"===i){let t;for(let o of[].concat(e.oneOf??[],e.allOf??[],e.anyOf??[],e.then??[],e.else??[]))if(t=cu(o,[i,...r],n))break;return t}};!function(e){e.HIDE="HIDE",e.SHOW="SHOW",e.ENABLE="ENABLE",e.DISABLE="DISABLE"}(e1||(e1={}));let ch=(e,t)=>{if(!cf(e))return t??"";let n=(e=>{let t=e.replace(/(anyOf|allOf|oneOf)\/[\d]+\//g,"").replace(/(then|else)\//g,"").split("/").map(ca),n="#"===t[0]||""===t[0];return lM()(n?2:1,t.length,2).map(e=>t[e])})(e.scope);return lk()(n)?t??"":co(t,n.join("."))},cm=e=>"object"==typeof e&&null!==e&&"string"==typeof e.i18n,cf=e=>(e=>!!e&&"object"==typeof e)(e)&&"string"==typeof e.scope,cp=(e,t)=>ch(e,t),cg=(e,t,n,i)=>{if("AND"===t.type)return t.conditions.reduce((t,r)=>t&&cg(e,r,n,i),!0);if("OR"===t.type)return t.conditions.reduce((t,r)=>t||cg(e,r,n,i),!1);if("LEAF"===t.type)return cc(e,cp(t,n))===t.expectedValue;if(!lR()(t,"schema"))return!0;{let r=cc(e,cp(t,n));return(!t.failWhenUndefined||void 0!==r)&&i.validate(t.schema,r)}},cb=(e,t,n,i)=>cg(t,e.rule.condition,n,i),c_=e=>!!e.rule&&(e.rule.effect===e1.SHOW||e.rule.effect===e1.HIDE),cy=(e,t,n,i)=>!e.rule||((e,t,n,i)=>{let r=cb(e,t,n,i);switch(e.rule.effect){case e1.HIDE:return!r;case e1.SHOW:return r;default:return!0}})(e,t,n,i),cv=e=>!!e&&Object.prototype.hasOwnProperty.call(e,"oneOf")&&e.oneOf&&e.oneOf.every(e=>void 0!==e.const),cx=(e,t)=>lz()(cw(e),t),cw=e=>{if(lk()(e))return[];if(!lk()(e.type)&&"string"==typeof e.type)return[e.type];if(lN()(e.type))return e.type;if(!lk()(e.properties)||!lk()(e.additionalProperties))return["object"];if(!lk()(e.items))return["array"];if(!lk()(e.enum)){let t=new Set;return e.enum.forEach(e=>{"string"==typeof e?t.add("string"):cw(e).forEach(e=>t.add(e))}),Array.from(t)}if(!lk()(e.allOf)){let t=lP()(e.allOf,e=>0!==cw(e).length);if(t)return cw(t)}return[]},cF={schema:cd,data:cc},ck={compose:co},cE=e=>{let t=new(lY())({allErrors:!0,verbose:!0,strict:!1,addUsedSchema:!1,...e});return lU()(t),t},cA=(e,t)=>void 0===e||e(t)?[]:e.errors,cC=e=>{let t=e.dataPath||e.instancePath||"";t=t.replace(/\//g,".");let n=(e=>{switch(e.keyword){case"required":case"dependencies":return e.params.missingProperty;case"additionalProperties":return e.params.additionalProperty;default:return}})(e);return void 0===n||t.endsWith(n)||(t=`${t}.${n}`),t=ca(t=t.replace(/^./,""))},cT=["additionalProperties","allOf","anyOf","oneOf"],cS=e=>({type:e,elements:[]}),cM=e=>({type:"Control",scope:e}),cL=(e,t,n,i,r,o)=>{if(!lk()(e)&&void 0!==e.$ref)return cL(cd(o,e.$ref,o),t,n,i,r,o);if((e=>!lk()(e)&&(!lk()(e.oneOf)||!lk()(e.anyOf)||!lk()(e.allOf)))(e)){let e=cM(n);return t.push(e),e}let a=cw(e);if(0===a.length)return null;if(a.length>1){let e=cM(n);return t.push(e),e}if("#"===n&&"object"===a[0]){let a=cS(r);if(t.push(a),e.properties&&lT()(e.properties).length>1&&((e,t)=>{if(!lk()(t)){let n=lA()(t);"Group"===e.type?e.label=n:e.elements.push({type:"Label",text:n})}})(a,i),!lk()(e.properties)){let t=n+"/properties";Object.keys(e.properties).map(n=>{let i,s=e.properties[n],l=`${t}/${(i=n,i?.replace(/~/g,"~0").replace(/\//g,"~1"))}`;void 0!==s.$ref&&(s=cd(o,s.$ref,o)),cL(s,a.elements,l,n,r,o)})}return a}switch(a[0]){case"object":case"array":case"string":case"number":case"integer":case"null":case"boolean":{let e=cM(n);return t.push(e),e}default:throw Error("Unknown type: "+JSON.stringify(e))}},cD=(e,t="VerticalLayout",n="#",i=e)=>((e,t)=>{if(!lk()(e)&&void 0===e.elements){let n=cS(t);return n.elements.push(e),n}return e})(cL(e,[],n,"",t,i),t),cI={uiSchema:cD},cR="jsonforms/INIT",cO="jsonforms/UPDATE_CORE",cP="jsonforms/SET_AJV",c$="jsonforms/UPDATE",cN="jsonforms/UPDATE_ERRORS",cB="jsonforms/ADD_RENDERER",cz="jsonforms/REMOVE_RENDERER",cj="jsonforms/ADD_CELL",cY="jsonforms/REMOVE_CELL",cH="jsonforms/SET_CONFIG",cU="jsonforms/ADD_UI_SCHEMA",cV="jsonforms/REMOVE_UI_SCHEMA",cW="jsonforms/SET_SCHEMA",cG="jsonforms/SET_UISCHEMA",cq="jsonforms/SET_VALIDATION_MODE",cK="jsonforms/SET_LOCALE",cX="jsonforms/SET_TRANSLATOR",cZ="jsonforms/UPDATE_I18N",cJ="jsonforms/ADD_DEFAULT_DATA",cQ="jsonforms/REMOVE_DEFAULT_DATA",c0=(e,t,n)=>({type:c$,path:e,updater:t,context:n}),c1=e=>({type:cH,config:e});var c2=Object.freeze({__proto__:null,INIT:cR,UPDATE_CORE:cO,SET_AJV:cP,UPDATE_DATA:c$,UPDATE_ERRORS:cN,VALIDATE:"jsonforms/VALIDATE",ADD_RENDERER:cB,REMOVE_RENDERER:cz,ADD_CELL:cj,REMOVE_CELL:cY,SET_CONFIG:cH,ADD_UI_SCHEMA:cU,REMOVE_UI_SCHEMA:cV,SET_SCHEMA:cW,SET_UISCHEMA:cG,SET_VALIDATION_MODE:cq,SET_LOCALE:cK,SET_TRANSLATOR:cX,UPDATE_I18N:cZ,ADD_DEFAULT_DATA:cJ,REMOVE_DEFAULT_DATA:cQ,isUpdateArrayContext:e=>{if(!("type"in e)||"string"!=typeof e.type)return!1;switch(e.type){case"ADD":return"values"in e&&Array.isArray(e.values)&&e.values.length>0;case"REMOVE":return"indices"in e&&Array.isArray(e.indices)&&e.indices.length>0&&e.indices.every(e=>"number"==typeof e);case"MOVE":return"moves"in e&&Array.isArray(e.moves)&&e.moves.length>0&&e.moves.every(e=>"object"==typeof e&&null!==e&&"from"in e&&"to"in e&&"number"==typeof e.from&&"number"==typeof e.to);default:return!1}},init:(e,t=ce(e),n,i)=>({type:cR,data:e,schema:t,uischema:"object"==typeof n?n:cD(t),options:i}),updateCore:(e,t,n,i)=>({type:cO,data:e,schema:t,uischema:n,options:i}),registerDefaultData:(e,t)=>({type:cJ,schemaPath:e,data:t}),unregisterDefaultData:e=>({type:cQ,schemaPath:e}),setAjv:e=>({type:cP,ajv:e}),update:c0,updateErrors:e=>({type:cN,errors:e}),registerRenderer:(e,t)=>({type:cB,tester:e,renderer:t}),registerCell:(e,t)=>({type:cj,tester:e,cell:t}),unregisterCell:(e,t)=>({type:cY,tester:e,cell:t}),unregisterRenderer:(e,t)=>({type:cz,tester:e,renderer:t}),setConfig:c1,setValidationMode:e=>({type:cq,validationMode:e}),registerUISchema:(e,t)=>({type:cU,tester:e,uischema:t}),unregisterUISchema:e=>({type:cV,tester:e}),setLocale:e=>({type:cK,locale:e}),setSchema:e=>({type:cW,schema:e}),setTranslator:(e,t)=>({type:cX,translator:e,errorTranslator:t}),updateI18n:(e,t,n)=>({type:cZ,locale:e,translator:t,errorTranslator:n}),setUISchema:e=>({type:cG,uischema:e})});let c5={restrict:!1,trim:!1,showUnfocusedDescription:!1,hideRequiredAsterisk:!1},c3=(e={})=>lX()({},c5,e),c4={data:{},schema:{},uischema:void 0,errors:[],validator:void 0,ajv:void 0,validationMode:"ValidateAndShow",additionalErrors:[]},c6=(e,t)=>t&&c8(t.options)?t.options.validationMode:e.validationMode,c8=e=>!!e&&void 0!==e.validationMode,c7=(e,t)=>t&&(e=>!!e&&void 0!==e.additionalErrors)(t.options)?t.options.additionalErrors:e.additionalErrors,c9=(e,t)=>{if(t){if(de(t.options))return t.options.ajv;else if(void 0!==t.options&&l3()(t.options.compile))return t.options}return e.ajv?e.ajv:cE()},de=e=>!!e&&void 0!==e.ajv;!function(e){e.addTooltip="addTooltip",e.addAriaLabel="addAriaLabel",e.removeTooltip="removeTooltip",e.upAriaLabel="upAriaLabel",e.downAriaLabel="downAriaLabel",e.noSelection="noSelection",e.removeAriaLabel="removeAriaLabel",e.noDataMessage="noDataMessage",e.deleteDialogTitle="deleteDialogTitle",e.deleteDialogMessage="deleteDialogMessage",e.deleteDialogAccept="deleteDialogAccept",e.deleteDialogDecline="deleteDialogDecline",e.up="up",e.down="down"}(e2||(e2={})),e2.addTooltip,e2.addAriaLabel,e2.removeTooltip,e2.removeAriaLabel,e2.upAriaLabel,e2.up,e2.down,e2.downAriaLabel,e2.noDataMessage,e2.noSelection,e2.deleteDialogTitle,e2.deleteDialogMessage,e2.deleteDialogAccept,e2.deleteDialogDecline,function(e){e.clearDialogTitle="clearDialogTitle",e.clearDialogMessage="clearDialogMessage",e.clearDialogAccept="clearDialogAccept",e.clearDialogDecline="clearDialogDecline"}(e5||(e5={})),e5.clearDialogTitle,e5.clearDialogMessage,e5.clearDialogAccept,e5.clearDialogDecline;let dt=(e,t)=>cm(t)?t.i18n:e?.i18n??void 0,dn=(e,t,n)=>dt(e,t)??(n?.split(".").filter(e=>!/^\d+$/.test(e)).join(".")||"root"),di=(e,t,n,i)=>`${dn(e,t,n)}.${i}`,dr=(e,t)=>t,da=(e,t,n)=>{let i=t(di(e.parentSchema,n,cC(e),`error.${e.keyword}`),void 0,{error:e});if(void 0!==i)return i;let r=t(`error.${e.keyword}`,void 0,{error:e});if(void 0!==r)return r;let o=t(e.message,void 0,{error:e});return void 0!==o?o:"required"===e.keyword&&e.message?.startsWith("must have required property")?t("is a required property","is a required property",{error:e}):e.message},ds=()=>e=>(e=>void 0===e?dr:e.translate)(lD()(e,"jsonforms.i18n")),dl=e=>!lk()(e)&&void 0!==e.scope,dc=e=>(t,n,i)=>{if(lk()(t)||!dl(t)||lk()(n))return!1;let r=t.scope;if(lk()(r))return!1;let o=n;return cx(n,"object")&&(o=cd(n,r,i?.rootSchema)),void 0!==o&&e(o,i?.rootSchema)},dd=(e,t)=>(n,i,r)=>{if(lk()(n)||!dl(n))return!1;let o=n.scope,a=i;return cx(i,"object")&&(a=cd(i,o,r?.rootSchema)),void 0!==(a=lD()(a,e))&&t(a,r?.rootSchema)},du=e=>dc(t=>!lk()(t)&&cx(t,e)),dh=e=>dc(t=>!lk()(t)&&t.format===e&&cx(t,"string")),dm=e=>t=>!lk()(t)&&t.type===e,df=(e,t)=>n=>{if(lk()(n))return!1;let i=n.options;return!lk()(i)&&i[e]===t},dp=(...e)=>(t,n,i)=>e.reduce((e,r)=>e&&r(t,n,i),!0),dg=(...e)=>(t,n,i)=>e.reduce((e,r)=>e||r(t,n,i),!1),db=(e,t)=>(n,i,r)=>t(n,i,r)?e:-1,d_=dp(dm("Control"),du("boolean")),dy=dp(dm("Control"),du("object")),dv=dp(dm("Control"),dc(e=>Object.prototype.hasOwnProperty.call(e,"allOf"))),dx=dp(dm("Control"),dc(e=>Object.prototype.hasOwnProperty.call(e,"anyOf"))),dw=dp(dm("Control"),dc(e=>Object.prototype.hasOwnProperty.call(e,"oneOf"))),dF=dp(dm("Control"),dc(e=>(e=>!!e&&"object"==typeof e&&(Object.prototype.hasOwnProperty.call(e,"enum")||Object.prototype.hasOwnProperty.call(e,"const")))(e))),dk=dp(dm("Control"),dc(e=>cv(e))),dE=dp(dm("Control"),du("integer")),dA=dp(dm("Control"),du("number")),dC=dp(dm("Control"),du("string"));dp(dm("Control"),df("multi",!0));let dT=dp(dm("Control"),dg(dh("date"),df("format","date"))),dS=dp(dm("Control"),dg(dh("time"),df("format","time"))),dM=dp(dm("Control"),dg(dh("date-time"),df("format","date-time"))),dL=dp(dc((e,t)=>cx(e,"array")&&!Array.isArray(cd(e,"items",t))),dd("items",(e,t)=>cx(e.$ref?cd(t,e.$ref,t):e,"object")));dp(dm("Control"),dL),dp(dm("Control"),dc((e,t)=>0!==cw(e).length&&!Array.isArray(cd(e,"items",t))),dd("items",(e,t)=>{let n=cw(e.$ref?cd(t,e.$ref,t):e);return 1===n.length&&lz()(["integer","number","boolean","string"],n[0])})),dp(dm("Control"),dg(du("number"),du("integer")),dc(e=>Object.prototype.hasOwnProperty.call(e,"maximum")&&Object.prototype.hasOwnProperty.call(e,"minimum")&&Object.prototype.hasOwnProperty.call(e,"default")),df("slider",!0)),dp(dm("Control"),du("integer"),df("format",!0));let dD=(e,t,n,i,r="VerticalLayout",o,a)=>{if(o&&o.options&&o.options.detail){if("string"==typeof o.options.detail){if("GENERATE"===o.options.detail.toUpperCase())return"function"==typeof r?r():cI.uiSchema(t,r,void 0,a)}else if("object"==typeof o.options.detail&&o.options.detail.type&&"string"==typeof o.options.detail.type)return o.options.detail}let s=((t,n,i)=>{let r=l6()(e,e=>e.tester(t,n,i));if(void 0!==r&&-1!==r.tester(t,n,i))return r.uischema})(t,n,i);return void 0===s?"function"==typeof r?r():cI.uiSchema(t,r,"#",a):s},dI=e=>d$(lD()(e,"jsonforms.core")),dR=e=>dN(lD()(e,"jsonforms.core")),dO=e=>dB(lD()(e,"jsonforms.core")),dP=e=>lD()(e,"jsonforms.renderers"),d$=e=>lD()(e,"data"),dN=e=>lD()(e,"schema"),dB=e=>lD()(e,"ajv"),dz=(e,t,n,i,r,o)=>!e?.jsonforms?.readonly&&(n&&(e=>!!e.rule&&(e.rule.effect===e1.ENABLE||e.rule.effect===e1.DISABLE))(n)?((e,t,n,i)=>!e.rule||((e,t,n,i)=>{let r=cb(e,t,n,i);switch(e.rule.effect){case e1.DISABLE:return!r;case e1.ENABLE:return r;default:return!0}})(e,t,n,i))(n,r,t?.path,dO(e)):"boolean"==typeof n?.options?.readonly?!n.options.readonly:"boolean"==typeof n?.options?.readOnly?!n.options.readOnly:"boolean"==typeof o?.readonly?!o.readonly:"boolean"==typeof o?.readOnly?!o.readOnly:i?.readOnly!==!0&&("boolean"!=typeof t?.enabled||t.enabled)),dj=(e,t,n)=>{let i=t+n;if(i<0||i>=e.length)return;let r=[t,i].sort((e,t)=>e-t);e.splice(r[0],2,e[r[1]],e[r[0]])},dY=(e,t,n)=>`${e??""}${t&&!n?"*":""}`,dH=(e,t)=>{let n=dU(e,t);return void 0===n?{}:n},dU=(e,t)=>{let n="string"==typeof e.$ref?cF.schema(t,e.$ref,t):e;if(void 0!==n.default)return dW(n,t);if(cx(n,"string"))return"date-time"===n.format||"date"===n.format||"time"===n.format?((e,t)=>{let n=e.toISOString();if("date-time"===t);else if("date"===t)return n.split("T")[0];else if("time"===t)return n.split("T")[1].split(".")[0];return n})(new Date,n.format):"";if(cx(n,"integer")||cx(n,"number"))return 0;if(cx(n,"boolean"))return!1;if(cx(n,"array"))return[];if(cx(n,"object"))return dW(n,t);if(cx(n,"null"))return null;for(let n of["oneOf","anyOf","allOf"])if(e[n]&&Array.isArray(e[n])){let i=dV(e[n],t);if(void 0!==i)return i}},dV=(e,t)=>{if(e.length>0)for(let n of e){let e=dU(n,t);if(void 0!==e)return e}},dW=(e,t)=>{if(cx(e,"object")&&void 0===e.default){let n={};for(let i in e.properties){let r=e.properties[i],o=r.$ref?cF.schema(t,r.$ref,t):r;o&&void 0!==o.default&&(n[i]=lJ()(o.default))}return e.allOf&&Array.isArray(e.allOf)&&e.allOf.forEach(e=>{if(e&&e.properties)for(let i in e.properties){let r=e.properties[i],o=r.$ref?cF.schema(t,r.$ref,t):r;o&&void 0!==o.default&&(n[i]=lJ()(o.default))}}),n}return lJ()(e.default)},dG=(e,t)=>{let n,{uischema:i}=t,r=dI(e),o=ch(i,t.path),a=void 0===t.visible||c_(i)?cy(i,r,t.path,dO(e)):t.visible,s=t.id,l=dR(e),c=void 0!==i.scope&&((e,t,n)=>{let i=t.split("/"),r=ca(i[i.length-1]),o=i.slice(0,i.length-2).join("/"),a=cF.schema(e,o,n);return void 0!==a&&void 0!==a.required&&-1!==a.required.indexOf(r)})(t.schema,i.scope,l),d=cF.schema(t.schema||l,i.scope,l),u=(e=>((e,t)=>{let n;return n=t=>t===e,i=>{let r=i.errors??[],o=i.additionalErrors??[];return(i=>{let r=lW()(i,e=>"oneOf"===e.keyword||"anyOf"===e.keyword).map(e=>cC(e));return lW()(i,i=>{if(-1!==cT.indexOf(i.keyword)&&!cv(i.parentSchema))return!1;let o=n(cC(i)),a=i.parentSchema;return!o||(e=>e?.type==="object"||!!e?.properties)(a)||cv(a)||-1===r.findIndex(t=>e.startsWith(t))||(o=o&&lq()(a,t)),o})})("ValidateAndHide"===i.validationMode?o:[...r,...o])}})(o,d)(e.jsonforms.core))(e),h=void 0!==d?d.description:"",m=cF.data(r,o),f=((e,t)=>{let n=e.label;return"boolean"==typeof n?cl(cs(e,t),n):"string"==typeof n?cl(n,!0):"object"==typeof n?cl("string"==typeof n.text?n.text:cs(e,t),"boolean"!=typeof n.show||n.show):cl(cs(e,t),!0)})(i,d),p=f.show?f.text:"",g=e.jsonforms.config,b=dz(e,t,i,d||l,r,g),_=d??l,y=ds()(e),v=(n=e,(e=>void 0===e?da:e.translateError)(lD()(n,"jsonforms.i18n"))),x=dn(_,i,o),w=y(di(_,i,o,"label"),p,{schema:_,uischema:i,path:o,errors:u});return{data:m,description:y(di(_,i,o,"description"),h,{schema:_,uischema:i,path:o,errors:u}),errors:((e,t,n,i,r,o)=>{if(e.length>0&&n){let t=n(di(i,r,o,"error.custom"),void 0,{schema:i,uischema:r,path:o,errors:e});if(void 0!==t)return t}return(e=>null==e?"":e.join("\n"))(e.map(e=>t(e,n,r)))})(u,v,y,_,i,o),label:w,visible:a,enabled:b,id:s,path:o,required:c,uischema:i,schema:_,config:e.jsonforms.config,cells:t.cells||e.jsonforms.cells,rootSchema:l,i18nKeyPrefix:x}},dq=e=>({handleChange(t,n){e(c0(t,()=>n))}}),dK=(e,t)=>{let{...n}=dG(e,t);return{...n,uischemas:e.jsonforms.uischemas}},dX={visible:!0,enabled:!0,path:"",direction:"column"};({...dX,errors:[]});var dZ=n(38339),dJ=n.n(dZ);n(22111),n(51976),n(82414);var dQ=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};class d0 extends CustomEvent{constructor(e,t){super(d0.NAME,{bubbles:!0,composed:!0,detail:{value:e,valid:t}})}}d0.NAME="or-ace-editor-changed";class d1 extends CustomEvent{constructor(){super(d1.NAME,{bubbles:!0,composed:!0})}}d1.NAME="or-ace-editor-edit";let d2=class extends em{constructor(){super(...arguments),this.mode="ace/mode/json",this._lastValue="",this._editing=!1}static get styles(){return u`
|
|
1161
1161
|
:host {
|
|
1162
1162
|
display: block;
|
|
1163
1163
|
width: 100%;
|
|
@@ -1181,11 +1181,11 @@ uniform ${n} ${i} u_${r};
|
|
|
1181
1181
|
}
|
|
1182
1182
|
`}disconnectedCallback(){this.destroyEditor(),super.disconnectedCallback()}updated(e){super.updated(e),e.has("mode")&&(this.destroyEditor(),this.initEditor()),e.has("value")&&this._aceEditor&&(this._lastValue=void 0!==this.value?"string"==typeof this.value?this.value:JSON.stringify(this.value,null,2):"",this._aceEditor.setValue(this._lastValue))}render(){return K`
|
|
1183
1183
|
<div id="ace-editor"></div>
|
|
1184
|
-
`}destroyEditor(){this._aceEditor&&(this._aceEditor.destroy(),this._aceEditor=void 0)}initEditor(){this._aceElem&&(this._aceEditor=
|
|
1185
|
-
<or-mwc-input class="any-of-picker" .label="${l}" .type="${
|
|
1186
|
-
`}function
|
|
1184
|
+
`}destroyEditor(){this._aceEditor&&(this._aceEditor.destroy(),this._aceEditor=void 0)}initEditor(){this._aceElem&&(this._aceEditor=dJ().edit(this._aceElem,{mode:this.mode,value:this._lastValue,useSoftTabs:!0,tabSize:2,readOnly:this.readonly,showPrintMargin:!1}),this._aceEditor.renderer.attachToShadowRoot(),this._aceEditor.getSession().on("changeAnnotation",()=>this._onEditorChange()),this._aceEditor.on("change",()=>this._onEditorEdit()))}_onEditorEdit(){this._editing||(this.dispatchEvent(new d1),this._editing=!0),this._changeTimer&&window.clearTimeout(this._changeTimer),this._changeTimer=window.setTimeout(()=>{this._changeTimer=void 0,this._editing&&this._onEditorChange()},600)}_onEditorChange(){this._editing=!1;let e=this.getValue()||"";if(this._lastValue!==e){this._lastValue=e;let t=this.validate();this.dispatchEvent(new d0(e,t))}}getValue(){if(this._aceEditor)return this._aceEditor.getValue()}validate(){if(!this._aceEditor)return!1;let e=this._aceEditor.getSession().getAnnotations();return!e||0===e.length}};function d5(e,t){let n;if(!e||!t)return K``;let i=t.renderers||dP({jsonforms:Object.assign({},e)}),r=t.schema,o=t.uischema;if(i&&r&&o&&e.core){let a=i.map(t=>[t,t.tester(o,r,{rootSchema:function e(t,n,i){return t.$ref?e(cF.schema(n,t.$ref,n),n):((i?[i]:["allOf","anyOf","oneOf"]).forEach(i=>{let r=t[i];r&&(t[i]=r.map(t=>e(t,n)))}),t.items&&(Array.isArray(t.items)?t.items=t.items.map(t=>e(t,n)):t.items=e(t.items,n)),t.properties&&Object.keys(t.properties).forEach(i=>t.properties[i]=e(t.properties[i],n)),t)}(r,e.core.schema),config:e.config})]).sort((e,t)=>t[1]-e[1]),s=a&&a.length>0?a[0]:void 0;n=s&&-1!==s[1]?s[0].renderer(e,t):K`<span>No applicable renderer found!</span>`}return n}function d3(e,t){return e.map(e=>{let n,i,r,o=d8(e,t);if(e.$ref&&(e=cF.schema(e,"",t)),Array.isArray(e.allOf)&&(e=cF.schema(e,"allOf",t)),cw(e).every(e=>"object"===e)){var a;let s,l=(s=[],(a=e).allOf?s=a.allOf.map(e=>e.properties?Object.entries(e.properties):[]).flat():a.properties&&(s=Object.entries(a.properties)),s).find(([e,t])=>void 0!==d4(t));l?(n=l[0],i=d4(l[1]),r=()=>{let e={};return e[l[0]]=d4(l[1]),e},o[0]||(o[0]=d4(l[1]))):r=()=>dH(e,t)}else r=()=>dH(e,t);return{title:o[0],description:o[1],defaultValueCreator:r,constProperty:n,constValue:i}})}function d4(e){if(e){if(void 0!==e.const)return e.const;if(Array.isArray(e.enum)&&1===e.enum.length)return e.enum[0]}}function d6(e,t,n,i,r,o){let a=d3(t[i],e),s=a.map((e,t)=>[t+"",e.title||tB.t("schema.title.indexedItem",{index:t})]),l=r?tB.t("schema.anyOfPickerLabel",{label:r}):tB.t("type");return K`
|
|
1185
|
+
<or-mwc-input class="any-of-picker" .label="${l}" .type="${sq.SELECT}" .options="${s}" @or-mwc-input-changed="${e=>{o(a[Number(e.detail.value)])}}"></or-mwc-input>
|
|
1186
|
+
`}function d8(e,t){let n;if(e.$ref&&(n=d7(e.$ref),e=cF.schema(e,"",t)),e.title)return[e.title,e.description];if(e.allOf){let n=cF.schema(e,"allOf",t).allOf.find(e=>!!e.title);if(n)return[n.title,n.description]}return[tB.t("schema.title."+n,{defaultValue:tX(n)}),void 0]}function d7(e){return e.substr(e.lastIndexOf("/")+1)}function d9(e,t,n,i){if(n)return n;let r=d8(e,t);return r[0]?r[0]:i?tX(d7(i)):void 0}dQ([eb({type:Boolean,attribute:!1})],d2.prototype,"readonly",void 0),dQ([eb({attribute:!1})],d2.prototype,"value",void 0),dQ([eb({type:String,attribute:!1})],d2.prototype,"mode",void 0),dQ([ev("#ace-editor")],d2.prototype,"_aceElem",void 0),d2=dQ([ep("or-ace-editor")],d2);let ue=e=>({type:"Control",scope:e,label:!1}),ut=(e,t,n)=>{let i=eP(),r=eP();la(new ll().setContent(K`
|
|
1187
1187
|
<or-ace-editor ${eB(i)} @or-ace-editor-edit="${()=>void(r.value.disabled=!0)}" @or-ace-editor-changed="${e=>(e=>{let t=e.detail.valid;r.value.disabled=!t})(e)}" .value="${t}"></or-ace-editor>
|
|
1188
|
-
`).setActions([{actionName:"cancel",content:"cancel"},{default:!0,actionName:"update",action:()=>{let e=i.value;e.validate()&&n(e.getValue()?JSON.parse(e.getValue()):void 0)},content:K`<or-mwc-input ${eB(r)} disabled .type="${
|
|
1188
|
+
`).setActions([{actionName:"cancel",content:"cancel"},{default:!0,actionName:"update",action:()=>{let e=i.value;e.validate()&&n(e.getValue()?JSON.parse(e.getValue()):void 0)},content:K`<or-mwc-input ${eB(r)} disabled .type="${sq.BUTTON}" label="update"></or-mwc-input>`}]).setHeading(e).setDismissAction(null).setStyles(K`
|
|
1189
1189
|
<style>
|
|
1190
1190
|
.mdc-dialog__surface {
|
|
1191
1191
|
width: 1024px;
|
|
@@ -1193,7 +1193,7 @@ uniform ${n} ${i} u_${r};
|
|
|
1193
1193
|
overflow-y: visible !important;
|
|
1194
1194
|
}
|
|
1195
1195
|
#dialog-content {
|
|
1196
|
-
border-color: var(--or-app-color5, ${d(
|
|
1196
|
+
border-color: var(--or-app-color5, ${d(iC)});
|
|
1197
1197
|
border-top-width: 1px;
|
|
1198
1198
|
border-top-style: solid;
|
|
1199
1199
|
border-bottom-width: 1px;
|
|
@@ -1203,7 +1203,7 @@ uniform ${n} ${i} u_${r};
|
|
|
1203
1203
|
height: 60vh;
|
|
1204
1204
|
}
|
|
1205
1205
|
</style>
|
|
1206
|
-
`))};var
|
|
1206
|
+
`))};var un=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};class ui extends em{set props(e){delete e.id,Object.assign(this,e)}}un([eb({type:Object})],ui.prototype,"state",void 0),un([eb({type:Object})],ui.prototype,"uischema",void 0),un([eb({type:Object})],ui.prototype,"schema",void 0),un([eb({type:String,attribute:!1})],ui.prototype,"data",void 0),un([eb({type:Array})],ui.prototype,"renderers",void 0),un([eb({type:Array})],ui.prototype,"cells",void 0),un([eb({type:String,attribute:!1})],ui.prototype,"config",void 0),un([eb({type:Array})],ui.prototype,"uischemas",void 0),un([eb({type:Boolean})],ui.prototype,"enabled",void 0),un([eb({type:Boolean})],ui.prototype,"visible",void 0),un([eb({type:String})],ui.prototype,"path",void 0),un([eb({type:String})],ui.prototype,"label",void 0),un([eb({type:Boolean})],ui.prototype,"required",void 0),un([eb()],ui.prototype,"errors",void 0);class ur extends ui{constructor(){super(...arguments),this.direction="column"}getChildProps(){return(this.uischema&&this.uischema.elements?this.uischema.elements:[]).map(e=>({renderers:this.renderers,uischema:e,schema:this.schema,path:this.path}))}}!function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);o>3&&a&&Object.defineProperty(t,n,a)}([eb({type:String})],ur.prototype,"direction",void 0);var uo=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let ua=u`
|
|
1207
1207
|
|
|
1208
1208
|
:host {
|
|
1209
1209
|
display: block;
|
|
@@ -1212,7 +1212,7 @@ uniform ${n} ${i} u_${r};
|
|
|
1212
1212
|
overflow: hidden;
|
|
1213
1213
|
transition: margin 225ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
1214
1214
|
position: relative;
|
|
1215
|
-
border-color: var(--or-app-color5, ${d(
|
|
1215
|
+
border-color: var(--or-app-color5, ${d(iC)});
|
|
1216
1216
|
background-color: var(--or-collapisble-panel-background-color);
|
|
1217
1217
|
border-radius: 4px;
|
|
1218
1218
|
border-width: 1px;
|
|
@@ -1286,7 +1286,7 @@ uniform ${n} ${i} u_${r};
|
|
|
1286
1286
|
margin-right: 2px;
|
|
1287
1287
|
margin-left: -5px;
|
|
1288
1288
|
}
|
|
1289
|
-
`,
|
|
1289
|
+
`,us=class extends em{constructor(){super(...arguments),this.expanded=!1,this.expandable=!0}static get styles(){return[ua]}_onHeaderClicked(e){this.expandable&&(e.preventDefault(),this.expanded=!this.expanded)}render(){return K`
|
|
1290
1290
|
<div id="header" class="${this.expandable?"expandable":""} ${this.expandable&&this.expanded?"expanded":""}" @click="${e=>this._onHeaderClicked(e)}">
|
|
1291
1291
|
${this.expandable?K`<or-icon icon="chevron-${this.expanded?"down":"right"}"></or-icon>`:""}
|
|
1292
1292
|
<span id="header-content">
|
|
@@ -1297,7 +1297,7 @@ uniform ${n} ${i} u_${r};
|
|
|
1297
1297
|
<div id="content" class="${this.expandable&&this.expanded?"expanded":""}">
|
|
1298
1298
|
${this.lazycontent?this.expanded&&eO(this.lazycontent,K`${tB.t("loading")}`):K`<slot name="content"></slot>`}
|
|
1299
1299
|
</div>
|
|
1300
|
-
`}};
|
|
1300
|
+
`}};uo([eb({type:Promise})],us.prototype,"lazycontent",void 0),uo([eb({type:Boolean})],us.prototype,"expanded",void 0),uo([eb({type:Boolean})],us.prototype,"expandable",void 0),uo([ev("#header")],us.prototype,"headerElem",void 0),us=uo([ep("or-collapsible-panel")],us);let ul=u`
|
|
1301
1301
|
:host {
|
|
1302
1302
|
flex: 1;
|
|
1303
1303
|
}
|
|
@@ -1326,8 +1326,8 @@ uniform ${n} ${i} u_${r};
|
|
|
1326
1326
|
|
|
1327
1327
|
.button-clear {
|
|
1328
1328
|
background: none;
|
|
1329
|
-
color: ${d(
|
|
1330
|
-
--or-icon-fill: ${d(
|
|
1329
|
+
color: ${d(iC)};
|
|
1330
|
+
--or-icon-fill: ${d(iC)};
|
|
1331
1331
|
visibility: hidden;
|
|
1332
1332
|
display: inline-block;
|
|
1333
1333
|
border: none;
|
|
@@ -1335,7 +1335,7 @@ uniform ${n} ${i} u_${r};
|
|
|
1335
1335
|
cursor: pointer;
|
|
1336
1336
|
}
|
|
1337
1337
|
.button-clear:hover {
|
|
1338
|
-
--or-icon-fill: ${d(
|
|
1338
|
+
--or-icon-fill: ${d(iE)};
|
|
1339
1339
|
}
|
|
1340
1340
|
.button-clear:focus {
|
|
1341
1341
|
outline: 0;
|
|
@@ -1360,7 +1360,7 @@ uniform ${n} ${i} u_${r};
|
|
|
1360
1360
|
#errors > or-icon {
|
|
1361
1361
|
margin-right: 5px;
|
|
1362
1362
|
}
|
|
1363
|
-
`,
|
|
1363
|
+
`,uc=u`
|
|
1364
1364
|
#header-description {
|
|
1365
1365
|
flex: 1;
|
|
1366
1366
|
display: flex;
|
|
@@ -1400,7 +1400,7 @@ uniform ${n} ${i} u_${r};
|
|
|
1400
1400
|
margin-top: 10px;
|
|
1401
1401
|
}
|
|
1402
1402
|
|
|
1403
|
-
`,
|
|
1403
|
+
`,ud=K`
|
|
1404
1404
|
<style>
|
|
1405
1405
|
.mdc-dialog__surface {
|
|
1406
1406
|
width: 800px;
|
|
@@ -1408,7 +1408,7 @@ uniform ${n} ${i} u_${r};
|
|
|
1408
1408
|
overflow-y: visible !important;
|
|
1409
1409
|
}
|
|
1410
1410
|
#dialog-content {
|
|
1411
|
-
border-color: var(--or-app-color5, ${d(
|
|
1411
|
+
border-color: var(--or-app-color5, ${d(iC)});
|
|
1412
1412
|
border-top-width: 1px;
|
|
1413
1413
|
border-top-style: solid;
|
|
1414
1414
|
border-bottom-width: 1px;
|
|
@@ -1431,7 +1431,7 @@ uniform ${n} ${i} u_${r};
|
|
|
1431
1431
|
}
|
|
1432
1432
|
#parameter-title {
|
|
1433
1433
|
text-transform: capitalize;
|
|
1434
|
-
color: var(--or-app-color3, ${d(
|
|
1434
|
+
color: var(--or-app-color3, ${d(iS)});
|
|
1435
1435
|
font-size: 18px;
|
|
1436
1436
|
font-weight: bold;
|
|
1437
1437
|
}
|
|
@@ -1444,7 +1444,7 @@ uniform ${n} ${i} u_${r};
|
|
|
1444
1444
|
overflow: auto;
|
|
1445
1445
|
}
|
|
1446
1446
|
</style>
|
|
1447
|
-
`;var
|
|
1447
|
+
`;var uu=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let uh=u`
|
|
1448
1448
|
|
|
1449
1449
|
#dynamic-wrapper {
|
|
1450
1450
|
display: table;
|
|
@@ -1492,18 +1492,18 @@ uniform ${n} ${i} u_${r};
|
|
|
1492
1492
|
margin: 0;
|
|
1493
1493
|
flex: 1;
|
|
1494
1494
|
}
|
|
1495
|
-
`,
|
|
1495
|
+
`,um=class extends ur{static get styles(){return[ul,uc,uh]}render(){var e;let t,n,i=[],r={jsonforms:Object.assign({},this.state)},o=dR(r),a=void 0===(e=this.schema).allOf&&void 0===e.anyOf&&(void 0===e.properties||0===Object.keys(e.properties).length),s=".+";if(a)if("object"==typeof this.schema.patternProperties){let e=Object.entries(this.schema.patternProperties);1===e.length&&(s=e[0][0],t=e[0][1])}else"object"==typeof this.schema.additionalProperties&&(t=this.schema.additionalProperties);let l=this.minimal?"":K`
|
|
1496
1496
|
<div slot="header">
|
|
1497
|
-
<span>${this.label?
|
|
1497
|
+
<span>${this.label?dY(this.label,this.required,!1):""}</span>
|
|
1498
1498
|
${this.type?K`<span id="type-label">${this.type}</span>`:""}
|
|
1499
1499
|
</div>
|
|
1500
1500
|
<div id="header-description" slot="header-description">
|
|
1501
1501
|
<div id="errors">
|
|
1502
1502
|
${!this.errors?"":K`<or-icon icon="alert"></or-icon><span>${this.errors}</span>`}
|
|
1503
1503
|
</div>
|
|
1504
|
-
<div id="header-buttons"><or-mwc-input .type="${
|
|
1504
|
+
<div id="header-buttons"><or-mwc-input .type="${sq.BUTTON}" outlined label="json" icon="pencil" @or-mwc-input-changed="${e=>this._showJson(e)}"></or-mwc-input></div>
|
|
1505
1505
|
</div>
|
|
1506
|
-
`;a&&t?n=this._getDynamicContentTemplate(s,t):this.getChildProps().length>0&&(n=this.getChildProps().map(e=>{if(
|
|
1506
|
+
`;a&&t?n=this._getDynamicContentTemplate(s,t):this.getChildProps().length>0&&(n=this.getChildProps().map(e=>{if(dl(e.uischema)){let t=dG(r,e);if(t.label=t.label||d9(this.schema,o,void 0,e.uischema.scope)||"",e.label=t.label,e.required=!!t.required,!t.required&&void 0===t.data)return i.push(t),K``}return d5(this.state,e)}).filter(e=>void 0!==e));let c=!!n&&(!Array.isArray(n)||n.length>0)||!this.errors&&i.length>0,d=K`
|
|
1507
1507
|
${l}
|
|
1508
1508
|
<div id="content-wrapper" slot="content">
|
|
1509
1509
|
<div id="content">
|
|
@@ -1512,15 +1512,15 @@ uniform ${n} ${i} u_${r};
|
|
|
1512
1512
|
|
|
1513
1513
|
${this.errors||0===i.length&&!a?"":K`
|
|
1514
1514
|
<div id="footer">
|
|
1515
|
-
<or-mwc-input .type="${
|
|
1515
|
+
<or-mwc-input .type="${sq.BUTTON}" label="addParameter" icon="plus" @or-mwc-input-changed="${()=>this._addParameter(o,i,s,t)}"></or-mwc-input>
|
|
1516
1516
|
</div>`}
|
|
1517
1517
|
</div>
|
|
1518
|
-
`;return this.minimal?K`<div>${d}</div>`:K`<or-collapsible-panel .expandable="${c}">${d}</or-collapsible-panel>`}_getDynamicContentTemplate(e,t){if(!this.data)return;let n=e=>{let t=Object.assign({},this.data);delete t[e],this.handleChange(this.path,t)},i=(e,t,n)=>{if(!e.valid)return;if(void 0!==this.data[n])return void e.setCustomValidity(tB.t("validation.keyAlreadyExists"));e.setCustomValidity(void 0);let i=Object.assign({},this.data),r=i[t];delete i[t],i[n]=r,this.handleChange(this.path,i)},r={renderers:this.renderers,uischema:
|
|
1518
|
+
`;return this.minimal?K`<div>${d}</div>`:K`<or-collapsible-panel .expandable="${c}">${d}</or-collapsible-panel>`}_getDynamicContentTemplate(e,t){if(!this.data)return;let n=e=>{let t=Object.assign({},this.data);delete t[e],this.handleChange(this.path,t)},i=(e,t,n)=>{if(!e.valid)return;if(void 0!==this.data[n])return void e.setCustomValidity(tB.t("validation.keyAlreadyExists"));e.setCustomValidity(void 0);let i=Object.assign({},this.data),r=i[t];delete i[t],i[n]=r,this.handleChange(this.path,i)},r={renderers:this.renderers,uischema:ue("#"),enabled:this.enabled,visible:this.visible,path:"",schema:t,minimal:!0,required:!1,label:""},o=(e,t)=>(r.path=ck.compose(this.path,e),d5(this.state,r)||K``);return K`
|
|
1519
1519
|
<div id="dynamic-wrapper">
|
|
1520
1520
|
${Object.entries(this.data).map(([t,r])=>K`
|
|
1521
1521
|
<div class="row">
|
|
1522
1522
|
<div class="key-container">
|
|
1523
|
-
<or-mwc-input .type="${
|
|
1523
|
+
<or-mwc-input .type="${sq.TEXT}" @or-mwc-input-changed="${e=>i(e.currentTarget,t,e.detail.value)}" required .pattern="${e}" .value="${t}"></or-mwc-input>
|
|
1524
1524
|
</div>
|
|
1525
1525
|
<div class="value-container">
|
|
1526
1526
|
${o(t,r)}
|
|
@@ -1531,7 +1531,7 @@ uniform ${n} ${i} u_${r};
|
|
|
1531
1531
|
</div>
|
|
1532
1532
|
`)}
|
|
1533
1533
|
</div>
|
|
1534
|
-
`}_showJson(e){e.stopPropagation(),
|
|
1534
|
+
`}_showJson(e){e.stopPropagation(),ut(this.title||this.schema.title||"",this.data,e=>{this.handleChange(this.path||"",e)})}_addParameter(e,t,n,i){let r,o,a,s=0===t.length,l=t.map(e=>{let t=dY(e.label,!!e.required,!1);return{text:t,value:t,data:e}}),c=e=>{let t=e.currentTarget;t.setCustomValidity(void 0),a=t.currentValue;let n=t.valid;void 0!==this.data[a]&&(n=!1,t.setCustomValidity(tB.t("validation.keyAlreadyExists"))),d.shadowRoot.getElementById("add-btn").disabled=!n},d=la(new ll().setContent(()=>{let t;return r&&r.schema&&r.schema.oneOf&&(t=d6(e,r.schema,r.path,"oneOf",r.label,e=>{o=e,d.shadowRoot.getElementById("add-btn").disabled=!o,d.shadowRoot.getElementById("schema-description").innerHTML=(o?o.description:tB.t("schema.selectTypeMessage"))||tB.t("schema.noDescriptionAvailable")})),K`
|
|
1535
1535
|
<div class="col">
|
|
1536
1536
|
<form id="mdc-dialog-form-add" class="row">
|
|
1537
1537
|
${s?"":K`
|
|
@@ -1570,17 +1570,17 @@ uniform ${n} ${i} u_${r};
|
|
|
1570
1570
|
}
|
|
1571
1571
|
</style>
|
|
1572
1572
|
<div id="dynamic-wrapper">
|
|
1573
|
-
<or-mwc-input required .type="${
|
|
1573
|
+
<or-mwc-input required .type="${sq.TEXT}" .pattern="${n}" .label="${tB.t("schema.keyInputLabel")}" @keyup="${e=>c(e)}"></or-mwc-input>
|
|
1574
1574
|
</div>
|
|
1575
1575
|
`}
|
|
1576
1576
|
</div>
|
|
1577
1577
|
</form>
|
|
1578
1578
|
</div>
|
|
1579
|
-
`}).setStyles(
|
|
1579
|
+
`}).setStyles(ud).setHeading((this.label?dY(this.label,this.required,!1)+" - ":"")+tB.t("addParameter")).setActions([{actionName:"cancel",content:"cancel"},{default:!0,actionName:"add",action:()=>{let t=s?a:r.path.split(".").pop(),n=Object.assign({},this.data),l=s?i:r.schema;n[t]=Array.isArray(l.type)?null:(o?o.defaultValueCreator():void 0)||dH(l,e),this.handleChange(this.path||"",n)},content:K`<or-mwc-input id="add-btn" .type="${sq.BUTTON}" disabled label="add"></or-mwc-input>`}]).setDismissAction(null))}};uu([eb()],um.prototype,"minimal",void 0),uu([eb()],um.prototype,"type",void 0),um=uu([ep("or-json-forms-vertical-layout")],um);var uf=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};class up extends ui{constructor(){super()}updated(e){if(super.updated(e),e.has("state")){let{handleChange:e}=dq(this.state.dispatch);this.handleChange=e}}shouldUpdate(e){var t;if(e.has("uischema")&&dl(this.uischema)){let n=e.get("uischema");(null==n?void 0:n.scope)!==(null==(t=this.uischema)?void 0:t.scope)&&(this.id&&cr(this.id),this.id=(e=>{void 0===e&&(e="undefined");let t=0;for(;!ci(e,t);)t++;let n=cn(e,t);return ct.add(n),n})(this.uischema.scope))}return!0}disconnectedCallback(){dl(this.uischema)&&cr(this.id)}}uf([eb()],up.prototype,"description",void 0),uf([eb()],up.prototype,"rootSchema",void 0);let ug=u`
|
|
1580
1580
|
or-mwc-input {
|
|
1581
1581
|
width: 100%;
|
|
1582
1582
|
}
|
|
1583
|
-
`,
|
|
1583
|
+
`,ub=class extends up{static get styles(){return[ul,ug]}render(){var e;let t,n,i,r,o,a,s,l=this.uischema,c=this.schema,d=this.schema.format,u={rootSchema:this.rootSchema,config:this.config};this.inputType=sq.TEXT;let h=!1,m=null!=(e=this.data)?e:c.default;return Array.isArray(c.type)?this.inputType=sq.JSON:d_(l,c,u)?this.inputType=sq.CHECKBOX:dA(l,c,u)||dE(l,c,u)?(t=dA(l,c,u)?.1:1,this.inputType=sq.NUMBER,n=c.minimum,r=c.maximum,t=c.multipleOf||t,void 0!==n&&void 0!==r&&"or-range"===d&&(r-n)/t<=200&&(this.inputType=sq.RANGE)):dF(l,c,u)||dk(l,c,u)||ux(l,c,u)?(this.inputType=sq.SELECT,dF(l,c,u)?s=c.enum.map(e=>[JSON.stringify(e),String(e)]):dk(l,c,u)?s=c.oneOf.map(e=>[JSON.stringify(e.const),String(e.const)]):(h=!0,s=c.items.oneOf?c.items.oneOf.map(e=>[JSON.stringify(e.const),String(e.const)]):c.items.enum.map(e=>[JSON.stringify(e),String(e)])),m=h?Array.isArray(m)?m.map(e=>JSON.stringify(e)):void 0!==m?[JSON.stringify(m)]:void 0:void 0!==m?JSON.stringify(m):void 0):dC(l,c,u)&&(i=c.minLength,o=c.maxLength,a=c.pattern,"date-time"===d?this.inputType=sq.DATETIME:"date"===d?this.inputType=sq.DATE:"time"===d?this.inputType=sq.TIME:"email"===d?this.inputType=sq.EMAIL:"tel"===d?this.inputType=sq.TELEPHONE:"or-multiline"===d?this.inputType=sq.TEXTAREA:("or-password"===d||c.writeOnly)&&(this.inputType=sq.PASSWORD)),K`<or-mwc-input
|
|
1584
1584
|
.label="${this.label}"
|
|
1585
1585
|
.type="${this.inputType}"
|
|
1586
1586
|
.disabled="${!this.enabled}"
|
|
@@ -1596,9 +1596,9 @@ uniform ${n} ${i} u_${r};
|
|
|
1596
1596
|
.step="${t}"
|
|
1597
1597
|
.max="${r}"
|
|
1598
1598
|
.min="${n}"
|
|
1599
|
-
.value="${m}"></or-mwc-input>`}onValueChanged(e){this.inputType===
|
|
1599
|
+
.value="${m}"></or-mwc-input>`}onValueChanged(e){this.inputType===sq.SELECT?Array.isArray(e.detail.value)?this.handleChange(this.path,e.detail.value.map(e=>JSON.parse(e))):this.handleChange(this.path,JSON.parse(e.detail.value)):this.handleChange(this.path,e.detail.value)}};ub=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}([ep("or-json-forms-input-control")],ub);var u_=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let uy=u`
|
|
1600
1600
|
.item-border, .drag-handle {
|
|
1601
|
-
border-color: var(--or-app-color5, ${d(
|
|
1601
|
+
border-color: var(--or-app-color5, ${d(iC)});
|
|
1602
1602
|
border-radius: 4px;
|
|
1603
1603
|
border-width: 1px;
|
|
1604
1604
|
border-style: solid;
|
|
@@ -1638,37 +1638,37 @@ uniform ${n} ${i} u_${r};
|
|
|
1638
1638
|
.item-wrapper.indicator-after {
|
|
1639
1639
|
border-bottom-width: 3px;
|
|
1640
1640
|
border-bottom-style: solid;
|
|
1641
|
-
border-bottom-color: var(--or-app-color4, ${d(
|
|
1641
|
+
border-bottom-color: var(--or-app-color4, ${d(iE)});
|
|
1642
1642
|
}
|
|
1643
1643
|
|
|
1644
1644
|
.item-wrapper.indicator-before {
|
|
1645
1645
|
border-top-width: 3px;
|
|
1646
1646
|
border-top-style: solid;
|
|
1647
|
-
border-top-color: var(--or-app-color4, ${d(
|
|
1647
|
+
border-top-color: var(--or-app-color4, ${d(iE)});
|
|
1648
1648
|
}
|
|
1649
1649
|
|
|
1650
1650
|
.drag-container > button {
|
|
1651
1651
|
cursor: grab;
|
|
1652
1652
|
}
|
|
1653
|
-
`,
|
|
1654
|
-
<span slot="header">${this.label?
|
|
1653
|
+
`,uv=class extends up{static get styles(){return[ul,uc,uy]}shouldUpdate(e){if(e.has("schema")&&(this.itemInfos=void 0,this.resolvedSchema=cF.schema(this.schema,"items",this.rootSchema),Array.isArray(this.resolvedSchema.anyOf)?this.itemInfos=d3(this.resolvedSchema.anyOf,this.rootSchema):Array.isArray(this.resolvedSchema.oneOf)&&(this.itemInfos=d3(this.resolvedSchema.oneOf,this.rootSchema))),e.has("state")){let e,t=(e=this.state.dispatch,{addItem:(t,n)=>()=>{e(c0(t,e=>null==e?[n]:(e.push(n),e),{type:"ADD",values:[n]}))},removeItems:(t,n)=>()=>{e(c0(t,e=>(n.sort((e,t)=>e-t).reverse().forEach(t=>e.splice(t,1)),e),{type:"REMOVE",indices:n}))},moveUp:(t,n)=>()=>{e(c0(t,e=>(dj(e,n,-1),e),{type:"MOVE",moves:[{from:n,to:n-1}]}))},moveDown:(t,n)=>()=>{e(c0(t,e=>(dj(e,n,1),e),{type:"MOVE",moves:[{from:n,to:n+1}]}))}});this.addItem=e=>t.addItem(this.path,e)(),this.removeItem=e=>{t.removeItems(this.path,[e])()},this.moveItem=(e,t)=>{this.state.dispatch(c0(this.path,n=>{let i=1,r=n.splice(e,i)[0];return i=0,n.splice(t,i,r),n}))}}return super.shouldUpdate(e)}render(){var e;let t=null!=(e=this.schema.maxItems)?e:Number.MAX_SAFE_INTEGER,n=Array.isArray(this.data)?this.data.length:0,i=this.minimal?"":K`
|
|
1654
|
+
<span slot="header">${this.label?dY(this.label,this.required,!1):""}</span>
|
|
1655
1655
|
<div id="header-description" slot="header-description">
|
|
1656
1656
|
<div id="errors">
|
|
1657
1657
|
${!this.errors?"":K`<or-icon icon="alert"></or-icon><span>${this.errors}</span>`}
|
|
1658
1658
|
</div>
|
|
1659
|
-
<div id="header-buttons"><or-mwc-input .type="${
|
|
1659
|
+
<div id="header-buttons"><or-mwc-input .type="${sq.BUTTON}" outlined label="json" icon="pencil" @or-mwc-input-changed="${e=>this._showJson(e)}"></or-mwc-input></div>
|
|
1660
1660
|
</div>
|
|
1661
1661
|
`,r=K`
|
|
1662
1662
|
${i}
|
|
1663
1663
|
<div id="content-wrapper" slot="content">
|
|
1664
1664
|
<div id="content" @dragover="${e=>this._onDragOver(e)}">
|
|
1665
1665
|
|
|
1666
|
-
${!Array.isArray(this.data)?"":this.data.map((e,t)=>{let n=
|
|
1666
|
+
${!Array.isArray(this.data)?"":this.data.map((e,t)=>{let n=ck.compose(this.path,""+t),i={renderers:this.renderers,uischema:ue("#"),schema:this.resolvedSchema,path:n};return this.getArrayItemWrapper(d5(this.state,i)||K``,t)})}
|
|
1667
1667
|
|
|
1668
1668
|
</div>
|
|
1669
1669
|
${this.errors?"":K`
|
|
1670
1670
|
<div id="footer">
|
|
1671
|
-
<or-mwc-input .disabled="${n&&n>=t}" .type="${
|
|
1671
|
+
<or-mwc-input .disabled="${n&&n>=t}" .type="${sq.BUTTON}" label="addItem" icon="plus" @or-mwc-input-changed="${()=>this.doAddItem()}"></or-mwc-input>
|
|
1672
1672
|
</div>
|
|
1673
1673
|
`}
|
|
1674
1674
|
</div>
|
|
@@ -1677,9 +1677,9 @@ uniform ${n} ${i} u_${r};
|
|
|
1677
1677
|
<div class="drag-container">
|
|
1678
1678
|
<button draggable="true" @dragstart="${e=>this._onDragStart(e)}" @dragend="${e=>this._onDragEnd(e)}" class="draggable button-clear"><or-icon icon="menu"></or-icon></input>
|
|
1679
1679
|
</div>
|
|
1680
|
-
${
|
|
1680
|
+
${uT(e,()=>this.removeItem(t))}
|
|
1681
1681
|
</div>
|
|
1682
|
-
`}_onDragStart(e){let t=e.currentTarget.parentElement.parentElement;t.classList.add("dragging");let n=t.lastElementChild;e.dataTransfer.setDragImage(n,n.getBoundingClientRect().width/2-50,0)}_onDragEnd(e){let t=[...this.shadowRoot.querySelectorAll(".item-wrapper")],n=e.currentTarget.parentElement.parentElement;n.classList.remove("dragging");let i=Number(n.getAttribute("data-index")),r=Math.max(0,(null!==n.getAttribute("data-after-index")?Number(n.getAttribute("data-after-index")):t.length)-1);t.forEach(e=>e.classList.remove("indicator-before","indicator-after")),i!==r&&this.moveItem(i,r)}_onDragOver(e){let t=this.shadowRoot.querySelector(".dragging");if(!t)return;e.preventDefault();let n=[...this.shadowRoot.querySelectorAll(".item-wrapper:not(.dragging)")],i=n.reduce((t,n)=>{let i=n.getBoundingClientRect(),r=e.clientY-i.top-i.height/2;return r<0&&r>t.offset?{offset:r,element:n}:t},{offset:-1/0,element:null}).element;if(n.forEach(e=>e.classList.remove("indicator-before","indicator-after")),null===i)n[n.length-1].classList.add("indicator-after"),t.removeAttribute("data-after-index");else{i.classList.add("indicator-before");let e=i.getAttribute("data-index");t.setAttribute("data-after-index",e)}}_showJson(e){e.stopPropagation(),
|
|
1682
|
+
`}_onDragStart(e){let t=e.currentTarget.parentElement.parentElement;t.classList.add("dragging");let n=t.lastElementChild;e.dataTransfer.setDragImage(n,n.getBoundingClientRect().width/2-50,0)}_onDragEnd(e){let t=[...this.shadowRoot.querySelectorAll(".item-wrapper")],n=e.currentTarget.parentElement.parentElement;n.classList.remove("dragging");let i=Number(n.getAttribute("data-index")),r=Math.max(0,(null!==n.getAttribute("data-after-index")?Number(n.getAttribute("data-after-index")):t.length)-1);t.forEach(e=>e.classList.remove("indicator-before","indicator-after")),i!==r&&this.moveItem(i,r)}_onDragOver(e){let t=this.shadowRoot.querySelector(".dragging");if(!t)return;e.preventDefault();let n=[...this.shadowRoot.querySelectorAll(".item-wrapper:not(.dragging)")],i=n.reduce((t,n)=>{let i=n.getBoundingClientRect(),r=e.clientY-i.top-i.height/2;return r<0&&r>t.offset?{offset:r,element:n}:t},{offset:-1/0,element:null}).element;if(n.forEach(e=>e.classList.remove("indicator-before","indicator-after")),null===i)n[n.length-1].classList.add("indicator-after"),t.removeAttribute("data-after-index");else{i.classList.add("indicator-before");let e=i.getAttribute("data-index");t.setAttribute("data-after-index",e)}}_showJson(e){e.stopPropagation(),ut(this.title||this.schema.title||"",this.data,e=>{this.handleChange(this.path||"",e)})}doAddItem(){this.resolvedSchema&&(this.itemInfos?this.showAddDialog():this.addItem(dH(this.resolvedSchema,this.rootSchema)))}showAddDialog(){let e,t=this.itemInfos.map((e,t)=>{let n=e.title?dY(e.title,!1,!0):"";return{text:n,value:n,data:e}}),n=la(new ll().setContent(K`
|
|
1683
1683
|
<div class="col">
|
|
1684
1684
|
<form id="mdc-dialog-form-add" class="row">
|
|
1685
1685
|
<div id="type-list" class="col">
|
|
@@ -1688,7 +1688,7 @@ uniform ${n} ${i} u_${r};
|
|
|
1688
1688
|
<div id="parameter-desc" class="col"></div>
|
|
1689
1689
|
</form>
|
|
1690
1690
|
</div>
|
|
1691
|
-
`).setStyles(
|
|
1691
|
+
`).setStyles(ud).setHeading((this.label?dY(this.label,this.required,!1)+" - ":"")+tB.t("addItem")).setActions([{actionName:"cancel",content:"cancel"},{default:!0,actionName:"add",action:()=>{if(e){let t=e.defaultValueCreator();this.addItem(t)}},content:K`<or-mwc-input id="add-btn" .type="${sq.BUTTON}" disabled label="add"></or-mwc-input>`}]).setDismissAction(null))}};u_([eb()],uv.prototype,"minimal",void 0),uv=u_([ep("or-json-forms-array-control")],uv);let ux=dp(dm("Control"),dp(dc(e=>cx(e,"array")&&!Array.isArray(e.items)&&!0===e.uniqueItems),dd("items",e=>(e=>void 0!==e.oneOf&&e.oneOf.length>0&&e.oneOf.every(e=>void 0!==d4(e)))(e)||Array.isArray(e.enum)))),uw=db(1,dg(dm("VerticalLayout"),dm("Group"))),uF=db(6,dc(e=>void 0!==d4(e))),uk=db(3,dg(dc(e=>Array.isArray(e.type)&&7===e.type.length),dC,d_,dA,dE,dT,dS,dM,dF,dk,ux)),uE=db(2,dy),uA=db(4,dg(dx,dw)),uC=db(4,dv);function uT(e,t){let n=t?K`
|
|
1692
1692
|
<button class="button-clear" @click="${t}"><or-icon icon="close-circle"></or-icon></input>
|
|
1693
1693
|
`:"";return K`
|
|
1694
1694
|
<div class="item-container">
|
|
@@ -1697,9 +1697,9 @@ uniform ${n} ${i} u_${r};
|
|
|
1697
1697
|
${n}
|
|
1698
1698
|
</div>
|
|
1699
1699
|
</div>
|
|
1700
|
-
`}let
|
|
1701
|
-
<div class="item-container no-match-container"><span>${s}:</span><b><or-translate value="validation.noSchemaMatchFound"></b><or-mwc-input .type="${
|
|
1702
|
-
`)}let y=_[b.indexOfFittingSchema].schema,v=_[b.indexOfFittingSchema].uischema;return y.allOf&&(v={type:"Control",scope:"#",label:!1}),
|
|
1700
|
+
`}let uS=[{tester:uw,renderer:(e,t)=>{let n,i=Object.assign(Object.assign(Object.assign({},((e,t)=>{let n=dI(e),{uischema:i}=t,r=void 0===t.visible||c_(i)?cy(t.uischema,n,t.path,dO(e)):t.visible,o=cF.data(n,t.path),a=e.jsonforms.config,s=dz(e,t,i,void 0,n,a),l=ds()(e),c=(e=>!!e&&"object"==typeof e)(i)?((e,t)=>{if(!1===e.label||(void 0===e.label||null===e.label||!0===e.label)&&!cm(e))return;let n="string"==typeof e.label?e.label:JSON.stringify(e.label),i=dt(void 0,e);return t("string"==typeof i?`${i}.label`:n,n,{uischema:e})})(i,l):void 0;return{...dX,renderers:t.renderers||dP(e),cells:t.cells||lD()(e,"jsonforms.cells"),visible:r,enabled:s,path:t.path,data:o,uischema:t.uischema,schema:t.schema,direction:t.direction??(e=>"HorizontalLayout"===e.type?"row":"VerticalLayout"===e.type?"column":dX.direction)(i),config:a,label:c}})({jsonforms:Object.assign({},e)},t)),dq(e.dispatch)),{label:t.label,required:t.required,errors:t.errors,minimal:t.minimal,type:t.type}),r=K`<or-json-forms-vertical-layout .state="${e}" .props="${i}"></or-json-forms-vertical-layout>`;return!i.required&&i.path&&(n=()=>{i.handleChange(i.path||"",void 0)}),uT(r,n)}},{tester:uF,renderer:(e,t)=>{}},{tester:uk,renderer:(e,t)=>{let n,i=Object.assign(Object.assign({},dG({jsonforms:Object.assign({},e)},t)),dq(e.dispatch));i.label=t.label||i.label,i.required=!!t.required||i.required;let r=K`<or-json-forms-input-control .state="${e}" .props="${i}"></or-json-forms-input-control>`;return!i.required&&i.path&&(n=()=>{i.handleChange(i.path,void 0)}),uT(r,n)}},{tester:uE,renderer:(e,t)=>{let{required:n,renderers:i,cells:r,uischemas:o,schema:a,label:s,errors:l,path:c,visible:d,enabled:u,uischema:h,rootSchema:m}=dK({jsonforms:Object.assign({},e)},t),f=dD(o,a,h.scope,c,"VerticalLayout",h,m);return d5(e,{visible:d,enabled:u,schema:a,uischema:f,path:c,renderers:i,cells:r,label:t.label||d9(a,m,s)||"",required:!!t.required||!!n,errors:l,minimal:t.minimal})}},{tester:db(2,dc(e=>cx(e,"array")&&!Array.isArray(e.items))),renderer:(e,t)=>{let n,i=Object.assign(Object.assign({},dG({jsonforms:Object.assign({},e)},t)),dq(e.dispatch));i.label=t.label||i.label,i.required=!!t.required||i.required,i.minimal=t.minimal;let r=K`<or-json-forms-array-control .state="${e}" .props="${i}"></or-json-forms-array-control>`;return!i.required&&i.path&&(n=()=>{i.handleChange(i.path,void 0)}),uT(r,n)}},{tester:uA,renderer:(e,t)=>{let n={jsonforms:Object.assign({},e)},{required:i,renderers:r,cells:o,schema:a,label:s,path:l,errors:c,visible:d,enabled:u,uischema:h,rootSchema:m,data:f}=dK(n,t),p=void 0!==a.anyOf?"anyOf":"oneOf",g=cd(a,p,m),b=function(e,t,n){let{uischema:i}=t,r=ch(i,t.path),o=dR(e),a=cF.schema(t.schema||o,i.scope,o),s=void 0===t.visible||c_(i)?cy(i,dI(e),t.path,dO(e)):t.visible,l=t.id,c=cF.data(dI(e),r),d=e.jsonforms.core.ajv,u=a||o,h=cF.schema(u,n,o),m=["required","additionalProperties","type","enum","const"],f=e=>!e||0===e.length||!e.find(e=>-1!==m.indexOf(e.keyword)),p=-1;for(let e=0;e<h.length;e++)try{let t=Object.assign({definitions:o.definitions},h[e]),n=d.compile(t);if(n(c),f(n.errors)){p=e;break}}catch(e){console.debug("Combinator subschema is not self contained, can't hand it over to AJV")}return{data:c,path:r,schema:u,rootSchema:o,visible:s,id:l,indexOfFittingSchema:p,uischemas:e.jsonforms.uischemas,uischema:i}}(n,t,p),_=((e,t,n,i,r,o)=>e.map((e,a)=>{let s=e.$ref&&cF.schema(t,e.$ref,t),l=s??e;return{schema:l,uischema:dD(o,l,i.scope,r,void 0,i,t),label:e.title??s?.title??`${n}-${a}`}}))(g,m,p,b.uischema||h,l,b.uischemas);if(null!=f&&(void 0===b.indexOfFittingSchema||b.indexOfFittingSchema<0)){let e=d3(g,m),t=e.length>0?e[0].constProperty:void 0;if(t&&"object"==typeof f&&f[t]){let n=f[t];b.indexOfFittingSchema=e.findIndex(e=>e.constValue===n)}}if(void 0===b.indexOfFittingSchema||b.indexOfFittingSchema<0){let{handleChange:n}=dq(e.dispatch);return null==f?d6(m,g,l,p,t.label||s,e=>n(l,e.defaultValueCreator())):(console.warn("Cannot match "+p+" schema to instance data"),K`
|
|
1701
|
+
<div class="item-container no-match-container"><span>${s}:</span><b><or-translate value="validation.noSchemaMatchFound"></b><or-mwc-input .type="${sq.BUTTON}" outlined label="json" icon="pencil" @or-mwc-input-changed="${e=>{e.stopPropagation(),ut(s,f,e=>{n(l||"",e)})}}"></or-mwc-input></div>
|
|
1702
|
+
`)}let y=_[b.indexOfFittingSchema].schema,v=_[b.indexOfFittingSchema].uischema;return y.allOf&&(v={type:"Control",scope:"#",label:!1}),d5(e,{schema:y,uischema:v,path:l,renderers:r,cells:o,label:t.label||d9(y,m,s)||"",required:t.required||!!i,errors:c,minimal:t.minimal,type:y.title})}},{tester:uC,renderer:(e,t)=>{let n=Object.assign({},dK({jsonforms:Object.assign({},e)},t)),i=cd(n.schema,"allOf",n.rootSchema);return n.schema=i.allOf.reduce((e,t)=>(function e(t,n,i){if(t&&!n)return Object.assign({},t);if(n&&!t)return Object.assign({},n);let r=Object.assign({},t),o=[];return Object.entries(n).forEach(([t,n])=>{var a,s,l,c,d;let u;a=r,s=o,l=t,c=n,d=i,u=a,s.forEach(e=>{u.hasOwnProperty(e)||(u[e]={}),u=u[e]}),u&&(u.hasOwnProperty(l)?null==c?delete u[l]:Array.isArray(u[l])?d?u[l]=[...u[l],...c]:u[l]=[...c]:"object"==typeof c?u[l]=e(Object.assign({},u[l]),c,d):u[l]=c:null==c?delete u[l]:Array.isArray(c)?u[l]=[...c]:"object"==typeof c?u[l]=Object.assign({},c):u[l]=c)}),r})(e,t,!1)),n.uischema.scope="#",n.label=t.label||n.label,n.required=!!t.required||n.required,n.minimal=t.minimal,d5(e,n)}}];var uM=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let uL=u`
|
|
1703
1703
|
.delete-container {
|
|
1704
1704
|
width: 0;
|
|
1705
1705
|
}
|
|
@@ -1707,9 +1707,9 @@ uniform ${n} ${i} u_${r};
|
|
|
1707
1707
|
.item-container {
|
|
1708
1708
|
margin: 0; /* Remove inherited margin */
|
|
1709
1709
|
}
|
|
1710
|
-
`,
|
|
1711
|
-
<or-mwc-input .label="${tB.t("agentId")}" required class="agent-id-picker" @or-mwc-input-changed="${n=>(e=>{t.handleChange(t.path,e?e.id:void 0)})(e.find(e=>e.id===n.detail.value))}" type="${
|
|
1712
|
-
`});return
|
|
1710
|
+
`,uD=class extends em{constructor(){super(...arguments),this.renderers=uS,this.readonly=!1,this.required=!1,this.previousErrors=[]}static get styles(){return[ul,uL]}checkValidity(){return 0===this.previousErrors.length}shouldUpdate(e){if(super.shouldUpdate(e),this.schema||(this.schema=void 0!==this.data?ce(this.data):{}),this.uischema||(this.uischema=cD(this.schema)),this.core||(this.core={ajv:cE({useDefaults:!0,validateFormats:!1}),data:{},schema:this.schema,uischema:this.uischema},this.updateCore(c2.init(this.data,this.schema,this.uischema)),this.config=((e=c3(),t)=>t.type===cH?c3(t.config):e)(void 0,c1(this.config))),(e.has("data")||e.has("schema")||e.has("uischema"))&&this.updateCore(c2.updateCore(this.data,this.schema,this.uischema)),(!this.contextValue||e.has("core")||e.has("renderers")||e.has("cells")||e.has("config")||e.has("readonly"))&&(this.contextValue={core:this.core,renderers:this.renderers,cells:this.cells,config:this.config,uischemas:this.uischemas,readonly:this.readonly,dispatch:e=>this.updateCore(e)}),e.has("core")){let e=this.core.data,t=this.core.errors;this.onChange&&(!tK(e,this.previousData,!0)||t&&!tK(t,this.previousErrors,!0))&&(this.previousErrors=t||[],this.previousData=e,this.onChange({data:e,errors:t}))}return!0}updateCore(e){let t=((e=c4,t)=>{switch(t.type){case cR:{let n=c9(e,t),i=c6(e,t),r="NoValidation"===i?void 0:n.compile(t.schema),o=cA(r,t.data),a=c7(e,t);return{...e,data:t.data,schema:t.schema,uischema:t.uischema,additionalErrors:a,errors:o,validator:r,ajv:n,validationMode:i}}case cO:{let n=c9(e,t),i=c6(e,t),r=e.validator,o=e.errors;e.schema!==t.schema||e.validationMode!==i||e.ajv!==n?o=cA(r="NoValidation"===i?void 0:n.compile(t.schema),t.data):e.data!==t.data&&(o=cA(r,t.data));let a=c7(e,t);return e.data!==t.data||e.schema!==t.schema||e.uischema!==t.uischema||e.ajv!==n||e.errors!==o||e.validator!==r||e.validationMode!==i||e.additionalErrors!==a?{...e,data:t.data,schema:t.schema,uischema:t.uischema,ajv:n,errors:lq()(o,e.errors)?e.errors:o,validator:r,validationMode:i,additionalErrors:a}:e}case cP:{let n=t.ajv,i="NoValidation"===e.validationMode?void 0:n.compile(e.schema),r=cA(i,e.data);return{...e,validator:i,errors:r}}case cW:{let n=t.schema&&e.ajv&&"NoValidation"!==e.validationMode?e.ajv.compile(t.schema):e.validator,i=cA(n,e.data);return{...e,validator:n,schema:t.schema,errors:i}}case cG:return{...e,uischema:t.uischema};case c$:if(void 0===t.path||null===t.path)return e;if(""===t.path){let n=t.updater(lJ()(e.data)),i=cA(e.validator,n);return{...e,data:n,errors:i}}{let n,i=lD()(e.data,t.path),r=t.updater(lJ()(i));n=void 0!==r?l0()(t.path,r,void 0===e.data?{}:e.data):l2()(t.path,void 0===e.data?{}:e.data);let o=cA(e.validator,n);return{...e,data:n,errors:o}}case cN:return{...e,errors:t.errors};case cq:if(e.validationMode===t.validationMode)return e;if("NoValidation"===t.validationMode){let n=cA(void 0,e.data);return{...e,errors:n,validationMode:t.validationMode}}if("NoValidation"===e.validationMode){let n=e.ajv.compile(e.schema),i=cA(n,e.data);return{...e,validator:n,errors:i,validationMode:t.validationMode}}return{...e,validationMode:t.validationMode};default:return e}})(this.core,e);return t!==this.core&&(this.core=t),e}render(){if(!this.contextValue)return K``;let e=Object.assign(Object.assign({},((e,t)=>{let n;return{renderers:t.renderers||lD()(e.jsonforms,"renderers"),cells:t.cells||lD()(e.jsonforms,"cells"),schema:t.schema||dR(e),rootSchema:dR(e),uischema:t.uischema||(n=lD()(e,"jsonforms.core"),lD()(n,"uischema")),path:t.path,enabled:t.enabled,config:e.jsonforms.config}})({jsonforms:Object.assign({},this.contextValue)},this)),{label:d9(this.schema,this.uischema,this.label,void 0)||"",required:this.required});return d5(this.contextValue,e)||K``}};uM([eb({type:Object})],uD.prototype,"uischema",void 0),uM([eb({type:Object})],uD.prototype,"schema",void 0),uM([eb({type:Object,attribute:!1})],uD.prototype,"data",void 0),uM([eb({type:Array})],uD.prototype,"renderers",void 0),uM([eb({type:Array})],uD.prototype,"cells",void 0),uM([eb({type:String,attribute:!1})],uD.prototype,"onChange",void 0),uM([eb({type:String,attribute:!1})],uD.prototype,"config",void 0),uM([eb({type:Array})],uD.prototype,"uischemas",void 0),uM([eb({type:Boolean})],uD.prototype,"readonly",void 0),uM([eb({type:String})],uD.prototype,"label",void 0),uM([eb({type:Boolean})],uD.prototype,"required",void 0),uM([e_()],uD.prototype,"core",void 0),uM([e_()],uD.prototype,"contextValue",void 0),uD=uM([ep("or-json-forms")],uD);let uI=!1;function uR(){return t?Promise.resolve(t):r||(uI||(iO.addListener(e=>{e===sB.DISPLAY_REALM_CHANGED&&(t=void 0,r=void 0)}),iO.events.subscribeAssetEvents(void 0,!1,e=>{e.asset&&e.asset.type.endsWith("Agent")&&(t=void 0,r=void 0)}),uI=!0),r=iO.rest.api.AssetResource.queryAssets({realm:{name:iO.displayRealm},types:["Agent"],select:{attributes:[]}}).then(e=>e.data).then(e=>(t=e,e)))}let uO={tester:db(6,dp(dm("Control"),dh("or-agent-id"))),renderer:(e,t)=>{t=Object.assign(Object.assign(Object.assign({},t),dG({jsonforms:Object.assign({},e)},t)),dq(e.dispatch));let n=uR().then(e=>{let n=e.map(e=>[e.id,e.name+" ("+e.id+")"]);return K`
|
|
1711
|
+
<or-mwc-input .label="${tB.t("agentId")}" required class="agent-id-picker" @or-mwc-input-changed="${n=>(e=>{t.handleChange(t.path,e?e.id:void 0)})(e.find(e=>e.id===n.detail.value))}" type="${sq.SELECT}" .value="${t.data}" .placeholder="${tB.t("selectAgent")}" .options="${n}"></or-mwc-input>
|
|
1712
|
+
`});return uT(K`
|
|
1713
1713
|
<style>
|
|
1714
1714
|
.agent-id-picker {
|
|
1715
1715
|
min-width: 300px;
|
|
@@ -1717,8 +1717,8 @@ uniform ${n} ${i} u_${r};
|
|
|
1717
1717
|
width: 100%;
|
|
1718
1718
|
}
|
|
1719
1719
|
</style>
|
|
1720
|
-
${eO(n,K`<or-mwc-input class="agent-id-picker" .type="${
|
|
1721
|
-
`,void 0)}};var
|
|
1720
|
+
${eO(n,K`<or-mwc-input class="agent-id-picker" .type="${sq.SELECT}"></or-mwc-input>`)}
|
|
1721
|
+
`,void 0)}};var uP=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};class u$ extends CustomEvent{constructor(e,t){super(u$.NAME,{detail:{value:e,previousValue:t},bubbles:!0,composed:!0})}}function uN(e,t,n,i,r,o,a,s,l){return r&&(e=K`
|
|
1722
1722
|
<div id="wrapper-helper">
|
|
1723
1723
|
${o?K`<div id="wrapper-label">${o}</div>`:""}
|
|
1724
1724
|
<div id="wrapper-input">${e}</div>
|
|
@@ -1732,7 +1732,7 @@ uniform ${n} ${i} u_${r};
|
|
|
1732
1732
|
${e}
|
|
1733
1733
|
<div id="scrim" class="${(n?void 0:"hidden")??Z}"><progress class="pure-material-progress-circular"></progress></div>
|
|
1734
1734
|
</div>
|
|
1735
|
-
`}function uO(e,t,n){return e?tB.t("sending"):t?tB.t("sendFailed"):n?tB.t("updatedWithDate",{date:new Date(n)}):void 0}uI.NAME="or-attribute-input-changed";let uP=[...uE,uL],u$=e=>(t,n,i,r,o,a)=>{let s=!!(a&&a.disabled),l=!!(a&&a.readonly),c=a.label;if("agentLink"===r.name){let e,t,n={type:"Control",scope:"#"},i=eP(),r=eP(),a=[],d=!1,u=e=>{if(!d)return;let n=e.data;if(n){let e=a.find(e=>e.id===n.id);if(e){let t=tY.getAssetDescriptor(e.type);t&&(n.type=t.agentLinkType)}}tK(n,t)||(t=n,o({value:n}))};return{templateFunction:(o,h,m,f,p,g)=>(o||(o={id:"",type:"DefaultAgentLink"}),window.setTimeout(()=>(n=>(function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})})(void 0,void 0,void 0,function*(){if(d||(t=n),d=!0,e||(e=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","title":"Agent Link","oneOf":[{"$ref":"#/definitions/SNMPAgentLink"},{"$ref":"#/definitions/DefaultAgentLink"},{"$ref":"#/definitions/HTTPAgentLink"},{"$ref":"#/definitions/MockAgentLink"},{"$ref":"#/definitions/WebsocketAgentLink"},{"$ref":"#/definitions/ZWaveAgentLink"},{"$ref":"#/definitions/ModbusAgentLink"},{"$ref":"#/definitions/StorageSimulatorAgentLink"},{"$ref":"#/definitions/BluetoothMeshAgentLink"},{"$ref":"#/definitions/MQTTAgentLink"},{"$ref":"#/definitions/KNXAgentLink"},{"$ref":"#/definitions/SimulatorAgentLink"},{"$ref":"#/definitions/MailAgentLink"},{"$ref":"#/definitions/VelbusAgentLink"}],"definitions":{"SNMPAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["SNMPAgentLink"],"default":"SNMPAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"oid":{"type":"string"}},"title":"SNMPAgentLink","required":["type","oid"]},"regex":{"type":"object","additionalProperties":true,"title":"Regex","properties":{"type":{"type":"string","enum":["regex"],"default":"regex"},"pattern":{"type":"string"},"matchGroup":{"type":"integer"},"matchIndex":{"type":"integer"}},"required":["type"]},"substring":{"type":"object","additionalProperties":true,"title":"Substring","properties":{"type":{"type":"string","enum":["substring"],"default":"substring"},"beginIndex":{"type":"integer"},"endIndex":{"type":"integer"}},"required":["type","beginIndex"]},"jsonPath":{"type":"object","additionalProperties":true,"title":"JSON Path","properties":{"type":{"type":"string","enum":["jsonPath"],"default":"jsonPath"},"path":{"type":"string"},"returnFirst":{"type":"boolean"},"returnLast":{"type":"boolean"}},"required":["type","path","returnFirst","returnLast"]},"mathExpression":{"type":"object","additionalProperties":true,"title":"Mathematical Expression","properties":{"type":{"type":"string","enum":["mathExpression"],"default":"mathExpression"},"expression":{"type":"string"}},"required":["type"]},"AnyType":{"type":["null","number","integer","boolean","string","array","object"],"additionalProperties":true,"properties":{}},"StringPredicate":{"type":"object","additionalProperties":true,"description":"Predicate for string values; will match based on configured options.","properties":{"predicateType":{"type":"string","enum":["string"],"default":"string"},"match":{"type":"string","enum":["EXACT","BEGIN","END","CONTAINS"]},"caseSensitive":{"type":"boolean"},"value":{"type":"string"},"negate":{"type":"boolean"}},"title":"string","required":["predicateType","caseSensitive","negate"]},"BooleanPredicate":{"type":"object","additionalProperties":true,"description":"Predicate for boolean values; will evaluate the value as a boolean and match against this predicates value, any value that is not a boolean will not match","properties":{"predicateType":{"type":"string","enum":["boolean"],"default":"boolean"},"value":{"type":"boolean"}},"title":"boolean","required":["predicateType","value"]},"DateTimePredicate":{"type":"object","additionalProperties":true,"description":"Predicate for date time values; provided values should be valid ISO 8601 datetime strings (e.g. yyyy-MM-dd\'T\'HH:mm:ssZ or yyyy-MM-dd\'T\'HH:mm:ss\xb1HH:mm), offset and time are optional, if no offset information is supplied then UTC is assumed.","properties":{"predicateType":{"type":"string","enum":["datetime"],"default":"datetime"},"value":{"type":"string"},"rangeValue":{"type":"string"},"operator":{"type":"string","enum":["EQUALS","GREATER_THAN","GREATER_EQUALS","LESS_THAN","LESS_EQUALS","BETWEEN"]},"negate":{"type":"boolean"}},"title":"datetime","required":["predicateType","negate"]},"NumberPredicate":{"type":"object","additionalProperties":true,"description":"Predicate for number values; will match based on configured options.","properties":{"predicateType":{"type":"string","enum":["number"],"default":"number"},"value":{"type":"number"},"rangeValue":{"type":"number"},"operator":{"type":"string","enum":["EQUALS","GREATER_THAN","GREATER_EQUALS","LESS_THAN","LESS_EQUALS","BETWEEN"]},"negate":{"type":"boolean"}},"title":"number","required":["predicateType","negate"]},"RadialGeofencePredicate":{"type":"object","additionalProperties":true,"description":"Predicate for GEO JSON point values; will return true if the point is within the specified radius of the specified latitude and longitude unless negated.","title":"Radial geofence","properties":{"predicateType":{"type":"string","enum":["radial"],"default":"radial"},"radius":{"type":"integer"},"lat":{"type":"number"},"lng":{"type":"number"},"negated":{"type":"boolean"}},"required":["predicateType","radius","lat","lng","negated"]},"RectangularGeofencePredicate":{"type":"object","additionalProperties":true,"description":"Predicate for GEO JSON point values; will return true if the point is within the specified rectangle specified as latitude and longitude values of two corners unless negated.","title":"Rectangular geofence","properties":{"predicateType":{"type":"string","enum":["rect"],"default":"rect"},"latMin":{"type":"number"},"lngMin":{"type":"number"},"latMax":{"type":"number"},"lngMax":{"type":"number"},"negated":{"type":"boolean"}},"required":["predicateType","latMin","lngMin","latMax","lngMax","negated"]},"ArrayPredicate":{"type":"object","additionalProperties":true,"description":"Predicate for array values; will match based on configured options.","properties":{"predicateType":{"type":"string","enum":["array"],"default":"array"},"value":{"$ref":"#/definitions/AnyType"},"index":{"type":"integer"},"lengthEquals":{"type":"integer"},"lengthGreaterThan":{"type":"integer"},"lengthLessThan":{"type":"integer"},"negated":{"type":"boolean"}},"title":"array","required":["predicateType","negated"]},"ValueAnyPredicate":{"type":"object","additionalProperties":true,"description":"Predicate that matches any value including null.","title":"Any value","properties":{"predicateType":{"type":"string","enum":["value-any"],"default":"value-any"}},"required":["predicateType"]},"ValueEmptyPredicate":{"type":"object","additionalProperties":true,"description":"Predicate that matches any empty/null value; unless negated.","title":"Empty value","properties":{"predicateType":{"type":"string","enum":["value-empty"],"default":"value-empty"},"negate":{"type":"boolean"}},"required":["predicateType","negate"]},"CalendarEventPredicate":{"type":"object","additionalProperties":true,"description":"Predicate for calendar event values; will match based on whether the calendar event is active for the specified time.","title":"Calendar","properties":{"predicateType":{"type":"string","enum":["calendar-event"],"default":"calendar-event"},"timestamp":{"type":"integer","format":"utc-millisec"}},"required":["predicateType"]},"DefaultAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["DefaultAgentLink"],"default":"DefaultAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"}},"title":"DefaultAgentLink","required":["type"]},"HTTPAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["HTTPAgentLink"],"default":"HTTPAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"headers":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"A JSON object of headers to be added to HTTP request; the key represents the name of the header and for each string value supplied a new header will be added with the key name and specified string value"},"queryParameters":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"A JSON object of query parameters to be added to HTTP request URL; the key represents the name of the query parameter and for each string value supplied a new query parameter will be added with the key name and specified string value (e.g. \'https://..../?test=1&test=2\')"},"pollingMillis":{"type":"integer","description":"Indicates that this HTTP request is used to update the linked attribute; this value indicates how frequently the HTTP request is made in order to update the linked attribute value"},"pagingMode":{"type":"boolean","description":"Indicates that the HTTP server supports pagination using the standard Link header mechanism"},"path":{"type":"string","description":"The URL path to append to the agents Base URL when making requests for this linked attribute"},"method":{"type":"string","enum":["GET","POST","PUT","DELETE","OPTIONS","PATCH"],"description":"The HTTP method to use when making requests for this linked attribute"},"contentType":{"type":"string","description":"The content type header value to use when making requests for this linked attribute (shortcut alternative to using headers parameter)"},"pollingAttribute":{"type":"string","description":"Allows the polled response to be written to another attribute with the specified name on the same asset as the linked attribute"},"messageConvertBinary":{"type":"boolean","description":"Indicates that the HTTP response is binary and should be converted to binary string representation"},"messageConvertHex":{"type":"boolean","description":"Indicates that the HTTP response is binary and should be converted to hexadecimal string representation"}},"title":"HTTPAgentLink","required":["type","messageConvertBinary","messageConvertHex"]},"MockAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["MockAgentLink"],"default":"MockAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"requiredValue":{"type":"string"}},"title":"MockAgentLink","required":["type"]},"WebsocketAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["WebsocketAgentLink"],"default":"WebsocketAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"websocketSubscriptions":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/websocket"},{"$ref":"#/definitions/http"}]}}},"title":"WebsocketAgentLink","required":["type"]},"websocket":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["websocket"],"default":"websocket"},"body":{"$ref":"#/definitions/AnyType"}},"title":"websocket","required":["type"]},"http":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["http"],"default":"http"},"body":{"$ref":"#/definitions/AnyType"},"method":{"type":"string","enum":["GET","PUT","POST"]},"contentType":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"uri":{"type":"string"}},"title":"http","required":["type"]},"ZWaveAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["ZWaveAgentLink"],"default":"ZWaveAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"deviceNodeId":{"type":"integer"},"deviceEndpoint":{"type":"integer"},"deviceValue":{"type":"string"}},"title":"ZWaveAgentLink","required":["type"]},"ModbusAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["ModbusAgentLink"],"default":"ModbusAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"pollingMillis":{"type":"integer","description":"Poll interval in milliseconds"},"readMemoryArea":{"type":"string","enum":["COIL","DISCRETE","HOLDING","INPUT"],"description":"Memory area to read from during read request"},"readValueType":{"type":"string","enum":["BOOL","SINT","USINT","BYTE","INT","UINT","WORD","DINT","UDINT","DWORD","LINT","ULINT","LWORD","REAL","LREAL","CHAR","WCHAR"],"description":"Type to convert the returned data to. As specified by the PLC4X Modbus data types."},"readAddress":{"type":"integer","description":"Zero based address from which the value is read from"},"writeMemoryArea":{"type":"string","enum":["COIL","HOLDING"],"description":"Memory area to write to. \\"HOLDING\\" or \\"COIL\\" allowed."},"writeAddress":{"type":"integer","description":"Zero-based address to which the value sent is written to"},"readRegistersAmount":{"type":"integer","description":"Set amount of registers to read. If left empty or less than 1, will use the default size for the corresponding data-type."}},"title":"ModbusAgentLink","required":["type","pollingMillis","readMemoryArea","readValueType","readAddress"]},"StorageSimulatorAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["StorageSimulatorAgentLink"],"default":"StorageSimulatorAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"}},"title":"StorageSimulatorAgentLink","required":["type"]},"BluetoothMeshAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["BluetoothMeshAgentLink"],"default":"BluetoothMeshAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"appKeyIndex":{"type":"integer","minimum":0,"maximum":2147483647},"address":{"type":"string","pattern":"^([0-9A-Fa-f]{4})$"},"modelName":{"type":"string","pattern":"^.*\\\\S+.*$","minLength":1}},"title":"BluetoothMeshAgentLink","required":["type","appKeyIndex","modelName"]},"MQTTAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["MQTTAgentLink"],"default":"MQTTAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"subscriptionTopic":{"type":"string","description":"An MQTT topic to subscribe to, any received payload will be pushed into the attribute; use value filter(s) to extract values from string payloads and/or value converters to do simple value mapping, complex processing may require a rule or a custom MQTT agent"},"publishTopic":{"type":"string","description":"An MQTT topic to publish attribute events to, any received payload will be pushed into the attribute; use write value converter and/or write value to do any processing, complex processing may require a rule or a custom MQTT agent"},"qos":{"type":"integer","minimum":0,"maximum":2,"description":"QoS level to use for publish/subscribe (default is 0 if unset)"}},"title":"MQTTAgentLink","required":["type"]},"KNXAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["KNXAgentLink"],"default":"KNXAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"dpt":{"type":"string","pattern":"^\\\\d{1,3}\\\\.\\\\d{1,3}$"},"actionGroupAddress":{"type":"string","pattern":"^\\\\d{1,3}/\\\\d{1,3}/\\\\d{1,3}$"},"statusGroupAddress":{"type":"string","pattern":"^\\\\d{1,3}/\\\\d{1,3}/\\\\d{1,3}$"}},"title":"KNXAgentLink","required":["type","dpt"]},"SimulatorAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["SimulatorAgentLink"],"default":"SimulatorAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"replayData":{"type":"array","items":{"$ref":"#/definitions/SimulatorReplayDatapoint"},"description":"Used to store 24h dataset of values that should be replayed (i.e. written to the linked attribute) in a continuous loop."}},"title":"SimulatorAgentLink","required":["type"]},"SimulatorReplayDatapoint":{"type":"object","additionalProperties":true,"title":"Data point","properties":{"timestamp":{"type":"integer"},"value":{"$ref":"#/definitions/AnyType"}},"required":["timestamp"]},"MailAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["MailAgentLink"],"default":"MailAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"subjectMatchPredicate":{"$ref":"#/definitions/StringPredicate","description":"The predicate to apply to incoming mail message subjects to determine if the message is intended for the linked attribute. This must be defined to enable attributes to be updated by the linked agent."},"fromMatchPredicate":{"$ref":"#/definitions/StringPredicate","description":"The predicate to apply to incoming mail message from address(es) to determine if the message is intended for the linked attribute. This must be defined to enable attributes to be updated by the linked agent."},"useSubject":{"type":"boolean","description":"Use the subject as value instead of the body"}},"title":"MailAgentLink","required":["type"]},"VelbusAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["VelbusAgentLink"],"default":"VelbusAgentLink"},"id":{"type":"string","format":"or-agent-id"},"deviceAddress":{"type":"integer","minimum":1,"maximum":255},"deviceValueLink":{"type":"string","pattern":"^.*\\\\S+.*$","minLength":1},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"}},"title":"VelbusAgentLink","required":["type","deviceAddress","deviceValueLink"]}}}')),!(a=yield uM()))return void console.warn("Failed to load agents for agent link");if(n&&(n.id?a.find(e=>e.id===n.id)||(console.warn("Agent link: linked agent could not be found"),n.id=""):n.id=""),i.value&&r.value){let t=i.value;t.schema=e,t.data=n,r.value.loading=!1}}))(o),0),K`
|
|
1735
|
+
`}function uB(e,t,n){return e?tB.t("sending"):t?tB.t("sendFailed"):n?tB.t("updatedWithDate",{date:new Date(n)}):void 0}u$.NAME="or-attribute-input-changed";let uz=[...uS,uO],uj=e=>(t,n,i,r,o,a)=>{let s=!!(a&&a.disabled),l=!!(a&&a.readonly),c=a.label;if("agentLink"===r.name){let e,t,n={type:"Control",scope:"#"},i=eP(),r=eP(),a=[],d=!1,u=e=>{if(!d)return;let n=e.data;if(n){let e=a.find(e=>e.id===n.id);if(e){let t=tY.getAssetDescriptor(e.type);t&&(n.type=t.agentLinkType)}}tK(n,t)||(t=n,o({value:n}))};return{templateFunction:(o,h,m,f,p,g)=>(o||(o={id:"",type:"DefaultAgentLink"}),window.setTimeout(()=>(n=>(function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})})(void 0,void 0,void 0,function*(){if(d||(t=n),d=!0,e||(e=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","title":"Agent Link","oneOf":[{"$ref":"#/definitions/SNMPAgentLink"},{"$ref":"#/definitions/DefaultAgentLink"},{"$ref":"#/definitions/HTTPAgentLink"},{"$ref":"#/definitions/MockAgentLink"},{"$ref":"#/definitions/WebsocketAgentLink"},{"$ref":"#/definitions/ZWaveAgentLink"},{"$ref":"#/definitions/ModbusAgentLink"},{"$ref":"#/definitions/StorageSimulatorAgentLink"},{"$ref":"#/definitions/BluetoothMeshAgentLink"},{"$ref":"#/definitions/MQTTAgentLink"},{"$ref":"#/definitions/KNXAgentLink"},{"$ref":"#/definitions/SimulatorAgentLink"},{"$ref":"#/definitions/MailAgentLink"},{"$ref":"#/definitions/VelbusAgentLink"}],"definitions":{"SNMPAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["SNMPAgentLink"],"default":"SNMPAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"oid":{"type":"string"}},"title":"SNMPAgentLink","required":["type","oid"]},"regex":{"type":"object","additionalProperties":true,"title":"Regex","properties":{"type":{"type":"string","enum":["regex"],"default":"regex"},"pattern":{"type":"string"},"matchGroup":{"type":"integer"},"matchIndex":{"type":"integer"}},"required":["type"]},"substring":{"type":"object","additionalProperties":true,"title":"Substring","properties":{"type":{"type":"string","enum":["substring"],"default":"substring"},"beginIndex":{"type":"integer"},"endIndex":{"type":"integer"}},"required":["type","beginIndex"]},"jsonPath":{"type":"object","additionalProperties":true,"title":"JSON Path","properties":{"type":{"type":"string","enum":["jsonPath"],"default":"jsonPath"},"path":{"type":"string"},"returnFirst":{"type":"boolean"},"returnLast":{"type":"boolean"}},"required":["type","path","returnFirst","returnLast"]},"mathExpression":{"type":"object","additionalProperties":true,"title":"Mathematical Expression","properties":{"type":{"type":"string","enum":["mathExpression"],"default":"mathExpression"},"expression":{"type":"string"}},"required":["type"]},"AnyType":{"type":["null","number","integer","boolean","string","array","object"],"additionalProperties":true,"properties":{}},"StringPredicate":{"type":"object","additionalProperties":true,"description":"Predicate for string values; will match based on configured options.","properties":{"predicateType":{"type":"string","enum":["string"],"default":"string"},"match":{"type":"string","enum":["EXACT","BEGIN","END","CONTAINS"]},"caseSensitive":{"type":"boolean"},"value":{"type":"string"},"negate":{"type":"boolean"}},"title":"string","required":["predicateType","caseSensitive","negate"]},"BooleanPredicate":{"type":"object","additionalProperties":true,"description":"Predicate for boolean values; will evaluate the value as a boolean and match against this predicates value, any value that is not a boolean will not match","properties":{"predicateType":{"type":"string","enum":["boolean"],"default":"boolean"},"value":{"type":"boolean"}},"title":"boolean","required":["predicateType","value"]},"DateTimePredicate":{"type":"object","additionalProperties":true,"description":"Predicate for date time values; provided values should be valid ISO 8601 datetime strings (e.g. yyyy-MM-dd\'T\'HH:mm:ssZ or yyyy-MM-dd\'T\'HH:mm:ss\xb1HH:mm), offset and time are optional, if no offset information is supplied then UTC is assumed.","properties":{"predicateType":{"type":"string","enum":["datetime"],"default":"datetime"},"value":{"type":"string"},"rangeValue":{"type":"string"},"operator":{"type":"string","enum":["EQUALS","GREATER_THAN","GREATER_EQUALS","LESS_THAN","LESS_EQUALS","BETWEEN"]},"negate":{"type":"boolean"}},"title":"datetime","required":["predicateType","negate"]},"NumberPredicate":{"type":"object","additionalProperties":true,"description":"Predicate for number values; will match based on configured options.","properties":{"predicateType":{"type":"string","enum":["number"],"default":"number"},"value":{"type":"number"},"rangeValue":{"type":"number"},"operator":{"type":"string","enum":["EQUALS","GREATER_THAN","GREATER_EQUALS","LESS_THAN","LESS_EQUALS","BETWEEN"]},"negate":{"type":"boolean"}},"title":"number","required":["predicateType","negate"]},"RadialGeofencePredicate":{"type":"object","additionalProperties":true,"description":"Predicate for GEO JSON point values; will return true if the point is within the specified radius of the specified latitude and longitude unless negated.","title":"Radial geofence","properties":{"predicateType":{"type":"string","enum":["radial"],"default":"radial"},"radius":{"type":"integer"},"lat":{"type":"number"},"lng":{"type":"number"},"negated":{"type":"boolean"}},"required":["predicateType","radius","lat","lng","negated"]},"RectangularGeofencePredicate":{"type":"object","additionalProperties":true,"description":"Predicate for GEO JSON point values; will return true if the point is within the specified rectangle specified as latitude and longitude values of two corners unless negated.","title":"Rectangular geofence","properties":{"predicateType":{"type":"string","enum":["rect"],"default":"rect"},"latMin":{"type":"number"},"lngMin":{"type":"number"},"latMax":{"type":"number"},"lngMax":{"type":"number"},"negated":{"type":"boolean"}},"required":["predicateType","latMin","lngMin","latMax","lngMax","negated"]},"ArrayPredicate":{"type":"object","additionalProperties":true,"description":"Predicate for array values; will match based on configured options.","properties":{"predicateType":{"type":"string","enum":["array"],"default":"array"},"value":{"$ref":"#/definitions/AnyType"},"index":{"type":"integer"},"lengthEquals":{"type":"integer"},"lengthGreaterThan":{"type":"integer"},"lengthLessThan":{"type":"integer"},"negated":{"type":"boolean"}},"title":"array","required":["predicateType","negated"]},"ValueAnyPredicate":{"type":"object","additionalProperties":true,"description":"Predicate that matches any value including null.","title":"Any value","properties":{"predicateType":{"type":"string","enum":["value-any"],"default":"value-any"}},"required":["predicateType"]},"ValueEmptyPredicate":{"type":"object","additionalProperties":true,"description":"Predicate that matches any empty/null value; unless negated.","title":"Empty value","properties":{"predicateType":{"type":"string","enum":["value-empty"],"default":"value-empty"},"negate":{"type":"boolean"}},"required":["predicateType","negate"]},"CalendarEventPredicate":{"type":"object","additionalProperties":true,"description":"Predicate for calendar event values; will match based on whether the calendar event is active for the specified time.","title":"Calendar","properties":{"predicateType":{"type":"string","enum":["calendar-event"],"default":"calendar-event"},"timestamp":{"type":"integer","format":"utc-millisec"}},"required":["predicateType"]},"DefaultAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["DefaultAgentLink"],"default":"DefaultAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"}},"title":"DefaultAgentLink","required":["type"]},"HTTPAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["HTTPAgentLink"],"default":"HTTPAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"headers":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"A JSON object of headers to be added to HTTP request; the key represents the name of the header and for each string value supplied a new header will be added with the key name and specified string value"},"queryParameters":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"A JSON object of query parameters to be added to HTTP request URL; the key represents the name of the query parameter and for each string value supplied a new query parameter will be added with the key name and specified string value (e.g. \'https://..../?test=1&test=2\')"},"pollingMillis":{"type":"integer","description":"Indicates that this HTTP request is used to update the linked attribute; this value indicates how frequently the HTTP request is made in order to update the linked attribute value"},"pagingMode":{"type":"boolean","description":"Indicates that the HTTP server supports pagination using the standard Link header mechanism"},"path":{"type":"string","description":"The URL path to append to the agents Base URL when making requests for this linked attribute"},"method":{"type":"string","enum":["GET","POST","PUT","DELETE","OPTIONS","PATCH"],"description":"The HTTP method to use when making requests for this linked attribute"},"contentType":{"type":"string","description":"The content type header value to use when making requests for this linked attribute (shortcut alternative to using headers parameter)"},"pollingAttribute":{"type":"string","description":"Allows the polled response to be written to another attribute with the specified name on the same asset as the linked attribute"},"messageConvertBinary":{"type":"boolean","description":"Indicates that the HTTP response is binary and should be converted to binary string representation"},"messageConvertHex":{"type":"boolean","description":"Indicates that the HTTP response is binary and should be converted to hexadecimal string representation"}},"title":"HTTPAgentLink","required":["type","messageConvertBinary","messageConvertHex"]},"MockAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["MockAgentLink"],"default":"MockAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"requiredValue":{"type":"string"}},"title":"MockAgentLink","required":["type"]},"WebsocketAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["WebsocketAgentLink"],"default":"WebsocketAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"websocketSubscriptions":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/websocket"},{"$ref":"#/definitions/http"}]}}},"title":"WebsocketAgentLink","required":["type"]},"websocket":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["websocket"],"default":"websocket"},"body":{"$ref":"#/definitions/AnyType"}},"title":"websocket","required":["type"]},"http":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["http"],"default":"http"},"body":{"$ref":"#/definitions/AnyType"},"method":{"type":"string","enum":["GET","PUT","POST"]},"contentType":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"uri":{"type":"string"}},"title":"http","required":["type"]},"ZWaveAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["ZWaveAgentLink"],"default":"ZWaveAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"deviceNodeId":{"type":"integer"},"deviceEndpoint":{"type":"integer"},"deviceValue":{"type":"string"}},"title":"ZWaveAgentLink","required":["type"]},"ModbusAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["ModbusAgentLink"],"default":"ModbusAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"pollingMillis":{"type":"integer","description":"Poll interval in milliseconds"},"readMemoryArea":{"type":"string","enum":["COIL","DISCRETE","HOLDING","INPUT"],"description":"Memory area to read from during read request"},"readValueType":{"type":"string","enum":["BOOL","SINT","USINT","BYTE","INT","UINT","WORD","DINT","UDINT","DWORD","LINT","ULINT","LWORD","REAL","LREAL","CHAR","WCHAR"],"description":"Type to convert the returned data to. As specified by the PLC4X Modbus data types."},"readAddress":{"type":"integer","description":"Zero based address from which the value is read from"},"writeMemoryArea":{"type":"string","enum":["COIL","HOLDING"],"description":"Memory area to write to. \\"HOLDING\\" or \\"COIL\\" allowed."},"writeAddress":{"type":"integer","description":"Zero-based address to which the value sent is written to"},"readRegistersAmount":{"type":"integer","description":"Set amount of registers to read. If left empty or less than 1, will use the default size for the corresponding data-type."}},"title":"ModbusAgentLink","required":["type","pollingMillis","readMemoryArea","readValueType","readAddress"]},"StorageSimulatorAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["StorageSimulatorAgentLink"],"default":"StorageSimulatorAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"}},"title":"StorageSimulatorAgentLink","required":["type"]},"BluetoothMeshAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["BluetoothMeshAgentLink"],"default":"BluetoothMeshAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"appKeyIndex":{"type":"integer","minimum":0,"maximum":2147483647},"address":{"type":"string","pattern":"^([0-9A-Fa-f]{4})$"},"modelName":{"type":"string","pattern":"^.*\\\\S+.*$","minLength":1}},"title":"BluetoothMeshAgentLink","required":["type","appKeyIndex","modelName"]},"MQTTAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["MQTTAgentLink"],"default":"MQTTAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"subscriptionTopic":{"type":"string","description":"An MQTT topic to subscribe to, any received payload will be pushed into the attribute; use value filter(s) to extract values from string payloads and/or value converters to do simple value mapping, complex processing may require a rule or a custom MQTT agent"},"publishTopic":{"type":"string","description":"An MQTT topic to publish attribute events to, any received payload will be pushed into the attribute; use write value converter and/or write value to do any processing, complex processing may require a rule or a custom MQTT agent"},"qos":{"type":"integer","minimum":0,"maximum":2,"description":"QoS level to use for publish/subscribe (default is 0 if unset)"}},"title":"MQTTAgentLink","required":["type"]},"KNXAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["KNXAgentLink"],"default":"KNXAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"dpt":{"type":"string","pattern":"^\\\\d{1,3}\\\\.\\\\d{1,3}$"},"actionGroupAddress":{"type":"string","pattern":"^\\\\d{1,3}/\\\\d{1,3}/\\\\d{1,3}$"},"statusGroupAddress":{"type":"string","pattern":"^\\\\d{1,3}/\\\\d{1,3}/\\\\d{1,3}$"}},"title":"KNXAgentLink","required":["type","dpt"]},"SimulatorAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["SimulatorAgentLink"],"default":"SimulatorAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"replayData":{"type":"array","items":{"$ref":"#/definitions/SimulatorReplayDatapoint"},"description":"Used to store 24h dataset of values that should be replayed (i.e. written to the linked attribute) in a continuous loop."}},"title":"SimulatorAgentLink","required":["type"]},"SimulatorReplayDatapoint":{"type":"object","additionalProperties":true,"title":"Data point","properties":{"timestamp":{"type":"integer"},"value":{"$ref":"#/definitions/AnyType"}},"required":["timestamp"]},"MailAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["MailAgentLink"],"default":"MailAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"subjectMatchPredicate":{"$ref":"#/definitions/StringPredicate","description":"The predicate to apply to incoming mail message subjects to determine if the message is intended for the linked attribute. This must be defined to enable attributes to be updated by the linked agent."},"fromMatchPredicate":{"$ref":"#/definitions/StringPredicate","description":"The predicate to apply to incoming mail message from address(es) to determine if the message is intended for the linked attribute. This must be defined to enable attributes to be updated by the linked agent."},"useSubject":{"type":"boolean","description":"Use the subject as value instead of the body"}},"title":"MailAgentLink","required":["type"]},"VelbusAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["VelbusAgentLink"],"default":"VelbusAgentLink"},"id":{"type":"string","format":"or-agent-id"},"deviceAddress":{"type":"integer","minimum":1,"maximum":255},"deviceValueLink":{"type":"string","pattern":"^.*\\\\S+.*$","minLength":1},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"}},"title":"VelbusAgentLink","required":["type","deviceAddress","deviceValueLink"]}}}')),!(a=yield uR()))return void console.warn("Failed to load agents for agent link");if(n&&(n.id?a.find(e=>e.id===n.id)||(console.warn("Agent link: linked agent could not be found"),n.id=""):n.id=""),i.value&&r.value){let t=i.value;t.schema=e,t.data=n,r.value.loading=!1}}))(o),0),K`
|
|
1736
1736
|
<style>
|
|
1737
1737
|
.disabled {
|
|
1738
1738
|
opacity: 0.5;
|
|
@@ -1743,11 +1743,11 @@ uniform ${n} ${i} u_${r};
|
|
|
1743
1743
|
}
|
|
1744
1744
|
</style>
|
|
1745
1745
|
<or-loading-wrapper ${eB(r)} .loading="${!0}">
|
|
1746
|
-
<or-json-forms .renderers="${
|
|
1746
|
+
<or-json-forms .renderers="${uz}" ${eB(i)}
|
|
1747
1747
|
.disabled="${s}" .readonly="${l}" .label="${c}"
|
|
1748
1748
|
.schema="${e}" label="Agent link" .uischema="${n}" .onChange="${u}"></or-json-forms>
|
|
1749
1749
|
</or-loading-wrapper>
|
|
1750
|
-
`),supportsHelperText:!1,supportsLabel:!1,supportsSendButton:!1,validator:()=>!!i.value&&i.value.checkValidity()}}return e},
|
|
1750
|
+
`),supportsHelperText:!1,supportsLabel:!1,supportsSendButton:!1,validator:()=>!!i.value&&i.value.checkValidity()}}return e},uY=class extends ik(iO)(ez(tB)(em)){constructor(){super(...arguments),this.disableSubscribe=!1,this.disableWrite=!1,this.compact=!1,this.comfortable=!1,this.resizeVertical=!1,this.writeTimeout=5e3,this._requestFocus=!1,this._sendError=!1,this.langChangedCallback=()=>{this._updateTemplate(),this.requestUpdate()}}static get styles(){return[an,u`
|
|
1751
1751
|
:host {
|
|
1752
1752
|
display: inline-block;
|
|
1753
1753
|
}
|
|
@@ -1825,7 +1825,7 @@ uniform ${n} ${i} u_${r};
|
|
|
1825
1825
|
margin-left: 4px;
|
|
1826
1826
|
margin-top: 4px;
|
|
1827
1827
|
}
|
|
1828
|
-
`]}disconnectedCallback(){super.disconnectedCallback(),this._clearWriteTimeout()}shouldUpdate(e){let t=super.shouldUpdate(e),n=!1,i=!1;if(e.has("disableSubscribe")&&(n=!0),(e.has("attributeDescriptor")||e.has("valueDescriptor")||e.has("assetType"))&&(i=!0),e.has("attribute")){let t=Object.assign({},e.get("attribute")),r=this.attribute;if(t&&r){let o=t.value,a=t.timestamp;if(t.value=r.value,t.timestamp=r.timestamp,tK(t,r))if(tK(o,r.value)&&a===r.timestamp){if(1===e.size)return!1}else this._onAttributeValueChanged(o,r.value,r.timestamp);else n=!0,i=!0}}return e.has("assetId")&&e.get("assetId")!==this.assetId&&(n=!0,i=!0),i&&this._updateDescriptors(),n&&this._updateSubscribedRefs(),this._templateProvider&&(e.has("disabled")||e.has("readonly")||e.has("required")||e.has("label"))&&this._updateTemplate(),t}_updateSubscribedRefs(){if(this._attributeEvent=void 0,this.disableSubscribe)this.attributeRefs=void 0;else{let e=this._getAttributeRef();this.attributeRefs=e?[e]:void 0}}_getAttributeRef(){if(this.assetId&&this.attribute)return{name:this.attribute.name,id:this.assetId}}_updateDescriptors(){var e;if(this._valueDescriptor=void 0,this._attributeDescriptor=void 0,this.attributeDescriptor&&this.valueDescriptor)this._attributeDescriptor=this.attributeDescriptor,this._valueDescriptor=this.valueDescriptor;else{let e=this.attributeDescriptor||(this.attribute?this.attribute.name:void 0);if(e){let t=tY.getAttributeAndValueDescriptors(this.assetType,e,this.attribute);this._attributeDescriptor=t[0],this._valueDescriptor=this.valueDescriptor?this._valueDescriptor:t[1]}else this._attributeDescriptor=this.attributeDescriptor,this._valueDescriptor=this.valueDescriptor}if(this._valueDescriptor&&"assetType"==this._valueDescriptor.name){let t=null==(e=this._valueDescriptor.constraints)?void 0:e.find(e=>"allowedValues"===e.type);t&&t.allowedValues&&t.allowedValues.sort((e,t)=>e.localeCompare(t))}this._updateTemplate()}_updateTemplate(){if(this._templateProvider=void 0,!this.assetType)return;let e=tY.resolveValueDescriptor(this.attribute,this._valueDescriptor||this._attributeDescriptor);if(!e)return;let t={readonly:this.isReadonly(),required:this.required,disabled:this.disabled,compact:this.compact,rounded:this.rounded,outlined:this.outlined,label:this.getLabel(),comfortable:this.comfortable,resizeVertical:this.resizeVertical,inputType:this.inputType},n=e=>{let t=e?e.value:void 0,n=e&&e.enterPressed||!this._templateProvider||!this.showButton||!this._templateProvider.supportsSendButton;this._onInputValueChanged(t,n)};if(this.customProvider){this._templateProvider=this.customProvider?this.customProvider(this.assetType,this.attribute,this._attributeDescriptor,e,e=>n(e),t):void 0;return}if("GEO_JSONPoint"===e.name){var i,r;let e,o,a,s,l,c,d,u;this._templateProvider=(i=this.assetType,this.attribute,this._attributeDescriptor,r=e=>n(e),o=!!(t&&t.disabled),a=!!(t&&t.readonly),s=!!(t&&t.compact),l=!!(t&&t.comfortable),c=new
|
|
1828
|
+
`]}disconnectedCallback(){super.disconnectedCallback(),this._clearWriteTimeout()}shouldUpdate(e){let t=super.shouldUpdate(e),n=!1,i=!1;if(e.has("disableSubscribe")&&(n=!0),(e.has("attributeDescriptor")||e.has("valueDescriptor")||e.has("assetType"))&&(i=!0),e.has("attribute")){let t=Object.assign({},e.get("attribute")),r=this.attribute;if(t&&r){let o=t.value,a=t.timestamp;if(t.value=r.value,t.timestamp=r.timestamp,tK(t,r))if(tK(o,r.value)&&a===r.timestamp){if(1===e.size)return!1}else this._onAttributeValueChanged(o,r.value,r.timestamp);else n=!0,i=!0}}return e.has("assetId")&&e.get("assetId")!==this.assetId&&(n=!0,i=!0),i&&this._updateDescriptors(),n&&this._updateSubscribedRefs(),this._templateProvider&&(e.has("disabled")||e.has("readonly")||e.has("required")||e.has("label"))&&this._updateTemplate(),t}_updateSubscribedRefs(){if(this._attributeEvent=void 0,this.disableSubscribe)this.attributeRefs=void 0;else{let e=this._getAttributeRef();this.attributeRefs=e?[e]:void 0}}_getAttributeRef(){if(this.assetId&&this.attribute)return{name:this.attribute.name,id:this.assetId}}_updateDescriptors(){var e;if(this._valueDescriptor=void 0,this._attributeDescriptor=void 0,this.attributeDescriptor&&this.valueDescriptor)this._attributeDescriptor=this.attributeDescriptor,this._valueDescriptor=this.valueDescriptor;else{let e=this.attributeDescriptor||(this.attribute?this.attribute.name:void 0);if(e){let t=tY.getAttributeAndValueDescriptors(this.assetType,e,this.attribute);this._attributeDescriptor=t[0],this._valueDescriptor=this.valueDescriptor?this._valueDescriptor:t[1]}else this._attributeDescriptor=this.attributeDescriptor,this._valueDescriptor=this.valueDescriptor}if(this._valueDescriptor&&"assetType"==this._valueDescriptor.name){let t=null==(e=this._valueDescriptor.constraints)?void 0:e.find(e=>"allowedValues"===e.type);t&&t.allowedValues&&t.allowedValues.sort((e,t)=>e.localeCompare(t))}this._updateTemplate()}_updateTemplate(){if(this._templateProvider=void 0,!this.assetType)return;let e=tY.resolveValueDescriptor(this.attribute,this._valueDescriptor||this._attributeDescriptor);if(!e)return;let t={readonly:this.isReadonly(),required:this.required,disabled:this.disabled,compact:this.compact,rounded:this.rounded,outlined:this.outlined,label:this.getLabel(),comfortable:this.comfortable,resizeVertical:this.resizeVertical,inputType:this.inputType},n=e=>{let t=e?e.value:void 0,n=e&&e.enterPressed||!this._templateProvider||!this.showButton||!this._templateProvider.supportsSendButton;this._onInputValueChanged(t,n)};if(this.customProvider){this._templateProvider=this.customProvider?this.customProvider(this.assetType,this.attribute,this._attributeDescriptor,e,e=>n(e),t):void 0;return}if("GEO_JSONPoint"===e.name){var i,r;let e,o,a,s,l,c,d,u;this._templateProvider=(i=this.assetType,this.attribute,this._attributeDescriptor,r=e=>n(e),o=!!(t&&t.disabled),a=!!(t&&t.readonly),s=!!(t&&t.compact),l=!!(t&&t.comfortable),c=new l_,u=new lx(o,d=e=>{r&&(void 0!==e?r({value:e?function(e){if(e)return Array.isArray(e)?{type:"Point",coordinates:e}:{type:"Point",coordinates:[e.hasOwnProperty("lng")?e.lng:e.lon,e.lat]}}(e):null}):r(void 0))}),{templateFunction:(t,n,r,h,m,f)=>{let p,g;t&&(p=(e=av(t))?Object.values(e):void 0);let b=p?p.join(", "):void 0;c.pos=e||void 0,u.readonly=o||a||h||r,u.value=b;let _=ax(i),y=t=>{if(!a&&!o)if(e=t?av(t):null,g){let t=g.shadowRoot.getElementById("geo-json-point-marker");t.lng=e?e.lng:void 0,t.lat=e?e.lat:void 0,u.value=(p=e?Object.values(e):void 0)?p.join(", "):void 0}else d(e)},v=[[c,"bottom-left"],[u,"top-right"]];if(!a){let e=new ag.GeolocateControl({positionOptions:{enableHighAccuracy:!0},showAccuracyCircle:!1,showUserLocation:!1});e.on("geolocate",e=>{y(new ag.LngLat(e.coords.longitude,e.coords.latitude))}),e.on("outofmaxbounds",e=>{y(new ag.LngLat(e.coords.longitude,e.coords.latitude))}),v.push([e,"bottom-left"])}let x=K`
|
|
1829
1829
|
<or-map id="geo-json-point-map" class="or-map" @or-map-long-press="${e=>{y(e.detail.lngLat)}}" .center="${p}" .controls="${v}" .showGeoCodingControl=${!a}>
|
|
1830
1830
|
<or-map-marker id="geo-json-point-marker" active .lng="${e?e.lng:void 0}" .lat="${e?e.lat:void 0}" .icon="${_?_.icon:void 0}" .activeColor="${_?"#"+_.color:void 0}" .colour="${_?"#"+_.color:void 0}"></or-map-marker>
|
|
1831
1831
|
</or-map>
|
|
@@ -1840,8 +1840,8 @@ uniform ${n} ${i} u_${r};
|
|
|
1840
1840
|
}
|
|
1841
1841
|
</style>
|
|
1842
1842
|
<div id="geo-json-point-input-compact-wrapper">
|
|
1843
|
-
<or-mwc-input style="width: auto;" .comfortable="${l}" .type="${
|
|
1844
|
-
<or-mwc-input style="width: auto;" .type="${
|
|
1843
|
+
<or-mwc-input style="width: auto;" .comfortable="${l}" .type="${sq.TEXT}" .value="${b}" .pattern="${ly}" @keyup="${e=>lv(d)(e)}"></or-mwc-input>
|
|
1844
|
+
<or-mwc-input style="width: auto;" .type="${sq.BUTTON}" compact icon="crosshairs-gps" @or-mwc-input-changed="${()=>{g=la(new ll().setContent(t).setStyles(K`
|
|
1845
1845
|
<style>
|
|
1846
1846
|
.dialog-container {
|
|
1847
1847
|
flex-direction: column !important;
|
|
@@ -1857,11 +1857,11 @@ uniform ${n} ${i} u_${r};
|
|
|
1857
1857
|
</style>
|
|
1858
1858
|
`).setActions([{actionName:"none",content:"none",action:()=>{y(null),d(e)}},{actionName:"ok",content:"ok",action:()=>{d(e)}},{default:!0,actionName:"cancel",content:"cancel"}]))}}"></or-mwc-input>
|
|
1859
1859
|
</div>
|
|
1860
|
-
`}return x},supportsHelperText:!1,supportsLabel:!1,supportsSendButton:!1,validator:()=>!e||void 0!==e.lat&&null!==e.lat&&void 0!==e.lng&&null!==e.lng});return}let o=((e,t,n,i,r,o)=>{var a,s,l,c,d,u,h;let m,f,p,g,b,_,y,v,x=o.inputType,w={},F="string"==typeof e?e:e.name,k=(t&&t.meta||i&&i.meta?t5("constraints",t,n,F,!0):(a=t,s=n,l=F,t5("constraints",a||tJ(s,null),s,l,!1)))||[],E=t&&t.meta||i&&i.meta?t5("format",t,n,F,!0):(c=t,d=n,u=F,t5("format",c||tJ(d,null),d,u,!1));if(!x){switch(i.name){case"text":case"email":case"UUID":case"assetID":case"hostOrIPAddress":case"IPAddress":x=!0===tZ("multiline",t,n)?
|
|
1860
|
+
`}return x},supportsHelperText:!1,supportsLabel:!1,supportsSendButton:!1,validator:()=>!e||void 0!==e.lat&&null!==e.lat&&void 0!==e.lng&&null!==e.lng});return}let o=((e,t,n,i,r,o)=>{var a,s,l,c,d,u,h;let m,f,p,g,b,_,y,v,x=o.inputType,w={},F="string"==typeof e?e:e.name,k=(t&&t.meta||i&&i.meta?t5("constraints",t,n,F,!0):(a=t,s=n,l=F,t5("constraints",a||tJ(s,null),s,l,!1)))||[],E=t&&t.meta||i&&i.meta?t5("format",t,n,F,!0):(c=t,d=n,u=F,t5("format",c||tJ(d,null),d,u,!1));if(!x){switch(i.name){case"text":case"email":case"UUID":case"assetID":case"hostOrIPAddress":case"IPAddress":x=!0===tZ("multiline",t,n)?sq.TEXTAREA:sq.TEXT;break;case"boolean":if(E&&E.asNumber){x=sq.NUMBER,m=1,p=0,g=1,v=e=>!!e;break}x=E&&(E.asOnOff||E.asOpenClosed)?sq.SWITCH:sq.CHECKBOX,(E&&E.asMomentary||!0===tZ("momentary",t,n))&&(x=sq.BUTTON_MOMENTARY);break;case"bigNumber":case"number":case"positiveInteger":case"positiveNumber":case"long":case"integer":case"byte":case"integerByte":case"direction":case"TCP_IPPortNumber":"byte"===i.name||"integerByte"===i.name?(p=0,g=255,m=1):("integer"===i.name||"long"===i.name)&&(m=1),E&&E.asDate?x=sq.DATETIME:E&&E.asBoolean?(x=sq.CHECKBOX,v=e=>+!!e):x=E&&E.asSlider?sq.RANGE:sq.NUMBER;break;case"bigInteger":x=sq.BIG_INT,m=1;break;case"colourRGB":x=sq.COLOUR;break;case"dateAndTime":case"timestamp":case"timestampISO8601":x=sq.DATETIME;break;case"CRONExpression":x=sq.CRON;break;case"timeDurationISO8601":x=sq.DURATION_TIME;break;case"periodDurationISO8601":x=sq.DURATION_PERIOD;break;case"timeAndPeriodDurationISO8601":x=sq.DURATION;break;case"JSONObject":x=sq.JSON_OBJECT}i.arrayDimensions&&i.arrayDimensions>0&&(x=sq.JSON)}if(!x)switch(i.jsonType){case"number":case"bigint":x=sq.NUMBER;break;case"boolean":x=sq.CHECKBOX;break;case"string":x=sq.TEXT;break;case"date":x=sq.DATETIME}x||(x=sq.JSON);let A=k&&k.find(e=>"size"===e.type),C=k&&k.find(e=>"pattern"===e.type),T=k&&k.find(e=>"min"===e.type),S=k&&k.find(e=>"max"===e.type),M=k&&k.find(e=>"allowedValues"===e.type),D=k&&k.find(e=>"past"===e.type),I=k&&k.find(e=>"pastOrPresent"===e.type),R=k&&k.find(e=>"future"===e.type),O=k&&k.find(e=>"futureOrPresent"===e.type),P=k&&k.find(e=>"notEmpty"===e.type),$=k&&k.find(e=>"notBlank"===e.type),N=k&&k.find(e=>"notNull"===e.type);if(A&&(p=A.min,g=A.max),A&&(p=A.min,g=A.max),T&&(p=T.min),S&&(g=S.max),C&&(f=C.regexp),N&&(_=!0),$&&!f?f="\\S+":P&&!f&&(f=".+"),M&&M.allowedValues){let e=M.allowedValueNames&&M.allowedValueNames.length===M.allowedValues.length?M.allowedValueNames:void 0;y=M.allowedValues.map((t,n)=>{let i=e?e[n]:""+t;return[t,(i=function(e,t){if(e)return tB.t("label.allowedValue."+e,{defaultValue:tX(e||""),nsSeparator:!1})}(i))||""+t]}),x=sq.SELECT,i.arrayDimensions&&i.arrayDimensions>0&&(b=!0)}x===sq.DATETIME&&(D||I?(p=void 0,g=new Date):(R||O)&&(p=new Date,g=void 0),E&&(E.timeStyle&&!E.dateStyle?x=sq.TIME:E.dateStyle&&!E.timeStyle&&(x=sq.DATE))),x===sq.NUMBER&&E&&E.resolution&&(m=E.resolution),x===sq.COLOUR&&(w.marginLeft="24px");let B=o9(x),z=o9(h=x)||h===sq.CHECKBOX||h===sq.BUTTON_MOMENTARY,j=o7(x),Y=o.readonly;_=_||o.required;let H=o.comfortable,U=o.resizeVertical,V=eP();return{templateFunction:(e,t,n,i,a,s)=>{let l=o.disabled||n||i,c=z?o.label:void 0;return K`<or-mwc-input ${eB(V)} id="input" style="${oR(w)}" .type="${x}" .label="${c}" .value="${e}" .pattern="${f}"
|
|
1861
1861
|
.min="${p}" .max="${g}" .format="${E}" .focused="${t}" .required="${_}" .multiple="${b}"
|
|
1862
1862
|
.options="${y}" .comfortable="${H}" .readonly="${Y}" .disabled="${l}" .step="${m}"
|
|
1863
1863
|
.helperText="${s}" .helperPersistent="${!0}" .resizeVertical="${U}"
|
|
1864
1864
|
.rounded="${o.rounded}"
|
|
1865
1865
|
.outlined="${o.outlined}"
|
|
1866
|
-
@or-mwc-input-changed="${e=>{e.stopPropagation(),e.detail.value=v?v(e.detail.value):e.detail.value,r(e.detail)}}"></or-mwc-input>`},supportsHelperText:B,supportsSendButton:j,supportsLabel:z,validator:()=>!!V.value&&V.value.checkValidity()}})(this.assetType,this.attribute,this._attributeDescriptor,e,e=>n(e),t);this._templateProvider=
|
|
1866
|
+
@or-mwc-input-changed="${e=>{e.stopPropagation(),e.detail.value=v?v(e.detail.value):e.detail.value,r(e.detail)}}"></or-mwc-input>`},supportsHelperText:B,supportsSendButton:j,supportsLabel:z,validator:()=>!!V.value&&V.value.checkValidity()}})(this.assetType,this.attribute,this._attributeDescriptor,e,e=>n(e),t);this._templateProvider=uj(o)(this.assetType,this.attribute,this._attributeDescriptor,e,e=>n(e),t),this._templateProvider||(this._templateProvider=o)}getLabel(){let e;if(this.label)e=this.label;else if(""!==this.label&&null!==this.label){var t,n;let i=tY.getAttributeAndValueDescriptors(this.assetType,this.attribute?this.attribute.name:void 0,this._attributeDescriptor);t=this.attribute,n=i[0],e=tQ(t,n,this.assetType,!0,!0,void 0)}return e}isReadonly(){return iO.hasRole("write:attributes")?void 0!==this.readonly?this.readonly:tZ("readOnly",this.attribute,this._attributeDescriptor):(this.readonly=!iO.hasRole("write:attributes"),this.readonly)}render(){if(!this.assetType||!this._templateProvider)return K``;let e=this.attributeRefs&&!this._attributeEvent||!!this._writeTimeoutHandler,t=this.getValue(),n=this._requestFocus;this._requestFocus=!1;let i=this.hasHelperText?uB(!!this._writeTimeoutHandler,this._sendError,this.getTimestamp()):void 0,r=this.showButton?this._writeTimeoutHandler?"send-clock":"send":this.disableButton?void 0:"";return uN(this._templateProvider&&this._templateProvider.templateFunction?K`${eO(this._templateProvider.templateFunction(t,n,e,!!this._writeTimeoutHandler,this._sendError,this._templateProvider.supportsHelperText?i:void 0),"")}`:K`<or-translate .value="attributeUnsupported"></or-translate>`,t,e,!!this.disabled,this._templateProvider.supportsHelperText?void 0:i,this._templateProvider.supportsLabel?void 0:this.getLabel(),this._templateProvider.supportsSendButton?r:void 0,()=>this._updateValue(),this.fullWidth)}updated(e){e.has("_writeTimeoutHandler")&&!this._writeTimeoutHandler&&(this._requestFocus=!0,this.requestUpdate())}get showButton(){return!this.isReadonly()&&!this.disabled&&!this.disableButton&&!!this._getAttributeRef()&&!!this._templateProvider&&this._templateProvider.supportsSendButton}getValue(){return this._attributeEvent?this._attributeEvent.value:this.attribute?this.attribute.value:this.value}getTimestamp(){return this._attributeEvent?this._attributeEvent.timestamp:this.attribute?this.attribute.timestamp:void 0}_onEvent(e){if("attribute"!==e.eventType)return;let t=this.getValue();this._attributeEvent=e,this._onAttributeValueChanged(t,this._attributeEvent.value,e.timestamp)}checkValidity(){return!!this._templateProvider&&(!this._templateProvider.validator||this._templateProvider.validator())}_onAttributeValueChanged(e,t,n){this.attribute&&(this.attribute.value=t,this.attribute.timestamp=n),this._clearWriteTimeout(),this.value=t,this._sendError=!1,this.dispatchEvent(new u$(t,e))}_onInputValueChanged(e,t){this._newValue=e,t&&this._updateValue()}_updateValue(){if(this.readonly||this.isReadonly()||this._writeTimeoutHandler)return;void 0===this._newValue&&(this._newValue=this.getValue());let e=this.getValue(),t=this._newValue;this._newValue=void 0;let n=this._getAttributeRef();n&&!this.disableWrite?(super._sendEvent({eventType:"attribute",ref:n,value:t}),this._writeTimeoutHandler=window.setTimeout(()=>this._onWriteTimeout(),this.writeTimeout)):(this.value=t,this.dispatchEvent(new u$(t,e)))}_clearWriteTimeout(){this._writeTimeoutHandler&&window.clearTimeout(this._writeTimeoutHandler),this._writeTimeoutHandler=void 0}_onWriteTimeout(){this._sendError=!0,(!this.showButton||this.hasHelperText)&&this.requestUpdate("value"),this._clearWriteTimeout()}};uP([eb({type:Object,reflect:!1})],uY.prototype,"attribute",void 0),uP([eb({type:String})],uY.prototype,"assetId",void 0),uP([eb({type:Object})],uY.prototype,"attributeDescriptor",void 0),uP([eb({type:Object})],uY.prototype,"valueDescriptor",void 0),uP([eb({type:String})],uY.prototype,"assetType",void 0),uP([eb({type:String})],uY.prototype,"label",void 0),uP([eb({type:Boolean})],uY.prototype,"disabled",void 0),uP([eb({type:Boolean})],uY.prototype,"readonly",void 0),uP([eb({type:Boolean,attribute:!0})],uY.prototype,"required",void 0),uP([eb()],uY.prototype,"value",void 0),uP([eb()],uY.prototype,"inputType",void 0),uP([eb({type:Boolean})],uY.prototype,"hasHelperText",void 0),uP([eb({type:Boolean})],uY.prototype,"disableButton",void 0),uP([eb({type:Boolean,attribute:!0})],uY.prototype,"disableSubscribe",void 0),uP([eb({type:Boolean})],uY.prototype,"disableWrite",void 0),uP([eb({type:Boolean})],uY.prototype,"compact",void 0),uP([eb({type:Boolean})],uY.prototype,"comfortable",void 0),uP([eb({type:Boolean})],uY.prototype,"resizeVertical",void 0),uP([eb({type:Boolean})],uY.prototype,"fullWidth",void 0),uP([eb({type:Boolean})],uY.prototype,"rounded",void 0),uP([eb({type:Boolean})],uY.prototype,"outlined",void 0),uP([eb()],uY.prototype,"_attributeEvent",void 0),uP([eb()],uY.prototype,"_writeTimeoutHandler",void 0),uY=uP([ep("or-attribute-input")],uY)})(),i})());
|
|
1867
1867
|
//# sourceMappingURL=index.orbundle.js.map
|