@burdenoff/microfe-healthybowl 2026.802.1 → 2026.802.2
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/healthybowl/components/FieldMap.js +220 -220
- package/dist/healthybowl/components/FieldMap.js.map +1 -1
- package/dist/healthybowl/components/WeatherMap.js +87 -86
- package/dist/healthybowl/components/WeatherMap.js.map +1 -1
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js +195 -185
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/fields/FieldMapPage.js +723 -723
- package/dist/healthybowl/pages/fields/FieldMapPage.js.map +1 -1
- package/dist/healthybowl/pages/satellite/NdviHeatmapMap.js +19 -19
- package/dist/healthybowl/utils/geo.js +4 -1
- package/dist/healthybowl/utils/geo.js.map +1 -1
- package/dist/healthybowl/utils/index.js +1 -1
- package/package.json +1 -1
|
@@ -9,31 +9,32 @@ import { useConfirm as ne } from "../../components/ConfirmDialog.js";
|
|
|
9
9
|
import { Breadcrumbs as re } from "../../components/Breadcrumbs.js";
|
|
10
10
|
import { PageLoader as ie } from "../../components/PageLoader.js";
|
|
11
11
|
import { Modal as ae } from "../../components/Modal.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
12
|
+
import { isUsableCoordinate as oe } from "../../utils/geo.js";
|
|
13
|
+
import { useToast as se } from "../../hooks/useToast.js";
|
|
14
|
+
import { FieldMap as ce } from "../../components/FieldMap.js";
|
|
15
|
+
import { CreateFarmTaskButton as le } from "../../components/CreateFarmTaskButton.js";
|
|
15
16
|
import "../../components/index.js";
|
|
16
|
-
import { useHealthyBowlData as
|
|
17
|
-
import { usePlantCatalog as
|
|
18
|
-
import { DEFAULT_BED_WIDTH_M as
|
|
19
|
-
import { useSuccessionPlanning as
|
|
20
|
-
import { computeSeedRate as
|
|
21
|
-
import { buildCropComparison as
|
|
22
|
-
import { useCallback as
|
|
23
|
-
import { useI18n as
|
|
24
|
-
import { Activity as
|
|
25
|
-
import { useNavigate as
|
|
26
|
-
import { Fragment as
|
|
27
|
-
import { Button as d, GlassCard as
|
|
17
|
+
import { useHealthyBowlData as ue } from "../../hooks/useHealthyBowlData.js";
|
|
18
|
+
import { usePlantCatalog as de } from "../../hooks/usePlantCatalog.js";
|
|
19
|
+
import { DEFAULT_BED_WIDTH_M as fe, DEFAULT_CROP_SPACING_PRESET as pe, DEFAULT_PATH_WIDTH_M as me, estimatePlantingCapacity as he, getCropSpacingPreset as ge } from "../../utils/plantingCapacity.js";
|
|
20
|
+
import { useSuccessionPlanning as _e } from "../../hooks/useSuccessionPlanning.js";
|
|
21
|
+
import { computeSeedRate as ve } from "../../utils/seedRate.js";
|
|
22
|
+
import { buildCropComparison as ye, sortCropComparison as be } from "../../utils/cropComparison.js";
|
|
23
|
+
import { useCallback as xe, useEffect as Se, useMemo as o, useState as s } from "react";
|
|
24
|
+
import { useI18n as Ce } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
25
|
+
import { Activity as we, ArrowLeft as Te, BarChart3 as Ee, Calendar as De, ChevronDown as c, ChevronUp as Oe, CloudRain as ke, Droplets as Ae, Edit as je, Eye as Me, Leaf as Ne, Map as Pe, Plus as Fe, Sprout as Ie, Sun as Le, Table2 as Re, Thermometer as ze, Trash2 as Be, TrendingUp as Ve, Wind as He } from "lucide-react";
|
|
26
|
+
import { useNavigate as Ue, useParams as We } from "react-router";
|
|
27
|
+
import { Fragment as Ge, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
28
|
+
import { Button as d, GlassCard as Ke, Select as f, SelectContent as p, SelectItem as m, SelectTrigger as h, SelectValue as g } from "@burdenoff/fe-libs/ui";
|
|
28
29
|
//#region src/healthybowl/pages/crops/FieldDetailsPage.tsx
|
|
29
|
-
var
|
|
30
|
+
var qe = (e) => {
|
|
30
31
|
switch (e) {
|
|
31
32
|
case "active": return "success";
|
|
32
33
|
case "fallow": return "muted";
|
|
33
34
|
case "preparation": return "warning";
|
|
34
35
|
default: return "default";
|
|
35
36
|
}
|
|
36
|
-
},
|
|
37
|
+
}, Je = (e) => {
|
|
37
38
|
switch (e) {
|
|
38
39
|
case "optimal": return "success";
|
|
39
40
|
case "acceptable": return "info";
|
|
@@ -43,15 +44,21 @@ var Ke = (e) => {
|
|
|
43
44
|
}, _ = (e, t) => {
|
|
44
45
|
let n = Number(e);
|
|
45
46
|
return Number.isFinite(n) && n > 0 ? n : t;
|
|
46
|
-
},
|
|
47
|
+
}, Ye = (e, t) => {
|
|
47
48
|
let n = Number(e);
|
|
48
49
|
return Number.isFinite(n) && n >= 0 ? n : t;
|
|
49
|
-
}, v = (e, t = 1) => new Intl.NumberFormat("en-US", { maximumFractionDigits: t }).format(e),
|
|
50
|
-
let { t: c } =
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
}, v = (e, t = 1) => new Intl.NumberFormat("en-US", { maximumFractionDigits: t }).format(e), Xe = () => {
|
|
51
|
+
let { t: c } = Ce(), Oe = ne(), { fields: Xe, crops: S, soilTests: Ze, weatherData: Qe, errors: $e, loadings: et, updateField: tt, deleteField: nt, refetch: rt } = ue(), { fieldId: it } = We(), C = Ue(), { buildPath: w } = n(), { toasts: at, toast: T, dismiss: ot } = se(), [st, E] = s(!1), [ct, D] = s(!1), O = Xe.find((e) => e.id === it), lt = o(() => {
|
|
52
|
+
let e = O?.location, t = {
|
|
53
|
+
lat: Number(e?.lat),
|
|
54
|
+
lng: Number(e?.lng)
|
|
55
|
+
};
|
|
56
|
+
return oe(t) ? t : null;
|
|
57
|
+
}, [O]), [k, ut] = s(""), [A, dt] = s(""), [ft, pt] = s("acres"), [mt, ht] = s(""), [gt, _t] = s(""), [vt, yt] = s("active"), [bt, xt] = s(!1), [j, St] = s(""), { entries: M } = de(), [N, Ct] = s(""), [wt, P] = s(String(pe.plantSpacingCm)), [Tt, F] = s(String(pe.rowSpacingCm)), [I, Et] = s(String(fe)), [L, Dt] = s(String(me)), [R, Ot] = s(null), kt = () => {
|
|
58
|
+
O && (ut(O.name), dt(String(O.area)), pt(O.unit ?? "acres"), ht(O.soilType), _t(O.irrigationType), yt(O.status), xt(O.organicCertified), E(!0));
|
|
59
|
+
}, At = async () => {
|
|
53
60
|
if (O) {
|
|
54
|
-
if (!k.trim() || !
|
|
61
|
+
if (!k.trim() || !A) {
|
|
55
62
|
T({
|
|
56
63
|
title: c("healthybowl.crops.fieldDetail.toast.missingFields.title", "Missing required fields"),
|
|
57
64
|
description: c("healthybowl.crops.fieldDetail.toast.missingFields.description", "Name and area are required."),
|
|
@@ -61,15 +68,15 @@ var Ke = (e) => {
|
|
|
61
68
|
}
|
|
62
69
|
D(!0);
|
|
63
70
|
try {
|
|
64
|
-
await
|
|
71
|
+
await tt({
|
|
65
72
|
id: O.id,
|
|
66
73
|
name: k.trim(),
|
|
67
|
-
area: Number(
|
|
68
|
-
unit:
|
|
69
|
-
soilType:
|
|
70
|
-
irrigationType:
|
|
71
|
-
status:
|
|
72
|
-
organicCertified:
|
|
74
|
+
area: Number(A),
|
|
75
|
+
unit: ft,
|
|
76
|
+
soilType: mt.trim() || "Unknown",
|
|
77
|
+
irrigationType: gt.trim() || "None",
|
|
78
|
+
status: vt,
|
|
79
|
+
organicCertified: bt
|
|
73
80
|
}), T({
|
|
74
81
|
title: c("healthybowl.crops.fieldDetail.toast.updated.title", "Field updated"),
|
|
75
82
|
description: c("healthybowl.crops.fieldDetail.toast.updated.description", "{{name}} has been saved.", { name: k.trim() }),
|
|
@@ -85,8 +92,8 @@ var Ke = (e) => {
|
|
|
85
92
|
D(!1);
|
|
86
93
|
}
|
|
87
94
|
}
|
|
88
|
-
},
|
|
89
|
-
if (O && await
|
|
95
|
+
}, jt = async () => {
|
|
96
|
+
if (O && await Oe({
|
|
90
97
|
title: c("healthybowl.crops.fieldDetail.deleteConfirm.title", "Delete field?"),
|
|
91
98
|
message: c("healthybowl.crops.fieldDetail.deleteConfirm.message", "{{name}} will be permanently removed.", { name: O.name }),
|
|
92
99
|
okButtonTitle: c("healthybowl.common.delete", "Delete"),
|
|
@@ -94,7 +101,7 @@ var Ke = (e) => {
|
|
|
94
101
|
}) !== !1) {
|
|
95
102
|
D(!0);
|
|
96
103
|
try {
|
|
97
|
-
await
|
|
104
|
+
await nt(O.id), T({
|
|
98
105
|
title: c("healthybowl.crops.fieldDetail.toast.deleted.title", "Field deleted"),
|
|
99
106
|
description: c("healthybowl.crops.fieldDetail.toast.deleted.description", "{{name}} has been removed.", { name: O.name }),
|
|
100
107
|
variant: "success"
|
|
@@ -110,92 +117,92 @@ var Ke = (e) => {
|
|
|
110
117
|
}, z = o(() => O ? S.filter((e) => e.field === O.id || e.fieldName === O.name) : [], [S, O]), B = o(() => {
|
|
111
118
|
let e = /* @__PURE__ */ new Set();
|
|
112
119
|
return [...z, ...S].filter((t) => !e.has(t.id) && !!e.add(t.id));
|
|
113
|
-
}, [S, z]),
|
|
114
|
-
|
|
120
|
+
}, [S, z]), Mt = o(() => z[0] ?? B[0] ?? null, [B, z]), V = o(() => B.find((e) => e.id === j) ?? Mt, [
|
|
121
|
+
j,
|
|
115
122
|
B,
|
|
116
|
-
|
|
117
|
-
]), H = o(() =>
|
|
123
|
+
Mt
|
|
124
|
+
]), H = o(() => ge(V), [V]), U = R != null && R > 0 ? R : O?.area ?? 0, Nt = R != null && R > 0, W = o(() => O ? he({
|
|
118
125
|
fieldArea: U,
|
|
119
126
|
fieldUnit: O.unit,
|
|
120
|
-
bedWidthM: _(I,
|
|
121
|
-
pathWidthM:
|
|
122
|
-
plantSpacingCm: _(
|
|
123
|
-
rowSpacingCm: _(
|
|
127
|
+
bedWidthM: _(I, fe),
|
|
128
|
+
pathWidthM: Ye(L, me),
|
|
129
|
+
plantSpacingCm: _(wt, H.plantSpacingCm),
|
|
130
|
+
rowSpacingCm: _(Tt, H.rowSpacingCm)
|
|
124
131
|
}) : null, [
|
|
125
132
|
I,
|
|
126
133
|
U,
|
|
127
134
|
O,
|
|
128
135
|
L,
|
|
129
|
-
|
|
130
|
-
|
|
136
|
+
wt,
|
|
137
|
+
Tt,
|
|
131
138
|
H
|
|
132
139
|
]);
|
|
133
|
-
|
|
134
|
-
if (!V ||
|
|
135
|
-
let e =
|
|
136
|
-
|
|
137
|
-
}, [
|
|
138
|
-
let
|
|
140
|
+
Se(() => {
|
|
141
|
+
if (!V || j === V.id) return;
|
|
142
|
+
let e = ge(V);
|
|
143
|
+
St(V.id), P(String(e.plantSpacingCm)), F(String(e.rowSpacingCm));
|
|
144
|
+
}, [j, V]);
|
|
145
|
+
let Pt = (e) => {
|
|
139
146
|
let t = B.find((t) => t.id === e);
|
|
140
|
-
|
|
141
|
-
let n =
|
|
147
|
+
St(e), Ct("");
|
|
148
|
+
let n = ge(t);
|
|
142
149
|
P(String(n.plantSpacingCm)), F(String(n.rowSpacingCm));
|
|
143
|
-
},
|
|
144
|
-
if (
|
|
145
|
-
|
|
150
|
+
}, Ft = (e) => {
|
|
151
|
+
if (Ct(e), e === "none") {
|
|
152
|
+
Ct("");
|
|
146
153
|
return;
|
|
147
154
|
}
|
|
148
|
-
let t =
|
|
155
|
+
let t = M.find((t) => t.id === e);
|
|
149
156
|
t && (t.plantSpacingCm != null && P(String(t.plantSpacingCm)), t.rowSpacingCm != null && F(String(t.rowSpacingCm)));
|
|
150
157
|
}, G = o(() => {
|
|
151
|
-
let e =
|
|
158
|
+
let e = N ? M.find((e) => e.id === N) : void 0;
|
|
152
159
|
if (e) return e;
|
|
153
160
|
if (!V) return;
|
|
154
161
|
let t = (V.name ?? "").trim().toLowerCase();
|
|
155
162
|
if (!t) return;
|
|
156
163
|
let n = (V.variety ?? "").trim().toLowerCase();
|
|
157
|
-
return
|
|
164
|
+
return M.find((e) => (e.name ?? "").trim().toLowerCase() === t && (e.variety ?? "").trim().toLowerCase() === n) ?? M.find((e) => (e.name ?? "").trim().toLowerCase() === t);
|
|
158
165
|
}, [
|
|
166
|
+
N,
|
|
159
167
|
M,
|
|
160
|
-
j,
|
|
161
168
|
V
|
|
162
|
-
]), K = o(() => W ?
|
|
169
|
+
]), K = o(() => W ? ve({
|
|
163
170
|
plantsNeeded: W.totalPlants,
|
|
164
171
|
seedsPerGram: G?.seedsPerGram,
|
|
165
172
|
germinationRate: G?.germinationRate,
|
|
166
173
|
seedsPerCell: G?.seedsPerCell
|
|
167
|
-
}) : null, [W, G]), [q,
|
|
174
|
+
}) : null, [W, G]), [q, It] = s("label"), [J, Lt] = s("asc"), Rt = o(() => !O || M.length === 0 ? [] : ye(M, {
|
|
168
175
|
fieldArea: U,
|
|
169
176
|
fieldUnit: O.unit,
|
|
170
|
-
bedWidthM: _(I,
|
|
171
|
-
pathWidthM:
|
|
177
|
+
bedWidthM: _(I, fe),
|
|
178
|
+
pathWidthM: Ye(L, me)
|
|
172
179
|
}), [
|
|
173
180
|
I,
|
|
174
181
|
U,
|
|
175
182
|
O,
|
|
176
183
|
L,
|
|
177
|
-
|
|
178
|
-
]), Y = o(() =>
|
|
179
|
-
|
|
184
|
+
M
|
|
185
|
+
]), Y = o(() => be(Rt, q, J), [
|
|
186
|
+
Rt,
|
|
180
187
|
q,
|
|
181
188
|
J
|
|
182
|
-
]), X =
|
|
189
|
+
]), X = xe((e) => {
|
|
183
190
|
if (e === q) {
|
|
184
|
-
|
|
191
|
+
Lt((e) => e === "asc" ? "desc" : "asc");
|
|
185
192
|
return;
|
|
186
193
|
}
|
|
187
|
-
|
|
188
|
-
}, [q]), { successionPlans:
|
|
194
|
+
It(e), Lt(e === "label" ? "asc" : "desc");
|
|
195
|
+
}, [q]), { successionPlans: zt, beds: Bt, createSuccession: Vt, deletePlan: Ht } = _e(O?.id), [Z, Ut] = s(() => (/* @__PURE__ */ new Date()).toISOString().split("T")[0]), [Wt, Gt] = s("14"), [Kt, qt] = s("4"), [Jt, Yt] = s(""), [Xt, Zt] = s(!1), Qt = o(() => {
|
|
189
196
|
let e = /* @__PURE__ */ new Map();
|
|
190
|
-
for (let t of
|
|
197
|
+
for (let t of zt) {
|
|
191
198
|
let n = String(t.successionGroupId), r = e.get(n);
|
|
192
199
|
r ? r.push(t) : e.set(n, [t]);
|
|
193
200
|
}
|
|
194
201
|
return Array.from(e.entries());
|
|
195
|
-
}, [
|
|
202
|
+
}, [zt]), $t = xe((e) => {
|
|
196
203
|
let t = e.cropId ? S.find((t) => t.id === e.cropId) : void 0;
|
|
197
204
|
if (t) return t.variety ? `${t.name} - ${t.variety}` : t.name;
|
|
198
|
-
let n = e.plantCatalogId ?
|
|
205
|
+
let n = e.plantCatalogId ? M.find((t) => t.id === e.plantCatalogId) : void 0;
|
|
199
206
|
if (n?.name?.trim()) return n.variety ? `${n.name} - ${n.variety}` : n.name;
|
|
200
207
|
let r = e.cropName?.trim();
|
|
201
208
|
if (r && !/^unknown(\s+crop)?$/i.test(r)) return r;
|
|
@@ -203,11 +210,11 @@ var Ke = (e) => {
|
|
|
203
210
|
return i ? i.variety ? `${i.name} - ${i.variety}` : i.name : "—";
|
|
204
211
|
}, [
|
|
205
212
|
S,
|
|
206
|
-
|
|
213
|
+
M,
|
|
207
214
|
z
|
|
208
|
-
]),
|
|
215
|
+
]), en = async () => {
|
|
209
216
|
if (!O) return;
|
|
210
|
-
let e = Number(
|
|
217
|
+
let e = Number(Wt), t = Number(Kt);
|
|
211
218
|
if (!Z || !Number.isFinite(e) || e < 1 || !Number.isFinite(t) || t < 1) {
|
|
212
219
|
T({
|
|
213
220
|
title: c("healthybowl.crops.fieldDetail.succession.toast.invalid.title", "Check the schedule inputs"),
|
|
@@ -216,13 +223,13 @@ var Ke = (e) => {
|
|
|
216
223
|
});
|
|
217
224
|
return;
|
|
218
225
|
}
|
|
219
|
-
|
|
226
|
+
Zt(!0);
|
|
220
227
|
try {
|
|
221
|
-
let n = await
|
|
228
|
+
let n = await Vt({
|
|
222
229
|
fieldId: O.id,
|
|
223
|
-
bedId:
|
|
230
|
+
bedId: Jt || void 0,
|
|
224
231
|
cropId: V?.id ?? void 0,
|
|
225
|
-
plantCatalogId:
|
|
232
|
+
plantCatalogId: N || void 0,
|
|
226
233
|
season: V?.season ? V.season.toUpperCase() : void 0,
|
|
227
234
|
year: new Date(Z).getFullYear(),
|
|
228
235
|
startDate: Z,
|
|
@@ -245,16 +252,16 @@ var Ke = (e) => {
|
|
|
245
252
|
variant: "error"
|
|
246
253
|
});
|
|
247
254
|
} finally {
|
|
248
|
-
|
|
255
|
+
Zt(!1);
|
|
249
256
|
}
|
|
250
|
-
},
|
|
251
|
-
if (await
|
|
257
|
+
}, tn = async (e) => {
|
|
258
|
+
if (await Oe({
|
|
252
259
|
title: c("healthybowl.crops.fieldDetail.succession.deleteConfirm.title", "Delete this sowing?"),
|
|
253
260
|
message: c("healthybowl.crops.fieldDetail.succession.deleteConfirm.message", "This sowing will be permanently removed from the schedule."),
|
|
254
261
|
okButtonTitle: c("healthybowl.common.delete", "Delete"),
|
|
255
262
|
cancelButtonTitle: c("healthybowl.common.cancel", "Cancel")
|
|
256
263
|
}) !== !1) try {
|
|
257
|
-
await
|
|
264
|
+
await Ht(e.id), T({
|
|
258
265
|
title: c("healthybowl.crops.fieldDetail.succession.toast.deleted.title", "Sowing removed"),
|
|
259
266
|
description: c("healthybowl.crops.fieldDetail.succession.toast.deleted.description", "The sowing was deleted."),
|
|
260
267
|
variant: "success"
|
|
@@ -266,9 +273,9 @@ var Ke = (e) => {
|
|
|
266
273
|
variant: "error"
|
|
267
274
|
});
|
|
268
275
|
}
|
|
269
|
-
}, Q = O ?
|
|
270
|
-
location:
|
|
271
|
-
current:
|
|
276
|
+
}, Q = O ? Ze.find((e) => e.fieldName === O.name) : void 0, $ = {
|
|
277
|
+
location: Qe?.location ?? "",
|
|
278
|
+
current: Qe?.current ?? {
|
|
272
279
|
temperature: 0,
|
|
273
280
|
condition: "N/A",
|
|
274
281
|
feelsLike: 0,
|
|
@@ -278,8 +285,8 @@ var Ke = (e) => {
|
|
|
278
285
|
pressure: 0,
|
|
279
286
|
visibility: 0
|
|
280
287
|
},
|
|
281
|
-
forecast:
|
|
282
|
-
},
|
|
288
|
+
forecast: Qe?.forecast ?? []
|
|
289
|
+
}, nn = o(() => {
|
|
283
290
|
let e = [];
|
|
284
291
|
return z.forEach((t) => {
|
|
285
292
|
t.plantingDate && e.push({
|
|
@@ -307,7 +314,7 @@ var Ke = (e) => {
|
|
|
307
314
|
z,
|
|
308
315
|
Q,
|
|
309
316
|
c
|
|
310
|
-
]),
|
|
317
|
+
]), rn = o(() => z.length === 0 ? [{
|
|
311
318
|
season: c("healthybowl.crops.fieldDetail.cropHistory.currentSeason", "Current"),
|
|
312
319
|
crop: c("healthybowl.crops.fieldDetail.cropHistory.noCropsPlanted", "No crops planted"),
|
|
313
320
|
status: "fallow"
|
|
@@ -326,7 +333,7 @@ var Ke = (e) => {
|
|
|
326
333
|
actions: /* @__PURE__ */ u("div", {
|
|
327
334
|
className: "flex items-center gap-2",
|
|
328
335
|
children: [
|
|
329
|
-
/* @__PURE__ */ l(
|
|
336
|
+
/* @__PURE__ */ l(le, {
|
|
330
337
|
entityType: "FIELD",
|
|
331
338
|
entityId: O.id,
|
|
332
339
|
entityLabel: O.name
|
|
@@ -335,26 +342,26 @@ var Ke = (e) => {
|
|
|
335
342
|
variant: "outline",
|
|
336
343
|
onClick: () => C(w("crops/fields")),
|
|
337
344
|
children: [
|
|
338
|
-
/* @__PURE__ */ l(
|
|
345
|
+
/* @__PURE__ */ l(Te, { className: "h-4 w-4" }),
|
|
339
346
|
" ",
|
|
340
347
|
c("healthybowl.crops.fieldDetail.actions.backToFields", "Back to Fields")
|
|
341
348
|
]
|
|
342
349
|
}),
|
|
343
350
|
/* @__PURE__ */ u(d, {
|
|
344
351
|
variant: "outline",
|
|
345
|
-
onClick:
|
|
352
|
+
onClick: kt,
|
|
346
353
|
children: [
|
|
347
|
-
/* @__PURE__ */ l(
|
|
354
|
+
/* @__PURE__ */ l(je, { className: "h-4 w-4" }),
|
|
348
355
|
" ",
|
|
349
356
|
c("healthybowl.crops.fieldDetail.actions.editField", "Edit Field")
|
|
350
357
|
]
|
|
351
358
|
}),
|
|
352
359
|
/* @__PURE__ */ u(d, {
|
|
353
360
|
variant: "destructive",
|
|
354
|
-
onClick:
|
|
355
|
-
disabled:
|
|
361
|
+
onClick: jt,
|
|
362
|
+
disabled: ct,
|
|
356
363
|
children: [
|
|
357
|
-
/* @__PURE__ */ l(
|
|
364
|
+
/* @__PURE__ */ l(Be, { className: "h-4 w-4" }),
|
|
358
365
|
" ",
|
|
359
366
|
c("healthybowl.common.delete", "Delete")
|
|
360
367
|
]
|
|
@@ -367,7 +374,7 @@ var Ke = (e) => {
|
|
|
367
374
|
id: "edit",
|
|
368
375
|
label: c("healthybowl.crops.fieldDetail.nextSteps.edit.label", "Update field details"),
|
|
369
376
|
description: c("healthybowl.crops.fieldDetail.nextSteps.edit.desc", "Keep area, soil type and irrigation info current."),
|
|
370
|
-
onClick:
|
|
377
|
+
onClick: kt
|
|
371
378
|
},
|
|
372
379
|
{
|
|
373
380
|
id: "soil",
|
|
@@ -399,7 +406,7 @@ var Ke = (e) => {
|
|
|
399
406
|
className: "flex flex-wrap items-center gap-3",
|
|
400
407
|
children: [/* @__PURE__ */ l(i, {
|
|
401
408
|
label: O.status,
|
|
402
|
-
variant:
|
|
409
|
+
variant: qe(O.status),
|
|
403
410
|
dot: !0
|
|
404
411
|
}), O.organicCertified ? /* @__PURE__ */ l(i, {
|
|
405
412
|
label: c("healthybowl.crops.fieldDetail.badges.organicCertified", "Organic Certified"),
|
|
@@ -414,7 +421,7 @@ var Ke = (e) => {
|
|
|
414
421
|
children: [/* @__PURE__ */ u("div", {
|
|
415
422
|
className: "space-y-6 lg:col-span-2",
|
|
416
423
|
children: [
|
|
417
|
-
/* @__PURE__ */ u(
|
|
424
|
+
/* @__PURE__ */ u(Ke, {
|
|
418
425
|
treatment: "glass",
|
|
419
426
|
glow: !0,
|
|
420
427
|
className: "border-border-seam p-6",
|
|
@@ -453,7 +460,7 @@ var Ke = (e) => {
|
|
|
453
460
|
className: "mt-1",
|
|
454
461
|
children: /* @__PURE__ */ l(i, {
|
|
455
462
|
label: O.status,
|
|
456
|
-
variant:
|
|
463
|
+
variant: qe(O.status)
|
|
457
464
|
})
|
|
458
465
|
})] })
|
|
459
466
|
]
|
|
@@ -489,7 +496,7 @@ var Ke = (e) => {
|
|
|
489
496
|
children: [/* @__PURE__ */ l("span", {
|
|
490
497
|
className: "text-xs text-text-secondary",
|
|
491
498
|
children: c("healthybowl.crops.fieldDetail.info.gpsCoordinates", "GPS Coordinates")
|
|
492
|
-
}), /* @__PURE__ */ u("div", {
|
|
499
|
+
}), lt ? /* @__PURE__ */ u("div", {
|
|
493
500
|
className: "mt-1 flex items-center gap-4",
|
|
494
501
|
children: [/* @__PURE__ */ u("span", {
|
|
495
502
|
className: "text-xs text-text-secondary",
|
|
@@ -498,7 +505,7 @@ var Ke = (e) => {
|
|
|
498
505
|
" ",
|
|
499
506
|
/* @__PURE__ */ l("span", {
|
|
500
507
|
className: "font-mono text-sm text-text-primary",
|
|
501
|
-
children:
|
|
508
|
+
children: lt.lat
|
|
502
509
|
})
|
|
503
510
|
]
|
|
504
511
|
}), /* @__PURE__ */ u("span", {
|
|
@@ -508,10 +515,13 @@ var Ke = (e) => {
|
|
|
508
515
|
" ",
|
|
509
516
|
/* @__PURE__ */ l("span", {
|
|
510
517
|
className: "font-mono text-sm text-text-primary",
|
|
511
|
-
children:
|
|
518
|
+
children: lt.lng
|
|
512
519
|
})
|
|
513
520
|
]
|
|
514
521
|
})]
|
|
522
|
+
}) : /* @__PURE__ */ l("p", {
|
|
523
|
+
className: "mt-1 text-xs text-text-secondary",
|
|
524
|
+
children: c("healthybowl.crops.fieldDetail.info.noCoordinates", "Not set — draw or import this field’s boundary on the map below.")
|
|
515
525
|
})]
|
|
516
526
|
})
|
|
517
527
|
]
|
|
@@ -524,7 +534,7 @@ var Ke = (e) => {
|
|
|
524
534
|
children: [/* @__PURE__ */ u("h3", {
|
|
525
535
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
526
536
|
children: [
|
|
527
|
-
/* @__PURE__ */ l(
|
|
537
|
+
/* @__PURE__ */ l(Pe, { className: "h-4 w-4 text-success" }),
|
|
528
538
|
" ",
|
|
529
539
|
c("healthybowl.crops.fieldDetail.boundary.heading", "Field Boundary")
|
|
530
540
|
]
|
|
@@ -533,13 +543,13 @@ var Ke = (e) => {
|
|
|
533
543
|
children: c("healthybowl.crops.fieldDetail.boundary.description", "Draw or import this field’s boundary on the satellite map. Saving updates the field area automatically.")
|
|
534
544
|
})]
|
|
535
545
|
}),
|
|
536
|
-
/* @__PURE__ */ l(
|
|
546
|
+
/* @__PURE__ */ l(ce, {
|
|
537
547
|
fieldId: O.id,
|
|
538
548
|
unit: O.unit ?? "acres",
|
|
539
549
|
center: O.location,
|
|
540
550
|
initialBoundary: O.boundary,
|
|
541
|
-
onSaved:
|
|
542
|
-
onAreaChange:
|
|
551
|
+
onSaved: rt,
|
|
552
|
+
onAreaChange: Ot
|
|
543
553
|
}),
|
|
544
554
|
/* @__PURE__ */ u("div", {
|
|
545
555
|
className: "mt-5 border-t border-border-subtle pt-5",
|
|
@@ -548,7 +558,7 @@ var Ke = (e) => {
|
|
|
548
558
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
549
559
|
children: [/* @__PURE__ */ u("h4", {
|
|
550
560
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
551
|
-
children: [c("healthybowl.crops.fieldDetail.capacity.heading", "Planting capacity"),
|
|
561
|
+
children: [c("healthybowl.crops.fieldDetail.capacity.heading", "Planting capacity"), Nt && /* @__PURE__ */ l("span", {
|
|
552
562
|
className: "rounded-full bg-success/10 px-2 py-0.5 text-[11px] font-medium text-success",
|
|
553
563
|
children: c("healthybowl.crops.fieldDetail.capacity.fromBoundary", "from drawn boundary")
|
|
554
564
|
})]
|
|
@@ -558,7 +568,7 @@ var Ke = (e) => {
|
|
|
558
568
|
})]
|
|
559
569
|
}),
|
|
560
570
|
/* @__PURE__ */ u("div", {
|
|
561
|
-
className: "mt-4 grid gap-3 md:grid-cols-2 xl:grid-cols-
|
|
571
|
+
className: "mt-4 grid gap-3 md:grid-cols-2 xl:grid-cols-4",
|
|
562
572
|
children: [
|
|
563
573
|
/* @__PURE__ */ u("div", {
|
|
564
574
|
className: "xl:col-span-2",
|
|
@@ -566,8 +576,8 @@ var Ke = (e) => {
|
|
|
566
576
|
className: "text-xs font-medium text-text-secondary",
|
|
567
577
|
children: c("healthybowl.crops.fieldDetail.capacity.crop", "Crop")
|
|
568
578
|
}), /* @__PURE__ */ u(f, {
|
|
569
|
-
value:
|
|
570
|
-
onValueChange:
|
|
579
|
+
value: j,
|
|
580
|
+
onValueChange: Pt,
|
|
571
581
|
children: [/* @__PURE__ */ l(h, {
|
|
572
582
|
className: "mt-1 w-full",
|
|
573
583
|
children: /* @__PURE__ */ l(g, { placeholder: c("healthybowl.crops.fieldDetail.capacity.cropPlaceholder", "Select crop") })
|
|
@@ -577,21 +587,21 @@ var Ke = (e) => {
|
|
|
577
587
|
}, e.id)) })]
|
|
578
588
|
})]
|
|
579
589
|
}),
|
|
580
|
-
|
|
590
|
+
M.length > 0 && /* @__PURE__ */ u("div", {
|
|
581
591
|
className: "xl:col-span-2",
|
|
582
592
|
children: [/* @__PURE__ */ l("label", {
|
|
583
593
|
className: "text-xs font-medium text-text-secondary",
|
|
584
594
|
children: c("healthybowl.crops.fieldDetail.capacity.catalog", "Master Plant List")
|
|
585
595
|
}), /* @__PURE__ */ u(f, {
|
|
586
|
-
value:
|
|
587
|
-
onValueChange:
|
|
596
|
+
value: N || "none",
|
|
597
|
+
onValueChange: Ft,
|
|
588
598
|
children: [/* @__PURE__ */ l(h, {
|
|
589
599
|
className: "mt-1 w-full",
|
|
590
600
|
children: /* @__PURE__ */ l(g, { placeholder: c("healthybowl.crops.fieldDetail.capacity.catalogPlaceholder", "Fill spacing from catalog") })
|
|
591
601
|
}), /* @__PURE__ */ u(p, { children: [/* @__PURE__ */ l(m, {
|
|
592
602
|
value: "none",
|
|
593
603
|
children: c("healthybowl.crops.fieldDetail.capacity.catalogNone", "None")
|
|
594
|
-
}),
|
|
604
|
+
}), M.map((e) => /* @__PURE__ */ l(m, {
|
|
595
605
|
value: e.id,
|
|
596
606
|
children: e.variety ? `${e.name} - ${e.variety}` : e.name
|
|
597
607
|
}, e.id))] })]
|
|
@@ -600,7 +610,7 @@ var Ke = (e) => {
|
|
|
600
610
|
/* @__PURE__ */ l(y, {
|
|
601
611
|
label: c("healthybowl.crops.fieldDetail.capacity.plantSpacing", "Plant spacing"),
|
|
602
612
|
unit: "cm",
|
|
603
|
-
value:
|
|
613
|
+
value: wt,
|
|
604
614
|
min: "1",
|
|
605
615
|
step: "1",
|
|
606
616
|
onChange: P
|
|
@@ -608,7 +618,7 @@ var Ke = (e) => {
|
|
|
608
618
|
/* @__PURE__ */ l(y, {
|
|
609
619
|
label: c("healthybowl.crops.fieldDetail.capacity.rowSpacing", "Row spacing"),
|
|
610
620
|
unit: "cm",
|
|
611
|
-
value:
|
|
621
|
+
value: Tt,
|
|
612
622
|
min: "1",
|
|
613
623
|
step: "1",
|
|
614
624
|
onChange: F
|
|
@@ -619,7 +629,7 @@ var Ke = (e) => {
|
|
|
619
629
|
value: I,
|
|
620
630
|
min: "0.1",
|
|
621
631
|
step: "0.1",
|
|
622
|
-
onChange:
|
|
632
|
+
onChange: Et
|
|
623
633
|
}),
|
|
624
634
|
/* @__PURE__ */ l(y, {
|
|
625
635
|
label: c("healthybowl.crops.fieldDetail.capacity.pathWidth", "Path width"),
|
|
@@ -627,11 +637,11 @@ var Ke = (e) => {
|
|
|
627
637
|
value: L,
|
|
628
638
|
min: "0",
|
|
629
639
|
step: "0.05",
|
|
630
|
-
onChange:
|
|
640
|
+
onChange: Dt
|
|
631
641
|
})
|
|
632
642
|
]
|
|
633
643
|
}),
|
|
634
|
-
W ? /* @__PURE__ */ u(
|
|
644
|
+
W ? /* @__PURE__ */ u(Ge, { children: [
|
|
635
645
|
/* @__PURE__ */ u("div", {
|
|
636
646
|
className: "mt-4 grid grid-cols-2 gap-3 md:grid-cols-3 xl:grid-cols-6",
|
|
637
647
|
children: [
|
|
@@ -673,7 +683,7 @@ var Ke = (e) => {
|
|
|
673
683
|
/* @__PURE__ */ u("h5", {
|
|
674
684
|
className: "mb-3 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
675
685
|
children: [
|
|
676
|
-
/* @__PURE__ */ l(
|
|
686
|
+
/* @__PURE__ */ l(Ie, { className: "h-3.5 w-3.5 text-success" }),
|
|
677
687
|
c("healthybowl.crops.fieldDetail.seedRate.heading", "Seed rate"),
|
|
678
688
|
G && /* @__PURE__ */ l("span", {
|
|
679
689
|
className: "rounded-full bg-success/10 px-2 py-0.5 text-[11px] font-medium normal-case text-success",
|
|
@@ -711,7 +721,7 @@ var Ke = (e) => {
|
|
|
711
721
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
712
722
|
children: [/* @__PURE__ */ u("h5", {
|
|
713
723
|
className: "flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
714
|
-
children: [/* @__PURE__ */ l(
|
|
724
|
+
children: [/* @__PURE__ */ l(Re, { className: "h-3.5 w-3.5 text-success" }), c("healthybowl.crops.fieldDetail.compare.heading", "Compare crops for this field")]
|
|
715
725
|
}), Y.length > 0 && /* @__PURE__ */ u("span", {
|
|
716
726
|
className: "text-xs text-text-secondary",
|
|
717
727
|
children: [
|
|
@@ -720,7 +730,7 @@ var Ke = (e) => {
|
|
|
720
730
|
c("healthybowl.crops.fieldDetail.compare.varieties", "varieties")
|
|
721
731
|
]
|
|
722
732
|
})]
|
|
723
|
-
}), Y.length > 0 ? /* @__PURE__ */ u(
|
|
733
|
+
}), Y.length > 0 ? /* @__PURE__ */ u(Ge, { children: [
|
|
724
734
|
/* @__PURE__ */ l("p", {
|
|
725
735
|
className: "mt-1 text-xs text-text-secondary",
|
|
726
736
|
children: c("healthybowl.crops.fieldDetail.compare.description", "What each variety in your Master Plant List would need on this field, at the bed and path widths above.")
|
|
@@ -854,7 +864,7 @@ var Ke = (e) => {
|
|
|
854
864
|
children: [/* @__PURE__ */ u("h3", {
|
|
855
865
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
856
866
|
children: [
|
|
857
|
-
/* @__PURE__ */ l(
|
|
867
|
+
/* @__PURE__ */ l(Ie, { className: "h-4 w-4 text-success" }),
|
|
858
868
|
" ",
|
|
859
869
|
c("healthybowl.crops.fieldDetail.succession.heading", "Succession planting")
|
|
860
870
|
]
|
|
@@ -872,38 +882,38 @@ var Ke = (e) => {
|
|
|
872
882
|
}), /* @__PURE__ */ l("input", {
|
|
873
883
|
type: "date",
|
|
874
884
|
value: Z,
|
|
875
|
-
onChange: (e) =>
|
|
885
|
+
onChange: (e) => Ut(e.target.value),
|
|
876
886
|
className: "mt-1 h-10 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
877
887
|
})] }),
|
|
878
888
|
/* @__PURE__ */ l(y, {
|
|
879
889
|
label: c("healthybowl.crops.fieldDetail.succession.interval", "Interval"),
|
|
880
890
|
unit: c("healthybowl.crops.fieldDetail.succession.days", "days"),
|
|
881
|
-
value:
|
|
891
|
+
value: Wt,
|
|
882
892
|
min: "1",
|
|
883
893
|
step: "1",
|
|
884
|
-
onChange:
|
|
894
|
+
onChange: Gt
|
|
885
895
|
}),
|
|
886
896
|
/* @__PURE__ */ l(y, {
|
|
887
897
|
label: c("healthybowl.crops.fieldDetail.succession.count", "Number of sowings"),
|
|
888
898
|
unit: c("healthybowl.crops.fieldDetail.succession.sowings", "sowings"),
|
|
889
|
-
value:
|
|
899
|
+
value: Kt,
|
|
890
900
|
min: "1",
|
|
891
901
|
step: "1",
|
|
892
|
-
onChange:
|
|
902
|
+
onChange: qt
|
|
893
903
|
}),
|
|
894
|
-
|
|
904
|
+
Bt.length > 0 && /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
895
905
|
className: "text-xs font-medium text-text-secondary",
|
|
896
906
|
children: c("healthybowl.crops.fieldDetail.succession.bed", "Bed (optional)")
|
|
897
907
|
}), /* @__PURE__ */ u(f, {
|
|
898
|
-
value:
|
|
899
|
-
onValueChange: (e) =>
|
|
908
|
+
value: Jt || "none",
|
|
909
|
+
onValueChange: (e) => Yt(e === "none" ? "" : e),
|
|
900
910
|
children: [/* @__PURE__ */ l(h, {
|
|
901
911
|
className: "mt-1 w-full",
|
|
902
912
|
children: /* @__PURE__ */ l(g, { placeholder: c("healthybowl.crops.fieldDetail.succession.bedPlaceholder", "No specific bed") })
|
|
903
913
|
}), /* @__PURE__ */ u(p, { children: [/* @__PURE__ */ l(m, {
|
|
904
914
|
value: "none",
|
|
905
915
|
children: c("healthybowl.crops.fieldDetail.succession.bedNone", "No specific bed")
|
|
906
|
-
}),
|
|
916
|
+
}), Bt.map((e) => /* @__PURE__ */ l(m, {
|
|
907
917
|
value: e.id,
|
|
908
918
|
children: e.name
|
|
909
919
|
}, e.id))] })]
|
|
@@ -916,18 +926,18 @@ var Ke = (e) => {
|
|
|
916
926
|
className: "text-xs text-text-secondary",
|
|
917
927
|
children: V ? c("healthybowl.crops.fieldDetail.succession.forCrop", "For: {{crop}}", { crop: V.variety ? `${V.name} - ${V.variety}` : V.name }) : c("healthybowl.crops.fieldDetail.succession.noCrop", "Select a crop in the capacity planner above.")
|
|
918
928
|
}), /* @__PURE__ */ u(d, {
|
|
919
|
-
onClick:
|
|
920
|
-
disabled:
|
|
921
|
-
children: [/* @__PURE__ */ l(
|
|
929
|
+
onClick: en,
|
|
930
|
+
disabled: Xt,
|
|
931
|
+
children: [/* @__PURE__ */ l(Fe, { className: "h-4 w-4" }), Xt ? c("healthybowl.crops.fieldDetail.succession.generating", "Generating...") : c("healthybowl.crops.fieldDetail.succession.generate", "Generate schedule")]
|
|
922
932
|
})]
|
|
923
933
|
}),
|
|
924
|
-
|
|
934
|
+
Qt.length > 0 ? /* @__PURE__ */ l("div", {
|
|
925
935
|
className: "mt-5 space-y-5 border-t border-border-subtle pt-5",
|
|
926
|
-
children:
|
|
936
|
+
children: Qt.map(([n, r]) => /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("div", {
|
|
927
937
|
className: "mb-2 flex items-center justify-between",
|
|
928
938
|
children: [/* @__PURE__ */ l("h4", {
|
|
929
939
|
className: "text-sm font-semibold text-text-primary",
|
|
930
|
-
children: r[0] ?
|
|
940
|
+
children: r[0] ? $t(r[0]) : c("healthybowl.crops.fieldDetail.succession.series", "Succession series")
|
|
931
941
|
}), /* @__PURE__ */ l("span", {
|
|
932
942
|
className: "text-xs text-text-secondary",
|
|
933
943
|
children: c("healthybowl.crops.fieldDetail.succession.sowingCount", "{{count}} sowings", { count: r.length })
|
|
@@ -959,10 +969,10 @@ var Ke = (e) => {
|
|
|
959
969
|
}), /* @__PURE__ */ l(d, {
|
|
960
970
|
variant: "ghost",
|
|
961
971
|
size: "icon-sm",
|
|
962
|
-
onClick: () => void
|
|
972
|
+
onClick: () => void tn(n),
|
|
963
973
|
"aria-label": c("healthybowl.common.delete", "Delete"),
|
|
964
974
|
className: "text-status-error-text hover:bg-status-error-bg/10 hover:text-status-error-text",
|
|
965
|
-
children: /* @__PURE__ */ l(
|
|
975
|
+
children: /* @__PURE__ */ l(Be, { className: "h-4 w-4" })
|
|
966
976
|
})]
|
|
967
977
|
}, n.id))
|
|
968
978
|
})] }, n))
|
|
@@ -977,7 +987,7 @@ var Ke = (e) => {
|
|
|
977
987
|
children: [/* @__PURE__ */ u("h3", {
|
|
978
988
|
className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
979
989
|
children: [
|
|
980
|
-
/* @__PURE__ */ l(
|
|
990
|
+
/* @__PURE__ */ l(Ne, { className: "h-4 w-4 text-success" }),
|
|
981
991
|
" ",
|
|
982
992
|
c("healthybowl.crops.fieldDetail.currentCrops.heading", "Current Crops")
|
|
983
993
|
]
|
|
@@ -1032,13 +1042,13 @@ var Ke = (e) => {
|
|
|
1032
1042
|
children: [/* @__PURE__ */ u("h3", {
|
|
1033
1043
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
1034
1044
|
children: [
|
|
1035
|
-
/* @__PURE__ */ l(
|
|
1045
|
+
/* @__PURE__ */ l(we, { className: "h-4 w-4 text-warning" }),
|
|
1036
1046
|
" ",
|
|
1037
1047
|
c("healthybowl.crops.fieldDetail.soilHealth.heading", "Soil Health")
|
|
1038
1048
|
]
|
|
1039
1049
|
}), /* @__PURE__ */ l(i, {
|
|
1040
1050
|
label: (Q.status ?? "unknown").replace("_", " "),
|
|
1041
|
-
variant:
|
|
1051
|
+
variant: Je(Q.status ?? "unknown")
|
|
1042
1052
|
})]
|
|
1043
1053
|
}),
|
|
1044
1054
|
/* @__PURE__ */ l("div", {
|
|
@@ -1111,13 +1121,13 @@ var Ke = (e) => {
|
|
|
1111
1121
|
children: [/* @__PURE__ */ u("h3", {
|
|
1112
1122
|
className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
1113
1123
|
children: [
|
|
1114
|
-
/* @__PURE__ */ l(
|
|
1124
|
+
/* @__PURE__ */ l(De, { className: "h-4 w-4 text-info" }),
|
|
1115
1125
|
" ",
|
|
1116
1126
|
c("healthybowl.crops.fieldDetail.cropHistory.heading", "Crop History")
|
|
1117
1127
|
]
|
|
1118
1128
|
}), /* @__PURE__ */ l("div", {
|
|
1119
1129
|
className: "space-y-3",
|
|
1120
|
-
children:
|
|
1130
|
+
children: rn.map((e, t) => /* @__PURE__ */ u("div", {
|
|
1121
1131
|
className: "flex items-center justify-between rounded-md border border-border-subtle p-3",
|
|
1122
1132
|
children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
|
|
1123
1133
|
className: "text-sm font-medium text-text-primary",
|
|
@@ -1141,7 +1151,7 @@ var Ke = (e) => {
|
|
|
1141
1151
|
children: [/* @__PURE__ */ u("h3", {
|
|
1142
1152
|
className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
1143
1153
|
children: [
|
|
1144
|
-
/* @__PURE__ */ l(
|
|
1154
|
+
/* @__PURE__ */ l(ke, { className: "h-4 w-4 text-info" }),
|
|
1145
1155
|
" ",
|
|
1146
1156
|
c("healthybowl.crops.fieldDetail.weather.heading", "Current Conditions")
|
|
1147
1157
|
]
|
|
@@ -1153,7 +1163,7 @@ var Ke = (e) => {
|
|
|
1153
1163
|
children: [/* @__PURE__ */ u("span", {
|
|
1154
1164
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
1155
1165
|
children: [
|
|
1156
|
-
/* @__PURE__ */ l(
|
|
1166
|
+
/* @__PURE__ */ l(ze, { className: "h-3.5 w-3.5" }),
|
|
1157
1167
|
" ",
|
|
1158
1168
|
c("healthybowl.crops.fieldDetail.weather.temperature", "Temperature")
|
|
1159
1169
|
]
|
|
@@ -1167,7 +1177,7 @@ var Ke = (e) => {
|
|
|
1167
1177
|
children: [/* @__PURE__ */ u("span", {
|
|
1168
1178
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
1169
1179
|
children: [
|
|
1170
|
-
/* @__PURE__ */ l(
|
|
1180
|
+
/* @__PURE__ */ l(Ae, { className: "h-3.5 w-3.5" }),
|
|
1171
1181
|
" ",
|
|
1172
1182
|
c("healthybowl.crops.fieldDetail.weather.humidity", "Humidity")
|
|
1173
1183
|
]
|
|
@@ -1181,7 +1191,7 @@ var Ke = (e) => {
|
|
|
1181
1191
|
children: [/* @__PURE__ */ u("span", {
|
|
1182
1192
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
1183
1193
|
children: [
|
|
1184
|
-
/* @__PURE__ */ l(
|
|
1194
|
+
/* @__PURE__ */ l(He, { className: "h-3.5 w-3.5" }),
|
|
1185
1195
|
" ",
|
|
1186
1196
|
c("healthybowl.crops.fieldDetail.weather.wind", "Wind")
|
|
1187
1197
|
]
|
|
@@ -1195,7 +1205,7 @@ var Ke = (e) => {
|
|
|
1195
1205
|
children: [/* @__PURE__ */ u("span", {
|
|
1196
1206
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
1197
1207
|
children: [
|
|
1198
|
-
/* @__PURE__ */ l(
|
|
1208
|
+
/* @__PURE__ */ l(Le, { className: "h-3.5 w-3.5" }),
|
|
1199
1209
|
" ",
|
|
1200
1210
|
c("healthybowl.crops.fieldDetail.weather.uvIndex", "UV Index")
|
|
1201
1211
|
]
|
|
@@ -1209,7 +1219,7 @@ var Ke = (e) => {
|
|
|
1209
1219
|
children: [/* @__PURE__ */ u("span", {
|
|
1210
1220
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
1211
1221
|
children: [
|
|
1212
|
-
/* @__PURE__ */ l(
|
|
1222
|
+
/* @__PURE__ */ l(Me, { className: "h-3.5 w-3.5" }),
|
|
1213
1223
|
" ",
|
|
1214
1224
|
c("healthybowl.crops.fieldDetail.weather.visibility", "Visibility")
|
|
1215
1225
|
]
|
|
@@ -1234,7 +1244,7 @@ var Ke = (e) => {
|
|
|
1234
1244
|
onClick: () => C(w("weather")),
|
|
1235
1245
|
className: "w-full justify-start",
|
|
1236
1246
|
children: [
|
|
1237
|
-
/* @__PURE__ */ l(
|
|
1247
|
+
/* @__PURE__ */ l(Le, { className: "h-4 w-4 text-text-secondary" }),
|
|
1238
1248
|
" ",
|
|
1239
1249
|
c("healthybowl.crops.fieldDetail.quickActions.weatherData", "Weather Data")
|
|
1240
1250
|
]
|
|
@@ -1244,7 +1254,7 @@ var Ke = (e) => {
|
|
|
1244
1254
|
onClick: () => C(w("soil-health")),
|
|
1245
1255
|
className: "w-full justify-start",
|
|
1246
1256
|
children: [
|
|
1247
|
-
/* @__PURE__ */ l(
|
|
1257
|
+
/* @__PURE__ */ l(Ee, { className: "h-4 w-4 text-text-secondary" }),
|
|
1248
1258
|
" ",
|
|
1249
1259
|
c("healthybowl.crops.fieldDetail.quickActions.soilAnalysis", "Soil Analysis")
|
|
1250
1260
|
]
|
|
@@ -1254,7 +1264,7 @@ var Ke = (e) => {
|
|
|
1254
1264
|
onClick: () => C(w("crops")),
|
|
1255
1265
|
className: "w-full justify-start",
|
|
1256
1266
|
children: [
|
|
1257
|
-
/* @__PURE__ */ l(
|
|
1267
|
+
/* @__PURE__ */ l(Ve, { className: "h-4 w-4 text-text-secondary" }),
|
|
1258
1268
|
" ",
|
|
1259
1269
|
c("healthybowl.crops.fieldDetail.quickActions.cropHistory", "Crop History")
|
|
1260
1270
|
]
|
|
@@ -1264,7 +1274,7 @@ var Ke = (e) => {
|
|
|
1264
1274
|
onClick: () => C(w("analytics")),
|
|
1265
1275
|
className: "w-full justify-start",
|
|
1266
1276
|
children: [
|
|
1267
|
-
/* @__PURE__ */ l(
|
|
1277
|
+
/* @__PURE__ */ l(we, { className: "h-4 w-4 text-text-secondary" }),
|
|
1268
1278
|
" ",
|
|
1269
1279
|
c("healthybowl.crops.fieldDetail.quickActions.generateReport", "Generate Report")
|
|
1270
1280
|
]
|
|
@@ -1279,11 +1289,11 @@ var Ke = (e) => {
|
|
|
1279
1289
|
children: c("healthybowl.crops.fieldDetail.recentActivity.heading", "Recent Activity")
|
|
1280
1290
|
}), /* @__PURE__ */ l("div", {
|
|
1281
1291
|
className: "space-y-4",
|
|
1282
|
-
children:
|
|
1292
|
+
children: nn.map((t, n) => /* @__PURE__ */ u("div", {
|
|
1283
1293
|
className: "flex gap-3",
|
|
1284
1294
|
children: [/* @__PURE__ */ u("div", {
|
|
1285
1295
|
className: "relative flex flex-col items-center",
|
|
1286
|
-
children: [/* @__PURE__ */ l("div", { className: "h-2 w-2 rounded-full bg-action-primary-bg" }), n <
|
|
1296
|
+
children: [/* @__PURE__ */ l("div", { className: "h-2 w-2 rounded-full bg-action-primary-bg" }), n < nn.length - 1 && /* @__PURE__ */ l("div", { className: "w-0.5 flex-1 bg-border" })]
|
|
1287
1297
|
}), /* @__PURE__ */ u("div", {
|
|
1288
1298
|
className: "pb-4",
|
|
1289
1299
|
children: [/* @__PURE__ */ l("p", {
|
|
@@ -1301,19 +1311,19 @@ var Ke = (e) => {
|
|
|
1301
1311
|
})]
|
|
1302
1312
|
}),
|
|
1303
1313
|
/* @__PURE__ */ l(ae, {
|
|
1304
|
-
open:
|
|
1314
|
+
open: st,
|
|
1305
1315
|
onClose: () => E(!1),
|
|
1306
1316
|
title: c("healthybowl.crops.fieldDetail.editModal.title", "Edit Field"),
|
|
1307
1317
|
description: c("healthybowl.crops.fieldDetail.editModal.description", "Update details for {{name}}", { name: O.name }),
|
|
1308
1318
|
size: "lg",
|
|
1309
|
-
footer: /* @__PURE__ */ u(
|
|
1319
|
+
footer: /* @__PURE__ */ u(Ge, { children: [/* @__PURE__ */ l(d, {
|
|
1310
1320
|
variant: "outline",
|
|
1311
1321
|
onClick: () => E(!1),
|
|
1312
1322
|
children: c("healthybowl.common.cancel", "Cancel")
|
|
1313
1323
|
}), /* @__PURE__ */ l(d, {
|
|
1314
|
-
onClick:
|
|
1315
|
-
disabled:
|
|
1316
|
-
children:
|
|
1324
|
+
onClick: At,
|
|
1325
|
+
disabled: ct,
|
|
1326
|
+
children: ct ? c("healthybowl.crops.fieldDetail.editModal.saving", "Saving...") : c("healthybowl.crops.fieldDetail.editModal.saveChanges", "Save Changes")
|
|
1317
1327
|
})] }),
|
|
1318
1328
|
children: /* @__PURE__ */ u("div", {
|
|
1319
1329
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
@@ -1324,7 +1334,7 @@ var Ke = (e) => {
|
|
|
1324
1334
|
}), /* @__PURE__ */ l("input", {
|
|
1325
1335
|
type: "text",
|
|
1326
1336
|
value: k,
|
|
1327
|
-
onChange: (e) =>
|
|
1337
|
+
onChange: (e) => ut(e.target.value),
|
|
1328
1338
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
1329
1339
|
})] }),
|
|
1330
1340
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
@@ -1333,16 +1343,16 @@ var Ke = (e) => {
|
|
|
1333
1343
|
}), /* @__PURE__ */ l("input", {
|
|
1334
1344
|
type: "number",
|
|
1335
1345
|
min: 0,
|
|
1336
|
-
value:
|
|
1337
|
-
onChange: (e) =>
|
|
1346
|
+
value: A,
|
|
1347
|
+
onChange: (e) => dt(e.target.value),
|
|
1338
1348
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
1339
1349
|
})] }),
|
|
1340
1350
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
1341
1351
|
className: "text-sm font-medium text-text-primary",
|
|
1342
1352
|
children: c("healthybowl.crops.fieldDetail.form.unit.label", "Unit")
|
|
1343
1353
|
}), /* @__PURE__ */ u(f, {
|
|
1344
|
-
value:
|
|
1345
|
-
onValueChange: (e) =>
|
|
1354
|
+
value: ft,
|
|
1355
|
+
onValueChange: (e) => pt(e),
|
|
1346
1356
|
children: [/* @__PURE__ */ l(h, {
|
|
1347
1357
|
className: "mt-1 w-full",
|
|
1348
1358
|
children: /* @__PURE__ */ l(g, {})
|
|
@@ -1358,8 +1368,8 @@ var Ke = (e) => {
|
|
|
1358
1368
|
className: "text-sm font-medium text-text-primary",
|
|
1359
1369
|
children: c("healthybowl.crops.fieldDetail.form.status.label", "Status")
|
|
1360
1370
|
}), /* @__PURE__ */ u(f, {
|
|
1361
|
-
value:
|
|
1362
|
-
onValueChange:
|
|
1371
|
+
value: vt,
|
|
1372
|
+
onValueChange: yt,
|
|
1363
1373
|
children: [/* @__PURE__ */ l(h, {
|
|
1364
1374
|
className: "mt-1 w-full",
|
|
1365
1375
|
children: /* @__PURE__ */ l(g, {})
|
|
@@ -1383,8 +1393,8 @@ var Ke = (e) => {
|
|
|
1383
1393
|
children: c("healthybowl.crops.fieldDetail.form.soilType.label", "Soil Type")
|
|
1384
1394
|
}), /* @__PURE__ */ l("input", {
|
|
1385
1395
|
type: "text",
|
|
1386
|
-
value:
|
|
1387
|
-
onChange: (e) =>
|
|
1396
|
+
value: mt,
|
|
1397
|
+
onChange: (e) => ht(e.target.value),
|
|
1388
1398
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
1389
1399
|
})] }),
|
|
1390
1400
|
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
@@ -1392,8 +1402,8 @@ var Ke = (e) => {
|
|
|
1392
1402
|
children: c("healthybowl.crops.fieldDetail.form.irrigationType.label", "Irrigation Type")
|
|
1393
1403
|
}), /* @__PURE__ */ l("input", {
|
|
1394
1404
|
type: "text",
|
|
1395
|
-
value:
|
|
1396
|
-
onChange: (e) =>
|
|
1405
|
+
value: gt,
|
|
1406
|
+
onChange: (e) => _t(e.target.value),
|
|
1397
1407
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
1398
1408
|
})] }),
|
|
1399
1409
|
/* @__PURE__ */ l("div", {
|
|
@@ -1402,8 +1412,8 @@ var Ke = (e) => {
|
|
|
1402
1412
|
className: "flex cursor-pointer items-center gap-2 text-sm font-medium text-text-primary",
|
|
1403
1413
|
children: [/* @__PURE__ */ l("input", {
|
|
1404
1414
|
type: "checkbox",
|
|
1405
|
-
checked:
|
|
1406
|
-
onChange: (e) =>
|
|
1415
|
+
checked: bt,
|
|
1416
|
+
onChange: (e) => xt(e.target.checked),
|
|
1407
1417
|
className: "h-4 w-4 rounded border-border-subtle text-primary focus:ring-[var(--color-focus-ring)]"
|
|
1408
1418
|
}), c("healthybowl.crops.fieldDetail.form.organicCertified.label", "Organic Certified")]
|
|
1409
1419
|
})
|
|
@@ -1412,13 +1422,13 @@ var Ke = (e) => {
|
|
|
1412
1422
|
})
|
|
1413
1423
|
}),
|
|
1414
1424
|
/* @__PURE__ */ l(te, {
|
|
1415
|
-
toasts:
|
|
1416
|
-
onDismiss:
|
|
1425
|
+
toasts: at,
|
|
1426
|
+
onDismiss: ot
|
|
1417
1427
|
})
|
|
1418
1428
|
]
|
|
1419
1429
|
}) : /* @__PURE__ */ l(r, {
|
|
1420
1430
|
title: c("healthybowl.crops.fieldDetail.notFound.pageTitle", "Field Not Found"),
|
|
1421
|
-
children:
|
|
1431
|
+
children: et.crops ? /* @__PURE__ */ l(ie, {}) : $e.crops ? /* @__PURE__ */ l(a, { onRetry: rt }) : /* @__PURE__ */ l(ee, {
|
|
1422
1432
|
title: c("healthybowl.crops.fieldDetail.notFound.title", "Field not found"),
|
|
1423
1433
|
description: c("healthybowl.crops.fieldDetail.notFound.description", "The field you are looking for does not exist."),
|
|
1424
1434
|
action: /* @__PURE__ */ l(d, {
|
|
@@ -1438,18 +1448,18 @@ var Ke = (e) => {
|
|
|
1438
1448
|
min: r,
|
|
1439
1449
|
step: i,
|
|
1440
1450
|
onChange: (e) => ee(e.target.value),
|
|
1441
|
-
className: "h-10 w-full rounded-md border border-border-subtle bg-bg-surface px-3 pr-
|
|
1451
|
+
className: "h-10 w-full rounded-md border border-border-subtle bg-bg-surface px-3 pr-8 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] [appearance:textfield] [&::-webkit-inner-spin-button]:m-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:m-0 [&::-webkit-outer-spin-button]:appearance-none"
|
|
1442
1452
|
}), /* @__PURE__ */ l("span", {
|
|
1443
1453
|
className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-xs text-text-secondary",
|
|
1444
1454
|
children: t
|
|
1445
1455
|
})]
|
|
1446
1456
|
})] }), b = ({ label: e, value: t, unit: n }) => /* @__PURE__ */ u("div", {
|
|
1447
|
-
className: "min-w-0 rounded-md border border-border-subtle bg-bg-sunken/60 p-3",
|
|
1457
|
+
className: "flex min-w-0 flex-col rounded-md border border-border-subtle bg-bg-sunken/60 p-3",
|
|
1448
1458
|
children: [/* @__PURE__ */ l("span", {
|
|
1449
|
-
className: "block
|
|
1459
|
+
className: "block text-xs leading-tight text-text-secondary",
|
|
1450
1460
|
children: e
|
|
1451
1461
|
}), /* @__PURE__ */ u("p", {
|
|
1452
|
-
className: "mt-1 text-lg font-semibold text-text-primary",
|
|
1462
|
+
className: "mt-auto pt-1 text-lg font-semibold text-text-primary",
|
|
1453
1463
|
children: [t, n && /* @__PURE__ */ l("span", {
|
|
1454
1464
|
className: "ml-1 text-xs font-medium text-text-secondary",
|
|
1455
1465
|
children: n
|
|
@@ -1465,7 +1475,7 @@ var Ke = (e) => {
|
|
|
1465
1475
|
type: "button",
|
|
1466
1476
|
onClick: () => i(t),
|
|
1467
1477
|
className: `inline-flex items-center gap-1 rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] ${a ? "text-text-primary" : "text-text-secondary hover:text-text-primary"}`,
|
|
1468
|
-
children: [e, a && l(r === "asc" ?
|
|
1478
|
+
children: [e, a && l(r === "asc" ? Oe : c, {
|
|
1469
1479
|
className: "h-3 w-3",
|
|
1470
1480
|
"aria-hidden": "true"
|
|
1471
1481
|
})]
|
|
@@ -1473,6 +1483,6 @@ var Ke = (e) => {
|
|
|
1473
1483
|
});
|
|
1474
1484
|
};
|
|
1475
1485
|
//#endregion
|
|
1476
|
-
export {
|
|
1486
|
+
export { Xe as FieldDetailsPage };
|
|
1477
1487
|
|
|
1478
1488
|
//# sourceMappingURL=FieldDetailsPage.js.map
|