@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.
- package/dist/atheletebridge/AthleteBridgeRoot.js +71 -55
- package/dist/atheletebridge/AthleteBridgeRoot.js.map +1 -1
- package/dist/atheletebridge/AthleteBridgeRoutes.js +30 -6
- package/dist/atheletebridge/AthleteBridgeRoutes.js.map +1 -1
- package/dist/atheletebridge/components/MatchupRow.js +11 -2
- package/dist/atheletebridge/components/MatchupRow.js.map +1 -1
- package/dist/atheletebridge/components/analytics/AiInsightsPanel.d.ts +5 -0
- package/dist/atheletebridge/components/analytics/AiInsightsPanel.js +617 -0
- package/dist/atheletebridge/components/analytics/AiInsightsPanel.js.map +1 -0
- package/dist/atheletebridge/components/wearables/ConnectedDevicesPanel.d.ts +5 -0
- package/dist/atheletebridge/components/wearables/ConnectedDevicesPanel.js +453 -0
- package/dist/atheletebridge/components/wearables/ConnectedDevicesPanel.js.map +1 -0
- package/dist/atheletebridge/hooks/index.d.ts +2 -0
- package/dist/atheletebridge/hooks/index.js +1 -0
- package/dist/atheletebridge/hooks/useInsightsWearablesMarketplaceApi.d.ts +62 -0
- package/dist/atheletebridge/hooks/useInsightsWearablesMarketplaceApi.js +362 -0
- package/dist/atheletebridge/hooks/useInsightsWearablesMarketplaceApi.js.map +1 -0
- package/dist/atheletebridge/pages/DashboardPage.js +71 -1
- package/dist/atheletebridge/pages/DashboardPage.js.map +1 -1
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.d.ts +3 -1
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js +346 -317
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js.map +1 -1
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js +171 -159
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js.map +1 -1
- package/dist/atheletebridge/pages/devices/ConnectedDevicesPage.d.ts +1 -0
- package/dist/atheletebridge/pages/devices/ConnectedDevicesPage.js +14 -0
- package/dist/atheletebridge/pages/devices/ConnectedDevicesPage.js.map +1 -0
- package/dist/atheletebridge/pages/marketplace/MarketplacePage.d.ts +1 -0
- package/dist/atheletebridge/pages/marketplace/MarketplacePage.js +756 -0
- package/dist/atheletebridge/pages/marketplace/MarketplacePage.js.map +1 -0
- package/dist/atheletebridge/pages/performance/PerformancePage.js +296 -277
- package/dist/atheletebridge/pages/performance/PerformancePage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.js +279 -147
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.js.map +1 -1
- package/dist/atheletebridge/types/index.d.ts +1 -0
- package/dist/atheletebridge/types/insights.d.ts +270 -0
- package/package.json +1 -1
|
@@ -5,29 +5,30 @@ import { StatCard as r } from "../../components/viz/StatCard.js";
|
|
|
5
5
|
import { RatingStars as i } from "../../components/viz/RatingStars.js";
|
|
6
6
|
import { SessionCard as a } from "../../components/SessionCard.js";
|
|
7
7
|
import { Crest as o } from "../../components/Crest.js";
|
|
8
|
-
import { UserAvatar as
|
|
9
|
-
import { EmptyState as
|
|
10
|
-
import { SubjectDecisions as
|
|
11
|
-
import {
|
|
8
|
+
import { UserAvatar as ee } from "../../components/UserAvatar.js";
|
|
9
|
+
import { EmptyState as s } from "../../components/EmptyState.js";
|
|
10
|
+
import { SubjectDecisions as te } from "../../components/ai/SubjectDecisions.js";
|
|
11
|
+
import { ConnectedDevicesPanel as ne } from "../../components/wearables/ConnectedDevicesPanel.js";
|
|
12
|
+
import { ErrorState as c, LoadingState as re } from "../../components/LoadingState.js";
|
|
12
13
|
import "../../components/viz/index.js";
|
|
13
|
-
import { MEMBER_ROLE_LABELS as
|
|
14
|
-
import { useAthleteBridge as
|
|
14
|
+
import { MEMBER_ROLE_LABELS as ie, METRIC_TYPE_LABELS as l, SPORT_LABELS as u } from "../../components/domain.js";
|
|
15
|
+
import { useAthleteBridge as d } from "../../context/AthleteBridgeContext.js";
|
|
15
16
|
import { useAthleteProfile as f, useTeam as p } from "../../hooks/useAthleteBridgeApi.js";
|
|
16
|
-
import { formatDate as m, formatDuration as
|
|
17
|
-
import { useMemo as
|
|
18
|
-
import { ArrowLeft as
|
|
19
|
-
import { useParams as
|
|
20
|
-
import { Fragment as
|
|
21
|
-
import { Badge as
|
|
17
|
+
import { formatDate as m, formatDuration as ae } from "../../utils/formatters.js";
|
|
18
|
+
import { useMemo as h, useState as oe } from "react";
|
|
19
|
+
import { ArrowLeft as se, CalendarClock as g, Dumbbell as _, Gauge as ce, LineChart as le, Ruler as ue, Sparkles as de, Star as v, Users as y, Weight as b } from "lucide-react";
|
|
20
|
+
import { useParams as x } from "react-router";
|
|
21
|
+
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
22
|
+
import { Badge as T, GlassCard as E, GradientText as fe, ResponsiveTable as pe, Tabs as me, TabsContent as D, TabsList as O, TabsTrigger as k } from "@burdenoff/fe-libs/ui";
|
|
22
23
|
// src/atheletebridge/pages/athletes/AthleteProfilePage.tsx
|
|
23
|
-
var
|
|
24
|
+
var A = [
|
|
24
25
|
"1M",
|
|
25
26
|
"3M",
|
|
26
27
|
"6M",
|
|
27
28
|
"YTD",
|
|
28
29
|
"1Y",
|
|
29
30
|
"ALL"
|
|
30
|
-
],
|
|
31
|
+
], j = {
|
|
31
32
|
"1M": "1M",
|
|
32
33
|
"3M": "3M",
|
|
33
34
|
"6M": "6M",
|
|
@@ -35,7 +36,7 @@ var j = [
|
|
|
35
36
|
"1Y": "1Y",
|
|
36
37
|
ALL: "All"
|
|
37
38
|
};
|
|
38
|
-
function
|
|
39
|
+
function M(e) {
|
|
39
40
|
let t = Date.now(), n = 864e5;
|
|
40
41
|
switch (e) {
|
|
41
42
|
case "1M": return t - 30 * n;
|
|
@@ -46,11 +47,11 @@ function N(e) {
|
|
|
46
47
|
case "ALL": return 0;
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
|
-
var
|
|
50
|
+
var N = (e) => new Date(e).toLocaleDateString(void 0, {
|
|
50
51
|
month: "short",
|
|
51
52
|
day: "numeric"
|
|
52
53
|
});
|
|
53
|
-
function
|
|
54
|
+
function P(e, t) {
|
|
54
55
|
let n = /* @__PURE__ */ new Map();
|
|
55
56
|
for (let r of e) {
|
|
56
57
|
let e = new Date(r.recordedAt).getTime();
|
|
@@ -71,105 +72,105 @@ function F(e, t) {
|
|
|
71
72
|
};
|
|
72
73
|
}).sort((e, t) => t.points.length - e.points.length);
|
|
73
74
|
}
|
|
74
|
-
function
|
|
75
|
-
let { teamId:
|
|
76
|
-
if (
|
|
75
|
+
function F() {
|
|
76
|
+
let { teamId: A, memberId: j } = x(), { navigateTo: F } = d(), R = f(A, j), z = p(A), [B, V] = oe("6M"), H = h(() => M(B), [B]), U = h(() => P(R.metrics, H), [R.metrics, H]), W = h(() => P(R.metrics, 0), [R.metrics]), G = h(() => R.sessions.filter((e) => e.rating !== null), [R.sessions]), K = h(() => G.length > 0 ? G.reduce((e, t) => e + (t.rating ?? 0), 0) / G.length : null, [G]), q = h(() => R.sessions.filter((e) => e.status === "REQUESTED" || e.status === "CONFIRMED").sort((e, t) => new Date(e.scheduledAt).getTime() - new Date(t.scheduledAt).getTime()), [R.sessions]), J = h(() => [...R.workouts].sort((e, t) => new Date(t.performedAt).getTime() - new Date(e.performedAt).getTime()), [R.workouts]), Y = h(() => R.sessions.filter((e) => e.status === "COMPLETED").length, [R.sessions]);
|
|
77
|
+
if (R.isLoading) return /* @__PURE__ */ C(e, {
|
|
77
78
|
title: "Athlete",
|
|
78
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ C(re, { label: "Loading athlete profile…" })
|
|
79
80
|
});
|
|
80
|
-
if (
|
|
81
|
+
if (R.isError || !R.member) return /* @__PURE__ */ C(e, {
|
|
81
82
|
title: "Athlete",
|
|
82
|
-
children: /* @__PURE__ */
|
|
83
|
+
children: /* @__PURE__ */ C(c, {
|
|
83
84
|
title: "Athlete not found",
|
|
84
85
|
message: "This athlete is not on the roster, or you do not have access.",
|
|
85
|
-
onRetry: () =>
|
|
86
|
+
onRetry: () => F(A ? `/teams/${A}` : "/teams")
|
|
86
87
|
})
|
|
87
88
|
});
|
|
88
|
-
let X =
|
|
89
|
+
let X = R.member, Z = z.data?.name ?? null, Q = z.data?.sport, $ = [];
|
|
89
90
|
X.height != null && $.push({
|
|
90
|
-
icon: /* @__PURE__ */
|
|
91
|
+
icon: /* @__PURE__ */ C(ue, { className: "h-4 w-4" }),
|
|
91
92
|
label: "Height",
|
|
92
93
|
value: String(X.height)
|
|
93
94
|
}), X.weight != null && $.push({
|
|
94
|
-
icon: /* @__PURE__ */
|
|
95
|
+
icon: /* @__PURE__ */ C(b, { className: "h-4 w-4" }),
|
|
95
96
|
label: "Weight",
|
|
96
97
|
value: String(X.weight)
|
|
97
98
|
}), X.dominantSide && $.push({
|
|
98
|
-
icon: /* @__PURE__ */
|
|
99
|
+
icon: /* @__PURE__ */ C(ce, { className: "h-4 w-4" }),
|
|
99
100
|
label: "Dominant side",
|
|
100
101
|
value: X.dominantSide
|
|
101
102
|
}), X.position && $.push({
|
|
102
|
-
icon: /* @__PURE__ */
|
|
103
|
+
icon: /* @__PURE__ */ C(y, { className: "h-4 w-4" }),
|
|
103
104
|
label: "Position",
|
|
104
105
|
value: X.position
|
|
105
106
|
}), X.joinedAt && $.push({
|
|
106
|
-
icon: /* @__PURE__ */
|
|
107
|
+
icon: /* @__PURE__ */ C(g, { className: "h-4 w-4" }),
|
|
107
108
|
label: "Joined",
|
|
108
109
|
value: m(X.joinedAt)
|
|
109
110
|
});
|
|
110
|
-
let
|
|
111
|
-
return /* @__PURE__ */
|
|
112
|
-
title: /* @__PURE__ */
|
|
113
|
-
description: Z ? `${Z}${Q ? ` · ${
|
|
114
|
-
actions: /* @__PURE__ */
|
|
111
|
+
let he = U[0] ?? null;
|
|
112
|
+
return /* @__PURE__ */ w(e, {
|
|
113
|
+
title: /* @__PURE__ */ C(fe, { children: X.displayName }),
|
|
114
|
+
description: Z ? `${Z}${Q ? ` · ${u[Q]}` : ""}` : void 0,
|
|
115
|
+
actions: /* @__PURE__ */ w("button", {
|
|
115
116
|
type: "button",
|
|
116
|
-
onClick: () =>
|
|
117
|
+
onClick: () => F(A ? `/teams/${A}` : "/teams"),
|
|
117
118
|
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",
|
|
118
|
-
children: [/* @__PURE__ */
|
|
119
|
+
children: [/* @__PURE__ */ C(se, { className: "h-4 w-4" }), " Back to team"]
|
|
119
120
|
}),
|
|
120
|
-
children: [/* @__PURE__ */
|
|
121
|
+
children: [/* @__PURE__ */ C(E, {
|
|
121
122
|
treatment: "insight",
|
|
122
123
|
className: "mb-8 p-6",
|
|
123
|
-
children: /* @__PURE__ */
|
|
124
|
+
children: /* @__PURE__ */ w("div", {
|
|
124
125
|
className: "flex flex-col gap-6 md:flex-row md:items-start",
|
|
125
|
-
children: [/* @__PURE__ */
|
|
126
|
+
children: [/* @__PURE__ */ C(ee, {
|
|
126
127
|
name: X.displayName,
|
|
127
128
|
id: X.userId,
|
|
128
129
|
jersey: X.jerseyNumber,
|
|
129
130
|
size: "xl",
|
|
130
131
|
ring: !0,
|
|
131
132
|
className: "shrink-0"
|
|
132
|
-
}), /* @__PURE__ */
|
|
133
|
+
}), /* @__PURE__ */ w("div", {
|
|
133
134
|
className: "min-w-0 flex-1",
|
|
134
|
-
children: [/* @__PURE__ */
|
|
135
|
+
children: [/* @__PURE__ */ w("div", {
|
|
135
136
|
className: "flex flex-wrap items-center gap-2",
|
|
136
137
|
children: [
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ C(T, {
|
|
138
139
|
variant: "default",
|
|
139
|
-
children:
|
|
140
|
+
children: ie[X.role]
|
|
140
141
|
}),
|
|
141
|
-
X.position ? /* @__PURE__ */
|
|
142
|
+
X.position ? /* @__PURE__ */ C(T, {
|
|
142
143
|
variant: "secondary",
|
|
143
144
|
children: X.position
|
|
144
145
|
}) : null,
|
|
145
|
-
X.jerseyNumber == null ? null : /* @__PURE__ */ T
|
|
146
|
+
X.jerseyNumber == null ? null : /* @__PURE__ */ w(T, {
|
|
146
147
|
variant: "outline",
|
|
147
148
|
className: "tabular-nums",
|
|
148
149
|
children: ["#", X.jerseyNumber]
|
|
149
150
|
}),
|
|
150
|
-
Z ? /* @__PURE__ */ T
|
|
151
|
+
Z ? /* @__PURE__ */ w(T, {
|
|
151
152
|
variant: "secondary",
|
|
152
153
|
className: "gap-1.5",
|
|
153
|
-
children: [/* @__PURE__ */
|
|
154
|
+
children: [/* @__PURE__ */ C(o, {
|
|
154
155
|
name: Z,
|
|
155
156
|
sport: Q,
|
|
156
157
|
size: 16,
|
|
157
158
|
showSportGlyph: !1
|
|
158
159
|
}), Z]
|
|
159
160
|
}) : null,
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ C(t, { status: X.status })
|
|
161
162
|
]
|
|
162
|
-
}), $.length > 0 ? /* @__PURE__ */
|
|
163
|
+
}), $.length > 0 ? /* @__PURE__ */ C("dl", {
|
|
163
164
|
className: "mt-5 grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3 lg:grid-cols-5",
|
|
164
|
-
children: $.map((e) => /* @__PURE__ */
|
|
165
|
+
children: $.map((e) => /* @__PURE__ */ w("div", {
|
|
165
166
|
className: "min-w-0",
|
|
166
|
-
children: [/* @__PURE__ */
|
|
167
|
+
children: [/* @__PURE__ */ w("dt", {
|
|
167
168
|
className: "flex items-center gap-1.5 text-xs font-medium text-text-secondary",
|
|
168
|
-
children: [/* @__PURE__ */
|
|
169
|
+
children: [/* @__PURE__ */ C("span", {
|
|
169
170
|
className: "text-text-muted",
|
|
170
171
|
children: e.icon
|
|
171
172
|
}), e.label]
|
|
172
|
-
}), /* @__PURE__ */
|
|
173
|
+
}), /* @__PURE__ */ C("dd", {
|
|
173
174
|
className: "mt-1 truncate text-lg font-semibold text-text-primary",
|
|
174
175
|
children: e.value
|
|
175
176
|
})]
|
|
@@ -177,152 +178,156 @@ function I() {
|
|
|
177
178
|
}) : null]
|
|
178
179
|
})]
|
|
179
180
|
})
|
|
180
|
-
}), /* @__PURE__ */
|
|
181
|
+
}), /* @__PURE__ */ w(me, {
|
|
181
182
|
defaultValue: "overview",
|
|
182
183
|
children: [
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ w(O, {
|
|
184
185
|
className: "mb-6 flex-wrap",
|
|
185
186
|
children: [
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ C(k, {
|
|
187
188
|
value: "overview",
|
|
188
189
|
children: "Overview"
|
|
189
190
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ C(k, {
|
|
191
192
|
value: "metrics",
|
|
192
193
|
children: "Metrics"
|
|
193
194
|
}),
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ C(k, {
|
|
195
196
|
value: "workouts",
|
|
196
197
|
children: "Workouts"
|
|
197
198
|
}),
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ C(k, {
|
|
199
200
|
value: "sessions",
|
|
200
201
|
children: "Sessions"
|
|
201
202
|
}),
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ C(k, {
|
|
203
204
|
value: "ai",
|
|
204
205
|
children: "AI decisions"
|
|
206
|
+
}),
|
|
207
|
+
/* @__PURE__ */ C(k, {
|
|
208
|
+
value: "devices",
|
|
209
|
+
children: "Connected devices"
|
|
205
210
|
})
|
|
206
211
|
]
|
|
207
212
|
}),
|
|
208
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ w(D, {
|
|
209
214
|
value: "overview",
|
|
210
215
|
className: "space-y-8",
|
|
211
216
|
children: [
|
|
212
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ w("div", {
|
|
213
218
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
214
219
|
children: [
|
|
215
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ w(E, {
|
|
216
221
|
treatment: "metric",
|
|
217
222
|
className: "flex flex-col gap-2 p-5",
|
|
218
|
-
children: [/* @__PURE__ */
|
|
223
|
+
children: [/* @__PURE__ */ C("span", {
|
|
219
224
|
className: "text-sm font-medium text-text-secondary",
|
|
220
225
|
children: "Avg session rating"
|
|
221
|
-
}),
|
|
226
|
+
}), K == null ? /* @__PURE__ */ C("span", {
|
|
222
227
|
className: "text-sm text-text-muted",
|
|
223
228
|
children: "No rated sessions yet"
|
|
224
|
-
}) : /* @__PURE__ */
|
|
225
|
-
value:
|
|
229
|
+
}) : /* @__PURE__ */ C(S, { children: /* @__PURE__ */ C(i, {
|
|
230
|
+
value: K,
|
|
226
231
|
max: 5,
|
|
227
232
|
size: 20,
|
|
228
233
|
showValue: !0,
|
|
229
|
-
count:
|
|
234
|
+
count: G.length
|
|
230
235
|
}) })]
|
|
231
236
|
}),
|
|
232
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ C(r, {
|
|
233
238
|
label: "Sessions",
|
|
234
|
-
value:
|
|
235
|
-
icon: /* @__PURE__ */
|
|
239
|
+
value: R.sessions.length,
|
|
240
|
+
icon: /* @__PURE__ */ C(g, { className: "h-4 w-4" })
|
|
236
241
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ C(r, {
|
|
238
243
|
label: "Completed",
|
|
239
|
-
value:
|
|
240
|
-
icon: /* @__PURE__ */
|
|
244
|
+
value: Y,
|
|
245
|
+
icon: /* @__PURE__ */ C(v, { className: "h-4 w-4" })
|
|
241
246
|
}),
|
|
242
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ C(r, {
|
|
243
248
|
label: "Workouts logged",
|
|
244
|
-
value:
|
|
245
|
-
icon: /* @__PURE__ */
|
|
249
|
+
value: R.workouts.length,
|
|
250
|
+
icon: /* @__PURE__ */ C(_, { className: "h-4 w-4" })
|
|
246
251
|
})
|
|
247
252
|
]
|
|
248
253
|
}),
|
|
249
|
-
|
|
254
|
+
W.some((e) => e.deltaPct != null) ? /* @__PURE__ */ w("section", { children: [/* @__PURE__ */ C("h2", {
|
|
250
255
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
251
256
|
children: "Improvement"
|
|
252
|
-
}), /* @__PURE__ */
|
|
257
|
+
}), /* @__PURE__ */ C("div", {
|
|
253
258
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
254
|
-
children:
|
|
255
|
-
label: `${
|
|
259
|
+
children: W.filter((e) => e.deltaPct != null).slice(0, 4).map((e) => /* @__PURE__ */ C(r, {
|
|
260
|
+
label: `${l[e.type]}${e.unit ? ` (${e.unit})` : ""}`,
|
|
256
261
|
value: e.last.toLocaleString(),
|
|
257
262
|
delta: e.deltaPct ?? void 0,
|
|
258
263
|
deltaLabel: "first → latest",
|
|
259
264
|
sparkline: e.points.map((e) => e.value)
|
|
260
265
|
}, e.type))
|
|
261
266
|
})] }) : null,
|
|
262
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ C(L, {
|
|
263
268
|
title: "Performance trend",
|
|
264
|
-
groups:
|
|
265
|
-
primary:
|
|
266
|
-
range:
|
|
267
|
-
onRangeChange:
|
|
269
|
+
groups: U,
|
|
270
|
+
primary: he,
|
|
271
|
+
range: B,
|
|
272
|
+
onRangeChange: V
|
|
268
273
|
}),
|
|
269
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ w("section", { children: [/* @__PURE__ */ w("h2", {
|
|
270
275
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
271
276
|
children: [
|
|
272
277
|
"Upcoming sessions (",
|
|
273
|
-
|
|
278
|
+
q.length,
|
|
274
279
|
")"
|
|
275
280
|
]
|
|
276
|
-
}),
|
|
281
|
+
}), q.length === 0 ? /* @__PURE__ */ C(s, {
|
|
277
282
|
illustration: "empty-calendar",
|
|
278
|
-
icon: /* @__PURE__ */
|
|
283
|
+
icon: /* @__PURE__ */ C(g, { className: "h-10 w-10" }),
|
|
279
284
|
title: "No upcoming sessions",
|
|
280
285
|
description: "Confirmed and requested coaching sessions for this athlete appear here."
|
|
281
|
-
}) : /* @__PURE__ */
|
|
286
|
+
}) : /* @__PURE__ */ C("div", {
|
|
282
287
|
className: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
283
|
-
children:
|
|
288
|
+
children: q.slice(0, 6).map((e) => /* @__PURE__ */ C(a, {
|
|
284
289
|
session: e,
|
|
285
290
|
athleteName: X.displayName,
|
|
286
|
-
onClick: () =>
|
|
291
|
+
onClick: () => F(`/sessions/${e.id}`)
|
|
287
292
|
}, e.id))
|
|
288
293
|
})] })
|
|
289
294
|
]
|
|
290
295
|
}),
|
|
291
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ w(D, {
|
|
292
297
|
value: "metrics",
|
|
293
298
|
className: "space-y-8",
|
|
294
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ w("div", {
|
|
295
300
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
296
|
-
children: [/* @__PURE__ */
|
|
301
|
+
children: [/* @__PURE__ */ C("h2", {
|
|
297
302
|
className: "text-lg font-semibold text-text-primary",
|
|
298
303
|
children: "Performance metrics"
|
|
299
|
-
}), /* @__PURE__ */
|
|
300
|
-
value:
|
|
301
|
-
onChange:
|
|
304
|
+
}), /* @__PURE__ */ C(I, {
|
|
305
|
+
value: B,
|
|
306
|
+
onChange: V
|
|
302
307
|
})]
|
|
303
|
-
}),
|
|
308
|
+
}), U.length === 0 ? /* @__PURE__ */ C(s, {
|
|
304
309
|
illustration: "empty-data",
|
|
305
|
-
icon: /* @__PURE__ */
|
|
310
|
+
icon: /* @__PURE__ */ C(le, { className: "h-10 w-10" }),
|
|
306
311
|
title: "No metrics in this range",
|
|
307
312
|
description: "Record metrics for this athlete — speed, strength, endurance — to chart progress over time."
|
|
308
|
-
}) : /* @__PURE__ */
|
|
313
|
+
}) : /* @__PURE__ */ C("div", {
|
|
309
314
|
className: "grid grid-cols-1 gap-4 lg:grid-cols-2",
|
|
310
|
-
children:
|
|
315
|
+
children: U.map((e) => /* @__PURE__ */ w(E, {
|
|
311
316
|
treatment: "metric",
|
|
312
317
|
className: "p-5",
|
|
313
318
|
children: [
|
|
314
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ w("div", {
|
|
315
320
|
className: "mb-3 flex items-start justify-between gap-3",
|
|
316
|
-
children: [/* @__PURE__ */
|
|
321
|
+
children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("h3", {
|
|
317
322
|
className: "text-sm font-semibold uppercase tracking-wide text-text-secondary",
|
|
318
|
-
children:
|
|
319
|
-
}), /* @__PURE__ */
|
|
323
|
+
children: l[e.type]
|
|
324
|
+
}), /* @__PURE__ */ w("p", {
|
|
320
325
|
className: "mt-1 text-2xl font-semibold tabular-nums text-text-primary",
|
|
321
|
-
children: [e.last.toLocaleString(), e.unit ? /* @__PURE__ */
|
|
326
|
+
children: [e.last.toLocaleString(), e.unit ? /* @__PURE__ */ C("span", {
|
|
322
327
|
className: "ml-1 text-sm text-text-secondary",
|
|
323
328
|
children: e.unit
|
|
324
329
|
}) : null]
|
|
325
|
-
})] }), e.deltaPct == null ? null : /* @__PURE__ */ T
|
|
330
|
+
})] }), e.deltaPct == null ? null : /* @__PURE__ */ w(T, {
|
|
326
331
|
variant: e.deltaPct >= 0 ? "default" : "destructive",
|
|
327
332
|
className: "tabular-nums",
|
|
328
333
|
children: [
|
|
@@ -332,16 +337,16 @@ function I() {
|
|
|
332
337
|
]
|
|
333
338
|
})]
|
|
334
339
|
}),
|
|
335
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ C(n, {
|
|
336
341
|
series: e.points.map((e) => ({
|
|
337
|
-
label:
|
|
342
|
+
label: N(e.recordedAt),
|
|
338
343
|
value: e.value
|
|
339
344
|
})),
|
|
340
|
-
seriesLabel:
|
|
345
|
+
seriesLabel: l[e.type],
|
|
341
346
|
height: 160,
|
|
342
347
|
valueFormatter: (t) => `${t.toLocaleString()}${e.unit ? ` ${e.unit}` : ""}`
|
|
343
348
|
}),
|
|
344
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ w("p", {
|
|
345
350
|
className: "mt-2 text-xs text-text-muted tabular-nums",
|
|
346
351
|
children: [
|
|
347
352
|
"Peak ",
|
|
@@ -356,20 +361,20 @@ function I() {
|
|
|
356
361
|
}, e.type))
|
|
357
362
|
})]
|
|
358
363
|
}),
|
|
359
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ C(D, {
|
|
360
365
|
value: "workouts",
|
|
361
|
-
children:
|
|
366
|
+
children: J.length === 0 ? /* @__PURE__ */ C(s, {
|
|
362
367
|
illustration: "empty-data",
|
|
363
|
-
icon: /* @__PURE__ */
|
|
368
|
+
icon: /* @__PURE__ */ C(_, { className: "h-10 w-10" }),
|
|
364
369
|
title: "No workouts logged",
|
|
365
370
|
description: "This athlete's logged training sessions will appear here."
|
|
366
|
-
}) : /* @__PURE__ */
|
|
371
|
+
}) : /* @__PURE__ */ C(pe, {
|
|
367
372
|
columns: [
|
|
368
373
|
{
|
|
369
374
|
key: "title",
|
|
370
375
|
header: "Workout",
|
|
371
376
|
priority: "primary",
|
|
372
|
-
cell: (e) => /* @__PURE__ */
|
|
377
|
+
cell: (e) => /* @__PURE__ */ C("span", {
|
|
373
378
|
className: "font-medium text-text-primary",
|
|
374
379
|
children: e.title
|
|
375
380
|
})
|
|
@@ -378,16 +383,16 @@ function I() {
|
|
|
378
383
|
key: "duration",
|
|
379
384
|
header: "Duration",
|
|
380
385
|
priority: "secondary",
|
|
381
|
-
cell: (e) => /* @__PURE__ */
|
|
386
|
+
cell: (e) => /* @__PURE__ */ C("span", {
|
|
382
387
|
className: "tabular-nums text-text-secondary",
|
|
383
|
-
children: e.durationMin == null ? "—" :
|
|
388
|
+
children: e.durationMin == null ? "—" : ae(e.durationMin)
|
|
384
389
|
})
|
|
385
390
|
},
|
|
386
391
|
{
|
|
387
392
|
key: "load",
|
|
388
393
|
header: "Load",
|
|
389
394
|
priority: "hidden-on-mobile",
|
|
390
|
-
cell: (e) => /* @__PURE__ */
|
|
395
|
+
cell: (e) => /* @__PURE__ */ C("span", {
|
|
391
396
|
className: "tabular-nums text-text-secondary",
|
|
392
397
|
children: e.totalLoad == null ? "—" : e.totalLoad.toLocaleString()
|
|
393
398
|
})
|
|
@@ -396,7 +401,7 @@ function I() {
|
|
|
396
401
|
key: "rpe",
|
|
397
402
|
header: "RPE",
|
|
398
403
|
priority: "hidden-on-mobile",
|
|
399
|
-
cell: (e) => /* @__PURE__ */
|
|
404
|
+
cell: (e) => /* @__PURE__ */ C("span", {
|
|
400
405
|
className: "tabular-nums text-text-secondary",
|
|
401
406
|
children: e.rpe == null ? "—" : e.rpe
|
|
402
407
|
})
|
|
@@ -405,123 +410,130 @@ function I() {
|
|
|
405
410
|
key: "status",
|
|
406
411
|
header: "Status",
|
|
407
412
|
priority: "secondary",
|
|
408
|
-
cell: (e) => /* @__PURE__ */
|
|
413
|
+
cell: (e) => /* @__PURE__ */ C(t, { status: e.status })
|
|
409
414
|
},
|
|
410
415
|
{
|
|
411
416
|
key: "date",
|
|
412
417
|
header: "Date",
|
|
413
418
|
priority: "secondary",
|
|
414
|
-
cell: (e) => /* @__PURE__ */
|
|
419
|
+
cell: (e) => /* @__PURE__ */ C("span", {
|
|
415
420
|
className: "whitespace-nowrap text-text-secondary",
|
|
416
421
|
children: m(e.performedAt)
|
|
417
422
|
})
|
|
418
423
|
}
|
|
419
424
|
],
|
|
420
|
-
data:
|
|
425
|
+
data: J,
|
|
421
426
|
rowKey: (e) => e.id
|
|
422
427
|
})
|
|
423
428
|
}),
|
|
424
|
-
/* @__PURE__ */
|
|
429
|
+
/* @__PURE__ */ C(D, {
|
|
425
430
|
value: "sessions",
|
|
426
|
-
children:
|
|
431
|
+
children: R.sessions.length === 0 ? /* @__PURE__ */ C(s, {
|
|
427
432
|
illustration: "empty-calendar",
|
|
428
|
-
icon: /* @__PURE__ */
|
|
433
|
+
icon: /* @__PURE__ */ C(g, { className: "h-10 w-10" }),
|
|
429
434
|
title: "No coaching sessions",
|
|
430
435
|
description: "Booked, completed and cancelled sessions for this athlete will appear here."
|
|
431
|
-
}) : /* @__PURE__ */
|
|
436
|
+
}) : /* @__PURE__ */ C("div", {
|
|
432
437
|
className: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
433
|
-
children: [...
|
|
438
|
+
children: [...R.sessions].sort((e, t) => new Date(t.scheduledAt).getTime() - new Date(e.scheduledAt).getTime()).map((e) => /* @__PURE__ */ C(a, {
|
|
434
439
|
session: e,
|
|
435
440
|
athleteName: X.displayName,
|
|
436
|
-
onClick: () =>
|
|
441
|
+
onClick: () => F(`/sessions/${e.id}`)
|
|
437
442
|
}, e.id))
|
|
438
443
|
})
|
|
439
444
|
}),
|
|
440
|
-
/* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ C(D, {
|
|
441
446
|
value: "ai",
|
|
442
|
-
children: X.userId ? /* @__PURE__ */
|
|
447
|
+
children: X.userId ? /* @__PURE__ */ C(te, { subject: {
|
|
443
448
|
kind: "athlete",
|
|
444
449
|
athleteId: X.userId
|
|
445
|
-
} }) : /* @__PURE__ */
|
|
450
|
+
} }) : /* @__PURE__ */ C(s, {
|
|
446
451
|
illustration: "empty-data",
|
|
447
|
-
icon: /* @__PURE__ */
|
|
452
|
+
icon: /* @__PURE__ */ C(de, { className: "h-10 w-10" }),
|
|
448
453
|
title: "No AI decisions for this roster entry",
|
|
449
454
|
description: "AI assessments are keyed to an athlete's account. Link this roster entry to a user to see the decisions made about them."
|
|
450
455
|
})
|
|
456
|
+
}),
|
|
457
|
+
/* @__PURE__ */ C(D, {
|
|
458
|
+
value: "devices",
|
|
459
|
+
children: /* @__PURE__ */ C(ne, {
|
|
460
|
+
athleteId: X.userId || void 0,
|
|
461
|
+
athleteName: X.displayName
|
|
462
|
+
})
|
|
451
463
|
})
|
|
452
464
|
]
|
|
453
465
|
})]
|
|
454
466
|
});
|
|
455
467
|
}
|
|
456
|
-
function
|
|
457
|
-
return /* @__PURE__ */
|
|
468
|
+
function I({ value: e, onChange: t }) {
|
|
469
|
+
return /* @__PURE__ */ C("div", {
|
|
458
470
|
role: "group",
|
|
459
471
|
"aria-label": "Trend range",
|
|
460
472
|
className: "inline-flex items-center gap-1 rounded-lg border border-border-seam bg-bg-surface p-1",
|
|
461
|
-
children:
|
|
473
|
+
children: A.map((n) => {
|
|
462
474
|
let r = n === e;
|
|
463
|
-
return /* @__PURE__ */
|
|
475
|
+
return /* @__PURE__ */ C("button", {
|
|
464
476
|
type: "button",
|
|
465
477
|
"aria-pressed": r,
|
|
466
478
|
onClick: () => t(n),
|
|
467
479
|
className: r ? "rounded-md bg-action-primary-bg px-2.5 py-1 text-xs font-medium text-action-primary-text" : "rounded-md px-2.5 py-1 text-xs font-medium text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary",
|
|
468
|
-
children:
|
|
480
|
+
children: j[n]
|
|
469
481
|
}, n);
|
|
470
482
|
})
|
|
471
483
|
});
|
|
472
484
|
}
|
|
473
|
-
function
|
|
485
|
+
function L({ title: e, groups: t, primary: r, range: i, onRangeChange: a }) {
|
|
474
486
|
let o = t.find((e) => e.type !== r?.type) ?? null;
|
|
475
|
-
return /* @__PURE__ */
|
|
487
|
+
return /* @__PURE__ */ w(E, {
|
|
476
488
|
treatment: "metric",
|
|
477
489
|
className: "p-5",
|
|
478
|
-
children: [/* @__PURE__ */
|
|
490
|
+
children: [/* @__PURE__ */ w("div", {
|
|
479
491
|
className: "mb-4 flex flex-wrap items-center justify-between gap-3",
|
|
480
|
-
children: [/* @__PURE__ */
|
|
492
|
+
children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("h2", {
|
|
481
493
|
className: "text-lg font-semibold text-text-primary",
|
|
482
494
|
children: e
|
|
483
|
-
}), r ? /* @__PURE__ */
|
|
495
|
+
}), r ? /* @__PURE__ */ w("div", {
|
|
484
496
|
className: "mt-1 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-text-secondary",
|
|
485
|
-
children: [/* @__PURE__ */
|
|
497
|
+
children: [/* @__PURE__ */ w("span", {
|
|
486
498
|
className: "inline-flex items-center gap-1.5",
|
|
487
499
|
children: [
|
|
488
|
-
/* @__PURE__ */
|
|
500
|
+
/* @__PURE__ */ C("span", {
|
|
489
501
|
className: "h-2 w-2 rounded-full bg-[var(--color-accent-primary)]",
|
|
490
502
|
"aria-hidden": "true"
|
|
491
503
|
}),
|
|
492
|
-
|
|
504
|
+
l[r.type],
|
|
493
505
|
r.unit ? ` (${r.unit})` : ""
|
|
494
506
|
]
|
|
495
|
-
}), o ? /* @__PURE__ */
|
|
507
|
+
}), o ? /* @__PURE__ */ w("span", {
|
|
496
508
|
className: "inline-flex items-center gap-1.5",
|
|
497
509
|
children: [
|
|
498
|
-
/* @__PURE__ */
|
|
510
|
+
/* @__PURE__ */ C("span", {
|
|
499
511
|
className: "h-2 w-2 rounded-full bg-[var(--color-accent-teal)]",
|
|
500
512
|
"aria-hidden": "true"
|
|
501
513
|
}),
|
|
502
|
-
|
|
514
|
+
l[o.type],
|
|
503
515
|
o.unit ? ` (${o.unit})` : ""
|
|
504
516
|
]
|
|
505
517
|
}) : null]
|
|
506
|
-
}) : null] }), /* @__PURE__ */
|
|
518
|
+
}) : null] }), /* @__PURE__ */ C(I, {
|
|
507
519
|
value: i,
|
|
508
520
|
onChange: a
|
|
509
521
|
})]
|
|
510
|
-
}), r ? /* @__PURE__ */
|
|
522
|
+
}), r ? /* @__PURE__ */ C(n, {
|
|
511
523
|
series: r.points.map((e) => ({
|
|
512
|
-
label:
|
|
524
|
+
label: N(e.recordedAt),
|
|
513
525
|
value: e.value
|
|
514
526
|
})),
|
|
515
527
|
compare: o ? o.points.map((e) => e.value) : void 0,
|
|
516
|
-
seriesLabel:
|
|
517
|
-
compareLabel: o ?
|
|
528
|
+
seriesLabel: l[r.type],
|
|
529
|
+
compareLabel: o ? l[o.type] : void 0,
|
|
518
530
|
height: 240
|
|
519
|
-
}) : /* @__PURE__ */
|
|
531
|
+
}) : /* @__PURE__ */ C("div", {
|
|
520
532
|
className: "flex h-40 items-center justify-center text-sm text-text-muted",
|
|
521
533
|
children: "No metric readings in this range."
|
|
522
534
|
})]
|
|
523
535
|
});
|
|
524
536
|
}
|
|
525
|
-
export {
|
|
537
|
+
export { F as AthleteProfilePage };
|
|
526
538
|
|
|
527
539
|
//# sourceMappingURL=AthleteProfilePage.js.map
|