(function(E,z){typeof exports=="object"&&typeof module<"u"?z(exports,require("@idmwx/idmwx-base"),require("vue"),require("@turf/turf"),require("@mapbox/sphericalmercator"),require("moment"),require("mapbox-gl"),require("@idm-plugin/geo"),require("axios")):typeof define=="function"&&define.amd?define(["exports","@idmwx/idmwx-base","vue","@turf/turf","@mapbox/sphericalmercator","moment","mapbox-gl","@idm-plugin/geo","axios"],z):(E=typeof globalThis<"u"?globalThis:E||self,z(E["idm-gl"]={},E["@idmwx/idmwx-base"],E.Vue,E["@turf/turf"],E["@mapbox/sphericalmercator"],E.moment,E["mapbox-gl"],E["@idm-plugin/geo"],E.axios))})(this,function(E,z,r,Ee,Se,M,U,S,Z){"use strict";var zr=Object.defineProperty;var Pr=(E,z,r)=>z in E?zr(E,z,{enumerable:!0,configurable:!0,writable:!0,value:r}):E[z]=r;var P=(E,z,r)=>(Pr(E,typeof z!="symbol"?z+"":z,r),r);function ze(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const x=ze(Ee),Nr="",Tr="",C=(a,e)=>{const t=a.__vccOpts||a;for(const[o,i]of e)t[o]=i;return t},Pe={name:"IdmGlLayer",props:{map:{type:Object},mapProjection:{type:String},top:{type:Number,default:60},toggleMenu:{type:Boolean,default:!1},toggleVersion:{type:Number},isLogin:{type:Boolean,default:void 0}},emits:["weather","other","coordinate","measure","point","3d","toggleVersion","menu","showLayers"],data(){return{showLayers:!1,source:"",weatherLayers:[],activeWeatherLayers:[],autoActive:!0,otherLayers:[],layers:{weather:[...z.LayerHelper.WEATHER_LAYERS],other:[...z.LayerHelper.OTHER_LAYERS]},weatherLayersCache:"weatherLayersCache",autoActiveCache:"autoActiveCache",otherLayersCache:"otherLayersCache",sourceCache:"defaultSourceCache",showCoord:!1,showMeasure:!1,showPoint:!1,show3d:!1,version:{v:"0.0.6",k:"glCacheVersion"},right:10,rampColorLayers:["visibility","precip3h","temp","water-temp","arctic"]}},computed:{computeLayerClass(){return function(a,e){let t="layer";return e.some(o=>o.key===a.key)&&(t="layer active"),(!a.enabled||this.rampColorLayers.includes(a.key)&&this.mapProjection==="globe")&&(t="layer disabled"),t}}},watch:{showLayers:{handler(){this.$nextTick(()=>{var a,e;this.$emit("menu",this.showLayers?!1:this.toggleMenu),this.$emit("toggleVersion",Math.random()),this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10})}},toggleMenu:{handler(){this.$nextTick(()=>{var a,e;this.showLayers=this.toggleMenu?!1:this.showLayers,this.$emit("toggleVersion",Math.random()),this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10})}}},mounted(){const a=localStorage.getItem(this.version.k);this.version.v!==a&&(localStorage.removeItem(this.weatherLayersCache),localStorage.setItem(this.version.k,this.version.v));let e=localStorage.getItem(this.autoActiveCache);this.autoActive=e!=="false",e=localStorage.getItem(this.weatherLayersCache);let t=JSON.parse(e||'[{"weight":1,"name":"Wind","key":"wind","enabled":true,"type":"json","particle":true},{"weight":4096,"name":"Pressure","key":"prmsl","enabled":true,"type":"json"},{"weight":256,"name":"Tropicals","key":"tropicals","enabled":true,"type":"json"}]');this.weatherLayers=t,this.autoActive&&(this.activeWeatherLayers=[...t]),e=localStorage.getItem(this.otherLayersCache),t=JSON.parse(e||'[{"weight":4,"name":"ECA Zones","key":"eca-zones","enabled":true,"type":"json"}]'),this.otherLayers=t,e=localStorage.getItem(this.sourceCache),this.source=e||"GFS",this.handleConfirm()},methods:{handleConfirm(){this.$emit("weather",this.weatherLayers,this.activeWeatherLayers,this.source),this.$emit("other",this.otherLayers),localStorage.setItem(this.autoActiveCache,this.autoActive),localStorage.setItem(this.sourceCache,this.source)},handleWeatherLayerPick(a){if(this.rampColorLayers.includes(a.key)&&this.mapProjection==="globe")return!1;this.weatherLayers.some(e=>e.key===a.key)?(this.weatherLayers=this.weatherLayers.filter(e=>e.key!==a.key),this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.key!==a.key)):this.weatherLayers.length<12&&a.enabled&&(["png","jpg"].includes(a.type)&&(this.weatherLayers=this.weatherLayers.filter(e=>e.type==="json"),this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.type==="json")),this.weatherLayers.push(a),this.activeWeatherLayers.push(a)),localStorage.setItem(this.weatherLayersCache,JSON.stringify(this.weatherLayers)),this.$emit("weather",this.weatherLayers,this.activeWeatherLayers,this.source),localStorage.setItem(this.autoActiveCache,this.autoActive),localStorage.setItem(this.sourceCache,this.source)},handleActiveWeatherLayerPick(a){if(this.rampColorLayers.includes(a.key)&&this.mapProjection==="globe")return!1;if(this.activeWeatherLayers.some(e=>e.key===a.key))this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.key!==a.key);else if(a.enabled){this.activeWeatherLayers.push(a);for(const e of this.weatherLayers)a.weight>e.weight&&a.weight&e.weight&&this.activeWeatherLayers.push(e)}this.$emit("weather",this.weatherLayers,this.activeWeatherLayers,this.source)},handleOtherLayerPick(a){this.otherLayers.some(e=>e.key===a.key)?this.otherLayers=this.otherLayers.filter(e=>e.key!==a.key):a.enabled&&this.otherLayers.push(a),localStorage.setItem(this.otherLayersCache,JSON.stringify(this.otherLayers)),this.$emit("other",this.otherLayers)},handleMenuToggle(){this.showLayers=!this.showLayers},handleCoordToggle(){this.showCoord=!this.showCoord,this.$emit("coordinate",this.showCoord)},handlePointToggle(){this.isLogin?(this.showPoint=!this.showPoint,this.$emit("point",this.showPoint)):this.$emit("toggleVersion",Math.random())},handleMeasureToggle(){this.showMeasure=!this.showMeasure,this.$emit("measure",this.showMeasure)},handle3DToggle(){this.show3d=!this.show3d,this.$emit("3d",this.show3d)},handleSourceToggle(a){this.source=a,this.handleConfirm()}}},Ne={class:"idm-gl3-layer"},Te={class:"bar-item layer-bars"},De={class:"bar-item tool-bars"},Ve=["onClick"],Re={class:"weather-layers"},Ie={class:"layers-title",style:{display:"flex","align-items":"center","justify-content":"space-between"}},Be={style:{"font-size":"12px"}},Ae={class:"layers-body"},Me=["onClick"],We={class:"other-layers"},Oe={class:"layers-body"},je=["onClick"],Fe={class:"source-layers"},$e={class:"layers-body model-box"};function He(a,e,t,o,i,s){const l=r.resolveComponent("ElScrollbar");return r.openBlock(),r.createElementBlock("div",Ne,[r.createElementVNode("div",{class:"menu-bar-box",style:r.normalizeStyle({top:t.top+10+"px",right:i.right+"px"})},[r.createElementVNode("div",Te,[r.createElementVNode("div",{class:r.normalizeClass(i.showLayers?"menu-icon active":"menu-icon"),onClick:e[0]||(e[0]=(...n)=>s.handleMenuToggle&&s.handleMenuToggle(...n))},e[8]||(e[8]=[r.createElementVNode("span",{class:"iconfont"},"",-1)]),2)])],4),r.createElementVNode("div",{class:"menu-bar-box",style:r.normalizeStyle({top:t.top+160+"px",right:i.right+"px"})},[r.createElementVNode("div",De,[r.createElementVNode("div",{class:r.normalizeClass(i.showMeasure?"menu-icon active":"menu-icon"),onClick:e[1]||(e[1]=(...n)=>s.handleMeasureToggle&&s.handleMeasureToggle(...n))},e[9]||(e[9]=[r.createElementVNode("span",{class:"iconfont"},"",-1)]),2),r.createElementVNode("div",{class:r.normalizeClass(i.showPoint?"menu-icon active":"menu-icon"),onClick:e[2]||(e[2]=(...n)=>s.handlePointToggle&&s.handlePointToggle(...n))},e[10]||(e[10]=[r.createElementVNode("span",{class:"iconfont"},"",-1)]),2),r.createElementVNode("div",{class:r.normalizeClass(i.showCoord?"menu-icon active":"menu-icon"),onClick:e[3]||(e[3]=(...n)=>s.handleCoordToggle&&s.handleCoordToggle(...n))},e[11]||(e[11]=[r.createElementVNode("span",{class:"iconfont"},"",-1)]),2),r.createElementVNode("div",{class:r.normalizeClass(i.show3d?"menu-icon active":"menu-icon"),onClick:e[4]||(e[4]=(...n)=>s.handle3DToggle&&s.handle3DToggle(...n))},e[12]||(e[12]=[r.createElementVNode("span",{class:"iconfont"},"",-1)]),2)])],4),r.createElementVNode("div",{class:"active-layers",style:r.normalizeStyle({right:i.right+"px",bottom:"100px"})},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.weatherLayers,n=>(r.openBlock(),r.createElementBlock("div",{key:n.key,class:r.normalizeClass(s.computeLayerClass(n,i.activeWeatherLayers)),onClick:c=>s.handleActiveWeatherLayerPick(n)},[e[13]||(e[13]=r.createElementVNode("div",{class:"checkbox"},null,-1)),r.createElementVNode("span",null,r.toDisplayString(n.name),1)],10,Ve))),128))],4),r.createElementVNode("div",{class:"available-layers flex-center",style:r.normalizeStyle({top:t.top+"px",right:i.showLayers?"0px":"-240px"})},[r.createElementVNode("div",{class:"side-bar",style:r.normalizeStyle({right:i.showLayers?"0px":"-240px"}),onClick:e[5]||(e[5]=(...n)=>s.handleMenuToggle&&s.handleMenuToggle(...n))},e[14]||(e[14]=[r.createElementVNode("i",{class:"iconfont"},"",-1)]),4),r.createElementVNode("div",{class:r.normalizeClass(["list-box",i.showLayers?"available-layers-show":""])},[r.createVNode(l,{style:{flex:"1"}},{default:r.withCtx(()=>[r.createElementVNode("div",Re,[r.createElementVNode("div",Ie,[r.createElementVNode("div",null,[e[15]||(e[15]=r.createTextVNode(" Weather Layers ")),r.createElementVNode("span",Be,"("+r.toDisplayString(i.weatherLayers.length)+"/12)",1)])]),r.createElementVNode("div",Ae,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.layers.weather,n=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:n.key},[n.hide?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(s.computeLayerClass(n,i.weatherLayers)),onClick:c=>s.handleWeatherLayerPick(n)},[e[16]||(e[16]=r.createElementVNode("div",{class:"checkbox"},null,-1)),r.createElementVNode("span",null,r.toDisplayString(n.name),1)],10,Me))],64))),128))])]),r.createElementVNode("div",We,[e[18]||(e[18]=r.createElementVNode("div",{class:"layers-title"},"Other Layers",-1)),r.createElementVNode("div",Oe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.layers.other,n=>(r.openBlock(),r.createElementBlock("div",{key:n.key,class:r.normalizeClass(s.computeLayerClass(n,i.otherLayers)),onClick:c=>s.handleOtherLayerPick(n)},[e[17]||(e[17]=r.createElementVNode("div",{class:"checkbox"},null,-1)),r.createElementVNode("span",null,r.toDisplayString(n.name),1)],10,je))),128))])]),r.createElementVNode("div",Fe,[e[19]||(e[19]=r.createElementVNode("span",{class:"layers-title"},"Forecast Model",-1)),r.createElementVNode("div",$e,[r.createElementVNode("span",{class:r.normalizeClass(i.source==="GFS"?"text active":"text"),onClick:e[6]||(e[6]=n=>s.handleSourceToggle("GFS"))},"GFS",2),r.createElementVNode("span",{class:r.normalizeClass(i.source==="CMEMS"?"text active":"text"),onClick:e[7]||(e[7]=n=>s.handleSourceToggle("CMEMS"))},"ECMWF",2)])])]),_:1})],2)],4)])}const Ue=C(Pe,[["render",He]]),Dr="",Ze={name:"IdmWindBarb",props:{map:{type:Object},wind:{type:Object},current:{type:Object},beforeLayer:{type:String},mapProjection:{type:String},showParticle:{type:Boolean,default:!1},toggleVersion:{type:Number},weatherLayers:{type:Object}},emits:["particle"],data(){return{source:"wind-barb-source",barbs:[0,2,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105],empty:x.featureCollection([]),showFeather:!1,right:10,bottom:125,windBarbLoaded:!1}},watch:{"wind.version":{handler(){var a;(a=this.wind)!=null&&a.active&&this.showFeather?this.handleRender():this.handleClear()},deep:!0},showParticle:{handler(){this.showFeather=!this.showParticle},immediate:!0},showFeather:{handler(){this.handleToggle()},immediate:!0},toggleVersion:{handler(){var a,e;this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0},"current.version":{handler(){var a,e,t;this.bottom=(a=this.current)!=null&&a.active?(((e=document.getElementsByClassName("active-layers")[0])==null?void 0:e.clientHeight)||0)+135:(((t=document.getElementsByClassName("active-layers")[0])==null?void 0:t.clientHeight)||0)+105},immediate:!0},weatherLayers:{handler(){var a,e,t;this.bottom=(a=this.current)!=null&&a.active?(((e=document.getElementsByClassName("active-layers")[0])==null?void 0:e.clientHeight)||0)+135:(((t=document.getElementsByClassName("active-layers")[0])==null?void 0:t.clientHeight)||0)+105},immediate:!0}},methods:{handleParticle(){this.$emit("particle",{particle:!this.showParticle,key:"wind",weight:1})},handleRender(){var a,e,t,o;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.wind){const i=new Date().valueOf();let s=0,l=0,n=this.empty;if((a=this.wind)!=null&&a.active&&(n=(e=this.wind)==null?void 0:e.data),(t=this.map)!=null&&t.getSource(this.source))(o=this.map)==null||o.getSource(this.source).setData(n),l=new Date().valueOf()-(i+s),console.log("[wind] update elapsed: ",l,", total: ",s+=l);else{this.map.addSource(this.source,{type:"geojson",data:n});for(let c=0;c<(this.barbs??[]).length-1;c++){const h=(this.barbs??[])[c]||0,d=(this.barbs??[])[c+1]||0,m=h<10?`00${h}kts`:h<100?`0${h}kts`:`${h}kts`;this.map.addLayer({id:m,type:"symbol",filter:["all",[">=","spd",h],["<","spd",d]],source:this.source,layout:{"symbol-placement":"point","icon-image":m,"icon-size":.14,"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":1,"text-color":"#222"}},this.beforeLayer)}this.windBarbLoaded=!0,l=new Date().valueOf()-(i+s),console.log("[wind] add elapsed: ",l,", total: ",s+=l)}}},handleToggle(){if(!this.windBarbLoaded)this.handleRender();else for(const a of this.barbs??[]){const e=a<10?`00${a}kts`:a<100?`0${a}kts`:`${a}kts`;this.map.getLayer(e)&&this.map.setLayoutProperty(e,"visibility",this.showFeather?"visible":"none")}},handleClear(){for(const a of this.barbs??[]){const e=a<10?`00${a}kts`:a<100?`0${a}kts`:`${a}kts`;this.map.getLayer(e)&&this.map.removeLayer(e)}this.map.getSource(this.source)&&this.map.removeSource(this.source),this.windBarbLoaded=!1}}},Ge={key:0},Je={key:0,class:"iconfont active"},Xe={key:1,class:"iconfont"},qe={key:0,class:"iconfont active"},Ye={key:1,class:"iconfont"};function Qe(a,e,t,o,i,s){var l;return(l=t.wind)!=null&&l.active?(r.openBlock(),r.createElementBlock("div",Ge,[r.createElementVNode("div",{class:"flex-center tool-bars",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:i.bottom+"px"}])},[t.mapProjection==="mercator"?(r.openBlock(),r.createElementBlock("div",{key:0,class:"flex-start",onClick:e[0]||(e[0]=(...n)=>s.handleParticle&&s.handleParticle(...n))},[t.showParticle?(r.openBlock(),r.createElementBlock("i",Je,"")):(r.openBlock(),r.createElementBlock("i",Xe,"")),r.createElementVNode("span",{class:r.normalizeClass(t.showParticle?"active":"")},"Wind Particles",2)])):r.createCommentVNode("",!0),t.showParticle?(r.openBlock(),r.createElementBlock("div",{key:1,class:"flex-start",style:{"margin-left":"16px"},onClick:e[1]||(e[1]=n=>i.showFeather=!i.showFeather)},[i.showFeather?(r.openBlock(),r.createElementBlock("i",qe,"")):(r.openBlock(),r.createElementBlock("i",Ye,"")),r.createElementVNode("span",{class:r.normalizeClass(i.showFeather?"active":"")},"Wind Feather",2)])):r.createCommentVNode("",!0)],4)])):r.createCommentVNode("",!0)}const Ke=C(Ze,[["render",Qe],["__scopeId","data-v-b6fb74d9"]]);class pe{constructor(e){P(this,"map");P(this,"mercator");P(this,"rampColorLayer");P(this,"rampColorSource");P(this,"particleLayer");P(this,"particleSource");P(this,"rampColorCanvas");P(this,"particleCanvas");P(this,"ratio");this.map=e,this.mercator=new Se,this.rampColorLayer="ramp-color-layer",this.rampColorSource="ramp-color-source",this.particleLayer="particle-layer",this.particleSource="particle-source",this.rampColorCanvas=document.createElement("canvas"),this.particleCanvas=document.createElement("canvas"),this.ratio=window.devicePixelRatio}convertNLng(e,t=0){return e>180?this.convertNLng(e-360,t+1):e<-180?this.convertNLng(e+360,t+1):[e,t]}getBoundLngLat(){const e=this.map.getBounds();return[[e._sw.lng,e._ne.lat],[e._ne.lng,e._ne.lat],[e._ne.lng,e._sw.lat],[e._sw.lng,e._sw.lat]]}getBoundPixel(){const e=this.map.getBounds(),t=this.map.getZoom()+1,o=[e._ne.lng,e._ne.lat],i=[e._sw.lng,e._sw.lat],[s,l]=this.convertNLng(o[0]),[n,c]=this.convertNLng(i[0]),[h,d]=this.mercator.px([s,o[1]],t),[m,g]=this.mercator.px([n,i[1]],t),y=Math.round(this.mercator.size*Math.pow(2,t)*(l+c));return[m,g,h+y,d]}getBoundRange(){const e=this.map.getZoom()+1,t=this.mercator.size*Math.pow(2,e),o=this.getBoundPixel();return[o[0]/t,o[2]/t,o[3]/t,o[1]/t]}getWorldCopy(e,t){const o=2**t,[i,s,l,n]=e.map(d=>~~(d/(o*256))),c=[];for(let d=n;d<=s;d++)for(let m=i;m<=l;m++)c.push([m,d]);return c.map(d=>{const m=2**t*256;return[d[0]*m,d[1]*m,m]})}resize(){let e=this.map.getSource(this.rampColorSource);e.setCoordinates(this.getBoundLngLat()),e=this.map.getSource(this.particleSource),e.setCoordinates(this.getBoundLngLat()),this.rampColorCanvas.width=this.map._canvas.clientWidth,this.rampColorCanvas.height=this.map._canvas.clientHeight,this.particleCanvas.width=this.map._canvas.clientWidth,this.particleCanvas.height=this.map._canvas.clientHeight}toggle(e){const t=this.map.getLayoutProperty(this.rampColorLayer,"visibility"),o=e?"visible":"none";t!==o&&this.map.setLayoutProperty(this.rampColorLayer,"visibility",o)}toggleParticle(e){const t=this.map.getLayoutProperty(this.particleLayer,"visibility"),o=e?"visible":"none";t!==o&&this.map.setLayoutProperty(this.particleLayer,"visibility",o)}}class G{createShader(e,t,o){const i=e.createShader(t);if(i&&(e.shaderSource(i,o),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)))throw new Error(e.getShaderInfoLog(i)||"error happened while create shader...");return i}createTexture(e,t,o,i,s,l,n){const c=e.createTexture();return e.bindTexture(e.TEXTURE_2D,c),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,i),s instanceof Uint8Array?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,l,n,0,e.RGBA,e.UNSIGNED_BYTE,s):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,s),e.bindTexture(e.TEXTURE_2D,null),c}createDataBuffer(e,t,o){if(e){const i=e.createBuffer();return t==="array"?(e.bindBuffer(e.ARRAY_BUFFER,i),o&&e.bufferData(e.ARRAY_BUFFER,o,e.STATIC_DRAW)):t==="element"&&(e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,i),o&&e.bufferData(e.ELEMENT_ARRAY_BUFFER,o,e.STATIC_DRAW)),i}return null}createProgram(e,t,o){const i=e.createProgram(),s=this.createShader(e,e.VERTEX_SHADER,t),l=this.createShader(e,e.FRAGMENT_SHADER,o);if(i&&s&&l&&(e.attachShader(i,s),e.attachShader(i,l),e.linkProgram(i),!e.getProgramParameter(i,e.LINK_STATUS)))throw new Error(e.getProgramInfoLog(i)||"error happened while creating ramp color program");return i}createProgramWrapper(e,t,o){const i=this.createProgram(e,t,o);if(i){const s={program:i},l=e.getProgramParameter(i,e.ACTIVE_ATTRIBUTES);for(let c=0;c{c.addColorStop(h,d)}),n.fillStyle=c,n.fillRect(0,0,256,1),{canvas:l,texture:this.createTexture(e,e.LINEAR,e.LINEAR,e.CLAMP_TO_EDGE,o?new Uint8Array(n.getImageData(0,0,256,1).data):l,i,s)}}}setupParticle(e,t=1e3){const o=Math.ceil(Math.sqrt(t)),i=o*o,s=new Uint8Array(i*4);for(let d=0;d{const o=new Blob([e],{type:e.type}),i=URL.createObjectURL(o),s=new Image;s.crossOrigin="anonymous",s.src=i,s.onload=()=>t(s)})}}class D{}P(D,"vertexSchema",` //canvas 坐标系上的坐标 (x, y) attribute vec2 a_position; //像素坐标 attribute vec2 a_texCoord; //纹理坐标 // canvas 宽高 uniform vec2 u_resolution; //全局变量 varying vec2 v_texCoord; //向fragmentSchema传值 void main() { // 将屏幕坐标系转化为裁剪坐标(裁剪坐标系) convert the position from pixels to 0.0 to 1.0 vec2 position = (a_position / u_resolution) * 2.0 - 1.0; // canvas的 Y 轴坐标方向和 设备坐标系的相反 gl_Position = vec4(position * vec2(1, -1), 0.0, 1.0); v_texCoord = a_texCoord; }`),P(D,"uvFragmentSchema",` precision mediump float; uniform sampler2D u_image; uniform vec2 u_range_u_v; uniform vec2 u_range_s; uniform sampler2D u_color; varying vec2 v_texCoord; void main() { vec4 uv = texture2D(u_image, v_texCoord); float u = uv.r * (u_range_u_v.y - u_range_u_v.x) + u_range_u_v.x; float v = uv.g * (u_range_u_v.y - u_range_u_v.x) + u_range_u_v.x; float s = sqrt(u * u + v * v); float r = (s - u_range_s.x) / (u_range_s.y - u_range_s.x); float f = 1.0 - uv.b; vec4 color = texture2D(u_color, vec2(r, 0.5)) * f; gl_FragColor = color; }`),P(D,"fragmentSchema",` precision mediump float; uniform sampler2D u_image; // 灰度 uniform sampler2D u_color; // 色值映射 varying vec2 v_texCoord;// 坐标 void main() { vec4 rgba = texture2D(u_image, v_texCoord); vec4 color = texture2D(u_color, vec2(rgba.r, 0)); gl_FragColor = color; }`);class R{}P(R,"vertexSchema",` precision mediump float; attribute float a_index; // 索引 uniform sampler2D u_particles; // 粒子纹理 uniform float u_particles_resolution; // Math.ceil(Math.sqrt(numParticles))) uniform float u_point; uniform vec4 u_viewport; varying vec2 v_particle_pos_uv; void main() { vec4 color = texture2D(u_particles, vec2( fract(a_index / u_particles_resolution), floor(a_index / u_particles_resolution) / u_particles_resolution)); vec2 v_particle_pos = vec2(color.r / 255.0 + color.b, color.g / 255.0 + color.a); v_particle_pos_uv = vec2(fract(v_particle_pos.x * (u_viewport.y - u_viewport.x) + u_viewport.x), v_particle_pos.y * (u_viewport.w - u_viewport.z) + u_viewport.z); gl_PointSize = 1.0; // gl_PointSize = u_point; gl_Position = vec4(2.0 * v_particle_pos.x - 1.0, 1.0 - 2.0 * v_particle_pos.y, 0, 1); }`),P(R,"fragmentSchema",` precision mediump float; uniform sampler2D u_factor; uniform vec2 u_factor_min; uniform vec2 u_factor_max; uniform sampler2D u_color_ramp; varying vec2 v_particle_pos_uv; void main() { vec4 uv = texture2D(u_factor, v_particle_pos_uv); vec2 velocity = mix(u_factor_min, u_factor_max, uv.rg); float speed_t = length(velocity) / length(u_factor_max); // color ramp is encoded in a 16x16 texture vec2 ramp_pos = vec2( fract(16.0 * speed_t), floor(16.0 * speed_t) / 16.0); float f = 1.0 - uv.b; gl_FragColor = texture2D(u_color_ramp, ramp_pos) * f; }`),P(R,"quadVertSchema",` precision mediump float; attribute vec2 a_pos; varying vec2 v_tex_pos; void main() { v_tex_pos = a_pos; gl_Position = vec4(1.0 - 2.0 * a_pos, 0, 1); }`),P(R,"screenFragmentSchema",` precision mediump float; uniform sampler2D u_screen; uniform float u_opacity; varying vec2 v_tex_pos; void main() { vec4 color = texture2D(u_screen, 1.0 - v_tex_pos); // a hack to guarantee opacity fade out even with a value close to 1.0 gl_FragColor = vec4(floor(255.0 * color * u_opacity) / 255.0); }`),P(R,"updateFragmentSchema",` precision mediump float; uniform sampler2D u_particles; uniform sampler2D u_factor; uniform vec2 u_factor_res; uniform vec2 u_factor_min; uniform vec2 u_factor_max; uniform float u_rand_seed; uniform float u_speed_factor; uniform float u_drop_rate; uniform float u_drop_rate_bump; uniform vec4 u_viewport; varying vec2 v_tex_pos; // pseudo-random generator const vec3 rand_constants = vec3(989.6543, 43.456, 287.6543); float rand(const vec2 co) { float t = dot(rand_constants.xy, co); return fract(sin(t) * (rand_constants.z + t)); } // factor speed lookup; use manual bilinear filtering based on 4 adjacent pixels for smooth interpolation vec2 lookup_factor(const vec2 uv) { vec2 px = 1.0 / u_factor_res; vec2 vc = (floor(uv * u_factor_res)) * px; vec2 f = fract(uv * u_factor_res); vec2 tl = texture2D(u_factor, vc).rg; vec2 tr = texture2D(u_factor, vc + vec2(px.x, 0)).rg; vec2 bl = texture2D(u_factor, vc + vec2(0, px.y)).rg; vec2 br = texture2D(u_factor, vc + px).rg; return mix(mix(tl, tr, f.x), mix(bl, br, f.x), f.y); } void main() { vec4 color = texture2D(u_particles, v_tex_pos); // decode particle position from pixel RGBA vec2 pos = vec2( color.r / 255.0 + color.b, color.g / 255.0 + color.a); vec2 pos_uv = vec2( fract(pos.x * (u_viewport.y - u_viewport.x) + u_viewport.x), pos.y * (u_viewport.w - u_viewport.z) + u_viewport.z); vec2 velocity = mix(u_factor_min, u_factor_max, lookup_factor(pos_uv)); float speed_t = length(velocity) / length(u_factor_max); float b = texture2D(u_factor, pos_uv).b; float p = (b / -1.0) + 1.0; velocity = velocity * p; speed_t = speed_t * p; // take EPSG:4236 distortion into account for calculating where the particle moved float distortion = cos(radians(pos.y * 180.0 - 90.0)); // float distortion = cos(radians(pos.y * 180.0 - 90.0)); vec2 offset = vec2(velocity.x, -velocity.y) * 0.0001 * u_speed_factor; // update particle position, wrapping around the date line pos = fract(1.0 + pos + offset); // a random seed to use for the particle drop vec2 seed = (pos + v_tex_pos) * u_rand_seed; // drop rate is a chance a particle will restart at random position, to avoid degeneration float drop_rate = u_drop_rate + speed_t * u_drop_rate_bump; float drop = step(1.0 - drop_rate, rand(seed)); vec2 random_pos = vec2( rand(seed + 1.3), rand(seed + 2.1)); pos = mix(pos, random_pos, drop); // 将新的粒子位置编码回RGBA gl_FragColor = vec4( fract(pos * 255.0), floor(pos * 255.0) / 255.0); }`);class ge{constructor(e="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNseTVudHJzYzAwNWUwbHBsZHkyaDRqczMiLCJyb2xlIjoxLCJuYW1lIjoiZmFrZUBvcm13eC5jb20iLCJwbGF0SWQiOiJnZDBtdDFkIiwiY29tcGFueSI6eyJpZCI6bnVsbCwiY2hpbGRyZW4iOltdfSwiaWF0IjoxNzIzMDI0MDI0LCJleHAiOjM5MzA1NDQwMjR9.RrKcdcMnq-FxBLJQ-i6lx2FscDE46y8EvHIemPW4HTg"){P(this,"token");P(this,"mapboxCustomer");P(this,"i4");P(this,"hi");P(this,"td");P(this,"windy");this.token=e,this.mapboxCustomer={source:this.initialOnlineStyle().sources.composite,layers:{water:{id:"water",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},paint:{"fill-color":"hsl(205, 75%, 70%)"}},waterDeplth:{id:"water-depth",type:"fill",source:"composite","source-layer":"depth",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},maxzoom:8,paint:{"fill-antialias":!1,"fill-color":["interpolate",["linear"],["zoom"],6,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0.35)",200,"hsla(205, 75%, 63%, 0.35)",7e3,"hsla(205, 75%, 56%, 0.35)"],8,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0)",200,"hsla(205, 75%, 63%, 0)",7e3,"hsla(205, 75%, 53%, 0)"]]}},countryBoundary:{id:"country-boundaries",type:"fill",source:"composite","source-layer":"country_boundaries",layout:{visibility:"visible"},paint:{"fill-color":"#d9d8d8"}},countryAdmin0BoundaryBg:{id:"admin-0-boundary-bg",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-width":["interpolate",["linear"],["zoom"],3,4,12,8],"line-color":"rgb(193, 190, 190)","line-opacity":["interpolate",["linear"],["zoom"],3,0,4,.5],"line-blur":["interpolate",["linear"],["zoom"],3,0,12,2]}},countryAdmin0Boundary:{id:"admin-0-boundary",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","disputed"],"false"],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(114, 110, 111)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[2,0]],7,["literal",[2,2,6,2]]]}},countryAdmin0BoundaryDisputed:{id:"admin-0-boundary-disputed",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","disputed"],"true"],["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(95, 93, 94)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[3,2,5]],7,["literal",[2,1.5]]]}},countryLabel:{id:"country-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},layout:{visibility:"visible","text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["HelveticaNeueThin"],"text-radial-offset":["step",["zoom"],.6,8,0],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],7,"auto"],"text-size":["interpolate",["cubic-bezier",.2,0,.7,1],["zoom"],1,["step",["get","symbolrank"],11,4,9,5,8],9,["step",["get","symbolrank"],22,4,19,5,17]]},paint:{"text-color":"rgba(255,255,255,0)"}}}},this.td={source:{type:"raster",tiles:["https://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t1.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t2.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t3.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t4.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t5.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t6.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t7.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8"],tileSize:256},layer:{id:"td",type:"raster",source:"td",layout:{visibility:"visible"}}},this.i4={source:{type:"raster",tiles:["https://osshz.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz1.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz2.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz3.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz4.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz5.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz6.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz7.idmwx.com/nautical/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"i4",type:"raster",source:"i4",layout:{visibility:"none"}}},this.hi={source:{type:"raster",tiles:[`https://assist0.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist1.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist2.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist3.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist4.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist5.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist6.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist7.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`],tileSize:256},layer:{id:"hi",type:"raster",source:"hi",layout:{visibility:"none"}}},this.windy={darkmap:{source:{type:"raster",tiles:["https://tiles.windy.com/tiles/v10.0/darkmap/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"darkmap",type:"raster",source:"darkmap",layout:{visibility:"none"}}},grayland:{source:{type:"raster",tiles:["https://tiles.windy.com/tiles/v9.0/grayland/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"grayland",type:"raster",source:"grayland",layout:{visibility:"none"},paint:{"raster-opacity":1}}}}}initialOnlineStyle(){return{version:8,name:"map-weather-v2.0.0",metadata:{"mapbox:print":{width:8.5,height:11,units:"in",format:"png",resolution:300},"mapbox:type":"default","mapbox:trackposition":!0,"mapbox:autocomposite":!0,"mapbox:sdk-support":{android:"11.0.0",ios:"11.0.0",js:"3.0.0"},"mapbox:origin":"outdoors-v12","mapbox:groups":{"Terrain, terrain-labels":{name:"Terrain, terrain-labels",collapsed:!0},"Administrative boundaries, admin":{name:"Administrative boundaries, admin",collapsed:!1},"Land & water, built":{name:"Land & water, built",collapsed:!1},"Terrain, surface":{name:"Terrain, surface",collapsed:!0},"Land & water, land":{name:"Land & water, land",collapsed:!1},"Natural features, natural-labels":{name:"Natural features, natural-labels",collapsed:!0},"Walking, cycling, etc., barriers-bridges":{name:"Walking, cycling, etc., barriers-bridges",collapsed:!0},"Place labels, place-labels":{name:"Place labels, place-labels",collapsed:!1},"Transit, ferries":{name:"Transit, ferries",collapsed:!0},"Transit, elevated":{name:"Transit, elevated",collapsed:!0},"Walking, cycling, etc., tunnels":{name:"Walking, cycling, etc., tunnels",collapsed:!0},"Terrain, land":{name:"Terrain, land",collapsed:!0},"Road network, tunnels-case":{name:"Road network, tunnels-case",collapsed:!0},"Walking, cycling, etc., walking-cycling-labels":{name:"Walking, cycling, etc., walking-cycling-labels",collapsed:!0},"Walking, cycling, etc., surface":{name:"Walking, cycling, etc., surface",collapsed:!0},"Road network, surface-icons":{name:"Road network, surface-icons",collapsed:!0},"Land & water, water":{name:"Land & water, water",collapsed:!1}}},lights:[],fog:{color:"#ffffff",range:[.5,10],"high-color":"#245cdf","space-color":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"horizon-blend":["interpolate",["linear"],["zoom"],4,.2,7,.1],"star-intensity":["interpolate",["linear"],["zoom"],5,.35,6,0],"vertical-range":[0,0]},center:[80.02170408691855,17.83215724225399],zoom:2.4589703839156347,bearing:0,pitch:1,sprite:"mapbox://sprites/neatchenheng/clxwst0tq00wd01rn0usb2eer/3hcvufdre7i2yn9nbkvi9f9xi",glyphs:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",projection:{name:"equirectangular"},sources:{composite:{type:"vector",url:"mapbox://mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1",data:{attribution:'© Mapbox © OpenStreetMap © Mapbox © OpenStreetMap Improve this map',bounds:[-180,-85.051129,180,85],center:[0,-.025564500000001544,0],description:"Global polygon tileset of country boundaries and disputed areas",format:"pbf",language_options:{ar:"Arabic",ca:"Catalan",cs:"Czech",da:"Danish",de:"German",el:"Greek",en:"English",es:"Spanish",fa:"Farsi",fi:"Finnish",fr:"French",he:"Hebrew",hu:"Hungarian",id:"Indonesian",it:"Italian",ja:"Japanese",ka:"Georgian",ko:"Korean",local:"Renderable local language",lv:"Latvian",ms:"Malay",nb:"Norwegian Bokmål",nl:"Dutch",no:"Norwegian",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sk:"Slovak",sl:"Slovenian",sr:"Serbian",sv:"Swedish",th:"Thai",tl:"Tagalog",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese","zh-Hans":"Simplified Chinese","zh-Hant":"Traditional Chinese"},mapbox_logo:!0,maskLevel:9,maxzoom:16,minzoom:0,mts:!0,name:"Mapbox Countries v1 + Mapbox Bathymetry v2 + Mapbox Terrain v2 + Mapbox Streets v8",scheme:"xyz",tilejson:"2.2.0",tiles:["https://a.tiles.mapbox.com/v4/mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1IjoibmVhdGNoZW5oZW5nIiwiYSI6ImNsdXM3cnBmODBsemgycW1vaXc1bjV6bXMifQ.w6fqHGRbhNhLvm0LnX4ZVw","https://b.tiles.mapbox.com/v4/mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1IjoibmVhdGNoZW5oZW5nIiwiYSI6ImNsdXM3cnBmODBsemgycW1vaXc1bjV6bXMifQ.w6fqHGRbhNhLvm0LnX4ZVw"],vector_layers:[{id:"landuse",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"waterway",minzoom:7,source:"mapbox.mapbox-streets-v8"},{id:"water",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"aeroway",minzoom:9,source:"mapbox.mapbox-streets-v8"},{id:"structure",minzoom:13,source:"mapbox.mapbox-streets-v8"},{id:"building",minzoom:12,source:"mapbox.mapbox-streets-v8"},{id:"landuse_overlay",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"road",minzoom:3,source:"mapbox.mapbox-streets-v8"},{id:"admin",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"place_label",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"airport_label",minzoom:8,source:"mapbox.mapbox-streets-v8"},{id:"transit_stop_label",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"natural_label",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"poi_label",minzoom:6,source:"mapbox.mapbox-streets-v8"},{id:"motorway_junction",minzoom:9,source:"mapbox.mapbox-streets-v8"},{id:"housenum_label",minzoom:16,source:"mapbox.mapbox-streets-v8"},{id:"landcover",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"hillshade",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"contour",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"depth",maxzoom:7,minzoom:0,source:"mapbox.mapbox-bathymetry-v2"},{id:"country_boundaries",maxzoom:22,minzoom:0,source:"mapbox.country-boundaries-v1"}],worldview_default:"US",worldview_options:{AR:"Argentina",CN:"China",IN:"India",JP:"Japan",MA:"Morocco",RS:"Serbia",RU:"Russia",TR:"Turkey",US:"United States"}}}},layers:[{id:"land",type:"background",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},paint:{"background-color":"rgb(171, 174, 172)"}},{id:"landcover",type:"fill",source:"composite","source-layer":"landcover",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},maxzoom:12,paint:{"fill-color":["match",["get","class"],"wood","hsl(0, 0%, 69%)","scrub","hsl(0, 0%, 69%)","crop","hsl(0, 0%, 69%)","grass","hsl(0, 0%, 69%)","snow","hsl(0, 0%, 69%)","hsl(0, 0%, 69%)"],"fill-opacity":["interpolate",["exponential",1.5],["zoom"],8,.8,12,0],"fill-antialias":!1}},{id:"national-park",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:5,filter:["==",["get","class"],"national_park"],paint:{"fill-color":"hsl(98, 38%, 68%)","fill-opacity":["interpolate",["linear"],["zoom"],5,0,6,.6,12,.2]}},{id:"national-park_tint-band",type:"line",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:9,filter:["==",["get","class"],"national_park"],paint:{"line-color":"hsl(98, 38%, 68%)","line-width":["interpolate",["exponential",1.5],["zoom"],9,1,14,8],"line-blur":["interpolate",["exponential",1.5],["zoom"],9,1,14,8]}},{id:"landuse",type:"fill",source:"composite","source-layer":"landuse",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:5,filter:["all",[">=",["to-number",["get","sizerank"]],0],["match",["get","class"],["agriculture","wood","grass","scrub","glacier","pitch","sand"],["step",["zoom"],!1,11,!0],"residential",["step",["zoom"],!0,10,!1],["park","airport"],["step",["zoom"],!1,8,["case",["==",["get","sizerank"],1],!0,!1],10,!0],["facility","industrial"],["step",["zoom"],!1,12,!0],"rock",["step",["zoom"],!1,11,!0],"cemetery",["step",["zoom"],!1,11,!0],"school",["step",["zoom"],!1,11,!0],"hospital",["step",["zoom"],!1,11,!0],"commercial_area",["step",["zoom"],!1,11,!0],!1],["<=",["-",["to-number",["get","sizerank"]],["interpolate",["exponential",1.5],["zoom"],12,0,18,14]],14]],paint:{"fill-color":["interpolate",["linear"],["zoom"],15,["match",["get","class"],"wood","hsla(103, 50%, 60%, 0.8)","scrub","hsla(98, 47%, 68%, 0.6)","agriculture","hsla(98, 50%, 74%, 0.6)","park",["match",["get","type"],["garden","playground","zoo"],"hsl(98, 38%, 68%)","hsl(98, 55%, 70%)"],"grass","hsla(98, 50%, 74%, 0.6)","airport","hsl(230, 40%, 82%)","cemetery","hsl(98, 45%, 75%)","glacier","hsl(205, 45%, 95%)","hospital","hsl(20, 45%, 82%)","pitch","hsl(88, 65%, 75%)","sand","hsl(69, 60%, 72%)","rock","hsl(60, 0%, 85%)","school","hsl(40, 45%, 78%)","commercial_area","hsl(55, 45%, 85%)","residential","hsl(60, 7%, 87%)",["facility","industrial"],"hsl(230, 20%, 85%)","hsl(60, 12%, 72%)"],16,["match",["get","class"],"wood","hsla(103, 50%, 60%, 0.8)","scrub","hsla(98, 47%, 68%, 0.6)","agriculture","hsla(98, 50%, 74%, 0.6)","park",["match",["get","type"],["garden","playground","zoo"],"hsl(98, 38%, 68%)","hsl(98, 55%, 70%)"],"grass","hsla(98, 50%, 74%, 0.6)","airport","hsl(230, 40%, 82%)","cemetery","hsl(98, 45%, 75%)","glacier","hsl(205, 45%, 95%)","hospital","hsl(20, 45%, 82%)","pitch","hsl(88, 65%, 75%)","sand","hsl(69, 60%, 72%)","rock","hsla(60, 0%, 85%, 0.5)","school","hsl(40, 45%, 78%)","commercial_area","hsla(55, 45%, 85%, 0.5)",["facility","industrial"],"hsl(230, 20%, 85%)","hsl(60, 12%, 72%)"]],"fill-opacity":["interpolate",["linear"],["zoom"],8,["match",["get","class"],"residential",.8,.2],10,["match",["get","class"],"residential",0,1]],"fill-antialias":!1}},{id:"pitch-outline",type:"line",source:"composite","source-layer":"landuse",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:15,filter:["==",["get","class"],"pitch"],paint:{"line-color":"hsl(0, 0%, 69%)"}},{id:"waterway-shadow",type:"line",source:"composite","source-layer":"waterway",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:10,layout:{"line-cap":["step",["zoom"],"butt",11,"round"],"line-join":["step",["zoom"],"miter",11,"round"]},paint:{"line-color":"hsl(224, 79%, 69%)","line-width":["interpolate",["exponential",1.3],["zoom"],9,["match",["get","class"],["canal","river"],.1,0],20,["match",["get","class"],["canal","river"],8,3]],"line-translate":["interpolate",["exponential",1.2],["zoom"],7,["literal",[0,0]],16,["literal",[-1,-1]]],"line-translate-anchor":"viewport","line-opacity":["interpolate",["linear"],["zoom"],8,0,8.5,1]}},{id:"water-shadow",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:10,paint:{"fill-color":"hsl(224, 79%, 69%)","fill-translate":["interpolate",["exponential",1.2],["zoom"],7,["literal",[0,0]],16,["literal",[-1,-1]]],"fill-translate-anchor":"viewport"}},{id:"waterway",type:"line",source:"composite","source-layer":"waterway",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:8,layout:{"line-cap":["step",["zoom"],"butt",11,"round"],"line-join":["step",["zoom"],"miter",11,"round"]},paint:{"line-color":"hsl(205, 75%, 70%)","line-width":["interpolate",["exponential",1.3],["zoom"],9,["match",["get","class"],["canal","river"],.1,0],20,["match",["get","class"],["canal","river"],8,3]],"line-opacity":["interpolate",["linear"],["zoom"],8,0,8.5,1]}},{id:"water",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},paint:{"fill-color":"hsl(205, 75%, 70%)"}},{id:"water-depth",type:"fill",source:"composite","source-layer":"depth",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},maxzoom:8,paint:{"fill-antialias":!1,"fill-color":["interpolate",["linear"],["zoom"],6,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0.35)",200,"hsla(205, 75%, 63%, 0.35)",7e3,"hsla(205, 75%, 56%, 0.35)"],8,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0)",200,"hsla(205, 75%, 63%, 0)",7e3,"hsla(205, 75%, 53%, 0)"]]}},{id:"wetland",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:5,filter:["match",["get","class"],["wetland","wetland_noveg"],!0,!1],paint:{"fill-color":"hsl(194, 38%, 74%)","fill-opacity":["interpolate",["linear"],["zoom"],10,.25,10.5,.15]}},{id:"wetland-pattern",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:5,filter:["match",["get","class"],["wetland","wetland_noveg"],!0,!1],paint:{"fill-color":"hsl(194, 38%, 74%)","fill-opacity":["interpolate",["linear"],["zoom"],10,0,10.5,1],"fill-pattern":"wetland","fill-translate-anchor":"viewport"}},{id:"land-structure-polygon",type:"fill",source:"composite","source-layer":"structure",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, built"},minzoom:13,filter:["all",["==",["get","class"],"land"],["==",["geometry-type"],"Polygon"]],paint:{"fill-color":"hsl(0, 0%, 69%)"}},{id:"land-structure-line",type:"line",source:"composite","source-layer":"structure",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, built"},minzoom:13,filter:["all",["==",["get","class"],"land"],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"square"},paint:{"line-width":["interpolate",["exponential",1.99],["zoom"],14,.75,20,40],"line-color":"hsl(60, 20%, 85%)"}},{id:"country-boundaries",type:"fill",source:"composite","source-layer":"country_boundaries",paint:{"fill-color":["interpolate",["linear"],["zoom"],0,"rgb(171, 174, 172)",22,"rgb(171, 174, 172)"]}},{id:"admin-0-boundary-bg",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-width":["interpolate",["linear"],["zoom"],3,4,12,8],"line-color":"rgb(193, 190, 190)","line-opacity":["interpolate",["linear"],["zoom"],3,0,4,.5],"line-blur":["interpolate",["linear"],["zoom"],3,0,12,2]}},{id:"admin-0-boundary",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","disputed"],"false"],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(114, 110, 111)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[2,0]],7,["literal",[2,2,6,2]]]}},{id:"admin-0-boundary-disputed",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","disputed"],"true"],["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(95, 93, 94)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[3,2,5]],7,["literal",[2,1.5]]]}},{id:"waterway-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:13,filter:["all",["match",["get","class"],["canal","river","stream","disputed_canal","disputed_river","disputed_stream"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"text-max-angle":30,"symbol-spacing":["interpolate",["linear",1],["zoom"],15,250,17,400],"text-size":["interpolate",["linear"],["zoom"],13,12,18,18],"symbol-placement":"line","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"text-color":"hsl(205, 43%, 90%)","text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"natural-line-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:4,filter:["all",["match",["get","class"],["glacier","landform","disputed_glacier","disputed_landform"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],4],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-max-angle":30,"text-field":["coalesce",["get","name_en"],["get","name"]],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport",visibility:"none"},paint:{"text-halo-width":.5,"text-halo-color":"hsl(60, 17%, 84%)","text-halo-blur":.5,"text-color":"hsl(340, 10%, 38%)"}},{id:"natural-point-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:4,filter:["all",["match",["get","class"],["dock","glacier","landform","water_feature","wetland","disputed_dock","disputed_glacier","disputed_landform","disputed_water_feature","disputed_wetland"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],4],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"Point"]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"icon-image":["case",["has","maki_beta"],["coalesce",["image",["get","maki_beta"]],["image",["get","maki"]]],["image",["get","maki"]]],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-offset":["step",["zoom"],["step",["get","sizerank"],["literal",[0,0]],5,["literal",[0,.8]]],17,["step",["get","sizerank"],["literal",[0,0]],13,["literal",[0,.8]]]],"text-anchor":["step",["zoom"],["step",["get","sizerank"],"center",5,"top"],17,["step",["get","sizerank"],"center",13,"top"]],"text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"icon-opacity":["step",["zoom"],["step",["get","sizerank"],0,5,1],17,["step",["get","sizerank"],0,13,1]],"text-halo-color":"hsl(60, 20%, 98%)","text-halo-width":.5,"text-halo-blur":.5,"text-color":"hsl(340, 10%, 38%)"}},{id:"water-line-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:1,filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water","disputed_bay","disputed_ocean","disputed_reservoir","disputed_sea","disputed_water"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-size":["interpolate",["linear"],["zoom"],0,["*",["-",16,["sqrt",["get","sizerank"]]],1],22,["*",["-",22,["sqrt",["get","sizerank"]]],1]],"text-max-angle":30,"text-letter-spacing":["match",["get","class"],"ocean",.25,["sea","bay"],.15,0],"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"text-color":["match",["get","class"],["bay","ocean","sea"],"hsl(205, 71%, 90%)","hsl(205, 43%, 90%)"],"text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"water-point-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:1,filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water","disputed_bay","disputed_ocean","disputed_reservoir","disputed_sea","disputed_water"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"Point"]],layout:{"text-line-height":1.3,"text-size":["interpolate",["linear"],["zoom"],0,["*",["-",16,["sqrt",["get","sizerank"]]],1],22,["*",["-",22,["sqrt",["get","sizerank"]]],1]],"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":["match",["get","class"],"ocean",.25,["bay","sea"],.15,.01],"text-max-width":["match",["get","class"],"ocean",4,"sea",5,["bay","water"],7,10],visibility:"none"},paint:{"text-color":["match",["get","class"],["bay","ocean","sea"],"hsl(205, 71%, 90%)","hsl(205, 43%, 90%)"],"text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"settlement-subdivision-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:10,maxzoom:15,filter:["all",["match",["get","class"],["settlement_subdivision","disputed_settlement_subdivision"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],3],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-transform":"uppercase","text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-letter-spacing":["match",["get","type"],"suburb",.15,.05],"text-max-width":7,"text-padding":3,"text-size":["interpolate",["cubic-bezier",.5,0,1,1],["zoom"],11,["match",["get","type"],"suburb",11,10.5],15,["match",["get","type"],"suburb",15,14]],visibility:"none"},paint:{"text-halo-color":"hsla(60, 25%, 100%, 0.75)","text-halo-width":1,"text-color":"hsl(230, 29%, 36%)","text-halo-blur":.5}},{id:"settlement-minor-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:2,maxzoom:13,filter:["all",["<=",["get","filterrank"],3],["match",["get","class"],["settlement","disputed_settlement"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["zoom"],[">",["get","symbolrank"],6],4,[">=",["get","symbolrank"],7],6,[">=",["get","symbolrank"],8],7,[">=",["get","symbolrank"],10],10,[">=",["get","symbolrank"],11],11,[">=",["get","symbolrank"],13],12,[">=",["get","symbolrank"],15]],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],11,9,10],6,["step",["get","symbolrank"],14,9,12,12,10],8,["step",["get","symbolrank"],16,9,14,12,12,15,10],13,["step",["get","symbolrank"],22,9,20,12,16,15,14]],"text-radial-offset":["step",["zoom"],["match",["get","capital"],2,.6,.55],8,0],"symbol-sort-key":["get","symbolrank"],"icon-image":["step",["zoom"],["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],8,""],"text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-justify":"auto",visibility:"none","text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-max-width":7},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-halo-blur":1}},{id:"settlement-major-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:2,maxzoom:15,filter:["all",["<=",["get","filterrank"],3],["match",["get","class"],["settlement","disputed_settlement"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["zoom"],!1,2,["<=",["get","symbolrank"],6],4,["<",["get","symbolrank"],7],6,["<",["get","symbolrank"],8],7,["<",["get","symbolrank"],10],10,["<",["get","symbolrank"],11],11,["<",["get","symbolrank"],13],12,["<",["get","symbolrank"],15],13,[">=",["get","symbolrank"],11],14,[">=",["get","symbolrank"],15]],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],13,6,11],6,["step",["get","symbolrank"],18,6,16,7,14],8,["step",["get","symbolrank"],20,9,16,10,14],15,["step",["get","symbolrank"],24,9,20,12,16,15,14]],"text-radial-offset":["step",["zoom"],["match",["get","capital"],2,.6,.55],8,0],"symbol-sort-key":["get","symbolrank"],"icon-image":["step",["zoom"],["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],8,""],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],visibility:"none","text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-max-width":7},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-halo-blur":1}},{id:"state-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:3,maxzoom:9,filter:["all",["match",["get","class"],["state","disputed_state"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-size":["interpolate",["cubic-bezier",.85,.7,.65,1],["zoom"],4,["step",["get","symbolrank"],9,6,8,7,7],9,["step",["get","symbolrank"],21,6,16,7,14]],"text-transform":"uppercase","text-font":["DIN Pro Bold","Arial Unicode MS Bold"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":.15,"text-max-width":6,visibility:"none"},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-opacity":.5}},{id:"country-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:1,maxzoom:10,filter:["all",["match",["get","class"],["country","disputed_country"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-radial-offset":["step",["zoom"],.6,8,0],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],7,"auto"],"text-size":["interpolate",["cubic-bezier",.2,0,.7,1],["zoom"],1,["step",["get","symbolrank"],11,4,9,5,8],9,["step",["get","symbolrank"],22,4,19,5,17]]},paint:{"icon-opacity":["step",["zoom"],["case",["has","text_anchor"],1,0],7,0],"text-color":"hsl(230, 29%, 0%)","text-halo-color":["interpolate",["linear"],["zoom"],2,"hsla(60, 25%, 100%, 0.75)",3,"hsl(60, 25%, 100%)"],"text-halo-width":1.25}},{id:"continent-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:.75,maxzoom:3,filter:["==",["get","class"],"continent"],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-size":["interpolate",["exponential",.5],["zoom"],0,10,2.5,15],"text-transform":"uppercase","text-letter-spacing":.05,visibility:"none"},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":["interpolate",["linear"],["zoom"],0,"hsla(60, 25%, 100%, 0.75)",3,"hsl(60, 25%, 100%)"],"text-halo-width":1.5,"text-opacity":["interpolate",["linear"],["zoom"],0,.8,1.5,.5,2.5,0]}}]}}}const Vr="",et={name:"IdmWindParticle",props:{factor:{type:Object},viewport:{type:pe},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new G,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleOptions:{fadeOpacity:.9,speedFactor:.25,dropRate:.003,dropRateBump:.01,uvRange:[-25,26],sRange:[0,31.985]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a,e;this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[wind-particle] add elapsed: ",t,", total: ",e+=t)}},handleClear(){var a,e,t,o,i,s,l,n;(a=this.viewport)==null||a.toggle(!1),(e=this.viewport)==null||e.toggleParticle(!1),this.context=void 0,this.particleContext=void 0,this.etime=void 0,this.initial=!0,(o=(t=this.viewport)==null?void 0:t.map)==null||o.off("resize",this.handleResize),(s=(i=this.viewport)==null?void 0:i.map)==null||s.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay),this.handlePause()},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgb(98, 113, 184, 0.8)"],[12/255,"rgb(98, 113, 184)"],[24/255,"rgb(61, 110, 163)"],[32/255,"rgb(74, 146, 148)"],[40/255,"rgb(77, 142, 124)"],[60/255,"rgb(76, 164, 76)"],[80/255,"rgb(103, 164, 54)"],[100/255,"rgb(162, 135, 64)"],[120/255,"rgb(162, 109, 92)"],[140/255,"rgb(141, 63, 92)"],[160/255,"rgb(151, 75, 145)"],[200/255,"rgb(95, 100, 160)"],[240/255,"rgb(91, 136, 161)"],[1,"rgb(91, 136, 161)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,D.vertexSchema,D.uvFragmentSchema);this.program=e,this.aPositionBuffer=t}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const a=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,R.vertexSchema,R.fragmentSchema,R.quadVertSchema,R.screenFragmentSchema,R.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,a,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,9e3),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,a),this.wrapper.image=a}this.initial&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext)}},handlePause(){this.paused=!0,this.animation&&(cancelAnimationFrame(this.animation),this.viewport.toggleParticle(!1))},handlePlay(){this.paused=!1,this.animation=requestAnimationFrame(()=>{this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay()})}}},tt={key:0};function at(a,e,t,o,i,s){var l;return(l=t.factor)!=null&&l.active?(r.openBlock(),r.createElementBlock("div",tt,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"kts",-1),r.createElementVNode("span",null,"0",-1),r.createElementVNode("span",null,"5",-1),r.createElementVNode("span",null,"10",-1),r.createElementVNode("span",null,"20",-1),r.createElementVNode("span",null,"30",-1),r.createElementVNode("span",null,"40",-1),r.createElementVNode("span",null,"60",-1)]),4)])):r.createCommentVNode("",!0)}const rt=C(et,[["render",at],["__scopeId","data-v-41a686d0"]]),Rr="",it={name:"IdmCurrent",props:{map:{type:Object},current:{type:Object},beforeLayer:{type:String},mapProjection:{type:String},showParticle:{type:Boolean,default:!1},marginBottom:{type:String,default:"30px"},toggleVersion:{type:Number},weatherLayers:{type:Object}},emits:["particle"],data(){return{source:"current-source",directionLayer:"current-direction-layer",speedLayer:"current-speed-layer",speedLabelLayer:"current-speed-label-layer",empty:x.featureCollection([]),showJson:!1,right:10,bottom:95}},watch:{"current.version":{handler(){var a;(a=this.current)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},showParticle:{handler(){this.showJson=!this.showParticle},immediate:!0},showJson:{handler(){this.handleToggle()},immediate:!0},toggleVersion:{handler(){var a,e;this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0},weatherLayers:{handler(){var a;this.bottom=(((a=document.getElementsByClassName("active-layers")[0])==null?void 0:a.clientHeight)||0)+105},immediate:!0}},methods:{handleParticle(){this.$emit("particle",{particle:!this.showParticle,key:"current",weight:96})},handleRender(){var a,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.current){const t=new Date().valueOf();let o=0,i=0,s=this.empty;this.current.active&&(s=this.current.data),(a=this.map)!=null&&a.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),i=new Date().valueOf()-(t+o),console.log("[current] update elapsed: ",i,", total: ",o+=i)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.speedLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":["step",["get","val"],"#e1ffb3",1,"#ffff00",3,"#ff9500",4,"#f44336",5,"#f44336"]}},this.beforeLayer),this.map.addLayer({id:this.speedLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Polygon"],layout:{"symbol-placement":"line","text-field":"{val} kts","text-allow-overlap":!0,"text-rotation-alignment":"viewport","text-size":12},paint:{"text-color":"rgba(0, 0, 0, 0.8)"}},this.beforeLayer),this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"arrow-red","icon-size":["interpolate",["linear"],["get","spd"],.5,.14,3,.28],"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":.6}},this.beforeLayer),i=new Date().valueOf()-(t+o),console.log("[current] add elapsed: ",i,", total: ",o+=i)),this.handleToggle()}},handleToggle(){this.map.getLayer(this.speedLayer)&&this.map.setLayoutProperty(this.speedLayer,"visibility",this.showJson?"visible":"none"),this.map.getLayer(this.speedLabelLayer)&&this.map.setLayoutProperty(this.speedLabelLayer,"visibility",this.showJson?"visible":"none"),this.map.getLayer(this.directionLayer)&&this.map.setLayoutProperty(this.directionLayer,"visibility",this.showJson?"visible":"none")},handleClear(){this.map.getLayer(this.speedLayer)&&this.map.removeLayer(this.speedLayer),this.map.getLayer(this.speedLabelLayer)&&this.map.removeLayer(this.speedLabelLayer),this.map.getLayer(this.directionLayer)&&this.map.removeLayer(this.directionLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},ot={key:0},st={key:0,class:"iconfont active"},nt={key:1,class:"iconfont"},lt={key:0,class:"iconfont active"},ct={key:1,class:"iconfont"};function ht(a,e,t,o,i,s){var l;return(l=t.current)!=null&&l.active?(r.openBlock(),r.createElementBlock("div",ot,[r.createElementVNode("div",{class:"flex-center tool-bars",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:i.bottom+"px"}])},[t.mapProjection==="mercator"?(r.openBlock(),r.createElementBlock("div",{key:0,class:"flex-start",onClick:e[0]||(e[0]=(...n)=>s.handleParticle&&s.handleParticle(...n))},[t.showParticle?(r.openBlock(),r.createElementBlock("i",st,"")):(r.openBlock(),r.createElementBlock("i",nt,"")),r.createElementVNode("span",{class:r.normalizeClass(t.showParticle?"active":"")},"Current Particles",2)])):r.createCommentVNode("",!0),t.showParticle?(r.openBlock(),r.createElementBlock("div",{key:1,class:"flex-start",style:{"margin-left":"16px"},onClick:e[1]||(e[1]=n=>i.showJson=!i.showJson)},[i.showJson?(r.openBlock(),r.createElementBlock("i",lt,"")):(r.openBlock(),r.createElementBlock("i",ct,"")),r.createElementVNode("span",{class:r.normalizeClass(i.showJson?"active":"")},"Current",2)])):r.createCommentVNode("",!0)],4)])):r.createCommentVNode("",!0)}const dt=C(it,[["render",ht],["__scopeId","data-v-ae630f43"]]),Ir="",mt={name:"IdmCurrentParticle",props:{factor:{type:Object},viewport:{type:pe},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new G,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleOptions:{fadeOpacity:.96,speedFactor:4,dropRate:.005,dropRateBump:.01,uvRange:[-2.5,2.6],sRange:[0,3]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a,e;this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[current-particle] add elapsed: ",t,", total: ",e+=t)}},handleClear(){var a,e,t,o,i,s,l,n;(a=this.viewport)==null||a.toggle(!1),(e=this.viewport)==null||e.toggleParticle(!1),this.context=void 0,this.particleContext=void 0,this.etime=void 0,this.initial=!0,(o=(t=this.viewport)==null?void 0:t.map)==null||o.off("resize",this.handleResize),(s=(i=this.viewport)==null?void 0:i.map)==null||s.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay),this.handlePause()},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0/255,"rgba(95, 143, 197,1)"],[5/255,"rgba(64,127,115,1)"],[10/255,"rgb(58,164,58)"],[15/255,"rgb(191,182,67)"],[20/255,"rgb(197,154,68)"],[30/255,"rgb(160,70,94)"],[40/255,"rgb(138,84,166)"],[45/255,"rgb(82,113,165)"],[50/255,"rgb(84,142,152)"],[65/255,"rgb(150,181,184)"],[80/255,"rgb(195,194,194)"],[254/255,"rgb(195,194,194)"],[1,"rgb(195,194,194)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,D.vertexSchema,D.uvFragmentSchema);this.program=e,this.aPositionBuffer=t}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const a=[[0,"rgb(183,224,224)"],[1,"rgb(199,202,202)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,R.vertexSchema,R.fragmentSchema,R.quadVertSchema,R.screenFragmentSchema,R.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,a,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,12e3),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,a),this.wrapper.image=a}this.initial&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext)}},handlePause(){this.paused=!0,this.animation&&(cancelAnimationFrame(this.animation),this.viewport.toggleParticle(!1))},handlePlay(){this.paused=!1,this.animation=requestAnimationFrame(()=>{this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay()})}}},pt={key:0};function yt(a,e,t,o,i,s){var l;return(l=t.factor)!=null&&l.active?(r.openBlock(),r.createElementBlock("div",pt,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"kts",-1),r.createElementVNode("span",null,"0",-1),r.createElementVNode("span",null,"0.4",-1),r.createElementVNode("span",null,"0.8",-1),r.createElementVNode("span",null,"1.6",-1),r.createElementVNode("span",null,"2",-1),r.createElementVNode("span",null,"3.2",-1)]),4)])):r.createCommentVNode("",!0)}const ut=C(mt,[["render",yt],["__scopeId","data-v-9115889b"]]),ft={name:"IdmSigWave",props:{map:{type:Object},sigWave:{type:Object},beforeLayer:{type:String}},data(){return{source:"sig-wave-source",heightLayer:"sig-wave-height-layer",heightLabelLayer:"sig-wave-height-label-layer",empty:x.featureCollection([])}},watch:{"sigWave.version":{handler(){var a;(a=this.sigWave)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var a,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.sigWave){const t=new Date().valueOf();let o=0,i=0,s=this.empty;this.sigWave.active&&(s=this.sigWave.data),(a=this.map)!=null&&a.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),i=new Date().valueOf()-(t+o),console.log("[sig.wave] update elapsed: ",i,", total: ",o+=i)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.heightLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],layout:{"fill-sort-key":["get","val"]},paint:{"fill-outline-color":"#888","fill-opacity":.8,"fill-color":["step",["get","val"],"rgba(111,248,201,0.6)",3,"#6ff8c9",4,"#36cd9a",5,"#6bff6b",6,"#fee600",7,"#ffa200",8,"#ff6600",9,"#e23304",10,"#f80078",11,"#dc03d2",12,"#a603f8",13,"#7102ab"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Polygon"],layout:{"symbol-placement":"line","symbol-avoid-edges":!0,"symbol-sort-key":["get","val"],"text-field":"{val} m","text-rotation-alignment":"viewport","text-size":10},paint:{"text-opacity":.7}},this.beforeLayer),i=new Date().valueOf()-(t+o),console.log("[sig.wave] add elapsed: ",i,", total: ",o+=i))}},handleClear(){this.map.getLayer(this.heightLayer)&&this.map.removeLayer(this.heightLayer),this.map.getLayer(this.heightLabelLayer)&&this.map.removeLayer(this.heightLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function gt(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const bt=C(ft,[["render",gt]]),Lt={name:"IdmSwell",props:{map:{type:Object},swell:{type:Object},beforeLayer:{type:String}},data(){return{source:"swell-source",directionLayer:"swell-direction-layer",heightLayer:"swell-height-layer",heightLabelLayer:"swell-height-label-layer",empty:x.featureCollection([])}},watch:{"swell.version":{handler(){var a;(a=this.swell)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var a,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.swell){const t=new Date().valueOf();let o=0,i=0,s=this.empty;this.swell.active&&(s=this.swell.data),(a=this.map)!=null&&a.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),i=new Date().valueOf()-(t+o),console.log("[swell] update elapsed: ",i,", total: ",o+=i)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.heightLayer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-opacity":1,"line-width":2,"line-color":["match",["get","val"],2,"rgba(255,255,0,0.9)",3,"rgba(255,149,0,0.9)",4,"rgba(244,67,54,0.9)",5,"rgba(162,2,31,0.9)",6,"rgba(162,2,31,0.9)","rgba(162,2,31,0.9)"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","LineString"],layout:{"symbol-placement":"line","text-rotation-alignment":"viewport","text-field":"{val}M","text-size":12},paint:{"text-color":["step",["get","val"],"black",4,"white",5,"white",6,"white"],"text-halo-color":["match",["get","val"],2,"rgba(255,255,0,0.7)",3,"rgba(255,149,0,0.7)",4,"rgba(244,67,54,0.7)",5,"rgba(162,13,2,0.7)",6,"rgba(162,13,2,0.7)","rgba(162,13,2,0.7)"],"text-halo-width":4}}),this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"arrow-yellow","icon-size":{base:1,stops:[[2,.14],[6,.28]]},"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,180],[360,540]]}},paint:{"icon-opacity":.8}},this.beforeLayer),i=new Date().valueOf()-(t+o),console.log("[swell] add elapsed: ",i,", total: ",o+=i))}},handleClear(){this.map.getLayer(this.heightLayer)&&this.map.removeLayer(this.heightLayer),this.map.getLayer(this.heightLabelLayer)&&this.map.removeLayer(this.heightLabelLayer),this.map.getLayer(this.directionLayer)&&this.map.removeLayer(this.directionLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function wt(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const vt=C(Lt,[["render",wt]]),xt={name:"IdmPrmsl",props:{map:{type:Object},prmsl:{type:Object},beforeLayer:{type:String},activeWeatherLayers:{type:Array}},data(){return{source:"prmsl-source",layer:"prmsl-layer",labelLayer:"prmsl-label-layer",pointLabelLayer:"prmsl-point-label-layer",empty:x.featureCollection([])}},watch:{"prmsl.version":{handler(){var a;(a=this.prmsl)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var a,e,t;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.prmsl){const o=new Date().valueOf();let i=0,s=0,l=this.empty;this.prmsl.active&&(l=this.prmsl.data),(a=this.map)!=null&&a.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(l),s=new Date().valueOf()-(o+i),console.log("[prmsl] update elapsed: ",s,", total: ",i+=s)):(this.map.addSource(this.source,{type:"geojson",data:l}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-color":["step",["get","val"],"rgba(162,13,2,1)",920,"rgba(244,67,54,1)",980,"rgba(255,255,0,1)",1100,"rgba(199,171,250,1)"],"line-width":1,"line-opacity":1}},this.beforeLayer),(t=this.map)==null||t.addLayer({id:this.labelLayer,type:"symbol",source:this.source,minzoom:4,filter:["==","$type","LineString"],layout:{"symbol-placement":"line","text-rotation-alignment":"viewport","text-field":"{val}","text-size":12},paint:{"text-color":"black","text-opacity":.9,"text-halo-color":"rgba(255,255,255,1)","text-halo-width":1}},this.beforeLayer),setTimeout(()=>{this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":["format",["get","type"],{"font-scale":1.03},` `,["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":12},paint:{"text-opacity":1,"text-color":["step",["get","val"],"white",980,"black",1100,"black"],"text-halo-color":["step",["get","val"],"rgba(162,13,2,0.9)",920,"rgba(244,67,54,0.9)",980,"rgba(255,255,0,0.9)",1100,"rgba(199,171,250,0.9)"],"text-halo-width":4}},this.beforeLayer)},1e3),s=new Date().valueOf()-(o+i),console.log("[prmsl] add elapsed: ",s,", total: ",i+=s))}},handleMove(){var a,e;(e=(a=this.map)==null?void 0:a.getLayer("country-boundaries"))==null||e.setLayoutProperty("visibility","visible"),this.map.getLayer(this.pointLabelLayer)&&this.map.moveLayer(this.pointLabelLayer,"country-boundaries"),this.map.getLayer(this.labelLayer)&&this.map.moveLayer(this.labelLayer,"country-boundaries"),this.map.getLayer(this.layer)&&this.map.moveLayer(this.layer,"country-boundaries")},handleClear(){var a,e;this.activeWeatherLayers.length===0&&((e=(a=this.map)==null?void 0:a.getLayer("country-boundaries"))==null||e.setLayoutProperty("visibility","none")),this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.labelLayer)&&this.map.removeLayer(this.labelLayer),this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function _t(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const Ct=C(xt,[["render",_t]]),kt={name:"IdmIceberg",props:{map:{type:Object},iceberg:{type:Object},beforeLayer:{type:String}},data(){return{source:"iceberg-source",layer:"iceberg-layer",empty:x.featureCollection([])}},watch:{"iceberg.version":{handler(){var a;(a=this.iceberg)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var a,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.iceberg){const t=new Date().valueOf();let o=0,i=0,s=this.empty;this.iceberg.active&&(s=this.iceberg.data),(a=this.map)!=null&&a.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),i=new Date().valueOf()-(t+o),console.log("[iceberg] update elapsed: ",i,", total: ",o+=i)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-color":"rgba(255,255,255, 0.8)","line-width":2,"line-opacity":1}}),i=new Date().valueOf()-(t+o),console.log("[iceberg] add elapsed: ",i,", total: ",o+=i))}},handleClear(){this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Et(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const St=C(kt,[["render",Et]]),Br="",zt={name:"IdmTropicals",props:{map:{type:Object},tropicals:{type:Object},date:{type:String},timeZone:{type:Number,default:0}},emits:["tropical","tropicalProbability"],data(){return{helper:z.CompanyHelper,source:"tropicals-source",clusterSource:"tropicals-cluster-source",historyLayer:"tropicals-history-layer",forecastLayer:"tropicals-forecast-layer",forecastModelLayer:"tropicals-forecast-model-layer",forecastNameLayer:"tropicals-forecast-name-layer",pointCircleLayer:"tropicals-point-circle-layer",pointLabelLayer:"tropicals-point-label-layer",historyPointCircleLayer:"history-tropicals-point-circle-layer",historyPointLabelLayer:"history-tropicals-point-label-layer",interpolateData:[],interpolateMarkers:[],interpolateSource:"tropicals-interpolate-source",interpolateLineLayer:"tropicals-interpolate-line-layer",showTropicals:!1,activeTropicals:void 0,activeTropicalsMarker:void 0,empty:x.featureCollection([]),circleSource:"circle-source",circleSourceData:x.featureCollection([]),circleLayer:"tropical-circle-layer"}},computed:{computeTime(){return function(a){if(a){const e=M(a).utc().utcOffset(this.timeZone),t=this.timeZone<0?this.timeZone:"+"+this.timeZone;return`${e.format("MMM-DD,HHmm")}[ UTC ${t} ] ( ${e==null?void 0:e.fromNow()} )`}return"-"}},computeTimezone(){return this.timeZone<0?this.timeZone:"+"+this.timeZone}},watch:{"tropicals.active":{handler(){this.handleInit()},immediate:!0},showTropicals:{handler(){this.$emit("tropical",this.showTropicals)},immediate:!0},"tropicals.version":{handler(){this.handleRefresh()}},timeZone:{handler(){this.handleRefresh()}}},methods:{handleRefresh(){var o,i;const a=((i=(o=this.tropicals)==null?void 0:o.data)==null?void 0:i.features)||[],e=M().utc().hour(),t=[];a.forEach(s=>{var l,n,c;(l=s.properties)!=null&&l.name&&!t.includes((n=s.properties)==null?void 0:n.name)&&t.push((c=s.properties)==null?void 0:c.name)}),t.forEach(s=>{var h;let l=0,n;const c=a.filter(d=>{var m,g;return((g=(m=d.properties)==null?void 0:m.category)==null?void 0:g.split("-")[0])===s});(h=c.filter(d=>{var m,g;return((m=d.geometry)==null?void 0:m.type)==="LineString"&&((g=d.properties)==null?void 0:g.type)==="forecast"})[0])==null||h.properties.model,c.forEach((d,m)=>{var g,y,u,f,p,L;((g=d.geometry)==null?void 0:g.type)==="Point"&&((y=d.properties)==null?void 0:y.type)==="history"&&(l=m,n=n===void 0?m:n),((u=d.geometry)==null?void 0:u.type)==="Point"&&((f=d.properties)==null?void 0:f.type)==="forecast"&&n===void 0&&(n=m),((p=d.geometry)==null?void 0:p.type)==="LineString"&&((L=d.properties)==null||L.type)}),c.map((d,m)=>{var g,y,u,f,p,L,b;if(((g=d.geometry)==null?void 0:g.type)==="LineString"&&((y=d.properties)==null||y.type),((u=d.geometry)==null?void 0:u.type)==="Point"&&((f=d.properties)==null?void 0:f.type)==="forecast"&&(d.properties.name=s,d.properties.format=M(d.properties.date).utcOffset(this.timeZone).format(`MMM-DD,HHmm [(utc ${this.computeTimezone})]`)),((p=d.geometry)==null?void 0:p.type)==="Point"&&((L=d.properties)==null?void 0:L.type)==="history"){d.properties.format=M(d.properties.date).utcOffset(this.timeZone).format(`MMM-DD,HHmm [(utc ${this.computeTimezone})]`);const v=M((b=d.properties)==null?void 0:b.date).utc().format("HHmm")===M().utc().hour(Math.floor(e/6)*6).minute("00").format("HHmm");d.properties.showHistoryLabel=v||m===l,d.properties.showNameLabel=m===l,d.properties.name=s}return d})}),this.handleInit()},handleInit(){var a,e;this.tropicals&&this.tropicals.active?(this.handleRender(),(a=this.map)==null||a.on("click",[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.forecastModelLayer,this.pointCircleLayer,this.pointLabelLayer,this.historyPointCircleLayer,this.historyPointLabelLayer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.forecastModelLayer,this.pointCircleLayer,this.pointLabelLayer,this.historyPointCircleLayer,this.historyPointLabelLayer],this.handleClick))},handleRender(){var a,e,t,o,i,s,l,n,c,h;if(!this.map)setTimeout(()=>{this.handleRender()},500);else{if(this.tropicals){const g=new Date().valueOf();let y=0,u=0;(a=this.map)!=null&&a.getSource(this.source)?((t=this.map)==null||t.getSource(this.source).setData((e=this.tropicals)!=null&&e.active?this.tropicals.data:this.empty),u=new Date().valueOf()-(g+y),console.log("[tropicals] update elapsed: ",u,", total: ",y+=u)):(this.map.addSource(this.source,{type:"geojson",data:(o=this.tropicals)!=null&&o.active?(i=this.tropicals)==null?void 0:i.data:this.empty}),this.map.addLayer({id:this.historyLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["==","type","history"],["!=","disabled",!0]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#000","line-width":4,"line-opacity":.5}}),this.map.addLayer({id:this.forecastLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"],["!=","disabled",!0]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["match",["get","model"],"cma","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#fff"],"line-width":3,"line-opacity":.9,"line-dasharray":[1,2]}}),this.map.addLayer({id:this.forecastModelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"],["!=","disabled",!0]],layout:{"symbol-placement":"line","text-field":"{model}","text-rotation-alignment":"viewport","text-size":13},paint:{"text-color":["match",["get","model"],"cma","#000","jma","#000","ecmwf","#fff","ukm","#fff","noaa-at","#fff","noaa-ep","#fff","#000"],"text-opacity":1,"text-halo-color":["match",["get","model"],"cma","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#fff"],"text-halo-width":4}}),u=new Date().valueOf()-(g+y),console.log("[tropical] add elapsed: ",u,", total: ",y+=u)),(s=this.map)!=null&&s.getSource(this.clusterSource)?((n=this.map)==null||n.getSource(this.clusterSource).setData((l=this.tropicals)!=null&&l.active?this.tropicals.data:this.empty),u=new Date().valueOf()-(g+y),console.log("[tropical] update elapsed: ",u,", total: ",y+=u)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(c=this.tropicals)!=null&&c.active?(h=this.tropicals)==null?void 0:h.data:this.empty}),this.map.addLayer({id:this.pointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":6,"circle-color":"#fff"}}),this.map.addLayer({id:this.pointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":4,"circle-color":["case",["boolean",["==",["get","spd",["get","wind"]],null]],"#03f869",["boolean",["<",["get","spd",["get","wind"]],17.2]],"#03f869",["boolean",["<=",["get","spd",["get","wind"]],24.5]],"#f2f202",["boolean",["<=",["get","spd",["get","wind"]],32.7]],"#ff9100",["boolean",["<=",["get","spd",["get","wind"]],41.5]],"#f44336",["boolean",["<",["get","spd",["get","wind"]],51]],"#f903d0",["boolean",[">=",["get","spd",["get","wind"]],51]],"#8702f9","#fff"]}}),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[0,-.5],"text-anchor":"bottom-left","text-size":12},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"#fff","text-halo-width":1}}),this.map.addLayer({id:this.historyPointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":8,"circle-color":"#fff"}}),this.map.addLayer({id:this.historyPointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":6,"circle-color":"rgba(0,0,0,0.7)"}}),this.map.addLayer({id:this.historyPointCircleLayer+"-inner",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":4,"circle-color":"#fff"}}),this.map.addLayer({id:this.historyPointLabelLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[0,-.5],"text-anchor":"bottom-left","text-size":14},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"#fff","text-halo-width":1}}),this.map.addLayer({id:this.forecastNameLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showNameLabel",!0]],layout:{"text-field":["get","name"],"text-offset":[0,1.5],"text-anchor":"bottom","text-size":16,"text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#fff","text-halo-color":"#0033ff","text-halo-width":4}}),u=new Date().valueOf()-(g+y),console.log("[tropical] add elapsed: ",u,", total: ",y+=u))}this.handleDrawCircle();const d=S.TropicalHelper.interpolate(this.tropicals,1);this.interpolateData=JSON.parse(JSON.stringify(d));const m=this.interpolateData.filter(g=>g.properties.name==="kristy"&&g.properties.model==="ecmwf");console.log(m),this.handleDateChange()}},handleClear(){var a;this.map&&(this.map.getLayer(this.historyLayer)&&this.map.removeLayer(this.historyLayer),this.map.getLayer(this.forecastLayer)&&this.map.removeLayer(this.forecastLayer),this.map.getLayer(this.forecastModelLayer)&&this.map.removeLayer(this.forecastModelLayer),this.map.getLayer(this.forecastNameLayer)&&this.map.removeLayer(this.forecastNameLayer),this.map.getLayer(this.pointCircleLayer)&&this.map.removeLayer(this.pointCircleLayer),this.map.getLayer(this.pointCircleLayer+"-border")&&this.map.removeLayer(this.pointCircleLayer+"-border"),this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.historyPointCircleLayer)&&this.map.removeLayer(this.historyPointCircleLayer),this.map.getLayer(this.historyPointCircleLayer+"-border")&&this.map.removeLayer(this.historyPointCircleLayer+"-border"),this.map.getLayer(this.historyPointCircleLayer+"-inner")&&this.map.removeLayer(this.historyPointCircleLayer+"-inner"),this.map.getLayer(this.historyPointLabelLayer)&&this.map.removeLayer(this.historyPointLabelLayer),this.map.getLayer(this.interpolateLineLayer)&&this.map.removeLayer(this.interpolateLineLayer),(a=this.interpolateMarkers)==null||a.forEach(e=>e==null?void 0:e.remove()),this.map.getSource(this.source)&&this.map.removeSource(this.source),this.map.getSource(this.clusterSource)&&this.map.removeSource(this.clusterSource),this.map.getSource(this.interpolateSource)&&this.map.removeSource(this.interpolateSource),this.map.getLayer(this.circleLayer)&&this.map.removeLayer(this.circleLayer),this.map.getSource(this.circleSource)&&this.map.removeSource(this.circleSource))},handleDateChange(){var a,e,t,o,i,s,l,n,c,h,d,m,g,y,u,f,p,L,b,v,_,w,N,T,V,I,B,W,Q,K,ee,te,ae,re,ie,J;if((a=this.interpolateMarkers)==null||a.forEach(O=>O==null?void 0:O.remove()),this.circleSourceData.features=[],(e=this.interpolateData)!=null&&e.length&&this.tropicals.active){const O=M(this.date).utc().set({minute:0,second:0,millisecond:0}),j=this.interpolateData.filter(k=>k.properties.date===O.format()&&!k.properties.disabled),oe=this.handleComputePolygons(j),F=x.featureCollection([...j]);oe.forEach(k=>{F.features.push(k)}),(t=this.map)!=null&&t.getSource(this.interpolateSource)?(o=this.map)==null||o.getSource(this.interpolateSource).setData(F):((i=this.map)==null||i.addSource(this.interpolateSource,{type:"geojson",data:F}),(s=this.map)==null||s.addLayer({id:this.interpolateLineLayer,type:"line",source:this.interpolateSource,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-opacity":1,"line-color":["match",["get","level"],7,"#ff9100",10,"#f44336","#ffffff"],"line-width":1}})),this.interpolateMarkers=[];for(const k of j)if(!k.properties.disabled){let A="#f44336";((n=(l=k.properties)==null?void 0:l.wind)==null?void 0:n.spd)<17.2||!((h=(c=k.properties)==null?void 0:c.wind)!=null&&h.spd)?A="#03f869":((m=(d=k.properties)==null?void 0:d.wind)==null?void 0:m.spd)>=17.2&&((y=(g=k.properties)==null?void 0:g.wind)==null?void 0:y.spd)<24.5?A="#f2f202":((f=(u=k.properties)==null?void 0:u.wind)==null?void 0:f.spd)>=24.5&&((L=(p=k.properties)==null?void 0:p.wind)==null?void 0:L.spd)<32.7?A="#ff9100":((v=(b=k.properties)==null?void 0:b.wind)==null?void 0:v.spd)>=32.7&&((w=(_=k.properties)==null?void 0:_.wind)==null?void 0:w.spd)<41.5?A="#f44336":((T=(N=k.properties)==null?void 0:N.wind)==null?void 0:T.spd)>=41.5&&((I=(V=k.properties)==null?void 0:V.wind)==null?void 0:I.spd)<51?A="#f903d0":((W=(B=k.properties)==null?void 0:B.wind)==null?void 0:W.spd)>=51?A="#8702f9":A="#f44336";const se=` `,$=document.createElement("div");$.className="hurricane-hourly-marker",$.innerHTML=`
${se}
`;const ne=new U.Marker($).setLngLat(k.geometry.coordinates).addTo(this.map);if(this.interpolateMarkers.push(ne),(Q=k.properties)!=null&&Q.showCircle){const X={radius:100,coordinates:k.geometry.coordinates},q={radius:200,coordinates:k.geometry.coordinates},Y={radius:500,coordinates:k.geometry.coordinates};(K=this.circleSourceData)==null||K.features.push(x.circle(X.coordinates,X.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}})),(ee=this.circleSourceData)==null||ee.features.push(x.circle(q.coordinates,q.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}})),(te=this.circleSourceData)==null||te.features.push(x.circle(Y.coordinates,Y.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}}))}(re=(ae=this.map)==null?void 0:ae.getSource(this.circleSource))==null||re.setData(this.circleSourceData)}}else(ie=this.map)!=null&&ie.getSource(this.interpolateSource)&&((J=this.map)==null||J.getSource(this.interpolateSource).setData(this.empty))},handleClick(a){var s,l,n,c,h,d,m,g;const e=a.features[0],t=(l=(s=this.tropicals)==null?void 0:s.data)==null?void 0:l.features.filter(y=>{var u;return y.geometry.type==="LineString"&&y.properties.type==="forecast"&&y.properties.name===((u=e==null?void 0:e.properties)==null?void 0:u.name)});t.sort((y,u)=>{var f,p,L,b;return((f=y.properties)==null?void 0:f.model)==="cma"?-1:((p=y.properties)==null?void 0:p.model)==="jma"?((L=u.properties)==null?void 0:L.model)==="cma"?1:-1:y.properties.model==="ecmwf"?["jma","cma"].includes((b=u.properties)==null?void 0:b.model)?1:-1:0});const o=(c=(n=this.tropicals)==null?void 0:n.data)==null?void 0:c.features.filter(y=>{var u;return y.geometry.type==="LineString"&&y.properties.type==="history"&&y.properties.name===((u=e==null?void 0:e.properties)==null?void 0:u.name)});this.activeTropicals={name:(h=e==null?void 0:e.properties)==null?void 0:h.name,forecasts:t.map(y=>y.properties),history:(d=o[0])==null?void 0:d.properties,showCircle:(g=(m=t[0])==null?void 0:m.properties)==null?void 0:g.showCircle},this.showTropicals=!0;const i=document.getElementById("active-tropical");this.activeTropicalsMarker?this.activeTropicalsMarker.setLngLat([a.lngLat.lng,a.lngLat.lat]):this.activeTropicalsMarker=new U.Marker(i).setLngLat([a.lngLat.lng,a.lngLat.lat]).setOffset([220,0]).addTo(this.map)},handleForecastToggle(a){var o,i,s,l,n,c;a.disabled=!a.disabled;const e=`${a.name}-${a.model}`,t=(i=(o=this.map)==null?void 0:o.getSource(this.source)._data)==null?void 0:i.features;t.forEach(h=>{h.properties.category===e&&(h.properties.disabled=a.disabled)}),this.interpolateData.forEach(h=>{h.properties.category===e&&(h.properties.disabled=a.disabled)}),(l=(s=this.map)==null?void 0:s.getSource(this.source))==null||l.setData(x.featureCollection(t)),(c=(n=this.map)==null?void 0:n.getSource(this.clusterSource))==null||c.setData(x.featureCollection(t)),this.handleDateChange()},handleStrikeProbability(a){this.$emit("tropicalProbability",a)},handleToggleCircles(a){var e,t;a.showCircle=!a.showCircle,(t=(e=this.tropicals.data)==null?void 0:e.features)==null||t.forEach(o=>{o.properties.name===a.name&&(o.properties.showCircle=a.showCircle)}),this.handleRender()},handleDrawCircle(){var a,e;(a=this.map)!=null&&a.getSource(this.circleSource)?(e=this.map)==null||e.getSource(this.circleSource).setData(this.circleSourceData):(this.map.addSource(this.circleSource,{type:"geojson",data:this.circleSourceData}),this.map.addLayer({id:this.circleLayer,type:"line",source:this.circleSource,filter:["all",["==","$type","Polygon"],["==","type","tropicalCircle"]],paint:{"line-color":"#fff","line-width":2,"line-opacity":1,"line-dasharray":[1,1]}}))},handleComputePolygons(a){const e=[];for(const t of a){const o=t.properties.wind,i={ne:o.r7ne>=0?o.r7ne:void 0,se:o.r7se>=0?o.r7se:void 0,sw:o.r7sw>=0?o.r7sw:void 0,nw:o.r7nw>=0?o.r7nw:void 0},s=this.handleComputeArc(t.geometry.coordinates,i,{...t.properties,level:7});e.push(s);const l={ne:o.r10ne>=0?o.r10ne:void 0,se:o.r10se>=0?o.r10se:void 0,sw:o.r10sw>=0?o.r10sw:void 0,nw:o.r10nw>=0?o.r10nw:void 0},n=this.handleComputeArc(t.geometry.coordinates,l,{...t.properties,level:10});e.push(n)}return e},handleComputeArc(a,e,t){var s;const o=[];for(const l in e){const n=e[l]??0;let c;switch(l){case"ne":c=x.lineArc(a,n*1.852,0,90,{steps:n>0?64:1});break;case"se":c=x.lineArc(a,n*1.852,90,180,{steps:n>0?64:1});break;case"sw":c=x.lineArc(a,n*1.852,180,270,{steps:n>0?64:1});break;case"nw":c=x.lineArc(a,n*1.852,270,360,{steps:n>0?64:1});break}o.push(...(s=c==null?void 0:c.geometry)==null?void 0:s.coordinates)}const i=x.lineString(o);return x.lineToPolygon(i,{properties:t})}}},Pt={id:"active-tropical",class:"active-tropical"},Nt={class:"header-box"},Tt={class:"main"},Dt={key:0},Vt={class:"sub"},Rt={id:"meteoBox",class:"main-box"},It={class:"content"},Bt={class:"row"},At={class:"col col-left",style:{"justify-content":"flex-start"}},Mt={class:"col col-right",style:{"justify-content":"flex-start"}},Wt={class:"row"},Ot={class:"col col-24",style:{"justify-content":"flex-start"}},jt={class:"forecast-models"},Ft=["onClick"],$t={class:"more"};function Ht(a,e,t,o,i,s){var l,n,c,h,d,m,g,y,u,f,p,L,b,v,_;return r.withDirectives((r.openBlock(),r.createElementBlock("div",Pt,[r.createElementVNode("div",Nt,[r.createElementVNode("div",{class:"iconfont close-btn",onClick:e[0]||(e[0]=w=>i.showTropicals=!1)},""),r.createElementVNode("div",Tt,[(n=(l=i.activeTropicals)==null?void 0:l.history)!=null&&n.level?(r.openBlock(),r.createElementBlock("span",Dt,r.toDisplayString((h=(c=i.activeTropicals)==null?void 0:c.history)==null?void 0:h.level)+" , ",1)):r.createCommentVNode("",!0),r.createTextVNode(r.toDisplayString((d=i.activeTropicals)==null?void 0:d.name),1)]),r.createElementVNode("div",Vt," Last update: "+r.toDisplayString(s.computeTime(((g=(m=i.activeTropicals)==null?void 0:m.history)==null?void 0:g.updated)||((f=(u=(y=i.activeTropicals)==null?void 0:y.forecasts)==null?void 0:u.filter(w=>!w.disabled)[0])==null?void 0:f.date))),1)]),r.createElementVNode("div",Rt,[r.createElementVNode("div",It,[r.createElementVNode("div",Bt,[r.createElementVNode("div",At,[e[2]||(e[2]=r.createElementVNode("label",null,"Wind speed : ",-1)),r.createElementVNode("span",null,r.toDisplayString(((L=(p=i.activeTropicals)==null?void 0:p.history)==null?void 0:L.kts)||"-")+"[kts]",1)]),r.createElementVNode("div",Mt,[e[3]||(e[3]=r.createElementVNode("label",null,"Pressure : ",-1)),r.createElementVNode("span",null,r.toDisplayString(((v=(b=i.activeTropicals)==null?void 0:b.history)==null?void 0:v.pressure)||"-")+"[hPa]",1)])]),r.createElementVNode("div",Wt,[r.createElementVNode("div",Ot,[e[4]||(e[4]=r.createElementVNode("label",{style:{width:"max-content"}},"Forecast Models : ",-1)),r.createElementVNode("div",jt,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList((_=i.activeTropicals)==null?void 0:_.forecasts,(w,N)=>{var T,V,I,B;return r.openBlock(),r.createElementBlock("div",{key:N,class:r.normalizeClass(["model",w.disabled?"":"active",N>0&&N<((V=(T=i.activeTropicals)==null?void 0:T.forecasts)==null?void 0:V.length)-1&&((B=(I=i.activeTropicals)==null?void 0:I.forecasts)==null?void 0:B.length)>2?"center-child":""]),onClick:W=>s.handleForecastToggle(w)},[r.createElementVNode("span",{class:r.normalizeClass(w.model)},r.toDisplayString(w.model),3)],10,Ft)}),128))])])]),e[5]||(e[5]=r.createStaticVNode('
TD
TS
STS
TY
STY
Super TY
History
35kts Radii
50kts Radii
',3))]),r.createElementVNode("div",$t,[r.createElementVNode("div",{class:"button",onClick:e[1]||(e[1]=w=>s.handleStrikeProbability(i.activeTropicals))},"Strike Probability >>")])])],512)),[[r.vShow,i.showTropicals&&!a.$attrs.hideTropicalsLegend]])}const ye=C(zt,[["render",Ht],["__scopeId","data-v-b521de47"]]),Ar="",Ut={name:"IdmPrecip3h",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new G,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a,e;this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[precip3h] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgba(59, 126, 162, 0)"],[14/255,"rgba(84,170,230, 0)"],[15/255,"rgba(172, 210, 255, 0.8)"],[20/255,"rgba(51,202,248,0.8)"],[30/255,"rgba(3,248,103,0.8)"],[49/255,"rgba(14,201,3,0.8)"],[57/255,"rgba(190,226,2,0.8)"],[73/255,"rgba(248,1,1,0.8)"],[82/255,"rgba(197,5,58,0.8)"],[1,"rgba(197,5,58,0.8)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,D.vertexSchema,D.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Zt={key:0};function Gt(a,e,t,o,i,s){var l;return(l=t.factor)!=null&&l.active?(r.openBlock(),r.createElementBlock("div",Zt,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"mm",-1),r.createElementVNode("span",null,"1.5",-1),r.createElementVNode("span",null,"2",-1),r.createElementVNode("span",null,"3",-1),r.createElementVNode("span",null,"7",-1),r.createElementVNode("span",null,"10",-1),r.createElementVNode("span",null,"20",-1),r.createElementVNode("span",null,"30",-1)]),4)])):r.createCommentVNode("",!0)}const Jt=C(Ut,[["render",Gt],["__scopeId","data-v-dec867b8"]]),Mr="",Xt={name:"IdmVisibility",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new G,etime:void 0}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a,e;this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[visibility] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgba(189,50,160,0.8)"],[8/255,"rgba(208,56,56,0.8)"],[27/255,"rgba(190,226,2,0.8)"],[60/255,"rgba(3,236,118,0.8)"],[160/255,"rgba(172, 210,255,0.8)"],[161/255,"rgba(172, 210,255,0)"],[1,"rgba(144,144,144,0)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,D.vertexSchema,D.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},qt={key:0};function Yt(a,e,t,o,i,s){var l;return(l=t.factor)!=null&&l.active?(r.openBlock(),r.createElementBlock("div",qt,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:a.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"nm",-1),r.createElementVNode("span",null,"0",-1),r.createElementVNode("span",null,"0.5",-1),r.createElementVNode("span",null,"1.5",-1),r.createElementVNode("span",null,"3",-1),r.createElementVNode("span",null,"9",-1)]),4)])):r.createCommentVNode("",!0)}const Qt=C(Xt,[["render",Yt],["__scopeId","data-v-952dee5c"]]),Wr="",Kt={name:"IdmWaterTemp",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new G,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a,e;this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[water-temp] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgba(95, 143, 197)"],[46/255,"rgba(95, 143, 197)"],[69/255,"rgb(80, 140, 62)"],[92/255,"rgb(121, 146, 28)"],[115/255,"rgb(171, 161, 14)"],[138/255,"rgb(223, 177, 69)"],[161/255,"rgb(243, 150, 6)"],[184/255,"rgb(236, 95, 21)"],[207/255,"rgb(190, 65, 18)"],[230/255,"rgb(138, 43, 10)"],[1,"rgb(138, 43, 10)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,D.vertexSchema,D.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},ea={key:0};function ta(a,e,t,o,i,s){var l;return(l=t.factor)!=null&&l.active?(r.openBlock(),r.createElementBlock("div",ea,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"°C",-1),r.createElementVNode("span",null,"0",-1),r.createElementVNode("span",null,"10",-1),r.createElementVNode("span",null,"20",-1),r.createElementVNode("span",null,"30",-1),r.createElementVNode("span",null,"40",-1)]),4)])):r.createCommentVNode("",!0)}const aa=C(Kt,[["render",ta],["__scopeId","data-v-67e5094b"]]),Or="",ra={name:"IdmTemp",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new G,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a,e;this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[water-temp] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgb(149, 137, 211)"],[100/255,"rgb(149, 137, 211)"],[110/255,"rgb(150, 209, 216)"],[120/255,"rgb(129, 204, 197)"],[130/255,"rgb(103, 180, 186)"],[140/255,"rgb(95, 143, 197)"],[150/255,"rgb(80, 140, 62)"],[160/255,"rgb(121, 146, 28)"],[170/255,"rgb(171, 161, 14)"],[180/255,"rgb(223, 177, 6)"],[190/255,"rgb(243, 150, 6)"],[200/255,"rgb(236, 95, 21)"],[210/255,"rgb(190, 65, 18)"],[220/255,"rgb(138, 43, 10)"],[1,"rgb(138, 43, 10)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,D.vertexSchema,D.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},ia={key:0};function oa(a,e,t,o,i,s){var l;return(l=t.factor)!=null&&l.active?(r.openBlock(),r.createElementBlock("div",ia,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"°C",-1),r.createElementVNode("span",null,"-20",-1),r.createElementVNode("span",null,"-10",-1),r.createElementVNode("span",null,"0",-1),r.createElementVNode("span",null,"10",-1),r.createElementVNode("span",null,"20",-1),r.createElementVNode("span",null,"30",-1),r.createElementVNode("span",null,"40",-1)]),4)])):r.createCommentVNode("",!0)}const sa=C(ra,[["render",oa],["__scopeId","data-v-389ea886"]]),jr="",na={name:"IdmArctic",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new G,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a,e;this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[water-temp] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgba(76, 165, 228, 0)"],[50/255,"rgba(76, 165, 228, 0)"],[51/255,"rgb(76, 165, 228)"],[102/255,"rgb(129, 204, 197)"],[153/255,"rgb(150, 209, 216)"],[204/255,"rgb(180, 209, 216)"],[1,"rgb(180, 209, 216)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,D.vertexSchema,D.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},la={key:0};function ca(a,e,t,o,i,s){var l;return(l=t.factor)!=null&&l.active?(r.openBlock(),r.createElementBlock("div",la,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"m",-1),r.createElementVNode("span",null,"0",-1),r.createElementVNode("span",null,"0.5",-1),r.createElementVNode("span",null,"1",-1),r.createElementVNode("span",null,"1.5",-1),r.createElementVNode("span",null,"2",-1)]),4)])):r.createCommentVNode("",!0)}const ha=C(na,[["render",ca],["__scopeId","data-v-db805141"]]),Fr="",da={name:"IdmPoint",emits:["point","more"],props:{map:{type:Object},show:{type:Boolean},timeZone:{type:Number,default:0},meteo:{type:Object}},data(){return{showMeteo:!1,meteoMarker:void 0,helper:z.CompanyHelper}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){this.map&&this.show&&this.handleBind()}},meteo:{handler(){this.meteo?(this.showMeteo=!0,this.handleRender()):this.showMeteo=!1}}},computed:{computeTime(){return function(a){if(a){const e=M(a).utc().utcOffset(this.timeZone),t=this.timeZone<0?this.timeZone:"+"+this.timeZone;return`${e.format("MMM-DD,HHmm")} ( UTC ${t} )`}return"-"}},computeLat(){return function(a,e=4){return S.LngLatHelper.lat2pretty(a,e).pretty}},computeLng(){return function(a,e=4){return S.LngLatHelper.lng2pretty(a,e).pretty}},roundPrecision(){return function(a,e=4){return isNaN(a)?"-":S.LngLatHelper.roundPrecision(a,e)}}},methods:{handleBind(){var a,e;this.show?(a=this.map)==null||a.on("click",this.handleClick):((e=this.map)==null||e.off("click",this.handleClick),this.showMeteo=!1)},handleClick(a){a.originalEvent.stopPropagation();const e=a.originalEvent.target.className;e.indexOf("close")>-1?this.showMeteo=!1:e==="more"?this.$emit("more",this.meteo):this.$emit("point",a.lngLat)},handleRender(){var a;if(this.meteo){const e=document.getElementById("point-meteo");this.meteoMarker?(a=this.meteoMarker)==null||a.setLngLat([this.meteo.lng,this.meteo.lat]):this.meteoMarker=new U.Marker(e).setLngLat([this.meteo.lng,this.meteo.lat]).addTo(this.map)}}}},ma={id:"point-meteo",class:"point-meteo"},pa={class:"meteo-box"},ya={class:"header-box"},ua={class:"main"},fa={class:"sub"},ga={class:"main-box"},ba={class:"flex-space"},La={class:"flex-space"},wa={class:"flex-space"},va={class:"flex-space"},xa={class:"flex-space"},_a={class:"flex-space"},Ca={class:"flex-space"},ka={class:"flex-space"},Ea={class:"flex-space"},Sa={key:0,class:"flex-space",style:{"justify-content":"flex-end"}};function za(a,e,t,o,i,s){var l,n,c,h,d,m,g,y,u,f,p,L,b,v,_,w,N,T,V,I,B,W,Q,K,ee,te,ae,re,ie,J,O,j,oe,F,k,A,se,$,ne,X,q,Y,le,ce,he,de,me;return r.withDirectives((r.openBlock(),r.createElementBlock("div",ma,[r.createElementVNode("div",pa,[r.createElementVNode("div",ya,[r.createElementVNode("div",{class:"iconfont close",onClick:e[0]||(e[0]=fe=>i.showMeteo=!1)},""),r.createElementVNode("div",ua,r.toDisplayString(s.computeLat((l=t.meteo)==null?void 0:l.lat))+","+r.toDisplayString(s.computeLng((n=t.meteo)==null?void 0:n.lng)),1),r.createElementVNode("div",fa,r.toDisplayString(s.computeTime((c=t.meteo)==null?void 0:c.utc)),1)]),r.createElementVNode("div",ga,[r.createElementVNode("div",ba,[e[1]||(e[1]=r.createElementVNode("label",null,"Wind",-1)),r.createElementVNode("span",null,r.toDisplayString(((d=(h=t.meteo)==null?void 0:h.wind)==null?void 0:d.direction)||"-")+"/"+r.toDisplayString(s.roundPrecision((g=(m=t.meteo)==null?void 0:m.wind)==null?void 0:g.kts,1))+"[kts]/"+r.toDisplayString((u=(y=t.meteo)==null?void 0:y.wind)==null?void 0:u.scale)+"[BF]/"+r.toDisplayString(s.roundPrecision((p=(f=t.meteo)==null?void 0:f.gusts)==null?void 0:p.kts,1))+"[kts]",1)]),r.createElementVNode("div",La,[e[2]||(e[2]=r.createElementVNode("label",null,"Wind.Wave",-1)),r.createElementVNode("span",null,r.toDisplayString(((v=(b=(L=t.meteo)==null?void 0:L.wave)==null?void 0:b.wd)==null?void 0:v.direction)||"-")+"/"+r.toDisplayString(s.roundPrecision((N=(w=(_=t.meteo)==null?void 0:_.wave)==null?void 0:w.wd)==null?void 0:N.height,1))+"[m]/"+r.toDisplayString(s.roundPrecision((I=(V=(T=t.meteo)==null?void 0:T.wave)==null?void 0:V.wd)==null?void 0:I.period,1))+"[s]",1)]),r.createElementVNode("div",wa,[e[3]||(e[3]=r.createElementVNode("label",null,"Swell",-1)),r.createElementVNode("span",null,r.toDisplayString(((Q=(W=(B=t.meteo)==null?void 0:B.wave)==null?void 0:W.swell)==null?void 0:Q.direction)||"-")+"/"+r.toDisplayString(s.roundPrecision((te=(ee=(K=t.meteo)==null?void 0:K.wave)==null?void 0:ee.swell)==null?void 0:te.height,1))+"[m]/"+r.toDisplayString(s.roundPrecision((ie=(re=(ae=t.meteo)==null?void 0:ae.wave)==null?void 0:re.swell)==null?void 0:ie.period,1))+"[s]",1)]),r.createElementVNode("div",va,[e[4]||(e[4]=r.createElementVNode("label",null,"Sig.Wave",-1)),r.createElementVNode("span",null,r.toDisplayString(((j=(O=(J=t.meteo)==null?void 0:J.wave)==null?void 0:O.sig)==null?void 0:j.direction)||"-")+"/"+r.toDisplayString(s.roundPrecision((k=(F=(oe=t.meteo)==null?void 0:oe.wave)==null?void 0:F.sig)==null?void 0:k.height,1))+"[m]/"+r.toDisplayString(s.roundPrecision(($=(se=(A=t.meteo)==null?void 0:A.wave)==null?void 0:se.sig)==null?void 0:$.period,1))+"[s]",1)]),r.createElementVNode("div",xa,[e[5]||(e[5]=r.createElementVNode("label",null,"Current",-1)),r.createElementVNode("span",null,r.toDisplayString(((X=(ne=t.meteo)==null?void 0:ne.current)==null?void 0:X.direction)||"-")+"/"+r.toDisplayString(s.roundPrecision((Y=(q=t.meteo)==null?void 0:q.current)==null?void 0:Y.kts,2))+"[kts]",1)]),r.createElementVNode("div",_a,[e[6]||(e[6]=r.createElementVNode("label",null,"Precip",-1)),r.createElementVNode("span",null,r.toDisplayString(s.roundPrecision((ce=(le=t.meteo)==null?void 0:le.precip)==null?void 0:ce.inter6h,2))+"[mm]",1)]),r.createElementVNode("div",Ca,[e[7]||(e[7]=r.createElementVNode("label",null,"Visibility",-1)),r.createElementVNode("span",null,r.toDisplayString(s.roundPrecision(((he=t.meteo)==null?void 0:he.visibility)/1852,0))+"[nm]",1)]),r.createElementVNode("div",ka,[e[8]||(e[8]=r.createElementVNode("label",null,"Temp",-1)),r.createElementVNode("span",null,r.toDisplayString(s.roundPrecision((de=t.meteo)==null?void 0:de.temp,0))+"[°C]",1)]),r.createElementVNode("div",Ea,[e[9]||(e[9]=r.createElementVNode("label",null,"Water Temp",-1)),r.createElementVNode("span",null,r.toDisplayString(s.roundPrecision((me=t.meteo)==null?void 0:me.waterTemp,2))+"[°C]",1)])]),a.$attrs.permission&i.helper.LEVEL.Prime?(r.openBlock(),r.createElementBlock("div",Sa,e[10]||(e[10]=[r.createElementVNode("span",{class:"more"},"More >>",-1)]))):r.createCommentVNode("",!0)])],512)),[[r.vShow,i.showMeteo]])}const Pa=C(da,[["render",za],["__scopeId","data-v-22c5d8c1"]]),Na={name:"IdmWarZone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"war-zone-source",zoneLayer:"war-zone-layer",zoneLabelLayer:"war-zone-label-layer"}},watch:{zone:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.zone&&(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-color":"#f44336","fill-opacity":.4}},this.beforeLayer),this.map.addLayer({id:this.zoneLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":1,"line-color":"#f44336"}},this.beforeLayer),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-1]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneLayer+"-border")&&this.map.removeLayer(this.zoneLayer+"-border"),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Ta(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const Da=C(Na,[["render",Ta]]),Va={name:"IdmGmdssArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"gmdss-area-source",areaLayer:"gmdss-area-layer",areaLabelLayer:"gmdss-area-label-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":["match",["get","val"],"AreaI","#EB8996","AreaII","#6F448B","AreaIII","#3E8BD3","AreaIV","#5EBCC4","AreaV","#00AAE7","AreaVI","#9CCE6D","AreaVII","#F4AE00","AreaVIII","#EF9A85","AreaIX","#00AAA7","AreaX","#7AC49F","AreaXI","#DFDFDF","AreaXII","#FFF974","AreaXIII","#EF9A85","AreaXIV","#86A2D1","AreaXV","#EC8972","AreaXVI","#EAC2DA","AreaXVII","#B9C8E7","AreaXVIII","#BBA1C8","AreaXIX","#FAE0BD","AreaXX","#DBECC8","AreaXXI","#D496AF","#ffffff"]}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":12,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-opacity":.8,"text-color":"#000"}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Ra(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const Ia=C(Va,[["render",Ra]]),Ba={name:"IdmEcaZone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"eca-zone-source",zoneLayer:"eca-zone-layer",zoneLabelLayer:"eca-zone-label-layer"}},watch:{zone:{handler(){this.zone?this.handleRender():this.handleClear()}}},methods:{handleRender(){var a;this.map?(this.handleClear(),this.zone&&(this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(this.zone):(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":"#05f324"}}),this.map.addLayer({id:this.zoneLayer+"-border",type:"line",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-color":"#04c021","line-width":1,"line-opacity":1}},this.beforeLayer),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-max-width":16,"text-justify":"left","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}})))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneLayer+"-border")&&this.map.removeLayer(this.zoneLayer+"-border"),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Aa(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const Ma=C(Ba,[["render",Aa]]),$r="",Wa={name:"IdmAlertZone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"alert-zone-source",polygonLayer:"alert-zone-polygon-layer",polygonLabelLayer:"alert-zone-polygon-label-layer",lineLayer:"alert-zone-line-layer",lineLabelLayer:"alert-zone-line-label-layer",pointLayer:"alert-zone-point-layer",showZone:!1,form:{}}},watch:{zone:{handler(){var a,e;this.zone?(this.handleRender(),(a=this.map)==null||a.on("click",[this.polygonLabelLayer,this.lineLabelLayer,this.pointLayer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.polygonLabelLayer,this.lineLabelLayer,this.pointLayer],this.handleClick))}}},methods:{handleClick(a){var o;const e=a.features[0],t=(o=this.zone)==null?void 0:o.features.filter(i=>{var s;return i.properties.id===((s=e==null?void 0:e.properties)==null?void 0:s.id)})[0];t&&(this.showZone=!0,this.form={...t.properties})},handleRender(){var a;this.map?(this.handleClear(),this.zone&&(this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(this.zone):(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.polygonLayer,type:"fill",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"fill-outline-color":"#d57d02","fill-opacity":.4,"fill-color":"#d57d02"}}),this.map.addLayer({id:this.polygonLayer+"-border",type:"line",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-width":1,"line-color":"#d57d02"}}),this.map.addLayer({id:this.lineLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["!=","disabled",!0]],paint:{"line-color":"#d57d02","line-width":2}}),this.map.addLayer({id:this.polygonLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-image":"alert","icon-size":.1,"icon-allow-overlap":!0,"icon-rotation-alignment":"viewport"},paint:{"icon-opacity":.8}}),this.map.addLayer({id:this.lineLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","LineString"],["!=","disabled",!0]],layout:{"symbol-placement":"line-center","icon-image":"alert","icon-size":.1,"icon-allow-overlap":!0,"icon-rotation-alignment":"viewport"},paint:{"icon-opacity":.8}}),this.map.addLayer({id:this.pointLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-image":"alert","icon-size":.1},paint:{"icon-opacity":.8}})))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.polygonLayer)&&this.map.removeLayer(this.polygonLayer),this.map.getLayer(this.polygonLayer+"-border")&&this.map.removeLayer(this.polygonLayer+"-border"),this.map.getLayer(this.polygonLabelLayer)&&this.map.removeLayer(this.polygonLabelLayer),this.map.getLayer(this.lineLayer)&&this.map.removeLayer(this.lineLayer),this.map.getLayer(this.lineLabelLayer)&&this.map.removeLayer(this.lineLabelLayer),this.map.getLayer(this.pointLayer)&&this.map.removeLayer(this.pointLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},Oa={id:"zone-info"},ja=["innerHTML"];function Fa(a,e,t,o,i,s){var l;return r.withDirectives((r.openBlock(),r.createElementBlock("div",Oa,[r.createElementVNode("div",{class:"iconfont close",onClick:e[0]||(e[0]=n=>i.showZone=!1)},""),r.createElementVNode("div",{class:"rich-context",innerHTML:(l=i.form)==null?void 0:l.name},null,8,ja)],512)),[[r.vShow,i.showZone]])}const $a=C(Wa,[["render",Fa],["__scopeId","data-v-c0864afc"]]),Hr="",Ha={name:"IdmPort",props:{map:{type:Object},port:{type:Object},beforeLayer:{type:String}},emits:["port"],data(){return{source:"port-source",layer:"port-layer",showPort:!1,form:{},marker:void 0}},computed:{computeLat(){return function(a){return S.LngLatHelper.lat2pretty(a,4).pretty}},computeLng(){return function(a){return S.LngLatHelper.lng2pretty(a,4).pretty}}},watch:{port:{handler(){var a,e;this.port?(this.handleRender(),(a=this.map)==null||a.on("click",[this.layer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.layer],this.handleClick))}}},methods:{handleClick(a){var o;const e=a.features[0],t=(o=this.port)==null?void 0:o.features.filter(i=>{var s;return i.properties.id===((s=e==null?void 0:e.properties)==null?void 0:s.id)})[0];if(t){this.showPort=!0,this.form={...t.properties},this.form.lng=t.geometry.coordinates[0],this.form.lat=t.geometry.coordinates[1];const i=document.getElementById("port-info");this.marker?this.marker.setLngLat([a.lngLat.lng,a.lngLat.lat]):this.marker=new U.Marker(i).setLngLat([a.lngLat.lng,a.lngLat.lat]).setOffset([0,-85]).addTo(this.map)}},handleEmit(){this.$emit("port",this.form)},handleRender(){var a;this.map?this.port&&(this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(this.port):(this.map.addSource(this.source,{type:"geojson",data:this.port}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"port","text-anchor":"left","text-field":"{name}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[1,0]},paint:{"text-color":"rgba(0, 0, 0, 0.8)","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.showPort=!1,this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},Ua={id:"port-info"},Za={class:"port-box"},Ga={class:"flex-start"},Ja={class:"flex-start"},Xa={class:"flex-start"},qa={class:"flex-start",style:{"align-items":"flex-start"}};function Ya(a,e,t,o,i,s){return r.withDirectives((r.openBlock(),r.createElementBlock("div",Ua,[r.createElementVNode("div",{class:"close iconfont",onClick:e[0]||(e[0]=l=>i.showPort=!1)},""),r.createElementVNode("div",Za,[r.createElementVNode("div",Ga,[e[2]||(e[2]=r.createElementVNode("label",null,"Name : ",-1)),r.createElementVNode("span",{onClick:e[1]||(e[1]=(...l)=>s.handleEmit&&s.handleEmit(...l))},r.toDisplayString(i.form.name),1)]),r.createElementVNode("div",Ja,[e[3]||(e[3]=r.createElementVNode("label",null,"Position : ",-1)),r.createElementVNode("span",null,r.toDisplayString(s.computeLat(i.form.lat))+", "+r.toDisplayString(s.computeLng(i.form.lng)),1)]),r.createElementVNode("div",Xa,[e[4]||(e[4]=r.createElementVNode("label",null,"LoCode : ",-1)),r.createElementVNode("span",null,r.toDisplayString(i.form.loCode||"-"),1)]),r.createElementVNode("div",qa,[e[5]||(e[5]=r.createElementVNode("label",null,"Region : ",-1)),r.createElementVNode("span",null,r.toDisplayString(i.form.city||"-")+", "+r.toDisplayString(i.form.country||"-"),1)])])],512)),[[r.vShow,i.showPort]])}const Qa=C(Ha,[["render",Ya],["__scopeId","data-v-4ab013cc"]]),Ka={name:"IdmLoadLine",props:{map:{type:Object},line:{type:Object},beforeLayer:{type:String}},data(){return{source:"load-line-source",lineLayer:"load-line-layer",lineLabelLayer:"load-line-label-layer"}},watch:{line:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.line&&(this.map.addSource(this.source,{type:"geojson",data:this.line}),this.map.addLayer({id:this.lineLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.75,"fill-color":["match",["get","val"],"LLGreen","#A0C0C0","LLRed","#F5A39D","LLBlue","#6B94E4","#ffffff"]}},this.beforeLayer),this.map.addLayer({id:this.lineLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{lbl} (Length < {shipLength}, {start} - {end})","text-rotation-alignment":"viewport","text-offset":[0,1],"text-size":10,"text-allow-overlap":!0},paint:{"text-opacity":.8}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.lineLayer)&&this.map.removeLayer(this.lineLayer),this.map.getLayer(this.lineLabelLayer)&&this.map.removeLayer(this.lineLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function er(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const tr=C(Ka,[["render",er]]),ar={name:"IdmTimezone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"time-zone-source",zoneLayer:"time-zone-layer",zoneLabelLayer:"time-zone-label-layer"}},watch:{zone:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.zone&&(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":["match",["get","offSet"],"-11.5","rgba(255,0,0,0.4)","-11","rgba(0,255,0,0.3)","-10.5","rgba(0,255,0,0.3)","-10","rgba(0,0,255,0.3)","-9.5","rgba(0,0,255,0.3)","-9","rgba(255,0,0,0.4)","-8.5","rgba(255,0,0,0.4)","-8","rgba(0,255,0,0.3)","-7.5","rgba(0,255,0,0.3)","-7","rgba(0,0,255,0.3)","-6.5","rgba(0,0,255,0.3)","-6","rgba(255,0,0,0.4)","-5.5","rgba(255,0,0,0.4)","-5","rgba(0,255,0,0.3)","-4.5","rgba(0,255,0,0.3)","-4","rgba(0,0,255,0.3)","-3.5","rgba(0,0,255,0.3)","-3","rgba(255,0,0,0.4)","-2.5","rgba(255,0,0,0.4)","-2","rgba(0,255,0,0.3)","-1.5","rgba(0,255,0,0.3)","-1","rgba(0,0,255,0.3)","-0.5","rgba(0,0,255,0.3)","+0","rgba(255,0,0,0.4)","+0.5","rgba(255,0,0,0.4)","+1","rgba(0,255,0,0.3)","+1.5","rgba(0,255,0,0.3)","+2","rgba(0,0,255,0.3)","+2.5","rgba(0,0,255,0.3)","+3","rgba(255,0,0,0.4)","+3.5","rgba(255,0,0,0.4)","+4","rgba(0,255,0,0.3)","+4.5","rgba(0,255,0,0.3)","+5","rgba(0,0,255,0.3)","+5.5","rgba(0,0,255,0.3)","+6","rgba(255,0,0,0.4)","+6.5","rgba(255,0,0,0.4)","+7","rgba(0,255,0,0.3)","+7.5","rgba(0,255,0,0.3)","+8","rgba(0,0,255,0.3)","+8.5","rgba(0,0,255,0.3)","+9","rgba(255,0,0,0.4)","+9.5","rgba(255,0,0,0.4)","+10","rgba(0,255,0,0.3)","+10.5","rgba(0,255,0,0.3)","+11","rgba(0,0,255,0.3)","+11.5","rgba(0,0,255,0.3)","rgba(255,0,0,0.4)"]}}),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{offSet}","text-rotation-alignment":"viewport","text-size":12,"text-offset":[0,1]},paint:{"text-opacity":.8,"text-color":"#fff"}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function rr(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const ir=C(ar,[["render",rr]]),or={name:"IdmVoluntaryReportingArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"vra-source",areaLayer:"vra-layer",areaLabelLayer:"vra-label-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":"#9f30f9"}},this.beforeLayer),this.map.addLayer({id:this.areaLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":1,"line-color":"#9f30f9"}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLayer+"-border")&&this.map.removeLayer(this.areaLayer+"-border"),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function sr(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const nr=C(or,[["render",sr]]),lr={name:"IdmSpecialArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"special-area-source",areaLayer:"special-area-layer",areaLabelLayer:"special-area-label-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.area.features.forEach(a=>{a.geometry.type==="Polygon"&&a.geometry.coordinates.forEach(e=>S.LngLatHelper.convertToMonotonicLng2(e))}),this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":["match",["get","val"],"DefaultStyle","rgb(0,0,0)","JWCriskArea","rgb(0,0,0)","rgb(0,0,0)"]}},this.beforeLayer),this.map.addLayer({id:this.areaLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":.4,"line-color":"rgb(0,0,0)"}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLayer+"-border")&&this.map.removeLayer(this.areaLayer+"-border"),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function cr(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const hr=C(lr,[["render",cr]]),dr={name:"IdmTerminator",props:{map:{type:Object},area:{type:Object}},data(){return{source:"terminator-source",layer:"terminator-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.layer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":"rgba(0, 0, 0, 0.4)"}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function mr(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const pr=C(dr,[["render",mr]]),Ur="",yr={name:"IdmLatLng",props:{map:{type:Object},show:{type:Boolean},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{lngLat:void 0,source:"idm-lat-lng-source",layer:"idm-lat-lng-layer",labelLayer:"idm-lat-lng-label-layer",right:10}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){var a;this.map&&((a=this.map)==null||a.on("mousemove",this.handleMouseMove))},immediate:!0},toggleVersion:{handler(){var a,e,t;this.right=(((a=document.getElementsByClassName("legend-bars")[0])==null?void 0:a.clientWidth)||-10)+(((e=document.getElementsByClassName("available-layers-show")[0])==null?void 0:e.clientWidth)||0)+(((t=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:t.clientWidth)||0)+20},immediate:!0}},methods:{handleBind(){var a,e;this.show?((a=this.map)==null||a.on("zoomend",this.handleZoomEnd),this.handleRender()):(this.handleClear(),(e=this.map)==null||e.off("zoomend",this.handleZoomEnd))},handleMouseMove(a){const e=a.lngLat,t=S.LngLatHelper.lng2pretty(e.lng,2),o=S.LngLatHelper.lat2pretty(e.lat,2);this.lngLat={lng:t,lat:o}},handleComputeLatLngs(){var o;const a=(o=this.map)==null?void 0:o.getZoom();console.log(a);let e=30;a>4?e=10:a>3&&(e=15);const t=[];for(let i=-60;i<90;i+=e)t.push({type:"Feature",geometry:{type:"LineString",coordinates:[[-180,i],[180,i]]}});for(let i=-180;i<180;i+=e)t.push({type:"Feature",geometry:{type:"LineString",coordinates:[[i,-90],[i,90]]}});for(let i=180;i>-180;i-=e)for(let s=-60;s<90;s+=e)t.push({type:"Feature",geometry:{type:"Point",coordinates:[i,s]},properties:{val:`${s>0?s+" N":s===0?s:s*-1+" S"}, ${i>0?i+" E":i*-1+" W"}`}});return t},handleZoomEnd(){var e;const a=this.handleComputeLatLngs();(e=this.map)==null||e.getSource(this.source).setData(x.featureCollection(a))},handleRender(){if(this.map){const a=this.handleComputeLatLngs();this.map.addSource(this.source,{type:"geojson",data:{type:"FeatureCollection",features:a}}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"rgba(0, 0, 0, 0.3)","line-width":1}}),this.map.addLayer({id:this.labelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{val}","text-rotation-alignment":"viewport","text-offset":[0,1],"text-size":10,"text-allow-overlap":!0},paint:{"text-opacity":.8}})}},handleClear(){var a,e,t,o,i,s;(a=this.map)!=null&&a.getLayer(this.layer)&&((e=this.map)==null||e.removeLayer(this.layer)),(t=this.map)!=null&&t.getLayer(this.labelLayer)&&((o=this.map)==null||o.removeLayer(this.labelLayer)),(i=this.map)!=null&&i.getSource(this.source)&&((s=this.map)==null||s.removeSource(this.source))}}};function ur(a,e,t,o,i,s){return i.lngLat?(r.openBlock(),r.createElementBlock("div",{key:0,class:"lat-lng-tip",style:r.normalizeStyle({right:i.right+"px",bottom:t.bottom})},[r.createElementVNode("span",null,r.toDisplayString(i.lngLat.lat.pretty),1),e[0]||(e[0]=r.createElementVNode("span",null,", ",-1)),r.createElementVNode("span",null,r.toDisplayString(i.lngLat.lng.pretty),1)],4)):r.createCommentVNode("",!0)}const ue=C(yr,[["render",ur],["__scopeId","data-v-7367f59b"]]),fr={name:"IdmMeasure",props:{map:{type:Object},show:{type:Boolean}},data(){return{geojson:[],source:"measure-source",layer:"measure-layer",labelLayer:"measure-label-layer",tmpSource:"measure-tmp-source",tmpLayer:"measure-tmp-layer",tmpLabelLayer:"measure-tmp-label-layer",closeMarkers:{},pointMarkers:{},tipMarker:void 0,contextmenu:void 0,navigation:"RL"}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){this.map&&this.handleBind()}}},methods:{handleBind(){var a,e,t,o,i,s,l,n,c,h;if(this.show)(a=this.map)==null||a.getCanvas().addEventListener("keydown",this.handleKeydown),(e=this.map)==null||e.on("mousemove",this.handleMove),(t=this.map)==null||t.on("dblclick",this.handleDblClick),(o=this.map)==null||o.on("click",this.handleClick),(i=this.map)==null||i.on("contextmenu",this.handleContextmenu),this.map&&(this.map.getCanvas().style.cursor="crosshair");else{(s=this.map)==null||s.getCanvas().removeEventListener("keydown",this.handleKeydown),(l=this.map)==null||l.off("mousemove",this.handleMove),(n=this.map)==null||n.off("dblclick",this.handleDblClick),(c=this.map)==null||c.off("click",this.handleClick),(h=this.map)==null||h.off("contextmenu",this.handleContextmenu);for(const d of this.geojson)this.handleClear(d,!0);this.geojson=[],this.map&&(this.map.getCanvas().style.cursor="grab")}},handleKeydown(a){if(a.key==="Shift"){this.navigation=this.navigation==="RL"?"GC":"RL";const t=this.geojson.at(-1).features.filter(o=>o.geometry.type==="Point");t.length&&(t.at(-1).properties.mode=this.navigation)}},handleDrag(a){var t,o,i,s,l,n,c,h,d,m;const e=(o=(t=a.target)==null?void 0:t._element)==null?void 0:o.id;if((e==null?void 0:e.split("-").length)===2){const g=this.geojson.filter(p=>p.id===e.split("-")[0])[0];this.pointMarkers[g.id].filter(p=>{var L;return((L=p._element)==null?void 0:L.id)===e})[0].setLngLat([(s=(i=a.target)==null?void 0:i._lngLat)==null?void 0:s.lng,(n=(l=a.target)==null?void 0:l._lngLat)==null?void 0:n.lat]);let u;g.features.forEach((p,L)=>{if(p.geometry.type==="Point"&&p.properties.id==e.split("-")[1]){u=L;return}});const f=g.features.filter(p=>p.geometry.type==="Point");this.handleTmpPointUpdate(g,f[u-1],{lng:(h=(c=a.target)==null?void 0:c._lngLat)==null?void 0:h.lng,lat:(m=(d=a.target)==null?void 0:d._lngLat)==null?void 0:m.lat,properties:f[u].properties},u===f.length-1?void 0:f[u+1])}},handleDragEnd(a){var t,o,i,s,l,n,c,h,d,m;const e=(o=(t=a.target)==null?void 0:t._element)==null?void 0:o.id;if((e==null?void 0:e.split("-").length)===2){const g=this.geojson.filter(f=>f.id===e.split("-")[0])[0];this.pointMarkers[g.id].filter(f=>{var p;return((p=f._element)==null?void 0:p.id)===e})[0].setLngLat([(s=(i=a.target)==null?void 0:i._lngLat)==null?void 0:s.lng,(n=(l=a.target)==null?void 0:l._lngLat)==null?void 0:n.lat]);const u=g.features.filter(f=>f.geometry.type==="Point"&&f.properties.id==e.split("-")[1])[0];u.geometry.coordinates=[(h=(c=a.target)==null?void 0:c._lngLat)==null?void 0:h.lng,(m=(d=a.target)==null?void 0:d._lngLat)==null?void 0:m.lat],g.features=g.features.filter(f=>f.geometry.type==="Point"),this.handlePointUpdate(g)}},handleContextmenu(a){var t,o,i,s;a.preventDefault(),(t=this.contextmenu)==null||t.remove();const e=(s=(i=(o=a.originalEvent)==null?void 0:o.target)==null?void 0:i.parentElement)==null?void 0:s.id;if((e==null?void 0:e.split("-").length)===2){const n=this.geojson.filter(c=>c.id===e.split("-")[0])[0].features.filter(c=>c.geometry.type==="Point");if(n.length>2&&n.filter(h=>h.properties.id===(e==null?void 0:e.split("-")[1]))[0]){const h=document.createElement("div");h.className="point-contextmenu-marker",h.innerHTML=`Del`,this.contextmenu=new U.Marker(h).setOffset([24,0]).setLngLat([a.lngLat.lng,a.lngLat.lat]).addTo(this.map)}}},handleClick(a){var t,o,i,s,l;(t=this.contextmenu)==null||t.remove();const e=a.originalEvent.target.className;if(e==="marker-close"){const n=(i=(o=a.originalEvent)==null?void 0:o.srcElement)==null?void 0:i.id,c=this.geojson.filter(h=>h.id===n)[0];c&&this.handleClear(c,!0),this.geojson=this.geojson.filter(h=>h.id!==n)}else if(e==="del-point"){const n=(l=(s=a.originalEvent.target.id)==null?void 0:s.replace("del-",""))==null?void 0:l.split("-"),c=this.geojson.filter(h=>h.id===n[0])[0];c.features=c.features.filter(h=>h.geometry.type==="Point"&&h.properties.id!==n[1]),this.handlePointUpdate(c)}else if(e!=="marker-label"){let n=this.geojson.at(-1);n||(n=x.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(n)),n.features=n.features.filter(h=>h.geometry.type==="Point");const c=x.feature({type:"Point",coordinates:[a.lngLat.lng,a.lngLat.lat]},{id:new Date().getTime().toString(),mode:this.navigation});n.features.push(c),this.handlePointUpdate(n)}},handlePointUpdate(a){const e=a.features;if(e.length>1){let t=0;const o=[];for(let i=1;i[u.lng,u.lat]));y.properties.dist=d,y.properties.bearing=m,y.properties.total=t,o.push(y)}e.push(...o),a.total=t}return this.handleRender(a),a},handleTmpPointUpdate(a,e,t,o){const i=x.featureCollection([]);let s,l;if(e){const c=e.properties,h={lng:e.geometry.coordinates[0],lat:e.geometry.coordinates[1]},d={lng:t.lng,lat:t.lat};s=S.LaneHelper.calculateDistance(h,d,c.mode==="RL",2),l=S.LaneHelper.calculateBearing(h,d,c.mode==="RL",2);let m;c.mode==="RL"?m=S.LngLatHelper.convertToMonotonicLng([h,d]):m=S.LngLatHelper.convertToMonotonicLng(S.LaneHelper.interpolateCoordinates(h,d,200));const g=x.lineString(m.map(y=>[y.lng,y.lat]));g.properties.dist=s,g.properties.bearing=l,i.features.push(g)}if(o){const c=t.properties,h=t,d={lng:o.geometry.coordinates[0],lat:o.geometry.coordinates[1]};s=S.LaneHelper.calculateDistance(h,d,c.mode==="RL",2),l=S.LaneHelper.calculateBearing(h,d,c.mode==="RL",2);let m;c.mode==="RL"?m=S.LngLatHelper.convertToMonotonicLng([h,d]):m=S.LngLatHelper.convertToMonotonicLng(S.LaneHelper.interpolateCoordinates(h,d,200));const g=x.lineString(m.map(y=>[y.lng,y.lat]));g.properties.dist=s,g.properties.bearing=l,i.features.push(g)}this.map.getSource(this.tmpSource)?this.map.getSource(this.tmpSource).setData(i):this.map.addSource(this.tmpSource,{type:"geojson",data:i}),this.map.getLayer(this.tmpLayer)||this.map.addLayer({id:this.tmpLayer,type:"line",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#F44336","line-width":2,"line-opacity":1,"line-dasharray":[3,2]}}),this.map.getLayer(this.tmpLabelLayer)||this.map.addLayer({id:this.tmpLabelLayer,type:"symbol",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist} nm","text-rotation-alignment":"map","text-size":12},paint:{"text-opacity":1,"text-color":"#fff","text-halo-color":"#F44336","text-halo-width":4,"text-halo-blur":0}});let n;if(o?n='
Drag and drop
':n=`
Tol distance: ${S.LngLatHelper.roundPrecision((a.total??0)+s,2)}nm, bearing: ${l}°
${this.navigation==="RL"?"RL":"GC"} mode, using 'Shift' to switch
Double click to end
`,this.tipMarker)this.tipMarker._element.innerHTML=n,this.tipMarker.setLngLat([t.lng,t.lat]);else{const c=document.createElement("div");c.className="tip-marker",c.innerHTML=n,this.tipMarker=new U.Marker(c).setOffset([140,0]).setLngLat([t.lng,t.lat]).addTo(this.map)}},handleMove(a){this.map.getCanvas().style.cursor="crosshair";let e=this.geojson.at(-1);e||(e=x.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e));const t=e.features.filter(o=>o.geometry.type==="Point");t!=null&&t.length&&this.handleTmpPointUpdate(e,t.at(-1),{lng:a.lngLat.lng,lat:a.lngLat.lat})},handleDblClick(a){a.preventDefault();let e=this.geojson.at(-1);e.closed=!0,this.handleRender(e),e=x.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e)},handleRender(a){var e;if((e=a==null?void 0:a.features)!=null&&e.length){const t=`${a.id}-${this.source}`,o=`${a.id}-${this.layer}`,i=`${a.id}-${this.labelLayer}`;this.map.getSource(t)?this.map.getSource(t).setData(a):this.map.addSource(t,{type:"geojson",data:a}),this.handleClear(a,!1),this.map.addLayer({id:o,type:"line",source:t,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#F44336","line-width":2}}),this.map.addLayer({id:i,type:"symbol",source:t,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist}nm,{bearing}°","text-rotation-alignment":"map","text-size":12},paint:{"text-opacity":1,"text-color":"#fff","text-halo-color":"#F44336","text-halo-width":4,"text-halo-blur":0}});const s=a.features.filter(l=>l.geometry.type==="Point");for(const l of s){const n=document.createElement("div");n.id=`${a.id}-${l.properties.id}`,n.className=`${a.closed?"point-marker closed":"point-marker"}`,n.innerHTML='
';const c=new U.Marker({element:n,draggable:!0,contextmenu:!0}).setLngLat(l.geometry.coordinates).addTo(this.map);c.on("drag",this.handleDrag),c.on("dragend",this.handleDragEnd),this.pointMarkers[a.id]?this.pointMarkers[a.id].push(c):this.pointMarkers[a.id]=[c]}if(a.closed){const l=s.at(-1),c=a.features.filter(d=>d.geometry.type==="LineString").at(-1),h=document.createElement("div");h.className="point-summary-marker",h.innerHTML=`
×
Tol: ${c.properties.total}nm
`,this.closeMarkers[a.id]=new U.Marker(h).setOffset([60,0]).setLngLat(l.geometry.coordinates).addTo(this.map)}}},handleClear(a,e=!0){var s,l,n,c,h,d,m,g,y;const t=`${a.id}-${this.source}`,o=`${a.id}-${this.layer}`,i=`${a.id}-${this.labelLayer}`;(s=this.map)!=null&&s.getLayer(o)&&this.map.removeLayer(o),(l=this.map)!=null&&l.getLayer(i)&&this.map.removeLayer(i),(n=this.map)!=null&&n.getLayer(this.tmpLayer)&&this.map.removeLayer(this.tmpLayer),(c=this.map)!=null&&c.getLayer(this.tmpLabelLayer)&&this.map.removeLayer(this.tmpLabelLayer),(h=this.closeMarkers[a.id])==null||h.remove(),this.closeMarkers[a.id]=void 0,(d=this.pointMarkers[a.id])==null||d.forEach(u=>{u==null||u.remove()}),this.pointMarkers[a.id]=[],(m=this.tipMarker)==null||m.remove(),this.tipMarker=void 0,e&&((g=this.map)!=null&&g.getSource(t))&&this.map.removeSource(t),e&&((y=this.map)!=null&&y.getSource(this.tmpSource))&&this.map.removeSource(this.tmpSource)}}};function gr(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const br=C(fr,[["render",gr]]),Zr="",Lr={name:"IdmENC",props:{map:{type:Object},enabled:{type:Boolean},beforeLayer:{type:String,default:"grayland"},bottom:{type:String,default:"260px"},token:{type:String,default:""},toggleVersion:{type:Number},permission:{type:Number}},emits:["enc"],data(){return{helper:z.CompanyHelper,vendor:this.$attrs.permission&z.CompanyHelper.LEVEL.Supper?"hi":"i4",right:10}},watch:{vendor:{handler(){this.$emit("enc",this.vendor)},immediate:!0},toggleVersion:{handler(){var a,e;this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0}},methods:{}},wr={key:0},vr={class:"bar-item"};function xr(a,e,t,o,i,s){return t.enabled&&t.permission&i.helper.LEVEL.Supper?(r.openBlock(),r.createElementBlock("div",wr,[r.createElementVNode("div",{class:"menu-bar-box",style:r.normalizeStyle({position:"absolute",right:i.right+"px",bottom:t.bottom})},[r.createElementVNode("div",vr,[r.createElementVNode("div",{class:r.normalizeClass(i.vendor==="hi"?"menu-icon active":"menu-icon"),onClick:e[0]||(e[0]=l=>i.vendor="hi")},e[2]||(e[2]=[r.createElementVNode("span",{class:"iconfont"},"HI",-1)]),2),r.createElementVNode("div",{class:r.normalizeClass(i.vendor==="i4"?"menu-icon active":"menu-icon"),onClick:e[1]||(e[1]=l=>i.vendor="i4")},e[3]||(e[3]=[r.createElementVNode("span",{class:"iconfont"},"I4",-1)]),2)])],4)])):r.createCommentVNode("",!0)}const _r=C(Lr,[["render",xr],["__scopeId","data-v-ab627b83"]]),Gr="",Cr={name:"IdmGLV2",components:{IdmGlLayer:Ue,IdmWindBarb:Ke,IdmWindParticle:rt,IdmCurrents:dt,IdmCurrentParticle:ut,IdmSigWave:bt,IdmSwell:vt,IdmPrmsl:Ct,IdmIceberg:St,IdmTropicals:ye,IdmPrecip3h:Jt,IdmVisibility:Qt,IdmWaterTemp:aa,IdmTemp:sa,IdmArctic:ha,IdmWarZone:Da,IdmGmdssArea:Ia,IdmEcaZone:Ma,IdmAlertZone:$a,IdmPort:Qa,IdmLoadLine:tr,IdmTimezone:ir,IdmVRA:nr,IdmSpecialArea:hr,IdmTerminator:pr,IdmLatLng:ue,IdmMeasure:br,IdmPoint:Pa,IdmENC:_r},props:{map:{type:Object,default:void 0},token:{type:String},ts:{type:String},beforeLayer:{type:String,default:""}},data(){return{weatherLayers:{},activeWeatherLayers:[],weatherWeight:0,otherLayers:{},otherWeight:0,showCoord:!1,showMeasure:!1,showPoint:!1,show3d:!1,meteo:void 0,source:"",gateway:"https://cbe.idmwx.com",mapProjection:"mercator",zoom:6,viewport:void 0,particleFactor:void 0,showRampColor:!1,activeWindLayer:!1,showWindParticle:!1,showCurrentParticle:!1,toggleVersion:0,enc:"",defaultMeteoToken:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNseTVudHJzYzAwNWUwbHBsZHkyaDRqczMiLCJyb2xlIjoxLCJuYW1lIjoiZmFrZUBvcm13eC5jb20iLCJwbGF0SWQiOiJnZDBtdDFkIiwiY29tcGFueSI6eyJpZCI6bnVsbCwiY2hpbGRyZW4iOltdfSwiaWF0IjoxNzIzMDI0MDI0LCJleHAiOjM5MzA1NDQwMjR9.RrKcdcMnq-FxBLJQ-i6lx2FscDE46y8EvHIemPW4HTg",helper:new ge}},watch:{ts:{handler(a,e){a&&e&&M(a).utc().format("yyyy-MM-DD HH")!==M(e).utc().format("yyyy-MM-DD HH")&&this.$nextTick(()=>{this.handleDateChange({tropicals:!1})})},immediate:!0},map:{handler(){this.map&&(this.map.on("zoomend",this.handleDragEndWithZoom4Json),this.map.on("dragend",this.handleDragEndWithZoom4Json),this.map.on("move",this.handleDragEndWithZoom4Image),this.viewport=new pe(this.map),this.handleRampColorInitial())},immediate:!0},enc:{handler(a,e){var t,o,i,s,l,n,c,h;a?((o=(t=this.map)==null?void 0:t.getLayer(a))==null||o.setLayoutProperty("visibility","visible"),(s=(i=this.map)==null?void 0:i.getLayer(e))==null||s.setLayoutProperty("visibility","none")):((n=(l=this.map)==null?void 0:l.getLayer("i4"))==null||n.setLayoutProperty("visibility","none"),(h=(c=this.map)==null?void 0:c.getLayer("hi"))==null||h.setLayoutProperty("visibility","none"))}},activeWeatherLayers:{handler(){var a,e,t,o,i,s,l,n,c,h,d,m,g,y,u,f,p,L;if(!this.map)return!1;this.activeWeatherLayers.length>0?((e=(a=this.map)==null?void 0:a.getLayer(this.enc))==null||e.setLayoutProperty("visibility","none"),(o=(t=this.map)==null?void 0:t.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))==null||o.setLayoutProperty("visibility","visible"),(s=this.map)!=null&&s.getLayer((i=this.viewport)==null?void 0:i.rampColorLayer)&&((l=this.map)!=null&&l.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&this.mapProjection==="mercator"&&((c=this.map)==null||c.moveLayer((n=this.viewport)==null?void 0:n.rampColorLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)),(d=this.map)!=null&&d.getLayer((h=this.viewport)==null?void 0:h.particleLayer)&&((m=this.map)!=null&&m.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&this.mapProjection==="mercator"&&((y=this.map)==null||y.moveLayer((g=this.viewport)==null?void 0:g.particleLayer,this.helper.mapboxCustomer.layers.countryBoundary.id))):((f=(u=this.map)==null?void 0:u.getLayer(this.enc))==null||f.setLayoutProperty("visibility","visible"),(L=(p=this.map)==null?void 0:p.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))==null||L.setLayoutProperty("visibility","none"))},immediate:!0}},methods:{async fetchWeatherLayers(a={tropicals:!1}){var i,s,l,n,c,h,d,m;const e=new Date().valueOf();let t=0,o=0;if(this.map){const g=((i=this.map)==null?void 0:i.getZoom())+1,y=(s=this.map)==null?void 0:s.getBounds(),u=`${y._sw.lng},${y._sw.lat},${y._ne.lng},${y._ne.lat}`;if(this.handleRampColorState(),this.particleFactor){const f=z.LayerHelper.WEATHER_LAYERS.find(p=>{var L;return((L=p.peer)==null?void 0:L.weight)===this.particleFactor.weight});this.particleFactor.particle?this.weatherWeight=this.weatherWeight&f.weight?this.weatherWeight:this.weatherWeight+f.weight:this.weatherWeight=this.weatherWeight&f.weight?this.weatherWeight-f.weight:this.weatherWeight}if(this.weatherWeight>0){let f=this.weatherWeight,p;if(a.tropicals||this.weatherWeight&256&&(p=this.weatherLayers.tropicals,p&&(f-=256,p.version=Math.random()+1)),f>0){const L=await Z.get(`${this.gateway}/api/arc/weather/layers/links?l=${f}&v=${this.source}&z=${g}&bbox=${u}&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(o=new Date().valueOf()-(e+t),console.log("weather links elapsed: ",o,", total: ",t+=o),((l=L==null?void 0:L.data)==null?void 0:l.code)===0){const b=(n=L==null?void 0:L.data)==null?void 0:n.data,v=[];for(const w in b)w==="ice-edge"&&(b[w]="https://idm-hz.oss-cn-hangzhou.aliyuncs.com/test/sea_ice_contours.geojson"),w!=="tropicals"&&v.push(Z.get(b[w],{headers:{Authorization:this.token||this.defaultMeteoToken,key:w},responseType:/\.(jpg|png)$/.test(b[w])?"blob":"json"}).catch(N=>{console.log(`[${w}] fetch layer error: ${N}`)}));const _=await Promise.all(v);this.weatherLayers={},_.map(w=>{var V,I,B,W;const N=((V=w==null?void 0:w.data)==null?void 0:V.data)||(w==null?void 0:w.data),T=(B=(I=w==null?void 0:w.config)==null?void 0:I.headers)==null?void 0:B.key;T&&N&&(this.weatherLayers[T]={raw:N,type:((W=w==null?void 0:w.config)==null?void 0:W.responseType)==="blob"?"image":"json",etime:this.ts})}),b.tropicals&&Z.get(b.tropicals,{headers:{Authorization:this.token||this.defaultMeteoToken,key:"tropicals"}}).then(w=>{var V,I,B;const N=S.TropicalHelper.convert2Geojson(((V=w==null?void 0:w.data)==null?void 0:V.data)||(w==null?void 0:w.data)),T=(B=(I=w==null?void 0:w.config)==null?void 0:I.headers)==null?void 0:B.key;this.weatherLayers[T]={data:N,active:!0,cached:!1,type:"json",etime:this.ts,version:Math.random()+1}})}if(o=new Date().valueOf()-(e+t),console.log("weather layers elapsed: ",o,", total: ",t+=o),this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const b=(c=this.weatherLayers["swell-direction"])==null?void 0:c.raw,v=(h=this.weatherLayers["swell-height"])==null?void 0:h.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers.swell={type:"json",direction:b,height:{raw:v},etime:this.ts}}if(this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const b=(d=this.weatherLayers["current-direction"])==null?void 0:d.raw,v=(m=this.weatherLayers["current-speed"])==null?void 0:m.raw;delete this.weatherLayers["current-direction"],delete this.weatherLayers["current-speed"],this.weatherLayers.current={type:"json",direction:b,speed:{raw:v},etime:this.ts}}}p&&(p.etime=this.ts,p.cached=!0,this.weatherLayers.tropicals=p)}this.handleWeatherLayerToggle(),this.handleDragEndWithZoom4Json()}this.toggleVersion=Math.random()},async fetchOtherLayers(a={all:!1,dayNight:!1,enc:!1}){var e,t,o,i;if(this.map){let s=this.otherWeight;if(s){let l=!1;if(this.otherWeight&2048&&(s=this.otherWeight-2048,l=!0),s){if(a.all){const n=await Z.get(`${this.gateway}/api/arc/other/layers/links?l=${s}&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(((e=n==null?void 0:n.data)==null?void 0:e.code)===0){const c=(t=n==null?void 0:n.data)==null?void 0:t.data,h=[];for(const m in c)h.push(Z.get(c[m],{headers:{Authorization:this.token||this.defaultMeteoToken,key:m}}));const d=await Promise.all(h);this.otherLayers={enc:l},d.map(m=>{var u,f,p;const g=((u=m==null?void 0:m.data)==null?void 0:u.data)||(m==null?void 0:m.data),y=(p=(f=m==null?void 0:m.config)==null?void 0:f.headers)==null?void 0:p.key;this.otherLayers[y]=g})}}else if(a.dayNight&&s&1024){const n=await Z.get(`${this.gateway}/api/arc/other/layers/links?l=1024&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(((o=n==null?void 0:n.data)==null?void 0:o.code)===0){const c=(i=n==null?void 0:n.data)==null?void 0:i.data,h=[];for(const m in c)h.push(Z.get(c[m],{headers:{Authorization:this.token||this.defaultMeteoToken,key:m}}));(await Promise.all(h)).map(m=>{var u,f,p;const g=((u=m==null?void 0:m.data)==null?void 0:u.data)||(m==null?void 0:m.data),y=(p=(f=m==null?void 0:m.config)==null?void 0:f.headers)==null?void 0:p.key;this.otherLayers[y]=g})}}}else this.otherLayers={enc:l}}else this.otherLayers={};this.handleBeforeLayerToggle()}},handleRampColorState(){var a;if(this.showRampColor=!1,this.showWindParticle=!1,this.showCurrentParticle=!1,(a=this.particleFactor)!=null&&a.particle)this.showRampColor=!0,this.showWindParticle=this.particleFactor.key==="wind",this.showCurrentParticle=this.particleFactor.key==="current",this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.type==="json");else for(const e of this.activeWeatherLayers)["png","jpg"].includes(e.type)&&(this.showRampColor=!0);this.activeWindLayer=!!this.activeWeatherLayers.find(e=>e.key==="wind"),this.$refs.layer&&(this.$refs.layer.activeWeatherLayers=this.activeWeatherLayers)},handleRampColorInitial(){var a,e,t,o,i,s,l,n,c,h,d,m;this.viewport.map.getSource((a=this.viewport)==null?void 0:a.rampColorSource)||this.viewport.map.addSource((e=this.viewport)==null?void 0:e.rampColorSource,{type:"canvas",canvas:(t=this.viewport)==null?void 0:t.rampColorCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((o=this.viewport)==null?void 0:o.rampColorLayer)||this.viewport.map.addLayer({type:"raster",id:(i=this.viewport)==null?void 0:i.rampColorLayer,source:(s=this.viewport)==null?void 0:s.rampColorSource,layout:{visibility:"none"}},this.beforeLayer),this.viewport.map.getSource((l=this.viewport)==null?void 0:l.particleSource)||this.viewport.map.addSource((n=this.viewport)==null?void 0:n.particleSource,{type:"canvas",canvas:(c=this.viewport)==null?void 0:c.particleCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((h=this.viewport)==null?void 0:h.particleLayer)||this.viewport.map.addLayer({type:"raster",id:(d=this.viewport)==null?void 0:d.particleLayer,source:(m=this.viewport)==null?void 0:m.particleSource,layout:{visibility:"none"}},this.beforeLayer)},handleDragEndWithZoom4Json(){var h,d,m,g;const a=new Date().valueOf();let e=0,t=0;const o=(h=this.map)==null?void 0:h.getBounds(),i=this.map.getZoom(),s=z.convertToStandardLng(o._sw.lng),l=z.convertToStandardLng(o._ne.lng),n=Math.floor(o._sw.lat),c=Math.ceil(o._ne.lat);for(const y in this.weatherLayers)if(this.weatherLayers[y].active&&this.weatherLayers[y].type==="json"){this.weatherLayers[y].active=!1,this.weatherLayers[y].version=Math.random()+1;let u=[];if(["swell","current"].includes(y)){const f=((d=this.weatherLayers[y])==null?void 0:d.direction)||{};for(const p in f)if(p>n&&pl?L.forEach((b,v)=>{var _;if((b>=s&&b<=180||b>=-180&&b<=l)&&(!(i<=this.zoom)||b%(i{var _;if(b>=s&&b<=l&&(!(i<=this.zoom)||b%(ib.properties.val>.5):p.data.features;u=u.concat(L),t=new Date().valueOf()-(a+e),console.log("speed elapsed: ",t,", total: ",e+=t)}}}else if(y==="wind"){const f=this.weatherLayers.wind.raw;for(const p in f)if(p>n&&pl?L.forEach((b,v)=>{if((b>=s&&b<=180||b>=-180&&b<=l)&&(!(i<=this.zoom)||b%(i{if(b>=s&&b<=l&&(!(i<=this.zoom)||b%(i{b=z.convertToStandardLng(b),p.push(x.point([b,L],{val:f.Point[L].val[v],type:f.Point[L].type[v]}))});u=u.concat(p)}}t=new Date().valueOf()-(a+e),console.log("prmsl elapsed: ",t,", total: ",e+=t)}else if(y==="arctic"||y==="iceberg"){if(this.weatherLayers[y].data)u=this.weatherLayers[y].data;else{const f=this.weatherLayers[y].raw;if(f){const p=[];for(const L in f.LineString){const b=f.LineString[L];for(const v of b)p.push(x.lineString(v,{val:Number(L)}))}u=u.concat(p)}}t=new Date().valueOf()-(a+e)}console.log(y," elapsed: ",t,", total: ",e+=t),u.length&&(this.weatherLayers[y].data=x.featureCollection(u)),this.weatherLayers[y].active=!0,this.weatherLayers[y].version=Math.random()+1}},handleDragEndWithZoom4Image(){for(const a in this.weatherLayers)this.weatherLayers[a].active&&this.weatherLayers[a].type==="image"&&(this.weatherLayers[a].active=!0,this.weatherLayers[a].version=Math.random()+1)},handleBboxClip(a,e){const t=[],o=z.convertToStandardLng(e._sw.lng),i=z.convertToStandardLng(e._ne.lng);return a.features.forEach(s=>{if(s.geometry.type!=="Point")if(o>i){let l=[o,e._sw.lat,180,e._ne.lat],n=x.bboxClip(s,l);n.geometry.coordinates.length&&t.push(n),l=[-180,e._sw.lat,i,e._ne.lat],n=x.bboxClip(s,l),n.geometry.coordinates.length&&t.push(n)}else{const l=[o,e._sw.lat,i,e._ne.lat],n=x.bboxClip(s,l);n.geometry.coordinates.length&&t.push(n)}else t.push(s)}),t},handleWeatherLayerToggle(){var a;for(const e in this.weatherLayers)this.weatherLayers[e].active=!1,this.weatherLayers[e].version=Math.random()+1;for(const e of this.activeWeatherLayers){let t=e.key;t.indexOf("swell")>-1?t="swell":t.indexOf("current")>-1&&(t="current"),this.weatherLayers[t]&&(this.weatherLayers[t].active=!0,this.weatherLayers[t].version=Math.random()+1,((a=this.particleFactor)==null?void 0:a.key)===t&&this.weatherLayers[`${t}-particle`]&&(this.weatherLayers[`${t}-particle`].active=this.particleFactor.particle))}this.handleBeforeLayerToggle()},handleBeforeLayerToggle(){var a,e,t,o,i,s,l,n,c,h,d,m,g;(a=this.map)!=null&&a.getLayer(this.beforeLayer)&&((e=this.activeWeatherLayers)!=null&&e.length||(t=this.otherLayers)!=null&&t["war-zones"]||(o=this.otherLayers)!=null&&o["gmdss-areas"]||(i=this.otherLayers)!=null&&i["load-lines"]||(s=this.otherLayers)!=null&&s["high-risk-area"]||(l=this.otherLayers)!=null&&l["time-zones"]||(n=this.otherLayers)!=null&&n.pirates||(c=this.otherLayers)!=null&&c.ports||(h=this.otherLayers)!=null&&h.enc||(d=this.otherLayers)!=null&&d["voluntary-reporting-area"]||(m=this.otherLayers)!=null&&m["eca-zones"]||(g=this.otherLayers)!=null&&g["special-area"])&&this.map.setLayoutProperty(this.beforeLayer,"visibility","visible")},handleDateChange(a={tropicals:!1}){this.fetchWeatherLayers(a),this.fetchOtherLayers({dayNight:!0})},handleWeatherLayerChange(a,e,t){if(!this.map)setTimeout(()=>{this.handleWeatherLayerChange(a,e,t)},500);else{this.activeWeatherLayers=e;const o=this.activeWeatherLayers.some(l=>["wind","current"].includes(l.key)),i=this.activeWeatherLayers.some(l=>["png","jpg"].includes(l.type));o&&!i?(this.particleFactor=this.activeWeatherLayers.find(l=>["wind","current"].includes(l.key)),this.particleFactor.particle=!0):i&&this.particleFactor&&(this.particleFactor.particle=!1);const s=e==null?void 0:e.reduce((l,n)=>l+(l&(n==null?void 0:n.weight)?0:n==null?void 0:n.weight),0);this.weatherWeight!==s||this.source!==t?(this.source=t,this.weatherWeight=s,this.fetchWeatherLayers({tropicals:!1})):this.handleWeatherLayerToggle()}},handleOtherLayerChange(a){if(!this.map)setTimeout(()=>{this.handleOtherLayerChange(a)},500);else{const e=a==null?void 0:a.reduce((t,o)=>t+(o==null?void 0:o.weight),0);a.find(t=>t.key==="enc")?this.enc="i4":this.enc="",this.otherWeight!=e&&(this.otherWeight=e,this.fetchOtherLayers({all:!0}))}},async handlePointChange(a){const e=this.ts?M(this.ts):M(),t={lat:a.lat,lng:a.lng,ts:e.utc().format(),wt:!0,src:this.source},o=await Z.get(`${this.gateway}/api/arc/meteo/query`,{params:t,headers:{Authorization:this.token||this.defaultMeteoToken}});(o==null?void 0:o.status)===200&&(this.meteo={...o==null?void 0:o.data,...a})},handle3dToggle(a){var e,t,o,i,s,l,n,c,h,d,m,g,y,u,f,p,L,b,v,_;a?(this.map.setProjection("globe"),this.mapProjection="globe",(t=this.map)!=null&&t.getLayer((e=this.viewport)==null?void 0:e.rampColorLayer)&&((o=this.map)!=null&&o.getLayer(this.helper.mapboxCustomer.layers.water.id))&&((s=this.map)==null||s.moveLayer((i=this.viewport)==null?void 0:i.rampColorLayer,this.helper.mapboxCustomer.layers.water.id)),(n=this.map)!=null&&n.getLayer((l=this.viewport)==null?void 0:l.particleLayer)&&((c=this.map)!=null&&c.getLayer(this.helper.mapboxCustomer.layers.water.id))&&((d=this.map)==null||d.moveLayer((h=this.viewport)==null?void 0:h.particleLayer,this.helper.mapboxCustomer.layers.water.id)),this.map.off("zoomend",this.handleDragEndWithZoom4Json),this.map.off("dragend",this.handleDragEndWithZoom4Json),this.map.off("move",this.handleDragEndWithZoom4Image)):(this.map.setProjection("mercator"),this.mapProjection="mercator",this.map.on("zoomend",this.handleDragEndWithZoom4Json),this.map.on("dragend",this.handleDragEndWithZoom4Json),this.map.on("move",this.handleDragEndWithZoom4Image),this.handleDragEndWithZoom4Image(),this.handleDragEndWithZoom4Json(),(g=this.map)!=null&&g.getLayer((m=this.viewport)==null?void 0:m.rampColorLayer)&&((y=this.map)!=null&&y.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&((f=this.map)==null||f.moveLayer((u=this.viewport)==null?void 0:u.rampColorLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)),(L=this.map)!=null&&L.getLayer((p=this.viewport)==null?void 0:p.particleLayer)&&((b=this.map)!=null&&b.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&((_=this.map)==null||_.moveLayer((v=this.viewport)==null?void 0:v.particleLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)))},handleParticle(a){this.particleFactor=a,this.fetchWeatherLayers({tropicals:!1})}}},kr={key:0,className:"map-gl-home"};function Er(a,e,t,o,i,s){var J,O,j,oe,F,k,A,se,$,ne,X,q,Y,le,ce,he,de,me,fe,Le,we,ve,xe,_e,Ce,ke;const l=r.resolveComponent("IdmGlLayer"),n=r.resolveComponent("IdmENC"),c=r.resolveComponent("IdmSigWave"),h=r.resolveComponent("IdmSwell"),d=r.resolveComponent("IdmPrmsl"),m=r.resolveComponent("IdmIceberg"),g=r.resolveComponent("IdmTropicals"),y=r.resolveComponent("IdmCurrents"),u=r.resolveComponent("IdmCurrentParticle"),f=r.resolveComponent("IdmWindBarb"),p=r.resolveComponent("IdmWindParticle"),L=r.resolveComponent("IdmPrecip3h"),b=r.resolveComponent("IdmVisibility"),v=r.resolveComponent("IdmWaterTemp"),_=r.resolveComponent("IdmTemp"),w=r.resolveComponent("IdmArctic"),N=r.resolveComponent("IdmWarZone"),T=r.resolveComponent("IdmGmdssArea"),V=r.resolveComponent("IdmEcaZone"),I=r.resolveComponent("IdmAlertZone"),B=r.resolveComponent("IdmPort"),W=r.resolveComponent("IdmLoadLine"),Q=r.resolveComponent("IdmTimezone"),K=r.resolveComponent("IdmVRA"),ee=r.resolveComponent("IdmSpecialArea"),te=r.resolveComponent("IdmTerminator"),ae=r.resolveComponent("IdmLatLng"),re=r.resolveComponent("IdmMeasure"),ie=r.resolveComponent("IdmPoint");return t.map?(r.openBlock(),r.createElementBlock("div",kr,[r.createVNode(l,r.mergeProps({ref:"layer",map:t.map,"toggle-version":i.toggleVersion,"map-projection":i.mapProjection},a.$attrs,{onWeather:s.handleWeatherLayerChange,onOther:s.handleOtherLayerChange,onCoordinate:e[0]||(e[0]=H=>i.showCoord=H),onMeasure:e[1]||(e[1]=H=>i.showMeasure=H),onPoint:e[2]||(e[2]=H=>i.showPoint=H),on3d:s.handle3dToggle,onToggleVersion:e[3]||(e[3]=H=>i.toggleVersion=H)}),null,16,["map","toggle-version","map-projection","onWeather","onOther","on3d"]),r.createVNode(n,r.mergeProps({map:t.map,token:t.token,enabled:(J=i.otherLayers)==null?void 0:J.enc,"toggle-version":i.toggleVersion},a.$attrs,{onEnc:e[4]||(e[4]=H=>i.enc=H)}),null,16,["map","token","enabled","toggle-version"]),r.createVNode(c,r.mergeProps({map:t.map,"sig-wave":(O=i.weatherLayers)==null?void 0:O["sig-wave-height"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","sig-wave","before-layer"]),r.createVNode(h,r.mergeProps({map:t.map,swell:(j=i.weatherLayers)==null?void 0:j.swell,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","swell","before-layer"]),r.createVNode(d,r.mergeProps({map:t.map,prmsl:(oe=i.weatherLayers)==null?void 0:oe.prmsl,"before-layer":t.beforeLayer,"active-weather-layers":i.activeWeatherLayers},a.$attrs),null,16,["map","prmsl","before-layer","active-weather-layers"]),r.createVNode(m,r.mergeProps({map:t.map,iceberg:(F=i.weatherLayers)==null?void 0:F.iceberg,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","iceberg","before-layer"]),r.createVNode(g,r.mergeProps({map:t.map,date:t.ts,tropicals:(k=i.weatherLayers)==null?void 0:k.tropicals,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","date","tropicals","before-layer"]),r.createVNode(y,r.mergeProps({map:t.map,"map-projection":i.mapProjection,current:(A=i.weatherLayers)==null?void 0:A.current,"before-layer":t.beforeLayer,"show-particle":i.showCurrentParticle,"margin-bottom":i.activeWindLayer?i.showRampColor?"84px":"56px":i.showRampColor?"56px":"30px","toggle-version":i.toggleVersion,"weather-layers":i.weatherLayers},a.$attrs,{onParticle:s.handleParticle}),null,16,["map","map-projection","current","before-layer","show-particle","margin-bottom","toggle-version","weather-layers","onParticle"]),r.createVNode(u,r.mergeProps({viewport:i.viewport,factor:(se=i.weatherLayers)==null?void 0:se["current-particle"],"before-layer":t.beforeLayer,"toggle-version":i.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(f,r.mergeProps({ref:"windBarb",map:t.map,"map-projection":i.mapProjection,wind:($=i.weatherLayers)==null?void 0:$.wind,current:(ne=i.weatherLayers)==null?void 0:ne.current,"before-layer":t.beforeLayer,"margin-bottom":i.showRampColor?"56px":"30px","show-particle":i.showWindParticle},a.$attrs,{"toggle-version":i.toggleVersion,"weather-layers":i.weatherLayers,onParticle:s.handleParticle}),null,16,["map","map-projection","wind","current","before-layer","margin-bottom","show-particle","toggle-version","weather-layers","onParticle"]),r.createVNode(p,r.mergeProps({viewport:i.viewport,factor:(X=i.weatherLayers)==null?void 0:X["wind-particle"],"before-layer":t.beforeLayer,"toggle-version":i.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(L,r.mergeProps({viewport:i.viewport,factor:(q=i.weatherLayers)==null?void 0:q.precip3h,"before-layer":t.beforeLayer,"toggle-version":i.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(b,r.mergeProps({viewport:i.viewport,factor:(Y=i.weatherLayers)==null?void 0:Y.visibility,"before-layer":t.beforeLayer,"toggle-version":i.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(v,r.mergeProps({viewport:i.viewport,factor:(le=i.weatherLayers)==null?void 0:le["water-temp"],"before-layer":t.beforeLayer,"toggle-version":i.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(_,r.mergeProps({viewport:i.viewport,factor:(ce=i.weatherLayers)==null?void 0:ce.temp,"before-layer":t.beforeLayer,"toggle-version":i.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(w,r.mergeProps({viewport:i.viewport,factor:(he=i.weatherLayers)==null?void 0:he.arctic,"before-layer":t.beforeLayer,"toggle-version":i.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(N,r.mergeProps({map:t.map,zone:(de=i.otherLayers)==null?void 0:de["war-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),r.createVNode(T,r.mergeProps({map:t.map,area:(me=i.otherLayers)==null?void 0:me["gmdss-areas"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","area","before-layer"]),r.createVNode(V,r.mergeProps({map:t.map,zone:(fe=i.otherLayers)==null?void 0:fe["eca-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),r.createVNode(I,r.mergeProps({map:t.map,zone:(Le=i.otherLayers)==null?void 0:Le["alert-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),r.createVNode(B,r.mergeProps({map:t.map,port:(we=i.otherLayers)==null?void 0:we.ports,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","port","before-layer"]),r.createVNode(W,r.mergeProps({map:t.map,line:(ve=i.otherLayers)==null?void 0:ve["load-lines"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","line","before-layer"]),r.createVNode(Q,r.mergeProps({map:t.map,zone:(xe=i.otherLayers)==null?void 0:xe["time-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),r.createVNode(K,r.mergeProps({map:t.map,area:(_e=i.otherLayers)==null?void 0:_e["voluntary-reporting-area"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","area","before-layer"]),r.createVNode(ee,r.mergeProps({map:t.map,area:(Ce=i.otherLayers)==null?void 0:Ce["special-area"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","area","before-layer"]),r.createVNode(te,r.mergeProps({map:t.map,area:(ke=i.otherLayers)==null?void 0:ke["day-night"]},a.$attrs),null,16,["map","area"]),r.createVNode(ae,r.mergeProps({map:t.map,show:i.showCoord,"toggle-version":i.toggleVersion},a.$attrs),null,16,["map","show","toggle-version"]),r.createVNode(re,r.mergeProps({map:t.map,show:i.showMeasure},a.$attrs),null,16,["map","show"]),r.createVNode(ie,r.mergeProps({map:t.map,show:i.showPoint,meteo:i.meteo},a.$attrs,{onPoint:s.handlePointChange}),null,16,["map","show","meteo","onPoint"])])):r.createCommentVNode("",!0)}const be=C(Cr,[["render",Er]]),Sr={install(a){a.component("MapboxGL",be),a.component("TropicalGL",ye),a.component("LatLngGL",ue)}};E.LatLngGL=ue,E.MapboxGL=be,E.MapboxGLPlugin=Sr,E.MapboxHelper=ge,E.ParticleSchema=R,E.TropicalGL=ye,E.Viewport=pe,E.WebGL=G,E.WebGLSchema=D,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});