(function(k,C){typeof exports=="object"&&typeof module<"u"?C(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"],C):(k=typeof globalThis<"u"?globalThis:k||self,C(k["idm-gl"]={},k["@idmwx/idmwx-base"],k.Vue,k["@turf/turf"],k["@mapbox/sphericalmercator"],k.moment,k["mapbox-gl"],k["@idm-plugin/geo"],k.axios))})(this,function(k,C,a,He,Ge,W,$,E,O){"use strict";var Or=Object.defineProperty;var Fr=(k,C,a)=>C in k?Or(k,C,{enumerable:!0,configurable:!0,writable:!0,value:a}):k[C]=a;var N=(k,C,a)=>(Fr(k,typeof C!="symbol"?C+"":C,a),a);function Xe(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const x=Xe(He),Mr="",Wr="",S=(i,e)=>{const t=i.__vccOpts||i;for(const[o,r]of e)t[o]=r;return t},Ze={name:"IdmGlLayer",props:{map:{type:Object},top:{type:String,default:"10px"},left:{type:String,default:"10px"}},emits:["weather","other","coordinate","measure","point","3d","meteoSource"],data(){return{showLayers:!1,source:"",weatherLayers:[],activeWeatherLayers:[],autoActive:!0,otherLayers:[],layers:{weather:[...C.LayerHelper.WEATHER_LAYERS],other:[...C.LayerHelper.OTHER_LAYERS]},weatherLayersCache:"weatherLayersCache",autoActiveCache:"autoActiveCache",otherLayersCache:"otherLayersCache",sourceCache:"defaultSourceCache",showCoord:!1,showMeasure:!1,showPoint:!1,show3d:!1,version:{v:"0.0.4",k:"glCacheVersion"}}},computed:{computeLayerClass(){return function(i,e){return i.enabled?e.some(t=>t.key===i.key)?"layer active":"layer":"layer disabled"}}},watch:{},mounted(){const i=localStorage.getItem(this.version.k);this.version.v!==i&&(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":16,"name":"Sig Waves","key":"sig-wave-height","enabled":true,"type":"json"},{"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":2048,"name":"ENC","key":"enc","enabled":true,"type":"json"},{"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.showLayers=!1,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),this.$emit("meteoSource",this.source)},handleWeatherLayerPick(i){this.weatherLayers.some(e=>e.key===i.key)?(this.weatherLayers=this.weatherLayers.filter(e=>e.key!==i.key),this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.key!==i.key)):this.weatherLayers.length<12&&i.enabled&&(["png","jpg"].includes(i.type)&&(this.weatherLayers=this.weatherLayers.filter(e=>e.type==="json"),this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.type==="json")),this.weatherLayers.push(i),this.activeWeatherLayers.push(i)),localStorage.setItem(this.weatherLayersCache,JSON.stringify(this.weatherLayers))},handleActiveWeatherLayerPick(i){if(this.activeWeatherLayers.some(e=>e.key===i.key))this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.key!==i.key);else if(i.enabled){this.activeWeatherLayers.push(i);for(const e of this.weatherLayers)i.weight>e.weight&&i.weight&e.weight&&this.activeWeatherLayers.push(e)}this.$emit("weather",this.weatherLayers,this.activeWeatherLayers,this.source)},handleOtherLayerPick(i){this.otherLayers.some(e=>e.key===i.key)?this.otherLayers=this.otherLayers.filter(e=>e.key!==i.key):i.enabled&&this.otherLayers.push(i),localStorage.setItem(this.otherLayersCache,JSON.stringify(this.otherLayers))},handleCoordToggle(){this.showCoord=!this.showCoord,this.$emit("coordinate",this.showCoord)},handlePointToggle(){this.showPoint=!this.showPoint,this.$emit("point",this.showPoint)},handleMeasureToggle(){this.showMeasure=!this.showMeasure,this.$emit("measure",this.showMeasure)},handle3DToggle(){this.show3d=!this.show3d,this.$emit("3d",this.show3d)}}},qe={class:"layer-bars flex-start"},Je=[a.createElementVNode("span",{class:"iconfont"},"",-1)],Ye={class:"other-bars"},Ke=[a.createElementVNode("span",{class:"iconfont"},"",-1)],Qe=[a.createElementVNode("span",{class:"iconfont"},"",-1)],et=[a.createElementVNode("span",{class:"iconfont"},"",-1)],tt=[a.createElementVNode("span",{class:"iconfont"},"",-1)],at={key:0,class:"active-layers"},it=["onClick"],rt=a.createElementVNode("div",{class:"checkbox"},null,-1),ot={key:0,class:"available-layers"},st={class:"weather-layers"},nt={class:"layers-title",style:{display:"flex","align-items":"center","justify-content":"space-between"}},lt=[a.createElementVNode("div",{class:"checkbox"},null,-1),a.createElementVNode("span",null,"Auto Act.",-1)],ct={class:"layers-body"},ht=["onClick"],dt=a.createElementVNode("div",{class:"checkbox"},null,-1),pt={class:"other-layers"},mt=a.createElementVNode("div",{class:"layers-title"},"Other Layers",-1),ft={class:"layers-body"},yt=["onClick"],ut=a.createElementVNode("div",{class:"checkbox"},null,-1),gt={class:"source-layers"},_t=a.createElementVNode("div",{class:"layers-title"},"Forecast Model",-1),Lt={class:"layers-body"},bt=[a.createElementVNode("div",{class:"checkbox"},null,-1),a.createElementVNode("span",null,"GFS",-1)],wt=[a.createElementVNode("div",{class:"checkbox"},null,-1),a.createElementVNode("span",null,"ECMWF",-1)],vt={class:"layer",style:{"justify-content":"flex-end",flex:"1"}};function xt(i,e,t,o,r,s){return a.openBlock(),a.createElementBlock("div",{class:"idm-gl2-layer",style:a.normalizeStyle({top:t.top,left:t.left})},[a.createElementVNode("div",qe,[a.createElementVNode("div",{class:a.normalizeClass(r.showLayers?"layer-icon active":"layer-icon"),onClick:e[0]||(e[0]=n=>r.showLayers=!r.showLayers)},Je,2)]),a.createElementVNode("div",Ye,[a.createElementVNode("div",{class:a.normalizeClass(r.showMeasure?"layer-icon active":"layer-icon"),onClick:e[1]||(e[1]=(...n)=>s.handleMeasureToggle&&s.handleMeasureToggle(...n))},Ke,2),a.createElementVNode("div",{class:a.normalizeClass(r.showPoint?"layer-icon active":"layer-icon"),onClick:e[2]||(e[2]=(...n)=>s.handlePointToggle&&s.handlePointToggle(...n))},Qe,2),a.createElementVNode("div",{class:a.normalizeClass(r.showCoord?"layer-icon active":"layer-icon"),onClick:e[3]||(e[3]=(...n)=>s.handleCoordToggle&&s.handleCoordToggle(...n))},et,2),a.createElementVNode("div",{class:a.normalizeClass(r.show3d?"layer-icon active":"layer-icon"),onClick:e[4]||(e[4]=(...n)=>s.handle3DToggle&&s.handle3DToggle(...n))},tt,2)]),a.createVNode(a.Transition,{name:"fade"},{default:a.withCtx(()=>[r.showLayers?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",at,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.weatherLayers,n=>(a.openBlock(),a.createElementBlock("div",{key:n.key,class:a.normalizeClass(s.computeLayerClass(n,r.activeWeatherLayers)),onClick:l=>s.handleActiveWeatherLayerPick(n)},[rt,a.createElementVNode("span",null,a.toDisplayString(n.name),1)],10,it))),128))]))]),_:1}),a.createVNode(a.Transition,{name:"fade"},{default:a.withCtx(()=>[r.showLayers?(a.openBlock(),a.createElementBlock("div",ot,[a.createElementVNode("div",st,[a.createElementVNode("div",nt,[a.createElementVNode("div",null,"Weather Layers ["+a.toDisplayString(r.weatherLayers.length)+"/12 (Max)]",1),a.createElementVNode("div",{class:a.normalizeClass(r.autoActive?"layer active":"layer"),style:{"padding-top":"0"},onClick:e[5]||(e[5]=n=>r.autoActive=!r.autoActive)},lt,2)]),a.createElementVNode("div",ct,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.layers.weather,n=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:n.key},[n.hide?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(s.computeLayerClass(n,r.weatherLayers)),onClick:l=>s.handleWeatherLayerPick(n)},[dt,a.createElementVNode("span",null,a.toDisplayString(n.name),1)],10,ht))],64))),128))])]),a.createElementVNode("div",pt,[mt,a.createElementVNode("div",ft,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.layers.other,n=>(a.openBlock(),a.createElementBlock("div",{key:n.key,class:a.normalizeClass(s.computeLayerClass(n,r.otherLayers)),onClick:l=>s.handleOtherLayerPick(n)},[ut,a.createElementVNode("span",null,a.toDisplayString(n.name),1)],10,yt))),128))])]),a.createElementVNode("div",gt,[_t,a.createElementVNode("div",Lt,[a.createElementVNode("div",{class:a.normalizeClass(r.source==="GFS"?"layer active":"layer"),onClick:e[6]||(e[6]=n=>r.source="GFS")},bt,2),a.createElementVNode("div",{class:a.normalizeClass(r.source==="CMEMS"?"layer active":"layer"),onClick:e[7]||(e[7]=n=>r.source="CMEMS")},wt,2),a.createElementVNode("div",vt,[a.createElementVNode("div",{class:"confirm",onClick:e[8]||(e[8]=(...n)=>s.handleConfirm&&s.handleConfirm(...n))},"Confirm")])])])])):a.createCommentVNode("",!0)]),_:1})],4)}const St=S(Ze,[["render",xt]]),eo="",Et={name:"IdmWindBarb",props:{map:{type:Object},wind:{type:Object},beforeLayer:{type:String},left:{type:String,default:"10px"},bottom:{type:String,default:"70px"},showParticle:{type:Boolean,default:!1},marginBottom:{type:String,default:"30px"}},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:!0}},watch:{"wind.version":{handler(){var i;(i=this.wind)!=null&&i.active?this.handleRender():this.handleClear()},deep:!0},showParticle:{handler(){this.showFeather=!this.showParticle},immediate:!0},showFeather:{handler(){this.handleToggle()},immediate:!0}},methods:{handleParticle(){this.$emit("particle",{particle:!this.showParticle,key:"wind",weight:1})},handleRender(){var i,e,t,o;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.wind){const r=new Date().valueOf();let s=0,n=0,l=this.empty;if((i=this.wind)!=null&&i.active&&(l=(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(l),n=new Date().valueOf()-(r+s),console.log("[wind] update elapsed: ",n,", total: ",s+=n);else{this.map.addSource(this.source,{type:"geojson",data:l});for(let c=0;c<(this.barbs??[]).length-1;c++){const h=(this.barbs??[])[c]||0,m=(this.barbs??[])[c+1]||0,p=h<10?`00${h}kts`:h<100?`0${h}kts`:`${h}kts`;this.map.addLayer({id:p,type:"symbol",filter:["all",[">=","spd",h],["<","spd",m]],source:this.source,layout:{"symbol-placement":"point","icon-image":p,"icon-size":{base:1,stops:[[2,.6],[6,1]]},"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}})}n=new Date().valueOf()-(r+s),console.log("[wind] add elapsed: ",n,", total: ",s+=n)}}},handleToggle(){for(const i of this.barbs??[]){const e=i<10?`00${i}kts`:i<100?`0${i}kts`:`${i}kts`;this.map.getLayer(e)&&this.map.setLayoutProperty(e,"visibility",this.showFeather?"visible":"none")}},handleClear(){for(const i of this.barbs??[]){const e=i<10?`00${i}kts`:i<100?`0${i}kts`:`${i}kts`;this.map.getLayer(e)&&this.map.removeLayer(e)}this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},Ct={key:0,class:"iconfont active"},kt={key:1,class:"iconfont"},Pt={key:0,class:"iconfont active"},Tt={key:1,class:"iconfont"};function Nt(i,e,t,o,r,s){var n;return(n=t.wind)!=null&&n.active?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle({position:"absolute",left:t.left,bottom:t.bottom})},[a.createElementVNode("div",{class:"legend-bars flex-center",style:a.normalizeStyle({marginBottom:t.marginBottom})},[a.createElementVNode("div",{class:"flex-start",onClick:e[0]||(e[0]=(...l)=>s.handleParticle&&s.handleParticle(...l))},[t.showParticle?(a.openBlock(),a.createElementBlock("i",Ct,"")):(a.openBlock(),a.createElementBlock("i",kt,"")),a.createElementVNode("span",{class:a.normalizeClass(t.showParticle?"active":"")},"Wind Particles",2)]),t.showParticle?(a.openBlock(),a.createElementBlock("div",{key:0,class:"flex-start",style:{"margin-left":"16px"},onClick:e[1]||(e[1]=l=>r.showFeather=!r.showFeather)},[r.showFeather?(a.openBlock(),a.createElementBlock("i",Pt,"")):(a.openBlock(),a.createElementBlock("i",Tt,"")),a.createElementVNode("span",{class:a.normalizeClass(r.showFeather?"active":"")},"Wind Feather",2)])):a.createCommentVNode("",!0)],4)],4)):a.createCommentVNode("",!0)}const Rt=S(Et,[["render",Nt],["__scopeId","data-v-bcc2f7f2"]]);class ue{constructor(e){N(this,"map");N(this,"mercator");N(this,"rampColorLayer");N(this,"rampColorSource");N(this,"particleLayer");N(this,"particleSource");N(this,"rampColorCanvas");N(this,"particleCanvas");N(this,"ratio");this.map=e,this.mercator=new Ge,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],r=[e._sw.lng,e._sw.lat],[s,n]=this.convertNLng(o[0]),[l,c]=this.convertNLng(r[0]),[h,m]=this.mercator.px([s,o[1]],t),[p,g]=this.mercator.px([l,r[1]],t),f=Math.round(this.mercator.size*Math.pow(2,t)*(n+c));return[p,g,h+f,m]}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,[r,s,n,l]=e.map(m=>~~(m/(o*256))),c=[];for(let m=l;m<=s;m++)for(let p=r;p<=n;p++)c.push([p,m]);return c.map(m=>{const p=2**t*256;return[m[0]*p,m[1]*p,p]})}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){this.map.setLayoutProperty(this.rampColorLayer,"visibility",e?"visible":"none")}toggleParticle(e){this.map.setLayoutProperty(this.particleLayer,"visibility",e?"visible":"none")}}class F{createShader(e,t,o){const r=e.createShader(t);if(r&&(e.shaderSource(r,o),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)))throw new Error(e.getShaderInfoLog(r)||"error happened while create shader...");return r}createTexture(e,t,o,r,s,n,l){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,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,r),s instanceof Uint8Array?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,l,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 r=e.createBuffer();return t==="array"?(e.bindBuffer(e.ARRAY_BUFFER,r),o&&e.bufferData(e.ARRAY_BUFFER,o,e.STATIC_DRAW)):t==="element"&&(e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r),o&&e.bufferData(e.ELEMENT_ARRAY_BUFFER,o,e.STATIC_DRAW)),r}return null}createProgram(e,t,o){const r=e.createProgram(),s=this.createShader(e,e.VERTEX_SHADER,t),n=this.createShader(e,e.FRAGMENT_SHADER,o);if(r&&s&&n&&(e.attachShader(r,s),e.attachShader(r,n),e.linkProgram(r),!e.getProgramParameter(r,e.LINK_STATUS)))throw new Error(e.getProgramInfoLog(r)||"error happened while creating ramp color program");return r}createProgramWrapper(e,t,o){const r=this.createProgram(e,t,o);if(r){const s={program:r},n=e.getProgramParameter(r,e.ACTIVE_ATTRIBUTES);for(let c=0;c{c.addColorStop(h,m)}),l.fillStyle=c,l.fillRect(0,0,256,1),{canvas:n,texture:this.createTexture(e,e.LINEAR,e.LINEAR,e.CLAMP_TO_EDGE,o?new Uint8Array(l.getImageData(0,0,256,1).data):n,r,s)}}}setupParticle(e,t=1e3){const o=Math.ceil(Math.sqrt(t)),r=o*o,s=new Uint8Array(r*4);for(let m=0;m{const o=new Blob([e],{type:e.type}),r=URL.createObjectURL(o),s=new Image;s.crossOrigin="anonymous",s.src=r,s.onload=()=>t(s)})}}class P{}N(P,"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; }`),N(P,"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; }`),N(P,"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 V{}N(V,"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); }`),N(V,"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; }`),N(V,"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); }`),N(V,"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); }`),N(V,"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); }`);const to="",Vt={name:"IdmWindParticle",props:{factor:{type:Object},viewport:{type:ue},left:{type:String,default:"10px"},bottom:{type:String,default:"70px"}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new F,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}},watch:{"factor.version":{handler(){var i;(i=this.factor)!=null&&i.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const i=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(i+e),console.log("[wind-particle] add elapsed: ",t,", total: ",e+=t)}},handleClear(){var i,e,t,o,r,s,n;(i=this.viewport)==null||i.toggle(!1),this.context=void 0,this.particleContext=void 0,this.etime=void 0,this.initial=!0,(t=(e=this.viewport)==null?void 0:e.map)==null||t.off("resize",this.handleResize),(r=(o=this.viewport)==null?void 0:o.map)==null||r.off("movestart",this.handlePause),(n=(s=this.viewport)==null?void 0:s.map)==null||n.off("moveend",this.handlePlay),this.handlePause()},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const i=[[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,i);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,P.vertexSchema,P.uvFragmentSchema);this.program=e,this.aPositionBuffer=t}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const i=[[0,"rgb(205,255,255)"],[1,"rgb(235,255,255)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,V.vertexSchema,V.fragmentSchema,V.quadVertSchema,V.screenFragmentSchema,V.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,i,!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 i=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,i),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,i),this.wrapper.image=i}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()})}}},It=[(i=>(a.pushScopeId("data-v-c6fb6a2d"),i=i(),a.popScopeId(),i))(()=>a.createElementVNode("div",{class:"legend-bars flex-center"},[a.createElementVNode("span",null,"kts"),a.createElementVNode("span",null,"0"),a.createElementVNode("span",null,"5"),a.createElementVNode("span",null,"10"),a.createElementVNode("span",null,"20"),a.createElementVNode("span",null,"30"),a.createElementVNode("span",null,"40"),a.createElementVNode("span",null,"60")],-1))];function Dt(i,e,t,o,r,s){var n;return(n=t.factor)!=null&&n.active?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle([{position:"absolute"},{left:t.left,bottom:t.bottom}])},It,4)):a.createCommentVNode("",!0)}const Bt=S(Vt,[["render",Dt],["__scopeId","data-v-c6fb6a2d"]]),ro="",At={name:"IdmCurrent",props:{map:{type:Object},current:{type:Object},beforeLayer:{type:String},left:{type:String,default:"10px"},bottom:{type:String,default:"70px"},showParticle:{type:Boolean,default:!1},marginBottom:{type:String,default:"30px"}},emits:["particle"],data(){return{source:"current-source",directionLayer:"current-direction-layer",speedLayer:"current-speed-layer",speedLabelLayer:"current-speed-label-layer",empty:x.featureCollection([]),showJson:!0}},watch:{"current.version":{handler(){var i;(i=this.current)!=null&&i.active?this.handleRender():this.handleClear()},deep:!0},showParticle:{handler(){this.showParticle?this.showJson=!1:this.showJson=!0},immediate:!0},showJson:{handler(){this.handleToggle()},immediate:!0,deep:!0}},methods:{handleParticle(){this.$emit("particle",{particle:!this.showParticle,key:"current",weight:96})},handleRender(){var i,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.current){const t=new Date().valueOf();let o=0,r=0,s=this.empty;this.current.active&&(s=this.current.data),(i=this.map)!=null&&i.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),r=new Date().valueOf()-(t+o),console.log("[current] update elapsed: ",r,", total: ",o+=r)):(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"],"#D9FFB3",1,"#FFFF80",3,"#FF8040",4,"#FD5200",5,"#FF0000"]}},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-halo-color":"rgba(0, 0, 0, 0.2)","text-halo-width":.6}},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,.5,3,1],"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":.7}},this.beforeLayer),r=new Date().valueOf()-(t+o),console.log("[current] add elapsed: ",r,", total: ",o+=r)),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)}}},zt={key:0,class:"iconfont active"},$t={key:1,class:"iconfont"},Ot={key:0,class:"iconfont active"},Ft={key:1,class:"iconfont"};function Mt(i,e,t,o,r,s){var n;return(n=t.current)!=null&&n.active?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle([{position:"absolute"},{left:t.left,bottom:t.bottom}])},[a.createElementVNode("div",{class:"legend-bars flex-center",style:a.normalizeStyle({marginBottom:t.marginBottom})},[a.createElementVNode("div",{class:"flex-start",onClick:e[0]||(e[0]=(...l)=>s.handleParticle&&s.handleParticle(...l))},[t.showParticle?(a.openBlock(),a.createElementBlock("i",zt,"")):(a.openBlock(),a.createElementBlock("i",$t,"")),a.createElementVNode("span",{class:a.normalizeClass(t.showParticle?"active":"")},"Current Particles",2)]),t.showParticle?(a.openBlock(),a.createElementBlock("div",{key:0,class:"flex-start",style:{"margin-left":"16px"},onClick:e[1]||(e[1]=l=>r.showJson=!r.showJson)},[r.showJson?(a.openBlock(),a.createElementBlock("i",Ot,"")):(a.openBlock(),a.createElementBlock("i",Ft,"")),a.createElementVNode("span",{class:a.normalizeClass(r.showJson?"active":"")},"Current",2)])):a.createCommentVNode("",!0)],4)],4)):a.createCommentVNode("",!0)}const Wt=S(At,[["render",Mt],["__scopeId","data-v-02beb77a"]]),oo="",jt={name:"IdmCurrentParticle",props:{factor:{type:Object},viewport:{type:ue},left:{type:String,default:"10px"},bottom:{type:String,default:"70px"}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new F,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}},watch:{"factor.version":{handler(){var i;(i=this.factor)!=null&&i.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const i=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(i+e),console.log("[current-particle] add elapsed: ",t,", total: ",e+=t)}},handleClear(){var i,e,t,o,r,s,n;(i=this.viewport)==null||i.toggle(!1),this.context=void 0,this.particleContext=void 0,this.etime=void 0,this.initial=!0,(t=(e=this.viewport)==null?void 0:e.map)==null||t.off("resize",this.handleResize),(r=(o=this.viewport)==null?void 0:o.map)==null||r.off("movestart",this.handlePause),(n=(s=this.viewport)==null?void 0:s.map)==null||n.off("moveend",this.handlePlay),this.handlePause()},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const i=[[0/255,"rgb(64, 77, 144)"],[5/255,"rgb(61, 121, 110)"],[10/255,"rgb(50, 140, 50)"],[15/255,"rgb(140, 133, 49)"],[20/255,"rgb(143, 115, 50)"],[30/255,"rgb(117, 52, 68)"],[40/255,"rgb(107, 67, 131)"],[45/255,"rgb(67, 93, 133)"],[50/255,"rgb(73, 122, 132)"],[65/255,"rgb(115, 135, 139)"],[80/255,"rgb(144, 144, 144)"],[254/255,"rgb(144, 144, 144)"],[1,"rgb(144, 144, 144)"]];this.rampColor=this.webgl.setup(this.context,i);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,P.vertexSchema,P.uvFragmentSchema);this.program=e,this.aPositionBuffer=t}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const i=[[0,"rgb(205,255,255)"],[1,"rgb(235,255,255)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,V.vertexSchema,V.fragmentSchema,V.quadVertSchema,V.screenFragmentSchema,V.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,i,!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 i=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,i),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,i),this.wrapper.image=i}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()})}}},Ut=[(i=>(a.pushScopeId("data-v-3746a4f1"),i=i(),a.popScopeId(),i))(()=>a.createElementVNode("div",{class:"legend-bars flex-center"},[a.createElementVNode("span",null,"kts"),a.createElementVNode("span",null,"0"),a.createElementVNode("span",null,"0.4"),a.createElementVNode("span",null,"0.8"),a.createElementVNode("span",null,"1.6"),a.createElementVNode("span",null,"2"),a.createElementVNode("span",null,"3.2")],-1))];function Ht(i,e,t,o,r,s){var n;return(n=t.factor)!=null&&n.active?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle([{position:"absolute"},{left:t.left,bottom:t.bottom}])},Ut,4)):a.createCommentVNode("",!0)}const Gt=S(jt,[["render",Ht],["__scopeId","data-v-3746a4f1"]]),lo="",Xt={name:"IdmSigWave",props:{map:{type:Object},viewport:{type:Object},sigWave:{type:Object},beforeLayer:{type:String},left:{type:String,default:"10px"},bottom:{type:String,default:"70px"},marginBottom:{type:String,default:"0"}},emits:["ramp"],data(){return{showRamp:!1,showContourLine:!1,source:"sig-wave-source",heightLayer:"sig-wave-height-layer",heightLabelLayer:"sig-wave-height-label-layer",empty:x.featureCollection([])}},watch:{"sigWave.version":{handler(){var i;(i=this.sigWave)!=null&&i.active?(this.showRamp=!1,this.handleRender()):(this.showRamp=!0,this.handleClear())},deep:!0}},methods:{handleToggleRamp(){this.showRamp=!this.showRamp,this.$emit("ramp",{ramp:this.showRamp,key:"sigWave",weight:16})},handleRender(){var i,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.sigWave){const t=this.map.getLayer("barb")?"barb":this.beforeLayer,o=new Date().valueOf();let r=0,s=0,n=this.empty;this.sigWave.active&&(n=this.sigWave.data),(i=this.map)!=null&&i.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(n),s=new Date().valueOf()-(o+r),console.log("[sig.wave] update elapsed: ",s,", total: ",r+=s)):(this.map.addSource(this.source,{type:"geojson",data:n}),this.map.addLayer({id:this.heightLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],layout:{"fill-sort-key":["get","val"]},paint:{"fill-outline-color":"silver","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"]}},t),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":.5}},this.beforeLayer),s=new Date().valueOf()-(o+r),console.log("[sig.wave] add elapsed: ",s,", total: ",r+=s))}},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)}}},Zt={key:0,class:"iconfont active"},qt={key:1,class:"iconfont"};function Jt(i,e,t,o,r,s){return t.sigWave?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle({position:"absolute",left:t.left,bottom:t.bottom})},[a.createElementVNode("div",{class:"legend-bars flex-center",style:a.normalizeStyle({marginBottom:t.marginBottom})},[a.createElementVNode("div",{class:"flex-start",onClick:e[0]||(e[0]=(...n)=>s.handleToggleRamp&&s.handleToggleRamp(...n))},[r.showRamp?(a.openBlock(),a.createElementBlock("i",Zt,"")):(a.openBlock(),a.createElementBlock("i",qt,"")),a.createElementVNode("span",{class:a.normalizeClass(r.showRamp?"active":"")},"Sig Waves Ramp",2)])],4)],4)):a.createCommentVNode("",!0)}const Yt=S(Xt,[["render",Jt],["__scopeId","data-v-dfa06ed5"]]),co="",Kt={name:"IdmSigWaveRamp",props:{factor:{type:Object},viewport:{type:Object},left:{type:String,default:"10px"},bottom:{type:String,default:"70px"}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new F,etime:void 0}},watch:{factor:{handler(){var i;(i=this.factor)!=null&&i.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const i=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(i+e),console.log("[sigWave] 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 i=[[0/255,"rgba(50, 158, 186,0)"],[20/255,"rgba(111,248,201,0)"],[40/255,"rgba(111,248,201,0)"],[41/255,"rgba(111,248,201,0.6)"],[60/255,"#6ff8c9"],[80/255,"#36cd9a"],[100/255,"#6bff6b"],[120/255,"#fee600"],[140/255,"#ffa200"],[160/255,"#ff6600"],[180/255,"#e23304"],[200/255,"#f80078"],[220/255,"#dc03d2"],[240/255,"#a603f8"],[1,"#7102ab"]];this.rampColor=this.webgl.setup(this.context,i);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,P.vertexSchema,P.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const i=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,i)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Qt=[(i=>(a.pushScopeId("data-v-6e6fa6a0"),i=i(),a.popScopeId(),i))(()=>a.createElementVNode("div",{class:"legend-bars flex-center"},[a.createElementVNode("span",null,"m"),a.createElementVNode("span",null,"2"),a.createElementVNode("span",null,"4"),a.createElementVNode("span",null,"6"),a.createElementVNode("span",null,"8"),a.createElementVNode("span",null,"10"),a.createElementVNode("span",null,"12")],-1))];function ea(i,e,t,o,r,s){var n;return(n=t.factor)!=null&&n.active?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle([{position:"absolute"},{left:t.left,bottom:t.bottom}])},Qt,4)):a.createCommentVNode("",!0)}const ta=S(Kt,[["render",ea],["__scopeId","data-v-6e6fa6a0"]]),aa={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 i;(i=this.swell)!=null&&i.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var i,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.swell){const t=new Date().valueOf();let o=0,r=0,s=this.empty;this.swell.active&&(s=this.swell.data),(i=this.map)!=null&&i.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),r=new Date().valueOf()-(t+o),console.log("[swell] update elapsed: ",r,", total: ",o+=r)):(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":.5,"line-width":2,"line-color":["match",["get","val"],2,"#ffeb3b",3,"#ffc107",4,"#ff9800",5,"#ff5722",6,"#f44336","#f44336"]}},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",5,"white",6,"white"],"text-halo-color":["match",["get","val"],2,"#ffeb3b",3,"#ffc107",4,"#ff9800",5,"#ff5722",6,"#f44336","#f44336"],"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,.6],[6,1]]},"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,180],[360,540]]}},paint:{"icon-opacity":1}},this.beforeLayer),r=new Date().valueOf()-(t+o),console.log("[swell] add elapsed: ",r,", total: ",o+=r))}},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 ia(i,e,t,o,r,s){return a.openBlock(),a.createElementBlock("div")}const ra=S(aa,[["render",ia]]),oa={name:"IdmPrmsl",props:{map:{type:Object},prmsl:{type:Object},beforeLayer:{type:String}},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 i;(i=this.prmsl)!=null&&i.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var i,e,t;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.prmsl){const o=new Date().valueOf();let r=0,s=0,n=this.empty;this.prmsl.active&&(n=this.prmsl.data),(i=this.map)!=null&&i.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(n),s=new Date().valueOf()-(o+r),console.log("[prmsl] update elapsed: ",s,", total: ",r+=s)):(this.map.addSource(this.source,{type:"geojson",data:n}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-color":["step",["get","val"],"#e91e63",920,"#f44336",980,"#ffeb3b",1100,"#673ab7"],"line-width":1,"line-opacity":1}}),(t=this.map)==null||t.addLayer({id:this.labelLayer,type:"symbol",source:this.source,filter:["==","$type","LineString"],layout:{"symbol-placement":"line","text-rotation-alignment":"viewport","text-field":"{val}","text-size":12},paint:{"text-color":["step",["get","val"],"white",980,"black",1100,"black"],"text-halo-color":["step",["get","val"],"#e91e63",920,"#f44336",980,"#ffeb3b",1100,"#673ab7"],"text-halo-width":4}}),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-color":["match",["get","type"],"L","#e91e63","H","#ffeb3b","#ffeb3b"],"text-halo-color":"rgba(255, 255, 255, 0.8)","text-halo-width":.2}}),s=new Date().valueOf()-(o+r),console.log("[prmsl] add elapsed: ",s,", total: ",r+=s))}},handleClear(){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 sa(i,e,t,o,r,s){return a.openBlock(),a.createElementBlock("div")}const na=S(oa,[["render",sa]]),la={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 i;(i=this.iceberg)!=null&&i.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var i,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.iceberg){const t=new Date().valueOf();let o=0,r=0,s=this.empty;this.iceberg.active&&(s=this.iceberg.data),(i=this.map)!=null&&i.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),r=new Date().valueOf()-(t+o),console.log("[iceberg] update elapsed: ",r,", total: ",o+=r)):(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}}),r=new Date().valueOf()-(t+o),console.log("[iceberg] add elapsed: ",r,", total: ",o+=r))}},handleClear(){this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function ca(i,e,t,o,r,s){return a.openBlock(),a.createElementBlock("div")}const ha=S(la,[["render",ca]]),mo="",da={name:"IdmTropicals",props:{map:{type:Object},tropicals:{type:Object},date:{type:String}},emits:["tropical"],data(){return{sourceData:[],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",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(i){if(i){const e=W(i).utc();return`${e.format("MMM-DD,HHmm[Z]")} (${e==null?void 0:e.fromNow()})`}return"-"}}},watch:{"tropicals.version":{handler(){var i,e,t;(i=this.tropicals)!=null&&i.active?(this.handleRender(),(e=this.map)==null||e.on("click",[this.forecastNameLayer,this.pointCircleLayer,this.pointLabelLayer],this.handleClick)):(this.handleClear(),(t=this.map)==null||t.off("click",[this.forecastNameLayer,this.pointCircleLayer,this.pointLabelLayer],this.handleClick))},immediate:!0}},methods:{handleRender(){var i,e,t,o,r,s,n,l,c,h;if(!this.map)setTimeout(()=>{this.handleRender()},500);else{if(this.tropicals){const m=new Date().valueOf();let p=0,g=0;this.sourceData=(i=this.tropicals)!=null&&i.active?this.tropicals.data:this.empty,(e=this.map)!=null&&e.getSource(this.source)?((t=this.map)==null||t.getSource(this.source).setData(this.sourceData),g=new Date().valueOf()-(m+p),console.log("[tropicals] update elapsed: ",g,", total: ",p+=g)):(this.map.addSource(this.source,{type:"geojson",data:this.sourceData}),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":"rgba(0, 0, 0, 0.4)","line-width":3,"line-opacity":1}}),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"],"jma","#F56C6C","ecmwf","#E6A23C","ukm","#67C23A","noaa-at","#FFA6FC","noaa-ep","#FFA6FC","#ffffff"],"line-width":3,"line-opacity":1,"line-dasharray":[2,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":"#6e6e6e","text-halo-color":"#fff","text-halo-width":1}}),this.map.addLayer({id:this.forecastNameLayer,type:"symbol",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"]],layout:{"symbol-placement":"point","text-field":"{name}","text-rotation-alignment":"viewport","text-size":13},paint:{"text-color":"rgba(255, 0, 0, 0.8)","text-halo-color":"#fff","text-halo-width":1}}),g=new Date().valueOf()-(m+p),console.log("[tropical] add elapsed: ",g,", total: ",p+=g)),(o=this.map)!=null&&o.getSource(this.clusterSource)?((s=this.map)==null||s.getSource(this.clusterSource).setData((r=this.tropicals)!=null&&r.active?this.tropicals.data:this.empty),g=new Date().valueOf()-(m+p),console.log("[tropical] update elapsed: ",g,", total: ",p+=g)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(n=this.tropicals)!=null&&n.active?(l=this.tropicals)==null?void 0:l.data:this.empty}),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"]],17.2]],"#5eff02",["boolean",["<=",["get","spd",["get","wind"]],24.5]],"#f2da00",["boolean",["<=",["get","spd",["get","wind"]],32.7]],"#f27d00",["boolean",["<=",["get","spd",["get","wind"]],41.5]],"#f00000",["boolean",["<",["get","spd",["get","wind"]],51]],"#971d12",["boolean",[">=",["get","spd",["get","wind"]],51]],"#010101","#ffffff"]}}),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":14},paint:{"text-color":"#6e6e6e","text-halo-color":"#fff","text-halo-width":2}}),g=new Date().valueOf()-(m+p),console.log("[tropical] add elapsed: ",g,", total: ",p+=g)),(c=this.map)!=null&&c.getSource(this.circleSource)?(h=this.map)==null||h.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]}}))}this.interpolateData=E.TropicalHelper.interpolate(this.tropicals,1),this.handleDateChange()}},handleClear(){var i;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.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.interpolateLineLayer)&&this.map.removeLayer(this.interpolateLineLayer),(i=this.interpolateMarkers)==null||i.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 i,e,t,o,r,s,n,l,c,h,m,p,g,f,L,y;if((i=this.interpolateMarkers)==null||i.forEach(d=>d==null?void 0:d.remove()),this.circleSourceData.features=[],(t=(e=this.map)==null?void 0:e.getSource(this.circleSource))==null||t.setData(this.circleSourceData),(o=this.interpolateData)!=null&&o.length&&this.tropicals.active){const d=W(this.date).utc().set({minute:0,second:0,millisecond:0}),_=this.interpolateData.filter(v=>v.properties.date===d.format()&&!v.properties.disabled),u=this.handleComputePolygons(_),w=x.featureCollection([..._]);u.forEach(v=>{w.features.push(v)}),(r=this.map)!=null&&r.getSource(this.interpolateSource)?(s=this.map)==null||s.getSource(this.interpolateSource).setData(w):((n=this.map)==null||n.addSource(this.interpolateSource,{type:"geojson",data:w}),(l=this.map)==null||l.addLayer({id:this.interpolateLineLayer,type:"line",source:this.interpolateSource,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-color":["match",["get","level"],7,"#34fa8a",10,"#f85c5c","#ffffff"],"line-width":1.3}})),this.interpolateMarkers=[];for(const v of _)if(!v.properties.disabled){const b=document.createElement("div");b.className="hurricane-hourly-marker",b.innerHTML=`
`;const T=new $.Marker(b).setLngLat(v.geometry.coordinates).addTo(this.map);if(this.interpolateMarkers.push(T),(c=v.properties)!=null&&c.showCircle){const R={radius:100,coordinates:v.geometry.coordinates},I={radius:200,coordinates:v.geometry.coordinates},B={radius:500,coordinates:v.geometry.coordinates};(h=this.circleSourceData)==null||h.features.push(x.circle(R.coordinates,R.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle",distance:"100nm"}})),(m=this.circleSourceData)==null||m.features.push(x.circle(I.coordinates,I.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle",distance:"200nm"}})),(p=this.circleSourceData)==null||p.features.push(x.circle(B.coordinates,B.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle",distance:"500nm"}})),(f=(g=this.map)==null?void 0:g.getSource(this.circleSource))==null||f.setData(this.circleSourceData)}}}else(L=this.map)!=null&&L.getSource(this.interpolateSource)&&((y=this.map)==null||y.getSource(this.interpolateSource).setData(this.empty))},handleClick(i){var s,n,l,c,h,m,p,g;const e=i.features[0],t=(n=(s=this.tropicals)==null?void 0:s.data)==null?void 0:n.features.filter(f=>{var L;return f.geometry.type==="LineString"&&f.properties.type==="forecast"&&f.properties.name===((L=e==null?void 0:e.properties)==null?void 0:L.name)});t.sort((f,L)=>{var y,d,_,u;return((y=f.properties)==null?void 0:y.model)==="cma"?-1:((d=f.properties)==null?void 0:d.model)==="jma"?((_=L.properties)==null?void 0:_.model)==="cma"?1:-1:f.properties.model==="ecmwf"?["jma","cma"].includes((u=L.properties)==null?void 0:u.model)?1:-1:0});const o=(c=(l=this.tropicals)==null?void 0:l.data)==null?void 0:c.features.filter(f=>{var L;return f.geometry.type==="LineString"&&f.properties.type==="history"&&f.properties.name===((L=e==null?void 0:e.properties)==null?void 0:L.name)});this.activeTropicals={name:(h=e==null?void 0:e.properties)==null?void 0:h.name,forecasts:t.map(f=>f.properties),history:(m=o[0])==null?void 0:m.properties,showCircle:(g=(p=t[0])==null?void 0:p.properties)==null?void 0:g.showCircle},this.showTropicals=!0;const r=document.getElementById("active-tropical");this.activeTropicalsMarker?this.activeTropicalsMarker.setLngLat([i.lngLat.lng,i.lngLat.lat]):this.activeTropicalsMarker=new $.Marker(r).setLngLat([i.lngLat.lng,i.lngLat.lat]).setOffset([220,0]).addTo(this.map)},handleForecastToggle(i){var o,r,s,n,l,c;i.disabled=!i.disabled;const e=`${i.name}-${i.model}`,t=(r=(o=this.map)==null?void 0:o.getSource(this.source)._data)==null?void 0:r.features;t.forEach(h=>{h.properties.category===e&&(h.properties.disabled=i.disabled)}),this.interpolateData.forEach(h=>{h.properties.category===e&&(h.properties.disabled=i.disabled)}),(n=(s=this.map)==null?void 0:s.getSource(this.source))==null||n.setData(x.featureCollection(t)),(c=(l=this.map)==null?void 0:l.getSource(this.clusterSource))==null||c.setData(x.featureCollection(t)),this.handleDateChange()},handleToggleCircles(i){var e,t;i.showCircle=!i.showCircle,(t=(e=this.tropicals.data)==null?void 0:e.features)==null||t.forEach(o=>{o.properties.name===i.name&&(o.properties.showCircle=i.showCircle)}),this.handleRender()},handleStrikeProbability(i){this.$emit("tropical",i)},handleComputePolygons(i){const e=[];for(const t of i){const o=t.properties.wind,r={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,r,{...t.properties,level:7});e.push(s);const n={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},l=this.handleComputeArc(t.geometry.coordinates,n,{...t.properties,level:10});e.push(l)}return e},handleComputeArc(i,e,t){var s;const o=[];for(const n in e){const l=e[n]??0;let c;switch(n){case"ne":c=x.lineArc(i,l*1.852,0,90,{steps:l>0?64:1});break;case"se":c=x.lineArc(i,l*1.852,90,180,{steps:l>0?64:1});break;case"sw":c=x.lineArc(i,l*1.852,180,270,{steps:l>0?64:1});break;case"nw":c=x.lineArc(i,l*1.852,270,360,{steps:l>0?64:1});break}o.push(...(s=c==null?void 0:c.geometry)==null?void 0:s.coordinates)}const r=x.lineString(o);return x.lineToPolygon(r,{properties:t})}}},M=i=>(a.pushScopeId("data-v-f9874330"),i=i(),a.popScopeId(),i),pa={id:"active-tropical",class:"active-tropical"},ma={class:"flex-start"},fa=M(()=>a.createElementVNode("i",{class:"iconfont"},"",-1)),ya={class:"info"},ua={class:"label"},ga={class:"name"},_a={class:"info flex"},La={class:"label"},ba={class:"flex-space"},wa={class:"flex-start"},va=M(()=>a.createElementVNode("i",{class:"iconfont"},"",-1)),xa={class:"info"},Sa=M(()=>a.createElementVNode("div",{class:"label"},"Wind speed",-1)),Ea={class:"number"},Ca=M(()=>a.createElementVNode("span",null,"kts",-1)),ka={class:"flex-start"},Pa=M(()=>a.createElementVNode("i",{class:"iconfont"},"",-1)),Ta={class:"info"},Na=M(()=>a.createElementVNode("div",{class:"label"},"Pressure",-1)),Ra={class:"number"},Va=M(()=>a.createElementVNode("span",null,"hPa",-1)),Ia={class:"flex-space",style:{"border-bottom":"var(--idm-dashed-border)","padding-bottom":"10px","border-color":"var(--idm-white-9)"}},Da={class:"forecast-models flex-end"},Ba=["onClick"],Aa=a.createStaticVNode('
TD
TS
STS
TY
STY
Super TY
',1),za={class:"forecast-legends flex-space"},$a=a.createStaticVNode('
History
35kts Radii
50kts Radii
',3),Oa={class:"legend"};function Fa(i,e,t,o,r,s){var n,l,c,h,m,p,g,f,L,y,d,_,u,w;return a.withDirectives((a.openBlock(),a.createElementBlock("div",pa,[a.createElementVNode("div",ma,[fa,a.createElementVNode("div",ya,[a.createElementVNode("div",ua,a.toDisplayString(((l=(n=r.activeTropicals)==null?void 0:n.history)==null?void 0:l.level)||"Unknown"),1),a.createElementVNode("div",ga,a.toDisplayString((c=r.activeTropicals)==null?void 0:c.name),1)]),a.createElementVNode("div",_a,[a.createElementVNode("div",La," Last update: "+a.toDisplayString(s.computeTime(((m=(h=r.activeTropicals)==null?void 0:h.history)==null?void 0:m.updated)||((f=(g=(p=r.activeTropicals)==null?void 0:p.forecasts)==null?void 0:g.filter(v=>!v.disabled)[0])==null?void 0:f.date))),1)])]),a.createElementVNode("div",ba,[a.createElementVNode("div",wa,[va,a.createElementVNode("div",xa,[Sa,a.createElementVNode("div",Ea,[a.createTextVNode(a.toDisplayString(((y=(L=r.activeTropicals)==null?void 0:L.history)==null?void 0:y.kts)||"-"),1),Ca])])]),a.createElementVNode("div",ka,[Pa,a.createElementVNode("div",Ta,[Na,a.createElementVNode("div",Ra,[a.createTextVNode(a.toDisplayString(((_=(d=r.activeTropicals)==null?void 0:d.history)==null?void 0:_.pressure)||"-"),1),Va])])])]),a.createElementVNode("div",Ia,[a.createElementVNode("div",{class:a.normalizeClass(["circle",(u=r.activeTropicals)!=null&&u.showCircle?"active":""]),onClick:e[0]||(e[0]=v=>s.handleToggleCircles(r.activeTropicals))},"circle",2),a.createElementVNode("div",Da,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList((w=r.activeTropicals)==null?void 0:w.forecasts,(v,b)=>(a.openBlock(),a.createElementBlock("div",{key:b,class:a.normalizeClass(v.disabled?"model":"model active"),onClick:T=>s.handleForecastToggle(v)},[a.createElementVNode("span",{class:a.normalizeClass(v.model)},a.toDisplayString(v.model),3)],10,Ba))),128))])]),Aa,a.createElementVNode("div",za,[$a,a.createElementVNode("div",Oa,[a.createElementVNode("div",{class:"button",onClick:e[1]||(e[1]=v=>s.handleStrikeProbability(r.activeTropicals))},"Strike Probability")])]),a.createElementVNode("div",{class:"close",onClick:e[2]||(e[2]=v=>r.showTropicals=!1)},"X")],512)),[[a.vShow,r.showTropicals]])}const ge=S(da,[["render",Fa],["__scopeId","data-v-f9874330"]]),fo="",Ma={name:"IdmPrecip3h",props:{factor:{type:Object},viewport:{type:Object},left:{type:String,default:"10px"},bottom:{type:String,default:"70px"}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new F,etime:void 0}},watch:{"factor.version":{handler(){var i;(i=this.factor)!=null&&i.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const i=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(i+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 i=[[0,"rgba(59, 124, 162, 0)"],[14/255,"rgba(59, 126, 162, 0)"],[15/255,"rgba(59, 126, 162, 1)"],[20/255,"rgba(58, 137, 162, 1)"],[30/255,"rgba(58, 153, 162, 1)"],[49/255,"rgba(74, 164, 57, 0.8)"],[57/255,"rgba(129, 162, 59, 0.8)"],[73/255,"rgba(162, 60, 59, 0.9)"],[82/255,"rgba(171, 54, 107, 0.9)"],[1,"rgba(164, 58, 154, 1)"]];this.rampColor=this.webgl.setup(this.context,i);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,P.vertexSchema,P.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const i=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,i)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Wa=[(i=>(a.pushScopeId("data-v-694c2c1e"),i=i(),a.popScopeId(),i))(()=>a.createElementVNode("div",{class:"legend-bars flex-center"},[a.createElementVNode("span",null,"mm"),a.createElementVNode("span",null,"1.5"),a.createElementVNode("span",null,"2"),a.createElementVNode("span",null,"3"),a.createElementVNode("span",null,"7"),a.createElementVNode("span",null,"10"),a.createElementVNode("span",null,"20"),a.createElementVNode("span",null,"30")],-1))];function ja(i,e,t,o,r,s){var n;return(n=t.factor)!=null&&n.active?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle([{position:"absolute"},{left:t.left,bottom:t.bottom}])},Wa,4)):a.createCommentVNode("",!0)}const Ua=S(Ma,[["render",ja],["__scopeId","data-v-694c2c1e"]]),go="",Ha={name:"IdmVisibility",props:{factor:{type:Object},viewport:{type:Object},left:{type:String,default:"10px"},bottom:{type:String,default:"70px"}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new F,etime:void 0}},watch:{"factor.version":{handler(){var i;(i=this.factor)!=null&&i.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const i=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(i+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 i=[[0,"rgba(164, 89, 164, 1)"],[8/255,"rgba(168, 86, 86, 1)"],[27/255,"rgba(89, 99, 164, 1)"],[60/255,"rgba(70, 180, 74, 1)"],[160/255,"rgba(91, 158, 85, 1)"],[161/255,"rgba(91, 158, 85, 0)"],[1,"rgba(76, 165, 228, 0)"]];this.rampColor=this.webgl.setup(this.context,i);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,P.vertexSchema,P.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const i=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,i)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Ga=[(i=>(a.pushScopeId("data-v-79011e10"),i=i(),a.popScopeId(),i))(()=>a.createElementVNode("div",{class:"legend-bars flex-center"},[a.createElementVNode("span",null,"nm"),a.createElementVNode("span",null,"0.5"),a.createElementVNode("span",null,"1.5"),a.createElementVNode("span",null,"3"),a.createElementVNode("span",null,"9")],-1))];function Xa(i,e,t,o,r,s){var n;return(n=t.factor)!=null&&n.active?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle([{position:"absolute"},{left:t.left,bottom:t.bottom}])},Ga,4)):a.createCommentVNode("",!0)}const Za=S(Ha,[["render",Xa],["__scopeId","data-v-79011e10"]]),bo="",qa={name:"IdmWaterTemp",props:{factor:{type:Object},viewport:{type:Object},left:{type:String,default:"10px"},bottom:{type:String,default:"70px"}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new F,etime:void 0}},watch:{"factor.version":{handler(){var i;(i=this.factor)!=null&&i.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const i=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(i+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 i=[[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,i);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,P.vertexSchema,P.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const i=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,i)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Ja=[(i=>(a.pushScopeId("data-v-7c7efac9"),i=i(),a.popScopeId(),i))(()=>a.createElementVNode("div",{class:"legend-bars flex-center"},[a.createElementVNode("span",null,"°C"),a.createElementVNode("span",null,"0"),a.createElementVNode("span",null,"10"),a.createElementVNode("span",null,"20"),a.createElementVNode("span",null,"30"),a.createElementVNode("span",null,"40")],-1))];function Ya(i,e,t,o,r,s){var n;return(n=t.factor)!=null&&n.active?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle([{position:"absolute"},{left:t.left,bottom:t.bottom}])},Ja,4)):a.createCommentVNode("",!0)}const Ka=S(qa,[["render",Ya],["__scopeId","data-v-7c7efac9"]]),xo="",Qa={name:"IdmTemp",props:{factor:{type:Object},viewport:{type:Object},left:{type:String,default:"10px"},bottom:{type:String,default:"70px"}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new F,etime:void 0}},watch:{"factor.version":{handler(){var i;(i=this.factor)!=null&&i.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const i=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(i+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 i=[[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,i);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,P.vertexSchema,P.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const i=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,i)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},ei=[(i=>(a.pushScopeId("data-v-521a3688"),i=i(),a.popScopeId(),i))(()=>a.createElementVNode("div",{class:"legend-bars flex-center"},[a.createElementVNode("span",null,"°C"),a.createElementVNode("span",null,"-20"),a.createElementVNode("span",null,"-10"),a.createElementVNode("span",null,"0"),a.createElementVNode("span",null,"10"),a.createElementVNode("span",null,"20"),a.createElementVNode("span",null,"30"),a.createElementVNode("span",null,"40")],-1))];function ti(i,e,t,o,r,s){var n;return(n=t.factor)!=null&&n.active?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle([{position:"absolute"},{left:t.left,bottom:t.bottom}])},ei,4)):a.createCommentVNode("",!0)}const ai=S(Qa,[["render",ti],["__scopeId","data-v-521a3688"]]),Co="",ii={name:"IdmArctic",props:{factor:{type:Object},viewport:{type:Object},left:{type:String,default:"10px"},bottom:{type:String,default:"70px"}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new F,etime:void 0}},watch:{"factor.version":{handler(){var i;(i=this.factor)!=null&&i.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const i=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(i+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 i=[[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,i);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,P.vertexSchema,P.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const i=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,i)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},ri=[(i=>(a.pushScopeId("data-v-b7b952f0"),i=i(),a.popScopeId(),i))(()=>a.createElementVNode("div",{class:"legend-bars flex-center"},[a.createElementVNode("span",null,"m"),a.createElementVNode("span",null,"0"),a.createElementVNode("span",null,"0.5"),a.createElementVNode("span",null,"1"),a.createElementVNode("span",null,"1.5"),a.createElementVNode("span",null,"2")],-1))];function oi(i,e,t,o,r,s){var n;return(n=t.factor)!=null&&n.active?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle([{position:"absolute"},{left:t.left,bottom:t.bottom}])},ri,4)):a.createCommentVNode("",!0)}const si=S(ii,[["render",oi],["__scopeId","data-v-b7b952f0"]]),To="",ni={name:"IdmPoint",props:{map:{type:Object},show:{type:Boolean},meteo:{type:Object}},emits:["point","more"],data(){return{showMeteo:!1,meteoMarker:void 0,helper:C.CompanyHelper}},computed:{computeTime(){return function(i){return i?`${W(i).utc().format("MMM-DD,HHmm[Z]")}`:"-"}},computeLat(){return function(i,e=4){return E.LngLatHelper.lat2pretty(i,e).pretty}},computeLng(){return function(i,e=4){return E.LngLatHelper.lng2pretty(i,e).pretty}},roundPrecision(){return function(i,e=4){return isNaN(i)?"-":E.LngLatHelper.roundPrecision(i,e)}}},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}}},methods:{handleBind(){var i,e;this.show?(i=this.map)==null||i.on("click",this.handleClick):((e=this.map)==null||e.off("click",this.handleClick),this.showMeteo=!1)},handleClick(i){i.originalEvent.stopPropagation();const e=i.originalEvent.target.className;e==="close"?this.showMeteo=!1:e==="more"?this.$emit("more",this.meteo):this.$emit("point",i.lngLat)},handleRender(){var i;if(this.meteo){const e=document.getElementById("point-meteo");this.meteoMarker?(i=this.meteoMarker)==null||i.setLngLat([this.meteo.lng,this.meteo.lat]):this.meteoMarker=new $.Marker(e).setLngLat([this.meteo.lng,this.meteo.lat]).addTo(this.map)}}}},D=i=>(a.pushScopeId("data-v-ad2c5d62"),i=i(),a.popScopeId(),i),li={id:"point-meteo",class:"point-meteo"},ci={class:"meteo-box"},hi=D(()=>a.createElementVNode("div",{class:"close"},"X",-1)),di={class:"flex-space"},pi=D(()=>a.createElementVNode("label",null,"Date Time",-1)),mi={class:"flex-space"},fi=D(()=>a.createElementVNode("label",null,"Position",-1)),yi={class:"flex-space"},ui=D(()=>a.createElementVNode("label",null,"Wind",-1)),gi={class:"flex-space"},_i=D(()=>a.createElementVNode("label",null,"Wind.Wave",-1)),Li={class:"flex-space"},bi=D(()=>a.createElementVNode("label",null,"Swell",-1)),wi={class:"flex-space"},vi=D(()=>a.createElementVNode("label",null,"Sig.Wave",-1)),xi={class:"flex-space"},Si=D(()=>a.createElementVNode("label",null,"Current",-1)),Ei={class:"flex-space"},Ci=D(()=>a.createElementVNode("label",null,"Precip",-1)),ki={class:"flex-space"},Pi=D(()=>a.createElementVNode("label",null,"Visibility",-1)),Ti={class:"flex-space"},Ni=D(()=>a.createElementVNode("label",null,"Temp",-1)),Ri={class:"flex-space"},Vi=D(()=>a.createElementVNode("label",null,"Water Temp",-1)),Ii={key:0,class:"flex-space",style:{"justify-content":"flex-end"}},Di=[D(()=>a.createElementVNode("span",{class:"more"},"More >>>",-1))];function Bi(i,e,t,o,r,s){var n,l,c,h,m,p,g,f,L,y,d,_,u,w,v,b,T,R,I,B,A,z,le,ce,he,de,pe,me,fe,ye,j,U,H,G,X,Z,q,J,Y,K,Q,ee,te,ae,ie,re,oe;return a.withDirectives((a.openBlock(),a.createElementBlock("div",li,[a.createElementVNode("div",ci,[hi,a.createElementVNode("div",di,[pi,a.createElementVNode("span",null,a.toDisplayString(s.computeTime((n=t.meteo)==null?void 0:n.utc)),1)]),a.createElementVNode("div",mi,[fi,a.createElementVNode("span",null,a.toDisplayString(s.computeLat((l=t.meteo)==null?void 0:l.lat))+","+a.toDisplayString(s.computeLng((c=t.meteo)==null?void 0:c.lng)),1)]),a.createElementVNode("div",yi,[ui,a.createElementVNode("span",null,a.toDisplayString(((m=(h=t.meteo)==null?void 0:h.wind)==null?void 0:m.direction)||"-")+"/"+a.toDisplayString(s.roundPrecision((g=(p=t.meteo)==null?void 0:p.wind)==null?void 0:g.kts,1))+"[kts]/"+a.toDisplayString((L=(f=t.meteo)==null?void 0:f.wind)==null?void 0:L.scale)+"[BF]/"+a.toDisplayString(s.roundPrecision((d=(y=t.meteo)==null?void 0:y.gusts)==null?void 0:d.kts,1))+"[kts]",1)]),a.createElementVNode("div",gi,[_i,a.createElementVNode("span",null,a.toDisplayString(((w=(u=(_=t.meteo)==null?void 0:_.wave)==null?void 0:u.wd)==null?void 0:w.direction)||"-")+"/"+a.toDisplayString(s.roundPrecision((T=(b=(v=t.meteo)==null?void 0:v.wave)==null?void 0:b.wd)==null?void 0:T.height,1))+"[m]/"+a.toDisplayString(s.roundPrecision((B=(I=(R=t.meteo)==null?void 0:R.wave)==null?void 0:I.wd)==null?void 0:B.period,1))+"[s]",1)]),a.createElementVNode("div",Li,[bi,a.createElementVNode("span",null,a.toDisplayString(((le=(z=(A=t.meteo)==null?void 0:A.wave)==null?void 0:z.swell)==null?void 0:le.direction)||"-")+"/"+a.toDisplayString(s.roundPrecision((de=(he=(ce=t.meteo)==null?void 0:ce.wave)==null?void 0:he.swell)==null?void 0:de.height,1))+"[m]/"+a.toDisplayString(s.roundPrecision((fe=(me=(pe=t.meteo)==null?void 0:pe.wave)==null?void 0:me.swell)==null?void 0:fe.period,1))+"[s]",1)]),a.createElementVNode("div",wi,[vi,a.createElementVNode("span",null,a.toDisplayString(((U=(j=(ye=t.meteo)==null?void 0:ye.wave)==null?void 0:j.sig)==null?void 0:U.direction)||"-")+"/"+a.toDisplayString(s.roundPrecision((X=(G=(H=t.meteo)==null?void 0:H.wave)==null?void 0:G.sig)==null?void 0:X.height,1))+"[m]/"+a.toDisplayString(s.roundPrecision((J=(q=(Z=t.meteo)==null?void 0:Z.wave)==null?void 0:q.sig)==null?void 0:J.period,1))+"[s]",1)]),a.createElementVNode("div",xi,[Si,a.createElementVNode("span",null,a.toDisplayString(((K=(Y=t.meteo)==null?void 0:Y.current)==null?void 0:K.direction)||"-")+"/"+a.toDisplayString(s.roundPrecision((ee=(Q=t.meteo)==null?void 0:Q.current)==null?void 0:ee.kts,2))+"[kts]",1)]),a.createElementVNode("div",Ei,[Ci,a.createElementVNode("span",null,a.toDisplayString(s.roundPrecision((ae=(te=t.meteo)==null?void 0:te.precip)==null?void 0:ae.inter6h,2))+"[mm]",1)]),a.createElementVNode("div",ki,[Pi,a.createElementVNode("span",null,a.toDisplayString(s.roundPrecision(((ie=t.meteo)==null?void 0:ie.visibility)/1852,0))+"[nm]",1)]),a.createElementVNode("div",Ti,[Ni,a.createElementVNode("span",null,a.toDisplayString(s.roundPrecision((re=t.meteo)==null?void 0:re.temp,0))+"[°C]",1)]),a.createElementVNode("div",Ri,[Vi,a.createElementVNode("span",null,a.toDisplayString(s.roundPrecision((oe=t.meteo)==null?void 0:oe.waterTemp,2))+"[°C]",1)]),i.$attrs.permission&r.helper.LEVEL.Prime?(a.openBlock(),a.createElementBlock("div",Ii,Di)):a.createCommentVNode("",!0)])],512)),[[a.vShow,r.showMeteo]])}const Ai=S(ni,[["render",Bi],["__scopeId","data-v-ad2c5d62"]]),zi={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-opacity":.5,"fill-color":["match",["get","val"],"PiracyArea","#DF2CF3","ConvoyArea","#FFFF00","JWCriskArea","#DF2CF3","#ffffff"]}},this.beforeLayer),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.3,"icon-image":"{icon}","text-anchor":"left","text-field":"{lbl}","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 $i(i,e,t,o,r,s){return a.openBlock(),a.createElementBlock("div")}const Oi=S(zi,[["render",$i]]),Fi={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":.3,"icon-image":"{icon}","text-anchor":"left","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":12,"text-offset":[0,1]},paint:{"text-opacity":.8,"text-color":"#003399"}}))):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 Mi(i,e,t,o,r,s){return a.openBlock(),a.createElementBlock("div")}const Wi=S(Fi,[["render",Mi]]),ji={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 i;this.map?(this.handleClear(),this.zone&&(this.map.getSource(this.source)?(i=this.map)==null||i.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":.5,"fill-color":"#1CD537"}}),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":.3,"icon-image":"{icon}","text-anchor":"left","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":12,"text-offset":[0,1]},paint:{"text-opacity":.8}})))):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 Ui(i,e,t,o,r,s){return a.openBlock(),a.createElementBlock("div")}const Hi=S(ji,[["render",Ui]]),Ro="",Gi={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 i,e;this.zone?(this.handleRender(),(i=this.map)==null||i.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(i){var o;const e=i.features[0],t=(o=this.zone)==null?void 0:o.features.filter(r=>{var s;return r.properties.id===((s=e==null?void 0:e.properties)==null?void 0:s.id)})[0];if(t){this.showZone=!0,this.form={...t.properties},console.log("[alert zone] ",this.form);const r=document.getElementById("zone-info");this.marker?this.marker.setLngLat([i.lngLat.lng,i.lngLat.lat]):this.marker=new $.Marker(r).setLngLat([i.lngLat.lng,i.lngLat.lat]).setOffset([0,0]).addTo(this.map)}},handleRender(){var i;this.map?(this.handleClear(),this.zone&&(this.map.getSource(this.source)?(i=this.map)==null||i.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":"#ffa046","fill-opacity":.5,"fill-color":"#c2ccb8"}}),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"}}),this.map.addLayer({id:this.lineLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["!=","disabled",!0]],paint:{"line-color":"#ffa046","line-width":2}}),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"}}),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}})))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.polygonLayer)&&this.map.removeLayer(this.polygonLayer),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)}}},Xi={id:"zone-info"},Zi=["innerHTML"];function qi(i,e,t,o,r,s){var n;return a.withDirectives((a.openBlock(),a.createElementBlock("div",Xi,[a.createElementVNode("div",{class:"close",onClick:e[0]||(e[0]=l=>r.showZone=!1)},"X"),a.createElementVNode("div",{class:"rich-context",innerHTML:(n=r.form)==null?void 0:n.name},null,8,Zi)],512)),[[a.vShow,r.showZone]])}const Ji=S(Gi,[["render",qi],["__scopeId","data-v-a133d0b8"]]),Vo="",Yi={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(i){return E.LngLatHelper.lat2pretty(i,4).pretty}},computeLng(){return function(i){return E.LngLatHelper.lng2pretty(i,4).pretty}}},watch:{port:{handler(){var i,e;this.port?(this.handleRender(),(i=this.map)==null||i.on("click",[this.layer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.layer],this.handleClick))}}},methods:{handleClick(i){var o;const e=i.features[0],t=(o=this.port)==null?void 0:o.features.filter(r=>{var s;return r.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 r=document.getElementById("port-info");this.marker?this.marker.setLngLat([i.lngLat.lng,i.lngLat.lat]):this.marker=new $.Marker(r).setLngLat([i.lngLat.lng,i.lngLat.lat]).setOffset([0,0]).addTo(this.map)}},handleEmit(){this.$emit("port",this.form)},handleRender(){var i;this.map?this.port&&(this.map.getSource(this.source)?(i=this.map)==null||i.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":.3,"icon-image":"port","text-anchor":"left","text-field":"{name}","text-rotation-alignment":"viewport","text-size":13,"text-offset":[1,0]},paint:{"text-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":2,"text-halo-blur":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)}}},ne=i=>(a.pushScopeId("data-v-b4281aec"),i=i(),a.popScopeId(),i),Ki={id:"port-info"},Qi={class:"port-box"},er={class:"flex-space"},tr=ne(()=>a.createElementVNode("label",null,"Name",-1)),ar={class:"flex-space"},ir=ne(()=>a.createElementVNode("label",null,"Position",-1)),rr={class:"flex-space"},or=ne(()=>a.createElementVNode("label",null,"LoCode",-1)),sr={class:"flex-space"},nr=ne(()=>a.createElementVNode("label",null,"Region",-1));function lr(i,e,t,o,r,s){return a.withDirectives((a.openBlock(),a.createElementBlock("div",Ki,[a.createElementVNode("div",{class:"close",onClick:e[0]||(e[0]=n=>r.showPort=!1)},"X"),a.createElementVNode("div",Qi,[a.createElementVNode("div",er,[tr,a.createElementVNode("span",{class:"link",onClick:e[1]||(e[1]=(...n)=>s.handleEmit&&s.handleEmit(...n))},a.toDisplayString(r.form.name),1)]),a.createElementVNode("div",ar,[ir,a.createElementVNode("span",null,a.toDisplayString(s.computeLat(r.form.lat))+", "+a.toDisplayString(s.computeLng(r.form.lng)),1)]),a.createElementVNode("div",rr,[or,a.createElementVNode("span",null,a.toDisplayString(r.form.loCode||"-"),1)]),a.createElementVNode("div",sr,[nr,a.createElementVNode("span",null,a.toDisplayString(r.form.city||"-")+", "+a.toDisplayString(r.form.country||"-"),1)])])],512)),[[a.vShow,r.showPort]])}const cr=S(Yi,[["render",lr],["__scopeId","data-v-b4281aec"]]),hr={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 dr(i,e,t,o,r,s){return a.openBlock(),a.createElementBlock("div")}const pr=S(hr,[["render",dr]]),mr={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 fr(i,e,t,o,r,s){return a.openBlock(),a.createElementBlock("div")}const yr=S(mr,[["render",fr]]),ur={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":.5,"fill-color":"#9ec3ba"}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.3,"icon-image":"{icon}","text-anchor":"left","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":12,"text-offset":[1,0]},paint:{"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 gr(i,e,t,o,r,s){return a.openBlock(),a.createElementBlock("div")}const _r=S(ur,[["render",gr]]),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(i=>{i.geometry.type==="Polygon"&&i.geometry.coordinates.forEach(e=>E.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":.5,"fill-color":["match",["get","val"],"DefaultStyle","#CA7C7C","JWCriskArea","#CA7C7C","#ffffff"]}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.3,"icon-image":"{icon}","text-anchor":"left","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":12,"text-offset":[1,0]},paint:{"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 br(i,e,t,o,r,s){return a.openBlock(),a.createElementBlock("div")}const wr=S(Lr,[["render",br]]),vr={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 xr(i,e,t,o,r,s){return a.openBlock(),a.createElementBlock("div")}const Sr=S(vr,[["render",xr]]),Io="",Er={name:"IdmLatLng",props:{map:{type:Object},show:{type:Boolean},left:{type:String,default:"10px"},bottom:{type:String,default:"70px"}},data(){return{lngLat:void 0,source:"idm-lat-lng-source",layer:"idm-lat-lng-layer",labelLayer:"idm-lat-lng-label-layer"}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){var i;this.map&&((i=this.map)==null||i.on("mousemove",this.handleMouseMove))},immediate:!0}},methods:{handleBind(){var i,e;this.show?((i=this.map)==null||i.on("zoomend",this.handleZoomEnd),this.handleRender()):(this.handleClear(),(e=this.map)==null||e.off("zoomend",this.handleZoomEnd))},handleMouseMove(i){const e=i.lngLat,t=E.LngLatHelper.lng2pretty(e.lng,2),o=E.LngLatHelper.lat2pretty(e.lat,2);this.lngLat={lng:t,lat:o}},handleComputeLatLngs(){var o;const i=(o=this.map)==null?void 0:o.getZoom();console.log(i);let e=30;i>4?e=10:i>3&&(e=15);const t=[];for(let r=-60;r<90;r+=e)t.push({type:"Feature",geometry:{type:"LineString",coordinates:[[-180,r],[180,r]]}});for(let r=-180;r<180;r+=e)t.push({type:"Feature",geometry:{type:"LineString",coordinates:[[r,-90],[r,90]]}});for(let r=180;r>-180;r-=e)for(let s=-60;s<90;s+=e)t.push({type:"Feature",geometry:{type:"Point",coordinates:[r,s]},properties:{val:`${s>0?s+" N":s===0?s:s*-1+" S"}, ${r>0?r+" E":r*-1+" W"}`}});return t},handleZoomEnd(){var e;const i=this.handleComputeLatLngs();(e=this.map)==null||e.getSource(this.source).setData(x.featureCollection(i))},handleRender(){if(this.map){const i=this.handleComputeLatLngs();this.map.addSource(this.source,{type:"geojson",data:{type:"FeatureCollection",features:i}}),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 i,e,t,o,r,s;(i=this.map)!=null&&i.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)),(r=this.map)!=null&&r.getSource(this.source)&&((s=this.map)==null||s.removeSource(this.source))}}},Cr=(i=>(a.pushScopeId("data-v-b9e40dad"),i=i(),a.popScopeId(),i))(()=>a.createElementVNode("span",null,", ",-1));function kr(i,e,t,o,r,s){return r.lngLat?(a.openBlock(),a.createElementBlock("div",{key:0,class:"lat-lng-tip",style:a.normalizeStyle({left:t.left,bottom:t.bottom})},[a.createElementVNode("span",null,a.toDisplayString(r.lngLat.lat.pretty),1),Cr,a.createElementVNode("span",null,a.toDisplayString(r.lngLat.lng.pretty),1)],4)):a.createCommentVNode("",!0)}const _e=S(Er,[["render",kr],["__scopeId","data-v-b9e40dad"]]),Pr={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 i,e,t,o,r,s,n,l,c,h;if(this.show)(i=this.map)==null||i.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),(r=this.map)==null||r.on("contextmenu",this.handleContextmenu),this.map&&(this.map.getCanvas().style.cursor="crosshair");else{(s=this.map)==null||s.getCanvas().removeEventListener("keydown",this.handleKeydown),(n=this.map)==null||n.off("mousemove",this.handleMove),(l=this.map)==null||l.off("dblclick",this.handleDblClick),(c=this.map)==null||c.off("click",this.handleClick),(h=this.map)==null||h.off("contextmenu",this.handleContextmenu);for(const m of this.geojson)this.handleClear(m,!0);this.geojson=[],this.map&&(this.map.getCanvas().style.cursor="grab")}},handleKeydown(i){if(i.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(i){var t,o,r,s,n,l,c,h,m,p;const e=(o=(t=i.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(d=>d.id===e.split("-")[0])[0];this.pointMarkers[g.id].filter(d=>{var _;return((_=d._element)==null?void 0:_.id)===e})[0].setLngLat([(s=(r=i.target)==null?void 0:r._lngLat)==null?void 0:s.lng,(l=(n=i.target)==null?void 0:n._lngLat)==null?void 0:l.lat]);let L;g.features.forEach((d,_)=>{if(d.geometry.type==="Point"&&d.properties.id==e.split("-")[1]){L=_;return}});const y=g.features.filter(d=>d.geometry.type==="Point");this.handleTmpPointUpdate(g,y[L-1],{lng:(h=(c=i.target)==null?void 0:c._lngLat)==null?void 0:h.lng,lat:(p=(m=i.target)==null?void 0:m._lngLat)==null?void 0:p.lat,properties:y[L].properties},L===y.length-1?void 0:y[L+1])}},handleDragEnd(i){var t,o,r,s,n,l,c,h,m,p;const e=(o=(t=i.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(y=>y.id===e.split("-")[0])[0];this.pointMarkers[g.id].filter(y=>{var d;return((d=y._element)==null?void 0:d.id)===e})[0].setLngLat([(s=(r=i.target)==null?void 0:r._lngLat)==null?void 0:s.lng,(l=(n=i.target)==null?void 0:n._lngLat)==null?void 0:l.lat]);const L=g.features.filter(y=>y.geometry.type==="Point"&&y.properties.id==e.split("-")[1])[0];L.geometry.coordinates=[(h=(c=i.target)==null?void 0:c._lngLat)==null?void 0:h.lng,(p=(m=i.target)==null?void 0:m._lngLat)==null?void 0:p.lat],g.features=g.features.filter(y=>y.geometry.type==="Point"),this.handlePointUpdate(g)}},handleContextmenu(i){var t,o,r,s;i.preventDefault(),(t=this.contextmenu)==null||t.remove();const e=(s=(r=(o=i.originalEvent)==null?void 0:o.target)==null?void 0:r.parentElement)==null?void 0:s.id;if((e==null?void 0:e.split("-").length)===2){const l=this.geojson.filter(c=>c.id===e.split("-")[0])[0].features.filter(c=>c.geometry.type==="Point");if(l.length>2&&l.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 $.Marker(h).setOffset([24,0]).setLngLat([i.lngLat.lng,i.lngLat.lat]).addTo(this.map)}}},handleClick(i){var t,o,r,s,n;(t=this.contextmenu)==null||t.remove();const e=i.originalEvent.target.className;if(e==="marker-close"){const l=(r=(o=i.originalEvent)==null?void 0:o.srcElement)==null?void 0:r.id,c=this.geojson.filter(h=>h.id===l)[0];c&&this.handleClear(c,!0),this.geojson=this.geojson.filter(h=>h.id!==l)}else if(e==="del-point"){const l=(n=(s=i.originalEvent.target.id)==null?void 0:s.replace("del-",""))==null?void 0:n.split("-"),c=this.geojson.filter(h=>h.id===l[0])[0];c.features=c.features.filter(h=>h.geometry.type==="Point"&&h.properties.id!==l[1]),this.handlePointUpdate(c)}else if(e!=="marker-label"){let l=this.geojson.at(-1);l||(l=x.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(l)),l.features=l.features.filter(h=>h.geometry.type==="Point");const c=x.feature({type:"Point",coordinates:[i.lngLat.lng,i.lngLat.lat]},{id:new Date().getTime().toString(),mode:this.navigation});l.features.push(c),this.handlePointUpdate(l)}},handlePointUpdate(i){const e=i.features;if(e.length>1){let t=0;const o=[];for(let r=1;r[L.lng,L.lat]));f.properties.dist=m,f.properties.bearing=p,f.properties.total=t,o.push(f)}e.push(...o),i.total=t}return this.handleRender(i),i},handleTmpPointUpdate(i,e,t,o){const r=x.featureCollection([]);let s,n;if(e){const c=e.properties,h={lng:e.geometry.coordinates[0],lat:e.geometry.coordinates[1]},m={lng:t.lng,lat:t.lat};s=E.LaneHelper.calculateDistance(h,m,c.mode==="RL",2),n=E.LaneHelper.calculateBearing(h,m,c.mode==="RL",2);let p;c.mode==="RL"?p=E.LngLatHelper.convertToMonotonicLng([h,m]):p=E.LngLatHelper.convertToMonotonicLng(E.LaneHelper.interpolateCoordinates(h,m,200));const g=x.lineString(p.map(f=>[f.lng,f.lat]));g.properties.dist=s,g.properties.bearing=n,r.features.push(g)}if(o){const c=t.properties,h=t,m={lng:o.geometry.coordinates[0],lat:o.geometry.coordinates[1]};s=E.LaneHelper.calculateDistance(h,m,c.mode==="RL",2),n=E.LaneHelper.calculateBearing(h,m,c.mode==="RL",2);let p;c.mode==="RL"?p=E.LngLatHelper.convertToMonotonicLng([h,m]):p=E.LngLatHelper.convertToMonotonicLng(E.LaneHelper.interpolateCoordinates(h,m,200));const g=x.lineString(p.map(f=>[f.lng,f.lat]));g.properties.dist=s,g.properties.bearing=n,r.features.push(g)}this.map.getSource(this.tmpSource)?this.map.getSource(this.tmpSource).setData(r):this.map.addSource(this.tmpSource,{type:"geojson",data:r}),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 l;if(o?l='
Drag and drop
':l=`
Tol distance: ${E.LngLatHelper.roundPrecision((i.total??0)+s,2)}nm, bearing: ${n}°
${this.navigation==="RL"?"RL":"GC"} mode, using 'Shift' to switch
Double click to end
`,this.tipMarker)this.tipMarker._element.innerHTML=l,this.tipMarker.setLngLat([t.lng,t.lat]);else{const c=document.createElement("div");c.className="tip-marker",c.innerHTML=l,this.tipMarker=new $.Marker(c).setOffset([140,0]).setLngLat([t.lng,t.lat]).addTo(this.map)}},handleMove(i){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:i.lngLat.lng,lat:i.lngLat.lat})},handleDblClick(i){i.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(i){var e;if((e=i==null?void 0:i.features)!=null&&e.length){const t=`${i.id}-${this.source}`,o=`${i.id}-${this.layer}`,r=`${i.id}-${this.labelLayer}`;this.map.getSource(t)?this.map.getSource(t).setData(i):this.map.addSource(t,{type:"geojson",data:i}),this.handleClear(i,!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:r,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=i.features.filter(n=>n.geometry.type==="Point");for(const n of s){const l=document.createElement("div");l.id=`${i.id}-${n.properties.id}`,l.className=`${i.closed?"point-marker closed":"point-marker"}`,l.innerHTML='
';const c=new $.Marker({element:l,draggable:!0,contextmenu:!0}).setLngLat(n.geometry.coordinates).addTo(this.map);c.on("drag",this.handleDrag),c.on("dragend",this.handleDragEnd),this.pointMarkers[i.id]?this.pointMarkers[i.id].push(c):this.pointMarkers[i.id]=[c]}if(i.closed){const n=s.at(-1),c=i.features.filter(m=>m.geometry.type==="LineString").at(-1),h=document.createElement("div");h.className="point-summary-marker",h.innerHTML=`
×
Tol: ${c.properties.total}nm
`,this.closeMarkers[i.id]=new $.Marker(h).setOffset([60,0]).setLngLat(n.geometry.coordinates).addTo(this.map)}}},handleClear(i,e=!0){var s,n,l,c,h,m,p,g,f;const t=`${i.id}-${this.source}`,o=`${i.id}-${this.layer}`,r=`${i.id}-${this.labelLayer}`;(s=this.map)!=null&&s.getLayer(o)&&this.map.removeLayer(o),(n=this.map)!=null&&n.getLayer(r)&&this.map.removeLayer(r),(l=this.map)!=null&&l.getLayer(this.tmpLayer)&&this.map.removeLayer(this.tmpLayer),(c=this.map)!=null&&c.getLayer(this.tmpLabelLayer)&&this.map.removeLayer(this.tmpLabelLayer),(h=this.closeMarkers[i.id])==null||h.remove(),this.closeMarkers[i.id]=void 0,(m=this.pointMarkers[i.id])==null||m.forEach(L=>{L==null||L.remove()}),this.pointMarkers[i.id]=[],(p=this.tipMarker)==null||p.remove(),this.tipMarker=void 0,e&&((g=this.map)!=null&&g.getSource(t))&&this.map.removeSource(t),e&&((f=this.map)!=null&&f.getSource(this.tmpSource))&&this.map.removeSource(this.tmpSource)}}};function Tr(i,e,t,o,r,s){return a.openBlock(),a.createElementBlock("div")}const Nr=S(Pr,[["render",Tr]]),Bo="",Rr={name:"IdmENC",props:{map:{type:Object},enabled:{type:Boolean},weatherLayers:{type:Object,default:()=>({})},beforeLayer:{type:String,default:"land-structure-line"},left:{type:String,default:"10px"},bottom:{type:String,default:"64px"},token:{type:String,default:""}},data(){return{source:"enc-source",layer:"enc-layer",helper:C.CompanyHelper,vendor:this.$attrs.permission&C.CompanyHelper.LEVEL.Supper?"hi":"i4"}},watch:{enabled:{handler(){this.enabled?(this.handleRender(),Object.keys(this.weatherLayers).some(i=>{var e;return(e=this.weatherLayers)==null?void 0:e[i].active})?this.map.getLayer(this.layer)&&this.map.moveLayer(this.layer,this.beforeLayer):this.map.getLayer(this.layer)&&this.map.moveLayer(this.layer,"continent-label")):this.handleClear()}},weatherLayers:{handler(){Object.keys(this.weatherLayers).some(i=>{var e;return(e=this.weatherLayers)==null?void 0:e[i].active})?this.map.getLayer(this.layer)&&this.map.moveLayer(this.layer,this.beforeLayer):this.map.getLayer(this.layer)&&this.map.moveLayer(this.layer,"continent-label")},deep:!0},vendor:{handler(){var e;const i=(e=this.map)==null?void 0:e.getSource(this.source);i&&(this.vendor==="hi"?i.setTiles([`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}`]):i.setTiles(["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"]))},immediate:!0}},methods:{handleRender(){if(!this.map)setTimeout(()=>{this.handleRender()},500);else{this.handleClear();let i;this.vendor==="hi"?i=[`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}`]:i=["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"],this.map.addSource(this.source,{type:"raster",tiles:i,titleSize:256,minzoom:5}),this.map.addLayer({id:this.layer,type:"raster",source:this.source,layout:{visibility:"visible"}},this.beforeLayer)}},handleClear(){var i,e;(i=this.map)!=null&&i.getLayer(this.layer)&&this.map.removeLayer(this.layer),(e=this.map)!=null&&e.getSource(this.source)&&this.map.removeSource(this.source)}}},Vr={class:"legend-bars"};function Ir(i,e,t,o,r,s){return t.enabled&&i.$attrs.permission&r.helper.LEVEL.Supper?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle({position:"absolute",left:t.left,bottom:t.bottom})},[a.createElementVNode("div",Vr,[a.createElementVNode("div",{class:a.normalizeClass(r.vendor==="hi"?"active":""),onClick:e[0]||(e[0]=n=>r.vendor="hi")},"HI",2),a.createElementVNode("div",{class:a.normalizeClass(r.vendor==="i4"?"active":""),onClick:e[1]||(e[1]=n=>r.vendor="i4")},"I4",2)])],4)):a.createCommentVNode("",!0)}const Dr=S(Rr,[["render",Ir],["__scopeId","data-v-edf7d3c0"]]),Ao="",Br={name:"IdmGLV2",components:{IdmGlLayer:St,IdmWindBarb:Rt,IdmWindParticle:Bt,IdmCurrents:Wt,IdmCurrentParticle:Gt,IdmSigWave:Yt,IdmSigWaveRamp:ta,IdmSwell:ra,IdmPrmsl:na,IdmIceberg:ha,IdmTropicals:ge,IdmPrecip3h:Ua,IdmVisibility:Za,IdmWaterTemp:Ka,IdmTemp:ai,IdmArctic:si,IdmWarZone:Oi,IdmGmdssArea:Wi,IdmEcaZone:Hi,IdmAlertZone:Ji,IdmPort:cr,IdmLoadLine:pr,IdmTimezone:yr,IdmVRA:_r,IdmSpecialArea:wr,IdmTerminator:Sr,IdmLatLng:_e,IdmMeasure:Nr,IdmPoint:Ai,IdmENC:Dr},props:{map:{type:Object},token:{type:String},ts:{type:String},beforeLayer:{type:String,default:"country-boundaries"}},emits:["tropicals"],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",zoom:6,viewport:void 0,particleFactor:void 0,showRampColor:!1,activeWindLayer:!1,showWindParticle:!1,showCurrentParticle:!1,rampFactor:void 0}},watch:{ts:{handler(){this.ts&&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 ue(this.map),this.handleRampColorInitial())},immediate:!0}},methods:{async fetchWeatherLayers(i={tropicals:!1}){var r,s,n,l,c,h,m,p;const e=new Date().valueOf();let t=0,o=0;if(this.map){const g=((r=this.map)==null?void 0:r.getZoom())+1,f=(s=this.map)==null?void 0:s.getBounds(),L=`${f._sw.lng},${f._sw.lat},${f._ne.lng},${f._ne.lat}`;if(this.handleRampColorState(),this.particleFactor){const y=C.LayerHelper.WEATHER_LAYERS.find(d=>{var _;return((_=d.peer)==null?void 0:_.weight)===this.particleFactor.weight});this.particleFactor.particle?this.weatherWeight=this.weatherWeight&y.weight?this.weatherWeight:this.weatherWeight+y.weight:this.weatherWeight=this.weatherWeight&y.weight?this.weatherWeight-y.weight:this.weatherWeight}if(this.rampFactor){const y=C.LayerHelper.WEATHER_LAYERS.find(d=>{var _;return((_=d.peer)==null?void 0:_.weight)===this.rampFactor.weight});this.rampFactor.ramp?this.weatherWeight=this.weatherWeight&y.weight?this.weatherWeight:this.weatherWeight+y.weight:this.weatherWeight=this.weatherWeight&y.weight?this.weatherWeight-y.weight:this.weatherWeight}if(this.weatherWeight>0){let y=this.weatherWeight,d;if(i.tropicals||this.weatherWeight&256&&(d=this.weatherLayers.tropicals,d&&(y-=256,d.version=Math.random()+1)),y>0){const _=await O.get(`${this.gateway}/api/arc/weather/layers/links?l=${y}&v=${this.source}&z=${g}&bbox=${L}&t=${this.ts}`,{headers:{Authorization:this.token}});if(o=new Date().valueOf()-(e+t),console.log("weather links elapsed: ",o,", total: ",t+=o),((n=_==null?void 0:_.data)==null?void 0:n.code)===0){const u=(l=_==null?void 0:_.data)==null?void 0:l.data,w=[];for(const b in u)b!=="tropicals"&&w.push(O.get(u[b],{headers:{Authorization:this.token,key:b},responseType:/\.(jpg|png)$/.test(u[b])?"blob":"json"}).catch(T=>{console.log(`[${b}] fetch layer error: ${T}`)}));const v=await Promise.all(w);this.weatherLayers={},v.map(b=>{var I,B,A,z;const T=((I=b==null?void 0:b.data)==null?void 0:I.data)||(b==null?void 0:b.data),R=(A=(B=b==null?void 0:b.config)==null?void 0:B.headers)==null?void 0:A.key;R&&T&&(this.weatherLayers[R]={raw:T,type:((z=b==null?void 0:b.config)==null?void 0:z.responseType)==="blob"?"image":"json",etime:this.ts})}),u.tropicals&&O.get(u.tropicals,{headers:{Authorization:this.token,key:"tropicals"}}).then(b=>{var I,B,A,z;const T=E.TropicalHelper.convert2Geojson(((I=b==null?void 0:b.data)==null?void 0:I.data)||(b==null?void 0:b.data));this.$emit("tropicals",{raw:(B=b==null?void 0:b.data)==null?void 0:B.data,geojson:T});const R=(z=(A=b==null?void 0:b.config)==null?void 0:A.headers)==null?void 0:z.key;this.weatherLayers[R]={data:T,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 u=(c=this.weatherLayers["swell-direction"])==null?void 0:c.raw,w=(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:u,height:{raw:w},etime:this.ts}}if(this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const u=(m=this.weatherLayers["current-direction"])==null?void 0:m.raw,w=(p=this.weatherLayers["current-speed"])==null?void 0:p.raw;delete this.weatherLayers["current-direction"],delete this.weatherLayers["current-speed"],this.weatherLayers.current={type:"json",direction:u,speed:{raw:w},etime:this.ts}}}d&&(d.etime=this.ts,d.cached=!0,this.weatherLayers.tropicals=d)}this.handleWeatherLayerToggle(),this.handleDragEndWithZoom4Json()}},async fetchOtherLayers(i={all:!1,dayNight:!1,enc:!1}){var e,t,o,r;if(this.map){let s=this.otherWeight;if(s){let n=!1;if(this.otherWeight&2048&&(s=this.otherWeight-2048,n=!0),s){if(i.all){const l=await O.get(`${this.gateway}/api/arc/other/layers/links?l=${s}&t=${this.ts}`,{headers:{Authorization:this.token}});if(((e=l==null?void 0:l.data)==null?void 0:e.code)===0){const c=(t=l==null?void 0:l.data)==null?void 0:t.data,h=[];for(const p in c)h.push(O.get(c[p],{headers:{Authorization:this.token,key:p}}));const m=await Promise.all(h);this.otherLayers={enc:n},m.map(p=>{var L,y,d;const g=((L=p==null?void 0:p.data)==null?void 0:L.data)||(p==null?void 0:p.data),f=(d=(y=p==null?void 0:p.config)==null?void 0:y.headers)==null?void 0:d.key;this.otherLayers[f]=g})}}else if(i.dayNight&&s&1024){const l=await O.get(`${this.gateway}/api/arc/other/layers/links?l=1024&t=${this.ts}`,{headers:{Authorization:this.token}});if(((o=l==null?void 0:l.data)==null?void 0:o.code)===0){const c=(r=l==null?void 0:l.data)==null?void 0:r.data,h=[];for(const p in c)h.push(O.get(c[p],{headers:{Authorization:this.token,key:p}}));(await Promise.all(h)).map(p=>{var L,y,d;const g=((L=p==null?void 0:p.data)==null?void 0:L.data)||(p==null?void 0:p.data),f=(d=(y=p==null?void 0:p.config)==null?void 0:y.headers)==null?void 0:d.key;this.otherLayers[f]=g})}}}else this.otherLayers={enc:n}}else this.otherLayers={};this.handleBeforeLayerToggle()}},handleRampColorState(){var i;if(this.showRampColor=!1,this.showWindParticle=!1,this.showCurrentParticle=!1,(i=this.particleFactor)!=null&&i.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 i,e,t,o,r,s,n,l,c,h,m,p;this.viewport.map.getSource((i=this.viewport)==null?void 0:i.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:(r=this.viewport)==null?void 0:r.rampColorLayer,source:(s=this.viewport)==null?void 0:s.rampColorSource,layout:{visibility:"none"}},this.beforeLayer),this.viewport.map.getSource((n=this.viewport)==null?void 0:n.particleSource)||this.viewport.map.addSource((l=this.viewport)==null?void 0:l.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:(m=this.viewport)==null?void 0:m.particleLayer,source:(p=this.viewport)==null?void 0:p.particleSource,layout:{visibility:"none"}},this.beforeLayer)},handleDragEndWithZoom4Json(){var h,m,p,g;const i=new Date().valueOf();let e=0,t=0;const o=(h=this.map)==null?void 0:h.getBounds(),r=this.map.getZoom(),s=C.convertToStandardLng(o._sw.lng),n=C.convertToStandardLng(o._ne.lng),l=Math.floor(o._sw.lat),c=Math.ceil(o._ne.lat);for(const f in this.weatherLayers)if(this.weatherLayers[f].active&&this.weatherLayers[f].type==="json"){this.weatherLayers[f].active=!1,this.weatherLayers[f].version=Math.random()+1;let L=[];if(["swell","current"].includes(f)){const y=((m=this.weatherLayers[f])==null?void 0:m.direction)||{};for(const d in y)if(d>l&&dn?_.forEach((u,w)=>{var v;if((u>=s&&u<=180||u>=-180&&u<=n)&&(!(r<=this.zoom)||u%(r{var v;if(u>=s&&u<=n&&(!(r<=this.zoom)||u%(ru.properties.val>.5):d.data.features;L=L.concat(_),t=new Date().valueOf()-(i+e),console.log("speed elapsed: ",t,", total: ",e+=t)}}}else if(f==="wind"){const y=this.weatherLayers.wind.raw;for(const d in y)if(d>l&&dn?_.forEach((u,w)=>{if((u>=s&&u<=180||u>=-180&&u<=n)&&(!(r<=this.zoom)||u%(r{if(u>=s&&u<=n&&(!(r<=this.zoom)||u%(r{u=C.convertToStandardLng(u),d.push(x.point([u,_],{val:y.Point[_].val[w],type:y.Point[_].type[w]}))});L=L.concat(d)}}t=new Date().valueOf()-(i+e),console.log("prmsl elapsed: ",t,", total: ",e+=t)}else if(f==="arctic"||f==="iceberg"){if(this.weatherLayers[f].data)L=this.weatherLayers[f].data;else{const y=this.weatherLayers[f].raw;if(y){const d=[];for(const _ in y.LineString){const u=y.LineString[_];for(const w of u)d.push(x.lineString(w,{val:Number(_)}))}L=L.concat(d)}}t=new Date().valueOf()-(i+e)}console.log(f," elapsed: ",t,", total: ",e+=t),L.length&&(this.weatherLayers[f].data=x.featureCollection(L)),this.weatherLayers[f].active=!0,this.weatherLayers[f].version=Math.random()+1}},handleDragEndWithZoom4Image(){for(const i in this.weatherLayers)this.weatherLayers[i].active&&this.weatherLayers[i].type==="image"&&(this.weatherLayers[i].active=!0,this.weatherLayers[i].version=Math.random()+1)},handleBboxClip(i,e){const t=[],o=C.convertToStandardLng(e._sw.lng),r=C.convertToStandardLng(e._ne.lng);return i.features.forEach(s=>{if(s.geometry.type!=="Point")if(o>r){let n=[o,e._sw.lat,180,e._ne.lat],l=x.bboxClip(s,n);l.geometry.coordinates.length&&t.push(l),n=[-180,e._sw.lat,r,e._ne.lat],l=x.bboxClip(s,n),l.geometry.coordinates.length&&t.push(l)}else{const n=[o,e._sw.lat,r,e._ne.lat],l=x.bboxClip(s,n);l.geometry.coordinates.length&&t.push(l)}else t.push(s)}),t},handleWeatherLayerToggle(){var i;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,((i=this.particleFactor)==null?void 0:i.key)===t&&this.weatherLayers[`${t}-particle`]&&(this.weatherLayers[`${t}-particle`].active=this.particleFactor.particle),e.key==="sig-wave"&&e.ramp&&(this.weatherLayers["sig-wave-height"].active=!1))}this.handleBeforeLayerToggle()},handleBeforeLayerToggle(){var i,e,t,o,r,s,n,l,c,h,m,p,g;(i=this.map)!=null&&i.getLayer(this.beforeLayer)&&((e=this.activeWeatherLayers)!=null&&e.length||(t=this.otherLayers)!=null&&t["war-zones"]||(o=this.otherLayers)!=null&&o["gmdss-areas"]||(r=this.otherLayers)!=null&&r["load-lines"]||(s=this.otherLayers)!=null&&s["high-risk-area"]||(n=this.otherLayers)!=null&&n["time-zones"]||(l=this.otherLayers)!=null&&l.pirates||(c=this.otherLayers)!=null&&c.ports||(h=this.otherLayers)!=null&&h.enc||(m=this.otherLayers)!=null&&m["voluntary-reporting-area"]||(p=this.otherLayers)!=null&&p["eca-zones"]||(g=this.otherLayers)!=null&&g["special-area"]?this.map.setLayoutProperty(this.beforeLayer,"visibility","visible"):this.map.setLayoutProperty(this.beforeLayer,"visibility","none"))},handleDateChange(i={tropicals:!1}){this.fetchWeatherLayers(i),this.fetchOtherLayers({dayNight:!0})},handleWeatherLayerChange(i,e,t){if(!this.map)setTimeout(()=>{this.handleWeatherLayerChange(i,e,t)},500);else{this.activeWeatherLayers=e,this.activeWeatherLayers.some(r=>["png","jpg"].includes(r.type))&&this.particleFactor&&(this.particleFactor.particle=!1,this.rampFactor={ramp:!1,key:"sigWave",weight:16});const o=e==null?void 0:e.reduce((r,s)=>r+(r&(s==null?void 0:s.weight)?0:s==null?void 0:s.weight),0);this.weatherWeight!==o||this.source!==t?(this.source=t,this.weatherWeight=o,this.fetchWeatherLayers({tropicals:!1})):this.handleWeatherLayerToggle()}},handleOtherLayerChange(i){if(!this.map)setTimeout(()=>{this.handleOtherLayerChange(i)},500);else{const e=i==null?void 0:i.reduce((t,o)=>t+(o==null?void 0:o.weight),0);this.otherWeight!=e&&(this.otherWeight=e,this.fetchOtherLayers({all:!0}))}},async handlePointChange(i){const e=this.ts?W(this.ts):W(),t={lat:i.lat,lng:i.lng,ts:e.utc().format(),wt:!0,src:this.source},o=await O.get(`${this.gateway}/api/arc/meteo/query`,{params:t,headers:{Authorization:this.token}});(o==null?void 0:o.status)===200&&(this.meteo={...o==null?void 0:o.data,...i})},handle3dToggle(i){i?this.map.setProjection("globe"):this.map.setProjection("mercator")},handleParticle(i){this.particleFactor=i,this.particleFactor.particle&&(this.rampFactor=i={ramp:!1,key:"sigWave",weight:16}),this.fetchWeatherLayers({tropicals:!1})},handleRamp(i){this.rampFactor=i,this.rampFactor.ramp?(this.particleFactor={particle:!1,key:"wind",weight:1},this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.key!=="sig-wave"&&!["png","jpg"].includes(e.type)),this.activeWeatherLayers.push({enabled:!0,h5:!0,key:"sig-wave",name:"Sig Waves",type:"jpg",weight:524304,ramp:!0})):this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.key!=="sig-wave"),this.fetchWeatherLayers({tropicals:!1})}}},Ar={key:0,class:"map-gl-home"};function zr(i,e,t,o,r,s){var j,U,H,G,X,Z,q,J,Y,K,Q,ee,te,ae,ie,re,oe,be,we,ve,xe,Se,Ee,Ce,ke,Pe,Te,Ne,Re,Ve,Ie,De,Be,Ae,ze,$e,Oe,Fe,Me,We,je,Ue;const n=a.resolveComponent("IdmGlLayer"),l=a.resolveComponent("IdmENC"),c=a.resolveComponent("IdmSigWave"),h=a.resolveComponent("IdmSigWaveRamp"),m=a.resolveComponent("IdmSwell"),p=a.resolveComponent("IdmPrmsl"),g=a.resolveComponent("IdmIceberg"),f=a.resolveComponent("IdmTropicals"),L=a.resolveComponent("IdmCurrents"),y=a.resolveComponent("IdmCurrentParticle"),d=a.resolveComponent("IdmWindBarb"),_=a.resolveComponent("IdmWindParticle"),u=a.resolveComponent("IdmPrecip3h"),w=a.resolveComponent("IdmVisibility"),v=a.resolveComponent("IdmWaterTemp"),b=a.resolveComponent("IdmTemp"),T=a.resolveComponent("IdmArctic"),R=a.resolveComponent("IdmWarZone"),I=a.resolveComponent("IdmGmdssArea"),B=a.resolveComponent("IdmEcaZone"),A=a.resolveComponent("IdmAlertZone"),z=a.resolveComponent("IdmPort"),le=a.resolveComponent("IdmLoadLine"),ce=a.resolveComponent("IdmTimezone"),he=a.resolveComponent("IdmVRA"),de=a.resolveComponent("IdmSpecialArea"),pe=a.resolveComponent("IdmTerminator"),me=a.resolveComponent("IdmLatLng"),fe=a.resolveComponent("IdmMeasure"),ye=a.resolveComponent("IdmPoint");return t.map?(a.openBlock(),a.createElementBlock("div",Ar,[a.createVNode(n,a.mergeProps({ref:"layer",map:t.map},i.$attrs,{onWeather:s.handleWeatherLayerChange,onOther:s.handleOtherLayerChange,onCoordinate:e[0]||(e[0]=se=>r.showCoord=se),onMeasure:e[1]||(e[1]=se=>r.showMeasure=se),onPoint:e[2]||(e[2]=se=>r.showPoint=se),on3d:s.handle3dToggle}),null,16,["map","onWeather","onOther","on3d"]),a.createVNode(l,a.mergeProps({map:t.map,token:t.token,"weather-layers":r.weatherLayers,enabled:(j=r.otherLayers)==null?void 0:j.enc},i.$attrs),null,16,["map","token","weather-layers","enabled"]),a.createVNode(c,a.mergeProps({ref:"sigWave",map:t.map,"sig-wave":(U=r.weatherLayers)==null?void 0:U["sig-wave-height"],"before-layer":t.beforeLayer,"margin-bottom":(G=(H=r.weatherLayers)==null?void 0:H.wind)!=null&&G.active&&((Z=(X=r.weatherLayers)==null?void 0:X.current)!=null&&Z.active)&&r.showRampColor?"108px":((J=(q=r.weatherLayers)==null?void 0:q.wind)!=null&&J.active||(K=(Y=r.weatherLayers)==null?void 0:Y.current)!=null&&K.active)&&r.showRampColor?"82px":(ee=(Q=r.weatherLayers)==null?void 0:Q.wind)!=null&&ee.active||(ae=(te=r.weatherLayers)==null?void 0:te.current)!=null&&ae.active||r.showRampColor?"56px":"30px"},i.$attrs,{onRamp:s.handleRamp}),null,16,["map","sig-wave","before-layer","margin-bottom","onRamp"]),a.createVNode(h,a.mergeProps({viewport:r.viewport,factor:(ie=r.weatherLayers)==null?void 0:ie["sig-wave"],"before-layer":t.beforeLayer},i.$attrs),null,16,["viewport","factor","before-layer"]),a.createVNode(m,a.mergeProps({map:t.map,swell:(re=r.weatherLayers)==null?void 0:re.swell,"before-layer":t.beforeLayer},i.$attrs),null,16,["map","swell","before-layer"]),a.createVNode(p,a.mergeProps({map:t.map,prmsl:(oe=r.weatherLayers)==null?void 0:oe.prmsl,"before-layer":t.beforeLayer},i.$attrs),null,16,["map","prmsl","before-layer"]),a.createVNode(g,a.mergeProps({map:t.map,iceberg:(be=r.weatherLayers)==null?void 0:be.iceberg,"before-layer":t.beforeLayer},i.$attrs),null,16,["map","iceberg","before-layer"]),a.createVNode(f,a.mergeProps({map:t.map,date:t.ts,tropicals:(we=r.weatherLayers)==null?void 0:we.tropicals,"before-layer":t.beforeLayer},i.$attrs),null,16,["map","date","tropicals","before-layer"]),a.createVNode(L,a.mergeProps({map:t.map,current:(ve=r.weatherLayers)==null?void 0:ve.current,"before-layer":t.beforeLayer,"show-particle":r.showCurrentParticle,"margin-bottom":(Se=(xe=r.weatherLayers)==null?void 0:xe.wind)!=null&&Se.active&&r.showRampColor?"82px":(Ce=(Ee=r.weatherLayers)==null?void 0:Ee.wind)!=null&&Ce.active||r.showRampColor?"58px":"30px"},i.$attrs,{onParticle:s.handleParticle}),null,16,["map","current","before-layer","show-particle","margin-bottom","onParticle"]),a.createVNode(y,a.mergeProps({viewport:r.viewport,factor:(ke=r.weatherLayers)==null?void 0:ke["current-particle"],"before-layer":t.beforeLayer},i.$attrs),null,16,["viewport","factor","before-layer"]),a.createVNode(d,a.mergeProps({map:t.map,wind:(Pe=r.weatherLayers)==null?void 0:Pe.wind,"before-layer":t.beforeLayer,"margin-bottom":r.showRampColor?"56px":"30px","show-particle":r.showWindParticle},i.$attrs,{onParticle:s.handleParticle}),null,16,["map","wind","before-layer","margin-bottom","show-particle","onParticle"]),a.createVNode(_,a.mergeProps({viewport:r.viewport,factor:(Te=r.weatherLayers)==null?void 0:Te["wind-particle"],"before-layer":t.beforeLayer},i.$attrs),null,16,["viewport","factor","before-layer"]),a.createVNode(u,a.mergeProps({viewport:r.viewport,factor:(Ne=r.weatherLayers)==null?void 0:Ne.precip3h,"before-layer":t.beforeLayer},i.$attrs),null,16,["viewport","factor","before-layer"]),a.createVNode(w,a.mergeProps({viewport:r.viewport,factor:(Re=r.weatherLayers)==null?void 0:Re.visibility,"before-layer":t.beforeLayer},i.$attrs),null,16,["viewport","factor","before-layer"]),a.createVNode(v,a.mergeProps({viewport:r.viewport,factor:(Ve=r.weatherLayers)==null?void 0:Ve["water-temp"],"before-layer":t.beforeLayer},i.$attrs),null,16,["viewport","factor","before-layer"]),a.createVNode(b,a.mergeProps({viewport:r.viewport,factor:(Ie=r.weatherLayers)==null?void 0:Ie.temp,"before-layer":t.beforeLayer},i.$attrs),null,16,["viewport","factor","before-layer"]),a.createVNode(T,a.mergeProps({viewport:r.viewport,factor:(De=r.weatherLayers)==null?void 0:De.arctic,"before-layer":t.beforeLayer},i.$attrs),null,16,["viewport","factor","before-layer"]),a.createVNode(R,a.mergeProps({map:t.map,zone:(Be=r.otherLayers)==null?void 0:Be["war-zones"],"before-layer":t.beforeLayer},i.$attrs),null,16,["map","zone","before-layer"]),a.createVNode(I,a.mergeProps({map:t.map,area:(Ae=r.otherLayers)==null?void 0:Ae["gmdss-areas"],"before-layer":t.beforeLayer},i.$attrs),null,16,["map","area","before-layer"]),a.createVNode(B,a.mergeProps({map:t.map,zone:(ze=r.otherLayers)==null?void 0:ze["eca-zones"],"before-layer":t.beforeLayer},i.$attrs),null,16,["map","zone","before-layer"]),a.createVNode(A,a.mergeProps({map:t.map,zone:($e=r.otherLayers)==null?void 0:$e["alert-zones"],"before-layer":t.beforeLayer},i.$attrs),null,16,["map","zone","before-layer"]),a.createVNode(z,a.mergeProps({map:t.map,port:(Oe=r.otherLayers)==null?void 0:Oe.ports,"before-layer":t.beforeLayer},i.$attrs),null,16,["map","port","before-layer"]),a.createVNode(le,a.mergeProps({map:t.map,line:(Fe=r.otherLayers)==null?void 0:Fe["load-lines"],"before-layer":t.beforeLayer},i.$attrs),null,16,["map","line","before-layer"]),a.createVNode(ce,a.mergeProps({map:t.map,zone:(Me=r.otherLayers)==null?void 0:Me["time-zones"],"before-layer":t.beforeLayer},i.$attrs),null,16,["map","zone","before-layer"]),a.createVNode(he,a.mergeProps({map:t.map,area:(We=r.otherLayers)==null?void 0:We["voluntary-reporting-area"],"before-layer":t.beforeLayer},i.$attrs),null,16,["map","area","before-layer"]),a.createVNode(de,a.mergeProps({map:t.map,area:(je=r.otherLayers)==null?void 0:je["special-area"],"before-layer":t.beforeLayer},i.$attrs),null,16,["map","area","before-layer"]),a.createVNode(pe,a.mergeProps({map:t.map,area:(Ue=r.otherLayers)==null?void 0:Ue["day-night"]},i.$attrs),null,16,["map","area"]),a.createVNode(me,a.mergeProps({map:t.map,show:r.showCoord},i.$attrs),null,16,["map","show"]),a.createVNode(fe,a.mergeProps({map:t.map,show:r.showMeasure},i.$attrs),null,16,["map","show"]),a.createVNode(ye,a.mergeProps({map:t.map,show:r.showPoint,meteo:r.meteo},i.$attrs,{onPoint:s.handlePointChange}),null,16,["map","show","meteo","onPoint"])])):a.createCommentVNode("",!0)}const Le=S(Br,[["render",zr]]),$r={install(i){i.component("MapboxGL",Le),i.component("TropicalGL",ge),i.component("LatLngGL",_e)}};k.LatLngGL=_e,k.MapboxGL=Le,k.MapboxGLPlugin=$r,k.TropicalGL=ge,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});