@burdenoff/microfe-healthybowl 2026.1005.2 → 2026.1007.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/healthybowl/components/BedLayoutGrid.js +128 -115
  2. package/dist/healthybowl/components/BedLayoutGrid.js.map +1 -1
  3. package/dist/healthybowl/components/CropPicker.js +37 -0
  4. package/dist/healthybowl/components/CropPicker.js.map +1 -0
  5. package/dist/healthybowl/components/DataTable.js +125 -108
  6. package/dist/healthybowl/components/DataTable.js.map +1 -1
  7. package/dist/healthybowl/components/FilterBar.js +9 -6
  8. package/dist/healthybowl/components/FilterBar.js.map +1 -1
  9. package/dist/healthybowl/components/PlantCatalogPicker.js +32 -0
  10. package/dist/healthybowl/components/PlantCatalogPicker.js.map +1 -0
  11. package/dist/healthybowl/components/WorkspaceRecordPicker.js +164 -0
  12. package/dist/healthybowl/components/WorkspaceRecordPicker.js.map +1 -0
  13. package/dist/healthybowl/components/index.js +3 -1
  14. package/dist/healthybowl/hooks/useCropPage.js +71 -0
  15. package/dist/healthybowl/hooks/useCropPage.js.map +1 -0
  16. package/dist/healthybowl/hooks/usePlantCatalog.js +133 -44
  17. package/dist/healthybowl/hooks/usePlantCatalog.js.map +1 -1
  18. package/dist/healthybowl/hooks/usePlantingEstimate.js +6 -6
  19. package/dist/healthybowl/hooks/usePlantingEstimate.js.map +1 -1
  20. package/dist/healthybowl/hooks/useWorkspaceRead.js +46 -0
  21. package/dist/healthybowl/hooks/useWorkspaceRead.js.map +1 -0
  22. package/dist/healthybowl/pages/HomePage.js +143 -142
  23. package/dist/healthybowl/pages/HomePage.js.map +1 -1
  24. package/dist/healthybowl/pages/analytics/ReportsPage.js +8 -8
  25. package/dist/healthybowl/pages/catalog/PlantCatalogPage.js +266 -192
  26. package/dist/healthybowl/pages/catalog/PlantCatalogPage.js.map +1 -1
  27. package/dist/healthybowl/pages/catalog/WorkspaceBrowseFilters.js +58 -0
  28. package/dist/healthybowl/pages/catalog/WorkspaceBrowseFilters.js.map +1 -0
  29. package/dist/healthybowl/pages/catalog/browsePagination.js +24 -0
  30. package/dist/healthybowl/pages/catalog/browsePagination.js.map +1 -0
  31. package/dist/healthybowl/pages/compliance/ComplianceDocumentsPage.js +6 -6
  32. package/dist/healthybowl/pages/crops/CropDetailsPage.js +340 -348
  33. package/dist/healthybowl/pages/crops/CropDetailsPage.js.map +1 -1
  34. package/dist/healthybowl/pages/crops/CropPlanningPage.js +468 -434
  35. package/dist/healthybowl/pages/crops/CropPlanningPage.js.map +1 -1
  36. package/dist/healthybowl/pages/crops/CropsPage.js +633 -542
  37. package/dist/healthybowl/pages/crops/CropsPage.js.map +1 -1
  38. package/dist/healthybowl/pages/crops/FieldDetailsPage.js +875 -800
  39. package/dist/healthybowl/pages/crops/FieldDetailsPage.js.map +1 -1
  40. package/dist/healthybowl/pages/crops/PlanningDetailsPage.js +459 -448
  41. package/dist/healthybowl/pages/crops/PlanningDetailsPage.js.map +1 -1
  42. package/dist/healthybowl/pages/crops/SuccessionCropLabel.js +21 -0
  43. package/dist/healthybowl/pages/crops/SuccessionCropLabel.js.map +1 -0
  44. package/dist/healthybowl/pages/crops/planningEdit.js +30 -0
  45. package/dist/healthybowl/pages/crops/planningEdit.js.map +1 -0
  46. package/dist/healthybowl/pages/fields/FieldMapPage.js +989 -941
  47. package/dist/healthybowl/pages/fields/FieldMapPage.js.map +1 -1
  48. package/dist/healthybowl/pages/financial/GeneralLedgerPage.js +6 -6
  49. package/dist/healthybowl/pages/financial/InvoiceManagementPage.js +7 -7
  50. package/dist/healthybowl/pages/financial/InvoiceManagementPage.js.map +1 -1
  51. package/dist/healthybowl/pages/financial/TransactionsPage.js +541 -541
  52. package/dist/healthybowl/pages/financial/TransactionsPage.js.map +1 -1
  53. package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js +10 -10
  54. package/dist/healthybowl/pages/government-schemes/CommunicationPage.js +207 -207
  55. package/dist/healthybowl/pages/government-schemes/CommunicationPage.js.map +1 -1
  56. package/dist/healthybowl/pages/government-schemes/SchemeAdminPage.js +38 -38
  57. package/dist/healthybowl/pages/government-schemes/SchemeAdminPage.js.map +1 -1
  58. package/dist/healthybowl/pages/government-schemes/TrainingProgramsPage.js +15 -15
  59. package/dist/healthybowl/pages/government-schemes/TrainingProgramsPage.js.map +1 -1
  60. package/dist/healthybowl/pages/livestock/AnimalRegistryPage.js +4 -4
  61. package/dist/healthybowl/pages/livestock/BreedingManagementPage.js +4 -4
  62. package/dist/healthybowl/pages/livestock/FeedManagementPage.js +4 -4
  63. package/dist/healthybowl/pages/livestock/HealthRecordsPage.js +16 -16
  64. package/dist/healthybowl/pages/livestock/HealthRecordsPage.js.map +1 -1
  65. package/dist/healthybowl/pages/livestock/ProductionTrackingPage.js +4 -4
  66. package/dist/healthybowl/pages/livestock/VaccinationSchedulePage.js +4 -4
  67. package/dist/healthybowl/pages/market/MarketPricesPage.js +305 -305
  68. package/dist/healthybowl/pages/market/MarketPricesPage.js.map +1 -1
  69. package/dist/healthybowl/pages/network/CohortsPage.js +107 -107
  70. package/dist/healthybowl/pages/network/CohortsPage.js.map +1 -1
  71. package/dist/healthybowl/pages/network/CommunityPage.js +247 -247
  72. package/dist/healthybowl/pages/network/CommunityPage.js.map +1 -1
  73. package/dist/healthybowl/pages/network/EventsPage.js +16 -16
  74. package/dist/healthybowl/pages/network/EventsPage.js.map +1 -1
  75. package/dist/healthybowl/pages/network/ExpertsPage.js +470 -470
  76. package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
  77. package/dist/healthybowl/pages/network/MentorsPage.js +6 -6
  78. package/dist/healthybowl/pages/pest-management/PestIssuesPage.js +8 -8
  79. package/dist/healthybowl/pages/pest-management/TreatmentLibraryPage.js +7 -7
  80. package/dist/healthybowl/pages/pest-management/TreatmentLibraryPage.js.map +1 -1
  81. package/dist/healthybowl/pages/production/ProductionBatchesPage.js +7 -7
  82. package/dist/healthybowl/pages/production/RecipeManagementPage.js +5 -5
  83. package/dist/healthybowl/pages/production/ValueAddedProductsPage.js +7 -7
  84. package/dist/healthybowl/pages/soil/SoilTestsPage.js +6 -6
  85. package/dist/healthybowl/pages/soil/SoilTestsPage.js.map +1 -1
  86. package/dist/healthybowl/pages/suppliers/SuppliersPage.js +10 -10
  87. package/dist/healthybowl/pages/sustainability/CarbonCreditLedgerPage.js +6 -6
  88. package/dist/healthybowl/pages/terrace/PlantingFormModal.js +151 -131
  89. package/dist/healthybowl/pages/terrace/PlantingFormModal.js.map +1 -1
  90. package/dist/healthybowl/pages/traceability/BatchTrackingPage.js +6 -6
  91. package/dist/healthybowl/utils/cropComparison.js +1 -1
  92. package/dist/healthybowl/utils/cropComparison.js.map +1 -1
  93. package/dist/healthybowl/utils/cropPicker.js +35 -0
  94. package/dist/healthybowl/utils/cropPicker.js.map +1 -0
  95. package/dist/healthybowl/utils/plantingCapacity.js +2 -2
  96. package/dist/healthybowl/utils/plantingCapacity.js.map +1 -1
  97. package/dist/healthybowl/utils/quotaLabels.js +8 -0
  98. package/dist/healthybowl/utils/quotaLabels.js.map +1 -0
  99. package/dist/healthybowl/utils/seedRate.js +1 -8
  100. package/dist/healthybowl/utils/seedRate.js.map +1 -1
  101. package/package.json +1 -1
@@ -1,27 +1,31 @@
1
- import { formatDate as e, formatNumber as t } from "../../utils/helpers.js";
2
- import { PageLayout as n } from "../../components/PageLayout.js";
1
+ import { useHealthyBowl as e } from "../../context/HealthyBowlContext.js";
2
+ import { formatDate as t, formatNumber as n } from "../../utils/helpers.js";
3
+ import { PageLayout as r } from "../../components/PageLayout.js";
3
4
  import { useBasePath as ee } from "../../hooks/useBasePath.js";
4
- import { StatusBadge as r } from "../../components/StatusBadge.js";
5
- import { EmptyState as te } from "../../components/EmptyState.js";
6
- import { ErrorState as ne } from "../../components/ErrorState.js";
7
- import { ToastContainer as re } from "../../components/Toast.js";
8
- import { useConfirm as ie } from "../../components/ConfirmDialog.js";
9
- import { Breadcrumbs as ae } from "../../components/Breadcrumbs.js";
10
- import { PageLoader as oe } from "../../components/PageLoader.js";
11
- import { Modal as se } from "../../components/Modal.js";
12
- import { useToast as ce } from "../../hooks/useToast.js";
5
+ import { useCropDetail as te } from "../../hooks/useCropPage.js";
6
+ import { CropPicker as ne } from "../../components/CropPicker.js";
7
+ import { StatusBadge as i } from "../../components/StatusBadge.js";
8
+ import { EmptyState as re } from "../../components/EmptyState.js";
9
+ import { ErrorState as ie } from "../../components/ErrorState.js";
10
+ import { ToastContainer as ae } from "../../components/Toast.js";
11
+ import { useConfirm as oe } from "../../components/ConfirmDialog.js";
12
+ import { Breadcrumbs as se } from "../../components/Breadcrumbs.js";
13
+ import { PageLoader as ce } from "../../components/PageLoader.js";
14
+ import { Modal as le } from "../../components/Modal.js";
15
+ import { useToast as ue } from "../../hooks/useToast.js";
13
16
  import "../../components/index.js";
14
- import { useHealthyBowlData as le } from "../../hooks/useHealthyBowlData.js";
15
- import { isNative as ue, nativeNotify as de, nativeToast as fe } from "../../../utils/nativeBridge.js";
16
- import { PlanExecutionPanel as pe } from "../../components/PlanExecutionPanel.js";
17
- import { useEffect as me, useState as i } from "react";
18
- import { useI18n as he } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
19
- import { AlertTriangle as ge, ArrowLeft as _e, Beaker as a, Calendar as ve, ClipboardList as ye, Clock as o, CloudRain as be, Edit as xe, Leaf as Se, MapPin as s, Sprout as c, Target as Ce, Trash2 as we, TrendingUp as Te } from "lucide-react";
20
- import { useNavigate as Ee, useParams as De } from "react-router";
21
- import { Fragment as Oe, jsx as l, jsxs as u } from "react/jsx-runtime";
22
- import { Button as d, GlassCard as ke, Select as f, SelectContent as p, SelectItem as m, SelectTrigger as h, SelectValue as g } from "@burdenoff/fe-libs/ui";
17
+ import { useHealthyBowlData as de } from "../../hooks/useHealthyBowlData.js";
18
+ import { isNative as fe, nativeNotify as pe, nativeToast as me } from "../../../utils/nativeBridge.js";
19
+ import { buildPlanningEditInput as he, initialPlanAssociations as ge } from "./planningEdit.js";
20
+ import { PlanExecutionPanel as _e } from "../../components/PlanExecutionPanel.js";
21
+ import { useState as a } from "react";
22
+ import { useI18n as ve } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
23
+ import { AlertTriangle as ye, ArrowLeft as be, Beaker as o, Calendar as xe, ClipboardList as Se, Clock as s, CloudRain as c, Edit as Ce, Leaf as we, MapPin as l, Sprout as u, Target as Te, Trash2 as Ee, TrendingUp as d } from "lucide-react";
24
+ import { useNavigate as De, useParams as f } from "react-router";
25
+ import { Fragment as Oe, jsx as p, jsxs as m } from "react/jsx-runtime";
26
+ import { Button as h, GlassCard as ke, Select as g, SelectContent as _, SelectItem as v, SelectTrigger as y, SelectValue as b } from "@burdenoff/fe-libs/ui";
23
27
  //#region src/healthybowl/pages/crops/PlanningDetailsPage.tsx
24
- var _ = (e) => {
28
+ var x = (e) => {
25
29
  switch (e) {
26
30
  case "active": return "success";
27
31
  case "approved": return "info";
@@ -29,107 +33,114 @@ var _ = (e) => {
29
33
  case "completed": return "default";
30
34
  default: return "muted";
31
35
  }
32
- }, v = (e) => {
36
+ }, S = (e) => {
33
37
  switch (e) {
34
38
  case "high": return "error";
35
39
  case "medium": return "warning";
36
40
  default: return "success";
37
41
  }
38
- }, y = (e) => {
42
+ }, C = (e) => {
39
43
  switch (e) {
40
44
  case "high": return "error";
41
45
  case "medium": return "warning";
42
46
  default: return "success";
43
47
  }
44
- }, b = (e) => (e ?? "").trim().toLowerCase(), x = () => {
45
- let { t: x } = he(), Ae = ie(), S = (e) => {
46
- switch (e) {
47
- case "kharif": return x("healthybowl.crops.planningDetail.season.kharif", "Kharif");
48
- case "rabi": return x("healthybowl.crops.planningDetail.season.rabi", "Rabi");
49
- case "zaid": return x("healthybowl.crops.planningDetail.season.zaid", "Zaid");
50
- case "perennial": return x("healthybowl.crops.planningDetail.season.perennial", "Perennial");
51
- default: return e;
48
+ }, w = (e) => (e ?? "").trim().toLowerCase(), T = () => {
49
+ let { workspaceId: t } = e(), { planId: n } = f();
50
+ return t ? /* @__PURE__ */ p(E, {}, `${t}:${n ?? ""}`) : /* @__PURE__ */ p(r, {
51
+ title: "Planting plan details",
52
+ children: /* @__PURE__ */ p("p", {
53
+ className: "text-sm text-text-secondary",
54
+ children: "Choose a workspace to view its planting plans."
55
+ })
56
+ });
57
+ }, E = () => {
58
+ let { t: e } = ve(), T = oe(), E = (t) => {
59
+ switch (t) {
60
+ case "kharif": return e("healthybowl.crops.planningDetail.season.kharif", "Kharif");
61
+ case "rabi": return e("healthybowl.crops.planningDetail.season.rabi", "Rabi");
62
+ case "zaid": return e("healthybowl.crops.planningDetail.season.zaid", "Zaid");
63
+ case "perennial": return e("healthybowl.crops.planningDetail.season.perennial", "Perennial");
64
+ default: return t;
52
65
  }
53
- }, { plantingPlans: C, fields: w, crops: T, errors: je, loadings: Me, updatePlantingPlan: Ne, deletePlantingPlan: Pe, refetch: E } = le(), { planId: D } = De(), O = Ee(), { buildPath: k } = ee(), { toasts: Fe, toast: A, dismiss: Ie } = ce(), [Le, j] = i(!1), [M, N] = i(!1), [P, Re] = i(() => C.find((e) => e.id === D));
54
- me(() => {
55
- let e = C.find((e) => e.id === D);
56
- e && Re(e);
57
- }, [C, D]);
58
- let [F, I] = i(""), [L, R] = i(""), [z, B] = i(""), [V, H] = i(""), [U, W] = i(""), [G, K] = i(""), [q, J] = i("low"), [Y, X] = i("draft"), ze = () => {
59
- if (!P) return;
60
- let e = T.find((e) => e.id === P.cropId) ?? T.find((e) => b(e.name) === b(P.cropName)), t = w.find((e) => e.id === P.fieldId) ?? w.find((e) => b(e.name) === b(P.fieldName));
61
- I(e?.id ?? ""), R(t?.id ?? ""), B(P.startDate), H(P.endDate), W(String(P.expectedYield)), K(String(P.seedRequired)), J(P.priority), X(P.status), j(!0);
66
+ }, { plantingPlans: Ae, fields: D, crops: O, errors: je, loadings: Me, updatePlantingPlan: Ne, deletePlantingPlan: Pe, refetch: k } = de(), { planId: Fe } = f(), A = De(), { buildPath: j } = ee(), { toasts: Ie, toast: M, dismiss: Le } = ue(), [N, P] = a(!1), [F, I] = a(!1), L = Ae.find((e) => e.id === Fe), [R, z] = a(""), [B, V] = a(""), [Re, ze] = a({
67
+ cropId: "",
68
+ fieldId: ""
69
+ }), { crop: Be } = te(R, { skip: !N }), [H, U] = a(""), [W, G] = a(""), [K, q] = a(""), [J, Y] = a(""), [X, Ve] = a("low"), [He, Ue] = a("draft"), Z = () => {
70
+ if (!L) return;
71
+ let e = ge(L, O, D);
72
+ ze(e), z(e.cropId), V(e.fieldId), U(L.startDate), G(L.endDate), q(String(L.expectedYield)), Y(String(L.seedRequired)), Ve(L.priority), Ue(L.status), P(!0);
62
73
  };
63
- if (!P) return /* @__PURE__ */ l(n, {
64
- title: x("healthybowl.crops.planningDetail.notFound.title", "Plan Not Found"),
65
- children: Me.crops ? /* @__PURE__ */ l(oe, {}) : je.crops ? /* @__PURE__ */ l(ne, { onRetry: E }) : /* @__PURE__ */ l(te, {
66
- title: x("healthybowl.crops.planningDetail.notFound.emptyTitle", "Plan not found"),
67
- description: x("healthybowl.crops.planningDetail.notFound.description", "The planting plan you are looking for does not exist."),
68
- action: /* @__PURE__ */ l(d, {
69
- onClick: () => O(k("crops/planning")),
70
- children: x("healthybowl.crops.planningDetail.actions.backToPlans", "Back to Plans")
74
+ if (!L) return /* @__PURE__ */ p(r, {
75
+ title: e("healthybowl.crops.planningDetail.notFound.title", "Plan Not Found"),
76
+ children: Me.crops ? /* @__PURE__ */ p(ce, {}) : je.crops ? /* @__PURE__ */ p(ie, { onRetry: k }) : /* @__PURE__ */ p(re, {
77
+ title: e("healthybowl.crops.planningDetail.notFound.emptyTitle", "Plan not found"),
78
+ description: e("healthybowl.crops.planningDetail.notFound.description", "The planting plan you are looking for does not exist."),
79
+ action: /* @__PURE__ */ p(h, {
80
+ onClick: () => A(j("crops/planning")),
81
+ children: e("healthybowl.crops.planningDetail.actions.backToPlans", "Back to Plans")
71
82
  })
72
83
  })
73
84
  });
74
- let Z = w.find((e) => e.id === P.fieldId) ?? w.find((e) => b(e.name) === b(P.fieldName)), Be = /* @__PURE__ */ new Date(), Ve = new Date(P.startDate), Q = new Date(P.endDate).getTime() - Ve.getTime(), He = Be.getTime() - Ve.getTime(), Ue = Q > 0 ? Math.max(0, Math.min(100, Math.round(He / Q * 100))) : 0, We = Math.ceil(Q / (1e3 * 60 * 60 * 24)), $ = Math.max(0, Math.ceil(He / (1e3 * 60 * 60 * 24))), Ge = Math.max(0, We - $);
75
- return /* @__PURE__ */ u(n, {
76
- title: `${P.cropName} - ${P.fieldName}`,
77
- description: x("healthybowl.crops.planningDetail.subtitle", "Planting plan for {{season}} season", { season: S(P.season) }),
78
- actions: /* @__PURE__ */ u("div", {
85
+ let Q = D.find((e) => L.fieldId ? e.id === L.fieldId : w(e.name) === w(L.fieldName)), We = /* @__PURE__ */ new Date(), Ge = new Date(L.startDate), $ = new Date(L.endDate).getTime() - Ge.getTime(), Ke = We.getTime() - Ge.getTime(), qe = $ > 0 ? Math.max(0, Math.min(100, Math.round(Ke / $ * 100))) : 0, Je = Math.ceil($ / (1e3 * 60 * 60 * 24)), Ye = Math.max(0, Math.ceil(Ke / (1e3 * 60 * 60 * 24))), Xe = Math.max(0, Je - Ye);
86
+ return /* @__PURE__ */ m(r, {
87
+ title: `${L.cropName} - ${L.fieldName}`,
88
+ description: e("healthybowl.crops.planningDetail.subtitle", "Planting plan for {{season}} season", { season: E(L.season) }),
89
+ actions: /* @__PURE__ */ m("div", {
79
90
  className: "flex items-center gap-2",
80
91
  children: [
81
- /* @__PURE__ */ u(d, {
92
+ /* @__PURE__ */ m(h, {
82
93
  variant: "outline",
83
- onClick: ze,
94
+ onClick: Z,
84
95
  children: [
85
- /* @__PURE__ */ l(xe, { className: "h-4 w-4" }),
96
+ /* @__PURE__ */ p(Ce, { className: "h-4 w-4" }),
86
97
  " ",
87
- x("healthybowl.common.edit", "Edit")
98
+ e("healthybowl.common.edit", "Edit")
88
99
  ]
89
100
  }),
90
- /* @__PURE__ */ u(d, {
101
+ /* @__PURE__ */ m(h, {
91
102
  variant: "destructive",
92
103
  onClick: async () => {
93
- if (P && await Ae({
94
- title: x("healthybowl.crops.planningDetail.deleteConfirm.title", "Delete planting plan?"),
95
- message: x("healthybowl.crops.planningDetail.deleteConfirm.message", "{{crop}} plan for {{field}} will be permanently removed.", {
96
- crop: P.cropName,
97
- field: P.fieldName
104
+ if (L && await T({
105
+ title: e("healthybowl.crops.planningDetail.deleteConfirm.title", "Delete planting plan?"),
106
+ message: e("healthybowl.crops.planningDetail.deleteConfirm.message", "{{crop}} plan for {{field}} will be permanently removed.", {
107
+ crop: L.cropName,
108
+ field: L.fieldName
98
109
  }),
99
- okButtonTitle: x("healthybowl.common.delete", "Delete"),
100
- cancelButtonTitle: x("healthybowl.common.cancel", "Cancel")
110
+ okButtonTitle: e("healthybowl.common.delete", "Delete"),
111
+ cancelButtonTitle: e("healthybowl.common.cancel", "Cancel")
101
112
  }) !== !1) {
102
- N(!0);
113
+ I(!0);
103
114
  try {
104
- await Pe(P.id), A({
105
- title: x("healthybowl.crops.planningDetail.toast.deleted.title", "Plan deleted"),
106
- description: x("healthybowl.crops.planningDetail.toast.deleted.description", "{{crop}} plan has been removed.", { crop: P.cropName }),
115
+ await Pe(L.id), M({
116
+ title: e("healthybowl.crops.planningDetail.toast.deleted.title", "Plan deleted"),
117
+ description: e("healthybowl.crops.planningDetail.toast.deleted.description", "{{crop}} plan has been removed.", { crop: L.cropName }),
107
118
  variant: "success"
108
- }), ue() && (fe(x("healthybowl.crops.planningDetail.toast.deleted.title", "Plan deleted")), de("success")), O(k("crops/planning"));
109
- } catch (e) {
110
- A({
111
- title: x("healthybowl.crops.planningDetail.toast.deleteFailed.title", "Delete failed"),
112
- description: String(e),
119
+ }), fe() && (me(e("healthybowl.crops.planningDetail.toast.deleted.title", "Plan deleted")), pe("success")), A(j("crops/planning"));
120
+ } catch (t) {
121
+ M({
122
+ title: e("healthybowl.crops.planningDetail.toast.deleteFailed.title", "Delete failed"),
123
+ description: String(t),
113
124
  variant: "error"
114
- }), N(!1);
125
+ }), I(!1);
115
126
  }
116
127
  }
117
128
  },
118
- disabled: M,
129
+ disabled: F,
119
130
  children: [
120
- /* @__PURE__ */ l(we, { className: "h-4 w-4" }),
131
+ /* @__PURE__ */ p(Ee, { className: "h-4 w-4" }),
121
132
  " ",
122
- x("healthybowl.common.delete", "Delete")
133
+ e("healthybowl.common.delete", "Delete")
123
134
  ]
124
135
  }),
125
- /* @__PURE__ */ u(d, {
136
+ /* @__PURE__ */ m(h, {
126
137
  variant: "outline",
127
138
  size: "sm",
128
- onClick: () => O(k("crops/planning")),
139
+ onClick: () => A(j("crops/planning")),
129
140
  children: [
130
- /* @__PURE__ */ l(_e, { className: "h-4 w-4" }),
141
+ /* @__PURE__ */ p(be, { className: "h-4 w-4" }),
131
142
  " ",
132
- x("healthybowl.common.back", "Back")
143
+ e("healthybowl.common.back", "Back")
133
144
  ]
134
145
  })
135
146
  ]
@@ -138,532 +149,532 @@ var _ = (e) => {
138
149
  nextSteps: [
139
150
  {
140
151
  id: "edit",
141
- label: x("healthybowl.crops.planningDetail.nextSteps.edit.label", "Refine this plan"),
142
- description: x("healthybowl.crops.planningDetail.nextSteps.edit.desc", "Adjust timing, field or priority before you commit to it."),
143
- onClick: ze
152
+ label: e("healthybowl.crops.planningDetail.nextSteps.edit.label", "Refine this plan"),
153
+ description: e("healthybowl.crops.planningDetail.nextSteps.edit.desc", "Adjust timing, field or priority before you commit to it."),
154
+ onClick: Z
144
155
  },
145
156
  {
146
157
  id: "weather",
147
- label: x("healthybowl.crops.planningDetail.nextSteps.weather.label", "Check the weather outlook"),
148
- description: x("healthybowl.crops.planningDetail.nextSteps.weather.desc", "Make sure conditions suit your planned planting window."),
149
- href: k("weather")
158
+ label: e("healthybowl.crops.planningDetail.nextSteps.weather.label", "Check the weather outlook"),
159
+ description: e("healthybowl.crops.planningDetail.nextSteps.weather.desc", "Make sure conditions suit your planned planting window."),
160
+ href: j("weather")
150
161
  },
151
162
  {
152
163
  id: "crops",
153
- label: x("healthybowl.crops.planningDetail.nextSteps.crops.label", "See your active crops"),
154
- description: x("healthybowl.crops.planningDetail.nextSteps.crops.desc", "Once planted, track this plan as a living crop."),
155
- href: k("crops")
164
+ label: e("healthybowl.crops.planningDetail.nextSteps.crops.label", "See your active crops"),
165
+ description: e("healthybowl.crops.planningDetail.nextSteps.crops.desc", "Once planted, track this plan as a living crop."),
166
+ href: j("crops")
156
167
  }
157
168
  ],
158
169
  nextStepsKey: "healthybowl-plan-detail",
159
170
  children: [
160
- /* @__PURE__ */ l(ae, { items: [
171
+ /* @__PURE__ */ p(se, { items: [
161
172
  {
162
- label: x("healthybowl.crops.planningDetail.breadcrumbs.crops", "Crops"),
163
- href: k("crops")
173
+ label: e("healthybowl.crops.planningDetail.breadcrumbs.crops", "Crops"),
174
+ href: j("crops")
164
175
  },
165
176
  {
166
- label: x("healthybowl.crops.planningDetail.breadcrumbs.planning", "Planning"),
167
- href: k("crops/planning")
177
+ label: e("healthybowl.crops.planningDetail.breadcrumbs.planning", "Planning"),
178
+ href: j("crops/planning")
168
179
  },
169
- { label: P.cropName }
180
+ { label: L.cropName }
170
181
  ] }),
171
- /* @__PURE__ */ u("div", {
182
+ /* @__PURE__ */ m("div", {
172
183
  className: "flex flex-wrap items-center gap-3",
173
184
  children: [
174
- /* @__PURE__ */ l(r, {
175
- label: P.status,
176
- variant: _(P.status ?? "unknown"),
185
+ /* @__PURE__ */ p(i, {
186
+ label: L.status,
187
+ variant: x(L.status ?? "unknown"),
177
188
  dot: !0
178
189
  }),
179
- /* @__PURE__ */ l(r, {
180
- label: x("healthybowl.crops.planningDetail.badges.priority", "Priority: {{priority}}", { priority: P.priority }),
181
- variant: v(P.priority)
190
+ /* @__PURE__ */ p(i, {
191
+ label: e("healthybowl.crops.planningDetail.badges.priority", "Priority: {{priority}}", { priority: L.priority }),
192
+ variant: S(L.priority)
182
193
  }),
183
- /* @__PURE__ */ l(r, {
184
- label: x("healthybowl.crops.planningDetail.badges.weatherRisk", "Weather Risk: {{risk}}", { risk: P.weatherRisk }),
185
- variant: y(P.weatherRisk)
194
+ /* @__PURE__ */ p(i, {
195
+ label: e("healthybowl.crops.planningDetail.badges.weatherRisk", "Weather Risk: {{risk}}", { risk: L.weatherRisk }),
196
+ variant: C(L.weatherRisk)
186
197
  }),
187
- /* @__PURE__ */ l(r, {
188
- label: S(P.season),
198
+ /* @__PURE__ */ p(i, {
199
+ label: E(L.season),
189
200
  variant: "muted"
190
201
  })
191
202
  ]
192
203
  }),
193
- /* @__PURE__ */ u("div", {
204
+ /* @__PURE__ */ m("div", {
194
205
  className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
195
- children: [/* @__PURE__ */ u("div", {
206
+ children: [/* @__PURE__ */ m("div", {
196
207
  className: "space-y-6 lg:col-span-2",
197
208
  children: [
198
- /* @__PURE__ */ u(ke, {
209
+ /* @__PURE__ */ m(ke, {
199
210
  treatment: "glass",
200
211
  glow: !0,
201
212
  className: "border-border-seam p-6",
202
- children: [/* @__PURE__ */ u("h3", {
213
+ children: [/* @__PURE__ */ m("h3", {
203
214
  className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
204
215
  children: [
205
- /* @__PURE__ */ l(ye, { className: "h-4 w-4 text-info" }),
216
+ /* @__PURE__ */ p(Se, { className: "h-4 w-4 text-info" }),
206
217
  " ",
207
- x("healthybowl.crops.planningDetail.overview.title", "Plan Overview")
218
+ e("healthybowl.crops.planningDetail.overview.title", "Plan Overview")
208
219
  ]
209
- }), /* @__PURE__ */ u("div", {
220
+ }), /* @__PURE__ */ m("div", {
210
221
  className: "grid grid-cols-2 gap-4 md:grid-cols-4",
211
222
  children: [
212
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("div", {
223
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("div", {
213
224
  className: "flex items-center gap-1 text-text-secondary",
214
- children: [/* @__PURE__ */ l(c, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ l("span", {
225
+ children: [/* @__PURE__ */ p(u, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ p("span", {
215
226
  className: "text-xs",
216
- children: x("healthybowl.crops.planningDetail.overview.crop", "Crop")
227
+ children: e("healthybowl.crops.planningDetail.overview.crop", "Crop")
217
228
  })]
218
- }), /* @__PURE__ */ l("p", {
229
+ }), /* @__PURE__ */ p("p", {
219
230
  className: "mt-1 text-sm font-semibold text-text-primary",
220
- children: P.cropName
231
+ children: L.cropName
221
232
  })] }),
222
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("div", {
233
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("div", {
223
234
  className: "flex items-center gap-1 text-text-secondary",
224
- children: [/* @__PURE__ */ l(s, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ l("span", {
235
+ children: [/* @__PURE__ */ p(l, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ p("span", {
225
236
  className: "text-xs",
226
- children: x("healthybowl.crops.planningDetail.overview.field", "Field")
237
+ children: e("healthybowl.crops.planningDetail.overview.field", "Field")
227
238
  })]
228
- }), /* @__PURE__ */ l("p", {
239
+ }), /* @__PURE__ */ p("p", {
229
240
  className: "mt-1 text-sm font-semibold text-text-primary",
230
- children: P.fieldName
241
+ children: L.fieldName
231
242
  })] }),
232
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("div", {
243
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("div", {
233
244
  className: "flex items-center gap-1 text-text-secondary",
234
- children: [/* @__PURE__ */ l(Se, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ l("span", {
245
+ children: [/* @__PURE__ */ p(we, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ p("span", {
235
246
  className: "text-xs",
236
- children: x("healthybowl.crops.planningDetail.overview.season", "Season")
247
+ children: e("healthybowl.crops.planningDetail.overview.season", "Season")
237
248
  })]
238
- }), /* @__PURE__ */ l("p", {
249
+ }), /* @__PURE__ */ p("p", {
239
250
  className: "mt-1 text-sm font-semibold capitalize text-text-primary",
240
- children: S(P.season)
251
+ children: E(L.season)
241
252
  })] }),
242
- Z && /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("div", {
253
+ Q && /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("div", {
243
254
  className: "flex items-center gap-1 text-text-secondary",
244
- children: [/* @__PURE__ */ l(s, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ l("span", {
255
+ children: [/* @__PURE__ */ p(l, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ p("span", {
245
256
  className: "text-xs",
246
- children: x("healthybowl.crops.planningDetail.overview.fieldArea", "Field Area")
257
+ children: e("healthybowl.crops.planningDetail.overview.fieldArea", "Field Area")
247
258
  })]
248
- }), /* @__PURE__ */ u("p", {
259
+ }), /* @__PURE__ */ m("p", {
249
260
  className: "mt-1 text-sm font-semibold text-text-primary",
250
261
  children: [
251
- Z.area,
262
+ Q.area,
252
263
  " ",
253
- Z.unit
264
+ Q.unit
254
265
  ]
255
266
  })] })
256
267
  ]
257
268
  })]
258
269
  }),
259
- /* @__PURE__ */ u("div", {
270
+ /* @__PURE__ */ m("div", {
260
271
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
261
272
  children: [
262
- /* @__PURE__ */ u("h3", {
273
+ /* @__PURE__ */ m("h3", {
263
274
  className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
264
275
  children: [
265
- /* @__PURE__ */ l(ve, { className: "h-4 w-4 text-info" }),
276
+ /* @__PURE__ */ p(xe, { className: "h-4 w-4 text-info" }),
266
277
  " ",
267
- x("healthybowl.crops.planningDetail.timeline.title", "Timeline")
278
+ e("healthybowl.crops.planningDetail.timeline.title", "Timeline")
268
279
  ]
269
280
  }),
270
- /* @__PURE__ */ u("div", {
281
+ /* @__PURE__ */ m("div", {
271
282
  className: "grid grid-cols-1 gap-4 md:grid-cols-3",
272
283
  children: [
273
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
284
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
274
285
  className: "text-xs text-text-secondary",
275
- children: x("healthybowl.crops.planningDetail.timeline.startDate", "Start Date")
276
- }), /* @__PURE__ */ l("p", {
286
+ children: e("healthybowl.crops.planningDetail.timeline.startDate", "Start Date")
287
+ }), /* @__PURE__ */ p("p", {
277
288
  className: "text-sm font-semibold text-text-primary",
278
- children: e(P.startDate)
289
+ children: t(L.startDate)
279
290
  })] }),
280
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
291
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
281
292
  className: "text-xs text-text-secondary",
282
- children: x("healthybowl.crops.planningDetail.timeline.endDate", "End Date")
283
- }), /* @__PURE__ */ l("p", {
293
+ children: e("healthybowl.crops.planningDetail.timeline.endDate", "End Date")
294
+ }), /* @__PURE__ */ p("p", {
284
295
  className: "text-sm font-semibold text-text-primary",
285
- children: e(P.endDate)
296
+ children: t(L.endDate)
286
297
  })] }),
287
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
298
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
288
299
  className: "text-xs text-text-secondary",
289
- children: x("healthybowl.crops.planningDetail.timeline.duration", "Duration")
290
- }), /* @__PURE__ */ l("p", {
300
+ children: e("healthybowl.crops.planningDetail.timeline.duration", "Duration")
301
+ }), /* @__PURE__ */ p("p", {
291
302
  className: "text-sm font-semibold text-text-primary",
292
- children: x("healthybowl.crops.planningDetail.timeline.days", "{{count}} days", { count: We })
303
+ children: e("healthybowl.crops.planningDetail.timeline.days", "{{count}} days", { count: Je })
293
304
  })] })
294
305
  ]
295
306
  }),
296
- /* @__PURE__ */ u("div", {
307
+ /* @__PURE__ */ m("div", {
297
308
  className: "mt-5",
298
309
  children: [
299
- /* @__PURE__ */ u("div", {
310
+ /* @__PURE__ */ m("div", {
300
311
  className: "flex items-center justify-between text-xs text-text-secondary",
301
- children: [/* @__PURE__ */ l("span", { children: x("healthybowl.crops.planningDetail.timeline.progress", "Timeline Progress") }), /* @__PURE__ */ u("span", { children: [Ue, "%"] })]
312
+ children: [/* @__PURE__ */ p("span", { children: e("healthybowl.crops.planningDetail.timeline.progress", "Timeline Progress") }), /* @__PURE__ */ m("span", { children: [qe, "%"] })]
302
313
  }),
303
- /* @__PURE__ */ l("div", {
314
+ /* @__PURE__ */ p("div", {
304
315
  className: "mt-2 h-3 rounded-full bg-bg-sunken",
305
- children: /* @__PURE__ */ l("div", {
316
+ children: /* @__PURE__ */ p("div", {
306
317
  className: "h-3 rounded-full bg-action-primary-bg transition-all",
307
- style: { width: `${Ue}%` }
318
+ style: { width: `${qe}%` }
308
319
  })
309
320
  }),
310
- /* @__PURE__ */ u("div", {
321
+ /* @__PURE__ */ m("div", {
311
322
  className: "mt-2 flex items-center justify-between text-xs text-text-secondary",
312
- children: [/* @__PURE__ */ l("span", { children: e(P.startDate) }), /* @__PURE__ */ l("span", { children: e(P.endDate) })]
323
+ children: [/* @__PURE__ */ p("span", { children: t(L.startDate) }), /* @__PURE__ */ p("span", { children: t(L.endDate) })]
313
324
  })
314
325
  ]
315
326
  }),
316
- /* @__PURE__ */ u("div", {
327
+ /* @__PURE__ */ m("div", {
317
328
  className: "mt-4 grid grid-cols-2 gap-4",
318
- children: [/* @__PURE__ */ u("div", {
329
+ children: [/* @__PURE__ */ m("div", {
319
330
  className: "rounded-lg bg-info/10 p-3",
320
- children: [/* @__PURE__ */ u("div", {
331
+ children: [/* @__PURE__ */ m("div", {
321
332
  className: "flex items-center gap-1.5",
322
- children: [/* @__PURE__ */ l(o, { className: "h-3.5 w-3.5 text-info" }), /* @__PURE__ */ l("span", {
333
+ children: [/* @__PURE__ */ p(s, { className: "h-3.5 w-3.5 text-info" }), /* @__PURE__ */ p("span", {
323
334
  className: "text-xs font-medium text-info",
324
- children: x("healthybowl.crops.planningDetail.timeline.elapsed", "Elapsed")
335
+ children: e("healthybowl.crops.planningDetail.timeline.elapsed", "Elapsed")
325
336
  })]
326
- }), /* @__PURE__ */ l("p", {
337
+ }), /* @__PURE__ */ p("p", {
327
338
  className: "mt-1 text-lg font-bold text-info",
328
- children: x("healthybowl.crops.planningDetail.timeline.days", "{{count}} days", { count: $ })
339
+ children: e("healthybowl.crops.planningDetail.timeline.days", "{{count}} days", { count: Ye })
329
340
  })]
330
- }), /* @__PURE__ */ u("div", {
341
+ }), /* @__PURE__ */ m("div", {
331
342
  className: "rounded-lg bg-warning/10 p-3",
332
- children: [/* @__PURE__ */ u("div", {
343
+ children: [/* @__PURE__ */ m("div", {
333
344
  className: "flex items-center gap-1.5",
334
- children: [/* @__PURE__ */ l(o, { className: "h-3.5 w-3.5 text-warning" }), /* @__PURE__ */ l("span", {
345
+ children: [/* @__PURE__ */ p(s, { className: "h-3.5 w-3.5 text-warning" }), /* @__PURE__ */ p("span", {
335
346
  className: "text-xs font-medium text-warning",
336
- children: x("healthybowl.crops.planningDetail.timeline.remaining", "Remaining")
347
+ children: e("healthybowl.crops.planningDetail.timeline.remaining", "Remaining")
337
348
  })]
338
- }), /* @__PURE__ */ l("p", {
349
+ }), /* @__PURE__ */ p("p", {
339
350
  className: "mt-1 text-lg font-bold text-warning",
340
- children: x("healthybowl.crops.planningDetail.timeline.days", "{{count}} days", { count: Ge })
351
+ children: e("healthybowl.crops.planningDetail.timeline.days", "{{count}} days", { count: Xe })
341
352
  })]
342
353
  })]
343
354
  })
344
355
  ]
345
356
  }),
346
- /* @__PURE__ */ u("div", {
357
+ /* @__PURE__ */ m("div", {
347
358
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
348
- children: [/* @__PURE__ */ u("h3", {
359
+ children: [/* @__PURE__ */ m("h3", {
349
360
  className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
350
361
  children: [
351
- /* @__PURE__ */ l(Ce, { className: "h-4 w-4 text-success" }),
362
+ /* @__PURE__ */ p(Te, { className: "h-4 w-4 text-success" }),
352
363
  " ",
353
- x("healthybowl.crops.planningDetail.production.title", "Production Details")
364
+ e("healthybowl.crops.planningDetail.production.title", "Production Details")
354
365
  ]
355
- }), /* @__PURE__ */ u("div", {
366
+ }), /* @__PURE__ */ m("div", {
356
367
  className: "grid grid-cols-1 gap-6 sm:grid-cols-2",
357
368
  children: [
358
- /* @__PURE__ */ u("div", {
369
+ /* @__PURE__ */ m("div", {
359
370
  className: "rounded-lg border border-border-subtle p-4",
360
- children: [/* @__PURE__ */ u("div", {
371
+ children: [/* @__PURE__ */ m("div", {
361
372
  className: "flex items-center gap-2",
362
- children: [/* @__PURE__ */ l("div", {
373
+ children: [/* @__PURE__ */ p("div", {
363
374
  className: "flex h-10 w-10 items-center justify-center rounded-lg bg-success-subtle",
364
- children: /* @__PURE__ */ l(Te, { className: "h-5 w-5 text-success" })
365
- }), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
375
+ children: /* @__PURE__ */ p(d, { className: "h-5 w-5 text-success" })
376
+ }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
366
377
  className: "text-xs text-text-secondary",
367
- children: x("healthybowl.crops.planningDetail.production.expectedYield", "Expected Yield")
368
- }), /* @__PURE__ */ u("p", {
378
+ children: e("healthybowl.crops.planningDetail.production.expectedYield", "Expected Yield")
379
+ }), /* @__PURE__ */ m("p", {
369
380
  className: "text-xl font-bold text-text-primary",
370
- children: [t(P.expectedYield), " kg"]
381
+ children: [n(L.expectedYield), " kg"]
371
382
  })] })]
372
- }), Z && /* @__PURE__ */ l("p", {
383
+ }), Q && /* @__PURE__ */ p("p", {
373
384
  className: "mt-2 text-xs text-text-secondary",
374
- children: x("healthybowl.crops.planningDetail.production.yieldPerUnit", "~{{amount}} kg per {{unit}}", {
375
- amount: Math.round(P.expectedYield / Z.area),
376
- unit: (Z.unit ?? "").replace(/s$/, "")
385
+ children: e("healthybowl.crops.planningDetail.production.yieldPerUnit", "~{{amount}} kg per {{unit}}", {
386
+ amount: Math.round(L.expectedYield / Q.area),
387
+ unit: (Q.unit ?? "").replace(/s$/, "")
377
388
  })
378
389
  })]
379
390
  }),
380
- /* @__PURE__ */ u("div", {
391
+ /* @__PURE__ */ m("div", {
381
392
  className: "rounded-lg border border-border-subtle p-4",
382
- children: [/* @__PURE__ */ u("div", {
393
+ children: [/* @__PURE__ */ m("div", {
383
394
  className: "flex items-center gap-2",
384
- children: [/* @__PURE__ */ l("div", {
395
+ children: [/* @__PURE__ */ p("div", {
385
396
  className: "flex h-10 w-10 items-center justify-center rounded-lg bg-info/10",
386
- children: /* @__PURE__ */ l(c, { className: "h-5 w-5 text-info" })
387
- }), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
397
+ children: /* @__PURE__ */ p(u, { className: "h-5 w-5 text-info" })
398
+ }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
388
399
  className: "text-xs text-text-secondary",
389
- children: x("healthybowl.crops.planningDetail.production.seedRequired", "Seed Required")
390
- }), /* @__PURE__ */ u("p", {
400
+ children: e("healthybowl.crops.planningDetail.production.seedRequired", "Seed Required")
401
+ }), /* @__PURE__ */ m("p", {
391
402
  className: "text-xl font-bold text-text-primary",
392
- children: [t(P.seedRequired), " kg"]
403
+ children: [n(L.seedRequired), " kg"]
393
404
  })] })]
394
- }), Z && /* @__PURE__ */ l("p", {
405
+ }), Q && /* @__PURE__ */ p("p", {
395
406
  className: "mt-2 text-xs text-text-secondary",
396
- children: x("healthybowl.crops.planningDetail.production.seedPerUnit", "~{{amount}} kg per {{unit}}", {
397
- amount: (P.seedRequired / Z.area).toFixed(1),
398
- unit: (Z.unit ?? "").replace(/s$/, "")
407
+ children: e("healthybowl.crops.planningDetail.production.seedPerUnit", "~{{amount}} kg per {{unit}}", {
408
+ amount: (L.seedRequired / Q.area).toFixed(1),
409
+ unit: (Q.unit ?? "").replace(/s$/, "")
399
410
  })
400
411
  })]
401
412
  }),
402
- (P.plantsNeeded != null || P.seedGrams != null || P.seedlingsToRaise != null) && /* @__PURE__ */ u("div", {
413
+ (L.plantsNeeded != null || L.seedGrams != null || L.seedlingsToRaise != null) && /* @__PURE__ */ m("div", {
403
414
  className: "rounded-lg border border-border-subtle p-4 sm:col-span-2",
404
415
  "data-testid": "planning-detail-seed-rate",
405
416
  children: [
406
- /* @__PURE__ */ l("p", {
417
+ /* @__PURE__ */ p("p", {
407
418
  className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
408
- children: x("healthybowl.crops.planningDetail.production.computedHeading", "Computed at planning")
419
+ children: e("healthybowl.crops.planningDetail.production.computedHeading", "Computed at planning")
409
420
  }),
410
- /* @__PURE__ */ u("div", {
421
+ /* @__PURE__ */ m("div", {
411
422
  className: "mt-3 grid grid-cols-3 gap-3",
412
423
  children: [
413
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
424
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
414
425
  className: "text-xs text-text-secondary",
415
- children: x("healthybowl.crops.planningDetail.production.plantsNeeded", "Plants needed")
416
- }), /* @__PURE__ */ l("p", {
426
+ children: e("healthybowl.crops.planningDetail.production.plantsNeeded", "Plants needed")
427
+ }), /* @__PURE__ */ p("p", {
417
428
  className: "text-lg font-bold text-text-primary",
418
- children: P.plantsNeeded == null ? "—" : t(P.plantsNeeded)
429
+ children: L.plantsNeeded == null ? "—" : n(L.plantsNeeded)
419
430
  })] }),
420
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
431
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
421
432
  className: "text-xs text-text-secondary",
422
- children: x("healthybowl.crops.planningDetail.production.seedGrams", "Seed (g)")
423
- }), /* @__PURE__ */ l("p", {
433
+ children: e("healthybowl.crops.planningDetail.production.seedGrams", "Seed (g)")
434
+ }), /* @__PURE__ */ p("p", {
424
435
  className: "text-lg font-bold text-text-primary",
425
- children: P.seedGrams == null ? "—" : P.seedGrams.toFixed(2)
436
+ children: L.seedGrams == null ? "—" : L.seedGrams.toFixed(2)
426
437
  })] }),
427
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
438
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
428
439
  className: "text-xs text-text-secondary",
429
- children: x("healthybowl.crops.planningDetail.production.seedlingsToRaise", "Seedlings to raise")
430
- }), /* @__PURE__ */ l("p", {
440
+ children: e("healthybowl.crops.planningDetail.production.seedlingsToRaise", "Seedlings to raise")
441
+ }), /* @__PURE__ */ p("p", {
431
442
  className: "text-lg font-bold text-text-primary",
432
- children: P.seedlingsToRaise == null ? "—" : t(P.seedlingsToRaise)
443
+ children: L.seedlingsToRaise == null ? "—" : n(L.seedlingsToRaise)
433
444
  })] })
434
445
  ]
435
446
  }),
436
- /* @__PURE__ */ l("p", {
447
+ /* @__PURE__ */ p("p", {
437
448
  className: "mt-3 text-xs text-text-secondary",
438
- children: x("healthybowl.crops.planningDetail.production.computedNote", "Recorded when the plan was created. Editing the plan does not recalculate these.")
449
+ children: e("healthybowl.crops.planningDetail.production.identitySnapshotNote", "Recorded at planning. Date or priority edits retain these figures; changing the crop or field may recalculate them.")
439
450
  })
440
451
  ]
441
452
  })
442
453
  ]
443
454
  })]
444
455
  }),
445
- /* @__PURE__ */ u("div", {
456
+ /* @__PURE__ */ m("div", {
446
457
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
447
- children: [/* @__PURE__ */ u("h3", {
458
+ children: [/* @__PURE__ */ m("h3", {
448
459
  className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
449
460
  children: [
450
- /* @__PURE__ */ l(a, { className: "h-4 w-4 text-primary" }),
461
+ /* @__PURE__ */ p(o, { className: "h-4 w-4 text-primary" }),
451
462
  " ",
452
- x("healthybowl.crops.planningDetail.fertilizers.title", "Fertilizers")
463
+ e("healthybowl.crops.planningDetail.fertilizers.title", "Fertilizers")
453
464
  ]
454
- }), P.fertilizers.length > 0 ? /* @__PURE__ */ l("div", {
465
+ }), L.fertilizers.length > 0 ? /* @__PURE__ */ p("div", {
455
466
  className: "flex flex-wrap gap-2",
456
- children: P.fertilizers.map((e) => /* @__PURE__ */ u("span", {
467
+ children: L.fertilizers.map((e) => /* @__PURE__ */ m("span", {
457
468
  className: "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle bg-bg-sunken/50 px-3 py-2 text-sm font-medium text-text-primary",
458
- children: [/* @__PURE__ */ l(a, { className: "h-3.5 w-3.5 text-primary" }), e]
469
+ children: [/* @__PURE__ */ p(o, { className: "h-3.5 w-3.5 text-primary" }), e]
459
470
  }, e))
460
- }) : /* @__PURE__ */ l("p", {
471
+ }) : /* @__PURE__ */ p("p", {
461
472
  className: "text-sm text-text-secondary",
462
- children: x("healthybowl.crops.planningDetail.fertilizers.empty", "No fertilizers specified.")
473
+ children: e("healthybowl.crops.planningDetail.fertilizers.empty", "No fertilizers specified.")
463
474
  })]
464
475
  })
465
476
  ]
466
- }), /* @__PURE__ */ u("div", {
477
+ }), /* @__PURE__ */ m("div", {
467
478
  className: "space-y-6",
468
479
  children: [
469
- /* @__PURE__ */ u("div", {
480
+ /* @__PURE__ */ m("div", {
470
481
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
471
482
  children: [
472
- /* @__PURE__ */ l("h3", {
483
+ /* @__PURE__ */ p("h3", {
473
484
  className: "mb-4 text-sm font-semibold text-text-primary",
474
- children: x("healthybowl.crops.planningDetail.statusCard.title", "Plan Status")
485
+ children: e("healthybowl.crops.planningDetail.statusCard.title", "Plan Status")
475
486
  }),
476
- /* @__PURE__ */ u("div", {
487
+ /* @__PURE__ */ m("div", {
477
488
  className: "space-y-3",
478
489
  children: [
479
- /* @__PURE__ */ u("div", {
490
+ /* @__PURE__ */ m("div", {
480
491
  className: "flex items-center justify-between",
481
- children: [/* @__PURE__ */ l("span", {
492
+ children: [/* @__PURE__ */ p("span", {
482
493
  className: "text-xs text-text-secondary",
483
- children: x("healthybowl.crops.planningDetail.statusCard.status", "Status")
484
- }), /* @__PURE__ */ l(r, {
485
- label: P.status,
486
- variant: _(P.status ?? "unknown")
494
+ children: e("healthybowl.crops.planningDetail.statusCard.status", "Status")
495
+ }), /* @__PURE__ */ p(i, {
496
+ label: L.status,
497
+ variant: x(L.status ?? "unknown")
487
498
  })]
488
499
  }),
489
- /* @__PURE__ */ u("div", {
500
+ /* @__PURE__ */ m("div", {
490
501
  className: "flex items-center justify-between",
491
- children: [/* @__PURE__ */ l("span", {
502
+ children: [/* @__PURE__ */ p("span", {
492
503
  className: "text-xs text-text-secondary",
493
- children: x("healthybowl.crops.planningDetail.statusCard.priority", "Priority")
494
- }), /* @__PURE__ */ l(r, {
495
- label: P.priority,
496
- variant: v(P.priority)
504
+ children: e("healthybowl.crops.planningDetail.statusCard.priority", "Priority")
505
+ }), /* @__PURE__ */ p(i, {
506
+ label: L.priority,
507
+ variant: S(L.priority)
497
508
  })]
498
509
  }),
499
- /* @__PURE__ */ u("div", {
510
+ /* @__PURE__ */ m("div", {
500
511
  className: "flex items-center justify-between",
501
- children: [/* @__PURE__ */ l("span", {
512
+ children: [/* @__PURE__ */ p("span", {
502
513
  className: "text-xs text-text-secondary",
503
- children: x("healthybowl.crops.planningDetail.statusCard.weatherRisk", "Weather Risk")
504
- }), /* @__PURE__ */ l(r, {
505
- label: P.weatherRisk,
506
- variant: y(P.weatherRisk)
514
+ children: e("healthybowl.crops.planningDetail.statusCard.weatherRisk", "Weather Risk")
515
+ }), /* @__PURE__ */ p(i, {
516
+ label: L.weatherRisk,
517
+ variant: C(L.weatherRisk)
507
518
  })]
508
519
  }),
509
- /* @__PURE__ */ u("div", {
520
+ /* @__PURE__ */ m("div", {
510
521
  className: "flex items-center justify-between",
511
- children: [/* @__PURE__ */ l("span", {
522
+ children: [/* @__PURE__ */ p("span", {
512
523
  className: "text-xs text-text-secondary",
513
- children: x("healthybowl.crops.planningDetail.statusCard.season", "Season")
514
- }), /* @__PURE__ */ l("span", {
524
+ children: e("healthybowl.crops.planningDetail.statusCard.season", "Season")
525
+ }), /* @__PURE__ */ p("span", {
515
526
  className: "text-xs font-medium capitalize text-text-primary",
516
- children: S(P.season)
527
+ children: E(L.season)
517
528
  })]
518
529
  })
519
530
  ]
520
531
  }),
521
- P.priority === "high" && /* @__PURE__ */ l("div", {
532
+ L.priority === "high" && /* @__PURE__ */ p("div", {
522
533
  className: "mt-4 rounded-lg bg-status-error-bg/10 p-3",
523
- children: /* @__PURE__ */ u("div", {
534
+ children: /* @__PURE__ */ m("div", {
524
535
  className: "flex items-start gap-2",
525
- children: [/* @__PURE__ */ l(ge, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-status-error-text" }), /* @__PURE__ */ l("p", {
536
+ children: [/* @__PURE__ */ p(ye, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-status-error-text" }), /* @__PURE__ */ p("p", {
526
537
  className: "text-xs text-status-error-text",
527
- children: x("healthybowl.crops.planningDetail.alerts.highPriority", "High priority plan. Ensure resources are allocated promptly.")
538
+ children: e("healthybowl.crops.planningDetail.alerts.highPriority", "High priority plan. Ensure resources are allocated promptly.")
528
539
  })]
529
540
  })
530
541
  }),
531
- P.weatherRisk === "high" && /* @__PURE__ */ l("div", {
542
+ L.weatherRisk === "high" && /* @__PURE__ */ p("div", {
532
543
  className: "mt-3 rounded-lg bg-warning/10 p-3",
533
- children: /* @__PURE__ */ u("div", {
544
+ children: /* @__PURE__ */ m("div", {
534
545
  className: "flex items-start gap-2",
535
- children: [/* @__PURE__ */ l(be, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-warning" }), /* @__PURE__ */ l("p", {
546
+ children: [/* @__PURE__ */ p(c, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-warning" }), /* @__PURE__ */ p("p", {
536
547
  className: "text-xs text-warning",
537
- children: x("healthybowl.crops.planningDetail.alerts.highWeatherRisk", "High weather risk. Monitor forecasts closely and prepare contingency plans.")
548
+ children: e("healthybowl.crops.planningDetail.alerts.highWeatherRisk", "High weather risk. Monitor forecasts closely and prepare contingency plans.")
538
549
  })]
539
550
  })
540
551
  })
541
552
  ]
542
553
  }),
543
- Z && /* @__PURE__ */ u("div", {
554
+ Q && /* @__PURE__ */ m("div", {
544
555
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
545
556
  children: [
546
- /* @__PURE__ */ l("h3", {
557
+ /* @__PURE__ */ p("h3", {
547
558
  className: "mb-4 text-sm font-semibold text-text-primary",
548
- children: x("healthybowl.crops.planningDetail.fieldCard.title", "Field Details")
559
+ children: e("healthybowl.crops.planningDetail.fieldCard.title", "Field Details")
549
560
  }),
550
- /* @__PURE__ */ u("div", {
561
+ /* @__PURE__ */ m("div", {
551
562
  className: "space-y-3",
552
563
  children: [
553
- /* @__PURE__ */ u("div", {
564
+ /* @__PURE__ */ m("div", {
554
565
  className: "flex items-center justify-between",
555
- children: [/* @__PURE__ */ l("span", {
566
+ children: [/* @__PURE__ */ p("span", {
556
567
  className: "text-xs text-text-secondary",
557
- children: x("healthybowl.crops.planningDetail.fieldCard.name", "Name")
558
- }), /* @__PURE__ */ l("span", {
568
+ children: e("healthybowl.crops.planningDetail.fieldCard.name", "Name")
569
+ }), /* @__PURE__ */ p("span", {
559
570
  className: "text-xs font-medium text-text-primary",
560
- children: Z.name
571
+ children: Q.name
561
572
  })]
562
573
  }),
563
- /* @__PURE__ */ u("div", {
574
+ /* @__PURE__ */ m("div", {
564
575
  className: "flex items-center justify-between",
565
- children: [/* @__PURE__ */ l("span", {
576
+ children: [/* @__PURE__ */ p("span", {
566
577
  className: "text-xs text-text-secondary",
567
- children: x("healthybowl.crops.planningDetail.fieldCard.area", "Area")
568
- }), /* @__PURE__ */ u("span", {
578
+ children: e("healthybowl.crops.planningDetail.fieldCard.area", "Area")
579
+ }), /* @__PURE__ */ m("span", {
569
580
  className: "text-xs font-medium text-text-primary",
570
581
  children: [
571
- Z.area,
582
+ Q.area,
572
583
  " ",
573
- Z.unit
584
+ Q.unit
574
585
  ]
575
586
  })]
576
587
  }),
577
- /* @__PURE__ */ u("div", {
588
+ /* @__PURE__ */ m("div", {
578
589
  className: "flex items-center justify-between",
579
- children: [/* @__PURE__ */ l("span", {
590
+ children: [/* @__PURE__ */ p("span", {
580
591
  className: "text-xs text-text-secondary",
581
- children: x("healthybowl.crops.planningDetail.fieldCard.soilType", "Soil Type")
582
- }), /* @__PURE__ */ l("span", {
592
+ children: e("healthybowl.crops.planningDetail.fieldCard.soilType", "Soil Type")
593
+ }), /* @__PURE__ */ p("span", {
583
594
  className: "text-xs font-medium text-text-primary",
584
- children: Z.soilType
595
+ children: Q.soilType
585
596
  })]
586
597
  }),
587
- /* @__PURE__ */ u("div", {
598
+ /* @__PURE__ */ m("div", {
588
599
  className: "flex items-center justify-between",
589
- children: [/* @__PURE__ */ l("span", {
600
+ children: [/* @__PURE__ */ p("span", {
590
601
  className: "text-xs text-text-secondary",
591
- children: x("healthybowl.crops.planningDetail.fieldCard.irrigation", "Irrigation")
592
- }), /* @__PURE__ */ l("span", {
602
+ children: e("healthybowl.crops.planningDetail.fieldCard.irrigation", "Irrigation")
603
+ }), /* @__PURE__ */ p("span", {
593
604
  className: "text-xs font-medium text-text-primary",
594
- children: Z.irrigationType
605
+ children: Q.irrigationType
595
606
  })]
596
607
  }),
597
- /* @__PURE__ */ u("div", {
608
+ /* @__PURE__ */ m("div", {
598
609
  className: "flex items-center justify-between",
599
- children: [/* @__PURE__ */ l("span", {
610
+ children: [/* @__PURE__ */ p("span", {
600
611
  className: "text-xs text-text-secondary",
601
- children: x("healthybowl.crops.planningDetail.fieldCard.status", "Status")
602
- }), /* @__PURE__ */ l(r, {
603
- label: Z.status,
604
- variant: Z.status === "active" ? "success" : "muted"
612
+ children: e("healthybowl.crops.planningDetail.fieldCard.status", "Status")
613
+ }), /* @__PURE__ */ p(i, {
614
+ label: Q.status,
615
+ variant: Q.status === "active" ? "success" : "muted"
605
616
  })]
606
617
  })
607
618
  ]
608
619
  }),
609
- /* @__PURE__ */ u(d, {
620
+ /* @__PURE__ */ m(h, {
610
621
  variant: "outline",
611
- onClick: () => O(k(`crops/fields/${Z.id}`)),
622
+ onClick: () => A(j(`crops/fields/${Q.id}`)),
612
623
  className: "mt-4 w-full",
613
624
  children: [
614
- /* @__PURE__ */ l(s, { className: "h-4 w-4 text-text-secondary" }),
625
+ /* @__PURE__ */ p(l, { className: "h-4 w-4 text-text-secondary" }),
615
626
  " ",
616
- x("healthybowl.crops.planningDetail.fieldCard.viewField", "View Field")
627
+ e("healthybowl.crops.planningDetail.fieldCard.viewField", "View Field")
617
628
  ]
618
629
  })
619
630
  ]
620
631
  }),
621
- /* @__PURE__ */ u("div", {
632
+ /* @__PURE__ */ m("div", {
622
633
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
623
- children: [/* @__PURE__ */ l("h3", {
634
+ children: [/* @__PURE__ */ p("h3", {
624
635
  className: "mb-4 text-sm font-semibold text-text-primary",
625
- children: x("healthybowl.crops.planningDetail.quickActions.title", "Quick Actions")
626
- }), /* @__PURE__ */ u("div", {
636
+ children: e("healthybowl.crops.planningDetail.quickActions.title", "Quick Actions")
637
+ }), /* @__PURE__ */ m("div", {
627
638
  className: "space-y-2",
628
639
  children: [
629
- /* @__PURE__ */ u(d, {
640
+ /* @__PURE__ */ m(h, {
630
641
  variant: "outline",
631
- onClick: () => O(k("weather")),
642
+ onClick: () => A(j("weather")),
632
643
  className: "w-full justify-start",
633
644
  children: [
634
- /* @__PURE__ */ l(be, { className: "h-4 w-4 text-text-secondary" }),
645
+ /* @__PURE__ */ p(c, { className: "h-4 w-4 text-text-secondary" }),
635
646
  " ",
636
- x("healthybowl.crops.planningDetail.quickActions.checkWeather", "Check Weather")
647
+ e("healthybowl.crops.planningDetail.quickActions.checkWeather", "Check Weather")
637
648
  ]
638
649
  }),
639
- /* @__PURE__ */ u(d, {
650
+ /* @__PURE__ */ m(h, {
640
651
  variant: "outline",
641
- onClick: () => O(k("crops")),
652
+ onClick: () => A(j("crops")),
642
653
  className: "w-full justify-start",
643
654
  children: [
644
- /* @__PURE__ */ l(c, { className: "h-4 w-4 text-text-secondary" }),
655
+ /* @__PURE__ */ p(u, { className: "h-4 w-4 text-text-secondary" }),
645
656
  " ",
646
- x("healthybowl.crops.planningDetail.quickActions.allCrops", "All Crops")
657
+ e("healthybowl.crops.planningDetail.quickActions.allCrops", "All Crops")
647
658
  ]
648
659
  }),
649
- /* @__PURE__ */ u(d, {
660
+ /* @__PURE__ */ m(h, {
650
661
  variant: "outline",
651
- onClick: () => O(k("crops/planning")),
662
+ onClick: () => A(j("crops/planning")),
652
663
  className: "w-full justify-start",
653
664
  children: [
654
- /* @__PURE__ */ l(ye, { className: "h-4 w-4 text-text-secondary" }),
665
+ /* @__PURE__ */ p(Se, { className: "h-4 w-4 text-text-secondary" }),
655
666
  " ",
656
- x("healthybowl.crops.planningDetail.quickActions.allPlans", "All Plans")
667
+ e("healthybowl.crops.planningDetail.quickActions.allPlans", "All Plans")
657
668
  ]
658
669
  }),
659
- /* @__PURE__ */ u(d, {
670
+ /* @__PURE__ */ m(h, {
660
671
  variant: "outline",
661
- onClick: () => O(k("analytics")),
672
+ onClick: () => A(j("analytics")),
662
673
  className: "w-full justify-start",
663
674
  children: [
664
- /* @__PURE__ */ l(Te, { className: "h-4 w-4 text-text-secondary" }),
675
+ /* @__PURE__ */ p(d, { className: "h-4 w-4 text-text-secondary" }),
665
676
  " ",
666
- x("healthybowl.crops.planningDetail.quickActions.analytics", "Analytics")
677
+ e("healthybowl.crops.planningDetail.quickActions.analytics", "Analytics")
667
678
  ]
668
679
  })
669
680
  ]
@@ -672,193 +683,193 @@ var _ = (e) => {
672
683
  ]
673
684
  })]
674
685
  }),
675
- /* @__PURE__ */ l(pe, {
676
- plan: P,
677
- crops: T,
678
- onCropChanged: E
686
+ /* @__PURE__ */ p(_e, {
687
+ plan: L,
688
+ crops: O,
689
+ onCropChanged: k
679
690
  }),
680
- /* @__PURE__ */ l(se, {
681
- open: Le,
682
- onClose: () => j(!1),
683
- title: x("healthybowl.crops.planningDetail.editModal.title", "Edit Plan - {{crop}}", { crop: P.cropName }),
684
- description: x("healthybowl.crops.planningDetail.editModal.description", "Update planting plan details"),
691
+ /* @__PURE__ */ p(le, {
692
+ open: N,
693
+ onClose: () => P(!1),
694
+ title: e("healthybowl.crops.planningDetail.editModal.title", "Edit Plan - {{crop}}", { crop: L.cropName }),
695
+ description: e("healthybowl.crops.planningDetail.editModal.description", "Update planting plan details"),
685
696
  size: "lg",
686
- footer: /* @__PURE__ */ u(Oe, { children: [/* @__PURE__ */ l(d, {
697
+ footer: /* @__PURE__ */ m(Oe, { children: [/* @__PURE__ */ p(h, {
687
698
  variant: "outline",
688
- onClick: () => j(!1),
689
- children: x("healthybowl.common.cancel", "Cancel")
690
- }), /* @__PURE__ */ l(d, {
699
+ onClick: () => P(!1),
700
+ children: e("healthybowl.common.cancel", "Cancel")
701
+ }), /* @__PURE__ */ p(h, {
691
702
  onClick: async () => {
692
- if (!P) return;
693
- if (!F) {
694
- A({
695
- title: x("healthybowl.crops.planningDetail.toast.missingFields.title", "Missing required fields"),
696
- description: x("healthybowl.crops.planningDetail.toast.missingFields.description", "Crop is required."),
697
- variant: "warning"
698
- });
699
- return;
700
- }
701
- let e = T.find((e) => e.id === F);
702
- N(!0);
703
- try {
704
- await Ne({
705
- id: P.id,
706
- cropId: F,
707
- fieldId: L || void 0,
708
- startDate: z || void 0,
709
- endDate: V || void 0,
710
- expectedYield: U ? Number(U) : void 0,
711
- seedRequired: G ? Number(G) : void 0,
712
- priority: q,
713
- status: Y
714
- }), A({
715
- title: x("healthybowl.crops.planningDetail.toast.updated.title", "Plan updated"),
716
- description: x("healthybowl.crops.planningDetail.toast.updated.description", "{{crop}} plan has been saved.", { crop: e?.name ?? P.cropName }),
717
- variant: "success"
718
- }), j(!1);
719
- } catch (e) {
720
- A({
721
- title: x("healthybowl.crops.planningDetail.toast.updateFailed.title", "Update failed"),
722
- description: String(e),
723
- variant: "error"
724
- });
725
- } finally {
726
- N(!1);
703
+ if (L) {
704
+ I(!0);
705
+ try {
706
+ await Ne(he(L, Re, {
707
+ cropId: R,
708
+ fieldId: B,
709
+ startDate: H,
710
+ endDate: W,
711
+ expectedYield: K,
712
+ seedRequired: J,
713
+ priority: X,
714
+ status: He
715
+ })), M({
716
+ title: e("healthybowl.crops.planningDetail.toast.updated.title", "Plan updated"),
717
+ description: e("healthybowl.crops.planningDetail.toast.updated.description", "{{crop}} plan has been saved.", { crop: Be?.name ?? L.cropName }),
718
+ variant: "success"
719
+ }), P(!1);
720
+ } catch (t) {
721
+ M({
722
+ title: e("healthybowl.crops.planningDetail.toast.updateFailed.title", "Update failed"),
723
+ description: String(t),
724
+ variant: "error"
725
+ });
726
+ } finally {
727
+ I(!1);
728
+ }
727
729
  }
728
730
  },
729
- disabled: M,
730
- children: M ? x("healthybowl.crops.planningDetail.editModal.saving", "Saving...") : x("healthybowl.crops.planningDetail.editModal.save", "Save Changes")
731
+ disabled: F,
732
+ children: F ? e("healthybowl.crops.planningDetail.editModal.saving", "Saving...") : e("healthybowl.crops.planningDetail.editModal.save", "Save Changes")
731
733
  })] }),
732
- children: /* @__PURE__ */ u("div", {
734
+ children: /* @__PURE__ */ m("div", {
733
735
  className: "grid gap-4 sm:grid-cols-2",
734
736
  children: [
735
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
737
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
738
+ htmlFor: "plan-edit-crop",
736
739
  className: "text-sm font-medium text-text-primary",
737
- children: x("healthybowl.crops.planningDetail.form.cropName", "Crop Name")
738
- }), /* @__PURE__ */ u(f, {
739
- value: F,
740
- onValueChange: I,
741
- children: [/* @__PURE__ */ l(h, {
742
- className: "mt-1 w-full",
743
- children: /* @__PURE__ */ l(g, {})
744
- }), /* @__PURE__ */ l(p, { children: T.map((e) => /* @__PURE__ */ l(m, {
745
- value: e.id,
746
- children: e.variety ? `${e.name} - ${e.variety}` : e.name
747
- }, e.id)) })]
740
+ children: e("healthybowl.crops.planningDetail.form.cropName", "Crop Name")
741
+ }), /* @__PURE__ */ p(ne, {
742
+ id: "plan-edit-crop",
743
+ value: R,
744
+ onValueChange: z,
745
+ options: O,
746
+ recordedLabel: R === L.cropId ? `${L.cropName} — recorded crop ID ${R}` : void 0,
747
+ skip: !N,
748
+ disabled: F,
749
+ className: "mt-1"
748
750
  })] }),
749
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
751
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
750
752
  className: "text-sm font-medium text-text-primary",
751
- children: x("healthybowl.crops.planningDetail.form.field", "Field")
752
- }), /* @__PURE__ */ u(f, {
753
- value: L,
754
- onValueChange: R,
755
- children: [/* @__PURE__ */ l(h, {
753
+ children: e("healthybowl.crops.planningDetail.form.field", "Field")
754
+ }), /* @__PURE__ */ m(g, {
755
+ value: B,
756
+ onValueChange: V,
757
+ children: [/* @__PURE__ */ p(y, {
756
758
  className: "mt-1 w-full",
757
- children: /* @__PURE__ */ l(g, {})
758
- }), /* @__PURE__ */ l(p, { children: w.map((e) => /* @__PURE__ */ l(m, {
759
+ children: /* @__PURE__ */ p(b, {})
760
+ }), /* @__PURE__ */ m(_, { children: [B && !D.some((e) => e.id === B) && /* @__PURE__ */ m(v, {
761
+ value: B,
762
+ disabled: !0,
763
+ children: [
764
+ L.fieldName,
765
+ " — recorded field ID ",
766
+ B,
767
+ " (unavailable)"
768
+ ]
769
+ }), D.map((e) => /* @__PURE__ */ p(v, {
759
770
  value: e.id,
760
771
  children: e.name
761
- }, e.id)) })]
772
+ }, e.id))] })]
762
773
  })] }),
763
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
774
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
764
775
  className: "text-sm font-medium text-text-primary",
765
- children: x("healthybowl.crops.planningDetail.form.startDate", "Start Date")
766
- }), /* @__PURE__ */ l("input", {
776
+ children: e("healthybowl.crops.planningDetail.form.startDate", "Start Date")
777
+ }), /* @__PURE__ */ p("input", {
767
778
  type: "date",
768
- value: z,
769
- onChange: (e) => B(e.target.value),
779
+ value: H,
780
+ onChange: (e) => U(e.target.value),
770
781
  className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
771
782
  })] }),
772
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
783
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
773
784
  className: "text-sm font-medium text-text-primary",
774
- children: x("healthybowl.crops.planningDetail.form.endDate", "End Date")
775
- }), /* @__PURE__ */ l("input", {
785
+ children: e("healthybowl.crops.planningDetail.form.endDate", "End Date")
786
+ }), /* @__PURE__ */ p("input", {
776
787
  type: "date",
777
- value: V,
778
- onChange: (e) => H(e.target.value),
788
+ value: W,
789
+ onChange: (e) => G(e.target.value),
779
790
  className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
780
791
  })] }),
781
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
792
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
782
793
  className: "text-sm font-medium text-text-primary",
783
- children: x("healthybowl.crops.planningDetail.form.expectedYield", "Expected Yield (kg)")
784
- }), /* @__PURE__ */ l("input", {
794
+ children: e("healthybowl.crops.planningDetail.form.expectedYield", "Expected Yield (kg)")
795
+ }), /* @__PURE__ */ p("input", {
785
796
  type: "number",
786
- value: U,
787
- onChange: (e) => W(e.target.value),
797
+ value: K,
798
+ onChange: (e) => q(e.target.value),
788
799
  className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
789
800
  })] }),
790
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
801
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
791
802
  className: "text-sm font-medium text-text-primary",
792
- children: x("healthybowl.crops.planningDetail.form.seedRequired", "Seed Required (kg)")
793
- }), /* @__PURE__ */ l("input", {
803
+ children: e("healthybowl.crops.planningDetail.form.seedRequired", "Seed Required (kg)")
804
+ }), /* @__PURE__ */ p("input", {
794
805
  type: "number",
795
- value: G,
796
- onChange: (e) => K(e.target.value),
806
+ value: J,
807
+ onChange: (e) => Y(e.target.value),
797
808
  className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
798
809
  })] }),
799
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
810
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
800
811
  className: "text-sm font-medium text-text-primary",
801
- children: x("healthybowl.crops.planningDetail.form.priority", "Priority")
802
- }), /* @__PURE__ */ u(f, {
803
- value: q,
804
- onValueChange: (e) => J(e),
805
- children: [/* @__PURE__ */ l(h, {
812
+ children: e("healthybowl.crops.planningDetail.form.priority", "Priority")
813
+ }), /* @__PURE__ */ m(g, {
814
+ value: X,
815
+ onValueChange: (e) => Ve(e),
816
+ children: [/* @__PURE__ */ p(y, {
806
817
  className: "mt-1 w-full",
807
- children: /* @__PURE__ */ l(g, {})
808
- }), /* @__PURE__ */ u(p, { children: [
809
- /* @__PURE__ */ l(m, {
818
+ children: /* @__PURE__ */ p(b, {})
819
+ }), /* @__PURE__ */ m(_, { children: [
820
+ /* @__PURE__ */ p(v, {
810
821
  value: "low",
811
- children: x("healthybowl.crops.planningDetail.priorityOptions.low", "Low")
822
+ children: e("healthybowl.crops.planningDetail.priorityOptions.low", "Low")
812
823
  }),
813
- /* @__PURE__ */ l(m, {
824
+ /* @__PURE__ */ p(v, {
814
825
  value: "medium",
815
- children: x("healthybowl.crops.planningDetail.priorityOptions.medium", "Medium")
826
+ children: e("healthybowl.crops.planningDetail.priorityOptions.medium", "Medium")
816
827
  }),
817
- /* @__PURE__ */ l(m, {
828
+ /* @__PURE__ */ p(v, {
818
829
  value: "high",
819
- children: x("healthybowl.crops.planningDetail.priorityOptions.high", "High")
830
+ children: e("healthybowl.crops.planningDetail.priorityOptions.high", "High")
820
831
  })
821
832
  ] })]
822
833
  })] }),
823
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
834
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
824
835
  className: "text-sm font-medium text-text-primary",
825
- children: x("healthybowl.crops.planningDetail.form.status", "Status")
826
- }), /* @__PURE__ */ u(f, {
827
- value: Y,
828
- onValueChange: (e) => X(e),
829
- children: [/* @__PURE__ */ l(h, {
836
+ children: e("healthybowl.crops.planningDetail.form.status", "Status")
837
+ }), /* @__PURE__ */ m(g, {
838
+ value: He,
839
+ onValueChange: (e) => Ue(e),
840
+ children: [/* @__PURE__ */ p(y, {
830
841
  className: "mt-1 w-full",
831
- children: /* @__PURE__ */ l(g, {})
832
- }), /* @__PURE__ */ u(p, { children: [
833
- /* @__PURE__ */ l(m, {
842
+ children: /* @__PURE__ */ p(b, {})
843
+ }), /* @__PURE__ */ m(_, { children: [
844
+ /* @__PURE__ */ p(v, {
834
845
  value: "draft",
835
- children: x("healthybowl.crops.planningDetail.statusOptions.draft", "Draft")
846
+ children: e("healthybowl.crops.planningDetail.statusOptions.draft", "Draft")
836
847
  }),
837
- /* @__PURE__ */ l(m, {
848
+ /* @__PURE__ */ p(v, {
838
849
  value: "approved",
839
- children: x("healthybowl.crops.planningDetail.statusOptions.approved", "Approved")
850
+ children: e("healthybowl.crops.planningDetail.statusOptions.approved", "Approved")
840
851
  }),
841
- /* @__PURE__ */ l(m, {
852
+ /* @__PURE__ */ p(v, {
842
853
  value: "active",
843
- children: x("healthybowl.crops.planningDetail.statusOptions.active", "Active")
854
+ children: e("healthybowl.crops.planningDetail.statusOptions.active", "Active")
844
855
  }),
845
- /* @__PURE__ */ l(m, {
856
+ /* @__PURE__ */ p(v, {
846
857
  value: "completed",
847
- children: x("healthybowl.crops.planningDetail.statusOptions.completed", "Completed")
858
+ children: e("healthybowl.crops.planningDetail.statusOptions.completed", "Completed")
848
859
  })
849
860
  ] })]
850
861
  })] })
851
862
  ]
852
863
  })
853
864
  }),
854
- /* @__PURE__ */ l(re, {
855
- toasts: Fe,
856
- onDismiss: Ie
865
+ /* @__PURE__ */ p(ae, {
866
+ toasts: Ie,
867
+ onDismiss: Le
857
868
  })
858
869
  ]
859
870
  });
860
871
  };
861
872
  //#endregion
862
- export { x as PlanningDetailsPage };
873
+ export { T as PlanningDetailsPage };
863
874
 
864
875
  //# sourceMappingURL=PlanningDetailsPage.js.map