@burdenoff/microfe-healthybowl 2026.714.5 → 2026.714.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/generated/wspace-operations.js +6 -7
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/healthybowl/HealthyBowlRoutes.js +111 -95
- package/dist/healthybowl/HealthyBowlRoutes.js.map +1 -1
- package/dist/healthybowl/hooks/useWeatherIntelligence.js +224 -0
- package/dist/healthybowl/hooks/useWeatherIntelligence.js.map +1 -0
- package/dist/healthybowl/pages/weather/FrostRiskCalendarPage.js +258 -0
- package/dist/healthybowl/pages/weather/FrostRiskCalendarPage.js.map +1 -0
- package/dist/healthybowl/pages/weather/WeatherAlertHistoryPage.js +255 -0
- package/dist/healthybowl/pages/weather/WeatherAlertHistoryPage.js.map +1 -0
- package/dist/healthybowl/pages/weather/WeatherAnomalyReportPage.js +387 -0
- package/dist/healthybowl/pages/weather/WeatherAnomalyReportPage.js.map +1 -0
- package/dist/healthybowl/pages/weather/WeatherHistoryPage.js +313 -114
- package/dist/healthybowl/pages/weather/WeatherHistoryPage.js.map +1 -1
- package/dist/healthybowl/pages/weather/WeatherOverviewPage.js +554 -213
- package/dist/healthybowl/pages/weather/WeatherOverviewPage.js.map +1 -1
- package/dist/healthybowl/pages/weather/WeatherSettingsPage.js +457 -0
- package/dist/healthybowl/pages/weather/WeatherSettingsPage.js.map +1 -0
- package/dist/node_modules/date-fns/addDays.js.map +1 -1
- package/dist/node_modules/date-fns/locale/ta/_lib/localize.js.map +1 -1
- package/dist/node_modules/date-fns/locale/zh-CN/_lib/match.js +15 -15
- package/dist/node_modules/date-fns/locale/zh-CN/_lib/match.js.map +1 -1
- package/dist/services/assistantApi.js +34 -234
- package/dist/services/assistantApi.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
import { geocodePlace as e } from "../../utils/geocode.js";
|
|
2
2
|
import { useBasePath as t } from "../../hooks/useBasePath.js";
|
|
3
3
|
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
4
|
+
import { StatCard as r } from "../../components/StatCard.js";
|
|
5
|
+
import { StatusBadge as i } from "../../components/StatusBadge.js";
|
|
6
|
+
import { EmptyState as a } from "../../components/EmptyState.js";
|
|
7
|
+
import { ErrorState as ee } from "../../components/ErrorState.js";
|
|
8
|
+
import { ToastContainer as te } from "../../components/Toast.js";
|
|
9
|
+
import { PageLoader as ne } from "../../components/PageLoader.js";
|
|
10
|
+
import { Modal as o } from "../../components/Modal.js";
|
|
11
|
+
import { useToast as re } from "../../hooks/useToast.js";
|
|
12
|
+
import { WeatherMap as ie } from "../../components/WeatherMap.js";
|
|
12
13
|
import "../../components/index.js";
|
|
13
|
-
import { useHealthyBowlData as
|
|
14
|
+
import { useHealthyBowlData as ae } from "../../hooks/useHealthyBowlData.js";
|
|
15
|
+
import { ResponsiveContainer as s } from "../../../node_modules/recharts/es6/component/ResponsiveContainer.js";
|
|
16
|
+
import { Area as oe } from "../../../node_modules/recharts/es6/cartesian/Area.js";
|
|
17
|
+
import { AreaChart as c } from "../../../node_modules/recharts/es6/chart/AreaChart.js";
|
|
18
|
+
import { useWeatherIntelligence as se } from "../../hooks/useWeatherIntelligence.js";
|
|
19
|
+
import { useDiseaseWarning as l } from "../../hooks/useDiseaseWarning.js";
|
|
14
20
|
import { useCallback as u, useMemo as d, useState as f } from "react";
|
|
15
|
-
import { useI18n as
|
|
16
|
-
import { AlertTriangle as
|
|
17
|
-
import { useNavigate as
|
|
21
|
+
import { useI18n as ce } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
22
|
+
import { Activity as le, AlertTriangle as p, ArrowDown as ue, ArrowUp as de, BarChart3 as fe, Bell as m, Calendar as h, CalendarDays as g, ChevronRight as _, Cloud as v, CloudLightning as y, CloudRain as pe, Droplets as b, Eye as me, Gauge as he, History as ge, Loader2 as x, MapPin as S, Settings2 as _e, Snowflake as C, Sun as w, Thermometer as T, TrendingUp as E, Wind as ve, Workflow as ye } from "lucide-react";
|
|
23
|
+
import { useNavigate as be } from "react-router-dom";
|
|
18
24
|
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
19
25
|
import { Button as A } from "@burdenoff/fe-libs/ui";
|
|
20
26
|
//#region src/healthybowl/pages/weather/WeatherOverviewPage.tsx
|
|
21
|
-
var
|
|
27
|
+
var xe = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ? "warning" : "info", Se = (e) => {
|
|
22
28
|
switch (e) {
|
|
23
29
|
case "extreme": return "border-l-red-600";
|
|
24
30
|
case "severe": return "border-l-red-500";
|
|
@@ -30,17 +36,58 @@ var se = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ?
|
|
|
30
36
|
switch (e.toLowerCase()) {
|
|
31
37
|
case "sunny":
|
|
32
38
|
case "clear": return w;
|
|
33
|
-
case "partly cloudy": return
|
|
34
|
-
case "rain": return
|
|
35
|
-
case "thunderstorm": return
|
|
36
|
-
case "cloudy": return
|
|
39
|
+
case "partly cloudy": return v;
|
|
40
|
+
case "rain": return pe;
|
|
41
|
+
case "thunderstorm": return y;
|
|
42
|
+
case "cloudy": return v;
|
|
37
43
|
default: return w;
|
|
38
44
|
}
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
}, Ce = (e) => {
|
|
46
|
+
switch (e) {
|
|
47
|
+
case "RED": return "bg-red-600 text-white";
|
|
48
|
+
case "AMBER": return "bg-amber-500 text-white";
|
|
49
|
+
default: return "bg-slate-500 text-white";
|
|
50
|
+
}
|
|
51
|
+
}, we = (e) => {
|
|
52
|
+
switch (e) {
|
|
53
|
+
case "extreme":
|
|
54
|
+
case "severe": return "bg-red-600 text-white";
|
|
55
|
+
case "moderate": return "bg-amber-500 text-white";
|
|
56
|
+
default: return "bg-slate-500 text-white";
|
|
57
|
+
}
|
|
58
|
+
}, Te = (e) => {
|
|
59
|
+
switch (e.toUpperCase()) {
|
|
60
|
+
case "FROST": return C;
|
|
61
|
+
case "STORM": return y;
|
|
62
|
+
case "HEAT": return T;
|
|
63
|
+
case "DISEASE": return le;
|
|
64
|
+
default: return p;
|
|
65
|
+
}
|
|
66
|
+
}, Ee = (e) => {
|
|
67
|
+
let t = e.toLowerCase();
|
|
68
|
+
return t.includes("frost") || t.includes("freeze") || t.includes("cold") ? C : t.includes("storm") || t.includes("thunder") || t.includes("rain") || t.includes("wind") ? y : t.includes("heat") || t.includes("hot") ? T : p;
|
|
69
|
+
}, De = (e) => {
|
|
70
|
+
switch (e) {
|
|
71
|
+
case "FROST_HIGH": return "bg-red-600 text-white";
|
|
72
|
+
case "FROST_WATCH": return "bg-amber-500 text-white";
|
|
73
|
+
case "HEAT": return "bg-orange-500 text-white";
|
|
74
|
+
case "STORM": return "bg-slate-500 text-white";
|
|
75
|
+
case "DISEASE_WINDOW": return "bg-violet-600 text-white";
|
|
76
|
+
case "CLEAR": return "bg-emerald-600/15 text-emerald-700";
|
|
77
|
+
default: return "bg-bg-sunken text-text-secondary";
|
|
78
|
+
}
|
|
79
|
+
}, Oe = (e) => {
|
|
80
|
+
if (!e) return null;
|
|
81
|
+
let t = new Date(e);
|
|
82
|
+
return Number.isNaN(t.getTime()) ? null : t.toLocaleDateString("en-US", {
|
|
83
|
+
month: "short",
|
|
84
|
+
day: "numeric"
|
|
85
|
+
});
|
|
86
|
+
}, ke = (e) => e <= 2 ? "low" : e <= 5 ? "moderate" : e <= 7 ? "high" : e <= 10 ? "veryHigh" : "extreme", M = () => {
|
|
87
|
+
let { weatherData: v, farm: y, createFarm: w, updateFarm: T, loadings: M, errors: N, refetch: P } = ae(), { anomaly: F, loadingAnomaly: Ae, errorAnomaly: je, frostCalendar: I, loadingCalendar: Me, errorCalendar: Ne, alertEvents: Pe, series: L, loadingSeries: Fe } = se(), { rules: R, loading: Ie, error: Le } = l(), [Re, ze] = f(!1), [Be, z] = f(!1), [B, Ve] = f(""), [V, He] = f(!1), H = be(), { buildPath: U } = t(), { t: Ue } = ce(), W = u((e, t, n) => {
|
|
88
|
+
let r = Ue(e), i = r === e ? t : r;
|
|
42
89
|
return n ? Object.entries(n).reduce((e, [t, n]) => e.replace(`{{${t}}}`, String(n)), i) : i;
|
|
43
|
-
}, [
|
|
90
|
+
}, [Ue]), { toasts: We, toast: G, dismiss: Ge } = re(), K = v?.current ?? {
|
|
44
91
|
temperature: 0,
|
|
45
92
|
condition: "N/A",
|
|
46
93
|
feelsLike: 0,
|
|
@@ -51,185 +98,255 @@ var se = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ?
|
|
|
51
98
|
pressure: 0,
|
|
52
99
|
visibility: 0,
|
|
53
100
|
icon: ""
|
|
54
|
-
},
|
|
55
|
-
lat:
|
|
56
|
-
lng:
|
|
57
|
-
} : null,
|
|
58
|
-
high:
|
|
59
|
-
low:
|
|
101
|
+
}, q = v?.forecast ?? [], J = v?.alerts ?? [], Y = v?.location ?? "", Ke = typeof v?.latitude == "number" && typeof v?.longitude == "number" ? {
|
|
102
|
+
lat: v.latitude,
|
|
103
|
+
lng: v.longitude
|
|
104
|
+
} : null, qe = Y === "" && q.length === 0, X = q[0] ?? {
|
|
105
|
+
high: K.temperature,
|
|
106
|
+
low: K.temperature,
|
|
60
107
|
precipitation: 0,
|
|
61
|
-
humidity:
|
|
62
|
-
windSpeed:
|
|
63
|
-
},
|
|
64
|
-
let t =
|
|
108
|
+
humidity: K.humidity,
|
|
109
|
+
windSpeed: K.windSpeed
|
|
110
|
+
}, Z = u((e) => {
|
|
111
|
+
let t = ke(e);
|
|
65
112
|
return {
|
|
66
|
-
low:
|
|
67
|
-
moderate:
|
|
68
|
-
high:
|
|
69
|
-
veryHigh:
|
|
70
|
-
extreme:
|
|
113
|
+
low: W("healthybowl.weather.overview.uv.low", "Low"),
|
|
114
|
+
moderate: W("healthybowl.weather.overview.uv.moderate", "Moderate"),
|
|
115
|
+
high: W("healthybowl.weather.overview.uv.high", "High"),
|
|
116
|
+
veryHigh: W("healthybowl.weather.overview.uv.veryHigh", "Very High"),
|
|
117
|
+
extreme: W("healthybowl.weather.overview.uv.extreme", "Extreme")
|
|
71
118
|
}[t];
|
|
72
|
-
}, [
|
|
73
|
-
|
|
74
|
-
}, [
|
|
75
|
-
let t =
|
|
119
|
+
}, [W]), Je = u(() => {
|
|
120
|
+
Ve(y.location ?? ""), z(!0);
|
|
121
|
+
}, [y.location]), Ye = u(async () => {
|
|
122
|
+
let t = B.trim();
|
|
76
123
|
if (!t) {
|
|
77
|
-
|
|
78
|
-
title:
|
|
79
|
-
description:
|
|
124
|
+
G({
|
|
125
|
+
title: W("healthybowl.weather.overview.location.toast.required.title", "Location required"),
|
|
126
|
+
description: W("healthybowl.weather.overview.location.toast.required.description", "Enter a town, city, or region to set your farm location."),
|
|
80
127
|
variant: "warning"
|
|
81
128
|
});
|
|
82
129
|
return;
|
|
83
130
|
}
|
|
84
|
-
|
|
131
|
+
He(!0);
|
|
85
132
|
try {
|
|
86
133
|
let n = await e(t), r = n ? {
|
|
87
134
|
latitude: n.latitude,
|
|
88
135
|
longitude: n.longitude
|
|
89
136
|
} : {};
|
|
90
|
-
|
|
91
|
-
id:
|
|
137
|
+
y.id ? await T({
|
|
138
|
+
id: y.id,
|
|
92
139
|
location: t,
|
|
93
140
|
...r
|
|
94
|
-
}) : await
|
|
95
|
-
name:
|
|
141
|
+
}) : await w({
|
|
142
|
+
name: W("healthybowl.weather.overview.location.defaultFarmName", "My Farm"),
|
|
96
143
|
location: t,
|
|
97
144
|
owner: "",
|
|
98
145
|
totalArea: 0,
|
|
99
146
|
areaUnit: "acres",
|
|
100
147
|
organicCertified: !1,
|
|
101
148
|
...r
|
|
102
|
-
}),
|
|
103
|
-
title:
|
|
104
|
-
description: n ?
|
|
149
|
+
}), G({
|
|
150
|
+
title: W("healthybowl.weather.overview.location.toast.saved.title", "Location set"),
|
|
151
|
+
description: n ? W("healthybowl.weather.overview.location.toast.saved.resolved", "Weather will load for {{place}}.", { place: [
|
|
105
152
|
n.name,
|
|
106
153
|
n.admin1,
|
|
107
154
|
n.country
|
|
108
|
-
].filter(Boolean).join(", ") || t }) :
|
|
155
|
+
].filter(Boolean).join(", ") || t }) : W("healthybowl.weather.overview.location.toast.saved.unresolved", "Saved \"{{place}}\". We could not resolve exact coordinates — the server will try to geocode it.", { place: t }),
|
|
109
156
|
variant: "success"
|
|
110
|
-
}),
|
|
157
|
+
}), z(!1), await P();
|
|
111
158
|
} catch (e) {
|
|
112
|
-
|
|
113
|
-
title:
|
|
159
|
+
G({
|
|
160
|
+
title: W("healthybowl.weather.overview.location.toast.failed.title", "Could not set location"),
|
|
114
161
|
description: e instanceof Error ? e.message : String(e),
|
|
115
162
|
variant: "error"
|
|
116
163
|
});
|
|
117
164
|
} finally {
|
|
118
|
-
|
|
165
|
+
He(!1);
|
|
119
166
|
}
|
|
120
167
|
}, [
|
|
121
|
-
|
|
122
|
-
|
|
168
|
+
B,
|
|
169
|
+
y.id,
|
|
170
|
+
T,
|
|
123
171
|
w,
|
|
124
|
-
x,
|
|
125
172
|
P,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
]),
|
|
173
|
+
G,
|
|
174
|
+
W
|
|
175
|
+
]), Xe = d(() => {
|
|
129
176
|
let e = [];
|
|
130
|
-
|
|
177
|
+
K.humidity >= 40 && K.humidity <= 70 && K.temperature >= 15 && K.temperature <= 30 ? e.push({
|
|
131
178
|
id: "goodIrrigation",
|
|
132
|
-
title:
|
|
133
|
-
description:
|
|
134
|
-
humidity:
|
|
135
|
-
temperature:
|
|
179
|
+
title: W("healthybowl.weather.overview.recommendations.goodIrrigation.title", "Good conditions for irrigation"),
|
|
180
|
+
description: W("healthybowl.weather.overview.recommendations.goodIrrigation.description", "Humidity at {{humidity}}% and {{temperature}}°C are optimal for watering crops", {
|
|
181
|
+
humidity: K.humidity,
|
|
182
|
+
temperature: K.temperature
|
|
136
183
|
}),
|
|
137
|
-
icon:
|
|
184
|
+
icon: E,
|
|
138
185
|
iconColor: "text-success"
|
|
139
|
-
}) :
|
|
186
|
+
}) : K.humidity > 70 ? e.push({
|
|
140
187
|
id: "skipIrrigation",
|
|
141
|
-
title:
|
|
142
|
-
description:
|
|
143
|
-
icon:
|
|
188
|
+
title: W("healthybowl.weather.overview.recommendations.skipIrrigation.title", "Skip irrigation today"),
|
|
189
|
+
description: W("healthybowl.weather.overview.recommendations.skipIrrigation.description", "Humidity is high at {{humidity}}% — soil moisture is likely adequate", { humidity: K.humidity }),
|
|
190
|
+
icon: b,
|
|
144
191
|
iconColor: "text-info"
|
|
145
192
|
}) : e.push({
|
|
146
193
|
id: "increaseIrrigation",
|
|
147
|
-
title:
|
|
148
|
-
description:
|
|
149
|
-
icon:
|
|
194
|
+
title: W("healthybowl.weather.overview.recommendations.increaseIrrigation.title", "Increase irrigation"),
|
|
195
|
+
description: W("healthybowl.weather.overview.recommendations.increaseIrrigation.description", "Low humidity at {{humidity}}% — crops may need extra watering", { humidity: K.humidity }),
|
|
196
|
+
icon: p,
|
|
150
197
|
iconColor: "text-warning"
|
|
151
198
|
});
|
|
152
|
-
let t =
|
|
199
|
+
let t = q.find((e) => e.precipitation > 50);
|
|
153
200
|
return t && e.push({
|
|
154
201
|
id: "heavyRain",
|
|
155
|
-
title:
|
|
156
|
-
description:
|
|
202
|
+
title: W("healthybowl.weather.overview.recommendations.heavyRain.title", "Prepare for heavy rain"),
|
|
203
|
+
description: W("healthybowl.weather.overview.recommendations.heavyRain.description", "{{precipitation}}% precipitation expected on {{day}} — ensure proper drainage", {
|
|
157
204
|
precipitation: t.precipitation,
|
|
158
205
|
day: new Date(t.date).toLocaleDateString("en-US", { weekday: "short" })
|
|
159
206
|
}),
|
|
160
|
-
icon:
|
|
207
|
+
icon: p,
|
|
161
208
|
iconColor: "text-warning"
|
|
162
|
-
}),
|
|
209
|
+
}), K.windSpeed > 20 && e.push({
|
|
163
210
|
id: "windSensitive",
|
|
164
|
-
title:
|
|
165
|
-
description:
|
|
166
|
-
windSpeed:
|
|
167
|
-
windDirection:
|
|
211
|
+
title: W("healthybowl.weather.overview.recommendations.windSensitive.title", "Monitor wind-sensitive crops"),
|
|
212
|
+
description: W("healthybowl.weather.overview.recommendations.windSensitive.description", "Wind at {{windSpeed}} km/h {{windDirection}} — check support structures for tall crops", {
|
|
213
|
+
windSpeed: K.windSpeed,
|
|
214
|
+
windDirection: K.windDirection
|
|
168
215
|
}),
|
|
169
|
-
icon:
|
|
216
|
+
icon: ve,
|
|
170
217
|
iconColor: "text-info"
|
|
171
|
-
}),
|
|
218
|
+
}), K.uvIndex >= 8 && e.push({
|
|
172
219
|
id: "highUV",
|
|
173
|
-
title:
|
|
174
|
-
description:
|
|
175
|
-
uvIndex:
|
|
176
|
-
uvLabel:
|
|
220
|
+
title: W("healthybowl.weather.overview.recommendations.highUV.title", "High UV exposure"),
|
|
221
|
+
description: W("healthybowl.weather.overview.recommendations.highUV.description", "UV index at {{uvIndex}} ({{uvLabel}}) — consider shade protection for sensitive crops", {
|
|
222
|
+
uvIndex: K.uvIndex,
|
|
223
|
+
uvLabel: Z(K.uvIndex)
|
|
177
224
|
}),
|
|
178
|
-
icon:
|
|
225
|
+
icon: p,
|
|
179
226
|
iconColor: "text-status-error-text"
|
|
180
227
|
}), e.length === 0 && e.push({
|
|
181
228
|
id: "stable",
|
|
182
|
-
title:
|
|
183
|
-
description:
|
|
184
|
-
icon:
|
|
229
|
+
title: W("healthybowl.weather.overview.recommendations.stable.title", "Conditions are stable"),
|
|
230
|
+
description: W("healthybowl.weather.overview.recommendations.stable.description", "No immediate weather concerns for farming operations"),
|
|
231
|
+
icon: E,
|
|
185
232
|
iconColor: "text-success"
|
|
186
233
|
}), e;
|
|
187
234
|
}, [
|
|
235
|
+
K,
|
|
188
236
|
q,
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
let e = G("healthybowl.weather.overview.impact.levels.low", "Low"), t = G("healthybowl.weather.overview.impact.levels.moderate", "Moderate"), n = G("healthybowl.weather.overview.impact.levels.high", "High"), r = q.temperature >= 15 && q.temperature <= 30 ? 90 : q.temperature >= 10 && q.temperature <= 35 ? 60 : 30, i = q.humidity >= 40 && q.humidity <= 70 ? 85 : 50, a = Math.round((r + i) / 2), ee = a >= 80 ? G("healthybowl.weather.overview.impact.levels.excellent", "Excellent") : a >= 60 ? G("healthybowl.weather.overview.impact.levels.good", "Good") : a >= 40 ? t : G("healthybowl.weather.overview.impact.levels.poor", "Poor"), o = a >= 60 ? "bg-success" : a >= 40 ? "bg-warning" : "bg-status-error-bg", s = Y.filter((e) => e.severity === "extreme" || e.severity === "severe").length, c = Math.min(100, Math.round(q.humidity / 100 * 60 + s * 15)), l = c >= 70 ? n : c >= 40 ? t : e, te = c >= 70 ? "bg-status-error-bg" : c >= 40 ? "bg-warning" : "bg-success", u = Math.min(100, Math.round(q.windSpeed / 50 * 100)), d = Math.min(100, Math.round(u * .4 + (q.temperature > 25 ? 30 : 10))), f = d >= 60 ? n : d >= 30 ? t : e, p = d >= 60 ? "bg-status-error-bg" : d >= 30 ? "bg-warning" : "bg-success", m = J.length > 0 ? J.reduce((e, t) => e + t.precipitation, 0) / J.length : 0, h = Math.max(0, Math.min(100, Math.round(100 - m - q.humidity * .5))), g = h >= 60 ? n : h >= 30 ? t : e, _ = h >= 60 ? "bg-status-error-bg" : h >= 30 ? "bg-warning" : "bg-info";
|
|
237
|
+
W,
|
|
238
|
+
Z
|
|
239
|
+
]), Ze = d(() => {
|
|
240
|
+
let e = W("healthybowl.weather.overview.impact.levels.low", "Low"), t = W("healthybowl.weather.overview.impact.levels.moderate", "Moderate"), n = W("healthybowl.weather.overview.impact.levels.high", "High"), r = K.temperature >= 15 && K.temperature <= 30 ? 90 : K.temperature >= 10 && K.temperature <= 35 ? 60 : 30, i = K.humidity >= 40 && K.humidity <= 70 ? 85 : 50, a = Math.round((r + i) / 2), ee = a >= 80 ? W("healthybowl.weather.overview.impact.levels.excellent", "Excellent") : a >= 60 ? W("healthybowl.weather.overview.impact.levels.good", "Good") : a >= 40 ? t : W("healthybowl.weather.overview.impact.levels.poor", "Poor"), te = a >= 60 ? "bg-success" : a >= 40 ? "bg-warning" : "bg-status-error-bg", ne = J.filter((e) => e.severity === "extreme" || e.severity === "severe").length, o = Math.min(100, Math.round(K.humidity / 100 * 60 + ne * 15)), re = o >= 70 ? n : o >= 40 ? t : e, ie = o >= 70 ? "bg-status-error-bg" : o >= 40 ? "bg-warning" : "bg-success", ae = Math.min(100, Math.round(K.windSpeed / 50 * 100)), s = Math.min(100, Math.round(ae * .4 + (K.temperature > 25 ? 30 : 10))), oe = s >= 60 ? n : s >= 30 ? t : e, c = s >= 60 ? "bg-status-error-bg" : s >= 30 ? "bg-warning" : "bg-success", se = q.length > 0 ? q.reduce((e, t) => e + t.precipitation, 0) / q.length : 0, l = Math.max(0, Math.min(100, Math.round(100 - se - K.humidity * .5))), u = l >= 60 ? n : l >= 30 ? t : e, d = l >= 60 ? "bg-status-error-bg" : l >= 30 ? "bg-warning" : "bg-info";
|
|
194
241
|
return [
|
|
195
242
|
{
|
|
196
243
|
id: "cropGrowth",
|
|
197
|
-
label:
|
|
244
|
+
label: W("healthybowl.weather.overview.impact.cropGrowth.label", "Crop Growth Conditions"),
|
|
198
245
|
level: ee,
|
|
199
246
|
percent: a,
|
|
200
|
-
color:
|
|
247
|
+
color: te
|
|
201
248
|
},
|
|
202
249
|
{
|
|
203
250
|
id: "diseaseRisk",
|
|
204
|
-
label:
|
|
205
|
-
level:
|
|
206
|
-
percent:
|
|
207
|
-
color:
|
|
251
|
+
label: W("healthybowl.weather.overview.impact.diseaseRisk.label", "Disease Risk"),
|
|
252
|
+
level: re,
|
|
253
|
+
percent: o,
|
|
254
|
+
color: ie
|
|
208
255
|
},
|
|
209
256
|
{
|
|
210
257
|
id: "pestActivity",
|
|
211
|
-
label:
|
|
212
|
-
level:
|
|
213
|
-
percent:
|
|
214
|
-
color:
|
|
258
|
+
label: W("healthybowl.weather.overview.impact.pestActivity.label", "Pest Activity"),
|
|
259
|
+
level: oe,
|
|
260
|
+
percent: s,
|
|
261
|
+
color: c
|
|
215
262
|
},
|
|
216
263
|
{
|
|
217
264
|
id: "irrigationNeed",
|
|
218
|
-
label:
|
|
219
|
-
level:
|
|
220
|
-
percent:
|
|
221
|
-
color:
|
|
265
|
+
label: W("healthybowl.weather.overview.impact.irrigationNeed.label", "Irrigation Need"),
|
|
266
|
+
level: u,
|
|
267
|
+
percent: l,
|
|
268
|
+
color: d
|
|
222
269
|
}
|
|
223
270
|
];
|
|
224
271
|
}, [
|
|
272
|
+
K,
|
|
225
273
|
q,
|
|
226
274
|
J,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
275
|
+
W
|
|
276
|
+
]), Qe = d(() => {
|
|
277
|
+
let e = Pe.filter((e) => e.status !== "handled");
|
|
278
|
+
return e.length > 0 ? e.slice(0, 3).map((e) => ({
|
|
279
|
+
id: e.id,
|
|
280
|
+
icon: Te(e.alertType),
|
|
281
|
+
classes: Ce(e.severity),
|
|
282
|
+
title: e.title,
|
|
283
|
+
detail: e.advisory ?? ""
|
|
284
|
+
})) : J.slice(0, 3).map((e) => ({
|
|
285
|
+
id: e.id,
|
|
286
|
+
icon: Ee(`${e.title} ${e.description ?? ""}`),
|
|
287
|
+
classes: we(e.severity),
|
|
288
|
+
title: e.title,
|
|
289
|
+
detail: e.description ?? ""
|
|
290
|
+
}));
|
|
291
|
+
}, [Pe, J]), $e = d(() => (F?.monthlyRainfall ?? []).map((e) => ({
|
|
292
|
+
month: e.monthName,
|
|
293
|
+
value: e.currentValue
|
|
294
|
+
})), [F]), Q = d(() => {
|
|
295
|
+
let e = L?.baseline ?? [];
|
|
296
|
+
return e.length === 0 ? null : e.reduce((e, t) => t.avgRainfall > e.avgRainfall ? t : e, e[0]);
|
|
297
|
+
}, [L]), et = [
|
|
298
|
+
{
|
|
299
|
+
id: "forecast",
|
|
300
|
+
label: W("healthybowl.weather.subnav.forecast", "Forecast"),
|
|
301
|
+
icon: h,
|
|
302
|
+
path: "weather/forecast"
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
id: "history",
|
|
306
|
+
label: W("healthybowl.weather.subnav.history", "History"),
|
|
307
|
+
icon: E,
|
|
308
|
+
path: "weather/history"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
id: "alerts",
|
|
312
|
+
label: W("healthybowl.weather.subnav.alerts", "Alerts"),
|
|
313
|
+
icon: m,
|
|
314
|
+
path: "weather/alerts"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
id: "calendar",
|
|
318
|
+
label: W("healthybowl.weather.subnav.calendar", "Calendar"),
|
|
319
|
+
icon: g,
|
|
320
|
+
path: "weather/calendar"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
id: "anomaly",
|
|
324
|
+
label: W("healthybowl.weather.subnav.anomaly", "Anomaly"),
|
|
325
|
+
icon: fe,
|
|
326
|
+
path: "weather/anomaly"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
id: "alert-rules",
|
|
330
|
+
label: W("healthybowl.weather.subnav.alertRules", "Alert Rules"),
|
|
331
|
+
icon: ye,
|
|
332
|
+
path: "weather/alert-rules"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
id: "alert-history",
|
|
336
|
+
label: W("healthybowl.weather.subnav.alertHistory", "Alert History"),
|
|
337
|
+
icon: ge,
|
|
338
|
+
path: "weather/alert-history"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
id: "settings",
|
|
342
|
+
label: W("healthybowl.weather.subnav.settings", "Settings"),
|
|
343
|
+
icon: _e,
|
|
344
|
+
path: "weather/settings"
|
|
345
|
+
}
|
|
346
|
+
], $ = F ? Math.round(F.rainfallDeviationPct) : 0, tt = Oe(I?.historicalFirstFrost);
|
|
230
347
|
return /* @__PURE__ */ k(n, {
|
|
231
|
-
title:
|
|
232
|
-
description:
|
|
348
|
+
title: W("healthybowl.weather.overview.title", "Weather Dashboard"),
|
|
349
|
+
description: W("healthybowl.weather.overview.description", "Real-time weather data and forecasts for {{location}}", { location: Y }),
|
|
233
350
|
purpose: "Today's conditions and the days ahead for your farm in one view. Check the weather before you head out, and jump into the full forecast, history or alerts when you need to plan or react.",
|
|
234
351
|
nextStepsKey: "healthybowl-weather-overview",
|
|
235
352
|
nextStepsTitle: "Plan around the weather",
|
|
@@ -253,74 +370,105 @@ var se = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ?
|
|
|
253
370
|
onClick: () => H(U("weather/history"))
|
|
254
371
|
}
|
|
255
372
|
],
|
|
256
|
-
actions: !
|
|
373
|
+
actions: !qe && !M.weather && !N.weather ? /* @__PURE__ */ k(A, {
|
|
257
374
|
variant: "outline",
|
|
258
375
|
size: "sm",
|
|
259
|
-
onClick:
|
|
260
|
-
children: [/* @__PURE__ */ O(
|
|
376
|
+
onClick: Je,
|
|
377
|
+
children: [/* @__PURE__ */ O(S, { className: "h-4 w-4 text-text-secondary" }), W("healthybowl.weather.overview.actions.changeLocation", "Change location")]
|
|
261
378
|
}) : void 0,
|
|
262
379
|
children: [
|
|
263
|
-
M.weather ? /* @__PURE__ */ O(
|
|
380
|
+
M.weather ? /* @__PURE__ */ O(ne, {}) : N.weather ? /* @__PURE__ */ O(ee, { onRetry: P }) : qe ? /* @__PURE__ */ O(a, {
|
|
264
381
|
illustration: "empty-generic",
|
|
265
|
-
title:
|
|
266
|
-
description:
|
|
382
|
+
title: W("healthybowl.weather.overview.emptyState.title", "No farm location set"),
|
|
383
|
+
description: W("healthybowl.weather.overview.emptyState.description", "Weather forecasts need a location. Set your farm location to see real-time conditions, a 7-day forecast, and farming recommendations."),
|
|
267
384
|
action: /* @__PURE__ */ k(A, {
|
|
268
|
-
onClick:
|
|
269
|
-
children: [/* @__PURE__ */ O(
|
|
385
|
+
onClick: Je,
|
|
386
|
+
children: [/* @__PURE__ */ O(S, { className: "h-4 w-4" }), W("healthybowl.weather.overview.emptyState.action", "Set your farm location")]
|
|
270
387
|
})
|
|
271
388
|
}) : /* @__PURE__ */ k(D, { children: [
|
|
389
|
+
Qe.length > 0 && /* @__PURE__ */ O("div", {
|
|
390
|
+
className: "grid grid-cols-1 gap-3 lg:grid-cols-3",
|
|
391
|
+
children: Qe.map((e) => {
|
|
392
|
+
let t = e.icon;
|
|
393
|
+
return /* @__PURE__ */ k("div", {
|
|
394
|
+
className: `flex items-start gap-3 rounded-lg p-4 ${e.classes}`,
|
|
395
|
+
children: [/* @__PURE__ */ O(t, { className: "mt-0.5 h-5 w-5 shrink-0" }), /* @__PURE__ */ k("div", {
|
|
396
|
+
className: "min-w-0",
|
|
397
|
+
children: [/* @__PURE__ */ O("p", {
|
|
398
|
+
className: "text-sm font-semibold",
|
|
399
|
+
children: e.title
|
|
400
|
+
}), e.detail && /* @__PURE__ */ O("p", {
|
|
401
|
+
className: "mt-0.5 text-xs opacity-90",
|
|
402
|
+
children: e.detail
|
|
403
|
+
})]
|
|
404
|
+
})]
|
|
405
|
+
}, e.id);
|
|
406
|
+
})
|
|
407
|
+
}),
|
|
408
|
+
/* @__PURE__ */ O("div", {
|
|
409
|
+
className: "flex flex-wrap gap-2",
|
|
410
|
+
children: et.map((e) => {
|
|
411
|
+
let t = e.icon;
|
|
412
|
+
return /* @__PURE__ */ k("button", {
|
|
413
|
+
type: "button",
|
|
414
|
+
onClick: () => H(U(e.path)),
|
|
415
|
+
className: "inline-flex items-center gap-1.5 rounded-full border border-border-subtle bg-bg-surface px-3 py-1.5 text-xs font-medium text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary",
|
|
416
|
+
children: [/* @__PURE__ */ O(t, { className: "h-3.5 w-3.5" }), e.label]
|
|
417
|
+
}, e.id);
|
|
418
|
+
})
|
|
419
|
+
}),
|
|
272
420
|
/* @__PURE__ */ k("div", {
|
|
273
421
|
className: "grid grid-cols-2 gap-3 md:grid-cols-4",
|
|
274
422
|
children: [
|
|
275
423
|
/* @__PURE__ */ k(A, {
|
|
276
424
|
variant: "outline",
|
|
277
425
|
onClick: () => H(U("weather/forecast")),
|
|
278
|
-
children: [/* @__PURE__ */ O(
|
|
426
|
+
children: [/* @__PURE__ */ O(h, { className: "h-4 w-4 text-text-secondary" }), W("healthybowl.weather.overview.quickNav.extendedForecast", "Extended Forecast")]
|
|
279
427
|
}),
|
|
280
428
|
/* @__PURE__ */ k(A, {
|
|
281
429
|
variant: "outline",
|
|
282
430
|
onClick: () => H(U("weather/alerts")),
|
|
283
|
-
children: [/* @__PURE__ */ O(
|
|
431
|
+
children: [/* @__PURE__ */ O(m, { className: "h-4 w-4 text-text-secondary" }), W("healthybowl.weather.overview.quickNav.alertSettings", "Alert Settings")]
|
|
284
432
|
}),
|
|
285
433
|
/* @__PURE__ */ k(A, {
|
|
286
434
|
variant: "outline",
|
|
287
435
|
onClick: () => H(U("weather/history")),
|
|
288
|
-
children: [/* @__PURE__ */ O(
|
|
436
|
+
children: [/* @__PURE__ */ O(E, { className: "h-4 w-4 text-text-secondary" }), W("healthybowl.weather.overview.quickNav.historicalData", "Historical Data")]
|
|
289
437
|
}),
|
|
290
438
|
/* @__PURE__ */ k(A, {
|
|
291
439
|
variant: "outline",
|
|
292
|
-
onClick: () =>
|
|
440
|
+
onClick: () => ze(!0),
|
|
293
441
|
children: [
|
|
294
|
-
/* @__PURE__ */ O(
|
|
442
|
+
/* @__PURE__ */ O(S, { className: "h-4 w-4 text-text-secondary" }),
|
|
295
443
|
" ",
|
|
296
|
-
|
|
444
|
+
W("healthybowl.weather.overview.quickNav.weatherMaps", "Weather Maps")
|
|
297
445
|
]
|
|
298
446
|
})
|
|
299
447
|
]
|
|
300
448
|
}),
|
|
301
|
-
|
|
449
|
+
J.length > 0 && /* @__PURE__ */ k("div", {
|
|
302
450
|
className: "space-y-3",
|
|
303
451
|
children: [/* @__PURE__ */ k("div", {
|
|
304
452
|
className: "flex items-center justify-between",
|
|
305
453
|
children: [/* @__PURE__ */ O("h2", {
|
|
306
454
|
className: "text-base font-semibold text-text-primary",
|
|
307
|
-
children:
|
|
455
|
+
children: W("healthybowl.weather.overview.alerts.heading", "Weather Alerts")
|
|
308
456
|
}), /* @__PURE__ */ k(A, {
|
|
309
457
|
variant: "ghost",
|
|
310
458
|
size: "sm",
|
|
311
459
|
onClick: () => H(U("weather/alerts")),
|
|
312
460
|
className: "gap-1 text-text-secondary hover:text-text-primary",
|
|
313
461
|
children: [
|
|
314
|
-
|
|
462
|
+
W("healthybowl.weather.overview.alerts.manage", "Manage Alerts"),
|
|
315
463
|
" ",
|
|
316
|
-
/* @__PURE__ */ O(
|
|
464
|
+
/* @__PURE__ */ O(_, { className: "h-3.5 w-3.5" })
|
|
317
465
|
]
|
|
318
466
|
})]
|
|
319
|
-
}),
|
|
320
|
-
className: `rounded-lg border border-border-subtle border-l-4 bg-bg-surface p-4 ${
|
|
467
|
+
}), J.map((e) => /* @__PURE__ */ O("div", {
|
|
468
|
+
className: `rounded-lg border border-border-subtle border-l-4 bg-bg-surface p-4 ${Se(e.severity)}`,
|
|
321
469
|
children: /* @__PURE__ */ k("div", {
|
|
322
470
|
className: "flex items-start gap-3",
|
|
323
|
-
children: [/* @__PURE__ */ O(
|
|
471
|
+
children: [/* @__PURE__ */ O(p, { className: "mt-0.5 h-5 w-5 shrink-0 text-warning" }), /* @__PURE__ */ k("div", {
|
|
324
472
|
className: "flex-1",
|
|
325
473
|
children: [
|
|
326
474
|
/* @__PURE__ */ k("div", {
|
|
@@ -328,9 +476,9 @@ var se = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ?
|
|
|
328
476
|
children: [/* @__PURE__ */ O("h3", {
|
|
329
477
|
className: "text-sm font-medium text-text-primary",
|
|
330
478
|
children: e.title
|
|
331
|
-
}), /* @__PURE__ */ O(
|
|
479
|
+
}), /* @__PURE__ */ O(i, {
|
|
332
480
|
label: e.severity,
|
|
333
|
-
variant:
|
|
481
|
+
variant: xe(e.severity)
|
|
334
482
|
})]
|
|
335
483
|
}),
|
|
336
484
|
/* @__PURE__ */ O("p", {
|
|
@@ -339,7 +487,7 @@ var se = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ?
|
|
|
339
487
|
}),
|
|
340
488
|
/* @__PURE__ */ O("p", {
|
|
341
489
|
className: "mt-1 text-xs text-text-secondary",
|
|
342
|
-
children:
|
|
490
|
+
children: W("healthybowl.weather.overview.alerts.affected", "Affected: {{areas}}", { areas: (e.affectedAreas ?? []).join(", ") })
|
|
343
491
|
})
|
|
344
492
|
]
|
|
345
493
|
})]
|
|
@@ -352,12 +500,12 @@ var se = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ?
|
|
|
352
500
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6 lg:col-span-2",
|
|
353
501
|
children: [/* @__PURE__ */ k("div", {
|
|
354
502
|
className: "mb-4 flex items-center gap-2",
|
|
355
|
-
children: [/* @__PURE__ */ O(j(
|
|
503
|
+
children: [/* @__PURE__ */ O(j(K.condition), { className: "h-8 w-8 text-text-secondary" }), /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("h3", {
|
|
356
504
|
className: "text-sm font-semibold text-text-primary",
|
|
357
|
-
children:
|
|
505
|
+
children: W("healthybowl.weather.overview.current.title", "Current Weather")
|
|
358
506
|
}), /* @__PURE__ */ O("p", {
|
|
359
507
|
className: "text-xs text-text-secondary",
|
|
360
|
-
children:
|
|
508
|
+
children: W("healthybowl.weather.overview.current.lastUpdated", "Last updated: {{time}}", { time: (/* @__PURE__ */ new Date()).toLocaleString() })
|
|
361
509
|
})] })]
|
|
362
510
|
}), /* @__PURE__ */ k("div", {
|
|
363
511
|
className: "grid grid-cols-2 gap-6 md:grid-cols-4",
|
|
@@ -367,15 +515,15 @@ var se = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ?
|
|
|
367
515
|
children: [
|
|
368
516
|
/* @__PURE__ */ k("div", {
|
|
369
517
|
className: "text-3xl font-bold text-text-primary",
|
|
370
|
-
children: [
|
|
518
|
+
children: [K.temperature, "°C"]
|
|
371
519
|
}),
|
|
372
520
|
/* @__PURE__ */ O("div", {
|
|
373
521
|
className: "text-sm text-text-secondary",
|
|
374
|
-
children:
|
|
522
|
+
children: W("healthybowl.weather.overview.current.feelsLike", "Feels like {{temp}}°C", { temp: K.feelsLike })
|
|
375
523
|
}),
|
|
376
524
|
/* @__PURE__ */ O("div", {
|
|
377
525
|
className: "mt-1 text-sm font-medium text-text-primary",
|
|
378
|
-
children:
|
|
526
|
+
children: K.condition
|
|
379
527
|
})
|
|
380
528
|
]
|
|
381
529
|
}),
|
|
@@ -383,17 +531,17 @@ var se = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ?
|
|
|
383
531
|
className: "space-y-2",
|
|
384
532
|
children: [/* @__PURE__ */ k("div", {
|
|
385
533
|
className: "flex items-center gap-2",
|
|
386
|
-
children: [/* @__PURE__ */ O(
|
|
534
|
+
children: [/* @__PURE__ */ O(b, { className: "h-4 w-4 text-info" }), /* @__PURE__ */ O("span", {
|
|
387
535
|
className: "text-sm text-text-primary",
|
|
388
|
-
children:
|
|
536
|
+
children: W("healthybowl.weather.overview.current.humidity", "Humidity: {{value}}%", { value: K.humidity })
|
|
389
537
|
})]
|
|
390
538
|
}), /* @__PURE__ */ k("div", {
|
|
391
539
|
className: "flex items-center gap-2",
|
|
392
|
-
children: [/* @__PURE__ */ O(
|
|
540
|
+
children: [/* @__PURE__ */ O(ve, { className: "h-4 w-4 text-text-secondary" }), /* @__PURE__ */ O("span", {
|
|
393
541
|
className: "text-sm text-text-primary",
|
|
394
|
-
children:
|
|
395
|
-
speed:
|
|
396
|
-
direction:
|
|
542
|
+
children: W("healthybowl.weather.overview.current.wind", "Wind: {{speed}} km/h {{direction}}", {
|
|
543
|
+
speed: K.windSpeed,
|
|
544
|
+
direction: K.windDirection
|
|
397
545
|
})
|
|
398
546
|
})]
|
|
399
547
|
})]
|
|
@@ -402,15 +550,15 @@ var se = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ?
|
|
|
402
550
|
className: "space-y-2",
|
|
403
551
|
children: [/* @__PURE__ */ k("div", {
|
|
404
552
|
className: "flex items-center gap-2",
|
|
405
|
-
children: [/* @__PURE__ */ O(
|
|
553
|
+
children: [/* @__PURE__ */ O(he, { className: "h-4 w-4 text-primary" }), /* @__PURE__ */ O("span", {
|
|
406
554
|
className: "text-sm text-text-primary",
|
|
407
|
-
children:
|
|
555
|
+
children: W("healthybowl.weather.overview.current.pressure", "Pressure: {{value}} hPa", { value: K.pressure })
|
|
408
556
|
})]
|
|
409
557
|
}), /* @__PURE__ */ k("div", {
|
|
410
558
|
className: "flex items-center gap-2",
|
|
411
|
-
children: [/* @__PURE__ */ O(
|
|
559
|
+
children: [/* @__PURE__ */ O(me, { className: "h-4 w-4 text-success" }), /* @__PURE__ */ O("span", {
|
|
412
560
|
className: "text-sm text-text-primary",
|
|
413
|
-
children:
|
|
561
|
+
children: W("healthybowl.weather.overview.current.visibility", "Visibility: {{value}} km", { value: K.visibility })
|
|
414
562
|
})]
|
|
415
563
|
})]
|
|
416
564
|
}),
|
|
@@ -420,13 +568,13 @@ var se = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ?
|
|
|
420
568
|
className: "text-sm",
|
|
421
569
|
children: [/* @__PURE__ */ O("span", {
|
|
422
570
|
className: "text-text-secondary",
|
|
423
|
-
children:
|
|
571
|
+
children: W("healthybowl.weather.overview.current.uvIndex", "UV Index: ")
|
|
424
572
|
}), /* @__PURE__ */ k("span", {
|
|
425
573
|
className: "font-medium text-text-primary",
|
|
426
574
|
children: [
|
|
427
|
-
|
|
575
|
+
K.uvIndex,
|
|
428
576
|
" (",
|
|
429
|
-
|
|
577
|
+
Z(K.uvIndex),
|
|
430
578
|
")"
|
|
431
579
|
]
|
|
432
580
|
})]
|
|
@@ -438,7 +586,7 @@ var se = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ?
|
|
|
438
586
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
439
587
|
children: [/* @__PURE__ */ O("h3", {
|
|
440
588
|
className: "text-sm font-semibold text-text-primary",
|
|
441
|
-
children:
|
|
589
|
+
children: W("healthybowl.weather.overview.summary.title", "Today's Summary")
|
|
442
590
|
}), /* @__PURE__ */ k("div", {
|
|
443
591
|
className: "mt-4 space-y-4",
|
|
444
592
|
children: [
|
|
@@ -446,12 +594,12 @@ var se = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ?
|
|
|
446
594
|
className: "flex items-center justify-between",
|
|
447
595
|
children: [/* @__PURE__ */ O("span", {
|
|
448
596
|
className: "text-sm text-text-secondary",
|
|
449
|
-
children:
|
|
597
|
+
children: W("healthybowl.weather.overview.summary.high", "High")
|
|
450
598
|
}), /* @__PURE__ */ k("div", {
|
|
451
599
|
className: "flex items-center gap-1",
|
|
452
|
-
children: [/* @__PURE__ */ O(
|
|
600
|
+
children: [/* @__PURE__ */ O(de, { className: "h-3.5 w-3.5 text-status-error-text" }), /* @__PURE__ */ k("span", {
|
|
453
601
|
className: "font-medium text-text-primary",
|
|
454
|
-
children: [
|
|
602
|
+
children: [X.high, "°C"]
|
|
455
603
|
})]
|
|
456
604
|
})]
|
|
457
605
|
}),
|
|
@@ -459,12 +607,12 @@ var se = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ?
|
|
|
459
607
|
className: "flex items-center justify-between",
|
|
460
608
|
children: [/* @__PURE__ */ O("span", {
|
|
461
609
|
className: "text-sm text-text-secondary",
|
|
462
|
-
children:
|
|
610
|
+
children: W("healthybowl.weather.overview.summary.low", "Low")
|
|
463
611
|
}), /* @__PURE__ */ k("div", {
|
|
464
612
|
className: "flex items-center gap-1",
|
|
465
|
-
children: [/* @__PURE__ */ O(
|
|
613
|
+
children: [/* @__PURE__ */ O(ue, { className: "h-3.5 w-3.5 text-info" }), /* @__PURE__ */ k("span", {
|
|
466
614
|
className: "font-medium text-text-primary",
|
|
467
|
-
children: [
|
|
615
|
+
children: [X.low, "°C"]
|
|
468
616
|
})]
|
|
469
617
|
})]
|
|
470
618
|
}),
|
|
@@ -472,30 +620,30 @@ var se = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ?
|
|
|
472
620
|
className: "flex items-center justify-between",
|
|
473
621
|
children: [/* @__PURE__ */ O("span", {
|
|
474
622
|
className: "text-sm text-text-secondary",
|
|
475
|
-
children:
|
|
623
|
+
children: W("healthybowl.weather.overview.summary.precipitation", "Precipitation")
|
|
476
624
|
}), /* @__PURE__ */ k("span", {
|
|
477
625
|
className: "font-medium text-text-primary",
|
|
478
|
-
children: [
|
|
626
|
+
children: [X.precipitation, "%"]
|
|
479
627
|
})]
|
|
480
628
|
}),
|
|
481
629
|
/* @__PURE__ */ k("div", {
|
|
482
630
|
className: "flex items-center justify-between",
|
|
483
631
|
children: [/* @__PURE__ */ O("span", {
|
|
484
632
|
className: "text-sm text-text-secondary",
|
|
485
|
-
children:
|
|
633
|
+
children: W("healthybowl.weather.overview.summary.humidity", "Humidity")
|
|
486
634
|
}), /* @__PURE__ */ k("span", {
|
|
487
635
|
className: "font-medium text-text-primary",
|
|
488
|
-
children: [
|
|
636
|
+
children: [X.humidity, "%"]
|
|
489
637
|
})]
|
|
490
638
|
}),
|
|
491
639
|
/* @__PURE__ */ k("div", {
|
|
492
640
|
className: "flex items-center justify-between",
|
|
493
641
|
children: [/* @__PURE__ */ O("span", {
|
|
494
642
|
className: "text-sm text-text-secondary",
|
|
495
|
-
children:
|
|
643
|
+
children: W("healthybowl.weather.overview.summary.windSpeed", "Wind Speed")
|
|
496
644
|
}), /* @__PURE__ */ k("span", {
|
|
497
645
|
className: "font-medium text-text-primary",
|
|
498
|
-
children: [
|
|
646
|
+
children: [X.windSpeed, " km/h"]
|
|
499
647
|
})]
|
|
500
648
|
})
|
|
501
649
|
]
|
|
@@ -508,24 +656,24 @@ var se = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ?
|
|
|
508
656
|
className: "mb-4 flex items-center justify-between",
|
|
509
657
|
children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("h3", {
|
|
510
658
|
className: "text-base font-semibold text-text-primary",
|
|
511
|
-
children:
|
|
659
|
+
children: W("healthybowl.weather.overview.forecast.title", "7-Day Forecast")
|
|
512
660
|
}), /* @__PURE__ */ O("p", {
|
|
513
661
|
className: "text-xs text-text-secondary",
|
|
514
|
-
children:
|
|
662
|
+
children: W("healthybowl.weather.overview.forecast.subtitle", "Click on any day for detailed forecast")
|
|
515
663
|
})] }), /* @__PURE__ */ k(A, {
|
|
516
664
|
variant: "ghost",
|
|
517
665
|
size: "sm",
|
|
518
666
|
onClick: () => H(U("weather/forecast")),
|
|
519
667
|
className: "gap-1 text-text-secondary hover:text-text-primary",
|
|
520
668
|
children: [
|
|
521
|
-
|
|
669
|
+
W("healthybowl.weather.overview.forecast.viewExtended", "View Extended Forecast"),
|
|
522
670
|
" ",
|
|
523
|
-
/* @__PURE__ */ O(
|
|
671
|
+
/* @__PURE__ */ O(_, { className: "h-3.5 w-3.5" })
|
|
524
672
|
]
|
|
525
673
|
})]
|
|
526
674
|
}), /* @__PURE__ */ O("div", {
|
|
527
675
|
className: "space-y-2",
|
|
528
|
-
children:
|
|
676
|
+
children: q.slice(0, 7).map((e, t) => {
|
|
529
677
|
let n = j(e.condition);
|
|
530
678
|
return /* @__PURE__ */ k("div", {
|
|
531
679
|
onClick: () => H(U("weather/forecast")),
|
|
@@ -535,7 +683,7 @@ var se = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ?
|
|
|
535
683
|
children: [
|
|
536
684
|
/* @__PURE__ */ O("span", {
|
|
537
685
|
className: "w-14 text-sm font-medium text-text-primary",
|
|
538
|
-
children: t === 0 ?
|
|
686
|
+
children: t === 0 ? W("healthybowl.weather.overview.forecast.today", "Today") : new Date(e.date).toLocaleDateString("en-US", { weekday: "short" })
|
|
539
687
|
}),
|
|
540
688
|
/* @__PURE__ */ O(n, { className: "h-5 w-5 text-text-secondary" }),
|
|
541
689
|
/* @__PURE__ */ O("span", {
|
|
@@ -547,7 +695,7 @@ var se = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ?
|
|
|
547
695
|
className: "flex items-center gap-4 text-sm",
|
|
548
696
|
children: [/* @__PURE__ */ k("div", {
|
|
549
697
|
className: "flex items-center gap-1",
|
|
550
|
-
children: [/* @__PURE__ */ O(
|
|
698
|
+
children: [/* @__PURE__ */ O(b, { className: "h-3 w-3 text-info" }), /* @__PURE__ */ k("span", {
|
|
551
699
|
className: "text-text-primary",
|
|
552
700
|
children: [e.precipitation, "%"]
|
|
553
701
|
})]
|
|
@@ -573,15 +721,15 @@ var se = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ?
|
|
|
573
721
|
children: [
|
|
574
722
|
/* @__PURE__ */ O("h3", {
|
|
575
723
|
className: "text-base font-semibold text-text-primary",
|
|
576
|
-
children:
|
|
724
|
+
children: W("healthybowl.weather.overview.recommendations.title", "Farming Recommendations")
|
|
577
725
|
}),
|
|
578
726
|
/* @__PURE__ */ O("p", {
|
|
579
727
|
className: "text-xs text-text-secondary",
|
|
580
|
-
children:
|
|
728
|
+
children: W("healthybowl.weather.overview.recommendations.subtitle", "AI-powered insights based on current conditions")
|
|
581
729
|
}),
|
|
582
730
|
/* @__PURE__ */ O("div", {
|
|
583
731
|
className: "mt-4 space-y-3",
|
|
584
|
-
children:
|
|
732
|
+
children: Xe.map((e) => {
|
|
585
733
|
let t = e.icon;
|
|
586
734
|
return /* @__PURE__ */ k("div", {
|
|
587
735
|
className: "flex items-start gap-3 rounded-lg bg-bg-sunken/50 p-3",
|
|
@@ -601,15 +749,15 @@ var se = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ?
|
|
|
601
749
|
children: [
|
|
602
750
|
/* @__PURE__ */ O("h3", {
|
|
603
751
|
className: "text-base font-semibold text-text-primary",
|
|
604
|
-
children:
|
|
752
|
+
children: W("healthybowl.weather.overview.impact.title", "Weather Impact Analysis")
|
|
605
753
|
}),
|
|
606
754
|
/* @__PURE__ */ O("p", {
|
|
607
755
|
className: "text-xs text-text-secondary",
|
|
608
|
-
children:
|
|
756
|
+
children: W("healthybowl.weather.overview.impact.subtitle", "Impact on farming operations")
|
|
609
757
|
}),
|
|
610
758
|
/* @__PURE__ */ O("div", {
|
|
611
759
|
className: "mt-4 space-y-4",
|
|
612
|
-
children:
|
|
760
|
+
children: Ze.map(({ id: e, label: t, level: n, percent: r, color: i }) => /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ k("div", {
|
|
613
761
|
className: "mb-1.5 flex items-center justify-between",
|
|
614
762
|
children: [/* @__PURE__ */ O("span", {
|
|
615
763
|
className: "text-sm font-medium text-text-primary",
|
|
@@ -628,57 +776,250 @@ var se = (e) => e === "extreme" || e === "severe" ? "error" : e === "moderate" ?
|
|
|
628
776
|
})
|
|
629
777
|
]
|
|
630
778
|
})]
|
|
779
|
+
}),
|
|
780
|
+
/* @__PURE__ */ k("div", {
|
|
781
|
+
className: "grid grid-cols-1 gap-4 lg:grid-cols-3",
|
|
782
|
+
children: [
|
|
783
|
+
/* @__PURE__ */ k("div", {
|
|
784
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
785
|
+
children: [/* @__PURE__ */ k("div", {
|
|
786
|
+
className: "mb-3 flex items-center justify-between",
|
|
787
|
+
children: [/* @__PURE__ */ k("div", {
|
|
788
|
+
className: "flex items-center gap-2",
|
|
789
|
+
children: [/* @__PURE__ */ O(le, { className: "h-4 w-4 text-info" }), /* @__PURE__ */ O("h3", {
|
|
790
|
+
className: "text-sm font-semibold text-text-primary",
|
|
791
|
+
children: W("healthybowl.weather.overview.anomaly.title", "Anomaly Detector")
|
|
792
|
+
})]
|
|
793
|
+
}), /* @__PURE__ */ k(A, {
|
|
794
|
+
variant: "ghost",
|
|
795
|
+
size: "sm",
|
|
796
|
+
onClick: () => H(U("weather/anomaly")),
|
|
797
|
+
className: "gap-1 text-text-secondary hover:text-text-primary",
|
|
798
|
+
children: [W("healthybowl.weather.overview.anomaly.view", "View report"), /* @__PURE__ */ O(_, { className: "h-3.5 w-3.5" })]
|
|
799
|
+
})]
|
|
800
|
+
}), Ae && !F ? /* @__PURE__ */ k("div", {
|
|
801
|
+
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
802
|
+
children: [/* @__PURE__ */ O(x, { className: "h-4 w-4 animate-spin" }), W("healthybowl.common.loading", "Loading…")]
|
|
803
|
+
}) : je ? /* @__PURE__ */ O("p", {
|
|
804
|
+
className: "text-sm text-status-error-text",
|
|
805
|
+
children: W("healthybowl.weather.overview.anomaly.error", "Could not load the anomaly report.")
|
|
806
|
+
}) : F ? /* @__PURE__ */ k(D, { children: [
|
|
807
|
+
$e.length > 0 && /* @__PURE__ */ O("div", {
|
|
808
|
+
className: "h-16 w-full",
|
|
809
|
+
children: /* @__PURE__ */ O(s, {
|
|
810
|
+
width: "100%",
|
|
811
|
+
height: "100%",
|
|
812
|
+
children: /* @__PURE__ */ O(c, {
|
|
813
|
+
data: $e,
|
|
814
|
+
margin: {
|
|
815
|
+
top: 4,
|
|
816
|
+
right: 0,
|
|
817
|
+
bottom: 0,
|
|
818
|
+
left: 0
|
|
819
|
+
},
|
|
820
|
+
children: /* @__PURE__ */ O(oe, {
|
|
821
|
+
type: "monotone",
|
|
822
|
+
dataKey: "value",
|
|
823
|
+
stroke: "var(--color-info)",
|
|
824
|
+
fill: "var(--color-info)",
|
|
825
|
+
fillOpacity: .15,
|
|
826
|
+
strokeWidth: 2,
|
|
827
|
+
isAnimationActive: !1
|
|
828
|
+
})
|
|
829
|
+
})
|
|
830
|
+
})
|
|
831
|
+
}),
|
|
832
|
+
/* @__PURE__ */ O("p", {
|
|
833
|
+
className: "mt-3 text-sm text-text-primary",
|
|
834
|
+
children: $ < 0 ? W("healthybowl.weather.overview.anomaly.rainfallBelow", "Rainfall {{pct}}% below normal this month", { pct: Math.abs($) }) : $ > 0 ? W("healthybowl.weather.overview.anomaly.rainfallAbove", "Rainfall {{pct}}% above normal this month", { pct: $ }) : W("healthybowl.weather.overview.anomaly.rainfallNormal", "Rainfall is close to normal this month")
|
|
835
|
+
}),
|
|
836
|
+
/* @__PURE__ */ O("p", {
|
|
837
|
+
className: "mt-1 text-xs text-text-secondary",
|
|
838
|
+
children: W("healthybowl.weather.overview.anomaly.detail", "{{current}}mm so far vs {{baseline}}mm baseline for {{month}}", {
|
|
839
|
+
current: Math.round(F.rainfallThisMonthMm),
|
|
840
|
+
baseline: Math.round(F.rainfallBaselineMm),
|
|
841
|
+
month: F.currentMonthName
|
|
842
|
+
})
|
|
843
|
+
})
|
|
844
|
+
] }) : /* @__PURE__ */ O(a, {
|
|
845
|
+
illustration: "empty-generic",
|
|
846
|
+
title: W("healthybowl.weather.overview.anomaly.empty.title", "No anomaly data yet"),
|
|
847
|
+
description: W("healthybowl.weather.overview.anomaly.empty.description", "Sync weather history to compare this season against your baseline.")
|
|
848
|
+
})]
|
|
849
|
+
}),
|
|
850
|
+
/* @__PURE__ */ k("div", {
|
|
851
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
852
|
+
children: [/* @__PURE__ */ k("div", {
|
|
853
|
+
className: "mb-3 flex items-center justify-between",
|
|
854
|
+
children: [/* @__PURE__ */ k("div", {
|
|
855
|
+
className: "flex items-center gap-2",
|
|
856
|
+
children: [/* @__PURE__ */ O(g, { className: "h-4 w-4 text-info" }), /* @__PURE__ */ O("h3", {
|
|
857
|
+
className: "text-sm font-semibold text-text-primary",
|
|
858
|
+
children: W("healthybowl.weather.overview.frostCalendar.title", "Frost-Risk Calendar")
|
|
859
|
+
})]
|
|
860
|
+
}), /* @__PURE__ */ k(A, {
|
|
861
|
+
variant: "ghost",
|
|
862
|
+
size: "sm",
|
|
863
|
+
onClick: () => H(U("weather/calendar")),
|
|
864
|
+
className: "gap-1 text-text-secondary hover:text-text-primary",
|
|
865
|
+
children: [W("healthybowl.weather.overview.frostCalendar.view", "Open"), /* @__PURE__ */ O(_, { className: "h-3.5 w-3.5" })]
|
|
866
|
+
})]
|
|
867
|
+
}), Me && !I ? /* @__PURE__ */ k("div", {
|
|
868
|
+
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
869
|
+
children: [/* @__PURE__ */ O(x, { className: "h-4 w-4 animate-spin" }), W("healthybowl.common.loading", "Loading…")]
|
|
870
|
+
}) : Ne ? /* @__PURE__ */ O("p", {
|
|
871
|
+
className: "text-sm text-status-error-text",
|
|
872
|
+
children: W("healthybowl.weather.overview.frostCalendar.error", "Could not load the frost-risk calendar.")
|
|
873
|
+
}) : !I || I.days.length === 0 ? /* @__PURE__ */ O(a, {
|
|
874
|
+
illustration: "empty-generic",
|
|
875
|
+
title: W("healthybowl.weather.overview.frostCalendar.empty.title", "No calendar data"),
|
|
876
|
+
description: W("healthybowl.weather.overview.frostCalendar.empty.description", "Frost-risk days appear here once forecasts and history are available.")
|
|
877
|
+
}) : /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ k("p", {
|
|
878
|
+
className: "mb-2 text-xs text-text-secondary",
|
|
879
|
+
children: [
|
|
880
|
+
I.monthName,
|
|
881
|
+
" ·",
|
|
882
|
+
" ",
|
|
883
|
+
W("healthybowl.weather.overview.frostCalendar.count", "{{count}} frost-risk days", { count: I.frostRiskDayCount })
|
|
884
|
+
]
|
|
885
|
+
}), /* @__PURE__ */ k("div", {
|
|
886
|
+
className: "grid grid-cols-7 gap-1",
|
|
887
|
+
children: [Array.from({ length: (() => {
|
|
888
|
+
let e = new Date(I.days[0].date);
|
|
889
|
+
return Number.isNaN(e.getTime()) ? 0 : e.getDay();
|
|
890
|
+
})() }).map((e, t) => /* @__PURE__ */ O("div", { "aria-hidden": !0 }, `spacer-${t}`)), I.days.map((e) => /* @__PURE__ */ O("div", {
|
|
891
|
+
title: e.detail ?? e.label,
|
|
892
|
+
className: `flex aspect-square items-center justify-center rounded text-[11px] font-medium ${De(e.risk)}`,
|
|
893
|
+
children: e.day
|
|
894
|
+
}, e.date))]
|
|
895
|
+
})] })]
|
|
896
|
+
}),
|
|
897
|
+
/* @__PURE__ */ k("div", {
|
|
898
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
899
|
+
children: [/* @__PURE__ */ k("div", {
|
|
900
|
+
className: "mb-3 flex items-center justify-between",
|
|
901
|
+
children: [/* @__PURE__ */ k("div", {
|
|
902
|
+
className: "flex items-center gap-2",
|
|
903
|
+
children: [/* @__PURE__ */ O(ye, { className: "h-4 w-4 text-info" }), /* @__PURE__ */ O("h3", {
|
|
904
|
+
className: "text-sm font-semibold text-text-primary",
|
|
905
|
+
children: W("healthybowl.weather.overview.alertRules.title", "Automated Alert Rules")
|
|
906
|
+
})]
|
|
907
|
+
}), /* @__PURE__ */ k(A, {
|
|
908
|
+
variant: "ghost",
|
|
909
|
+
size: "sm",
|
|
910
|
+
onClick: () => H(U("weather/alert-rules")),
|
|
911
|
+
className: "gap-1 text-text-secondary hover:text-text-primary",
|
|
912
|
+
children: [W("healthybowl.weather.overview.alertRules.view", "Manage"), /* @__PURE__ */ O(_, { className: "h-3.5 w-3.5" })]
|
|
913
|
+
})]
|
|
914
|
+
}), Ie && R.length === 0 ? /* @__PURE__ */ k("div", {
|
|
915
|
+
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
916
|
+
children: [/* @__PURE__ */ O(x, { className: "h-4 w-4 animate-spin" }), W("healthybowl.common.loading", "Loading…")]
|
|
917
|
+
}) : Le ? /* @__PURE__ */ O("p", {
|
|
918
|
+
className: "text-sm text-status-error-text",
|
|
919
|
+
children: W("healthybowl.weather.overview.alertRules.error", "Could not load alert rules.")
|
|
920
|
+
}) : R.length === 0 ? /* @__PURE__ */ O(a, {
|
|
921
|
+
illustration: "empty-generic",
|
|
922
|
+
title: W("healthybowl.weather.overview.alertRules.empty.title", "No alert rules yet"),
|
|
923
|
+
description: W("healthybowl.weather.overview.alertRules.empty.description", "Create FluidGrids rules to get warned about frost, storms and heat.")
|
|
924
|
+
}) : /* @__PURE__ */ O("div", {
|
|
925
|
+
className: "space-y-2",
|
|
926
|
+
children: R.slice(0, 4).map((e) => /* @__PURE__ */ k("div", {
|
|
927
|
+
className: "flex items-center justify-between gap-2 rounded-lg bg-bg-sunken/50 px-3 py-2",
|
|
928
|
+
children: [/* @__PURE__ */ k("div", {
|
|
929
|
+
className: "min-w-0",
|
|
930
|
+
children: [/* @__PURE__ */ O("p", {
|
|
931
|
+
className: "truncate text-sm font-medium text-text-primary",
|
|
932
|
+
children: e.name
|
|
933
|
+
}), /* @__PURE__ */ k("p", {
|
|
934
|
+
className: "truncate text-xs text-text-secondary",
|
|
935
|
+
children: [
|
|
936
|
+
e.metric,
|
|
937
|
+
" ",
|
|
938
|
+
e.operator,
|
|
939
|
+
" ",
|
|
940
|
+
e.threshold,
|
|
941
|
+
e.unit ?? ""
|
|
942
|
+
]
|
|
943
|
+
})]
|
|
944
|
+
}), /* @__PURE__ */ O(i, {
|
|
945
|
+
label: e.status === "active" ? W("healthybowl.weather.overview.alertRules.active", "Active") : W("healthybowl.weather.overview.alertRules.paused", "Paused"),
|
|
946
|
+
variant: e.status === "active" ? "success" : "default"
|
|
947
|
+
})]
|
|
948
|
+
}, e.id))
|
|
949
|
+
})]
|
|
950
|
+
})
|
|
951
|
+
]
|
|
952
|
+
}),
|
|
953
|
+
/* @__PURE__ */ k("div", {
|
|
954
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
955
|
+
children: [
|
|
956
|
+
/* @__PURE__ */ O(r, {
|
|
957
|
+
label: W("healthybowl.weather.overview.stats.frostDays", "Frost days this season"),
|
|
958
|
+
value: Ae && !F ? "—" : F ? F.frostDaysThisSeason : "—",
|
|
959
|
+
icon: /* @__PURE__ */ O(C, { className: "h-4 w-4" })
|
|
960
|
+
}),
|
|
961
|
+
/* @__PURE__ */ O(r, {
|
|
962
|
+
label: W("healthybowl.weather.overview.stats.wettestMonth", "Wettest month"),
|
|
963
|
+
value: Fe && !L ? "—" : Q ? `${Q.monthName} ${Math.round(Q.avgRainfall)}mm` : "—",
|
|
964
|
+
icon: /* @__PURE__ */ O(pe, { className: "h-4 w-4" })
|
|
965
|
+
}),
|
|
966
|
+
/* @__PURE__ */ O(r, {
|
|
967
|
+
label: W("healthybowl.weather.overview.stats.firstFrost", "Historical avg first-frost"),
|
|
968
|
+
value: Me && !I ? "—" : tt ?? "—",
|
|
969
|
+
icon: /* @__PURE__ */ O(h, { className: "h-4 w-4" })
|
|
970
|
+
})
|
|
971
|
+
]
|
|
631
972
|
})
|
|
632
973
|
] }),
|
|
633
|
-
/* @__PURE__ */ O(
|
|
634
|
-
open:
|
|
635
|
-
onClose: () =>
|
|
636
|
-
title:
|
|
637
|
-
description:
|
|
974
|
+
/* @__PURE__ */ O(o, {
|
|
975
|
+
open: Re,
|
|
976
|
+
onClose: () => ze(!1),
|
|
977
|
+
title: W("healthybowl.weather.overview.map.title", "Weather Map"),
|
|
978
|
+
description: Y ? W("healthybowl.weather.overview.map.descriptionNear", "Live precipitation radar near {{location}}", { location: Y }) : W("healthybowl.weather.overview.map.description", "Live precipitation radar"),
|
|
638
979
|
size: "xl",
|
|
639
|
-
children:
|
|
640
|
-
location:
|
|
641
|
-
center:
|
|
980
|
+
children: Re && /* @__PURE__ */ O(ie, {
|
|
981
|
+
location: Y,
|
|
982
|
+
center: Ke
|
|
642
983
|
})
|
|
643
984
|
}),
|
|
644
|
-
/* @__PURE__ */ O(
|
|
645
|
-
open:
|
|
646
|
-
onClose: () =>
|
|
647
|
-
title:
|
|
648
|
-
description:
|
|
985
|
+
/* @__PURE__ */ O(o, {
|
|
986
|
+
open: Be,
|
|
987
|
+
onClose: () => z(!1),
|
|
988
|
+
title: W("healthybowl.weather.overview.location.modal.title", "Set farm location"),
|
|
989
|
+
description: W("healthybowl.weather.overview.location.modal.description", "Enter your farm’s town, city, or region. We use it to fetch local weather and forecasts."),
|
|
649
990
|
size: "md",
|
|
650
991
|
footer: /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(A, {
|
|
651
992
|
variant: "outline",
|
|
652
|
-
onClick: () =>
|
|
653
|
-
children:
|
|
993
|
+
onClick: () => z(!1),
|
|
994
|
+
children: W("healthybowl.common.cancel", "Cancel")
|
|
654
995
|
}), /* @__PURE__ */ k(A, {
|
|
655
|
-
onClick:
|
|
656
|
-
disabled:
|
|
657
|
-
children: [
|
|
996
|
+
onClick: Ye,
|
|
997
|
+
disabled: V,
|
|
998
|
+
children: [V && /* @__PURE__ */ O(x, { className: "h-4 w-4 animate-spin" }), V ? W("healthybowl.weather.overview.location.modal.saving", "Saving…") : W("healthybowl.weather.overview.location.modal.save", "Save location")]
|
|
658
999
|
})] }),
|
|
659
1000
|
children: /* @__PURE__ */ k("div", { children: [
|
|
660
1001
|
/* @__PURE__ */ O("label", {
|
|
661
1002
|
htmlFor: "weather-location",
|
|
662
1003
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
663
|
-
children:
|
|
1004
|
+
children: W("healthybowl.weather.overview.location.field.label", "Farm location")
|
|
664
1005
|
}),
|
|
665
1006
|
/* @__PURE__ */ O("input", {
|
|
666
1007
|
id: "weather-location",
|
|
667
1008
|
type: "text",
|
|
668
|
-
value:
|
|
669
|
-
onChange: (e) =>
|
|
670
|
-
placeholder:
|
|
1009
|
+
value: B,
|
|
1010
|
+
onChange: (e) => Ve(e.target.value),
|
|
1011
|
+
placeholder: W("healthybowl.weather.overview.location.field.placeholder", "e.g., Pune, Maharashtra"),
|
|
671
1012
|
className: "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
672
1013
|
}),
|
|
673
1014
|
/* @__PURE__ */ O("p", {
|
|
674
1015
|
className: "mt-1 text-xs text-text-secondary",
|
|
675
|
-
children:
|
|
1016
|
+
children: W("healthybowl.weather.overview.location.field.helper", "We resolve coordinates automatically so the forecast reflects this exact place.")
|
|
676
1017
|
})
|
|
677
1018
|
] })
|
|
678
1019
|
}),
|
|
679
|
-
/* @__PURE__ */ O(
|
|
680
|
-
toasts:
|
|
681
|
-
onDismiss:
|
|
1020
|
+
/* @__PURE__ */ O(te, {
|
|
1021
|
+
toasts: We,
|
|
1022
|
+
onDismiss: Ge
|
|
682
1023
|
})
|
|
683
1024
|
]
|
|
684
1025
|
});
|