@burdenoff/microfe-atheletebridge 2026.1116.1 → 2026.1123.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/atheletebridge/AthleteBridgeRoot.js +71 -55
  2. package/dist/atheletebridge/AthleteBridgeRoot.js.map +1 -1
  3. package/dist/atheletebridge/AthleteBridgeRoutes.js +30 -6
  4. package/dist/atheletebridge/AthleteBridgeRoutes.js.map +1 -1
  5. package/dist/atheletebridge/components/MatchupRow.js +11 -2
  6. package/dist/atheletebridge/components/MatchupRow.js.map +1 -1
  7. package/dist/atheletebridge/components/analytics/AiInsightsPanel.d.ts +5 -0
  8. package/dist/atheletebridge/components/analytics/AiInsightsPanel.js +617 -0
  9. package/dist/atheletebridge/components/analytics/AiInsightsPanel.js.map +1 -0
  10. package/dist/atheletebridge/components/wearables/ConnectedDevicesPanel.d.ts +5 -0
  11. package/dist/atheletebridge/components/wearables/ConnectedDevicesPanel.js +453 -0
  12. package/dist/atheletebridge/components/wearables/ConnectedDevicesPanel.js.map +1 -0
  13. package/dist/atheletebridge/hooks/index.d.ts +2 -0
  14. package/dist/atheletebridge/hooks/index.js +1 -0
  15. package/dist/atheletebridge/hooks/useInsightsWearablesMarketplaceApi.d.ts +62 -0
  16. package/dist/atheletebridge/hooks/useInsightsWearablesMarketplaceApi.js +362 -0
  17. package/dist/atheletebridge/hooks/useInsightsWearablesMarketplaceApi.js.map +1 -0
  18. package/dist/atheletebridge/pages/DashboardPage.js +71 -1
  19. package/dist/atheletebridge/pages/DashboardPage.js.map +1 -1
  20. package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.d.ts +3 -1
  21. package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js +346 -317
  22. package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js.map +1 -1
  23. package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js +171 -159
  24. package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js.map +1 -1
  25. package/dist/atheletebridge/pages/devices/ConnectedDevicesPage.d.ts +1 -0
  26. package/dist/atheletebridge/pages/devices/ConnectedDevicesPage.js +14 -0
  27. package/dist/atheletebridge/pages/devices/ConnectedDevicesPage.js.map +1 -0
  28. package/dist/atheletebridge/pages/marketplace/MarketplacePage.d.ts +1 -0
  29. package/dist/atheletebridge/pages/marketplace/MarketplacePage.js +756 -0
  30. package/dist/atheletebridge/pages/marketplace/MarketplacePage.js.map +1 -0
  31. package/dist/atheletebridge/pages/performance/PerformancePage.js +296 -277
  32. package/dist/atheletebridge/pages/performance/PerformancePage.js.map +1 -1
  33. package/dist/atheletebridge/pages/sessions/SessionDetailPage.js +279 -147
  34. package/dist/atheletebridge/pages/sessions/SessionDetailPage.js.map +1 -1
  35. package/dist/atheletebridge/types/index.d.ts +1 -0
  36. package/dist/atheletebridge/types/insights.d.ts +270 -0
  37. package/package.json +1 -1
@@ -1,80 +1,81 @@
1
1
  import { PageLayout as e } from "../../components/PageLayout.js";
2
2
  import { AthleteSelect as t } from "../../components/AthleteSelect.js";
3
3
  import { StatusBadge as n } from "../../components/StatusBadge.js";
4
- import { Sparkline as r } from "../../components/viz/Sparkline.js";
5
- import { EmptyState as i } from "../../components/EmptyState.js";
4
+ import { EmptyState as r } from "../../components/EmptyState.js";
5
+ import { Sparkline as i } from "../../components/viz/Sparkline.js";
6
6
  import { ErrorState as a, LoadingState as o } from "../../components/LoadingState.js";
7
7
  import { CursorPager as s } from "../../components/CursorPager.js";
8
8
  import { FilterSelect as c } from "../../components/FilterSelect.js";
9
9
  import "../../components/viz/index.js";
10
10
  import { FormField as l, fieldInputClass as u } from "../../components/form.js";
11
11
  import { METRIC_TYPE_LABELS as d } from "../../components/domain.js";
12
- import { useAbTranslate as f } from "../../i18n.js";
13
- import { useLogWorkout as p, usePerformanceMetrics as m, useRecordMetric as h, useWorkoutLogs as g } from "../../hooks/useAthleteBridgeApi.js";
14
- import { formatDate as _, formatDuration as v } from "../../utils/formatters.js";
15
- import { cn as y } from "../../utils/cn.js";
16
- import { useMemo as b, useState as x } from "react";
17
- import { Activity as S, ArrowDown as C, ArrowUp as w, CalendarRange as T, Dumbbell as E, Gauge as D, HeartPulse as O, Loader2 as k, Move as A, Plus as j, Save as M, Scale as N, Target as P, Users as F, Zap as I } from "lucide-react";
18
- import { Fragment as L, jsx as R, jsxs as z } from "react/jsx-runtime";
19
- import { GlassCard as B, ResponsiveDialog as V, ResponsiveDialogContent as H, ResponsiveDialogFooter as U, ResponsiveDialogHeader as W, ResponsiveDialogTitle as G, ResponsiveTable as ee } from "@burdenoff/fe-libs/ui";
12
+ import { useAthleteBridge as f } from "../../context/AthleteBridgeContext.js";
13
+ import { useAbTranslate as p } from "../../i18n.js";
14
+ import { useLogWorkout as m, usePerformanceMetrics as h, useRecordMetric as g, useWorkoutLogs as _ } from "../../hooks/useAthleteBridgeApi.js";
15
+ import { formatDate as v, formatDuration as y } from "../../utils/formatters.js";
16
+ import { cn as b } from "../../utils/cn.js";
17
+ import { useMemo as x, useState as S } from "react";
18
+ import { Activity as C, ArrowDown as w, ArrowUp as T, CalendarRange as E, Dumbbell as D, Gauge as O, HeartPulse as k, Loader2 as A, Move as j, Plus as M, Save as N, Scale as P, Target as F, Users as ee, Watch as I, Zap as L } from "lucide-react";
19
+ import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
20
+ import { GlassCard as V, ResponsiveDialog as H, ResponsiveDialogContent as U, ResponsiveDialogFooter as W, ResponsiveDialogHeader as G, ResponsiveDialogTitle as K, ResponsiveTable as te } from "@burdenoff/fe-libs/ui";
20
21
  // src/atheletebridge/pages/performance/PerformancePage.tsx
21
- var K = 10, q = [
22
+ var q = 10, ne = [
22
23
  "COMPLETED",
23
24
  "PLANNED",
24
25
  "SKIPPED"
25
- ], J = Object.keys(d), te = 100, ne = { limit: 100 }, re = [
26
+ ], re = Object.keys(d), ie = 100, ae = { limit: 100 }, oe = [
26
27
  "7d",
27
28
  "28d",
28
29
  "90d"
29
- ], Y = {
30
+ ], se = {
30
31
  "7d": 7,
31
32
  "28d": 28,
32
33
  "90d": 90
33
- }, ie = (e) => {
34
+ }, J = (e) => {
34
35
  let t = /* @__PURE__ */ new Date();
35
36
  t.setHours(23, 59, 59, 999);
36
37
  let n = new Date(t);
37
- return n.setHours(0, 0, 0, 0), n.setDate(n.getDate() - (Y[e] - 1)), {
38
+ return n.setHours(0, 0, 0, 0), n.setDate(n.getDate() - (se[e] - 1)), {
38
39
  start: n.getTime(),
39
40
  end: t.getTime()
40
41
  };
41
- }, X = (e) => new Date(e).getTime(), ae = (e) => _(new Date(e), {
42
+ }, Y = (e) => new Date(e).getTime(), ce = (e) => v(new Date(e), {
42
43
  hour: void 0,
43
44
  minute: void 0,
44
45
  hour12: void 0
45
- }), oe = (e) => `${ae(e.start)} – ${ae(e.end)}`, se = (e, t) => {
46
+ }), le = (e) => `${ce(e.start)} – ${ce(e.end)}`, ue = (e, t) => {
46
47
  switch (e) {
47
48
  case "7d": return t("atheletebridge.pages.performance.window.last7", "Last 7 days");
48
49
  case "28d": return t("atheletebridge.pages.performance.window.last28", "Last 28 days");
49
50
  case "90d": return t("atheletebridge.pages.performance.window.last90", "Last 90 days");
50
51
  }
51
- }, ce = (e, t) => {
52
+ }, de = (e, t) => {
52
53
  switch (e) {
53
54
  case "7d": return t("atheletebridge.pages.performance.window.vsLast7", "vs previous 7 days");
54
55
  case "28d": return t("atheletebridge.pages.performance.window.vsLast28", "vs previous 28 days");
55
56
  case "90d": return t("atheletebridge.pages.performance.window.vsLast90", "vs previous 90 days");
56
57
  }
57
- }, le = (e, t) => {
58
+ }, fe = (e, t) => {
58
59
  switch (e) {
59
60
  case "7d": return t("atheletebridge.pages.performance.window.noPrior7", "No reading in the previous 7 days");
60
61
  case "28d": return t("atheletebridge.pages.performance.window.noPrior28", "No reading in the previous 28 days");
61
62
  case "90d": return t("atheletebridge.pages.performance.window.noPrior90", "No reading in the previous 90 days");
62
63
  }
63
- }, Z = "inline-flex items-center justify-center gap-1.5 rounded-lg px-4 py-2 text-sm font-semibold text-action-primary-text shadow-elevation-1 transition-[filter,box-shadow] hover:shadow-elevation-2 hover:brightness-110 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] bg-[linear-gradient(120deg,var(--color-action-primary-bg),color-mix(in_oklab,var(--color-action-primary-bg)_62%,var(--color-accent-purple)),var(--color-action-primary-bg))]", ue = {
64
- SPEED: I,
65
- ENDURANCE: S,
66
- STRENGTH: E,
67
- AGILITY: A,
68
- ACCURACY: P,
69
- WEIGHT: N,
70
- HEART_RATE: O,
71
- CUSTOM: D
72
- }, de = (e) => {
64
+ }, X = "inline-flex items-center justify-center gap-1.5 rounded-lg px-4 py-2 text-sm font-semibold text-action-primary-text shadow-elevation-1 transition-[filter,box-shadow] hover:shadow-elevation-2 hover:brightness-110 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] bg-[linear-gradient(120deg,var(--color-action-primary-bg),color-mix(in_oklab,var(--color-action-primary-bg)_62%,var(--color-accent-purple)),var(--color-action-primary-bg))]", pe = {
65
+ SPEED: L,
66
+ ENDURANCE: C,
67
+ STRENGTH: D,
68
+ AGILITY: j,
69
+ ACCURACY: F,
70
+ WEIGHT: P,
71
+ HEART_RATE: k,
72
+ CUSTOM: O
73
+ }, me = (e) => {
73
74
  let t = e.trim();
74
75
  if (!t) return;
75
76
  let n = Number.parseInt(t, 10);
76
77
  return Number.isNaN(n) ? void 0 : n;
77
- }, fe = (e) => {
78
+ }, Z = (e) => {
78
79
  let t = e.trim();
79
80
  if (!t) return;
80
81
  let n = Number.parseFloat(t);
@@ -83,80 +84,89 @@ var K = 10, q = [
83
84
  let e = /* @__PURE__ */ new Date();
84
85
  return (/* @__PURE__ */ new Date(e.getTime() - e.getTimezoneOffset() * 6e4)).toISOString().slice(0, 16);
85
86
  }, $ = (e) => (Math.abs(e) >= 100 ? e.toFixed(0) : e.toFixed(2)).replace(/\.?0+$/, "");
86
- function pe() {
87
- let n = f(), [r, a] = x({
87
+ function he() {
88
+ let n = p(), { navigateTo: i } = f(), [a, o] = S({
88
89
  athleteId: "",
89
90
  displayName: ""
90
91
  });
91
- return /* @__PURE__ */ z(e, {
92
+ return /* @__PURE__ */ B(e, {
92
93
  title: n("atheletebridge.pages.performance.title", "Performance"),
93
- description: n("atheletebridge.pages.performance.description", "Log workouts, record metrics and track an athlete's progress over time."),
94
- children: [/* @__PURE__ */ R("div", {
94
+ description: n("atheletebridge.pages.performance.description", "Track. Analyze. Improve — log workouts, record metrics and review an athlete's progress over time."),
95
+ actions: /* @__PURE__ */ B("button", {
96
+ type: "button",
97
+ onClick: () => i("/devices"),
98
+ className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
99
+ children: [/* @__PURE__ */ z(I, {
100
+ className: "h-4 w-4",
101
+ "aria-hidden": "true"
102
+ }), n("atheletebridge.pages.performance.connectedDevices", "Connected devices")]
103
+ }),
104
+ children: [/* @__PURE__ */ z("div", {
95
105
  "data-tour": "performance-athlete-picker",
96
106
  className: "sticky top-0 z-20 -mx-6 mb-8 bg-bg-canvas/80 px-6 pb-4 pt-1 backdrop-blur supports-[backdrop-filter]:bg-bg-canvas/60",
97
- children: /* @__PURE__ */ R(B, {
107
+ children: /* @__PURE__ */ z(V, {
98
108
  treatment: "insight",
99
109
  className: "p-5 sm:p-6",
100
- children: /* @__PURE__ */ R(t, {
101
- athleteId: r.athleteId,
102
- onSelect: a,
110
+ children: /* @__PURE__ */ z(t, {
111
+ athleteId: a.athleteId,
112
+ onSelect: o,
103
113
  idPrefix: "perf-athlete"
104
114
  })
105
115
  })
106
- }), r.athleteId ? /* @__PURE__ */ R(me, {
107
- athleteId: r.athleteId,
108
- displayName: r.displayName
109
- }) : /* @__PURE__ */ R(i, {
116
+ }), a.athleteId ? /* @__PURE__ */ z(ge, {
117
+ athleteId: a.athleteId,
118
+ displayName: a.displayName
119
+ }) : /* @__PURE__ */ z(r, {
110
120
  illustration: "empty-data",
111
- icon: /* @__PURE__ */ R(F, { className: "h-10 w-10" }),
121
+ icon: /* @__PURE__ */ z(ee, { className: "h-10 w-10" }),
112
122
  title: n("atheletebridge.pages.performance.pickAthleteTitle", "Pick an athlete to begin"),
113
123
  description: n("atheletebridge.pages.performance.pickAthleteHint", "Choose a team and an athlete above to log workouts, record metrics and review their history.")
114
124
  })]
115
125
  });
116
126
  }
117
- function me({ athleteId: e, displayName: t }) {
118
- let r = f(), [l, u] = x(0), [d, p] = x(""), [h, C] = x(!1), [w, O] = x(!1), k = b(() => d === "" ? null : ie(d), [d]), A = g({
127
+ function ge({ athleteId: e, displayName: t }) {
128
+ let i = p(), [l, u] = S(0), [d, f] = S(""), [m, g] = S(!1), [w, T] = S(!1), k = x(() => d === "" ? null : J(d), [d]), A = _({
119
129
  athleteId: e,
120
- pagination: k ? { limit: te } : {
121
- limit: K,
122
- offset: l * K
130
+ pagination: k ? { limit: ie } : {
131
+ limit: q,
132
+ offset: l * q
123
133
  }
124
- }), M = m(e, ne), N = b(() => A.data?.items ?? [], [A.data]), P = A.data?.pageInfo.hasMore ?? !1, F = b(() => k ? N.filter((e) => {
125
- let t = X(e.performedAt);
134
+ }), j = h(e, ae), N = x(() => A.data?.items ?? [], [A.data]), P = A.data?.pageInfo.hasMore ?? !1, F = x(() => k ? N.filter((e) => {
135
+ let t = Y(e.performedAt);
126
136
  return t >= k.start && t <= k.end;
127
- }) : N, [N, k]), I = k ? Math.max(0, Math.ceil(F.length / K) - 1) : l, V = Math.min(l, I), H = k ? F.slice(V * K, (V + 1) * K) : F, U = k ? F.length > (V + 1) * K : P, W = b(() => {
137
+ }) : N, [N, k]), ee = k ? Math.max(0, Math.ceil(F.length / q) - 1) : l, I = Math.min(l, ee), L = k ? F.slice(I * q, (I + 1) * q) : F, H = k ? F.length > (I + 1) * q : P, U = x(() => {
128
138
  if (!k || !P) return !0;
129
139
  let e = N[N.length - 1];
130
- return e != null && X(e.performedAt) <= k.start;
140
+ return e != null && Y(e.performedAt) <= k.start;
131
141
  }, [
132
142
  k,
133
143
  P,
134
144
  N
135
- ]), G = b(() => re.map((e) => ({
145
+ ]), W = x(() => oe.map((e) => ({
136
146
  value: e,
137
- label: `${se(e, r)} · ${oe(ie(e))}`
138
- })), [r]), q = b(() => d === "" ? {
139
- comparison: r("atheletebridge.pages.performance.window.vsPrevious", "vs previous"),
140
- noComparison: r("atheletebridge.pages.performance.window.firstReading", "First reading")
147
+ label: `${ue(e, i)} · ${le(J(e))}`
148
+ })), [i]), G = x(() => d === "" ? {
149
+ comparison: i("atheletebridge.pages.performance.window.vsPrevious", "vs previous"),
150
+ noComparison: i("atheletebridge.pages.performance.window.firstReading", "First reading")
141
151
  } : {
142
- comparison: ce(d, r),
143
- noComparison: le(d, r)
144
- }, [d, r]), J = b(() => {
152
+ comparison: de(d, i),
153
+ noComparison: fe(d, i)
154
+ }, [d, i]), K = x(() => {
145
155
  let e = /* @__PURE__ */ new Map();
146
- for (let t of M.data ?? []) {
156
+ for (let t of j.data ?? []) {
147
157
  let n = `${t.type}::${t.label}`, r = e.get(n) ?? [];
148
158
  r.push(t), e.set(n, r);
149
159
  }
150
160
  return Array.from(e.entries()).map(([e, t]) => {
151
- let n = [...t].sort((e, t) => X(e.recordedAt) - X(t.recordedAt)), r = k ? n.filter((e) => {
152
- let t = X(e.recordedAt);
161
+ let n = [...t].sort((e, t) => Y(e.recordedAt) - Y(t.recordedAt)), r = k ? n.filter((e) => {
162
+ let t = Y(e.recordedAt);
153
163
  return t >= k.start && t <= k.end;
154
164
  }) : n;
155
165
  if (r.length === 0) return null;
156
166
  let i = r.map((e) => e.value), a = r[r.length - 1], o = null;
157
167
  if (k) {
158
168
  let e = k.start - (k.end - k.start + 1), t = n.filter((t) => {
159
- let n = X(t.recordedAt);
169
+ let n = Y(t.recordedAt);
160
170
  return n >= e && n < k.start;
161
171
  });
162
172
  o = t.length > 0 ? t[t.length - 1].value : null;
@@ -173,23 +183,23 @@ function me({ athleteId: e, displayName: t }) {
173
183
  series: i,
174
184
  recordedAt: a.recordedAt
175
185
  };
176
- }).filter((e) => e !== null).sort((e, t) => X(t.recordedAt) - X(e.recordedAt));
177
- }, [M.data, k]), Y = b(() => [
186
+ }).filter((e) => e !== null).sort((e, t) => Y(t.recordedAt) - Y(e.recordedAt));
187
+ }, [j.data, k]), ne = x(() => [
178
188
  {
179
189
  key: "workout",
180
- header: r("atheletebridge.pages.performance.column.workout", "Workout"),
190
+ header: i("atheletebridge.pages.performance.column.workout", "Workout"),
181
191
  priority: "primary",
182
192
  cell: (e) => {
183
- let t = he(e.title);
184
- return /* @__PURE__ */ z("div", {
193
+ let t = _e(e.title);
194
+ return /* @__PURE__ */ B("div", {
185
195
  className: "flex items-center gap-3",
186
- children: [/* @__PURE__ */ R("span", {
196
+ children: [/* @__PURE__ */ z("span", {
187
197
  className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-[var(--color-accent-teal)]",
188
- children: /* @__PURE__ */ R(t, {
198
+ children: /* @__PURE__ */ z(t, {
189
199
  className: "h-4 w-4",
190
200
  "aria-hidden": "true"
191
201
  })
192
- }), /* @__PURE__ */ R("span", {
202
+ }), /* @__PURE__ */ z("span", {
193
203
  className: "min-w-0 truncate font-medium text-text-primary",
194
204
  children: e.title
195
205
  })]
@@ -198,234 +208,234 @@ function me({ athleteId: e, displayName: t }) {
198
208
  },
199
209
  {
200
210
  key: "duration",
201
- header: r("atheletebridge.pages.performance.column.duration", "Duration"),
211
+ header: i("atheletebridge.pages.performance.column.duration", "Duration"),
202
212
  priority: "secondary",
203
- mobileLabel: r("atheletebridge.pages.performance.column.duration", "Duration"),
204
- cell: (e) => e.durationMin == null ? /* @__PURE__ */ R("span", {
213
+ mobileLabel: i("atheletebridge.pages.performance.column.duration", "Duration"),
214
+ cell: (e) => e.durationMin == null ? /* @__PURE__ */ z("span", {
205
215
  className: "text-text-muted",
206
216
  children: "—"
207
- }) : /* @__PURE__ */ R("span", {
217
+ }) : /* @__PURE__ */ z("span", {
208
218
  className: "tabular-nums text-text-secondary",
209
- children: v(e.durationMin)
219
+ children: y(e.durationMin)
210
220
  })
211
221
  },
212
222
  {
213
223
  key: "rpe",
214
- header: r("atheletebridge.pages.performance.column.rpe", "RPE"),
224
+ header: i("atheletebridge.pages.performance.column.rpe", "RPE"),
215
225
  priority: "secondary",
216
- mobileLabel: r("atheletebridge.pages.performance.column.rpe", "RPE"),
217
- cell: (e) => e.rpe == null ? /* @__PURE__ */ R("span", {
226
+ mobileLabel: i("atheletebridge.pages.performance.column.rpe", "RPE"),
227
+ cell: (e) => e.rpe == null ? /* @__PURE__ */ z("span", {
218
228
  className: "text-text-muted",
219
229
  children: "—"
220
- }) : /* @__PURE__ */ R(ge, { rpe: e.rpe })
230
+ }) : /* @__PURE__ */ z(ve, { rpe: e.rpe })
221
231
  },
222
232
  {
223
233
  key: "date",
224
- header: r("atheletebridge.pages.performance.column.date", "Date"),
234
+ header: i("atheletebridge.pages.performance.column.date", "Date"),
225
235
  priority: "secondary",
226
- mobileLabel: r("atheletebridge.pages.performance.column.date", "Date"),
227
- cell: (e) => /* @__PURE__ */ R("span", {
236
+ mobileLabel: i("atheletebridge.pages.performance.column.date", "Date"),
237
+ cell: (e) => /* @__PURE__ */ z("span", {
228
238
  className: "tabular-nums text-text-secondary",
229
- children: _(e.performedAt)
239
+ children: v(e.performedAt)
230
240
  })
231
241
  },
232
242
  {
233
243
  key: "status",
234
- header: r("atheletebridge.pages.performance.column.status", "Status"),
244
+ header: i("atheletebridge.pages.performance.column.status", "Status"),
235
245
  priority: "primary",
236
- mobileLabel: r("atheletebridge.pages.performance.column.status", "Status"),
237
- cell: (e) => /* @__PURE__ */ R(n, { status: e.status })
246
+ mobileLabel: i("atheletebridge.pages.performance.column.status", "Status"),
247
+ cell: (e) => /* @__PURE__ */ z(n, { status: e.status })
238
248
  },
239
249
  {
240
250
  key: "notes",
241
- header: r("atheletebridge.pages.performance.column.notes", "Notes"),
251
+ header: i("atheletebridge.pages.performance.column.notes", "Notes"),
242
252
  priority: "hidden-on-mobile",
243
- cell: (e) => e.notes ? /* @__PURE__ */ R("span", {
253
+ cell: (e) => e.notes ? /* @__PURE__ */ z("span", {
244
254
  className: "line-clamp-2 max-w-[22ch] text-text-secondary",
245
255
  children: e.notes
246
- }) : /* @__PURE__ */ R("span", {
256
+ }) : /* @__PURE__ */ z("span", {
247
257
  className: "text-text-muted",
248
258
  children: "—"
249
259
  })
250
260
  }
251
- ], [r]);
252
- return /* @__PURE__ */ z("div", {
261
+ ], [i]);
262
+ return /* @__PURE__ */ B("div", {
253
263
  className: "space-y-8 pb-24 sm:pb-0",
254
264
  children: [
255
- /* @__PURE__ */ z("div", {
265
+ /* @__PURE__ */ B("div", {
256
266
  className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
257
- children: [/* @__PURE__ */ z("p", {
267
+ children: [/* @__PURE__ */ B("p", {
258
268
  className: "text-sm text-text-secondary",
259
269
  children: [
260
- r("atheletebridge.pages.performance.tracking", "Tracking"),
270
+ i("atheletebridge.pages.performance.tracking", "Tracking"),
261
271
  " ",
262
- /* @__PURE__ */ R("span", {
272
+ /* @__PURE__ */ z("span", {
263
273
  className: "font-medium text-text-primary",
264
- children: t || r("atheletebridge.pages.performance.athleteFallback", "athlete")
274
+ children: t || i("atheletebridge.pages.performance.athleteFallback", "athlete")
265
275
  }),
266
- k ? /* @__PURE__ */ z(L, { children: [" · ", /* @__PURE__ */ R("span", {
276
+ k ? /* @__PURE__ */ B(R, { children: [" · ", /* @__PURE__ */ z("span", {
267
277
  className: "tabular-nums text-text-muted",
268
- children: oe(k)
278
+ children: le(k)
269
279
  })] }) : null
270
280
  ]
271
- }), /* @__PURE__ */ z("div", {
281
+ }), /* @__PURE__ */ B("div", {
272
282
  className: "flex flex-wrap items-center gap-2",
273
283
  children: [
274
- /* @__PURE__ */ z("span", {
284
+ /* @__PURE__ */ B("span", {
275
285
  className: "flex items-center gap-2",
276
286
  "data-tour": "performance-date-range",
277
- children: [/* @__PURE__ */ R(T, {
287
+ children: [/* @__PURE__ */ z(E, {
278
288
  className: "h-4 w-4 shrink-0 text-text-muted",
279
289
  "aria-hidden": "true"
280
- }), /* @__PURE__ */ R(c, {
290
+ }), /* @__PURE__ */ z(c, {
281
291
  value: d,
282
292
  onChange: (e) => {
283
- p(e), u(0);
293
+ f(e), u(0);
284
294
  },
285
- options: G,
286
- allLabel: r("atheletebridge.pages.performance.window.allTime", "All time"),
287
- ariaLabel: r("atheletebridge.pages.performance.window.ariaLabel", "Date range")
295
+ options: W,
296
+ allLabel: i("atheletebridge.pages.performance.window.allTime", "All time"),
297
+ ariaLabel: i("atheletebridge.pages.performance.window.ariaLabel", "Date range")
288
298
  })]
289
299
  }),
290
- /* @__PURE__ */ z("button", {
300
+ /* @__PURE__ */ B("button", {
291
301
  type: "button",
292
- onClick: () => O(!0),
302
+ onClick: () => T(!0),
293
303
  className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
294
304
  children: [
295
- /* @__PURE__ */ R(D, { className: "h-4 w-4" }),
305
+ /* @__PURE__ */ z(O, { className: "h-4 w-4" }),
296
306
  " ",
297
- r("atheletebridge.pages.performance.recordMetric", "Record metric")
307
+ i("atheletebridge.pages.performance.recordMetric", "Record metric")
298
308
  ]
299
309
  }),
300
- /* @__PURE__ */ z("button", {
310
+ /* @__PURE__ */ B("button", {
301
311
  type: "button",
302
- onClick: () => C(!0),
303
- className: y(Z, "hidden sm:inline-flex"),
312
+ onClick: () => g(!0),
313
+ className: b(X, "hidden sm:inline-flex"),
304
314
  children: [
305
- /* @__PURE__ */ R(E, { className: "h-4 w-4" }),
315
+ /* @__PURE__ */ z(D, { className: "h-4 w-4" }),
306
316
  " ",
307
- r("atheletebridge.pages.performance.logWorkout", "Log workout")
317
+ i("atheletebridge.pages.performance.logWorkout", "Log workout")
308
318
  ]
309
319
  })
310
320
  ]
311
321
  })]
312
322
  }),
313
- /* @__PURE__ */ z("section", { children: [/* @__PURE__ */ R("h2", {
323
+ /* @__PURE__ */ B("section", { children: [/* @__PURE__ */ z("h2", {
314
324
  className: "mb-4 text-lg font-semibold text-text-primary",
315
- children: r("atheletebridge.pages.performance.metricsTitle", "Performance metrics")
316
- }), M.isLoading ? /* @__PURE__ */ R(o, { label: r("atheletebridge.pages.performance.loadingMetrics", "Loading metrics…") }) : M.isError ? /* @__PURE__ */ R(a, { onRetry: () => void M.refetch() }) : J.length === 0 ? /* @__PURE__ */ R(i, {
325
+ children: i("atheletebridge.pages.performance.metricsTitle", "Performance metrics")
326
+ }), j.isLoading ? /* @__PURE__ */ z(o, { label: i("atheletebridge.pages.performance.loadingMetrics", "Loading metrics…") }) : j.isError ? /* @__PURE__ */ z(a, { onRetry: () => void j.refetch() }) : K.length === 0 ? /* @__PURE__ */ z(r, {
317
327
  illustration: "empty-data",
318
- icon: /* @__PURE__ */ R(D, { className: "h-10 w-10" }),
319
- title: k ? r("atheletebridge.pages.performance.metrics.emptyWindowTitle", "No metrics in this window") : r("atheletebridge.pages.performance.metrics.emptyTitle", "No metrics recorded"),
320
- description: k ? r("atheletebridge.pages.performance.metrics.emptyWindowDescription", "Nothing was recorded for this athlete in the selected period. Widen the date range, or record a metric.") : r("atheletebridge.pages.performance.noMetricsDescription", "Record a metric — speed, strength, endurance and more — to start charting progress."),
321
- action: /* @__PURE__ */ z("button", {
328
+ icon: /* @__PURE__ */ z(O, { className: "h-10 w-10" }),
329
+ title: k ? i("atheletebridge.pages.performance.metrics.emptyWindowTitle", "No metrics in this window") : i("atheletebridge.pages.performance.metrics.emptyTitle", "No metrics recorded"),
330
+ description: k ? i("atheletebridge.pages.performance.metrics.emptyWindowDescription", "Nothing was recorded for this athlete in the selected period. Widen the date range, or record a metric.") : i("atheletebridge.pages.performance.noMetricsDescription", "Record a metric — speed, strength, endurance and more — to start charting progress."),
331
+ action: /* @__PURE__ */ B("button", {
322
332
  type: "button",
323
- onClick: () => O(!0),
324
- className: Z,
333
+ onClick: () => T(!0),
334
+ className: X,
325
335
  children: [
326
- /* @__PURE__ */ R(j, { className: "h-4 w-4" }),
336
+ /* @__PURE__ */ z(M, { className: "h-4 w-4" }),
327
337
  " ",
328
- r("atheletebridge.pages.performance.recordMetricAction", "Record metric")
338
+ i("atheletebridge.pages.performance.recordMetricAction", "Record metric")
329
339
  ]
330
340
  })
331
- }) : /* @__PURE__ */ R("div", {
332
- className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
333
- children: J.map((e) => /* @__PURE__ */ R(_e, {
341
+ }) : /* @__PURE__ */ z("div", {
342
+ className: "grid grid-cols-2 gap-3 sm:gap-4 lg:grid-cols-3",
343
+ children: K.map((e) => /* @__PURE__ */ z(ye, {
334
344
  metric: e,
335
- labels: q,
336
- tr: r
345
+ labels: G,
346
+ tr: i
337
347
  }, e.key))
338
348
  })] }),
339
- /* @__PURE__ */ z("section", { children: [
340
- /* @__PURE__ */ R("h2", {
349
+ /* @__PURE__ */ B("section", { children: [
350
+ /* @__PURE__ */ z("h2", {
341
351
  className: "mb-4 text-lg font-semibold text-text-primary",
342
- children: r("atheletebridge.pages.performance.workoutsTitle", "Workout history")
352
+ children: i("atheletebridge.pages.performance.workoutsTitle", "Workout history")
343
353
  }),
344
- A.isLoading ? /* @__PURE__ */ R(o, { label: r("atheletebridge.pages.performance.loadingWorkouts", "Loading workouts…") }) : A.isError ? /* @__PURE__ */ R(a, { onRetry: () => void A.refetch() }) : H.length === 0 ? /* @__PURE__ */ R(i, {
354
+ A.isLoading ? /* @__PURE__ */ z(o, { label: i("atheletebridge.pages.performance.loadingWorkouts", "Loading workouts…") }) : A.isError ? /* @__PURE__ */ z(a, { onRetry: () => void A.refetch() }) : L.length === 0 ? /* @__PURE__ */ z(r, {
345
355
  illustration: "empty-data",
346
- icon: /* @__PURE__ */ R(S, { className: "h-10 w-10" }),
347
- title: k ? r("atheletebridge.pages.performance.workouts.emptyWindowTitle", "No workouts in this window") : r("atheletebridge.pages.performance.workouts.emptyTitle", "No workouts logged"),
348
- description: k ? r("atheletebridge.pages.performance.workouts.emptyWindowDescription", "Nothing was logged for this athlete in the selected period. Widen the date range, or log a workout.") : r("atheletebridge.pages.performance.noWorkoutsDescription", "Log a workout to build this athlete's training history."),
349
- action: /* @__PURE__ */ z("button", {
356
+ icon: /* @__PURE__ */ z(C, { className: "h-10 w-10" }),
357
+ title: k ? i("atheletebridge.pages.performance.workouts.emptyWindowTitle", "No workouts in this window") : i("atheletebridge.pages.performance.workouts.emptyTitle", "No workouts logged"),
358
+ description: k ? i("atheletebridge.pages.performance.workouts.emptyWindowDescription", "Nothing was logged for this athlete in the selected period. Widen the date range, or log a workout.") : i("atheletebridge.pages.performance.noWorkoutsDescription", "Log a workout to build this athlete's training history."),
359
+ action: /* @__PURE__ */ B("button", {
350
360
  type: "button",
351
- onClick: () => C(!0),
352
- className: Z,
361
+ onClick: () => g(!0),
362
+ className: X,
353
363
  children: [
354
- /* @__PURE__ */ R(E, { className: "h-4 w-4" }),
364
+ /* @__PURE__ */ z(D, { className: "h-4 w-4" }),
355
365
  " ",
356
- r("atheletebridge.pages.performance.logWorkout", "Log workout")
366
+ i("atheletebridge.pages.performance.logWorkout", "Log workout")
357
367
  ]
358
368
  })
359
- }) : /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R(B, {
369
+ }) : /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(V, {
360
370
  treatment: "metric",
361
371
  className: "overflow-hidden p-1 sm:p-2",
362
- children: /* @__PURE__ */ R(ee, {
363
- columns: Y,
364
- data: H,
372
+ children: /* @__PURE__ */ z(te, {
373
+ columns: ne,
374
+ data: L,
365
375
  rowKey: (e) => e.id,
366
- caption: r("atheletebridge.pages.performance.workouts.caption", "Workout history for {{name}}").replace("{{name}}", t || r("atheletebridge.pages.performance.athleteFallback", "athlete"))
376
+ caption: i("atheletebridge.pages.performance.workouts.caption", "Workout history for {{name}}").replace("{{name}}", t || i("atheletebridge.pages.performance.athleteFallback", "athlete"))
367
377
  })
368
- }), /* @__PURE__ */ R(s, {
378
+ }), /* @__PURE__ */ z(s, {
369
379
  className: "mt-6",
370
- page: V,
371
- hasMore: U,
372
- onPrev: () => u(Math.max(0, V - 1)),
373
- onNext: () => u(V + 1)
380
+ page: I,
381
+ hasMore: H,
382
+ onPrev: () => u(Math.max(0, I - 1)),
383
+ onNext: () => u(I + 1)
374
384
  })] }),
375
- W ? null : /* @__PURE__ */ R("p", {
385
+ U ? null : /* @__PURE__ */ z("p", {
376
386
  className: "mt-3 text-xs text-text-muted",
377
- children: r("atheletebridge.pages.performance.workouts.windowTruncated", "Only the most recent page of workouts was searched, and it does not reach back to the start of this window — older sessions in the range are not listed.")
387
+ children: i("atheletebridge.pages.performance.workouts.windowTruncated", "Only the most recent page of workouts was searched, and it does not reach back to the start of this window — older sessions in the range are not listed.")
378
388
  })
379
389
  ] }),
380
- /* @__PURE__ */ R("div", {
390
+ /* @__PURE__ */ z("div", {
381
391
  className: "sticky bottom-0 z-30 -mx-6 border-t border-border-seam bg-bg-canvas/85 px-6 pb-[max(env(safe-area-inset-bottom),0.75rem)] pt-3 backdrop-blur sm:hidden",
382
- children: /* @__PURE__ */ z("button", {
392
+ children: /* @__PURE__ */ B("button", {
383
393
  type: "button",
384
- onClick: () => C(!0),
385
- className: y(Z, "w-full py-3 text-base"),
394
+ onClick: () => g(!0),
395
+ className: b(X, "w-full py-3 text-base"),
386
396
  children: [
387
- /* @__PURE__ */ R(j, { className: "h-5 w-5" }),
397
+ /* @__PURE__ */ z(M, { className: "h-5 w-5" }),
388
398
  " ",
389
- r("atheletebridge.pages.performance.logWorkout", "Log workout")
399
+ i("atheletebridge.pages.performance.logWorkout", "Log workout")
390
400
  ]
391
401
  })
392
402
  }),
393
- /* @__PURE__ */ R(ve, {
394
- open: h,
395
- onOpenChange: C,
403
+ /* @__PURE__ */ z(be, {
404
+ open: m,
405
+ onOpenChange: g,
396
406
  athleteId: e,
397
407
  displayName: t
398
408
  }),
399
- /* @__PURE__ */ R(ye, {
409
+ /* @__PURE__ */ z(xe, {
400
410
  open: w,
401
- onOpenChange: O,
411
+ onOpenChange: T,
402
412
  athleteId: e,
403
413
  displayName: t
404
414
  })
405
415
  ]
406
416
  });
407
417
  }
408
- function he(e) {
418
+ function _e(e) {
409
419
  let t = e.toLowerCase();
410
- return /strength|lift|squat|deadlift|bench|1rm|weight/.test(t) ? E : /speed|sprint|agility|accel|split/.test(t) ? I : /endurance|aerobic|cardio|run|beep|yo-?yo/.test(t) ? S : /recovery|mobility|stretch|rest/.test(t) ? O : /accuracy|shoot|target/.test(t) ? P : E;
420
+ return /strength|lift|squat|deadlift|bench|1rm|weight/.test(t) ? D : /speed|sprint|agility|accel|split/.test(t) ? L : /endurance|aerobic|cardio|run|beep|yo-?yo/.test(t) ? C : /recovery|mobility|stretch|rest/.test(t) ? k : /accuracy|shoot|target/.test(t) ? F : D;
411
421
  }
412
- function ge({ rpe: e }) {
413
- return /* @__PURE__ */ R("span", {
414
- className: y("inline-flex h-7 min-w-[1.75rem] items-center justify-center rounded-md border px-1.5 text-sm font-semibold tabular-nums", e >= 8 ? "border-status-error-border text-status-error-text" : e >= 5 ? "border-status-warning-border text-status-warning-text" : "border-border-seam text-text-secondary"),
422
+ function ve({ rpe: e }) {
423
+ return /* @__PURE__ */ z("span", {
424
+ className: b("inline-flex h-7 min-w-[1.75rem] items-center justify-center rounded-md border px-1.5 text-sm font-semibold tabular-nums", e >= 8 ? "border-status-error-border text-status-error-text" : e >= 5 ? "border-status-warning-border text-status-warning-text" : "border-border-seam text-text-secondary"),
415
425
  children: e
416
426
  });
417
427
  }
418
- function _e({ metric: e, labels: t, tr: n }) {
419
- let i = ue[e.type], a = e.previous == null ? null : e.latest - e.previous, o = e.max > e.min, s = o ? Math.round((e.latest - e.min) / (e.max - e.min) * 100) : 100, c = e.unit ? ` ${e.unit}` : "";
420
- return /* @__PURE__ */ z(B, {
428
+ function ye({ metric: e, labels: t, tr: n }) {
429
+ let r = pe[e.type], a = e.previous == null ? null : e.latest - e.previous, o = e.max > e.min, s = o ? Math.round((e.latest - e.min) / (e.max - e.min) * 100) : 100, c = e.unit ? ` ${e.unit}` : "";
430
+ return /* @__PURE__ */ B(V, {
421
431
  treatment: "metric",
422
432
  className: "flex flex-col gap-3 p-5",
423
433
  children: [
424
- /* @__PURE__ */ z("div", {
434
+ /* @__PURE__ */ B("div", {
425
435
  className: "flex items-center justify-between gap-2",
426
- children: [/* @__PURE__ */ z("span", {
436
+ children: [/* @__PURE__ */ B("span", {
427
437
  className: "flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-[var(--color-accent-teal)]",
428
- children: [/* @__PURE__ */ R(i, {
438
+ children: [/* @__PURE__ */ z(r, {
429
439
  className: "h-4 w-4",
430
440
  "aria-hidden": "true"
431
441
  }), ((e) => {
@@ -440,28 +450,28 @@ function _e({ metric: e, labels: t, tr: n }) {
440
450
  case "CUSTOM": return n("atheletebridge.metricType.custom", "Custom");
441
451
  }
442
452
  })(e.type)]
443
- }), /* @__PURE__ */ R("span", {
453
+ }), /* @__PURE__ */ z("span", {
444
454
  className: "text-xs text-text-muted",
445
- children: _(e.recordedAt)
455
+ children: v(e.recordedAt)
446
456
  })]
447
457
  }),
448
- /* @__PURE__ */ z("div", {
458
+ /* @__PURE__ */ B("div", {
449
459
  className: "flex items-end justify-between gap-3",
450
- children: [/* @__PURE__ */ z("div", {
460
+ children: [/* @__PURE__ */ B("div", {
451
461
  className: "min-w-0",
452
- children: [/* @__PURE__ */ R("p", {
462
+ children: [/* @__PURE__ */ z("p", {
453
463
  className: "truncate text-sm text-text-secondary",
454
464
  children: e.label
455
- }), /* @__PURE__ */ z("p", {
465
+ }), /* @__PURE__ */ B("p", {
456
466
  className: "mt-0.5 text-3xl font-bold leading-none tracking-tight tabular-nums text-text-primary",
457
- children: [$(e.latest), e.unit ? /* @__PURE__ */ R("span", {
467
+ children: [$(e.latest), e.unit ? /* @__PURE__ */ z("span", {
458
468
  className: "ml-1 text-base font-medium text-text-secondary",
459
469
  children: e.unit
460
470
  }) : null]
461
471
  })]
462
- }), e.series.length > 1 ? /* @__PURE__ */ R("div", {
472
+ }), e.series.length > 1 ? /* @__PURE__ */ z("div", {
463
473
  className: "w-24 shrink-0 sm:w-28",
464
- children: /* @__PURE__ */ R(r, {
474
+ children: /* @__PURE__ */ z(i, {
465
475
  data: e.series,
466
476
  variant: "area",
467
477
  height: 40,
@@ -469,44 +479,53 @@ function _e({ metric: e, labels: t, tr: n }) {
469
479
  })
470
480
  }) : null]
471
481
  }),
472
- o ? /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("span", {
473
- className: "block h-1.5 overflow-hidden rounded-full bg-bg-sunken",
474
- "aria-hidden": "true",
475
- children: /* @__PURE__ */ R("span", {
476
- className: "block h-1.5 rounded-full bg-[var(--color-accent-teal)]",
477
- style: { width: `${Math.max(4, Math.min(100, s))}%` }
478
- })
479
- }), /* @__PURE__ */ z("div", {
482
+ o ? /* @__PURE__ */ B("div", { children: [/* @__PURE__ */ B("div", {
483
+ className: "flex items-center gap-2",
484
+ children: [/* @__PURE__ */ z("span", {
485
+ className: "block h-1.5 flex-1 overflow-hidden rounded-full bg-bg-sunken",
486
+ "aria-hidden": "true",
487
+ children: /* @__PURE__ */ z("span", {
488
+ className: "block h-1.5 rounded-full bg-[var(--color-accent-teal)]",
489
+ style: { width: `${Math.max(4, Math.min(100, s))}%` }
490
+ })
491
+ }), /* @__PURE__ */ B("span", {
492
+ className: "shrink-0 text-[0.7rem] font-semibold tabular-nums text-[var(--color-accent-teal)]",
493
+ children: [s, "%"]
494
+ })]
495
+ }), /* @__PURE__ */ B("div", {
480
496
  className: "mt-1 flex justify-between text-[0.7rem] tabular-nums text-text-muted",
481
497
  children: [
482
- /* @__PURE__ */ R("span", { children: $(e.min) }),
483
- /* @__PURE__ */ R("span", { children: $((e.min + e.max) / 2) }),
484
- /* @__PURE__ */ R("span", { children: $(e.max) })
498
+ /* @__PURE__ */ z("span", { children: $(e.min) }),
499
+ /* @__PURE__ */ z("span", {
500
+ className: "hidden sm:inline",
501
+ children: $((e.min + e.max) / 2)
502
+ }),
503
+ /* @__PURE__ */ z("span", { children: $(e.max) })
485
504
  ]
486
505
  })] }) : null,
487
- /* @__PURE__ */ R("div", {
506
+ /* @__PURE__ */ z("div", {
488
507
  className: "mt-auto flex items-center gap-1.5 text-sm",
489
- children: a == null ? /* @__PURE__ */ R("span", {
508
+ children: a == null ? /* @__PURE__ */ z("span", {
490
509
  className: "text-text-muted",
491
510
  children: t.noComparison
492
- }) : a === 0 ? /* @__PURE__ */ z("span", {
511
+ }) : a === 0 ? /* @__PURE__ */ B("span", {
493
512
  className: "text-text-muted",
494
513
  children: [
495
514
  n("atheletebridge.pages.performance.window.noChange", "No change"),
496
515
  " ",
497
516
  t.comparison
498
517
  ]
499
- }) : /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ z("span", {
518
+ }) : /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ B("span", {
500
519
  className: "inline-flex items-center gap-0.5 font-medium tabular-nums text-text-secondary",
501
520
  children: [
502
- R(a > 0 ? w : C, {
521
+ z(a > 0 ? T : w, {
503
522
  className: "h-4 w-4",
504
523
  "aria-hidden": "true"
505
524
  }),
506
525
  $(Math.abs(a)),
507
526
  c
508
527
  ]
509
- }), /* @__PURE__ */ R("span", {
528
+ }), /* @__PURE__ */ z("span", {
510
529
  className: "text-text-muted",
511
530
  children: t.comparison
512
531
  })] })
@@ -514,32 +533,32 @@ function _e({ metric: e, labels: t, tr: n }) {
514
533
  ]
515
534
  });
516
535
  }
517
- function ve({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
518
- let i = f(), a = p(), [o, s] = x(""), [c, d] = x("COMPLETED"), [m, h] = x(Q), [g, _] = x(""), [v, b] = x(""), [S, C] = x(""), [w, T] = x(""), [E, D] = x(null), O = () => {
519
- s(""), d("COMPLETED"), h(Q()), _(""), b(""), C(""), T(""), D(null);
520
- }, A = (e) => {
536
+ function be({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
537
+ let i = p(), a = m(), [o, s] = S(""), [c, d] = S("COMPLETED"), [f, h] = S(Q), [g, _] = S(""), [v, y] = S(""), [x, C] = S(""), [w, T] = S(""), [E, D] = S(null), O = () => {
538
+ s(""), d("COMPLETED"), h(Q()), _(""), y(""), C(""), T(""), D(null);
539
+ }, k = (e) => {
521
540
  switch (e) {
522
541
  case "COMPLETED": return i("atheletebridge.workoutStatus.completed", "Completed");
523
542
  case "PLANNED": return i("atheletebridge.workoutStatus.planned", "Planned");
524
543
  case "SKIPPED": return i("atheletebridge.workoutStatus.skipped", "Skipped");
525
544
  }
526
545
  };
527
- return /* @__PURE__ */ R(V, {
546
+ return /* @__PURE__ */ z(H, {
528
547
  open: e,
529
548
  onOpenChange: t,
530
- children: /* @__PURE__ */ z(H, { children: [/* @__PURE__ */ R(W, { children: /* @__PURE__ */ z(G, { children: [i("atheletebridge.pages.performance.logWorkoutDialogTitle", "Log workout"), r ? ` — ${r}` : ""] }) }), /* @__PURE__ */ z("form", {
549
+ children: /* @__PURE__ */ B(U, { children: [/* @__PURE__ */ z(G, { children: /* @__PURE__ */ B(K, { children: [i("atheletebridge.pages.performance.logWorkoutDialogTitle", "Log workout"), r ? ` — ${r}` : ""] }) }), /* @__PURE__ */ B("form", {
531
550
  onSubmit: async (e) => {
532
551
  if (e.preventDefault(), D(null), !o.trim()) D(i("atheletebridge.pages.performance.error.titleRequired", "A workout title is required."));
533
- else if (!m) D(i("atheletebridge.pages.performance.error.performedAtRequired", "A performed date and time is required."));
552
+ else if (!f) D(i("atheletebridge.pages.performance.error.performedAtRequired", "A performed date and time is required."));
534
553
  else try {
535
554
  await a.mutateAsync({
536
555
  athleteId: n,
537
556
  title: o.trim(),
538
557
  status: c,
539
- performedAt: new Date(m).toISOString(),
540
- durationMin: de(g),
541
- rpe: de(v),
542
- totalLoad: fe(S),
558
+ performedAt: new Date(f).toISOString(),
559
+ durationMin: me(g),
560
+ rpe: me(v),
561
+ totalLoad: Z(x),
543
562
  notes: w.trim() || void 0
544
563
  }), O(), t(!1);
545
564
  } catch (e) {
@@ -548,11 +567,11 @@ function ve({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
548
567
  },
549
568
  className: "space-y-4 px-1",
550
569
  children: [
551
- /* @__PURE__ */ R(l, {
570
+ /* @__PURE__ */ z(l, {
552
571
  label: i("atheletebridge.pages.performance.label.title", "Title"),
553
572
  htmlFor: "workoutTitle",
554
573
  required: !0,
555
- children: /* @__PURE__ */ R("input", {
574
+ children: /* @__PURE__ */ z("input", {
556
575
  id: "workoutTitle",
557
576
  className: u,
558
577
  value: o,
@@ -560,41 +579,41 @@ function ve({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
560
579
  placeholder: i("atheletebridge.pages.performance.placeholder.title", "e.g. Lower-body strength")
561
580
  })
562
581
  }),
563
- /* @__PURE__ */ z("div", {
582
+ /* @__PURE__ */ B("div", {
564
583
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
565
- children: [/* @__PURE__ */ R(l, {
584
+ children: [/* @__PURE__ */ z(l, {
566
585
  label: i("atheletebridge.pages.performance.label.status", "Status"),
567
586
  htmlFor: "workoutStatus",
568
- children: /* @__PURE__ */ R("select", {
587
+ children: /* @__PURE__ */ z("select", {
569
588
  id: "workoutStatus",
570
589
  className: u,
571
590
  value: c,
572
591
  onChange: (e) => d(e.target.value),
573
- children: q.map((e) => /* @__PURE__ */ R("option", {
592
+ children: ne.map((e) => /* @__PURE__ */ z("option", {
574
593
  value: e,
575
- children: A(e)
594
+ children: k(e)
576
595
  }, e))
577
596
  })
578
- }), /* @__PURE__ */ R(l, {
597
+ }), /* @__PURE__ */ z(l, {
579
598
  label: i("atheletebridge.pages.performance.label.performedAt", "Performed at"),
580
599
  htmlFor: "workoutPerformedAt",
581
600
  required: !0,
582
- children: /* @__PURE__ */ R("input", {
601
+ children: /* @__PURE__ */ z("input", {
583
602
  id: "workoutPerformedAt",
584
603
  type: "datetime-local",
585
604
  className: u,
586
- value: m,
605
+ value: f,
587
606
  onChange: (e) => h(e.target.value)
588
607
  })
589
608
  })]
590
609
  }),
591
- /* @__PURE__ */ z("div", {
610
+ /* @__PURE__ */ B("div", {
592
611
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
593
612
  children: [
594
- /* @__PURE__ */ R(l, {
613
+ /* @__PURE__ */ z(l, {
595
614
  label: i("atheletebridge.pages.performance.label.durationMin", "Duration (min)"),
596
615
  htmlFor: "workoutDuration",
597
- children: /* @__PURE__ */ R("input", {
616
+ children: /* @__PURE__ */ z("input", {
598
617
  id: "workoutDuration",
599
618
  inputMode: "numeric",
600
619
  className: u,
@@ -602,34 +621,34 @@ function ve({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
602
621
  onChange: (e) => _(e.target.value)
603
622
  })
604
623
  }),
605
- /* @__PURE__ */ R(l, {
624
+ /* @__PURE__ */ z(l, {
606
625
  label: i("atheletebridge.pages.performance.label.rpe", "RPE (1–10)"),
607
626
  htmlFor: "workoutRpe",
608
- children: /* @__PURE__ */ R("input", {
627
+ children: /* @__PURE__ */ z("input", {
609
628
  id: "workoutRpe",
610
629
  inputMode: "numeric",
611
630
  className: u,
612
631
  value: v,
613
- onChange: (e) => b(e.target.value)
632
+ onChange: (e) => y(e.target.value)
614
633
  })
615
634
  }),
616
- /* @__PURE__ */ R(l, {
635
+ /* @__PURE__ */ z(l, {
617
636
  label: i("atheletebridge.pages.performance.label.totalLoad", "Total load"),
618
637
  htmlFor: "workoutLoad",
619
- children: /* @__PURE__ */ R("input", {
638
+ children: /* @__PURE__ */ z("input", {
620
639
  id: "workoutLoad",
621
640
  inputMode: "decimal",
622
641
  className: u,
623
- value: S,
642
+ value: x,
624
643
  onChange: (e) => C(e.target.value)
625
644
  })
626
645
  })
627
646
  ]
628
647
  }),
629
- /* @__PURE__ */ R(l, {
648
+ /* @__PURE__ */ z(l, {
630
649
  label: i("atheletebridge.pages.performance.label.notes", "Notes"),
631
650
  htmlFor: "workoutNotes",
632
- children: /* @__PURE__ */ R("textarea", {
651
+ children: /* @__PURE__ */ z("textarea", {
633
652
  id: "workoutNotes",
634
653
  rows: 2,
635
654
  className: u,
@@ -638,28 +657,28 @@ function ve({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
638
657
  placeholder: i("atheletebridge.pages.performance.notesPlaceholder", "How did the session go?")
639
658
  })
640
659
  }),
641
- E && /* @__PURE__ */ R("p", {
660
+ E && /* @__PURE__ */ z("p", {
642
661
  className: "text-sm text-status-error-text",
643
662
  children: E
644
663
  }),
645
- /* @__PURE__ */ z(U, { children: [/* @__PURE__ */ R("button", {
664
+ /* @__PURE__ */ B(W, { children: [/* @__PURE__ */ z("button", {
646
665
  type: "button",
647
666
  onClick: () => t(!1),
648
667
  className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
649
668
  children: i("common.cancel", "Cancel")
650
- }), /* @__PURE__ */ z("button", {
669
+ }), /* @__PURE__ */ B("button", {
651
670
  type: "submit",
652
671
  disabled: a.isPending,
653
- className: y(Z, "disabled:opacity-60"),
654
- children: [a.isPending ? /* @__PURE__ */ R(k, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ R(M, { className: "h-4 w-4" }), i("atheletebridge.pages.performance.logWorkout", "Log workout")]
672
+ className: b(X, "disabled:opacity-60"),
673
+ children: [a.isPending ? /* @__PURE__ */ z(A, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ z(N, { className: "h-4 w-4" }), i("atheletebridge.pages.performance.logWorkout", "Log workout")]
655
674
  })] })
656
675
  ]
657
676
  })] })
658
677
  });
659
678
  }
660
- function ye({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
661
- let i = f(), a = h(), [o, s] = x("CUSTOM"), [c, d] = x(""), [p, m] = x(""), [g, _] = x(""), [v, b] = x(""), [S, C] = x(Q), [w, T] = x(null), E = () => {
662
- s("CUSTOM"), d(""), m(""), _(""), b(""), C(Q()), T(null);
679
+ function xe({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
680
+ let i = p(), a = g(), [o, s] = S("CUSTOM"), [c, d] = S(""), [f, m] = S(""), [h, _] = S(""), [v, y] = S(""), [x, C] = S(Q), [w, T] = S(null), E = () => {
681
+ s("CUSTOM"), d(""), m(""), _(""), y(""), C(Q()), T(null);
663
682
  }, D = (e) => {
664
683
  switch (e) {
665
684
  case "SPEED": return i("atheletebridge.metricType.speed", "Speed");
@@ -672,27 +691,27 @@ function ye({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
672
691
  case "CUSTOM": return i("atheletebridge.metricType.custom", "Custom");
673
692
  }
674
693
  };
675
- return /* @__PURE__ */ R(V, {
694
+ return /* @__PURE__ */ z(H, {
676
695
  open: e,
677
696
  onOpenChange: t,
678
- children: /* @__PURE__ */ z(H, { children: [/* @__PURE__ */ R(W, { children: /* @__PURE__ */ z(G, { children: [i("atheletebridge.pages.performance.recordMetricDialogTitle", "Record metric"), r ? ` — ${r}` : ""] }) }), /* @__PURE__ */ z("form", {
697
+ children: /* @__PURE__ */ B(U, { children: [/* @__PURE__ */ z(G, { children: /* @__PURE__ */ B(K, { children: [i("atheletebridge.pages.performance.recordMetricDialogTitle", "Record metric"), r ? ` — ${r}` : ""] }) }), /* @__PURE__ */ B("form", {
679
698
  onSubmit: async (e) => {
680
699
  if (e.preventDefault(), T(null), !c.trim()) {
681
700
  T(i("atheletebridge.pages.performance.error.metricLabelRequired", "A metric label is required."));
682
701
  return;
683
702
  }
684
- let r = fe(p);
703
+ let r = Z(f);
685
704
  if (r === void 0) T(i("atheletebridge.pages.performance.error.metricValueRequired", "A numeric value is required."));
686
- else if (!S) T(i("atheletebridge.pages.performance.error.recordedAtRequired", "A recorded date and time is required."));
705
+ else if (!x) T(i("atheletebridge.pages.performance.error.recordedAtRequired", "A recorded date and time is required."));
687
706
  else try {
688
707
  await a.mutateAsync({
689
708
  athleteId: n,
690
709
  type: o,
691
710
  label: c.trim(),
692
711
  value: r,
693
- unit: g.trim() || void 0,
712
+ unit: h.trim() || void 0,
694
713
  source: v.trim() || void 0,
695
- recordedAt: new Date(S).toISOString()
714
+ recordedAt: new Date(x).toISOString()
696
715
  }), E(), t(!1);
697
716
  } catch (e) {
698
717
  T(e instanceof Error ? e.message : i("atheletebridge.pages.performance.error.recordFailed", "Failed to record metric."));
@@ -700,39 +719,39 @@ function ye({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
700
719
  },
701
720
  className: "space-y-4 px-1",
702
721
  children: [
703
- /* @__PURE__ */ z("div", {
722
+ /* @__PURE__ */ B("div", {
704
723
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
705
- children: [/* @__PURE__ */ R(l, {
724
+ children: [/* @__PURE__ */ z(l, {
706
725
  label: i("atheletebridge.pages.performance.label.metricType", "Metric type"),
707
726
  htmlFor: "metricType",
708
- children: /* @__PURE__ */ R("select", {
727
+ children: /* @__PURE__ */ z("select", {
709
728
  id: "metricType",
710
729
  className: u,
711
730
  value: o,
712
731
  onChange: (e) => s(e.target.value),
713
- children: J.map((e) => /* @__PURE__ */ R("option", {
732
+ children: re.map((e) => /* @__PURE__ */ z("option", {
714
733
  value: e,
715
734
  children: D(e)
716
735
  }, e))
717
736
  })
718
- }), /* @__PURE__ */ R(l, {
737
+ }), /* @__PURE__ */ z(l, {
719
738
  label: i("atheletebridge.pages.performance.label.recordedAt", "Recorded at"),
720
739
  htmlFor: "metricRecordedAt",
721
740
  required: !0,
722
- children: /* @__PURE__ */ R("input", {
741
+ children: /* @__PURE__ */ z("input", {
723
742
  id: "metricRecordedAt",
724
743
  type: "datetime-local",
725
744
  className: u,
726
- value: S,
745
+ value: x,
727
746
  onChange: (e) => C(e.target.value)
728
747
  })
729
748
  })]
730
749
  }),
731
- /* @__PURE__ */ R(l, {
750
+ /* @__PURE__ */ z(l, {
732
751
  label: i("atheletebridge.pages.performance.label.metricLabel", "Label"),
733
752
  htmlFor: "metricLabel",
734
753
  required: !0,
735
- children: /* @__PURE__ */ R("input", {
754
+ children: /* @__PURE__ */ z("input", {
736
755
  id: "metricLabel",
737
756
  className: u,
738
757
  value: c,
@@ -740,63 +759,63 @@ function ye({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
740
759
  placeholder: i("atheletebridge.pages.performance.placeholder.metricLabel", "e.g. 40m sprint")
741
760
  })
742
761
  }),
743
- /* @__PURE__ */ z("div", {
762
+ /* @__PURE__ */ B("div", {
744
763
  className: "grid grid-cols-2 gap-4",
745
- children: [/* @__PURE__ */ R(l, {
764
+ children: [/* @__PURE__ */ z(l, {
746
765
  label: i("atheletebridge.pages.performance.label.value", "Value"),
747
766
  htmlFor: "metricValue",
748
767
  required: !0,
749
- children: /* @__PURE__ */ R("input", {
768
+ children: /* @__PURE__ */ z("input", {
750
769
  id: "metricValue",
751
770
  inputMode: "decimal",
752
771
  className: u,
753
- value: p,
772
+ value: f,
754
773
  onChange: (e) => m(e.target.value),
755
774
  placeholder: i("atheletebridge.pages.performance.placeholder.value", "e.g. 4.8")
756
775
  })
757
- }), /* @__PURE__ */ R(l, {
776
+ }), /* @__PURE__ */ z(l, {
758
777
  label: i("atheletebridge.pages.performance.label.unit", "Unit"),
759
778
  htmlFor: "metricUnit",
760
- children: /* @__PURE__ */ R("input", {
779
+ children: /* @__PURE__ */ z("input", {
761
780
  id: "metricUnit",
762
781
  className: u,
763
- value: g,
782
+ value: h,
764
783
  onChange: (e) => _(e.target.value),
765
784
  placeholder: i("atheletebridge.pages.performance.placeholder.unit", "e.g. s, kg, bpm")
766
785
  })
767
786
  })]
768
787
  }),
769
- /* @__PURE__ */ R(l, {
788
+ /* @__PURE__ */ z(l, {
770
789
  label: i("atheletebridge.pages.performance.label.source", "Source"),
771
790
  htmlFor: "metricSource",
772
791
  hint: i("atheletebridge.pages.performance.hint.source", "Optional — device, test or coach."),
773
- children: /* @__PURE__ */ R("input", {
792
+ children: /* @__PURE__ */ z("input", {
774
793
  id: "metricSource",
775
794
  className: u,
776
795
  value: v,
777
- onChange: (e) => b(e.target.value),
796
+ onChange: (e) => y(e.target.value),
778
797
  placeholder: i("atheletebridge.pages.performance.placeholder.source", "e.g. GPS vest")
779
798
  })
780
799
  }),
781
- w && /* @__PURE__ */ R("p", {
800
+ w && /* @__PURE__ */ z("p", {
782
801
  className: "text-sm text-status-error-text",
783
802
  children: w
784
803
  }),
785
- /* @__PURE__ */ z(U, { children: [/* @__PURE__ */ R("button", {
804
+ /* @__PURE__ */ B(W, { children: [/* @__PURE__ */ z("button", {
786
805
  type: "button",
787
806
  onClick: () => t(!1),
788
807
  className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
789
808
  children: i("common.cancel", "Cancel")
790
- }), /* @__PURE__ */ z("button", {
809
+ }), /* @__PURE__ */ B("button", {
791
810
  type: "submit",
792
811
  disabled: a.isPending,
793
- className: y(Z, "disabled:opacity-60"),
794
- children: [a.isPending ? /* @__PURE__ */ R(k, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ R(j, { className: "h-4 w-4" }), i("atheletebridge.pages.performance.recordMetric", "Record metric")]
812
+ className: b(X, "disabled:opacity-60"),
813
+ children: [a.isPending ? /* @__PURE__ */ z(A, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ z(M, { className: "h-4 w-4" }), i("atheletebridge.pages.performance.recordMetric", "Record metric")]
795
814
  })] })
796
815
  ]
797
816
  })] })
798
817
  });
799
818
  }
800
- export { pe as PerformancePage };
819
+ export { he as PerformancePage };
801
820
 
802
821
  //# sourceMappingURL=PerformancePage.js.map