@idmwx/idmui-gl4 3.3.5 → 3.3.6
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/{chunk-3VYIPD3A-4bf949ee.js → chunk-3VYIPD3A-97fed3d8.js} +1 -1
- package/dist/{chunk-ANSXOGKI-37f6cba6.js → chunk-ANSXOGKI-f2be5749.js} +1 -1
- package/dist/{chunk-T4JIPPZO-8e764c74.js → chunk-T4JIPPZO-26d6b1f2.js} +1 -1
- package/dist/{download-c4ac7d36.js → download-9a17d1f7.js} +3 -3
- package/dist/{index-fe881d6e.js → index-2978f7e0.js} +17 -17
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/{rasterize-JS5G2XHH-943660c1.js → rasterize-JS5G2XHH-c53ad806.js} +3 -3
- package/dist/{toBlob-522627e3.js → toBlob-e498a5e6.js} +3 -3
- package/dist/{toCanvas-f7ca36a4.js → toCanvas-798daeeb.js} +2 -2
- package/dist/{toImg-e53cada7.js → toImg-10f2a12f.js} +3 -3
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as a } from "./chunk-3VYIPD3A-
|
|
1
|
+
import { W as a } from "./chunk-3VYIPD3A-97fed3d8.js";
|
|
2
2
|
async function o(r, t) {
|
|
3
3
|
let i = await a(r, t), e = new Image();
|
|
4
4
|
return e.src = i.toDataURL(`image/${t.format}`, t.quality), await e.decode(), e.style.width = `${i.width / t.dpr}px`, e.style.height = `${i.height / t.dpr}px`, e;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { m as d } from "./chunk-T4JIPPZO-
|
|
2
|
-
import { W as f } from "./chunk-3VYIPD3A-
|
|
3
|
-
import "./index-
|
|
1
|
+
import { m as d } from "./chunk-T4JIPPZO-26d6b1f2.js";
|
|
2
|
+
import { W as f } from "./chunk-3VYIPD3A-97fed3d8.js";
|
|
3
|
+
import "./index-2978f7e0.js";
|
|
4
4
|
import "axios";
|
|
5
5
|
import "vuetify";
|
|
6
6
|
import "vue";
|
|
@@ -9771,7 +9771,7 @@ const Kd = {
|
|
|
9771
9771
|
},
|
|
9772
9772
|
handleResetMinMax() {
|
|
9773
9773
|
var a, r, l, c, s;
|
|
9774
|
-
if (
|
|
9774
|
+
if (this.dayAbout.h == null || this.dayAbout.f == null)
|
|
9775
9775
|
return;
|
|
9776
9776
|
const t = T().utc().date(), e = Math.ceil(T().utc().hour() / this.intervalHour) * this.intervalHour, o = ((a = T()) == null ? void 0 : a.utc().set({ date: t, hour: e, minute: 0, second: 0, millisecond: 0 }).unix()) * 1e3, i = T.tz(o, this.timeZoneName).clone();
|
|
9777
9777
|
this.minDate = i.clone().add(this.dayAbout.h, "day").format("yyyy-MM-DD"), this.maxDate = i.clone().add(this.dayAbout.f, "day").format("yyyy-MM-DD"), this.minTimestamp = ((l = (r = T()) == null ? void 0 : r.utc()) == null ? void 0 : l.set({ date: t + this.dayAbout.h, hour: 0, minute: 0, second: 0, millisecond: 0 }).unix()) * 1e3, this.maxTimestamp = ((s = (c = T()) == null ? void 0 : c.utc()) == null ? void 0 : s.set({ date: t + this.dayAbout.f, hour: 0, minute: 0, second: 0, millisecond: 0 }).unix()) * 1e3, this.$emit("minTimestamp", this.minTimestamp), this.$emit("maxTimestamp", this.maxTimestamp);
|
|
@@ -17057,52 +17057,52 @@ Pe.capture = async (t, e, o) => {
|
|
|
17057
17057
|
if (o !== rr)
|
|
17058
17058
|
throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");
|
|
17059
17059
|
let i = await ir(t, e), a = { img: async (g, h) => {
|
|
17060
|
-
let { toImg: f } = await import("./toImg-
|
|
17060
|
+
let { toImg: f } = await import("./toImg-10f2a12f.js");
|
|
17061
17061
|
return f(i, { ...g, ...h || {} });
|
|
17062
17062
|
}, svg: async (g, h) => {
|
|
17063
|
-
let { toSvg: f } = await import("./toImg-
|
|
17063
|
+
let { toSvg: f } = await import("./toImg-10f2a12f.js");
|
|
17064
17064
|
return f(i, { ...g, ...h || {} });
|
|
17065
17065
|
}, canvas: async (g, h) => {
|
|
17066
|
-
let { toCanvas: f } = await import("./toCanvas-
|
|
17066
|
+
let { toCanvas: f } = await import("./toCanvas-798daeeb.js");
|
|
17067
17067
|
return f(i, { ...g, ...h || {} });
|
|
17068
17068
|
}, blob: async (g, h) => {
|
|
17069
|
-
let { toBlob: f } = await import("./toBlob-
|
|
17069
|
+
let { toBlob: f } = await import("./toBlob-e498a5e6.js");
|
|
17070
17070
|
return f(i, { ...g, ...h || {} });
|
|
17071
17071
|
}, png: async (g, h) => {
|
|
17072
|
-
let { rasterize: f } = await import("./rasterize-JS5G2XHH-
|
|
17072
|
+
let { rasterize: f } = await import("./rasterize-JS5G2XHH-c53ad806.js");
|
|
17073
17073
|
return f(i, { ...g, ...h || {}, format: "png" });
|
|
17074
17074
|
}, jpeg: async (g, h) => {
|
|
17075
|
-
let { rasterize: f } = await import("./rasterize-JS5G2XHH-
|
|
17075
|
+
let { rasterize: f } = await import("./rasterize-JS5G2XHH-c53ad806.js");
|
|
17076
17076
|
return f(i, { ...g, ...h || {}, format: "jpeg" });
|
|
17077
17077
|
}, webp: async (g, h) => {
|
|
17078
|
-
let { rasterize: f } = await import("./rasterize-JS5G2XHH-
|
|
17078
|
+
let { rasterize: f } = await import("./rasterize-JS5G2XHH-c53ad806.js");
|
|
17079
17079
|
return f(i, { ...g, ...h || {}, format: "webp" });
|
|
17080
17080
|
}, download: async (g, h) => {
|
|
17081
|
-
let { download: f } = await import("./download-
|
|
17081
|
+
let { download: f } = await import("./download-9a17d1f7.js");
|
|
17082
17082
|
return f(i, { ...g, ...h || {} });
|
|
17083
17083
|
} }, r = { ...e, export: { url: i }, exports: { svg: async (g) => {
|
|
17084
|
-
let { toSvg: h } = await import("./toImg-
|
|
17084
|
+
let { toSvg: h } = await import("./toImg-10f2a12f.js");
|
|
17085
17085
|
return h(i, { ...e, ...g || {}, [qe]: !0 });
|
|
17086
17086
|
}, canvas: async (g) => {
|
|
17087
|
-
let { toCanvas: h } = await import("./toCanvas-
|
|
17087
|
+
let { toCanvas: h } = await import("./toCanvas-798daeeb.js");
|
|
17088
17088
|
return h(i, { ...e, ...g || {}, [qe]: !0 });
|
|
17089
17089
|
}, png: async (g) => {
|
|
17090
|
-
let { rasterize: h } = await import("./rasterize-JS5G2XHH-
|
|
17090
|
+
let { rasterize: h } = await import("./rasterize-JS5G2XHH-c53ad806.js");
|
|
17091
17091
|
return h(i, { ...e, ...g || {}, format: "png", [qe]: !0 });
|
|
17092
17092
|
}, jpeg: async (g) => {
|
|
17093
|
-
let { rasterize: h } = await import("./rasterize-JS5G2XHH-
|
|
17093
|
+
let { rasterize: h } = await import("./rasterize-JS5G2XHH-c53ad806.js");
|
|
17094
17094
|
return h(i, { ...e, ...g || {}, format: "jpeg", [qe]: !0 });
|
|
17095
17095
|
}, jpg: async (g) => {
|
|
17096
|
-
let { rasterize: h } = await import("./rasterize-JS5G2XHH-
|
|
17096
|
+
let { rasterize: h } = await import("./rasterize-JS5G2XHH-c53ad806.js");
|
|
17097
17097
|
return h(i, { ...e, ...g || {}, format: "jpeg", [qe]: !0 });
|
|
17098
17098
|
}, webp: async (g) => {
|
|
17099
|
-
let { rasterize: h } = await import("./rasterize-JS5G2XHH-
|
|
17099
|
+
let { rasterize: h } = await import("./rasterize-JS5G2XHH-c53ad806.js");
|
|
17100
17100
|
return h(i, { ...e, ...g || {}, format: "webp", [qe]: !0 });
|
|
17101
17101
|
}, blob: async (g) => {
|
|
17102
|
-
let { toBlob: h } = await import("./toBlob-
|
|
17102
|
+
let { toBlob: h } = await import("./toBlob-e498a5e6.js");
|
|
17103
17103
|
return h(i, { ...e, ...g || {}, [qe]: !0 });
|
|
17104
17104
|
}, img: async (g) => {
|
|
17105
|
-
let { toImg: h } = await import("./toImg-
|
|
17105
|
+
let { toImg: h } = await import("./toImg-10f2a12f.js");
|
|
17106
17106
|
return h(i, { ...e, ...g || {}, [qe]: !0 });
|
|
17107
17107
|
} } }, l = await Lg("defineExports", r), c = Object.assign({}, ...l.filter((g) => g && typeof g == "object")), s = { ...a, ...c };
|
|
17108
17108
|
s.jpeg && !s.jpg && (s.jpg = (g, h) => s.jpeg(g, h));
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as n, D as x, L as D, a as T, b as S, M as W, g as f, f as h, P as k, d as y, T as V, V as d, W as u, e as w } from "./index-
|
|
1
|
+
import { c as n, D as x, L as D, a as T, b as S, M as W, g as f, f as h, P as k, d as y, T as V, V as d, W as u, e as w } from "./index-2978f7e0.js";
|
|
2
2
|
import "axios";
|
|
3
3
|
import "vuetify";
|
|
4
4
|
import "vue";
|
package/dist/index.umd.cjs
CHANGED
|
@@ -214,7 +214,7 @@
|
|
|
214
214
|
<path
|
|
215
215
|
d="M420.66666667 959.17a16.08 16.08 0 0 1-15.91-13.49A15.89 15.89 0 0 1 415.50666667 928c1.49-0.55 38.88-14.76 72.79-65.52A354.55 354.55 0 0 1 162.66666667 509.17a450.14 450.14 0 0 1 450.5-450.5 16.07 16.07 0 0 1 15.91 13.48 15.88 15.88 0 0 1-10.75 17.66c-1.58 0.58-39.13 14.9-73.07 65.95A354.22 354.22 0 0 1 871.66666667 509.17a16 16 0 0 1-0.52 4.05A450.14 450.14 0 0 1 420.66666667 959.17zM554.80666667 94.72C351.57666667 123.2 194.66666667 298.21 194.66666667 509.17c0 177.08 144.06 321.74 321.13 322.48a16 16 0 0 1 14.07 23.49c-16.11 30.42-34.27 52.37-50.85 68C682.25666667 894.63 839.16666667 719.63 839.16666667 508.67a15.94 15.94 0 0 1 0.47-3.86C837.30666667 329.33 693.82666667 187 517.80666667 186.67A16 16 0 0 1 503.66666667 163.21c16.21-30.69 34.47-52.79 51.14-68.49z"
|
|
216
216
|
fill="#ffffff" p-id="18386"></path>
|
|
217
|
-
</svg>`,he=document.createElement("div");he.className="idm-tropical-gl4-hourly-marker",he.innerHTML=`<div class="${S.geometry.coordinates[1]>=0?"center north":"center south"}">${re}</div>`;const ge=new ne.Marker(he).setLngLat(S.geometry.coordinates).addTo(this.map);this.interpolateMarkers.push(ge)}this.$emit("tropicalCenterPoints",X)}else(M=this.map)!=null&&M.getSource(this.interpolateSource)&&((F=this.map)==null||F.getSource(this.interpolateSource).setData(this.empty))},handleClick(t){var i,l,n,c,s,d,m,p,g,y,u;const e=t.features[0],a=(l=(i=this.tropicals)==null?void 0:i.data)==null?void 0:l.features.filter(h=>{var f;return h.geometry.type==="LineString"&&h.properties.type==="forecast"&&h.properties.name===((f=e==null?void 0:e.properties)==null?void 0:f.name)}),r=(c=(n=this.tropicals)==null?void 0:n.data)==null?void 0:c.features.filter(h=>{var f;return h.geometry.type==="LineString"&&h.properties.type==="history"&&h.properties.name===((f=e==null?void 0:e.properties)==null?void 0:f.name)});this.activeTropicals={name:((s=e==null?void 0:e.properties)==null?void 0:s.name)||"-",nameCn:((d=e==null?void 0:e.properties)==null?void 0:d.nameCn)||((m=e==null?void 0:e.properties)==null?void 0:m.name)||"-",Name:((p=e==null?void 0:e.properties)==null?void 0:p.Name)||"-",forecasts:a.map(h=>h.properties),history:(g=r[0])==null?void 0:g.properties,showCircle:(u=(y=a[0])==null?void 0:y.properties)==null?void 0:u.showCircle},this.showTropicalsInfo=!0,this.simple||this.drawTropicalsInfoMaker([t.lngLat.lng,t.lngLat.lat])},drawTropicalsInfoMaker(t){this.$nextTick(()=>{const e=document.getElementById("idm-tropical-gl4-info");this.activeTropicalsMarker?this.activeTropicalsMarker.setLngLat(t).setOffset([220,0]):this.activeTropicalsMarker=new ne.Marker(e).setLngLat(t).setOffset([220,0]).addTo(this.map)})},handleCloseInfoMarker(){this.showTropicalsInfo=!1,this.$nextTick(()=>{var t;(t=this.activeTropicalsMarker)==null||t.remove(),this.activeTropicalsMarker=void 0})},handleForecastToggle(t){var r,i,l,n,c,s;t.disabled=!t.disabled;const e=`${t.name}-${t.model}`,a=(i=(r=this.map)==null?void 0:r.getSource(this.source)._data)==null?void 0:i.features;a.forEach(d=>{d.properties.category===e&&(d.properties.disabled=t.disabled)}),this.interpolateData.forEach(d=>{d.properties.category===e&&(d.properties.disabled=t.disabled)}),(n=(l=this.map)==null?void 0:l.getSource(this.source))==null||n.setData(E.featureCollection(a)),(s=(c=this.map)==null?void 0:c.getSource(this.clusterSource))==null||s.setData(E.featureCollection(a)),this.handleDateChange()},handleStrikeProbability(t){this.$emit("tropicalProbability",t)},handleToggleCircles(t){var e,a;t.showCircle=!t.showCircle,(a=(e=this.tropicals.data)==null?void 0:e.features)==null||a.forEach(r=>{r.properties.name===t.name&&(r.properties.showCircle=t.showCircle)}),this.handleRender()},handleComputePolygons(t){const e=[];for(const a of t){const r=a.properties.wind,i={ne:r.r7ne>=0?r.r7ne:void 0,se:r.r7se>=0?r.r7se:void 0,sw:r.r7sw>=0?r.r7sw:void 0,nw:r.r7nw>=0?r.r7nw:void 0},l=this.handleComputeArc(a.geometry.coordinates,i,{...a.properties,level:7});e.push(l);const n={ne:r.r10ne>=0?r.r10ne:void 0,se:r.r10se>=0?r.r10se:void 0,sw:r.r10sw>=0?r.r10sw:void 0,nw:r.r10nw>=0?r.r10nw:void 0},c=this.handleComputeArc(a.geometry.coordinates,n,{...a.properties,level:10});e.push(c)}return e},handleComputeArc(t,e,a){var l;const r=[];for(const n in e){const c=e[n]??0;let s;switch(n){case"ne":s=E.lineArc(t,c,0,90,{steps:c>0?32:1,units:"nauticalmiles"});break;case"se":s=E.lineArc(t,c,90,180,{steps:c>0?32:1,units:"nauticalmiles"});break;case"sw":s=E.lineArc(t,c,180,270,{steps:c>0?32:1,units:"nauticalmiles"});break;case"nw":s=E.lineArc(t,c,270,360,{steps:c>0?32:1,units:"nauticalmiles"});break}r.push(...(l=s==null?void 0:s.geometry)==null?void 0:l.coordinates)}const i=E.lineString(r);return E.lineToPolygon(i,{properties:a})},handleNotification(t){this.$emit("tropicalNotification",t)},handleHover(t){var i,l,n,c,s;this.map.getCanvas().style.cursor="pointer";const a=this.map.queryRenderedFeatures(t.point,{layers:[this.pointCircleLayer,this.pointCircleLayer+"-border",this.historyPointCircleLayer,this.historyPointCircleLayer+"-border",this.historyPointCircleLayer+"-inner"]})[0];this.hoverPoint=a==null?void 0:a.properties;const r=(l=(i=this.tropicals)==null?void 0:i.data)==null?void 0:l.features.filter(d=>{var m;return d.geometry.type==="LineString"&&d.properties.type==="forecast"&&d.properties.name===((m=a==null?void 0:a.properties)==null?void 0:m.name)});this.hoverPoint&&(this.hoverPoint.lng=a.geometry.coordinates[0],this.hoverPoint.lat=a.geometry.coordinates[1],this.hoverPoint.update=(c=(n=r==null?void 0:r[0])==null?void 0:n.properties)==null?void 0:c.date,(s=this.hoverMarker)==null||s.remove(),this.showHoverPoint=!0,this.$nextTick(()=>{const d=document.getElementById("tropicalHoverMarkerInfo").cloneNode(!0);this.hoverMarker=new ne.Marker(d).setLngLat(a.geometry.coordinates).setOffset([160,0]).addTo(this.map)}))},handleLeave(){var t;this.map.getCanvas().style.cursor="grab",this.showHoverPoint=!1,(t=this.hoverMarker)==null||t.remove(),this.hoverMarker=void 0}}},sm={class:"idm-tropical-gl4"},cm={class:"pb-1"},mm={class:"text-h5 font-weight-600"},dm={key:0,class:"text-h5 font-weight-600"},hm={class:"text-body-1"},pm={class:"text-label"},gm={class:"d-flex justify-space-between align-center"},um={class:"w-60"},fm={class:"text-label pr-1"},ym={class:"flex-1-1-0"},bm={class:"text-label pr-1"},wm={class:"py-2 d-flex justify-space-between align-center"},xm={class:"w-60"},km={class:"text-label pr-1"},Am={class:"flex-1-1-0"},Lm={class:"text-label pr-1"},Cm={class:"d-flex align-center flex-1-1-100 justify-space-between mt-n1"},zm={class:"text-label pr-1",style:{width:"70px"}},vm={class:"model-box d-flex justify-end align-center flex-wrap ga-1 pa-1"},_m={class:"more"},Sm={key:0,class:"w-100 d-flex justify-space-between align-center px-2"},Mm={class:"pa-1"},Nm={class:"legend d-flex justify-start align-center py-2"},Pm={class:"label"},Vm={class:"legend d-flex justify-start align-center py-2"},Tm={class:"label"},Em={class:"legend d-flex justify-start align-center py-2"},Rm={class:"label"},Dm={class:"pa-1"},Bm={class:"legend d-flex justify-start align-center py-2"},Im={class:"label"},Fm={class:"legend d-flex justify-start align-center py-2"},Gm={class:"label"},jm={class:"legend d-flex justify-start align-center py-2"},Wm={class:"label"},Zm={class:"pa-1"},Xm={class:"w-100 legend d-flex justify-start align-center py-2 ga-2"},Hm={class:"label"},Om={class:"label"},Ym={class:"w-100 legend d-flex justify-start align-center py-2"},Um={class:"label"},Jm={class:"w-100 legend d-flex justify-start align-center py-2"},Km={class:"label"},Qm={key:1,class:"my-3 w-100",style:{height:"80px"}},qm={class:"legend d-flex justify-start align-center"},$m={class:"label"},ed={class:"legend d-flex justify-start align-center"},td={class:"label"},od={class:"legend d-flex justify-start align-center"},ad={class:"label"},id={class:"legend d-flex justify-start align-center"},rd={class:"label"},ld={class:"legend d-flex justify-start align-center"},nd={class:"label"},sd={class:"legend d-flex justify-start align-center"},cd={class:"label"},md={class:"legend d-flex justify-start align-center"},dd={class:"label"},hd={class:"legend d-flex justify-start align-center"},pd={class:"label"},gd={class:"legend d-flex justify-start align-center"},ud={class:"label"},fd={class:"legend d-flex justify-start align-center"},yd={class:"label"},bd={class:"d-flex justify-star align-center"},wd={class:"font-weight-600 mr-1"},xd={class:""},kd={class:"port-box d-flex flex-column justify-center align-start ga-2"},Ad={key:0,class:"d-flex justify-start align-center"},Ld={class:"text-label pr-1"},Cd={key:1,class:"d-flex justify-start align-center"},zd={class:"text-label pr-1"},vd={key:2,class:"d-flex justify-start align-center"},_d={class:"text-label pr-1"},Sd={key:3,class:"d-flex justify-start align-center"},Md={class:"text-label pr-1"},Nd={key:4,class:"d-flex justify-start align-center"},Pd={class:"text-label pr-1"},Vd={key:5,class:"d-flex justify-start align-center"},Td={class:"text-label pr-1"},Ed={class:"d-flex justify-start align-center"},Rd={class:"text-label pr-1"},Dd={key:6,class:"d-flex justify-start align-center"},Bd={class:"text-label pr-1"},Id={key:7,class:"d-flex justify-start align-center"},Fd={class:"text-label pr-1"},Gd={class:"d-flex justify-start align-center"},jd={class:"text-label pr-1"};function Wd(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip"),s=o.resolveComponent("VCardText"),d=o.resolveComponent("VDivider"),m=o.resolveComponent("VCardActions"),p=o.resolveComponent("VCard"),g=o.resolveComponent("VCardTitle");return o.openBlock(),o.createElementBlock("div",sm,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+86+"px",right:i.right+"px"})},[o.createVNode(c,{text:t.$t("tropical.tropicals"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:y})=>[o.createVNode(n,o.mergeProps(y,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>e[2]||(e[2]=[o.createElementVNode("i",{class:"iconfont icon-Tropical text-h4"},null,-1)])),_:2,__:[2]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4),i.showTropicalsInfo&&!t.$attrs.hideTropicalsLegend?(o.openBlock(),o.createElementBlock("div",{key:0,id:"idm-tropical-gl4-info",ref:"tropicalsInfo",class:o.normalizeClass(["idm-tropical-gl4-info",a.simple?"page":"dialog"])},[o.createVNode(p,{class:o.normalizeClass(["w-100",a.simple?"rounded-t-4 bg-none":""]),elevation:a.simple?0:16},{default:o.withCtx(()=>[o.createVNode(s,null,{default:o.withCtx(()=>{var y,u,h,f,w,b,A,x,C,k,_,z;return[o.createElementVNode("div",cm,[o.createElementVNode("span",mm,o.toDisplayString(a.locale==="en"?(y=i.activeTropicals)==null?void 0:y.Name:((u=i.activeTropicals)==null?void 0:u.nameCn)||((h=i.activeTropicals)==null?void 0:h.Name)||"-"),1),(w=(f=i.activeTropicals)==null?void 0:f.history)!=null&&w.levelI18n?(o.openBlock(),o.createElementBlock("span",dm," , "+o.toDisplayString(t.$t("tropical."+((A=(b=i.activeTropicals)==null?void 0:b.history)==null?void 0:A.levelI18n))),1)):o.createCommentVNode("",!0)]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"close",onClick:o.withModifiers(l.handleCloseInfoMarker,["stop"])},{default:o.withCtx(()=>e[3]||(e[3]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[3]},8,["onClick"]),o.createElementVNode("div",hm,[o.createElementVNode("span",pm,o.toDisplayString(t.$t("actions.lastUpdate"))+": ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTime(((C=(x=i.activeTropicals)==null?void 0:x.history)==null?void 0:C.updated)||((z=(_=(k=i.activeTropicals)==null?void 0:k.forecasts)==null?void 0:_.filter(P=>!P.disabled)[0])==null?void 0:z.date),a.timeZone)),1)])]}),_:1}),o.createVNode(d),o.createVNode(s,{class:"text-body-1 py-3"},{default:o.withCtx(()=>{var y,u,h,f,w,b,A,x,C;return[o.createElementVNode("div",gm,[o.createElementVNode("div",um,[o.createElementVNode("label",fm,o.toDisplayString(t.$t("weather.windSpeed"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((u=(y=i.activeTropicals)==null?void 0:y.history)==null?void 0:u.kts)||"-")+" kts",1),o.createElementVNode("span",null,", BF "+o.toDisplayString(l.computeBF(((f=(h=i.activeTropicals)==null?void 0:h.history)==null?void 0:f.kts)||"-")),1)]),o.createElementVNode("div",ym,[o.createElementVNode("label",bm,o.toDisplayString(t.$t("weather.pressure"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((b=(w=i.activeTropicals)==null?void 0:w.history)==null?void 0:b.pressure)||"-")+" hPa",1)])]),o.createElementVNode("div",wm,[o.createElementVNode("div",xm,[o.createElementVNode("label",km,o.toDisplayString(t.$t("tropical.moveSpeed"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((A=l.computeMovement(i.activeTropicals))==null?void 0:A.kts)||"-")+" kts",1)]),o.createElementVNode("div",Am,[o.createElementVNode("label",Lm,o.toDisplayString(t.$t("tropical.moveDir"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((x=l.computeMovement(i.activeTropicals))==null?void 0:x.deg)||"-")+"°",1)])]),o.createElementVNode("div",Cm,[o.createElementVNode("label",zm,o.toDisplayString(t.$t("tropical.models"))+" : ",1),o.createElementVNode("div",vm,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList((C=i.activeTropicals)==null?void 0:C.forecasts,(k,_)=>(o.openBlock(),o.createBlock(n,{key:_,density:"compact",variant:k.disabled?"text":"flat",color:k.disabled?"":"primary","min-width":30,class:o.normalizeClass(["model text-none text-body-1 px-1",k.disabled?"btn-border-1 btn-bg-1":""]),onClick:o.withModifiers(z=>l.handleForecastToggle(k),["stop"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(k.model),1)]),_:2},1032,["variant","color","class","onClick"]))),128))])])]}),_:1}),o.createVNode(d),a.simple?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(m,{key:0,class:"d-flex justify-space-between"},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact","prepend-icon":"",variant:"text",color:i.showLegend?"primary":"",class:"text-none text-body-1",onClick:e[0]||(e[0]=o.withModifiers(y=>i.showLegend=!i.showLegend,["stop"]))},{prepend:o.withCtx(()=>e[4]||(e[4]=[o.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),default:o.withCtx(()=>[o.createTextVNode(" "+o.toDisplayString(t.$t("weather.legend")),1)]),_:1},8,["color"]),o.createElementVNode("div",_m,[o.createVNode(n,{variant:"text",density:"compact","append-icon":"mdi-chevron-right",class:"text-none text-body-1",onClick:e[1]||(e[1]=o.withModifiers(y=>l.handleStrikeProbability(i.activeTropicals),["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.viewReport")),1)]),_:1})])]),_:1}))]),_:1},8,["class","elevation"]),a.simple?(o.openBlock(),o.createElementBlock("div",Sm,[o.createElementVNode("div",Mm,[o.createElementVNode("div",Nm,[e[5]||(e[5]=o.createElementVNode("div",{class:"icon td"},null,-1)),o.createElementVNode("div",Pm,o.toDisplayString(t.$t("tropical.td")),1)]),o.createElementVNode("div",Vm,[e[6]||(e[6]=o.createElementVNode("div",{class:"icon sts"},null,-1)),o.createElementVNode("div",Tm,o.toDisplayString(t.$t("tropical.sts")),1)]),o.createElementVNode("div",Em,[e[7]||(e[7]=o.createElementVNode("div",{class:"icon sty"},null,-1)),o.createElementVNode("div",Rm,o.toDisplayString(t.$t("tropical.sty")),1)])]),o.createElementVNode("div",Dm,[o.createElementVNode("div",Bm,[e[8]||(e[8]=o.createElementVNode("div",{class:"icon ts"},null,-1)),o.createElementVNode("div",Im,o.toDisplayString(t.$t("tropical.ts")),1)]),o.createElementVNode("div",Fm,[e[9]||(e[9]=o.createElementVNode("div",{class:"icon ty"},null,-1)),o.createElementVNode("div",Gm,o.toDisplayString(t.$t("tropical.ty")),1)]),o.createElementVNode("div",jm,[e[10]||(e[10]=o.createElementVNode("div",{class:"icon supper-ty"},null,-1)),o.createElementVNode("div",Wm,o.toDisplayString(t.$t("tropical.superTy")),1)])]),o.createElementVNode("div",Zm,[o.createElementVNode("div",Xm,[e[11]||(e[11]=o.createElementVNode("div",{class:"icon history"},null,-1)),o.createElementVNode("div",Hm,o.toDisplayString(t.$t("tropical.history")),1),e[12]||(e[12]=o.createElementVNode("div",{class:"icon forecast"},null,-1)),o.createElementVNode("div",Om,o.toDisplayString(t.$t("tropical.forecast")),1)]),o.createElementVNode("div",Ym,[e[13]||(e[13]=o.createElementVNode("div",{class:"icon r7"},null,-1)),o.createElementVNode("div",Um,"35kts "+o.toDisplayString(t.$t("tropical.radii")),1)]),o.createElementVNode("div",Jm,[e[14]||(e[14]=o.createElementVNode("div",{class:"icon r10"},null,-1)),o.createElementVNode("div",Km,"50kts "+o.toDisplayString(t.$t("tropical.radii")),1)])])])):(o.openBlock(),o.createElementBlock("div",Qm,[o.withDirectives(o.createVNode(p,{elevation:"16"},{default:o.withCtx(()=>[o.createVNode(s,null,{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(["pa-1 d-flex justify-space-between align-center flex-wrap",a.locale==="zhHans"?" ga-2":" ga-3"])},[o.createElementVNode("div",qm,[e[15]||(e[15]=o.createElementVNode("div",{class:"icon td"},null,-1)),o.createElementVNode("div",$m,o.toDisplayString(t.$t("tropical.td")),1)]),o.createElementVNode("div",ed,[e[16]||(e[16]=o.createElementVNode("div",{class:"icon ts"},null,-1)),o.createElementVNode("div",td,o.toDisplayString(t.$t("tropical.ts")),1)]),o.createElementVNode("div",od,[e[17]||(e[17]=o.createElementVNode("div",{class:"icon sts"},null,-1)),o.createElementVNode("div",ad,o.toDisplayString(t.$t("tropical.sts")),1)]),o.createElementVNode("div",id,[e[18]||(e[18]=o.createElementVNode("div",{class:"icon ty"},null,-1)),o.createElementVNode("div",rd,o.toDisplayString(t.$t("tropical.ty")),1)]),o.createElementVNode("div",ld,[e[19]||(e[19]=o.createElementVNode("div",{class:"icon sty"},null,-1)),o.createElementVNode("div",nd,o.toDisplayString(t.$t("tropical.sty")),1)]),o.createElementVNode("div",sd,[e[20]||(e[20]=o.createElementVNode("div",{class:"icon supper-ty"},null,-1)),o.createElementVNode("div",cd,o.toDisplayString(t.$t("tropical.superTy")),1)]),o.createElementVNode("div",md,[e[21]||(e[21]=o.createElementVNode("div",{class:"icon history"},null,-1)),o.createElementVNode("div",dd,o.toDisplayString(t.$t("tropical.history")),1)]),o.createElementVNode("div",hd,[e[22]||(e[22]=o.createElementVNode("div",{class:"icon forecast"},null,-1)),o.createElementVNode("div",pd,o.toDisplayString(t.$t("tropical.forecast")),1)]),o.createElementVNode("div",gd,[e[23]||(e[23]=o.createElementVNode("div",{class:"icon r7"},null,-1)),o.createElementVNode("div",ud,"35kts "+o.toDisplayString(t.$t("tropical.radii")),1)]),o.createElementVNode("div",fd,[e[24]||(e[24]=o.createElementVNode("div",{class:"icon r10"},null,-1)),o.createElementVNode("div",yd,"50kts "+o.toDisplayString(t.$t("tropical.radii")),1)])],2),[[o.vShow,i.showLegend]])]),_:1})]),_:1},512),[[o.vShow,i.showLegend]])]))],2)):o.createCommentVNode("",!0),o.withDirectives(o.createVNode(p,{id:"tropicalHoverMarkerInfo",elevation:"16","max-width":"280"},{default:o.withCtx(()=>[o.createVNode(g,null,{default:o.withCtx(()=>{var y,u,h,f;return[o.createElementVNode("div",bd,[o.createElementVNode("span",wd,o.toDisplayString(a.locale==="en"?(y=i.hoverPoint)==null?void 0:y.Name:((u=i.hoverPoint)==null?void 0:u.nameCn)||((h=i.hoverPoint)==null?void 0:h.Name)),1),o.createElementVNode("span",xd," ["+o.toDisplayString(t.$t("tropical."+((f=i.hoverPoint)==null?void 0:f.levelI18n)))+"]",1)])]}),_:1}),o.createVNode(d),o.createVNode(s,{class:"text-body-1"},{default:o.withCtx(()=>{var y,u,h,f,w,b,A,x,C,k,_,z,P,T,V,j,W,O,ie,oe;return[o.createElementVNode("div",kd,[((y=i.hoverPoint)==null?void 0:y.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Ad,[o.createElementVNode("label",Ld,o.toDisplayString(t.$t("tropical.updated"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTzTime((u=i.hoverPoint)==null?void 0:u.update,a.timeZone)),1)])):o.createCommentVNode("",!0),((h=i.hoverPoint)==null?void 0:h.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Cd,[o.createElementVNode("label",zd,o.toDisplayString(t.$t("tropical.forecast"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTzTime((f=i.hoverPoint)==null?void 0:f.date,a.timeZone)),1)])):o.createCommentVNode("",!0),((w=i.hoverPoint)==null?void 0:w.type)==="history"?(o.openBlock(),o.createElementBlock("div",vd,[o.createElementVNode("label",_d,o.toDisplayString(t.$t("tropical.forecast"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTzTime((b=i.hoverPoint)==null?void 0:b.date,a.timeZone)),1)])):o.createCommentVNode("",!0),((A=i.hoverPoint)==null?void 0:A.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Sd,[o.createElementVNode("label",Md,o.toDisplayString(t.$t("tropical.model"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((x=i.hoverPoint)==null?void 0:x.model)??"-"),1)])):o.createCommentVNode("",!0),((C=i.hoverPoint)==null?void 0:C.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Nd,[o.createElementVNode("label",Pd,o.toDisplayString(t.$t("weather.wind"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((_=JSON.parse(((k=i.hoverPoint)==null?void 0:k.wind)||"{}"))==null?void 0:_.kts)??"-")+" kts",1)])):o.createCommentVNode("",!0),((z=i.hoverPoint)==null?void 0:z.type)==="history"?(o.openBlock(),o.createElementBlock("div",Vd,[o.createElementVNode("label",Td,o.toDisplayString(t.$t("weather.wind"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((P=i.hoverPoint)==null?void 0:P.kts)??"-")+" kts",1)])):o.createCommentVNode("",!0),o.createElementVNode("div",Ed,[o.createElementVNode("label",Rd,o.toDisplayString(t.$t("weather.pressure"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((T=i.hoverPoint)==null?void 0:T.pressure)??"-")+" hPa",1)]),((V=i.hoverPoint)==null?void 0:V.type)==="history"?(o.openBlock(),o.createElementBlock("div",Dd,[o.createElementVNode("label",Bd,o.toDisplayString(t.$t("tropical.moveSpeed"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((W=JSON.parse(((j=i.hoverPoint)==null?void 0:j.movement)||"{}"))==null?void 0:W.kts)??"-")+" kts",1)])):o.createCommentVNode("",!0),((O=i.hoverPoint)==null?void 0:O.type)==="history"?(o.openBlock(),o.createElementBlock("div",Id,[o.createElementVNode("label",Fd,o.toDisplayString(t.$t("tropical.moveDir"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((oe=JSON.parse(((ie=i.hoverPoint)==null?void 0:ie.movement)||"{}"))==null?void 0:oe.deg)??"-")+" °",1)])):o.createCommentVNode("",!0),o.createElementVNode("div",Gd,[o.createElementVNode("label",jd,o.toDisplayString(t.$t("tropical.position"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computePosition(i.hoverPoint)),1)])])]}),_:1})]),_:1},512),[[o.vShow,i.showHoverPoint]])])}const Xo=Y(nm,[["render",Wd]]),Ly="",Zd={name:"DateTimePicker",props:{width:{type:Number,default:null},height:{type:Number,default:30},position:{type:String,default:"top"},bgClass:{type:String,default:""},locale:{type:String,default:"en"},style:{type:Object,default:{}},intervalHour:{type:Number,default:3},timeZone:{type:Number},dateTime:{type:String},dayAbout:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1}},emits:["dateTime","currentTimestamp","currentRealTime","minTimestamp","maxTimestamp"],data(){return{showDatePicker:!1,minDate:void 0,maxDate:void 0,minTimestamp:void 0,maxTimestamp:void 0,currentDate:void 0,currentTime:void 0,currentTimestamp:void 0,currentDateTimeZ:void 0,currentDateTime:void 0,currentRealTime:void 0,timer:null}},computed:{getStyle(){const t=this.width||220;return this.position==="top"?{bottom:"40px",left:`-${(420-t)/2}px`}:this.position==="bottom"?{top:"40px",left:`-${(420-t)/2}px`}:this.position==="left"?{bottom:"-140px",left:"-428px"}:this.position==="right"?{bottom:"-140px",right:"-428px"}:{bottom:"40px",left:`-${(420-t)/2}px`}},hourOptions(){const t=[];for(let e=0;e<24;e++)t.push(e<10?`0${e}:00`:`${e}:00`);return t.filter((e,a)=>(a-this.timeZone)%this.intervalHour===0)},timeZoneNames(){return v.tz.names()},timeZoneName(){var t;return(t=this.timeZoneNames.filter(e=>v.tz(v(),e).utcOffset()===this.timeZone*60))==null?void 0:t[0]},utcTimeZoneName(){return"Africa/Abidjan"},localTimeZoneName(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"Asia/Shanghai"}},watch:{timeZone:{handler(t,e){t!==e&&(this.handleResetDateTime(this.dateTime),this.handleResetMinMax())}},dateTime:{handler(t,e){t&&this.handleResetDateTime(this.dateTime)},immediate:!0},currentTimestamp:{handler(){this.currentDateTimeZ=v(this.currentTimestamp).utc().format("yyyy-MM-DD HH:00[Z]"),this.$emit("dateTime",this.currentDateTimeZ),this.$emit("currentTimestamp",this.currentTimestamp),this.currentDateTime=`${v.tz(this.currentTimestamp,this.timeZoneName).clone().format("yyyy-MM-DD : HH:00")}`},immediate:!0},currentRealTime:{handler(t,e){t!==e&&this.$emit("currentRealTime",this.currentRealTime)}}},mounted(){this.timer=setInterval(()=>{this.currentRealTime=`${v.tz(v().unix()*1e3,this.timeZoneName).clone().format("HH:mm")}`},100),document.addEventListener("click",this.handleClickOutside)},unmounted(){clearInterval(this.timer),this.handleCancelDate(),document.removeEventListener("click",this.handleClickOutside)},methods:{handleReset(){this.handleResetDateTime(),this.handleResetMinMax()},handleResetDateTime(t){var i;const e=v(t).utc().date(),a=Math.ceil(v(t).utc().hour()/this.intervalHour)*this.intervalHour;this.currentTimestamp=((i=v(t))==null?void 0:i.utc().set({date:e,hour:a,minute:0,second:0,millisecond:0}).unix())*1e3;const r=v.tz(this.currentTimestamp,this.timeZoneName).clone();this.currentDate=r.clone().format("YYYY-MM-DD"),this.currentTime=r.clone().format("HH:00"),this.currentDateTime=`${v.tz(this.currentTimestamp,this.timeZoneName).clone().format("yyyy-MM-DD : HH:00")}`,this.currentRealTime=`${v.tz(v().unix()*1e3,this.timeZoneName).clone().format("HH:mm")}`},handleResetMinMax(){var i,l,n,c,s;if(!this.dayAbout.h||!this.dayAbout.f)return;const t=v().utc().date(),e=Math.ceil(v().utc().hour()/this.intervalHour)*this.intervalHour,a=((i=v())==null?void 0:i.utc().set({date:t,hour:e,minute:0,second:0,millisecond:0}).unix())*1e3,r=v.tz(a,this.timeZoneName).clone();this.minDate=r.clone().add(this.dayAbout.h,"day").format("yyyy-MM-DD"),this.maxDate=r.clone().add(this.dayAbout.f,"day").format("yyyy-MM-DD"),this.minTimestamp=((n=(l=v())==null?void 0:l.utc())==null?void 0:n.set({date:t+this.dayAbout.h,hour:0,minute:0,second:0,millisecond:0}).unix())*1e3,this.maxTimestamp=((s=(c=v())==null?void 0:c.utc())==null?void 0:s.set({date:t+this.dayAbout.f,hour:0,minute:0,second:0,millisecond:0}).unix())*1e3,this.$emit("minTimestamp",this.minTimestamp),this.$emit("maxTimestamp",this.maxTimestamp)},handleOpenDatePicker(){this.disabled||(this.showDatePicker=!this.showDatePicker)},handleUpdateMonth(t){const e=t||v.tz(this.currentTimestamp,this.timeZoneName).clone().month(),a=this.locale==="en"?v.tz(this.currentTimestamp,this.timeZoneName).set({month:e}).clone().format("MMM"):v.tz(this.currentTimestamp,this.timeZoneName).set({month:e}).clone().format("M月");this.$nextTick(()=>{const r=document.querySelector(".v-date-picker-controls__month-btn");r.innerText=a})},handleConfirmDate(){const t=v(this.currentDate).format("yyyy-MM-DD"),e=this.currentTime,a=`${t} ${e}`,r=v.tz(a,"YYYY-MM-DD HH:00",this.timeZoneName).clone().tz(this.localTimeZoneName);this.currentTimestamp=r.unix()*1e3,this.showDatePicker=!1},handleCancelDate(){this.showDatePicker=!1;const t=v.tz(this.currentTimestamp,this.timeZoneName).clone();this.currentDate=t.clone().format("YYYY-MM-DD"),this.currentTime=t.clone().format("HH:00")},handleClickOutside(t){const e=this.$refs.idmGl4Timepicker;e&&!e.contains(t.target)&&(this.showDatePicker=!1)}}},Xd={ref:"idmGl4Timepicker",class:"idm-gl4-time-picker"},Hd={class:"pa-0",style:{width:"320px"}},Od={class:"h-100 pa-0 d-flex flex-column justify-start align-center",style:{width:"100px"}},Yd={class:"d-flex justify-center align-center text-body-2",style:{height:"44px"}};function Ud(t,e,a,r,i,l){const n=o.resolveComponent("VDatePicker"),c=o.resolveComponent("VDivider"),s=o.resolveComponent("VListItemTitle"),d=o.resolveComponent("VListItem"),m=o.resolveComponent("VList"),p=o.resolveComponent("VCardText"),g=o.resolveComponent("VBtn"),y=o.resolveComponent("VCardActions"),u=o.resolveComponent("VCard");return o.openBlock(),o.createElementBlock("div",Xd,[o.createElementVNode("div",{style:o.normalizeStyle({height:a.height+"px",width:a.width?a.width+"px":"auto"}),class:o.normalizeClass([[a.bgClass,{"cursor-pointer":!a.disabled}],"rounded text-body-1 btn-border-1 btn-bg-1 d-flex align-center justify-center px-2"]),onClick:e[0]||(e[0]=(...h)=>l.handleOpenDatePicker&&l.handleOpenDatePicker(...h))},o.toDisplayString(i.currentDateTime)+" | UTC "+o.toDisplayString(a.timeZone<0?a.timeZone:"+"+a.timeZone),7),i.showDatePicker?(o.openBlock(),o.createBlock(u,{key:0,class:"card-box d-flex flex-column border elevation-12",style:o.normalizeStyle(l.getStyle)},{default:o.withCtx(()=>[o.createVNode(p,{class:"w-100 flex-1-1-0 d-flex pa-0 text-body-1"},{default:o.withCtx(()=>[o.createElementVNode("div",Hd,[o.createVNode(n,{modelValue:i.currentDate,"onUpdate:modelValue":e[1]||(e[1]=h=>i.currentDate=h),min:i.minDate,max:i.maxDate,"weekday-format":"narrow",color:"primary",density:"compact",class:"w-100","hide-header":""},null,8,["modelValue","min","max"])]),o.createVNode(c,{class:"h-100",vertical:""}),o.createElementVNode("div",Od,[o.createElementVNode("div",Yd,o.toDisplayString(t.$t("time.time")),1),o.createVNode(m,{class:"pa-0 flex-1-1-0 scroll"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.hourOptions,(h,f)=>(o.openBlock(),o.createBlock(d,{key:f,value:h,color:"primary",active:i.currentTime===h,rounded:"",height:"26","min-height":"26",class:"rounded-xl",variant:i.currentTime===h?"flat":"text"},{default:o.withCtx(()=>[o.createVNode(s,{class:"text-body-2 font-weight-600 text-center",onClick:w=>i.currentTime=h},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h),1)]),_:2},1032,["onClick"])]),_:2},1032,["value","active","variant"]))),128))]),_:1})])]),_:1}),o.createVNode(c),o.createVNode(y,{class:"w-100 d-flex justify-end align-center px-4 ga-4",style:{height:"50px"}},{default:o.withCtx(()=>[o.createVNode(g,{size:"small",variant:"tonal",class:"text-none text-body-1 px-4",onClick:l.handleCancelDate},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.cancel")),1)]),_:1},8,["onClick"]),o.createVNode(g,{size:"small",variant:"flat",color:"primary",class:"text-none text-body-1 px-4",onClick:l.handleConfirmDate},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.confirm")),1)]),_:1},8,["onClick"])]),_:1})]),_:1},8,["style"])):o.createCommentVNode("",!0)],512)}const qe=Y(Zd,[["render",Ud]]),Cy="",Jd={name:"IdmPoint",components:{DateTimePicker:qe},props:{simple:{type:Boolean,default:!1},isLogin:{type:Boolean,default:!1},token:{type:String},defaultMeteoToken:{type:String},theme:{type:String,default:"zh"},map:{type:Object},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}},gateway:{type:String},timeZone:{type:Number},forecastModel:{type:String},realTime:{type:String},followList:{type:Array,default:()=>[]}},emits:["meteoMore","follow","cancelFollow","login"],data(){return{right:10,toggle:!1,showForm:!1,showMeteo:!1,loading:!1,form:{lng:void 0,lngDegree:void 0,lngMinute:void 0,lngDirection:"E",lat:void 0,latDegree:void 0,latMinute:void 0,latDirection:"N",dateTime:void 0,forecastModel:""},formRules:{lngDegree:[t=>t!=null&&t!==""||"required",t=>/^\d{1,3}$/.test(t)||"number",t=>parseInt(t)>=0&&parseInt(t)<=180||"0 ~ 180"],lngMinute:[t=>t===void 0||t===null&&t===""||/^\d{1,2}(\.\d+)?$/.test(t)||"number",t=>t===void 0||t===null&&t===""||parseInt(t)>=0&&parseInt(t)<=59||"0 ~ 59"],latDegree:[t=>t!=null&&t!==""||"required",t=>/^\d{1,2}$/.test(t)||"number",t=>parseInt(t)>=0&&parseInt(t)<=90||"0 ~ 90"],latMinute:[t=>t===void 0||t===null&&t===""||/^\d{1,2}(\.\d+)?$/.test(t)||"number",t=>t===void 0||t===null&&t===""||parseInt(t)>=0&&parseInt(t)<=59||"0 ~ 59"]},meteoData:void 0,currentHourData:{},positionOffset:void 0,positionGmt:void 0,positionMarker:void 0,meteoInfoMarker:void 0}},computed:{timeZoneNames(){return v.tz.names()},timeZoneName(){var t;return(t=this.timeZoneNames.filter(e=>v.tz(v(),e).utcOffset()===this.timeZone*60))==null?void 0:t[0]},computedTzTime(){return t=>v.tz(v(t),this.timeZoneName).clone().format("YYYY-MM-DD HHmm")+" (UTC "+(this.timeZone>=0?"+":"")+this.timeZone+")"},computedLocalTime(){return t=>{var r,i,l;const e=Number((r=this.positionOffset)==null?void 0:r.slice(1,3))*(+(((i=this.positionOffset)==null?void 0:i.slice(1))==="+")?1:-1),a=(l=this.timeZoneNames.filter(n=>v.tz(v(),n).utcOffset()===e*60))==null?void 0:l[0];return t?v.tz(v(t),a).clone().format("YYYY-MM-DD HHmm")+" (UTC "+(e>=0?"+":"")+e+")":"-"}},computePosition(){return function(t){return!t||t.lng===null||t.lng===void 0||isNaN(t.lng)||t.lat===null||t.lat===void 0||isNaN(t.lat)?"-":N.LngLatHelper.lat2pretty(t==null?void 0:t.lat,2).pretty+" / "+N.LngLatHelper.lng2pretty(t==null?void 0:t.lng,2).pretty}},computeRoundPrecision(){return function(t,e=4){return t==null||isNaN(t)||isNaN(e)?"-":N.LngLatHelper.roundPrecision(t,e)}}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})},immediate:!0},toggle:{handler(){this.toggle?this.showForm=!0:(this.showForm=!1,this.showMeteo=!1),this.map&&this.handleBind()},immediate:!0},map:{handler(){this.map&&this.toggle&&this.handleBind()}},showForm:{handler(){this.showForm?(this.realTime&&(this.form.dateTime=this.realTime),this.$nextTick(()=>{var t;(t=this.$refs.spotForm)==null||t.resetValidation()})):this.handleCloseForm()}},showMeteo:{handler(){var t,e,a,r,i,l;this.showMeteo?((a=(e=(t=this.$parent)==null?void 0:t.$refs)==null?void 0:e.idmBottomBar)==null||a.handleToggle("spot",!0),this.simple&&this.$nextTick(()=>{var n,c;this.$parent.playerBottom=((c=(n=this.$refs.spotMeteo)==null?void 0:n.$el)==null?void 0:c.clientHeight)+10})):((l=(i=(r=this.$parent)==null?void 0:r.$refs)==null?void 0:i.idmBottomBar)==null||l.handleToggle("spot",!1),this.simple&&(this.$parent.playerBottom=30))}},realTime:{handler(){this.realTime&&(this.form.dateTime=this.realTime,this.showMeteo&&this.fetchData())}},forecastModel:{handler(){this.form.forecastModel=this.forecastModel},immediate:!0},"form.forecastModel":{handler(t,e){!t&&e&&(this.form.forecastModel=e==="GFS"?"ECMWF":"GFS")}}},methods:{handleMenuToggle(){this.isLogin?this.toggle=!this.toggle:this.$emit("login")},submitForm(){this.handleCloseMeteo(),this.$refs.spotForm.validate().then(async t=>{t!=null&&t.valid&&this.fetchData()})},cancelForm(){var t;(t=this.$refs.spotForm)==null||t.reset(),this.form={lng:void 0,lngDegree:void 0,lngMinute:void 0,lngDirection:"E",lat:void 0,latDegree:void 0,latMinute:void 0,latDirection:"N",dateTime:void 0,forecastModel:this.forecastModel}},handleCloseForm(){this.showForm=!1,this.cancelForm(),this.toggle=!1},async fetchData(){var a;if(isNaN(this.form.latDegree)||isNaN(this.form.latMinute)||isNaN(this.form.lngDegree)||isNaN(this.form.lngMinute))return!1;this.form.lat=(Number(this.form.latDegree??0)+Number(this.form.latMinute??0)/60)*(this.form.latDirection==="N"?1:-1),this.form.lng=(Number(this.form.lngDegree??0)+Number(this.form.lngMinute??0)/60)*(this.form.lngDirection==="E"?1:-1);const t=v();((a=v(this.realTime))==null?void 0:a.diff(t,"d",!0))>=0?await this.fetchForecastData(this.form):await this.fetchHistoryData(this.form)},async fetchForecastData(t){this.loading=!0,this.showMeteo=!0,this.form.lng=t.lng,this.form.lat=t.lat,this.form.followId=t.followId,this.handleDrawInfoMarker([t.lng,t.lat]),this.meteoData=[];const{weatherModels:e,marineModels:a}=Ie.Meteo2Assist.autoPickMeteoModel(t.forecastModel);let r={lat:t.lat,lng:t.lng,datetime:v(t.dateTime).utc().format(),forecastDays:t.day??3,weatherModels:e,marineModels:a};await le.post(`${this.gateway}/api/arc/meteo2/spot/forecast`,r,{headers:{Authorization:this.token||this.defaultMeteoToken}}).then(i=>{(i==null?void 0:i.data.code)===0?(this.meteoData=i==null?void 0:i.data.data,this.meteoData.lng=t.lng,this.meteoData.lat=t.lat,this.initTableData(this.meteoData),this.loading=!1):this.loading=!1}).catch(()=>{this.loading=!1})},async fetchHistoryData(t){this.loading=!0,this.showMeteo=!0,this.form.lng=t.lng,this.form.lat=t.lat,this.form.followId=t.followId,this.handleDrawInfoMarker([t.lng,t.lat]),this.meteoData=[];const{weatherModels:e,marineModels:a}=Ie.Meteo2Assist.autoPickMeteoModel(t.forecastModel),r={lat:t.lat,lng:t.lng,datetime:v(t.dateTime).utc().format(),forecastDays:2,pastDays:1,weatherModels:e,marineModels:a};await le.post(`${this.gateway}/api/arc/meteo2/spot/forecast`,r,{headers:{Authorization:this.token||this.defaultMeteoToken}}).then(i=>{(i==null?void 0:i.data.code)===0?(this.meteoData=i==null?void 0:i.data.data,this.meteoData.lng=t.lng,this.meteoData.lat=t.lat,this.initTableData(this.meteoData),this.loading=!1):this.loading=!1}).catch(()=>{this.loading=!1}),this.loading=!1},initTableData(t){var a,r,i,l,n,c,s,d,m,p,g,y,u,h,f,w,b,A,x,C,k,_,z,P,T,V,j,W,O,ie,oe,M,F,G,U,B,D,X,S,Q,re;this.currentHourData={},this.positionGmt=(r=(a=t==null?void 0:t.weather)==null?void 0:a[0])==null?void 0:r.timezone,this.positionOffset=(l=(i=t==null?void 0:t.weather)==null?void 0:i[0])==null?void 0:l.offset;const e=((n=Ie.Meteo2Assist.pickHourly(t,v(this.form.dateTime)))==null?void 0:n[0])||{};this.currentHourData.utc=e.utc,this.currentHourData.lat=t.lat,this.currentHourData.lng=t.lng,this.currentHourData.temp=this.computeRoundPrecision((c=e==null?void 0:e.weather)==null?void 0:c.temp,0)??"-",this.currentHourData.precipProbability=this.computeRoundPrecision((d=(s=e==null?void 0:e.weather)==null?void 0:s.precip)==null?void 0:d.probability,0)??"-",this.currentHourData.precip1h=this.computeRoundPrecision((p=(m=e==null?void 0:e.weather)==null?void 0:m.precip)==null?void 0:p.sum,0)??"-",this.currentHourData.visibility=this.computeRoundPrecision((g=e==null?void 0:e.weather)==null?void 0:g.visibility,0)??"-",this.currentHourData.windSpeed=this.computeRoundPrecision((u=(y=e==null?void 0:e.weather)==null?void 0:y.wind)==null?void 0:u.kts,1)??"-",this.currentHourData.windDir=((f=(h=e==null?void 0:e.weather)==null?void 0:h.wind)==null?void 0:f.direction)??"-",this.currentHourData.windLevel=this.computeRoundPrecision((b=(w=e==null?void 0:e.weather)==null?void 0:w.wind)==null?void 0:b.scale,0)??"-",this.currentHourData.windGust=this.computeRoundPrecision((x=(A=e==null?void 0:e.weather)==null?void 0:A.wind)==null?void 0:x.gusts,1)??"-",this.currentHourData.sigwaveHeight=this.computeRoundPrecision((k=(C=e==null?void 0:e.wave)==null?void 0:C.sig)==null?void 0:k.height,1)??"-",this.currentHourData.sigwaveDir=(z=(_=e==null?void 0:e.wave)==null?void 0:_.sig)==null?void 0:z.direction,this.currentHourData.sigwavePeriod=this.computeRoundPrecision((T=(P=e==null?void 0:e.wave)==null?void 0:P.sig)==null?void 0:T.period,1)??"-",this.currentHourData.windwaveHeight=this.computeRoundPrecision((j=(V=e==null?void 0:e.wave)==null?void 0:V.wd)==null?void 0:j.height,1)??"-",this.currentHourData.windwaveDir=(O=(W=e==null?void 0:e.wave)==null?void 0:W.wd)==null?void 0:O.direction,this.currentHourData.windwavePeriod=this.computeRoundPrecision((oe=(ie=e==null?void 0:e.wave)==null?void 0:ie.wd)==null?void 0:oe.period,1)??"-",this.currentHourData.swellHeight=this.computeRoundPrecision((F=(M=e==null?void 0:e.wave)==null?void 0:M.swell)==null?void 0:F.height,1)??"-",this.currentHourData.swellDir=(U=(G=e==null?void 0:e.wave)==null?void 0:G.swell)==null?void 0:U.direction,this.currentHourData.swellPeriod=this.computeRoundPrecision((D=(B=e==null?void 0:e.wave)==null?void 0:B.swell)==null?void 0:D.period,1)??"-",this.currentHourData.currentSpeed=this.computeRoundPrecision((X=e==null?void 0:e.current)==null?void 0:X.speed,1)??"-",this.currentHourData.currentDir=(S=e==null?void 0:e.current)==null?void 0:S.direction,this.currentHourData.currentSpeed=this.computeRoundPrecision((Q=e==null?void 0:e.current)==null?void 0:Q.speed,1)??"-",this.currentHourData.seaLevel=this.computeRoundPrecision(e==null?void 0:e.height,1)??"-",this.currentHourData.seaTemp=this.computeRoundPrecision(e==null?void 0:e.sst,0)??"-",this.currentHourData.weatherUrls=(re=e==null?void 0:e.weather)==null?void 0:re.url},handleBind(){var t,e;this.toggle?((t=this.map)==null||t.on("click",this.handleClick),this.map&&(this.map.getCanvas().style.cursor="crosshair")):((e=this.map)==null||e.off("click",this.handleClick),this.handleCloseMeteo(),this.map&&(this.map.getCanvas().style.cursor="grab"))},handleClick(t){if(t.originalEvent.stopPropagation(),t.originalEvent.target.className==="mapboxgl-canvas")this.handleGetPosition(t.lngLat),this.$nextTick(()=>{this.fetchData()});else return!1},handleGetPosition(t){if(isNaN(t.lat)||isNaN(t.lng))return!1;this.form.latDegree=Number(N.LngLatHelper.lat2pretty(t.lat).degree),this.form.latMinute=Number(N.LngLatHelper.lat2pretty(t.lat).minute),this.form.latDirection=N.LngLatHelper.lat2pretty(t.lat).direction,this.form.lngDegree=Number(N.LngLatHelper.lng2pretty(t.lng).degree),this.form.lngMinute=Number(N.LngLatHelper.lng2pretty(t.lng).minute),this.form.lngDirection=N.LngLatHelper.lng2pretty(t.lng).direction},handleDrawInfoMarker(t){this.drawPositionMarker(t),this.simple||this.drawMeteoInfoMarker(t)},drawPositionMarker(t){t&&(this.map.flyTo({center:t,duration:300}),this.$nextTick(()=>{var a,r;(a=this.positionMarker)==null||a.remove();const e=(r=document.getElementById("idm-position-icon"))==null?void 0:r.cloneNode(!0);this.positionMarker=new ne.Marker(e).setLngLat(t).setOffset([0,-15]).addTo(this.map)}))},drawMeteoInfoMarker(t){this.$nextTick(()=>{var a;const e=document.getElementById("idm-gl4-spot-meteo");this.meteoInfoMarker?(a=this.meteoInfoMarker)==null||a.setLngLat(t):this.meteoInfoMarker=new ne.Marker(e).setLngLat(t).setOffset([0,-190]).addTo(this.map)})},handleMeteoMore(){this.form.forecastModel=this.forecastModel,this.$emit("meteoMore",this.form)},handleCloseMeteo(){this.showMeteo=!1,this.$nextTick(()=>{var t,e;(t=this.positionMarker)==null||t.remove(),this.positionMarker=void 0,(e=this.meteoInfoMarker)==null||e.remove(),this.meteoInfoMarker=void 0})},handleFollow(){this.$emit("follow",this.form)},handleCancelFollow(){var e,a,r;const t=((e=this.form)==null?void 0:e.followId)||((r=(a=this.followList)==null?void 0:a.find(i=>{var l,n;return(i==null?void 0:i.id)===this.form.followId||((l=i==null?void 0:i.coordinate)==null?void 0:l.lng)===this.form.lng&&((n=i==null?void 0:i.coordinate)==null?void 0:n.lat)===this.form.lat}))==null?void 0:r.id);this.$emit("cancelFollow",t)}}},Kd={class:"idm-gl4-spot"},Qd={class:"d-flex justify-start align-center"},qd={class:"text-h6 font-weight-600"},$d={class:"d-flex justify-start align-center ga-1 mb-2"},eh={class:"text-label"},th={class:"d-flex justify-start align-center ga-1 mb-2"},oh={class:"text-label"},ah={class:"d-flex justify-start align-center ga-1 mb-2"},ih={class:"text-label"},rh={class:"d-flex justify-start align-center ga-1 mb-2"},lh={class:"text-label"},nh={class:"d-flex justify-start align-center"},sh={class:"mx-2"},ch={class:"mx-0 py-2 d-flex align-center justify-start"},mh={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},dh={class:"pa-0 px-0"},hh={class:"mx-0 py-2 d-flex align-center justify-start"},ph={cols:"9",class:"pa-0 px-0"},gh={class:"mx-0 py-2 d-flex align-center justify-start"},uh={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},fh={style:{width:"150px"},class:"pa-0 text-left"},yh={style:{width:"80px"},class:"pa-0 pr-2 text-right opacity-50"},bh={cols:"3",class:"pa-0 px-0 text-left"},wh={class:"mx-0 py-2 d-flex align-center justify-start"},xh={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},kh={style:{width:"150px"},class:"pa-0 text-left"},Ah={style:{width:"80px"},class:"pa-0 pr-2 text-right opacity-50"},Lh={cols:"3",class:"pa-0 text-left"},Ch={class:"mx-0 py-2 d-flex align-center justify-start"},zh={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},vh={style:{width:"150px"},class:"pa-0 text-left"},_h={style:{width:"80px"},class:"pa-0 pr-2 text-right opacity-50"},Sh={class:"pa-0 text-left"},Mh={class:"d-flex justify-space-between align-center"},Nh={class:"d-flex justify-start align-center"},Ph={class:"mx-1"},Vh={class:"d-flex justify-end align-center"},Th={class:"mx-0 py-1 d-flex align-center justify-start"},Eh={style:{width:"60px"},class:"pa-0 pr-2 text-right opacity-50"},Rh={class:"pa-0 px-0"},Dh={class:"mx-0 py-1 d-flex align-center justify-start"},Bh={class:"pa-0 px-0"},Ih={class:"gray-bg-2 mx-4 my-2 py-3 px-2 rounded text-font-13 d-flex align-center justify-space-between"},Fh={class:"d-flex flex-column align-start justify-center ga-3"},Gh={class:"text-label pr-2"},jh={class:"text-label pr-2"},Wh={class:"text-label pr-2"},Zh={class:"d-flex flex-column align-start justify-center ga-3"},Xh={class:"text-label pr-2"},Hh={class:"text-label pr-2"},Oh={class:"text-label pr-2"},Yh={id:"idm-position-icon"},Uh={class:"multi-color-icon",style:{height:"30px",width:"30px"},"aria-hidden":"true"},Jh=["xlink:href"];function Kh(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip"),s=o.resolveComponent("VCardTitle"),d=o.resolveComponent("VDivider"),m=o.resolveComponent("VTextField"),p=o.resolveComponent("VCol"),g=o.resolveComponent("VRow"),y=o.resolveComponent("DateTimePicker"),u=o.resolveComponent("VBtnToggle"),h=o.resolveComponent("VCardText"),f=o.resolveComponent("VCardActions"),w=o.resolveComponent("VForm"),b=o.resolveComponent("VCard");return o.openBlock(),o.createElementBlock("div",Kd,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+126+"px",right:i.right+"px"})},[o.createVNode(c,{text:t.$t("spot.spotsMeteo"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:A})=>[o.createVNode(n,o.mergeProps(A,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>e[8]||(e[8]=[o.createElementVNode("i",{class:"iconfont icon-a-Spotweather text-h4"},null,-1)])),_:2,__:[8]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4),i.showForm&&!a.simple?(o.openBlock(),o.createBlock(b,{key:0,class:"spot-form-card",style:o.normalizeStyle({top:a.top+a.paddingTop+126+"px",right:i.right+50+"px"})},{default:o.withCtx(()=>[o.createVNode(s,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>[o.createElementVNode("div",Qd,[o.createElementVNode("div",qd,o.toDisplayString(t.$t("spot.spotWeather")),1)]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleCloseForm},{default:o.withCtx(()=>e[9]||(e[9]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[9]},8,["onClick"])]),_:1}),o.createVNode(d),o.createVNode(w,{ref:"spotForm",autocomplete:"off",class:"form-box",onSubmit:o.withModifiers(l.submitForm,["prevent"])},{default:o.withCtx(()=>[o.createVNode(h,{class:"text-body-1 pa-4"},{default:o.withCtx(()=>[o.createElementVNode("div",$d,[o.createElementVNode("div",eh,[o.createTextVNode(o.toDisplayString(t.$t("spot.lat")),1),e[10]||(e[10]=o.createElementVNode("span",{class:"text-danger"},"*",-1))])]),o.createVNode(g,{class:"ma-0"},{default:o.withCtx(()=>[o.createVNode(p,{cols:"4",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.latDegree,"onUpdate:modelValue":e[0]||(e[0]=A=>i.form.latDegree=A),rules:i.formRules.latDegree,label:"",density:"compact",variant:"outlined",height:"32px","min-height":"32px",required:"",dense:"",class:"text-body-1 input-btn-bg-1"},null,8,["modelValue","rules"]),e[11]||(e[11]=o.createElementVNode("span",{class:"px-1"},"°",-1))]),_:1,__:[11]}),o.createVNode(p,{cols:"6",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.latMinute,"onUpdate:modelValue":e[1]||(e[1]=A=>i.form.latMinute=A),rules:i.formRules.latMinute,label:"",density:"compact",variant:"outlined",class:"text-body-1 input-btn-bg-1",required:"",dense:""},null,8,["modelValue","rules"]),e[12]||(e[12]=o.createElementVNode("span",{class:"px-1"},"'",-1))]),_:1,__:[12]}),o.createVNode(p,{cols:"2",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(n,{variant:"outlined",density:"compact",width:"32","min-width":"32",height:"32",class:"text-body-1 bg-primary",style:{border:"1px solid rgba(var(--v-theme-on-surface), 0.38)"},onClick:e[2]||(e[2]=A=>i.form.latDirection=i.form.latDirection==="N"?"S":"N")},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.form.latDirection),1)]),_:1})]),_:1})]),_:1}),o.createElementVNode("div",th,[o.createElementVNode("div",oh,[o.createTextVNode(o.toDisplayString(t.$t("spot.lng")),1),e[13]||(e[13]=o.createElementVNode("span",{class:"text-danger"},"*",-1))])]),o.createVNode(g,{class:"ma-0"},{default:o.withCtx(()=>[o.createVNode(p,{cols:"4",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.lngDegree,"onUpdate:modelValue":e[3]||(e[3]=A=>i.form.lngDegree=A),rules:i.formRules.lngDegree,density:"compact",variant:"outlined",class:"text-body-1 input-btn-bg-1",required:"",dense:""},null,8,["modelValue","rules"]),e[14]||(e[14]=o.createElementVNode("span",{class:"px-1"},"°",-1))]),_:1,__:[14]}),o.createVNode(p,{cols:"6",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.lngMinute,"onUpdate:modelValue":e[4]||(e[4]=A=>i.form.lngMinute=A),rules:i.formRules.lngMinute,label:"",density:"compact",variant:"outlined",class:"text-body-1 input-btn-bg-1",required:"",dense:""},null,8,["modelValue","rules"]),e[15]||(e[15]=o.createElementVNode("span",{class:"px-1"},"'",-1))]),_:1,__:[15]}),o.createVNode(p,{cols:"2",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(n,{variant:"outlined",density:"compact",width:"32","min-width":"32",height:"32",class:"text-body-1 bg-primary",style:{border:"1px solid rgba(var(--v-theme-on-surface), 0.38)"},onClick:e[5]||(e[5]=A=>i.form.lngDirection=i.form.lngDirection==="E"?"W":"E")},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.form.lngDirection),1)]),_:1})]),_:1})]),_:1}),o.createElementVNode("div",ah,[o.createElementVNode("div",ih,[o.createTextVNode(o.toDisplayString(t.$t("spot.dateTime")),1),e[16]||(e[16]=o.createElementVNode("span",{class:"text-danger"},"*",-1))])]),o.createVNode(g,{class:"ma-0 mb-4"},{default:o.withCtx(()=>[o.createVNode(p,{cols:"12",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(y,o.mergeProps({"date-time":i.form.dateTime,"time-zone":a.timeZone},t.$attrs,{onDateTime:e[6]||(e[6]=A=>i.form.dateTime=A)}),null,16,["date-time","time-zone"])]),_:1})]),_:1}),o.createElementVNode("div",rh,[o.createElementVNode("div",lh,[o.createTextVNode(o.toDisplayString(t.$t("weather.forecastModel")),1),e[17]||(e[17]=o.createElementVNode("span",{class:"text-danger"},"*",-1))])]),o.createVNode(g,{class:"ma-0 mb-2"},{default:o.withCtx(()=>[o.createVNode(p,{cols:"12",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(u,{modelValue:i.form.forecastModel,"onUpdate:modelValue":e[7]||(e[7]=A=>i.form.forecastModel=A),class:"w-100",rounded:"",height:"30",density:"compact",group:"",mandatory:""},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"30",value:"GFS",class:o.normalizeClass(["text-none flex-1-1-0",i.form.forecastModel==="GFS"?"":"btn-border-1 btn-bg-1"]),color:i.form.forecastModel==="GFS"?"primary":"","base-color":""},{default:o.withCtx(()=>e[18]||(e[18]=[o.createTextVNode(" NOAA ",-1)])),_:1,__:[18]},8,["class","color"]),o.createVNode(n,{density:"compact",height:"30",class:o.normalizeClass(["text-none flex-1-1-0",i.form.forecastModel==="ECMWF"?"":"btn-border-1 btn-bg-1"]),color:i.form.forecastModel==="ECMWF"?"primary":"","base-color":"",value:"ECMWF"},{default:o.withCtx(()=>e[19]||(e[19]=[o.createTextVNode(" ECMWF ",-1)])),_:1,__:[19]},8,["class","color"])]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),o.createVNode(d),o.createVNode(f,{class:"d-flex justify-end align-center ga-4 pa-4"},{default:o.withCtx(()=>[o.createVNode(n,{size:"small",variant:"tonal",class:"text-none text-body-1 btn-bg-1",onClick:l.cancelForm},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.clear")),1)]),_:1},8,["onClick"]),o.createVNode(n,{ref:"submitSpot",loading:i.loading,size:"small",variant:"flat",color:"primary",type:"submit",class:"text-none text-body-1"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.confirm")),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["onSubmit"])]),_:1},8,["style"])):o.createCommentVNode("",!0),i.showMeteo&&!a.simple?(o.openBlock(),o.createBlock(b,{key:1,id:"idm-gl4-spot-meteo",class:"spot-meteo",style:{width:"490px","z-index":"9"}},{default:o.withCtx(()=>[o.createVNode(s,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>[o.createElementVNode("div",nh,[e[20]||(e[20]=o.createElementVNode("i",{class:"iconfont icon-a-Spotweather text-h5 map-icon-aqua"},null,-1)),o.createElementVNode("div",sh,o.toDisplayString(l.computePosition(i.form||i.currentHourData)),1)]),o.createVNode(n,{class:"mr-n2",density:"comfortable",icon:"",variant:"plain",onClick:o.withModifiers(l.handleCloseMeteo,["stop"])},{default:o.withCtx(()=>e[21]||(e[21]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[21]},8,["onClick"])]),_:1}),o.createVNode(d),o.createVNode(h,{class:"text-body-1 px-0 py-1"},{default:o.withCtx(()=>{var A,x;return[o.createElementVNode("div",ch,[o.createElementVNode("div",mh,o.toDisplayString(t.$t("time.time")),1),o.createElementVNode("div",dh,o.toDisplayString(l.computedTzTime((A=i.currentHourData)==null?void 0:A.utc)),1)]),o.createElementVNode("div",hh,[e[22]||(e[22]=o.createElementVNode("div",{style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},"LT",-1)),o.createElementVNode("div",ph,o.toDisplayString(l.computedLocalTime((x=i.currentHourData)==null?void 0:x.utc)),1)]),o.createElementVNode("div",gh,[o.createElementVNode("div",uh,o.toDisplayString(t.$t("weather.wind")),1),o.createElementVNode("div",fh,o.toDisplayString(i.currentHourData.windDir??"-")+"/"+o.toDisplayString(i.currentHourData.windSpeed??"-")+"kts/BF"+o.toDisplayString(i.currentHourData.windLevel??"-"),1),o.createElementVNode("div",yh,o.toDisplayString(t.$t("weather.sigWave")),1),o.createElementVNode("div",bh,o.toDisplayString(i.currentHourData.sigwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.sigwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.sigwavePeriod??"-")+"s ",1)]),o.createElementVNode("div",wh,[o.createElementVNode("div",xh,o.toDisplayString(t.$t("weather.windWave")),1),o.createElementVNode("div",kh,o.toDisplayString(i.currentHourData.windwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.windwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.windwavePeriod??"-")+"s ",1),o.createElementVNode("div",Ah,o.toDisplayString(t.$t("weather.swell")),1),o.createElementVNode("div",Lh,o.toDisplayString(i.currentHourData.swellDir??"-")+"/"+o.toDisplayString(i.currentHourData.swellHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.swellPeriod??"-")+"s ",1)]),o.createElementVNode("div",Ch,[o.createElementVNode("div",zh,o.toDisplayString(t.$t("weather.current")),1),o.createElementVNode("div",vh,o.toDisplayString(i.currentHourData.currentDir??"-")+"/"+o.toDisplayString(i.currentHourData.currentSpeed??"-")+"kts",1),o.createElementVNode("div",_h,o.toDisplayString(t.$t("weather.visibility")),1),o.createElementVNode("div",Sh,o.toDisplayString(i.currentHourData.visibility??"-")+" nm",1)])]}),_:1}),o.createVNode(d),o.createVNode(f,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>{var A;return[(A=a.followList)!=null&&A.some(x=>{var C,k;return(x==null?void 0:x.id)===i.form.followId||((C=x==null?void 0:x.coordinate)==null?void 0:C.lng)===i.form.lng&&((k=x==null?void 0:x.coordinate)==null?void 0:k.lat)===i.form.lat})?(o.openBlock(),o.createBlock(n,{key:0,id:"idm-gl4-spot-meteo-follow",class:"text-none text-body-1",variant:"text",density:"compact",height:"32",onClick:o.withModifiers(l.handleCancelFollow,["stop"])},{prepend:o.withCtx(()=>e[23]||(e[23]=[o.createElementVNode("i",{class:"iconfont icon-yishoucang text-h6 text-warning"},null,-1)])),default:o.withCtx(()=>[o.createTextVNode(" "+o.toDisplayString(t.$t("actions.unfollow")),1)]),_:1},8,["onClick"])):(o.openBlock(),o.createBlock(n,{key:1,id:"idm-gl4-spot-meteo-unfollow",class:"text-none text-body-1",variant:"text",density:"compact",height:"32",onClick:o.withModifiers(l.handleFollow,["stop"])},{prepend:o.withCtx(()=>e[24]||(e[24]=[o.createElementVNode("i",{class:"iconfont icon-weishoucang text-h6"},null,-1)])),default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.follow"))+" ",1)]),_:1},8,["onClick"])),o.createVNode(n,{height:"32",variant:"text",density:"compact","append-icon":"mdi-chevron-right",class:"text-none text-body-1",onClick:o.withModifiers(l.handleMeteoMore,["stop"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("spot.forecast")),1)]),_:1},8,["onClick"])]}),_:1})]),_:1})):o.createCommentVNode("",!0),i.showMeteo&&a.simple?(o.openBlock(),o.createBlock(b,{key:2,ref:"spotMeteo",class:"position-absolute bottom-0 rounded-t-4",style:{width:"100vw","z-index":"1001"}},{default:o.withCtx(()=>[o.createVNode(s,null,{default:o.withCtx(()=>{var A;return[o.createElementVNode("div",Mh,[o.createElementVNode("div",Nh,[e[25]||(e[25]=o.createElementVNode("i",{class:"iconfont icon-a-Spotweather text-h5 map-icon-aqua"},null,-1)),o.createElementVNode("div",Ph,o.toDisplayString(l.computePosition(i.form||i.currentHourData)),1)]),o.createElementVNode("div",Vh,[(A=a.followList)!=null&&A.some(x=>{var C,k;return(x==null?void 0:x.id)===i.form.followId||((C=x==null?void 0:x.coordinate)==null?void 0:C.lng)===i.form.lng&&((k=x==null?void 0:x.coordinate)==null?void 0:k.lat)===i.form.lat})?(o.openBlock(),o.createBlock(n,{key:0,class:"text-none text-body-1 rounded-circle",variant:"text",density:"compact",height:"32",width:"28","min-width":"28",onClick:o.withModifiers(l.handleCancelFollow,["stop"])},{default:o.withCtx(()=>e[26]||(e[26]=[o.createElementVNode("i",{class:"iconfont icon-yishoucang text-h4 text-warning"},null,-1)])),_:1,__:[26]},8,["onClick"])):(o.openBlock(),o.createBlock(n,{key:1,class:"text-none text-body-1 rounded-circle",variant:"plain",density:"compact",height:"32",width:"28","min-width":"28",onClick:o.withModifiers(l.handleFollow,["stop"])},{default:o.withCtx(()=>e[27]||(e[27]=[o.createElementVNode("i",{class:"iconfont icon-weishoucang text-h4"},null,-1)])),_:1,__:[27]},8,["onClick"])),o.createVNode(n,{class:"mr-n2",density:"comfortable",icon:"",variant:"plain",onClick:o.withModifiers(l.handleCloseMeteo,["stop"])},{default:o.withCtx(()=>e[28]||(e[28]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[28]},8,["onClick"])])]),e[29]||(e[29]=o.createElementVNode("div",{class:"px-5 py-0 text-label text-body-1"},"Spot Weather",-1))]}),_:1,__:[29]}),o.createVNode(d),o.createVNode(h,{class:"text-body-1 px-0 py-2"},{default:o.withCtx(()=>{var A,x;return[o.createElementVNode("div",Th,[o.createElementVNode("div",Eh,o.toDisplayString(t.$t("time.time")),1),o.createElementVNode("div",Rh,o.toDisplayString(l.computedTzTime((A=i.currentHourData)==null?void 0:A.utc)),1)]),o.createElementVNode("div",Dh,[e[30]||(e[30]=o.createElementVNode("div",{style:{width:"60px"},class:"pa-0 pr-2 text-right opacity-50"},"LT",-1)),o.createElementVNode("div",Bh,o.toDisplayString(l.computedLocalTime((x=i.currentHourData)==null?void 0:x.utc)),1)]),o.createElementVNode("div",Ih,[o.createElementVNode("div",Fh,[o.createElementVNode("div",null,[o.createElementVNode("span",Gh,o.toDisplayString(t.$t("weather.wind")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.windDir??"-")+"/"+o.toDisplayString(i.currentHourData.windSpeed??"-")+"kts/BF"+o.toDisplayString(i.currentHourData.windLevel??"-"),1)]),o.createElementVNode("div",null,[o.createElementVNode("span",jh,o.toDisplayString(t.$t("weather.sigWave")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.sigwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.sigwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.sigwavePeriod??"-")+"s",1)]),o.createElementVNode("div",null,[o.createElementVNode("span",Wh,o.toDisplayString(t.$t("weather.windWave")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.windwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.windwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.windwavePeriod??"-")+"s",1)])]),o.createElementVNode("div",Zh,[o.createElementVNode("div",null,[o.createElementVNode("span",Xh,o.toDisplayString(t.$t("weather.swell")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.swellDir??"-")+"/"+o.toDisplayString(i.currentHourData.swellHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.swellPeriod??"-")+"s",1)]),o.createElementVNode("div",null,[o.createElementVNode("span",Hh,o.toDisplayString(t.$t("weather.current")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.currentDir??"-")+"/"+o.toDisplayString(i.currentHourData.currentSpeed??"-")+"kts",1)]),o.createElementVNode("div",null,[o.createElementVNode("span",Oh,o.toDisplayString(t.$t("weather.visibility")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.visibility??"-")+" nm",1)])])])]}),_:1})]),_:1},512)):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",Yh,[(o.openBlock(),o.createElementBlock("svg",Uh,[o.createElementVNode("use",{"xlink:href":`#icon-spot-${a.theme}`},null,8,Jh)]))],512),[[o.vShow,i.showMeteo]])])}const Qh=Y(Jd,[["render",Kh]]),zy="",qh={name:"IdmMeasure",props:{simple:{type:Boolean,default:!1},map:{type:Object},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}}},setup(){return{Theme:fe.useTheme()}},data(){return{right:10,toggle:!1,geojson:[],source:"measure-source",layer:"measure-layer",labelLayer:"measure-label-layer",sumLayer:"measure-suml-layer",tmpSource:"measure-tmp-source",tmpLayer:"measure-tmp-layer",tmpLabelLayer:"measure-tmp-label-layer",closeMarkers:{},pointMarkers:{},tipMarker:void 0,contextmenu:void 0,navigation:"RL",currentLineIndex:1}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})},immediate:!0},toggle:{handler(){var t,e,a;if(this.toggle)this.handleBind();else{(t=this.map)==null||t.getCanvas().removeEventListener("keydown",this.handleKeydown),(e=this.map)==null||e.off("mousemove",this.handleMove),(a=this.map)==null||a.off("dblclick",this.handleDblClick),this.map;let r=this.geojson.find(i=>!i.closed);r&&this.handleClear(r,!0),this.geojson=this.geojson.filter(i=>!!i.closed),r=E.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(r)}},immediate:!0},map:{handler(){this.map&&(this.toggle?this.handleBind():this.handleUnbind())}}},methods:{handleMenuToggle(){this.toggle=!this.toggle},handleBind(){var t,e,a,r,i;(t=this.map)==null||t.getCanvas().addEventListener("keydown",this.handleKeydown),(e=this.map)==null||e.on("mousemove",this.handleMove),(a=this.map)==null||a.on("dblclick",this.handleDblClick),(r=this.map)==null||r.on("click",this.handleClick),(i=this.map)==null||i.on("contextmenu",this.handleContextmenu),this.map&&(this.map.getCanvas().style.cursor="crosshair")},handleUnbind(){var t,e,a,r,i;(t=this.map)==null||t.getCanvas().removeEventListener("keydown",this.handleKeydown),(e=this.map)==null||e.off("mousemove",this.handleMove),(a=this.map)==null||a.off("dblclick",this.handleDblClick),(r=this.map)==null||r.off("click",this.handleClick),(i=this.map)==null||i.off("contextmenu",this.handleContextmenu);for(const l of this.geojson)this.handleClear(l,!0);this.geojson=[],this.map&&(this.map.getCanvas().style.cursor="grab")},handleKeydown(t){if(t.key==="Shift"){this.navigation=this.navigation==="RL"?"GC":"RL";const e=this.geojson.at(-1),a=e.features.filter(r=>r.geometry.type==="Point");a!=null&&a.length&&(a.at(-1).properties.mode=this.navigation),this.handleRender(e)}},handleDrag(t){var a,r,i,l,n,c,s,d,m,p;const e=(r=(a=t.target)==null?void 0:a._element)==null?void 0:r.id;if((e==null?void 0:e.split("-").length)===2){const g=this.geojson.filter(f=>f.id===e.split("-")[0])[0];this.pointMarkers[g.id].filter(f=>{var w;return((w=f._element)==null?void 0:w.id)===e})[0].setLngLat([(l=(i=t.target)==null?void 0:i._lngLat)==null?void 0:l.lng,(c=(n=t.target)==null?void 0:n._lngLat)==null?void 0:c.lat]);let u;g.features.forEach((f,w)=>{if(f.geometry.type==="Point"&&f.properties.id===e.split("-")[1]){u=w;return}});const h=g.features.filter(f=>f.geometry.type==="Point");this.handleTmpPointUpdate(g,h[u-1],{lng:(d=(s=t.target)==null?void 0:s._lngLat)==null?void 0:d.lng,lat:(p=(m=t.target)==null?void 0:m._lngLat)==null?void 0:p.lat,properties:h[u].properties},u===h.length-1?void 0:h[u+1])}},handleDragEnd(t){var a,r,i,l,n,c,s,d,m,p;const e=(r=(a=t.target)==null?void 0:a._element)==null?void 0:r.id;if((e==null?void 0:e.split("-").length)===2){const g=this.geojson.filter(h=>h.id===e.split("-")[0])[0];this.pointMarkers[g.id].filter(h=>{var f;return((f=h._element)==null?void 0:f.id)===e})[0].setLngLat([(l=(i=t.target)==null?void 0:i._lngLat)==null?void 0:l.lng,(c=(n=t.target)==null?void 0:n._lngLat)==null?void 0:c.lat]);const u=g.features.filter(h=>h.geometry.type==="Point"&&h.properties.id===e.split("-")[1])[0];u.geometry.coordinates=[(d=(s=t.target)==null?void 0:s._lngLat)==null?void 0:d.lng,(p=(m=t.target)==null?void 0:m._lngLat)==null?void 0:p.lat],g.features=g.features.filter(h=>h.geometry.type==="Point"),this.handlePointUpdate(g)}},handleContextmenu(t){var a,r,i,l;t.preventDefault(),(a=this.contextmenu)==null||a.remove();const e=(l=(i=(r=t.originalEvent)==null?void 0:r.target)==null?void 0:i.parentElement)==null?void 0:l.id;if((e==null?void 0:e.split("-").length)===2){const c=this.geojson.filter(s=>s.id===e.split("-")[0])[0].features.filter(s=>s.geometry.type==="Point");if(c.length>2&&c.filter(d=>d.properties.id===(e==null?void 0:e.split("-")[1]))[0]){const d=document.createElement("div");d.className="idm-gl4-measure-contextmenu-marker",d.innerHTML=`<span id="del-${e}" class="del-point">${this.$t("actions.detele")}</span>`,this.contextmenu=new ne.Marker(d).setOffset([24,0]).setLngLat([t.lngLat.lng,t.lngLat.lat]).addTo(this.map)}}},handleClick(t){var a,r,i,l,n,c;(a=this.contextmenu)==null||a.remove();const e=t.originalEvent.target.className;if(e==="marker-close"){const s=(i=(r=t.originalEvent)==null?void 0:r.srcElement)==null?void 0:i.id,d=this.geojson.filter(m=>m.id===s)[0];d&&this.handleClear(d,!0),this.geojson=this.geojson.filter(m=>m.id!==s),!this.toggle&&!((l=this.geojson)!=null&&l.some(m=>m.closed))&&this.handleUnbind()}else if(e==="del-point"){const s=(c=(n=t.originalEvent.target.id)==null?void 0:n.replace("del-",""))==null?void 0:c.split("-"),d=this.geojson.filter(m=>m.id===s[0])[0];d.features=d.features.filter(m=>m.geometry.type==="Point"&&m.properties.id!==s[1]),this.handlePointUpdate(d)}else if(e!=="marker-label"&&this.toggle){let s=this.geojson.at(-1);s||(s=E.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(s)),s.features=s.features.filter(m=>m.geometry.type==="Point");const d=E.feature({type:"Point",coordinates:[t.lngLat.lng,t.lngLat.lat]},{id:new Date().getTime().toString(),mode:this.navigation,sumLabel:"Start"});s.features.push(d),this.handlePointUpdate(s)}},handlePointUpdate(t){const e=t.features;if(e.length>1){let a=0;const r=[];for(let i=1;i<e.length;i++){const l=e[i-1],n=e[i],c=l.properties,s={lng:l.geometry.coordinates[0],lat:l.geometry.coordinates[1]},d={lng:n.geometry.coordinates[0],lat:n.geometry.coordinates[1]},m=N.LaneHelper.calculateDistance(s,d,c.mode==="RL",4),p=N.LaneHelper.calculateBearing(s,d,c.mode==="RL",2);a=N.LngLatHelper.roundPrecision(a+m,4);let g;c.mode==="RL"?g=N.LngLatHelper.convertToMonotonicLng([s,d]):g=N.LngLatHelper.convertToMonotonicLng(N.LaneHelper.interpolateCoordinates(s,d,200));const y=E.lineString(g.map(h=>[h.lng,h.lat]));y.properties.dist=m,y.properties.bearing=p,y.properties.total=a,y.properties.name="Line "+this.currentLineIndex,r.push(y);const u=e[i];u.properties.totalDist=N.LngLatHelper.roundPrecision((c.totalDist?c.totalDist:0)+m,4),u.properties.sumLabel=u.properties.totalDist+" nm"}e.push(...r),t.total=a}return this.handleRender(t),t},handleTmpPointUpdate(t,e,a,r){const i=E.featureCollection([]);let l,n;if(e){const s=e.properties,d={lng:e.geometry.coordinates[0],lat:e.geometry.coordinates[1]},m={lng:a.lng,lat:a.lat};l=N.LaneHelper.calculateDistance(d,m,s.mode==="RL",4),n=N.LaneHelper.calculateBearing(d,m,s.mode==="RL",2);let p;s.mode==="RL"?p=N.LngLatHelper.convertToMonotonicLng([d,m]):p=N.LngLatHelper.convertToMonotonicLng(N.LaneHelper.interpolateCoordinates(d,m,200));const g=E.lineString(p.map(y=>[y.lng,y.lat]));g.properties.dist=l,g.properties.bearing=n,i.features.push(g)}if(r){const s=a.properties,d=a,m={lng:r.geometry.coordinates[0],lat:r.geometry.coordinates[1]};l=N.LaneHelper.calculateDistance(d,m,s.mode==="RL",4),n=N.LaneHelper.calculateBearing(d,m,s.mode==="RL",2);let p;s.mode==="RL"?p=N.LngLatHelper.convertToMonotonicLng([d,m]):p=N.LngLatHelper.convertToMonotonicLng(N.LaneHelper.interpolateCoordinates(d,m,200));const g=E.lineString(p.map(y=>[y.lng,y.lat]));g.properties.dist=l,g.properties.bearing=n,i.features.push(g)}this.map.getSource(this.tmpSource)?this.map.getSource(this.tmpSource).setData(i):this.map.addSource(this.tmpSource,{type:"geojson",data:i}),this.map.getLayer(this.tmpLayer)||this.map.addLayer({id:this.tmpLayer,type:"line",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.Theme.current.value.colors["map-orange"],"line-width":2,"line-opacity":1,"line-dasharray":[3,2]}}),this.map.getLayer(this.tmpLabelLayer)||this.map.addLayer({id:this.tmpLabelLayer,type:"symbol",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist}nm / {bearing}°","text-rotation-alignment":"map","text-size":11,"text-offset":[0,-1]},paint:{"text-opacity":1,"text-color":this.Theme.current.value.colors["on-surface"]}});let c;if(r)c=`<div class="marker-label">${this.$t("measure.dragTips")}</div>`;else{const s=N.LngLatHelper.roundPrecision((t.total??0)+l,1);c=`<div class="marker-label">${this.$t("measure.totalDistance")}: <b>${s}</b>nm, ${this.$t("measure.bearing")}: <b>${n}</b>°</div><div class="marker-label"> ${this.$t("measure.mode")}${this.navigation==="RL"?"RL":"GC"}, ${this.$t("measure.switchTips")}</div><div class="marker-label">${this.$t("measure.clickTips")}</div>`}if(this.tipMarker)this.tipMarker._element.innerHTML=c,this.tipMarker.setLngLat([a.lng,a.lat]);else{const s=document.createElement("div");s.className="idm-gl4-measure-tip-marker",s.innerHTML=c,this.tipMarker=new ne.Marker(s).setOffset([140,0]).setLngLat([a.lng,a.lat]).addTo(this.map)}},handleMove(t){this.map.getCanvas().style.cursor="crosshair";let e=this.geojson.at(-1);e||(e=E.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e));const a=e.features.filter(r=>r.geometry.type==="Point");a!=null&&a.length&&this.handleTmpPointUpdate(e,a.at(-1),{lng:t.lngLat.lng,lat:t.lngLat.lat})},handleDblClick(t){t.preventDefault();let e=this.geojson.at(-1);e.closed=!0,this.handleRender(e),e=E.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e),this.currentLineIndex++},handleRender(t){var e;if((e=t==null?void 0:t.features)!=null&&e.length){const a=`${t.id}-${this.source}`,r=`${t.id}-${this.layer}`,i=`${t.id}-${this.labelLayer}`,l=`${t.id}-${this.sumLayer}`;this.map.getSource(a)?this.map.getSource(a).setData(t):this.map.addSource(a,{type:"geojson",data:t}),this.handleClear(t,!1),this.map.addLayer({id:r,type:"line",source:a,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.Theme.current.value.colors["map-orange"],"line-width":2}}),this.map.addLayer({id:i,type:"symbol",source:a,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist}nm / {bearing}°","text-rotation-alignment":"map","text-size":11,"text-offset":[0,-1]},paint:{"text-opacity":1,"text-color":this.Theme.current.value.colors["on-surface"]}}),this.map.addLayer({id:l,type:"symbol",source:a,filter:["==","$type","Point"],layout:{"text-field":"{sumLabel}","text-rotation-alignment":"map","text-size":12,"text-offset":[0,1.5]},paint:{"text-opacity":1,"text-color":this.Theme.current.value.colors["on-surface"]}});const n=t.features.filter(c=>c.geometry.type==="Point");for(const c of n){const s=document.createElement("div");s.id=`${t.id}-${c.properties.id}`,s.className=`${t.closed?"idm-gl4-measure-marker closed":"idm-gl4-measure-marker"}`,s.innerHTML='<div class="marker-circle"></div>';const d=new ne.Marker({element:s,draggable:!0,contextmenu:!0}).setLngLat(c.geometry.coordinates).addTo(this.map);d.on("drag",this.handleDrag),d.on("dragend",this.handleDragEnd),this.pointMarkers[t.id]?this.pointMarkers[t.id].push(d):this.pointMarkers[t.id]=[d]}if(t.closed){const c=n.at(-1),d=t.features.filter(p=>p.geometry.type==="LineString").at(-1),m=document.createElement("div");m.className="idm-gl4-measure-summary-marker",m.innerHTML=`<div class="marker-label">${d.properties.name}</div><div id="${t.id}" class="marker-close">X</div>`,this.closeMarkers[t.id]=new ne.Marker(m).setOffset([0,-30]).setLngLat(c.geometry.coordinates).addTo(this.map)}}},handleClear(t,e=!0){var n,c,s,d,m,p,g,y,u,h;const a=`${t.id}-${this.source}`,r=`${t.id}-${this.layer}`,i=`${t.id}-${this.labelLayer}`,l=`${t.id}-${this.sumLayer}`;(n=this.map)!=null&&n.getLayer(r)&&this.map.removeLayer(r),(c=this.map)!=null&&c.getLayer(i)&&this.map.removeLayer(i),(s=this.map)!=null&&s.getLayer(l)&&this.map.removeLayer(l),(d=this.map)!=null&&d.getLayer(this.tmpLayer)&&this.map.removeLayer(this.tmpLayer),(m=this.map)!=null&&m.getLayer(this.tmpLabelLayer)&&this.map.removeLayer(this.tmpLabelLayer),(p=this.closeMarkers[t.id])==null||p.remove(),this.closeMarkers[t.id]=void 0,(g=this.pointMarkers[t.id])==null||g.forEach(f=>{f==null||f.remove()}),this.pointMarkers[t.id]=[],(y=this.tipMarker)==null||y.remove(),this.tipMarker=void 0,e&&((u=this.map)!=null&&u.getSource(a))&&this.map.removeSource(a),e&&((h=this.map)!=null&&h.getSource(this.tmpSource))&&this.map.removeSource(this.tmpSource)}}},$h={class:"idm-gl4-measure"};function ep(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip");return o.openBlock(),o.createElementBlock("div",$h,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+166+"px",right:i.right+"px"})},[o.createVNode(c,{text:t.$t("measure.measure"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:s})=>[o.createVNode(n,o.mergeProps(s,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>e[0]||(e[0]=[o.createElementVNode("i",{class:"iconfont icon-a-Measuredistance text-h4"},null,-1)])),_:2,__:[0]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4)])}const tp=Y(qh,[["render",ep]]),vy="",op={name:"IdmDrawMarker",props:{map:{type:Object},gateway:{type:String},token:{type:String},simple:{type:Boolean,default:!1},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:()=>({})},editLayer:{type:Object,default:null},group:{type:Object,default:()=>({})}},emits:["close","save","hideLayer"],setup(){return{Theme:fe.useTheme()}},data(){var t;return{markerType:"Point",form:{latDegree:"",latMinute:"",latDir:"N",lngDegree:"",lngMinute:"",lngDir:"E",areaType:"Polygon",color:(t=this.Theme.current.value.colors)==null?void 0:t["map-green"],name:""},formRules:{lngDegree:[e=>e!=null&&e!==""||"required",e=>/^\d{1,3}$/.test(e)||"number",e=>parseInt(e)>=0&&parseInt(e)<=180||"0 ~ 180"],lngMinute:[e=>e==null||e===""||/^\d{1,2}(\.\d+)?$/.test(e)||"number",e=>e==null||e===""||parseInt(e)>=0&&parseInt(e)<=59||"0 ~ 59"],latDegree:[e=>e!=null&&e!==""||"required",e=>/^\d{1,2}$/.test(e)||"number",e=>parseInt(e)>=0&&parseInt(e)<=90||"0 ~ 90"],latMinute:[e=>e==null||e===""||/^\d{1,2}(\.\d+)?$/.test(e)||"number",e=>e==null||e===""||parseInt(e)>=0&&parseInt(e)<=59||"0 ~ 59"],color:[e=>e!=null&&e!==""||"required"],name:[e=>e!=null&&e!==""||"required"]},saving:!1,drawSource:"draw-marker-source",drawPointLayer:"draw-marker-point-layer",drawLineLayer:"draw-marker-line-layer",drawFillLayer:"draw-marker-fill-layer",drawTmpSource:"draw-marker-tmp-source",drawTmpLayer:"draw-marker-tmp-layer",drawCoords:[],rectCornerMarkers:[],polygonVertexMarkers:[],circleMarkers:[],drawRadiusSource:"draw-marker-radius-source",drawRadiusLayer:"draw-marker-radius-layer",tipMarker:null,pointMarker:null,pointHighlightMarker:null,editMarkers:[],deleteBtn:null,originalProperties:{}}},watch:{markerType:{handler(){var t;(t=this.editLayer)!=null&&t.id||(this.markerType==="Area"?this.form.name=`${this.form.areaType} 1`:this.form.name=`${this.markerType} 1`,this.handleClearDraw())},immediate:!0},"form.areaType"(){var t;(t=this.editLayer)!=null&&t.id||(this.markerType==="Area"?this.form.name=`${this.form.areaType} 1`:this.form.name=`${this.markerType} 1`,this.handleClearDraw())},map:{handler(){var t;this.map&&(this.handleBindMap(),(t=this.editLayer)!=null&&t.id&&this.loadEditLayer())},immediate:!0},"form.color":{handler(){this.handleChangePoint(),this.handleUpdateLayerColors()},immediate:!0}},beforeUnmount(){this.handleClearDraw(!0),this.handleUnbindMap()},methods:{handleClose(){this.handleClearDraw(!0),this.handleUnbindMap(),this.$emit("close")},handleBindMap(){var t,e;this.map&&(this.markerType==="Point"?(this.map.on("click",this.handleMapClickPoint),this.map.getCanvas().style.cursor="crosshair"):this.markerType==="Line"&&!((t=this.editLayer)!=null&&t.id)?(this.map.on("click",this.handleMapClickLine),this.map.on("mousemove",this.handleMapMoveLine),this.map.on("dblclick",this.handleMapDblClickLine),this.map.getCanvas().style.cursor="crosshair"):this.markerType==="Area"&&!((e=this.editLayer)!=null&&e.id)&&(this.form.areaType==="Polygon"?(this.map.on("click",this.handleMapClickPolygon),this.map.on("mousemove",this.handleMapMovePolygon),this.map.on("dblclick",this.handleMapDblClickPolygon)):this.form.areaType==="Circle"?(this.map.on("click",this.handleMapClickCircle),this.map.on("mousemove",this.handleMapMoveCircle)):this.form.areaType==="Rect"&&(this.map.on("click",this.handleMapClickRect),this.map.on("mousemove",this.handleMapMoveRect)),this.map.getCanvas().style.cursor="crosshair"))},handleUnbindMap(){this.map&&(this.map.off("click",this.handleMapClickPoint),this.map.off("click",this.handleMapClickLine),this.map.off("mousemove",this.handleMapMoveLine),this.map.off("dblclick",this.handleMapDblClickLine),this.map.off("click",this.handleMapClickPolygon),this.map.off("mousemove",this.handleMapMovePolygon),this.map.off("dblclick",this.handleMapDblClickPolygon),this.map.off("click",this.handleMapClickCircle),this.map.off("mousemove",this.handleMapMoveCircle),this.map.off("click",this.handleMapClickRect),this.map.off("mousemove",this.handleMapMoveRect),this.map.getCanvas().style.cursor="grab")},handleRebindMap(){this.handleUnbindMap(),this.handleBindMap()},loadEditLayer(){var i,l,n,c,s,d;if(!((i=this.editLayer)!=null&&i.extend)||!this.map)return;const t=typeof this.editLayer.extend=="string"?JSON.parse(this.editLayer.extend):this.editLayer.extend;if(!t)return;const a=(t.features||(t.type==="Feature"?[t]:[]))[0];if(!a)return;this.originalProperties=a.properties||{},this.form.name=this.editLayer.name||"",this.form.color=this.editLayer.color||((l=this.originalProperties)==null?void 0:l.color)||((n=this.Theme.current.value.colors)==null?void 0:n["map-green"])||"#4CAF50";const r=(c=a.geometry)==null?void 0:c.type;if(r==="Point"){this.markerType="Point";const[m,p]=a.geometry.coordinates;this.drawCoords=[[m,p]],this.form.latDegree=Number(N.LngLatHelper.lat2pretty(p).degree),this.form.latMinute=Number(N.LngLatHelper.lat2pretty(p).minute),this.form.latDir=N.LngLatHelper.lat2pretty(p).direction,this.form.lngDegree=Number(N.LngLatHelper.lng2pretty(m).degree),this.form.lngMinute=Number(N.LngLatHelper.lng2pretty(m).minute),this.form.lngDir=N.LngLatHelper.lng2pretty(m).direction,this.handleRenderPoint(this.drawCoords,this.form.color),this.setupPointEdit()}else r==="LineString"?(this.markerType="Line",this.$nextTick(()=>{this.handlerRenderEditLine(a),this.setupLineEdit(),this.handleUnbindMap()})):r==="Polygon"&&(this.markerType="Area",this.form.areaType=(d=(s=this.originalProperties)==null?void 0:s.shape)==null?void 0:d.toLowerCase(),this.$nextTick(()=>{this.handlerRenderEditPolygon(t),this.setupPolygonEdit(a),this.handleUnbindMap()}));this.$emit("hideLayer",this.editLayer.id)},setupPointEdit(){var a;if(!this.pointMarker)return;this.pointMarker.setDraggable(!0),this.pointMarker.off("drag",this.handlePointDrag),this.pointMarker.on("drag",this.handlePointDrag),this.pointMarker.off("dragend",this.handlePointDrag),this.pointMarker.on("dragend",this.handlePointDrag),(a=this.pointHighlightMarker)==null||a.remove();const t=document.createElement("div");t.className="idm-gl4-point-center-ring";const e=this.pointMarker.getLngLat();this.pointHighlightMarker=new ne.Marker({element:t,anchor:"center",offset:[0,0]}).setLngLat(e).addTo(this.map),this.pointMarker.on("drag",()=>{var r;(r=this.pointHighlightMarker)==null||r.setLngLat(this.pointMarker.getLngLat())})},handlePointDrag(){const{lng:t,lat:e}=this.pointMarker.getLngLat();this.drawCoords=[[t,e]],this.form.latDegree=Number(N.LngLatHelper.lat2pretty(e).degree),this.form.latMinute=Number(N.LngLatHelper.lat2pretty(e).minute),this.form.latDir=N.LngLatHelper.lat2pretty(e).direction,this.form.lngDegree=Number(N.LngLatHelper.lng2pretty(t).degree),this.form.lngMinute=Number(N.LngLatHelper.lng2pretty(t).minute),this.form.lngDir=N.LngLatHelper.lng2pretty(t).direction},clearEditMarkers(){this.editMarkers.forEach(t=>t.remove()),this.editMarkers=[],this._edgeContextMenuHandler&&this.map&&(this.map.off("contextmenu",this._edgeContextMenuHandler),this._edgeContextMenuHandler=null)},handlerRenderEditLine(t){this.drawCoords=t.geometry.coordinates.map(r=>[...r]);const e=E.featureCollection([t,...this.drawCoords.map(r=>E.point(r))]);this.handleSetDrawSource(e);const a=3;this.map.getLayer(this.drawLineLayer)||this.map.addLayer({id:this.drawLineLayer,type:"line",source:this.drawSource,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":a}})},setupLineEdit(){this.clearEditMarkers(),this.drawCoords.forEach((e,a)=>{const r=document.createElement("div");r.className="idm-gl4-edit-vertex",r.style.backgroundColor=this.form.color;const i=new ne.Marker({element:r,draggable:!0}).setLngLat(e).addTo(this.map);i.on("dragstart",()=>{this.map.getCanvas().style.cursor="pointer";const{lng:l,lat:n}=i.getLngLat();this.handleRenderVertexLabel([l,n],40)}),i.on("drag",()=>{this.map.getCanvas().style.cursor="pointer";const{lng:l,lat:n}=i.getLngLat();this.handleUpdateVertexLabel([l,n]),this.drawCoords[a]=[l,n],this.handlerRenderEditLine(E.lineString(this.drawCoords,{type:"Line",color:this.form.color}))}),i.on("dragend",()=>{this.map.getCanvas().style.cursor="grab";const{lng:l,lat:n}=i.getLngLat();this.drawCoords[a]=[l,n],this.handlerRenderEditLine(E.lineString(this.drawCoords,{type:"Line",color:this.form.color})),this.handleClearVertexLabels()}),r.addEventListener("contextmenu",l=>{l.preventDefault(),l.stopPropagation(),this.drawCoords.length>2&&this.showDeleteButton(e,()=>{this.drawCoords.splice(a,1),this.handlerRenderEditLine(E.lineString(this.drawCoords,{type:"Line",color:this.form.color})),this.setupLineEdit()})}),this.editMarkers.push(i)});const t=e=>{e.preventDefault();const{lng:a,lat:r}=e.lngLat,i=E.point([a,r]),l=E.lineString(this.drawCoords),n=E.nearestPointOnLine(l,i);if(n){const c=n.properties.index;this.showDeleteButton([a,r],()=>{this.drawCoords.splice(c+1,0,[a,r]),this.handlerRenderEditLine(E.lineString(this.drawCoords,{type:"Line",color:this.form.color})),this.setupLineEdit()},this.$t("actions.add")||"新增","add")}};this.map.on("contextmenu",t),this._edgeContextMenuHandler=t},showDeleteButton(t,e,a,r="delete"){this.hideDeleteButton();const i=this.map.getContainer(),l=document.createElement("button");l.textContent=a||this.$t("actions.delete"),l.className=r==="add"?"idm-gl4-edit-add-btn":"idm-gl4-edit-delete-btn";const n=this.map.project(t);l.style.left=`${n.x}px`,l.style.top=`${n.y}px`;const c=s=>{s.stopPropagation(),e(),this.hideDeleteButton()};l.addEventListener("click",c),i.appendChild(l),this.deleteBtn=l,this.map.once("click",()=>this.hideDeleteButton())},hideDeleteButton(){this.deleteBtn&&(this.deleteBtn.remove(),this.deleteBtn=null)},handlerRenderEditPolygon(t){this.handleSetDrawSource(t);const e=3;this.map.getLayer(this.drawFillLayer)?(this.map.setPaintProperty(this.drawLineLayer,"line-width",e),this.map.getLayer(this.drawPointLayer)&&this.map.setPaintProperty(this.drawPointLayer,"circle-color",this.form.color)):(this.map.addLayer({id:this.drawFillLayer,type:"fill",source:this.drawSource,filter:["==","$type","Polygon"],paint:{"fill-color":this.form.color,"fill-opacity":.35}}),this.map.addLayer({id:this.drawLineLayer,type:"line",source:this.drawSource,filter:["==","$type","Polygon"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":e}}),this.map.addLayer({id:this.drawPointLayer,type:"circle",source:this.drawSource,filter:["==","$type","Point"],paint:{"circle-radius":3,"circle-color":this.form.color,"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}}))},setupPolygonEdit(t){this.clearEditMarkers();const e=t.geometry.coordinates[0].slice(0,-1);this.drawCoords=e.map(r=>[...r]),this.drawCoords.forEach((r,i)=>{const l=document.createElement("div");l.className="idm-gl4-edit-vertex",l.style.backgroundColor=this.form.color;const n=new ne.Marker({element:l,draggable:!0}).setLngLat(r).addTo(this.map);n.on("dragstart",()=>{this.map.getCanvas().style.cursor="pointer";const{lng:c,lat:s}=n.getLngLat();this.handleRenderVertexLabel([c,s])}),n.on("drag",()=>{this.map.getCanvas().style.cursor="pointer";const{lng:c,lat:s}=n.getLngLat();this.handleUpdateVertexLabel([c,s]),this.drawCoords[i]=[c,s],this.handleRenderPolygonFill(this.drawCoords)}),n.on("dragend",()=>{this.map.getCanvas().style.cursor="grab";const{lng:c,lat:s}=n.getLngLat();this.drawCoords[i]=[c,s],this.handleRenderPolygonFill(this.drawCoords),this.handleClearVertexLabels()}),l.addEventListener("contextmenu",c=>{c.preventDefault(),c.stopPropagation(),this.drawCoords.length>3&&this.showDeleteButton(r,()=>{this.drawCoords.splice(i,1),this.handleRenderPolygonFill(this.drawCoords),this.handleClearVertexLabels(),this.setupPolygonEdit({geometry:{type:"Polygon",coordinates:[[...this.drawCoords,this.drawCoords[0]]]},properties:this.originalProperties})})}),this.editMarkers.push(n)});const a=r=>{r.preventDefault();const{lng:i,lat:l}=r.lngLat,n=E.point([i,l]),c=E.lineString([...this.drawCoords,this.drawCoords[0]]),s=E.nearestPointOnLine(c,n);if(s){const d=s.properties.index,m=d>=this.drawCoords.length-1?this.drawCoords.length-1:d;this.showDeleteButton([i,l],()=>{this.drawCoords.splice(m+1,0,[i,l]),this.handleRenderPolygonFill(this.drawCoords),this.handleClearVertexLabels(),this.setupPolygonEdit({geometry:{type:"Polygon",coordinates:[[...this.drawCoords,this.drawCoords[0]]]},properties:this.originalProperties})},this.$t("actions.add")||"新增","add")}};this.map.on("contextmenu",a),this._edgeContextMenuHandler=a},handleMapClickPoint(t){var r;const{lng:e,lat:a}=t.lngLat;this.drawCoords=[[e,a]],this.form.latDegree=Number(N.LngLatHelper.lat2pretty(a).degree),this.form.latMinute=Number(N.LngLatHelper.lat2pretty(a).minute),this.form.latDir=N.LngLatHelper.lat2pretty(a).direction,this.form.lngDegree=Number(N.LngLatHelper.lng2pretty(e).degree),this.form.lngMinute=Number(N.LngLatHelper.lng2pretty(e).minute),this.form.lngDir=N.LngLatHelper.lng2pretty(e).direction,this.handleRenderPoint(this.drawCoords,this.form.color),(r=this.editLayer)!=null&&r.id&&this.setupPointEdit()},handleChangePoint(){var g;const{latDegree:t,latMinute:e,latDir:a,lngDegree:r,lngMinute:i,lngDir:l}=this.form,n=parseFloat(t),c=parseFloat(e),s=parseFloat(r),d=parseFloat(i);if(isNaN(n)||isNaN(s))return;const m=(n+(isNaN(c)?0:c)/60)*(a==="S"?-1:1),p=(s+(isNaN(d)?0:d)/60)*(l==="W"?-1:1);this.drawCoords=[[p,m]],this.handleRenderPoint(this.drawCoords,this.form.color),(g=this.editLayer)!=null&&g.id&&this.setupPointEdit()},handleRenderPoint(t,e){var i;if((i=this.pointMarker)==null||i.remove(),!t||!t.length)return;const[a,r]=t[0];this.pointMarker=new ne.Marker({color:e}).setLngLat([a,r]).addTo(this.map)},handleMapClickLine(t){var r;const{lng:e,lat:a}=t.lngLat;this.drawCoords.push([e,a]),this.handleRenderLine(this.drawCoords),(r=this.editLayer)!=null&&r.id&&this.setupLineEdit()},handleMapMoveLine(t){if(!this.drawCoords.length)return;const{lng:e,lat:a}=t.lngLat;this.handleRenderTmpLine(this.drawCoords.at(-1),[e,a])},handleMapDblClickLine(t){t.preventDefault(),this.drawCoords.length>1&&this.drawCoords.pop(),this.handleRenderLine(this.drawCoords),this.handleClearTmp(),this.map.off("click",this.handleMapClickLine),this.map.off("mousemove",this.handleMapMoveLine),this.map.off("dblclick",this.handleMapDblClickLine)},handleRenderLine(t){if(!t||t.length<1)return;const e=[];t==null||t.forEach((i,l)=>{e.push(N.GeoJsonHelper.drawPoint(i==null?void 0:i[1],i==null?void 0:i[0]))}),(t==null?void 0:t.length)>=2&&e.push(N.GeoJsonHelper.drawLine(t));const a=2,r=E.featureCollection(e);this.handleSetDrawSource(r),this.map.getLayer(this.drawLineLayer)?(this.map.setPaintProperty(this.drawLineLayer,"line-color",this.form.color),this.map.setPaintProperty(this.drawLineLayer,"line-width",a),this.map.getLayer(this.drawPointLayer)&&this.map.setPaintProperty(this.drawPointLayer,"circle-color",this.form.color)):(this.map.addLayer({id:this.drawLineLayer,type:"line",source:this.drawSource,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":a}}),this.map.addLayer({id:this.drawPointLayer,type:"circle",source:this.drawSource,filter:["==","$type","Point"],paint:{"circle-radius":3,"circle-color":this.form.color,"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}}))},handleRenderTmpLine(t,e){const a=N.GeoJsonHelper.drawLine([t,e]),r=E.featureCollection([a]);this.map.getSource(this.drawTmpSource)?this.map.getSource(this.drawTmpSource).setData(r):this.map.addSource(this.drawTmpSource,{type:"geojson",data:r}),this.map.getLayer(this.drawTmpLayer)||this.map.addLayer({id:this.drawTmpLayer,type:"line",source:this.drawTmpSource,layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":2,"line-dasharray":[3,2]}});const i={lng:t[0],lat:t[1]},l={lng:e[0],lat:e[1]},n=N.LaneHelper.calculateDistance(i,l,!0,2),c=N.LaneHelper.calculateBearing(i,l,!0,2);let s=0;for(let m=1;m<this.drawCoords.length;m++){const p={lng:this.drawCoords[m-1][0],lat:this.drawCoords[m-1][1]},g={lng:this.drawCoords[m][0],lat:this.drawCoords[m][1]};s+=N.LaneHelper.calculateDistance(p,g,!0,4)}s=N.LngLatHelper.roundPrecision(s+n,1);const d=`
|
|
217
|
+
</svg>`,he=document.createElement("div");he.className="idm-tropical-gl4-hourly-marker",he.innerHTML=`<div class="${S.geometry.coordinates[1]>=0?"center north":"center south"}">${re}</div>`;const ge=new ne.Marker(he).setLngLat(S.geometry.coordinates).addTo(this.map);this.interpolateMarkers.push(ge)}this.$emit("tropicalCenterPoints",X)}else(M=this.map)!=null&&M.getSource(this.interpolateSource)&&((F=this.map)==null||F.getSource(this.interpolateSource).setData(this.empty))},handleClick(t){var i,l,n,c,s,d,m,p,g,y,u;const e=t.features[0],a=(l=(i=this.tropicals)==null?void 0:i.data)==null?void 0:l.features.filter(h=>{var f;return h.geometry.type==="LineString"&&h.properties.type==="forecast"&&h.properties.name===((f=e==null?void 0:e.properties)==null?void 0:f.name)}),r=(c=(n=this.tropicals)==null?void 0:n.data)==null?void 0:c.features.filter(h=>{var f;return h.geometry.type==="LineString"&&h.properties.type==="history"&&h.properties.name===((f=e==null?void 0:e.properties)==null?void 0:f.name)});this.activeTropicals={name:((s=e==null?void 0:e.properties)==null?void 0:s.name)||"-",nameCn:((d=e==null?void 0:e.properties)==null?void 0:d.nameCn)||((m=e==null?void 0:e.properties)==null?void 0:m.name)||"-",Name:((p=e==null?void 0:e.properties)==null?void 0:p.Name)||"-",forecasts:a.map(h=>h.properties),history:(g=r[0])==null?void 0:g.properties,showCircle:(u=(y=a[0])==null?void 0:y.properties)==null?void 0:u.showCircle},this.showTropicalsInfo=!0,this.simple||this.drawTropicalsInfoMaker([t.lngLat.lng,t.lngLat.lat])},drawTropicalsInfoMaker(t){this.$nextTick(()=>{const e=document.getElementById("idm-tropical-gl4-info");this.activeTropicalsMarker?this.activeTropicalsMarker.setLngLat(t).setOffset([220,0]):this.activeTropicalsMarker=new ne.Marker(e).setLngLat(t).setOffset([220,0]).addTo(this.map)})},handleCloseInfoMarker(){this.showTropicalsInfo=!1,this.$nextTick(()=>{var t;(t=this.activeTropicalsMarker)==null||t.remove(),this.activeTropicalsMarker=void 0})},handleForecastToggle(t){var r,i,l,n,c,s;t.disabled=!t.disabled;const e=`${t.name}-${t.model}`,a=(i=(r=this.map)==null?void 0:r.getSource(this.source)._data)==null?void 0:i.features;a.forEach(d=>{d.properties.category===e&&(d.properties.disabled=t.disabled)}),this.interpolateData.forEach(d=>{d.properties.category===e&&(d.properties.disabled=t.disabled)}),(n=(l=this.map)==null?void 0:l.getSource(this.source))==null||n.setData(E.featureCollection(a)),(s=(c=this.map)==null?void 0:c.getSource(this.clusterSource))==null||s.setData(E.featureCollection(a)),this.handleDateChange()},handleStrikeProbability(t){this.$emit("tropicalProbability",t)},handleToggleCircles(t){var e,a;t.showCircle=!t.showCircle,(a=(e=this.tropicals.data)==null?void 0:e.features)==null||a.forEach(r=>{r.properties.name===t.name&&(r.properties.showCircle=t.showCircle)}),this.handleRender()},handleComputePolygons(t){const e=[];for(const a of t){const r=a.properties.wind,i={ne:r.r7ne>=0?r.r7ne:void 0,se:r.r7se>=0?r.r7se:void 0,sw:r.r7sw>=0?r.r7sw:void 0,nw:r.r7nw>=0?r.r7nw:void 0},l=this.handleComputeArc(a.geometry.coordinates,i,{...a.properties,level:7});e.push(l);const n={ne:r.r10ne>=0?r.r10ne:void 0,se:r.r10se>=0?r.r10se:void 0,sw:r.r10sw>=0?r.r10sw:void 0,nw:r.r10nw>=0?r.r10nw:void 0},c=this.handleComputeArc(a.geometry.coordinates,n,{...a.properties,level:10});e.push(c)}return e},handleComputeArc(t,e,a){var l;const r=[];for(const n in e){const c=e[n]??0;let s;switch(n){case"ne":s=E.lineArc(t,c,0,90,{steps:c>0?32:1,units:"nauticalmiles"});break;case"se":s=E.lineArc(t,c,90,180,{steps:c>0?32:1,units:"nauticalmiles"});break;case"sw":s=E.lineArc(t,c,180,270,{steps:c>0?32:1,units:"nauticalmiles"});break;case"nw":s=E.lineArc(t,c,270,360,{steps:c>0?32:1,units:"nauticalmiles"});break}r.push(...(l=s==null?void 0:s.geometry)==null?void 0:l.coordinates)}const i=E.lineString(r);return E.lineToPolygon(i,{properties:a})},handleNotification(t){this.$emit("tropicalNotification",t)},handleHover(t){var i,l,n,c,s;this.map.getCanvas().style.cursor="pointer";const a=this.map.queryRenderedFeatures(t.point,{layers:[this.pointCircleLayer,this.pointCircleLayer+"-border",this.historyPointCircleLayer,this.historyPointCircleLayer+"-border",this.historyPointCircleLayer+"-inner"]})[0];this.hoverPoint=a==null?void 0:a.properties;const r=(l=(i=this.tropicals)==null?void 0:i.data)==null?void 0:l.features.filter(d=>{var m;return d.geometry.type==="LineString"&&d.properties.type==="forecast"&&d.properties.name===((m=a==null?void 0:a.properties)==null?void 0:m.name)});this.hoverPoint&&(this.hoverPoint.lng=a.geometry.coordinates[0],this.hoverPoint.lat=a.geometry.coordinates[1],this.hoverPoint.update=(c=(n=r==null?void 0:r[0])==null?void 0:n.properties)==null?void 0:c.date,(s=this.hoverMarker)==null||s.remove(),this.showHoverPoint=!0,this.$nextTick(()=>{const d=document.getElementById("tropicalHoverMarkerInfo").cloneNode(!0);this.hoverMarker=new ne.Marker(d).setLngLat(a.geometry.coordinates).setOffset([160,0]).addTo(this.map)}))},handleLeave(){var t;this.map.getCanvas().style.cursor="grab",this.showHoverPoint=!1,(t=this.hoverMarker)==null||t.remove(),this.hoverMarker=void 0}}},sm={class:"idm-tropical-gl4"},cm={class:"pb-1"},mm={class:"text-h5 font-weight-600"},dm={key:0,class:"text-h5 font-weight-600"},hm={class:"text-body-1"},pm={class:"text-label"},gm={class:"d-flex justify-space-between align-center"},um={class:"w-60"},fm={class:"text-label pr-1"},ym={class:"flex-1-1-0"},bm={class:"text-label pr-1"},wm={class:"py-2 d-flex justify-space-between align-center"},xm={class:"w-60"},km={class:"text-label pr-1"},Am={class:"flex-1-1-0"},Lm={class:"text-label pr-1"},Cm={class:"d-flex align-center flex-1-1-100 justify-space-between mt-n1"},zm={class:"text-label pr-1",style:{width:"70px"}},vm={class:"model-box d-flex justify-end align-center flex-wrap ga-1 pa-1"},_m={class:"more"},Sm={key:0,class:"w-100 d-flex justify-space-between align-center px-2"},Mm={class:"pa-1"},Nm={class:"legend d-flex justify-start align-center py-2"},Pm={class:"label"},Vm={class:"legend d-flex justify-start align-center py-2"},Tm={class:"label"},Em={class:"legend d-flex justify-start align-center py-2"},Rm={class:"label"},Dm={class:"pa-1"},Bm={class:"legend d-flex justify-start align-center py-2"},Im={class:"label"},Fm={class:"legend d-flex justify-start align-center py-2"},Gm={class:"label"},jm={class:"legend d-flex justify-start align-center py-2"},Wm={class:"label"},Zm={class:"pa-1"},Xm={class:"w-100 legend d-flex justify-start align-center py-2 ga-2"},Hm={class:"label"},Om={class:"label"},Ym={class:"w-100 legend d-flex justify-start align-center py-2"},Um={class:"label"},Jm={class:"w-100 legend d-flex justify-start align-center py-2"},Km={class:"label"},Qm={key:1,class:"my-3 w-100",style:{height:"80px"}},qm={class:"legend d-flex justify-start align-center"},$m={class:"label"},ed={class:"legend d-flex justify-start align-center"},td={class:"label"},od={class:"legend d-flex justify-start align-center"},ad={class:"label"},id={class:"legend d-flex justify-start align-center"},rd={class:"label"},ld={class:"legend d-flex justify-start align-center"},nd={class:"label"},sd={class:"legend d-flex justify-start align-center"},cd={class:"label"},md={class:"legend d-flex justify-start align-center"},dd={class:"label"},hd={class:"legend d-flex justify-start align-center"},pd={class:"label"},gd={class:"legend d-flex justify-start align-center"},ud={class:"label"},fd={class:"legend d-flex justify-start align-center"},yd={class:"label"},bd={class:"d-flex justify-star align-center"},wd={class:"font-weight-600 mr-1"},xd={class:""},kd={class:"port-box d-flex flex-column justify-center align-start ga-2"},Ad={key:0,class:"d-flex justify-start align-center"},Ld={class:"text-label pr-1"},Cd={key:1,class:"d-flex justify-start align-center"},zd={class:"text-label pr-1"},vd={key:2,class:"d-flex justify-start align-center"},_d={class:"text-label pr-1"},Sd={key:3,class:"d-flex justify-start align-center"},Md={class:"text-label pr-1"},Nd={key:4,class:"d-flex justify-start align-center"},Pd={class:"text-label pr-1"},Vd={key:5,class:"d-flex justify-start align-center"},Td={class:"text-label pr-1"},Ed={class:"d-flex justify-start align-center"},Rd={class:"text-label pr-1"},Dd={key:6,class:"d-flex justify-start align-center"},Bd={class:"text-label pr-1"},Id={key:7,class:"d-flex justify-start align-center"},Fd={class:"text-label pr-1"},Gd={class:"d-flex justify-start align-center"},jd={class:"text-label pr-1"};function Wd(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip"),s=o.resolveComponent("VCardText"),d=o.resolveComponent("VDivider"),m=o.resolveComponent("VCardActions"),p=o.resolveComponent("VCard"),g=o.resolveComponent("VCardTitle");return o.openBlock(),o.createElementBlock("div",sm,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+86+"px",right:i.right+"px"})},[o.createVNode(c,{text:t.$t("tropical.tropicals"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:y})=>[o.createVNode(n,o.mergeProps(y,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>e[2]||(e[2]=[o.createElementVNode("i",{class:"iconfont icon-Tropical text-h4"},null,-1)])),_:2,__:[2]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4),i.showTropicalsInfo&&!t.$attrs.hideTropicalsLegend?(o.openBlock(),o.createElementBlock("div",{key:0,id:"idm-tropical-gl4-info",ref:"tropicalsInfo",class:o.normalizeClass(["idm-tropical-gl4-info",a.simple?"page":"dialog"])},[o.createVNode(p,{class:o.normalizeClass(["w-100",a.simple?"rounded-t-4 bg-none":""]),elevation:a.simple?0:16},{default:o.withCtx(()=>[o.createVNode(s,null,{default:o.withCtx(()=>{var y,u,h,f,w,b,A,x,C,k,_,z;return[o.createElementVNode("div",cm,[o.createElementVNode("span",mm,o.toDisplayString(a.locale==="en"?(y=i.activeTropicals)==null?void 0:y.Name:((u=i.activeTropicals)==null?void 0:u.nameCn)||((h=i.activeTropicals)==null?void 0:h.Name)||"-"),1),(w=(f=i.activeTropicals)==null?void 0:f.history)!=null&&w.levelI18n?(o.openBlock(),o.createElementBlock("span",dm," , "+o.toDisplayString(t.$t("tropical."+((A=(b=i.activeTropicals)==null?void 0:b.history)==null?void 0:A.levelI18n))),1)):o.createCommentVNode("",!0)]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"close",onClick:o.withModifiers(l.handleCloseInfoMarker,["stop"])},{default:o.withCtx(()=>e[3]||(e[3]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[3]},8,["onClick"]),o.createElementVNode("div",hm,[o.createElementVNode("span",pm,o.toDisplayString(t.$t("actions.lastUpdate"))+": ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTime(((C=(x=i.activeTropicals)==null?void 0:x.history)==null?void 0:C.updated)||((z=(_=(k=i.activeTropicals)==null?void 0:k.forecasts)==null?void 0:_.filter(P=>!P.disabled)[0])==null?void 0:z.date),a.timeZone)),1)])]}),_:1}),o.createVNode(d),o.createVNode(s,{class:"text-body-1 py-3"},{default:o.withCtx(()=>{var y,u,h,f,w,b,A,x,C;return[o.createElementVNode("div",gm,[o.createElementVNode("div",um,[o.createElementVNode("label",fm,o.toDisplayString(t.$t("weather.windSpeed"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((u=(y=i.activeTropicals)==null?void 0:y.history)==null?void 0:u.kts)||"-")+" kts",1),o.createElementVNode("span",null,", BF "+o.toDisplayString(l.computeBF(((f=(h=i.activeTropicals)==null?void 0:h.history)==null?void 0:f.kts)||"-")),1)]),o.createElementVNode("div",ym,[o.createElementVNode("label",bm,o.toDisplayString(t.$t("weather.pressure"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((b=(w=i.activeTropicals)==null?void 0:w.history)==null?void 0:b.pressure)||"-")+" hPa",1)])]),o.createElementVNode("div",wm,[o.createElementVNode("div",xm,[o.createElementVNode("label",km,o.toDisplayString(t.$t("tropical.moveSpeed"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((A=l.computeMovement(i.activeTropicals))==null?void 0:A.kts)||"-")+" kts",1)]),o.createElementVNode("div",Am,[o.createElementVNode("label",Lm,o.toDisplayString(t.$t("tropical.moveDir"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((x=l.computeMovement(i.activeTropicals))==null?void 0:x.deg)||"-")+"°",1)])]),o.createElementVNode("div",Cm,[o.createElementVNode("label",zm,o.toDisplayString(t.$t("tropical.models"))+" : ",1),o.createElementVNode("div",vm,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList((C=i.activeTropicals)==null?void 0:C.forecasts,(k,_)=>(o.openBlock(),o.createBlock(n,{key:_,density:"compact",variant:k.disabled?"text":"flat",color:k.disabled?"":"primary","min-width":30,class:o.normalizeClass(["model text-none text-body-1 px-1",k.disabled?"btn-border-1 btn-bg-1":""]),onClick:o.withModifiers(z=>l.handleForecastToggle(k),["stop"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(k.model),1)]),_:2},1032,["variant","color","class","onClick"]))),128))])])]}),_:1}),o.createVNode(d),a.simple?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(m,{key:0,class:"d-flex justify-space-between"},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact","prepend-icon":"",variant:"text",color:i.showLegend?"primary":"",class:"text-none text-body-1",onClick:e[0]||(e[0]=o.withModifiers(y=>i.showLegend=!i.showLegend,["stop"]))},{prepend:o.withCtx(()=>e[4]||(e[4]=[o.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),default:o.withCtx(()=>[o.createTextVNode(" "+o.toDisplayString(t.$t("weather.legend")),1)]),_:1},8,["color"]),o.createElementVNode("div",_m,[o.createVNode(n,{variant:"text",density:"compact","append-icon":"mdi-chevron-right",class:"text-none text-body-1",onClick:e[1]||(e[1]=o.withModifiers(y=>l.handleStrikeProbability(i.activeTropicals),["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.viewReport")),1)]),_:1})])]),_:1}))]),_:1},8,["class","elevation"]),a.simple?(o.openBlock(),o.createElementBlock("div",Sm,[o.createElementVNode("div",Mm,[o.createElementVNode("div",Nm,[e[5]||(e[5]=o.createElementVNode("div",{class:"icon td"},null,-1)),o.createElementVNode("div",Pm,o.toDisplayString(t.$t("tropical.td")),1)]),o.createElementVNode("div",Vm,[e[6]||(e[6]=o.createElementVNode("div",{class:"icon sts"},null,-1)),o.createElementVNode("div",Tm,o.toDisplayString(t.$t("tropical.sts")),1)]),o.createElementVNode("div",Em,[e[7]||(e[7]=o.createElementVNode("div",{class:"icon sty"},null,-1)),o.createElementVNode("div",Rm,o.toDisplayString(t.$t("tropical.sty")),1)])]),o.createElementVNode("div",Dm,[o.createElementVNode("div",Bm,[e[8]||(e[8]=o.createElementVNode("div",{class:"icon ts"},null,-1)),o.createElementVNode("div",Im,o.toDisplayString(t.$t("tropical.ts")),1)]),o.createElementVNode("div",Fm,[e[9]||(e[9]=o.createElementVNode("div",{class:"icon ty"},null,-1)),o.createElementVNode("div",Gm,o.toDisplayString(t.$t("tropical.ty")),1)]),o.createElementVNode("div",jm,[e[10]||(e[10]=o.createElementVNode("div",{class:"icon supper-ty"},null,-1)),o.createElementVNode("div",Wm,o.toDisplayString(t.$t("tropical.superTy")),1)])]),o.createElementVNode("div",Zm,[o.createElementVNode("div",Xm,[e[11]||(e[11]=o.createElementVNode("div",{class:"icon history"},null,-1)),o.createElementVNode("div",Hm,o.toDisplayString(t.$t("tropical.history")),1),e[12]||(e[12]=o.createElementVNode("div",{class:"icon forecast"},null,-1)),o.createElementVNode("div",Om,o.toDisplayString(t.$t("tropical.forecast")),1)]),o.createElementVNode("div",Ym,[e[13]||(e[13]=o.createElementVNode("div",{class:"icon r7"},null,-1)),o.createElementVNode("div",Um,"35kts "+o.toDisplayString(t.$t("tropical.radii")),1)]),o.createElementVNode("div",Jm,[e[14]||(e[14]=o.createElementVNode("div",{class:"icon r10"},null,-1)),o.createElementVNode("div",Km,"50kts "+o.toDisplayString(t.$t("tropical.radii")),1)])])])):(o.openBlock(),o.createElementBlock("div",Qm,[o.withDirectives(o.createVNode(p,{elevation:"16"},{default:o.withCtx(()=>[o.createVNode(s,null,{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(["pa-1 d-flex justify-space-between align-center flex-wrap",a.locale==="zhHans"?" ga-2":" ga-3"])},[o.createElementVNode("div",qm,[e[15]||(e[15]=o.createElementVNode("div",{class:"icon td"},null,-1)),o.createElementVNode("div",$m,o.toDisplayString(t.$t("tropical.td")),1)]),o.createElementVNode("div",ed,[e[16]||(e[16]=o.createElementVNode("div",{class:"icon ts"},null,-1)),o.createElementVNode("div",td,o.toDisplayString(t.$t("tropical.ts")),1)]),o.createElementVNode("div",od,[e[17]||(e[17]=o.createElementVNode("div",{class:"icon sts"},null,-1)),o.createElementVNode("div",ad,o.toDisplayString(t.$t("tropical.sts")),1)]),o.createElementVNode("div",id,[e[18]||(e[18]=o.createElementVNode("div",{class:"icon ty"},null,-1)),o.createElementVNode("div",rd,o.toDisplayString(t.$t("tropical.ty")),1)]),o.createElementVNode("div",ld,[e[19]||(e[19]=o.createElementVNode("div",{class:"icon sty"},null,-1)),o.createElementVNode("div",nd,o.toDisplayString(t.$t("tropical.sty")),1)]),o.createElementVNode("div",sd,[e[20]||(e[20]=o.createElementVNode("div",{class:"icon supper-ty"},null,-1)),o.createElementVNode("div",cd,o.toDisplayString(t.$t("tropical.superTy")),1)]),o.createElementVNode("div",md,[e[21]||(e[21]=o.createElementVNode("div",{class:"icon history"},null,-1)),o.createElementVNode("div",dd,o.toDisplayString(t.$t("tropical.history")),1)]),o.createElementVNode("div",hd,[e[22]||(e[22]=o.createElementVNode("div",{class:"icon forecast"},null,-1)),o.createElementVNode("div",pd,o.toDisplayString(t.$t("tropical.forecast")),1)]),o.createElementVNode("div",gd,[e[23]||(e[23]=o.createElementVNode("div",{class:"icon r7"},null,-1)),o.createElementVNode("div",ud,"35kts "+o.toDisplayString(t.$t("tropical.radii")),1)]),o.createElementVNode("div",fd,[e[24]||(e[24]=o.createElementVNode("div",{class:"icon r10"},null,-1)),o.createElementVNode("div",yd,"50kts "+o.toDisplayString(t.$t("tropical.radii")),1)])],2),[[o.vShow,i.showLegend]])]),_:1})]),_:1},512),[[o.vShow,i.showLegend]])]))],2)):o.createCommentVNode("",!0),o.withDirectives(o.createVNode(p,{id:"tropicalHoverMarkerInfo",elevation:"16","max-width":"280"},{default:o.withCtx(()=>[o.createVNode(g,null,{default:o.withCtx(()=>{var y,u,h,f;return[o.createElementVNode("div",bd,[o.createElementVNode("span",wd,o.toDisplayString(a.locale==="en"?(y=i.hoverPoint)==null?void 0:y.Name:((u=i.hoverPoint)==null?void 0:u.nameCn)||((h=i.hoverPoint)==null?void 0:h.Name)),1),o.createElementVNode("span",xd," ["+o.toDisplayString(t.$t("tropical."+((f=i.hoverPoint)==null?void 0:f.levelI18n)))+"]",1)])]}),_:1}),o.createVNode(d),o.createVNode(s,{class:"text-body-1"},{default:o.withCtx(()=>{var y,u,h,f,w,b,A,x,C,k,_,z,P,T,V,j,W,O,ie,oe;return[o.createElementVNode("div",kd,[((y=i.hoverPoint)==null?void 0:y.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Ad,[o.createElementVNode("label",Ld,o.toDisplayString(t.$t("tropical.updated"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTzTime((u=i.hoverPoint)==null?void 0:u.update,a.timeZone)),1)])):o.createCommentVNode("",!0),((h=i.hoverPoint)==null?void 0:h.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Cd,[o.createElementVNode("label",zd,o.toDisplayString(t.$t("tropical.forecast"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTzTime((f=i.hoverPoint)==null?void 0:f.date,a.timeZone)),1)])):o.createCommentVNode("",!0),((w=i.hoverPoint)==null?void 0:w.type)==="history"?(o.openBlock(),o.createElementBlock("div",vd,[o.createElementVNode("label",_d,o.toDisplayString(t.$t("tropical.forecast"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTzTime((b=i.hoverPoint)==null?void 0:b.date,a.timeZone)),1)])):o.createCommentVNode("",!0),((A=i.hoverPoint)==null?void 0:A.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Sd,[o.createElementVNode("label",Md,o.toDisplayString(t.$t("tropical.model"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((x=i.hoverPoint)==null?void 0:x.model)??"-"),1)])):o.createCommentVNode("",!0),((C=i.hoverPoint)==null?void 0:C.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Nd,[o.createElementVNode("label",Pd,o.toDisplayString(t.$t("weather.wind"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((_=JSON.parse(((k=i.hoverPoint)==null?void 0:k.wind)||"{}"))==null?void 0:_.kts)??"-")+" kts",1)])):o.createCommentVNode("",!0),((z=i.hoverPoint)==null?void 0:z.type)==="history"?(o.openBlock(),o.createElementBlock("div",Vd,[o.createElementVNode("label",Td,o.toDisplayString(t.$t("weather.wind"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((P=i.hoverPoint)==null?void 0:P.kts)??"-")+" kts",1)])):o.createCommentVNode("",!0),o.createElementVNode("div",Ed,[o.createElementVNode("label",Rd,o.toDisplayString(t.$t("weather.pressure"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((T=i.hoverPoint)==null?void 0:T.pressure)??"-")+" hPa",1)]),((V=i.hoverPoint)==null?void 0:V.type)==="history"?(o.openBlock(),o.createElementBlock("div",Dd,[o.createElementVNode("label",Bd,o.toDisplayString(t.$t("tropical.moveSpeed"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((W=JSON.parse(((j=i.hoverPoint)==null?void 0:j.movement)||"{}"))==null?void 0:W.kts)??"-")+" kts",1)])):o.createCommentVNode("",!0),((O=i.hoverPoint)==null?void 0:O.type)==="history"?(o.openBlock(),o.createElementBlock("div",Id,[o.createElementVNode("label",Fd,o.toDisplayString(t.$t("tropical.moveDir"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((oe=JSON.parse(((ie=i.hoverPoint)==null?void 0:ie.movement)||"{}"))==null?void 0:oe.deg)??"-")+" °",1)])):o.createCommentVNode("",!0),o.createElementVNode("div",Gd,[o.createElementVNode("label",jd,o.toDisplayString(t.$t("tropical.position"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computePosition(i.hoverPoint)),1)])])]}),_:1})]),_:1},512),[[o.vShow,i.showHoverPoint]])])}const Xo=Y(nm,[["render",Wd]]),Ly="",Zd={name:"DateTimePicker",props:{width:{type:Number,default:null},height:{type:Number,default:30},position:{type:String,default:"top"},bgClass:{type:String,default:""},locale:{type:String,default:"en"},style:{type:Object,default:{}},intervalHour:{type:Number,default:3},timeZone:{type:Number},dateTime:{type:String},dayAbout:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1}},emits:["dateTime","currentTimestamp","currentRealTime","minTimestamp","maxTimestamp"],data(){return{showDatePicker:!1,minDate:void 0,maxDate:void 0,minTimestamp:void 0,maxTimestamp:void 0,currentDate:void 0,currentTime:void 0,currentTimestamp:void 0,currentDateTimeZ:void 0,currentDateTime:void 0,currentRealTime:void 0,timer:null}},computed:{getStyle(){const t=this.width||220;return this.position==="top"?{bottom:"40px",left:`-${(420-t)/2}px`}:this.position==="bottom"?{top:"40px",left:`-${(420-t)/2}px`}:this.position==="left"?{bottom:"-140px",left:"-428px"}:this.position==="right"?{bottom:"-140px",right:"-428px"}:{bottom:"40px",left:`-${(420-t)/2}px`}},hourOptions(){const t=[];for(let e=0;e<24;e++)t.push(e<10?`0${e}:00`:`${e}:00`);return t.filter((e,a)=>(a-this.timeZone)%this.intervalHour===0)},timeZoneNames(){return v.tz.names()},timeZoneName(){var t;return(t=this.timeZoneNames.filter(e=>v.tz(v(),e).utcOffset()===this.timeZone*60))==null?void 0:t[0]},utcTimeZoneName(){return"Africa/Abidjan"},localTimeZoneName(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"Asia/Shanghai"}},watch:{timeZone:{handler(t,e){t!==e&&(this.handleResetDateTime(this.dateTime),this.handleResetMinMax())}},dateTime:{handler(t,e){t&&this.handleResetDateTime(this.dateTime)},immediate:!0},currentTimestamp:{handler(){this.currentDateTimeZ=v(this.currentTimestamp).utc().format("yyyy-MM-DD HH:00[Z]"),this.$emit("dateTime",this.currentDateTimeZ),this.$emit("currentTimestamp",this.currentTimestamp),this.currentDateTime=`${v.tz(this.currentTimestamp,this.timeZoneName).clone().format("yyyy-MM-DD : HH:00")}`},immediate:!0},currentRealTime:{handler(t,e){t!==e&&this.$emit("currentRealTime",this.currentRealTime)}}},mounted(){this.timer=setInterval(()=>{this.currentRealTime=`${v.tz(v().unix()*1e3,this.timeZoneName).clone().format("HH:mm")}`},100),document.addEventListener("click",this.handleClickOutside)},unmounted(){clearInterval(this.timer),this.handleCancelDate(),document.removeEventListener("click",this.handleClickOutside)},methods:{handleReset(){this.handleResetDateTime(),this.handleResetMinMax()},handleResetDateTime(t){var i;const e=v(t).utc().date(),a=Math.ceil(v(t).utc().hour()/this.intervalHour)*this.intervalHour;this.currentTimestamp=((i=v(t))==null?void 0:i.utc().set({date:e,hour:a,minute:0,second:0,millisecond:0}).unix())*1e3;const r=v.tz(this.currentTimestamp,this.timeZoneName).clone();this.currentDate=r.clone().format("YYYY-MM-DD"),this.currentTime=r.clone().format("HH:00"),this.currentDateTime=`${v.tz(this.currentTimestamp,this.timeZoneName).clone().format("yyyy-MM-DD : HH:00")}`,this.currentRealTime=`${v.tz(v().unix()*1e3,this.timeZoneName).clone().format("HH:mm")}`},handleResetMinMax(){var i,l,n,c,s;if(this.dayAbout.h==null||this.dayAbout.f==null)return;const t=v().utc().date(),e=Math.ceil(v().utc().hour()/this.intervalHour)*this.intervalHour,a=((i=v())==null?void 0:i.utc().set({date:t,hour:e,minute:0,second:0,millisecond:0}).unix())*1e3,r=v.tz(a,this.timeZoneName).clone();this.minDate=r.clone().add(this.dayAbout.h,"day").format("yyyy-MM-DD"),this.maxDate=r.clone().add(this.dayAbout.f,"day").format("yyyy-MM-DD"),this.minTimestamp=((n=(l=v())==null?void 0:l.utc())==null?void 0:n.set({date:t+this.dayAbout.h,hour:0,minute:0,second:0,millisecond:0}).unix())*1e3,this.maxTimestamp=((s=(c=v())==null?void 0:c.utc())==null?void 0:s.set({date:t+this.dayAbout.f,hour:0,minute:0,second:0,millisecond:0}).unix())*1e3,this.$emit("minTimestamp",this.minTimestamp),this.$emit("maxTimestamp",this.maxTimestamp)},handleOpenDatePicker(){this.disabled||(this.showDatePicker=!this.showDatePicker)},handleUpdateMonth(t){const e=t||v.tz(this.currentTimestamp,this.timeZoneName).clone().month(),a=this.locale==="en"?v.tz(this.currentTimestamp,this.timeZoneName).set({month:e}).clone().format("MMM"):v.tz(this.currentTimestamp,this.timeZoneName).set({month:e}).clone().format("M月");this.$nextTick(()=>{const r=document.querySelector(".v-date-picker-controls__month-btn");r.innerText=a})},handleConfirmDate(){const t=v(this.currentDate).format("yyyy-MM-DD"),e=this.currentTime,a=`${t} ${e}`,r=v.tz(a,"YYYY-MM-DD HH:00",this.timeZoneName).clone().tz(this.localTimeZoneName);this.currentTimestamp=r.unix()*1e3,this.showDatePicker=!1},handleCancelDate(){this.showDatePicker=!1;const t=v.tz(this.currentTimestamp,this.timeZoneName).clone();this.currentDate=t.clone().format("YYYY-MM-DD"),this.currentTime=t.clone().format("HH:00")},handleClickOutside(t){const e=this.$refs.idmGl4Timepicker;e&&!e.contains(t.target)&&(this.showDatePicker=!1)}}},Xd={ref:"idmGl4Timepicker",class:"idm-gl4-time-picker"},Hd={class:"pa-0",style:{width:"320px"}},Od={class:"h-100 pa-0 d-flex flex-column justify-start align-center",style:{width:"100px"}},Yd={class:"d-flex justify-center align-center text-body-2",style:{height:"44px"}};function Ud(t,e,a,r,i,l){const n=o.resolveComponent("VDatePicker"),c=o.resolveComponent("VDivider"),s=o.resolveComponent("VListItemTitle"),d=o.resolveComponent("VListItem"),m=o.resolveComponent("VList"),p=o.resolveComponent("VCardText"),g=o.resolveComponent("VBtn"),y=o.resolveComponent("VCardActions"),u=o.resolveComponent("VCard");return o.openBlock(),o.createElementBlock("div",Xd,[o.createElementVNode("div",{style:o.normalizeStyle({height:a.height+"px",width:a.width?a.width+"px":"auto"}),class:o.normalizeClass([[a.bgClass,{"cursor-pointer":!a.disabled}],"rounded text-body-1 btn-border-1 btn-bg-1 d-flex align-center justify-center px-2"]),onClick:e[0]||(e[0]=(...h)=>l.handleOpenDatePicker&&l.handleOpenDatePicker(...h))},o.toDisplayString(i.currentDateTime)+" | UTC "+o.toDisplayString(a.timeZone<0?a.timeZone:"+"+a.timeZone),7),i.showDatePicker?(o.openBlock(),o.createBlock(u,{key:0,class:"card-box d-flex flex-column border elevation-12",style:o.normalizeStyle(l.getStyle)},{default:o.withCtx(()=>[o.createVNode(p,{class:"w-100 flex-1-1-0 d-flex pa-0 text-body-1"},{default:o.withCtx(()=>[o.createElementVNode("div",Hd,[o.createVNode(n,{modelValue:i.currentDate,"onUpdate:modelValue":e[1]||(e[1]=h=>i.currentDate=h),min:i.minDate,max:i.maxDate,"weekday-format":"narrow",color:"primary",density:"compact",class:"w-100","hide-header":""},null,8,["modelValue","min","max"])]),o.createVNode(c,{class:"h-100",vertical:""}),o.createElementVNode("div",Od,[o.createElementVNode("div",Yd,o.toDisplayString(t.$t("time.time")),1),o.createVNode(m,{class:"pa-0 flex-1-1-0 scroll"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.hourOptions,(h,f)=>(o.openBlock(),o.createBlock(d,{key:f,value:h,color:"primary",active:i.currentTime===h,rounded:"",height:"26","min-height":"26",class:"rounded-xl",variant:i.currentTime===h?"flat":"text"},{default:o.withCtx(()=>[o.createVNode(s,{class:"text-body-2 font-weight-600 text-center",onClick:w=>i.currentTime=h},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h),1)]),_:2},1032,["onClick"])]),_:2},1032,["value","active","variant"]))),128))]),_:1})])]),_:1}),o.createVNode(c),o.createVNode(y,{class:"w-100 d-flex justify-end align-center px-4 ga-4",style:{height:"50px"}},{default:o.withCtx(()=>[o.createVNode(g,{size:"small",variant:"tonal",class:"text-none text-body-1 px-4",onClick:l.handleCancelDate},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.cancel")),1)]),_:1},8,["onClick"]),o.createVNode(g,{size:"small",variant:"flat",color:"primary",class:"text-none text-body-1 px-4",onClick:l.handleConfirmDate},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.confirm")),1)]),_:1},8,["onClick"])]),_:1})]),_:1},8,["style"])):o.createCommentVNode("",!0)],512)}const qe=Y(Zd,[["render",Ud]]),Cy="",Jd={name:"IdmPoint",components:{DateTimePicker:qe},props:{simple:{type:Boolean,default:!1},isLogin:{type:Boolean,default:!1},token:{type:String},defaultMeteoToken:{type:String},theme:{type:String,default:"zh"},map:{type:Object},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}},gateway:{type:String},timeZone:{type:Number},forecastModel:{type:String},realTime:{type:String},followList:{type:Array,default:()=>[]}},emits:["meteoMore","follow","cancelFollow","login"],data(){return{right:10,toggle:!1,showForm:!1,showMeteo:!1,loading:!1,form:{lng:void 0,lngDegree:void 0,lngMinute:void 0,lngDirection:"E",lat:void 0,latDegree:void 0,latMinute:void 0,latDirection:"N",dateTime:void 0,forecastModel:""},formRules:{lngDegree:[t=>t!=null&&t!==""||"required",t=>/^\d{1,3}$/.test(t)||"number",t=>parseInt(t)>=0&&parseInt(t)<=180||"0 ~ 180"],lngMinute:[t=>t===void 0||t===null&&t===""||/^\d{1,2}(\.\d+)?$/.test(t)||"number",t=>t===void 0||t===null&&t===""||parseInt(t)>=0&&parseInt(t)<=59||"0 ~ 59"],latDegree:[t=>t!=null&&t!==""||"required",t=>/^\d{1,2}$/.test(t)||"number",t=>parseInt(t)>=0&&parseInt(t)<=90||"0 ~ 90"],latMinute:[t=>t===void 0||t===null&&t===""||/^\d{1,2}(\.\d+)?$/.test(t)||"number",t=>t===void 0||t===null&&t===""||parseInt(t)>=0&&parseInt(t)<=59||"0 ~ 59"]},meteoData:void 0,currentHourData:{},positionOffset:void 0,positionGmt:void 0,positionMarker:void 0,meteoInfoMarker:void 0}},computed:{timeZoneNames(){return v.tz.names()},timeZoneName(){var t;return(t=this.timeZoneNames.filter(e=>v.tz(v(),e).utcOffset()===this.timeZone*60))==null?void 0:t[0]},computedTzTime(){return t=>v.tz(v(t),this.timeZoneName).clone().format("YYYY-MM-DD HHmm")+" (UTC "+(this.timeZone>=0?"+":"")+this.timeZone+")"},computedLocalTime(){return t=>{var r,i,l;const e=Number((r=this.positionOffset)==null?void 0:r.slice(1,3))*(+(((i=this.positionOffset)==null?void 0:i.slice(1))==="+")?1:-1),a=(l=this.timeZoneNames.filter(n=>v.tz(v(),n).utcOffset()===e*60))==null?void 0:l[0];return t?v.tz(v(t),a).clone().format("YYYY-MM-DD HHmm")+" (UTC "+(e>=0?"+":"")+e+")":"-"}},computePosition(){return function(t){return!t||t.lng===null||t.lng===void 0||isNaN(t.lng)||t.lat===null||t.lat===void 0||isNaN(t.lat)?"-":N.LngLatHelper.lat2pretty(t==null?void 0:t.lat,2).pretty+" / "+N.LngLatHelper.lng2pretty(t==null?void 0:t.lng,2).pretty}},computeRoundPrecision(){return function(t,e=4){return t==null||isNaN(t)||isNaN(e)?"-":N.LngLatHelper.roundPrecision(t,e)}}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})},immediate:!0},toggle:{handler(){this.toggle?this.showForm=!0:(this.showForm=!1,this.showMeteo=!1),this.map&&this.handleBind()},immediate:!0},map:{handler(){this.map&&this.toggle&&this.handleBind()}},showForm:{handler(){this.showForm?(this.realTime&&(this.form.dateTime=this.realTime),this.$nextTick(()=>{var t;(t=this.$refs.spotForm)==null||t.resetValidation()})):this.handleCloseForm()}},showMeteo:{handler(){var t,e,a,r,i,l;this.showMeteo?((a=(e=(t=this.$parent)==null?void 0:t.$refs)==null?void 0:e.idmBottomBar)==null||a.handleToggle("spot",!0),this.simple&&this.$nextTick(()=>{var n,c;this.$parent.playerBottom=((c=(n=this.$refs.spotMeteo)==null?void 0:n.$el)==null?void 0:c.clientHeight)+10})):((l=(i=(r=this.$parent)==null?void 0:r.$refs)==null?void 0:i.idmBottomBar)==null||l.handleToggle("spot",!1),this.simple&&(this.$parent.playerBottom=30))}},realTime:{handler(){this.realTime&&(this.form.dateTime=this.realTime,this.showMeteo&&this.fetchData())}},forecastModel:{handler(){this.form.forecastModel=this.forecastModel},immediate:!0},"form.forecastModel":{handler(t,e){!t&&e&&(this.form.forecastModel=e==="GFS"?"ECMWF":"GFS")}}},methods:{handleMenuToggle(){this.isLogin?this.toggle=!this.toggle:this.$emit("login")},submitForm(){this.handleCloseMeteo(),this.$refs.spotForm.validate().then(async t=>{t!=null&&t.valid&&this.fetchData()})},cancelForm(){var t;(t=this.$refs.spotForm)==null||t.reset(),this.form={lng:void 0,lngDegree:void 0,lngMinute:void 0,lngDirection:"E",lat:void 0,latDegree:void 0,latMinute:void 0,latDirection:"N",dateTime:void 0,forecastModel:this.forecastModel}},handleCloseForm(){this.showForm=!1,this.cancelForm(),this.toggle=!1},async fetchData(){var a;if(isNaN(this.form.latDegree)||isNaN(this.form.latMinute)||isNaN(this.form.lngDegree)||isNaN(this.form.lngMinute))return!1;this.form.lat=(Number(this.form.latDegree??0)+Number(this.form.latMinute??0)/60)*(this.form.latDirection==="N"?1:-1),this.form.lng=(Number(this.form.lngDegree??0)+Number(this.form.lngMinute??0)/60)*(this.form.lngDirection==="E"?1:-1);const t=v();((a=v(this.realTime))==null?void 0:a.diff(t,"d",!0))>=0?await this.fetchForecastData(this.form):await this.fetchHistoryData(this.form)},async fetchForecastData(t){this.loading=!0,this.showMeteo=!0,this.form.lng=t.lng,this.form.lat=t.lat,this.form.followId=t.followId,this.handleDrawInfoMarker([t.lng,t.lat]),this.meteoData=[];const{weatherModels:e,marineModels:a}=Ie.Meteo2Assist.autoPickMeteoModel(t.forecastModel);let r={lat:t.lat,lng:t.lng,datetime:v(t.dateTime).utc().format(),forecastDays:t.day??3,weatherModels:e,marineModels:a};await le.post(`${this.gateway}/api/arc/meteo2/spot/forecast`,r,{headers:{Authorization:this.token||this.defaultMeteoToken}}).then(i=>{(i==null?void 0:i.data.code)===0?(this.meteoData=i==null?void 0:i.data.data,this.meteoData.lng=t.lng,this.meteoData.lat=t.lat,this.initTableData(this.meteoData),this.loading=!1):this.loading=!1}).catch(()=>{this.loading=!1})},async fetchHistoryData(t){this.loading=!0,this.showMeteo=!0,this.form.lng=t.lng,this.form.lat=t.lat,this.form.followId=t.followId,this.handleDrawInfoMarker([t.lng,t.lat]),this.meteoData=[];const{weatherModels:e,marineModels:a}=Ie.Meteo2Assist.autoPickMeteoModel(t.forecastModel),r={lat:t.lat,lng:t.lng,datetime:v(t.dateTime).utc().format(),forecastDays:2,pastDays:1,weatherModels:e,marineModels:a};await le.post(`${this.gateway}/api/arc/meteo2/spot/forecast`,r,{headers:{Authorization:this.token||this.defaultMeteoToken}}).then(i=>{(i==null?void 0:i.data.code)===0?(this.meteoData=i==null?void 0:i.data.data,this.meteoData.lng=t.lng,this.meteoData.lat=t.lat,this.initTableData(this.meteoData),this.loading=!1):this.loading=!1}).catch(()=>{this.loading=!1}),this.loading=!1},initTableData(t){var a,r,i,l,n,c,s,d,m,p,g,y,u,h,f,w,b,A,x,C,k,_,z,P,T,V,j,W,O,ie,oe,M,F,G,U,B,D,X,S,Q,re;this.currentHourData={},this.positionGmt=(r=(a=t==null?void 0:t.weather)==null?void 0:a[0])==null?void 0:r.timezone,this.positionOffset=(l=(i=t==null?void 0:t.weather)==null?void 0:i[0])==null?void 0:l.offset;const e=((n=Ie.Meteo2Assist.pickHourly(t,v(this.form.dateTime)))==null?void 0:n[0])||{};this.currentHourData.utc=e.utc,this.currentHourData.lat=t.lat,this.currentHourData.lng=t.lng,this.currentHourData.temp=this.computeRoundPrecision((c=e==null?void 0:e.weather)==null?void 0:c.temp,0)??"-",this.currentHourData.precipProbability=this.computeRoundPrecision((d=(s=e==null?void 0:e.weather)==null?void 0:s.precip)==null?void 0:d.probability,0)??"-",this.currentHourData.precip1h=this.computeRoundPrecision((p=(m=e==null?void 0:e.weather)==null?void 0:m.precip)==null?void 0:p.sum,0)??"-",this.currentHourData.visibility=this.computeRoundPrecision((g=e==null?void 0:e.weather)==null?void 0:g.visibility,0)??"-",this.currentHourData.windSpeed=this.computeRoundPrecision((u=(y=e==null?void 0:e.weather)==null?void 0:y.wind)==null?void 0:u.kts,1)??"-",this.currentHourData.windDir=((f=(h=e==null?void 0:e.weather)==null?void 0:h.wind)==null?void 0:f.direction)??"-",this.currentHourData.windLevel=this.computeRoundPrecision((b=(w=e==null?void 0:e.weather)==null?void 0:w.wind)==null?void 0:b.scale,0)??"-",this.currentHourData.windGust=this.computeRoundPrecision((x=(A=e==null?void 0:e.weather)==null?void 0:A.wind)==null?void 0:x.gusts,1)??"-",this.currentHourData.sigwaveHeight=this.computeRoundPrecision((k=(C=e==null?void 0:e.wave)==null?void 0:C.sig)==null?void 0:k.height,1)??"-",this.currentHourData.sigwaveDir=(z=(_=e==null?void 0:e.wave)==null?void 0:_.sig)==null?void 0:z.direction,this.currentHourData.sigwavePeriod=this.computeRoundPrecision((T=(P=e==null?void 0:e.wave)==null?void 0:P.sig)==null?void 0:T.period,1)??"-",this.currentHourData.windwaveHeight=this.computeRoundPrecision((j=(V=e==null?void 0:e.wave)==null?void 0:V.wd)==null?void 0:j.height,1)??"-",this.currentHourData.windwaveDir=(O=(W=e==null?void 0:e.wave)==null?void 0:W.wd)==null?void 0:O.direction,this.currentHourData.windwavePeriod=this.computeRoundPrecision((oe=(ie=e==null?void 0:e.wave)==null?void 0:ie.wd)==null?void 0:oe.period,1)??"-",this.currentHourData.swellHeight=this.computeRoundPrecision((F=(M=e==null?void 0:e.wave)==null?void 0:M.swell)==null?void 0:F.height,1)??"-",this.currentHourData.swellDir=(U=(G=e==null?void 0:e.wave)==null?void 0:G.swell)==null?void 0:U.direction,this.currentHourData.swellPeriod=this.computeRoundPrecision((D=(B=e==null?void 0:e.wave)==null?void 0:B.swell)==null?void 0:D.period,1)??"-",this.currentHourData.currentSpeed=this.computeRoundPrecision((X=e==null?void 0:e.current)==null?void 0:X.speed,1)??"-",this.currentHourData.currentDir=(S=e==null?void 0:e.current)==null?void 0:S.direction,this.currentHourData.currentSpeed=this.computeRoundPrecision((Q=e==null?void 0:e.current)==null?void 0:Q.speed,1)??"-",this.currentHourData.seaLevel=this.computeRoundPrecision(e==null?void 0:e.height,1)??"-",this.currentHourData.seaTemp=this.computeRoundPrecision(e==null?void 0:e.sst,0)??"-",this.currentHourData.weatherUrls=(re=e==null?void 0:e.weather)==null?void 0:re.url},handleBind(){var t,e;this.toggle?((t=this.map)==null||t.on("click",this.handleClick),this.map&&(this.map.getCanvas().style.cursor="crosshair")):((e=this.map)==null||e.off("click",this.handleClick),this.handleCloseMeteo(),this.map&&(this.map.getCanvas().style.cursor="grab"))},handleClick(t){if(t.originalEvent.stopPropagation(),t.originalEvent.target.className==="mapboxgl-canvas")this.handleGetPosition(t.lngLat),this.$nextTick(()=>{this.fetchData()});else return!1},handleGetPosition(t){if(isNaN(t.lat)||isNaN(t.lng))return!1;this.form.latDegree=Number(N.LngLatHelper.lat2pretty(t.lat).degree),this.form.latMinute=Number(N.LngLatHelper.lat2pretty(t.lat).minute),this.form.latDirection=N.LngLatHelper.lat2pretty(t.lat).direction,this.form.lngDegree=Number(N.LngLatHelper.lng2pretty(t.lng).degree),this.form.lngMinute=Number(N.LngLatHelper.lng2pretty(t.lng).minute),this.form.lngDirection=N.LngLatHelper.lng2pretty(t.lng).direction},handleDrawInfoMarker(t){this.drawPositionMarker(t),this.simple||this.drawMeteoInfoMarker(t)},drawPositionMarker(t){t&&(this.map.flyTo({center:t,duration:300}),this.$nextTick(()=>{var a,r;(a=this.positionMarker)==null||a.remove();const e=(r=document.getElementById("idm-position-icon"))==null?void 0:r.cloneNode(!0);this.positionMarker=new ne.Marker(e).setLngLat(t).setOffset([0,-15]).addTo(this.map)}))},drawMeteoInfoMarker(t){this.$nextTick(()=>{var a;const e=document.getElementById("idm-gl4-spot-meteo");this.meteoInfoMarker?(a=this.meteoInfoMarker)==null||a.setLngLat(t):this.meteoInfoMarker=new ne.Marker(e).setLngLat(t).setOffset([0,-190]).addTo(this.map)})},handleMeteoMore(){this.form.forecastModel=this.forecastModel,this.$emit("meteoMore",this.form)},handleCloseMeteo(){this.showMeteo=!1,this.$nextTick(()=>{var t,e;(t=this.positionMarker)==null||t.remove(),this.positionMarker=void 0,(e=this.meteoInfoMarker)==null||e.remove(),this.meteoInfoMarker=void 0})},handleFollow(){this.$emit("follow",this.form)},handleCancelFollow(){var e,a,r;const t=((e=this.form)==null?void 0:e.followId)||((r=(a=this.followList)==null?void 0:a.find(i=>{var l,n;return(i==null?void 0:i.id)===this.form.followId||((l=i==null?void 0:i.coordinate)==null?void 0:l.lng)===this.form.lng&&((n=i==null?void 0:i.coordinate)==null?void 0:n.lat)===this.form.lat}))==null?void 0:r.id);this.$emit("cancelFollow",t)}}},Kd={class:"idm-gl4-spot"},Qd={class:"d-flex justify-start align-center"},qd={class:"text-h6 font-weight-600"},$d={class:"d-flex justify-start align-center ga-1 mb-2"},eh={class:"text-label"},th={class:"d-flex justify-start align-center ga-1 mb-2"},oh={class:"text-label"},ah={class:"d-flex justify-start align-center ga-1 mb-2"},ih={class:"text-label"},rh={class:"d-flex justify-start align-center ga-1 mb-2"},lh={class:"text-label"},nh={class:"d-flex justify-start align-center"},sh={class:"mx-2"},ch={class:"mx-0 py-2 d-flex align-center justify-start"},mh={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},dh={class:"pa-0 px-0"},hh={class:"mx-0 py-2 d-flex align-center justify-start"},ph={cols:"9",class:"pa-0 px-0"},gh={class:"mx-0 py-2 d-flex align-center justify-start"},uh={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},fh={style:{width:"150px"},class:"pa-0 text-left"},yh={style:{width:"80px"},class:"pa-0 pr-2 text-right opacity-50"},bh={cols:"3",class:"pa-0 px-0 text-left"},wh={class:"mx-0 py-2 d-flex align-center justify-start"},xh={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},kh={style:{width:"150px"},class:"pa-0 text-left"},Ah={style:{width:"80px"},class:"pa-0 pr-2 text-right opacity-50"},Lh={cols:"3",class:"pa-0 text-left"},Ch={class:"mx-0 py-2 d-flex align-center justify-start"},zh={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},vh={style:{width:"150px"},class:"pa-0 text-left"},_h={style:{width:"80px"},class:"pa-0 pr-2 text-right opacity-50"},Sh={class:"pa-0 text-left"},Mh={class:"d-flex justify-space-between align-center"},Nh={class:"d-flex justify-start align-center"},Ph={class:"mx-1"},Vh={class:"d-flex justify-end align-center"},Th={class:"mx-0 py-1 d-flex align-center justify-start"},Eh={style:{width:"60px"},class:"pa-0 pr-2 text-right opacity-50"},Rh={class:"pa-0 px-0"},Dh={class:"mx-0 py-1 d-flex align-center justify-start"},Bh={class:"pa-0 px-0"},Ih={class:"gray-bg-2 mx-4 my-2 py-3 px-2 rounded text-font-13 d-flex align-center justify-space-between"},Fh={class:"d-flex flex-column align-start justify-center ga-3"},Gh={class:"text-label pr-2"},jh={class:"text-label pr-2"},Wh={class:"text-label pr-2"},Zh={class:"d-flex flex-column align-start justify-center ga-3"},Xh={class:"text-label pr-2"},Hh={class:"text-label pr-2"},Oh={class:"text-label pr-2"},Yh={id:"idm-position-icon"},Uh={class:"multi-color-icon",style:{height:"30px",width:"30px"},"aria-hidden":"true"},Jh=["xlink:href"];function Kh(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip"),s=o.resolveComponent("VCardTitle"),d=o.resolveComponent("VDivider"),m=o.resolveComponent("VTextField"),p=o.resolveComponent("VCol"),g=o.resolveComponent("VRow"),y=o.resolveComponent("DateTimePicker"),u=o.resolveComponent("VBtnToggle"),h=o.resolveComponent("VCardText"),f=o.resolveComponent("VCardActions"),w=o.resolveComponent("VForm"),b=o.resolveComponent("VCard");return o.openBlock(),o.createElementBlock("div",Kd,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+126+"px",right:i.right+"px"})},[o.createVNode(c,{text:t.$t("spot.spotsMeteo"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:A})=>[o.createVNode(n,o.mergeProps(A,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>e[8]||(e[8]=[o.createElementVNode("i",{class:"iconfont icon-a-Spotweather text-h4"},null,-1)])),_:2,__:[8]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4),i.showForm&&!a.simple?(o.openBlock(),o.createBlock(b,{key:0,class:"spot-form-card",style:o.normalizeStyle({top:a.top+a.paddingTop+126+"px",right:i.right+50+"px"})},{default:o.withCtx(()=>[o.createVNode(s,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>[o.createElementVNode("div",Qd,[o.createElementVNode("div",qd,o.toDisplayString(t.$t("spot.spotWeather")),1)]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleCloseForm},{default:o.withCtx(()=>e[9]||(e[9]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[9]},8,["onClick"])]),_:1}),o.createVNode(d),o.createVNode(w,{ref:"spotForm",autocomplete:"off",class:"form-box",onSubmit:o.withModifiers(l.submitForm,["prevent"])},{default:o.withCtx(()=>[o.createVNode(h,{class:"text-body-1 pa-4"},{default:o.withCtx(()=>[o.createElementVNode("div",$d,[o.createElementVNode("div",eh,[o.createTextVNode(o.toDisplayString(t.$t("spot.lat")),1),e[10]||(e[10]=o.createElementVNode("span",{class:"text-danger"},"*",-1))])]),o.createVNode(g,{class:"ma-0"},{default:o.withCtx(()=>[o.createVNode(p,{cols:"4",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.latDegree,"onUpdate:modelValue":e[0]||(e[0]=A=>i.form.latDegree=A),rules:i.formRules.latDegree,label:"",density:"compact",variant:"outlined",height:"32px","min-height":"32px",required:"",dense:"",class:"text-body-1 input-btn-bg-1"},null,8,["modelValue","rules"]),e[11]||(e[11]=o.createElementVNode("span",{class:"px-1"},"°",-1))]),_:1,__:[11]}),o.createVNode(p,{cols:"6",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.latMinute,"onUpdate:modelValue":e[1]||(e[1]=A=>i.form.latMinute=A),rules:i.formRules.latMinute,label:"",density:"compact",variant:"outlined",class:"text-body-1 input-btn-bg-1",required:"",dense:""},null,8,["modelValue","rules"]),e[12]||(e[12]=o.createElementVNode("span",{class:"px-1"},"'",-1))]),_:1,__:[12]}),o.createVNode(p,{cols:"2",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(n,{variant:"outlined",density:"compact",width:"32","min-width":"32",height:"32",class:"text-body-1 bg-primary",style:{border:"1px solid rgba(var(--v-theme-on-surface), 0.38)"},onClick:e[2]||(e[2]=A=>i.form.latDirection=i.form.latDirection==="N"?"S":"N")},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.form.latDirection),1)]),_:1})]),_:1})]),_:1}),o.createElementVNode("div",th,[o.createElementVNode("div",oh,[o.createTextVNode(o.toDisplayString(t.$t("spot.lng")),1),e[13]||(e[13]=o.createElementVNode("span",{class:"text-danger"},"*",-1))])]),o.createVNode(g,{class:"ma-0"},{default:o.withCtx(()=>[o.createVNode(p,{cols:"4",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.lngDegree,"onUpdate:modelValue":e[3]||(e[3]=A=>i.form.lngDegree=A),rules:i.formRules.lngDegree,density:"compact",variant:"outlined",class:"text-body-1 input-btn-bg-1",required:"",dense:""},null,8,["modelValue","rules"]),e[14]||(e[14]=o.createElementVNode("span",{class:"px-1"},"°",-1))]),_:1,__:[14]}),o.createVNode(p,{cols:"6",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.lngMinute,"onUpdate:modelValue":e[4]||(e[4]=A=>i.form.lngMinute=A),rules:i.formRules.lngMinute,label:"",density:"compact",variant:"outlined",class:"text-body-1 input-btn-bg-1",required:"",dense:""},null,8,["modelValue","rules"]),e[15]||(e[15]=o.createElementVNode("span",{class:"px-1"},"'",-1))]),_:1,__:[15]}),o.createVNode(p,{cols:"2",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(n,{variant:"outlined",density:"compact",width:"32","min-width":"32",height:"32",class:"text-body-1 bg-primary",style:{border:"1px solid rgba(var(--v-theme-on-surface), 0.38)"},onClick:e[5]||(e[5]=A=>i.form.lngDirection=i.form.lngDirection==="E"?"W":"E")},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.form.lngDirection),1)]),_:1})]),_:1})]),_:1}),o.createElementVNode("div",ah,[o.createElementVNode("div",ih,[o.createTextVNode(o.toDisplayString(t.$t("spot.dateTime")),1),e[16]||(e[16]=o.createElementVNode("span",{class:"text-danger"},"*",-1))])]),o.createVNode(g,{class:"ma-0 mb-4"},{default:o.withCtx(()=>[o.createVNode(p,{cols:"12",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(y,o.mergeProps({"date-time":i.form.dateTime,"time-zone":a.timeZone},t.$attrs,{onDateTime:e[6]||(e[6]=A=>i.form.dateTime=A)}),null,16,["date-time","time-zone"])]),_:1})]),_:1}),o.createElementVNode("div",rh,[o.createElementVNode("div",lh,[o.createTextVNode(o.toDisplayString(t.$t("weather.forecastModel")),1),e[17]||(e[17]=o.createElementVNode("span",{class:"text-danger"},"*",-1))])]),o.createVNode(g,{class:"ma-0 mb-2"},{default:o.withCtx(()=>[o.createVNode(p,{cols:"12",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(u,{modelValue:i.form.forecastModel,"onUpdate:modelValue":e[7]||(e[7]=A=>i.form.forecastModel=A),class:"w-100",rounded:"",height:"30",density:"compact",group:"",mandatory:""},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"30",value:"GFS",class:o.normalizeClass(["text-none flex-1-1-0",i.form.forecastModel==="GFS"?"":"btn-border-1 btn-bg-1"]),color:i.form.forecastModel==="GFS"?"primary":"","base-color":""},{default:o.withCtx(()=>e[18]||(e[18]=[o.createTextVNode(" NOAA ",-1)])),_:1,__:[18]},8,["class","color"]),o.createVNode(n,{density:"compact",height:"30",class:o.normalizeClass(["text-none flex-1-1-0",i.form.forecastModel==="ECMWF"?"":"btn-border-1 btn-bg-1"]),color:i.form.forecastModel==="ECMWF"?"primary":"","base-color":"",value:"ECMWF"},{default:o.withCtx(()=>e[19]||(e[19]=[o.createTextVNode(" ECMWF ",-1)])),_:1,__:[19]},8,["class","color"])]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),o.createVNode(d),o.createVNode(f,{class:"d-flex justify-end align-center ga-4 pa-4"},{default:o.withCtx(()=>[o.createVNode(n,{size:"small",variant:"tonal",class:"text-none text-body-1 btn-bg-1",onClick:l.cancelForm},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.clear")),1)]),_:1},8,["onClick"]),o.createVNode(n,{ref:"submitSpot",loading:i.loading,size:"small",variant:"flat",color:"primary",type:"submit",class:"text-none text-body-1"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.confirm")),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["onSubmit"])]),_:1},8,["style"])):o.createCommentVNode("",!0),i.showMeteo&&!a.simple?(o.openBlock(),o.createBlock(b,{key:1,id:"idm-gl4-spot-meteo",class:"spot-meteo",style:{width:"490px","z-index":"9"}},{default:o.withCtx(()=>[o.createVNode(s,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>[o.createElementVNode("div",nh,[e[20]||(e[20]=o.createElementVNode("i",{class:"iconfont icon-a-Spotweather text-h5 map-icon-aqua"},null,-1)),o.createElementVNode("div",sh,o.toDisplayString(l.computePosition(i.form||i.currentHourData)),1)]),o.createVNode(n,{class:"mr-n2",density:"comfortable",icon:"",variant:"plain",onClick:o.withModifiers(l.handleCloseMeteo,["stop"])},{default:o.withCtx(()=>e[21]||(e[21]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[21]},8,["onClick"])]),_:1}),o.createVNode(d),o.createVNode(h,{class:"text-body-1 px-0 py-1"},{default:o.withCtx(()=>{var A,x;return[o.createElementVNode("div",ch,[o.createElementVNode("div",mh,o.toDisplayString(t.$t("time.time")),1),o.createElementVNode("div",dh,o.toDisplayString(l.computedTzTime((A=i.currentHourData)==null?void 0:A.utc)),1)]),o.createElementVNode("div",hh,[e[22]||(e[22]=o.createElementVNode("div",{style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},"LT",-1)),o.createElementVNode("div",ph,o.toDisplayString(l.computedLocalTime((x=i.currentHourData)==null?void 0:x.utc)),1)]),o.createElementVNode("div",gh,[o.createElementVNode("div",uh,o.toDisplayString(t.$t("weather.wind")),1),o.createElementVNode("div",fh,o.toDisplayString(i.currentHourData.windDir??"-")+"/"+o.toDisplayString(i.currentHourData.windSpeed??"-")+"kts/BF"+o.toDisplayString(i.currentHourData.windLevel??"-"),1),o.createElementVNode("div",yh,o.toDisplayString(t.$t("weather.sigWave")),1),o.createElementVNode("div",bh,o.toDisplayString(i.currentHourData.sigwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.sigwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.sigwavePeriod??"-")+"s ",1)]),o.createElementVNode("div",wh,[o.createElementVNode("div",xh,o.toDisplayString(t.$t("weather.windWave")),1),o.createElementVNode("div",kh,o.toDisplayString(i.currentHourData.windwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.windwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.windwavePeriod??"-")+"s ",1),o.createElementVNode("div",Ah,o.toDisplayString(t.$t("weather.swell")),1),o.createElementVNode("div",Lh,o.toDisplayString(i.currentHourData.swellDir??"-")+"/"+o.toDisplayString(i.currentHourData.swellHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.swellPeriod??"-")+"s ",1)]),o.createElementVNode("div",Ch,[o.createElementVNode("div",zh,o.toDisplayString(t.$t("weather.current")),1),o.createElementVNode("div",vh,o.toDisplayString(i.currentHourData.currentDir??"-")+"/"+o.toDisplayString(i.currentHourData.currentSpeed??"-")+"kts",1),o.createElementVNode("div",_h,o.toDisplayString(t.$t("weather.visibility")),1),o.createElementVNode("div",Sh,o.toDisplayString(i.currentHourData.visibility??"-")+" nm",1)])]}),_:1}),o.createVNode(d),o.createVNode(f,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>{var A;return[(A=a.followList)!=null&&A.some(x=>{var C,k;return(x==null?void 0:x.id)===i.form.followId||((C=x==null?void 0:x.coordinate)==null?void 0:C.lng)===i.form.lng&&((k=x==null?void 0:x.coordinate)==null?void 0:k.lat)===i.form.lat})?(o.openBlock(),o.createBlock(n,{key:0,id:"idm-gl4-spot-meteo-follow",class:"text-none text-body-1",variant:"text",density:"compact",height:"32",onClick:o.withModifiers(l.handleCancelFollow,["stop"])},{prepend:o.withCtx(()=>e[23]||(e[23]=[o.createElementVNode("i",{class:"iconfont icon-yishoucang text-h6 text-warning"},null,-1)])),default:o.withCtx(()=>[o.createTextVNode(" "+o.toDisplayString(t.$t("actions.unfollow")),1)]),_:1},8,["onClick"])):(o.openBlock(),o.createBlock(n,{key:1,id:"idm-gl4-spot-meteo-unfollow",class:"text-none text-body-1",variant:"text",density:"compact",height:"32",onClick:o.withModifiers(l.handleFollow,["stop"])},{prepend:o.withCtx(()=>e[24]||(e[24]=[o.createElementVNode("i",{class:"iconfont icon-weishoucang text-h6"},null,-1)])),default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.follow"))+" ",1)]),_:1},8,["onClick"])),o.createVNode(n,{height:"32",variant:"text",density:"compact","append-icon":"mdi-chevron-right",class:"text-none text-body-1",onClick:o.withModifiers(l.handleMeteoMore,["stop"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("spot.forecast")),1)]),_:1},8,["onClick"])]}),_:1})]),_:1})):o.createCommentVNode("",!0),i.showMeteo&&a.simple?(o.openBlock(),o.createBlock(b,{key:2,ref:"spotMeteo",class:"position-absolute bottom-0 rounded-t-4",style:{width:"100vw","z-index":"1001"}},{default:o.withCtx(()=>[o.createVNode(s,null,{default:o.withCtx(()=>{var A;return[o.createElementVNode("div",Mh,[o.createElementVNode("div",Nh,[e[25]||(e[25]=o.createElementVNode("i",{class:"iconfont icon-a-Spotweather text-h5 map-icon-aqua"},null,-1)),o.createElementVNode("div",Ph,o.toDisplayString(l.computePosition(i.form||i.currentHourData)),1)]),o.createElementVNode("div",Vh,[(A=a.followList)!=null&&A.some(x=>{var C,k;return(x==null?void 0:x.id)===i.form.followId||((C=x==null?void 0:x.coordinate)==null?void 0:C.lng)===i.form.lng&&((k=x==null?void 0:x.coordinate)==null?void 0:k.lat)===i.form.lat})?(o.openBlock(),o.createBlock(n,{key:0,class:"text-none text-body-1 rounded-circle",variant:"text",density:"compact",height:"32",width:"28","min-width":"28",onClick:o.withModifiers(l.handleCancelFollow,["stop"])},{default:o.withCtx(()=>e[26]||(e[26]=[o.createElementVNode("i",{class:"iconfont icon-yishoucang text-h4 text-warning"},null,-1)])),_:1,__:[26]},8,["onClick"])):(o.openBlock(),o.createBlock(n,{key:1,class:"text-none text-body-1 rounded-circle",variant:"plain",density:"compact",height:"32",width:"28","min-width":"28",onClick:o.withModifiers(l.handleFollow,["stop"])},{default:o.withCtx(()=>e[27]||(e[27]=[o.createElementVNode("i",{class:"iconfont icon-weishoucang text-h4"},null,-1)])),_:1,__:[27]},8,["onClick"])),o.createVNode(n,{class:"mr-n2",density:"comfortable",icon:"",variant:"plain",onClick:o.withModifiers(l.handleCloseMeteo,["stop"])},{default:o.withCtx(()=>e[28]||(e[28]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[28]},8,["onClick"])])]),e[29]||(e[29]=o.createElementVNode("div",{class:"px-5 py-0 text-label text-body-1"},"Spot Weather",-1))]}),_:1,__:[29]}),o.createVNode(d),o.createVNode(h,{class:"text-body-1 px-0 py-2"},{default:o.withCtx(()=>{var A,x;return[o.createElementVNode("div",Th,[o.createElementVNode("div",Eh,o.toDisplayString(t.$t("time.time")),1),o.createElementVNode("div",Rh,o.toDisplayString(l.computedTzTime((A=i.currentHourData)==null?void 0:A.utc)),1)]),o.createElementVNode("div",Dh,[e[30]||(e[30]=o.createElementVNode("div",{style:{width:"60px"},class:"pa-0 pr-2 text-right opacity-50"},"LT",-1)),o.createElementVNode("div",Bh,o.toDisplayString(l.computedLocalTime((x=i.currentHourData)==null?void 0:x.utc)),1)]),o.createElementVNode("div",Ih,[o.createElementVNode("div",Fh,[o.createElementVNode("div",null,[o.createElementVNode("span",Gh,o.toDisplayString(t.$t("weather.wind")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.windDir??"-")+"/"+o.toDisplayString(i.currentHourData.windSpeed??"-")+"kts/BF"+o.toDisplayString(i.currentHourData.windLevel??"-"),1)]),o.createElementVNode("div",null,[o.createElementVNode("span",jh,o.toDisplayString(t.$t("weather.sigWave")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.sigwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.sigwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.sigwavePeriod??"-")+"s",1)]),o.createElementVNode("div",null,[o.createElementVNode("span",Wh,o.toDisplayString(t.$t("weather.windWave")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.windwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.windwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.windwavePeriod??"-")+"s",1)])]),o.createElementVNode("div",Zh,[o.createElementVNode("div",null,[o.createElementVNode("span",Xh,o.toDisplayString(t.$t("weather.swell")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.swellDir??"-")+"/"+o.toDisplayString(i.currentHourData.swellHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.swellPeriod??"-")+"s",1)]),o.createElementVNode("div",null,[o.createElementVNode("span",Hh,o.toDisplayString(t.$t("weather.current")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.currentDir??"-")+"/"+o.toDisplayString(i.currentHourData.currentSpeed??"-")+"kts",1)]),o.createElementVNode("div",null,[o.createElementVNode("span",Oh,o.toDisplayString(t.$t("weather.visibility")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.visibility??"-")+" nm",1)])])])]}),_:1})]),_:1},512)):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",Yh,[(o.openBlock(),o.createElementBlock("svg",Uh,[o.createElementVNode("use",{"xlink:href":`#icon-spot-${a.theme}`},null,8,Jh)]))],512),[[o.vShow,i.showMeteo]])])}const Qh=Y(Jd,[["render",Kh]]),zy="",qh={name:"IdmMeasure",props:{simple:{type:Boolean,default:!1},map:{type:Object},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}}},setup(){return{Theme:fe.useTheme()}},data(){return{right:10,toggle:!1,geojson:[],source:"measure-source",layer:"measure-layer",labelLayer:"measure-label-layer",sumLayer:"measure-suml-layer",tmpSource:"measure-tmp-source",tmpLayer:"measure-tmp-layer",tmpLabelLayer:"measure-tmp-label-layer",closeMarkers:{},pointMarkers:{},tipMarker:void 0,contextmenu:void 0,navigation:"RL",currentLineIndex:1}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})},immediate:!0},toggle:{handler(){var t,e,a;if(this.toggle)this.handleBind();else{(t=this.map)==null||t.getCanvas().removeEventListener("keydown",this.handleKeydown),(e=this.map)==null||e.off("mousemove",this.handleMove),(a=this.map)==null||a.off("dblclick",this.handleDblClick),this.map;let r=this.geojson.find(i=>!i.closed);r&&this.handleClear(r,!0),this.geojson=this.geojson.filter(i=>!!i.closed),r=E.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(r)}},immediate:!0},map:{handler(){this.map&&(this.toggle?this.handleBind():this.handleUnbind())}}},methods:{handleMenuToggle(){this.toggle=!this.toggle},handleBind(){var t,e,a,r,i;(t=this.map)==null||t.getCanvas().addEventListener("keydown",this.handleKeydown),(e=this.map)==null||e.on("mousemove",this.handleMove),(a=this.map)==null||a.on("dblclick",this.handleDblClick),(r=this.map)==null||r.on("click",this.handleClick),(i=this.map)==null||i.on("contextmenu",this.handleContextmenu),this.map&&(this.map.getCanvas().style.cursor="crosshair")},handleUnbind(){var t,e,a,r,i;(t=this.map)==null||t.getCanvas().removeEventListener("keydown",this.handleKeydown),(e=this.map)==null||e.off("mousemove",this.handleMove),(a=this.map)==null||a.off("dblclick",this.handleDblClick),(r=this.map)==null||r.off("click",this.handleClick),(i=this.map)==null||i.off("contextmenu",this.handleContextmenu);for(const l of this.geojson)this.handleClear(l,!0);this.geojson=[],this.map&&(this.map.getCanvas().style.cursor="grab")},handleKeydown(t){if(t.key==="Shift"){this.navigation=this.navigation==="RL"?"GC":"RL";const e=this.geojson.at(-1),a=e.features.filter(r=>r.geometry.type==="Point");a!=null&&a.length&&(a.at(-1).properties.mode=this.navigation),this.handleRender(e)}},handleDrag(t){var a,r,i,l,n,c,s,d,m,p;const e=(r=(a=t.target)==null?void 0:a._element)==null?void 0:r.id;if((e==null?void 0:e.split("-").length)===2){const g=this.geojson.filter(f=>f.id===e.split("-")[0])[0];this.pointMarkers[g.id].filter(f=>{var w;return((w=f._element)==null?void 0:w.id)===e})[0].setLngLat([(l=(i=t.target)==null?void 0:i._lngLat)==null?void 0:l.lng,(c=(n=t.target)==null?void 0:n._lngLat)==null?void 0:c.lat]);let u;g.features.forEach((f,w)=>{if(f.geometry.type==="Point"&&f.properties.id===e.split("-")[1]){u=w;return}});const h=g.features.filter(f=>f.geometry.type==="Point");this.handleTmpPointUpdate(g,h[u-1],{lng:(d=(s=t.target)==null?void 0:s._lngLat)==null?void 0:d.lng,lat:(p=(m=t.target)==null?void 0:m._lngLat)==null?void 0:p.lat,properties:h[u].properties},u===h.length-1?void 0:h[u+1])}},handleDragEnd(t){var a,r,i,l,n,c,s,d,m,p;const e=(r=(a=t.target)==null?void 0:a._element)==null?void 0:r.id;if((e==null?void 0:e.split("-").length)===2){const g=this.geojson.filter(h=>h.id===e.split("-")[0])[0];this.pointMarkers[g.id].filter(h=>{var f;return((f=h._element)==null?void 0:f.id)===e})[0].setLngLat([(l=(i=t.target)==null?void 0:i._lngLat)==null?void 0:l.lng,(c=(n=t.target)==null?void 0:n._lngLat)==null?void 0:c.lat]);const u=g.features.filter(h=>h.geometry.type==="Point"&&h.properties.id===e.split("-")[1])[0];u.geometry.coordinates=[(d=(s=t.target)==null?void 0:s._lngLat)==null?void 0:d.lng,(p=(m=t.target)==null?void 0:m._lngLat)==null?void 0:p.lat],g.features=g.features.filter(h=>h.geometry.type==="Point"),this.handlePointUpdate(g)}},handleContextmenu(t){var a,r,i,l;t.preventDefault(),(a=this.contextmenu)==null||a.remove();const e=(l=(i=(r=t.originalEvent)==null?void 0:r.target)==null?void 0:i.parentElement)==null?void 0:l.id;if((e==null?void 0:e.split("-").length)===2){const c=this.geojson.filter(s=>s.id===e.split("-")[0])[0].features.filter(s=>s.geometry.type==="Point");if(c.length>2&&c.filter(d=>d.properties.id===(e==null?void 0:e.split("-")[1]))[0]){const d=document.createElement("div");d.className="idm-gl4-measure-contextmenu-marker",d.innerHTML=`<span id="del-${e}" class="del-point">${this.$t("actions.detele")}</span>`,this.contextmenu=new ne.Marker(d).setOffset([24,0]).setLngLat([t.lngLat.lng,t.lngLat.lat]).addTo(this.map)}}},handleClick(t){var a,r,i,l,n,c;(a=this.contextmenu)==null||a.remove();const e=t.originalEvent.target.className;if(e==="marker-close"){const s=(i=(r=t.originalEvent)==null?void 0:r.srcElement)==null?void 0:i.id,d=this.geojson.filter(m=>m.id===s)[0];d&&this.handleClear(d,!0),this.geojson=this.geojson.filter(m=>m.id!==s),!this.toggle&&!((l=this.geojson)!=null&&l.some(m=>m.closed))&&this.handleUnbind()}else if(e==="del-point"){const s=(c=(n=t.originalEvent.target.id)==null?void 0:n.replace("del-",""))==null?void 0:c.split("-"),d=this.geojson.filter(m=>m.id===s[0])[0];d.features=d.features.filter(m=>m.geometry.type==="Point"&&m.properties.id!==s[1]),this.handlePointUpdate(d)}else if(e!=="marker-label"&&this.toggle){let s=this.geojson.at(-1);s||(s=E.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(s)),s.features=s.features.filter(m=>m.geometry.type==="Point");const d=E.feature({type:"Point",coordinates:[t.lngLat.lng,t.lngLat.lat]},{id:new Date().getTime().toString(),mode:this.navigation,sumLabel:"Start"});s.features.push(d),this.handlePointUpdate(s)}},handlePointUpdate(t){const e=t.features;if(e.length>1){let a=0;const r=[];for(let i=1;i<e.length;i++){const l=e[i-1],n=e[i],c=l.properties,s={lng:l.geometry.coordinates[0],lat:l.geometry.coordinates[1]},d={lng:n.geometry.coordinates[0],lat:n.geometry.coordinates[1]},m=N.LaneHelper.calculateDistance(s,d,c.mode==="RL",4),p=N.LaneHelper.calculateBearing(s,d,c.mode==="RL",2);a=N.LngLatHelper.roundPrecision(a+m,4);let g;c.mode==="RL"?g=N.LngLatHelper.convertToMonotonicLng([s,d]):g=N.LngLatHelper.convertToMonotonicLng(N.LaneHelper.interpolateCoordinates(s,d,200));const y=E.lineString(g.map(h=>[h.lng,h.lat]));y.properties.dist=m,y.properties.bearing=p,y.properties.total=a,y.properties.name="Line "+this.currentLineIndex,r.push(y);const u=e[i];u.properties.totalDist=N.LngLatHelper.roundPrecision((c.totalDist?c.totalDist:0)+m,4),u.properties.sumLabel=u.properties.totalDist+" nm"}e.push(...r),t.total=a}return this.handleRender(t),t},handleTmpPointUpdate(t,e,a,r){const i=E.featureCollection([]);let l,n;if(e){const s=e.properties,d={lng:e.geometry.coordinates[0],lat:e.geometry.coordinates[1]},m={lng:a.lng,lat:a.lat};l=N.LaneHelper.calculateDistance(d,m,s.mode==="RL",4),n=N.LaneHelper.calculateBearing(d,m,s.mode==="RL",2);let p;s.mode==="RL"?p=N.LngLatHelper.convertToMonotonicLng([d,m]):p=N.LngLatHelper.convertToMonotonicLng(N.LaneHelper.interpolateCoordinates(d,m,200));const g=E.lineString(p.map(y=>[y.lng,y.lat]));g.properties.dist=l,g.properties.bearing=n,i.features.push(g)}if(r){const s=a.properties,d=a,m={lng:r.geometry.coordinates[0],lat:r.geometry.coordinates[1]};l=N.LaneHelper.calculateDistance(d,m,s.mode==="RL",4),n=N.LaneHelper.calculateBearing(d,m,s.mode==="RL",2);let p;s.mode==="RL"?p=N.LngLatHelper.convertToMonotonicLng([d,m]):p=N.LngLatHelper.convertToMonotonicLng(N.LaneHelper.interpolateCoordinates(d,m,200));const g=E.lineString(p.map(y=>[y.lng,y.lat]));g.properties.dist=l,g.properties.bearing=n,i.features.push(g)}this.map.getSource(this.tmpSource)?this.map.getSource(this.tmpSource).setData(i):this.map.addSource(this.tmpSource,{type:"geojson",data:i}),this.map.getLayer(this.tmpLayer)||this.map.addLayer({id:this.tmpLayer,type:"line",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.Theme.current.value.colors["map-orange"],"line-width":2,"line-opacity":1,"line-dasharray":[3,2]}}),this.map.getLayer(this.tmpLabelLayer)||this.map.addLayer({id:this.tmpLabelLayer,type:"symbol",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist}nm / {bearing}°","text-rotation-alignment":"map","text-size":11,"text-offset":[0,-1]},paint:{"text-opacity":1,"text-color":this.Theme.current.value.colors["on-surface"]}});let c;if(r)c=`<div class="marker-label">${this.$t("measure.dragTips")}</div>`;else{const s=N.LngLatHelper.roundPrecision((t.total??0)+l,1);c=`<div class="marker-label">${this.$t("measure.totalDistance")}: <b>${s}</b>nm, ${this.$t("measure.bearing")}: <b>${n}</b>°</div><div class="marker-label"> ${this.$t("measure.mode")}${this.navigation==="RL"?"RL":"GC"}, ${this.$t("measure.switchTips")}</div><div class="marker-label">${this.$t("measure.clickTips")}</div>`}if(this.tipMarker)this.tipMarker._element.innerHTML=c,this.tipMarker.setLngLat([a.lng,a.lat]);else{const s=document.createElement("div");s.className="idm-gl4-measure-tip-marker",s.innerHTML=c,this.tipMarker=new ne.Marker(s).setOffset([140,0]).setLngLat([a.lng,a.lat]).addTo(this.map)}},handleMove(t){this.map.getCanvas().style.cursor="crosshair";let e=this.geojson.at(-1);e||(e=E.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e));const a=e.features.filter(r=>r.geometry.type==="Point");a!=null&&a.length&&this.handleTmpPointUpdate(e,a.at(-1),{lng:t.lngLat.lng,lat:t.lngLat.lat})},handleDblClick(t){t.preventDefault();let e=this.geojson.at(-1);e.closed=!0,this.handleRender(e),e=E.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e),this.currentLineIndex++},handleRender(t){var e;if((e=t==null?void 0:t.features)!=null&&e.length){const a=`${t.id}-${this.source}`,r=`${t.id}-${this.layer}`,i=`${t.id}-${this.labelLayer}`,l=`${t.id}-${this.sumLayer}`;this.map.getSource(a)?this.map.getSource(a).setData(t):this.map.addSource(a,{type:"geojson",data:t}),this.handleClear(t,!1),this.map.addLayer({id:r,type:"line",source:a,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.Theme.current.value.colors["map-orange"],"line-width":2}}),this.map.addLayer({id:i,type:"symbol",source:a,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist}nm / {bearing}°","text-rotation-alignment":"map","text-size":11,"text-offset":[0,-1]},paint:{"text-opacity":1,"text-color":this.Theme.current.value.colors["on-surface"]}}),this.map.addLayer({id:l,type:"symbol",source:a,filter:["==","$type","Point"],layout:{"text-field":"{sumLabel}","text-rotation-alignment":"map","text-size":12,"text-offset":[0,1.5]},paint:{"text-opacity":1,"text-color":this.Theme.current.value.colors["on-surface"]}});const n=t.features.filter(c=>c.geometry.type==="Point");for(const c of n){const s=document.createElement("div");s.id=`${t.id}-${c.properties.id}`,s.className=`${t.closed?"idm-gl4-measure-marker closed":"idm-gl4-measure-marker"}`,s.innerHTML='<div class="marker-circle"></div>';const d=new ne.Marker({element:s,draggable:!0,contextmenu:!0}).setLngLat(c.geometry.coordinates).addTo(this.map);d.on("drag",this.handleDrag),d.on("dragend",this.handleDragEnd),this.pointMarkers[t.id]?this.pointMarkers[t.id].push(d):this.pointMarkers[t.id]=[d]}if(t.closed){const c=n.at(-1),d=t.features.filter(p=>p.geometry.type==="LineString").at(-1),m=document.createElement("div");m.className="idm-gl4-measure-summary-marker",m.innerHTML=`<div class="marker-label">${d.properties.name}</div><div id="${t.id}" class="marker-close">X</div>`,this.closeMarkers[t.id]=new ne.Marker(m).setOffset([0,-30]).setLngLat(c.geometry.coordinates).addTo(this.map)}}},handleClear(t,e=!0){var n,c,s,d,m,p,g,y,u,h;const a=`${t.id}-${this.source}`,r=`${t.id}-${this.layer}`,i=`${t.id}-${this.labelLayer}`,l=`${t.id}-${this.sumLayer}`;(n=this.map)!=null&&n.getLayer(r)&&this.map.removeLayer(r),(c=this.map)!=null&&c.getLayer(i)&&this.map.removeLayer(i),(s=this.map)!=null&&s.getLayer(l)&&this.map.removeLayer(l),(d=this.map)!=null&&d.getLayer(this.tmpLayer)&&this.map.removeLayer(this.tmpLayer),(m=this.map)!=null&&m.getLayer(this.tmpLabelLayer)&&this.map.removeLayer(this.tmpLabelLayer),(p=this.closeMarkers[t.id])==null||p.remove(),this.closeMarkers[t.id]=void 0,(g=this.pointMarkers[t.id])==null||g.forEach(f=>{f==null||f.remove()}),this.pointMarkers[t.id]=[],(y=this.tipMarker)==null||y.remove(),this.tipMarker=void 0,e&&((u=this.map)!=null&&u.getSource(a))&&this.map.removeSource(a),e&&((h=this.map)!=null&&h.getSource(this.tmpSource))&&this.map.removeSource(this.tmpSource)}}},$h={class:"idm-gl4-measure"};function ep(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip");return o.openBlock(),o.createElementBlock("div",$h,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+166+"px",right:i.right+"px"})},[o.createVNode(c,{text:t.$t("measure.measure"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:s})=>[o.createVNode(n,o.mergeProps(s,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>e[0]||(e[0]=[o.createElementVNode("i",{class:"iconfont icon-a-Measuredistance text-h4"},null,-1)])),_:2,__:[0]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4)])}const tp=Y(qh,[["render",ep]]),vy="",op={name:"IdmDrawMarker",props:{map:{type:Object},gateway:{type:String},token:{type:String},simple:{type:Boolean,default:!1},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:()=>({})},editLayer:{type:Object,default:null},group:{type:Object,default:()=>({})}},emits:["close","save","hideLayer"],setup(){return{Theme:fe.useTheme()}},data(){var t;return{markerType:"Point",form:{latDegree:"",latMinute:"",latDir:"N",lngDegree:"",lngMinute:"",lngDir:"E",areaType:"Polygon",color:(t=this.Theme.current.value.colors)==null?void 0:t["map-green"],name:""},formRules:{lngDegree:[e=>e!=null&&e!==""||"required",e=>/^\d{1,3}$/.test(e)||"number",e=>parseInt(e)>=0&&parseInt(e)<=180||"0 ~ 180"],lngMinute:[e=>e==null||e===""||/^\d{1,2}(\.\d+)?$/.test(e)||"number",e=>e==null||e===""||parseInt(e)>=0&&parseInt(e)<=59||"0 ~ 59"],latDegree:[e=>e!=null&&e!==""||"required",e=>/^\d{1,2}$/.test(e)||"number",e=>parseInt(e)>=0&&parseInt(e)<=90||"0 ~ 90"],latMinute:[e=>e==null||e===""||/^\d{1,2}(\.\d+)?$/.test(e)||"number",e=>e==null||e===""||parseInt(e)>=0&&parseInt(e)<=59||"0 ~ 59"],color:[e=>e!=null&&e!==""||"required"],name:[e=>e!=null&&e!==""||"required"]},saving:!1,drawSource:"draw-marker-source",drawPointLayer:"draw-marker-point-layer",drawLineLayer:"draw-marker-line-layer",drawFillLayer:"draw-marker-fill-layer",drawTmpSource:"draw-marker-tmp-source",drawTmpLayer:"draw-marker-tmp-layer",drawCoords:[],rectCornerMarkers:[],polygonVertexMarkers:[],circleMarkers:[],drawRadiusSource:"draw-marker-radius-source",drawRadiusLayer:"draw-marker-radius-layer",tipMarker:null,pointMarker:null,pointHighlightMarker:null,editMarkers:[],deleteBtn:null,originalProperties:{}}},watch:{markerType:{handler(){var t;(t=this.editLayer)!=null&&t.id||(this.markerType==="Area"?this.form.name=`${this.form.areaType} 1`:this.form.name=`${this.markerType} 1`,this.handleClearDraw())},immediate:!0},"form.areaType"(){var t;(t=this.editLayer)!=null&&t.id||(this.markerType==="Area"?this.form.name=`${this.form.areaType} 1`:this.form.name=`${this.markerType} 1`,this.handleClearDraw())},map:{handler(){var t;this.map&&(this.handleBindMap(),(t=this.editLayer)!=null&&t.id&&this.loadEditLayer())},immediate:!0},"form.color":{handler(){this.handleChangePoint(),this.handleUpdateLayerColors()},immediate:!0}},beforeUnmount(){this.handleClearDraw(!0),this.handleUnbindMap()},methods:{handleClose(){this.handleClearDraw(!0),this.handleUnbindMap(),this.$emit("close")},handleBindMap(){var t,e;this.map&&(this.markerType==="Point"?(this.map.on("click",this.handleMapClickPoint),this.map.getCanvas().style.cursor="crosshair"):this.markerType==="Line"&&!((t=this.editLayer)!=null&&t.id)?(this.map.on("click",this.handleMapClickLine),this.map.on("mousemove",this.handleMapMoveLine),this.map.on("dblclick",this.handleMapDblClickLine),this.map.getCanvas().style.cursor="crosshair"):this.markerType==="Area"&&!((e=this.editLayer)!=null&&e.id)&&(this.form.areaType==="Polygon"?(this.map.on("click",this.handleMapClickPolygon),this.map.on("mousemove",this.handleMapMovePolygon),this.map.on("dblclick",this.handleMapDblClickPolygon)):this.form.areaType==="Circle"?(this.map.on("click",this.handleMapClickCircle),this.map.on("mousemove",this.handleMapMoveCircle)):this.form.areaType==="Rect"&&(this.map.on("click",this.handleMapClickRect),this.map.on("mousemove",this.handleMapMoveRect)),this.map.getCanvas().style.cursor="crosshair"))},handleUnbindMap(){this.map&&(this.map.off("click",this.handleMapClickPoint),this.map.off("click",this.handleMapClickLine),this.map.off("mousemove",this.handleMapMoveLine),this.map.off("dblclick",this.handleMapDblClickLine),this.map.off("click",this.handleMapClickPolygon),this.map.off("mousemove",this.handleMapMovePolygon),this.map.off("dblclick",this.handleMapDblClickPolygon),this.map.off("click",this.handleMapClickCircle),this.map.off("mousemove",this.handleMapMoveCircle),this.map.off("click",this.handleMapClickRect),this.map.off("mousemove",this.handleMapMoveRect),this.map.getCanvas().style.cursor="grab")},handleRebindMap(){this.handleUnbindMap(),this.handleBindMap()},loadEditLayer(){var i,l,n,c,s,d;if(!((i=this.editLayer)!=null&&i.extend)||!this.map)return;const t=typeof this.editLayer.extend=="string"?JSON.parse(this.editLayer.extend):this.editLayer.extend;if(!t)return;const a=(t.features||(t.type==="Feature"?[t]:[]))[0];if(!a)return;this.originalProperties=a.properties||{},this.form.name=this.editLayer.name||"",this.form.color=this.editLayer.color||((l=this.originalProperties)==null?void 0:l.color)||((n=this.Theme.current.value.colors)==null?void 0:n["map-green"])||"#4CAF50";const r=(c=a.geometry)==null?void 0:c.type;if(r==="Point"){this.markerType="Point";const[m,p]=a.geometry.coordinates;this.drawCoords=[[m,p]],this.form.latDegree=Number(N.LngLatHelper.lat2pretty(p).degree),this.form.latMinute=Number(N.LngLatHelper.lat2pretty(p).minute),this.form.latDir=N.LngLatHelper.lat2pretty(p).direction,this.form.lngDegree=Number(N.LngLatHelper.lng2pretty(m).degree),this.form.lngMinute=Number(N.LngLatHelper.lng2pretty(m).minute),this.form.lngDir=N.LngLatHelper.lng2pretty(m).direction,this.handleRenderPoint(this.drawCoords,this.form.color),this.setupPointEdit()}else r==="LineString"?(this.markerType="Line",this.$nextTick(()=>{this.handlerRenderEditLine(a),this.setupLineEdit(),this.handleUnbindMap()})):r==="Polygon"&&(this.markerType="Area",this.form.areaType=(d=(s=this.originalProperties)==null?void 0:s.shape)==null?void 0:d.toLowerCase(),this.$nextTick(()=>{this.handlerRenderEditPolygon(t),this.setupPolygonEdit(a),this.handleUnbindMap()}));this.$emit("hideLayer",this.editLayer.id)},setupPointEdit(){var a;if(!this.pointMarker)return;this.pointMarker.setDraggable(!0),this.pointMarker.off("drag",this.handlePointDrag),this.pointMarker.on("drag",this.handlePointDrag),this.pointMarker.off("dragend",this.handlePointDrag),this.pointMarker.on("dragend",this.handlePointDrag),(a=this.pointHighlightMarker)==null||a.remove();const t=document.createElement("div");t.className="idm-gl4-point-center-ring";const e=this.pointMarker.getLngLat();this.pointHighlightMarker=new ne.Marker({element:t,anchor:"center",offset:[0,0]}).setLngLat(e).addTo(this.map),this.pointMarker.on("drag",()=>{var r;(r=this.pointHighlightMarker)==null||r.setLngLat(this.pointMarker.getLngLat())})},handlePointDrag(){const{lng:t,lat:e}=this.pointMarker.getLngLat();this.drawCoords=[[t,e]],this.form.latDegree=Number(N.LngLatHelper.lat2pretty(e).degree),this.form.latMinute=Number(N.LngLatHelper.lat2pretty(e).minute),this.form.latDir=N.LngLatHelper.lat2pretty(e).direction,this.form.lngDegree=Number(N.LngLatHelper.lng2pretty(t).degree),this.form.lngMinute=Number(N.LngLatHelper.lng2pretty(t).minute),this.form.lngDir=N.LngLatHelper.lng2pretty(t).direction},clearEditMarkers(){this.editMarkers.forEach(t=>t.remove()),this.editMarkers=[],this._edgeContextMenuHandler&&this.map&&(this.map.off("contextmenu",this._edgeContextMenuHandler),this._edgeContextMenuHandler=null)},handlerRenderEditLine(t){this.drawCoords=t.geometry.coordinates.map(r=>[...r]);const e=E.featureCollection([t,...this.drawCoords.map(r=>E.point(r))]);this.handleSetDrawSource(e);const a=3;this.map.getLayer(this.drawLineLayer)||this.map.addLayer({id:this.drawLineLayer,type:"line",source:this.drawSource,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":a}})},setupLineEdit(){this.clearEditMarkers(),this.drawCoords.forEach((e,a)=>{const r=document.createElement("div");r.className="idm-gl4-edit-vertex",r.style.backgroundColor=this.form.color;const i=new ne.Marker({element:r,draggable:!0}).setLngLat(e).addTo(this.map);i.on("dragstart",()=>{this.map.getCanvas().style.cursor="pointer";const{lng:l,lat:n}=i.getLngLat();this.handleRenderVertexLabel([l,n],40)}),i.on("drag",()=>{this.map.getCanvas().style.cursor="pointer";const{lng:l,lat:n}=i.getLngLat();this.handleUpdateVertexLabel([l,n]),this.drawCoords[a]=[l,n],this.handlerRenderEditLine(E.lineString(this.drawCoords,{type:"Line",color:this.form.color}))}),i.on("dragend",()=>{this.map.getCanvas().style.cursor="grab";const{lng:l,lat:n}=i.getLngLat();this.drawCoords[a]=[l,n],this.handlerRenderEditLine(E.lineString(this.drawCoords,{type:"Line",color:this.form.color})),this.handleClearVertexLabels()}),r.addEventListener("contextmenu",l=>{l.preventDefault(),l.stopPropagation(),this.drawCoords.length>2&&this.showDeleteButton(e,()=>{this.drawCoords.splice(a,1),this.handlerRenderEditLine(E.lineString(this.drawCoords,{type:"Line",color:this.form.color})),this.setupLineEdit()})}),this.editMarkers.push(i)});const t=e=>{e.preventDefault();const{lng:a,lat:r}=e.lngLat,i=E.point([a,r]),l=E.lineString(this.drawCoords),n=E.nearestPointOnLine(l,i);if(n){const c=n.properties.index;this.showDeleteButton([a,r],()=>{this.drawCoords.splice(c+1,0,[a,r]),this.handlerRenderEditLine(E.lineString(this.drawCoords,{type:"Line",color:this.form.color})),this.setupLineEdit()},this.$t("actions.add")||"新增","add")}};this.map.on("contextmenu",t),this._edgeContextMenuHandler=t},showDeleteButton(t,e,a,r="delete"){this.hideDeleteButton();const i=this.map.getContainer(),l=document.createElement("button");l.textContent=a||this.$t("actions.delete"),l.className=r==="add"?"idm-gl4-edit-add-btn":"idm-gl4-edit-delete-btn";const n=this.map.project(t);l.style.left=`${n.x}px`,l.style.top=`${n.y}px`;const c=s=>{s.stopPropagation(),e(),this.hideDeleteButton()};l.addEventListener("click",c),i.appendChild(l),this.deleteBtn=l,this.map.once("click",()=>this.hideDeleteButton())},hideDeleteButton(){this.deleteBtn&&(this.deleteBtn.remove(),this.deleteBtn=null)},handlerRenderEditPolygon(t){this.handleSetDrawSource(t);const e=3;this.map.getLayer(this.drawFillLayer)?(this.map.setPaintProperty(this.drawLineLayer,"line-width",e),this.map.getLayer(this.drawPointLayer)&&this.map.setPaintProperty(this.drawPointLayer,"circle-color",this.form.color)):(this.map.addLayer({id:this.drawFillLayer,type:"fill",source:this.drawSource,filter:["==","$type","Polygon"],paint:{"fill-color":this.form.color,"fill-opacity":.35}}),this.map.addLayer({id:this.drawLineLayer,type:"line",source:this.drawSource,filter:["==","$type","Polygon"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":e}}),this.map.addLayer({id:this.drawPointLayer,type:"circle",source:this.drawSource,filter:["==","$type","Point"],paint:{"circle-radius":3,"circle-color":this.form.color,"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}}))},setupPolygonEdit(t){this.clearEditMarkers();const e=t.geometry.coordinates[0].slice(0,-1);this.drawCoords=e.map(r=>[...r]),this.drawCoords.forEach((r,i)=>{const l=document.createElement("div");l.className="idm-gl4-edit-vertex",l.style.backgroundColor=this.form.color;const n=new ne.Marker({element:l,draggable:!0}).setLngLat(r).addTo(this.map);n.on("dragstart",()=>{this.map.getCanvas().style.cursor="pointer";const{lng:c,lat:s}=n.getLngLat();this.handleRenderVertexLabel([c,s])}),n.on("drag",()=>{this.map.getCanvas().style.cursor="pointer";const{lng:c,lat:s}=n.getLngLat();this.handleUpdateVertexLabel([c,s]),this.drawCoords[i]=[c,s],this.handleRenderPolygonFill(this.drawCoords)}),n.on("dragend",()=>{this.map.getCanvas().style.cursor="grab";const{lng:c,lat:s}=n.getLngLat();this.drawCoords[i]=[c,s],this.handleRenderPolygonFill(this.drawCoords),this.handleClearVertexLabels()}),l.addEventListener("contextmenu",c=>{c.preventDefault(),c.stopPropagation(),this.drawCoords.length>3&&this.showDeleteButton(r,()=>{this.drawCoords.splice(i,1),this.handleRenderPolygonFill(this.drawCoords),this.handleClearVertexLabels(),this.setupPolygonEdit({geometry:{type:"Polygon",coordinates:[[...this.drawCoords,this.drawCoords[0]]]},properties:this.originalProperties})})}),this.editMarkers.push(n)});const a=r=>{r.preventDefault();const{lng:i,lat:l}=r.lngLat,n=E.point([i,l]),c=E.lineString([...this.drawCoords,this.drawCoords[0]]),s=E.nearestPointOnLine(c,n);if(s){const d=s.properties.index,m=d>=this.drawCoords.length-1?this.drawCoords.length-1:d;this.showDeleteButton([i,l],()=>{this.drawCoords.splice(m+1,0,[i,l]),this.handleRenderPolygonFill(this.drawCoords),this.handleClearVertexLabels(),this.setupPolygonEdit({geometry:{type:"Polygon",coordinates:[[...this.drawCoords,this.drawCoords[0]]]},properties:this.originalProperties})},this.$t("actions.add")||"新增","add")}};this.map.on("contextmenu",a),this._edgeContextMenuHandler=a},handleMapClickPoint(t){var r;const{lng:e,lat:a}=t.lngLat;this.drawCoords=[[e,a]],this.form.latDegree=Number(N.LngLatHelper.lat2pretty(a).degree),this.form.latMinute=Number(N.LngLatHelper.lat2pretty(a).minute),this.form.latDir=N.LngLatHelper.lat2pretty(a).direction,this.form.lngDegree=Number(N.LngLatHelper.lng2pretty(e).degree),this.form.lngMinute=Number(N.LngLatHelper.lng2pretty(e).minute),this.form.lngDir=N.LngLatHelper.lng2pretty(e).direction,this.handleRenderPoint(this.drawCoords,this.form.color),(r=this.editLayer)!=null&&r.id&&this.setupPointEdit()},handleChangePoint(){var g;const{latDegree:t,latMinute:e,latDir:a,lngDegree:r,lngMinute:i,lngDir:l}=this.form,n=parseFloat(t),c=parseFloat(e),s=parseFloat(r),d=parseFloat(i);if(isNaN(n)||isNaN(s))return;const m=(n+(isNaN(c)?0:c)/60)*(a==="S"?-1:1),p=(s+(isNaN(d)?0:d)/60)*(l==="W"?-1:1);this.drawCoords=[[p,m]],this.handleRenderPoint(this.drawCoords,this.form.color),(g=this.editLayer)!=null&&g.id&&this.setupPointEdit()},handleRenderPoint(t,e){var i;if((i=this.pointMarker)==null||i.remove(),!t||!t.length)return;const[a,r]=t[0];this.pointMarker=new ne.Marker({color:e}).setLngLat([a,r]).addTo(this.map)},handleMapClickLine(t){var r;const{lng:e,lat:a}=t.lngLat;this.drawCoords.push([e,a]),this.handleRenderLine(this.drawCoords),(r=this.editLayer)!=null&&r.id&&this.setupLineEdit()},handleMapMoveLine(t){if(!this.drawCoords.length)return;const{lng:e,lat:a}=t.lngLat;this.handleRenderTmpLine(this.drawCoords.at(-1),[e,a])},handleMapDblClickLine(t){t.preventDefault(),this.drawCoords.length>1&&this.drawCoords.pop(),this.handleRenderLine(this.drawCoords),this.handleClearTmp(),this.map.off("click",this.handleMapClickLine),this.map.off("mousemove",this.handleMapMoveLine),this.map.off("dblclick",this.handleMapDblClickLine)},handleRenderLine(t){if(!t||t.length<1)return;const e=[];t==null||t.forEach((i,l)=>{e.push(N.GeoJsonHelper.drawPoint(i==null?void 0:i[1],i==null?void 0:i[0]))}),(t==null?void 0:t.length)>=2&&e.push(N.GeoJsonHelper.drawLine(t));const a=2,r=E.featureCollection(e);this.handleSetDrawSource(r),this.map.getLayer(this.drawLineLayer)?(this.map.setPaintProperty(this.drawLineLayer,"line-color",this.form.color),this.map.setPaintProperty(this.drawLineLayer,"line-width",a),this.map.getLayer(this.drawPointLayer)&&this.map.setPaintProperty(this.drawPointLayer,"circle-color",this.form.color)):(this.map.addLayer({id:this.drawLineLayer,type:"line",source:this.drawSource,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":a}}),this.map.addLayer({id:this.drawPointLayer,type:"circle",source:this.drawSource,filter:["==","$type","Point"],paint:{"circle-radius":3,"circle-color":this.form.color,"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}}))},handleRenderTmpLine(t,e){const a=N.GeoJsonHelper.drawLine([t,e]),r=E.featureCollection([a]);this.map.getSource(this.drawTmpSource)?this.map.getSource(this.drawTmpSource).setData(r):this.map.addSource(this.drawTmpSource,{type:"geojson",data:r}),this.map.getLayer(this.drawTmpLayer)||this.map.addLayer({id:this.drawTmpLayer,type:"line",source:this.drawTmpSource,layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":2,"line-dasharray":[3,2]}});const i={lng:t[0],lat:t[1]},l={lng:e[0],lat:e[1]},n=N.LaneHelper.calculateDistance(i,l,!0,2),c=N.LaneHelper.calculateBearing(i,l,!0,2);let s=0;for(let m=1;m<this.drawCoords.length;m++){const p={lng:this.drawCoords[m-1][0],lat:this.drawCoords[m-1][1]},g={lng:this.drawCoords[m][0],lat:this.drawCoords[m][1]};s+=N.LaneHelper.calculateDistance(p,g,!0,4)}s=N.LngLatHelper.roundPrecision(s+n,1);const d=`
|
|
218
218
|
<div class="marker-label">${this.$t("measure.totalDistance")}: <b>${s}</b>nm, ${this.$t("measure.bearing")}: <b>${c}</b>°</div>
|
|
219
219
|
<div class="marker-label"> ${this.$t("measure.clickTips")}</div>`;if(this.tipMarker)this.tipMarker._element.innerHTML=d,this.tipMarker.setLngLat([e[0],e[1]]);else{const m=document.createElement("div");m.className="idm-gl4-draw-tip-marker",m.innerHTML=d,this.tipMarker=new ne.Marker(m).setOffset([140,0]).setLngLat([e[0],e[1]]).addTo(this.map)}},handleRefreshLine(){this.drawCoords.length>=1&&this.handleRenderLine(this.drawCoords)},handleMapClickPolygon(t){var r;const{lng:e,lat:a}=t.lngLat;this.drawCoords.push([e,a]),this.drawCoords.length>=3&&this.handleRenderPolygonFill(this.drawCoords),this.handleRenderAllVertexLabels(this.drawCoords),(r=this.editLayer)!=null&&r.id&&this.setupPolygonEdit()},handleMapMovePolygon(t){if(!this.drawCoords.length)return;const{lng:e,lat:a}=t.lngLat,r=[...this.drawCoords,[e,a]];r.length>=1&&this.handleRenderPolygonFill(r),this.handleRenderAllVertexLabels(r)},handleMapDblClickPolygon(t){t.preventDefault(),this.drawCoords.length>=1&&this.drawCoords.pop(),this.drawCoords.length>=1&&this.handleRenderPolygonFill(this.drawCoords),this.handleRenderAllVertexLabels(this.drawCoords),this.map.off("click",this.handleMapClickPolygon),this.map.off("mousemove",this.handleMapMovePolygon),this.map.off("dblclick",this.handleMapDblClickPolygon)},handleRenderPolygonFill(t){var i;let e=[];if(t==null||t.forEach((l,n)=>{e.push(E.point(l))}),(t==null?void 0:t.length)>2){const l=[...t,t[0]];e.push(N.GeoJsonHelper.drawPolygon(l,{...this.originalProperties}))}const a=E.featureCollection(e);this.handleSetDrawSource(a);const r=(i=this.editLayer)!=null&&i.id?3:2;this.map.getLayer(this.drawFillLayer)?(this.map.setPaintProperty(this.drawLineLayer,"line-width",r),this.map.getLayer(this.drawPointLayer)&&this.map.setPaintProperty(this.drawPointLayer,"circle-color",this.form.color)):(this.map.addLayer({id:this.drawFillLayer,type:"fill",source:this.drawSource,filter:["==","$type","Polygon"],paint:{"fill-color":this.form.color,"fill-opacity":.35}}),this.map.addLayer({id:this.drawLineLayer,type:"line",source:this.drawSource,filter:["==","$type","Polygon"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":r}}),this.map.addLayer({id:this.drawPointLayer,type:"circle",source:this.drawSource,filter:["==","$type","Point"],paint:{"circle-radius":3,"circle-color":this.form.color,"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}}))},handleRenderVertexLabel(t,e=8){this.handleClearVertexLabels();const a=N.LngLatHelper.lat2pretty(t[1],4).pretty,r=N.LngLatHelper.lng2pretty(t[0],4).pretty,i=document.createElement("div");i.className="idm-gl4-draw-corner-label center",i.innerHTML=`<span class="corner-text">${a} <br/> ${r}</span>`;const l=new ne.Marker(i,{anchor:"bottom",offset:[0,e]}).setLngLat(t).addTo(this.map);this.polygonVertexMarkers.push(l)},handleRenderAllVertexLabels(t){this.handleClearVertexLabels();const e=t.reduce((a,r)=>[a[0]+r[0],a[1]+r[1]],[0,0]);e[0]/=t.length,e[1]/=t.length,t.forEach(a=>{const r=a[0]-e[0],i=a[1]-e[1];let l="center";i>=0&&r>=0?l="bottom-left":i>=0&&r<0?l="bottom-right":i<0&&r>=0?l="top-left":l="top-right";const n=N.LngLatHelper.lat2pretty(a[1],4).pretty,c=N.LngLatHelper.lng2pretty(a[0],4).pretty,s=document.createElement("div");s.className="idm-gl4-draw-corner-label "+l,s.innerHTML=`<span class="corner-text">${n} <br/> ${c}</span>`;const d=new ne.Marker(s,{anchor:l}).setLngLat(a).addTo(this.map);this.polygonVertexMarkers.push(d)})},handleUpdateVertexLabel(t){if(!this.polygonVertexMarkers.length)return;const e=this.polygonVertexMarkers[0];e.setLngLat(t);const a=N.LngLatHelper.lat2pretty(t[1],4).pretty,r=N.LngLatHelper.lng2pretty(t[0],4).pretty,i=e.getElement().querySelector(".corner-text");i&&(i.innerHTML=`${a} <br/> ${r}`)},handleClearVertexLabels(){this.polygonVertexMarkers.forEach(t=>t.remove()),this.polygonVertexMarkers=[]},handleMapClickCircle(t){const{lng:e,lat:a}=t.lngLat;if(this.drawCoords.length===0){this.drawCoords.push([e,a]);const r=E.featureCollection([E.point([e,a])]);this.handleSetDrawSource(r),this.map.getLayer(this.drawPointLayer)||this.map.addLayer({id:this.drawPointLayer,type:"circle",source:this.drawSource,filter:["==","$type","Point"],paint:{"circle-radius":3,"circle-color":this.form.color,"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}}),this.handleRenderCircleCenterLabel([e,a])}else{const r=this.drawCoords[0],i=[e,a],l=E.distance(E.point(r),E.point(i),{units:"nauticalmiles"}),n=N.GeoJsonHelper.drawCircle(r[0],r[1],l),c=E.featureCollection([E.point(r),n]);this.handleSetDrawSource(c),this.handleRenderAreaLayers(),this.handleRenderRadiusLine(r,i,l),this.drawCoords=[r,i],this.map.off("click",this.handleMapClickCircle),this.map.off("mousemove",this.handleMapMoveCircle)}},handleMapMoveCircle(t){if(this.drawCoords.length!==1)return;const e=this.drawCoords[0],a=[t.lngLat.lng,t.lngLat.lat],r=E.distance(E.point(e),E.point(a),{units:"nauticalmiles"}),i=N.GeoJsonHelper.drawCircle(e[0],e[1],r),l=E.featureCollection([E.point(e),i]);this.handleSetDrawSource(l),this.map.getLayer(this.drawFillLayer)||this.handleRenderAreaLayers(),this.handleRenderRadiusLine(e,a,r)},handleRenderCircleCenterLabel(t){const e=N.LngLatHelper.lat2pretty(t[1],4).pretty,a=N.LngLatHelper.lng2pretty(t[0],4).pretty,r=document.createElement("div");r.className="idm-gl4-draw-corner-label bottom-right",r.innerHTML=`<span class="corner-text">${e} <br/> ${a}</span>`;const i=new ne.Marker(r,{anchor:"bottom-right"}).setLngLat(t).addTo(this.map);this.circleMarkers.push(i)},handleRenderRadiusLine(t,e,a){const r=N.LngLatHelper.roundPrecision(a,2),i=E.featureCollection([E.lineString([t,e])]);this.map.getSource(this.drawRadiusSource)?this.map.getSource(this.drawRadiusSource).setData(i):this.map.addSource(this.drawRadiusSource,{type:"geojson",data:i}),this.map.getLayer(this.drawRadiusLayer)||this.map.addLayer({id:this.drawRadiusLayer,type:"line",source:this.drawRadiusSource,layout:{"line-cap":"round"},paint:{"line-color":this.form.color,"line-width":1.5,"line-dasharray":[4,3]}});const l=[(t[0]+e[0])/2,(t[1]+e[1])/2],n=this.map.project(t),c=this.map.project(e),s=c.x-n.x,d=c.y-n.y;let m=Math.atan2(d,s)*180/Math.PI;m>90&&(m-=180),m<-90&&(m+=180);const p=16,g=(m-90)*Math.PI/180,y=Math.round(Math.cos(g)*p),u=Math.round(Math.sin(g)*p);this.circleMarkers.length>1&&(this.circleMarkers[1].remove(),this.circleMarkers.splice(1,1));const h=document.createElement("div"),f=document.createElement("span");f.className="idm-gl4-draw-radius-label",f.style.transform=`rotate(${m}deg)`,f.style.transformOrigin="center",f.style.display="inline-block",f.textContent=`${r} nm`,h.appendChild(f);const w=new ne.Marker(h,{anchor:"center",offset:[y,u]}).setLngLat(l).addTo(this.map);this.circleMarkers.push(w)},handleClearCircleLabels(){var t,e;this.circleMarkers.forEach(a=>a.remove()),this.circleMarkers=[],(t=this.map)!=null&&t.getLayer(this.drawRadiusLayer)&&this.map.removeLayer(this.drawRadiusLayer),(e=this.map)!=null&&e.getSource(this.drawRadiusSource)&&this.map.removeSource(this.drawRadiusSource)},buildRectFeatureCollection(t,e){const a=Math.min(t[0],e[0]),r=Math.max(t[0],e[0]),i=Math.min(t[1],e[1]),l=Math.max(t[1],e[1]);return[[a,l],[r,l],[r,i],[a,i]]},handleMapClickRect(t){const{lng:e,lat:a}=t.lngLat;if(this.drawCoords.length===0)this.drawCoords.push([e,a]);else{const r=this.drawCoords[0],i=[e,a],l=N.GeoJsonHelper.drawRect(r,i);delete l.bbox;const n=this.buildRectFeatureCollection(r,i),c=E.featureCollection([l,...n.map(s=>E.point(s))]);this.handleSetDrawSource(c),this.handleRenderRectLayers(),this.handleRenderRectCorners(r,i),this.drawCoords=[r,i],this.map.off("click",this.handleMapClickRect),this.map.off("mousemove",this.handleMapMoveRect)}},handleMapMoveRect(t){if(this.drawCoords.length!==1)return;const e=this.drawCoords[0],a=[t.lngLat.lng,t.lngLat.lat],r=N.GeoJsonHelper.drawRect(e,a),i=this.buildRectFeatureCollection(e,a),l=E.featureCollection([r,...i.map(n=>E.point(n))]);this.handleSetDrawSource(l),this.map.getLayer(this.drawFillLayer)||this.handleRenderRectLayers(),this.handleRenderRectCorners(e,a)},handleRenderRectLayers(){var e;const t=(e=this.editLayer)!=null&&e.id?3:2;this.map.getLayer(this.drawFillLayer)||this.map.addLayer({id:this.drawFillLayer,type:"fill",source:this.drawSource,filter:["==","$type","Polygon"],paint:{"fill-color":this.form.color,"fill-opacity":.35}}),this.map.getLayer(this.drawLineLayer)?this.map.setPaintProperty(this.drawLineLayer,"line-width",t):this.map.addLayer({id:this.drawLineLayer,type:"line",source:this.drawSource,filter:["==","$type","Polygon"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":t}}),this.map.getLayer(this.drawPointLayer)||this.map.addLayer({id:this.drawPointLayer,type:"circle",source:this.drawSource,filter:["==","$type","Point"],paint:{"circle-radius":3,"circle-color":this.form.color,"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}})},handleRenderRectCorners(t,e){const a=Math.min(t[0],e[0]),r=Math.max(t[0],e[0]),i=Math.min(t[1],e[1]),l=Math.max(t[1],e[1]),n=[{coord:[a,l],anchor:"bottom-right"},{coord:[r,l],anchor:"bottom-left"},{coord:[r,i],anchor:"top-left"},{coord:[a,i],anchor:"top-right"}];this.handleClearRectCorners(),n.forEach(({coord:c,anchor:s})=>{const d=N.LngLatHelper.lat2pretty(c[1],4).pretty,m=N.LngLatHelper.lng2pretty(c[0],4).pretty,p=document.createElement("div");p.className="idm-gl4-draw-corner-label "+s,p.innerHTML=`<span class="corner-text">${d} <br/> ${m}</span>`;const g=new ne.Marker(p,{anchor:s}).setLngLat(c).addTo(this.map);this.rectCornerMarkers.push(g)})},handleClearRectCorners(){this.rectCornerMarkers.forEach(t=>t.remove()),this.rectCornerMarkers=[]},handleRenderAreaLayers(){var e;const t=(e=this.editLayer)!=null&&e.id?3:2;this.map.getLayer(this.drawFillLayer)||this.map.addLayer({id:this.drawFillLayer,type:"fill",source:this.drawSource,filter:["==","$type","Polygon"],paint:{"fill-color":this.form.color,"fill-opacity":.35}}),this.map.getLayer(this.drawLineLayer)?this.map.setPaintProperty(this.drawLineLayer,"line-width",t):this.map.addLayer({id:this.drawLineLayer,type:"line",source:this.drawSource,filter:["==","$type","Polygon"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.form.color,"line-width":t}})},handleSetDrawSource(t){this.map.getSource(this.drawSource)?this.map.getSource(this.drawSource).setData(t):this.map.addSource(this.drawSource,{type:"geojson",data:t})},handleClearTmp(){var t,e,a;(t=this.map)!=null&&t.getLayer(this.drawTmpLayer)&&this.map.removeLayer(this.drawTmpLayer),(e=this.map)!=null&&e.getSource(this.drawTmpSource)&&this.map.removeSource(this.drawTmpSource),(a=this.tipMarker)==null||a.remove(),this.tipMarker=null},handleUpdateLayerColors(){if(!this.map)return;const t=this.form.color;this.map.getLayer(this.drawPointLayer)&&this.map.setPaintProperty(this.drawPointLayer,"circle-color",t),this.map.getLayer(this.drawLineLayer)&&this.map.setPaintProperty(this.drawLineLayer,"line-color",t),this.map.getLayer(this.drawFillLayer)&&this.map.setPaintProperty(this.drawFillLayer,"fill-color",t),this.map.getLayer(this.drawRadiusLayer)&&this.map.setPaintProperty(this.drawRadiusLayer,"line-color",t),this.map.getLayer(this.drawTmpLayer)&&this.map.setPaintProperty(this.drawTmpLayer,"line-color",t),this.editMarkers.forEach(e=>{e.getElement()&&(e.getElement().style.backgroundColor=t)})},handleClearDraw(t=!1){var a,r,i,l,n;this.handleClearTmp(),this.hideDeleteButton();const e=[this.drawPointLayer,this.drawLineLayer,this.drawFillLayer];for(const c of e)(a=this.map)!=null&&a.getLayer(c)&&((r=this.map)==null||r.removeLayer(c));(i=this.map)!=null&&i.getSource(this.drawSource)&&this.map.removeSource(this.drawSource),this.drawCoords=[],this.originalProperties={},this.handleClearRectCorners(),this.handleClearVertexLabels(),this.handleClearCircleLabels(),(l=this.pointMarker)==null||l.remove(),this.pointMarker=null,(n=this.pointHighlightMarker)==null||n.remove(),this.pointHighlightMarker=null,this.clearEditMarkers(),this.handleRebindMap()},async handleSave(){var r,i;let t=null;if(this.markerType==="Point"?await this.$refs.pointForm.validate().then(l=>{var n;if(l!=null&&l.valid){if(!this.drawCoords.length)return;const[c,s]=this.drawCoords[0];t=E.featureCollection([N.GeoJsonHelper.drawPoint(s,c,{...this.originalProperties,color:this.form.color,name:this.form.name})]),(n=t.features)==null||n.forEach(d=>{d.properties.color=this.form.color,d.properties.name=this.form.name})}}):this.markerType==="Line"?await this.$refs.lineForm.validate().then(l=>{if(l!=null&&l.valid){if(this.drawCoords.length<2)return;const n=[],c=N.LaneHelper.generateRouteAccordingToWaypoints(this.drawCoords.map(s=>({lng:s==null?void 0:s[0],lat:s==null?void 0:s[1]})));for(const s of c)s.length>1&&n.push(N.GeoJsonHelper.drawLine(s,{properties:{...this.originalProperties,color:this.form.color,name:this.form.name}}));t=E.featureCollection(n)}}):this.markerType==="Area"&&await this.$refs.areaForm.validate().then(l=>{var n,c,s;if(l!=null&&l.valid){const d=(n=this.map)==null?void 0:n.getSource(this.drawSource);if(!d)return;const m=d._data;if(!((c=m==null?void 0:m.features)!=null&&c.length))return;let p=((s=m.features)==null?void 0:s.filter(g=>g.geometry.type==="Polygon"))||[];if(p=p==null?void 0:p.map(g=>(g.properties.name=this.form.name,g.properties.color=this.form.color,g)),!p.length)return;t=E.featureCollection(p)}}),!t)return!1;const e={name:this.form.name,format:"geojson",color:this.form.color,extend:t};this.saving=!0,await((r=this.editLayer)!=null&&r.id?le.put(`${this.gateway}/api/arc/layers/${this.editLayer.id}`,e,{headers:{Authorization:this.token||this.defaultMeteoToken,version:"new"}}):le.post(`${this.gateway}/api/arc/lygroups/${(i=this.group)==null?void 0:i.id}/layers`,e,{headers:{Authorization:this.token||this.defaultMeteoToken,version:"new"}})).then(l=>{var n,c,s,d;((n=l.data)==null?void 0:n.code)===0&&this.$emit("save",{...e,id:((c=this.editLayer)==null?void 0:c.id)||((d=(s=l.data)==null?void 0:s.data)==null?void 0:d.id)}),this.saving=!1}).catch(l=>{console.error("save marker error",l),this.saving=!1})}}},ap={class:"text-h6 font-weight-600"},ip={class:"text-label mb-1"},rp={class:"text-label mb-1"},lp={class:"mb-1"},np={class:"text-label mb-1"},sp={class:"mb-1"},cp={class:"text-label mb-1"},mp={class:"mb-1"},dp={class:"text-label mb-1"},hp={class:"color-picker-row d-flex align-start ga-2"},pp=["value"],gp={class:"mb-n2"},up={class:"text-label mb-1"},fp={class:"mb-1"},yp={class:"text-label mb-1"},bp={class:"color-picker-row d-flex align-start ga-2"},wp=["value"],xp={class:"mb-n2"},kp={class:"text-label mb-1"},Ap={key:0,class:"mb-3"},Lp={class:"text-label mb-1"},Cp={class:"mb-1"},zp={class:"text-label mb-1"},vp={class:"color-picker-row d-flex align-start ga-2"},_p=["value"],Sp={class:"mb-n2"},Mp={class:"text-label mb-1"};function Np(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VCardTitle"),s=o.resolveComponent("VDivider"),d=o.resolveComponent("VTextField"),m=o.resolveComponent("VCardText"),p=o.resolveComponent("VBtnToggle"),g=o.resolveComponent("VCol"),y=o.resolveComponent("VRow"),u=o.resolveComponent("VCardActions"),h=o.resolveComponent("VForm"),f=o.resolveComponent("VCard");return o.openBlock(),o.createBlock(f,{class:"idm-gl4-draw-dialog-card",elevation:"4"},{default:o.withCtx(()=>{var w;return[o.createVNode(c,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>{var b;return[o.createElementVNode("span",ap,o.toDisplayString((b=a.editLayer)!=null&&b.id?t.$t("actions.edit"):t.$t("actions.addMarker")),1),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleClose},{default:o.withCtx(()=>e[21]||(e[21]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[21]},8,["onClick"])]}),_:1}),o.createVNode(s),o.createVNode(m,{class:"text-body-1 px-4 pb-0"},{default:o.withCtx(()=>{var b;return[o.createElementVNode("div",ip,o.toDisplayString(t.$t("marker.group")),1),o.createVNode(d,{"model-value":(b=a.group)==null?void 0:b.name,density:"compact",variant:"outlined","hide-details":"",disabled:"",class:"input-btn-bg-1"},null,8,["model-value"])]}),_:1}),(w=a.editLayer)!=null&&w.id?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(m,{key:0,class:"text-body-1 px-4 pb-0"},{default:o.withCtx(()=>{var b;return[o.createElementVNode("div",rp,[o.createTextVNode(o.toDisplayString(t.$t("marker.markerType")),1),e[22]||(e[22]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createVNode(p,{modelValue:i.markerType,"onUpdate:modelValue":e[0]||(e[0]=A=>i.markerType=A),mandatory:"",group:"",density:"compact",variant:"flat",class:"w-100",disabled:!!((b=a.editLayer)!=null&&b.id)},{default:o.withCtx(()=>[o.createVNode(n,{value:"Point",class:o.normalizeClass(["flex-1-1-0 text-none text-body-1",i.markerType==="Point"?"":"btn-border-1 btn-bg-1"]),color:i.markerType==="Point"?"primary":"","base-color":"",height:"32px","min-height":"32px"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("marker.point")),1)]),_:1},8,["class","color"]),o.createVNode(n,{value:"Line",class:o.normalizeClass(["flex-1-1-0 text-none text-body-1",i.markerType==="Line"?"":"btn-border-1 btn-bg-1"]),style:{"border-left":"0 !important","border-right":"0 !important"},color:i.markerType==="Line"?"primary":"",height:"32px","min-height":"32px"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("marker.line")),1)]),_:1},8,["class","color"]),o.createVNode(n,{value:"Area",class:o.normalizeClass(["flex-1-1-0 text-none text-body-1",i.markerType==="Area"?"":"btn-border-1 btn-bg-1"]),color:i.markerType==="Area"?"primary":"",height:"32px","min-height":"32px"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("marker.area")),1)]),_:1},8,["class","color"])]),_:1},8,["modelValue","disabled"])]}),_:1})),i.markerType==="Point"?(o.openBlock(),o.createBlock(h,{key:1,ref:"pointForm",autocomplete:"off",class:"form-box",onSubmit:o.withModifiers(l.handleSave,["prevent"])},{default:o.withCtx(()=>[o.createVNode(m,{class:"px-4 text-body-1"},{default:o.withCtx(()=>[o.createElementVNode("div",lp,[o.createElementVNode("div",np,[o.createTextVNode(o.toDisplayString(t.$t("marker.lat")),1),e[23]||(e[23]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createVNode(y,{class:"ma-0"},{default:o.withCtx(()=>[o.createVNode(g,{cols:"4",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(d,{modelValue:i.form.latDegree,"onUpdate:modelValue":[e[1]||(e[1]=b=>i.form.latDegree=b),e[2]||(e[2]=b=>l.handleChangePoint())],rules:i.formRules.latDegree,label:"",autocomplete:"off",density:"compact",variant:"outlined",height:"32px","min-height":"32px",required:"",dense:"",class:"text-body-1 input-btn-bg-1"},null,8,["modelValue","rules"]),e[24]||(e[24]=o.createElementVNode("span",{class:"px-1"},"°",-1))]),_:1,__:[24]}),o.createVNode(g,{cols:"6",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(d,{modelValue:i.form.latMinute,"onUpdate:modelValue":[e[3]||(e[3]=b=>i.form.latMinute=b),e[4]||(e[4]=b=>l.handleChangePoint())],rules:i.formRules.latMinute,label:"",height:"32px","min-height":"32px",autocomplete:"off",density:"compact",variant:"outlined",class:"text-body-1 input-btn-bg-1",required:"",dense:""},null,8,["modelValue","rules"]),e[25]||(e[25]=o.createElementVNode("span",{class:"px-1"},"'",-1))]),_:1,__:[25]}),o.createVNode(g,{cols:"2",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(n,{variant:"outlined",density:"compact",width:"32","min-width":"32",height:"32",class:"text-body-1 bg-primary",style:{border:"1px solid rgba(var(--v-theme-on-surface), 0.38)"},onClick:e[5]||(e[5]=b=>{i.form.latDir=i.form.latDir==="N"?"S":"N",l.handleChangePoint()})},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.form.latDir),1)]),_:1})]),_:1})]),_:1})]),o.createElementVNode("div",sp,[o.createElementVNode("div",cp,[o.createTextVNode(o.toDisplayString(t.$t("marker.lng")),1),e[26]||(e[26]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createVNode(y,{class:"ma-0"},{default:o.withCtx(()=>[o.createVNode(g,{cols:"4",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(d,{modelValue:i.form.lngDegree,"onUpdate:modelValue":[e[6]||(e[6]=b=>i.form.lngDegree=b),e[7]||(e[7]=b=>l.handleChangePoint())],rules:i.formRules.lngDegree,density:"compact",variant:"outlined",autocomplete:"off",class:"text-body-1 input-btn-bg-1"},null,8,["modelValue","rules"]),e[27]||(e[27]=o.createElementVNode("span",{class:"px-1"},"°",-1))]),_:1,__:[27]}),o.createVNode(g,{cols:"6",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(d,{modelValue:i.form.lngMinute,"onUpdate:modelValue":[e[8]||(e[8]=b=>i.form.lngMinute=b),e[9]||(e[9]=b=>l.handleChangePoint())],rules:i.formRules.lngMinute,density:"compact",variant:"outlined",autocomplete:"off",class:"text-body-1 input-btn-bg-1"},null,8,["modelValue","rules"]),e[28]||(e[28]=o.createElementVNode("span",{class:"px-1"},"'",-1))]),_:1,__:[28]}),o.createVNode(g,{cols:"2",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(n,{variant:"outlined",density:"compact",width:"32","min-width":"32",height:"32",class:"text-body-1 bg-primary",style:{border:"1px solid rgba(var(--v-theme-on-surface), 0.38)"},onClick:e[10]||(e[10]=b=>{i.form.lngDir=i.form.lngDir==="E"?"W":"E",l.handleChangePoint()})},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.form.lngDir),1)]),_:1})]),_:1})]),_:1})]),o.createElementVNode("div",mp,[o.createElementVNode("div",dp,[o.createTextVNode(o.toDisplayString(t.$t("marker.color")),1),e[29]||(e[29]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createElementVNode("div",hp,[o.createElementVNode("input",{type:"color",value:i.form.color,class:"native-color-picker cursor-pointer",onInput:e[11]||(e[11]=b=>i.form.color=b.target.value)},null,40,pp),o.createVNode(d,{modelValue:i.form.color,"onUpdate:modelValue":e[12]||(e[12]=b=>i.form.color=b),rules:i.formRules.color,density:"compact",variant:"outlined",class:"flex-1-1-0 input-btn-bg-1"},null,8,["modelValue","rules"])])]),o.createElementVNode("div",gp,[o.createElementVNode("div",up,[o.createTextVNode(o.toDisplayString(t.$t("marker.name")),1),e[30]||(e[30]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createVNode(d,{modelValue:i.form.name,"onUpdate:modelValue":e[13]||(e[13]=b=>i.form.name=b),density:"compact",variant:"outlined",rules:i.formRules.name,autocomplete:"off",class:"input-btn-bg-1"},null,8,["modelValue","rules"])])]),_:1}),o.createVNode(s),o.createVNode(u,{class:"w-100 d-flex justify-end align-center ga-4 pa-4"},{default:o.withCtx(()=>[o.createVNode(n,{class:"text-none text-body-1",variant:"tonal",density:"comfortable",onClick:l.handleClearDraw},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.clear")),1)]),_:1},8,["onClick"]),o.createVNode(n,{class:"text-none text-body-1",variant:"flat",color:"primary",density:"comfortable",type:"submit",loading:i.saving},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.save")),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["onSubmit"])):o.createCommentVNode("",!0),i.markerType==="Line"?(o.openBlock(),o.createBlock(h,{key:2,ref:"lineForm",autocomplete:"off",class:"form-box",onSubmit:o.withModifiers(l.handleSave,["prevent"])},{default:o.withCtx(()=>[o.createVNode(m,{class:"px-4 text-body-1"},{default:o.withCtx(()=>[o.createElementVNode("div",fp,[o.createElementVNode("div",yp,[o.createTextVNode(o.toDisplayString(t.$t("marker.color")),1),e[31]||(e[31]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createElementVNode("div",bp,[o.createElementVNode("input",{type:"color",value:i.form.color,class:"native-color-picker cursor-pointer",onInput:e[14]||(e[14]=b=>i.form.color=b.target.value)},null,40,wp),o.createVNode(d,{modelValue:i.form.color,"onUpdate:modelValue":e[15]||(e[15]=b=>i.form.color=b),rules:i.formRules.color,density:"compact",variant:"outlined",class:"flex-1-1-0 input-btn-bg-1"},null,8,["modelValue","rules"])])]),o.createElementVNode("div",xp,[o.createElementVNode("div",kp,[o.createTextVNode(o.toDisplayString(t.$t("marker.name")),1),e[32]||(e[32]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createVNode(d,{modelValue:i.form.name,"onUpdate:modelValue":e[16]||(e[16]=b=>i.form.name=b),density:"compact",variant:"outlined",rules:i.formRules.name,autocomplete:"off",class:"input-btn-bg-1"},null,8,["modelValue","rules"])])]),_:1}),o.createVNode(s),o.createVNode(u,{class:"w-100 d-flex justify-end align-center ga-4 pa-4"},{default:o.withCtx(()=>[o.createVNode(n,{class:"text-none text-body-1",variant:"tonal",density:"comfortable",onClick:l.handleClearDraw},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.clear")),1)]),_:1},8,["onClick"]),o.createVNode(n,{class:"text-none text-body-1",variant:"flat",color:"primary",density:"comfortable",type:"submit",loading:i.saving},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.save")),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["onSubmit"])):o.createCommentVNode("",!0),i.markerType==="Area"?(o.openBlock(),o.createBlock(h,{key:3,ref:"areaForm",autocomplete:"off",class:"form-box",onSubmit:o.withModifiers(l.handleSave,["prevent"])},{default:o.withCtx(()=>[o.createVNode(m,{class:"px-4 text-body-1"},{default:o.withCtx(()=>{var b,A;return[(b=a.editLayer)!=null&&b.id?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Ap,[o.createElementVNode("div",Lp,[o.createTextVNode(o.toDisplayString(t.$t("marker.areaType")),1),e[33]||(e[33]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createVNode(p,{modelValue:i.form.areaType,"onUpdate:modelValue":e[17]||(e[17]=x=>i.form.areaType=x),mandatory:"",group:"",density:"compact",variant:"flat",color:"primary",class:"w-100",disabled:!!((A=a.editLayer)!=null&&A.id)},{default:o.withCtx(()=>[o.createVNode(n,{value:"Polygon",class:o.normalizeClass(["flex-1-1-0 text-none text-body-1",i.form.areaType==="Polygon"?"":"btn-border-1 btn-bg-1"]),color:i.form.areaType==="Polygon"?"primary":"","base-color":"",height:"32px","min-height":"32px"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("marker.polygon")),1)]),_:1},8,["class","color"]),o.createVNode(n,{value:"Circle",class:o.normalizeClass(["flex-1-1-0 text-none text-body-1",i.form.areaType==="Circle"?"":"btn-border-1 btn-bg-1"]),style:{"border-left":"0 !important","border-right":"0 !important"},color:i.form.areaType==="Circle"?"primary":"","base-color":"",height:"32px","min-height":"32px"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("marker.circle")),1)]),_:1},8,["class","color"]),o.createVNode(n,{value:"Rect",class:o.normalizeClass(["flex-1-1-0 text-none text-body-1",i.form.areaType==="Rect"?"":"btn-border-1 btn-bg-1"]),color:i.form.areaType==="Rect"?"primary":"","base-color":"",height:"32px","min-height":"32px"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("marker.rect")),1)]),_:1},8,["class","color"])]),_:1},8,["modelValue","disabled"])])),o.createElementVNode("div",Cp,[o.createElementVNode("div",zp,[o.createTextVNode(o.toDisplayString(t.$t("marker.color")),1),e[34]||(e[34]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createElementVNode("div",vp,[o.createElementVNode("input",{type:"color",value:i.form.color,class:"native-color-picker cursor-pointer",onInput:e[18]||(e[18]=x=>i.form.color=x.target.value)},null,40,_p),o.createVNode(d,{modelValue:i.form.color,"onUpdate:modelValue":e[19]||(e[19]=x=>i.form.color=x),rules:i.formRules.color,density:"compact",variant:"outlined",class:"flex-1-1-0 input-btn-bg-1"},null,8,["modelValue","rules"])])]),o.createElementVNode("div",Sp,[o.createElementVNode("div",Mp,[o.createTextVNode(o.toDisplayString(t.$t("marker.name")),1),e[35]||(e[35]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createVNode(d,{modelValue:i.form.name,"onUpdate:modelValue":e[20]||(e[20]=x=>i.form.name=x),density:"compact",variant:"outlined",rules:i.formRules.name,autocomplete:"off",class:"input-btn-bg-1"},null,8,["modelValue","rules"])])]}),_:1}),o.createVNode(s),o.createVNode(u,{class:"w-100 d-flex justify-end align-center ga-4 pa-4"},{default:o.withCtx(()=>{var b;return[(b=a.editLayer)!=null&&b.id?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(n,{key:0,class:"text-none text-body-1",variant:"tonal",density:"comfortable",onClick:l.handleClearDraw},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.clear")),1)]),_:1},8,["onClick"])),o.createVNode(n,{class:"text-none text-body-1",variant:"flat",color:"primary",density:"comfortable",type:"submit",loading:i.saving},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.save")),1)]),_:1},8,["loading"])]}),_:1})]),_:1},8,["onSubmit"])):o.createCommentVNode("",!0)]}),_:1})}const Pp=Y(op,[["render",Np]]),_y="",Vp={name:"IdmImportMarker",props:{map:{type:Object},gateway:{type:String},token:{type:String},defaultMeteoToken:{type:String},group:{type:Object,default:null}},emits:["close","import"],setup(){return{Theme:fe.useTheme()}},data(){var t;return{form:{groupName:"",name:"",file:null,format:"",extend:void 0,color:(t=this.Theme.current.value.colors)==null?void 0:t["map-green"]},formRules:{groupName:[e=>e!=null&&e!==""||"required"],color:[e=>e!=null&&e!==""||"required"]},isDragOver:!1,uploading:!1,fileError:"",previewSourceId:"__import_preview__",previewMarkers:[]}},watch:{"form.color":{handler(t){var e;(e=this.form.extend)!=null&&e.features&&this.form.extend.features.forEach(a=>{a.properties.color=t}),this.handleDrawLayers()},immediate:!0}},mounted(){var t;this.form.groupName=((t=this.group)==null?void 0:t.name)||"Import layer 1"},beforeUnmount(){this.handleClearPreview()},methods:{handleClose(){this.$emit("close")},handleReset(){var t;this.form={groupName:((t=this.group)==null?void 0:t.name)||"Import layer 1",file:null,format:"",extend:void 0},this.fileError=""},handleSelectFile(){this.$refs.fileInput.click()},handleFileChange(t){const e=t.target.files[0];e&&this.onUpload(e)},handleDrop(t){this.isDragOver=!1;const e=t.dataTransfer.files[0];e&&this.onUpload(e)},async onUpload(t){var r,i,l,n;if(t.size>10485760){this.fileError=this.$t("marker.fileTooLarge");return}this.form.file=t,this.fileError="",this.form.name=(r=t.name.split("."))==null?void 0:r[0];const a=(i=t.name.split(".").pop())==null?void 0:i.toLowerCase();try{let c;if(a==="json"||a==="geojson"){const s=await t.text();c=JSON.parse(s)}else if(a==="kml"){const s=await t.text();c=await N.GeoJsonHelper.convertKML2GeoJSON(s)}else if(a==="kmz"){const s=await t.arrayBuffer();c=await N.GeoJsonHelper.convertKMZ2GeoJSON(s)}else if(a==="zip"||a==="shp"){const s=await t.arrayBuffer();c=await N.GeoJsonHelper.convertZIP2GeoJSON(s)}else{this.fileError="Unsupported format: "+a;return}this.form.extend=c,this.form.format="geojson",(n=(l=this.form.extend)==null?void 0:l.features)==null||n.forEach(s=>{s.properties.color=this.form.color}),this.handleDrawLayers()}catch{this.fileError="Failed to parse file",this.form.file=null}},handleRemoveFile(){this.form.file=null,this.$refs.fileInput.value="",this.handleClearPreview()},async handleConfirm(){const{valid:t}=await this.$refs.importForm.validate();if(!t)return;if(!this.form.file){this.fileError=this.$t("marker.fileRequired");return}this.uploading=!0;let e=this.group.id;if(e||await le.post(`${this.gateway}/api/arc/lygroups`,{name:this.form.groupName},{headers:{Authorization:this.token||this.defaultMeteoToken,version:"new"}}).then(r=>{var i,l;((i=r.data)==null?void 0:i.code)===0&&(e=(l=r.data.data)==null?void 0:l.id)}),!e){this.uploading=!1;return}const a={format:this.form.format,extend:this.form.extend};le.post(`${this.gateway}/api/arc/lygroups/${e}/layers`,a,{headers:{Authorization:this.token||this.defaultMeteoToken,version:"new"}}).then(r=>{var i;((i=r.data)==null?void 0:i.code)===0&&(this.$emit("import"),this.uploading=!1)}).catch(r=>{this.uploading=!1})},handleDrawLayers(){if(!this.map||!this.form.extend)return;const t=this.form.extend,e=this.previewSourceId,a=t.features||(t.type==="Feature"?[t]:[]);a.forEach(i=>{var n,c,s;const l=((n=i==null?void 0:i.properties)==null?void 0:n.color)||((c=this.Theme.current.value.colors)==null?void 0:c["map-green"]);if(((s=i.geometry)==null?void 0:s.type)==="Point"){const[d,m]=i.geometry.coordinates;this.previewMarkers.push(new ne.Marker({color:l}).setLngLat([d,m]).addTo(this.map))}i.properties.color||(i.properties.color=l)}),this.map.getSource(e)?this.map.getSource(e).setData(t):this.map.addSource(e,{type:"geojson",data:t});const r=new Set(a.map(i=>{var l;return(l=i.geometry)==null?void 0:l.type}));(r.has("LineString")||r.has("MultiLineString"))&&!this.map.getLayer(`${e}-line`)&&this.map.addLayer({id:`${e}-line`,type:"line",source:e,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["get","color"],"line-width":2}}),(r.has("Polygon")||r.has("MultiPolygon"))&&(this.map.getLayer(`${e}-fill`)||this.map.addLayer({id:`${e}-fill`,type:"fill",source:e,filter:["==","$type","Polygon"],paint:{"fill-color":["get","color"],"fill-opacity":.35}}),this.map.getLayer(`${e}-outline`)||this.map.addLayer({id:`${e}-outline`,type:"line",source:e,filter:["==","$type","Polygon"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["get","color"],"line-width":2}}))},handleClearPreview(){if(!this.map)return;this.previewMarkers.forEach(a=>a.remove()),this.previewMarkers=[];const t=this.previewSourceId;[`${t}-vertex`,`${t}-point`,`${t}-line`,`${t}-fill`,`${t}-outline`].forEach(a=>{this.map.getLayer(a)&&this.map.removeLayer(a)}),this.map.getSource(t)&&this.map.removeSource(t)}}},Tp={class:"text-h6 font-weight-600"},Ep={class:"mb-4"},Rp={class:"text-label mb-1"},Dp={class:"mb-1"},Bp={class:"text-label mb-1"},Ip={class:"color-picker-row d-flex align-start ga-2"},Fp=["value"],Gp={class:"text-body-2 text-center text-label"},jp={class:"text-body-1 text-primary mt-2 cursor-pointer"},Wp={class:"text-body-2 text-left text-label mt-1"},Zp={key:0,class:"text-body-2 text-left text-danger mt-1"},Xp={key:1,class:"file-item d-flex align-center justify-space-between mt-2 gray-bg-1 pa-1"},Hp={class:"text-body-2 text-truncate"};function Op(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VCardTitle"),s=o.resolveComponent("VDivider"),d=o.resolveComponent("VTextField"),m=o.resolveComponent("VIcon"),p=o.resolveComponent("VCardText"),g=o.resolveComponent("VCardActions"),y=o.resolveComponent("VForm"),u=o.resolveComponent("VCard");return o.openBlock(),o.createBlock(u,{class:"idm-gl4-import-dialog-card",elevation:"4"},{default:o.withCtx(()=>[o.createVNode(c,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>[o.createElementVNode("span",Tp,o.toDisplayString(t.$t("marker.importLayer")),1),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleClose},{default:o.withCtx(()=>e[9]||(e[9]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[9]},8,["onClick"])]),_:1}),o.createVNode(s),o.createVNode(y,{ref:"importForm",autocomplete:"off",class:"form-box",onSubmit:o.withModifiers(l.handleConfirm,["prevent"])},{default:o.withCtx(()=>[o.createVNode(p,{class:"px-4 text-body-1"},{default:o.withCtx(()=>[o.createElementVNode("div",Ep,[o.createElementVNode("div",Rp,[o.createTextVNode(o.toDisplayString(t.$t("marker.group")),1),e[10]||(e[10]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createVNode(d,{modelValue:i.form.groupName,"onUpdate:modelValue":e[0]||(e[0]=h=>i.form.groupName=h),density:"compact",variant:"outlined","hide-details":"",class:"input-btn-bg-1"},null,8,["modelValue"])]),o.createElementVNode("div",Dp,[o.createElementVNode("div",Bp,[o.createTextVNode(o.toDisplayString(t.$t("marker.color")),1),e[11]||(e[11]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createElementVNode("div",Ip,[o.createElementVNode("input",{type:"color",value:i.form.color,class:"native-color-picker cursor-pointer",onInput:e[1]||(e[1]=h=>i.form.color=h.target.value)},null,40,Fp),o.createVNode(d,{modelValue:i.form.color,"onUpdate:modelValue":e[2]||(e[2]=h=>i.form.color=h),rules:i.formRules.color,density:"compact",variant:"outlined",class:"flex-1-1-0 input-btn-bg-1"},null,8,["modelValue","rules"])])]),o.createElementVNode("div",{class:o.normalizeClass(["upload-area btn-bg-1 d-flex flex-column justify-center align-center pa-4",{"drag-over":i.isDragOver,"upload-error":i.fileError}]),onDragenter:e[4]||(e[4]=o.withModifiers(h=>i.isDragOver=!0,["prevent"])),onDragleave:e[5]||(e[5]=o.withModifiers(h=>i.isDragOver=!1,["prevent"])),onDragover:e[6]||(e[6]=o.withModifiers(()=>{},["prevent"])),onDrop:e[7]||(e[7]=o.withModifiers((...h)=>l.handleDrop&&l.handleDrop(...h),["prevent"])),onClick:e[8]||(e[8]=(...h)=>l.handleSelectFile&&l.handleSelectFile(...h))},[o.createVNode(m,{size:"36",color:"grey",class:"mb-2"},{default:o.withCtx(()=>e[12]||(e[12]=[o.createTextVNode("mdi-cloud-upload-outline",-1)])),_:1,__:[12]}),o.createElementVNode("div",Gp,o.toDisplayString(t.$t("marker.uploadHint")),1),o.createElementVNode("div",jp,o.toDisplayString(t.$t("marker.selectFile")),1),o.createElementVNode("input",{ref:"fileInput",type:"file",style:{display:"none"},accept:".json,.geojson,.zip,.shp,.kml,.kmz",onChange:e[3]||(e[3]=(...h)=>l.handleFileChange&&l.handleFileChange(...h))},null,544)],34),o.createElementVNode("div",Wp,o.toDisplayString(t.$t("marker.uploadLimit")),1),i.fileError?(o.openBlock(),o.createElementBlock("div",Zp,o.toDisplayString(i.fileError),1)):o.createCommentVNode("",!0),i.form.file?(o.openBlock(),o.createElementBlock("div",Xp,[o.createElementVNode("span",Hp,[o.createVNode(m,{size:"16",color:"success",class:"mr-1"},{default:o.withCtx(()=>e[13]||(e[13]=[o.createTextVNode("mdi-check-circle",-1)])),_:1,__:[13]}),o.createTextVNode(" "+o.toDisplayString(i.form.file.name),1)]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",size:"small",class:"file-remove-btn",onClick:l.handleRemoveFile},{default:o.withCtx(()=>[o.createVNode(m,{size:"16"},{default:o.withCtx(()=>e[14]||(e[14]=[o.createTextVNode("mdi-close",-1)])),_:1,__:[14]})]),_:1},8,["onClick"])])):o.createCommentVNode("",!0)]),_:1}),o.createVNode(s),o.createVNode(g,{class:"w-100 d-flex justify-end align-center ga-4 pa-4"},{default:o.withCtx(()=>[o.createVNode(n,{class:"text-none text-body-1",variant:"tonal",density:"comfortable",onClick:l.handleReset},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.reset")),1)]),_:1},8,["onClick"]),o.createVNode(n,{class:"text-none text-body-1",variant:"flat",color:"primary",density:"comfortable",type:"submit",loading:i.uploading},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.confirm")),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["onSubmit"])]),_:1})}const Yp=Y(Vp,[["render",Op]]),Sy="",Up={name:"IdmGroupDialog",props:{modelValue:{type:Boolean,default:!1},group:{type:Object,default:null},gateway:{type:String},token:{type:String},defaultMeteoToken:{type:String}},emits:["update:modelValue","saved"],data(){return{localName:"",saving:!1}},watch:{group:{handler(t){this.localName=(t==null?void 0:t.name)||""},immediate:!0}},methods:{handleClose(){this.$emit("update:modelValue",!1)},async handleConfirm(){var t;!this.group||!((t=this.localName)!=null&&t.trim())||(this.saving=!0,await le.put(`${this.gateway}/api/arc/lygroups/${this.group.id}`,{name:this.localName},{headers:{Authorization:this.token||this.defaultMeteoToken,version:"new"}}).then(e=>{var a;((a=e.data)==null?void 0:a.code)===0&&this.$emit("saved")}).finally(()=>{this.saving=!1}))}}},Jp={class:"text-h6 font-weight-600"},Kp={class:"text-label mb-2"};function Qp(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VCardTitle"),s=o.resolveComponent("VDivider"),d=o.resolveComponent("VTextField"),m=o.resolveComponent("VCardText"),p=o.resolveComponent("VCardActions"),g=o.resolveComponent("VCard"),y=o.resolveComponent("VDialog");return o.openBlock(),o.createBlock(y,{"model-value":a.modelValue,"max-width":"320",persistent:"","onUpdate:modelValue":e[1]||(e[1]=u=>t.$emit("update:modelValue",u))},{default:o.withCtx(()=>[o.createVNode(g,{class:"",elevation:"4"},{default:o.withCtx(()=>[o.createVNode(c,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>[o.createElementVNode("span",Jp,o.toDisplayString(t.$t("actions.editGroup")),1),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleClose},{default:o.withCtx(()=>e[2]||(e[2]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[2]},8,["onClick"])]),_:1}),o.createVNode(s),o.createVNode(m,{class:"px-4 text-body-1"},{default:o.withCtx(()=>[o.createElementVNode("div",Kp,[o.createTextVNode(o.toDisplayString(t.$t("marker.groupName")),1),e[3]||(e[3]=o.createElementVNode("span",{class:"text-danger"},"*",-1))]),o.createVNode(d,{modelValue:i.localName,"onUpdate:modelValue":e[0]||(e[0]=u=>i.localName=u),density:"compact",variant:"outlined","hide-details":"",autocomplete:"off",height:"32px","min-height":"32px",class:"input-btn-bg-1"},null,8,["modelValue"])]),_:1}),o.createVNode(s),o.createVNode(p,{class:"w-100 d-flex justify-end align-center ga-4 pa-4"},{default:o.withCtx(()=>[o.createVNode(n,{class:"text-none text-body-1",variant:"tonal",density:"comfortable",onClick:l.handleClose},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.cancel")),1)]),_:1},8,["onClick"]),o.createVNode(n,{class:"text-none text-body-1",variant:"flat",color:"primary",density:"comfortable",loading:i.saving,onClick:l.handleConfirm},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.confirm")),1)]),_:1},8,["loading","onClick"])]),_:1})]),_:1})]),_:1},8,["model-value"])}const qp=Y(Up,[["render",Qp]]),$p={name:"DeleteDialog",props:{title:{type:String},tips:{type:String},loading:{type:Boolean,default:!1}},emits:["close","delete"],data(){return{showDialog:!1}},methods:{handleClose(){this.showDialog=!1},handleDelete(){this.$emit("delete")},open(){this.showDialog=!0}}},eg={class:"text-body-1 pb-1"},tg={class:"text-body-1"};function og(t,e,a,r,i,l){const n=o.resolveComponent("VIcon"),c=o.resolveComponent("VBtn"),s=o.resolveComponent("VCardTitle"),d=o.resolveComponent("VCardText"),m=o.resolveComponent("VCardActions"),p=o.resolveComponent("VCard"),g=o.resolveComponent("VDialog");return o.openBlock(),o.createBlock(g,{modelValue:i.showDialog,"onUpdate:modelValue":e[0]||(e[0]=y=>i.showDialog=y),width:"500","min-width":"500","max-width":"500"},{default:o.withCtx(()=>[o.createVNode(p,{class:""},{default:o.withCtx(()=>[o.createVNode(s,{class:"text-h6 font-weight-600 d-flex justify-center align-center py-4"},{default:o.withCtx(()=>[o.createVNode(n,{color:"warning",icon:"mdi-alert-circle",size:"small",class:"mr-2"}),o.createElementVNode("div",null,o.toDisplayString(a.title),1),o.createVNode(c,{icon:"",density:"compact",variant:"plain",class:"position-absolute top-0 right-0 mt-2 mr-2",onClick:l.handleClose},{default:o.withCtx(()=>e[1]||(e[1]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[1]},8,["onClick"])]),_:1}),o.createVNode(d,{class:"py-4 text-center"},{default:o.withCtx(()=>[o.createElementVNode("p",eg,o.toDisplayString(a.tips),1),o.createElementVNode("p",tg,o.toDisplayString(t.$t("tips.doYouWantToContinue")),1)]),_:1}),o.createVNode(m,{class:"w-100 d-flex justify-center align-center ga-8 py-6"},{default:o.withCtx(()=>[o.createVNode(c,{variant:"tonal",class:"text-none text-body-1",height:"32",onClick:l.handleClose},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.cancel")),1)]),_:1},8,["onClick"]),o.createVNode(c,{loading:a.loading,variant:"flat",color:"danger",class:"text-none text-body-1",height:"32",onClick:l.handleDelete},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.delete")),1)]),_:1},8,["loading","onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"])}const ag=Y($p,[["render",og]]),My="",Ny="",ig={name:"IdmMarker",components:{IdmDrawMarker:Pp,IdmImportMarker:Yp,IdmGroupDialog:qp,DeleteDialog:ag},props:{simple:{type:Boolean,default:!1},map:{type:Object},theme:{type:String},token:{type:String},isLogin:{type:Boolean,default:!1},defaultMeteoToken:{type:String},gateway:{type:String},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}}},emits:["map","menuToggle","theme","login"],setup(){return{Theme:fe.useTheme()}},data(){return{right:10,toggle:!1,autoActive:localStorage.getItem("autoActiveMarkersGL4")==="true"||void 0,keyword:"",drawDialog:!1,importDialog:!1,loading:!1,deleteDialog:!1,deleteLoading:!1,layerGroup:[],layers:[],groupIndex:0,currentLayer:void 0,drawnLayerIds:[],layerMarkers:{},groupDialog:!1,currentGroup:null,currentGroupId:"",currentGroupName:""}},computed:{listStyle(){return this.simple?{top:this.top+"px",left:this.toggle?"0px":"-280px"}:{top:this.top+"px",right:this.toggle?"0px":"-280px"}}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.markerLayers,this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})},immediate:!0},toggle:{async handler(){this.toggle&&(localStorage.getItem("autoActiveMarkersGL4")||(this.autoActive=!0))}},autoActive:{async handler(){(this.autoActive===!0||this.autoActive===!1)&&localStorage.setItem("autoActiveMarkersGL4",this.autoActive),this.layerGroup.length===0&&await this.fetchAllLayers(),this.autoActive?this.handleDrawAllLayers():this.handleClearAllLayers()},immediate:!0},map:{handler(){this.map&&(this.handleDrawAllLayers(),this.map.on("zoom",this.handleZoomChange))}}},methods:{handleMenuToggle(){this.isLogin?(this.toggle=!this.toggle,this.$emit("menuToggle","markerLayers")):this.$emit("login")},handleEditGroup(t){this.drawDialog=!1,this.importDialog=!1,this.currentGroup=t,this.groupDialog=!0},handleSaveGroup(){this.fetchAllLayers(),this.groupDialog=!1,this.currentGroup=void 0},handleOpenDelete(t,e){t==="group"?(this.currentGroup=e,this.currentLayer=void 0):t==="layer"&&(this.currentGroup=void 0,this.currentLayer=e),this.$refs.deleteDialog.open()},confirmDelete(){var t;this.currentGroup?this.handleDeleteGroup((t=this.currentGroup)==null?void 0:t.id):this.currentLayer&&this.handleDeleteLayer(this.currentLayer)},async handleDeleteGroup(t){t&&(this.deleteLoading=!0,await le.delete(`${this.gateway}/api/arc/lygroups/${t}`,{headers:{Authorization:this.token||this.defaultMeteoToken,version:"new"}}).then(e=>{var a;((a=e.data)==null?void 0:a.code)===0&&(this.fetchAllLayers(),this.currentGroup=void 0,this.$refs.deleteDialog.handleClose(),this.deleteLoading=!1)}).catch(()=>{this.deleteLoading=!1}))},handleOpenDrawMarkers(t){this.handleCloseDraw(),this.currentGroup=t||this.layerGroup.find(e=>e.name==="Custom Layers"),this.importDialog=!1,this.drawDialog=!0},handleOpenImportDialog(t){this.drawDialog=!1,this.handleCloseDraw(),this.currentGroup=t||void 0,this.importDialog=!0},handleImportLayer(t){this.fetchAllLayers(),this.importDialog=!1},handleSaveMarker(t){this.fetchAllLayers(),this.drawDialog=!1,this.currentLayer=null},handleCloseDraw(){this.drawDialog=!1,this.currentLayer=null,this.autoActive&&this.handleDrawAllLayers(),this.currentGroup=void 0},handleEditLayer(t,e){var a;this.importDialog=!1,this.drawDialog&&((a=this.currentLayer)!=null&&a.id)&&this.currentLayer.id!==e.id&&this.autoActive&&this.handleDrawAllLayers(),this.currentGroup=t,this.currentLayer=e,this.drawDialog=!0},async fetchAllLayers(){this.loading=!0,this.layerGroup=[],await le.get(`${this.gateway}/api/arc/lygroups/my`,{headers:{Authorization:this.token||this.defaultMeteoToken,version:"new"}}).then(t=>{var e,a,r,i,l,n;if(((e=t.data)==null?void 0:e.code)===0){this.loading=!1,this.layerGroup=((i=(r=(a=t.data)==null?void 0:a.data)==null?void 0:r.rows)==null?void 0:i.reverse())||[];const c=[];(l=this.layerGroup)==null||l.forEach(s=>{var d;s.show=!0,(d=s.layers)==null||d.forEach(m=>{var g;m.layerGroupId=s.id;const p=typeof m.extend=="string"?JSON.parse(m.extend):m.extend;(g=p==null?void 0:p.features)==null||g.forEach(y=>{y.properties.lgId=s.id,y.properties.layerId=m.id,y.properties.name||(y.properties.name=m.name)}),c.push(m)})}),this.layers=c,this.handleDrawAllLayers(),(n=this.$refs.drawDialog)==null||n.handleClearDraw()}}).catch(()=>{this.loading=!1})},async handleDeleteLayer(t){this.deleteLoading=!0,await le.delete(`${this.gateway}/api/arc/layers/${t.id}`,{headers:{Authorization:this.token||this.defaultMeteoToken,version:"new"}}).then(e=>{var a;((a=e.data)==null?void 0:a.code)===0&&(this.deleteLoading=!1,this.fetchAllLayers(),this.$refs.deleteDialog.handleClose())}).catch(()=>{this.deleteLoading=!1})},handleRenderLayer(t){if(!this.map||!(t!=null&&t.extend))return;const e=typeof t.extend=="string"?JSON.parse(t.extend):t.extend;if(!e)return;const a=`marker-layer-${t.id}`;this.handleClearLayerMarkers(t.id);const r=e.features||(e.type==="Feature"?[e]:[]);if(r.some(c=>{var s,d;return(((s=c.geometry)==null?void 0:s.type)==="Point"||((d=c.geometry)==null?void 0:d.type)==="MultiPoint")&&c.properties.shape==="point"})){const c=[];r.forEach(s=>{var g,y,u,h;const d=(g=s.geometry)==null?void 0:g.type,m=((y=s.properties)==null?void 0:y.name)||"",p=((u=s.properties)==null?void 0:u.color)||t.color||((h=this.Theme.current.value.colors)==null?void 0:h["map-green"]);if(d==="Point"){const[f,w]=s.geometry.coordinates,b=`<div style="font-size:12px;line-height:1.5;">
|
|
220
220
|
<div style="font-weight:600;">${m}</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as l } from "./chunk-ANSXOGKI-
|
|
2
|
-
import "./chunk-3VYIPD3A-
|
|
3
|
-
import "./index-
|
|
1
|
+
import { d as l } from "./chunk-ANSXOGKI-f2be5749.js";
|
|
2
|
+
import "./chunk-3VYIPD3A-97fed3d8.js";
|
|
3
|
+
import "./index-2978f7e0.js";
|
|
4
4
|
import "axios";
|
|
5
5
|
import "vuetify";
|
|
6
6
|
import "vue";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { m as k } from "./chunk-T4JIPPZO-
|
|
2
|
-
import "./chunk-3VYIPD3A-
|
|
3
|
-
import "./index-
|
|
1
|
+
import { m as k } from "./chunk-T4JIPPZO-26d6b1f2.js";
|
|
2
|
+
import "./chunk-3VYIPD3A-97fed3d8.js";
|
|
3
|
+
import "./index-2978f7e0.js";
|
|
4
4
|
import "axios";
|
|
5
5
|
import "vuetify";
|
|
6
6
|
import "vue";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as u } from "./chunk-ANSXOGKI-
|
|
2
|
-
import { l as g } from "./index-
|
|
3
|
-
import "./chunk-3VYIPD3A-
|
|
1
|
+
import { d as u } from "./chunk-ANSXOGKI-f2be5749.js";
|
|
2
|
+
import { l as g } from "./index-2978f7e0.js";
|
|
3
|
+
import "./chunk-3VYIPD3A-97fed3d8.js";
|
|
4
4
|
import "axios";
|
|
5
5
|
import "vuetify";
|
|
6
6
|
import "vue";
|