@burdenoff/microfe-mybodyshield 2026.827.1 → 2026.830.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mybodyshield/MyBodyShieldRoot.d.ts.map +1 -1
- package/dist/mybodyshield/MyBodyShieldRoot.js +54 -56
- package/dist/mybodyshield/MyBodyShieldRoot.js.map +1 -1
- package/dist/mybodyshield/MyBodyShieldRoutes.d.ts.map +1 -1
- package/dist/mybodyshield/MyBodyShieldRoutes.js +121 -62
- package/dist/mybodyshield/MyBodyShieldRoutes.js.map +1 -1
- package/dist/mybodyshield/components/EvidenceUpload.d.ts.map +1 -1
- package/dist/mybodyshield/components/EvidenceUpload.js +46 -45
- package/dist/mybodyshield/components/EvidenceUpload.js.map +1 -1
- package/dist/mybodyshield/components/FileLink.d.ts.map +1 -1
- package/dist/mybodyshield/components/FileLink.js +27 -18
- package/dist/mybodyshield/components/FileLink.js.map +1 -1
- package/dist/mybodyshield/components/MybDiscussion.d.ts +1 -1
- package/dist/mybodyshield/components/MybDiscussion.d.ts.map +1 -1
- package/dist/mybodyshield/components/MybDiscussion.js +59 -58
- package/dist/mybodyshield/components/MybDiscussion.js.map +1 -1
- package/dist/mybodyshield/components/MybTags.d.ts +1 -1
- package/dist/mybodyshield/components/MybTags.d.ts.map +1 -1
- package/dist/mybodyshield/components/MybTags.js +83 -74
- package/dist/mybodyshield/components/MybTags.js.map +1 -1
- package/dist/mybodyshield/components/PageDisabled.d.ts.map +1 -1
- package/dist/mybodyshield/components/PageDisabled.js +16 -11
- package/dist/mybodyshield/components/PageDisabled.js.map +1 -1
- package/dist/mybodyshield/components/Pagination.d.ts.map +1 -1
- package/dist/mybodyshield/components/Pagination.js +36 -27
- package/dist/mybodyshield/components/Pagination.js.map +1 -1
- package/dist/mybodyshield/components/StateViews.d.ts.map +1 -1
- package/dist/mybodyshield/components/StateViews.js +42 -34
- package/dist/mybodyshield/components/StateViews.js.map +1 -1
- package/dist/mybodyshield/components/UserSearchSelect.d.ts.map +1 -1
- package/dist/mybodyshield/components/UserSearchSelect.js +66 -68
- package/dist/mybodyshield/components/UserSearchSelect.js.map +1 -1
- package/dist/mybodyshield/hooks/index.d.ts +1 -0
- package/dist/mybodyshield/hooks/index.d.ts.map +1 -1
- package/dist/mybodyshield/hooks/index.js +1 -0
- package/dist/mybodyshield/hooks/useTr.d.ts +5 -0
- package/dist/mybodyshield/hooks/useTr.d.ts.map +1 -0
- package/dist/mybodyshield/hooks/useTr.js +12 -0
- package/dist/mybodyshield/hooks/useTr.js.map +1 -0
- package/dist/mybodyshield/pages/DashboardPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/DashboardPage.js +157 -136
- package/dist/mybodyshield/pages/DashboardPage.js.map +1 -1
- package/dist/mybodyshield/pages/SettingsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/SettingsPage.js +50 -59
- package/dist/mybodyshield/pages/SettingsPage.js.map +1 -1
- package/dist/mybodyshield/pages/_shared/visuals.d.ts +2 -1
- package/dist/mybodyshield/pages/_shared/visuals.d.ts.map +1 -1
- package/dist/mybodyshield/pages/_shared/visuals.js +91 -81
- package/dist/mybodyshield/pages/_shared/visuals.js.map +1 -1
- package/dist/mybodyshield/pages/ai/AiControlsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/ai/AiControlsPage.js +255 -266
- package/dist/mybodyshield/pages/ai/AiControlsPage.js.map +1 -1
- package/dist/mybodyshield/pages/coaching/CoachingPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/coaching/CoachingPage.js +321 -301
- package/dist/mybodyshield/pages/coaching/CoachingPage.js.map +1 -1
- package/dist/mybodyshield/pages/goals/GoalsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/goals/GoalsPage.js +247 -251
- package/dist/mybodyshield/pages/goals/GoalsPage.js.map +1 -1
- package/dist/mybodyshield/pages/insights/InsightsCharts.d.ts.map +1 -1
- package/dist/mybodyshield/pages/insights/InsightsCharts.js +216 -213
- package/dist/mybodyshield/pages/insights/InsightsCharts.js.map +1 -1
- package/dist/mybodyshield/pages/insights/InsightsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/insights/InsightsPage.js +290 -284
- package/dist/mybodyshield/pages/insights/InsightsPage.js.map +1 -1
- package/dist/mybodyshield/pages/nutrition/NutritionPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/nutrition/NutritionPage.js +575 -529
- package/dist/mybodyshield/pages/nutrition/NutritionPage.js.map +1 -1
- package/dist/mybodyshield/pages/programs/ProgramDetailPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/programs/ProgramDetailPage.js +333 -275
- package/dist/mybodyshield/pages/programs/ProgramDetailPage.js.map +1 -1
- package/dist/mybodyshield/pages/programs/ProgramsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/programs/ProgramsPage.js +258 -253
- package/dist/mybodyshield/pages/programs/ProgramsPage.js.map +1 -1
- package/dist/mybodyshield/pages/progress/ProgressPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/progress/ProgressPage.js +271 -254
- package/dist/mybodyshield/pages/progress/ProgressPage.js.map +1 -1
- package/dist/mybodyshield/pages/recovery/RecoveryPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/recovery/RecoveryPage.js +206 -200
- package/dist/mybodyshield/pages/recovery/RecoveryPage.js.map +1 -1
- package/dist/mybodyshield/pages/train/SessionDetailPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/train/SessionDetailPage.js +327 -294
- package/dist/mybodyshield/pages/train/SessionDetailPage.js.map +1 -1
- package/dist/mybodyshield/pages/train/SessionsPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/train/SessionsPage.js +180 -163
- package/dist/mybodyshield/pages/train/SessionsPage.js.map +1 -1
- package/dist/mybodyshield/utils/i18n.d.ts +1 -2
- package/dist/mybodyshield/utils/i18n.d.ts.map +1 -1
- package/dist/mybodyshield/utils/i18n.js +15 -0
- package/dist/mybodyshield/utils/i18n.js.map +1 -0
- package/package.json +1 -1
|
@@ -3,34 +3,35 @@ import { PageLayout as t } from "../../components/PageLayout.js";
|
|
|
3
3
|
import { formatDate as n } from "../../utils/formatters.js";
|
|
4
4
|
import { StatusBadge as r } from "../../components/StatusBadge.js";
|
|
5
5
|
import { EmptyState as i } from "../../components/EmptyState.js";
|
|
6
|
-
import { ErrorView as a, LoadingView as o, Section as s } from "../../components/StateViews.js";
|
|
7
|
-
import { FilterTabs as c } from "../../components/FilterTabs.js";
|
|
8
6
|
import "../../context/index.js";
|
|
9
|
-
import { useMybCoaching as
|
|
7
|
+
import { useMybCoaching as a, useMybCreateCoaching as o, useMybTransitionCoaching as s } from "../../hooks/useMyBodyShieldApi.js";
|
|
8
|
+
import { useTr as c } from "../../hooks/useTr.js";
|
|
10
9
|
import "../../hooks/index.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
10
|
+
import { ErrorView as l, LoadingView as u, Section as d } from "../../components/StateViews.js";
|
|
11
|
+
import { FilterTabs as f } from "../../components/FilterTabs.js";
|
|
12
|
+
import { MybDiscussion as p } from "../../components/MybDiscussion.js";
|
|
13
|
+
import { UserSearchSelect as m } from "../../components/UserSearchSelect.js";
|
|
13
14
|
import "../../components/index.js";
|
|
14
|
-
import { AnimatePresence as
|
|
15
|
-
import { motion as
|
|
16
|
-
import { useReducedMotion as
|
|
17
|
-
import { IconChip as
|
|
18
|
-
import { useMemo as
|
|
19
|
-
import { CalendarClock as
|
|
20
|
-
import { jsx as
|
|
21
|
-
import { Button as
|
|
15
|
+
import { AnimatePresence as h } from "../../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.js";
|
|
16
|
+
import { motion as g } from "../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
|
|
17
|
+
import { useReducedMotion as _ } from "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
|
|
18
|
+
import { IconChip as v } from "../_shared/visuals.js";
|
|
19
|
+
import { useMemo as y, useState as b } from "react";
|
|
20
|
+
import { CalendarClock as x, CalendarX as S, Check as C, ChevronDown as w, ChevronUp as T, Dumbbell as E, EyeOff as D, FileLock2 as O, HeartHandshake as k, LineChart as A, Lock as j, MessageSquare as M, Minus as N, Plus as P, Salad as F, ScanEye as ee, ShieldCheck as te, User as I } from "lucide-react";
|
|
21
|
+
import { jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
22
|
+
import { Button as z, GlassCard as B, Input as ne, Label as V, ResponsiveDialog as re, ResponsiveDialogContent as H, ResponsiveDialogDescription as U, ResponsiveDialogFooter as W, ResponsiveDialogHeader as G, ResponsiveDialogTitle as K, Switch as q } from "@burdenoff/fe-libs/ui";
|
|
22
23
|
//#region src/mybodyshield/pages/coaching/CoachingPage.tsx
|
|
23
|
-
var
|
|
24
|
+
var J = [
|
|
24
25
|
"PENDING",
|
|
25
26
|
"ACTIVE",
|
|
26
27
|
"PAUSED",
|
|
27
28
|
"ENDED"
|
|
28
|
-
],
|
|
29
|
+
], Y = [
|
|
29
30
|
.16,
|
|
30
31
|
1,
|
|
31
32
|
.3,
|
|
32
33
|
1
|
|
33
|
-
],
|
|
34
|
+
], ie = {
|
|
34
35
|
hidden: {},
|
|
35
36
|
show: { transition: { staggerChildren: .06 } }
|
|
36
37
|
}, ae = {
|
|
@@ -43,74 +44,92 @@ var K = [
|
|
|
43
44
|
y: 0,
|
|
44
45
|
transition: {
|
|
45
46
|
duration: .35,
|
|
46
|
-
ease:
|
|
47
|
+
ease: Y
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
detail: "Body metrics, recovery scores, sleep hours and free-text notes are stored encrypted and decrypted only when returned to someone allowed to read them."
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
icon: D,
|
|
101
|
-
title: "Health fields are redacted from the audit log",
|
|
102
|
-
detail: "Every mutation is audited, but weights, scores, macros and notes are replaced with a redaction marker before the entry leaves this service."
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
icon: re,
|
|
106
|
-
title: "Scope is fixed for the life of the relationship",
|
|
107
|
-
detail: "The three switches are chosen when the relationship is created. To change them, end this one and create a new relationship with the scope you want."
|
|
50
|
+
};
|
|
51
|
+
function oe(e, t) {
|
|
52
|
+
let n = "mybodyshield.pages.coaching.status";
|
|
53
|
+
switch (t) {
|
|
54
|
+
case "PENDING": return e(`${n}.pending`, "Pending");
|
|
55
|
+
case "ACTIVE": return e(`${n}.active`, "Active");
|
|
56
|
+
case "PAUSED": return e(`${n}.paused`, "Paused");
|
|
57
|
+
case "ENDED": return e(`${n}.ended`, "Ended");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function se(e) {
|
|
61
|
+
return y(() => ({
|
|
62
|
+
PENDING: [{
|
|
63
|
+
to: "ACTIVE",
|
|
64
|
+
label: e("mybodyshield.pages.coaching.accept", "Accept"),
|
|
65
|
+
primary: !0
|
|
66
|
+
}, {
|
|
67
|
+
to: "ENDED",
|
|
68
|
+
label: e("mybodyshield.pages.coaching.endRequest", "End request"),
|
|
69
|
+
primary: !1
|
|
70
|
+
}],
|
|
71
|
+
ACTIVE: [{
|
|
72
|
+
to: "PAUSED",
|
|
73
|
+
label: e("mybodyshield.pages.coaching.pause", "Pause"),
|
|
74
|
+
primary: !1
|
|
75
|
+
}, {
|
|
76
|
+
to: "ENDED",
|
|
77
|
+
label: e("mybodyshield.pages.coaching.end", "End"),
|
|
78
|
+
primary: !1
|
|
79
|
+
}],
|
|
80
|
+
PAUSED: [{
|
|
81
|
+
to: "ACTIVE",
|
|
82
|
+
label: e("mybodyshield.pages.coaching.resume", "Resume"),
|
|
83
|
+
primary: !0
|
|
84
|
+
}, {
|
|
85
|
+
to: "ENDED",
|
|
86
|
+
label: e("mybodyshield.pages.coaching.end", "End"),
|
|
87
|
+
primary: !1
|
|
88
|
+
}],
|
|
89
|
+
ENDED: []
|
|
90
|
+
}), [e]);
|
|
91
|
+
}
|
|
92
|
+
function ce(e, t) {
|
|
93
|
+
switch (t) {
|
|
94
|
+
case "PENDING": return e("mybodyshield.pages.coaching.pendingNote", "Nothing is shared yet. The other party has to accept this request — the person who sent it cannot accept it themselves.");
|
|
95
|
+
case "ACTIVE": return e("mybodyshield.pages.coaching.activeNote", "The coach can read the categories marked On. Pausing or ending this revokes that access on the next request.");
|
|
96
|
+
case "PAUSED": return e("mybodyshield.pages.coaching.pausedNote", "Sharing is suspended while paused. Resuming restores exactly the scope above.");
|
|
97
|
+
case "ENDED": return e("mybodyshield.pages.coaching.endedNote", "Access was revoked when this relationship ended.");
|
|
108
98
|
}
|
|
109
|
-
|
|
110
|
-
function
|
|
111
|
-
return
|
|
99
|
+
}
|
|
100
|
+
function le(e) {
|
|
101
|
+
return y(() => [
|
|
102
|
+
{
|
|
103
|
+
icon: ee,
|
|
104
|
+
title: e("mybodyshield.pages.coaching.checkedOnEveryRead", "Checked on every read"),
|
|
105
|
+
detail: e("mybodyshield.pages.coaching.checkedOnEveryReadDetail", "Each request re-checks the relationship and the matching switch. Access is not granted once and cached for the session.")
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
icon: D,
|
|
109
|
+
title: e("mybodyshield.pages.coaching.refusalsLookLikeNotFound", "Refusals look like \"not found\""),
|
|
110
|
+
detail: e("mybodyshield.pages.coaching.refusalsLookLikeNotFoundDetail", "Asking for data you have not shared returns not-found, never \"forbidden\" — so nobody can use the error to confirm a record exists.")
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
icon: j,
|
|
114
|
+
title: e("mybodyshield.pages.coaching.encryptedAtRest", "Health values are encrypted at rest"),
|
|
115
|
+
detail: e("mybodyshield.pages.coaching.encryptedAtRestDetail", "Body metrics, recovery scores, sleep hours and free-text notes are stored encrypted and decrypted only when returned to someone allowed to read them.")
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
icon: O,
|
|
119
|
+
title: e("mybodyshield.pages.coaching.redactedFromAudit", "Health fields are redacted from the audit log"),
|
|
120
|
+
detail: e("mybodyshield.pages.coaching.redactedFromAuditDetail", "Every mutation is audited, but weights, scores, macros and notes are replaced with a redaction marker before the entry leaves this service.")
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
icon: te,
|
|
124
|
+
title: e("mybodyshield.pages.coaching.scopeFixed", "Scope is fixed for the life of the relationship"),
|
|
125
|
+
detail: e("mybodyshield.pages.coaching.scopeFixedDetail", "The three switches are chosen when the relationship is created. To change them, end this one and create a new relationship with the scope you want.")
|
|
126
|
+
}
|
|
127
|
+
], [e]);
|
|
112
128
|
}
|
|
113
129
|
function X(e) {
|
|
130
|
+
return e.length <= 10 ? e : `${e.slice(0, 8)}…`;
|
|
131
|
+
}
|
|
132
|
+
function Z(e) {
|
|
114
133
|
return {
|
|
115
134
|
memberId: e.userId,
|
|
116
135
|
memberName: e.displayName,
|
|
@@ -122,290 +141,286 @@ function X(e) {
|
|
|
122
141
|
shareMetrics: !0
|
|
123
142
|
};
|
|
124
143
|
}
|
|
125
|
-
function
|
|
126
|
-
return /* @__PURE__ */
|
|
144
|
+
function Q({ id: e, label: t, description: n, checked: r, onChange: i }) {
|
|
145
|
+
return /* @__PURE__ */ R("div", {
|
|
127
146
|
className: "flex items-center justify-between gap-4 rounded-xl bg-bg-sunken/60 p-3",
|
|
128
|
-
children: [/* @__PURE__ */
|
|
147
|
+
children: [/* @__PURE__ */ R("div", {
|
|
129
148
|
className: "min-w-0",
|
|
130
|
-
children: [/* @__PURE__ */
|
|
149
|
+
children: [/* @__PURE__ */ L(V, {
|
|
131
150
|
htmlFor: e,
|
|
132
151
|
className: "cursor-pointer",
|
|
133
152
|
children: t
|
|
134
|
-
}), /* @__PURE__ */
|
|
153
|
+
}), /* @__PURE__ */ L("p", {
|
|
135
154
|
className: "text-xs text-text-tertiary",
|
|
136
155
|
children: n
|
|
137
156
|
})]
|
|
138
|
-
}), /* @__PURE__ */
|
|
157
|
+
}), /* @__PURE__ */ L(q, {
|
|
139
158
|
id: e,
|
|
140
159
|
checked: r,
|
|
141
160
|
onCheckedChange: i
|
|
142
161
|
})]
|
|
143
162
|
});
|
|
144
163
|
}
|
|
145
|
-
function
|
|
146
|
-
let r =
|
|
147
|
-
e || (
|
|
148
|
-
},
|
|
149
|
-
let e =
|
|
164
|
+
function ue({ open: e, onOpenChange: t, defaultMember: n }) {
|
|
165
|
+
let r = c(), i = o(), [a, s] = b(() => Z(n)), [l, u] = b(null), d = (e) => {
|
|
166
|
+
e || (s(Z(n)), u(null)), t(e);
|
|
167
|
+
}, f = async () => {
|
|
168
|
+
let e = a.coachId.trim(), o = a.memberId.trim();
|
|
150
169
|
if (!e) {
|
|
151
|
-
|
|
170
|
+
u(r("mybodyshield.pages.coaching.coachRequired", "Coach user id is required."));
|
|
152
171
|
return;
|
|
153
172
|
}
|
|
154
173
|
if (!o) {
|
|
155
|
-
|
|
174
|
+
u(r("mybodyshield.pages.coaching.memberRequired", "Member user id is required."));
|
|
156
175
|
return;
|
|
157
176
|
}
|
|
158
|
-
|
|
177
|
+
u(null);
|
|
159
178
|
let c = {
|
|
160
179
|
coachId: e,
|
|
161
180
|
memberId: o,
|
|
162
|
-
specialty:
|
|
163
|
-
shareWorkouts:
|
|
164
|
-
shareNutrition:
|
|
165
|
-
shareMetrics:
|
|
181
|
+
specialty: a.specialty.trim() || void 0,
|
|
182
|
+
shareWorkouts: a.shareWorkouts,
|
|
183
|
+
shareNutrition: a.shareNutrition,
|
|
184
|
+
shareMetrics: a.shareMetrics
|
|
166
185
|
};
|
|
167
186
|
try {
|
|
168
|
-
await
|
|
187
|
+
await i.mutateAsync(c), s(Z(n)), t(!1);
|
|
169
188
|
} catch (e) {
|
|
170
|
-
|
|
189
|
+
u(e instanceof Error ? e.message : r("mybodyshield.pages.coaching.failedToCreate", "Failed to create coaching relationship."));
|
|
171
190
|
}
|
|
172
191
|
};
|
|
173
|
-
return /* @__PURE__ */
|
|
192
|
+
return /* @__PURE__ */ L(re, {
|
|
174
193
|
open: e,
|
|
175
|
-
onOpenChange:
|
|
176
|
-
children: /* @__PURE__ */
|
|
194
|
+
onOpenChange: d,
|
|
195
|
+
children: /* @__PURE__ */ R(H, { children: [/* @__PURE__ */ R(G, { children: [/* @__PURE__ */ L(K, { children: r("mybodyshield.pages.coaching.dialogTitle", "New coaching") }), /* @__PURE__ */ L(U, { children: r("mybodyshield.pages.coaching.dialogDescription", "Link a coach and member, and choose exactly what training, nutrition and progress data is shared.") })] }), /* @__PURE__ */ R("form", {
|
|
177
196
|
className: "space-y-4",
|
|
178
197
|
onSubmit: (e) => {
|
|
179
|
-
e.preventDefault(),
|
|
198
|
+
e.preventDefault(), f();
|
|
180
199
|
},
|
|
181
200
|
children: [
|
|
182
|
-
|
|
201
|
+
l && /* @__PURE__ */ L("p", {
|
|
183
202
|
className: "rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
184
|
-
children:
|
|
203
|
+
children: l
|
|
185
204
|
}),
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
label: "Coach",
|
|
205
|
+
/* @__PURE__ */ L(m, {
|
|
206
|
+
label: r("mybodyshield.pages.coaching.coach", "Coach"),
|
|
188
207
|
required: !0,
|
|
189
208
|
htmlId: "myb-coaching-coach",
|
|
190
|
-
userId:
|
|
191
|
-
displayName:
|
|
192
|
-
onSelect: ({ userId: e, displayName: t }) =>
|
|
209
|
+
userId: a.coachId,
|
|
210
|
+
displayName: a.coachName,
|
|
211
|
+
onSelect: ({ userId: e, displayName: t }) => s((n) => ({
|
|
193
212
|
...n,
|
|
194
213
|
coachId: e,
|
|
195
214
|
coachName: t
|
|
196
215
|
}))
|
|
197
216
|
}),
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
-
label: "Member",
|
|
217
|
+
/* @__PURE__ */ L(m, {
|
|
218
|
+
label: r("mybodyshield.pages.coaching.member", "Member"),
|
|
200
219
|
htmlId: "myb-coaching-member",
|
|
201
|
-
userId:
|
|
202
|
-
displayName:
|
|
203
|
-
onSelect: ({ userId: e, displayName: t }) =>
|
|
220
|
+
userId: a.memberId,
|
|
221
|
+
displayName: a.memberName,
|
|
222
|
+
onSelect: ({ userId: e, displayName: t }) => s((n) => ({
|
|
204
223
|
...n,
|
|
205
224
|
memberId: e,
|
|
206
225
|
memberName: t
|
|
207
226
|
}))
|
|
208
227
|
}),
|
|
209
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ R("div", {
|
|
210
229
|
className: "space-y-2",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
230
|
+
children: [/* @__PURE__ */ L(V, {
|
|
212
231
|
htmlFor: "myb-coaching-specialty",
|
|
213
|
-
children: "Specialty"
|
|
214
|
-
}), /* @__PURE__ */
|
|
232
|
+
children: r("mybodyshield.pages.coaching.specialty", "Specialty")
|
|
233
|
+
}), /* @__PURE__ */ L(ne, {
|
|
215
234
|
id: "myb-coaching-specialty",
|
|
216
|
-
value:
|
|
217
|
-
onChange: (e) =>
|
|
235
|
+
value: a.specialty,
|
|
236
|
+
onChange: (e) => s((t) => ({
|
|
218
237
|
...t,
|
|
219
238
|
specialty: e.target.value
|
|
220
239
|
})),
|
|
221
|
-
placeholder: "e.g., Strength & conditioning"
|
|
240
|
+
placeholder: r("mybodyshield.pages.coaching.specialtyPlaceholder", "e.g., Strength & conditioning")
|
|
222
241
|
})]
|
|
223
242
|
}),
|
|
224
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ R("div", {
|
|
225
244
|
className: "space-y-2",
|
|
226
245
|
children: [
|
|
227
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ L("p", {
|
|
228
247
|
className: "text-sm font-medium text-text-primary",
|
|
229
|
-
children: "Shared with the coach"
|
|
248
|
+
children: r("mybodyshield.pages.coaching.sharedWithCoach", "Shared with the coach")
|
|
230
249
|
}),
|
|
231
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ L(Q, {
|
|
232
251
|
id: "myb-coaching-share-workouts",
|
|
233
|
-
label: "Workouts",
|
|
234
|
-
description: "Programs, sessions and logged sets.",
|
|
235
|
-
checked:
|
|
236
|
-
onChange: (e) =>
|
|
252
|
+
label: r("mybodyshield.pages.coaching.workouts", "Workouts"),
|
|
253
|
+
description: r("mybodyshield.pages.coaching.workoutsDescription", "Programs, sessions and logged sets."),
|
|
254
|
+
checked: a.shareWorkouts,
|
|
255
|
+
onChange: (e) => s((t) => ({
|
|
237
256
|
...t,
|
|
238
257
|
shareWorkouts: e
|
|
239
258
|
}))
|
|
240
259
|
}),
|
|
241
|
-
/* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ L(Q, {
|
|
242
261
|
id: "myb-coaching-share-nutrition",
|
|
243
|
-
label: "Nutrition",
|
|
244
|
-
description: "Plans, meals and daily macros.",
|
|
245
|
-
checked:
|
|
246
|
-
onChange: (e) =>
|
|
262
|
+
label: r("mybodyshield.pages.coaching.nutrition", "Nutrition"),
|
|
263
|
+
description: r("mybodyshield.pages.coaching.nutritionDescription", "Plans, meals and daily macros."),
|
|
264
|
+
checked: a.shareNutrition,
|
|
265
|
+
onChange: (e) => s((t) => ({
|
|
247
266
|
...t,
|
|
248
267
|
shareNutrition: e
|
|
249
268
|
}))
|
|
250
269
|
}),
|
|
251
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ L(Q, {
|
|
252
271
|
id: "myb-coaching-share-metrics",
|
|
253
|
-
label: "Metrics",
|
|
254
|
-
description: "Body metrics and recovery logs.",
|
|
255
|
-
checked:
|
|
256
|
-
onChange: (e) =>
|
|
272
|
+
label: r("mybodyshield.pages.coaching.metrics", "Metrics"),
|
|
273
|
+
description: r("mybodyshield.pages.coaching.metricsDescription", "Body metrics and recovery logs."),
|
|
274
|
+
checked: a.shareMetrics,
|
|
275
|
+
onChange: (e) => s((t) => ({
|
|
257
276
|
...t,
|
|
258
277
|
shareMetrics: e
|
|
259
278
|
}))
|
|
260
279
|
})
|
|
261
280
|
]
|
|
262
281
|
}),
|
|
263
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ R(W, { children: [/* @__PURE__ */ L(z, {
|
|
264
283
|
type: "button",
|
|
265
284
|
variant: "outline",
|
|
266
|
-
onClick: () =>
|
|
267
|
-
disabled:
|
|
268
|
-
children: "Cancel"
|
|
269
|
-
}), /* @__PURE__ */
|
|
285
|
+
onClick: () => d(!1),
|
|
286
|
+
disabled: i.isPending,
|
|
287
|
+
children: r("mybodyshield.common.cancel", "Cancel")
|
|
288
|
+
}), /* @__PURE__ */ L(z, {
|
|
270
289
|
type: "submit",
|
|
271
|
-
disabled:
|
|
272
|
-
children:
|
|
290
|
+
disabled: i.isPending,
|
|
291
|
+
children: i.isPending ? r("mybodyshield.common.creating", "Creating…") : r("mybodyshield.pages.coaching.createCoachingButton", "Create coaching")
|
|
273
292
|
})] })
|
|
274
293
|
]
|
|
275
294
|
})] })
|
|
276
295
|
});
|
|
277
296
|
}
|
|
278
|
-
function
|
|
279
|
-
let
|
|
280
|
-
return /* @__PURE__ */
|
|
281
|
-
"aria-label": `${
|
|
282
|
-
className: `inline-flex items-center gap-1.5 rounded-full py-0.5 pl-1 pr-2.5 text-xs font-medium ${
|
|
297
|
+
function $({ t: e, label: t, icon: n, on: r }) {
|
|
298
|
+
let i = n, a = r ? C : N;
|
|
299
|
+
return /* @__PURE__ */ R("span", {
|
|
300
|
+
"aria-label": `${t} ${r ? e("mybodyshield.pages.coaching.shared", "shared") : e("mybodyshield.pages.coaching.notShared", "not shared")}`,
|
|
301
|
+
className: `inline-flex items-center gap-1.5 rounded-full py-0.5 pl-1 pr-2.5 text-xs font-medium ${r ? "bg-status-success-bg-subtle text-status-success-text ring-1 ring-inset ring-[color-mix(in_oklab,var(--color-status-success-text)_28%,transparent)]" : "bg-bg-sunken text-text-tertiary ring-1 ring-inset ring-border-seam"}`,
|
|
283
302
|
children: [
|
|
284
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ L("span", {
|
|
285
304
|
"aria-hidden": "true",
|
|
286
|
-
className: `inline-flex size-4 items-center justify-center rounded-full ${
|
|
287
|
-
children: /* @__PURE__ */
|
|
305
|
+
className: `inline-flex size-4 items-center justify-center rounded-full ${r ? "bg-[color-mix(in_oklab,var(--color-status-success-text)_22%,transparent)]" : "bg-[color-mix(in_oklab,var(--color-text-tertiary)_18%,transparent)]"}`,
|
|
306
|
+
children: /* @__PURE__ */ L(a, { className: "h-2.5 w-2.5" })
|
|
288
307
|
}),
|
|
289
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ L(i, {
|
|
290
309
|
className: "h-3 w-3",
|
|
291
310
|
"aria-hidden": "true"
|
|
292
311
|
}),
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
-
|
|
295
|
-
" ·
|
|
296
|
-
|
|
312
|
+
/* @__PURE__ */ R("span", { children: [
|
|
313
|
+
t,
|
|
314
|
+
" ·",
|
|
315
|
+
" ",
|
|
316
|
+
r ? e("mybodyshield.pages.coaching.on", "On") : e("mybodyshield.pages.coaching.off", "Off")
|
|
297
317
|
] })
|
|
298
318
|
]
|
|
299
319
|
});
|
|
300
320
|
}
|
|
301
|
-
function
|
|
302
|
-
let o = !!t && e.coachId === t,
|
|
303
|
-
return /* @__PURE__ */
|
|
321
|
+
function de({ relationship: e, currentUserId: t, busy: i, onTransition: a }) {
|
|
322
|
+
let o = c(), s = se(o), l = !!t && e.coachId === t, u = !!t && e.memberId === t, d = s[e.status], f = e.status === "ACTIVE" || e.status === "PAUSED", [m, y] = b(!1), C = _();
|
|
323
|
+
return /* @__PURE__ */ R(B, {
|
|
304
324
|
treatment: "glass",
|
|
305
325
|
glow: e.status === "ACTIVE",
|
|
306
326
|
className: "flex h-full flex-col gap-4 p-5 transition-shadow hover:shadow-float" + (e.status === "PENDING" ? " ring-1 ring-inset ring-[color-mix(in_oklab,var(--color-status-warning-text)_35%,transparent)]" : ""),
|
|
307
327
|
children: [
|
|
308
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ R("div", {
|
|
309
329
|
className: "flex items-start justify-between gap-3",
|
|
310
|
-
children: [/* @__PURE__ */
|
|
330
|
+
children: [/* @__PURE__ */ R("div", {
|
|
311
331
|
className: "flex min-w-0 items-start gap-3",
|
|
312
|
-
children: [/* @__PURE__ */
|
|
332
|
+
children: [/* @__PURE__ */ L(v, { icon: /* @__PURE__ */ L(k, { className: "h-4 w-4" }) }), /* @__PURE__ */ R("div", {
|
|
313
333
|
className: "min-w-0",
|
|
314
|
-
children: [/* @__PURE__ */
|
|
334
|
+
children: [/* @__PURE__ */ L("p", {
|
|
315
335
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
316
|
-
children: e.specialty?.trim() || "Coaching relationship"
|
|
317
|
-
}), /* @__PURE__ */
|
|
336
|
+
children: e.specialty?.trim() || o("mybodyshield.pages.coaching.coachingRelationship", "Coaching relationship")
|
|
337
|
+
}), /* @__PURE__ */ L("p", {
|
|
318
338
|
className: "text-xs text-text-tertiary",
|
|
319
|
-
children: "Coach ↔ member"
|
|
339
|
+
children: o("mybodyshield.pages.coaching.coachMember", "Coach ↔ member")
|
|
320
340
|
})]
|
|
321
341
|
})]
|
|
322
|
-
}), /* @__PURE__ */
|
|
342
|
+
}), /* @__PURE__ */ L(r, { status: e.status })]
|
|
323
343
|
}),
|
|
324
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ R("div", {
|
|
325
345
|
className: "grid grid-cols-2 gap-3",
|
|
326
|
-
children: [/* @__PURE__ */
|
|
346
|
+
children: [/* @__PURE__ */ R("div", {
|
|
327
347
|
className: "flex items-center gap-2.5 rounded-lg bg-bg-sunken/60 p-2.5",
|
|
328
|
-
children: [/* @__PURE__ */
|
|
348
|
+
children: [/* @__PURE__ */ L("span", {
|
|
329
349
|
"aria-hidden": "true",
|
|
330
|
-
className: `flex size-8 shrink-0 items-center justify-center rounded-full ring-1 ring-inset ${
|
|
331
|
-
children: /* @__PURE__ */
|
|
332
|
-
}), /* @__PURE__ */
|
|
350
|
+
className: `flex size-8 shrink-0 items-center justify-center rounded-full ring-1 ring-inset ${l ? "bg-[color-mix(in_oklab,var(--color-action-primary-bg)_16%,transparent)] text-action-primary-bg ring-[color-mix(in_oklab,var(--color-action-primary-bg)_40%,transparent)]" : "bg-bg-surface text-text-tertiary ring-border-seam"}`,
|
|
351
|
+
children: /* @__PURE__ */ L(I, { className: "h-4 w-4" })
|
|
352
|
+
}), /* @__PURE__ */ R("div", {
|
|
333
353
|
className: "min-w-0",
|
|
334
|
-
children: [/* @__PURE__ */
|
|
354
|
+
children: [/* @__PURE__ */ L("p", {
|
|
335
355
|
className: "text-[11px] font-medium uppercase tracking-wide text-text-tertiary",
|
|
336
|
-
children: "Coach"
|
|
337
|
-
}), /* @__PURE__ */
|
|
356
|
+
children: o("mybodyshield.pages.coaching.coachLabel", "Coach")
|
|
357
|
+
}), /* @__PURE__ */ L("p", {
|
|
338
358
|
className: "mt-0.5 truncate text-sm font-medium text-text-primary",
|
|
339
359
|
title: e.coachId,
|
|
340
|
-
children:
|
|
360
|
+
children: l ? o("mybodyshield.pages.coaching.you", "You") : `#${X(e.coachId)}`
|
|
341
361
|
})]
|
|
342
362
|
})]
|
|
343
|
-
}), /* @__PURE__ */
|
|
363
|
+
}), /* @__PURE__ */ R("div", {
|
|
344
364
|
className: "flex items-center gap-2.5 rounded-lg bg-bg-sunken/60 p-2.5",
|
|
345
|
-
children: [/* @__PURE__ */
|
|
365
|
+
children: [/* @__PURE__ */ L("span", {
|
|
346
366
|
"aria-hidden": "true",
|
|
347
|
-
className: `flex size-8 shrink-0 items-center justify-center rounded-full ring-1 ring-inset ${
|
|
348
|
-
children: /* @__PURE__ */
|
|
349
|
-
}), /* @__PURE__ */
|
|
367
|
+
className: `flex size-8 shrink-0 items-center justify-center rounded-full ring-1 ring-inset ${u ? "bg-[color-mix(in_oklab,var(--color-action-primary-bg)_16%,transparent)] text-action-primary-bg ring-[color-mix(in_oklab,var(--color-action-primary-bg)_40%,transparent)]" : "bg-bg-surface text-text-tertiary ring-border-seam"}`,
|
|
368
|
+
children: /* @__PURE__ */ L(I, { className: "h-4 w-4" })
|
|
369
|
+
}), /* @__PURE__ */ R("div", {
|
|
350
370
|
className: "min-w-0",
|
|
351
|
-
children: [/* @__PURE__ */
|
|
371
|
+
children: [/* @__PURE__ */ L("p", {
|
|
352
372
|
className: "text-[11px] font-medium uppercase tracking-wide text-text-tertiary",
|
|
353
|
-
children: "Member"
|
|
354
|
-
}), /* @__PURE__ */
|
|
373
|
+
children: o("mybodyshield.pages.coaching.memberLabel", "Member")
|
|
374
|
+
}), /* @__PURE__ */ L("p", {
|
|
355
375
|
className: "mt-0.5 truncate text-sm font-medium text-text-primary",
|
|
356
376
|
title: e.memberId,
|
|
357
|
-
children:
|
|
377
|
+
children: u ? o("mybodyshield.pages.coaching.you", "You") : `#${X(e.memberId)}`
|
|
358
378
|
})]
|
|
359
379
|
})]
|
|
360
380
|
})]
|
|
361
381
|
}),
|
|
362
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ R("div", {
|
|
363
383
|
className: "space-y-2",
|
|
364
|
-
children: [/* @__PURE__ */
|
|
384
|
+
children: [/* @__PURE__ */ R("div", {
|
|
365
385
|
className: "flex flex-wrap gap-1.5",
|
|
366
386
|
children: [
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
-
|
|
369
|
-
|
|
387
|
+
/* @__PURE__ */ L($, {
|
|
388
|
+
t: o,
|
|
389
|
+
label: o("mybodyshield.pages.coaching.workouts", "Workouts"),
|
|
390
|
+
icon: E,
|
|
370
391
|
on: e.shareWorkouts
|
|
371
392
|
}),
|
|
372
|
-
/* @__PURE__ */
|
|
373
|
-
|
|
374
|
-
|
|
393
|
+
/* @__PURE__ */ L($, {
|
|
394
|
+
t: o,
|
|
395
|
+
label: o("mybodyshield.pages.coaching.nutrition", "Nutrition"),
|
|
396
|
+
icon: F,
|
|
375
397
|
on: e.shareNutrition
|
|
376
398
|
}),
|
|
377
|
-
/* @__PURE__ */
|
|
378
|
-
|
|
379
|
-
|
|
399
|
+
/* @__PURE__ */ L($, {
|
|
400
|
+
t: o,
|
|
401
|
+
label: o("mybodyshield.pages.coaching.metrics", "Metrics"),
|
|
402
|
+
icon: A,
|
|
380
403
|
on: e.shareMetrics
|
|
381
404
|
})
|
|
382
405
|
]
|
|
383
|
-
}), /* @__PURE__ */
|
|
406
|
+
}), /* @__PURE__ */ L("p", {
|
|
384
407
|
className: "text-xs leading-relaxed text-text-tertiary",
|
|
385
|
-
children:
|
|
408
|
+
children: ce(o, e.status)
|
|
386
409
|
})]
|
|
387
410
|
}),
|
|
388
|
-
(e.startedAt || e.endedAt) && /* @__PURE__ */
|
|
411
|
+
(e.startedAt || e.endedAt) && /* @__PURE__ */ R("div", {
|
|
389
412
|
className: "flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-text-tertiary",
|
|
390
|
-
children: [e.startedAt && /* @__PURE__ */
|
|
413
|
+
children: [e.startedAt && /* @__PURE__ */ R("span", {
|
|
391
414
|
className: "inline-flex items-center gap-1",
|
|
392
|
-
children: [
|
|
393
|
-
|
|
394
|
-
"Started ",
|
|
395
|
-
n(e.startedAt)
|
|
396
|
-
]
|
|
397
|
-
}), e.endedAt && /* @__PURE__ */ F("span", {
|
|
415
|
+
children: [/* @__PURE__ */ L(x, { className: "h-3.5 w-3.5" }), o("mybodyshield.pages.coaching.started", "Started {{date}}", { date: n(e.startedAt) })]
|
|
416
|
+
}), e.endedAt && /* @__PURE__ */ R("span", {
|
|
398
417
|
className: "inline-flex items-center gap-1",
|
|
399
|
-
children: [
|
|
400
|
-
/* @__PURE__ */ P(x, { className: "h-3.5 w-3.5" }),
|
|
401
|
-
"Ended ",
|
|
402
|
-
n(e.endedAt)
|
|
403
|
-
]
|
|
418
|
+
children: [/* @__PURE__ */ L(S, { className: "h-3.5 w-3.5" }), o("mybodyshield.pages.coaching.ended", "Ended {{date}}", { date: n(e.endedAt) })]
|
|
404
419
|
})]
|
|
405
420
|
}),
|
|
406
|
-
|
|
421
|
+
d.length > 0 && /* @__PURE__ */ L("div", {
|
|
407
422
|
className: "mt-auto flex flex-wrap gap-2 pt-1",
|
|
408
|
-
children:
|
|
423
|
+
children: d.map((t) => /* @__PURE__ */ L(z, {
|
|
409
424
|
size: "sm",
|
|
410
425
|
variant: t.primary ? void 0 : "outline",
|
|
411
426
|
disabled: i,
|
|
@@ -413,22 +428,22 @@ function $({ relationship: e, currentUserId: t, busy: i, onTransition: a }) {
|
|
|
413
428
|
children: t.label
|
|
414
429
|
}, t.to))
|
|
415
430
|
}),
|
|
416
|
-
|
|
417
|
-
className: `border-t border-border-seam pt-3 ${
|
|
418
|
-
children: [/* @__PURE__ */
|
|
431
|
+
f && /* @__PURE__ */ R("div", {
|
|
432
|
+
className: `border-t border-border-seam pt-3 ${d.length === 0 ? "mt-auto" : ""}`,
|
|
433
|
+
children: [/* @__PURE__ */ R("button", {
|
|
419
434
|
type: "button",
|
|
420
|
-
onClick: () =>
|
|
421
|
-
"aria-expanded":
|
|
435
|
+
onClick: () => y((e) => !e),
|
|
436
|
+
"aria-expanded": m,
|
|
422
437
|
className: "inline-flex items-center gap-1.5 text-sm font-medium text-accent hover:underline",
|
|
423
438
|
children: [
|
|
424
|
-
/* @__PURE__ */
|
|
425
|
-
|
|
426
|
-
|
|
439
|
+
/* @__PURE__ */ L(M, { className: "h-4 w-4" }),
|
|
440
|
+
m ? o("mybodyshield.pages.coaching.hideDiscussion", "Hide discussion") : o("mybodyshield.pages.coaching.discussion", "Discussion"),
|
|
441
|
+
L(m ? T : w, { className: "h-4 w-4" })
|
|
427
442
|
]
|
|
428
|
-
}), /* @__PURE__ */
|
|
443
|
+
}), /* @__PURE__ */ L(h, {
|
|
429
444
|
initial: !1,
|
|
430
|
-
children:
|
|
431
|
-
initial:
|
|
445
|
+
children: m && /* @__PURE__ */ L(g.div, {
|
|
446
|
+
initial: C ? !1 : {
|
|
432
447
|
opacity: 0,
|
|
433
448
|
height: 0
|
|
434
449
|
},
|
|
@@ -436,22 +451,22 @@ function $({ relationship: e, currentUserId: t, busy: i, onTransition: a }) {
|
|
|
436
451
|
opacity: 1,
|
|
437
452
|
height: "auto"
|
|
438
453
|
},
|
|
439
|
-
exit:
|
|
454
|
+
exit: C ? { opacity: 0 } : {
|
|
440
455
|
opacity: 0,
|
|
441
456
|
height: 0
|
|
442
457
|
},
|
|
443
|
-
transition:
|
|
458
|
+
transition: C ? { duration: 0 } : {
|
|
444
459
|
duration: .25,
|
|
445
|
-
ease:
|
|
460
|
+
ease: Y
|
|
446
461
|
},
|
|
447
462
|
className: "overflow-hidden",
|
|
448
|
-
children: /* @__PURE__ */
|
|
463
|
+
children: /* @__PURE__ */ L("div", {
|
|
449
464
|
className: "mt-3",
|
|
450
|
-
children: /* @__PURE__ */
|
|
465
|
+
children: /* @__PURE__ */ L(p, {
|
|
451
466
|
entityType: "mybodyshield-coaching",
|
|
452
467
|
entityId: e.id,
|
|
453
|
-
title: "Coaching discussion",
|
|
454
|
-
description: "A private thread between the coach and member."
|
|
468
|
+
title: o("mybodyshield.pages.coaching.coachingDiscussion", "Coaching discussion"),
|
|
469
|
+
description: o("mybodyshield.pages.coaching.coachingDiscussionDescription", "A private thread between the coach and member.")
|
|
455
470
|
})
|
|
456
471
|
})
|
|
457
472
|
}, "discussion")
|
|
@@ -460,25 +475,26 @@ function $({ relationship: e, currentUserId: t, busy: i, onTransition: a }) {
|
|
|
460
475
|
]
|
|
461
476
|
});
|
|
462
477
|
}
|
|
463
|
-
function
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
478
|
+
function fe() {
|
|
479
|
+
let e = c(), t = le(e);
|
|
480
|
+
return /* @__PURE__ */ L(d, {
|
|
481
|
+
title: e("mybodyshield.pages.coaching.sharingEnforcementTitle", "How sharing is enforced"),
|
|
482
|
+
description: e("mybodyshield.pages.coaching.sharingEnforcementDescription", "Private by default — a coach only ever sees the categories you switched on, for as long as the relationship is active."),
|
|
483
|
+
children: /* @__PURE__ */ L(B, {
|
|
468
484
|
treatment: "plain",
|
|
469
485
|
className: "p-5",
|
|
470
|
-
children: /* @__PURE__ */
|
|
486
|
+
children: /* @__PURE__ */ L("ul", {
|
|
471
487
|
className: "grid gap-4 sm:grid-cols-2",
|
|
472
|
-
children:
|
|
488
|
+
children: t.map((e) => {
|
|
473
489
|
let t = e.icon;
|
|
474
|
-
return /* @__PURE__ */
|
|
490
|
+
return /* @__PURE__ */ R("li", {
|
|
475
491
|
className: "flex items-start gap-3",
|
|
476
|
-
children: [/* @__PURE__ */
|
|
492
|
+
children: [/* @__PURE__ */ L(v, { icon: /* @__PURE__ */ L(t, { className: "h-4 w-4" }) }), /* @__PURE__ */ R("div", {
|
|
477
493
|
className: "min-w-0",
|
|
478
|
-
children: [/* @__PURE__ */
|
|
494
|
+
children: [/* @__PURE__ */ L("p", {
|
|
479
495
|
className: "text-sm font-medium text-text-primary",
|
|
480
496
|
children: e.title
|
|
481
|
-
}), /* @__PURE__ */
|
|
497
|
+
}), /* @__PURE__ */ L("p", {
|
|
482
498
|
className: "mt-0.5 text-xs leading-relaxed text-text-secondary",
|
|
483
499
|
children: e.detail
|
|
484
500
|
})]
|
|
@@ -489,98 +505,102 @@ function ue() {
|
|
|
489
505
|
})
|
|
490
506
|
});
|
|
491
507
|
}
|
|
492
|
-
function
|
|
493
|
-
let { currentUser:
|
|
508
|
+
function pe() {
|
|
509
|
+
let n = c(), { currentUser: r } = e(), o = _(), [d, p] = b("ALL"), [m, h] = b(!1), [v, x] = b(null), [S, C] = b(null), w = a(), T = s(), E = w.data?.items ?? [], D = y(() => {
|
|
494
510
|
let e = {
|
|
495
511
|
PENDING: 0,
|
|
496
512
|
ACTIVE: 0,
|
|
497
513
|
PAUSED: 0,
|
|
498
514
|
ENDED: 0
|
|
499
515
|
};
|
|
500
|
-
for (let t of
|
|
516
|
+
for (let t of E) e[t.status] += 1;
|
|
501
517
|
return e;
|
|
502
|
-
}, [
|
|
518
|
+
}, [E]), O = y(() => [{
|
|
503
519
|
value: "ALL",
|
|
504
|
-
label: "All",
|
|
505
|
-
count:
|
|
506
|
-
}, ...
|
|
520
|
+
label: n("mybodyshield.common.all", "All"),
|
|
521
|
+
count: E.length
|
|
522
|
+
}, ...J.map((e) => ({
|
|
507
523
|
value: e,
|
|
508
|
-
label:
|
|
509
|
-
count:
|
|
510
|
-
}))], [
|
|
511
|
-
|
|
524
|
+
label: oe(n, e),
|
|
525
|
+
count: D[e]
|
|
526
|
+
}))], [
|
|
527
|
+
E.length,
|
|
528
|
+
D,
|
|
529
|
+
n
|
|
530
|
+
]), A = y(() => d === "ALL" ? E : E.filter((e) => e.status === d), [E, d]), j = async (e, t) => {
|
|
531
|
+
x(e), C(null);
|
|
512
532
|
try {
|
|
513
|
-
await
|
|
533
|
+
await T.mutateAsync({
|
|
514
534
|
id: e,
|
|
515
535
|
status: t
|
|
516
536
|
});
|
|
517
537
|
} catch (e) {
|
|
518
|
-
|
|
538
|
+
C(e instanceof Error ? e.message : n("mybodyshield.pages.coaching.failedToUpdate", "Failed to update the relationship."));
|
|
519
539
|
} finally {
|
|
520
|
-
|
|
540
|
+
x(null);
|
|
521
541
|
}
|
|
522
|
-
},
|
|
523
|
-
return /* @__PURE__ */
|
|
524
|
-
title: "Coaching",
|
|
525
|
-
description: "Coach ↔ member relationships and what's shared.",
|
|
526
|
-
actions: /* @__PURE__ */
|
|
527
|
-
onClick: () =>
|
|
528
|
-
children: [/* @__PURE__ */ P
|
|
542
|
+
}, M = w.isLoading && !w.data;
|
|
543
|
+
return /* @__PURE__ */ R(t, {
|
|
544
|
+
title: n("mybodyshield.pages.coaching.title", "Coaching"),
|
|
545
|
+
description: n("mybodyshield.pages.coaching.description", "Coach ↔ member relationships and what's shared."),
|
|
546
|
+
actions: /* @__PURE__ */ R(z, {
|
|
547
|
+
onClick: () => h(!0),
|
|
548
|
+
children: [/* @__PURE__ */ L(P, { className: "mr-2 h-4 w-4" }), n("mybodyshield.pages.coaching.newCoaching", "New coaching")]
|
|
529
549
|
}),
|
|
530
550
|
children: [
|
|
531
|
-
/* @__PURE__ */
|
|
551
|
+
/* @__PURE__ */ L("div", {
|
|
532
552
|
className: "mb-6",
|
|
533
|
-
children: /* @__PURE__ */
|
|
534
|
-
options:
|
|
535
|
-
value:
|
|
536
|
-
onChange:
|
|
553
|
+
children: /* @__PURE__ */ L(f, {
|
|
554
|
+
options: O,
|
|
555
|
+
value: d,
|
|
556
|
+
onChange: p
|
|
537
557
|
})
|
|
538
558
|
}),
|
|
539
|
-
|
|
559
|
+
S && /* @__PURE__ */ L("p", {
|
|
540
560
|
className: "mb-4 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
541
|
-
children:
|
|
561
|
+
children: S
|
|
542
562
|
}),
|
|
543
|
-
|
|
544
|
-
message: "We couldn't load your coaching relationships.",
|
|
545
|
-
onRetry: () => void
|
|
546
|
-
}) :
|
|
563
|
+
M ? /* @__PURE__ */ L(u, { label: n("mybodyshield.pages.coaching.loading", "Loading coaching relationships…") }) : w.isError ? /* @__PURE__ */ L(l, {
|
|
564
|
+
message: n("mybodyshield.pages.coaching.error", "We couldn't load your coaching relationships."),
|
|
565
|
+
onRetry: () => void w.refetch()
|
|
566
|
+
}) : A.length === 0 ? /* @__PURE__ */ L(i, {
|
|
547
567
|
illustration: "empty-data",
|
|
548
|
-
icon: /* @__PURE__ */
|
|
549
|
-
title:
|
|
550
|
-
description:
|
|
551
|
-
action: /* @__PURE__ */
|
|
552
|
-
onClick: () =>
|
|
553
|
-
children: [/* @__PURE__ */ P
|
|
568
|
+
icon: /* @__PURE__ */ L(k, { className: "h-10 w-10" }),
|
|
569
|
+
title: E.length === 0 ? n("mybodyshield.pages.coaching.emptyTitle", "No coaching relationships") : n("mybodyshield.pages.coaching.emptyFilteredTitle", "No relationships match this filter"),
|
|
570
|
+
description: E.length === 0 ? n("mybodyshield.pages.coaching.emptyDescription", "Connect a coach and a member to start sharing training, nutrition and progress data.") : n("mybodyshield.pages.coaching.emptyFilteredDescription", "Try a different status filter, or create a new coaching relationship."),
|
|
571
|
+
action: /* @__PURE__ */ R(z, {
|
|
572
|
+
onClick: () => h(!0),
|
|
573
|
+
children: [/* @__PURE__ */ L(P, { className: "mr-2 h-4 w-4" }), n("mybodyshield.pages.coaching.newCoaching", "New coaching")]
|
|
554
574
|
})
|
|
555
|
-
}) : /* @__PURE__ */
|
|
575
|
+
}) : /* @__PURE__ */ L(g.div, {
|
|
556
576
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
557
|
-
variants:
|
|
558
|
-
initial:
|
|
577
|
+
variants: o ? void 0 : ie,
|
|
578
|
+
initial: o ? !1 : "hidden",
|
|
559
579
|
animate: "show",
|
|
560
|
-
children:
|
|
580
|
+
children: A.map((e) => /* @__PURE__ */ L(g.div, {
|
|
561
581
|
className: "h-full",
|
|
562
|
-
variants:
|
|
563
|
-
children: /* @__PURE__ */
|
|
582
|
+
variants: o ? void 0 : ae,
|
|
583
|
+
children: /* @__PURE__ */ L(de, {
|
|
564
584
|
relationship: e,
|
|
565
|
-
currentUserId:
|
|
566
|
-
busy:
|
|
567
|
-
onTransition: (e, t) => void
|
|
585
|
+
currentUserId: r?.id,
|
|
586
|
+
busy: v === e.id,
|
|
587
|
+
onTransition: (e, t) => void j(e, t)
|
|
568
588
|
})
|
|
569
589
|
}, e.id))
|
|
570
590
|
}),
|
|
571
|
-
/* @__PURE__ */
|
|
572
|
-
/* @__PURE__ */
|
|
573
|
-
open:
|
|
574
|
-
onOpenChange:
|
|
591
|
+
/* @__PURE__ */ L(fe, {}),
|
|
592
|
+
/* @__PURE__ */ L(ue, {
|
|
593
|
+
open: m,
|
|
594
|
+
onOpenChange: h,
|
|
575
595
|
defaultMember: {
|
|
576
|
-
userId:
|
|
577
|
-
displayName:
|
|
596
|
+
userId: r?.id ?? "",
|
|
597
|
+
displayName: r?.name || r?.email || ""
|
|
578
598
|
}
|
|
579
599
|
})
|
|
580
600
|
]
|
|
581
601
|
});
|
|
582
602
|
}
|
|
583
603
|
//#endregion
|
|
584
|
-
export {
|
|
604
|
+
export { pe as CoachingPage };
|
|
585
605
|
|
|
586
606
|
//# sourceMappingURL=CoachingPage.js.map
|