@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.
- package/dist/mybodyshield/MyBodyShieldRoot.d.ts.map +1 -1
- package/dist/mybodyshield/MyBodyShieldRoot.js +54 -56
- package/dist/mybodyshield/MyBodyShieldRoot.js.map +1 -1
- package/dist/mybodyshield/MyBodyShieldRoutes.d.ts.map +1 -1
- package/dist/mybodyshield/MyBodyShieldRoutes.js +121 -62
- package/dist/mybodyshield/MyBodyShieldRoutes.js.map +1 -1
- package/dist/mybodyshield/components/EvidenceUpload.d.ts.map +1 -1
- package/dist/mybodyshield/components/EvidenceUpload.js +46 -45
- package/dist/mybodyshield/components/EvidenceUpload.js.map +1 -1
- package/dist/mybodyshield/components/FileLink.d.ts.map +1 -1
- package/dist/mybodyshield/components/FileLink.js +27 -18
- package/dist/mybodyshield/components/FileLink.js.map +1 -1
- package/dist/mybodyshield/components/MybDiscussion.d.ts +1 -1
- package/dist/mybodyshield/components/MybDiscussion.d.ts.map +1 -1
- package/dist/mybodyshield/components/MybDiscussion.js +59 -58
- package/dist/mybodyshield/components/MybDiscussion.js.map +1 -1
- package/dist/mybodyshield/components/MybTags.d.ts +1 -1
- package/dist/mybodyshield/components/MybTags.d.ts.map +1 -1
- package/dist/mybodyshield/components/MybTags.js +83 -74
- package/dist/mybodyshield/components/MybTags.js.map +1 -1
- package/dist/mybodyshield/components/PageDisabled.d.ts.map +1 -1
- package/dist/mybodyshield/components/PageDisabled.js +16 -11
- package/dist/mybodyshield/components/PageDisabled.js.map +1 -1
- package/dist/mybodyshield/components/Pagination.d.ts.map +1 -1
- package/dist/mybodyshield/components/Pagination.js +36 -27
- package/dist/mybodyshield/components/Pagination.js.map +1 -1
- package/dist/mybodyshield/components/StateViews.d.ts.map +1 -1
- package/dist/mybodyshield/components/StateViews.js +42 -34
- package/dist/mybodyshield/components/StateViews.js.map +1 -1
- package/dist/mybodyshield/components/UserSearchSelect.d.ts.map +1 -1
- package/dist/mybodyshield/components/UserSearchSelect.js +66 -68
- package/dist/mybodyshield/components/UserSearchSelect.js.map +1 -1
- package/dist/mybodyshield/hooks/index.d.ts +1 -0
- package/dist/mybodyshield/hooks/index.d.ts.map +1 -1
- package/dist/mybodyshield/hooks/index.js +1 -0
- package/dist/mybodyshield/hooks/useTr.d.ts +5 -0
- package/dist/mybodyshield/hooks/useTr.d.ts.map +1 -0
- package/dist/mybodyshield/hooks/useTr.js +12 -0
- package/dist/mybodyshield/hooks/useTr.js.map +1 -0
- package/dist/mybodyshield/pages/DashboardPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/DashboardPage.js +157 -136
- package/dist/mybodyshield/pages/DashboardPage.js.map +1 -1
- package/dist/mybodyshield/pages/SettingsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/SettingsPage.js +50 -59
- package/dist/mybodyshield/pages/SettingsPage.js.map +1 -1
- package/dist/mybodyshield/pages/_shared/visuals.d.ts +2 -1
- package/dist/mybodyshield/pages/_shared/visuals.d.ts.map +1 -1
- package/dist/mybodyshield/pages/_shared/visuals.js +91 -81
- package/dist/mybodyshield/pages/_shared/visuals.js.map +1 -1
- package/dist/mybodyshield/pages/ai/AiControlsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/ai/AiControlsPage.js +255 -266
- package/dist/mybodyshield/pages/ai/AiControlsPage.js.map +1 -1
- package/dist/mybodyshield/pages/coaching/CoachingPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/coaching/CoachingPage.js +321 -301
- package/dist/mybodyshield/pages/coaching/CoachingPage.js.map +1 -1
- package/dist/mybodyshield/pages/goals/GoalsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/goals/GoalsPage.js +247 -251
- package/dist/mybodyshield/pages/goals/GoalsPage.js.map +1 -1
- package/dist/mybodyshield/pages/insights/InsightsCharts.d.ts.map +1 -1
- package/dist/mybodyshield/pages/insights/InsightsCharts.js +216 -213
- package/dist/mybodyshield/pages/insights/InsightsCharts.js.map +1 -1
- package/dist/mybodyshield/pages/insights/InsightsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/insights/InsightsPage.js +290 -284
- package/dist/mybodyshield/pages/insights/InsightsPage.js.map +1 -1
- package/dist/mybodyshield/pages/nutrition/NutritionPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/nutrition/NutritionPage.js +575 -529
- package/dist/mybodyshield/pages/nutrition/NutritionPage.js.map +1 -1
- package/dist/mybodyshield/pages/programs/ProgramDetailPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/programs/ProgramDetailPage.js +333 -275
- package/dist/mybodyshield/pages/programs/ProgramDetailPage.js.map +1 -1
- package/dist/mybodyshield/pages/programs/ProgramsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/programs/ProgramsPage.js +258 -253
- package/dist/mybodyshield/pages/programs/ProgramsPage.js.map +1 -1
- package/dist/mybodyshield/pages/progress/ProgressPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/progress/ProgressPage.js +271 -254
- package/dist/mybodyshield/pages/progress/ProgressPage.js.map +1 -1
- package/dist/mybodyshield/pages/recovery/RecoveryPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/recovery/RecoveryPage.js +206 -200
- package/dist/mybodyshield/pages/recovery/RecoveryPage.js.map +1 -1
- package/dist/mybodyshield/pages/train/SessionDetailPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/train/SessionDetailPage.js +327 -294
- package/dist/mybodyshield/pages/train/SessionDetailPage.js.map +1 -1
- package/dist/mybodyshield/pages/train/SessionsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/train/SessionsPage.js +180 -163
- package/dist/mybodyshield/pages/train/SessionsPage.js.map +1 -1
- package/dist/mybodyshield/utils/i18n.d.ts +1 -2
- package/dist/mybodyshield/utils/i18n.d.ts.map +1 -1
- package/dist/mybodyshield/utils/i18n.js +15 -0
- package/dist/mybodyshield/utils/i18n.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { cn as e } from "../../utils/cn.js";
|
|
2
2
|
import { formatDate as t, formatGrams as n, formatKcal as r, formatNumber as i, formatWeight as a } from "../../utils/formatters.js";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
3
|
+
import { useTr as o } from "../../hooks/useTr.js";
|
|
4
|
+
import "../../hooks/index.js";
|
|
5
|
+
import { IconChip as s, MACRO_HUE as c } from "../_shared/visuals.js";
|
|
6
|
+
import { Legend as l } from "../../../node_modules/recharts/es6/component/Legend.js";
|
|
7
|
+
import { Tooltip as u } from "../../../node_modules/recharts/es6/component/Tooltip.js";
|
|
8
|
+
import { ResponsiveContainer as d } from "../../../node_modules/recharts/es6/component/ResponsiveContainer.js";
|
|
9
|
+
import { Bar as f } from "../../../node_modules/recharts/es6/cartesian/Bar.js";
|
|
10
|
+
import { CartesianGrid as p } from "../../../node_modules/recharts/es6/cartesian/CartesianGrid.js";
|
|
11
|
+
import { Line as m } from "../../../node_modules/recharts/es6/cartesian/Line.js";
|
|
12
|
+
import { Area as h } from "../../../node_modules/recharts/es6/cartesian/Area.js";
|
|
13
|
+
import { XAxis as g } from "../../../node_modules/recharts/es6/cartesian/XAxis.js";
|
|
14
|
+
import { YAxis as _ } from "../../../node_modules/recharts/es6/cartesian/YAxis.js";
|
|
15
|
+
import { BarChart as v } from "../../../node_modules/recharts/es6/chart/BarChart.js";
|
|
16
|
+
import { ComposedChart as y } from "../../../node_modules/recharts/es6/chart/ComposedChart.js";
|
|
17
|
+
import { useMemo as b } from "react";
|
|
18
|
+
import { Activity as x, Dumbbell as S, HeartPulse as C, Moon as w, Scale as T, Utensils as E } from "lucide-react";
|
|
19
|
+
import { jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
20
|
+
import { GlassCard as k } from "@burdenoff/fe-libs/ui";
|
|
19
21
|
//#region src/mybodyshield/pages/insights/InsightsCharts.tsx
|
|
20
|
-
var
|
|
22
|
+
var A = {
|
|
21
23
|
primary: "var(--color-action-primary-bg)",
|
|
22
24
|
secondary: "var(--color-accent-primary)",
|
|
23
25
|
success: "var(--color-status-success-text)",
|
|
@@ -27,21 +29,21 @@ var k = {
|
|
|
27
29
|
chart2: "var(--color-chart-2)",
|
|
28
30
|
chart3: "var(--color-chart-3)",
|
|
29
31
|
chart4: "var(--color-chart-4)"
|
|
30
|
-
},
|
|
32
|
+
}, j = {
|
|
31
33
|
background: "var(--color-bg-surface)",
|
|
32
34
|
border: "1px solid var(--color-border-seam)",
|
|
33
35
|
borderRadius: 12,
|
|
34
36
|
color: "var(--color-text-primary)",
|
|
35
37
|
fontSize: 12
|
|
36
|
-
},
|
|
38
|
+
}, M = {
|
|
37
39
|
stroke: "var(--color-border-seam)",
|
|
38
40
|
strokeDasharray: "4 4"
|
|
39
|
-
},
|
|
41
|
+
}, N = {
|
|
40
42
|
fill: "var(--color-text-tertiary)",
|
|
41
43
|
fontSize: 12
|
|
42
44
|
};
|
|
43
|
-
function
|
|
44
|
-
return
|
|
45
|
+
function P(e) {
|
|
46
|
+
return b(() => [...e].sort((e, t) => new Date(e.date).getTime() - new Date(t.date).getTime()).map((e) => ({
|
|
45
47
|
label: t(e.date),
|
|
46
48
|
date: e.date,
|
|
47
49
|
sessions: e.sessions,
|
|
@@ -55,49 +57,49 @@ function N(e) {
|
|
|
55
57
|
weight: e.weight ?? null
|
|
56
58
|
})), [e]);
|
|
57
59
|
}
|
|
58
|
-
function
|
|
59
|
-
return /* @__PURE__ */
|
|
60
|
+
function F({ message: e = "No data for the selected range" }) {
|
|
61
|
+
return /* @__PURE__ */ O("div", {
|
|
60
62
|
className: "flex h-[240px] flex-col items-center justify-center gap-2 text-center",
|
|
61
|
-
children: [/* @__PURE__ */
|
|
63
|
+
children: [/* @__PURE__ */ D(x, { className: "h-8 w-8 text-text-tertiary" }), /* @__PURE__ */ D("p", {
|
|
62
64
|
className: "text-sm text-text-secondary",
|
|
63
65
|
children: e
|
|
64
66
|
})]
|
|
65
67
|
});
|
|
66
68
|
}
|
|
67
|
-
function
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
+
function I({ title: t, icon: n, children: r, className: i }) {
|
|
70
|
+
return /* @__PURE__ */ O(k, {
|
|
69
71
|
treatment: "plain",
|
|
70
72
|
className: e("overflow-hidden p-5", i),
|
|
71
|
-
children: [/* @__PURE__ */
|
|
73
|
+
children: [/* @__PURE__ */ O("div", {
|
|
72
74
|
className: "mb-4 flex items-center gap-2.5",
|
|
73
|
-
children: [n, /* @__PURE__ */
|
|
75
|
+
children: [n, /* @__PURE__ */ D("h3", {
|
|
74
76
|
className: "text-sm font-semibold text-text-primary",
|
|
75
77
|
children: t
|
|
76
78
|
})]
|
|
77
79
|
}), r]
|
|
78
80
|
});
|
|
79
81
|
}
|
|
80
|
-
function
|
|
81
|
-
let t =
|
|
82
|
-
return t.length === 0 ? /* @__PURE__ */
|
|
83
|
-
title: "Training volume",
|
|
84
|
-
icon: /* @__PURE__ */
|
|
85
|
-
icon: /* @__PURE__ */
|
|
86
|
-
tint:
|
|
82
|
+
function L({ daily: e }) {
|
|
83
|
+
let t = P(e), n = o();
|
|
84
|
+
return t.length === 0 ? /* @__PURE__ */ D(I, {
|
|
85
|
+
title: n("mybodyshield.pages.insights.volumeChartTitle", "Training volume"),
|
|
86
|
+
icon: /* @__PURE__ */ D(s, {
|
|
87
|
+
icon: /* @__PURE__ */ D(S, { className: "h-4 w-4" }),
|
|
88
|
+
tint: A.primary
|
|
87
89
|
}),
|
|
88
|
-
children: /* @__PURE__ */
|
|
89
|
-
}) : /* @__PURE__ */
|
|
90
|
-
title: "Training volume",
|
|
91
|
-
icon: /* @__PURE__ */
|
|
92
|
-
icon: /* @__PURE__ */
|
|
93
|
-
tint:
|
|
90
|
+
children: /* @__PURE__ */ D(F, { message: n("mybodyshield.pages.insights.volumeChartEmpty", "Log completed sessions to see volume trends.") })
|
|
91
|
+
}) : /* @__PURE__ */ D(I, {
|
|
92
|
+
title: n("mybodyshield.pages.insights.volumeChartTitle", "Training volume"),
|
|
93
|
+
icon: /* @__PURE__ */ D(s, {
|
|
94
|
+
icon: /* @__PURE__ */ D(S, { className: "h-4 w-4" }),
|
|
95
|
+
tint: A.primary
|
|
94
96
|
}),
|
|
95
|
-
children: /* @__PURE__ */
|
|
97
|
+
children: /* @__PURE__ */ D("div", {
|
|
96
98
|
className: "h-[260px] w-full",
|
|
97
|
-
children: /* @__PURE__ */
|
|
99
|
+
children: /* @__PURE__ */ D(d, {
|
|
98
100
|
width: "100%",
|
|
99
101
|
height: "100%",
|
|
100
|
-
children: /* @__PURE__ */
|
|
102
|
+
children: /* @__PURE__ */ O(y, {
|
|
101
103
|
data: t,
|
|
102
104
|
margin: {
|
|
103
105
|
top: 4,
|
|
@@ -106,49 +108,49 @@ function I({ daily: e }) {
|
|
|
106
108
|
left: 4
|
|
107
109
|
},
|
|
108
110
|
children: [
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
...
|
|
111
|
+
/* @__PURE__ */ D(p, {
|
|
112
|
+
...M,
|
|
111
113
|
vertical: !1
|
|
112
114
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ D(g, {
|
|
114
116
|
dataKey: "label",
|
|
115
117
|
tickLine: !1,
|
|
116
118
|
axisLine: !1,
|
|
117
|
-
tick:
|
|
119
|
+
tick: N,
|
|
118
120
|
tickMargin: 8,
|
|
119
121
|
minTickGap: 24
|
|
120
122
|
}),
|
|
121
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ D(_, {
|
|
122
124
|
yAxisId: "left",
|
|
123
125
|
tickLine: !1,
|
|
124
126
|
axisLine: !1,
|
|
125
|
-
tick:
|
|
127
|
+
tick: N,
|
|
126
128
|
width: 52,
|
|
127
129
|
tickFormatter: (e) => a(Number(e))
|
|
128
130
|
}),
|
|
129
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ D(_, {
|
|
130
132
|
yAxisId: "right",
|
|
131
133
|
orientation: "right",
|
|
132
134
|
tickLine: !1,
|
|
133
135
|
axisLine: !1,
|
|
134
|
-
tick:
|
|
136
|
+
tick: N,
|
|
135
137
|
width: 36,
|
|
136
138
|
allowDecimals: !1
|
|
137
139
|
}),
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
contentStyle:
|
|
140
|
+
/* @__PURE__ */ D(u, {
|
|
141
|
+
contentStyle: j,
|
|
140
142
|
labelStyle: { color: "var(--color-text-tertiary)" },
|
|
141
|
-
formatter: (e, t) =>
|
|
143
|
+
formatter: (e, t, n) => n.dataKey === "volumeKg" ? [a(Number(e)), t] : [i(Number(e)), t]
|
|
142
144
|
}),
|
|
143
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ D(l, { wrapperStyle: {
|
|
144
146
|
fontSize: 12,
|
|
145
147
|
paddingTop: 8
|
|
146
148
|
} }),
|
|
147
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ D(f, {
|
|
148
150
|
yAxisId: "left",
|
|
149
151
|
dataKey: "volumeKg",
|
|
150
|
-
name: "Volume",
|
|
151
|
-
fill:
|
|
152
|
+
name: n("mybodyshield.common.volume", "Volume"),
|
|
153
|
+
fill: A.primary,
|
|
152
154
|
radius: [
|
|
153
155
|
4,
|
|
154
156
|
4,
|
|
@@ -157,12 +159,12 @@ function I({ daily: e }) {
|
|
|
157
159
|
],
|
|
158
160
|
opacity: .85
|
|
159
161
|
}),
|
|
160
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ D(m, {
|
|
161
163
|
yAxisId: "right",
|
|
162
164
|
type: "monotone",
|
|
163
165
|
dataKey: "sessions",
|
|
164
|
-
name: "Sessions",
|
|
165
|
-
stroke:
|
|
166
|
+
name: n("mybodyshield.common.sessions", "Sessions"),
|
|
167
|
+
stroke: A.secondary,
|
|
166
168
|
strokeWidth: 2.5,
|
|
167
169
|
dot: !1,
|
|
168
170
|
activeDot: {
|
|
@@ -177,20 +179,20 @@ function I({ daily: e }) {
|
|
|
177
179
|
})
|
|
178
180
|
});
|
|
179
181
|
}
|
|
180
|
-
function
|
|
181
|
-
let t =
|
|
182
|
-
return t.some((e) => e.readiness != null || e.sleepHours != null) ? /* @__PURE__ */
|
|
183
|
-
title: "Recovery & sleep",
|
|
184
|
-
icon: /* @__PURE__ */
|
|
185
|
-
icon: /* @__PURE__ */
|
|
186
|
-
tint:
|
|
182
|
+
function R({ daily: e }) {
|
|
183
|
+
let t = P(e), n = o();
|
|
184
|
+
return t.some((e) => e.readiness != null || e.sleepHours != null) ? /* @__PURE__ */ D(I, {
|
|
185
|
+
title: n("mybodyshield.pages.insights.readinessSleepChartTitle", "Recovery & sleep"),
|
|
186
|
+
icon: /* @__PURE__ */ D(s, {
|
|
187
|
+
icon: /* @__PURE__ */ D(C, { className: "h-4 w-4" }),
|
|
188
|
+
tint: A.success
|
|
187
189
|
}),
|
|
188
|
-
children: /* @__PURE__ */
|
|
190
|
+
children: /* @__PURE__ */ D("div", {
|
|
189
191
|
className: "h-[260px] w-full",
|
|
190
|
-
children: /* @__PURE__ */
|
|
192
|
+
children: /* @__PURE__ */ D(d, {
|
|
191
193
|
width: "100%",
|
|
192
194
|
height: "100%",
|
|
193
|
-
children: /* @__PURE__ */
|
|
195
|
+
children: /* @__PURE__ */ O(y, {
|
|
194
196
|
data: t,
|
|
195
197
|
margin: {
|
|
196
198
|
top: 4,
|
|
@@ -199,54 +201,54 @@ function L({ daily: e }) {
|
|
|
199
201
|
left: 4
|
|
200
202
|
},
|
|
201
203
|
children: [
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
-
...
|
|
204
|
+
/* @__PURE__ */ D(p, {
|
|
205
|
+
...M,
|
|
204
206
|
vertical: !1
|
|
205
207
|
}),
|
|
206
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ D(g, {
|
|
207
209
|
dataKey: "label",
|
|
208
210
|
tickLine: !1,
|
|
209
211
|
axisLine: !1,
|
|
210
|
-
tick:
|
|
212
|
+
tick: N,
|
|
211
213
|
tickMargin: 8,
|
|
212
214
|
minTickGap: 24
|
|
213
215
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ D(_, {
|
|
215
217
|
yAxisId: "left",
|
|
216
218
|
tickLine: !1,
|
|
217
219
|
axisLine: !1,
|
|
218
|
-
tick:
|
|
220
|
+
tick: N,
|
|
219
221
|
width: 36,
|
|
220
222
|
domain: [0, 100],
|
|
221
223
|
hide: !t.some((e) => e.readiness != null)
|
|
222
224
|
}),
|
|
223
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ D(_, {
|
|
224
226
|
yAxisId: "right",
|
|
225
227
|
orientation: "right",
|
|
226
228
|
tickLine: !1,
|
|
227
229
|
axisLine: !1,
|
|
228
|
-
tick:
|
|
230
|
+
tick: N,
|
|
229
231
|
width: 44,
|
|
230
232
|
tickFormatter: (e) => `${i(Number(e))} h`,
|
|
231
233
|
hide: !t.some((e) => e.sleepHours != null)
|
|
232
234
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
contentStyle:
|
|
235
|
+
/* @__PURE__ */ D(u, {
|
|
236
|
+
contentStyle: j,
|
|
235
237
|
labelStyle: { color: "var(--color-text-tertiary)" },
|
|
236
|
-
formatter: (e, t) =>
|
|
238
|
+
formatter: (e, t, n) => n.dataKey === "readiness" ? [i(Number(e)), t] : [`${i(Number(e))} h`, t]
|
|
237
239
|
}),
|
|
238
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ D(l, { wrapperStyle: {
|
|
239
241
|
fontSize: 12,
|
|
240
242
|
paddingTop: 8
|
|
241
243
|
} }),
|
|
242
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ D(h, {
|
|
243
245
|
yAxisId: "right",
|
|
244
246
|
type: "monotone",
|
|
245
247
|
dataKey: "sleepHours",
|
|
246
|
-
name: "Sleep",
|
|
247
|
-
stroke:
|
|
248
|
+
name: n("mybodyshield.common.sleep", "Sleep"),
|
|
249
|
+
stroke: A.secondary,
|
|
248
250
|
strokeWidth: 2,
|
|
249
|
-
fill:
|
|
251
|
+
fill: A.secondary,
|
|
250
252
|
fillOpacity: .12,
|
|
251
253
|
dot: !1,
|
|
252
254
|
activeDot: {
|
|
@@ -256,12 +258,12 @@ function L({ daily: e }) {
|
|
|
256
258
|
},
|
|
257
259
|
connectNulls: !0
|
|
258
260
|
}),
|
|
259
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ D(m, {
|
|
260
262
|
yAxisId: "left",
|
|
261
263
|
type: "monotone",
|
|
262
264
|
dataKey: "readiness",
|
|
263
|
-
name: "Readiness",
|
|
264
|
-
stroke:
|
|
265
|
+
name: n("mybodyshield.common.readiness", "Readiness"),
|
|
266
|
+
stroke: A.success,
|
|
265
267
|
strokeWidth: 2.5,
|
|
266
268
|
dot: !1,
|
|
267
269
|
activeDot: {
|
|
@@ -275,36 +277,36 @@ function L({ daily: e }) {
|
|
|
275
277
|
})
|
|
276
278
|
})
|
|
277
279
|
})
|
|
278
|
-
}) : /* @__PURE__ */
|
|
279
|
-
title: "Recovery & sleep",
|
|
280
|
-
icon: /* @__PURE__ */
|
|
281
|
-
icon: /* @__PURE__ */
|
|
282
|
-
tint:
|
|
280
|
+
}) : /* @__PURE__ */ D(I, {
|
|
281
|
+
title: n("mybodyshield.pages.insights.readinessSleepChartTitle", "Recovery & sleep"),
|
|
282
|
+
icon: /* @__PURE__ */ D(s, {
|
|
283
|
+
icon: /* @__PURE__ */ D(C, { className: "h-4 w-4" }),
|
|
284
|
+
tint: A.success
|
|
283
285
|
}),
|
|
284
|
-
children: /* @__PURE__ */
|
|
286
|
+
children: /* @__PURE__ */ D(F, { message: n("mybodyshield.pages.insights.readinessSleepChartEmpty", "Log recovery entries to see readiness and sleep trends.") })
|
|
285
287
|
});
|
|
286
288
|
}
|
|
287
|
-
function
|
|
288
|
-
let t =
|
|
289
|
-
return t.length === 0 ? /* @__PURE__ */
|
|
290
|
-
title: "Macro adherence",
|
|
291
|
-
icon: /* @__PURE__ */
|
|
292
|
-
icon: /* @__PURE__ */ E
|
|
293
|
-
tint:
|
|
289
|
+
function z({ daily: e }) {
|
|
290
|
+
let t = P(e), r = o();
|
|
291
|
+
return t.length === 0 ? /* @__PURE__ */ D(I, {
|
|
292
|
+
title: r("mybodyshield.pages.insights.macroChartTitle", "Macro adherence"),
|
|
293
|
+
icon: /* @__PURE__ */ D(s, {
|
|
294
|
+
icon: /* @__PURE__ */ D(E, { className: "h-4 w-4" }),
|
|
295
|
+
tint: A.warning
|
|
294
296
|
}),
|
|
295
|
-
children: /* @__PURE__ */
|
|
296
|
-
}) : /* @__PURE__ */
|
|
297
|
-
title: "Macro adherence",
|
|
298
|
-
icon: /* @__PURE__ */
|
|
299
|
-
icon: /* @__PURE__ */ E
|
|
300
|
-
tint:
|
|
297
|
+
children: /* @__PURE__ */ D(F, { message: r("mybodyshield.pages.insights.macroChartEmpty", "Log meals to see macro trends.") })
|
|
298
|
+
}) : /* @__PURE__ */ D(I, {
|
|
299
|
+
title: r("mybodyshield.pages.insights.macroChartTitle", "Macro adherence"),
|
|
300
|
+
icon: /* @__PURE__ */ D(s, {
|
|
301
|
+
icon: /* @__PURE__ */ D(E, { className: "h-4 w-4" }),
|
|
302
|
+
tint: A.warning
|
|
301
303
|
}),
|
|
302
|
-
children: /* @__PURE__ */
|
|
304
|
+
children: /* @__PURE__ */ D("div", {
|
|
303
305
|
className: "h-[260px] w-full",
|
|
304
|
-
children: /* @__PURE__ */
|
|
306
|
+
children: /* @__PURE__ */ D(d, {
|
|
305
307
|
width: "100%",
|
|
306
308
|
height: "100%",
|
|
307
|
-
children: /* @__PURE__ */
|
|
309
|
+
children: /* @__PURE__ */ O(v, {
|
|
308
310
|
data: t,
|
|
309
311
|
margin: {
|
|
310
312
|
top: 4,
|
|
@@ -313,51 +315,51 @@ function R({ daily: e }) {
|
|
|
313
315
|
left: 4
|
|
314
316
|
},
|
|
315
317
|
children: [
|
|
316
|
-
/* @__PURE__ */
|
|
317
|
-
...
|
|
318
|
+
/* @__PURE__ */ D(p, {
|
|
319
|
+
...M,
|
|
318
320
|
vertical: !1
|
|
319
321
|
}),
|
|
320
|
-
/* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ D(g, {
|
|
321
323
|
dataKey: "label",
|
|
322
324
|
tickLine: !1,
|
|
323
325
|
axisLine: !1,
|
|
324
|
-
tick:
|
|
326
|
+
tick: N,
|
|
325
327
|
tickMargin: 8,
|
|
326
328
|
minTickGap: 24
|
|
327
329
|
}),
|
|
328
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ D(_, {
|
|
329
331
|
tickLine: !1,
|
|
330
332
|
axisLine: !1,
|
|
331
|
-
tick:
|
|
333
|
+
tick: N,
|
|
332
334
|
width: 44,
|
|
333
335
|
tickFormatter: (e) => n(Number(e))
|
|
334
336
|
}),
|
|
335
|
-
/* @__PURE__ */
|
|
336
|
-
contentStyle:
|
|
337
|
+
/* @__PURE__ */ D(u, {
|
|
338
|
+
contentStyle: j,
|
|
337
339
|
labelStyle: { color: "var(--color-text-tertiary)" },
|
|
338
340
|
formatter: (e, t) => [n(Number(e)), t]
|
|
339
341
|
}),
|
|
340
|
-
/* @__PURE__ */
|
|
342
|
+
/* @__PURE__ */ D(l, { wrapperStyle: {
|
|
341
343
|
fontSize: 12,
|
|
342
344
|
paddingTop: 8
|
|
343
345
|
} }),
|
|
344
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ D(f, {
|
|
345
347
|
dataKey: "proteinG",
|
|
346
|
-
name: "Protein",
|
|
348
|
+
name: r("mybodyshield.common.protein", "Protein"),
|
|
347
349
|
stackId: "macros",
|
|
348
|
-
fill:
|
|
350
|
+
fill: c.protein
|
|
349
351
|
}),
|
|
350
|
-
/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */ D(f, {
|
|
351
353
|
dataKey: "carbsG",
|
|
352
|
-
name: "Carbs",
|
|
354
|
+
name: r("mybodyshield.common.carbs", "Carbs"),
|
|
353
355
|
stackId: "macros",
|
|
354
|
-
fill:
|
|
356
|
+
fill: c.carbs
|
|
355
357
|
}),
|
|
356
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ D(f, {
|
|
357
359
|
dataKey: "fatG",
|
|
358
|
-
name: "Fat",
|
|
360
|
+
name: r("mybodyshield.common.fat", "Fat"),
|
|
359
361
|
stackId: "macros",
|
|
360
|
-
fill:
|
|
362
|
+
fill: c.fat
|
|
361
363
|
})
|
|
362
364
|
]
|
|
363
365
|
})
|
|
@@ -365,27 +367,27 @@ function R({ daily: e }) {
|
|
|
365
367
|
})
|
|
366
368
|
});
|
|
367
369
|
}
|
|
368
|
-
function
|
|
369
|
-
let t =
|
|
370
|
-
return t.length === 0 ? /* @__PURE__ */
|
|
371
|
-
title: "Calorie trend",
|
|
372
|
-
icon: /* @__PURE__ */
|
|
373
|
-
icon: /* @__PURE__ */
|
|
374
|
-
tint:
|
|
370
|
+
function B({ daily: e }) {
|
|
371
|
+
let t = P(e), n = o();
|
|
372
|
+
return t.length === 0 ? /* @__PURE__ */ D(I, {
|
|
373
|
+
title: n("mybodyshield.pages.insights.calorieChartTitle", "Calorie trend"),
|
|
374
|
+
icon: /* @__PURE__ */ D(s, {
|
|
375
|
+
icon: /* @__PURE__ */ D(T, { className: "h-4 w-4" }),
|
|
376
|
+
tint: A.chart1
|
|
375
377
|
}),
|
|
376
|
-
children: /* @__PURE__ */
|
|
377
|
-
}) : /* @__PURE__ */
|
|
378
|
-
title: "Calorie trend",
|
|
379
|
-
icon: /* @__PURE__ */
|
|
380
|
-
icon: /* @__PURE__ */
|
|
381
|
-
tint:
|
|
378
|
+
children: /* @__PURE__ */ D(F, { message: n("mybodyshield.pages.insights.calorieChartEmpty", "Log meals to see calorie trends.") })
|
|
379
|
+
}) : /* @__PURE__ */ D(I, {
|
|
380
|
+
title: n("mybodyshield.pages.insights.calorieChartTitle", "Calorie trend"),
|
|
381
|
+
icon: /* @__PURE__ */ D(s, {
|
|
382
|
+
icon: /* @__PURE__ */ D(T, { className: "h-4 w-4" }),
|
|
383
|
+
tint: A.chart1
|
|
382
384
|
}),
|
|
383
|
-
children: /* @__PURE__ */
|
|
385
|
+
children: /* @__PURE__ */ D("div", {
|
|
384
386
|
className: "h-[260px] w-full",
|
|
385
|
-
children: /* @__PURE__ */
|
|
387
|
+
children: /* @__PURE__ */ D(d, {
|
|
386
388
|
width: "100%",
|
|
387
389
|
height: "100%",
|
|
388
|
-
children: /* @__PURE__ */
|
|
390
|
+
children: /* @__PURE__ */ O(y, {
|
|
389
391
|
data: t,
|
|
390
392
|
margin: {
|
|
391
393
|
top: 4,
|
|
@@ -394,37 +396,37 @@ function z({ daily: e }) {
|
|
|
394
396
|
left: 4
|
|
395
397
|
},
|
|
396
398
|
children: [
|
|
397
|
-
/* @__PURE__ */
|
|
398
|
-
...
|
|
399
|
+
/* @__PURE__ */ D(p, {
|
|
400
|
+
...M,
|
|
399
401
|
vertical: !1
|
|
400
402
|
}),
|
|
401
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ D(g, {
|
|
402
404
|
dataKey: "label",
|
|
403
405
|
tickLine: !1,
|
|
404
406
|
axisLine: !1,
|
|
405
|
-
tick:
|
|
407
|
+
tick: N,
|
|
406
408
|
tickMargin: 8,
|
|
407
409
|
minTickGap: 24
|
|
408
410
|
}),
|
|
409
|
-
/* @__PURE__ */
|
|
411
|
+
/* @__PURE__ */ D(_, {
|
|
410
412
|
tickLine: !1,
|
|
411
413
|
axisLine: !1,
|
|
412
|
-
tick:
|
|
414
|
+
tick: N,
|
|
413
415
|
width: 52,
|
|
414
416
|
tickFormatter: (e) => r(Number(e))
|
|
415
417
|
}),
|
|
416
|
-
/* @__PURE__ */
|
|
417
|
-
contentStyle:
|
|
418
|
+
/* @__PURE__ */ D(u, {
|
|
419
|
+
contentStyle: j,
|
|
418
420
|
labelStyle: { color: "var(--color-text-tertiary)" },
|
|
419
|
-
formatter: (e) => [r(Number(e)),
|
|
421
|
+
formatter: (e, t) => [r(Number(e)), t]
|
|
420
422
|
}),
|
|
421
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ D(h, {
|
|
422
424
|
type: "monotone",
|
|
423
425
|
dataKey: "calories",
|
|
424
|
-
name: "Calories",
|
|
425
|
-
stroke:
|
|
426
|
+
name: n("mybodyshield.common.calories", "Calories"),
|
|
427
|
+
stroke: A.chart1,
|
|
426
428
|
strokeWidth: 2,
|
|
427
|
-
fill:
|
|
429
|
+
fill: A.chart1,
|
|
428
430
|
fillOpacity: .12,
|
|
429
431
|
dot: !1,
|
|
430
432
|
activeDot: {
|
|
@@ -439,7 +441,7 @@ function z({ daily: e }) {
|
|
|
439
441
|
})
|
|
440
442
|
});
|
|
441
443
|
}
|
|
442
|
-
function
|
|
444
|
+
function V(e, t) {
|
|
443
445
|
let n = e.map((e, n) => [e, t[n]]).filter(([e, t]) => e != null && t != null);
|
|
444
446
|
if (n.length < 3) return {
|
|
445
447
|
r: null,
|
|
@@ -454,96 +456,97 @@ function B(e, t) {
|
|
|
454
456
|
n: r
|
|
455
457
|
};
|
|
456
458
|
}
|
|
457
|
-
function
|
|
458
|
-
return
|
|
459
|
-
let t = e.map((e) => e.readiness ?? null), n = e.map((e) => e.sleepHours ?? null), r = e.map((e) => e.volumeKg), i = e.map((e) => e.sessions), a = e.map((e) => e.proteinG), o = e.map((e) => e.calories), s = (e, t, n, r, i) => {
|
|
460
|
-
let { r:
|
|
459
|
+
function H(e) {
|
|
460
|
+
return b(() => {
|
|
461
|
+
let t = e.map((e) => e.readiness ?? null), n = e.map((e) => e.sleepHours ?? null), r = e.map((e) => e.volumeKg), i = e.map((e) => e.sessions), a = e.map((e) => e.proteinG), o = e.map((e) => e.calories), s = (e, t, n, r, i, a) => {
|
|
462
|
+
let { r: o, n: s } = V(i, a);
|
|
461
463
|
return {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
464
|
+
labelKey: e,
|
|
465
|
+
labelFallback: t,
|
|
466
|
+
x: n,
|
|
467
|
+
y: r,
|
|
468
|
+
r: o,
|
|
469
|
+
n: s
|
|
467
470
|
};
|
|
468
471
|
};
|
|
469
472
|
return [
|
|
470
|
-
s("Sleep → Readiness", "Sleep", "Readiness", n, t),
|
|
471
|
-
s("Volume → Readiness", "Volume", "Readiness", r, t),
|
|
472
|
-
s("Sessions → Sleep", "Sessions", "Sleep", i, n),
|
|
473
|
-
s("Protein → Readiness", "Protein", "Readiness", a, t),
|
|
474
|
-
s("Calories → Volume", "Calories", "Volume", o, r)
|
|
473
|
+
s("mybodyshield.pages.insights.correlationSleepReadiness", "Sleep → Readiness", "Sleep", "Readiness", n, t),
|
|
474
|
+
s("mybodyshield.pages.insights.correlationVolumeReadiness", "Volume → Readiness", "Volume", "Readiness", r, t),
|
|
475
|
+
s("mybodyshield.pages.insights.correlationSessionsSleep", "Sessions → Sleep", "Sessions", "Sleep", i, n),
|
|
476
|
+
s("mybodyshield.pages.insights.correlationProteinReadiness", "Protein → Readiness", "Protein", "Readiness", a, t),
|
|
477
|
+
s("mybodyshield.pages.insights.correlationCaloriesVolume", "Calories → Volume", "Calories", "Volume", o, r)
|
|
475
478
|
];
|
|
476
479
|
}, [e]);
|
|
477
480
|
}
|
|
478
|
-
function
|
|
479
|
-
let
|
|
480
|
-
return
|
|
481
|
+
function U(e, t) {
|
|
482
|
+
let n = Math.abs(e);
|
|
483
|
+
return n >= .7 ? t("mybodyshield.pages.insights.correlationStrong", "Strong") : n >= .4 ? t("mybodyshield.pages.insights.correlationModerate", "Moderate") : n >= .2 ? t("mybodyshield.pages.insights.correlationWeak", "Weak") : t("mybodyshield.pages.insights.correlationNone", "None");
|
|
481
484
|
}
|
|
482
|
-
function
|
|
485
|
+
function W(e) {
|
|
483
486
|
return e > 0 ? "var(--color-status-success-text)" : e < 0 ? "var(--color-status-error-text)" : "var(--color-text-tertiary)";
|
|
484
487
|
}
|
|
485
|
-
function
|
|
486
|
-
let t =
|
|
487
|
-
return
|
|
488
|
+
function G({ daily: e }) {
|
|
489
|
+
let t = o(), n = H(e).filter((e) => e.r != null);
|
|
490
|
+
return n.length === 0 ? /* @__PURE__ */ O(k, {
|
|
488
491
|
treatment: "plain",
|
|
489
492
|
className: "p-6",
|
|
490
|
-
children: [/* @__PURE__ */
|
|
493
|
+
children: [/* @__PURE__ */ O("div", {
|
|
491
494
|
className: "flex items-center gap-2.5",
|
|
492
|
-
children: [/* @__PURE__ */
|
|
493
|
-
icon: /* @__PURE__ */
|
|
494
|
-
tint:
|
|
495
|
-
}), /* @__PURE__ */
|
|
495
|
+
children: [/* @__PURE__ */ D(s, {
|
|
496
|
+
icon: /* @__PURE__ */ D(w, { className: "h-4 w-4" }),
|
|
497
|
+
tint: A.secondary
|
|
498
|
+
}), /* @__PURE__ */ D("h3", {
|
|
496
499
|
className: "text-sm font-semibold text-text-primary",
|
|
497
|
-
children: "Correlations"
|
|
500
|
+
children: t("mybodyshield.pages.insights.correlationsTitle", "Correlations")
|
|
498
501
|
})]
|
|
499
|
-
}), /* @__PURE__ */
|
|
502
|
+
}), /* @__PURE__ */ D("p", {
|
|
500
503
|
className: "mt-3 text-sm text-text-secondary",
|
|
501
|
-
children: "Log a few more recovery, training and nutrition days to surface correlations."
|
|
504
|
+
children: t("mybodyshield.pages.insights.correlationsEmpty", "Log a few more recovery, training and nutrition days to surface correlations.")
|
|
502
505
|
})]
|
|
503
|
-
}) : /* @__PURE__ */
|
|
506
|
+
}) : /* @__PURE__ */ O(k, {
|
|
504
507
|
treatment: "plain",
|
|
505
508
|
className: "overflow-hidden p-0",
|
|
506
|
-
children: [/* @__PURE__ */
|
|
509
|
+
children: [/* @__PURE__ */ O("div", {
|
|
507
510
|
className: "border-b border-border-seam px-5 py-4",
|
|
508
|
-
children: [/* @__PURE__ */
|
|
511
|
+
children: [/* @__PURE__ */ O("div", {
|
|
509
512
|
className: "flex items-center gap-2.5",
|
|
510
|
-
children: [/* @__PURE__ */
|
|
511
|
-
icon: /* @__PURE__ */
|
|
512
|
-
tint:
|
|
513
|
-
}), /* @__PURE__ */
|
|
513
|
+
children: [/* @__PURE__ */ D(s, {
|
|
514
|
+
icon: /* @__PURE__ */ D(w, { className: "h-4 w-4" }),
|
|
515
|
+
tint: A.secondary
|
|
516
|
+
}), /* @__PURE__ */ D("h3", {
|
|
514
517
|
className: "text-sm font-semibold text-text-primary",
|
|
515
|
-
children: "Correlations"
|
|
518
|
+
children: t("mybodyshield.pages.insights.correlationsTitle", "Correlations")
|
|
516
519
|
})]
|
|
517
|
-
}), /* @__PURE__ */
|
|
520
|
+
}), /* @__PURE__ */ D("p", {
|
|
518
521
|
className: "mt-1 text-xs text-text-secondary",
|
|
519
|
-
children: "Pearson correlation across the selected range. More data gives more reliable signals."
|
|
522
|
+
children: t("mybodyshield.pages.insights.correlationsSubtitle", "Pearson correlation across the selected range. More data gives more reliable signals.")
|
|
520
523
|
})]
|
|
521
|
-
}), /* @__PURE__ */
|
|
524
|
+
}), /* @__PURE__ */ D("div", {
|
|
522
525
|
className: "divide-y divide-border-seam/60",
|
|
523
|
-
children:
|
|
526
|
+
children: n.map((e) => /* @__PURE__ */ O("div", {
|
|
524
527
|
className: "flex items-center justify-between px-5 py-3",
|
|
525
|
-
children: [/* @__PURE__ */
|
|
528
|
+
children: [/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
526
529
|
className: "text-sm font-medium text-text-primary",
|
|
527
|
-
children: e.
|
|
530
|
+
children: t(e.labelKey, e.labelFallback)
|
|
528
531
|
}), /* @__PURE__ */ D("p", {
|
|
529
532
|
className: "text-xs text-text-tertiary",
|
|
530
|
-
children:
|
|
531
|
-
})] }), /* @__PURE__ */
|
|
533
|
+
children: t("mybodyshield.pages.insights.correlationDaysWithMetrics", "{{count}} days with both metrics", { count: e.n })
|
|
534
|
+
})] }), /* @__PURE__ */ O("div", {
|
|
532
535
|
className: "text-right",
|
|
533
|
-
children: [/* @__PURE__ */
|
|
536
|
+
children: [/* @__PURE__ */ D("p", {
|
|
534
537
|
className: "text-sm font-semibold tabular-nums",
|
|
535
|
-
style: { color:
|
|
538
|
+
style: { color: W(e.r ?? 0) },
|
|
536
539
|
children: (e.r ?? 0).toFixed(2)
|
|
537
|
-
}), /* @__PURE__ */
|
|
540
|
+
}), /* @__PURE__ */ D("p", {
|
|
538
541
|
className: "text-xs text-text-tertiary",
|
|
539
|
-
children:
|
|
542
|
+
children: U(e.r ?? 0, t)
|
|
540
543
|
})]
|
|
541
544
|
})]
|
|
542
|
-
}, e.
|
|
545
|
+
}, e.labelKey))
|
|
543
546
|
})]
|
|
544
547
|
});
|
|
545
548
|
}
|
|
546
549
|
//#endregion
|
|
547
|
-
export {
|
|
550
|
+
export { B as CalorieChart, G as CorrelationView, z as MacroChart, R as ReadinessSleepChart, L as VolumeChart };
|
|
548
551
|
|
|
549
552
|
//# sourceMappingURL=InsightsCharts.js.map
|