@burdenoff/microfe-mybodyshield 2026.706.2 → 2026.713.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.
Files changed (152) hide show
  1. package/dist/dev/main.d.ts +2 -0
  2. package/dist/dev/main.d.ts.map +1 -0
  3. package/dist/generated/global-operations.d.ts +2 -0
  4. package/dist/generated/global-operations.d.ts.map +1 -0
  5. package/dist/generated/global-types.d.ts +18199 -0
  6. package/dist/generated/global-types.d.ts.map +1 -0
  7. package/dist/generated/wspace-operations.d.ts +2 -0
  8. package/dist/generated/wspace-operations.d.ts.map +1 -0
  9. package/dist/generated/wspace-types.d.ts +43046 -0
  10. package/dist/generated/wspace-types.d.ts.map +1 -0
  11. package/dist/index.d.ts +3 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +2 -1
  14. package/dist/mybodyshield/MyBodyShieldRoot.d.ts +5 -0
  15. package/dist/mybodyshield/MyBodyShieldRoot.d.ts.map +1 -0
  16. package/dist/mybodyshield/MyBodyShieldRoutes.d.ts +4 -0
  17. package/dist/mybodyshield/MyBodyShieldRoutes.d.ts.map +1 -0
  18. package/dist/mybodyshield/MyBodyShieldRoutes.js +77 -36
  19. package/dist/mybodyshield/MyBodyShieldRoutes.js.map +1 -1
  20. package/dist/mybodyshield/components/DataTable.d.ts +28 -0
  21. package/dist/mybodyshield/components/DataTable.d.ts.map +1 -0
  22. package/dist/mybodyshield/components/EmptyState.d.ts +18 -0
  23. package/dist/mybodyshield/components/EmptyState.d.ts.map +1 -0
  24. package/dist/mybodyshield/components/EvidenceUpload.d.ts +14 -0
  25. package/dist/mybodyshield/components/EvidenceUpload.d.ts.map +1 -0
  26. package/dist/mybodyshield/components/FeatureFlagGuard.d.ts +11 -0
  27. package/dist/mybodyshield/components/FeatureFlagGuard.d.ts.map +1 -0
  28. package/dist/mybodyshield/components/FeatureFlagGuard.js +27 -0
  29. package/dist/mybodyshield/components/FeatureFlagGuard.js.map +1 -0
  30. package/dist/mybodyshield/components/FileLink.d.ts +15 -0
  31. package/dist/mybodyshield/components/FileLink.d.ts.map +1 -0
  32. package/dist/mybodyshield/components/FilterTabs.d.ts +18 -0
  33. package/dist/mybodyshield/components/FilterTabs.d.ts.map +1 -0
  34. package/dist/mybodyshield/components/MetricsCard.d.ts +23 -0
  35. package/dist/mybodyshield/components/MetricsCard.d.ts.map +1 -0
  36. package/dist/mybodyshield/components/MiniBar.d.ts +16 -0
  37. package/dist/mybodyshield/components/MiniBar.d.ts.map +1 -0
  38. package/dist/mybodyshield/components/MybDiscussion.d.ts +18 -0
  39. package/dist/mybodyshield/components/MybDiscussion.d.ts.map +1 -0
  40. package/dist/mybodyshield/components/MybDiscussion.js +5 -5
  41. package/dist/mybodyshield/components/MybTags.d.ts +17 -0
  42. package/dist/mybodyshield/components/MybTags.d.ts.map +1 -0
  43. package/dist/mybodyshield/components/PageDisabled.d.ts +9 -0
  44. package/dist/mybodyshield/components/PageDisabled.d.ts.map +1 -0
  45. package/dist/mybodyshield/components/PageDisabled.js +17 -0
  46. package/dist/mybodyshield/components/PageDisabled.js.map +1 -0
  47. package/dist/mybodyshield/components/PageLayout.d.ts +16 -0
  48. package/dist/mybodyshield/components/PageLayout.d.ts.map +1 -0
  49. package/dist/mybodyshield/components/Pagination.d.ts +22 -0
  50. package/dist/mybodyshield/components/Pagination.d.ts.map +1 -0
  51. package/dist/mybodyshield/components/StateViews.d.ts +25 -0
  52. package/dist/mybodyshield/components/StateViews.d.ts.map +1 -0
  53. package/dist/mybodyshield/components/StateViews.js +2 -1
  54. package/dist/mybodyshield/components/StateViews.js.map +1 -1
  55. package/dist/mybodyshield/components/StatusBadge.d.ts +9 -0
  56. package/dist/mybodyshield/components/StatusBadge.d.ts.map +1 -0
  57. package/dist/mybodyshield/components/Tabs.d.ts +17 -0
  58. package/dist/mybodyshield/components/Tabs.d.ts.map +1 -0
  59. package/dist/mybodyshield/components/UserSearchSelect.d.ts +28 -0
  60. package/dist/mybodyshield/components/UserSearchSelect.d.ts.map +1 -0
  61. package/dist/mybodyshield/components/index.d.ts +22 -0
  62. package/dist/mybodyshield/components/index.d.ts.map +1 -0
  63. package/dist/mybodyshield/components/index.js +4 -2
  64. package/dist/mybodyshield/context/MyBodyShieldContext.d.ts +16 -0
  65. package/dist/mybodyshield/context/MyBodyShieldContext.d.ts.map +1 -0
  66. package/dist/mybodyshield/context/index.d.ts +6 -0
  67. package/dist/mybodyshield/context/index.d.ts.map +1 -0
  68. package/dist/mybodyshield/hooks/index.d.ts +12 -0
  69. package/dist/mybodyshield/hooks/index.d.ts.map +1 -0
  70. package/dist/mybodyshield/hooks/index.js +1 -0
  71. package/dist/mybodyshield/hooks/useMyBodyShieldAnalytics.d.ts +21 -0
  72. package/dist/mybodyshield/hooks/useMyBodyShieldAnalytics.d.ts.map +1 -0
  73. package/dist/mybodyshield/hooks/useMyBodyShieldAnalytics.js +35 -0
  74. package/dist/mybodyshield/hooks/useMyBodyShieldAnalytics.js.map +1 -0
  75. package/dist/mybodyshield/hooks/useMyBodyShieldApi.d.ts +83 -0
  76. package/dist/mybodyshield/hooks/useMyBodyShieldApi.d.ts.map +1 -0
  77. package/dist/mybodyshield/hooks/useMybComments.d.ts +36 -0
  78. package/dist/mybodyshield/hooks/useMybComments.d.ts.map +1 -0
  79. package/dist/mybodyshield/hooks/useMybFiles.d.ts +47 -0
  80. package/dist/mybodyshield/hooks/useMybFiles.d.ts.map +1 -0
  81. package/dist/mybodyshield/hooks/useMybTags.d.ts +44 -0
  82. package/dist/mybodyshield/hooks/useMybTags.d.ts.map +1 -0
  83. package/dist/mybodyshield/hooks/useMybUsers.d.ts +27 -0
  84. package/dist/mybodyshield/hooks/useMybUsers.d.ts.map +1 -0
  85. package/dist/mybodyshield/hooks/usePager.d.ts +29 -0
  86. package/dist/mybodyshield/hooks/usePager.d.ts.map +1 -0
  87. package/dist/mybodyshield/index.d.ts +9 -0
  88. package/dist/mybodyshield/index.d.ts.map +1 -0
  89. package/dist/mybodyshield/pages/DashboardPage.d.ts +10 -0
  90. package/dist/mybodyshield/pages/DashboardPage.d.ts.map +1 -0
  91. package/dist/mybodyshield/pages/DashboardPage.js +91 -86
  92. package/dist/mybodyshield/pages/DashboardPage.js.map +1 -1
  93. package/dist/mybodyshield/pages/_shared/visuals.d.ts +77 -0
  94. package/dist/mybodyshield/pages/_shared/visuals.d.ts.map +1 -0
  95. package/dist/mybodyshield/pages/coaching/CoachingPage.d.ts +11 -0
  96. package/dist/mybodyshield/pages/coaching/CoachingPage.d.ts.map +1 -0
  97. package/dist/mybodyshield/pages/coaching/CoachingPage.js +60 -60
  98. package/dist/mybodyshield/pages/goals/GoalsPage.d.ts +11 -0
  99. package/dist/mybodyshield/pages/goals/GoalsPage.d.ts.map +1 -0
  100. package/dist/mybodyshield/pages/goals/GoalsPage.js +125 -125
  101. package/dist/mybodyshield/pages/goals/GoalsPage.js.map +1 -1
  102. package/dist/mybodyshield/pages/nutrition/NutritionPage.d.ts +13 -0
  103. package/dist/mybodyshield/pages/nutrition/NutritionPage.d.ts.map +1 -0
  104. package/dist/mybodyshield/pages/nutrition/NutritionPage.js +129 -129
  105. package/dist/mybodyshield/pages/nutrition/NutritionPage.js.map +1 -1
  106. package/dist/mybodyshield/pages/programs/ProgramDetailPage.d.ts +10 -0
  107. package/dist/mybodyshield/pages/programs/ProgramDetailPage.d.ts.map +1 -0
  108. package/dist/mybodyshield/pages/programs/ProgramDetailPage.js +218 -191
  109. package/dist/mybodyshield/pages/programs/ProgramDetailPage.js.map +1 -1
  110. package/dist/mybodyshield/pages/programs/ProgramsPage.d.ts +11 -0
  111. package/dist/mybodyshield/pages/programs/ProgramsPage.d.ts.map +1 -0
  112. package/dist/mybodyshield/pages/programs/ProgramsPage.js +197 -193
  113. package/dist/mybodyshield/pages/programs/ProgramsPage.js.map +1 -1
  114. package/dist/mybodyshield/pages/progress/ProgressPage.d.ts +13 -0
  115. package/dist/mybodyshield/pages/progress/ProgressPage.d.ts.map +1 -0
  116. package/dist/mybodyshield/pages/progress/ProgressPage.js +143 -143
  117. package/dist/mybodyshield/pages/progress/ProgressPage.js.map +1 -1
  118. package/dist/mybodyshield/pages/recovery/RecoveryPage.d.ts +11 -0
  119. package/dist/mybodyshield/pages/recovery/RecoveryPage.d.ts.map +1 -0
  120. package/dist/mybodyshield/pages/recovery/RecoveryPage.js +60 -60
  121. package/dist/mybodyshield/pages/recovery/RecoveryPage.js.map +1 -1
  122. package/dist/mybodyshield/pages/train/SessionDetailPage.d.ts +11 -0
  123. package/dist/mybodyshield/pages/train/SessionDetailPage.d.ts.map +1 -0
  124. package/dist/mybodyshield/pages/train/SessionDetailPage.js +184 -181
  125. package/dist/mybodyshield/pages/train/SessionDetailPage.js.map +1 -1
  126. package/dist/mybodyshield/pages/train/SessionsPage.d.ts +11 -0
  127. package/dist/mybodyshield/pages/train/SessionsPage.d.ts.map +1 -0
  128. package/dist/mybodyshield/pages/train/SessionsPage.js +119 -115
  129. package/dist/mybodyshield/pages/train/SessionsPage.js.map +1 -1
  130. package/dist/mybodyshield/services/createSandboxAssistantTransport.d.ts +24 -0
  131. package/dist/mybodyshield/services/createSandboxAssistantTransport.d.ts.map +1 -0
  132. package/dist/mybodyshield/services/createSandboxAssistantTransport.js +14 -0
  133. package/dist/mybodyshield/services/createSandboxAssistantTransport.js.map +1 -0
  134. package/dist/mybodyshield/types/assistant.d.ts +55 -0
  135. package/dist/mybodyshield/types/assistant.d.ts.map +1 -0
  136. package/dist/mybodyshield/types/index.d.ts +419 -0
  137. package/dist/mybodyshield/types/index.d.ts.map +1 -0
  138. package/dist/mybodyshield/utils/cn.d.ts +4 -0
  139. package/dist/mybodyshield/utils/cn.d.ts.map +1 -0
  140. package/dist/mybodyshield/utils/formatters.d.ts +32 -0
  141. package/dist/mybodyshield/utils/formatters.d.ts.map +1 -0
  142. package/dist/mybodyshield/utils/i18n.d.ts +6 -0
  143. package/dist/mybodyshield/utils/i18n.d.ts.map +1 -0
  144. package/dist/mybodyshield/utils/index.d.ts +9 -0
  145. package/dist/mybodyshield/utils/index.d.ts.map +1 -0
  146. package/dist/mybodyshield/utils/navigation.d.ts +14 -0
  147. package/dist/mybodyshield/utils/navigation.d.ts.map +1 -0
  148. package/dist/mybodyshield/utils/pageContext.d.ts +28 -0
  149. package/dist/mybodyshield/utils/pageContext.d.ts.map +1 -0
  150. package/dist/mybodyshield/utils/pageContext.js +62 -0
  151. package/dist/mybodyshield/utils/pageContext.js.map +1 -0
  152. package/package.json +8 -2
@@ -1,22 +1,22 @@
1
- import { motion as e } from "../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
2
- import { useReducedMotion as t } from "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
3
- import { PageLayout as n } from "../../components/PageLayout.js";
4
- import { MetricsCard as r } from "../../components/MetricsCard.js";
5
- import { formatDate as i, formatEnumLabel as a, formatNumber as o, formatPercent as s, formatRelativeTime as c } from "../../utils/formatters.js";
6
- import { StatusBadge as l } from "../../components/StatusBadge.js";
7
- import { MiniBar as u } from "../../components/MiniBar.js";
8
- import { ErrorView as d, LoadingView as f } from "../../components/StateViews.js";
9
- import { EmptyState as p } from "../../components/EmptyState.js";
10
- import { GOAL_TYPE_META as m, IconChip as h, Meter as g, computeGoalProgress as _ } from "../_shared/visuals.js";
11
- import { useMybAchieveGoal as v, useMybCreateGoal as y, useMybGoals as b, useMybUpdateGoal as x } from "../../hooks/useMyBodyShieldApi.js";
12
- import { useOffsetPager as ee } from "../../hooks/usePager.js";
1
+ import { PageLayout as e } from "../../components/PageLayout.js";
2
+ import { MetricsCard as t } from "../../components/MetricsCard.js";
3
+ import { formatDate as n, formatEnumLabel as r, formatNumber as i, formatPercent as a, formatRelativeTime as o } from "../../utils/formatters.js";
4
+ import { StatusBadge as s } from "../../components/StatusBadge.js";
5
+ import { EmptyState as c } from "../../components/EmptyState.js";
6
+ import { ErrorView as l, LoadingView as u } from "../../components/StateViews.js";
7
+ import { FilterTabs as d } from "../../components/FilterTabs.js";
8
+ import { Pagination as f } from "../../components/Pagination.js";
9
+ import { MiniBar as p } from "../../components/MiniBar.js";
10
+ import { useMybAchieveGoal as m, useMybCreateGoal as h, useMybGoals as g, useMybUpdateGoal as _ } from "../../hooks/useMyBodyShieldApi.js";
11
+ import { useOffsetPager as v } from "../../hooks/usePager.js";
13
12
  import "../../hooks/index.js";
14
- import { FilterTabs as S } from "../../components/FilterTabs.js";
15
- import { Pagination as C } from "../../components/Pagination.js";
16
13
  import "../../components/index.js";
17
- import { useMemo as te, useState as w } from "react";
18
- import { CalendarClock as T, CheckCircle2 as E, Plus as D, Target as O, TrendingUp as k, Trophy as ne } from "lucide-react";
19
- import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
14
+ import { motion as y } from "../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
15
+ import { useReducedMotion as b } from "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
16
+ import { GOAL_TYPE_META as x, IconChip as S, Meter as C, computeGoalProgress as w } from "../_shared/visuals.js";
17
+ import { useMemo as ee, useState as T } from "react";
18
+ import { CalendarClock as E, CheckCircle2 as D, Plus as O, Target as k, TrendingUp as A, Trophy as te } from "lucide-react";
19
+ import { Fragment as ne, jsx as j, jsxs as M } from "react/jsx-runtime";
20
20
  import { Button as N, GlassCard as P, Input as F, Label as I, ResponsiveDialog as L, ResponsiveDialogContent as R, ResponsiveDialogDescription as z, ResponsiveDialogFooter as B, ResponsiveDialogHeader as V, ResponsiveDialogTitle as H, Select as U, SelectContent as W, SelectItem as G, SelectTrigger as K, SelectValue as q, Textarea as J } from "@burdenoff/fe-libs/ui";
21
21
  //#region src/mybodyshield/pages/goals/GoalsPage.tsx
22
22
  var Y = 12, X = 100, re = [
@@ -56,26 +56,26 @@ var Q = {
56
56
  description: ""
57
57
  };
58
58
  function ae({ open: e, onOpenChange: t }) {
59
- let n = y(), [r, i] = w(Q), [o, s] = w(null), c = (e) => {
60
- e || (i(Q), s(null)), t(e);
59
+ let n = h(), [i, a] = T(Q), [o, s] = T(null), c = (e) => {
60
+ e || (a(Q), s(null)), t(e);
61
61
  }, l = async () => {
62
- let e = r.title.trim();
62
+ let e = i.title.trim();
63
63
  if (!e) {
64
64
  s("Goal title is required.");
65
65
  return;
66
66
  }
67
67
  s(null);
68
- let a = {
68
+ let r = {
69
69
  title: e,
70
- type: r.type,
71
- description: r.description.trim() || void 0,
72
- baselineValue: Z(r.baselineValue),
73
- targetValue: Z(r.targetValue),
74
- unit: r.unit.trim() || void 0,
75
- targetDate: r.targetDate ? new Date(r.targetDate).toISOString() : void 0
70
+ type: i.type,
71
+ description: i.description.trim() || void 0,
72
+ baselineValue: Z(i.baselineValue),
73
+ targetValue: Z(i.targetValue),
74
+ unit: i.unit.trim() || void 0,
75
+ targetDate: i.targetDate ? new Date(i.targetDate).toISOString() : void 0
76
76
  };
77
77
  try {
78
- await n.mutateAsync(a), i(Q), t(!1);
78
+ await n.mutateAsync(r), a(Q), t(!1);
79
79
  } catch (e) {
80
80
  s(e instanceof Error ? e.message : "Failed to create goal.");
81
81
  }
@@ -100,8 +100,8 @@ function ae({ open: e, onOpenChange: t }) {
100
100
  children: "Title"
101
101
  }), /* @__PURE__ */ j(F, {
102
102
  id: "myb-goal-title",
103
- value: r.title,
104
- onChange: (e) => i((t) => ({
103
+ value: i.title,
104
+ onChange: (e) => a((t) => ({
105
105
  ...t,
106
106
  title: e.target.value
107
107
  })),
@@ -114,8 +114,8 @@ function ae({ open: e, onOpenChange: t }) {
114
114
  htmlFor: "myb-goal-type",
115
115
  children: "Type"
116
116
  }), /* @__PURE__ */ M(U, {
117
- value: r.type,
118
- onValueChange: (e) => i((t) => ({
117
+ value: i.type,
118
+ onValueChange: (e) => a((t) => ({
119
119
  ...t,
120
120
  type: e
121
121
  })),
@@ -124,7 +124,7 @@ function ae({ open: e, onOpenChange: t }) {
124
124
  children: /* @__PURE__ */ j(q, { placeholder: "Select a goal type" })
125
125
  }), /* @__PURE__ */ j(W, { children: ie.map((e) => /* @__PURE__ */ j(G, {
126
126
  value: e,
127
- children: a(e)
127
+ children: r(e)
128
128
  }, e)) })]
129
129
  })]
130
130
  }),
@@ -140,8 +140,8 @@ function ae({ open: e, onOpenChange: t }) {
140
140
  id: "myb-goal-baseline",
141
141
  type: "number",
142
142
  inputMode: "decimal",
143
- value: r.baselineValue,
144
- onChange: (e) => i((t) => ({
143
+ value: i.baselineValue,
144
+ onChange: (e) => a((t) => ({
145
145
  ...t,
146
146
  baselineValue: e.target.value
147
147
  })),
@@ -157,8 +157,8 @@ function ae({ open: e, onOpenChange: t }) {
157
157
  id: "myb-goal-target",
158
158
  type: "number",
159
159
  inputMode: "decimal",
160
- value: r.targetValue,
161
- onChange: (e) => i((t) => ({
160
+ value: i.targetValue,
161
+ onChange: (e) => a((t) => ({
162
162
  ...t,
163
163
  targetValue: e.target.value
164
164
  })),
@@ -172,8 +172,8 @@ function ae({ open: e, onOpenChange: t }) {
172
172
  children: "Unit"
173
173
  }), /* @__PURE__ */ j(F, {
174
174
  id: "myb-goal-unit",
175
- value: r.unit,
176
- onChange: (e) => i((t) => ({
175
+ value: i.unit,
176
+ onChange: (e) => a((t) => ({
177
177
  ...t,
178
178
  unit: e.target.value
179
179
  })),
@@ -190,8 +190,8 @@ function ae({ open: e, onOpenChange: t }) {
190
190
  }), /* @__PURE__ */ j(F, {
191
191
  id: "myb-goal-date",
192
192
  type: "date",
193
- value: r.targetDate,
194
- onChange: (e) => i((t) => ({
193
+ value: i.targetDate,
194
+ onChange: (e) => a((t) => ({
195
195
  ...t,
196
196
  targetDate: e.target.value
197
197
  }))
@@ -205,8 +205,8 @@ function ae({ open: e, onOpenChange: t }) {
205
205
  }), /* @__PURE__ */ j(J, {
206
206
  id: "myb-goal-desc",
207
207
  rows: 3,
208
- value: r.description,
209
- onChange: (e) => i((t) => ({
208
+ value: i.description,
209
+ onChange: (e) => a((t) => ({
210
210
  ...t,
211
211
  description: e.target.value
212
212
  })),
@@ -229,8 +229,8 @@ function ae({ open: e, onOpenChange: t }) {
229
229
  });
230
230
  }
231
231
  function oe({ goal: e, onOpenChange: t }) {
232
- let n = x(), [r, i] = w(""), [a, s] = w(null), [c, l] = w(null);
233
- e && e.id !== c && (l(e.id), i(String(e.currentValue)), s(null));
232
+ let n = _(), [r, a] = T(""), [o, s] = T(null), [c, l] = T(null);
233
+ e && e.id !== c && (l(e.id), a(String(e.currentValue)), s(null));
234
234
  let u = async () => {
235
235
  if (!e) return;
236
236
  let i = Z(r);
@@ -257,9 +257,9 @@ function oe({ goal: e, onOpenChange: t }) {
257
257
  e.preventDefault(), u();
258
258
  },
259
259
  children: [
260
- a && /* @__PURE__ */ j("p", {
260
+ o && /* @__PURE__ */ j("p", {
261
261
  className: "rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
262
- children: a
262
+ children: o
263
263
  }),
264
264
  /* @__PURE__ */ M("div", {
265
265
  className: "space-y-2",
@@ -274,14 +274,14 @@ function oe({ goal: e, onOpenChange: t }) {
274
274
  inputMode: "decimal",
275
275
  autoFocus: !0,
276
276
  value: r,
277
- onChange: (e) => i(e.target.value),
277
+ onChange: (e) => a(e.target.value),
278
278
  placeholder: "0"
279
279
  }),
280
280
  e && /* @__PURE__ */ M("p", {
281
281
  className: "text-xs text-text-tertiary",
282
282
  children: [
283
283
  "Target: ",
284
- o(e.targetValue),
284
+ i(e.targetValue),
285
285
  e.unit ? ` ${e.unit}` : ""
286
286
  ]
287
287
  })
@@ -307,11 +307,11 @@ var se = [
307
307
  1,
308
308
  .36,
309
309
  1
310
- ], $ = ({ index: n = 0, hover: r = !1, className: i, children: a }) => {
311
- let o = t();
312
- return /* @__PURE__ */ j(e.div, {
313
- className: i,
314
- initial: o ? !1 : {
310
+ ], $ = ({ index: e = 0, hover: t = !1, className: n, children: r }) => {
311
+ let i = b();
312
+ return /* @__PURE__ */ j(y.div, {
313
+ className: n,
314
+ initial: i ? !1 : {
315
315
  opacity: 0,
316
316
  y: 12
317
317
  },
@@ -319,31 +319,31 @@ var se = [
319
319
  opacity: 1,
320
320
  y: 0
321
321
  },
322
- transition: o ? { duration: 0 } : {
322
+ transition: i ? { duration: 0 } : {
323
323
  duration: .35,
324
- delay: Math.min(n * .05, .45),
324
+ delay: Math.min(e * .05, .45),
325
325
  ease: se
326
326
  },
327
- whileHover: o || !r ? void 0 : { y: -4 },
328
- children: a
327
+ whileHover: i || !t ? void 0 : { y: -4 },
328
+ children: r
329
329
  });
330
330
  };
331
- function ce({ goal: e, index: t, onUpdateProgress: n, onAchieve: r, isAchieving: u }) {
332
- let d = m[e.type], f = d.icon, p = _(e), v = e.unit ? ` ${e.unit}` : "", y = e.status === "ACHIEVED";
331
+ function ce({ goal: e, index: t, onUpdateProgress: c, onAchieve: l, isAchieving: u }) {
332
+ let d = x[e.type], f = d.icon, p = w(e), m = e.unit ? ` ${e.unit}` : "", h = e.status === "ACHIEVED";
333
333
  return /* @__PURE__ */ j($, {
334
334
  index: t,
335
335
  hover: !0,
336
336
  className: "h-full",
337
337
  children: /* @__PURE__ */ M(P, {
338
338
  treatment: "glass",
339
- glow: y,
339
+ glow: h,
340
340
  className: "flex h-full flex-col gap-3.5 p-5 transition-shadow hover:shadow-[var(--shadow-pop-hover)]",
341
341
  children: [
342
342
  /* @__PURE__ */ M("div", {
343
343
  className: "flex items-start justify-between gap-3",
344
344
  children: [/* @__PURE__ */ M("div", {
345
345
  className: "flex min-w-0 items-start gap-3",
346
- children: [/* @__PURE__ */ j(h, {
346
+ children: [/* @__PURE__ */ j(S, {
347
347
  icon: /* @__PURE__ */ j(f, { className: "h-4 w-4" }),
348
348
  tint: d.tint
349
349
  }), /* @__PURE__ */ M("div", {
@@ -353,10 +353,10 @@ function ce({ goal: e, index: t, onUpdateProgress: n, onAchieve: r, isAchieving:
353
353
  children: e.title
354
354
  }), /* @__PURE__ */ j("span", {
355
355
  className: "mt-1 inline-flex items-center rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary",
356
- children: a(e.type)
356
+ children: r(e.type)
357
357
  })]
358
358
  })]
359
- }), /* @__PURE__ */ j(l, { status: e.status })]
359
+ }), /* @__PURE__ */ j(s, { status: e.status })]
360
360
  }),
361
361
  e.description && /* @__PURE__ */ j("p", {
362
362
  className: "line-clamp-2 text-xs text-text-secondary",
@@ -370,44 +370,44 @@ function ce({ goal: e, index: t, onUpdateProgress: n, onAchieve: r, isAchieving:
370
370
  className: "tabular-nums text-sm text-text-secondary",
371
371
  children: [/* @__PURE__ */ M("span", {
372
372
  className: "font-semibold text-text-primary",
373
- children: [o(e.currentValue), v]
373
+ children: [i(e.currentValue), m]
374
374
  }), /* @__PURE__ */ M("span", {
375
375
  className: "text-text-tertiary",
376
376
  children: [
377
377
  " ",
378
378
  "/ ",
379
- o(e.targetValue),
380
- v
379
+ i(e.targetValue),
380
+ m
381
381
  ]
382
382
  })]
383
383
  }), /* @__PURE__ */ j("span", {
384
384
  className: "text-lg font-bold leading-none tabular-nums text-action-primary-bg",
385
- children: s(p)
385
+ children: a(p)
386
386
  })]
387
- }), /* @__PURE__ */ j(g, {
387
+ }), /* @__PURE__ */ j(C, {
388
388
  value: p,
389
389
  height: 10
390
390
  })]
391
391
  }),
392
- (e.targetDate || y && e.achievedAt) && /* @__PURE__ */ M("div", {
392
+ (e.targetDate || h && e.achievedAt) && /* @__PURE__ */ M("div", {
393
393
  className: "flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-text-tertiary",
394
394
  children: [e.targetDate && /* @__PURE__ */ M("span", {
395
395
  className: "inline-flex items-center gap-1",
396
396
  children: [
397
- /* @__PURE__ */ j(T, { className: "h-3.5 w-3.5" }),
397
+ /* @__PURE__ */ j(E, { className: "h-3.5 w-3.5" }),
398
398
  "Target ",
399
- i(e.targetDate),
399
+ n(e.targetDate),
400
400
  /* @__PURE__ */ M("span", {
401
401
  className: "text-text-secondary",
402
- children: ["· ", c(e.targetDate)]
402
+ children: ["· ", o(e.targetDate)]
403
403
  })
404
404
  ]
405
- }), y && e.achievedAt && /* @__PURE__ */ M("span", {
405
+ }), h && e.achievedAt && /* @__PURE__ */ M("span", {
406
406
  className: "inline-flex items-center gap-1 text-status-success-text",
407
407
  children: [
408
- /* @__PURE__ */ j(E, { className: "h-3.5 w-3.5" }),
408
+ /* @__PURE__ */ j(D, { className: "h-3.5 w-3.5" }),
409
409
  "Achieved ",
410
- i(e.achievedAt)
410
+ n(e.achievedAt)
411
411
  ]
412
412
  })]
413
413
  }),
@@ -416,11 +416,11 @@ function ce({ goal: e, index: t, onUpdateProgress: n, onAchieve: r, isAchieving:
416
416
  children: [/* @__PURE__ */ j(N, {
417
417
  variant: "outline",
418
418
  size: "sm",
419
- onClick: () => n(e),
419
+ onClick: () => c(e),
420
420
  children: "Update progress"
421
421
  }), e.status === "ACTIVE" && /* @__PURE__ */ j(N, {
422
422
  size: "sm",
423
- onClick: () => r(e),
423
+ onClick: () => l(e),
424
424
  disabled: u,
425
425
  children: u ? "Marking…" : "Mark achieved"
426
426
  })]
@@ -430,36 +430,36 @@ function ce({ goal: e, index: t, onUpdateProgress: n, onAchieve: r, isAchieving:
430
430
  });
431
431
  }
432
432
  function le() {
433
- let [e, t] = w("ALL"), [i, a] = w(!1), [c, l] = w(null), [m, h] = w(null), [g, y] = w(null), x = ee(Y), T = b({
434
- status: e === "ALL" ? void 0 : e,
433
+ let [n, r] = T("ALL"), [o, s] = T(!1), [h, _] = T(null), [y, b] = T(null), [x, S] = T(null), C = v(Y), E = g({
434
+ status: n === "ALL" ? void 0 : n,
435
435
  pagination: {
436
436
  limit: Y,
437
- offset: x.offset
437
+ offset: C.offset
438
438
  }
439
- }), E = b({
439
+ }), D = g({
440
440
  status: "ACTIVE",
441
441
  pagination: { limit: X }
442
- }), P = b({
442
+ }), P = g({
443
443
  status: "ACHIEVED",
444
444
  pagination: { limit: X }
445
- }), F = v(), I = T.data?.items ?? [], L = E.data?.items ?? [], R = P.data?.items ?? [], z = te(() => L.length === 0 ? 0 : L.reduce((e, t) => e + _(t), 0) / L.length, [L]), B = (e) => {
446
- t(e), x.reset();
445
+ }), F = m(), I = E.data?.items ?? [], L = D.data?.items ?? [], R = P.data?.items ?? [], z = ee(() => L.length === 0 ? 0 : L.reduce((e, t) => e + w(t), 0) / L.length, [L]), B = (e) => {
446
+ r(e), C.reset();
447
447
  }, V = async (e) => {
448
- h(e.id), y(null);
448
+ b(e.id), S(null);
449
449
  try {
450
450
  await F.mutateAsync(e.id);
451
451
  } catch (e) {
452
- y(e instanceof Error ? e.message : "Failed to mark goal as achieved.");
452
+ S(e instanceof Error ? e.message : "Failed to mark goal as achieved.");
453
453
  } finally {
454
- h(null);
454
+ b(null);
455
455
  }
456
- }, H = T.isLoading && !T.data;
457
- return /* @__PURE__ */ M(n, {
456
+ }, H = E.isLoading && !E.data;
457
+ return /* @__PURE__ */ M(e, {
458
458
  title: "Goals",
459
459
  description: "Targets across training, nutrition and body composition.",
460
460
  actions: /* @__PURE__ */ M(N, {
461
- onClick: () => a(!0),
462
- children: [/* @__PURE__ */ j(D, { className: "mr-2 h-4 w-4" }), "New goal"]
461
+ onClick: () => s(!0),
462
+ children: [/* @__PURE__ */ j(O, { className: "mr-2 h-4 w-4" }), "New goal"]
463
463
  }),
464
464
  children: [
465
465
  /* @__PURE__ */ M("div", {
@@ -468,20 +468,20 @@ function le() {
468
468
  /* @__PURE__ */ j($, {
469
469
  index: 0,
470
470
  className: "h-full",
471
- children: /* @__PURE__ */ j(r, {
471
+ children: /* @__PURE__ */ j(t, {
472
472
  className: "h-full",
473
- icon: /* @__PURE__ */ j(O, { className: "h-5 w-5" }),
474
- value: o(E.data ? L.length : void 0),
473
+ icon: /* @__PURE__ */ j(k, { className: "h-5 w-5" }),
474
+ value: i(D.data ? L.length : void 0),
475
475
  label: "Active goals"
476
476
  })
477
477
  }),
478
478
  /* @__PURE__ */ j($, {
479
479
  index: 1,
480
480
  className: "h-full",
481
- children: /* @__PURE__ */ j(r, {
481
+ children: /* @__PURE__ */ j(t, {
482
482
  className: "h-full",
483
- icon: /* @__PURE__ */ j(ne, { className: "h-5 w-5" }),
484
- value: o(P.data ? R.length : void 0),
483
+ icon: /* @__PURE__ */ j(te, { className: "h-5 w-5" }),
484
+ value: i(P.data ? R.length : void 0),
485
485
  label: "Achieved",
486
486
  accent: "success"
487
487
  })
@@ -489,12 +489,12 @@ function le() {
489
489
  /* @__PURE__ */ j($, {
490
490
  index: 2,
491
491
  className: "h-full",
492
- children: /* @__PURE__ */ j(r, {
492
+ children: /* @__PURE__ */ j(t, {
493
493
  className: "h-full",
494
- icon: /* @__PURE__ */ j(k, { className: "h-5 w-5" }),
495
- value: E.data ? s(z) : "—",
494
+ icon: /* @__PURE__ */ j(A, { className: "h-5 w-5" }),
495
+ value: D.data ? a(z) : "—",
496
496
  label: "Avg progress (active)",
497
- footer: /* @__PURE__ */ j(u, {
497
+ footer: /* @__PURE__ */ j(p, {
498
498
  value: z,
499
499
  height: 4,
500
500
  barClassName: "bg-action-primary-bg"
@@ -505,55 +505,55 @@ function le() {
505
505
  }),
506
506
  /* @__PURE__ */ j("div", {
507
507
  className: "mt-6",
508
- children: /* @__PURE__ */ j(S, {
508
+ children: /* @__PURE__ */ j(d, {
509
509
  options: re,
510
- value: e,
510
+ value: n,
511
511
  onChange: B
512
512
  })
513
513
  }),
514
- g && /* @__PURE__ */ j("p", {
514
+ x && /* @__PURE__ */ j("p", {
515
515
  className: "mt-4 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
516
- children: g
516
+ children: x
517
517
  }),
518
518
  /* @__PURE__ */ j("div", {
519
519
  className: "mt-4",
520
- children: H ? /* @__PURE__ */ j(f, { label: "Loading your goals…" }) : T.isError ? /* @__PURE__ */ j(d, {
520
+ children: H ? /* @__PURE__ */ j(u, { label: "Loading your goals…" }) : E.isError ? /* @__PURE__ */ j(l, {
521
521
  message: "We couldn't load your goals.",
522
- onRetry: () => void T.refetch()
523
- }) : I.length === 0 ? /* @__PURE__ */ j(p, {
522
+ onRetry: () => void E.refetch()
523
+ }) : I.length === 0 ? /* @__PURE__ */ j(c, {
524
524
  illustration: "empty-data",
525
- icon: /* @__PURE__ */ j(O, { className: "h-10 w-10" }),
526
- title: e === "ALL" ? "No goals yet" : "No goals match this filter",
527
- description: e === "ALL" ? "Set a goal to give your training and nutrition a clear target to work toward." : "Try a different status filter, or create a new goal.",
525
+ icon: /* @__PURE__ */ j(k, { className: "h-10 w-10" }),
526
+ title: n === "ALL" ? "No goals yet" : "No goals match this filter",
527
+ description: n === "ALL" ? "Set a goal to give your training and nutrition a clear target to work toward." : "Try a different status filter, or create a new goal.",
528
528
  action: /* @__PURE__ */ M(N, {
529
- onClick: () => a(!0),
530
- children: [/* @__PURE__ */ j(D, { className: "mr-2 h-4 w-4" }), "New goal"]
529
+ onClick: () => s(!0),
530
+ children: [/* @__PURE__ */ j(O, { className: "mr-2 h-4 w-4" }), "New goal"]
531
531
  })
532
- }) : /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j("div", {
532
+ }) : /* @__PURE__ */ M(ne, { children: [/* @__PURE__ */ j("div", {
533
533
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
534
534
  children: I.map((e, t) => /* @__PURE__ */ j(ce, {
535
535
  goal: e,
536
536
  index: t,
537
- onUpdateProgress: l,
537
+ onUpdateProgress: _,
538
538
  onAchieve: (e) => void V(e),
539
- isAchieving: m === e.id
539
+ isAchieving: y === e.id
540
540
  }, e.id))
541
- }), /* @__PURE__ */ j(C, {
542
- page: x.page,
541
+ }), /* @__PURE__ */ j(f, {
542
+ page: C.page,
543
543
  pageSize: Y,
544
544
  itemCount: I.length,
545
- hasMore: T.data?.pageInfo?.hasMore ?? !1,
546
- onPageChange: (e) => x.onPageChange(e)
545
+ hasMore: E.data?.pageInfo?.hasMore ?? !1,
546
+ onPageChange: (e) => C.onPageChange(e)
547
547
  })] })
548
548
  }),
549
549
  /* @__PURE__ */ j(ae, {
550
- open: i,
551
- onOpenChange: a
550
+ open: o,
551
+ onOpenChange: s
552
552
  }),
553
553
  /* @__PURE__ */ j(oe, {
554
- goal: c,
554
+ goal: h,
555
555
  onOpenChange: (e) => {
556
- e || l(null);
556
+ e || _(null);
557
557
  }
558
558
  })
559
559
  ]