@burdenoff/microfe-healthybowl 2026.904.21 → 2026.904.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/assistant/AssistantChatArea.js +7 -9
- package/dist/components/assistant/AssistantChatArea.js.map +1 -1
- package/dist/healthybowl/HealthyBowlRoot.js +56 -57
- package/dist/healthybowl/HealthyBowlRoot.js.map +1 -1
- package/dist/healthybowl/HealthyBowlRoutes.js +36 -48
- package/dist/healthybowl/HealthyBowlRoutes.js.map +1 -1
- package/dist/healthybowl/components/CreateFarmTaskButton.js.map +1 -1
- package/dist/healthybowl/components/PageLayout.js +10 -11
- package/dist/healthybowl/components/PageLayout.js.map +1 -1
- package/dist/healthybowl/context/HealthyBowlContext.js +7 -7
- package/dist/healthybowl/context/HealthyBowlContext.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlCompliance.js +141 -157
- package/dist/healthybowl/hooks/useHealthyBowlCompliance.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlData.js +0 -18
- package/dist/healthybowl/hooks/useHealthyBowlData.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlDistribution.js +37 -52
- package/dist/healthybowl/hooks/useHealthyBowlDistribution.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlLivestockDepth.js +78 -135
- package/dist/healthybowl/hooks/useHealthyBowlLivestockDepth.js.map +1 -1
- package/dist/healthybowl/hooks/useIrrigationAutomation.js +1 -1
- package/dist/healthybowl/hooks/useIrrigationAutomation.js.map +1 -1
- package/dist/healthybowl/hooks/useSuccessionPlanning.js +1 -1
- package/dist/healthybowl/hooks/useSuccessionPlanning.js.map +1 -1
- package/dist/healthybowl/hooks/useWeatherIntelligence.js +1 -1
- package/dist/healthybowl/hooks/useWeatherIntelligence.js.map +1 -1
- package/dist/healthybowl/offline/OfflineStatusPill.js +21 -40
- package/dist/healthybowl/offline/OfflineStatusPill.js.map +1 -1
- package/dist/healthybowl/offline/OfflineSyncProvider.js +130 -153
- package/dist/healthybowl/offline/OfflineSyncProvider.js.map +1 -1
- package/dist/healthybowl/offline/graphql.js.map +1 -1
- package/dist/healthybowl/offline/store.js +1 -1
- package/dist/healthybowl/offline/syncEngine.js +1 -2
- package/dist/healthybowl/offline/syncEngine.js.map +1 -1
- package/dist/healthybowl/offline/types.js.map +1 -1
- package/dist/healthybowl/pages/GettingStartedPage.js +0 -1
- package/dist/healthybowl/pages/GettingStartedPage.js.map +1 -1
- package/dist/healthybowl/pages/analytics/InsightsPage.js +2 -2
- package/dist/healthybowl/pages/analytics/InsightsPage.js.map +1 -1
- package/dist/healthybowl/pages/analytics/ReportsPage.js +99 -136
- package/dist/healthybowl/pages/analytics/ReportsPage.js.map +1 -1
- package/dist/healthybowl/pages/compliance/ComplianceOverviewPage.js +162 -204
- package/dist/healthybowl/pages/compliance/ComplianceOverviewPage.js.map +1 -1
- package/dist/healthybowl/pages/compliance/IcsGroupDetailPage.js +178 -196
- package/dist/healthybowl/pages/compliance/IcsGroupDetailPage.js.map +1 -1
- package/dist/healthybowl/pages/compliance/IcsGrowerDetailPage.js +141 -142
- package/dist/healthybowl/pages/compliance/IcsGrowerDetailPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropFieldsPage.js +0 -2
- package/dist/healthybowl/pages/crops/CropFieldsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropHarvestPage.js +272 -316
- package/dist/healthybowl/pages/crops/CropHarvestPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropPlanningPage.js +0 -6
- package/dist/healthybowl/pages/crops/CropPlanningPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js +846 -871
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/HarvestDetailsPage.js +334 -376
- package/dist/healthybowl/pages/crops/HarvestDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/distribution/CsaPlanDetailPage.js +188 -415
- package/dist/healthybowl/pages/distribution/CsaPlanDetailPage.js.map +1 -1
- package/dist/healthybowl/pages/distribution/labels.js +2 -10
- package/dist/healthybowl/pages/distribution/labels.js.map +1 -1
- package/dist/healthybowl/pages/farm/FarmProfilePage.js +0 -1
- package/dist/healthybowl/pages/farm/FarmProfilePage.js.map +1 -1
- package/dist/healthybowl/pages/field-capture/CaptureObservationForm.js +8 -8
- package/dist/healthybowl/pages/fields/FieldMapPage.js +0 -2
- package/dist/healthybowl/pages/fields/FieldMapPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/FinancialReportsPage.js +107 -92
- package/dist/healthybowl/pages/financial/FinancialReportsPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js +188 -228
- package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/SchemeDetailsPage.js +191 -261
- package/dist/healthybowl/pages/government-schemes/SchemeDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/inputs-insurance/InputsInsuranceOverviewPage.js +14 -14
- package/dist/healthybowl/pages/inputs-insurance/InputsInsuranceOverviewPage.js.map +1 -1
- package/dist/healthybowl/pages/irrigation/IrrigationPage.js +307 -338
- package/dist/healthybowl/pages/irrigation/IrrigationPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/AnimalDepthFormModal.js +102 -126
- package/dist/healthybowl/pages/livestock/AnimalDepthFormModal.js.map +1 -1
- package/dist/healthybowl/pages/livestock/AnimalDepthPage.js +215 -257
- package/dist/healthybowl/pages/livestock/AnimalDepthPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/GrazingPage.js +0 -1
- package/dist/healthybowl/pages/livestock/GrazingPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/HerdDepthPage.js +0 -4
- package/dist/healthybowl/pages/livestock/HerdDepthPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/grazing/RecordGrazingMoveModal.js +9 -8
- package/dist/healthybowl/pages/livestock/grazing/RecordGrazingMoveModal.js.map +1 -1
- package/dist/healthybowl/pages/network/ExpertsPage.js +419 -520
- package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
- package/dist/healthybowl/pages/weather/WeatherAlertHistoryPage.js +130 -129
- package/dist/healthybowl/pages/weather/WeatherAlertHistoryPage.js.map +1 -1
- package/dist/healthybowl/pages/weather/WeatherSettingsPage.js +237 -285
- package/dist/healthybowl/pages/weather/WeatherSettingsPage.js.map +1 -1
- package/dist/healthybowl/utils/plantingCapacity.js +10 -10
- package/dist/healthybowl/utils/plantingCapacity.js.map +1 -1
- package/dist/node_modules/fast-equals/dist/es/index.js +86 -74
- package/dist/node_modules/fast-equals/dist/es/index.js.map +1 -1
- package/dist/services/assistantApi.js +30 -59
- package/dist/services/assistantApi.js.map +1 -1
- package/dist/utils/pageContext.js +1 -15
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +1 -1
- package/dist/healthybowl/hooks/useAgronomyDecisions.js +0 -79
- package/dist/healthybowl/hooks/useAgronomyDecisions.js.map +0 -1
- package/dist/healthybowl/hooks/useAnalyticsReports.js +0 -173
- package/dist/healthybowl/hooks/useAnalyticsReports.js.map +0 -1
- package/dist/healthybowl/hooks/useComplianceExports.js +0 -74
- package/dist/healthybowl/hooks/useComplianceExports.js.map +0 -1
- package/dist/healthybowl/hooks/useConsultationPayments.js +0 -59
- package/dist/healthybowl/hooks/useConsultationPayments.js.map +0 -1
- package/dist/healthybowl/hooks/usePlantingEstimate.js +0 -88
- package/dist/healthybowl/hooks/usePlantingEstimate.js.map +0 -1
- package/dist/healthybowl/offline/HeaderOfflinePill.js +0 -28
- package/dist/healthybowl/offline/HeaderOfflinePill.js.map +0 -1
- package/dist/healthybowl/offline/captureCache.js +0 -30
- package/dist/healthybowl/offline/captureCache.js.map +0 -1
- package/dist/healthybowl/offline/headerSlot.js +0 -24
- package/dist/healthybowl/offline/headerSlot.js.map +0 -1
- package/dist/healthybowl/pages/ai/AiDecisionsPage.js +0 -287
- package/dist/healthybowl/pages/ai/AiDecisionsPage.js.map +0 -1
- package/dist/healthybowl/pages/compliance/ResidueTestsPage.js +0 -291
- package/dist/healthybowl/pages/compliance/ResidueTestsPage.js.map +0 -1
- package/dist/healthybowl/pages/compliance/SubstanceRulesPage.js +0 -300
- package/dist/healthybowl/pages/compliance/SubstanceRulesPage.js.map +0 -1
- package/dist/healthybowl/pages/compliance/substanceRuleForm.js +0 -135
- package/dist/healthybowl/pages/compliance/substanceRuleForm.js.map +0 -1
- package/dist/healthybowl/pages/government-schemes/schemeApplicationTransitions.js +0 -49
- package/dist/healthybowl/pages/government-schemes/schemeApplicationTransitions.js.map +0 -1
- package/dist/healthybowl/pages/government-schemes/schemeDocumentSlots.js +0 -48
- package/dist/healthybowl/pages/government-schemes/schemeDocumentSlots.js.map +0 -1
- package/dist/healthybowl/pages/government-schemes/useSchemeApplicationTransition.js +0 -54
- package/dist/healthybowl/pages/government-schemes/useSchemeApplicationTransition.js.map +0 -1
- package/dist/healthybowl/pages/livestock/PedigreeTree.js +0 -154
- package/dist/healthybowl/pages/livestock/PedigreeTree.js.map +0 -1
- package/dist/healthybowl/pages/livestock/eidTagInput.js +0 -39
- package/dist/healthybowl/pages/livestock/eidTagInput.js.map +0 -1
- package/dist/healthybowl/pages/livestock/pedigreeLayout.js +0 -68
- package/dist/healthybowl/pages/livestock/pedigreeLayout.js.map +0 -1
- package/dist/healthybowl/pages/weather/alertDelivery.js +0 -105
- package/dist/healthybowl/pages/weather/alertDelivery.js.map +0 -1
- package/dist/healthybowl/utils/icsInspection.js +0 -18
- package/dist/healthybowl/utils/icsInspection.js.map +0 -1
|
@@ -4,19 +4,18 @@ import { EmptyState as r } from "../../components/EmptyState.js";
|
|
|
4
4
|
import { ErrorState as i } from "../../components/ErrorState.js";
|
|
5
5
|
import { ChartCard as a } from "../../components/ChartCard.js";
|
|
6
6
|
import { ToastContainer as o } from "../../components/Toast.js";
|
|
7
|
-
import { LoadingSkeleton as
|
|
8
|
-
import { useToast as
|
|
7
|
+
import { LoadingSkeleton as s } from "../../components/LoadingSkeleton.js";
|
|
8
|
+
import { useToast as c } from "../../hooks/useToast.js";
|
|
9
9
|
import "../../components/index.js";
|
|
10
|
-
import { useHealthyBowlData as
|
|
11
|
-
import { Legend as
|
|
12
|
-
import { Tooltip as
|
|
13
|
-
import { ResponsiveContainer as
|
|
14
|
-
import { CartesianGrid as
|
|
15
|
-
import { Line as
|
|
16
|
-
import { XAxis as
|
|
17
|
-
import { YAxis as
|
|
18
|
-
import { LineChart as
|
|
19
|
-
import { reportPeriodOptions as g, useAnalyticsReports as _ } from "../../hooks/useAnalyticsReports.js";
|
|
10
|
+
import { useHealthyBowlData as l } from "../../hooks/useHealthyBowlData.js";
|
|
11
|
+
import { Legend as u } from "../../../node_modules/recharts/es6/component/Legend.js";
|
|
12
|
+
import { Tooltip as d } from "../../../node_modules/recharts/es6/component/Tooltip.js";
|
|
13
|
+
import { ResponsiveContainer as f } from "../../../node_modules/recharts/es6/component/ResponsiveContainer.js";
|
|
14
|
+
import { CartesianGrid as p } from "../../../node_modules/recharts/es6/cartesian/CartesianGrid.js";
|
|
15
|
+
import { Line as m } from "../../../node_modules/recharts/es6/cartesian/Line.js";
|
|
16
|
+
import { XAxis as h } from "../../../node_modules/recharts/es6/cartesian/XAxis.js";
|
|
17
|
+
import { YAxis as g } from "../../../node_modules/recharts/es6/cartesian/YAxis.js";
|
|
18
|
+
import { LineChart as _ } from "../../../node_modules/recharts/es6/chart/LineChart.js";
|
|
20
19
|
import { useState as v } from "react";
|
|
21
20
|
import { useI18n as y } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
22
21
|
import { BarChart3 as b, Clock as x, FileDown as S, FileText as C, PieChart as w, TrendingUp as T, Wallet as E } from "lucide-react";
|
|
@@ -29,7 +28,7 @@ var F = {
|
|
|
29
28
|
budget: E,
|
|
30
29
|
tax: C
|
|
31
30
|
}, I = () => {
|
|
32
|
-
let { t: b } = y(), { transactions: C, invoices: T, revenueChartData: E, loading: I, errors: L
|
|
31
|
+
let { t: b } = y(), { transactions: C, invoices: T, revenueChartData: E, loading: I, errors: L } = l(), R = [
|
|
33
32
|
{
|
|
34
33
|
id: "rpt-pl",
|
|
35
34
|
title: b("healthybowl.financial.reports.types.pl.title", "Profit & Loss Statement"),
|
|
@@ -60,7 +59,12 @@ var F = {
|
|
|
60
59
|
description: b("healthybowl.financial.reports.types.receivableAging.description", "Outstanding invoices grouped by aging buckets"),
|
|
61
60
|
category: "cashflow"
|
|
62
61
|
}
|
|
63
|
-
],
|
|
62
|
+
], z = {
|
|
63
|
+
pl: b("healthybowl.financial.reports.categories.pl", "Profit & Loss"),
|
|
64
|
+
cashflow: b("healthybowl.financial.reports.categories.cashflow", "Cash Flow"),
|
|
65
|
+
budget: b("healthybowl.financial.reports.categories.budget", "Budget vs Actual"),
|
|
66
|
+
tax: b("healthybowl.financial.reports.categories.tax", "Tax Summary")
|
|
67
|
+
}, { toasts: B, toast: V, dismiss: H } = c(), [U, W] = v("pl"), [G, K] = v("Q1 2025"), [q, J] = v("pdf"), Y = C.filter((e) => e.type === "income").reduce((e, t) => e + t.amount, 0), X = C.filter((e) => e.type === "expense").reduce((e, t) => e + t.amount, 0), Z = Y - X, Q = T.filter((e) => e.status === "sent" || e.status === "overdue").reduce((e, t) => e + t.total, 0), $ = [
|
|
64
68
|
{
|
|
65
69
|
id: "grossRevenue",
|
|
66
70
|
label: b("healthybowl.financial.reports.metrics.grossRevenue", "Gross Revenue"),
|
|
@@ -79,58 +83,27 @@ var F = {
|
|
|
79
83
|
{
|
|
80
84
|
id: "accountsReceivable",
|
|
81
85
|
label: b("healthybowl.financial.reports.metrics.accountsReceivable", "Accounts Receivable"),
|
|
82
|
-
value:
|
|
86
|
+
value: Q
|
|
83
87
|
}
|
|
84
|
-
],
|
|
85
|
-
|
|
86
|
-
V(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
});
|
|
95
|
-
if (!i.started) {
|
|
96
|
-
t = !1;
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
if (!i.ok) {
|
|
100
|
-
G({
|
|
101
|
-
title: b("healthybowl.financial.reports.toast.generateFailed.title", "Could not generate the report"),
|
|
102
|
-
description: i.message,
|
|
103
|
-
variant: "error"
|
|
104
|
-
});
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
await R().catch(() => void 0), G({
|
|
108
|
-
title: b("healthybowl.financial.reports.toast.generated.title", "Report ready"),
|
|
109
|
-
description: b("healthybowl.financial.reports.toast.generated.description", "\"{{title}}\" ({{period}}) is ready under Analytics → Reports.", {
|
|
110
|
-
title: e,
|
|
111
|
-
period: b(r?.labelKey ?? "", r?.labelFallback ?? "")
|
|
112
|
-
}),
|
|
113
|
-
variant: "success"
|
|
114
|
-
});
|
|
115
|
-
} finally {
|
|
116
|
-
t && V(!1);
|
|
117
|
-
}
|
|
118
|
-
}, re = async (e) => {
|
|
119
|
-
await $(U.find((t) => t.id === e)?.title ?? b("healthybowl.financial.reports.toast.fallbackReport", "Financial report"));
|
|
120
|
-
}, ie = (e) => {
|
|
121
|
-
let t = [["Metric", "Value"], ...Q.map((e) => [e.label, String((e.value ?? 0).toFixed(2))])].map((e) => e.map((e) => `"${e}"`).join(",")).join("\n"), n = new Blob([t], { type: "text/csv" }), r = URL.createObjectURL(n), i = document.createElement("a");
|
|
122
|
-
i.href = r, i.download = `${(e.title ?? "").replace(/\s+/g, "_")}.csv`, i.click(), URL.revokeObjectURL(r), G({
|
|
88
|
+
], ee = (e) => {
|
|
89
|
+
let t = R.find((t) => t.id === e);
|
|
90
|
+
V({
|
|
91
|
+
title: b("healthybowl.financial.reports.toast.generateUnavailable.title", "Report generation is not available yet"),
|
|
92
|
+
description: b("healthybowl.financial.reports.toast.generateUnavailable.description", "{{report}} cannot be generated yet. You can still download already-available reports as CSV.", { report: t?.title ?? b("healthybowl.financial.reports.toast.generateUnavailable.fallbackReport", "This report") }),
|
|
93
|
+
variant: "warning"
|
|
94
|
+
});
|
|
95
|
+
}, te = (e) => {
|
|
96
|
+
let t = [["Metric", "Value"], ...$.map((e) => [e.label, String((e.value ?? 0).toFixed(2))])].map((e) => e.map((e) => `"${e}"`).join(",")).join("\n"), n = new Blob([t], { type: "text/csv" }), r = URL.createObjectURL(n), i = document.createElement("a");
|
|
97
|
+
i.href = r, i.download = `${(e.title ?? "").replace(/\s+/g, "_")}.csv`, i.click(), URL.revokeObjectURL(r), V({
|
|
123
98
|
title: b("healthybowl.financial.reports.toast.downloaded.title", "Downloaded as CSV"),
|
|
124
99
|
description: e.title,
|
|
125
100
|
variant: "success"
|
|
126
101
|
});
|
|
127
|
-
}, ae = async () => {
|
|
128
|
-
await $(b("healthybowl.financial.reports.customTitle", "Custom financial report"));
|
|
129
102
|
};
|
|
130
103
|
return I && C.length === 0 && T.length === 0 && E.length === 0 ? /* @__PURE__ */ D(n, {
|
|
131
104
|
title: b("healthybowl.financial.reports.title", "Financial Reports"),
|
|
132
105
|
description: b("healthybowl.financial.reports.description", "Generate, download, and schedule financial reports"),
|
|
133
|
-
children: /* @__PURE__ */ D(
|
|
106
|
+
children: /* @__PURE__ */ D(s, {
|
|
134
107
|
variant: "card",
|
|
135
108
|
count: 4
|
|
136
109
|
})
|
|
@@ -148,50 +121,93 @@ var F = {
|
|
|
148
121
|
}),
|
|
149
122
|
/* @__PURE__ */ D("p", {
|
|
150
123
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
151
|
-
children: b("healthybowl.financial.reports.generate.subtitle", "
|
|
124
|
+
children: b("healthybowl.financial.reports.generate.subtitle", "Select report type, period, and format to generate a custom report")
|
|
152
125
|
}),
|
|
153
126
|
/* @__PURE__ */ O("div", {
|
|
154
127
|
className: "mt-4 flex flex-wrap items-end gap-3",
|
|
155
128
|
children: [
|
|
156
|
-
/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("
|
|
129
|
+
/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("label", {
|
|
157
130
|
className: "mb-1 block text-xs font-medium text-text-secondary",
|
|
158
131
|
children: b("healthybowl.financial.reports.generate.fields.reportType.label", "Report Type")
|
|
159
|
-
}), /* @__PURE__ */
|
|
160
|
-
|
|
161
|
-
|
|
132
|
+
}), /* @__PURE__ */ O(A, {
|
|
133
|
+
value: U,
|
|
134
|
+
onValueChange: (e) => W(e),
|
|
135
|
+
children: [/* @__PURE__ */ D(N, {
|
|
136
|
+
className: "h-9 w-auto",
|
|
137
|
+
children: /* @__PURE__ */ D(P, {})
|
|
138
|
+
}), /* @__PURE__ */ D(j, { children: Object.entries(z).map(([e, t]) => /* @__PURE__ */ D(M, {
|
|
139
|
+
value: e,
|
|
140
|
+
children: t
|
|
141
|
+
}, e)) })]
|
|
162
142
|
})] }),
|
|
163
143
|
/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("label", {
|
|
164
144
|
className: "mb-1 block text-xs font-medium text-text-secondary",
|
|
165
145
|
children: b("healthybowl.financial.reports.generate.fields.period.label", "Period")
|
|
166
146
|
}), /* @__PURE__ */ O(A, {
|
|
167
|
-
value:
|
|
168
|
-
onValueChange:
|
|
147
|
+
value: G,
|
|
148
|
+
onValueChange: K,
|
|
169
149
|
children: [/* @__PURE__ */ D(N, {
|
|
170
150
|
className: "h-9 w-auto",
|
|
171
151
|
children: /* @__PURE__ */ D(P, {})
|
|
172
|
-
}), /* @__PURE__ */
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
152
|
+
}), /* @__PURE__ */ O(j, { children: [
|
|
153
|
+
/* @__PURE__ */ D(M, {
|
|
154
|
+
value: "Q1 2025",
|
|
155
|
+
children: b("healthybowl.financial.reports.generate.periods.q1_2025", "Q1 2025")
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ D(M, {
|
|
158
|
+
value: "Q4 2024",
|
|
159
|
+
children: b("healthybowl.financial.reports.generate.periods.q4_2024", "Q4 2024")
|
|
160
|
+
}),
|
|
161
|
+
/* @__PURE__ */ D(M, {
|
|
162
|
+
value: "March 2025",
|
|
163
|
+
children: b("healthybowl.financial.reports.generate.periods.march_2025", "March 2025")
|
|
164
|
+
}),
|
|
165
|
+
/* @__PURE__ */ D(M, {
|
|
166
|
+
value: "FY 2024-25",
|
|
167
|
+
children: b("healthybowl.financial.reports.generate.periods.fy_2024_25", "FY 2024-25")
|
|
168
|
+
})
|
|
169
|
+
] })]
|
|
176
170
|
})] }),
|
|
177
|
-
/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("
|
|
171
|
+
/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("label", {
|
|
178
172
|
className: "mb-1 block text-xs font-medium text-text-secondary",
|
|
179
173
|
children: b("healthybowl.financial.reports.generate.fields.format.label", "Format")
|
|
180
|
-
}), /* @__PURE__ */
|
|
181
|
-
|
|
182
|
-
|
|
174
|
+
}), /* @__PURE__ */ O(A, {
|
|
175
|
+
value: q,
|
|
176
|
+
onValueChange: (e) => J(e),
|
|
177
|
+
children: [/* @__PURE__ */ D(N, {
|
|
178
|
+
className: "h-9 w-auto",
|
|
179
|
+
children: /* @__PURE__ */ D(P, {})
|
|
180
|
+
}), /* @__PURE__ */ O(j, { children: [
|
|
181
|
+
/* @__PURE__ */ D(M, {
|
|
182
|
+
value: "pdf",
|
|
183
|
+
children: b("healthybowl.financial.reports.generate.formats.pdf", "PDF")
|
|
184
|
+
}),
|
|
185
|
+
/* @__PURE__ */ D(M, {
|
|
186
|
+
value: "csv",
|
|
187
|
+
children: b("healthybowl.financial.reports.generate.formats.csv", "CSV")
|
|
188
|
+
}),
|
|
189
|
+
/* @__PURE__ */ D(M, {
|
|
190
|
+
value: "excel",
|
|
191
|
+
children: b("healthybowl.financial.reports.generate.formats.excel", "Excel")
|
|
192
|
+
})
|
|
193
|
+
] })]
|
|
183
194
|
})] }),
|
|
184
195
|
/* @__PURE__ */ O(k, {
|
|
185
|
-
onClick: () =>
|
|
186
|
-
|
|
196
|
+
onClick: () => {
|
|
197
|
+
V({
|
|
198
|
+
title: b("healthybowl.financial.reports.toast.generateUnavailable.title", "Report generation is not available yet"),
|
|
199
|
+
description: b("healthybowl.financial.reports.toast.customUnavailable.description", "Custom report generation has no backend yet — nothing was queued. Use Download CSV for available data."),
|
|
200
|
+
variant: "warning"
|
|
201
|
+
});
|
|
202
|
+
},
|
|
187
203
|
children: [/* @__PURE__ */ D(S, { className: "h-4 w-4" }), b("healthybowl.financial.reports.generate.actions.generate", "Generate")]
|
|
188
204
|
}),
|
|
189
205
|
/* @__PURE__ */ O(k, {
|
|
190
206
|
variant: "outline",
|
|
191
207
|
onClick: () => {
|
|
192
|
-
|
|
208
|
+
V({
|
|
193
209
|
title: b("healthybowl.financial.reports.toast.scheduleUnavailable.title", "Report scheduling is not available yet"),
|
|
194
|
-
description: b("healthybowl.financial.reports.toast.scheduleUnavailable.description", "Scheduled reports have no backend yet — nothing was scheduled.
|
|
210
|
+
description: b("healthybowl.financial.reports.toast.scheduleUnavailable.description", "Scheduled reports have no backend yet — nothing was scheduled."),
|
|
195
211
|
variant: "warning"
|
|
196
212
|
});
|
|
197
213
|
},
|
|
@@ -208,10 +224,10 @@ var F = {
|
|
|
208
224
|
illustration: "empty-data",
|
|
209
225
|
title: b("healthybowl.financial.reports.revenueTrend.empty.title", "No revenue data yet"),
|
|
210
226
|
description: b("healthybowl.financial.reports.revenueTrend.empty.description", "Revenue and expense trends will appear here once financial activity is recorded.")
|
|
211
|
-
}) : /* @__PURE__ */ D(
|
|
227
|
+
}) : /* @__PURE__ */ D(f, {
|
|
212
228
|
width: "100%",
|
|
213
229
|
height: 260,
|
|
214
|
-
children: /* @__PURE__ */ O(
|
|
230
|
+
children: /* @__PURE__ */ O(_, {
|
|
215
231
|
data: E,
|
|
216
232
|
margin: {
|
|
217
233
|
top: 5,
|
|
@@ -220,21 +236,21 @@ var F = {
|
|
|
220
236
|
bottom: 5
|
|
221
237
|
},
|
|
222
238
|
children: [
|
|
223
|
-
/* @__PURE__ */ D(
|
|
239
|
+
/* @__PURE__ */ D(p, {
|
|
224
240
|
strokeDasharray: "3 3",
|
|
225
241
|
className: "stroke-border"
|
|
226
242
|
}),
|
|
227
|
-
/* @__PURE__ */ D(
|
|
243
|
+
/* @__PURE__ */ D(h, {
|
|
228
244
|
dataKey: "month",
|
|
229
245
|
className: "text-xs",
|
|
230
246
|
tick: { fill: "currentColor" }
|
|
231
247
|
}),
|
|
232
|
-
/* @__PURE__ */ D(
|
|
248
|
+
/* @__PURE__ */ D(g, {
|
|
233
249
|
className: "text-xs",
|
|
234
250
|
tick: { fill: "currentColor" },
|
|
235
251
|
tickFormatter: (t) => e(t, "INR")
|
|
236
252
|
}),
|
|
237
|
-
/* @__PURE__ */ D(
|
|
253
|
+
/* @__PURE__ */ D(d, {
|
|
238
254
|
formatter: (e) => t(e, "INR"),
|
|
239
255
|
contentStyle: {
|
|
240
256
|
backgroundColor: "var(--color-card)",
|
|
@@ -243,8 +259,8 @@ var F = {
|
|
|
243
259
|
},
|
|
244
260
|
labelStyle: { color: "var(--color-foreground)" }
|
|
245
261
|
}),
|
|
246
|
-
/* @__PURE__ */ D(
|
|
247
|
-
/* @__PURE__ */ D(
|
|
262
|
+
/* @__PURE__ */ D(u, {}),
|
|
263
|
+
/* @__PURE__ */ D(m, {
|
|
248
264
|
type: "monotone",
|
|
249
265
|
dataKey: "revenue",
|
|
250
266
|
name: b("healthybowl.financial.reports.revenueTrend.series.revenue", "Revenue"),
|
|
@@ -256,7 +272,7 @@ var F = {
|
|
|
256
272
|
},
|
|
257
273
|
activeDot: { r: 6 }
|
|
258
274
|
}),
|
|
259
|
-
/* @__PURE__ */ D(
|
|
275
|
+
/* @__PURE__ */ D(m, {
|
|
260
276
|
type: "monotone",
|
|
261
277
|
dataKey: "expenses",
|
|
262
278
|
name: b("healthybowl.financial.reports.revenueTrend.series.expenses", "Expenses"),
|
|
@@ -286,7 +302,7 @@ var F = {
|
|
|
286
302
|
description: b("healthybowl.financial.reports.metrics.empty.description", "Key metrics will appear here once transactions and invoices are recorded.")
|
|
287
303
|
}) : /* @__PURE__ */ D("div", {
|
|
288
304
|
className: "mt-4 grid grid-cols-2 gap-4 sm:grid-cols-4",
|
|
289
|
-
children:
|
|
305
|
+
children: $.map((e) => /* @__PURE__ */ O("div", {
|
|
290
306
|
className: "rounded-md bg-bg-sunken/50 p-3 text-center",
|
|
291
307
|
children: [/* @__PURE__ */ D("p", {
|
|
292
308
|
className: "text-xs text-text-secondary",
|
|
@@ -303,7 +319,7 @@ var F = {
|
|
|
303
319
|
children: b("healthybowl.financial.reports.available.heading", "Available Reports")
|
|
304
320
|
}), /* @__PURE__ */ D("div", {
|
|
305
321
|
className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
306
|
-
children:
|
|
322
|
+
children: R.map((e) => {
|
|
307
323
|
let t = F[e.category];
|
|
308
324
|
return /* @__PURE__ */ O("div", {
|
|
309
325
|
className: "flex flex-col rounded-lg border border-border-subtle bg-bg-surface p-5",
|
|
@@ -327,12 +343,11 @@ var F = {
|
|
|
327
343
|
children: [/* @__PURE__ */ O(k, {
|
|
328
344
|
variant: "outline",
|
|
329
345
|
size: "sm",
|
|
330
|
-
onClick: () =>
|
|
346
|
+
onClick: () => te(e),
|
|
331
347
|
children: [/* @__PURE__ */ D(S, { className: "h-3.5 w-3.5" }), b("healthybowl.financial.reports.available.actions.downloadCsv", "Download CSV")]
|
|
332
348
|
}), /* @__PURE__ */ D(k, {
|
|
333
349
|
size: "sm",
|
|
334
|
-
onClick: () =>
|
|
335
|
-
disabled: B,
|
|
350
|
+
onClick: () => ee(e.id),
|
|
336
351
|
children: b("healthybowl.financial.reports.available.actions.generate", "Generate")
|
|
337
352
|
})]
|
|
338
353
|
})]
|
|
@@ -340,8 +355,8 @@ var F = {
|
|
|
340
355
|
})
|
|
341
356
|
})] }),
|
|
342
357
|
/* @__PURE__ */ D(o, {
|
|
343
|
-
toasts:
|
|
344
|
-
onDismiss:
|
|
358
|
+
toasts: B,
|
|
359
|
+
onDismiss: H
|
|
345
360
|
})
|
|
346
361
|
]
|
|
347
362
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FinancialReportsPage.js","names":[],"sources":["../../../../src/healthybowl/pages/financial/FinancialReportsPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { BarChart3, FileDown, FileText, TrendingUp, Wallet, Clock, PieChart as PieChartIcon } from 'lucide-react';\nimport { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend } from 'recharts';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Button, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@burdenoff/fe-libs/ui';\nimport { PageLayout, ChartCard, LoadingSkeleton, EmptyState, ErrorState } from '../../components';\nimport { ToastContainer } from '../../components/Toast';\nimport { useToast } from '../../hooks/useToast';\nimport { useHealthyBowlData } from '../../hooks/useHealthyBowlData';\nimport { reportPeriodOptions, useAnalyticsReports } from '../../hooks/useAnalyticsReports';\nimport { formatCurrency, formatCompactCurrency, HB_DEFAULT_CURRENCY } from '../../utils/helpers';\n\ntype ReportCategory = 'pl' | 'cashflow' | 'budget' | 'tax';\n\ninterface ReportType {\n id: string;\n title: string;\n description: string;\n category: ReportCategory;\n}\n\nconst categoryIcons: Record<ReportCategory, typeof TrendingUp> = {\n pl: TrendingUp,\n cashflow: BarChart3,\n budget: Wallet,\n tax: FileText,\n};\n\nexport const FinancialReportsPage = () => {\n const { t } = useI18n();\n const { transactions, invoices, revenueChartData, loading, errors, refetch } = useHealthyBowlData();\n const { generate } = useAnalyticsReports();\n // Same reason as ReportsPage: the hook's flag clears at the mutation, not at the end of the flow.\n const [submitting, setSubmitting] = useState(false);\n // Derived from the current render date; the submission path recomputes again to stay correct if\n // this screen has been open across a day, quarter, or year boundary.\n const periodOptions = reportPeriodOptions(new Date());\n\n // Templates provide a quick CSV of current financial metrics and a real generated financial PDF.\n // No fabricated \"last generated\" dates or fixed periods — those would imply runs that never happened.\n const reportTypes: ReportType[] = [\n {\n id: 'rpt-pl',\n title: t('healthybowl.financial.reports.types.pl.title', 'Profit & Loss Statement'),\n description: t('healthybowl.financial.reports.types.pl.description', 'Revenue, expenses, and net income summary'),\n category: 'pl',\n },\n {\n id: 'rpt-cf',\n title: t('healthybowl.financial.reports.types.cashflow.title', 'Cash Flow Report'),\n description: t(\n 'healthybowl.financial.reports.types.cashflow.description',\n 'Cash inflows, outflows, and closing balance'\n ),\n category: 'cashflow',\n },\n {\n id: 'rpt-ba',\n title: t('healthybowl.financial.reports.types.budget.title', 'Budget vs Actual'),\n description: t(\n 'healthybowl.financial.reports.types.budget.description',\n 'Budget allocation vs actual spending by category'\n ),\n category: 'budget',\n },\n {\n id: 'rpt-tax',\n title: t('healthybowl.financial.reports.types.tax.title', 'Tax Summary'),\n description: t(\n 'healthybowl.financial.reports.types.tax.description',\n 'Tax collected, paid, and outstanding for the period'\n ),\n category: 'tax',\n },\n {\n id: 'rpt-ar',\n title: t('healthybowl.financial.reports.types.receivableAging.title', 'Accounts Receivable Aging'),\n description: t(\n 'healthybowl.financial.reports.types.receivableAging.description',\n 'Outstanding invoices grouped by aging buckets'\n ),\n category: 'cashflow',\n },\n ];\n\n const { toasts, toast, dismiss } = useToast();\n const [selectedPeriod, setSelectedPeriod] = useState('ytd');\n\n const totalRevenue = transactions.filter((t) => t.type === 'income').reduce((s, t) => s + t.amount, 0);\n const totalExpenses = transactions.filter((t) => t.type === 'expense').reduce((s, t) => s + t.amount, 0);\n const netIncome = totalRevenue - totalExpenses;\n const accountsReceivable = invoices\n .filter((i) => i.status === 'sent' || i.status === 'overdue')\n .reduce((s, i) => s + i.total, 0);\n\n // Only metrics with a real data source. Cash-on-hand and tax-liability were dropped — they were\n // synthesized from arbitrary multipliers (netIncome*0.775, revenue*0.0736), not real balances/tax.\n // No period-over-period deltas: these are all-time totals with no comparable prior period here.\n const financialMetrics = [\n {\n id: 'grossRevenue',\n label: t('healthybowl.financial.reports.metrics.grossRevenue', 'Gross Revenue'),\n value: totalRevenue,\n },\n {\n id: 'operatingExpenses',\n label: t('healthybowl.financial.reports.metrics.operatingExpenses', 'Operating Expenses'),\n value: totalExpenses,\n },\n { id: 'netIncome', label: t('healthybowl.financial.reports.metrics.netIncome', 'Net Income'), value: netIncome },\n {\n id: 'accountsReceivable',\n label: t('healthybowl.financial.reports.metrics.accountsReceivable', 'Accounts Receivable'),\n value: accountsReceivable,\n },\n ];\n\n // BOFF-6022 — a real generator replaces the \"not available yet\" toast. Everything here is a\n // financial report, so the type is fixed; the analytics Reports page owns the type choice.\n const generateFinancialReport = async (title: string) => {\n if (submitting) return;\n setSubmitting(true);\n // The hook rejects a same-tick duplicate before React has rendered this button disabled. That\n // ignored invocation must not clear the lock owned by the request that actually started.\n let releaseSubmissionLock = true;\n try {\n // Compute at submission too: a page left open across midnight must not generate yesterday's\n // year-to-date or previous-quarter range.\n const currentPeriodOptions = reportPeriodOptions(new Date());\n const period = currentPeriodOptions.find((o) => o.value === selectedPeriod) ?? currentPeriodOptions[0];\n const result = await generate({\n title,\n type: 'FINANCIAL',\n startDate: period?.startDate,\n endDate: period?.endDate,\n });\n if (!result.started) {\n releaseSubmissionLock = false;\n return;\n }\n if (!result.ok) {\n toast({\n title: t('healthybowl.financial.reports.toast.generateFailed.title', 'Could not generate the report'),\n description: result.message,\n variant: 'error',\n });\n return;\n }\n // The report is already persisted. A transient read failure must not suppress the success\n // toast or leak an unhandled rejection that invites the farmer to submit it again.\n await refetch().catch(() => undefined);\n toast({\n title: t('healthybowl.financial.reports.toast.generated.title', 'Report ready'),\n description: t(\n 'healthybowl.financial.reports.toast.generated.description',\n '\"{{title}}\" ({{period}}) is ready under Analytics → Reports.',\n { title, period: t(period?.labelKey ?? '', period?.labelFallback ?? '') }\n ),\n variant: 'success',\n });\n } finally {\n if (releaseSubmissionLock) setSubmitting(false);\n }\n };\n\n const handleGenerate = async (id: string) => {\n const report = reportTypes.find((r) => r.id === id);\n await generateFinancialReport(\n report?.title ?? t('healthybowl.financial.reports.toast.fallbackReport', 'Financial report')\n );\n };\n\n const handleDownload = (report: ReportType) => {\n const headers = ['Metric', 'Value'];\n const rows = financialMetrics.map((m) => [m.label, String((m.value ?? 0).toFixed(2))]);\n const csv = [headers, ...rows].map((r) => r.map((c) => `\"${c}\"`).join(',')).join('\\n');\n const blob = new Blob([csv], { type: 'text/csv' });\n const url = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.href = url;\n a.download = `${(report.title ?? '').replace(/\\s+/g, '_')}.csv`;\n a.click();\n URL.revokeObjectURL(url);\n toast({\n title: t('healthybowl.financial.reports.toast.downloaded.title', 'Downloaded as CSV'),\n description: report.title,\n variant: 'success',\n });\n };\n\n const handleGenerateCustom = async () => {\n await generateFinancialReport(t('healthybowl.financial.reports.customTitle', 'Custom financial report'));\n };\n\n // Left honest on purpose. Scheduling needs a cron this service does not have, and the ticket's\n // build order puts it after \"there is something worth scheduling\" — which this PR only just\n // makes true. Replacing this toast with a button that silently does nothing would be worse than\n // the toast.\n const handleScheduleReport = () => {\n toast({\n title: t(\n 'healthybowl.financial.reports.toast.scheduleUnavailable.title',\n 'Report scheduling is not available yet'\n ),\n description: t(\n 'healthybowl.financial.reports.toast.scheduleUnavailable.description',\n 'Scheduled reports have no backend yet — nothing was scheduled. You can generate a report now instead.'\n ),\n variant: 'warning',\n });\n };\n\n // While the first load is still in flight and nothing has arrived yet, show skeletons in place\n // of the metric/chart body so the page never flashes zeros/blank/NaN sections.\n if (loading && transactions.length === 0 && invoices.length === 0 && revenueChartData.length === 0) {\n return (\n <PageLayout\n title={t('healthybowl.financial.reports.title', 'Financial Reports')}\n description={t(\n 'healthybowl.financial.reports.description',\n 'Generate, download, and schedule financial reports'\n )}\n >\n <LoadingSkeleton variant=\"card\" count={4} />\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title={t('healthybowl.financial.reports.title', 'Financial Reports')}\n description={t('healthybowl.financial.reports.description', 'Generate, download, and schedule financial reports')}\n purpose=\"Produce the financial statements you need for tax, loans or your own books — and schedule them to arrive automatically. Hand these to your accountant or lender as proof of how the farm is doing.\"\n >\n {/* Report Generation Section */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.financial.reports.generate.heading', 'Generate Report')}\n </h3>\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n {t('healthybowl.financial.reports.generate.subtitle', 'Generate a financial PDF for the selected period')}\n </p>\n <div className=\"mt-4 flex flex-wrap items-end gap-3\">\n <div>\n <span className=\"mb-1 block text-xs font-medium text-text-secondary\">\n {t('healthybowl.financial.reports.generate.fields.reportType.label', 'Report Type')}\n </span>\n <p className=\"h-9 rounded-md border border-border-subtle bg-bg-sunken px-3 py-2 text-sm text-text-primary\">\n {t('healthybowl.financial.reports.generate.types.financial', 'Financial')}\n </p>\n </div>\n <div>\n <label className=\"mb-1 block text-xs font-medium text-text-secondary\">\n {t('healthybowl.financial.reports.generate.fields.period.label', 'Period')}\n </label>\n <Select value={selectedPeriod} onValueChange={setSelectedPeriod}>\n <SelectTrigger className=\"h-9 w-auto\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {periodOptions.map((option) => (\n <SelectItem key={option.value} value={option.value}>\n {t(option.labelKey, option.labelFallback)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div>\n <span className=\"mb-1 block text-xs font-medium text-text-secondary\">\n {t('healthybowl.financial.reports.generate.fields.format.label', 'Format')}\n </span>\n <p className=\"h-9 rounded-md border border-border-subtle bg-bg-sunken px-3 py-2 text-sm text-text-primary\">\n {t('healthybowl.financial.reports.generate.formats.pdf', 'PDF')}\n </p>\n </div>\n <Button onClick={() => void handleGenerateCustom()} disabled={submitting}>\n <FileDown className=\"h-4 w-4\" />\n {t('healthybowl.financial.reports.generate.actions.generate', 'Generate')}\n </Button>\n <Button variant=\"outline\" onClick={handleScheduleReport}>\n <Clock className=\"h-4 w-4\" />\n {t('healthybowl.financial.reports.generate.actions.schedule', 'Schedule')}\n </Button>\n </div>\n </div>\n\n {/* Revenue Trend Chart */}\n <ChartCard\n title={t('healthybowl.financial.reports.revenueTrend.title', 'Revenue Trend')}\n description={t('healthybowl.financial.reports.revenueTrend.description', 'Monthly revenue over last 6 months')}\n >\n {revenueChartData.length === 0 ? (\n errors.financial ? (\n <ErrorState />\n ) : (\n <EmptyState\n illustration=\"empty-data\"\n title={t('healthybowl.financial.reports.revenueTrend.empty.title', 'No revenue data yet')}\n description={t(\n 'healthybowl.financial.reports.revenueTrend.empty.description',\n 'Revenue and expense trends will appear here once financial activity is recorded.'\n )}\n />\n )\n ) : (\n <ResponsiveContainer width=\"100%\" height={260}>\n <LineChart data={revenueChartData} margin={{ top: 5, right: 20, left: 0, bottom: 5 }}>\n <CartesianGrid strokeDasharray=\"3 3\" className=\"stroke-border\" />\n <XAxis dataKey=\"month\" className=\"text-xs\" tick={{ fill: 'currentColor' }} />\n <YAxis\n className=\"text-xs\"\n tick={{ fill: 'currentColor' }}\n tickFormatter={(v: number) => formatCompactCurrency(v, HB_DEFAULT_CURRENCY)}\n />\n <Tooltip\n formatter={(value: number) => formatCurrency(value, HB_DEFAULT_CURRENCY)}\n contentStyle={{\n backgroundColor: 'var(--color-card)',\n border: '1px solid var(--color-border)',\n borderRadius: '8px',\n }}\n labelStyle={{ color: 'var(--color-foreground)' }}\n />\n <Legend />\n <Line\n type=\"monotone\"\n dataKey=\"revenue\"\n name={t('healthybowl.financial.reports.revenueTrend.series.revenue', 'Revenue')}\n stroke=\"var(--color-success)\"\n strokeWidth={2}\n dot={{ r: 4, fill: 'var(--color-success)' }}\n activeDot={{ r: 6 }}\n />\n <Line\n type=\"monotone\"\n dataKey=\"expenses\"\n name={t('healthybowl.financial.reports.revenueTrend.series.expenses', 'Expenses')}\n stroke=\"var(--color-destructive)\"\n strokeWidth={2}\n dot={{ r: 4, fill: 'var(--color-destructive)' }}\n activeDot={{ r: 6 }}\n />\n </LineChart>\n </ResponsiveContainer>\n )}\n </ChartCard>\n\n {/* Key Financial Metrics */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <div className=\"flex items-center gap-2\">\n <PieChartIcon className=\"h-4 w-4 text-text-secondary\" />\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.financial.reports.metrics.heading', 'Key Financial Metrics')}\n </h3>\n </div>\n {transactions.length === 0 && invoices.length === 0 ? (\n errors.financial ? (\n <ErrorState />\n ) : (\n <EmptyState\n illustration=\"empty-data\"\n title={t('healthybowl.financial.reports.metrics.empty.title', 'No financial data yet')}\n description={t(\n 'healthybowl.financial.reports.metrics.empty.description',\n 'Key metrics will appear here once transactions and invoices are recorded.'\n )}\n />\n )\n ) : (\n <div className=\"mt-4 grid grid-cols-2 gap-4 sm:grid-cols-4\">\n {financialMetrics.map((metric) => (\n <div key={metric.id} className=\"rounded-md bg-bg-sunken/50 p-3 text-center\">\n <p className=\"text-xs text-text-secondary\">{metric.label}</p>\n <p className=\"mt-1 text-lg font-bold text-text-primary\">\n {formatCurrency(metric.value, HB_DEFAULT_CURRENCY)}\n </p>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {/* Pre-built Report Cards */}\n <div>\n <h3 className=\"mb-3 text-sm font-semibold text-text-primary\">\n {t('healthybowl.financial.reports.available.heading', 'Available Reports')}\n </h3>\n <div className=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {reportTypes.map((report) => {\n const Icon = categoryIcons[report.category];\n\n return (\n <div key={report.id} className=\"flex flex-col rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <div className=\"flex items-start gap-3\">\n <div className=\"rounded-md bg-bg-sunken p-2\">\n <Icon className=\"h-5 w-5 text-text-secondary\" />\n </div>\n <div className=\"flex-1\">\n <h4 className=\"text-sm font-semibold text-text-primary\">{report.title}</h4>\n <p className=\"mt-0.5 text-xs text-text-secondary\">{report.description}</p>\n </div>\n </div>\n\n <div className=\"mt-auto flex items-center justify-end gap-2 pt-4\">\n {/* Download is a real CSV of the current metrics; full report generation is honestly disabled. */}\n <Button variant=\"outline\" size=\"sm\" onClick={() => handleDownload(report)}>\n <FileDown className=\"h-3.5 w-3.5\" />\n {t('healthybowl.financial.reports.available.actions.downloadCsv', 'Download CSV')}\n </Button>\n <Button size=\"sm\" onClick={() => void handleGenerate(report.id)} disabled={submitting}>\n {t('healthybowl.financial.reports.available.actions.generate', 'Generate')}\n </Button>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n\n <ToastContainer toasts={toasts} onDismiss={dismiss} />\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAM,IAA2D;CAC/D,IAAI;CACJ,UAAU;CACV,QAAQ;CACR,KAAK;AACP,GAEa,UAA6B;CACxC,IAAM,EAAE,SAAM,EAAQ,GAChB,EAAE,iBAAc,aAAU,qBAAkB,YAAS,WAAQ,eAAY,EAAmB,GAC5F,EAAE,gBAAa,EAAoB,GAEnC,CAAC,GAAY,KAAiB,EAAS,EAAK,GAG5C,IAAgB,kBAAoB,IAAI,KAAK,CAAC,GAI9C,IAA4B;EAChC;GACE,IAAI;GACJ,OAAO,EAAE,gDAAgD,yBAAyB;GAClF,aAAa,EAAE,sDAAsD,2CAA2C;GAChH,UAAU;EACZ;EACA;GACE,IAAI;GACJ,OAAO,EAAE,sDAAsD,kBAAkB;GACjF,aAAa,EACX,4DACA,6CACF;GACA,UAAU;EACZ;EACA;GACE,IAAI;GACJ,OAAO,EAAE,oDAAoD,kBAAkB;GAC/E,aAAa,EACX,0DACA,kDACF;GACA,UAAU;EACZ;EACA;GACE,IAAI;GACJ,OAAO,EAAE,iDAAiD,aAAa;GACvE,aAAa,EACX,uDACA,qDACF;GACA,UAAU;EACZ;EACA;GACE,IAAI;GACJ,OAAO,EAAE,6DAA6D,2BAA2B;GACjG,aAAa,EACX,mEACA,+CACF;GACA,UAAU;E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;OAAK,WAAU;iBAAf,CACE,kBAAC,OAAD;QAAK,WAAU;kBACb,kBAAC,GAAD,EAAM,WAAU,8BAA+B,CAAA;OAC5C,CAAA,GACL,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,MAAD;SAAI,WAAU;mBAA2C,EAAO;QAAU,CAAA,GAC1E,kBAAC,KAAD;SAAG,WAAU;mBAAsC,EAAO;QAAe,CAAA,CACtE;SACF;UAEL,kBAAC,OAAD;OAAK,WAAU;iBAAf,CAEE,kBAAC,GAAD;QAAQ,SAAQ;QAAU,MAAK;QAAK,eAAe,GAAe,CAAM;kBAAxE,CACE,kBAAC,GAAD,EAAU,WAAU,cAAe,CAAA,GAClC,EAAE,+DAA+D,cAAc,CAC1E;WACR,kBAAC,GAAD;QAAQ,MAAK;QAAK,eAAe,KAAK,GAAe,EAAO,EAAE;QAAG,UAAU;kBACxE,EAAE,4DAA4D,UAAU;OACnE,CAAA,CACL;QACF;QArBK,EAAO,EAqBZ;IAET,CAAC;GACE,CAAA,CACF,EAAA,CAAA;GAEL,kBAAC,GAAD;IAAwB;IAAQ,WAAW;GAAU,CAAA;EAC3C;;AAEhB"}
|
|
1
|
+
{"version":3,"file":"FinancialReportsPage.js","names":[],"sources":["../../../../src/healthybowl/pages/financial/FinancialReportsPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { BarChart3, FileDown, FileText, TrendingUp, Wallet, Clock, PieChart as PieChartIcon } from 'lucide-react';\nimport { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend } from 'recharts';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Button, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@burdenoff/fe-libs/ui';\nimport { PageLayout, ChartCard, LoadingSkeleton, EmptyState, ErrorState } from '../../components';\nimport { ToastContainer } from '../../components/Toast';\nimport { useToast } from '../../hooks/useToast';\nimport { useHealthyBowlData } from '../../hooks/useHealthyBowlData';\nimport { formatCurrency, formatCompactCurrency, HB_DEFAULT_CURRENCY } from '../../utils/helpers';\n\ntype ReportCategory = 'pl' | 'cashflow' | 'budget' | 'tax';\ntype ExportFormat = 'pdf' | 'csv' | 'excel';\n\ninterface ReportType {\n id: string;\n title: string;\n description: string;\n category: ReportCategory;\n}\n\nconst categoryIcons: Record<ReportCategory, typeof TrendingUp> = {\n pl: TrendingUp,\n cashflow: BarChart3,\n budget: Wallet,\n tax: FileText,\n};\n\nexport const FinancialReportsPage = () => {\n const { t } = useI18n();\n const { transactions, invoices, revenueChartData, loading, errors } = useHealthyBowlData();\n\n // Report templates. Each downloads a real CSV of the current financial metrics; full\n // (PDF) generation has no backend yet (handled honestly below). No fabricated\n // \"last generated\" dates or fixed periods — those implied real runs that never happened.\n const reportTypes: ReportType[] = [\n {\n id: 'rpt-pl',\n title: t('healthybowl.financial.reports.types.pl.title', 'Profit & Loss Statement'),\n description: t('healthybowl.financial.reports.types.pl.description', 'Revenue, expenses, and net income summary'),\n category: 'pl',\n },\n {\n id: 'rpt-cf',\n title: t('healthybowl.financial.reports.types.cashflow.title', 'Cash Flow Report'),\n description: t(\n 'healthybowl.financial.reports.types.cashflow.description',\n 'Cash inflows, outflows, and closing balance'\n ),\n category: 'cashflow',\n },\n {\n id: 'rpt-ba',\n title: t('healthybowl.financial.reports.types.budget.title', 'Budget vs Actual'),\n description: t(\n 'healthybowl.financial.reports.types.budget.description',\n 'Budget allocation vs actual spending by category'\n ),\n category: 'budget',\n },\n {\n id: 'rpt-tax',\n title: t('healthybowl.financial.reports.types.tax.title', 'Tax Summary'),\n description: t(\n 'healthybowl.financial.reports.types.tax.description',\n 'Tax collected, paid, and outstanding for the period'\n ),\n category: 'tax',\n },\n {\n id: 'rpt-ar',\n title: t('healthybowl.financial.reports.types.receivableAging.title', 'Accounts Receivable Aging'),\n description: t(\n 'healthybowl.financial.reports.types.receivableAging.description',\n 'Outstanding invoices grouped by aging buckets'\n ),\n category: 'cashflow',\n },\n ];\n\n const categoryLabels: Record<ReportCategory, string> = {\n pl: t('healthybowl.financial.reports.categories.pl', 'Profit & Loss'),\n cashflow: t('healthybowl.financial.reports.categories.cashflow', 'Cash Flow'),\n budget: t('healthybowl.financial.reports.categories.budget', 'Budget vs Actual'),\n tax: t('healthybowl.financial.reports.categories.tax', 'Tax Summary'),\n };\n\n const { toasts, toast, dismiss } = useToast();\n const [selectedReportType, setSelectedReportType] = useState<ReportCategory>('pl');\n const [selectedPeriod, setSelectedPeriod] = useState('Q1 2025');\n const [selectedFormat, setSelectedFormat] = useState<ExportFormat>('pdf');\n\n const totalRevenue = transactions.filter((t) => t.type === 'income').reduce((s, t) => s + t.amount, 0);\n const totalExpenses = transactions.filter((t) => t.type === 'expense').reduce((s, t) => s + t.amount, 0);\n const netIncome = totalRevenue - totalExpenses;\n const accountsReceivable = invoices\n .filter((i) => i.status === 'sent' || i.status === 'overdue')\n .reduce((s, i) => s + i.total, 0);\n\n // Only metrics with a real data source. Cash-on-hand and tax-liability were dropped — they were\n // synthesized from arbitrary multipliers (netIncome*0.775, revenue*0.0736), not real balances/tax.\n // No period-over-period deltas: these are all-time totals with no comparable prior period here.\n const financialMetrics = [\n {\n id: 'grossRevenue',\n label: t('healthybowl.financial.reports.metrics.grossRevenue', 'Gross Revenue'),\n value: totalRevenue,\n },\n {\n id: 'operatingExpenses',\n label: t('healthybowl.financial.reports.metrics.operatingExpenses', 'Operating Expenses'),\n value: totalExpenses,\n },\n { id: 'netIncome', label: t('healthybowl.financial.reports.metrics.netIncome', 'Net Income'), value: netIncome },\n {\n id: 'accountsReceivable',\n label: t('healthybowl.financial.reports.metrics.accountsReceivable', 'Accounts Receivable'),\n value: accountsReceivable,\n },\n ];\n\n const handleGenerate = (id: string) => {\n const report = reportTypes.find((r) => r.id === id);\n toast({\n title: t(\n 'healthybowl.financial.reports.toast.generateUnavailable.title',\n 'Report generation is not available yet'\n ),\n description: t(\n 'healthybowl.financial.reports.toast.generateUnavailable.description',\n '{{report}} cannot be generated yet. You can still download already-available reports as CSV.',\n {\n report:\n report?.title ?? t('healthybowl.financial.reports.toast.generateUnavailable.fallbackReport', 'This report'),\n }\n ),\n variant: 'warning',\n });\n };\n\n const handleDownload = (report: ReportType) => {\n const headers = ['Metric', 'Value'];\n const rows = financialMetrics.map((m) => [m.label, String((m.value ?? 0).toFixed(2))]);\n const csv = [headers, ...rows].map((r) => r.map((c) => `\"${c}\"`).join(',')).join('\\n');\n const blob = new Blob([csv], { type: 'text/csv' });\n const url = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.href = url;\n a.download = `${(report.title ?? '').replace(/\\s+/g, '_')}.csv`;\n a.click();\n URL.revokeObjectURL(url);\n toast({\n title: t('healthybowl.financial.reports.toast.downloaded.title', 'Downloaded as CSV'),\n description: report.title,\n variant: 'success',\n });\n };\n\n const handleGenerateCustom = () => {\n toast({\n title: t(\n 'healthybowl.financial.reports.toast.generateUnavailable.title',\n 'Report generation is not available yet'\n ),\n description: t(\n 'healthybowl.financial.reports.toast.customUnavailable.description',\n 'Custom report generation has no backend yet — nothing was queued. Use Download CSV for available data.'\n ),\n variant: 'warning',\n });\n };\n\n const handleScheduleReport = () => {\n toast({\n title: t(\n 'healthybowl.financial.reports.toast.scheduleUnavailable.title',\n 'Report scheduling is not available yet'\n ),\n description: t(\n 'healthybowl.financial.reports.toast.scheduleUnavailable.description',\n 'Scheduled reports have no backend yet — nothing was scheduled.'\n ),\n variant: 'warning',\n });\n };\n\n // While the first load is still in flight and nothing has arrived yet, show skeletons in place\n // of the metric/chart body so the page never flashes zeros/blank/NaN sections.\n if (loading && transactions.length === 0 && invoices.length === 0 && revenueChartData.length === 0) {\n return (\n <PageLayout\n title={t('healthybowl.financial.reports.title', 'Financial Reports')}\n description={t(\n 'healthybowl.financial.reports.description',\n 'Generate, download, and schedule financial reports'\n )}\n >\n <LoadingSkeleton variant=\"card\" count={4} />\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title={t('healthybowl.financial.reports.title', 'Financial Reports')}\n description={t('healthybowl.financial.reports.description', 'Generate, download, and schedule financial reports')}\n purpose=\"Produce the financial statements you need for tax, loans or your own books — and schedule them to arrive automatically. Hand these to your accountant or lender as proof of how the farm is doing.\"\n >\n {/* Report Generation Section */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.financial.reports.generate.heading', 'Generate Report')}\n </h3>\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n {t(\n 'healthybowl.financial.reports.generate.subtitle',\n 'Select report type, period, and format to generate a custom report'\n )}\n </p>\n <div className=\"mt-4 flex flex-wrap items-end gap-3\">\n <div>\n <label className=\"mb-1 block text-xs font-medium text-text-secondary\">\n {t('healthybowl.financial.reports.generate.fields.reportType.label', 'Report Type')}\n </label>\n <Select\n value={selectedReportType}\n onValueChange={(value) => setSelectedReportType(value as ReportCategory)}\n >\n <SelectTrigger className=\"h-9 w-auto\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {Object.entries(categoryLabels).map(([key, label]) => (\n <SelectItem key={key} value={key}>\n {label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div>\n <label className=\"mb-1 block text-xs font-medium text-text-secondary\">\n {t('healthybowl.financial.reports.generate.fields.period.label', 'Period')}\n </label>\n <Select value={selectedPeriod} onValueChange={setSelectedPeriod}>\n <SelectTrigger className=\"h-9 w-auto\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"Q1 2025\">\n {t('healthybowl.financial.reports.generate.periods.q1_2025', 'Q1 2025')}\n </SelectItem>\n <SelectItem value=\"Q4 2024\">\n {t('healthybowl.financial.reports.generate.periods.q4_2024', 'Q4 2024')}\n </SelectItem>\n <SelectItem value=\"March 2025\">\n {t('healthybowl.financial.reports.generate.periods.march_2025', 'March 2025')}\n </SelectItem>\n <SelectItem value=\"FY 2024-25\">\n {t('healthybowl.financial.reports.generate.periods.fy_2024_25', 'FY 2024-25')}\n </SelectItem>\n </SelectContent>\n </Select>\n </div>\n <div>\n <label className=\"mb-1 block text-xs font-medium text-text-secondary\">\n {t('healthybowl.financial.reports.generate.fields.format.label', 'Format')}\n </label>\n <Select value={selectedFormat} onValueChange={(value) => setSelectedFormat(value as ExportFormat)}>\n <SelectTrigger className=\"h-9 w-auto\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"pdf\">{t('healthybowl.financial.reports.generate.formats.pdf', 'PDF')}</SelectItem>\n <SelectItem value=\"csv\">{t('healthybowl.financial.reports.generate.formats.csv', 'CSV')}</SelectItem>\n <SelectItem value=\"excel\">\n {t('healthybowl.financial.reports.generate.formats.excel', 'Excel')}\n </SelectItem>\n </SelectContent>\n </Select>\n </div>\n <Button onClick={handleGenerateCustom}>\n <FileDown className=\"h-4 w-4\" />\n {t('healthybowl.financial.reports.generate.actions.generate', 'Generate')}\n </Button>\n <Button variant=\"outline\" onClick={handleScheduleReport}>\n <Clock className=\"h-4 w-4\" />\n {t('healthybowl.financial.reports.generate.actions.schedule', 'Schedule')}\n </Button>\n </div>\n </div>\n\n {/* Revenue Trend Chart */}\n <ChartCard\n title={t('healthybowl.financial.reports.revenueTrend.title', 'Revenue Trend')}\n description={t('healthybowl.financial.reports.revenueTrend.description', 'Monthly revenue over last 6 months')}\n >\n {revenueChartData.length === 0 ? (\n errors.financial ? (\n <ErrorState />\n ) : (\n <EmptyState\n illustration=\"empty-data\"\n title={t('healthybowl.financial.reports.revenueTrend.empty.title', 'No revenue data yet')}\n description={t(\n 'healthybowl.financial.reports.revenueTrend.empty.description',\n 'Revenue and expense trends will appear here once financial activity is recorded.'\n )}\n />\n )\n ) : (\n <ResponsiveContainer width=\"100%\" height={260}>\n <LineChart data={revenueChartData} margin={{ top: 5, right: 20, left: 0, bottom: 5 }}>\n <CartesianGrid strokeDasharray=\"3 3\" className=\"stroke-border\" />\n <XAxis dataKey=\"month\" className=\"text-xs\" tick={{ fill: 'currentColor' }} />\n <YAxis\n className=\"text-xs\"\n tick={{ fill: 'currentColor' }}\n tickFormatter={(v: number) => formatCompactCurrency(v, HB_DEFAULT_CURRENCY)}\n />\n <Tooltip\n formatter={(value: number) => formatCurrency(value, HB_DEFAULT_CURRENCY)}\n contentStyle={{\n backgroundColor: 'var(--color-card)',\n border: '1px solid var(--color-border)',\n borderRadius: '8px',\n }}\n labelStyle={{ color: 'var(--color-foreground)' }}\n />\n <Legend />\n <Line\n type=\"monotone\"\n dataKey=\"revenue\"\n name={t('healthybowl.financial.reports.revenueTrend.series.revenue', 'Revenue')}\n stroke=\"var(--color-success)\"\n strokeWidth={2}\n dot={{ r: 4, fill: 'var(--color-success)' }}\n activeDot={{ r: 6 }}\n />\n <Line\n type=\"monotone\"\n dataKey=\"expenses\"\n name={t('healthybowl.financial.reports.revenueTrend.series.expenses', 'Expenses')}\n stroke=\"var(--color-destructive)\"\n strokeWidth={2}\n dot={{ r: 4, fill: 'var(--color-destructive)' }}\n activeDot={{ r: 6 }}\n />\n </LineChart>\n </ResponsiveContainer>\n )}\n </ChartCard>\n\n {/* Key Financial Metrics */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <div className=\"flex items-center gap-2\">\n <PieChartIcon className=\"h-4 w-4 text-text-secondary\" />\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.financial.reports.metrics.heading', 'Key Financial Metrics')}\n </h3>\n </div>\n {transactions.length === 0 && invoices.length === 0 ? (\n errors.financial ? (\n <ErrorState />\n ) : (\n <EmptyState\n illustration=\"empty-data\"\n title={t('healthybowl.financial.reports.metrics.empty.title', 'No financial data yet')}\n description={t(\n 'healthybowl.financial.reports.metrics.empty.description',\n 'Key metrics will appear here once transactions and invoices are recorded.'\n )}\n />\n )\n ) : (\n <div className=\"mt-4 grid grid-cols-2 gap-4 sm:grid-cols-4\">\n {financialMetrics.map((metric) => (\n <div key={metric.id} className=\"rounded-md bg-bg-sunken/50 p-3 text-center\">\n <p className=\"text-xs text-text-secondary\">{metric.label}</p>\n <p className=\"mt-1 text-lg font-bold text-text-primary\">\n {formatCurrency(metric.value, HB_DEFAULT_CURRENCY)}\n </p>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {/* Pre-built Report Cards */}\n <div>\n <h3 className=\"mb-3 text-sm font-semibold text-text-primary\">\n {t('healthybowl.financial.reports.available.heading', 'Available Reports')}\n </h3>\n <div className=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {reportTypes.map((report) => {\n const Icon = categoryIcons[report.category];\n\n return (\n <div key={report.id} className=\"flex flex-col rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <div className=\"flex items-start gap-3\">\n <div className=\"rounded-md bg-bg-sunken p-2\">\n <Icon className=\"h-5 w-5 text-text-secondary\" />\n </div>\n <div className=\"flex-1\">\n <h4 className=\"text-sm font-semibold text-text-primary\">{report.title}</h4>\n <p className=\"mt-0.5 text-xs text-text-secondary\">{report.description}</p>\n </div>\n </div>\n\n <div className=\"mt-auto flex items-center justify-end gap-2 pt-4\">\n {/* Download is a real CSV of the current metrics; full report generation is honestly disabled. */}\n <Button variant=\"outline\" size=\"sm\" onClick={() => handleDownload(report)}>\n <FileDown className=\"h-3.5 w-3.5\" />\n {t('healthybowl.financial.reports.available.actions.downloadCsv', 'Download CSV')}\n </Button>\n <Button size=\"sm\" onClick={() => handleGenerate(report.id)}>\n {t('healthybowl.financial.reports.available.actions.generate', 'Generate')}\n </Button>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n\n <ToastContainer toasts={toasts} onDismiss={dismiss} />\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAM,IAA2D;CAC/D,IAAI;CACJ,UAAU;CACV,QAAQ;CACR,KAAK;AACP,GAEa,UAA6B;CACxC,IAAM,EAAE,SAAM,EAAQ,GAChB,EAAE,iBAAc,aAAU,qBAAkB,YAAS,cAAW,EAAmB,GAKnF,IAA4B;EAChC;GACE,IAAI;GAC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