@instructure/platform-modules 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,25 +1,25 @@
1
1
  import { z as d } from "zod";
2
- import { gql as ee } from "graphql-tag";
3
- import { jsx as o, jsxs as _ } from "react/jsx-runtime";
4
- import { createContext as Be, useContext as Ge, useMemo as N, useCallback as D, useRef as $, useState as Z, useEffect as de, useId as je, memo as Ye } from "react";
5
- import { useInfiniteQuery as Te, useQueryClient as We, InfiniteQueryObserver as Rt } from "@tanstack/react-query";
6
- import Ft from "p-limit";
7
- import { Button as X, IconButton as zt } from "@instructure/ui-buttons";
8
- import { Flex as T } from "@instructure/ui-flex";
9
- import { Text as b } from "@instructure/ui-text";
10
- import { View as y } from "@instructure/ui-view";
11
- import { politeAnnounce as Qe, getLiveRegion as He } from "@instructure/platform-instui-bindings";
12
- import { Alert as Ke } from "@instructure/ui-alerts";
13
- import { Heading as Ve } from "@instructure/ui-heading";
14
- import { IconLockLine as Ze, IconWarningLine as Xe, IconCheckLine as me, IconClockLine as Je, IconArrowNestLine as Ut, IconEmptyLine as Ot, IconLtiLine as $t, IconLinkLine as Bt, IconAttachMediaLine as Gt, IconDocumentLine as jt, IconDiscussionLine as Yt, IconQuizLine as Wt, IconAssignmentLine as Qt, IconArrowOpenUpLine as Ht, IconArrowOpenDownLine as et, IconSearchLine as Kt } from "@instructure/ui-icons";
15
- import { ProgressBar as Vt } from "@instructure/ui-progress";
16
- import { Spinner as tt } from "@instructure/ui-spinner";
17
- import { ScreenReaderContent as Zt } from "@instructure/ui-a11y-content";
18
- import { Link as Xt } from "@instructure/ui-link";
19
- import { Pill as Jt } from "@instructure/ui-pill";
20
- import { Menu as Me } from "@instructure/ui-menu";
21
- import { TextInput as en } from "@instructure/ui-text-input";
22
- const tn = d.enum([
2
+ import { gql as J } from "graphql-tag";
3
+ import { jsx as o, jsxs as T } from "react/jsx-runtime";
4
+ import { createContext as Oe, useContext as $e, useMemo as v, useCallback as A, useRef as q, useState as V, useEffect as ce, useId as Be, memo as Ge } from "react";
5
+ import { useInfiniteQuery as _e, useQueryClient as je, InfiniteQueryObserver as kt } from "@tanstack/react-query";
6
+ import qt from "p-limit";
7
+ import { Button as Z, IconButton as Rt } from "@instructure/ui-buttons";
8
+ import { Flex as P } from "@instructure/ui-flex";
9
+ import { Text as M } from "@instructure/ui-text";
10
+ import { View as _ } from "@instructure/ui-view";
11
+ import { politeAnnounce as Ye, getLiveRegion as Qe } from "@instructure/platform-instui-bindings";
12
+ import { Alert as We } from "@instructure/ui-alerts";
13
+ import { Heading as He } from "@instructure/ui-heading";
14
+ import { IconLockLine as Ke, IconWarningLine as Ve, IconCheckLine as de, IconClockLine as Ze, IconArrowNestLine as Ft, IconEmptyLine as zt, IconLtiLine as Ut, IconLinkLine as Ot, IconAttachMediaLine as $t, IconDocumentLine as Bt, IconDiscussionLine as Gt, IconQuizLine as jt, IconAssignmentLine as Yt, IconArrowOpenUpLine as Qt, IconArrowOpenDownLine as Xe, IconSearchLine as Wt } from "@instructure/ui-icons";
15
+ import { ProgressBar as Ht } from "@instructure/ui-progress";
16
+ import { Spinner as Je } from "@instructure/ui-spinner";
17
+ import { ScreenReaderContent as Kt } from "@instructure/ui-a11y-content";
18
+ import { Link as Vt } from "@instructure/ui-link";
19
+ import { Pill as Zt } from "@instructure/ui-pill";
20
+ import { Menu as be } from "@instructure/ui-menu";
21
+ import { TextInput as Xt } from "@instructure/ui-text-input";
22
+ const Jt = d.enum([
23
23
  "assignment",
24
24
  "quiz",
25
25
  "discussion",
@@ -28,7 +28,7 @@ const tn = d.enum([
28
28
  "external_url",
29
29
  "external_tool",
30
30
  "sub_header"
31
- ]), nn = d.enum(["not_started", "in_progress", "submitted", "graded", "missing", "locked"]), sn = d.enum(["not_started", "in_progress", "all_submitted", "all_graded", "missing", "locked"]), rn = d.enum([
31
+ ]), en = d.enum(["not_started", "in_progress", "submitted", "graded", "missing", "locked"]), tn = d.enum(["not_started", "in_progress", "all_submitted", "all_graded", "missing", "locked"]), nn = d.enum([
32
32
  "must_view",
33
33
  "must_mark_done",
34
34
  "must_contribute",
@@ -36,77 +36,77 @@ const tn = d.enum([
36
36
  "min_score",
37
37
  "min_percentage",
38
38
  "unknown"
39
- ]), on = d.object({
40
- status: sn,
39
+ ]), sn = d.object({
40
+ status: tn,
41
41
  requirementsMet: d.number(),
42
42
  requirementCount: d.number(),
43
43
  percentComplete: d.number().min(0).max(100),
44
44
  latestDueAt: d.string().nullish(),
45
45
  missingCount: d.number()
46
- }), nt = d.object({
46
+ }), et = d.object({
47
47
  itemId: d.string(),
48
- type: rn,
48
+ type: nn,
49
49
  minScore: d.number().nullish(),
50
50
  minPercentage: d.number().nullish()
51
- }), st = d.object({
51
+ }), tt = d.object({
52
52
  id: d.string(),
53
53
  moduleId: d.string(),
54
54
  title: d.string(),
55
- type: tn,
55
+ type: Jt,
56
56
  position: d.number(),
57
57
  indent: d.number(),
58
58
  published: d.boolean(),
59
59
  url: d.string().nullish(),
60
60
  newTab: d.boolean().nullish(),
61
- completionRequirement: nt.nullish(),
61
+ completionRequirement: et.nullish(),
62
62
  dueAt: d.string().nullish(),
63
- status: nn.optional(),
63
+ status: en.optional(),
64
64
  pointsPossible: d.number().nullish(),
65
65
  extensions: d.record(d.unknown()).optional()
66
- }), ln = d.object({
66
+ }), rn = d.object({
67
67
  id: d.string(),
68
68
  name: d.string(),
69
69
  position: d.number(),
70
70
  published: d.boolean(),
71
71
  itemCount: d.number(),
72
- items: d.array(st).optional(),
72
+ items: d.array(tt).optional(),
73
73
  unlockAt: d.string().nullish(),
74
74
  prerequisiteModuleIds: d.array(d.string()),
75
75
  requirementCount: d.number().nullish(),
76
76
  requireSequentialProgress: d.boolean(),
77
- completionRequirements: d.array(nt).optional(),
78
- progress: on.optional(),
77
+ completionRequirements: d.array(et).optional(),
78
+ progress: sn.optional(),
79
79
  extensions: d.record(d.unknown()).optional()
80
- }), rt = d.object({
80
+ }), nt = d.object({
81
81
  hasNextPage: d.boolean(),
82
82
  endCursor: d.string().nullable()
83
83
  }).refine((e) => !e.hasNextPage || e.endCursor !== null, {
84
84
  message: 'hasNextPage is true but endCursor is null: there is another page and no cursor to ask for it with, which renders a "Load more" that can never load.',
85
85
  path: ["endCursor"]
86
- }), an = d.object({
87
- modules: d.array(ln),
88
- pageInfo: rt
89
- }), un = d.object({
90
- items: d.array(st),
91
- pageInfo: rt
92
- }), ot = "career.estimatedDurationMinutes";
93
- function cn(e) {
86
+ }), on = d.object({
87
+ modules: d.array(rn),
88
+ pageInfo: nt
89
+ }), ln = d.object({
90
+ items: d.array(tt),
91
+ pageInfo: nt
92
+ }), st = "career.estimatedDurationMinutes";
93
+ function an(e) {
94
94
  var n;
95
- const t = (n = e.extensions) == null ? void 0 : n[ot];
95
+ const t = (n = e.extensions) == null ? void 0 : n[st];
96
96
  return typeof t != "number" || !Number.isFinite(t) || t <= 0 ? null : t;
97
97
  }
98
- function it(e, t) {
99
- return t == null ? e : { ...e, [ot]: t };
98
+ function rt(e, t) {
99
+ return t == null ? e : { ...e, [st]: t };
100
100
  }
101
- const Se = 100, we = 2e3;
102
- class dn extends Error {
101
+ const Me = 100, Te = 2e3;
102
+ class un extends Error {
103
103
  constructor(t, n) {
104
104
  super(
105
105
  `This in-memory adapter was built for course ${t} but was asked for course ${n}. A fixture serves exactly one course.`
106
106
  ), this.name = "InMemoryCourseMismatchError", this.expected = t, this.received = n;
107
107
  }
108
108
  }
109
- const mn = (e) => `offset:${e}`, gn = (e) => {
109
+ const cn = (e) => `offset:${e}`, dn = (e) => {
110
110
  if (!e) return 0;
111
111
  const t = Number.parseInt(e.replace("offset:", ""), 10);
112
112
  return Number.isFinite(t) && t >= 0 ? t : 0;
@@ -115,16 +115,16 @@ const mn = (e) => `offset:${e}`, gn = (e) => {
115
115
  throw new DOMException("The operation was aborted.", "AbortError");
116
116
  };
117
117
  function Le(e, t, n) {
118
- const s = gn(t), r = e.slice(s, s + n), i = s + r.length, u = i < e.length;
118
+ const s = dn(t), r = e.slice(s, s + n), i = s + r.length, u = i < e.length;
119
119
  return {
120
120
  slice: r,
121
- pageInfo: { hasNextPage: u, endCursor: u ? mn(i) : null }
121
+ pageInfo: { hasNextPage: u, endCursor: u ? cn(i) : null }
122
122
  };
123
123
  }
124
124
  function Qo(e, t = {}) {
125
125
  const n = (r) => e.itemsByModuleId[r] ?? [], s = (r) => {
126
126
  if (r !== e.courseId)
127
- throw new dn(e.courseId, r);
127
+ throw new un(e.courseId, r);
128
128
  };
129
129
  return {
130
130
  async listModules({
@@ -137,10 +137,10 @@ function Qo(e, t = {}) {
137
137
  }) {
138
138
  var f;
139
139
  Ce(g), s(r), (f = t.onRequest) == null || f.call(t, "listModules", { operation: "listModules", courseId: r });
140
- const { slice: l, pageInfo: m } = Le(e.modules, i, u), M = Math.min(c ?? Se, Se);
140
+ const { slice: l, pageInfo: m } = Le(e.modules, i, u), S = Math.min(c ?? Me, Me);
141
141
  return { modules: l.map((h) => {
142
- const P = n(h.id), C = a && P.length <= M;
143
- return { ...h, itemCount: P.length, items: C ? P : void 0 };
142
+ const w = n(h.id), x = a && w.length <= S;
143
+ return { ...h, itemCount: w.length, items: x ? w : void 0 };
144
144
  }), pageInfo: m };
145
145
  },
146
146
  async listModuleItems({
@@ -157,7 +157,7 @@ function Qo(e, t = {}) {
157
157
  }
158
158
  };
159
159
  }
160
- class lt extends Error {
160
+ class ot extends Error {
161
161
  constructor(t, n, s) {
162
162
  const r = t === "module" ? "module" : "module item";
163
163
  super(
@@ -165,11 +165,11 @@ class lt extends Error {
165
165
  ), this.name = "PartialCanvasResponseError", this.subject = t, this.id = n, this.field = s;
166
166
  }
167
167
  }
168
- function at(e, t, n) {
168
+ function it(e, t, n) {
169
169
  if (e != null) return e;
170
- throw new lt(t, n, "published");
170
+ throw new ot(t, n, "published");
171
171
  }
172
- function fn(e, t) {
172
+ function mn(e, t) {
173
173
  if (e.onUnsupportedItem) {
174
174
  e.onUnsupportedItem(t);
175
175
  return;
@@ -178,7 +178,7 @@ function fn(e, t) {
178
178
  `[platform-modules] dropped module item ${t.id}: content type "${t.typename ?? "null"}" is outside the closed ModuleItemType enum. Pass \`onUnsupportedItem\` to handle these yourself.`
179
179
  );
180
180
  }
181
- const hn = {
181
+ const gn = {
182
182
  Assignment: "assignment",
183
183
  Quiz: "quiz",
184
184
  Discussion: "discussion",
@@ -196,21 +196,21 @@ const hn = {
196
196
  // for no better reason than not being listed.
197
197
  PeerReviewSubAssignment: "assignment"
198
198
  };
199
- function pn(e) {
199
+ function fn(e) {
200
200
  const t = e == null ? void 0 : e.__typename;
201
201
  if (!t) return null;
202
- const n = hn[t];
202
+ const n = gn[t];
203
203
  return n ? n === "assignment" && (e == null ? void 0 : e.isNewQuiz) === !0 ? "quiz" : n : null;
204
204
  }
205
- const In = /^P(?!$)(?:(\d+(?:\.\d+)?)W)?(?:(\d+(?:\.\d+)?)D)?(?:T(?!$)(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?)?$/;
206
- function bn(e) {
205
+ const hn = /^P(?!$)(?:(\d+(?:\.\d+)?)W)?(?:(\d+(?:\.\d+)?)D)?(?:T(?!$)(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?)?$/;
206
+ function pn(e) {
207
207
  if (!e) return null;
208
- const t = In.exec(e);
208
+ const t = hn.exec(e);
209
209
  if (!t) return null;
210
210
  const [, n, s, r, i, u] = t, a = Number(n ?? 0) * 7 * 24 * 60 + Number(s ?? 0) * 24 * 60 + Number(r ?? 0) * 60 + Number(i ?? 0) + Number(u ?? 0) / 60;
211
211
  return Math.round(a);
212
212
  }
213
- const Mn = /* @__PURE__ */ new Set([
213
+ const In = /* @__PURE__ */ new Set([
214
214
  "must_view",
215
215
  "must_mark_done",
216
216
  "must_contribute",
@@ -218,31 +218,31 @@ const Mn = /* @__PURE__ */ new Set([
218
218
  "min_score",
219
219
  "min_percentage"
220
220
  ]);
221
- function Sn(e) {
222
- return Mn.has(e) ? e : "unknown";
221
+ function bn(e) {
222
+ return In.has(e) ? e : "unknown";
223
223
  }
224
- function yn(e) {
224
+ function Mn(e) {
225
225
  return {
226
226
  itemId: String(e.id),
227
- type: Sn(e.type),
227
+ type: bn(e.type),
228
228
  minScore: e.minScore ?? null,
229
229
  minPercentage: e.minPercentage ?? null
230
230
  };
231
231
  }
232
- function ut(e) {
232
+ function lt(e) {
233
233
  return {
234
234
  hasNextPage: (e == null ? void 0 : e.hasNextPage) ?? !1,
235
235
  endCursor: (e == null ? void 0 : e.endCursor) ?? null
236
236
  };
237
237
  }
238
- const _n = /* @__PURE__ */ new Set(["graded"]), Tn = /* @__PURE__ */ new Set(["submitted", "pending_review"]), wn = /* @__PURE__ */ new Set(["graded", "excused"]);
239
- function ct(e) {
238
+ const Sn = /* @__PURE__ */ new Set(["graded"]), yn = /* @__PURE__ */ new Set(["submitted", "pending_review"]), _n = /* @__PURE__ */ new Set(["graded", "excused"]);
239
+ function at(e) {
240
240
  var t;
241
241
  for (const n of ((t = e == null ? void 0 : e.submissionsConnection) == null ? void 0 : t.nodes) ?? [])
242
242
  if (n) return n;
243
243
  return null;
244
244
  }
245
- function dt(e, t) {
245
+ function ut(e, t) {
246
246
  if (!e) return;
247
247
  const n = new Map(t.map((r) => [r.itemId, r.type])), s = /* @__PURE__ */ new Set();
248
248
  for (const r of e.requirementsMet ?? []) {
@@ -258,35 +258,35 @@ function dt(e, t) {
258
258
  requirementsMetItemIds: s
259
259
  };
260
260
  }
261
- function Pn(e, t, n) {
261
+ function Tn(e, t, n) {
262
262
  if (n.locked) return "locked";
263
- const s = ct(e);
263
+ const s = at(e);
264
264
  if (s) {
265
265
  if (s.missing === !0) return "missing";
266
- if (_n.has(s.state ?? "") || wn.has(s.gradingStatus ?? ""))
266
+ if (Sn.has(s.state ?? "") || _n.has(s.gradingStatus ?? ""))
267
267
  return "graded";
268
- if (s.submittedAt != null || Tn.has(s.state ?? ""))
268
+ if (s.submittedAt != null || yn.has(s.state ?? ""))
269
269
  return "submitted";
270
270
  if ((s.attempt ?? 0) > 0) return "in_progress";
271
271
  }
272
272
  return n.requirementsMetItemIds.has(t) ? "in_progress" : "not_started";
273
273
  }
274
- const En = (e) => e.pointsPossible != null;
275
- function xn(e, t, n, s) {
274
+ const Pn = (e) => e.pointsPossible != null;
275
+ function wn(e, t, n, s) {
276
276
  if (e.locked) return "locked";
277
277
  if (t > 0 && !e.completed) return "missing";
278
278
  if (e.completed) {
279
- const r = (s ?? []).filter(En);
279
+ const r = (s ?? []).filter(Pn);
280
280
  return r.length > 0 && r.every((u) => u.status === "graded") ? "all_graded" : "all_submitted";
281
281
  }
282
282
  return e.started || n > 0 ? "in_progress" : "not_started";
283
283
  }
284
- function Cn(e, t, n, s) {
284
+ function En(e, t, n, s) {
285
285
  var a, c;
286
286
  if (!n) return;
287
287
  const r = e.requirementCount ?? t.length, i = Math.min(n.requirementsMetItemIds.size, r), u = ((a = e.submissionStatistics) == null ? void 0 : a.missingAssignmentCount) ?? 0;
288
288
  return {
289
- status: xn(n, u, i, s),
289
+ status: wn(n, u, i, s),
290
290
  requirementsMet: i,
291
291
  requirementCount: r,
292
292
  percentComplete: r > 0 ? Math.round(i / r * 100) : 0,
@@ -294,12 +294,12 @@ function Cn(e, t, n, s) {
294
294
  missingCount: u
295
295
  };
296
296
  }
297
- function Ln(e, t, n, s = {}, r) {
297
+ function xn(e, t, n, s = {}, r) {
298
298
  var c, g, l;
299
- const i = String(e._id), u = pn(e.content);
299
+ const i = String(e._id), u = fn(e.content);
300
300
  if (!u)
301
- return fn(s, { id: i, typename: ((c = e.content) == null ? void 0 : c.__typename) ?? null }), null;
302
- const a = ct(e.content);
301
+ return mn(s, { id: i, typename: ((c = e.content) == null ? void 0 : c.__typename) ?? null }), null;
302
+ const a = at(e.content);
303
303
  return {
304
304
  id: i,
305
305
  moduleId: t,
@@ -307,26 +307,26 @@ function Ln(e, t, n, s = {}, r) {
307
307
  type: u,
308
308
  position: e.position ?? 0,
309
309
  indent: e.indent ?? 0,
310
- published: at(e.published, "moduleItem", i),
310
+ published: it(e.published, "moduleItem", i),
311
311
  url: e.url ?? null,
312
312
  newTab: e.newTab ?? !1,
313
313
  completionRequirement: n.get(i) ?? null,
314
314
  dueAt: (a == null ? void 0 : a.cachedDueDate) ?? ((g = e.content) == null ? void 0 : g.dueAt) ?? null,
315
- status: r ? Pn(e.content, i, r) : void 0,
315
+ status: r ? Tn(e.content, i, r) : void 0,
316
316
  pointsPossible: ((l = e.content) == null ? void 0 : l.pointsPossible) ?? null,
317
317
  // Career-only, so it rides in `extensions` rather than widening the shared
318
318
  // model. Absent entirely for a Canvas LMS item, which is every item here.
319
- extensions: it(
319
+ extensions: rt(
320
320
  void 0,
321
- bn(e.estimatedDuration)
321
+ pn(e.estimatedDuration)
322
322
  )
323
323
  };
324
324
  }
325
- function mt(e, t, n, s, r) {
325
+ function ct(e, t, n, s, r) {
326
326
  const i = [];
327
327
  for (const u of e ?? []) {
328
328
  if (!u) continue;
329
- const a = Ln(
329
+ const a = xn(
330
330
  u,
331
331
  t,
332
332
  n,
@@ -337,26 +337,26 @@ function mt(e, t, n, s, r) {
337
337
  }
338
338
  return i;
339
339
  }
340
- function gt(e) {
340
+ function dt(e) {
341
341
  const t = [], n = /* @__PURE__ */ new Map();
342
342
  for (const s of e ?? []) {
343
343
  if (!s) continue;
344
- const r = yn(s);
344
+ const r = Mn(s);
345
345
  t.push(r), n.set(r.itemId, r);
346
346
  }
347
347
  return { list: t, byItemId: n };
348
348
  }
349
- function An(e, t = {}) {
349
+ function Cn(e, t = {}) {
350
350
  var g;
351
351
  const n = String(e._id);
352
352
  if (e.moduleItemsTotalCount == null)
353
- throw new lt("module", n, "moduleItemsTotalCount");
354
- const { list: s, byItemId: r } = gt(e.completionRequirements), i = e.moduleItemsConnection, u = i != null && !((g = i.pageInfo) != null && g.hasNextPage), a = dt(e.progression, s), c = u ? mt(i.nodes, n, r, t, a) : void 0;
353
+ throw new ot("module", n, "moduleItemsTotalCount");
354
+ const { list: s, byItemId: r } = dt(e.completionRequirements), i = e.moduleItemsConnection, u = i != null && !((g = i.pageInfo) != null && g.hasNextPage), a = ut(e.progression, s), c = u ? ct(i.nodes, n, r, t, a) : void 0;
355
355
  return {
356
356
  id: n,
357
357
  name: e.name ?? "",
358
358
  position: e.position ?? 0,
359
- published: at(e.published, "module", n),
359
+ published: it(e.published, "module", n),
360
360
  itemCount: e.moduleItemsTotalCount,
361
361
  items: c,
362
362
  unlockAt: e.unlockAt ?? null,
@@ -365,24 +365,24 @@ function An(e, t = {}) {
365
365
  requireSequentialProgress: e.requireSequentialProgress ?? !1,
366
366
  completionRequirements: s,
367
367
  // Derived after the items so `all_graded` can see them when they are inline.
368
- progress: Cn(e, s, a, c)
368
+ progress: En(e, s, a, c)
369
369
  };
370
370
  }
371
- function vn(e, t = {}) {
371
+ function Ln(e, t = {}) {
372
372
  var r;
373
373
  const n = (r = e == null ? void 0 : e.legacyNode) == null ? void 0 : r.modulesConnection, s = [];
374
374
  for (const i of (n == null ? void 0 : n.nodes) ?? [])
375
- i && s.push(An(i, t));
376
- return { modules: s, pageInfo: ut(n == null ? void 0 : n.pageInfo) };
375
+ i && s.push(Cn(i, t));
376
+ return { modules: s, pageInfo: lt(n == null ? void 0 : n.pageInfo) };
377
377
  }
378
- function Nn(e, t, n = {}) {
379
- const s = e == null ? void 0 : e.legacyNode, { list: r, byItemId: i } = gt(s == null ? void 0 : s.completionRequirements), u = s == null ? void 0 : s.moduleItemsConnection, a = dt(s == null ? void 0 : s.progression, r);
378
+ function An(e, t, n = {}) {
379
+ const s = e == null ? void 0 : e.legacyNode, { list: r, byItemId: i } = dt(s == null ? void 0 : s.completionRequirements), u = s == null ? void 0 : s.moduleItemsConnection, a = ut(s == null ? void 0 : s.progression, r);
380
380
  return {
381
- items: mt(u == null ? void 0 : u.nodes, t, i, n, a),
382
- pageInfo: ut(u == null ? void 0 : u.pageInfo)
381
+ items: ct(u == null ? void 0 : u.nodes, t, i, n, a),
382
+ pageInfo: lt(u == null ? void 0 : u.pageInfo)
383
383
  };
384
384
  }
385
- const Dn = ee`
385
+ const vn = J`
386
386
  fragment PlatformModulesSubmissionFields on Submission {
387
387
  _id
388
388
  state
@@ -392,7 +392,7 @@ const Dn = ee`
392
392
  missing
393
393
  cachedDueDate
394
394
  }
395
- `, ft = ee`
395
+ `, mt = J`
396
396
  fragment PlatformModulesItemFields on ModuleItem {
397
397
  _id
398
398
  title
@@ -439,8 +439,8 @@ const Dn = ee`
439
439
  }
440
440
  }
441
441
  }
442
- ${Dn}
443
- `, ht = ee`
442
+ ${vn}
443
+ `, gt = J`
444
444
  fragment PlatformModulesProgressionFields on ModuleProgression {
445
445
  workflowState
446
446
  completed
@@ -453,7 +453,7 @@ const Dn = ee`
453
453
  minPercentage
454
454
  }
455
455
  }
456
- `, kn = ee`
456
+ `, Nn = J`
457
457
  query PlatformModulesGetModules(
458
458
  $courseId: ID!
459
459
  $first: Int!
@@ -509,9 +509,9 @@ const Dn = ee`
509
509
  }
510
510
  }
511
511
  }
512
- ${ft}
513
- ${ht}
514
- `, qn = ee`
512
+ ${mt}
513
+ ${gt}
514
+ `, Dn = J`
515
515
  query PlatformModulesGetModuleItems(
516
516
  $moduleId: ID!
517
517
  $first: Int!
@@ -542,25 +542,25 @@ const Dn = ee`
542
542
  }
543
543
  }
544
544
  }
545
- ${ft}
546
- ${ht}
545
+ ${mt}
546
+ ${gt}
547
547
  `;
548
- function pt() {
548
+ function ft() {
549
549
  return new DOMException("The operation was aborted.", "AbortError");
550
550
  }
551
- function ue(e) {
552
- if (e != null && e.aborted) throw pt();
551
+ function ae(e) {
552
+ if (e != null && e.aborted) throw ft();
553
553
  }
554
554
  function Ae(e, t) {
555
555
  return t ? new Promise((n, s) => {
556
- const r = () => s(pt());
556
+ const r = () => s(ft());
557
557
  t.addEventListener("abort", r, { once: !0 }), e.then(n, s).finally(() => t.removeEventListener("abort", r));
558
558
  }) : e;
559
559
  }
560
- function Ho({
560
+ function Wo({
561
561
  executeQuery: e,
562
- inlineItemLimit: t = Se,
563
- nodeBudget: n = we,
562
+ inlineItemLimit: t = Me,
563
+ nodeBudget: n = Te,
564
564
  onUnsupportedItem: s,
565
565
  studentId: r,
566
566
  validate: i = !0
@@ -575,27 +575,27 @@ function Ho({
575
575
  cursor: g,
576
576
  pageSize: l,
577
577
  includeItems: m,
578
- inlineItemsFirst: M,
578
+ inlineItemsFirst: S,
579
579
  inlineFirst: p,
580
580
  signal: f
581
581
  }) {
582
- ue(f);
583
- const h = m ? Math.min(p ?? l, l) : l, P = Math.min(M ?? t, t), C = Math.max(1, Math.min(P, Math.floor(n / h))), v = await Ae(
584
- e(kn, {
582
+ ae(f);
583
+ const h = m ? Math.min(p ?? l, l) : l, w = Math.min(S ?? t, t), x = Math.max(1, Math.min(w, Math.floor(n / h))), L = await Ae(
584
+ e(Nn, {
585
585
  courseId: c,
586
586
  first: h,
587
587
  // Pass through what the caller was given; never derive an offset.
588
588
  after: g ?? null,
589
589
  includeItems: m,
590
- itemsFirst: C,
590
+ itemsFirst: x,
591
591
  includeSubmissions: a,
592
592
  studentId: r ?? null
593
593
  }),
594
594
  f
595
595
  );
596
- ue(f);
597
- const A = vn(v, u);
598
- return i ? an.parse(A) : A;
596
+ ae(f);
597
+ const C = Ln(L, u);
598
+ return i ? on.parse(C) : C;
599
599
  },
600
600
  async listModuleItems({
601
601
  moduleId: c,
@@ -603,9 +603,9 @@ function Ho({
603
603
  pageSize: l,
604
604
  signal: m
605
605
  }) {
606
- ue(m);
607
- const M = await Ae(
608
- e(qn, {
606
+ ae(m);
607
+ const S = await Ae(
608
+ e(Dn, {
609
609
  moduleId: c,
610
610
  first: l,
611
611
  after: g ?? null,
@@ -614,13 +614,13 @@ function Ho({
614
614
  }),
615
615
  m
616
616
  );
617
- ue(m);
618
- const p = Nn(M, c, u);
619
- return i ? un.parse(p) : p;
617
+ ae(m);
618
+ const p = An(S, c, u);
619
+ return i ? ln.parse(p) : p;
620
620
  }
621
621
  };
622
622
  }
623
- const he = {
623
+ const fe = {
624
624
  formatters: {},
625
625
  itemTypes: {},
626
626
  itemStatuses: {},
@@ -630,32 +630,32 @@ const he = {
630
630
  itemActions: {},
631
631
  navigation: {}
632
632
  };
633
- Object.freeze(he);
634
- for (const e of Object.values(he))
633
+ Object.freeze(fe);
634
+ for (const e of Object.values(fe))
635
635
  Object.freeze(e);
636
- const It = Be(null);
637
- function Ko({ value: e, children: t }) {
638
- return /* @__PURE__ */ o(It.Provider, { value: e, children: t });
636
+ const ht = Oe(null);
637
+ function Ho({ value: e, children: t }) {
638
+ return /* @__PURE__ */ o(ht.Provider, { value: e, children: t });
639
639
  }
640
- function Vo() {
641
- return Ge(It) ?? he;
640
+ function Ko() {
641
+ return $e(ht) ?? fe;
642
642
  }
643
- const ye = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
644
- function ge(e, t) {
643
+ const Se = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
644
+ function me(e, t) {
645
645
  const n = Object.entries(t ?? {}).filter(([, s]) => s !== void 0);
646
646
  return { ...e, ...Object.fromEntries(n) };
647
647
  }
648
- function Y(e, t = {}) {
648
+ function O(e, t = {}) {
649
649
  const n = Object.keys(e).map((r) => [
650
650
  r,
651
- ge(e[r], ye(t, r) ? t[r] : void 0)
652
- ]), s = Object.keys(t).filter((r) => !ye(e, r)).sort().map((r) => [r, ge({}, t[r])]);
651
+ me(e[r], Se(t, r) ? t[r] : void 0)
652
+ ]), s = Object.keys(t).filter((r) => !Se(e, r)).sort().map((r) => [r, me({}, t[r])]);
653
653
  return Object.fromEntries([...n, ...s]);
654
654
  }
655
- function Zo(e) {
655
+ function Vo(e) {
656
656
  return Object.keys(e).filter((t) => !e[t].hidden).map((t) => ({ ...e[t], key: t })).sort((t, n) => t.order - n.order);
657
657
  }
658
- const Rn = d.object({
658
+ const kn = d.object({
659
659
  /** Resolved through `t` at render. */
660
660
  label: d.string(),
661
661
  /** Sort position, ascending. The base spaces its values (10, 20, 30…) so a host can insert between two built-ins. */
@@ -663,56 +663,56 @@ const Rn = d.object({
663
663
  /** How a host removes an entry. Stays in the resolved registry; `visibleEntries` filters it at read time. */
664
664
  hidden: d.boolean().optional()
665
665
  });
666
- function Fn(e) {
666
+ function qn(e) {
667
667
  return d.record(d.string(), e);
668
668
  }
669
- const W = Fn(Rn.strict()), zn = d.object({
669
+ const $ = qn(kn.strict()), Rn = d.object({
670
670
  formatters: d.object({}).strict(),
671
- itemTypes: W,
672
- itemStatuses: W,
673
- itemMeta: W,
674
- filters: W,
675
- moduleActions: W,
676
- itemActions: W,
671
+ itemTypes: $,
672
+ itemStatuses: $,
673
+ itemMeta: $,
674
+ filters: $,
675
+ moduleActions: $,
676
+ itemActions: $,
677
677
  navigation: d.object({}).strict()
678
678
  });
679
- function Un(e, t = {}) {
680
- const n = Object.keys(t).filter((r) => !ye(e, r));
679
+ function Fn(e, t = {}) {
680
+ const n = Object.keys(t).filter((r) => !Se(e, r));
681
681
  if (n.length > 0)
682
682
  throw new Error(
683
683
  `Unknown modules config key(s): ${n.join(", ")}. Known keys are ${Object.keys(e).join(", ")}.`
684
684
  );
685
685
  const s = {
686
- formatters: ge(e.formatters, t.formatters),
687
- itemTypes: Y(e.itemTypes, t.itemTypes),
688
- itemStatuses: Y(e.itemStatuses, t.itemStatuses),
689
- itemMeta: Y(e.itemMeta, t.itemMeta),
690
- filters: Y(e.filters, t.filters),
691
- moduleActions: Y(e.moduleActions, t.moduleActions),
692
- itemActions: Y(e.itemActions, t.itemActions),
693
- navigation: ge(e.navigation, t.navigation)
686
+ formatters: me(e.formatters, t.formatters),
687
+ itemTypes: O(e.itemTypes, t.itemTypes),
688
+ itemStatuses: O(e.itemStatuses, t.itemStatuses),
689
+ itemMeta: O(e.itemMeta, t.itemMeta),
690
+ filters: O(e.filters, t.filters),
691
+ moduleActions: O(e.moduleActions, t.moduleActions),
692
+ itemActions: O(e.itemActions, t.itemActions),
693
+ navigation: me(e.navigation, t.navigation)
694
694
  };
695
- return zn.parse(s), s;
695
+ return Rn.parse(s), s;
696
696
  }
697
- function Xo(e = {}) {
698
- return Un(he, e);
697
+ function Zo(e = {}) {
698
+ return Fn(fe, e);
699
699
  }
700
- const Pe = 100, bt = 100, Mt = 100, On = 4, pe = 5 * 60 * 1e3, St = 20, fe = { hasNextPage: !1, endCursor: null }, Q = ["platform-modules"], te = {
701
- all: Q,
702
- course: (e) => [...Q, e],
703
- list: (e, t = {}) => [...Q, e, "list", t],
704
- items: (e, t, n = {}) => [...Q, e, "module", t, "items", n]
700
+ const Pe = 100, pt = 100, It = 100, zn = 4, he = 5 * 60 * 1e3, bt = 20, ge = { hasNextPage: !1, endCursor: null }, B = ["platform-modules"], ee = {
701
+ all: B,
702
+ course: (e) => [...B, e],
703
+ list: (e, t = {}) => [...B, e, "list", t],
704
+ items: (e, t, n = {}) => [...B, e, "module", t, "items", n]
705
705
  };
706
- function $n(e) {
707
- return [...Q, e, "list"];
706
+ function Un(e) {
707
+ return [...B, e, "list"];
708
708
  }
709
- function yt(e, t) {
710
- return [...Q, e, "module", t, "items"];
709
+ function Mt(e, t) {
710
+ return [...B, e, "module", t, "items"];
711
711
  }
712
- function _t(e) {
712
+ function St(e) {
713
713
  return e.pageInfo.hasNextPage ? e.pageInfo.endCursor : null;
714
714
  }
715
- function Tt(e) {
715
+ function yt(e) {
716
716
  const {
717
717
  courseId: t,
718
718
  adapter: n,
@@ -728,7 +728,7 @@ function Tt(e) {
728
728
  // `inlineItemsFirst` is deliberately NOT in the key. It is derived from the
729
729
  // probe of this very list, so it cannot vary for a fixed (view, pageSize,
730
730
  // includeItems) — including it would only add a segment that never differs.
731
- queryKey: te.list(t, { view: a, pageSize: s, includeItems: r }),
731
+ queryKey: ee.list(t, { view: a, pageSize: s, includeItems: r }),
732
732
  initialPageParam: null,
733
733
  queryFn: ({ pageParam: l, signal: m }) => n.listModules({
734
734
  courseId: t,
@@ -739,18 +739,18 @@ function Tt(e) {
739
739
  inlineFirst: u,
740
740
  signal: m
741
741
  }),
742
- getNextPageParam: _t,
742
+ getNextPageParam: St,
743
743
  enabled: g,
744
744
  staleTime: c,
745
745
  // A refetch of an infinite query re-walks every page it has loaded. Doing
746
- // that because someone alt-tabbed is the Canvas behaviour we are replacing.
746
+ // that because someone alt-tabbed is the Canvas behavior we are replacing.
747
747
  refetchOnWindowFocus: !1
748
748
  };
749
749
  }
750
- function wt(e) {
750
+ function _t(e) {
751
751
  const { courseId: t, moduleId: n, adapter: s, pageSize: r, view: i, staleTime: u, enabled: a, limit: c } = e;
752
752
  return {
753
- queryKey: te.items(t, n, { view: i, pageSize: r }),
753
+ queryKey: ee.items(t, n, { view: i, pageSize: r }),
754
754
  initialPageParam: null,
755
755
  queryFn: ({ pageParam: g, signal: l }) => {
756
756
  const m = () => s.listModuleItems({ courseId: t, moduleId: n, cursor: g, pageSize: r, signal: l });
@@ -760,14 +760,14 @@ function wt(e) {
760
760
  return m();
761
761
  }) : m();
762
762
  },
763
- getNextPageParam: _t,
763
+ getNextPageParam: St,
764
764
  enabled: a,
765
765
  staleTime: u,
766
766
  refetchOnWindowFocus: !1
767
767
  };
768
768
  }
769
- function Bn(e) {
770
- var P;
769
+ function On(e) {
770
+ var w;
771
771
  const {
772
772
  courseId: t,
773
773
  adapter: n,
@@ -776,10 +776,10 @@ function Bn(e) {
776
776
  inlineItemsFirst: i,
777
777
  inlineFirst: u,
778
778
  view: a,
779
- staleTime: c = pe,
779
+ staleTime: c = he,
780
780
  enabled: g = !0
781
- } = e, l = Te(
782
- Tt({
781
+ } = e, l = _e(
782
+ yt({
783
783
  courseId: t,
784
784
  adapter: n,
785
785
  pageSize: s,
@@ -790,11 +790,11 @@ function Bn(e) {
790
790
  staleTime: c,
791
791
  enabled: g
792
792
  })
793
- ), m = (P = l.data) == null ? void 0 : P.pages, M = N(() => (m ?? []).flatMap((C) => C.modules), [m]), p = m && m.length > 0 ? m[m.length - 1].pageInfo : fe, f = l.fetchNextPage, h = D(() => {
793
+ ), m = (w = l.data) == null ? void 0 : w.pages, S = v(() => (m ?? []).flatMap((x) => x.modules), [m]), p = m && m.length > 0 ? m[m.length - 1].pageInfo : ge, f = l.fetchNextPage, h = A(() => {
794
794
  f();
795
795
  }, [f]);
796
796
  return {
797
- modules: M,
797
+ modules: S,
798
798
  pageInfo: p,
799
799
  hasNextPage: p.hasNextPage,
800
800
  fetchNextPage: h,
@@ -804,19 +804,19 @@ function Bn(e) {
804
804
  error: l.error
805
805
  };
806
806
  }
807
- function Jo(e) {
807
+ function Xo(e) {
808
808
  var h;
809
809
  const {
810
810
  courseId: t,
811
811
  moduleId: n,
812
812
  adapter: s,
813
- pageSize: r = bt,
813
+ pageSize: r = pt,
814
814
  view: i,
815
815
  enabled: u = !0,
816
- staleTime: a = pe,
816
+ staleTime: a = he,
817
817
  limit: c
818
- } = e, g = Te(
819
- wt({
818
+ } = e, g = _e(
819
+ _t({
820
820
  courseId: t,
821
821
  moduleId: n,
822
822
  adapter: s,
@@ -826,20 +826,20 @@ function Jo(e) {
826
826
  enabled: u,
827
827
  limit: c
828
828
  })
829
- ), l = (h = g.data) == null ? void 0 : h.pages, m = N(() => (l ?? []).flatMap((P) => P.items), [l]), M = l && l.length > 0 ? l[l.length - 1].pageInfo : fe, p = g.fetchNextPage, f = D(() => {
829
+ ), l = (h = g.data) == null ? void 0 : h.pages, m = v(() => (l ?? []).flatMap((w) => w.items), [l]), S = l && l.length > 0 ? l[l.length - 1].pageInfo : ge, p = g.fetchNextPage, f = A(() => {
830
830
  p();
831
831
  }, [p]);
832
832
  return {
833
833
  items: m,
834
- pageInfo: M,
835
- hasNextPage: M.hasNextPage,
834
+ pageInfo: S,
835
+ hasNextPage: S.hasNextPage,
836
836
  fetchNextPage: f,
837
837
  isLoading: g.isLoading,
838
838
  isFetchingNextPage: g.isFetchingNextPage,
839
839
  error: g.error
840
840
  };
841
841
  }
842
- function Gn(e, t, n = we) {
842
+ function $n(e, t, n = Te) {
843
843
  if (e.pageInfo.hasNextPage) return "onDemand";
844
844
  let s = 0, r = 0;
845
845
  for (const i of e.modules) {
@@ -848,19 +848,19 @@ function Gn(e, t, n = we) {
848
848
  }
849
849
  return s > t * 2 ? "onDemand" : Math.max(e.modules.length, 1) * Math.max(r, 1) <= n ? "inline" : "onDemand";
850
850
  }
851
- function jn(e) {
852
- var M;
851
+ function Bn(e) {
852
+ var S;
853
853
  const {
854
854
  courseId: t,
855
855
  adapter: n,
856
856
  mode: s = "auto",
857
- inlineThreshold: r = Mt,
858
- nodeBudget: i = n.inlineNodeBudget ?? we,
857
+ inlineThreshold: r = It,
858
+ nodeBudget: i = n.inlineNodeBudget ?? Te,
859
859
  pageSize: u = Pe,
860
860
  view: a,
861
- staleTime: c = pe
862
- } = e, g = s === "auto", l = Te(
863
- Tt({
861
+ staleTime: c = he
862
+ } = e, g = s === "auto", l = _e(
863
+ yt({
864
864
  courseId: t,
865
865
  adapter: n,
866
866
  pageSize: u,
@@ -886,87 +886,87 @@ function jn(e) {
886
886
  error: l.error,
887
887
  inlineShape: null
888
888
  };
889
- const m = (M = l.data) == null ? void 0 : M.pages[0];
889
+ const m = (S = l.data) == null ? void 0 : S.pages[0];
890
890
  return m ? {
891
- resolvedMode: Gn(m, r, i),
891
+ resolvedMode: $n(m, r, i),
892
892
  isResolving: !1,
893
893
  probed: !0,
894
894
  error: null,
895
- inlineShape: Yn(m)
895
+ inlineShape: Gn(m)
896
896
  } : { resolvedMode: null, isResolving: !0, probed: !0, error: null, inlineShape: null };
897
897
  }
898
- function Yn(e) {
898
+ function Gn(e) {
899
899
  let t = 1;
900
900
  for (const n of e.modules)
901
901
  n.itemCount > t && (t = n.itemCount);
902
902
  return { moduleCount: Math.max(e.modules.length, 1), maxItemCount: t };
903
903
  }
904
- const ve = "\0", Wn = /* @__PURE__ */ new Map();
905
- function Qn(e, t, n = St) {
906
- const s = We(), r = $(/* @__PURE__ */ new Map()), [i, u] = Z(Wn), a = e.join(ve), c = N(() => a === "" ? [] : a.split(ve), [a]);
907
- de(() => {
904
+ const ve = "\0", jn = /* @__PURE__ */ new Map();
905
+ function Yn(e, t, n = bt) {
906
+ const s = je(), r = q(/* @__PURE__ */ new Map()), [i, u] = V(jn), a = e.join(ve), c = v(() => a === "" ? [] : a.split(ve), [a]);
907
+ ce(() => {
908
908
  const l = r.current, m = () => {
909
909
  u((f) => {
910
910
  const h = /* @__PURE__ */ new Map();
911
- let P = f.size !== l.size;
912
- for (const [C, v] of l) {
913
- const A = v.getCurrentResult();
914
- h.set(C, A), !P && f.get(C) !== A && (P = !0);
911
+ let w = f.size !== l.size;
912
+ for (const [x, L] of l) {
913
+ const C = L.getCurrentResult();
914
+ h.set(x, C), !w && f.get(x) !== C && (w = !0);
915
915
  }
916
- return P ? h : f;
916
+ return w ? h : f;
917
917
  });
918
- }, M = new Set(c);
918
+ }, S = new Set(c);
919
919
  for (const f of c) {
920
920
  if (l.has(f)) continue;
921
- const h = new Rt(
921
+ const h = new kt(
922
922
  s,
923
923
  t(f, !0)
924
924
  );
925
925
  l.set(f, h), h.subscribe(m);
926
926
  }
927
927
  for (const [f, h] of l)
928
- h.setOptions(t(f, M.has(f)));
928
+ h.setOptions(t(f, S.has(f)));
929
929
  for (const f of c) {
930
930
  const h = l.get(f);
931
931
  h && (l.delete(f), l.set(f, h));
932
932
  }
933
- let p = l.size - M.size;
933
+ let p = l.size - S.size;
934
934
  if (p > n)
935
935
  for (const [f, h] of l) {
936
936
  if (p <= n) break;
937
- M.has(f) || (h.destroy(), l.delete(f), p -= 1);
937
+ S.has(f) || (h.destroy(), l.delete(f), p -= 1);
938
938
  }
939
939
  m();
940
- }, [s, t, c, n]), de(() => {
940
+ }, [s, t, c, n]), ce(() => {
941
941
  const l = r.current;
942
942
  return () => {
943
943
  for (const m of l.values()) m.destroy();
944
944
  l.clear();
945
945
  };
946
946
  }, []);
947
- const g = D((l) => {
947
+ const g = A((l) => {
948
948
  var m;
949
949
  (m = r.current.get(l)) == null || m.fetchNextPage();
950
950
  }, []);
951
951
  return { results: i, fetchNextPage: g };
952
952
  }
953
- const Hn = [], Kn = () => {
953
+ const Qn = [], Wn = () => {
954
954
  };
955
- function ei(e) {
956
- var G, le;
955
+ function Jo(e) {
956
+ var z, ie;
957
957
  const {
958
958
  courseId: t,
959
959
  adapter: n,
960
960
  view: s,
961
961
  itemsMode: r = "auto",
962
- inlineThreshold: i = Mt,
962
+ inlineThreshold: i = It,
963
963
  pageSize: u = Pe,
964
- itemPageSize: a = bt,
965
- itemConcurrency: c = On,
966
- retainCollapsedLimit: g = St,
967
- staleTime: l = pe,
964
+ itemPageSize: a = pt,
965
+ itemConcurrency: c = zn,
966
+ retainCollapsedLimit: g = bt,
967
+ staleTime: l = he,
968
968
  initialExpandedModuleIds: m
969
- } = e, M = We(), p = jn({
969
+ } = e, S = je(), p = Bn({
970
970
  courseId: t,
971
971
  adapter: n,
972
972
  mode: r,
@@ -974,7 +974,7 @@ function ei(e) {
974
974
  pageSize: u,
975
975
  view: s,
976
976
  staleTime: l
977
- }), f = p.resolvedMode, h = Bn({
977
+ }), f = p.resolvedMode, h = On({
978
978
  courseId: t,
979
979
  adapter: n,
980
980
  pageSize: u,
@@ -984,90 +984,90 @@ function ei(e) {
984
984
  // Measured by the probe, not assumed. Canvas charges GraphQL complexity on
985
985
  // the requested shape, so asking for the ceiling rejects the query outright
986
986
  // even on a tiny course. @see UseItemsModeResult.inlineShape
987
- inlineItemsFirst: (G = p.inlineShape) == null ? void 0 : G.maxItemCount,
987
+ inlineItemsFirst: (z = p.inlineShape) == null ? void 0 : z.maxItemCount,
988
988
  // Both axes, not just one: the budget is charged on the product, so asking
989
989
  // for 100 modules when page 1 held 6 is what forces `inlineItemsFirst` down.
990
- inlineFirst: (le = p.inlineShape) == null ? void 0 : le.moduleCount,
990
+ inlineFirst: (ie = p.inlineShape) == null ? void 0 : ie.moduleCount,
991
991
  enabled: f !== null
992
- }), [P, C] = Z(
992
+ }), [w, x] = V(
993
993
  () => m ?? []
994
- ), v = N(() => {
995
- const S = /* @__PURE__ */ new Map();
996
- for (const I of h.modules) S.set(I.id, I);
997
- return S;
998
- }, [h.modules]), A = N(
999
- () => P.filter((S) => {
1000
- const I = v.get(S);
1001
- return I !== void 0 && I.items === void 0;
994
+ ), L = v(() => {
995
+ const y = /* @__PURE__ */ new Map();
996
+ for (const b of h.modules) y.set(b.id, b);
997
+ return y;
998
+ }, [h.modules]), C = v(
999
+ () => w.filter((y) => {
1000
+ const b = L.get(y);
1001
+ return b !== void 0 && b.items === void 0;
1002
1002
  }),
1003
- [P, v]
1004
- ), se = N(() => new Set(A), [A]), re = N(() => Ft(c), [c]), E = D(
1005
- (S, I) => wt({
1003
+ [w, L]
1004
+ ), ne = v(() => new Set(C), [C]), se = v(() => qt(c), [c]), E = A(
1005
+ (y, b) => _t({
1006
1006
  courseId: t,
1007
- moduleId: S,
1007
+ moduleId: y,
1008
1008
  adapter: n,
1009
1009
  pageSize: a,
1010
1010
  view: s,
1011
1011
  staleTime: l,
1012
- enabled: I,
1013
- limit: re
1012
+ enabled: b,
1013
+ limit: se
1014
1014
  }),
1015
- [t, n, a, s, l, re]
1016
- ), F = Qn(A, E, g), H = F.fetchNextPage, q = $(/* @__PURE__ */ new Map()), K = D(
1017
- (S) => {
1018
- let I = q.current.get(S);
1019
- return I || (I = () => H(S), q.current.set(S, I)), I;
1015
+ [t, n, a, s, l, se]
1016
+ ), G = Yn(C, E, g), j = G.fetchNextPage, R = q(/* @__PURE__ */ new Map()), Y = A(
1017
+ (y) => {
1018
+ let b = R.current.get(y);
1019
+ return b || (b = () => j(y), R.current.set(y, b)), b;
1020
1020
  },
1021
- [H]
1022
- ), z = D((S) => {
1023
- C(
1024
- (I) => I.includes(S) ? I : [...I, S]
1021
+ [j]
1022
+ ), D = A((y) => {
1023
+ x(
1024
+ (b) => b.includes(y) ? b : [...b, y]
1025
1025
  );
1026
- }, []), B = D(
1027
- (S) => {
1028
- C((I) => I.filter((x) => x !== S)), M.cancelQueries({ queryKey: yt(t, S) });
1026
+ }, []), F = A(
1027
+ (y) => {
1028
+ x((b) => b.filter((I) => I !== y)), S.cancelQueries({ queryKey: Mt(t, y) });
1029
1029
  },
1030
- [M, t]
1031
- ), V = $(P);
1032
- V.current = P;
1033
- const oe = D(
1034
- (S) => {
1035
- V.current.includes(S) ? B(S) : z(S);
1030
+ [S, t]
1031
+ ), Q = q(w);
1032
+ Q.current = w;
1033
+ const re = A(
1034
+ (y) => {
1035
+ Q.current.includes(y) ? F(y) : D(y);
1036
1036
  },
1037
- [B, z]
1038
- ), U = F.results, ie = $(/* @__PURE__ */ new Map()), O = D(
1039
- (S) => {
1037
+ [F, D]
1038
+ ), k = G.results, oe = q(/* @__PURE__ */ new Map()), W = A(
1039
+ (y) => {
1040
1040
  var xe;
1041
- const I = v.get(S), x = U.get(S), w = se.has(S), L = ie.current.get(S);
1042
- if (L && L.items === (I == null ? void 0 : I.items) && L.result === x && L.active === w)
1043
- return L.value;
1044
- const j = (ae) => (ie.current.set(S, { items: I == null ? void 0 : I.items, result: x, active: w, value: ae }), ae);
1045
- if ((I == null ? void 0 : I.items) !== void 0)
1046
- return j({
1047
- items: I.items,
1048
- pageInfo: fe,
1041
+ const b = L.get(y), I = k.get(y), H = ne.has(y), K = oe.current.get(y);
1042
+ if (K && K.items === (b == null ? void 0 : b.items) && K.result === I && K.active === H)
1043
+ return K.value;
1044
+ const we = (le) => (oe.current.set(y, { items: b == null ? void 0 : b.items, result: I, active: H, value: le }), le);
1045
+ if ((b == null ? void 0 : b.items) !== void 0)
1046
+ return we({
1047
+ items: b.items,
1048
+ pageInfo: ge,
1049
1049
  hasNextPage: !1,
1050
- fetchNextPage: Kn,
1050
+ fetchNextPage: Wn,
1051
1051
  isLoading: !1,
1052
1052
  isFetchingNextPage: !1,
1053
1053
  error: null,
1054
1054
  source: "inline"
1055
1055
  });
1056
- const R = (xe = x == null ? void 0 : x.data) == null ? void 0 : xe.pages, qt = R ? R.flatMap((ae) => ae.items) : Hn, Ee = R && R.length > 0 ? R[R.length - 1].pageInfo : fe;
1057
- return j({
1058
- items: qt,
1056
+ const U = (xe = I == null ? void 0 : I.data) == null ? void 0 : xe.pages, Dt = U ? U.flatMap((le) => le.items) : Qn, Ee = U && U.length > 0 ? U[U.length - 1].pageInfo : ge;
1057
+ return we({
1058
+ items: Dt,
1059
1059
  pageInfo: Ee,
1060
1060
  hasNextPage: Ee.hasNextPage,
1061
- fetchNextPage: K(S),
1061
+ fetchNextPage: Y(y),
1062
1062
  // Between the click and the observer being wired up there is one commit
1063
1063
  // with no result yet; report that as loading rather than as "empty".
1064
- isLoading: x ? x.isLoading : w,
1065
- isFetchingNextPage: (x == null ? void 0 : x.isFetchingNextPage) ?? !1,
1066
- error: (x == null ? void 0 : x.error) ?? null,
1064
+ isLoading: I ? I.isLoading : H,
1065
+ isFetchingNextPage: (I == null ? void 0 : I.isFetchingNextPage) ?? !1,
1066
+ error: (I == null ? void 0 : I.error) ?? null,
1067
1067
  source: "onDemand"
1068
1068
  });
1069
1069
  },
1070
- [v, U, K, se]
1070
+ [L, k, Y, ne]
1071
1071
  );
1072
1072
  return {
1073
1073
  modules: h.modules,
@@ -1078,119 +1078,118 @@ function ei(e) {
1078
1078
  isFetchingNextPage: h.isFetchingNextPage,
1079
1079
  error: h.error ?? p.error,
1080
1080
  itemsMode: f,
1081
- getItems: O,
1082
- expandModule: z,
1083
- collapseModule: B,
1084
- toggleModule: oe,
1085
- expandedModuleIds: P
1081
+ getItems: W,
1082
+ expandModule: D,
1083
+ collapseModule: F,
1084
+ toggleModule: re,
1085
+ expandedModuleIds: w
1086
1086
  };
1087
1087
  }
1088
- function ti(e, t, n, s) {
1089
- const r = s ? te.items(t, n, s) : yt(t, n);
1088
+ function ei(e, t, n, s) {
1089
+ const r = s ? ee.items(t, n, s) : Mt(t, n);
1090
1090
  return e.invalidateQueries({ queryKey: r });
1091
1091
  }
1092
- function ni(e, t, n) {
1093
- const s = n ? te.list(t, n) : $n(t);
1092
+ function ti(e, t, n) {
1093
+ const s = n ? ee.list(t, n) : Un(t);
1094
1094
  return e.invalidateQueries({ queryKey: s });
1095
1095
  }
1096
- function si(e, t) {
1097
- return e.invalidateQueries({ queryKey: te.course(t) });
1098
- }
1099
- const Vn = "Course modules", Zn = { one: "%{count} module loaded", other: "%{count} modules loaded" }, Xn = "Search by name", Jn = "Search…", es = "Expand / collapse", ts = "Expand all", ns = "Collapse all", ss = "Search matches module names only — items of collapsed modules are not loaded.", rs = "Modules failed to load: %{message}", os = "Loading modules", is = "This course has no modules.", ls = { one: "The only loaded module does not match this filter.", other: "None of the %{count} loaded modules match this filter." }, as = "Clear filters", us = "Loading more modules…", cs = "Load more modules (%{count} loaded)", ds = { one: "The only module in this course is loaded.", other: "All %{count} modules in this course are loaded." }, ms = "Filter", gs = "%{label} (%{count})", fs = "All", hs = "In progress", ps = "Complete", Is = "Due this week", bs = "Missing", Ms = "Locked until prerequisites are met", Ss = "%{name} progress", ys = { one: "%{loaded} of %{count} item loaded in %{name}", other: "%{loaded} of %{count} items loaded in %{name}" }, _s = "Items failed to load: %{message}", Ts = "Loading items", ws = "Loading…", Ps = "No items.", Es = "Loading more items…", xs = "Load more items (%{loaded} of %{count} loaded)", Cs = "(unpublished)", Ls = "Collapse %{name}", As = "Expand %{name}", vs = "Not started", Ns = "In progress", Ds = "All items complete", ks = "All items graded", qs = "Missing", Rs = "Locked", Fs = "Not started", zs = "In progress", Us = "Submitted", Os = "Graded", $s = "Missing", Bs = "Locked", Gs = "Assignment", js = "Quiz", Ys = "Discussion", Ws = "Page", Qs = "File", Hs = "External URL", Ks = "External tool", Vs = "Text header", Zs = "View the item", Xs = "Submit the assignment", Js = "Contribute to the page", er = "Mark as done", tr = "Score at least the minimum", nr = "Score at least %{count}", sr = "Score at least the minimum percentage", rr = "Score at least %{count}%", or = "Complete the requirement", ir = "today, %{time}", lr = "yesterday, %{time}", ar = "tomorrow, %{time}", ur = "%{date}, %{time}", cr = "Due %{when}", dr = "Will unlock on %{when}", mr = { one: "%{count} pt", other: "%{count} pts" }, gr = { one: "%{percent}% | %{met} of %{count} requirement met", other: "%{percent}% | %{met} of %{count} requirements met" }, fr = "%{count} min", hr = "Unpublished", pr = "Untitled item", Ir = "opens in a new window", br = {
1100
- pageTitle: Vn,
1101
- modulesLoadedAnnouncement: Zn,
1102
- moduleSearchLabel: Xn,
1103
- searchPlaceholder: Jn,
1104
- expandCollapseTrigger: es,
1105
- expandAll: ts,
1106
- collapseAll: ns,
1107
- searchScopeHint: ss,
1108
- modulesLoadErrorAlert: rs,
1109
- modulesLoadingSpinnerLabel: os,
1110
- noModulesEmptyState: is,
1111
- filteredEmptyState: ls,
1112
- clearFilters: as,
1113
- loadMoreModulesLoading: us,
1114
- loadMoreModules: cs,
1115
- allModulesLoaded: ds,
1116
- filterGroupLabel: ms,
1117
- filterChipWithCount: gs,
1118
- filterAll: fs,
1119
- filterInProgress: hs,
1120
- filterComplete: ps,
1121
- filterDueThisWeek: Is,
1122
- filterMissing: bs,
1123
- lockedByline: Ms,
1124
- moduleProgressScreenReaderLabel: Ss,
1125
- itemsLoadedAnnouncement: ys,
1126
- itemsLoadErrorAlert: _s,
1127
- itemsLoadingSpinnerLabel: Ts,
1128
- itemsLoadingText: ws,
1129
- noItemsEmptyState: Ps,
1130
- loadMoreItemsLoading: Es,
1131
- loadMoreItems: xs,
1132
- moduleUnpublishedBadge: Cs,
1133
- collapseModule: Ls,
1134
- expandModule: As,
1135
- moduleStatusNotStarted: vs,
1136
- moduleStatusInProgress: Ns,
1137
- moduleStatusAllSubmitted: Ds,
1138
- moduleStatusAllGraded: ks,
1139
- moduleStatusMissing: qs,
1140
- moduleStatusLocked: Rs,
1141
- itemStatusNotStarted: Fs,
1142
- itemStatusInProgress: zs,
1143
- itemStatusSubmitted: Us,
1144
- itemStatusGraded: Os,
1145
- itemStatusMissing: $s,
1146
- itemStatusLocked: Bs,
1147
- itemTypeAssignment: Gs,
1148
- itemTypeQuiz: js,
1149
- itemTypeDiscussion: Ys,
1150
- itemTypePage: Ws,
1151
- itemTypeFile: Qs,
1152
- itemTypeExternalUrl: Hs,
1153
- itemTypeExternalTool: Ks,
1154
- itemTypeSubHeader: Vs,
1155
- requirementMustView: Zs,
1156
- requirementMustSubmit: Xs,
1157
- requirementMustContribute: Js,
1158
- requirementMustMarkDone: er,
1159
- requirementMinScoreUnknown: tr,
1160
- requirementMinScore: nr,
1161
- requirementMinPercentageUnknown: sr,
1162
- requirementMinPercentage: rr,
1163
- requirementUnknown: or,
1164
- dateTimeToday: ir,
1165
- dateTimeYesterday: lr,
1166
- dateTimeTomorrow: ar,
1167
- dateTimeWithDate: ur,
1168
- dueByline: cr,
1169
- unlockByline: dr,
1170
- pointsAbbreviated: mr,
1171
- progressSummary: gr,
1172
- durationMinutes: fr,
1173
- itemUnpublishedLabel: hr,
1174
- itemUntitled: pr,
1175
- opensInNewWindow: Ir
1176
- }, Mr = /%\{(\w+)\}/g, Sr = br, ne = "en-US", yr = /* @__PURE__ */ new Map(), _r = /* @__PURE__ */ new Map();
1177
- function Pt(e, t, n) {
1096
+ function ni(e, t) {
1097
+ return e.invalidateQueries({ queryKey: ee.course(t) });
1098
+ }
1099
+ const Hn = "Course modules", Kn = { one: "%{count} module loaded", other: "%{count} modules loaded" }, Vn = "Search by name", Zn = "Search…", Xn = "Expand / collapse", Jn = "Expand all", es = "Collapse all", ts = "Search matches module names only — items of collapsed modules are not loaded.", ns = "Modules failed to load: %{message}", ss = "Loading modules", rs = "This course has no modules.", os = { one: "The only loaded module does not match this filter.", other: "None of the %{count} loaded modules match this filter." }, is = "Clear filters", ls = "Loading more modules…", as = "Load more modules (%{count} loaded)", us = { one: "The only module in this course is loaded.", other: "All %{count} modules in this course are loaded." }, cs = "Filter", ds = "All", ms = "In progress", gs = "Complete", fs = "Due this week", hs = "Missing", ps = "Locked until prerequisites are met", Is = "%{name} progress", bs = { one: "%{loaded} of %{count} item loaded in %{name}", other: "%{loaded} of %{count} items loaded in %{name}" }, Ms = "Items failed to load: %{message}", Ss = "Loading items", ys = "Loading…", _s = "No items.", Ts = "Loading more items…", Ps = "Load more items (%{loaded} of %{count} loaded)", ws = "(unpublished)", Es = "Collapse %{name}", xs = "Expand %{name}", Cs = "Not started", Ls = "In progress", As = "All items complete", vs = "All items graded", Ns = "Missing", Ds = "Locked", ks = "Not started", qs = "In progress", Rs = "Submitted", Fs = "Graded", zs = "Missing", Us = "Locked", Os = "Assignment", $s = "Quiz", Bs = "Discussion", Gs = "Page", js = "File", Ys = "External URL", Qs = "External tool", Ws = "Text header", Hs = "View the item", Ks = "Submit the assignment", Vs = "Contribute to the page", Zs = "Mark as done", Xs = "Score at least the minimum", Js = "Score at least %{count}", er = "Score at least the minimum percentage", tr = "Score at least %{count}%", nr = "Complete the requirement", sr = "today, %{time}", rr = "yesterday, %{time}", or = "tomorrow, %{time}", ir = "%{date}, %{time}", lr = "Due %{when}", ar = "Will unlock on %{when}", ur = { one: "%{count} pt", other: "%{count} pts" }, cr = { one: "%{percent}% | %{met} of %{count} requirement met", other: "%{percent}% | %{met} of %{count} requirements met" }, dr = "%{count} min", mr = "Unpublished", gr = "Untitled item", fr = "opens in a new window", hr = {
1100
+ pageTitle: Hn,
1101
+ modulesLoadedAnnouncement: Kn,
1102
+ moduleSearchLabel: Vn,
1103
+ searchPlaceholder: Zn,
1104
+ expandCollapseTrigger: Xn,
1105
+ expandAll: Jn,
1106
+ collapseAll: es,
1107
+ searchScopeHint: ts,
1108
+ modulesLoadErrorAlert: ns,
1109
+ modulesLoadingSpinnerLabel: ss,
1110
+ noModulesEmptyState: rs,
1111
+ filteredEmptyState: os,
1112
+ clearFilters: is,
1113
+ loadMoreModulesLoading: ls,
1114
+ loadMoreModules: as,
1115
+ allModulesLoaded: us,
1116
+ filterGroupLabel: cs,
1117
+ filterAll: ds,
1118
+ filterInProgress: ms,
1119
+ filterComplete: gs,
1120
+ filterDueThisWeek: fs,
1121
+ filterMissing: hs,
1122
+ lockedByline: ps,
1123
+ moduleProgressScreenReaderLabel: Is,
1124
+ itemsLoadedAnnouncement: bs,
1125
+ itemsLoadErrorAlert: Ms,
1126
+ itemsLoadingSpinnerLabel: Ss,
1127
+ itemsLoadingText: ys,
1128
+ noItemsEmptyState: _s,
1129
+ loadMoreItemsLoading: Ts,
1130
+ loadMoreItems: Ps,
1131
+ moduleUnpublishedBadge: ws,
1132
+ collapseModule: Es,
1133
+ expandModule: xs,
1134
+ moduleStatusNotStarted: Cs,
1135
+ moduleStatusInProgress: Ls,
1136
+ moduleStatusAllSubmitted: As,
1137
+ moduleStatusAllGraded: vs,
1138
+ moduleStatusMissing: Ns,
1139
+ moduleStatusLocked: Ds,
1140
+ itemStatusNotStarted: ks,
1141
+ itemStatusInProgress: qs,
1142
+ itemStatusSubmitted: Rs,
1143
+ itemStatusGraded: Fs,
1144
+ itemStatusMissing: zs,
1145
+ itemStatusLocked: Us,
1146
+ itemTypeAssignment: Os,
1147
+ itemTypeQuiz: $s,
1148
+ itemTypeDiscussion: Bs,
1149
+ itemTypePage: Gs,
1150
+ itemTypeFile: js,
1151
+ itemTypeExternalUrl: Ys,
1152
+ itemTypeExternalTool: Qs,
1153
+ itemTypeSubHeader: Ws,
1154
+ requirementMustView: Hs,
1155
+ requirementMustSubmit: Ks,
1156
+ requirementMustContribute: Vs,
1157
+ requirementMustMarkDone: Zs,
1158
+ requirementMinScoreUnknown: Xs,
1159
+ requirementMinScore: Js,
1160
+ requirementMinPercentageUnknown: er,
1161
+ requirementMinPercentage: tr,
1162
+ requirementUnknown: nr,
1163
+ dateTimeToday: sr,
1164
+ dateTimeYesterday: rr,
1165
+ dateTimeTomorrow: or,
1166
+ dateTimeWithDate: ir,
1167
+ dueByline: lr,
1168
+ unlockByline: ar,
1169
+ pointsAbbreviated: ur,
1170
+ progressSummary: cr,
1171
+ durationMinutes: dr,
1172
+ itemUnpublishedLabel: mr,
1173
+ itemUntitled: gr,
1174
+ opensInNewWindow: fr
1175
+ }, pr = /%\{(\w+)\}/g, Ir = hr, te = "en-US", br = /* @__PURE__ */ new Map(), Mr = /* @__PURE__ */ new Map();
1176
+ function Tt(e, t, n) {
1178
1177
  const s = e.get(t);
1179
1178
  if (s) return s;
1180
1179
  const r = n();
1181
1180
  return e.set(t, r), r;
1182
1181
  }
1183
- function Tr(e, t, n) {
1184
- return n ? e.replace(Mr, (s, r) => {
1182
+ function Sr(e, t, n) {
1183
+ return n ? e.replace(pr, (s, r) => {
1185
1184
  if (!Object.prototype.hasOwnProperty.call(n, r)) return s;
1186
1185
  const i = n[r];
1187
- return typeof i == "number" && Number.isFinite(i) ? Pt(_r, t, () => new Intl.NumberFormat(t)).format(i) : String(i);
1186
+ return typeof i == "number" && Number.isFinite(i) ? Tt(Mr, t, () => new Intl.NumberFormat(t)).format(i) : String(i);
1188
1187
  }) : e;
1189
1188
  }
1190
- function wr(e, t, n) {
1189
+ function yr(e, t, n) {
1191
1190
  const s = n == null ? void 0 : n.count;
1192
1191
  if (typeof s == "number" && Number.isFinite(s)) {
1193
- const r = Pt(yr, t, () => new Intl.PluralRules(t)).select(s), i = e[r];
1192
+ const r = Tt(br, t, () => new Intl.PluralRules(t)).select(s), i = e[r];
1194
1193
  if (typeof i == "string") return i;
1195
1194
  }
1196
1195
  return typeof e.other == "string" ? e.other : void 0;
@@ -1198,40 +1197,40 @@ function wr(e, t, n) {
1198
1197
  function Ne(e, t, n) {
1199
1198
  if (typeof e == "string") return e;
1200
1199
  if (e !== null && typeof e == "object")
1201
- return wr(e, t, n);
1200
+ return yr(e, t, n);
1202
1201
  }
1203
- function Pr(e, t, n, s) {
1202
+ function _r(e, t, n, s) {
1204
1203
  const r = Ne(e == null ? void 0 : e[t], n, s);
1205
1204
  if (typeof r == "string") return r;
1206
- const i = Ne(Sr[t], n, s);
1205
+ const i = Ne(Ir[t], n, s);
1207
1206
  return typeof i == "string" ? i : t;
1208
1207
  }
1209
- function Et(e, t = ne) {
1210
- return (n, s) => Tr(Pr(e, n, t, s), t, s);
1208
+ function Pt(e, t = te) {
1209
+ return (n, s) => Sr(_r(e, n, t, s), t, s);
1211
1210
  }
1212
- const Er = Et(), xr = { t: Er, locale: ne }, xt = Be(null);
1213
- function ri({
1211
+ const Tr = Pt(), Pr = { t: Tr, locale: te }, wt = Oe(null);
1212
+ function si({
1214
1213
  translations: e,
1215
1214
  locale: t,
1216
1215
  children: n
1217
1216
  }) {
1218
- const s = N(() => {
1219
- const r = t ?? ne;
1220
- return { t: Et(e, r), locale: r };
1217
+ const s = v(() => {
1218
+ const r = t ?? te;
1219
+ return { t: Pt(e, r), locale: r };
1221
1220
  }, [e, t]);
1222
- return /* @__PURE__ */ o(xt.Provider, { value: s, children: n });
1221
+ return /* @__PURE__ */ o(wt.Provider, { value: s, children: n });
1223
1222
  }
1224
- function k() {
1225
- return Ge(xt) ?? xr;
1223
+ function N() {
1224
+ return $e(wt) ?? Pr;
1226
1225
  }
1227
- const Cr = 864e5, De = /* @__PURE__ */ new Map(), ke = /* @__PURE__ */ new Map();
1228
- function Lr(e) {
1226
+ const wr = 864e5, De = /* @__PURE__ */ new Map(), ke = /* @__PURE__ */ new Map();
1227
+ function Er(e) {
1229
1228
  const t = ke.get(e);
1230
1229
  if (t) return t;
1231
1230
  const n = new Intl.NumberFormat(e, { minimumIntegerDigits: 2, useGrouping: !1 });
1232
1231
  return ke.set(e, n), n;
1233
1232
  }
1234
- function Ar(e) {
1233
+ function xr(e) {
1235
1234
  const t = De.get(e);
1236
1235
  if (t) return t;
1237
1236
  const n = {
@@ -1241,30 +1240,30 @@ function Ar(e) {
1241
1240
  };
1242
1241
  return De.set(e, n), n;
1243
1242
  }
1244
- function Ct(e, t) {
1243
+ function Et(e, t) {
1245
1244
  const n = Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()), s = Date.UTC(t.getFullYear(), t.getMonth(), t.getDate());
1246
- return Math.round((n - s) / Cr);
1245
+ return Math.round((n - s) / wr);
1247
1246
  }
1248
- function Lt(e, t, n, s = ne) {
1247
+ function xt(e, t, n, s = te) {
1249
1248
  const r = new Date(t);
1250
1249
  if (Number.isNaN(r.getTime())) return t;
1251
- const i = Ar(s), u = i.time.format(r), a = Ct(r, n);
1250
+ const i = xr(s), u = i.time.format(r), a = Et(r, n);
1252
1251
  if (a === 0) return e("dateTimeToday", { time: u });
1253
1252
  if (a === -1) return e("dateTimeYesterday", { time: u });
1254
1253
  if (a === 1) return e("dateTimeTomorrow", { time: u });
1255
1254
  const c = r.getFullYear() === n.getFullYear() ? i.day.format(r) : i.dayYear.format(r);
1256
1255
  return e("dateTimeWithDate", { date: c, time: u });
1257
1256
  }
1258
- function At(e, t, n, s) {
1259
- return e("dueByline", { when: Lt(e, t, n, s) });
1257
+ function Ct(e, t, n, s) {
1258
+ return e("dueByline", { when: xt(e, t, n, s) });
1260
1259
  }
1261
1260
  function qe(e, t, n, s) {
1262
- return e("unlockByline", { when: Lt(e, t, n, s) });
1261
+ return e("unlockByline", { when: xt(e, t, n, s) });
1263
1262
  }
1264
- function vr(e, t = ne) {
1265
- return !Number.isInteger(e) || e < 1 ? null : Lr(t).format(e);
1263
+ function Cr(e, t = te) {
1264
+ return !Number.isInteger(e) || e < 1 ? null : Er(t).format(e);
1266
1265
  }
1267
- function Nr(e, t) {
1266
+ function Lr(e, t) {
1268
1267
  switch (t) {
1269
1268
  case "assignment":
1270
1269
  return e("itemTypeAssignment");
@@ -1284,10 +1283,10 @@ function Nr(e, t) {
1284
1283
  return e("itemTypeSubHeader");
1285
1284
  }
1286
1285
  }
1287
- function Dr(e, t) {
1286
+ function Ar(e, t) {
1288
1287
  return t == null ? null : e("pointsAbbreviated", { count: t });
1289
1288
  }
1290
- function kr(e, t) {
1289
+ function vr(e, t) {
1291
1290
  switch (t.type) {
1292
1291
  case "must_view":
1293
1292
  return e("requirementMustView");
@@ -1305,17 +1304,17 @@ function kr(e, t) {
1305
1304
  return e("requirementUnknown");
1306
1305
  }
1307
1306
  }
1308
- function qr(e, t, n, s) {
1307
+ function Nr(e, t, n, s) {
1309
1308
  return e("progressSummary", { percent: t, met: n, count: s });
1310
1309
  }
1311
- const Rr = [
1310
+ const Dr = [
1312
1311
  "all",
1313
1312
  "in_progress",
1314
1313
  "complete",
1315
1314
  "due_this_week",
1316
1315
  "missing"
1317
1316
  ];
1318
- function Fr(e, t) {
1317
+ function kr(e, t) {
1319
1318
  switch (t) {
1320
1319
  case "all":
1321
1320
  return e("filterAll");
@@ -1329,8 +1328,8 @@ function Fr(e, t) {
1329
1328
  return e("filterMissing");
1330
1329
  }
1331
1330
  }
1332
- const zr = 7;
1333
- function Re(e, t, n) {
1331
+ const qr = 7;
1332
+ function Rr(e, t, n) {
1334
1333
  if (t === "all") return !0;
1335
1334
  const s = e.progress;
1336
1335
  if (!s) return !1;
@@ -1345,65 +1344,65 @@ function Re(e, t, n) {
1345
1344
  if (!s.latestDueAt) return !1;
1346
1345
  const r = new Date(s.latestDueAt);
1347
1346
  if (Number.isNaN(r.getTime())) return !1;
1348
- const i = Ct(r, n);
1349
- return i >= 0 && i <= zr;
1347
+ const i = Et(r, n);
1348
+ return i >= 0 && i <= qr;
1350
1349
  }
1351
1350
  default:
1352
1351
  return !0;
1353
1352
  }
1354
1353
  }
1355
- function Fe(e, t, n) {
1354
+ function Fr(e, t, n) {
1356
1355
  const s = t.trim().toLocaleLowerCase(n);
1357
1356
  return s === "" ? !0 : e.name.toLocaleLowerCase(n).includes(s);
1358
1357
  }
1359
- function Ur({ value: e, onChange: t, counts: n }) {
1360
- const { t: s } = k(), r = je();
1361
- return /* @__PURE__ */ _(y, { as: "div", margin: "medium 0 0 0", children: [
1362
- /* @__PURE__ */ o(y, { as: "div", margin: "0 0 x-small 0", children: /* @__PURE__ */ o(b, { size: "small", weight: "bold", id: r, children: s("filterGroupLabel") }) }),
1358
+ function zr({ value: e, onChange: t }) {
1359
+ const { t: n } = N(), s = Be();
1360
+ return /* @__PURE__ */ T(_, { as: "div", margin: "medium 0 0 0", children: [
1361
+ /* @__PURE__ */ o(_, { as: "div", margin: "0 0 x-small 0", children: /* @__PURE__ */ o(M, { size: "medium", weight: "bold", id: s, children: n("filterGroupLabel") }) }),
1363
1362
  /* @__PURE__ */ o(
1364
- T,
1363
+ P,
1365
1364
  {
1366
- gap: "x-small",
1365
+ gap: "space4",
1367
1366
  wrap: "wrap",
1368
1367
  as: "div",
1369
1368
  role: "group",
1370
- "aria-labelledby": r,
1369
+ "aria-labelledby": s,
1371
1370
  "data-testid": "filter-chips",
1372
- children: Rr.map((i) => {
1373
- const u = i === e, a = n == null ? void 0 : n[i], c = Fr(s, i);
1374
- return /* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ o(
1375
- X,
1371
+ children: Dr.map((r) => {
1372
+ const i = r === e;
1373
+ return /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ o(
1374
+ Z,
1376
1375
  {
1377
- size: "small",
1378
- color: u ? "primary" : "secondary",
1379
- "aria-pressed": u,
1380
- onClick: () => t(i),
1381
- "data-testid": `filter-chip-${i}`,
1382
- themeOverride: { borderRadius: "1.5rem" },
1383
- children: a === void 0 ? c : s("filterChipWithCount", { label: c, count: a })
1376
+ size: "medium",
1377
+ color: i ? "primary" : "secondary",
1378
+ "aria-pressed": i,
1379
+ onClick: () => t(r),
1380
+ "data-testid": `filter-chip-${r}`,
1381
+ themeOverride: { borderRadius: "0.5rem" },
1382
+ children: kr(n, r)
1384
1383
  }
1385
- ) }, i);
1384
+ ) }, r);
1386
1385
  })
1387
1386
  }
1388
1387
  )
1389
1388
  ] });
1390
1389
  }
1391
- const Or = {
1390
+ const Ur = {
1392
1391
  not_started: {},
1393
- in_progress: { color: "info", icon: /* @__PURE__ */ o(Je, {}) },
1394
- all_submitted: { color: "success", icon: /* @__PURE__ */ o(me, {}) },
1395
- all_graded: { color: "success", icon: /* @__PURE__ */ o(me, {}) },
1396
- missing: { color: "danger", icon: /* @__PURE__ */ o(Xe, {}) },
1397
- locked: { icon: /* @__PURE__ */ o(Ze, {}) }
1398
- }, $r = {
1392
+ in_progress: { color: "info", icon: /* @__PURE__ */ o(Ze, {}) },
1393
+ all_submitted: { color: "success", icon: /* @__PURE__ */ o(de, {}) },
1394
+ all_graded: { color: "success", icon: /* @__PURE__ */ o(de, {}) },
1395
+ missing: { color: "danger", icon: /* @__PURE__ */ o(Ve, {}) },
1396
+ locked: { icon: /* @__PURE__ */ o(Ke, {}) }
1397
+ }, Or = {
1399
1398
  not_started: {},
1400
- in_progress: { color: "info", icon: /* @__PURE__ */ o(Je, {}) },
1401
- submitted: { color: "success", icon: /* @__PURE__ */ o(me, {}) },
1402
- graded: { color: "success", icon: /* @__PURE__ */ o(me, {}) },
1403
- missing: { color: "danger", icon: /* @__PURE__ */ o(Xe, {}) },
1404
- locked: { icon: /* @__PURE__ */ o(Ze, {}) }
1399
+ in_progress: { color: "info", icon: /* @__PURE__ */ o(Ze, {}) },
1400
+ submitted: { color: "success", icon: /* @__PURE__ */ o(de, {}) },
1401
+ graded: { color: "success", icon: /* @__PURE__ */ o(de, {}) },
1402
+ missing: { color: "danger", icon: /* @__PURE__ */ o(Ve, {}) },
1403
+ locked: { icon: /* @__PURE__ */ o(Ke, {}) }
1405
1404
  };
1406
- function Br(e, t) {
1405
+ function $r(e, t) {
1407
1406
  switch (t) {
1408
1407
  case "not_started":
1409
1408
  return e("moduleStatusNotStarted");
@@ -1419,7 +1418,7 @@ function Br(e, t) {
1419
1418
  return e("moduleStatusLocked");
1420
1419
  }
1421
1420
  }
1422
- function Gr(e, t) {
1421
+ function Br(e, t) {
1423
1422
  switch (t) {
1424
1423
  case "not_started":
1425
1424
  return e("itemStatusNotStarted");
@@ -1435,51 +1434,51 @@ function Gr(e, t) {
1435
1434
  return e("itemStatusLocked");
1436
1435
  }
1437
1436
  }
1438
- function vt(e, t, n) {
1439
- return /* @__PURE__ */ o(Jt, { color: e.color, renderIcon: e.icon, "data-testid": n, children: t });
1437
+ function Lt(e, t, n) {
1438
+ return /* @__PURE__ */ o(Zt, { color: e.color, renderIcon: e.icon, "data-testid": n, children: t });
1440
1439
  }
1441
- function jr({ status: e }) {
1442
- const { t } = k();
1443
- return vt(
1444
- Or[e],
1445
- Br(t, e),
1440
+ function Gr({ status: e }) {
1441
+ const { t } = N();
1442
+ return Lt(
1443
+ Ur[e],
1444
+ $r(t, e),
1446
1445
  "module-status-pill"
1447
1446
  );
1448
1447
  }
1449
- function Yr({ status: e }) {
1450
- const { t } = k();
1451
- return vt(
1452
- $r[e],
1453
- Gr(t, e),
1448
+ function jr({ status: e }) {
1449
+ const { t } = N();
1450
+ return Lt(
1451
+ Or[e],
1452
+ Br(t, e),
1454
1453
  "item-status-pill"
1455
1454
  );
1456
1455
  }
1457
- const Wr = {
1458
- assignment: /* @__PURE__ */ o(Qt, {}),
1459
- quiz: /* @__PURE__ */ o(Wt, {}),
1460
- discussion: /* @__PURE__ */ o(Yt, {}),
1461
- page: /* @__PURE__ */ o(jt, {}),
1462
- file: /* @__PURE__ */ o(Gt, {}),
1463
- external_url: /* @__PURE__ */ o(Bt, {}),
1464
- external_tool: /* @__PURE__ */ o($t, {}),
1465
- sub_header: /* @__PURE__ */ o(Ot, {})
1466
- }, Qr = 1.75, Hr = {
1456
+ const Yr = {
1457
+ assignment: /* @__PURE__ */ o(Yt, {}),
1458
+ quiz: /* @__PURE__ */ o(jt, {}),
1459
+ discussion: /* @__PURE__ */ o(Gt, {}),
1460
+ page: /* @__PURE__ */ o(Bt, {}),
1461
+ file: /* @__PURE__ */ o($t, {}),
1462
+ external_url: /* @__PURE__ */ o(Ot, {}),
1463
+ external_tool: /* @__PURE__ */ o(Ut, {}),
1464
+ sub_header: /* @__PURE__ */ o(zt, {})
1465
+ }, Qr = 1.75, Wr = {
1467
1466
  contentVisibility: "auto",
1468
1467
  containIntrinsicSize: "auto 3.5rem"
1469
1468
  };
1470
- function Kr({ item: e, today: t, navigation: n }) {
1469
+ function Hr({ item: e, today: t, navigation: n }) {
1471
1470
  var p;
1472
- const { t: s, locale: r } = k(), i = e.title || s("itemUntitled");
1471
+ const { t: s, locale: r } = N(), i = e.title || s("itemUntitled");
1473
1472
  if (e.type === "sub_header")
1474
1473
  return /* @__PURE__ */ o(
1475
- y,
1474
+ _,
1476
1475
  {
1477
1476
  as: "div",
1478
1477
  padding: "x-small small",
1479
1478
  margin: "x-small 0 0 0",
1480
1479
  "data-testid": `module-item-${e.id}`,
1481
1480
  children: /* @__PURE__ */ o(
1482
- b,
1481
+ M,
1483
1482
  {
1484
1483
  size: "small",
1485
1484
  weight: "bold",
@@ -1492,13 +1491,13 @@ function Kr({ item: e, today: t, navigation: n }) {
1492
1491
  )
1493
1492
  }
1494
1493
  );
1495
- const u = ((p = n == null ? void 0 : n.getItemHref) == null ? void 0 : p.call(n, e)) ?? e.url ?? null, a = e.status === "locked", c = n == null ? void 0 : n.onItemClick, g = c ? (f) => c(e, f) : void 0, l = [Nr(s, e.type)];
1496
- e.dueAt && l.push(At(s, e.dueAt, t, r));
1497
- const m = Dr(s, e.pointsPossible);
1498
- m && l.push(m), e.completionRequirement && l.push(kr(s, e.completionRequirement));
1499
- const M = cn(e);
1500
- return M !== null && l.push(s("durationMinutes", { count: M })), e.published || l.push(s("itemUnpublishedLabel")), /* @__PURE__ */ o("div", { style: { marginLeft: `${e.indent * Qr}rem`, ...Hr }, children: /* @__PURE__ */ o(
1501
- y,
1494
+ const u = ((p = n == null ? void 0 : n.getItemHref) == null ? void 0 : p.call(n, e)) ?? e.url ?? null, a = e.status === "locked", c = n == null ? void 0 : n.onItemClick, g = c ? (f) => c(e, f) : void 0, l = [Lr(s, e.type)];
1495
+ e.dueAt && l.push(Ct(s, e.dueAt, t, r));
1496
+ const m = Ar(s, e.pointsPossible);
1497
+ m && l.push(m), e.completionRequirement && l.push(vr(s, e.completionRequirement));
1498
+ const S = an(e);
1499
+ return S !== null && l.push(s("durationMinutes", { count: S })), e.published || l.push(s("itemUnpublishedLabel")), /* @__PURE__ */ o("div", { style: { marginLeft: `${e.indent * Qr}rem`, ...Wr }, children: /* @__PURE__ */ o(
1500
+ _,
1502
1501
  {
1503
1502
  as: "div",
1504
1503
  background: "secondary",
@@ -1506,10 +1505,10 @@ function Kr({ item: e, today: t, navigation: n }) {
1506
1505
  padding: "x-small small",
1507
1506
  margin: "x-small 0 0 0",
1508
1507
  "data-testid": `module-item-${e.id}`,
1509
- children: /* @__PURE__ */ _(T, { alignItems: "center", gap: "small", children: [
1510
- e.indent > 0 ? /* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ o(b, { color: "secondary", children: /* @__PURE__ */ o(Ut, {}) }) }) : null,
1511
- /* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ o(
1512
- y,
1508
+ children: /* @__PURE__ */ T(P, { alignItems: "center", gap: "small", children: [
1509
+ e.indent > 0 ? /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ o(M, { color: "secondary", children: /* @__PURE__ */ o(Ft, {}) }) }) : null,
1510
+ /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ o(
1511
+ _,
1513
1512
  {
1514
1513
  as: "div",
1515
1514
  background: "primary",
@@ -1519,12 +1518,12 @@ function Kr({ item: e, today: t, navigation: n }) {
1519
1518
  width: "2.25rem",
1520
1519
  height: "2.25rem",
1521
1520
  textAlign: "center",
1522
- children: /* @__PURE__ */ o(b, { color: "secondary", children: Wr[e.type] })
1521
+ children: /* @__PURE__ */ o(M, { color: "secondary", children: Yr[e.type] })
1523
1522
  }
1524
1523
  ) }),
1525
- /* @__PURE__ */ _(T.Item, { shouldGrow: !0, shouldShrink: !0, children: [
1526
- /* @__PURE__ */ o(y, { as: "div", children: a || !u ? /* @__PURE__ */ o(
1527
- b,
1524
+ /* @__PURE__ */ T(P.Item, { shouldGrow: !0, shouldShrink: !0, children: [
1525
+ /* @__PURE__ */ o(_, { as: "div", children: a || !u ? /* @__PURE__ */ o(
1526
+ M,
1528
1527
  {
1529
1528
  weight: "bold",
1530
1529
  size: "small",
@@ -1533,8 +1532,8 @@ function Kr({ item: e, today: t, navigation: n }) {
1533
1532
  "data-locked": a ? "true" : void 0,
1534
1533
  children: i
1535
1534
  }
1536
- ) : /* @__PURE__ */ _(
1537
- Xt,
1535
+ ) : /* @__PURE__ */ T(
1536
+ Vt,
1538
1537
  {
1539
1538
  href: u,
1540
1539
  onClick: g,
@@ -1543,57 +1542,57 @@ function Kr({ item: e, today: t, navigation: n }) {
1543
1542
  target: e.newTab ? "_blank" : void 0,
1544
1543
  rel: e.newTab ? "noopener noreferrer" : void 0,
1545
1544
  children: [
1546
- /* @__PURE__ */ o(b, { weight: "bold", size: "small", color: "primary", "data-testid": "module-item-title", children: i }),
1547
- e.newTab ? /* @__PURE__ */ o(Zt, { children: ` ${s("opensInNewWindow")}` }) : null
1545
+ /* @__PURE__ */ o(M, { weight: "bold", size: "small", color: "primary", "data-testid": "module-item-title", children: i }),
1546
+ e.newTab ? /* @__PURE__ */ o(Kt, { children: ` ${s("opensInNewWindow")}` }) : null
1548
1547
  ]
1549
1548
  }
1550
1549
  ) }),
1551
- /* @__PURE__ */ o(y, { as: "div", children: /* @__PURE__ */ o(b, { size: "x-small", color: "secondary", "data-testid": "module-item-meta", children: l.map((f, h) => /* @__PURE__ */ _("span", { children: [
1550
+ /* @__PURE__ */ o(_, { as: "div", children: /* @__PURE__ */ o(M, { size: "x-small", color: "secondary", "data-testid": "module-item-meta", children: l.map((f, h) => /* @__PURE__ */ T("span", { children: [
1552
1551
  h > 0 ? /* @__PURE__ */ o("span", { "aria-hidden": "true", children: " | " }) : null,
1553
1552
  /* @__PURE__ */ o("span", { children: f })
1554
1553
  ] }, f)) }) })
1555
1554
  ] }),
1556
- e.status ? /* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ o(Yr, { status: e.status }) }) : null
1555
+ e.status ? /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ o(jr, { status: e.status }) }) : null
1557
1556
  ] })
1558
1557
  }
1559
1558
  ) });
1560
1559
  }
1561
- const Vr = Ye(Kr), ze = "3rem";
1562
- function Zr({
1560
+ const Kr = Ge(Hr), Re = "3rem";
1561
+ function Vr({
1563
1562
  label: e,
1564
1563
  dimmed: t = !1
1565
1564
  }) {
1566
1565
  return e === null ? null : /* @__PURE__ */ o(
1567
- y,
1566
+ _,
1568
1567
  {
1569
1568
  as: "div",
1570
1569
  display: "inline-block",
1571
1570
  borderWidth: "small",
1572
1571
  borderRadius: "large",
1573
1572
  borderColor: t ? "primary" : "secondary",
1574
- minWidth: ze,
1575
- height: ze,
1573
+ minWidth: Re,
1574
+ height: Re,
1576
1575
  padding: "0 xx-small",
1577
1576
  "data-testid": "module-number",
1578
- children: /* @__PURE__ */ o(T, { height: "100%", alignItems: "center", justifyItems: "center", children: /* @__PURE__ */ o(b, { weight: "bold", size: "medium", color: t ? "secondary" : "primary", children: e }) })
1577
+ children: /* @__PURE__ */ o(P, { height: "100%", alignItems: "center", justifyItems: "center", children: /* @__PURE__ */ o(M, { weight: "bold", size: "medium", color: t ? "secondary" : "primary", children: e }) })
1579
1578
  }
1580
1579
  );
1581
1580
  }
1582
- function Xr({ module: e, today: t }) {
1581
+ function Zr({ module: e, today: t }) {
1583
1582
  var a, c;
1584
- const { t: n, locale: s } = k(), r = ((a = e.progress) == null ? void 0 : a.status) === "locked", i = e.unlockAt;
1583
+ const { t: n, locale: s } = N(), r = ((a = e.progress) == null ? void 0 : a.status) === "locked", i = e.unlockAt;
1585
1584
  if (r && i)
1586
- return /* @__PURE__ */ o(b, { size: "small", color: "secondary", "data-testid": "module-byline", children: qe(n, i, t, s) });
1585
+ return /* @__PURE__ */ o(M, { size: "small", color: "secondary", "data-testid": "module-byline", children: qe(n, i, t, s) });
1587
1586
  if (r)
1588
- return /* @__PURE__ */ o(b, { size: "small", color: "secondary", "data-testid": "module-byline", children: n("lockedByline") });
1587
+ return /* @__PURE__ */ o(M, { size: "small", color: "secondary", "data-testid": "module-byline", children: n("lockedByline") });
1589
1588
  const u = (c = e.progress) == null ? void 0 : c.latestDueAt;
1590
- return u ? /* @__PURE__ */ o(b, { size: "small", color: "secondary", "data-testid": "module-byline", children: At(n, u, t, s) }) : !e.progress && i ? /* @__PURE__ */ o(b, { size: "small", color: "secondary", "data-testid": "module-byline", children: qe(n, i, t, s) }) : null;
1589
+ return u ? /* @__PURE__ */ o(M, { size: "small", color: "secondary", "data-testid": "module-byline", children: Ct(n, u, t, s) }) : !e.progress && i ? /* @__PURE__ */ o(M, { size: "small", color: "secondary", "data-testid": "module-byline", children: qe(n, i, t, s) }) : null;
1591
1590
  }
1592
- function Jr({ module: e }) {
1593
- const { t } = k(), n = e.progress;
1594
- return !n || n.requirementCount <= 0 ? null : /* @__PURE__ */ _(T, { alignItems: "center", gap: "small", margin: "small 0 0 0", "data-testid": "module-progress", children: [
1595
- /* @__PURE__ */ o(T.Item, { size: "22rem", shouldShrink: !0, children: /* @__PURE__ */ o(
1596
- Vt,
1591
+ function Xr({ module: e }) {
1592
+ const { t } = N(), n = e.progress;
1593
+ return !n || n.requirementCount <= 0 ? null : /* @__PURE__ */ T(P, { alignItems: "center", gap: "small", margin: "small 0 0 0", "data-testid": "module-progress", children: [
1594
+ /* @__PURE__ */ o(P.Item, { size: "22rem", shouldShrink: !0, children: /* @__PURE__ */ o(
1595
+ Ht,
1597
1596
  {
1598
1597
  size: "x-small",
1599
1598
  meterColor: n.percentComplete >= 100 ? "success" : "brand",
@@ -1603,7 +1602,7 @@ function Jr({ module: e }) {
1603
1602
  screenReaderLabel: t("moduleProgressScreenReaderLabel", { name: e.name })
1604
1603
  }
1605
1604
  ) }),
1606
- /* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ o(b, { size: "small", color: "secondary", children: qr(
1605
+ /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ o(M, { size: "small", color: "secondary", children: Nr(
1607
1606
  t,
1608
1607
  n.percentComplete,
1609
1608
  n.requirementsMet,
@@ -1611,39 +1610,39 @@ function Jr({ module: e }) {
1611
1610
  ) }) })
1612
1611
  ] });
1613
1612
  }
1614
- const Ue = (e) => `platform-modules-panel-${e}`;
1615
- function eo({
1613
+ const Fe = (e) => `platform-modules-panel-${e}`;
1614
+ function Jr({
1616
1615
  module: e,
1617
1616
  state: t,
1618
1617
  today: n,
1619
1618
  navigation: s,
1620
1619
  showDiagnostics: r
1621
1620
  }) {
1622
- const { t: i } = k(), u = $(null), a = t.items.length, c = !t.isLoading && !t.isFetchingNextPage;
1623
- return de(() => {
1624
- !c || a === 0 || u.current !== a && (u.current = a, Qe(
1621
+ const { t: i } = N(), u = q(null), a = t.items.length, c = !t.isLoading && !t.isFetchingNextPage;
1622
+ return ce(() => {
1623
+ !c || a === 0 || u.current !== a && (u.current = a, Ye(
1625
1624
  i("itemsLoadedAnnouncement", {
1626
1625
  loaded: a,
1627
1626
  count: e.itemCount,
1628
1627
  name: e.name
1629
1628
  })
1630
1629
  ));
1631
- }, [c, a, e.itemCount, e.name, i]), t.error ? /* @__PURE__ */ o(y, { as: "div", margin: "small 0 0 0", children: /* @__PURE__ */ o(
1632
- Ke,
1630
+ }, [c, a, e.itemCount, e.name, i]), t.error ? /* @__PURE__ */ o(_, { as: "div", margin: "small 0 0 0", children: /* @__PURE__ */ o(
1631
+ We,
1633
1632
  {
1634
1633
  variant: "error",
1635
1634
  margin: "0",
1636
- liveRegion: He,
1635
+ liveRegion: Qe,
1637
1636
  liveRegionPoliteness: "assertive",
1638
1637
  "data-testid": "items-error",
1639
1638
  children: i("itemsLoadErrorAlert", { message: t.error.message })
1640
1639
  }
1641
- ) }) : t.isLoading ? /* @__PURE__ */ _(y, { as: "div", margin: "small 0 0 0", "data-testid": "items-loading", children: [
1642
- /* @__PURE__ */ o(tt, { size: "x-small", renderTitle: i("itemsLoadingSpinnerLabel") }),
1640
+ ) }) : t.isLoading ? /* @__PURE__ */ T(_, { as: "div", margin: "small 0 0 0", "data-testid": "items-loading", children: [
1641
+ /* @__PURE__ */ o(Je, { size: "x-small", renderTitle: i("itemsLoadingSpinnerLabel") }),
1643
1642
  " ",
1644
- /* @__PURE__ */ o(b, { size: "small", color: "secondary", children: i("itemsLoadingText") })
1645
- ] }) : /* @__PURE__ */ _(y, { as: "div", margin: "small 0 0 0", children: [
1646
- r ? /* @__PURE__ */ _(b, { size: "x-small", color: "secondary", "data-testid": "items-source", children: [
1643
+ /* @__PURE__ */ o(M, { size: "small", color: "secondary", children: i("itemsLoadingText") })
1644
+ ] }) : /* @__PURE__ */ T(_, { as: "div", margin: "small 0 0 0", children: [
1645
+ r ? /* @__PURE__ */ T(M, { size: "x-small", color: "secondary", "data-testid": "items-source", children: [
1647
1646
  "items source: ",
1648
1647
  t.source,
1649
1648
  " · loaded ",
@@ -1651,9 +1650,9 @@ function eo({
1651
1650
  " of ",
1652
1651
  e.itemCount
1653
1652
  ] }) : null,
1654
- t.items.length === 0 ? /* @__PURE__ */ o(y, { as: "div", padding: "small", "data-testid": "items-empty", children: /* @__PURE__ */ o(b, { size: "small", color: "secondary", children: i("noItemsEmptyState") }) }) : /* @__PURE__ */ o("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, "data-testid": "items-list", children: t.items.map((g) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o(Vr, { item: g, today: n, navigation: s }) }, g.id)) }),
1655
- t.hasNextPage ? /* @__PURE__ */ o(y, { as: "div", margin: "small 0 0 0", textAlign: "center", children: /* @__PURE__ */ o(
1656
- X,
1653
+ t.items.length === 0 ? /* @__PURE__ */ o(_, { as: "div", padding: "small", "data-testid": "items-empty", children: /* @__PURE__ */ o(M, { size: "small", color: "secondary", children: i("noItemsEmptyState") }) }) : /* @__PURE__ */ o("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, "data-testid": "items-list", children: t.items.map((g) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o(Kr, { item: g, today: n, navigation: s }) }, g.id)) }),
1654
+ t.hasNextPage ? /* @__PURE__ */ o(_, { as: "div", margin: "small 0 0 0", textAlign: "center", children: /* @__PURE__ */ o(
1655
+ Z,
1657
1656
  {
1658
1657
  size: "small",
1659
1658
  onClick: t.fetchNextPage,
@@ -1667,7 +1666,7 @@ function eo({
1667
1666
  ) }) : null
1668
1667
  ] });
1669
1668
  }
1670
- function to({
1669
+ function eo({
1671
1670
  module: e,
1672
1671
  expanded: t,
1673
1672
  onToggle: n,
@@ -1679,9 +1678,9 @@ function to({
1679
1678
  moduleLabel: c
1680
1679
  }) {
1681
1680
  var p;
1682
- const { t: g, locale: l } = k(), m = ((p = e.progress) == null ? void 0 : p.status) === "locked", M = c === void 0 ? vr(e.position, l) : c;
1683
- return /* @__PURE__ */ _(
1684
- y,
1681
+ const { t: g, locale: l } = N(), m = ((p = e.progress) == null ? void 0 : p.status) === "locked", S = c === void 0 ? Cr(e.position, l) : c;
1682
+ return /* @__PURE__ */ T(
1683
+ _,
1685
1684
  {
1686
1685
  as: "div",
1687
1686
  background: "primary",
@@ -1692,45 +1691,45 @@ function to({
1692
1691
  margin: "0 0 small 0",
1693
1692
  "data-testid": `module-card-${e.id}`,
1694
1693
  children: [
1695
- /* @__PURE__ */ _(T, { alignItems: "start", gap: "small", "data-testid": "module-header", children: [
1696
- M !== null ? /* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ o(Zr, { label: M, dimmed: m }) }) : null,
1697
- /* @__PURE__ */ _(T.Item, { shouldGrow: !0, shouldShrink: !0, children: [
1698
- /* @__PURE__ */ _(y, { as: "div", children: [
1694
+ /* @__PURE__ */ T(P, { alignItems: "start", gap: "small", "data-testid": "module-header", children: [
1695
+ S !== null ? /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ o(Vr, { label: S, dimmed: m }) }) : null,
1696
+ /* @__PURE__ */ T(P.Item, { shouldGrow: !0, shouldShrink: !0, children: [
1697
+ /* @__PURE__ */ T(_, { as: "div", children: [
1699
1698
  /* @__PURE__ */ o(
1700
- Ve,
1699
+ He,
1701
1700
  {
1702
1701
  level: a,
1703
1702
  themeOverride: { h2FontSize: "1.375rem", h3FontSize: "1.375rem" },
1704
1703
  "data-testid": "module-name",
1705
- children: /* @__PURE__ */ o(b, { size: "large", weight: "bold", color: m ? "secondary" : "primary", children: e.name })
1704
+ children: /* @__PURE__ */ o(M, { size: "large", weight: "bold", color: m ? "secondary" : "primary", children: e.name })
1706
1705
  }
1707
1706
  ),
1708
- e.published ? null : /* @__PURE__ */ _(b, { size: "x-small", color: "secondary", children: [
1707
+ e.published ? null : /* @__PURE__ */ T(M, { size: "x-small", color: "secondary", children: [
1709
1708
  " ",
1710
1709
  g("moduleUnpublishedBadge")
1711
1710
  ] })
1712
1711
  ] }),
1713
- /* @__PURE__ */ o(y, { as: "div", children: /* @__PURE__ */ o(Xr, { module: e, today: r }) }),
1714
- /* @__PURE__ */ o(Jr, { module: e })
1712
+ /* @__PURE__ */ o(_, { as: "div", children: /* @__PURE__ */ o(Zr, { module: e, today: r }) }),
1713
+ /* @__PURE__ */ o(Xr, { module: e })
1715
1714
  ] }),
1716
- e.progress ? /* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ o(jr, { status: e.progress.status }) }) : null,
1717
- /* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ o(
1718
- zt,
1715
+ e.progress ? /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ o(Gr, { status: e.progress.status }) }) : null,
1716
+ /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ o(
1717
+ Rt,
1719
1718
  {
1720
1719
  size: "small",
1721
1720
  withBorder: !0,
1722
1721
  withBackground: !1,
1723
1722
  screenReaderLabel: t ? g("collapseModule", { name: e.name }) : g("expandModule", { name: e.name }),
1724
1723
  "aria-expanded": t,
1725
- "aria-controls": Ue(e.id),
1724
+ "aria-controls": Fe(e.id),
1726
1725
  onClick: () => n(e.id),
1727
1726
  "data-testid": `toggle-module-${e.id}`,
1728
- children: t ? /* @__PURE__ */ o(Ht, {}) : /* @__PURE__ */ o(et, {})
1727
+ children: t ? /* @__PURE__ */ o(Qt, {}) : /* @__PURE__ */ o(Xe, {})
1729
1728
  }
1730
1729
  ) })
1731
1730
  ] }),
1732
- /* @__PURE__ */ o("div", { id: Ue(e.id), role: "group", "aria-label": e.name, hidden: !t, children: t ? /* @__PURE__ */ o(
1733
- eo,
1731
+ /* @__PURE__ */ o("div", { id: Fe(e.id), role: "group", "aria-label": e.name, hidden: !t, children: t ? /* @__PURE__ */ o(
1732
+ Jr,
1734
1733
  {
1735
1734
  module: e,
1736
1735
  state: s,
@@ -1743,15 +1742,15 @@ function to({
1743
1742
  }
1744
1743
  );
1745
1744
  }
1746
- const no = Ye(to);
1747
- function so({
1745
+ const to = Ge(eo);
1746
+ function no({
1748
1747
  counts: e,
1749
1748
  itemsMode: t,
1750
1749
  loadedModules: n
1751
1750
  }) {
1752
1751
  const s = e.listModules + e.listModuleItems;
1753
1752
  return /* @__PURE__ */ o(
1754
- y,
1753
+ _,
1755
1754
  {
1756
1755
  as: "div",
1757
1756
  background: "secondary",
@@ -1760,25 +1759,25 @@ function so({
1760
1759
  padding: "x-small small",
1761
1760
  margin: "0 0 small 0",
1762
1761
  "data-testid": "dev-diagnostics",
1763
- children: /* @__PURE__ */ _(T, { gap: "medium", wrap: "wrap", children: [
1764
- /* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ o(b, { size: "x-small", weight: "bold", children: "Adapter requests" }) }),
1765
- /* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ _(b, { size: "x-small", "data-testid": "request-count-list-modules", children: [
1762
+ children: /* @__PURE__ */ T(P, { gap: "medium", wrap: "wrap", children: [
1763
+ /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ o(M, { size: "x-small", weight: "bold", children: "Adapter requests" }) }),
1764
+ /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ T(M, { size: "x-small", "data-testid": "request-count-list-modules", children: [
1766
1765
  "listModules: ",
1767
1766
  e.listModules
1768
1767
  ] }) }),
1769
- /* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ _(b, { size: "x-small", "data-testid": "request-count-list-module-items", children: [
1768
+ /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ T(M, { size: "x-small", "data-testid": "request-count-list-module-items", children: [
1770
1769
  "listModuleItems: ",
1771
1770
  e.listModuleItems
1772
1771
  ] }) }),
1773
- /* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ _(b, { size: "x-small", weight: "bold", "data-testid": "request-count-total", children: [
1772
+ /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ T(M, { size: "x-small", weight: "bold", "data-testid": "request-count-total", children: [
1774
1773
  "total: ",
1775
1774
  s
1776
1775
  ] }) }),
1777
- /* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ _(b, { size: "x-small", "data-testid": "resolved-items-mode", children: [
1776
+ /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ T(M, { size: "x-small", "data-testid": "resolved-items-mode", children: [
1778
1777
  "itemsMode: ",
1779
1778
  t ?? "probing…"
1780
1779
  ] }) }),
1781
- /* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ _(b, { size: "x-small", "data-testid": "modules-loaded-count", children: [
1780
+ /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ T(M, { size: "x-small", "data-testid": "modules-loaded-count", children: [
1782
1781
  "modules loaded: ",
1783
1782
  n
1784
1783
  ] }) })
@@ -1786,7 +1785,7 @@ function so({
1786
1785
  }
1787
1786
  );
1788
1787
  }
1789
- function oi({
1788
+ function ri({
1790
1789
  data: e,
1791
1790
  courseName: t,
1792
1791
  courseContext: n,
@@ -1801,106 +1800,97 @@ function oi({
1801
1800
  const {
1802
1801
  modules: l,
1803
1802
  hasNextPage: m,
1804
- fetchNextPage: M,
1803
+ fetchNextPage: S,
1805
1804
  isFetchingNextPage: p,
1806
1805
  isLoading: f,
1807
1806
  error: h,
1808
- itemsMode: P,
1809
- expandedModuleIds: C,
1810
- toggleModule: v,
1811
- expandModule: A,
1812
- collapseModule: se,
1813
- getItems: re
1814
- } = e, { t: E, locale: F } = k(), H = t ?? E("pageTitle"), [q, K] = Z(""), [z, B] = Z(u), V = $(null), oe = je(), U = $(!1), [ie] = Z(() => /* @__PURE__ */ new Date()), O = s ?? ie;
1815
- de(() => {
1816
- var w;
1817
- !U.current || p || (U.current = !1, Qe(E("modulesLoadedAnnouncement", { count: l.length })), (w = V.current) == null || w.focus());
1807
+ itemsMode: w,
1808
+ expandedModuleIds: x,
1809
+ toggleModule: L,
1810
+ expandModule: C,
1811
+ collapseModule: ne,
1812
+ getItems: se
1813
+ } = e, { t: E, locale: G } = N(), j = t ?? E("pageTitle"), [R, Y] = V(""), [D, F] = V(u), Q = q(null), re = Be(), k = q(!1), [oe] = V(() => /* @__PURE__ */ new Date()), W = s ?? oe;
1814
+ ce(() => {
1815
+ var I;
1816
+ !k.current || p || (k.current = !1, Ye(E("modulesLoadedAnnouncement", { count: l.length })), (I = Q.current) == null || I.focus());
1818
1817
  }, [p, l.length, E]);
1819
- const G = N(
1818
+ const z = v(
1820
1819
  () => l.filter(
1821
- (w) => Fe(w, q, F) && Re(w, z, O)
1820
+ (I) => Fr(I, R, G) && Rr(I, D, W)
1822
1821
  ),
1823
- [l, q, z, O, F]
1824
- ), le = N(() => {
1825
- const w = l.filter((j) => Fe(j, q, F)), L = (j) => w.filter((R) => Re(R, j, O)).length;
1826
- return {
1827
- all: w.length,
1828
- in_progress: L("in_progress"),
1829
- complete: L("complete"),
1830
- due_this_week: L("due_this_week"),
1831
- missing: L("missing")
1832
- };
1833
- }, [l, q, O, F]), S = () => {
1834
- for (const w of G) A(w.id);
1835
- }, I = () => {
1836
- for (const w of C) se(w);
1837
- }, x = l.length > 0 && G.length === 0 && !f && !h;
1838
- return /* @__PURE__ */ _(y, { as: c, display: "block", "data-testid": "modules-list", children: [
1839
- n ? /* @__PURE__ */ _(y, { as: "div", children: [
1840
- /* @__PURE__ */ o(b, { size: "small", color: "brand", children: n }),
1841
- /* @__PURE__ */ _(b, { size: "small", color: "secondary", children: [
1822
+ [l, R, D, W, G]
1823
+ ), ie = () => {
1824
+ for (const I of z) C(I.id);
1825
+ }, y = () => {
1826
+ for (const I of x) ne(I);
1827
+ }, b = l.length > 0 && z.length === 0 && !f && !h;
1828
+ return /* @__PURE__ */ T(_, { as: c, display: "block", "data-testid": "modules-list", children: [
1829
+ n ? /* @__PURE__ */ T(_, { as: "div", children: [
1830
+ /* @__PURE__ */ o(M, { size: "small", color: "brand", children: n }),
1831
+ /* @__PURE__ */ T(M, { size: "small", color: "secondary", children: [
1842
1832
  " ",
1843
1833
  "/",
1844
1834
  " "
1845
1835
  ] }),
1846
- /* @__PURE__ */ o(b, { size: "small", color: "secondary", children: H })
1836
+ /* @__PURE__ */ o(M, { size: "small", color: "secondary", children: j })
1847
1837
  ] }) : null,
1848
- /* @__PURE__ */ o(Ve, { level: g, margin: "x-small 0 medium 0", children: H }),
1838
+ /* @__PURE__ */ o(He, { level: g, margin: "x-small 0 medium 0", children: j }),
1849
1839
  r ? /* @__PURE__ */ o(
1850
- so,
1840
+ no,
1851
1841
  {
1852
1842
  counts: r,
1853
- itemsMode: P,
1843
+ itemsMode: w,
1854
1844
  loadedModules: l.length
1855
1845
  }
1856
1846
  ) : null,
1857
- /* @__PURE__ */ _(T, { gap: "small", wrap: "wrap", alignItems: "end", children: [
1858
- /* @__PURE__ */ o(T.Item, { size: "24rem", shouldShrink: !0, children: /* @__PURE__ */ o(
1859
- en,
1847
+ /* @__PURE__ */ T(P, { gap: "small", wrap: "wrap", alignItems: "end", children: [
1848
+ /* @__PURE__ */ o(P.Item, { size: "24rem", shouldShrink: !0, children: /* @__PURE__ */ o(
1849
+ Xt,
1860
1850
  {
1861
1851
  renderLabel: E("moduleSearchLabel"),
1862
1852
  placeholder: E("searchPlaceholder"),
1863
- "aria-describedby": oe,
1864
- value: q,
1865
- onChange: (w, L) => K(L),
1866
- renderBeforeInput: /* @__PURE__ */ o(Kt, { inline: !1 }),
1853
+ "aria-describedby": re,
1854
+ value: R,
1855
+ onChange: (I, H) => Y(H),
1856
+ renderBeforeInput: /* @__PURE__ */ o(Wt, { inline: !1 }),
1867
1857
  "data-testid": "modules-search"
1868
1858
  }
1869
1859
  ) }),
1870
- /* @__PURE__ */ o(T.Item, { shouldGrow: !0 }),
1871
- /* @__PURE__ */ o(T.Item, { children: /* @__PURE__ */ _(
1872
- Me,
1860
+ /* @__PURE__ */ o(P.Item, { shouldGrow: !0 }),
1861
+ /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ T(
1862
+ be,
1873
1863
  {
1874
1864
  placement: "bottom end",
1875
- trigger: /* @__PURE__ */ o(X, { renderIcon: /* @__PURE__ */ o(et, {}), "data-testid": "expand-collapse-trigger", children: E("expandCollapseTrigger") }),
1865
+ trigger: /* @__PURE__ */ o(Z, { renderIcon: /* @__PURE__ */ o(Xe, {}), "data-testid": "expand-collapse-trigger", children: E("expandCollapseTrigger") }),
1876
1866
  children: [
1877
- /* @__PURE__ */ o(Me.Item, { onSelect: S, "data-testid": "expand-all", children: E("expandAll") }),
1878
- /* @__PURE__ */ o(Me.Item, { onSelect: I, "data-testid": "collapse-all", children: E("collapseAll") })
1867
+ /* @__PURE__ */ o(be.Item, { onSelect: ie, "data-testid": "expand-all", children: E("expandAll") }),
1868
+ /* @__PURE__ */ o(be.Item, { onSelect: y, "data-testid": "collapse-all", children: E("collapseAll") })
1879
1869
  ]
1880
1870
  }
1881
1871
  ) })
1882
1872
  ] }),
1883
- /* @__PURE__ */ o(y, { as: "div", margin: "xx-small 0 0 0", children: /* @__PURE__ */ o(b, { size: "x-small", color: "secondary", id: oe, children: E("searchScopeHint") }) }),
1884
- /* @__PURE__ */ o(Ur, { value: z, onChange: B, counts: le }),
1885
- /* @__PURE__ */ _(y, { as: "div", margin: "medium 0 0 0", children: [
1873
+ /* @__PURE__ */ o(_, { as: "div", margin: "xx-small 0 0 0", children: /* @__PURE__ */ o(M, { size: "x-small", color: "secondary", id: re, children: E("searchScopeHint") }) }),
1874
+ /* @__PURE__ */ o(zr, { value: D, onChange: F }),
1875
+ /* @__PURE__ */ T(_, { as: "div", margin: "medium 0 0 0", children: [
1886
1876
  h ? (
1887
1877
  // `liveRegion` is what makes this announce; without it InstUI's Alert
1888
1878
  // sets no role and no aria-live. See the same fix in ModuleCard.
1889
1879
  /* @__PURE__ */ o(
1890
- Ke,
1880
+ We,
1891
1881
  {
1892
1882
  variant: "error",
1893
1883
  margin: "0 0 small 0",
1894
- liveRegion: He,
1884
+ liveRegion: Qe,
1895
1885
  liveRegionPoliteness: "assertive",
1896
1886
  "data-testid": "modules-error",
1897
1887
  children: E("modulesLoadErrorAlert", { message: h.message })
1898
1888
  }
1899
1889
  )
1900
1890
  ) : null,
1901
- f ? /* @__PURE__ */ o(y, { as: "div", padding: "large", textAlign: "center", "data-testid": "modules-loading", children: /* @__PURE__ */ o(tt, { renderTitle: E("modulesLoadingSpinnerLabel") }) }) : null,
1891
+ f ? /* @__PURE__ */ o(_, { as: "div", padding: "large", textAlign: "center", "data-testid": "modules-loading", children: /* @__PURE__ */ o(Je, { renderTitle: E("modulesLoadingSpinnerLabel") }) }) : null,
1902
1892
  !f && !h && l.length === 0 ? /* @__PURE__ */ o(
1903
- y,
1893
+ _,
1904
1894
  {
1905
1895
  as: "div",
1906
1896
  background: "secondary",
@@ -1908,11 +1898,11 @@ function oi({
1908
1898
  padding: "large",
1909
1899
  textAlign: "center",
1910
1900
  "data-testid": "modules-empty",
1911
- children: /* @__PURE__ */ o(b, { color: "secondary", children: E("noModulesEmptyState") })
1901
+ children: /* @__PURE__ */ o(M, { color: "secondary", children: E("noModulesEmptyState") })
1912
1902
  }
1913
1903
  ) : null,
1914
- x ? /* @__PURE__ */ _(
1915
- y,
1904
+ b ? /* @__PURE__ */ T(
1905
+ _,
1916
1906
  {
1917
1907
  as: "div",
1918
1908
  background: "secondary",
@@ -1921,13 +1911,13 @@ function oi({
1921
1911
  textAlign: "center",
1922
1912
  "data-testid": "modules-filtered-empty",
1923
1913
  children: [
1924
- /* @__PURE__ */ o(y, { as: "div", margin: "0 0 small 0", children: /* @__PURE__ */ o(b, { color: "secondary", children: E("filteredEmptyState", { count: l.length }) }) }),
1914
+ /* @__PURE__ */ o(_, { as: "div", margin: "0 0 small 0", children: /* @__PURE__ */ o(M, { color: "secondary", children: E("filteredEmptyState", { count: l.length }) }) }),
1925
1915
  /* @__PURE__ */ o(
1926
- X,
1916
+ Z,
1927
1917
  {
1928
1918
  size: "small",
1929
1919
  onClick: () => {
1930
- B("all"), K(""), U.current = !0;
1920
+ F("all"), Y(""), k.current = !0;
1931
1921
  },
1932
1922
  children: E("clearFilters")
1933
1923
  }
@@ -1935,39 +1925,39 @@ function oi({
1935
1925
  ]
1936
1926
  }
1937
1927
  ) : null,
1938
- /* @__PURE__ */ o("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, "data-testid": "modules-stack", children: G.map((w) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o(
1939
- no,
1928
+ /* @__PURE__ */ o("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, "data-testid": "modules-stack", children: z.map((I) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o(
1929
+ to,
1940
1930
  {
1941
- module: w,
1942
- expanded: C.includes(w.id),
1943
- onToggle: v,
1944
- itemsState: re(w.id),
1945
- today: O,
1931
+ module: I,
1932
+ expanded: x.includes(I.id),
1933
+ onToggle: L,
1934
+ itemsState: se(I.id),
1935
+ today: W,
1946
1936
  showDiagnostics: i,
1947
1937
  navigation: a,
1948
1938
  headingLevel: g === "h1" ? "h2" : "h3"
1949
1939
  }
1950
- ) }, w.id)) })
1940
+ ) }, I.id)) })
1951
1941
  ] }),
1952
- m ? /* @__PURE__ */ o(y, { as: "div", textAlign: "center", margin: "small 0 0 0", children: /* @__PURE__ */ o(
1953
- X,
1942
+ m ? /* @__PURE__ */ o(_, { as: "div", textAlign: "center", margin: "small 0 0 0", children: /* @__PURE__ */ o(
1943
+ Z,
1954
1944
  {
1955
1945
  color: "primary",
1956
1946
  onClick: () => {
1957
- U.current = !0, M();
1947
+ k.current = !0, S();
1958
1948
  },
1959
1949
  interaction: p ? "disabled" : "enabled",
1960
1950
  "data-testid": "load-more-modules",
1961
1951
  children: p ? E("loadMoreModulesLoading") : E("loadMoreModules", { count: l.length })
1962
1952
  }
1963
- ) }) : l.length > 0 ? /* @__PURE__ */ o(y, { as: "div", textAlign: "center", margin: "small 0 0 0", children: /* @__PURE__ */ o(
1964
- b,
1953
+ ) }) : l.length > 0 ? /* @__PURE__ */ o(_, { as: "div", textAlign: "center", margin: "small 0 0 0", children: /* @__PURE__ */ o(
1954
+ M,
1965
1955
  {
1966
1956
  size: "x-small",
1967
1957
  color: "secondary",
1968
1958
  "data-testid": "modules-all-loaded",
1969
- elementRef: (w) => {
1970
- V.current = w;
1959
+ elementRef: (I) => {
1960
+ Q.current = I;
1971
1961
  },
1972
1962
  tabIndex: -1,
1973
1963
  children: E("allModulesLoaded", { count: l.length })
@@ -1975,7 +1965,7 @@ function oi({
1975
1965
  ) }) : null
1976
1966
  ] });
1977
1967
  }
1978
- const J = [
1968
+ const X = [
1979
1969
  "assignment",
1980
1970
  "quiz",
1981
1971
  "discussion",
@@ -1984,24 +1974,24 @@ const J = [
1984
1974
  "external_url",
1985
1975
  "external_tool",
1986
1976
  "sub_header"
1987
- ], _e = [
1977
+ ], ye = [
1988
1978
  "not_started",
1989
1979
  "in_progress",
1990
1980
  "all_submitted",
1991
1981
  "all_graded",
1992
1982
  "missing",
1993
1983
  "locked"
1994
- ], Oe = [
1984
+ ], ze = [
1995
1985
  "must_view",
1996
1986
  "must_submit",
1997
1987
  "must_contribute",
1998
1988
  "must_mark_done",
1999
1989
  "min_score",
2000
1990
  "min_percentage"
2001
- ], ro = ["assignment", "quiz", "discussion"], oo = ["external_url", "external_tool"], io = ["assignment", "quiz", "discussion"], lo = Date.UTC(2025, 0, 6), ao = 864e5, Ie = "1", Nt = (e) => new Date(lo + e * ao).toISOString(), uo = (e, t) => {
2002
- const n = Oe[Math.floor(t / 3) % Oe.length];
1991
+ ], so = ["assignment", "quiz", "discussion"], ro = ["external_url", "external_tool"], oo = ["assignment", "quiz", "discussion"], io = Date.UTC(2025, 0, 6), lo = 864e5, pe = "1", At = (e) => new Date(io + e * lo).toISOString(), ao = (e, t) => {
1992
+ const n = ze[Math.floor(t / 3) % ze.length];
2003
1993
  return n === "min_score" ? { itemId: e, type: n, minScore: 10 } : n === "min_percentage" ? { itemId: e, type: n, minPercentage: 80 } : { itemId: e, type: n };
2004
- }, Dt = (e, t) => t % 3 === 0 && e !== "sub_header", kt = (e) => _e[(e - 1) % _e.length], co = (e, t) => !io.includes(e) || e === "discussion" && Math.floor(t / J.length) % 2 === 1 ? null : 5 + t % 4 * 5, mo = (e, t, n, s) => {
1994
+ }, vt = (e, t) => t % 3 === 0 && e !== "sub_header", Nt = (e) => ye[(e - 1) % ye.length], uo = (e, t) => !oo.includes(e) || e === "discussion" && Math.floor(t / X.length) % 2 === 1 ? null : 5 + t % 4 * 5, co = (e, t, n, s) => {
2005
1995
  const r = n ? "in_progress" : "not_started";
2006
1996
  switch (e) {
2007
1997
  case "locked":
@@ -2017,8 +2007,8 @@ const J = [
2017
2007
  case "in_progress":
2018
2008
  return t ? s % 3 === 0 ? "submitted" : s % 3 === 1 ? "in_progress" : "not_started" : s % 2 === 0 ? r : "not_started";
2019
2009
  }
2020
- }, go = (e) => e.status === "submitted" || e.status === "graded" || e.status === "in_progress" && e.pointsPossible == null, fo = (e, t, n, s, r, i) => {
2021
- const u = String(e), a = String(e * 1e3 + t + 1), c = J[n % J.length], g = c === "sub_header", l = ro.includes(c) && (n % 4 === 0 || s === "missing"), m = Dt(c, n) ? uo(a, n) : null;
2010
+ }, mo = (e) => e.status === "submitted" || e.status === "graded" || e.status === "in_progress" && e.pointsPossible == null, go = (e, t, n, s, r, i) => {
2011
+ const u = String(e), a = String(e * 1e3 + t + 1), c = X[n % X.length], g = c === "sub_header", l = so.includes(c) && (n % 4 === 0 || s === "missing"), m = vt(c, n) ? ao(a, n) : null;
2022
2012
  return {
2023
2013
  id: a,
2024
2014
  moduleId: u,
@@ -2026,50 +2016,50 @@ const J = [
2026
2016
  type: c,
2027
2017
  position: t + 1,
2028
2018
  indent: t % 5 === 4 ? 1 : 0,
2029
- // 1 in 7 unpublished, so a teacher view always has something to grey out.
2019
+ // 1 in 7 unpublished, so a teacher view always has something to gray out.
2030
2020
  // Same rule as the module: a student's page contains no unpublished items,
2031
- // so only a teacher fixture greys any out.
2021
+ // so only a teacher fixture grays any out.
2032
2022
  published: i === "teacher" ? n % 7 !== 0 : !0,
2033
- url: g ? null : `/courses/${Ie}/modules/items/${a}`,
2034
- newTab: oo.includes(c) && n % 2 === 0,
2023
+ url: g ? null : `/courses/${pe}/modules/items/${a}`,
2024
+ newTab: ro.includes(c) && n % 2 === 0,
2035
2025
  completionRequirement: m,
2036
- dueAt: l ? Nt(n % 90) : null,
2026
+ dueAt: l ? At(n % 90) : null,
2037
2027
  status: s,
2038
2028
  pointsPossible: r,
2039
2029
  // Canvas Career only, so it rides in `extensions`. Sparse on purpose: a
2040
2030
  // handful per fixture proves the escape hatch survives a round trip, and
2041
2031
  // every other item must carry no `extensions` key at all.
2042
- extensions: it(
2032
+ extensions: rt(
2043
2033
  void 0,
2044
2034
  n % 37 === 0 ? 5 + n % 4 * 10 : null
2045
2035
  )
2046
2036
  };
2047
- }, ho = (e, t, n, s) => {
2048
- const r = kt(e), i = [];
2037
+ }, fo = (e, t, n, s) => {
2038
+ const r = Nt(e), i = [];
2049
2039
  let u = 0;
2050
2040
  for (let a = 0; a < t; a += 1) {
2051
- const c = n + a, g = J[c % J.length], l = co(g, c), m = l !== null, M = m ? u++ : a, p = mo(r, m, Dt(g, c), M);
2052
- i.push(fo(e, a, c, p, l, s));
2041
+ const c = n + a, g = X[c % X.length], l = uo(g, c), m = l !== null, S = m ? u++ : a, p = co(r, m, vt(g, c), S);
2042
+ i.push(go(e, a, c, p, l, s));
2053
2043
  }
2054
2044
  return i;
2055
- }, po = (e, t, n) => {
2056
- const s = kt(e);
2045
+ }, ho = (e, t, n) => {
2046
+ const s = Nt(e);
2057
2047
  return s === "locked" || s === "not_started" ? s : t.length === 0 ? "not_started" : !t.some((r) => r.pointsPossible != null) || s === "missing" && n === 0 ? "in_progress" : s;
2058
- }, Io = (e) => {
2048
+ }, po = (e) => {
2059
2049
  const t = e.map((n) => n.dueAt).filter((n) => typeof n == "string").sort();
2060
2050
  return t.length > 0 ? t[t.length - 1] : null;
2061
- }, bo = (e, t, n) => {
2062
- const s = t.filter((c) => c.completionRequirement), r = n ?? s.length, i = Math.min(s.filter(go).length, r), u = t.filter((c) => c.status === "missing").length;
2051
+ }, Io = (e, t, n) => {
2052
+ const s = t.filter((c) => c.completionRequirement), r = n ?? s.length, i = Math.min(s.filter(mo).length, r), u = t.filter((c) => c.status === "missing").length;
2063
2053
  return {
2064
- status: po(e, t, u),
2054
+ status: ho(e, t, u),
2065
2055
  requirementsMet: i,
2066
2056
  requirementCount: r,
2067
2057
  // Derived from the clamped pair, so the bar and the fraction always agree.
2068
2058
  percentComplete: r > 0 ? Math.round(i / r * 100) : 0,
2069
- latestDueAt: Io(t),
2059
+ latestDueAt: po(t),
2070
2060
  missingCount: u
2071
2061
  };
2072
- }, Mo = (e, t, n) => {
2062
+ }, bo = (e, t, n) => {
2073
2063
  const s = e % 2 === 0 ? null : 1;
2074
2064
  return {
2075
2065
  id: String(e),
@@ -2078,17 +2068,17 @@ const J = [
2078
2068
  // A student sees only published modules; publish state varies for a teacher.
2079
2069
  published: n === "teacher" ? e % 4 !== 0 : !0,
2080
2070
  itemCount: t.length,
2081
- unlockAt: e % 5 === 0 ? Nt(e) : null,
2071
+ unlockAt: e % 5 === 0 ? At(e) : null,
2082
2072
  prerequisiteModuleIds: e > 1 && e % 3 === 0 ? [String(e - 1)] : [],
2083
2073
  requirementCount: s,
2084
2074
  requireSequentialProgress: e % 6 === 0,
2085
2075
  completionRequirements: t.flatMap(
2086
2076
  (r) => r.completionRequirement ? [r.completionRequirement] : []
2087
2077
  ),
2088
- progress: bo(e, t, s)
2078
+ progress: Io(e, t, s)
2089
2079
  };
2090
2080
  };
2091
- function So(e) {
2081
+ function Mo(e) {
2092
2082
  return {
2093
2083
  courseId: e.courseId,
2094
2084
  modules: e.modules.map(({ progress: t, ...n }) => n),
@@ -2100,40 +2090,40 @@ function So(e) {
2100
2090
  )
2101
2091
  };
2102
2092
  }
2103
- function be(e, t = {}) {
2104
- const n = t.view ?? "student", s = t.courseId ?? Ie, r = [], i = {};
2093
+ function Ie(e, t = {}) {
2094
+ const n = t.view ?? "student", s = t.courseId ?? pe, r = [], i = {};
2105
2095
  let u = 0;
2106
2096
  e.forEach((c, g) => {
2107
- const l = g + 1, m = ho(l, c, u, n);
2108
- u += c, r.push(Mo(l, m, n)), i[String(l)] = m;
2097
+ const l = g + 1, m = fo(l, c, u, n);
2098
+ u += c, r.push(bo(l, m, n)), i[String(l)] = m;
2109
2099
  });
2110
2100
  const a = { courseId: s, modules: r, itemsByModuleId: i };
2111
- return n === "teacher" ? So(a) : a;
2101
+ return n === "teacher" ? Mo(a) : a;
2102
+ }
2103
+ const ue = (e) => `/courses/${pe}/modules/items/${e}`, So = ye.length, yo = 8, _o = 120, To = 25, Po = 250, Ue = 8;
2104
+ function oi() {
2105
+ return Ie(Array.from({ length: So }, () => yo));
2112
2106
  }
2113
- const ce = (e) => `/courses/${Ie}/modules/items/${e}`, yo = _e.length, _o = 8, To = 120, wo = 25, Po = 250, $e = 8;
2114
2107
  function ii() {
2115
- return be(Array.from({ length: yo }, () => _o));
2108
+ return Ie(Array.from({ length: _o }, () => To));
2116
2109
  }
2117
2110
  function li() {
2118
- return be(Array.from({ length: To }, () => wo));
2119
- }
2120
- function ai() {
2121
- return be([
2122
- $e,
2111
+ return Ie([
2112
+ Ue,
2123
2113
  Po,
2124
- $e
2114
+ Ue
2125
2115
  ]);
2126
2116
  }
2127
- function ui() {
2128
- return be([]);
2117
+ function ai() {
2118
+ return Ie([]);
2129
2119
  }
2130
- function ci() {
2120
+ function ui() {
2131
2121
  const t = [
2132
- { title: "Reading: limits from the left and the right", type: "page", url: ce(1) },
2122
+ { title: "Reading: limits from the left and the right", type: "page", url: ue(1) },
2133
2123
  {
2134
2124
  title: "Desmos: interactive limit explorer",
2135
2125
  type: "external_url",
2136
- url: ce(2),
2126
+ url: ue(2),
2137
2127
  newTab: !0
2138
2128
  },
2139
2129
  { title: "Practice", type: "sub_header", url: null },
@@ -2141,9 +2131,9 @@ function ci() {
2141
2131
  {
2142
2132
  title: "Utilizing Triangle Characteristics: Measuring Distances Through Angles, Elevation and the Practical Limits of Indirect Measurement in the Field",
2143
2133
  type: "assignment",
2144
- url: ce(5)
2134
+ url: ue(5)
2145
2135
  },
2146
- { title: "Unit test", type: "quiz", url: ce(6), status: "locked" }
2136
+ { title: "Unit test", type: "quiz", url: ue(6), status: "locked" }
2147
2137
  ].map((n, s) => ({
2148
2138
  id: String(s + 1),
2149
2139
  moduleId: "1",
@@ -2155,7 +2145,7 @@ function ci() {
2155
2145
  ...n
2156
2146
  }));
2157
2147
  return {
2158
- courseId: Ie,
2148
+ courseId: pe,
2159
2149
  modules: [
2160
2150
  {
2161
2151
  id: "1",
@@ -2171,74 +2161,74 @@ function ci() {
2171
2161
  };
2172
2162
  }
2173
2163
  export {
2174
- nt as CompletionRequirementSchema,
2175
- rn as CompletionRequirementTypeSchema,
2176
- Mt as DEFAULT_INLINE_THRESHOLD,
2177
- On as DEFAULT_ITEM_CONCURRENCY,
2178
- bt as DEFAULT_ITEM_PAGE_SIZE,
2179
- ne as DEFAULT_LOCALE,
2164
+ et as CompletionRequirementSchema,
2165
+ nn as CompletionRequirementTypeSchema,
2166
+ It as DEFAULT_INLINE_THRESHOLD,
2167
+ zn as DEFAULT_ITEM_CONCURRENCY,
2168
+ pt as DEFAULT_ITEM_PAGE_SIZE,
2169
+ te as DEFAULT_LOCALE,
2180
2170
  Pe as DEFAULT_PAGE_SIZE,
2181
- St as DEFAULT_RETAIN_COLLAPSED_LIMIT,
2182
- pe as DEFAULT_STALE_TIME_MS,
2183
- ot as EXT_CAREER_ESTIMATED_DURATION_MINUTES,
2184
- Ie as FIXTURE_COURSE_ID,
2185
- Ur as FilterChips,
2186
- kn as GET_MODULES,
2187
- qn as GET_MODULE_ITEMS,
2188
- Se as INLINE_ITEM_LIMIT,
2189
- we as INLINE_QUERY_NODE_BUDGET,
2190
- dn as InMemoryCourseMismatchError,
2191
- Rr as MODULES_FILTER_IDS,
2192
- no as ModuleCard,
2193
- Vr as ModuleItemRow,
2194
- st as ModuleItemSchema,
2195
- Yr as ModuleItemStatusPill,
2196
- nn as ModuleItemStatusSchema,
2197
- tn as ModuleItemTypeSchema,
2198
- un as ModuleItemsPageSchema,
2199
- Zr as ModuleNumberBadge,
2200
- on as ModuleProgressSchema,
2201
- ln as ModuleSchema,
2202
- jr as ModuleStatusPill,
2203
- sn as ModuleStatusSchema,
2204
- Ko as ModulesConfigProvider,
2205
- zn as ModulesConfigSchema,
2206
- ri as ModulesI18nProvider,
2207
- oi as ModulesList,
2208
- an as ModulesPageSchema,
2209
- rt as PageInfoSchema,
2210
- lt as PartialCanvasResponseError,
2211
- Rn as RegistryEntrySchema,
2212
- he as baseModulesConfig,
2213
- be as buildFixture,
2214
- ui as courseEmpty,
2215
- ai as courseFatModule,
2216
- ci as courseItemLinks,
2217
- li as courseLarge,
2218
- ii as courseSmall,
2219
- Ho as createCanvasGraphqlAdapter,
2171
+ bt as DEFAULT_RETAIN_COLLAPSED_LIMIT,
2172
+ he as DEFAULT_STALE_TIME_MS,
2173
+ st as EXT_CAREER_ESTIMATED_DURATION_MINUTES,
2174
+ pe as FIXTURE_COURSE_ID,
2175
+ zr as FilterChips,
2176
+ Nn as GET_MODULES,
2177
+ Dn as GET_MODULE_ITEMS,
2178
+ Me as INLINE_ITEM_LIMIT,
2179
+ Te as INLINE_QUERY_NODE_BUDGET,
2180
+ un as InMemoryCourseMismatchError,
2181
+ Dr as MODULES_FILTER_IDS,
2182
+ to as ModuleCard,
2183
+ Kr as ModuleItemRow,
2184
+ tt as ModuleItemSchema,
2185
+ jr as ModuleItemStatusPill,
2186
+ en as ModuleItemStatusSchema,
2187
+ Jt as ModuleItemTypeSchema,
2188
+ ln as ModuleItemsPageSchema,
2189
+ Vr as ModuleNumberBadge,
2190
+ sn as ModuleProgressSchema,
2191
+ rn as ModuleSchema,
2192
+ Gr as ModuleStatusPill,
2193
+ tn as ModuleStatusSchema,
2194
+ Ho as ModulesConfigProvider,
2195
+ Rn as ModulesConfigSchema,
2196
+ si as ModulesI18nProvider,
2197
+ ri as ModulesList,
2198
+ on as ModulesPageSchema,
2199
+ nt as PageInfoSchema,
2200
+ ot as PartialCanvasResponseError,
2201
+ kn as RegistryEntrySchema,
2202
+ fe as baseModulesConfig,
2203
+ Ie as buildFixture,
2204
+ ai as courseEmpty,
2205
+ li as courseFatModule,
2206
+ ui as courseItemLinks,
2207
+ ii as courseLarge,
2208
+ oi as courseSmall,
2209
+ Wo as createCanvasGraphqlAdapter,
2220
2210
  Qo as createInMemoryAdapter,
2221
- Et as createTranslate,
2222
- Er as defaultTranslate,
2223
- Fr as filterLabel,
2224
- cn as getEstimatedDurationMinutes,
2225
- si as invalidateCourse,
2226
- ti as invalidateModuleItems,
2227
- ni as invalidateModuleList,
2228
- Y as mergeRegistry,
2229
- Gr as moduleItemStatusLabel,
2230
- yt as moduleItemsPrefix,
2231
- Br as moduleStatusLabel,
2232
- te as modulesKeys,
2233
- $n as modulesListPrefix,
2234
- Xo as partialModulesConfig,
2235
- Fn as registrySchema,
2236
- Un as resolveModulesConfig,
2237
- Jo as useModuleItems,
2238
- Bn as useModules,
2239
- Vo as useModulesConfig,
2240
- k as useModulesI18n,
2241
- ei as useModulesPageData,
2242
- Zo as visibleEntries,
2243
- it as withEstimatedDurationMinutes
2211
+ Pt as createTranslate,
2212
+ Tr as defaultTranslate,
2213
+ kr as filterLabel,
2214
+ an as getEstimatedDurationMinutes,
2215
+ ni as invalidateCourse,
2216
+ ei as invalidateModuleItems,
2217
+ ti as invalidateModuleList,
2218
+ O as mergeRegistry,
2219
+ Br as moduleItemStatusLabel,
2220
+ Mt as moduleItemsPrefix,
2221
+ $r as moduleStatusLabel,
2222
+ ee as modulesKeys,
2223
+ Un as modulesListPrefix,
2224
+ Zo as partialModulesConfig,
2225
+ qn as registrySchema,
2226
+ Fn as resolveModulesConfig,
2227
+ Xo as useModuleItems,
2228
+ On as useModules,
2229
+ Ko as useModulesConfig,
2230
+ N as useModulesI18n,
2231
+ Jo as useModulesPageData,
2232
+ Vo as visibleEntries,
2233
+ rt as withEstimatedDurationMinutes
2244
2234
  };