@burdenoff/microfe-buildmyiq 2026.1102.1 → 2026.1102.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,98 +8,153 @@ import { StatusBadge as s } from "../../components/StatusBadge.js";
8
8
  import { EmptyState as c } from "../../components/EmptyState.js";
9
9
  import { ErrorView as l, LoadingView as u, Section as d } from "../../components/StateViews.js";
10
10
  import { MiniBar as ee } from "../../components/MiniBar.js";
11
- import { useBuiAssessments as te, useBuiCourse as ne, useBuiEnroll as f, useBuiModules as re, useBuiMyEnrollment as ie, useBuiMyEnrollments as ae } from "../../hooks/useBuildmyiqApi.js";
11
+ import { useBuiAssessments as te, useBuiCourse as ne, useBuiEnroll as re, useBuiModules as ie, useBuiMyEnrollment as ae, useBuiMyEnrollments as oe, useBuiMySavedCourses as f, useBuiToggleSavedCourse as p } from "../../hooks/useBuildmyiqApi.js";
12
12
  import "../../hooks/index.js";
13
- import { BuiDiscussion as oe } from "../../components/BuiDiscussion.js";
14
- import { BuiTags as se } from "../../components/BuiTags.js";
15
- import { BuiPermissionButton as ce } from "../../components/BuiPermissionButton.js";
13
+ import { BuiDiscussion as se } from "../../components/BuiDiscussion.js";
14
+ import { BuiTags as ce } from "../../components/BuiTags.js";
15
+ import { BuiPermissionButton as le } from "../../components/BuiPermissionButton.js";
16
16
  import "../../components/index.js";
17
- import { useBuildmyiqAnalytics as le } from "../../analytics/useBuildmyiqAnalytics.js";
17
+ import { useBuildmyiqAnalytics as m } from "../../analytics/useBuildmyiqAnalytics.js";
18
18
  import "../../analytics/index.js";
19
- import { useMemo as p, useState as m } from "react";
20
- import { ArrowLeft as ue, ArrowRight as de, BookOpen as fe, CheckCircle2 as h, ChevronDown as pe, Circle as g, CircleDashed as _, ClipboardCheck as v, ClipboardList as y, Clock as b, FileText as x, GraduationCap as me, Layers as S, ListChecks as C, MousePointerClick as w, PlayCircle as he, Radio as T, Sparkles as ge, Video as E } from "lucide-react";
21
- import { useParams as D } from "react-router";
22
- import { jsx as O, jsxs as k } from "react/jsx-runtime";
23
- import { Button as A, GlassCard as j } from "@burdenoff/fe-libs/ui";
19
+ import { useMemo as h, useState as g } from "react";
20
+ import { ArrowLeft as ue, ArrowRight as de, BookOpen as fe, Bookmark as _, BookmarkCheck as v, CheckCircle2 as y, ChevronDown as pe, Circle as b, CircleDashed as x, ClipboardCheck as S, ClipboardList as C, Clock as w, FileText as T, GraduationCap as me, Layers as E, ListChecks as D, MousePointerClick as O, PlayCircle as k, Radio as A, Sparkles as he, Video as j } from "lucide-react";
21
+ import { useParams as ge } from "react-router";
22
+ import { jsx as M, jsxs as N } from "react/jsx-runtime";
23
+ import { Button as P, GlassCard as F } from "@burdenoff/fe-libs/ui";
24
24
  //#region src/buildmyiq/pages/catalog/CourseDetailPage.tsx
25
- var M = "buildmyiq-course", _e = "__ungrouped__", N = {
26
- ARTICLE: x,
27
- VIDEO: E,
28
- QUIZ: C,
29
- ASSIGNMENT: y,
30
- INTERACTIVE: w,
31
- LIVE_SESSION: T
32
- }, P = ({ status: e, label: t }) => {
25
+ var I = "buildmyiq-course", _e = "__ungrouped__", L = {
26
+ ARTICLE: T,
27
+ VIDEO: j,
28
+ QUIZ: D,
29
+ ASSIGNMENT: C,
30
+ INTERACTIVE: O,
31
+ LIVE_SESSION: A
32
+ }, R = ({ status: e, label: t }) => {
33
33
  if (!e) return null;
34
- let r = e === "COMPLETED" ? h : e === "IN_PROGRESS" ? _ : g;
35
- return /* @__PURE__ */ k("span", {
34
+ let r = e === "COMPLETED" ? y : e === "IN_PROGRESS" ? x : b;
35
+ return /* @__PURE__ */ N("span", {
36
36
  className: n("shrink-0", e === "COMPLETED" ? "text-status-success-text" : e === "IN_PROGRESS" ? "text-[var(--color-accent-teal)]" : "text-text-tertiary"),
37
37
  title: t,
38
- children: [/* @__PURE__ */ O(r, {
38
+ children: [/* @__PURE__ */ M(r, {
39
39
  className: "h-4 w-4",
40
40
  "aria-hidden": !0
41
- }), /* @__PURE__ */ O("span", {
41
+ }), /* @__PURE__ */ M("span", {
42
42
  className: "sr-only",
43
43
  children: t
44
44
  })]
45
45
  });
46
- }, F = ({ lesson: e, index: t, progressStatus: n, progressLabel: r }) => /* @__PURE__ */ k("li", {
46
+ }, z = ({ lesson: e, index: t, progressStatus: n, progressLabel: r }) => /* @__PURE__ */ N("li", {
47
47
  className: "flex items-center gap-3 px-4 py-3 transition-colors hover:bg-bg-sunken/60",
48
48
  children: [
49
- /* @__PURE__ */ O("span", {
49
+ /* @__PURE__ */ M("span", {
50
50
  className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary",
51
- children: /* @__PURE__ */ O(N[e.type] ?? x, { className: "h-4 w-4" })
51
+ children: /* @__PURE__ */ M(L[e.type] ?? T, { className: "h-4 w-4" })
52
52
  }),
53
- /* @__PURE__ */ k("div", {
53
+ /* @__PURE__ */ N("div", {
54
54
  className: "min-w-0 flex-1",
55
- children: [/* @__PURE__ */ k("p", {
55
+ children: [/* @__PURE__ */ N("p", {
56
56
  className: "truncate text-sm font-medium text-text-primary",
57
- children: [/* @__PURE__ */ k("span", {
57
+ children: [/* @__PURE__ */ N("span", {
58
58
  className: "me-1.5 tabular-nums text-text-tertiary",
59
59
  children: [t + 1, "."]
60
60
  }), e.title]
61
- }), /* @__PURE__ */ O("p", {
61
+ }), /* @__PURE__ */ M("p", {
62
62
  className: "text-xs text-text-tertiary",
63
63
  children: a(e.type)
64
64
  })]
65
65
  }),
66
- e.durationMin > 0 && /* @__PURE__ */ k("span", {
66
+ e.durationMin > 0 && /* @__PURE__ */ N("span", {
67
67
  className: "hidden shrink-0 items-center gap-1 text-xs tabular-nums text-text-secondary sm:inline-flex",
68
68
  children: [
69
- /* @__PURE__ */ O(b, { className: "h-3.5 w-3.5" }),
69
+ /* @__PURE__ */ M(w, { className: "h-3.5 w-3.5" }),
70
70
  " ",
71
71
  i(e.durationMin)
72
72
  ]
73
73
  }),
74
- e.isPreview && /* @__PURE__ */ O("span", {
74
+ e.isPreview && /* @__PURE__ */ M("span", {
75
75
  className: "shrink-0 rounded-full border border-[var(--color-accent-teal)] px-2 py-0.5 text-xs font-medium text-[var(--color-accent-teal)]",
76
76
  children: "Preview"
77
77
  }),
78
- /* @__PURE__ */ O(P, {
78
+ /* @__PURE__ */ M(R, {
79
79
  status: n,
80
80
  label: r ?? ""
81
81
  })
82
82
  ]
83
- }), I = ({ icon: e, children: t }) => /* @__PURE__ */ k("span", {
83
+ }), B = ({ icon: e, children: t }) => /* @__PURE__ */ N("span", {
84
84
  className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam bg-bg-surface px-3 py-1.5 text-xs font-medium text-text-secondary",
85
- children: [/* @__PURE__ */ O(e, {
85
+ children: [/* @__PURE__ */ M(e, {
86
86
  className: "h-3.5 w-3.5 text-text-tertiary",
87
87
  "aria-hidden": !0
88
88
  }), t]
89
- }), L = () => {
90
- let { courseId: a } = D(), { currentUser: h, navigateTo: g } = e(), _ = t(), y = h?.id, x = ne(a), C = re(a), w = te(a), T = ae({
89
+ }), ve = ({ courseId: e, enabled: n }) => {
90
+ let r = t(), i = f({
91
+ courseId: e,
92
+ limit: 1,
93
+ enabled: n
94
+ }), a = p(), [o, s] = g(null);
95
+ if (!n || i.isLoading) return null;
96
+ if (i.isError) return /* @__PURE__ */ N("div", {
97
+ className: "ms-auto flex flex-col items-end gap-1",
98
+ children: [/* @__PURE__ */ N(P, {
99
+ size: "sm",
100
+ variant: "outline",
101
+ onClick: () => void i.refetch(),
102
+ disabled: i.isFetching,
103
+ "data-testid": "bui-save-course-retry",
104
+ children: [/* @__PURE__ */ M(_, {
105
+ className: "me-1.5 h-4 w-4",
106
+ "aria-hidden": !0
107
+ }), r("buildmyiq.course.save.retry", "Retry Save for later")]
108
+ }), /* @__PURE__ */ M("p", {
109
+ role: "alert",
110
+ className: "text-xs text-status-error-text",
111
+ children: r("buildmyiq.course.save.loadError", "Could not load your saved courses.")
112
+ })]
113
+ });
114
+ let c = (i.data?.items.length ?? 0) > 0, l = async () => {
115
+ s(null);
116
+ try {
117
+ await a.mutateAsync({
118
+ courseId: e,
119
+ save: !c
120
+ });
121
+ } catch (e) {
122
+ s(e instanceof Error ? e.message : r("buildmyiq.course.save.error", "Could not update your saved courses."));
123
+ }
124
+ }, u = c ? v : _;
125
+ return /* @__PURE__ */ N("div", {
126
+ className: "ms-auto flex flex-col items-end gap-1",
127
+ children: [/* @__PURE__ */ N(P, {
128
+ size: "sm",
129
+ variant: c ? "secondary" : "outline",
130
+ onClick: l,
131
+ disabled: a.isPending,
132
+ "aria-pressed": c,
133
+ "data-testid": "bui-save-course",
134
+ children: [/* @__PURE__ */ M(u, {
135
+ className: "me-1.5 h-4 w-4",
136
+ "aria-hidden": !0
137
+ }), c ? r("buildmyiq.course.save.saved", "Saved") : r("buildmyiq.course.save.saveForLater", "Save for later")]
138
+ }), o && /* @__PURE__ */ M("p", {
139
+ role: "alert",
140
+ className: "text-xs text-status-error-text",
141
+ children: o
142
+ })]
143
+ });
144
+ }, V = () => {
145
+ let { courseId: a } = ge(), { currentUser: f, navigateTo: p } = e(), _ = t(), v = f?.id, y = ne(a), b = ie(a), x = te(a), C = oe({
91
146
  courseId: a,
92
- enabled: !!(a && y)
93
- }), E = f(), { trackCourseEnrolled: N } = le(), [P, L] = m(null), [ve, R] = m(null), z = x.data ?? null, B = C.data ?? [], V = w.data ?? [], H = T.data?.items ?? [], U = p(() => H.find((e) => e.status !== "DROPPED" && e.status !== "EXPIRED"), [H]), W = ie(U?.id), G = p(() => {
147
+ enabled: !!(a && v)
148
+ }), T = re(), { trackCourseEnrolled: D } = m(), [O, A] = g(null), [j, L] = g(null), R = y.data ?? null, V = b.data ?? [], H = x.data ?? [], U = C.data?.items ?? [], W = h(() => U.find((e) => e.status !== "DROPPED" && e.status !== "EXPIRED"), [U]), G = ae(W?.id), K = h(() => {
94
149
  let e = /* @__PURE__ */ new Map();
95
- for (let t of W.data?.lessonProgress ?? []) e.set(t.lessonId, t.status);
150
+ for (let t of G.data?.lessonProgress ?? []) e.set(t.lessonId, t.status);
96
151
  return e;
97
- }, [W.data]), K = !!U && W.data != null, q = {
152
+ }, [G.data]), q = !!W && G.data != null, ye = {
98
153
  COMPLETED: _("buildmyiq.course.lessonProgress.completed", "Completed"),
99
154
  IN_PROGRESS: _("buildmyiq.course.lessonProgress.inProgress", "In progress"),
100
155
  NOT_STARTED: _("buildmyiq.course.lessonProgress.notStarted", "Not started")
101
- }, ye = (e) => K ? G.get(e) ?? "NOT_STARTED" : void 0, J = p(() => (z?.lessons ?? []).filter((e) => !e.moduleId), [z]), Y = p(() => {
102
- let e = B.map((e) => ({
156
+ }, be = (e) => q ? K.get(e) ?? "NOT_STARTED" : void 0, J = h(() => (R?.lessons ?? []).filter((e) => !e.moduleId), [R]), Y = h(() => {
157
+ let e = V.map((e) => ({
103
158
  id: e.id,
104
159
  title: e.title,
105
160
  description: e.description,
@@ -111,263 +166,270 @@ var M = "buildmyiq-course", _e = "__ungrouped__", N = {
111
166
  lessons: J
112
167
  }), e;
113
168
  }, [
114
- B,
169
+ V,
115
170
  J,
116
171
  _
117
- ]), X = z?.lessons?.length ?? 0, be = V.filter((e) => e.status === "PUBLISHED").length, Z = p(() => {
118
- if (K) {
119
- for (let e of Y) for (let t of e.lessons) if (G.get(t.id) !== "COMPLETED") return t.id;
172
+ ]), X = R?.lessons?.length ?? 0, xe = H.filter((e) => e.status === "PUBLISHED").length, Z = h(() => {
173
+ if (q) {
174
+ for (let e of Y) for (let t of e.lessons) if (K.get(t.id) !== "COMPLETED") return t.id;
120
175
  }
121
176
  }, [
122
- K,
177
+ q,
123
178
  Y,
124
- G
125
- ]), xe = (e) => Z ? `learning/${e}?lesson=${encodeURIComponent(Z)}` : `learning/${e}`, Q = ve ?? new Set(Y.slice(0, 1).map((e) => e.id)), $ = Y.length > 0 && Y.every((e) => Q.has(e.id)), Se = (e) => {
179
+ K
180
+ ]), Se = (e) => Z ? `learning/${e}?lesson=${encodeURIComponent(Z)}` : `learning/${e}`, Q = j ?? new Set(Y.slice(0, 1).map((e) => e.id)), $ = Y.length > 0 && Y.every((e) => Q.has(e.id)), Ce = (e) => {
126
181
  let t = new Set(Q);
127
- t.has(e) ? t.delete(e) : t.add(e), R(t);
182
+ t.has(e) ? t.delete(e) : t.add(e), L(t);
128
183
  };
129
- return a ? x.isLoading ? /* @__PURE__ */ O(r, {
184
+ return a ? y.isLoading ? /* @__PURE__ */ M(r, {
130
185
  title: _("buildmyiq.course.pageTitle", "Course"),
131
- children: /* @__PURE__ */ O(u, { label: _("buildmyiq.course.loading", "Loading course…") })
132
- }) : x.isError ? /* @__PURE__ */ O(r, {
186
+ children: /* @__PURE__ */ M(u, { label: _("buildmyiq.course.loading", "Loading course…") })
187
+ }) : y.isError ? /* @__PURE__ */ M(r, {
133
188
  title: _("buildmyiq.course.pageTitle", "Course"),
134
- children: /* @__PURE__ */ O(l, {
189
+ children: /* @__PURE__ */ M(l, {
135
190
  title: _("buildmyiq.course.errorTitle", "Couldn't load this course"),
136
- message: x.error instanceof Error ? x.error.message : void 0,
137
- onRetry: () => x.refetch()
191
+ message: y.error instanceof Error ? y.error.message : void 0,
192
+ onRetry: () => y.refetch()
138
193
  })
139
- }) : z ? /* @__PURE__ */ O(r, {
140
- title: z.title,
141
- children: /* @__PURE__ */ k("div", {
194
+ }) : R ? /* @__PURE__ */ M(r, {
195
+ title: R.title,
196
+ children: /* @__PURE__ */ N("div", {
142
197
  className: "mx-auto flex w-full max-w-6xl flex-col gap-6",
143
198
  children: [
144
- /* @__PURE__ */ k("div", {
199
+ /* @__PURE__ */ N("div", {
145
200
  className: "flex flex-wrap items-center justify-between gap-3",
146
- children: [/* @__PURE__ */ k("nav", {
201
+ children: [/* @__PURE__ */ N("nav", {
147
202
  className: "flex min-w-0 items-center gap-1.5 text-sm",
148
203
  "aria-label": "Breadcrumb",
149
204
  children: [
150
- /* @__PURE__ */ O("button", {
205
+ /* @__PURE__ */ M("button", {
151
206
  type: "button",
152
- onClick: () => g("catalog"),
207
+ onClick: () => p("catalog"),
153
208
  className: "shrink-0 font-medium text-[var(--color-accent-teal)] transition-colors hover:opacity-80",
154
209
  children: _("buildmyiq.course.breadcrumbCatalog", "Catalog")
155
210
  }),
156
- /* @__PURE__ */ O("span", {
211
+ /* @__PURE__ */ M("span", {
157
212
  className: "shrink-0 text-text-tertiary",
158
213
  children: "/"
159
214
  }),
160
- /* @__PURE__ */ O("span", {
215
+ /* @__PURE__ */ M("span", {
161
216
  className: "truncate text-text-secondary",
162
- children: z.title
217
+ children: R.title
163
218
  })
164
219
  ]
165
- }), /* @__PURE__ */ k("button", {
220
+ }), /* @__PURE__ */ N("button", {
166
221
  type: "button",
167
- onClick: () => g("catalog"),
222
+ onClick: () => p("catalog"),
168
223
  className: "inline-flex shrink-0 items-center gap-1.5 text-sm text-text-secondary transition-colors hover:text-text-primary",
169
224
  children: [
170
- /* @__PURE__ */ O(ue, { className: "h-4 w-4 rtl:-scale-x-100" }),
225
+ /* @__PURE__ */ M(ue, { className: "h-4 w-4 rtl:-scale-x-100" }),
171
226
  " ",
172
227
  _("buildmyiq.course.backToCatalog", "Back to catalog")
173
228
  ]
174
229
  })]
175
230
  }),
176
- /* @__PURE__ */ k("div", {
231
+ /* @__PURE__ */ N("div", {
177
232
  className: "grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,1fr)_20rem]",
178
- children: [/* @__PURE__ */ O(j, {
233
+ children: [/* @__PURE__ */ M(F, {
179
234
  treatment: "plain",
180
235
  className: "overflow-hidden",
181
- children: /* @__PURE__ */ k("div", {
236
+ children: /* @__PURE__ */ N("div", {
182
237
  className: "grid grid-cols-1 sm:grid-cols-[minmax(0,15rem)_minmax(0,1fr)]",
183
- children: [/* @__PURE__ */ O("div", {
238
+ children: [/* @__PURE__ */ M("div", {
184
239
  className: "relative h-44 w-full overflow-hidden bg-bg-sunken sm:h-full",
185
- children: z.cover?.downloadUrl ? /* @__PURE__ */ O("img", {
186
- src: z.cover.downloadUrl,
240
+ children: R.cover?.downloadUrl ? /* @__PURE__ */ M("img", {
241
+ src: R.cover.downloadUrl,
187
242
  alt: "",
188
243
  className: "h-full w-full object-cover"
189
- }) : /* @__PURE__ */ O("div", {
244
+ }) : /* @__PURE__ */ M("div", {
190
245
  className: "flex h-full min-h-[11rem] w-full items-center justify-center bg-[var(--color-accent-soft)]",
191
- children: /* @__PURE__ */ O(fe, { className: "h-10 w-10 text-text-secondary opacity-60" })
246
+ children: /* @__PURE__ */ M(fe, { className: "h-10 w-10 text-text-secondary opacity-60" })
192
247
  })
193
- }), /* @__PURE__ */ k("div", {
248
+ }), /* @__PURE__ */ N("div", {
194
249
  className: "flex flex-col gap-4 p-6",
195
250
  children: [
196
- /* @__PURE__ */ k("div", {
251
+ /* @__PURE__ */ N("div", {
197
252
  className: "flex flex-wrap items-center gap-2",
198
- children: [/* @__PURE__ */ O(s, { status: z.level }), /* @__PURE__ */ O(s, { status: z.status })]
253
+ children: [
254
+ /* @__PURE__ */ M(s, { status: R.level }),
255
+ /* @__PURE__ */ M(s, { status: R.status }),
256
+ /* @__PURE__ */ M(ve, {
257
+ courseId: R.id,
258
+ enabled: !!v && R.status === "PUBLISHED"
259
+ })
260
+ ]
199
261
  }),
200
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("h1", {
262
+ /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("h1", {
201
263
  className: "text-2xl font-semibold tracking-tight text-text-primary",
202
- children: z.title
203
- }), z.summary && /* @__PURE__ */ O("p", {
264
+ children: R.title
265
+ }), R.summary && /* @__PURE__ */ M("p", {
204
266
  className: "mt-2 text-sm text-text-secondary",
205
- children: z.summary
267
+ children: R.summary
206
268
  })] }),
207
- /* @__PURE__ */ k("div", {
269
+ /* @__PURE__ */ N("div", {
208
270
  className: "flex flex-wrap gap-2",
209
271
  children: [
210
- z.skill?.name && /* @__PURE__ */ O(I, {
211
- icon: ge,
212
- children: z.skill.name
272
+ R.skill?.name && /* @__PURE__ */ M(B, {
273
+ icon: he,
274
+ children: R.skill.name
213
275
  }),
214
- /* @__PURE__ */ O(I, {
215
- icon: S,
276
+ /* @__PURE__ */ M(B, {
277
+ icon: E,
216
278
  children: _("buildmyiq.course.meta.modulesLessons", "{{modules}} module{{modulesSuffix}} · {{lessons}} lesson{{lessonsSuffix}}", {
217
- modules: B.length,
218
- modulesSuffix: B.length === 1 ? "" : "s",
279
+ modules: V.length,
280
+ modulesSuffix: V.length === 1 ? "" : "s",
219
281
  lessons: X,
220
282
  lessonsSuffix: X === 1 ? "" : "s"
221
283
  })
222
284
  }),
223
- z.estimatedHours > 0 && /* @__PURE__ */ O(I, {
224
- icon: b,
225
- children: o(z.estimatedHours)
285
+ R.estimatedHours > 0 && /* @__PURE__ */ M(B, {
286
+ icon: w,
287
+ children: o(R.estimatedHours)
226
288
  })
227
289
  ]
228
290
  }),
229
- z.tags.length > 0 && /* @__PURE__ */ O("div", {
291
+ R.tags.length > 0 && /* @__PURE__ */ M("div", {
230
292
  className: "flex flex-wrap gap-1.5",
231
- children: z.tags.map((e) => /* @__PURE__ */ O("span", {
293
+ children: R.tags.map((e) => /* @__PURE__ */ M("span", {
232
294
  className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs text-text-secondary",
233
295
  children: e
234
296
  }, e))
235
297
  }),
236
- z.description && /* @__PURE__ */ O("p", {
298
+ R.description && /* @__PURE__ */ M("p", {
237
299
  className: "whitespace-pre-wrap text-sm leading-relaxed text-text-secondary",
238
- children: z.description
300
+ children: R.description
239
301
  })
240
302
  ]
241
303
  })]
242
304
  })
243
- }), /* @__PURE__ */ O(j, {
305
+ }), /* @__PURE__ */ M(F, {
244
306
  treatment: "glass",
245
307
  glow: !0,
246
308
  className: "h-fit p-5 lg:sticky lg:top-4",
247
- children: U ? /* @__PURE__ */ k("div", {
309
+ children: W ? /* @__PURE__ */ N("div", {
248
310
  className: "flex flex-col gap-4",
249
311
  children: [
250
- /* @__PURE__ */ k(A, {
312
+ /* @__PURE__ */ N(P, {
251
313
  size: "lg",
252
314
  className: "w-full",
253
- onClick: () => g(xe(U.id)),
315
+ onClick: () => p(Se(W.id)),
254
316
  children: [
255
- /* @__PURE__ */ O(he, { className: "me-2 h-4 w-4" }),
317
+ /* @__PURE__ */ M(k, { className: "me-2 h-4 w-4" }),
256
318
  " ",
257
319
  _("buildmyiq.course.enrol.continueLearning", "Continue learning")
258
320
  ]
259
321
  }),
260
- /* @__PURE__ */ k("div", {
322
+ /* @__PURE__ */ N("div", {
261
323
  className: "flex flex-col gap-1.5",
262
- children: [/* @__PURE__ */ k("div", {
324
+ children: [/* @__PURE__ */ N("div", {
263
325
  className: "flex items-center justify-between text-sm",
264
- children: [/* @__PURE__ */ O("span", {
326
+ children: [/* @__PURE__ */ M("span", {
265
327
  className: "text-text-secondary",
266
328
  children: _("buildmyiq.course.enrol.yourProgress", "Your progress")
267
- }), /* @__PURE__ */ k("span", {
329
+ }), /* @__PURE__ */ N("span", {
268
330
  className: "font-semibold tabular-nums text-text-primary",
269
- children: [U.progressPct, "%"]
331
+ children: [W.progressPct, "%"]
270
332
  })]
271
- }), /* @__PURE__ */ O(ee, {
272
- value: U.progressPct,
333
+ }), /* @__PURE__ */ M(ee, {
334
+ value: W.progressPct,
273
335
  label: _("buildmyiq.course.enrol.yourProgress", "Your progress")
274
336
  })]
275
337
  }),
276
- /* @__PURE__ */ k("div", {
338
+ /* @__PURE__ */ N("div", {
277
339
  className: "flex items-center justify-between border-t border-border-seam pt-3 text-xs",
278
- children: [/* @__PURE__ */ O("span", {
340
+ children: [/* @__PURE__ */ M("span", {
279
341
  className: "text-text-secondary",
280
342
  children: _("buildmyiq.course.enrol.enrollment", "Enrollment")
281
- }), /* @__PURE__ */ O(s, { status: U.status })]
343
+ }), /* @__PURE__ */ M(s, { status: W.status })]
282
344
  })
283
345
  ]
284
- }) : /* @__PURE__ */ k("div", {
346
+ }) : /* @__PURE__ */ N("div", {
285
347
  className: "flex flex-col gap-4",
286
348
  children: [
287
- /* @__PURE__ */ O(ce, {
349
+ /* @__PURE__ */ M(le, {
288
350
  resource: "buildmyiq-enrollment",
289
351
  action: "create",
290
352
  deniedBehavior: "tooltip",
291
- children: /* @__PURE__ */ k(A, {
353
+ children: /* @__PURE__ */ N(P, {
292
354
  size: "lg",
293
355
  className: "w-full",
294
356
  onClick: async () => {
295
- if (!(!a || !y)) {
296
- L(null);
357
+ if (!(!a || !v)) {
358
+ A(null);
297
359
  try {
298
- let e = await E.mutateAsync({
360
+ let e = await T.mutateAsync({
299
361
  courseId: a,
300
- learnerId: y
362
+ learnerId: v
301
363
  });
302
- N({
364
+ D({
303
365
  courseId: a,
304
366
  enrollmentId: e.id
305
- }), g(`learning/${e.id}`);
367
+ }), p(`learning/${e.id}`);
306
368
  } catch (e) {
307
- L(e instanceof Error ? e.message : _("buildmyiq.course.enrol.enrolError", "Could not enrol in this course."));
369
+ A(e instanceof Error ? e.message : _("buildmyiq.course.enrol.enrolError", "Could not enrol in this course."));
308
370
  }
309
371
  }
310
372
  },
311
- disabled: E.isPending || !y,
373
+ disabled: T.isPending || !v,
312
374
  children: [
313
- /* @__PURE__ */ O(me, { className: "me-2 h-4 w-4" }),
314
- E.isPending ? _("buildmyiq.course.enrol.enrolling", "Enrolling…") : _("buildmyiq.course.enrol.enrolButton", "Enrol in this course"),
315
- !E.isPending && /* @__PURE__ */ O(de, { className: "ms-2 h-4 w-4 rtl:-scale-x-100" })
375
+ /* @__PURE__ */ M(me, { className: "me-2 h-4 w-4" }),
376
+ T.isPending ? _("buildmyiq.course.enrol.enrolling", "Enrolling…") : _("buildmyiq.course.enrol.enrolButton", "Enrol in this course"),
377
+ !T.isPending && /* @__PURE__ */ M(de, { className: "ms-2 h-4 w-4 rtl:-scale-x-100" })
316
378
  ]
317
379
  })
318
380
  }),
319
- !y && /* @__PURE__ */ O("p", {
381
+ !v && /* @__PURE__ */ M("p", {
320
382
  className: "text-xs text-text-tertiary",
321
383
  children: _("buildmyiq.course.enrol.signInToEnrol", "Sign in to your workspace to enrol.")
322
384
  }),
323
- P && /* @__PURE__ */ O("p", {
385
+ O && /* @__PURE__ */ M("p", {
324
386
  role: "alert",
325
387
  className: "text-xs text-status-error-text",
326
- children: P
388
+ children: O
327
389
  }),
328
- /* @__PURE__ */ k("dl", {
390
+ /* @__PURE__ */ N("dl", {
329
391
  className: "flex flex-col gap-2.5 border-t border-border-seam pt-3 text-sm",
330
392
  children: [
331
- /* @__PURE__ */ k("div", {
393
+ /* @__PURE__ */ N("div", {
332
394
  className: "flex items-center justify-between",
333
- children: [/* @__PURE__ */ k("dt", {
395
+ children: [/* @__PURE__ */ N("dt", {
334
396
  className: "inline-flex items-center gap-1.5 text-text-secondary",
335
397
  children: [
336
- /* @__PURE__ */ O(S, { className: "h-3.5 w-3.5 text-text-tertiary" }),
398
+ /* @__PURE__ */ M(E, { className: "h-3.5 w-3.5 text-text-tertiary" }),
337
399
  " ",
338
400
  _("buildmyiq.course.enrol.lessonsMeta", "Lessons")
339
401
  ]
340
- }), /* @__PURE__ */ O("dd", {
402
+ }), /* @__PURE__ */ M("dd", {
341
403
  className: "font-medium tabular-nums text-text-primary",
342
404
  children: X
343
405
  })]
344
406
  }),
345
- z.estimatedHours > 0 && /* @__PURE__ */ k("div", {
407
+ R.estimatedHours > 0 && /* @__PURE__ */ N("div", {
346
408
  className: "flex items-center justify-between",
347
- children: [/* @__PURE__ */ k("dt", {
409
+ children: [/* @__PURE__ */ N("dt", {
348
410
  className: "inline-flex items-center gap-1.5 text-text-secondary",
349
411
  children: [
350
- /* @__PURE__ */ O(b, { className: "h-3.5 w-3.5 text-text-tertiary" }),
412
+ /* @__PURE__ */ M(w, { className: "h-3.5 w-3.5 text-text-tertiary" }),
351
413
  " ",
352
414
  _("buildmyiq.course.enrol.durationMeta", "Duration")
353
415
  ]
354
- }), /* @__PURE__ */ O("dd", {
416
+ }), /* @__PURE__ */ M("dd", {
355
417
  className: "font-medium text-text-primary",
356
- children: o(z.estimatedHours)
418
+ children: o(R.estimatedHours)
357
419
  })]
358
420
  }),
359
- /* @__PURE__ */ k("div", {
421
+ /* @__PURE__ */ N("div", {
360
422
  className: "flex items-center justify-between",
361
- children: [/* @__PURE__ */ k("dt", {
423
+ children: [/* @__PURE__ */ N("dt", {
362
424
  className: "inline-flex items-center gap-1.5 text-text-secondary",
363
425
  children: [
364
- /* @__PURE__ */ O(v, { className: "h-3.5 w-3.5 text-text-tertiary" }),
426
+ /* @__PURE__ */ M(S, { className: "h-3.5 w-3.5 text-text-tertiary" }),
365
427
  " ",
366
428
  _("buildmyiq.course.enrol.assessmentsMeta", "Assessments")
367
429
  ]
368
- }), /* @__PURE__ */ O("dd", {
430
+ }), /* @__PURE__ */ M("dd", {
369
431
  className: "font-medium tabular-nums text-text-primary",
370
- children: be
432
+ children: xe
371
433
  })]
372
434
  })
373
435
  ]
@@ -376,181 +438,181 @@ var M = "buildmyiq-course", _e = "__ungrouped__", N = {
376
438
  })
377
439
  })]
378
440
  }),
379
- /* @__PURE__ */ k("div", {
441
+ /* @__PURE__ */ N("div", {
380
442
  className: "grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,1.7fr)_minmax(0,1fr)]",
381
- children: [/* @__PURE__ */ O("div", { children: /* @__PURE__ */ O(d, {
443
+ children: [/* @__PURE__ */ M("div", { children: /* @__PURE__ */ M(d, {
382
444
  title: _("buildmyiq.course.curriculumTitle", "Curriculum"),
383
445
  description: _("buildmyiq.course.curriculumDescription", "Modules and lessons in this course."),
384
- action: Y.length > 1 ? /* @__PURE__ */ O("button", {
446
+ action: Y.length > 1 ? /* @__PURE__ */ M("button", {
385
447
  type: "button",
386
448
  onClick: () => {
387
- R($ ? /* @__PURE__ */ new Set() : new Set(Y.map((e) => e.id)));
449
+ L($ ? /* @__PURE__ */ new Set() : new Set(Y.map((e) => e.id)));
388
450
  },
389
451
  className: "text-sm font-medium text-[var(--color-accent-teal)] transition-colors hover:opacity-80",
390
452
  children: $ ? _("buildmyiq.course.collapseAll", "Collapse all") : _("buildmyiq.course.expandAll", "Expand all")
391
453
  }) : void 0,
392
- children: C.isLoading ? /* @__PURE__ */ O(u, { label: _("buildmyiq.course.loadingCurriculum", "Loading curriculum…") }) : C.isError ? /* @__PURE__ */ O(l, {
454
+ children: b.isLoading ? /* @__PURE__ */ M(u, { label: _("buildmyiq.course.loadingCurriculum", "Loading curriculum…") }) : b.isError ? /* @__PURE__ */ M(l, {
393
455
  title: _("buildmyiq.course.curriculumErrorTitle", "Couldn't load the curriculum"),
394
- message: C.error instanceof Error ? C.error.message : void 0,
395
- onRetry: () => C.refetch()
396
- }) : Y.length === 0 ? /* @__PURE__ */ O(c, {
456
+ message: b.error instanceof Error ? b.error.message : void 0,
457
+ onRetry: () => b.refetch()
458
+ }) : Y.length === 0 ? /* @__PURE__ */ M(c, {
397
459
  illustration: "empty-data",
398
460
  title: _("buildmyiq.course.noLessonsTitle", "No lessons yet"),
399
461
  description: _("buildmyiq.course.noLessonsDescription", "The instructor hasn't added any modules or lessons to this course.")
400
- }) : /* @__PURE__ */ k("div", {
462
+ }) : /* @__PURE__ */ N("div", {
401
463
  className: "flex flex-col gap-3",
402
- children: [U && W.isError && /* @__PURE__ */ O("p", {
464
+ children: [W && G.isError && /* @__PURE__ */ M("p", {
403
465
  className: "rounded-lg border border-status-warning-border bg-status-warning-bg-subtle px-3 py-2 text-xs text-status-warning-text",
404
466
  children: _("buildmyiq.course.progressUnavailable", "Your completion marks couldn't be loaded, so the lessons below show no progress.")
405
467
  }), Y.map((e, t) => {
406
468
  let r = Q.has(e.id), i = `curriculum-panel-${e.id}`;
407
- return /* @__PURE__ */ k("div", {
469
+ return /* @__PURE__ */ N("div", {
408
470
  className: n("overflow-hidden rounded-xl border bg-bg-surface transition-colors", r ? "border-[var(--color-accent-soft)]" : "border-border-seam"),
409
- children: [/* @__PURE__ */ k("button", {
471
+ children: [/* @__PURE__ */ N("button", {
410
472
  type: "button",
411
- onClick: () => Se(e.id),
473
+ onClick: () => Ce(e.id),
412
474
  "aria-expanded": r,
413
475
  "aria-controls": i,
414
476
  className: "flex w-full items-center gap-3 px-4 py-3 text-start transition-colors hover:bg-bg-sunken/50",
415
477
  children: [
416
- /* @__PURE__ */ O("span", {
478
+ /* @__PURE__ */ M("span", {
417
479
  className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg text-xs font-semibold text-action-primary-text",
418
480
  children: t + 1
419
481
  }),
420
- /* @__PURE__ */ k("div", {
482
+ /* @__PURE__ */ N("div", {
421
483
  className: "min-w-0 flex-1",
422
- children: [/* @__PURE__ */ O("h3", {
484
+ children: [/* @__PURE__ */ M("h3", {
423
485
  className: "truncate font-semibold text-text-primary",
424
486
  children: e.title
425
- }), e.description && r && /* @__PURE__ */ O("p", {
487
+ }), e.description && r && /* @__PURE__ */ M("p", {
426
488
  className: "mt-0.5 line-clamp-2 text-sm text-text-secondary",
427
489
  children: e.description
428
490
  })]
429
491
  }),
430
- /* @__PURE__ */ O("span", {
492
+ /* @__PURE__ */ M("span", {
431
493
  className: "shrink-0 text-xs text-text-tertiary",
432
- children: K ? _("buildmyiq.course.moduleProgress", "{{done}} of {{total}} complete", {
433
- done: e.lessons.filter((e) => G.get(e.id) === "COMPLETED").length,
494
+ children: q ? _("buildmyiq.course.moduleProgress", "{{done}} of {{total}} complete", {
495
+ done: e.lessons.filter((e) => K.get(e.id) === "COMPLETED").length,
434
496
  total: e.lessons.length
435
497
  }) : _(e.lessons.length === 1 ? "buildmyiq.course.lessonCount" : "buildmyiq.course.lessonCountPlural", e.lessons.length === 1 ? "{{n}} lesson" : "{{n}} lessons", { n: e.lessons.length })
436
498
  }),
437
- /* @__PURE__ */ O(pe, {
499
+ /* @__PURE__ */ M(pe, {
438
500
  className: n("h-4 w-4 shrink-0 text-text-tertiary transition-transform", r && "rotate-180"),
439
501
  "aria-hidden": !0
440
502
  })
441
503
  ]
442
- }), r && (e.lessons.length === 0 ? /* @__PURE__ */ O("p", {
504
+ }), r && (e.lessons.length === 0 ? /* @__PURE__ */ M("p", {
443
505
  className: "border-t border-border-seam px-4 py-3 text-sm text-text-tertiary",
444
506
  children: _("buildmyiq.course.noLessonsInModule", "No lessons in this module yet.")
445
- }) : /* @__PURE__ */ O("ul", {
507
+ }) : /* @__PURE__ */ M("ul", {
446
508
  id: i,
447
509
  className: "divide-y divide-border-seam border-t border-border-seam",
448
510
  children: e.lessons.map((e, t) => {
449
- let n = ye(e.id);
450
- return /* @__PURE__ */ O(F, {
511
+ let n = be(e.id);
512
+ return /* @__PURE__ */ M(z, {
451
513
  lesson: e,
452
514
  index: t,
453
515
  progressStatus: n,
454
- progressLabel: n ? q[n] : void 0
516
+ progressLabel: n ? ye[n] : void 0
455
517
  }, e.id);
456
518
  })
457
519
  }))]
458
520
  }, e.id);
459
521
  })]
460
522
  })
461
- }) }), /* @__PURE__ */ k("div", {
523
+ }) }), /* @__PURE__ */ N("div", {
462
524
  className: "flex flex-col gap-6",
463
- children: [/* @__PURE__ */ O("div", { children: /* @__PURE__ */ O(d, {
525
+ children: [/* @__PURE__ */ M("div", { children: /* @__PURE__ */ M(d, {
464
526
  title: _("buildmyiq.course.assessmentsTitle", "Assessments"),
465
527
  description: _("buildmyiq.course.assessmentsDescription", "Quizzes and exams for this course."),
466
- children: w.isLoading ? /* @__PURE__ */ O(u, { label: _("buildmyiq.course.loadingAssessments", "Loading assessments…") }) : w.isError ? /* @__PURE__ */ O(l, {
528
+ children: x.isLoading ? /* @__PURE__ */ M(u, { label: _("buildmyiq.course.loadingAssessments", "Loading assessments…") }) : x.isError ? /* @__PURE__ */ M(l, {
467
529
  title: _("buildmyiq.course.assessmentsErrorTitle", "Couldn't load assessments"),
468
- message: w.error instanceof Error ? w.error.message : void 0,
469
- onRetry: () => w.refetch()
470
- }) : V.length === 0 ? /* @__PURE__ */ O(c, {
530
+ message: x.error instanceof Error ? x.error.message : void 0,
531
+ onRetry: () => x.refetch()
532
+ }) : H.length === 0 ? /* @__PURE__ */ M(c, {
471
533
  illustration: "empty-data",
472
- icon: /* @__PURE__ */ O(v, { className: "h-9 w-9" }),
534
+ icon: /* @__PURE__ */ M(S, { className: "h-9 w-9" }),
473
535
  title: _("buildmyiq.course.noAssessmentsTitle", "No assessments yet"),
474
536
  description: _("buildmyiq.course.noAssessmentsDescription", "This course doesn't have any quizzes or exams attached.")
475
- }) : /* @__PURE__ */ O("ul", {
537
+ }) : /* @__PURE__ */ M("ul", {
476
538
  className: "flex flex-col gap-3",
477
- children: V.map((e) => /* @__PURE__ */ k("li", {
539
+ children: H.map((e) => /* @__PURE__ */ N("li", {
478
540
  className: "rounded-xl border border-border-seam bg-bg-surface p-4",
479
- children: [/* @__PURE__ */ k("div", {
541
+ children: [/* @__PURE__ */ N("div", {
480
542
  className: "flex items-start gap-3",
481
- children: [/* @__PURE__ */ O("span", {
543
+ children: [/* @__PURE__ */ M("span", {
482
544
  className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary",
483
- children: /* @__PURE__ */ O(v, { className: "h-4 w-4" })
484
- }), /* @__PURE__ */ k("div", {
545
+ children: /* @__PURE__ */ M(S, { className: "h-4 w-4" })
546
+ }), /* @__PURE__ */ N("div", {
485
547
  className: "min-w-0 flex-1",
486
548
  children: [
487
- /* @__PURE__ */ O("p", {
549
+ /* @__PURE__ */ M("p", {
488
550
  className: "font-medium text-text-primary",
489
551
  children: e.title
490
552
  }),
491
- /* @__PURE__ */ k("div", {
553
+ /* @__PURE__ */ N("div", {
492
554
  className: "mt-1.5 flex flex-wrap items-center gap-1.5",
493
- children: [/* @__PURE__ */ O(s, { status: e.type }), /* @__PURE__ */ O(s, { status: e.status })]
555
+ children: [/* @__PURE__ */ M(s, { status: e.type }), /* @__PURE__ */ M(s, { status: e.status })]
494
556
  }),
495
- /* @__PURE__ */ k("div", {
557
+ /* @__PURE__ */ N("div", {
496
558
  className: "mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-text-secondary",
497
559
  children: [
498
- /* @__PURE__ */ O("span", { children: _("buildmyiq.course.meta.passAtLeast", "Pass ≥ {{score}}%", { score: e.passingScore }) }),
499
- /* @__PURE__ */ O("span", { children: _("buildmyiq.course.meta.attemptCount", "{{count}} attempt{{suffix}}", {
560
+ /* @__PURE__ */ M("span", { children: _("buildmyiq.course.meta.passAtLeast", "Pass ≥ {{score}}%", { score: e.passingScore }) }),
561
+ /* @__PURE__ */ M("span", { children: _("buildmyiq.course.meta.attemptCount", "{{count}} attempt{{suffix}}", {
500
562
  count: e.maxAttempts,
501
563
  suffix: e.maxAttempts === 1 ? "" : "s"
502
564
  }) }),
503
- e.timeLimitMin > 0 && /* @__PURE__ */ k("span", {
565
+ e.timeLimitMin > 0 && /* @__PURE__ */ N("span", {
504
566
  className: "inline-flex items-center gap-1",
505
- children: [/* @__PURE__ */ O(b, { className: "h-3.5 w-3.5" }), i(e.timeLimitMin)]
567
+ children: [/* @__PURE__ */ M(w, { className: "h-3.5 w-3.5" }), i(e.timeLimitMin)]
506
568
  })
507
569
  ]
508
570
  })
509
571
  ]
510
572
  })]
511
- }), e.status === "PUBLISHED" && U && /* @__PURE__ */ O("div", {
573
+ }), e.status === "PUBLISHED" && W && /* @__PURE__ */ M("div", {
512
574
  className: "mt-3 flex justify-end",
513
- children: /* @__PURE__ */ O(A, {
575
+ children: /* @__PURE__ */ M(P, {
514
576
  size: "sm",
515
- onClick: () => g(`assessments/${e.id}/take`),
577
+ onClick: () => p(`assessments/${e.id}/take`),
516
578
  children: _("buildmyiq.course.takeAssessment", "Take")
517
579
  })
518
580
  })]
519
581
  }, e.id))
520
582
  })
521
- }) }), /* @__PURE__ */ O("div", { children: /* @__PURE__ */ O(oe, {
522
- entityType: M,
583
+ }) }), /* @__PURE__ */ M("div", { children: /* @__PURE__ */ M(se, {
584
+ entityType: I,
523
585
  entityId: a,
524
586
  description: _("buildmyiq.course.discussionDescription", "Ask questions and discuss this course with your workspace.")
525
587
  }) })]
526
588
  })]
527
589
  }),
528
- /* @__PURE__ */ O("div", { children: /* @__PURE__ */ O(se, {
529
- entityType: M,
590
+ /* @__PURE__ */ M("div", { children: /* @__PURE__ */ M(ce, {
591
+ entityType: I,
530
592
  entityId: a
531
593
  }) })
532
594
  ]
533
595
  })
534
- }) : /* @__PURE__ */ O(r, {
596
+ }) : /* @__PURE__ */ M(r, {
535
597
  title: _("buildmyiq.course.pageTitle", "Course"),
536
- children: /* @__PURE__ */ O(c, {
598
+ children: /* @__PURE__ */ M(c, {
537
599
  illustration: "empty-search",
538
600
  title: _("buildmyiq.course.notFoundTitle", "Course not found"),
539
601
  description: _("buildmyiq.course.notFoundDescription", "This course may have been unpublished or removed."),
540
- action: /* @__PURE__ */ O(A, {
541
- onClick: () => g("catalog"),
602
+ action: /* @__PURE__ */ M(P, {
603
+ onClick: () => p("catalog"),
542
604
  children: _("buildmyiq.course.backToCatalog", "Back to catalog")
543
605
  })
544
606
  })
545
- }) : /* @__PURE__ */ O(r, {
607
+ }) : /* @__PURE__ */ M(r, {
546
608
  title: _("buildmyiq.course.pageTitle", "Course"),
547
- children: /* @__PURE__ */ O(l, {
609
+ children: /* @__PURE__ */ M(l, {
548
610
  title: _("buildmyiq.course.missingTitle", "Missing course"),
549
611
  message: _("buildmyiq.course.missingMessage", "No course was specified.")
550
612
  })
551
613
  });
552
614
  };
553
615
  //#endregion
554
- export { L as CourseDetailPage };
616
+ export { V as CourseDetailPage };
555
617
 
556
618
  //# sourceMappingURL=CourseDetailPage.js.map