@burdenoff/microfe-buildmyiq 2026.1102.2 → 2026.1102.4

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.
@@ -10,17 +10,19 @@ import { ErrorView as c, LoadingView as l } from "../../components/StateViews.js
10
10
  import { MiniBar as ee } from "../../components/MiniBar.js";
11
11
  import { ProgressRing as te } from "../../components/Viz.js";
12
12
  import { useBuiCompleteMyEnrollment as ne, useBuiCourse as re, useBuiMyEnrollment as ie, useBuiRecordMyLessonProgress as ae } from "../../hooks/useBuildmyiqApi.js";
13
+ import { useBuiInteractivePlayer as oe, useBuiMyInteractiveAttempts as se, useBuiSubmitMyInteractiveAttempt as ce } from "../../hooks/useBuiInteractive.js";
13
14
  import "../../hooks/index.js";
14
- import { FileLink as oe } from "../../components/FileLink.js";
15
- import { TutorPanel as se } from "../../components/TutorPanel.js";
16
- import { OfflineLessonControl as ce } from "../../components/OfflineLessonControl.js";
15
+ import { FileLink as le } from "../../components/FileLink.js";
16
+ import { TutorPanel as ue } from "../../components/TutorPanel.js";
17
+ import { OfflineLessonControl as de } from "../../components/OfflineLessonControl.js";
17
18
  import "../../components/index.js";
18
- import { useBuildmyiqAnalytics as le } from "../../analytics/useBuildmyiqAnalytics.js";
19
+ import { useBuildmyiqAnalytics as fe } from "../../analytics/useBuildmyiqAnalytics.js";
19
20
  import "../../analytics/index.js";
20
- import { useEffect as ue, useMemo as u, useRef as de, useState as d } from "react";
21
- import { ArrowLeft as fe, BookOpen as pe, Check as me, CheckCircle2 as f, ChevronLeft as he, ChevronRight as ge, FileText as p, HelpCircle as m, ListChecks as _e, Loader2 as h, MousePointerClick as g, PenLine as _, PlayCircle as v, Radio as y, Trophy as ve } from "lucide-react";
22
- import { useParams as ye, useSearchParams as be } from "react-router";
23
- import { Fragment as xe, jsx as b, jsxs as x } from "react/jsx-runtime";
21
+ import { InteractiveActivity as pe } from "./InteractiveActivity.js";
22
+ import { useEffect as me, useMemo as u, useRef as he, useState as d } from "react";
23
+ import { ArrowLeft as ge, BookOpen as _e, Check as ve, CheckCircle2 as f, ChevronLeft as ye, ChevronRight as be, FileText as p, HelpCircle as m, ListChecks as xe, Loader2 as h, MousePointerClick as g, PenLine as _, PlayCircle as v, Radio as y, Trophy as Se } from "lucide-react";
24
+ import { useParams as Ce, useSearchParams as we } from "react-router";
25
+ import { Fragment as Te, jsx as b, jsxs as x } from "react/jsx-runtime";
24
26
  import { Button as S, GlassCard as C } from "@burdenoff/fe-libs/ui";
25
27
  //#region src/buildmyiq/pages/learning/LessonPlayerPage.tsx
26
28
  var w = {
@@ -31,7 +33,7 @@ var w = {
31
33
  INTERACTIVE: g,
32
34
  LIVE_SESSION: y
33
35
  }, T = (e) => [...e].sort((e, t) => e.position - t.position), E = () => {
34
- let { enrollmentId: m } = ye(), [g] = be(), _ = g.get("lesson"), { navigateTo: v } = e(), y = t(), E = ie(m), D = E.data ?? null, O = D?.courseId, k = re(O), A = k.data ?? null, j = ae(), M = ne(), { trackLessonStarted: N, trackLessonCompleted: Se, trackCourseCompleted: Ce } = le(), P = j.mutate, F = de(/* @__PURE__ */ new Set()), [I, L] = d(null), [R, z] = d(!1), [B, V] = d(null), H = u(() => {
36
+ let { enrollmentId: m } = Ce(), [g] = we(), _ = g.get("lesson"), { navigateTo: v } = e(), y = t(), E = ie(m), D = E.data ?? null, O = D?.courseId, k = re(O), A = k.data ?? null, j = ae(), M = ne(), { trackLessonStarted: N, trackLessonCompleted: P, trackCourseCompleted: Ee } = fe(), De = j.mutate, Oe = he(/* @__PURE__ */ new Set()), [F, I] = d(null), [L, R] = d(!1), [z, B] = d(null), V = u(() => {
35
37
  if (!A) return [];
36
38
  let e = /* @__PURE__ */ new Set(), t = T(A.modules ?? []), n = [];
37
39
  for (let r of t) {
@@ -48,78 +50,91 @@ var w = {
48
50
  title: y("common.lessons", "Lessons"),
49
51
  lessons: r
50
52
  }), n;
51
- }, [A, y]), U = u(() => H.flatMap((e) => e.lessons), [H]), we = u(() => new Map(U.map((e) => [e.id, e.title])), [U]), W = u(() => {
53
+ }, [A, y]), H = u(() => V.flatMap((e) => e.lessons), [V]), ke = u(() => new Map(H.map((e) => [e.id, e.title])), [H]), U = u(() => {
52
54
  let e = /* @__PURE__ */ new Map();
53
55
  for (let t of D?.lessonProgress ?? []) e.set(t.lessonId, t.status);
54
56
  return e;
55
- }, [D]), G = u(() => U.length === 0 ? null : I && U.some((e) => e.id === I) ? I : _ && U.some((e) => e.id === _) ? _ : U[0].id, [
56
- U,
57
- I,
57
+ }, [D]), W = u(() => H.length === 0 ? null : F && H.some((e) => e.id === F) ? F : _ && H.some((e) => e.id === _) ? _ : H[0].id, [
58
+ H,
59
+ F,
58
60
  _
59
61
  ]);
60
- ue(() => {
61
- if (!m || !G) return;
62
- let e = W.get(G);
63
- if (e === "COMPLETED" || e === "IN_PROGRESS" || F.current.has(G)) return;
64
- F.current.add(G);
65
- let t = U.find((e) => e.id === G)?.type;
66
- P({
62
+ me(() => {
63
+ if (!m || !W) return;
64
+ let e = U.get(W);
65
+ if (e === "COMPLETED" || e === "IN_PROGRESS" || Oe.current.has(W)) return;
66
+ Oe.current.add(W);
67
+ let t = H.find((e) => e.id === W)?.type;
68
+ De({
67
69
  enrollmentId: m,
68
- lessonId: G,
70
+ lessonId: W,
69
71
  status: "IN_PROGRESS"
70
72
  }, { onSuccess: () => N({
71
73
  courseId: O,
72
74
  enrollmentId: m,
73
- lessonId: G,
75
+ lessonId: W,
74
76
  lessonType: t
75
77
  }) });
76
78
  }, [
77
79
  m,
78
- G,
79
80
  W,
80
- P,
81
81
  U,
82
+ De,
83
+ H,
82
84
  O,
83
85
  N
84
86
  ]);
85
- let K = U.findIndex((e) => e.id === G), q = K >= 0 ? U[K] : null, J = (q ? W.get(q.id) : void 0) === "COMPLETED", Y = U.filter((e) => W.get(e.id) === "COMPLETED").length, Te = U.length > 0 && Y === U.length, Ee = D?.status === "COMPLETED", X = (e) => {
86
- L(e), z(!1), V(null);
87
- }, Z = (e) => {
88
- if (K < 0) return;
89
- let t = U[K + e];
90
- t && X(t.id);
91
- }, De = async () => {
92
- if (!m || !q) return;
93
- V(null);
87
+ let G = H.findIndex((e) => e.id === W), K = G >= 0 ? H[G] : null, q = (K ? U.get(K.id) : void 0) === "COMPLETED", J = K?.type === "INTERACTIVE", Y = oe(J ? K?.id : null), X = J ? Y.data ?? null : null, Ae = se(X ? m : null, X ? K?.id : null), je = Ae.data?.length ? Math.max(...Ae.data.map((e) => e.scaled)) : null, Me = ce(), Z = H.filter((e) => U.get(e.id) === "COMPLETED").length, Ne = H.length > 0 && Z === H.length, Pe = D?.status === "COMPLETED", Fe = (e) => {
88
+ I(e), R(!1), B(null);
89
+ }, Ie = (e) => {
90
+ if (G < 0) return;
91
+ let t = H[G + e];
92
+ t && Fe(t.id);
93
+ }, Le = async () => {
94
+ if (!m || !K) return;
95
+ B(null);
94
96
  try {
95
97
  await j.mutateAsync({
96
98
  enrollmentId: m,
97
- lessonId: q.id,
99
+ lessonId: K.id,
98
100
  status: "COMPLETED"
99
101
  });
100
102
  } catch (e) {
101
- V(e instanceof Error && e.message ? e.message : y("buildmyiq.lessonPlayer.markCompleteError", "Could not mark this lesson complete."));
103
+ B(e instanceof Error && e.message ? e.message : y("buildmyiq.lessonPlayer.markCompleteError", "Could not mark this lesson complete."));
102
104
  return;
103
105
  }
104
- Se({
106
+ P({
105
107
  courseId: O,
106
108
  enrollmentId: m,
107
- lessonId: q.id,
108
- lessonType: q.type
109
+ lessonId: K.id,
110
+ lessonType: K.type
111
+ });
112
+ let e = H[G + 1];
113
+ e && I(e.id);
114
+ }, Re = async (e) => {
115
+ if (!m || !K) throw Error(y("buildmyiq.interactive.noEnrollment", "Open this lesson from your enrollment."));
116
+ let t = await Me.mutateAsync({
117
+ enrollmentId: m,
118
+ lessonId: K.id,
119
+ responses: e
109
120
  });
110
- let e = U[K + 1];
111
- e && L(e.id);
112
- }, Oe = async () => {
121
+ return t.lessonCompleted && !q && P({
122
+ courseId: O,
123
+ enrollmentId: m,
124
+ lessonId: K.id,
125
+ lessonType: K.type
126
+ }), t;
127
+ }, ze = async () => {
113
128
  if (m) {
114
- V(null);
129
+ B(null);
115
130
  try {
116
131
  let e = await M.mutateAsync({ id: m });
117
- Ce({
132
+ Ee({
118
133
  courseId: e.courseId,
119
134
  enrollmentId: e.id
120
135
  });
121
136
  } catch (e) {
122
- V(e instanceof Error && e.message ? e.message : y("buildmyiq.lessonPlayer.finishCourseError", "Could not finish this course."));
137
+ B(e instanceof Error && e.message ? e.message : y("buildmyiq.lessonPlayer.finishCourseError", "Could not finish this course."));
123
138
  }
124
139
  }
125
140
  };
@@ -135,17 +150,17 @@ var w = {
135
150
  })
136
151
  })
137
152
  });
138
- let ke = E.isLoading || !!O && k.isLoading, Q = /* @__PURE__ */ x(S, {
153
+ let Be = E.isLoading || !!O && k.isLoading, Q = /* @__PURE__ */ x(S, {
139
154
  variant: "ghost",
140
155
  size: "sm",
141
156
  onClick: () => v("learning"),
142
157
  children: [
143
- /* @__PURE__ */ b(fe, { className: "me-1 h-4 w-4 rtl:-scale-x-100" }),
158
+ /* @__PURE__ */ b(ge, { className: "me-1 h-4 w-4 rtl:-scale-x-100" }),
144
159
  " ",
145
160
  y("buildmyiq.nav.learning", "My Learning")
146
161
  ]
147
162
  });
148
- if (ke) return /* @__PURE__ */ b(r, {
163
+ if (Be) return /* @__PURE__ */ b(r, {
149
164
  title: y("buildmyiq.lessonPlayer.pageTitle", "Lesson"),
150
165
  actions: Q,
151
166
  children: /* @__PURE__ */ b(l, { label: y("buildmyiq.lessonPlayer.loading", "Loading your lesson…") })
@@ -181,7 +196,7 @@ var w = {
181
196
  onRetry: () => k.refetch()
182
197
  })
183
198
  });
184
- let $ = Math.round(D.progressPct ?? 0), Ae = q ? w[q.type] : p;
199
+ let $ = Math.round(D.progressPct ?? 0), Ve = K ? w[K.type] : p;
185
200
  return /* @__PURE__ */ b(r, {
186
201
  title: A?.title ?? y("buildmyiq.lessonPlayer.pageTitle", "Lesson"),
187
202
  actions: Q,
@@ -205,8 +220,8 @@ var w = {
205
220
  children: [/* @__PURE__ */ b(o, { status: D.status }), /* @__PURE__ */ b("span", {
206
221
  className: "text-sm text-text-secondary tabular-nums",
207
222
  children: y("buildmyiq.lessonPlayer.progressSummary", "{{completed}} of {{total}} lessons complete", {
208
- completed: Y,
209
- total: U.length
223
+ completed: Z,
224
+ total: H.length
210
225
  })
211
226
  })]
212
227
  }), /* @__PURE__ */ b(ee, {
@@ -215,43 +230,43 @@ var w = {
215
230
  className: "mt-3"
216
231
  })]
217
232
  }),
218
- Te && !Ee && /* @__PURE__ */ x(S, {
233
+ Ne && !Pe && /* @__PURE__ */ x(S, {
219
234
  className: "shrink-0 max-sm:w-full",
220
- onClick: Oe,
235
+ onClick: ze,
221
236
  disabled: M.isPending,
222
- children: [M.isPending ? /* @__PURE__ */ b(h, { className: "me-1 h-4 w-4 animate-spin" }) : /* @__PURE__ */ b(ve, { className: "me-1 h-4 w-4" }), y("buildmyiq.lessonPlayer.finishCourse", "Finish course")]
237
+ children: [M.isPending ? /* @__PURE__ */ b(h, { className: "me-1 h-4 w-4 animate-spin" }) : /* @__PURE__ */ b(Se, { className: "me-1 h-4 w-4" }), y("buildmyiq.lessonPlayer.finishCourse", "Finish course")]
223
238
  })
224
239
  ]
225
240
  }),
226
- B && /* @__PURE__ */ b("p", {
241
+ z && /* @__PURE__ */ b("p", {
227
242
  role: "alert",
228
243
  className: "text-sm text-status-error-text",
229
- children: B
244
+ children: z
230
245
  }),
231
246
  /* @__PURE__ */ x(S, {
232
247
  variant: "secondary",
233
248
  size: "sm",
234
249
  className: "w-full lg:hidden",
235
- onClick: () => z((e) => !e),
236
- children: [/* @__PURE__ */ b(_e, { className: "me-1 h-4 w-4" }), R ? y("buildmyiq.lessonPlayer.hideLessons", "Hide lessons") : y("buildmyiq.lessonPlayer.showLessons", "Lessons ({{completed}}/{{total}})", {
237
- completed: Y,
238
- total: U.length
250
+ onClick: () => R((e) => !e),
251
+ children: [/* @__PURE__ */ b(xe, { className: "me-1 h-4 w-4" }), L ? y("buildmyiq.lessonPlayer.hideLessons", "Hide lessons") : y("buildmyiq.lessonPlayer.showLessons", "Lessons ({{completed}}/{{total}})", {
252
+ completed: Z,
253
+ total: H.length
239
254
  })]
240
255
  }),
241
256
  /* @__PURE__ */ x("div", {
242
257
  className: "flex flex-col gap-5 lg:flex-row",
243
258
  children: [/* @__PURE__ */ b("aside", {
244
- className: n("lg:block lg:w-80 lg:shrink-0", R ? "block" : "hidden"),
259
+ className: n("lg:block lg:w-80 lg:shrink-0", L ? "block" : "hidden"),
245
260
  children: /* @__PURE__ */ b(C, {
246
261
  treatment: "plain",
247
262
  className: "overflow-hidden p-0 lg:sticky lg:top-4",
248
- children: U.length === 0 ? /* @__PURE__ */ b("div", {
263
+ children: H.length === 0 ? /* @__PURE__ */ b("div", {
249
264
  className: "p-4 text-sm text-text-secondary",
250
265
  children: y("buildmyiq.lessonPlayer.noLessons", "This course has no lessons yet.")
251
- }) : /* @__PURE__ */ x(xe, { children: [/* @__PURE__ */ b("nav", {
266
+ }) : /* @__PURE__ */ x(Te, { children: [/* @__PURE__ */ b("nav", {
252
267
  className: "max-h-[68vh] overflow-auto p-3",
253
- children: H.map((e) => {
254
- let t = e.lessons.filter((e) => W.get(e.id) === "COMPLETED").length;
268
+ children: V.map((e) => {
269
+ let t = e.lessons.filter((e) => U.get(e.id) === "COMPLETED").length;
255
270
  return /* @__PURE__ */ x("div", {
256
271
  className: "mb-4 last:mb-0",
257
272
  children: [/* @__PURE__ */ x("div", {
@@ -270,14 +285,14 @@ var w = {
270
285
  }), /* @__PURE__ */ b("ul", {
271
286
  className: "flex flex-col",
272
287
  children: e.lessons.map((t, r) => {
273
- let o = W.get(t.id) === "COMPLETED", s = t.id === G, c = r === e.lessons.length - 1, l = w[t.type];
288
+ let o = U.get(t.id) === "COMPLETED", s = t.id === W, c = r === e.lessons.length - 1, l = w[t.type];
274
289
  return /* @__PURE__ */ x("li", {
275
290
  className: "flex gap-3",
276
291
  children: [/* @__PURE__ */ x("div", {
277
292
  className: "flex flex-col items-center pt-1.5",
278
293
  children: [o ? /* @__PURE__ */ b("span", {
279
294
  className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--color-status-success-text)]",
280
- children: /* @__PURE__ */ b(me, { className: "h-3.5 w-3.5 text-status-success-bg-subtle" })
295
+ children: /* @__PURE__ */ b(ve, { className: "h-3.5 w-3.5 text-status-success-bg-subtle" })
281
296
  }) : s ? /* @__PURE__ */ b("span", {
282
297
  className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--color-accent-soft)] ring-2 ring-[var(--color-accent-teal)]",
283
298
  children: /* @__PURE__ */ b(l, { className: "h-3.5 w-3.5 text-[var(--color-accent-teal)]" })
@@ -287,7 +302,7 @@ var w = {
287
302
  }), !c && /* @__PURE__ */ b("span", { className: n("my-1 w-px flex-1", o ? "bg-[color-mix(in_srgb,var(--color-status-success-text)_45%,transparent)]" : "bg-border-seam") })]
288
303
  }), /* @__PURE__ */ x("button", {
289
304
  type: "button",
290
- onClick: () => X(t.id),
305
+ onClick: () => Fe(t.id),
291
306
  className: n("mb-1 min-w-0 flex-1 rounded-lg px-3 py-2 text-start transition-colors", s ? "bg-[var(--color-accent-soft)]" : "hover:bg-bg-sunken"),
292
307
  "aria-current": s ? "true" : void 0,
293
308
  children: [/* @__PURE__ */ b("span", {
@@ -311,7 +326,7 @@ var w = {
311
326
  className: "w-full",
312
327
  onClick: () => v(`catalog/${O}`),
313
328
  children: [
314
- /* @__PURE__ */ b(pe, { className: "me-1.5 h-4 w-4" }),
329
+ /* @__PURE__ */ b(_e, { className: "me-1.5 h-4 w-4" }),
315
330
  " ",
316
331
  y("buildmyiq.lessonPlayer.courseOverview", "Course overview")
317
332
  ]
@@ -321,7 +336,7 @@ var w = {
321
336
  }), /* @__PURE__ */ x("section", {
322
337
  "aria-label": y("buildmyiq.lessonPlayer.lessonRegion", "Lesson"),
323
338
  className: "min-w-0 flex-1",
324
- children: [q ? /* @__PURE__ */ x(C, {
339
+ children: [K ? /* @__PURE__ */ x(C, {
325
340
  treatment: "plain",
326
341
  className: "flex flex-col gap-4 p-5 sm:p-7",
327
342
  children: [
@@ -330,13 +345,13 @@ var w = {
330
345
  children: [
331
346
  /* @__PURE__ */ x("span", {
332
347
  className: "inline-flex items-center gap-1.5 rounded-full bg-[var(--color-accent-soft)] px-2.5 py-1 text-xs font-medium text-text-primary",
333
- children: [/* @__PURE__ */ b(Ae, { className: "h-3.5 w-3.5 text-[var(--color-accent-teal)]" }), a(q.type)]
348
+ children: [/* @__PURE__ */ b(Ve, { className: "h-3.5 w-3.5 text-[var(--color-accent-teal)]" }), a(K.type)]
334
349
  }),
335
- q.durationMin > 0 && /* @__PURE__ */ b("span", {
350
+ K.durationMin > 0 && /* @__PURE__ */ b("span", {
336
351
  className: "text-xs text-text-secondary",
337
- children: i(q.durationMin)
352
+ children: i(K.durationMin)
338
353
  }),
339
- J && /* @__PURE__ */ x("span", {
354
+ q && /* @__PURE__ */ x("span", {
340
355
  className: "inline-flex items-center gap-1 text-xs font-medium text-status-success-text",
341
356
  children: [
342
357
  /* @__PURE__ */ b(f, { className: "h-3.5 w-3.5" }),
@@ -344,34 +359,45 @@ var w = {
344
359
  y("buildmyiq.lessonPlayer.completedLabel", "Completed")
345
360
  ]
346
361
  }),
347
- /* @__PURE__ */ b(ce, { lesson: q }, q.id),
362
+ /* @__PURE__ */ b(de, { lesson: K }, K.id),
348
363
  /* @__PURE__ */ b("span", {
349
364
  className: "ms-auto text-xs tabular-nums text-text-secondary",
350
365
  children: y("buildmyiq.lessonPlayer.lessonPosition", "Lesson {{n}} of {{total}}", {
351
- n: K + 1,
352
- total: U.length
366
+ n: G + 1,
367
+ total: H.length
353
368
  })
354
369
  })
355
370
  ]
356
371
  }),
357
372
  /* @__PURE__ */ b("h2", {
358
373
  className: "text-2xl font-semibold tracking-tight text-text-primary",
359
- children: q.title
374
+ children: K.title
360
375
  }),
361
- q.media ? /* @__PURE__ */ x("div", {
376
+ K.media ? /* @__PURE__ */ x("div", {
362
377
  className: "rounded-xl border border-border-seam bg-bg-sunken p-3",
363
378
  children: [/* @__PURE__ */ b("p", {
364
379
  className: "mb-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",
365
380
  children: y("buildmyiq.lessonPlayer.resources", "Resources")
366
- }), /* @__PURE__ */ b(oe, { fileId: q.media.id })]
381
+ }), /* @__PURE__ */ b(le, { fileId: K.media.id })]
367
382
  }) : null,
368
- q.content ? /* @__PURE__ */ b("p", {
383
+ K.content ? /* @__PURE__ */ b("p", {
369
384
  className: "max-w-prose whitespace-pre-wrap text-[15px] leading-7 text-text-primary",
370
- children: q.content
371
- }) : /* @__PURE__ */ b("p", {
385
+ children: K.content
386
+ }) : X ? null : /* @__PURE__ */ b("p", {
372
387
  className: "text-sm text-text-secondary",
373
- children: q.media ? y("buildmyiq.lessonPlayer.noContentWithMedia", "This lesson has no written content beyond the attached media.") : y("buildmyiq.lessonPlayer.noContent", "This lesson has no written content")
388
+ children: K.media ? y("buildmyiq.lessonPlayer.noContentWithMedia", "This lesson has no written content beyond the attached media.") : y("buildmyiq.lessonPlayer.noContent", "This lesson has no written content")
389
+ }),
390
+ J && Y.isLoading && /* @__PURE__ */ b(l, { label: y("buildmyiq.interactive.loading", "Loading the activity…") }),
391
+ J && Y.isError && /* @__PURE__ */ b(c, {
392
+ title: y("buildmyiq.interactive.loadError", "Couldn't load the activity"),
393
+ message: Y.error instanceof Error ? Y.error.message : void 0,
394
+ onRetry: () => Y.refetch()
374
395
  }),
396
+ X && /* @__PURE__ */ b(pe, {
397
+ config: X,
398
+ bestScaled: je,
399
+ onSubmit: Re
400
+ }, X.packageId),
375
401
  /* @__PURE__ */ x("div", {
376
402
  className: "mt-2 flex flex-col gap-3 border-t border-border-seam pt-5 sm:flex-row sm:items-center sm:justify-between",
377
403
  children: [
@@ -379,25 +405,28 @@ var w = {
379
405
  variant: "outline",
380
406
  size: "sm",
381
407
  className: "max-sm:w-full",
382
- onClick: () => Z(-1),
383
- disabled: K <= 0,
408
+ onClick: () => Ie(-1),
409
+ disabled: G <= 0,
384
410
  children: [
385
- /* @__PURE__ */ b(he, { className: "me-1 h-4 w-4 rtl:-scale-x-100" }),
411
+ /* @__PURE__ */ b(ye, { className: "me-1 h-4 w-4 rtl:-scale-x-100" }),
386
412
  " ",
387
413
  y("buildmyiq.lessonPlayer.previous", "Previous")
388
414
  ]
389
415
  }),
390
- J ? /* @__PURE__ */ x("span", {
416
+ q ? /* @__PURE__ */ x("span", {
391
417
  className: "inline-flex items-center justify-center gap-2 rounded-lg bg-status-success-bg-subtle px-4 py-2 text-sm font-medium text-status-success-text max-sm:w-full",
392
418
  children: [
393
419
  /* @__PURE__ */ b(f, { className: "h-4 w-4" }),
394
420
  " ",
395
421
  y("buildmyiq.lessonPlayer.lessonComplete", "Lesson complete")
396
422
  ]
423
+ }) : J && (Y.isLoading || Y.isError) ? /* @__PURE__ */ b("span", { className: "max-sm:w-full" }) : X ? /* @__PURE__ */ b("span", {
424
+ className: "text-center text-sm text-text-secondary max-sm:w-full",
425
+ children: y("buildmyiq.interactive.passToComplete", "Pass the activity to complete this lesson.")
397
426
  }) : /* @__PURE__ */ x(S, {
398
427
  size: "lg",
399
428
  className: "max-sm:w-full",
400
- onClick: De,
429
+ onClick: Le,
401
430
  disabled: j.isPending,
402
431
  children: [j.isPending ? /* @__PURE__ */ b(h, { className: "me-1.5 h-4 w-4 animate-spin" }) : /* @__PURE__ */ b(f, { className: "me-1.5 h-4 w-4" }), j.isPending ? y("buildmyiq.lessonPlayer.markingComplete", "Marking complete…") : y("buildmyiq.lessonPlayer.markComplete", "Mark complete")]
403
432
  }),
@@ -405,12 +434,12 @@ var w = {
405
434
  variant: "outline",
406
435
  size: "sm",
407
436
  className: "max-sm:w-full",
408
- onClick: () => Z(1),
409
- disabled: K >= U.length - 1,
437
+ onClick: () => Ie(1),
438
+ disabled: G >= H.length - 1,
410
439
  children: [
411
440
  y("buildmyiq.lessonPlayer.next", "Next"),
412
441
  " ",
413
- /* @__PURE__ */ b(ge, { className: "ms-1 h-4 w-4 rtl:-scale-x-100" })
442
+ /* @__PURE__ */ b(be, { className: "ms-1 h-4 w-4 rtl:-scale-x-100" })
414
443
  ]
415
444
  })
416
445
  ]
@@ -420,14 +449,14 @@ var w = {
420
449
  illustration: "empty-data",
421
450
  title: y("buildmyiq.lessonPlayer.noLessonTitle", "No lesson to show"),
422
451
  description: y("buildmyiq.lessonPlayer.noLessonDescription", "This course doesn't have any lessons yet. Check back once the author adds content.")
423
- }), q && O && m && /* @__PURE__ */ b("div", {
452
+ }), K && O && m && /* @__PURE__ */ b("div", {
424
453
  className: "mt-5",
425
- children: /* @__PURE__ */ b(se, {
454
+ children: /* @__PURE__ */ b(ue, {
426
455
  courseId: O,
427
456
  enrollmentId: m,
428
- lessonId: q.id,
429
- lessonTitle: q.title,
430
- lessonTitlesById: we
457
+ lessonId: K.id,
458
+ lessonTitle: K.title,
459
+ lessonTitlesById: ke
431
460
  }, O)
432
461
  })]
433
462
  })]