@burdenoff/microfe-healthybowl 2026.713.2 → 2026.713.4
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.
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
import { __toESM as e } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { geocodePlace as t } from "../../utils/geocode.js";
|
|
3
3
|
import { useHealthyBowl as n } from "../../context/HealthyBowlContext.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
4
|
+
import { useBasePath as r } from "../../hooks/useBasePath.js";
|
|
5
|
+
import { PageLayout as i } from "../../components/PageLayout.js";
|
|
6
|
+
import { EmptyState as a } from "../../components/EmptyState.js";
|
|
7
|
+
import { ErrorState as o } from "../../components/ErrorState.js";
|
|
8
|
+
import { ToastContainer as ee } from "../../components/Toast.js";
|
|
9
|
+
import { useConfirm as te } from "../../components/ConfirmDialog.js";
|
|
10
|
+
import { Modal as ne } from "../../components/Modal.js";
|
|
11
|
+
import { require_leaflet_src as s } from "../../../node_modules/leaflet/dist/leaflet-src.js";
|
|
12
|
+
import { useToast as re } from "../../hooks/useToast.js";
|
|
13
|
+
import { ensureLeafletCss as ie } from "../../utils/leaflet.js";
|
|
14
|
+
import { extractPolygon as ae, isValidPolygon as oe, polygonAreaInUnit as se, polygonAreaSqMeters as c, polygonCentroid as ce, ringToPolygon as le } from "../../utils/geo.js";
|
|
15
|
+
import { SOIL_PALETTE as ue, soilColor as de, soilLegendFor as fe } from "../../utils/soil.js";
|
|
16
|
+
import { elevationColor as pe, fetchElevations as me } from "../../utils/elevation.js";
|
|
17
|
+
import { bedPlantCount as he, generateBeds as ge } from "../../utils/bedLayout.js";
|
|
16
18
|
import "../../utils/index.js";
|
|
17
19
|
import "../../components/index.js";
|
|
18
|
-
import { useHealthyBowlData as
|
|
19
|
-
import { DEFAULT_BED_WIDTH_M as
|
|
20
|
-
import { useCallback as
|
|
21
|
-
import { useI18n as
|
|
22
|
-
import { Check as
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
20
|
+
import { useHealthyBowlData as _e } from "../../hooks/useHealthyBowlData.js";
|
|
21
|
+
import { DEFAULT_BED_WIDTH_M as ve, DEFAULT_PATH_WIDTH_M as ye, getCropSpacingPreset as be } from "../../utils/plantingCapacity.js";
|
|
22
|
+
import { useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
23
|
+
import { useI18n as xe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
24
|
+
import { Check as Se, Droplet as m, Fence as h, Layers as Ce, LayoutGrid as we, LocateFixed as Te, MapPinned as Ee, Pencil as De, Plus as Oe, Ruler as ke, Save as Ae, Search as je, Shapes as Me, Spline as Ne, Sprout as g, Square as Pe, Trash2 as Fe, TriangleAlert as Ie, Undo2 as Le, Warehouse as Re, Waypoints as _, X as ze } from "lucide-react";
|
|
25
|
+
import { useNavigate as Be } from "react-router-dom";
|
|
26
|
+
import { Fragment as Ve, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
27
|
+
import { Button as b, Select as He, SelectContent as Ue, SelectItem as x, SelectTrigger as We, SelectValue as Ge } from "@burdenoff/fe-libs/ui";
|
|
28
|
+
import { gql as S } from "@apollo/client";
|
|
29
|
+
import { useMutation as Ke, useQuery as qe } from "@apollo/client/react";
|
|
27
30
|
//#region src/healthybowl/pages/fields/FieldMapPage.tsx
|
|
28
|
-
var
|
|
31
|
+
var C = /* @__PURE__ */ e(s(), 1), Je = S`
|
|
29
32
|
mutation UpdateHealthyBowlFieldBoundaryOnMapPage($input: UpdateHealthyBowlFieldInput!) {
|
|
30
33
|
updateHealthyBowlField(input: $input) {
|
|
31
34
|
id
|
|
@@ -34,7 +37,7 @@ var T = /* @__PURE__ */ e(c(), 1), He = C`
|
|
|
34
37
|
location
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
|
-
`,
|
|
40
|
+
`, Ye = S`
|
|
38
41
|
query HealthyBowlBedsOnMapPage($context: ContextInput!, $fieldId: ID) {
|
|
39
42
|
healthyBowlBeds(context: $context, fieldId: $fieldId) {
|
|
40
43
|
id
|
|
@@ -50,13 +53,13 @@ var T = /* @__PURE__ */ e(c(), 1), He = C`
|
|
|
50
53
|
status
|
|
51
54
|
}
|
|
52
55
|
}
|
|
53
|
-
`,
|
|
56
|
+
`, Xe = S`
|
|
54
57
|
mutation CreateHealthyBowlBedOnMapPage($input: CreateHealthyBowlBedInput!) {
|
|
55
58
|
createHealthyBowlBed(input: $input) {
|
|
56
59
|
id
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
|
-
`,
|
|
62
|
+
`, Ze = S`
|
|
60
63
|
mutation UpdateHealthyBowlBedOnMapPage($input: UpdateHealthyBowlBedInput!) {
|
|
61
64
|
updateHealthyBowlBed(input: $input) {
|
|
62
65
|
id
|
|
@@ -64,11 +67,11 @@ var T = /* @__PURE__ */ e(c(), 1), He = C`
|
|
|
64
67
|
plantCount
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
|
-
`,
|
|
70
|
+
`, Qe = S`
|
|
68
71
|
mutation DeleteHealthyBowlBedOnMapPage($id: ID!, $context: ContextInput!) {
|
|
69
72
|
deleteHealthyBowlBed(id: $id, context: $context)
|
|
70
73
|
}
|
|
71
|
-
`,
|
|
74
|
+
`, $e = S`
|
|
72
75
|
query HealthyBowlMapFeaturesOnMapPage($context: ContextInput!) {
|
|
73
76
|
healthyBowlMapFeatures(context: $context) {
|
|
74
77
|
id
|
|
@@ -79,17 +82,17 @@ var T = /* @__PURE__ */ e(c(), 1), He = C`
|
|
|
79
82
|
color
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
|
-
`,
|
|
85
|
+
`, et = S`
|
|
83
86
|
mutation CreateHealthyBowlMapFeatureOnMapPage($input: CreateHealthyBowlMapFeatureInput!) {
|
|
84
87
|
createHealthyBowlMapFeature(input: $input) {
|
|
85
88
|
id
|
|
86
89
|
}
|
|
87
90
|
}
|
|
88
|
-
`,
|
|
91
|
+
`, tt = S`
|
|
89
92
|
mutation DeleteHealthyBowlMapFeatureOnMapPage($id: ID!, $context: ContextInput!) {
|
|
90
93
|
deleteHealthyBowlMapFeature(id: $id, context: $context)
|
|
91
94
|
}
|
|
92
|
-
`,
|
|
95
|
+
`, nt = [
|
|
93
96
|
{
|
|
94
97
|
type: "BUFFER_ZONE",
|
|
95
98
|
kind: "polygon",
|
|
@@ -103,7 +106,7 @@ var T = /* @__PURE__ */ e(c(), 1), He = C`
|
|
|
103
106
|
fillColor: "#f59e0b",
|
|
104
107
|
fillOpacity: .15
|
|
105
108
|
},
|
|
106
|
-
icon:
|
|
109
|
+
icon: Pe
|
|
107
110
|
},
|
|
108
111
|
{
|
|
109
112
|
type: "GREENHOUSE",
|
|
@@ -117,7 +120,7 @@ var T = /* @__PURE__ */ e(c(), 1), He = C`
|
|
|
117
120
|
fillColor: "#14b8a6",
|
|
118
121
|
fillOpacity: .3
|
|
119
122
|
},
|
|
120
|
-
icon:
|
|
123
|
+
icon: g
|
|
121
124
|
},
|
|
122
125
|
{
|
|
123
126
|
type: "BUILDING",
|
|
@@ -131,7 +134,7 @@ var T = /* @__PURE__ */ e(c(), 1), He = C`
|
|
|
131
134
|
fillColor: "#6b7280",
|
|
132
135
|
fillOpacity: .4
|
|
133
136
|
},
|
|
134
|
-
icon:
|
|
137
|
+
icon: Re
|
|
135
138
|
},
|
|
136
139
|
{
|
|
137
140
|
type: "ENCLOSURE",
|
|
@@ -146,7 +149,7 @@ var T = /* @__PURE__ */ e(c(), 1), He = C`
|
|
|
146
149
|
fillColor: "#92400e",
|
|
147
150
|
fillOpacity: .2
|
|
148
151
|
},
|
|
149
|
-
icon:
|
|
152
|
+
icon: h
|
|
150
153
|
},
|
|
151
154
|
{
|
|
152
155
|
type: "CUSTOM",
|
|
@@ -160,7 +163,7 @@ var T = /* @__PURE__ */ e(c(), 1), He = C`
|
|
|
160
163
|
fillColor: "#8b5cf6",
|
|
161
164
|
fillOpacity: .25
|
|
162
165
|
},
|
|
163
|
-
icon:
|
|
166
|
+
icon: Me
|
|
164
167
|
},
|
|
165
168
|
{
|
|
166
169
|
type: "IRRIGATION_LINE",
|
|
@@ -172,7 +175,7 @@ var T = /* @__PURE__ */ e(c(), 1), He = C`
|
|
|
172
175
|
color: "#3b82f6",
|
|
173
176
|
weight: 3
|
|
174
177
|
},
|
|
175
|
-
icon:
|
|
178
|
+
icon: _
|
|
176
179
|
},
|
|
177
180
|
{
|
|
178
181
|
type: "WATER_SOURCE",
|
|
@@ -186,7 +189,7 @@ var T = /* @__PURE__ */ e(c(), 1), He = C`
|
|
|
186
189
|
fillColor: "#3b82f6",
|
|
187
190
|
fillOpacity: 1
|
|
188
191
|
},
|
|
189
|
-
icon:
|
|
192
|
+
icon: m
|
|
190
193
|
},
|
|
191
194
|
{
|
|
192
195
|
type: "HAZARD",
|
|
@@ -200,70 +203,70 @@ var T = /* @__PURE__ */ e(c(), 1), He = C`
|
|
|
200
203
|
fillColor: "#dc2626",
|
|
201
204
|
fillOpacity: 1
|
|
202
205
|
},
|
|
203
|
-
icon:
|
|
206
|
+
icon: Ie
|
|
204
207
|
}
|
|
205
|
-
],
|
|
206
|
-
async function
|
|
208
|
+
], w = new Map(nt.map((e) => [e.type, e])), rt = (e) => e === "polygon" ? "Area" : e === "line" ? "Line" : "Point", it = 250, at = 20;
|
|
209
|
+
async function ot(e, t, n) {
|
|
207
210
|
for (let r = 0; r < e.length; r += t) await Promise.all(e.slice(r, r + t).map(n));
|
|
208
211
|
}
|
|
209
|
-
var
|
|
212
|
+
var st = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}", ct = "Esri, Maxar, Earthstar Geographics", lt = "https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", ut = "© OpenTopoMap (CC-BY-SA) · © OpenStreetMap contributors", dt = 21, ft = 16, pt = 2.47105, mt = "#16a34a", ht = {
|
|
210
213
|
color: "#f59e0b",
|
|
211
214
|
weight: 2,
|
|
212
215
|
dashArray: "6 4",
|
|
213
216
|
fillColor: "#f59e0b",
|
|
214
217
|
fillOpacity: .15
|
|
215
|
-
},
|
|
218
|
+
}, gt = {
|
|
216
219
|
color: "#ffffff",
|
|
217
220
|
weight: 2,
|
|
218
221
|
dashArray: "6 4",
|
|
219
222
|
fillColor: "#22c55e",
|
|
220
223
|
fillOpacity: .2
|
|
221
|
-
},
|
|
224
|
+
}, _t = {
|
|
222
225
|
color: "#38bdf8",
|
|
223
226
|
weight: 3,
|
|
224
227
|
dashArray: "6 6"
|
|
225
|
-
},
|
|
228
|
+
}, vt = {
|
|
226
229
|
color: "#b45309",
|
|
227
230
|
weight: 1,
|
|
228
231
|
dashArray: "4 3",
|
|
229
232
|
fillColor: "#f59e0b",
|
|
230
233
|
fillOpacity: .25
|
|
231
|
-
},
|
|
234
|
+
}, yt = {
|
|
232
235
|
color: "#065f46",
|
|
233
236
|
weight: 2,
|
|
234
237
|
fillColor: "#34d399",
|
|
235
238
|
fillOpacity: .5
|
|
236
|
-
},
|
|
239
|
+
}, bt = {
|
|
237
240
|
color: "#065f46",
|
|
238
241
|
weight: 2,
|
|
239
242
|
fillColor: "#059669",
|
|
240
243
|
fillOpacity: .6
|
|
241
|
-
},
|
|
242
|
-
let t =
|
|
243
|
-
return t &&
|
|
244
|
-
},
|
|
244
|
+
}, xt = (e) => !!(e && Number.isFinite(e.lat) && Number.isFinite(e.lng) && e.lat >= -90 && e.lat <= 90 && e.lng >= -180 && e.lng <= 180 && (e.lat !== 0 || e.lng !== 0)), T = (e) => /hect|(^|[^a-z])ha([^a-z]|$)/i.test(e ?? ""), St = (e) => T(e.unit) ? e.area * pt : e.area, Ct = (e) => `${e.area.toFixed(1)} ${T(e.unit) ? "ha" : "ac"}`, E = (e) => {
|
|
245
|
+
let t = ae(e.boundary);
|
|
246
|
+
return t && oe(t) ? t : null;
|
|
247
|
+
}, wt = C.default.divIcon({
|
|
245
248
|
className: "",
|
|
246
249
|
html: "<span style=\"display:block;width:12px;height:12px;background:#22c55e;border:2px solid #fff;border-radius:2px;box-shadow:0 0 3px rgba(0,0,0,.6)\"></span>",
|
|
247
250
|
iconSize: [16, 16],
|
|
248
251
|
iconAnchor: [8, 8]
|
|
249
|
-
}),
|
|
250
|
-
let { t: e } =
|
|
251
|
-
|
|
252
|
-
K.current =
|
|
253
|
-
}, [
|
|
254
|
-
|
|
255
|
-
}, [
|
|
256
|
-
|
|
257
|
-
}, [
|
|
258
|
-
let
|
|
259
|
-
let e =
|
|
260
|
-
return e ?
|
|
261
|
-
}, [
|
|
252
|
+
}), Tt = () => {
|
|
253
|
+
let { t: e } = xe(), { workspaceId: s } = n(), m = te(), { fields: h, crops: g, farm: Pe, loadings: Ie, errors: Re, refetch: _, createField: S } = _e(), { toasts: pt, toast: T, dismiss: Tt } = re(), Et = Be(), { buildPath: Dt } = r(), Ot = !!Pe?.id, [D] = Ke(Je), [kt] = Ke(Xe), [At] = Ke(Ze), [jt] = Ke(Qe), [Mt] = Ke(et), [Nt] = Ke(tt), [O, Pt] = p("loading"), [k, A] = p("view"), [j, M] = p(null), [Ft, It] = p(!1), [Lt, Rt] = p(!0), [zt, Bt] = p(!1), [N, Vt] = p({}), [Ht, Ut] = p(""), [Wt, Gt] = p(""), [Kt, qt] = p(!1), [Jt, Yt] = p(0), [Xt, Zt] = p(null), [Qt, $t] = p(!1), [en, tn] = p(!1), [P, nn] = p(null), [rn, an] = p(!1), [F, on] = p(ve), [sn, cn] = p(ye), [I, ln] = p(0), [un, dn] = p(""), [fn, pn] = p(!1), [mn, hn] = p(!1), [L, gn] = p(null), [_n, vn] = p(""), [yn, bn] = p(!1), [xn, Sn] = p(!0), [Cn, wn] = p(!1), [Tn, En] = p(null), [Dn, On] = p(0), [R, kn] = p(null), [An, jn] = p(""), [Mn, Nn] = p(""), [Pn, Fn] = p(!1), [z, In] = p(null), [Ln, Rn] = p(!1), [B, zn] = p(null), [Bn, Vn] = p(!1), [Hn, Un] = p(""), [Wn, Gn] = p("Clay loam"), [Kn, qn] = p("Drip"), [Jn, Yn] = p("active"), Xn = f(null), V = f(null), Zn = f(null), Qn = f(null), $n = f(null), H = f(null), er = f(null), tr = f(null), nr = f(null), rr = f(null), ir = f(null), U = f([]), ar = f(null), W = f(null), G = f([]), or = f(null), sr = f([]), cr = f(null), lr = f([]), K = f("view"), ur = f(!1);
|
|
254
|
+
u(() => {
|
|
255
|
+
K.current = k;
|
|
256
|
+
}, [k]), u(() => {
|
|
257
|
+
W.current = Tn;
|
|
258
|
+
}, [Tn]), u(() => {
|
|
259
|
+
k !== "element" && (ir.current?.clearLayers(), U.current = [], ar.current = null);
|
|
260
|
+
}, [k]);
|
|
261
|
+
let dr = d(() => h.filter((e) => E(e) !== null).length, [h]), fr = d(() => h.reduce((e, t) => e + St(t), 0), [h]), pr = d(() => fe(h.map((e) => e.soilType)), [h]), q = d(() => h.find((e) => e.id === j) ?? null, [h, j]), mr = d(() => {
|
|
262
|
+
let e = Ht.trim().toLowerCase();
|
|
263
|
+
return e ? h.filter((t) => t.name.toLowerCase().includes(e) || (t.soilType ?? "").toLowerCase().includes(e)) : h;
|
|
264
|
+
}, [h, Ht]), hr = d(() => {
|
|
262
265
|
let e = [];
|
|
263
|
-
for (let t of
|
|
264
|
-
let n =
|
|
266
|
+
for (let t of h) {
|
|
267
|
+
let n = E(t);
|
|
265
268
|
if (n) {
|
|
266
|
-
let r =
|
|
269
|
+
let r = ce(n);
|
|
267
270
|
if (r) {
|
|
268
271
|
e.push({
|
|
269
272
|
id: t.id,
|
|
@@ -273,78 +276,78 @@ var tt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
273
276
|
continue;
|
|
274
277
|
}
|
|
275
278
|
}
|
|
276
|
-
|
|
279
|
+
xt(t.location) && e.push({
|
|
277
280
|
id: t.id,
|
|
278
281
|
lat: t.location.lat,
|
|
279
282
|
lng: t.location.lng
|
|
280
283
|
});
|
|
281
284
|
}
|
|
282
285
|
return e;
|
|
283
|
-
}, [
|
|
284
|
-
|
|
285
|
-
if (
|
|
286
|
-
|
|
286
|
+
}, [h]);
|
|
287
|
+
u(() => {
|
|
288
|
+
if (hr.length === 0) {
|
|
289
|
+
Vt({});
|
|
287
290
|
return;
|
|
288
291
|
}
|
|
289
292
|
let e = new AbortController(), t = !1;
|
|
290
|
-
return
|
|
293
|
+
return me(hr.map((e) => ({
|
|
291
294
|
lat: e.lat,
|
|
292
295
|
lng: e.lng
|
|
293
296
|
})), e.signal).then((e) => {
|
|
294
297
|
if (t) return;
|
|
295
298
|
let n = {};
|
|
296
|
-
|
|
299
|
+
hr.forEach((t, r) => {
|
|
297
300
|
n[t.id] = e[r] ?? null;
|
|
298
|
-
}),
|
|
301
|
+
}), Vt(n);
|
|
299
302
|
}), () => {
|
|
300
303
|
t = !0, e.abort();
|
|
301
304
|
};
|
|
302
|
-
}, [
|
|
303
|
-
let [
|
|
304
|
-
let e = Object.values(
|
|
305
|
+
}, [d(() => hr.map((e) => `${e.id}:${e.lat.toFixed(5)},${e.lng.toFixed(5)}`).join("|"), [hr])]);
|
|
306
|
+
let [gr, _r] = d(() => {
|
|
307
|
+
let e = Object.values(N).filter((e) => e != null && Number.isFinite(e));
|
|
305
308
|
return e.length === 0 ? [0, 0] : [Math.min(...e), Math.max(...e)];
|
|
306
|
-
}, [
|
|
309
|
+
}, [N]), vr = d(() => Object.values(N).some((e) => e != null && Number.isFinite(e)), [N]), yr = l((e) => {
|
|
307
310
|
if (!e) return "";
|
|
308
|
-
let t =
|
|
311
|
+
let t = g.find((t) => t.field === e.id || t.fieldName === e.name);
|
|
309
312
|
return t ? t.name : (e.crops ?? []).join(", ");
|
|
310
|
-
}, [
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
]), J =
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
}, [
|
|
318
|
-
let Y =
|
|
319
|
-
bedWidthM:
|
|
320
|
-
pathWidthM:
|
|
321
|
-
orientationDeg:
|
|
313
|
+
}, [g]), br = d(() => q ? E(q) : null, [q]), xr = d(() => q ? g.find((e) => e.field === q.id || e.fieldName === q.name) ?? null : null, [g, q]), Sr = d(() => g.find((e) => e.id === un) ?? xr, [
|
|
314
|
+
g,
|
|
315
|
+
un,
|
|
316
|
+
xr
|
|
317
|
+
]), J = d(() => be(Sr), [Sr]);
|
|
318
|
+
u(() => {
|
|
319
|
+
dn("");
|
|
320
|
+
}, [j]);
|
|
321
|
+
let Y = d(() => br ? ge(br, {
|
|
322
|
+
bedWidthM: F,
|
|
323
|
+
pathWidthM: sn,
|
|
324
|
+
orientationDeg: I
|
|
322
325
|
}) : null, [
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
]),
|
|
326
|
+
br,
|
|
327
|
+
F,
|
|
328
|
+
sn,
|
|
329
|
+
I
|
|
330
|
+
]), Cr = d(() => Y ? Y.beds.reduce((e, t) => e + he(c(t), F, J.plantSpacingCm, J.rowSpacingCm), 0) : 0, [
|
|
328
331
|
Y,
|
|
329
|
-
|
|
332
|
+
F,
|
|
330
333
|
J
|
|
331
|
-
]), { data:
|
|
334
|
+
]), { data: wr, loading: Tr, refetch: Er } = qe(Ye, {
|
|
332
335
|
variables: {
|
|
333
|
-
context: { workspaceId:
|
|
334
|
-
fieldId:
|
|
336
|
+
context: { workspaceId: s },
|
|
337
|
+
fieldId: j ?? void 0
|
|
335
338
|
},
|
|
336
|
-
skip: !
|
|
339
|
+
skip: !j,
|
|
337
340
|
fetchPolicy: "cache-and-network"
|
|
338
|
-
}), X =
|
|
339
|
-
variables: { context: { workspaceId:
|
|
341
|
+
}), X = d(() => wr?.healthyBowlBeds ?? [], [wr]), { data: Dr, refetch: Or } = qe($e, {
|
|
342
|
+
variables: { context: { workspaceId: s } },
|
|
340
343
|
fetchPolicy: "cache-and-network"
|
|
341
|
-
}),
|
|
342
|
-
|
|
343
|
-
let t =
|
|
344
|
-
t && (t.clearLayers(),
|
|
345
|
-
let r =
|
|
346
|
-
if (!r || !
|
|
347
|
-
let i =
|
|
344
|
+
}), kr = d(() => Dr?.healthyBowlMapFeatures ?? [], [Dr]), Ar = d(() => w.get(Tn ?? "") ?? null, [Tn]), jr = l((e) => e ? g.find((t) => t.id === e)?.name ?? null : null, [g]);
|
|
345
|
+
u(() => {
|
|
346
|
+
let t = nr.current;
|
|
347
|
+
t && (t.clearLayers(), k === "view" && (X.forEach((n) => {
|
|
348
|
+
let r = ae(n.boundary);
|
|
349
|
+
if (!r || !oe(r)) return;
|
|
350
|
+
let i = jr(n.cropId), a = C.default.geoJSON(r, { style: () => n.cropId ? bt : yt });
|
|
348
351
|
a.bindTooltip(e("healthybowl.fieldMapPage.beds.savedTooltip", "{{name}}{{crop}} · {{plants}} plants", {
|
|
349
352
|
name: n.name,
|
|
350
353
|
crop: i ? ` · ${i}` : "",
|
|
@@ -353,10 +356,10 @@ var tt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
353
356
|
sticky: !0,
|
|
354
357
|
direction: "top"
|
|
355
358
|
}), a.on("click", (e) => {
|
|
356
|
-
|
|
359
|
+
C.default.DomEvent.stopPropagation(e), gn(n), vn(n.cropId ?? "");
|
|
357
360
|
}), a.addTo(t);
|
|
358
|
-
}),
|
|
359
|
-
let r =
|
|
361
|
+
}), rn && Y && Y.beds.forEach((n) => {
|
|
362
|
+
let r = c(n), i = he(r, F, J.plantSpacingCm, J.rowSpacingCm), a = C.default.geoJSON(n, { style: () => vt });
|
|
360
363
|
a.bindTooltip(e("healthybowl.fieldMapPage.beds.bedTooltip", "{{plants}} plants · {{area}} m²", {
|
|
361
364
|
plants: String(i),
|
|
362
365
|
area: r.toFixed(0)
|
|
@@ -366,27 +369,27 @@ var tt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
366
369
|
}), a.addTo(t);
|
|
367
370
|
})));
|
|
368
371
|
}, [
|
|
369
|
-
|
|
372
|
+
rn,
|
|
370
373
|
Y,
|
|
371
|
-
|
|
374
|
+
F,
|
|
372
375
|
J,
|
|
373
|
-
|
|
376
|
+
k,
|
|
374
377
|
X,
|
|
375
|
-
|
|
378
|
+
jr,
|
|
376
379
|
e
|
|
377
|
-
]),
|
|
378
|
-
let t =
|
|
379
|
-
t && (t.clearLayers(),
|
|
380
|
-
let r =
|
|
380
|
+
]), u(() => {
|
|
381
|
+
let t = rr.current;
|
|
382
|
+
t && (t.clearLayers(), xn && kr.forEach((n) => {
|
|
383
|
+
let r = w.get(n.type), i = n.color || r?.color || "#8b5cf6", a = r?.style ?? {
|
|
381
384
|
color: i,
|
|
382
385
|
weight: 2,
|
|
383
386
|
fillColor: i,
|
|
384
387
|
fillOpacity: .25
|
|
385
388
|
}, o = null;
|
|
386
389
|
try {
|
|
387
|
-
o =
|
|
390
|
+
o = C.default.geoJSON(n.geometry, {
|
|
388
391
|
style: () => a,
|
|
389
|
-
pointToLayer: (e, t) =>
|
|
392
|
+
pointToLayer: (e, t) => C.default.circleMarker(t, {
|
|
390
393
|
radius: 7,
|
|
391
394
|
color: "#fff",
|
|
392
395
|
weight: 2,
|
|
@@ -398,57 +401,57 @@ var tt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
398
401
|
o = null;
|
|
399
402
|
}
|
|
400
403
|
if (!o) return;
|
|
401
|
-
let
|
|
402
|
-
o.bindTooltip(`${n.name} · ${
|
|
404
|
+
let ee = r ? e(r.labelKey, r.label) : n.type;
|
|
405
|
+
o.bindTooltip(`${n.name} · ${ee}`, {
|
|
403
406
|
sticky: !0,
|
|
404
407
|
direction: "top"
|
|
405
408
|
}), o.on("click", (e) => {
|
|
406
|
-
|
|
409
|
+
C.default.DomEvent.stopPropagation(e), K.current === "view" && In(n);
|
|
407
410
|
}), o.addTo(t);
|
|
408
411
|
}));
|
|
409
412
|
}, [
|
|
410
|
-
|
|
411
|
-
|
|
413
|
+
kr,
|
|
414
|
+
xn,
|
|
412
415
|
e
|
|
413
416
|
]);
|
|
414
|
-
let
|
|
417
|
+
let Mr = l(async () => {
|
|
415
418
|
if (!(!q || !Y || Y.beds.length === 0)) {
|
|
416
|
-
if (Y.bedCount >
|
|
417
|
-
|
|
419
|
+
if (Y.bedCount > it) {
|
|
420
|
+
T({
|
|
418
421
|
title: e("healthybowl.fieldMapPage.beds.tooMany.title", "Too many beds to save"),
|
|
419
422
|
description: e("healthybowl.fieldMapPage.beds.tooMany.description", "This layout has {{count}} beds (max {{max}}). Increase the bed width to reduce the count, then save.", {
|
|
420
423
|
count: String(Y.bedCount),
|
|
421
|
-
max: String(
|
|
424
|
+
max: String(it)
|
|
422
425
|
}),
|
|
423
426
|
variant: "warning"
|
|
424
427
|
});
|
|
425
428
|
return;
|
|
426
429
|
}
|
|
427
|
-
|
|
430
|
+
pn(!0);
|
|
428
431
|
try {
|
|
429
|
-
await
|
|
432
|
+
await ot(X, at, (e) => jt({ variables: {
|
|
430
433
|
id: e.id,
|
|
431
|
-
context: { workspaceId:
|
|
434
|
+
context: { workspaceId: s }
|
|
432
435
|
} }));
|
|
433
436
|
let t = Y.beds;
|
|
434
|
-
await
|
|
437
|
+
await ot(t.map((e, t) => ({
|
|
435
438
|
bed: e,
|
|
436
439
|
index: t
|
|
437
|
-
})),
|
|
438
|
-
let r =
|
|
439
|
-
return
|
|
440
|
+
})), at, ({ bed: t, index: n }) => {
|
|
441
|
+
let r = c(t), i = he(r, F, J.plantSpacingCm, J.rowSpacingCm);
|
|
442
|
+
return kt({ variables: { input: {
|
|
440
443
|
fieldId: q.id,
|
|
441
444
|
name: e("healthybowl.fieldMapPage.beds.bedName", "Bed {{n}}", { n: String(n + 1) }),
|
|
442
445
|
boundary: t,
|
|
443
446
|
area: r,
|
|
444
447
|
unit: "sqm",
|
|
445
|
-
widthM:
|
|
446
|
-
orientationDeg:
|
|
447
|
-
cropId:
|
|
448
|
+
widthM: F,
|
|
449
|
+
orientationDeg: I,
|
|
450
|
+
cropId: Sr?.id ?? void 0,
|
|
448
451
|
plantCount: i,
|
|
449
|
-
context: { workspaceId:
|
|
452
|
+
context: { workspaceId: s }
|
|
450
453
|
} } });
|
|
451
|
-
}), await
|
|
454
|
+
}), await Er(), T({
|
|
452
455
|
title: e("healthybowl.fieldMapPage.beds.saved.title", "Bed layout saved"),
|
|
453
456
|
description: e("healthybowl.fieldMapPage.beds.saved.description", "Saved {{count}} beds for {{name}}.", {
|
|
454
457
|
count: String(t.length),
|
|
@@ -457,31 +460,31 @@ var tt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
457
460
|
variant: "success"
|
|
458
461
|
});
|
|
459
462
|
} catch (t) {
|
|
460
|
-
|
|
463
|
+
T({
|
|
461
464
|
title: e("healthybowl.fieldMapPage.beds.saveFailed.title", "Could not save beds"),
|
|
462
465
|
description: String(t),
|
|
463
466
|
variant: "error"
|
|
464
467
|
});
|
|
465
468
|
} finally {
|
|
466
|
-
|
|
469
|
+
pn(!1);
|
|
467
470
|
}
|
|
468
471
|
}
|
|
469
472
|
}, [
|
|
470
|
-
|
|
473
|
+
Sr,
|
|
471
474
|
Y,
|
|
472
|
-
|
|
475
|
+
I,
|
|
473
476
|
J,
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
477
|
+
F,
|
|
478
|
+
kt,
|
|
479
|
+
jt,
|
|
480
|
+
Er,
|
|
478
481
|
X,
|
|
479
482
|
q,
|
|
480
483
|
e,
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
]),
|
|
484
|
-
if (!(!q || X.length === 0) && await
|
|
484
|
+
T,
|
|
485
|
+
s
|
|
486
|
+
]), Nr = l(async () => {
|
|
487
|
+
if (!(!q || X.length === 0) && await m({
|
|
485
488
|
title: e("healthybowl.fieldMapPage.beds.clearConfirm.title", "Clear saved beds?"),
|
|
486
489
|
message: e("healthybowl.fieldMapPage.beds.clearConfirm.description", "This deletes all {{count}} saved beds for {{name}}. You can re-generate and save again.", {
|
|
487
490
|
count: String(X.length),
|
|
@@ -489,79 +492,79 @@ var tt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
489
492
|
}),
|
|
490
493
|
okButtonTitle: e("healthybowl.common.delete", "Delete")
|
|
491
494
|
})) {
|
|
492
|
-
|
|
495
|
+
hn(!0);
|
|
493
496
|
try {
|
|
494
|
-
await
|
|
497
|
+
await ot(X, at, (e) => jt({ variables: {
|
|
495
498
|
id: e.id,
|
|
496
|
-
context: { workspaceId:
|
|
497
|
-
} })), await
|
|
499
|
+
context: { workspaceId: s }
|
|
500
|
+
} })), await Er(), T({
|
|
498
501
|
title: e("healthybowl.fieldMapPage.beds.cleared.title", "Saved beds cleared"),
|
|
499
502
|
description: e("healthybowl.fieldMapPage.beds.cleared.description", "Removed the saved layout."),
|
|
500
503
|
variant: "success"
|
|
501
504
|
});
|
|
502
505
|
} catch (t) {
|
|
503
|
-
|
|
506
|
+
T({
|
|
504
507
|
title: e("healthybowl.fieldMapPage.beds.saveFailed.title", "Could not save beds"),
|
|
505
508
|
description: String(t),
|
|
506
509
|
variant: "error"
|
|
507
510
|
});
|
|
508
511
|
} finally {
|
|
509
|
-
|
|
512
|
+
hn(!1);
|
|
510
513
|
}
|
|
511
514
|
}
|
|
512
515
|
}, [
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
+
m,
|
|
517
|
+
jt,
|
|
518
|
+
Er,
|
|
516
519
|
X,
|
|
517
520
|
q,
|
|
518
521
|
e,
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
]),
|
|
522
|
-
if (!
|
|
523
|
-
let t =
|
|
524
|
-
|
|
522
|
+
T,
|
|
523
|
+
s
|
|
524
|
+
]), Pr = l(async () => {
|
|
525
|
+
if (!L) return;
|
|
526
|
+
let t = g.find((e) => e.id === _n) ?? null, n = be(t), r = ae(L.boundary), i = he(L.area ?? (r ? c(r) : 0), L.widthM ?? F, n.plantSpacingCm, n.rowSpacingCm);
|
|
527
|
+
bn(!0);
|
|
525
528
|
try {
|
|
526
|
-
await
|
|
527
|
-
id:
|
|
528
|
-
cropId:
|
|
529
|
+
await At({ variables: { input: {
|
|
530
|
+
id: L.id,
|
|
531
|
+
cropId: _n || null,
|
|
529
532
|
plantCount: i,
|
|
530
|
-
context: { workspaceId:
|
|
531
|
-
} } }), await
|
|
533
|
+
context: { workspaceId: s }
|
|
534
|
+
} } }), await Er(), gn(null), T({
|
|
532
535
|
title: e("healthybowl.fieldMapPage.beds.assigned.title", "Crop assigned"),
|
|
533
536
|
description: t ? e("healthybowl.fieldMapPage.beds.assigned.description", "{{bed}}: {{crop}} · {{plants}} plants.", {
|
|
534
|
-
bed:
|
|
537
|
+
bed: L.name,
|
|
535
538
|
crop: t.name,
|
|
536
539
|
plants: String(i)
|
|
537
|
-
}) : e("healthybowl.fieldMapPage.beds.assigned.cleared", "{{bed}}: crop cleared.", { bed:
|
|
540
|
+
}) : e("healthybowl.fieldMapPage.beds.assigned.cleared", "{{bed}}: crop cleared.", { bed: L.name }),
|
|
538
541
|
variant: "success"
|
|
539
542
|
});
|
|
540
543
|
} catch (t) {
|
|
541
|
-
|
|
544
|
+
T({
|
|
542
545
|
title: e("healthybowl.fieldMapPage.beds.assignFailed.title", "Could not assign crop"),
|
|
543
546
|
description: String(t),
|
|
544
547
|
variant: "error"
|
|
545
548
|
});
|
|
546
549
|
} finally {
|
|
547
|
-
|
|
550
|
+
bn(!1);
|
|
548
551
|
}
|
|
549
552
|
}, [
|
|
550
|
-
z,
|
|
551
|
-
sn,
|
|
552
553
|
L,
|
|
553
|
-
|
|
554
|
-
|
|
554
|
+
_n,
|
|
555
|
+
F,
|
|
556
|
+
g,
|
|
557
|
+
Er,
|
|
555
558
|
e,
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
]),
|
|
560
|
-
let t =
|
|
559
|
+
T,
|
|
560
|
+
At,
|
|
561
|
+
s
|
|
562
|
+
]), Fr = l((e) => {
|
|
563
|
+
let t = V.current;
|
|
561
564
|
if (!t) return;
|
|
562
|
-
let n =
|
|
565
|
+
let n = E(e);
|
|
563
566
|
if (n) try {
|
|
564
|
-
let e =
|
|
567
|
+
let e = C.default.geoJSON(n).getBounds();
|
|
565
568
|
if (e.isValid()) {
|
|
566
569
|
t.fitBounds(e, {
|
|
567
570
|
padding: [40, 40],
|
|
@@ -570,30 +573,30 @@ var tt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
570
573
|
return;
|
|
571
574
|
}
|
|
572
575
|
} catch {}
|
|
573
|
-
|
|
574
|
-
}, []),
|
|
575
|
-
K.current === "draw" || K.current === "measure" || (
|
|
576
|
-
}, [
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
}, [
|
|
580
|
-
let
|
|
581
|
-
let t =
|
|
576
|
+
xt(e.location) && t.flyTo([e.location.lat, e.location.lng], ft, { duration: .6 });
|
|
577
|
+
}, []), Ir = l((e) => {
|
|
578
|
+
K.current === "draw" || K.current === "measure" || (M(e.id), Fr(e));
|
|
579
|
+
}, [Fr]);
|
|
580
|
+
u(() => {
|
|
581
|
+
j && document.querySelector(`[data-field-id="${j}"]`)?.scrollIntoView({ block: "nearest" });
|
|
582
|
+
}, [j]);
|
|
583
|
+
let Lr = l(() => {
|
|
584
|
+
let t = V.current, n = $n.current;
|
|
582
585
|
if (!t || !n) return;
|
|
583
586
|
n.clearLayers();
|
|
584
587
|
let r = [];
|
|
585
|
-
for (let t of
|
|
586
|
-
if (
|
|
587
|
-
let i = t.id ===
|
|
588
|
-
if (
|
|
589
|
-
let e =
|
|
588
|
+
for (let t of h) {
|
|
589
|
+
if (k === "edit" && t.id === j) continue;
|
|
590
|
+
let i = t.id === j, a = N[t.id], o = zt && a != null ? pe(a, gr, _r) : Lt ? de(t.soilType) : mt, ee = `${t.name} — ${Ct(t)}`, te = E(t);
|
|
591
|
+
if (te) {
|
|
592
|
+
let e = C.default.geoJSON(te, { style: () => ({
|
|
590
593
|
color: i ? "#ffffff" : o,
|
|
591
594
|
weight: i ? 5 : 2,
|
|
592
595
|
opacity: 1,
|
|
593
596
|
fillColor: o,
|
|
594
597
|
fillOpacity: i ? .62 : .5
|
|
595
598
|
}) });
|
|
596
|
-
e.on("click", () =>
|
|
599
|
+
e.on("click", () => M(t.id)), e.bindTooltip(ee, {
|
|
597
600
|
permanent: !0,
|
|
598
601
|
direction: "center",
|
|
599
602
|
className: "hb-field-label"
|
|
@@ -602,94 +605,124 @@ var tt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
602
605
|
let t = e.getBounds();
|
|
603
606
|
t.isValid() && r.push(t);
|
|
604
607
|
} catch {}
|
|
605
|
-
} else if (
|
|
606
|
-
let a =
|
|
608
|
+
} else if (xt(t.location)) {
|
|
609
|
+
let a = C.default.circleMarker([t.location.lat, t.location.lng], {
|
|
607
610
|
radius: i ? 9 : 7,
|
|
608
611
|
color: i ? "#ffffff" : "#fff",
|
|
609
612
|
weight: i ? 3 : 2,
|
|
610
613
|
fillColor: o,
|
|
611
614
|
fillOpacity: 1
|
|
612
615
|
});
|
|
613
|
-
a.on("click", () =>
|
|
616
|
+
a.on("click", () => M(t.id)), a.bindTooltip(`${t.name} (${e("healthybowl.fieldMapPage.unmapped", "no boundary")})`, {
|
|
614
617
|
permanent: !1,
|
|
615
618
|
direction: "top"
|
|
616
|
-
}), a.addTo(n), r.push(
|
|
619
|
+
}), a.addTo(n), r.push(C.default.latLngBounds([t.location.lat, t.location.lng], [t.location.lat, t.location.lng]));
|
|
617
620
|
}
|
|
618
621
|
}
|
|
619
|
-
if (!
|
|
620
|
-
let e = r.reduce((e, t) => e.extend(t),
|
|
622
|
+
if (!ur.current && r.length > 0) {
|
|
623
|
+
let e = r.reduce((e, t) => e.extend(t), C.default.latLngBounds(r[0].getSouthWest(), r[0].getNorthEast()));
|
|
621
624
|
try {
|
|
622
625
|
t.fitBounds(e, {
|
|
623
626
|
padding: [40, 40],
|
|
624
627
|
maxZoom: 17
|
|
625
|
-
}),
|
|
628
|
+
}), ur.current = !0;
|
|
626
629
|
} catch {}
|
|
627
630
|
}
|
|
628
631
|
}, [
|
|
629
|
-
|
|
632
|
+
h,
|
|
633
|
+
k,
|
|
630
634
|
j,
|
|
635
|
+
Lt,
|
|
636
|
+
zt,
|
|
631
637
|
N,
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
F,
|
|
635
|
-
cr,
|
|
636
|
-
lr,
|
|
638
|
+
gr,
|
|
639
|
+
_r,
|
|
637
640
|
e
|
|
638
641
|
]);
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
}, [
|
|
642
|
-
let Z =
|
|
643
|
-
|
|
644
|
-
}, []),
|
|
645
|
-
let e =
|
|
642
|
+
u(() => {
|
|
643
|
+
O === "ready" && Lr();
|
|
644
|
+
}, [Lr, O]);
|
|
645
|
+
let Z = l(() => {
|
|
646
|
+
H.current?.clearLayers(), or.current = null, G.current = [], Yt(0);
|
|
647
|
+
}, []), Rr = l(() => {
|
|
648
|
+
let e = H.current;
|
|
646
649
|
if (!e) return;
|
|
647
|
-
|
|
648
|
-
let t =
|
|
649
|
-
t.length >= 2 && (
|
|
650
|
-
}, []),
|
|
651
|
-
let t =
|
|
650
|
+
or.current &&= (e.removeLayer(or.current), null);
|
|
651
|
+
let t = G.current;
|
|
652
|
+
t.length >= 2 && (or.current = C.default.polygon(t, ht).addTo(e));
|
|
653
|
+
}, []), zr = l(() => {
|
|
654
|
+
let t = G.current;
|
|
652
655
|
if (t.length < 3) {
|
|
653
|
-
|
|
656
|
+
T({
|
|
654
657
|
title: e("healthybowl.fieldMapPage.toast.needPoints.title", "Need at least 3 points"),
|
|
655
658
|
description: e("healthybowl.fieldMapPage.toast.needPoints.description", "Click the map to add more corners."),
|
|
656
659
|
variant: "warning"
|
|
657
660
|
});
|
|
658
661
|
return;
|
|
659
662
|
}
|
|
660
|
-
let n =
|
|
663
|
+
let n = le(t.map((e) => ({
|
|
661
664
|
lat: e.lat,
|
|
662
665
|
lng: e.lng
|
|
663
666
|
})));
|
|
664
|
-
Z(), K.current = "view",
|
|
667
|
+
Z(), K.current = "view", A("view"), n && (zn({
|
|
665
668
|
boundary: n,
|
|
666
|
-
area:
|
|
667
|
-
centroid:
|
|
668
|
-
}),
|
|
669
|
+
area: se(n, "acres"),
|
|
670
|
+
centroid: ce(n) ?? [0, 0]
|
|
671
|
+
}), Un(""), Gn("Clay loam"), qn("Drip"), Yn("active"));
|
|
669
672
|
}, [
|
|
670
673
|
Z,
|
|
671
674
|
e,
|
|
672
|
-
|
|
673
|
-
]),
|
|
674
|
-
|
|
675
|
-
}, [Z]),
|
|
676
|
-
Z(), K.current = "view",
|
|
677
|
-
}, [Z]),
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
675
|
+
T
|
|
676
|
+
]), Br = l(() => {
|
|
677
|
+
M(null), Z(), K.current = "draw", A("draw");
|
|
678
|
+
}, [Z]), Vr = l(() => {
|
|
679
|
+
Z(), K.current = "view", A("view");
|
|
680
|
+
}, [Z]), Hr = l(() => {
|
|
681
|
+
let e = G.current;
|
|
682
|
+
if (e.length === 0) return;
|
|
683
|
+
e.pop();
|
|
684
|
+
let t = H.current;
|
|
685
|
+
t && (t.clearLayers(), or.current = null, e.forEach((e, n) => {
|
|
686
|
+
let r = n === 0, i = C.default.circleMarker(e, {
|
|
687
|
+
radius: r ? 7 : 5,
|
|
688
|
+
color: "#fff",
|
|
689
|
+
weight: 2,
|
|
690
|
+
fillColor: r ? "#16a34a" : "#f59e0b",
|
|
691
|
+
fillOpacity: 1
|
|
692
|
+
}).addTo(t);
|
|
693
|
+
r && i.on("click", (e) => {
|
|
694
|
+
C.default.DomEvent.stopPropagation(e), zr();
|
|
695
|
+
});
|
|
696
|
+
}), Rr()), Yt(e.length);
|
|
697
|
+
}, [zr, Rr]);
|
|
698
|
+
u(() => {
|
|
699
|
+
if (k !== "draw") return;
|
|
700
|
+
let e = (e) => {
|
|
701
|
+
let t = e.target;
|
|
702
|
+
t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.isContentEditable) || (e.key === "Backspace" || e.key === "Delete" ? (e.preventDefault(), Hr()) : e.key === "Escape" && (e.preventDefault(), Vr()));
|
|
703
|
+
};
|
|
704
|
+
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
705
|
+
}, [
|
|
706
|
+
k,
|
|
707
|
+
Hr,
|
|
708
|
+
Vr
|
|
709
|
+
]);
|
|
710
|
+
let Ur = l(() => {
|
|
711
|
+
er.current?.clearLayers(), cr.current = null, sr.current = [], Zt(null), $t(!1);
|
|
712
|
+
}, []), Wr = l(() => {
|
|
713
|
+
if (!er.current || !cr.current) return;
|
|
714
|
+
cr.current.setLatLngs(sr.current);
|
|
715
|
+
let e = le(sr.current.map((e) => ({
|
|
683
716
|
lat: e.lat,
|
|
684
717
|
lng: e.lng
|
|
685
718
|
})));
|
|
686
|
-
e &&
|
|
687
|
-
}, [q]),
|
|
688
|
-
let t =
|
|
719
|
+
e && Zt(se(e, q?.unit ?? "acres"));
|
|
720
|
+
}, [q]), Gr = l(() => {
|
|
721
|
+
let t = V.current, n = er.current;
|
|
689
722
|
if (!t || !n || !q) return;
|
|
690
|
-
let r =
|
|
723
|
+
let r = E(q);
|
|
691
724
|
if (!r) {
|
|
692
|
-
|
|
725
|
+
T({
|
|
693
726
|
title: e("healthybowl.fieldMapPage.toast.noBoundary.title", "No boundary to edit"),
|
|
694
727
|
description: e("healthybowl.fieldMapPage.toast.noBoundary.description", "Draw a boundary for this field first."),
|
|
695
728
|
variant: "warning"
|
|
@@ -697,38 +730,38 @@ var tt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
697
730
|
return;
|
|
698
731
|
}
|
|
699
732
|
n.clearLayers();
|
|
700
|
-
let i = r.coordinates[0].slice(0, -1).map(([e, t]) =>
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
icon:
|
|
733
|
+
let i = r.coordinates[0].slice(0, -1).map(([e, t]) => C.default.latLng(t, e));
|
|
734
|
+
sr.current = i, cr.current = C.default.polygon(i, gt).addTo(n), i.forEach((e, t) => {
|
|
735
|
+
C.default.marker(i[t], {
|
|
736
|
+
icon: wt,
|
|
704
737
|
draggable: !0
|
|
705
738
|
}).addTo(n).on("drag", (e) => {
|
|
706
|
-
|
|
739
|
+
sr.current[t] = e.target.getLatLng(), Wr(), $t(!0);
|
|
707
740
|
});
|
|
708
|
-
}), K.current = "edit",
|
|
741
|
+
}), K.current = "edit", A("edit"), $t(!1), Zt(se(r, q.unit));
|
|
709
742
|
}, [
|
|
710
|
-
|
|
743
|
+
Wr,
|
|
711
744
|
q,
|
|
712
745
|
e,
|
|
713
|
-
|
|
714
|
-
]),
|
|
715
|
-
|
|
716
|
-
}, [
|
|
746
|
+
T
|
|
747
|
+
]), Kr = l(() => {
|
|
748
|
+
Ur(), K.current = "view", A("view"), Lr();
|
|
749
|
+
}, [Ur, Lr]), qr = l(async () => {
|
|
717
750
|
if (!q) return;
|
|
718
|
-
let t =
|
|
751
|
+
let t = le(sr.current.map((e) => ({
|
|
719
752
|
lat: e.lat,
|
|
720
753
|
lng: e.lng
|
|
721
754
|
})));
|
|
722
755
|
if (t) {
|
|
723
|
-
|
|
756
|
+
tn(!0);
|
|
724
757
|
try {
|
|
725
|
-
let n =
|
|
726
|
-
await
|
|
758
|
+
let n = se(t, q.unit);
|
|
759
|
+
await D({ variables: { input: {
|
|
727
760
|
id: q.id,
|
|
728
761
|
boundary: t,
|
|
729
762
|
area: n,
|
|
730
|
-
context: { workspaceId:
|
|
731
|
-
} } }), await
|
|
763
|
+
context: { workspaceId: s }
|
|
764
|
+
} } }), await _(), Ur(), K.current = "view", A("view"), T({
|
|
732
765
|
title: e("healthybowl.fieldMapPage.toast.saved.title", "Boundary saved"),
|
|
733
766
|
description: e("healthybowl.fieldMapPage.toast.saved.description", "Area updated to {{area}} {{unit}}.", {
|
|
734
767
|
area: String(n),
|
|
@@ -737,49 +770,49 @@ var tt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
737
770
|
variant: "success"
|
|
738
771
|
});
|
|
739
772
|
} catch (t) {
|
|
740
|
-
|
|
773
|
+
T({
|
|
741
774
|
title: e("healthybowl.fieldMapPage.toast.saveFailed.title", "Save failed"),
|
|
742
775
|
description: String(t),
|
|
743
776
|
variant: "error"
|
|
744
777
|
});
|
|
745
778
|
} finally {
|
|
746
|
-
|
|
779
|
+
tn(!1);
|
|
747
780
|
}
|
|
748
781
|
}
|
|
749
782
|
}, [
|
|
750
|
-
|
|
751
|
-
|
|
783
|
+
Ur,
|
|
784
|
+
_,
|
|
752
785
|
q,
|
|
753
786
|
e,
|
|
787
|
+
T,
|
|
754
788
|
D,
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
]), zr = u(async () => {
|
|
789
|
+
s
|
|
790
|
+
]), Jr = l(async () => {
|
|
758
791
|
if (q) {
|
|
759
|
-
if (!
|
|
760
|
-
|
|
792
|
+
if (!E(q)) {
|
|
793
|
+
T({
|
|
761
794
|
title: e("healthybowl.fieldMapPage.toast.noBoundary.title", "No boundary to edit"),
|
|
762
795
|
description: e("healthybowl.fieldMapPage.toast.deleteNone.description", "This field has no boundary to delete."),
|
|
763
796
|
variant: "warning"
|
|
764
797
|
});
|
|
765
798
|
return;
|
|
766
799
|
}
|
|
767
|
-
if (await
|
|
800
|
+
if (await m({
|
|
768
801
|
title: e("healthybowl.fieldMapPage.confirmDelete.title", "Delete boundary?"),
|
|
769
802
|
message: e("healthybowl.fieldMapPage.confirmDelete.description", "This removes the drawn shape from {{name}}. The field record is kept.", { name: q.name }),
|
|
770
803
|
okButtonTitle: e("healthybowl.common.delete", "Delete")
|
|
771
804
|
})) try {
|
|
772
|
-
await
|
|
805
|
+
await D({ variables: { input: {
|
|
773
806
|
id: q.id,
|
|
774
807
|
boundary: null,
|
|
775
|
-
context: { workspaceId:
|
|
776
|
-
} } }), await
|
|
808
|
+
context: { workspaceId: s }
|
|
809
|
+
} } }), await _(), T({
|
|
777
810
|
title: e("healthybowl.fieldMapPage.toast.boundaryDeleted.title", "Boundary removed"),
|
|
778
811
|
description: e("healthybowl.fieldMapPage.toast.boundaryDeleted.description", "The drawn shape was cleared."),
|
|
779
812
|
variant: "success"
|
|
780
813
|
});
|
|
781
814
|
} catch (t) {
|
|
782
|
-
|
|
815
|
+
T({
|
|
783
816
|
title: e("healthybowl.fieldMapPage.toast.saveFailed.title", "Save failed"),
|
|
784
817
|
description: String(t),
|
|
785
818
|
variant: "error"
|
|
@@ -787,90 +820,90 @@ var tt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
787
820
|
}
|
|
788
821
|
}
|
|
789
822
|
}, [
|
|
790
|
-
|
|
791
|
-
|
|
823
|
+
m,
|
|
824
|
+
_,
|
|
792
825
|
q,
|
|
793
826
|
e,
|
|
827
|
+
T,
|
|
794
828
|
D,
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
let e = Kn.current;
|
|
829
|
+
s
|
|
830
|
+
]), Q = l(() => {
|
|
831
|
+
tr.current?.clearLayers(), lr.current = [], nn(null);
|
|
832
|
+
}, []), Yr = l(() => {
|
|
833
|
+
let e = tr.current;
|
|
801
834
|
if (!e) return;
|
|
802
835
|
e.clearLayers();
|
|
803
|
-
let t =
|
|
836
|
+
let t = lr.current;
|
|
804
837
|
t.forEach((t) => {
|
|
805
|
-
|
|
838
|
+
C.default.circleMarker(t, {
|
|
806
839
|
radius: 4,
|
|
807
840
|
color: "#38bdf8",
|
|
808
841
|
weight: 2,
|
|
809
842
|
fillColor: "#fff",
|
|
810
843
|
fillOpacity: 1
|
|
811
844
|
}).addTo(e);
|
|
812
|
-
}), t.length >= 2 &&
|
|
845
|
+
}), t.length >= 2 && C.default.polyline(t, _t).addTo(e);
|
|
813
846
|
let n = 0;
|
|
814
847
|
for (let e = 1; e < t.length; e++) n += t[e - 1].distanceTo(t[e]);
|
|
815
848
|
let r = null;
|
|
816
849
|
if (t.length >= 3) {
|
|
817
|
-
let e =
|
|
850
|
+
let e = le(t.map((e) => ({
|
|
818
851
|
lat: e.lat,
|
|
819
852
|
lng: e.lng
|
|
820
853
|
})));
|
|
821
|
-
e && (r =
|
|
854
|
+
e && (r = c(e));
|
|
822
855
|
}
|
|
823
|
-
|
|
856
|
+
nn({
|
|
824
857
|
distance: n,
|
|
825
858
|
area: r
|
|
826
859
|
});
|
|
827
|
-
}, []),
|
|
828
|
-
|
|
860
|
+
}, []), Xr = l(() => {
|
|
861
|
+
M(null), Q(), K.current = "measure", A("measure"), nn({
|
|
829
862
|
distance: 0,
|
|
830
863
|
area: null
|
|
831
864
|
});
|
|
832
|
-
}, [Q]),
|
|
833
|
-
Q(), K.current = "view",
|
|
834
|
-
}, [Q]),
|
|
835
|
-
|
|
836
|
-
}, []),
|
|
837
|
-
let e =
|
|
865
|
+
}, [Q]), Zr = l(() => {
|
|
866
|
+
Q(), K.current = "view", A("view");
|
|
867
|
+
}, [Q]), Qr = l(() => {
|
|
868
|
+
ir.current?.clearLayers(), ar.current = null, U.current = [], On(0);
|
|
869
|
+
}, []), $r = l(() => {
|
|
870
|
+
let e = ir.current, t = w.get(W.current ?? "");
|
|
838
871
|
if (!e || !t) return;
|
|
839
|
-
|
|
840
|
-
let n =
|
|
841
|
-
t.kind === "polygon" && n.length >= 2 ?
|
|
872
|
+
ar.current &&= (e.removeLayer(ar.current), null);
|
|
873
|
+
let n = U.current;
|
|
874
|
+
t.kind === "polygon" && n.length >= 2 ? ar.current = C.default.polygon(n, {
|
|
842
875
|
...t.style,
|
|
843
876
|
dashArray: "6 4"
|
|
844
|
-
}).addTo(e) : t.kind === "line" && n.length >= 2 && (
|
|
877
|
+
}).addTo(e) : t.kind === "line" && n.length >= 2 && (ar.current = C.default.polyline(n, {
|
|
845
878
|
...t.style,
|
|
846
879
|
dashArray: "6 4"
|
|
847
880
|
}).addTo(e));
|
|
848
|
-
}, []),
|
|
849
|
-
|
|
881
|
+
}, []), ei = l((e, t) => {
|
|
882
|
+
Qr(), En(null), W.current = null, K.current = "view", A("view"), jn(""), Nn(""), kn({
|
|
850
883
|
type: e,
|
|
851
884
|
geometry: t
|
|
852
885
|
});
|
|
853
|
-
}, [
|
|
854
|
-
let t =
|
|
886
|
+
}, [Qr]), ti = l(() => {
|
|
887
|
+
let t = w.get(W.current ?? "");
|
|
855
888
|
if (!t) return;
|
|
856
|
-
let n =
|
|
889
|
+
let n = U.current;
|
|
857
890
|
if (t.kind === "polygon") {
|
|
858
891
|
if (n.length < 3) {
|
|
859
|
-
|
|
892
|
+
T({
|
|
860
893
|
title: e("healthybowl.fieldMapPage.toast.needPoints.title", "Need at least 3 points"),
|
|
861
894
|
description: e("healthybowl.fieldMapPage.toast.needPoints.description", "Click the map to add more corners."),
|
|
862
895
|
variant: "warning"
|
|
863
896
|
});
|
|
864
897
|
return;
|
|
865
898
|
}
|
|
866
|
-
let r =
|
|
899
|
+
let r = le(n.map((e) => ({
|
|
867
900
|
lat: e.lat,
|
|
868
901
|
lng: e.lng
|
|
869
902
|
})));
|
|
870
|
-
r &&
|
|
903
|
+
r && ei(t.type, r);
|
|
871
904
|
} else if (t.kind === "line") {
|
|
872
905
|
if (n.length < 2) {
|
|
873
|
-
|
|
906
|
+
T({
|
|
874
907
|
title: e("healthybowl.fieldMapPage.toast.needLine.title", "Need at least 2 points"),
|
|
875
908
|
description: e("healthybowl.fieldMapPage.toast.needLine.description", "Click the map to add more points."),
|
|
876
909
|
variant: "warning"
|
|
@@ -881,526 +914,556 @@ var tt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
881
914
|
type: "LineString",
|
|
882
915
|
coordinates: n.map((e) => [e.lng, e.lat])
|
|
883
916
|
};
|
|
884
|
-
|
|
917
|
+
ei(t.type, r);
|
|
885
918
|
}
|
|
886
919
|
}, [
|
|
887
|
-
|
|
920
|
+
ei,
|
|
888
921
|
e,
|
|
889
|
-
|
|
890
|
-
]),
|
|
891
|
-
Z(),
|
|
922
|
+
T
|
|
923
|
+
]), ni = l((e) => {
|
|
924
|
+
Z(), Ur(), Q(), Qr(), M(null), In(null), wn(!1), w.has(e) && (En(e), W.current = e, K.current = "element", A("element"));
|
|
892
925
|
}, [
|
|
893
926
|
Z,
|
|
894
|
-
|
|
927
|
+
Ur,
|
|
895
928
|
Q,
|
|
896
|
-
|
|
897
|
-
]),
|
|
898
|
-
|
|
899
|
-
}, [
|
|
900
|
-
if (
|
|
929
|
+
Qr
|
|
930
|
+
]), ri = l(() => {
|
|
931
|
+
Qr(), En(null), W.current = null, K.current = "view", A("view");
|
|
932
|
+
}, [Qr]), ii = l((e) => {
|
|
933
|
+
if (V.current) {
|
|
901
934
|
if (K.current === "element") {
|
|
902
|
-
let t =
|
|
935
|
+
let t = w.get(W.current ?? "");
|
|
903
936
|
if (!t) return;
|
|
904
937
|
if (t.kind === "point") {
|
|
905
|
-
|
|
938
|
+
ei(t.type, {
|
|
906
939
|
type: "Point",
|
|
907
940
|
coordinates: [e.latlng.lng, e.latlng.lat]
|
|
908
941
|
});
|
|
909
942
|
return;
|
|
910
943
|
}
|
|
911
|
-
|
|
912
|
-
let n =
|
|
944
|
+
U.current.push(e.latlng);
|
|
945
|
+
let n = U.current.length === 1, r = C.default.circleMarker(e.latlng, {
|
|
913
946
|
radius: n ? 7 : 5,
|
|
914
947
|
color: "#fff",
|
|
915
948
|
weight: 2,
|
|
916
949
|
fillColor: t.color,
|
|
917
950
|
fillOpacity: 1
|
|
918
|
-
}).addTo(
|
|
951
|
+
}).addTo(ir.current);
|
|
919
952
|
n && t.kind === "polygon" && r.on("click", (e) => {
|
|
920
|
-
|
|
921
|
-
}),
|
|
953
|
+
C.default.DomEvent.stopPropagation(e), ti();
|
|
954
|
+
}), On(U.current.length), $r();
|
|
922
955
|
return;
|
|
923
956
|
}
|
|
924
957
|
if (K.current === "draw") {
|
|
925
|
-
|
|
926
|
-
let t =
|
|
958
|
+
G.current.push(e.latlng);
|
|
959
|
+
let t = G.current.length === 1, n = C.default.circleMarker(e.latlng, {
|
|
927
960
|
radius: t ? 7 : 5,
|
|
928
961
|
color: "#fff",
|
|
929
962
|
weight: 2,
|
|
930
963
|
fillColor: t ? "#16a34a" : "#f59e0b",
|
|
931
964
|
fillOpacity: 1
|
|
932
|
-
}).addTo(
|
|
965
|
+
}).addTo(H.current);
|
|
933
966
|
t && n.on("click", (e) => {
|
|
934
|
-
|
|
935
|
-
}),
|
|
936
|
-
} else K.current === "measure" && (
|
|
967
|
+
C.default.DomEvent.stopPropagation(e), zr();
|
|
968
|
+
}), Yt(G.current.length), Rr();
|
|
969
|
+
} else K.current === "measure" && (lr.current.push(e.latlng), Yr());
|
|
937
970
|
}
|
|
938
971
|
}, [
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
]),
|
|
972
|
+
zr,
|
|
973
|
+
Yr,
|
|
974
|
+
Rr,
|
|
975
|
+
ei,
|
|
976
|
+
ti,
|
|
977
|
+
$r
|
|
978
|
+
]), ai = l(async (n) => {
|
|
946
979
|
n.preventDefault();
|
|
947
|
-
let r =
|
|
980
|
+
let r = V.current, i = Wt.trim();
|
|
948
981
|
if (!r || !i) return;
|
|
949
982
|
let a = i.match(/^(-?\d+(?:\.\d+)?)\s*,\s*(-?\d+(?:\.\d+)?)$/);
|
|
950
983
|
if (a) {
|
|
951
|
-
r.flyTo([Number(a[1]), Number(a[2])],
|
|
984
|
+
r.flyTo([Number(a[1]), Number(a[2])], ft, { duration: .6 });
|
|
952
985
|
return;
|
|
953
986
|
}
|
|
954
|
-
|
|
987
|
+
qt(!0);
|
|
955
988
|
try {
|
|
956
989
|
let n = await t(i);
|
|
957
990
|
if (!n) {
|
|
958
|
-
|
|
991
|
+
T({
|
|
959
992
|
title: e("healthybowl.fieldMapPage.toast.placeNotFound.title", "Place not found"),
|
|
960
993
|
description: e("healthybowl.fieldMapPage.toast.placeNotFound.description", "Try a more specific place name."),
|
|
961
994
|
variant: "warning"
|
|
962
995
|
});
|
|
963
996
|
return;
|
|
964
997
|
}
|
|
965
|
-
r.flyTo([n.latitude, n.longitude],
|
|
998
|
+
r.flyTo([n.latitude, n.longitude], ft, { duration: .6 });
|
|
966
999
|
} catch (t) {
|
|
967
|
-
|
|
1000
|
+
T({
|
|
968
1001
|
title: e("healthybowl.fieldMapPage.toast.searchFailed.title", "Search failed"),
|
|
969
1002
|
description: t instanceof Error ? t.message : String(t),
|
|
970
1003
|
variant: "error"
|
|
971
1004
|
});
|
|
972
1005
|
} finally {
|
|
973
|
-
|
|
1006
|
+
qt(!1);
|
|
974
1007
|
}
|
|
975
1008
|
}, [
|
|
976
|
-
|
|
1009
|
+
Wt,
|
|
977
1010
|
e,
|
|
978
|
-
|
|
979
|
-
]),
|
|
980
|
-
if (
|
|
981
|
-
if (!
|
|
982
|
-
|
|
1011
|
+
T
|
|
1012
|
+
]), oi = l(async () => {
|
|
1013
|
+
if (B) {
|
|
1014
|
+
if (!Hn.trim()) {
|
|
1015
|
+
T({
|
|
983
1016
|
title: e("healthybowl.fieldMapPage.toast.nameRequired.title", "Name required"),
|
|
984
1017
|
description: e("healthybowl.fieldMapPage.toast.nameRequired.description", "Give the new field a name."),
|
|
985
1018
|
variant: "warning"
|
|
986
1019
|
});
|
|
987
1020
|
return;
|
|
988
1021
|
}
|
|
989
|
-
|
|
1022
|
+
Vn(!0);
|
|
990
1023
|
try {
|
|
991
|
-
let [t, n] =
|
|
992
|
-
name:
|
|
993
|
-
area:
|
|
1024
|
+
let [t, n] = B.centroid, r = await S({
|
|
1025
|
+
name: Hn.trim(),
|
|
1026
|
+
area: B.area,
|
|
994
1027
|
unit: "acres",
|
|
995
|
-
soilType:
|
|
996
|
-
irrigationType:
|
|
1028
|
+
soilType: Wn,
|
|
1029
|
+
irrigationType: Kn,
|
|
997
1030
|
organicCertified: !1,
|
|
998
|
-
status:
|
|
1031
|
+
status: Jn,
|
|
999
1032
|
crops: [],
|
|
1000
1033
|
location: {
|
|
1001
1034
|
lat: t,
|
|
1002
1035
|
lng: n
|
|
1003
1036
|
}
|
|
1004
1037
|
});
|
|
1005
|
-
r?.id && await
|
|
1038
|
+
r?.id && await D({ variables: { input: {
|
|
1006
1039
|
id: r.id,
|
|
1007
|
-
boundary:
|
|
1008
|
-
area:
|
|
1009
|
-
context: { workspaceId:
|
|
1010
|
-
} } }), await
|
|
1040
|
+
boundary: B.boundary,
|
|
1041
|
+
area: B.area,
|
|
1042
|
+
context: { workspaceId: s }
|
|
1043
|
+
} } }), await _(), zn(null), r?.id && M(r.id), T({
|
|
1011
1044
|
title: e("healthybowl.fieldMapPage.toast.fieldCreated.title", "Field created"),
|
|
1012
1045
|
description: e("healthybowl.fieldMapPage.toast.fieldCreated.description", "{{name}} saved at {{area}} acres.", {
|
|
1013
|
-
name:
|
|
1014
|
-
area: String(
|
|
1046
|
+
name: Hn.trim(),
|
|
1047
|
+
area: String(B.area)
|
|
1015
1048
|
}),
|
|
1016
1049
|
variant: "success"
|
|
1017
1050
|
});
|
|
1018
1051
|
} catch (t) {
|
|
1019
|
-
|
|
1052
|
+
T({
|
|
1020
1053
|
title: e("healthybowl.fieldMapPage.toast.createFailed.title", "Create failed"),
|
|
1021
1054
|
description: String(t),
|
|
1022
1055
|
variant: "error"
|
|
1023
1056
|
});
|
|
1024
1057
|
} finally {
|
|
1025
|
-
|
|
1058
|
+
Vn(!1);
|
|
1026
1059
|
}
|
|
1027
1060
|
}
|
|
1028
1061
|
}, [
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1062
|
+
S,
|
|
1063
|
+
Kn,
|
|
1064
|
+
Hn,
|
|
1065
|
+
Wn,
|
|
1066
|
+
Jn,
|
|
1067
|
+
B,
|
|
1068
|
+
_,
|
|
1036
1069
|
e,
|
|
1070
|
+
T,
|
|
1037
1071
|
D,
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
if (!
|
|
1042
|
-
|
|
1043
|
-
D({
|
|
1072
|
+
s
|
|
1073
|
+
]), si = l(async () => {
|
|
1074
|
+
if (!R) return;
|
|
1075
|
+
if (!An.trim()) {
|
|
1076
|
+
T({
|
|
1044
1077
|
title: e("healthybowl.fieldMapPage.toast.nameRequired.title", "Name required"),
|
|
1045
1078
|
description: e("healthybowl.fieldMapPage.elements.nameRequired", "Give this map element a name."),
|
|
1046
1079
|
variant: "warning"
|
|
1047
1080
|
});
|
|
1048
1081
|
return;
|
|
1049
1082
|
}
|
|
1050
|
-
let t =
|
|
1051
|
-
|
|
1083
|
+
let t = w.get(R.type);
|
|
1084
|
+
Fn(!0);
|
|
1052
1085
|
try {
|
|
1053
|
-
await
|
|
1054
|
-
name:
|
|
1055
|
-
type:
|
|
1056
|
-
geometry:
|
|
1057
|
-
notes:
|
|
1086
|
+
await Mt({ variables: { input: {
|
|
1087
|
+
name: An.trim(),
|
|
1088
|
+
type: R.type,
|
|
1089
|
+
geometry: R.geometry,
|
|
1090
|
+
notes: Mn.trim() || void 0,
|
|
1058
1091
|
color: t?.color,
|
|
1059
|
-
context: { workspaceId:
|
|
1060
|
-
} } }), await
|
|
1092
|
+
context: { workspaceId: s }
|
|
1093
|
+
} } }), await Or(), kn(null), T({
|
|
1061
1094
|
title: e("healthybowl.fieldMapPage.elements.saved.title", "Map element added"),
|
|
1062
|
-
description: e("healthybowl.fieldMapPage.elements.saved.description", "{{name}} saved to the map.", { name:
|
|
1095
|
+
description: e("healthybowl.fieldMapPage.elements.saved.description", "{{name}} saved to the map.", { name: An.trim() }),
|
|
1063
1096
|
variant: "success"
|
|
1064
1097
|
});
|
|
1065
1098
|
} catch (t) {
|
|
1066
|
-
|
|
1099
|
+
T({
|
|
1067
1100
|
title: e("healthybowl.fieldMapPage.elements.saveFailed.title", "Could not add element"),
|
|
1068
1101
|
description: String(t),
|
|
1069
1102
|
variant: "error"
|
|
1070
1103
|
});
|
|
1071
1104
|
} finally {
|
|
1072
|
-
|
|
1105
|
+
Fn(!1);
|
|
1073
1106
|
}
|
|
1074
1107
|
}, [
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1108
|
+
Mt,
|
|
1109
|
+
An,
|
|
1110
|
+
Mn,
|
|
1111
|
+
R,
|
|
1112
|
+
Or,
|
|
1080
1113
|
e,
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
]),
|
|
1084
|
-
if (
|
|
1114
|
+
T,
|
|
1115
|
+
s
|
|
1116
|
+
]), ci = l(async () => {
|
|
1117
|
+
if (z && await m({
|
|
1085
1118
|
title: e("healthybowl.fieldMapPage.elements.deleteConfirm.title", "Delete map element?"),
|
|
1086
|
-
message: e("healthybowl.fieldMapPage.elements.deleteConfirm.description", "This removes {{name}} from the map. This cannot be undone.", { name:
|
|
1119
|
+
message: e("healthybowl.fieldMapPage.elements.deleteConfirm.description", "This removes {{name}} from the map. This cannot be undone.", { name: z.name }),
|
|
1087
1120
|
okButtonTitle: e("healthybowl.common.delete", "Delete")
|
|
1088
1121
|
})) {
|
|
1089
|
-
|
|
1122
|
+
Rn(!0);
|
|
1090
1123
|
try {
|
|
1091
|
-
await
|
|
1092
|
-
id:
|
|
1093
|
-
context: { workspaceId:
|
|
1094
|
-
} }), await
|
|
1124
|
+
await Nt({ variables: {
|
|
1125
|
+
id: z.id,
|
|
1126
|
+
context: { workspaceId: s }
|
|
1127
|
+
} }), await Or(), In(null), T({
|
|
1095
1128
|
title: e("healthybowl.fieldMapPage.elements.deleted.title", "Map element removed"),
|
|
1096
1129
|
description: e("healthybowl.fieldMapPage.elements.deleted.description", "The element was deleted."),
|
|
1097
1130
|
variant: "success"
|
|
1098
1131
|
});
|
|
1099
1132
|
} catch (t) {
|
|
1100
|
-
|
|
1133
|
+
T({
|
|
1101
1134
|
title: e("healthybowl.fieldMapPage.elements.deleteFailed.title", "Could not delete element"),
|
|
1102
1135
|
description: String(t),
|
|
1103
1136
|
variant: "error"
|
|
1104
1137
|
});
|
|
1105
1138
|
} finally {
|
|
1106
|
-
|
|
1139
|
+
Rn(!1);
|
|
1107
1140
|
}
|
|
1108
1141
|
}
|
|
1109
1142
|
}, [
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1143
|
+
m,
|
|
1144
|
+
Nt,
|
|
1145
|
+
Or,
|
|
1146
|
+
z,
|
|
1114
1147
|
e,
|
|
1115
|
-
|
|
1116
|
-
|
|
1148
|
+
T,
|
|
1149
|
+
s
|
|
1117
1150
|
]);
|
|
1118
|
-
|
|
1119
|
-
let e =
|
|
1151
|
+
u(() => {
|
|
1152
|
+
let e = Xn.current;
|
|
1120
1153
|
if (!e) return;
|
|
1121
|
-
|
|
1122
|
-
let t =
|
|
1123
|
-
attribution:
|
|
1124
|
-
maxZoom:
|
|
1154
|
+
ie();
|
|
1155
|
+
let t = C.default.tileLayer(st, {
|
|
1156
|
+
attribution: ct,
|
|
1157
|
+
maxZoom: dt,
|
|
1125
1158
|
maxNativeZoom: 18
|
|
1126
|
-
}), n =
|
|
1127
|
-
attribution:
|
|
1128
|
-
maxZoom:
|
|
1159
|
+
}), n = C.default.tileLayer(lt, {
|
|
1160
|
+
attribution: ut,
|
|
1161
|
+
maxZoom: dt,
|
|
1129
1162
|
maxNativeZoom: 17,
|
|
1130
1163
|
opacity: .65
|
|
1131
1164
|
});
|
|
1132
|
-
|
|
1133
|
-
let r =
|
|
1165
|
+
Zn.current = t, Qn.current = n;
|
|
1166
|
+
let r = C.default.map(e, {
|
|
1134
1167
|
center: [20, 78],
|
|
1135
1168
|
zoom: 4,
|
|
1136
1169
|
scrollWheelZoom: !0,
|
|
1137
|
-
maxZoom:
|
|
1170
|
+
maxZoom: dt,
|
|
1138
1171
|
layers: [t]
|
|
1139
1172
|
});
|
|
1140
|
-
return
|
|
1141
|
-
r.off("click",
|
|
1173
|
+
return V.current = r, $n.current = C.default.layerGroup().addTo(r), nr.current = C.default.layerGroup().addTo(r), rr.current = C.default.layerGroup().addTo(r), H.current = C.default.layerGroup().addTo(r), er.current = C.default.layerGroup().addTo(r), tr.current = C.default.layerGroup().addTo(r), ir.current = C.default.layerGroup().addTo(r), r.on("click", ii), Pt("ready"), window.setTimeout(() => r.invalidateSize(), 80), () => {
|
|
1174
|
+
r.off("click", ii), r.remove(), V.current = null, Zn.current = null, Qn.current = null, $n.current = null, nr.current = null, rr.current = null, H.current = null, er.current = null, tr.current = null, ir.current = null;
|
|
1142
1175
|
};
|
|
1143
|
-
}, []),
|
|
1144
|
-
let e =
|
|
1145
|
-
!e || !t || (
|
|
1146
|
-
}, [
|
|
1147
|
-
let
|
|
1148
|
-
if (
|
|
1176
|
+
}, []), u(() => {
|
|
1177
|
+
let e = V.current, t = Qn.current;
|
|
1178
|
+
!e || !t || (Ft ? t.addTo(e) : e.removeLayer(t));
|
|
1179
|
+
}, [Ft]);
|
|
1180
|
+
let li = R ? w.get(R.type) ?? null : null, $ = z ? w.get(z.type) ?? null : null, ui = !Ie.crops && h.length === 0, di = P ? P.distance >= 1e3 ? `${(P.distance / 1e3).toFixed(2)} km` : `${P.distance.toFixed(0)} m` : "";
|
|
1181
|
+
if (Re.crops && h.length === 0) return /* @__PURE__ */ v(i, {
|
|
1149
1182
|
title: e("healthybowl.fieldMapPage.title", "Field Map"),
|
|
1150
1183
|
titleAccent: e("healthybowl.fieldMapPage.titleAccent", "Map"),
|
|
1151
1184
|
description: e("healthybowl.fieldMapPage.description", "Draw and manage your field boundaries on satellite imagery."),
|
|
1152
|
-
children: /* @__PURE__ */
|
|
1185
|
+
children: /* @__PURE__ */ v(o, { onRetry: _ })
|
|
1153
1186
|
});
|
|
1154
|
-
|
|
1187
|
+
if (!Ie.dashboard && !Ot) return /* @__PURE__ */ v(i, {
|
|
1188
|
+
title: e("healthybowl.fieldMapPage.title", "Field Map"),
|
|
1189
|
+
titleAccent: e("healthybowl.fieldMapPage.titleAccent", "Map"),
|
|
1190
|
+
description: e("healthybowl.fieldMapPage.description", "Draw and manage your field boundaries on satellite imagery."),
|
|
1191
|
+
children: /* @__PURE__ */ v(a, {
|
|
1192
|
+
illustration: "onboarding",
|
|
1193
|
+
title: e("healthybowl.fieldMapPage.noFarm.title", "Set up your farm first"),
|
|
1194
|
+
description: e("healthybowl.fieldMapPage.noFarm.description", "The Field Map attaches every boundary you draw to your farm. Create your farm, then come back to trace and save your fields on the satellite view."),
|
|
1195
|
+
action: /* @__PURE__ */ y(b, {
|
|
1196
|
+
onClick: () => Et(Dt("getting-started")),
|
|
1197
|
+
children: [
|
|
1198
|
+
/* @__PURE__ */ v(Oe, { className: "h-4 w-4" }),
|
|
1199
|
+
" ",
|
|
1200
|
+
e("healthybowl.fieldMapPage.noFarm.action", "Set up your farm")
|
|
1201
|
+
]
|
|
1202
|
+
})
|
|
1203
|
+
})
|
|
1204
|
+
});
|
|
1205
|
+
let fi = (e, t, n, r) => /* @__PURE__ */ y("button", {
|
|
1155
1206
|
type: "button",
|
|
1156
1207
|
onClick: t,
|
|
1157
1208
|
"aria-pressed": e,
|
|
1158
1209
|
className: `flex flex-col items-center gap-1 rounded-md px-3 py-1.5 text-[11px] font-medium transition-colors ${e ? "bg-success text-white" : "text-text-primary hover:bg-bg-sunken"}`,
|
|
1159
1210
|
children: [n, r]
|
|
1160
1211
|
});
|
|
1161
|
-
return /* @__PURE__ */
|
|
1212
|
+
return /* @__PURE__ */ y(i, {
|
|
1162
1213
|
title: e("healthybowl.fieldMapPage.title", "Field Map"),
|
|
1163
1214
|
titleAccent: e("healthybowl.fieldMapPage.titleAccent", "Map"),
|
|
1164
1215
|
hero: !0,
|
|
1165
1216
|
description: e("healthybowl.fieldMapPage.description", "Draw and manage your field boundaries on satellite imagery."),
|
|
1166
1217
|
purpose: "Trace each plot on the aerial view to auto-calculate its acreage, shade fields by soil type, overlay terrain, and see your whole holding at a glance. Click any field in the list to fly straight to it.",
|
|
1167
1218
|
children: [
|
|
1168
|
-
/* @__PURE__ */
|
|
1219
|
+
/* @__PURE__ */ y("div", {
|
|
1169
1220
|
className: "flex flex-col gap-4 lg:flex-row",
|
|
1170
|
-
children: [/* @__PURE__ */
|
|
1221
|
+
children: [/* @__PURE__ */ y("div", {
|
|
1171
1222
|
className: "min-w-0 flex-1 space-y-3",
|
|
1172
1223
|
children: [
|
|
1173
|
-
/* @__PURE__ */
|
|
1224
|
+
/* @__PURE__ */ y("form", {
|
|
1174
1225
|
className: "flex gap-2",
|
|
1175
|
-
onSubmit:
|
|
1176
|
-
children: [/* @__PURE__ */
|
|
1226
|
+
onSubmit: ai,
|
|
1227
|
+
children: [/* @__PURE__ */ y("div", {
|
|
1177
1228
|
className: "relative min-w-0 flex-1",
|
|
1178
|
-
children: [/* @__PURE__ */
|
|
1229
|
+
children: [/* @__PURE__ */ v(je, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ v("input", {
|
|
1179
1230
|
type: "search",
|
|
1180
|
-
value:
|
|
1181
|
-
onChange: (e) =>
|
|
1231
|
+
value: Wt,
|
|
1232
|
+
onChange: (e) => Gt(e.target.value),
|
|
1182
1233
|
placeholder: e("healthybowl.fieldMapPage.placeSearch.placeholder", "Find your farm — village, city, or lat,lng…"),
|
|
1183
1234
|
"aria-label": e("healthybowl.fieldMapPage.placeSearch.label", "Locate a place on the map"),
|
|
1184
1235
|
className: "h-9 w-full rounded-md border border-border-subtle bg-bg-surface py-2 pl-9 pr-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
1185
1236
|
})]
|
|
1186
|
-
}), /* @__PURE__ */ b
|
|
1237
|
+
}), /* @__PURE__ */ y(b, {
|
|
1187
1238
|
type: "submit",
|
|
1188
1239
|
variant: "outline",
|
|
1189
1240
|
size: "sm",
|
|
1190
|
-
disabled:
|
|
1241
|
+
disabled: O !== "ready" || Kt,
|
|
1191
1242
|
children: [
|
|
1192
|
-
/* @__PURE__ */
|
|
1243
|
+
/* @__PURE__ */ v(Te, { className: "h-4 w-4" }),
|
|
1193
1244
|
" ",
|
|
1194
|
-
|
|
1245
|
+
Kt ? e("healthybowl.fieldMapPage.placeSearch.searching", "Locating…") : e("healthybowl.fieldMapPage.placeSearch.action", "Locate")
|
|
1195
1246
|
]
|
|
1196
1247
|
})]
|
|
1197
1248
|
}),
|
|
1198
|
-
/* @__PURE__ */
|
|
1249
|
+
/* @__PURE__ */ y("div", {
|
|
1199
1250
|
className: "relative",
|
|
1200
1251
|
children: [
|
|
1201
|
-
/* @__PURE__ */
|
|
1202
|
-
ref:
|
|
1252
|
+
/* @__PURE__ */ v("div", {
|
|
1253
|
+
ref: Xn,
|
|
1203
1254
|
className: "h-[70vh] max-h-[640px] w-full overflow-hidden rounded-lg border border-border-subtle bg-bg-sunken"
|
|
1204
1255
|
}),
|
|
1205
|
-
|
|
1256
|
+
O === "ready" && /* @__PURE__ */ y("div", {
|
|
1206
1257
|
className: "absolute right-3 top-3 z-[1000] flex items-center gap-1 rounded-lg border border-border-subtle bg-bg-surface/95 p-1 shadow-md",
|
|
1207
1258
|
children: [
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
}, /* @__PURE__ */
|
|
1259
|
+
fi(k === "draw", () => k === "draw" ? Vr() : Br(), /* @__PURE__ */ v(De, { className: "h-4 w-4" }), e("healthybowl.fieldMapPage.tools.polygon", "Polygon")),
|
|
1260
|
+
fi(k === "edit", () => k === "edit" ? Kr() : Gr(), /* @__PURE__ */ v(Ne, { className: "h-4 w-4" }), e("healthybowl.fieldMapPage.tools.vertices", "Vertices")),
|
|
1261
|
+
fi(!1, Jr, /* @__PURE__ */ v(Fe, { className: "h-4 w-4" }), e("healthybowl.fieldMapPage.tools.delete", "Delete")),
|
|
1262
|
+
fi(k === "measure", () => k === "measure" ? Zr() : Xr(), /* @__PURE__ */ v(ke, { className: "h-4 w-4" }), e("healthybowl.fieldMapPage.tools.measure", "Measure")),
|
|
1263
|
+
fi(k === "element" || Cn, () => {
|
|
1264
|
+
k === "element" ? (ri(), wn(!1)) : wn((e) => !e);
|
|
1265
|
+
}, /* @__PURE__ */ v(Me, { className: "h-4 w-4" }), e("healthybowl.fieldMapPage.tools.elements", "Elements"))
|
|
1215
1266
|
]
|
|
1216
1267
|
}),
|
|
1217
|
-
|
|
1268
|
+
O === "ready" && Cn && k !== "element" && /* @__PURE__ */ y("div", {
|
|
1218
1269
|
className: "absolute right-3 top-16 z-[1001] w-60 rounded-lg border border-border-subtle bg-bg-surface/95 p-2 shadow-lg",
|
|
1219
|
-
children: [/* @__PURE__ */
|
|
1270
|
+
children: [/* @__PURE__ */ v("p", {
|
|
1220
1271
|
className: "px-1.5 pb-1 text-[11px] font-semibold uppercase tracking-wide text-text-secondary",
|
|
1221
1272
|
children: e("healthybowl.fieldMapPage.elements.menuTitle", "Add map element")
|
|
1222
|
-
}),
|
|
1273
|
+
}), nt.map((t) => {
|
|
1223
1274
|
let n = t.icon;
|
|
1224
|
-
return /* @__PURE__ */
|
|
1275
|
+
return /* @__PURE__ */ y("button", {
|
|
1225
1276
|
type: "button",
|
|
1226
|
-
onClick: () =>
|
|
1277
|
+
onClick: () => ni(t.type),
|
|
1227
1278
|
className: "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-text-primary transition-colors hover:bg-bg-sunken",
|
|
1228
1279
|
children: [
|
|
1229
|
-
/* @__PURE__ */
|
|
1280
|
+
/* @__PURE__ */ v(n, {
|
|
1230
1281
|
className: "h-4 w-4 shrink-0",
|
|
1231
1282
|
style: { color: t.color }
|
|
1232
1283
|
}),
|
|
1233
|
-
/* @__PURE__ */
|
|
1284
|
+
/* @__PURE__ */ v("span", {
|
|
1234
1285
|
className: "min-w-0 flex-1 truncate",
|
|
1235
1286
|
children: e(t.labelKey, t.label)
|
|
1236
1287
|
}),
|
|
1237
|
-
/* @__PURE__ */
|
|
1288
|
+
/* @__PURE__ */ v("span", {
|
|
1238
1289
|
className: "shrink-0 text-[10px] uppercase tracking-wide text-text-secondary",
|
|
1239
|
-
children: e(`healthybowl.fieldMapPage.elements.kind.${t.kind}`,
|
|
1290
|
+
children: e(`healthybowl.fieldMapPage.elements.kind.${t.kind}`, rt(t.kind))
|
|
1240
1291
|
})
|
|
1241
1292
|
]
|
|
1242
1293
|
}, t.type);
|
|
1243
1294
|
})]
|
|
1244
1295
|
}),
|
|
1245
|
-
|
|
1296
|
+
k === "draw" && /* @__PURE__ */ y("div", {
|
|
1246
1297
|
className: "absolute left-1/2 top-3 z-[1000] flex -translate-x-1/2 items-center gap-2 rounded-full bg-bg-surface/95 px-3 py-1.5 text-xs text-text-primary shadow-md",
|
|
1247
1298
|
children: [
|
|
1248
|
-
/* @__PURE__ */
|
|
1249
|
-
/* @__PURE__ */ b
|
|
1299
|
+
/* @__PURE__ */ v("span", { children: e("healthybowl.fieldMapPage.drawHint", "Click the map to add corners ({{count}}) — click the first point or Finish.", { count: String(Jt) }) }),
|
|
1300
|
+
/* @__PURE__ */ y(b, {
|
|
1301
|
+
size: "sm",
|
|
1302
|
+
variant: "outline",
|
|
1303
|
+
onClick: Hr,
|
|
1304
|
+
disabled: Jt === 0,
|
|
1305
|
+
title: e("healthybowl.fieldMapPage.undoCorner", "Undo last corner"),
|
|
1306
|
+
children: [
|
|
1307
|
+
/* @__PURE__ */ v(Le, { className: "h-3.5 w-3.5" }),
|
|
1308
|
+
" ",
|
|
1309
|
+
e("healthybowl.fieldMapPage.undo", "Undo")
|
|
1310
|
+
]
|
|
1311
|
+
}),
|
|
1312
|
+
/* @__PURE__ */ y(b, {
|
|
1250
1313
|
size: "sm",
|
|
1251
1314
|
variant: "default",
|
|
1252
|
-
onClick:
|
|
1315
|
+
onClick: zr,
|
|
1253
1316
|
children: [
|
|
1254
|
-
/* @__PURE__ */
|
|
1317
|
+
/* @__PURE__ */ v(Se, { className: "h-3.5 w-3.5" }),
|
|
1255
1318
|
" ",
|
|
1256
1319
|
e("healthybowl.fieldMapPage.finish", "Finish")
|
|
1257
1320
|
]
|
|
1258
1321
|
}),
|
|
1259
|
-
/* @__PURE__ */
|
|
1322
|
+
/* @__PURE__ */ v(b, {
|
|
1260
1323
|
size: "sm",
|
|
1261
1324
|
variant: "outline",
|
|
1262
|
-
onClick:
|
|
1263
|
-
children: /* @__PURE__ */
|
|
1325
|
+
onClick: Vr,
|
|
1326
|
+
children: /* @__PURE__ */ v(ze, { className: "h-3.5 w-3.5" })
|
|
1264
1327
|
})
|
|
1265
1328
|
]
|
|
1266
1329
|
}),
|
|
1267
|
-
|
|
1330
|
+
k === "edit" && /* @__PURE__ */ y("div", {
|
|
1268
1331
|
className: "absolute left-1/2 top-3 z-[1000] flex -translate-x-1/2 items-center gap-2 rounded-full bg-bg-surface/95 px-3 py-1.5 text-xs text-text-primary shadow-md",
|
|
1269
1332
|
children: [
|
|
1270
|
-
/* @__PURE__ */
|
|
1271
|
-
area: String(
|
|
1333
|
+
/* @__PURE__ */ v("span", { children: e("healthybowl.fieldMapPage.editHint", "Drag handles to reshape · {{area}} {{unit}}", {
|
|
1334
|
+
area: String(Xt ?? ""),
|
|
1272
1335
|
unit: q?.unit ?? "acres"
|
|
1273
1336
|
}) }),
|
|
1274
|
-
/* @__PURE__ */ b
|
|
1337
|
+
/* @__PURE__ */ y(b, {
|
|
1275
1338
|
size: "sm",
|
|
1276
1339
|
variant: "default",
|
|
1277
|
-
onClick:
|
|
1278
|
-
disabled: !
|
|
1340
|
+
onClick: qr,
|
|
1341
|
+
disabled: !Qt || en,
|
|
1279
1342
|
children: [
|
|
1280
|
-
/* @__PURE__ */
|
|
1343
|
+
/* @__PURE__ */ v(Ae, { className: "h-3.5 w-3.5" }),
|
|
1281
1344
|
" ",
|
|
1282
|
-
|
|
1345
|
+
en ? e("healthybowl.fieldMapPage.saving", "Saving…") : e("healthybowl.fieldMapPage.save", "Save")
|
|
1283
1346
|
]
|
|
1284
1347
|
}),
|
|
1285
|
-
/* @__PURE__ */
|
|
1348
|
+
/* @__PURE__ */ v(b, {
|
|
1286
1349
|
size: "sm",
|
|
1287
1350
|
variant: "outline",
|
|
1288
|
-
onClick:
|
|
1289
|
-
children: /* @__PURE__ */
|
|
1351
|
+
onClick: Kr,
|
|
1352
|
+
children: /* @__PURE__ */ v(ze, { className: "h-3.5 w-3.5" })
|
|
1290
1353
|
})
|
|
1291
1354
|
]
|
|
1292
1355
|
}),
|
|
1293
|
-
|
|
1356
|
+
k === "measure" && P && /* @__PURE__ */ y("div", {
|
|
1294
1357
|
className: "absolute left-1/2 top-3 z-[1000] flex -translate-x-1/2 items-center gap-3 rounded-full bg-bg-surface/95 px-3 py-1.5 text-xs text-text-primary shadow-md",
|
|
1295
1358
|
children: [
|
|
1296
|
-
/* @__PURE__ */
|
|
1297
|
-
/* @__PURE__ */
|
|
1359
|
+
/* @__PURE__ */ y("span", { children: [e("healthybowl.fieldMapPage.measure.distance", "Distance: {{d}}", { d: di }), P.area != null && ` · ${e("healthybowl.fieldMapPage.measure.area", "Area: {{a}} ac", { a: (P.area / 4046.8564224).toFixed(2) })}`] }),
|
|
1360
|
+
/* @__PURE__ */ v(b, {
|
|
1298
1361
|
size: "sm",
|
|
1299
1362
|
variant: "outline",
|
|
1300
1363
|
onClick: Q,
|
|
1301
1364
|
children: e("healthybowl.fieldMapPage.measure.reset", "Reset")
|
|
1302
1365
|
}),
|
|
1303
|
-
/* @__PURE__ */
|
|
1366
|
+
/* @__PURE__ */ v(b, {
|
|
1304
1367
|
size: "sm",
|
|
1305
1368
|
variant: "outline",
|
|
1306
|
-
onClick:
|
|
1307
|
-
children: /* @__PURE__ */
|
|
1369
|
+
onClick: Zr,
|
|
1370
|
+
children: /* @__PURE__ */ v(ze, { className: "h-3.5 w-3.5" })
|
|
1308
1371
|
})
|
|
1309
1372
|
]
|
|
1310
1373
|
}),
|
|
1311
|
-
|
|
1374
|
+
k === "element" && Ar && /* @__PURE__ */ y("div", {
|
|
1312
1375
|
className: "absolute left-1/2 top-3 z-[1000] flex -translate-x-1/2 items-center gap-2 rounded-full bg-bg-surface/95 px-3 py-1.5 text-xs text-text-primary shadow-md",
|
|
1313
1376
|
children: [
|
|
1314
|
-
/* @__PURE__ */
|
|
1315
|
-
|
|
1377
|
+
/* @__PURE__ */ v("span", { children: Ar.kind === "point" ? e("healthybowl.fieldMapPage.elements.hint.point", "Click the map to place {{label}}.", { label: e(Ar.labelKey, Ar.label) }) : Ar.kind === "line" ? e("healthybowl.fieldMapPage.elements.hint.line", "Click to add points ({{count}}) — then Finish.", { count: String(Dn) }) : e("healthybowl.fieldMapPage.elements.hint.polygon", "Click to add corners ({{count}}) — click the first point or Finish.", { count: String(Dn) }) }),
|
|
1378
|
+
Ar.kind !== "point" && /* @__PURE__ */ y(b, {
|
|
1316
1379
|
size: "sm",
|
|
1317
1380
|
variant: "default",
|
|
1318
|
-
onClick:
|
|
1381
|
+
onClick: ti,
|
|
1319
1382
|
children: [
|
|
1320
|
-
/* @__PURE__ */
|
|
1383
|
+
/* @__PURE__ */ v(Se, { className: "h-3.5 w-3.5" }),
|
|
1321
1384
|
" ",
|
|
1322
1385
|
e("healthybowl.fieldMapPage.finish", "Finish")
|
|
1323
1386
|
]
|
|
1324
1387
|
}),
|
|
1325
|
-
/* @__PURE__ */
|
|
1388
|
+
/* @__PURE__ */ v(b, {
|
|
1326
1389
|
size: "sm",
|
|
1327
1390
|
variant: "outline",
|
|
1328
|
-
onClick:
|
|
1329
|
-
children: /* @__PURE__ */
|
|
1391
|
+
onClick: ri,
|
|
1392
|
+
children: /* @__PURE__ */ v(ze, { className: "h-3.5 w-3.5" })
|
|
1330
1393
|
})
|
|
1331
1394
|
]
|
|
1332
1395
|
}),
|
|
1333
|
-
|
|
1396
|
+
O === "ready" && /* @__PURE__ */ y("div", {
|
|
1334
1397
|
className: "absolute bottom-3 left-3 z-[1000] rounded-lg border border-border-subtle bg-bg-surface/95 p-3 text-xs shadow-md",
|
|
1335
1398
|
children: [
|
|
1336
|
-
/* @__PURE__ */
|
|
1399
|
+
/* @__PURE__ */ y("div", {
|
|
1337
1400
|
className: "mb-1.5 flex items-center gap-1.5 font-semibold text-text-primary",
|
|
1338
1401
|
children: [
|
|
1339
|
-
/* @__PURE__ */
|
|
1402
|
+
/* @__PURE__ */ v(Ce, { className: "h-3.5 w-3.5" }),
|
|
1340
1403
|
" ",
|
|
1341
1404
|
e("healthybowl.fieldMapPage.layers.title", "Layers")
|
|
1342
1405
|
]
|
|
1343
1406
|
}),
|
|
1344
|
-
/* @__PURE__ */
|
|
1407
|
+
/* @__PURE__ */ y("label", {
|
|
1345
1408
|
className: "flex items-center gap-2 py-0.5 text-text-secondary",
|
|
1346
|
-
children: [/* @__PURE__ */
|
|
1409
|
+
children: [/* @__PURE__ */ v("input", {
|
|
1347
1410
|
type: "checkbox",
|
|
1348
1411
|
checked: !0,
|
|
1349
1412
|
readOnly: !0,
|
|
1350
1413
|
className: "h-3.5 w-3.5 accent-[var(--color-success)]"
|
|
1351
1414
|
}), e("healthybowl.fieldMapPage.layers.satellite", "Satellite")]
|
|
1352
1415
|
}),
|
|
1353
|
-
/* @__PURE__ */
|
|
1416
|
+
/* @__PURE__ */ y("label", {
|
|
1354
1417
|
className: "flex cursor-pointer items-center gap-2 py-0.5 text-text-primary",
|
|
1355
|
-
children: [/* @__PURE__ */
|
|
1418
|
+
children: [/* @__PURE__ */ v("input", {
|
|
1356
1419
|
type: "checkbox",
|
|
1357
|
-
checked:
|
|
1358
|
-
onChange: (e) =>
|
|
1420
|
+
checked: Ft,
|
|
1421
|
+
onChange: (e) => It(e.target.checked),
|
|
1359
1422
|
className: "h-3.5 w-3.5 accent-[var(--color-success)]"
|
|
1360
1423
|
}), e("healthybowl.fieldMapPage.layers.terrain", "Terrain")]
|
|
1361
1424
|
}),
|
|
1362
|
-
/* @__PURE__ */
|
|
1425
|
+
/* @__PURE__ */ y("label", {
|
|
1363
1426
|
className: "flex cursor-pointer items-center gap-2 py-0.5 text-text-primary",
|
|
1364
|
-
children: [/* @__PURE__ */
|
|
1427
|
+
children: [/* @__PURE__ */ v("input", {
|
|
1365
1428
|
type: "checkbox",
|
|
1366
|
-
checked:
|
|
1367
|
-
onChange: (e) =>
|
|
1429
|
+
checked: Lt,
|
|
1430
|
+
onChange: (e) => Rt(e.target.checked),
|
|
1368
1431
|
className: "h-3.5 w-3.5 accent-[var(--color-success)]"
|
|
1369
1432
|
}), e("healthybowl.fieldMapPage.layers.soil", "Soil type")]
|
|
1370
1433
|
}),
|
|
1371
|
-
/* @__PURE__ */
|
|
1434
|
+
/* @__PURE__ */ y("label", {
|
|
1372
1435
|
className: "flex cursor-pointer items-center gap-2 py-0.5 text-text-primary",
|
|
1373
|
-
children: [/* @__PURE__ */
|
|
1436
|
+
children: [/* @__PURE__ */ v("input", {
|
|
1374
1437
|
type: "checkbox",
|
|
1375
|
-
checked:
|
|
1376
|
-
onChange: (e) =>
|
|
1438
|
+
checked: zt,
|
|
1439
|
+
onChange: (e) => Bt(e.target.checked),
|
|
1377
1440
|
className: "h-3.5 w-3.5 accent-[var(--color-success)]"
|
|
1378
1441
|
}), e("healthybowl.fieldMapPage.layers.elevation", "Elevation")]
|
|
1379
1442
|
}),
|
|
1380
|
-
/* @__PURE__ */
|
|
1443
|
+
/* @__PURE__ */ y("label", {
|
|
1381
1444
|
className: "flex cursor-pointer items-center gap-2 py-0.5 text-text-primary",
|
|
1382
|
-
children: [/* @__PURE__ */
|
|
1445
|
+
children: [/* @__PURE__ */ v("input", {
|
|
1383
1446
|
type: "checkbox",
|
|
1384
|
-
checked:
|
|
1385
|
-
onChange: (e) =>
|
|
1447
|
+
checked: xn,
|
|
1448
|
+
onChange: (e) => Sn(e.target.checked),
|
|
1386
1449
|
className: "h-3.5 w-3.5 accent-[var(--color-success)]"
|
|
1387
1450
|
}), e("healthybowl.fieldMapPage.layers.elements", "Map elements")]
|
|
1388
1451
|
}),
|
|
1389
|
-
|
|
1452
|
+
xn && /* @__PURE__ */ y("div", {
|
|
1390
1453
|
className: "mt-1.5 max-h-40 overflow-y-auto border-t border-border-subtle pt-1.5",
|
|
1391
|
-
children: [/* @__PURE__ */
|
|
1454
|
+
children: [/* @__PURE__ */ v("div", {
|
|
1392
1455
|
className: "mb-1 text-[10px] font-semibold uppercase tracking-wide text-text-secondary",
|
|
1393
1456
|
children: e("healthybowl.fieldMapPage.elements.legendTitle", "Element types")
|
|
1394
|
-
}),
|
|
1457
|
+
}), nt.map((t) => {
|
|
1395
1458
|
let n = t.icon;
|
|
1396
|
-
return /* @__PURE__ */
|
|
1459
|
+
return /* @__PURE__ */ y("div", {
|
|
1397
1460
|
className: "flex items-center gap-2 py-0.5 text-text-secondary",
|
|
1398
1461
|
children: [
|
|
1399
|
-
/* @__PURE__ */
|
|
1462
|
+
/* @__PURE__ */ v("span", {
|
|
1400
1463
|
className: `inline-block shrink-0 ${t.kind === "line" ? "h-0.5 w-3.5 rounded-full" : "h-3 w-3 rounded-sm"}`,
|
|
1401
1464
|
style: { backgroundColor: t.color }
|
|
1402
1465
|
}),
|
|
1403
|
-
/* @__PURE__ */
|
|
1466
|
+
/* @__PURE__ */ v(n, {
|
|
1404
1467
|
className: "h-3 w-3 shrink-0",
|
|
1405
1468
|
style: { color: t.color }
|
|
1406
1469
|
}),
|
|
@@ -1411,71 +1474,71 @@ var tt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
1411
1474
|
})
|
|
1412
1475
|
]
|
|
1413
1476
|
}),
|
|
1414
|
-
|
|
1477
|
+
O === "ready" && zt && /* @__PURE__ */ y("div", {
|
|
1415
1478
|
className: "absolute bottom-3 right-3 z-[1000] rounded-lg border border-border-subtle bg-bg-surface/95 p-3 text-xs shadow-md",
|
|
1416
|
-
children: [/* @__PURE__ */
|
|
1479
|
+
children: [/* @__PURE__ */ v("div", {
|
|
1417
1480
|
className: "mb-1.5 font-semibold text-text-primary",
|
|
1418
1481
|
children: e("healthybowl.fieldMapPage.elevationLegend.title", "Elevation")
|
|
1419
|
-
}),
|
|
1482
|
+
}), vr ? /* @__PURE__ */ y(Ve, { children: [/* @__PURE__ */ v("span", {
|
|
1420
1483
|
className: "block h-2 w-40 rounded-full",
|
|
1421
1484
|
style: { background: "linear-gradient(to right, #16a34a, #f59e0b, #dc2626)" }
|
|
1422
|
-
}), /* @__PURE__ */
|
|
1485
|
+
}), /* @__PURE__ */ y("div", {
|
|
1423
1486
|
className: "mt-1 flex justify-between gap-3 text-text-secondary",
|
|
1424
|
-
children: [/* @__PURE__ */
|
|
1425
|
-
})] }) : /* @__PURE__ */
|
|
1487
|
+
children: [/* @__PURE__ */ v("span", { children: e("healthybowl.fieldMapPage.elevationLegend.low", "{{value}} m Low", { value: String(Math.round(gr)) }) }), /* @__PURE__ */ v("span", { children: e("healthybowl.fieldMapPage.elevationLegend.high", "{{value}} m High", { value: String(Math.round(_r)) }) })]
|
|
1488
|
+
})] }) : /* @__PURE__ */ v("span", {
|
|
1426
1489
|
className: "text-text-secondary",
|
|
1427
1490
|
children: e("healthybowl.fieldMapPage.elevationLegend.loading", "Loading elevation…")
|
|
1428
1491
|
})]
|
|
1429
1492
|
}),
|
|
1430
|
-
|
|
1493
|
+
O === "ready" && Lt && !zt && pr.length > 0 && /* @__PURE__ */ y("div", {
|
|
1431
1494
|
className: "absolute bottom-3 right-3 z-[1000] rounded-lg border border-border-subtle bg-bg-surface/95 p-3 text-xs shadow-md",
|
|
1432
|
-
children: [/* @__PURE__ */
|
|
1495
|
+
children: [/* @__PURE__ */ v("div", {
|
|
1433
1496
|
className: "mb-1.5 font-semibold text-text-primary",
|
|
1434
1497
|
children: e("healthybowl.fieldMapPage.soilLegend.title", "Soil Legend")
|
|
1435
|
-
}),
|
|
1498
|
+
}), pr.map((t) => /* @__PURE__ */ y("div", {
|
|
1436
1499
|
className: "flex items-center gap-2 py-0.5 text-text-secondary",
|
|
1437
|
-
children: [/* @__PURE__ */
|
|
1500
|
+
children: [/* @__PURE__ */ v("span", {
|
|
1438
1501
|
className: "inline-block h-3 w-3 rounded-sm",
|
|
1439
1502
|
style: { backgroundColor: t.color }
|
|
1440
1503
|
}), e(`healthybowl.fieldMapPage.soil.${t.key}`, t.label)]
|
|
1441
1504
|
}, t.key))]
|
|
1442
1505
|
}),
|
|
1443
|
-
|
|
1506
|
+
O === "ready" && Ft && /* @__PURE__ */ y("div", {
|
|
1444
1507
|
className: "absolute left-3 top-3 z-[1000] rounded-lg border border-border-subtle bg-bg-surface/95 px-3 py-2 text-[11px] text-text-secondary shadow-md",
|
|
1445
|
-
children: [/* @__PURE__ */
|
|
1508
|
+
children: [/* @__PURE__ */ v("div", {
|
|
1446
1509
|
className: "font-semibold text-text-primary",
|
|
1447
1510
|
children: e("healthybowl.fieldMapPage.terrainLegend.title", "Terrain / Elevation")
|
|
1448
|
-
}), /* @__PURE__ */
|
|
1511
|
+
}), /* @__PURE__ */ y("div", {
|
|
1449
1512
|
className: "mt-1 flex items-center gap-2",
|
|
1450
|
-
children: [/* @__PURE__ */
|
|
1513
|
+
children: [/* @__PURE__ */ v("span", { className: "inline-block h-2 w-16 rounded-full bg-gradient-to-r from-green-600 via-yellow-400 to-orange-500" }), /* @__PURE__ */ v("span", { children: e("healthybowl.fieldMapPage.terrainLegend.scale", "low → high (contours)") })]
|
|
1451
1514
|
})]
|
|
1452
1515
|
}),
|
|
1453
|
-
(
|
|
1516
|
+
(O === "loading" || Ie.crops && h.length === 0) && /* @__PURE__ */ v("div", {
|
|
1454
1517
|
className: "pointer-events-none absolute inset-0 z-[900] flex items-center justify-center rounded-lg bg-bg-surface/60 text-sm text-text-secondary",
|
|
1455
1518
|
children: e("healthybowl.fieldMapPage.loading", "Loading map…")
|
|
1456
1519
|
}),
|
|
1457
|
-
|
|
1520
|
+
ui && O === "ready" && k === "view" && /* @__PURE__ */ v("div", {
|
|
1458
1521
|
className: "absolute inset-0 z-[950] flex items-center justify-center p-6",
|
|
1459
|
-
children: /* @__PURE__ */
|
|
1522
|
+
children: /* @__PURE__ */ y("div", {
|
|
1460
1523
|
className: "max-w-sm rounded-xl border border-border-subtle bg-bg-surface/95 p-6 text-center shadow-lg",
|
|
1461
1524
|
children: [
|
|
1462
|
-
/* @__PURE__ */
|
|
1525
|
+
/* @__PURE__ */ v("div", {
|
|
1463
1526
|
className: "mx-auto mb-3 flex h-12 w-12 items-center justify-center rounded-full bg-success/15",
|
|
1464
|
-
children: /* @__PURE__ */
|
|
1527
|
+
children: /* @__PURE__ */ v(Ee, { className: "h-6 w-6 text-success" })
|
|
1465
1528
|
}),
|
|
1466
|
-
/* @__PURE__ */
|
|
1529
|
+
/* @__PURE__ */ v("h3", {
|
|
1467
1530
|
className: "text-lg font-semibold text-text-primary",
|
|
1468
1531
|
children: e("healthybowl.fieldMapPage.empty.title", "No field boundaries yet")
|
|
1469
1532
|
}),
|
|
1470
|
-
/* @__PURE__ */
|
|
1533
|
+
/* @__PURE__ */ v("p", {
|
|
1471
1534
|
className: "mt-1 text-sm text-text-secondary",
|
|
1472
1535
|
children: e("healthybowl.fieldMapPage.empty.description", "Draw the shape of each field on the satellite view to auto-calculate its area and unlock soil & terrain overlays.")
|
|
1473
1536
|
}),
|
|
1474
|
-
/* @__PURE__ */ b
|
|
1537
|
+
/* @__PURE__ */ y(b, {
|
|
1475
1538
|
className: "mt-4",
|
|
1476
|
-
onClick:
|
|
1539
|
+
onClick: Br,
|
|
1477
1540
|
children: [
|
|
1478
|
-
/* @__PURE__ */
|
|
1541
|
+
/* @__PURE__ */ v(Oe, { className: "h-4 w-4" }),
|
|
1479
1542
|
" ",
|
|
1480
1543
|
e("healthybowl.fieldMapPage.empty.action", "Draw Your First Field")
|
|
1481
1544
|
]
|
|
@@ -1485,108 +1548,108 @@ var tt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
1485
1548
|
})
|
|
1486
1549
|
]
|
|
1487
1550
|
}),
|
|
1488
|
-
/* @__PURE__ */
|
|
1551
|
+
/* @__PURE__ */ v("p", {
|
|
1489
1552
|
className: "text-xs text-text-secondary",
|
|
1490
1553
|
children: e("healthybowl.fieldMapPage.attribution", "Imagery © Esri, Maxar, Earthstar Geographics · terrain © OpenTopoMap / OpenStreetMap")
|
|
1491
1554
|
})
|
|
1492
1555
|
]
|
|
1493
|
-
}), /* @__PURE__ */
|
|
1556
|
+
}), /* @__PURE__ */ y("aside", {
|
|
1494
1557
|
className: "shrink-0 space-y-4 lg:w-80",
|
|
1495
1558
|
children: [
|
|
1496
|
-
/* @__PURE__ */
|
|
1559
|
+
/* @__PURE__ */ y("div", {
|
|
1497
1560
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
1498
1561
|
children: [
|
|
1499
|
-
/* @__PURE__ */
|
|
1562
|
+
/* @__PURE__ */ v("h2", {
|
|
1500
1563
|
className: "text-base font-semibold text-text-primary",
|
|
1501
1564
|
children: e("healthybowl.fieldMapPage.panel.title", "Fields")
|
|
1502
1565
|
}),
|
|
1503
|
-
/* @__PURE__ */
|
|
1566
|
+
/* @__PURE__ */ v("p", {
|
|
1504
1567
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
1505
1568
|
children: e("healthybowl.fieldMapPage.panel.summary", "{{acres}} acres · {{count}} fields · {{mapped}} mapped", {
|
|
1506
|
-
acres:
|
|
1507
|
-
count: String(
|
|
1508
|
-
mapped: String(
|
|
1569
|
+
acres: fr.toFixed(1),
|
|
1570
|
+
count: String(h.length),
|
|
1571
|
+
mapped: String(dr)
|
|
1509
1572
|
})
|
|
1510
1573
|
}),
|
|
1511
|
-
/* @__PURE__ */
|
|
1574
|
+
/* @__PURE__ */ y("div", {
|
|
1512
1575
|
className: "relative mt-3",
|
|
1513
|
-
children: [/* @__PURE__ */
|
|
1576
|
+
children: [/* @__PURE__ */ v(je, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ v("input", {
|
|
1514
1577
|
type: "search",
|
|
1515
|
-
value:
|
|
1516
|
-
onChange: (e) =>
|
|
1578
|
+
value: Ht,
|
|
1579
|
+
onChange: (e) => Ut(e.target.value),
|
|
1517
1580
|
placeholder: e("healthybowl.fieldMapPage.panel.search", "Search fields…"),
|
|
1518
1581
|
className: "h-9 w-full rounded-md border border-border-subtle bg-bg-surface py-2 pl-9 pr-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
1519
1582
|
})]
|
|
1520
1583
|
}),
|
|
1521
|
-
/* @__PURE__ */
|
|
1584
|
+
/* @__PURE__ */ y("div", {
|
|
1522
1585
|
className: "mt-3 max-h-[38vh] space-y-1 overflow-y-auto",
|
|
1523
|
-
children: [
|
|
1524
|
-
let n =
|
|
1525
|
-
return /* @__PURE__ */
|
|
1586
|
+
children: [mr.map((t) => {
|
|
1587
|
+
let n = E(t) !== null;
|
|
1588
|
+
return /* @__PURE__ */ y("button", {
|
|
1526
1589
|
type: "button",
|
|
1527
1590
|
"data-field-id": t.id,
|
|
1528
|
-
onClick: () =>
|
|
1529
|
-
className: `flex w-full items-center gap-3 rounded-md border px-2.5 py-2 text-left transition-colors ${t.id ===
|
|
1591
|
+
onClick: () => Ir(t),
|
|
1592
|
+
className: `flex w-full items-center gap-3 rounded-md border px-2.5 py-2 text-left transition-colors ${t.id === j ? "border-success bg-success/10" : "border-transparent hover:bg-bg-sunken"}`,
|
|
1530
1593
|
children: [
|
|
1531
|
-
/* @__PURE__ */
|
|
1594
|
+
/* @__PURE__ */ v("span", {
|
|
1532
1595
|
className: "mt-0.5 inline-block h-4 w-4 shrink-0 rounded",
|
|
1533
|
-
style: { backgroundColor:
|
|
1596
|
+
style: { backgroundColor: de(t.soilType) }
|
|
1534
1597
|
}),
|
|
1535
|
-
/* @__PURE__ */
|
|
1598
|
+
/* @__PURE__ */ y("span", {
|
|
1536
1599
|
className: "min-w-0 flex-1",
|
|
1537
|
-
children: [/* @__PURE__ */
|
|
1600
|
+
children: [/* @__PURE__ */ v("span", {
|
|
1538
1601
|
className: "block truncate text-sm font-medium text-text-primary",
|
|
1539
1602
|
children: t.name
|
|
1540
|
-
}), /* @__PURE__ */
|
|
1603
|
+
}), /* @__PURE__ */ y("span", {
|
|
1541
1604
|
className: "block truncate text-xs text-text-secondary",
|
|
1542
1605
|
children: [
|
|
1543
|
-
|
|
1606
|
+
Ct(t),
|
|
1544
1607
|
" ·",
|
|
1545
1608
|
" ",
|
|
1546
1609
|
t.soilType || e("healthybowl.fieldMapPage.unknownSoil", "Unknown soil"),
|
|
1547
|
-
|
|
1610
|
+
N[t.id] != null && ` · ${e("healthybowl.fieldMapPage.detail.elevationValue", "{{value}} m", { value: String(Math.round(N[t.id])) })}`
|
|
1548
1611
|
]
|
|
1549
1612
|
})]
|
|
1550
1613
|
}),
|
|
1551
|
-
!n && /* @__PURE__ */
|
|
1614
|
+
!n && /* @__PURE__ */ v("span", {
|
|
1552
1615
|
className: "shrink-0 rounded-full bg-warning/20 px-1.5 py-0.5 text-[10px] font-medium text-warning",
|
|
1553
1616
|
children: e("healthybowl.fieldMapPage.unmapped", "no boundary")
|
|
1554
1617
|
})
|
|
1555
1618
|
]
|
|
1556
1619
|
}, t.id);
|
|
1557
|
-
}),
|
|
1620
|
+
}), mr.length === 0 && /* @__PURE__ */ v("p", {
|
|
1558
1621
|
className: "px-2 py-4 text-center text-xs text-text-secondary",
|
|
1559
1622
|
children: e("healthybowl.fieldMapPage.panel.none", "No fields match your search.")
|
|
1560
1623
|
})]
|
|
1561
1624
|
}),
|
|
1562
|
-
/* @__PURE__ */ b
|
|
1625
|
+
/* @__PURE__ */ y(b, {
|
|
1563
1626
|
className: "mt-3 w-full",
|
|
1564
|
-
onClick:
|
|
1565
|
-
disabled:
|
|
1627
|
+
onClick: Br,
|
|
1628
|
+
disabled: k === "draw",
|
|
1566
1629
|
children: [
|
|
1567
|
-
/* @__PURE__ */
|
|
1630
|
+
/* @__PURE__ */ v(Oe, { className: "h-4 w-4" }),
|
|
1568
1631
|
" ",
|
|
1569
1632
|
e("healthybowl.fieldMapPage.panel.drawNew", "Draw New Field")
|
|
1570
1633
|
]
|
|
1571
1634
|
})
|
|
1572
1635
|
]
|
|
1573
1636
|
}),
|
|
1574
|
-
q && /* @__PURE__ */
|
|
1637
|
+
q && /* @__PURE__ */ y("div", {
|
|
1575
1638
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
1576
1639
|
children: [
|
|
1577
|
-
/* @__PURE__ */
|
|
1640
|
+
/* @__PURE__ */ v("h3", {
|
|
1578
1641
|
className: "text-sm font-semibold text-text-primary",
|
|
1579
1642
|
children: e("healthybowl.fieldMapPage.detail.selected", "Selected: {{name}}", { name: q.name })
|
|
1580
1643
|
}),
|
|
1581
|
-
/* @__PURE__ */
|
|
1644
|
+
/* @__PURE__ */ y("dl", {
|
|
1582
1645
|
className: "mt-3 space-y-2 text-sm",
|
|
1583
1646
|
children: [
|
|
1584
|
-
/* @__PURE__ */
|
|
1647
|
+
/* @__PURE__ */ y("div", {
|
|
1585
1648
|
className: "flex justify-between gap-3",
|
|
1586
|
-
children: [/* @__PURE__ */
|
|
1649
|
+
children: [/* @__PURE__ */ v("dt", {
|
|
1587
1650
|
className: "text-text-secondary",
|
|
1588
1651
|
children: e("healthybowl.fieldMapPage.detail.area", "Area")
|
|
1589
|
-
}), /* @__PURE__ */
|
|
1652
|
+
}), /* @__PURE__ */ y("dd", {
|
|
1590
1653
|
className: "font-medium text-text-primary",
|
|
1591
1654
|
children: [
|
|
1592
1655
|
q.area,
|
|
@@ -1595,78 +1658,78 @@ var tt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
1595
1658
|
]
|
|
1596
1659
|
})]
|
|
1597
1660
|
}),
|
|
1598
|
-
/* @__PURE__ */
|
|
1661
|
+
/* @__PURE__ */ y("div", {
|
|
1599
1662
|
className: "flex justify-between gap-3",
|
|
1600
|
-
children: [/* @__PURE__ */
|
|
1663
|
+
children: [/* @__PURE__ */ v("dt", {
|
|
1601
1664
|
className: "text-text-secondary",
|
|
1602
1665
|
children: e("healthybowl.fieldMapPage.detail.elevation", "Elevation")
|
|
1603
|
-
}), /* @__PURE__ */
|
|
1666
|
+
}), /* @__PURE__ */ v("dd", {
|
|
1604
1667
|
className: "font-medium text-text-primary",
|
|
1605
|
-
children:
|
|
1668
|
+
children: N[q.id] == null ? "—" : e("healthybowl.fieldMapPage.detail.elevationValue", "{{value}} m", { value: String(Math.round(N[q.id])) })
|
|
1606
1669
|
})]
|
|
1607
1670
|
}),
|
|
1608
|
-
/* @__PURE__ */
|
|
1671
|
+
/* @__PURE__ */ y("div", {
|
|
1609
1672
|
className: "flex justify-between gap-3",
|
|
1610
|
-
children: [/* @__PURE__ */
|
|
1673
|
+
children: [/* @__PURE__ */ v("dt", {
|
|
1611
1674
|
className: "text-text-secondary",
|
|
1612
1675
|
children: e("healthybowl.fieldMapPage.detail.soil", "Soil")
|
|
1613
|
-
}), /* @__PURE__ */
|
|
1676
|
+
}), /* @__PURE__ */ v("dd", {
|
|
1614
1677
|
className: "font-medium text-text-primary",
|
|
1615
1678
|
children: q.soilType || e("healthybowl.fieldMapPage.unknownSoil", "Unknown soil")
|
|
1616
1679
|
})]
|
|
1617
1680
|
}),
|
|
1618
|
-
/* @__PURE__ */
|
|
1681
|
+
/* @__PURE__ */ y("div", {
|
|
1619
1682
|
className: "flex justify-between gap-3",
|
|
1620
|
-
children: [/* @__PURE__ */
|
|
1683
|
+
children: [/* @__PURE__ */ v("dt", {
|
|
1621
1684
|
className: "text-text-secondary",
|
|
1622
1685
|
children: e("healthybowl.fieldMapPage.detail.irrigation", "Irrigation")
|
|
1623
|
-
}), /* @__PURE__ */
|
|
1686
|
+
}), /* @__PURE__ */ v("dd", {
|
|
1624
1687
|
className: "font-medium text-text-primary",
|
|
1625
1688
|
children: q.irrigationType || "—"
|
|
1626
1689
|
})]
|
|
1627
1690
|
}),
|
|
1628
|
-
/* @__PURE__ */
|
|
1691
|
+
/* @__PURE__ */ y("div", {
|
|
1629
1692
|
className: "flex justify-between gap-3",
|
|
1630
|
-
children: [/* @__PURE__ */
|
|
1693
|
+
children: [/* @__PURE__ */ v("dt", {
|
|
1631
1694
|
className: "text-text-secondary",
|
|
1632
1695
|
children: e("healthybowl.fieldMapPage.detail.crop", "Crop")
|
|
1633
|
-
}), /* @__PURE__ */
|
|
1696
|
+
}), /* @__PURE__ */ v("dd", {
|
|
1634
1697
|
className: "font-medium text-text-primary",
|
|
1635
|
-
children:
|
|
1698
|
+
children: yr(q) || e("healthybowl.fieldMapPage.detail.noCrop", "None")
|
|
1636
1699
|
})]
|
|
1637
1700
|
}),
|
|
1638
|
-
/* @__PURE__ */
|
|
1701
|
+
/* @__PURE__ */ y("div", {
|
|
1639
1702
|
className: "flex justify-between gap-3",
|
|
1640
|
-
children: [/* @__PURE__ */
|
|
1703
|
+
children: [/* @__PURE__ */ v("dt", {
|
|
1641
1704
|
className: "text-text-secondary",
|
|
1642
1705
|
children: e("healthybowl.fieldMapPage.detail.status", "Status")
|
|
1643
|
-
}), /* @__PURE__ */
|
|
1706
|
+
}), /* @__PURE__ */ v("dd", {
|
|
1644
1707
|
className: "font-medium capitalize text-text-primary",
|
|
1645
1708
|
children: q.status
|
|
1646
1709
|
})]
|
|
1647
1710
|
})
|
|
1648
1711
|
]
|
|
1649
1712
|
}),
|
|
1650
|
-
/* @__PURE__ */
|
|
1713
|
+
/* @__PURE__ */ y("div", {
|
|
1651
1714
|
className: "mt-3 flex gap-2",
|
|
1652
|
-
children: [/* @__PURE__ */ b
|
|
1715
|
+
children: [/* @__PURE__ */ y(b, {
|
|
1653
1716
|
variant: "outline",
|
|
1654
1717
|
size: "sm",
|
|
1655
1718
|
className: "flex-1",
|
|
1656
|
-
onClick: () =>
|
|
1719
|
+
onClick: () => Fr(q),
|
|
1657
1720
|
children: [
|
|
1658
|
-
/* @__PURE__ */
|
|
1721
|
+
/* @__PURE__ */ v(Ee, { className: "h-4 w-4" }),
|
|
1659
1722
|
" ",
|
|
1660
1723
|
e("healthybowl.fieldMapPage.detail.flyTo", "Fly to")
|
|
1661
1724
|
]
|
|
1662
|
-
}),
|
|
1725
|
+
}), E(q) && /* @__PURE__ */ y(b, {
|
|
1663
1726
|
variant: "outline",
|
|
1664
1727
|
size: "sm",
|
|
1665
1728
|
className: "flex-1",
|
|
1666
|
-
onClick:
|
|
1667
|
-
disabled:
|
|
1729
|
+
onClick: Gr,
|
|
1730
|
+
disabled: k === "edit",
|
|
1668
1731
|
children: [
|
|
1669
|
-
/* @__PURE__ */
|
|
1732
|
+
/* @__PURE__ */ v(Ne, { className: "h-4 w-4" }),
|
|
1670
1733
|
" ",
|
|
1671
1734
|
e("healthybowl.fieldMapPage.detail.edit", "Edit")
|
|
1672
1735
|
]
|
|
@@ -1674,97 +1737,97 @@ var tt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
1674
1737
|
})
|
|
1675
1738
|
]
|
|
1676
1739
|
}),
|
|
1677
|
-
q &&
|
|
1740
|
+
q && br && /* @__PURE__ */ y("div", {
|
|
1678
1741
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
1679
1742
|
children: [
|
|
1680
|
-
/* @__PURE__ */
|
|
1743
|
+
/* @__PURE__ */ y("div", {
|
|
1681
1744
|
className: "flex items-center justify-between gap-2",
|
|
1682
|
-
children: [/* @__PURE__ */
|
|
1745
|
+
children: [/* @__PURE__ */ y("h3", {
|
|
1683
1746
|
className: "flex items-center gap-1.5 text-sm font-semibold text-text-primary",
|
|
1684
1747
|
children: [
|
|
1685
|
-
/* @__PURE__ */
|
|
1748
|
+
/* @__PURE__ */ v(we, { className: "h-4 w-4" }),
|
|
1686
1749
|
" ",
|
|
1687
1750
|
e("healthybowl.fieldMapPage.beds.title", "Bed layout")
|
|
1688
1751
|
]
|
|
1689
|
-
}), /* @__PURE__ */
|
|
1752
|
+
}), /* @__PURE__ */ y("label", {
|
|
1690
1753
|
className: "flex cursor-pointer items-center gap-2 text-xs font-medium text-text-primary",
|
|
1691
|
-
children: [/* @__PURE__ */
|
|
1754
|
+
children: [/* @__PURE__ */ v("input", {
|
|
1692
1755
|
type: "checkbox",
|
|
1693
|
-
checked:
|
|
1694
|
-
onChange: (e) =>
|
|
1756
|
+
checked: rn,
|
|
1757
|
+
onChange: (e) => an(e.target.checked),
|
|
1695
1758
|
className: "h-3.5 w-3.5 accent-[var(--color-success)]"
|
|
1696
1759
|
}), e("healthybowl.fieldMapPage.beds.show", "Show beds")]
|
|
1697
1760
|
})]
|
|
1698
1761
|
}),
|
|
1699
|
-
/* @__PURE__ */
|
|
1762
|
+
/* @__PURE__ */ v("p", {
|
|
1700
1763
|
className: "mt-1 text-xs text-text-secondary",
|
|
1701
1764
|
children: e("healthybowl.fieldMapPage.beds.hint", "Draw planting bed strips inside this field, then save the layout. Click a saved bed to assign a crop.")
|
|
1702
1765
|
}),
|
|
1703
|
-
/* @__PURE__ */
|
|
1766
|
+
/* @__PURE__ */ y("div", {
|
|
1704
1767
|
className: "mt-3 grid grid-cols-2 gap-3",
|
|
1705
|
-
children: [/* @__PURE__ */
|
|
1768
|
+
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
1706
1769
|
className: "text-xs font-medium text-text-primary",
|
|
1707
1770
|
children: e("healthybowl.fieldMapPage.beds.bedWidth", "Bed width (m)")
|
|
1708
|
-
}), /* @__PURE__ */
|
|
1771
|
+
}), /* @__PURE__ */ v("input", {
|
|
1709
1772
|
type: "number",
|
|
1710
1773
|
min: .2,
|
|
1711
1774
|
step: .1,
|
|
1712
|
-
value:
|
|
1713
|
-
onChange: (e) =>
|
|
1775
|
+
value: F,
|
|
1776
|
+
onChange: (e) => on(Math.max(.2, Number(e.target.value) || 0)),
|
|
1714
1777
|
className: "mt-1 h-9 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)]"
|
|
1715
|
-
})] }), /* @__PURE__ */
|
|
1778
|
+
})] }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
1716
1779
|
className: "text-xs font-medium text-text-primary",
|
|
1717
1780
|
children: e("healthybowl.fieldMapPage.beds.pathWidth", "Path width (m)")
|
|
1718
|
-
}), /* @__PURE__ */
|
|
1781
|
+
}), /* @__PURE__ */ v("input", {
|
|
1719
1782
|
type: "number",
|
|
1720
1783
|
min: 0,
|
|
1721
1784
|
step: .05,
|
|
1722
|
-
value:
|
|
1723
|
-
onChange: (e) =>
|
|
1785
|
+
value: sn,
|
|
1786
|
+
onChange: (e) => cn(Math.max(0, Number(e.target.value) || 0)),
|
|
1724
1787
|
className: "mt-1 h-9 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)]"
|
|
1725
1788
|
})] })]
|
|
1726
1789
|
}),
|
|
1727
|
-
/* @__PURE__ */
|
|
1790
|
+
/* @__PURE__ */ y("div", {
|
|
1728
1791
|
className: "mt-3",
|
|
1729
|
-
children: [/* @__PURE__ */
|
|
1792
|
+
children: [/* @__PURE__ */ y("div", {
|
|
1730
1793
|
className: "flex items-center justify-between",
|
|
1731
|
-
children: [/* @__PURE__ */
|
|
1794
|
+
children: [/* @__PURE__ */ v("label", {
|
|
1732
1795
|
className: "text-xs font-medium text-text-primary",
|
|
1733
1796
|
children: e("healthybowl.fieldMapPage.beds.orientation", "Orientation")
|
|
1734
|
-
}), /* @__PURE__ */
|
|
1797
|
+
}), /* @__PURE__ */ y("span", {
|
|
1735
1798
|
className: "text-xs text-text-secondary",
|
|
1736
|
-
children: [
|
|
1799
|
+
children: [I, "°"]
|
|
1737
1800
|
})]
|
|
1738
|
-
}), /* @__PURE__ */
|
|
1801
|
+
}), /* @__PURE__ */ v("input", {
|
|
1739
1802
|
type: "range",
|
|
1740
1803
|
min: 0,
|
|
1741
1804
|
max: 180,
|
|
1742
1805
|
step: 1,
|
|
1743
|
-
value:
|
|
1744
|
-
onChange: (e) =>
|
|
1806
|
+
value: I,
|
|
1807
|
+
onChange: (e) => ln(Number(e.target.value)),
|
|
1745
1808
|
className: "mt-1 w-full accent-[var(--color-success)]",
|
|
1746
1809
|
"aria-label": e("healthybowl.fieldMapPage.beds.orientation", "Orientation")
|
|
1747
1810
|
})]
|
|
1748
1811
|
}),
|
|
1749
|
-
|
|
1812
|
+
g.length > 0 && /* @__PURE__ */ y("div", {
|
|
1750
1813
|
className: "mt-3",
|
|
1751
1814
|
children: [
|
|
1752
|
-
/* @__PURE__ */
|
|
1815
|
+
/* @__PURE__ */ v("label", {
|
|
1753
1816
|
className: "text-xs font-medium text-text-primary",
|
|
1754
1817
|
children: e("healthybowl.fieldMapPage.beds.crop", "Spacing for crop")
|
|
1755
1818
|
}),
|
|
1756
|
-
/* @__PURE__ */
|
|
1757
|
-
value:
|
|
1758
|
-
onValueChange:
|
|
1759
|
-
children: [/* @__PURE__ */
|
|
1819
|
+
/* @__PURE__ */ y(He, {
|
|
1820
|
+
value: Sr?.id ?? "",
|
|
1821
|
+
onValueChange: dn,
|
|
1822
|
+
children: [/* @__PURE__ */ v(We, {
|
|
1760
1823
|
className: "mt-1 w-full",
|
|
1761
|
-
children: /* @__PURE__ */
|
|
1762
|
-
}), /* @__PURE__ */
|
|
1824
|
+
children: /* @__PURE__ */ v(Ge, { placeholder: e("healthybowl.fieldMapPage.beds.cropPlaceholder", "Standard spacing") })
|
|
1825
|
+
}), /* @__PURE__ */ v(Ue, { children: g.map((e) => /* @__PURE__ */ v(x, {
|
|
1763
1826
|
value: e.id,
|
|
1764
1827
|
children: e.name
|
|
1765
1828
|
}, e.id)) })]
|
|
1766
1829
|
}),
|
|
1767
|
-
/* @__PURE__ */
|
|
1830
|
+
/* @__PURE__ */ v("p", {
|
|
1768
1831
|
className: "mt-1 text-[11px] text-text-secondary",
|
|
1769
1832
|
children: e("healthybowl.fieldMapPage.beds.spacingLine", "{{preset}} · {{plant}}×{{row}} cm", {
|
|
1770
1833
|
preset: J.label,
|
|
@@ -1774,156 +1837,166 @@ var tt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
1774
1837
|
})
|
|
1775
1838
|
]
|
|
1776
1839
|
}),
|
|
1777
|
-
Y && /* @__PURE__ */
|
|
1840
|
+
Y && /* @__PURE__ */ y("div", {
|
|
1778
1841
|
className: "mt-3 rounded-md bg-warning/10 px-3 py-2 text-sm font-medium text-text-primary",
|
|
1779
1842
|
children: [e("healthybowl.fieldMapPage.beds.readout", "{{beds}} beds · ~{{plants}} plants", {
|
|
1780
1843
|
beds: String(Y.bedCount),
|
|
1781
|
-
plants:
|
|
1782
|
-
}), /* @__PURE__ */
|
|
1844
|
+
plants: Cr.toLocaleString()
|
|
1845
|
+
}), /* @__PURE__ */ v("span", {
|
|
1783
1846
|
className: "ml-1 text-xs font-normal text-text-secondary",
|
|
1784
1847
|
children: e("healthybowl.fieldMapPage.beds.previewTag", "(preview)")
|
|
1785
1848
|
})]
|
|
1786
1849
|
}),
|
|
1787
|
-
X.length > 0 && /* @__PURE__ */
|
|
1850
|
+
X.length > 0 && /* @__PURE__ */ y("div", {
|
|
1788
1851
|
className: "mt-2 flex items-center gap-2 rounded-md bg-success/10 px-3 py-2 text-sm font-medium text-text-primary",
|
|
1789
|
-
children: [/* @__PURE__ */
|
|
1852
|
+
children: [/* @__PURE__ */ v("span", { className: "inline-block h-3 w-3 shrink-0 rounded-sm border border-[#065f46] bg-[#34d399]" }), e("healthybowl.fieldMapPage.beds.savedCount", "Saved ({{count}} beds)", { count: String(X.length) })]
|
|
1790
1853
|
}),
|
|
1791
|
-
|
|
1854
|
+
Tr && X.length === 0 && /* @__PURE__ */ v("p", {
|
|
1792
1855
|
className: "mt-2 text-xs text-text-secondary",
|
|
1793
1856
|
children: e("healthybowl.fieldMapPage.beds.loadingSaved", "Loading saved beds…")
|
|
1794
1857
|
}),
|
|
1795
|
-
/* @__PURE__ */
|
|
1858
|
+
/* @__PURE__ */ y("div", {
|
|
1796
1859
|
className: "mt-3 flex gap-2",
|
|
1797
|
-
children: [/* @__PURE__ */ b
|
|
1860
|
+
children: [/* @__PURE__ */ y(b, {
|
|
1798
1861
|
size: "sm",
|
|
1799
1862
|
className: "flex-1",
|
|
1800
|
-
onClick:
|
|
1801
|
-
disabled: !Y || Y.beds.length === 0 ||
|
|
1863
|
+
onClick: Mr,
|
|
1864
|
+
disabled: !Y || Y.beds.length === 0 || fn,
|
|
1802
1865
|
children: [
|
|
1803
|
-
/* @__PURE__ */
|
|
1866
|
+
/* @__PURE__ */ v(Ae, { className: "h-4 w-4" }),
|
|
1804
1867
|
" ",
|
|
1805
|
-
|
|
1868
|
+
fn ? e("healthybowl.fieldMapPage.beds.saving", "Saving…") : X.length > 0 ? e("healthybowl.fieldMapPage.beds.resave", "Save layout (replace)") : e("healthybowl.fieldMapPage.beds.save", "Save layout")
|
|
1806
1869
|
]
|
|
1807
|
-
}), X.length > 0 && /* @__PURE__ */ b
|
|
1870
|
+
}), X.length > 0 && /* @__PURE__ */ y(b, {
|
|
1808
1871
|
variant: "outline",
|
|
1809
1872
|
size: "sm",
|
|
1810
|
-
onClick:
|
|
1811
|
-
disabled:
|
|
1873
|
+
onClick: Nr,
|
|
1874
|
+
disabled: mn,
|
|
1812
1875
|
children: [
|
|
1813
|
-
/* @__PURE__ */
|
|
1876
|
+
/* @__PURE__ */ v(Fe, { className: "h-4 w-4" }),
|
|
1814
1877
|
" ",
|
|
1815
|
-
|
|
1878
|
+
mn ? e("healthybowl.fieldMapPage.beds.clearing", "Clearing…") : e("healthybowl.fieldMapPage.beds.clear", "Clear")
|
|
1816
1879
|
]
|
|
1817
1880
|
})]
|
|
1818
1881
|
}),
|
|
1819
|
-
Y && Y.bedCount >
|
|
1882
|
+
Y && Y.bedCount > it && /* @__PURE__ */ v("p", {
|
|
1820
1883
|
className: "mt-2 text-xs text-warning",
|
|
1821
|
-
children: e("healthybowl.fieldMapPage.beds.capHint", "Over the {{max}}-bed save limit — widen the beds to save this layout.", { max: String(
|
|
1884
|
+
children: e("healthybowl.fieldMapPage.beds.capHint", "Over the {{max}}-bed save limit — widen the beds to save this layout.", { max: String(it) })
|
|
1822
1885
|
})
|
|
1823
1886
|
]
|
|
1824
1887
|
})
|
|
1825
1888
|
]
|
|
1826
1889
|
})]
|
|
1827
1890
|
}),
|
|
1828
|
-
/* @__PURE__ */
|
|
1829
|
-
open:
|
|
1830
|
-
onClose: () =>
|
|
1891
|
+
/* @__PURE__ */ v(ne, {
|
|
1892
|
+
open: B !== null,
|
|
1893
|
+
onClose: () => zn(null),
|
|
1831
1894
|
title: e("healthybowl.fieldMapPage.create.title", "Save New Field"),
|
|
1832
1895
|
description: e("healthybowl.fieldMapPage.create.description", "Name the field you just drew. Its area is auto-calculated."),
|
|
1833
|
-
footer: /* @__PURE__ */
|
|
1896
|
+
footer: /* @__PURE__ */ y(Ve, { children: [/* @__PURE__ */ v(b, {
|
|
1834
1897
|
variant: "outline",
|
|
1835
|
-
onClick: () =>
|
|
1898
|
+
onClick: () => zn(null),
|
|
1836
1899
|
className: "text-text-secondary",
|
|
1837
1900
|
children: e("healthybowl.common.cancel", "Cancel")
|
|
1838
|
-
}), /* @__PURE__ */
|
|
1839
|
-
onClick:
|
|
1840
|
-
disabled:
|
|
1841
|
-
children:
|
|
1901
|
+
}), /* @__PURE__ */ v(b, {
|
|
1902
|
+
onClick: oi,
|
|
1903
|
+
disabled: Bn,
|
|
1904
|
+
children: Bn ? e("healthybowl.fieldMapPage.create.saving", "Saving…") : e("healthybowl.fieldMapPage.create.action", "Save Field")
|
|
1842
1905
|
})] }),
|
|
1843
|
-
children: /* @__PURE__ */
|
|
1906
|
+
children: /* @__PURE__ */ y("div", {
|
|
1844
1907
|
className: "space-y-4",
|
|
1845
1908
|
children: [
|
|
1846
|
-
/* @__PURE__ */
|
|
1909
|
+
/* @__PURE__ */ v("div", {
|
|
1847
1910
|
className: "rounded-md bg-success/10 px-3 py-2 text-sm text-text-primary",
|
|
1848
|
-
children: e("healthybowl.fieldMapPage.create.areaLine", "Auto-calculated area: {{area}} acres", { area: String(
|
|
1911
|
+
children: e("healthybowl.fieldMapPage.create.areaLine", "Auto-calculated area: {{area}} acres", { area: String(B?.area ?? 0) })
|
|
1849
1912
|
}),
|
|
1850
|
-
/* @__PURE__ */
|
|
1913
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
1851
1914
|
className: "text-sm font-medium text-text-primary",
|
|
1852
1915
|
children: e("healthybowl.fieldMapPage.create.name", "Field name *")
|
|
1853
|
-
}), /* @__PURE__ */
|
|
1916
|
+
}), /* @__PURE__ */ v("input", {
|
|
1854
1917
|
type: "text",
|
|
1855
|
-
value:
|
|
1856
|
-
onChange: (e) =>
|
|
1918
|
+
value: Hn,
|
|
1919
|
+
onChange: (e) => Un(e.target.value),
|
|
1857
1920
|
placeholder: e("healthybowl.fieldMapPage.create.namePlaceholder", "e.g., North Paddy"),
|
|
1858
1921
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
1859
1922
|
})] }),
|
|
1860
|
-
/* @__PURE__ */
|
|
1923
|
+
/* @__PURE__ */ y("div", {
|
|
1861
1924
|
className: "grid grid-cols-2 gap-3",
|
|
1862
|
-
children: [/* @__PURE__ */
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
children: /* @__PURE__ */
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
children:
|
|
1874
|
-
|
|
1875
|
-
|
|
1925
|
+
children: [/* @__PURE__ */ y("div", { children: [
|
|
1926
|
+
/* @__PURE__ */ v("label", {
|
|
1927
|
+
className: "text-sm font-medium text-text-primary",
|
|
1928
|
+
children: e("healthybowl.fieldMapPage.create.soil", "Soil type")
|
|
1929
|
+
}),
|
|
1930
|
+
/* @__PURE__ */ y(He, {
|
|
1931
|
+
value: Wn,
|
|
1932
|
+
onValueChange: Gn,
|
|
1933
|
+
children: [/* @__PURE__ */ v(We, {
|
|
1934
|
+
className: "mt-1 w-full",
|
|
1935
|
+
children: /* @__PURE__ */ v(Ge, {})
|
|
1936
|
+
}), /* @__PURE__ */ v(Ue, { children: ue.map((t) => /* @__PURE__ */ v(x, {
|
|
1937
|
+
value: t.label,
|
|
1938
|
+
children: e(`healthybowl.fieldMapPage.soil.${t.key}`, t.label)
|
|
1939
|
+
}, t.key)) })]
|
|
1940
|
+
}),
|
|
1941
|
+
/* @__PURE__ */ y("p", {
|
|
1942
|
+
className: "mt-1 flex items-center gap-1.5 text-xs text-text-secondary",
|
|
1943
|
+
children: [/* @__PURE__ */ v("span", {
|
|
1944
|
+
className: "inline-block h-3 w-3 shrink-0 rounded-sm border border-border-subtle",
|
|
1945
|
+
style: { backgroundColor: de(Wn) }
|
|
1946
|
+
}), e("healthybowl.fieldMapPage.create.soilHint", "The map shades each field by its soil type — pick the right one so fields stand apart.")]
|
|
1947
|
+
})
|
|
1948
|
+
] }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
1876
1949
|
className: "text-sm font-medium text-text-primary",
|
|
1877
1950
|
children: e("healthybowl.fieldMapPage.create.irrigation", "Irrigation")
|
|
1878
|
-
}), /* @__PURE__ */
|
|
1879
|
-
value:
|
|
1880
|
-
onValueChange:
|
|
1881
|
-
children: [/* @__PURE__ */
|
|
1951
|
+
}), /* @__PURE__ */ y(He, {
|
|
1952
|
+
value: Kn,
|
|
1953
|
+
onValueChange: qn,
|
|
1954
|
+
children: [/* @__PURE__ */ v(We, {
|
|
1882
1955
|
className: "mt-1 w-full",
|
|
1883
|
-
children: /* @__PURE__ */
|
|
1884
|
-
}), /* @__PURE__ */
|
|
1885
|
-
/* @__PURE__ */
|
|
1956
|
+
children: /* @__PURE__ */ v(Ge, {})
|
|
1957
|
+
}), /* @__PURE__ */ y(Ue, { children: [
|
|
1958
|
+
/* @__PURE__ */ v(x, {
|
|
1886
1959
|
value: "Drip",
|
|
1887
1960
|
children: e("healthybowl.fieldMapPage.irrigation.drip", "Drip")
|
|
1888
1961
|
}),
|
|
1889
|
-
/* @__PURE__ */
|
|
1962
|
+
/* @__PURE__ */ v(x, {
|
|
1890
1963
|
value: "Sprinkler",
|
|
1891
1964
|
children: e("healthybowl.fieldMapPage.irrigation.sprinkler", "Sprinkler")
|
|
1892
1965
|
}),
|
|
1893
|
-
/* @__PURE__ */
|
|
1966
|
+
/* @__PURE__ */ v(x, {
|
|
1894
1967
|
value: "Flood",
|
|
1895
1968
|
children: e("healthybowl.fieldMapPage.irrigation.flood", "Flood")
|
|
1896
1969
|
}),
|
|
1897
|
-
/* @__PURE__ */
|
|
1970
|
+
/* @__PURE__ */ v(x, {
|
|
1898
1971
|
value: "Rainfed",
|
|
1899
1972
|
children: e("healthybowl.fieldMapPage.irrigation.rainfed", "Rainfed")
|
|
1900
1973
|
}),
|
|
1901
|
-
/* @__PURE__ */
|
|
1974
|
+
/* @__PURE__ */ v(x, {
|
|
1902
1975
|
value: "None",
|
|
1903
1976
|
children: e("healthybowl.fieldMapPage.irrigation.none", "None")
|
|
1904
1977
|
})
|
|
1905
1978
|
] })]
|
|
1906
1979
|
})] })]
|
|
1907
1980
|
}),
|
|
1908
|
-
/* @__PURE__ */
|
|
1981
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
1909
1982
|
className: "text-sm font-medium text-text-primary",
|
|
1910
1983
|
children: e("healthybowl.fieldMapPage.create.status", "Status")
|
|
1911
|
-
}), /* @__PURE__ */
|
|
1912
|
-
value:
|
|
1913
|
-
onValueChange:
|
|
1914
|
-
children: [/* @__PURE__ */
|
|
1984
|
+
}), /* @__PURE__ */ y(He, {
|
|
1985
|
+
value: Jn,
|
|
1986
|
+
onValueChange: Yn,
|
|
1987
|
+
children: [/* @__PURE__ */ v(We, {
|
|
1915
1988
|
className: "mt-1 w-full",
|
|
1916
|
-
children: /* @__PURE__ */
|
|
1917
|
-
}), /* @__PURE__ */
|
|
1918
|
-
/* @__PURE__ */
|
|
1989
|
+
children: /* @__PURE__ */ v(Ge, {})
|
|
1990
|
+
}), /* @__PURE__ */ y(Ue, { children: [
|
|
1991
|
+
/* @__PURE__ */ v(x, {
|
|
1919
1992
|
value: "active",
|
|
1920
1993
|
children: e("healthybowl.fieldMapPage.status.active", "Active")
|
|
1921
1994
|
}),
|
|
1922
|
-
/* @__PURE__ */
|
|
1995
|
+
/* @__PURE__ */ v(x, {
|
|
1923
1996
|
value: "preparation",
|
|
1924
1997
|
children: e("healthybowl.fieldMapPage.status.preparation", "Preparation")
|
|
1925
1998
|
}),
|
|
1926
|
-
/* @__PURE__ */
|
|
1999
|
+
/* @__PURE__ */ v(x, {
|
|
1927
2000
|
value: "fallow",
|
|
1928
2001
|
children: e("healthybowl.fieldMapPage.status.fallow", "Fallow")
|
|
1929
2002
|
})
|
|
@@ -1932,39 +2005,39 @@ var tt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
1932
2005
|
]
|
|
1933
2006
|
})
|
|
1934
2007
|
}),
|
|
1935
|
-
/* @__PURE__ */
|
|
1936
|
-
open:
|
|
1937
|
-
onClose: () =>
|
|
1938
|
-
title: e("healthybowl.fieldMapPage.beds.assign.title", "Assign crop to {{bed}}", { bed:
|
|
2008
|
+
/* @__PURE__ */ v(ne, {
|
|
2009
|
+
open: L !== null,
|
|
2010
|
+
onClose: () => gn(null),
|
|
2011
|
+
title: e("healthybowl.fieldMapPage.beds.assign.title", "Assign crop to {{bed}}", { bed: L?.name ?? "" }),
|
|
1939
2012
|
description: e("healthybowl.fieldMapPage.beds.assign.description", "Pick a crop for this bed. Its plant count is recomputed from the crop's spacing."),
|
|
1940
|
-
footer: /* @__PURE__ */
|
|
2013
|
+
footer: /* @__PURE__ */ y(Ve, { children: [/* @__PURE__ */ v(b, {
|
|
1941
2014
|
variant: "outline",
|
|
1942
|
-
onClick: () =>
|
|
2015
|
+
onClick: () => gn(null),
|
|
1943
2016
|
className: "text-text-secondary",
|
|
1944
2017
|
children: e("healthybowl.common.cancel", "Cancel")
|
|
1945
|
-
}), /* @__PURE__ */
|
|
1946
|
-
onClick:
|
|
1947
|
-
disabled:
|
|
1948
|
-
children:
|
|
2018
|
+
}), /* @__PURE__ */ v(b, {
|
|
2019
|
+
onClick: Pr,
|
|
2020
|
+
disabled: yn,
|
|
2021
|
+
children: yn ? e("healthybowl.fieldMapPage.beds.assign.saving", "Saving…") : e("healthybowl.fieldMapPage.beds.assign.action", "Assign")
|
|
1949
2022
|
})] }),
|
|
1950
|
-
children: /* @__PURE__ */
|
|
2023
|
+
children: /* @__PURE__ */ y("div", {
|
|
1951
2024
|
className: "space-y-3",
|
|
1952
|
-
children: [/* @__PURE__ */
|
|
2025
|
+
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
1953
2026
|
className: "text-sm font-medium text-text-primary",
|
|
1954
2027
|
children: e("healthybowl.fieldMapPage.beds.assign.crop", "Crop")
|
|
1955
|
-
}), /* @__PURE__ */
|
|
1956
|
-
value:
|
|
1957
|
-
onValueChange:
|
|
1958
|
-
children: [/* @__PURE__ */
|
|
2028
|
+
}), /* @__PURE__ */ y(He, {
|
|
2029
|
+
value: _n,
|
|
2030
|
+
onValueChange: vn,
|
|
2031
|
+
children: [/* @__PURE__ */ v(We, {
|
|
1959
2032
|
className: "mt-1 w-full",
|
|
1960
|
-
children: /* @__PURE__ */
|
|
1961
|
-
}), /* @__PURE__ */
|
|
2033
|
+
children: /* @__PURE__ */ v(Ge, { placeholder: e("healthybowl.fieldMapPage.beds.assign.none", "No crop") })
|
|
2034
|
+
}), /* @__PURE__ */ v(Ue, { children: g.map((e) => /* @__PURE__ */ v(x, {
|
|
1962
2035
|
value: e.id,
|
|
1963
2036
|
children: e.name
|
|
1964
2037
|
}, e.id)) })]
|
|
1965
2038
|
})] }), (() => {
|
|
1966
|
-
let t =
|
|
1967
|
-
return /* @__PURE__ */
|
|
2039
|
+
let t = be(g.find((e) => e.id === _n) ?? null), n = L ? ae(L.boundary) : null, r = he(L?.area ?? (n ? c(n) : 0), L?.widthM ?? F, t.plantSpacingCm, t.rowSpacingCm);
|
|
2040
|
+
return /* @__PURE__ */ v("div", {
|
|
1968
2041
|
className: "rounded-md bg-success/10 px-3 py-2 text-sm text-text-primary",
|
|
1969
2042
|
children: e("healthybowl.fieldMapPage.beds.assign.preview", "{{preset}} · {{plant}}×{{row}} cm · ~{{plants}} plants", {
|
|
1970
2043
|
preset: t.label,
|
|
@@ -1976,47 +2049,47 @@ var tt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
1976
2049
|
})()]
|
|
1977
2050
|
})
|
|
1978
2051
|
}),
|
|
1979
|
-
/* @__PURE__ */
|
|
1980
|
-
open:
|
|
1981
|
-
onClose: () =>
|
|
2052
|
+
/* @__PURE__ */ v(ne, {
|
|
2053
|
+
open: R !== null,
|
|
2054
|
+
onClose: () => kn(null),
|
|
1982
2055
|
title: e("healthybowl.fieldMapPage.elements.save.title", "Save map element"),
|
|
1983
2056
|
description: e("healthybowl.fieldMapPage.elements.save.description", "Name the element you just drew. It will show on the map with its type styling."),
|
|
1984
|
-
footer: /* @__PURE__ */
|
|
2057
|
+
footer: /* @__PURE__ */ y(Ve, { children: [/* @__PURE__ */ v(b, {
|
|
1985
2058
|
variant: "outline",
|
|
1986
|
-
onClick: () =>
|
|
2059
|
+
onClick: () => kn(null),
|
|
1987
2060
|
className: "text-text-secondary",
|
|
1988
2061
|
children: e("healthybowl.common.cancel", "Cancel")
|
|
1989
|
-
}), /* @__PURE__ */
|
|
1990
|
-
onClick:
|
|
1991
|
-
disabled:
|
|
1992
|
-
children:
|
|
2062
|
+
}), /* @__PURE__ */ v(b, {
|
|
2063
|
+
onClick: si,
|
|
2064
|
+
disabled: Pn,
|
|
2065
|
+
children: Pn ? e("healthybowl.fieldMapPage.elements.save.saving", "Saving…") : e("healthybowl.fieldMapPage.elements.save.action", "Save element")
|
|
1993
2066
|
})] }),
|
|
1994
|
-
children: /* @__PURE__ */
|
|
2067
|
+
children: /* @__PURE__ */ y("div", {
|
|
1995
2068
|
className: "space-y-4",
|
|
1996
2069
|
children: [
|
|
1997
|
-
|
|
2070
|
+
li && /* @__PURE__ */ y("div", {
|
|
1998
2071
|
className: "flex items-center gap-2 rounded-md bg-success/10 px-3 py-2 text-sm text-text-primary",
|
|
1999
|
-
children: [/* @__PURE__ */
|
|
2072
|
+
children: [/* @__PURE__ */ v(li.icon, {
|
|
2000
2073
|
className: "h-4 w-4 shrink-0",
|
|
2001
|
-
style: { color:
|
|
2002
|
-
}), e("healthybowl.fieldMapPage.elements.save.typeLine", "Type: {{type}}", { type: e(
|
|
2074
|
+
style: { color: li.color }
|
|
2075
|
+
}), e("healthybowl.fieldMapPage.elements.save.typeLine", "Type: {{type}}", { type: e(li.labelKey, li.label) })]
|
|
2003
2076
|
}),
|
|
2004
|
-
/* @__PURE__ */
|
|
2077
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
2005
2078
|
className: "text-sm font-medium text-text-primary",
|
|
2006
2079
|
children: e("healthybowl.fieldMapPage.elements.save.name", "Name *")
|
|
2007
|
-
}), /* @__PURE__ */
|
|
2080
|
+
}), /* @__PURE__ */ v("input", {
|
|
2008
2081
|
type: "text",
|
|
2009
|
-
value:
|
|
2010
|
-
onChange: (e) =>
|
|
2082
|
+
value: An,
|
|
2083
|
+
onChange: (e) => jn(e.target.value),
|
|
2011
2084
|
placeholder: e("healthybowl.fieldMapPage.elements.save.namePlaceholder", "e.g., North buffer strip"),
|
|
2012
2085
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
2013
2086
|
})] }),
|
|
2014
|
-
/* @__PURE__ */
|
|
2087
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
2015
2088
|
className: "text-sm font-medium text-text-primary",
|
|
2016
2089
|
children: e("healthybowl.fieldMapPage.elements.save.notes", "Notes")
|
|
2017
|
-
}), /* @__PURE__ */
|
|
2018
|
-
value:
|
|
2019
|
-
onChange: (e) =>
|
|
2090
|
+
}), /* @__PURE__ */ v("textarea", {
|
|
2091
|
+
value: Mn,
|
|
2092
|
+
onChange: (e) => Nn(e.target.value),
|
|
2020
2093
|
rows: 3,
|
|
2021
2094
|
placeholder: e("healthybowl.fieldMapPage.elements.save.notesPlaceholder", "Optional details…"),
|
|
2022
2095
|
className: "mt-1 w-full resize-y rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
@@ -2024,57 +2097,57 @@ var tt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
2024
2097
|
]
|
|
2025
2098
|
})
|
|
2026
2099
|
}),
|
|
2027
|
-
/* @__PURE__ */
|
|
2028
|
-
open:
|
|
2029
|
-
onClose: () =>
|
|
2030
|
-
title:
|
|
2031
|
-
description: $ ? e($.labelKey, $.label) :
|
|
2032
|
-
footer: /* @__PURE__ */
|
|
2100
|
+
/* @__PURE__ */ v(ne, {
|
|
2101
|
+
open: z !== null,
|
|
2102
|
+
onClose: () => In(null),
|
|
2103
|
+
title: z?.name ?? e("healthybowl.fieldMapPage.elements.detail.title", "Map element"),
|
|
2104
|
+
description: $ ? e($.labelKey, $.label) : z?.type ?? "",
|
|
2105
|
+
footer: /* @__PURE__ */ y(Ve, { children: [/* @__PURE__ */ v(b, {
|
|
2033
2106
|
variant: "outline",
|
|
2034
|
-
onClick: () =>
|
|
2107
|
+
onClick: () => In(null),
|
|
2035
2108
|
className: "text-text-secondary",
|
|
2036
2109
|
children: e("healthybowl.common.close", "Close")
|
|
2037
|
-
}), /* @__PURE__ */ b
|
|
2110
|
+
}), /* @__PURE__ */ y(b, {
|
|
2038
2111
|
variant: "destructive",
|
|
2039
|
-
onClick:
|
|
2040
|
-
disabled:
|
|
2112
|
+
onClick: ci,
|
|
2113
|
+
disabled: Ln,
|
|
2041
2114
|
children: [
|
|
2042
|
-
/* @__PURE__ */
|
|
2115
|
+
/* @__PURE__ */ v(Fe, { className: "h-4 w-4" }),
|
|
2043
2116
|
" ",
|
|
2044
|
-
|
|
2117
|
+
Ln ? e("healthybowl.fieldMapPage.elements.detail.deleting", "Deleting…") : e("healthybowl.common.delete", "Delete")
|
|
2045
2118
|
]
|
|
2046
2119
|
})] }),
|
|
2047
|
-
children: /* @__PURE__ */
|
|
2120
|
+
children: /* @__PURE__ */ y("div", {
|
|
2048
2121
|
className: "space-y-3 text-sm",
|
|
2049
|
-
children: [/* @__PURE__ */
|
|
2122
|
+
children: [/* @__PURE__ */ y("div", {
|
|
2050
2123
|
className: "flex justify-between gap-3",
|
|
2051
|
-
children: [/* @__PURE__ */
|
|
2124
|
+
children: [/* @__PURE__ */ v("span", {
|
|
2052
2125
|
className: "text-text-secondary",
|
|
2053
2126
|
children: e("healthybowl.fieldMapPage.elements.detail.type", "Type")
|
|
2054
|
-
}), /* @__PURE__ */
|
|
2127
|
+
}), /* @__PURE__ */ y("span", {
|
|
2055
2128
|
className: "flex items-center gap-1.5 font-medium text-text-primary",
|
|
2056
|
-
children: [$ && /* @__PURE__ */
|
|
2129
|
+
children: [$ && /* @__PURE__ */ v($.icon, {
|
|
2057
2130
|
className: "h-4 w-4",
|
|
2058
2131
|
style: { color: $.color }
|
|
2059
|
-
}), $ ? e($.labelKey, $.label) :
|
|
2132
|
+
}), $ ? e($.labelKey, $.label) : z?.type]
|
|
2060
2133
|
})]
|
|
2061
|
-
}),
|
|
2134
|
+
}), z?.notes && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("span", {
|
|
2062
2135
|
className: "text-text-secondary",
|
|
2063
2136
|
children: e("healthybowl.fieldMapPage.elements.detail.notes", "Notes")
|
|
2064
|
-
}), /* @__PURE__ */
|
|
2137
|
+
}), /* @__PURE__ */ v("p", {
|
|
2065
2138
|
className: "mt-1 whitespace-pre-wrap text-text-primary",
|
|
2066
|
-
children:
|
|
2139
|
+
children: z.notes
|
|
2067
2140
|
})] })]
|
|
2068
2141
|
})
|
|
2069
2142
|
}),
|
|
2070
|
-
/* @__PURE__ */
|
|
2071
|
-
toasts:
|
|
2072
|
-
onDismiss:
|
|
2143
|
+
/* @__PURE__ */ v(ee, {
|
|
2144
|
+
toasts: pt,
|
|
2145
|
+
onDismiss: Tt
|
|
2073
2146
|
})
|
|
2074
2147
|
]
|
|
2075
2148
|
});
|
|
2076
2149
|
};
|
|
2077
2150
|
//#endregion
|
|
2078
|
-
export {
|
|
2151
|
+
export { Tt as FieldMapPage };
|
|
2079
2152
|
|
|
2080
2153
|
//# sourceMappingURL=FieldMapPage.js.map
|