@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,49 +1,50 @@
1
1
  import { useMyBodyShield as e } from "../../context/MyBodyShieldContext.js";
2
- import { motion as t } from "../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
3
- import { useReducedMotion as n } from "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
4
- import { PageLayout as r } from "../../components/PageLayout.js";
5
- import { MetricsCard as i } from "../../components/MetricsCard.js";
6
- import { formatEnumLabel as a, formatNumber as o, formatRelativeTime as s } from "../../utils/formatters.js";
7
- import { StatusBadge as c } from "../../components/StatusBadge.js";
8
- import { ErrorView as l, LoadingView as ee } from "../../components/StateViews.js";
9
- import { EmptyState as te } from "../../components/EmptyState.js";
10
- import { GOAL_TYPE_META as u, IconChip as d } from "../_shared/visuals.js";
2
+ import { PageLayout as t } from "../../components/PageLayout.js";
3
+ import { MetricsCard as n } from "../../components/MetricsCard.js";
4
+ import { formatEnumLabel as r, formatNumber as i, formatRelativeTime as a } from "../../utils/formatters.js";
5
+ import { StatusBadge as o } from "../../components/StatusBadge.js";
6
+ import { EmptyState as s } from "../../components/EmptyState.js";
7
+ import { ErrorView as c, LoadingView as l } from "../../components/StateViews.js";
8
+ import { FilterTabs as ee } from "../../components/FilterTabs.js";
9
+ import { Pagination as te } from "../../components/Pagination.js";
11
10
  import "../../context/index.js";
12
- import { useMybCreateProgram as f, useMybPrograms as p } from "../../hooks/useMyBodyShieldApi.js";
13
- import { useOffsetPager as m } from "../../hooks/usePager.js";
11
+ import { useMybCreateProgram as ne, useMybPrograms as u } from "../../hooks/useMyBodyShieldApi.js";
12
+ import { useOffsetPager as re } from "../../hooks/usePager.js";
13
+ import { useMyBodyShieldAnalytics as ie } from "../../hooks/useMyBodyShieldAnalytics.js";
14
14
  import "../../hooks/index.js";
15
- import { FilterTabs as h } from "../../components/FilterTabs.js";
16
- import { Pagination as ne } from "../../components/Pagination.js";
17
15
  import "../../components/index.js";
18
- import { useMemo as g, useState as _ } from "react";
19
- import { Clock as v, Dumbbell as y, FilePenLine as re, Layers as ie, Plus as b } from "lucide-react";
20
- import { jsx as x, jsxs as S } from "react/jsx-runtime";
21
- import { Button as C, GlassCard as w, Input as T, Label as E, ResponsiveDialog as D, ResponsiveDialogContent as O, ResponsiveDialogDescription as ae, ResponsiveDialogFooter as oe, ResponsiveDialogHeader as se, ResponsiveDialogTitle as k, Select as A, SelectContent as j, SelectItem as M, SelectTrigger as N, SelectValue as P, Textarea as ce } from "@burdenoff/fe-libs/ui";
16
+ import { motion as d } from "../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
17
+ import { useReducedMotion as f } from "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
18
+ import { GOAL_TYPE_META as p, IconChip as m } from "../_shared/visuals.js";
19
+ import { useMemo as h, useState as g } from "react";
20
+ import { Clock as _, Dumbbell as v, FilePenLine as ae, Layers as oe, Plus as y } from "lucide-react";
21
+ import { jsx as b, jsxs as x } from "react/jsx-runtime";
22
+ import { Button as S, GlassCard as C, Input as w, Label as T, ResponsiveDialog as E, ResponsiveDialogContent as se, ResponsiveDialogDescription as ce, ResponsiveDialogFooter as D, ResponsiveDialogHeader as O, ResponsiveDialogTitle as le, Select as k, SelectContent as A, SelectItem as j, SelectTrigger as M, SelectValue as N, Textarea as ue } from "@burdenoff/fe-libs/ui";
22
23
  //#region src/mybodyshield/pages/programs/ProgramsPage.tsx
23
- var F = 24, le = [
24
+ var P = 24, de = [
24
25
  "ALL",
25
26
  "DRAFT",
26
27
  "ACTIVE",
27
28
  "COMPLETED",
28
29
  "ARCHIVED"
29
- ], I = [
30
+ ], F = [
30
31
  "WEIGHT_LOSS",
31
32
  "MUSCLE_GAIN",
32
33
  "STRENGTH",
33
34
  "ENDURANCE",
34
35
  "MOBILITY",
35
36
  "GENERAL_FITNESS"
36
- ], ue = [
37
+ ], fe = [
37
38
  "BEGINNER",
38
39
  "INTERMEDIATE",
39
40
  "ADVANCED",
40
41
  "ELITE"
41
- ], L = [
42
+ ], pe = [
42
43
  "BUILD",
43
44
  "PEAK",
44
45
  "DELOAD",
45
46
  "MAINTENANCE"
46
- ], R = {
47
+ ], I = {
47
48
  name: "",
48
49
  description: "",
49
50
  goalType: "GENERAL_FITNESS",
@@ -52,21 +53,21 @@ var F = 24, le = [
52
53
  weeks: "",
53
54
  daysPerWeek: "",
54
55
  startDate: ""
55
- }, z = (e) => {
56
+ }, L = (e) => {
56
57
  let t = e.trim();
57
58
  if (t === "") return null;
58
59
  let n = Number(t);
59
60
  return Number.isFinite(n) ? n : null;
60
- }, B = [
61
+ }, R = [
61
62
  .22,
62
63
  1,
63
64
  .36,
64
65
  1
65
- ], V = ({ index: e = 0, hover: r = !1, className: i, children: a }) => {
66
- let o = n();
67
- return /* @__PURE__ */ x(t.div, {
68
- className: i,
69
- initial: o ? !1 : {
66
+ ], z = ({ index: e = 0, hover: t = !1, className: n, children: r }) => {
67
+ let i = f();
68
+ return /* @__PURE__ */ b(d.div, {
69
+ className: n,
70
+ initial: i ? !1 : {
70
71
  opacity: 0,
71
72
  y: 12
72
73
  },
@@ -74,99 +75,99 @@ var F = 24, le = [
74
75
  opacity: 1,
75
76
  y: 0
76
77
  },
77
- transition: o ? { duration: 0 } : {
78
+ transition: i ? { duration: 0 } : {
78
79
  duration: .35,
79
80
  delay: Math.min(e * .05, .45),
80
- ease: B
81
+ ease: R
81
82
  },
82
- whileHover: o || !r ? void 0 : { y: -4 },
83
- children: a
83
+ whileHover: i || !t ? void 0 : { y: -4 },
84
+ children: r
84
85
  });
85
86
  };
86
- function H({ id: e, value: t, onChange: n, options: r }) {
87
- return /* @__PURE__ */ S(A, {
87
+ function B({ id: e, value: t, onChange: n, options: i }) {
88
+ return /* @__PURE__ */ x(k, {
88
89
  value: t,
89
90
  onValueChange: (e) => n(e),
90
- children: [/* @__PURE__ */ x(N, {
91
+ children: [/* @__PURE__ */ b(M, {
91
92
  id: e,
92
- children: /* @__PURE__ */ x(P, {})
93
- }), /* @__PURE__ */ x(j, { children: r.map((e) => /* @__PURE__ */ x(M, {
93
+ children: /* @__PURE__ */ b(N, {})
94
+ }), /* @__PURE__ */ b(A, { children: i.map((e) => /* @__PURE__ */ b(j, {
94
95
  value: e,
95
- children: a(e)
96
+ children: r(e)
96
97
  }, e)) })]
97
98
  });
98
99
  }
99
- function de({ program: e, index: t, onOpen: n }) {
100
- let r = u[e.goalType], i = r.icon, l = [
100
+ function me({ program: e, index: t, onOpen: n }) {
101
+ let s = p[e.goalType], c = s.icon, l = [
101
102
  e.phase,
102
103
  e.level,
103
104
  e.goalType
104
- ].map((e) => a(e)).join(" · ");
105
- return /* @__PURE__ */ x(V, {
105
+ ].map((e) => r(e)).join(" · ");
106
+ return /* @__PURE__ */ b(z, {
106
107
  index: t,
107
108
  hover: !0,
108
109
  className: "h-full",
109
- children: /* @__PURE__ */ x("button", {
110
+ children: /* @__PURE__ */ b("button", {
110
111
  type: "button",
111
112
  onClick: () => n(e.id),
112
113
  className: "block h-full w-full text-left",
113
- children: /* @__PURE__ */ S(w, {
114
+ children: /* @__PURE__ */ x(C, {
114
115
  treatment: "glass",
115
116
  className: "flex h-full flex-col p-5 transition-shadow hover:shadow-[var(--shadow-pop-hover)]",
116
117
  children: [
117
- /* @__PURE__ */ S("div", {
118
+ /* @__PURE__ */ x("div", {
118
119
  className: "flex items-start justify-between gap-3",
119
- children: [/* @__PURE__ */ S("div", {
120
+ children: [/* @__PURE__ */ x("div", {
120
121
  className: "flex min-w-0 items-start gap-3",
121
- children: [/* @__PURE__ */ x(d, {
122
- icon: /* @__PURE__ */ x(i, { className: "h-4 w-4" }),
123
- tint: r.tint
124
- }), /* @__PURE__ */ S("div", {
122
+ children: [/* @__PURE__ */ b(m, {
123
+ icon: /* @__PURE__ */ b(c, { className: "h-4 w-4" }),
124
+ tint: s.tint
125
+ }), /* @__PURE__ */ x("div", {
125
126
  className: "min-w-0",
126
- children: [/* @__PURE__ */ x("p", {
127
+ children: [/* @__PURE__ */ b("p", {
127
128
  className: "truncate font-semibold text-text-primary",
128
129
  children: e.name
129
- }), /* @__PURE__ */ x("p", {
130
+ }), /* @__PURE__ */ b("p", {
130
131
  className: "mt-0.5 truncate text-xs text-text-tertiary",
131
132
  children: l
132
133
  })]
133
134
  })]
134
- }), /* @__PURE__ */ x(c, { status: e.status })]
135
+ }), /* @__PURE__ */ b(o, { status: e.status })]
135
136
  }),
136
- e.description && /* @__PURE__ */ x("p", {
137
+ e.description && /* @__PURE__ */ b("p", {
137
138
  className: "mt-3 line-clamp-2 text-sm text-text-secondary",
138
139
  children: e.description
139
140
  }),
140
- /* @__PURE__ */ S("div", {
141
+ /* @__PURE__ */ x("div", {
141
142
  className: "mt-3 inline-flex items-center gap-1.5 text-sm text-text-secondary",
142
- children: [/* @__PURE__ */ x(v, { className: "h-4 w-4 shrink-0 text-action-primary-bg" }), /* @__PURE__ */ S("span", {
143
+ children: [/* @__PURE__ */ b(_, { className: "h-4 w-4 shrink-0 text-action-primary-bg" }), /* @__PURE__ */ x("span", {
143
144
  className: "tabular-nums",
144
145
  children: [
145
- o(e.weeks),
146
+ i(e.weeks),
146
147
  " wk × ",
147
- o(e.daysPerWeek),
148
+ i(e.daysPerWeek),
148
149
  " days"
149
150
  ]
150
151
  })]
151
152
  }),
152
- e.tags.length > 0 && /* @__PURE__ */ x("div", {
153
+ e.tags.length > 0 && /* @__PURE__ */ b("div", {
153
154
  className: "mt-3 flex flex-wrap gap-1.5",
154
- children: e.tags.slice(0, 4).map((e) => /* @__PURE__ */ S("span", {
155
+ children: e.tags.slice(0, 4).map((e) => /* @__PURE__ */ x("span", {
155
156
  className: "inline-flex items-center rounded-full bg-[var(--color-accent-soft)] px-2 py-0.5 text-xs font-medium text-text-secondary",
156
157
  children: ["#", e]
157
158
  }, e))
158
159
  }),
159
- /* @__PURE__ */ S("div", {
160
+ /* @__PURE__ */ x("div", {
160
161
  className: "mt-auto pt-4 text-xs text-text-tertiary",
161
- children: ["Updated ", s(e.updatedAt)]
162
+ children: ["Updated ", a(e.updatedAt)]
162
163
  })
163
164
  ]
164
165
  })
165
166
  })
166
167
  });
167
168
  }
168
- function U() {
169
- let { navigateTo: t } = e(), n = m(F), [s, c] = _("ALL"), [u, d] = _("ALL"), [v, w] = _(!1), [B, U] = _(R), [W, G] = _(null), K = f(), q = p({ pagination: { limit: 100 } }), J = g(() => q.data?.items ?? [], [q.data]), Y = g(() => {
169
+ function V() {
170
+ let { navigateTo: a, workspaceId: o } = e(), d = re(P), f = ie(), [p, m] = g("ALL"), [_, C] = g("ALL"), [R, V] = g(!1), [H, U] = g(I), [W, G] = g(null), K = ne(), q = u({ pagination: { limit: 100 } }), J = h(() => q.data?.items ?? [], [q.data]), Y = h(() => {
170
171
  let e = (e) => J.filter((t) => t.status === e).length;
171
172
  return {
172
173
  ALL: J.length,
@@ -175,299 +176,302 @@ function U() {
175
176
  COMPLETED: e("COMPLETED"),
176
177
  ARCHIVED: e("ARCHIVED")
177
178
  };
178
- }, [J]), X = p({
179
- status: s === "ALL" ? void 0 : s,
179
+ }, [J]), X = u({
180
+ status: p === "ALL" ? void 0 : p,
180
181
  pagination: {
181
- limit: F,
182
- offset: n.offset
182
+ limit: P,
183
+ offset: d.offset
183
184
  }
184
- }), Z = X.data?.items ?? [], Q = u === "ALL" ? Z : Z.filter((e) => e.goalType === u), fe = (e) => {
185
- c(e), n.reset();
186
- }, pe = (e) => {
187
- d(e), n.reset();
185
+ }), Z = X.data?.items ?? [], Q = _ === "ALL" ? Z : Z.filter((e) => e.goalType === _), he = (e) => {
186
+ m(e), d.reset();
187
+ }, ge = (e) => {
188
+ C(e), d.reset();
188
189
  }, $ = () => {
189
- U(R), G(null), w(!0);
190
- }, me = async () => {
191
- if (!B.name.trim()) {
190
+ U(I), G(null), V(!0), f.emitIntent("program", "create", { workspaceId: o });
191
+ }, _e = async () => {
192
+ if (!H.name.trim()) {
192
193
  G("Program name is required.");
193
194
  return;
194
195
  }
195
196
  let e = {
196
- name: B.name.trim(),
197
- description: B.description.trim() || null,
198
- goalType: B.goalType,
199
- level: B.level,
200
- phase: B.phase,
201
- weeks: z(B.weeks),
202
- daysPerWeek: z(B.daysPerWeek),
203
- startDate: B.startDate ? new Date(B.startDate).toISOString() : null
197
+ name: H.name.trim(),
198
+ description: H.description.trim() || null,
199
+ goalType: H.goalType,
200
+ level: H.level,
201
+ phase: H.phase,
202
+ weeks: L(H.weeks),
203
+ daysPerWeek: L(H.daysPerWeek),
204
+ startDate: H.startDate ? new Date(H.startDate).toISOString() : null
204
205
  };
205
206
  try {
206
- let n = await K.mutateAsync(e);
207
- w(!1), t(`programs/${n.id}`);
207
+ let t = await K.mutateAsync(e);
208
+ f.emitFact("program", "created", {
209
+ workspaceId: o,
210
+ entityId: t.id
211
+ }), V(!1), a(`programs/${t.id}`);
208
212
  } catch (e) {
209
213
  G(e instanceof Error ? e.message : "Failed to create program.");
210
214
  }
211
- }, he = le.map((e) => ({
215
+ }, ve = de.map((e) => ({
212
216
  value: e,
213
- label: e === "ALL" ? "All" : a(e),
217
+ label: e === "ALL" ? "All" : r(e),
214
218
  count: Y[e]
215
219
  }));
216
- return /* @__PURE__ */ S(r, {
220
+ return /* @__PURE__ */ x(t, {
217
221
  title: "Programs",
218
222
  description: "Structured training blocks — build, peak, deload & maintain.",
219
- actions: /* @__PURE__ */ S(C, {
223
+ actions: /* @__PURE__ */ x(S, {
220
224
  onClick: $,
221
- children: [/* @__PURE__ */ x(b, { className: "mr-1 h-4 w-4" }), " New program"]
225
+ children: [/* @__PURE__ */ b(y, { className: "mr-1 h-4 w-4" }), " New program"]
222
226
  }),
223
227
  children: [
224
- /* @__PURE__ */ S("div", {
228
+ /* @__PURE__ */ x("div", {
225
229
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
226
230
  children: [
227
- /* @__PURE__ */ x(V, {
231
+ /* @__PURE__ */ b(z, {
228
232
  index: 0,
229
233
  className: "h-full",
230
- children: /* @__PURE__ */ x(i, {
234
+ children: /* @__PURE__ */ b(n, {
231
235
  className: "h-full",
232
- icon: /* @__PURE__ */ x(y, { className: "h-5 w-5" }),
233
- value: o(Y.ACTIVE),
236
+ icon: /* @__PURE__ */ b(v, { className: "h-5 w-5" }),
237
+ value: i(Y.ACTIVE),
234
238
  label: "Active programs",
235
239
  accent: "success"
236
240
  })
237
241
  }),
238
- /* @__PURE__ */ x(V, {
242
+ /* @__PURE__ */ b(z, {
239
243
  index: 1,
240
244
  className: "h-full",
241
- children: /* @__PURE__ */ x(i, {
245
+ children: /* @__PURE__ */ b(n, {
242
246
  className: "h-full",
243
- icon: /* @__PURE__ */ x(re, { className: "h-5 w-5" }),
244
- value: o(Y.DRAFT),
247
+ icon: /* @__PURE__ */ b(ae, { className: "h-5 w-5" }),
248
+ value: i(Y.DRAFT),
245
249
  label: "Draft programs"
246
250
  })
247
251
  }),
248
- /* @__PURE__ */ x(V, {
252
+ /* @__PURE__ */ b(z, {
249
253
  index: 2,
250
254
  className: "h-full",
251
- children: /* @__PURE__ */ x(i, {
255
+ children: /* @__PURE__ */ b(n, {
252
256
  className: "h-full",
253
- icon: /* @__PURE__ */ x(ie, { className: "h-5 w-5" }),
254
- value: o(Y.ALL),
257
+ icon: /* @__PURE__ */ b(oe, { className: "h-5 w-5" }),
258
+ value: i(Y.ALL),
255
259
  label: "Total programs"
256
260
  })
257
261
  })
258
262
  ]
259
263
  }),
260
- /* @__PURE__ */ S("div", {
264
+ /* @__PURE__ */ x("div", {
261
265
  className: "mt-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
262
- children: [/* @__PURE__ */ x(h, {
263
- options: he,
264
- value: s,
265
- onChange: fe
266
- }), /* @__PURE__ */ S("div", {
266
+ children: [/* @__PURE__ */ b(ee, {
267
+ options: ve,
268
+ value: p,
269
+ onChange: he
270
+ }), /* @__PURE__ */ x("div", {
267
271
  className: "flex items-center gap-2",
268
- children: [/* @__PURE__ */ x("span", {
272
+ children: [/* @__PURE__ */ b("span", {
269
273
  className: "text-sm text-text-tertiary",
270
274
  children: "Goal"
271
- }), /* @__PURE__ */ x("div", {
275
+ }), /* @__PURE__ */ b("div", {
272
276
  className: "w-48",
273
- children: /* @__PURE__ */ S(A, {
274
- value: u,
275
- onValueChange: (e) => pe(e),
276
- children: [/* @__PURE__ */ x(N, { children: /* @__PURE__ */ x(P, {}) }), /* @__PURE__ */ S(j, { children: [/* @__PURE__ */ x(M, {
277
+ children: /* @__PURE__ */ x(k, {
278
+ value: _,
279
+ onValueChange: (e) => ge(e),
280
+ children: [/* @__PURE__ */ b(M, { children: /* @__PURE__ */ b(N, {}) }), /* @__PURE__ */ x(A, { children: [/* @__PURE__ */ b(j, {
277
281
  value: "ALL",
278
282
  children: "All goals"
279
- }), I.map((e) => /* @__PURE__ */ x(M, {
283
+ }), F.map((e) => /* @__PURE__ */ b(j, {
280
284
  value: e,
281
- children: a(e)
285
+ children: r(e)
282
286
  }, e))] })]
283
287
  })
284
288
  })]
285
289
  })]
286
290
  }),
287
- /* @__PURE__ */ S("div", {
291
+ /* @__PURE__ */ x("div", {
288
292
  className: "mt-6",
289
- children: [X.isLoading ? /* @__PURE__ */ x(ee, { label: "Loading programs…" }) : X.isError ? /* @__PURE__ */ x(l, {
293
+ children: [X.isLoading ? /* @__PURE__ */ b(l, { label: "Loading programs…" }) : X.isError ? /* @__PURE__ */ b(c, {
290
294
  message: "We couldn't load your programs.",
291
295
  onRetry: () => void X.refetch()
292
- }) : Z.length === 0 ? /* @__PURE__ */ x(te, {
296
+ }) : Z.length === 0 ? /* @__PURE__ */ b(s, {
293
297
  illustration: "empty-data",
294
- icon: /* @__PURE__ */ x(y, { className: "h-10 w-10" }),
295
- title: s === "ALL" ? "No programs yet" : "No programs in this status",
298
+ icon: /* @__PURE__ */ b(v, { className: "h-10 w-10" }),
299
+ title: p === "ALL" ? "No programs yet" : "No programs in this status",
296
300
  description: "Create a structured training program to plan your workouts week by week.",
297
- action: /* @__PURE__ */ S(C, {
301
+ action: /* @__PURE__ */ x(S, {
298
302
  onClick: $,
299
- children: [/* @__PURE__ */ x(b, { className: "mr-1 h-4 w-4" }), " New program"]
303
+ children: [/* @__PURE__ */ b(y, { className: "mr-1 h-4 w-4" }), " New program"]
300
304
  })
301
- }) : Q.length === 0 ? /* @__PURE__ */ S("div", {
305
+ }) : Q.length === 0 ? /* @__PURE__ */ x("div", {
302
306
  className: "rounded-xl border border-dashed border-border-seam py-10 text-center text-sm text-text-secondary",
303
307
  children: [
304
308
  "No programs on this page match",
305
309
  " ",
306
- /* @__PURE__ */ x("span", {
310
+ /* @__PURE__ */ b("span", {
307
311
  className: "font-medium text-text-primary",
308
- children: a(u)
312
+ children: r(_)
309
313
  }),
310
314
  "."
311
315
  ]
312
- }) : /* @__PURE__ */ x("div", {
316
+ }) : /* @__PURE__ */ b("div", {
313
317
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
314
- children: Q.map((e, n) => /* @__PURE__ */ x(de, {
318
+ children: Q.map((e, t) => /* @__PURE__ */ b(me, {
315
319
  program: e,
316
- index: n,
317
- onOpen: (e) => t(`programs/${e}`)
320
+ index: t,
321
+ onOpen: (e) => a(`programs/${e}`)
318
322
  }, e.id))
319
- }), !X.isLoading && !X.isError && Z.length > 0 && /* @__PURE__ */ x(ne, {
320
- page: n.page,
321
- pageSize: F,
323
+ }), !X.isLoading && !X.isError && Z.length > 0 && /* @__PURE__ */ b(te, {
324
+ page: d.page,
325
+ pageSize: P,
322
326
  itemCount: Z.length,
323
327
  hasMore: X.data?.pageInfo?.hasMore ?? !1,
324
- onPageChange: (e) => n.onPageChange(e)
328
+ onPageChange: (e) => d.onPageChange(e)
325
329
  })]
326
330
  }),
327
- /* @__PURE__ */ x(D, {
328
- open: v,
329
- onOpenChange: w,
330
- children: /* @__PURE__ */ S(O, {
331
+ /* @__PURE__ */ b(E, {
332
+ open: R,
333
+ onOpenChange: V,
334
+ children: /* @__PURE__ */ x(se, {
331
335
  className: "sm:max-w-lg",
332
336
  children: [
333
- /* @__PURE__ */ S(se, { children: [/* @__PURE__ */ x(k, { children: "New program" }), /* @__PURE__ */ x(ae, { children: "Define a structured training block. You can add workouts & exercises after creating it." })] }),
334
- /* @__PURE__ */ S("div", {
337
+ /* @__PURE__ */ x(O, { children: [/* @__PURE__ */ b(le, { children: "New program" }), /* @__PURE__ */ b(ce, { children: "Define a structured training block. You can add workouts & exercises after creating it." })] }),
338
+ /* @__PURE__ */ x("div", {
335
339
  className: "space-y-4 py-2",
336
340
  children: [
337
- W && /* @__PURE__ */ x("p", {
341
+ W && /* @__PURE__ */ b("p", {
338
342
  className: "rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
339
343
  children: W
340
344
  }),
341
- /* @__PURE__ */ S("div", {
345
+ /* @__PURE__ */ x("div", {
342
346
  className: "space-y-1.5",
343
- children: [/* @__PURE__ */ x(E, {
347
+ children: [/* @__PURE__ */ b(T, {
344
348
  htmlFor: "myb-prog-name",
345
349
  children: "Name"
346
- }), /* @__PURE__ */ x(T, {
350
+ }), /* @__PURE__ */ b(w, {
347
351
  id: "myb-prog-name",
348
- value: B.name,
352
+ value: H.name,
349
353
  onChange: (e) => U({
350
- ...B,
354
+ ...H,
351
355
  name: e.target.value
352
356
  }),
353
357
  placeholder: "e.g. Hypertrophy Block A"
354
358
  })]
355
359
  }),
356
- /* @__PURE__ */ S("div", {
360
+ /* @__PURE__ */ x("div", {
357
361
  className: "space-y-1.5",
358
- children: [/* @__PURE__ */ x(E, {
362
+ children: [/* @__PURE__ */ b(T, {
359
363
  htmlFor: "myb-prog-desc",
360
364
  children: "Description"
361
- }), /* @__PURE__ */ x(ce, {
365
+ }), /* @__PURE__ */ b(ue, {
362
366
  id: "myb-prog-desc",
363
367
  rows: 3,
364
- value: B.description,
368
+ value: H.description,
365
369
  onChange: (e) => U({
366
- ...B,
370
+ ...H,
367
371
  description: e.target.value
368
372
  }),
369
373
  placeholder: "Focus, progression scheme, notes…"
370
374
  })]
371
375
  }),
372
- /* @__PURE__ */ S("div", {
376
+ /* @__PURE__ */ x("div", {
373
377
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
374
378
  children: [
375
- /* @__PURE__ */ S("div", {
379
+ /* @__PURE__ */ x("div", {
376
380
  className: "space-y-1.5",
377
- children: [/* @__PURE__ */ x(E, {
381
+ children: [/* @__PURE__ */ b(T, {
378
382
  htmlFor: "myb-prog-goal",
379
383
  children: "Goal type"
380
- }), /* @__PURE__ */ x(H, {
384
+ }), /* @__PURE__ */ b(B, {
381
385
  id: "myb-prog-goal",
382
- value: B.goalType,
386
+ value: H.goalType,
383
387
  onChange: (e) => U({
384
- ...B,
388
+ ...H,
385
389
  goalType: e
386
390
  }),
387
- options: I
391
+ options: F
388
392
  })]
389
393
  }),
390
- /* @__PURE__ */ S("div", {
394
+ /* @__PURE__ */ x("div", {
391
395
  className: "space-y-1.5",
392
- children: [/* @__PURE__ */ x(E, {
396
+ children: [/* @__PURE__ */ b(T, {
393
397
  htmlFor: "myb-prog-level",
394
398
  children: "Level"
395
- }), /* @__PURE__ */ x(H, {
399
+ }), /* @__PURE__ */ b(B, {
396
400
  id: "myb-prog-level",
397
- value: B.level,
401
+ value: H.level,
398
402
  onChange: (e) => U({
399
- ...B,
403
+ ...H,
400
404
  level: e
401
405
  }),
402
- options: ue
406
+ options: fe
403
407
  })]
404
408
  }),
405
- /* @__PURE__ */ S("div", {
409
+ /* @__PURE__ */ x("div", {
406
410
  className: "space-y-1.5",
407
- children: [/* @__PURE__ */ x(E, {
411
+ children: [/* @__PURE__ */ b(T, {
408
412
  htmlFor: "myb-prog-phase",
409
413
  children: "Phase"
410
- }), /* @__PURE__ */ x(H, {
414
+ }), /* @__PURE__ */ b(B, {
411
415
  id: "myb-prog-phase",
412
- value: B.phase,
416
+ value: H.phase,
413
417
  onChange: (e) => U({
414
- ...B,
418
+ ...H,
415
419
  phase: e
416
420
  }),
417
- options: L
421
+ options: pe
418
422
  })]
419
423
  })
420
424
  ]
421
425
  }),
422
- /* @__PURE__ */ S("div", {
426
+ /* @__PURE__ */ x("div", {
423
427
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
424
428
  children: [
425
- /* @__PURE__ */ S("div", {
429
+ /* @__PURE__ */ x("div", {
426
430
  className: "space-y-1.5",
427
- children: [/* @__PURE__ */ x(E, {
431
+ children: [/* @__PURE__ */ b(T, {
428
432
  htmlFor: "myb-prog-weeks",
429
433
  children: "Weeks"
430
- }), /* @__PURE__ */ x(T, {
434
+ }), /* @__PURE__ */ b(w, {
431
435
  id: "myb-prog-weeks",
432
436
  type: "number",
433
437
  min: 1,
434
- value: B.weeks,
438
+ value: H.weeks,
435
439
  onChange: (e) => U({
436
- ...B,
440
+ ...H,
437
441
  weeks: e.target.value
438
442
  }),
439
443
  placeholder: "8"
440
444
  })]
441
445
  }),
442
- /* @__PURE__ */ S("div", {
446
+ /* @__PURE__ */ x("div", {
443
447
  className: "space-y-1.5",
444
- children: [/* @__PURE__ */ x(E, {
448
+ children: [/* @__PURE__ */ b(T, {
445
449
  htmlFor: "myb-prog-days",
446
450
  children: "Days / week"
447
- }), /* @__PURE__ */ x(T, {
451
+ }), /* @__PURE__ */ b(w, {
448
452
  id: "myb-prog-days",
449
453
  type: "number",
450
454
  min: 1,
451
455
  max: 7,
452
- value: B.daysPerWeek,
456
+ value: H.daysPerWeek,
453
457
  onChange: (e) => U({
454
- ...B,
458
+ ...H,
455
459
  daysPerWeek: e.target.value
456
460
  }),
457
461
  placeholder: "4"
458
462
  })]
459
463
  }),
460
- /* @__PURE__ */ S("div", {
464
+ /* @__PURE__ */ x("div", {
461
465
  className: "space-y-1.5",
462
- children: [/* @__PURE__ */ x(E, {
466
+ children: [/* @__PURE__ */ b(T, {
463
467
  htmlFor: "myb-prog-start",
464
468
  children: "Start date"
465
- }), /* @__PURE__ */ x(T, {
469
+ }), /* @__PURE__ */ b(w, {
466
470
  id: "myb-prog-start",
467
471
  type: "date",
468
- value: B.startDate,
472
+ value: H.startDate,
469
473
  onChange: (e) => U({
470
- ...B,
474
+ ...H,
471
475
  startDate: e.target.value
472
476
  })
473
477
  })]
@@ -476,13 +480,13 @@ function U() {
476
480
  })
477
481
  ]
478
482
  }),
479
- /* @__PURE__ */ S(oe, { children: [/* @__PURE__ */ x(C, {
483
+ /* @__PURE__ */ x(D, { children: [/* @__PURE__ */ b(S, {
480
484
  variant: "outline",
481
- onClick: () => w(!1),
485
+ onClick: () => V(!1),
482
486
  disabled: K.isPending,
483
487
  children: "Cancel"
484
- }), /* @__PURE__ */ x(C, {
485
- onClick: () => void me(),
488
+ }), /* @__PURE__ */ b(S, {
489
+ onClick: () => void _e(),
486
490
  disabled: K.isPending,
487
491
  children: K.isPending ? "Creating…" : "Create program"
488
492
  })] })
@@ -493,6 +497,6 @@ function U() {
493
497
  });
494
498
  }
495
499
  //#endregion
496
- export { U as ProgramsPage };
500
+ export { V as ProgramsPage };
497
501
 
498
502
  //# sourceMappingURL=ProgramsPage.js.map