@burdenoff/microfe-healthybowl 2026.727.2 → 2026.727.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.
@@ -5,19 +5,31 @@ import { EmptyState as r } from "../../components/EmptyState.js";
5
5
  import { ErrorState as i } from "../../components/ErrorState.js";
6
6
  import { ToastContainer as a } from "../../components/Toast.js";
7
7
  import { Modal as o } from "../../components/Modal.js";
8
- import { useToast as ee } from "../../hooks/useToast.js";
9
- import { downscaleImage as s } from "../../utils/imageDownscale.js";
8
+ import { useToast as s } from "../../hooks/useToast.js";
9
+ import "../../../utils/gatewayLimits.js";
10
+ import { downscaleImage as c } from "../../utils/imageDownscale.js";
10
11
  import "../../components/index.js";
11
- import { useHealthyBowlData as c } from "../../hooks/useHealthyBowlData.js";
12
- import { resolvePlantScanImageUrl as l, usePlantScans as u } from "../../hooks/usePlantScans.js";
13
- import { useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
14
- import { useI18n as te } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
15
- import { AlertTriangle as g, Camera as ne, ClipboardList as _, Leaf as v, Loader2 as y, ScanSearch as b, Sparkles as x, Upload as re } from "lucide-react";
16
- import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
17
- import { Button as T, Select as E, SelectContent as D, SelectItem as O, SelectTrigger as k, SelectValue as A } from "@burdenoff/fe-libs/ui";
18
- import { useSaveToFiles as ie } from "@burdenoff/fe-libs/storage";
12
+ import { useHealthyBowlData as l } from "../../hooks/useHealthyBowlData.js";
13
+ import { resolvePlantScanImageUrl as u, usePlantScans as d } from "../../hooks/usePlantScans.js";
14
+ import { useCallback as f, useEffect as p, useMemo as m, useRef as h, useState as g } from "react";
15
+ import { useI18n as ee } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
16
+ import { AlertTriangle as _, Camera as te, ClipboardList as v, Leaf as y, Loader2 as b, ScanSearch as x, Sparkles as S, Upload as ne } from "lucide-react";
17
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
18
+ import { Button as E, Select as D, SelectContent as O, SelectItem as k, SelectTrigger as A, SelectValue as j } from "@burdenoff/fe-libs/ui";
19
+ import { useSaveToFiles as re } from "@burdenoff/fe-libs/storage";
19
20
  //#region src/healthybowl/pages/pest-management/AiPestDetectionPage.tsx
20
- var j = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", M = {
21
+ var ie = 10 * 1024 * 1024, ae = {
22
+ maxDim: 768,
23
+ quality: .6
24
+ };
25
+ function M(e) {
26
+ let t = e.indexOf(",");
27
+ return t >= 0 ? e.slice(t + 1) : e;
28
+ }
29
+ function N(e) {
30
+ return e.inlineDataUrl ? M(e.inlineDataUrl) : e.base64;
31
+ }
32
+ var P = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", F = {
21
33
  LOW: "bg-status-success-bgSubtle text-status-success-text",
22
34
  MEDIUM: "bg-status-warning-bgSubtle text-status-warning-text",
23
35
  MODERATE: "bg-status-warning-bgSubtle text-status-warning-text",
@@ -25,76 +37,91 @@ var j = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 t
25
37
  CRITICAL: "bg-status-error-bg/10 text-status-error-text",
26
38
  NONE: "bg-bg-sunken text-text-secondary"
27
39
  };
28
- function N(e, t) {
40
+ function I(e, t) {
29
41
  let n = (e ?? "").toUpperCase();
30
42
  return n === "MEDIUM" ? t("healthybowl.plantScan.severity.moderate", "Moderate") : n === "LOW" ? t("healthybowl.plantScan.severity.low", "Low") : n === "HIGH" ? t("healthybowl.plantScan.severity.high", "High") : n === "CRITICAL" ? t("healthybowl.plantScan.severity.critical", "Critical") : t("healthybowl.plantScan.severity.none", "None");
31
43
  }
32
- function P(e) {
33
- return M[(e ?? "NONE").toUpperCase()] ?? M.NONE;
44
+ function L(e) {
45
+ return F[(e ?? "NONE").toUpperCase()] ?? F.NONE;
34
46
  }
35
- function ae({ fileId: t, alt: n }) {
36
- let { workspaceId: r } = e(), [i, a] = h(null);
37
- return f(() => {
47
+ function oe({ fileId: t, alt: n }) {
48
+ let { workspaceId: r } = e(), [i, a] = g(null);
49
+ return p(() => {
38
50
  let e = !0;
39
- return t && r && l(t, r).then((t) => {
51
+ return t && r && u(t, r).then((t) => {
40
52
  e && a(t);
41
53
  }), () => {
42
54
  e = !1;
43
55
  };
44
- }, [t, r]), /* @__PURE__ */ C("div", {
56
+ }, [t, r]), /* @__PURE__ */ w("div", {
45
57
  className: "h-12 w-12 shrink-0 overflow-hidden rounded-lg bg-bg-sunken",
46
- children: i ? /* @__PURE__ */ C("img", {
58
+ children: i ? /* @__PURE__ */ w("img", {
47
59
  src: i,
48
60
  alt: n,
49
61
  className: "h-full w-full object-cover",
50
62
  loading: "lazy"
51
- }) : /* @__PURE__ */ C("div", {
63
+ }) : /* @__PURE__ */ w("div", {
52
64
  className: "flex h-full w-full items-center justify-center text-text-tertiary",
53
- children: /* @__PURE__ */ C(v, { size: 18 })
65
+ children: /* @__PURE__ */ w(y, { size: 18 })
54
66
  })
55
67
  });
56
68
  }
57
- function F({ value: e }) {
58
- return /* @__PURE__ */ C("div", {
69
+ function R({ value: e }) {
70
+ return /* @__PURE__ */ w("div", {
59
71
  className: "h-2 w-24 overflow-hidden rounded-full bg-bg-sunken",
60
72
  "aria-hidden": !0,
61
- children: /* @__PURE__ */ C("div", {
73
+ children: /* @__PURE__ */ w("div", {
62
74
  className: "h-full rounded-full bg-action-primary-bg",
63
75
  style: { width: `${Math.max(0, Math.min(100, Math.round(e)))}%` }
64
76
  })
65
77
  });
66
78
  }
67
- function I() {
68
- let { t: e } = te(), { fields: o, crops: l } = c(), { data: f, loading: g, error: v, refetch: j, diagnose: M, logToPest: N } = u(), { save: P } = ie(), { toasts: F, toast: I, dismiss: L } = ee(), R = m(null), [z, B] = h(null), [V, H] = h(""), [U, W] = h(""), [G, ce] = h(""), [K, q] = h(!1), [J, Y] = h(null), [le, X] = h(!1), Z = p(() => o.find((e) => e.id === V), [o, V]), Q = p(() => l.find((e) => e.id === U), [l, U]), ue = p(() => V ? l.filter((e) => e.field === V) : l, [l, V]), de = d(async (t) => {
79
+ function z() {
80
+ let { t: e } = ee(), { fields: o, crops: u } = l(), { data: p, loading: _, error: y, refetch: M, diagnose: P, logToPest: F } = d(), { save: I } = re(), { toasts: L, toast: R, dismiss: z } = s(), B = h(null), [V, H] = g(null), [U, W] = g(""), [G, K] = g(""), [q, le] = g(""), [J, Y] = g(!1), [X, Z] = g(null), [ue, Q] = g(!1), de = m(() => o.find((e) => e.id === U), [o, U]), fe = m(() => u.find((e) => e.id === G), [u, G]), pe = m(() => U ? u.filter((e) => e.field === U) : u, [u, U]), me = f(async (t) => {
69
81
  if (t) try {
70
- B(await s(t)), Y(null);
82
+ let n = await c(t, { inline: ae });
83
+ if (!n.downscaled && n.blob.size > ie) {
84
+ R({
85
+ title: e("healthybowl.plantScan.tooLarge", "That photo is too large to analyse. Try a JPEG or PNG, or a smaller photo."),
86
+ variant: "error"
87
+ });
88
+ return;
89
+ }
90
+ if (N(n).length > 229376) {
91
+ R({
92
+ title: e("healthybowl.plantScan.tooLargeToSend", "That photo is too detailed to send for analysis. Try a smaller photo."),
93
+ variant: "error"
94
+ });
95
+ return;
96
+ }
97
+ H(n), Z(null);
71
98
  } catch {
72
- I({
99
+ R({
73
100
  title: e("healthybowl.plantScan.readError", "Could not read that image. Try another photo."),
74
101
  variant: "error"
75
102
  });
76
103
  }
77
- }, [e, I]), fe = d(async () => {
78
- if (!z) {
79
- I({
104
+ }, [e, R]), he = f(async () => {
105
+ if (!V) {
106
+ R({
80
107
  title: e("healthybowl.plantScan.needPhoto", "Take or upload a plant photo first."),
81
108
  variant: "error"
82
109
  });
83
110
  return;
84
111
  }
85
- q(!0);
112
+ Y(!0);
86
113
  try {
87
114
  let t = null;
88
115
  try {
89
- t = (await P({
116
+ t = (await I({
90
117
  source: {
91
118
  kind: "blob",
92
- filename: z.filename,
93
- mimeType: z.mimeType,
119
+ filename: V.filename,
120
+ mimeType: V.mimeType,
94
121
  getBlob: async () => ({
95
- blob: z.blob,
96
- filename: z.filename,
97
- mimeType: z.mimeType
122
+ blob: V.blob,
123
+ filename: V.filename,
124
+ mimeType: V.mimeType
98
125
  })
99
126
  },
100
127
  folderPath: "/HealthyBowl/PestScan"
@@ -102,243 +129,243 @@ function I() {
102
129
  } catch {
103
130
  t = null;
104
131
  }
105
- let n = await M({
106
- fieldId: V || null,
107
- fieldName: Z?.name ?? null,
108
- cropName: Q?.name ?? null,
132
+ let n = await P({
133
+ fieldId: U || null,
134
+ fieldName: de?.name ?? null,
135
+ cropName: fe?.name ?? null,
109
136
  photoFileId: t,
110
- imageBase64: z.base64,
111
- notes: G.trim() || null
137
+ imageBase64: N(V),
138
+ notes: q.trim() || null
112
139
  });
113
- Y(n), await j(), I({
140
+ Z(n), await M(), R({
114
141
  title: e("healthybowl.plantScan.done", "Diagnosis ready"),
115
142
  description: n.topDiagnosis ?? "",
116
143
  variant: "success"
117
144
  });
118
145
  } catch (t) {
119
- I({
146
+ R({
120
147
  title: e("healthybowl.plantScan.failed", "Diagnosis failed"),
121
148
  description: t instanceof Error ? t.message : String(t),
122
149
  variant: "error"
123
150
  });
124
151
  } finally {
125
- q(!1);
152
+ Y(!1);
126
153
  }
127
154
  }, [
128
- z,
129
- P,
130
- M,
131
155
  V,
132
- Z,
133
- Q,
134
- G,
135
- j,
136
156
  I,
157
+ P,
158
+ U,
159
+ de,
160
+ fe,
161
+ q,
162
+ M,
163
+ R,
137
164
  e
138
- ]), $ = f?.stats, pe = f?.scans ?? [];
139
- return /* @__PURE__ */ w(n, {
165
+ ]), $ = p?.stats, ge = p?.scans ?? [];
166
+ return /* @__PURE__ */ T(n, {
140
167
  title: e("healthybowl.plantScan.title", "AI Pest & Disease Detection"),
141
168
  titleAccent: e("healthybowl.plantScan.titleAccent", "AI"),
142
169
  description: e("healthybowl.plantScan.subtitle", "Photograph a plant — AI names the likely pest or disease, with organic-safe next steps."),
143
170
  hero: !0,
144
171
  purpose: e("healthybowl.plantScan.purpose", "Snap or upload a leaf photo and get an AI second opinion — the most likely pest or disease with a confidence score, ranked alternatives, and organic-safe actions. Log it to Pest Issues in one tap to start tracking it."),
145
- actions: J ? /* @__PURE__ */ w(T, {
146
- onClick: () => X(!0),
172
+ actions: X ? /* @__PURE__ */ T(E, {
173
+ onClick: () => Q(!0),
147
174
  className: "gap-2",
148
175
  children: [
149
- /* @__PURE__ */ C(_, { size: 16 }),
176
+ /* @__PURE__ */ w(v, { size: 16 }),
150
177
  " ",
151
178
  e("healthybowl.plantScan.logToIssues", "Log to Pest Issues")
152
179
  ]
153
180
  }) : void 0,
154
181
  children: [
155
- /* @__PURE__ */ C("input", {
156
- ref: R,
182
+ /* @__PURE__ */ w("input", {
183
+ ref: B,
157
184
  type: "file",
158
185
  accept: "image/*",
159
186
  capture: "environment",
160
187
  className: "hidden",
161
- onChange: (e) => void de(e.target.files?.[0])
188
+ onChange: (e) => void me(e.target.files?.[0])
162
189
  }),
163
- /* @__PURE__ */ w("div", {
190
+ /* @__PURE__ */ T("div", {
164
191
  className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
165
192
  children: [
166
- /* @__PURE__ */ w("section", {
193
+ /* @__PURE__ */ T("section", {
167
194
  className: "rounded-2xl border border-border-subtle bg-bg-surface p-5",
168
195
  children: [
169
- /* @__PURE__ */ C("h2", {
196
+ /* @__PURE__ */ w("h2", {
170
197
  className: "mb-4 text-lg font-semibold text-text-primary",
171
198
  children: e("healthybowl.plantScan.scanCard", "Scan a Plant")
172
199
  }),
173
- /* @__PURE__ */ C("div", {
200
+ /* @__PURE__ */ w("div", {
174
201
  className: "mb-4 flex aspect-square w-full items-center justify-center overflow-hidden rounded-xl bg-bg-sunken",
175
- children: z ? /* @__PURE__ */ C("img", {
176
- src: z.dataUrl,
202
+ children: V ? /* @__PURE__ */ w("img", {
203
+ src: V.dataUrl,
177
204
  alt: e("healthybowl.plantScan.previewAlt", "Plant to diagnose"),
178
205
  className: "h-full w-full object-cover"
179
- }) : /* @__PURE__ */ w("div", {
206
+ }) : /* @__PURE__ */ T("div", {
180
207
  className: "flex flex-col items-center gap-2 p-6 text-center text-text-tertiary",
181
- children: [/* @__PURE__ */ C(b, { size: 40 }), /* @__PURE__ */ C("span", {
208
+ children: [/* @__PURE__ */ w(x, { size: 40 }), /* @__PURE__ */ w("span", {
182
209
  className: "text-sm",
183
210
  children: e("healthybowl.plantScan.previewHint", "Take or upload a photo of the affected leaf")
184
211
  })]
185
212
  })
186
213
  }),
187
- /* @__PURE__ */ w("div", {
214
+ /* @__PURE__ */ T("div", {
188
215
  className: "grid grid-cols-2 gap-3",
189
- children: [/* @__PURE__ */ w(T, {
216
+ children: [/* @__PURE__ */ T(E, {
190
217
  variant: "outline",
191
218
  className: "gap-2",
192
- onClick: () => R.current?.click(),
193
- disabled: K,
219
+ onClick: () => B.current?.click(),
220
+ disabled: J,
194
221
  children: [
195
- /* @__PURE__ */ C(ne, { size: 16 }),
222
+ /* @__PURE__ */ w(te, { size: 16 }),
196
223
  " ",
197
224
  e("healthybowl.plantScan.takePhoto", "Take Photo")
198
225
  ]
199
- }), /* @__PURE__ */ w(T, {
226
+ }), /* @__PURE__ */ T(E, {
200
227
  variant: "outline",
201
228
  className: "gap-2",
202
- onClick: () => R.current?.click(),
203
- disabled: K,
229
+ onClick: () => B.current?.click(),
230
+ disabled: J,
204
231
  children: [
205
- /* @__PURE__ */ C(re, { size: 16 }),
232
+ /* @__PURE__ */ w(ne, { size: 16 }),
206
233
  " ",
207
234
  e("healthybowl.plantScan.upload", "Upload Image")
208
235
  ]
209
236
  })]
210
237
  }),
211
- /* @__PURE__ */ w("div", {
238
+ /* @__PURE__ */ T("div", {
212
239
  className: "mt-4 grid grid-cols-1 gap-3 sm:grid-cols-2",
213
- children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("label", {
240
+ children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
214
241
  className: "mb-1 block text-xs font-medium text-text-secondary",
215
242
  children: e("healthybowl.plantScan.field", "Field")
216
- }), /* @__PURE__ */ w(E, {
217
- value: V,
243
+ }), /* @__PURE__ */ T(D, {
244
+ value: U,
218
245
  onValueChange: (e) => {
219
- H(e), W("");
246
+ W(e), K("");
220
247
  },
221
- children: [/* @__PURE__ */ C(k, {
248
+ children: [/* @__PURE__ */ w(A, {
222
249
  className: "w-full",
223
- children: /* @__PURE__ */ C(A, { placeholder: e("healthybowl.plantScan.selectField", "Select field") })
224
- }), /* @__PURE__ */ C(D, { children: o.map((e) => /* @__PURE__ */ C(O, {
250
+ children: /* @__PURE__ */ w(j, { placeholder: e("healthybowl.plantScan.selectField", "Select field") })
251
+ }), /* @__PURE__ */ w(O, { children: o.map((e) => /* @__PURE__ */ w(k, {
225
252
  value: e.id,
226
253
  children: e.name
227
254
  }, e.id)) })]
228
- })] }), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("label", {
255
+ })] }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
229
256
  className: "mb-1 block text-xs font-medium text-text-secondary",
230
257
  children: e("healthybowl.plantScan.crop", "Crop")
231
- }), /* @__PURE__ */ w(E, {
232
- value: U,
233
- onValueChange: W,
234
- children: [/* @__PURE__ */ C(k, {
258
+ }), /* @__PURE__ */ T(D, {
259
+ value: G,
260
+ onValueChange: K,
261
+ children: [/* @__PURE__ */ w(A, {
235
262
  className: "w-full",
236
- children: /* @__PURE__ */ C(A, { placeholder: e("healthybowl.plantScan.selectCrop", "Select crop") })
237
- }), /* @__PURE__ */ C(D, { children: ue.map((e) => /* @__PURE__ */ C(O, {
263
+ children: /* @__PURE__ */ w(j, { placeholder: e("healthybowl.plantScan.selectCrop", "Select crop") })
264
+ }), /* @__PURE__ */ w(O, { children: pe.map((e) => /* @__PURE__ */ w(k, {
238
265
  value: e.id,
239
266
  children: e.name
240
267
  }, e.id)) })]
241
268
  })] })]
242
269
  }),
243
- /* @__PURE__ */ w("div", {
270
+ /* @__PURE__ */ T("div", {
244
271
  className: "mt-3",
245
- children: [/* @__PURE__ */ C("label", {
272
+ children: [/* @__PURE__ */ w("label", {
246
273
  className: "mb-1 block text-xs font-medium text-text-secondary",
247
274
  children: e("healthybowl.plantScan.notes", "Symptoms (optional)")
248
- }), /* @__PURE__ */ C("textarea", {
249
- value: G,
250
- onChange: (e) => ce(e.target.value),
275
+ }), /* @__PURE__ */ w("textarea", {
276
+ value: q,
277
+ onChange: (e) => le(e.target.value),
251
278
  rows: 2,
252
279
  placeholder: e("healthybowl.plantScan.notesPlaceholder", "e.g. brown spots spreading on lower leaves"),
253
280
  className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
254
281
  })]
255
282
  }),
256
- /* @__PURE__ */ C(T, {
257
- onClick: () => void fe(),
258
- disabled: !z || K,
283
+ /* @__PURE__ */ w(E, {
284
+ onClick: () => void he(),
285
+ disabled: !V || J,
259
286
  className: "mt-4 w-full gap-2",
260
- children: K ? /* @__PURE__ */ w(S, { children: [
261
- /* @__PURE__ */ C(y, {
287
+ children: J ? /* @__PURE__ */ T(C, { children: [
288
+ /* @__PURE__ */ w(b, {
262
289
  size: 16,
263
290
  className: "animate-spin"
264
291
  }),
265
292
  " ",
266
293
  e("healthybowl.plantScan.analyzing", "Analyzing…")
267
- ] }) : /* @__PURE__ */ w(S, { children: [
268
- /* @__PURE__ */ C(x, { size: 16 }),
294
+ ] }) : /* @__PURE__ */ T(C, { children: [
295
+ /* @__PURE__ */ w(S, { size: 16 }),
269
296
  " ",
270
297
  e("healthybowl.plantScan.diagnose", "Diagnose with AI")
271
298
  ] })
272
299
  })
273
300
  ]
274
301
  }),
275
- /* @__PURE__ */ w("section", {
302
+ /* @__PURE__ */ T("section", {
276
303
  className: "rounded-2xl border border-border-subtle bg-bg-surface p-5",
277
- children: [/* @__PURE__ */ C("h2", {
304
+ children: [/* @__PURE__ */ w("h2", {
278
305
  className: "mb-4 text-lg font-semibold text-text-primary",
279
306
  children: e("healthybowl.plantScan.diagnosisCard", "AI Diagnosis")
280
- }), J ? /* @__PURE__ */ C(oe, {
281
- scan: J,
307
+ }), X ? /* @__PURE__ */ w(se, {
308
+ scan: X,
282
309
  t: e
283
- }) : /* @__PURE__ */ w("div", {
310
+ }) : /* @__PURE__ */ T("div", {
284
311
  className: "flex h-64 flex-col items-center justify-center gap-2 text-center text-text-tertiary",
285
- children: [/* @__PURE__ */ C(x, { size: 32 }), /* @__PURE__ */ C("p", {
312
+ children: [/* @__PURE__ */ w(S, { size: 32 }), /* @__PURE__ */ w("p", {
286
313
  className: "text-sm",
287
314
  children: e("healthybowl.plantScan.diagnosisEmpty", "Your AI diagnosis will appear here after you scan a plant.")
288
315
  })]
289
316
  })]
290
317
  }),
291
- /* @__PURE__ */ w("section", {
318
+ /* @__PURE__ */ T("section", {
292
319
  className: "space-y-4",
293
- children: [/* @__PURE__ */ w("div", {
320
+ children: [/* @__PURE__ */ T("div", {
294
321
  className: "rounded-2xl border border-border-subtle bg-bg-surface p-5",
295
- children: [/* @__PURE__ */ C("h2", {
322
+ children: [/* @__PURE__ */ w("h2", {
296
323
  className: "mb-4 text-lg font-semibold text-text-primary",
297
324
  children: e("healthybowl.plantScan.recentScans", "Recent Scans")
298
- }), g ? /* @__PURE__ */ C("div", {
325
+ }), _ ? /* @__PURE__ */ w("div", {
299
326
  className: "flex h-32 items-center justify-center text-text-tertiary",
300
- children: /* @__PURE__ */ C(y, {
327
+ children: /* @__PURE__ */ w(b, {
301
328
  size: 20,
302
329
  className: "animate-spin"
303
330
  })
304
- }) : v ? /* @__PURE__ */ C(i, { onRetry: () => void j() }) : pe.length === 0 ? /* @__PURE__ */ C(r, {
305
- icon: /* @__PURE__ */ C(b, { size: 28 }),
331
+ }) : y ? /* @__PURE__ */ w(i, { onRetry: () => void M() }) : ge.length === 0 ? /* @__PURE__ */ w(r, {
332
+ icon: /* @__PURE__ */ w(x, { size: 28 }),
306
333
  title: e("healthybowl.plantScan.noScans", "No scans yet"),
307
334
  description: e("healthybowl.plantScan.noScansHint", "Point your phone at a sick-looking plant and let HealthyBowl AI name the likely pest or disease.")
308
- }) : /* @__PURE__ */ C("ul", {
335
+ }) : /* @__PURE__ */ w("ul", {
309
336
  className: "divide-y divide-border-subtle",
310
- children: pe.slice(0, 8).map((n) => /* @__PURE__ */ C("li", { children: /* @__PURE__ */ w("button", {
337
+ children: ge.slice(0, 8).map((n) => /* @__PURE__ */ w("li", { children: /* @__PURE__ */ T("button", {
311
338
  type: "button",
312
- onClick: () => Y(n),
339
+ onClick: () => Z(n),
313
340
  className: "flex w-full items-center gap-3 py-3 text-start hover:opacity-80",
314
341
  children: [
315
- /* @__PURE__ */ C(ae, {
342
+ /* @__PURE__ */ w(oe, {
316
343
  fileId: n.photoFileIds?.[0],
317
344
  alt: n.topDiagnosis ?? "scan"
318
345
  }),
319
- /* @__PURE__ */ w("div", {
346
+ /* @__PURE__ */ T("div", {
320
347
  className: "min-w-0 flex-1",
321
- children: [/* @__PURE__ */ w("p", {
348
+ children: [/* @__PURE__ */ T("p", {
322
349
  className: "truncate text-sm font-medium text-text-primary",
323
350
  children: [n.cropName || e("healthybowl.plantScan.unknownCrop", "Unknown crop"), n.topDiagnosis ? ` · ${n.topDiagnosis}` : ""]
324
- }), /* @__PURE__ */ C("p", {
351
+ }), /* @__PURE__ */ w("p", {
325
352
  className: "text-xs text-text-tertiary",
326
353
  children: t(n.createdAt)
327
354
  })]
328
355
  }),
329
- n.loggedPestIssueId ? /* @__PURE__ */ C("span", {
356
+ n.loggedPestIssueId ? /* @__PURE__ */ w("span", {
330
357
  className: "rounded-full bg-status-success-bgSubtle px-2 py-0.5 text-[11px] font-medium text-status-success-text",
331
358
  children: e("healthybowl.plantScan.logged", "Logged")
332
359
  }) : null
333
360
  ]
334
361
  }) }, n.id))
335
362
  })]
336
- }), $ ? /* @__PURE__ */ w("div", {
363
+ }), $ ? /* @__PURE__ */ T("div", {
337
364
  className: "rounded-2xl border border-border-subtle bg-bg-surface p-5",
338
- children: [/* @__PURE__ */ w("p", {
365
+ children: [/* @__PURE__ */ T("p", {
339
366
  className: "text-sm text-text-secondary",
340
367
  children: [
341
- /* @__PURE__ */ C("span", {
368
+ /* @__PURE__ */ w("span", {
342
369
  className: "text-lg font-semibold text-text-primary",
343
370
  children: $.scansThisSeason
344
371
  }),
@@ -346,14 +373,14 @@ function I() {
346
373
  e("healthybowl.plantScan.statScans", "scans this season"),
347
374
  " ·",
348
375
  " ",
349
- /* @__PURE__ */ C("span", {
376
+ /* @__PURE__ */ w("span", {
350
377
  className: "text-lg font-semibold text-text-primary",
351
378
  children: $.issuesCaughtEarly
352
379
  }),
353
380
  " ",
354
381
  e("healthybowl.plantScan.statIssues", "issues caught early")
355
382
  ]
356
- }), $.avgConfidence > 0 ? /* @__PURE__ */ w("p", {
383
+ }), $.avgConfidence > 0 ? /* @__PURE__ */ T("p", {
357
384
  className: "mt-1 text-xs text-text-tertiary",
358
385
  children: [
359
386
  e("healthybowl.plantScan.statAvg", "Average confidence"),
@@ -366,24 +393,24 @@ function I() {
366
393
  })
367
394
  ]
368
395
  }),
369
- J ? /* @__PURE__ */ C(se, {
370
- open: le,
371
- onClose: () => X(!1),
372
- scan: J,
396
+ X ? /* @__PURE__ */ w(ce, {
397
+ open: ue,
398
+ onClose: () => Q(!1),
399
+ scan: X,
373
400
  fields: o,
374
- defaultFieldId: V,
401
+ defaultFieldId: U,
375
402
  t: e,
376
403
  onSubmit: async (t) => {
377
404
  try {
378
- await N(t), await j(), Y((e) => e && {
405
+ await F(t), await M(), Z((e) => e && {
379
406
  ...e,
380
407
  loggedPestIssueId: "logged"
381
- }), X(!1), I({
408
+ }), Q(!1), R({
382
409
  title: e("healthybowl.plantScan.loggedToast", "Logged to Pest Issues"),
383
410
  variant: "success"
384
411
  });
385
412
  } catch (t) {
386
- I({
413
+ R({
387
414
  title: e("healthybowl.plantScan.logFailed", "Could not log the issue"),
388
415
  description: t instanceof Error ? t.message : String(t),
389
416
  variant: "error"
@@ -391,83 +418,83 @@ function I() {
391
418
  }
392
419
  }
393
420
  }) : null,
394
- /* @__PURE__ */ C(a, {
395
- toasts: F,
396
- onDismiss: L
421
+ /* @__PURE__ */ w(a, {
422
+ toasts: L,
423
+ onDismiss: z
397
424
  })
398
425
  ]
399
426
  });
400
427
  }
401
- function oe({ scan: e, t }) {
428
+ function se({ scan: e, t }) {
402
429
  let n = e.candidates ?? [], r = n[0], i = n.slice(1), a = e.advisorySource === "MODEL";
403
- return /* @__PURE__ */ w("div", {
430
+ return /* @__PURE__ */ T("div", {
404
431
  className: "space-y-4",
405
432
  children: [
406
- /* @__PURE__ */ w("div", {
433
+ /* @__PURE__ */ T("div", {
407
434
  className: "rounded-xl bg-status-success-bgSubtle p-4",
408
- children: [/* @__PURE__ */ w("div", {
435
+ children: [/* @__PURE__ */ T("div", {
409
436
  className: "flex items-start justify-between gap-3",
410
- children: [/* @__PURE__ */ w("div", {
437
+ children: [/* @__PURE__ */ T("div", {
411
438
  className: "min-w-0",
412
- children: [/* @__PURE__ */ C("p", {
439
+ children: [/* @__PURE__ */ w("p", {
413
440
  className: "text-lg font-bold text-text-primary",
414
441
  children: e.topDiagnosis ?? r?.name ?? "—"
415
- }), e.topScientificName ? /* @__PURE__ */ C("p", {
442
+ }), e.topScientificName ? /* @__PURE__ */ w("p", {
416
443
  className: "text-sm italic text-text-secondary",
417
444
  children: e.topScientificName
418
445
  }) : null]
419
- }), e.topConfidence == null ? null : /* @__PURE__ */ w("div", {
446
+ }), e.topConfidence == null ? null : /* @__PURE__ */ T("div", {
420
447
  className: "shrink-0 rounded-lg bg-action-primary-bg px-3 py-1.5 text-center text-action-primary-text",
421
- children: [/* @__PURE__ */ C("p", {
448
+ children: [/* @__PURE__ */ w("p", {
422
449
  className: "text-[10px] uppercase leading-none opacity-80",
423
450
  children: t("healthybowl.plantScan.confidence", "Confidence")
424
- }), /* @__PURE__ */ w("p", {
451
+ }), /* @__PURE__ */ T("p", {
425
452
  className: "text-lg font-bold leading-tight",
426
453
  children: [Math.round(e.topConfidence), "%"]
427
454
  })]
428
455
  })]
429
- }), /* @__PURE__ */ w("span", {
430
- className: `mt-3 inline-block rounded-full px-3 py-1 text-xs font-semibold ${P(e.severity)}`,
456
+ }), /* @__PURE__ */ T("span", {
457
+ className: `mt-3 inline-block rounded-full px-3 py-1 text-xs font-semibold ${L(e.severity)}`,
431
458
  children: [
432
459
  t("healthybowl.plantScan.severityLabel", "Severity"),
433
460
  ": ",
434
- N(e.severity, t)
461
+ I(e.severity, t)
435
462
  ]
436
463
  })]
437
464
  }),
438
- i.length > 0 ? /* @__PURE__ */ w("div", {
465
+ i.length > 0 ? /* @__PURE__ */ T("div", {
439
466
  className: "space-y-2",
440
- children: [/* @__PURE__ */ C("p", {
467
+ children: [/* @__PURE__ */ w("p", {
441
468
  className: "text-xs font-medium uppercase tracking-wide text-text-tertiary",
442
469
  children: t("healthybowl.plantScan.alternatives", "Alternative candidates")
443
- }), i.map((e, t) => /* @__PURE__ */ w("div", {
470
+ }), i.map((e, t) => /* @__PURE__ */ T("div", {
444
471
  className: "flex items-center gap-3 text-sm",
445
472
  children: [
446
- /* @__PURE__ */ C("span", {
473
+ /* @__PURE__ */ w("span", {
447
474
  className: "flex h-5 w-5 items-center justify-center rounded-full bg-bg-sunken text-xs text-text-secondary",
448
475
  children: t + 1
449
476
  }),
450
- /* @__PURE__ */ C("span", {
477
+ /* @__PURE__ */ w("span", {
451
478
  className: "flex-1 truncate text-text-primary",
452
479
  children: e.name
453
480
  }),
454
- /* @__PURE__ */ C(F, { value: e.confidence }),
455
- /* @__PURE__ */ w("span", {
481
+ /* @__PURE__ */ w(R, { value: e.confidence }),
482
+ /* @__PURE__ */ T("span", {
456
483
  className: "w-10 text-end text-text-secondary",
457
484
  children: [Math.round(e.confidence), "%"]
458
485
  })
459
486
  ]
460
487
  }, `${e.name}-${t}`))]
461
488
  }) : null,
462
- /* @__PURE__ */ w("div", {
489
+ /* @__PURE__ */ T("div", {
463
490
  className: "rounded-xl border border-border-subtle p-4",
464
491
  children: [
465
- /* @__PURE__ */ w("p", {
492
+ /* @__PURE__ */ T("p", {
466
493
  className: "mb-2 text-sm font-semibold text-text-primary",
467
494
  children: [
468
495
  t("healthybowl.plantScan.recommendedAction", "Recommended Action"),
469
496
  " ",
470
- /* @__PURE__ */ w("span", {
497
+ /* @__PURE__ */ T("span", {
471
498
  className: "font-normal text-text-tertiary",
472
499
  children: [
473
500
  "(",
@@ -477,29 +504,29 @@ function oe({ scan: e, t }) {
477
504
  })
478
505
  ]
479
506
  }),
480
- e.recommendedActions?.length ? /* @__PURE__ */ C("ul", {
507
+ e.recommendedActions?.length ? /* @__PURE__ */ w("ul", {
481
508
  className: "space-y-1.5",
482
- children: e.recommendedActions.map((e, t) => /* @__PURE__ */ w("li", {
509
+ children: e.recommendedActions.map((e, t) => /* @__PURE__ */ T("li", {
483
510
  className: "flex gap-2 text-sm text-text-secondary",
484
- children: [/* @__PURE__ */ C(v, {
511
+ children: [/* @__PURE__ */ w(y, {
485
512
  size: 16,
486
513
  className: "mt-0.5 shrink-0 text-accent-teal"
487
- }), /* @__PURE__ */ C("span", { children: e })]
514
+ }), /* @__PURE__ */ w("span", { children: e })]
488
515
  }, t))
489
- }) : /* @__PURE__ */ C("p", {
516
+ }) : /* @__PURE__ */ w("p", {
490
517
  className: "text-sm text-text-tertiary",
491
518
  children: e.advisoryText ?? "—"
492
519
  }),
493
- /* @__PURE__ */ w("p", {
520
+ /* @__PURE__ */ T("p", {
494
521
  className: "mt-3 border-t border-border-subtle pt-2 text-xs text-text-tertiary",
495
- children: [a ? /* @__PURE__ */ w(S, { children: [
496
- /* @__PURE__ */ C(x, {
522
+ children: [a ? /* @__PURE__ */ T(C, { children: [
523
+ /* @__PURE__ */ w(S, {
497
524
  size: 12,
498
525
  className: "mr-1 inline"
499
526
  }),
500
527
  t("healthybowl.plantScan.aiAttribution", "AI diagnosis"),
501
528
  e.modelName ? ` · ${e.modelName}` : ""
502
- ] }) : /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(g, {
529
+ ] }) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(_, {
503
530
  size: 12,
504
531
  className: "mr-1 inline"
505
532
  }), t("healthybowl.plantScan.ruleAttribution", "Rule-based estimate (not AI) — confirm before treating")] }), e.processingMs ? ` · ${(e.processingMs / 1e3).toFixed(1)}s` : ""]
@@ -509,69 +536,69 @@ function oe({ scan: e, t }) {
509
536
  ]
510
537
  });
511
538
  }
512
- var L = [
539
+ var B = [
513
540
  "DISEASE",
514
541
  "FUNGUS",
515
542
  "INSECT",
516
543
  "WEED"
517
- ], R = [
544
+ ], V = [
518
545
  "ACTIVE",
519
546
  "MONITORING",
520
547
  "TREATING",
521
548
  "RESOLVED"
522
- ], z = [
549
+ ], H = [
523
550
  "LOW",
524
551
  "MEDIUM",
525
552
  "HIGH",
526
553
  "CRITICAL"
527
554
  ];
528
- function B(e) {
555
+ function U(e) {
529
556
  let t = (e ?? "").toUpperCase();
530
- return L.includes(t) ? t : "DISEASE";
557
+ return B.includes(t) ? t : "DISEASE";
531
558
  }
532
- function se({ open: e, onClose: t, scan: n, fields: r, defaultFieldId: i, t: a, onSubmit: ee }) {
533
- let [s, c] = h(() => H(n, i)), [l, u] = h(!1);
534
- f(() => {
535
- e && c(H(n, i));
559
+ function ce({ open: e, onClose: t, scan: n, fields: r, defaultFieldId: i, t: a, onSubmit: s }) {
560
+ let [c, l] = g(() => G(n, i)), [u, d] = g(!1);
561
+ p(() => {
562
+ e && l(G(n, i));
536
563
  }, [
537
564
  e,
538
565
  n,
539
566
  i
540
567
  ]);
541
- let d = (e, t) => c((n) => ({
568
+ let f = (e, t) => l((n) => ({
542
569
  ...n,
543
570
  [e]: t
544
- })), p = async () => {
545
- u(!0);
571
+ })), m = async () => {
572
+ d(!0);
546
573
  try {
547
- await ee(s);
574
+ await s(c);
548
575
  } finally {
549
- u(!1);
576
+ d(!1);
550
577
  }
551
- }, m = !!s.fieldId && !!s.pestName.trim();
552
- return /* @__PURE__ */ w(o, {
578
+ }, h = !!c.fieldId && !!c.pestName.trim();
579
+ return /* @__PURE__ */ T(o, {
553
580
  open: e,
554
581
  onClose: t,
555
582
  title: a("healthybowl.plantScan.logModalTitle", "Log to Pest Issues"),
556
583
  size: "lg",
557
- footer: /* @__PURE__ */ w("div", {
584
+ footer: /* @__PURE__ */ T("div", {
558
585
  className: "flex justify-end gap-2",
559
- children: [/* @__PURE__ */ C(T, {
586
+ children: [/* @__PURE__ */ w(E, {
560
587
  variant: "outline",
561
588
  onClick: t,
562
589
  children: a("common.cancel", "Cancel")
563
- }), /* @__PURE__ */ w(T, {
564
- onClick: () => void p(),
565
- disabled: !m || l,
590
+ }), /* @__PURE__ */ T(E, {
591
+ onClick: () => void m(),
592
+ disabled: !h || u,
566
593
  className: "gap-2",
567
- children: [l ? /* @__PURE__ */ C(y, {
594
+ children: [u ? /* @__PURE__ */ w(b, {
568
595
  size: 16,
569
596
  className: "animate-spin"
570
- }) : /* @__PURE__ */ C(_, { size: 16 }), a("healthybowl.plantScan.createIssue", "Create Pest Issue")]
597
+ }) : /* @__PURE__ */ w(v, { size: 16 }), a("healthybowl.plantScan.createIssue", "Create Pest Issue")]
571
598
  })]
572
599
  }),
573
600
  children: [
574
- /* @__PURE__ */ w("div", {
601
+ /* @__PURE__ */ T("div", {
575
602
  className: "rounded-lg bg-status-success-bgSubtle px-3 py-2 text-sm text-status-success-text",
576
603
  children: [
577
604
  a("healthybowl.plantScan.prefill", "Pre-filled from AI scan"),
@@ -580,76 +607,76 @@ function se({ open: e, onClose: t, scan: n, fields: r, defaultFieldId: i, t: a,
580
607
  n.topConfidence == null ? "" : `, ${Math.round(n.topConfidence)}% ${a("healthybowl.plantScan.confidenceLower", "confidence")}`
581
608
  ]
582
609
  }),
583
- /* @__PURE__ */ w("div", {
610
+ /* @__PURE__ */ T("div", {
584
611
  className: "mt-4 grid grid-cols-1 gap-4 sm:grid-cols-2",
585
612
  children: [
586
- /* @__PURE__ */ C(V, {
613
+ /* @__PURE__ */ w(W, {
587
614
  label: a("healthybowl.plantScan.pestDisease", "Pest / Disease"),
588
- children: /* @__PURE__ */ C("input", {
589
- value: s.pestName,
590
- onChange: (e) => d("pestName", e.target.value),
591
- className: j
615
+ children: /* @__PURE__ */ w("input", {
616
+ value: c.pestName,
617
+ onChange: (e) => f("pestName", e.target.value),
618
+ className: P
592
619
  })
593
620
  }),
594
- /* @__PURE__ */ C(V, {
621
+ /* @__PURE__ */ w(W, {
595
622
  label: a("healthybowl.plantScan.type", "Type"),
596
- children: /* @__PURE__ */ w(E, {
597
- value: s.type,
598
- onValueChange: (e) => d("type", e),
599
- children: [/* @__PURE__ */ C(k, {
623
+ children: /* @__PURE__ */ T(D, {
624
+ value: c.type,
625
+ onValueChange: (e) => f("type", e),
626
+ children: [/* @__PURE__ */ w(A, {
600
627
  className: "w-full",
601
- children: /* @__PURE__ */ C(A, {})
602
- }), /* @__PURE__ */ C(D, { children: L.map((e) => /* @__PURE__ */ C(O, {
628
+ children: /* @__PURE__ */ w(j, {})
629
+ }), /* @__PURE__ */ w(O, { children: B.map((e) => /* @__PURE__ */ w(k, {
603
630
  value: e,
604
631
  children: e
605
632
  }, e)) })]
606
633
  })
607
634
  }),
608
- /* @__PURE__ */ C(V, {
635
+ /* @__PURE__ */ w(W, {
609
636
  label: a("healthybowl.plantScan.affectedCrop", "Affected Crop"),
610
- children: /* @__PURE__ */ C("input", {
611
- value: s.cropAffected,
612
- onChange: (e) => d("cropAffected", e.target.value),
613
- className: j
637
+ children: /* @__PURE__ */ w("input", {
638
+ value: c.cropAffected,
639
+ onChange: (e) => f("cropAffected", e.target.value),
640
+ className: P
614
641
  })
615
642
  }),
616
- /* @__PURE__ */ C(V, {
643
+ /* @__PURE__ */ w(W, {
617
644
  label: a("healthybowl.plantScan.fieldLocation", "Field / Location"),
618
- children: /* @__PURE__ */ w(E, {
619
- value: s.fieldId,
620
- onValueChange: (e) => d("fieldId", e),
621
- children: [/* @__PURE__ */ C(k, {
645
+ children: /* @__PURE__ */ T(D, {
646
+ value: c.fieldId,
647
+ onValueChange: (e) => f("fieldId", e),
648
+ children: [/* @__PURE__ */ w(A, {
622
649
  className: "w-full",
623
- children: /* @__PURE__ */ C(A, { placeholder: a("healthybowl.plantScan.selectField", "Select field") })
624
- }), /* @__PURE__ */ C(D, { children: r.map((e) => /* @__PURE__ */ C(O, {
650
+ children: /* @__PURE__ */ w(j, { placeholder: a("healthybowl.plantScan.selectField", "Select field") })
651
+ }), /* @__PURE__ */ w(O, { children: r.map((e) => /* @__PURE__ */ w(k, {
625
652
  value: e.id,
626
653
  children: e.name
627
654
  }, e.id)) })]
628
655
  })
629
656
  }),
630
- /* @__PURE__ */ C(V, {
657
+ /* @__PURE__ */ w(W, {
631
658
  label: a("healthybowl.plantScan.severityLabel", "Severity"),
632
- children: /* @__PURE__ */ w(E, {
633
- value: s.severity,
634
- onValueChange: (e) => d("severity", e),
635
- children: [/* @__PURE__ */ C(k, {
659
+ children: /* @__PURE__ */ T(D, {
660
+ value: c.severity,
661
+ onValueChange: (e) => f("severity", e),
662
+ children: [/* @__PURE__ */ w(A, {
636
663
  className: "w-full",
637
- children: /* @__PURE__ */ C(A, {})
638
- }), /* @__PURE__ */ C(D, { children: z.map((e) => /* @__PURE__ */ C(O, {
664
+ children: /* @__PURE__ */ w(j, {})
665
+ }), /* @__PURE__ */ w(O, { children: H.map((e) => /* @__PURE__ */ w(k, {
639
666
  value: e,
640
667
  children: e
641
668
  }, e)) })]
642
669
  })
643
670
  }),
644
- /* @__PURE__ */ C(V, {
671
+ /* @__PURE__ */ w(W, {
645
672
  label: a("healthybowl.plantScan.status", "Status"),
646
- children: /* @__PURE__ */ w(E, {
647
- value: s.status,
648
- onValueChange: (e) => d("status", e),
649
- children: [/* @__PURE__ */ C(k, {
673
+ children: /* @__PURE__ */ T(D, {
674
+ value: c.status,
675
+ onValueChange: (e) => f("status", e),
676
+ children: [/* @__PURE__ */ w(A, {
650
677
  className: "w-full",
651
- children: /* @__PURE__ */ C(A, {})
652
- }), /* @__PURE__ */ C(D, { children: R.map((e) => /* @__PURE__ */ C(O, {
678
+ children: /* @__PURE__ */ w(j, {})
679
+ }), /* @__PURE__ */ w(O, { children: V.map((e) => /* @__PURE__ */ w(k, {
653
680
  value: e,
654
681
  children: e
655
682
  }, e)) })]
@@ -657,61 +684,61 @@ function se({ open: e, onClose: t, scan: n, fields: r, defaultFieldId: i, t: a,
657
684
  })
658
685
  ]
659
686
  }),
660
- /* @__PURE__ */ C("div", {
687
+ /* @__PURE__ */ w("div", {
661
688
  className: "mt-4",
662
- children: /* @__PURE__ */ C(V, {
663
- label: /* @__PURE__ */ w(S, { children: [
689
+ children: /* @__PURE__ */ w(W, {
690
+ label: /* @__PURE__ */ T(C, { children: [
664
691
  a("healthybowl.plantScan.suggestedTreatment", "Suggested Treatment"),
665
692
  " ",
666
- /* @__PURE__ */ C("span", {
693
+ /* @__PURE__ */ w("span", {
667
694
  className: "rounded bg-status-success-bgSubtle px-1.5 py-0.5 text-[11px] text-status-success-text",
668
695
  children: a("healthybowl.plantScan.aiSuggested", "AI-suggested (organic-safe)")
669
696
  })
670
697
  ] }),
671
- children: /* @__PURE__ */ C("textarea", {
672
- value: s.treatment,
673
- onChange: (e) => d("treatment", e.target.value),
698
+ children: /* @__PURE__ */ w("textarea", {
699
+ value: c.treatment,
700
+ onChange: (e) => f("treatment", e.target.value),
674
701
  rows: 2,
675
- className: j
702
+ className: P
676
703
  })
677
704
  })
678
705
  }),
679
- /* @__PURE__ */ C("div", {
706
+ /* @__PURE__ */ w("div", {
680
707
  className: "mt-4",
681
- children: /* @__PURE__ */ C(V, {
708
+ children: /* @__PURE__ */ w(W, {
682
709
  label: a("healthybowl.plantScan.notesField", "Notes"),
683
- children: /* @__PURE__ */ C("textarea", {
684
- value: s.notes,
685
- onChange: (e) => d("notes", e.target.value),
710
+ children: /* @__PURE__ */ w("textarea", {
711
+ value: c.notes,
712
+ onChange: (e) => f("notes", e.target.value),
686
713
  rows: 2,
687
714
  placeholder: a("healthybowl.plantScan.addObservations", "Add any observations…"),
688
- className: j
715
+ className: P
689
716
  })
690
717
  })
691
718
  }),
692
- /* @__PURE__ */ w("label", {
719
+ /* @__PURE__ */ T("label", {
693
720
  className: "mt-4 flex items-center gap-2 text-sm text-text-secondary",
694
- children: [/* @__PURE__ */ C("input", {
721
+ children: [/* @__PURE__ */ w("input", {
695
722
  type: "checkbox",
696
- checked: s.attachPhoto,
697
- onChange: (e) => d("attachPhoto", e.target.checked)
723
+ checked: c.attachPhoto,
724
+ onChange: (e) => f("attachPhoto", e.target.checked)
698
725
  }), a("healthybowl.plantScan.attachPhoto", "Attach scan photo to this issue")]
699
726
  })
700
727
  ]
701
728
  });
702
729
  }
703
- function V({ label: e, children: t }) {
704
- return /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("label", {
730
+ function W({ label: e, children: t }) {
731
+ return /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
705
732
  className: "mb-1 flex items-center gap-2 text-xs font-medium text-text-secondary",
706
733
  children: e
707
734
  }), t] });
708
735
  }
709
- function H(e, t) {
736
+ function G(e, t) {
710
737
  return {
711
738
  scanId: e.id,
712
739
  fieldId: e.fieldId ?? t ?? "",
713
740
  pestName: e.topScientificName ? `${e.topDiagnosis ?? ""} (${e.topScientificName})`.trim() : e.topDiagnosis ?? "",
714
- type: B(e.topType),
741
+ type: U(e.topType),
715
742
  cropAffected: e.cropName ?? "",
716
743
  severity: (e.severity ?? "MEDIUM").toUpperCase() === "MODERATE" ? "MEDIUM" : (e.severity ?? "MEDIUM").toUpperCase(),
717
744
  status: "ACTIVE",
@@ -721,6 +748,6 @@ function H(e, t) {
721
748
  };
722
749
  }
723
750
  //#endregion
724
- export { I as AiPestDetectionPage };
751
+ export { z as AiPestDetectionPage };
725
752
 
726
753
  //# sourceMappingURL=AiPestDetectionPage.js.map