@instructure/platform-modules 0.3.0 → 1.0.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.
Files changed (108) hide show
  1. package/README.md +3 -2
  2. package/dist/adapters/canvasGraphql/index.d.ts +4 -40
  3. package/dist/adapters/canvasGraphql/index.d.ts.map +1 -1
  4. package/dist/adapters/canvasGraphql/normalize.d.ts +9 -220
  5. package/dist/adapters/canvasGraphql/normalize.d.ts.map +1 -1
  6. package/dist/adapters/canvasGraphql/queries.d.ts +7 -49
  7. package/dist/adapters/canvasGraphql/queries.d.ts.map +1 -1
  8. package/dist/adapters/inMemory.d.ts +0 -40
  9. package/dist/adapters/inMemory.d.ts.map +1 -1
  10. package/dist/adapters/limits.d.ts +3 -81
  11. package/dist/adapters/limits.d.ts.map +1 -1
  12. package/dist/adapters/types.d.ts +11 -61
  13. package/dist/adapters/types.d.ts.map +1 -1
  14. package/dist/cache/invalidate.d.ts +0 -46
  15. package/dist/cache/invalidate.d.ts.map +1 -1
  16. package/dist/cache/keys.d.ts +3 -55
  17. package/dist/cache/keys.d.ts.map +1 -1
  18. package/dist/components/FilterChips.d.ts +4 -17
  19. package/dist/components/FilterChips.d.ts.map +1 -1
  20. package/dist/components/ModuleCard.d.ts +5 -29
  21. package/dist/components/ModuleCard.d.ts.map +1 -1
  22. package/dist/components/ModuleCard.stories.d.ts +14 -1
  23. package/dist/components/ModuleCard.stories.d.ts.map +1 -1
  24. package/dist/components/ModuleItemRow.d.ts +0 -10
  25. package/dist/components/ModuleItemRow.d.ts.map +1 -1
  26. package/dist/components/ModuleNumberBadge.d.ts +0 -1
  27. package/dist/components/ModuleNumberBadge.d.ts.map +1 -1
  28. package/dist/components/ModulesList.d.ts +2 -54
  29. package/dist/components/ModulesList.d.ts.map +1 -1
  30. package/dist/components/ModulesList.stories.d.ts +11 -128
  31. package/dist/components/ModulesList.stories.d.ts.map +1 -1
  32. package/dist/components/StatusPill.d.ts +4 -6
  33. package/dist/components/StatusPill.d.ts.map +1 -1
  34. package/dist/components/index.d.ts +1 -1
  35. package/dist/components/index.d.ts.map +1 -1
  36. package/dist/components/labels.d.ts +8 -78
  37. package/dist/components/labels.d.ts.map +1 -1
  38. package/dist/components/lightThemeDecorator.d.ts +3 -0
  39. package/dist/components/lightThemeDecorator.d.ts.map +1 -0
  40. package/dist/config/base.d.ts +0 -5
  41. package/dist/config/base.d.ts.map +1 -1
  42. package/dist/config/capabilities.d.ts +8 -0
  43. package/dist/config/capabilities.d.ts.map +1 -0
  44. package/dist/config/context.d.ts +1 -2
  45. package/dist/config/context.d.ts.map +1 -1
  46. package/dist/config/filters.d.ts +15 -0
  47. package/dist/config/filters.d.ts.map +1 -0
  48. package/dist/config/formatters.d.ts +15 -0
  49. package/dist/config/formatters.d.ts.map +1 -0
  50. package/dist/config/index.d.ts +9 -4
  51. package/dist/config/index.d.ts.map +1 -1
  52. package/dist/config/itemMeta.d.ts +5 -0
  53. package/dist/config/itemMeta.d.ts.map +1 -0
  54. package/dist/config/itemTypes.d.ts +4 -0
  55. package/dist/config/itemTypes.d.ts.map +1 -0
  56. package/dist/config/partialModulesConfig.d.ts +0 -1
  57. package/dist/config/partialModulesConfig.d.ts.map +1 -1
  58. package/dist/config/registry.d.ts +2 -30
  59. package/dist/config/registry.d.ts.map +1 -1
  60. package/dist/config/resolve.d.ts +0 -4
  61. package/dist/config/resolve.d.ts.map +1 -1
  62. package/dist/config/schemas.d.ts +37 -7
  63. package/dist/config/schemas.d.ts.map +1 -1
  64. package/dist/config/types.d.ts +8 -14
  65. package/dist/config/types.d.ts.map +1 -1
  66. package/dist/config/useFormatters.d.ts +10 -0
  67. package/dist/config/useFormatters.d.ts.map +1 -0
  68. package/dist/fixtures/generate.d.ts +1 -37
  69. package/dist/fixtures/generate.d.ts.map +1 -1
  70. package/dist/fixtures/index.d.ts +1 -1
  71. package/dist/fixtures/index.d.ts.map +1 -1
  72. package/dist/fixtures/scenarios.d.ts +4 -34
  73. package/dist/fixtures/scenarios.d.ts.map +1 -1
  74. package/dist/hooks/constants.d.ts +6 -40
  75. package/dist/hooks/constants.d.ts.map +1 -1
  76. package/dist/hooks/queryOptions.d.ts +2 -26
  77. package/dist/hooks/queryOptions.d.ts.map +1 -1
  78. package/dist/hooks/useItemsMode.d.ts +3 -84
  79. package/dist/hooks/useItemsMode.d.ts.map +1 -1
  80. package/dist/hooks/useModuleItemQueries.d.ts +1 -45
  81. package/dist/hooks/useModuleItemQueries.d.ts.map +1 -1
  82. package/dist/hooks/useModuleItems.d.ts +0 -16
  83. package/dist/hooks/useModuleItems.d.ts.map +1 -1
  84. package/dist/hooks/useModules.d.ts +3 -24
  85. package/dist/hooks/useModules.d.ts.map +1 -1
  86. package/dist/hooks/useModulesPageData.d.ts +9 -33
  87. package/dist/hooks/useModulesPageData.d.ts.map +1 -1
  88. package/dist/i18n.d.ts +8 -45
  89. package/dist/i18n.d.ts.map +1 -1
  90. package/dist/index.d.ts +5 -12
  91. package/dist/index.d.ts.map +1 -1
  92. package/dist/index.js +1874 -1344
  93. package/dist/types/domain.d.ts +9 -87
  94. package/dist/types/domain.d.ts.map +1 -1
  95. package/dist/types/enums.d.ts +5 -58
  96. package/dist/types/enums.d.ts.map +1 -1
  97. package/dist/types/extensions.d.ts +0 -43
  98. package/dist/types/extensions.d.ts.map +1 -1
  99. package/dist/types/filterClause.d.ts +18 -0
  100. package/dist/types/filterClause.d.ts.map +1 -0
  101. package/dist/types/index.d.ts +3 -2
  102. package/dist/types/index.d.ts.map +1 -1
  103. package/dist/types/navigation.d.ts +0 -6
  104. package/dist/types/navigation.d.ts.map +1 -1
  105. package/dist/types/schemas.d.ts +2 -28
  106. package/dist/types/schemas.d.ts.map +1 -1
  107. package/locales/en.json +20 -9
  108. package/package.json +35 -31
package/dist/index.js CHANGED
@@ -1,25 +1,37 @@
1
- import { z as d } from "zod";
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([
1
+ import { z as c } from "zod";
2
+ import { gql as de } from "graphql-tag";
3
+ import { jsx as i, jsxs as _ } from "react/jsx-runtime";
4
+ import { createContext as bt, useContext as St, useMemo as R, isValidElement as Mt, useCallback as F, useRef as Y, useState as ae, useEffect as Le, useId as $e, memo as yt, Fragment as _t } from "react";
5
+ import { PlugInstUIIcon as mn, ExternalLinkInstUIIcon as pn, FileInstUIIcon as gn, FileTextInstUIIcon as fn, MessagesSquareInstUIIcon as hn, RocketInstUIIcon as In, FilePenLineInstUIIcon as bn, IconLockLine as Tt, IconWarningLine as Pe, IconCompleteLine as Ce, IconClockLine as Et, IconArrowNestLine as Sn, IconArrowOpenUpLine as Mn, IconArrowOpenDownLine as Pt, IconSearchLine as yn } from "@instructure/ui-icons";
6
+ import { useInfiniteQuery as Qe, useQueryClient as Ct, InfiniteQueryObserver as _n } from "@tanstack/react-query";
7
+ import Tn from "p-limit";
8
+ import { Button as le, IconButton as En } from "@instructure/ui-buttons/v11_7";
9
+ import { Flex as S } from "@instructure/ui-flex/v11_7";
10
+ import { Text as P } from "@instructure/ui-text/v11_7";
11
+ import { View as T } from "@instructure/ui-view/v11_7";
12
+ import { TruncateWithTooltip as Pn, politeAnnounce as wt, getLiveRegion as Lt } from "@instructure/platform-instui-bindings";
13
+ import { Alert as At } from "@instructure/ui-alerts/v11_7";
14
+ import { Heading as vt } from "@instructure/ui-heading/v11_7";
15
+ import { ProgressBar as Cn } from "@instructure/ui-progress/v11_7";
16
+ import { Spinner as xt } from "@instructure/ui-spinner/v11_7";
17
+ import { useTheme as Rt } from "@instructure/emotion";
18
+ import { ScreenReaderContent as Je } from "@instructure/ui-a11y-content";
19
+ import { Link as wn } from "@instructure/ui-link/v11_7";
20
+ import { Pill as Ln } from "@instructure/ui-pill/v11_7";
21
+ import { WithBreakpoints as An } from "@instructure/platform-with-breakpoints";
22
+ import { Menu as Ue } from "@instructure/ui-menu/v11_7";
23
+ import { TextInput as vn } from "@instructure/ui-text-input/v11_7";
24
+ const xn = c.object({
25
+ target: c.enum(["module", "item"]),
26
+ field: c.string(),
27
+ op: c.enum(["eq", "contains"]),
28
+ value: c.union([c.string(), c.boolean()])
29
+ }).strict();
30
+ function Rn(e, t) {
31
+ const n = e == null ? void 0 : e[t.target];
32
+ return !n || !Object.prototype.hasOwnProperty.call(n, t.field) ? !1 : n[t.field].includes(t.op);
33
+ }
34
+ const Dn = c.enum([
23
35
  "assignment",
24
36
  "quiz",
25
37
  "discussion",
@@ -28,7 +40,24 @@ const Jt = d.enum([
28
40
  "external_url",
29
41
  "external_tool",
30
42
  "sub_header"
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([
43
+ ]), Nn = c.enum([
44
+ "not_started",
45
+ "in_progress",
46
+ "complete",
47
+ "submitted",
48
+ "graded",
49
+ "excused",
50
+ "missing",
51
+ "locked"
52
+ ]), qn = c.enum([
53
+ "not_started",
54
+ "in_progress",
55
+ "complete",
56
+ "missing",
57
+ "incomplete",
58
+ "missing_and_incomplete",
59
+ "locked"
60
+ ]), kn = c.enum([
32
61
  "must_view",
33
62
  "must_mark_done",
34
63
  "must_contribute",
@@ -36,140 +65,176 @@ const Jt = d.enum([
36
65
  "min_score",
37
66
  "min_percentage",
38
67
  "unknown"
39
- ]), sn = d.object({
40
- status: tn,
41
- requirementsMet: d.number(),
42
- requirementCount: d.number(),
43
- percentComplete: d.number().min(0).max(100),
44
- latestDueAt: d.string().nullish(),
45
- missingCount: d.number()
46
- }), et = d.object({
47
- itemId: d.string(),
48
- type: nn,
49
- minScore: d.number().nullish(),
50
- minPercentage: d.number().nullish()
51
- }), tt = d.object({
52
- id: d.string(),
53
- moduleId: d.string(),
54
- title: d.string(),
55
- type: Jt,
56
- position: d.number(),
57
- indent: d.number(),
58
- published: d.boolean(),
59
- url: d.string().nullish(),
60
- newTab: d.boolean().nullish(),
61
- completionRequirement: et.nullish(),
62
- dueAt: d.string().nullish(),
63
- status: en.optional(),
64
- pointsPossible: d.number().nullish(),
65
- extensions: d.record(d.unknown()).optional()
66
- }), rn = d.object({
67
- id: d.string(),
68
- name: d.string(),
69
- position: d.number(),
70
- published: d.boolean(),
71
- itemCount: d.number(),
72
- items: d.array(tt).optional(),
73
- unlockAt: d.string().nullish(),
74
- prerequisiteModuleIds: d.array(d.string()),
75
- requirementCount: d.number().nullish(),
76
- requireSequentialProgress: d.boolean(),
77
- completionRequirements: d.array(et).optional(),
78
- progress: sn.optional(),
79
- extensions: d.record(d.unknown()).optional()
80
- }), nt = d.object({
81
- hasNextPage: d.boolean(),
82
- endCursor: d.string().nullable()
68
+ ]), On = c.object({
69
+ status: qn.optional(),
70
+ requirementsMet: c.number(),
71
+ requirementCount: c.number(),
72
+ percentComplete: c.number().min(0).max(100),
73
+ latestDueAt: c.string().nullish(),
74
+ missingCount: c.number(),
75
+ incompleteCount: c.number()
76
+ }), Dt = c.object({
77
+ itemId: c.string(),
78
+ type: kn,
79
+ minScore: c.number().nullish(),
80
+ minPercentage: c.number().nullish()
81
+ }), Nt = c.object({
82
+ id: c.string(),
83
+ moduleId: c.string(),
84
+ title: c.string(),
85
+ type: Dn,
86
+ position: c.number(),
87
+ indent: c.number(),
88
+ published: c.boolean(),
89
+ url: c.string().nullish(),
90
+ newTab: c.boolean().nullish(),
91
+ completionRequirement: Dt.nullish(),
92
+ dueAt: c.string().nullish(),
93
+ status: Nn.optional(),
94
+ pointsPossible: c.number().nullish(),
95
+ extensions: c.record(c.unknown()).optional()
96
+ }), Fn = c.object({
97
+ id: c.string(),
98
+ name: c.string()
99
+ }), Un = c.object({
100
+ id: c.string(),
101
+ name: c.string(),
102
+ position: c.number(),
103
+ published: c.boolean(),
104
+ itemCount: c.number(),
105
+ items: c.array(Nt).optional(),
106
+ unlockAt: c.string().nullish(),
107
+ prerequisiteModules: c.array(Fn),
108
+ requirementCount: c.number().nullish(),
109
+ requireSequentialProgress: c.boolean(),
110
+ completionRequirements: c.array(Dt).optional(),
111
+ progress: On.optional(),
112
+ extensions: c.record(c.unknown()).optional()
113
+ }), qt = c.object({
114
+ hasNextPage: c.boolean(),
115
+ endCursor: c.string().nullable()
83
116
  }).refine((e) => !e.hasNextPage || e.endCursor !== null, {
84
117
  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
118
  path: ["endCursor"]
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) {
119
+ }), zn = c.object({
120
+ modules: c.array(Un),
121
+ pageInfo: qt
122
+ }), $n = c.object({
123
+ items: c.array(Nt),
124
+ pageInfo: qt
125
+ }), kt = "career.estimatedDurationMinutes";
126
+ function Bn(e) {
94
127
  var n;
95
- const t = (n = e.extensions) == null ? void 0 : n[st];
128
+ const t = (n = e.extensions) == null ? void 0 : n[kt];
96
129
  return typeof t != "number" || !Number.isFinite(t) || t <= 0 ? null : t;
97
130
  }
98
- function rt(e, t) {
99
- return t == null ? e : { ...e, [st]: t };
131
+ function He(e, t) {
132
+ return t == null ? e : { ...e, [kt]: t };
100
133
  }
101
- const Me = 100, Te = 2e3;
102
- class un extends Error {
134
+ const Be = 100, Ve = 2e3;
135
+ class jn extends Error {
103
136
  constructor(t, n) {
104
137
  super(
105
138
  `This in-memory adapter was built for course ${t} but was asked for course ${n}. A fixture serves exactly one course.`
106
139
  ), this.name = "InMemoryCourseMismatchError", this.expected = t, this.received = n;
107
140
  }
108
141
  }
109
- const cn = (e) => `offset:${e}`, dn = (e) => {
142
+ const Gn = (e) => `offset:${e}`, Yn = (e) => {
110
143
  if (!e) return 0;
111
144
  const t = Number.parseInt(e.replace("offset:", ""), 10);
112
145
  return Number.isFinite(t) && t >= 0 ? t : 0;
113
- }, Ce = (e) => {
146
+ }, et = (e) => {
114
147
  if (e != null && e.aborted)
115
148
  throw new DOMException("The operation was aborted.", "AbortError");
116
149
  };
117
- function Le(e, t, n) {
118
- const s = dn(t), r = e.slice(s, s + n), i = s + r.length, u = i < e.length;
150
+ function tt(e, t, n) {
151
+ const o = Yn(t), r = e.slice(o, o + n), s = o + r.length, l = s < e.length;
119
152
  return {
120
153
  slice: r,
121
- pageInfo: { hasNextPage: u, endCursor: u ? cn(i) : null }
154
+ pageInfo: { hasNextPage: l, endCursor: l ? Gn(s) : null }
122
155
  };
123
156
  }
124
- function Qo(e, t = {}) {
125
- const n = (r) => e.itemsByModuleId[r] ?? [], s = (r) => {
157
+ const Wn = /* @__PURE__ */ new Map([
158
+ ["COMPLETED", (e) => {
159
+ var t;
160
+ return ((t = e.progress) == null ? void 0 : t.status) === "complete";
161
+ }],
162
+ ["IN_PROGRESS", (e) => {
163
+ var t;
164
+ return ((t = e.progress) == null ? void 0 : t.status) === "in_progress";
165
+ }],
166
+ ["INCOMPLETE", (e) => {
167
+ var t;
168
+ return ((t = e.progress) == null ? void 0 : t.status) !== "complete";
169
+ }],
170
+ [
171
+ "NOT_STARTED",
172
+ (e) => {
173
+ var t, n;
174
+ return ((t = e.progress) == null ? void 0 : t.status) !== "complete" && ((n = e.progress) == null ? void 0 : n.status) !== "in_progress";
175
+ }
176
+ ]
177
+ ]), Qn = { module: { completionStatus: ["eq"] } };
178
+ function Hn(e) {
179
+ if (e.target !== "module" || e.field !== "completionStatus" || e.op !== "eq")
180
+ throw new Error(
181
+ `in-memory adapter cannot compile ${e.target}.${e.field} ${e.op}`
182
+ );
183
+ const t = typeof e.value == "string" ? Wn.get(e.value) : void 0;
184
+ if (!t) throw new Error(`unknown completionStatus "${String(e.value)}"`);
185
+ return t;
186
+ }
187
+ function yl(e, t = {}) {
188
+ const n = (r) => e.itemsByModuleId[r] ?? [], o = (r) => {
126
189
  if (r !== e.courseId)
127
- throw new un(e.courseId, r);
190
+ throw new jn(e.courseId, r);
128
191
  };
129
192
  return {
193
+ capabilities: Qn,
130
194
  async listModules({
131
195
  courseId: r,
132
- cursor: i,
133
- pageSize: u,
196
+ cursor: s,
197
+ pageSize: l,
134
198
  includeItems: a,
135
- inlineItemsFirst: c,
136
- signal: g
199
+ filter: d,
200
+ inlineItemsFirst: m,
201
+ signal: u
137
202
  }) {
138
- var f;
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), S = Math.min(c ?? Me, Me);
141
- return { modules: l.map((h) => {
142
- const w = n(h.id), x = a && w.length <= S;
143
- return { ...h, itemCount: w.length, items: x ? w : void 0 };
144
- }), pageInfo: m };
203
+ var C;
204
+ et(u), o(r), (C = t.onRequest) == null || C.call(t, "listModules", { operation: "listModules", courseId: r });
205
+ const p = d ? e.modules.filter(Hn(d)) : e.modules, { slice: g, pageInfo: f } = tt(p, s, l), h = Math.min(m ?? Be, Be);
206
+ return { modules: g.map((E) => {
207
+ const M = n(E.id), D = a && M.length <= h;
208
+ return { ...E, itemCount: M.length, items: D ? M : void 0 };
209
+ }), pageInfo: f };
145
210
  },
146
211
  async listModuleItems({
147
212
  courseId: r,
148
- moduleId: i,
149
- cursor: u,
213
+ moduleId: s,
214
+ cursor: l,
150
215
  pageSize: a,
151
- signal: c
216
+ signal: d
152
217
  }) {
153
- var m;
154
- Ce(c), s(r), (m = t.onRequest) == null || m.call(t, "listModuleItems", { operation: "listModuleItems", courseId: r, moduleId: i });
155
- const { slice: g, pageInfo: l } = Le(n(i), u, a);
156
- return { items: g, pageInfo: l };
218
+ var p;
219
+ et(d), o(r), (p = t.onRequest) == null || p.call(t, "listModuleItems", { operation: "listModuleItems", courseId: r, moduleId: s });
220
+ const { slice: m, pageInfo: u } = tt(n(s), l, a);
221
+ return { items: m, pageInfo: u };
157
222
  }
158
223
  };
159
224
  }
160
- class ot extends Error {
161
- constructor(t, n, s) {
225
+ class Ot extends Error {
226
+ constructor(t, n, o) {
162
227
  const r = t === "module" ? "module" : "module item";
163
228
  super(
164
- `Canvas returned ${r} ${n} without a usable ${s}. This is a partial response; refusing to guess a value for it.`
165
- ), this.name = "PartialCanvasResponseError", this.subject = t, this.id = n, this.field = s;
229
+ `Canvas returned ${r} ${n} without a usable ${o}. This is a partial response; refusing to guess a value for it.`
230
+ ), this.name = "PartialCanvasResponseError", this.subject = t, this.id = n, this.field = o;
166
231
  }
167
232
  }
168
- function it(e, t, n) {
233
+ function Ft(e, t, n) {
169
234
  if (e != null) return e;
170
- throw new ot(t, n, "published");
235
+ throw new Ot(t, n, "published");
171
236
  }
172
- function mn(e, t) {
237
+ function Vn(e, t) {
173
238
  if (e.onUnsupportedItem) {
174
239
  e.onUnsupportedItem(t);
175
240
  return;
@@ -178,39 +243,33 @@ function mn(e, t) {
178
243
  `[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
244
  );
180
245
  }
181
- const gn = {
246
+ const Kn = {
182
247
  Assignment: "assignment",
183
248
  Quiz: "quiz",
184
249
  Discussion: "discussion",
185
250
  Page: "page",
186
251
  File: "file",
187
252
  ExternalUrl: "external_url",
188
- // Canvas models an LTI placement in a module as `ModuleExternalTool` and a
189
- // course-level tool as `ExternalTool`; both render identically here.
190
253
  ModuleExternalTool: "external_tool",
191
254
  ExternalTool: "external_tool",
192
255
  SubHeader: "sub_header",
193
- // `PeerReviewSubAssignmentType < Types::AssignmentType` on master, so it
194
- // inherits `ModuleItemInterface` and is assignment-shaped down to
195
- // `pointsPossible`, `dueAt` and `submissionsConnection`. It was being dropped
196
- // for no better reason than not being listed.
197
256
  PeerReviewSubAssignment: "assignment"
198
257
  };
199
- function fn(e) {
258
+ function Zn(e) {
200
259
  const t = e == null ? void 0 : e.__typename;
201
260
  if (!t) return null;
202
- const n = gn[t];
261
+ const n = Kn[t];
203
262
  return n ? n === "assignment" && (e == null ? void 0 : e.isNewQuiz) === !0 ? "quiz" : n : null;
204
263
  }
205
- const hn = /^P(?!$)(?:(\d+(?:\.\d+)?)W)?(?:(\d+(?:\.\d+)?)D)?(?:T(?!$)(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?)?$/;
206
- function pn(e) {
264
+ const Xn = /^P(?!$)(?:(\d+(?:\.\d+)?)W)?(?:(\d+(?:\.\d+)?)D)?(?:T(?!$)(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?)?$/;
265
+ function Jn(e) {
207
266
  if (!e) return null;
208
- const t = hn.exec(e);
267
+ const t = Xn.exec(e);
209
268
  if (!t) return null;
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;
269
+ const [, n, o, r, s, l] = t, a = Number(n ?? 0) * 7 * 24 * 60 + Number(o ?? 0) * 24 * 60 + Number(r ?? 0) * 60 + Number(s ?? 0) + Number(l ?? 0) / 60;
211
270
  return Math.round(a);
212
271
  }
213
- const In = /* @__PURE__ */ new Set([
272
+ const eo = /* @__PURE__ */ new Set([
214
273
  "must_view",
215
274
  "must_mark_done",
216
275
  "must_contribute",
@@ -218,171 +277,182 @@ const In = /* @__PURE__ */ new Set([
218
277
  "min_score",
219
278
  "min_percentage"
220
279
  ]);
221
- function bn(e) {
222
- return In.has(e) ? e : "unknown";
280
+ function to(e) {
281
+ return eo.has(e) ? e : "unknown";
223
282
  }
224
- function Mn(e) {
283
+ function no(e) {
225
284
  return {
226
285
  itemId: String(e.id),
227
- type: bn(e.type),
286
+ type: to(e.type),
228
287
  minScore: e.minScore ?? null,
229
288
  minPercentage: e.minPercentage ?? null
230
289
  };
231
290
  }
232
- function lt(e) {
291
+ function Ut(e) {
233
292
  return {
234
293
  hasNextPage: (e == null ? void 0 : e.hasNextPage) ?? !1,
235
294
  endCursor: (e == null ? void 0 : e.endCursor) ?? null
236
295
  };
237
296
  }
238
- const Sn = /* @__PURE__ */ new Set(["graded"]), yn = /* @__PURE__ */ new Set(["submitted", "pending_review"]), _n = /* @__PURE__ */ new Set(["graded", "excused"]);
239
- function at(e) {
297
+ const oo = /* @__PURE__ */ new Set(["graded"]), ro = /* @__PURE__ */ new Set(["submitted", "pending_review"]), so = /* @__PURE__ */ new Set(["graded"]);
298
+ function zt(e) {
240
299
  var t;
241
300
  for (const n of ((t = e == null ? void 0 : e.submissionsConnection) == null ? void 0 : t.nodes) ?? [])
242
301
  if (n) return n;
243
302
  return null;
244
303
  }
245
- function ut(e, t) {
304
+ function $t(e, t) {
246
305
  if (!e) return;
247
- const n = new Map(t.map((r) => [r.itemId, r.type])), s = /* @__PURE__ */ new Set();
248
- for (const r of e.requirementsMet ?? []) {
249
- if (!r) continue;
250
- const i = String(r.id);
251
- n.get(i) === r.type && s.add(i);
306
+ const n = new Map(t.map((s) => [s.itemId, s.type])), o = /* @__PURE__ */ new Set();
307
+ for (const s of e.requirementsMet ?? []) {
308
+ if (!s) continue;
309
+ const l = String(s.id);
310
+ n.get(l) === s.type && o.add(l);
311
+ }
312
+ const r = /* @__PURE__ */ new Set();
313
+ for (const s of e.incompleteRequirements ?? []) {
314
+ if (!s || s.score == null) continue;
315
+ const l = String(s.id);
316
+ n.get(l) === s.type && r.add(l);
252
317
  }
253
318
  return {
254
319
  locked: e.locked === !0 || e.workflowState === "locked",
255
320
  workflowState: e.workflowState ?? null,
256
321
  completed: e.completed === !0 || e.workflowState === "completed",
257
322
  started: e.started === !0 || e.workflowState === "started",
258
- requirementsMetItemIds: s
323
+ requirementsMetItemIds: o,
324
+ incompleteRequirementItemIds: r
259
325
  };
260
326
  }
261
- function Tn(e, t, n) {
327
+ function io(e, t, n, o = !0) {
262
328
  if (n.locked) return "locked";
263
- const s = at(e);
264
- if (s) {
265
- if (s.missing === !0) return "missing";
266
- if (Sn.has(s.state ?? "") || _n.has(s.gradingStatus ?? ""))
329
+ const r = zt(e);
330
+ if (r) {
331
+ if (r.gradingStatus === "excused") return "excused";
332
+ if (r.missing === !0) return "missing";
333
+ if (oo.has(r.state ?? "") || so.has(r.gradingStatus ?? ""))
267
334
  return "graded";
268
- if (s.submittedAt != null || yn.has(s.state ?? ""))
335
+ if (r.submittedAt != null || ro.has(r.state ?? ""))
269
336
  return "submitted";
270
- if ((s.attempt ?? 0) > 0) return "in_progress";
271
- }
272
- return n.requirementsMetItemIds.has(t) ? "in_progress" : "not_started";
273
- }
274
- const Pn = (e) => e.pointsPossible != null;
275
- function wn(e, t, n, s) {
276
- if (e.locked) return "locked";
277
- if (t > 0 && !e.completed) return "missing";
278
- if (e.completed) {
279
- const r = (s ?? []).filter(Pn);
280
- return r.length > 0 && r.every((u) => u.status === "graded") ? "all_graded" : "all_submitted";
337
+ if ((r.attempt ?? 0) > 0) return "in_progress";
281
338
  }
282
- return e.started || n > 0 ? "in_progress" : "not_started";
339
+ return n.requirementsMetItemIds.has(t) ? o ? "complete" : "in_progress" : "not_started";
340
+ }
341
+ const lo = {
342
+ LOCKED: "locked",
343
+ MISSING: "missing",
344
+ MISSING_AND_INCOMPLETE: "missing_and_incomplete",
345
+ INCOMPLETE: "incomplete",
346
+ COMPLETE: "complete",
347
+ IN_PROGRESS: "in_progress",
348
+ NOT_STARTED: "not_started"
349
+ };
350
+ function ao(e) {
351
+ if (e != null)
352
+ return lo[e];
283
353
  }
284
- function En(e, t, n, s) {
285
- var a, c;
354
+ function uo(e, t, n) {
355
+ var a, d;
286
356
  if (!n) return;
287
- const r = e.requirementCount ?? t.length, i = Math.min(n.requirementsMetItemIds.size, r), u = ((a = e.submissionStatistics) == null ? void 0 : a.missingAssignmentCount) ?? 0;
357
+ const o = e.requirementCount ?? t.length, r = Math.min(n.requirementsMetItemIds.size, o), s = ((a = e.submissionStatistics) == null ? void 0 : a.missingAssignmentCount) ?? 0, l = n.incompleteRequirementItemIds.size;
288
358
  return {
289
- status: wn(n, u, i, s),
290
- requirementsMet: i,
291
- requirementCount: r,
292
- percentComplete: r > 0 ? Math.round(i / r * 100) : 0,
293
- latestDueAt: ((c = e.submissionStatistics) == null ? void 0 : c.latestDueAt) ?? null,
294
- missingCount: u
359
+ status: ao(e.moduleStatus) ?? (n.locked ? "locked" : void 0),
360
+ requirementsMet: r,
361
+ requirementCount: o,
362
+ percentComplete: o > 0 ? Math.round(r / o * 100) : 0,
363
+ latestDueAt: ((d = e.submissionStatistics) == null ? void 0 : d.latestDueAt) ?? null,
364
+ missingCount: s,
365
+ incompleteCount: l
295
366
  };
296
367
  }
297
- function xn(e, t, n, s = {}, r) {
298
- var c, g, l;
299
- const i = String(e._id), u = fn(e.content);
300
- if (!u)
301
- return mn(s, { id: i, typename: ((c = e.content) == null ? void 0 : c.__typename) ?? null }), null;
302
- const a = at(e.content);
368
+ function co(e, t, n, o = {}, r) {
369
+ var d, m, u;
370
+ const s = String(e._id), l = Zn(e.content);
371
+ if (!l)
372
+ return Vn(o, { id: s, typename: ((d = e.content) == null ? void 0 : d.__typename) ?? null }), null;
373
+ const a = zt(e.content);
303
374
  return {
304
- id: i,
375
+ id: s,
305
376
  moduleId: t,
306
377
  title: e.title ?? "",
307
- type: u,
378
+ type: l,
308
379
  position: e.position ?? 0,
309
380
  indent: e.indent ?? 0,
310
- published: it(e.published, "moduleItem", i),
381
+ published: Ft(e.published, "moduleItem", s),
311
382
  url: e.url ?? null,
312
383
  newTab: e.newTab ?? !1,
313
- completionRequirement: n.get(i) ?? null,
314
- dueAt: (a == null ? void 0 : a.cachedDueDate) ?? ((g = e.content) == null ? void 0 : g.dueAt) ?? null,
315
- status: r ? Tn(e.content, i, r) : void 0,
316
- pointsPossible: ((l = e.content) == null ? void 0 : l.pointsPossible) ?? null,
317
- // Career-only, so it rides in `extensions` rather than widening the shared
318
- // model. Absent entirely for a Canvas LMS item, which is every item here.
319
- extensions: rt(
384
+ completionRequirement: n.get(s) ?? null,
385
+ dueAt: (a == null ? void 0 : a.cachedDueDate) ?? ((m = e.content) == null ? void 0 : m.dueAt) ?? null,
386
+ status: r ? io(e.content, s, r, o.submissionsIncluded ?? !0) : void 0,
387
+ pointsPossible: ((u = e.content) == null ? void 0 : u.pointsPossible) ?? null,
388
+ extensions: He(
320
389
  void 0,
321
- pn(e.estimatedDuration)
390
+ Jn(e.estimatedDuration)
322
391
  )
323
392
  };
324
393
  }
325
- function ct(e, t, n, s, r) {
326
- const i = [];
327
- for (const u of e ?? []) {
328
- if (!u) continue;
329
- const a = xn(
330
- u,
394
+ function Bt(e, t, n, o, r) {
395
+ const s = [];
396
+ for (const l of e ?? []) {
397
+ if (!l) continue;
398
+ const a = co(
399
+ l,
331
400
  t,
332
401
  n,
333
- s,
402
+ o,
334
403
  r
335
404
  );
336
- a && i.push(a);
405
+ a && s.push(a);
337
406
  }
338
- return i;
407
+ return s;
339
408
  }
340
- function dt(e) {
409
+ function jt(e) {
341
410
  const t = [], n = /* @__PURE__ */ new Map();
342
- for (const s of e ?? []) {
343
- if (!s) continue;
344
- const r = Mn(s);
411
+ for (const o of e ?? []) {
412
+ if (!o) continue;
413
+ const r = no(o);
345
414
  t.push(r), n.set(r.itemId, r);
346
415
  }
347
416
  return { list: t, byItemId: n };
348
417
  }
349
- function Cn(e, t = {}) {
350
- var g;
418
+ function mo(e, t = {}) {
419
+ var m;
351
420
  const n = String(e._id);
352
421
  if (e.moduleItemsTotalCount == null)
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;
422
+ throw new Ot("module", n, "moduleItemsTotalCount");
423
+ const { list: o, byItemId: r } = jt(e.completionRequirements), s = e.moduleItemsConnection, l = s != null && !((m = s.pageInfo) != null && m.hasNextPage), a = $t(e.progression, o), d = l ? Bt(s.nodes, n, r, t, a) : void 0;
355
424
  return {
356
425
  id: n,
357
426
  name: e.name ?? "",
358
427
  position: e.position ?? 0,
359
- published: it(e.published, "module", n),
428
+ published: Ft(e.published, "module", n),
360
429
  itemCount: e.moduleItemsTotalCount,
361
- items: c,
430
+ items: d,
362
431
  unlockAt: e.unlockAt ?? null,
363
- prerequisiteModuleIds: (e.prerequisites ?? []).filter((l) => l != null).map((l) => String(l.id)),
432
+ prerequisiteModules: (e.prerequisites ?? []).filter(
433
+ (u) => u != null
434
+ ).map((u) => ({ id: String(u.id), name: u.name ?? "" })),
364
435
  requirementCount: e.requirementCount ?? null,
365
436
  requireSequentialProgress: e.requireSequentialProgress ?? !1,
366
- completionRequirements: s,
367
- // Derived after the items so `all_graded` can see them when they are inline.
368
- progress: En(e, s, a, c)
437
+ completionRequirements: o,
438
+ progress: uo(e, o, a)
369
439
  };
370
440
  }
371
- function Ln(e, t = {}) {
441
+ function po(e, t = {}) {
372
442
  var r;
373
- const n = (r = e == null ? void 0 : e.legacyNode) == null ? void 0 : r.modulesConnection, s = [];
374
- for (const i of (n == null ? void 0 : n.nodes) ?? [])
375
- i && s.push(Cn(i, t));
376
- return { modules: s, pageInfo: lt(n == null ? void 0 : n.pageInfo) };
443
+ const n = (r = e == null ? void 0 : e.legacyNode) == null ? void 0 : r.modulesConnection, o = [];
444
+ for (const s of (n == null ? void 0 : n.nodes) ?? [])
445
+ s && o.push(mo(s, t));
446
+ return { modules: o, pageInfo: Ut(n == null ? void 0 : n.pageInfo) };
377
447
  }
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);
448
+ function go(e, t, n = {}) {
449
+ const o = e == null ? void 0 : e.legacyNode, { list: r, byItemId: s } = jt(o == null ? void 0 : o.completionRequirements), l = o == null ? void 0 : o.moduleItemsConnection, a = $t(o == null ? void 0 : o.progression, r);
380
450
  return {
381
- items: ct(u == null ? void 0 : u.nodes, t, i, n, a),
382
- pageInfo: lt(u == null ? void 0 : u.pageInfo)
451
+ items: Bt(l == null ? void 0 : l.nodes, t, s, n, a),
452
+ pageInfo: Ut(l == null ? void 0 : l.pageInfo)
383
453
  };
384
454
  }
385
- const vn = J`
455
+ const fo = de`
386
456
  fragment PlatformModulesSubmissionFields on Submission {
387
457
  _id
388
458
  state
@@ -392,7 +462,7 @@ const vn = J`
392
462
  missing
393
463
  cachedDueDate
394
464
  }
395
- `, mt = J`
465
+ `, Gt = de`
396
466
  fragment PlatformModulesItemFields on ModuleItem {
397
467
  _id
398
468
  title
@@ -439,8 +509,8 @@ const vn = J`
439
509
  }
440
510
  }
441
511
  }
442
- ${vn}
443
- `, gt = J`
512
+ ${fo}
513
+ `, Yt = de`
444
514
  fragment PlatformModulesProgressionFields on ModuleProgression {
445
515
  workflowState
446
516
  completed
@@ -452,8 +522,15 @@ const vn = J`
452
522
  minScore
453
523
  minPercentage
454
524
  }
525
+ incompleteRequirements {
526
+ id
527
+ type
528
+ minScore
529
+ minPercentage
530
+ score
531
+ }
455
532
  }
456
- `, Nn = J`
533
+ `, ho = de`
457
534
  query PlatformModulesGetModules(
458
535
  $courseId: ID!
459
536
  $first: Int!
@@ -462,10 +539,11 @@ const vn = J`
462
539
  $itemsFirst: Int!
463
540
  $includeSubmissions: Boolean!
464
541
  $studentId: ID
542
+ $filter: ModuleFilterInput
465
543
  ) {
466
544
  legacyNode(_id: $courseId, type: Course) {
467
545
  ... on Course {
468
- modulesConnection(first: $first, after: $after) {
546
+ modulesConnection(first: $first, after: $after, filter: $filter) {
469
547
  nodes {
470
548
  _id
471
549
  name
@@ -473,10 +551,12 @@ const vn = J`
473
551
  published
474
552
  unlockAt
475
553
  moduleItemsTotalCount
554
+ moduleStatus
476
555
  requirementCount
477
556
  requireSequentialProgress
478
557
  prerequisites {
479
558
  id
559
+ name
480
560
  }
481
561
  completionRequirements {
482
562
  id
@@ -509,9 +589,9 @@ const vn = J`
509
589
  }
510
590
  }
511
591
  }
512
- ${mt}
513
- ${gt}
514
- `, Dn = J`
592
+ ${Gt}
593
+ ${Yt}
594
+ `, Io = de`
515
595
  query PlatformModulesGetModuleItems(
516
596
  $moduleId: ID!
517
597
  $first: Int!
@@ -542,943 +622,1202 @@ const vn = J`
542
622
  }
543
623
  }
544
624
  }
545
- ${mt}
546
- ${gt}
625
+ ${Gt}
626
+ ${Yt}
547
627
  `;
548
- function ft() {
628
+ function Wt() {
549
629
  return new DOMException("The operation was aborted.", "AbortError");
550
630
  }
551
- function ae(e) {
552
- if (e != null && e.aborted) throw ft();
631
+ function Te(e) {
632
+ if (e != null && e.aborted) throw Wt();
553
633
  }
554
- function Ae(e, t) {
555
- return t ? new Promise((n, s) => {
556
- const r = () => s(ft());
557
- t.addEventListener("abort", r, { once: !0 }), e.then(n, s).finally(() => t.removeEventListener("abort", r));
634
+ function nt(e, t) {
635
+ return t ? new Promise((n, o) => {
636
+ const r = () => o(Wt());
637
+ t.addEventListener("abort", r, { once: !0 }), e.then(n, o).finally(() => t.removeEventListener("abort", r));
558
638
  }) : e;
559
639
  }
560
- function Wo({
640
+ const ot = [
641
+ "COMPLETED",
642
+ "INCOMPLETE",
643
+ "IN_PROGRESS",
644
+ "NOT_STARTED"
645
+ ], bo = {
646
+ module: { completionStatus: ["eq"] }
647
+ };
648
+ function So(e) {
649
+ if (!e) return null;
650
+ if (e.target !== "module" || e.field !== "completionStatus" || e.op !== "eq")
651
+ throw new Error(
652
+ `Canvas GraphQL cannot serve ${e.target}.${e.field} "${e.op}". Only module.completionStatus eq is compiled here.`
653
+ );
654
+ const t = e.value;
655
+ if (!ot.includes(t))
656
+ throw new Error(
657
+ `"${e.value}" is not a ModuleCompletionStatus (${ot.join(", ")}).`
658
+ );
659
+ return { completionStatus: t };
660
+ }
661
+ function _l({
561
662
  executeQuery: e,
562
- inlineItemLimit: t = Me,
563
- nodeBudget: n = Te,
564
- onUnsupportedItem: s,
663
+ inlineItemLimit: t = Be,
664
+ nodeBudget: n = Ve,
665
+ onUnsupportedItem: o,
565
666
  studentId: r,
566
- validate: i = !0
667
+ validate: s = !0,
668
+ capabilities: l = bo
567
669
  }) {
568
- const u = { onUnsupportedItem: s }, a = r != null;
670
+ const a = r != null, d = { onUnsupportedItem: o, submissionsIncluded: a };
569
671
  return {
570
- // Declared so `resolveItemsMode` bounds the query by *this* transport's
571
- // limit rather than assuming one. @see ModulesDataAdapter.inlineNodeBudget
572
672
  inlineNodeBudget: n,
673
+ capabilities: l,
573
674
  async listModules({
574
- courseId: c,
575
- cursor: g,
576
- pageSize: l,
577
- includeItems: m,
578
- inlineItemsFirst: S,
579
- inlineFirst: p,
580
- signal: f
675
+ courseId: m,
676
+ cursor: u,
677
+ pageSize: p,
678
+ includeItems: g,
679
+ filter: f,
680
+ inlineItemsFirst: h,
681
+ inlineFirst: I,
682
+ signal: C
581
683
  }) {
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
- courseId: c,
586
- first: h,
587
- // Pass through what the caller was given; never derive an offset.
588
- after: g ?? null,
589
- includeItems: m,
590
- itemsFirst: x,
684
+ Te(C);
685
+ const E = g ? Math.min(I ?? p, p) : p, M = Math.min(h ?? t, t), D = Math.max(1, Math.min(M, Math.floor(n / E))), q = await nt(
686
+ e(ho, {
687
+ courseId: m,
688
+ first: E,
689
+ after: u ?? null,
690
+ includeItems: g,
691
+ itemsFirst: D,
591
692
  includeSubmissions: a,
592
- studentId: r ?? null
693
+ studentId: r ?? null,
694
+ filter: So(f)
593
695
  }),
594
- f
696
+ C
595
697
  );
596
- ae(f);
597
- const C = Ln(L, u);
598
- return i ? on.parse(C) : C;
698
+ Te(C);
699
+ const N = po(q, d);
700
+ return s ? zn.parse(N) : N;
599
701
  },
600
702
  async listModuleItems({
601
- moduleId: c,
602
- cursor: g,
603
- pageSize: l,
604
- signal: m
703
+ moduleId: m,
704
+ cursor: u,
705
+ pageSize: p,
706
+ signal: g
605
707
  }) {
606
- ae(m);
607
- const S = await Ae(
608
- e(Dn, {
609
- moduleId: c,
610
- first: l,
611
- after: g ?? null,
708
+ Te(g);
709
+ const f = await nt(
710
+ e(Io, {
711
+ moduleId: m,
712
+ first: p,
713
+ after: u ?? null,
612
714
  includeSubmissions: a,
613
715
  studentId: r ?? null
614
716
  }),
615
- m
717
+ g
616
718
  );
617
- ae(m);
618
- const p = An(S, c, u);
619
- return i ? ln.parse(p) : p;
719
+ Te(g);
720
+ const h = go(f, m, d);
721
+ return s ? $n.parse(h) : h;
620
722
  }
621
723
  };
622
724
  }
623
- const fe = {
624
- formatters: {},
625
- itemTypes: {},
725
+ const Mo = "Course modules", yo = { one: "%{count} module loaded", other: "%{count} modules loaded" }, _o = "Search by name", To = "Search…", Eo = "Expand / collapse", Po = "Expand all", Co = "Collapse all", wo = "Search matches module names only — items of collapsed modules are not loaded.", Lo = "This filter runs on the modules loaded so far — load more to filter the rest of the course.", Ao = "Modules failed to load: %{message}", vo = "Loading modules", xo = "This course has no modules.", Ro = { one: "The only loaded module does not match this filter.", other: "None of the %{count} loaded modules match this filter." }, Do = "No modules match this filter.", No = "Clear filters", qo = "Loading more modules…", ko = "Load more modules (%{count} loaded)", Oo = { one: "The only module in this course is loaded.", other: "All %{count} modules in this course are loaded." }, Fo = "Filter", Uo = "All", zo = "In progress", $o = "Complete", Bo = "Due this week", jo = "Missing", Go = "Locked until prerequisites are met", Yo = "%{name} progress", Wo = { one: "%{loaded} of %{count} item loaded in %{name}", other: "%{loaded} of %{count} items loaded in %{name}" }, Qo = "Items failed to load: %{message}", Ho = "Loading items", Vo = "Loading…", Ko = "No items.", Zo = "Loading more items…", Xo = "Load more items (%{loaded} of %{count} loaded)", Jo = "(unpublished)", er = "Collapse %{name}", tr = "Expand %{name}", nr = "Not started", or = "In progress", rr = "All completed", sr = "%{count} Missing", ir = "%{count} Incomplete", lr = "%{missing} & %{incomplete}", ar = "Locked", ur = "Not started", cr = "In progress", dr = "Complete", mr = "Submitted", pr = "Graded", gr = "Excused", fr = "Missing", hr = "Locked", Ir = "Assignment", br = "Quiz", Sr = "Discussion", Mr = "Page", yr = "File", _r = "External URL", Tr = "External tool", Er = "Text header", Pr = "Item type", Cr = "Due date", wr = "Points", Lr = "Requirement", Ar = "Estimated duration", vr = "Publish state", xr = "View the item", Rr = "Submit the assignment", Dr = "Contribute to the page", Nr = "Mark as done", qr = "Score at least the minimum", kr = "Score at least %{count}", Or = "Score at least the minimum percentage", Fr = "Score at least %{count}%", Ur = "Complete the requirement", zr = "today, %{time}", $r = "yesterday, %{time}", Br = "tomorrow, %{time}", jr = "%{date}, %{time}", Gr = "%{time} (%{zone})", Yr = "Due %{when}", Wr = "Will unlock on %{when}", Qr = { one: "%{count} pt", other: "%{count} pts" }, Hr = { one: "%{percent}% | %{met} of %{count} requirement met", other: "%{percent}% | %{met} of %{count} requirements met" }, Vr = { one: "%{percent}% complete, %{met} of %{count} requirement met", other: "%{percent}% complete, %{met} of %{count} requirements met" }, Kr = "%{count} min", Zr = "Unpublished", Xr = "Untitled item", Jr = "opens in a new window", es = {
726
+ pageTitle: Mo,
727
+ modulesLoadedAnnouncement: yo,
728
+ moduleSearchLabel: _o,
729
+ searchPlaceholder: To,
730
+ expandCollapseTrigger: Eo,
731
+ expandAll: Po,
732
+ collapseAll: Co,
733
+ searchScopeHint: wo,
734
+ filterScopeHint: Lo,
735
+ modulesLoadErrorAlert: Ao,
736
+ modulesLoadingSpinnerLabel: vo,
737
+ noModulesEmptyState: xo,
738
+ filteredEmptyState: Ro,
739
+ noFilterMatches: Do,
740
+ clearFilters: No,
741
+ loadMoreModulesLoading: qo,
742
+ loadMoreModules: ko,
743
+ allModulesLoaded: Oo,
744
+ filterGroupLabel: Fo,
745
+ filterAll: Uo,
746
+ filterInProgress: zo,
747
+ filterComplete: $o,
748
+ filterDueThisWeek: Bo,
749
+ filterMissing: jo,
750
+ lockedByline: Go,
751
+ moduleProgressScreenReaderLabel: Yo,
752
+ itemsLoadedAnnouncement: Wo,
753
+ itemsLoadErrorAlert: Qo,
754
+ itemsLoadingSpinnerLabel: Ho,
755
+ itemsLoadingText: Vo,
756
+ noItemsEmptyState: Ko,
757
+ loadMoreItemsLoading: Zo,
758
+ loadMoreItems: Xo,
759
+ moduleUnpublishedBadge: Jo,
760
+ collapseModule: er,
761
+ expandModule: tr,
762
+ moduleStatusNotStarted: nr,
763
+ moduleStatusInProgress: or,
764
+ moduleStatusComplete: rr,
765
+ moduleStatusMissing: sr,
766
+ moduleStatusIncomplete: ir,
767
+ moduleStatusMissingAndIncomplete: lr,
768
+ moduleStatusLocked: ar,
769
+ itemStatusNotStarted: ur,
770
+ itemStatusInProgress: cr,
771
+ itemStatusComplete: dr,
772
+ itemStatusSubmitted: mr,
773
+ itemStatusGraded: pr,
774
+ itemStatusExcused: gr,
775
+ itemStatusMissing: fr,
776
+ itemStatusLocked: hr,
777
+ itemTypeAssignment: Ir,
778
+ itemTypeQuiz: br,
779
+ itemTypeDiscussion: Sr,
780
+ itemTypePage: Mr,
781
+ itemTypeFile: yr,
782
+ itemTypeExternalUrl: _r,
783
+ itemTypeExternalTool: Tr,
784
+ itemTypeSubHeader: Er,
785
+ metaFieldTypeLabel: Pr,
786
+ metaFieldDueAtLabel: Cr,
787
+ metaFieldPointsLabel: wr,
788
+ metaFieldRequirementLabel: Lr,
789
+ metaFieldDurationLabel: Ar,
790
+ metaFieldPublishStateLabel: vr,
791
+ requirementMustView: xr,
792
+ requirementMustSubmit: Rr,
793
+ requirementMustContribute: Dr,
794
+ requirementMustMarkDone: Nr,
795
+ requirementMinScoreUnknown: qr,
796
+ requirementMinScore: kr,
797
+ requirementMinPercentageUnknown: Or,
798
+ requirementMinPercentage: Fr,
799
+ requirementUnknown: Ur,
800
+ dateTimeToday: zr,
801
+ dateTimeYesterday: $r,
802
+ dateTimeTomorrow: Br,
803
+ dateTimeWithDate: jr,
804
+ timeWithZone: Gr,
805
+ dueByline: Yr,
806
+ unlockByline: Wr,
807
+ pointsAbbreviated: Qr,
808
+ progressSummary: Hr,
809
+ progressScreenReaderValue: Vr,
810
+ durationMinutes: Kr,
811
+ itemUnpublishedLabel: Zr,
812
+ itemUntitled: Xr,
813
+ opensInNewWindow: Jr
814
+ }, ts = /%\{(\w+)\}/g, ns = es, K = "en-US", os = /* @__PURE__ */ new Map(), rs = /* @__PURE__ */ new Map();
815
+ function Qt(e, t, n) {
816
+ const o = e.get(t);
817
+ if (o) return o;
818
+ const r = n();
819
+ return e.set(t, r), r;
820
+ }
821
+ function ss(e, t, n) {
822
+ return n ? e.replace(ts, (o, r) => {
823
+ if (!Object.prototype.hasOwnProperty.call(n, r)) return o;
824
+ const s = n[r];
825
+ return typeof s == "number" && Number.isFinite(s) ? Qt(rs, t, () => new Intl.NumberFormat(t)).format(s) : String(s);
826
+ }) : e;
827
+ }
828
+ function is(e, t, n) {
829
+ const o = n == null ? void 0 : n.count;
830
+ if (typeof o == "number" && Number.isFinite(o)) {
831
+ const r = Qt(os, t, () => new Intl.PluralRules(t)).select(o), s = e[r];
832
+ if (typeof s == "string") return s;
833
+ }
834
+ return typeof e.other == "string" ? e.other : void 0;
835
+ }
836
+ function rt(e, t, n) {
837
+ if (typeof e == "string") return e;
838
+ if (e !== null && typeof e == "object")
839
+ return is(e, t, n);
840
+ }
841
+ const st = /* @__PURE__ */ new Set();
842
+ function ls(e) {
843
+ st.has(e) || (st.add(e), console.warn(
844
+ `[platform-modules] no translation for "${e}"; it will render as itself. Add it to the catalog passed to ModulesI18nProvider.`
845
+ ));
846
+ }
847
+ function as(e, t, n, o, r) {
848
+ const s = rt(e == null ? void 0 : e[t], n, r);
849
+ if (typeof s == "string") return s;
850
+ const l = rt(ns[t], n, r);
851
+ return typeof l == "string" ? l : (o && ls(t), t);
852
+ }
853
+ function Ht(e, t = K, n = !1) {
854
+ return (o, r) => ss(as(e, o, t, n, r), t, r);
855
+ }
856
+ const us = Ht(), cs = { t: us, locale: K }, Vt = bt(null);
857
+ function Tl({
858
+ translations: e,
859
+ locale: t,
860
+ timezone: n,
861
+ warnOnMissingKey: o,
862
+ children: r
863
+ }) {
864
+ const s = R(() => {
865
+ const l = t ?? K;
866
+ return {
867
+ t: Ht(e, l, o),
868
+ locale: l,
869
+ timezone: n
870
+ };
871
+ }, [e, t, n, o]);
872
+ return /* @__PURE__ */ i(Vt.Provider, { value: s, children: r });
873
+ }
874
+ function k() {
875
+ return St(Vt) ?? cs;
876
+ }
877
+ const ds = 864e5, ms = "en-US", it = /* @__PURE__ */ new Map(), lt = /* @__PURE__ */ new Map();
878
+ function ps(e) {
879
+ const t = lt.get(e);
880
+ if (t) return t;
881
+ const n = new Intl.NumberFormat(e, { minimumIntegerDigits: 2, useGrouping: !1 });
882
+ return lt.set(e, n), n;
883
+ }
884
+ function at(e, t) {
885
+ return {
886
+ time: new Intl.DateTimeFormat(e, {
887
+ hour: "numeric",
888
+ minute: "2-digit",
889
+ timeZone: t
890
+ }),
891
+ day: new Intl.DateTimeFormat(e, { month: "long", day: "numeric", timeZone: t }),
892
+ dayYear: new Intl.DateTimeFormat(e, {
893
+ month: "long",
894
+ day: "numeric",
895
+ year: "numeric",
896
+ timeZone: t
897
+ }),
898
+ zone: t ? new Intl.DateTimeFormat(e, { timeZone: t, timeZoneName: "short" }) : void 0,
899
+ civilDay: new Intl.DateTimeFormat(ms, {
900
+ year: "numeric",
901
+ month: "numeric",
902
+ day: "numeric",
903
+ timeZone: t
904
+ })
905
+ };
906
+ }
907
+ function Kt(e, t) {
908
+ const n = t || void 0, o = `${e}|${n ?? ""}`, r = it.get(o);
909
+ if (r) return r;
910
+ let s;
911
+ try {
912
+ s = at(e, n);
913
+ } catch {
914
+ console.warn(
915
+ `[platform-modules] Unusable timezone ${JSON.stringify(n)}; rendering dates in the viewer's own clock instead.`
916
+ ), s = at(e, void 0);
917
+ }
918
+ return it.set(o, s), s;
919
+ }
920
+ function ut(e, t) {
921
+ return new Date(je(e, t)).getUTCFullYear();
922
+ }
923
+ function gs(e, t) {
924
+ var o;
925
+ const n = (o = e.zone) == null ? void 0 : o.formatToParts(t).find((r) => r.type === "timeZoneName");
926
+ return (n == null ? void 0 : n.value) ?? null;
927
+ }
928
+ function je(e, t) {
929
+ const n = e.civilDay.formatToParts(t), o = (r) => {
930
+ var s;
931
+ return Number((s = n.find((l) => l.type === r)) == null ? void 0 : s.value);
932
+ };
933
+ return Date.UTC(o("year"), o("month") - 1, o("day"));
934
+ }
935
+ function fs(e, t, n) {
936
+ return Zt(Kt(K, n), e, t);
937
+ }
938
+ function Zt(e, t, n) {
939
+ return Math.round((je(e, t) - je(e, n)) / ds);
940
+ }
941
+ function hs(e, t, n, { locale: o = K, timezone: r } = {}) {
942
+ const s = new Date(t);
943
+ if (Number.isNaN(s.getTime())) return t;
944
+ const l = Kt(o, r), a = gs(l, s), d = l.time.format(s), m = a ? e("timeWithZone", { time: d, zone: a }) : d, u = Zt(l, s, n);
945
+ if (u === 0) return e("dateTimeToday", { time: m });
946
+ if (u === -1) return e("dateTimeYesterday", { time: m });
947
+ if (u === 1) return e("dateTimeTomorrow", { time: m });
948
+ const g = ut(l, s) === ut(l, n) ? l.day.format(s) : l.dayYear.format(s);
949
+ return e("dateTimeWithDate", { date: g, time: m });
950
+ }
951
+ function Is(e, t = K) {
952
+ return !Number.isInteger(e) || e < 1 ? null : ps(t).format(e);
953
+ }
954
+ function bs(e, t) {
955
+ return t == null ? null : e("pointsAbbreviated", { count: t });
956
+ }
957
+ function Ss(e, t) {
958
+ switch (t.type) {
959
+ case "must_view":
960
+ return e("requirementMustView");
961
+ case "must_submit":
962
+ return e("requirementMustSubmit");
963
+ case "must_contribute":
964
+ return e("requirementMustContribute");
965
+ case "must_mark_done":
966
+ return e("requirementMustMarkDone");
967
+ case "min_score":
968
+ return t.minScore === null || t.minScore === void 0 ? e("requirementMinScoreUnknown") : e("requirementMinScore", { count: t.minScore });
969
+ case "min_percentage":
970
+ return t.minPercentage === null || t.minPercentage === void 0 ? e("requirementMinPercentageUnknown") : e("requirementMinPercentage", { count: t.minPercentage });
971
+ case "unknown":
972
+ return e("requirementUnknown");
973
+ }
974
+ }
975
+ function Ms(e, t, n, o) {
976
+ return e("progressSummary", { percent: t, met: n, count: o });
977
+ }
978
+ function ys(e, t, n, o) {
979
+ return e("progressScreenReaderValue", { percent: t, met: n, count: o });
980
+ }
981
+ function _s(e, t, n) {
982
+ const o = t.trim().toLocaleLowerCase(n);
983
+ return o === "" ? !0 : e.name.toLocaleLowerCase(n).includes(o);
984
+ }
985
+ const ue = "all", Ts = 7, Es = {
986
+ all: {
987
+ label: "filterAll",
988
+ order: 10,
989
+ predicate: () => !0
990
+ },
991
+ in_progress: {
992
+ label: "filterInProgress",
993
+ order: 20,
994
+ // Do not remove. Canvas `IN_PROGRESS` overlaps `missing`, which is exclusive here.
995
+ clientOnly: !0,
996
+ predicate: (e) => {
997
+ var t;
998
+ return ((t = e.progress) == null ? void 0 : t.status) === "in_progress";
999
+ }
1000
+ },
1001
+ complete: {
1002
+ label: "filterComplete",
1003
+ order: 30,
1004
+ predicate: (e) => {
1005
+ var t;
1006
+ return ((t = e.progress) == null ? void 0 : t.status) === "complete";
1007
+ },
1008
+ query: { target: "module", field: "completionStatus", op: "eq", value: "COMPLETED" }
1009
+ },
1010
+ due_this_week: {
1011
+ label: "filterDueThisWeek",
1012
+ order: 40,
1013
+ predicate: (e, { today: t, timezone: n }) => {
1014
+ var l;
1015
+ const o = (l = e.progress) == null ? void 0 : l.latestDueAt;
1016
+ if (!o) return !1;
1017
+ const r = new Date(o);
1018
+ if (Number.isNaN(r.getTime())) return !1;
1019
+ const s = fs(r, t, n);
1020
+ return s >= 0 && s <= Ts;
1021
+ }
1022
+ },
1023
+ missing: {
1024
+ label: "filterMissing",
1025
+ order: 50,
1026
+ predicate: (e) => {
1027
+ var t;
1028
+ return (((t = e.progress) == null ? void 0 : t.missingCount) ?? 0) > 0;
1029
+ }
1030
+ }
1031
+ };
1032
+ function Ke(e) {
1033
+ if (!(!e || e.clientOnly))
1034
+ return e.query;
1035
+ }
1036
+ function Ge(e) {
1037
+ return e !== void 0 && Ke(e) === void 0;
1038
+ }
1039
+ const Ps = {
1040
+ moduleLabel: (e, t, { locale: n }) => Is(e, n),
1041
+ dateTime: (e, t, { t: n, locale: o, timezone: r }) => hs(n, e, t, { locale: o, timezone: r }),
1042
+ points: (e, { t }) => bs(t, e),
1043
+ progress: (e, t, n, { t: o }) => Ms(o, e, t, n)
1044
+ }, Ae = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
1045
+ function ve(e, t) {
1046
+ const n = Object.entries(t ?? {}).filter(([, o]) => o !== void 0);
1047
+ return { ...e, ...Object.fromEntries(n) };
1048
+ }
1049
+ function H(e, t = {}) {
1050
+ const n = Object.keys(e).map((r) => [
1051
+ r,
1052
+ ve(e[r], Ae(t, r) ? t[r] : void 0)
1053
+ ]), o = Object.keys(t).filter((r) => !Ae(e, r)).sort().map((r) => [r, ve({}, t[r])]);
1054
+ return Object.fromEntries([...n, ...o]);
1055
+ }
1056
+ function me(e, t) {
1057
+ if (!(!Ae(e, t) || e[t].hidden))
1058
+ return e[t];
1059
+ }
1060
+ function Ze(e) {
1061
+ return Object.keys(e).filter((t) => me(e, t) !== void 0).map((t) => ({ ...e[t], key: t })).sort((t, n) => t.order - n.order);
1062
+ }
1063
+ const Cs = "type", ws = {
1064
+ type: {
1065
+ label: "metaFieldTypeLabel",
1066
+ order: 10,
1067
+ render: ({ item: e, t, config: n }) => {
1068
+ const o = me(n.itemTypes, e.type);
1069
+ return o ? t(o.label) : null;
1070
+ }
1071
+ },
1072
+ dueAt: {
1073
+ label: "metaFieldDueAtLabel",
1074
+ order: 20,
1075
+ render: ({ item: e, today: t, formatters: n }) => e.dueAt ? n.dueByline(e.dueAt, t) : null
1076
+ },
1077
+ points: {
1078
+ label: "metaFieldPointsLabel",
1079
+ order: 30,
1080
+ render: ({ item: e, formatters: t }) => t.points(e.pointsPossible)
1081
+ },
1082
+ requirement: {
1083
+ label: "metaFieldRequirementLabel",
1084
+ order: 40,
1085
+ render: ({ item: e, t }) => e.completionRequirement ? Ss(t, e.completionRequirement) : null
1086
+ },
1087
+ estimatedDuration: {
1088
+ label: "metaFieldDurationLabel",
1089
+ order: 50,
1090
+ render: ({ item: e, t }) => {
1091
+ const n = Bn(e);
1092
+ return n === null ? null : t("durationMinutes", { count: n });
1093
+ }
1094
+ },
1095
+ unpublished: {
1096
+ label: "metaFieldPublishStateLabel",
1097
+ order: 60,
1098
+ render: ({ item: e, t }) => e.published ? null : t("itemUnpublishedLabel")
1099
+ }
1100
+ }, G = { size: "md", color: "mutedColor" }, Ls = {
1101
+ assignment: {
1102
+ label: "itemTypeAssignment",
1103
+ order: 10,
1104
+ icon: /* @__PURE__ */ i(bn, { ...G })
1105
+ },
1106
+ quiz: { label: "itemTypeQuiz", order: 20, icon: /* @__PURE__ */ i(In, { ...G }) },
1107
+ discussion: {
1108
+ label: "itemTypeDiscussion",
1109
+ order: 30,
1110
+ icon: /* @__PURE__ */ i(hn, { ...G })
1111
+ },
1112
+ page: { label: "itemTypePage", order: 40, icon: /* @__PURE__ */ i(fn, { ...G }) },
1113
+ file: { label: "itemTypeFile", order: 50, icon: /* @__PURE__ */ i(gn, { ...G }) },
1114
+ external_url: {
1115
+ label: "itemTypeExternalUrl",
1116
+ order: 60,
1117
+ icon: /* @__PURE__ */ i(pn, { ...G })
1118
+ },
1119
+ external_tool: {
1120
+ label: "itemTypeExternalTool",
1121
+ order: 70,
1122
+ icon: /* @__PURE__ */ i(mn, { ...G })
1123
+ },
1124
+ sub_header: { label: "itemTypeSubHeader", order: 80, icon: null }
1125
+ }, Re = {
1126
+ formatters: Ps,
1127
+ itemTypes: Ls,
626
1128
  itemStatuses: {},
627
- itemMeta: {},
628
- filters: {},
1129
+ itemMeta: ws,
1130
+ filters: Es,
629
1131
  moduleActions: {},
630
1132
  itemActions: {},
631
1133
  navigation: {}
632
1134
  };
633
- Object.freeze(fe);
634
- for (const e of Object.values(fe))
1135
+ Object.freeze(Re);
1136
+ for (const e of Object.values(Re)) {
635
1137
  Object.freeze(e);
636
- const ht = Oe(null);
637
- function Ho({ value: e, children: t }) {
638
- return /* @__PURE__ */ o(ht.Provider, { value: e, children: t });
639
- }
640
- function Ko() {
641
- return $e(ht) ?? fe;
1138
+ for (const t of Object.values(e)) Object.freeze(t);
1139
+ }
1140
+ function As(e, t) {
1141
+ return Ze(e).filter((n) => {
1142
+ const o = Ke(n);
1143
+ return o !== void 0 && !Rn(t, o);
1144
+ }).map((n) => n.key);
1145
+ }
1146
+ function ct(e) {
1147
+ return `[platform-modules] the adapter cannot serve filter(s): ${e.join(", ")}. Add the field to the adapter's capabilities, or set clientOnly on the entry.`;
1148
+ }
1149
+ function vs(e, t) {
1150
+ const n = As(e, t);
1151
+ if (n.length === 0) return e;
1152
+ if (process.env.NODE_ENV !== "production")
1153
+ throw new Error(ct(n));
1154
+ console.warn(ct(n));
1155
+ const o = Object.fromEntries(n.map((r) => [r, { ...e[r], hidden: !0 }]));
1156
+ return { ...e, ...o };
1157
+ }
1158
+ const Xt = bt(null);
1159
+ function El({ value: e, children: t }) {
1160
+ return /* @__PURE__ */ i(Xt.Provider, { value: e, children: t });
1161
+ }
1162
+ function pe() {
1163
+ return St(Xt) ?? Re;
1164
+ }
1165
+ function Pl(e) {
1166
+ return me(pe().itemMeta, e) !== void 0;
1167
+ }
1168
+ const De = c.object({
1169
+ label: c.string(),
1170
+ order: c.number(),
1171
+ hidden: c.boolean().optional()
1172
+ });
1173
+ function we(e) {
1174
+ return c.record(c.string(), e);
642
1175
  }
643
- const Se = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
644
- function me(e, t) {
645
- const n = Object.entries(t ?? {}).filter(([, s]) => s !== void 0);
646
- return { ...e, ...Object.fromEntries(n) };
1176
+ const ze = we(De.strict()), Jt = (e) => e == null || typeof e == "string" || typeof e == "number" || typeof e == "bigint" || typeof e == "boolean" || Mt(e) || Array.isArray(e) && e.every(Jt), xs = (e) => {
1177
+ var t;
1178
+ return e == null || typeof e == "function" && !((t = e.prototype) != null && t.isReactComponent);
1179
+ }, Rs = De.extend({
1180
+ icon: c.custom(Jt, { message: "icon must be a ReactNode" }),
1181
+ renderIcon: c.custom(xs, {
1182
+ message: "renderIcon must be a function of the item, not a React component"
1183
+ })
1184
+ }).strict();
1185
+ function Ee() {
1186
+ return c.custom((e) => typeof e == "function", {
1187
+ message: "Expected a function"
1188
+ });
647
1189
  }
648
- function O(e, t = {}) {
649
- const n = Object.keys(e).map((r) => [
650
- 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
- return Object.fromEntries([...n, ...s]);
654
- }
655
- function Vo(e) {
656
- return Object.keys(e).filter((t) => !e[t].hidden).map((t) => ({ ...e[t], key: t })).sort((t, n) => t.order - n.order);
657
- }
658
- const kn = d.object({
659
- /** Resolved through `t` at render. */
660
- label: d.string(),
661
- /** Sort position, ascending. The base spaces its values (10, 20, 30…) so a host can insert between two built-ins. */
662
- order: d.number(),
663
- /** How a host removes an entry. Stays in the resolved registry; `visibleEntries` filters it at read time. */
664
- hidden: d.boolean().optional()
665
- });
666
- function qn(e) {
667
- return d.record(d.string(), e);
668
- }
669
- const $ = qn(kn.strict()), Rn = d.object({
670
- formatters: d.object({}).strict(),
671
- itemTypes: $,
672
- itemStatuses: $,
673
- itemMeta: $,
674
- filters: $,
675
- moduleActions: $,
676
- itemActions: $,
677
- navigation: d.object({}).strict()
1190
+ const Ds = De.extend({
1191
+ render: c.custom((e) => typeof e == "function", {
1192
+ message: "render must be a function taking a MetaFieldContext"
1193
+ })
1194
+ }).strict(), Ns = De.extend({
1195
+ predicate: c.custom((e) => typeof e == "function", {
1196
+ message: "predicate must be a function of the module and a FilterContext"
1197
+ }),
1198
+ query: xn.optional(),
1199
+ clientOnly: c.boolean().optional()
1200
+ }).strict(), qs = c.object({
1201
+ formatters: c.object({
1202
+ moduleLabel: Ee(),
1203
+ dateTime: Ee(),
1204
+ points: Ee(),
1205
+ progress: Ee()
1206
+ }).strict(),
1207
+ itemTypes: we(Rs),
1208
+ itemStatuses: ze,
1209
+ itemMeta: we(Ds),
1210
+ filters: we(Ns),
1211
+ moduleActions: ze,
1212
+ itemActions: ze,
1213
+ navigation: c.object({}).strict()
678
1214
  });
679
- function Fn(e, t = {}) {
680
- const n = Object.keys(t).filter((r) => !Se(e, r));
1215
+ function ks(e, t = {}) {
1216
+ const n = Object.keys(t).filter((r) => !Ae(e, r));
681
1217
  if (n.length > 0)
682
1218
  throw new Error(
683
1219
  `Unknown modules config key(s): ${n.join(", ")}. Known keys are ${Object.keys(e).join(", ")}.`
684
1220
  );
685
- const s = {
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)
1221
+ const o = {
1222
+ formatters: ve(e.formatters, t.formatters),
1223
+ itemTypes: H(e.itemTypes, t.itemTypes),
1224
+ itemStatuses: H(e.itemStatuses, t.itemStatuses),
1225
+ itemMeta: H(e.itemMeta, t.itemMeta),
1226
+ filters: H(e.filters, t.filters),
1227
+ moduleActions: H(e.moduleActions, t.moduleActions),
1228
+ itemActions: H(e.itemActions, t.itemActions),
1229
+ navigation: ve(e.navigation, t.navigation)
694
1230
  };
695
- return Rn.parse(s), s;
1231
+ return qs.parse(o), o;
1232
+ }
1233
+ function Cl(e = {}) {
1234
+ return ks(Re, e);
696
1235
  }
697
- function Zo(e = {}) {
698
- return Fn(fe, e);
1236
+ function Ne() {
1237
+ const { formatters: e } = pe(), { t, locale: n, timezone: o } = k();
1238
+ return R(() => {
1239
+ const r = { t, locale: n, timezone: o }, s = (l, a) => e.dateTime(l, a, r);
1240
+ return {
1241
+ moduleLabel: (l, a) => e.moduleLabel(l, a, r) || null,
1242
+ dueByline: (l, a) => t("dueByline", { when: s(l, a) }),
1243
+ unlockByline: (l, a) => t("unlockByline", { when: s(l, a) }),
1244
+ points: (l) => e.points(l, r),
1245
+ progress: (l, a, d) => e.progress(l, a, d, r)
1246
+ };
1247
+ }, [e, t, n, o]);
699
1248
  }
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]
1249
+ const Xe = 100, en = 100, tn = 100, Os = 4, qe = 5 * 60 * 1e3, nn = 20, xe = { hasNextPage: !1, endCursor: null }, V = ["platform-modules"], ge = {
1250
+ all: V,
1251
+ course: (e) => [...V, e],
1252
+ list: (e, t = {}) => [...V, e, "list", t],
1253
+ items: (e, t, n = {}) => [...V, e, "module", t, "items", n]
705
1254
  };
706
- function Un(e) {
707
- return [...B, e, "list"];
1255
+ function Fs(e) {
1256
+ return [...V, e, "list"];
708
1257
  }
709
- function Mt(e, t) {
710
- return [...B, e, "module", t, "items"];
1258
+ function on(e, t) {
1259
+ return [...V, e, "module", t, "items"];
711
1260
  }
712
- function St(e) {
1261
+ function rn(e) {
713
1262
  return e.pageInfo.hasNextPage ? e.pageInfo.endCursor : null;
714
1263
  }
715
- function yt(e) {
1264
+ function sn(e) {
716
1265
  const {
717
1266
  courseId: t,
718
1267
  adapter: n,
719
- pageSize: s,
1268
+ pageSize: o,
720
1269
  includeItems: r,
721
- inlineItemsFirst: i,
722
- inlineFirst: u,
723
- view: a,
724
- staleTime: c,
725
- enabled: g
1270
+ filter: s,
1271
+ inlineItemsFirst: l,
1272
+ inlineFirst: a,
1273
+ view: d,
1274
+ staleTime: m,
1275
+ enabled: u
726
1276
  } = e;
727
1277
  return {
728
- // `inlineItemsFirst` is deliberately NOT in the key. It is derived from the
729
- // probe of this very list, so it cannot vary for a fixed (view, pageSize,
730
- // includeItems) — including it would only add a segment that never differs.
731
- queryKey: ee.list(t, { view: a, pageSize: s, includeItems: r }),
1278
+ // `inlineItemsFirst` is deliberately out of the key: it is derived from this very list.
1279
+ queryKey: ge.list(t, { view: d, pageSize: o, includeItems: r, filter: s }),
732
1280
  initialPageParam: null,
733
- queryFn: ({ pageParam: l, signal: m }) => n.listModules({
1281
+ queryFn: ({ pageParam: p, signal: g }) => n.listModules({
734
1282
  courseId: t,
735
- cursor: l,
736
- pageSize: s,
1283
+ cursor: p,
1284
+ pageSize: o,
737
1285
  includeItems: r,
738
- inlineItemsFirst: i,
739
- inlineFirst: u,
740
- signal: m
1286
+ filter: s,
1287
+ inlineItemsFirst: l,
1288
+ inlineFirst: a,
1289
+ signal: g
741
1290
  }),
742
- getNextPageParam: St,
743
- enabled: g,
744
- staleTime: c,
745
- // A refetch of an infinite query re-walks every page it has loaded. Doing
746
- // that because someone alt-tabbed is the Canvas behavior we are replacing.
1291
+ getNextPageParam: rn,
1292
+ enabled: u,
1293
+ staleTime: m,
747
1294
  refetchOnWindowFocus: !1
748
1295
  };
749
1296
  }
750
- function _t(e) {
751
- const { courseId: t, moduleId: n, adapter: s, pageSize: r, view: i, staleTime: u, enabled: a, limit: c } = e;
1297
+ function ln(e) {
1298
+ const { courseId: t, moduleId: n, adapter: o, pageSize: r, view: s, staleTime: l, enabled: a, limit: d } = e;
752
1299
  return {
753
- queryKey: ee.items(t, n, { view: i, pageSize: r }),
1300
+ queryKey: ge.items(t, n, { view: s, pageSize: r }),
754
1301
  initialPageParam: null,
755
- queryFn: ({ pageParam: g, signal: l }) => {
756
- const m = () => s.listModuleItems({ courseId: t, moduleId: n, cursor: g, pageSize: r, signal: l });
757
- return c ? c(() => {
758
- if (l.aborted)
1302
+ queryFn: ({ pageParam: m, signal: u }) => {
1303
+ const p = () => o.listModuleItems({ courseId: t, moduleId: n, cursor: m, pageSize: r, signal: u });
1304
+ return d ? d(() => {
1305
+ if (u.aborted)
759
1306
  throw new DOMException("The operation was aborted.", "AbortError");
760
- return m();
761
- }) : m();
1307
+ return p();
1308
+ }) : p();
762
1309
  },
763
- getNextPageParam: St,
1310
+ getNextPageParam: rn,
764
1311
  enabled: a,
765
- staleTime: u,
1312
+ staleTime: l,
766
1313
  refetchOnWindowFocus: !1
767
1314
  };
768
1315
  }
769
- function On(e) {
770
- var w;
1316
+ function Us(e) {
1317
+ var E;
771
1318
  const {
772
1319
  courseId: t,
773
1320
  adapter: n,
774
- pageSize: s = Pe,
1321
+ pageSize: o = Xe,
775
1322
  includeItems: r = !1,
776
- inlineItemsFirst: i,
777
- inlineFirst: u,
778
- view: a,
779
- staleTime: c = he,
780
- enabled: g = !0
781
- } = e, l = _e(
782
- yt({
1323
+ filter: s,
1324
+ inlineItemsFirst: l,
1325
+ inlineFirst: a,
1326
+ view: d,
1327
+ staleTime: m = qe,
1328
+ enabled: u = !0
1329
+ } = e, p = Qe(
1330
+ sn({
783
1331
  courseId: t,
784
1332
  adapter: n,
785
- pageSize: s,
1333
+ pageSize: o,
786
1334
  includeItems: r,
787
- inlineItemsFirst: i,
788
- inlineFirst: u,
789
- view: a,
790
- staleTime: c,
791
- enabled: g
1335
+ filter: s,
1336
+ inlineItemsFirst: l,
1337
+ inlineFirst: a,
1338
+ view: d,
1339
+ staleTime: m,
1340
+ enabled: u
792
1341
  })
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
- f();
795
- }, [f]);
1342
+ ), g = (E = p.data) == null ? void 0 : E.pages, f = R(() => (g ?? []).flatMap((M) => M.modules), [g]), h = g && g.length > 0 ? g[g.length - 1].pageInfo : xe, I = p.fetchNextPage, C = F(() => {
1343
+ I();
1344
+ }, [I]);
796
1345
  return {
797
- modules: S,
798
- pageInfo: p,
799
- hasNextPage: p.hasNextPage,
800
- fetchNextPage: h,
801
- isLoading: l.isLoading,
802
- isFetchingNextPage: l.isFetchingNextPage,
803
- isPending: l.isPending,
804
- error: l.error
1346
+ modules: f,
1347
+ pageInfo: h,
1348
+ hasNextPage: h.hasNextPage,
1349
+ fetchNextPage: C,
1350
+ isLoading: p.isLoading,
1351
+ isFetchingNextPage: p.isFetchingNextPage,
1352
+ isPending: p.isPending,
1353
+ error: p.error
805
1354
  };
806
1355
  }
807
- function Xo(e) {
808
- var h;
1356
+ function wl(e) {
1357
+ var I;
809
1358
  const {
810
1359
  courseId: t,
811
1360
  moduleId: n,
812
- adapter: s,
813
- pageSize: r = pt,
814
- view: i,
815
- enabled: u = !0,
816
- staleTime: a = he,
817
- limit: c
818
- } = e, g = _e(
819
- _t({
1361
+ adapter: o,
1362
+ pageSize: r = en,
1363
+ view: s,
1364
+ enabled: l = !0,
1365
+ staleTime: a = qe,
1366
+ limit: d
1367
+ } = e, m = Qe(
1368
+ ln({
820
1369
  courseId: t,
821
1370
  moduleId: n,
822
- adapter: s,
1371
+ adapter: o,
823
1372
  pageSize: r,
824
- view: i,
1373
+ view: s,
825
1374
  staleTime: a,
826
- enabled: u,
827
- limit: c
1375
+ enabled: l,
1376
+ limit: d
828
1377
  })
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
- p();
831
- }, [p]);
1378
+ ), u = (I = m.data) == null ? void 0 : I.pages, p = R(() => (u ?? []).flatMap((C) => C.items), [u]), g = u && u.length > 0 ? u[u.length - 1].pageInfo : xe, f = m.fetchNextPage, h = F(() => {
1379
+ f();
1380
+ }, [f]);
832
1381
  return {
833
- items: m,
834
- pageInfo: S,
835
- hasNextPage: S.hasNextPage,
836
- fetchNextPage: f,
837
- isLoading: g.isLoading,
838
- isFetchingNextPage: g.isFetchingNextPage,
839
- error: g.error
1382
+ items: p,
1383
+ pageInfo: g,
1384
+ hasNextPage: g.hasNextPage,
1385
+ fetchNextPage: h,
1386
+ isLoading: m.isLoading,
1387
+ isFetchingNextPage: m.isFetchingNextPage,
1388
+ error: m.error
840
1389
  };
841
1390
  }
842
- function $n(e, t, n = Te) {
1391
+ function zs(e, t, n = Ve) {
843
1392
  if (e.pageInfo.hasNextPage) return "onDemand";
844
- let s = 0, r = 0;
845
- for (const i of e.modules) {
846
- if (i.itemCount > t) return "onDemand";
847
- s += i.itemCount, i.itemCount > r && (r = i.itemCount);
1393
+ let o = 0, r = 0;
1394
+ for (const s of e.modules) {
1395
+ if (s.itemCount > t) return "onDemand";
1396
+ o += s.itemCount, s.itemCount > r && (r = s.itemCount);
848
1397
  }
849
- return s > t * 2 ? "onDemand" : Math.max(e.modules.length, 1) * Math.max(r, 1) <= n ? "inline" : "onDemand";
1398
+ return o > t * 2 ? "onDemand" : Math.max(e.modules.length, 1) * Math.max(r, 1) <= n ? "inline" : "onDemand";
850
1399
  }
851
- function Bn(e) {
852
- var S;
1400
+ function $s(e) {
1401
+ var f;
853
1402
  const {
854
1403
  courseId: t,
855
1404
  adapter: n,
856
- mode: s = "auto",
857
- inlineThreshold: r = It,
858
- nodeBudget: i = n.inlineNodeBudget ?? Te,
859
- pageSize: u = Pe,
860
- view: a,
861
- staleTime: c = he
862
- } = e, g = s === "auto", l = _e(
863
- yt({
1405
+ mode: o = "auto",
1406
+ inlineThreshold: r = tn,
1407
+ nodeBudget: s = n.inlineNodeBudget ?? Ve,
1408
+ pageSize: l = Xe,
1409
+ filter: a,
1410
+ view: d,
1411
+ staleTime: m = qe
1412
+ } = e, u = o === "auto", p = Qe(
1413
+ sn({
864
1414
  courseId: t,
865
1415
  adapter: n,
866
- pageSize: u,
1416
+ pageSize: l,
867
1417
  includeItems: !1,
868
- view: a,
869
- staleTime: c,
870
- enabled: g
1418
+ filter: a,
1419
+ view: d,
1420
+ staleTime: m,
1421
+ enabled: u
871
1422
  })
872
1423
  );
873
- if (!g)
1424
+ if (!u)
874
1425
  return {
875
- resolvedMode: s,
1426
+ resolvedMode: o,
876
1427
  isResolving: !1,
877
1428
  probed: !1,
878
1429
  error: null,
879
1430
  inlineShape: null
880
1431
  };
881
- if (l.error)
1432
+ if (p.error)
882
1433
  return {
883
1434
  resolvedMode: "onDemand",
884
1435
  isResolving: !1,
885
1436
  probed: !0,
886
- error: l.error,
1437
+ error: p.error,
887
1438
  inlineShape: null
888
1439
  };
889
- const m = (S = l.data) == null ? void 0 : S.pages[0];
890
- return m ? {
891
- resolvedMode: $n(m, r, i),
1440
+ const g = (f = p.data) == null ? void 0 : f.pages[0];
1441
+ return g ? {
1442
+ resolvedMode: zs(g, r, s),
892
1443
  isResolving: !1,
893
1444
  probed: !0,
894
1445
  error: null,
895
- inlineShape: Gn(m)
1446
+ inlineShape: Bs(g)
896
1447
  } : { resolvedMode: null, isResolving: !0, probed: !0, error: null, inlineShape: null };
897
1448
  }
898
- function Gn(e) {
1449
+ function Bs(e) {
899
1450
  let t = 1;
900
1451
  for (const n of e.modules)
901
1452
  n.itemCount > t && (t = n.itemCount);
902
1453
  return { moduleCount: Math.max(e.modules.length, 1), maxItemCount: t };
903
1454
  }
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
- const l = r.current, m = () => {
909
- u((f) => {
910
- const h = /* @__PURE__ */ new Map();
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);
1455
+ const dt = "\0", js = /* @__PURE__ */ new Map();
1456
+ function Gs(e, t, n = nn) {
1457
+ const o = Ct(), r = Y(/* @__PURE__ */ new Map()), [s, l] = ae(js), a = e.join(dt), d = R(() => a === "" ? [] : a.split(dt), [a]);
1458
+ Le(() => {
1459
+ const u = r.current, p = () => {
1460
+ l((h) => {
1461
+ const I = /* @__PURE__ */ new Map();
1462
+ let C = h.size !== u.size;
1463
+ for (const [E, M] of u) {
1464
+ const D = M.getCurrentResult();
1465
+ I.set(E, D), !C && h.get(E) !== D && (C = !0);
915
1466
  }
916
- return w ? h : f;
1467
+ return C ? I : h;
917
1468
  });
918
- }, S = new Set(c);
919
- for (const f of c) {
920
- if (l.has(f)) continue;
921
- const h = new kt(
922
- s,
923
- t(f, !0)
1469
+ }, g = new Set(d);
1470
+ for (const h of d) {
1471
+ if (u.has(h)) continue;
1472
+ const I = new _n(
1473
+ o,
1474
+ t(h, !0)
924
1475
  );
925
- l.set(f, h), h.subscribe(m);
1476
+ u.set(h, I), I.subscribe(p);
926
1477
  }
927
- for (const [f, h] of l)
928
- h.setOptions(t(f, S.has(f)));
929
- for (const f of c) {
930
- const h = l.get(f);
931
- h && (l.delete(f), l.set(f, h));
1478
+ for (const [h, I] of u)
1479
+ I.setOptions(t(h, g.has(h)));
1480
+ for (const h of d) {
1481
+ const I = u.get(h);
1482
+ I && (u.delete(h), u.set(h, I));
932
1483
  }
933
- let p = l.size - S.size;
934
- if (p > n)
935
- for (const [f, h] of l) {
936
- if (p <= n) break;
937
- S.has(f) || (h.destroy(), l.delete(f), p -= 1);
1484
+ let f = u.size - g.size;
1485
+ if (f > n)
1486
+ for (const [h, I] of u) {
1487
+ if (f <= n) break;
1488
+ g.has(h) || (I.destroy(), u.delete(h), f -= 1);
938
1489
  }
939
- m();
940
- }, [s, t, c, n]), ce(() => {
941
- const l = r.current;
1490
+ p();
1491
+ }, [o, t, d, n]), Le(() => {
1492
+ const u = r.current;
942
1493
  return () => {
943
- for (const m of l.values()) m.destroy();
944
- l.clear();
1494
+ for (const p of u.values()) p.destroy();
1495
+ u.clear();
945
1496
  };
946
1497
  }, []);
947
- const g = A((l) => {
948
- var m;
949
- (m = r.current.get(l)) == null || m.fetchNextPage();
1498
+ const m = F((u) => {
1499
+ var p;
1500
+ (p = r.current.get(u)) == null || p.fetchNextPage();
950
1501
  }, []);
951
- return { results: i, fetchNextPage: g };
1502
+ return { results: s, fetchNextPage: m };
952
1503
  }
953
- const Qn = [], Wn = () => {
1504
+ const Ys = [], Ws = () => {
954
1505
  };
955
- function Jo(e) {
956
- var z, ie;
1506
+ function Ll(e) {
1507
+ var oe, re;
957
1508
  const {
958
1509
  courseId: t,
959
1510
  adapter: n,
960
- view: s,
1511
+ view: o,
961
1512
  itemsMode: r = "auto",
962
- inlineThreshold: i = It,
963
- pageSize: u = Pe,
964
- itemPageSize: a = pt,
965
- itemConcurrency: c = zn,
966
- retainCollapsedLimit: g = bt,
967
- staleTime: l = he,
968
- initialExpandedModuleIds: m
969
- } = e, S = je(), p = Bn({
1513
+ inlineThreshold: s = tn,
1514
+ pageSize: l = Xe,
1515
+ itemPageSize: a = en,
1516
+ itemConcurrency: d = Os,
1517
+ retainCollapsedLimit: m = nn,
1518
+ staleTime: u = qe,
1519
+ initialExpandedModuleIds: p,
1520
+ initialFilter: g = ue
1521
+ } = e, f = Ct(), h = pe(), [I, C] = ae(g), E = R(
1522
+ () => vs(h.filters, n.capabilities),
1523
+ [h.filters, n.capabilities]
1524
+ ), M = me(E, I), D = Ke(M), q = $s({
970
1525
  courseId: t,
971
1526
  adapter: n,
972
1527
  mode: r,
973
- inlineThreshold: i,
974
- pageSize: u,
975
- view: s,
976
- staleTime: l
977
- }), f = p.resolvedMode, h = On({
1528
+ inlineThreshold: s,
1529
+ pageSize: l,
1530
+ filter: D,
1531
+ view: o,
1532
+ staleTime: u
1533
+ }), N = q.resolvedMode, x = Us({
978
1534
  courseId: t,
979
1535
  adapter: n,
980
- pageSize: u,
981
- view: s,
982
- staleTime: l,
983
- includeItems: f === "inline",
984
- // Measured by the probe, not assumed. Canvas charges GraphQL complexity on
985
- // the requested shape, so asking for the ceiling rejects the query outright
986
- // even on a tiny course. @see UseItemsModeResult.inlineShape
987
- inlineItemsFirst: (z = p.inlineShape) == null ? void 0 : z.maxItemCount,
988
- // Both axes, not just one: the budget is charged on the product, so asking
989
- // for 100 modules when page 1 held 6 is what forces `inlineItemsFirst` down.
990
- inlineFirst: (ie = p.inlineShape) == null ? void 0 : ie.moduleCount,
991
- enabled: f !== null
992
- }), [w, x] = V(
993
- () => m ?? []
994
- ), L = v(() => {
1536
+ pageSize: l,
1537
+ filter: D,
1538
+ view: o,
1539
+ staleTime: u,
1540
+ includeItems: N === "inline",
1541
+ inlineItemsFirst: (oe = q.inlineShape) == null ? void 0 : oe.maxItemCount,
1542
+ inlineFirst: (re = q.inlineShape) == null ? void 0 : re.moduleCount,
1543
+ enabled: N !== null
1544
+ }), [A, z] = ae(
1545
+ () => p ?? []
1546
+ ), $ = R(() => {
995
1547
  const y = /* @__PURE__ */ new Map();
996
- for (const b of h.modules) y.set(b.id, b);
1548
+ for (const b of x.modules) y.set(b.id, b);
997
1549
  return y;
998
- }, [h.modules]), C = v(
999
- () => w.filter((y) => {
1000
- const b = L.get(y);
1550
+ }, [x.modules]), X = R(
1551
+ () => A.filter((y) => {
1552
+ const b = $.get(y);
1001
1553
  return b !== void 0 && b.items === void 0;
1002
1554
  }),
1003
- [w, L]
1004
- ), ne = v(() => new Set(C), [C]), se = v(() => qt(c), [c]), E = A(
1005
- (y, b) => _t({
1555
+ [A, $]
1556
+ ), fe = R(() => new Set(X), [X]), he = R(() => Tn(d), [d]), Fe = F(
1557
+ (y, b) => ln({
1006
1558
  courseId: t,
1007
1559
  moduleId: y,
1008
1560
  adapter: n,
1009
1561
  pageSize: a,
1010
- view: s,
1011
- staleTime: l,
1562
+ view: o,
1563
+ staleTime: u,
1012
1564
  enabled: b,
1013
- limit: se
1565
+ limit: he
1014
1566
  }),
1015
- [t, n, a, s, l, se]
1016
- ), G = Yn(C, E, g), j = G.fetchNextPage, R = q(/* @__PURE__ */ new Map()), Y = A(
1567
+ [t, n, a, o, u, he]
1568
+ ), J = Gs(X, Fe, m), ee = J.fetchNextPage, Ie = Y(/* @__PURE__ */ new Map()), W = F(
1017
1569
  (y) => {
1018
- let b = R.current.get(y);
1019
- return b || (b = () => j(y), R.current.set(y, b)), b;
1570
+ let b = Ie.current.get(y);
1571
+ return b || (b = () => ee(y), Ie.current.set(y, b)), b;
1020
1572
  },
1021
- [j]
1022
- ), D = A((y) => {
1023
- x(
1573
+ [ee]
1574
+ ), Q = F((y) => {
1575
+ z(
1024
1576
  (b) => b.includes(y) ? b : [...b, y]
1025
1577
  );
1026
- }, []), F = A(
1578
+ }, []), w = F(
1027
1579
  (y) => {
1028
- x((b) => b.filter((I) => I !== y)), S.cancelQueries({ queryKey: Mt(t, y) });
1580
+ z((b) => b.filter((v) => v !== y)), f.cancelQueries({ queryKey: on(t, y) });
1029
1581
  },
1030
- [S, t]
1031
- ), Q = q(w);
1032
- Q.current = w;
1033
- const re = A(
1582
+ [f, t]
1583
+ ), te = Y(A);
1584
+ te.current = A;
1585
+ const be = F(
1034
1586
  (y) => {
1035
- Q.current.includes(y) ? F(y) : D(y);
1587
+ te.current.includes(y) ? w(y) : Q(y);
1036
1588
  },
1037
- [F, D]
1038
- ), k = G.results, oe = q(/* @__PURE__ */ new Map()), W = A(
1589
+ [w, Q]
1590
+ ), ne = J.results, B = Y(/* @__PURE__ */ new Map()), Se = F(
1039
1591
  (y) => {
1040
- var xe;
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);
1592
+ var _e;
1593
+ const b = $.get(y), v = ne.get(y), j = fe.has(y), O = B.current.get(y);
1594
+ if (O && O.items === (b == null ? void 0 : b.items) && O.result === v && O.active === j)
1595
+ return O.value;
1596
+ const Me = (L) => (B.current.set(y, { items: b == null ? void 0 : b.items, result: v, active: j, value: L }), L);
1045
1597
  if ((b == null ? void 0 : b.items) !== void 0)
1046
- return we({
1598
+ return Me({
1047
1599
  items: b.items,
1048
- pageInfo: ge,
1600
+ pageInfo: xe,
1049
1601
  hasNextPage: !1,
1050
- fetchNextPage: Wn,
1602
+ fetchNextPage: Ws,
1051
1603
  isLoading: !1,
1052
1604
  isFetchingNextPage: !1,
1053
1605
  error: null,
1054
1606
  source: "inline"
1055
1607
  });
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
- pageInfo: Ee,
1060
- hasNextPage: Ee.hasNextPage,
1061
- fetchNextPage: Y(y),
1062
- // Between the click and the observer being wired up there is one commit
1063
- // with no result yet; report that as loading rather than as "empty".
1064
- isLoading: I ? I.isLoading : H,
1065
- isFetchingNextPage: (I == null ? void 0 : I.isFetchingNextPage) ?? !1,
1066
- error: (I == null ? void 0 : I.error) ?? null,
1608
+ const U = (_e = v == null ? void 0 : v.data) == null ? void 0 : _e.pages, ye = U ? U.flatMap((L) => L.items) : Ys, se = U && U.length > 0 ? U[U.length - 1].pageInfo : xe;
1609
+ return Me({
1610
+ items: ye,
1611
+ pageInfo: se,
1612
+ hasNextPage: se.hasNextPage,
1613
+ fetchNextPage: W(y),
1614
+ isLoading: v ? v.isLoading : j,
1615
+ isFetchingNextPage: (v == null ? void 0 : v.isFetchingNextPage) ?? !1,
1616
+ error: (v == null ? void 0 : v.error) ?? null,
1067
1617
  source: "onDemand"
1068
1618
  });
1069
1619
  },
1070
- [L, k, Y, ne]
1620
+ [$, ne, W, fe]
1071
1621
  );
1072
1622
  return {
1073
- modules: h.modules,
1074
- pageInfo: h.pageInfo,
1075
- hasNextPage: h.hasNextPage,
1076
- fetchNextPage: h.fetchNextPage,
1077
- isLoading: p.isResolving || h.isPending,
1078
- isFetchingNextPage: h.isFetchingNextPage,
1079
- error: h.error ?? p.error,
1080
- itemsMode: f,
1081
- getItems: W,
1082
- expandModule: D,
1083
- collapseModule: F,
1084
- toggleModule: re,
1085
- expandedModuleIds: w
1623
+ modules: x.modules,
1624
+ pageInfo: x.pageInfo,
1625
+ hasNextPage: x.hasNextPage,
1626
+ fetchNextPage: x.fetchNextPage,
1627
+ isLoading: q.isResolving || x.isPending,
1628
+ isFetchingNextPage: x.isFetchingNextPage,
1629
+ error: x.error ?? q.error,
1630
+ itemsMode: N,
1631
+ getItems: Se,
1632
+ expandModule: Q,
1633
+ collapseModule: w,
1634
+ toggleModule: be,
1635
+ expandedModuleIds: A,
1636
+ filter: I,
1637
+ setFilter: C,
1638
+ filterEntry: M,
1639
+ filterPredicate: Ge(M) ? M == null ? void 0 : M.predicate : void 0,
1640
+ filterResultsArePartial: I !== ue && Ge(M) && x.hasNextPage
1086
1641
  };
1087
1642
  }
1088
- function ei(e, t, n, s) {
1089
- const r = s ? ee.items(t, n, s) : Mt(t, n);
1643
+ function Al(e, t, n, o) {
1644
+ const r = o ? ge.items(t, n, o) : on(t, n);
1090
1645
  return e.invalidateQueries({ queryKey: r });
1091
1646
  }
1092
- function ti(e, t, n) {
1093
- const s = n ? ee.list(t, n) : Un(t);
1094
- return e.invalidateQueries({ queryKey: s });
1095
- }
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) {
1177
- const s = e.get(t);
1178
- if (s) return s;
1179
- const r = n();
1180
- return e.set(t, r), r;
1181
- }
1182
- function Sr(e, t, n) {
1183
- return n ? e.replace(pr, (s, r) => {
1184
- if (!Object.prototype.hasOwnProperty.call(n, r)) return s;
1185
- const i = n[r];
1186
- return typeof i == "number" && Number.isFinite(i) ? Tt(Mr, t, () => new Intl.NumberFormat(t)).format(i) : String(i);
1187
- }) : e;
1188
- }
1189
- function yr(e, t, n) {
1190
- const s = n == null ? void 0 : n.count;
1191
- if (typeof s == "number" && Number.isFinite(s)) {
1192
- const r = Tt(br, t, () => new Intl.PluralRules(t)).select(s), i = e[r];
1193
- if (typeof i == "string") return i;
1194
- }
1195
- return typeof e.other == "string" ? e.other : void 0;
1196
- }
1197
- function Ne(e, t, n) {
1198
- if (typeof e == "string") return e;
1199
- if (e !== null && typeof e == "object")
1200
- return yr(e, t, n);
1201
- }
1202
- function _r(e, t, n, s) {
1203
- const r = Ne(e == null ? void 0 : e[t], n, s);
1204
- if (typeof r == "string") return r;
1205
- const i = Ne(Ir[t], n, s);
1206
- return typeof i == "string" ? i : t;
1207
- }
1208
- function Pt(e, t = te) {
1209
- return (n, s) => Sr(_r(e, n, t, s), t, s);
1210
- }
1211
- const Tr = Pt(), Pr = { t: Tr, locale: te }, wt = Oe(null);
1212
- function si({
1213
- translations: e,
1214
- locale: t,
1215
- children: n
1216
- }) {
1217
- const s = v(() => {
1218
- const r = t ?? te;
1219
- return { t: Pt(e, r), locale: r };
1220
- }, [e, t]);
1221
- return /* @__PURE__ */ o(wt.Provider, { value: s, children: n });
1222
- }
1223
- function N() {
1224
- return $e(wt) ?? Pr;
1225
- }
1226
- const wr = 864e5, De = /* @__PURE__ */ new Map(), ke = /* @__PURE__ */ new Map();
1227
- function Er(e) {
1228
- const t = ke.get(e);
1229
- if (t) return t;
1230
- const n = new Intl.NumberFormat(e, { minimumIntegerDigits: 2, useGrouping: !1 });
1231
- return ke.set(e, n), n;
1232
- }
1233
- function xr(e) {
1234
- const t = De.get(e);
1235
- if (t) return t;
1236
- const n = {
1237
- time: new Intl.DateTimeFormat(e, { hour: "numeric", minute: "2-digit" }),
1238
- day: new Intl.DateTimeFormat(e, { month: "long", day: "numeric" }),
1239
- dayYear: new Intl.DateTimeFormat(e, { month: "long", day: "numeric", year: "numeric" })
1240
- };
1241
- return De.set(e, n), n;
1242
- }
1243
- function Et(e, t) {
1244
- const n = Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()), s = Date.UTC(t.getFullYear(), t.getMonth(), t.getDate());
1245
- return Math.round((n - s) / wr);
1246
- }
1247
- function xt(e, t, n, s = te) {
1248
- const r = new Date(t);
1249
- if (Number.isNaN(r.getTime())) return t;
1250
- const i = xr(s), u = i.time.format(r), a = Et(r, n);
1251
- if (a === 0) return e("dateTimeToday", { time: u });
1252
- if (a === -1) return e("dateTimeYesterday", { time: u });
1253
- if (a === 1) return e("dateTimeTomorrow", { time: u });
1254
- const c = r.getFullYear() === n.getFullYear() ? i.day.format(r) : i.dayYear.format(r);
1255
- return e("dateTimeWithDate", { date: c, time: u });
1256
- }
1257
- function Ct(e, t, n, s) {
1258
- return e("dueByline", { when: xt(e, t, n, s) });
1259
- }
1260
- function qe(e, t, n, s) {
1261
- return e("unlockByline", { when: xt(e, t, n, s) });
1262
- }
1263
- function Cr(e, t = te) {
1264
- return !Number.isInteger(e) || e < 1 ? null : Er(t).format(e);
1265
- }
1266
- function Lr(e, t) {
1267
- switch (t) {
1268
- case "assignment":
1269
- return e("itemTypeAssignment");
1270
- case "quiz":
1271
- return e("itemTypeQuiz");
1272
- case "discussion":
1273
- return e("itemTypeDiscussion");
1274
- case "page":
1275
- return e("itemTypePage");
1276
- case "file":
1277
- return e("itemTypeFile");
1278
- case "external_url":
1279
- return e("itemTypeExternalUrl");
1280
- case "external_tool":
1281
- return e("itemTypeExternalTool");
1282
- case "sub_header":
1283
- return e("itemTypeSubHeader");
1284
- }
1285
- }
1286
- function Ar(e, t) {
1287
- return t == null ? null : e("pointsAbbreviated", { count: t });
1288
- }
1289
- function vr(e, t) {
1290
- switch (t.type) {
1291
- case "must_view":
1292
- return e("requirementMustView");
1293
- case "must_submit":
1294
- return e("requirementMustSubmit");
1295
- case "must_contribute":
1296
- return e("requirementMustContribute");
1297
- case "must_mark_done":
1298
- return e("requirementMustMarkDone");
1299
- case "min_score":
1300
- return t.minScore === null || t.minScore === void 0 ? e("requirementMinScoreUnknown") : e("requirementMinScore", { count: t.minScore });
1301
- case "min_percentage":
1302
- return t.minPercentage === null || t.minPercentage === void 0 ? e("requirementMinPercentageUnknown") : e("requirementMinPercentage", { count: t.minPercentage });
1303
- case "unknown":
1304
- return e("requirementUnknown");
1305
- }
1647
+ function vl(e, t, n) {
1648
+ const o = n ? ge.list(t, n) : Fs(t);
1649
+ return e.invalidateQueries({ queryKey: o });
1306
1650
  }
1307
- function Nr(e, t, n, s) {
1308
- return e("progressSummary", { percent: t, met: n, count: s });
1651
+ function xl(e, t) {
1652
+ return e.invalidateQueries({ queryKey: ge.course(t) });
1309
1653
  }
1310
- const Dr = [
1311
- "all",
1312
- "in_progress",
1313
- "complete",
1314
- "due_this_week",
1315
- "missing"
1316
- ];
1317
- function kr(e, t) {
1318
- switch (t) {
1319
- case "all":
1320
- return e("filterAll");
1321
- case "in_progress":
1322
- return e("filterInProgress");
1323
- case "complete":
1324
- return e("filterComplete");
1325
- case "due_this_week":
1326
- return e("filterDueThisWeek");
1327
- case "missing":
1328
- return e("filterMissing");
1329
- }
1330
- }
1331
- const qr = 7;
1332
- function Rr(e, t, n) {
1333
- if (t === "all") return !0;
1334
- const s = e.progress;
1335
- if (!s) return !1;
1336
- switch (t) {
1337
- case "in_progress":
1338
- return s.status === "in_progress";
1339
- case "complete":
1340
- return s.status === "all_submitted" || s.status === "all_graded";
1341
- case "missing":
1342
- return s.missingCount > 0;
1343
- case "due_this_week": {
1344
- if (!s.latestDueAt) return !1;
1345
- const r = new Date(s.latestDueAt);
1346
- if (Number.isNaN(r.getTime())) return !1;
1347
- const i = Et(r, n);
1348
- return i >= 0 && i <= qr;
1349
- }
1350
- default:
1351
- return !0;
1352
- }
1353
- }
1354
- function Fr(e, t, n) {
1355
- const s = t.trim().toLocaleLowerCase(n);
1356
- return s === "" ? !0 : e.name.toLocaleLowerCase(n).includes(s);
1357
- }
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") }) }),
1362
- /* @__PURE__ */ o(
1363
- P,
1654
+ function Qs({ value: e, onChange: t, describedBy: n }) {
1655
+ const { t: o } = k(), r = pe(), s = R(() => Ze(r.filters), [r.filters]), l = $e();
1656
+ return /* @__PURE__ */ _(T, { as: "div", margin: "medium 0 0 0", children: [
1657
+ /* @__PURE__ */ i(T, { as: "div", margin: "0 0 x-small 0", children: /* @__PURE__ */ i(P, { size: "medium", weight: "bold", id: l, children: o("filterGroupLabel") }) }),
1658
+ /* @__PURE__ */ i(
1659
+ S,
1364
1660
  {
1365
1661
  gap: "space4",
1366
1662
  wrap: "wrap",
1367
1663
  as: "div",
1368
1664
  role: "group",
1369
- "aria-labelledby": s,
1665
+ "aria-labelledby": l,
1370
1666
  "data-testid": "filter-chips",
1371
- children: Dr.map((r) => {
1372
- const i = r === e;
1373
- return /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ o(
1374
- Z,
1667
+ children: s.map((a) => {
1668
+ const d = a.key === e;
1669
+ return /* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ i(
1670
+ le,
1375
1671
  {
1376
1672
  size: "medium",
1377
- color: i ? "primary" : "secondary",
1378
- "aria-pressed": i,
1379
- onClick: () => t(r),
1380
- "data-testid": `filter-chip-${r}`,
1673
+ color: d ? "primary" : "secondary",
1674
+ "aria-pressed": d,
1675
+ "aria-describedby": a.key !== ue && Ge(a) ? n : void 0,
1676
+ onClick: () => t(a.key),
1677
+ "data-testid": `filter-chip-${a.key}`,
1381
1678
  themeOverride: { borderRadius: "0.5rem" },
1382
- children: kr(n, r)
1679
+ children: o(a.label)
1383
1680
  }
1384
- ) }, r);
1681
+ ) }, a.key);
1385
1682
  })
1386
1683
  }
1387
1684
  )
1388
1685
  ] });
1389
1686
  }
1390
- const Ur = {
1687
+ const Hs = "#586874", Vs = "#D7DADE", an = (e, t) => {
1688
+ var n, o, r, s;
1689
+ return {
1690
+ baseTextColor: ((o = (n = t.colors) == null ? void 0 : n.contrasts) == null ? void 0 : o.grey5782) ?? Hs,
1691
+ baseBorderColor: ((s = (r = t.colors) == null ? void 0 : r.contrasts) == null ? void 0 : s.grey1424) ?? Vs
1692
+ };
1693
+ }, Ks = {
1391
1694
  not_started: {},
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 = {
1695
+ in_progress: { color: "info", icon: /* @__PURE__ */ i(Et, {}) },
1696
+ complete: { color: "success", icon: /* @__PURE__ */ i(Ce, {}) },
1697
+ missing: { color: "error", icon: /* @__PURE__ */ i(Pe, {}) },
1698
+ incomplete: { color: "error", icon: /* @__PURE__ */ i(Pe, {}) },
1699
+ missing_and_incomplete: { color: "error", icon: /* @__PURE__ */ i(Pe, {}) },
1700
+ locked: { icon: /* @__PURE__ */ i(Tt, {}), themeOverride: an }
1701
+ }, Zs = {
1398
1702
  not_started: {},
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, {}) }
1703
+ in_progress: { color: "info", icon: /* @__PURE__ */ i(Et, {}) },
1704
+ complete: { color: "success", icon: /* @__PURE__ */ i(Ce, {}) },
1705
+ submitted: { color: "success", icon: /* @__PURE__ */ i(Ce, {}) },
1706
+ graded: { color: "success", icon: /* @__PURE__ */ i(Ce, {}) },
1707
+ excused: {},
1708
+ missing: { color: "error", icon: /* @__PURE__ */ i(Pe, {}) },
1709
+ locked: { icon: /* @__PURE__ */ i(Tt, {}), themeOverride: an }
1404
1710
  };
1405
- function $r(e, t) {
1711
+ function Xs(e, t, n, o) {
1406
1712
  switch (t) {
1407
1713
  case "not_started":
1408
1714
  return e("moduleStatusNotStarted");
1409
1715
  case "in_progress":
1410
1716
  return e("moduleStatusInProgress");
1411
- case "all_submitted":
1412
- return e("moduleStatusAllSubmitted");
1413
- case "all_graded":
1414
- return e("moduleStatusAllGraded");
1717
+ case "complete":
1718
+ return e("moduleStatusComplete");
1415
1719
  case "missing":
1416
- return e("moduleStatusMissing");
1720
+ return e("moduleStatusMissing", { count: n });
1721
+ case "incomplete":
1722
+ return e("moduleStatusIncomplete", { count: o });
1723
+ case "missing_and_incomplete":
1724
+ return e("moduleStatusMissingAndIncomplete", {
1725
+ missing: e("moduleStatusMissing", { count: n }),
1726
+ incomplete: e("moduleStatusIncomplete", { count: o })
1727
+ });
1417
1728
  case "locked":
1418
1729
  return e("moduleStatusLocked");
1419
1730
  }
1420
1731
  }
1421
- function Br(e, t) {
1732
+ function Js(e, t) {
1422
1733
  switch (t) {
1423
1734
  case "not_started":
1424
1735
  return e("itemStatusNotStarted");
1425
1736
  case "in_progress":
1426
1737
  return e("itemStatusInProgress");
1738
+ case "complete":
1739
+ return e("itemStatusComplete");
1427
1740
  case "submitted":
1428
1741
  return e("itemStatusSubmitted");
1429
1742
  case "graded":
1430
1743
  return e("itemStatusGraded");
1744
+ case "excused":
1745
+ return e("itemStatusExcused");
1431
1746
  case "missing":
1432
1747
  return e("itemStatusMissing");
1433
1748
  case "locked":
1434
1749
  return e("itemStatusLocked");
1435
1750
  }
1436
1751
  }
1437
- function Lt(e, t, n) {
1438
- return /* @__PURE__ */ o(Zt, { color: e.color, renderIcon: e.icon, "data-testid": n, children: t });
1752
+ function un(e, t, n) {
1753
+ return /* @__PURE__ */ i(
1754
+ Ln,
1755
+ {
1756
+ color: e.color,
1757
+ renderIcon: e.icon,
1758
+ themeOverride: e.themeOverride,
1759
+ "data-testid": n,
1760
+ children: t
1761
+ }
1762
+ );
1439
1763
  }
1440
- function Gr({ status: e }) {
1441
- const { t } = N();
1442
- return Lt(
1443
- Ur[e],
1444
- $r(t, e),
1764
+ function ei({
1765
+ status: e,
1766
+ missingCount: t,
1767
+ incompleteCount: n
1768
+ }) {
1769
+ const { t: o } = k();
1770
+ return un(
1771
+ Ks[e],
1772
+ Xs(o, e, t, n),
1445
1773
  "module-status-pill"
1446
1774
  );
1447
1775
  }
1448
- function jr({ status: e }) {
1449
- const { t } = N();
1450
- return Lt(
1451
- Or[e],
1452
- Br(t, e),
1776
+ function ti({ status: e }) {
1777
+ const { t } = k();
1778
+ return un(
1779
+ Zs[e],
1780
+ Js(t, e),
1453
1781
  "item-status-pill"
1454
1782
  );
1455
1783
  }
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 = {
1784
+ const ni = 1.75, mt = "2.75rem", oi = { lineHeight: 0, display: "block" }, ri = {
1785
+ display: "inline-block",
1786
+ paddingLeft: "0.5rem",
1787
+ marginLeft: "0.5rem"
1788
+ }, si = "#D7DADE", ii = { fontSize: 0 };
1789
+ function Ye(e) {
1790
+ return e == null || typeof e == "boolean" || e === "" ? !0 : Array.isArray(e) ? e.every(Ye) : Mt(e) && e.type === _t ? Ye(e.props.children) : !1;
1791
+ }
1792
+ const li = {
1466
1793
  contentVisibility: "auto",
1467
- containIntrinsicSize: "auto 3.5rem"
1794
+ containIntrinsicSize: "auto 3.75rem"
1468
1795
  };
1469
- function Hr({ item: e, today: t, navigation: n }) {
1470
- var p;
1471
- const { t: s, locale: r } = N(), i = e.title || s("itemUntitled");
1796
+ function ai() {
1797
+ const e = Rt();
1798
+ return "key" in e && e.key === "canvas-high-contrast" ? "inline" : "standalone";
1799
+ }
1800
+ function ui() {
1801
+ var t, n;
1802
+ const e = Rt();
1803
+ return ("colors" in e ? (n = (t = e.colors) == null ? void 0 : t.contrasts) == null ? void 0 : n.grey1424 : void 0) ?? si;
1804
+ }
1805
+ function ci({ item: e, today: t, navigation: n }) {
1806
+ var x;
1807
+ const { t: o, locale: r, timezone: s } = k(), l = ai(), a = ui(), d = R(
1808
+ () => ({ ...ri, borderLeft: `1px solid ${a}` }),
1809
+ [a]
1810
+ ), m = Ne(), u = pe(), p = R(() => Ze(u.itemMeta), [u.itemMeta]), g = e.title || o("itemUntitled");
1472
1811
  if (e.type === "sub_header")
1473
- return /* @__PURE__ */ o(
1474
- _,
1812
+ return /* @__PURE__ */ i(
1813
+ T,
1475
1814
  {
1476
1815
  as: "div",
1477
1816
  padding: "x-small small",
1478
1817
  margin: "x-small 0 0 0",
1479
1818
  "data-testid": `module-item-${e.id}`,
1480
- children: /* @__PURE__ */ o(
1481
- M,
1819
+ children: /* @__PURE__ */ i(
1820
+ P,
1482
1821
  {
1483
1822
  size: "small",
1484
1823
  weight: "bold",
@@ -1486,18 +1825,14 @@ function Hr({ item: e, today: t, navigation: n }) {
1486
1825
  letterSpacing: "expanded",
1487
1826
  "data-testid": "module-item-title",
1488
1827
  "data-sub-header": "true",
1489
- children: i
1828
+ children: g
1490
1829
  }
1491
1830
  )
1492
1831
  }
1493
1832
  );
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
- _,
1833
+ const f = ((x = n == null ? void 0 : n.getItemHref) == null ? void 0 : x.call(n, e)) ?? e.url ?? null, h = e.status === "locked", I = n == null ? void 0 : n.onItemClick, C = I ? (A) => I(e, A) : void 0, E = me(u.itemTypes, e.type), M = E != null && E.renderIcon ? E.renderIcon({ item: e }) : E == null ? void 0 : E.icon, D = { item: e, t: o, today: t, locale: r, timezone: s, formatters: m, config: u }, q = p.map((A) => ({ key: A.key, node: A.render(D) })).filter((A) => !Ye(A.node)), N = q.some((A) => A.key === Cs);
1834
+ return /* @__PURE__ */ i("div", { style: { marginLeft: `${e.indent * ni}rem`, ...li }, children: /* @__PURE__ */ i(
1835
+ T,
1501
1836
  {
1502
1837
  as: "div",
1503
1838
  background: "secondary",
@@ -1505,144 +1840,173 @@ function Hr({ item: e, today: t, navigation: n }) {
1505
1840
  padding: "x-small small",
1506
1841
  margin: "x-small 0 0 0",
1507
1842
  "data-testid": `module-item-${e.id}`,
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
- _,
1843
+ children: /* @__PURE__ */ _(S, { alignItems: "center", gap: "small", children: [
1844
+ e.indent > 0 ? /* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ i(P, { color: "secondary", children: /* @__PURE__ */ i(Sn, {}) }) }) : null,
1845
+ /* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ i(
1846
+ T,
1512
1847
  {
1513
1848
  as: "div",
1514
1849
  background: "primary",
1515
1850
  borderWidth: "small",
1516
- borderRadius: "medium",
1517
- padding: "x-small",
1518
- width: "2.25rem",
1519
- height: "2.25rem",
1520
- textAlign: "center",
1521
- children: /* @__PURE__ */ o(M, { color: "secondary", children: Yr[e.type] })
1851
+ borderRadius: "large",
1852
+ width: mt,
1853
+ height: mt,
1854
+ children: /* @__PURE__ */ i(S, { height: "100%", alignItems: "center", justifyItems: "center", children: /* @__PURE__ */ _(S.Item, { children: [
1855
+ /* @__PURE__ */ i("span", { style: oi, "data-testid": "item-type-icon", children: M }),
1856
+ E && !N ? /* @__PURE__ */ i(Je, { children: o(E.label) }) : null
1857
+ ] }) })
1522
1858
  }
1523
1859
  ) }),
1524
- /* @__PURE__ */ T(P.Item, { shouldGrow: !0, shouldShrink: !0, children: [
1525
- /* @__PURE__ */ o(_, { as: "div", children: a || !u ? /* @__PURE__ */ o(
1526
- M,
1860
+ /* @__PURE__ */ _(S.Item, { shouldGrow: !0, shouldShrink: !0, children: [
1861
+ /* @__PURE__ */ i(T, { as: "div", children: h || !f ? /* @__PURE__ */ i(
1862
+ P,
1527
1863
  {
1528
1864
  weight: "bold",
1529
1865
  size: "small",
1530
- color: a ? "secondary" : "primary",
1866
+ color: h ? "secondary" : "primary",
1531
1867
  "data-testid": "module-item-title",
1532
- "data-locked": a ? "true" : void 0,
1533
- children: i
1868
+ "data-locked": h ? "true" : void 0,
1869
+ children: g
1534
1870
  }
1535
- ) : /* @__PURE__ */ T(
1536
- Vt,
1871
+ ) : /* @__PURE__ */ _(
1872
+ wn,
1537
1873
  {
1538
- href: u,
1539
- onClick: g,
1874
+ href: f,
1875
+ onClick: C,
1540
1876
  forceButtonRole: !1,
1541
- isWithinText: !1,
1877
+ variant: l,
1542
1878
  target: e.newTab ? "_blank" : void 0,
1543
1879
  rel: e.newTab ? "noopener noreferrer" : void 0,
1544
1880
  children: [
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
1881
+ /* @__PURE__ */ i(P, { weight: "bold", size: "small", color: "primary", "data-testid": "module-item-title", children: g }),
1882
+ e.newTab ? /* @__PURE__ */ i(Je, { children: ` ${o("opensInNewWindow")}` }) : null
1547
1883
  ]
1548
1884
  }
1549
1885
  ) }),
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: [
1551
- h > 0 ? /* @__PURE__ */ o("span", { "aria-hidden": "true", children: " | " }) : null,
1552
- /* @__PURE__ */ o("span", { children: f })
1553
- ] }, f)) }) })
1886
+ /* @__PURE__ */ i(T, { as: "div", children: /* @__PURE__ */ i(P, { size: "x-small", color: "secondary", "data-testid": "module-item-meta", children: q.map((A, z) => /* @__PURE__ */ _(_t, { children: [
1887
+ z > 0 ? /* @__PURE__ */ i("span", { style: ii, children: " " }) : null,
1888
+ /* @__PURE__ */ i("span", { style: z > 0 ? d : void 0, children: A.node })
1889
+ ] }, A.key)) }) })
1554
1890
  ] }),
1555
- e.status ? /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ o(jr, { status: e.status }) }) : null
1891
+ e.status ? /* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ i(ti, { status: e.status }) }) : null
1556
1892
  ] })
1557
1893
  }
1558
1894
  ) });
1559
1895
  }
1560
- const Kr = Ge(Hr), Re = "3rem";
1561
- function Vr({
1896
+ const di = yt(ci), pt = "3rem";
1897
+ function mi({
1562
1898
  label: e,
1563
1899
  dimmed: t = !1
1564
1900
  }) {
1565
- return e === null ? null : /* @__PURE__ */ o(
1566
- _,
1901
+ return e === null ? null : /* @__PURE__ */ i(
1902
+ T,
1567
1903
  {
1568
1904
  as: "div",
1569
1905
  display: "inline-block",
1570
1906
  borderWidth: "small",
1571
1907
  borderRadius: "large",
1572
1908
  borderColor: t ? "primary" : "secondary",
1573
- minWidth: Re,
1574
- height: Re,
1909
+ minWidth: pt,
1910
+ height: pt,
1575
1911
  padding: "0 xx-small",
1576
1912
  "data-testid": "module-number",
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 }) })
1913
+ children: /* @__PURE__ */ i(S, { height: "100%", alignItems: "center", justifyItems: "center", children: /* @__PURE__ */ i(P, { weight: "bold", size: "medium", color: t ? "secondary" : "primary", children: e }) })
1578
1914
  }
1579
1915
  );
1580
1916
  }
1581
- function Zr({ module: e, today: t }) {
1582
- var a, c;
1583
- const { t: n, locale: s } = N(), r = ((a = e.progress) == null ? void 0 : a.status) === "locked", i = e.unlockAt;
1584
- if (r && i)
1585
- return /* @__PURE__ */ o(M, { size: "small", color: "secondary", "data-testid": "module-byline", children: qe(n, i, t, s) });
1586
- if (r)
1587
- return /* @__PURE__ */ o(M, { size: "small", color: "secondary", "data-testid": "module-byline", children: n("lockedByline") });
1588
- const u = (c = e.progress) == null ? void 0 : c.latestDueAt;
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;
1590
- }
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,
1596
- {
1597
- size: "x-small",
1598
- meterColor: n.percentComplete >= 100 ? "success" : "brand",
1599
- valueNow: n.requirementsMet,
1600
- valueMax: Math.max(n.requirementCount, 1),
1601
- shouldAnimate: !1,
1602
- screenReaderLabel: t("moduleProgressScreenReaderLabel", { name: e.name })
1603
- }
1604
- ) }),
1605
- /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ o(M, { size: "small", color: "secondary", children: Nr(
1606
- t,
1607
- n.percentComplete,
1608
- n.requirementsMet,
1609
- n.requirementCount
1610
- ) }) })
1611
- ] });
1917
+ function pi({ module: e, today: t }) {
1918
+ var a;
1919
+ const { t: n } = k(), o = Ne(), r = ((a = e.progress) == null ? void 0 : a.status) === "locked", s = e.unlockAt;
1920
+ let l = null;
1921
+ return r && s ? l = o.unlockByline(s, t) : r ? l = n("lockedByline") : !e.progress && s && (l = o.unlockByline(s, t)), l === null ? null : /* @__PURE__ */ i(T, { as: "div", margin: "xxx-small 0 0 0", children: /* @__PURE__ */ i(P, { size: "small", color: "secondary", "data-testid": "module-byline", children: l }) });
1612
1922
  }
1613
- const Fe = (e) => `platform-modules-panel-${e}`;
1614
- function Jr({
1923
+ const gi = "#273540", fi = "#D7DADE", hi = "0.5rem", Ii = (e, t) => {
1924
+ var n, o, r, s, l;
1925
+ return {
1926
+ meterColorBrand: ((o = (n = t.colors) == null ? void 0 : n.contrasts) == null ? void 0 : o.grey125125) ?? gi,
1927
+ borderRadius: String(((r = t.borders) == null ? void 0 : r.radiusLarge) ?? hi),
1928
+ borderColor: ((l = (s = t.colors) == null ? void 0 : s.contrasts) == null ? void 0 : l.grey1424) ?? fi,
1929
+ trackBottomBorderColor: "transparent"
1930
+ };
1931
+ }, bi = "66.667%", Si = "8rem", Mi = 2;
1932
+ function yi({
1933
+ module: e,
1934
+ breakpoints: t
1935
+ }) {
1936
+ const { t: n } = k(), o = Ne(), r = e.progress;
1937
+ if (!r || r.status === "locked" || r.requirementCount <= 0) return null;
1938
+ const s = t.mobileOnly, l = Object.keys(t).length === 0 || t.desktop === !0;
1939
+ return /* @__PURE__ */ _(
1940
+ S,
1941
+ {
1942
+ width: l ? bi : "100%",
1943
+ direction: s ? "column" : "row",
1944
+ alignItems: s ? "stretch" : "center",
1945
+ wrap: "wrap",
1946
+ gap: "x-small",
1947
+ margin: "small 0 0 0",
1948
+ "data-testid": "module-progress",
1949
+ children: [
1950
+ /* @__PURE__ */ i(S.Item, { size: s ? void 0 : Si, shouldGrow: !0, children: /* @__PURE__ */ i(
1951
+ Cn,
1952
+ {
1953
+ size: "x-small",
1954
+ meterColor: "brand",
1955
+ valueNow: r.requirementsMet,
1956
+ valueMax: r.requirementCount,
1957
+ shouldAnimate: !1,
1958
+ screenReaderLabel: n("moduleProgressScreenReaderLabel", { name: e.name }),
1959
+ formatScreenReaderValue: () => ys(
1960
+ n,
1961
+ r.percentComplete,
1962
+ r.requirementsMet,
1963
+ r.requirementCount
1964
+ ),
1965
+ themeOverride: Ii
1966
+ }
1967
+ ) }),
1968
+ /* @__PURE__ */ i(S.Item, { shouldShrink: !0, "aria-hidden": "true", children: /* @__PURE__ */ i(P, { size: "small", color: "secondary", children: o.progress(
1969
+ r.percentComplete,
1970
+ r.requirementsMet,
1971
+ r.requirementCount
1972
+ ) }) })
1973
+ ]
1974
+ }
1975
+ );
1976
+ }
1977
+ const gt = (e) => `platform-modules-panel-${e}`;
1978
+ function _i({
1615
1979
  module: e,
1616
1980
  state: t,
1617
1981
  today: n,
1618
- navigation: s,
1982
+ navigation: o,
1619
1983
  showDiagnostics: r
1620
1984
  }) {
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(
1624
- i("itemsLoadedAnnouncement", {
1985
+ const { t: s } = k(), l = Y(null), a = t.items.length, d = !t.isLoading && !t.isFetchingNextPage;
1986
+ return Le(() => {
1987
+ !d || a === 0 || l.current !== a && (l.current = a, wt(
1988
+ s("itemsLoadedAnnouncement", {
1625
1989
  loaded: a,
1626
1990
  count: e.itemCount,
1627
1991
  name: e.name
1628
1992
  })
1629
1993
  ));
1630
- }, [c, a, e.itemCount, e.name, i]), t.error ? /* @__PURE__ */ o(_, { as: "div", margin: "small 0 0 0", children: /* @__PURE__ */ o(
1631
- We,
1994
+ }, [d, a, e.itemCount, e.name, s]), t.error ? /* @__PURE__ */ i(T, { as: "div", margin: "small 0 0 0", children: /* @__PURE__ */ i(
1995
+ At,
1632
1996
  {
1633
1997
  variant: "error",
1634
1998
  margin: "0",
1635
- liveRegion: Qe,
1999
+ liveRegion: Lt,
1636
2000
  liveRegionPoliteness: "assertive",
1637
2001
  "data-testid": "items-error",
1638
- children: i("itemsLoadErrorAlert", { message: t.error.message })
2002
+ children: s("itemsLoadErrorAlert", { message: t.error.message })
1639
2003
  }
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") }),
2004
+ ) }) : t.isLoading ? /* @__PURE__ */ _(T, { as: "div", margin: "small 0 0 0", "data-testid": "items-loading", children: [
2005
+ /* @__PURE__ */ i(xt, { size: "x-small", renderTitle: s("itemsLoadingSpinnerLabel") }),
1642
2006
  " ",
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: [
2007
+ /* @__PURE__ */ i(P, { size: "small", color: "secondary", children: s("itemsLoadingText") })
2008
+ ] }) : /* @__PURE__ */ _(T, { as: "div", margin: "small 0 0 0", children: [
2009
+ r ? /* @__PURE__ */ _(P, { size: "x-small", color: "secondary", "data-testid": "items-source", children: [
1646
2010
  "items source: ",
1647
2011
  t.source,
1648
2012
  " · loaded ",
@@ -1650,15 +2014,15 @@ function Jr({
1650
2014
  " of ",
1651
2015
  e.itemCount
1652
2016
  ] }) : null,
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,
2017
+ t.items.length === 0 ? /* @__PURE__ */ i(T, { as: "div", padding: "small", "data-testid": "items-empty", children: /* @__PURE__ */ i(P, { size: "small", color: "secondary", children: s("noItemsEmptyState") }) }) : /* @__PURE__ */ i("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, "data-testid": "items-list", children: t.items.map((m) => /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(di, { item: m, today: n, navigation: o }) }, m.id)) }),
2018
+ t.hasNextPage ? /* @__PURE__ */ i(T, { as: "div", margin: "small 0 0 0", textAlign: "center", children: /* @__PURE__ */ i(
2019
+ le,
1656
2020
  {
1657
2021
  size: "small",
1658
2022
  onClick: t.fetchNextPage,
1659
2023
  interaction: t.isFetchingNextPage ? "disabled" : "enabled",
1660
2024
  "data-testid": "load-more-items",
1661
- children: t.isFetchingNextPage ? i("loadMoreItemsLoading") : i("loadMoreItems", {
2025
+ children: t.isFetchingNextPage ? s("loadMoreItemsLoading") : s("loadMoreItems", {
1662
2026
  loaded: t.items.length,
1663
2027
  count: e.itemCount
1664
2028
  })
@@ -1666,91 +2030,102 @@ function Jr({
1666
2030
  ) }) : null
1667
2031
  ] });
1668
2032
  }
1669
- function eo({
2033
+ function Ti({
1670
2034
  module: e,
1671
2035
  expanded: t,
1672
2036
  onToggle: n,
1673
- itemsState: s,
2037
+ itemsState: o,
1674
2038
  today: r,
1675
- navigation: i,
1676
- showDiagnostics: u = !1,
2039
+ navigation: s,
2040
+ showDiagnostics: l = !1,
1677
2041
  headingLevel: a = "h3",
1678
- moduleLabel: c
2042
+ moduleLabel: d,
2043
+ breakpoints: m = {}
1679
2044
  }) {
1680
- var p;
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
- _,
2045
+ var h, I;
2046
+ const { t: u } = k(), p = Ne(), g = ((h = e.progress) == null ? void 0 : h.status) === "locked", f = d === void 0 ? p.moduleLabel(e.position, e) : d;
2047
+ return /* @__PURE__ */ _(
2048
+ T,
1684
2049
  {
1685
2050
  as: "div",
1686
2051
  background: "primary",
1687
2052
  borderRadius: "large",
1688
2053
  borderWidth: "small",
1689
2054
  shadow: "resting",
1690
- padding: "medium",
2055
+ padding: "small",
1691
2056
  margin: "0 0 small 0",
1692
2057
  "data-testid": `module-card-${e.id}`,
1693
2058
  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: [
1698
- /* @__PURE__ */ o(
1699
- He,
2059
+ /* @__PURE__ */ _(S, { alignItems: "start", gap: "mediumSmall", "data-testid": "module-header", children: [
2060
+ f !== null ? /* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ i(mi, { label: f, dimmed: g }) }) : null,
2061
+ /* @__PURE__ */ _(S.Item, { shouldGrow: !0, shouldShrink: !0, children: [
2062
+ /* @__PURE__ */ _(T, { as: "div", children: [
2063
+ /* @__PURE__ */ i(
2064
+ vt,
1700
2065
  {
1701
2066
  level: a,
1702
- themeOverride: { h2FontSize: "1.375rem", h3FontSize: "1.375rem" },
2067
+ variant: "titleCardRegular",
2068
+ color: g ? "secondary" : "primary",
1703
2069
  "data-testid": "module-name",
1704
- children: /* @__PURE__ */ o(M, { size: "large", weight: "bold", color: m ? "secondary" : "primary", children: e.name })
2070
+ children: /* @__PURE__ */ i(Pn, { linesAllowed: Mi, children: e.name })
1705
2071
  }
1706
2072
  ),
1707
- e.published ? null : /* @__PURE__ */ T(M, { size: "x-small", color: "secondary", children: [
2073
+ e.published ? null : /* @__PURE__ */ _(P, { size: "x-small", color: "secondary", children: [
1708
2074
  " ",
1709
- g("moduleUnpublishedBadge")
2075
+ u("moduleUnpublishedBadge")
1710
2076
  ] })
1711
2077
  ] }),
1712
- /* @__PURE__ */ o(_, { as: "div", children: /* @__PURE__ */ o(Zr, { module: e, today: r }) }),
1713
- /* @__PURE__ */ o(Xr, { module: e })
2078
+ /* @__PURE__ */ i(pi, { module: e, today: r }),
2079
+ /* @__PURE__ */ i(yi, { module: e, breakpoints: m })
1714
2080
  ] }),
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,
1718
- {
1719
- size: "small",
1720
- withBorder: !0,
1721
- withBackground: !1,
1722
- screenReaderLabel: t ? g("collapseModule", { name: e.name }) : g("expandModule", { name: e.name }),
1723
- "aria-expanded": t,
1724
- "aria-controls": Fe(e.id),
1725
- onClick: () => n(e.id),
1726
- "data-testid": `toggle-module-${e.id}`,
1727
- children: t ? /* @__PURE__ */ o(Qt, {}) : /* @__PURE__ */ o(Xe, {})
1728
- }
1729
- ) })
2081
+ /* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ _(S, { alignItems: "center", gap: "mediumSmall", children: [
2082
+ (I = e.progress) != null && I.status ? /* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ i(
2083
+ ei,
2084
+ {
2085
+ status: e.progress.status,
2086
+ missingCount: e.progress.missingCount,
2087
+ incompleteCount: e.progress.incompleteCount
2088
+ }
2089
+ ) }) : null,
2090
+ /* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ i(
2091
+ En,
2092
+ {
2093
+ size: "medium",
2094
+ withBorder: !0,
2095
+ withBackground: !1,
2096
+ screenReaderLabel: t ? u("collapseModule", { name: e.name }) : u("expandModule", { name: e.name }),
2097
+ "aria-expanded": t,
2098
+ "aria-controls": gt(e.id),
2099
+ onClick: () => n(e.id),
2100
+ "data-testid": `toggle-module-${e.id}`,
2101
+ children: t ? /* @__PURE__ */ i(Mn, {}) : /* @__PURE__ */ i(Pt, {})
2102
+ }
2103
+ ) })
2104
+ ] }) })
1730
2105
  ] }),
1731
- /* @__PURE__ */ o("div", { id: Fe(e.id), role: "group", "aria-label": e.name, hidden: !t, children: t ? /* @__PURE__ */ o(
1732
- Jr,
2106
+ /* @__PURE__ */ i("div", { id: gt(e.id), role: "group", "aria-label": e.name, hidden: !t, children: t ? /* @__PURE__ */ i(
2107
+ _i,
1733
2108
  {
1734
2109
  module: e,
1735
- state: s,
2110
+ state: o,
1736
2111
  today: r,
1737
- navigation: i,
1738
- showDiagnostics: u
2112
+ navigation: s,
2113
+ showDiagnostics: l
1739
2114
  }
1740
2115
  ) : null })
1741
2116
  ]
1742
2117
  }
1743
2118
  );
1744
2119
  }
1745
- const to = Ge(eo);
1746
- function no({
2120
+ const Ei = yt(Ti);
2121
+ function Pi({
1747
2122
  counts: e,
1748
2123
  itemsMode: t,
1749
2124
  loadedModules: n
1750
2125
  }) {
1751
- const s = e.listModules + e.listModuleItems;
1752
- return /* @__PURE__ */ o(
1753
- _,
2126
+ const o = e.listModules + e.listModuleItems;
2127
+ return /* @__PURE__ */ i(
2128
+ T,
1754
2129
  {
1755
2130
  as: "div",
1756
2131
  background: "secondary",
@@ -1759,25 +2134,25 @@ function no({
1759
2134
  padding: "x-small small",
1760
2135
  margin: "0 0 small 0",
1761
2136
  "data-testid": "dev-diagnostics",
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: [
2137
+ children: /* @__PURE__ */ _(S, { gap: "medium", wrap: "wrap", children: [
2138
+ /* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ i(P, { size: "x-small", weight: "bold", children: "Adapter requests" }) }),
2139
+ /* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ _(P, { size: "x-small", "data-testid": "request-count-list-modules", children: [
1765
2140
  "listModules: ",
1766
2141
  e.listModules
1767
2142
  ] }) }),
1768
- /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ T(M, { size: "x-small", "data-testid": "request-count-list-module-items", children: [
2143
+ /* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ _(P, { size: "x-small", "data-testid": "request-count-list-module-items", children: [
1769
2144
  "listModuleItems: ",
1770
2145
  e.listModuleItems
1771
2146
  ] }) }),
1772
- /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ T(M, { size: "x-small", weight: "bold", "data-testid": "request-count-total", children: [
2147
+ /* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ _(P, { size: "x-small", weight: "bold", "data-testid": "request-count-total", children: [
1773
2148
  "total: ",
1774
- s
2149
+ o
1775
2150
  ] }) }),
1776
- /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ T(M, { size: "x-small", "data-testid": "resolved-items-mode", children: [
2151
+ /* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ _(P, { size: "x-small", "data-testid": "resolved-items-mode", children: [
1777
2152
  "itemsMode: ",
1778
2153
  t ?? "probing…"
1779
2154
  ] }) }),
1780
- /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ T(M, { size: "x-small", "data-testid": "modules-loaded-count", children: [
2155
+ /* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ _(P, { size: "x-small", "data-testid": "modules-loaded-count", children: [
1781
2156
  "modules loaded: ",
1782
2157
  n
1783
2158
  ] }) })
@@ -1785,112 +2160,133 @@ function no({
1785
2160
  }
1786
2161
  );
1787
2162
  }
1788
- function ri({
2163
+ function Ci({
1789
2164
  data: e,
1790
2165
  courseName: t,
1791
2166
  courseContext: n,
1792
- today: s,
2167
+ today: o,
1793
2168
  requestCounts: r,
1794
- showDiagnostics: i = r !== void 0,
1795
- initialFilter: u = "all",
1796
- navigation: a,
1797
- as: c = "div",
1798
- headingLevel: g = "h2"
2169
+ showDiagnostics: s = r !== void 0,
2170
+ navigation: l,
2171
+ as: a = "div",
2172
+ headingLevel: d = "h2",
2173
+ breakpoints: m = {}
1799
2174
  }) {
1800
- const {
1801
- modules: l,
1802
- hasNextPage: m,
1803
- fetchNextPage: S,
1804
- isFetchingNextPage: p,
1805
- isLoading: f,
1806
- error: h,
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());
1817
- }, [p, l.length, E]);
1818
- const z = v(
1819
- () => l.filter(
1820
- (I) => Fr(I, R, G) && Rr(I, D, W)
2175
+ const { miniTablet: u, tablet: p, desktop: g, desktopNavOpen: f, desktopOnly: h, mobileOnly: I, ICEDesktop: C } = m, E = R(
2176
+ () => ({ miniTablet: u, tablet: p, desktop: g, desktopNavOpen: f, desktopOnly: h, mobileOnly: I, ICEDesktop: C }),
2177
+ [u, p, g, f, h, I, C]
2178
+ ), {
2179
+ modules: M,
2180
+ hasNextPage: D,
2181
+ fetchNextPage: q,
2182
+ isFetchingNextPage: N,
2183
+ isLoading: x,
2184
+ error: A,
2185
+ itemsMode: z,
2186
+ expandedModuleIds: $,
2187
+ toggleModule: X,
2188
+ expandModule: fe,
2189
+ collapseModule: he,
2190
+ getItems: Fe,
2191
+ filter: J,
2192
+ setFilter: ee,
2193
+ filterEntry: Ie,
2194
+ filterPredicate: W,
2195
+ filterResultsArePartial: Q
2196
+ } = e, { t: w, locale: te, timezone: be } = k(), ne = t ?? w("pageTitle"), [B, Se] = ae(""), oe = Y(null), re = $e(), y = $e(), b = Y(!1), [v] = ae(() => /* @__PURE__ */ new Date()), j = o ?? v;
2197
+ Le(() => {
2198
+ var L;
2199
+ !b.current || N || (b.current = !1, wt(w("modulesLoadedAnnouncement", { count: M.length })), (L = oe.current) == null || L.focus());
2200
+ }, [N, M.length, w]);
2201
+ const O = R(
2202
+ () => M.filter(
2203
+ (L) => _s(L, B, te) && (W === void 0 || W(L, { today: j, timezone: be }))
1821
2204
  ),
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: [
2205
+ [M, B, W, j, te, be]
2206
+ ), Me = () => {
2207
+ for (const L of O) fe(L.id);
2208
+ }, U = () => {
2209
+ for (const L of $) he(L);
2210
+ }, ye = B.trim() !== "" || Ie !== void 0 && J !== ue, se = O.length === 0 && !x && !A, _e = se && ye;
2211
+ return /* @__PURE__ */ _(T, { as: a, display: "block", "data-testid": "modules-list", children: [
2212
+ n ? /* @__PURE__ */ _(T, { as: "div", children: [
2213
+ /* @__PURE__ */ i(P, { size: "small", color: "brand", children: n }),
2214
+ /* @__PURE__ */ _(P, { size: "small", color: "secondary", children: [
1832
2215
  " ",
1833
2216
  "/",
1834
2217
  " "
1835
2218
  ] }),
1836
- /* @__PURE__ */ o(M, { size: "small", color: "secondary", children: j })
2219
+ /* @__PURE__ */ i(P, { size: "small", color: "secondary", children: ne })
1837
2220
  ] }) : null,
1838
- /* @__PURE__ */ o(He, { level: g, margin: "x-small 0 medium 0", children: j }),
1839
- r ? /* @__PURE__ */ o(
1840
- no,
2221
+ /* @__PURE__ */ i(vt, { level: d, margin: "x-small 0 medium 0", children: ne }),
2222
+ r ? /* @__PURE__ */ i(
2223
+ Pi,
1841
2224
  {
1842
2225
  counts: r,
1843
- itemsMode: w,
1844
- loadedModules: l.length
2226
+ itemsMode: z,
2227
+ loadedModules: M.length
1845
2228
  }
1846
2229
  ) : null,
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,
2230
+ /* @__PURE__ */ _(S, { gap: "small", wrap: "wrap", alignItems: "end", children: [
2231
+ /* @__PURE__ */ i(S.Item, { size: "24rem", shouldShrink: !0, children: /* @__PURE__ */ i(
2232
+ vn,
1850
2233
  {
1851
- renderLabel: E("moduleSearchLabel"),
1852
- placeholder: E("searchPlaceholder"),
2234
+ renderLabel: w("moduleSearchLabel"),
2235
+ placeholder: w("searchPlaceholder"),
1853
2236
  "aria-describedby": re,
1854
- value: R,
1855
- onChange: (I, H) => Y(H),
1856
- renderBeforeInput: /* @__PURE__ */ o(Wt, { inline: !1 }),
2237
+ value: B,
2238
+ onChange: (L, dn) => Se(dn),
2239
+ renderBeforeInput: /* @__PURE__ */ i(yn, { inline: !1 }),
1857
2240
  "data-testid": "modules-search"
1858
2241
  }
1859
2242
  ) }),
1860
- /* @__PURE__ */ o(P.Item, { shouldGrow: !0 }),
1861
- /* @__PURE__ */ o(P.Item, { children: /* @__PURE__ */ T(
1862
- be,
2243
+ /* @__PURE__ */ i(S.Item, { shouldGrow: !0 }),
2244
+ /* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ _(
2245
+ Ue,
1863
2246
  {
1864
2247
  placement: "bottom end",
1865
- trigger: /* @__PURE__ */ o(Z, { renderIcon: /* @__PURE__ */ o(Xe, {}), "data-testid": "expand-collapse-trigger", children: E("expandCollapseTrigger") }),
2248
+ trigger: /* @__PURE__ */ i(le, { renderIcon: /* @__PURE__ */ i(Pt, {}), "data-testid": "expand-collapse-trigger", children: w("expandCollapseTrigger") }),
1866
2249
  children: [
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") })
2250
+ /* @__PURE__ */ i(Ue.Item, { onSelect: Me, "data-testid": "expand-all", children: w("expandAll") }),
2251
+ /* @__PURE__ */ i(Ue.Item, { onSelect: U, "data-testid": "collapse-all", children: w("collapseAll") })
1869
2252
  ]
1870
2253
  }
1871
2254
  ) })
1872
2255
  ] }),
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: [
1876
- h ? (
1877
- // `liveRegion` is what makes this announce; without it InstUI's Alert
1878
- // sets no role and no aria-live. See the same fix in ModuleCard.
1879
- /* @__PURE__ */ o(
1880
- We,
1881
- {
1882
- variant: "error",
1883
- margin: "0 0 small 0",
1884
- liveRegion: Qe,
1885
- liveRegionPoliteness: "assertive",
1886
- "data-testid": "modules-error",
1887
- children: E("modulesLoadErrorAlert", { message: h.message })
1888
- }
1889
- )
2256
+ /* @__PURE__ */ i(T, { as: "div", margin: "xx-small 0 0 0", children: /* @__PURE__ */ i(P, { size: "x-small", color: "secondary", id: re, children: w("searchScopeHint") }) }),
2257
+ /* @__PURE__ */ i(
2258
+ Qs,
2259
+ {
2260
+ value: J,
2261
+ onChange: ee,
2262
+ describedBy: Q ? y : void 0
2263
+ }
2264
+ ),
2265
+ Q ? /* @__PURE__ */ i(T, { as: "div", margin: "x-small 0 0 0", children: /* @__PURE__ */ i(
2266
+ P,
2267
+ {
2268
+ size: "x-small",
2269
+ color: "secondary",
2270
+ id: y,
2271
+ "data-testid": "filter-partial-hint",
2272
+ children: w("filterScopeHint")
2273
+ }
2274
+ ) }) : null,
2275
+ /* @__PURE__ */ _(T, { as: "div", margin: "medium 0 0 0", children: [
2276
+ A ? /* @__PURE__ */ i(
2277
+ At,
2278
+ {
2279
+ variant: "error",
2280
+ margin: "0 0 small 0",
2281
+ liveRegion: Lt,
2282
+ liveRegionPoliteness: "assertive",
2283
+ "data-testid": "modules-error",
2284
+ children: w("modulesLoadErrorAlert", { message: A.message })
2285
+ }
1890
2286
  ) : null,
1891
- f ? /* @__PURE__ */ o(_, { as: "div", padding: "large", textAlign: "center", "data-testid": "modules-loading", children: /* @__PURE__ */ o(Je, { renderTitle: E("modulesLoadingSpinnerLabel") }) }) : null,
1892
- !f && !h && l.length === 0 ? /* @__PURE__ */ o(
1893
- _,
2287
+ x ? /* @__PURE__ */ i(T, { as: "div", padding: "large", textAlign: "center", "data-testid": "modules-loading", children: /* @__PURE__ */ i(xt, { renderTitle: w("modulesLoadingSpinnerLabel") }) }) : null,
2288
+ se && !ye ? /* @__PURE__ */ i(
2289
+ T,
1894
2290
  {
1895
2291
  as: "div",
1896
2292
  background: "secondary",
@@ -1898,11 +2294,11 @@ function ri({
1898
2294
  padding: "large",
1899
2295
  textAlign: "center",
1900
2296
  "data-testid": "modules-empty",
1901
- children: /* @__PURE__ */ o(M, { color: "secondary", children: E("noModulesEmptyState") })
2297
+ children: /* @__PURE__ */ i(P, { color: "secondary", children: w("noModulesEmptyState") })
1902
2298
  }
1903
2299
  ) : null,
1904
- b ? /* @__PURE__ */ T(
1905
- _,
2300
+ _e ? /* @__PURE__ */ _(
2301
+ T,
1906
2302
  {
1907
2303
  as: "div",
1908
2304
  background: "secondary",
@@ -1911,61 +2307,64 @@ function ri({
1911
2307
  textAlign: "center",
1912
2308
  "data-testid": "modules-filtered-empty",
1913
2309
  children: [
1914
- /* @__PURE__ */ o(_, { as: "div", margin: "0 0 small 0", children: /* @__PURE__ */ o(M, { color: "secondary", children: E("filteredEmptyState", { count: l.length }) }) }),
1915
- /* @__PURE__ */ o(
1916
- Z,
2310
+ /* @__PURE__ */ i(T, { as: "div", margin: "0 0 small 0", children: /* @__PURE__ */ i(P, { color: "secondary", children: M.length === 0 ? w("noFilterMatches") : w("filteredEmptyState", { count: M.length }) }) }),
2311
+ /* @__PURE__ */ i(
2312
+ le,
1917
2313
  {
1918
2314
  size: "small",
1919
2315
  onClick: () => {
1920
- F("all"), Y(""), k.current = !0;
2316
+ ee(ue), Se(""), b.current = !0;
1921
2317
  },
1922
- children: E("clearFilters")
2318
+ children: w("clearFilters")
1923
2319
  }
1924
2320
  )
1925
2321
  ]
1926
2322
  }
1927
2323
  ) : null,
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,
2324
+ /* @__PURE__ */ i("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, "data-testid": "modules-stack", children: O.map((L) => /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
2325
+ Ei,
1930
2326
  {
1931
- module: I,
1932
- expanded: x.includes(I.id),
1933
- onToggle: L,
1934
- itemsState: se(I.id),
1935
- today: W,
1936
- showDiagnostics: i,
1937
- navigation: a,
1938
- headingLevel: g === "h1" ? "h2" : "h3"
2327
+ module: L,
2328
+ expanded: $.includes(L.id),
2329
+ onToggle: X,
2330
+ itemsState: Fe(L.id),
2331
+ today: j,
2332
+ showDiagnostics: s,
2333
+ navigation: l,
2334
+ headingLevel: d === "h1" ? "h2" : "h3",
2335
+ breakpoints: E
1939
2336
  }
1940
- ) }, I.id)) })
2337
+ ) }, L.id)) })
1941
2338
  ] }),
1942
- m ? /* @__PURE__ */ o(_, { as: "div", textAlign: "center", margin: "small 0 0 0", children: /* @__PURE__ */ o(
1943
- Z,
2339
+ D ? /* @__PURE__ */ i(T, { as: "div", textAlign: "center", margin: "small 0 0 0", children: /* @__PURE__ */ i(
2340
+ le,
1944
2341
  {
1945
2342
  color: "primary",
1946
2343
  onClick: () => {
1947
- k.current = !0, S();
2344
+ b.current = !0, q();
1948
2345
  },
1949
- interaction: p ? "disabled" : "enabled",
2346
+ interaction: N ? "disabled" : "enabled",
1950
2347
  "data-testid": "load-more-modules",
1951
- children: p ? E("loadMoreModulesLoading") : E("loadMoreModules", { count: l.length })
2348
+ children: N ? w("loadMoreModulesLoading") : w("loadMoreModules", { count: M.length })
1952
2349
  }
1953
- ) }) : l.length > 0 ? /* @__PURE__ */ o(_, { as: "div", textAlign: "center", margin: "small 0 0 0", children: /* @__PURE__ */ o(
1954
- M,
2350
+ ) }) : M.length > 0 ? /* @__PURE__ */ i(T, { as: "div", textAlign: "center", margin: "small 0 0 0", children: /* @__PURE__ */ i(
2351
+ P,
1955
2352
  {
1956
2353
  size: "x-small",
1957
2354
  color: "secondary",
1958
2355
  "data-testid": "modules-all-loaded",
1959
- elementRef: (I) => {
1960
- Q.current = I;
2356
+ elementRef: (L) => {
2357
+ oe.current = L;
1961
2358
  },
1962
2359
  tabIndex: -1,
1963
- children: E("allModulesLoaded", { count: l.length })
2360
+ children: w("allModulesLoaded", { count: M.length })
1964
2361
  }
1965
2362
  ) }) : null
1966
2363
  ] });
1967
2364
  }
1968
- const X = [
2365
+ const Rl = An(
2366
+ Ci
2367
+ ), ce = [
1969
2368
  "assignment",
1970
2369
  "quiz",
1971
2370
  "discussion",
@@ -1974,156 +2373,269 @@ const X = [
1974
2373
  "external_url",
1975
2374
  "external_tool",
1976
2375
  "sub_header"
1977
- ], ye = [
2376
+ ], We = [
1978
2377
  "not_started",
1979
2378
  "in_progress",
1980
- "all_submitted",
1981
- "all_graded",
2379
+ "complete",
1982
2380
  "missing",
2381
+ "incomplete",
2382
+ "missing_and_incomplete",
1983
2383
  "locked"
1984
- ], ze = [
2384
+ ], ft = [
1985
2385
  "must_view",
1986
2386
  "must_submit",
1987
2387
  "must_contribute",
1988
2388
  "must_mark_done",
1989
2389
  "min_score",
1990
2390
  "min_percentage"
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];
2391
+ ], wi = ["assignment", "quiz", "discussion"], Li = ["external_url", "external_tool"], Ai = ["assignment", "quiz", "discussion"], vi = Date.UTC(2025, 0, 6), xi = 864e5, Z = "1", cn = (e) => new Date(vi + e * xi).toISOString(), Ri = (e, t) => {
2392
+ const n = ft[Math.floor(t / 3) % ft.length];
1993
2393
  return n === "min_score" ? { itemId: e, type: n, minScore: 10 } : n === "min_percentage" ? { itemId: e, type: n, minPercentage: 80 } : { itemId: e, type: n };
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) => {
1995
- const r = n ? "in_progress" : "not_started";
2394
+ }, Di = (e, t) => t % 3 === 0 && e !== "sub_header", ke = (e) => We[(e - 1) % We.length], Ni = (e, t) => !Ai.includes(e) || e === "discussion" && Math.floor(t / ce.length) % 2 === 1 ? null : 5 + t % 4 * 5, qi = (e, t, n, o) => {
2395
+ const r = n ? "complete" : "not_started";
1996
2396
  switch (e) {
1997
2397
  case "locked":
1998
2398
  return "locked";
1999
2399
  case "not_started":
2000
2400
  return "not_started";
2001
- case "all_submitted":
2002
- return t ? "submitted" : r;
2003
- case "all_graded":
2004
- return t ? "graded" : r;
2401
+ case "complete":
2402
+ return t ? o === 0 ? "excused" : "graded" : r;
2005
2403
  case "missing":
2006
- return n ? t ? "missing" : "not_started" : t ? s % 2 === 0 ? "missing" : "graded" : "not_started";
2404
+ return n ? t ? "missing" : "not_started" : t ? o % 2 === 0 ? "missing" : "graded" : "not_started";
2405
+ case "incomplete":
2406
+ return n ? t ? "graded" : r : t ? o % 2 === 0 ? "graded" : "submitted" : "not_started";
2407
+ case "missing_and_incomplete":
2408
+ return n ? t ? "graded" : r : t ? o === 1 ? "missing" : "graded" : "not_started";
2007
2409
  case "in_progress":
2008
- return t ? s % 3 === 0 ? "submitted" : s % 3 === 1 ? "in_progress" : "not_started" : s % 2 === 0 ? r : "not_started";
2410
+ return t ? o % 3 === 0 ? "submitted" : o % 3 === 1 ? "in_progress" : "not_started" : o % 2 === 0 ? r : "not_started";
2009
2411
  }
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;
2412
+ }, ki = /* @__PURE__ */ new Set([
2413
+ "submitted",
2414
+ "graded",
2415
+ "excused",
2416
+ "complete"
2417
+ ]), Oi = (e) => e.status !== void 0 && ki.has(e.status), Fi = (e) => {
2418
+ var t, n;
2419
+ return ((t = e.completionRequirement) == null ? void 0 : t.type) === "min_score" || ((n = e.completionRequirement) == null ? void 0 : n.type) === "min_percentage";
2420
+ }, Ui = (e, t, n, o, r, s, l, a) => {
2421
+ const d = String(e), m = ce[o % ce.length], u = m === "sub_header", p = wi.includes(m) && (o % 4 === 0 || r === "missing");
2012
2422
  return {
2013
- id: a,
2014
- moduleId: u,
2015
- title: `${c} ${t + 1}`,
2016
- type: c,
2423
+ id: n,
2424
+ moduleId: d,
2425
+ title: `${m} ${t + 1}`,
2426
+ type: m,
2017
2427
  position: t + 1,
2018
2428
  indent: t % 5 === 4 ? 1 : 0,
2019
- // 1 in 7 unpublished, so a teacher view always has something to gray out.
2020
- // Same rule as the module: a student's page contains no unpublished items,
2021
- // so only a teacher fixture grays any out.
2022
- published: i === "teacher" ? n % 7 !== 0 : !0,
2023
- url: g ? null : `/courses/${pe}/modules/items/${a}`,
2024
- newTab: ro.includes(c) && n % 2 === 0,
2025
- completionRequirement: m,
2026
- dueAt: l ? At(n % 90) : null,
2027
- status: s,
2028
- pointsPossible: r,
2029
- // Canvas Career only, so it rides in `extensions`. Sparse on purpose: a
2030
- // handful per fixture proves the escape hatch survives a round trip, and
2031
- // every other item must carry no `extensions` key at all.
2032
- extensions: rt(
2429
+ published: a === "teacher" ? o % 7 !== 0 : !0,
2430
+ url: u ? null : `/courses/${Z}/modules/items/${n}`,
2431
+ newTab: Li.includes(m) && o % 2 === 0,
2432
+ completionRequirement: l,
2433
+ dueAt: p ? cn(o % 90) : null,
2434
+ status: r,
2435
+ pointsPossible: s,
2436
+ extensions: He(
2033
2437
  void 0,
2034
- n % 37 === 0 ? 5 + n % 4 * 10 : null
2438
+ o % 37 === 0 ? 5 + o % 4 * 10 : null
2035
2439
  )
2036
2440
  };
2037
- }, fo = (e, t, n, s) => {
2038
- const r = Nt(e), i = [];
2039
- let u = 0;
2441
+ }, zi = (e, t, n, o) => {
2442
+ const r = ke(e), s = [];
2443
+ let l = 0;
2040
2444
  for (let a = 0; a < t; a += 1) {
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));
2445
+ const d = n + a, m = ce[d % ce.length], u = Ni(m, d), p = u !== null, g = p ? l++ : a, f = String(e * 1e3 + a + 1), C = (r === "incomplete" || r === "missing_and_incomplete") && p && g === 0 ? { itemId: f, type: "min_score", minScore: 10 } : r === "complete" && p && g === 0 ? { itemId: f, type: "must_view" } : Di(m, d) ? Ri(f, d) : null, E = qi(r, p, C != null, g);
2446
+ s.push(Ui(e, a, f, d, E, u, C, o));
2447
+ }
2448
+ return s;
2449
+ }, $i = (e, t, n, o) => {
2450
+ const r = ke(e);
2451
+ if (r === "locked" || r === "not_started") return r;
2452
+ if (t.length === 0) return "not_started";
2453
+ if (!t.some((s) => s.pointsPossible != null) || r === "missing" && n === 0 || r === "incomplete" && o === 0) return "in_progress";
2454
+ if (r === "missing_and_incomplete") {
2455
+ if (n === 0 && o === 0) return "in_progress";
2456
+ if (n === 0) return "incomplete";
2457
+ if (o === 0) return "missing";
2043
2458
  }
2044
- return i;
2045
- }, ho = (e, t, n) => {
2046
- const s = Nt(e);
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;
2048
- }, po = (e) => {
2459
+ return r;
2460
+ }, Bi = (e) => {
2049
2461
  const t = e.map((n) => n.dueAt).filter((n) => typeof n == "string").sort();
2050
2462
  return t.length > 0 ? t[t.length - 1] : null;
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;
2463
+ }, ji = (e, t, n) => {
2464
+ const o = ke(e), r = o === "incomplete" || o === "missing_and_incomplete" ? t.filter((f) => f.status === "graded" && Fi(f)) : [], s = new Set(r.map((f) => f.id)), l = t.filter((f) => f.completionRequirement), a = n ?? l.length, d = l.filter((f) => !s.has(f.id)), m = Math.min(d.filter(Oi).length, a), u = t.filter((f) => f.status === "missing").length, p = s.size;
2053
2465
  return {
2054
- status: ho(e, t, u),
2055
- requirementsMet: i,
2056
- requirementCount: r,
2057
- // Derived from the clamped pair, so the bar and the fraction always agree.
2058
- percentComplete: r > 0 ? Math.round(i / r * 100) : 0,
2059
- latestDueAt: po(t),
2060
- missingCount: u
2466
+ status: $i(e, t, u, p),
2467
+ requirementsMet: m,
2468
+ requirementCount: a,
2469
+ percentComplete: a > 0 ? Math.round(m / a * 100) : 0,
2470
+ latestDueAt: Bi(t),
2471
+ missingCount: u,
2472
+ incompleteCount: p
2061
2473
  };
2062
- }, bo = (e, t, n) => {
2063
- const s = e % 2 === 0 ? null : 1;
2474
+ }, Gi = (e, t, n) => {
2475
+ const o = ke(e), r = e % 2 !== 0 && o !== "incomplete" && o !== "missing_and_incomplete" ? 1 : null;
2064
2476
  return {
2065
2477
  id: String(e),
2066
2478
  name: `Module ${e}`,
2067
2479
  position: e,
2068
- // A student sees only published modules; publish state varies for a teacher.
2069
2480
  published: n === "teacher" ? e % 4 !== 0 : !0,
2070
2481
  itemCount: t.length,
2071
- unlockAt: e % 5 === 0 ? At(e) : null,
2072
- prerequisiteModuleIds: e > 1 && e % 3 === 0 ? [String(e - 1)] : [],
2073
- requirementCount: s,
2482
+ unlockAt: e % 5 === 0 ? cn(e) : null,
2483
+ prerequisiteModules: e > 1 && e % 3 === 0 ? [{ id: String(e - 1), name: `Module ${e - 1}` }] : [],
2484
+ requirementCount: r,
2074
2485
  requireSequentialProgress: e % 6 === 0,
2075
2486
  completionRequirements: t.flatMap(
2076
- (r) => r.completionRequirement ? [r.completionRequirement] : []
2487
+ (s) => s.completionRequirement ? [s.completionRequirement] : []
2077
2488
  ),
2078
- progress: Io(e, t, s)
2489
+ progress: ji(e, t, r)
2079
2490
  };
2080
2491
  };
2081
- function Mo(e) {
2492
+ function Yi(e) {
2082
2493
  return {
2083
2494
  courseId: e.courseId,
2084
2495
  modules: e.modules.map(({ progress: t, ...n }) => n),
2085
2496
  itemsByModuleId: Object.fromEntries(
2086
2497
  Object.entries(e.itemsByModuleId).map(([t, n]) => [
2087
2498
  t,
2088
- n.map(({ status: s, ...r }) => r)
2499
+ n.map(({ status: o, ...r }) => r)
2089
2500
  ])
2090
2501
  )
2091
2502
  };
2092
2503
  }
2093
- function Ie(e, t = {}) {
2094
- const n = t.view ?? "student", s = t.courseId ?? pe, r = [], i = {};
2095
- let u = 0;
2096
- e.forEach((c, g) => {
2097
- const l = g + 1, m = fo(l, c, u, n);
2098
- u += c, r.push(bo(l, m, n)), i[String(l)] = m;
2504
+ function Oe(e, t = {}) {
2505
+ const n = t.view ?? "student", o = t.courseId ?? Z, r = [], s = {};
2506
+ let l = 0;
2507
+ e.forEach((d, m) => {
2508
+ const u = m + 1, p = zi(u, d, l, n);
2509
+ l += d, r.push(Gi(u, p, n)), s[String(u)] = p;
2099
2510
  });
2100
- const a = { courseId: s, modules: r, itemsByModuleId: i };
2101
- return n === "teacher" ? Mo(a) : a;
2511
+ const a = { courseId: o, modules: r, itemsByModuleId: s };
2512
+ return n === "teacher" ? Yi(a) : a;
2102
2513
  }
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));
2514
+ const ie = (e) => `/courses/${Z}/modules/items/${e}`, ht = "2099-08-31T06:59:00Z", Wi = "2020-01-06T07:00:00Z", Qi = We.length, Hi = 8, Vi = 120, Ki = 25, Zi = 250, It = 8;
2515
+ function Dl() {
2516
+ return Oe(Array.from({ length: Qi }, () => Hi));
2106
2517
  }
2107
- function ii() {
2108
- return Ie(Array.from({ length: _o }, () => To));
2518
+ function Nl() {
2519
+ return Oe(Array.from({ length: Vi }, () => Ki));
2109
2520
  }
2110
- function li() {
2111
- return Ie([
2112
- Ue,
2113
- Po,
2114
- Ue
2521
+ function ql() {
2522
+ return Oe([
2523
+ It,
2524
+ Zi,
2525
+ It
2115
2526
  ]);
2116
2527
  }
2117
- function ai() {
2118
- return Ie([]);
2528
+ function kl() {
2529
+ const e = (r, s, l) => ({
2530
+ id: String(r),
2531
+ name: s,
2532
+ position: r,
2533
+ published: !0,
2534
+ itemCount: 0,
2535
+ prerequisiteModules: [],
2536
+ requireSequentialProgress: !1,
2537
+ progress: {
2538
+ status: "locked",
2539
+ requirementsMet: 0,
2540
+ requirementCount: 0,
2541
+ percentComplete: 0,
2542
+ missingCount: 0,
2543
+ incompleteCount: 0
2544
+ },
2545
+ ...l
2546
+ }), t = { id: "101", name: "Week 1: Foundations" }, n = { id: "102", name: "Week 2: Derivatives" }, o = [
2547
+ e(1, "Locked by a future date", { unlockAt: ht }),
2548
+ e(2, "Locked by one prerequisite", { prerequisiteModules: [t] }),
2549
+ e(3, "Locked by several prerequisites", {
2550
+ prerequisiteModules: [t, n]
2551
+ }),
2552
+ e(4, "Locked by a date and a prerequisite", {
2553
+ unlockAt: ht,
2554
+ prerequisiteModules: [t]
2555
+ }),
2556
+ e(5, "Locked, and the unlock date has passed", { unlockAt: Wi })
2557
+ ];
2558
+ return {
2559
+ courseId: Z,
2560
+ modules: o,
2561
+ itemsByModuleId: Object.fromEntries(o.map((r) => [r.id, []]))
2562
+ };
2119
2563
  }
2120
- function ui() {
2564
+ function Ol() {
2565
+ return Oe([]);
2566
+ }
2567
+ function Fl() {
2568
+ const t = [
2569
+ {
2570
+ title: "Every fact: type, due date, points, requirement",
2571
+ type: "assignment",
2572
+ dueAt: "2025-01-07T12:00:00Z",
2573
+ pointsPossible: 10,
2574
+ completionRequirement: { itemId: "1", type: "must_submit" }
2575
+ },
2576
+ { title: "Type only: no date, no points, no requirement", type: "page" },
2577
+ {
2578
+ title: "One point, so the singular form shows",
2579
+ type: "quiz",
2580
+ dueAt: "2025-01-09T23:59:00Z",
2581
+ pointsPossible: 1,
2582
+ completionRequirement: { itemId: "3", type: "min_score", minScore: 1 }
2583
+ },
2584
+ {
2585
+ title: "Past due, three weeks ago",
2586
+ type: "discussion",
2587
+ dueAt: "2024-12-16T23:59:00Z",
2588
+ pointsPossible: 25,
2589
+ completionRequirement: { itemId: "4", type: "must_contribute" },
2590
+ status: "missing"
2591
+ },
2592
+ {
2593
+ title: "Career item carrying an estimated duration",
2594
+ type: "external_tool",
2595
+ completionRequirement: { itemId: "5", type: "must_view" },
2596
+ extensions: He(void 0, 45)
2597
+ },
2598
+ { title: "A file, ungradeable, so no points at all", type: "file" },
2599
+ { title: "External link, opens in a new tab", type: "external_url", newTab: !0 },
2600
+ {
2601
+ title: "A sub-header, which renders no tile and no meta line",
2602
+ type: "sub_header",
2603
+ url: null
2604
+ }
2605
+ ].map((n, o) => ({
2606
+ id: String(o + 1),
2607
+ moduleId: "1",
2608
+ position: o + 1,
2609
+ indent: 0,
2610
+ published: !0,
2611
+ newTab: !1,
2612
+ url: ie(o + 1),
2613
+ status: "not_started",
2614
+ ...n
2615
+ }));
2616
+ return {
2617
+ courseId: Z,
2618
+ modules: [
2619
+ {
2620
+ id: "1",
2621
+ name: "Item row variants",
2622
+ position: 1,
2623
+ published: !0,
2624
+ itemCount: t.length,
2625
+ prerequisiteModules: [],
2626
+ requireSequentialProgress: !1
2627
+ }
2628
+ ],
2629
+ itemsByModuleId: { 1: t }
2630
+ };
2631
+ }
2632
+ function Ul() {
2121
2633
  const t = [
2122
- { title: "Reading: limits from the left and the right", type: "page", url: ue(1) },
2634
+ { title: "Reading: limits from the left and the right", type: "page", url: ie(1) },
2123
2635
  {
2124
2636
  title: "Desmos: interactive limit explorer",
2125
2637
  type: "external_url",
2126
- url: ue(2),
2638
+ url: ie(2),
2127
2639
  newTab: !0
2128
2640
  },
2129
2641
  { title: "Practice", type: "sub_header", url: null },
@@ -2131,13 +2643,13 @@ function ui() {
2131
2643
  {
2132
2644
  title: "Utilizing Triangle Characteristics: Measuring Distances Through Angles, Elevation and the Practical Limits of Indirect Measurement in the Field",
2133
2645
  type: "assignment",
2134
- url: ue(5)
2646
+ url: ie(5)
2135
2647
  },
2136
- { title: "Unit test", type: "quiz", url: ue(6), status: "locked" }
2137
- ].map((n, s) => ({
2138
- id: String(s + 1),
2648
+ { title: "Unit test", type: "quiz", url: ie(6), status: "locked" }
2649
+ ].map((n, o) => ({
2650
+ id: String(o + 1),
2139
2651
  moduleId: "1",
2140
- position: s + 1,
2652
+ position: o + 1,
2141
2653
  indent: 0,
2142
2654
  published: !0,
2143
2655
  newTab: !1,
@@ -2145,7 +2657,7 @@ function ui() {
2145
2657
  ...n
2146
2658
  }));
2147
2659
  return {
2148
- courseId: pe,
2660
+ courseId: Z,
2149
2661
  modules: [
2150
2662
  {
2151
2663
  id: "1",
@@ -2153,7 +2665,7 @@ function ui() {
2153
2665
  position: 1,
2154
2666
  published: !0,
2155
2667
  itemCount: t.length,
2156
- prerequisiteModuleIds: [],
2668
+ prerequisiteModules: [],
2157
2669
  requireSequentialProgress: !1
2158
2670
  }
2159
2671
  ],
@@ -2161,74 +2673,92 @@ function ui() {
2161
2673
  };
2162
2674
  }
2163
2675
  export {
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,
2170
- Pe as DEFAULT_PAGE_SIZE,
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,
2210
- Qo as createInMemoryAdapter,
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
2676
+ ue as ALL_FILTER,
2677
+ Dt as CompletionRequirementSchema,
2678
+ kn as CompletionRequirementTypeSchema,
2679
+ tn as DEFAULT_INLINE_THRESHOLD,
2680
+ Os as DEFAULT_ITEM_CONCURRENCY,
2681
+ en as DEFAULT_ITEM_PAGE_SIZE,
2682
+ K as DEFAULT_LOCALE,
2683
+ Xe as DEFAULT_PAGE_SIZE,
2684
+ nn as DEFAULT_RETAIN_COLLAPSED_LIMIT,
2685
+ qe as DEFAULT_STALE_TIME_MS,
2686
+ Ts as DUE_THIS_WEEK_DAYS,
2687
+ kt as EXT_CAREER_ESTIMATED_DURATION_MINUTES,
2688
+ Z as FIXTURE_COURSE_ID,
2689
+ Qs as FilterChips,
2690
+ xn as FilterClauseSchema,
2691
+ Ns as FilterEntrySchema,
2692
+ ho as GET_MODULES,
2693
+ Io as GET_MODULE_ITEMS,
2694
+ Be as INLINE_ITEM_LIMIT,
2695
+ Ve as INLINE_QUERY_NODE_BUDGET,
2696
+ jn as InMemoryCourseMismatchError,
2697
+ Rs as ItemTypeEntrySchema,
2698
+ Ds as MetaFieldEntrySchema,
2699
+ Ei as ModuleCard,
2700
+ di as ModuleItemRow,
2701
+ Nt as ModuleItemSchema,
2702
+ ti as ModuleItemStatusPill,
2703
+ Nn as ModuleItemStatusSchema,
2704
+ Dn as ModuleItemTypeSchema,
2705
+ $n as ModuleItemsPageSchema,
2706
+ mi as ModuleNumberBadge,
2707
+ On as ModuleProgressSchema,
2708
+ Un as ModuleSchema,
2709
+ ei as ModuleStatusPill,
2710
+ qn as ModuleStatusSchema,
2711
+ El as ModulesConfigProvider,
2712
+ qs as ModulesConfigSchema,
2713
+ Tl as ModulesI18nProvider,
2714
+ Rl as ModulesList,
2715
+ zn as ModulesPageSchema,
2716
+ qt as PageInfoSchema,
2717
+ Ot as PartialCanvasResponseError,
2718
+ Fn as PrerequisiteModuleSchema,
2719
+ De as RegistryEntrySchema,
2720
+ Cs as TYPE_FIELD,
2721
+ Es as baseFilters,
2722
+ Re as baseModulesConfig,
2723
+ Oe as buildFixture,
2724
+ Ol as courseEmpty,
2725
+ ql as courseFatModule,
2726
+ Ul as courseItemLinks,
2727
+ Fl as courseItemRowVariants,
2728
+ Nl as courseLarge,
2729
+ kl as courseLockReasons,
2730
+ Dl as courseSmall,
2731
+ _l as createCanvasGraphqlAdapter,
2732
+ yl as createInMemoryAdapter,
2733
+ Ht as createTranslate,
2734
+ Ps as defaultFormatters,
2735
+ us as defaultTranslate,
2736
+ Ke as filterClauseOf,
2737
+ Bn as getEstimatedDurationMinutes,
2738
+ vs as hideUnservableFilters,
2739
+ xl as invalidateCourse,
2740
+ Al as invalidateModuleItems,
2741
+ vl as invalidateModuleList,
2742
+ Ge as isPredicateServed,
2743
+ H as mergeRegistry,
2744
+ Js as moduleItemStatusLabel,
2745
+ on as moduleItemsPrefix,
2746
+ Xs as moduleStatusLabel,
2747
+ ge as modulesKeys,
2748
+ Fs as modulesListPrefix,
2749
+ Cl as partialModulesConfig,
2750
+ we as registrySchema,
2751
+ ks as resolveModulesConfig,
2752
+ Rn as servesClause,
2753
+ As as unservableFilters,
2754
+ Pl as useFieldVisible,
2755
+ Ne as useFormatters,
2756
+ wl as useModuleItems,
2757
+ Us as useModules,
2758
+ pe as useModulesConfig,
2759
+ k as useModulesI18n,
2760
+ Ll as useModulesPageData,
2761
+ Ze as visibleEntries,
2762
+ me as visibleEntry,
2763
+ He as withEstimatedDurationMinutes
2234
2764
  };