@burdenoff/microfe-mybodyshield 2026.716.1 → 2026.720.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,34 +1,38 @@
1
1
  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
- import { formatDateTime as r, formatDuration as i, formatKcal as a, formatNumber as o, formatRelativeTime as s, formatWeight as ee } from "../../utils/formatters.js";
5
- import { StatusBadge as te } from "../../components/StatusBadge.js";
6
- import { EmptyState as ne } from "../../components/EmptyState.js";
7
- import { ErrorView as re, LoadingView as ie } from "../../components/StateViews.js";
4
+ import { formatDateTime as ee, formatDuration as r, formatEnumLabel as te, formatKcal as ne, formatNumber as i, formatRelativeTime as a, formatWeight as o } from "../../utils/formatters.js";
5
+ import { StatusBadge as re } from "../../components/StatusBadge.js";
6
+ import { EmptyState as ie } from "../../components/EmptyState.js";
7
+ import { ErrorView as ae, LoadingView as oe } from "../../components/StateViews.js";
8
8
  import "../../context/index.js";
9
- import { useMybCompleteSession as ae, useMybLogSet as oe, useMybSession as se } from "../../hooks/useMyBodyShieldApi.js";
10
- import { useMyBodyShieldAnalytics as ce } from "../../hooks/useMyBodyShieldAnalytics.js";
9
+ import { useMybCompleteSession as se, useMybExerciseBestSet as ce, useMybLogSet as le, useMybSession as ue, useMybWorkoutExercises as de } from "../../hooks/useMyBodyShieldApi.js";
10
+ import { useMyBodyShieldAnalytics as fe } from "../../hooks/useMyBodyShieldAnalytics.js";
11
11
  import "../../hooks/index.js";
12
- import { MybDiscussion as le } from "../../components/MybDiscussion.js";
12
+ import { MybDiscussion as pe } from "../../components/MybDiscussion.js";
13
13
  import "../../components/index.js";
14
- import { motion as c } from "../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
15
- import { useReducedMotion as ue } from "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
16
- import { IconChip as de } from "../_shared/visuals.js";
17
- import { useMemo as l, useState as u } from "react";
18
- import { AlertTriangle as fe, ArrowLeft as pe, CheckCircle2 as me, Dumbbell as d, Flame as f, Gauge as he, Plus as p, Ruler as ge, Timer as m, Weight as _e } from "lucide-react";
19
- import { useParams as ve } from "react-router-dom";
20
- import { Fragment as ye, jsx as h, jsxs as g } from "react/jsx-runtime";
21
- import { Button as _, GlassCard as be, Input as v, Label as y, ResponsiveDialog as b, ResponsiveDialogContent as x, ResponsiveDialogDescription as S, ResponsiveDialogFooter as C, ResponsiveDialogHeader as w, ResponsiveDialogTitle as T, Switch as xe, Textarea as Se } from "@burdenoff/fe-libs/ui";
14
+ import { motion as s } from "../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
15
+ import { useReducedMotion as me } from "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
16
+ import { IconChip as c } from "../_shared/visuals.js";
17
+ import { useEffect as he, useMemo as l, useState as u } from "react";
18
+ import { AlertTriangle as ge, ArrowLeft as _e, CheckCircle2 as ve, ChevronLeft as ye, ChevronRight as be, Dumbbell as d, Flame as xe, Gauge as Se, ListChecks as Ce, Plus as f, Ruler as we, Timer as p, Trophy as Te, Weight as Ee, X as De } from "lucide-react";
19
+ import { useParams as Oe } from "react-router-dom";
20
+ import { Fragment as ke, jsx as m, jsxs as h } from "react/jsx-runtime";
21
+ import { Button as g, GlassCard as _, Input as v, Label as y, ResponsiveDialog as Ae, ResponsiveDialogContent as je, ResponsiveDialogDescription as Me, ResponsiveDialogFooter as Ne, ResponsiveDialogHeader as Pe, ResponsiveDialogTitle as Fe, Switch as Ie, Textarea as Le } from "@burdenoff/fe-libs/ui";
22
22
  //#region src/mybodyshield/pages/train/SessionDetailPage.tsx
23
- var E = [
23
+ var Re = 90, ze = [];
24
+ function Be(e, t, n) {
25
+ return n ? e > n.weight || e === n.weight && t > n.reps : !1;
26
+ }
27
+ var b = [
24
28
  .16,
25
29
  1,
26
30
  .3,
27
31
  1
28
- ], D = {
32
+ ], Ve = {
29
33
  hidden: {},
30
34
  show: { transition: { staggerChildren: .06 } }
31
- }, O = {
35
+ }, x = {
32
36
  hidden: {
33
37
  opacity: 0,
34
38
  y: 12
@@ -38,17 +42,17 @@ var E = [
38
42
  y: 0,
39
43
  transition: {
40
44
  duration: .35,
41
- ease: E
45
+ ease: b
42
46
  }
43
47
  }
44
48
  };
45
- function k(e) {
49
+ function S(e) {
46
50
  let t = e.trim();
47
51
  if (!t) return;
48
52
  let n = Number(t);
49
53
  return Number.isFinite(n) ? n : void 0;
50
54
  }
51
- var A = {
55
+ var C = {
52
56
  exerciseName: "",
53
57
  setNumber: "",
54
58
  reps: "",
@@ -56,17 +60,17 @@ var A = {
56
60
  distanceM: "",
57
61
  durationSec: "",
58
62
  isPersonalRecord: !1
59
- }, j = {
63
+ }, He = {
60
64
  caloriesBurned: "",
61
65
  perceivedExertion: "",
62
66
  notes: ""
63
67
  };
64
- function M() {
65
- let { navigateTo: M, workspaceId: Ce } = e(), N = ue(), { id: P } = ve();
66
- ce();
67
- let F = se(P), I = oe(), L = ae(), [we, R] = u(!1), [z, B] = u(A), [V, H] = u(null), [Te, U] = u(!1), [W, G] = u(j), [K, q] = u(null), J = F.data, Y = l(() => J?.sets ?? [], [J?.sets]), Ee = l(() => {
68
+ function w() {
69
+ let { navigateTo: w, workspaceId: Ue } = e(), T = me(), { id: E } = Oe();
70
+ fe();
71
+ let D = ue(E), O = le(), k = se(), We = de(D.data?.workoutId ?? void 0), [Ge, A] = u(!1), [j, M] = u(C), [Ke, N] = u(null), [qe, P] = u(!1), [Je, F] = u(!1), [I, L] = u(He), [Ye, R] = u(null), [Xe, z] = u(null), [Ze, Qe] = u(D.data?.workoutId), [B, V] = u(null), [$e, H] = u(0), U = ce(j.exerciseName), W = D.data, G = l(() => W?.sets ?? [], [W?.sets]), K = l(() => {
68
72
  let e = /* @__PURE__ */ new Map();
69
- for (let t of Y) {
73
+ for (let t of G) {
70
74
  let n = e.get(t.exerciseName) ?? [];
71
75
  n.push(t), e.set(t.exerciseName, n);
72
76
  }
@@ -74,55 +78,81 @@ function M() {
74
78
  name: e,
75
79
  sets: t.slice().sort((e, t) => e.setNumber - t.setNumber)
76
80
  }));
77
- }, [Y]), De = l(() => Y.reduce((e, t) => e + t.reps * t.weight, 0), [Y]), X = J?.startedAt, Z = J?.completedAt, Oe = l(() => {
78
- if (!X || !Z) return;
79
- let e = new Date(X).getTime(), t = new Date(Z).getTime();
81
+ }, [G]), et = l(() => G.reduce((e, t) => e + t.reps * t.weight, 0), [G]), q = W?.startedAt, tt = W?.completedAt, nt = l(() => {
82
+ if (!q || !tt) return;
83
+ let e = new Date(q).getTime(), t = new Date(tt).getTime();
80
84
  if (!(!Number.isFinite(e) || !Number.isFinite(t) || t < e)) return (t - e) / 1e3;
81
- }, [X, Z]);
82
- if (!P) return /* @__PURE__ */ h(t, {
85
+ }, [q, tt]), J = We.data ?? ze, Y = l(() => {
86
+ let e = /* @__PURE__ */ new Map();
87
+ for (let t of K) e.set(t.name, t.sets.length);
88
+ return e;
89
+ }, [K]), rt = l(() => {
90
+ if (J.length === 0) return 0;
91
+ let e = J.findIndex((e) => (Y.get(e.name) ?? 0) < Math.max(e.sets, 1));
92
+ return e === -1 ? J.length - 1 : e;
93
+ }, [J, Y]), X = Math.min(Xe ?? rt, Math.max(J.length - 1, 0)), Z = J[X], it = J.length > 0 && J.every((e) => (Y.get(e.name) ?? 0) >= Math.max(e.sets, 1));
94
+ D.data?.workoutId !== Ze && (Qe(D.data?.workoutId), z(null)), he(() => {
95
+ if (B == null) return;
96
+ let e = window.setInterval(() => {
97
+ let e = Math.max(0, Math.ceil((B - Date.now()) / 1e3));
98
+ H(e), e <= 0 && V(null);
99
+ }, 1e3);
100
+ return () => window.clearInterval(e);
101
+ }, [B]);
102
+ let at = S(j.weight) ?? 0, ot = S(j.reps) ?? 0, st = j.exerciseName.trim().length > 0 && Be(at, ot, U.data), ct = qe ? j.isPersonalRecord : st;
103
+ if (!E) return /* @__PURE__ */ m(t, {
83
104
  title: "Workout session",
84
- children: /* @__PURE__ */ h(re, {
105
+ children: /* @__PURE__ */ m(ae, {
85
106
  message: "No session was specified.",
86
- onRetry: () => M("train")
107
+ onRetry: () => w("train")
87
108
  })
88
109
  });
89
- if (F.isLoading) return /* @__PURE__ */ h(t, {
110
+ if (D.isLoading) return /* @__PURE__ */ m(t, {
90
111
  title: "Workout session",
91
- children: /* @__PURE__ */ h(ie, { label: "Loading session…" })
112
+ children: /* @__PURE__ */ m(oe, { label: "Loading session…" })
92
113
  });
93
- if (F.isError || !J) return /* @__PURE__ */ h(t, {
114
+ if (D.isError || !W) return /* @__PURE__ */ m(t, {
94
115
  title: "Workout session",
95
- children: /* @__PURE__ */ h(re, {
116
+ children: /* @__PURE__ */ m(ae, {
96
117
  title: "Session not found",
97
118
  message: "This workout session may have been removed, or you don't have access to it.",
98
- onRetry: () => F.refetch()
119
+ onRetry: () => D.refetch()
99
120
  })
100
121
  });
101
- let Q = J.status === "IN_PROGRESS", ke = J.completedAt ? `Completed ${s(J.completedAt)}` : J.startedAt ? `Started ${s(J.startedAt)}` : J.scheduledFor ? `Scheduled ${s(J.scheduledFor)}` : `Created ${s(J.createdAt)}`, $ = () => {
102
- B(A), H(null), R(!0);
122
+ let Q = W.status === "IN_PROGRESS", lt = W.completedAt ? `Completed ${a(W.completedAt)}` : W.startedAt ? `Started ${a(W.startedAt)}` : W.scheduledFor ? `Scheduled ${a(W.scheduledFor)}` : `Created ${a(W.createdAt)}`, $ = () => {
123
+ M(C), N(null), P(!1), A(!0);
124
+ }, ut = (e) => {
125
+ let t = Y.get(e.name) ?? 0;
126
+ M({
127
+ ...C,
128
+ exerciseName: e.name,
129
+ setNumber: String(t + 1),
130
+ reps: e.reps > 0 ? String(e.reps) : "",
131
+ weight: e.targetWeight > 0 ? String(e.targetWeight) : ""
132
+ }), N(null), P(!1), A(!0);
103
133
  };
104
- return /* @__PURE__ */ g(t, {
134
+ return /* @__PURE__ */ h(t, {
105
135
  title: "Workout session",
106
- description: ke,
107
- actions: Q ? /* @__PURE__ */ g(ye, { children: [/* @__PURE__ */ g(_, {
136
+ description: lt,
137
+ actions: Q ? /* @__PURE__ */ h(ke, { children: [/* @__PURE__ */ h(g, {
108
138
  variant: "outline",
109
139
  onClick: $,
110
- children: [/* @__PURE__ */ h(p, { className: "h-4 w-4" }), " Log set"]
111
- }), /* @__PURE__ */ g(_, {
140
+ children: [/* @__PURE__ */ m(f, { className: "h-4 w-4" }), " Log set"]
141
+ }), /* @__PURE__ */ h(g, {
112
142
  onClick: () => {
113
- G(j), q(null), U(!0);
143
+ L(He), R(null), F(!0);
114
144
  },
115
- children: [/* @__PURE__ */ h(me, { className: "h-4 w-4" }), " Complete"]
145
+ children: [/* @__PURE__ */ m(ve, { className: "h-4 w-4" }), " Complete"]
116
146
  })] }) : void 0,
117
147
  children: [
118
- /* @__PURE__ */ g("button", {
148
+ /* @__PURE__ */ h("button", {
119
149
  type: "button",
120
- onClick: () => M("train"),
150
+ onClick: () => w("train"),
121
151
  className: "mb-4 inline-flex items-center gap-1.5 text-sm font-medium text-text-secondary hover:text-text-primary",
122
- children: [/* @__PURE__ */ h(pe, { className: "h-4 w-4" }), " Back to sessions"]
152
+ children: [/* @__PURE__ */ m(_e, { className: "h-4 w-4" }), " Back to sessions"]
123
153
  }),
124
- /* @__PURE__ */ h(c.div, {
125
- initial: N ? !1 : {
154
+ /* @__PURE__ */ m(s.div, {
155
+ initial: T ? !1 : {
126
156
  opacity: 0,
127
157
  y: 10
128
158
  },
@@ -130,185 +160,320 @@ function M() {
130
160
  opacity: 1,
131
161
  y: 0
132
162
  },
133
- transition: N ? { duration: 0 } : {
163
+ transition: T ? { duration: 0 } : {
134
164
  duration: .35,
135
- ease: E
165
+ ease: b
136
166
  },
137
- children: /* @__PURE__ */ g(be, {
167
+ children: /* @__PURE__ */ h(_, {
138
168
  treatment: "glass",
139
169
  glow: Q,
140
170
  className: "p-6",
141
171
  children: [
142
- /* @__PURE__ */ h("div", {
172
+ /* @__PURE__ */ m("div", {
143
173
  className: "flex flex-wrap items-start justify-between gap-3",
144
- children: /* @__PURE__ */ g("div", {
174
+ children: /* @__PURE__ */ h("div", {
145
175
  className: "flex items-center gap-3",
146
- children: [/* @__PURE__ */ h(de, {
147
- icon: h(Q ? f : d, { className: "h-5 w-5" }),
176
+ children: [/* @__PURE__ */ m(c, {
177
+ icon: m(Q ? xe : d, { className: "h-5 w-5" }),
148
178
  tint: Q ? "var(--color-accent-teal)" : "var(--color-accent-primary)"
149
- }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("div", {
179
+ }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
150
180
  className: "flex items-center gap-2",
151
- children: /* @__PURE__ */ h(te, { status: J.status })
152
- }), /* @__PURE__ */ h("p", {
181
+ children: /* @__PURE__ */ m(re, { status: W.status })
182
+ }), /* @__PURE__ */ m("p", {
153
183
  className: "mt-1 text-sm text-text-secondary",
154
- children: ke
184
+ children: lt
155
185
  })] })]
156
186
  })
157
187
  }),
158
- /* @__PURE__ */ g("div", {
188
+ /* @__PURE__ */ h("div", {
159
189
  className: "mt-5 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
160
190
  children: [
161
- J.scheduledFor && /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("p", {
191
+ W.scheduledFor && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
162
192
  className: "text-xs text-text-tertiary",
163
193
  children: "Scheduled for"
164
- }), /* @__PURE__ */ h("p", {
194
+ }), /* @__PURE__ */ m("p", {
165
195
  className: "mt-0.5 text-sm font-medium text-text-primary",
166
- children: r(J.scheduledFor)
196
+ children: ee(W.scheduledFor)
167
197
  })] }),
168
- J.startedAt && /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("p", {
198
+ W.startedAt && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
169
199
  className: "text-xs text-text-tertiary",
170
200
  children: "Started"
171
- }), /* @__PURE__ */ h("p", {
201
+ }), /* @__PURE__ */ m("p", {
172
202
  className: "mt-0.5 text-sm font-medium text-text-primary",
173
- children: r(J.startedAt)
203
+ children: ee(W.startedAt)
174
204
  })] }),
175
- J.completedAt && /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("p", {
205
+ W.completedAt && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
176
206
  className: "text-xs text-text-tertiary",
177
207
  children: "Completed"
178
- }), /* @__PURE__ */ h("p", {
208
+ }), /* @__PURE__ */ m("p", {
179
209
  className: "mt-0.5 text-sm font-medium text-text-primary",
180
- children: r(J.completedAt)
210
+ children: ee(W.completedAt)
181
211
  })] }),
182
- J.perceivedExertion != null && /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("p", {
212
+ W.perceivedExertion != null && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
183
213
  className: "text-xs text-text-tertiary",
184
214
  children: "Perceived exertion"
185
- }), /* @__PURE__ */ g("p", {
215
+ }), /* @__PURE__ */ h("p", {
186
216
  className: "mt-0.5 text-sm font-medium tabular-nums text-text-primary",
187
- children: [J.perceivedExertion, "/10 RPE"]
217
+ children: [W.perceivedExertion, "/10 RPE"]
188
218
  })] }),
189
- J.caloriesBurned > 0 && /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("p", {
219
+ W.caloriesBurned > 0 && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
190
220
  className: "text-xs text-text-tertiary",
191
221
  children: "Calories burned"
192
- }), /* @__PURE__ */ h("p", {
222
+ }), /* @__PURE__ */ m("p", {
193
223
  className: "mt-0.5 text-sm font-medium tabular-nums text-text-primary",
194
- children: a(J.caloriesBurned)
224
+ children: ne(W.caloriesBurned)
195
225
  })] })
196
226
  ]
197
227
  }),
198
- J.notes && /* @__PURE__ */ g("div", {
228
+ W.notes && /* @__PURE__ */ h("div", {
199
229
  className: "mt-5 rounded-xl bg-bg-sunken/60 p-4",
200
- children: [/* @__PURE__ */ h("p", {
230
+ children: [/* @__PURE__ */ m("p", {
201
231
  className: "text-xs text-text-tertiary",
202
232
  children: "Notes"
203
- }), /* @__PURE__ */ h("p", {
233
+ }), /* @__PURE__ */ m("p", {
204
234
  className: "mt-1 whitespace-pre-wrap text-sm text-text-secondary",
205
- children: J.notes
235
+ children: W.notes
206
236
  })]
207
237
  })
208
238
  ]
209
239
  })
210
240
  }),
211
- /* @__PURE__ */ g(c.div, {
241
+ Q && $e > 0 && /* @__PURE__ */ m(s.div, {
242
+ initial: T ? !1 : {
243
+ opacity: 0,
244
+ y: -6
245
+ },
246
+ animate: {
247
+ opacity: 1,
248
+ y: 0
249
+ },
250
+ transition: T ? { duration: 0 } : {
251
+ duration: .25,
252
+ ease: b
253
+ },
254
+ className: "mt-4",
255
+ children: /* @__PURE__ */ h(_, {
256
+ treatment: "plain",
257
+ className: "flex flex-wrap items-center justify-between gap-3 border border-accent/30 bg-accent/5 p-4",
258
+ children: [/* @__PURE__ */ h("div", {
259
+ className: "flex items-center gap-2.5",
260
+ children: [/* @__PURE__ */ m(c, {
261
+ icon: /* @__PURE__ */ m(p, { className: "h-4 w-4" }),
262
+ tint: "var(--color-accent-teal)"
263
+ }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
264
+ className: "text-sm font-semibold text-text-primary",
265
+ children: "Resting"
266
+ }), /* @__PURE__ */ h("p", {
267
+ className: "text-xs tabular-nums text-text-secondary",
268
+ children: [r($e), " remaining"]
269
+ })] })]
270
+ }), /* @__PURE__ */ h("div", {
271
+ className: "flex items-center gap-2",
272
+ children: [/* @__PURE__ */ m(g, {
273
+ variant: "outline",
274
+ size: "sm",
275
+ onClick: () => {
276
+ V((e) => e && e + 15e3), H((e) => e + 15);
277
+ },
278
+ children: "+15s"
279
+ }), /* @__PURE__ */ h(g, {
280
+ variant: "ghost",
281
+ size: "sm",
282
+ onClick: () => {
283
+ V(null), H(0);
284
+ },
285
+ children: [/* @__PURE__ */ m(De, { className: "h-4 w-4" }), " Skip"]
286
+ })]
287
+ })]
288
+ })
289
+ }),
290
+ Q && J.length > 0 && /* @__PURE__ */ m(s.div, {
291
+ initial: T ? !1 : {
292
+ opacity: 0,
293
+ y: 10
294
+ },
295
+ animate: {
296
+ opacity: 1,
297
+ y: 0
298
+ },
299
+ transition: T ? { duration: 0 } : {
300
+ duration: .35,
301
+ ease: b,
302
+ delay: .05
303
+ },
304
+ className: "mt-4",
305
+ children: /* @__PURE__ */ h(_, {
306
+ treatment: "plain",
307
+ className: "p-4",
308
+ children: [/* @__PURE__ */ h("div", {
309
+ className: "mb-3 flex items-center justify-between gap-2",
310
+ children: [/* @__PURE__ */ h("div", {
311
+ className: "flex items-center gap-2.5",
312
+ children: [/* @__PURE__ */ m(c, { icon: /* @__PURE__ */ m(Ce, { className: "h-4 w-4" }) }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h3", {
313
+ className: "text-sm font-semibold text-text-primary",
314
+ children: "Guided workout"
315
+ }), /* @__PURE__ */ m("p", {
316
+ className: "text-xs text-text-secondary",
317
+ children: it ? "All planned exercises logged — nice work." : `Exercise ${X + 1} of ${J.length}`
318
+ })] })]
319
+ }), /* @__PURE__ */ h("div", {
320
+ className: "flex items-center gap-1.5",
321
+ children: [/* @__PURE__ */ m(g, {
322
+ variant: "outline",
323
+ size: "sm",
324
+ onClick: () => z(Math.max(X - 1, 0)),
325
+ disabled: X === 0,
326
+ "aria-label": "Previous exercise",
327
+ children: /* @__PURE__ */ m(ye, { className: "h-4 w-4" })
328
+ }), /* @__PURE__ */ m(g, {
329
+ variant: "outline",
330
+ size: "sm",
331
+ onClick: () => z(Math.min(X + 1, J.length - 1)),
332
+ disabled: X >= J.length - 1,
333
+ "aria-label": "Next exercise",
334
+ children: /* @__PURE__ */ m(be, { className: "h-4 w-4" })
335
+ })]
336
+ })]
337
+ }), Z && /* @__PURE__ */ h("div", {
338
+ className: "flex flex-wrap items-center justify-between gap-3 rounded-xl bg-bg-sunken/60 p-3",
339
+ children: [/* @__PURE__ */ h("div", { children: [
340
+ /* @__PURE__ */ m("p", {
341
+ className: "text-sm font-semibold text-text-primary",
342
+ children: Z.name
343
+ }),
344
+ /* @__PURE__ */ h("p", {
345
+ className: "mt-0.5 text-xs text-text-secondary",
346
+ children: [
347
+ te(Z.muscleGroup),
348
+ " · ",
349
+ Z.sets,
350
+ " ×",
351
+ " ",
352
+ Z.reps,
353
+ " reps",
354
+ Z.targetWeight > 0 ? ` @ ${o(Z.targetWeight)}` : "",
355
+ Z.restSeconds > 0 ? ` · ${r(Z.restSeconds)} rest` : ""
356
+ ]
357
+ }),
358
+ /* @__PURE__ */ h("p", {
359
+ className: "mt-0.5 text-xs tabular-nums text-text-tertiary",
360
+ children: [
361
+ Y.get(Z.name) ?? 0,
362
+ " of",
363
+ " ",
364
+ Math.max(Z.sets, 1),
365
+ " sets logged"
366
+ ]
367
+ })
368
+ ] }), /* @__PURE__ */ h(g, {
369
+ size: "sm",
370
+ onClick: () => ut(Z),
371
+ children: [/* @__PURE__ */ m(f, { className: "h-4 w-4" }), " Log this exercise"]
372
+ })]
373
+ })]
374
+ })
375
+ }),
376
+ /* @__PURE__ */ h(s.div, {
212
377
  className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
213
- variants: N ? void 0 : D,
214
- initial: N ? !1 : "hidden",
378
+ variants: T ? void 0 : Ve,
379
+ initial: T ? !1 : "hidden",
215
380
  animate: "show",
216
381
  children: [
217
- /* @__PURE__ */ h(c.div, {
218
- variants: N ? void 0 : O,
219
- children: /* @__PURE__ */ h(n, {
220
- icon: /* @__PURE__ */ h("span", {
382
+ /* @__PURE__ */ m(s.div, {
383
+ variants: T ? void 0 : x,
384
+ children: /* @__PURE__ */ m(n, {
385
+ icon: /* @__PURE__ */ m("span", {
221
386
  className: "text-action-primary-bg",
222
- children: /* @__PURE__ */ h(d, { className: "h-5 w-5" })
387
+ children: /* @__PURE__ */ m(d, { className: "h-5 w-5" })
223
388
  }),
224
- value: o(Y.length),
389
+ value: i(G.length),
225
390
  label: "Total sets"
226
391
  })
227
392
  }),
228
- /* @__PURE__ */ h(c.div, {
229
- variants: N ? void 0 : O,
230
- children: /* @__PURE__ */ h(n, {
231
- icon: /* @__PURE__ */ h("span", {
393
+ /* @__PURE__ */ m(s.div, {
394
+ variants: T ? void 0 : x,
395
+ children: /* @__PURE__ */ m(n, {
396
+ icon: /* @__PURE__ */ m("span", {
232
397
  className: "text-action-primary-bg",
233
- children: /* @__PURE__ */ h(_e, { className: "h-5 w-5" })
398
+ children: /* @__PURE__ */ m(Ee, { className: "h-5 w-5" })
234
399
  }),
235
- value: `${o(De)} kg`,
400
+ value: `${i(et)} kg`,
236
401
  label: "Total volume"
237
402
  })
238
403
  }),
239
- /* @__PURE__ */ h(c.div, {
240
- variants: N ? void 0 : O,
241
- children: /* @__PURE__ */ h(n, {
242
- icon: /* @__PURE__ */ h("span", {
404
+ /* @__PURE__ */ m(s.div, {
405
+ variants: T ? void 0 : x,
406
+ children: /* @__PURE__ */ m(n, {
407
+ icon: /* @__PURE__ */ m("span", {
243
408
  className: "text-action-primary-bg",
244
- children: /* @__PURE__ */ h(m, { className: "h-5 w-5" })
409
+ children: /* @__PURE__ */ m(p, { className: "h-5 w-5" })
245
410
  }),
246
- value: Oe == null ? "—" : i(Oe),
411
+ value: nt == null ? "—" : r(nt),
247
412
  label: "Duration"
248
413
  })
249
414
  }),
250
- /* @__PURE__ */ h(c.div, {
251
- variants: N ? void 0 : O,
252
- children: /* @__PURE__ */ h(n, {
253
- icon: /* @__PURE__ */ h("span", {
415
+ /* @__PURE__ */ m(s.div, {
416
+ variants: T ? void 0 : x,
417
+ children: /* @__PURE__ */ m(n, {
418
+ icon: /* @__PURE__ */ m("span", {
254
419
  className: "text-action-primary-bg",
255
- children: /* @__PURE__ */ h(f, { className: "h-5 w-5" })
420
+ children: /* @__PURE__ */ m(xe, { className: "h-5 w-5" })
256
421
  }),
257
- value: J.caloriesBurned > 0 ? a(J.caloriesBurned) : "—",
422
+ value: W.caloriesBurned > 0 ? ne(W.caloriesBurned) : "—",
258
423
  label: "Calories burned"
259
424
  })
260
425
  })
261
426
  ]
262
427
  }),
263
- /* @__PURE__ */ g("div", {
428
+ /* @__PURE__ */ h("div", {
264
429
  className: "mt-8",
265
- children: [/* @__PURE__ */ g("div", {
430
+ children: [/* @__PURE__ */ h("div", {
266
431
  className: "mb-3 flex items-end justify-between gap-3",
267
- children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h2", {
432
+ children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h2", {
268
433
  className: "text-base font-semibold text-text-primary",
269
434
  children: "Logged sets"
270
- }), /* @__PURE__ */ h("p", {
435
+ }), /* @__PURE__ */ m("p", {
271
436
  className: "mt-0.5 text-sm text-text-secondary",
272
437
  children: "Every set recorded during this session, grouped by exercise."
273
- })] }), Q && /* @__PURE__ */ g(_, {
438
+ })] }), Q && /* @__PURE__ */ h(g, {
274
439
  variant: "outline",
275
440
  size: "sm",
276
441
  onClick: $,
277
442
  className: "shrink-0",
278
- children: [/* @__PURE__ */ h(p, { className: "h-4 w-4" }), " Log set"]
443
+ children: [/* @__PURE__ */ m(f, { className: "h-4 w-4" }), " Log set"]
279
444
  })]
280
- }), Ee.length === 0 ? /* @__PURE__ */ h(ne, {
445
+ }), K.length === 0 ? /* @__PURE__ */ m(ie, {
281
446
  illustration: "empty-data",
282
- icon: /* @__PURE__ */ h(d, { className: "h-10 w-10" }),
447
+ icon: /* @__PURE__ */ m(d, { className: "h-10 w-10" }),
283
448
  title: "No sets logged yet",
284
449
  description: Q ? "Log your first set to start tracking this workout." : "No sets were recorded for this session.",
285
- action: Q ? /* @__PURE__ */ g(_, {
450
+ action: Q ? /* @__PURE__ */ h(g, {
286
451
  onClick: $,
287
- children: [/* @__PURE__ */ h(p, { className: "h-4 w-4" }), " Log set"]
452
+ children: [/* @__PURE__ */ m(f, { className: "h-4 w-4" }), " Log set"]
288
453
  }) : void 0
289
- }) : /* @__PURE__ */ h(c.div, {
454
+ }) : /* @__PURE__ */ m(s.div, {
290
455
  className: "space-y-4",
291
- variants: N ? void 0 : D,
292
- initial: N ? !1 : "hidden",
456
+ variants: T ? void 0 : Ve,
457
+ initial: T ? !1 : "hidden",
293
458
  animate: "show",
294
- children: Ee.map((e) => {
459
+ children: K.map((e) => {
295
460
  let t = e.sets.filter((e) => e.isPersonalRecord).length;
296
- return /* @__PURE__ */ h(c.div, {
297
- variants: N ? void 0 : O,
298
- children: /* @__PURE__ */ g(be, {
461
+ return /* @__PURE__ */ m(s.div, {
462
+ variants: T ? void 0 : x,
463
+ children: /* @__PURE__ */ h(_, {
299
464
  treatment: "plain",
300
465
  className: "p-4 transition-shadow hover:shadow-float",
301
- children: [/* @__PURE__ */ g("div", {
466
+ children: [/* @__PURE__ */ h("div", {
302
467
  className: "mb-3 flex items-center justify-between gap-2",
303
- children: [/* @__PURE__ */ g("div", {
468
+ children: [/* @__PURE__ */ h("div", {
304
469
  className: "flex min-w-0 items-center gap-2.5",
305
470
  children: [
306
- /* @__PURE__ */ h(de, { icon: /* @__PURE__ */ h(d, { className: "h-4 w-4" }) }),
307
- /* @__PURE__ */ h("h3", {
471
+ /* @__PURE__ */ m(c, { icon: /* @__PURE__ */ m(d, { className: "h-4 w-4" }) }),
472
+ /* @__PURE__ */ m("h3", {
308
473
  className: "truncate text-sm font-semibold text-text-primary",
309
474
  children: e.name
310
475
  }),
311
- t > 0 && /* @__PURE__ */ g("span", {
476
+ t > 0 && /* @__PURE__ */ h("span", {
312
477
  className: "inline-flex items-center rounded-full bg-status-success-bg-subtle px-2 py-0.5 text-[11px] font-semibold text-status-success-text shadow-[0_0_0_3px_color-mix(in_oklab,var(--color-status-success-text)_14%,transparent)]",
313
478
  children: [
314
479
  t,
@@ -317,47 +482,47 @@ function M() {
317
482
  ]
318
483
  })
319
484
  ]
320
- }), /* @__PURE__ */ g("span", {
485
+ }), /* @__PURE__ */ h("span", {
321
486
  className: "shrink-0 text-xs tabular-nums text-text-tertiary",
322
487
  children: [
323
- o(e.sets.length),
488
+ i(e.sets.length),
324
489
  " ",
325
490
  e.sets.length === 1 ? "set" : "sets"
326
491
  ]
327
492
  })]
328
- }), /* @__PURE__ */ h("ul", {
493
+ }), /* @__PURE__ */ m("ul", {
329
494
  className: "divide-y divide-border-seam",
330
495
  children: e.sets.map((e) => {
331
496
  let t = e.durationSec > 0 || e.distanceM > 0;
332
- return /* @__PURE__ */ g("li", {
497
+ return /* @__PURE__ */ h("li", {
333
498
  className: "flex flex-wrap items-center justify-between gap-2 rounded-lg px-2 py-2 transition-colors" + (e.isPersonalRecord ? " bg-[color-mix(in_oklab,var(--color-status-success-text)_9%,transparent)]" : " hover:bg-bg-sunken/40"),
334
- children: [/* @__PURE__ */ g("div", {
499
+ children: [/* @__PURE__ */ h("div", {
335
500
  className: "flex items-center gap-2",
336
- children: [/* @__PURE__ */ g("span", {
501
+ children: [/* @__PURE__ */ h("span", {
337
502
  className: "text-sm font-medium text-text-primary tabular-nums",
338
503
  children: [
339
504
  "Set ",
340
505
  e.setNumber,
341
506
  ": ",
342
- o(e.reps),
507
+ i(e.reps),
343
508
  " ×",
344
509
  " ",
345
- ee(e.weight)
510
+ o(e.weight)
346
511
  ]
347
- }), e.isPersonalRecord && /* @__PURE__ */ h("span", {
512
+ }), e.isPersonalRecord && /* @__PURE__ */ m("span", {
348
513
  className: "inline-flex rounded-full shadow-[0_0_0_3px_color-mix(in_oklab,var(--color-status-success-text)_16%,transparent)]",
349
- children: /* @__PURE__ */ h(te, { status: "PR" })
514
+ children: /* @__PURE__ */ m(re, { status: "PR" })
350
515
  })]
351
- }), /* @__PURE__ */ g("div", {
516
+ }), /* @__PURE__ */ h("div", {
352
517
  className: "flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-text-secondary",
353
- children: [t && e.durationSec > 0 && /* @__PURE__ */ g("span", {
518
+ children: [t && e.durationSec > 0 && /* @__PURE__ */ h("span", {
354
519
  className: "inline-flex items-center gap-1 tabular-nums",
355
- children: [/* @__PURE__ */ h(m, { className: "h-3.5 w-3.5 text-accent" }), i(e.durationSec)]
356
- }), t && e.distanceM > 0 && /* @__PURE__ */ g("span", {
520
+ children: [/* @__PURE__ */ m(p, { className: "h-3.5 w-3.5 text-accent" }), r(e.durationSec)]
521
+ }), t && e.distanceM > 0 && /* @__PURE__ */ h("span", {
357
522
  className: "inline-flex items-center gap-1 tabular-nums",
358
523
  children: [
359
- /* @__PURE__ */ h(ge, { className: "h-3.5 w-3.5 text-accent" }),
360
- o(e.distanceM),
524
+ /* @__PURE__ */ m(we, { className: "h-3.5 w-3.5 text-accent" }),
525
+ i(e.distanceM),
361
526
  " m"
362
527
  ]
363
528
  })]
@@ -370,126 +535,129 @@ function M() {
370
535
  })
371
536
  })]
372
537
  }),
373
- /* @__PURE__ */ h("div", {
538
+ /* @__PURE__ */ m("div", {
374
539
  className: "mt-8",
375
- children: /* @__PURE__ */ h(le, {
540
+ children: /* @__PURE__ */ m(pe, {
376
541
  entityType: "mybodyshield-session",
377
- entityId: J.id,
542
+ entityId: W.id,
378
543
  title: "Coach feedback",
379
544
  description: "Discuss form, cues and this session's results with your coach and team."
380
545
  })
381
546
  }),
382
- /* @__PURE__ */ h(b, {
383
- open: we,
384
- onOpenChange: R,
385
- children: /* @__PURE__ */ g(x, { children: [
386
- /* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(T, { children: "Log a set" }), /* @__PURE__ */ h(S, { children: "Record reps and load for strength work, or duration and distance for cardio. The dialog stays open so you can log sets back-to-back." })] }),
387
- /* @__PURE__ */ g("div", {
547
+ /* @__PURE__ */ m(Ae, {
548
+ open: Ge,
549
+ onOpenChange: A,
550
+ children: /* @__PURE__ */ h(je, { children: [
551
+ /* @__PURE__ */ h(Pe, { children: [/* @__PURE__ */ m(Fe, { children: "Log a set" }), /* @__PURE__ */ m(Me, { children: "Record reps and load for strength work, or duration and distance for cardio. The dialog stays open so you can log sets back-to-back." })] }),
552
+ /* @__PURE__ */ h("div", {
388
553
  className: "space-y-4 px-1",
389
554
  children: [
390
- /* @__PURE__ */ g("div", {
555
+ /* @__PURE__ */ h("div", {
391
556
  className: "space-y-1.5",
392
- children: [/* @__PURE__ */ h(y, {
557
+ children: [/* @__PURE__ */ m(y, {
393
558
  htmlFor: "myb-set-exercise",
394
559
  children: "Exercise"
395
- }), /* @__PURE__ */ h(v, {
560
+ }), /* @__PURE__ */ m(v, {
396
561
  id: "myb-set-exercise",
397
- value: z.exerciseName,
398
- onChange: (e) => B((t) => ({
399
- ...t,
400
- exerciseName: e.target.value
401
- })),
562
+ value: j.exerciseName,
563
+ onChange: (e) => {
564
+ let t = e.target.value;
565
+ M((e) => ({
566
+ ...e,
567
+ exerciseName: t
568
+ })), P(!1);
569
+ },
402
570
  placeholder: "e.g. Back Squat"
403
571
  })]
404
572
  }),
405
- /* @__PURE__ */ g("div", {
573
+ /* @__PURE__ */ h("div", {
406
574
  className: "grid grid-cols-2 gap-3",
407
575
  children: [
408
- /* @__PURE__ */ g("div", {
576
+ /* @__PURE__ */ h("div", {
409
577
  className: "space-y-1.5",
410
- children: [/* @__PURE__ */ h(y, {
578
+ children: [/* @__PURE__ */ m(y, {
411
579
  htmlFor: "myb-set-number",
412
580
  children: "Set number"
413
- }), /* @__PURE__ */ h(v, {
581
+ }), /* @__PURE__ */ m(v, {
414
582
  id: "myb-set-number",
415
583
  type: "number",
416
584
  inputMode: "numeric",
417
585
  min: 1,
418
- value: z.setNumber,
419
- onChange: (e) => B((t) => ({
586
+ value: j.setNumber,
587
+ onChange: (e) => M((t) => ({
420
588
  ...t,
421
589
  setNumber: e.target.value
422
590
  })),
423
591
  placeholder: "1"
424
592
  })]
425
593
  }),
426
- /* @__PURE__ */ g("div", {
594
+ /* @__PURE__ */ h("div", {
427
595
  className: "space-y-1.5",
428
- children: [/* @__PURE__ */ h(y, {
596
+ children: [/* @__PURE__ */ m(y, {
429
597
  htmlFor: "myb-set-reps",
430
598
  children: "Reps"
431
- }), /* @__PURE__ */ h(v, {
599
+ }), /* @__PURE__ */ m(v, {
432
600
  id: "myb-set-reps",
433
601
  type: "number",
434
602
  inputMode: "numeric",
435
603
  min: 0,
436
- value: z.reps,
437
- onChange: (e) => B((t) => ({
604
+ value: j.reps,
605
+ onChange: (e) => M((t) => ({
438
606
  ...t,
439
607
  reps: e.target.value
440
608
  })),
441
609
  placeholder: "8"
442
610
  })]
443
611
  }),
444
- /* @__PURE__ */ g("div", {
612
+ /* @__PURE__ */ h("div", {
445
613
  className: "space-y-1.5",
446
- children: [/* @__PURE__ */ h(y, {
614
+ children: [/* @__PURE__ */ m(y, {
447
615
  htmlFor: "myb-set-weight",
448
616
  children: "Weight (kg)"
449
- }), /* @__PURE__ */ h(v, {
617
+ }), /* @__PURE__ */ m(v, {
450
618
  id: "myb-set-weight",
451
619
  type: "number",
452
620
  inputMode: "decimal",
453
621
  min: 0,
454
622
  step: "0.5",
455
- value: z.weight,
456
- onChange: (e) => B((t) => ({
623
+ value: j.weight,
624
+ onChange: (e) => M((t) => ({
457
625
  ...t,
458
626
  weight: e.target.value
459
627
  })),
460
628
  placeholder: "60"
461
629
  })]
462
630
  }),
463
- /* @__PURE__ */ g("div", {
631
+ /* @__PURE__ */ h("div", {
464
632
  className: "space-y-1.5",
465
- children: [/* @__PURE__ */ h(y, {
633
+ children: [/* @__PURE__ */ m(y, {
466
634
  htmlFor: "myb-set-distance",
467
635
  children: "Distance (m)"
468
- }), /* @__PURE__ */ h(v, {
636
+ }), /* @__PURE__ */ m(v, {
469
637
  id: "myb-set-distance",
470
638
  type: "number",
471
639
  inputMode: "numeric",
472
640
  min: 0,
473
- value: z.distanceM,
474
- onChange: (e) => B((t) => ({
641
+ value: j.distanceM,
642
+ onChange: (e) => M((t) => ({
475
643
  ...t,
476
644
  distanceM: e.target.value
477
645
  })),
478
646
  placeholder: "Optional"
479
647
  })]
480
648
  }),
481
- /* @__PURE__ */ g("div", {
649
+ /* @__PURE__ */ h("div", {
482
650
  className: "space-y-1.5",
483
- children: [/* @__PURE__ */ h(y, {
651
+ children: [/* @__PURE__ */ m(y, {
484
652
  htmlFor: "myb-set-duration",
485
653
  children: "Duration (sec)"
486
- }), /* @__PURE__ */ h(v, {
654
+ }), /* @__PURE__ */ m(v, {
487
655
  id: "myb-set-duration",
488
656
  type: "number",
489
657
  inputMode: "numeric",
490
658
  min: 0,
491
- value: z.durationSec,
492
- onChange: (e) => B((t) => ({
659
+ value: j.durationSec,
660
+ onChange: (e) => M((t) => ({
493
661
  ...t,
494
662
  durationSec: e.target.value
495
663
  })),
@@ -498,120 +666,124 @@ function M() {
498
666
  })
499
667
  ]
500
668
  }),
501
- /* @__PURE__ */ g("div", {
669
+ /* @__PURE__ */ h("div", {
502
670
  className: "flex items-center justify-between gap-3 rounded-xl bg-bg-sunken/60 p-3",
503
- children: [/* @__PURE__ */ g("div", {
671
+ children: [/* @__PURE__ */ h("div", {
504
672
  className: "flex items-center gap-2",
505
- children: [/* @__PURE__ */ h(he, { className: "h-4 w-4 text-accent" }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h(y, {
673
+ children: [ct ? /* @__PURE__ */ m(Te, { className: "h-4 w-4 text-status-success-text" }) : /* @__PURE__ */ m(Se, { className: "h-4 w-4 text-accent" }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m(y, {
506
674
  htmlFor: "myb-set-pr",
507
675
  className: "cursor-pointer",
508
676
  children: "Personal record"
509
- }), /* @__PURE__ */ h("p", {
677
+ }), /* @__PURE__ */ m("p", {
510
678
  className: "text-xs text-text-tertiary",
511
- children: "Flag this set as a new PR."
679
+ children: U.data ? `Auto-detected against your best: ${i(U.data.reps)} × ${o(U.data.weight)}.` : j.exerciseName.trim() ? "First time logging this exercise — nothing to compare yet." : "Flag this set as a new PR."
512
680
  })] })]
513
- }), /* @__PURE__ */ h(xe, {
681
+ }), /* @__PURE__ */ m(Ie, {
514
682
  id: "myb-set-pr",
515
- checked: z.isPersonalRecord,
516
- onCheckedChange: (e) => B((t) => ({
517
- ...t,
518
- isPersonalRecord: e
519
- }))
683
+ checked: ct,
684
+ onCheckedChange: (e) => {
685
+ P(!0), M((t) => ({
686
+ ...t,
687
+ isPersonalRecord: e
688
+ }));
689
+ }
520
690
  })]
521
691
  }),
522
- V && /* @__PURE__ */ h("p", {
692
+ Ke && /* @__PURE__ */ m("p", {
523
693
  className: "text-sm text-status-error-text",
524
- children: V
694
+ children: Ke
525
695
  })
526
696
  ]
527
697
  }),
528
- /* @__PURE__ */ g(C, { children: [/* @__PURE__ */ h(_, {
698
+ /* @__PURE__ */ h(Ne, { children: [/* @__PURE__ */ m(g, {
529
699
  variant: "outline",
530
- onClick: () => R(!1),
700
+ onClick: () => A(!1),
531
701
  children: "Done"
532
- }), /* @__PURE__ */ h(_, {
702
+ }), /* @__PURE__ */ m(g, {
533
703
  onClick: async () => {
534
- H(null);
535
- let e = z.exerciseName.trim();
704
+ N(null);
705
+ let e = j.exerciseName.trim();
536
706
  if (!e) {
537
- H("Exercise name is required.");
707
+ N("Exercise name is required.");
538
708
  return;
539
709
  }
540
710
  try {
541
- let t = await I.mutateAsync({
542
- sessionId: P,
711
+ let t = await O.mutateAsync({
712
+ sessionId: E,
543
713
  exerciseName: e,
544
- setNumber: k(z.setNumber),
545
- reps: k(z.reps),
546
- weight: k(z.weight),
547
- distanceM: k(z.distanceM),
548
- durationSec: k(z.durationSec),
549
- isPersonalRecord: z.isPersonalRecord
714
+ setNumber: S(j.setNumber),
715
+ reps: S(j.reps),
716
+ weight: S(j.weight),
717
+ distanceM: S(j.distanceM),
718
+ durationSec: S(j.durationSec),
719
+ isPersonalRecord: ct
550
720
  });
551
- B({
552
- ...A,
721
+ M({
722
+ ...C,
553
723
  exerciseName: e,
554
724
  setNumber: String(t.setNumber + 1)
555
- });
725
+ }), P(!1);
726
+ let n = Z && Z.name === e && Z.restSeconds > 0 ? Z.restSeconds : Re;
727
+ V(Date.now() + n * 1e3), H(n);
556
728
  } catch (e) {
557
- H(e instanceof Error ? e.message : "Failed to log the set.");
729
+ N(e instanceof Error ? e.message : "Failed to log the set.");
558
730
  }
559
731
  },
560
- disabled: I.isPending,
561
- children: I.isPending ? "Logging…" : "Log set"
732
+ disabled: O.isPending,
733
+ children: O.isPending ? "Logging…" : "Log set"
562
734
  })] })
563
735
  ] })
564
736
  }),
565
- /* @__PURE__ */ h(b, {
566
- open: Te,
567
- onOpenChange: U,
568
- children: /* @__PURE__ */ g(x, { children: [
569
- /* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(T, { children: "Complete session" }), /* @__PURE__ */ h(S, { children: "Wrap up this workout and record how it went." })] }),
570
- /* @__PURE__ */ g("div", {
737
+ /* @__PURE__ */ m(Ae, {
738
+ open: Je,
739
+ onOpenChange: F,
740
+ children: /* @__PURE__ */ h(je, { children: [
741
+ /* @__PURE__ */ h(Pe, { children: [/* @__PURE__ */ m(Fe, { children: "Complete session" }), /* @__PURE__ */ m(Me, { children: "Wrap up this workout and record how it went." })] }),
742
+ /* @__PURE__ */ h("div", {
571
743
  className: "space-y-4 px-1",
572
744
  children: [
573
- Y.length === 0 && /* @__PURE__ */ g("div", {
745
+ G.length === 0 && /* @__PURE__ */ h("div", {
574
746
  className: "flex items-start gap-2.5 rounded-xl border border-status-warning-text/40 bg-status-warning-bg-subtle p-3",
575
- children: [/* @__PURE__ */ h(fe, { className: "mt-0.5 h-4 w-4 shrink-0 text-status-warning-text" }), /* @__PURE__ */ g("p", {
747
+ children: [/* @__PURE__ */ m(ge, { className: "mt-0.5 h-4 w-4 shrink-0 text-status-warning-text" }), /* @__PURE__ */ h("p", {
576
748
  className: "text-sm text-text-secondary",
577
- children: [/* @__PURE__ */ h("span", {
749
+ children: [/* @__PURE__ */ m("span", {
578
750
  className: "font-medium text-text-primary",
579
751
  children: "No sets logged."
580
752
  }), " You can still complete this session, but nothing was recorded for it."]
581
753
  })]
582
754
  }),
583
- /* @__PURE__ */ g("div", {
755
+ /* @__PURE__ */ h("div", {
584
756
  className: "grid grid-cols-2 gap-3",
585
- children: [/* @__PURE__ */ g("div", {
757
+ children: [/* @__PURE__ */ h("div", {
586
758
  className: "space-y-1.5",
587
- children: [/* @__PURE__ */ h(y, {
759
+ children: [/* @__PURE__ */ m(y, {
588
760
  htmlFor: "myb-complete-calories",
589
761
  children: "Calories burned"
590
- }), /* @__PURE__ */ h(v, {
762
+ }), /* @__PURE__ */ m(v, {
591
763
  id: "myb-complete-calories",
592
764
  type: "number",
593
765
  inputMode: "numeric",
594
766
  min: 0,
595
- value: W.caloriesBurned,
596
- onChange: (e) => G((t) => ({
767
+ value: I.caloriesBurned,
768
+ onChange: (e) => L((t) => ({
597
769
  ...t,
598
770
  caloriesBurned: e.target.value
599
771
  })),
600
772
  placeholder: "Optional"
601
773
  })]
602
- }), /* @__PURE__ */ g("div", {
774
+ }), /* @__PURE__ */ h("div", {
603
775
  className: "space-y-1.5",
604
- children: [/* @__PURE__ */ h(y, {
776
+ children: [/* @__PURE__ */ m(y, {
605
777
  htmlFor: "myb-complete-rpe",
606
778
  children: "Perceived exertion (1–10)"
607
- }), /* @__PURE__ */ h(v, {
779
+ }), /* @__PURE__ */ m(v, {
608
780
  id: "myb-complete-rpe",
609
781
  type: "number",
610
782
  inputMode: "numeric",
611
783
  min: 1,
612
784
  max: 10,
613
- value: W.perceivedExertion,
614
- onChange: (e) => G((t) => ({
785
+ value: I.perceivedExertion,
786
+ onChange: (e) => L((t) => ({
615
787
  ...t,
616
788
  perceivedExertion: e.target.value
617
789
  })),
@@ -619,50 +791,50 @@ function M() {
619
791
  })]
620
792
  })]
621
793
  }),
622
- /* @__PURE__ */ g("div", {
794
+ /* @__PURE__ */ h("div", {
623
795
  className: "space-y-1.5",
624
- children: [/* @__PURE__ */ h(y, {
796
+ children: [/* @__PURE__ */ m(y, {
625
797
  htmlFor: "myb-complete-notes",
626
798
  children: "Notes"
627
- }), /* @__PURE__ */ h(Se, {
799
+ }), /* @__PURE__ */ m(Le, {
628
800
  id: "myb-complete-notes",
629
801
  rows: 3,
630
- value: W.notes,
631
- onChange: (e) => G((t) => ({
802
+ value: I.notes,
803
+ onChange: (e) => L((t) => ({
632
804
  ...t,
633
805
  notes: e.target.value
634
806
  })),
635
807
  placeholder: "How did the session feel?"
636
808
  })]
637
809
  }),
638
- K && /* @__PURE__ */ h("p", {
810
+ Ye && /* @__PURE__ */ m("p", {
639
811
  className: "text-sm text-status-error-text",
640
- children: K
812
+ children: Ye
641
813
  })
642
814
  ]
643
815
  }),
644
- /* @__PURE__ */ g(C, { children: [/* @__PURE__ */ h(_, {
816
+ /* @__PURE__ */ h(Ne, { children: [/* @__PURE__ */ m(g, {
645
817
  variant: "outline",
646
- onClick: () => U(!1),
818
+ onClick: () => F(!1),
647
819
  children: "Cancel"
648
- }), /* @__PURE__ */ h(_, {
820
+ }), /* @__PURE__ */ m(g, {
649
821
  onClick: async () => {
650
- q(null);
822
+ R(null);
651
823
  try {
652
- await L.mutateAsync({
653
- id: P,
824
+ await k.mutateAsync({
825
+ id: E,
654
826
  input: {
655
- caloriesBurned: k(W.caloriesBurned),
656
- perceivedExertion: k(W.perceivedExertion),
657
- notes: W.notes.trim() ? W.notes.trim() : void 0
827
+ caloriesBurned: S(I.caloriesBurned),
828
+ perceivedExertion: S(I.perceivedExertion),
829
+ notes: I.notes.trim() ? I.notes.trim() : void 0
658
830
  }
659
- }), U(!1);
831
+ }), F(!1);
660
832
  } catch (e) {
661
- q(e instanceof Error ? e.message : "Failed to complete the session.");
833
+ R(e instanceof Error ? e.message : "Failed to complete the session.");
662
834
  }
663
835
  },
664
- disabled: L.isPending,
665
- children: L.isPending ? "Completing…" : "Complete session"
836
+ disabled: k.isPending,
837
+ children: k.isPending ? "Completing…" : "Complete session"
666
838
  })] })
667
839
  ] })
668
840
  })
@@ -670,6 +842,6 @@ function M() {
670
842
  });
671
843
  }
672
844
  //#endregion
673
- export { M as SessionDetailPage };
845
+ export { w as SessionDetailPage };
674
846
 
675
847
  //# sourceMappingURL=SessionDetailPage.js.map