@instructure/platform-modules 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ModulesList.d.ts.map +1 -1
- package/dist/components/ModulesList.stories.d.ts +1 -0
- package/dist/components/ModulesList.stories.d.ts.map +1 -1
- package/dist/components/ModulesProgressBar.d.ts +8 -0
- package/dist/components/ModulesProgressBar.d.ts.map +1 -0
- package/dist/components/ModulesProgressBar.stories.d.ts +18 -0
- package/dist/components/ModulesProgressBar.stories.d.ts.map +1 -0
- package/dist/components/StatusPill.d.ts +13 -0
- package/dist/components/StatusPill.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/storyThemes.d.ts +4 -0
- package/dist/components/storyThemes.d.ts.map +1 -1
- package/dist/config/actions.d.ts +20 -0
- package/dist/config/actions.d.ts.map +1 -0
- package/dist/config/index.d.ts +3 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/schemas.d.ts +16 -0
- package/dist/config/schemas.d.ts.map +1 -1
- package/dist/config/types.d.ts +5 -5
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/useActionContext.d.ts +6 -0
- package/dist/config/useActionContext.d.ts.map +1 -0
- package/dist/hooks/useModulesPageData.d.ts +2 -0
- package/dist/hooks/useModulesPageData.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1714 -1379
- package/locales/en.json +27 -3
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { z as
|
|
2
|
-
import { gql as
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { createContext as
|
|
5
|
-
import { PlugInstUIIcon as
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import { Button as
|
|
9
|
-
import { Flex as
|
|
1
|
+
import { z as m } from "zod";
|
|
2
|
+
import { gql as xe } from "graphql-tag";
|
|
3
|
+
import { jsx as l, jsxs as C, Fragment as vt } from "react/jsx-runtime";
|
|
4
|
+
import { createContext as en, useContext as tn, useMemo as N, isValidElement as nn, useCallback as U, useRef as $, useState as V, useEffect as Z, useId as st, memo as on, Fragment as sn } from "react";
|
|
5
|
+
import { PlugInstUIIcon as ro, ExternalLinkInstUIIcon as io, FileInstUIIcon as lo, FileTextInstUIIcon as ao, MessagesSquareInstUIIcon as co, RocketInstUIIcon as uo, FilePenLineInstUIIcon as mo, LockInstUIIcon as rn, CircleAlertInstUIIcon as Pe, CircleCheckInstUIIcon as ln, ClockFadingInstUIIcon as an, CircleDashedInstUIIcon as cn, CornerDownRightInstUIIcon as po, IconArrowOpenUpLine as fo, IconArrowOpenDownLine as go } from "@instructure/ui-icons";
|
|
6
|
+
import { useQueryClient as ht, useInfiniteQuery as It, keepPreviousData as ho, InfiniteQueryObserver as Io } from "@tanstack/react-query";
|
|
7
|
+
import bo from "p-limit";
|
|
8
|
+
import { Button as ve, IconButton as Mo } from "@instructure/ui-buttons/v11_7";
|
|
9
|
+
import { Flex as E } from "@instructure/ui-flex/v11_7";
|
|
10
10
|
import { Text as v } from "@instructure/ui-text/v11_7";
|
|
11
|
-
import { View as
|
|
12
|
-
import { TruncateWithTooltip as
|
|
13
|
-
import { Alert as
|
|
14
|
-
import { Heading as
|
|
15
|
-
import { ProgressBar as
|
|
16
|
-
import { Spinner as
|
|
17
|
-
import { Tooltip as
|
|
18
|
-
import { useTheme as
|
|
19
|
-
import { ScreenReaderContent as
|
|
20
|
-
import { Link as
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
const
|
|
25
|
-
target:
|
|
26
|
-
field:
|
|
27
|
-
op:
|
|
28
|
-
value:
|
|
11
|
+
import { View as T } from "@instructure/ui-view/v11_7";
|
|
12
|
+
import { TruncateWithTooltip as yo, politeAnnounce as pe, getLiveRegion as un } from "@instructure/platform-instui-bindings";
|
|
13
|
+
import { Alert as dn } from "@instructure/ui-alerts/v11_7";
|
|
14
|
+
import { Heading as mn } from "@instructure/ui-heading/v11_7";
|
|
15
|
+
import { ProgressBar as So } from "@instructure/ui-progress/v11_7";
|
|
16
|
+
import { Spinner as rt } from "@instructure/ui-spinner/v11_7";
|
|
17
|
+
import { Tooltip as pn } from "@instructure/ui-tooltip/v11_7";
|
|
18
|
+
import { useTheme as fn } from "@instructure/emotion";
|
|
19
|
+
import { ScreenReaderContent as it } from "@instructure/ui-a11y-content";
|
|
20
|
+
import { Link as _o } from "@instructure/ui-link/v11_7";
|
|
21
|
+
import { isValid as lt, colorToRGB as at, overlayColors as To, alpha as Eo, color2hex as gn, contrast as oe, darken as Co, lighten as wo } from "@instructure/ui-color-utils";
|
|
22
|
+
import { Pill as Po } from "@instructure/ui-pill/v11_7";
|
|
23
|
+
import { WithBreakpoints as vo } from "@instructure/platform-with-breakpoints";
|
|
24
|
+
const Ao = m.object({
|
|
25
|
+
target: m.enum(["module", "item"]),
|
|
26
|
+
field: m.string(),
|
|
27
|
+
op: m.enum(["eq", "contains"]),
|
|
28
|
+
value: m.union([m.string(), m.boolean()])
|
|
29
29
|
}).strict();
|
|
30
|
-
function
|
|
30
|
+
function xo(e, t) {
|
|
31
31
|
const n = e == null ? void 0 : e[t.target];
|
|
32
32
|
return !n || !Object.prototype.hasOwnProperty.call(n, t.field) ? !1 : n[t.field].includes(t.op);
|
|
33
33
|
}
|
|
34
|
-
const
|
|
34
|
+
const Lo = m.enum([
|
|
35
35
|
"assignment",
|
|
36
36
|
"quiz",
|
|
37
37
|
"discussion",
|
|
@@ -40,7 +40,7 @@ const Kn = d.enum([
|
|
|
40
40
|
"external_url",
|
|
41
41
|
"external_tool",
|
|
42
42
|
"sub_header"
|
|
43
|
-
]),
|
|
43
|
+
]), Ro = m.enum(["not_started", "in_progress", "complete", "incomplete", "missing", "locked"]), ko = m.enum([
|
|
44
44
|
"not_started",
|
|
45
45
|
"in_progress",
|
|
46
46
|
"complete",
|
|
@@ -48,7 +48,7 @@ const Kn = d.enum([
|
|
|
48
48
|
"incomplete",
|
|
49
49
|
"missing_and_incomplete",
|
|
50
50
|
"locked"
|
|
51
|
-
]),
|
|
51
|
+
]), No = m.enum([
|
|
52
52
|
"must_view",
|
|
53
53
|
"must_mark_done",
|
|
54
54
|
"must_contribute",
|
|
@@ -56,97 +56,97 @@ const Kn = d.enum([
|
|
|
56
56
|
"min_score",
|
|
57
57
|
"min_percentage",
|
|
58
58
|
"unknown"
|
|
59
|
-
]),
|
|
60
|
-
status:
|
|
61
|
-
requirementsMet:
|
|
62
|
-
requirementCount:
|
|
63
|
-
percentComplete:
|
|
64
|
-
nextDueAt:
|
|
65
|
-
missingCount:
|
|
66
|
-
incompleteCount:
|
|
67
|
-
}),
|
|
68
|
-
itemId:
|
|
69
|
-
type:
|
|
70
|
-
minScore:
|
|
71
|
-
minPercentage:
|
|
72
|
-
}),
|
|
73
|
-
id:
|
|
74
|
-
moduleId:
|
|
75
|
-
title:
|
|
76
|
-
type:
|
|
77
|
-
position:
|
|
78
|
-
indent:
|
|
79
|
-
published:
|
|
80
|
-
url:
|
|
81
|
-
newTab:
|
|
82
|
-
completionRequirement:
|
|
83
|
-
dueAt:
|
|
84
|
-
status:
|
|
85
|
-
pointsPossible:
|
|
86
|
-
extensions:
|
|
87
|
-
}),
|
|
88
|
-
id:
|
|
89
|
-
name:
|
|
90
|
-
}),
|
|
91
|
-
id:
|
|
92
|
-
name:
|
|
93
|
-
position:
|
|
94
|
-
published:
|
|
95
|
-
itemCount:
|
|
96
|
-
items:
|
|
97
|
-
unlockAt:
|
|
98
|
-
prerequisiteModules:
|
|
99
|
-
requirementCount:
|
|
100
|
-
requireSequentialProgress:
|
|
101
|
-
completionRequirements:
|
|
102
|
-
progress:
|
|
103
|
-
collapsed:
|
|
104
|
-
extensions:
|
|
105
|
-
}),
|
|
106
|
-
hasNextPage:
|
|
107
|
-
endCursor:
|
|
59
|
+
]), Do = m.object({
|
|
60
|
+
status: ko.optional(),
|
|
61
|
+
requirementsMet: m.number(),
|
|
62
|
+
requirementCount: m.number(),
|
|
63
|
+
percentComplete: m.number().min(0).max(100),
|
|
64
|
+
nextDueAt: m.string().nullish(),
|
|
65
|
+
missingCount: m.number(),
|
|
66
|
+
incompleteCount: m.number()
|
|
67
|
+
}), hn = m.object({
|
|
68
|
+
itemId: m.string(),
|
|
69
|
+
type: No,
|
|
70
|
+
minScore: m.number().nullish(),
|
|
71
|
+
minPercentage: m.number().nullish()
|
|
72
|
+
}), In = m.object({
|
|
73
|
+
id: m.string(),
|
|
74
|
+
moduleId: m.string(),
|
|
75
|
+
title: m.string(),
|
|
76
|
+
type: Lo,
|
|
77
|
+
position: m.number(),
|
|
78
|
+
indent: m.number(),
|
|
79
|
+
published: m.boolean(),
|
|
80
|
+
url: m.string().nullish(),
|
|
81
|
+
newTab: m.boolean().nullish(),
|
|
82
|
+
completionRequirement: hn.nullish(),
|
|
83
|
+
dueAt: m.string().nullish(),
|
|
84
|
+
status: Ro.optional(),
|
|
85
|
+
pointsPossible: m.number().nullish(),
|
|
86
|
+
extensions: m.record(m.unknown()).optional()
|
|
87
|
+
}), Oo = m.object({
|
|
88
|
+
id: m.string(),
|
|
89
|
+
name: m.string()
|
|
90
|
+
}), qo = m.object({
|
|
91
|
+
id: m.string(),
|
|
92
|
+
name: m.string(),
|
|
93
|
+
position: m.number(),
|
|
94
|
+
published: m.boolean(),
|
|
95
|
+
itemCount: m.number(),
|
|
96
|
+
items: m.array(In).optional(),
|
|
97
|
+
unlockAt: m.string().nullish(),
|
|
98
|
+
prerequisiteModules: m.array(Oo),
|
|
99
|
+
requirementCount: m.number().nullish(),
|
|
100
|
+
requireSequentialProgress: m.boolean(),
|
|
101
|
+
completionRequirements: m.array(hn).optional(),
|
|
102
|
+
progress: Do.optional(),
|
|
103
|
+
collapsed: m.boolean().nullish(),
|
|
104
|
+
extensions: m.record(m.unknown()).optional()
|
|
105
|
+
}), bn = m.object({
|
|
106
|
+
hasNextPage: m.boolean(),
|
|
107
|
+
endCursor: m.string().nullable()
|
|
108
108
|
}).refine((e) => !e.hasNextPage || e.endCursor !== null, {
|
|
109
109
|
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.',
|
|
110
110
|
path: ["endCursor"]
|
|
111
|
-
}),
|
|
112
|
-
modules:
|
|
113
|
-
pageInfo:
|
|
114
|
-
}),
|
|
115
|
-
items:
|
|
116
|
-
pageInfo:
|
|
117
|
-
}),
|
|
118
|
-
function
|
|
111
|
+
}), Fo = m.object({
|
|
112
|
+
modules: m.array(qo),
|
|
113
|
+
pageInfo: bn
|
|
114
|
+
}), Uo = m.object({
|
|
115
|
+
items: m.array(In),
|
|
116
|
+
pageInfo: bn
|
|
117
|
+
}), Mn = "career.estimatedDurationMinutes";
|
|
118
|
+
function zo(e) {
|
|
119
119
|
var n;
|
|
120
|
-
const t = (n = e.extensions) == null ? void 0 : n[
|
|
120
|
+
const t = (n = e.extensions) == null ? void 0 : n[Mn];
|
|
121
121
|
return typeof t != "number" || !Number.isFinite(t) || t <= 0 ? null : t;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
return t == null ? e : { ...e, [
|
|
123
|
+
function bt(e, t) {
|
|
124
|
+
return t == null ? e : { ...e, [Mn]: t };
|
|
125
125
|
}
|
|
126
|
-
const
|
|
127
|
-
class
|
|
126
|
+
const ct = 100, Mt = 2e3;
|
|
127
|
+
class $o extends Error {
|
|
128
128
|
constructor(t, n) {
|
|
129
129
|
super(
|
|
130
130
|
`This in-memory adapter was built for course ${t} but was asked for course ${n}. A fixture serves exactly one course.`
|
|
131
131
|
), this.name = "InMemoryCourseMismatchError", this.expected = t, this.received = n;
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
const
|
|
134
|
+
const Bo = (e) => `offset:${e}`, Go = (e) => {
|
|
135
135
|
if (!e) return 0;
|
|
136
136
|
const t = Number.parseInt(e.replace("offset:", ""), 10);
|
|
137
137
|
return Number.isFinite(t) && t >= 0 ? t : 0;
|
|
138
|
-
},
|
|
138
|
+
}, At = (e) => {
|
|
139
139
|
if (e != null && e.aborted)
|
|
140
140
|
throw new DOMException("The operation was aborted.", "AbortError");
|
|
141
141
|
};
|
|
142
|
-
function
|
|
143
|
-
const o =
|
|
142
|
+
function xt(e, t, n) {
|
|
143
|
+
const o = Go(t), s = e.slice(o, o + n), r = o + s.length, i = r < e.length;
|
|
144
144
|
return {
|
|
145
|
-
slice:
|
|
146
|
-
pageInfo: { hasNextPage:
|
|
145
|
+
slice: s,
|
|
146
|
+
pageInfo: { hasNextPage: i, endCursor: i ? Bo(r) : null }
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
|
-
const
|
|
149
|
+
const jo = /* @__PURE__ */ new Map([
|
|
150
150
|
["COMPLETED", (e) => {
|
|
151
151
|
var t;
|
|
152
152
|
return ((t = e.progress) == null ? void 0 : t.status) === "complete";
|
|
@@ -166,67 +166,67 @@ const uo = /* @__PURE__ */ new Map([
|
|
|
166
166
|
return ((t = e.progress) == null ? void 0 : t.status) !== "complete" && ((n = e.progress) == null ? void 0 : n.status) !== "in_progress";
|
|
167
167
|
}
|
|
168
168
|
]
|
|
169
|
-
]),
|
|
170
|
-
function
|
|
169
|
+
]), Yo = { module: { completionStatus: ["eq"] } };
|
|
170
|
+
function Wo(e) {
|
|
171
171
|
if (e.target !== "module" || e.field !== "completionStatus" || e.op !== "eq")
|
|
172
172
|
throw new Error(
|
|
173
173
|
`in-memory adapter cannot compile ${e.target}.${e.field} ${e.op}`
|
|
174
174
|
);
|
|
175
|
-
const t = typeof e.value == "string" ?
|
|
175
|
+
const t = typeof e.value == "string" ? jo.get(e.value) : void 0;
|
|
176
176
|
if (!t) throw new Error(`unknown completionStatus "${String(e.value)}"`);
|
|
177
177
|
return t;
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
const n = (
|
|
181
|
-
if (
|
|
182
|
-
throw new
|
|
179
|
+
function Wa(e, t = {}) {
|
|
180
|
+
const n = (s) => e.itemsByModuleId[s] ?? [], o = (s) => {
|
|
181
|
+
if (s !== e.courseId)
|
|
182
|
+
throw new $o(e.courseId, s);
|
|
183
183
|
};
|
|
184
184
|
return {
|
|
185
|
-
capabilities:
|
|
185
|
+
capabilities: Yo,
|
|
186
186
|
async listModules({
|
|
187
|
-
courseId:
|
|
188
|
-
cursor:
|
|
189
|
-
pageSize:
|
|
187
|
+
courseId: s,
|
|
188
|
+
cursor: r,
|
|
189
|
+
pageSize: i,
|
|
190
190
|
includeItems: a,
|
|
191
|
-
filter:
|
|
192
|
-
inlineItemsFirst:
|
|
193
|
-
signal:
|
|
191
|
+
filter: d,
|
|
192
|
+
inlineItemsFirst: u,
|
|
193
|
+
signal: c
|
|
194
194
|
}) {
|
|
195
|
-
var
|
|
196
|
-
|
|
197
|
-
const p =
|
|
198
|
-
return { modules: f.map((
|
|
199
|
-
const
|
|
200
|
-
return { ...
|
|
195
|
+
var w;
|
|
196
|
+
At(c), o(s), (w = t.onRequest) == null || w.call(t, "listModules", { operation: "listModules", courseId: s });
|
|
197
|
+
const p = d ? e.modules.filter(Wo(d)) : e.modules, { slice: f, pageInfo: y } = xt(p, r, i), g = Math.min(u ?? ct, ct);
|
|
198
|
+
return { modules: f.map((x) => {
|
|
199
|
+
const _ = n(x.id), A = a && _.length <= g;
|
|
200
|
+
return { ...x, itemCount: _.length, items: A ? _ : void 0 };
|
|
201
201
|
}), pageInfo: y };
|
|
202
202
|
},
|
|
203
203
|
async listModuleItems({
|
|
204
|
-
courseId:
|
|
205
|
-
moduleId:
|
|
206
|
-
cursor:
|
|
204
|
+
courseId: s,
|
|
205
|
+
moduleId: r,
|
|
206
|
+
cursor: i,
|
|
207
207
|
pageSize: a,
|
|
208
|
-
signal:
|
|
208
|
+
signal: d
|
|
209
209
|
}) {
|
|
210
210
|
var p;
|
|
211
|
-
|
|
212
|
-
const { slice:
|
|
213
|
-
return { items:
|
|
211
|
+
At(d), o(s), (p = t.onRequest) == null || p.call(t, "listModuleItems", { operation: "listModuleItems", courseId: s, moduleId: r });
|
|
212
|
+
const { slice: u, pageInfo: c } = xt(n(r), i, a);
|
|
213
|
+
return { items: u, pageInfo: c };
|
|
214
214
|
}
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
|
-
class
|
|
217
|
+
class yn extends Error {
|
|
218
218
|
constructor(t, n, o) {
|
|
219
|
-
const
|
|
219
|
+
const s = t === "module" ? "module" : "module item";
|
|
220
220
|
super(
|
|
221
|
-
`Canvas returned ${
|
|
221
|
+
`Canvas returned ${s} ${n} without a usable ${o}. This is a partial response; refusing to guess a value for it.`
|
|
222
222
|
), this.name = "PartialCanvasResponseError", this.subject = t, this.id = n, this.field = o;
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function Sn(e, t, n) {
|
|
226
226
|
if (e != null) return e;
|
|
227
|
-
throw new
|
|
227
|
+
throw new yn(t, n, "published");
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function Ho(e, t) {
|
|
230
230
|
if (e.onUnsupportedItem) {
|
|
231
231
|
e.onUnsupportedItem(t);
|
|
232
232
|
return;
|
|
@@ -235,7 +235,7 @@ function po(e, t) {
|
|
|
235
235
|
`[platform-modules] dropped module item ${t.id}: content type "${t.typename ?? "null"}" is outside the closed ModuleItemType enum. Pass \`onUnsupportedItem\` to handle these yourself.`
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
|
-
const
|
|
238
|
+
const Ko = {
|
|
239
239
|
Assignment: "assignment",
|
|
240
240
|
Quiz: "quiz",
|
|
241
241
|
Discussion: "discussion",
|
|
@@ -247,21 +247,21 @@ const fo = {
|
|
|
247
247
|
SubHeader: "sub_header",
|
|
248
248
|
PeerReviewSubAssignment: "assignment"
|
|
249
249
|
};
|
|
250
|
-
function
|
|
250
|
+
function Qo(e) {
|
|
251
251
|
const t = e == null ? void 0 : e.__typename;
|
|
252
252
|
if (!t) return null;
|
|
253
|
-
const n =
|
|
253
|
+
const n = Ko[t];
|
|
254
254
|
return n ? n === "assignment" && (e == null ? void 0 : e.isNewQuiz) === !0 ? "quiz" : n : null;
|
|
255
255
|
}
|
|
256
|
-
const
|
|
257
|
-
function
|
|
256
|
+
const Vo = /^P(?!$)(?:(\d+(?:\.\d+)?)W)?(?:(\d+(?:\.\d+)?)D)?(?:T(?!$)(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?)?$/;
|
|
257
|
+
function Zo(e) {
|
|
258
258
|
if (!e) return null;
|
|
259
|
-
const t =
|
|
259
|
+
const t = Vo.exec(e);
|
|
260
260
|
if (!t) return null;
|
|
261
|
-
const [, n, o,
|
|
261
|
+
const [, n, o, s, r, i] = t, a = Number(n ?? 0) * 7 * 24 * 60 + Number(o ?? 0) * 24 * 60 + Number(s ?? 0) * 60 + Number(r ?? 0) + Number(i ?? 0) / 60;
|
|
262
262
|
return Math.round(a);
|
|
263
263
|
}
|
|
264
|
-
const
|
|
264
|
+
const Xo = /* @__PURE__ */ new Set([
|
|
265
265
|
"must_view",
|
|
266
266
|
"must_mark_done",
|
|
267
267
|
"must_contribute",
|
|
@@ -269,42 +269,42 @@ const bo = /* @__PURE__ */ new Set([
|
|
|
269
269
|
"min_score",
|
|
270
270
|
"min_percentage"
|
|
271
271
|
]);
|
|
272
|
-
function
|
|
273
|
-
return
|
|
272
|
+
function Jo(e) {
|
|
273
|
+
return Xo.has(e) ? e : "unknown";
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function es(e) {
|
|
276
276
|
return {
|
|
277
277
|
itemId: String(e.id),
|
|
278
|
-
type:
|
|
278
|
+
type: Jo(e.type),
|
|
279
279
|
minScore: e.minScore ?? null,
|
|
280
280
|
minPercentage: e.minPercentage ?? null
|
|
281
281
|
};
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function _n(e) {
|
|
284
284
|
return {
|
|
285
285
|
hasNextPage: (e == null ? void 0 : e.hasNextPage) ?? !1,
|
|
286
286
|
endCursor: (e == null ? void 0 : e.endCursor) ?? null
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
|
-
const
|
|
290
|
-
function
|
|
289
|
+
const ts = /* @__PURE__ */ new Set(["min_score", "min_percentage"]);
|
|
290
|
+
function ns(e) {
|
|
291
291
|
var t;
|
|
292
292
|
for (const n of ((t = e == null ? void 0 : e.submissionsConnection) == null ? void 0 : t.nodes) ?? [])
|
|
293
293
|
if (n) return n;
|
|
294
294
|
return null;
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function Tn(e, t) {
|
|
297
297
|
if (!e) return;
|
|
298
|
-
const n = new Map(t.map((
|
|
299
|
-
for (const
|
|
300
|
-
if (!
|
|
301
|
-
const
|
|
302
|
-
n.get(
|
|
298
|
+
const n = new Map(t.map((r) => [r.itemId, r.type])), o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Map();
|
|
299
|
+
for (const r of e.requirementsMet ?? []) {
|
|
300
|
+
if (!r) continue;
|
|
301
|
+
const i = String(r.id);
|
|
302
|
+
n.get(i) === r.type && o.add(i);
|
|
303
303
|
}
|
|
304
|
-
for (const
|
|
305
|
-
if (!
|
|
306
|
-
const
|
|
307
|
-
n.get(
|
|
304
|
+
for (const r of e.incompleteRequirements ?? []) {
|
|
305
|
+
if (!r) continue;
|
|
306
|
+
const i = String(r.id);
|
|
307
|
+
n.get(i) === r.type && ts.has(r.type) && s.set(i, r.score ?? null);
|
|
308
308
|
}
|
|
309
309
|
return {
|
|
310
310
|
locked: e.locked === !0 || e.workflowState === "locked",
|
|
@@ -312,10 +312,10 @@ function Jt(e, t) {
|
|
|
312
312
|
completed: e.completed === !0 || e.workflowState === "completed",
|
|
313
313
|
started: e.started === !0 || e.workflowState === "started",
|
|
314
314
|
requirementsMetItemIds: o,
|
|
315
|
-
incompleteRequirementScores:
|
|
315
|
+
incompleteRequirementScores: s
|
|
316
316
|
};
|
|
317
317
|
}
|
|
318
|
-
const
|
|
318
|
+
const os = {
|
|
319
319
|
LOCKED: "locked",
|
|
320
320
|
MISSING: "missing",
|
|
321
321
|
INCOMPLETE: "incomplete",
|
|
@@ -323,11 +323,11 @@ const To = {
|
|
|
323
323
|
IN_PROGRESS: "in_progress",
|
|
324
324
|
NOT_STARTED: "not_started"
|
|
325
325
|
};
|
|
326
|
-
function
|
|
326
|
+
function ss(e) {
|
|
327
327
|
if (e != null)
|
|
328
|
-
return
|
|
328
|
+
return os[e];
|
|
329
329
|
}
|
|
330
|
-
const
|
|
330
|
+
const rs = {
|
|
331
331
|
LOCKED: "locked",
|
|
332
332
|
MISSING: "missing",
|
|
333
333
|
MISSING_AND_INCOMPLETE: "missing_and_incomplete",
|
|
@@ -336,89 +336,89 @@ const Po = {
|
|
|
336
336
|
IN_PROGRESS: "in_progress",
|
|
337
337
|
NOT_STARTED: "not_started"
|
|
338
338
|
};
|
|
339
|
-
function
|
|
339
|
+
function is(e) {
|
|
340
340
|
if (e != null)
|
|
341
|
-
return
|
|
341
|
+
return rs[e];
|
|
342
342
|
}
|
|
343
|
-
function
|
|
344
|
-
var a,
|
|
343
|
+
function ls(e, t, n) {
|
|
344
|
+
var a, d;
|
|
345
345
|
if (!n) return;
|
|
346
|
-
const o = e.requirementCount ?? t.length,
|
|
347
|
-
(
|
|
346
|
+
const o = e.requirementCount ?? t.length, s = Math.min(n.requirementsMetItemIds.size, o), r = ((a = e.submissionStatistics) == null ? void 0 : a.missingAssignmentCount) ?? 0, i = [...n.incompleteRequirementScores.values()].filter(
|
|
347
|
+
(u) => u != null
|
|
348
348
|
).length;
|
|
349
349
|
return {
|
|
350
|
-
status:
|
|
351
|
-
requirementsMet:
|
|
350
|
+
status: is(e.moduleStatus) ?? (n.locked ? "locked" : void 0),
|
|
351
|
+
requirementsMet: s,
|
|
352
352
|
requirementCount: o,
|
|
353
|
-
percentComplete: o > 0 ? Math.round(
|
|
354
|
-
nextDueAt: ((
|
|
355
|
-
missingCount:
|
|
356
|
-
incompleteCount:
|
|
353
|
+
percentComplete: o > 0 ? Math.round(s / o * 100) : 0,
|
|
354
|
+
nextDueAt: ((d = e.submissionStatistics) == null ? void 0 : d.nextDueAt) ?? null,
|
|
355
|
+
missingCount: r,
|
|
356
|
+
incompleteCount: i
|
|
357
357
|
};
|
|
358
358
|
}
|
|
359
|
-
function
|
|
360
|
-
var
|
|
361
|
-
const
|
|
362
|
-
if (!
|
|
363
|
-
return
|
|
364
|
-
const a =
|
|
359
|
+
function as(e, t, n, o = {}, s) {
|
|
360
|
+
var u, c, p;
|
|
361
|
+
const r = String(e._id), i = Qo(e.content);
|
|
362
|
+
if (!i)
|
|
363
|
+
return Ho(o, { id: r, typename: ((u = e.content) == null ? void 0 : u.__typename) ?? null }), null;
|
|
364
|
+
const a = ns(e.content), d = n.get(r) ?? null;
|
|
365
365
|
return {
|
|
366
|
-
id:
|
|
366
|
+
id: r,
|
|
367
367
|
moduleId: t,
|
|
368
368
|
title: e.title ?? "",
|
|
369
|
-
type:
|
|
369
|
+
type: i,
|
|
370
370
|
position: e.position ?? 0,
|
|
371
371
|
indent: e.indent ?? 0,
|
|
372
|
-
published:
|
|
372
|
+
published: Sn(e.published, "moduleItem", r),
|
|
373
373
|
url: e.url ?? null,
|
|
374
374
|
newTab: e.newTab ?? !1,
|
|
375
|
-
completionRequirement:
|
|
376
|
-
dueAt: (a == null ? void 0 : a.cachedDueDate) ?? ((
|
|
377
|
-
status:
|
|
375
|
+
completionRequirement: d,
|
|
376
|
+
dueAt: (a == null ? void 0 : a.cachedDueDate) ?? ((c = e.content) == null ? void 0 : c.dueAt) ?? null,
|
|
377
|
+
status: s ? ss(e.moduleItemStatus) ?? (s.locked ? "locked" : void 0) : void 0,
|
|
378
378
|
pointsPossible: ((p = e.content) == null ? void 0 : p.pointsPossible) ?? null,
|
|
379
|
-
extensions:
|
|
379
|
+
extensions: bt(
|
|
380
380
|
void 0,
|
|
381
|
-
|
|
381
|
+
Zo(e.estimatedDuration)
|
|
382
382
|
)
|
|
383
383
|
};
|
|
384
384
|
}
|
|
385
|
-
function
|
|
386
|
-
const
|
|
387
|
-
for (const
|
|
388
|
-
if (!
|
|
389
|
-
const a =
|
|
390
|
-
|
|
385
|
+
function En(e, t, n, o, s) {
|
|
386
|
+
const r = [];
|
|
387
|
+
for (const i of e ?? []) {
|
|
388
|
+
if (!i) continue;
|
|
389
|
+
const a = as(
|
|
390
|
+
i,
|
|
391
391
|
t,
|
|
392
392
|
n,
|
|
393
393
|
o,
|
|
394
|
-
|
|
394
|
+
s
|
|
395
395
|
);
|
|
396
|
-
a &&
|
|
396
|
+
a && r.push(a);
|
|
397
397
|
}
|
|
398
|
-
return
|
|
398
|
+
return r;
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function Cn(e) {
|
|
401
401
|
const t = [], n = /* @__PURE__ */ new Map();
|
|
402
402
|
for (const o of e ?? []) {
|
|
403
403
|
if (!o) continue;
|
|
404
|
-
const
|
|
405
|
-
t.push(
|
|
404
|
+
const s = es(o);
|
|
405
|
+
t.push(s), n.set(s.itemId, s);
|
|
406
406
|
}
|
|
407
407
|
return { list: t, byItemId: n };
|
|
408
408
|
}
|
|
409
|
-
function
|
|
410
|
-
var
|
|
409
|
+
function cs(e, t = {}) {
|
|
410
|
+
var u, c;
|
|
411
411
|
const n = String(e._id);
|
|
412
412
|
if (e.moduleItemsTotalCount == null)
|
|
413
|
-
throw new
|
|
414
|
-
const { list: o, byItemId:
|
|
413
|
+
throw new yn("module", n, "moduleItemsTotalCount");
|
|
414
|
+
const { list: o, byItemId: s } = Cn(e.completionRequirements), r = e.moduleItemsConnection, i = r != null && !((u = r.pageInfo) != null && u.hasNextPage), a = Tn(e.progression, o), d = i ? En(r.nodes, n, s, t, a) : void 0;
|
|
415
415
|
return {
|
|
416
416
|
id: n,
|
|
417
417
|
name: e.name ?? "",
|
|
418
418
|
position: e.position ?? 0,
|
|
419
|
-
published:
|
|
419
|
+
published: Sn(e.published, "module", n),
|
|
420
420
|
itemCount: e.moduleItemsTotalCount,
|
|
421
|
-
items:
|
|
421
|
+
items: d,
|
|
422
422
|
unlockAt: e.unlockAt ?? null,
|
|
423
423
|
prerequisiteModules: (e.prerequisites ?? []).filter(
|
|
424
424
|
(p) => p != null
|
|
@@ -426,30 +426,30 @@ function Lo(e, t = {}) {
|
|
|
426
426
|
requirementCount: e.requirementCount ?? null,
|
|
427
427
|
requireSequentialProgress: e.requireSequentialProgress ?? !1,
|
|
428
428
|
completionRequirements: o,
|
|
429
|
-
progress:
|
|
430
|
-
collapsed: ((
|
|
429
|
+
progress: ls(e, o, a),
|
|
430
|
+
collapsed: ((c = e.progression) == null ? void 0 : c.collapsed) ?? null
|
|
431
431
|
};
|
|
432
432
|
}
|
|
433
|
-
function
|
|
434
|
-
var
|
|
435
|
-
const n = (
|
|
436
|
-
for (const
|
|
437
|
-
|
|
438
|
-
return { modules: o, pageInfo:
|
|
433
|
+
function us(e, t = {}) {
|
|
434
|
+
var s;
|
|
435
|
+
const n = (s = e == null ? void 0 : e.legacyNode) == null ? void 0 : s.modulesConnection, o = [];
|
|
436
|
+
for (const r of (n == null ? void 0 : n.nodes) ?? [])
|
|
437
|
+
r && o.push(cs(r, t));
|
|
438
|
+
return { modules: o, pageInfo: _n(n == null ? void 0 : n.pageInfo) };
|
|
439
439
|
}
|
|
440
|
-
function
|
|
441
|
-
const o = e == null ? void 0 : e.legacyNode, { list:
|
|
440
|
+
function ds(e, t, n = {}) {
|
|
441
|
+
const o = e == null ? void 0 : e.legacyNode, { list: s, byItemId: r } = Cn(o == null ? void 0 : o.completionRequirements), i = o == null ? void 0 : o.moduleItemsConnection, a = Tn(o == null ? void 0 : o.progression, s);
|
|
442
442
|
return {
|
|
443
|
-
items:
|
|
444
|
-
pageInfo:
|
|
443
|
+
items: En(i == null ? void 0 : i.nodes, t, r, n, a),
|
|
444
|
+
pageInfo: _n(i == null ? void 0 : i.pageInfo)
|
|
445
445
|
};
|
|
446
446
|
}
|
|
447
|
-
const
|
|
447
|
+
const ms = xe`
|
|
448
448
|
fragment PlatformModulesSubmissionFields on Submission {
|
|
449
449
|
_id
|
|
450
450
|
cachedDueDate
|
|
451
451
|
}
|
|
452
|
-
`,
|
|
452
|
+
`, wn = xe`
|
|
453
453
|
fragment PlatformModulesItemFields on ModuleItem {
|
|
454
454
|
_id
|
|
455
455
|
title
|
|
@@ -497,8 +497,8 @@ const Ro = Pe`
|
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
${
|
|
501
|
-
`,
|
|
500
|
+
${ms}
|
|
501
|
+
`, Pn = xe`
|
|
502
502
|
fragment PlatformModulesProgressionFields on ModuleProgression {
|
|
503
503
|
workflowState
|
|
504
504
|
completed
|
|
@@ -518,7 +518,7 @@ const Ro = Pe`
|
|
|
518
518
|
score
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
|
-
`,
|
|
521
|
+
`, ps = xe`
|
|
522
522
|
query PlatformModulesGetModules(
|
|
523
523
|
$courseId: ID!
|
|
524
524
|
$first: Int!
|
|
@@ -578,9 +578,9 @@ const Ro = Pe`
|
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
|
-
${
|
|
582
|
-
${
|
|
583
|
-
`,
|
|
581
|
+
${wn}
|
|
582
|
+
${Pn}
|
|
583
|
+
`, fs = xe`
|
|
584
584
|
query PlatformModulesGetModuleItems(
|
|
585
585
|
$moduleId: ID!
|
|
586
586
|
$first: Int!
|
|
@@ -611,265 +611,340 @@ const Ro = Pe`
|
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
|
-
${
|
|
615
|
-
${
|
|
614
|
+
${wn}
|
|
615
|
+
${Pn}
|
|
616
616
|
`;
|
|
617
|
-
function
|
|
617
|
+
function vn() {
|
|
618
618
|
return new DOMException("The operation was aborted.", "AbortError");
|
|
619
619
|
}
|
|
620
|
-
function
|
|
621
|
-
if (e != null && e.aborted) throw
|
|
620
|
+
function We(e) {
|
|
621
|
+
if (e != null && e.aborted) throw vn();
|
|
622
622
|
}
|
|
623
|
-
function
|
|
623
|
+
function Lt(e, t) {
|
|
624
624
|
return t ? new Promise((n, o) => {
|
|
625
|
-
const
|
|
626
|
-
t.addEventListener("abort",
|
|
625
|
+
const s = () => o(vn());
|
|
626
|
+
t.addEventListener("abort", s, { once: !0 }), e.then(n, o).finally(() => t.removeEventListener("abort", s));
|
|
627
627
|
}) : e;
|
|
628
628
|
}
|
|
629
|
-
const
|
|
629
|
+
const Rt = [
|
|
630
630
|
"COMPLETED",
|
|
631
631
|
"INCOMPLETE",
|
|
632
632
|
"IN_PROGRESS",
|
|
633
633
|
"NOT_STARTED"
|
|
634
|
-
],
|
|
634
|
+
], gs = {
|
|
635
635
|
module: { completionStatus: ["eq"] }
|
|
636
636
|
};
|
|
637
|
-
function
|
|
637
|
+
function hs(e) {
|
|
638
638
|
if (!e) return null;
|
|
639
639
|
if (e.target !== "module" || e.field !== "completionStatus" || e.op !== "eq")
|
|
640
640
|
throw new Error(
|
|
641
641
|
`Canvas GraphQL cannot serve ${e.target}.${e.field} "${e.op}". Only module.completionStatus eq is compiled here.`
|
|
642
642
|
);
|
|
643
643
|
const t = e.value;
|
|
644
|
-
if (!
|
|
644
|
+
if (!Rt.includes(t))
|
|
645
645
|
throw new Error(
|
|
646
|
-
`"${e.value}" is not a ModuleCompletionStatus (${
|
|
646
|
+
`"${e.value}" is not a ModuleCompletionStatus (${Rt.join(", ")}).`
|
|
647
647
|
);
|
|
648
648
|
return { completionStatus: t };
|
|
649
649
|
}
|
|
650
|
-
function
|
|
650
|
+
function Ha({
|
|
651
651
|
executeQuery: e,
|
|
652
|
-
inlineItemLimit: t =
|
|
653
|
-
nodeBudget: n =
|
|
652
|
+
inlineItemLimit: t = ct,
|
|
653
|
+
nodeBudget: n = Mt,
|
|
654
654
|
onUnsupportedItem: o,
|
|
655
|
-
studentId:
|
|
656
|
-
validate:
|
|
657
|
-
capabilities:
|
|
655
|
+
studentId: s,
|
|
656
|
+
validate: r = !0,
|
|
657
|
+
capabilities: i = gs
|
|
658
658
|
}) {
|
|
659
|
-
const a =
|
|
659
|
+
const a = s != null, d = { onUnsupportedItem: o };
|
|
660
660
|
return {
|
|
661
661
|
inlineNodeBudget: n,
|
|
662
|
-
capabilities:
|
|
662
|
+
capabilities: i,
|
|
663
663
|
async listModules({
|
|
664
|
-
courseId:
|
|
665
|
-
cursor:
|
|
664
|
+
courseId: u,
|
|
665
|
+
cursor: c,
|
|
666
666
|
pageSize: p,
|
|
667
667
|
includeItems: f,
|
|
668
668
|
filter: y,
|
|
669
669
|
inlineItemsFirst: g,
|
|
670
|
-
inlineFirst:
|
|
671
|
-
signal:
|
|
670
|
+
inlineFirst: b,
|
|
671
|
+
signal: w
|
|
672
672
|
}) {
|
|
673
|
-
|
|
674
|
-
const
|
|
675
|
-
e(
|
|
676
|
-
courseId:
|
|
677
|
-
first:
|
|
678
|
-
after:
|
|
673
|
+
We(w);
|
|
674
|
+
const x = f ? Math.min(b ?? p, p) : p, _ = Math.min(g ?? t, t), A = Math.max(1, Math.min(_, Math.floor(n / x))), q = await Lt(
|
|
675
|
+
e(ps, {
|
|
676
|
+
courseId: u,
|
|
677
|
+
first: x,
|
|
678
|
+
after: c ?? null,
|
|
679
679
|
includeItems: f,
|
|
680
|
-
itemsFirst:
|
|
680
|
+
itemsFirst: A,
|
|
681
681
|
includeSubmissions: a,
|
|
682
|
-
studentId:
|
|
683
|
-
filter:
|
|
682
|
+
studentId: s ?? null,
|
|
683
|
+
filter: hs(y)
|
|
684
684
|
}),
|
|
685
|
-
|
|
685
|
+
w
|
|
686
686
|
);
|
|
687
|
-
|
|
688
|
-
const
|
|
689
|
-
return
|
|
687
|
+
We(w);
|
|
688
|
+
const B = us(q, d);
|
|
689
|
+
return r ? Fo.parse(B) : B;
|
|
690
690
|
},
|
|
691
691
|
async listModuleItems({
|
|
692
|
-
moduleId:
|
|
693
|
-
cursor:
|
|
692
|
+
moduleId: u,
|
|
693
|
+
cursor: c,
|
|
694
694
|
pageSize: p,
|
|
695
695
|
signal: f
|
|
696
696
|
}) {
|
|
697
|
-
|
|
698
|
-
const y = await
|
|
699
|
-
e(
|
|
700
|
-
moduleId:
|
|
697
|
+
We(f);
|
|
698
|
+
const y = await Lt(
|
|
699
|
+
e(fs, {
|
|
700
|
+
moduleId: u,
|
|
701
701
|
first: p,
|
|
702
|
-
after:
|
|
702
|
+
after: c ?? null,
|
|
703
703
|
includeSubmissions: a,
|
|
704
|
-
studentId:
|
|
704
|
+
studentId: s ?? null
|
|
705
705
|
}),
|
|
706
706
|
f
|
|
707
707
|
);
|
|
708
|
-
|
|
709
|
-
const g =
|
|
710
|
-
return
|
|
708
|
+
We(f);
|
|
709
|
+
const g = ds(y, u, d);
|
|
710
|
+
return r ? Uo.parse(g) : g;
|
|
711
711
|
}
|
|
712
712
|
};
|
|
713
713
|
}
|
|
714
|
-
const
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
714
|
+
const ge = ["platform-modules"], Le = {
|
|
715
|
+
all: ge,
|
|
716
|
+
course: (e) => [...ge, e],
|
|
717
|
+
list: (e, t = {}) => [...ge, e, "list", t],
|
|
718
|
+
items: (e, t, n = {}) => [...ge, e, "module", t, "items", n]
|
|
719
|
+
};
|
|
720
|
+
function Is(e) {
|
|
721
|
+
return [...ge, e, "list"];
|
|
722
|
+
}
|
|
723
|
+
function ut(e, t) {
|
|
724
|
+
return [...ge, e, "module", t, "items"];
|
|
725
|
+
}
|
|
726
|
+
function bs(e, t, n, o) {
|
|
727
|
+
const s = o ? Le.items(t, n, o) : ut(t, n);
|
|
728
|
+
return e.invalidateQueries({ queryKey: s });
|
|
729
|
+
}
|
|
730
|
+
function kt(e, t, n) {
|
|
731
|
+
const o = n ? Le.list(t, n) : Is(t);
|
|
732
|
+
return e.invalidateQueries({ queryKey: o });
|
|
733
|
+
}
|
|
734
|
+
function Ka(e, t) {
|
|
735
|
+
return e.invalidateQueries({ queryKey: Le.course(t) });
|
|
736
|
+
}
|
|
737
|
+
const Qe = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
|
|
738
|
+
function Ve(e, t) {
|
|
739
|
+
const n = Object.entries(t ?? {}).filter(([, o]) => o !== void 0);
|
|
740
|
+
return { ...e, ...Object.fromEntries(n) };
|
|
741
|
+
}
|
|
742
|
+
function me(e, t = {}) {
|
|
743
|
+
const n = Object.keys(e).map((s) => [
|
|
744
|
+
s,
|
|
745
|
+
Ve(e[s], Qe(t, s) ? t[s] : void 0)
|
|
746
|
+
]), o = Object.keys(t).filter((s) => !Qe(e, s)).sort().map((s) => [s, Ve({}, t[s])]);
|
|
747
|
+
return Object.fromEntries([...n, ...o]);
|
|
748
|
+
}
|
|
749
|
+
function he(e, t) {
|
|
750
|
+
if (!(!Qe(e, t) || e[t].hidden))
|
|
751
|
+
return e[t];
|
|
752
|
+
}
|
|
753
|
+
function Je(e) {
|
|
754
|
+
return Object.keys(e).filter((t) => he(e, t) !== void 0).map((t) => ({ ...e[t], key: t })).sort((t, n) => t.order - n.order);
|
|
755
|
+
}
|
|
756
|
+
const Qa = 1e3;
|
|
757
|
+
function Ms({
|
|
758
|
+
queryClient: e,
|
|
759
|
+
courseId: t,
|
|
760
|
+
module: n,
|
|
761
|
+
item: o
|
|
762
|
+
}) {
|
|
763
|
+
return {
|
|
764
|
+
module: n,
|
|
765
|
+
item: o,
|
|
766
|
+
invalidateModuleItems: async (s) => {
|
|
767
|
+
await Promise.all([
|
|
768
|
+
bs(e, t, s),
|
|
769
|
+
kt(e, t)
|
|
770
|
+
]);
|
|
771
|
+
},
|
|
772
|
+
invalidateModuleList: () => kt(e, t)
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
function Va(e, t) {
|
|
776
|
+
return Je(e).filter(
|
|
777
|
+
(n) => n.visible == null || n.visible(t) === !0
|
|
778
|
+
);
|
|
779
|
+
}
|
|
780
|
+
const ys = "Course modules", Ss = { one: "%{count} module loaded", other: "%{count} modules loaded" }, _s = "Expand all modules", Ts = "Collapse all modules", Es = { one: "Loading items in %{count} module…", other: "Loading items in %{count} modules…" }, Cs = "All items loaded", ws = { one: "%{count} module expanded", other: "%{count} modules expanded" }, Ps = { one: "%{count} module collapsed", other: "%{count} modules collapsed" }, vs = "This filter runs on the modules loaded so far — load more to filter the rest of the course.", As = "Modules failed to load: %{message}", xs = "Loading modules", Ls = "This course has no modules.", Rs = { one: "The only loaded module does not match this filter.", other: "None of the %{count} loaded modules match this filter." }, ks = "No modules match this filter.", Ns = "Clear filters", Ds = "Loading more modules…", Os = "Load more modules (%{count} loaded)", qs = { one: "The only module in this course is loaded.", other: "All %{count} modules in this course are loaded." }, Fs = "Filter", Us = "All", zs = "In progress", $s = "Complete", Bs = "Due this week", Gs = "Missing", js = "Locked until %{name} is completed.", Ys = "Locked until %{prerequisites} are completed.", Ws = "%{count} prerequisites", Hs = "%{label}. %{name}", Ks = "%{name} progress", Qs = { one: "%{loaded} of %{count} item loaded in %{name}", other: "%{loaded} of %{count} items loaded in %{name}" }, Vs = "Items failed to load: %{message}", Zs = "Loading items", Xs = "Loading…", Js = "No items.", er = "Loading more items…", tr = "Load more items (%{loaded} of %{count} loaded)", nr = "(unpublished)", or = "Collapse %{name}", sr = "Expand %{name}", rr = "Not started", ir = "In progress", lr = "All completed", ar = "%{count} Missing", cr = "%{count} Incomplete", ur = "%{missing} & %{incomplete}", dr = "Locked", mr = "Not started", pr = "In progress", fr = "Completed", gr = "Incomplete", hr = "Missing", Ir = "Locked", br = "Assignment", Mr = "Quiz", yr = "Discussion", Sr = "Page", _r = "File", Tr = "External URL", Er = "External tool", Cr = "Text header", wr = "Item type", Pr = "Due date", vr = "Points", Ar = "Requirement", xr = "Estimated duration", Lr = "Publish state", Rr = "View the item", kr = "Submit the assignment", Nr = "Contribute to the page", Dr = "Mark as done", Or = "Score at least the minimum", qr = "Score at least %{count}", Fr = "Score at least the minimum percentage", Ur = "Score at least %{count}%", zr = "Complete the requirement", $r = "today, %{time}", Br = "yesterday, %{time}", Gr = "tomorrow, %{time}", jr = "%{date}, %{time}", Yr = "%{time} (%{zone})", Wr = "Due %{when}", Hr = "Will unlock on %{when}", Kr = "Unlocked on %{when}", Qr = { one: "%{count} pt", other: "%{count} pts" }, Vr = { one: "%{percent}% | %{met} of %{count} requirement met", other: "%{percent}% | %{met} of %{count} requirements met" }, Zr = { one: "%{percent}% complete, %{met} of %{count} requirement met", other: "%{percent}% complete, %{met} of %{count} requirements met" }, Xr = "%{percent}%", Jr = { one: "%{completedModules} of %{totalModules} module complete", other: "%{completedModules} of %{totalModules} modules complete" }, ei = "(%{itemsSummary})", ti = { one: "%{completedItems} of %{totalItems} item", other: "%{completedItems} of %{totalItems} items" }, ni = "Module progress", oi = "%{name}: %{status}", si = "%{count} min", ri = "Unpublished", ii = "Untitled item", li = "opens in a new window", ai = {
|
|
781
|
+
pageTitle: ys,
|
|
782
|
+
modulesLoadedAnnouncement: Ss,
|
|
783
|
+
expandAllModules: _s,
|
|
784
|
+
collapseAllModules: Ts,
|
|
785
|
+
expandAllLoadingItems: Es,
|
|
786
|
+
expandAllItemsLoaded: Cs,
|
|
787
|
+
modulesExpandedAnnouncement: ws,
|
|
788
|
+
modulesCollapsedAnnouncement: Ps,
|
|
789
|
+
filterScopeHint: vs,
|
|
790
|
+
modulesLoadErrorAlert: As,
|
|
791
|
+
modulesLoadingSpinnerLabel: xs,
|
|
792
|
+
noModulesEmptyState: Ls,
|
|
793
|
+
filteredEmptyState: Rs,
|
|
794
|
+
noFilterMatches: ks,
|
|
795
|
+
clearFilters: Ns,
|
|
796
|
+
loadMoreModulesLoading: Ds,
|
|
797
|
+
loadMoreModules: Os,
|
|
798
|
+
allModulesLoaded: qs,
|
|
799
|
+
filterGroupLabel: Fs,
|
|
800
|
+
filterAll: Us,
|
|
801
|
+
filterInProgress: zs,
|
|
802
|
+
filterComplete: $s,
|
|
803
|
+
filterDueThisWeek: Bs,
|
|
804
|
+
filterMissing: Gs,
|
|
805
|
+
lockedByPrerequisiteByline: js,
|
|
806
|
+
lockedByPrerequisitesByline: Ys,
|
|
807
|
+
lockedByPrerequisitesCount: Ws,
|
|
808
|
+
moduleNameWithLabel: Hs,
|
|
809
|
+
moduleProgressScreenReaderLabel: Ks,
|
|
810
|
+
itemsLoadedAnnouncement: Qs,
|
|
811
|
+
itemsLoadErrorAlert: Vs,
|
|
812
|
+
itemsLoadingSpinnerLabel: Zs,
|
|
813
|
+
itemsLoadingText: Xs,
|
|
814
|
+
noItemsEmptyState: Js,
|
|
815
|
+
loadMoreItemsLoading: er,
|
|
816
|
+
loadMoreItems: tr,
|
|
817
|
+
moduleUnpublishedBadge: nr,
|
|
818
|
+
collapseModule: or,
|
|
819
|
+
expandModule: sr,
|
|
820
|
+
moduleStatusNotStarted: rr,
|
|
821
|
+
moduleStatusInProgress: ir,
|
|
822
|
+
moduleStatusComplete: lr,
|
|
823
|
+
moduleStatusMissing: ar,
|
|
824
|
+
moduleStatusIncomplete: cr,
|
|
825
|
+
moduleStatusMissingAndIncomplete: ur,
|
|
826
|
+
moduleStatusLocked: dr,
|
|
827
|
+
itemStatusNotStarted: mr,
|
|
828
|
+
itemStatusInProgress: pr,
|
|
829
|
+
itemStatusComplete: fr,
|
|
830
|
+
itemStatusIncomplete: gr,
|
|
831
|
+
itemStatusMissing: hr,
|
|
832
|
+
itemStatusLocked: Ir,
|
|
833
|
+
itemTypeAssignment: br,
|
|
834
|
+
itemTypeQuiz: Mr,
|
|
835
|
+
itemTypeDiscussion: yr,
|
|
836
|
+
itemTypePage: Sr,
|
|
837
|
+
itemTypeFile: _r,
|
|
838
|
+
itemTypeExternalUrl: Tr,
|
|
839
|
+
itemTypeExternalTool: Er,
|
|
840
|
+
itemTypeSubHeader: Cr,
|
|
841
|
+
metaFieldTypeLabel: wr,
|
|
842
|
+
metaFieldDueAtLabel: Pr,
|
|
843
|
+
metaFieldPointsLabel: vr,
|
|
844
|
+
metaFieldRequirementLabel: Ar,
|
|
845
|
+
metaFieldDurationLabel: xr,
|
|
846
|
+
metaFieldPublishStateLabel: Lr,
|
|
847
|
+
requirementMustView: Rr,
|
|
848
|
+
requirementMustSubmit: kr,
|
|
849
|
+
requirementMustContribute: Nr,
|
|
850
|
+
requirementMustMarkDone: Dr,
|
|
851
|
+
requirementMinScoreUnknown: Or,
|
|
852
|
+
requirementMinScore: qr,
|
|
853
|
+
requirementMinPercentageUnknown: Fr,
|
|
854
|
+
requirementMinPercentage: Ur,
|
|
855
|
+
requirementUnknown: zr,
|
|
856
|
+
dateTimeToday: $r,
|
|
857
|
+
dateTimeYesterday: Br,
|
|
858
|
+
dateTimeTomorrow: Gr,
|
|
859
|
+
dateTimeWithDate: jr,
|
|
860
|
+
timeWithZone: Yr,
|
|
861
|
+
dueByline: Wr,
|
|
862
|
+
unlockByline: Hr,
|
|
863
|
+
unlockedByline: Kr,
|
|
864
|
+
pointsAbbreviated: Qr,
|
|
865
|
+
progressSummary: Vr,
|
|
866
|
+
progressScreenReaderValue: Zr,
|
|
867
|
+
moduleProgressOverviewPercentLabel: Xr,
|
|
868
|
+
moduleProgressOverviewSummary: Jr,
|
|
869
|
+
moduleProgressOverviewDetail: ei,
|
|
870
|
+
moduleProgressOverviewItemsSummary: ti,
|
|
871
|
+
moduleProgressOverviewGroupLabel: ni,
|
|
872
|
+
moduleProgressSegmentLabel: oi,
|
|
873
|
+
durationMinutes: si,
|
|
874
|
+
itemUnpublishedLabel: ri,
|
|
875
|
+
itemUntitled: ii,
|
|
876
|
+
opensInNewWindow: li
|
|
877
|
+
}, ci = /%\{(\w+)\}/g, ui = ai, Ie = "en-US", di = /* @__PURE__ */ new Map(), mi = /* @__PURE__ */ new Map();
|
|
878
|
+
function An(e, t, n) {
|
|
804
879
|
const o = e.get(t);
|
|
805
880
|
if (o) return o;
|
|
806
|
-
const
|
|
807
|
-
return e.set(t,
|
|
808
|
-
}
|
|
809
|
-
function
|
|
810
|
-
return n ? e.replace(
|
|
811
|
-
if (!Object.prototype.hasOwnProperty.call(n,
|
|
812
|
-
const
|
|
813
|
-
return typeof
|
|
881
|
+
const s = n();
|
|
882
|
+
return e.set(t, s), s;
|
|
883
|
+
}
|
|
884
|
+
function pi(e, t, n) {
|
|
885
|
+
return n ? e.replace(ci, (o, s) => {
|
|
886
|
+
if (!Object.prototype.hasOwnProperty.call(n, s)) return o;
|
|
887
|
+
const r = n[s];
|
|
888
|
+
return typeof r == "number" && Number.isFinite(r) ? An(mi, t, () => new Intl.NumberFormat(t)).format(r) : String(r);
|
|
814
889
|
}) : e;
|
|
815
890
|
}
|
|
816
|
-
function
|
|
891
|
+
function fi(e, t, n) {
|
|
817
892
|
const o = n == null ? void 0 : n.count;
|
|
818
893
|
if (typeof o == "number" && Number.isFinite(o)) {
|
|
819
|
-
const
|
|
820
|
-
if (typeof
|
|
894
|
+
const s = An(di, t, () => new Intl.PluralRules(t)).select(o), r = e[s];
|
|
895
|
+
if (typeof r == "string") return r;
|
|
821
896
|
}
|
|
822
897
|
return typeof e.other == "string" ? e.other : void 0;
|
|
823
898
|
}
|
|
824
|
-
function
|
|
899
|
+
function Nt(e, t, n) {
|
|
825
900
|
if (typeof e == "string") return e;
|
|
826
901
|
if (e !== null && typeof e == "object")
|
|
827
|
-
return
|
|
902
|
+
return fi(e, t, n);
|
|
828
903
|
}
|
|
829
|
-
const
|
|
830
|
-
function
|
|
831
|
-
|
|
904
|
+
const Dt = /* @__PURE__ */ new Set();
|
|
905
|
+
function gi(e) {
|
|
906
|
+
Dt.has(e) || (Dt.add(e), console.warn(
|
|
832
907
|
`[platform-modules] no translation for "${e}"; it will render as itself. Add it to the catalog passed to ModulesI18nProvider.`
|
|
833
908
|
));
|
|
834
909
|
}
|
|
835
|
-
function
|
|
836
|
-
const
|
|
837
|
-
if (typeof
|
|
838
|
-
const
|
|
839
|
-
return typeof
|
|
910
|
+
function hi(e, t, n, o, s) {
|
|
911
|
+
const r = Nt(e == null ? void 0 : e[t], n, s);
|
|
912
|
+
if (typeof r == "string") return r;
|
|
913
|
+
const i = Nt(ui[t], n, s);
|
|
914
|
+
return typeof i == "string" ? i : (o && gi(t), t);
|
|
840
915
|
}
|
|
841
|
-
function
|
|
842
|
-
return (o,
|
|
916
|
+
function xn(e, t = Ie, n = !1) {
|
|
917
|
+
return (o, s) => pi(hi(e, o, t, n, s), t, s);
|
|
843
918
|
}
|
|
844
|
-
const
|
|
845
|
-
function
|
|
919
|
+
const Ii = xn(), bi = { t: Ii, locale: Ie }, Ln = en(null);
|
|
920
|
+
function Za({
|
|
846
921
|
translations: e,
|
|
847
922
|
locale: t,
|
|
848
923
|
timezone: n,
|
|
849
924
|
warnOnMissingKey: o,
|
|
850
|
-
children:
|
|
925
|
+
children: s
|
|
851
926
|
}) {
|
|
852
|
-
const
|
|
853
|
-
const
|
|
927
|
+
const r = N(() => {
|
|
928
|
+
const i = t ?? Ie;
|
|
854
929
|
return {
|
|
855
|
-
t:
|
|
856
|
-
locale:
|
|
930
|
+
t: xn(e, i, o),
|
|
931
|
+
locale: i,
|
|
857
932
|
timezone: n
|
|
858
933
|
};
|
|
859
934
|
}, [e, t, n, o]);
|
|
860
|
-
return /* @__PURE__ */
|
|
935
|
+
return /* @__PURE__ */ l(Ln.Provider, { value: r, children: s });
|
|
861
936
|
}
|
|
862
|
-
function
|
|
863
|
-
return
|
|
937
|
+
function j() {
|
|
938
|
+
return tn(Ln) ?? bi;
|
|
864
939
|
}
|
|
865
|
-
const
|
|
866
|
-
function
|
|
867
|
-
const t =
|
|
940
|
+
const Mi = 864e5, yi = "en-US", Ot = /* @__PURE__ */ new Map(), qt = /* @__PURE__ */ new Map();
|
|
941
|
+
function Si(e) {
|
|
942
|
+
const t = qt.get(e);
|
|
868
943
|
if (t) return t;
|
|
869
944
|
const n = new Intl.NumberFormat(e, { minimumIntegerDigits: 2, useGrouping: !1 });
|
|
870
|
-
return
|
|
945
|
+
return qt.set(e, n), n;
|
|
871
946
|
}
|
|
872
|
-
function
|
|
947
|
+
function Ft(e, t) {
|
|
873
948
|
return {
|
|
874
949
|
time: new Intl.DateTimeFormat(e, {
|
|
875
950
|
hour: "numeric",
|
|
@@ -884,7 +959,7 @@ function yt(e, t) {
|
|
|
884
959
|
timeZone: t
|
|
885
960
|
}),
|
|
886
961
|
zone: t ? new Intl.DateTimeFormat(e, { timeZone: t, timeZoneName: "short" }) : void 0,
|
|
887
|
-
civilDay: new Intl.DateTimeFormat(
|
|
962
|
+
civilDay: new Intl.DateTimeFormat(yi, {
|
|
888
963
|
year: "numeric",
|
|
889
964
|
month: "numeric",
|
|
890
965
|
day: "numeric",
|
|
@@ -892,57 +967,57 @@ function yt(e, t) {
|
|
|
892
967
|
})
|
|
893
968
|
};
|
|
894
969
|
}
|
|
895
|
-
function
|
|
896
|
-
const n = t || void 0, o = `${e}|${n ?? ""}`,
|
|
897
|
-
if (
|
|
898
|
-
let
|
|
970
|
+
function Rn(e, t) {
|
|
971
|
+
const n = t || void 0, o = `${e}|${n ?? ""}`, s = Ot.get(o);
|
|
972
|
+
if (s) return s;
|
|
973
|
+
let r;
|
|
899
974
|
try {
|
|
900
|
-
|
|
975
|
+
r = Ft(e, n);
|
|
901
976
|
} catch {
|
|
902
977
|
console.warn(
|
|
903
978
|
`[platform-modules] Unusable timezone ${JSON.stringify(n)}; rendering dates in the viewer's own clock instead.`
|
|
904
|
-
),
|
|
979
|
+
), r = Ft(e, void 0);
|
|
905
980
|
}
|
|
906
|
-
return
|
|
981
|
+
return Ot.set(o, r), r;
|
|
907
982
|
}
|
|
908
|
-
function
|
|
909
|
-
return new Date(
|
|
983
|
+
function Ut(e, t) {
|
|
984
|
+
return new Date(dt(e, t)).getUTCFullYear();
|
|
910
985
|
}
|
|
911
|
-
function
|
|
986
|
+
function _i(e, t) {
|
|
912
987
|
var o;
|
|
913
|
-
const n = (o = e.zone) == null ? void 0 : o.formatToParts(t).find((
|
|
988
|
+
const n = (o = e.zone) == null ? void 0 : o.formatToParts(t).find((s) => s.type === "timeZoneName");
|
|
914
989
|
return (n == null ? void 0 : n.value) ?? null;
|
|
915
990
|
}
|
|
916
|
-
function
|
|
917
|
-
const n = e.civilDay.formatToParts(t), o = (
|
|
918
|
-
var
|
|
919
|
-
return Number((
|
|
991
|
+
function dt(e, t) {
|
|
992
|
+
const n = e.civilDay.formatToParts(t), o = (s) => {
|
|
993
|
+
var r;
|
|
994
|
+
return Number((r = n.find((i) => i.type === s)) == null ? void 0 : r.value);
|
|
920
995
|
};
|
|
921
996
|
return Date.UTC(o("year"), o("month") - 1, o("day"));
|
|
922
997
|
}
|
|
923
|
-
function
|
|
924
|
-
return
|
|
998
|
+
function Ti(e, t, n) {
|
|
999
|
+
return kn(Rn(Ie, n), e, t);
|
|
925
1000
|
}
|
|
926
|
-
function
|
|
927
|
-
return Math.round((
|
|
1001
|
+
function kn(e, t, n) {
|
|
1002
|
+
return Math.round((dt(e, t) - dt(e, n)) / Mi);
|
|
928
1003
|
}
|
|
929
|
-
function
|
|
930
|
-
const
|
|
931
|
-
if (Number.isNaN(
|
|
932
|
-
const
|
|
933
|
-
if (
|
|
934
|
-
if (
|
|
935
|
-
if (
|
|
936
|
-
const f =
|
|
937
|
-
return e("dateTimeWithDate", { date: f, time:
|
|
1004
|
+
function Ei(e, t, n, { locale: o = Ie, timezone: s } = {}) {
|
|
1005
|
+
const r = new Date(t);
|
|
1006
|
+
if (Number.isNaN(r.getTime())) return t;
|
|
1007
|
+
const i = Rn(o, s), a = _i(i, r), d = i.time.format(r), u = a ? e("timeWithZone", { time: d, zone: a }) : d, c = kn(i, r, n);
|
|
1008
|
+
if (c === 0) return e("dateTimeToday", { time: u });
|
|
1009
|
+
if (c === -1) return e("dateTimeYesterday", { time: u });
|
|
1010
|
+
if (c === 1) return e("dateTimeTomorrow", { time: u });
|
|
1011
|
+
const f = Ut(i, r) === Ut(i, n) ? i.day.format(r) : i.dayYear.format(r);
|
|
1012
|
+
return e("dateTimeWithDate", { date: f, time: u });
|
|
938
1013
|
}
|
|
939
|
-
function
|
|
940
|
-
return !Number.isInteger(e) || e < 1 ? null :
|
|
1014
|
+
function Ci(e, t = Ie) {
|
|
1015
|
+
return !Number.isInteger(e) || e < 1 ? null : Si(t).format(e);
|
|
941
1016
|
}
|
|
942
|
-
function
|
|
1017
|
+
function wi(e, t) {
|
|
943
1018
|
return t == null ? null : e("pointsAbbreviated", { count: t });
|
|
944
1019
|
}
|
|
945
|
-
function
|
|
1020
|
+
function Pi(e, t) {
|
|
946
1021
|
switch (t.type) {
|
|
947
1022
|
case "must_view":
|
|
948
1023
|
return e("requirementMustView");
|
|
@@ -960,13 +1035,13 @@ function ks(e, t) {
|
|
|
960
1035
|
return e("requirementUnknown");
|
|
961
1036
|
}
|
|
962
1037
|
}
|
|
963
|
-
function
|
|
1038
|
+
function vi(e, t, n, o) {
|
|
964
1039
|
return e("progressSummary", { percent: t, met: n, count: o });
|
|
965
1040
|
}
|
|
966
|
-
function
|
|
1041
|
+
function Ai(e, t, n, o) {
|
|
967
1042
|
return e("progressScreenReaderValue", { percent: t, met: n, count: o });
|
|
968
1043
|
}
|
|
969
|
-
const
|
|
1044
|
+
const X = "all", xi = 7, Li = {
|
|
970
1045
|
all: {
|
|
971
1046
|
label: "filterAll",
|
|
972
1047
|
order: 10,
|
|
@@ -995,13 +1070,13 @@ const te = "all", Fs = 7, Us = {
|
|
|
995
1070
|
label: "filterDueThisWeek",
|
|
996
1071
|
order: 40,
|
|
997
1072
|
predicate: (e, { today: t, timezone: n }) => {
|
|
998
|
-
var
|
|
999
|
-
const o = (
|
|
1073
|
+
var i;
|
|
1074
|
+
const o = (i = e.progress) == null ? void 0 : i.nextDueAt;
|
|
1000
1075
|
if (!o) return !1;
|
|
1001
|
-
const
|
|
1002
|
-
if (Number.isNaN(
|
|
1003
|
-
const
|
|
1004
|
-
return
|
|
1076
|
+
const s = new Date(o);
|
|
1077
|
+
if (Number.isNaN(s.getTime())) return !1;
|
|
1078
|
+
const r = Ti(s, t, n);
|
|
1079
|
+
return r >= 0 && r < xi;
|
|
1005
1080
|
}
|
|
1006
1081
|
},
|
|
1007
1082
|
missing: {
|
|
@@ -1013,43 +1088,24 @@ const te = "all", Fs = 7, Us = {
|
|
|
1013
1088
|
}
|
|
1014
1089
|
}
|
|
1015
1090
|
};
|
|
1016
|
-
function
|
|
1091
|
+
function yt(e) {
|
|
1017
1092
|
if (!(!e || e.clientOnly))
|
|
1018
1093
|
return e.query;
|
|
1019
1094
|
}
|
|
1020
|
-
function
|
|
1021
|
-
return e !== void 0 &&
|
|
1095
|
+
function mt(e) {
|
|
1096
|
+
return e !== void 0 && yt(e) === void 0;
|
|
1022
1097
|
}
|
|
1023
|
-
const
|
|
1024
|
-
moduleLabel: (e, t, { locale: n }) =>
|
|
1025
|
-
dateTime: (e, t, { t: n, locale: o, timezone:
|
|
1026
|
-
points: (e, { t }) =>
|
|
1027
|
-
progress: (e, t, n, { t: o }) =>
|
|
1028
|
-
},
|
|
1029
|
-
function Fe(e, t) {
|
|
1030
|
-
const n = Object.entries(t ?? {}).filter(([, o]) => o !== void 0);
|
|
1031
|
-
return { ...e, ...Object.fromEntries(n) };
|
|
1032
|
-
}
|
|
1033
|
-
function ie(e, t = {}) {
|
|
1034
|
-
const n = Object.keys(e).map((r) => [
|
|
1035
|
-
r,
|
|
1036
|
-
Fe(e[r], Oe(t, r) ? t[r] : void 0)
|
|
1037
|
-
]), o = Object.keys(t).filter((r) => !Oe(e, r)).sort().map((r) => [r, Fe({}, t[r])]);
|
|
1038
|
-
return Object.fromEntries([...n, ...o]);
|
|
1039
|
-
}
|
|
1040
|
-
function ce(e, t) {
|
|
1041
|
-
if (!(!Oe(e, t) || e[t].hidden))
|
|
1042
|
-
return e[t];
|
|
1043
|
-
}
|
|
1044
|
-
function it(e) {
|
|
1045
|
-
return Object.keys(e).filter((t) => ce(e, t) !== void 0).map((t) => ({ ...e[t], key: t })).sort((t, n) => t.order - n.order);
|
|
1046
|
-
}
|
|
1047
|
-
const $s = "type", Bs = {
|
|
1098
|
+
const Ri = {
|
|
1099
|
+
moduleLabel: (e, t, { locale: n }) => Ci(e, n),
|
|
1100
|
+
dateTime: (e, t, { t: n, locale: o, timezone: s }) => Ei(n, e, t, { locale: o, timezone: s }),
|
|
1101
|
+
points: (e, { t }) => wi(t, e),
|
|
1102
|
+
progress: (e, t, n, { t: o }) => vi(o, e, t, n)
|
|
1103
|
+
}, ki = "type", Ni = {
|
|
1048
1104
|
type: {
|
|
1049
1105
|
label: "metaFieldTypeLabel",
|
|
1050
1106
|
order: 10,
|
|
1051
1107
|
render: ({ item: e, t, config: n }) => {
|
|
1052
|
-
const o =
|
|
1108
|
+
const o = he(n.itemTypes, e.type);
|
|
1053
1109
|
return o ? t(o.label) : null;
|
|
1054
1110
|
}
|
|
1055
1111
|
},
|
|
@@ -1066,13 +1122,13 @@ const $s = "type", Bs = {
|
|
|
1066
1122
|
requirement: {
|
|
1067
1123
|
label: "metaFieldRequirementLabel",
|
|
1068
1124
|
order: 40,
|
|
1069
|
-
render: ({ item: e, t }) => e.completionRequirement ?
|
|
1125
|
+
render: ({ item: e, t }) => e.completionRequirement ? Pi(t, e.completionRequirement) : null
|
|
1070
1126
|
},
|
|
1071
1127
|
estimatedDuration: {
|
|
1072
1128
|
label: "metaFieldDurationLabel",
|
|
1073
1129
|
order: 50,
|
|
1074
1130
|
render: ({ item: e, t }) => {
|
|
1075
|
-
const n =
|
|
1131
|
+
const n = zo(e);
|
|
1076
1132
|
return n === null ? null : t("durationMinutes", { count: n });
|
|
1077
1133
|
}
|
|
1078
1134
|
},
|
|
@@ -1081,259 +1137,268 @@ const $s = "type", Bs = {
|
|
|
1081
1137
|
order: 60,
|
|
1082
1138
|
render: ({ item: e, t }) => e.published ? null : t("itemUnpublishedLabel")
|
|
1083
1139
|
}
|
|
1084
|
-
},
|
|
1140
|
+
}, ne = { size: "md", color: "mutedColor" }, Di = {
|
|
1085
1141
|
assignment: {
|
|
1086
1142
|
label: "itemTypeAssignment",
|
|
1087
1143
|
order: 10,
|
|
1088
|
-
icon: /* @__PURE__ */
|
|
1144
|
+
icon: /* @__PURE__ */ l(mo, { ...ne })
|
|
1089
1145
|
},
|
|
1090
|
-
quiz: { label: "itemTypeQuiz", order: 20, icon: /* @__PURE__ */
|
|
1146
|
+
quiz: { label: "itemTypeQuiz", order: 20, icon: /* @__PURE__ */ l(uo, { ...ne }) },
|
|
1091
1147
|
discussion: {
|
|
1092
1148
|
label: "itemTypeDiscussion",
|
|
1093
1149
|
order: 30,
|
|
1094
|
-
icon: /* @__PURE__ */
|
|
1150
|
+
icon: /* @__PURE__ */ l(co, { ...ne })
|
|
1095
1151
|
},
|
|
1096
|
-
page: { label: "itemTypePage", order: 40, icon: /* @__PURE__ */
|
|
1097
|
-
file: { label: "itemTypeFile", order: 50, icon: /* @__PURE__ */
|
|
1152
|
+
page: { label: "itemTypePage", order: 40, icon: /* @__PURE__ */ l(ao, { ...ne }) },
|
|
1153
|
+
file: { label: "itemTypeFile", order: 50, icon: /* @__PURE__ */ l(lo, { ...ne }) },
|
|
1098
1154
|
external_url: {
|
|
1099
1155
|
label: "itemTypeExternalUrl",
|
|
1100
1156
|
order: 60,
|
|
1101
|
-
icon: /* @__PURE__ */
|
|
1157
|
+
icon: /* @__PURE__ */ l(io, { ...ne })
|
|
1102
1158
|
},
|
|
1103
1159
|
external_tool: {
|
|
1104
1160
|
label: "itemTypeExternalTool",
|
|
1105
1161
|
order: 70,
|
|
1106
|
-
icon: /* @__PURE__ */
|
|
1162
|
+
icon: /* @__PURE__ */ l(ro, { ...ne })
|
|
1107
1163
|
},
|
|
1108
1164
|
sub_header: { label: "itemTypeSubHeader", order: 80, icon: null }
|
|
1109
|
-
},
|
|
1110
|
-
formatters:
|
|
1111
|
-
itemTypes:
|
|
1165
|
+
}, et = {
|
|
1166
|
+
formatters: Ri,
|
|
1167
|
+
itemTypes: Di,
|
|
1112
1168
|
itemStatuses: {},
|
|
1113
|
-
itemMeta:
|
|
1114
|
-
filters:
|
|
1169
|
+
itemMeta: Ni,
|
|
1170
|
+
filters: Li,
|
|
1115
1171
|
moduleActions: {},
|
|
1116
1172
|
itemActions: {},
|
|
1117
1173
|
navigation: {}
|
|
1118
1174
|
};
|
|
1119
|
-
Object.freeze(
|
|
1120
|
-
for (const e of Object.values(
|
|
1175
|
+
Object.freeze(et);
|
|
1176
|
+
for (const e of Object.values(et)) {
|
|
1121
1177
|
Object.freeze(e);
|
|
1122
1178
|
for (const t of Object.values(e)) Object.freeze(t);
|
|
1123
1179
|
}
|
|
1124
|
-
function
|
|
1125
|
-
return
|
|
1126
|
-
const o =
|
|
1127
|
-
return o !== void 0 && !
|
|
1180
|
+
function Oi(e, t) {
|
|
1181
|
+
return Je(e).filter((n) => {
|
|
1182
|
+
const o = yt(n);
|
|
1183
|
+
return o !== void 0 && !xo(t, o);
|
|
1128
1184
|
}).map((n) => n.key);
|
|
1129
1185
|
}
|
|
1130
|
-
function
|
|
1186
|
+
function zt(e) {
|
|
1131
1187
|
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.`;
|
|
1132
1188
|
}
|
|
1133
|
-
function
|
|
1134
|
-
const n =
|
|
1189
|
+
function qi(e, t) {
|
|
1190
|
+
const n = Oi(e, t);
|
|
1135
1191
|
if (n.length === 0) return e;
|
|
1136
1192
|
if (process.env.NODE_ENV !== "production")
|
|
1137
|
-
throw new Error(
|
|
1138
|
-
console.warn(
|
|
1139
|
-
const o = Object.fromEntries(n.map((
|
|
1193
|
+
throw new Error(zt(n));
|
|
1194
|
+
console.warn(zt(n));
|
|
1195
|
+
const o = Object.fromEntries(n.map((s) => [s, { ...e[s], hidden: !0 }]));
|
|
1140
1196
|
return { ...e, ...o };
|
|
1141
1197
|
}
|
|
1142
|
-
const
|
|
1143
|
-
function
|
|
1144
|
-
return /* @__PURE__ */
|
|
1198
|
+
const Nn = en(null);
|
|
1199
|
+
function Xa({ value: e, children: t }) {
|
|
1200
|
+
return /* @__PURE__ */ l(Nn.Provider, { value: e, children: t });
|
|
1145
1201
|
}
|
|
1146
|
-
function
|
|
1147
|
-
return
|
|
1202
|
+
function Re() {
|
|
1203
|
+
return tn(Nn) ?? et;
|
|
1148
1204
|
}
|
|
1149
|
-
function
|
|
1150
|
-
return
|
|
1205
|
+
function Ja(e) {
|
|
1206
|
+
return he(Re().itemMeta, e) !== void 0;
|
|
1151
1207
|
}
|
|
1152
|
-
const
|
|
1153
|
-
label:
|
|
1154
|
-
order:
|
|
1155
|
-
hidden:
|
|
1208
|
+
const ke = m.object({
|
|
1209
|
+
label: m.string(),
|
|
1210
|
+
order: m.number(),
|
|
1211
|
+
hidden: m.boolean().optional()
|
|
1156
1212
|
});
|
|
1157
|
-
function
|
|
1158
|
-
return
|
|
1213
|
+
function fe(e) {
|
|
1214
|
+
return m.record(m.string(), e);
|
|
1159
1215
|
}
|
|
1160
|
-
const
|
|
1216
|
+
const Fi = fe(ke.strict()), Dn = (e) => e == null || typeof e == "string" || typeof e == "number" || typeof e == "bigint" || typeof e == "boolean" || nn(e) || Array.isArray(e) && e.every(Dn), Ui = (e) => {
|
|
1161
1217
|
var t;
|
|
1162
1218
|
return e == null || typeof e == "function" && !((t = e.prototype) != null && t.isReactComponent);
|
|
1163
|
-
},
|
|
1164
|
-
icon:
|
|
1165
|
-
renderIcon:
|
|
1219
|
+
}, zi = ke.extend({
|
|
1220
|
+
icon: m.custom(Dn, { message: "icon must be a ReactNode" }),
|
|
1221
|
+
renderIcon: m.custom(Ui, {
|
|
1166
1222
|
message: "renderIcon must be a function of the item, not a React component"
|
|
1167
1223
|
})
|
|
1224
|
+
}).strict(), On = (e) => {
|
|
1225
|
+
var t;
|
|
1226
|
+
return typeof e == "function" && !((t = e.prototype) != null && t.isReactComponent);
|
|
1227
|
+
}, $t = (e) => e == null || On(e), Bt = ke.extend({
|
|
1228
|
+
onSelect: m.custom(On, {
|
|
1229
|
+
message: "onSelect must be a function taking an ActionContext"
|
|
1230
|
+
}),
|
|
1231
|
+
visible: m.custom($t, {
|
|
1232
|
+
message: "visible must be a function taking an ActionContext, not a React component"
|
|
1233
|
+
}),
|
|
1234
|
+
renderModal: m.custom($t, {
|
|
1235
|
+
message: "renderModal must be a function taking an ActionContext, not a React component"
|
|
1236
|
+
})
|
|
1168
1237
|
}).strict();
|
|
1169
|
-
function
|
|
1170
|
-
return
|
|
1238
|
+
function He() {
|
|
1239
|
+
return m.custom((e) => typeof e == "function", {
|
|
1171
1240
|
message: "Expected a function"
|
|
1172
1241
|
});
|
|
1173
1242
|
}
|
|
1174
|
-
const
|
|
1175
|
-
render:
|
|
1243
|
+
const $i = ke.extend({
|
|
1244
|
+
render: m.custom((e) => typeof e == "function", {
|
|
1176
1245
|
message: "render must be a function taking a MetaFieldContext"
|
|
1177
1246
|
})
|
|
1178
|
-
}).strict(),
|
|
1179
|
-
predicate:
|
|
1247
|
+
}).strict(), Bi = ke.extend({
|
|
1248
|
+
predicate: m.custom((e) => typeof e == "function", {
|
|
1180
1249
|
message: "predicate must be a function of the module and a FilterContext"
|
|
1181
1250
|
}),
|
|
1182
|
-
query:
|
|
1183
|
-
clientOnly:
|
|
1184
|
-
}).strict(),
|
|
1185
|
-
formatters:
|
|
1186
|
-
moduleLabel:
|
|
1187
|
-
dateTime:
|
|
1188
|
-
points:
|
|
1189
|
-
progress:
|
|
1251
|
+
query: Ao.optional(),
|
|
1252
|
+
clientOnly: m.boolean().optional()
|
|
1253
|
+
}).strict(), Gi = m.object({
|
|
1254
|
+
formatters: m.object({
|
|
1255
|
+
moduleLabel: He(),
|
|
1256
|
+
dateTime: He(),
|
|
1257
|
+
points: He(),
|
|
1258
|
+
progress: He()
|
|
1190
1259
|
}).strict(),
|
|
1191
|
-
itemTypes:
|
|
1192
|
-
itemStatuses:
|
|
1193
|
-
itemMeta:
|
|
1194
|
-
filters:
|
|
1195
|
-
moduleActions:
|
|
1196
|
-
itemActions:
|
|
1197
|
-
navigation:
|
|
1260
|
+
itemTypes: fe(zi),
|
|
1261
|
+
itemStatuses: Fi,
|
|
1262
|
+
itemMeta: fe($i),
|
|
1263
|
+
filters: fe(Bi),
|
|
1264
|
+
moduleActions: fe(Bt),
|
|
1265
|
+
itemActions: fe(Bt),
|
|
1266
|
+
navigation: m.object({}).strict()
|
|
1198
1267
|
});
|
|
1199
|
-
function
|
|
1200
|
-
const n = Object.keys(t).filter((
|
|
1268
|
+
function ji(e, t = {}) {
|
|
1269
|
+
const n = Object.keys(t).filter((s) => !Qe(e, s));
|
|
1201
1270
|
if (n.length > 0)
|
|
1202
1271
|
throw new Error(
|
|
1203
1272
|
`Unknown modules config key(s): ${n.join(", ")}. Known keys are ${Object.keys(e).join(", ")}.`
|
|
1204
1273
|
);
|
|
1205
1274
|
const o = {
|
|
1206
|
-
formatters:
|
|
1207
|
-
itemTypes:
|
|
1208
|
-
itemStatuses:
|
|
1209
|
-
itemMeta:
|
|
1210
|
-
filters:
|
|
1211
|
-
moduleActions:
|
|
1212
|
-
itemActions:
|
|
1213
|
-
navigation:
|
|
1275
|
+
formatters: Ve(e.formatters, t.formatters),
|
|
1276
|
+
itemTypes: me(e.itemTypes, t.itemTypes),
|
|
1277
|
+
itemStatuses: me(e.itemStatuses, t.itemStatuses),
|
|
1278
|
+
itemMeta: me(e.itemMeta, t.itemMeta),
|
|
1279
|
+
filters: me(e.filters, t.filters),
|
|
1280
|
+
moduleActions: me(e.moduleActions, t.moduleActions),
|
|
1281
|
+
itemActions: me(e.itemActions, t.itemActions),
|
|
1282
|
+
navigation: Ve(e.navigation, t.navigation)
|
|
1214
1283
|
};
|
|
1215
|
-
return
|
|
1284
|
+
return Gi.parse(o), o;
|
|
1216
1285
|
}
|
|
1217
|
-
function
|
|
1218
|
-
return
|
|
1286
|
+
function ec(e = {}) {
|
|
1287
|
+
return ji(et, e);
|
|
1288
|
+
}
|
|
1289
|
+
function tc(e) {
|
|
1290
|
+
const t = ht();
|
|
1291
|
+
return U(
|
|
1292
|
+
(n, o) => Ms({ queryClient: t, courseId: e, module: n, item: o }),
|
|
1293
|
+
[t, e]
|
|
1294
|
+
);
|
|
1219
1295
|
}
|
|
1220
|
-
function
|
|
1221
|
-
const { formatters: e } =
|
|
1222
|
-
return
|
|
1223
|
-
const
|
|
1296
|
+
function Ne() {
|
|
1297
|
+
const { formatters: e } = Re(), { t, locale: n, timezone: o } = j();
|
|
1298
|
+
return N(() => {
|
|
1299
|
+
const s = { t, locale: n, timezone: o }, r = (i, a) => e.dateTime(i, a, s);
|
|
1224
1300
|
return {
|
|
1225
|
-
moduleLabel: (
|
|
1226
|
-
dueByline: (
|
|
1227
|
-
unlockByline: (
|
|
1228
|
-
unlockedByline: (
|
|
1229
|
-
points: (
|
|
1230
|
-
progress: (
|
|
1301
|
+
moduleLabel: (i, a) => e.moduleLabel(i, a, s) || null,
|
|
1302
|
+
dueByline: (i, a) => t("dueByline", { when: r(i, a) }),
|
|
1303
|
+
unlockByline: (i, a) => t("unlockByline", { when: r(i, a) }),
|
|
1304
|
+
unlockedByline: (i, a) => t("unlockedByline", { when: r(i, a) }),
|
|
1305
|
+
points: (i) => e.points(i, s),
|
|
1306
|
+
progress: (i, a, d) => e.progress(i, a, d, s)
|
|
1231
1307
|
};
|
|
1232
1308
|
}, [e, t, n, o]);
|
|
1233
1309
|
}
|
|
1234
|
-
const
|
|
1235
|
-
|
|
1236
|
-
course: (e) => [...le, e],
|
|
1237
|
-
list: (e, t = {}) => [...le, e, "list", t],
|
|
1238
|
-
items: (e, t, n = {}) => [...le, e, "module", t, "items", n]
|
|
1239
|
-
};
|
|
1240
|
-
function Js(e) {
|
|
1241
|
-
return [...le, e, "list"];
|
|
1242
|
-
}
|
|
1243
|
-
function hn(e, t) {
|
|
1244
|
-
return [...le, e, "module", t, "items"];
|
|
1245
|
-
}
|
|
1246
|
-
function In(e) {
|
|
1310
|
+
const St = 100, qn = 100, Fn = 100, Yi = 4, tt = 5 * 60 * 1e3, Un = 20, Ze = { hasNextPage: !1, endCursor: null };
|
|
1311
|
+
function zn(e) {
|
|
1247
1312
|
return e.pageInfo.hasNextPage ? e.pageInfo.endCursor : null;
|
|
1248
1313
|
}
|
|
1249
|
-
function
|
|
1314
|
+
function $n(e) {
|
|
1250
1315
|
const {
|
|
1251
1316
|
courseId: t,
|
|
1252
1317
|
adapter: n,
|
|
1253
1318
|
pageSize: o,
|
|
1254
|
-
includeItems:
|
|
1255
|
-
filter:
|
|
1256
|
-
inlineItemsFirst:
|
|
1319
|
+
includeItems: s,
|
|
1320
|
+
filter: r,
|
|
1321
|
+
inlineItemsFirst: i,
|
|
1257
1322
|
inlineFirst: a,
|
|
1258
|
-
view:
|
|
1259
|
-
staleTime:
|
|
1260
|
-
enabled:
|
|
1323
|
+
view: d,
|
|
1324
|
+
staleTime: u,
|
|
1325
|
+
enabled: c
|
|
1261
1326
|
} = e;
|
|
1262
1327
|
return {
|
|
1263
1328
|
// `inlineItemsFirst` is deliberately out of the key: it is derived from this very list.
|
|
1264
|
-
queryKey:
|
|
1329
|
+
queryKey: Le.list(t, { view: d, pageSize: o, includeItems: s, filter: r }),
|
|
1265
1330
|
initialPageParam: null,
|
|
1266
1331
|
queryFn: ({ pageParam: p, signal: f }) => n.listModules({
|
|
1267
1332
|
courseId: t,
|
|
1268
1333
|
cursor: p,
|
|
1269
1334
|
pageSize: o,
|
|
1270
|
-
includeItems:
|
|
1271
|
-
filter:
|
|
1272
|
-
inlineItemsFirst:
|
|
1335
|
+
includeItems: s,
|
|
1336
|
+
filter: r,
|
|
1337
|
+
inlineItemsFirst: i,
|
|
1273
1338
|
inlineFirst: a,
|
|
1274
1339
|
signal: f
|
|
1275
1340
|
}),
|
|
1276
|
-
getNextPageParam:
|
|
1277
|
-
enabled:
|
|
1278
|
-
staleTime:
|
|
1341
|
+
getNextPageParam: zn,
|
|
1342
|
+
enabled: c,
|
|
1343
|
+
staleTime: u,
|
|
1279
1344
|
refetchOnWindowFocus: !1
|
|
1280
1345
|
};
|
|
1281
1346
|
}
|
|
1282
|
-
function
|
|
1283
|
-
const { courseId: t, moduleId: n, adapter: o, pageSize:
|
|
1347
|
+
function Bn(e) {
|
|
1348
|
+
const { courseId: t, moduleId: n, adapter: o, pageSize: s, view: r, staleTime: i, enabled: a, limit: d } = e;
|
|
1284
1349
|
return {
|
|
1285
|
-
queryKey:
|
|
1350
|
+
queryKey: Le.items(t, n, { view: r, pageSize: s }),
|
|
1286
1351
|
initialPageParam: null,
|
|
1287
|
-
queryFn: ({ pageParam:
|
|
1288
|
-
const p = () => o.listModuleItems({ courseId: t, moduleId: n, cursor:
|
|
1289
|
-
return
|
|
1290
|
-
if (
|
|
1352
|
+
queryFn: ({ pageParam: u, signal: c }) => {
|
|
1353
|
+
const p = () => o.listModuleItems({ courseId: t, moduleId: n, cursor: u, pageSize: s, signal: c });
|
|
1354
|
+
return d ? d(() => {
|
|
1355
|
+
if (c.aborted)
|
|
1291
1356
|
throw new DOMException("The operation was aborted.", "AbortError");
|
|
1292
1357
|
return p();
|
|
1293
1358
|
}) : p();
|
|
1294
1359
|
},
|
|
1295
|
-
getNextPageParam:
|
|
1360
|
+
getNextPageParam: zn,
|
|
1296
1361
|
enabled: a,
|
|
1297
|
-
staleTime:
|
|
1362
|
+
staleTime: i,
|
|
1298
1363
|
refetchOnWindowFocus: !1
|
|
1299
1364
|
};
|
|
1300
1365
|
}
|
|
1301
|
-
function
|
|
1302
|
-
var
|
|
1366
|
+
function Wi(e) {
|
|
1367
|
+
var x;
|
|
1303
1368
|
const {
|
|
1304
1369
|
courseId: t,
|
|
1305
1370
|
adapter: n,
|
|
1306
|
-
pageSize: o =
|
|
1307
|
-
includeItems:
|
|
1308
|
-
filter:
|
|
1309
|
-
inlineItemsFirst:
|
|
1371
|
+
pageSize: o = St,
|
|
1372
|
+
includeItems: s = !1,
|
|
1373
|
+
filter: r,
|
|
1374
|
+
inlineItemsFirst: i,
|
|
1310
1375
|
inlineFirst: a,
|
|
1311
|
-
view:
|
|
1312
|
-
staleTime:
|
|
1313
|
-
enabled:
|
|
1314
|
-
} = e, p =
|
|
1315
|
-
|
|
1376
|
+
view: d,
|
|
1377
|
+
staleTime: u = tt,
|
|
1378
|
+
enabled: c = !0
|
|
1379
|
+
} = e, p = It({
|
|
1380
|
+
...$n({
|
|
1316
1381
|
courseId: t,
|
|
1317
1382
|
adapter: n,
|
|
1318
1383
|
pageSize: o,
|
|
1319
|
-
includeItems:
|
|
1320
|
-
filter:
|
|
1321
|
-
inlineItemsFirst:
|
|
1384
|
+
includeItems: s,
|
|
1385
|
+
filter: r,
|
|
1386
|
+
inlineItemsFirst: i,
|
|
1322
1387
|
inlineFirst: a,
|
|
1323
|
-
view:
|
|
1324
|
-
staleTime:
|
|
1325
|
-
enabled:
|
|
1388
|
+
view: d,
|
|
1389
|
+
staleTime: u,
|
|
1390
|
+
enabled: c
|
|
1326
1391
|
}),
|
|
1327
1392
|
// `useItemsMode` shares `modulesQueryOptions`, and `inlineFirst` is out of that key.
|
|
1328
|
-
placeholderData:
|
|
1329
|
-
}), f = (
|
|
1330
|
-
|
|
1331
|
-
}, [
|
|
1393
|
+
placeholderData: ho
|
|
1394
|
+
}), f = (x = p.data) == null ? void 0 : x.pages, y = N(() => (f ?? []).flatMap((_) => _.modules), [f]), g = f && f.length > 0 ? f[f.length - 1].pageInfo : Ze, b = p.fetchNextPage, w = U(() => {
|
|
1395
|
+
b();
|
|
1396
|
+
}, [b]);
|
|
1332
1397
|
return {
|
|
1333
1398
|
modules: y,
|
|
1334
1399
|
pageInfo: g,
|
|
1335
1400
|
hasNextPage: g.hasNextPage,
|
|
1336
|
-
fetchNextPage:
|
|
1401
|
+
fetchNextPage: w,
|
|
1337
1402
|
isLoading: p.isLoading,
|
|
1338
1403
|
isFetchingNextPage: p.isFetchingNextPage,
|
|
1339
1404
|
isPending: p.isPending,
|
|
@@ -1341,29 +1406,29 @@ function ei(e) {
|
|
|
1341
1406
|
error: p.error
|
|
1342
1407
|
};
|
|
1343
1408
|
}
|
|
1344
|
-
function
|
|
1345
|
-
var
|
|
1409
|
+
function nc(e) {
|
|
1410
|
+
var b;
|
|
1346
1411
|
const {
|
|
1347
1412
|
courseId: t,
|
|
1348
1413
|
moduleId: n,
|
|
1349
1414
|
adapter: o,
|
|
1350
|
-
pageSize:
|
|
1351
|
-
view:
|
|
1352
|
-
enabled:
|
|
1353
|
-
staleTime: a =
|
|
1354
|
-
limit:
|
|
1355
|
-
} = e,
|
|
1356
|
-
|
|
1415
|
+
pageSize: s = qn,
|
|
1416
|
+
view: r,
|
|
1417
|
+
enabled: i = !0,
|
|
1418
|
+
staleTime: a = tt,
|
|
1419
|
+
limit: d
|
|
1420
|
+
} = e, u = It(
|
|
1421
|
+
Bn({
|
|
1357
1422
|
courseId: t,
|
|
1358
1423
|
moduleId: n,
|
|
1359
1424
|
adapter: o,
|
|
1360
|
-
pageSize:
|
|
1361
|
-
view:
|
|
1425
|
+
pageSize: s,
|
|
1426
|
+
view: r,
|
|
1362
1427
|
staleTime: a,
|
|
1363
|
-
enabled:
|
|
1364
|
-
limit:
|
|
1428
|
+
enabled: i,
|
|
1429
|
+
limit: d
|
|
1365
1430
|
})
|
|
1366
|
-
),
|
|
1431
|
+
), c = (b = u.data) == null ? void 0 : b.pages, p = N(() => (c ?? []).flatMap((w) => w.items), [c]), f = c && c.length > 0 ? c[c.length - 1].pageInfo : Ze, y = u.fetchNextPage, g = U(() => {
|
|
1367
1432
|
y();
|
|
1368
1433
|
}, [y]);
|
|
1369
1434
|
return {
|
|
@@ -1371,45 +1436,45 @@ function Gl(e) {
|
|
|
1371
1436
|
pageInfo: f,
|
|
1372
1437
|
hasNextPage: f.hasNextPage,
|
|
1373
1438
|
fetchNextPage: g,
|
|
1374
|
-
isLoading:
|
|
1375
|
-
isFetchingNextPage:
|
|
1376
|
-
error:
|
|
1439
|
+
isLoading: u.isLoading,
|
|
1440
|
+
isFetchingNextPage: u.isFetchingNextPage,
|
|
1441
|
+
error: u.error
|
|
1377
1442
|
};
|
|
1378
1443
|
}
|
|
1379
|
-
function
|
|
1444
|
+
function Hi(e, t, n = Mt) {
|
|
1380
1445
|
if (e.pageInfo.hasNextPage) return "onDemand";
|
|
1381
|
-
let o = 0,
|
|
1382
|
-
for (const
|
|
1383
|
-
if (
|
|
1384
|
-
o +=
|
|
1446
|
+
let o = 0, s = 0;
|
|
1447
|
+
for (const r of e.modules) {
|
|
1448
|
+
if (r.itemCount > t) return "onDemand";
|
|
1449
|
+
o += r.itemCount, r.itemCount > s && (s = r.itemCount);
|
|
1385
1450
|
}
|
|
1386
|
-
return o > t * 2 ? "onDemand" : Math.max(e.modules.length, 1) * Math.max(
|
|
1451
|
+
return o > t * 2 ? "onDemand" : Math.max(e.modules.length, 1) * Math.max(s, 1) <= n ? "inline" : "onDemand";
|
|
1387
1452
|
}
|
|
1388
|
-
function
|
|
1453
|
+
function Ki(e) {
|
|
1389
1454
|
var y;
|
|
1390
1455
|
const {
|
|
1391
1456
|
courseId: t,
|
|
1392
1457
|
adapter: n,
|
|
1393
1458
|
mode: o = "auto",
|
|
1394
|
-
inlineThreshold:
|
|
1395
|
-
nodeBudget:
|
|
1396
|
-
pageSize:
|
|
1459
|
+
inlineThreshold: s = Fn,
|
|
1460
|
+
nodeBudget: r = n.inlineNodeBudget ?? Mt,
|
|
1461
|
+
pageSize: i = St,
|
|
1397
1462
|
filter: a,
|
|
1398
|
-
view:
|
|
1399
|
-
staleTime:
|
|
1400
|
-
} = e,
|
|
1401
|
-
|
|
1463
|
+
view: d,
|
|
1464
|
+
staleTime: u = tt
|
|
1465
|
+
} = e, c = o === "auto", p = It(
|
|
1466
|
+
$n({
|
|
1402
1467
|
courseId: t,
|
|
1403
1468
|
adapter: n,
|
|
1404
|
-
pageSize:
|
|
1469
|
+
pageSize: i,
|
|
1405
1470
|
includeItems: !1,
|
|
1406
1471
|
filter: a,
|
|
1407
|
-
view:
|
|
1408
|
-
staleTime:
|
|
1409
|
-
enabled:
|
|
1472
|
+
view: d,
|
|
1473
|
+
staleTime: u,
|
|
1474
|
+
enabled: c
|
|
1410
1475
|
})
|
|
1411
1476
|
);
|
|
1412
|
-
if (!
|
|
1477
|
+
if (!c)
|
|
1413
1478
|
return {
|
|
1414
1479
|
resolvedMode: o,
|
|
1415
1480
|
isResolving: !1,
|
|
@@ -1427,268 +1492,276 @@ function ni(e) {
|
|
|
1427
1492
|
};
|
|
1428
1493
|
const f = (y = p.data) == null ? void 0 : y.pages[0];
|
|
1429
1494
|
return f ? {
|
|
1430
|
-
resolvedMode:
|
|
1495
|
+
resolvedMode: Hi(f, s, r),
|
|
1431
1496
|
isResolving: !1,
|
|
1432
1497
|
probed: !0,
|
|
1433
1498
|
error: null,
|
|
1434
|
-
inlineShape:
|
|
1499
|
+
inlineShape: Qi(f)
|
|
1435
1500
|
} : { resolvedMode: null, isResolving: !0, probed: !0, error: null, inlineShape: null };
|
|
1436
1501
|
}
|
|
1437
|
-
function
|
|
1502
|
+
function Qi(e) {
|
|
1438
1503
|
let t = 1;
|
|
1439
1504
|
for (const n of e.modules)
|
|
1440
1505
|
n.itemCount > t && (t = n.itemCount);
|
|
1441
1506
|
return { moduleCount: Math.max(e.modules.length, 1), maxItemCount: t };
|
|
1442
1507
|
}
|
|
1443
|
-
const
|
|
1444
|
-
function
|
|
1445
|
-
const o =
|
|
1446
|
-
|
|
1447
|
-
const
|
|
1448
|
-
|
|
1449
|
-
const
|
|
1450
|
-
let
|
|
1451
|
-
for (const [
|
|
1452
|
-
const
|
|
1453
|
-
|
|
1508
|
+
const Gt = "\0", Vi = /* @__PURE__ */ new Map();
|
|
1509
|
+
function Zi(e, t, n = Un) {
|
|
1510
|
+
const o = ht(), s = $(/* @__PURE__ */ new Map()), [r, i] = V(Vi), a = e.join(Gt), d = N(() => a === "" ? [] : a.split(Gt), [a]);
|
|
1511
|
+
Z(() => {
|
|
1512
|
+
const c = s.current, p = () => {
|
|
1513
|
+
i((g) => {
|
|
1514
|
+
const b = /* @__PURE__ */ new Map();
|
|
1515
|
+
let w = g.size !== c.size;
|
|
1516
|
+
for (const [x, _] of c) {
|
|
1517
|
+
const A = _.getCurrentResult();
|
|
1518
|
+
b.set(x, A), !w && g.get(x) !== A && (w = !0);
|
|
1454
1519
|
}
|
|
1455
|
-
return
|
|
1520
|
+
return w ? b : g;
|
|
1456
1521
|
});
|
|
1457
|
-
}, f = new Set(
|
|
1458
|
-
for (const g of
|
|
1459
|
-
if (
|
|
1460
|
-
const
|
|
1522
|
+
}, f = new Set(d);
|
|
1523
|
+
for (const g of d) {
|
|
1524
|
+
if (c.has(g)) continue;
|
|
1525
|
+
const b = new Io(
|
|
1461
1526
|
o,
|
|
1462
1527
|
t(g, !0)
|
|
1463
1528
|
);
|
|
1464
|
-
|
|
1529
|
+
c.set(g, b), b.subscribe(p);
|
|
1465
1530
|
}
|
|
1466
|
-
for (const [g,
|
|
1467
|
-
|
|
1468
|
-
for (const g of
|
|
1469
|
-
const
|
|
1470
|
-
|
|
1531
|
+
for (const [g, b] of c)
|
|
1532
|
+
b.setOptions(t(g, f.has(g)));
|
|
1533
|
+
for (const g of d) {
|
|
1534
|
+
const b = c.get(g);
|
|
1535
|
+
b && (c.delete(g), c.set(g, b));
|
|
1471
1536
|
}
|
|
1472
|
-
let y =
|
|
1537
|
+
let y = c.size - f.size;
|
|
1473
1538
|
if (y > n)
|
|
1474
|
-
for (const [g,
|
|
1539
|
+
for (const [g, b] of c) {
|
|
1475
1540
|
if (y <= n) break;
|
|
1476
|
-
f.has(g) || (
|
|
1541
|
+
f.has(g) || (b.destroy(), c.delete(g), y -= 1);
|
|
1477
1542
|
}
|
|
1478
1543
|
p();
|
|
1479
|
-
}, [o, t,
|
|
1480
|
-
const
|
|
1544
|
+
}, [o, t, d, n]), Z(() => {
|
|
1545
|
+
const c = s.current;
|
|
1481
1546
|
return () => {
|
|
1482
|
-
for (const p of
|
|
1483
|
-
|
|
1547
|
+
for (const p of c.values()) p.destroy();
|
|
1548
|
+
c.clear();
|
|
1484
1549
|
};
|
|
1485
1550
|
}, []);
|
|
1486
|
-
const
|
|
1551
|
+
const u = U((c) => {
|
|
1487
1552
|
var p;
|
|
1488
|
-
(p =
|
|
1553
|
+
(p = s.current.get(c)) == null || p.fetchNextPage();
|
|
1489
1554
|
}, []);
|
|
1490
|
-
return { results:
|
|
1555
|
+
return { results: r, fetchNextPage: u };
|
|
1491
1556
|
}
|
|
1492
|
-
const
|
|
1557
|
+
const Xi = [], Ji = () => {
|
|
1493
1558
|
};
|
|
1494
|
-
function
|
|
1495
|
-
var
|
|
1559
|
+
function oc(e) {
|
|
1560
|
+
var Te, Ge;
|
|
1496
1561
|
const {
|
|
1497
1562
|
courseId: t,
|
|
1498
1563
|
adapter: n,
|
|
1499
1564
|
view: o,
|
|
1500
|
-
itemsMode:
|
|
1501
|
-
inlineThreshold:
|
|
1502
|
-
pageSize:
|
|
1503
|
-
itemPageSize: a =
|
|
1504
|
-
itemConcurrency:
|
|
1505
|
-
retainCollapsedLimit:
|
|
1506
|
-
staleTime:
|
|
1565
|
+
itemsMode: s = "auto",
|
|
1566
|
+
inlineThreshold: r = Fn,
|
|
1567
|
+
pageSize: i = St,
|
|
1568
|
+
itemPageSize: a = qn,
|
|
1569
|
+
itemConcurrency: d = Yi,
|
|
1570
|
+
retainCollapsedLimit: u = Un,
|
|
1571
|
+
staleTime: c = tt,
|
|
1507
1572
|
initialExpandedModuleIds: p,
|
|
1508
|
-
initialFilter: f =
|
|
1509
|
-
} = e, y =
|
|
1510
|
-
() =>
|
|
1573
|
+
initialFilter: f = X
|
|
1574
|
+
} = e, y = ht(), g = Re(), [b, w] = V(f), x = N(
|
|
1575
|
+
() => qi(g.filters, n.capabilities),
|
|
1511
1576
|
[g.filters, n.capabilities]
|
|
1512
|
-
),
|
|
1577
|
+
), _ = he(x, b), A = yt(_), q = Ki({
|
|
1513
1578
|
courseId: t,
|
|
1514
1579
|
adapter: n,
|
|
1515
|
-
mode:
|
|
1516
|
-
inlineThreshold:
|
|
1517
|
-
pageSize:
|
|
1518
|
-
filter:
|
|
1580
|
+
mode: s,
|
|
1581
|
+
inlineThreshold: r,
|
|
1582
|
+
pageSize: i,
|
|
1583
|
+
filter: A,
|
|
1519
1584
|
view: o,
|
|
1520
|
-
staleTime:
|
|
1521
|
-
}),
|
|
1585
|
+
staleTime: c
|
|
1586
|
+
}), B = q.resolvedMode, L = Wi({
|
|
1522
1587
|
courseId: t,
|
|
1523
1588
|
adapter: n,
|
|
1524
|
-
pageSize:
|
|
1525
|
-
filter:
|
|
1589
|
+
pageSize: i,
|
|
1590
|
+
filter: A,
|
|
1526
1591
|
view: o,
|
|
1527
|
-
staleTime:
|
|
1528
|
-
includeItems:
|
|
1529
|
-
inlineItemsFirst: (
|
|
1530
|
-
inlineFirst: (
|
|
1531
|
-
enabled:
|
|
1532
|
-
}), [k,
|
|
1592
|
+
staleTime: c,
|
|
1593
|
+
includeItems: B === "inline",
|
|
1594
|
+
inlineItemsFirst: (Te = q.inlineShape) == null ? void 0 : Te.maxItemCount,
|
|
1595
|
+
inlineFirst: (Ge = q.inlineShape) == null ? void 0 : Ge.moduleCount,
|
|
1596
|
+
enabled: B !== null
|
|
1597
|
+
}), [k, G] = V(
|
|
1533
1598
|
() => p ?? []
|
|
1534
|
-
),
|
|
1535
|
-
|
|
1536
|
-
!
|
|
1537
|
-
const
|
|
1538
|
-
for (const
|
|
1539
|
-
|
|
1540
|
-
return
|
|
1599
|
+
), J = p === void 0, F = $(!1), D = b !== X && _ !== void 0;
|
|
1600
|
+
Z(() => {
|
|
1601
|
+
!J || F.current || D || L.isPlaceholderData || G((h) => {
|
|
1602
|
+
const M = new Set(h), I = [...h];
|
|
1603
|
+
for (const R of L.modules)
|
|
1604
|
+
R.collapsed === !1 && !M.has(R.id) && I.push(R.id);
|
|
1605
|
+
return I.length === h.length ? h : I;
|
|
1541
1606
|
});
|
|
1542
|
-
}, [
|
|
1543
|
-
const
|
|
1607
|
+
}, [L.modules, L.isPlaceholderData, J, D]);
|
|
1608
|
+
const Y = N(() => {
|
|
1544
1609
|
const h = /* @__PURE__ */ new Map();
|
|
1545
|
-
for (const
|
|
1610
|
+
for (const M of L.modules) h.set(M.id, M);
|
|
1546
1611
|
return h;
|
|
1547
|
-
}, [
|
|
1612
|
+
}, [L.modules]), se = N(
|
|
1548
1613
|
() => k.filter((h) => {
|
|
1549
|
-
const
|
|
1550
|
-
return
|
|
1614
|
+
const M = Y.get(h);
|
|
1615
|
+
return M !== void 0 && M.items === void 0;
|
|
1551
1616
|
}),
|
|
1552
|
-
[k,
|
|
1553
|
-
),
|
|
1554
|
-
(h,
|
|
1617
|
+
[k, Y]
|
|
1618
|
+
), De = N(() => new Set(se), [se]), Oe = N(() => bo(d), [d]), Me = U(
|
|
1619
|
+
(h, M) => Bn({
|
|
1555
1620
|
courseId: t,
|
|
1556
1621
|
moduleId: h,
|
|
1557
1622
|
adapter: n,
|
|
1558
1623
|
pageSize: a,
|
|
1559
1624
|
view: o,
|
|
1560
|
-
staleTime:
|
|
1561
|
-
enabled:
|
|
1562
|
-
limit:
|
|
1625
|
+
staleTime: c,
|
|
1626
|
+
enabled: M,
|
|
1627
|
+
limit: Oe
|
|
1563
1628
|
}),
|
|
1564
|
-
[t, n, a, o,
|
|
1565
|
-
),
|
|
1629
|
+
[t, n, a, o, c, Oe]
|
|
1630
|
+
), ee = Zi(se, Me, u), ye = ee.fetchNextPage, qe = $(/* @__PURE__ */ new Map()), re = U(
|
|
1566
1631
|
(h) => {
|
|
1567
|
-
let
|
|
1568
|
-
return
|
|
1632
|
+
let M = qe.current.get(h);
|
|
1633
|
+
return M || (M = () => ye(h), qe.current.set(h, M)), M;
|
|
1569
1634
|
},
|
|
1570
|
-
[
|
|
1571
|
-
),
|
|
1572
|
-
|
|
1573
|
-
(
|
|
1635
|
+
[ye]
|
|
1636
|
+
), ie = U((h) => {
|
|
1637
|
+
F.current = !0, G(
|
|
1638
|
+
(M) => M.includes(h) ? M : [...M, h]
|
|
1574
1639
|
);
|
|
1575
|
-
}, []),
|
|
1640
|
+
}, []), P = U(
|
|
1576
1641
|
(h) => {
|
|
1577
|
-
|
|
1642
|
+
F.current = !0, G((M) => M.filter((I) => I !== h)), y.cancelQueries({ queryKey: ut(t, h) });
|
|
1578
1643
|
},
|
|
1579
1644
|
[y, t]
|
|
1580
|
-
),
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
}, [
|
|
1586
|
-
oe.current = I;
|
|
1587
|
-
const B = z(null), We = U(
|
|
1645
|
+
), Fe = U((h) => {
|
|
1646
|
+
F.current = !0, G((M) => {
|
|
1647
|
+
const I = new Set(M), R = h.filter((O) => !I.has(O));
|
|
1648
|
+
return R.length === 0 ? M : [...M, ...R];
|
|
1649
|
+
});
|
|
1650
|
+
}, []), Ue = U(
|
|
1588
1651
|
(h) => {
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
const
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1652
|
+
F.current = !0;
|
|
1653
|
+
const M = new Set(h);
|
|
1654
|
+
G((I) => {
|
|
1655
|
+
const R = I.filter((O) => !M.has(O));
|
|
1656
|
+
return R.length === I.length ? I : R;
|
|
1657
|
+
});
|
|
1658
|
+
for (const I of M)
|
|
1659
|
+
y.cancelQueries({ queryKey: ut(t, I) });
|
|
1597
1660
|
},
|
|
1598
|
-
[
|
|
1599
|
-
),
|
|
1661
|
+
[y, t]
|
|
1662
|
+
), W = $(k);
|
|
1663
|
+
W.current = k;
|
|
1664
|
+
const Se = U(() => {
|
|
1665
|
+
F.current = !0;
|
|
1666
|
+
for (const h of W.current) P(h);
|
|
1667
|
+
}, [P]), le = $(b);
|
|
1668
|
+
le.current = b;
|
|
1669
|
+
const H = $(null), ze = U(
|
|
1600
1670
|
(h) => {
|
|
1601
|
-
|
|
1671
|
+
if (h === le.current) return;
|
|
1672
|
+
if (le.current = h, h !== X && he(x, h) !== void 0) {
|
|
1673
|
+
H.current === null && (H.current = W.current);
|
|
1674
|
+
const I = F.current;
|
|
1675
|
+
for (const R of W.current) P(R);
|
|
1676
|
+
F.current = I;
|
|
1677
|
+
} else H.current !== null && (G(H.current), W.current = H.current, H.current = null);
|
|
1678
|
+
w(h);
|
|
1602
1679
|
},
|
|
1603
|
-
[
|
|
1604
|
-
),
|
|
1680
|
+
[x, P]
|
|
1681
|
+
), ae = U(
|
|
1605
1682
|
(h) => {
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1683
|
+
W.current.includes(h) ? P(h) : ie(h);
|
|
1684
|
+
},
|
|
1685
|
+
[P, ie]
|
|
1686
|
+
), $e = ee.results, Be = $(/* @__PURE__ */ new Map()), _e = U(
|
|
1687
|
+
(h) => {
|
|
1688
|
+
var ue;
|
|
1689
|
+
const M = Y.get(h), I = $e.get(h), R = De.has(h), O = Be.current.get(h);
|
|
1690
|
+
if (O && O.items === (M == null ? void 0 : M.items) && O.result === I && O.active === R)
|
|
1691
|
+
return O.value;
|
|
1692
|
+
const ce = (Q) => (Be.current.set(h, { items: M == null ? void 0 : M.items, result: I, active: R, value: Q }), Q);
|
|
1693
|
+
if ((M == null ? void 0 : M.items) !== void 0)
|
|
1694
|
+
return ce({
|
|
1695
|
+
items: M.items,
|
|
1696
|
+
pageInfo: Ze,
|
|
1615
1697
|
hasNextPage: !1,
|
|
1616
|
-
fetchNextPage:
|
|
1698
|
+
fetchNextPage: Ji,
|
|
1617
1699
|
isLoading: !1,
|
|
1618
1700
|
isFetchingNextPage: !1,
|
|
1619
1701
|
error: null,
|
|
1620
1702
|
source: "inline"
|
|
1621
1703
|
});
|
|
1622
|
-
const
|
|
1623
|
-
return
|
|
1624
|
-
items:
|
|
1625
|
-
pageInfo:
|
|
1626
|
-
hasNextPage:
|
|
1627
|
-
fetchNextPage:
|
|
1628
|
-
isLoading:
|
|
1629
|
-
isFetchingNextPage: (
|
|
1630
|
-
error: (
|
|
1704
|
+
const K = (ue = I == null ? void 0 : I.data) == null ? void 0 : ue.pages, te = K ? K.flatMap((Q) => Q.items) : Xi, Ee = K && K.length > 0 ? K[K.length - 1].pageInfo : Ze;
|
|
1705
|
+
return ce({
|
|
1706
|
+
items: te,
|
|
1707
|
+
pageInfo: Ee,
|
|
1708
|
+
hasNextPage: Ee.hasNextPage,
|
|
1709
|
+
fetchNextPage: re(h),
|
|
1710
|
+
isLoading: I ? I.isLoading : R,
|
|
1711
|
+
isFetchingNextPage: (I == null ? void 0 : I.isFetchingNextPage) ?? !1,
|
|
1712
|
+
error: (I == null ? void 0 : I.error) ?? null,
|
|
1631
1713
|
source: "onDemand"
|
|
1632
1714
|
});
|
|
1633
1715
|
},
|
|
1634
|
-
[
|
|
1716
|
+
[Y, $e, re, De]
|
|
1635
1717
|
);
|
|
1636
1718
|
return {
|
|
1637
|
-
modules:
|
|
1638
|
-
pageInfo:
|
|
1639
|
-
hasNextPage:
|
|
1640
|
-
fetchNextPage:
|
|
1641
|
-
isLoading: (
|
|
1642
|
-
isRefreshing:
|
|
1643
|
-
isFetchingNextPage:
|
|
1644
|
-
error:
|
|
1645
|
-
itemsMode:
|
|
1646
|
-
getItems:
|
|
1647
|
-
expandModule:
|
|
1648
|
-
collapseModule:
|
|
1649
|
-
|
|
1650
|
-
|
|
1719
|
+
modules: L.modules,
|
|
1720
|
+
pageInfo: L.pageInfo,
|
|
1721
|
+
hasNextPage: L.hasNextPage,
|
|
1722
|
+
fetchNextPage: L.fetchNextPage,
|
|
1723
|
+
isLoading: (q.isResolving || L.isPending) && !L.isPlaceholderData,
|
|
1724
|
+
isRefreshing: L.isPlaceholderData,
|
|
1725
|
+
isFetchingNextPage: L.isFetchingNextPage,
|
|
1726
|
+
error: L.error ?? q.error,
|
|
1727
|
+
itemsMode: B,
|
|
1728
|
+
getItems: _e,
|
|
1729
|
+
expandModule: ie,
|
|
1730
|
+
collapseModule: P,
|
|
1731
|
+
expandModules: Fe,
|
|
1732
|
+
collapseModules: Ue,
|
|
1733
|
+
collapseAllModules: Se,
|
|
1734
|
+
toggleModule: ae,
|
|
1651
1735
|
expandedModuleIds: k,
|
|
1652
|
-
filter:
|
|
1653
|
-
setFilter:
|
|
1654
|
-
filterEntry:
|
|
1655
|
-
filterPredicate:
|
|
1656
|
-
filterResultsArePartial:
|
|
1736
|
+
filter: b,
|
|
1737
|
+
setFilter: ze,
|
|
1738
|
+
filterEntry: _,
|
|
1739
|
+
filterPredicate: mt(_) ? _ == null ? void 0 : _.predicate : void 0,
|
|
1740
|
+
filterResultsArePartial: b !== X && mt(_) && L.hasNextPage
|
|
1657
1741
|
};
|
|
1658
1742
|
}
|
|
1659
|
-
function
|
|
1660
|
-
const
|
|
1661
|
-
return
|
|
1662
|
-
}
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
return e.invalidateQueries({ queryKey: o });
|
|
1666
|
-
}
|
|
1667
|
-
function Ql(e, t) {
|
|
1668
|
-
return e.invalidateQueries({ queryKey: we.course(t) });
|
|
1669
|
-
}
|
|
1670
|
-
function ai({ value: e, onChange: t, describedBy: n }) {
|
|
1671
|
-
const { t: o } = W(), r = Ce(), s = q(() => it(r.filters), [r.filters]), l = Rt();
|
|
1672
|
-
return /* @__PURE__ */ S(E, { as: "div", margin: "medium 0 0 0", children: [
|
|
1673
|
-
/* @__PURE__ */ i(E, { as: "div", margin: "0 0 x-small 0", children: /* @__PURE__ */ i(v, { size: "medium", weight: "bold", id: l, children: o("filterGroupLabel") }) }),
|
|
1674
|
-
/* @__PURE__ */ i(
|
|
1675
|
-
_,
|
|
1743
|
+
function el({ value: e, onChange: t, describedBy: n }) {
|
|
1744
|
+
const { t: o } = j(), s = Re(), r = N(() => Je(s.filters), [s.filters]), i = st();
|
|
1745
|
+
return /* @__PURE__ */ C(T, { as: "div", margin: "medium 0 0 0", children: [
|
|
1746
|
+
/* @__PURE__ */ l(T, { as: "div", margin: "0 0 x-small 0", children: /* @__PURE__ */ l(v, { size: "medium", weight: "bold", id: i, children: o("filterGroupLabel") }) }),
|
|
1747
|
+
/* @__PURE__ */ l(
|
|
1748
|
+
E,
|
|
1676
1749
|
{
|
|
1677
1750
|
gap: "space4",
|
|
1678
1751
|
wrap: "wrap",
|
|
1679
1752
|
as: "div",
|
|
1680
1753
|
role: "group",
|
|
1681
|
-
"aria-labelledby":
|
|
1754
|
+
"aria-labelledby": i,
|
|
1682
1755
|
"data-testid": "filter-chips",
|
|
1683
|
-
children:
|
|
1684
|
-
const
|
|
1685
|
-
return /* @__PURE__ */
|
|
1686
|
-
|
|
1756
|
+
children: r.map((a) => {
|
|
1757
|
+
const d = a.key === e;
|
|
1758
|
+
return /* @__PURE__ */ l(E.Item, { children: /* @__PURE__ */ l(
|
|
1759
|
+
ve,
|
|
1687
1760
|
{
|
|
1688
1761
|
size: "medium",
|
|
1689
|
-
color:
|
|
1690
|
-
"aria-pressed":
|
|
1691
|
-
"aria-describedby": a.key !==
|
|
1762
|
+
color: d ? "primary" : "secondary",
|
|
1763
|
+
"aria-pressed": d,
|
|
1764
|
+
"aria-describedby": a.key !== X && mt(a) ? n : void 0,
|
|
1692
1765
|
onClick: () => t(a.key),
|
|
1693
1766
|
"data-testid": `filter-chip-${a.key}`,
|
|
1694
1767
|
themeOverride: { borderRadius: "0.5rem" },
|
|
@@ -1700,29 +1773,115 @@ function ai({ value: e, onChange: t, describedBy: n }) {
|
|
|
1700
1773
|
)
|
|
1701
1774
|
] });
|
|
1702
1775
|
}
|
|
1703
|
-
const
|
|
1704
|
-
|
|
1776
|
+
const tl = 20, nl = 4.5, jt = 7, ol = 5, sl = 20, Gn = "#000000", jn = "#FFFFFF", Yn = {
|
|
1777
|
+
primary: { semantic: "base", textKey: "baseTextColor", borderKey: "baseBorderColor" },
|
|
1778
|
+
info: { semantic: "info", textKey: "infoTextColor", borderKey: "infoBorderColor" },
|
|
1779
|
+
success: { semantic: "success", textKey: "successTextColor", borderKey: "successBorderColor" },
|
|
1780
|
+
warning: { semantic: "warning", textKey: "warningTextColor", borderKey: "warningBorderColor" }
|
|
1781
|
+
}, rl = {
|
|
1782
|
+
card: {
|
|
1783
|
+
primary: { fill: "#E8EAEC", stroke: "#8D959F", text: "#273540" },
|
|
1784
|
+
info: { fill: "#D5E4F2", stroke: "#2B7ABC", text: "#23649A" },
|
|
1785
|
+
success: { fill: "#CDE7D8", stroke: "#03893D", text: "#02642C" },
|
|
1786
|
+
warning: { fill: "#F5DBCC", stroke: "#CF4A00", text: "#A13900" }
|
|
1787
|
+
},
|
|
1788
|
+
row: {
|
|
1789
|
+
primary: { fill: "#DEE1E4", stroke: "#8D959F", text: "#273540" },
|
|
1790
|
+
info: { fill: "#CADCEA", stroke: "#2B7ABC", text: "#1E5685" },
|
|
1791
|
+
success: { fill: "#C2DFD0", stroke: "#03893D", text: "#02642C" },
|
|
1792
|
+
warning: { fill: "#EBD2C4", stroke: "#CF4A00", text: "#A13900" }
|
|
1793
|
+
}
|
|
1794
|
+
};
|
|
1795
|
+
function il(e, t) {
|
|
1796
|
+
const n = To(
|
|
1797
|
+
at(e),
|
|
1798
|
+
at(Eo(t, tl))
|
|
1799
|
+
);
|
|
1800
|
+
return gn(n);
|
|
1801
|
+
}
|
|
1802
|
+
function ll(e, t, n) {
|
|
1803
|
+
const o = oe(n, t) >= jt ? jt : nl;
|
|
1804
|
+
return Math.min(o, Math.max(oe(e, Gn), oe(e, jn)));
|
|
1805
|
+
}
|
|
1806
|
+
function al(e, t, n) {
|
|
1807
|
+
const o = ll(e, t, n);
|
|
1808
|
+
if (oe(e, t) >= o) return t;
|
|
1809
|
+
const s = oe(e, Gn) > oe(e, jn) ? Co : wo;
|
|
1810
|
+
let r = t;
|
|
1811
|
+
for (let i = 0; i < sl && oe(e, r) < o; i++)
|
|
1812
|
+
r = s(r, ol);
|
|
1813
|
+
return gn(r);
|
|
1814
|
+
}
|
|
1815
|
+
function cl(e) {
|
|
1816
|
+
return lt(e) && at(e).a === 1;
|
|
1817
|
+
}
|
|
1818
|
+
function Yt(e, t) {
|
|
1819
|
+
var n;
|
|
1820
|
+
return t === "card" ? (n = e == null ? void 0 : e.elevatedSurface) == null ? void 0 : n.base : e == null ? void 0 : e.muted;
|
|
1821
|
+
}
|
|
1822
|
+
function Wt(e, t, n, o) {
|
|
1823
|
+
var i, a, d, u;
|
|
1824
|
+
const s = rl[n][e], r = t;
|
|
1825
|
+
try {
|
|
1826
|
+
const c = r == null ? void 0 : r.newTheme, p = (i = c == null ? void 0 : c.semantics) == null ? void 0 : i.call(c, c.primitives);
|
|
1827
|
+
if (!p) return s;
|
|
1828
|
+
const { semantic: f } = Yn[e], y = Yt((u = (d = (a = r == null ? void 0 : r.themeOverride) == null ? void 0 : a.semantics) == null ? void 0 : d.color) == null ? void 0 : u.background, n) ?? Yt(p.color.background, n) ?? "", g = o.stroke ?? p.color.stroke[f], b = o.label ?? p.color.text[f];
|
|
1829
|
+
if (!cl(y) || !lt(g) || !lt(b)) return s;
|
|
1830
|
+
const w = il(y, g);
|
|
1831
|
+
return { fill: w, stroke: g, text: al(w, b, y) };
|
|
1832
|
+
} catch {
|
|
1833
|
+
return s;
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
const Ht = /* @__PURE__ */ new WeakMap();
|
|
1837
|
+
function ul(e, t, n, o = {}) {
|
|
1838
|
+
if (typeof t != "object" || t === null)
|
|
1839
|
+
return Wt(e, t, n, o);
|
|
1840
|
+
let s = Ht.get(t);
|
|
1841
|
+
s === void 0 && (s = /* @__PURE__ */ new Map(), Ht.set(t, s));
|
|
1842
|
+
const r = `${n}:${e}:${o.stroke ?? ""}:${o.label ?? ""}`, i = s.get(r);
|
|
1843
|
+
if (i !== void 0) return i;
|
|
1844
|
+
const a = Wt(e, t, n, o);
|
|
1845
|
+
return s.set(r, a), a;
|
|
1846
|
+
}
|
|
1847
|
+
function Ke(e, t) {
|
|
1848
|
+
const { textKey: n, borderKey: o } = Yn[e];
|
|
1849
|
+
return (s, r) => {
|
|
1850
|
+
const i = s, { fill: a, stroke: d, text: u } = ul(e, r, t, {
|
|
1851
|
+
stroke: i == null ? void 0 : i[o],
|
|
1852
|
+
label: i == null ? void 0 : i[n]
|
|
1853
|
+
});
|
|
1854
|
+
return { backgroundColor: a, [n]: u, [o]: d };
|
|
1855
|
+
};
|
|
1856
|
+
}
|
|
1857
|
+
function Kt(e) {
|
|
1705
1858
|
return {
|
|
1706
|
-
|
|
1707
|
-
|
|
1859
|
+
primary: Ke("primary", e),
|
|
1860
|
+
info: Ke("info", e),
|
|
1861
|
+
success: Ke("success", e),
|
|
1862
|
+
warning: Ke("warning", e)
|
|
1708
1863
|
};
|
|
1709
|
-
}
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1864
|
+
}
|
|
1865
|
+
const dl = {
|
|
1866
|
+
card: Kt("card"),
|
|
1867
|
+
row: Kt("row")
|
|
1868
|
+
}, ml = {
|
|
1869
|
+
not_started: { tone: "primary", icon: /* @__PURE__ */ l(cn, { size: "sm" }) },
|
|
1870
|
+
in_progress: { tone: "info", icon: /* @__PURE__ */ l(an, { size: "sm" }) },
|
|
1871
|
+
complete: { tone: "success", icon: /* @__PURE__ */ l(ln, { size: "sm" }) },
|
|
1872
|
+
missing: { tone: "warning", icon: /* @__PURE__ */ l(Pe, { size: "sm" }) },
|
|
1873
|
+
incomplete: { tone: "warning", icon: /* @__PURE__ */ l(Pe, { size: "sm" }) },
|
|
1874
|
+
missing_and_incomplete: { tone: "warning", icon: /* @__PURE__ */ l(Pe, { size: "sm" }) },
|
|
1875
|
+
locked: { tone: "primary", icon: /* @__PURE__ */ l(rn, { size: "sm" }) }
|
|
1876
|
+
}, pl = {
|
|
1877
|
+
not_started: { tone: "primary", icon: /* @__PURE__ */ l(cn, { size: "sm" }) },
|
|
1878
|
+
in_progress: { tone: "info", icon: /* @__PURE__ */ l(an, { size: "sm" }) },
|
|
1879
|
+
complete: { tone: "success", icon: /* @__PURE__ */ l(ln, { size: "sm" }) },
|
|
1880
|
+
incomplete: { tone: "warning", icon: /* @__PURE__ */ l(Pe, { size: "sm" }) },
|
|
1881
|
+
missing: { tone: "warning", icon: /* @__PURE__ */ l(Pe, { size: "sm" }) },
|
|
1882
|
+
locked: { tone: "primary", icon: /* @__PURE__ */ l(rn, { size: "sm" }) }
|
|
1724
1883
|
};
|
|
1725
|
-
function
|
|
1884
|
+
function Wn(e, t, n, o) {
|
|
1726
1885
|
switch (t) {
|
|
1727
1886
|
case "not_started":
|
|
1728
1887
|
return e("moduleStatusNotStarted");
|
|
@@ -1743,7 +1902,7 @@ function pi(e, t, n, o) {
|
|
|
1743
1902
|
return e("moduleStatusLocked");
|
|
1744
1903
|
}
|
|
1745
1904
|
}
|
|
1746
|
-
function
|
|
1905
|
+
function fl(e, t) {
|
|
1747
1906
|
switch (t) {
|
|
1748
1907
|
case "not_started":
|
|
1749
1908
|
return e("itemStatusNotStarted");
|
|
@@ -1759,84 +1918,86 @@ function fi(e, t) {
|
|
|
1759
1918
|
return e("itemStatusLocked");
|
|
1760
1919
|
}
|
|
1761
1920
|
}
|
|
1762
|
-
function
|
|
1763
|
-
return /* @__PURE__ */
|
|
1764
|
-
|
|
1921
|
+
function Hn(e, t, n, o) {
|
|
1922
|
+
return /* @__PURE__ */ l(
|
|
1923
|
+
Po,
|
|
1765
1924
|
{
|
|
1766
|
-
color: e.
|
|
1925
|
+
color: e.tone,
|
|
1767
1926
|
renderIcon: e.icon,
|
|
1768
|
-
themeOverride: e.
|
|
1927
|
+
themeOverride: dl[o][e.tone],
|
|
1769
1928
|
"data-testid": n,
|
|
1770
1929
|
children: t
|
|
1771
1930
|
}
|
|
1772
1931
|
);
|
|
1773
1932
|
}
|
|
1774
|
-
function
|
|
1933
|
+
function gl({
|
|
1775
1934
|
status: e,
|
|
1776
1935
|
missingCount: t,
|
|
1777
1936
|
incompleteCount: n
|
|
1778
1937
|
}) {
|
|
1779
|
-
const { t: o } =
|
|
1780
|
-
return
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
"module-status-pill"
|
|
1938
|
+
const { t: o } = j();
|
|
1939
|
+
return Hn(
|
|
1940
|
+
ml[e],
|
|
1941
|
+
Wn(o, e, t, n),
|
|
1942
|
+
"module-status-pill",
|
|
1943
|
+
"card"
|
|
1784
1944
|
);
|
|
1785
1945
|
}
|
|
1786
|
-
function
|
|
1787
|
-
const { t } =
|
|
1788
|
-
return
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
"item-status-pill"
|
|
1946
|
+
function hl({ status: e }) {
|
|
1947
|
+
const { t } = j();
|
|
1948
|
+
return Hn(
|
|
1949
|
+
pl[e],
|
|
1950
|
+
fl(t, e),
|
|
1951
|
+
"item-status-pill",
|
|
1952
|
+
"row"
|
|
1792
1953
|
);
|
|
1793
1954
|
}
|
|
1794
|
-
const
|
|
1955
|
+
const Kn = 2.75, ot = `${Kn}rem`, Il = { lineHeight: 0, display: "block" }, bl = {
|
|
1795
1956
|
display: "inline-block",
|
|
1796
1957
|
paddingLeft: "0.5rem",
|
|
1797
1958
|
marginLeft: "0.5rem"
|
|
1798
|
-
},
|
|
1799
|
-
function
|
|
1800
|
-
return e == null || typeof e == "boolean" || e === "" ? !0 : Array.isArray(e) ? e.every(
|
|
1959
|
+
}, Ml = "#D7DADE", yl = "#6A7883", Qn = { fontSize: 0 };
|
|
1960
|
+
function pt(e) {
|
|
1961
|
+
return e == null || typeof e == "boolean" || e === "" ? !0 : Array.isArray(e) ? e.every(pt) : nn(e) && e.type === sn ? pt(e.props.children) : !1;
|
|
1801
1962
|
}
|
|
1802
|
-
const
|
|
1963
|
+
const Sl = {
|
|
1803
1964
|
contentVisibility: "auto",
|
|
1804
1965
|
containIntrinsicSize: "auto 4.25rem"
|
|
1805
|
-
},
|
|
1806
|
-
function
|
|
1807
|
-
const e =
|
|
1966
|
+
}, _l = "0.5rem";
|
|
1967
|
+
function Tl() {
|
|
1968
|
+
const e = fn();
|
|
1808
1969
|
return "key" in e && e.key === "canvas-high-contrast" ? "inline" : "standalone";
|
|
1809
1970
|
}
|
|
1810
|
-
function
|
|
1811
|
-
var o,
|
|
1812
|
-
const n =
|
|
1813
|
-
return ("colors" in n ? (
|
|
1814
|
-
}
|
|
1815
|
-
function
|
|
1816
|
-
const e =
|
|
1817
|
-
return
|
|
1818
|
-
() => ({ ...
|
|
1971
|
+
function Vn(e, t) {
|
|
1972
|
+
var o, s;
|
|
1973
|
+
const n = fn();
|
|
1974
|
+
return ("colors" in n ? (s = (o = n.colors) == null ? void 0 : o.contrasts) == null ? void 0 : s[e] : void 0) ?? t;
|
|
1975
|
+
}
|
|
1976
|
+
function Zn() {
|
|
1977
|
+
const e = Vn("grey1424", Ml);
|
|
1978
|
+
return N(
|
|
1979
|
+
() => ({ ...bl, borderLeft: `1px solid ${e}` }),
|
|
1819
1980
|
[e]
|
|
1820
1981
|
);
|
|
1821
1982
|
}
|
|
1822
|
-
function
|
|
1983
|
+
function El({
|
|
1823
1984
|
item: e,
|
|
1824
1985
|
today: t,
|
|
1825
1986
|
navigation: n,
|
|
1826
1987
|
attachedAbove: o,
|
|
1827
|
-
attachedBelow:
|
|
1988
|
+
attachedBelow: s
|
|
1828
1989
|
}) {
|
|
1829
|
-
var
|
|
1830
|
-
const { t:
|
|
1990
|
+
var F;
|
|
1991
|
+
const { t: r, locale: i, timezone: a } = j(), d = Tl(), u = Vn("grey4570", yl), c = Zn(), p = Ne(), f = Re(), y = N(() => Je(f.itemMeta), [f.itemMeta]), g = e.title || r("itemUntitled");
|
|
1831
1992
|
if (e.type === "sub_header")
|
|
1832
|
-
return /* @__PURE__ */
|
|
1833
|
-
|
|
1993
|
+
return /* @__PURE__ */ l(
|
|
1994
|
+
T,
|
|
1834
1995
|
{
|
|
1835
1996
|
as: "div",
|
|
1836
1997
|
padding: "x-small small",
|
|
1837
1998
|
margin: "x-small 0 0 0",
|
|
1838
1999
|
"data-testid": `module-item-${e.id}`,
|
|
1839
|
-
children: /* @__PURE__ */
|
|
2000
|
+
children: /* @__PURE__ */ l(
|
|
1840
2001
|
v,
|
|
1841
2002
|
{
|
|
1842
2003
|
size: "small",
|
|
@@ -1850,57 +2011,57 @@ function Ei({
|
|
|
1850
2011
|
)
|
|
1851
2012
|
}
|
|
1852
2013
|
);
|
|
1853
|
-
const
|
|
1854
|
-
return /* @__PURE__ */
|
|
1855
|
-
|
|
2014
|
+
const b = ((F = n == null ? void 0 : n.getItemHref) == null ? void 0 : F.call(n, e)) ?? e.url ?? null, w = e.status === "locked", x = n == null ? void 0 : n.onItemClick, _ = x ? (D) => x(e, D) : void 0, A = he(f.itemTypes, e.type), q = A != null && A.renderIcon ? A.renderIcon({ item: e }) : A == null ? void 0 : A.icon, B = { item: e, t: r, today: t, locale: i, timezone: a, formatters: p, config: f }, L = y.map((D) => ({ key: D.key, node: D.render(B) })).filter((D) => !pt(D.node)), k = L.some((D) => D.key === ki), G = o ? "none" : "large", J = s ? "none" : "large";
|
|
2015
|
+
return /* @__PURE__ */ l("div", { style: { ...Sl, marginTop: o ? void 0 : _l }, children: /* @__PURE__ */ l(
|
|
2016
|
+
T,
|
|
1856
2017
|
{
|
|
1857
2018
|
as: "div",
|
|
1858
2019
|
background: "secondary",
|
|
1859
|
-
borderRadius: `${
|
|
2020
|
+
borderRadius: `${G} ${G} ${J} ${J}`,
|
|
1860
2021
|
padding: "small",
|
|
1861
2022
|
"data-testid": `module-item-${e.id}`,
|
|
1862
|
-
children: /* @__PURE__ */
|
|
1863
|
-
/* @__PURE__ */
|
|
1864
|
-
e.indent > 0 ? /* @__PURE__ */
|
|
1865
|
-
/* @__PURE__ */
|
|
1866
|
-
|
|
2023
|
+
children: /* @__PURE__ */ l("div", { style: { paddingInlineStart: `${Math.max(e.indent - 1, 0) * Kn}rem` }, children: /* @__PURE__ */ C(E, { alignItems: "center", gap: "mediumSmall", children: [
|
|
2024
|
+
/* @__PURE__ */ l(E.Item, { children: /* @__PURE__ */ C(E, { alignItems: "center", children: [
|
|
2025
|
+
e.indent > 0 ? /* @__PURE__ */ l(E.Item, { size: ot, textAlign: "center", "data-testid": "item-nest-arrow", children: /* @__PURE__ */ l("span", { style: { color: u }, children: /* @__PURE__ */ l(po, { size: "md", color: "inherit" }) }) }) : null,
|
|
2026
|
+
/* @__PURE__ */ l(E.Item, { children: /* @__PURE__ */ l(
|
|
2027
|
+
T,
|
|
1867
2028
|
{
|
|
1868
2029
|
as: "div",
|
|
1869
2030
|
background: "primary",
|
|
1870
2031
|
borderWidth: "small",
|
|
1871
2032
|
borderRadius: "large",
|
|
1872
|
-
width:
|
|
1873
|
-
height:
|
|
1874
|
-
children: /* @__PURE__ */
|
|
1875
|
-
/* @__PURE__ */
|
|
1876
|
-
|
|
2033
|
+
width: ot,
|
|
2034
|
+
height: ot,
|
|
2035
|
+
children: /* @__PURE__ */ l(E, { height: "100%", alignItems: "center", justifyItems: "center", children: /* @__PURE__ */ C(E.Item, { children: [
|
|
2036
|
+
/* @__PURE__ */ l("span", { style: Il, "data-testid": "item-type-icon", children: q }),
|
|
2037
|
+
A && !k ? /* @__PURE__ */ l(it, { children: r(A.label) }) : null
|
|
1877
2038
|
] }) })
|
|
1878
2039
|
}
|
|
1879
2040
|
) })
|
|
1880
2041
|
] }) }),
|
|
1881
|
-
/* @__PURE__ */
|
|
1882
|
-
/* @__PURE__ */
|
|
2042
|
+
/* @__PURE__ */ C(E.Item, { shouldGrow: !0, shouldShrink: !0, children: [
|
|
2043
|
+
/* @__PURE__ */ l(T, { as: "div", children: w || !b ? /* @__PURE__ */ l(
|
|
1883
2044
|
v,
|
|
1884
2045
|
{
|
|
1885
2046
|
weight: "bold",
|
|
1886
2047
|
size: "medium",
|
|
1887
2048
|
lineHeight: "condensed",
|
|
1888
|
-
color:
|
|
2049
|
+
color: w ? "secondary" : "primary",
|
|
1889
2050
|
"data-testid": "module-item-title",
|
|
1890
|
-
"data-locked":
|
|
2051
|
+
"data-locked": w ? "true" : void 0,
|
|
1891
2052
|
children: g
|
|
1892
2053
|
}
|
|
1893
|
-
) : /* @__PURE__ */
|
|
1894
|
-
|
|
2054
|
+
) : /* @__PURE__ */ C(
|
|
2055
|
+
_o,
|
|
1895
2056
|
{
|
|
1896
|
-
href:
|
|
1897
|
-
onClick:
|
|
2057
|
+
href: b,
|
|
2058
|
+
onClick: _,
|
|
1898
2059
|
forceButtonRole: !1,
|
|
1899
|
-
variant:
|
|
2060
|
+
variant: d,
|
|
1900
2061
|
target: e.newTab ? "_blank" : void 0,
|
|
1901
2062
|
rel: e.newTab ? "noopener noreferrer" : void 0,
|
|
1902
2063
|
children: [
|
|
1903
|
-
/* @__PURE__ */
|
|
2064
|
+
/* @__PURE__ */ l(
|
|
1904
2065
|
v,
|
|
1905
2066
|
{
|
|
1906
2067
|
weight: "bold",
|
|
@@ -1911,148 +2072,148 @@ function Ei({
|
|
|
1911
2072
|
children: g
|
|
1912
2073
|
}
|
|
1913
2074
|
),
|
|
1914
|
-
e.newTab ? /* @__PURE__ */
|
|
2075
|
+
e.newTab ? /* @__PURE__ */ l(it, { children: ` ${r("opensInNewWindow")}` }) : null
|
|
1915
2076
|
]
|
|
1916
2077
|
}
|
|
1917
2078
|
) }),
|
|
1918
|
-
/* @__PURE__ */
|
|
1919
|
-
|
|
1920
|
-
/* @__PURE__ */
|
|
1921
|
-
] },
|
|
2079
|
+
/* @__PURE__ */ l(T, { as: "div", children: /* @__PURE__ */ l(v, { size: "x-small", color: "secondary", "data-testid": "module-item-meta", children: L.map((D, Y) => /* @__PURE__ */ C(sn, { children: [
|
|
2080
|
+
Y > 0 ? /* @__PURE__ */ l("span", { style: Qn, children: " " }) : null,
|
|
2081
|
+
/* @__PURE__ */ l("span", { style: Y > 0 ? c : void 0, children: D.node })
|
|
2082
|
+
] }, D.key)) }) })
|
|
1922
2083
|
] }),
|
|
1923
|
-
e.status ? /* @__PURE__ */
|
|
2084
|
+
e.status ? /* @__PURE__ */ l(E.Item, { children: /* @__PURE__ */ l(hl, { status: e.status }) }) : null
|
|
1924
2085
|
] }) })
|
|
1925
2086
|
}
|
|
1926
2087
|
) });
|
|
1927
2088
|
}
|
|
1928
|
-
const
|
|
1929
|
-
function
|
|
1930
|
-
const { t } =
|
|
1931
|
-
if (e.length === 1) return /* @__PURE__ */
|
|
2089
|
+
const Cl = on(El), Qt = "\0", wl = { textDecoration: "underline dotted", cursor: "help" };
|
|
2090
|
+
function Pl({ names: e }) {
|
|
2091
|
+
const { t } = j();
|
|
2092
|
+
if (e.length === 1) return /* @__PURE__ */ l(vt, { children: t("lockedByPrerequisiteByline", { name: e[0] }) });
|
|
1932
2093
|
const n = t("lockedByPrerequisitesByline", {
|
|
1933
2094
|
count: e.length,
|
|
1934
|
-
prerequisites:
|
|
1935
|
-
}), [o, ...
|
|
1936
|
-
return /* @__PURE__ */
|
|
1937
|
-
|
|
1938
|
-
/* @__PURE__ */
|
|
2095
|
+
prerequisites: Qt
|
|
2096
|
+
}), [o, ...s] = n.split(Qt), r = s.length > 0 ? s.join("") : null;
|
|
2097
|
+
return /* @__PURE__ */ C(vt, { children: [
|
|
2098
|
+
r === null ? null : o,
|
|
2099
|
+
/* @__PURE__ */ l(pn, { renderTip: e.join(", "), children: /* @__PURE__ */ l(
|
|
1939
2100
|
"span",
|
|
1940
2101
|
{
|
|
1941
2102
|
tabIndex: 0,
|
|
1942
|
-
style:
|
|
1943
|
-
onClick: (
|
|
2103
|
+
style: wl,
|
|
2104
|
+
onClick: (i) => i.stopPropagation(),
|
|
1944
2105
|
"data-testid": "module-byline-prerequisites",
|
|
1945
|
-
children:
|
|
2106
|
+
children: r === null ? n : t("lockedByPrerequisitesCount", { count: e.length })
|
|
1946
2107
|
}
|
|
1947
2108
|
) }),
|
|
1948
|
-
|
|
2109
|
+
r
|
|
1949
2110
|
] });
|
|
1950
2111
|
}
|
|
1951
|
-
function
|
|
1952
|
-
var
|
|
1953
|
-
const n =
|
|
1954
|
-
let
|
|
1955
|
-
|
|
1956
|
-
const
|
|
1957
|
-
return
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
2112
|
+
function vl({ module: e, today: t }) {
|
|
2113
|
+
var c;
|
|
2114
|
+
const n = Ne(), o = Zn(), s = ((c = e.progress) == null ? void 0 : c.status) === "locked", r = e.unlockAt ?? null, i = e.prerequisiteModules.map((p) => p.name.trim()).filter((p) => p !== ""), a = r !== null && new Date(r) > t;
|
|
2115
|
+
let d = null;
|
|
2116
|
+
r !== null && a && (s || !e.progress) ? d = n.unlockByline(r, t) : r !== null && !a && !e.progress && (d = n.unlockedByline(r, t));
|
|
2117
|
+
const u = s && i.length > 0;
|
|
2118
|
+
return d === null && !u ? null : /* @__PURE__ */ l(T, { as: "div", margin: "xxx-small 0 0 0", children: /* @__PURE__ */ C(v, { size: "small", color: "secondary", "data-testid": "module-byline", children: [
|
|
2119
|
+
d,
|
|
2120
|
+
d !== null && u ? /* @__PURE__ */ l("span", { style: Qn, children: " " }) : null,
|
|
2121
|
+
u ? /* @__PURE__ */ l("span", { style: d !== null ? o : void 0, children: /* @__PURE__ */ l(Pl, { names: i }) }) : null
|
|
1961
2122
|
] }) });
|
|
1962
2123
|
}
|
|
1963
|
-
const
|
|
1964
|
-
var n, o,
|
|
2124
|
+
const Al = "#273540", xl = "#D7DADE", Ll = "0.5rem", Rl = (e, t) => {
|
|
2125
|
+
var n, o, s, r, i;
|
|
1965
2126
|
return {
|
|
1966
|
-
meterColorBrand: ((o = (n = t.colors) == null ? void 0 : n.contrasts) == null ? void 0 : o.grey125125) ??
|
|
1967
|
-
borderRadius: String(((
|
|
1968
|
-
borderColor: ((
|
|
2127
|
+
meterColorBrand: ((o = (n = t.colors) == null ? void 0 : n.contrasts) == null ? void 0 : o.grey125125) ?? Al,
|
|
2128
|
+
borderRadius: String(((s = t.borders) == null ? void 0 : s.radiusLarge) ?? Ll),
|
|
2129
|
+
borderColor: ((i = (r = t.colors) == null ? void 0 : r.contrasts) == null ? void 0 : i.grey1424) ?? xl,
|
|
1969
2130
|
trackBottomBorderColor: "transparent"
|
|
1970
2131
|
};
|
|
1971
|
-
},
|
|
1972
|
-
function
|
|
2132
|
+
}, kl = "66.667%", Nl = "8rem", Dl = 2;
|
|
2133
|
+
function Ol({
|
|
1973
2134
|
module: e,
|
|
1974
2135
|
breakpoints: t
|
|
1975
2136
|
}) {
|
|
1976
|
-
const { t: n } =
|
|
1977
|
-
if (!
|
|
1978
|
-
const
|
|
1979
|
-
return /* @__PURE__ */
|
|
1980
|
-
|
|
2137
|
+
const { t: n } = j(), o = Ne(), s = e.progress;
|
|
2138
|
+
if (!s || s.status === "locked" || s.requirementCount <= 0) return null;
|
|
2139
|
+
const r = t.mobileOnly, i = Object.keys(t).length === 0 || t.desktop === !0;
|
|
2140
|
+
return /* @__PURE__ */ C(
|
|
2141
|
+
E,
|
|
1981
2142
|
{
|
|
1982
|
-
width:
|
|
1983
|
-
direction:
|
|
1984
|
-
alignItems:
|
|
2143
|
+
width: i ? kl : "100%",
|
|
2144
|
+
direction: r ? "column" : "row",
|
|
2145
|
+
alignItems: r ? "stretch" : "center",
|
|
1985
2146
|
wrap: "wrap",
|
|
1986
2147
|
gap: "x-small",
|
|
1987
2148
|
margin: "small 0 0 0",
|
|
1988
2149
|
"data-testid": "module-progress",
|
|
1989
2150
|
children: [
|
|
1990
|
-
/* @__PURE__ */
|
|
1991
|
-
|
|
2151
|
+
/* @__PURE__ */ l(E.Item, { size: r ? void 0 : Nl, shouldGrow: !0, children: /* @__PURE__ */ l(
|
|
2152
|
+
So,
|
|
1992
2153
|
{
|
|
1993
2154
|
size: "x-small",
|
|
1994
2155
|
meterColor: "brand",
|
|
1995
|
-
valueNow:
|
|
1996
|
-
valueMax:
|
|
2156
|
+
valueNow: s.requirementsMet,
|
|
2157
|
+
valueMax: s.requirementCount,
|
|
1997
2158
|
shouldAnimate: !1,
|
|
1998
2159
|
screenReaderLabel: n("moduleProgressScreenReaderLabel", { name: e.name }),
|
|
1999
|
-
formatScreenReaderValue: () =>
|
|
2160
|
+
formatScreenReaderValue: () => Ai(
|
|
2000
2161
|
n,
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2162
|
+
s.percentComplete,
|
|
2163
|
+
s.requirementsMet,
|
|
2164
|
+
s.requirementCount
|
|
2004
2165
|
),
|
|
2005
|
-
themeOverride:
|
|
2166
|
+
themeOverride: Rl
|
|
2006
2167
|
}
|
|
2007
2168
|
) }),
|
|
2008
|
-
/* @__PURE__ */
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2169
|
+
/* @__PURE__ */ l(E.Item, { shouldShrink: !0, "aria-hidden": "true", children: /* @__PURE__ */ l(v, { size: "small", color: "secondary", children: o.progress(
|
|
2170
|
+
s.percentComplete,
|
|
2171
|
+
s.requirementsMet,
|
|
2172
|
+
s.requirementCount
|
|
2012
2173
|
) }) })
|
|
2013
2174
|
]
|
|
2014
2175
|
}
|
|
2015
2176
|
);
|
|
2016
2177
|
}
|
|
2017
|
-
const
|
|
2018
|
-
function
|
|
2178
|
+
const Vt = (e) => `platform-modules-panel-${e}`;
|
|
2179
|
+
function ft(e) {
|
|
2019
2180
|
return e !== void 0 && e.type !== "sub_header";
|
|
2020
2181
|
}
|
|
2021
|
-
function
|
|
2022
|
-
return
|
|
2182
|
+
function Zt(e) {
|
|
2183
|
+
return ft(e) && e.indent > 0;
|
|
2023
2184
|
}
|
|
2024
|
-
function
|
|
2185
|
+
function ql({
|
|
2025
2186
|
module: e,
|
|
2026
2187
|
state: t,
|
|
2027
2188
|
today: n,
|
|
2028
2189
|
navigation: o,
|
|
2029
|
-
showDiagnostics:
|
|
2190
|
+
showDiagnostics: s
|
|
2030
2191
|
}) {
|
|
2031
|
-
const { t:
|
|
2032
|
-
return
|
|
2033
|
-
!
|
|
2034
|
-
|
|
2192
|
+
const { t: r } = j(), i = $(null), a = t.items.length, d = !t.isLoading && !t.isFetchingNextPage;
|
|
2193
|
+
return Z(() => {
|
|
2194
|
+
!d || a === 0 || i.current !== a && (i.current = a, pe(
|
|
2195
|
+
r("itemsLoadedAnnouncement", {
|
|
2035
2196
|
loaded: a,
|
|
2036
2197
|
count: e.itemCount,
|
|
2037
2198
|
name: e.name
|
|
2038
2199
|
})
|
|
2039
2200
|
));
|
|
2040
|
-
}, [
|
|
2041
|
-
|
|
2201
|
+
}, [d, a, e.itemCount, e.name, r]), t.error ? /* @__PURE__ */ l(T, { as: "div", margin: "small 0 0 0", children: /* @__PURE__ */ l(
|
|
2202
|
+
dn,
|
|
2042
2203
|
{
|
|
2043
2204
|
variant: "error",
|
|
2044
2205
|
margin: "0",
|
|
2045
|
-
liveRegion:
|
|
2206
|
+
liveRegion: un,
|
|
2046
2207
|
liveRegionPoliteness: "assertive",
|
|
2047
2208
|
"data-testid": "items-error",
|
|
2048
|
-
children:
|
|
2209
|
+
children: r("itemsLoadErrorAlert", { message: t.error.message })
|
|
2049
2210
|
}
|
|
2050
|
-
) }) : t.isLoading ? /* @__PURE__ */
|
|
2051
|
-
/* @__PURE__ */
|
|
2211
|
+
) }) : t.isLoading ? /* @__PURE__ */ C(T, { as: "div", margin: "small 0 0 0", "data-testid": "items-loading", children: [
|
|
2212
|
+
/* @__PURE__ */ l(rt, { size: "x-small", renderTitle: r("itemsLoadingSpinnerLabel") }),
|
|
2052
2213
|
" ",
|
|
2053
|
-
/* @__PURE__ */
|
|
2054
|
-
] }) : /* @__PURE__ */
|
|
2055
|
-
|
|
2214
|
+
/* @__PURE__ */ l(v, { size: "small", color: "secondary", children: r("itemsLoadingText") })
|
|
2215
|
+
] }) : /* @__PURE__ */ C(T, { as: "div", margin: "small 0 0 0", children: [
|
|
2216
|
+
s ? /* @__PURE__ */ C(v, { size: "x-small", color: "secondary", "data-testid": "items-source", children: [
|
|
2056
2217
|
"items source: ",
|
|
2057
2218
|
t.source,
|
|
2058
2219
|
" · loaded ",
|
|
@@ -2060,24 +2221,24 @@ function Oi({
|
|
|
2060
2221
|
" of ",
|
|
2061
2222
|
e.itemCount
|
|
2062
2223
|
] }) : null,
|
|
2063
|
-
t.items.length === 0 ? /* @__PURE__ */
|
|
2064
|
-
|
|
2224
|
+
t.items.length === 0 ? /* @__PURE__ */ l(T, { as: "div", padding: "small", "data-testid": "items-empty", children: /* @__PURE__ */ l(v, { size: "small", color: "secondary", children: r("noItemsEmptyState") }) }) : /* @__PURE__ */ l("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, "data-testid": "items-list", children: t.items.map((u, c) => /* @__PURE__ */ l("li", { children: /* @__PURE__ */ l(
|
|
2225
|
+
Cl,
|
|
2065
2226
|
{
|
|
2066
|
-
item:
|
|
2227
|
+
item: u,
|
|
2067
2228
|
today: n,
|
|
2068
2229
|
navigation: o,
|
|
2069
|
-
attachedAbove:
|
|
2070
|
-
attachedBelow:
|
|
2230
|
+
attachedAbove: Zt(u) && ft(t.items[c - 1]),
|
|
2231
|
+
attachedBelow: ft(u) && Zt(t.items[c + 1])
|
|
2071
2232
|
}
|
|
2072
|
-
) },
|
|
2073
|
-
t.hasNextPage ? /* @__PURE__ */
|
|
2074
|
-
|
|
2233
|
+
) }, u.id)) }),
|
|
2234
|
+
t.hasNextPage ? /* @__PURE__ */ l(T, { as: "div", margin: "small 0 0 0", textAlign: "center", children: /* @__PURE__ */ l(
|
|
2235
|
+
ve,
|
|
2075
2236
|
{
|
|
2076
2237
|
size: "small",
|
|
2077
2238
|
onClick: t.fetchNextPage,
|
|
2078
2239
|
interaction: t.isFetchingNextPage ? "disabled" : "enabled",
|
|
2079
2240
|
"data-testid": "load-more-items",
|
|
2080
|
-
children: t.isFetchingNextPage ?
|
|
2241
|
+
children: t.isFetchingNextPage ? r("loadMoreItemsLoading") : r("loadMoreItems", {
|
|
2081
2242
|
loaded: t.items.length,
|
|
2082
2243
|
count: e.itemCount
|
|
2083
2244
|
})
|
|
@@ -2085,32 +2246,32 @@ function Oi({
|
|
|
2085
2246
|
) }) : null
|
|
2086
2247
|
] });
|
|
2087
2248
|
}
|
|
2088
|
-
function
|
|
2249
|
+
function Fl({
|
|
2089
2250
|
module: e,
|
|
2090
2251
|
expanded: t,
|
|
2091
2252
|
onToggle: n,
|
|
2092
2253
|
itemsState: o,
|
|
2093
|
-
today:
|
|
2094
|
-
navigation:
|
|
2095
|
-
showDiagnostics:
|
|
2254
|
+
today: s,
|
|
2255
|
+
navigation: r,
|
|
2256
|
+
showDiagnostics: i = !1,
|
|
2096
2257
|
headingLevel: a = "h3",
|
|
2097
|
-
moduleLabel:
|
|
2098
|
-
breakpoints:
|
|
2258
|
+
moduleLabel: d,
|
|
2259
|
+
breakpoints: u = {}
|
|
2099
2260
|
}) {
|
|
2100
|
-
var
|
|
2101
|
-
const { t:
|
|
2102
|
-
var
|
|
2103
|
-
(
|
|
2104
|
-
},
|
|
2105
|
-
|
|
2261
|
+
var _, A;
|
|
2262
|
+
const { t: c } = j(), p = Ne(), f = ((_ = e.progress) == null ? void 0 : _.status) === "locked", y = d === void 0 ? p.moduleLabel(e.position, e) : d, g = (y == null ? void 0 : y.trim()) || null, b = u.mobileOnly === !0, w = () => {
|
|
2263
|
+
var q;
|
|
2264
|
+
(q = window.getSelection()) != null && q.toString().trim() || n(e.id);
|
|
2265
|
+
}, x = (A = e.progress) != null && A.status ? /* @__PURE__ */ l(
|
|
2266
|
+
gl,
|
|
2106
2267
|
{
|
|
2107
2268
|
status: e.progress.status,
|
|
2108
2269
|
missingCount: e.progress.missingCount,
|
|
2109
2270
|
incompleteCount: e.progress.incompleteCount
|
|
2110
2271
|
}
|
|
2111
2272
|
) : null;
|
|
2112
|
-
return /* @__PURE__ */
|
|
2113
|
-
|
|
2273
|
+
return /* @__PURE__ */ C(
|
|
2274
|
+
T,
|
|
2114
2275
|
{
|
|
2115
2276
|
as: "div",
|
|
2116
2277
|
background: "primary",
|
|
@@ -2121,80 +2282,205 @@ function Fi({
|
|
|
2121
2282
|
margin: "0 0 small 0",
|
|
2122
2283
|
"data-testid": `module-card-${e.id}`,
|
|
2123
2284
|
children: [
|
|
2124
|
-
/* @__PURE__ */
|
|
2125
|
-
|
|
2285
|
+
/* @__PURE__ */ l(T, { as: "div", cursor: "pointer", children: /* @__PURE__ */ C(
|
|
2286
|
+
E,
|
|
2126
2287
|
{
|
|
2127
2288
|
alignItems: "start",
|
|
2128
2289
|
gap: "mediumSmall",
|
|
2129
|
-
onClick:
|
|
2290
|
+
onClick: w,
|
|
2130
2291
|
"data-testid": "module-header",
|
|
2131
2292
|
children: [
|
|
2132
|
-
/* @__PURE__ */
|
|
2133
|
-
/* @__PURE__ */
|
|
2134
|
-
/* @__PURE__ */
|
|
2135
|
-
|
|
2293
|
+
/* @__PURE__ */ C(E.Item, { shouldGrow: !0, shouldShrink: !0, children: [
|
|
2294
|
+
/* @__PURE__ */ C(T, { as: "div", children: [
|
|
2295
|
+
/* @__PURE__ */ l(
|
|
2296
|
+
mn,
|
|
2136
2297
|
{
|
|
2137
2298
|
level: a,
|
|
2138
2299
|
variant: "titleCardRegular",
|
|
2139
2300
|
color: f ? "secondary" : "primary",
|
|
2140
2301
|
"data-testid": "module-name",
|
|
2141
|
-
children: /* @__PURE__ */
|
|
2302
|
+
children: /* @__PURE__ */ l(yo, { linesAllowed: Dl, children: g ? c("moduleNameWithLabel", { label: g, name: e.name }) : e.name })
|
|
2142
2303
|
}
|
|
2143
2304
|
),
|
|
2144
|
-
e.published ? null : /* @__PURE__ */
|
|
2305
|
+
e.published ? null : /* @__PURE__ */ C(v, { size: "x-small", color: "secondary", children: [
|
|
2145
2306
|
" ",
|
|
2146
|
-
|
|
2307
|
+
c("moduleUnpublishedBadge")
|
|
2147
2308
|
] })
|
|
2148
2309
|
] }),
|
|
2149
|
-
/* @__PURE__ */
|
|
2150
|
-
|
|
2151
|
-
/* @__PURE__ */
|
|
2310
|
+
/* @__PURE__ */ l(vl, { module: e, today: s }),
|
|
2311
|
+
b && x ? /* @__PURE__ */ l(T, { as: "div", margin: "x-small 0 0 0", children: x }) : null,
|
|
2312
|
+
/* @__PURE__ */ l(Ol, { module: e, breakpoints: u })
|
|
2152
2313
|
] }),
|
|
2153
|
-
/* @__PURE__ */
|
|
2154
|
-
!
|
|
2155
|
-
/* @__PURE__ */
|
|
2156
|
-
|
|
2314
|
+
/* @__PURE__ */ l(E.Item, { children: /* @__PURE__ */ C(E, { alignItems: "center", gap: "mediumSmall", children: [
|
|
2315
|
+
!b && x ? /* @__PURE__ */ l(E.Item, { children: x }) : null,
|
|
2316
|
+
/* @__PURE__ */ l(E.Item, { children: /* @__PURE__ */ l(
|
|
2317
|
+
Mo,
|
|
2157
2318
|
{
|
|
2158
2319
|
size: "medium",
|
|
2159
2320
|
withBorder: !0,
|
|
2160
2321
|
withBackground: !1,
|
|
2161
|
-
screenReaderLabel: t ?
|
|
2322
|
+
screenReaderLabel: t ? c("collapseModule", { name: e.name }) : c("expandModule", { name: e.name }),
|
|
2162
2323
|
"aria-expanded": t,
|
|
2163
|
-
"aria-controls":
|
|
2164
|
-
onClick: (
|
|
2165
|
-
|
|
2324
|
+
"aria-controls": Vt(e.id),
|
|
2325
|
+
onClick: (q) => {
|
|
2326
|
+
q.stopPropagation(), n(e.id);
|
|
2166
2327
|
},
|
|
2167
2328
|
"data-testid": `toggle-module-${e.id}`,
|
|
2168
|
-
children: t ? /* @__PURE__ */
|
|
2329
|
+
children: t ? /* @__PURE__ */ l(fo, {}) : /* @__PURE__ */ l(go, {})
|
|
2169
2330
|
}
|
|
2170
2331
|
) })
|
|
2171
2332
|
] }) })
|
|
2172
2333
|
]
|
|
2173
2334
|
}
|
|
2174
2335
|
) }),
|
|
2175
|
-
/* @__PURE__ */
|
|
2176
|
-
|
|
2336
|
+
/* @__PURE__ */ l("div", { id: Vt(e.id), role: "group", "aria-label": e.name, hidden: !t, children: t ? /* @__PURE__ */ l(
|
|
2337
|
+
ql,
|
|
2177
2338
|
{
|
|
2178
2339
|
module: e,
|
|
2179
2340
|
state: o,
|
|
2180
|
-
today:
|
|
2181
|
-
navigation:
|
|
2182
|
-
showDiagnostics:
|
|
2341
|
+
today: s,
|
|
2342
|
+
navigation: r,
|
|
2343
|
+
showDiagnostics: i
|
|
2183
2344
|
}
|
|
2184
2345
|
) : null })
|
|
2185
2346
|
]
|
|
2186
2347
|
}
|
|
2187
2348
|
);
|
|
2188
2349
|
}
|
|
2189
|
-
const
|
|
2190
|
-
function
|
|
2350
|
+
const Ul = on(Fl);
|
|
2351
|
+
function zl(e) {
|
|
2352
|
+
switch (e) {
|
|
2353
|
+
case "complete":
|
|
2354
|
+
return "complete";
|
|
2355
|
+
case "locked":
|
|
2356
|
+
return "locked";
|
|
2357
|
+
case void 0:
|
|
2358
|
+
case "not_started":
|
|
2359
|
+
return "notStarted";
|
|
2360
|
+
case "in_progress":
|
|
2361
|
+
case "missing":
|
|
2362
|
+
case "incomplete":
|
|
2363
|
+
case "missing_and_incomplete":
|
|
2364
|
+
return "inProgress";
|
|
2365
|
+
}
|
|
2366
|
+
}
|
|
2367
|
+
function $l(e) {
|
|
2368
|
+
var i, a, d;
|
|
2369
|
+
let t = 0, n = 0, o = 0;
|
|
2370
|
+
for (const u of e)
|
|
2371
|
+
((i = u.progress) == null ? void 0 : i.status) === "complete" && (t += 1), n += ((a = u.progress) == null ? void 0 : a.requirementCount) ?? 0, o += ((d = u.progress) == null ? void 0 : d.requirementsMet) ?? 0;
|
|
2372
|
+
const s = e.length, r = s === 0 ? 0 : t === s ? 100 : Math.floor(t / s * 100);
|
|
2373
|
+
return {
|
|
2374
|
+
totalModules: s,
|
|
2375
|
+
completedModules: t,
|
|
2376
|
+
totalItems: n,
|
|
2377
|
+
completedItems: o,
|
|
2378
|
+
percent: r
|
|
2379
|
+
};
|
|
2380
|
+
}
|
|
2381
|
+
const Bl = "1.75rem", Gl = "4px", jl = "4px", Yl = "6.5rem";
|
|
2382
|
+
function Wl({
|
|
2383
|
+
module: e,
|
|
2384
|
+
onClick: t
|
|
2385
|
+
}) {
|
|
2386
|
+
var c, p, f, y;
|
|
2387
|
+
const { t: n } = j(), s = Ne().moduleLabel(e.position, e), r = s ? n("moduleNameWithLabel", { label: s, name: e.name }) : e.name, i = ((c = e.progress) == null ? void 0 : c.status) ?? "not_started", a = zl(i), d = n("moduleProgressSegmentLabel", {
|
|
2388
|
+
name: r,
|
|
2389
|
+
status: Wn(
|
|
2390
|
+
n,
|
|
2391
|
+
i,
|
|
2392
|
+
((p = e.progress) == null ? void 0 : p.missingCount) ?? 0,
|
|
2393
|
+
((f = e.progress) == null ? void 0 : f.incompleteCount) ?? 0
|
|
2394
|
+
)
|
|
2395
|
+
}), u = a === "complete" ? 100 : a === "inProgress" ? ((y = e.progress) == null ? void 0 : y.percentComplete) ?? 0 : 0;
|
|
2396
|
+
return /* @__PURE__ */ l(E.Item, { shouldShrink: !0, width: Yl, children: /* @__PURE__ */ l(pn, { renderTip: r, children: () => /* @__PURE__ */ C(
|
|
2397
|
+
T,
|
|
2398
|
+
{
|
|
2399
|
+
as: "button",
|
|
2400
|
+
type: "button",
|
|
2401
|
+
display: "block",
|
|
2402
|
+
width: "100%",
|
|
2403
|
+
height: Bl,
|
|
2404
|
+
borderRadius: Gl,
|
|
2405
|
+
borderWidth: a === "complete" ? "none" : "small",
|
|
2406
|
+
borderColor: "secondary",
|
|
2407
|
+
background: a === "locked" ? "secondary" : "primary",
|
|
2408
|
+
position: "relative",
|
|
2409
|
+
overflowX: "hidden",
|
|
2410
|
+
overflowY: "hidden",
|
|
2411
|
+
padding: "0",
|
|
2412
|
+
onClick: t ? () => t(e.id) : void 0,
|
|
2413
|
+
"data-testid": `modules-progress-segment-${e.id}`,
|
|
2414
|
+
children: [
|
|
2415
|
+
u > 0 ? /* @__PURE__ */ l(
|
|
2416
|
+
T,
|
|
2417
|
+
{
|
|
2418
|
+
as: "div",
|
|
2419
|
+
position: "absolute",
|
|
2420
|
+
insetInlineStart: "0",
|
|
2421
|
+
insetInlineEnd: "0",
|
|
2422
|
+
insetBlockEnd: "0",
|
|
2423
|
+
height: `${u}%`,
|
|
2424
|
+
background: "brand"
|
|
2425
|
+
}
|
|
2426
|
+
) : null,
|
|
2427
|
+
/* @__PURE__ */ l(it, { children: d })
|
|
2428
|
+
]
|
|
2429
|
+
}
|
|
2430
|
+
) }) });
|
|
2431
|
+
}
|
|
2432
|
+
function Hl({
|
|
2433
|
+
modules: e,
|
|
2434
|
+
onModuleClick: t
|
|
2435
|
+
}) {
|
|
2436
|
+
const { t: n } = j(), o = N(() => $l(e), [e]);
|
|
2437
|
+
if (!e.some((a) => a.progress !== void 0) || o.totalModules === 0) return null;
|
|
2438
|
+
const r = n("moduleProgressOverviewSummary", {
|
|
2439
|
+
count: o.totalModules,
|
|
2440
|
+
completedModules: o.completedModules,
|
|
2441
|
+
totalModules: o.totalModules
|
|
2442
|
+
}), i = o.totalItems > 0 ? n("moduleProgressOverviewDetail", {
|
|
2443
|
+
itemsSummary: n("moduleProgressOverviewItemsSummary", {
|
|
2444
|
+
count: o.totalItems,
|
|
2445
|
+
completedItems: o.completedItems,
|
|
2446
|
+
totalItems: o.totalItems
|
|
2447
|
+
})
|
|
2448
|
+
}) : null;
|
|
2449
|
+
return /* @__PURE__ */ C(T, { as: "div", margin: "medium 0 small 0", "data-testid": "modules-progress-overview", children: [
|
|
2450
|
+
/* @__PURE__ */ l(E, { wrap: "wrap", children: /* @__PURE__ */ C(E.Item, { children: [
|
|
2451
|
+
/* @__PURE__ */ l(T, { as: "span", margin: "0 x-small 0 0", children: /* @__PURE__ */ l(
|
|
2452
|
+
v,
|
|
2453
|
+
{
|
|
2454
|
+
size: "large",
|
|
2455
|
+
weight: "bold",
|
|
2456
|
+
lineHeight: "condensed",
|
|
2457
|
+
"data-testid": "modules-progress-overview-percent",
|
|
2458
|
+
children: n("moduleProgressOverviewPercentLabel", { percent: o.percent })
|
|
2459
|
+
}
|
|
2460
|
+
) }),
|
|
2461
|
+
/* @__PURE__ */ l(v, { size: "medium", "data-testid": "modules-progress-overview-summary", children: i ? `${r} ${i}` : r })
|
|
2462
|
+
] }) }),
|
|
2463
|
+
/* @__PURE__ */ l(
|
|
2464
|
+
E,
|
|
2465
|
+
{
|
|
2466
|
+
margin: "xx-small 0 0 0",
|
|
2467
|
+
gap: jl,
|
|
2468
|
+
role: "group",
|
|
2469
|
+
"aria-label": n("moduleProgressOverviewGroupLabel"),
|
|
2470
|
+
"data-testid": "modules-progress-overview-segments",
|
|
2471
|
+
children: e.map((a) => /* @__PURE__ */ l(Wl, { module: a, onClick: t }, a.id))
|
|
2472
|
+
}
|
|
2473
|
+
)
|
|
2474
|
+
] });
|
|
2475
|
+
}
|
|
2476
|
+
function Kl({
|
|
2191
2477
|
counts: e,
|
|
2192
2478
|
itemsMode: t,
|
|
2193
2479
|
loadedModules: n
|
|
2194
2480
|
}) {
|
|
2195
2481
|
const o = e.listModules + e.listModuleItems;
|
|
2196
|
-
return /* @__PURE__ */
|
|
2197
|
-
|
|
2482
|
+
return /* @__PURE__ */ l(
|
|
2483
|
+
T,
|
|
2198
2484
|
{
|
|
2199
2485
|
as: "div",
|
|
2200
2486
|
background: "secondary",
|
|
@@ -2203,25 +2489,25 @@ function zi({
|
|
|
2203
2489
|
padding: "x-small small",
|
|
2204
2490
|
margin: "0 0 small 0",
|
|
2205
2491
|
"data-testid": "dev-diagnostics",
|
|
2206
|
-
children: /* @__PURE__ */
|
|
2207
|
-
/* @__PURE__ */
|
|
2208
|
-
/* @__PURE__ */
|
|
2492
|
+
children: /* @__PURE__ */ C(E, { gap: "medium", wrap: "wrap", children: [
|
|
2493
|
+
/* @__PURE__ */ l(E.Item, { children: /* @__PURE__ */ l(v, { size: "x-small", weight: "bold", children: "Adapter requests" }) }),
|
|
2494
|
+
/* @__PURE__ */ l(E.Item, { children: /* @__PURE__ */ C(v, { size: "x-small", "data-testid": "request-count-list-modules", children: [
|
|
2209
2495
|
"listModules: ",
|
|
2210
2496
|
e.listModules
|
|
2211
2497
|
] }) }),
|
|
2212
|
-
/* @__PURE__ */
|
|
2498
|
+
/* @__PURE__ */ l(E.Item, { children: /* @__PURE__ */ C(v, { size: "x-small", "data-testid": "request-count-list-module-items", children: [
|
|
2213
2499
|
"listModuleItems: ",
|
|
2214
2500
|
e.listModuleItems
|
|
2215
2501
|
] }) }),
|
|
2216
|
-
/* @__PURE__ */
|
|
2502
|
+
/* @__PURE__ */ l(E.Item, { children: /* @__PURE__ */ C(v, { size: "x-small", weight: "bold", "data-testid": "request-count-total", children: [
|
|
2217
2503
|
"total: ",
|
|
2218
2504
|
o
|
|
2219
2505
|
] }) }),
|
|
2220
|
-
/* @__PURE__ */
|
|
2506
|
+
/* @__PURE__ */ l(E.Item, { children: /* @__PURE__ */ C(v, { size: "x-small", "data-testid": "resolved-items-mode", children: [
|
|
2221
2507
|
"itemsMode: ",
|
|
2222
2508
|
t ?? "probing…"
|
|
2223
2509
|
] }) }),
|
|
2224
|
-
/* @__PURE__ */
|
|
2510
|
+
/* @__PURE__ */ l(E.Item, { children: /* @__PURE__ */ C(v, { size: "x-small", "data-testid": "modules-loaded-count", children: [
|
|
2225
2511
|
"modules loaded: ",
|
|
2226
2512
|
n
|
|
2227
2513
|
] }) })
|
|
@@ -2229,156 +2515,190 @@ function zi({
|
|
|
2229
2515
|
}
|
|
2230
2516
|
);
|
|
2231
2517
|
}
|
|
2232
|
-
const
|
|
2233
|
-
function
|
|
2518
|
+
const Ql = 200;
|
|
2519
|
+
function Vl({
|
|
2234
2520
|
data: e,
|
|
2235
2521
|
courseName: t,
|
|
2236
2522
|
courseContext: n,
|
|
2237
2523
|
today: o,
|
|
2238
|
-
requestCounts:
|
|
2239
|
-
showDiagnostics:
|
|
2240
|
-
navigation:
|
|
2524
|
+
requestCounts: s,
|
|
2525
|
+
showDiagnostics: r = s !== void 0,
|
|
2526
|
+
navigation: i,
|
|
2241
2527
|
as: a = "div",
|
|
2242
|
-
headingLevel:
|
|
2243
|
-
breakpoints:
|
|
2528
|
+
headingLevel: d = "h2",
|
|
2529
|
+
breakpoints: u = {}
|
|
2244
2530
|
}) {
|
|
2245
|
-
const { miniTablet:
|
|
2246
|
-
() => ({ miniTablet:
|
|
2247
|
-
[
|
|
2531
|
+
const { miniTablet: c, tablet: p, desktop: f, desktopNavOpen: y, desktopOnly: g, mobileOnly: b, ICEDesktop: w } = u, x = N(
|
|
2532
|
+
() => ({ miniTablet: c, tablet: p, desktop: f, desktopNavOpen: y, desktopOnly: g, mobileOnly: b, ICEDesktop: w }),
|
|
2533
|
+
[c, p, f, y, g, b, w]
|
|
2248
2534
|
), {
|
|
2249
|
-
modules:
|
|
2250
|
-
hasNextPage:
|
|
2251
|
-
fetchNextPage:
|
|
2252
|
-
isFetchingNextPage:
|
|
2253
|
-
isLoading:
|
|
2535
|
+
modules: _,
|
|
2536
|
+
hasNextPage: A,
|
|
2537
|
+
fetchNextPage: q,
|
|
2538
|
+
isFetchingNextPage: B,
|
|
2539
|
+
isLoading: L,
|
|
2254
2540
|
isRefreshing: k,
|
|
2255
|
-
error:
|
|
2256
|
-
itemsMode:
|
|
2257
|
-
expandedModuleIds:
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
var
|
|
2271
|
-
|
|
2272
|
-
}, [
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2541
|
+
error: G,
|
|
2542
|
+
itemsMode: J,
|
|
2543
|
+
expandedModuleIds: F,
|
|
2544
|
+
expandModule: D,
|
|
2545
|
+
collapseModule: Y,
|
|
2546
|
+
toggleModule: se,
|
|
2547
|
+
expandModules: De,
|
|
2548
|
+
collapseModules: Oe,
|
|
2549
|
+
getItems: Me,
|
|
2550
|
+
filter: ee,
|
|
2551
|
+
setFilter: ye,
|
|
2552
|
+
filterEntry: qe,
|
|
2553
|
+
filterPredicate: re,
|
|
2554
|
+
filterResultsArePartial: ie
|
|
2555
|
+
} = e, { t: P, timezone: Fe } = j(), Ue = t ?? P("pageTitle"), W = $(null), Se = $(/* @__PURE__ */ new Map()), le = st(), H = st(), ze = b === !0, ae = $(!1), $e = U((S) => {
|
|
2556
|
+
var z;
|
|
2557
|
+
(z = Se.current.get(S)) == null || z.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
2558
|
+
}, []), [Be] = V(() => /* @__PURE__ */ new Date()), _e = o ?? Be, [Te, Ge] = V(null);
|
|
2559
|
+
Z(() => {
|
|
2560
|
+
!A && !k && ee === X && Ge(_);
|
|
2561
|
+
}, [A, k, ee, _]), Z(() => {
|
|
2562
|
+
var S;
|
|
2563
|
+
!ae.current || B || k || (ae.current = !1, pe(P("modulesLoadedAnnouncement", { count: _.length })), (S = W.current) == null || S.focus());
|
|
2564
|
+
}, [B, k, _.length, P]);
|
|
2565
|
+
const h = N(
|
|
2566
|
+
() => _.filter(
|
|
2567
|
+
(S) => re === void 0 || re(S, { today: _e, timezone: Fe })
|
|
2276
2568
|
),
|
|
2277
|
-
[
|
|
2278
|
-
),
|
|
2279
|
-
rows:
|
|
2280
|
-
expanded:
|
|
2569
|
+
[_, re, _e, Fe]
|
|
2570
|
+
), M = $({
|
|
2571
|
+
rows: h,
|
|
2572
|
+
expanded: F,
|
|
2281
2573
|
items: /* @__PURE__ */ new Map()
|
|
2282
|
-
}), [
|
|
2283
|
-
k ?
|
|
2284
|
-
rows:
|
|
2285
|
-
expanded:
|
|
2286
|
-
items: new Map(
|
|
2287
|
-
},
|
|
2288
|
-
const
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2574
|
+
}), [I, R] = V(null);
|
|
2575
|
+
k ? I === null && R(M.current) : (M.current = {
|
|
2576
|
+
rows: h,
|
|
2577
|
+
expanded: F,
|
|
2578
|
+
items: new Map(F.map((S) => [S, Me(S)]))
|
|
2579
|
+
}, I !== null && R(null));
|
|
2580
|
+
const O = (I == null ? void 0 : I.rows) ?? h, ce = (I == null ? void 0 : I.expanded) ?? F, K = N(() => new Set(ce), [ce]), te = N(
|
|
2581
|
+
() => O.filter((S) => K.has(S.id)).map((S) => S.id),
|
|
2582
|
+
[O, K]
|
|
2583
|
+
), Ee = te.length > 0, [ue, Q] = V(!1), Ce = te.filter((S) => Me(S).isLoading).length, je = ue ? Ce : 0, de = $(!1);
|
|
2584
|
+
Z(() => {
|
|
2585
|
+
if (ue) {
|
|
2586
|
+
if (Ce > 0 && !de.current) {
|
|
2587
|
+
de.current = !0, pe(P("expandAllLoadingItems", { count: Ce }));
|
|
2295
2588
|
return;
|
|
2296
2589
|
}
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2590
|
+
Ce === 0 && de.current && (de.current = !1, Q(!1), pe(P("expandAllItemsLoaded")));
|
|
2591
|
+
}
|
|
2592
|
+
}, [ue, Ce, P]);
|
|
2593
|
+
const eo = () => {
|
|
2594
|
+
if (Ee) {
|
|
2595
|
+
const z = new Set(te);
|
|
2596
|
+
Q(!1), de.current = !1, Oe(te), I !== null && R({ ...I, expanded: I.expanded.filter((Ye) => !z.has(Ye)) }), pe(P("modulesCollapsedAnnouncement", { count: te.length }));
|
|
2597
|
+
return;
|
|
2598
|
+
}
|
|
2599
|
+
const S = O.map((z) => z.id);
|
|
2600
|
+
Q(!0), de.current = !1, De(S), I !== null && R({ ...I, expanded: S }), pe(P("modulesExpandedAnnouncement", { count: S.length }));
|
|
2601
|
+
}, Tt = $(I);
|
|
2602
|
+
Tt.current = I;
|
|
2603
|
+
const to = U(
|
|
2604
|
+
(S) => {
|
|
2605
|
+
const z = Tt.current;
|
|
2606
|
+
if (z === null) {
|
|
2607
|
+
se(S);
|
|
2608
|
+
return;
|
|
2609
|
+
}
|
|
2610
|
+
const Ye = z.expanded.includes(S);
|
|
2611
|
+
R({
|
|
2612
|
+
...z,
|
|
2613
|
+
expanded: Ye ? z.expanded.filter((so) => so !== S) : [...z.expanded, S]
|
|
2614
|
+
}), Ye ? Y(S) : D(S);
|
|
2302
2615
|
},
|
|
2303
|
-
[
|
|
2304
|
-
), [
|
|
2305
|
-
|
|
2616
|
+
[se, Y, D]
|
|
2617
|
+
), [no, Et] = V(!1);
|
|
2618
|
+
Z(() => {
|
|
2306
2619
|
if (!k) {
|
|
2307
|
-
|
|
2620
|
+
Et(!1);
|
|
2308
2621
|
return;
|
|
2309
2622
|
}
|
|
2310
|
-
const
|
|
2311
|
-
return () => clearTimeout(
|
|
2623
|
+
const S = setTimeout(() => Et(!0), Ql);
|
|
2624
|
+
return () => clearTimeout(S);
|
|
2312
2625
|
}, [k]);
|
|
2313
|
-
const
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
}, Ne = Ae !== void 0 && Le !== te, be = A || k && V.length === 0, Me = V.length === 0 && !be && !$, se = Me && Ne;
|
|
2319
|
-
return /* @__PURE__ */ S(E, { as: a, display: "block", "data-testid": "modules-list", children: [
|
|
2320
|
-
n ? /* @__PURE__ */ S(E, { as: "div", children: [
|
|
2321
|
-
/* @__PURE__ */ i(v, { size: "small", color: "brand", children: n }),
|
|
2322
|
-
/* @__PURE__ */ S(v, { size: "small", color: "secondary", children: [
|
|
2626
|
+
const Ct = qe !== void 0 && ee !== X, wt = L || k && O.length === 0, Pt = O.length === 0 && !wt && !G, oo = Pt && Ct;
|
|
2627
|
+
return /* @__PURE__ */ C(T, { as: a, display: "block", "data-testid": "modules-list", children: [
|
|
2628
|
+
n ? /* @__PURE__ */ C(T, { as: "div", children: [
|
|
2629
|
+
/* @__PURE__ */ l(v, { size: "small", color: "brand", children: n }),
|
|
2630
|
+
/* @__PURE__ */ C(v, { size: "small", color: "secondary", children: [
|
|
2323
2631
|
" ",
|
|
2324
2632
|
"/",
|
|
2325
2633
|
" "
|
|
2326
2634
|
] }),
|
|
2327
|
-
/* @__PURE__ */
|
|
2635
|
+
/* @__PURE__ */ l(v, { size: "small", color: "secondary", children: Ue })
|
|
2328
2636
|
] }) : null,
|
|
2329
|
-
/* @__PURE__ */
|
|
2330
|
-
|
|
2331
|
-
|
|
2637
|
+
/* @__PURE__ */ l(mn, { level: d, margin: "x-small 0 medium 0", children: Ue }),
|
|
2638
|
+
Te ? /* @__PURE__ */ l(Hl, { modules: Te, onModuleClick: $e }) : null,
|
|
2639
|
+
r && s ? /* @__PURE__ */ l(
|
|
2640
|
+
Kl,
|
|
2332
2641
|
{
|
|
2333
|
-
counts:
|
|
2334
|
-
itemsMode:
|
|
2335
|
-
loadedModules:
|
|
2642
|
+
counts: s,
|
|
2643
|
+
itemsMode: J,
|
|
2644
|
+
loadedModules: _.length
|
|
2336
2645
|
}
|
|
2337
2646
|
) : null,
|
|
2338
|
-
/* @__PURE__ */
|
|
2339
|
-
|
|
2647
|
+
/* @__PURE__ */ l(E, { justifyItems: "end", "data-testid": "modules-controls", children: /* @__PURE__ */ l(E.Item, { shouldGrow: ze, children: /* @__PURE__ */ l(
|
|
2648
|
+
ve,
|
|
2340
2649
|
{
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2650
|
+
display: ze ? "block" : "inline-block",
|
|
2651
|
+
onClick: eo,
|
|
2652
|
+
interaction: O.length === 0 ? "disabled" : "enabled",
|
|
2653
|
+
renderIcon: je > 0 ? /* @__PURE__ */ l(rt, { size: "x-small", renderTitle: P("itemsLoadingSpinnerLabel") }) : void 0,
|
|
2654
|
+
"aria-describedby": je > 0 ? H : void 0,
|
|
2655
|
+
"data-testid": "expand-collapse-all",
|
|
2656
|
+
children: P(Ee ? "collapseAllModules" : "expandAllModules")
|
|
2347
2657
|
}
|
|
2348
2658
|
) }) }),
|
|
2349
|
-
/* @__PURE__ */
|
|
2350
|
-
|
|
2659
|
+
je > 0 ? /* @__PURE__ */ l(T, { as: "div", margin: "xx-small 0 0 0", textAlign: "end", children: /* @__PURE__ */ l(
|
|
2660
|
+
v,
|
|
2661
|
+
{
|
|
2662
|
+
size: "x-small",
|
|
2663
|
+
color: "secondary",
|
|
2664
|
+
id: H,
|
|
2665
|
+
"data-testid": "expand-all-loading-hint",
|
|
2666
|
+
children: P("expandAllLoadingItems", { count: je })
|
|
2667
|
+
}
|
|
2668
|
+
) }) : null,
|
|
2669
|
+
/* @__PURE__ */ l(
|
|
2670
|
+
el,
|
|
2351
2671
|
{
|
|
2352
|
-
value:
|
|
2353
|
-
onChange:
|
|
2354
|
-
describedBy:
|
|
2672
|
+
value: ee,
|
|
2673
|
+
onChange: ye,
|
|
2674
|
+
describedBy: ie ? le : void 0
|
|
2355
2675
|
}
|
|
2356
2676
|
),
|
|
2357
|
-
|
|
2677
|
+
ie ? /* @__PURE__ */ l(T, { as: "div", margin: "x-small 0 0 0", children: /* @__PURE__ */ l(
|
|
2358
2678
|
v,
|
|
2359
2679
|
{
|
|
2360
2680
|
size: "x-small",
|
|
2361
2681
|
color: "secondary",
|
|
2362
|
-
id:
|
|
2682
|
+
id: le,
|
|
2363
2683
|
"data-testid": "filter-partial-hint",
|
|
2364
|
-
children:
|
|
2684
|
+
children: P("filterScopeHint")
|
|
2365
2685
|
}
|
|
2366
2686
|
) }) : null,
|
|
2367
|
-
/* @__PURE__ */
|
|
2368
|
-
|
|
2369
|
-
|
|
2687
|
+
/* @__PURE__ */ C(T, { as: "div", margin: "medium 0 0 0", children: [
|
|
2688
|
+
G ? /* @__PURE__ */ l(
|
|
2689
|
+
dn,
|
|
2370
2690
|
{
|
|
2371
2691
|
variant: "error",
|
|
2372
2692
|
margin: "0 0 small 0",
|
|
2373
|
-
liveRegion:
|
|
2693
|
+
liveRegion: un,
|
|
2374
2694
|
liveRegionPoliteness: "assertive",
|
|
2375
2695
|
"data-testid": "modules-error",
|
|
2376
|
-
children:
|
|
2696
|
+
children: P("modulesLoadErrorAlert", { message: G.message })
|
|
2377
2697
|
}
|
|
2378
2698
|
) : null,
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2699
|
+
wt ? /* @__PURE__ */ l(T, { as: "div", padding: "large", textAlign: "center", "data-testid": "modules-loading", children: /* @__PURE__ */ l(rt, { renderTitle: P("modulesLoadingSpinnerLabel") }) }) : null,
|
|
2700
|
+
Pt && !Ct ? /* @__PURE__ */ l(
|
|
2701
|
+
T,
|
|
2382
2702
|
{
|
|
2383
2703
|
as: "div",
|
|
2384
2704
|
background: "secondary",
|
|
@@ -2386,11 +2706,11 @@ function Bi({
|
|
|
2386
2706
|
padding: "large",
|
|
2387
2707
|
textAlign: "center",
|
|
2388
2708
|
"data-testid": "modules-empty",
|
|
2389
|
-
children: /* @__PURE__ */
|
|
2709
|
+
children: /* @__PURE__ */ l(v, { color: "secondary", children: P("noModulesEmptyState") })
|
|
2390
2710
|
}
|
|
2391
2711
|
) : null,
|
|
2392
|
-
|
|
2393
|
-
|
|
2712
|
+
oo ? /* @__PURE__ */ C(
|
|
2713
|
+
T,
|
|
2394
2714
|
{
|
|
2395
2715
|
as: "div",
|
|
2396
2716
|
background: "secondary",
|
|
@@ -2399,72 +2719,81 @@ function Bi({
|
|
|
2399
2719
|
textAlign: "center",
|
|
2400
2720
|
"data-testid": "modules-filtered-empty",
|
|
2401
2721
|
children: [
|
|
2402
|
-
/* @__PURE__ */
|
|
2403
|
-
/* @__PURE__ */
|
|
2404
|
-
|
|
2722
|
+
/* @__PURE__ */ l(T, { as: "div", margin: "0 0 small 0", children: /* @__PURE__ */ l(v, { color: "secondary", children: _.length === 0 ? P("noFilterMatches") : P("filteredEmptyState", { count: _.length }) }) }),
|
|
2723
|
+
/* @__PURE__ */ l(
|
|
2724
|
+
ve,
|
|
2405
2725
|
{
|
|
2406
2726
|
size: "small",
|
|
2407
2727
|
onClick: () => {
|
|
2408
|
-
|
|
2728
|
+
ye(X), ae.current = !0;
|
|
2409
2729
|
},
|
|
2410
|
-
children:
|
|
2730
|
+
children: P("clearFilters")
|
|
2411
2731
|
}
|
|
2412
2732
|
)
|
|
2413
2733
|
]
|
|
2414
2734
|
}
|
|
2415
2735
|
) : null,
|
|
2416
|
-
/* @__PURE__ */
|
|
2736
|
+
/* @__PURE__ */ l(
|
|
2417
2737
|
"ul",
|
|
2418
2738
|
{
|
|
2419
|
-
style: { listStyle: "none", margin: 0, padding: 0, opacity:
|
|
2739
|
+
style: { listStyle: "none", margin: 0, padding: 0, opacity: no ? 0.5 : 1 },
|
|
2420
2740
|
"aria-busy": k,
|
|
2421
2741
|
"data-testid": "modules-stack",
|
|
2422
|
-
children:
|
|
2423
|
-
|
|
2742
|
+
children: O.map((S) => /* @__PURE__ */ l(
|
|
2743
|
+
"li",
|
|
2424
2744
|
{
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2745
|
+
ref: (z) => {
|
|
2746
|
+
z ? Se.current.set(S.id, z) : Se.current.delete(S.id);
|
|
2747
|
+
},
|
|
2748
|
+
children: /* @__PURE__ */ l(
|
|
2749
|
+
Ul,
|
|
2750
|
+
{
|
|
2751
|
+
module: S,
|
|
2752
|
+
expanded: ce.includes(S.id),
|
|
2753
|
+
onToggle: to,
|
|
2754
|
+
itemsState: (I == null ? void 0 : I.items.get(S.id)) ?? Me(S.id),
|
|
2755
|
+
today: _e,
|
|
2756
|
+
showDiagnostics: r,
|
|
2757
|
+
navigation: i,
|
|
2758
|
+
headingLevel: d === "h1" ? "h2" : "h3",
|
|
2759
|
+
breakpoints: x
|
|
2760
|
+
}
|
|
2761
|
+
)
|
|
2762
|
+
},
|
|
2763
|
+
S.id
|
|
2764
|
+
))
|
|
2436
2765
|
}
|
|
2437
2766
|
)
|
|
2438
2767
|
] }),
|
|
2439
|
-
|
|
2440
|
-
|
|
2768
|
+
A ? /* @__PURE__ */ l(T, { as: "div", textAlign: "center", margin: "small 0 0 0", children: /* @__PURE__ */ l(
|
|
2769
|
+
ve,
|
|
2441
2770
|
{
|
|
2442
2771
|
color: "primary",
|
|
2443
2772
|
onClick: () => {
|
|
2444
|
-
|
|
2773
|
+
ae.current = !0, q();
|
|
2445
2774
|
},
|
|
2446
|
-
interaction:
|
|
2775
|
+
interaction: B || k ? "disabled" : "enabled",
|
|
2447
2776
|
"data-testid": "load-more-modules",
|
|
2448
|
-
children:
|
|
2777
|
+
children: B ? P("loadMoreModulesLoading") : P("loadMoreModules", { count: _.length })
|
|
2449
2778
|
}
|
|
2450
|
-
) }) :
|
|
2779
|
+
) }) : _.length > 0 ? /* @__PURE__ */ l(T, { as: "div", textAlign: "center", margin: "small 0 0 0", children: /* @__PURE__ */ l(
|
|
2451
2780
|
v,
|
|
2452
2781
|
{
|
|
2453
2782
|
size: "x-small",
|
|
2454
2783
|
color: "secondary",
|
|
2455
2784
|
"data-testid": "modules-all-loaded",
|
|
2456
|
-
elementRef: (
|
|
2457
|
-
|
|
2785
|
+
elementRef: (S) => {
|
|
2786
|
+
W.current = S;
|
|
2458
2787
|
},
|
|
2459
2788
|
tabIndex: -1,
|
|
2460
|
-
children:
|
|
2789
|
+
children: P("allModulesLoaded", { count: _.length })
|
|
2461
2790
|
}
|
|
2462
2791
|
) }) : null
|
|
2463
2792
|
] });
|
|
2464
2793
|
}
|
|
2465
|
-
const
|
|
2466
|
-
|
|
2467
|
-
),
|
|
2794
|
+
const sc = vo(
|
|
2795
|
+
Vl
|
|
2796
|
+
), Ae = [
|
|
2468
2797
|
"assignment",
|
|
2469
2798
|
"quiz",
|
|
2470
2799
|
"discussion",
|
|
@@ -2473,7 +2802,7 @@ const Vl = Hn(
|
|
|
2473
2802
|
"external_url",
|
|
2474
2803
|
"external_tool",
|
|
2475
2804
|
"sub_header"
|
|
2476
|
-
],
|
|
2805
|
+
], gt = [
|
|
2477
2806
|
"not_started",
|
|
2478
2807
|
"in_progress",
|
|
2479
2808
|
"complete",
|
|
@@ -2481,30 +2810,30 @@ const Vl = Hn(
|
|
|
2481
2810
|
"incomplete",
|
|
2482
2811
|
"missing_and_incomplete",
|
|
2483
2812
|
"locked"
|
|
2484
|
-
],
|
|
2813
|
+
], Xn = [
|
|
2485
2814
|
"must_view",
|
|
2486
2815
|
"must_submit",
|
|
2487
2816
|
"must_contribute",
|
|
2488
2817
|
"must_mark_done",
|
|
2489
2818
|
"min_score",
|
|
2490
2819
|
"min_percentage"
|
|
2491
|
-
],
|
|
2820
|
+
], Zl = ["assignment", "quiz", "discussion"], Xl = ["external_url", "external_tool"], Jl = ["assignment", "quiz", "discussion"], ea = Date.UTC(2025, 0, 6), ta = 864e5, be = "1", Jn = (e) => new Date(ea + e * ta).toISOString(), Xe = [
|
|
2492
2821
|
"min_score",
|
|
2493
2822
|
"min_percentage"
|
|
2494
|
-
],
|
|
2495
|
-
(e) => !
|
|
2496
|
-
),
|
|
2823
|
+
], na = Xn.filter(
|
|
2824
|
+
(e) => !Xe.includes(e)
|
|
2825
|
+
), oa = [
|
|
2497
2826
|
"in_progress",
|
|
2498
2827
|
"incomplete",
|
|
2499
2828
|
"missing_and_incomplete"
|
|
2500
|
-
],
|
|
2501
|
-
const
|
|
2502
|
-
return
|
|
2503
|
-
},
|
|
2829
|
+
], sa = (e, t, n, o) => {
|
|
2830
|
+
const s = n ? Xn : na, r = n && o ? Xe[t % Xe.length] : s[Math.floor(t / 3) % s.length];
|
|
2831
|
+
return r === "min_score" ? { itemId: e, type: r, minScore: 10 } : r === "min_percentage" ? { itemId: e, type: r, minPercentage: 80 } : { itemId: e, type: r };
|
|
2832
|
+
}, ra = (e, t, n, o) => e === "sub_header" ? !1 : n && o || t % 3 === 0, _t = (e) => gt[(e - 1) % gt.length], ia = (e, t) => !Jl.includes(e) || e === "discussion" && Math.floor(t / Ae.length) % 2 === 1 ? null : 5 + t % 4 * 5, la = (e, t, n, o) => t ? e === "missing" ? n != null || o % 2 === 0 : e === "missing_and_incomplete" ? o % 2 === 1 : !1 : !1, aa = (e, t, n, o) => {
|
|
2504
2833
|
if (e === "locked") return "locked";
|
|
2505
|
-
if (
|
|
2834
|
+
if (la(e, t, n, o)) return "missing";
|
|
2506
2835
|
if (!n) return;
|
|
2507
|
-
const
|
|
2836
|
+
const s = t && Xe.includes(n.type);
|
|
2508
2837
|
switch (e) {
|
|
2509
2838
|
case "not_started":
|
|
2510
2839
|
case "missing":
|
|
@@ -2513,122 +2842,122 @@ const Vl = Hn(
|
|
|
2513
2842
|
return "complete";
|
|
2514
2843
|
case "incomplete":
|
|
2515
2844
|
case "missing_and_incomplete":
|
|
2516
|
-
return
|
|
2845
|
+
return s && o % 2 === 0 ? "incomplete" : "complete";
|
|
2517
2846
|
case "in_progress":
|
|
2518
|
-
return
|
|
2847
|
+
return s ? o % 3 === 0 ? "complete" : o % 3 === 1 ? "in_progress" : "not_started" : o % 2 === 0 ? "complete" : "not_started";
|
|
2519
2848
|
default:
|
|
2520
2849
|
return e;
|
|
2521
2850
|
}
|
|
2522
|
-
},
|
|
2523
|
-
const
|
|
2851
|
+
}, ca = (e) => e.status === "complete", ua = (e, t, n, o, s, r, i, a) => {
|
|
2852
|
+
const d = String(e), u = Ae[o % Ae.length], c = u === "sub_header", p = Zl.includes(u) && (o % 4 === 0 || s === "missing");
|
|
2524
2853
|
return {
|
|
2525
2854
|
id: n,
|
|
2526
|
-
moduleId:
|
|
2527
|
-
title: `${
|
|
2528
|
-
type:
|
|
2855
|
+
moduleId: d,
|
|
2856
|
+
title: `${u} ${t + 1}`,
|
|
2857
|
+
type: u,
|
|
2529
2858
|
position: t + 1,
|
|
2530
2859
|
indent: t % 5 === 4 ? 1 : 0,
|
|
2531
2860
|
published: a === "teacher" ? o % 7 !== 0 : !0,
|
|
2532
|
-
url:
|
|
2533
|
-
newTab:
|
|
2534
|
-
completionRequirement:
|
|
2535
|
-
dueAt: p ?
|
|
2536
|
-
status:
|
|
2537
|
-
pointsPossible:
|
|
2538
|
-
extensions:
|
|
2861
|
+
url: c ? null : `/courses/${be}/modules/items/${n}`,
|
|
2862
|
+
newTab: Xl.includes(u) && o % 2 === 0,
|
|
2863
|
+
completionRequirement: i,
|
|
2864
|
+
dueAt: p ? Jn(o % 90) : null,
|
|
2865
|
+
status: s,
|
|
2866
|
+
pointsPossible: r,
|
|
2867
|
+
extensions: bt(
|
|
2539
2868
|
void 0,
|
|
2540
2869
|
o % 37 === 0 ? 5 + o % 4 * 10 : null
|
|
2541
2870
|
)
|
|
2542
2871
|
};
|
|
2543
|
-
},
|
|
2544
|
-
const
|
|
2872
|
+
}, da = (e, t, n, o) => {
|
|
2873
|
+
const s = _t(e), r = oa.includes(s), i = [];
|
|
2545
2874
|
let a = 0;
|
|
2546
|
-
for (let
|
|
2547
|
-
const
|
|
2548
|
-
|
|
2875
|
+
for (let d = 0; d < t; d += 1) {
|
|
2876
|
+
const u = n + d, c = Ae[u % Ae.length], p = ia(c, u), f = p !== null, y = f ? a++ : d, g = String(e * 1e3 + d + 1), b = ra(c, u, f, r) ? sa(g, u, f, r) : null, w = aa(s, f, b, y);
|
|
2877
|
+
i.push(ua(e, d, g, u, w, p, b, o));
|
|
2549
2878
|
}
|
|
2550
|
-
return
|
|
2551
|
-
},
|
|
2552
|
-
const
|
|
2553
|
-
if (
|
|
2879
|
+
return i;
|
|
2880
|
+
}, ma = (e, t, n, o) => {
|
|
2881
|
+
const s = _t(e);
|
|
2882
|
+
if (s === "locked" || s === "not_started") return s;
|
|
2554
2883
|
if (t.length === 0) return "not_started";
|
|
2555
|
-
if (!t.some((
|
|
2556
|
-
if (
|
|
2884
|
+
if (!t.some((r) => r.pointsPossible != null) || s === "missing" && n === 0 || s === "incomplete" && o === 0) return "in_progress";
|
|
2885
|
+
if (s === "missing_and_incomplete") {
|
|
2557
2886
|
if (n === 0 && o === 0) return "in_progress";
|
|
2558
2887
|
if (n === 0) return "incomplete";
|
|
2559
2888
|
if (o === 0) return "missing";
|
|
2560
2889
|
}
|
|
2561
|
-
return
|
|
2562
|
-
},
|
|
2563
|
-
const o = t.filter((
|
|
2890
|
+
return s;
|
|
2891
|
+
}, pa = (e) => e.map((n) => n.dueAt).filter((n) => typeof n == "string").sort()[0] ?? null, fa = (e, t, n) => {
|
|
2892
|
+
const o = t.filter((u) => u.completionRequirement), s = n ?? o.length, r = Math.min(o.filter(ca).length, s), i = t.filter((u) => u.status === "missing").length, a = t.filter((u) => u.status === "incomplete").length;
|
|
2564
2893
|
return {
|
|
2565
|
-
status:
|
|
2566
|
-
requirementsMet:
|
|
2567
|
-
requirementCount:
|
|
2568
|
-
percentComplete:
|
|
2569
|
-
nextDueAt:
|
|
2570
|
-
missingCount:
|
|
2894
|
+
status: ma(e, t, i, a),
|
|
2895
|
+
requirementsMet: r,
|
|
2896
|
+
requirementCount: s,
|
|
2897
|
+
percentComplete: s > 0 ? Math.round(r / s * 100) : 0,
|
|
2898
|
+
nextDueAt: pa(t),
|
|
2899
|
+
missingCount: i,
|
|
2571
2900
|
incompleteCount: a
|
|
2572
2901
|
};
|
|
2573
|
-
},
|
|
2574
|
-
const o =
|
|
2902
|
+
}, ga = (e, t, n) => {
|
|
2903
|
+
const o = _t(e), s = e % 2 !== 0 && o !== "incomplete" && o !== "missing_and_incomplete" ? 1 : null;
|
|
2575
2904
|
return {
|
|
2576
2905
|
id: String(e),
|
|
2577
2906
|
name: `Module ${e}`,
|
|
2578
2907
|
position: e,
|
|
2579
2908
|
published: n === "teacher" ? e % 4 !== 0 : !0,
|
|
2580
2909
|
itemCount: t.length,
|
|
2581
|
-
unlockAt: e % 5 === 0 ?
|
|
2910
|
+
unlockAt: e % 5 === 0 ? Jn(e) : null,
|
|
2582
2911
|
prerequisiteModules: e > 1 && e % 3 === 0 ? [{ id: String(e - 1), name: `Module ${e - 1}` }] : [],
|
|
2583
|
-
requirementCount:
|
|
2912
|
+
requirementCount: s,
|
|
2584
2913
|
requireSequentialProgress: e % 6 === 0,
|
|
2585
2914
|
completionRequirements: t.flatMap(
|
|
2586
|
-
(
|
|
2915
|
+
(r) => r.completionRequirement ? [r.completionRequirement] : []
|
|
2587
2916
|
),
|
|
2588
|
-
progress:
|
|
2917
|
+
progress: fa(e, t, s)
|
|
2589
2918
|
};
|
|
2590
2919
|
};
|
|
2591
|
-
function
|
|
2920
|
+
function ha(e) {
|
|
2592
2921
|
return {
|
|
2593
2922
|
courseId: e.courseId,
|
|
2594
2923
|
modules: e.modules.map(({ progress: t, ...n }) => n),
|
|
2595
2924
|
itemsByModuleId: Object.fromEntries(
|
|
2596
2925
|
Object.entries(e.itemsByModuleId).map(([t, n]) => [
|
|
2597
2926
|
t,
|
|
2598
|
-
n.map(({ status: o, ...
|
|
2927
|
+
n.map(({ status: o, ...s }) => s)
|
|
2599
2928
|
])
|
|
2600
2929
|
)
|
|
2601
2930
|
};
|
|
2602
2931
|
}
|
|
2603
|
-
function
|
|
2604
|
-
const n = t.view ?? "student", o = t.courseId ??
|
|
2605
|
-
let
|
|
2606
|
-
e.forEach((
|
|
2607
|
-
const
|
|
2608
|
-
|
|
2932
|
+
function nt(e, t = {}) {
|
|
2933
|
+
const n = t.view ?? "student", o = t.courseId ?? be, s = [], r = {};
|
|
2934
|
+
let i = 0;
|
|
2935
|
+
e.forEach((d, u) => {
|
|
2936
|
+
const c = u + 1, p = da(c, d, i, n);
|
|
2937
|
+
i += d, s.push(ga(c, p, n)), r[String(c)] = p;
|
|
2609
2938
|
});
|
|
2610
|
-
const a = { courseId: o, modules:
|
|
2611
|
-
return n === "teacher" ?
|
|
2939
|
+
const a = { courseId: o, modules: s, itemsByModuleId: r };
|
|
2940
|
+
return n === "teacher" ? ha(a) : a;
|
|
2612
2941
|
}
|
|
2613
|
-
const
|
|
2614
|
-
function
|
|
2615
|
-
return
|
|
2942
|
+
const we = (e) => `/courses/${be}/modules/items/${e}`, Xt = "2099-08-31T06:59:00Z", Ia = "2020-01-06T07:00:00Z", ba = gt.length, Ma = 8, ya = 120, Sa = 25, _a = 250, Jt = 8;
|
|
2943
|
+
function rc() {
|
|
2944
|
+
return nt(Array.from({ length: ba }, () => Ma));
|
|
2616
2945
|
}
|
|
2617
|
-
function
|
|
2618
|
-
return
|
|
2946
|
+
function ic() {
|
|
2947
|
+
return nt(Array.from({ length: ya }, () => Sa));
|
|
2619
2948
|
}
|
|
2620
|
-
function
|
|
2621
|
-
return
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2949
|
+
function lc() {
|
|
2950
|
+
return nt([
|
|
2951
|
+
Jt,
|
|
2952
|
+
_a,
|
|
2953
|
+
Jt
|
|
2625
2954
|
]);
|
|
2626
2955
|
}
|
|
2627
|
-
function
|
|
2628
|
-
const e = (
|
|
2629
|
-
id: String(
|
|
2630
|
-
name:
|
|
2631
|
-
position:
|
|
2956
|
+
function ac() {
|
|
2957
|
+
const e = (s, r, i) => ({
|
|
2958
|
+
id: String(s),
|
|
2959
|
+
name: r,
|
|
2960
|
+
position: s,
|
|
2632
2961
|
published: !0,
|
|
2633
2962
|
itemCount: 0,
|
|
2634
2963
|
prerequisiteModules: [],
|
|
@@ -2641,29 +2970,29 @@ function Jl() {
|
|
|
2641
2970
|
missingCount: 0,
|
|
2642
2971
|
incompleteCount: 0
|
|
2643
2972
|
},
|
|
2644
|
-
...
|
|
2973
|
+
...i
|
|
2645
2974
|
}), t = { id: "101", name: "Week 1: Foundations" }, n = { id: "102", name: "Week 2: Derivatives" }, o = [
|
|
2646
|
-
e(1, "Locked by a future date", { unlockAt:
|
|
2975
|
+
e(1, "Locked by a future date", { unlockAt: Xt }),
|
|
2647
2976
|
e(2, "Locked by one prerequisite", { prerequisiteModules: [t] }),
|
|
2648
2977
|
e(3, "Locked by several prerequisites", {
|
|
2649
2978
|
prerequisiteModules: [t, n]
|
|
2650
2979
|
}),
|
|
2651
2980
|
e(4, "Locked by a date and a prerequisite", {
|
|
2652
|
-
unlockAt:
|
|
2981
|
+
unlockAt: Xt,
|
|
2653
2982
|
prerequisiteModules: [t]
|
|
2654
2983
|
}),
|
|
2655
|
-
e(5, "Locked, and the unlock date has passed", { unlockAt:
|
|
2984
|
+
e(5, "Locked, and the unlock date has passed", { unlockAt: Ia })
|
|
2656
2985
|
];
|
|
2657
2986
|
return {
|
|
2658
|
-
courseId:
|
|
2987
|
+
courseId: be,
|
|
2659
2988
|
modules: o,
|
|
2660
|
-
itemsByModuleId: Object.fromEntries(o.map((
|
|
2989
|
+
itemsByModuleId: Object.fromEntries(o.map((s) => [s.id, []]))
|
|
2661
2990
|
};
|
|
2662
2991
|
}
|
|
2663
|
-
function
|
|
2664
|
-
return
|
|
2992
|
+
function cc() {
|
|
2993
|
+
return nt([]);
|
|
2665
2994
|
}
|
|
2666
|
-
function
|
|
2995
|
+
function uc() {
|
|
2667
2996
|
const t = [
|
|
2668
2997
|
{
|
|
2669
2998
|
title: "Every fact: type, due date, points, requirement",
|
|
@@ -2692,7 +3021,7 @@ function ta() {
|
|
|
2692
3021
|
title: "Career item carrying an estimated duration",
|
|
2693
3022
|
type: "external_tool",
|
|
2694
3023
|
completionRequirement: { itemId: "5", type: "must_view" },
|
|
2695
|
-
extensions:
|
|
3024
|
+
extensions: bt(void 0, 45)
|
|
2696
3025
|
},
|
|
2697
3026
|
{ title: "A file, ungradeable, so no points at all", type: "file" },
|
|
2698
3027
|
{ title: "External link, opens in a new tab", type: "external_url", newTab: !0 },
|
|
@@ -2715,12 +3044,12 @@ function ta() {
|
|
|
2715
3044
|
indent: 0,
|
|
2716
3045
|
published: !0,
|
|
2717
3046
|
newTab: !1,
|
|
2718
|
-
url:
|
|
3047
|
+
url: we(o + 1),
|
|
2719
3048
|
status: "not_started",
|
|
2720
3049
|
...n
|
|
2721
3050
|
}));
|
|
2722
3051
|
return {
|
|
2723
|
-
courseId:
|
|
3052
|
+
courseId: be,
|
|
2724
3053
|
modules: [
|
|
2725
3054
|
{
|
|
2726
3055
|
id: "1",
|
|
@@ -2735,13 +3064,13 @@ function ta() {
|
|
|
2735
3064
|
itemsByModuleId: { 1: t }
|
|
2736
3065
|
};
|
|
2737
3066
|
}
|
|
2738
|
-
function
|
|
3067
|
+
function dc() {
|
|
2739
3068
|
const t = [
|
|
2740
|
-
{ title: "Reading: limits from the left and the right", type: "page", url:
|
|
3069
|
+
{ title: "Reading: limits from the left and the right", type: "page", url: we(1) },
|
|
2741
3070
|
{
|
|
2742
3071
|
title: "Desmos: interactive limit explorer",
|
|
2743
3072
|
type: "external_url",
|
|
2744
|
-
url:
|
|
3073
|
+
url: we(2),
|
|
2745
3074
|
newTab: !0
|
|
2746
3075
|
},
|
|
2747
3076
|
{ title: "Practice", type: "sub_header", url: null },
|
|
@@ -2749,9 +3078,9 @@ function na() {
|
|
|
2749
3078
|
{
|
|
2750
3079
|
title: "Utilizing Triangle Characteristics: Measuring Distances Through Angles, Elevation and the Practical Limits of Indirect Measurement in the Field",
|
|
2751
3080
|
type: "assignment",
|
|
2752
|
-
url:
|
|
3081
|
+
url: we(5)
|
|
2753
3082
|
},
|
|
2754
|
-
{ title: "Unit test", type: "quiz", url:
|
|
3083
|
+
{ title: "Unit test", type: "quiz", url: we(6), status: "locked" }
|
|
2755
3084
|
].map((n, o) => ({
|
|
2756
3085
|
id: String(o + 1),
|
|
2757
3086
|
moduleId: "1",
|
|
@@ -2763,7 +3092,7 @@ function na() {
|
|
|
2763
3092
|
...n
|
|
2764
3093
|
}));
|
|
2765
3094
|
return {
|
|
2766
|
-
courseId:
|
|
3095
|
+
courseId: be,
|
|
2767
3096
|
modules: [
|
|
2768
3097
|
{
|
|
2769
3098
|
id: "1",
|
|
@@ -2779,91 +3108,97 @@ function na() {
|
|
|
2779
3108
|
};
|
|
2780
3109
|
}
|
|
2781
3110
|
export {
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
3111
|
+
Qa as ACTION_ORDER_LTI_FLOOR,
|
|
3112
|
+
X as ALL_FILTER,
|
|
3113
|
+
Bt as ActionEntrySchema,
|
|
3114
|
+
hn as CompletionRequirementSchema,
|
|
3115
|
+
No as CompletionRequirementTypeSchema,
|
|
3116
|
+
Fn as DEFAULT_INLINE_THRESHOLD,
|
|
3117
|
+
Yi as DEFAULT_ITEM_CONCURRENCY,
|
|
3118
|
+
qn as DEFAULT_ITEM_PAGE_SIZE,
|
|
3119
|
+
Ie as DEFAULT_LOCALE,
|
|
3120
|
+
St as DEFAULT_PAGE_SIZE,
|
|
3121
|
+
Un as DEFAULT_RETAIN_COLLAPSED_LIMIT,
|
|
3122
|
+
tt as DEFAULT_STALE_TIME_MS,
|
|
3123
|
+
xi as DUE_THIS_WEEK_DAYS,
|
|
3124
|
+
Mn as EXT_CAREER_ESTIMATED_DURATION_MINUTES,
|
|
3125
|
+
be as FIXTURE_COURSE_ID,
|
|
3126
|
+
el as FilterChips,
|
|
3127
|
+
Ao as FilterClauseSchema,
|
|
3128
|
+
Bi as FilterEntrySchema,
|
|
3129
|
+
ps as GET_MODULES,
|
|
3130
|
+
fs as GET_MODULE_ITEMS,
|
|
3131
|
+
ct as INLINE_ITEM_LIMIT,
|
|
3132
|
+
Mt as INLINE_QUERY_NODE_BUDGET,
|
|
3133
|
+
$o as InMemoryCourseMismatchError,
|
|
3134
|
+
zi as ItemTypeEntrySchema,
|
|
3135
|
+
$i as MetaFieldEntrySchema,
|
|
3136
|
+
Ul as ModuleCard,
|
|
3137
|
+
Cl as ModuleItemRow,
|
|
3138
|
+
In as ModuleItemSchema,
|
|
3139
|
+
hl as ModuleItemStatusPill,
|
|
3140
|
+
Ro as ModuleItemStatusSchema,
|
|
3141
|
+
Lo as ModuleItemTypeSchema,
|
|
3142
|
+
Uo as ModuleItemsPageSchema,
|
|
3143
|
+
Do as ModuleProgressSchema,
|
|
3144
|
+
qo as ModuleSchema,
|
|
3145
|
+
gl as ModuleStatusPill,
|
|
3146
|
+
ko as ModuleStatusSchema,
|
|
3147
|
+
Xa as ModulesConfigProvider,
|
|
3148
|
+
Gi as ModulesConfigSchema,
|
|
3149
|
+
Za as ModulesI18nProvider,
|
|
3150
|
+
sc as ModulesList,
|
|
3151
|
+
Fo as ModulesPageSchema,
|
|
3152
|
+
Hl as ModulesProgressBar,
|
|
3153
|
+
bn as PageInfoSchema,
|
|
3154
|
+
yn as PartialCanvasResponseError,
|
|
3155
|
+
Oo as PrerequisiteModuleSchema,
|
|
3156
|
+
ke as RegistryEntrySchema,
|
|
3157
|
+
ki as TYPE_FIELD,
|
|
3158
|
+
Li as baseFilters,
|
|
3159
|
+
et as baseModulesConfig,
|
|
3160
|
+
nt as buildFixture,
|
|
3161
|
+
cc as courseEmpty,
|
|
3162
|
+
lc as courseFatModule,
|
|
3163
|
+
dc as courseItemLinks,
|
|
3164
|
+
uc as courseItemRowVariants,
|
|
3165
|
+
ic as courseLarge,
|
|
3166
|
+
ac as courseLockReasons,
|
|
3167
|
+
rc as courseSmall,
|
|
3168
|
+
Ms as createActionContext,
|
|
3169
|
+
Ha as createCanvasGraphqlAdapter,
|
|
3170
|
+
Wa as createInMemoryAdapter,
|
|
3171
|
+
xn as createTranslate,
|
|
3172
|
+
Ri as defaultFormatters,
|
|
3173
|
+
Ii as defaultTranslate,
|
|
3174
|
+
yt as filterClauseOf,
|
|
3175
|
+
zo as getEstimatedDurationMinutes,
|
|
3176
|
+
qi as hideUnservableFilters,
|
|
3177
|
+
Ka as invalidateCourse,
|
|
3178
|
+
bs as invalidateModuleItems,
|
|
3179
|
+
kt as invalidateModuleList,
|
|
3180
|
+
mt as isPredicateServed,
|
|
3181
|
+
me as mergeRegistry,
|
|
3182
|
+
fl as moduleItemStatusLabel,
|
|
3183
|
+
ut as moduleItemsPrefix,
|
|
3184
|
+
Wn as moduleStatusLabel,
|
|
3185
|
+
Le as modulesKeys,
|
|
3186
|
+
Is as modulesListPrefix,
|
|
3187
|
+
ec as partialModulesConfig,
|
|
3188
|
+
fe as registrySchema,
|
|
3189
|
+
ji as resolveModulesConfig,
|
|
3190
|
+
xo as servesClause,
|
|
3191
|
+
Oi as unservableFilters,
|
|
3192
|
+
tc as useActionContext,
|
|
3193
|
+
Ja as useFieldVisible,
|
|
3194
|
+
Ne as useFormatters,
|
|
3195
|
+
nc as useModuleItems,
|
|
3196
|
+
Wi as useModules,
|
|
3197
|
+
Re as useModulesConfig,
|
|
3198
|
+
j as useModulesI18n,
|
|
3199
|
+
oc as useModulesPageData,
|
|
3200
|
+
Va as visibleActions,
|
|
3201
|
+
Je as visibleEntries,
|
|
3202
|
+
he as visibleEntry,
|
|
3203
|
+
bt as withEstimatedDurationMinutes
|
|
2869
3204
|
};
|