@idmwx/idmui-gl3 4.5.9 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(S,V){typeof exports=="object"&&typeof module<"u"?V(exports,require("@idm-plugin/tag"),require("vue"),require("@turf/turf"),require("@mapbox/sphericalmercator"),require("moment"),require("mapbox-gl"),require("@idm-plugin/geo"),require("@idm-plugin/meteo"),require("axios")):typeof define=="function"&&define.amd?define(["exports","@idm-plugin/tag","vue","@turf/turf","@mapbox/sphericalmercator","moment","mapbox-gl","@idm-plugin/geo","@idm-plugin/meteo","axios"],V):(S=typeof globalThis<"u"?globalThis:S||self,V(S["idm-gl"]={},S["@idm-plugin/tag"],S.Vue,S["@turf/turf"],S["@mapbox/sphericalmercator"],S.moment,S["mapbox-gl"],S["@idm-plugin/geo"],S["@idm-plugin/meteo"],S.axios))})(this,function(S,V,t,Se,Ne,D,j,k,de,$){"use strict";var ci=Object.defineProperty;var hi=(S,V,t)=>V in S?ci(S,V,{enumerable:!0,configurable:!0,writable:!0,value:t}):S[V]=t;var T=(S,V,t)=>(hi(S,typeof V!="symbol"?V+"":V,t),t);function Pe(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const a in r)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(r,a);Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>r[a]})}}return e.default=r,Object.freeze(e)}const v=Pe(Se),di="",pi="",E=(r,e)=>{const a=r.__vccOpts||r;for(const[o,i]of e)a[o]=i;return a},ze={name:"IdmGlLayer",props:{map:{type:Object},mapProjection:{type:String},top:{type:Number,default:60},layerToggle:{type:Boolean,default:!1},toggleVersion:{type:Number},isLogin:{type:Boolean,default:void 0},showWindFeather:{type:Boolean,default:void 0},showWindParticle:{type:Boolean,default:void 0},showCurrentIsoband:{type:Boolean,default:void 0},showCurrentParticle:{type:Boolean,default:void 0}},emits:["weather","other","toggleWindParticle","toggleWindFeather","toggleCurrentParticle","toggleCurrentIsoband","coordinate","measure","point","3d","layerToggle","handleToggleVersion"],data(){return{autoActive:!0,layers:{weather:[...V.LayerHelper.WEATHER_LAYERS.filter(r=>!["swell-height","swell-direction","current-direction","current-speed"].includes(r.key))],other:[...V.LayerHelper.OTHER_LAYERS.filter(r=>r.key!=="world12nm"&&r.enabled)]},activeWeatherLayers:[],activeOtherLayers:[],autoActiveCache:"autoActiveCache",activeWeatherLayersCache:"activeWeatherLayersCache",activeOtherLayersCache:"activeOtherLayersCache",collectedLayerCache:"collectedLayerCache",sourceCache:"defaultSourceCache",windFeatherCache:"windFeatherCache",currentIsobandCache:"currentIsobandCache",showCoord:!1,showMeasure:!1,showPoint:!1,show3d:!1,version:{v:"0.0.7",k:"glCacheVersion"},source:"",right:10,rampColorLayers:["visibility","precip3h","temp","water-temp","arctic"]}},computed:{computeLayerClass(){return function(r,e){var o;let a="layer flex-between";return e.some(i=>i.key===r.key)&&(a=a+" active"),(!r.enabled||(o=this.layers.weather)!=null&&o.some(i=>i.key===r.key)&&!this.autoActive||this.rampColorLayers.includes(r.key)&&this.mapProjection==="globe")&&(a=a+" disabled"),a}},hasCollectedLayers(){var r;return((r=this.layers.weather.filter(e=>e.collected))==null?void 0:r.length)>0}},watch:{toggleVersion:{handler(){this.$nextTick(()=>{var r;this.right=(((r=document.getElementsByClassName("right-bar")[0])==null?void 0:r.clientWidth)||0)+10})}},source:{handler(r,e){r&&e&&r!==e&&this.handleConfirm()}}},mounted(){this.fetchCache(),this.handleConfirm()},methods:{fetchCache(){const r=localStorage.getItem(this.version.k);this.version.v!==r&&(localStorage.removeItem(this.activeWeatherLayersCache),localStorage.removeItem(this.collectedLayerCache),localStorage.removeItem(this.activeOtherLayersCache),localStorage.removeItem(this.windFeatherCache),localStorage.removeItem(this.currentIsobandCache),localStorage.setItem(this.version.k,this.version.v));let e=localStorage.getItem(this.autoActiveCache);this.autoActive=e!=="false",e=localStorage.getItem(this.collectedLayerCache);let a=JSON.parse(e||'[{"weight": 16, "name": "Sig Waves", "key": "sig-wave-height", "collected": true},{"weight": 1, "name": "Wind", "key": "wind", "h5": true, "collected": true},{"weight": 96, "name": "Current", "key": "current", "collected": true},{"weight": 6, "name": "Swell", "key": "swell", "collected": true}]');this.layers.weather.forEach(o=>{o.collected=!!a.some(i=>i.key===o.key&&i.collected)}),e=localStorage.getItem(this.activeWeatherLayersCache),e||localStorage.setItem(this.activeWeatherLayersCache,JSON.stringify([{weight:1,name:"Wind",key:"wind",enabled:!0,type:"json",particle:!0},{weight:4096,name:"Pressure",key:"prmsl",enabled:!0,type:"json"},{weight:256,name:"Tropicals",key:"tropicals",enabled:!0,type:"json"}])),e=localStorage.getItem(this.activeWeatherLayersCache),a=JSON.parse(e),this.autoActive&&(this.activeWeatherLayers=[...a]),a.some(o=>o.key==="wind"&&o.particle)&&this.$emit("toggleWindParticle",!0),localStorage.getItem(this.windFeatherCache)==="true"&&this.$emit("toggleWindFeather",!0),a.some(o=>o.key==="current"&&o.particle)&&this.$emit("toggleCurrentParticle",!0),localStorage.getItem(this.currentIsobandCache)==="true"&&this.$emit("toggleCurrentIsoband",!0),e=localStorage.getItem(this.activeOtherLayersCache),a=JSON.parse(e||'[{"weight":4,"name":"ECA Zones","key":"eca-zones","enabled":true,"type":"json"}]'),this.activeOtherLayers=a,e=localStorage.getItem(this.sourceCache),this.source=e||"GFS"},handleConfirm(){this.$emit("weather",this.activeWeatherLayers,this.source),this.$emit("other",this.activeOtherLayers),localStorage.setItem(this.autoActiveCache,this.autoActive),localStorage.setItem(this.sourceCache,this.source)},handleWeatherLayerPick(r){if(this.activeWeatherLayers=JSON.parse(localStorage.getItem(this.activeWeatherLayersCache)),this.rampColorLayers.includes(r.key)&&this.mapProjection==="globe"||!this.autoActive)return!1;(r.key==="wind"&&!this.showWindFeather||r.key==="current"&&!this.showCurrentIsoband)&&(r.particle=!0),this.activeWeatherLayers.some(e=>e.key===r.key)?this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.key!==r.key):this.activeWeatherLayers.length<6&&r.enabled&&(["png","jpg"].includes(r.type)?this.activeWeatherLayers.forEach(e=>{(e.key==="wind"&&this.showWindFeather||r.key==="current"&&this.showCurrentIsoband)&&(e.particle=!1)}):r.key==="wind"?this.activeWeatherLayers.forEach(e=>{e.key==="current"&&this.showCurrentIsoband&&(e.particle=!1)}):r.key==="current"&&this.activeWeatherLayers.forEach(e=>{e.key==="wind"&&this.showWindFeather&&(e.particle=!1)}),this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.type==="json"&&!(["wind","current"].includes(e.key)&&e.particle)),this.activeWeatherLayers.push(r)),this.$emit("weather",this.activeWeatherLayers,this.source),localStorage.setItem(this.activeWeatherLayersCache,JSON.stringify(this.activeWeatherLayers))},handleWeatherLayerCollect(r){var e;!r.collected&&((e=this.layers.weather.filter(a=>a.collected))==null?void 0:e.length)>=6&&(this.layers.weather.filter(a=>a.collected)[0].collected=!1),r.collected=!r.collected,localStorage.setItem(this.collectedLayerCache,JSON.stringify(this.layers.weather)),this.$emit("handleToggleVersion")},handleToggleWindParticle(){!this.showWindFeather&&this.showWindParticle?this.handleWeatherLayerPick({weight:1,name:"Wind",key:"wind",enabled:!0,type:"json",particle:!0}):(this.showCurrentParticle&&(this.$emit("toggleCurrentParticle",!1),this.showCurrentIsoband||(this.activeWeatherLayers=this.activeWeatherLayers.filter(r=>r.key!=="current"),localStorage.setItem(this.activeWeatherLayersCache,JSON.stringify(this.activeWeatherLayers)))),this.$emit("toggleWindParticle",!this.showWindParticle))},handleToggleWindFeather(){this.showWindFeather&&!this.showWindParticle&&this.handleWeatherLayerPick({weight:1,name:"Wind",key:"wind",enabled:!0,type:"json",particle:!0}),this.$emit("toggleWindFeather",!this.showWindFeather),localStorage.setItem(this.windFeatherCache,!this.showWindFeather)},handleToggleCurrentParticle(){!this.showCurrentIsoband&&this.showCurrentParticle?this.handleWeatherLayerPick({weight:96,name:"Current",key:"current",vendor:"cmems",merge:!0,h5:!0,enabled:!0}):(this.showWindParticle&&(this.$emit("toggleWindParticle",!1),this.showWindFeather||(this.activeWeatherLayers=this.activeWeatherLayers.filter(r=>r.key!=="wind"),localStorage.setItem(this.activeWeatherLayersCache,JSON.stringify(this.activeWeatherLayers)))),this.$emit("toggleCurrentParticle",!this.showCurrentParticle))},handleToggleCurrentIsoband(){this.showCurrentIsoband&&!this.showCurrentParticle&&this.handleWeatherLayerPick({weight:96,name:"Current",key:"current",vendor:"cmems",merge:!0,h5:!0,enabled:!0}),this.$emit("toggleCurrentIsoband",!this.showCurrentIsoband),localStorage.setItem(this.currentIsobandCache,!this.showCurrentIsoband)},handleOtherLayerPick(r){this.activeOtherLayers.some(e=>e.key===r.key)?this.activeOtherLayers=this.activeOtherLayers.filter(e=>e.key!==r.key):r.enabled&&this.activeOtherLayers.push(r),localStorage.setItem(this.activeOtherLayersCache,JSON.stringify(this.activeOtherLayers)),this.$emit("other",this.activeOtherLayers)},handleMenuToggle(){this.$emit("layerToggle",!this.layerToggle)},toggleAutoActive(){this.autoActive=!this.autoActive,localStorage.setItem(this.autoActiveCache,this.autoActive),this.autoActive?this.$emit("weather",this.activeWeatherLayers,this.source):this.$emit("weather",[],this.source)},handleCoordToggle(){this.showCoord=!this.showCoord,this.$emit("coordinate",this.showCoord)},handlePointToggle(){this.isLogin?(this.showPoint=!this.showPoint,this.$emit("point",this.showPoint)):this.$emit("handleToggleVersion")},handleMeasureToggle(){this.showMeasure=!this.showMeasure,this.$emit("measure",this.showMeasure)},handle3DToggle(){this.show3d=!this.show3d,this.$emit("3d",this.show3d)}}},Te={class:"idm-gl3-layer"},Ve={class:"bar-item layer-bars"},De={class:"bar-item tool-bars"},Be={class:"flex-between"},Ie={key:0,class:"iconfont active"},Re={key:1,class:"iconfont"},We=["onClick"],Ae=["onClick"],Me={key:0,class:"flex-start"},Oe={key:1,class:"flex-start"},Fe={class:"header-box flex-between"},je={class:"weather-layers card-bg"},$e={class:"layers-title flex-between"},He={key:0,class:"iconfont active"},Ue={key:1,class:"iconfont"},Ze={class:"layers-body"},Ge={class:"flex-start"},Je=["onClick"],Xe=["onClick"],qe={key:0,class:"flex-start"},Ye={key:1,class:"flex-start"},Qe=["onClick"],Ke={key:0,class:"iconfont bookmark-icon active"},et={key:1,class:"iconfont bookmark-icon inactive"},tt={class:"other-layers card-bg"},at={class:"layers-body"},rt=["onClick"],it={class:"flex-start"},ot={class:"switch flex-center"},st={key:0,class:"iconfont active"},nt={key:1,class:"iconfont"},lt={class:"source-layers card-bg"},ct={class:"layers-body"};function ht(r,e,a,o,i,s){const n=t.resolveComponent("ElTooltip"),l=t.resolveComponent("ElRadio"),h=t.resolveComponent("ElRadioGroup"),p=t.resolveComponent("ElScrollbar");return t.openBlock(),t.createElementBlock("div",Te,[t.createElementVNode("div",{class:"menu-bar-box",style:t.normalizeStyle({top:a.top+10+"px",right:i.right+"px"})},[t.createElementVNode("div",Ve,[t.createVNode(n,{placement:"left",effect:"light",content:"Menu","show-after":1e3},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(a.layerToggle?"menu-icon active":"menu-icon"),onClick:e[0]||(e[0]=(...c)=>s.handleMenuToggle&&s.handleMenuToggle(...c))},e[17]||(e[17]=[t.createElementVNode("span",{class:"iconfont"},"",-1)]),2)]),_:1})])],4),t.createElementVNode("div",{class:"menu-bar-box",style:t.normalizeStyle({top:a.top+160+"px",right:i.right+"px"})},[t.createElementVNode("div",De,[t.createVNode(n,{placement:"left",effect:"light",content:"Measure","show-after":1e3},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(i.showMeasure?"menu-icon active":"menu-icon"),onClick:e[1]||(e[1]=(...c)=>s.handleMeasureToggle&&s.handleMeasureToggle(...c))},e[18]||(e[18]=[t.createElementVNode("span",{class:"iconfont"},"",-1)]),2)]),_:1}),t.createVNode(n,{placement:"left",effect:"light",content:"Point Meteo","show-after":1e3},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(i.showPoint?"menu-icon active":"menu-icon"),onClick:e[2]||(e[2]=(...c)=>s.handlePointToggle&&s.handlePointToggle(...c))},e[19]||(e[19]=[t.createElementVNode("span",{class:"iconfont"},"",-1)]),2)]),_:1}),t.createVNode(n,{placement:"left",effect:"light",content:"Grid","show-after":1e3},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(i.showCoord?"menu-icon active":"menu-icon"),onClick:e[3]||(e[3]=(...c)=>s.handleCoordToggle&&s.handleCoordToggle(...c))},e[20]||(e[20]=[t.createElementVNode("span",{class:"iconfont"},"",-1)]),2)]),_:1}),t.createVNode(n,{placement:"left",effect:"light",content:"3D","show-after":1e3},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(i.show3d?"menu-icon active":"menu-icon"),onClick:e[4]||(e[4]=(...c)=>s.handle3DToggle&&s.handle3DToggle(...c))},e[21]||(e[21]=[t.createElementVNode("span",{class:"iconfont"},"",-1)]),2)]),_:1})])],4),s.hasCollectedLayers?(t.openBlock(),t.createElementBlock("div",{key:0,class:"active-layers",style:t.normalizeStyle({right:i.right+"px",bottom:"100px"})},[t.createElementVNode("div",Be,[e[22]||(e[22]=t.createElementVNode("div",{style:{margin:"2px 5px"}},"My Favorites",-1)),t.createElementVNode("div",{class:"switch flex-center",style:{"font-size":"28px","margin-right":"0"},onClick:e[5]||(e[5]=(...c)=>s.toggleAutoActive&&s.toggleAutoActive(...c))},[i.autoActive?(t.openBlock(),t.createElementBlock("i",Ie,"")):(t.openBlock(),t.createElementBlock("i",Re,""))])]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.layers.weather.filter(c=>c.collected),c=>(t.openBlock(),t.createElementBlock("div",{key:c.key,class:t.normalizeClass(s.computeLayerClass(c,i.activeWeatherLayers))},[t.createElementVNode("div",{class:"checkbox",onClick:d=>s.handleWeatherLayerPick(c)},null,8,We),t.createElementVNode("span",{class:"name",onClick:d=>s.handleWeatherLayerPick(c)},t.toDisplayString(c.name),9,Ae),c.key==="wind"&&i.activeWeatherLayers.some(d=>d.key===c.key)?(t.openBlock(),t.createElementBlock("div",Me,[t.createElementVNode("i",{class:t.normalizeClass(["iconfont sub-layer-icon",a.showWindParticle?"active":""]),onClick:e[6]||(e[6]=d=>s.handleToggleWindParticle())},"",2),t.createElementVNode("i",{class:t.normalizeClass(["iconfont sub-layer-icon",a.showWindFeather?"active":""]),onClick:e[7]||(e[7]=d=>s.handleToggleWindFeather())},"",2)])):t.createCommentVNode("",!0),c.key==="current"&&i.activeWeatherLayers.some(d=>d.key===c.key)?(t.openBlock(),t.createElementBlock("div",Oe,[t.createElementVNode("i",{class:t.normalizeClass(["iconfont sub-layer-icon",a.showCurrentParticle?"active":""]),onClick:e[8]||(e[8]=d=>s.handleToggleCurrentParticle())},"",2),t.createElementVNode("i",{class:t.normalizeClass(["iconfont sub-layer-icon",a.showCurrentIsoband?"active":""]),onClick:e[9]||(e[9]=d=>s.handleToggleCurrentIsoband())},"",2)])):t.createCommentVNode("",!0)],2))),128))],4)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"available-layers flex-center",style:t.normalizeStyle({top:a.top+"px",right:a.layerToggle?"0px":"-240px"})},[t.createElementVNode("div",{class:t.normalizeClass(["list-box",a.layerToggle?"right-bar":""])},[t.createElementVNode("div",Fe,[e[23]||(e[23]=t.createElementVNode("div",null,"Layers",-1)),t.createElementVNode("div",{class:"iconfont close-btn",onClick:e[10]||(e[10]=(...c)=>s.handleMenuToggle&&s.handleMenuToggle(...c))},"")]),t.createVNode(p,{style:{flex:"1"}},{default:t.withCtx(()=>[t.createElementVNode("div",je,[t.createElementVNode("div",$e,[e[24]||(e[24]=t.createElementVNode("div",null,"Weather Layers",-1)),t.createElementVNode("div",{class:"switch flex-center",style:{"margin-right":"0"},onClick:e[11]||(e[11]=(...c)=>s.toggleAutoActive&&s.toggleAutoActive(...c))},[i.autoActive?(t.openBlock(),t.createElementBlock("i",He,"")):(t.openBlock(),t.createElementBlock("i",Ue,""))])]),t.createElementVNode("div",Ze,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.layers.weather,c=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:c.key},[c.hide?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(s.computeLayerClass(c,i.activeWeatherLayers))},[t.createElementVNode("div",Ge,[t.createElementVNode("div",{class:"checkbox",onClick:d=>s.handleWeatherLayerPick(c)},null,8,Je),t.createElementVNode("span",{class:"name",onClick:d=>s.handleWeatherLayerPick(c)},t.toDisplayString(c.name),9,Xe),c.key==="wind"&&i.activeWeatherLayers.some(d=>d.key===c.key)?(t.openBlock(),t.createElementBlock("div",qe,[t.createElementVNode("i",{class:t.normalizeClass(["iconfont sub-layer-icon",a.showWindParticle?"active":""]),onClick:e[12]||(e[12]=d=>s.handleToggleWindParticle())},"",2),t.createElementVNode("i",{class:t.normalizeClass(["iconfont sub-layer-icon",a.showWindFeather?"active":""]),onClick:e[13]||(e[13]=d=>s.handleToggleWindFeather())},"",2)])):t.createCommentVNode("",!0),c.key==="current"&&i.activeWeatherLayers.some(d=>d.key===c.key)?(t.openBlock(),t.createElementBlock("div",Ye,[t.createElementVNode("i",{class:t.normalizeClass(["iconfont sub-layer-icon",a.showCurrentParticle?"active":""]),onClick:e[14]||(e[14]=d=>s.handleToggleCurrentParticle())},"",2),t.createElementVNode("i",{class:t.normalizeClass(["iconfont sub-layer-icon",a.showCurrentIsoband?"active":""]),onClick:e[15]||(e[15]=d=>s.handleToggleCurrentIsoband())},"",2)])):t.createCommentVNode("",!0)]),t.createElementVNode("div",{onClick:d=>s.handleWeatherLayerCollect(c)},[c.collected?(t.openBlock(),t.createElementBlock("i",Ke,"")):(t.openBlock(),t.createElementBlock("i",et,""))],8,Qe)],2))],64))),128)),e[25]||(e[25]=t.createElementVNode("div",{class:"tip flex-start"},[t.createElementVNode("i",{class:"iconfont bookmark-icon",style:{"align-self":"flex-start",padding:"5px 5px 0 0"}},""),t.createElementVNode("div",null,"You can add the layers to your favorites. (Max 6)")],-1))])]),t.createElementVNode("div",tt,[e[26]||(e[26]=t.createElementVNode("div",{class:"layers-title"},"Other Layers",-1)),t.createElementVNode("div",at,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.layers.other,c=>{var d;return t.openBlock(),t.createElementBlock("div",{key:c.key,class:t.normalizeClass(["layer flex-between",s.computeLayerClass(c,i.activeOtherLayers)]),onClick:u=>s.handleOtherLayerPick(c)},[t.createElementVNode("div",it,[t.createElementVNode("div",ot,[(d=s.computeLayerClass(c,i.activeOtherLayers))!=null&&d.includes("active")?(t.openBlock(),t.createElementBlock("i",st,"")):(t.openBlock(),t.createElementBlock("i",nt,""))]),t.createElementVNode("span",null,t.toDisplayString(c.name),1)])],10,rt)}),128))])]),t.createElementVNode("div",lt,[e[29]||(e[29]=t.createElementVNode("span",{class:"layers-title"},"Forecast Model",-1)),t.createElementVNode("div",ct,[t.createVNode(h,{modelValue:i.source,"onUpdate:modelValue":e[16]||(e[16]=c=>i.source=c),class:"layer-radio flex-col-center-start"},{default:t.withCtx(()=>[t.createVNode(l,{value:"GFS"},{default:t.withCtx(()=>e[27]||(e[27]=[t.createTextVNode("GFS")])),_:1}),t.createVNode(l,{value:"CMEMS"},{default:t.withCtx(()=>e[28]||(e[28]=[t.createTextVNode("CMEMS")])),_:1})]),_:1},8,["modelValue"])])])]),_:1})],2)],4)])}const dt=E(ze,[["render",ht]]),mi="",pt={name:"IdmWindBarb",props:{map:{type:Object},wind:{type:Object},current:{type:Object},beforeLayer:{type:String},mapProjection:{type:String},showWindFeather:{type:Boolean,default:!1},showWindParticle:{type:Boolean,default:!1},toggleVersion:{type:Number}},emits:["particle","showWindFeather"],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:v.featureCollection([]),right:10,bottom:125,windBarbLoaded:!1}},watch:{"wind.version":{handler(){var r;(r=this.wind)!=null&&r.active&&this.showWindFeather?this.handleRender():this.handleClear()},deep:!0},showWindParticle:{handler(){this.handleParticle()}},showWindFeather:{handler(){this.handleToggle()}}},methods:{handleParticle(){this.$emit("particle",{particle:this.showWindParticle,key:"wind",weight:1})},handleRender(){var r,e,a,o;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.wind){const i=new Date().valueOf();let s=0,n=0,l=this.empty;if((r=this.wind)!=null&&r.active&&(l=(e=this.wind)==null?void 0:e.data),(a=this.map)!=null&&a.getSource(this.source))(o=this.map)==null||o.getSource(this.source).setData(l),n=new Date().valueOf()-(i+s),console.log("[wind] update elapsed: ",n,", total: ",s+=n);else{this.map.addSource(this.source,{type:"geojson",data:l});for(let h=0;h<(this.barbs??[]).length-1;h++){const p=(this.barbs??[])[h]||0,c=(this.barbs??[])[h+1]||0,d=p<10?`00${p}kts`:p<100?`0${p}kts`:`${p}kts`;this.map.addLayer({id:d,type:"symbol",filter:["all",[">=","spd",p],["<","spd",c]],source:this.source,layout:{"symbol-placement":"point","icon-image":d,"icon-size":.14,"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":1,"text-color":"#222"}},this.beforeLayer)}this.windBarbLoaded=!0,n=new Date().valueOf()-(i+s),console.log("[wind] add elapsed: ",n,", total: ",s+=n)}}},handleToggle(){if(!this.windBarbLoaded)this.handleRender();else for(const r of this.barbs??[]){const e=r<10?`00${r}kts`:r<100?`0${r}kts`:`${r}kts`;this.map.getLayer(e)&&this.map.setLayoutProperty(e,"visibility",this.showWindFeather?"visible":"none")}},handleClear(){for(const r of this.barbs??[]){const e=r<10?`00${r}kts`:r<100?`0${r}kts`:`${r}kts`;this.map.getLayer(e)&&this.map.removeLayer(e)}this.map.getSource(this.source)&&this.map.removeSource(this.source),this.windBarbLoaded=!1}}},mt={key:0};function yt(r,e,a,o,i,s){var n;return(n=a.wind)!=null&&n.active?(t.openBlock(),t.createElementBlock("div",mt)):t.createCommentVNode("",!0)}const ft=E(pt,[["render",yt]]);class oe{constructor(e){T(this,"map");T(this,"mercator");T(this,"rampColorLayer");T(this,"rampColorSource");T(this,"particleLayer");T(this,"particleSource");T(this,"rampColorCanvas");T(this,"particleCanvas");T(this,"ratio");this.map=e,this.mercator=new Ne,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,a=0){return e>180?this.convertNLng(e-360,a+1):e<-180?this.convertNLng(e+360,a+1):[e,a]}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(),a=this.map.getZoom()+1,o=[e._ne.lng,e._ne.lat],i=[e._sw.lng,e._sw.lat],[s,n]=this.convertNLng(o[0]),[l,h]=this.convertNLng(i[0]),[p,c]=this.mercator.px([s,o[1]],a),[d,u]=this.mercator.px([l,i[1]],a),m=Math.round(this.mercator.size*Math.pow(2,a)*(n+h));return[d,u,p+m,c]}getBoundRange(){const e=this.map.getZoom()+1,a=this.mercator.size*Math.pow(2,e),o=this.getBoundPixel();return[o[0]/a,o[2]/a,o[3]/a,o[1]/a]}getWorldCopy(e,a){const o=2**a,[i,s,n,l]=e.map(c=>~~(c/(o*256))),h=[];for(let c=l;c<=s;c++)for(let d=i;d<=n;d++)h.push([d,c]);return h.map(c=>{const d=2**a*256;return[c[0]*d,c[1]*d,d]})}resize(){let e=this.map.getSource(this.rampColorSource);e.setCoordinates(this.getBoundLngLat()),e=this.map.getSource(this.particleSource),e.setCoordinates(this.getBoundLngLat()),this.rampColorCanvas.width=this.map._canvas.clientWidth,this.rampColorCanvas.height=this.map._canvas.clientHeight,this.particleCanvas.width=this.map._canvas.clientWidth,this.particleCanvas.height=this.map._canvas.clientHeight}toggle(e){const a=this.map.getLayoutProperty(this.rampColorLayer,"visibility"),o=e?"visible":"none";a!==o&&this.map.setLayoutProperty(this.rampColorLayer,"visibility",o)}toggleParticle(e){const a=this.map.getLayoutProperty(this.particleLayer,"visibility"),o=e?"visible":"none";a!==o&&this.map.setLayoutProperty(this.particleLayer,"visibility",o)}}class H{createShader(e,a,o){const i=e.createShader(a);if(i&&(e.shaderSource(i,o),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)))throw new Error(e.getShaderInfoLog(i)||"error happened while create shader...");return i}createTexture(e,a,o,i,s,n,l){const h=e.createTexture();return e.bindTexture(e.TEXTURE_2D,h),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,a),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,i),s instanceof Uint8Array?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,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),h}createDataBuffer(e,a,o){if(e){const i=e.createBuffer();return a==="array"?(e.bindBuffer(e.ARRAY_BUFFER,i),o&&e.bufferData(e.ARRAY_BUFFER,o,e.STATIC_DRAW)):a==="element"&&(e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,i),o&&e.bufferData(e.ELEMENT_ARRAY_BUFFER,o,e.STATIC_DRAW)),i}return null}createProgram(e,a,o){const i=e.createProgram(),s=this.createShader(e,e.VERTEX_SHADER,a),n=this.createShader(e,e.FRAGMENT_SHADER,o);if(i&&s&&n&&(e.attachShader(i,s),e.attachShader(i,n),e.linkProgram(i),!e.getProgramParameter(i,e.LINK_STATUS)))throw new Error(e.getProgramInfoLog(i)||"error happened while creating ramp color program");return i}createProgramWrapper(e,a,o){const i=this.createProgram(e,a,o);if(i){const s={program:i},n=e.getProgramParameter(i,e.ACTIVE_ATTRIBUTES);for(let h=0;h<n;h++){const p=e.getActiveAttrib(i,h);s[p.name]=e.getAttribLocation(i,p.name)}const l=e.getProgramParameter(i,e.ACTIVE_UNIFORMS);for(let h=0;h<l;h++){const p=e.getActiveUniform(i,h);s[p.name]=e.getUniformLocation(i,p.name)}return s}}setup(e,a,o=!1,i,s){const n=document.createElement("canvas");n.width=256,n.height=1;const l=n.getContext("2d");if(l&&e){const h=l==null?void 0:l.createLinearGradient(0,0,256,0);return a.forEach(([p,c])=>{h.addColorStop(p,c)}),l.fillStyle=h,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,i,s)}}}setupParticle(e,a=1e3){const o=Math.ceil(Math.sqrt(a)),i=o*o,s=new Uint8Array(i*4);for(let c=0;c<s.length;c++)s[c]=Math.floor(Math.random()*256);const n=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,s,o,o),l=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,s,o,o),h=new Float32Array(i);for(let c=0;c<i;c++)h[c]=c;const p=this.createDataBuffer(e,"array",h);return{resolution:o,total:i,texture0:n,texture1:l,indexBuffer:p}}bind(e,a,o){const i=this.createProgram(e,a,o);if(i){const s=this.createDataBuffer(e,"array",void 0),n=e.getAttribLocation(i,"a_position");e.enableVertexAttribArray(n),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0);const l=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);this.createDataBuffer(e,"array",l);const h=e.getAttribLocation(i,"a_texCoord");return e.enableVertexAttribArray(h),e.vertexAttribPointer(h,2,e.FLOAT,!1,0,0),{program:i,aPositionBuffer:s}}return{}}bindParticle(e,a,o,i,s,n){const l=this.createProgramWrapper(e,a,o),h=this.createProgramWrapper(e,i,s),p=this.createProgramWrapper(e,i,n),c=this.createDataBuffer(e,"array",new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])),d=e.createFramebuffer();return{particle:l,screen:h,update:p,quadBuffer:c,frameBuffer:d}}draw(e,a,o,i,s,n,l){var h,p;if(a&&o){e.resize(),a==null||a.viewport(0,0,(h=a==null?void 0:a.canvas)==null?void 0:h.width,(p=a==null?void 0:a.canvas)==null?void 0:p.height),a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT);try{const c=a.getUniformLocation(o,"u_resolution"),d=a.getUniformLocation(o,"u_image"),u=a.getUniformLocation(o,"u_color");if(a.useProgram(o),a.uniform2f(c,a.canvas.width*e.ratio,a.canvas.height*e.ratio),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,i),a.uniform1i(d,0),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,s),a.uniform1i(u,1),l!=null&&l.uvRange&&(l!=null&&l.sRange)){const y=a.getUniformLocation(o,"u_range_u_v"),L=a.getUniformLocation(o,"u_range_s");a.uniform2f(y,l.uvRange[0],l.uvRange[1]),a.uniform2f(L,l.sRange[0],l.sRange[1])}const m=e.getBoundPixel(),b=e.map.getZoom()+1,f=e.getWorldCopy(m,b);for(const y of f){const L=(y[0]-m[0])*e.ratio,g=(y[1]-m[3])*e.ratio,x=y[2]*e.ratio,[C,w,_,N]=[L,x+L,g,x+g],I=new Float32Array([C,_,w,_,C,N,C,N,w,_,w,N]);a.bindBuffer(a.ARRAY_BUFFER,n),a.bufferData(a.ARRAY_BUFFER,I,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6)}}catch(c){console.log(`render failed...${c}`)}}}drawParticle(e,a,o,i,s){var n,l;a&&(a==null||a.viewport(0,0,(n=a==null?void 0:a.canvas)==null?void 0:n.width,(l=a==null?void 0:a.canvas)==null?void 0:l.height),a.disable(a.DEPTH_TEST),a.disable(a.STENCIL_TEST),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,o),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,i.texture0),this.renderScreen(e,a,i,s),this.updateParticles(e,a,i,s))}renderScreen(e,a,o,i){a.bindFramebuffer(a.FRAMEBUFFER,o.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,o.screenTexture,0),a.viewport(0,0,a.canvas.width,a.canvas.height),this.renderScreenTexture(a,o.backgroundTexture,o.screen,o.quadBuffer,.95),this.renderParticles(e,a,o,i),a.bindFramebuffer(a.FRAMEBUFFER,null),this.renderScreenTexture(a,o.screenTexture,o.screen,o.quadBuffer,1);const s=o.backgroundTexture;o.backgroundTexture=o.screenTexture,o.screenTexture=s}renderScreenTexture(e,a,o,i,s){e&&(e.useProgram(o.program),e.bindBuffer(e.ARRAY_BUFFER,i),e.enableVertexAttribArray(o.a_pos),e.vertexAttribPointer(o.a_pos,2,e.FLOAT,!1,0,0),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,a),e.uniform1i(o.u_screen,2),e.uniform1f(o.u_opacity,s),e.drawArrays(e.TRIANGLES,0,6))}renderParticles(e,a,o,i){if(a){a.useProgram(o.particle.program),a.bindBuffer(a.ARRAY_BUFFER,o.indexBuffer),a.enableVertexAttribArray(o.particle.a_index),a.vertexAttribPointer(o.particle.a_index,1,a.FLOAT,!1,0,0),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,o.color.texture),a.uniform1i(o.particle.u_factor,0),a.uniform1i(o.particle.u_particles,1),a.uniform1i(o.particle.u_color_ramp,2),a.uniform1f(o.particle.u_particles_resolution,o.resolution*e.ratio),a.uniform1f(o.particle.u_point,e.ratio);const s=e.getBoundRange();a.uniform4f(o.particle.u_viewport,s[0],s[1],s[2],s[3]),a.uniform2f(o.particle.u_factor_min,i.uvRange[0],i.uvRange[0]),a.uniform2f(o.particle.u_factor_max,i.uvRange[1],i.uvRange[1]),a.drawArrays(a.POINTS,0,o.total)}}updateParticles(e,a,o,i){var n,l;if(a){a.bindFramebuffer(a.FRAMEBUFFER,o.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,o.texture1,0),a.viewport(0,0,o.resolution,o.resolution),a.useProgram(o.update.program),a.bindBuffer(a.ARRAY_BUFFER,o.quadBuffer),a.enableVertexAttribArray(o.update.a_pos),a.vertexAttribPointer(o.update.a_pos,2,a.FLOAT,!1,0,0),a.uniform1i(o.update.u_factor,0),a.uniform1i(o.update.u_particles,1);const h=e.getBoundRange();a.uniform4f(o.update.u_viewport,h[0],h[1],h[2],h[3]),a.uniform1f(o.update.u_rand_seed,Math.random()),a.uniform2f(o.update.u_factor_res,(n=o==null?void 0:o.image)==null?void 0:n.width,(l=o==null?void 0:o.image)==null?void 0:l.height),a.uniform2f(o.update.u_factor_min,i.uvRange[0],i.uvRange[0]),a.uniform2f(o.update.u_factor_max,i.uvRange[1],i.uvRange[1]),a.uniform1f(o.update.u_speed_factor,i.speedFactor*e.ratio),a.uniform1f(o.update.u_drop_rate,i.dropRate),a.uniform1f(o.update.u_drop_rate_bump,i.dropRateBump),a.drawArrays(a.TRIANGLES,0,6)}const s=o.texture0;o.texture0=o.texture1,o.texture1=s}resize(e,a){e.resize();const o=new Uint8Array(a.canvas.width*a.canvas.height*4).fill(0,0,a.canvas.width*a.canvas.height*4),i=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,o,a.canvas.width,a.canvas.height),s=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,o,a.canvas.width,a.canvas.height);return{screenTexture:i,backgroundTexture:s}}async loadImg(e){return new Promise(a=>{const o=new Blob([e],{type:e.type}),i=URL.createObjectURL(o),s=new Image;s.crossOrigin="anonymous",s.src=i,s.onload=()=>a(s)})}}class B{}T(B,"vertexSchema",`
1
+ (function(S,V){typeof exports=="object"&&typeof module<"u"?V(exports,require("@idm-plugin/tag"),require("vue"),require("@turf/turf"),require("@mapbox/sphericalmercator"),require("moment"),require("mapbox-gl"),require("@idm-plugin/geo"),require("@idm-plugin/meteo"),require("axios")):typeof define=="function"&&define.amd?define(["exports","@idm-plugin/tag","vue","@turf/turf","@mapbox/sphericalmercator","moment","mapbox-gl","@idm-plugin/geo","@idm-plugin/meteo","axios"],V):(S=typeof globalThis<"u"?globalThis:S||self,V(S["idm-gl"]={},S["@idm-plugin/tag"],S.Vue,S["@turf/turf"],S["@mapbox/sphericalmercator"],S.moment,S["mapbox-gl"],S["@idm-plugin/geo"],S["@idm-plugin/meteo"],S.axios))})(this,function(S,V,t,Se,Pe,D,j,k,de,$){"use strict";var ci=Object.defineProperty;var hi=(S,V,t)=>V in S?ci(S,V,{enumerable:!0,configurable:!0,writable:!0,value:t}):S[V]=t;var T=(S,V,t)=>(hi(S,typeof V!="symbol"?V+"":V,t),t);function Ne(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const a in r)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(r,a);Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>r[a]})}}return e.default=r,Object.freeze(e)}const v=Ne(Se),di="",pi="",E=(r,e)=>{const a=r.__vccOpts||r;for(const[o,i]of e)a[o]=i;return a},ze={name:"IdmGlLayer",props:{map:{type:Object},mapProjection:{type:String},top:{type:Number,default:60},layerToggle:{type:Boolean,default:!1},toggleVersion:{type:Number},isLogin:{type:Boolean,default:void 0},showWindFeather:{type:Boolean,default:void 0},showWindParticle:{type:Boolean,default:void 0},showCurrentIsoband:{type:Boolean,default:void 0},showCurrentParticle:{type:Boolean,default:void 0}},emits:["weather","other","toggleWindParticle","toggleWindFeather","toggleCurrentParticle","toggleCurrentIsoband","coordinate","measure","point","3d","layerToggle","handleToggleVersion"],data(){return{autoActive:!0,layers:{weather:[...V.LayerHelper.WEATHER_LAYERS.filter(r=>!["swell-height","swell-direction","current-direction","current-speed"].includes(r.key))],other:[...V.LayerHelper.OTHER_LAYERS.filter(r=>r.key!=="world12nm"&&r.enabled)]},activeWeatherLayers:[],activeOtherLayers:[],autoActiveCache:"autoActiveCache",activeWeatherLayersCache:"activeWeatherLayersCache",activeOtherLayersCache:"activeOtherLayersCache",collectedLayerCache:"collectedLayerCache",sourceCache:"defaultSourceCache",windFeatherCache:"windFeatherCache",currentIsobandCache:"currentIsobandCache",showCoord:!1,showMeasure:!1,showPoint:!1,show3d:!1,version:{v:"0.0.7",k:"glCacheVersion"},source:"",right:10,rampColorLayers:["visibility","precip3h","temp","water-temp","arctic"]}},computed:{computeLayerClass(){return function(r,e){var o;let a="layer flex-between";return e.some(i=>i.key===r.key)&&(a=a+" active"),(!r.enabled||(o=this.layers.weather)!=null&&o.some(i=>i.key===r.key)&&!this.autoActive||this.rampColorLayers.includes(r.key)&&this.mapProjection==="globe")&&(a=a+" disabled"),a}},hasCollectedLayers(){var r;return((r=this.layers.weather.filter(e=>e.collected))==null?void 0:r.length)>0}},watch:{toggleVersion:{handler(){this.$nextTick(()=>{var r;this.right=(((r=document.getElementsByClassName("right-bar")[0])==null?void 0:r.clientWidth)||0)+10})}},source:{handler(r,e){r&&e&&r!==e&&this.handleConfirm()}}},mounted(){this.fetchCache(),this.handleConfirm()},methods:{fetchCache(){const r=localStorage.getItem(this.version.k);this.version.v!==r&&(localStorage.removeItem(this.activeWeatherLayersCache),localStorage.removeItem(this.collectedLayerCache),localStorage.removeItem(this.activeOtherLayersCache),localStorage.removeItem(this.windFeatherCache),localStorage.removeItem(this.currentIsobandCache),localStorage.setItem(this.version.k,this.version.v));let e=localStorage.getItem(this.autoActiveCache);this.autoActive=e!=="false",e=localStorage.getItem(this.collectedLayerCache);let a=JSON.parse(e||'[{"weight": 16, "name": "Sig Waves", "key": "sig-wave-height", "collected": true},{"weight": 1, "name": "Wind", "key": "wind", "h5": true, "collected": true},{"weight": 96, "name": "Current", "key": "current", "collected": true},{"weight": 6, "name": "Swell", "key": "swell", "collected": true}]');this.layers.weather.forEach(o=>{o.collected=!!a.some(i=>i.key===o.key&&i.collected)}),e=localStorage.getItem(this.activeWeatherLayersCache),e||localStorage.setItem(this.activeWeatherLayersCache,JSON.stringify([{weight:1,name:"Wind",key:"wind",enabled:!0,type:"json",particle:!0},{weight:4096,name:"Pressure",key:"prmsl",enabled:!0,type:"json"},{weight:256,name:"Tropicals",key:"tropicals",enabled:!0,type:"json"}])),e=localStorage.getItem(this.activeWeatherLayersCache),a=JSON.parse(e),this.autoActive&&(this.activeWeatherLayers=[...a]),a.some(o=>o.key==="wind"&&o.particle)&&this.$emit("toggleWindParticle",!0),localStorage.getItem(this.windFeatherCache)==="true"&&this.$emit("toggleWindFeather",!0),a.some(o=>o.key==="current"&&o.particle)&&this.$emit("toggleCurrentParticle",!0),localStorage.getItem(this.currentIsobandCache)==="true"&&this.$emit("toggleCurrentIsoband",!0),e=localStorage.getItem(this.activeOtherLayersCache),a=JSON.parse(e||'[{"weight":4,"name":"ECA Zones","key":"eca-zones","enabled":true,"type":"json"}]'),this.activeOtherLayers=a,e=localStorage.getItem(this.sourceCache),this.source=e||"GFS"},handleConfirm(){this.$emit("weather",this.activeWeatherLayers,this.source),this.$emit("other",this.activeOtherLayers),localStorage.setItem(this.autoActiveCache,this.autoActive),localStorage.setItem(this.sourceCache,this.source)},handleWeatherLayerPick(r){if(this.activeWeatherLayers=JSON.parse(localStorage.getItem(this.activeWeatherLayersCache)),this.rampColorLayers.includes(r.key)&&this.mapProjection==="globe"||!this.autoActive)return!1;(r.key==="wind"&&!this.showWindFeather||r.key==="current"&&!this.showCurrentIsoband)&&(r.particle=!0),this.activeWeatherLayers.some(e=>e.key===r.key)?this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.key!==r.key):this.activeWeatherLayers.length<6&&r.enabled&&(["png","jpg"].includes(r.type)?this.activeWeatherLayers.forEach(e=>{(e.key==="wind"&&this.showWindFeather||r.key==="current"&&this.showCurrentIsoband)&&(e.particle=!1)}):r.key==="wind"?this.activeWeatherLayers.forEach(e=>{e.key==="current"&&this.showCurrentIsoband&&(e.particle=!1)}):r.key==="current"&&this.activeWeatherLayers.forEach(e=>{e.key==="wind"&&this.showWindFeather&&(e.particle=!1)}),this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.type==="json"&&!(["wind","current"].includes(e.key)&&e.particle)),this.activeWeatherLayers.push(r)),this.$emit("weather",this.activeWeatherLayers,this.source),localStorage.setItem(this.activeWeatherLayersCache,JSON.stringify(this.activeWeatherLayers))},handleWeatherLayerCollect(r){var e;!r.collected&&((e=this.layers.weather.filter(a=>a.collected))==null?void 0:e.length)>=6&&(this.layers.weather.filter(a=>a.collected)[0].collected=!1),r.collected=!r.collected,localStorage.setItem(this.collectedLayerCache,JSON.stringify(this.layers.weather)),this.$emit("handleToggleVersion")},handleToggleWindParticle(){!this.showWindFeather&&this.showWindParticle?this.handleWeatherLayerPick({weight:1,name:"Wind",key:"wind",enabled:!0,type:"json",particle:!0}):(this.showCurrentParticle&&(this.$emit("toggleCurrentParticle",!1),this.showCurrentIsoband||(this.activeWeatherLayers=this.activeWeatherLayers.filter(r=>r.key!=="current"),localStorage.setItem(this.activeWeatherLayersCache,JSON.stringify(this.activeWeatherLayers)))),this.$emit("toggleWindParticle",!this.showWindParticle))},handleToggleWindFeather(){this.showWindFeather&&!this.showWindParticle&&this.handleWeatherLayerPick({weight:1,name:"Wind",key:"wind",enabled:!0,type:"json",particle:!0}),this.$emit("toggleWindFeather",!this.showWindFeather),localStorage.setItem(this.windFeatherCache,!this.showWindFeather)},handleToggleCurrentParticle(){!this.showCurrentIsoband&&this.showCurrentParticle?this.handleWeatherLayerPick({weight:96,name:"Current",key:"current",vendor:"cmems",merge:!0,h5:!0,enabled:!0}):(this.showWindParticle&&(this.$emit("toggleWindParticle",!1),this.showWindFeather||(this.activeWeatherLayers=this.activeWeatherLayers.filter(r=>r.key!=="wind"),localStorage.setItem(this.activeWeatherLayersCache,JSON.stringify(this.activeWeatherLayers)))),this.$emit("toggleCurrentParticle",!this.showCurrentParticle))},handleToggleCurrentIsoband(){this.showCurrentIsoband&&!this.showCurrentParticle&&this.handleWeatherLayerPick({weight:96,name:"Current",key:"current",vendor:"cmems",merge:!0,h5:!0,enabled:!0}),this.$emit("toggleCurrentIsoband",!this.showCurrentIsoband),localStorage.setItem(this.currentIsobandCache,!this.showCurrentIsoband)},handleOtherLayerPick(r){this.activeOtherLayers.some(e=>e.key===r.key)?this.activeOtherLayers=this.activeOtherLayers.filter(e=>e.key!==r.key):r.enabled&&this.activeOtherLayers.push(r),localStorage.setItem(this.activeOtherLayersCache,JSON.stringify(this.activeOtherLayers)),this.$emit("other",this.activeOtherLayers)},handleMenuToggle(){this.$emit("layerToggle",!this.layerToggle)},toggleAutoActive(){this.autoActive=!this.autoActive,localStorage.setItem(this.autoActiveCache,this.autoActive),this.autoActive?this.$emit("weather",this.activeWeatherLayers,this.source):this.$emit("weather",[],this.source)},handleCoordToggle(){this.showCoord=!this.showCoord,this.$emit("coordinate",this.showCoord)},handlePointToggle(){this.isLogin?(this.showPoint=!this.showPoint,this.$emit("point",this.showPoint)):this.$emit("handleToggleVersion")},handleMeasureToggle(){this.showMeasure=!this.showMeasure,this.$emit("measure",this.showMeasure)},handle3DToggle(){this.show3d=!this.show3d,this.$emit("3d",this.show3d)}}},Te={class:"idm-gl3-layer"},Ve={class:"bar-item layer-bars"},De={class:"bar-item tool-bars"},Be={class:"flex-between"},Ie={key:0,class:"iconfont active"},Re={key:1,class:"iconfont"},Me=["onClick"],We=["onClick"],Ae={key:0,class:"flex-start"},Oe={key:1,class:"flex-start"},Fe={class:"header-box flex-between"},je={class:"weather-layers card-bg"},$e={class:"layers-title flex-between"},He={key:0,class:"iconfont active"},Ue={key:1,class:"iconfont"},Ze={class:"layers-body"},Ge={class:"flex-start"},Je=["onClick"],Xe=["onClick"],qe={key:0,class:"flex-start"},Ye={key:1,class:"flex-start"},Qe=["onClick"],Ke={key:0,class:"iconfont bookmark-icon active"},et={key:1,class:"iconfont bookmark-icon inactive"},tt={class:"other-layers card-bg"},at={class:"layers-body"},rt=["onClick"],it={class:"flex-start"},ot={class:"switch flex-center"},st={key:0,class:"iconfont active"},nt={key:1,class:"iconfont"},lt={class:"source-layers card-bg"},ct={class:"layers-body"};function ht(r,e,a,o,i,s){const n=t.resolveComponent("ElTooltip"),l=t.resolveComponent("ElRadio"),h=t.resolveComponent("ElRadioGroup"),p=t.resolveComponent("ElScrollbar");return t.openBlock(),t.createElementBlock("div",Te,[t.createElementVNode("div",{class:"menu-bar-box",style:t.normalizeStyle({top:a.top+10+"px",right:i.right+"px"})},[t.createElementVNode("div",Ve,[t.createVNode(n,{placement:"left",effect:"light",content:"Menu","show-after":1e3},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(a.layerToggle?"menu-icon active":"menu-icon"),onClick:e[0]||(e[0]=(...c)=>s.handleMenuToggle&&s.handleMenuToggle(...c))},e[17]||(e[17]=[t.createElementVNode("span",{class:"iconfont"},"",-1)]),2)]),_:1})])],4),t.createElementVNode("div",{class:"menu-bar-box",style:t.normalizeStyle({top:a.top+160+"px",right:i.right+"px"})},[t.createElementVNode("div",De,[t.createVNode(n,{placement:"left",effect:"light",content:"Measure","show-after":1e3},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(i.showMeasure?"menu-icon active":"menu-icon"),onClick:e[1]||(e[1]=(...c)=>s.handleMeasureToggle&&s.handleMeasureToggle(...c))},e[18]||(e[18]=[t.createElementVNode("span",{class:"iconfont"},"",-1)]),2)]),_:1}),t.createVNode(n,{placement:"left",effect:"light",content:"Point Meteo","show-after":1e3},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(i.showPoint?"menu-icon active":"menu-icon"),onClick:e[2]||(e[2]=(...c)=>s.handlePointToggle&&s.handlePointToggle(...c))},e[19]||(e[19]=[t.createElementVNode("span",{class:"iconfont"},"",-1)]),2)]),_:1}),t.createVNode(n,{placement:"left",effect:"light",content:"Grid","show-after":1e3},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(i.showCoord?"menu-icon active":"menu-icon"),onClick:e[3]||(e[3]=(...c)=>s.handleCoordToggle&&s.handleCoordToggle(...c))},e[20]||(e[20]=[t.createElementVNode("span",{class:"iconfont"},"",-1)]),2)]),_:1}),t.createVNode(n,{placement:"left",effect:"light",content:"3D","show-after":1e3},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(i.show3d?"menu-icon active":"menu-icon"),onClick:e[4]||(e[4]=(...c)=>s.handle3DToggle&&s.handle3DToggle(...c))},e[21]||(e[21]=[t.createElementVNode("span",{class:"iconfont"},"",-1)]),2)]),_:1})])],4),s.hasCollectedLayers?(t.openBlock(),t.createElementBlock("div",{key:0,class:"active-layers",style:t.normalizeStyle({right:i.right+"px",bottom:"100px"})},[t.createElementVNode("div",Be,[e[22]||(e[22]=t.createElementVNode("div",{style:{margin:"2px 5px"}},"My Favorites",-1)),t.createElementVNode("div",{class:"switch flex-center",style:{"font-size":"28px","margin-right":"0"},onClick:e[5]||(e[5]=(...c)=>s.toggleAutoActive&&s.toggleAutoActive(...c))},[i.autoActive?(t.openBlock(),t.createElementBlock("i",Ie,"")):(t.openBlock(),t.createElementBlock("i",Re,""))])]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.layers.weather.filter(c=>c.collected),c=>(t.openBlock(),t.createElementBlock("div",{key:c.key,class:t.normalizeClass(s.computeLayerClass(c,i.activeWeatherLayers))},[t.createElementVNode("div",{class:"checkbox",onClick:d=>s.handleWeatherLayerPick(c)},null,8,Me),t.createElementVNode("span",{class:"name",onClick:d=>s.handleWeatherLayerPick(c)},t.toDisplayString(c.name),9,We),c.key==="wind"&&i.activeWeatherLayers.some(d=>d.key===c.key)?(t.openBlock(),t.createElementBlock("div",Ae,[t.createElementVNode("i",{class:t.normalizeClass(["iconfont sub-layer-icon",a.showWindParticle?"active":""]),onClick:e[6]||(e[6]=d=>s.handleToggleWindParticle())},"",2),t.createElementVNode("i",{class:t.normalizeClass(["iconfont sub-layer-icon",a.showWindFeather?"active":""]),onClick:e[7]||(e[7]=d=>s.handleToggleWindFeather())},"",2)])):t.createCommentVNode("",!0),c.key==="current"&&i.activeWeatherLayers.some(d=>d.key===c.key)?(t.openBlock(),t.createElementBlock("div",Oe,[t.createElementVNode("i",{class:t.normalizeClass(["iconfont sub-layer-icon",a.showCurrentParticle?"active":""]),onClick:e[8]||(e[8]=d=>s.handleToggleCurrentParticle())},"",2),t.createElementVNode("i",{class:t.normalizeClass(["iconfont sub-layer-icon",a.showCurrentIsoband?"active":""]),onClick:e[9]||(e[9]=d=>s.handleToggleCurrentIsoband())},"",2)])):t.createCommentVNode("",!0)],2))),128))],4)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"available-layers flex-center",style:t.normalizeStyle({top:a.top+"px",right:a.layerToggle?"0px":"-240px"})},[t.createElementVNode("div",{class:t.normalizeClass(["list-box",a.layerToggle?"right-bar":""])},[t.createElementVNode("div",Fe,[e[23]||(e[23]=t.createElementVNode("div",null,"Layers",-1)),t.createElementVNode("div",{class:"iconfont close-btn",onClick:e[10]||(e[10]=(...c)=>s.handleMenuToggle&&s.handleMenuToggle(...c))},"")]),t.createVNode(p,{style:{flex:"1"}},{default:t.withCtx(()=>[t.createElementVNode("div",je,[t.createElementVNode("div",$e,[e[24]||(e[24]=t.createElementVNode("div",null,"Weather Layers",-1)),t.createElementVNode("div",{class:"switch flex-center",style:{"margin-right":"0"},onClick:e[11]||(e[11]=(...c)=>s.toggleAutoActive&&s.toggleAutoActive(...c))},[i.autoActive?(t.openBlock(),t.createElementBlock("i",He,"")):(t.openBlock(),t.createElementBlock("i",Ue,""))])]),t.createElementVNode("div",Ze,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.layers.weather,c=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:c.key},[c.hide?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(s.computeLayerClass(c,i.activeWeatherLayers))},[t.createElementVNode("div",Ge,[t.createElementVNode("div",{class:"checkbox",onClick:d=>s.handleWeatherLayerPick(c)},null,8,Je),t.createElementVNode("span",{class:"name",onClick:d=>s.handleWeatherLayerPick(c)},t.toDisplayString(c.name),9,Xe),c.key==="wind"&&i.activeWeatherLayers.some(d=>d.key===c.key)?(t.openBlock(),t.createElementBlock("div",qe,[t.createElementVNode("i",{class:t.normalizeClass(["iconfont sub-layer-icon",a.showWindParticle?"active":""]),onClick:e[12]||(e[12]=d=>s.handleToggleWindParticle())},"",2),t.createElementVNode("i",{class:t.normalizeClass(["iconfont sub-layer-icon",a.showWindFeather?"active":""]),onClick:e[13]||(e[13]=d=>s.handleToggleWindFeather())},"",2)])):t.createCommentVNode("",!0),c.key==="current"&&i.activeWeatherLayers.some(d=>d.key===c.key)?(t.openBlock(),t.createElementBlock("div",Ye,[t.createElementVNode("i",{class:t.normalizeClass(["iconfont sub-layer-icon",a.showCurrentParticle?"active":""]),onClick:e[14]||(e[14]=d=>s.handleToggleCurrentParticle())},"",2),t.createElementVNode("i",{class:t.normalizeClass(["iconfont sub-layer-icon",a.showCurrentIsoband?"active":""]),onClick:e[15]||(e[15]=d=>s.handleToggleCurrentIsoband())},"",2)])):t.createCommentVNode("",!0)]),t.createElementVNode("div",{onClick:d=>s.handleWeatherLayerCollect(c)},[c.collected?(t.openBlock(),t.createElementBlock("i",Ke,"")):(t.openBlock(),t.createElementBlock("i",et,""))],8,Qe)],2))],64))),128)),e[25]||(e[25]=t.createElementVNode("div",{class:"tip flex-start"},[t.createElementVNode("i",{class:"iconfont bookmark-icon",style:{"align-self":"flex-start",padding:"5px 5px 0 0"}},""),t.createElementVNode("div",null,"You can add the layers to your favorites. (Max 6)")],-1))])]),t.createElementVNode("div",tt,[e[26]||(e[26]=t.createElementVNode("div",{class:"layers-title"},"Other Layers",-1)),t.createElementVNode("div",at,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.layers.other,c=>{var d;return t.openBlock(),t.createElementBlock("div",{key:c.key,class:t.normalizeClass(["layer flex-between",s.computeLayerClass(c,i.activeOtherLayers)]),onClick:u=>s.handleOtherLayerPick(c)},[t.createElementVNode("div",it,[t.createElementVNode("div",ot,[(d=s.computeLayerClass(c,i.activeOtherLayers))!=null&&d.includes("active")?(t.openBlock(),t.createElementBlock("i",st,"")):(t.openBlock(),t.createElementBlock("i",nt,""))]),t.createElementVNode("span",null,t.toDisplayString(c.name),1)])],10,rt)}),128))])]),t.createElementVNode("div",lt,[e[29]||(e[29]=t.createElementVNode("span",{class:"layers-title"},"Forecast Model",-1)),t.createElementVNode("div",ct,[t.createVNode(h,{modelValue:i.source,"onUpdate:modelValue":e[16]||(e[16]=c=>i.source=c),class:"layer-radio flex-col-center-start"},{default:t.withCtx(()=>[t.createVNode(l,{value:"GFS"},{default:t.withCtx(()=>e[27]||(e[27]=[t.createTextVNode("GFS")])),_:1}),t.createVNode(l,{value:"CMEMS"},{default:t.withCtx(()=>e[28]||(e[28]=[t.createTextVNode("CMEMS")])),_:1})]),_:1},8,["modelValue"])])])]),_:1})],2)],4)])}const dt=E(ze,[["render",ht]]),mi="",pt={name:"IdmWindBarb",props:{map:{type:Object},wind:{type:Object},current:{type:Object},beforeLayer:{type:String},mapProjection:{type:String},showWindFeather:{type:Boolean,default:!1},showWindParticle:{type:Boolean,default:!1},toggleVersion:{type:Number}},emits:["particle","showWindFeather"],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:v.featureCollection([]),right:10,bottom:125,windBarbLoaded:!1}},watch:{"wind.version":{handler(){var r;(r=this.wind)!=null&&r.active&&this.showWindFeather?this.handleRender():this.handleClear()},deep:!0},showWindParticle:{handler(){this.handleParticle()}},showWindFeather:{handler(){this.handleToggle()}}},methods:{handleParticle(){this.$emit("particle",{particle:this.showWindParticle,key:"wind",weight:1})},handleRender(){var r,e,a,o;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.wind){const i=new Date().valueOf();let s=0,n=0,l=this.empty;if((r=this.wind)!=null&&r.active&&(l=(e=this.wind)==null?void 0:e.data),(a=this.map)!=null&&a.getSource(this.source))(o=this.map)==null||o.getSource(this.source).setData(l),n=new Date().valueOf()-(i+s),console.log("[wind] update elapsed: ",n,", total: ",s+=n);else{this.map.addSource(this.source,{type:"geojson",data:l});for(let h=0;h<(this.barbs??[]).length-1;h++){const p=(this.barbs??[])[h]||0,c=(this.barbs??[])[h+1]||0,d=p<10?`00${p}kts`:p<100?`0${p}kts`:`${p}kts`;this.map.addLayer({id:d,type:"symbol",filter:["all",[">=","spd",p],["<","spd",c]],source:this.source,layout:{"symbol-placement":"point","icon-image":d,"icon-size":.14,"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":1,"text-color":"#222"}},this.beforeLayer)}this.windBarbLoaded=!0,n=new Date().valueOf()-(i+s),console.log("[wind] add elapsed: ",n,", total: ",s+=n)}}},handleToggle(){if(!this.windBarbLoaded)this.handleRender();else for(const r of this.barbs??[]){const e=r<10?`00${r}kts`:r<100?`0${r}kts`:`${r}kts`;this.map.getLayer(e)&&this.map.setLayoutProperty(e,"visibility",this.showWindFeather?"visible":"none")}},handleClear(){for(const r of this.barbs??[]){const e=r<10?`00${r}kts`:r<100?`0${r}kts`:`${r}kts`;this.map.getLayer(e)&&this.map.removeLayer(e)}this.map.getSource(this.source)&&this.map.removeSource(this.source),this.windBarbLoaded=!1}}},mt={key:0};function yt(r,e,a,o,i,s){var n;return(n=a.wind)!=null&&n.active?(t.openBlock(),t.createElementBlock("div",mt)):t.createCommentVNode("",!0)}const ft=E(pt,[["render",yt]]);class oe{constructor(e){T(this,"map");T(this,"mercator");T(this,"rampColorLayer");T(this,"rampColorSource");T(this,"particleLayer");T(this,"particleSource");T(this,"rampColorCanvas");T(this,"particleCanvas");T(this,"ratio");this.map=e,this.mercator=new Pe,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,a=0){return e>180?this.convertNLng(e-360,a+1):e<-180?this.convertNLng(e+360,a+1):[e,a]}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(),a=this.map.getZoom()+1,o=[e._ne.lng,e._ne.lat],i=[e._sw.lng,e._sw.lat],[s,n]=this.convertNLng(o[0]),[l,h]=this.convertNLng(i[0]),[p,c]=this.mercator.px([s,o[1]],a),[d,u]=this.mercator.px([l,i[1]],a),m=Math.round(this.mercator.size*Math.pow(2,a)*(n+h));return[d,u,p+m,c]}getBoundRange(){const e=this.map.getZoom()+1,a=this.mercator.size*Math.pow(2,e),o=this.getBoundPixel();return[o[0]/a,o[2]/a,o[3]/a,o[1]/a]}getWorldCopy(e,a){const o=2**a,[i,s,n,l]=e.map(c=>~~(c/(o*256))),h=[];for(let c=l;c<=s;c++)for(let d=i;d<=n;d++)h.push([d,c]);return h.map(c=>{const d=2**a*256;return[c[0]*d,c[1]*d,d]})}resize(){let e=this.map.getSource(this.rampColorSource);e.setCoordinates(this.getBoundLngLat()),e=this.map.getSource(this.particleSource),e.setCoordinates(this.getBoundLngLat()),this.rampColorCanvas.width=this.map._canvas.clientWidth,this.rampColorCanvas.height=this.map._canvas.clientHeight,this.particleCanvas.width=this.map._canvas.clientWidth,this.particleCanvas.height=this.map._canvas.clientHeight}toggle(e){const a=this.map.getLayoutProperty(this.rampColorLayer,"visibility"),o=e?"visible":"none";a!==o&&this.map.setLayoutProperty(this.rampColorLayer,"visibility",o)}toggleParticle(e){const a=this.map.getLayoutProperty(this.particleLayer,"visibility"),o=e?"visible":"none";a!==o&&this.map.setLayoutProperty(this.particleLayer,"visibility",o)}}class H{createShader(e,a,o){const i=e.createShader(a);if(i&&(e.shaderSource(i,o),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)))throw new Error(e.getShaderInfoLog(i)||"error happened while create shader...");return i}createTexture(e,a,o,i,s,n,l){const h=e.createTexture();return e.bindTexture(e.TEXTURE_2D,h),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,a),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,i),s instanceof Uint8Array?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,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),h}createDataBuffer(e,a,o){if(e){const i=e.createBuffer();return a==="array"?(e.bindBuffer(e.ARRAY_BUFFER,i),o&&e.bufferData(e.ARRAY_BUFFER,o,e.STATIC_DRAW)):a==="element"&&(e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,i),o&&e.bufferData(e.ELEMENT_ARRAY_BUFFER,o,e.STATIC_DRAW)),i}return null}createProgram(e,a,o){const i=e.createProgram(),s=this.createShader(e,e.VERTEX_SHADER,a),n=this.createShader(e,e.FRAGMENT_SHADER,o);if(i&&s&&n&&(e.attachShader(i,s),e.attachShader(i,n),e.linkProgram(i),!e.getProgramParameter(i,e.LINK_STATUS)))throw new Error(e.getProgramInfoLog(i)||"error happened while creating ramp color program");return i}createProgramWrapper(e,a,o){const i=this.createProgram(e,a,o);if(i){const s={program:i},n=e.getProgramParameter(i,e.ACTIVE_ATTRIBUTES);for(let h=0;h<n;h++){const p=e.getActiveAttrib(i,h);s[p.name]=e.getAttribLocation(i,p.name)}const l=e.getProgramParameter(i,e.ACTIVE_UNIFORMS);for(let h=0;h<l;h++){const p=e.getActiveUniform(i,h);s[p.name]=e.getUniformLocation(i,p.name)}return s}}setup(e,a,o=!1,i,s){const n=document.createElement("canvas");n.width=256,n.height=1;const l=n.getContext("2d");if(l&&e){const h=l==null?void 0:l.createLinearGradient(0,0,256,0);return a.forEach(([p,c])=>{h.addColorStop(p,c)}),l.fillStyle=h,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,i,s)}}}setupParticle(e,a=1e3){const o=Math.ceil(Math.sqrt(a)),i=o*o,s=new Uint8Array(i*4);for(let c=0;c<s.length;c++)s[c]=Math.floor(Math.random()*256);const n=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,s,o,o),l=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,s,o,o),h=new Float32Array(i);for(let c=0;c<i;c++)h[c]=c;const p=this.createDataBuffer(e,"array",h);return{resolution:o,total:i,texture0:n,texture1:l,indexBuffer:p}}bind(e,a,o){const i=this.createProgram(e,a,o);if(i){const s=this.createDataBuffer(e,"array",void 0),n=e.getAttribLocation(i,"a_position");e.enableVertexAttribArray(n),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0);const l=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);this.createDataBuffer(e,"array",l);const h=e.getAttribLocation(i,"a_texCoord");return e.enableVertexAttribArray(h),e.vertexAttribPointer(h,2,e.FLOAT,!1,0,0),{program:i,aPositionBuffer:s}}return{}}bindParticle(e,a,o,i,s,n){const l=this.createProgramWrapper(e,a,o),h=this.createProgramWrapper(e,i,s),p=this.createProgramWrapper(e,i,n),c=this.createDataBuffer(e,"array",new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])),d=e.createFramebuffer();return{particle:l,screen:h,update:p,quadBuffer:c,frameBuffer:d}}draw(e,a,o,i,s,n,l){var h,p;if(a&&o){e.resize(),a==null||a.viewport(0,0,(h=a==null?void 0:a.canvas)==null?void 0:h.width,(p=a==null?void 0:a.canvas)==null?void 0:p.height),a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT);try{const c=a.getUniformLocation(o,"u_resolution"),d=a.getUniformLocation(o,"u_image"),u=a.getUniformLocation(o,"u_color");if(a.useProgram(o),a.uniform2f(c,a.canvas.width*e.ratio,a.canvas.height*e.ratio),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,i),a.uniform1i(d,0),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,s),a.uniform1i(u,1),l!=null&&l.uvRange&&(l!=null&&l.sRange)){const y=a.getUniformLocation(o,"u_range_u_v"),w=a.getUniformLocation(o,"u_range_s");a.uniform2f(y,l.uvRange[0],l.uvRange[1]),a.uniform2f(w,l.sRange[0],l.sRange[1])}const m=e.getBoundPixel(),b=e.map.getZoom()+1,f=e.getWorldCopy(m,b);for(const y of f){const w=(y[0]-m[0])*e.ratio,g=(y[1]-m[3])*e.ratio,x=y[2]*e.ratio,[C,L,_,P]=[w,x+w,g,x+g],I=new Float32Array([C,_,L,_,C,P,C,P,L,_,L,P]);a.bindBuffer(a.ARRAY_BUFFER,n),a.bufferData(a.ARRAY_BUFFER,I,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6)}}catch(c){console.log(`render failed...${c}`)}}}drawParticle(e,a,o,i,s){var n,l;a&&(a==null||a.viewport(0,0,(n=a==null?void 0:a.canvas)==null?void 0:n.width,(l=a==null?void 0:a.canvas)==null?void 0:l.height),a.disable(a.DEPTH_TEST),a.disable(a.STENCIL_TEST),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,o),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,i.texture0),this.renderScreen(e,a,i,s),this.updateParticles(e,a,i,s))}renderScreen(e,a,o,i){a.bindFramebuffer(a.FRAMEBUFFER,o.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,o.screenTexture,0),a.viewport(0,0,a.canvas.width,a.canvas.height),this.renderScreenTexture(a,o.backgroundTexture,o.screen,o.quadBuffer,.95),this.renderParticles(e,a,o,i),a.bindFramebuffer(a.FRAMEBUFFER,null),this.renderScreenTexture(a,o.screenTexture,o.screen,o.quadBuffer,1);const s=o.backgroundTexture;o.backgroundTexture=o.screenTexture,o.screenTexture=s}renderScreenTexture(e,a,o,i,s){e&&(e.useProgram(o.program),e.bindBuffer(e.ARRAY_BUFFER,i),e.enableVertexAttribArray(o.a_pos),e.vertexAttribPointer(o.a_pos,2,e.FLOAT,!1,0,0),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,a),e.uniform1i(o.u_screen,2),e.uniform1f(o.u_opacity,s),e.drawArrays(e.TRIANGLES,0,6))}renderParticles(e,a,o,i){if(a){a.useProgram(o.particle.program),a.bindBuffer(a.ARRAY_BUFFER,o.indexBuffer),a.enableVertexAttribArray(o.particle.a_index),a.vertexAttribPointer(o.particle.a_index,1,a.FLOAT,!1,0,0),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,o.color.texture),a.uniform1i(o.particle.u_factor,0),a.uniform1i(o.particle.u_particles,1),a.uniform1i(o.particle.u_color_ramp,2),a.uniform1f(o.particle.u_particles_resolution,o.resolution*e.ratio),a.uniform1f(o.particle.u_point,e.ratio);const s=e.getBoundRange();a.uniform4f(o.particle.u_viewport,s[0],s[1],s[2],s[3]),a.uniform2f(o.particle.u_factor_min,i.uvRange[0],i.uvRange[0]),a.uniform2f(o.particle.u_factor_max,i.uvRange[1],i.uvRange[1]),a.drawArrays(a.POINTS,0,o.total)}}updateParticles(e,a,o,i){var n,l;if(a){a.bindFramebuffer(a.FRAMEBUFFER,o.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,o.texture1,0),a.viewport(0,0,o.resolution,o.resolution),a.useProgram(o.update.program),a.bindBuffer(a.ARRAY_BUFFER,o.quadBuffer),a.enableVertexAttribArray(o.update.a_pos),a.vertexAttribPointer(o.update.a_pos,2,a.FLOAT,!1,0,0),a.uniform1i(o.update.u_factor,0),a.uniform1i(o.update.u_particles,1);const h=e.getBoundRange();a.uniform4f(o.update.u_viewport,h[0],h[1],h[2],h[3]),a.uniform1f(o.update.u_rand_seed,Math.random()),a.uniform2f(o.update.u_factor_res,(n=o==null?void 0:o.image)==null?void 0:n.width,(l=o==null?void 0:o.image)==null?void 0:l.height),a.uniform2f(o.update.u_factor_min,i.uvRange[0],i.uvRange[0]),a.uniform2f(o.update.u_factor_max,i.uvRange[1],i.uvRange[1]),a.uniform1f(o.update.u_speed_factor,i.speedFactor*e.ratio),a.uniform1f(o.update.u_drop_rate,i.dropRate),a.uniform1f(o.update.u_drop_rate_bump,i.dropRateBump),a.drawArrays(a.TRIANGLES,0,6)}const s=o.texture0;o.texture0=o.texture1,o.texture1=s}resize(e,a){e.resize();const o=new Uint8Array(a.canvas.width*a.canvas.height*4).fill(0,0,a.canvas.width*a.canvas.height*4),i=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,o,a.canvas.width,a.canvas.height),s=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,o,a.canvas.width,a.canvas.height);return{screenTexture:i,backgroundTexture:s}}async loadImg(e){return new Promise(a=>{const o=new Blob([e],{type:e.type}),i=URL.createObjectURL(o),s=new Image;s.crossOrigin="anonymous",s.src=i,s.onload=()=>a(s)})}}class B{}T(B,"vertexSchema",`
2
2
  //canvas 坐标系上的坐标 (x, y)
3
3
  attribute vec2 a_position; //像素坐标
4
4
  attribute vec2 a_texCoord; //纹理坐标
@@ -186,8 +186,8 @@
186
186
  gl_FragColor = vec4(
187
187
  fract(pos * 255.0),
188
188
  floor(pos * 255.0) / 255.0);
189
- }`);class pe{constructor(e="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNseTVudHJzYzAwNWUwbHBsZHkyaDRqczMiLCJyb2xlIjoxLCJuYW1lIjoiZmFrZUBvcm13eC5jb20iLCJwbGF0SWQiOiJnZDBtdDFkIiwiY29tcGFueSI6eyJpZCI6bnVsbCwiY2hpbGRyZW4iOltdfSwiaWF0IjoxNzIzMDI0MDI0LCJleHAiOjM5MzA1NDQwMjR9.RrKcdcMnq-FxBLJQ-i6lx2FscDE46y8EvHIemPW4HTg"){T(this,"token");T(this,"mapboxCustomer");T(this,"i4");T(this,"hi");T(this,"td");T(this,"windy");this.token=e,this.mapboxCustomer={source:this.initialOnlineStyle().sources.composite,layers:{water:{id:"water",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},paint:{"fill-color":"hsl(205, 75%, 70%)"}},waterDeplth:{id:"water-depth",type:"fill",source:"composite","source-layer":"depth",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},maxzoom:8,paint:{"fill-antialias":!1,"fill-color":["interpolate",["linear"],["zoom"],6,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0.35)",200,"hsla(205, 75%, 63%, 0.35)",7e3,"hsla(205, 75%, 56%, 0.35)"],8,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0)",200,"hsla(205, 75%, 63%, 0)",7e3,"hsla(205, 75%, 53%, 0)"]]}},countryBoundary:{id:"country-boundaries",type:"fill",source:"composite","source-layer":"country_boundaries",layout:{visibility:"visible"},paint:{"fill-color":"#d9d8d8"}},countryAdmin0BoundaryBg:{id:"admin-0-boundary-bg",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-width":["interpolate",["linear"],["zoom"],3,4,12,8],"line-color":"rgb(193, 190, 190)","line-opacity":["interpolate",["linear"],["zoom"],3,0,4,.5],"line-blur":["interpolate",["linear"],["zoom"],3,0,12,2]}},countryAdmin0Boundary:{id:"admin-0-boundary",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","disputed"],"false"],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(114, 110, 111)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[2,0]],7,["literal",[2,2,6,2]]]}},countryAdmin0BoundaryDisputed:{id:"admin-0-boundary-disputed",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","disputed"],"true"],["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(95, 93, 94)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[3,2,5]],7,["literal",[2,1.5]]]}},countryLabel:{id:"country-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},layout:{visibility:"visible","text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["HelveticaNeueThin"],"text-radial-offset":["step",["zoom"],.6,8,0],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],7,"auto"],"text-size":["interpolate",["cubic-bezier",.2,0,.7,1],["zoom"],1,["step",["get","symbolrank"],11,4,9,5,8],9,["step",["get","symbolrank"],22,4,19,5,17]]},paint:{"text-color":"rgba(255,255,255,0)"}}}},this.td={source:{type:"raster",tiles:["https://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t1.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t2.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t3.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t4.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t5.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t6.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t7.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8"],tileSize:256},layer:{id:"td",type:"raster",source:"td",layout:{visibility:"visible"}}},this.i4={source:{type:"raster",tiles:["https://osshz.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz1.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz2.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz3.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz4.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz5.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz6.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz7.idmwx.com/nautical/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"i4",type:"raster",source:"i4",layout:{visibility:"none"}}},this.hi={source:{type:"raster",tiles:[`https://assist0.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist1.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist2.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist3.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist4.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist5.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist6.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist7.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`],tileSize:256},layer:{id:"hi",type:"raster",source:"hi",layout:{visibility:"none"}}},this.windy={darkmap:{source:{type:"raster",tiles:["https://tiles.windy.com/tiles/v10.0/darkmap/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"darkmap",type:"raster",source:"darkmap",layout:{visibility:"none"}}},grayland:{source:{type:"raster",tiles:["https://tiles.windy.com/tiles/v9.0/grayland/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"grayland",type:"raster",source:"grayland",layout:{visibility:"none"},paint:{"raster-opacity":1}}}}}initialOnlineStyle(){return{version:8,name:"map-weather-v2.0.0",metadata:{"mapbox:print":{width:8.5,height:11,units:"in",format:"png",resolution:300},"mapbox:type":"default","mapbox:trackposition":!0,"mapbox:autocomposite":!0,"mapbox:sdk-support":{android:"11.0.0",ios:"11.0.0",js:"3.0.0"},"mapbox:origin":"outdoors-v12","mapbox:groups":{"Terrain, terrain-labels":{name:"Terrain, terrain-labels",collapsed:!0},"Administrative boundaries, admin":{name:"Administrative boundaries, admin",collapsed:!1},"Land & water, built":{name:"Land & water, built",collapsed:!1},"Terrain, surface":{name:"Terrain, surface",collapsed:!0},"Land & water, land":{name:"Land & water, land",collapsed:!1},"Natural features, natural-labels":{name:"Natural features, natural-labels",collapsed:!0},"Walking, cycling, etc., barriers-bridges":{name:"Walking, cycling, etc., barriers-bridges",collapsed:!0},"Place labels, place-labels":{name:"Place labels, place-labels",collapsed:!1},"Transit, ferries":{name:"Transit, ferries",collapsed:!0},"Transit, elevated":{name:"Transit, elevated",collapsed:!0},"Walking, cycling, etc., tunnels":{name:"Walking, cycling, etc., tunnels",collapsed:!0},"Terrain, land":{name:"Terrain, land",collapsed:!0},"Road network, tunnels-case":{name:"Road network, tunnels-case",collapsed:!0},"Walking, cycling, etc., walking-cycling-labels":{name:"Walking, cycling, etc., walking-cycling-labels",collapsed:!0},"Walking, cycling, etc., surface":{name:"Walking, cycling, etc., surface",collapsed:!0},"Road network, surface-icons":{name:"Road network, surface-icons",collapsed:!0},"Land & water, water":{name:"Land & water, water",collapsed:!1}}},lights:[],fog:{color:"#ffffff",range:[.5,10],"high-color":"#245cdf","space-color":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"horizon-blend":["interpolate",["linear"],["zoom"],4,.2,7,.1],"star-intensity":["interpolate",["linear"],["zoom"],5,.35,6,0],"vertical-range":[0,0]},center:[80.02170408691855,17.83215724225399],zoom:2.4589703839156347,bearing:0,pitch:1,sprite:"mapbox://sprites/neatchenheng/clxwst0tq00wd01rn0usb2eer/3hcvufdre7i2yn9nbkvi9f9xi",glyphs:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",projection:{name:"equirectangular"},sources:{composite:{type:"vector",url:"mapbox://mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1",data:{attribution:'<a href="https://www.mapbox.com/about/maps/" target="_blank" title="Mapbox" aria-label="Mapbox">&copy; Mapbox</a> <a href="https://www.openstreetmap.org/about/" target="_blank" title="OpenStreetMap" aria-label="OpenStreetMap">&copy; OpenStreetMap</a> <a href="https://www.mapbox.com/about/maps/" target="_blank" title="Mapbox" aria-label="Mapbox">&copy; Mapbox</a> <a href="https://www.openstreetmap.org/about/" target="_blank" title="OpenStreetMap" aria-label="OpenStreetMap">&copy; OpenStreetMap</a> <a class="mapbox-improve-map" href="https://www.mapbox.com/contribute/" target="_blank" title="Improve this map" aria-label="Improve this map">Improve this map</a>',bounds:[-180,-85.051129,180,85],center:[0,-.025564500000001544,0],description:"Global polygon tileset of country boundaries and disputed areas",format:"pbf",language_options:{ar:"Arabic",ca:"Catalan",cs:"Czech",da:"Danish",de:"German",el:"Greek",en:"English",es:"Spanish",fa:"Farsi",fi:"Finnish",fr:"French",he:"Hebrew",hu:"Hungarian",id:"Indonesian",it:"Italian",ja:"Japanese",ka:"Georgian",ko:"Korean",local:"Renderable local language",lv:"Latvian",ms:"Malay",nb:"Norwegian Bokmål",nl:"Dutch",no:"Norwegian",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sk:"Slovak",sl:"Slovenian",sr:"Serbian",sv:"Swedish",th:"Thai",tl:"Tagalog",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese","zh-Hans":"Simplified Chinese","zh-Hant":"Traditional Chinese"},mapbox_logo:!0,maskLevel:9,maxzoom:16,minzoom:0,mts:!0,name:"Mapbox Countries v1 + Mapbox Bathymetry v2 + Mapbox Terrain v2 + Mapbox Streets v8",scheme:"xyz",tilejson:"2.2.0",tiles:["https://a.tiles.mapbox.com/v4/mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1IjoibmVhdGNoZW5oZW5nIiwiYSI6ImNsdXM3cnBmODBsemgycW1vaXc1bjV6bXMifQ.w6fqHGRbhNhLvm0LnX4ZVw","https://b.tiles.mapbox.com/v4/mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1IjoibmVhdGNoZW5oZW5nIiwiYSI6ImNsdXM3cnBmODBsemgycW1vaXc1bjV6bXMifQ.w6fqHGRbhNhLvm0LnX4ZVw"],vector_layers:[{id:"landuse",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"waterway",minzoom:7,source:"mapbox.mapbox-streets-v8"},{id:"water",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"aeroway",minzoom:9,source:"mapbox.mapbox-streets-v8"},{id:"structure",minzoom:13,source:"mapbox.mapbox-streets-v8"},{id:"building",minzoom:12,source:"mapbox.mapbox-streets-v8"},{id:"landuse_overlay",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"road",minzoom:3,source:"mapbox.mapbox-streets-v8"},{id:"admin",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"place_label",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"airport_label",minzoom:8,source:"mapbox.mapbox-streets-v8"},{id:"transit_stop_label",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"natural_label",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"poi_label",minzoom:6,source:"mapbox.mapbox-streets-v8"},{id:"motorway_junction",minzoom:9,source:"mapbox.mapbox-streets-v8"},{id:"housenum_label",minzoom:16,source:"mapbox.mapbox-streets-v8"},{id:"landcover",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"hillshade",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"contour",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"depth",maxzoom:7,minzoom:0,source:"mapbox.mapbox-bathymetry-v2"},{id:"country_boundaries",maxzoom:22,minzoom:0,source:"mapbox.country-boundaries-v1"}],worldview_default:"US",worldview_options:{AR:"Argentina",CN:"China",IN:"India",JP:"Japan",MA:"Morocco",RS:"Serbia",RU:"Russia",TR:"Turkey",US:"United States"}}}},layers:[{id:"land",type:"background",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},paint:{"background-color":"rgb(171, 174, 172)"}},{id:"landcover",type:"fill",source:"composite","source-layer":"landcover",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},maxzoom:12,paint:{"fill-color":["match",["get","class"],"wood","hsl(0, 0%, 69%)","scrub","hsl(0, 0%, 69%)","crop","hsl(0, 0%, 69%)","grass","hsl(0, 0%, 69%)","snow","hsl(0, 0%, 69%)","hsl(0, 0%, 69%)"],"fill-opacity":["interpolate",["exponential",1.5],["zoom"],8,.8,12,0],"fill-antialias":!1}},{id:"national-park",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:5,filter:["==",["get","class"],"national_park"],paint:{"fill-color":"hsl(98, 38%, 68%)","fill-opacity":["interpolate",["linear"],["zoom"],5,0,6,.6,12,.2]}},{id:"national-park_tint-band",type:"line",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:9,filter:["==",["get","class"],"national_park"],paint:{"line-color":"hsl(98, 38%, 68%)","line-width":["interpolate",["exponential",1.5],["zoom"],9,1,14,8],"line-blur":["interpolate",["exponential",1.5],["zoom"],9,1,14,8]}},{id:"landuse",type:"fill",source:"composite","source-layer":"landuse",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:5,filter:["all",[">=",["to-number",["get","sizerank"]],0],["match",["get","class"],["agriculture","wood","grass","scrub","glacier","pitch","sand"],["step",["zoom"],!1,11,!0],"residential",["step",["zoom"],!0,10,!1],["park","airport"],["step",["zoom"],!1,8,["case",["==",["get","sizerank"],1],!0,!1],10,!0],["facility","industrial"],["step",["zoom"],!1,12,!0],"rock",["step",["zoom"],!1,11,!0],"cemetery",["step",["zoom"],!1,11,!0],"school",["step",["zoom"],!1,11,!0],"hospital",["step",["zoom"],!1,11,!0],"commercial_area",["step",["zoom"],!1,11,!0],!1],["<=",["-",["to-number",["get","sizerank"]],["interpolate",["exponential",1.5],["zoom"],12,0,18,14]],14]],paint:{"fill-color":["interpolate",["linear"],["zoom"],15,["match",["get","class"],"wood","hsla(103, 50%, 60%, 0.8)","scrub","hsla(98, 47%, 68%, 0.6)","agriculture","hsla(98, 50%, 74%, 0.6)","park",["match",["get","type"],["garden","playground","zoo"],"hsl(98, 38%, 68%)","hsl(98, 55%, 70%)"],"grass","hsla(98, 50%, 74%, 0.6)","airport","hsl(230, 40%, 82%)","cemetery","hsl(98, 45%, 75%)","glacier","hsl(205, 45%, 95%)","hospital","hsl(20, 45%, 82%)","pitch","hsl(88, 65%, 75%)","sand","hsl(69, 60%, 72%)","rock","hsl(60, 0%, 85%)","school","hsl(40, 45%, 78%)","commercial_area","hsl(55, 45%, 85%)","residential","hsl(60, 7%, 87%)",["facility","industrial"],"hsl(230, 20%, 85%)","hsl(60, 12%, 72%)"],16,["match",["get","class"],"wood","hsla(103, 50%, 60%, 0.8)","scrub","hsla(98, 47%, 68%, 0.6)","agriculture","hsla(98, 50%, 74%, 0.6)","park",["match",["get","type"],["garden","playground","zoo"],"hsl(98, 38%, 68%)","hsl(98, 55%, 70%)"],"grass","hsla(98, 50%, 74%, 0.6)","airport","hsl(230, 40%, 82%)","cemetery","hsl(98, 45%, 75%)","glacier","hsl(205, 45%, 95%)","hospital","hsl(20, 45%, 82%)","pitch","hsl(88, 65%, 75%)","sand","hsl(69, 60%, 72%)","rock","hsla(60, 0%, 85%, 0.5)","school","hsl(40, 45%, 78%)","commercial_area","hsla(55, 45%, 85%, 0.5)",["facility","industrial"],"hsl(230, 20%, 85%)","hsl(60, 12%, 72%)"]],"fill-opacity":["interpolate",["linear"],["zoom"],8,["match",["get","class"],"residential",.8,.2],10,["match",["get","class"],"residential",0,1]],"fill-antialias":!1}},{id:"pitch-outline",type:"line",source:"composite","source-layer":"landuse",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:15,filter:["==",["get","class"],"pitch"],paint:{"line-color":"hsl(0, 0%, 69%)"}},{id:"waterway-shadow",type:"line",source:"composite","source-layer":"waterway",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:10,layout:{"line-cap":["step",["zoom"],"butt",11,"round"],"line-join":["step",["zoom"],"miter",11,"round"]},paint:{"line-color":"hsl(224, 79%, 69%)","line-width":["interpolate",["exponential",1.3],["zoom"],9,["match",["get","class"],["canal","river"],.1,0],20,["match",["get","class"],["canal","river"],8,3]],"line-translate":["interpolate",["exponential",1.2],["zoom"],7,["literal",[0,0]],16,["literal",[-1,-1]]],"line-translate-anchor":"viewport","line-opacity":["interpolate",["linear"],["zoom"],8,0,8.5,1]}},{id:"water-shadow",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:10,paint:{"fill-color":"hsl(224, 79%, 69%)","fill-translate":["interpolate",["exponential",1.2],["zoom"],7,["literal",[0,0]],16,["literal",[-1,-1]]],"fill-translate-anchor":"viewport"}},{id:"waterway",type:"line",source:"composite","source-layer":"waterway",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:8,layout:{"line-cap":["step",["zoom"],"butt",11,"round"],"line-join":["step",["zoom"],"miter",11,"round"]},paint:{"line-color":"hsl(205, 75%, 70%)","line-width":["interpolate",["exponential",1.3],["zoom"],9,["match",["get","class"],["canal","river"],.1,0],20,["match",["get","class"],["canal","river"],8,3]],"line-opacity":["interpolate",["linear"],["zoom"],8,0,8.5,1]}},{id:"water",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},paint:{"fill-color":"hsl(205, 75%, 70%)"}},{id:"water-depth",type:"fill",source:"composite","source-layer":"depth",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},maxzoom:8,paint:{"fill-antialias":!1,"fill-color":["interpolate",["linear"],["zoom"],6,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0.35)",200,"hsla(205, 75%, 63%, 0.35)",7e3,"hsla(205, 75%, 56%, 0.35)"],8,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0)",200,"hsla(205, 75%, 63%, 0)",7e3,"hsla(205, 75%, 53%, 0)"]]}},{id:"wetland",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:5,filter:["match",["get","class"],["wetland","wetland_noveg"],!0,!1],paint:{"fill-color":"hsl(194, 38%, 74%)","fill-opacity":["interpolate",["linear"],["zoom"],10,.25,10.5,.15]}},{id:"wetland-pattern",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:5,filter:["match",["get","class"],["wetland","wetland_noveg"],!0,!1],paint:{"fill-color":"hsl(194, 38%, 74%)","fill-opacity":["interpolate",["linear"],["zoom"],10,0,10.5,1],"fill-pattern":"wetland","fill-translate-anchor":"viewport"}},{id:"land-structure-polygon",type:"fill",source:"composite","source-layer":"structure",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, built"},minzoom:13,filter:["all",["==",["get","class"],"land"],["==",["geometry-type"],"Polygon"]],paint:{"fill-color":"hsl(0, 0%, 69%)"}},{id:"land-structure-line",type:"line",source:"composite","source-layer":"structure",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, built"},minzoom:13,filter:["all",["==",["get","class"],"land"],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"square"},paint:{"line-width":["interpolate",["exponential",1.99],["zoom"],14,.75,20,40],"line-color":"hsl(60, 20%, 85%)"}},{id:"country-boundaries",type:"fill",source:"composite","source-layer":"country_boundaries",paint:{"fill-color":["interpolate",["linear"],["zoom"],0,"rgb(171, 174, 172)",22,"rgb(171, 174, 172)"]}},{id:"admin-0-boundary-bg",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-width":["interpolate",["linear"],["zoom"],3,4,12,8],"line-color":"rgb(193, 190, 190)","line-opacity":["interpolate",["linear"],["zoom"],3,0,4,.5],"line-blur":["interpolate",["linear"],["zoom"],3,0,12,2]}},{id:"admin-0-boundary",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","disputed"],"false"],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(114, 110, 111)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[2,0]],7,["literal",[2,2,6,2]]]}},{id:"admin-0-boundary-disputed",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","disputed"],"true"],["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(95, 93, 94)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[3,2,5]],7,["literal",[2,1.5]]]}},{id:"waterway-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:13,filter:["all",["match",["get","class"],["canal","river","stream","disputed_canal","disputed_river","disputed_stream"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"text-max-angle":30,"symbol-spacing":["interpolate",["linear",1],["zoom"],15,250,17,400],"text-size":["interpolate",["linear"],["zoom"],13,12,18,18],"symbol-placement":"line","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"text-color":"hsl(205, 43%, 90%)","text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"natural-line-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:4,filter:["all",["match",["get","class"],["glacier","landform","disputed_glacier","disputed_landform"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],4],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-max-angle":30,"text-field":["coalesce",["get","name_en"],["get","name"]],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport",visibility:"none"},paint:{"text-halo-width":.5,"text-halo-color":"hsl(60, 17%, 84%)","text-halo-blur":.5,"text-color":"hsl(340, 10%, 38%)"}},{id:"natural-point-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:4,filter:["all",["match",["get","class"],["dock","glacier","landform","water_feature","wetland","disputed_dock","disputed_glacier","disputed_landform","disputed_water_feature","disputed_wetland"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],4],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"Point"]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"icon-image":["case",["has","maki_beta"],["coalesce",["image",["get","maki_beta"]],["image",["get","maki"]]],["image",["get","maki"]]],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-offset":["step",["zoom"],["step",["get","sizerank"],["literal",[0,0]],5,["literal",[0,.8]]],17,["step",["get","sizerank"],["literal",[0,0]],13,["literal",[0,.8]]]],"text-anchor":["step",["zoom"],["step",["get","sizerank"],"center",5,"top"],17,["step",["get","sizerank"],"center",13,"top"]],"text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"icon-opacity":["step",["zoom"],["step",["get","sizerank"],0,5,1],17,["step",["get","sizerank"],0,13,1]],"text-halo-color":"hsl(60, 20%, 98%)","text-halo-width":.5,"text-halo-blur":.5,"text-color":"hsl(340, 10%, 38%)"}},{id:"water-line-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:1,filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water","disputed_bay","disputed_ocean","disputed_reservoir","disputed_sea","disputed_water"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-size":["interpolate",["linear"],["zoom"],0,["*",["-",16,["sqrt",["get","sizerank"]]],1],22,["*",["-",22,["sqrt",["get","sizerank"]]],1]],"text-max-angle":30,"text-letter-spacing":["match",["get","class"],"ocean",.25,["sea","bay"],.15,0],"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"text-color":["match",["get","class"],["bay","ocean","sea"],"hsl(205, 71%, 90%)","hsl(205, 43%, 90%)"],"text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"water-point-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:1,filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water","disputed_bay","disputed_ocean","disputed_reservoir","disputed_sea","disputed_water"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"Point"]],layout:{"text-line-height":1.3,"text-size":["interpolate",["linear"],["zoom"],0,["*",["-",16,["sqrt",["get","sizerank"]]],1],22,["*",["-",22,["sqrt",["get","sizerank"]]],1]],"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":["match",["get","class"],"ocean",.25,["bay","sea"],.15,.01],"text-max-width":["match",["get","class"],"ocean",4,"sea",5,["bay","water"],7,10],visibility:"none"},paint:{"text-color":["match",["get","class"],["bay","ocean","sea"],"hsl(205, 71%, 90%)","hsl(205, 43%, 90%)"],"text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"settlement-subdivision-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:10,maxzoom:15,filter:["all",["match",["get","class"],["settlement_subdivision","disputed_settlement_subdivision"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],3],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-transform":"uppercase","text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-letter-spacing":["match",["get","type"],"suburb",.15,.05],"text-max-width":7,"text-padding":3,"text-size":["interpolate",["cubic-bezier",.5,0,1,1],["zoom"],11,["match",["get","type"],"suburb",11,10.5],15,["match",["get","type"],"suburb",15,14]],visibility:"none"},paint:{"text-halo-color":"hsla(60, 25%, 100%, 0.75)","text-halo-width":1,"text-color":"hsl(230, 29%, 36%)","text-halo-blur":.5}},{id:"settlement-minor-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:2,maxzoom:13,filter:["all",["<=",["get","filterrank"],3],["match",["get","class"],["settlement","disputed_settlement"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["zoom"],[">",["get","symbolrank"],6],4,[">=",["get","symbolrank"],7],6,[">=",["get","symbolrank"],8],7,[">=",["get","symbolrank"],10],10,[">=",["get","symbolrank"],11],11,[">=",["get","symbolrank"],13],12,[">=",["get","symbolrank"],15]],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],11,9,10],6,["step",["get","symbolrank"],14,9,12,12,10],8,["step",["get","symbolrank"],16,9,14,12,12,15,10],13,["step",["get","symbolrank"],22,9,20,12,16,15,14]],"text-radial-offset":["step",["zoom"],["match",["get","capital"],2,.6,.55],8,0],"symbol-sort-key":["get","symbolrank"],"icon-image":["step",["zoom"],["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],8,""],"text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-justify":"auto",visibility:"none","text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-max-width":7},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-halo-blur":1}},{id:"settlement-major-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:2,maxzoom:15,filter:["all",["<=",["get","filterrank"],3],["match",["get","class"],["settlement","disputed_settlement"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["zoom"],!1,2,["<=",["get","symbolrank"],6],4,["<",["get","symbolrank"],7],6,["<",["get","symbolrank"],8],7,["<",["get","symbolrank"],10],10,["<",["get","symbolrank"],11],11,["<",["get","symbolrank"],13],12,["<",["get","symbolrank"],15],13,[">=",["get","symbolrank"],11],14,[">=",["get","symbolrank"],15]],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],13,6,11],6,["step",["get","symbolrank"],18,6,16,7,14],8,["step",["get","symbolrank"],20,9,16,10,14],15,["step",["get","symbolrank"],24,9,20,12,16,15,14]],"text-radial-offset":["step",["zoom"],["match",["get","capital"],2,.6,.55],8,0],"symbol-sort-key":["get","symbolrank"],"icon-image":["step",["zoom"],["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],8,""],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],visibility:"none","text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-max-width":7},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-halo-blur":1}},{id:"state-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:3,maxzoom:9,filter:["all",["match",["get","class"],["state","disputed_state"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-size":["interpolate",["cubic-bezier",.85,.7,.65,1],["zoom"],4,["step",["get","symbolrank"],9,6,8,7,7],9,["step",["get","symbolrank"],21,6,16,7,14]],"text-transform":"uppercase","text-font":["DIN Pro Bold","Arial Unicode MS Bold"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":.15,"text-max-width":6,visibility:"none"},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-opacity":.5}},{id:"country-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:1,maxzoom:10,filter:["all",["match",["get","class"],["country","disputed_country"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-radial-offset":["step",["zoom"],.6,8,0],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],7,"auto"],"text-size":["interpolate",["cubic-bezier",.2,0,.7,1],["zoom"],1,["step",["get","symbolrank"],11,4,9,5,8],9,["step",["get","symbolrank"],22,4,19,5,17]]},paint:{"icon-opacity":["step",["zoom"],["case",["has","text_anchor"],1,0],7,0],"text-color":"hsl(230, 29%, 0%)","text-halo-color":["interpolate",["linear"],["zoom"],2,"hsla(60, 25%, 100%, 0.75)",3,"hsl(60, 25%, 100%)"],"text-halo-width":1.25}},{id:"continent-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:.75,maxzoom:3,filter:["==",["get","class"],"continent"],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-size":["interpolate",["exponential",.5],["zoom"],0,10,2.5,15],"text-transform":"uppercase","text-letter-spacing":.05,visibility:"none"},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":["interpolate",["linear"],["zoom"],0,"hsla(60, 25%, 100%, 0.75)",3,"hsl(60, 25%, 100%)"],"text-halo-width":1.5,"text-opacity":["interpolate",["linear"],["zoom"],0,.8,1.5,.5,2.5,0]}}]}}}const yi="",ut={name:"IdmWindParticle",props:{factor:{type:Object},viewport:{type:oe},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new H,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleOptions:{fadeOpacity:.9,speedFactor:.25,dropRate:.003,dropRateBump:.01,uvRange:[-25,26],sRange:[0,31.985]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{handler(){var r;(r=this.factor)!=null&&r.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var r;this.right=(((r=document.getElementsByClassName("right-bar")[0])==null?void 0:r.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const r=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(r+e),console.log("[wind-particle] add elapsed: ",a,", total: ",e+=a)}},handleClear(){var r,e,a,o,i,s,n,l;(r=this.viewport)==null||r.toggle(!1),(e=this.viewport)==null||e.toggleParticle(!1),this.context=void 0,this.particleContext=void 0,this.etime=void 0,this.initial=!0,(o=(a=this.viewport)==null?void 0:a.map)==null||o.off("resize",this.handleResize),(s=(i=this.viewport)==null?void 0:i.map)==null||s.off("movestart",this.handlePause),(l=(n=this.viewport)==null?void 0:n.map)==null||l.off("moveend",this.handlePlay),this.handlePause()},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const r=[[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,r);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,B.vertexSchema,B.uvFragmentSchema);this.program=e,this.aPositionBuffer=a}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const r=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,R.vertexSchema,R.fragmentSchema,R.quadVertSchema,R.screenFragmentSchema,R.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,r,!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 r=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,r),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,r),this.wrapper.image=r}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()})}}},gt={key:0};function bt(r,e,a,o,i,s){var n;return(n=a.factor)!=null&&n.active?(t.openBlock(),t.createElementBlock("div",gt,[t.createElementVNode("div",{class:"legend-bars flex-center",style:t.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:a.bottom}])},e[0]||(e[0]=[t.createElementVNode("span",null,"kts",-1),t.createElementVNode("span",null,"0",-1),t.createElementVNode("span",null,"5",-1),t.createElementVNode("span",null,"10",-1),t.createElementVNode("span",null,"20",-1),t.createElementVNode("span",null,"30",-1),t.createElementVNode("span",null,"40",-1),t.createElementVNode("span",null,"60",-1)]),4)])):t.createCommentVNode("",!0)}const Lt=E(ut,[["render",bt],["__scopeId","data-v-24e5434b"]]),fi="",wt={name:"IdmCurrent",props:{map:{type:Object},current:{type:Object},beforeLayer:{type:String},mapProjection:{type:String},showCurrentParticle:{type:Boolean,default:!1},showCurrentIsoband:{type:Boolean,default:!1},marginBottom:{type:String,default:"30px"},toggleVersion:{type:Number}},emits:["particle","handleToggleVersion"],data(){return{source:"current-source",directionLayer:"current-direction-layer",speedLayer:"current-speed-layer",speedLabelLayer:"current-speed-label-layer",empty:v.featureCollection([]),right:10,bottom:95}},watch:{"current.version":{handler(){var r;(r=this.current)!=null&&r.active?this.handleRender():this.handleClear(),this.$emit("handleToggleVersion")},deep:!0},showCurrentParticle:{handler(){this.handleParticle()}},showCurrentIsoband:{handler(){this.handleToggle()}}},methods:{handleParticle(){this.$emit("particle",{particle:this.showCurrentParticle,key:"current",weight:96})},handleRender(){var r,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.current){const a=new Date().valueOf();let o=0,i=0,s=this.empty;this.current.active&&(s=this.current.data),(r=this.map)!=null&&r.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),i=new Date().valueOf()-(a+o),console.log("[current] update elapsed: ",i,", total: ",o+=i)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.speedLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":["step",["get","val"],"#e1ffb3",1,"#ffff00",3,"#ff9500",4,"#f44336",5,"#f44336"]}},this.beforeLayer),this.map.addLayer({id:this.speedLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Polygon"],layout:{"symbol-placement":"line","text-field":"{val} kts","text-allow-overlap":!0,"text-rotation-alignment":"viewport","text-size":12},paint:{"text-color":"rgba(0, 0, 0, 0.8)"}},this.beforeLayer),this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"arrow-red","icon-size":["interpolate",["linear"],["get","spd"],.5,.14,3,.28],"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":.6}},this.beforeLayer),i=new Date().valueOf()-(a+o),console.log("[current] add elapsed: ",i,", total: ",o+=i)),this.handleToggle()}},handleToggle(){this.map.getLayer(this.speedLayer)&&this.map.setLayoutProperty(this.speedLayer,"visibility",this.showCurrentIsoband?"visible":"none"),this.map.getLayer(this.speedLabelLayer)&&this.map.setLayoutProperty(this.speedLabelLayer,"visibility",this.showCurrentIsoband?"visible":"none"),this.map.getLayer(this.directionLayer)&&this.map.setLayoutProperty(this.directionLayer,"visibility",this.showCurrentIsoband?"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)}}},xt={key:0};function _t(r,e,a,o,i,s){var n;return(n=a.current)!=null&&n.active?(t.openBlock(),t.createElementBlock("div",xt)):t.createCommentVNode("",!0)}const vt=E(wt,[["render",_t]]),ui="",Ct={name:"IdmCurrentParticle",props:{factor:{type:Object},viewport:{type:oe},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new H,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleOptions:{fadeOpacity:.96,speedFactor:4,dropRate:.005,dropRateBump:.01,uvRange:[-2.5,2.6],sRange:[0,3]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{handler(){var r;(r=this.factor)!=null&&r.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var r;this.right=(((r=document.getElementsByClassName("right-bar")[0])==null?void 0:r.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const r=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(r+e),console.log("[current-particle] add elapsed: ",a,", total: ",e+=a)}},handleClear(){var r,e,a,o,i,s,n,l;(r=this.viewport)==null||r.toggle(!1),(e=this.viewport)==null||e.toggleParticle(!1),this.context=void 0,this.particleContext=void 0,this.etime=void 0,this.initial=!0,(o=(a=this.viewport)==null?void 0:a.map)==null||o.off("resize",this.handleResize),(s=(i=this.viewport)==null?void 0:i.map)==null||s.off("movestart",this.handlePause),(l=(n=this.viewport)==null?void 0:n.map)==null||l.off("moveend",this.handlePlay),this.handlePause()},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const r=[[0/255,"rgba(95, 143, 197,1)"],[5/255,"rgba(64,127,115,1)"],[10/255,"rgb(58,164,58)"],[15/255,"rgb(191,182,67)"],[20/255,"rgb(197,154,68)"],[30/255,"rgb(160,70,94)"],[40/255,"rgb(138,84,166)"],[45/255,"rgb(82,113,165)"],[50/255,"rgb(84,142,152)"],[65/255,"rgb(150,181,184)"],[80/255,"rgb(195,194,194)"],[254/255,"rgb(195,194,194)"],[1,"rgb(195,194,194)"]];this.rampColor=this.webgl.setup(this.context,r);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,B.vertexSchema,B.uvFragmentSchema);this.program=e,this.aPositionBuffer=a}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const r=[[0,"rgb(183,224,224)"],[1,"rgb(199,202,202)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,R.vertexSchema,R.fragmentSchema,R.quadVertSchema,R.screenFragmentSchema,R.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,r,!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 r=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,r),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,r),this.wrapper.image=r}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()})}}},kt={key:0};function Et(r,e,a,o,i,s){var n;return(n=a.factor)!=null&&n.active?(t.openBlock(),t.createElementBlock("div",kt,[t.createElementVNode("div",{class:"legend-bars flex-center",style:t.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:a.bottom}])},e[0]||(e[0]=[t.createElementVNode("span",null,"kts",-1),t.createElementVNode("span",null,"0",-1),t.createElementVNode("span",null,"0.4",-1),t.createElementVNode("span",null,"0.8",-1),t.createElementVNode("span",null,"1.6",-1),t.createElementVNode("span",null,"2",-1),t.createElementVNode("span",null,"3.2",-1)]),4)])):t.createCommentVNode("",!0)}const St=E(Ct,[["render",Et],["__scopeId","data-v-6d4fd206"]]),Nt={name:"IdmSigWave",props:{map:{type:Object},sigWave:{type:Object},beforeLayer:{type:String},activeWeatherLayers:{type:Array}},data(){return{source:"sig-wave-source",heightLayer:"sig-wave-height-layer",heightLabelLayer:"sig-wave-height-label-layer",empty:v.featureCollection([])}},watch:{"sigWave.version":{handler(){var r;(r=this.sigWave)!=null&&r.active?(this.handleRender(),this.handleMove()):this.handleClear()},deep:!0}},methods:{handleRender(){var r,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.sigWave){const a=new Date().valueOf();let o=0,i=0,s=this.empty;this.sigWave.active&&(s=this.sigWave.data),(r=this.map)!=null&&r.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),i=new Date().valueOf()-(a+o),console.log("[sig.wave] update elapsed: ",i,", total: ",o+=i)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.heightLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],layout:{"fill-sort-key":["get","val"]},paint:{"fill-outline-color":"#888","fill-opacity":.8,"fill-color":["step",["get","val"],"rgba(186,247,199,0.4)",3,"rgba(186,247,199,0.7)",4,"rgba(101,252,149,0.9)",5,"#b3ff6b",6,"#fee600",7,"#ffa200",8,"#ff6600",9,"#e23304",10,"#f80078",11,"#dc03d2",12,"#a603f8",13,"#7102ab"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Polygon"],layout:{"symbol-placement":"line","symbol-avoid-edges":!0,"symbol-sort-key":["get","val"],"text-field":"{val} m","text-rotation-alignment":"viewport","text-size":10},paint:{"text-opacity":.7}},this.beforeLayer),i=new Date().valueOf()-(a+o),console.log("[sig.wave] add elapsed: ",i,", total: ",o+=i))}},handleMove(){var r,e;(e=(r=this.map)==null?void 0:r.getLayer("country-boundaries"))==null||e.setLayoutProperty("visibility","visible"),this.map.getLayer(this.heightLayer)&&this.map.moveLayer(this.heightLayer,"country-boundaries"),this.map.getLayer(this.heightLabelLayer)&&this.map.moveLayer(this.heightLabelLayer,"country-boundaries")},handleClear(){var r,e,a;((r=this.activeWeatherLayers)==null?void 0:r.length)===0&&((a=(e=this.map)==null?void 0:e.getLayer("country-boundaries"))==null||a.setLayoutProperty("visibility","none")),this.map.getLayer(this.heightLayer)&&this.map.removeLayer(this.heightLayer),this.map.getLayer(this.heightLabelLayer)&&this.map.removeLayer(this.heightLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Pt(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const zt=E(Nt,[["render",Pt]]),Tt={name:"IdmSwell",props:{map:{type:Object},swell:{type:Object},beforeLayer:{type:String},activeWeatherLayers:{type:Array}},data(){return{source:"swell-source",directionLayer:"swell-direction-layer",heightLayer:"swell-height-layer",heightLabelLayer:"swell-height-label-layer",empty:v.featureCollection([])}},watch:{"swell.version":{handler(){var r;(r=this.swell)!=null&&r.active?(this.handleRender(),this.handleMove()):this.handleClear()},deep:!0},activeWeatherLayers:{handler(){setTimeout(()=>{this.activeWeatherLayers.length>0?this.handleMove():this.handleClear()},500)},deep:!0,immediate:!0}},methods:{handleRender(){var r,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.swell){const a=new Date().valueOf();let o=0,i=0,s=this.empty;this.swell.active&&(s=this.swell.data),(r=this.map)!=null&&r.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),i=new Date().valueOf()-(a+o),console.log("[swell] update elapsed: ",i,", total: ",o+=i)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.heightLayer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-opacity":1,"line-width":2,"line-color":["match",["get","val"],2,"rgba(255,255,0,0.9)",3,"rgba(255,149,0,0.9)",4,"rgba(244,67,54,0.9)",5,"rgba(162,2,31,0.9)",6,"rgba(162,2,31,0.9)","rgba(162,2,31,0.9)"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","LineString"],layout:{"symbol-placement":"line","text-rotation-alignment":"viewport","text-field":"{val}M","text-size":12},paint:{"text-color":["step",["get","val"],"black",4,"white",5,"white",6,"white"],"text-halo-color":["match",["get","val"],2,"rgba(255,255,0,0.7)",3,"rgba(255,149,0,0.7)",4,"rgba(244,67,54,0.7)",5,"rgba(162,13,2,0.7)",6,"rgba(162,13,2,0.7)","rgba(162,13,2,0.7)"],"text-halo-width":4}},this.beforeLayer),this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"arrow-yellow","icon-size":{base:1,stops:[[2,.14],[6,.28]]},"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,180],[360,540]]}},paint:{"icon-opacity":.8}},this.beforeLayer),i=new Date().valueOf()-(a+o),console.log("[swell] add elapsed: ",i,", total: ",o+=i))}},handleMove(){var r,e;(e=(r=this.map)==null?void 0:r.getLayer("country-boundaries"))==null||e.setLayoutProperty("visibility","visible"),this.map.getLayer(this.heightLayer)&&this.map.moveLayer(this.heightLayer,"country-boundaries"),this.map.getLayer(this.directionLayer)&&this.map.moveLayer(this.directionLayer,"country-boundaries"),this.map.getLayer(this.heightLabelLayer)&&this.map.moveLayer(this.heightLabelLayer,"country-boundaries")},handleClear(){var r,e;this.activeWeatherLayers.length===0&&((e=(r=this.map)==null?void 0:r.getLayer("country-boundaries"))==null||e.setLayoutProperty("visibility","none")),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 Vt(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const Dt=E(Tt,[["render",Vt]]),Bt={name:"IdmPrmsl",props:{map:{type:Object},prmsl:{type:Object},beforeLayer:{type:String},showRampColor:{type:Boolean},activeWeatherLayers:{type:Array}},data(){return{source:"prmsl-source",layer:"prmsl-layer",labelLayer:"prmsl-label-layer",pointLabelLayer:"prmsl-point-label-layer",empty:v.featureCollection([])}},watch:{"prmsl.version":{handler(){var r;(r=this.prmsl)!=null&&r.active?(this.handleRender(),this.handleMove()):this.handleClear()},deep:!0},activeWeatherLayers:{handler(){setTimeout(()=>{this.activeWeatherLayers.length>0?this.handleMove():this.handleClear()},500)},deep:!0,immediate:!0}},methods:{handleRender(){var r,e,a;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.prmsl){const o=new Date().valueOf();let i=0,s=0,n=this.empty;this.prmsl.active&&(n=this.prmsl.data),(r=this.map)!=null&&r.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(n),s=new Date().valueOf()-(o+i),console.log("[prmsl] update elapsed: ",s,", total: ",i+=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"],"rgba(162,13,2,1)",920,"rgba(244,67,54,1)",980,"rgba(255,255,0,1)",1100,"rgba(199,171,250,1)"],"line-width":1,"line-opacity":1}},this.beforeLayer),(a=this.map)==null||a.addLayer({id:this.labelLayer,type:"symbol",source:this.source,minzoom:4,filter:["==","$type","LineString"],layout:{"symbol-placement":"line","text-rotation-alignment":"viewport","text-field":"{val}","text-size":12},paint:{"text-color":"black","text-opacity":.9,"text-halo-color":"rgba(255,255,255,1)","text-halo-width":1}},this.beforeLayer),setTimeout(()=>{this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":["format",["get","type"],{"font-scale":1.03},`
190
- `,["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":12},paint:{"text-opacity":1,"text-color":["step",["get","val"],"white",980,"black",1100,"black"],"text-halo-color":["step",["get","val"],"rgba(162,13,2,0.9)",920,"rgba(244,67,54,0.9)",980,"rgba(255,255,0,0.9)",1100,"rgba(199,171,250,0.9)"],"text-halo-width":4}},this.beforeLayer)},0),s=new Date().valueOf()-(o+i),console.log("[prmsl] add elapsed: ",s,", total: ",i+=s))}},handleMove(){var r,e;(e=(r=this.map)==null?void 0:r.getLayer("country-boundaries"))==null||e.setLayoutProperty("visibility","visible"),this.map.getLayer(this.pointLabelLayer)&&this.map.moveLayer(this.pointLabelLayer,"country-boundaries"),this.map.getLayer(this.labelLayer)&&this.map.moveLayer(this.labelLayer,"country-boundaries"),this.map.getLayer(this.layer)&&this.map.moveLayer(this.layer,"country-boundaries")},handleClear(){var r,e;this.activeWeatherLayers.length===0&&((e=(r=this.map)==null?void 0:r.getLayer("country-boundaries"))==null||e.setLayoutProperty("visibility","none")),this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.labelLayer)&&this.map.removeLayer(this.labelLayer),this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function It(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const Rt=E(Bt,[["render",It]]),Wt={name:"IdmIceberg",props:{map:{type:Object},iceberg:{type:Object},beforeLayer:{type:String}},data(){return{source:"iceberg-source",layer:"iceberg-layer",empty:v.featureCollection([])}},watch:{"iceberg.version":{handler(){var r;(r=this.iceberg)!=null&&r.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var r,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.iceberg){const a=new Date().valueOf();let o=0,i=0,s=this.empty;this.iceberg.active&&(s=this.iceberg.data),(r=this.map)!=null&&r.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),i=new Date().valueOf()-(a+o),console.log("[iceberg] update elapsed: ",i,", total: ",o+=i)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-color":"rgba(255,255,255, 0.8)","line-width":2,"line-opacity":1}}),i=new Date().valueOf()-(a+o),console.log("[iceberg] add elapsed: ",i,", total: ",o+=i))}},handleClear(){this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function At(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const Mt=E(Wt,[["render",At]]),gi="",Ot={name:"IdmTropicals",props:{map:{type:Object},tropicals:{type:Object},date:{type:String},timeZone:{type:Number,default:0}},emits:["tropical","tropicalProbability"],data(){return{helper:V.CompanyHelper,source:"tropicals-source",clusterSource:"tropicals-cluster-source",historyLayer:"tropicals-history-layer",forecastLayer:"tropicals-forecast-layer",forecastModelLayer:"tropicals-forecast-model-layer",forecastNameLayer:"tropicals-forecast-name-layer",pointCircleLayer:"tropicals-point-circle-layer",pointLabelLayer:"tropicals-point-label-layer",historyPointCircleLayer:"history-tropicals-point-circle-layer",historyPointLabelLayer:"history-tropicals-point-label-layer",interpolateData:[],interpolateMarkers:[],interpolateSource:"tropicals-interpolate-source",interpolateLineLayer:"tropicals-interpolate-line-layer",showTropicals:!1,activeTropicals:void 0,activeTropicalsMarker:void 0,empty:v.featureCollection([]),circleSource:"circle-source",circleSourceData:v.featureCollection([]),circleLayer:"tropical-circle-layer"}},computed:{computeTime(){return function(r){if(r){const e=D(r).utc().utcOffset(this.timeZone),a=this.timeZone<0?this.timeZone:"+"+this.timeZone;return`${e.format("MMM-DD,HHmm")}[ UTC ${a} ] ( ${e==null?void 0:e.fromNow()} )`}return"-"}},computeTimezone(){return this.timeZone<0?this.timeZone:"+"+this.timeZone}},watch:{"tropicals.active":{handler(){this.handleInit()},immediate:!0},showTropicals:{handler(){this.$emit("tropical",this.showTropicals)},immediate:!0},"tropicals.version":{handler(){this.handleRefresh()}},timeZone:{handler(){this.handleRefresh()}}},methods:{handleRefresh(){var o,i;const r=((i=(o=this.tropicals)==null?void 0:o.data)==null?void 0:i.features)||[],e=D().utc().hour(),a=[];r.forEach(s=>{var n,l,h;(n=s.properties)!=null&&n.name&&!a.includes((l=s.properties)==null?void 0:l.name)&&a.push((h=s.properties)==null?void 0:h.name)}),a.forEach(s=>{var p;let n=0,l;const h=r.filter(c=>{var d,u;return((u=(d=c.properties)==null?void 0:d.category)==null?void 0:u.split("-")[0])===s});(p=h.filter(c=>{var d,u;return((d=c.geometry)==null?void 0:d.type)==="LineString"&&((u=c.properties)==null?void 0:u.type)==="forecast"})[0])==null||p.properties.model,h.forEach((c,d)=>{var u,m,b,f,y,L;((u=c.geometry)==null?void 0:u.type)==="Point"&&((m=c.properties)==null?void 0:m.type)==="history"&&(n=d,l=l===void 0?d:l),((b=c.geometry)==null?void 0:b.type)==="Point"&&((f=c.properties)==null?void 0:f.type)==="forecast"&&l===void 0&&(l=d),((y=c.geometry)==null?void 0:y.type)==="LineString"&&((L=c.properties)==null||L.type)}),h.map((c,d)=>{var u,m,b,f,y,L,g;if(((u=c.geometry)==null?void 0:u.type)==="LineString"&&((m=c.properties)==null||m.type),((b=c.geometry)==null?void 0:b.type)==="Point"&&((f=c.properties)==null?void 0:f.type)==="forecast"&&(c.properties.name=s,c.properties.format=D(c.properties.date).utcOffset(this.timeZone).format(`MMM-DD,HHmm [(utc ${this.computeTimezone})]`)),((y=c.geometry)==null?void 0:y.type)==="Point"&&((L=c.properties)==null?void 0:L.type)==="history"){c.properties.format=D(c.properties.date).utcOffset(this.timeZone).format(`MMM-DD,HHmm [(utc ${this.computeTimezone})]`);const x=D((g=c.properties)==null?void 0:g.date).utc().format("HHmm")===D().utc().hour(Math.floor(e/6)*6).minute("00").format("HHmm");c.properties.showHistoryLabel=x||d===n,c.properties.showNameLabel=d===n,c.properties.name=s}return c})}),this.handleInit()},handleInit(){var r,e;this.tropicals&&this.tropicals.active?(this.handleRender(),(r=this.map)==null||r.on("click",[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.forecastModelLayer,this.pointCircleLayer,this.pointLabelLayer,this.historyPointCircleLayer,this.historyPointLabelLayer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.forecastModelLayer,this.pointCircleLayer,this.pointLabelLayer,this.historyPointCircleLayer,this.historyPointLabelLayer],this.handleClick))},handleRender(){var r,e,a,o,i,s,n,l,h,p;if(!this.map)setTimeout(()=>{this.handleRender()},500);else{if(this.tropicals){const d=new Date().valueOf();let u=0,m=0;(r=this.map)!=null&&r.getSource(this.source)?((a=this.map)==null||a.getSource(this.source).setData((e=this.tropicals)!=null&&e.active?this.tropicals.data:this.empty),m=new Date().valueOf()-(d+u),console.log("[tropicals] update elapsed: ",m,", total: ",u+=m)):(this.map.addSource(this.source,{type:"geojson",data:(o=this.tropicals)!=null&&o.active?(i=this.tropicals)==null?void 0:i.data:this.empty}),this.map.addLayer({id:this.historyLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["==","type","history"],["!=","disabled",!0]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#000","line-width":4,"line-opacity":.5}}),this.map.addLayer({id:this.forecastLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"],["!=","disabled",!0]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["match",["get","model"],"cma","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#fff"],"line-width":3,"line-opacity":.9,"line-dasharray":[1,2]}}),this.map.addLayer({id:this.forecastModelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"],["!=","disabled",!0]],layout:{"symbol-placement":"line","text-field":"{model}","text-rotation-alignment":"viewport","text-size":13},paint:{"text-color":["match",["get","model"],"cma","#000","jma","#000","ecmwf","#fff","ukm","#fff","noaa-at","#fff","noaa-ep","#fff","#000"],"text-opacity":1,"text-halo-color":["match",["get","model"],"cma","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#fff"],"text-halo-width":4}}),m=new Date().valueOf()-(d+u),console.log("[tropical] add elapsed: ",m,", total: ",u+=m)),(s=this.map)!=null&&s.getSource(this.clusterSource)?((l=this.map)==null||l.getSource(this.clusterSource).setData((n=this.tropicals)!=null&&n.active?this.tropicals.data:this.empty),m=new Date().valueOf()-(d+u),console.log("[tropical] update elapsed: ",m,", total: ",u+=m)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(h=this.tropicals)!=null&&h.active?(p=this.tropicals)==null?void 0:p.data:this.empty}),this.map.addLayer({id:this.pointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":6,"circle-color":"#fff"}}),this.map.addLayer({id:this.pointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":4,"circle-color":["case",["boolean",["==",["get","spd",["get","wind"]],null]],"#03f869",["boolean",["<",["get","spd",["get","wind"]],17.2]],"#03f869",["boolean",["<=",["get","spd",["get","wind"]],24.5]],"#f2f202",["boolean",["<=",["get","spd",["get","wind"]],32.7]],"#ff9100",["boolean",["<=",["get","spd",["get","wind"]],41.5]],"#f44336",["boolean",["<",["get","spd",["get","wind"]],51]],"#f903d0",["boolean",[">=",["get","spd",["get","wind"]],51]],"#8702f9","#fff"]}}),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[0,-.5],"text-anchor":"bottom-left","text-size":12},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"#fff","text-halo-width":1}}),this.map.addLayer({id:this.historyPointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":7,"circle-color":"#fff"}}),this.map.addLayer({id:this.historyPointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":5,"circle-color":"rgba(0,0,0,0.7)"}}),this.map.addLayer({id:this.historyPointCircleLayer+"-inner",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":3,"circle-color":"#fff"}}),this.map.addLayer({id:this.historyPointLabelLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[0,-.5],"text-anchor":"bottom-left","text-size":14},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"#fff","text-halo-width":1}}),this.map.addLayer({id:this.forecastNameLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showNameLabel",!0]],layout:{"text-field":["get","name"],"text-offset":[0,1.5],"text-anchor":"bottom","text-size":16,"text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#fff","text-halo-color":"#0033ff","text-halo-width":4}}),m=new Date().valueOf()-(d+u),console.log("[tropical] add elapsed: ",m,", total: ",u+=m))}this.handleDrawCircle();const c=k.TropicalHelper.interpolate(this.tropicals,1);this.interpolateData=JSON.parse(JSON.stringify(c)),this.interpolateData.filter(d=>d.properties.name==="kristy"&&d.properties.model==="ecmwf"),this.handleDateChange()}},handleClear(){var r;this.map&&(this.map.getLayer(this.historyLayer)&&this.map.removeLayer(this.historyLayer),this.map.getLayer(this.forecastLayer)&&this.map.removeLayer(this.forecastLayer),this.map.getLayer(this.forecastModelLayer)&&this.map.removeLayer(this.forecastModelLayer),this.map.getLayer(this.forecastNameLayer)&&this.map.removeLayer(this.forecastNameLayer),this.map.getLayer(this.pointCircleLayer)&&this.map.removeLayer(this.pointCircleLayer),this.map.getLayer(this.pointCircleLayer+"-border")&&this.map.removeLayer(this.pointCircleLayer+"-border"),this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.historyPointCircleLayer)&&this.map.removeLayer(this.historyPointCircleLayer),this.map.getLayer(this.historyPointCircleLayer+"-border")&&this.map.removeLayer(this.historyPointCircleLayer+"-border"),this.map.getLayer(this.historyPointCircleLayer+"-inner")&&this.map.removeLayer(this.historyPointCircleLayer+"-inner"),this.map.getLayer(this.historyPointLabelLayer)&&this.map.removeLayer(this.historyPointLabelLayer),this.map.getLayer(this.interpolateLineLayer)&&this.map.removeLayer(this.interpolateLineLayer),(r=this.interpolateMarkers)==null||r.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 r,e,a,o,i,s,n,l,h,p,c,d,u,m,b,f,y,L,g,x,C,w,_,N,I,W,A,F,G,J,X,q,Y,U,Q,z;if((r=this.interpolateMarkers)==null||r.forEach(Z=>Z==null?void 0:Z.remove()),this.circleSourceData.features=[],(e=this.interpolateData)!=null&&e.length&&this.tropicals.active){const Z=D(this.date).utc().set({minute:0,second:0,millisecond:0}),K=this.interpolateData.filter(P=>P.properties.date===Z.format()&&!P.properties.disabled),se=this.handleComputePolygons(K),ee=v.featureCollection([...K]);se.forEach(P=>{ee.features.push(P)}),(a=this.map)!=null&&a.getSource(this.interpolateSource)?(o=this.map)==null||o.getSource(this.interpolateSource).setData(ee):((i=this.map)==null||i.addSource(this.interpolateSource,{type:"geojson",data:ee}),(s=this.map)==null||s.addLayer({id:this.interpolateLineLayer,type:"line",source:this.interpolateSource,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-opacity":1,"line-color":["match",["get","level"],7,"#ff9100",10,"#f44336","#ffffff"],"line-width":1}})),this.interpolateMarkers=[];for(const P of K)if(!P.properties.disabled){let O="#f44336";((l=(n=P.properties)==null?void 0:n.wind)==null?void 0:l.spd)<17.2||!((p=(h=P.properties)==null?void 0:h.wind)!=null&&p.spd)?O="#03f869":((d=(c=P.properties)==null?void 0:c.wind)==null?void 0:d.spd)>=17.2&&((m=(u=P.properties)==null?void 0:u.wind)==null?void 0:m.spd)<24.5?O="#f2f202":((f=(b=P.properties)==null?void 0:b.wind)==null?void 0:f.spd)>=24.5&&((L=(y=P.properties)==null?void 0:y.wind)==null?void 0:L.spd)<32.7?O="#ff9100":((x=(g=P.properties)==null?void 0:g.wind)==null?void 0:x.spd)>=32.7&&((w=(C=P.properties)==null?void 0:C.wind)==null?void 0:w.spd)<41.5?O="#f44336":((N=(_=P.properties)==null?void 0:_.wind)==null?void 0:N.spd)>=41.5&&((W=(I=P.properties)==null?void 0:I.wind)==null?void 0:W.spd)<51?O="#f903d0":((F=(A=P.properties)==null?void 0:A.wind)==null?void 0:F.spd)>=51?O="#8702f9":O="#f44336";const ne=`<svg t="1719918955501"
189
+ }`);class pe{constructor(e="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNseTVudHJzYzAwNWUwbHBsZHkyaDRqczMiLCJyb2xlIjoxLCJuYW1lIjoiZmFrZUBvcm13eC5jb20iLCJwbGF0SWQiOiJnZDBtdDFkIiwiY29tcGFueSI6eyJpZCI6bnVsbCwiY2hpbGRyZW4iOltdfSwiaWF0IjoxNzIzMDI0MDI0LCJleHAiOjM5MzA1NDQwMjR9.RrKcdcMnq-FxBLJQ-i6lx2FscDE46y8EvHIemPW4HTg"){T(this,"token");T(this,"mapboxCustomer");T(this,"i4");T(this,"hi");T(this,"td");T(this,"windy");this.token=e,this.mapboxCustomer={source:this.initialOnlineStyle().sources.composite,layers:{water:{id:"water",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},paint:{"fill-color":"hsl(205, 75%, 70%)"}},waterDeplth:{id:"water-depth",type:"fill",source:"composite","source-layer":"depth",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},maxzoom:8,paint:{"fill-antialias":!1,"fill-color":["interpolate",["linear"],["zoom"],6,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0.35)",200,"hsla(205, 75%, 63%, 0.35)",7e3,"hsla(205, 75%, 56%, 0.35)"],8,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0)",200,"hsla(205, 75%, 63%, 0)",7e3,"hsla(205, 75%, 53%, 0)"]]}},countryBoundary:{id:"country-boundaries",type:"fill",source:"composite","source-layer":"country_boundaries",layout:{visibility:"visible"},paint:{"fill-color":"#d9d8d8"}},countryAdmin0BoundaryBg:{id:"admin-0-boundary-bg",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-width":["interpolate",["linear"],["zoom"],3,4,12,8],"line-color":"rgb(193, 190, 190)","line-opacity":["interpolate",["linear"],["zoom"],3,0,4,.5],"line-blur":["interpolate",["linear"],["zoom"],3,0,12,2]}},countryAdmin0Boundary:{id:"admin-0-boundary",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","disputed"],"false"],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(114, 110, 111)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[2,0]],7,["literal",[2,2,6,2]]]}},countryAdmin0BoundaryDisputed:{id:"admin-0-boundary-disputed",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","disputed"],"true"],["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(95, 93, 94)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[3,2,5]],7,["literal",[2,1.5]]]}},countryLabel:{id:"country-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},layout:{visibility:"visible","text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["HelveticaNeueThin"],"text-radial-offset":["step",["zoom"],.6,8,0],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],7,"auto"],"text-size":["interpolate",["cubic-bezier",.2,0,.7,1],["zoom"],1,["step",["get","symbolrank"],11,4,9,5,8],9,["step",["get","symbolrank"],22,4,19,5,17]]},paint:{"text-color":"rgba(255,255,255,0)"}}}},this.td={source:{type:"raster",tiles:["https://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t1.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t2.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t3.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t4.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t5.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t6.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t7.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8"],tileSize:256},layer:{id:"td",type:"raster",source:"td",layout:{visibility:"visible"}}},this.i4={source:{type:"raster",tiles:["https://osshz.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz1.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz2.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz3.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz4.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz5.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz6.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz7.idmwx.com/nautical/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"i4",type:"raster",source:"i4",layout:{visibility:"none"}}},this.hi={source:{type:"raster",tiles:[`https://assist0.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist1.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist2.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist3.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist4.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist5.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist6.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist7.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`],tileSize:256},layer:{id:"hi",type:"raster",source:"hi",layout:{visibility:"none"}}},this.windy={darkmap:{source:{type:"raster",tiles:["https://tiles.windy.com/tiles/v10.0/darkmap/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"darkmap",type:"raster",source:"darkmap",layout:{visibility:"none"}}},grayland:{source:{type:"raster",tiles:["https://tiles.windy.com/tiles/v9.0/grayland/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"grayland",type:"raster",source:"grayland",layout:{visibility:"none"},paint:{"raster-opacity":1}}}}}initialOnlineStyle(){return{version:8,name:"map-weather-v2.0.0",metadata:{"mapbox:print":{width:8.5,height:11,units:"in",format:"png",resolution:300},"mapbox:type":"default","mapbox:trackposition":!0,"mapbox:autocomposite":!0,"mapbox:sdk-support":{android:"11.0.0",ios:"11.0.0",js:"3.0.0"},"mapbox:origin":"outdoors-v12","mapbox:groups":{"Terrain, terrain-labels":{name:"Terrain, terrain-labels",collapsed:!0},"Administrative boundaries, admin":{name:"Administrative boundaries, admin",collapsed:!1},"Land & water, built":{name:"Land & water, built",collapsed:!1},"Terrain, surface":{name:"Terrain, surface",collapsed:!0},"Land & water, land":{name:"Land & water, land",collapsed:!1},"Natural features, natural-labels":{name:"Natural features, natural-labels",collapsed:!0},"Walking, cycling, etc., barriers-bridges":{name:"Walking, cycling, etc., barriers-bridges",collapsed:!0},"Place labels, place-labels":{name:"Place labels, place-labels",collapsed:!1},"Transit, ferries":{name:"Transit, ferries",collapsed:!0},"Transit, elevated":{name:"Transit, elevated",collapsed:!0},"Walking, cycling, etc., tunnels":{name:"Walking, cycling, etc., tunnels",collapsed:!0},"Terrain, land":{name:"Terrain, land",collapsed:!0},"Road network, tunnels-case":{name:"Road network, tunnels-case",collapsed:!0},"Walking, cycling, etc., walking-cycling-labels":{name:"Walking, cycling, etc., walking-cycling-labels",collapsed:!0},"Walking, cycling, etc., surface":{name:"Walking, cycling, etc., surface",collapsed:!0},"Road network, surface-icons":{name:"Road network, surface-icons",collapsed:!0},"Land & water, water":{name:"Land & water, water",collapsed:!1}}},lights:[],fog:{color:"#ffffff",range:[.5,10],"high-color":"#245cdf","space-color":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"horizon-blend":["interpolate",["linear"],["zoom"],4,.2,7,.1],"star-intensity":["interpolate",["linear"],["zoom"],5,.35,6,0],"vertical-range":[0,0]},center:[80.02170408691855,17.83215724225399],zoom:2.4589703839156347,bearing:0,pitch:1,sprite:"mapbox://sprites/neatchenheng/clxwst0tq00wd01rn0usb2eer/3hcvufdre7i2yn9nbkvi9f9xi",glyphs:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",projection:{name:"equirectangular"},sources:{composite:{type:"vector",url:"mapbox://mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1",data:{attribution:'<a href="https://www.mapbox.com/about/maps/" target="_blank" title="Mapbox" aria-label="Mapbox">&copy; Mapbox</a> <a href="https://www.openstreetmap.org/about/" target="_blank" title="OpenStreetMap" aria-label="OpenStreetMap">&copy; OpenStreetMap</a> <a href="https://www.mapbox.com/about/maps/" target="_blank" title="Mapbox" aria-label="Mapbox">&copy; Mapbox</a> <a href="https://www.openstreetmap.org/about/" target="_blank" title="OpenStreetMap" aria-label="OpenStreetMap">&copy; OpenStreetMap</a> <a class="mapbox-improve-map" href="https://www.mapbox.com/contribute/" target="_blank" title="Improve this map" aria-label="Improve this map">Improve this map</a>',bounds:[-180,-85.051129,180,85],center:[0,-.025564500000001544,0],description:"Global polygon tileset of country boundaries and disputed areas",format:"pbf",language_options:{ar:"Arabic",ca:"Catalan",cs:"Czech",da:"Danish",de:"German",el:"Greek",en:"English",es:"Spanish",fa:"Farsi",fi:"Finnish",fr:"French",he:"Hebrew",hu:"Hungarian",id:"Indonesian",it:"Italian",ja:"Japanese",ka:"Georgian",ko:"Korean",local:"Renderable local language",lv:"Latvian",ms:"Malay",nb:"Norwegian Bokmål",nl:"Dutch",no:"Norwegian",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sk:"Slovak",sl:"Slovenian",sr:"Serbian",sv:"Swedish",th:"Thai",tl:"Tagalog",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese","zh-Hans":"Simplified Chinese","zh-Hant":"Traditional Chinese"},mapbox_logo:!0,maskLevel:9,maxzoom:16,minzoom:0,mts:!0,name:"Mapbox Countries v1 + Mapbox Bathymetry v2 + Mapbox Terrain v2 + Mapbox Streets v8",scheme:"xyz",tilejson:"2.2.0",tiles:["https://a.tiles.mapbox.com/v4/mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1IjoibmVhdGNoZW5oZW5nIiwiYSI6ImNsdXM3cnBmODBsemgycW1vaXc1bjV6bXMifQ.w6fqHGRbhNhLvm0LnX4ZVw","https://b.tiles.mapbox.com/v4/mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1IjoibmVhdGNoZW5oZW5nIiwiYSI6ImNsdXM3cnBmODBsemgycW1vaXc1bjV6bXMifQ.w6fqHGRbhNhLvm0LnX4ZVw"],vector_layers:[{id:"landuse",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"waterway",minzoom:7,source:"mapbox.mapbox-streets-v8"},{id:"water",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"aeroway",minzoom:9,source:"mapbox.mapbox-streets-v8"},{id:"structure",minzoom:13,source:"mapbox.mapbox-streets-v8"},{id:"building",minzoom:12,source:"mapbox.mapbox-streets-v8"},{id:"landuse_overlay",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"road",minzoom:3,source:"mapbox.mapbox-streets-v8"},{id:"admin",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"place_label",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"airport_label",minzoom:8,source:"mapbox.mapbox-streets-v8"},{id:"transit_stop_label",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"natural_label",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"poi_label",minzoom:6,source:"mapbox.mapbox-streets-v8"},{id:"motorway_junction",minzoom:9,source:"mapbox.mapbox-streets-v8"},{id:"housenum_label",minzoom:16,source:"mapbox.mapbox-streets-v8"},{id:"landcover",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"hillshade",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"contour",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"depth",maxzoom:7,minzoom:0,source:"mapbox.mapbox-bathymetry-v2"},{id:"country_boundaries",maxzoom:22,minzoom:0,source:"mapbox.country-boundaries-v1"}],worldview_default:"US",worldview_options:{AR:"Argentina",CN:"China",IN:"India",JP:"Japan",MA:"Morocco",RS:"Serbia",RU:"Russia",TR:"Turkey",US:"United States"}}}},layers:[{id:"land",type:"background",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},paint:{"background-color":"rgb(171, 174, 172)"}},{id:"landcover",type:"fill",source:"composite","source-layer":"landcover",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},maxzoom:12,paint:{"fill-color":["match",["get","class"],"wood","hsl(0, 0%, 69%)","scrub","hsl(0, 0%, 69%)","crop","hsl(0, 0%, 69%)","grass","hsl(0, 0%, 69%)","snow","hsl(0, 0%, 69%)","hsl(0, 0%, 69%)"],"fill-opacity":["interpolate",["exponential",1.5],["zoom"],8,.8,12,0],"fill-antialias":!1}},{id:"national-park",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:5,filter:["==",["get","class"],"national_park"],paint:{"fill-color":"hsl(98, 38%, 68%)","fill-opacity":["interpolate",["linear"],["zoom"],5,0,6,.6,12,.2]}},{id:"national-park_tint-band",type:"line",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:9,filter:["==",["get","class"],"national_park"],paint:{"line-color":"hsl(98, 38%, 68%)","line-width":["interpolate",["exponential",1.5],["zoom"],9,1,14,8],"line-blur":["interpolate",["exponential",1.5],["zoom"],9,1,14,8]}},{id:"landuse",type:"fill",source:"composite","source-layer":"landuse",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:5,filter:["all",[">=",["to-number",["get","sizerank"]],0],["match",["get","class"],["agriculture","wood","grass","scrub","glacier","pitch","sand"],["step",["zoom"],!1,11,!0],"residential",["step",["zoom"],!0,10,!1],["park","airport"],["step",["zoom"],!1,8,["case",["==",["get","sizerank"],1],!0,!1],10,!0],["facility","industrial"],["step",["zoom"],!1,12,!0],"rock",["step",["zoom"],!1,11,!0],"cemetery",["step",["zoom"],!1,11,!0],"school",["step",["zoom"],!1,11,!0],"hospital",["step",["zoom"],!1,11,!0],"commercial_area",["step",["zoom"],!1,11,!0],!1],["<=",["-",["to-number",["get","sizerank"]],["interpolate",["exponential",1.5],["zoom"],12,0,18,14]],14]],paint:{"fill-color":["interpolate",["linear"],["zoom"],15,["match",["get","class"],"wood","hsla(103, 50%, 60%, 0.8)","scrub","hsla(98, 47%, 68%, 0.6)","agriculture","hsla(98, 50%, 74%, 0.6)","park",["match",["get","type"],["garden","playground","zoo"],"hsl(98, 38%, 68%)","hsl(98, 55%, 70%)"],"grass","hsla(98, 50%, 74%, 0.6)","airport","hsl(230, 40%, 82%)","cemetery","hsl(98, 45%, 75%)","glacier","hsl(205, 45%, 95%)","hospital","hsl(20, 45%, 82%)","pitch","hsl(88, 65%, 75%)","sand","hsl(69, 60%, 72%)","rock","hsl(60, 0%, 85%)","school","hsl(40, 45%, 78%)","commercial_area","hsl(55, 45%, 85%)","residential","hsl(60, 7%, 87%)",["facility","industrial"],"hsl(230, 20%, 85%)","hsl(60, 12%, 72%)"],16,["match",["get","class"],"wood","hsla(103, 50%, 60%, 0.8)","scrub","hsla(98, 47%, 68%, 0.6)","agriculture","hsla(98, 50%, 74%, 0.6)","park",["match",["get","type"],["garden","playground","zoo"],"hsl(98, 38%, 68%)","hsl(98, 55%, 70%)"],"grass","hsla(98, 50%, 74%, 0.6)","airport","hsl(230, 40%, 82%)","cemetery","hsl(98, 45%, 75%)","glacier","hsl(205, 45%, 95%)","hospital","hsl(20, 45%, 82%)","pitch","hsl(88, 65%, 75%)","sand","hsl(69, 60%, 72%)","rock","hsla(60, 0%, 85%, 0.5)","school","hsl(40, 45%, 78%)","commercial_area","hsla(55, 45%, 85%, 0.5)",["facility","industrial"],"hsl(230, 20%, 85%)","hsl(60, 12%, 72%)"]],"fill-opacity":["interpolate",["linear"],["zoom"],8,["match",["get","class"],"residential",.8,.2],10,["match",["get","class"],"residential",0,1]],"fill-antialias":!1}},{id:"pitch-outline",type:"line",source:"composite","source-layer":"landuse",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:15,filter:["==",["get","class"],"pitch"],paint:{"line-color":"hsl(0, 0%, 69%)"}},{id:"waterway-shadow",type:"line",source:"composite","source-layer":"waterway",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:10,layout:{"line-cap":["step",["zoom"],"butt",11,"round"],"line-join":["step",["zoom"],"miter",11,"round"]},paint:{"line-color":"hsl(224, 79%, 69%)","line-width":["interpolate",["exponential",1.3],["zoom"],9,["match",["get","class"],["canal","river"],.1,0],20,["match",["get","class"],["canal","river"],8,3]],"line-translate":["interpolate",["exponential",1.2],["zoom"],7,["literal",[0,0]],16,["literal",[-1,-1]]],"line-translate-anchor":"viewport","line-opacity":["interpolate",["linear"],["zoom"],8,0,8.5,1]}},{id:"water-shadow",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:10,paint:{"fill-color":"hsl(224, 79%, 69%)","fill-translate":["interpolate",["exponential",1.2],["zoom"],7,["literal",[0,0]],16,["literal",[-1,-1]]],"fill-translate-anchor":"viewport"}},{id:"waterway",type:"line",source:"composite","source-layer":"waterway",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:8,layout:{"line-cap":["step",["zoom"],"butt",11,"round"],"line-join":["step",["zoom"],"miter",11,"round"]},paint:{"line-color":"hsl(205, 75%, 70%)","line-width":["interpolate",["exponential",1.3],["zoom"],9,["match",["get","class"],["canal","river"],.1,0],20,["match",["get","class"],["canal","river"],8,3]],"line-opacity":["interpolate",["linear"],["zoom"],8,0,8.5,1]}},{id:"water",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},paint:{"fill-color":"hsl(205, 75%, 70%)"}},{id:"water-depth",type:"fill",source:"composite","source-layer":"depth",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},maxzoom:8,paint:{"fill-antialias":!1,"fill-color":["interpolate",["linear"],["zoom"],6,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0.35)",200,"hsla(205, 75%, 63%, 0.35)",7e3,"hsla(205, 75%, 56%, 0.35)"],8,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0)",200,"hsla(205, 75%, 63%, 0)",7e3,"hsla(205, 75%, 53%, 0)"]]}},{id:"wetland",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:5,filter:["match",["get","class"],["wetland","wetland_noveg"],!0,!1],paint:{"fill-color":"hsl(194, 38%, 74%)","fill-opacity":["interpolate",["linear"],["zoom"],10,.25,10.5,.15]}},{id:"wetland-pattern",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:5,filter:["match",["get","class"],["wetland","wetland_noveg"],!0,!1],paint:{"fill-color":"hsl(194, 38%, 74%)","fill-opacity":["interpolate",["linear"],["zoom"],10,0,10.5,1],"fill-pattern":"wetland","fill-translate-anchor":"viewport"}},{id:"land-structure-polygon",type:"fill",source:"composite","source-layer":"structure",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, built"},minzoom:13,filter:["all",["==",["get","class"],"land"],["==",["geometry-type"],"Polygon"]],paint:{"fill-color":"hsl(0, 0%, 69%)"}},{id:"land-structure-line",type:"line",source:"composite","source-layer":"structure",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, built"},minzoom:13,filter:["all",["==",["get","class"],"land"],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"square"},paint:{"line-width":["interpolate",["exponential",1.99],["zoom"],14,.75,20,40],"line-color":"hsl(60, 20%, 85%)"}},{id:"country-boundaries",type:"fill",source:"composite","source-layer":"country_boundaries",paint:{"fill-color":["interpolate",["linear"],["zoom"],0,"rgb(171, 174, 172)",22,"rgb(171, 174, 172)"]}},{id:"admin-0-boundary-bg",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-width":["interpolate",["linear"],["zoom"],3,4,12,8],"line-color":"rgb(193, 190, 190)","line-opacity":["interpolate",["linear"],["zoom"],3,0,4,.5],"line-blur":["interpolate",["linear"],["zoom"],3,0,12,2]}},{id:"admin-0-boundary",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","disputed"],"false"],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(114, 110, 111)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[2,0]],7,["literal",[2,2,6,2]]]}},{id:"admin-0-boundary-disputed",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","disputed"],"true"],["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(95, 93, 94)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[3,2,5]],7,["literal",[2,1.5]]]}},{id:"waterway-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:13,filter:["all",["match",["get","class"],["canal","river","stream","disputed_canal","disputed_river","disputed_stream"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"text-max-angle":30,"symbol-spacing":["interpolate",["linear",1],["zoom"],15,250,17,400],"text-size":["interpolate",["linear"],["zoom"],13,12,18,18],"symbol-placement":"line","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"text-color":"hsl(205, 43%, 90%)","text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"natural-line-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:4,filter:["all",["match",["get","class"],["glacier","landform","disputed_glacier","disputed_landform"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],4],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-max-angle":30,"text-field":["coalesce",["get","name_en"],["get","name"]],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport",visibility:"none"},paint:{"text-halo-width":.5,"text-halo-color":"hsl(60, 17%, 84%)","text-halo-blur":.5,"text-color":"hsl(340, 10%, 38%)"}},{id:"natural-point-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:4,filter:["all",["match",["get","class"],["dock","glacier","landform","water_feature","wetland","disputed_dock","disputed_glacier","disputed_landform","disputed_water_feature","disputed_wetland"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],4],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"Point"]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"icon-image":["case",["has","maki_beta"],["coalesce",["image",["get","maki_beta"]],["image",["get","maki"]]],["image",["get","maki"]]],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-offset":["step",["zoom"],["step",["get","sizerank"],["literal",[0,0]],5,["literal",[0,.8]]],17,["step",["get","sizerank"],["literal",[0,0]],13,["literal",[0,.8]]]],"text-anchor":["step",["zoom"],["step",["get","sizerank"],"center",5,"top"],17,["step",["get","sizerank"],"center",13,"top"]],"text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"icon-opacity":["step",["zoom"],["step",["get","sizerank"],0,5,1],17,["step",["get","sizerank"],0,13,1]],"text-halo-color":"hsl(60, 20%, 98%)","text-halo-width":.5,"text-halo-blur":.5,"text-color":"hsl(340, 10%, 38%)"}},{id:"water-line-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:1,filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water","disputed_bay","disputed_ocean","disputed_reservoir","disputed_sea","disputed_water"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-size":["interpolate",["linear"],["zoom"],0,["*",["-",16,["sqrt",["get","sizerank"]]],1],22,["*",["-",22,["sqrt",["get","sizerank"]]],1]],"text-max-angle":30,"text-letter-spacing":["match",["get","class"],"ocean",.25,["sea","bay"],.15,0],"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"text-color":["match",["get","class"],["bay","ocean","sea"],"hsl(205, 71%, 90%)","hsl(205, 43%, 90%)"],"text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"water-point-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:1,filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water","disputed_bay","disputed_ocean","disputed_reservoir","disputed_sea","disputed_water"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"Point"]],layout:{"text-line-height":1.3,"text-size":["interpolate",["linear"],["zoom"],0,["*",["-",16,["sqrt",["get","sizerank"]]],1],22,["*",["-",22,["sqrt",["get","sizerank"]]],1]],"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":["match",["get","class"],"ocean",.25,["bay","sea"],.15,.01],"text-max-width":["match",["get","class"],"ocean",4,"sea",5,["bay","water"],7,10],visibility:"none"},paint:{"text-color":["match",["get","class"],["bay","ocean","sea"],"hsl(205, 71%, 90%)","hsl(205, 43%, 90%)"],"text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"settlement-subdivision-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:10,maxzoom:15,filter:["all",["match",["get","class"],["settlement_subdivision","disputed_settlement_subdivision"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],3],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-transform":"uppercase","text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-letter-spacing":["match",["get","type"],"suburb",.15,.05],"text-max-width":7,"text-padding":3,"text-size":["interpolate",["cubic-bezier",.5,0,1,1],["zoom"],11,["match",["get","type"],"suburb",11,10.5],15,["match",["get","type"],"suburb",15,14]],visibility:"none"},paint:{"text-halo-color":"hsla(60, 25%, 100%, 0.75)","text-halo-width":1,"text-color":"hsl(230, 29%, 36%)","text-halo-blur":.5}},{id:"settlement-minor-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:2,maxzoom:13,filter:["all",["<=",["get","filterrank"],3],["match",["get","class"],["settlement","disputed_settlement"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["zoom"],[">",["get","symbolrank"],6],4,[">=",["get","symbolrank"],7],6,[">=",["get","symbolrank"],8],7,[">=",["get","symbolrank"],10],10,[">=",["get","symbolrank"],11],11,[">=",["get","symbolrank"],13],12,[">=",["get","symbolrank"],15]],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],11,9,10],6,["step",["get","symbolrank"],14,9,12,12,10],8,["step",["get","symbolrank"],16,9,14,12,12,15,10],13,["step",["get","symbolrank"],22,9,20,12,16,15,14]],"text-radial-offset":["step",["zoom"],["match",["get","capital"],2,.6,.55],8,0],"symbol-sort-key":["get","symbolrank"],"icon-image":["step",["zoom"],["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],8,""],"text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-justify":"auto",visibility:"none","text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-max-width":7},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-halo-blur":1}},{id:"settlement-major-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:2,maxzoom:15,filter:["all",["<=",["get","filterrank"],3],["match",["get","class"],["settlement","disputed_settlement"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["zoom"],!1,2,["<=",["get","symbolrank"],6],4,["<",["get","symbolrank"],7],6,["<",["get","symbolrank"],8],7,["<",["get","symbolrank"],10],10,["<",["get","symbolrank"],11],11,["<",["get","symbolrank"],13],12,["<",["get","symbolrank"],15],13,[">=",["get","symbolrank"],11],14,[">=",["get","symbolrank"],15]],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],13,6,11],6,["step",["get","symbolrank"],18,6,16,7,14],8,["step",["get","symbolrank"],20,9,16,10,14],15,["step",["get","symbolrank"],24,9,20,12,16,15,14]],"text-radial-offset":["step",["zoom"],["match",["get","capital"],2,.6,.55],8,0],"symbol-sort-key":["get","symbolrank"],"icon-image":["step",["zoom"],["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],8,""],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],visibility:"none","text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-max-width":7},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-halo-blur":1}},{id:"state-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:3,maxzoom:9,filter:["all",["match",["get","class"],["state","disputed_state"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-size":["interpolate",["cubic-bezier",.85,.7,.65,1],["zoom"],4,["step",["get","symbolrank"],9,6,8,7,7],9,["step",["get","symbolrank"],21,6,16,7,14]],"text-transform":"uppercase","text-font":["DIN Pro Bold","Arial Unicode MS Bold"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":.15,"text-max-width":6,visibility:"none"},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-opacity":.5}},{id:"country-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:1,maxzoom:10,filter:["all",["match",["get","class"],["country","disputed_country"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-radial-offset":["step",["zoom"],.6,8,0],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],7,"auto"],"text-size":["interpolate",["cubic-bezier",.2,0,.7,1],["zoom"],1,["step",["get","symbolrank"],11,4,9,5,8],9,["step",["get","symbolrank"],22,4,19,5,17]]},paint:{"icon-opacity":["step",["zoom"],["case",["has","text_anchor"],1,0],7,0],"text-color":"hsl(230, 29%, 0%)","text-halo-color":["interpolate",["linear"],["zoom"],2,"hsla(60, 25%, 100%, 0.75)",3,"hsl(60, 25%, 100%)"],"text-halo-width":1.25}},{id:"continent-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:.75,maxzoom:3,filter:["==",["get","class"],"continent"],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-size":["interpolate",["exponential",.5],["zoom"],0,10,2.5,15],"text-transform":"uppercase","text-letter-spacing":.05,visibility:"none"},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":["interpolate",["linear"],["zoom"],0,"hsla(60, 25%, 100%, 0.75)",3,"hsl(60, 25%, 100%)"],"text-halo-width":1.5,"text-opacity":["interpolate",["linear"],["zoom"],0,.8,1.5,.5,2.5,0]}}]}}}const yi="",ut={name:"IdmWindParticle",props:{factor:{type:Object},viewport:{type:oe},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new H,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleOptions:{fadeOpacity:.9,speedFactor:.25,dropRate:.003,dropRateBump:.01,uvRange:[-25,26],sRange:[0,31.985]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{handler(){var r;(r=this.factor)!=null&&r.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var r;this.right=(((r=document.getElementsByClassName("right-bar")[0])==null?void 0:r.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const r=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(r+e),console.log("[wind-particle] add elapsed: ",a,", total: ",e+=a)}},handleClear(){var r,e,a,o,i,s,n,l;(r=this.viewport)==null||r.toggle(!1),(e=this.viewport)==null||e.toggleParticle(!1),this.context=void 0,this.particleContext=void 0,this.etime=void 0,this.initial=!0,(o=(a=this.viewport)==null?void 0:a.map)==null||o.off("resize",this.handleResize),(s=(i=this.viewport)==null?void 0:i.map)==null||s.off("movestart",this.handlePause),(l=(n=this.viewport)==null?void 0:n.map)==null||l.off("moveend",this.handlePlay),this.handlePause()},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const r=[[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,r);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,B.vertexSchema,B.uvFragmentSchema);this.program=e,this.aPositionBuffer=a}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const r=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,R.vertexSchema,R.fragmentSchema,R.quadVertSchema,R.screenFragmentSchema,R.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,r,!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 r=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,r),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,r),this.wrapper.image=r}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()})}}},gt={key:0};function bt(r,e,a,o,i,s){var n;return(n=a.factor)!=null&&n.active?(t.openBlock(),t.createElementBlock("div",gt,[t.createElementVNode("div",{class:"legend-bars flex-center",style:t.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:a.bottom}])},e[0]||(e[0]=[t.createElementVNode("span",null,"kts",-1),t.createElementVNode("span",null,"0",-1),t.createElementVNode("span",null,"5",-1),t.createElementVNode("span",null,"10",-1),t.createElementVNode("span",null,"20",-1),t.createElementVNode("span",null,"30",-1),t.createElementVNode("span",null,"40",-1),t.createElementVNode("span",null,"60",-1)]),4)])):t.createCommentVNode("",!0)}const wt=E(ut,[["render",bt],["__scopeId","data-v-24e5434b"]]),fi="",Lt={name:"IdmCurrent",props:{map:{type:Object},current:{type:Object},beforeLayer:{type:String},mapProjection:{type:String},showCurrentParticle:{type:Boolean,default:!1},showCurrentIsoband:{type:Boolean,default:!1},marginBottom:{type:String,default:"30px"},toggleVersion:{type:Number}},emits:["particle","handleToggleVersion"],data(){return{source:"current-source",directionLayer:"current-direction-layer",speedLayer:"current-speed-layer",speedLabelLayer:"current-speed-label-layer",empty:v.featureCollection([]),right:10,bottom:95}},watch:{"current.version":{handler(){var r;(r=this.current)!=null&&r.active?this.handleRender():this.handleClear(),this.$emit("handleToggleVersion")},deep:!0},showCurrentParticle:{handler(){this.handleParticle()}},showCurrentIsoband:{handler(){this.handleToggle()}}},methods:{handleParticle(){this.$emit("particle",{particle:this.showCurrentParticle,key:"current",weight:96})},handleRender(){var r,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.current){const a=new Date().valueOf();let o=0,i=0,s=this.empty;this.current.active&&(s=this.current.data),(r=this.map)!=null&&r.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),i=new Date().valueOf()-(a+o),console.log("[current] update elapsed: ",i,", total: ",o+=i)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.speedLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":["step",["get","val"],"#e1ffb3",1,"#ffff00",3,"#ff9500",4,"#f44336",5,"#f44336"]}},this.beforeLayer),this.map.addLayer({id:this.speedLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Polygon"],layout:{"symbol-placement":"line","text-field":"{val} kts","text-allow-overlap":!0,"text-rotation-alignment":"viewport","text-size":12},paint:{"text-color":"rgba(0, 0, 0, 0.8)"}},this.beforeLayer),this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"arrow-red","icon-size":["interpolate",["linear"],["get","spd"],.5,.14,3,.28],"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":.6}},this.beforeLayer),i=new Date().valueOf()-(a+o),console.log("[current] add elapsed: ",i,", total: ",o+=i)),this.handleToggle()}},handleToggle(){this.map.getLayer(this.speedLayer)&&this.map.setLayoutProperty(this.speedLayer,"visibility",this.showCurrentIsoband?"visible":"none"),this.map.getLayer(this.speedLabelLayer)&&this.map.setLayoutProperty(this.speedLabelLayer,"visibility",this.showCurrentIsoband?"visible":"none"),this.map.getLayer(this.directionLayer)&&this.map.setLayoutProperty(this.directionLayer,"visibility",this.showCurrentIsoband?"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)}}},xt={key:0};function _t(r,e,a,o,i,s){var n;return(n=a.current)!=null&&n.active?(t.openBlock(),t.createElementBlock("div",xt)):t.createCommentVNode("",!0)}const vt=E(Lt,[["render",_t]]),ui="",Ct={name:"IdmCurrentParticle",props:{factor:{type:Object},viewport:{type:oe},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new H,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleOptions:{fadeOpacity:.96,speedFactor:4,dropRate:.005,dropRateBump:.01,uvRange:[-2.5,2.6],sRange:[0,3]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{handler(){var r;(r=this.factor)!=null&&r.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var r;this.right=(((r=document.getElementsByClassName("right-bar")[0])==null?void 0:r.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const r=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(r+e),console.log("[current-particle] add elapsed: ",a,", total: ",e+=a)}},handleClear(){var r,e,a,o,i,s,n,l;(r=this.viewport)==null||r.toggle(!1),(e=this.viewport)==null||e.toggleParticle(!1),this.context=void 0,this.particleContext=void 0,this.etime=void 0,this.initial=!0,(o=(a=this.viewport)==null?void 0:a.map)==null||o.off("resize",this.handleResize),(s=(i=this.viewport)==null?void 0:i.map)==null||s.off("movestart",this.handlePause),(l=(n=this.viewport)==null?void 0:n.map)==null||l.off("moveend",this.handlePlay),this.handlePause()},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const r=[[0/255,"rgba(95, 143, 197,1)"],[5/255,"rgba(64,127,115,1)"],[10/255,"rgb(58,164,58)"],[15/255,"rgb(191,182,67)"],[20/255,"rgb(197,154,68)"],[30/255,"rgb(160,70,94)"],[40/255,"rgb(138,84,166)"],[45/255,"rgb(82,113,165)"],[50/255,"rgb(84,142,152)"],[65/255,"rgb(150,181,184)"],[80/255,"rgb(195,194,194)"],[254/255,"rgb(195,194,194)"],[1,"rgb(195,194,194)"]];this.rampColor=this.webgl.setup(this.context,r);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,B.vertexSchema,B.uvFragmentSchema);this.program=e,this.aPositionBuffer=a}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const r=[[0,"rgb(183,224,224)"],[1,"rgb(199,202,202)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,R.vertexSchema,R.fragmentSchema,R.quadVertSchema,R.screenFragmentSchema,R.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,r,!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 r=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,r),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,r),this.wrapper.image=r}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()})}}},kt={key:0};function Et(r,e,a,o,i,s){var n;return(n=a.factor)!=null&&n.active?(t.openBlock(),t.createElementBlock("div",kt,[t.createElementVNode("div",{class:"legend-bars flex-center",style:t.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:a.bottom}])},e[0]||(e[0]=[t.createElementVNode("span",null,"kts",-1),t.createElementVNode("span",null,"0",-1),t.createElementVNode("span",null,"0.4",-1),t.createElementVNode("span",null,"0.8",-1),t.createElementVNode("span",null,"1.6",-1),t.createElementVNode("span",null,"2",-1),t.createElementVNode("span",null,"3.2",-1)]),4)])):t.createCommentVNode("",!0)}const St=E(Ct,[["render",Et],["__scopeId","data-v-6d4fd206"]]),Pt={name:"IdmSigWave",props:{map:{type:Object},sigWave:{type:Object},beforeLayer:{type:String},activeWeatherLayers:{type:Array}},data(){return{source:"sig-wave-source",heightLayer:"sig-wave-height-layer",heightLabelLayer:"sig-wave-height-label-layer",empty:v.featureCollection([])}},watch:{"sigWave.version":{handler(){var r;(r=this.sigWave)!=null&&r.active?(this.handleRender(),this.handleMove()):this.handleClear()},deep:!0}},methods:{handleRender(){var r,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.sigWave){const a=new Date().valueOf();let o=0,i=0,s=this.empty;this.sigWave.active&&(s=this.sigWave.data),(r=this.map)!=null&&r.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),i=new Date().valueOf()-(a+o),console.log("[sig.wave] update elapsed: ",i,", total: ",o+=i)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.heightLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],layout:{"fill-sort-key":["get","val"]},paint:{"fill-outline-color":"#888","fill-opacity":.8,"fill-color":["step",["get","val"],"rgba(186,247,199,0.4)",3,"rgba(186,247,199,0.7)",4,"rgba(101,252,149,0.9)",5,"#b3ff6b",6,"#fee600",7,"#ffa200",8,"#ff6600",9,"#e23304",10,"#f80078",11,"#dc03d2",12,"#a603f8",13,"#7102ab"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Polygon"],layout:{"symbol-placement":"line","symbol-avoid-edges":!0,"symbol-sort-key":["get","val"],"text-field":"{val} m","text-rotation-alignment":"viewport","text-size":10},paint:{"text-opacity":.7}},this.beforeLayer),i=new Date().valueOf()-(a+o),console.log("[sig.wave] add elapsed: ",i,", total: ",o+=i))}},handleMove(){var r,e;(e=(r=this.map)==null?void 0:r.getLayer("country-boundaries"))==null||e.setLayoutProperty("visibility","visible"),this.map.getLayer(this.heightLayer)&&this.map.moveLayer(this.heightLayer,"country-boundaries"),this.map.getLayer(this.heightLabelLayer)&&this.map.moveLayer(this.heightLabelLayer,"country-boundaries")},handleClear(){var r,e,a;((r=this.activeWeatherLayers)==null?void 0:r.length)===0&&((a=(e=this.map)==null?void 0:e.getLayer("country-boundaries"))==null||a.setLayoutProperty("visibility","none")),this.map.getLayer(this.heightLayer)&&this.map.removeLayer(this.heightLayer),this.map.getLayer(this.heightLabelLayer)&&this.map.removeLayer(this.heightLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Nt(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const zt=E(Pt,[["render",Nt]]),Tt={name:"IdmSwell",props:{map:{type:Object},swell:{type:Object},beforeLayer:{type:String},activeWeatherLayers:{type:Array}},data(){return{source:"swell-source",directionLayer:"swell-direction-layer",heightLayer:"swell-height-layer",heightLabelLayer:"swell-height-label-layer",empty:v.featureCollection([])}},watch:{"swell.version":{handler(){var r;(r=this.swell)!=null&&r.active?(this.handleRender(),this.handleMove()):this.handleClear()},deep:!0},activeWeatherLayers:{handler(){setTimeout(()=>{this.activeWeatherLayers.length>0?this.handleMove():this.handleClear()},500)},deep:!0,immediate:!0}},methods:{handleRender(){var r,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.swell){const a=new Date().valueOf();let o=0,i=0,s=this.empty;this.swell.active&&(s=this.swell.data),(r=this.map)!=null&&r.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),i=new Date().valueOf()-(a+o),console.log("[swell] update elapsed: ",i,", total: ",o+=i)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.heightLayer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-opacity":1,"line-width":2,"line-color":["match",["get","val"],2,"rgba(255,255,0,0.9)",3,"rgba(255,149,0,0.9)",4,"rgba(244,67,54,0.9)",5,"rgba(162,2,31,0.9)",6,"rgba(162,2,31,0.9)","rgba(162,2,31,0.9)"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","LineString"],layout:{"symbol-placement":"line","text-rotation-alignment":"viewport","text-field":"{val}M","text-size":12},paint:{"text-color":["step",["get","val"],"black",4,"white",5,"white",6,"white"],"text-halo-color":["match",["get","val"],2,"rgba(255,255,0,0.7)",3,"rgba(255,149,0,0.7)",4,"rgba(244,67,54,0.7)",5,"rgba(162,13,2,0.7)",6,"rgba(162,13,2,0.7)","rgba(162,13,2,0.7)"],"text-halo-width":4}},this.beforeLayer),this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"arrow-yellow","icon-size":{base:1,stops:[[2,.14],[6,.28]]},"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,180],[360,540]]}},paint:{"icon-opacity":.8}},this.beforeLayer),i=new Date().valueOf()-(a+o),console.log("[swell] add elapsed: ",i,", total: ",o+=i))}},handleMove(){var r,e;(e=(r=this.map)==null?void 0:r.getLayer("country-boundaries"))==null||e.setLayoutProperty("visibility","visible"),this.map.getLayer(this.heightLayer)&&this.map.moveLayer(this.heightLayer,"country-boundaries"),this.map.getLayer(this.directionLayer)&&this.map.moveLayer(this.directionLayer,"country-boundaries"),this.map.getLayer(this.heightLabelLayer)&&this.map.moveLayer(this.heightLabelLayer,"country-boundaries")},handleClear(){var r,e;this.activeWeatherLayers.length===0&&((e=(r=this.map)==null?void 0:r.getLayer("country-boundaries"))==null||e.setLayoutProperty("visibility","none")),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 Vt(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const Dt=E(Tt,[["render",Vt]]),Bt={name:"IdmPrmsl",props:{map:{type:Object},prmsl:{type:Object},beforeLayer:{type:String},showRampColor:{type:Boolean},activeWeatherLayers:{type:Array}},data(){return{source:"prmsl-source",layer:"prmsl-layer",labelLayer:"prmsl-label-layer",pointLabelLayer:"prmsl-point-label-layer",empty:v.featureCollection([])}},watch:{"prmsl.version":{handler(){var r;(r=this.prmsl)!=null&&r.active?(this.handleRender(),this.handleMove()):this.handleClear()},deep:!0},activeWeatherLayers:{handler(){setTimeout(()=>{this.activeWeatherLayers.length>0?this.handleMove():this.handleClear()},500)},deep:!0,immediate:!0}},methods:{handleRender(){var r,e,a;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.prmsl){const o=new Date().valueOf();let i=0,s=0,n=this.empty;this.prmsl.active&&(n=this.prmsl.data),(r=this.map)!=null&&r.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(n),s=new Date().valueOf()-(o+i),console.log("[prmsl] update elapsed: ",s,", total: ",i+=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"],"rgba(162,13,2,1)",920,"rgba(244,67,54,1)",980,"rgba(255,255,0,1)",1100,"rgba(199,171,250,1)"],"line-width":1,"line-opacity":1}},this.beforeLayer),(a=this.map)==null||a.addLayer({id:this.labelLayer,type:"symbol",source:this.source,minzoom:4,filter:["==","$type","LineString"],layout:{"symbol-placement":"line","text-rotation-alignment":"viewport","text-field":"{val}","text-size":12},paint:{"text-color":"black","text-opacity":.9,"text-halo-color":"rgba(255,255,255,1)","text-halo-width":1}},this.beforeLayer),setTimeout(()=>{this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":["format",["get","type"],{"font-scale":1.03},`
190
+ `,["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":12},paint:{"text-opacity":1,"text-color":["step",["get","val"],"white",980,"black",1100,"black"],"text-halo-color":["step",["get","val"],"rgba(162,13,2,0.9)",920,"rgba(244,67,54,0.9)",980,"rgba(255,255,0,0.9)",1100,"rgba(199,171,250,0.9)"],"text-halo-width":4}},this.beforeLayer)},0),s=new Date().valueOf()-(o+i),console.log("[prmsl] add elapsed: ",s,", total: ",i+=s))}},handleMove(){var r,e;(e=(r=this.map)==null?void 0:r.getLayer("country-boundaries"))==null||e.setLayoutProperty("visibility","visible"),this.map.getLayer(this.pointLabelLayer)&&this.map.moveLayer(this.pointLabelLayer,"country-boundaries"),this.map.getLayer(this.labelLayer)&&this.map.moveLayer(this.labelLayer,"country-boundaries"),this.map.getLayer(this.layer)&&this.map.moveLayer(this.layer,"country-boundaries")},handleClear(){var r,e;this.activeWeatherLayers.length===0&&((e=(r=this.map)==null?void 0:r.getLayer("country-boundaries"))==null||e.setLayoutProperty("visibility","none")),this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.labelLayer)&&this.map.removeLayer(this.labelLayer),this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function It(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const Rt=E(Bt,[["render",It]]),Mt={name:"IdmIceberg",props:{map:{type:Object},iceberg:{type:Object},beforeLayer:{type:String}},data(){return{source:"iceberg-source",layer:"iceberg-layer",empty:v.featureCollection([])}},watch:{"iceberg.version":{handler(){var r;(r=this.iceberg)!=null&&r.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var r,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.iceberg){const a=new Date().valueOf();let o=0,i=0,s=this.empty;this.iceberg.active&&(s=this.iceberg.data),(r=this.map)!=null&&r.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),i=new Date().valueOf()-(a+o),console.log("[iceberg] update elapsed: ",i,", total: ",o+=i)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-color":"rgba(255,255,255, 0.8)","line-width":2,"line-opacity":1}}),i=new Date().valueOf()-(a+o),console.log("[iceberg] add elapsed: ",i,", total: ",o+=i))}},handleClear(){this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Wt(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const At=E(Mt,[["render",Wt]]),gi="",Ot={name:"IdmTropicals",props:{map:{type:Object},tropicals:{type:Object},date:{type:String},timeZone:{type:Number,default:0}},emits:["tropical","tropicalProbability"],data(){return{helper:V.CompanyHelper,source:"tropicals-source",clusterSource:"tropicals-cluster-source",historyLayer:"tropicals-history-layer",forecastLayer:"tropicals-forecast-layer",forecastModelLayer:"tropicals-forecast-model-layer",forecastNameLayer:"tropicals-forecast-name-layer",pointCircleLayer:"tropicals-point-circle-layer",pointLabelLayer:"tropicals-point-label-layer",historyPointCircleLayer:"history-tropicals-point-circle-layer",historyPointLabelLayer:"history-tropicals-point-label-layer",interpolateData:[],interpolateMarkers:[],interpolateSource:"tropicals-interpolate-source",interpolateLineLayer:"tropicals-interpolate-line-layer",showTropicals:!1,activeTropicals:void 0,activeTropicalsMarker:void 0,empty:v.featureCollection([]),circleSource:"circle-source",circleSourceData:v.featureCollection([]),circleLayer:"tropical-circle-layer"}},computed:{computeTime(){return function(r){if(r){const e=D(r).utc().utcOffset(this.timeZone),a=this.timeZone<0?this.timeZone:"+"+this.timeZone;return`${e.format("MMM-DD,HHmm")}[ UTC ${a} ] ( ${e==null?void 0:e.fromNow()} )`}return"-"}},computeTimezone(){return this.timeZone<0?this.timeZone:"+"+this.timeZone}},watch:{"tropicals.active":{handler(){this.handleInit()},immediate:!0},showTropicals:{handler(){this.$emit("tropical",this.showTropicals)},immediate:!0},"tropicals.version":{handler(){this.handleRefresh()}},timeZone:{handler(){this.handleRefresh()}}},methods:{handleRefresh(){var o,i;const r=((i=(o=this.tropicals)==null?void 0:o.data)==null?void 0:i.features)||[],e=D().utc().hour(),a=[];r.forEach(s=>{var n,l,h;(n=s.properties)!=null&&n.name&&!a.includes((l=s.properties)==null?void 0:l.name)&&a.push((h=s.properties)==null?void 0:h.name)}),a.forEach(s=>{var p;let n=0,l;const h=r.filter(c=>{var d,u;return((u=(d=c.properties)==null?void 0:d.category)==null?void 0:u.split("-")[0])===s});(p=h.filter(c=>{var d,u;return((d=c.geometry)==null?void 0:d.type)==="LineString"&&((u=c.properties)==null?void 0:u.type)==="forecast"})[0])==null||p.properties.model,h.forEach((c,d)=>{var u,m,b,f,y,w;((u=c.geometry)==null?void 0:u.type)==="Point"&&((m=c.properties)==null?void 0:m.type)==="history"&&(n=d,l=l===void 0?d:l),((b=c.geometry)==null?void 0:b.type)==="Point"&&((f=c.properties)==null?void 0:f.type)==="forecast"&&l===void 0&&(l=d),((y=c.geometry)==null?void 0:y.type)==="LineString"&&((w=c.properties)==null||w.type)}),h.map((c,d)=>{var u,m,b,f,y,w,g;if(((u=c.geometry)==null?void 0:u.type)==="LineString"&&((m=c.properties)==null||m.type),((b=c.geometry)==null?void 0:b.type)==="Point"&&((f=c.properties)==null?void 0:f.type)==="forecast"&&(c.properties.name=s,c.properties.format=D(c.properties.date).utcOffset(this.timeZone).format(`MMM-DD,HHmm [(utc ${this.computeTimezone})]`)),((y=c.geometry)==null?void 0:y.type)==="Point"&&((w=c.properties)==null?void 0:w.type)==="history"){c.properties.format=D(c.properties.date).utcOffset(this.timeZone).format(`MMM-DD,HHmm [(utc ${this.computeTimezone})]`);const x=D((g=c.properties)==null?void 0:g.date).utc().format("HHmm")===D().utc().hour(Math.floor(e/6)*6).minute("00").format("HHmm");c.properties.showHistoryLabel=x||d===n,c.properties.showNameLabel=d===n,c.properties.name=s}return c})}),this.handleInit()},handleInit(){var r,e;this.tropicals&&this.tropicals.active?(this.handleRender(),(r=this.map)==null||r.on("click",[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.forecastModelLayer,this.pointCircleLayer,this.pointLabelLayer,this.historyPointCircleLayer,this.historyPointLabelLayer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.forecastModelLayer,this.pointCircleLayer,this.pointLabelLayer,this.historyPointCircleLayer,this.historyPointLabelLayer],this.handleClick))},handleRender(){var r,e,a,o,i,s,n,l,h,p;if(!this.map)setTimeout(()=>{this.handleRender()},500);else{if(this.tropicals){const d=new Date().valueOf();let u=0,m=0;(r=this.map)!=null&&r.getSource(this.source)?((a=this.map)==null||a.getSource(this.source).setData((e=this.tropicals)!=null&&e.active?this.tropicals.data:this.empty),m=new Date().valueOf()-(d+u),console.log("[tropicals] update elapsed: ",m,", total: ",u+=m)):(this.map.addSource(this.source,{type:"geojson",data:(o=this.tropicals)!=null&&o.active?(i=this.tropicals)==null?void 0:i.data:this.empty}),this.map.addLayer({id:this.historyLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["==","type","history"],["!=","disabled",!0]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#000","line-width":4,"line-opacity":.5}}),this.map.addLayer({id:this.forecastLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"],["!=","disabled",!0]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["match",["get","model"],"cma","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#fff"],"line-width":3,"line-opacity":.9,"line-dasharray":[1,2]}}),this.map.addLayer({id:this.forecastModelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"],["!=","disabled",!0]],layout:{"symbol-placement":"line","text-field":"{model}","text-rotation-alignment":"viewport","text-size":13},paint:{"text-color":["match",["get","model"],"cma","#000","jma","#000","ecmwf","#fff","ukm","#fff","noaa-at","#fff","noaa-ep","#fff","#000"],"text-opacity":1,"text-halo-color":["match",["get","model"],"cma","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#fff"],"text-halo-width":4}}),m=new Date().valueOf()-(d+u),console.log("[tropical] add elapsed: ",m,", total: ",u+=m)),(s=this.map)!=null&&s.getSource(this.clusterSource)?((l=this.map)==null||l.getSource(this.clusterSource).setData((n=this.tropicals)!=null&&n.active?this.tropicals.data:this.empty),m=new Date().valueOf()-(d+u),console.log("[tropical] update elapsed: ",m,", total: ",u+=m)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(h=this.tropicals)!=null&&h.active?(p=this.tropicals)==null?void 0:p.data:this.empty}),this.map.addLayer({id:this.pointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":6,"circle-color":"#fff"}}),this.map.addLayer({id:this.pointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":4,"circle-color":["case",["boolean",["==",["get","spd",["get","wind"]],null]],"#03f869",["boolean",["<",["get","spd",["get","wind"]],17.2]],"#03f869",["boolean",["<=",["get","spd",["get","wind"]],24.5]],"#f2f202",["boolean",["<=",["get","spd",["get","wind"]],32.7]],"#ff9100",["boolean",["<=",["get","spd",["get","wind"]],41.5]],"#f44336",["boolean",["<",["get","spd",["get","wind"]],51]],"#f903d0",["boolean",[">=",["get","spd",["get","wind"]],51]],"#8702f9","#fff"]}}),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[0,-.5],"text-anchor":"bottom-left","text-size":12},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"#fff","text-halo-width":1}}),this.map.addLayer({id:this.historyPointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":7,"circle-color":"#fff"}}),this.map.addLayer({id:this.historyPointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":5,"circle-color":"rgba(0,0,0,0.7)"}}),this.map.addLayer({id:this.historyPointCircleLayer+"-inner",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":3,"circle-color":"#fff"}}),this.map.addLayer({id:this.historyPointLabelLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[0,-.5],"text-anchor":"bottom-left","text-size":14},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"#fff","text-halo-width":1}}),this.map.addLayer({id:this.forecastNameLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showNameLabel",!0]],layout:{"text-field":["get","name"],"text-offset":[0,1.5],"text-anchor":"bottom","text-size":16,"text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#fff","text-halo-color":"#0033ff","text-halo-width":4}}),m=new Date().valueOf()-(d+u),console.log("[tropical] add elapsed: ",m,", total: ",u+=m))}this.handleDrawCircle();const c=k.TropicalHelper.interpolate(this.tropicals,1);this.interpolateData=JSON.parse(JSON.stringify(c)),this.interpolateData.filter(d=>d.properties.name==="kristy"&&d.properties.model==="ecmwf"),this.handleDateChange()}},handleClear(){var r;this.map&&(this.map.getLayer(this.historyLayer)&&this.map.removeLayer(this.historyLayer),this.map.getLayer(this.forecastLayer)&&this.map.removeLayer(this.forecastLayer),this.map.getLayer(this.forecastModelLayer)&&this.map.removeLayer(this.forecastModelLayer),this.map.getLayer(this.forecastNameLayer)&&this.map.removeLayer(this.forecastNameLayer),this.map.getLayer(this.pointCircleLayer)&&this.map.removeLayer(this.pointCircleLayer),this.map.getLayer(this.pointCircleLayer+"-border")&&this.map.removeLayer(this.pointCircleLayer+"-border"),this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.historyPointCircleLayer)&&this.map.removeLayer(this.historyPointCircleLayer),this.map.getLayer(this.historyPointCircleLayer+"-border")&&this.map.removeLayer(this.historyPointCircleLayer+"-border"),this.map.getLayer(this.historyPointCircleLayer+"-inner")&&this.map.removeLayer(this.historyPointCircleLayer+"-inner"),this.map.getLayer(this.historyPointLabelLayer)&&this.map.removeLayer(this.historyPointLabelLayer),this.map.getLayer(this.interpolateLineLayer)&&this.map.removeLayer(this.interpolateLineLayer),(r=this.interpolateMarkers)==null||r.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 r,e,a,o,i,s,n,l,h,p,c,d,u,m,b,f,y,w,g,x,C,L,_,P,I,M,W,F,G,J,X,q,Y,U,Q,z;if((r=this.interpolateMarkers)==null||r.forEach(Z=>Z==null?void 0:Z.remove()),this.circleSourceData.features=[],(e=this.interpolateData)!=null&&e.length&&this.tropicals.active){const Z=D(this.date).utc().set({minute:0,second:0,millisecond:0}),K=this.interpolateData.filter(N=>N.properties.date===Z.format()&&!N.properties.disabled),se=this.handleComputePolygons(K),ee=v.featureCollection([...K]);se.forEach(N=>{ee.features.push(N)}),(a=this.map)!=null&&a.getSource(this.interpolateSource)?(o=this.map)==null||o.getSource(this.interpolateSource).setData(ee):((i=this.map)==null||i.addSource(this.interpolateSource,{type:"geojson",data:ee}),(s=this.map)==null||s.addLayer({id:this.interpolateLineLayer,type:"line",source:this.interpolateSource,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-opacity":1,"line-color":["match",["get","level"],7,"#ff9100",10,"#f44336","#ffffff"],"line-width":1}})),this.interpolateMarkers=[];for(const N of K)if(!N.properties.disabled){let O="#f44336";((l=(n=N.properties)==null?void 0:n.wind)==null?void 0:l.spd)<17.2||!((p=(h=N.properties)==null?void 0:h.wind)!=null&&p.spd)?O="#03f869":((d=(c=N.properties)==null?void 0:c.wind)==null?void 0:d.spd)>=17.2&&((m=(u=N.properties)==null?void 0:u.wind)==null?void 0:m.spd)<24.5?O="#f2f202":((f=(b=N.properties)==null?void 0:b.wind)==null?void 0:f.spd)>=24.5&&((w=(y=N.properties)==null?void 0:y.wind)==null?void 0:w.spd)<32.7?O="#ff9100":((x=(g=N.properties)==null?void 0:g.wind)==null?void 0:x.spd)>=32.7&&((L=(C=N.properties)==null?void 0:C.wind)==null?void 0:L.spd)<41.5?O="#f44336":((P=(_=N.properties)==null?void 0:_.wind)==null?void 0:P.spd)>=41.5&&((M=(I=N.properties)==null?void 0:I.wind)==null?void 0:M.spd)<51?O="#f903d0":((F=(W=N.properties)==null?void 0:W.wind)==null?void 0:F.spd)>=51?O="#8702f9":O="#f44336";const ne=`<svg t="1719918955501"
191
191
  class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" p-id="18382"
192
192
  xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">
193
193
  <path
@@ -201,4 +201,4 @@
201
201
  <path
202
202
  d="M420.66666667 959.17a16.08 16.08 0 0 1-15.91-13.49A15.89 15.89 0 0 1 415.50666667 928c1.49-0.55 38.88-14.76 72.79-65.52A354.55 354.55 0 0 1 162.66666667 509.17a450.14 450.14 0 0 1 450.5-450.5 16.07 16.07 0 0 1 15.91 13.48 15.88 15.88 0 0 1-10.75 17.66c-1.58 0.58-39.13 14.9-73.07 65.95A354.22 354.22 0 0 1 871.66666667 509.17a16 16 0 0 1-0.52 4.05A450.14 450.14 0 0 1 420.66666667 959.17zM554.80666667 94.72C351.57666667 123.2 194.66666667 298.21 194.66666667 509.17c0 177.08 144.06 321.74 321.13 322.48a16 16 0 0 1 14.07 23.49c-16.11 30.42-34.27 52.37-50.85 68C682.25666667 894.63 839.16666667 719.63 839.16666667 508.67a15.94 15.94 0 0 1 0.47-3.86C837.30666667 329.33 693.82666667 187 517.80666667 186.67A16 16 0 0 1 503.66666667 163.21c16.21-30.69 34.47-52.79 51.14-68.49z"
203
203
  fill="#ffffff" p-id="18386"></path>
204
- </svg>`,te=document.createElement("div");te.className="hurricane-hourly-marker",te.innerHTML=`<div class="${P.geometry.coordinates[1]>=0?"center north":"center south"}">${ne}</div>`;const le=new j.Marker(te).setLngLat(P.geometry.coordinates).addTo(this.map);if(this.interpolateMarkers.push(le),(G=P.properties)!=null&&G.showCircle){const ae={radius:100,coordinates:P.geometry.coordinates},re={radius:200,coordinates:P.geometry.coordinates},ie={radius:500,coordinates:P.geometry.coordinates};(J=this.circleSourceData)==null||J.features.push(v.circle(ae.coordinates,ae.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}})),(X=this.circleSourceData)==null||X.features.push(v.circle(re.coordinates,re.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}})),(q=this.circleSourceData)==null||q.features.push(v.circle(ie.coordinates,ie.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}}))}(U=(Y=this.map)==null?void 0:Y.getSource(this.circleSource))==null||U.setData(this.circleSourceData)}}else(Q=this.map)!=null&&Q.getSource(this.interpolateSource)&&((z=this.map)==null||z.getSource(this.interpolateSource).setData(this.empty))},handleClick(r){var s,n,l,h,p,c,d,u;const e=r.features[0],a=(n=(s=this.tropicals)==null?void 0:s.data)==null?void 0:n.features.filter(m=>{var b;return m.geometry.type==="LineString"&&m.properties.type==="forecast"&&m.properties.name===((b=e==null?void 0:e.properties)==null?void 0:b.name)});a.sort((m,b)=>{var f,y,L,g;return((f=m.properties)==null?void 0:f.model)==="cma"?-1:((y=m.properties)==null?void 0:y.model)==="jma"?((L=b.properties)==null?void 0:L.model)==="cma"?1:-1:m.properties.model==="ecmwf"?["jma","cma"].includes((g=b.properties)==null?void 0:g.model)?1:-1:0});const o=(h=(l=this.tropicals)==null?void 0:l.data)==null?void 0:h.features.filter(m=>{var b;return m.geometry.type==="LineString"&&m.properties.type==="history"&&m.properties.name===((b=e==null?void 0:e.properties)==null?void 0:b.name)});this.activeTropicals={name:(p=e==null?void 0:e.properties)==null?void 0:p.name,forecasts:a.map(m=>m.properties),history:(c=o[0])==null?void 0:c.properties,showCircle:(u=(d=a[0])==null?void 0:d.properties)==null?void 0:u.showCircle},this.showTropicals=!0;const i=document.getElementById("active-tropical");this.activeTropicalsMarker?this.activeTropicalsMarker.setLngLat([r.lngLat.lng,r.lngLat.lat]):this.activeTropicalsMarker=new j.Marker(i).setLngLat([r.lngLat.lng,r.lngLat.lat]).setOffset([220,0]).addTo(this.map)},handleForecastToggle(r){var o,i,s,n,l,h;r.disabled=!r.disabled;const e=`${r.name}-${r.model}`,a=(i=(o=this.map)==null?void 0:o.getSource(this.source)._data)==null?void 0:i.features;a.forEach(p=>{p.properties.category===e&&(p.properties.disabled=r.disabled)}),this.interpolateData.forEach(p=>{p.properties.category===e&&(p.properties.disabled=r.disabled)}),(n=(s=this.map)==null?void 0:s.getSource(this.source))==null||n.setData(v.featureCollection(a)),(h=(l=this.map)==null?void 0:l.getSource(this.clusterSource))==null||h.setData(v.featureCollection(a)),this.handleDateChange()},handleStrikeProbability(r){this.$emit("tropicalProbability",r)},handleToggleCircles(r){var e,a;r.showCircle=!r.showCircle,(a=(e=this.tropicals.data)==null?void 0:e.features)==null||a.forEach(o=>{o.properties.name===r.name&&(o.properties.showCircle=r.showCircle)}),this.handleRender()},handleDrawCircle(){var r,e;(r=this.map)!=null&&r.getSource(this.circleSource)?(e=this.map)==null||e.getSource(this.circleSource).setData(this.circleSourceData):(this.map.addSource(this.circleSource,{type:"geojson",data:this.circleSourceData}),this.map.addLayer({id:this.circleLayer,type:"line",source:this.circleSource,filter:["all",["==","$type","Polygon"],["==","type","tropicalCircle"]],paint:{"line-color":"#fff","line-width":2,"line-opacity":1,"line-dasharray":[1,1]}}))},handleComputePolygons(r){const e=[];for(const a of r){const o=a.properties.wind,i={ne:o.r7ne>=0?o.r7ne:void 0,se:o.r7se>=0?o.r7se:void 0,sw:o.r7sw>=0?o.r7sw:void 0,nw:o.r7nw>=0?o.r7nw:void 0},s=this.handleComputeArc(a.geometry.coordinates,i,{...a.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(a.geometry.coordinates,n,{...a.properties,level:10});e.push(l)}return e},handleComputeArc(r,e,a){var s;const o=[];for(const n in e){const l=e[n]??0;let h;switch(n){case"ne":h=v.lineArc(r,l*1.852,0,90,{steps:l>0?64:1});break;case"se":h=v.lineArc(r,l*1.852,90,180,{steps:l>0?64:1});break;case"sw":h=v.lineArc(r,l*1.852,180,270,{steps:l>0?64:1});break;case"nw":h=v.lineArc(r,l*1.852,270,360,{steps:l>0?64:1});break}o.push(...(s=h==null?void 0:h.geometry)==null?void 0:s.coordinates)}const i=v.lineString(o);return v.lineToPolygon(i,{properties:a})}}},Ft={id:"active-tropical",class:"active-tropical"},jt={class:"header-box"},$t={class:"main"},Ht={key:0},Ut={class:"sub"},Zt={id:"meteoBox",class:"main-box"},Gt={class:"content"},Jt={class:"row"},Xt={class:"col col-left",style:{"justify-content":"flex-start"}},qt={class:"col col-right",style:{"justify-content":"flex-start"}},Yt={class:"row"},Qt={class:"col col-24",style:{"justify-content":"flex-start"}},Kt={class:"forecast-models"},ea=["onClick"],ta={class:"more"};function aa(r,e,a,o,i,s){var n,l,h,p,c,d,u,m,b,f,y,L,g,x,C;return t.withDirectives((t.openBlock(),t.createElementBlock("div",Ft,[t.createElementVNode("div",jt,[t.createElementVNode("div",{class:"iconfont close-btn",onClick:e[0]||(e[0]=w=>i.showTropicals=!1)},""),t.createElementVNode("div",$t,[(l=(n=i.activeTropicals)==null?void 0:n.history)!=null&&l.level?(t.openBlock(),t.createElementBlock("span",Ht,t.toDisplayString((p=(h=i.activeTropicals)==null?void 0:h.history)==null?void 0:p.level)+" , ",1)):t.createCommentVNode("",!0),t.createTextVNode(t.toDisplayString((c=i.activeTropicals)==null?void 0:c.name),1)]),t.createElementVNode("div",Ut," Last update: "+t.toDisplayString(s.computeTime(((u=(d=i.activeTropicals)==null?void 0:d.history)==null?void 0:u.updated)||((f=(b=(m=i.activeTropicals)==null?void 0:m.forecasts)==null?void 0:b.filter(w=>!w.disabled)[0])==null?void 0:f.date))),1)]),t.createElementVNode("div",Zt,[t.createElementVNode("div",Gt,[t.createElementVNode("div",Jt,[t.createElementVNode("div",Xt,[e[2]||(e[2]=t.createElementVNode("label",null,"Wind speed : ",-1)),t.createElementVNode("span",null,t.toDisplayString(((L=(y=i.activeTropicals)==null?void 0:y.history)==null?void 0:L.kts)||"-")+"[kts]",1)]),t.createElementVNode("div",qt,[e[3]||(e[3]=t.createElementVNode("label",null,"Pressure : ",-1)),t.createElementVNode("span",null,t.toDisplayString(((x=(g=i.activeTropicals)==null?void 0:g.history)==null?void 0:x.pressure)||"-")+"[hPa]",1)])]),t.createElementVNode("div",Yt,[t.createElementVNode("div",Qt,[e[4]||(e[4]=t.createElementVNode("label",{style:{width:"max-content"}},"Forecast Models : ",-1)),t.createElementVNode("div",Kt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList((C=i.activeTropicals)==null?void 0:C.forecasts,(w,_)=>{var N,I,W,A;return t.openBlock(),t.createElementBlock("div",{key:_,class:t.normalizeClass(["model",w.disabled?"":"active",_>0&&_<((I=(N=i.activeTropicals)==null?void 0:N.forecasts)==null?void 0:I.length)-1&&((A=(W=i.activeTropicals)==null?void 0:W.forecasts)==null?void 0:A.length)>2?"center-child":""]),onClick:F=>s.handleForecastToggle(w)},[t.createElementVNode("span",{class:t.normalizeClass(w.model)},t.toDisplayString(w.model),3)],10,ea)}),128))])])]),e[5]||(e[5]=t.createStaticVNode('<div class="row" style="padding:0;height:1px;margin:10px 0;background:var(--idm-black-1);" data-v-726fd7f6></div><div class="row" style="padding:2px 10px;" data-v-726fd7f6><div class="legend" data-v-726fd7f6><div class="icon td" data-v-726fd7f6></div><div class="label" data-v-726fd7f6>TD</div></div><div class="legend" data-v-726fd7f6><div class="icon ts" data-v-726fd7f6></div><div class="label" data-v-726fd7f6>TS</div></div><div class="legend" data-v-726fd7f6><div class="icon sts" data-v-726fd7f6></div><div class="label" data-v-726fd7f6>STS</div></div><div class="legend" data-v-726fd7f6><div class="icon ty" data-v-726fd7f6></div><div class="label" data-v-726fd7f6>TY</div></div><div class="legend" data-v-726fd7f6><div class="icon sty" data-v-726fd7f6></div><div class="label" data-v-726fd7f6>STY</div></div><div class="legend" data-v-726fd7f6><div class="icon supper-ty" data-v-726fd7f6></div><div class="label" data-v-726fd7f6>Super TY</div></div></div><div class="row" style="padding:2px 10px;" data-v-726fd7f6><div class="legend" data-v-726fd7f6><div class="icon history" data-v-726fd7f6></div><div class="label" data-v-726fd7f6>History</div></div><div class="legend" data-v-726fd7f6><div class="icon r7" data-v-726fd7f6></div><div class="label" data-v-726fd7f6>35kts Radii</div></div><div class="legend" data-v-726fd7f6><div class="icon r10" data-v-726fd7f6></div><div class="label" data-v-726fd7f6>50kts Radii</div></div></div>',3))]),t.createElementVNode("div",ta,[t.createElementVNode("div",{class:"button",onClick:e[1]||(e[1]=w=>s.handleStrikeProbability(i.activeTropicals))},"Strike Probability >>")])])],512)),[[t.vShow,i.showTropicals&&!r.$attrs.hideTropicalsLegend]])}const ce=E(Ot,[["render",aa],["__scopeId","data-v-726fd7f6"]]),bi="",ra={name:"IdmPrecip3h",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new H,etime:void 0,right:10}},watch:{"factor.version":{handler(){var r;(r=this.factor)!=null&&r.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var r;this.right=(((r=document.getElementsByClassName("right-bar")[0])==null?void 0:r.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const r=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(r+e),console.log("[precip3h] add elapsed: ",a,", total: ",e+=a)}},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 r=[[0,"rgba(59, 126, 162, 0)"],[14/255,"rgba(84,170,230, 0)"],[15/255,"rgba(172, 210, 255, 0.8)"],[20/255,"rgba(51,202,248,0.8)"],[30/255,"rgba(3,248,103,0.8)"],[49/255,"rgba(14,201,3,0.8)"],[57/255,"rgba(190,226,2,0.8)"],[73/255,"rgba(248,1,1,0.8)"],[82/255,"rgba(197,5,58,0.8)"],[1,"rgba(197,5,58,0.8)"]];this.rampColor=this.webgl.setup(this.context,r);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,B.vertexSchema,B.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const r=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,r)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},ia={key:0};function oa(r,e,a,o,i,s){var n;return(n=a.factor)!=null&&n.active?(t.openBlock(),t.createElementBlock("div",ia,[t.createElementVNode("div",{class:"legend-bars flex-center",style:t.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:a.bottom}])},e[0]||(e[0]=[t.createElementVNode("span",null,"mm",-1),t.createElementVNode("span",null,"1.5",-1),t.createElementVNode("span",null,"2",-1),t.createElementVNode("span",null,"3",-1),t.createElementVNode("span",null,"7",-1),t.createElementVNode("span",null,"10",-1),t.createElementVNode("span",null,"20",-1),t.createElementVNode("span",null,"30",-1)]),4)])):t.createCommentVNode("",!0)}const sa=E(ra,[["render",oa],["__scopeId","data-v-9708a7a3"]]),Li="",na={name:"IdmVisibility",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new H,etime:void 0}},watch:{"factor.version":{handler(){var r;(r=this.factor)!=null&&r.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var r;this.right=(((r=document.getElementsByClassName("right-bar")[0])==null?void 0:r.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const r=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(r+e),console.log("[visibility] add elapsed: ",a,", total: ",e+=a)}},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 r=[[0,"rgba(189,50,160,0.8)"],[8/255,"rgba(208,56,56,0.8)"],[27/255,"rgba(190,226,2,0.8)"],[60/255,"rgba(3,236,118,0.8)"],[160/255,"rgba(172, 210,255,0.8)"],[161/255,"rgba(172, 210,255,0)"],[1,"rgba(144,144,144,0)"]];this.rampColor=this.webgl.setup(this.context,r);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,B.vertexSchema,B.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const r=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,r)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},la={key:0};function ca(r,e,a,o,i,s){var n;return(n=a.factor)!=null&&n.active?(t.openBlock(),t.createElementBlock("div",la,[t.createElementVNode("div",{class:"legend-bars flex-center",style:t.normalizeStyle([{position:"absolute"},{right:r.right+"px",bottom:a.bottom}])},e[0]||(e[0]=[t.createElementVNode("span",null,"nm",-1),t.createElementVNode("span",null,"0",-1),t.createElementVNode("span",null,"0.5",-1),t.createElementVNode("span",null,"1.5",-1),t.createElementVNode("span",null,"3",-1),t.createElementVNode("span",null,"9",-1)]),4)])):t.createCommentVNode("",!0)}const ha=E(na,[["render",ca],["__scopeId","data-v-f7b2fb08"]]),wi="",da={name:"IdmWaterTemp",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new H,etime:void 0,right:10}},watch:{"factor.version":{handler(){var r;(r=this.factor)!=null&&r.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var r;this.right=(((r=document.getElementsByClassName("right-bar")[0])==null?void 0:r.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const r=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(r+e),console.log("[water-temp] add elapsed: ",a,", total: ",e+=a)}},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 r=[[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,r);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,B.vertexSchema,B.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const r=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,r)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},pa={key:0};function ma(r,e,a,o,i,s){var n;return(n=a.factor)!=null&&n.active?(t.openBlock(),t.createElementBlock("div",pa,[t.createElementVNode("div",{class:"legend-bars flex-center",style:t.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:a.bottom}])},e[0]||(e[0]=[t.createElementVNode("span",null,"°C",-1),t.createElementVNode("span",null,"0",-1),t.createElementVNode("span",null,"10",-1),t.createElementVNode("span",null,"20",-1),t.createElementVNode("span",null,"30",-1),t.createElementVNode("span",null,"40",-1)]),4)])):t.createCommentVNode("",!0)}const ya=E(da,[["render",ma],["__scopeId","data-v-7521f582"]]),xi="",fa={name:"IdmTemp",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new H,etime:void 0,right:10}},watch:{"factor.version":{handler(){var r;(r=this.factor)!=null&&r.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var r;this.right=(((r=document.getElementsByClassName("right-bar")[0])==null?void 0:r.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const r=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(r+e),console.log("[water-temp] add elapsed: ",a,", total: ",e+=a)}},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 r=[[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,r);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,B.vertexSchema,B.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const r=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,r)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},ua={key:0};function ga(r,e,a,o,i,s){var n;return(n=a.factor)!=null&&n.active?(t.openBlock(),t.createElementBlock("div",ua,[t.createElementVNode("div",{class:"legend-bars flex-center",style:t.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:a.bottom}])},e[0]||(e[0]=[t.createElementVNode("span",null,"°C",-1),t.createElementVNode("span",null,"-20",-1),t.createElementVNode("span",null,"-10",-1),t.createElementVNode("span",null,"0",-1),t.createElementVNode("span",null,"10",-1),t.createElementVNode("span",null,"20",-1),t.createElementVNode("span",null,"30",-1),t.createElementVNode("span",null,"40",-1)]),4)])):t.createCommentVNode("",!0)}const ba=E(fa,[["render",ga],["__scopeId","data-v-25daaa82"]]),_i="",La={name:"IdmArctic",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new H,etime:void 0,right:10}},watch:{"factor.version":{handler(){var r;(r=this.factor)!=null&&r.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var r;this.right=(((r=document.getElementsByClassName("right-bar")[0])==null?void 0:r.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const r=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(r+e),console.log("[water-temp] add elapsed: ",a,", total: ",e+=a)}},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 r=[[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,r);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,B.vertexSchema,B.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const r=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,r)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},wa={key:0};function xa(r,e,a,o,i,s){var n;return(n=a.factor)!=null&&n.active?(t.openBlock(),t.createElementBlock("div",wa,[t.createElementVNode("div",{class:"legend-bars flex-center",style:t.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:a.bottom}])},e[0]||(e[0]=[t.createElementVNode("span",null,"m",-1),t.createElementVNode("span",null,"0",-1),t.createElementVNode("span",null,"0.5",-1),t.createElementVNode("span",null,"1",-1),t.createElementVNode("span",null,"1.5",-1),t.createElementVNode("span",null,"2",-1)]),4)])):t.createCommentVNode("",!0)}const _a=E(La,[["render",xa],["__scopeId","data-v-5bb73794"]]);/*! Element Plus Icons Vue v2.3.1 */var va=t.defineComponent({name:"LocationFilled",__name:"location-filled",setup(r){return(e,a)=>(t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[t.createElementVNode("path",{fill:"currentColor",d:"M512 928c23.936 0 117.504-68.352 192.064-153.152C803.456 661.888 864 535.808 864 416c0-189.632-155.84-320-352-320S160 226.368 160 416c0 120.32 60.544 246.4 159.936 359.232C394.432 859.84 488 928 512 928m0-435.2a64 64 0 1 0 0-128 64 64 0 0 0 0 128m0 140.8a204.8 204.8 0 1 1 0-409.6 204.8 204.8 0 0 1 0 409.6"})]))}}),Ca=va;const vi="",ka={name:"IdmPoint",components:{LocationFilled:Ca},props:{token:{type:String},map:{type:Object},show:{type:Boolean},ts:{type:String},timeZone:{type:Number,default:8},meteo:{type:Object}},emits:["point","meteoMore"],data(){return{showMeteo:!1,meteoData:void 0,tableData:{},currentHourData:void 0,meteoMarker:void 0,helper:V.CompanyHelper,activeIndex:1}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){this.map&&this.show&&this.handleBind()}},ts:{handler(){this.showMeteo&&this.initTableData()}},meteo:{handler(){this.meteo?(this.showMeteo=!0,this.meteoData=this.meteo,this.initTableData(),this.handleRender()):this.showMeteo=!1}}},computed:{computeTime(){return function(r,e){const a=e??0;return r?`${D(r).utcOffset(a*60).format("MMM-DD,HHmm")}`:"-"}},computeHourL(){return function(r,e){const a=e??0;return r?`${D(r).utcOffset(a).format("HH")}`:"-"}},computeHourZ(){return function(r){return r?`${D(r).utc().format("HH")}Z`:"-"}},computeWeek(){return function(r){return r?`${D(r).format("dddd")}`:"-"}},computeMMMDD(){return function(r){return r?`${D(r).format("MMM-DD")}`:"-"}},computeTimeZone(){return`(UTC ${this.timeZone<0?this.timeZone:"+"+this.timeZone})`},computeLat(){return function(r,e=4){return k.LngLatHelper.lat2pretty(r,e).pretty}},computeLng(){return function(r,e=4){return k.LngLatHelper.lng2pretty(r,e).pretty}},roundPrecision(){return function(r,e=4){return isNaN(r)?"-":k.LngLatHelper.roundPrecision(r,e)}}},mounted(){},methods:{initTableData(){var r,e,a,o,i,s,n,l,h,p,c,d,u,m,b,f,y,L,g,x,C,w,_,N,I,W,A,F,G,J,X,q,Y;this.currentHourData=(r=de.Meteo2Assist.pickHourly(this.meteoData,this.ts?D(this.ts):D()))==null?void 0:r[0],this.tableData={hours:[],utcHours:[],weatherUrls:[],temp:[],precipProbability:[],precip1h:[],visibility:[],humidity:[],windSpeed:[],windDir:[],windGust:[],sigwaveHeight:[],sigwaveDir:[],windwaveHeight:[],windwaveDir:[],windwavePeriod:[],swellHeight:[],swellDir:[],swellPeriod:[],currentSpeed:[],currentDir:[]};for(let U=0;U<8;U++){const Q=D(this.ts).clone().utc().add(3*U,"h").format();this.tableData.hours.push(Q);const z=((e=de.Meteo2Assist.pickHourly(this.meteoData,Q))==null?void 0:e[0])||{};this.tableData.weatherUrls.push((a=z.weather)==null?void 0:a.url),this.tableData.temp.push(this.roundPrecision((o=z.weather)==null?void 0:o.temp,0)),this.tableData.precipProbability.push(this.roundPrecision((s=(i=z.weather)==null?void 0:i.precip)==null?void 0:s.probability,0)),this.tableData.precip1h.push(this.roundPrecision((l=(n=z.weather)==null?void 0:n.precip)==null?void 0:l.sum,0)),this.tableData.visibility.push(this.roundPrecision((h=z.weather)==null?void 0:h.visibility,0)),this.tableData.windSpeed.push(this.roundPrecision((c=(p=z.weather)==null?void 0:p.wind)==null?void 0:c.kts,1)),this.tableData.windDir.push((u=(d=z.weather)==null?void 0:d.wind)==null?void 0:u.angle),this.tableData.windGust.push(this.roundPrecision((b=(m=z.weather)==null?void 0:m.wind)==null?void 0:b.gusts,1)),this.tableData.sigwaveHeight.push(this.roundPrecision((y=(f=z.wave)==null?void 0:f.sig)==null?void 0:y.height,1)),this.tableData.sigwaveDir.push((g=(L=z.wave)==null?void 0:L.sig)==null?void 0:g.degree),this.tableData.windwaveHeight.push(this.roundPrecision((C=(x=z.wave)==null?void 0:x.wd)==null?void 0:C.height,1)),this.tableData.windwaveDir.push((_=(w=z.wave)==null?void 0:w.wd)==null?void 0:_.degree),this.tableData.windwavePeriod.push(this.roundPrecision((I=(N=z.wave)==null?void 0:N.wd)==null?void 0:I.period,1)),this.tableData.swellHeight.push(this.roundPrecision((A=(W=z.wave)==null?void 0:W.swell)==null?void 0:A.height,1)),this.tableData.swellDir.push((G=(F=z.wave)==null?void 0:F.swell)==null?void 0:G.degree),this.tableData.swellPeriod.push(this.roundPrecision((X=(J=z.wave)==null?void 0:J.swell)==null?void 0:X.period,1)),this.tableData.currentSpeed.push(this.roundPrecision((q=z.current)==null?void 0:q.speed,1)),this.tableData.currentDir.push((Y=z.current)==null?void 0:Y.degree)}},handleSelectTab(r){this.activeIndex=r},handleBind(){var r,e;this.show?((r=this.map)==null||r.on("click",this.handleClick),this.map.getCanvas().style.cursor="pointer"):((e=this.map)==null||e.off("click",this.handleClick),this.map.getCanvas().style.cursor="grab",this.showMeteo=!1)},handleClick(r){r.originalEvent.stopPropagation();const e=r.originalEvent.target.className;if(e.indexOf("close")>-1)this.showMeteo=!1;else if(e==="more")this.$emit("meteoMore",this.meteoData);else if(e==="mapboxgl-canvas")this.$emit("point",r.lngLat);else return!1},handleRender(){var e;const r=document.getElementById("point-meteo");this.meteoData&&(this.meteoMarker?(e=this.meteoMarker)==null||e.setLngLat([this.meteoData.lng,this.meteoData.lat]):this.meteoMarker=new j.Marker(r).setLngLat([this.meteoData.lng,this.meteoData.lat]).addTo(this.map))}}},Ea={id:"point-meteo",class:"point-meteo"},Sa={class:"meteo-box"},Na={class:"header-box flex-between"},Pa={class:"flex-center"},za={class:"lnglat"},Ta={class:"main-box"},Va={class:"summary-row flex-between"},Da={class:"summary flex-center"},Ba=["src"],Ia={class:"temp"},Ra={class:"des info"},Wa={class:"flex-start"},Aa={class:"flex-start"},Ma={class:"flex-start"},Oa={class:"date flex-col-center-end"},Fa={class:""},ja={class:""},$a={class:"detail-box"},Ha={class:"menu-header flex-start"},Ua={key:0,class:"basic-table"},Za={class:"day"},Ga={class:"hour"},Ja={class:"icon"},Xa=["src"],qa={class:"text"},Ya={class:"text"},Qa={class:"text"},Ka={class:"text"},er={key:1,class:"wave-current-table"},tr={class:"day"},ar={class:"hour"},rr={class:"icon"},ir=["src"],or={class:"text"},sr={class:"text"},nr={class:"text"},lr={class:"text"};function cr(r,e,a,o,i,s){var h,p,c,d,u,m,b,f,y,L,g,x,C,w;const n=t.resolveComponent("LocationFilled"),l=t.resolveComponent("ElIcon");return t.openBlock(),t.createElementBlock("div",null,[t.withDirectives(t.createElementVNode("div",Ea,[t.createElementVNode("div",Sa,[t.createElementVNode("div",Na,[t.createElementVNode("div",Pa,[t.createVNode(l,{size:"22"},{default:t.withCtx(()=>[t.createVNode(n)]),_:1}),t.createElementVNode("div",za,t.toDisplayString(s.computeLat((h=i.meteoData)==null?void 0:h.lat))+","+t.toDisplayString(s.computeLng((p=i.meteoData)==null?void 0:p.lng)),1)]),t.createElementVNode("div",{class:"iconfont close",onClick:e[0]||(e[0]=_=>i.showMeteo=!1)},"")]),t.createElementVNode("div",Ta,[t.createElementVNode("div",Va,[t.createElementVNode("div",Da,[t.createElementVNode("img",{class:"iconfont icon",style:{"margin-right":"5px"},src:(d=(c=i.currentHourData)==null?void 0:c.weather)==null?void 0:d.url},null,8,Ba),t.createElementVNode("div",Ia,[t.createElementVNode("span",null,[t.createTextVNode(t.toDisplayString(s.roundPrecision((m=(u=i.currentHourData)==null?void 0:u.weather)==null?void 0:m.temp,0)),1),e[4]||(e[4]=t.createElementVNode("span",{style:{"font-size":"14px"}},"°C",-1))])]),t.createElementVNode("div",Ra,[t.createElementVNode("div",Wa,[e[5]||(e[5]=t.createElementVNode("label",null,"Precip : ",-1)),t.createElementVNode("span",null,t.toDisplayString(s.roundPrecision((y=(f=(b=i.currentHourData)==null?void 0:b.weather)==null?void 0:f.precip)==null?void 0:y.sum,0))+" mm",1)]),t.createElementVNode("div",Aa,[e[6]||(e[6]=t.createElementVNode("label",null,"Visibility : ",-1)),t.createElementVNode("span",null,t.toDisplayString(s.roundPrecision((g=(L=i.currentHourData)==null?void 0:L.weather)==null?void 0:g.visibility,0))+" nm",1)]),t.createElementVNode("div",Ma,[e[7]||(e[7]=t.createElementVNode("label",null,"Wind : ",-1)),t.createElementVNode("span",null,t.toDisplayString(s.roundPrecision((w=(C=(x=i.currentHourData)==null?void 0:x.weather)==null?void 0:C.wind)==null?void 0:w.kts,1))+" kts",1)])])]),t.createElementVNode("div",Oa,[t.createElementVNode("div",Fa,t.toDisplayString(s.computeTime(a.ts,a.timeZone)),1),t.createElementVNode("div",ja,t.toDisplayString(s.computeTimeZone),1)])]),t.createElementVNode("div",$a,[t.createElementVNode("div",Ha,[t.createElementVNode("div",{class:t.normalizeClass(["menu-item",i.activeIndex===1?"active":""]),onClick:e[1]||(e[1]=t.withModifiers(_=>s.handleSelectTab(1),["prevent"]))},"Basis",2),t.createElementVNode("div",{class:t.normalizeClass(["menu-item",i.activeIndex===2?"active":""]),onClick:e[2]||(e[2]=t.withModifiers(_=>s.handleSelectTab(2),["prevent"]))},"Wave & Current",2)]),i.activeIndex===1?(t.openBlock(),t.createElementBlock("table",Ua,[t.createElementVNode("tr",Za,[e[8]||(e[8]=t.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[t.createTextVNode("Hours"),t.createElementVNode("span",{class:"unit"})],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.hours,_=>(t.openBlock(),t.createElementBlock("th",{rowspan:"1",colspan:"1",key:Math.random()},t.toDisplayString(s.computeHourL(_,a.timeZone)),1))),128))]),t.createElementVNode("tr",Ga,[e[9]||(e[9]=t.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},null,-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.hours,_=>(t.openBlock(),t.createElementBlock("th",{rowspan:"1",colspan:"1",key:Math.random()},t.toDisplayString(s.computeHourZ(_)),1))),128))]),t.createElementVNode("tr",Ja,[e[10]||(e[10]=t.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},null,-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.weatherUrls,_=>(t.openBlock(),t.createElementBlock("th",{rowspan:"1",colspan:"1",key:Math.random()},[t.createElementVNode("img",{class:"iconfont weather-icon",src:_},null,8,Xa)]))),128))]),t.createElementVNode("tr",qa,[e[11]||(e[11]=t.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[t.createTextVNode("Temp"),t.createElementVNode("span",{class:"unit"},"°C")],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.temp,_=>(t.openBlock(),t.createElementBlock("td",{rowspan:"1",colspan:"1",key:Math.random()},t.toDisplayString(_),1))),128))]),t.createElementVNode("tr",Ya,[e[12]||(e[12]=t.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[t.createTextVNode("Precip"),t.createElementVNode("span",{class:"unit"},"mm")],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.precip1h,_=>(t.openBlock(),t.createElementBlock("td",{rowspan:"1",colspan:"1",key:Math.random()},t.toDisplayString(_),1))),128))]),t.createElementVNode("tr",Qa,[e[13]||(e[13]=t.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[t.createTextVNode("Visibility"),t.createElementVNode("span",{class:"unit"},"nm")],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.visibility,_=>(t.openBlock(),t.createElementBlock("td",{rowspan:"1",colspan:"1",key:Math.random()},t.toDisplayString(_),1))),128))]),t.createElementVNode("tr",Ka,[e[14]||(e[14]=t.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[t.createTextVNode("Wind"),t.createElementVNode("span",{class:"unit"},"kts")],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.windSpeed,(_,N)=>(t.openBlock(),t.createElementBlock("td",{rowspan:"1",colspan:"1",key:Math.random()},[t.createElementVNode("span",{class:"iconfont icon blue",style:t.normalizeStyle({display:"inline-block",transform:`rotate(${i.tableData.windDir[N]}deg)`})},"",4),t.createElementVNode("span",null,t.toDisplayString(_),1)]))),128))])])):t.createCommentVNode("",!0),i.activeIndex===2?(t.openBlock(),t.createElementBlock("table",er,[t.createElementVNode("tr",tr,[e[15]||(e[15]=t.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[t.createTextVNode("Hours"),t.createElementVNode("span",{class:"unit"})],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.hours,_=>(t.openBlock(),t.createElementBlock("th",{rowspan:"1",colspan:"1",key:Math.random()},t.toDisplayString(s.computeHourL(_,a.timeZone)),1))),128))]),t.createElementVNode("tr",ar,[e[16]||(e[16]=t.createElementVNode("th",{rowspan:"1",colspan:"1"},null,-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.hours,_=>(t.openBlock(),t.createElementBlock("th",{rowspan:"1",colspan:"1",key:Math.random()},t.toDisplayString(s.computeHourZ(_)),1))),128))]),t.createElementVNode("tr",rr,[e[17]||(e[17]=t.createElementVNode("th",{rowspan:"1",colspan:"1"},null,-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.weatherUrls,_=>(t.openBlock(),t.createElementBlock("th",{rowspan:"1",colspan:"1",key:Math.random()},[t.createElementVNode("img",{class:"iconfont weather-icon",src:_},null,8,ir)]))),128))]),t.createElementVNode("tr",or,[e[18]||(e[18]=t.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[t.createTextVNode("Sig Wave"),t.createElementVNode("span",{class:"unit"},"m")],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.sigwaveHeight,(_,N)=>(t.openBlock(),t.createElementBlock("td",{rowspan:"1",colspan:"1",key:Math.random()},[t.createElementVNode("span",{class:"iconfont icon blue",style:t.normalizeStyle({display:"inline-block",transform:`rotate(${i.tableData.sigwaveDir[N]}deg)`})},"",4),t.createElementVNode("span",null,t.toDisplayString(_),1)]))),128))]),t.createElementVNode("tr",sr,[e[19]||(e[19]=t.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[t.createTextVNode("Wind Wave"),t.createElementVNode("span",{class:"unit"},"m")],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.windwaveHeight,(_,N)=>(t.openBlock(),t.createElementBlock("td",{rowspan:"1",colspan:"1",key:Math.random()},[t.createElementVNode("span",{class:"iconfont icon orange",style:t.normalizeStyle({display:"inline-block",transform:`rotate(${i.tableData.sigwaveDir[N]}deg)`})},"",4),t.createElementVNode("span",null,t.toDisplayString(_),1)]))),128))]),t.createElementVNode("tr",nr,[e[20]||(e[20]=t.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[t.createTextVNode("Swell"),t.createElementVNode("span",{class:"unit"},"m")],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.swellHeight,(_,N)=>(t.openBlock(),t.createElementBlock("td",{rowspan:"1",colspan:"1",key:Math.random()},[t.createElementVNode("span",{class:"iconfont icon orange",style:t.normalizeStyle({display:"inline-block",transform:`rotate(${i.tableData.swellDir[N]}deg)`})},"",4),t.createElementVNode("span",null,t.toDisplayString(_),1)]))),128))]),t.createElementVNode("tr",lr,[e[21]||(e[21]=t.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[t.createTextVNode("Current"),t.createElementVNode("span",{class:"unit"},"kts")],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.currentSpeed,(_,N)=>(t.openBlock(),t.createElementBlock("td",{rowspan:"1",colspan:"1",key:Math.random()},[t.createElementVNode("span",{class:"iconfont icon gray",style:t.normalizeStyle({display:"inline-block",transform:`rotate(${i.tableData.currentDir[N]}deg)`})},"",4),t.createElementVNode("span",null,t.toDisplayString(_),1)]))),128))])])):t.createCommentVNode("",!0)])]),r.$attrs.permission&i.helper.LEVEL.Prime?(t.openBlock(),t.createElementBlock("div",{key:0,class:"more",onClick:e[3]||(e[3]=t.withModifiers((..._)=>r.handleMore&&r.handleMore(..._),["prevent"]))},e[22]||(e[22]=[t.createElementVNode("span",{class:"more"},"More >>",-1)]))):t.createCommentVNode("",!0)])],512),[[t.vShow,i.showMeteo]])])}const hr=E(ka,[["render",cr],["__scopeId","data-v-1f6333db"]]),dr={name:"IdmWarZone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"war-zone-source",zoneLayer:"war-zone-layer",zoneLabelLayer:"war-zone-label-layer"}},watch:{zone:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.zone&&(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-color":"#f44336","fill-opacity":.4}},this.beforeLayer),this.map.addLayer({id:this.zoneLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":1,"line-color":"#f44336"}},this.beforeLayer),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-1]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneLayer+"-border")&&this.map.removeLayer(this.zoneLayer+"-border"),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function pr(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const mr=E(dr,[["render",pr]]),yr={name:"IdmGmdssArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"gmdss-area-source",areaLayer:"gmdss-area-layer",areaLabelLayer:"gmdss-area-label-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":["match",["get","val"],"AreaI","#EB8996","AreaII","#6F448B","AreaIII","#3E8BD3","AreaIV","#5EBCC4","AreaV","#00AAE7","AreaVI","#9CCE6D","AreaVII","#F4AE00","AreaVIII","#EF9A85","AreaIX","#00AAA7","AreaX","#7AC49F","AreaXI","#DFDFDF","AreaXII","#FFF974","AreaXIII","#EF9A85","AreaXIV","#86A2D1","AreaXV","#EC8972","AreaXVI","#EAC2DA","AreaXVII","#B9C8E7","AreaXVIII","#BBA1C8","AreaXIX","#FAE0BD","AreaXX","#DBECC8","AreaXXI","#D496AF","#ffffff"]}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":12,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-opacity":.8,"text-color":"#000"}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function fr(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const ur=E(yr,[["render",fr]]),gr={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 r;this.map?(this.handleClear(),this.zone&&(this.map.getSource(this.source)?(r=this.map)==null||r.getSource(this.source).setData(this.zone):(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":"#05f324"}}),this.map.addLayer({id:this.zoneLayer+"-border",type:"line",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-color":"#04c021","line-width":1,"line-opacity":1}},this.beforeLayer),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-max-width":16,"text-justify":"left","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}})))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneLayer+"-border")&&this.map.removeLayer(this.zoneLayer+"-border"),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function br(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const Lr=E(gr,[["render",br]]),Ci="",wr={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 r,e;this.zone?(this.handleRender(),(r=this.map)==null||r.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(r){var o;const e=r.features[0],a=(o=this.zone)==null?void 0:o.features.filter(i=>{var s;return i.properties.id===((s=e==null?void 0:e.properties)==null?void 0:s.id)})[0];if(a){this.showZone=!0,this.form={...a.properties};const i=document.getElementById("idm-gl3-zone-info");this.marker?this.marker.setLngLat([r.lngLat.lng,r.lngLat.lat]):this.marker=new j.Marker(i).setLngLat([r.lngLat.lng,r.lngLat.lat]).setOffset([0,0]).addTo(this.map)}},handleRender(){var r;this.map?(this.handleClear(),this.zone&&(this.map.getSource(this.source)?(r=this.map)==null||r.getSource(this.source).setData(this.zone):(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.polygonLayer,type:"fill",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"fill-outline-color":"#d57d02","fill-opacity":.4,"fill-color":"#d57d02"}}),this.map.addLayer({id:this.polygonLayer+"-border",type:"line",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-width":1,"line-color":"#d57d02"}}),this.map.addLayer({id:this.lineLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["!=","disabled",!0]],paint:{"line-color":"#d57d02","line-width":2}}),this.map.addLayer({id:this.polygonLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-image":"alert","icon-size":.08,"icon-allow-overlap":!0,"icon-rotation-alignment":"viewport"},paint:{"icon-opacity":.8}}),this.map.addLayer({id:this.lineLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","LineString"],["!=","disabled",!0]],layout:{"symbol-placement":"line-center","icon-image":"alert","icon-size":.08,"icon-allow-overlap":!0,"icon-rotation-alignment":"viewport"},paint:{"icon-opacity":.8}}),this.map.addLayer({id:this.pointLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-image":"alert","icon-size":.08},paint:{"icon-opacity":.8}})))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.polygonLayer)&&this.map.removeLayer(this.polygonLayer),this.map.getLayer(this.polygonLayer+"-border")&&this.map.removeLayer(this.polygonLayer+"-border"),this.map.getLayer(this.polygonLabelLayer)&&this.map.removeLayer(this.polygonLabelLayer),this.map.getLayer(this.lineLayer)&&this.map.removeLayer(this.lineLayer),this.map.getLayer(this.lineLabelLayer)&&this.map.removeLayer(this.lineLabelLayer),this.map.getLayer(this.pointLayer)&&this.map.removeLayer(this.pointLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},xr={id:"idm-gl3-zone-info"},_r=["innerHTML"];function vr(r,e,a,o,i,s){var n;return t.withDirectives((t.openBlock(),t.createElementBlock("div",xr,[t.createElementVNode("div",{class:"iconfont close",onClick:e[0]||(e[0]=l=>i.showZone=!1)},""),t.createElementVNode("div",{class:"rich-context",innerHTML:(n=i.form)==null?void 0:n.name},null,8,_r)],512)),[[t.vShow,i.showZone]])}const Cr=E(wr,[["render",vr]]),ki="",kr={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(r){return k.LngLatHelper.lat2pretty(r,4).pretty}},computeLng(){return function(r){return k.LngLatHelper.lng2pretty(r,4).pretty}}},watch:{port:{handler(){var r,e;this.port?(this.handleRender(),(r=this.map)==null||r.on("click",[this.layer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.layer],this.handleClick))}}},methods:{handleClick(r){var o;const e=r.features[0],a=(o=this.port)==null?void 0:o.features.filter(i=>{var s;return i.properties.id===((s=e==null?void 0:e.properties)==null?void 0:s.id)})[0];if(a){this.showPort=!0,this.form={...a.properties},this.form.lng=a.geometry.coordinates[0],this.form.lat=a.geometry.coordinates[1];const i=document.getElementById("port-info");this.marker?this.marker.setLngLat([r.lngLat.lng,r.lngLat.lat]):this.marker=new j.Marker(i).setLngLat([r.lngLat.lng,r.lngLat.lat]).setOffset([0,-85]).addTo(this.map)}},handleEmit(){this.$emit("port",this.form)},handleRender(){var r;this.map?this.port&&(this.map.getSource(this.source)?(r=this.map)==null||r.getSource(this.source).setData(this.port):(this.map.addSource(this.source,{type:"geojson",data:this.port}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"port","text-anchor":"left","text-field":"{name}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[1,0]},paint:{"text-color":"rgba(0, 0, 0, 0.8)","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.showPort=!1,this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},Er={id:"port-info"},Sr={class:"port-box"},Nr={class:"flex-start"},Pr={class:"flex-start"},zr={class:"flex-start"},Tr={class:"flex-start",style:{"align-items":"flex-start"}};function Vr(r,e,a,o,i,s){return t.withDirectives((t.openBlock(),t.createElementBlock("div",Er,[t.createElementVNode("div",{class:"close iconfont",onClick:e[0]||(e[0]=n=>i.showPort=!1)},""),t.createElementVNode("div",Sr,[t.createElementVNode("div",Nr,[e[2]||(e[2]=t.createElementVNode("label",null,"Name : ",-1)),t.createElementVNode("span",{onClick:e[1]||(e[1]=(...n)=>s.handleEmit&&s.handleEmit(...n))},t.toDisplayString(i.form.name),1)]),t.createElementVNode("div",Pr,[e[3]||(e[3]=t.createElementVNode("label",null,"Position : ",-1)),t.createElementVNode("span",null,t.toDisplayString(s.computeLat(i.form.lat))+", "+t.toDisplayString(s.computeLng(i.form.lng)),1)]),t.createElementVNode("div",zr,[e[4]||(e[4]=t.createElementVNode("label",null,"LoCode : ",-1)),t.createElementVNode("span",null,t.toDisplayString(i.form.loCode||"-"),1)]),t.createElementVNode("div",Tr,[e[5]||(e[5]=t.createElementVNode("label",null,"Region : ",-1)),t.createElementVNode("span",null,t.toDisplayString(i.form.zoneName||"-"),1)])])],512)),[[t.vShow,i.showPort]])}const Dr=E(kr,[["render",Vr],["__scopeId","data-v-c07e4c45"]]),Br={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 Ir(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const Rr=E(Br,[["render",Ir]]),Wr={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 Ar(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const Mr=E(Wr,[["render",Ar]]),Or={name:"IdmVoluntaryReportingArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"vra-source",areaLayer:"vra-layer",areaLabelLayer:"vra-label-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":"#9f30f9"}},this.beforeLayer),this.map.addLayer({id:this.areaLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":1,"line-color":"#9f30f9"}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLayer+"-border")&&this.map.removeLayer(this.areaLayer+"-border"),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Fr(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const jr=E(Or,[["render",Fr]]),$r={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(r=>{r.geometry.type==="Polygon"&&r.geometry.coordinates.forEach(e=>k.LngLatHelper.convertToMonotonicLng2(e))}),this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":["match",["get","val"],"DefaultStyle","rgb(0,0,0)","JWCriskArea","rgb(0,0,0)","rgb(0,0,0)"]}},this.beforeLayer),this.map.addLayer({id:this.areaLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":.4,"line-color":"rgb(0,0,0)"}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLayer+"-border")&&this.map.removeLayer(this.areaLayer+"-border"),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Hr(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const Ur=E($r,[["render",Hr]]),Zr={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 Gr(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const Jr=E(Zr,[["render",Gr]]),Ei="",Xr={name:"IdmLatLng",props:{map:{type:Object},show:{type:Boolean},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{lngLat:void 0,source:"idm-lat-lng-source",layer:"idm-lat-lng-layer",labelLayer:"idm-lat-lng-label-layer",right:10}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){var r;this.map&&((r=this.map)==null||r.on("mousemove",this.handleMouseMove))},immediate:!0},toggleVersion:{handler(){var r,e;this.right=(((r=document.getElementsByClassName("legend-bars")[0])==null?void 0:r.clientWidth)||-10)+(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+20},immediate:!0}},methods:{handleBind(){var r,e;this.show?((r=this.map)==null||r.on("zoomend",this.handleZoomEnd),this.handleRender()):(this.handleClear(),(e=this.map)==null||e.off("zoomend",this.handleZoomEnd))},handleMouseMove(r){const e=r.lngLat,a=k.LngLatHelper.lng2pretty(e.lng,2),o=k.LngLatHelper.lat2pretty(e.lat,2);this.lngLat={lng:a,lat:o}},handleComputeLatLngs(){var o;const r=(o=this.map)==null?void 0:o.getZoom();console.log(r);let e=30;r>4?e=10:r>3&&(e=15);const a=[];for(let i=-60;i<90;i+=e)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[-180,i],[180,i]]}});for(let i=-180;i<180;i+=e)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[i,-90],[i,90]]}});for(let i=180;i>-180;i-=e)for(let s=-60;s<90;s+=e)a.push({type:"Feature",geometry:{type:"Point",coordinates:[i,s]},properties:{val:`${s>0?s+" N":s===0?s:s*-1+" S"}, ${i>0?i+" E":i*-1+" W"}`}});return a},handleZoomEnd(){var e;const r=this.handleComputeLatLngs();(e=this.map)==null||e.getSource(this.source).setData(v.featureCollection(r))},handleRender(){if(this.map){const r=this.handleComputeLatLngs();this.map.addSource(this.source,{type:"geojson",data:{type:"FeatureCollection",features:r}}),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 r,e,a,o,i,s;(r=this.map)!=null&&r.getLayer(this.layer)&&((e=this.map)==null||e.removeLayer(this.layer)),(a=this.map)!=null&&a.getLayer(this.labelLayer)&&((o=this.map)==null||o.removeLayer(this.labelLayer)),(i=this.map)!=null&&i.getSource(this.source)&&((s=this.map)==null||s.removeSource(this.source))}}};function qr(r,e,a,o,i,s){return i.lngLat?(t.openBlock(),t.createElementBlock("div",{key:0,class:"lat-lng-tip",style:t.normalizeStyle({right:i.right+"px",bottom:a.bottom})},[t.createElementVNode("span",null,t.toDisplayString(i.lngLat.lat.pretty),1),e[0]||(e[0]=t.createElementVNode("span",null,", ",-1)),t.createElementVNode("span",null,t.toDisplayString(i.lngLat.lng.pretty),1)],4)):t.createCommentVNode("",!0)}const he=E(Xr,[["render",qr],["__scopeId","data-v-73241fe7"]]),Yr={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 r,e,a,o,i,s,n,l,h,p;if(this.show)(r=this.map)==null||r.getCanvas().addEventListener("keydown",this.handleKeydown),(e=this.map)==null||e.on("mousemove",this.handleMove),(a=this.map)==null||a.on("dblclick",this.handleDblClick),(o=this.map)==null||o.on("click",this.handleClick),(i=this.map)==null||i.on("contextmenu",this.handleContextmenu),this.map&&(this.map.getCanvas().style.cursor="crosshair");else{(s=this.map)==null||s.getCanvas().removeEventListener("keydown",this.handleKeydown),(n=this.map)==null||n.off("mousemove",this.handleMove),(l=this.map)==null||l.off("dblclick",this.handleDblClick),(h=this.map)==null||h.off("click",this.handleClick),(p=this.map)==null||p.off("contextmenu",this.handleContextmenu);for(const c of this.geojson)this.handleClear(c,!0);this.geojson=[],this.map&&(this.map.getCanvas().style.cursor="grab")}},handleKeydown(r){if(r.key==="Shift"){this.navigation=this.navigation==="RL"?"GC":"RL";const a=this.geojson.at(-1).features.filter(o=>o.geometry.type==="Point");a.length&&(a.at(-1).properties.mode=this.navigation)}},handleDrag(r){var a,o,i,s,n,l,h,p,c,d;const e=(o=(a=r.target)==null?void 0:a._element)==null?void 0:o.id;if((e==null?void 0:e.split("-").length)===2){const u=this.geojson.filter(y=>y.id===e.split("-")[0])[0];this.pointMarkers[u.id].filter(y=>{var L;return((L=y._element)==null?void 0:L.id)===e})[0].setLngLat([(s=(i=r.target)==null?void 0:i._lngLat)==null?void 0:s.lng,(l=(n=r.target)==null?void 0:n._lngLat)==null?void 0:l.lat]);let b;u.features.forEach((y,L)=>{if(y.geometry.type==="Point"&&y.properties.id==e.split("-")[1]){b=L;return}});const f=u.features.filter(y=>y.geometry.type==="Point");this.handleTmpPointUpdate(u,f[b-1],{lng:(p=(h=r.target)==null?void 0:h._lngLat)==null?void 0:p.lng,lat:(d=(c=r.target)==null?void 0:c._lngLat)==null?void 0:d.lat,properties:f[b].properties},b===f.length-1?void 0:f[b+1])}},handleDragEnd(r){var a,o,i,s,n,l,h,p,c,d;const e=(o=(a=r.target)==null?void 0:a._element)==null?void 0:o.id;if((e==null?void 0:e.split("-").length)===2){const u=this.geojson.filter(f=>f.id===e.split("-")[0])[0];this.pointMarkers[u.id].filter(f=>{var y;return((y=f._element)==null?void 0:y.id)===e})[0].setLngLat([(s=(i=r.target)==null?void 0:i._lngLat)==null?void 0:s.lng,(l=(n=r.target)==null?void 0:n._lngLat)==null?void 0:l.lat]);const b=u.features.filter(f=>f.geometry.type==="Point"&&f.properties.id==e.split("-")[1])[0];b.geometry.coordinates=[(p=(h=r.target)==null?void 0:h._lngLat)==null?void 0:p.lng,(d=(c=r.target)==null?void 0:c._lngLat)==null?void 0:d.lat],u.features=u.features.filter(f=>f.geometry.type==="Point"),this.handlePointUpdate(u)}},handleContextmenu(r){var a,o,i,s;r.preventDefault(),(a=this.contextmenu)==null||a.remove();const e=(s=(i=(o=r.originalEvent)==null?void 0:o.target)==null?void 0:i.parentElement)==null?void 0:s.id;if((e==null?void 0:e.split("-").length)===2){const l=this.geojson.filter(h=>h.id===e.split("-")[0])[0].features.filter(h=>h.geometry.type==="Point");if(l.length>2&&l.filter(p=>p.properties.id===(e==null?void 0:e.split("-")[1]))[0]){const p=document.createElement("div");p.className="point-contextmenu-marker",p.innerHTML=`<span id="del-${e}" class="del-point">Del</span>`,this.contextmenu=new j.Marker(p).setOffset([24,0]).setLngLat([r.lngLat.lng,r.lngLat.lat]).addTo(this.map)}}},handleClick(r){var a,o,i,s,n;(a=this.contextmenu)==null||a.remove();const e=r.originalEvent.target.className;if(e==="marker-close"){const l=(i=(o=r.originalEvent)==null?void 0:o.srcElement)==null?void 0:i.id,h=this.geojson.filter(p=>p.id===l)[0];h&&this.handleClear(h,!0),this.geojson=this.geojson.filter(p=>p.id!==l)}else if(e==="del-point"){const l=(n=(s=r.originalEvent.target.id)==null?void 0:s.replace("del-",""))==null?void 0:n.split("-"),h=this.geojson.filter(p=>p.id===l[0])[0];h.features=h.features.filter(p=>p.geometry.type==="Point"&&p.properties.id!==l[1]),this.handlePointUpdate(h)}else if(e!=="marker-label"){let l=this.geojson.at(-1);l||(l=v.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(l)),l.features=l.features.filter(p=>p.geometry.type==="Point");const h=v.feature({type:"Point",coordinates:[r.lngLat.lng,r.lngLat.lat]},{id:new Date().getTime().toString(),mode:this.navigation});l.features.push(h),this.handlePointUpdate(l)}},handlePointUpdate(r){const e=r.features;if(e.length>1){let a=0;const o=[];for(let i=1;i<e.length;i++){const s=e[i-1],n=e[i],l=s.properties,h={lng:s.geometry.coordinates[0],lat:s.geometry.coordinates[1]},p={lng:n.geometry.coordinates[0],lat:n.geometry.coordinates[1]},c=k.LaneHelper.calculateDistance(h,p,l.mode==="RL",2),d=k.LaneHelper.calculateBearing(h,p,l.mode==="RL",2);a=k.LngLatHelper.roundPrecision(a+c,2);let u;l.mode==="RL"?u=k.LngLatHelper.convertToMonotonicLng([h,p]):u=k.LngLatHelper.convertToMonotonicLng(k.LaneHelper.interpolateCoordinates(h,p,200));const m=v.lineString(u.map(b=>[b.lng,b.lat]));m.properties.dist=c,m.properties.bearing=d,m.properties.total=a,o.push(m)}e.push(...o),r.total=a}return this.handleRender(r),r},handleTmpPointUpdate(r,e,a,o){const i=v.featureCollection([]);let s,n;if(e){const h=e.properties,p={lng:e.geometry.coordinates[0],lat:e.geometry.coordinates[1]},c={lng:a.lng,lat:a.lat};s=k.LaneHelper.calculateDistance(p,c,h.mode==="RL",2),n=k.LaneHelper.calculateBearing(p,c,h.mode==="RL",2);let d;h.mode==="RL"?d=k.LngLatHelper.convertToMonotonicLng([p,c]):d=k.LngLatHelper.convertToMonotonicLng(k.LaneHelper.interpolateCoordinates(p,c,200));const u=v.lineString(d.map(m=>[m.lng,m.lat]));u.properties.dist=s,u.properties.bearing=n,i.features.push(u)}if(o){const h=a.properties,p=a,c={lng:o.geometry.coordinates[0],lat:o.geometry.coordinates[1]};s=k.LaneHelper.calculateDistance(p,c,h.mode==="RL",2),n=k.LaneHelper.calculateBearing(p,c,h.mode==="RL",2);let d;h.mode==="RL"?d=k.LngLatHelper.convertToMonotonicLng([p,c]):d=k.LngLatHelper.convertToMonotonicLng(k.LaneHelper.interpolateCoordinates(p,c,200));const u=v.lineString(d.map(m=>[m.lng,m.lat]));u.properties.dist=s,u.properties.bearing=n,i.features.push(u)}this.map.getSource(this.tmpSource)?this.map.getSource(this.tmpSource).setData(i):this.map.addSource(this.tmpSource,{type:"geojson",data:i}),this.map.getLayer(this.tmpLayer)||this.map.addLayer({id:this.tmpLayer,type:"line",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#F44336","line-width":2,"line-opacity":1,"line-dasharray":[3,2]}}),this.map.getLayer(this.tmpLabelLayer)||this.map.addLayer({id:this.tmpLabelLayer,type:"symbol",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist} nm","text-rotation-alignment":"map","text-size":12},paint:{"text-opacity":1,"text-color":"#fff","text-halo-color":"#F44336","text-halo-width":4,"text-halo-blur":0}});let l;if(o?l='<div class="marker-label">Drag and drop</div>':l=`<div class="marker-label">Tol distance: <b>${k.LngLatHelper.roundPrecision((r.total??0)+s,2)}</b>nm, bearing: <b>${n}</b>°</div><div class="marker-label">${this.navigation==="RL"?"RL":"GC"} mode, using 'Shift' to switch</div><div class="marker-label">Double click to end</div>`,this.tipMarker)this.tipMarker._element.innerHTML=l,this.tipMarker.setLngLat([a.lng,a.lat]);else{const h=document.createElement("div");h.className="tip-marker",h.innerHTML=l,this.tipMarker=new j.Marker(h).setOffset([140,0]).setLngLat([a.lng,a.lat]).addTo(this.map)}},handleMove(r){this.map.getCanvas().style.cursor="crosshair";let e=this.geojson.at(-1);e||(e=v.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e));const a=e.features.filter(o=>o.geometry.type==="Point");a!=null&&a.length&&this.handleTmpPointUpdate(e,a.at(-1),{lng:r.lngLat.lng,lat:r.lngLat.lat})},handleDblClick(r){r.preventDefault();let e=this.geojson.at(-1);e.closed=!0,this.handleRender(e),e=v.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e)},handleRender(r){var e;if((e=r==null?void 0:r.features)!=null&&e.length){const a=`${r.id}-${this.source}`,o=`${r.id}-${this.layer}`,i=`${r.id}-${this.labelLayer}`;this.map.getSource(a)?this.map.getSource(a).setData(r):this.map.addSource(a,{type:"geojson",data:r}),this.handleClear(r,!1),this.map.addLayer({id:o,type:"line",source:a,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#F44336","line-width":2}}),this.map.addLayer({id:i,type:"symbol",source:a,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=r.features.filter(n=>n.geometry.type==="Point");for(const n of s){const l=document.createElement("div");l.id=`${r.id}-${n.properties.id}`,l.className=`${r.closed?"point-marker closed":"point-marker"}`,l.innerHTML='<div class="marker-circle"></div>';const h=new j.Marker({element:l,draggable:!0,contextmenu:!0}).setLngLat(n.geometry.coordinates).addTo(this.map);h.on("drag",this.handleDrag),h.on("dragend",this.handleDragEnd),this.pointMarkers[r.id]?this.pointMarkers[r.id].push(h):this.pointMarkers[r.id]=[h]}if(r.closed){const n=s.at(-1),h=r.features.filter(c=>c.geometry.type==="LineString").at(-1),p=document.createElement("div");p.className="point-summary-marker",p.innerHTML=`<div id="${r.id}" class="marker-close">×</div><div class="marker-label">Tol: ${h.properties.total}nm</div>`,this.closeMarkers[r.id]=new j.Marker(p).setOffset([60,0]).setLngLat(n.geometry.coordinates).addTo(this.map)}}},handleClear(r,e=!0){var s,n,l,h,p,c,d,u,m;const a=`${r.id}-${this.source}`,o=`${r.id}-${this.layer}`,i=`${r.id}-${this.labelLayer}`;(s=this.map)!=null&&s.getLayer(o)&&this.map.removeLayer(o),(n=this.map)!=null&&n.getLayer(i)&&this.map.removeLayer(i),(l=this.map)!=null&&l.getLayer(this.tmpLayer)&&this.map.removeLayer(this.tmpLayer),(h=this.map)!=null&&h.getLayer(this.tmpLabelLayer)&&this.map.removeLayer(this.tmpLabelLayer),(p=this.closeMarkers[r.id])==null||p.remove(),this.closeMarkers[r.id]=void 0,(c=this.pointMarkers[r.id])==null||c.forEach(b=>{b==null||b.remove()}),this.pointMarkers[r.id]=[],(d=this.tipMarker)==null||d.remove(),this.tipMarker=void 0,e&&((u=this.map)!=null&&u.getSource(a))&&this.map.removeSource(a),e&&((m=this.map)!=null&&m.getSource(this.tmpSource))&&this.map.removeSource(this.tmpSource)}}};function Qr(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const Kr=E(Yr,[["render",Qr]]),Si="",ei={name:"IdmENC",props:{map:{type:Object},enabled:{type:Boolean},beforeLayer:{type:String,default:"grayland"},bottom:{type:String,default:"280px"},token:{type:String,default:""},toggleVersion:{type:Number},permission:{type:Number}},emits:["enc"],data(){return{helper:V.CompanyHelper,vendor:this.$attrs.permission&V.CompanyHelper.LEVEL.Supper?"hi":"i4",right:10}},watch:{vendor:{handler(){this.$emit("enc",this.vendor)},immediate:!0},toggleVersion:{handler(){var r;this.right=(((r=document.getElementsByClassName("right-bar")[0])==null?void 0:r.clientWidth)||0)+10},immediate:!0}},methods:{}},ti={key:0},ai={class:"bar-item"};function ri(r,e,a,o,i,s){const n=t.resolveComponent("ElTooltip");return a.enabled&&a.permission&i.helper.LEVEL.Supper?(t.openBlock(),t.createElementBlock("div",ti,[t.createElementVNode("div",{class:"menu-bar-box",style:t.normalizeStyle({position:"absolute",right:i.right+"px",bottom:a.bottom})},[t.createElementVNode("div",ai,[t.createVNode(n,{placement:"left",effect:"light",content:"Hifleet","show-after":1e3},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(i.vendor==="hi"?"menu-icon active":"menu-icon"),onClick:e[0]||(e[0]=l=>i.vendor="hi")},e[2]||(e[2]=[t.createElementVNode("span",{class:"iconfont"},"HI",-1)]),2)]),_:1}),t.createVNode(n,{placement:"left",effect:"light",content:"I4insight","show-after":1e3},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(i.vendor==="i4"?"menu-icon active":"menu-icon"),onClick:e[1]||(e[1]=l=>i.vendor="i4")},e[3]||(e[3]=[t.createElementVNode("span",{class:"iconfont"},"I4",-1)]),2)]),_:1})])],4)])):t.createCommentVNode("",!0)}const ii=E(ei,[["render",ri],["__scopeId","data-v-150235f7"]]),Ni="",oi={name:"IdmGLV2",components:{IdmGlLayer:dt,IdmWindBarb:ft,IdmWindParticle:Lt,IdmCurrents:vt,IdmCurrentParticle:St,IdmSigWave:zt,IdmSwell:Dt,IdmPrmsl:Rt,IdmIceberg:Mt,IdmTropicals:ce,IdmPrecip3h:sa,IdmVisibility:ha,IdmWaterTemp:ya,IdmTemp:ba,IdmArctic:_a,IdmWarZone:mr,IdmGmdssArea:ur,IdmEcaZone:Lr,IdmAlertZone:Cr,IdmPort:Dr,IdmLoadLine:Rr,IdmTimezone:Mr,IdmVRA:jr,IdmSpecialArea:Ur,IdmTerminator:Jr,IdmLatLng:he,IdmMeasure:Kr,IdmPoint:hr,IdmENC:ii},props:{map:{type:Object,default:void 0},token:{type:String},ts:{type:String},beforeLayer:{type:String,default:""},toggleVersion:{type:Number}},emits:["toggleVersion","activeWeatherLayers"],data(){return{weatherLayers:{},activeWeatherLayers:[],weatherWeight:0,otherLayers:{},otherWeight:0,showCoord:!1,showMeasure:!1,showPoint:!1,show3d:!1,meteo:void 0,source:"",gateway:"https://cbe.idmwx.com",mapProjection:"mercator",zoom:6,viewport:void 0,particleFactor:void 0,showRampColor:!1,activeWindLayer:!1,showWindFeather:!1,showWindParticle:!1,showCurrentIsoband:!1,showCurrentParticle:!1,enc:"",defaultMeteoToken:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNseTVudHJzYzAwNWUwbHBsZHkyaDRqczMiLCJyb2xlIjoxLCJuYW1lIjoiZmFrZUBvcm13eC5jb20iLCJwbGF0SWQiOiJnZDBtdDFkIiwiY29tcGFueSI6eyJpZCI6bnVsbCwiY2hpbGRyZW4iOltdfSwiaWF0IjoxNzIzMDI0MDI0LCJleHAiOjM5MzA1NDQwMjR9.RrKcdcMnq-FxBLJQ-i6lx2FscDE46y8EvHIemPW4HTg",helper:new pe}},watch:{ts:{handler(r,e){r&&e&&D(r).utc().format("yyyy-MM-DD HH")!==D(e).utc().format("yyyy-MM-DD HH")&&this.$nextTick(()=>{this.handleDateChange({tropicals:!1})})},immediate:!0},map:{handler(){this.map&&(this.map.on("zoomend",this.handleDragEndWithZoom4Json),this.map.on("dragend",this.handleDragEndWithZoom4Json),this.map.on("move",this.handleDragEndWithZoom4Image),this.viewport=new oe(this.map),this.handleRampColorInitial())},immediate:!0},enc:{handler(r,e){var a,o,i,s,n,l,h,p;r?((o=(a=this.map)==null?void 0:a.getLayer(r))==null||o.setLayoutProperty("visibility","visible"),(s=(i=this.map)==null?void 0:i.getLayer(e))==null||s.setLayoutProperty("visibility","none")):((l=(n=this.map)==null?void 0:n.getLayer("i4"))==null||l.setLayoutProperty("visibility","none"),(p=(h=this.map)==null?void 0:h.getLayer("hi"))==null||p.setLayoutProperty("visibility","none"))}},activeWeatherLayers:{handler(){var r,e,a,o,i,s,n,l,h,p,c,d,u,m,b,f,y,L;if(!this.map)return!1;this.activeWeatherLayers.length>0?((e=(r=this.map)==null?void 0:r.getLayer(this.enc))==null||e.setLayoutProperty("visibility","none"),(o=(a=this.map)==null?void 0:a.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))==null||o.setLayoutProperty("visibility","visible"),(s=this.map)!=null&&s.getLayer((i=this.viewport)==null?void 0:i.rampColorLayer)&&((n=this.map)!=null&&n.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&this.mapProjection==="mercator"&&((h=this.map)==null||h.moveLayer((l=this.viewport)==null?void 0:l.rampColorLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)),(c=this.map)!=null&&c.getLayer((p=this.viewport)==null?void 0:p.particleLayer)&&((d=this.map)!=null&&d.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&this.mapProjection==="mercator"&&((m=this.map)==null||m.moveLayer((u=this.viewport)==null?void 0:u.particleLayer,this.helper.mapboxCustomer.layers.countryBoundary.id))):((f=(b=this.map)==null?void 0:b.getLayer(this.enc))==null||f.setLayoutProperty("visibility","visible"),(L=(y=this.map)==null?void 0:y.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))==null||L.setLayoutProperty("visibility","none")),this.$emit("activeWeatherLayers",this.activeWeatherLayers)},immediate:!0}},methods:{async fetchWeatherLayers(r={tropicals:!1}){var i,s,n,l,h,p,c,d;const e=new Date().valueOf();let a=0,o=0;if(this.map){const u=((i=this.map)==null?void 0:i.getZoom())+1,m=(s=this.map)==null?void 0:s.getBounds(),b=`${m._sw.lng},${m._sw.lat},${m._ne.lng},${m._ne.lat}`;if(this.particleFactor){const f=V.LayerHelper.WEATHER_LAYERS.find(y=>{var L;return((L=y.peer)==null?void 0:L.weight)===this.particleFactor.weight});this.particleFactor.particle?this.weatherWeight=this.weatherWeight&f.weight?this.weatherWeight:this.weatherWeight+f.weight:this.weatherWeight=this.weatherWeight&f.weight?this.weatherWeight-f.weight:this.weatherWeight}if(this.weatherWeight>0){let f=this.weatherWeight,y;if(r.tropicals||this.weatherWeight&256&&(y=this.weatherLayers.tropicals,y&&(f-=256,y.version=Math.random()+1)),f>0){const L=await $.get(`${this.gateway}/api/arc/weather/layers/links?l=${f}&v=${this.source}&z=${u}&bbox=${b}&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(o=new Date().valueOf()-(e+a),console.log("weather links elapsed: ",o,", total: ",a+=o),((n=L==null?void 0:L.data)==null?void 0:n.code)===0){const g=(l=L==null?void 0:L.data)==null?void 0:l.data,x=[];for(const w in g)w==="ice-edge"&&(g[w]="https://idm-hz.oss-cn-hangzhou.aliyuncs.com/test/sea_ice_contours.geojson"),w!=="tropicals"&&x.push($.get(g[w],{headers:{Authorization:this.token||this.defaultMeteoToken,key:w},responseType:/\.(jpg|png)$/.test(g[w])?"blob":"json"}).catch(_=>{console.log(`[${w}] fetch layer error: ${_}`)}));const C=await Promise.all(x);this.weatherLayers={},C.map(w=>{var I,W,A,F;const _=((I=w==null?void 0:w.data)==null?void 0:I.data)||(w==null?void 0:w.data),N=(A=(W=w==null?void 0:w.config)==null?void 0:W.headers)==null?void 0:A.key;N&&_&&(this.weatherLayers[N]={raw:_,type:((F=w==null?void 0:w.config)==null?void 0:F.responseType)==="blob"?"image":"json",etime:this.ts})}),g.tropicals&&$.get(g.tropicals,{headers:{Authorization:this.token||this.defaultMeteoToken,key:"tropicals"}}).then(w=>{var I,W,A;const _=k.TropicalHelper.convert2Geojson(((I=w==null?void 0:w.data)==null?void 0:I.data)||(w==null?void 0:w.data)),N=(A=(W=w==null?void 0:w.config)==null?void 0:W.headers)==null?void 0:A.key;this.weatherLayers[N]={data:_,active:!0,cached:!1,type:"json",etime:this.ts,version:Math.random()+1}})}if(o=new Date().valueOf()-(e+a),console.log("weather layers elapsed: ",o,", total: ",a+=o),this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const g=(h=this.weatherLayers["swell-direction"])==null?void 0:h.raw,x=(p=this.weatherLayers["swell-height"])==null?void 0:p.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers.swell={type:"json",direction:g,height:{raw:x},etime:this.ts}}if(this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const g=(c=this.weatherLayers["current-direction"])==null?void 0:c.raw,x=(d=this.weatherLayers["current-speed"])==null?void 0:d.raw;delete this.weatherLayers["current-direction"],delete this.weatherLayers["current-speed"],this.weatherLayers.current={type:"json",direction:g,speed:{raw:x},etime:this.ts}}}y&&(y.etime=this.ts,y.cached=!0,this.weatherLayers.tropicals=y)}this.handleWeatherLayerToggle(),this.handleDragEndWithZoom4Json()}this.$emit("toggleVersion",Math.random())},async fetchOtherLayers(r={all:!1,dayNight:!1,enc:!1}){var e,a,o,i;if(this.map){let s=this.otherWeight;if(s){let n=!1;if(this.otherWeight&2048&&(s=this.otherWeight-2048,n=!0),s){if(r.all){const l=await $.get(`${this.gateway}/api/arc/other/layers/links?l=${s}&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(((e=l==null?void 0:l.data)==null?void 0:e.code)===0){const h=(a=l==null?void 0:l.data)==null?void 0:a.data,p=[];for(const d in h)p.push($.get(h[d],{headers:{Authorization:this.token||this.defaultMeteoToken,key:d}}));const c=await Promise.all(p);this.otherLayers={enc:n},c.map(d=>{var b,f,y;const u=((b=d==null?void 0:d.data)==null?void 0:b.data)||(d==null?void 0:d.data),m=(y=(f=d==null?void 0:d.config)==null?void 0:f.headers)==null?void 0:y.key;this.otherLayers[m]=u})}}else if(r.dayNight&&s&1024){const l=await $.get(`${this.gateway}/api/arc/other/layers/links?l=1024&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(((o=l==null?void 0:l.data)==null?void 0:o.code)===0){const h=(i=l==null?void 0:l.data)==null?void 0:i.data,p=[];for(const d in h)p.push($.get(h[d],{headers:{Authorization:this.token||this.defaultMeteoToken,key:d}}));(await Promise.all(p)).map(d=>{var b,f,y;const u=((b=d==null?void 0:d.data)==null?void 0:b.data)||(d==null?void 0:d.data),m=(y=(f=d==null?void 0:d.config)==null?void 0:f.headers)==null?void 0:y.key;this.otherLayers[m]=u})}}}else this.otherLayers={enc:n}}else this.otherLayers={};this.handleBeforeLayerToggle()}},handleRampColorState(){var r;if(this.showRampColor=!1,this.showWindParticle=!1,this.showCurrentParticle=!1,(r=this.particleFactor)!=null&&r.particle)this.showRampColor=!0,this.particleFactor.key==="wind"&&(this.showWindParticle=!0),this.particleFactor.key==="current"&&(this.showCurrentParticle=!0);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 r,e,a,o,i,s,n,l,h,p,c,d;this.viewport.map.getSource((r=this.viewport)==null?void 0:r.rampColorSource)||this.viewport.map.addSource((e=this.viewport)==null?void 0:e.rampColorSource,{type:"canvas",canvas:(a=this.viewport)==null?void 0:a.rampColorCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((o=this.viewport)==null?void 0:o.rampColorLayer)||this.viewport.map.addLayer({type:"raster",id:(i=this.viewport)==null?void 0:i.rampColorLayer,source:(s=this.viewport)==null?void 0:s.rampColorSource,layout:{visibility:"none"}},this.beforeLayer),this.viewport.map.getSource((n=this.viewport)==null?void 0:n.particleSource)||this.viewport.map.addSource((l=this.viewport)==null?void 0:l.particleSource,{type:"canvas",canvas:(h=this.viewport)==null?void 0:h.particleCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((p=this.viewport)==null?void 0:p.particleLayer)||this.viewport.map.addLayer({type:"raster",id:(c=this.viewport)==null?void 0:c.particleLayer,source:(d=this.viewport)==null?void 0:d.particleSource,layout:{visibility:"none"}},this.beforeLayer)},handleDragEndWithZoom4Json(){var p,c,d,u;const r=new Date().valueOf();let e=0,a=0;const o=(p=this.map)==null?void 0:p.getBounds(),i=this.map.getZoom(),s=k.LngLatHelper.convertToStdLng(o._sw.lng),n=k.LngLatHelper.convertToStdLng(o._ne.lng),l=Math.floor(o._sw.lat),h=Math.ceil(o._ne.lat);for(const m in this.weatherLayers)if(this.weatherLayers[m].active&&this.weatherLayers[m].type==="json"){this.weatherLayers[m].active=!1,this.weatherLayers[m].version=Math.random()+1;let b=[];if(["swell","current"].includes(m)){const f=((c=this.weatherLayers[m])==null?void 0:c.direction)||{};for(const y in f)if(y>l&&y<h&&(!(i<=this.zoom)||y%(i<this.zoom/2?5:3)===0)){const L=f[y].lng;s>n?L.forEach((g,x)=>{var C;if((g>=s&&g<=180||g>=-180&&g<=n)&&(!(i<=this.zoom)||g%(i<this.zoom/2?5:3)===0)){const w=v.point([g,y],{val:f[y].val[x],spd:(C=f[y].spd)==null?void 0:C[x]});b.push(w)}}):L.forEach((g,x)=>{var C;if(g>=s&&g<=n&&(!(i<=this.zoom)||g%(i<this.zoom/2?5:3)===0)){const w=v.point([g,y],{val:f[y].val[x],spd:(C=f[y].spd)==null?void 0:C[x]});b.push(w)}})}if(a=new Date().valueOf()-(r+e),console.log("direction elapsed: ",a,", total: ",e+=a),m==="swell"){const y=this.weatherLayers[m].height;if(y){if(!y.data){const L=[];for(const g in(d=y.raw)==null?void 0:d.LineString){const x=y.raw.LineString[g];for(const C of x)L.push(v.lineString(C,{val:Number(g)}));y.data=v.featureCollection(L)}}if(y.data){const L=this.handleBboxClip(y.data,o);b=b.concat(L)}a=new Date().valueOf()-(r+e),console.log("height elapsed: ",a,", total: ",e+=a)}}if(m==="current"){const y=this.weatherLayers[m].speed;if(y){if(!y.data){const g=[];for(const x in(u=y.raw)==null?void 0:u.Polygon){const C=y.raw.Polygon[x];for(const w of C)g.push(v.polygon(w,{val:Number(x)}))}y.data=v.featureCollection(g)}const L=i<this.zoom?y.data.features.filter(g=>g.properties.val>.5):y.data.features;b=b.concat(L),a=new Date().valueOf()-(r+e),console.log("speed elapsed: ",a,", total: ",e+=a)}}}else if(m==="wind"){const f=this.weatherLayers.wind.raw;for(const y in f)if(y>l&&y<h&&(!(i<=this.zoom)||y%(i<this.zoom/2?5:3)===0)){const L=f[y].lng;s>n?L.forEach((g,x)=>{if((g>=s&&g<=180||g>=-180&&g<=n)&&(!(i<=this.zoom)||g%(i<this.zoom/2?5:3)===0)){const C=v.point([g,y],{val:f[y].val[x],spd:f[y].spd[x]});b.push(C)}}):L.forEach((g,x)=>{if(g>=s&&g<=n&&(!(i<=this.zoom)||g%(i<this.zoom/2?5:3)===0)){const C=v.point([g,y],{val:f[y].val[x],spd:f[y].spd[x]});b.push(C)}})}a=new Date().valueOf()-(r+e),console.log("wind barb elapsed: ",a,", total: ",e+=a)}else if(m==="sig-wave-height"){if(this.weatherLayers[m].data)b=this.weatherLayers[m].data;else{const f=this.weatherLayers[m].raw;if(f){const y=[];for(const L in f.Polygon){const g=f.Polygon[L];for(const x of g)y.push(v.polygon(x,{val:Number(L)}))}for(const L in f.Point){const g=f.Point[L];for(const x of g)y.push(...v.points(x,{val:Number(L)}).features)}b=b.concat(y)}}a=new Date().valueOf()-(r+e),console.log("sigWave elapsed: ",a,", total: ",e+=a)}else if(m==="prmsl"){if(this.weatherLayers[m].data)b=this.weatherLayers[m].data;else{const f=this.weatherLayers[m].raw;if(f){const y=[];for(const L in f.LineString){const g=f.LineString[L];for(const x of g)y.push(v.lineString(x,{val:Number(L)}))}for(const L in f.Point)f.Point[L].lng.forEach((g,x)=>{g=k.LngLatHelper.convertToStdLng(g),y.push(v.point([g,L],{val:f.Point[L].val[x],type:f.Point[L].type[x]}))});b=b.concat(y)}}a=new Date().valueOf()-(r+e),console.log("prmsl elapsed: ",a,", total: ",e+=a)}else if(m==="arctic"||m==="iceberg"){if(this.weatherLayers[m].data)b=this.weatherLayers[m].data;else{const f=this.weatherLayers[m].raw;if(f){const y=[];for(const L in f.LineString){const g=f.LineString[L];for(const x of g)y.push(v.lineString(x,{val:Number(L)}))}b=b.concat(y)}}a=new Date().valueOf()-(r+e)}console.log(m," elapsed: ",a,", total: ",e+=a),b.length&&(this.weatherLayers[m].data=v.featureCollection(b)),this.weatherLayers[m].active=!0,this.weatherLayers[m].version=Math.random()+1}},handleDragEndWithZoom4Image(){for(const r in this.weatherLayers)this.weatherLayers[r].active&&this.weatherLayers[r].type==="image"&&(this.weatherLayers[r].active=!0,this.weatherLayers[r].version=Math.random()+1)},handleBboxClip(r,e){const a=[],o=k.LngLatHelper.convertToStdLng(e._sw.lng),i=k.LngLatHelper.convertToStdLng(e._ne.lng);return r.features.forEach(s=>{if(s.geometry.type!=="Point")if(o>i){let n=[o,e._sw.lat,180,e._ne.lat],l=v.bboxClip(s,n);l.geometry.coordinates.length&&a.push(l),n=[-180,e._sw.lat,i,e._ne.lat],l=v.bboxClip(s,n),l.geometry.coordinates.length&&a.push(l)}else{const n=[o,e._sw.lat,i,e._ne.lat],l=v.bboxClip(s,n);l.geometry.coordinates.length&&a.push(l)}else a.push(s)}),a},handleWeatherLayerToggle(){var r;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 a=e.key;a.indexOf("swell")>-1?a="swell":a.indexOf("current")>-1&&(a="current"),this.weatherLayers[a]&&(this.weatherLayers[a].active=!0,this.weatherLayers[a].version=Math.random()+1,((r=this.particleFactor)==null?void 0:r.key)===a&&this.weatherLayers[`${a}-particle`]&&(this.weatherLayers[`${a}-particle`].active=this.particleFactor.particle))}this.handleBeforeLayerToggle()},handleBeforeLayerToggle(){var r,e,a,o,i,s,n,l,h,p,c,d,u;(r=this.map)!=null&&r.getLayer(this.beforeLayer)&&((e=this.activeWeatherLayers)!=null&&e.length||(a=this.otherLayers)!=null&&a["war-zones"]||(o=this.otherLayers)!=null&&o["gmdss-areas"]||(i=this.otherLayers)!=null&&i["load-lines"]||(s=this.otherLayers)!=null&&s["high-risk-area"]||(n=this.otherLayers)!=null&&n["time-zones"]||(l=this.otherLayers)!=null&&l.pirates||(h=this.otherLayers)!=null&&h.ports||(p=this.otherLayers)!=null&&p.enc||(c=this.otherLayers)!=null&&c["voluntary-reporting-area"]||(d=this.otherLayers)!=null&&d["eca-zones"]||(u=this.otherLayers)!=null&&u["special-area"])&&this.map.setLayoutProperty(this.beforeLayer,"visibility","visible")},handleDateChange(r={tropicals:!1}){this.fetchWeatherLayers(r),this.fetchOtherLayers({dayNight:!0})},handleWeatherLayerChange(r,e){this.showWindParticle=!1,this.showCurrentParticle=!1,this.map?setTimeout(()=>{this.activeWeatherLayers=JSON.parse(JSON.stringify(r));const a=this.activeWeatherLayers.some(s=>{var n;return["wind","current"].includes(s.key)&&(!((n=Object.keys(s))!=null&&n.some(l=>l==="particle"))||!!s.particle)}),o=this.activeWeatherLayers.some(s=>["png","jpg"].includes(s.type));a&&!o?(this.activeWeatherLayers.forEach(s=>{s.key==="wind"&&s.particle&&(this.particleFactor=s,this.showWindParticle=!0),s.key==="current"&&s.particle&&(this.particleFactor=s,this.showCurrentParticle=!0)}),this.particleFactor.particle=!0):o&&this.particleFactor&&(this.particleFactor.particle=!1);const i=r==null?void 0:r.reduce((s,n)=>s+(s&(n==null?void 0:n.weight)?0:n==null?void 0:n.weight),0);this.weatherWeight!==i||this.source!==e?(this.source=e,this.weatherWeight=i,this.fetchWeatherLayers({tropicals:!1})):this.handleWeatherLayerToggle()}):setTimeout(()=>{this.handleWeatherLayerChange(r,e)},500)},handleOtherLayerChange(r){if(!this.map)setTimeout(()=>{this.handleOtherLayerChange(r)},500);else{const e=r==null?void 0:r.reduce((a,o)=>a+(o==null?void 0:o.weight),0);r.find(a=>a.key==="enc")?this.enc="i4":this.enc="",this.otherWeight!=e&&(this.otherWeight=e,this.fetchOtherLayers({all:!0}))}},async handlePointChange(r){console.log(this.ts);const e=this.ts?D(this.ts).utc().add(-1,"d").format():D().add(-1,"d").utc().format(),a={lat:r.lat,lng:r.lng,datetime:e,forecastDays:8,selfHosted:!1},o=await $.post(`${this.gateway}/api/arc/meteo2/spot/forecast`,a,{headers:{Authorization:this.token||this.defaultMeteoToken}});(o==null?void 0:o.data.code)===0&&(this.meteo={...o==null?void 0:o.data.data,...r})},handle3dToggle(r){var e,a,o,i,s,n,l,h,p,c,d,u,m,b,f,y,L,g,x,C;r?(this.map.setProjection("globe"),this.mapProjection="globe",(a=this.map)!=null&&a.getLayer((e=this.viewport)==null?void 0:e.rampColorLayer)&&((o=this.map)!=null&&o.getLayer(this.helper.mapboxCustomer.layers.water.id))&&((s=this.map)==null||s.moveLayer((i=this.viewport)==null?void 0:i.rampColorLayer,this.helper.mapboxCustomer.layers.water.id)),(l=this.map)!=null&&l.getLayer((n=this.viewport)==null?void 0:n.particleLayer)&&((h=this.map)!=null&&h.getLayer(this.helper.mapboxCustomer.layers.water.id))&&((c=this.map)==null||c.moveLayer((p=this.viewport)==null?void 0:p.particleLayer,this.helper.mapboxCustomer.layers.water.id)),this.map.off("zoomend",this.handleDragEndWithZoom4Json),this.map.off("dragend",this.handleDragEndWithZoom4Json),this.map.off("move",this.handleDragEndWithZoom4Image)):(this.map.setProjection("mercator"),this.mapProjection="mercator",this.map.on("zoomend",this.handleDragEndWithZoom4Json),this.map.on("dragend",this.handleDragEndWithZoom4Json),this.map.on("move",this.handleDragEndWithZoom4Image),this.handleDragEndWithZoom4Image(),this.handleDragEndWithZoom4Json(),(u=this.map)!=null&&u.getLayer((d=this.viewport)==null?void 0:d.rampColorLayer)&&((m=this.map)!=null&&m.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&((f=this.map)==null||f.moveLayer((b=this.viewport)==null?void 0:b.rampColorLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)),(L=this.map)!=null&&L.getLayer((y=this.viewport)==null?void 0:y.particleLayer)&&((g=this.map)!=null&&g.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&((C=this.map)==null||C.moveLayer((x=this.viewport)==null?void 0:x.particleLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)))},handleParticle(r){this.particleFactor=r,this.weatherLayers[r.key]&&(this.weatherLayers[r.key].particle=r.particle),this.activeWeatherLayers.map(o=>{var i;return o.key===r.key?o.particle=r.particle:(i=Object.keys(o))!=null&&i.some(s=>s==="particle")&&(o.particle=!1),o});let e=localStorage.getItem("activeWeatherLayersCache");const a=JSON.parse(e)||[];a==null||a.forEach(o=>{var i;o.key===r.key?o.particle=r.particle:(i=Object.keys(o))!=null&&i.some(s=>s==="particle")&&(o.particle=!1)}),localStorage.setItem("activeWeatherLayersCache",JSON.stringify(a)),this.fetchWeatherLayers({tropicals:!1})},handleToggleVersion(){this.$emit("toggleVersion",Math.random())}}},si={key:0,className:"map-gl-home"};function ni(r,e,a,o,i,s){var z,Z,K,se,ee,P,O,ne,te,le,ae,re,ie,ye,fe,ue,ge,be,Le,we,xe,_e,ve,Ce,ke,Ee;const n=t.resolveComponent("IdmGlLayer"),l=t.resolveComponent("IdmENC"),h=t.resolveComponent("IdmSigWave"),p=t.resolveComponent("IdmSwell"),c=t.resolveComponent("IdmPrmsl"),d=t.resolveComponent("IdmIceberg"),u=t.resolveComponent("IdmTropicals"),m=t.resolveComponent("IdmCurrents"),b=t.resolveComponent("IdmCurrentParticle"),f=t.resolveComponent("IdmWindBarb"),y=t.resolveComponent("IdmWindParticle"),L=t.resolveComponent("IdmPrecip3h"),g=t.resolveComponent("IdmVisibility"),x=t.resolveComponent("IdmWaterTemp"),C=t.resolveComponent("IdmTemp"),w=t.resolveComponent("IdmArctic"),_=t.resolveComponent("IdmWarZone"),N=t.resolveComponent("IdmGmdssArea"),I=t.resolveComponent("IdmEcaZone"),W=t.resolveComponent("IdmAlertZone"),A=t.resolveComponent("IdmPort"),F=t.resolveComponent("IdmLoadLine"),G=t.resolveComponent("IdmTimezone"),J=t.resolveComponent("IdmVRA"),X=t.resolveComponent("IdmSpecialArea"),q=t.resolveComponent("IdmTerminator"),Y=t.resolveComponent("IdmLatLng"),U=t.resolveComponent("IdmMeasure"),Q=t.resolveComponent("IdmPoint");return a.map?(t.openBlock(),t.createElementBlock("div",si,[t.createVNode(n,t.mergeProps({ref:"layer",map:a.map,"toggle-version":a.toggleVersion,"map-projection":i.mapProjection,showWindFeather:i.showWindFeather,showWindParticle:i.showWindParticle,showCurrentIsoband:i.showCurrentIsoband,showCurrentParticle:i.showCurrentParticle},r.$attrs,{onWeather:s.handleWeatherLayerChange,onOther:s.handleOtherLayerChange,onToggleWindParticle:e[0]||(e[0]=M=>i.showWindParticle=M),onToggleWindFeather:e[1]||(e[1]=M=>i.showWindFeather=M),onToggleCurrentParticle:e[2]||(e[2]=M=>i.showCurrentParticle=M),onToggleCurrentIsoband:e[3]||(e[3]=M=>i.showCurrentIsoband=M),onCoordinate:e[4]||(e[4]=M=>i.showCoord=M),onMeasure:e[5]||(e[5]=M=>i.showMeasure=M),onPoint:e[6]||(e[6]=M=>i.showPoint=M),on3d:s.handle3dToggle,onHandleToggleVersion:s.handleToggleVersion}),null,16,["map","toggle-version","map-projection","showWindFeather","showWindParticle","showCurrentIsoband","showCurrentParticle","onWeather","onOther","on3d","onHandleToggleVersion"]),t.createVNode(l,t.mergeProps({map:a.map,token:a.token,enabled:(z=i.otherLayers)==null?void 0:z.enc,"toggle-version":a.toggleVersion},r.$attrs,{onEnc:e[7]||(e[7]=M=>i.enc=M)}),null,16,["map","token","enabled","toggle-version"]),t.createVNode(h,t.mergeProps({map:a.map,"sig-wave":(Z=i.weatherLayers)==null?void 0:Z["sig-wave-height"],"before-layer":a.beforeLayer,activeWeatherLayers:i.activeWeatherLayers},r.$attrs),null,16,["map","sig-wave","before-layer","activeWeatherLayers"]),t.createVNode(p,t.mergeProps({map:a.map,swell:(K=i.weatherLayers)==null?void 0:K.swell,"before-layer":a.beforeLayer,activeWeatherLayers:i.activeWeatherLayers},r.$attrs),null,16,["map","swell","before-layer","activeWeatherLayers"]),t.createVNode(c,t.mergeProps({map:a.map,prmsl:(se=i.weatherLayers)==null?void 0:se.prmsl,"before-layer":a.beforeLayer,"active-weather-layers":i.activeWeatherLayers},r.$attrs),null,16,["map","prmsl","before-layer","active-weather-layers"]),t.createVNode(d,t.mergeProps({map:a.map,iceberg:(ee=i.weatherLayers)==null?void 0:ee.iceberg,"before-layer":a.beforeLayer},r.$attrs),null,16,["map","iceberg","before-layer"]),t.createVNode(u,t.mergeProps({map:a.map,date:a.ts,tropicals:(P=i.weatherLayers)==null?void 0:P.tropicals,"before-layer":a.beforeLayer},r.$attrs),null,16,["map","date","tropicals","before-layer"]),t.createVNode(m,t.mergeProps({map:a.map,"map-projection":i.mapProjection,current:(O=i.weatherLayers)==null?void 0:O.current,"before-layer":a.beforeLayer,showCurrentIsoband:i.showCurrentIsoband,showCurrentParticle:i.showCurrentParticle,"margin-bottom":i.activeWindLayer?i.showRampColor?"84px":"56px":i.showRampColor?"56px":"30px","toggle-version":a.toggleVersion,"weather-layers":i.weatherLayers},r.$attrs,{onParticle:s.handleParticle,onHandleToggleVersion:s.handleToggleVersion}),null,16,["map","map-projection","current","before-layer","showCurrentIsoband","showCurrentParticle","margin-bottom","toggle-version","weather-layers","onParticle","onHandleToggleVersion"]),t.createVNode(b,t.mergeProps({viewport:i.viewport,factor:(ne=i.weatherLayers)==null?void 0:ne["current-particle"],"before-layer":a.beforeLayer,"toggle-version":a.toggleVersion},r.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),t.createVNode(f,t.mergeProps({ref:"windBarb",map:a.map,"map-projection":i.mapProjection,wind:(te=i.weatherLayers)==null?void 0:te.wind,current:(le=i.weatherLayers)==null?void 0:le.current,"before-layer":a.beforeLayer,"margin-bottom":i.showRampColor?"56px":"30px",showWindFeather:i.showWindFeather,showWindParticle:i.showWindParticle},r.$attrs,{"toggle-version":a.toggleVersion,"weather-layers":i.weatherLayers,onParticle:s.handleParticle}),null,16,["map","map-projection","wind","current","before-layer","margin-bottom","showWindFeather","showWindParticle","toggle-version","weather-layers","onParticle"]),t.createVNode(y,t.mergeProps({viewport:i.viewport,factor:(ae=i.weatherLayers)==null?void 0:ae["wind-particle"],"before-layer":a.beforeLayer,"toggle-version":a.toggleVersion},r.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),t.createVNode(L,t.mergeProps({viewport:i.viewport,factor:(re=i.weatherLayers)==null?void 0:re.precip3h,"before-layer":a.beforeLayer,"toggle-version":a.toggleVersion},r.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),t.createVNode(g,t.mergeProps({viewport:i.viewport,factor:(ie=i.weatherLayers)==null?void 0:ie.visibility,"before-layer":a.beforeLayer,"toggle-version":a.toggleVersion},r.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),t.createVNode(x,t.mergeProps({viewport:i.viewport,factor:(ye=i.weatherLayers)==null?void 0:ye["water-temp"],"before-layer":a.beforeLayer,"toggle-version":a.toggleVersion},r.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),t.createVNode(C,t.mergeProps({viewport:i.viewport,factor:(fe=i.weatherLayers)==null?void 0:fe.temp,"before-layer":a.beforeLayer,"toggle-version":a.toggleVersion},r.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),t.createVNode(w,t.mergeProps({viewport:i.viewport,factor:(ue=i.weatherLayers)==null?void 0:ue.arctic,"before-layer":a.beforeLayer,"toggle-version":a.toggleVersion},r.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),t.createVNode(_,t.mergeProps({map:a.map,zone:(ge=i.otherLayers)==null?void 0:ge["war-zones"],"before-layer":a.beforeLayer},r.$attrs),null,16,["map","zone","before-layer"]),t.createVNode(N,t.mergeProps({map:a.map,area:(be=i.otherLayers)==null?void 0:be["gmdss-areas"],"before-layer":a.beforeLayer},r.$attrs),null,16,["map","area","before-layer"]),t.createVNode(I,t.mergeProps({map:a.map,zone:(Le=i.otherLayers)==null?void 0:Le["eca-zones"],"before-layer":a.beforeLayer},r.$attrs),null,16,["map","zone","before-layer"]),t.createVNode(W,t.mergeProps({map:a.map,zone:(we=i.otherLayers)==null?void 0:we["alert-zones"],"before-layer":a.beforeLayer},r.$attrs),null,16,["map","zone","before-layer"]),t.createVNode(A,t.mergeProps({map:a.map,port:(xe=i.otherLayers)==null?void 0:xe.ports,"before-layer":a.beforeLayer},r.$attrs),null,16,["map","port","before-layer"]),t.createVNode(F,t.mergeProps({map:a.map,line:(_e=i.otherLayers)==null?void 0:_e["load-lines"],"before-layer":a.beforeLayer},r.$attrs),null,16,["map","line","before-layer"]),t.createVNode(G,t.mergeProps({map:a.map,zone:(ve=i.otherLayers)==null?void 0:ve["time-zones"],"before-layer":a.beforeLayer},r.$attrs),null,16,["map","zone","before-layer"]),t.createVNode(J,t.mergeProps({map:a.map,area:(Ce=i.otherLayers)==null?void 0:Ce["voluntary-reporting-area"],"before-layer":a.beforeLayer},r.$attrs),null,16,["map","area","before-layer"]),t.createVNode(X,t.mergeProps({map:a.map,area:(ke=i.otherLayers)==null?void 0:ke["special-area"],"before-layer":a.beforeLayer},r.$attrs),null,16,["map","area","before-layer"]),t.createVNode(q,t.mergeProps({map:a.map,area:(Ee=i.otherLayers)==null?void 0:Ee["day-night"]},r.$attrs),null,16,["map","area"]),t.createVNode(Y,t.mergeProps({map:a.map,show:i.showCoord,"toggle-version":a.toggleVersion},r.$attrs),null,16,["map","show","toggle-version"]),t.createVNode(U,t.mergeProps({map:a.map,show:i.showMeasure},r.$attrs),null,16,["map","show"]),t.createVNode(Q,t.mergeProps({map:a.map,show:i.showPoint,meteo:i.meteo,ts:a.ts,token:a.token},r.$attrs,{onPoint:s.handlePointChange}),null,16,["map","show","meteo","ts","token","onPoint"])])):t.createCommentVNode("",!0)}const me=E(oi,[["render",ni]]),li={install(r){r.component("MapboxGL",me),r.component("TropicalGL",ce),r.component("LatLngGL",he)}};S.LatLngGL=he,S.MapboxGL=me,S.MapboxGLPlugin=li,S.MapboxHelper=pe,S.ParticleSchema=R,S.TropicalGL=ce,S.Viewport=oe,S.WebGL=H,S.WebGLSchema=B,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
204
+ </svg>`,te=document.createElement("div");te.className="hurricane-hourly-marker",te.innerHTML=`<div class="${N.geometry.coordinates[1]>=0?"center north":"center south"}">${ne}</div>`;const le=new j.Marker(te).setLngLat(N.geometry.coordinates).addTo(this.map);if(this.interpolateMarkers.push(le),(G=N.properties)!=null&&G.showCircle){const ae={radius:100,coordinates:N.geometry.coordinates},re={radius:200,coordinates:N.geometry.coordinates},ie={radius:500,coordinates:N.geometry.coordinates};(J=this.circleSourceData)==null||J.features.push(v.circle(ae.coordinates,ae.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}})),(X=this.circleSourceData)==null||X.features.push(v.circle(re.coordinates,re.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}})),(q=this.circleSourceData)==null||q.features.push(v.circle(ie.coordinates,ie.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}}))}(U=(Y=this.map)==null?void 0:Y.getSource(this.circleSource))==null||U.setData(this.circleSourceData)}}else(Q=this.map)!=null&&Q.getSource(this.interpolateSource)&&((z=this.map)==null||z.getSource(this.interpolateSource).setData(this.empty))},handleClick(r){var s,n,l,h,p,c,d,u;const e=r.features[0],a=(n=(s=this.tropicals)==null?void 0:s.data)==null?void 0:n.features.filter(m=>{var b;return m.geometry.type==="LineString"&&m.properties.type==="forecast"&&m.properties.name===((b=e==null?void 0:e.properties)==null?void 0:b.name)});a.sort((m,b)=>{var f,y,w,g;return((f=m.properties)==null?void 0:f.model)==="cma"?-1:((y=m.properties)==null?void 0:y.model)==="jma"?((w=b.properties)==null?void 0:w.model)==="cma"?1:-1:m.properties.model==="ecmwf"?["jma","cma"].includes((g=b.properties)==null?void 0:g.model)?1:-1:0});const o=(h=(l=this.tropicals)==null?void 0:l.data)==null?void 0:h.features.filter(m=>{var b;return m.geometry.type==="LineString"&&m.properties.type==="history"&&m.properties.name===((b=e==null?void 0:e.properties)==null?void 0:b.name)});this.activeTropicals={name:(p=e==null?void 0:e.properties)==null?void 0:p.name,forecasts:a.map(m=>m.properties),history:(c=o[0])==null?void 0:c.properties,showCircle:(u=(d=a[0])==null?void 0:d.properties)==null?void 0:u.showCircle},this.showTropicals=!0;const i=document.getElementById("active-tropical");this.activeTropicalsMarker?this.activeTropicalsMarker.setLngLat([r.lngLat.lng,r.lngLat.lat]):this.activeTropicalsMarker=new j.Marker(i).setLngLat([r.lngLat.lng,r.lngLat.lat]).setOffset([220,0]).addTo(this.map)},handleForecastToggle(r){var o,i,s,n,l,h;r.disabled=!r.disabled;const e=`${r.name}-${r.model}`,a=(i=(o=this.map)==null?void 0:o.getSource(this.source)._data)==null?void 0:i.features;a.forEach(p=>{p.properties.category===e&&(p.properties.disabled=r.disabled)}),this.interpolateData.forEach(p=>{p.properties.category===e&&(p.properties.disabled=r.disabled)}),(n=(s=this.map)==null?void 0:s.getSource(this.source))==null||n.setData(v.featureCollection(a)),(h=(l=this.map)==null?void 0:l.getSource(this.clusterSource))==null||h.setData(v.featureCollection(a)),this.handleDateChange()},handleStrikeProbability(r){this.$emit("tropicalProbability",r)},handleToggleCircles(r){var e,a;r.showCircle=!r.showCircle,(a=(e=this.tropicals.data)==null?void 0:e.features)==null||a.forEach(o=>{o.properties.name===r.name&&(o.properties.showCircle=r.showCircle)}),this.handleRender()},handleDrawCircle(){var r,e;(r=this.map)!=null&&r.getSource(this.circleSource)?(e=this.map)==null||e.getSource(this.circleSource).setData(this.circleSourceData):(this.map.addSource(this.circleSource,{type:"geojson",data:this.circleSourceData}),this.map.addLayer({id:this.circleLayer,type:"line",source:this.circleSource,filter:["all",["==","$type","Polygon"],["==","type","tropicalCircle"]],paint:{"line-color":"#fff","line-width":2,"line-opacity":1,"line-dasharray":[1,1]}}))},handleComputePolygons(r){const e=[];for(const a of r){const o=a.properties.wind,i={ne:o.r7ne>=0?o.r7ne:void 0,se:o.r7se>=0?o.r7se:void 0,sw:o.r7sw>=0?o.r7sw:void 0,nw:o.r7nw>=0?o.r7nw:void 0},s=this.handleComputeArc(a.geometry.coordinates,i,{...a.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(a.geometry.coordinates,n,{...a.properties,level:10});e.push(l)}return e},handleComputeArc(r,e,a){var s;const o=[];for(const n in e){const l=e[n]??0;let h;switch(n){case"ne":h=v.lineArc(r,l*1.852,0,90,{steps:l>0?64:1});break;case"se":h=v.lineArc(r,l*1.852,90,180,{steps:l>0?64:1});break;case"sw":h=v.lineArc(r,l*1.852,180,270,{steps:l>0?64:1});break;case"nw":h=v.lineArc(r,l*1.852,270,360,{steps:l>0?64:1});break}o.push(...(s=h==null?void 0:h.geometry)==null?void 0:s.coordinates)}const i=v.lineString(o);return v.lineToPolygon(i,{properties:a})}}},Ft={id:"active-tropical",class:"active-tropical"},jt={class:"header-box"},$t={class:"main"},Ht={key:0},Ut={class:"sub"},Zt={id:"meteoBox",class:"main-box"},Gt={class:"content"},Jt={class:"row"},Xt={class:"col col-left",style:{"justify-content":"flex-start"}},qt={class:"col col-right",style:{"justify-content":"flex-start"}},Yt={class:"row"},Qt={class:"col col-24",style:{"justify-content":"flex-start"}},Kt={class:"forecast-models"},ea=["onClick"],ta={class:"more"};function aa(r,e,a,o,i,s){var n,l,h,p,c,d,u,m,b,f,y,w,g,x,C;return t.withDirectives((t.openBlock(),t.createElementBlock("div",Ft,[t.createElementVNode("div",jt,[t.createElementVNode("div",{class:"iconfont close-btn",onClick:e[0]||(e[0]=L=>i.showTropicals=!1)},""),t.createElementVNode("div",$t,[(l=(n=i.activeTropicals)==null?void 0:n.history)!=null&&l.level?(t.openBlock(),t.createElementBlock("span",Ht,t.toDisplayString((p=(h=i.activeTropicals)==null?void 0:h.history)==null?void 0:p.level)+" , ",1)):t.createCommentVNode("",!0),t.createTextVNode(t.toDisplayString((c=i.activeTropicals)==null?void 0:c.name),1)]),t.createElementVNode("div",Ut," Last update: "+t.toDisplayString(s.computeTime(((u=(d=i.activeTropicals)==null?void 0:d.history)==null?void 0:u.updated)||((f=(b=(m=i.activeTropicals)==null?void 0:m.forecasts)==null?void 0:b.filter(L=>!L.disabled)[0])==null?void 0:f.date))),1)]),t.createElementVNode("div",Zt,[t.createElementVNode("div",Gt,[t.createElementVNode("div",Jt,[t.createElementVNode("div",Xt,[e[2]||(e[2]=t.createElementVNode("label",null,"Wind speed : ",-1)),t.createElementVNode("span",null,t.toDisplayString(((w=(y=i.activeTropicals)==null?void 0:y.history)==null?void 0:w.kts)||"-")+"[kts]",1)]),t.createElementVNode("div",qt,[e[3]||(e[3]=t.createElementVNode("label",null,"Pressure : ",-1)),t.createElementVNode("span",null,t.toDisplayString(((x=(g=i.activeTropicals)==null?void 0:g.history)==null?void 0:x.pressure)||"-")+"[hPa]",1)])]),t.createElementVNode("div",Yt,[t.createElementVNode("div",Qt,[e[4]||(e[4]=t.createElementVNode("label",{style:{width:"max-content"}},"Forecast Models : ",-1)),t.createElementVNode("div",Kt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList((C=i.activeTropicals)==null?void 0:C.forecasts,(L,_)=>{var P,I,M,W;return t.openBlock(),t.createElementBlock("div",{key:_,class:t.normalizeClass(["model",L.disabled?"":"active",_>0&&_<((I=(P=i.activeTropicals)==null?void 0:P.forecasts)==null?void 0:I.length)-1&&((W=(M=i.activeTropicals)==null?void 0:M.forecasts)==null?void 0:W.length)>2?"center-child":""]),onClick:F=>s.handleForecastToggle(L)},[t.createElementVNode("span",{class:t.normalizeClass(L.model)},t.toDisplayString(L.model),3)],10,ea)}),128))])])]),e[5]||(e[5]=t.createStaticVNode('<div class="row" style="padding:0;height:1px;margin:10px 0;background:var(--idm-black-1);" data-v-726fd7f6></div><div class="row" style="padding:2px 10px;" data-v-726fd7f6><div class="legend" data-v-726fd7f6><div class="icon td" data-v-726fd7f6></div><div class="label" data-v-726fd7f6>TD</div></div><div class="legend" data-v-726fd7f6><div class="icon ts" data-v-726fd7f6></div><div class="label" data-v-726fd7f6>TS</div></div><div class="legend" data-v-726fd7f6><div class="icon sts" data-v-726fd7f6></div><div class="label" data-v-726fd7f6>STS</div></div><div class="legend" data-v-726fd7f6><div class="icon ty" data-v-726fd7f6></div><div class="label" data-v-726fd7f6>TY</div></div><div class="legend" data-v-726fd7f6><div class="icon sty" data-v-726fd7f6></div><div class="label" data-v-726fd7f6>STY</div></div><div class="legend" data-v-726fd7f6><div class="icon supper-ty" data-v-726fd7f6></div><div class="label" data-v-726fd7f6>Super TY</div></div></div><div class="row" style="padding:2px 10px;" data-v-726fd7f6><div class="legend" data-v-726fd7f6><div class="icon history" data-v-726fd7f6></div><div class="label" data-v-726fd7f6>History</div></div><div class="legend" data-v-726fd7f6><div class="icon r7" data-v-726fd7f6></div><div class="label" data-v-726fd7f6>35kts Radii</div></div><div class="legend" data-v-726fd7f6><div class="icon r10" data-v-726fd7f6></div><div class="label" data-v-726fd7f6>50kts Radii</div></div></div>',3))]),t.createElementVNode("div",ta,[t.createElementVNode("div",{class:"button",onClick:e[1]||(e[1]=L=>s.handleStrikeProbability(i.activeTropicals))},"Strike Probability >>")])])],512)),[[t.vShow,i.showTropicals&&!r.$attrs.hideTropicalsLegend]])}const ce=E(Ot,[["render",aa],["__scopeId","data-v-726fd7f6"]]),bi="",ra={name:"IdmPrecip3h",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new H,etime:void 0,right:10}},watch:{"factor.version":{handler(){var r;(r=this.factor)!=null&&r.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var r;this.right=(((r=document.getElementsByClassName("right-bar")[0])==null?void 0:r.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const r=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(r+e),console.log("[precip3h] add elapsed: ",a,", total: ",e+=a)}},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 r=[[0,"rgba(59, 126, 162, 0)"],[14/255,"rgba(84,170,230, 0)"],[15/255,"rgba(172, 210, 255, 0.8)"],[20/255,"rgba(51,202,248,0.8)"],[30/255,"rgba(3,248,103,0.8)"],[49/255,"rgba(14,201,3,0.8)"],[57/255,"rgba(190,226,2,0.8)"],[73/255,"rgba(248,1,1,0.8)"],[82/255,"rgba(197,5,58,0.8)"],[1,"rgba(197,5,58,0.8)"]];this.rampColor=this.webgl.setup(this.context,r);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,B.vertexSchema,B.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const r=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,r)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},ia={key:0};function oa(r,e,a,o,i,s){var n;return(n=a.factor)!=null&&n.active?(t.openBlock(),t.createElementBlock("div",ia,[t.createElementVNode("div",{class:"legend-bars flex-center",style:t.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:a.bottom}])},e[0]||(e[0]=[t.createElementVNode("span",null,"mm",-1),t.createElementVNode("span",null,"1.5",-1),t.createElementVNode("span",null,"2",-1),t.createElementVNode("span",null,"3",-1),t.createElementVNode("span",null,"7",-1),t.createElementVNode("span",null,"10",-1),t.createElementVNode("span",null,"20",-1),t.createElementVNode("span",null,"30",-1)]),4)])):t.createCommentVNode("",!0)}const sa=E(ra,[["render",oa],["__scopeId","data-v-9708a7a3"]]),wi="",na={name:"IdmVisibility",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new H,etime:void 0}},watch:{"factor.version":{handler(){var r;(r=this.factor)!=null&&r.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var r;this.right=(((r=document.getElementsByClassName("right-bar")[0])==null?void 0:r.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const r=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(r+e),console.log("[visibility] add elapsed: ",a,", total: ",e+=a)}},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 r=[[0,"rgba(189,50,160,0.8)"],[8/255,"rgba(208,56,56,0.8)"],[27/255,"rgba(190,226,2,0.8)"],[60/255,"rgba(3,236,118,0.8)"],[160/255,"rgba(172, 210,255,0.8)"],[161/255,"rgba(172, 210,255,0)"],[1,"rgba(144,144,144,0)"]];this.rampColor=this.webgl.setup(this.context,r);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,B.vertexSchema,B.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const r=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,r)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},la={key:0};function ca(r,e,a,o,i,s){var n;return(n=a.factor)!=null&&n.active?(t.openBlock(),t.createElementBlock("div",la,[t.createElementVNode("div",{class:"legend-bars flex-center",style:t.normalizeStyle([{position:"absolute"},{right:r.right+"px",bottom:a.bottom}])},e[0]||(e[0]=[t.createElementVNode("span",null,"nm",-1),t.createElementVNode("span",null,"0",-1),t.createElementVNode("span",null,"0.5",-1),t.createElementVNode("span",null,"1.5",-1),t.createElementVNode("span",null,"3",-1),t.createElementVNode("span",null,"9",-1)]),4)])):t.createCommentVNode("",!0)}const ha=E(na,[["render",ca],["__scopeId","data-v-f7b2fb08"]]),Li="",da={name:"IdmWaterTemp",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new H,etime:void 0,right:10}},watch:{"factor.version":{handler(){var r;(r=this.factor)!=null&&r.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var r;this.right=(((r=document.getElementsByClassName("right-bar")[0])==null?void 0:r.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const r=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(r+e),console.log("[water-temp] add elapsed: ",a,", total: ",e+=a)}},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 r=[[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,r);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,B.vertexSchema,B.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const r=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,r)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},pa={key:0};function ma(r,e,a,o,i,s){var n;return(n=a.factor)!=null&&n.active?(t.openBlock(),t.createElementBlock("div",pa,[t.createElementVNode("div",{class:"legend-bars flex-center",style:t.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:a.bottom}])},e[0]||(e[0]=[t.createElementVNode("span",null,"°C",-1),t.createElementVNode("span",null,"0",-1),t.createElementVNode("span",null,"10",-1),t.createElementVNode("span",null,"20",-1),t.createElementVNode("span",null,"30",-1),t.createElementVNode("span",null,"40",-1)]),4)])):t.createCommentVNode("",!0)}const ya=E(da,[["render",ma],["__scopeId","data-v-7521f582"]]),xi="",fa={name:"IdmTemp",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new H,etime:void 0,right:10}},watch:{"factor.version":{handler(){var r;(r=this.factor)!=null&&r.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var r;this.right=(((r=document.getElementsByClassName("right-bar")[0])==null?void 0:r.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const r=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(r+e),console.log("[water-temp] add elapsed: ",a,", total: ",e+=a)}},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 r=[[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,r);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,B.vertexSchema,B.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const r=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,r)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},ua={key:0};function ga(r,e,a,o,i,s){var n;return(n=a.factor)!=null&&n.active?(t.openBlock(),t.createElementBlock("div",ua,[t.createElementVNode("div",{class:"legend-bars flex-center",style:t.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:a.bottom}])},e[0]||(e[0]=[t.createElementVNode("span",null,"°C",-1),t.createElementVNode("span",null,"-20",-1),t.createElementVNode("span",null,"-10",-1),t.createElementVNode("span",null,"0",-1),t.createElementVNode("span",null,"10",-1),t.createElementVNode("span",null,"20",-1),t.createElementVNode("span",null,"30",-1),t.createElementVNode("span",null,"40",-1)]),4)])):t.createCommentVNode("",!0)}const ba=E(fa,[["render",ga],["__scopeId","data-v-25daaa82"]]),_i="",wa={name:"IdmArctic",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new H,etime:void 0,right:10}},watch:{"factor.version":{handler(){var r;(r=this.factor)!=null&&r.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var r;this.right=(((r=document.getElementsByClassName("right-bar")[0])==null?void 0:r.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const r=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(r+e),console.log("[water-temp] add elapsed: ",a,", total: ",e+=a)}},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 r=[[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,r);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,B.vertexSchema,B.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const r=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,r)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},La={key:0};function xa(r,e,a,o,i,s){var n;return(n=a.factor)!=null&&n.active?(t.openBlock(),t.createElementBlock("div",La,[t.createElementVNode("div",{class:"legend-bars flex-center",style:t.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:a.bottom}])},e[0]||(e[0]=[t.createElementVNode("span",null,"m",-1),t.createElementVNode("span",null,"0",-1),t.createElementVNode("span",null,"0.5",-1),t.createElementVNode("span",null,"1",-1),t.createElementVNode("span",null,"1.5",-1),t.createElementVNode("span",null,"2",-1)]),4)])):t.createCommentVNode("",!0)}const _a=E(wa,[["render",xa],["__scopeId","data-v-5bb73794"]]);/*! Element Plus Icons Vue v2.3.1 */var va=t.defineComponent({name:"LocationFilled",__name:"location-filled",setup(r){return(e,a)=>(t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[t.createElementVNode("path",{fill:"currentColor",d:"M512 928c23.936 0 117.504-68.352 192.064-153.152C803.456 661.888 864 535.808 864 416c0-189.632-155.84-320-352-320S160 226.368 160 416c0 120.32 60.544 246.4 159.936 359.232C394.432 859.84 488 928 512 928m0-435.2a64 64 0 1 0 0-128 64 64 0 0 0 0 128m0 140.8a204.8 204.8 0 1 1 0-409.6 204.8 204.8 0 0 1 0 409.6"})]))}}),Ca=va;const vi="",ka={name:"IdmPoint",components:{LocationFilled:Ca},props:{token:{type:String},map:{type:Object},show:{type:Boolean},ts:{type:String},timeZone:{type:Number,default:8},meteo:{type:Object}},emits:["point","meteoMore"],data(){return{showMeteo:!1,meteoData:void 0,tableData:{},currentHourData:void 0,meteoMarker:void 0,helper:V.CompanyHelper,activeIndex:1}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){this.map&&this.show&&this.handleBind()}},ts:{handler(){this.showMeteo&&this.initTableData()}},meteo:{handler(){this.meteo?(this.showMeteo=!0,this.meteoData=this.meteo,this.initTableData(),this.handleRender()):this.showMeteo=!1}}},computed:{computeTime(){return function(r,e){const a=e??0;return r?`${D(r).utcOffset(a*60).format("MMM-DD,HHmm")}`:"-"}},computeHourL(){return function(r,e){const a=e??0;return r?`${D(r).utcOffset(a).format("HH")}`:"-"}},computeHourZ(){return function(r){return r?`${D(r).utc().format("HH")}Z`:"-"}},computeWeek(){return function(r){return r?`${D(r).format("dddd")}`:"-"}},computeMMMDD(){return function(r){return r?`${D(r).format("MMM-DD")}`:"-"}},computeTimeZone(){return`(UTC ${this.timeZone<0?this.timeZone:"+"+this.timeZone})`},computeLat(){return function(r,e=4){return k.LngLatHelper.lat2pretty(r,e).pretty}},computeLng(){return function(r,e=4){return k.LngLatHelper.lng2pretty(r,e).pretty}},roundPrecision(){return function(r,e=4){return isNaN(r)?"-":k.LngLatHelper.roundPrecision(r,e)}}},mounted(){},methods:{initTableData(){var r,e,a,o,i,s,n,l,h,p,c,d,u,m,b,f,y,w,g,x,C,L,_,P,I,M,W,F,G,J,X,q,Y;this.currentHourData=(r=de.Meteo2Assist.pickHourly(this.meteoData,this.ts?D(this.ts):D()))==null?void 0:r[0],this.tableData={hours:[],utcHours:[],weatherUrls:[],temp:[],precipProbability:[],precip1h:[],visibility:[],humidity:[],windSpeed:[],windDir:[],windGust:[],sigwaveHeight:[],sigwaveDir:[],windwaveHeight:[],windwaveDir:[],windwavePeriod:[],swellHeight:[],swellDir:[],swellPeriod:[],currentSpeed:[],currentDir:[]};for(let U=0;U<8;U++){const Q=D(this.ts).clone().utc().add(3*U,"h").format();this.tableData.hours.push(Q);const z=((e=de.Meteo2Assist.pickHourly(this.meteoData,Q))==null?void 0:e[0])||{};this.tableData.weatherUrls.push((a=z.weather)==null?void 0:a.url),this.tableData.temp.push(this.roundPrecision((o=z.weather)==null?void 0:o.temp,0)),this.tableData.precipProbability.push(this.roundPrecision((s=(i=z.weather)==null?void 0:i.precip)==null?void 0:s.probability,0)),this.tableData.precip1h.push(this.roundPrecision((l=(n=z.weather)==null?void 0:n.precip)==null?void 0:l.sum,0)),this.tableData.visibility.push(this.roundPrecision((h=z.weather)==null?void 0:h.visibility,0)),this.tableData.windSpeed.push(this.roundPrecision((c=(p=z.weather)==null?void 0:p.wind)==null?void 0:c.kts,1)),this.tableData.windDir.push((u=(d=z.weather)==null?void 0:d.wind)==null?void 0:u.angle),this.tableData.windGust.push(this.roundPrecision((b=(m=z.weather)==null?void 0:m.wind)==null?void 0:b.gusts,1)),this.tableData.sigwaveHeight.push(this.roundPrecision((y=(f=z.wave)==null?void 0:f.sig)==null?void 0:y.height,1)),this.tableData.sigwaveDir.push((g=(w=z.wave)==null?void 0:w.sig)==null?void 0:g.degree),this.tableData.windwaveHeight.push(this.roundPrecision((C=(x=z.wave)==null?void 0:x.wd)==null?void 0:C.height,1)),this.tableData.windwaveDir.push((_=(L=z.wave)==null?void 0:L.wd)==null?void 0:_.degree),this.tableData.windwavePeriod.push(this.roundPrecision((I=(P=z.wave)==null?void 0:P.wd)==null?void 0:I.period,1)),this.tableData.swellHeight.push(this.roundPrecision((W=(M=z.wave)==null?void 0:M.swell)==null?void 0:W.height,1)),this.tableData.swellDir.push((G=(F=z.wave)==null?void 0:F.swell)==null?void 0:G.degree),this.tableData.swellPeriod.push(this.roundPrecision((X=(J=z.wave)==null?void 0:J.swell)==null?void 0:X.period,1)),this.tableData.currentSpeed.push(this.roundPrecision((q=z.current)==null?void 0:q.speed,1)),this.tableData.currentDir.push((Y=z.current)==null?void 0:Y.degree)}},handleSelectTab(r){this.activeIndex=r},handleBind(){var r,e;this.show?((r=this.map)==null||r.on("click",this.handleClick),this.map.getCanvas().style.cursor="pointer"):((e=this.map)==null||e.off("click",this.handleClick),this.map.getCanvas().style.cursor="grab",this.showMeteo=!1)},handleClick(r){r.originalEvent.stopPropagation();const e=r.originalEvent.target.className;if(e.indexOf("close")>-1)this.showMeteo=!1;else if(e==="more")this.$emit("meteoMore",this.meteoData);else if(e==="mapboxgl-canvas")this.$emit("point",r.lngLat);else return!1},handleRender(){var e;const r=document.getElementById("point-meteo");this.meteoData&&(this.meteoMarker?(e=this.meteoMarker)==null||e.setLngLat([this.meteoData.lng,this.meteoData.lat]):this.meteoMarker=new j.Marker(r).setLngLat([this.meteoData.lng,this.meteoData.lat]).addTo(this.map))}}},Ea={id:"point-meteo",class:"point-meteo"},Sa={class:"meteo-box"},Pa={class:"header-box flex-between"},Na={class:"flex-center"},za={class:"lnglat"},Ta={class:"main-box"},Va={class:"summary-row flex-between"},Da={class:"summary flex-center"},Ba=["src"],Ia={class:"temp"},Ra={class:"des info"},Ma={class:"flex-start"},Wa={class:"flex-start"},Aa={class:"flex-start"},Oa={class:"date flex-col-center-end"},Fa={class:""},ja={class:""},$a={class:"detail-box"},Ha={class:"menu-header flex-start"},Ua={key:0,class:"basic-table"},Za={class:"day"},Ga={class:"hour"},Ja={class:"icon"},Xa=["src"],qa={class:"text"},Ya={class:"text"},Qa={class:"text"},Ka={class:"text"},er={key:1,class:"wave-current-table"},tr={class:"day"},ar={class:"hour"},rr={class:"icon"},ir=["src"],or={class:"text"},sr={class:"text"},nr={class:"text"},lr={class:"text"};function cr(r,e,a,o,i,s){var h,p,c,d,u,m,b,f,y,w,g,x,C,L;const n=t.resolveComponent("LocationFilled"),l=t.resolveComponent("ElIcon");return t.openBlock(),t.createElementBlock("div",null,[t.withDirectives(t.createElementVNode("div",Ea,[t.createElementVNode("div",Sa,[t.createElementVNode("div",Pa,[t.createElementVNode("div",Na,[t.createVNode(l,{size:"22"},{default:t.withCtx(()=>[t.createVNode(n)]),_:1}),t.createElementVNode("div",za,t.toDisplayString(s.computeLat((h=i.meteoData)==null?void 0:h.lat))+","+t.toDisplayString(s.computeLng((p=i.meteoData)==null?void 0:p.lng)),1)]),t.createElementVNode("div",{class:"iconfont close",onClick:e[0]||(e[0]=_=>i.showMeteo=!1)},"")]),t.createElementVNode("div",Ta,[t.createElementVNode("div",Va,[t.createElementVNode("div",Da,[t.createElementVNode("img",{class:"iconfont icon",style:{"margin-right":"5px"},src:(d=(c=i.currentHourData)==null?void 0:c.weather)==null?void 0:d.url},null,8,Ba),t.createElementVNode("div",Ia,[t.createElementVNode("span",null,[t.createTextVNode(t.toDisplayString(s.roundPrecision((m=(u=i.currentHourData)==null?void 0:u.weather)==null?void 0:m.temp,0)),1),e[4]||(e[4]=t.createElementVNode("span",{style:{"font-size":"14px"}},"°C",-1))])]),t.createElementVNode("div",Ra,[t.createElementVNode("div",Ma,[e[5]||(e[5]=t.createElementVNode("label",null,"Precip : ",-1)),t.createElementVNode("span",null,t.toDisplayString(s.roundPrecision((y=(f=(b=i.currentHourData)==null?void 0:b.weather)==null?void 0:f.precip)==null?void 0:y.sum,0))+" mm",1)]),t.createElementVNode("div",Wa,[e[6]||(e[6]=t.createElementVNode("label",null,"Visibility : ",-1)),t.createElementVNode("span",null,t.toDisplayString(s.roundPrecision((g=(w=i.currentHourData)==null?void 0:w.weather)==null?void 0:g.visibility,0))+" nm",1)]),t.createElementVNode("div",Aa,[e[7]||(e[7]=t.createElementVNode("label",null,"Wind : ",-1)),t.createElementVNode("span",null,t.toDisplayString(s.roundPrecision((L=(C=(x=i.currentHourData)==null?void 0:x.weather)==null?void 0:C.wind)==null?void 0:L.kts,1))+" kts",1)])])]),t.createElementVNode("div",Oa,[t.createElementVNode("div",Fa,t.toDisplayString(s.computeTime(a.ts,a.timeZone)),1),t.createElementVNode("div",ja,t.toDisplayString(s.computeTimeZone),1)])]),t.createElementVNode("div",$a,[t.createElementVNode("div",Ha,[t.createElementVNode("div",{class:t.normalizeClass(["menu-item",i.activeIndex===1?"active":""]),onClick:e[1]||(e[1]=t.withModifiers(_=>s.handleSelectTab(1),["prevent"]))},"Basis",2),t.createElementVNode("div",{class:t.normalizeClass(["menu-item",i.activeIndex===2?"active":""]),onClick:e[2]||(e[2]=t.withModifiers(_=>s.handleSelectTab(2),["prevent"]))},"Wave & Current",2)]),i.activeIndex===1?(t.openBlock(),t.createElementBlock("table",Ua,[t.createElementVNode("tr",Za,[e[8]||(e[8]=t.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[t.createTextVNode("Hours"),t.createElementVNode("span",{class:"unit"})],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.hours,_=>(t.openBlock(),t.createElementBlock("th",{rowspan:"1",colspan:"1",key:Math.random()},t.toDisplayString(s.computeHourL(_,a.timeZone)),1))),128))]),t.createElementVNode("tr",Ga,[e[9]||(e[9]=t.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},null,-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.hours,_=>(t.openBlock(),t.createElementBlock("th",{rowspan:"1",colspan:"1",key:Math.random()},t.toDisplayString(s.computeHourZ(_)),1))),128))]),t.createElementVNode("tr",Ja,[e[10]||(e[10]=t.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},null,-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.weatherUrls,_=>(t.openBlock(),t.createElementBlock("th",{rowspan:"1",colspan:"1",key:Math.random()},[t.createElementVNode("img",{class:"iconfont weather-icon",src:_},null,8,Xa)]))),128))]),t.createElementVNode("tr",qa,[e[11]||(e[11]=t.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[t.createTextVNode("Temp"),t.createElementVNode("span",{class:"unit"},"°C")],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.temp,_=>(t.openBlock(),t.createElementBlock("td",{rowspan:"1",colspan:"1",key:Math.random()},t.toDisplayString(_),1))),128))]),t.createElementVNode("tr",Ya,[e[12]||(e[12]=t.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[t.createTextVNode("Precip"),t.createElementVNode("span",{class:"unit"},"mm")],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.precip1h,_=>(t.openBlock(),t.createElementBlock("td",{rowspan:"1",colspan:"1",key:Math.random()},t.toDisplayString(_),1))),128))]),t.createElementVNode("tr",Qa,[e[13]||(e[13]=t.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[t.createTextVNode("Visibility"),t.createElementVNode("span",{class:"unit"},"nm")],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.visibility,_=>(t.openBlock(),t.createElementBlock("td",{rowspan:"1",colspan:"1",key:Math.random()},t.toDisplayString(_),1))),128))]),t.createElementVNode("tr",Ka,[e[14]||(e[14]=t.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[t.createTextVNode("Wind"),t.createElementVNode("span",{class:"unit"},"kts")],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.windSpeed,(_,P)=>(t.openBlock(),t.createElementBlock("td",{rowspan:"1",colspan:"1",key:Math.random()},[t.createElementVNode("span",{class:"iconfont icon blue",style:t.normalizeStyle({display:"inline-block",transform:`rotate(${i.tableData.windDir[P]}deg)`})},"",4),t.createElementVNode("span",null,t.toDisplayString(_),1)]))),128))])])):t.createCommentVNode("",!0),i.activeIndex===2?(t.openBlock(),t.createElementBlock("table",er,[t.createElementVNode("tr",tr,[e[15]||(e[15]=t.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[t.createTextVNode("Hours"),t.createElementVNode("span",{class:"unit"})],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.hours,_=>(t.openBlock(),t.createElementBlock("th",{rowspan:"1",colspan:"1",key:Math.random()},t.toDisplayString(s.computeHourL(_,a.timeZone)),1))),128))]),t.createElementVNode("tr",ar,[e[16]||(e[16]=t.createElementVNode("th",{rowspan:"1",colspan:"1"},null,-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.hours,_=>(t.openBlock(),t.createElementBlock("th",{rowspan:"1",colspan:"1",key:Math.random()},t.toDisplayString(s.computeHourZ(_)),1))),128))]),t.createElementVNode("tr",rr,[e[17]||(e[17]=t.createElementVNode("th",{rowspan:"1",colspan:"1"},null,-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.weatherUrls,_=>(t.openBlock(),t.createElementBlock("th",{rowspan:"1",colspan:"1",key:Math.random()},[t.createElementVNode("img",{class:"iconfont weather-icon",src:_},null,8,ir)]))),128))]),t.createElementVNode("tr",or,[e[18]||(e[18]=t.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[t.createTextVNode("Sig Wave"),t.createElementVNode("span",{class:"unit"},"m")],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.sigwaveHeight,(_,P)=>(t.openBlock(),t.createElementBlock("td",{rowspan:"1",colspan:"1",key:Math.random()},[t.createElementVNode("span",{class:"iconfont icon blue",style:t.normalizeStyle({display:"inline-block",transform:`rotate(${i.tableData.sigwaveDir[P]}deg)`})},"",4),t.createElementVNode("span",null,t.toDisplayString(_),1)]))),128))]),t.createElementVNode("tr",sr,[e[19]||(e[19]=t.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[t.createTextVNode("Wind Wave"),t.createElementVNode("span",{class:"unit"},"m")],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.windwaveHeight,(_,P)=>(t.openBlock(),t.createElementBlock("td",{rowspan:"1",colspan:"1",key:Math.random()},[t.createElementVNode("span",{class:"iconfont icon orange",style:t.normalizeStyle({display:"inline-block",transform:`rotate(${i.tableData.sigwaveDir[P]}deg)`})},"",4),t.createElementVNode("span",null,t.toDisplayString(_),1)]))),128))]),t.createElementVNode("tr",nr,[e[20]||(e[20]=t.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[t.createTextVNode("Swell"),t.createElementVNode("span",{class:"unit"},"m")],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.swellHeight,(_,P)=>(t.openBlock(),t.createElementBlock("td",{rowspan:"1",colspan:"1",key:Math.random()},[t.createElementVNode("span",{class:"iconfont icon orange",style:t.normalizeStyle({display:"inline-block",transform:`rotate(${i.tableData.swellDir[P]}deg)`})},"",4),t.createElementVNode("span",null,t.toDisplayString(_),1)]))),128))]),t.createElementVNode("tr",lr,[e[21]||(e[21]=t.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[t.createTextVNode("Current"),t.createElementVNode("span",{class:"unit"},"kts")],-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData.currentSpeed,(_,P)=>(t.openBlock(),t.createElementBlock("td",{rowspan:"1",colspan:"1",key:Math.random()},[t.createElementVNode("span",{class:"iconfont icon gray",style:t.normalizeStyle({display:"inline-block",transform:`rotate(${i.tableData.currentDir[P]}deg)`})},"",4),t.createElementVNode("span",null,t.toDisplayString(_),1)]))),128))])])):t.createCommentVNode("",!0)])]),r.$attrs.permission&i.helper.LEVEL.Prime?(t.openBlock(),t.createElementBlock("div",{key:0,class:"more",onClick:e[3]||(e[3]=t.withModifiers((..._)=>r.handleMore&&r.handleMore(..._),["prevent"]))},e[22]||(e[22]=[t.createElementVNode("span",{class:"more"},"More >>",-1)]))):t.createCommentVNode("",!0)])],512),[[t.vShow,i.showMeteo]])])}const hr=E(ka,[["render",cr],["__scopeId","data-v-1f6333db"]]),dr={name:"IdmWarZone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"war-zone-source",zoneLayer:"war-zone-layer",zoneLabelLayer:"war-zone-label-layer"}},watch:{zone:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.zone&&(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-color":"#f44336","fill-opacity":.4}},this.beforeLayer),this.map.addLayer({id:this.zoneLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":1,"line-color":"#f44336"}},this.beforeLayer),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-1]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneLayer+"-border")&&this.map.removeLayer(this.zoneLayer+"-border"),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function pr(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const mr=E(dr,[["render",pr]]),yr={name:"IdmGmdssArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"gmdss-area-source",areaLayer:"gmdss-area-layer",areaLabelLayer:"gmdss-area-label-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":["match",["get","val"],"AreaI","#EB8996","AreaII","#6F448B","AreaIII","#3E8BD3","AreaIV","#5EBCC4","AreaV","#00AAE7","AreaVI","#9CCE6D","AreaVII","#F4AE00","AreaVIII","#EF9A85","AreaIX","#00AAA7","AreaX","#7AC49F","AreaXI","#DFDFDF","AreaXII","#FFF974","AreaXIII","#EF9A85","AreaXIV","#86A2D1","AreaXV","#EC8972","AreaXVI","#EAC2DA","AreaXVII","#B9C8E7","AreaXVIII","#BBA1C8","AreaXIX","#FAE0BD","AreaXX","#DBECC8","AreaXXI","#D496AF","#ffffff"]}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":12,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-opacity":.8,"text-color":"#000"}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function fr(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const ur=E(yr,[["render",fr]]),gr={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 r;this.map?(this.handleClear(),this.zone&&(this.map.getSource(this.source)?(r=this.map)==null||r.getSource(this.source).setData(this.zone):(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":"#05f324"}}),this.map.addLayer({id:this.zoneLayer+"-border",type:"line",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-color":"#04c021","line-width":1,"line-opacity":1}},this.beforeLayer),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-max-width":16,"text-justify":"left","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}})))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneLayer+"-border")&&this.map.removeLayer(this.zoneLayer+"-border"),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function br(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const wr=E(gr,[["render",br]]),Ci="",Lr={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 r,e;this.zone?(this.handleRender(),(r=this.map)==null||r.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(r){var o;const e=r.features[0],a=(o=this.zone)==null?void 0:o.features.filter(i=>{var s;return i.properties.id===((s=e==null?void 0:e.properties)==null?void 0:s.id)})[0];if(a){this.showZone=!0,this.form={...a.properties};const i=document.getElementById("idm-gl3-zone-info");this.marker?this.marker.setLngLat([r.lngLat.lng,r.lngLat.lat]):this.marker=new j.Marker(i).setLngLat([r.lngLat.lng,r.lngLat.lat]).setOffset([0,0]).addTo(this.map)}},handleRender(){var r;this.map?(this.handleClear(),this.zone&&(this.map.getSource(this.source)?(r=this.map)==null||r.getSource(this.source).setData(this.zone):(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.polygonLayer,type:"fill",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"fill-outline-color":"#d57d02","fill-opacity":.4,"fill-color":"#d57d02"}}),this.map.addLayer({id:this.polygonLayer+"-border",type:"line",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-width":1,"line-color":"#d57d02"}}),this.map.addLayer({id:this.lineLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["!=","disabled",!0]],paint:{"line-color":"#d57d02","line-width":2}}),this.map.addLayer({id:this.polygonLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-image":"alert","icon-size":.08,"icon-allow-overlap":!0,"icon-rotation-alignment":"viewport"},paint:{"icon-opacity":.8}}),this.map.addLayer({id:this.lineLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","LineString"],["!=","disabled",!0]],layout:{"symbol-placement":"line-center","icon-image":"alert","icon-size":.08,"icon-allow-overlap":!0,"icon-rotation-alignment":"viewport"},paint:{"icon-opacity":.8}}),this.map.addLayer({id:this.pointLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-image":"alert","icon-size":.08},paint:{"icon-opacity":.8}})))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.polygonLayer)&&this.map.removeLayer(this.polygonLayer),this.map.getLayer(this.polygonLayer+"-border")&&this.map.removeLayer(this.polygonLayer+"-border"),this.map.getLayer(this.polygonLabelLayer)&&this.map.removeLayer(this.polygonLabelLayer),this.map.getLayer(this.lineLayer)&&this.map.removeLayer(this.lineLayer),this.map.getLayer(this.lineLabelLayer)&&this.map.removeLayer(this.lineLabelLayer),this.map.getLayer(this.pointLayer)&&this.map.removeLayer(this.pointLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},xr={id:"idm-gl3-zone-info"},_r=["innerHTML"];function vr(r,e,a,o,i,s){var n;return t.withDirectives((t.openBlock(),t.createElementBlock("div",xr,[t.createElementVNode("div",{class:"iconfont close",onClick:e[0]||(e[0]=l=>i.showZone=!1)},""),t.createElementVNode("div",{class:"rich-context",innerHTML:(n=i.form)==null?void 0:n.name},null,8,_r)],512)),[[t.vShow,i.showZone]])}const Cr=E(Lr,[["render",vr]]),ki="",kr={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(r){return k.LngLatHelper.lat2pretty(r,4).pretty}},computeLng(){return function(r){return k.LngLatHelper.lng2pretty(r,4).pretty}}},watch:{port:{handler(){var r,e;this.port?(this.handleRender(),(r=this.map)==null||r.on("click",[this.layer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.layer],this.handleClick))}}},methods:{handleClick(r){var o;const e=r.features[0],a=(o=this.port)==null?void 0:o.features.filter(i=>{var s;return i.properties.id===((s=e==null?void 0:e.properties)==null?void 0:s.id)})[0];if(a){this.showPort=!0,this.form={...a.properties},this.form.lng=a.geometry.coordinates[0],this.form.lat=a.geometry.coordinates[1];const i=document.getElementById("port-info");this.marker?this.marker.setLngLat([r.lngLat.lng,r.lngLat.lat]):this.marker=new j.Marker(i).setLngLat([r.lngLat.lng,r.lngLat.lat]).setOffset([0,-85]).addTo(this.map)}},handleEmit(){this.$emit("port",this.form)},handleRender(){var r;this.map?this.port&&(this.map.getSource(this.source)?(r=this.map)==null||r.getSource(this.source).setData(this.port):(this.map.addSource(this.source,{type:"geojson",data:this.port}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"port","text-anchor":"left","text-field":"{name}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[1,0]},paint:{"text-color":"rgba(0, 0, 0, 0.8)","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.showPort=!1,this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},Er={id:"port-info"},Sr={class:"port-box"},Pr={class:"flex-start"},Nr={class:"flex-start"},zr={class:"flex-start"},Tr={class:"flex-start",style:{"align-items":"flex-start"}};function Vr(r,e,a,o,i,s){return t.withDirectives((t.openBlock(),t.createElementBlock("div",Er,[t.createElementVNode("div",{class:"close iconfont",onClick:e[0]||(e[0]=n=>i.showPort=!1)},""),t.createElementVNode("div",Sr,[t.createElementVNode("div",Pr,[e[2]||(e[2]=t.createElementVNode("label",null,"Name : ",-1)),t.createElementVNode("span",{onClick:e[1]||(e[1]=(...n)=>s.handleEmit&&s.handleEmit(...n))},t.toDisplayString(i.form.name),1)]),t.createElementVNode("div",Nr,[e[3]||(e[3]=t.createElementVNode("label",null,"Position : ",-1)),t.createElementVNode("span",null,t.toDisplayString(s.computeLat(i.form.lat))+", "+t.toDisplayString(s.computeLng(i.form.lng)),1)]),t.createElementVNode("div",zr,[e[4]||(e[4]=t.createElementVNode("label",null,"LoCode : ",-1)),t.createElementVNode("span",null,t.toDisplayString(i.form.loCode||"-"),1)]),t.createElementVNode("div",Tr,[e[5]||(e[5]=t.createElementVNode("label",null,"Region : ",-1)),t.createElementVNode("span",null,t.toDisplayString(i.form.zoneName||"-"),1)])])],512)),[[t.vShow,i.showPort]])}const Dr=E(kr,[["render",Vr],["__scopeId","data-v-c07e4c45"]]),Br={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 Ir(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const Rr=E(Br,[["render",Ir]]),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 Wr(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const Ar=E(Mr,[["render",Wr]]),Or={name:"IdmVoluntaryReportingArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"vra-source",areaLayer:"vra-layer",areaLabelLayer:"vra-label-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":"#9f30f9"}},this.beforeLayer),this.map.addLayer({id:this.areaLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":1,"line-color":"#9f30f9"}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLayer+"-border")&&this.map.removeLayer(this.areaLayer+"-border"),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Fr(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const jr=E(Or,[["render",Fr]]),$r={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(r=>{r.geometry.type==="Polygon"&&r.geometry.coordinates.forEach(e=>k.LngLatHelper.convertToMonotonicLng2(e))}),this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":["match",["get","val"],"DefaultStyle","rgb(0,0,0)","JWCriskArea","rgb(0,0,0)","rgb(0,0,0)"]}},this.beforeLayer),this.map.addLayer({id:this.areaLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":.4,"line-color":"rgb(0,0,0)"}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLayer+"-border")&&this.map.removeLayer(this.areaLayer+"-border"),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Hr(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const Ur=E($r,[["render",Hr]]),Zr={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 Gr(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const Jr=E(Zr,[["render",Gr]]),Ei="",Xr={name:"IdmLatLng",props:{map:{type:Object},show:{type:Boolean},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{lngLat:void 0,source:"idm-lat-lng-source",layer:"idm-lat-lng-layer",labelLayer:"idm-lat-lng-label-layer",right:10}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){var r;this.map&&((r=this.map)==null||r.on("mousemove",this.handleMouseMove))},immediate:!0},toggleVersion:{handler(){var r,e;this.right=(((r=document.getElementsByClassName("legend-bars")[0])==null?void 0:r.clientWidth)||-10)+(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+20},immediate:!0}},methods:{handleBind(){var r,e;this.show?((r=this.map)==null||r.on("zoomend",this.handleZoomEnd),this.handleRender()):(this.handleClear(),(e=this.map)==null||e.off("zoomend",this.handleZoomEnd))},handleMouseMove(r){const e=r.lngLat,a=k.LngLatHelper.lng2pretty(e.lng,2),o=k.LngLatHelper.lat2pretty(e.lat,2);this.lngLat={lng:a,lat:o}},handleComputeLatLngs(){var o;const r=(o=this.map)==null?void 0:o.getZoom();console.log(r);let e=30;r>4?e=10:r>3&&(e=15);const a=[];for(let i=-60;i<90;i+=e)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[-180,i],[180,i]]}});for(let i=-180;i<180;i+=e)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[i,-90],[i,90]]}});for(let i=180;i>-180;i-=e)for(let s=-60;s<90;s+=e)a.push({type:"Feature",geometry:{type:"Point",coordinates:[i,s]},properties:{val:`${s>0?s+" N":s===0?s:s*-1+" S"}, ${i>0?i+" E":i*-1+" W"}`}});return a},handleZoomEnd(){var e;const r=this.handleComputeLatLngs();(e=this.map)==null||e.getSource(this.source).setData(v.featureCollection(r))},handleRender(){if(this.map){const r=this.handleComputeLatLngs();this.map.addSource(this.source,{type:"geojson",data:{type:"FeatureCollection",features:r}}),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 r,e,a,o,i,s;(r=this.map)!=null&&r.getLayer(this.layer)&&((e=this.map)==null||e.removeLayer(this.layer)),(a=this.map)!=null&&a.getLayer(this.labelLayer)&&((o=this.map)==null||o.removeLayer(this.labelLayer)),(i=this.map)!=null&&i.getSource(this.source)&&((s=this.map)==null||s.removeSource(this.source))}}};function qr(r,e,a,o,i,s){return i.lngLat?(t.openBlock(),t.createElementBlock("div",{key:0,class:"lat-lng-tip",style:t.normalizeStyle({right:i.right+"px",bottom:a.bottom})},[t.createElementVNode("span",null,t.toDisplayString(i.lngLat.lat.pretty),1),e[0]||(e[0]=t.createElementVNode("span",null,", ",-1)),t.createElementVNode("span",null,t.toDisplayString(i.lngLat.lng.pretty),1)],4)):t.createCommentVNode("",!0)}const he=E(Xr,[["render",qr],["__scopeId","data-v-73241fe7"]]),Yr={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 r,e,a,o,i,s,n,l,h,p;if(this.show)(r=this.map)==null||r.getCanvas().addEventListener("keydown",this.handleKeydown),(e=this.map)==null||e.on("mousemove",this.handleMove),(a=this.map)==null||a.on("dblclick",this.handleDblClick),(o=this.map)==null||o.on("click",this.handleClick),(i=this.map)==null||i.on("contextmenu",this.handleContextmenu),this.map&&(this.map.getCanvas().style.cursor="crosshair");else{(s=this.map)==null||s.getCanvas().removeEventListener("keydown",this.handleKeydown),(n=this.map)==null||n.off("mousemove",this.handleMove),(l=this.map)==null||l.off("dblclick",this.handleDblClick),(h=this.map)==null||h.off("click",this.handleClick),(p=this.map)==null||p.off("contextmenu",this.handleContextmenu);for(const c of this.geojson)this.handleClear(c,!0);this.geojson=[],this.map&&(this.map.getCanvas().style.cursor="grab")}},handleKeydown(r){if(r.key==="Shift"){this.navigation=this.navigation==="RL"?"GC":"RL";const a=this.geojson.at(-1).features.filter(o=>o.geometry.type==="Point");a.length&&(a.at(-1).properties.mode=this.navigation)}},handleDrag(r){var a,o,i,s,n,l,h,p,c,d;const e=(o=(a=r.target)==null?void 0:a._element)==null?void 0:o.id;if((e==null?void 0:e.split("-").length)===2){const u=this.geojson.filter(y=>y.id===e.split("-")[0])[0];this.pointMarkers[u.id].filter(y=>{var w;return((w=y._element)==null?void 0:w.id)===e})[0].setLngLat([(s=(i=r.target)==null?void 0:i._lngLat)==null?void 0:s.lng,(l=(n=r.target)==null?void 0:n._lngLat)==null?void 0:l.lat]);let b;u.features.forEach((y,w)=>{if(y.geometry.type==="Point"&&y.properties.id==e.split("-")[1]){b=w;return}});const f=u.features.filter(y=>y.geometry.type==="Point");this.handleTmpPointUpdate(u,f[b-1],{lng:(p=(h=r.target)==null?void 0:h._lngLat)==null?void 0:p.lng,lat:(d=(c=r.target)==null?void 0:c._lngLat)==null?void 0:d.lat,properties:f[b].properties},b===f.length-1?void 0:f[b+1])}},handleDragEnd(r){var a,o,i,s,n,l,h,p,c,d;const e=(o=(a=r.target)==null?void 0:a._element)==null?void 0:o.id;if((e==null?void 0:e.split("-").length)===2){const u=this.geojson.filter(f=>f.id===e.split("-")[0])[0];this.pointMarkers[u.id].filter(f=>{var y;return((y=f._element)==null?void 0:y.id)===e})[0].setLngLat([(s=(i=r.target)==null?void 0:i._lngLat)==null?void 0:s.lng,(l=(n=r.target)==null?void 0:n._lngLat)==null?void 0:l.lat]);const b=u.features.filter(f=>f.geometry.type==="Point"&&f.properties.id==e.split("-")[1])[0];b.geometry.coordinates=[(p=(h=r.target)==null?void 0:h._lngLat)==null?void 0:p.lng,(d=(c=r.target)==null?void 0:c._lngLat)==null?void 0:d.lat],u.features=u.features.filter(f=>f.geometry.type==="Point"),this.handlePointUpdate(u)}},handleContextmenu(r){var a,o,i,s;r.preventDefault(),(a=this.contextmenu)==null||a.remove();const e=(s=(i=(o=r.originalEvent)==null?void 0:o.target)==null?void 0:i.parentElement)==null?void 0:s.id;if((e==null?void 0:e.split("-").length)===2){const l=this.geojson.filter(h=>h.id===e.split("-")[0])[0].features.filter(h=>h.geometry.type==="Point");if(l.length>2&&l.filter(p=>p.properties.id===(e==null?void 0:e.split("-")[1]))[0]){const p=document.createElement("div");p.className="point-contextmenu-marker",p.innerHTML=`<span id="del-${e}" class="del-point">Del</span>`,this.contextmenu=new j.Marker(p).setOffset([24,0]).setLngLat([r.lngLat.lng,r.lngLat.lat]).addTo(this.map)}}},handleClick(r){var a,o,i,s,n;(a=this.contextmenu)==null||a.remove();const e=r.originalEvent.target.className;if(e==="marker-close"){const l=(i=(o=r.originalEvent)==null?void 0:o.srcElement)==null?void 0:i.id,h=this.geojson.filter(p=>p.id===l)[0];h&&this.handleClear(h,!0),this.geojson=this.geojson.filter(p=>p.id!==l)}else if(e==="del-point"){const l=(n=(s=r.originalEvent.target.id)==null?void 0:s.replace("del-",""))==null?void 0:n.split("-"),h=this.geojson.filter(p=>p.id===l[0])[0];h.features=h.features.filter(p=>p.geometry.type==="Point"&&p.properties.id!==l[1]),this.handlePointUpdate(h)}else if(e!=="marker-label"){let l=this.geojson.at(-1);l||(l=v.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(l)),l.features=l.features.filter(p=>p.geometry.type==="Point");const h=v.feature({type:"Point",coordinates:[r.lngLat.lng,r.lngLat.lat]},{id:new Date().getTime().toString(),mode:this.navigation});l.features.push(h),this.handlePointUpdate(l)}},handlePointUpdate(r){const e=r.features;if(e.length>1){let a=0;const o=[];for(let i=1;i<e.length;i++){const s=e[i-1],n=e[i],l=s.properties,h={lng:s.geometry.coordinates[0],lat:s.geometry.coordinates[1]},p={lng:n.geometry.coordinates[0],lat:n.geometry.coordinates[1]},c=k.LaneHelper.calculateDistance(h,p,l.mode==="RL",2),d=k.LaneHelper.calculateBearing(h,p,l.mode==="RL",2);a=k.LngLatHelper.roundPrecision(a+c,2);let u;l.mode==="RL"?u=k.LngLatHelper.convertToMonotonicLng([h,p]):u=k.LngLatHelper.convertToMonotonicLng(k.LaneHelper.interpolateCoordinates(h,p,200));const m=v.lineString(u.map(b=>[b.lng,b.lat]));m.properties.dist=c,m.properties.bearing=d,m.properties.total=a,o.push(m)}e.push(...o),r.total=a}return this.handleRender(r),r},handleTmpPointUpdate(r,e,a,o){const i=v.featureCollection([]);let s,n;if(e){const h=e.properties,p={lng:e.geometry.coordinates[0],lat:e.geometry.coordinates[1]},c={lng:a.lng,lat:a.lat};s=k.LaneHelper.calculateDistance(p,c,h.mode==="RL",2),n=k.LaneHelper.calculateBearing(p,c,h.mode==="RL",2);let d;h.mode==="RL"?d=k.LngLatHelper.convertToMonotonicLng([p,c]):d=k.LngLatHelper.convertToMonotonicLng(k.LaneHelper.interpolateCoordinates(p,c,200));const u=v.lineString(d.map(m=>[m.lng,m.lat]));u.properties.dist=s,u.properties.bearing=n,i.features.push(u)}if(o){const h=a.properties,p=a,c={lng:o.geometry.coordinates[0],lat:o.geometry.coordinates[1]};s=k.LaneHelper.calculateDistance(p,c,h.mode==="RL",2),n=k.LaneHelper.calculateBearing(p,c,h.mode==="RL",2);let d;h.mode==="RL"?d=k.LngLatHelper.convertToMonotonicLng([p,c]):d=k.LngLatHelper.convertToMonotonicLng(k.LaneHelper.interpolateCoordinates(p,c,200));const u=v.lineString(d.map(m=>[m.lng,m.lat]));u.properties.dist=s,u.properties.bearing=n,i.features.push(u)}this.map.getSource(this.tmpSource)?this.map.getSource(this.tmpSource).setData(i):this.map.addSource(this.tmpSource,{type:"geojson",data:i}),this.map.getLayer(this.tmpLayer)||this.map.addLayer({id:this.tmpLayer,type:"line",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#F44336","line-width":2,"line-opacity":1,"line-dasharray":[3,2]}}),this.map.getLayer(this.tmpLabelLayer)||this.map.addLayer({id:this.tmpLabelLayer,type:"symbol",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist} nm","text-rotation-alignment":"map","text-size":12},paint:{"text-opacity":1,"text-color":"#fff","text-halo-color":"#F44336","text-halo-width":4,"text-halo-blur":0}});let l;if(o?l='<div class="marker-label">Drag and drop</div>':l=`<div class="marker-label">Tol distance: <b>${k.LngLatHelper.roundPrecision((r.total??0)+s,2)}</b>nm, bearing: <b>${n}</b>°</div><div class="marker-label">${this.navigation==="RL"?"RL":"GC"} mode, using 'Shift' to switch</div><div class="marker-label">Double click to end</div>`,this.tipMarker)this.tipMarker._element.innerHTML=l,this.tipMarker.setLngLat([a.lng,a.lat]);else{const h=document.createElement("div");h.className="tip-marker",h.innerHTML=l,this.tipMarker=new j.Marker(h).setOffset([140,0]).setLngLat([a.lng,a.lat]).addTo(this.map)}},handleMove(r){this.map.getCanvas().style.cursor="crosshair";let e=this.geojson.at(-1);e||(e=v.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e));const a=e.features.filter(o=>o.geometry.type==="Point");a!=null&&a.length&&this.handleTmpPointUpdate(e,a.at(-1),{lng:r.lngLat.lng,lat:r.lngLat.lat})},handleDblClick(r){r.preventDefault();let e=this.geojson.at(-1);e.closed=!0,this.handleRender(e),e=v.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e)},handleRender(r){var e;if((e=r==null?void 0:r.features)!=null&&e.length){const a=`${r.id}-${this.source}`,o=`${r.id}-${this.layer}`,i=`${r.id}-${this.labelLayer}`;this.map.getSource(a)?this.map.getSource(a).setData(r):this.map.addSource(a,{type:"geojson",data:r}),this.handleClear(r,!1),this.map.addLayer({id:o,type:"line",source:a,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#F44336","line-width":2}}),this.map.addLayer({id:i,type:"symbol",source:a,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=r.features.filter(n=>n.geometry.type==="Point");for(const n of s){const l=document.createElement("div");l.id=`${r.id}-${n.properties.id}`,l.className=`${r.closed?"point-marker closed":"point-marker"}`,l.innerHTML='<div class="marker-circle"></div>';const h=new j.Marker({element:l,draggable:!0,contextmenu:!0}).setLngLat(n.geometry.coordinates).addTo(this.map);h.on("drag",this.handleDrag),h.on("dragend",this.handleDragEnd),this.pointMarkers[r.id]?this.pointMarkers[r.id].push(h):this.pointMarkers[r.id]=[h]}if(r.closed){const n=s.at(-1),h=r.features.filter(c=>c.geometry.type==="LineString").at(-1),p=document.createElement("div");p.className="point-summary-marker",p.innerHTML=`<div id="${r.id}" class="marker-close">×</div><div class="marker-label">Tol: ${h.properties.total}nm</div>`,this.closeMarkers[r.id]=new j.Marker(p).setOffset([60,0]).setLngLat(n.geometry.coordinates).addTo(this.map)}}},handleClear(r,e=!0){var s,n,l,h,p,c,d,u,m;const a=`${r.id}-${this.source}`,o=`${r.id}-${this.layer}`,i=`${r.id}-${this.labelLayer}`;(s=this.map)!=null&&s.getLayer(o)&&this.map.removeLayer(o),(n=this.map)!=null&&n.getLayer(i)&&this.map.removeLayer(i),(l=this.map)!=null&&l.getLayer(this.tmpLayer)&&this.map.removeLayer(this.tmpLayer),(h=this.map)!=null&&h.getLayer(this.tmpLabelLayer)&&this.map.removeLayer(this.tmpLabelLayer),(p=this.closeMarkers[r.id])==null||p.remove(),this.closeMarkers[r.id]=void 0,(c=this.pointMarkers[r.id])==null||c.forEach(b=>{b==null||b.remove()}),this.pointMarkers[r.id]=[],(d=this.tipMarker)==null||d.remove(),this.tipMarker=void 0,e&&((u=this.map)!=null&&u.getSource(a))&&this.map.removeSource(a),e&&((m=this.map)!=null&&m.getSource(this.tmpSource))&&this.map.removeSource(this.tmpSource)}}};function Qr(r,e,a,o,i,s){return t.openBlock(),t.createElementBlock("div")}const Kr=E(Yr,[["render",Qr]]),Si="",ei={name:"IdmENC",props:{map:{type:Object},enabled:{type:Boolean},beforeLayer:{type:String,default:"grayland"},bottom:{type:String,default:"280px"},token:{type:String,default:""},toggleVersion:{type:Number},permission:{type:Number}},emits:["enc"],data(){return{helper:V.CompanyHelper,vendor:this.$attrs.permission&V.CompanyHelper.LEVEL.Supper?"hi":"i4",right:10}},watch:{vendor:{handler(){this.$emit("enc",this.vendor)},immediate:!0},toggleVersion:{handler(){var r;this.right=(((r=document.getElementsByClassName("right-bar")[0])==null?void 0:r.clientWidth)||0)+10},immediate:!0}},methods:{}},ti={key:0},ai={class:"bar-item"};function ri(r,e,a,o,i,s){const n=t.resolveComponent("ElTooltip");return a.enabled&&a.permission&i.helper.LEVEL.Supper?(t.openBlock(),t.createElementBlock("div",ti,[t.createElementVNode("div",{class:"menu-bar-box",style:t.normalizeStyle({position:"absolute",right:i.right+"px",bottom:a.bottom})},[t.createElementVNode("div",ai,[t.createVNode(n,{placement:"left",effect:"light",content:"Hifleet","show-after":1e3},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(i.vendor==="hi"?"menu-icon active":"menu-icon"),onClick:e[0]||(e[0]=l=>i.vendor="hi")},e[2]||(e[2]=[t.createElementVNode("span",{class:"iconfont"},"HI",-1)]),2)]),_:1}),t.createVNode(n,{placement:"left",effect:"light",content:"I4insight","show-after":1e3},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(i.vendor==="i4"?"menu-icon active":"menu-icon"),onClick:e[1]||(e[1]=l=>i.vendor="i4")},e[3]||(e[3]=[t.createElementVNode("span",{class:"iconfont"},"I4",-1)]),2)]),_:1})])],4)])):t.createCommentVNode("",!0)}const ii=E(ei,[["render",ri],["__scopeId","data-v-150235f7"]]),Pi="",oi={name:"IdmGLV2",components:{IdmGlLayer:dt,IdmWindBarb:ft,IdmWindParticle:wt,IdmCurrents:vt,IdmCurrentParticle:St,IdmSigWave:zt,IdmSwell:Dt,IdmPrmsl:Rt,IdmIceberg:At,IdmTropicals:ce,IdmPrecip3h:sa,IdmVisibility:ha,IdmWaterTemp:ya,IdmTemp:ba,IdmArctic:_a,IdmWarZone:mr,IdmGmdssArea:ur,IdmEcaZone:wr,IdmAlertZone:Cr,IdmPort:Dr,IdmLoadLine:Rr,IdmTimezone:Ar,IdmVRA:jr,IdmSpecialArea:Ur,IdmTerminator:Jr,IdmLatLng:he,IdmMeasure:Kr,IdmPoint:hr,IdmENC:ii},props:{map:{type:Object,default:void 0},token:{type:String},ts:{type:String},beforeLayer:{type:String,default:""},toggleVersion:{type:Number}},emits:["toggleVersion","activeWeatherLayers","showMeteoPoint"],data(){return{weatherLayers:{},activeWeatherLayers:[],weatherWeight:0,otherLayers:{},otherWeight:0,showCoord:!1,showMeasure:!1,showPoint:!1,show3d:!1,meteo:void 0,source:"",gateway:"https://cbe.idmwx.com",mapProjection:"mercator",zoom:6,viewport:void 0,particleFactor:void 0,showRampColor:!1,activeWindLayer:!1,showWindFeather:!1,showWindParticle:!1,showCurrentIsoband:!1,showCurrentParticle:!1,enc:"",defaultMeteoToken:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNseTVudHJzYzAwNWUwbHBsZHkyaDRqczMiLCJyb2xlIjoxLCJuYW1lIjoiZmFrZUBvcm13eC5jb20iLCJwbGF0SWQiOiJnZDBtdDFkIiwiY29tcGFueSI6eyJpZCI6bnVsbCwiY2hpbGRyZW4iOltdfSwiaWF0IjoxNzIzMDI0MDI0LCJleHAiOjM5MzA1NDQwMjR9.RrKcdcMnq-FxBLJQ-i6lx2FscDE46y8EvHIemPW4HTg",helper:new pe}},watch:{ts:{handler(r,e){r&&e&&D(r).utc().format("yyyy-MM-DD HH")!==D(e).utc().format("yyyy-MM-DD HH")&&this.$nextTick(()=>{this.handleDateChange({tropicals:!1})})},immediate:!0},map:{handler(){this.map&&(this.map.on("zoomend",this.handleDragEndWithZoom4Json),this.map.on("dragend",this.handleDragEndWithZoom4Json),this.map.on("move",this.handleDragEndWithZoom4Image),this.viewport=new oe(this.map),this.handleRampColorInitial())},immediate:!0},enc:{handler(r,e){var a,o,i,s,n,l,h,p;r?((o=(a=this.map)==null?void 0:a.getLayer(r))==null||o.setLayoutProperty("visibility","visible"),(s=(i=this.map)==null?void 0:i.getLayer(e))==null||s.setLayoutProperty("visibility","none")):((l=(n=this.map)==null?void 0:n.getLayer("i4"))==null||l.setLayoutProperty("visibility","none"),(p=(h=this.map)==null?void 0:h.getLayer("hi"))==null||p.setLayoutProperty("visibility","none"))}},activeWeatherLayers:{handler(){var r,e,a,o,i,s,n,l,h,p,c,d,u,m,b,f,y,w;if(!this.map)return!1;this.activeWeatherLayers.length>0?((e=(r=this.map)==null?void 0:r.getLayer(this.enc))==null||e.setLayoutProperty("visibility","none"),(o=(a=this.map)==null?void 0:a.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))==null||o.setLayoutProperty("visibility","visible"),(s=this.map)!=null&&s.getLayer((i=this.viewport)==null?void 0:i.rampColorLayer)&&((n=this.map)!=null&&n.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&this.mapProjection==="mercator"&&((h=this.map)==null||h.moveLayer((l=this.viewport)==null?void 0:l.rampColorLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)),(c=this.map)!=null&&c.getLayer((p=this.viewport)==null?void 0:p.particleLayer)&&((d=this.map)!=null&&d.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&this.mapProjection==="mercator"&&((m=this.map)==null||m.moveLayer((u=this.viewport)==null?void 0:u.particleLayer,this.helper.mapboxCustomer.layers.countryBoundary.id))):((f=(b=this.map)==null?void 0:b.getLayer(this.enc))==null||f.setLayoutProperty("visibility","visible"),(w=(y=this.map)==null?void 0:y.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))==null||w.setLayoutProperty("visibility","none")),this.$emit("activeWeatherLayers",this.activeWeatherLayers)},immediate:!0},showPoint:{handler(){this.$emit("showMeteoPoint",this.showPoint)}}},methods:{async fetchWeatherLayers(r={tropicals:!1}){var i,s,n,l,h,p,c,d;const e=new Date().valueOf();let a=0,o=0;if(this.map){const u=((i=this.map)==null?void 0:i.getZoom())+1,m=(s=this.map)==null?void 0:s.getBounds(),b=`${m._sw.lng},${m._sw.lat},${m._ne.lng},${m._ne.lat}`;if(this.particleFactor){const f=V.LayerHelper.WEATHER_LAYERS.find(y=>{var w;return((w=y.peer)==null?void 0:w.weight)===this.particleFactor.weight});this.particleFactor.particle?this.weatherWeight=this.weatherWeight&f.weight?this.weatherWeight:this.weatherWeight+f.weight:this.weatherWeight=this.weatherWeight&f.weight?this.weatherWeight-f.weight:this.weatherWeight}if(this.weatherWeight>0){let f=this.weatherWeight,y;if(r.tropicals||this.weatherWeight&256&&(y=this.weatherLayers.tropicals,y&&(f-=256,y.version=Math.random()+1)),f>0){const w=await $.get(`${this.gateway}/api/arc/weather/layers/links?l=${f}&v=${this.source}&z=${u}&bbox=${b}&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(o=new Date().valueOf()-(e+a),console.log("weather links elapsed: ",o,", total: ",a+=o),((n=w==null?void 0:w.data)==null?void 0:n.code)===0){const g=(l=w==null?void 0:w.data)==null?void 0:l.data,x=[];for(const L in g)L==="ice-edge"&&(g[L]="https://idm-hz.oss-cn-hangzhou.aliyuncs.com/test/sea_ice_contours.geojson"),L!=="tropicals"&&x.push($.get(g[L],{headers:{Authorization:this.token||this.defaultMeteoToken,key:L},responseType:/\.(jpg|png)$/.test(g[L])?"blob":"json"}).catch(_=>{console.log(`[${L}] fetch layer error: ${_}`)}));const C=await Promise.all(x);this.weatherLayers={},C.map(L=>{var I,M,W,F;const _=((I=L==null?void 0:L.data)==null?void 0:I.data)||(L==null?void 0:L.data),P=(W=(M=L==null?void 0:L.config)==null?void 0:M.headers)==null?void 0:W.key;P&&_&&(this.weatherLayers[P]={raw:_,type:((F=L==null?void 0:L.config)==null?void 0:F.responseType)==="blob"?"image":"json",etime:this.ts})}),g.tropicals&&$.get(g.tropicals,{headers:{Authorization:this.token||this.defaultMeteoToken,key:"tropicals"}}).then(L=>{var I,M,W;const _=k.TropicalHelper.convert2Geojson(((I=L==null?void 0:L.data)==null?void 0:I.data)||(L==null?void 0:L.data)),P=(W=(M=L==null?void 0:L.config)==null?void 0:M.headers)==null?void 0:W.key;this.weatherLayers[P]={data:_,active:!0,cached:!1,type:"json",etime:this.ts,version:Math.random()+1}})}if(o=new Date().valueOf()-(e+a),console.log("weather layers elapsed: ",o,", total: ",a+=o),this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const g=(h=this.weatherLayers["swell-direction"])==null?void 0:h.raw,x=(p=this.weatherLayers["swell-height"])==null?void 0:p.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers.swell={type:"json",direction:g,height:{raw:x},etime:this.ts}}if(this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const g=(c=this.weatherLayers["current-direction"])==null?void 0:c.raw,x=(d=this.weatherLayers["current-speed"])==null?void 0:d.raw;delete this.weatherLayers["current-direction"],delete this.weatherLayers["current-speed"],this.weatherLayers.current={type:"json",direction:g,speed:{raw:x},etime:this.ts}}}y&&(y.etime=this.ts,y.cached=!0,this.weatherLayers.tropicals=y)}this.handleWeatherLayerToggle(),this.handleDragEndWithZoom4Json()}this.$emit("toggleVersion",Math.random())},async fetchOtherLayers(r={all:!1,dayNight:!1,enc:!1}){var e,a,o,i;if(this.map){let s=this.otherWeight;if(s){let n=!1;if(this.otherWeight&2048&&(s=this.otherWeight-2048,n=!0),s){if(r.all){const l=await $.get(`${this.gateway}/api/arc/other/layers/links?l=${s}&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(((e=l==null?void 0:l.data)==null?void 0:e.code)===0){const h=(a=l==null?void 0:l.data)==null?void 0:a.data,p=[];for(const d in h)p.push($.get(h[d],{headers:{Authorization:this.token||this.defaultMeteoToken,key:d}}));const c=await Promise.all(p);this.otherLayers={enc:n},c.map(d=>{var b,f,y;const u=((b=d==null?void 0:d.data)==null?void 0:b.data)||(d==null?void 0:d.data),m=(y=(f=d==null?void 0:d.config)==null?void 0:f.headers)==null?void 0:y.key;this.otherLayers[m]=u})}}else if(r.dayNight&&s&1024){const l=await $.get(`${this.gateway}/api/arc/other/layers/links?l=1024&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(((o=l==null?void 0:l.data)==null?void 0:o.code)===0){const h=(i=l==null?void 0:l.data)==null?void 0:i.data,p=[];for(const d in h)p.push($.get(h[d],{headers:{Authorization:this.token||this.defaultMeteoToken,key:d}}));(await Promise.all(p)).map(d=>{var b,f,y;const u=((b=d==null?void 0:d.data)==null?void 0:b.data)||(d==null?void 0:d.data),m=(y=(f=d==null?void 0:d.config)==null?void 0:f.headers)==null?void 0:y.key;this.otherLayers[m]=u})}}}else this.otherLayers={enc:n}}else this.otherLayers={};this.handleBeforeLayerToggle()}},handleRampColorState(){var r;if(this.showRampColor=!1,this.showWindParticle=!1,this.showCurrentParticle=!1,(r=this.particleFactor)!=null&&r.particle)this.showRampColor=!0,this.particleFactor.key==="wind"&&(this.showWindParticle=!0),this.particleFactor.key==="current"&&(this.showCurrentParticle=!0);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 r,e,a,o,i,s,n,l,h,p,c,d;this.viewport.map.getSource((r=this.viewport)==null?void 0:r.rampColorSource)||this.viewport.map.addSource((e=this.viewport)==null?void 0:e.rampColorSource,{type:"canvas",canvas:(a=this.viewport)==null?void 0:a.rampColorCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((o=this.viewport)==null?void 0:o.rampColorLayer)||this.viewport.map.addLayer({type:"raster",id:(i=this.viewport)==null?void 0:i.rampColorLayer,source:(s=this.viewport)==null?void 0:s.rampColorSource,layout:{visibility:"none"}},this.beforeLayer),this.viewport.map.getSource((n=this.viewport)==null?void 0:n.particleSource)||this.viewport.map.addSource((l=this.viewport)==null?void 0:l.particleSource,{type:"canvas",canvas:(h=this.viewport)==null?void 0:h.particleCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((p=this.viewport)==null?void 0:p.particleLayer)||this.viewport.map.addLayer({type:"raster",id:(c=this.viewport)==null?void 0:c.particleLayer,source:(d=this.viewport)==null?void 0:d.particleSource,layout:{visibility:"none"}},this.beforeLayer)},handleDragEndWithZoom4Json(){var p,c,d,u;const r=new Date().valueOf();let e=0,a=0;const o=(p=this.map)==null?void 0:p.getBounds(),i=this.map.getZoom(),s=k.LngLatHelper.convertToStdLng(o._sw.lng),n=k.LngLatHelper.convertToStdLng(o._ne.lng),l=Math.floor(o._sw.lat),h=Math.ceil(o._ne.lat);for(const m in this.weatherLayers)if(this.weatherLayers[m].active&&this.weatherLayers[m].type==="json"){this.weatherLayers[m].active=!1,this.weatherLayers[m].version=Math.random()+1;let b=[];if(["swell","current"].includes(m)){const f=((c=this.weatherLayers[m])==null?void 0:c.direction)||{};for(const y in f)if(y>l&&y<h&&(!(i<=this.zoom)||y%(i<this.zoom/2?5:3)===0)){const w=f[y].lng;s>n?w.forEach((g,x)=>{var C;if((g>=s&&g<=180||g>=-180&&g<=n)&&(!(i<=this.zoom)||g%(i<this.zoom/2?5:3)===0)){const L=v.point([g,y],{val:f[y].val[x],spd:(C=f[y].spd)==null?void 0:C[x]});b.push(L)}}):w.forEach((g,x)=>{var C;if(g>=s&&g<=n&&(!(i<=this.zoom)||g%(i<this.zoom/2?5:3)===0)){const L=v.point([g,y],{val:f[y].val[x],spd:(C=f[y].spd)==null?void 0:C[x]});b.push(L)}})}if(a=new Date().valueOf()-(r+e),console.log("direction elapsed: ",a,", total: ",e+=a),m==="swell"){const y=this.weatherLayers[m].height;if(y){if(!y.data){const w=[];for(const g in(d=y.raw)==null?void 0:d.LineString){const x=y.raw.LineString[g];for(const C of x)w.push(v.lineString(C,{val:Number(g)}));y.data=v.featureCollection(w)}}if(y.data){const w=this.handleBboxClip(y.data,o);b=b.concat(w)}a=new Date().valueOf()-(r+e),console.log("height elapsed: ",a,", total: ",e+=a)}}if(m==="current"){const y=this.weatherLayers[m].speed;if(y){if(!y.data){const g=[];for(const x in(u=y.raw)==null?void 0:u.Polygon){const C=y.raw.Polygon[x];for(const L of C)g.push(v.polygon(L,{val:Number(x)}))}y.data=v.featureCollection(g)}const w=i<this.zoom?y.data.features.filter(g=>g.properties.val>.5):y.data.features;b=b.concat(w),a=new Date().valueOf()-(r+e),console.log("speed elapsed: ",a,", total: ",e+=a)}}}else if(m==="wind"){const f=this.weatherLayers.wind.raw;for(const y in f)if(y>l&&y<h&&(!(i<=this.zoom)||y%(i<this.zoom/2?5:3)===0)){const w=f[y].lng;s>n?w.forEach((g,x)=>{if((g>=s&&g<=180||g>=-180&&g<=n)&&(!(i<=this.zoom)||g%(i<this.zoom/2?5:3)===0)){const C=v.point([g,y],{val:f[y].val[x],spd:f[y].spd[x]});b.push(C)}}):w.forEach((g,x)=>{if(g>=s&&g<=n&&(!(i<=this.zoom)||g%(i<this.zoom/2?5:3)===0)){const C=v.point([g,y],{val:f[y].val[x],spd:f[y].spd[x]});b.push(C)}})}a=new Date().valueOf()-(r+e),console.log("wind barb elapsed: ",a,", total: ",e+=a)}else if(m==="sig-wave-height"){if(this.weatherLayers[m].data)b=this.weatherLayers[m].data;else{const f=this.weatherLayers[m].raw;if(f){const y=[];for(const w in f.Polygon){const g=f.Polygon[w];for(const x of g)y.push(v.polygon(x,{val:Number(w)}))}for(const w in f.Point){const g=f.Point[w];for(const x of g)y.push(...v.points(x,{val:Number(w)}).features)}b=b.concat(y)}}a=new Date().valueOf()-(r+e),console.log("sigWave elapsed: ",a,", total: ",e+=a)}else if(m==="prmsl"){if(this.weatherLayers[m].data)b=this.weatherLayers[m].data;else{const f=this.weatherLayers[m].raw;if(f){const y=[];for(const w in f.LineString){const g=f.LineString[w];for(const x of g)y.push(v.lineString(x,{val:Number(w)}))}for(const w in f.Point)f.Point[w].lng.forEach((g,x)=>{g=k.LngLatHelper.convertToStdLng(g),y.push(v.point([g,w],{val:f.Point[w].val[x],type:f.Point[w].type[x]}))});b=b.concat(y)}}a=new Date().valueOf()-(r+e),console.log("prmsl elapsed: ",a,", total: ",e+=a)}else if(m==="arctic"||m==="iceberg"){if(this.weatherLayers[m].data)b=this.weatherLayers[m].data;else{const f=this.weatherLayers[m].raw;if(f){const y=[];for(const w in f.LineString){const g=f.LineString[w];for(const x of g)y.push(v.lineString(x,{val:Number(w)}))}b=b.concat(y)}}a=new Date().valueOf()-(r+e)}console.log(m," elapsed: ",a,", total: ",e+=a),b.length&&(this.weatherLayers[m].data=v.featureCollection(b)),this.weatherLayers[m].active=!0,this.weatherLayers[m].version=Math.random()+1}},handleDragEndWithZoom4Image(){for(const r in this.weatherLayers)this.weatherLayers[r].active&&this.weatherLayers[r].type==="image"&&(this.weatherLayers[r].active=!0,this.weatherLayers[r].version=Math.random()+1)},handleBboxClip(r,e){const a=[],o=k.LngLatHelper.convertToStdLng(e._sw.lng),i=k.LngLatHelper.convertToStdLng(e._ne.lng);return r.features.forEach(s=>{if(s.geometry.type!=="Point")if(o>i){let n=[o,e._sw.lat,180,e._ne.lat],l=v.bboxClip(s,n);l.geometry.coordinates.length&&a.push(l),n=[-180,e._sw.lat,i,e._ne.lat],l=v.bboxClip(s,n),l.geometry.coordinates.length&&a.push(l)}else{const n=[o,e._sw.lat,i,e._ne.lat],l=v.bboxClip(s,n);l.geometry.coordinates.length&&a.push(l)}else a.push(s)}),a},handleWeatherLayerToggle(){var r;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 a=e.key;a.indexOf("swell")>-1?a="swell":a.indexOf("current")>-1&&(a="current"),this.weatherLayers[a]&&(this.weatherLayers[a].active=!0,this.weatherLayers[a].version=Math.random()+1,((r=this.particleFactor)==null?void 0:r.key)===a&&this.weatherLayers[`${a}-particle`]&&(this.weatherLayers[`${a}-particle`].active=this.particleFactor.particle))}this.handleBeforeLayerToggle()},handleBeforeLayerToggle(){var r,e,a,o,i,s,n,l,h,p,c,d,u;(r=this.map)!=null&&r.getLayer(this.beforeLayer)&&((e=this.activeWeatherLayers)!=null&&e.length||(a=this.otherLayers)!=null&&a["war-zones"]||(o=this.otherLayers)!=null&&o["gmdss-areas"]||(i=this.otherLayers)!=null&&i["load-lines"]||(s=this.otherLayers)!=null&&s["high-risk-area"]||(n=this.otherLayers)!=null&&n["time-zones"]||(l=this.otherLayers)!=null&&l.pirates||(h=this.otherLayers)!=null&&h.ports||(p=this.otherLayers)!=null&&p.enc||(c=this.otherLayers)!=null&&c["voluntary-reporting-area"]||(d=this.otherLayers)!=null&&d["eca-zones"]||(u=this.otherLayers)!=null&&u["special-area"])&&this.map.setLayoutProperty(this.beforeLayer,"visibility","visible")},handleDateChange(r={tropicals:!1}){this.fetchWeatherLayers(r),this.fetchOtherLayers({dayNight:!0})},handleWeatherLayerChange(r,e){this.showWindParticle=!1,this.showCurrentParticle=!1,this.map?setTimeout(()=>{this.activeWeatherLayers=JSON.parse(JSON.stringify(r));const a=this.activeWeatherLayers.some(s=>{var n;return["wind","current"].includes(s.key)&&(!((n=Object.keys(s))!=null&&n.some(l=>l==="particle"))||!!s.particle)}),o=this.activeWeatherLayers.some(s=>["png","jpg"].includes(s.type));a&&!o?(this.activeWeatherLayers.forEach(s=>{s.key==="wind"&&s.particle&&(this.particleFactor=s,this.showWindParticle=!0),s.key==="current"&&s.particle&&(this.particleFactor=s,this.showCurrentParticle=!0)}),this.particleFactor.particle=!0):o&&this.particleFactor&&(this.particleFactor.particle=!1);const i=r==null?void 0:r.reduce((s,n)=>s+(s&(n==null?void 0:n.weight)?0:n==null?void 0:n.weight),0);this.weatherWeight!==i||this.source!==e?(this.source=e,this.weatherWeight=i,this.fetchWeatherLayers({tropicals:!1})):this.handleWeatherLayerToggle()}):setTimeout(()=>{this.handleWeatherLayerChange(r,e)},500)},handleOtherLayerChange(r){if(!this.map)setTimeout(()=>{this.handleOtherLayerChange(r)},500);else{const e=r==null?void 0:r.reduce((a,o)=>a+(o==null?void 0:o.weight),0);r.find(a=>a.key==="enc")?this.enc="i4":this.enc="",this.otherWeight!=e&&(this.otherWeight=e,this.fetchOtherLayers({all:!0}))}},async handlePointChange(r){const e=this.ts?D(this.ts).utc().add(-1,"d").format():D().add(-1,"d").utc().format(),a={lat:r.lat,lng:r.lng,datetime:e,forecastDays:8,selfHosted:!1},o=await $.post(`${this.gateway}/api/arc/meteo2/spot/forecast`,a,{headers:{Authorization:this.token||this.defaultMeteoToken}});(o==null?void 0:o.data.code)===0&&(this.meteo={...o==null?void 0:o.data.data,...r})},handle3dToggle(r){var e,a,o,i,s,n,l,h,p,c,d,u,m,b,f,y,w,g,x,C;r?(this.map.setProjection("globe"),this.mapProjection="globe",(a=this.map)!=null&&a.getLayer((e=this.viewport)==null?void 0:e.rampColorLayer)&&((o=this.map)!=null&&o.getLayer(this.helper.mapboxCustomer.layers.water.id))&&((s=this.map)==null||s.moveLayer((i=this.viewport)==null?void 0:i.rampColorLayer,this.helper.mapboxCustomer.layers.water.id)),(l=this.map)!=null&&l.getLayer((n=this.viewport)==null?void 0:n.particleLayer)&&((h=this.map)!=null&&h.getLayer(this.helper.mapboxCustomer.layers.water.id))&&((c=this.map)==null||c.moveLayer((p=this.viewport)==null?void 0:p.particleLayer,this.helper.mapboxCustomer.layers.water.id)),this.map.off("zoomend",this.handleDragEndWithZoom4Json),this.map.off("dragend",this.handleDragEndWithZoom4Json),this.map.off("move",this.handleDragEndWithZoom4Image)):(this.map.setProjection("mercator"),this.mapProjection="mercator",this.map.on("zoomend",this.handleDragEndWithZoom4Json),this.map.on("dragend",this.handleDragEndWithZoom4Json),this.map.on("move",this.handleDragEndWithZoom4Image),this.handleDragEndWithZoom4Image(),this.handleDragEndWithZoom4Json(),(u=this.map)!=null&&u.getLayer((d=this.viewport)==null?void 0:d.rampColorLayer)&&((m=this.map)!=null&&m.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&((f=this.map)==null||f.moveLayer((b=this.viewport)==null?void 0:b.rampColorLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)),(w=this.map)!=null&&w.getLayer((y=this.viewport)==null?void 0:y.particleLayer)&&((g=this.map)!=null&&g.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&((C=this.map)==null||C.moveLayer((x=this.viewport)==null?void 0:x.particleLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)))},handleParticle(r){this.particleFactor=r,this.weatherLayers[r.key]&&(this.weatherLayers[r.key].particle=r.particle),this.activeWeatherLayers.map(o=>{var i;return o.key===r.key?o.particle=r.particle:(i=Object.keys(o))!=null&&i.some(s=>s==="particle")&&(o.particle=!1),o});let e=localStorage.getItem("activeWeatherLayersCache");const a=JSON.parse(e)||[];a==null||a.forEach(o=>{var i;o.key===r.key?o.particle=r.particle:(i=Object.keys(o))!=null&&i.some(s=>s==="particle")&&(o.particle=!1)}),localStorage.setItem("activeWeatherLayersCache",JSON.stringify(a)),this.fetchWeatherLayers({tropicals:!1})},handleToggleVersion(){this.$emit("toggleVersion",Math.random())}}},si={key:0,className:"map-gl-home"};function ni(r,e,a,o,i,s){var z,Z,K,se,ee,N,O,ne,te,le,ae,re,ie,ye,fe,ue,ge,be,we,Le,xe,_e,ve,Ce,ke,Ee;const n=t.resolveComponent("IdmGlLayer"),l=t.resolveComponent("IdmENC"),h=t.resolveComponent("IdmSigWave"),p=t.resolveComponent("IdmSwell"),c=t.resolveComponent("IdmPrmsl"),d=t.resolveComponent("IdmIceberg"),u=t.resolveComponent("IdmTropicals"),m=t.resolveComponent("IdmCurrents"),b=t.resolveComponent("IdmCurrentParticle"),f=t.resolveComponent("IdmWindBarb"),y=t.resolveComponent("IdmWindParticle"),w=t.resolveComponent("IdmPrecip3h"),g=t.resolveComponent("IdmVisibility"),x=t.resolveComponent("IdmWaterTemp"),C=t.resolveComponent("IdmTemp"),L=t.resolveComponent("IdmArctic"),_=t.resolveComponent("IdmWarZone"),P=t.resolveComponent("IdmGmdssArea"),I=t.resolveComponent("IdmEcaZone"),M=t.resolveComponent("IdmAlertZone"),W=t.resolveComponent("IdmPort"),F=t.resolveComponent("IdmLoadLine"),G=t.resolveComponent("IdmTimezone"),J=t.resolveComponent("IdmVRA"),X=t.resolveComponent("IdmSpecialArea"),q=t.resolveComponent("IdmTerminator"),Y=t.resolveComponent("IdmLatLng"),U=t.resolveComponent("IdmMeasure"),Q=t.resolveComponent("IdmPoint");return a.map?(t.openBlock(),t.createElementBlock("div",si,[t.createVNode(n,t.mergeProps({ref:"layer",map:a.map,"toggle-version":a.toggleVersion,"map-projection":i.mapProjection,showWindFeather:i.showWindFeather,showWindParticle:i.showWindParticle,showCurrentIsoband:i.showCurrentIsoband,showCurrentParticle:i.showCurrentParticle},r.$attrs,{onWeather:s.handleWeatherLayerChange,onOther:s.handleOtherLayerChange,onToggleWindParticle:e[0]||(e[0]=A=>i.showWindParticle=A),onToggleWindFeather:e[1]||(e[1]=A=>i.showWindFeather=A),onToggleCurrentParticle:e[2]||(e[2]=A=>i.showCurrentParticle=A),onToggleCurrentIsoband:e[3]||(e[3]=A=>i.showCurrentIsoband=A),onCoordinate:e[4]||(e[4]=A=>i.showCoord=A),onMeasure:e[5]||(e[5]=A=>i.showMeasure=A),onPoint:e[6]||(e[6]=A=>i.showPoint=A),on3d:s.handle3dToggle,onHandleToggleVersion:s.handleToggleVersion}),null,16,["map","toggle-version","map-projection","showWindFeather","showWindParticle","showCurrentIsoband","showCurrentParticle","onWeather","onOther","on3d","onHandleToggleVersion"]),t.createVNode(l,t.mergeProps({map:a.map,token:a.token,enabled:(z=i.otherLayers)==null?void 0:z.enc,"toggle-version":a.toggleVersion},r.$attrs,{onEnc:e[7]||(e[7]=A=>i.enc=A)}),null,16,["map","token","enabled","toggle-version"]),t.createVNode(h,t.mergeProps({map:a.map,"sig-wave":(Z=i.weatherLayers)==null?void 0:Z["sig-wave-height"],"before-layer":a.beforeLayer,activeWeatherLayers:i.activeWeatherLayers},r.$attrs),null,16,["map","sig-wave","before-layer","activeWeatherLayers"]),t.createVNode(p,t.mergeProps({map:a.map,swell:(K=i.weatherLayers)==null?void 0:K.swell,"before-layer":a.beforeLayer,activeWeatherLayers:i.activeWeatherLayers},r.$attrs),null,16,["map","swell","before-layer","activeWeatherLayers"]),t.createVNode(c,t.mergeProps({map:a.map,prmsl:(se=i.weatherLayers)==null?void 0:se.prmsl,"before-layer":a.beforeLayer,"active-weather-layers":i.activeWeatherLayers},r.$attrs),null,16,["map","prmsl","before-layer","active-weather-layers"]),t.createVNode(d,t.mergeProps({map:a.map,iceberg:(ee=i.weatherLayers)==null?void 0:ee.iceberg,"before-layer":a.beforeLayer},r.$attrs),null,16,["map","iceberg","before-layer"]),t.createVNode(u,t.mergeProps({map:a.map,date:a.ts,tropicals:(N=i.weatherLayers)==null?void 0:N.tropicals,"before-layer":a.beforeLayer},r.$attrs),null,16,["map","date","tropicals","before-layer"]),t.createVNode(m,t.mergeProps({map:a.map,"map-projection":i.mapProjection,current:(O=i.weatherLayers)==null?void 0:O.current,"before-layer":a.beforeLayer,showCurrentIsoband:i.showCurrentIsoband,showCurrentParticle:i.showCurrentParticle,"margin-bottom":i.activeWindLayer?i.showRampColor?"84px":"56px":i.showRampColor?"56px":"30px","toggle-version":a.toggleVersion,"weather-layers":i.weatherLayers},r.$attrs,{onParticle:s.handleParticle,onHandleToggleVersion:s.handleToggleVersion}),null,16,["map","map-projection","current","before-layer","showCurrentIsoband","showCurrentParticle","margin-bottom","toggle-version","weather-layers","onParticle","onHandleToggleVersion"]),t.createVNode(b,t.mergeProps({viewport:i.viewport,factor:(ne=i.weatherLayers)==null?void 0:ne["current-particle"],"before-layer":a.beforeLayer,"toggle-version":a.toggleVersion},r.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),t.createVNode(f,t.mergeProps({ref:"windBarb",map:a.map,"map-projection":i.mapProjection,wind:(te=i.weatherLayers)==null?void 0:te.wind,current:(le=i.weatherLayers)==null?void 0:le.current,"before-layer":a.beforeLayer,"margin-bottom":i.showRampColor?"56px":"30px",showWindFeather:i.showWindFeather,showWindParticle:i.showWindParticle},r.$attrs,{"toggle-version":a.toggleVersion,"weather-layers":i.weatherLayers,onParticle:s.handleParticle}),null,16,["map","map-projection","wind","current","before-layer","margin-bottom","showWindFeather","showWindParticle","toggle-version","weather-layers","onParticle"]),t.createVNode(y,t.mergeProps({viewport:i.viewport,factor:(ae=i.weatherLayers)==null?void 0:ae["wind-particle"],"before-layer":a.beforeLayer,"toggle-version":a.toggleVersion},r.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),t.createVNode(w,t.mergeProps({viewport:i.viewport,factor:(re=i.weatherLayers)==null?void 0:re.precip3h,"before-layer":a.beforeLayer,"toggle-version":a.toggleVersion},r.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),t.createVNode(g,t.mergeProps({viewport:i.viewport,factor:(ie=i.weatherLayers)==null?void 0:ie.visibility,"before-layer":a.beforeLayer,"toggle-version":a.toggleVersion},r.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),t.createVNode(x,t.mergeProps({viewport:i.viewport,factor:(ye=i.weatherLayers)==null?void 0:ye["water-temp"],"before-layer":a.beforeLayer,"toggle-version":a.toggleVersion},r.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),t.createVNode(C,t.mergeProps({viewport:i.viewport,factor:(fe=i.weatherLayers)==null?void 0:fe.temp,"before-layer":a.beforeLayer,"toggle-version":a.toggleVersion},r.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),t.createVNode(L,t.mergeProps({viewport:i.viewport,factor:(ue=i.weatherLayers)==null?void 0:ue.arctic,"before-layer":a.beforeLayer,"toggle-version":a.toggleVersion},r.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),t.createVNode(_,t.mergeProps({map:a.map,zone:(ge=i.otherLayers)==null?void 0:ge["war-zones"],"before-layer":a.beforeLayer},r.$attrs),null,16,["map","zone","before-layer"]),t.createVNode(P,t.mergeProps({map:a.map,area:(be=i.otherLayers)==null?void 0:be["gmdss-areas"],"before-layer":a.beforeLayer},r.$attrs),null,16,["map","area","before-layer"]),t.createVNode(I,t.mergeProps({map:a.map,zone:(we=i.otherLayers)==null?void 0:we["eca-zones"],"before-layer":a.beforeLayer},r.$attrs),null,16,["map","zone","before-layer"]),t.createVNode(M,t.mergeProps({map:a.map,zone:(Le=i.otherLayers)==null?void 0:Le["alert-zones"],"before-layer":a.beforeLayer},r.$attrs),null,16,["map","zone","before-layer"]),t.createVNode(W,t.mergeProps({map:a.map,port:(xe=i.otherLayers)==null?void 0:xe.ports,"before-layer":a.beforeLayer},r.$attrs),null,16,["map","port","before-layer"]),t.createVNode(F,t.mergeProps({map:a.map,line:(_e=i.otherLayers)==null?void 0:_e["load-lines"],"before-layer":a.beforeLayer},r.$attrs),null,16,["map","line","before-layer"]),t.createVNode(G,t.mergeProps({map:a.map,zone:(ve=i.otherLayers)==null?void 0:ve["time-zones"],"before-layer":a.beforeLayer},r.$attrs),null,16,["map","zone","before-layer"]),t.createVNode(J,t.mergeProps({map:a.map,area:(Ce=i.otherLayers)==null?void 0:Ce["voluntary-reporting-area"],"before-layer":a.beforeLayer},r.$attrs),null,16,["map","area","before-layer"]),t.createVNode(X,t.mergeProps({map:a.map,area:(ke=i.otherLayers)==null?void 0:ke["special-area"],"before-layer":a.beforeLayer},r.$attrs),null,16,["map","area","before-layer"]),t.createVNode(q,t.mergeProps({map:a.map,area:(Ee=i.otherLayers)==null?void 0:Ee["day-night"]},r.$attrs),null,16,["map","area"]),t.createVNode(Y,t.mergeProps({map:a.map,show:i.showCoord,"toggle-version":a.toggleVersion},r.$attrs),null,16,["map","show","toggle-version"]),t.createVNode(U,t.mergeProps({map:a.map,show:i.showMeasure},r.$attrs),null,16,["map","show"]),t.createVNode(Q,t.mergeProps({map:a.map,show:i.showPoint,meteo:i.meteo,ts:a.ts,token:a.token},r.$attrs,{onPoint:s.handlePointChange}),null,16,["map","show","meteo","ts","token","onPoint"])])):t.createCommentVNode("",!0)}const me=E(oi,[["render",ni]]),li={install(r){r.component("MapboxGL",me),r.component("TropicalGL",ce),r.component("LatLngGL",he)}};S.LatLngGL=he,S.MapboxGL=me,S.MapboxGLPlugin=li,S.MapboxHelper=pe,S.ParticleSchema=R,S.TropicalGL=ce,S.Viewport=oe,S.WebGL=H,S.WebGLSchema=B,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});