@burdenoff/microfe-mybodyshield 2026.827.1 → 2026.830.1

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 (90) hide show
  1. package/dist/mybodyshield/MyBodyShieldRoot.d.ts.map +1 -1
  2. package/dist/mybodyshield/MyBodyShieldRoot.js +54 -56
  3. package/dist/mybodyshield/MyBodyShieldRoot.js.map +1 -1
  4. package/dist/mybodyshield/MyBodyShieldRoutes.d.ts.map +1 -1
  5. package/dist/mybodyshield/MyBodyShieldRoutes.js +121 -62
  6. package/dist/mybodyshield/MyBodyShieldRoutes.js.map +1 -1
  7. package/dist/mybodyshield/components/EvidenceUpload.d.ts.map +1 -1
  8. package/dist/mybodyshield/components/EvidenceUpload.js +46 -45
  9. package/dist/mybodyshield/components/EvidenceUpload.js.map +1 -1
  10. package/dist/mybodyshield/components/FileLink.d.ts.map +1 -1
  11. package/dist/mybodyshield/components/FileLink.js +27 -18
  12. package/dist/mybodyshield/components/FileLink.js.map +1 -1
  13. package/dist/mybodyshield/components/MybDiscussion.d.ts +1 -1
  14. package/dist/mybodyshield/components/MybDiscussion.d.ts.map +1 -1
  15. package/dist/mybodyshield/components/MybDiscussion.js +59 -58
  16. package/dist/mybodyshield/components/MybDiscussion.js.map +1 -1
  17. package/dist/mybodyshield/components/MybTags.d.ts +1 -1
  18. package/dist/mybodyshield/components/MybTags.d.ts.map +1 -1
  19. package/dist/mybodyshield/components/MybTags.js +83 -74
  20. package/dist/mybodyshield/components/MybTags.js.map +1 -1
  21. package/dist/mybodyshield/components/PageDisabled.d.ts.map +1 -1
  22. package/dist/mybodyshield/components/PageDisabled.js +16 -11
  23. package/dist/mybodyshield/components/PageDisabled.js.map +1 -1
  24. package/dist/mybodyshield/components/Pagination.d.ts.map +1 -1
  25. package/dist/mybodyshield/components/Pagination.js +36 -27
  26. package/dist/mybodyshield/components/Pagination.js.map +1 -1
  27. package/dist/mybodyshield/components/StateViews.d.ts.map +1 -1
  28. package/dist/mybodyshield/components/StateViews.js +42 -34
  29. package/dist/mybodyshield/components/StateViews.js.map +1 -1
  30. package/dist/mybodyshield/components/UserSearchSelect.d.ts.map +1 -1
  31. package/dist/mybodyshield/components/UserSearchSelect.js +66 -68
  32. package/dist/mybodyshield/components/UserSearchSelect.js.map +1 -1
  33. package/dist/mybodyshield/hooks/index.d.ts +1 -0
  34. package/dist/mybodyshield/hooks/index.d.ts.map +1 -1
  35. package/dist/mybodyshield/hooks/index.js +1 -0
  36. package/dist/mybodyshield/hooks/useTr.d.ts +5 -0
  37. package/dist/mybodyshield/hooks/useTr.d.ts.map +1 -0
  38. package/dist/mybodyshield/hooks/useTr.js +12 -0
  39. package/dist/mybodyshield/hooks/useTr.js.map +1 -0
  40. package/dist/mybodyshield/pages/DashboardPage.d.ts.map +1 -1
  41. package/dist/mybodyshield/pages/DashboardPage.js +157 -136
  42. package/dist/mybodyshield/pages/DashboardPage.js.map +1 -1
  43. package/dist/mybodyshield/pages/SettingsPage.d.ts.map +1 -1
  44. package/dist/mybodyshield/pages/SettingsPage.js +50 -59
  45. package/dist/mybodyshield/pages/SettingsPage.js.map +1 -1
  46. package/dist/mybodyshield/pages/_shared/visuals.d.ts +2 -1
  47. package/dist/mybodyshield/pages/_shared/visuals.d.ts.map +1 -1
  48. package/dist/mybodyshield/pages/_shared/visuals.js +91 -81
  49. package/dist/mybodyshield/pages/_shared/visuals.js.map +1 -1
  50. package/dist/mybodyshield/pages/ai/AiControlsPage.d.ts.map +1 -1
  51. package/dist/mybodyshield/pages/ai/AiControlsPage.js +255 -266
  52. package/dist/mybodyshield/pages/ai/AiControlsPage.js.map +1 -1
  53. package/dist/mybodyshield/pages/coaching/CoachingPage.d.ts.map +1 -1
  54. package/dist/mybodyshield/pages/coaching/CoachingPage.js +321 -301
  55. package/dist/mybodyshield/pages/coaching/CoachingPage.js.map +1 -1
  56. package/dist/mybodyshield/pages/goals/GoalsPage.d.ts.map +1 -1
  57. package/dist/mybodyshield/pages/goals/GoalsPage.js +247 -251
  58. package/dist/mybodyshield/pages/goals/GoalsPage.js.map +1 -1
  59. package/dist/mybodyshield/pages/insights/InsightsCharts.d.ts.map +1 -1
  60. package/dist/mybodyshield/pages/insights/InsightsCharts.js +216 -213
  61. package/dist/mybodyshield/pages/insights/InsightsCharts.js.map +1 -1
  62. package/dist/mybodyshield/pages/insights/InsightsPage.d.ts.map +1 -1
  63. package/dist/mybodyshield/pages/insights/InsightsPage.js +290 -284
  64. package/dist/mybodyshield/pages/insights/InsightsPage.js.map +1 -1
  65. package/dist/mybodyshield/pages/nutrition/NutritionPage.d.ts.map +1 -1
  66. package/dist/mybodyshield/pages/nutrition/NutritionPage.js +575 -529
  67. package/dist/mybodyshield/pages/nutrition/NutritionPage.js.map +1 -1
  68. package/dist/mybodyshield/pages/programs/ProgramDetailPage.d.ts.map +1 -1
  69. package/dist/mybodyshield/pages/programs/ProgramDetailPage.js +333 -275
  70. package/dist/mybodyshield/pages/programs/ProgramDetailPage.js.map +1 -1
  71. package/dist/mybodyshield/pages/programs/ProgramsPage.d.ts.map +1 -1
  72. package/dist/mybodyshield/pages/programs/ProgramsPage.js +258 -253
  73. package/dist/mybodyshield/pages/programs/ProgramsPage.js.map +1 -1
  74. package/dist/mybodyshield/pages/progress/ProgressPage.d.ts.map +1 -1
  75. package/dist/mybodyshield/pages/progress/ProgressPage.js +271 -254
  76. package/dist/mybodyshield/pages/progress/ProgressPage.js.map +1 -1
  77. package/dist/mybodyshield/pages/recovery/RecoveryPage.d.ts.map +1 -1
  78. package/dist/mybodyshield/pages/recovery/RecoveryPage.js +206 -200
  79. package/dist/mybodyshield/pages/recovery/RecoveryPage.js.map +1 -1
  80. package/dist/mybodyshield/pages/train/SessionDetailPage.d.ts.map +1 -1
  81. package/dist/mybodyshield/pages/train/SessionDetailPage.js +327 -294
  82. package/dist/mybodyshield/pages/train/SessionDetailPage.js.map +1 -1
  83. package/dist/mybodyshield/pages/train/SessionsPage.d.ts.map +1 -1
  84. package/dist/mybodyshield/pages/train/SessionsPage.js +180 -163
  85. package/dist/mybodyshield/pages/train/SessionsPage.js.map +1 -1
  86. package/dist/mybodyshield/utils/i18n.d.ts +1 -2
  87. package/dist/mybodyshield/utils/i18n.d.ts.map +1 -1
  88. package/dist/mybodyshield/utils/i18n.js +15 -0
  89. package/dist/mybodyshield/utils/i18n.js.map +1 -0
  90. package/package.json +1 -1
@@ -2,112 +2,119 @@ import { useMyBodyShield as e } from "../../context/MyBodyShieldContext.js";
2
2
  import { PageLayout as t } from "../../components/PageLayout.js";
3
3
  import { MetricsCard as n } from "../../components/MetricsCard.js";
4
4
  import { formatDate as r, formatEnumLabel as i, formatGrams as a, formatKcal as o, formatNumber as s, formatPercent as c, formatWeight as l } from "../../utils/formatters.js";
5
- import { ErrorView as u, LoadingView as d, Section as f } from "../../components/StateViews.js";
6
- import { DataTable as p } from "../../components/DataTable.js";
7
5
  import "../../context/index.js";
8
- import { useMybInsights as m } from "../../hooks/useMyBodyShieldApi.js";
9
- import { useMyBodyShieldAnalytics as h } from "../../hooks/useMyBodyShieldAnalytics.js";
6
+ import { useMybInsights as u } from "../../hooks/useMyBodyShieldApi.js";
7
+ import { useMyBodyShieldAnalytics as d } from "../../hooks/useMyBodyShieldAnalytics.js";
8
+ import { useTr as f } from "../../hooks/useTr.js";
10
9
  import "../../hooks/index.js";
10
+ import { ErrorView as p, LoadingView as m, Section as h } from "../../components/StateViews.js";
11
+ import { DataTable as g } from "../../components/DataTable.js";
11
12
  import "../../components/index.js";
12
- import { CalorieChart as g, CorrelationView as _, MacroChart as v, ReadinessSleepChart as y, VolumeChart as b } from "./InsightsCharts.js";
13
- import { useEffect as x, useMemo as S, useState as C } from "react";
14
- import { BarChart3 as w, Calendar as T, Dumbbell as E, Flame as D, HeartPulse as O, Moon as k, Scale as A, Target as j, TrendingUp as M, Utensils as N } from "lucide-react";
15
- import { jsx as P, jsxs as F } from "react/jsx-runtime";
16
- import { Button as I, GlassCard as L } from "@burdenoff/fe-libs/ui";
13
+ import { CalorieChart as _, CorrelationView as v, MacroChart as y, ReadinessSleepChart as b, VolumeChart as x } from "./InsightsCharts.js";
14
+ import { useEffect as S, useMemo as C, useState as w } from "react";
15
+ import { BarChart3 as T, Calendar as E, Dumbbell as D, Flame as O, HeartPulse as k, Moon as A, Scale as j, Target as M, TrendingUp as N, Utensils as P } from "lucide-react";
16
+ import { jsx as F, jsxs as I } from "react/jsx-runtime";
17
+ import { Button as L, GlassCard as R } from "@burdenoff/fe-libs/ui";
17
18
  //#region src/mybodyshield/pages/insights/InsightsPage.tsx
18
- var R = [
19
+ var z = [
19
20
  {
20
- label: "Last 7 days",
21
+ labelKey: "last7Days",
22
+ fallback: "Last 7 days",
21
23
  days: 7
22
24
  },
23
25
  {
24
- label: "Last 30 days",
26
+ labelKey: "last30Days",
27
+ fallback: "Last 30 days",
25
28
  days: 30
26
29
  },
27
30
  {
28
- label: "Last 90 days",
31
+ labelKey: "last90Days",
32
+ fallback: "Last 90 days",
29
33
  days: 90
30
34
  }
31
35
  ];
32
- function z(e) {
36
+ function B(e) {
33
37
  return e.toISOString().split("T")[0];
34
38
  }
35
- function B(e) {
39
+ function V(e) {
36
40
  return e.calories > 0 || e.proteinG > 0 || e.carbsG > 0 || e.fatG > 0;
37
41
  }
38
- function V(e) {
42
+ function H(e) {
39
43
  return e.readiness != null || e.sleepHours != null;
40
44
  }
41
- function H(e) {
42
- return e.sessions > 0 || V(e) || B(e) || e.weight != null;
45
+ function U(e) {
46
+ return e.sessions > 0 || H(e) || V(e) || e.weight != null;
43
47
  }
44
- function U({ daily: e, summary: t, onOpen: n }) {
45
- let r = e.length;
46
- return /* @__PURE__ */ P(f, {
47
- title: "What these numbers are built on",
48
- description: "The logs feeding the charts above. Gaps here are why a trend can look flat.",
49
- children: /* @__PURE__ */ P("div", {
48
+ function W({ daily: e, summary: t, onOpen: n }) {
49
+ let r = f(), i = e.length, a = [
50
+ {
51
+ route: "train",
52
+ icon: /* @__PURE__ */ F(D, { className: "h-4 w-4" }),
53
+ label: r("mybodyshield.pages.insights.training", "Training"),
54
+ value: t.totalSessions,
55
+ unit: t.totalSessions === 1 ? r("mybodyshield.pages.insights.trainingUnitSingular", "completed session") : r("mybodyshield.pages.insights.trainingUnitPlural", "completed sessions"),
56
+ detail: r("mybodyshield.pages.insights.trainingDetail", "on {{active}} of {{total}} days", {
57
+ active: s(e.filter((e) => e.sessions > 0).length),
58
+ total: s(i)
59
+ })
60
+ },
61
+ {
62
+ route: "recovery",
63
+ icon: /* @__PURE__ */ F(k, { className: "h-4 w-4" }),
64
+ label: r("mybodyshield.pages.insights.recovery", "Recovery"),
65
+ value: e.filter(H).length,
66
+ unit: r("mybodyshield.pages.insights.recoveryUnit", "days logged"),
67
+ detail: r("mybodyshield.pages.insights.recoveryDetail", "readiness or sleep entries")
68
+ },
69
+ {
70
+ route: "nutrition",
71
+ icon: /* @__PURE__ */ F(P, { className: "h-4 w-4" }),
72
+ label: r("mybodyshield.pages.insights.nutrition", "Nutrition"),
73
+ value: e.filter(V).length,
74
+ unit: r("mybodyshield.pages.insights.nutritionUnit", "days logged"),
75
+ detail: r("mybodyshield.pages.insights.nutritionDetail", "days with macros logged")
76
+ },
77
+ {
78
+ route: "progress",
79
+ icon: /* @__PURE__ */ F(j, { className: "h-4 w-4" }),
80
+ label: r("mybodyshield.pages.insights.bodyWeight", "Body weight"),
81
+ value: e.filter((e) => e.weight != null).length,
82
+ unit: r("mybodyshield.pages.insights.bodyWeightUnit", "days logged"),
83
+ detail: r("mybodyshield.pages.insights.bodyWeightDetail", "weight readings only")
84
+ }
85
+ ];
86
+ return /* @__PURE__ */ F(h, {
87
+ title: r("mybodyshield.pages.insights.sourcesTitle", "What these numbers are built on"),
88
+ description: r("mybodyshield.pages.insights.sourcesDescription", "The logs feeding the charts above. Gaps here are why a trend can look flat."),
89
+ children: /* @__PURE__ */ F("div", {
50
90
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4",
51
- children: [
52
- {
53
- route: "train",
54
- icon: /* @__PURE__ */ P(E, { className: "h-4 w-4" }),
55
- label: "Training",
56
- value: t.totalSessions,
57
- unit: t.totalSessions === 1 ? "completed session" : "completed sessions",
58
- detail: `on ${e.filter((e) => e.sessions > 0).length} of ${r} days`
59
- },
60
- {
61
- route: "recovery",
62
- icon: /* @__PURE__ */ P(O, { className: "h-4 w-4" }),
63
- label: "Recovery",
64
- value: e.filter(V).length,
65
- unit: "days logged",
66
- detail: "readiness or sleep entries"
67
- },
68
- {
69
- route: "nutrition",
70
- icon: /* @__PURE__ */ P(N, { className: "h-4 w-4" }),
71
- label: "Nutrition",
72
- value: e.filter(B).length,
73
- unit: "days logged",
74
- detail: "days with macros logged"
75
- },
76
- {
77
- route: "progress",
78
- icon: /* @__PURE__ */ P(A, { className: "h-4 w-4" }),
79
- label: "Body weight",
80
- value: e.filter((e) => e.weight != null).length,
81
- unit: "days logged",
82
- detail: "weight readings only"
83
- }
84
- ].map((e) => /* @__PURE__ */ F(L, {
91
+ children: a.map((e) => /* @__PURE__ */ I(R, {
85
92
  treatment: "plain",
86
93
  className: "flex flex-col gap-3 p-5",
87
- children: [/* @__PURE__ */ F("div", {
94
+ children: [/* @__PURE__ */ I("div", {
88
95
  className: "flex items-center justify-between gap-2",
89
- children: [/* @__PURE__ */ F("div", {
96
+ children: [/* @__PURE__ */ I("div", {
90
97
  className: "flex min-w-0 items-center gap-2 text-text-secondary",
91
- children: [e.icon, /* @__PURE__ */ P("span", {
98
+ children: [e.icon, /* @__PURE__ */ F("span", {
92
99
  className: "truncate text-sm font-medium text-text-primary",
93
100
  children: e.label
94
101
  })]
95
- }), /* @__PURE__ */ P(I, {
102
+ }), /* @__PURE__ */ F(L, {
96
103
  variant: "ghost",
97
104
  size: "sm",
98
105
  onClick: () => n(e.route),
99
- children: "View"
106
+ children: r("mybodyshield.pages.insights.viewButton", "View")
100
107
  })]
101
- }), /* @__PURE__ */ F("div", { children: [
102
- /* @__PURE__ */ P("p", {
108
+ }), /* @__PURE__ */ I("div", { children: [
109
+ /* @__PURE__ */ F("p", {
103
110
  className: "text-2xl font-bold tabular-nums text-text-primary",
104
111
  children: s(e.value)
105
112
  }),
106
- /* @__PURE__ */ P("p", {
113
+ /* @__PURE__ */ F("p", {
107
114
  className: "text-xs text-text-secondary",
108
115
  children: e.unit
109
116
  }),
110
- /* @__PURE__ */ P("p", {
117
+ /* @__PURE__ */ F("p", {
111
118
  className: "mt-1 text-xs text-text-tertiary",
112
119
  children: e.detail
113
120
  })
@@ -116,200 +123,234 @@ function U({ daily: e, summary: t, onOpen: n }) {
116
123
  })
117
124
  });
118
125
  }
119
- function W(e) {
120
- return S(() => {
126
+ function G(e) {
127
+ return C(() => {
121
128
  let t = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
122
129
  return n.setDate(t.getDate() - e + 1), {
123
- dateRangeStart: z(n),
124
- dateRangeEnd: z(t)
130
+ dateRangeStart: B(n),
131
+ dateRangeEnd: B(t)
125
132
  };
126
133
  }, [e]);
127
134
  }
128
- function G() {
129
- let { workspaceId: S, navigateTo: I } = e(), [z, B] = C(30), V = m(W(z)), G = h();
130
- if (x(() => {
131
- G.emitPageView("insights", { workspaceId: S });
132
- }, [G, S]), V.isLoading) return /* @__PURE__ */ P(t, {
133
- title: "Insights",
134
- children: /* @__PURE__ */ P(d, { label: "Loading insights…" })
135
+ function K() {
136
+ let C = f(), { workspaceId: L, navigateTo: B } = e(), [V, H] = w(30), K = u(G(V)), q = d();
137
+ if (S(() => {
138
+ q.emitPageView("insights", { workspaceId: L });
139
+ }, [q, L]), K.isLoading) return /* @__PURE__ */ F(t, {
140
+ title: C("mybodyshield.pages.insights.title", "Insights"),
141
+ children: /* @__PURE__ */ F(m, { label: C("mybodyshield.pages.insights.loading", "Loading insights…") })
135
142
  });
136
- if (V.isError) return /* @__PURE__ */ P(t, {
137
- title: "Insights",
138
- children: /* @__PURE__ */ P(u, {
139
- title: "Could not load insights",
140
- message: V.error instanceof Error ? V.error.message : "Unknown error",
141
- onRetry: () => V.refetch()
143
+ if (K.isError) return /* @__PURE__ */ F(t, {
144
+ title: C("mybodyshield.pages.insights.title", "Insights"),
145
+ children: /* @__PURE__ */ F(p, {
146
+ title: C("mybodyshield.pages.insights.errorTitle", "Could not load insights"),
147
+ message: K.error instanceof Error ? K.error.message : C("mybodyshield.common.unknownError", "Unknown error"),
148
+ onRetry: () => K.refetch()
142
149
  })
143
150
  });
144
- let K = V.data;
145
- if (!K) return /* @__PURE__ */ P(t, {
146
- title: "Insights",
147
- children: /* @__PURE__ */ P(u, {
148
- title: "Could not load insights",
149
- message: "No insight data was returned.",
150
- onRetry: () => V.refetch()
151
+ let J = K.data;
152
+ if (!J) return /* @__PURE__ */ F(t, {
153
+ title: C("mybodyshield.pages.insights.title", "Insights"),
154
+ children: /* @__PURE__ */ F(p, {
155
+ title: C("mybodyshield.pages.insights.errorTitle", "Could not load insights"),
156
+ message: C("mybodyshield.pages.insights.error", "No insight data was returned."),
157
+ onRetry: () => K.refetch()
151
158
  })
152
159
  });
153
- let { summary: q, daily: J, goals: Y } = K, X = J.filter(H).length;
154
- return /* @__PURE__ */ F(t, {
155
- title: "Insights",
156
- description: `${r(K.dateRangeStart)} – ${r(K.dateRangeEnd)}`,
160
+ let { summary: Y, daily: X, goals: Z } = J, Q = X.filter(U).length, $ = [
161
+ {
162
+ key: "date",
163
+ header: C("mybodyshield.pages.insights.dateColumn", "Date"),
164
+ render: (e) => /* @__PURE__ */ F("span", {
165
+ className: "text-text-primary",
166
+ children: r(e.date)
167
+ })
168
+ },
169
+ {
170
+ key: "sessions",
171
+ header: C("mybodyshield.pages.insights.sessionsColumn", "Sessions"),
172
+ align: "right",
173
+ render: (e) => /* @__PURE__ */ F("span", {
174
+ className: "tabular-nums text-text-secondary",
175
+ children: e.sessions
176
+ })
177
+ },
178
+ {
179
+ key: "volumeKg",
180
+ header: C("mybodyshield.pages.insights.volumeColumn", "Volume"),
181
+ align: "right",
182
+ render: (e) => /* @__PURE__ */ F("span", {
183
+ className: "tabular-nums text-text-secondary",
184
+ children: l(e.volumeKg)
185
+ })
186
+ },
187
+ {
188
+ key: "readiness",
189
+ header: C("mybodyshield.pages.insights.readinessColumn", "Readiness"),
190
+ align: "right",
191
+ render: (e) => /* @__PURE__ */ F("span", {
192
+ className: "tabular-nums text-text-secondary",
193
+ children: e.readiness == null ? "—" : s(e.readiness)
194
+ })
195
+ },
196
+ {
197
+ key: "sleepHours",
198
+ header: C("mybodyshield.pages.insights.sleepColumn", "Sleep"),
199
+ align: "right",
200
+ render: (e) => /* @__PURE__ */ F("span", {
201
+ className: "tabular-nums text-text-secondary",
202
+ children: e.sleepHours == null ? "—" : `${s(e.sleepHours)} h`
203
+ })
204
+ },
205
+ {
206
+ key: "calories",
207
+ header: C("mybodyshield.pages.insights.caloriesColumn", "Calories"),
208
+ align: "right",
209
+ render: (e) => /* @__PURE__ */ F("span", {
210
+ className: "tabular-nums text-text-secondary",
211
+ children: o(e.calories)
212
+ })
213
+ },
214
+ {
215
+ key: "proteinG",
216
+ header: C("mybodyshield.pages.insights.proteinColumn", "Protein"),
217
+ align: "right",
218
+ render: (e) => /* @__PURE__ */ F("span", {
219
+ className: "tabular-nums text-text-secondary",
220
+ children: a(e.proteinG)
221
+ })
222
+ },
223
+ {
224
+ key: "weight",
225
+ header: C("mybodyshield.pages.insights.weightColumn", "Weight"),
226
+ align: "right",
227
+ render: (e) => /* @__PURE__ */ F("span", {
228
+ className: "tabular-nums text-text-secondary",
229
+ children: e.weight == null ? "—" : l(e.weight)
230
+ })
231
+ }
232
+ ], ee = [
233
+ {
234
+ key: "title",
235
+ header: C("mybodyshield.pages.insights.goalColumn", "Goal"),
236
+ render: (e) => /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("span", {
237
+ className: "block text-sm text-text-primary",
238
+ children: e.title
239
+ }), /* @__PURE__ */ F("span", {
240
+ className: "text-xs text-text-tertiary",
241
+ children: i(e.type)
242
+ })] })
243
+ },
244
+ {
245
+ key: "status",
246
+ header: C("mybodyshield.pages.insights.statusColumn", "Status"),
247
+ render: (e) => /* @__PURE__ */ F("span", {
248
+ className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${e.status === "ACHIEVED" ? "bg-status-success-bg text-status-success-text" : "bg-status-warning-bg text-status-warning-text"}`,
249
+ children: i(e.status)
250
+ })
251
+ },
252
+ {
253
+ key: "progress",
254
+ header: C("mybodyshield.pages.insights.progressColumn", "Progress"),
255
+ align: "right",
256
+ render: (e) => /* @__PURE__ */ I("span", {
257
+ className: "tabular-nums text-text-secondary",
258
+ children: [
259
+ s(e.currentValue),
260
+ " / ",
261
+ s(e.targetValue),
262
+ " ",
263
+ e.unit
264
+ ]
265
+ })
266
+ }
267
+ ];
268
+ return /* @__PURE__ */ I(t, {
269
+ title: C("mybodyshield.pages.insights.title", "Insights"),
270
+ description: C("mybodyshield.pages.insights.description", "{{start}} – {{end}}", {
271
+ start: r(J.dateRangeStart),
272
+ end: r(J.dateRangeEnd)
273
+ }),
157
274
  children: [
158
- /* @__PURE__ */ P("div", {
275
+ /* @__PURE__ */ F("div", {
159
276
  className: "flex flex-wrap items-center gap-2",
160
- children: R.map((e) => /* @__PURE__ */ P("button", {
277
+ children: z.map((e) => /* @__PURE__ */ F("button", {
161
278
  type: "button",
162
- onClick: () => B(e.days),
163
- className: `rounded-lg px-3 py-1.5 text-sm font-medium transition-colors ${z === e.days ? "bg-accent text-white" : "bg-bg-sunken text-text-secondary hover:bg-bg-elevated"}`,
164
- children: e.label
279
+ onClick: () => H(e.days),
280
+ className: `rounded-lg px-3 py-1.5 text-sm font-medium transition-colors ${V === e.days ? "bg-accent text-white" : "bg-bg-sunken text-text-secondary hover:bg-bg-elevated"}`,
281
+ children: C(`mybodyshield.pages.insights.${e.labelKey}`, e.fallback)
165
282
  }, e.days))
166
283
  }),
167
- /* @__PURE__ */ P(f, {
168
- title: "Summary",
169
- children: /* @__PURE__ */ F("div", {
284
+ /* @__PURE__ */ F(h, {
285
+ title: C("mybodyshield.pages.insights.summary", "Summary"),
286
+ children: /* @__PURE__ */ I("div", {
170
287
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
171
288
  children: [
172
- /* @__PURE__ */ P(n, {
173
- icon: /* @__PURE__ */ P(D, { className: "h-5 w-5" }),
174
- value: q.consistencyStreakDays,
175
- label: "Consistency streak"
289
+ /* @__PURE__ */ F(n, {
290
+ icon: /* @__PURE__ */ F(O, { className: "h-5 w-5" }),
291
+ value: Y.consistencyStreakDays,
292
+ label: C("mybodyshield.pages.insights.consistencyStreak", "Consistency streak")
176
293
  }),
177
- /* @__PURE__ */ P(n, {
178
- icon: /* @__PURE__ */ P(E, { className: "h-5 w-5" }),
179
- value: q.totalSessions,
180
- label: "Total sessions"
294
+ /* @__PURE__ */ F(n, {
295
+ icon: /* @__PURE__ */ F(D, { className: "h-5 w-5" }),
296
+ value: Y.totalSessions,
297
+ label: C("mybodyshield.pages.insights.totalSessions", "Total sessions")
181
298
  }),
182
- /* @__PURE__ */ P(n, {
183
- icon: /* @__PURE__ */ P(M, { className: "h-5 w-5" }),
184
- value: l(q.totalVolumeKg),
185
- label: "Total volume"
299
+ /* @__PURE__ */ F(n, {
300
+ icon: /* @__PURE__ */ F(N, { className: "h-5 w-5" }),
301
+ value: l(Y.totalVolumeKg),
302
+ label: C("mybodyshield.pages.insights.totalVolume", "Total volume")
186
303
  }),
187
- /* @__PURE__ */ P(n, {
188
- icon: /* @__PURE__ */ P(O, { className: "h-5 w-5" }),
189
- value: s(q.averageReadiness),
190
- label: "Average readiness"
304
+ /* @__PURE__ */ F(n, {
305
+ icon: /* @__PURE__ */ F(k, { className: "h-5 w-5" }),
306
+ value: s(Y.averageReadiness),
307
+ label: C("mybodyshield.pages.insights.averageReadiness", "Average readiness")
191
308
  }),
192
- /* @__PURE__ */ P(n, {
193
- icon: /* @__PURE__ */ P(N, { className: "h-5 w-5" }),
194
- value: c(q.macroAdherencePercent),
195
- label: "Macro adherence"
309
+ /* @__PURE__ */ F(n, {
310
+ icon: /* @__PURE__ */ F(P, { className: "h-5 w-5" }),
311
+ value: c(Y.macroAdherencePercent),
312
+ label: C("mybodyshield.pages.insights.macroAdherence", "Macro adherence")
196
313
  }),
197
- /* @__PURE__ */ P(n, {
198
- icon: /* @__PURE__ */ P(T, { className: "h-5 w-5" }),
199
- value: X,
200
- label: "Days with data",
314
+ /* @__PURE__ */ F(n, {
315
+ icon: /* @__PURE__ */ F(E, { className: "h-5 w-5" }),
316
+ value: Q,
317
+ label: C("mybodyshield.pages.insights.daysWithData", "Days with data"),
201
318
  footer: /* @__PURE__ */ F("p", {
202
319
  className: "text-xs text-text-tertiary",
203
- children: [
204
- "of ",
205
- J.length,
206
- " days in this range"
207
- ]
320
+ children: C("mybodyshield.pages.insights.ofDaysInRange", "of {{count}} days in this range", { count: X.length })
208
321
  })
209
322
  })
210
323
  ]
211
324
  })
212
325
  }),
213
- /* @__PURE__ */ P(U, {
214
- daily: J,
215
- summary: q,
216
- onOpen: I
326
+ /* @__PURE__ */ F(W, {
327
+ daily: X,
328
+ summary: Y,
329
+ onOpen: B
217
330
  }),
218
- /* @__PURE__ */ P(f, {
219
- title: "Trends",
220
- description: "How training, recovery and nutrition move together.",
221
- children: /* @__PURE__ */ F("div", {
331
+ /* @__PURE__ */ F(h, {
332
+ title: C("mybodyshield.pages.insights.trends", "Trends"),
333
+ description: C("mybodyshield.pages.insights.trendsDescription", "How training, recovery and nutrition move together."),
334
+ children: /* @__PURE__ */ I("div", {
222
335
  className: "grid grid-cols-1 gap-6 xl:grid-cols-2",
223
336
  children: [
224
- /* @__PURE__ */ P(b, { daily: J }),
225
- /* @__PURE__ */ P(y, { daily: J }),
226
- /* @__PURE__ */ P(v, { daily: J }),
227
- /* @__PURE__ */ P(g, { daily: J })
337
+ /* @__PURE__ */ F(x, { daily: X }),
338
+ /* @__PURE__ */ F(b, { daily: X }),
339
+ /* @__PURE__ */ F(y, { daily: X }),
340
+ /* @__PURE__ */ F(_, { daily: X })
228
341
  ]
229
342
  })
230
343
  }),
231
- /* @__PURE__ */ P(_, { daily: J }),
232
- /* @__PURE__ */ P(f, {
233
- title: "Daily breakdown",
234
- description: "Per-day training, recovery and nutrition.",
235
- children: /* @__PURE__ */ P(L, {
344
+ /* @__PURE__ */ F(v, { daily: X }),
345
+ /* @__PURE__ */ F(h, {
346
+ title: C("mybodyshield.pages.insights.dailyBreakdown", "Daily breakdown"),
347
+ description: C("mybodyshield.pages.insights.dailyBreakdownDescription", "Per-day training, recovery and nutrition."),
348
+ children: /* @__PURE__ */ F(R, {
236
349
  treatment: "plain",
237
350
  className: "overflow-hidden p-0",
238
- children: /* @__PURE__ */ P(p, {
239
- columns: [
240
- {
241
- key: "date",
242
- header: "Date",
243
- render: (e) => /* @__PURE__ */ P("span", {
244
- className: "text-text-primary",
245
- children: r(e.date)
246
- })
247
- },
248
- {
249
- key: "sessions",
250
- header: "Sessions",
251
- align: "right",
252
- render: (e) => /* @__PURE__ */ P("span", {
253
- className: "tabular-nums text-text-secondary",
254
- children: e.sessions
255
- })
256
- },
257
- {
258
- key: "volumeKg",
259
- header: "Volume",
260
- align: "right",
261
- render: (e) => /* @__PURE__ */ P("span", {
262
- className: "tabular-nums text-text-secondary",
263
- children: l(e.volumeKg)
264
- })
265
- },
266
- {
267
- key: "readiness",
268
- header: "Readiness",
269
- align: "right",
270
- render: (e) => /* @__PURE__ */ P("span", {
271
- className: "tabular-nums text-text-secondary",
272
- children: e.readiness == null ? "—" : s(e.readiness)
273
- })
274
- },
275
- {
276
- key: "sleepHours",
277
- header: "Sleep",
278
- align: "right",
279
- render: (e) => /* @__PURE__ */ P("span", {
280
- className: "tabular-nums text-text-secondary",
281
- children: e.sleepHours == null ? "—" : `${s(e.sleepHours)} h`
282
- })
283
- },
284
- {
285
- key: "calories",
286
- header: "Calories",
287
- align: "right",
288
- render: (e) => /* @__PURE__ */ P("span", {
289
- className: "tabular-nums text-text-secondary",
290
- children: o(e.calories)
291
- })
292
- },
293
- {
294
- key: "proteinG",
295
- header: "Protein",
296
- align: "right",
297
- render: (e) => /* @__PURE__ */ P("span", {
298
- className: "tabular-nums text-text-secondary",
299
- children: a(e.proteinG)
300
- })
301
- },
302
- {
303
- key: "weight",
304
- header: "Weight",
305
- align: "right",
306
- render: (e) => /* @__PURE__ */ P("span", {
307
- className: "tabular-nums text-text-secondary",
308
- children: e.weight == null ? "—" : l(e.weight)
309
- })
310
- }
311
- ],
312
- rows: J,
351
+ children: /* @__PURE__ */ F(g, {
352
+ columns: $,
353
+ rows: X,
313
354
  rowKey: (e) => e.date,
314
355
  defaultSort: {
315
356
  key: "date",
@@ -318,64 +359,29 @@ function G() {
318
359
  })
319
360
  })
320
361
  }),
321
- /* @__PURE__ */ P(f, {
322
- title: "Active goals",
323
- description: "Goals open during this period.",
324
- children: Y.length === 0 ? /* @__PURE__ */ F(L, {
362
+ /* @__PURE__ */ F(h, {
363
+ title: C("mybodyshield.pages.insights.activeGoals", "Active goals"),
364
+ description: C("mybodyshield.pages.insights.activeGoalsDescription", "Goals open during this period."),
365
+ children: Z.length === 0 ? /* @__PURE__ */ I(R, {
325
366
  treatment: "plain",
326
367
  className: "p-8 text-center",
327
368
  children: [
328
- /* @__PURE__ */ P(j, { className: "mx-auto h-8 w-8 text-text-tertiary" }),
329
- /* @__PURE__ */ P("p", {
369
+ /* @__PURE__ */ F(M, { className: "mx-auto h-8 w-8 text-text-tertiary" }),
370
+ /* @__PURE__ */ F("p", {
330
371
  className: "mt-3 text-sm font-medium text-text-primary",
331
- children: "No active goals"
372
+ children: C("mybodyshield.pages.insights.noActiveGoals", "No active goals")
332
373
  }),
333
- /* @__PURE__ */ P("p", {
374
+ /* @__PURE__ */ F("p", {
334
375
  className: "mt-1 text-xs text-text-tertiary",
335
- children: "Create a goal to see progress here."
376
+ children: C("mybodyshield.pages.insights.noActiveGoalsDescription", "Create a goal to see progress here.")
336
377
  })
337
378
  ]
338
- }) : /* @__PURE__ */ P(L, {
379
+ }) : /* @__PURE__ */ F(R, {
339
380
  treatment: "plain",
340
381
  className: "overflow-hidden p-0",
341
- children: /* @__PURE__ */ P(p, {
342
- columns: [
343
- {
344
- key: "title",
345
- header: "Goal",
346
- render: (e) => /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("span", {
347
- className: "block text-sm text-text-primary",
348
- children: e.title
349
- }), /* @__PURE__ */ P("span", {
350
- className: "text-xs text-text-tertiary",
351
- children: i(e.type)
352
- })] })
353
- },
354
- {
355
- key: "status",
356
- header: "Status",
357
- render: (e) => /* @__PURE__ */ P("span", {
358
- className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${e.status === "ACHIEVED" ? "bg-status-success-bg text-status-success-text" : "bg-status-warning-bg text-status-warning-text"}`,
359
- children: i(e.status)
360
- })
361
- },
362
- {
363
- key: "progress",
364
- header: "Progress",
365
- align: "right",
366
- render: (e) => /* @__PURE__ */ F("span", {
367
- className: "tabular-nums text-text-secondary",
368
- children: [
369
- s(e.currentValue),
370
- " / ",
371
- s(e.targetValue),
372
- " ",
373
- e.unit
374
- ]
375
- })
376
- }
377
- ],
378
- rows: Y,
382
+ children: /* @__PURE__ */ F(g, {
383
+ columns: ee,
384
+ rows: Z,
379
385
  rowKey: (e) => e.id,
380
386
  defaultSort: {
381
387
  key: "status",
@@ -384,35 +390,35 @@ function G() {
384
390
  })
385
391
  })
386
392
  }),
387
- /* @__PURE__ */ F("div", {
393
+ /* @__PURE__ */ I("div", {
388
394
  className: "flex flex-wrap gap-4 text-xs text-text-tertiary",
389
395
  children: [
390
- /* @__PURE__ */ F("span", {
396
+ /* @__PURE__ */ I("span", {
391
397
  className: "inline-flex items-center gap-1.5",
392
- children: [/* @__PURE__ */ P(E, { className: "h-3.5 w-3.5" }), "Training data from completed sessions."]
398
+ children: [/* @__PURE__ */ F(D, { className: "h-3.5 w-3.5" }), C("mybodyshield.pages.insights.legendTraining", "Training data from completed sessions.")]
393
399
  }),
394
- /* @__PURE__ */ F("span", {
400
+ /* @__PURE__ */ I("span", {
395
401
  className: "inline-flex items-center gap-1.5",
396
- children: [/* @__PURE__ */ P(k, { className: "h-3.5 w-3.5" }), "Recovery data from recovery logs."]
402
+ children: [/* @__PURE__ */ F(A, { className: "h-3.5 w-3.5" }), C("mybodyshield.pages.insights.legendRecovery", "Recovery data from recovery logs.")]
397
403
  }),
398
- /* @__PURE__ */ F("span", {
404
+ /* @__PURE__ */ I("span", {
399
405
  className: "inline-flex items-center gap-1.5",
400
- children: [/* @__PURE__ */ P(A, { className: "h-3.5 w-3.5" }), "Body metrics from progress logs."]
406
+ children: [/* @__PURE__ */ F(j, { className: "h-3.5 w-3.5" }), C("mybodyshield.pages.insights.legendBody", "Body metrics from progress logs.")]
401
407
  }),
402
- /* @__PURE__ */ F("span", {
408
+ /* @__PURE__ */ I("span", {
403
409
  className: "inline-flex items-center gap-1.5",
404
- children: [/* @__PURE__ */ P(w, { className: "h-3.5 w-3.5" }), "Nutrition data from logged meals."]
410
+ children: [/* @__PURE__ */ F(T, { className: "h-3.5 w-3.5" }), C("mybodyshield.pages.insights.legendNutrition", "Nutrition data from logged meals.")]
405
411
  })
406
412
  ]
407
413
  }),
408
- /* @__PURE__ */ P("p", {
414
+ /* @__PURE__ */ F("p", {
409
415
  className: "mt-4 border-t border-border-seam pt-4 text-xs leading-relaxed text-text-tertiary",
410
- children: "General fitness information, not medical advice. MyBodyShield is not a medical device and does not diagnose, treat, cure or prevent any condition — talk to a qualified healthcare professional before changing how you train or eat."
416
+ children: C("mybodyshield.pages.insights.medicalDisclaimer", "General fitness information, not medical advice. MyBodyShield is not a medical device and does not diagnose, treat, cure or prevent any condition — talk to a qualified healthcare professional before changing how you train or eat.")
411
417
  })
412
418
  ]
413
419
  });
414
420
  }
415
421
  //#endregion
416
- export { G as InsightsPage };
422
+ export { K as InsightsPage };
417
423
 
418
424
  //# sourceMappingURL=InsightsPage.js.map