@idmwx/idmui-gl4 0.5.6 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3045,7 +3045,7 @@ const vi = /* @__PURE__ */ X(yi, [["render", xi]]), _i = {
3045
3045
  }, Pi = { class: "text-caption px-2" };
3046
3046
  function Ci(o, e, t, i, a, r) {
3047
3047
  var f;
3048
- const s = x("VBtn"), c = x("VTooltip"), n = x("VCol"), p = x("VRow"), d = x("VCardText"), m = x("VCard");
3048
+ const s = x("v-btn"), c = x("v-tooltip"), n = x("v-col"), p = x("v-row"), d = x("v-card-text"), m = x("v-card");
3049
3049
  return (f = t.current) != null && f.active ? (b(), M("div", ki, [
3050
3050
  l("div", {
3051
3051
  class: "menu-bar-box pa-1 rounded",
@@ -3087,8 +3087,8 @@ function Ci(o, e, t, i, a, r) {
3087
3087
  h(p, { class: "ma-0" }, {
3088
3088
  default: g(() => [
3089
3089
  (b(!0), M(fe, null, _e(a.list, (y, w) => (b(), V(n, {
3090
- key: w,
3091
3090
  cols: "12",
3091
+ key: w,
3092
3092
  class: "d-flex flex-row justify-start align-center pa-0"
3093
3093
  }, {
3094
3094
  default: g(() => [
@@ -187,7 +187,7 @@
187
187
  gl_FragColor = vec4(
188
188
  fract(pos * 255.0),
189
189
  floor(pos * 255.0) / 255.0);
190
- }`);const qa={name:"IdmWindBarb",props:{map:{type:Object},wind:{type:Object},current:{type:Object},beforeLayer:{type:String},menuToggle:{type:Object},theme:{type:String},mapFeather:{type:String}},emits:[],data(){return{toggle:!1,showCaption:!1,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:M.featureCollection([]),right:10,bottom:125,windBarbLoaded:!1}},computed:{barbsIconName(){var t;const a=[];for(let o=0;o<((t=this.barbs)==null?void 0:t.length);o++){const r=this.barbs[o]||0,i=r<10?`00${r}kts`:r<100?`0${r}kts`:`${r}kts`;a.push("icon-a-"+i)}return a},opacity(){return this.mapFeather==="dark"||this.mapFeather==="satellite"?.6:1}},watch:{"wind.version":{handler(){var a;(a=this.wind)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10})},immediate:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle,this.showCaption=!this.showCaption},handleRender(){var a,t,o,r;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.wind){const i=new Date().valueOf();let l=0,n=0,c=this.empty;if((a=this.wind)!=null&&a.active&&(c=(t=this.wind)==null?void 0:t.data),(o=this.map)!=null&&o.getSource(this.source))(r=this.map)==null||r.getSource(this.source).setData(c),n=new Date().valueOf()-(i+l),console.log("[windBarbs] update elapsed: ",n,", total: ",l+=n);else{this.map.addSource(this.source,{type:"geojson",data:c});for(let s=0;s<(this.barbs??[]).length-1;s++){const h=(this.barbs??[])[s]||0,d=(this.barbs??[])[s+1]||0,m=h<10?`00${h}kts`:h<100?`0${h}kts`:`${h}kts`;this.map.addLayer({id:m,type:"symbol",filter:["all",[">=","spd",h],["<","spd",d]],source:this.source,layout:{"symbol-placement":"point","icon-image":m,"icon-size":.14,"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"dir",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":this.opacity}},this.beforeLayer)}this.windBarbLoaded=!0,n=new Date().valueOf()-(i+l),console.log("[windBarbs] add elapsed: ",n,", total: ",l+=n)}}},handleClear(){for(const a of this.barbs??[]){const t=a<10?`00${a}kts`:a<100?`0${a}kts`:`${a}kts`;this.map.getLayer(t)&&this.map.removeLayer(t)}this.map.getSource(this.source)&&this.map.removeSource(this.source),this.windBarbLoaded=!1}}},Ka={key:0,class:"legend-tip-btn-gl4"},Ja={class:"d-flex flex-row justify-center align-center"},Qa={class:"text-caption"};function $a(a,t,o,r,i,l){var m;const n=e.resolveComponent("v-btn"),c=e.resolveComponent("v-col"),s=e.resolveComponent("v-row"),h=e.resolveComponent("v-card-text"),d=e.resolveComponent("v-card");return(m=o.wind)!=null&&m.active?(e.openBlock(),e.createElementBlock("div",Ka,[e.createElementVNode("div",{class:"menu-bar-box pa-1 rounded",style:e.normalizeStyle({right:i.right+"px"})},[e.createVNode(n,{"min-width":"32",width:"32",height:"32",class:"text-none pa-0",color:i.toggle?"primary":"",onClick:l.handleMenuToggle},{default:e.withCtx(()=>t[0]||(t[0]=[e.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),_:1,__:[0]},8,["color","onClick"])],4),e.withDirectives(e.createVNode(d,{width:"120",elevation:"16",class:"card-info",style:e.normalizeStyle({position:"absolute",top:"300px",right:i.right+50+"px"})},{default:e.withCtx(()=>[e.createVNode(h,{class:"pa-1 text-body-2 d-flex flex-column justify-center align-start opacity-80 z"},{default:e.withCtx(()=>[t[1]||(t[1]=e.createElementVNode("div",{class:"text-body-2 ma-1"},"Wind Level",-1)),e.createVNode(s,{class:"ma-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.barbs,(g,u)=>(e.openBlock(),e.createBlock(c,{cols:"6",key:g,class:"d-flex flex-row justify-center align-center pa-1"},{default:e.withCtx(()=>[e.createElementVNode("div",Ja,[e.createElementVNode("i",{class:e.normalizeClass(["iconfont",l.barbsIconName[u]]),style:e.normalizeStyle({color:o.theme==="dark"?"#fff":"#000"})},null,6),e.createElementVNode("span",Qa,e.toDisplayString(Number(g)<10?`00${g}kts`:Number(g)<100?`0${g}kts`:`${g}kts`),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[1]})]),_:1},8,["style"]),[[e.vShow,i.showCaption]])])):e.createCommentVNode("",!0)}const ei=O(qa,[["render",$a]]),Wl="",ti={name:"IdmWindParticle",props:{factor:{type:Object},viewport:{type:Ne},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new ye,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":{async handler(){var a,t;(a=this.factor)!=null&&a.active?await this.handleRender():this.handleClear(),(t=this.factor)!=null&&t.particle||this.handleClearParticle()}},"factor.particle":{async handler(a,t){a!==t&&t!==void 0&&(a?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{async handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let t=0,o=0;await this.handleDraw(),o=new Date().valueOf()-(a+t),console.log("[wind-particle] add elapsed: ",o,", total: ",t+=o)}},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgb(98, 113, 184, 0.8)"],[12/255,"rgb(98, 113, 184)"],[24/255,"rgb(61, 110, 163)"],[32/255,"rgb(74, 146, 148)"],[40/255,"rgb(77, 142, 124)"],[60/255,"rgb(76, 164, 76)"],[80/255,"rgb(103, 164, 54)"],[100/255,"rgb(162, 135, 64)"],[120/255,"rgb(162, 109, 92)"],[140/255,"rgb(141, 63, 92)"],[160/255,"rgb(151, 75, 145)"],[200/255,"rgb(95, 100, 160)"],[240/255,"rgb(91, 136, 161)"],[1,"rgb(91, 136, 161)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:t,aPositionBuffer:o}=this.webgl.bind(this.context,X.vertexSchema,X.uvFragmentSchema);this.program=t,this.aPositionBuffer=o}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const a=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,ne.vertexSchema,ne.fragmentSchema,ne.quadVertSchema,ne.screenFragmentSchema,ne.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,a,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,9e3),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,a),this.wrapper.image=a}this.initial&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext)}},handlePause(){this.paused=!0,this.animation&&(cancelAnimationFrame(this.animation),this.viewport.toggleParticle(!1))},handlePlay(){this.paused=!1,this.animation=requestAnimationFrame(()=>{this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay()})},handleClearParticle(){var a,t,o,r,i,l,n;(a=this.viewport)==null||a.toggleParticle(!1),this.particleContext=void 0,this.initial=!0,(o=(t=this.viewport)==null?void 0:t.map)==null||o.off("resize",this.handleResize),(i=(r=this.viewport)==null?void 0:r.map)==null||i.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay),this.handlePause()},handleClear(){var a;(a=this.viewport)==null||a.toggle(!1),this.context=void 0,this.etime=void 0,this.handleClearParticle()}}},oi={key:0};function ai(a,t,o,r,i,l){var n;return(n=o.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",oi,[e.createElementVNode("div",{class:"legend-bars-gl4 wind",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"kts",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"5",-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"30",-1),e.createElementVNode("span",null,"40",-1),e.createElementVNode("span",null,"60",-1)]),4)])):e.createCommentVNode("",!0)}const ii=O(ti,[["render",ai]]),ri={name:"IdmCurrent",props:{map:{type:Object},current:{type:Object},beforeLayer:{type:String},menuToggle:{type:Object},theme:{type:String},mapFeather:{type:String}},emits:[],data(){return{right:10,toggle:!1,showCaption:!1,source:"current-source",directionLayer:"current-direction-layer",speedLayer:"current-speed-layer",speedLabelLayer:"current-speed-label-layer",empty:M.featureCollection([]),list:[{label:"0-0.5 kts",size:.25,color:"rgb(58, 164, 58)"},{label:"0.5-1 kts",size:.4,color:"#ffff00"},{label:"1-1.5 kts",size:.6,color:"#ff9500"},{label:"1.5-2 kts",size:.8,color:"#f44336"},{label:">= 2 kts",size:1,color:"#e4711e"}]}},computed:{getSvgUrlBase64(){return a=>`data:image/svg+xml;base64,${btoa(a)}`},opacity(){return this.mapFeather==="dark"||this.mapFeather==="satellite"?.6:1}},watch:{"current.version":{handler(){var a;(a=this.current)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10})},immediate:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle,this.showCaption=!this.showCaption},handleRender(){var a,t;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.current){const o=new Date().valueOf();let r=0,i=0,l=this.empty;if(this.current.active&&(l=this.current.data),(a=this.map)!=null&&a.getSource(this.source))(t=this.map)==null||t.getSource(this.source).setData(l),i=new Date().valueOf()-(o+r),console.log("[current] update elapsed: ",i,", total: ",r+=i);else{this.map.addSource(this.source,{type:"geojson",data:l}),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"],"rgb(58, 164, 58)",1,"#ffff00",2,"#ff9500",3,"#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);const n=new Image(48,48);let c='<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" p-id="12518" width="200" height="200"><path d="M481.386772 959.514313 481.386772 334.713224c-56.000432 37.288255-92.523253 55.876612-142.312216 57.787124 85.834924-84.884272 130.528845-195.161888 172.552961-328.434218 40.259936 133.272329 89.39296 238.731196 172.622546 328.434218-54.105269-5.729491-86.780459-21.201881-146.338926-58.965973l0 625.979938L481.386772 959.514313z" p-id="12519" fill="#ffffff"></path></svg>',s="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(c)));n.src=s;const h=new Image(48,48);c='<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" p-id="12518" width="200" height="200"><path d="M481.386772 959.514313 481.386772 334.713224c-56.000432 37.288255-92.523253 55.876612-142.312216 57.787124 85.834924-84.884272 130.528845-195.161888 172.552961-328.434218 40.259936 133.272329 89.39296 238.731196 172.622546 328.434218-54.105269-5.729491-86.780459-21.201881-146.338926-58.965973l0 625.979938L481.386772 959.514313z" p-id="12519" fill="#f44336"></path></svg>',s="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(c))),h.src=s;const d=[n,h];let m=0;d.forEach(g=>{g.onload=()=>{m++,this.map.hasImage("currentDirIconWhite")||this.map.addImage("currentDirIconWhite",n),this.map.hasImage("currentDirIconRed")||this.map.addImage("currentDirIconRed",h),m===2&&this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":["step",["get","spd"],"currentDirIconWhite",1,"currentDirIconWhite"],"icon-size":["step",["get","spd"],.25,.5,.4,1,.6,1.5,.8,2,1],"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":this.opacity}},this.beforeLayer)}}),i=new Date().valueOf()-(o+r),console.log("[current] add elapsed: ",i,", total: ",r+=i)}}},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)}}},li={key:0,class:"legend-tip-btn-gl4"},ni={class:"d-flex flex-row justify-start align-center"},si={class:"d-flex flex-row justify-center align-center",style:{width:"48px"}},ci={class:"text-caption px-2"};function mi(a,t,o,r,i,l){var g;const n=e.resolveComponent("VBtn"),c=e.resolveComponent("VTooltip"),s=e.resolveComponent("VCol"),h=e.resolveComponent("VRow"),d=e.resolveComponent("VCardText"),m=e.resolveComponent("VCard");return(g=o.current)!=null&&g.active?(e.openBlock(),e.createElementBlock("div",li,[e.createElementVNode("div",{class:"menu-bar-box pa-1 rounded",style:e.normalizeStyle({right:i.right+"px"})},[e.createVNode(c,{text:"Map Layers",location:"left"},{activator:e.withCtx(({props:u})=>[e.createVNode(n,e.mergeProps(u,{"min-width":"32",width:"32",height:"32",class:"text-none pa-0",color:i.toggle?"primary":"",onClick:l.handleMenuToggle}),{default:e.withCtx(()=>t[0]||(t[0]=[e.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),_:2,__:[0]},1040,["color","onClick"])]),_:1})],4),e.withDirectives(e.createVNode(m,{width:"120",elevation:"16",class:"card-info",style:e.normalizeStyle({position:"absolute",top:"340px",right:i.right+50+"px"})},{default:e.withCtx(()=>[e.createVNode(d,{class:"pa-1 text-body-2 d-flex flex-column justify-center align-start opacity-80"},{default:e.withCtx(()=>[t[1]||(t[1]=e.createElementVNode("div",{class:"text-body-2 ma-1"},"Current",-1)),e.createVNode(h,{class:"ma-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.list,(u,f)=>(e.openBlock(),e.createBlock(s,{key:f,cols:"12",class:"d-flex flex-row justify-start align-center pa-0"},{default:e.withCtx(()=>[e.createElementVNode("div",ni,[e.createElementVNode("div",si,[e.createElementVNode("i",{class:"iconfont icon-direction-arrow opacity-80",style:e.normalizeStyle({fontSize:48*u.size+"px"})},null,4)]),e.createElementVNode("div",ci,e.toDisplayString(u.label),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[1]})]),_:1},8,["style"]),[[e.vShow,i.showCaption]])])):e.createCommentVNode("",!0)}const di=O(ri,[["render",mi]]),Ul="",hi={name:"IdmCurrentParticle",props:{factor:{type:Object},viewport:{type:Ne},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new ye,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],scale:.3},paused:!1,initial:!0,right:10}},watch:{"factor.version":{async handler(){var a,t;console.log("factor.version",this.viewport),(a=this.factor)!=null&&a.active?await this.handleRender():this.handleClear(),(t=this.factor)!=null&&t.particle||this.handleClearParticle()}},"factor.particle":{async handler(a,t){a!==t&&t!==void 0&&(console.log("factor.particle",a,t,this.viewport),a?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{async handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let t=0,o=0;await this.handleDraw(),o=new Date().valueOf()-(a+t),console.log("[current-particle] add elapsed: ",o,", total: ",t+=o)}},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0/255,"rgba(95, 143, 197,1)"],[5/255,"rgba(64,127,115,1)"],[10/255,"rgb(58,164,58)"],[15/255,"rgb(191,182,67)"],[20/255,"rgb(197,154,68)"],[30/255,"rgb(160,70,94)"],[40/255,"rgb(138,84,166)"],[45/255,"rgb(82,113,165)"],[50/255,"rgb(84,142,152)"],[65/255,"rgb(150,181,184)"],[80/255,"rgb(195,194,194)"],[254/255,"rgb(195,194,194)"],[1,"rgb(195,194,194)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:t,aPositionBuffer:o}=this.webgl.bind(this.context,X.vertexSchema,X.uvFragmentSchema);this.program=t,this.aPositionBuffer=o}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const a=[[0,"rgb(183,224,224)"],[1,"rgb(199,202,202)"],[.6,"rgb(199,202,202)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,ne.vertexSchema,ne.fragmentSchema,ne.quadVertSchema,ne.screenFragmentSchema,ne.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,a,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,9e3),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,a),this.wrapper.image=a}this.initial&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext)}},handlePause(){this.paused=!0,this.animation&&(cancelAnimationFrame(this.animation),this.viewport.toggleParticle(!1))},handlePlay(){this.paused=!1,this.animation=requestAnimationFrame(()=>{this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay()})},handleClearParticle(){var a,t,o,r,i,l,n;(a=this.viewport)==null||a.toggleParticle(!1),this.particleContext=void 0,this.initial=!0,(o=(t=this.viewport)==null?void 0:t.map)==null||o.off("resize",this.handleResize),(i=(r=this.viewport)==null?void 0:r.map)==null||i.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay),this.handlePause()},handleClear(){var a;(a=this.viewport)==null||a.toggle(!1),this.context=void 0,this.etime=void 0,this.handleClearParticle()}}},pi={key:0};function gi(a,t,o,r,i,l){var n;return(n=o.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",pi,[e.createElementVNode("div",{class:"legend-bars-gl4 current",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"kts",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"0.4",-1),e.createElementVNode("span",null,"0.8",-1),e.createElementVNode("span",null,"1.6",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"3.2",-1)]),4)])):e.createCommentVNode("",!0)}const ui=O(hi,[["render",gi]]),Yl="",fi={name:"IdmTemp",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new ye,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let t=0,o=0;this.handleDraw(),o=new Date().valueOf()-(a+t),console.log("[sig-wave] add elapsed: ",o,", total: ",t+=o)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgb(50, 158, 186)"],[10/255,"rgb(50, 158, 186)"],[20/255,"rgb(48, 128, 164)"],[30/255,"rgb(48, 99, 142)"],[40/255,"rgb(57, 61, 143)"],[50/255,"rgb(179, 86, 189)"],[60/255,"rgb(154, 45, 123)"],[80/255,"rgb(134, 48, 48)"],[120/255,"rgb(194, 77, 91)"],[150/255,"rgb(192, 118, 105)"],[180/255,"rgb(192, 163, 157)"],[1,"rgb(192, 163, 157)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:t,aPositionBuffer:o}=this.webgl.bind(this.context,X.vertexSchema,X.fragmentSchema);this.program=t,this.aPositionBuffer=o}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},yi={key:0};function bi(a,t,o,r,i,l){var n;return(n=o.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",yi,[e.createElementVNode("div",{class:"legend-bars-gl4 sig-wave",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"m",-1),e.createElementVNode("span",null,"0.5",-1),e.createElementVNode("span",null,"1",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"6",-1),e.createElementVNode("span",null,"9",-1)]),4)])):e.createCommentVNode("",!0)}const wi=O(fi,[["render",bi],["__scopeId","data-v-79ce70e2"]]),xi={name:"IdmSigWave",props:{map:{type:Object},sigWaveHeight:{type:Object},beforeLayer:{type:String},menuToggle:{type:Object}},data(){return{right:10,toggle:!1,showCaption:!1,source:"sig-wave-height-source",heightLayer:"sig-wave-height-layer",heightLabelLayer:"sig-wave-height-label-layer",empty:M.featureCollection([]),list:[{label:"< 2 m",color:"rgba(0,235,156,0)"},{label:"2-3 m",color:"rgba(0,235,156,0.4)"},{label:"3-4 m",color:"#ffed00"},{label:"4-5 m",color:"#ff9800"},{label:"5-6 m",color:"#f77800"},{label:"6-7 m",color:"#e4711e"},{label:"7-8 m",color:"#e06128"},{label:"8-9 m",color:"#dc5132"},{label:"9-10 m",color:"#d5453c"},{label:"10-12 m",color:"#cd3a46"},{label:"12-14 m",color:"#be2c50"},{label:"14-16 m",color:"#aa1a5a"},{label:"16-18 m",color:"#962878"},{label:"18-20 m",color:"#8c328c"},{label:"> 20 m",color:"#8c328c"}]}},watch:{"sigWaveHeight.version":{handler(){var a;(a=this.sigWaveHeight)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10})},immediate:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle,this.showCaption=!this.showCaption},handleRender(){var a,t;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.sigWaveHeight){const o=new Date().valueOf();let r=0,i=0,l=this.empty;this.sigWaveHeight.active&&(l=this.sigWaveHeight.data),(a=this.map)!=null&&a.getSource(this.source)?((t=this.map)==null||t.getSource(this.source).setData(l),i=new Date().valueOf()-(o+r),console.log("[sig-wave-height] update elapsed: ",i,", total: ",r+=i)):(this.map.addSource(this.source,{type:"geojson",data:l}),this.map.addLayer({id:this.heightLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-color":["step",["get","val"],"rgba(0,235,156,0)",2,"rgba(0,235,156,0.4)",3,"#ffed00",4,"#ff9800",5,"#f77800",6,"#e4711e",7,"#e06128",8,"#dc5132",9,"#d5453c",10,"#cd3a46",12,"#be2c50",14,"#b41a5a",16,"#aa1464",18,"#962878",20,"#8c328c"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":["format",["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":10},paint:{"text-color":["step",["get","val"],"rgba(0, 0, 0, 0.7)",9,"rgba(255,255,255,0.8)"]}},this.beforeLayer),i=new Date().valueOf()-(o+r),console.log("[sig-wave-height] add elapsed: ",i,", total: ",r+=i))}},handleClear(){this.map.getLayer(this.heightLayer)&&this.map.removeLayer(this.heightLayer),this.map.getLayer(this.heightLabelLayer)&&this.map.removeLayer(this.heightLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},_i={key:0,class:"legend-tip-btn-gl4"},ki={class:"d-flex flex-row justify-start align-center"},zi={key:0,style:{width:"24px",height:"12px",border:"1px solid rgba(var(--v-border-color), var(--v-border-opacity))"}},vi={class:"text-caption px-2"};function Li(a,t,o,r,i,l){var m;const n=e.resolveComponent("VBtn"),c=e.resolveComponent("VCol"),s=e.resolveComponent("VRow"),h=e.resolveComponent("VCardText"),d=e.resolveComponent("VCard");return(m=o.sigWaveHeight)!=null&&m.active?(e.openBlock(),e.createElementBlock("div",_i,[e.createElementVNode("div",{class:"menu-bar-box pa-1 rounded",style:e.normalizeStyle({right:i.right+"px"})},[e.createVNode(n,{"min-width":"32",width:"32",height:"32",class:"text-none pa-0",color:i.toggle?"primary":"",onClick:l.handleMenuToggle},{default:e.withCtx(()=>t[0]||(t[0]=[e.createElementVNode("i",{class:"iconfont icon-Legend"},null,-1)])),_:1,__:[0]},8,["color","onClick"])],4),e.withDirectives(e.createVNode(d,{width:"100",elevation:"16",class:"card-info",style:e.normalizeStyle({position:"absolute",top:"240px",right:i.right+50+"px"})},{default:e.withCtx(()=>[e.createVNode(h,{class:"pa-1 text-body-2 d-flex flex-column justify-center align-start opacity-80"},{default:e.withCtx(()=>[t[1]||(t[1]=e.createElementVNode("div",{class:"text-body-2 ma-1"},"Wave Height",-1)),e.createVNode(s,{class:"ma-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.list,(g,u)=>(e.openBlock(),e.createBlock(c,{key:u,cols:"12",class:"d-flex flex-row justify-start align-center pa-1"},{default:e.withCtx(()=>[e.createElementVNode("div",ki,[u===0?(e.openBlock(),e.createElementBlock("div",zi)):(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle({width:"24px",height:"12px",background:g.color})},null,4)),e.createElementVNode("div",vi,e.toDisplayString(g.label),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[1]})]),_:1},8,["style"]),[[e.vShow,i.showCaption]])])):e.createCommentVNode("",!0)}const Ci=O(xi,[["render",Li]]),Pi={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:M.featureCollection([])}},watch:{"swell.version":{handler(){var a;(a=this.swell)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var a,t;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.swell){const o=new Date().valueOf();let r=0,i=0,l=this.empty;if(this.swell.active&&(l=this.swell.data),(a=this.map)!=null&&a.getSource(this.source))(t=this.map)==null||t.getSource(this.source).setData(l),i=new Date().valueOf()-(o+r),console.log("[swell] update elapsed: ",i,", total: ",r+=i);else{this.map.addSource(this.source,{type:"geojson",data:l}),this.map.addLayer({id:this.heightLayer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-opacity":1,"line-width":1,"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":11},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":2}},this.beforeLayer);const n=new Image(72,72);let c='<svg t="1752721890391" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12518" width="200" height="200"><path d="M481.386772 959.514313 481.386772 334.713224c-56.000432 37.288255-92.523253 55.876612-142.312216 57.787124 85.834924-84.884272 130.528845-195.161888 172.552961-328.434218 40.259936 133.272329 89.39296 238.731196 172.622546 328.434218-54.105269-5.729491-86.780459-21.201881-146.338926-58.965973l0 625.979938L481.386772 959.514313z" p-id="12519" fill="#ffffff"></path></svg>',s="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(c)));n.src=s,n.onload=()=>{this.map.hasImage("swellDirIconWhite")||this.map.addImage("swellDirIconWhite",n),this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"swellDirIconWhite","icon-size":{base:1,stops:[[2,.32],[6,.5]]},"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,180],[360,540]]}},paint:{"icon-opacity":1}},this.beforeLayer)},i=new Date().valueOf()-(o+r),console.log("[swell] add elapsed: ",i,", total: ",r+=i)}}},handleClear(){var a,t;this.activeWeatherLayers.length===0&&(a=this.map)!=null&&a.getLayer("country-boundaries")&&((t=this.map)==null||t.setLayoutProperty("country-boundaries","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 Si(a,t,o,r,i,l){return e.openBlock(),e.createElementBlock("div")}const Ti=O(Pi,[["render",Si]]),Ni={name:"IdmPrmsl",props:{map:{type:Object},prmsl:{type:Object},beforeLayer:{type:String},showRampColor:{type:Boolean},activeWeatherLayers:{type:Array}},data(){return{right:10,toggle:!1,source:"prmsl-source",layer:"prmsl-layer",labelLayer:"prmsl-label-layer",pointLabelLayer:"prmsl-point-label-layer",empty:M.featureCollection([])}},watch:{"prmsl.version":{handler(){var a;(a=this.prmsl)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle},handleRender(){var a,t,o;if(console.log("prmsl",this.beforeLayer),!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.prmsl){const r=new Date().valueOf();let i=0,l=0,n=this.empty;this.prmsl.active&&(n=this.prmsl.data),(a=this.map)!=null&&a.getSource(this.source)?((t=this.map)==null||t.getSource(this.source).setData(n),l=new Date().valueOf()-(r+i),console.log("[prmsl] update elapsed: ",l,", total: ",i+=l)):(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":.6}},this.beforeLayer),(o=this.map)==null||o.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":10},paint:{"text-color":"black","text-halo-color":"rgba(255,255,255,1)","text-opacity":.7,"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
+ }`);const qa={name:"IdmWindBarb",props:{map:{type:Object},wind:{type:Object},current:{type:Object},beforeLayer:{type:String},menuToggle:{type:Object},theme:{type:String},mapFeather:{type:String}},emits:[],data(){return{toggle:!1,showCaption:!1,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:M.featureCollection([]),right:10,bottom:125,windBarbLoaded:!1}},computed:{barbsIconName(){var t;const a=[];for(let o=0;o<((t=this.barbs)==null?void 0:t.length);o++){const r=this.barbs[o]||0,i=r<10?`00${r}kts`:r<100?`0${r}kts`:`${r}kts`;a.push("icon-a-"+i)}return a},opacity(){return this.mapFeather==="dark"||this.mapFeather==="satellite"?.6:1}},watch:{"wind.version":{handler(){var a;(a=this.wind)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10})},immediate:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle,this.showCaption=!this.showCaption},handleRender(){var a,t,o,r;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.wind){const i=new Date().valueOf();let l=0,n=0,c=this.empty;if((a=this.wind)!=null&&a.active&&(c=(t=this.wind)==null?void 0:t.data),(o=this.map)!=null&&o.getSource(this.source))(r=this.map)==null||r.getSource(this.source).setData(c),n=new Date().valueOf()-(i+l),console.log("[windBarbs] update elapsed: ",n,", total: ",l+=n);else{this.map.addSource(this.source,{type:"geojson",data:c});for(let s=0;s<(this.barbs??[]).length-1;s++){const h=(this.barbs??[])[s]||0,d=(this.barbs??[])[s+1]||0,m=h<10?`00${h}kts`:h<100?`0${h}kts`:`${h}kts`;this.map.addLayer({id:m,type:"symbol",filter:["all",[">=","spd",h],["<","spd",d]],source:this.source,layout:{"symbol-placement":"point","icon-image":m,"icon-size":.14,"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"dir",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":this.opacity}},this.beforeLayer)}this.windBarbLoaded=!0,n=new Date().valueOf()-(i+l),console.log("[windBarbs] add elapsed: ",n,", total: ",l+=n)}}},handleClear(){for(const a of this.barbs??[]){const t=a<10?`00${a}kts`:a<100?`0${a}kts`:`${a}kts`;this.map.getLayer(t)&&this.map.removeLayer(t)}this.map.getSource(this.source)&&this.map.removeSource(this.source),this.windBarbLoaded=!1}}},Ka={key:0,class:"legend-tip-btn-gl4"},Ja={class:"d-flex flex-row justify-center align-center"},Qa={class:"text-caption"};function $a(a,t,o,r,i,l){var m;const n=e.resolveComponent("v-btn"),c=e.resolveComponent("v-col"),s=e.resolveComponent("v-row"),h=e.resolveComponent("v-card-text"),d=e.resolveComponent("v-card");return(m=o.wind)!=null&&m.active?(e.openBlock(),e.createElementBlock("div",Ka,[e.createElementVNode("div",{class:"menu-bar-box pa-1 rounded",style:e.normalizeStyle({right:i.right+"px"})},[e.createVNode(n,{"min-width":"32",width:"32",height:"32",class:"text-none pa-0",color:i.toggle?"primary":"",onClick:l.handleMenuToggle},{default:e.withCtx(()=>t[0]||(t[0]=[e.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),_:1,__:[0]},8,["color","onClick"])],4),e.withDirectives(e.createVNode(d,{width:"120",elevation:"16",class:"card-info",style:e.normalizeStyle({position:"absolute",top:"300px",right:i.right+50+"px"})},{default:e.withCtx(()=>[e.createVNode(h,{class:"pa-1 text-body-2 d-flex flex-column justify-center align-start opacity-80 z"},{default:e.withCtx(()=>[t[1]||(t[1]=e.createElementVNode("div",{class:"text-body-2 ma-1"},"Wind Level",-1)),e.createVNode(s,{class:"ma-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.barbs,(g,u)=>(e.openBlock(),e.createBlock(c,{cols:"6",key:g,class:"d-flex flex-row justify-center align-center pa-1"},{default:e.withCtx(()=>[e.createElementVNode("div",Ja,[e.createElementVNode("i",{class:e.normalizeClass(["iconfont",l.barbsIconName[u]]),style:e.normalizeStyle({color:o.theme==="dark"?"#fff":"#000"})},null,6),e.createElementVNode("span",Qa,e.toDisplayString(Number(g)<10?`00${g}kts`:Number(g)<100?`0${g}kts`:`${g}kts`),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[1]})]),_:1},8,["style"]),[[e.vShow,i.showCaption]])])):e.createCommentVNode("",!0)}const ei=O(qa,[["render",$a]]),Wl="",ti={name:"IdmWindParticle",props:{factor:{type:Object},viewport:{type:Ne},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new ye,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":{async handler(){var a,t;(a=this.factor)!=null&&a.active?await this.handleRender():this.handleClear(),(t=this.factor)!=null&&t.particle||this.handleClearParticle()}},"factor.particle":{async handler(a,t){a!==t&&t!==void 0&&(a?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{async handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let t=0,o=0;await this.handleDraw(),o=new Date().valueOf()-(a+t),console.log("[wind-particle] add elapsed: ",o,", total: ",t+=o)}},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgb(98, 113, 184, 0.8)"],[12/255,"rgb(98, 113, 184)"],[24/255,"rgb(61, 110, 163)"],[32/255,"rgb(74, 146, 148)"],[40/255,"rgb(77, 142, 124)"],[60/255,"rgb(76, 164, 76)"],[80/255,"rgb(103, 164, 54)"],[100/255,"rgb(162, 135, 64)"],[120/255,"rgb(162, 109, 92)"],[140/255,"rgb(141, 63, 92)"],[160/255,"rgb(151, 75, 145)"],[200/255,"rgb(95, 100, 160)"],[240/255,"rgb(91, 136, 161)"],[1,"rgb(91, 136, 161)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:t,aPositionBuffer:o}=this.webgl.bind(this.context,X.vertexSchema,X.uvFragmentSchema);this.program=t,this.aPositionBuffer=o}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const a=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,ne.vertexSchema,ne.fragmentSchema,ne.quadVertSchema,ne.screenFragmentSchema,ne.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,a,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,9e3),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,a),this.wrapper.image=a}this.initial&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext)}},handlePause(){this.paused=!0,this.animation&&(cancelAnimationFrame(this.animation),this.viewport.toggleParticle(!1))},handlePlay(){this.paused=!1,this.animation=requestAnimationFrame(()=>{this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay()})},handleClearParticle(){var a,t,o,r,i,l,n;(a=this.viewport)==null||a.toggleParticle(!1),this.particleContext=void 0,this.initial=!0,(o=(t=this.viewport)==null?void 0:t.map)==null||o.off("resize",this.handleResize),(i=(r=this.viewport)==null?void 0:r.map)==null||i.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay),this.handlePause()},handleClear(){var a;(a=this.viewport)==null||a.toggle(!1),this.context=void 0,this.etime=void 0,this.handleClearParticle()}}},oi={key:0};function ai(a,t,o,r,i,l){var n;return(n=o.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",oi,[e.createElementVNode("div",{class:"legend-bars-gl4 wind",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"kts",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"5",-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"30",-1),e.createElementVNode("span",null,"40",-1),e.createElementVNode("span",null,"60",-1)]),4)])):e.createCommentVNode("",!0)}const ii=O(ti,[["render",ai]]),ri={name:"IdmCurrent",props:{map:{type:Object},current:{type:Object},beforeLayer:{type:String},menuToggle:{type:Object},theme:{type:String},mapFeather:{type:String}},emits:[],data(){return{right:10,toggle:!1,showCaption:!1,source:"current-source",directionLayer:"current-direction-layer",speedLayer:"current-speed-layer",speedLabelLayer:"current-speed-label-layer",empty:M.featureCollection([]),list:[{label:"0-0.5 kts",size:.25,color:"rgb(58, 164, 58)"},{label:"0.5-1 kts",size:.4,color:"#ffff00"},{label:"1-1.5 kts",size:.6,color:"#ff9500"},{label:"1.5-2 kts",size:.8,color:"#f44336"},{label:">= 2 kts",size:1,color:"#e4711e"}]}},computed:{getSvgUrlBase64(){return a=>`data:image/svg+xml;base64,${btoa(a)}`},opacity(){return this.mapFeather==="dark"||this.mapFeather==="satellite"?.6:1}},watch:{"current.version":{handler(){var a;(a=this.current)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10})},immediate:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle,this.showCaption=!this.showCaption},handleRender(){var a,t;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.current){const o=new Date().valueOf();let r=0,i=0,l=this.empty;if(this.current.active&&(l=this.current.data),(a=this.map)!=null&&a.getSource(this.source))(t=this.map)==null||t.getSource(this.source).setData(l),i=new Date().valueOf()-(o+r),console.log("[current] update elapsed: ",i,", total: ",r+=i);else{this.map.addSource(this.source,{type:"geojson",data:l}),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"],"rgb(58, 164, 58)",1,"#ffff00",2,"#ff9500",3,"#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);const n=new Image(48,48);let c='<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" p-id="12518" width="200" height="200"><path d="M481.386772 959.514313 481.386772 334.713224c-56.000432 37.288255-92.523253 55.876612-142.312216 57.787124 85.834924-84.884272 130.528845-195.161888 172.552961-328.434218 40.259936 133.272329 89.39296 238.731196 172.622546 328.434218-54.105269-5.729491-86.780459-21.201881-146.338926-58.965973l0 625.979938L481.386772 959.514313z" p-id="12519" fill="#ffffff"></path></svg>',s="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(c)));n.src=s;const h=new Image(48,48);c='<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" p-id="12518" width="200" height="200"><path d="M481.386772 959.514313 481.386772 334.713224c-56.000432 37.288255-92.523253 55.876612-142.312216 57.787124 85.834924-84.884272 130.528845-195.161888 172.552961-328.434218 40.259936 133.272329 89.39296 238.731196 172.622546 328.434218-54.105269-5.729491-86.780459-21.201881-146.338926-58.965973l0 625.979938L481.386772 959.514313z" p-id="12519" fill="#f44336"></path></svg>',s="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(c))),h.src=s;const d=[n,h];let m=0;d.forEach(g=>{g.onload=()=>{m++,this.map.hasImage("currentDirIconWhite")||this.map.addImage("currentDirIconWhite",n),this.map.hasImage("currentDirIconRed")||this.map.addImage("currentDirIconRed",h),m===2&&this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":["step",["get","spd"],"currentDirIconWhite",1,"currentDirIconWhite"],"icon-size":["step",["get","spd"],.25,.5,.4,1,.6,1.5,.8,2,1],"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":this.opacity}},this.beforeLayer)}}),i=new Date().valueOf()-(o+r),console.log("[current] add elapsed: ",i,", total: ",r+=i)}}},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)}}},li={key:0,class:"legend-tip-btn-gl4"},ni={class:"d-flex flex-row justify-start align-center"},si={class:"d-flex flex-row justify-center align-center",style:{width:"48px"}},ci={class:"text-caption px-2"};function mi(a,t,o,r,i,l){var g;const n=e.resolveComponent("v-btn"),c=e.resolveComponent("v-tooltip"),s=e.resolveComponent("v-col"),h=e.resolveComponent("v-row"),d=e.resolveComponent("v-card-text"),m=e.resolveComponent("v-card");return(g=o.current)!=null&&g.active?(e.openBlock(),e.createElementBlock("div",li,[e.createElementVNode("div",{class:"menu-bar-box pa-1 rounded",style:e.normalizeStyle({right:i.right+"px"})},[e.createVNode(c,{text:"Map Layers",location:"left"},{activator:e.withCtx(({props:u})=>[e.createVNode(n,e.mergeProps(u,{"min-width":"32",width:"32",height:"32",class:"text-none pa-0",color:i.toggle?"primary":"",onClick:l.handleMenuToggle}),{default:e.withCtx(()=>t[0]||(t[0]=[e.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),_:2,__:[0]},1040,["color","onClick"])]),_:1})],4),e.withDirectives(e.createVNode(m,{width:"120",elevation:"16",class:"card-info",style:e.normalizeStyle({position:"absolute",top:"340px",right:i.right+50+"px"})},{default:e.withCtx(()=>[e.createVNode(d,{class:"pa-1 text-body-2 d-flex flex-column justify-center align-start opacity-80"},{default:e.withCtx(()=>[t[1]||(t[1]=e.createElementVNode("div",{class:"text-body-2 ma-1"},"Current",-1)),e.createVNode(h,{class:"ma-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.list,(u,f)=>(e.openBlock(),e.createBlock(s,{cols:"12",key:f,class:"d-flex flex-row justify-start align-center pa-0"},{default:e.withCtx(()=>[e.createElementVNode("div",ni,[e.createElementVNode("div",si,[e.createElementVNode("i",{class:"iconfont icon-direction-arrow opacity-80",style:e.normalizeStyle({fontSize:48*u.size+"px"})},null,4)]),e.createElementVNode("div",ci,e.toDisplayString(u.label),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[1]})]),_:1},8,["style"]),[[e.vShow,i.showCaption]])])):e.createCommentVNode("",!0)}const di=O(ri,[["render",mi]]),Ul="",hi={name:"IdmCurrentParticle",props:{factor:{type:Object},viewport:{type:Ne},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new ye,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],scale:.3},paused:!1,initial:!0,right:10}},watch:{"factor.version":{async handler(){var a,t;console.log("factor.version",this.viewport),(a=this.factor)!=null&&a.active?await this.handleRender():this.handleClear(),(t=this.factor)!=null&&t.particle||this.handleClearParticle()}},"factor.particle":{async handler(a,t){a!==t&&t!==void 0&&(console.log("factor.particle",a,t,this.viewport),a?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{async handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let t=0,o=0;await this.handleDraw(),o=new Date().valueOf()-(a+t),console.log("[current-particle] add elapsed: ",o,", total: ",t+=o)}},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0/255,"rgba(95, 143, 197,1)"],[5/255,"rgba(64,127,115,1)"],[10/255,"rgb(58,164,58)"],[15/255,"rgb(191,182,67)"],[20/255,"rgb(197,154,68)"],[30/255,"rgb(160,70,94)"],[40/255,"rgb(138,84,166)"],[45/255,"rgb(82,113,165)"],[50/255,"rgb(84,142,152)"],[65/255,"rgb(150,181,184)"],[80/255,"rgb(195,194,194)"],[254/255,"rgb(195,194,194)"],[1,"rgb(195,194,194)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:t,aPositionBuffer:o}=this.webgl.bind(this.context,X.vertexSchema,X.uvFragmentSchema);this.program=t,this.aPositionBuffer=o}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const a=[[0,"rgb(183,224,224)"],[1,"rgb(199,202,202)"],[.6,"rgb(199,202,202)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,ne.vertexSchema,ne.fragmentSchema,ne.quadVertSchema,ne.screenFragmentSchema,ne.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,a,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,9e3),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,a),this.wrapper.image=a}this.initial&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext)}},handlePause(){this.paused=!0,this.animation&&(cancelAnimationFrame(this.animation),this.viewport.toggleParticle(!1))},handlePlay(){this.paused=!1,this.animation=requestAnimationFrame(()=>{this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay()})},handleClearParticle(){var a,t,o,r,i,l,n;(a=this.viewport)==null||a.toggleParticle(!1),this.particleContext=void 0,this.initial=!0,(o=(t=this.viewport)==null?void 0:t.map)==null||o.off("resize",this.handleResize),(i=(r=this.viewport)==null?void 0:r.map)==null||i.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay),this.handlePause()},handleClear(){var a;(a=this.viewport)==null||a.toggle(!1),this.context=void 0,this.etime=void 0,this.handleClearParticle()}}},pi={key:0};function gi(a,t,o,r,i,l){var n;return(n=o.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",pi,[e.createElementVNode("div",{class:"legend-bars-gl4 current",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"kts",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"0.4",-1),e.createElementVNode("span",null,"0.8",-1),e.createElementVNode("span",null,"1.6",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"3.2",-1)]),4)])):e.createCommentVNode("",!0)}const ui=O(hi,[["render",gi]]),Yl="",fi={name:"IdmTemp",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new ye,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let t=0,o=0;this.handleDraw(),o=new Date().valueOf()-(a+t),console.log("[sig-wave] add elapsed: ",o,", total: ",t+=o)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgb(50, 158, 186)"],[10/255,"rgb(50, 158, 186)"],[20/255,"rgb(48, 128, 164)"],[30/255,"rgb(48, 99, 142)"],[40/255,"rgb(57, 61, 143)"],[50/255,"rgb(179, 86, 189)"],[60/255,"rgb(154, 45, 123)"],[80/255,"rgb(134, 48, 48)"],[120/255,"rgb(194, 77, 91)"],[150/255,"rgb(192, 118, 105)"],[180/255,"rgb(192, 163, 157)"],[1,"rgb(192, 163, 157)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:t,aPositionBuffer:o}=this.webgl.bind(this.context,X.vertexSchema,X.fragmentSchema);this.program=t,this.aPositionBuffer=o}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},yi={key:0};function bi(a,t,o,r,i,l){var n;return(n=o.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",yi,[e.createElementVNode("div",{class:"legend-bars-gl4 sig-wave",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"m",-1),e.createElementVNode("span",null,"0.5",-1),e.createElementVNode("span",null,"1",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"6",-1),e.createElementVNode("span",null,"9",-1)]),4)])):e.createCommentVNode("",!0)}const wi=O(fi,[["render",bi],["__scopeId","data-v-79ce70e2"]]),xi={name:"IdmSigWave",props:{map:{type:Object},sigWaveHeight:{type:Object},beforeLayer:{type:String},menuToggle:{type:Object}},data(){return{right:10,toggle:!1,showCaption:!1,source:"sig-wave-height-source",heightLayer:"sig-wave-height-layer",heightLabelLayer:"sig-wave-height-label-layer",empty:M.featureCollection([]),list:[{label:"< 2 m",color:"rgba(0,235,156,0)"},{label:"2-3 m",color:"rgba(0,235,156,0.4)"},{label:"3-4 m",color:"#ffed00"},{label:"4-5 m",color:"#ff9800"},{label:"5-6 m",color:"#f77800"},{label:"6-7 m",color:"#e4711e"},{label:"7-8 m",color:"#e06128"},{label:"8-9 m",color:"#dc5132"},{label:"9-10 m",color:"#d5453c"},{label:"10-12 m",color:"#cd3a46"},{label:"12-14 m",color:"#be2c50"},{label:"14-16 m",color:"#aa1a5a"},{label:"16-18 m",color:"#962878"},{label:"18-20 m",color:"#8c328c"},{label:"> 20 m",color:"#8c328c"}]}},watch:{"sigWaveHeight.version":{handler(){var a;(a=this.sigWaveHeight)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10})},immediate:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle,this.showCaption=!this.showCaption},handleRender(){var a,t;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.sigWaveHeight){const o=new Date().valueOf();let r=0,i=0,l=this.empty;this.sigWaveHeight.active&&(l=this.sigWaveHeight.data),(a=this.map)!=null&&a.getSource(this.source)?((t=this.map)==null||t.getSource(this.source).setData(l),i=new Date().valueOf()-(o+r),console.log("[sig-wave-height] update elapsed: ",i,", total: ",r+=i)):(this.map.addSource(this.source,{type:"geojson",data:l}),this.map.addLayer({id:this.heightLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-color":["step",["get","val"],"rgba(0,235,156,0)",2,"rgba(0,235,156,0.4)",3,"#ffed00",4,"#ff9800",5,"#f77800",6,"#e4711e",7,"#e06128",8,"#dc5132",9,"#d5453c",10,"#cd3a46",12,"#be2c50",14,"#b41a5a",16,"#aa1464",18,"#962878",20,"#8c328c"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":["format",["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":10},paint:{"text-color":["step",["get","val"],"rgba(0, 0, 0, 0.7)",9,"rgba(255,255,255,0.8)"]}},this.beforeLayer),i=new Date().valueOf()-(o+r),console.log("[sig-wave-height] add elapsed: ",i,", total: ",r+=i))}},handleClear(){this.map.getLayer(this.heightLayer)&&this.map.removeLayer(this.heightLayer),this.map.getLayer(this.heightLabelLayer)&&this.map.removeLayer(this.heightLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},_i={key:0,class:"legend-tip-btn-gl4"},ki={class:"d-flex flex-row justify-start align-center"},zi={key:0,style:{width:"24px",height:"12px",border:"1px solid rgba(var(--v-border-color), var(--v-border-opacity))"}},vi={class:"text-caption px-2"};function Li(a,t,o,r,i,l){var m;const n=e.resolveComponent("VBtn"),c=e.resolveComponent("VCol"),s=e.resolveComponent("VRow"),h=e.resolveComponent("VCardText"),d=e.resolveComponent("VCard");return(m=o.sigWaveHeight)!=null&&m.active?(e.openBlock(),e.createElementBlock("div",_i,[e.createElementVNode("div",{class:"menu-bar-box pa-1 rounded",style:e.normalizeStyle({right:i.right+"px"})},[e.createVNode(n,{"min-width":"32",width:"32",height:"32",class:"text-none pa-0",color:i.toggle?"primary":"",onClick:l.handleMenuToggle},{default:e.withCtx(()=>t[0]||(t[0]=[e.createElementVNode("i",{class:"iconfont icon-Legend"},null,-1)])),_:1,__:[0]},8,["color","onClick"])],4),e.withDirectives(e.createVNode(d,{width:"100",elevation:"16",class:"card-info",style:e.normalizeStyle({position:"absolute",top:"240px",right:i.right+50+"px"})},{default:e.withCtx(()=>[e.createVNode(h,{class:"pa-1 text-body-2 d-flex flex-column justify-center align-start opacity-80"},{default:e.withCtx(()=>[t[1]||(t[1]=e.createElementVNode("div",{class:"text-body-2 ma-1"},"Wave Height",-1)),e.createVNode(s,{class:"ma-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.list,(g,u)=>(e.openBlock(),e.createBlock(c,{key:u,cols:"12",class:"d-flex flex-row justify-start align-center pa-1"},{default:e.withCtx(()=>[e.createElementVNode("div",ki,[u===0?(e.openBlock(),e.createElementBlock("div",zi)):(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle({width:"24px",height:"12px",background:g.color})},null,4)),e.createElementVNode("div",vi,e.toDisplayString(g.label),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[1]})]),_:1},8,["style"]),[[e.vShow,i.showCaption]])])):e.createCommentVNode("",!0)}const Ci=O(xi,[["render",Li]]),Pi={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:M.featureCollection([])}},watch:{"swell.version":{handler(){var a;(a=this.swell)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var a,t;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.swell){const o=new Date().valueOf();let r=0,i=0,l=this.empty;if(this.swell.active&&(l=this.swell.data),(a=this.map)!=null&&a.getSource(this.source))(t=this.map)==null||t.getSource(this.source).setData(l),i=new Date().valueOf()-(o+r),console.log("[swell] update elapsed: ",i,", total: ",r+=i);else{this.map.addSource(this.source,{type:"geojson",data:l}),this.map.addLayer({id:this.heightLayer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-opacity":1,"line-width":1,"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":11},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":2}},this.beforeLayer);const n=new Image(72,72);let c='<svg t="1752721890391" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12518" width="200" height="200"><path d="M481.386772 959.514313 481.386772 334.713224c-56.000432 37.288255-92.523253 55.876612-142.312216 57.787124 85.834924-84.884272 130.528845-195.161888 172.552961-328.434218 40.259936 133.272329 89.39296 238.731196 172.622546 328.434218-54.105269-5.729491-86.780459-21.201881-146.338926-58.965973l0 625.979938L481.386772 959.514313z" p-id="12519" fill="#ffffff"></path></svg>',s="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(c)));n.src=s,n.onload=()=>{this.map.hasImage("swellDirIconWhite")||this.map.addImage("swellDirIconWhite",n),this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"swellDirIconWhite","icon-size":{base:1,stops:[[2,.32],[6,.5]]},"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,180],[360,540]]}},paint:{"icon-opacity":1}},this.beforeLayer)},i=new Date().valueOf()-(o+r),console.log("[swell] add elapsed: ",i,", total: ",r+=i)}}},handleClear(){var a,t;this.activeWeatherLayers.length===0&&(a=this.map)!=null&&a.getLayer("country-boundaries")&&((t=this.map)==null||t.setLayoutProperty("country-boundaries","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 Si(a,t,o,r,i,l){return e.openBlock(),e.createElementBlock("div")}const Ti=O(Pi,[["render",Si]]),Ni={name:"IdmPrmsl",props:{map:{type:Object},prmsl:{type:Object},beforeLayer:{type:String},showRampColor:{type:Boolean},activeWeatherLayers:{type:Array}},data(){return{right:10,toggle:!1,source:"prmsl-source",layer:"prmsl-layer",labelLayer:"prmsl-label-layer",pointLabelLayer:"prmsl-point-label-layer",empty:M.featureCollection([])}},watch:{"prmsl.version":{handler(){var a;(a=this.prmsl)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle},handleRender(){var a,t,o;if(console.log("prmsl",this.beforeLayer),!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.prmsl){const r=new Date().valueOf();let i=0,l=0,n=this.empty;this.prmsl.active&&(n=this.prmsl.data),(a=this.map)!=null&&a.getSource(this.source)?((t=this.map)==null||t.getSource(this.source).setData(n),l=new Date().valueOf()-(r+i),console.log("[prmsl] update elapsed: ",l,", total: ",i+=l)):(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":.6}},this.beforeLayer),(o=this.map)==null||o.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":10},paint:{"text-color":"black","text-halo-color":"rgba(255,255,255,1)","text-opacity":.7,"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},`
191
191
  `,["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":12},paint:{"text-color":["step",["get","val"],"rgba(255,255,255,0.8)",980,"rgba(0,0,0,0.6)",1100,"rgba(0,0,0,0.6)"],"text-halo-color":["step",["get","val"],"rgba(162,13,2,0.7)",920,"rgba(244,67,54,0.7)",980,"rgba(255,255,0,0.7)",1100,"rgba(199,171,250,0.7)"],"text-halo-width":2}})},0),l=new Date().valueOf()-(r+i),console.log("[prmsl] add elapsed: ",l,", total: ",i+=l))}},handleClear(){this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.labelLayer)&&this.map.removeLayer(this.labelLayer),this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},Mi={key:0,class:"legend-tip-btn-gl4"};function Ei(a,t,o,r,i,l){var s;const n=e.resolveComponent("VBtn"),c=e.resolveComponent("VTooltip");return(s=o.prmsl)!=null&&s.active?(e.openBlock(),e.createElementBlock("div",Mi,[e.createElementVNode("div",{class:"menu-bar-box pa-1 rounded",style:e.normalizeStyle({right:i.right+"px"})},[e.createVNode(c,{text:"Map Layers",location:"left"},{activator:e.withCtx(({props:h})=>[e.createVNode(n,e.mergeProps(h,{"min-width":"32",width:"32",height:"32",class:"text-none pa-0",color:i.toggle?"primary":"",onClick:l.handleMenuToggle}),{default:e.withCtx(()=>t[0]||(t[0]=[e.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),_:2,__:[0]},1040,["color","onClick"])]),_:1})],4)])):e.createCommentVNode("",!0)}const Bi=O(Ni,[["render",Ei]]),Zl="",Di={name:"IdmIceEdge",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new ye,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()}},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let t=0,o=0;this.handleDraw(),o=new Date().valueOf()-(a+t),console.log("[ice-edge] add elapsed: ",o,", total: ",t+=o)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgba(86, 169, 230, 0)"],[1/255,"rgba(86, 169, 230, 0)"],[25/255,"rgba(86, 169, 230, 1)"],[25/255,"rgba(47, 226, 155, 1)"],[100/255,"rgba(47, 226, 155, 1)"],[100/255,"rgba(213, 253, 37, 1)"],[175/255,"rgba(213, 253, 37, 1)"],[175/255,"rgba(230, 176, 39, 1)"],[225/255,"rgba(230, 176, 39, 1)"],[225/255,"rgba(230, 84, 39, 1)"],[250/255,"rgba(230, 84, 39, 1)"],[1,"rgba(230, 84, 39, 1)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:t,aPositionBuffer:o}=this.webgl.bind(this.context,X.vertexSchema,X.fragmentSchema);this.program=t,this.aPositionBuffer=o}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Ri={key:0};function Ii(a,t,o,r,i,l){var n;return(n=o.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",Ri,[e.createElementVNode("div",{class:"legend-bars-gl4 ice-edge",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",{style:{color:"rgba(var(--v-theme-black), 0.7)"}},"%",-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,"40",-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,"70",-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,"90",-1),e.createElementVNode("span",null,null,-1)]),4)])):e.createCommentVNode("",!0)}const Ai=O(Di,[["render",Ii]]),Xl="",Vi={name:"IdmCover",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new ye,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()}},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let t=0,o=0;this.handleDraw(),o=new Date().valueOf()-(a+t),console.log("[ice-cover] add elapsed: ",o,", total: ",t+=o)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgba(68, 1, 84, 0)"],[1/255,"rgba(63, 72, 137, 0)"],[50/255,"rgba(53, 125, 177, 1)"],[100/255,"rgba(33, 145, 140, 1)"],[150/255,"rgba(45, 178, 125, 1)"],[200/255,"rgba(112, 207, 87, 1)"],[250/255,"rgba(253, 231, 37, 0.8)"],[1,"rgba(253, 231, 37, 1)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:t,aPositionBuffer:o}=this.webgl.bind(this.context,X.vertexSchema,X.fragmentSchema);this.program=t,this.aPositionBuffer=o}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Oi={key:0};function ji(a,t,o,r,i,l){var n;return(n=o.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",Oi,[e.createElementVNode("div",{class:"legend-bars-gl4 ice-cover",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"%",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"40",-1),e.createElementVNode("span",null,"60",-1),e.createElementVNode("span",null,"80",-1),e.createElementVNode("span",null,"100",-1)]),4)])):e.createCommentVNode("",!0)}const Fi=O(Vi,[["render",ji],["__scopeId","data-v-9696d73b"]]),ql="",Hi={name:"IdmThickness",props:{factor:{type:Object},viewport:{type:Object},menuToggle:{type:Object},bottom:{type:String,default:"70px"}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new ye,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let t=0,o=0;this.handleDraw(),o=new Date().valueOf()-(a+t),console.log("[ice-thickness] add elapsed: ",o,", total: ",t+=o)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgba(4, 6, 19, 0)"],[1/255,"rgba(4, 6, 19, 0)"],[20/255,"rgba(51, 50, 102, 1)"],[40/255,"rgba(63, 82, 158, 1)"],[50/255,"rgba(66, 123, 183, 1)"],[60/255,"rgba(92, 161, 197, 1)"],[80/255,"rgba(134, 199, 212, 0.7)"],[100/255,"rgba(134, 199, 212, 1)"],[150/255,"rgba(234, 253, 2536, 0.8)"],[250/255,"rgba(234, 253, 2536, 0.9)"],[1,"rgba(234, 253, 2536, 1)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:t,aPositionBuffer:o}=this.webgl.bind(this.context,X.vertexSchema,X.fragmentSchema);this.program=t,this.aPositionBuffer=o}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Gi={key:0};function Wi(a,t,o,r,i,l){var n;return(n=o.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",Gi,[e.createElementVNode("div",{class:"legend-bars-gl4 ice-thickness",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"m",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"0.6",-1),e.createElementVNode("span",null,"1",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"3",-1)]),4)])):e.createCommentVNode("",!0)}const Ui=O(Hi,[["render",Wi]]),Kl="",Yi={name:"IdmPrecip3h",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new ye,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let t=0,o=0;this.handleDraw(),o=new Date().valueOf()-(a+t),console.log("[precip3h] add elapsed: ",o,", total: ",t+=o)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgba(59, 126, 162, 0)"],[14/255,"rgba(84,170,230, 0)"],[15/255,"rgba(172, 210, 255, 0.8)"],[20/255,"rgba(51,202,248,0.8)"],[30/255,"rgba(3,248,103,0.8)"],[49/255,"rgba(14,201,3,0.8)"],[57/255,"rgba(190,226,2,0.8)"],[73/255,"rgba(248,1,1,0.8)"],[82/255,"rgba(197,5,58,0.8)"],[1,"rgba(197,5,58,0.8)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:t,aPositionBuffer:o}=this.webgl.bind(this.context,X.vertexSchema,X.fragmentSchema);this.program=t,this.aPositionBuffer=o}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Zi={key:0};function Xi(a,t,o,r,i,l){var n;return(n=o.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",Zi,[e.createElementVNode("div",{class:"legend-bars-gl4 precip3h",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"mm",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"3",-1),e.createElementVNode("span",null,"7",-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"30",-1)]),4)])):e.createCommentVNode("",!0)}const qi=O(Yi,[["render",Xi]]),Jl="",Ki={name:"IdmVisibility",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{right:10,program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new ye,etime:void 0}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let t=0,o=0;this.handleDraw(),o=new Date().valueOf()-(a+t),console.log("[visibility] add elapsed: ",o,", total: ",t+=o)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgba(189,50,160,0.8)"],[8/255,"rgba(208,56,56,0.8)"],[27/255,"rgba(190,226,2,0.8)"],[60/255,"rgba(3,236,118,0.8)"],[160/255,"rgba(172, 210,255,0.8)"],[161/255,"rgba(172, 210,255,0)"],[1,"rgba(144,144,144,0)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:t,aPositionBuffer:o}=this.webgl.bind(this.context,X.vertexSchema,X.fragmentSchema);this.program=t,this.aPositionBuffer=o}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Ji={key:0};function Qi(a,t,o,r,i,l){var n;return(n=o.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",Ji,[e.createElementVNode("div",{class:"legend-bars-gl4 visibility",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"nm",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"0.5",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"3",-1),e.createElementVNode("span",null,"9",-1)]),4)])):e.createCommentVNode("",!0)}const $i=O(Ki,[["render",Qi]]),Ql="",er={name:"IdmWaterTemp",props:{factor:{type:Object},viewport:{type:Object},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new ye,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let t=0,o=0;this.handleDraw(),o=new Date().valueOf()-(a+t),console.log("[water-temp] add elapsed: ",o,", total: ",t+=o)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgba(95, 143, 197)"],[46/255,"rgba(95, 143, 197)"],[69/255,"rgb(80, 140, 62)"],[92/255,"rgb(121, 146, 28)"],[115/255,"rgb(171, 161, 14)"],[138/255,"rgb(223, 177, 69)"],[161/255,"rgb(243, 150, 6)"],[184/255,"rgb(236, 95, 21)"],[207/255,"rgb(190, 65, 18)"],[230/255,"rgb(138, 43, 10)"],[1,"rgb(138, 43, 10)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:t,aPositionBuffer:o}=this.webgl.bind(this.context,X.vertexSchema,X.fragmentSchema);this.program=t,this.aPositionBuffer=o}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},tr={key:0};function or(a,t,o,r,i,l){var n;return(n=o.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",tr,[e.createElementVNode("div",{class:"legend-bars-gl4 water-temp",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"°C",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"30",-1),e.createElementVNode("span",null,"40",-1)]),4)])):e.createCommentVNode("",!0)}const ar=O(er,[["render",or]]),$l="",ir={name:"IdmTemp",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new ye,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},"menuToggle.v":{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let t=0,o=0;this.handleDraw(),o=new Date().valueOf()-(a+t),console.log("[temp] add elapsed: ",o,", total: ",t+=o)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgb(149, 137, 211)"],[100/255,"rgb(149, 137, 211)"],[110/255,"rgb(150, 209, 216)"],[120/255,"rgb(129, 204, 197)"],[130/255,"rgb(103, 180, 186)"],[140/255,"rgb(95, 143, 197)"],[150/255,"rgb(80, 140, 62)"],[160/255,"rgb(121, 146, 28)"],[170/255,"rgb(171, 161, 14)"],[180/255,"rgb(223, 177, 6)"],[190/255,"rgb(243, 150, 6)"],[200/255,"rgb(236, 95, 21)"],[210/255,"rgb(190, 65, 18)"],[220/255,"rgb(138, 43, 10)"],[1,"rgb(138, 43, 10)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:t,aPositionBuffer:o}=this.webgl.bind(this.context,X.vertexSchema,X.fragmentSchema);this.program=t,this.aPositionBuffer=o}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},rr={key:0};function lr(a,t,o,r,i,l){var n;return(n=o.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",rr,[e.createElementVNode("div",{class:"legend-bars-gl4 temp",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"°C",-1),e.createElementVNode("span",null,"-20",-1),e.createElementVNode("span",null,"-10",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"30",-1),e.createElementVNode("span",null,"40",-1)]),4)])):e.createCommentVNode("",!0)}const nr=O(ir,[["render",lr]]),en="",sr={name:"IdmGlLayer",components:{IdmWindBarb:ei,IdmWindParticle:ii,IdmCurrentDirection:di,IdmCurrentParticle:ui,IdmWave:wi,IdmSigWaveHeight:Ci,IdmSwell:Ti,IdmPrmsl:Bi,IdmIceEdge:Ai,IdmIceCover:Fi,IdmIceThickness:Ui,IdmPrecip3h:qi,IdmVisibility:$i,IdmWaterTemp:ar,IdmTemp:nr},props:{isLogin:{type:Boolean,default:!1},map:{type:Object},mapFeather:{type:String},gateway:{type:String,default:"aa"},assistGateway:{type:Array,default:[]},token:{type:String},defaultMeteoToken:{type:String},top:{type:Number,default:60},menuToggle:{type:Object,default:{}},realTime:{type:String},forecastModel:{type:String},beforeLayer:{type:String}},emits:["menuToggle","weatherCheckList"],data(){return{right:10,toggle:!1,autoActive:!0,allLayers:[...Pe.LayerHelper.WEATHER_LAYERS],tagLayers:[...Pe.LayerHelper.WEATHER_LAYERS.filter(a=>!a.hide)],checkList:[],iceToggleValue:void 0,weatherLayers:{},activeWeatherLayers:[],cache:{v:"0.0.1",versionKey:"weatherLayerCacheVersionGL4",autoActiveKey:"autoActiveCacheGL4",checkListKey:"weatherCheckListCacheGL4"},sourceList:{},rampColorLayers:["visibility","precip3h","temp","water-temp","ice-thickness","ice-cover"],zoom:6,viewport:void 0,particleFactor:void 0,showWindParticle:!0,showCurrentParticle:!0}},computed:{computeDateZ(){return function(a){var t;if(a){const o=P(a);return`${(t=o==null?void 0:o.utc())==null?void 0:t.format("MMM-DD/HHmm")}Z`}return"-"}},overlaysKeys(){return this.tagLayers.filter(a=>a.overlays).map(a=>a.key)},rendersKeys(){return this.tagLayers.filter(a=>!a.overlays).map(a=>a.key)}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.weatherLayers,this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10})}},forecastModel:{handler(a,t){a&&a!==t&&this.handleWeatherLayerChange({sourceChanged:!0})}},map:{handler(){this.map&&(this.map.on("move",this.handleMove4Weather),this.viewport=new Ne(this.map),this.handleRampColorInitial(),this.handleWeatherLayerChange())},immediate:!0},realTime:{handler(a,t){a&&t&&P(a).utc().format("yyyy-MM-DD HH")!==P(t).utc().format("yyyy-MM-DD HH")&&this.$nextTick(()=>{this.fetchWeatherLayers()})},immediate:!0},checkList:{handler(a,t){this.handleCheckListChange(a,t),this.$emit("weatherCheckList",a)}},autoActive:{handler(a){localStorage.setItem(this.cache.autoActiveKey,this.autoActive),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(t=>this.checkList.includes(t.key)):[],this.handleWeatherLayerChange(),this.$parent.$refs.idmBottomBar.handleToggle(a),this.autoActive||this.handleMenuToggle()}},iceToggleValue:{handler(a){a&&(this.checkList=["ice-forecast",this.iceToggleValue])}},showWindParticle:{handler(a){let t="wind-particle";this.weatherLayers[t].particle=a,this.weatherLayers[t].version=Math.random()+1}},showCurrentParticle:{handler(a){let t="current-particle";this.weatherLayers[t].particle=a,this.weatherLayers[t].version=Math.random()+1}},isLogin:{handler(a){a?(this.fetchMeteoSource(),this.fetchWeatherLayers()):this.sourceList={}},immediate:!0}},mounted(){this.fetchCache()},methods:{arraysEqual(a,t){if((a==null?void 0:a.length)!==(t==null?void 0:t.length))return!1;for(let o=0;o<(a==null?void 0:a.length);o++)if((a==null?void 0:a[o])!==(t==null?void 0:t[o]))return!1;return!0},fetchCache(){const a=localStorage.getItem(this.cache.versionKey);this.cache.v!==a&&(localStorage.removeItem(this.cache.autoActiveKey),localStorage.removeItem(this.cache.checkListKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let t=localStorage.getItem(this.cache.autoActiveKey);this.autoActive=t!=="false",localStorage.setItem(this.cache.autoActiveKey,this.autoActive),t=localStorage.getItem(this.cache.checkListKey),this.checkList=JSON.parse(t||"[]"),localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList))},handleMenuToggle(){this.$emit("menuToggle","weatherLayers"),this.autoActive&&this.$parent.$refs.idmBottomBar.handleToggle(this.autoActive)},handleFastWeatherToggle(a){let t=[];this.checkList.includes(a)?t=this.checkList.filter(o=>o!==a):t=[...this.checkList,a],this.handleCheckListChange(t,this.checkList)},handleCheckListChange(a,t){if(this.arraysEqual(a,t))return!1;const o=[...new Set(a)],r=o==null?void 0:o.filter(l=>!(t!=null&&t.includes(l)))[0],i=t==null?void 0:t.filter(l=>!(o!=null&&o.includes(l)))[0];r&&(r==="ice-cover"||r==="ice-thickness"||r==="ice-forecast"?(this.checkList=["ice-forecast",this.iceToggleValue||"ice-cover"],this.iceToggleValue=this.iceToggleValue||"ice-cover"):this.rendersKeys.includes(r)?this.checkList=[r]:this.checkList=o.filter(l=>!this.rendersKeys.includes(l))),i&&(i==="ice-forecast"?(this.checkList=o.filter(l=>!["ice-cover","ice-thickness","ice-forecast"].includes(l)),this.iceToggleValue=void 0):this.checkList=o),this.checkList.includes("wind-particle")&&(this.showWindParticle=!0),this.checkList.includes("current-particle")&&(this.showCurrentParticle=!0),localStorage.setItem(this.cache.checkListKey,JSON.stringify(o)),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(l=>o.includes(l.key)):[],this.handleWeatherLayerChange()},async fetchMeteoSource(){this.sourceList={};let a=await Q.get(`${this.gateway}/api/arc/meteo2/models`,{headers:{Authorization:this.token}});(a==null?void 0:a.data.code)===0&&(this.sourceList=a==null?void 0:a.data.data)},async fetchWeatherLayers(a={}){var i,l,n,c,s,h,d,m,g;const t=new Date().valueOf();let o=0,r=0;if(this.map){const u=((i=this.map)==null?void 0:i.getZoom())+1,f=(l=this.map)==null?void 0:l.getBounds(),z=`${f._sw.lng},${f._sw.lat},${f._ne.lng},${f._ne.lat}`;if(this.particleFactor&&((n=this.$refs.layer)!=null&&n.autoActive)){const k=Pe.LayerHelper.WEATHER_LAYERS.find(S=>{var v;return((v=S.peer)==null?void 0:v.weight)===this.particleFactor.weight});this.particleFactor.particle&&(this.showWindParticle||this.showCurrentParticle)?this.weatherWeight=this.weatherWeight&k.weight?this.weatherWeight:this.weatherWeight+k.weight:this.weatherWeight=this.weatherWeight&k.weight?this.weatherWeight-k.weight:this.weatherWeight}if(this.weatherWeight>0){let k=this.weatherWeight;if(k>0){const S=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],v=await Q.get(`${S}/api/arc/weather/layers2/links?l=${k}&v=${this.forecastModel}&z=${u}&bbox=${z}&t=${this.realTime}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(r=new Date().valueOf()-(t+o),console.log("weather links elapsed: ",r,", total: ",o+=r),((c=v==null?void 0:v.data)==null?void 0:c.code)===0){const x=(s=v==null?void 0:v.data)==null?void 0:s.data,b=[];for(const _ in x)b.push(Q.get(x[_],{headers:{Authorization:this.token||this.defaultMeteoToken,key:_},responseType:/\.(jpg|png)$/.test(x[_])?"blob":"json"}).catch(y=>{console.log(`[${_}] fetch layer error: ${y}`)}));const w=await Promise.all(b);this.weatherLayers={},w.map(_=>{var B,I,D,R;const y=((B=_==null?void 0:_.data)==null?void 0:B.data)||(_==null?void 0:_.data);let L=(D=(I=_==null?void 0:_.config)==null?void 0:I.headers)==null?void 0:D.key;L&&y&&(this.weatherLayers[L]={raw:y,type:((R=_==null?void 0:_.config)==null?void 0:R.responseType)==="blob"?"image":"json",etime:v.data.etime})})}if(r=new Date().valueOf()-(t+o),console.log("weather layers elapsed: ",r,", total: ",o+=r),this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const x=(h=this.weatherLayers["swell-direction"])==null?void 0:h.raw,b=(d=this.weatherLayers["swell-height"])==null?void 0:d.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers.swell={type:"json",direction:x,height:{raw:b},etime:v.data.etime}}if(this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const x=(m=this.weatherLayers["current-direction"])==null?void 0:m.raw,b=(g=this.weatherLayers["current-speed"])==null?void 0:g.raw;delete this.weatherLayers["current-direction"],delete this.weatherLayers["current-speed"],this.weatherLayers.current={type:"json",direction:x,speed:{raw:b},etime:v.data.etime}}}}this.handleWeatherLayerToggle(),this.handleDrawWeather4Json()}},handleWeatherLayerToggle(){var t,o;for(const r in this.weatherLayers)this.weatherLayers[r].active=!1,this.weatherLayers[r].version=Math.random()+1;for(const r of this.activeWeatherLayers){let i=r.key;i==="current-direction"&&(i="current"),this.weatherLayers[i]&&(this.weatherLayers[i].active=!0,this.weatherLayers[i].version=Math.random()+1,i==="wind-particle"&&(this.weatherLayers[i].particle=this.showWindParticle),i==="current-particle"&&(this.weatherLayers[i].particle=this.showCurrentParticle))}this.autoActive&&this.activeWeatherLayers.some(r=>["wind-particle","sig-wave","current-particle","water-temp","temp"].some(i=>i===r.key))?(this.map.getLayer("country-boundaries")&&this.map.setLayoutProperty("country-boundaries","visibility","visible"),this.map.getLayer("water-outline2")&&this.map.setLayoutProperty("water-outline2","visibility","visible"),this.map.moveLayer((t=this.viewport)==null?void 0:t.rampColorLayer,"country-boundaries"),this.map.moveLayer((o=this.viewport)==null?void 0:o.particleLayer,"country-boundaries"),this.mapFeather==="nautical"&&(this.map.getLayer("i4")&&this.map.setLayoutProperty("i4","visibility","none"),this.map.getLayer("hi")&&this.map.setLayoutProperty("hi","visibility","none"),this.map.getLayer("admin-0-boundary-bg")&&this.map.setLayoutProperty("admin-0-boundary-bg","visibility","visible"),this.map.getLayer("admin-0-boundary")&&this.map.setLayoutProperty("admin-0-boundary","visibility","visible"),this.map.getLayer("admin-0-boundary-disputed")&&this.map.setLayoutProperty("admin-0-boundary-disputed","visibility","visible"),this.map.getLayer("country-label")&&this.map.setLayoutProperty("country-label","visibility","visible"),this.map.getLayer("continent-label")&&this.map.setLayoutProperty("continent-label","visibility","visible"),this.map.getLayer("state-label")&&this.map.setLayoutProperty("state-label","visibility","visible"))):(this.map.getLayer("country-boundaries")&&this.map.setLayoutProperty("country-boundaries","visibility","none"),this.map.getLayer("water-outline2")&&this.map.setLayoutProperty("water-outline2","visibility","none"),this.mapFeather==="nautical"&&(this.map.getLayer("i4")&&this.map.setLayoutProperty("i4","visibility","visible"),this.map.getLayer("hi")&&this.map.setLayoutProperty("hi","visibility","visible"),this.map.getLayer("admin-0-boundary-bg")&&this.map.setLayoutProperty("admin-0-boundary-bg","visibility","none"),this.map.getLayer("country-label")&&this.map.setLayoutProperty("admin-0-boundary","visibility","none"),this.map.getLayer("admin-0-boundary-disputed")&&this.map.setLayoutProperty("admin-0-boundary-disputed","visibility","none"),this.map.getLayer("country-label")&&this.map.setLayoutProperty("country-label","visibility","none"),this.map.getLayer("continent-label")&&this.map.setLayoutProperty("continent-label","visibility","none"),this.map.getLayer("state-label")&&this.map.setLayoutProperty("state-label","visibility","none")))},handleWeatherLayerChange(a={sourceChanged:!1}){this.map?setTimeout(()=>{var o;const t=(o=this.activeWeatherLayers)==null?void 0:o.reduce((r,i)=>r+(r&(i==null?void 0:i.weight)?0:i==null?void 0:i.weight),0);a!=null&&a.sourceChanged||this.weatherWeight!==t?(this.weatherWeight=t,this.fetchWeatherLayers()):this.handleWeatherLayerToggle()}):setTimeout(()=>{this.handleWeatherLayerChange()},500)},handleRampColorInitial(){var a,t,o,r,i,l,n,c,s,h,d,m;this.viewport.map.getSource((a=this.viewport)==null?void 0:a.rampColorSource)||this.viewport.map.addSource((t=this.viewport)==null?void 0:t.rampColorSource,{type:"canvas",canvas:(o=this.viewport)==null?void 0:o.rampColorCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((r=this.viewport)==null?void 0:r.rampColorLayer)||this.viewport.map.addLayer({type:"raster",id:(i=this.viewport)==null?void 0:i.rampColorLayer,source:(l=this.viewport)==null?void 0:l.rampColorSource,layout:{visibility:"none"}},this.beforeLayer),this.viewport.map.getSource((n=this.viewport)==null?void 0:n.particleSource)||this.viewport.map.addSource((c=this.viewport)==null?void 0:c.particleSource,{type:"canvas",canvas:(s=this.viewport)==null?void 0:s.particleCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((h=this.viewport)==null?void 0:h.particleLayer)||this.viewport.map.addLayer({type:"raster",id:(d=this.viewport)==null?void 0:d.particleLayer,source:(m=this.viewport)==null?void 0:m.particleSource,layout:{visibility:"none"}},this.beforeLayer)},handleDrawWeather4Json(){var h,d,m,g,u,f,z;const a=new Date().valueOf();let t=0,o=0;const r=(h=this.map)==null?void 0:h.getBounds(),i=(d=this.map)==null?void 0:d.getZoom(),l=V.LngLatHelper.convertToStdLng(r._sw.lng),n=V.LngLatHelper.convertToStdLng(r._ne.lng),c=Math.floor(r._sw.lat),s=Math.ceil(r._ne.lat);for(const k in this.weatherLayers){let S=!1;if(this.weatherLayers[k].active&&this.weatherLayers[k].type==="json"){let v=[];if(k==="swell"){S=!0;const x=((m=this.weatherLayers[k])==null?void 0:m.direction)||{};for(const w in x)if(w>c&&w<s&&(!(i<=this.zoom)||w%(i<2?10:i<4?5:3)===0)){const _=x[w].lng;l>n?_.forEach((y,L)=>{var B,I,D,R,W,U;if(i<2){if((y>=0&&y<=360||y>=-360&&y<=0)&&y%10===0){const F=M.point([y,w],{val:((B=x[w].val)==null?void 0:B[L])||((I=x[w].dir)==null?void 0:I[L]),spd:(D=x[w].spd)==null?void 0:D[L]});v.push(F)}}else if((y>=l&&y<=180||y>=-180&&y<=n)&&(!(i<=this.zoom)||y%(i<2?10:i<4?5:3)===0)){const F=M.point([y,w],{val:((R=x[w].val)==null?void 0:R[L])||((W=x[w].dir)==null?void 0:W[L]),spd:(U=x[w].spd)==null?void 0:U[L]});v.push(F)}}):_.forEach((y,L)=>{var B,I,D,R,W,U;if(l<2){if((y>=0&&y<=360||y>=-360&&y<=0)&&y%10===0){const F=M.point([y,w],{val:((B=x[w].val)==null?void 0:B[L])||((I=x[w].dir)==null?void 0:I[L]),spd:(D=x[w].spd)==null?void 0:D[L]});v.push(F)}}else if(y>=l&&y<=n&&(!(i<=this.zoom)||y%(i<2?10:i<4?5:3)===0)){const F=M.point([y,w],{val:((R=x[w].val)==null?void 0:R[L])||((W=x[w].dir)==null?void 0:W[L]),spd:(U=x[w].spd)==null?void 0:U[L]});v.push(F)}})}o=new Date().valueOf()-(a+t),console.log("swell direction elapsed: ",o,", total: ",t+=o);const b=this.weatherLayers[k].height;if(b){if(!b.data){const w=[];for(const _ in(g=b.raw)==null?void 0:g.LineString){const y=b.raw.LineString[_];for(const L of y)w.push(M.lineString(L,{val:Number(_)}));b.data=M.featureCollection(w)}}if(b.data){const w=this.handleBboxClip(b.data,r);v=v.concat(w)}o=new Date().valueOf()-(a+t),console.log("swell height elapsed: ",o,", total: ",t+=o)}}else if(k==="current"){S=!0;const x=((u=this.weatherLayers[k])==null?void 0:u.direction)||{};for(const w in x)if(w>c&&w<s&&(!(i<=this.zoom)||w%(i<2?10:i<4?5:3)===0)){const _=x[w].lng;l>n?_.forEach((y,L)=>{var B,I,D,R,W,U;if(i<2){if((y>=0&&y<=360||y>=-360&&y<=0)&&y%10===0){const F=M.point([y,w],{val:((B=x[w].val)==null?void 0:B[L])||((I=x[w].dir)==null?void 0:I[L]),spd:(D=x[w].spd)==null?void 0:D[L]});v.push(F)}}else if((y>=l&&y<=180||y>=-180&&y<=n)&&(!(i<=this.zoom)||y%(i<2?10:i<4?5:3)===0)){const F=M.point([y,w],{val:((R=x[w].val)==null?void 0:R[L])||((W=x[w].dir)==null?void 0:W[L]),spd:(U=x[w].spd)==null?void 0:U[L]});v.push(F)}}):_.forEach((y,L)=>{var B,I,D,R,W,U;if(l<2){if((y>=0&&y<=360||y>=-360&&y<=0)&&y%10===0){const F=M.point([y,w],{val:((B=x[w].val)==null?void 0:B[L])||((I=x[w].dir)==null?void 0:I[L]),spd:(D=x[w].spd)==null?void 0:D[L]});v.push(F)}}else if(y>=l&&y<=n&&(!(i<=this.zoom)||y%(i<this.zoom/2?5:3)===0)){const F=M.point([y,w],{val:((R=x[w].val)==null?void 0:R[L])||((W=x[w].dir)==null?void 0:W[L]),spd:(U=x[w].spd)==null?void 0:U[L]});v.push(F)}})}o=new Date().valueOf()-(a+t),console.log("current direction elapsed: ",o,", total: ",t+=o);const b=this.weatherLayers[k].speed;if(b){if(!b.data){const _=[];for(const y in(f=b.raw)==null?void 0:f.Polygon){const L=b.raw.Polygon[y];for(const B of L)_.push(M.polygon(B,{val:Number(y)}))}b.data=M.featureCollection(_)}const w=i<this.zoom?b.data.features.filter(_=>_.properties.val>.5):b.data.features;v=v.concat(w),o=new Date().valueOf()-(a+t),console.log("current speed elapsed: ",o,", total: ",t+=o)}}else if(k==="wind"){S=!0;const x=this.weatherLayers.wind.raw;for(const b in x)if(b>c&&b<s&&(!(i<=this.zoom)||b%(i<2?10:i<4?5:3)===0)){const w=x[b].lng;l>n?w.forEach((_,y)=>{var L,B,I,D;if(i<2){if((_>=0&&_<=360||_>=-360&&_<=0)&&_%10===0){const R=M.point([_,b],{dir:((L=x[b].val)==null?void 0:L[y])||((B=x[b].dir)==null?void 0:B[y]),spd:x[b].spd[y]});v.push(R)}}else if((_>=l&&_<=180||_>=-180&&_<=n)&&(!(i<=this.zoom)||_%(i<2?10:i<4?5:3)===0)){const R=M.point([_,b],{dir:((I=x[b].val)==null?void 0:I[y])||((D=x[b].dir)==null?void 0:D[y]),spd:x[b].spd[y]});v.push(R)}}):w.forEach((_,y)=>{var L,B,I,D;if(i<2){if((_>=0&&_<=360||_>=-360&&_<=0)&&_%10===0){const R=M.point([_,b],{dir:((L=x[b].val)==null?void 0:L[y])||((B=x[b].dir)==null?void 0:B[y]),spd:x[b].spd[y]});v.push(R)}}else if(_>=l&&_<=n&&(!(i<=this.zoom)||_%(i<2?10:i<4?5:3)===0)){const R=M.point([_,b],{dir:((I=x[b].val)==null?void 0:I[y])||((D=x[b].dir)==null?void 0:D[y]),spd:x[b].spd[y]});v.push(R)}})}o=new Date().valueOf()-(a+t),console.log("wind barb elapsed: ",o,", total: ",t+=o)}else if(k==="sig-wave-height"){if(this.weatherLayers[k].data)v=this.weatherLayers[k].data;else{S=!0;const x=this.weatherLayers[k].raw;if(x){const b=[];for(const w in x.Polygon){const _=x.Polygon[w];for(const y of _)b.push(M.polygon(y,{val:Number(w)}))}for(const w in x.Point){const _=x.Point[w];for(let y=0;y<((z=_.lng)==null?void 0:z.length);y++)b.push(M.point([_.lng[y],w],{val:Number(_.val[y])}))}v=v.concat(b)}}o=new Date().valueOf()-(a+t),console.log("sig-wave-height elapsed: ",o,", total: ",t+=o)}else if(k==="prmsl"){if(this.weatherLayers[k].data)v=this.weatherLayers[k].data;else{S=!0;const x=this.weatherLayers[k].raw;if(x){const b=[];for(const w in x.LineString){const _=x.LineString[w];for(const y of _)b.push(M.lineString(y,{val:Number(w)}))}for(const w in x.Point)x.Point[w].lng.forEach((_,y)=>{_=V.LngLatHelper.convertToStdLng(_),b.push(M.point([_,w],{val:x.Point[w].val[y],type:x.Point[w].type[y]}))});v=v.concat(b)}}o=new Date().valueOf()-(a+t),console.log("prmsl elapsed: ",o,", total: ",t+=o)}v.length&&(this.weatherLayers[k].data=M.featureCollection(v)),S&&(this.weatherLayers[k].version=Math.random()+1)}}},handleMove4Weather(){for(const a in this.weatherLayers)this.weatherLayers[a].active&&this.weatherLayers[a].type==="image"&&(this.weatherLayers[a].active=!0,this.weatherLayers[a].version=Math.random()+1);this.handleDrawWeather4Json()},handleBboxClip(a,t){const o=[],r=V.LngLatHelper.convertToStdLng(t._sw.lng),i=V.LngLatHelper.convertToStdLng(t._ne.lng);return a.features.forEach(l=>{if(l.geometry.type!=="Point")if(r>i){let n=[r,t._sw.lat,180,t._ne.lat],c=M.bboxClip(l,n);c.geometry.coordinates.length&&o.push(c),n=[-180,t._sw.lat,i,t._ne.lat],c=M.bboxClip(l,n),c.geometry.coordinates.length&&o.push(c)}else{const n=[r,t._sw.lat,i,t._ne.lat],c=M.bboxClip(l,n);c.geometry.coordinates.length&&o.push(c)}else o.push(l)}),o}}},cr={class:"idm-gl4-meteo-layers"},mr={class:"header-box d-flex justify-space-between align-center pl-4 pr-4"},dr={class:"d-flex justify-start align-center ga-3"},hr={class:"text-h5"},pr={class:"layers-body"},gr={class:"layers-body"},ur={key:0,class:"d-flex justify-start align-center ga-4 pl-6"},fr={key:1,class:"d-flex justify-start align-center ga-4 pl-6"},yr={class:"text-body-1 py-2"},br={class:"text-body-1 font-weight-medium"},wr={class:"text-body-2 opacity-70"},xr={key:0,class:"text-body-2 opacity-70 mb-3"},_r={class:"text-body-1 py-2"},kr={class:"text-body-1 font-weight-medium"},zr={class:"text-body-2 opacity-70"},vr={class:"text-body-2 opacity-70 pb-1"};function Lr(a,t,o,r,i,l){var F,$,te,ie,oe,j,C,ee,le,se,pe,ge,be,we,xe;const n=e.resolveComponent("VBtn"),c=e.resolveComponent("VTooltip"),s=e.resolveComponent("VSwitch"),h=e.resolveComponent("VCardTitle"),d=e.resolveComponent("VCardItem"),m=e.resolveComponent("VCheckbox"),g=e.resolveComponent("VCardText"),u=e.resolveComponent("VCard"),f=e.resolveComponent("VBtnToggle"),z=e.resolveComponent("VDivider"),k=e.resolveComponent("IdmWindBarb"),S=e.resolveComponent("IdmSigWaveHeight"),v=e.resolveComponent("IdmCurrentDirection"),x=e.resolveComponent("IdmPrmsl"),b=e.resolveComponent("IdmWindParticle"),w=e.resolveComponent("IdmCurrentParticle"),_=e.resolveComponent("IdmWave"),y=e.resolveComponent("IdmSwell"),L=e.resolveComponent("IdmIceEdge"),B=e.resolveComponent("IdmIceCover"),I=e.resolveComponent("IdmIceThickness"),D=e.resolveComponent("IdmPrecip3h"),R=e.resolveComponent("IdmVisibility"),W=e.resolveComponent("IdmWaterTemp"),U=e.resolveComponent("IdmTemp");return e.openBlock(),e.createElementBlock("div",cr,[e.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:e.normalizeStyle({top:o.top+94+"px",right:i.right+"px"})},[e.createVNode(c,{text:a.$t("weather.weatherLayers"),location:"left"},{activator:e.withCtx(({props:Y})=>[e.createVNode(n,e.mergeProps(Y,{"min-width":"32",width:"32",height:"32",class:"text-none pa-0",color:i.toggle?"primary":"",onClick:l.handleMenuToggle}),{default:e.withCtx(()=>t[6]||(t[6]=[e.createElementVNode("i",{class:"iconfont icon-Weather text-h4"},null,-1)])),_:2,__:[6]},1040,["color","onClick"])]),_:1},8,["text"])],4),e.createElementVNode("div",{class:e.normalizeClass(["available-layers transition flex-center",i.toggle?"right-bar":""]),style:e.normalizeStyle({top:o.top+"px",right:i.toggle?"0px":"-280px"})},[e.createElementVNode("div",mr,[e.createElementVNode("div",dr,[e.createElementVNode("div",hr,e.toDisplayString(a.$t("weather.weather")),1),e.createVNode(s,{modelValue:i.autoActive,"onUpdate:modelValue":t[0]||(t[0]=Y=>i.autoActive=Y),class:"small-switch",color:"primary","hide-details":""},null,8,["modelValue"])]),e.createVNode(n,{icon:"",density:"comfortable",variant:"plain",class:"mr-n2",onClick:l.handleMenuToggle},{default:e.withCtx(()=>t[7]||(t[7]=[e.createElementVNode("i",{class:"iconfont icon-close",style:{"font-size":"20px"}},null,-1)])),_:1,__:[7]},8,["onClick"])]),e.createElementVNode("div",{class:e.normalizeClass(["list-box scroll pl-4 pr-2 overflow-y-auto",i.autoActive?"":"cursor-not-allowed"])},[e.createVNode(u,{class:"menu-card mx-auto my-3",elevation:"8"},{default:e.withCtx(()=>[e.createVNode(d,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(h,{class:"text-subtitle-1",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("weather.overlays")),1)]),_:1})]),_:1}),e.createVNode(g,null,{default:e.withCtx(()=>[e.createElementVNode("div",pr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tagLayers.filter(Y=>Y.overlays),Y=>(e.openBlock(),e.createBlock(m,{key:Y.key,modelValue:i.checkList,"onUpdate:modelValue":t[1]||(t[1]=ae=>i.checkList=ae),value:Y.key,label:a.$t(`weather.${Y.locale}`),disabled:!i.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label","disabled"]))),128))])]),_:1})]),_:1}),e.createVNode(u,{class:"menu-card mx-auto mb-3",elevation:"8"},{default:e.withCtx(()=>[e.createVNode(d,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(h,{class:"text-subtitle-1",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("weather.renders")),1)]),_:1})]),_:1}),e.createVNode(g,null,{default:e.withCtx(()=>[e.createElementVNode("div",gr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tagLayers.filter(Y=>!Y.overlays&&Y.key!=="ice-thickness"),Y=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Y.key},[e.createVNode(m,{modelValue:i.checkList,"onUpdate:modelValue":t[2]||(t[2]=ae=>i.checkList=ae),value:Y.key,label:a.$t(`weather.${Y.locale}`),disabled:!i.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label","disabled"]),i.checkList.includes("wind-particle")&&Y.key==="wind-particle"?(e.openBlock(),e.createElementBlock("div",ur,[t[8]||(t[8]=e.createElementVNode("span",null,"Particle",-1)),e.createVNode(s,{modelValue:i.showWindParticle,"onUpdate:modelValue":t[3]||(t[3]=ae=>i.showWindParticle=ae),label:"",class:"small-switch",color:"primary",density:"compact",style:{"font-size":"14px"},"hide-details":""},null,8,["modelValue"])])):e.createCommentVNode("",!0),i.checkList.includes("current-particle")&&Y.key==="current-particle"?(e.openBlock(),e.createElementBlock("div",fr,[t[9]||(t[9]=e.createElementVNode("span",null,"Particle",-1)),e.createVNode(s,{modelValue:i.showCurrentParticle,"onUpdate:modelValue":t[4]||(t[4]=ae=>i.showCurrentParticle=ae),label:"",class:"small-switch",color:"primary",density:"compact",height:"20","hide-details":""},null,8,["modelValue"])])):e.createCommentVNode("",!0),i.checkList.includes("ice-forecast")&&Y.key==="ice-forecast"?(e.openBlock(),e.createBlock(f,{key:2,modelValue:i.iceToggleValue,"onUpdate:modelValue":t[5]||(t[5]=ae=>i.iceToggleValue=ae),class:"ml-7",rounded:"0",height:"30",density:"compact",group:"",disabled:!i.autoActive},{default:e.withCtx(()=>[e.createVNode(n,{density:"compact",height:"30",value:"ice-cover",class:"text-none px-2",color:i.iceToggleValue==="ice-cover"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("weather.coverage")),1)]),_:1},8,["color","disabled"]),e.createVNode(n,{density:"compact",height:"30",class:"text-none px-2",color:i.iceToggleValue==="ice-thickness"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive,value:"ice-thickness"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("weather.thickness")),1)]),_:1},8,["color","disabled"])]),_:1},8,["modelValue","disabled"])):e.createCommentVNode("",!0)],64))),128))])]),_:1})]),_:1}),e.createVNode(u,{class:"menu-card mx-auto mb-3",elevation:"8"},{default:e.withCtx(()=>[e.createVNode(d,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(h,{class:"text-subtitle-1",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("weather.forecastModel")),1)]),_:1})]),_:1}),e.createVNode(g,{class:""},{default:e.withCtx(()=>{var Y,ae,me,_e;return[e.createElementVNode("div",yr,e.toDisplayString(a.$t("weather.atmospheric")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((ae=(Y=i.sourceList)==null?void 0:Y.weather)==null?void 0:ae.filter(H=>H.model!=="best_match"),H=>{var fe,de,q,re,E,ue;return e.openBlock(),e.createElementBlock(e.Fragment,{key:`source${H.name}`},[e.createElementVNode("div",br,e.toDisplayString(H.name)+" "+e.toDisplayString(H.resolution)+e.toDisplayString(a.$t("units.km"))+" "+e.toDisplayString(H.length)+e.toDisplayString(a.$t("units.days")),1),e.createElementVNode("div",wr,e.toDisplayString(a.$t("weather.source"))+": "+e.toDisplayString(H.provider),1),(q=(de=(fe=H==null?void 0:H.update)==null?void 0:fe.default)==null?void 0:de.meta)!=null&&q.initialisationTime?(e.openBlock(),e.createElementBlock("div",xr,e.toDisplayString(a.$t("weather.lastUpdate"))+": "+e.toDisplayString(l.computeDateZ((ue=(E=(re=H==null?void 0:H.update)==null?void 0:re.default)==null?void 0:E.meta)==null?void 0:ue.initialisationTime)),1)):e.createCommentVNode("",!0)],64)}),128)),e.createVNode(z),e.createElementVNode("div",_r,e.toDisplayString(a.$t("weather.marine")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((_e=(me=i.sourceList)==null?void 0:me.marine)==null?void 0:_e.filter(H=>H.model!=="best_match"),H=>{var fe,de,q;return e.openBlock(),e.createElementBlock(e.Fragment,{key:`source${H.name}`},[e.createElementVNode("div",kr,e.toDisplayString(H.name)+" "+e.toDisplayString(H.resolution)+e.toDisplayString(a.$t("units.km"))+" "+e.toDisplayString(H.length)+e.toDisplayString(a.$t("units.days")),1),e.createElementVNode("div",zr,e.toDisplayString(a.$t("weather.source"))+": "+e.toDisplayString(H.provider),1),e.createElementVNode("div",vr,e.toDisplayString(a.$t("weather.lastUpdate"))+": "+e.toDisplayString(l.computeDateZ((q=(de=(fe=H==null?void 0:H.update)==null?void 0:fe.default)==null?void 0:de.meta)==null?void 0:q.initialisationTime)),1)],64)}),128))]}),_:1})]),_:1})],2)],6),o.map?(e.openBlock(),e.createBlock(k,e.mergeProps({key:0,ref:"windBarb",map:o.map,"map-feather":o.mapFeather,"before-layer":"empty-layer-2",wind:(F=i.weatherLayers)==null?void 0:F.wind,"menu-toggle":o.menuToggle},a.$attrs),null,16,["map","map-feather","wind","menu-toggle"])):e.createCommentVNode("",!0),o.map?(e.openBlock(),e.createBlock(S,e.mergeProps({key:1,map:o.map,"before-layer":"empty-layer-2","sig-wave-height":($=i.weatherLayers)==null?void 0:$["sig-wave-height"],"menu-toggle":o.menuToggle,"active-weather-layers":i.activeWeatherLayers},a.$attrs),null,16,["map","sig-wave-height","menu-toggle","active-weather-layers"])):e.createCommentVNode("",!0),o.map?(e.openBlock(),e.createBlock(v,e.mergeProps({key:2,map:o.map,"map-feather":o.mapFeather,"before-layer":"empty-layer-2",current:(te=i.weatherLayers)==null?void 0:te.current,"menu-toggle":o.menuToggle},a.$attrs),null,16,["map","map-feather","current","menu-toggle"])):e.createCommentVNode("",!0),o.map?(e.openBlock(),e.createBlock(x,e.mergeProps({key:3,map:o.map,"before-layer":"empty-layer-2",prmsl:(ie=i.weatherLayers)==null?void 0:ie.prmsl,"menu-toggle":o.menuToggle,"active-weather-layers":i.activeWeatherLayers},a.$attrs),null,16,["map","prmsl","menu-toggle","active-weather-layers"])):e.createCommentVNode("",!0),o.map?(e.openBlock(),e.createBlock(b,e.mergeProps({key:4,viewport:i.viewport,factor:(oe=i.weatherLayers)==null?void 0:oe["wind-particle"],"menu-toggle":o.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),o.map?(e.openBlock(),e.createBlock(w,e.mergeProps({key:5,viewport:i.viewport,factor:(j=i.weatherLayers)==null?void 0:j["current-particle"],"menu-toggle":o.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),o.map?(e.openBlock(),e.createBlock(_,e.mergeProps({key:6,viewport:i.viewport,factor:(C=i.weatherLayers)==null?void 0:C["sig-wave"],"menu-toggle":o.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),o.map?(e.openBlock(),e.createBlock(y,e.mergeProps({key:7,map:o.map,swell:(ee=i.weatherLayers)==null?void 0:ee.swell,"menu-toggle":o.menuToggle,"active-weather-layers":i.activeWeatherLayers},a.$attrs),null,16,["map","swell","menu-toggle","active-weather-layers"])):e.createCommentVNode("",!0),o.map?(e.openBlock(),e.createBlock(L,e.mergeProps({key:8,viewport:i.viewport,factor:(le=i.weatherLayers)==null?void 0:le["ice-edge"],"menu-toggle":o.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),o.map?(e.openBlock(),e.createBlock(B,e.mergeProps({key:9,viewport:i.viewport,factor:(se=i.weatherLayers)==null?void 0:se["ice-cover"],"menu-toggle":o.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),o.map?(e.openBlock(),e.createBlock(I,e.mergeProps({key:10,viewport:i.viewport,factor:(pe=i.weatherLayers)==null?void 0:pe["ice-thickness"],"menu-toggle":o.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),o.map?(e.openBlock(),e.createBlock(D,e.mergeProps({key:11,viewport:i.viewport,factor:(ge=i.weatherLayers)==null?void 0:ge.precip3h,"menu-toggle":o.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),o.map?(e.openBlock(),e.createBlock(R,e.mergeProps({key:12,viewport:i.viewport,factor:(be=i.weatherLayers)==null?void 0:be.visibility,"menu-toggle":o.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),o.map?(e.openBlock(),e.createBlock(W,e.mergeProps({key:13,viewport:i.viewport,factor:(we=i.weatherLayers)==null?void 0:we["water-temp"],"menu-toggle":o.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),o.map?(e.openBlock(),e.createBlock(U,e.mergeProps({key:14,viewport:i.viewport,factor:(xe=i.weatherLayers)==null?void 0:xe.temp,"menu-toggle":o.menuToggle},a.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0)])}const Cr=O(sr,[["render",Lr]]),Se=[{rank:0,name:"Best Match",alias:"BEST MATCH",model:"best_match",models:["best_match"]},{rank:1,name:"GFS",alias:"GFS",model:"gfs_seamless",provider:"NOAA",country:"United States",resolution:25,tips:"3-25km",length:16,frequency:1,models:["gfs_seamless"],categories:"ncep_gfs013,ncep_gfs025,ncep_gfs_graphcast025,ncep_hrrr_conus,ncep_nbm_conus",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:2,name:"ECMWF",alias:"ECMWF",model:"ecmwf_ifs025",provider:"ECMWF",country:"European Union",resolution:25,tips:"25km",length:15,frequency:6,models:["ecmwf_ifs025","ecmwf_aifs025_single"],categories:"ecmwf_ifs025,ecmwf_aifs025_single",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:3,disabled:!0,name:"ICON",alias:"ECMWF",model:"icon_seamless",provider:"Deutscher Wetterdienst (DWD)",country:"Germany",resolution:13,tips:"2-13km",length:7.5,frequency:3,models:["icon_seamless","icon_global","icon_eu","icon_d2"],categories:"dwd_icon,dwd_icon_eps,dwd_icon_d2,dwd_icon_d2_eps,dwd_icon_eu,dwd_icon_eu_eps",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:4,name:"ARPEGE",disabled:!0,alias:"ECMWF",model:"arpege_seamless",provider:"Météo-France",country:"France",resolution:25,tips:"1-25km",length:4,frequency:1,models:["arpege_seamless","arpege_world","arpege_europe"],categories:"meteofrance_arpege_europe,meteofrance_arpege_europe_probabilities,meteofrance_arpege_world025",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:5,name:"UKMO",disabled:!0,alias:"ECMWF",model:"ukmo_seamless",provider:"UK Met Office",country:"United Kingdom",resolution:10,tips:"2-10km",length:7,frequency:1,models:["ukmo_seamless","ukmo_global_deterministic_10km","ukmo_uk_deterministic_2km"],categories:"ukmo_global_deterministic_10km,ukmo_uk_deterministic_2km",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:6,name:"JMA",disabled:!0,alias:"GFS",model:"jma_seamless",provider:"JMA",country:"Japan",resolution:55,tips:"5-55km",length:11,frequency:3,models:["jma_seamless","jma_msm","jma_gsm"],categories:"jma_gsm,jma_msm",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:7,name:"GEM",disabled:!0,alias:"GFS",model:"gem_seamless",provider:"Canadian Weather Service",country:"Canada",resolution:2.5,tips:"2.5km",length:10,frequency:6,models:["gem_seamless","gem_global","gem_regional"],categories:"cmc_gem_gdps,cmc_gem_hrdps,cmc_gem_rdps",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:8,name:"GRAPES",disabled:!0,alias:"GFS",model:"cma_grapes_global",provider:"China Meteorological Administration (CMA)",country:"China",resolution:15,tips:"15km",length:10,frequency:6,models:["cma_grapes_global"],categories:"cma_grapes_global",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:9,name:"ACCESS-G",disabled:!0,alias:"GFS",model:"bom_access_global",provider:"Australian Bureau of Meteorology (BOM)",country:"Australia",resolution:15,tips:"15km",length:10,frequency:6,models:["bom_access_global"],categories:"bom_access_global",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"}],Te=[{rank:0,name:"Best Match",alias:"BEST MATCH",model:"best_match",models:["best_match"]},{rank:1,name:"MFWAM",alias:"ECMWF",model:"meteofrance_wave",provider:"MeteoFrance",country:"France",resolution:8,tips:"8km",length:10,frequency:12,models:["meteofrance_wave"],categories:"meteofrance_wave",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:2,disabled:!0,name:"SMOC",alias:"ECMWF",model:"meteofrance_currents",provider:"MeteoFrance",country:"France",resolution:8,tips:"8km",length:10,frequency:24,models:["meteofrance_currents"],categories:"meteofrance_currents, meteofrance_sea_surface_temperature",variables:"ocean_u_current,ocean_v_current,invert_barometer_height,sea_level_height_msl,sea_surface_temperature"},{rank:3,disabled:!0,name:"EWAM",alias:"ECMWF",model:"ewam",provider:"DWD",country:"Germany",resolution:5,tips:"5km",length:8,frequency:2,models:["ewam"],categories:"dwd_ewam",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:4,disabled:!0,name:"GWAM",alias:"ECMWF",model:"gwam",provider:"DWD",country:"Germany",resolution:5,tips:"5km",length:4,frequency:2,models:["gwam"],categories:"dwd_gwam",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:5,disabled:!0,name:"ECWAM",alias:"ECMWF",model:"ecmwf_wam025",provider:"ECMWF",country:"Europe",resolution:25,tips:"25km",length:10,frequency:6,models:["ecmwf_wam025"],categories:"ecmwf_wam025",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:6,name:"GFSWave",alias:"GFS",model:"ncep_gfswave025",provider:"NCEP",country:"USA",resolution:25,tips:"25km",length:10,frequency:6,models:["ncep_gfswave025","ncep_gfswave016"],categories:"ncep_gfswave025,ncep_gfswave016",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:7,disabled:!0,name:"ERA5-Ocean",alias:"ECMWF",model:"era5_ocean",provider:"Copernicus",country:"Europe",resolution:50,tips:"50km",length:-5,frequency:1,models:["era5_ocean"],categories:"copernicus_era5_ocean",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"}];class Ve{static standardWeatherModels(){return Se.filter(t=>!t.disabled&&t.alias)}static standardMarineModels(){return Te.filter(t=>!t.disabled&&t.alias)}static autoPickLayerModel(t,o="copernicus"){return o=o||"copernicus",o=o==null?void 0:o.toLowerCase(),o=["gfs","ecmwf","copernicus"].includes(o)?o:"copernicus",t=t==null?void 0:t.toLowerCase(),t==="gfs"?"gfs":["ec","ecmwf"].includes(t)?"ecmwf":["copernicus","cmems"].includes(t)?"copernicus":o}static autoPickPeerModel(t,o,r="copernicus"){if(o=this.autoPickLayerModel(o,r),Eo.LayerHelper.WEATHER_LAYERS.reduce((i,l)=>l.atmos?i+l.weight:i,0)&t.weight){if(o==="copernicus")return"ecmwf"}else if(o==="ecmwf")return"copernicus";return o}static autoPickMeteoModel(t="best_match"){var o,r;t=t==null?void 0:t.toLowerCase(),t=t==="ec"?"ecmwf":t;const i=t.toLowerCase().split(","),l=[],n=[];for(const c of i){let s=Se.find(d=>{var m,g,u;return((m=d.models)==null?void 0:m.includes(c))||((g=d.alias)==null?void 0:g.toLowerCase())===c||((u=d.name)==null?void 0:u.toLowerCase())===c}),h=Te.find(d=>{var m,g,u;return((m=d.models)==null?void 0:m.includes(c))||((g=d.alias)==null?void 0:g.toLowerCase())===c||((u=d.name)==null?void 0:u.toLowerCase())===c});s=s||Se.find(d=>{var m,g;return((m=d.alias)==null?void 0:m.toLowerCase())===((g=h==null?void 0:h.alias)==null?void 0:g.toLowerCase())}),h=h||Te.find(d=>{var m,g;return((m=d.alias)==null?void 0:m.toLowerCase())===((g=s==null?void 0:s.alias)==null?void 0:g.toLowerCase())}),s=s||Se[0],h=h||Te[0],l.push((o=s.models)!=null&&o.includes(c)?c:s.model),n.push((r=h.models)!=null&&r.includes(c)?c:h.model)}return{weatherModels:l.join(","),marineModels:n.join(",")}}static autoPickSubCategories(t){t=t.toUpperCase();const o=Se.filter(l=>l.alias===t),r=Te.filter(l=>l.alias===t),i=[];return o.forEach(l=>{l.categories&&i.push(...l.categories.split(","))}),r.forEach(l=>{l.categories&&i.push(...l.categories.split(","))}),i}static pickHourly(t,o){var r,i,l,n,c,s,h,d,m,g,u,f,z,k,S,v,x,b,w,_,y,L,B,I,D,R,W,U,F,$,te,ie,oe,j,C,ee,le,se,pe,ge,be,we,xe,Y,ae,me,_e,H,fe,de;const q=typeof o=="string"?P(o):o,re=t==null?void 0:t.weather,E=t==null?void 0:t.marine,ue=P((i=(r=re==null?void 0:re[0])==null?void 0:r.hourly)==null?void 0:i.date).utc(),Z=ue.clone().add((c=(n=(l=re==null?void 0:re[0])==null?void 0:l.hourly)==null?void 0:n.time)==null?void 0:c.at(0),"h"),K=ue.clone().add((d=(h=(s=re==null?void 0:re[0])==null?void 0:s.hourly)==null?void 0:h.time)==null?void 0:d.at(-1),"h"),ve=[];if(q.isBetween(Z,K,"millisecond","[]")){const N=q.utc().diff(Z,"h",!1);let ce,ze;if(re){let Le=0,Ce=0;for(const T of re){const A=T==null?void 0:T.hourly;for(let ke=N-(N-1)%3;ke<=N;ke++)Le+=(m=A==null?void 0:A.precipitation)==null?void 0:m.at(ke);for(let ke=N-(N-1)%6;ke<=N;ke++)Ce+=(g=A==null?void 0:A.precipitation)==null?void 0:g.at(ke);ce={temp:(u=A==null?void 0:A.temperature_2m)==null?void 0:u.at(N),apparentTemp:(f=A==null?void 0:A.apparent_temperature)==null?void 0:f.at(N),rh:(z=A==null?void 0:A.relative_humidity_2m)==null?void 0:z.at(N),dp:(k=A==null?void 0:A.dew_point_2m)==null?void 0:k.at(N),precip:{probability:(S=A==null?void 0:A.precipitation_probability)==null?void 0:S.at(N),sum:(v=A==null?void 0:A.precipitation)==null?void 0:v.at(N),sum3Hours:Math.round(Le*100)/100,sum6Hours:Math.round(Ce*100)/100},pmsl:(x=A==null?void 0:A.pressure_msl)==null?void 0:x.at(N),psurf:(b=A==null?void 0:A.surface_pressure)==null?void 0:b.at(N),code:(w=A==null?void 0:A.weather_code)==null?void 0:w.at(N),visibility:this.m2nm((_=A==null?void 0:A.visibility)==null?void 0:_.at(N)),wind:{speed:(y=A==null?void 0:A.wind_speed_10m)==null?void 0:y.at(N),kts:(L=A==null?void 0:A.wind_speed_10m)==null?void 0:L.at(N),degree:(B=A==null?void 0:A.wind_direction_10m)==null?void 0:B.at(N),bearing:((I=A==null?void 0:A.wind_direction_10m)==null?void 0:I.at(N))!==null?(((D=A==null?void 0:A.wind_direction_10m)==null?void 0:D.at(N))+180)%360:null,gusts:(R=A==null?void 0:A.wind_gusts_10m)==null?void 0:R.at(N)},isDay:(W=A==null?void 0:A.is_day)==null?void 0:W.at(N)};const{name:Ee,url:Be,bg:De}=this.parseWeatherCode(ce.code,ce.isDay);ce.name=Ee,ce.url=Be,ce.bg=De,ce.wind.scale=this.beaufort(this.kts2ms(ce.wind.kts)),ce.wind.direction=this.degree2Direction(ce.wind.degree),ve.push({utc:Z.add(N,"h").format(),model:T.model,weather:{...ce}})}}if(E){let Le=0;for(const Ce of E){const T=Ce==null?void 0:Ce.hourly;ze={wave:{sig:{height:(U=T==null?void 0:T.wave_height)==null?void 0:U.at(N),degree:(F=T==null?void 0:T.wave_direction)==null?void 0:F.at(N),bearing:(($=T==null?void 0:T.wave_direction)==null?void 0:$.at(N))!==null?(((te=T==null?void 0:T.wave_direction)==null?void 0:te.at(N))+180)%360:null,period:(ie=T==null?void 0:T.wave_period)==null?void 0:ie.at(N)},swell:{height:(oe=T==null?void 0:T.swell_wave_height)==null?void 0:oe.at(N),degree:(j=T==null?void 0:T.swell_wave_direction)==null?void 0:j.at(N),bearing:((C=T==null?void 0:T.swell_wave_direction)==null?void 0:C.at(N))!==null?(((ee=T==null?void 0:T.swell_wave_direction)==null?void 0:ee.at(N))+180)%360:null,period:(le=T==null?void 0:T.swell_wave_period)==null?void 0:le.at(N),peakPeriod:(se=T==null?void 0:T.swell_wave_peak_period)==null?void 0:se.at(N)},wd:{height:(pe=T==null?void 0:T.wind_wave_height)==null?void 0:pe.at(N),degree:(ge=T==null?void 0:T.wind_wave_direction)==null?void 0:ge.at(N),bearing:((be=T==null?void 0:T.wind_wave_direction)==null?void 0:be.at(N))!==null?(((we=T==null?void 0:T.wind_wave_direction)==null?void 0:we.at(N))+180)%360:null,period:(xe=T==null?void 0:T.wind_wave_period)==null?void 0:xe.at(N),peakPeriod:(Y=T==null?void 0:T.wind_wave_peak_period)==null?void 0:Y.at(N)}},current:{speed:(ae=T==null?void 0:T.ocean_current_velocity)==null?void 0:ae.at(N),kts:(me=T==null?void 0:T.ocean_current_velocity)==null?void 0:me.at(N),degree:(_e=T==null?void 0:T.ocean_current_direction)==null?void 0:_e.at(N),bearing:((H=T==null?void 0:T.ocean_current_direction)==null?void 0:H.at(N))??null},sst:(fe=T==null?void 0:T.sea_surface_temperature)==null?void 0:fe.at(N),height:(de=T==null?void 0:T.sea_level_height_msl)==null?void 0:de.at(N)},ze.wave=this.parseWave(ze.wave,ce==null?void 0:ce.wind),ze.current.direction=this.degree2Direction(ze.current.degree),Object.assign(ve[Le],ze),Le++}}}return ve}static toLegacy(t){var o,r,i,l,n,c,s,h,d,m;return{wind:(o=t==null?void 0:t.weather)==null?void 0:o.wind,visibility:(r=t==null?void 0:t.weather)==null?void 0:r.visibility,temp:(i=t==null?void 0:t.weather)==null?void 0:i.temp,prmsl:(l=t==null?void 0:t.weather)==null?void 0:l.pmsl,gusts:{kts:(c=(n=t==null?void 0:t.weather)==null?void 0:n.wind)==null?void 0:c.gusts},precip:(s=t==null?void 0:t.weather)==null?void 0:s.precip,code:(h=t==null?void 0:t.weather)==null?void 0:h.code,name:(d=t==null?void 0:t.weather)==null?void 0:d.name,url:(m=t==null?void 0:t.weather)==null?void 0:m.url,wave:t==null?void 0:t.wave,current:t==null?void 0:t.current,sst:t==null?void 0:t.sst,height:t==null?void 0:t.height,utc:t==null?void 0:t.utc,source:t==null?void 0:t.model}}static pickDaily(t,o){var r,i,l,n,c,s,h,d,m,g,u,f,z,k,S,v,x,b,w,_,y,L,B,I,D,R,W,U,F,$,te,ie,oe,j,C,ee,le,se,pe,ge,be,we,xe,Y;const ae=typeof o=="string"?P(o):o,me=t==null?void 0:t.weather,_e=t==null?void 0:t.marine,H=P((l=(i=(r=me==null?void 0:me[0])==null?void 0:r.daily)==null?void 0:i.time)==null?void 0:l.at(0)),fe=P((s=(c=(n=me==null?void 0:me[0])==null?void 0:n.daily)==null?void 0:c.time)==null?void 0:s.at(-1)),de=[];if(ae.isBetween(H,fe,"millisecond","[]")){let q,re;const E=ae.diff(H,"d",!1);if(me)for(const ue of me){const Z=ue.daily;q={code:(h=Z.weather_code)==null?void 0:h.at(E),temp:{max:(d=Z.temperature_2m_max)==null?void 0:d.at(E),min:(m=Z.temperature_2m_min)==null?void 0:m.at(E),mean:(g=Z.temperature_2m_mean)==null?void 0:g.at(E)},apparentTemp:{max:(u=Z.apparent_temperature_max)==null?void 0:u.at(E),min:(f=Z.apparent_temperature_min)==null?void 0:f.at(E)},precip:{sum:(z=Z.precipitation_sum)==null?void 0:z.at(E),rainSum:(k=Z.rain_sum)==null?void 0:k.at(E),snowfallSum:(S=Z.snowfall_sum)==null?void 0:S.at(E),showersSum:(v=Z.showers_sum)==null?void 0:v.at(E),hours:(x=Z.precipitation_hours)==null?void 0:x.at(E),probability:(b=Z.precipitation_probability_max)==null?void 0:b.at(E)},rh:{max:(w=Z.relative_humidity_2m_max)==null?void 0:w.at(E),min:(_=Z.relative_humidity_2m_min)==null?void 0:_.at(E),mean:(y=Z.relative_humidity_2m_mean)==null?void 0:y.at(E)},wind:{speed:(L=Z.wind_speed_10m_max)==null?void 0:L.at(E),kts:(B=Z.wind_speed_10m_max)==null?void 0:B.at(E),degree:(I=Z.wind_direction_10m_dominant)==null?void 0:I.at(E),gusts:(D=Z.wind_gusts_10m_max)==null?void 0:D.at(E),bearing:((R=Z.wind_direction_10m_dominant)==null?void 0:R.at(E))!==null?(((W=Z.wind_direction_10m_dominant)==null?void 0:W.at(E))+180)%360:null}};const{name:K,url:ve,bg:N}=this.parseWeatherCode(q.code,!0);q.name=K,q.url=ve,q.bg=N,q.wind.scale=this.beaufort(this.kts2ms(q.wind.kts)),q.wind.direction=this.degree2Direction(q.wind.degree),de.push({utc:H.add(E,"d").utc().format(),model:ue.model,weather:{...q}})}if(_e){let ue=0;for(const Z of _e){const K=Z.daily;re={wave:{sig:{height:(U=K.wave_height_max)==null?void 0:U.at(E),degree:(F=K.wave_direction_dominant)==null?void 0:F.at(E),period:($=K.wave_period_max)==null?void 0:$.at(E),bearing:((te=K.wave_direction_dominant)==null?void 0:te.at(E))!==null?(((ie=K.wave_direction_dominant)==null?void 0:ie.at(E))+180)%360:null},swell:{height:(oe=K.swell_wave_height_max)==null?void 0:oe.at(E),degree:(j=K.swell_wave_direction_dominant)==null?void 0:j.at(E),period:(C=K.swell_wave_period_max)==null?void 0:C.at(E),peakPeriod:(ee=K.swell_wave_peak_period_max)==null?void 0:ee.at(E),bearing:((le=K.swell_wave_direction_dominant)==null?void 0:le.at(E))!==null?((se=K.swell_wave_direction_dominant)==null?void 0:se.at(E))%360:null},wd:{height:(pe=K.wind_wave_height_max)==null?void 0:pe.at(E),degree:(ge=K.wind_wave_direction_dominant)==null?void 0:ge.at(E),period:(be=K.wind_wave_period_max)==null?void 0:be.at(E),peakPeriod:(we=K.wind_wave_peak_period_max)==null?void 0:we.at(E),bearing:((xe=K.wind_wave_direction_dominant)==null?void 0:xe.at(E))!==null?(((Y=K.wind_wave_direction_dominant)==null?void 0:Y.at(E))+180)%360:null}}},re.wave=this.parseWave(re.wave,q==null?void 0:q.wind),Object.assign(de[ue],re),ue++}}}return de}static parseWave(t,o){if(t.sig.direction=this.degree2Direction(t.sig.degree),t.swell.direction=this.degree2Direction(t.swell.degree),t.wd.direction=this.degree2Direction(t.wd.degree),t.sig.scale=this.douglas(t.sig.height),t.swell.scale=this.douglas(t.swell.height),t.wd.scale=this.douglas(t.wd.height),t.sig.height===0){const r=Math.sqrt(Math.pow(t.swell.height||0,2)+Math.pow(t.wd.height||0,2));t.sig.height=Math.round(r*100)/100}if(t.swell.height===0)if(t.sig.height>t.wd.height){const r=Math.sqrt(Math.abs(Math.pow(t.sig.height||0,2)-Math.pow(t.wd.height||0,2)));t.swell.height=Math.round(r*100)/100}else{const r=Math.round(.12*this.kts2ms((o==null?void 0:o.kts)||0)*100)/100,i=r>1?r/10:r>.5?r/5:r>.3?r/2:r;t.swell.height=Math.round(i*100)/100}if(t.wd.height===0||t.wd.height>t.sig.height)if(t.sig.height>t.swell.height){const r=Math.sqrt(Math.abs(Math.pow(t.sig.height||0,2)-Math.pow(t.swell.height||0,2))),i=.24*this.kts2ms((o==null?void 0:o.kts)||0);t.wd.height=Math.round(Math.min(r,i)*100)/100}else{const r=.24*this.kts2ms((o==null?void 0:o.kts)||0);t.wd.height=Math.round(r*100)/100}return t.swell.height>t.sig.height&&(t.swell.height=Math.round(t.sig.height*.76*100)/100),t.sig.period||(t.sig.period=Math.round(5*Math.sqrt(t.sig.height))),t.swell.period||(t.swell.period=Math.round(5*Math.sqrt(t.swell.height))),t.wd.period||(t.wd.period=Math.round(5*Math.sqrt(t.wd.height))),t}static parseWeatherCode(t,o){const r=this.weatherCode(t);return(o?r.day:r.night)||{}}static weatherCode(t){const o={code:t};switch(t){case 0:o.day={name:"Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"},o.night={name:"Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"};break;case 1:o.day={name:"Mainly Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"},o.night={name:"Mainly Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"};break;case 2:o.day={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg2.png"},o.night={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg2.png"};break;case 3:o.day={name:"Overcast",url:"https://osshz.idmwx.com/asset/weather/04d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg3.png"},o.night={name:"Overcast",url:"https://osshz.idmwx.com/asset/weather/04n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg3.png"};break;case 45:o.day={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"},o.night={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"};break;case 48:o.day={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"},o.night={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"};break;case 51:o.day={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},o.night={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 53:o.day={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},o.night={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 55:o.day={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/15d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},o.night={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/15n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 56:o.day={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},o.night={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 57:o.day={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},o.night={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 61:o.day={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},o.night={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 63:o.day={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},o.night={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 65:o.day={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},o.night={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 66:o.day={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},o.night={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 67:o.day={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},o.night={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 71:o.day={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},o.night={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 73:o.day={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},o.night={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 75:o.day={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},o.night={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 77:o.day={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},o.night={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 80:o.day={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},o.night={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 81:o.day={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},o.night={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 82:o.day={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},o.night={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 85:o.day={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},o.night={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 86:o.day={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},o.night={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 95:o.day={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},o.night={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 96:o.day={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},o.night={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 99:o.day={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},o.night={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break}return o}static kts2ms(t){return isNaN(t)||t===null?t:Math.round(t*1852/3600*1e4)/1e4}static kts2kmh(t){return isNaN(t)||t===null?t:t*1.852}static m2nm(t){return isNaN(t)||t===null?t:Math.round(t/1e3/1.852*1e4)/1e4}static kmh2kts(t){return isNaN(t)||t===null?t:this.ms2kts(t*1e3/3600)}static ms2kts(t){return isNaN(t)||t===null?t:Math.round(t*3600/1852*1e4)/1e4}static degree2Radian(t){if(isNaN(t)||t===null)return t;let o=t%360/360*2*Math.PI;return o=o<0?o+2*Math.PI:o,o}static degree2Direction(t){const o=this.degree2Radian(t);if(isNaN(o)||o===null)return null;let r="N/A";const i=Math.PI/16;return o<i?r="N":o>=i&&o<3*i?r="NNE":o>=3*i&&o<5*i?r="NE":o>=5*i&&o<7*i?r="ENE":o>=7*i&&o<9*i?r="E":o>=9*i&&o<11*i?r="ESE":o>=11*i&&o<13*i?r="SE":o>=13*i&&o<15*i?r="SSE":o>=15*i&&o<17*i?r="S":o>=17*i&&o<19*i?r="SSW":o>=19*i&&o<21*i?r="SW":o>=21*i&&o<23*i?r="WSW":o>=23*i&&o<25*i?r="W":o>=25*i&&o<27*i?r="WNW":o>=27*i&&o<29*i?r="NW":o>=29*i&&o<31*i?r="NNW":o>=31*i&&o<32*i&&(r="N"),r}static beaufort(t){let o=0;return isNaN(t)||(t=Math.round(t*10)/10,t<=.2?o=0:t<=1.5?o=1:t<=3.3?o=2:t<=5.4?o=3:t<=7.9?o=4:t<=10.7?o=5:t<=13.8?o=6:t<=17.1?o=7:t<=20.7?o=8:t<=22.4?o=9:t<=28.4?o=10:t<=32.6?o=11:t>32.6&&(o=12)),o}static douglas(t){let o="Calm";return isNaN(t)||t<=.1?o="Calm":t<=.5?o="Smooth":t<=1.25?o="Slight":t<=2.5?o="Moderate":t<=4?o="Rough":t<=6?o="VeryRough":t<=9?o="High":t<=14?o="VeryHigh":o="Precipitous",o}}const tn="",Pr={name:"IdmTropicals",props:{map:{type:Object},top:{type:Number,default:60},menuToggle:{type:Object,default:{}},timeZone:{type:Number,default:0},token:{type:String},defaultMeteoToken:{type:String},gateway:{type:String,default:"aa"},assistGateway:{type:Array,default:[]},forecastModel:{type:String},realTime:{type:String}},emits:["tropical","tropicalProbability"],data(){return{right:10,toggle:!1,helper:Pe.CompanyHelper,tropicals:void 0,tropicalCacheKey:"tropicalCacheGL4",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",showTropicalsInfo:!1,activeTropicals:void 0,activeTropicalsMarker:void 0,empty:M.featureCollection([]),circleSource:"circle-source",circleSourceData:M.featureCollection([]),circleLayer:"tropical-circle-layer"}},computed:{computeTime(){return function(a){if(a){const t=P(a).utcOffset(this.timeZone),o=this.timeZone<0?this.timeZone:"+"+this.timeZone;return`${t.format("MMM-DD/HHmm")} [ UTC${o} ] ( ${t==null?void 0:t.fromNow()} )`}return"-"}},computeTimezone(){return this.timeZone<0?this.timeZone:"+"+this.timeZone},computeBF(){return function(a){const t=Ve.kts2ms(a);return Ve.beaufort(t)}},computeMovement(){return function(a){var t,o;return(o=(t=a==null?void 0:a.forecasts)==null?void 0:t.find(r=>!r.disabled))==null?void 0:o.movement}}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10})},immediate:!0},map:{handler(){this.map&&(this.toggle=localStorage.getItem(this.tropicalCacheKey)==="true"||!1,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle&&this.fetchTropicals())}},showTropicalsInfo:{handler(){this.$emit("tropical",this.showTropicalsInfo)},immediate:!0},"tropicals.version":{handler(){this.handleRefresh()}},timeZone:{handler(){this.handleRefresh()}}},mounted(){},methods:{handleMenuToggle(){this.toggle=!this.toggle,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle?this.fetchTropicals():this.handleClear()},async fetchTropicals(){var i,l,n;const a=new Date().valueOf();let t=0,o=0,r=(i=Pe.LayerHelper.WEATHER_LAYERS.find(c=>c.key==="tropicals"))==null?void 0:i.weight;if(r>0){const c=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],s=await Q.get(`${c}/api/arc/weather/layers2/links?l=${r}&v=${this.forecastModel}&t=${this.realTime}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(o=new Date().valueOf()-(a+t),console.log("weather links elapsed: ",o,", total: ",t+=o),((l=s==null?void 0:s.data)==null?void 0:l.code)===0){const h=(n=s==null?void 0:s.data)==null?void 0:n.data;await Q.get(h.tropicals,{headers:{Authorization:this.token||this.defaultMeteoToken,key:"tropicals"},responseType:/\.(jpg|png)$/.test(h.tropicals)?"blob":"json"}).then(d=>{var u,f,z;const m=V.TropicalHelper.convert2Geojson(((u=d==null?void 0:d.data)==null?void 0:u.data)||(d==null?void 0:d.data));((z=(f=d==null?void 0:d.config)==null?void 0:f.headers)==null?void 0:z.key)&&m&&(this.tropicals={data:m,active:!0,cached:!0,type:"json",etime:s.data.etime,version:Math.random()+1},this.handleInit())}).catch(d=>{console.log(`[${key}] fetch layer error: ${d}`)})}o=new Date().valueOf()-(a+t),console.log("tropicals elapsed: ",o,", total: ",t+=o)}},handleRefresh(){var t,o;(((o=(t=this.tropicals)==null?void 0:t.data)==null?void 0:o.features)||[]).forEach(r=>{var i,l;((i=r.geometry)==null?void 0:i.type)==="Point"&&((l=r.properties)!=null&&l.important)&&(r.properties.format=P(r.properties.date).utcOffset(this.timeZone).format(`MMM-DD/HHmm [(utc${this.computeTimezone})]`))}),this.handleInit()},handleInit(){var a;this.tropicals&&(this.handleRender(),(a=this.map)==null||a.on("click",[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.forecastModelLayer,this.pointCircleLayer,this.pointLabelLayer,this.historyPointCircleLayer,this.historyPointLabelLayer],this.handleClick))},handleRender(){var a,t,o,r,i,l,n,c,s,h;if(!this.map)setTimeout(()=>{this.handleRender()},500);else{if(this.tropicals){const m=new Date().valueOf();let g=0,u=0;(a=this.map)!=null&&a.getSource(this.source)?((o=this.map)==null||o.getSource(this.source).setData((t=this.tropicals)!=null&&t.active?this.tropicals.data:this.empty),u=new Date().valueOf()-(m+g),console.log("[tropicals] update elapsed: ",u,", total: ",g+=u)):(this.map.addSource(this.source,{type:"geojson",data:(r=this.tropicals)!=null&&r.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":3,"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","#f2a0a0"],"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","#f2a0a0"],"text-halo-width":4}}),u=new Date().valueOf()-(m+g),console.log("[tropical] add elapsed: ",u,", total: ",g+=u)),(l=this.map)!=null&&l.getSource(this.clusterSource)?((c=this.map)==null||c.getSource(this.clusterSource).setData((n=this.tropicals)!=null&&n.active?this.tropicals.data:this.empty),u=new Date().valueOf()-(m+g),console.log("[tropical] update elapsed: ",u,", total: ",g+=u)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(s=this.tropicals)!=null&&s.active?(h=this.tropicals)==null?void 0:h.data:this.empty}),this.map.addLayer({id:this.pointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":6,"circle-color":"#fff"}}),this.map.addLayer({id:this.pointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":4,"circle-color":["case",["boolean",["==",["get","kts",["get","wind"]],null]],"#03f869",["boolean",["<",["get","kts",["get","wind"]],32]],"#03f869",["boolean",["<",["get","kts",["get","wind"]],47]],"#f2f202",["boolean",["<",["get","kts",["get","wind"]],63]],"#ff9100",["boolean",["<",["get","kts",["get","wind"]],79]],"#f44336",["boolean",["<",["get","kts",["get","wind"]],94]],"#f903d0",["boolean",[">=",["get","kts",["get","wind"]],94]],"#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"],["==","important",!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"],["==","important",!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"],["==","important",!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"],["==","important",!0],["!=","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.forecastNameLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["==","important",!0]],layout:{"text-field":["get","name"],"text-offset":[0,1.5],"text-anchor":"bottom","text-size":16,"text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#fff","text-halo-color":"#0033ff","text-halo-width":4}}),u=new Date().valueOf()-(m+g),console.log("[tropical] add elapsed: ",u,", total: ",g+=u))}this.handleDrawCircle();const d=V.TropicalHelper.interpolate(this.tropicals,1);this.interpolateData=JSON.parse(JSON.stringify(d)),this.handleDateChange()}},handleClear(){var a,t;this.map&&(this.map.getLayer(this.historyLayer)&&this.map.removeLayer(this.historyLayer),this.map.getLayer(this.forecastLayer)&&this.map.removeLayer(this.forecastLayer),this.map.getLayer(this.forecastModelLayer)&&this.map.removeLayer(this.forecastModelLayer),this.map.getLayer(this.forecastNameLayer)&&this.map.removeLayer(this.forecastNameLayer),this.map.getLayer(this.pointCircleLayer)&&this.map.removeLayer(this.pointCircleLayer),this.map.getLayer(this.pointCircleLayer+"-border")&&this.map.removeLayer(this.pointCircleLayer+"-border"),this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.historyPointCircleLayer)&&this.map.removeLayer(this.historyPointCircleLayer),this.map.getLayer(this.historyPointCircleLayer+"-border")&&this.map.removeLayer(this.historyPointCircleLayer+"-border"),this.map.getLayer(this.historyPointCircleLayer+"-inner")&&this.map.removeLayer(this.historyPointCircleLayer+"-inner"),this.map.getLayer(this.historyPointLabelLayer)&&this.map.removeLayer(this.historyPointLabelLayer),this.map.getLayer(this.interpolateLineLayer)&&this.map.removeLayer(this.interpolateLineLayer),(a=this.interpolateMarkers)==null||a.forEach(o=>o==null?void 0:o.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)),(t=this.map)==null||t.off("click",[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.forecastModelLayer,this.pointCircleLayer,this.pointLabelLayer,this.historyPointCircleLayer,this.historyPointLabelLayer],this.handleClick)},handleDateChange(){var a,t,o,r,i,l,n,c,s,h,d,m,g,u,f,z,k,S,v,x,b,w,_,y,L,B,I,D,R,W,U,F;if((a=this.interpolateMarkers)==null||a.forEach($=>$==null?void 0:$.remove()),this.circleSourceData.features=[],(t=this.interpolateData)!=null&&t.length&&this.tropicals.active){const $=P(this.realTime).utc().set({minute:0,second:0,millisecond:0}),te=this.interpolateData.filter(j=>j.properties.date===$.format()&&!j.properties.disabled),ie=this.handleComputePolygons(te),oe=M.featureCollection([...te]);ie.forEach(j=>{oe.features.push(j)}),(o=this.map)!=null&&o.getSource(this.interpolateSource)?(r=this.map)==null||r.getSource(this.interpolateSource).setData(oe):((i=this.map)==null||i.addSource(this.interpolateSource,{type:"geojson",data:oe}),(l=this.map)==null||l.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 j of te)if(!j.properties.disabled){let C="#f44336";((c=(n=j.properties)==null?void 0:n.wind)==null?void 0:c.kts)<32||!((h=(s=j.properties)==null?void 0:s.wind)!=null&&h.kts)?C="#03f869":((m=(d=j.properties)==null?void 0:d.wind)==null?void 0:m.kts)>=32&&((u=(g=j.properties)==null?void 0:g.wind)==null?void 0:u.kts)<47?C="#f2f202":((z=(f=j.properties)==null?void 0:f.wind)==null?void 0:z.kts)>=47&&((S=(k=j.properties)==null?void 0:k.wind)==null?void 0:S.kts)<63?C="#ff9100":((x=(v=j.properties)==null?void 0:v.wind)==null?void 0:x.kts)>=63&&((w=(b=j.properties)==null?void 0:b.wind)==null?void 0:w.kts)<79?C="#f44336":((y=(_=j.properties)==null?void 0:_.wind)==null?void 0:y.kts)>=79&&((B=(L=j.properties)==null?void 0:L.wind)==null?void 0:B.kts)<94?C="#f903d0":((D=(I=j.properties)==null?void 0:I.wind)==null?void 0:D.kts)>=94?C="#8702f9":C="#f44336";const ee=`<svg t="1719918955501"
192
192
  class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" p-id="18382"
193
193
  xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@idmwx/idmui-gl4",
3
3
  "private": false,
4
- "version": "0.5.6",
4
+ "version": "0.5.7",
5
5
  "description": "idm webgl4",
6
6
  "type": "module",
7
7
  "keywords": [