@idmui/spot 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Spot/src/index.vue.d.ts +1 -0
- package/dist/index.js +47 -46
- package/dist/index.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -31,6 +31,7 @@ declare namespace _sfc_main {
|
|
|
31
31
|
placeholder: string;
|
|
32
32
|
searchName: undefined;
|
|
33
33
|
rawSearchIcon: import("vue").Raw<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
|
34
|
+
positionOffset: undefined;
|
|
34
35
|
positionGmt: undefined;
|
|
35
36
|
issuedDate: undefined;
|
|
36
37
|
meteoData: {};
|
package/dist/index.js
CHANGED
|
@@ -7,8 +7,8 @@ import { markRaw as Pe, resolveComponent as we, openBlock as n, createElementBlo
|
|
|
7
7
|
import De from "axios";
|
|
8
8
|
class Se {
|
|
9
9
|
static pickHourly(e, t) {
|
|
10
|
-
var h, s,
|
|
11
|
-
const fe = typeof t == "string" ? X(t) : t, $ = e == null ? void 0 : e.weather, ye = e == null ? void 0 : e.marine, _e = X((s = (h = $ == null ? void 0 : $[0]) == null ? void 0 : h.hourly) == null ? void 0 : s.date).utc(), pe = _e.clone().add((C = (M = (
|
|
10
|
+
var h, s, w, M, C, S, L, N, I, P, H, a, r, K, D, R, A, E, G, F, O, B, V, U, Z, J, Y, j, g, k, p, y, W, v, q, te, ae, re, oe, T, se, m, ie, u, le, he, de, xe;
|
|
11
|
+
const fe = typeof t == "string" ? X(t) : t, $ = e == null ? void 0 : e.weather, ye = e == null ? void 0 : e.marine, _e = X((s = (h = $ == null ? void 0 : $[0]) == null ? void 0 : h.hourly) == null ? void 0 : s.date).utc(), pe = _e.clone().add((C = (M = (w = $ == null ? void 0 : $[0]) == null ? void 0 : w.hourly) == null ? void 0 : M.time) == null ? void 0 : C.at(0), "h"), Le = _e.clone().add((N = (L = (S = $ == null ? void 0 : $[0]) == null ? void 0 : S.hourly) == null ? void 0 : L.time) == null ? void 0 : N.at(-1), "h"), ze = [];
|
|
12
12
|
if (fe.isBetween(pe, Le, "millisecond", "[]")) {
|
|
13
13
|
const d = fe.utc().diff(pe, "h", !1);
|
|
14
14
|
let Q, ne;
|
|
@@ -31,8 +31,8 @@ class Se {
|
|
|
31
31
|
wind: {
|
|
32
32
|
speed: (G = c.wind_speed_10m) == null ? void 0 : G.at(d),
|
|
33
33
|
kts: (F = c.wind_speed_10m) == null ? void 0 : F.at(d),
|
|
34
|
-
degree: (
|
|
35
|
-
bearing: ((
|
|
34
|
+
degree: (O = c.wind_direction_10m) == null ? void 0 : O.at(d),
|
|
35
|
+
bearing: ((B = c.wind_direction_10m) == null ? void 0 : B.at(d)) !== null ? (((V = c.wind_direction_10m) == null ? void 0 : V.at(d)) + 180) % 360 : null,
|
|
36
36
|
gusts: (U = c.wind_gusts_10m) == null ? void 0 : U.at(d)
|
|
37
37
|
},
|
|
38
38
|
isDay: (Z = c.is_day) == null ? void 0 : Z.at(d)
|
|
@@ -48,13 +48,13 @@ class Se {
|
|
|
48
48
|
sig: {
|
|
49
49
|
height: (J = c.wave_height) == null ? void 0 : J.at(d),
|
|
50
50
|
degree: (Y = c.wave_direction) == null ? void 0 : Y.at(d),
|
|
51
|
-
bearing: ((j = c.wave_direction) == null ? void 0 : j.at(d)) !== null ? (((
|
|
51
|
+
bearing: ((j = c.wave_direction) == null ? void 0 : j.at(d)) !== null ? (((g = c.wave_direction) == null ? void 0 : g.at(d)) + 180) % 360 : null,
|
|
52
52
|
period: (k = c.wave_period) == null ? void 0 : k.at(d)
|
|
53
53
|
},
|
|
54
54
|
swell: {
|
|
55
55
|
height: (p = c.swell_wave_height) == null ? void 0 : p.at(d),
|
|
56
56
|
degree: (y = c.swell_wave_direction) == null ? void 0 : y.at(d),
|
|
57
|
-
bearing: ((W = c.swell_wave_direction) == null ? void 0 : W.at(d)) !== null ? (((
|
|
57
|
+
bearing: ((W = c.swell_wave_direction) == null ? void 0 : W.at(d)) !== null ? (((v = c.swell_wave_direction) == null ? void 0 : v.at(d)) + 180) % 360 : null,
|
|
58
58
|
period: (q = c.swell_wave_period) == null ? void 0 : q.at(d),
|
|
59
59
|
peakPeriod: (te = c.swell_wave_peak_period) == null ? void 0 : te.at(d)
|
|
60
60
|
},
|
|
@@ -105,11 +105,11 @@ class Se {
|
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
107
|
static pickDaily(e, t) {
|
|
108
|
-
var h, s,
|
|
109
|
-
const
|
|
110
|
-
if (
|
|
108
|
+
var h, s, w, M, C, S, L, N, I, P, H, a, r, K, D, R, A, E, G, F, O, B, V, U, Z, J, Y, j, g, k, p, y, W;
|
|
109
|
+
const v = typeof t == "string" ? X(t) : t, q = e == null ? void 0 : e.weather, te = e == null ? void 0 : e.marine, ae = X((w = (s = (h = q == null ? void 0 : q[0]) == null ? void 0 : h.daily) == null ? void 0 : s.time) == null ? void 0 : w.at(0)), re = X((S = (C = (M = q == null ? void 0 : q[0]) == null ? void 0 : M.daily) == null ? void 0 : C.time) == null ? void 0 : S.at(-1)), oe = [];
|
|
110
|
+
if (v.isBetween(ae, re, "millisecond", "[]")) {
|
|
111
111
|
let T, se;
|
|
112
|
-
const m =
|
|
112
|
+
const m = v.diff(ae, "d", !1);
|
|
113
113
|
if (q)
|
|
114
114
|
for (const ie of q) {
|
|
115
115
|
const u = ie.daily;
|
|
@@ -137,8 +137,8 @@ class Se {
|
|
|
137
137
|
wind: {
|
|
138
138
|
speed: (G = u.wind_speed_10m_max) == null ? void 0 : G.at(m),
|
|
139
139
|
kts: (F = u.wind_speed_10m_max) == null ? void 0 : F.at(m),
|
|
140
|
-
degree: (
|
|
141
|
-
gusts: (
|
|
140
|
+
degree: (O = u.wind_direction_10m_dominant) == null ? void 0 : O.at(m),
|
|
141
|
+
gusts: (B = u.wind_gusts_10m_max) == null ? void 0 : B.at(m)
|
|
142
142
|
}
|
|
143
143
|
};
|
|
144
144
|
const { name: le, url: he, bg: de } = this.parseWeatherCode(T.code, !0);
|
|
@@ -158,7 +158,7 @@ class Se {
|
|
|
158
158
|
height: (J = u.swell_wave_height_max) == null ? void 0 : J.at(m),
|
|
159
159
|
degree: (Y = u.wave_direction_dominant) == null ? void 0 : Y.at(m),
|
|
160
160
|
period: (j = u.swell_wave_period_max) == null ? void 0 : j.at(m),
|
|
161
|
-
peakPeriod: (
|
|
161
|
+
peakPeriod: (g = u.swell_wave_peak_period_max) == null ? void 0 : g.at(m)
|
|
162
162
|
},
|
|
163
163
|
wd: {
|
|
164
164
|
height: (k = u.wind_wave_height_max) == null ? void 0 : k.at(m),
|
|
@@ -587,6 +587,7 @@ const We = (l, e) => {
|
|
|
587
587
|
placeholder: "search for port name or coordinates",
|
|
588
588
|
searchName: void 0,
|
|
589
589
|
rawSearchIcon: Pe(Ce),
|
|
590
|
+
positionOffset: void 0,
|
|
590
591
|
positionGmt: void 0,
|
|
591
592
|
issuedDate: void 0,
|
|
592
593
|
meteoData: {},
|
|
@@ -659,14 +660,14 @@ const We = (l, e) => {
|
|
|
659
660
|
});
|
|
660
661
|
},
|
|
661
662
|
initInfo() {
|
|
662
|
-
var l, e;
|
|
663
|
-
this.loading = !1, this.positionGmt = (e = (l = this.meteoData.weather) == null ? void 0 : l[0]) == null ? void 0 : e.timezone, this.issuedDate = X(this.ts).utc().format("MMM-DD/HHmm[Z], YYYY"), this.activeIndex = ee(this.ts).tz(this.positionGmt).hour(), this.pickedDate = ee(this.ts).tz(this.positionGmt).set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).format(), this.collectList = JSON.parse(localStorage.getItem("idmCollectList") || "[]"), this.positionList = JSON.parse(JSON.stringify(this.collectList)), this.isCollected = this.collectList.some((
|
|
664
|
-
var
|
|
665
|
-
return
|
|
663
|
+
var l, e, t, h;
|
|
664
|
+
this.loading = !1, this.positionGmt = (e = (l = this.meteoData.weather) == null ? void 0 : l[0]) == null ? void 0 : e.timezone, this.positionOffset = (h = (t = this.meteoData.weather) == null ? void 0 : t[0]) == null ? void 0 : h.offset, this.issuedDate = X(this.ts).utc().format("MMM-DD/HHmm[Z], YYYY"), this.activeIndex = ee(this.ts).tz(this.positionGmt).hour(), this.pickedDate = ee(this.ts).tz(this.positionGmt).set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).format(), this.collectList = JSON.parse(localStorage.getItem("idmCollectList") || "[]"), this.positionList = JSON.parse(JSON.stringify(this.collectList)), this.isCollected = this.collectList.some((s) => {
|
|
665
|
+
var w;
|
|
666
|
+
return s.name === ((w = this.position) == null ? void 0 : w.name);
|
|
666
667
|
});
|
|
667
668
|
},
|
|
668
669
|
initTableData() {
|
|
669
|
-
var l, e, t, h, s,
|
|
670
|
+
var l, e, t, h, s, w, M, C, S, L, N, I, P, H, a, r, K, D, R, A, E, G, F, O, B, V, U, Z, J, Y, j, g, k, p;
|
|
670
671
|
this.tableData = {
|
|
671
672
|
hours: [],
|
|
672
673
|
utcHours: [],
|
|
@@ -696,20 +697,20 @@ const We = (l, e) => {
|
|
|
696
697
|
for (let y = 0; y < 24; y++) {
|
|
697
698
|
const W = X(this.pickedDate).clone().add(y, "h").format();
|
|
698
699
|
this.tableData.hours.push(W);
|
|
699
|
-
const
|
|
700
|
-
this.tableData.weatherUrls.push((e =
|
|
700
|
+
const v = ((l = Se.pickHourly(this.meteoData, W)) == null ? void 0 : l[0]) || {};
|
|
701
|
+
this.tableData.weatherUrls.push((e = v.weather) == null ? void 0 : e.url), this.tableData.weatherNames.push(((t = v.weather) == null ? void 0 : t.name) ?? "-"), this.tableData.temp.push(this.roundPrecision((h = v.weather) == null ? void 0 : h.temp, 0) ?? "-"), this.tableData.precipProbability.push(this.roundPrecision((w = (s = v.weather) == null ? void 0 : s.precip) == null ? void 0 : w.probability, 0) ?? "-"), this.tableData.precip1h.push(this.roundPrecision((C = (M = v.weather) == null ? void 0 : M.precip) == null ? void 0 : C.sum, 0) ?? "-"), this.tableData.visibility.push(this.roundPrecision((S = v.weather) == null ? void 0 : S.visibility, 0) ?? "-"), this.tableData.humidity.push(this.roundPrecision((L = v.weather) == null ? void 0 : L.rh, 0) ?? "-"), this.tableData.windSpeed.push(this.roundPrecision((I = (N = v.weather) == null ? void 0 : N.wind) == null ? void 0 : I.kts, 1)), this.tableData.windDir.push((H = (P = v.weather) == null ? void 0 : P.wind) == null ? void 0 : H.bearing), this.tableData.windGust.push(this.roundPrecision((r = (a = v.weather) == null ? void 0 : a.wind) == null ? void 0 : r.gusts, 1) ?? "-"), this.tableData.sigwaveHeight.push(this.roundPrecision((D = (K = v.wave) == null ? void 0 : K.sig) == null ? void 0 : D.height, 1) ?? "-"), this.tableData.sigwaveDir.push((A = (R = v.wave) == null ? void 0 : R.sig) == null ? void 0 : A.bearing), this.tableData.windwaveHeight.push(this.roundPrecision((G = (E = v.wave) == null ? void 0 : E.wd) == null ? void 0 : G.height, 1) ?? "-"), this.tableData.windwaveDir.push((O = (F = v.wave) == null ? void 0 : F.wd) == null ? void 0 : O.bearing), this.tableData.windwavePeriod.push(this.roundPrecision((V = (B = v.wave) == null ? void 0 : B.wd) == null ? void 0 : V.period, 1) ?? "-"), this.tableData.swellHeight.push(this.roundPrecision((Z = (U = v.wave) == null ? void 0 : U.swell) == null ? void 0 : Z.height, 1) ?? "-"), this.tableData.swellDir.push((Y = (J = v.wave) == null ? void 0 : J.swell) == null ? void 0 : Y.bearing), this.tableData.swellPeriod.push(this.roundPrecision((g = (j = v.wave) == null ? void 0 : j.swell) == null ? void 0 : g.period, 1) ?? "-"), this.tableData.currentSpeed.push(this.roundPrecision((k = v.current) == null ? void 0 : k.speed, 1) ?? "-"), this.tableData.currentDir.push((p = v.current) == null ? void 0 : p.bearing), this.tableData.seaLevel.push(this.roundPrecision(v.height, 1) ?? "-"), this.tableData.seaTemp.push(this.roundPrecision(v.sst, 0) ?? "-");
|
|
701
702
|
}
|
|
702
703
|
},
|
|
703
704
|
initEchart() {
|
|
704
|
-
var R, A, E, G, F,
|
|
705
|
-
const l = [], e = [], t = [], h = [], s = [],
|
|
706
|
-
for (let
|
|
707
|
-
const k = X(this.pickedDate).clone().add(
|
|
708
|
-
l.push(ee(k).tz(this.positionGmt).format("yyyy-MM-DD")), e.push(this.computeMMMDD(k)), t.push(
|
|
705
|
+
var R, A, E, G, F, O, B, V, U, Z, J, Y, j;
|
|
706
|
+
const l = [], e = [], t = [], h = [], s = [], w = [], M = [], C = [], S = [], L = [], N = {};
|
|
707
|
+
for (let g = 0; g < 7; g++) {
|
|
708
|
+
const k = X(this.pickedDate).clone().add(g, "d");
|
|
709
|
+
l.push(ee(k).tz(this.positionGmt).format("yyyy-MM-DD")), e.push(this.computeMMMDD(k)), t.push(g === 0 ? "Today" : this.computeWeek(k));
|
|
709
710
|
const p = ((R = Se.pickDaily(this.meteoData, k)) == null ? void 0 : R[0]) || {};
|
|
710
|
-
h.push(this.roundPrecision((E = (A = p.weather) == null ? void 0 : A.temp) == null ? void 0 : E.min, 0)), s.push(this.roundPrecision((F = (G = p.weather) == null ? void 0 : G.temp) == null ? void 0 : F.max, 0)), C.push(this.roundPrecision((
|
|
711
|
+
h.push(this.roundPrecision((E = (A = p.weather) == null ? void 0 : A.temp) == null ? void 0 : E.min, 0)), s.push(this.roundPrecision((F = (G = p.weather) == null ? void 0 : G.temp) == null ? void 0 : F.max, 0)), C.push(this.roundPrecision((B = (O = p.weather) == null ? void 0 : O.wind) == null ? void 0 : B.kts, 1) ?? "- kts"), L.push(this.roundPrecision((U = (V = p.weather) == null ? void 0 : V.precip) == null ? void 0 : U.sum, 0) ?? "- mm"), w.push({ symbol: "image://" + ((Z = p.weather) == null ? void 0 : Z.url) }), M.push((J = p.weather) == null ? void 0 : J.name), S.push((j = (Y = p.weather) == null ? void 0 : Y.wind) == null ? void 0 : j.degree);
|
|
711
712
|
}
|
|
712
|
-
const I = Math.max(...s.filter((
|
|
713
|
+
const I = Math.max(...s.filter((g) => typeof g == "number" && !isNaN(g))) - Math.min(...h.filter((g) => typeof g == "number" && !isNaN(g))), P = Math.min(...h.filter((g) => typeof g == "number" && !isNaN(g))) - 1.5 * I, H = Math.max(...s.filter((g) => typeof g == "number" && !isNaN(g))) + 2 * I, a = 4 + 0.5 / l.length * 92 + "%", r = "data:image/svg+xml;base64," + window.btoa(
|
|
713
714
|
unescape(
|
|
714
715
|
encodeURIComponent(
|
|
715
716
|
'<svg t="1740385441519" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10951" width="200" height="200"><path d="M512 804.83593751A276.87183211 276.87183211 0 0 1 235.12816789 527.9641054Q235.12816789 375.21005376 512 13.82031251q276.87183211 361.30792288 276.87183211 514.14379289a276.87183211 276.87183211 0 0 1-276.87183211 276.87183211zM294.4461577 527.9641054a217.47202472 217.47202472 0 0 0 217.5538423 217.55384231 19.79993605 19.79993605 0 1 0 0-39.51805453 177.9539702 177.9539702 0 0 1-177.9539702-178.03578778 19.79993605 19.79993605 0 0 0-39.5998721 0z" fill="#0c73a8" p-id="10952"></path></svg>'
|
|
@@ -738,7 +739,7 @@ const We = (l, e) => {
|
|
|
738
739
|
}
|
|
739
740
|
};
|
|
740
741
|
}
|
|
741
|
-
const
|
|
742
|
+
const g = ke.init(document.getElementById("weather-chart")), k = {
|
|
742
743
|
grid: {
|
|
743
744
|
bottom: 0,
|
|
744
745
|
top: 0,
|
|
@@ -938,7 +939,7 @@ const We = (l, e) => {
|
|
|
938
939
|
singleAxisIndex: 2,
|
|
939
940
|
coordinateSystem: "singleAxis",
|
|
940
941
|
type: "scatter",
|
|
941
|
-
data:
|
|
942
|
+
data: w,
|
|
942
943
|
symbolSize: 36
|
|
943
944
|
},
|
|
944
945
|
{
|
|
@@ -1041,7 +1042,7 @@ const We = (l, e) => {
|
|
|
1041
1042
|
}
|
|
1042
1043
|
]
|
|
1043
1044
|
};
|
|
1044
|
-
|
|
1045
|
+
g.setOption(k), g.on("click", (p) => {
|
|
1045
1046
|
const y = p.dataIndex;
|
|
1046
1047
|
this.pickedDate = ee(l[y]).tz(this.positionGmt).set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).format(), this.pickedWeek = y === 0 ? "Today" : this.computeWeek(this.pickedDate), this.activeIndex = y === 0 ? ee(this.ts).tz(this.positionGmt).hour() : void 0, this.initTableData(), k.series[3].markArea = {
|
|
1047
1048
|
itemStyle: {
|
|
@@ -1057,7 +1058,7 @@ const We = (l, e) => {
|
|
|
1057
1058
|
}
|
|
1058
1059
|
]
|
|
1059
1060
|
]
|
|
1060
|
-
},
|
|
1061
|
+
}, g.setOption(k);
|
|
1061
1062
|
});
|
|
1062
1063
|
};
|
|
1063
1064
|
},
|
|
@@ -1081,9 +1082,9 @@ const We = (l, e) => {
|
|
|
1081
1082
|
if (!this.searchName)
|
|
1082
1083
|
return !1;
|
|
1083
1084
|
this.position = {
|
|
1084
|
-
portId: (t = this.positionList.find((
|
|
1085
|
-
lat: (h = this.positionList.find((
|
|
1086
|
-
lng: (s = this.positionList.find((
|
|
1085
|
+
portId: (t = this.positionList.find((w) => w.name === this.searchName)) == null ? void 0 : t.id,
|
|
1086
|
+
lat: (h = this.positionList.find((w) => w.name === this.searchName)) == null ? void 0 : h.lat,
|
|
1087
|
+
lng: (s = this.positionList.find((w) => w.name === this.searchName)) == null ? void 0 : s.lng,
|
|
1087
1088
|
name: this.searchName
|
|
1088
1089
|
}, this.$emit("url", this.position), this.handleClear();
|
|
1089
1090
|
const l = {
|
|
@@ -1105,7 +1106,7 @@ const We = (l, e) => {
|
|
|
1105
1106
|
this.loading = !0, this.meteoData = {}, this.isCollected = !1, ke.dispose(document.getElementById("weather-chart"));
|
|
1106
1107
|
}
|
|
1107
1108
|
}
|
|
1108
|
-
}, Re = { class: "spot-report" }, Ae = { class: "header-box flex-between" }, Ee = { class: "bg" }, Ge = { class: "search-box flex-start" }, Fe = { class: "content-box" },
|
|
1109
|
+
}, Re = { class: "spot-report" }, Ae = { class: "header-box flex-between" }, Ee = { class: "bg" }, Ge = { class: "search-box flex-start" }, Fe = { class: "content-box" }, Oe = { class: "title-box flex-between" }, Be = { class: "main-title" }, Ve = { class: "sub-title" }, Ue = { class: "flex-end" }, Ze = {
|
|
1109
1110
|
key: 0,
|
|
1110
1111
|
id: "weather-chart"
|
|
1111
1112
|
}, Je = {
|
|
@@ -1124,7 +1125,7 @@ const We = (l, e) => {
|
|
|
1124
1125
|
key: 5,
|
|
1125
1126
|
class: "card-box flex-center"
|
|
1126
1127
|
};
|
|
1127
|
-
function Nt(l, e, t, h, s,
|
|
1128
|
+
function Nt(l, e, t, h, s, w) {
|
|
1128
1129
|
var L, N, I, P, H;
|
|
1129
1130
|
const M = we("ElOption"), C = we("ElSelect"), S = we("ElTooltip");
|
|
1130
1131
|
return n(), o("div", Re, [
|
|
@@ -1143,8 +1144,8 @@ function Nt(l, e, t, h, s, v) {
|
|
|
1143
1144
|
"remote-show-suffix": "",
|
|
1144
1145
|
onFocus: e[1] || (e[1] = (a) => s.placeholder = ""),
|
|
1145
1146
|
onBlur: e[2] || (e[2] = (a) => s.placeholder = "search for port name or coordinates"),
|
|
1146
|
-
"remote-method":
|
|
1147
|
-
onChange:
|
|
1147
|
+
"remote-method": w.fetchSuggestPosition,
|
|
1148
|
+
onChange: w.handleFetchMeteo
|
|
1148
1149
|
}, {
|
|
1149
1150
|
default: ve(() => [
|
|
1150
1151
|
(n(!0), o(b, null, x(s.positionList, (a) => (n(), He(M, {
|
|
@@ -1159,9 +1160,9 @@ function Nt(l, e, t, h, s, v) {
|
|
|
1159
1160
|
])
|
|
1160
1161
|
]),
|
|
1161
1162
|
i("div", Fe, [
|
|
1162
|
-
i("div",
|
|
1163
|
+
i("div", Oe, [
|
|
1163
1164
|
i("div", null, [
|
|
1164
|
-
i("div",
|
|
1165
|
+
i("div", Be, "Weather forecast for " + f(((L = s.position) == null ? void 0 : L.name) || "-") + " ( " + f(s.positionOffset) + " )", 1),
|
|
1165
1166
|
i("div", Ve, "At " + f((N = s.position) != null && N.portId ? "port" : "coordinates") + ", issued " + f(s.issuedDate), 1)
|
|
1166
1167
|
]),
|
|
1167
1168
|
i("div", Ue, [
|
|
@@ -1175,11 +1176,11 @@ function Nt(l, e, t, h, s, v) {
|
|
|
1175
1176
|
s.isCollected ? (n(), o("span", {
|
|
1176
1177
|
key: 0,
|
|
1177
1178
|
class: "iconfont icon active",
|
|
1178
|
-
onClick: e[3] || (e[3] = (...a) =>
|
|
1179
|
+
onClick: e[3] || (e[3] = (...a) => w.handleCollect && w.handleCollect(...a))
|
|
1179
1180
|
}, "")) : (n(), o("span", {
|
|
1180
1181
|
key: 1,
|
|
1181
1182
|
class: "iconfont icon",
|
|
1182
|
-
onClick: e[4] || (e[4] = (...a) =>
|
|
1183
|
+
onClick: e[4] || (e[4] = (...a) => w.handleCollect && w.handleCollect(...a))
|
|
1183
1184
|
}, ""))
|
|
1184
1185
|
]),
|
|
1185
1186
|
_: 1
|
|
@@ -1188,7 +1189,7 @@ function Nt(l, e, t, h, s, v) {
|
|
|
1188
1189
|
]),
|
|
1189
1190
|
(I = s.position) != null && I.name && !s.loading ? (n(), o("div", Ze)) : s.loading ? (n(), o("div", Je, "Loading....")) : s.position.name ? be("", !0) : (n(), o("div", Ye, "No Data")),
|
|
1190
1191
|
(P = s.position) != null && P.name && !s.loading ? (n(), o("div", je, [
|
|
1191
|
-
i("div", qe, f(s.pickedWeek) + " " + f(
|
|
1192
|
+
i("div", qe, f(s.pickedWeek) + " " + f(w.computeMMMDD(s.pickedDate)), 1),
|
|
1192
1193
|
i("table", Qe, [
|
|
1193
1194
|
i("tr", Ke, [
|
|
1194
1195
|
e[5] || (e[5] = i("th", {
|
|
@@ -1204,7 +1205,7 @@ function Nt(l, e, t, h, s, v) {
|
|
|
1204
1205
|
colspan: "1",
|
|
1205
1206
|
class: z(s.activeIndex === r ? "active" : ""),
|
|
1206
1207
|
key: Math.random() + "local"
|
|
1207
|
-
}, f(
|
|
1208
|
+
}, f(w.computeHourL(a)), 3))), 128))
|
|
1208
1209
|
]),
|
|
1209
1210
|
i("tr", Xe, [
|
|
1210
1211
|
e[6] || (e[6] = i("th", {
|
|
@@ -1220,7 +1221,7 @@ function Nt(l, e, t, h, s, v) {
|
|
|
1220
1221
|
colspan: "1",
|
|
1221
1222
|
class: z(s.activeIndex === r ? "active" : ""),
|
|
1222
1223
|
key: Math.random() + "z"
|
|
1223
|
-
}, f(
|
|
1224
|
+
}, f(w.computeHourZ(a)), 3))), 128))
|
|
1224
1225
|
]),
|
|
1225
1226
|
i("tr", $e, [
|
|
1226
1227
|
e[7] || (e[7] = i("td", {
|
|
@@ -1593,7 +1594,7 @@ function Nt(l, e, t, h, s, v) {
|
|
|
1593
1594
|
])
|
|
1594
1595
|
]);
|
|
1595
1596
|
}
|
|
1596
|
-
const It = /* @__PURE__ */ We(Te, [["render", Nt], ["__scopeId", "data-v-
|
|
1597
|
+
const It = /* @__PURE__ */ We(Te, [["render", Nt], ["__scopeId", "data-v-3ab7a0ef"]]), Rt = {
|
|
1597
1598
|
install(l) {
|
|
1598
1599
|
l.component("SpotReport", It);
|
|
1599
1600
|
}
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(k,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("moment"),require("moment-timezone"),require("@element-plus/icons-vue"),require("@idm-plugin/geo"),require("echarts"),require("vue"),require("axios")):typeof define=="function"&&define.amd?define(["exports","moment","moment-timezone","@element-plus/icons-vue","@idm-plugin/geo","echarts","vue","axios"],y):(k=typeof globalThis<"u"?globalThis:k||self,y(k["idmui-spot"]={},k.moment,k["moment-timezone"],k["@element-plus/icons-vue"],k["@idm-plugin/geo"],k.echarts,k.Vue,k.axios))})(this,function(k,y,J,ue,ne,xe,e,le){"use strict";function ke(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const s in n)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(n,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:()=>n[s]})}}return t.default=n,Object.freeze(t)}const ce=ke(xe);class de{static pickHourly(t,s){var r,a,w,E,D,f,_,z,N,B,V,o,i,Z,x,C,I,M,P,T,H,F,W,R,A,G,O,v,p,u,d,b,S,g,q,Q,X,te,ee,L,K,h,U,m,se,ae,oe,me;const pe=typeof s=="string"?y(s):s,Y=t==null?void 0:t.weather,ge=t==null?void 0:t.marine,we=y((a=(r=Y==null?void 0:Y[0])==null?void 0:r.hourly)==null?void 0:a.date).utc(),ie=we.clone().add((D=(E=(w=Y==null?void 0:Y[0])==null?void 0:w.hourly)==null?void 0:E.time)==null?void 0:D.at(0),"h"),bt=we.clone().add((z=(_=(f=Y==null?void 0:Y[0])==null?void 0:f.hourly)==null?void 0:_.time)==null?void 0:z.at(-1),"h"),be=[];if(pe.isBetween(ie,bt,"millisecond","[]")){const l=pe.utc().diff(ie,"h",!1);let j,$;if(Y)for(const re of Y){const c=re.hourly;j={temp:(N=c.temperature_2m)==null?void 0:N.at(l),apparentTemp:(B=c.apparent_temperature)==null?void 0:B.at(l),rh:(V=c.relative_humidity_2m)==null?void 0:V.at(l),dp:(o=c.dew_point_2m)==null?void 0:o.at(l),precip:{probability:(i=c.precipitation_probability)==null?void 0:i.at(l),sum:(Z=c.precipitation)==null?void 0:Z.at(l)},pmsl:(x=c.pressure_msl)==null?void 0:x.at(l),psurf:(C=c.surface_pressure)==null?void 0:C.at(l),code:(I=c.weather_code)==null?void 0:I.at(l),visibility:this.m2nm((M=c.visibility)==null?void 0:M.at(l)),wind:{speed:(P=c.wind_speed_10m)==null?void 0:P.at(l),kts:(T=c.wind_speed_10m)==null?void 0:T.at(l),degree:(H=c.wind_direction_10m)==null?void 0:H.at(l),bearing:((F=c.wind_direction_10m)==null?void 0:F.at(l))!==null?(((W=c.wind_direction_10m)==null?void 0:W.at(l))+180)%360:null,gusts:(R=c.wind_gusts_10m)==null?void 0:R.at(l)},isDay:(A=c.is_day)==null?void 0:A.at(l)};const{name:ut,url:xt,bg:kt}=this.parseWeatherCode(j.code,j.isDay);j.name=ut,j.url=xt,j.bg=kt,j.wind.scale=this.beaufort(this.kts2ms(j.wind.kts)),j.wind.direction=this.degree2Direction(j.wind.degree)}if(ge)for(const re of ge){const c=re.hourly;$={wave:{sig:{height:(G=c.wave_height)==null?void 0:G.at(l),degree:(O=c.wave_direction)==null?void 0:O.at(l),bearing:((v=c.wave_direction)==null?void 0:v.at(l))!==null?(((p=c.wave_direction)==null?void 0:p.at(l))+180)%360:null,period:(u=c.wave_period)==null?void 0:u.at(l)},swell:{height:(d=c.swell_wave_height)==null?void 0:d.at(l),degree:(b=c.swell_wave_direction)==null?void 0:b.at(l),bearing:((S=c.swell_wave_direction)==null?void 0:S.at(l))!==null?(((g=c.swell_wave_direction)==null?void 0:g.at(l))+180)%360:null,period:(q=c.swell_wave_period)==null?void 0:q.at(l),peakPeriod:(Q=c.swell_wave_peak_period)==null?void 0:Q.at(l)},wd:{height:(X=c.wind_wave_height)==null?void 0:X.at(l),degree:(te=c.wind_wave_direction)==null?void 0:te.at(l),bearing:((ee=c.wind_wave_direction)==null?void 0:ee.at(l))!==null?(((L=c.wind_wave_direction)==null?void 0:L.at(l))+180)%360:null,period:(K=c.wind_wave_period)==null?void 0:K.at(l),peakPeriod:(h=c.wind_wave_peak_period)==null?void 0:h.at(l)}},current:{speed:(U=c.ocean_current_velocity)==null?void 0:U.at(l),kts:(m=c.ocean_current_velocity)==null?void 0:m.at(l),degree:(se=c.ocean_current_direction)==null?void 0:se.at(l),bearing:((ae=c.ocean_current_direction)==null?void 0:ae.at(l))??null},sst:(oe=c.sea_surface_temperature)==null?void 0:oe.at(l),height:(me=c.sea_level_height_msl)==null?void 0:me.at(l)},$.wave=this.parseWave($.wave),$.current.direction=this.degree2Direction($.current.degree)}be.push({utc:ie.add(l,"h").format(),weather:{...j},...$})}return be}static toLegacy(t){return{wind:t.weather.wind,visibility:t.weather.visibility,temp:t.weather.temp,prmsl:t.weather.pmsl,gusts:{kts:t.weather.wind.gusts},precip:t.weather.precip,code:t.weather.code,name:t.weather.name,url:t.weather.url,wave:t.wave,current:t.current,sst:t.sst,height:t.height,utc:t.utc}}static pickDaily(t,s){var r,a,w,E,D,f,_,z,N,B,V,o,i,Z,x,C,I,M,P,T,H,F,W,R,A,G,O,v,p,u,d,b,S;const g=typeof s=="string"?y(s):s,q=t==null?void 0:t.weather,Q=t==null?void 0:t.marine,X=y((w=(a=(r=q==null?void 0:q[0])==null?void 0:r.daily)==null?void 0:a.time)==null?void 0:w.at(0)),te=y((f=(D=(E=q==null?void 0:q[0])==null?void 0:E.daily)==null?void 0:D.time)==null?void 0:f.at(-1)),ee=[];if(g.isBetween(X,te,"millisecond","[]")){let L,K;const h=g.diff(X,"d",!1);if(q)for(const U of q){const m=U.daily;L={code:(_=m.weather_code)==null?void 0:_.at(h),temp:{max:(z=m.temperature_2m_max)==null?void 0:z.at(h),min:(N=m.temperature_2m_min)==null?void 0:N.at(h),mean:(B=m.temperature_2m_mean)==null?void 0:B.at(h)},apparentTemp:{max:(V=m.apparent_temperature_max)==null?void 0:V.at(h),min:(o=m.apparent_temperature_min)==null?void 0:o.at(h)},precip:{sum:(i=m.precipitation_sum)==null?void 0:i.at(h),hours:(Z=m.precipitation_hours)==null?void 0:Z.at(h),probability:(x=m.precipitation_probability_max)==null?void 0:x.at(h)},rh:{max:(C=m.relative_humidity_2m_max)==null?void 0:C.at(h),min:(I=m.relative_humidity_2m_min)==null?void 0:I.at(h),mean:(M=m.relative_humidity_2m_mean)==null?void 0:M.at(h)},wind:{speed:(P=m.wind_speed_10m_max)==null?void 0:P.at(h),kts:(T=m.wind_speed_10m_max)==null?void 0:T.at(h),degree:(H=m.wind_direction_10m_dominant)==null?void 0:H.at(h),gusts:(F=m.wind_gusts_10m_max)==null?void 0:F.at(h)}};const{name:se,url:ae,bg:oe}=this.parseWeatherCode(L.code,!0);L.name=se,L.url=ae,L.bg=oe,L.wind.scale=this.beaufort(this.kts2ms(L.wind.kts)),L.wind.direction=this.degree2Direction(L.wind.degree)}if(Q)for(const U of Q){const m=U.daily;K={wave:{sig:{height:(W=m.wave_height_max)==null?void 0:W.at(h),degree:(R=m.wave_direction_dominant)==null?void 0:R.at(h),period:(A=m.wave_period_max)==null?void 0:A.at(h)},swell:{height:(G=m.swell_wave_height_max)==null?void 0:G.at(h),degree:(O=m.wave_direction_dominant)==null?void 0:O.at(h),period:(v=m.swell_wave_period_max)==null?void 0:v.at(h),peakPeriod:(p=m.swell_wave_peak_period_max)==null?void 0:p.at(h)},wd:{height:(u=m.wind_wave_height_max)==null?void 0:u.at(h),degree:(d=m.wind_wave_direction_dominant)==null?void 0:d.at(h),period:(b=m.wind_wave_period_max)==null?void 0:b.at(h),peakPeriod:(S=m.wind_wave_peak_period_max)==null?void 0:S.at(h)}}},K.wave=this.parseWave(K.wave)}ee.push({utc:X.add(h,"d").utc().format(),weather:{...L},...K})}return ee}static parseWave(t){return t.sig.direction=this.degree2Direction(t.sig.degree),t.swell.direction=this.degree2Direction(t.swell.degree),t.wd.direction=this.degree2Direction(t.wd.degree),t.sig.scale=this.douglas(t.sig.height),t.swell.scale=this.douglas(t.swell.height),t.wd.scale=this.douglas(t.wd.height),t}static parseWeatherCode(t,s){const r=this.weatherCode(t);return(s?r.day:r.night)||{}}static weatherCode(t){const s={code:t};switch(t){case 0:s.day={name:"Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"},s.night={name:"Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"};break;case 1:s.day={name:"Mainly Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"},s.night={name:"Mainly Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"};break;case 2:s.day={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg2.png"},s.night={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg2.png"};break;case 3:s.day={name:"Overcast",url:"https://osshz.idmwx.com/asset/weather/04d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg3.png"},s.night={name:"Overcast",url:"https://osshz.idmwx.com/asset/weather/04n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg3.png"};break;case 45:s.day={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"},s.night={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"};break;case 48:s.day={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"},s.night={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"};break;case 51:s.day={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 53:s.day={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 55:s.day={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/15d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/15n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 56:s.day={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 57:s.day={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 61:s.day={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 63:s.day={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 65:s.day={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 66:s.day={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 67:s.day={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 71:s.day={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},s.night={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 73:s.day={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},s.night={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 75:s.day={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},s.night={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 77:s.day={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},s.night={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 80:s.day={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 81:s.day={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 82:s.day={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 85:s.day={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},s.night={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 86:s.day={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},s.night={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 95:s.day={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 96:s.day={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 99:s.day={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break}return s}static kts2ms(t){return isNaN(t)||t===null?t:Math.round(t*1852/3600*1e4)/1e4}static kts2kmh(t){return isNaN(t)||t===null?t:t*1.852}static m2nm(t){return isNaN(t)||t===null?t:Math.round(t/1e3/1.852*1e4)/1e4}static kmh2kts(t){return isNaN(t)||t===null?t:this.ms2kts(t*1e3/3600)}static ms2kts(t){return isNaN(t)||t===null?t:Math.round(t*3600/1852*1e4)/1e4}static degree2Radian(t){if(isNaN(t)||t===null)return t;let s=t%360/360*2*Math.PI;return s=s<0?s+2*Math.PI:s,s}static degree2Direction(t){const s=this.degree2Radian(t);if(isNaN(s)||s===null)return null;let r="N/A";const a=Math.PI/16;return s<a?r="N":s>=a&&s<3*a?r="NNE":s>=3*a&&s<5*a?r="NE":s>=5*a&&s<7*a?r="ENE":s>=7*a&&s<9*a?r="E":s>=9*a&&s<11*a?r="ESE":s>=11*a&&s<13*a?r="SE":s>=13*a&&s<15*a?r="SSE":s>=15*a&&s<17*a?r="S":s>=17*a&&s<19*a?r="SSW":s>=19*a&&s<21*a?r="SW":s>=21*a&&s<23*a?r="WSW":s>=23*a&&s<25*a?r="W":s>=25*a&&s<27*a?r="WNW":s>=27*a&&s<29*a?r="NW":s>=29*a&&s<31*a?r="NNW":s>=31*a&&s<32*a&&(r="N"),r}static beaufort(t){let s=0;return isNaN(t)||(t=Math.round(t*10)/10,t<=.2?s=0:t<=1.5?s=1:t<=3.3?s=2:t<=5.4?s=3:t<=7.9?s=4:t<=10.7?s=5:t<=13.8?s=6:t<=17.1?s=7:t<=20.7?s=8:t<=22.4?s=9:t<=28.4?s=10:t<=32.6?s=11:t>32.6&&(s=12)),s}static douglas(t){let s="Calm";return isNaN(t)||t<=.1?s="Calm":t<=.5?s="Smooth":t<=1.25?s="Slight":t<=2.5?s="Moderate":t<=4?s="Rough":t<=6?s="VeryRough":t<=9?s="High":t<=14?s="VeryHigh":s="Precipitous",s}}const yt="",ye=(n,t)=>{const s=n.__vccOpts||n;for(const[r,a]of t)s[r]=a;return s},fe={name:"SpotReport",props:{token:{type:String,default:""},ts:{type:String,default:y().utc().format()},timeZone:{type:Number,default:8},report:{type:Object,default:()=>({})}},emits:["url"],data(){return{placeholder:"search for port name or coordinates",searchName:void 0,rawSearchIcon:e.markRaw(ue.Search),positionGmt:void 0,issuedDate:void 0,meteoData:{},a:void 0,positionList:[],position:void 0,loading:!0,activeIndex:void 0,tableData:{},pickedDate:void 0,pickedWeek:"Today",collectList:[],isCollected:!1}},computed:{computeHourL(){return function(n){return n?`${J(n).tz(this.positionGmt).format("HH")}`:"-"}},computeHourZ(){return function(n){return n?`${y(n).utc().format("HH")}Z`:"-"}},computeWeek(){return function(n){return n?`${J(n).tz(this.positionGmt).format("dddd")}`:"-"}},computeMMMDD(){return function(n){return n?`${J(n).tz(this.positionGmt).format("MMM-DD")}`:"-"}},computeLat(){return function(n,t=4){return ne.LngLatHelper.lat2pretty(n,t).pretty}},computeLng(){return function(n,t=4){return ne.LngLatHelper.lng2pretty(n,t).pretty}},roundPrecision(){return function(n,t=4){return isNaN(n)?"-":ne.LngLatHelper.roundPrecision(n,t)}}},watch:{"report.version":{handler(){var n,t,s;this.report&&(this.meteoData=this.report,this.position={id:this.report.portId,lat:(n=this.report)==null?void 0:n.lat,lng:(t=this.report)==null?void 0:t.lng,name:((s=this.report)==null?void 0:s.searchName)||this.computeLat(this.report.lat)+","+this.computeLng(this.report.lng)},this.handleRender())}}},methods:{handleRender(){this.initInfo(),this.initTableData(),this.$nextTick(()=>{this.initEchart()})},initInfo(){var n,t;this.loading=!1,this.positionGmt=(t=(n=this.meteoData.weather)==null?void 0:n[0])==null?void 0:t.timezone,this.issuedDate=y(this.ts).utc().format("MMM-DD/HHmm[Z], YYYY"),this.activeIndex=J(this.ts).tz(this.positionGmt).hour(),this.pickedDate=J(this.ts).tz(this.positionGmt).set({hour:0,minute:0,second:0,millisecond:0}).format(),this.collectList=JSON.parse(localStorage.getItem("idmCollectList")||"[]"),this.positionList=JSON.parse(JSON.stringify(this.collectList)),this.isCollected=this.collectList.some(s=>{var r;return s.name===((r=this.position)==null?void 0:r.name)})},initTableData(){var n,t,s,r,a,w,E,D,f,_,z,N,B,V,o,i,Z,x,C,I,M,P,T,H,F,W,R,A,G,O,v,p,u,d;this.tableData={hours:[],utcHours:[],weatherUrls:[],weatherNames:[],temp:[],precipProbability:[],precip1h:[],visibility:[],humidity:[],windSpeed:[],windDir:[],windGust:[],sigwaveHeight:[],sigwaveDir:[],windwaveHeight:[],windwaveDir:[],windwavePeriod:[],swellHeight:[],swellDir:[],swellPeriod:[],currentSpeed:[],currentDir:[],seaLevel:[],seaTemp:[]};for(let b=0;b<24;b++){const S=y(this.pickedDate).clone().add(b,"h").format();this.tableData.hours.push(S);const g=((n=de.pickHourly(this.meteoData,S))==null?void 0:n[0])||{};this.tableData.weatherUrls.push((t=g.weather)==null?void 0:t.url),this.tableData.weatherNames.push(((s=g.weather)==null?void 0:s.name)??"-"),this.tableData.temp.push(this.roundPrecision((r=g.weather)==null?void 0:r.temp,0)??"-"),this.tableData.precipProbability.push(this.roundPrecision((w=(a=g.weather)==null?void 0:a.precip)==null?void 0:w.probability,0)??"-"),this.tableData.precip1h.push(this.roundPrecision((D=(E=g.weather)==null?void 0:E.precip)==null?void 0:D.sum,0)??"-"),this.tableData.visibility.push(this.roundPrecision((f=g.weather)==null?void 0:f.visibility,0)??"-"),this.tableData.humidity.push(this.roundPrecision((_=g.weather)==null?void 0:_.rh,0)??"-"),this.tableData.windSpeed.push(this.roundPrecision((N=(z=g.weather)==null?void 0:z.wind)==null?void 0:N.kts,1)),this.tableData.windDir.push((V=(B=g.weather)==null?void 0:B.wind)==null?void 0:V.bearing),this.tableData.windGust.push(this.roundPrecision((i=(o=g.weather)==null?void 0:o.wind)==null?void 0:i.gusts,1)??"-"),this.tableData.sigwaveHeight.push(this.roundPrecision((x=(Z=g.wave)==null?void 0:Z.sig)==null?void 0:x.height,1)??"-"),this.tableData.sigwaveDir.push((I=(C=g.wave)==null?void 0:C.sig)==null?void 0:I.bearing),this.tableData.windwaveHeight.push(this.roundPrecision((P=(M=g.wave)==null?void 0:M.wd)==null?void 0:P.height,1)??"-"),this.tableData.windwaveDir.push((H=(T=g.wave)==null?void 0:T.wd)==null?void 0:H.bearing),this.tableData.windwavePeriod.push(this.roundPrecision((W=(F=g.wave)==null?void 0:F.wd)==null?void 0:W.period,1)??"-"),this.tableData.swellHeight.push(this.roundPrecision((A=(R=g.wave)==null?void 0:R.swell)==null?void 0:A.height,1)??"-"),this.tableData.swellDir.push((O=(G=g.wave)==null?void 0:G.swell)==null?void 0:O.bearing),this.tableData.swellPeriod.push(this.roundPrecision((p=(v=g.wave)==null?void 0:v.swell)==null?void 0:p.period,1)??"-"),this.tableData.currentSpeed.push(this.roundPrecision((u=g.current)==null?void 0:u.speed,1)??"-"),this.tableData.currentDir.push((d=g.current)==null?void 0:d.bearing),this.tableData.seaLevel.push(this.roundPrecision(g.height,1)??"-"),this.tableData.seaTemp.push(this.roundPrecision(g.sst,0)??"-")}},initEchart(){var C,I,M,P,T,H,F,W,R,A,G,O,v;const n=[],t=[],s=[],r=[],a=[],w=[],E=[],D=[],f=[],_=[],z={};for(let p=0;p<7;p++){const u=y(this.pickedDate).clone().add(p,"d");n.push(J(u).tz(this.positionGmt).format("yyyy-MM-DD")),t.push(this.computeMMMDD(u)),s.push(p===0?"Today":this.computeWeek(u));const d=((C=de.pickDaily(this.meteoData,u))==null?void 0:C[0])||{};r.push(this.roundPrecision((M=(I=d.weather)==null?void 0:I.temp)==null?void 0:M.min,0)),a.push(this.roundPrecision((T=(P=d.weather)==null?void 0:P.temp)==null?void 0:T.max,0)),D.push(this.roundPrecision((F=(H=d.weather)==null?void 0:H.wind)==null?void 0:F.kts,1)??"- kts"),_.push(this.roundPrecision((R=(W=d.weather)==null?void 0:W.precip)==null?void 0:R.sum,0)??"- mm"),w.push({symbol:"image://"+((A=d.weather)==null?void 0:A.url)}),E.push((G=d.weather)==null?void 0:G.name),f.push((v=(O=d.weather)==null?void 0:O.wind)==null?void 0:v.degree)}const N=Math.max(...a.filter(p=>typeof p=="number"&&!isNaN(p)))-Math.min(...r.filter(p=>typeof p=="number"&&!isNaN(p))),B=Math.min(...r.filter(p=>typeof p=="number"&&!isNaN(p)))-1.5*N,V=Math.max(...a.filter(p=>typeof p=="number"&&!isNaN(p)))+2*N,o=4+.5/n.length*92+"%",i="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent('<svg t="1740385441519" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10951" width="200" height="200"><path d="M512 804.83593751A276.87183211 276.87183211 0 0 1 235.12816789 527.9641054Q235.12816789 375.21005376 512 13.82031251q276.87183211 361.30792288 276.87183211 514.14379289a276.87183211 276.87183211 0 0 1-276.87183211 276.87183211zM294.4461577 527.9641054a217.47202472 217.47202472 0 0 0 217.5538423 217.55384231 19.79993605 19.79993605 0 1 0 0-39.51805453 177.9539702 177.9539702 0 0 1-177.9539702-178.03578778 19.79993605 19.79993605 0 0 0-39.5998721 0z" fill="#0c73a8" p-id="10952"></path></svg>'))),Z="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent('<svg t="1740383449285" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10797" width="200" height="200"><path d="M133.8 579l-44.4-44.4c-18.8-18.8-18.8-49.2 0-67.8L478 78c18.8-18.8 49.2-18.8 67.8 0l388.6 388.6c18.8 18.8 18.8 49.2 0 67.8L890 578.8c-19 19-50 18.6-68.6-0.8L592 337.2V912c0 26.6-21.4 48-48 48h-64c-26.6 0-48-21.4-48-48V337.2L202.4 578.2c-18.6 19.6-49.6 20-68.6 0.8z" fill="#ffffff" p-id="10798"></path></svg>'))),x=new Image(64,64);x.src=Z,x.onload=()=>{for(let d=0;d<7;d++){const b=document.createElement("canvas"),S=b.getContext("2d");b.width=x.width,b.height=x.height;const q=f[d]*(Math.PI/180);S.translate(b.width/2,b.height/2),S.rotate(q),S.translate(-x.width/2,-x.height/2),S.drawImage(x,0,0,64,64);const Q=b.toDataURL();z[`WindIcon${d}`]={height:12,width:12,align:"left",backgroundColor:{image:Q}}}const p=ce.init(document.getElementById("weather-chart")),u={grid:{bottom:0,top:0,left:"4%",right:"4%"},tooltip:{trigger:"item",show:!0,position:"right",formatter:function(d){return d.seriesName==="Weather Icon"?E[d.dataIndex]:!1}},legend:{show:!1},xAxis:{left:0,right:0,top:"50%",height:"50%",type:"category",data:n,show:!1},singleAxis:[{left:o,right:o,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:n,top:"7%",height:"2%"},{left:o,right:o,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:n,top:"16%",height:"2%"},{left:o,right:o,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:n,top:"27%",height:"2%"},{left:o,right:o,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:n,top:"84%",height:"2%"},{left:o,right:o,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:n,top:"93%",height:"2%"}],yAxis:{type:"value",name:"温度(℃)",show:!1,min:B,max:V,axisLabel:{formatter:"{value} °C"}},series:[{singleAxisIndex:0,coordinateSystem:"singleAxis",type:"scatter",data:s,label:{show:!0,color:"#fff",fontSize:14,formatter:"{c}"},symbolSize:0},{singleAxisIndex:1,coordinateSystem:"singleAxis",type:"scatter",data:t,label:{show:!0,color:"#fff",formatter:"{c}"},symbolSize:0},{name:"Weather Icon",singleAxisIndex:2,coordinateSystem:"singleAxis",type:"scatter",data:w,symbolSize:36},{name:"温度(℃)",type:"line",data:r,smooth:!0,itemStyle:{color:"rgba(255,255,255,0.7)"},label:{show:!0,color:"rgba(255,255,255,1)",position:[-10,12],formatter:"{c} °C",fontSize:12},markArea:{itemStyle:{color:"rgb(71,143,206)"},data:[[{x:"4%"},{x:4+1/n.length*92+"%"}]]}},{name:"温度(℃)",type:"line",data:a,smooth:!0,itemStyle:{color:"rgba(255,255,255,0.7)"},label:{show:!0,color:"rgba(255,255,255,1)",position:[-10,-12],formatter:"{c} °C",fontSize:12}},{singleAxisIndex:3,coordinateSystem:"singleAxis",type:"scatter",data:D,label:{show:!0,color:"#fff",rich:{...z,title:{align:"center",vertical:"center"}},formatter:function(d){return`{WindIcon${d.dataIndex}|}{title|${d.value}} kts`}},symbolSize:0},{singleAxisIndex:4,coordinateSystem:"singleAxis",type:"scatter",data:_,label:{show:!0,color:"#fff",rich:{dIcon:{height:16,width:16,align:"left",backgroundColor:{image:i}},title:{align:"center",vertical:"center"}},formatter:function(d){return`{dIcon|}{title|${d.value}} mm`}},symbolSize:0}]};p.setOption(u),p.on("click",d=>{const b=d.dataIndex;this.pickedDate=J(n[b]).tz(this.positionGmt).set({hour:0,minute:0,second:0,millisecond:0}).format(),this.pickedWeek=b===0?"Today":this.computeWeek(this.pickedDate),this.activeIndex=b===0?J(this.ts).tz(this.positionGmt).hour():void 0,this.initTableData(),u.series[3].markArea={itemStyle:{color:"rgb(71,143,206)"},data:[[{x:4+b/n.length*92+"%"},{x:4+(b+1)/n.length*92+"%"}]]},p.setOption(u)})}},handleCollect(){this.isCollected=!this.isCollected,this.isCollected?this.collectList.push({name:this.position.name,lat:this.position.lat,lng:this.position.lng}):this.collectList=this.collectList.filter(n=>n.name!==this.position.name),localStorage.setItem("idmCollectList",JSON.stringify(this.collectList))},async fetchSuggestPosition(n){var r;const t=n.replaceAll(",",",");if(!t)return this.positionList=this.collectList,!1;const s=await le.get(`https://cbe.idmwx.com/api/arc/ports/suggest?n=${t}`,{headers:{Authorization:this.token}});(s==null?void 0:s.data.code)===0&&(this.positionList=(r=s==null?void 0:s.data.data)==null?void 0:r.map(a=>(a.name=a.id?a.name:this.computeLat(a.lat)+", "+this.computeLng(a.lng),a)))},async handleFetchMeteo(){var s,r,a;if(!this.searchName)return!1;this.position={portId:(s=this.positionList.find(w=>w.name===this.searchName))==null?void 0:s.id,lat:(r=this.positionList.find(w=>w.name===this.searchName))==null?void 0:r.lat,lng:(a=this.positionList.find(w=>w.name===this.searchName))==null?void 0:a.lng,name:this.searchName},this.$emit("url",this.position),this.handleClear();const n={lat:this.position.lat,lng:this.position.lng,forecastDays:8,selfHosted:!1},t=await le.post("https://cbe.idmwx.com/api/arc/meteo2/spot/forecast",n,{headers:{Authorization:this.token}});(t==null?void 0:t.data.code)===0&&(this.meteoData={...t==null?void 0:t.data.data}),this.handleRender()},handleClear(){this.loading=!0,this.meteoData={},this.isCollected=!1,ce.dispose(document.getElementById("weather-chart"))}}},_e={class:"spot-report"},ze={class:"header-box flex-between"},Ne={class:"bg"},Ee={class:"search-box flex-start"},De={class:"content-box"},Be={class:"title-box flex-between"},Ve={class:"main-title"},Se={class:"sub-title"},Le={class:"flex-end"},Ce={key:0,id:"weather-chart"},Ie={key:1,class:"weather-chart flex-center"},Me={key:2,class:"weather-chart flex-center"},Pe={key:3,class:"card-box"},Te={class:"date"},He={class:"basic-table"},Fe={class:"day"},We={class:"hour"},Re={class:"icon"},Ae=["src"],Ge={class:"text"},Oe={class:"text"},ve={class:"text"},qe={class:"text"},je={class:"text"},Ze={class:"text"},Je={key:1},Ye={class:"text"},Qe={class:"text"},Ke={class:"wave-current-table"},Xe={class:"text"},Ue={class:"text"},$e={key:1},et={class:"text"},tt={class:"text"},st={class:"text"},at={key:1},ot={class:"text"},nt={class:"text"},it={class:"text"},rt={key:1},lt={class:"text"},ct={class:"sea-table"},dt={class:"text"},ht={class:"text"},mt={key:4,class:"card-box flex-center"},pt={key:5,class:"card-box flex-center"};function gt(n,t,s,r,a,w){var _,z,N,B,V;const E=e.resolveComponent("ElOption"),D=e.resolveComponent("ElSelect"),f=e.resolveComponent("ElTooltip");return e.openBlock(),e.createElementBlock("div",_e,[e.createElementVNode("div",ze,[e.createElementVNode("div",Ne,[e.createElementVNode("div",Ee,[e.createVNode(D,{modelValue:a.searchName,"onUpdate:modelValue":t[0]||(t[0]=o=>a.searchName=o),filterable:"",class:"input",clearable:"",remote:"",placeholder:a.placeholder,autocomplete:"","remote-show-suffix":"",onFocus:t[1]||(t[1]=o=>a.placeholder=""),onBlur:t[2]||(t[2]=o=>a.placeholder="search for port name or coordinates"),"remote-method":w.fetchSuggestPosition,onChange:w.handleFetchMeteo},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.positionList,o=>(e.openBlock(),e.createBlock(E,{key:o.name,label:o.name,value:o.name},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","remote-method","onChange"])])])]),e.createElementVNode("div",De,[e.createElementVNode("div",Be,[e.createElementVNode("div",null,[e.createElementVNode("div",Ve,"Weather forecast for "+e.toDisplayString(((_=a.position)==null?void 0:_.name)||"-")+" ( "+e.toDisplayString(a.positionGmt)+" )",1),e.createElementVNode("div",Se,"At "+e.toDisplayString((z=a.position)!=null&&z.portId?"port":"coordinates")+", issued "+e.toDisplayString(a.issuedDate),1)]),e.createElementVNode("div",Le,[e.createVNode(f,{placement:"left",effect:"light",content:a.isCollected?"remove the port/coordinate from the search list":"add the port/coordinate to the search list","show-after":1e3},{default:e.withCtx(()=>[a.isCollected?(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon active",onClick:t[3]||(t[3]=(...o)=>w.handleCollect&&w.handleCollect(...o))},"")):(e.openBlock(),e.createElementBlock("span",{key:1,class:"iconfont icon",onClick:t[4]||(t[4]=(...o)=>w.handleCollect&&w.handleCollect(...o))},""))]),_:1},8,["content"])])]),(N=a.position)!=null&&N.name&&!a.loading?(e.openBlock(),e.createElementBlock("div",Ce)):a.loading?(e.openBlock(),e.createElementBlock("div",Ie,"Loading....")):a.position.name?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Me,"No Data")),(B=a.position)!=null&&B.name&&!a.loading?(e.openBlock(),e.createElementBlock("div",Pe,[e.createElementVNode("div",Te,e.toDisplayString(a.pickedWeek)+" "+e.toDisplayString(w.computeMMMDD(a.pickedDate)),1),e.createElementVNode("table",He,[e.createElementVNode("tr",Fe,[t[5]||(t[5]=e.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Local time"),e.createElementVNode("span",{class:"unit"},"(LT)")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.hours,(o,i)=>(e.openBlock(),e.createElementBlock("th",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"local"},e.toDisplayString(w.computeHourL(o)),3))),128))]),e.createElementVNode("tr",We,[t[6]||(t[6]=e.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("UTC"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.hours,(o,i)=>(e.openBlock(),e.createElementBlock("th",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"z"},e.toDisplayString(w.computeHourZ(o)),3))),128))]),e.createElementVNode("tr",Re,[t[7]||(t[7]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Weather"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.weatherUrls,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"url"},[e.createVNode(f,{placement:"top",effect:"light",content:a.tableData.weatherNames[i],"show-after":500},{default:e.withCtx(()=>[o?(e.openBlock(),e.createElementBlock("img",{key:0,class:"iconfont weather-icon",src:o},null,8,Ae)):e.createCommentVNode("",!0)]),_:2},1032,["content"])],2))),128))]),e.createElementVNode("tr",Ge,[t[8]||(t[8]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Temperature"),e.createElementVNode("span",{class:"unit"},"°C")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.temp,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",Oe,[t[9]||(t[9]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Precipitation Probability"),e.createElementVNode("span",{class:"unit"},"%")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.precipProbability,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",ve,[t[10]||(t[10]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Precipitation 1h"),e.createElementVNode("span",{class:"unit"},"mm")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.precip1h,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",qe,[t[11]||(t[11]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Visibility"),e.createElementVNode("span",{class:"unit"},"nm")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.visibility,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",je,[t[12]||(t[12]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Relative Humidity"),e.createElementVNode("span",{class:"unit"},"%")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.humidity,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",Ze,[t[13]||(t[13]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windDir,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},[isNaN(o)?(e.openBlock(),e.createElementBlock("span",Je,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${o}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Ye,[t[14]||(t[14]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind speed"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windSpeed,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",Qe,[t[15]||(t[15]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind gust"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windGust,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))])]),t[27]||(t[27]=e.createElementVNode("div",{style:{"text-align":"center",padding:"3px"}},null,-1)),e.createElementVNode("table",Ke,[e.createElementVNode("tr",Xe,[t[16]||(t[16]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwaveHeight,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",Ue,[t[17]||(t[17]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwaveDir,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},[isNaN(o)?(e.openBlock(),e.createElementBlock("span",$e,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${o}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",et,[t[18]||(t[18]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave period"),e.createElementVNode("span",{class:"unit"},"s")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwavePeriod,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",tt,[t[19]||(t[19]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellHeight,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",st,[t[20]||(t[20]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellDir,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},[isNaN(o)?(e.openBlock(),e.createElementBlock("span",at,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${o}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",ot,[t[21]||(t[21]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell period"),e.createElementVNode("span",{class:"unit"},"s")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellPeriod,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",nt,[t[22]||(t[22]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sig wave height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.sigwaveHeight,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",it,[t[23]||(t[23]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Current direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.currentDir,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},[isNaN(o)?(e.openBlock(),e.createElementBlock("span",rt,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${o}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",lt,[t[24]||(t[24]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Current speed"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.currentSpeed,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))])]),t[28]||(t[28]=e.createElementVNode("div",{style:{"text-align":"center",padding:"3px"}},null,-1)),e.createElementVNode("table",ct,[e.createElementVNode("tr",dt,[t[25]||(t[25]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sea level height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.seaLevel,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",ht,[t[26]||(t[26]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sea surface temperature"),e.createElementVNode("span",{class:"unit"},"°C")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.seaTemp,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))])])])):a.loading?(e.openBlock(),e.createElementBlock("div",mt,"Loading....")):(V=a.position)!=null&&V.name?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",pt,"No Data"))])])}const he=ye(fe,[["render",gt],["__scopeId","data-v-299b53fa"]]),wt={install(n){n.component("SpotReport",he)}};k.SpotReport=he,k.SpotReportPlugin=wt,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(k,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("moment"),require("moment-timezone"),require("@element-plus/icons-vue"),require("@idm-plugin/geo"),require("echarts"),require("vue"),require("axios")):typeof define=="function"&&define.amd?define(["exports","moment","moment-timezone","@element-plus/icons-vue","@idm-plugin/geo","echarts","vue","axios"],f):(k=typeof globalThis<"u"?globalThis:k||self,f(k["idmui-spot"]={},k.moment,k["moment-timezone"],k["@element-plus/icons-vue"],k["@idm-plugin/geo"],k.echarts,k.Vue,k.axios))})(this,function(k,f,J,ue,ne,xe,e,le){"use strict";function ke(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const s in n)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(n,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:()=>n[s]})}}return t.default=n,Object.freeze(t)}const ce=ke(xe);class de{static pickHourly(t,s){var r,a,p,E,D,y,_,z,N,B,V,o,i,Z,x,C,I,M,P,T,H,F,W,R,A,O,G,v,g,u,d,b,S,w,q,Q,X,te,ee,L,K,h,U,m,se,ae,oe,me;const pe=typeof s=="string"?f(s):s,Y=t==null?void 0:t.weather,ge=t==null?void 0:t.marine,we=f((a=(r=Y==null?void 0:Y[0])==null?void 0:r.hourly)==null?void 0:a.date).utc(),ie=we.clone().add((D=(E=(p=Y==null?void 0:Y[0])==null?void 0:p.hourly)==null?void 0:E.time)==null?void 0:D.at(0),"h"),bt=we.clone().add((z=(_=(y=Y==null?void 0:Y[0])==null?void 0:y.hourly)==null?void 0:_.time)==null?void 0:z.at(-1),"h"),be=[];if(pe.isBetween(ie,bt,"millisecond","[]")){const l=pe.utc().diff(ie,"h",!1);let j,$;if(Y)for(const re of Y){const c=re.hourly;j={temp:(N=c.temperature_2m)==null?void 0:N.at(l),apparentTemp:(B=c.apparent_temperature)==null?void 0:B.at(l),rh:(V=c.relative_humidity_2m)==null?void 0:V.at(l),dp:(o=c.dew_point_2m)==null?void 0:o.at(l),precip:{probability:(i=c.precipitation_probability)==null?void 0:i.at(l),sum:(Z=c.precipitation)==null?void 0:Z.at(l)},pmsl:(x=c.pressure_msl)==null?void 0:x.at(l),psurf:(C=c.surface_pressure)==null?void 0:C.at(l),code:(I=c.weather_code)==null?void 0:I.at(l),visibility:this.m2nm((M=c.visibility)==null?void 0:M.at(l)),wind:{speed:(P=c.wind_speed_10m)==null?void 0:P.at(l),kts:(T=c.wind_speed_10m)==null?void 0:T.at(l),degree:(H=c.wind_direction_10m)==null?void 0:H.at(l),bearing:((F=c.wind_direction_10m)==null?void 0:F.at(l))!==null?(((W=c.wind_direction_10m)==null?void 0:W.at(l))+180)%360:null,gusts:(R=c.wind_gusts_10m)==null?void 0:R.at(l)},isDay:(A=c.is_day)==null?void 0:A.at(l)};const{name:ut,url:xt,bg:kt}=this.parseWeatherCode(j.code,j.isDay);j.name=ut,j.url=xt,j.bg=kt,j.wind.scale=this.beaufort(this.kts2ms(j.wind.kts)),j.wind.direction=this.degree2Direction(j.wind.degree)}if(ge)for(const re of ge){const c=re.hourly;$={wave:{sig:{height:(O=c.wave_height)==null?void 0:O.at(l),degree:(G=c.wave_direction)==null?void 0:G.at(l),bearing:((v=c.wave_direction)==null?void 0:v.at(l))!==null?(((g=c.wave_direction)==null?void 0:g.at(l))+180)%360:null,period:(u=c.wave_period)==null?void 0:u.at(l)},swell:{height:(d=c.swell_wave_height)==null?void 0:d.at(l),degree:(b=c.swell_wave_direction)==null?void 0:b.at(l),bearing:((S=c.swell_wave_direction)==null?void 0:S.at(l))!==null?(((w=c.swell_wave_direction)==null?void 0:w.at(l))+180)%360:null,period:(q=c.swell_wave_period)==null?void 0:q.at(l),peakPeriod:(Q=c.swell_wave_peak_period)==null?void 0:Q.at(l)},wd:{height:(X=c.wind_wave_height)==null?void 0:X.at(l),degree:(te=c.wind_wave_direction)==null?void 0:te.at(l),bearing:((ee=c.wind_wave_direction)==null?void 0:ee.at(l))!==null?(((L=c.wind_wave_direction)==null?void 0:L.at(l))+180)%360:null,period:(K=c.wind_wave_period)==null?void 0:K.at(l),peakPeriod:(h=c.wind_wave_peak_period)==null?void 0:h.at(l)}},current:{speed:(U=c.ocean_current_velocity)==null?void 0:U.at(l),kts:(m=c.ocean_current_velocity)==null?void 0:m.at(l),degree:(se=c.ocean_current_direction)==null?void 0:se.at(l),bearing:((ae=c.ocean_current_direction)==null?void 0:ae.at(l))??null},sst:(oe=c.sea_surface_temperature)==null?void 0:oe.at(l),height:(me=c.sea_level_height_msl)==null?void 0:me.at(l)},$.wave=this.parseWave($.wave),$.current.direction=this.degree2Direction($.current.degree)}be.push({utc:ie.add(l,"h").format(),weather:{...j},...$})}return be}static toLegacy(t){return{wind:t.weather.wind,visibility:t.weather.visibility,temp:t.weather.temp,prmsl:t.weather.pmsl,gusts:{kts:t.weather.wind.gusts},precip:t.weather.precip,code:t.weather.code,name:t.weather.name,url:t.weather.url,wave:t.wave,current:t.current,sst:t.sst,height:t.height,utc:t.utc}}static pickDaily(t,s){var r,a,p,E,D,y,_,z,N,B,V,o,i,Z,x,C,I,M,P,T,H,F,W,R,A,O,G,v,g,u,d,b,S;const w=typeof s=="string"?f(s):s,q=t==null?void 0:t.weather,Q=t==null?void 0:t.marine,X=f((p=(a=(r=q==null?void 0:q[0])==null?void 0:r.daily)==null?void 0:a.time)==null?void 0:p.at(0)),te=f((y=(D=(E=q==null?void 0:q[0])==null?void 0:E.daily)==null?void 0:D.time)==null?void 0:y.at(-1)),ee=[];if(w.isBetween(X,te,"millisecond","[]")){let L,K;const h=w.diff(X,"d",!1);if(q)for(const U of q){const m=U.daily;L={code:(_=m.weather_code)==null?void 0:_.at(h),temp:{max:(z=m.temperature_2m_max)==null?void 0:z.at(h),min:(N=m.temperature_2m_min)==null?void 0:N.at(h),mean:(B=m.temperature_2m_mean)==null?void 0:B.at(h)},apparentTemp:{max:(V=m.apparent_temperature_max)==null?void 0:V.at(h),min:(o=m.apparent_temperature_min)==null?void 0:o.at(h)},precip:{sum:(i=m.precipitation_sum)==null?void 0:i.at(h),hours:(Z=m.precipitation_hours)==null?void 0:Z.at(h),probability:(x=m.precipitation_probability_max)==null?void 0:x.at(h)},rh:{max:(C=m.relative_humidity_2m_max)==null?void 0:C.at(h),min:(I=m.relative_humidity_2m_min)==null?void 0:I.at(h),mean:(M=m.relative_humidity_2m_mean)==null?void 0:M.at(h)},wind:{speed:(P=m.wind_speed_10m_max)==null?void 0:P.at(h),kts:(T=m.wind_speed_10m_max)==null?void 0:T.at(h),degree:(H=m.wind_direction_10m_dominant)==null?void 0:H.at(h),gusts:(F=m.wind_gusts_10m_max)==null?void 0:F.at(h)}};const{name:se,url:ae,bg:oe}=this.parseWeatherCode(L.code,!0);L.name=se,L.url=ae,L.bg=oe,L.wind.scale=this.beaufort(this.kts2ms(L.wind.kts)),L.wind.direction=this.degree2Direction(L.wind.degree)}if(Q)for(const U of Q){const m=U.daily;K={wave:{sig:{height:(W=m.wave_height_max)==null?void 0:W.at(h),degree:(R=m.wave_direction_dominant)==null?void 0:R.at(h),period:(A=m.wave_period_max)==null?void 0:A.at(h)},swell:{height:(O=m.swell_wave_height_max)==null?void 0:O.at(h),degree:(G=m.wave_direction_dominant)==null?void 0:G.at(h),period:(v=m.swell_wave_period_max)==null?void 0:v.at(h),peakPeriod:(g=m.swell_wave_peak_period_max)==null?void 0:g.at(h)},wd:{height:(u=m.wind_wave_height_max)==null?void 0:u.at(h),degree:(d=m.wind_wave_direction_dominant)==null?void 0:d.at(h),period:(b=m.wind_wave_period_max)==null?void 0:b.at(h),peakPeriod:(S=m.wind_wave_peak_period_max)==null?void 0:S.at(h)}}},K.wave=this.parseWave(K.wave)}ee.push({utc:X.add(h,"d").utc().format(),weather:{...L},...K})}return ee}static parseWave(t){return t.sig.direction=this.degree2Direction(t.sig.degree),t.swell.direction=this.degree2Direction(t.swell.degree),t.wd.direction=this.degree2Direction(t.wd.degree),t.sig.scale=this.douglas(t.sig.height),t.swell.scale=this.douglas(t.swell.height),t.wd.scale=this.douglas(t.wd.height),t}static parseWeatherCode(t,s){const r=this.weatherCode(t);return(s?r.day:r.night)||{}}static weatherCode(t){const s={code:t};switch(t){case 0:s.day={name:"Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"},s.night={name:"Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"};break;case 1:s.day={name:"Mainly Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"},s.night={name:"Mainly Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"};break;case 2:s.day={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg2.png"},s.night={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg2.png"};break;case 3:s.day={name:"Overcast",url:"https://osshz.idmwx.com/asset/weather/04d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg3.png"},s.night={name:"Overcast",url:"https://osshz.idmwx.com/asset/weather/04n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg3.png"};break;case 45:s.day={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"},s.night={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"};break;case 48:s.day={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"},s.night={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"};break;case 51:s.day={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 53:s.day={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 55:s.day={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/15d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/15n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 56:s.day={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 57:s.day={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 61:s.day={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 63:s.day={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 65:s.day={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 66:s.day={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 67:s.day={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 71:s.day={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},s.night={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 73:s.day={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},s.night={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 75:s.day={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},s.night={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 77:s.day={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},s.night={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 80:s.day={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 81:s.day={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 82:s.day={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 85:s.day={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},s.night={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 86:s.day={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},s.night={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 95:s.day={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 96:s.day={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 99:s.day={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},s.night={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break}return s}static kts2ms(t){return isNaN(t)||t===null?t:Math.round(t*1852/3600*1e4)/1e4}static kts2kmh(t){return isNaN(t)||t===null?t:t*1.852}static m2nm(t){return isNaN(t)||t===null?t:Math.round(t/1e3/1.852*1e4)/1e4}static kmh2kts(t){return isNaN(t)||t===null?t:this.ms2kts(t*1e3/3600)}static ms2kts(t){return isNaN(t)||t===null?t:Math.round(t*3600/1852*1e4)/1e4}static degree2Radian(t){if(isNaN(t)||t===null)return t;let s=t%360/360*2*Math.PI;return s=s<0?s+2*Math.PI:s,s}static degree2Direction(t){const s=this.degree2Radian(t);if(isNaN(s)||s===null)return null;let r="N/A";const a=Math.PI/16;return s<a?r="N":s>=a&&s<3*a?r="NNE":s>=3*a&&s<5*a?r="NE":s>=5*a&&s<7*a?r="ENE":s>=7*a&&s<9*a?r="E":s>=9*a&&s<11*a?r="ESE":s>=11*a&&s<13*a?r="SE":s>=13*a&&s<15*a?r="SSE":s>=15*a&&s<17*a?r="S":s>=17*a&&s<19*a?r="SSW":s>=19*a&&s<21*a?r="SW":s>=21*a&&s<23*a?r="WSW":s>=23*a&&s<25*a?r="W":s>=25*a&&s<27*a?r="WNW":s>=27*a&&s<29*a?r="NW":s>=29*a&&s<31*a?r="NNW":s>=31*a&&s<32*a&&(r="N"),r}static beaufort(t){let s=0;return isNaN(t)||(t=Math.round(t*10)/10,t<=.2?s=0:t<=1.5?s=1:t<=3.3?s=2:t<=5.4?s=3:t<=7.9?s=4:t<=10.7?s=5:t<=13.8?s=6:t<=17.1?s=7:t<=20.7?s=8:t<=22.4?s=9:t<=28.4?s=10:t<=32.6?s=11:t>32.6&&(s=12)),s}static douglas(t){let s="Calm";return isNaN(t)||t<=.1?s="Calm":t<=.5?s="Smooth":t<=1.25?s="Slight":t<=2.5?s="Moderate":t<=4?s="Rough":t<=6?s="VeryRough":t<=9?s="High":t<=14?s="VeryHigh":s="Precipitous",s}}const ft="",fe=(n,t)=>{const s=n.__vccOpts||n;for(const[r,a]of t)s[r]=a;return s},ye={name:"SpotReport",props:{token:{type:String,default:""},ts:{type:String,default:f().utc().format()},timeZone:{type:Number,default:8},report:{type:Object,default:()=>({})}},emits:["url"],data(){return{placeholder:"search for port name or coordinates",searchName:void 0,rawSearchIcon:e.markRaw(ue.Search),positionOffset:void 0,positionGmt:void 0,issuedDate:void 0,meteoData:{},a:void 0,positionList:[],position:void 0,loading:!0,activeIndex:void 0,tableData:{},pickedDate:void 0,pickedWeek:"Today",collectList:[],isCollected:!1}},computed:{computeHourL(){return function(n){return n?`${J(n).tz(this.positionGmt).format("HH")}`:"-"}},computeHourZ(){return function(n){return n?`${f(n).utc().format("HH")}Z`:"-"}},computeWeek(){return function(n){return n?`${J(n).tz(this.positionGmt).format("dddd")}`:"-"}},computeMMMDD(){return function(n){return n?`${J(n).tz(this.positionGmt).format("MMM-DD")}`:"-"}},computeLat(){return function(n,t=4){return ne.LngLatHelper.lat2pretty(n,t).pretty}},computeLng(){return function(n,t=4){return ne.LngLatHelper.lng2pretty(n,t).pretty}},roundPrecision(){return function(n,t=4){return isNaN(n)?"-":ne.LngLatHelper.roundPrecision(n,t)}}},watch:{"report.version":{handler(){var n,t,s;this.report&&(this.meteoData=this.report,this.position={id:this.report.portId,lat:(n=this.report)==null?void 0:n.lat,lng:(t=this.report)==null?void 0:t.lng,name:((s=this.report)==null?void 0:s.searchName)||this.computeLat(this.report.lat)+","+this.computeLng(this.report.lng)},this.handleRender())}}},methods:{handleRender(){this.initInfo(),this.initTableData(),this.$nextTick(()=>{this.initEchart()})},initInfo(){var n,t,s,r;this.loading=!1,this.positionGmt=(t=(n=this.meteoData.weather)==null?void 0:n[0])==null?void 0:t.timezone,this.positionOffset=(r=(s=this.meteoData.weather)==null?void 0:s[0])==null?void 0:r.offset,this.issuedDate=f(this.ts).utc().format("MMM-DD/HHmm[Z], YYYY"),this.activeIndex=J(this.ts).tz(this.positionGmt).hour(),this.pickedDate=J(this.ts).tz(this.positionGmt).set({hour:0,minute:0,second:0,millisecond:0}).format(),this.collectList=JSON.parse(localStorage.getItem("idmCollectList")||"[]"),this.positionList=JSON.parse(JSON.stringify(this.collectList)),this.isCollected=this.collectList.some(a=>{var p;return a.name===((p=this.position)==null?void 0:p.name)})},initTableData(){var n,t,s,r,a,p,E,D,y,_,z,N,B,V,o,i,Z,x,C,I,M,P,T,H,F,W,R,A,O,G,v,g,u,d;this.tableData={hours:[],utcHours:[],weatherUrls:[],weatherNames:[],temp:[],precipProbability:[],precip1h:[],visibility:[],humidity:[],windSpeed:[],windDir:[],windGust:[],sigwaveHeight:[],sigwaveDir:[],windwaveHeight:[],windwaveDir:[],windwavePeriod:[],swellHeight:[],swellDir:[],swellPeriod:[],currentSpeed:[],currentDir:[],seaLevel:[],seaTemp:[]};for(let b=0;b<24;b++){const S=f(this.pickedDate).clone().add(b,"h").format();this.tableData.hours.push(S);const w=((n=de.pickHourly(this.meteoData,S))==null?void 0:n[0])||{};this.tableData.weatherUrls.push((t=w.weather)==null?void 0:t.url),this.tableData.weatherNames.push(((s=w.weather)==null?void 0:s.name)??"-"),this.tableData.temp.push(this.roundPrecision((r=w.weather)==null?void 0:r.temp,0)??"-"),this.tableData.precipProbability.push(this.roundPrecision((p=(a=w.weather)==null?void 0:a.precip)==null?void 0:p.probability,0)??"-"),this.tableData.precip1h.push(this.roundPrecision((D=(E=w.weather)==null?void 0:E.precip)==null?void 0:D.sum,0)??"-"),this.tableData.visibility.push(this.roundPrecision((y=w.weather)==null?void 0:y.visibility,0)??"-"),this.tableData.humidity.push(this.roundPrecision((_=w.weather)==null?void 0:_.rh,0)??"-"),this.tableData.windSpeed.push(this.roundPrecision((N=(z=w.weather)==null?void 0:z.wind)==null?void 0:N.kts,1)),this.tableData.windDir.push((V=(B=w.weather)==null?void 0:B.wind)==null?void 0:V.bearing),this.tableData.windGust.push(this.roundPrecision((i=(o=w.weather)==null?void 0:o.wind)==null?void 0:i.gusts,1)??"-"),this.tableData.sigwaveHeight.push(this.roundPrecision((x=(Z=w.wave)==null?void 0:Z.sig)==null?void 0:x.height,1)??"-"),this.tableData.sigwaveDir.push((I=(C=w.wave)==null?void 0:C.sig)==null?void 0:I.bearing),this.tableData.windwaveHeight.push(this.roundPrecision((P=(M=w.wave)==null?void 0:M.wd)==null?void 0:P.height,1)??"-"),this.tableData.windwaveDir.push((H=(T=w.wave)==null?void 0:T.wd)==null?void 0:H.bearing),this.tableData.windwavePeriod.push(this.roundPrecision((W=(F=w.wave)==null?void 0:F.wd)==null?void 0:W.period,1)??"-"),this.tableData.swellHeight.push(this.roundPrecision((A=(R=w.wave)==null?void 0:R.swell)==null?void 0:A.height,1)??"-"),this.tableData.swellDir.push((G=(O=w.wave)==null?void 0:O.swell)==null?void 0:G.bearing),this.tableData.swellPeriod.push(this.roundPrecision((g=(v=w.wave)==null?void 0:v.swell)==null?void 0:g.period,1)??"-"),this.tableData.currentSpeed.push(this.roundPrecision((u=w.current)==null?void 0:u.speed,1)??"-"),this.tableData.currentDir.push((d=w.current)==null?void 0:d.bearing),this.tableData.seaLevel.push(this.roundPrecision(w.height,1)??"-"),this.tableData.seaTemp.push(this.roundPrecision(w.sst,0)??"-")}},initEchart(){var C,I,M,P,T,H,F,W,R,A,O,G,v;const n=[],t=[],s=[],r=[],a=[],p=[],E=[],D=[],y=[],_=[],z={};for(let g=0;g<7;g++){const u=f(this.pickedDate).clone().add(g,"d");n.push(J(u).tz(this.positionGmt).format("yyyy-MM-DD")),t.push(this.computeMMMDD(u)),s.push(g===0?"Today":this.computeWeek(u));const d=((C=de.pickDaily(this.meteoData,u))==null?void 0:C[0])||{};r.push(this.roundPrecision((M=(I=d.weather)==null?void 0:I.temp)==null?void 0:M.min,0)),a.push(this.roundPrecision((T=(P=d.weather)==null?void 0:P.temp)==null?void 0:T.max,0)),D.push(this.roundPrecision((F=(H=d.weather)==null?void 0:H.wind)==null?void 0:F.kts,1)??"- kts"),_.push(this.roundPrecision((R=(W=d.weather)==null?void 0:W.precip)==null?void 0:R.sum,0)??"- mm"),p.push({symbol:"image://"+((A=d.weather)==null?void 0:A.url)}),E.push((O=d.weather)==null?void 0:O.name),y.push((v=(G=d.weather)==null?void 0:G.wind)==null?void 0:v.degree)}const N=Math.max(...a.filter(g=>typeof g=="number"&&!isNaN(g)))-Math.min(...r.filter(g=>typeof g=="number"&&!isNaN(g))),B=Math.min(...r.filter(g=>typeof g=="number"&&!isNaN(g)))-1.5*N,V=Math.max(...a.filter(g=>typeof g=="number"&&!isNaN(g)))+2*N,o=4+.5/n.length*92+"%",i="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent('<svg t="1740385441519" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10951" width="200" height="200"><path d="M512 804.83593751A276.87183211 276.87183211 0 0 1 235.12816789 527.9641054Q235.12816789 375.21005376 512 13.82031251q276.87183211 361.30792288 276.87183211 514.14379289a276.87183211 276.87183211 0 0 1-276.87183211 276.87183211zM294.4461577 527.9641054a217.47202472 217.47202472 0 0 0 217.5538423 217.55384231 19.79993605 19.79993605 0 1 0 0-39.51805453 177.9539702 177.9539702 0 0 1-177.9539702-178.03578778 19.79993605 19.79993605 0 0 0-39.5998721 0z" fill="#0c73a8" p-id="10952"></path></svg>'))),Z="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent('<svg t="1740383449285" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10797" width="200" height="200"><path d="M133.8 579l-44.4-44.4c-18.8-18.8-18.8-49.2 0-67.8L478 78c18.8-18.8 49.2-18.8 67.8 0l388.6 388.6c18.8 18.8 18.8 49.2 0 67.8L890 578.8c-19 19-50 18.6-68.6-0.8L592 337.2V912c0 26.6-21.4 48-48 48h-64c-26.6 0-48-21.4-48-48V337.2L202.4 578.2c-18.6 19.6-49.6 20-68.6 0.8z" fill="#ffffff" p-id="10798"></path></svg>'))),x=new Image(64,64);x.src=Z,x.onload=()=>{for(let d=0;d<7;d++){const b=document.createElement("canvas"),S=b.getContext("2d");b.width=x.width,b.height=x.height;const q=y[d]*(Math.PI/180);S.translate(b.width/2,b.height/2),S.rotate(q),S.translate(-x.width/2,-x.height/2),S.drawImage(x,0,0,64,64);const Q=b.toDataURL();z[`WindIcon${d}`]={height:12,width:12,align:"left",backgroundColor:{image:Q}}}const g=ce.init(document.getElementById("weather-chart")),u={grid:{bottom:0,top:0,left:"4%",right:"4%"},tooltip:{trigger:"item",show:!0,position:"right",formatter:function(d){return d.seriesName==="Weather Icon"?E[d.dataIndex]:!1}},legend:{show:!1},xAxis:{left:0,right:0,top:"50%",height:"50%",type:"category",data:n,show:!1},singleAxis:[{left:o,right:o,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:n,top:"7%",height:"2%"},{left:o,right:o,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:n,top:"16%",height:"2%"},{left:o,right:o,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:n,top:"27%",height:"2%"},{left:o,right:o,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:n,top:"84%",height:"2%"},{left:o,right:o,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:n,top:"93%",height:"2%"}],yAxis:{type:"value",name:"温度(℃)",show:!1,min:B,max:V,axisLabel:{formatter:"{value} °C"}},series:[{singleAxisIndex:0,coordinateSystem:"singleAxis",type:"scatter",data:s,label:{show:!0,color:"#fff",fontSize:14,formatter:"{c}"},symbolSize:0},{singleAxisIndex:1,coordinateSystem:"singleAxis",type:"scatter",data:t,label:{show:!0,color:"#fff",formatter:"{c}"},symbolSize:0},{name:"Weather Icon",singleAxisIndex:2,coordinateSystem:"singleAxis",type:"scatter",data:p,symbolSize:36},{name:"温度(℃)",type:"line",data:r,smooth:!0,itemStyle:{color:"rgba(255,255,255,0.7)"},label:{show:!0,color:"rgba(255,255,255,1)",position:[-10,12],formatter:"{c} °C",fontSize:12},markArea:{itemStyle:{color:"rgb(71,143,206)"},data:[[{x:"4%"},{x:4+1/n.length*92+"%"}]]}},{name:"温度(℃)",type:"line",data:a,smooth:!0,itemStyle:{color:"rgba(255,255,255,0.7)"},label:{show:!0,color:"rgba(255,255,255,1)",position:[-10,-12],formatter:"{c} °C",fontSize:12}},{singleAxisIndex:3,coordinateSystem:"singleAxis",type:"scatter",data:D,label:{show:!0,color:"#fff",rich:{...z,title:{align:"center",vertical:"center"}},formatter:function(d){return`{WindIcon${d.dataIndex}|}{title|${d.value}} kts`}},symbolSize:0},{singleAxisIndex:4,coordinateSystem:"singleAxis",type:"scatter",data:_,label:{show:!0,color:"#fff",rich:{dIcon:{height:16,width:16,align:"left",backgroundColor:{image:i}},title:{align:"center",vertical:"center"}},formatter:function(d){return`{dIcon|}{title|${d.value}} mm`}},symbolSize:0}]};g.setOption(u),g.on("click",d=>{const b=d.dataIndex;this.pickedDate=J(n[b]).tz(this.positionGmt).set({hour:0,minute:0,second:0,millisecond:0}).format(),this.pickedWeek=b===0?"Today":this.computeWeek(this.pickedDate),this.activeIndex=b===0?J(this.ts).tz(this.positionGmt).hour():void 0,this.initTableData(),u.series[3].markArea={itemStyle:{color:"rgb(71,143,206)"},data:[[{x:4+b/n.length*92+"%"},{x:4+(b+1)/n.length*92+"%"}]]},g.setOption(u)})}},handleCollect(){this.isCollected=!this.isCollected,this.isCollected?this.collectList.push({name:this.position.name,lat:this.position.lat,lng:this.position.lng}):this.collectList=this.collectList.filter(n=>n.name!==this.position.name),localStorage.setItem("idmCollectList",JSON.stringify(this.collectList))},async fetchSuggestPosition(n){var r;const t=n.replaceAll(",",",");if(!t)return this.positionList=this.collectList,!1;const s=await le.get(`https://cbe.idmwx.com/api/arc/ports/suggest?n=${t}`,{headers:{Authorization:this.token}});(s==null?void 0:s.data.code)===0&&(this.positionList=(r=s==null?void 0:s.data.data)==null?void 0:r.map(a=>(a.name=a.id?a.name:this.computeLat(a.lat)+", "+this.computeLng(a.lng),a)))},async handleFetchMeteo(){var s,r,a;if(!this.searchName)return!1;this.position={portId:(s=this.positionList.find(p=>p.name===this.searchName))==null?void 0:s.id,lat:(r=this.positionList.find(p=>p.name===this.searchName))==null?void 0:r.lat,lng:(a=this.positionList.find(p=>p.name===this.searchName))==null?void 0:a.lng,name:this.searchName},this.$emit("url",this.position),this.handleClear();const n={lat:this.position.lat,lng:this.position.lng,forecastDays:8,selfHosted:!1},t=await le.post("https://cbe.idmwx.com/api/arc/meteo2/spot/forecast",n,{headers:{Authorization:this.token}});(t==null?void 0:t.data.code)===0&&(this.meteoData={...t==null?void 0:t.data.data}),this.handleRender()},handleClear(){this.loading=!0,this.meteoData={},this.isCollected=!1,ce.dispose(document.getElementById("weather-chart"))}}},_e={class:"spot-report"},ze={class:"header-box flex-between"},Ne={class:"bg"},Ee={class:"search-box flex-start"},De={class:"content-box"},Be={class:"title-box flex-between"},Ve={class:"main-title"},Se={class:"sub-title"},Le={class:"flex-end"},Ce={key:0,id:"weather-chart"},Ie={key:1,class:"weather-chart flex-center"},Me={key:2,class:"weather-chart flex-center"},Pe={key:3,class:"card-box"},Te={class:"date"},He={class:"basic-table"},Fe={class:"day"},We={class:"hour"},Re={class:"icon"},Ae=["src"],Oe={class:"text"},Ge={class:"text"},ve={class:"text"},qe={class:"text"},je={class:"text"},Ze={class:"text"},Je={key:1},Ye={class:"text"},Qe={class:"text"},Ke={class:"wave-current-table"},Xe={class:"text"},Ue={class:"text"},$e={key:1},et={class:"text"},tt={class:"text"},st={class:"text"},at={key:1},ot={class:"text"},nt={class:"text"},it={class:"text"},rt={key:1},lt={class:"text"},ct={class:"sea-table"},dt={class:"text"},ht={class:"text"},mt={key:4,class:"card-box flex-center"},pt={key:5,class:"card-box flex-center"};function gt(n,t,s,r,a,p){var _,z,N,B,V;const E=e.resolveComponent("ElOption"),D=e.resolveComponent("ElSelect"),y=e.resolveComponent("ElTooltip");return e.openBlock(),e.createElementBlock("div",_e,[e.createElementVNode("div",ze,[e.createElementVNode("div",Ne,[e.createElementVNode("div",Ee,[e.createVNode(D,{modelValue:a.searchName,"onUpdate:modelValue":t[0]||(t[0]=o=>a.searchName=o),filterable:"",class:"input",clearable:"",remote:"",placeholder:a.placeholder,autocomplete:"","remote-show-suffix":"",onFocus:t[1]||(t[1]=o=>a.placeholder=""),onBlur:t[2]||(t[2]=o=>a.placeholder="search for port name or coordinates"),"remote-method":p.fetchSuggestPosition,onChange:p.handleFetchMeteo},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.positionList,o=>(e.openBlock(),e.createBlock(E,{key:o.name,label:o.name,value:o.name},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","remote-method","onChange"])])])]),e.createElementVNode("div",De,[e.createElementVNode("div",Be,[e.createElementVNode("div",null,[e.createElementVNode("div",Ve,"Weather forecast for "+e.toDisplayString(((_=a.position)==null?void 0:_.name)||"-")+" ( "+e.toDisplayString(a.positionOffset)+" )",1),e.createElementVNode("div",Se,"At "+e.toDisplayString((z=a.position)!=null&&z.portId?"port":"coordinates")+", issued "+e.toDisplayString(a.issuedDate),1)]),e.createElementVNode("div",Le,[e.createVNode(y,{placement:"left",effect:"light",content:a.isCollected?"remove the port/coordinate from the search list":"add the port/coordinate to the search list","show-after":1e3},{default:e.withCtx(()=>[a.isCollected?(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon active",onClick:t[3]||(t[3]=(...o)=>p.handleCollect&&p.handleCollect(...o))},"")):(e.openBlock(),e.createElementBlock("span",{key:1,class:"iconfont icon",onClick:t[4]||(t[4]=(...o)=>p.handleCollect&&p.handleCollect(...o))},""))]),_:1},8,["content"])])]),(N=a.position)!=null&&N.name&&!a.loading?(e.openBlock(),e.createElementBlock("div",Ce)):a.loading?(e.openBlock(),e.createElementBlock("div",Ie,"Loading....")):a.position.name?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Me,"No Data")),(B=a.position)!=null&&B.name&&!a.loading?(e.openBlock(),e.createElementBlock("div",Pe,[e.createElementVNode("div",Te,e.toDisplayString(a.pickedWeek)+" "+e.toDisplayString(p.computeMMMDD(a.pickedDate)),1),e.createElementVNode("table",He,[e.createElementVNode("tr",Fe,[t[5]||(t[5]=e.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Local time"),e.createElementVNode("span",{class:"unit"},"(LT)")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.hours,(o,i)=>(e.openBlock(),e.createElementBlock("th",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"local"},e.toDisplayString(p.computeHourL(o)),3))),128))]),e.createElementVNode("tr",We,[t[6]||(t[6]=e.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("UTC"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.hours,(o,i)=>(e.openBlock(),e.createElementBlock("th",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"z"},e.toDisplayString(p.computeHourZ(o)),3))),128))]),e.createElementVNode("tr",Re,[t[7]||(t[7]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Weather"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.weatherUrls,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"url"},[e.createVNode(y,{placement:"top",effect:"light",content:a.tableData.weatherNames[i],"show-after":500},{default:e.withCtx(()=>[o?(e.openBlock(),e.createElementBlock("img",{key:0,class:"iconfont weather-icon",src:o},null,8,Ae)):e.createCommentVNode("",!0)]),_:2},1032,["content"])],2))),128))]),e.createElementVNode("tr",Oe,[t[8]||(t[8]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Temperature"),e.createElementVNode("span",{class:"unit"},"°C")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.temp,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",Ge,[t[9]||(t[9]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Precipitation Probability"),e.createElementVNode("span",{class:"unit"},"%")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.precipProbability,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",ve,[t[10]||(t[10]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Precipitation 1h"),e.createElementVNode("span",{class:"unit"},"mm")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.precip1h,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",qe,[t[11]||(t[11]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Visibility"),e.createElementVNode("span",{class:"unit"},"nm")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.visibility,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",je,[t[12]||(t[12]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Relative Humidity"),e.createElementVNode("span",{class:"unit"},"%")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.humidity,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",Ze,[t[13]||(t[13]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windDir,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},[isNaN(o)?(e.openBlock(),e.createElementBlock("span",Je,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${o}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Ye,[t[14]||(t[14]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind speed"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windSpeed,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",Qe,[t[15]||(t[15]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind gust"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windGust,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))])]),t[27]||(t[27]=e.createElementVNode("div",{style:{"text-align":"center",padding:"3px"}},null,-1)),e.createElementVNode("table",Ke,[e.createElementVNode("tr",Xe,[t[16]||(t[16]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwaveHeight,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",Ue,[t[17]||(t[17]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwaveDir,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},[isNaN(o)?(e.openBlock(),e.createElementBlock("span",$e,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${o}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",et,[t[18]||(t[18]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave period"),e.createElementVNode("span",{class:"unit"},"s")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwavePeriod,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",tt,[t[19]||(t[19]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellHeight,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",st,[t[20]||(t[20]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellDir,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},[isNaN(o)?(e.openBlock(),e.createElementBlock("span",at,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${o}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",ot,[t[21]||(t[21]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell period"),e.createElementVNode("span",{class:"unit"},"s")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellPeriod,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",nt,[t[22]||(t[22]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sig wave height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.sigwaveHeight,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",it,[t[23]||(t[23]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Current direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.currentDir,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},[isNaN(o)?(e.openBlock(),e.createElementBlock("span",rt,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${o}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",lt,[t[24]||(t[24]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Current speed"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.currentSpeed,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))])]),t[28]||(t[28]=e.createElementVNode("div",{style:{"text-align":"center",padding:"3px"}},null,-1)),e.createElementVNode("table",ct,[e.createElementVNode("tr",dt,[t[25]||(t[25]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sea level height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.seaLevel,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",ht,[t[26]||(t[26]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sea surface temperature"),e.createElementVNode("span",{class:"unit"},"°C")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.seaTemp,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))])])])):a.loading?(e.openBlock(),e.createElementBlock("div",mt,"Loading....")):(V=a.position)!=null&&V.name?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",pt,"No Data"))])])}const he=fe(ye,[["render",gt],["__scopeId","data-v-3ab7a0ef"]]),wt={install(n){n.component("SpotReport",he)}};k.SpotReport=he,k.SpotReportPlugin=wt,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@page{size:1200px;margin:20px auto 40px}.spot-report[data-v-
|
|
1
|
+
@page{size:1200px;margin:20px auto 40px}.spot-report[data-v-3ab7a0ef]{height:100%;width:1160px;margin:0 auto;padding:0;display:flex;flex-direction:column;color:var(--idm-black-8)}.spot-report .header-box[data-v-3ab7a0ef]{width:100%;padding:10px 0}.spot-report .header-box .search-box .input[data-v-3ab7a0ef]{width:300px}.spot-report .header-box .search-box .info[data-v-3ab7a0ef]{margin:0 10px;color:var(--idm-info-color);font-size:12px}.spot-report .content-box[data-v-3ab7a0ef]{flex:1;width:100%;box-sizing:border-box}.spot-report .content-box .title-box .main-title[data-v-3ab7a0ef]{font-size:16px;font-weight:700}.spot-report .content-box .title-box .sub-title[data-v-3ab7a0ef]{font-size:13px;padding:2px 0}.spot-report .content-box .title-box .icon[data-v-3ab7a0ef]{cursor:pointer;margin-left:10px;font-size:16px}.spot-report .content-box .title-box .icon[data-v-3ab7a0ef]:hover{color:var(--idm-primary-color)}.spot-report .content-box .title-box .icon.active[data-v-3ab7a0ef]{color:var(--idm-warning-color)}.spot-report .content-box #weather-chart[data-v-3ab7a0ef],.spot-report .content-box .weather-chart[data-v-3ab7a0ef]{height:225px;width:100%;font-size:14px;color:#fff;border:1px solid var(--idm-gray-light);border-radius:5px;box-sizing:border-box;background:rgb(104,184,251)}.spot-report .content-box .card-box[data-v-3ab7a0ef]{min-height:500px;margin:5px 0;background:var(--idm-gray-light);border-radius:4px;font-size:14px;color:var(--idm-black-8);line-height:26px}.spot-report .content-box .card-box .date[data-v-3ab7a0ef]{font-weight:700;padding:2px 10px;background:var(--idm-white)}.spot-report .content-box .card-box .basic-table[data-v-3ab7a0ef],.spot-report .content-box .card-box .wave-current-table[data-v-3ab7a0ef],.spot-report .content-box .card-box .sea-table[data-v-3ab7a0ef]{width:100%;font-size:12px;padding:5px;border-collapse:collapse;border:1px solid var(--idm-gray-light)}.spot-report .content-box .card-box .basic-table .tr-title[data-v-3ab7a0ef],.spot-report .content-box .card-box .wave-current-table .tr-title[data-v-3ab7a0ef],.spot-report .content-box .card-box .sea-table .tr-title[data-v-3ab7a0ef]{width:200px;padding-right:10px;text-align:right!important;background:none}.spot-report .content-box .card-box .basic-table .tr-title .unit[data-v-3ab7a0ef],.spot-report .content-box .card-box .wave-current-table .tr-title .unit[data-v-3ab7a0ef],.spot-report .content-box .card-box .sea-table .tr-title .unit[data-v-3ab7a0ef]{width:20px;padding:0 5px;text-align:left;display:inline-block;color:var(--idm-info-color)}.spot-report .content-box .card-box .basic-table td[data-v-3ab7a0ef],.spot-report .content-box .card-box .wave-current-table td[data-v-3ab7a0ef],.spot-report .content-box .card-box .sea-table td[data-v-3ab7a0ef]{text-align:center;line-height:20px;width:40px;background:var(--idm-white)}.spot-report .content-box .card-box .basic-table td.active[data-v-3ab7a0ef],.spot-report .content-box .card-box .wave-current-table td.active[data-v-3ab7a0ef],.spot-report .content-box .card-box .sea-table td.active[data-v-3ab7a0ef]{color:#fff;background:rgb(71,143,206)}.spot-report .content-box .card-box .basic-table th[data-v-3ab7a0ef],.spot-report .content-box .card-box .wave-current-table th[data-v-3ab7a0ef],.spot-report .content-box .card-box .sea-table th[data-v-3ab7a0ef]{color:var(--idm-info-color);font-weight:400;text-align:center;line-height:20px;width:40px}.spot-report .content-box .card-box .basic-table .weather-icon[data-v-3ab7a0ef],.spot-report .content-box .card-box .wave-current-table .weather-icon[data-v-3ab7a0ef],.spot-report .content-box .card-box .sea-table .weather-icon[data-v-3ab7a0ef]{width:24px;height:24px;cursor:pointer}
|