@instructure/platform-assignment-review 0.4.17 → 0.4.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +779 -709
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
1
|
+
import { jsx as a, jsxs as S } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as Hn, useContext as $n, useMemo as Ve, useState as Ee, useRef as Bn, useEffect as yt, useCallback as Gn } from "react";
|
|
3
3
|
import { Flex as b } from "@instructure/ui-flex";
|
|
4
|
-
import { Heading as
|
|
4
|
+
import { Heading as _t } from "@instructure/ui-heading";
|
|
5
5
|
import { Spinner as Ye } from "@instructure/ui-spinner";
|
|
6
6
|
import { Text as _ } from "@instructure/ui-text";
|
|
7
7
|
import { View as Z } from "@instructure/ui-view";
|
|
8
|
-
import { useQuery as
|
|
9
|
-
import
|
|
10
|
-
import { z as
|
|
11
|
-
import { Pill as
|
|
12
|
-
import { IconDownloadLine as
|
|
13
|
-
import { ScreenReaderContent as
|
|
14
|
-
import { Link as
|
|
15
|
-
import { TruncateText as
|
|
16
|
-
import { Button as $, IconButton as
|
|
17
|
-
import { TextArea as
|
|
18
|
-
import { Badge as
|
|
19
|
-
import { Tooltip as
|
|
20
|
-
const
|
|
21
|
-
function
|
|
8
|
+
import { useQuery as Xe, useQueryClient as gn, useMutation as hn } from "@tanstack/react-query";
|
|
9
|
+
import se from "graphql-tag";
|
|
10
|
+
import { z as r } from "zod";
|
|
11
|
+
import { Pill as Et } from "@instructure/ui-pill";
|
|
12
|
+
import { IconDownloadLine as Wn, IconCheckMarkSolid as qn, IconArrowStartLine as Vn, IconArrowEndLine as Yn, IconTrashLine as Xn, IconArrowOpenStartLine as bn, IconArrowOpenEndLine as Tn, IconXLine as Kn, IconLockLine as yn, IconDocumentLine as Zt, IconLinkLine as Zn, IconDiscussionLine as Qn, IconQuizLine as Jn, IconAssignmentLine as ei } from "@instructure/ui-icons";
|
|
13
|
+
import { ScreenReaderContent as It } from "@instructure/ui-a11y-content";
|
|
14
|
+
import { Link as ti } from "@instructure/ui-link";
|
|
15
|
+
import { TruncateText as An } from "@instructure/ui-truncate-text";
|
|
16
|
+
import { Button as $, IconButton as ni } from "@instructure/ui-buttons";
|
|
17
|
+
import { TextArea as Sn } from "@instructure/ui-text-area";
|
|
18
|
+
import { Badge as _n } from "@instructure/ui-badge";
|
|
19
|
+
import { Tooltip as ii } from "@instructure/ui-tooltip";
|
|
20
|
+
const En = Hn(void 0);
|
|
21
|
+
function Wr({
|
|
22
22
|
translations: t,
|
|
23
23
|
children: n
|
|
24
24
|
}) {
|
|
25
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ a(En.Provider, { value: t, children: n });
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
const t =
|
|
27
|
+
function V() {
|
|
28
|
+
const t = $n(En);
|
|
29
29
|
if (!t)
|
|
30
30
|
throw new Error("useTranslations must be used within TranslationsProvider");
|
|
31
31
|
return t;
|
|
32
32
|
}
|
|
33
33
|
/*! @license DOMPurify 3.4.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.5/LICENSE */
|
|
34
|
-
function
|
|
34
|
+
function Qt(t, n) {
|
|
35
35
|
(n == null || n > t.length) && (n = t.length);
|
|
36
|
-
for (var i = 0,
|
|
37
|
-
return
|
|
36
|
+
for (var i = 0, o = Array(n); i < n; i++) o[i] = t[i];
|
|
37
|
+
return o;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function ri(t) {
|
|
40
40
|
if (Array.isArray(t)) return t;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function oi(t, n) {
|
|
43
43
|
var i = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
|
|
44
44
|
if (i != null) {
|
|
45
|
-
var
|
|
45
|
+
var o, l, c, d, p = [], m = !0, f = !1;
|
|
46
46
|
try {
|
|
47
|
-
if (c = (i = i.call(t)).next, n !== 0) for (; !(m = (
|
|
47
|
+
if (c = (i = i.call(t)).next, n !== 0) for (; !(m = (o = c.call(i)).done) && (p.push(o.value), p.length !== n); m = !0) ;
|
|
48
48
|
} catch (h) {
|
|
49
49
|
f = !0, l = h;
|
|
50
50
|
} finally {
|
|
@@ -57,157 +57,157 @@ function ti(t, n) {
|
|
|
57
57
|
return p;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function ai() {
|
|
61
61
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
62
62
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
return
|
|
64
|
+
function si(t, n) {
|
|
65
|
+
return ri(t) || oi(t, n) || li(t, n) || ai();
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function li(t, n) {
|
|
68
68
|
if (t) {
|
|
69
|
-
if (typeof t == "string") return
|
|
69
|
+
if (typeof t == "string") return Qt(t, n);
|
|
70
70
|
var i = {}.toString.call(t).slice(8, -1);
|
|
71
|
-
return i === "Object" && t.constructor && (i = t.constructor.name), i === "Map" || i === "Set" ? Array.from(t) : i === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i) ?
|
|
71
|
+
return i === "Object" && t.constructor && (i = t.constructor.name), i === "Map" || i === "Set" ? Array.from(t) : i === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i) ? Qt(t, n) : void 0;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
const
|
|
75
|
-
let B = Object.freeze, Y = Object.seal, _e = Object.create,
|
|
74
|
+
const In = Object.entries, Jt = Object.setPrototypeOf, ci = Object.isFrozen, mi = Object.getPrototypeOf, ui = Object.getOwnPropertyDescriptor;
|
|
75
|
+
let B = Object.freeze, Y = Object.seal, _e = Object.create, wn = typeof Reflect < "u" && Reflect, At = wn.apply, St = wn.construct;
|
|
76
76
|
B || (B = function(n) {
|
|
77
77
|
return n;
|
|
78
78
|
});
|
|
79
79
|
Y || (Y = function(n) {
|
|
80
80
|
return n;
|
|
81
81
|
});
|
|
82
|
-
|
|
83
|
-
for (var
|
|
82
|
+
At || (At = function(n, i) {
|
|
83
|
+
for (var o = arguments.length, l = new Array(o > 2 ? o - 2 : 0), c = 2; c < o; c++)
|
|
84
84
|
l[c - 2] = arguments[c];
|
|
85
85
|
return n.apply(i, l);
|
|
86
86
|
});
|
|
87
|
-
|
|
88
|
-
for (var i = arguments.length,
|
|
89
|
-
|
|
90
|
-
return new n(...
|
|
87
|
+
St || (St = function(n) {
|
|
88
|
+
for (var i = arguments.length, o = new Array(i > 1 ? i - 1 : 0), l = 1; l < i; l++)
|
|
89
|
+
o[l - 1] = arguments[l];
|
|
90
|
+
return new n(...o);
|
|
91
91
|
});
|
|
92
|
-
const Te = x(Array.prototype.forEach),
|
|
92
|
+
const Te = x(Array.prototype.forEach), di = x(Array.prototype.lastIndexOf), en = x(Array.prototype.pop), ye = x(Array.prototype.push), fi = x(Array.prototype.splice), H = Array.isArray, ve = x(String.prototype.toLowerCase), ft = x(String.prototype.toString), tn = x(String.prototype.match), Ae = x(String.prototype.replace), nn = x(String.prototype.indexOf), pi = x(String.prototype.trim), gi = x(Number.prototype.toString), hi = x(Boolean.prototype.toString), rn = typeof BigInt > "u" ? null : x(BigInt.prototype.toString), on = typeof Symbol > "u" ? null : x(Symbol.prototype.toString), D = x(Object.prototype.hasOwnProperty), Ne = x(Object.prototype.toString), U = x(RegExp.prototype.test), Ge = bi(TypeError);
|
|
93
93
|
function x(t) {
|
|
94
94
|
return function(n) {
|
|
95
95
|
n instanceof RegExp && (n.lastIndex = 0);
|
|
96
|
-
for (var i = arguments.length,
|
|
97
|
-
|
|
98
|
-
return
|
|
96
|
+
for (var i = arguments.length, o = new Array(i > 1 ? i - 1 : 0), l = 1; l < i; l++)
|
|
97
|
+
o[l - 1] = arguments[l];
|
|
98
|
+
return At(t, n, o);
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function bi(t) {
|
|
102
102
|
return function() {
|
|
103
|
-
for (var n = arguments.length, i = new Array(n),
|
|
104
|
-
i[
|
|
105
|
-
return
|
|
103
|
+
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
|
|
104
|
+
i[o] = arguments[o];
|
|
105
|
+
return St(t, i);
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
function T(t, n) {
|
|
109
|
-
let i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
110
|
-
if (
|
|
109
|
+
let i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ve;
|
|
110
|
+
if (Jt && Jt(t, null), !H(n))
|
|
111
111
|
return t;
|
|
112
|
-
let
|
|
113
|
-
for (;
|
|
114
|
-
let l = n[
|
|
112
|
+
let o = n.length;
|
|
113
|
+
for (; o--; ) {
|
|
114
|
+
let l = n[o];
|
|
115
115
|
if (typeof l == "string") {
|
|
116
116
|
const c = i(l);
|
|
117
|
-
c !== l && (
|
|
117
|
+
c !== l && (ci(n) || (n[o] = c), l = c);
|
|
118
118
|
}
|
|
119
119
|
t[l] = !0;
|
|
120
120
|
}
|
|
121
121
|
return t;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function Ti(t) {
|
|
124
124
|
for (let n = 0; n < t.length; n++)
|
|
125
125
|
D(t, n) || (t[n] = null);
|
|
126
126
|
return t;
|
|
127
127
|
}
|
|
128
128
|
function W(t) {
|
|
129
129
|
const n = _e(null);
|
|
130
|
-
for (const
|
|
131
|
-
var i =
|
|
130
|
+
for (const o of In(t)) {
|
|
131
|
+
var i = si(o, 2);
|
|
132
132
|
const l = i[0], c = i[1];
|
|
133
|
-
D(t, l) && (H(c) ? n[l] =
|
|
133
|
+
D(t, l) && (H(c) ? n[l] = Ti(c) : c && typeof c == "object" && c.constructor === Object ? n[l] = W(c) : n[l] = c);
|
|
134
134
|
}
|
|
135
135
|
return n;
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function yi(t) {
|
|
138
138
|
switch (typeof t) {
|
|
139
139
|
case "string":
|
|
140
140
|
return t;
|
|
141
141
|
case "number":
|
|
142
|
-
return
|
|
142
|
+
return gi(t);
|
|
143
143
|
case "boolean":
|
|
144
|
-
return
|
|
144
|
+
return hi(t);
|
|
145
145
|
case "bigint":
|
|
146
|
-
return
|
|
146
|
+
return rn ? rn(t) : "0";
|
|
147
147
|
case "symbol":
|
|
148
148
|
return on ? on(t) : "Symbol()";
|
|
149
149
|
case "undefined":
|
|
150
|
-
return
|
|
150
|
+
return Ne(t);
|
|
151
151
|
case "function":
|
|
152
152
|
case "object": {
|
|
153
153
|
if (t === null)
|
|
154
|
-
return
|
|
154
|
+
return Ne(t);
|
|
155
155
|
const n = t, i = de(n, "toString");
|
|
156
156
|
if (typeof i == "function") {
|
|
157
|
-
const
|
|
158
|
-
return typeof
|
|
157
|
+
const o = i(n);
|
|
158
|
+
return typeof o == "string" ? o : Ne(o);
|
|
159
159
|
}
|
|
160
|
-
return
|
|
160
|
+
return Ne(t);
|
|
161
161
|
}
|
|
162
162
|
default:
|
|
163
|
-
return
|
|
163
|
+
return Ne(t);
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
function de(t, n) {
|
|
167
167
|
for (; t !== null; ) {
|
|
168
|
-
const
|
|
169
|
-
if (
|
|
170
|
-
if (
|
|
171
|
-
return x(
|
|
172
|
-
if (typeof
|
|
173
|
-
return x(
|
|
168
|
+
const o = ui(t, n);
|
|
169
|
+
if (o) {
|
|
170
|
+
if (o.get)
|
|
171
|
+
return x(o.get);
|
|
172
|
+
if (typeof o.value == "function")
|
|
173
|
+
return x(o.value);
|
|
174
174
|
}
|
|
175
|
-
t =
|
|
175
|
+
t = mi(t);
|
|
176
176
|
}
|
|
177
177
|
function i() {
|
|
178
178
|
return null;
|
|
179
179
|
}
|
|
180
180
|
return i;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function Ai(t) {
|
|
183
183
|
try {
|
|
184
|
-
return
|
|
184
|
+
return U(t, ""), !0;
|
|
185
185
|
} catch {
|
|
186
186
|
return !1;
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
const
|
|
189
|
+
const an = B(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), pt = B(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), gt = B(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Si = B(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), ht = B(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), _i = B(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), sn = B(["#text"]), ln = B(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), bt = B(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), cn = B(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), We = B(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Ei = Y(/{{[\w\W]*|^[\w\W]*}}/g), Ii = Y(/<%[\w\W]*|^[\w\W]*%>/g), wi = Y(/\${[\w\W]*/g), Ci = Y(/^data-[\-\w.\u00B7-\uFFFF]+$/), Di = Y(/^aria-[\-\w]+$/), mn = Y(
|
|
190
190
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
191
191
|
// eslint-disable-line no-useless-escape
|
|
192
|
-
),
|
|
192
|
+
), Ri = Y(/^(?:\w+script|data):/i), Ni = Y(
|
|
193
193
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
194
194
|
// eslint-disable-line no-control-regex
|
|
195
|
-
),
|
|
195
|
+
), vi = Y(/^html$/i), Oi = Y(/^[a-z][.\w]*(-[.\w]+)+$/i), Se = {
|
|
196
196
|
element: 1,
|
|
197
197
|
text: 3,
|
|
198
198
|
// Deprecated
|
|
199
199
|
progressingInstruction: 7,
|
|
200
200
|
comment: 8,
|
|
201
201
|
document: 9
|
|
202
|
-
},
|
|
202
|
+
}, Li = function() {
|
|
203
203
|
return typeof window > "u" ? null : window;
|
|
204
|
-
},
|
|
204
|
+
}, xi = function(n, i) {
|
|
205
205
|
if (typeof n != "object" || typeof n.createPolicy != "function")
|
|
206
206
|
return null;
|
|
207
|
-
let
|
|
207
|
+
let o = null;
|
|
208
208
|
const l = "data-tt-policy-suffix";
|
|
209
|
-
i && i.hasAttribute(l) && (
|
|
210
|
-
const c = "dompurify" + (
|
|
209
|
+
i && i.hasAttribute(l) && (o = i.getAttribute(l));
|
|
210
|
+
const c = "dompurify" + (o ? "#" + o : "");
|
|
211
211
|
try {
|
|
212
212
|
return n.createPolicy(c, {
|
|
213
213
|
createHTML(d) {
|
|
@@ -220,7 +220,7 @@ const rn = B(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
220
220
|
} catch {
|
|
221
221
|
return console.warn("TrustedTypes policy " + c + " could not be created."), null;
|
|
222
222
|
}
|
|
223
|
-
},
|
|
223
|
+
}, un = function() {
|
|
224
224
|
return {
|
|
225
225
|
afterSanitizeAttributes: [],
|
|
226
226
|
afterSanitizeElements: [],
|
|
@@ -233,26 +233,26 @@ const rn = B(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
233
233
|
uponSanitizeShadowNode: []
|
|
234
234
|
};
|
|
235
235
|
};
|
|
236
|
-
function
|
|
237
|
-
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
238
|
-
const n = (g) =>
|
|
236
|
+
function Cn() {
|
|
237
|
+
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Li();
|
|
238
|
+
const n = (g) => Cn(g);
|
|
239
239
|
if (n.version = "3.4.5", n.removed = [], !t || !t.document || t.document.nodeType !== Se.document || !t.Element)
|
|
240
240
|
return n.isSupported = !1, n;
|
|
241
241
|
let i = t.document;
|
|
242
|
-
const
|
|
242
|
+
const o = i, l = o.currentScript, c = t.DocumentFragment, d = t.HTMLTemplateElement, p = t.Node, m = t.Element, f = t.NodeFilter, h = t.NamedNodeMap, C = h === void 0 ? t.NamedNodeMap || t.MozNamedAttrMap : h, I = t.HTMLFormElement, w = t.DOMParser, y = t.trustedTypes, X = m.prototype, fe = de(X, "cloneNode"), le = de(X, "remove"), M = de(X, "nextSibling"), ie = de(X, "childNodes"), N = de(X, "parentNode"), ce = p && p.prototype ? de(p.prototype, "nodeType") : null;
|
|
243
243
|
if (typeof d == "function") {
|
|
244
244
|
const g = i.createElement("template");
|
|
245
245
|
g.content && g.content.ownerDocument && (i = g.content.ownerDocument);
|
|
246
246
|
}
|
|
247
|
-
let E,
|
|
248
|
-
const ee = i, Ie = ee.implementation, xe = ee.createNodeIterator,
|
|
249
|
-
let j =
|
|
250
|
-
n.isSupported = typeof
|
|
251
|
-
const ke =
|
|
252
|
-
let
|
|
253
|
-
const
|
|
254
|
-
let
|
|
255
|
-
const
|
|
247
|
+
let E, v = "";
|
|
248
|
+
const ee = i, Ie = ee.implementation, xe = ee.createNodeIterator, Ke = ee.createDocumentFragment, Ze = ee.getElementsByTagName, Qe = o.importNode;
|
|
249
|
+
let j = un();
|
|
250
|
+
n.isSupported = typeof In == "function" && typeof N == "function" && Ie && Ie.createHTMLDocument !== void 0;
|
|
251
|
+
const ke = Ei, Me = Ii, Pe = wi, vn = Ci, On = Di, Ln = Ri, Ct = Ni, xn = Oi;
|
|
252
|
+
let Dt = mn, P = null;
|
|
253
|
+
const Rt = T({}, [...an, ...pt, ...gt, ...ht, ...sn]);
|
|
254
|
+
let z = null;
|
|
255
|
+
const Nt = T({}, [...ln, ...bt, ...cn, ...We]);
|
|
256
256
|
let R = Object.seal(_e(null, {
|
|
257
257
|
tagNameCheck: {
|
|
258
258
|
writable: !0,
|
|
@@ -273,7 +273,7 @@ function _n() {
|
|
|
273
273
|
value: !1
|
|
274
274
|
}
|
|
275
275
|
})), we = null, Fe = null;
|
|
276
|
-
const
|
|
276
|
+
const re = Object.seal(_e(null, {
|
|
277
277
|
tagCheck: {
|
|
278
278
|
writable: !0,
|
|
279
279
|
configurable: !1,
|
|
@@ -287,104 +287,104 @@ function _n() {
|
|
|
287
287
|
value: null
|
|
288
288
|
}
|
|
289
289
|
}));
|
|
290
|
-
let
|
|
291
|
-
const
|
|
292
|
-
let
|
|
293
|
-
const
|
|
294
|
-
let
|
|
295
|
-
const
|
|
296
|
-
let
|
|
297
|
-
const
|
|
298
|
-
let he = J, ot = !1,
|
|
299
|
-
const
|
|
300
|
-
let st = T({}, ["mi", "mo", "mn", "ms", "mtext"]),
|
|
301
|
-
const
|
|
290
|
+
let vt = !0, Je = !0, Ot = !1, Lt = !0, oe = !1, Ce = !0, me = !1, et = !1, tt = !1, pe = !1, ze = !1, Ue = !1, xt = !0, kt = !1;
|
|
291
|
+
const Mt = "user-content-";
|
|
292
|
+
let nt = !0, De = !1, ge = {}, Q = null;
|
|
293
|
+
const it = T({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
294
|
+
let Pt = null;
|
|
295
|
+
const Ft = T({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
296
|
+
let rt = null;
|
|
297
|
+
const zt = T({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), je = "http://www.w3.org/1998/Math/MathML", He = "http://www.w3.org/2000/svg", J = "http://www.w3.org/1999/xhtml";
|
|
298
|
+
let he = J, ot = !1, at = null;
|
|
299
|
+
const kn = T({}, [je, He, J], ft);
|
|
300
|
+
let st = T({}, ["mi", "mo", "mn", "ms", "mtext"]), lt = T({}, ["annotation-xml"]);
|
|
301
|
+
const Mn = T({}, ["title", "style", "font", "a", "script"]);
|
|
302
302
|
let Re = null;
|
|
303
|
-
const
|
|
303
|
+
const Pn = ["application/xhtml+xml", "text/html"], Fn = "text/html";
|
|
304
304
|
let k = null, be = null;
|
|
305
|
-
const
|
|
305
|
+
const zn = i.createElement("form"), Ut = function(e) {
|
|
306
306
|
return e instanceof RegExp || e instanceof Function;
|
|
307
|
-
},
|
|
307
|
+
}, ct = function() {
|
|
308
308
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
309
309
|
if (be && be === e)
|
|
310
310
|
return;
|
|
311
311
|
(!e || typeof e != "object") && (e = {}), e = W(e), Re = // eslint-disable-next-line unicorn/prefer-includes
|
|
312
|
-
|
|
313
|
-
const
|
|
314
|
-
if (R = _e(null), D(
|
|
312
|
+
Pn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? Fn : e.PARSER_MEDIA_TYPE, k = Re === "application/xhtml+xml" ? ft : ve, P = D(e, "ALLOWED_TAGS") && H(e.ALLOWED_TAGS) ? T({}, e.ALLOWED_TAGS, k) : Rt, z = D(e, "ALLOWED_ATTR") && H(e.ALLOWED_ATTR) ? T({}, e.ALLOWED_ATTR, k) : Nt, at = D(e, "ALLOWED_NAMESPACES") && H(e.ALLOWED_NAMESPACES) ? T({}, e.ALLOWED_NAMESPACES, ft) : kn, rt = D(e, "ADD_URI_SAFE_ATTR") && H(e.ADD_URI_SAFE_ATTR) ? T(W(zt), e.ADD_URI_SAFE_ATTR, k) : zt, Pt = D(e, "ADD_DATA_URI_TAGS") && H(e.ADD_DATA_URI_TAGS) ? T(W(Ft), e.ADD_DATA_URI_TAGS, k) : Ft, Q = D(e, "FORBID_CONTENTS") && H(e.FORBID_CONTENTS) ? T({}, e.FORBID_CONTENTS, k) : it, we = D(e, "FORBID_TAGS") && H(e.FORBID_TAGS) ? T({}, e.FORBID_TAGS, k) : W({}), Fe = D(e, "FORBID_ATTR") && H(e.FORBID_ATTR) ? T({}, e.FORBID_ATTR, k) : W({}), ge = D(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? W(e.USE_PROFILES) : e.USE_PROFILES : !1, vt = e.ALLOW_ARIA_ATTR !== !1, Je = e.ALLOW_DATA_ATTR !== !1, Ot = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Lt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, oe = e.SAFE_FOR_TEMPLATES || !1, Ce = e.SAFE_FOR_XML !== !1, me = e.WHOLE_DOCUMENT || !1, pe = e.RETURN_DOM || !1, ze = e.RETURN_DOM_FRAGMENT || !1, Ue = e.RETURN_TRUSTED_TYPE || !1, tt = e.FORCE_BODY || !1, xt = e.SANITIZE_DOM !== !1, kt = e.SANITIZE_NAMED_PROPS || !1, nt = e.KEEP_CONTENT !== !1, De = e.IN_PLACE || !1, Dt = Ai(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : mn, he = typeof e.NAMESPACE == "string" ? e.NAMESPACE : J, st = D(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? W(e.MATHML_TEXT_INTEGRATION_POINTS) : T({}, ["mi", "mo", "mn", "ms", "mtext"]), lt = D(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? W(e.HTML_INTEGRATION_POINTS) : T({}, ["annotation-xml"]);
|
|
313
|
+
const s = D(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? W(e.CUSTOM_ELEMENT_HANDLING) : _e(null);
|
|
314
|
+
if (R = _e(null), D(s, "tagNameCheck") && Ut(s.tagNameCheck) && (R.tagNameCheck = s.tagNameCheck), D(s, "attributeNameCheck") && Ut(s.attributeNameCheck) && (R.attributeNameCheck = s.attributeNameCheck), D(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (R.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), oe && (Je = !1), ze && (pe = !0), ge && (P = T({}, sn), z = _e(null), ge.html === !0 && (T(P, an), T(z, ln)), ge.svg === !0 && (T(P, pt), T(z, bt), T(z, We)), ge.svgFilters === !0 && (T(P, gt), T(z, bt), T(z, We)), ge.mathMl === !0 && (T(P, ht), T(z, cn), T(z, We))), re.tagCheck = null, re.attributeCheck = null, D(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? re.tagCheck = e.ADD_TAGS : H(e.ADD_TAGS) && (P === Rt && (P = W(P)), T(P, e.ADD_TAGS, k))), D(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? re.attributeCheck = e.ADD_ATTR : H(e.ADD_ATTR) && (z === Nt && (z = W(z)), T(z, e.ADD_ATTR, k))), D(e, "ADD_URI_SAFE_ATTR") && H(e.ADD_URI_SAFE_ATTR) && T(rt, e.ADD_URI_SAFE_ATTR, k), D(e, "FORBID_CONTENTS") && H(e.FORBID_CONTENTS) && (Q === it && (Q = W(Q)), T(Q, e.FORBID_CONTENTS, k)), D(e, "ADD_FORBID_CONTENTS") && H(e.ADD_FORBID_CONTENTS) && (Q === it && (Q = W(Q)), T(Q, e.ADD_FORBID_CONTENTS, k)), nt && (P["#text"] = !0), me && T(P, ["html", "head", "body"]), P.table && (T(P, ["tbody"]), delete we.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
315
315
|
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
316
316
|
throw Ge('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
317
317
|
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
318
318
|
throw Ge('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
319
|
-
E = e.TRUSTED_TYPES_POLICY,
|
|
319
|
+
E = e.TRUSTED_TYPES_POLICY, v = E.createHTML("");
|
|
320
320
|
} else
|
|
321
|
-
E === void 0 && (E =
|
|
321
|
+
E === void 0 && (E = xi(y, l)), E !== null && typeof v == "string" && (v = E.createHTML(""));
|
|
322
322
|
B && B(e), be = e;
|
|
323
|
-
},
|
|
324
|
-
let
|
|
325
|
-
(!
|
|
323
|
+
}, jt = T({}, [...pt, ...gt, ...Si]), Ht = T({}, [...ht, ..._i]), Un = function(e) {
|
|
324
|
+
let s = N(e);
|
|
325
|
+
(!s || !s.tagName) && (s = {
|
|
326
326
|
namespaceURI: he,
|
|
327
327
|
tagName: "template"
|
|
328
328
|
});
|
|
329
|
-
const u =
|
|
330
|
-
return
|
|
331
|
-
},
|
|
329
|
+
const u = ve(e.tagName), A = ve(s.tagName);
|
|
330
|
+
return at[e.namespaceURI] ? e.namespaceURI === He ? s.namespaceURI === J ? u === "svg" : s.namespaceURI === je ? u === "svg" && (A === "annotation-xml" || st[A]) : !!jt[u] : e.namespaceURI === je ? s.namespaceURI === J ? u === "math" : s.namespaceURI === He ? u === "math" && lt[A] : !!Ht[u] : e.namespaceURI === J ? s.namespaceURI === He && !lt[A] || s.namespaceURI === je && !st[A] ? !1 : !Ht[u] && (Mn[u] || !jt[u]) : !!(Re === "application/xhtml+xml" && at[e.namespaceURI]) : !1;
|
|
331
|
+
}, K = function(e) {
|
|
332
332
|
ye(n.removed, {
|
|
333
333
|
element: e
|
|
334
334
|
});
|
|
335
335
|
try {
|
|
336
|
-
|
|
336
|
+
N(e).removeChild(e);
|
|
337
337
|
} catch {
|
|
338
338
|
le(e);
|
|
339
339
|
}
|
|
340
|
-
}, ue = function(e,
|
|
340
|
+
}, ue = function(e, s) {
|
|
341
341
|
try {
|
|
342
342
|
ye(n.removed, {
|
|
343
|
-
attribute:
|
|
344
|
-
from:
|
|
343
|
+
attribute: s.getAttributeNode(e),
|
|
344
|
+
from: s
|
|
345
345
|
});
|
|
346
346
|
} catch {
|
|
347
347
|
ye(n.removed, {
|
|
348
348
|
attribute: null,
|
|
349
|
-
from:
|
|
349
|
+
from: s
|
|
350
350
|
});
|
|
351
351
|
}
|
|
352
|
-
if (
|
|
353
|
-
if (pe ||
|
|
352
|
+
if (s.removeAttribute(e), e === "is")
|
|
353
|
+
if (pe || ze)
|
|
354
354
|
try {
|
|
355
|
-
|
|
355
|
+
K(s);
|
|
356
356
|
} catch {
|
|
357
357
|
}
|
|
358
358
|
else
|
|
359
359
|
try {
|
|
360
|
-
|
|
360
|
+
s.setAttribute(e, "");
|
|
361
361
|
} catch {
|
|
362
362
|
}
|
|
363
|
-
},
|
|
364
|
-
let
|
|
365
|
-
if (
|
|
363
|
+
}, $t = function(e) {
|
|
364
|
+
let s = null, u = null;
|
|
365
|
+
if (tt)
|
|
366
366
|
e = "<remove></remove>" + e;
|
|
367
367
|
else {
|
|
368
|
-
const L =
|
|
368
|
+
const L = tn(e, /^[\r\n\t ]+/);
|
|
369
369
|
u = L && L[0];
|
|
370
370
|
}
|
|
371
371
|
Re === "application/xhtml+xml" && he === J && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
|
|
372
372
|
const A = E ? E.createHTML(e) : e;
|
|
373
373
|
if (he === J)
|
|
374
374
|
try {
|
|
375
|
-
|
|
375
|
+
s = new w().parseFromString(A, Re);
|
|
376
376
|
} catch {
|
|
377
377
|
}
|
|
378
|
-
if (!
|
|
379
|
-
|
|
378
|
+
if (!s || !s.documentElement) {
|
|
379
|
+
s = Ie.createDocument(he, "template", null);
|
|
380
380
|
try {
|
|
381
|
-
|
|
381
|
+
s.documentElement.innerHTML = ot ? v : A;
|
|
382
382
|
} catch {
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
|
-
const
|
|
386
|
-
return e && u &&
|
|
387
|
-
},
|
|
385
|
+
const O = s.body || s.documentElement;
|
|
386
|
+
return e && u && O.insertBefore(i.createTextNode(u), O.childNodes[0] || null), he === J ? Ze.call(s, me ? "html" : "body")[0] : me ? s.documentElement : O;
|
|
387
|
+
}, Bt = function(e) {
|
|
388
388
|
return xe.call(
|
|
389
389
|
e.ownerDocument || e,
|
|
390
390
|
e,
|
|
@@ -392,23 +392,23 @@ function _n() {
|
|
|
392
392
|
f.SHOW_ELEMENT | f.SHOW_COMMENT | f.SHOW_TEXT | f.SHOW_PROCESSING_INSTRUCTION | f.SHOW_CDATA_SECTION,
|
|
393
393
|
null
|
|
394
394
|
);
|
|
395
|
-
},
|
|
395
|
+
}, Gt = function(e) {
|
|
396
396
|
e.normalize();
|
|
397
|
-
const
|
|
397
|
+
const s = xe.call(
|
|
398
398
|
e.ownerDocument || e,
|
|
399
399
|
e,
|
|
400
400
|
// eslint-disable-next-line no-bitwise
|
|
401
401
|
f.SHOW_TEXT | f.SHOW_COMMENT | f.SHOW_CDATA_SECTION | f.SHOW_PROCESSING_INSTRUCTION,
|
|
402
402
|
null
|
|
403
403
|
);
|
|
404
|
-
let u =
|
|
404
|
+
let u = s.nextNode();
|
|
405
405
|
for (; u; ) {
|
|
406
406
|
let A = u.data;
|
|
407
|
-
Te([ke, Me, Pe], (
|
|
408
|
-
A = Ae(A,
|
|
409
|
-
}), u.data = A, u =
|
|
407
|
+
Te([ke, Me, Pe], (O) => {
|
|
408
|
+
A = Ae(A, O, " ");
|
|
409
|
+
}), u.data = A, u = s.nextNode();
|
|
410
410
|
}
|
|
411
|
-
},
|
|
411
|
+
}, mt = function(e) {
|
|
412
412
|
return e instanceof I && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof C) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
|
|
413
413
|
}, $e = function(e) {
|
|
414
414
|
if (!ce || typeof e != "object" || e === null)
|
|
@@ -419,60 +419,60 @@ function _n() {
|
|
|
419
419
|
return !1;
|
|
420
420
|
}
|
|
421
421
|
};
|
|
422
|
-
function te(g, e,
|
|
422
|
+
function te(g, e, s) {
|
|
423
423
|
Te(g, (u) => {
|
|
424
|
-
u.call(n, e,
|
|
424
|
+
u.call(n, e, s, be);
|
|
425
425
|
});
|
|
426
426
|
}
|
|
427
|
-
const
|
|
428
|
-
let
|
|
429
|
-
if (te(j.beforeSanitizeElements, e, null),
|
|
430
|
-
return
|
|
427
|
+
const Wt = function(e) {
|
|
428
|
+
let s = null;
|
|
429
|
+
if (te(j.beforeSanitizeElements, e, null), mt(e))
|
|
430
|
+
return K(e), !0;
|
|
431
431
|
const u = k(e.nodeName);
|
|
432
432
|
if (te(j.uponSanitizeElement, e, {
|
|
433
433
|
tagName: u,
|
|
434
434
|
allowedTags: P
|
|
435
|
-
}), Ce && e.hasChildNodes() && !$e(e.firstElementChild) &&
|
|
436
|
-
return
|
|
437
|
-
if (we[u] || !(
|
|
438
|
-
if (!we[u] &&
|
|
435
|
+
}), Ce && e.hasChildNodes() && !$e(e.firstElementChild) && U(/<[/\w!]/g, e.innerHTML) && U(/<[/\w!]/g, e.textContent) || Ce && e.namespaceURI === J && u === "style" && $e(e.firstElementChild) || e.nodeType === Se.progressingInstruction || Ce && e.nodeType === Se.comment && U(/<[/\w]/g, e.data))
|
|
436
|
+
return K(e), !0;
|
|
437
|
+
if (we[u] || !(re.tagCheck instanceof Function && re.tagCheck(u)) && !P[u]) {
|
|
438
|
+
if (!we[u] && Vt(u) && (R.tagNameCheck instanceof RegExp && U(R.tagNameCheck, u) || R.tagNameCheck instanceof Function && R.tagNameCheck(u)))
|
|
439
439
|
return !1;
|
|
440
|
-
if (
|
|
441
|
-
const A =
|
|
442
|
-
if (
|
|
443
|
-
const L =
|
|
440
|
+
if (nt && !Q[u]) {
|
|
441
|
+
const A = N(e) || e.parentNode, O = ie(e) || e.childNodes;
|
|
442
|
+
if (O && A) {
|
|
443
|
+
const L = O.length;
|
|
444
444
|
for (let G = L - 1; G >= 0; --G) {
|
|
445
|
-
const
|
|
446
|
-
A.insertBefore(
|
|
445
|
+
const ae = fe(O[G], !0);
|
|
446
|
+
A.insertBefore(ae, M(e));
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
|
-
return
|
|
450
|
+
return K(e), !0;
|
|
451
451
|
}
|
|
452
|
-
return e instanceof m && !
|
|
453
|
-
|
|
454
|
-
}), e.textContent !==
|
|
452
|
+
return e instanceof m && !Un(e) || (u === "noscript" || u === "noembed" || u === "noframes") && U(/<\/no(script|embed|frames)/i, e.innerHTML) ? (K(e), !0) : (oe && e.nodeType === Se.text && (s = e.textContent, Te([ke, Me, Pe], (A) => {
|
|
453
|
+
s = Ae(s, A, " ");
|
|
454
|
+
}), e.textContent !== s && (ye(n.removed, {
|
|
455
455
|
element: e.cloneNode()
|
|
456
|
-
}), e.textContent =
|
|
457
|
-
},
|
|
458
|
-
if (Fe[
|
|
456
|
+
}), e.textContent = s)), te(j.afterSanitizeElements, e, null), !1);
|
|
457
|
+
}, qt = function(e, s, u) {
|
|
458
|
+
if (Fe[s] || xt && (s === "id" || s === "name") && (u in i || u in zn))
|
|
459
459
|
return !1;
|
|
460
|
-
const A =
|
|
461
|
-
if (!(
|
|
462
|
-
if (!(
|
|
463
|
-
if (!A || Fe[
|
|
460
|
+
const A = z[s] || re.attributeCheck instanceof Function && re.attributeCheck(s, e);
|
|
461
|
+
if (!(Je && !Fe[s] && U(vn, s))) {
|
|
462
|
+
if (!(vt && U(On, s))) {
|
|
463
|
+
if (!A || Fe[s]) {
|
|
464
464
|
if (
|
|
465
465
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
466
466
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
467
467
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
468
|
-
!(
|
|
468
|
+
!(Vt(e) && (R.tagNameCheck instanceof RegExp && U(R.tagNameCheck, e) || R.tagNameCheck instanceof Function && R.tagNameCheck(e)) && (R.attributeNameCheck instanceof RegExp && U(R.attributeNameCheck, s) || R.attributeNameCheck instanceof Function && R.attributeNameCheck(s, e)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
469
469
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
470
|
-
|
|
470
|
+
s === "is" && R.allowCustomizedBuiltInElements && (R.tagNameCheck instanceof RegExp && U(R.tagNameCheck, u) || R.tagNameCheck instanceof Function && R.tagNameCheck(u)))
|
|
471
471
|
) return !1;
|
|
472
|
-
} else if (!
|
|
473
|
-
if (!
|
|
474
|
-
if (!((
|
|
475
|
-
if (!(
|
|
472
|
+
} else if (!rt[s]) {
|
|
473
|
+
if (!U(Dt, Ae(u, Ct, ""))) {
|
|
474
|
+
if (!((s === "src" || s === "xlink:href" || s === "href") && e !== "script" && nn(u, "data:") === 0 && Pt[e])) {
|
|
475
|
+
if (!(Ot && !U(Ln, Ae(u, Ct, "")))) {
|
|
476
476
|
if (u)
|
|
477
477
|
return !1;
|
|
478
478
|
}
|
|
@@ -482,29 +482,29 @@ function _n() {
|
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
484
|
return !0;
|
|
485
|
-
},
|
|
486
|
-
return !
|
|
485
|
+
}, jn = T({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), Vt = function(e) {
|
|
486
|
+
return !jn[ve(e)] && U(xn, e);
|
|
487
487
|
}, Yt = function(e) {
|
|
488
488
|
te(j.beforeSanitizeAttributes, e, null);
|
|
489
|
-
const
|
|
490
|
-
if (!
|
|
489
|
+
const s = e.attributes;
|
|
490
|
+
if (!s || mt(e))
|
|
491
491
|
return;
|
|
492
492
|
const u = {
|
|
493
493
|
attrName: "",
|
|
494
494
|
attrValue: "",
|
|
495
495
|
keepAttr: !0,
|
|
496
|
-
allowedAttributes:
|
|
496
|
+
allowedAttributes: z,
|
|
497
497
|
forceKeepAttr: void 0
|
|
498
498
|
};
|
|
499
|
-
let A =
|
|
499
|
+
let A = s.length;
|
|
500
500
|
for (; A--; ) {
|
|
501
|
-
const
|
|
502
|
-
let F = L === "value" ?
|
|
503
|
-
if (u.attrName = ne, u.attrValue = F, u.keepAttr = !0, u.forceKeepAttr = void 0, te(j.uponSanitizeAttribute, e, u), F = u.attrValue,
|
|
501
|
+
const O = s[A], L = O.name, G = O.namespaceURI, ae = O.value, ne = k(L), dt = ae;
|
|
502
|
+
let F = L === "value" ? dt : pi(dt);
|
|
503
|
+
if (u.attrName = ne, u.attrValue = F, u.keepAttr = !0, u.forceKeepAttr = void 0, te(j.uponSanitizeAttribute, e, u), F = u.attrValue, kt && (ne === "id" || ne === "name") && nn(F, Mt) !== 0 && (ue(L, e), F = Mt + F), Ce && U(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, F)) {
|
|
504
504
|
ue(L, e);
|
|
505
505
|
continue;
|
|
506
506
|
}
|
|
507
|
-
if (ne === "attributename" &&
|
|
507
|
+
if (ne === "attributename" && tn(F, "href")) {
|
|
508
508
|
ue(L, e);
|
|
509
509
|
continue;
|
|
510
510
|
}
|
|
@@ -514,20 +514,20 @@ function _n() {
|
|
|
514
514
|
ue(L, e);
|
|
515
515
|
continue;
|
|
516
516
|
}
|
|
517
|
-
if (!
|
|
517
|
+
if (!Lt && U(/\/>/i, F)) {
|
|
518
518
|
ue(L, e);
|
|
519
519
|
continue;
|
|
520
520
|
}
|
|
521
|
-
|
|
522
|
-
F = Ae(F,
|
|
521
|
+
oe && Te([ke, Me, Pe], (Kt) => {
|
|
522
|
+
F = Ae(F, Kt, " ");
|
|
523
523
|
});
|
|
524
|
-
const
|
|
525
|
-
if (!
|
|
524
|
+
const Xt = k(e.nodeName);
|
|
525
|
+
if (!qt(Xt, ne, F)) {
|
|
526
526
|
ue(L, e);
|
|
527
527
|
continue;
|
|
528
528
|
}
|
|
529
529
|
if (E && typeof y == "object" && typeof y.getAttributeType == "function" && !G)
|
|
530
|
-
switch (y.getAttributeType(
|
|
530
|
+
switch (y.getAttributeType(Xt, ne)) {
|
|
531
531
|
case "TrustedHTML": {
|
|
532
532
|
F = E.createHTML(F);
|
|
533
533
|
break;
|
|
@@ -537,102 +537,160 @@ function _n() {
|
|
|
537
537
|
break;
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
|
-
if (F !==
|
|
540
|
+
if (F !== dt)
|
|
541
541
|
try {
|
|
542
|
-
G ? e.setAttributeNS(G, L, F) : e.setAttribute(L, F),
|
|
542
|
+
G ? e.setAttributeNS(G, L, F) : e.setAttribute(L, F), mt(e) ? K(e) : en(n.removed);
|
|
543
543
|
} catch {
|
|
544
544
|
ue(L, e);
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
547
|
te(j.afterSanitizeAttributes, e, null);
|
|
548
|
-
},
|
|
549
|
-
let
|
|
550
|
-
const u =
|
|
551
|
-
for (te(j.beforeSanitizeShadowDOM, e, null);
|
|
552
|
-
te(j.uponSanitizeShadowNode,
|
|
548
|
+
}, ut = function(e) {
|
|
549
|
+
let s = null;
|
|
550
|
+
const u = Bt(e);
|
|
551
|
+
for (te(j.beforeSanitizeShadowDOM, e, null); s = u.nextNode(); )
|
|
552
|
+
te(j.uponSanitizeShadowNode, s, null), Wt(s), Yt(s), s.content instanceof c && ut(s.content);
|
|
553
553
|
te(j.afterSanitizeShadowDOM, e, null);
|
|
554
554
|
}, Be = function(e) {
|
|
555
555
|
if (e.nodeType === Se.element && e.shadowRoot instanceof c) {
|
|
556
556
|
const A = e.shadowRoot;
|
|
557
|
-
Be(A),
|
|
557
|
+
Be(A), ut(A);
|
|
558
558
|
}
|
|
559
|
-
const
|
|
560
|
-
if (!
|
|
559
|
+
const s = e.childNodes;
|
|
560
|
+
if (!s)
|
|
561
561
|
return;
|
|
562
562
|
const u = [];
|
|
563
|
-
Te(
|
|
563
|
+
Te(s, (A) => {
|
|
564
564
|
ye(u, A);
|
|
565
565
|
});
|
|
566
566
|
for (const A of u)
|
|
567
567
|
Be(A);
|
|
568
568
|
};
|
|
569
569
|
return n.sanitize = function(g) {
|
|
570
|
-
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {},
|
|
571
|
-
if (ot = !g, ot && (g = "<!-->"), typeof g != "string" && !$e(g) && (g =
|
|
570
|
+
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, u = null, A = null, O = null;
|
|
571
|
+
if (ot = !g, ot && (g = "<!-->"), typeof g != "string" && !$e(g) && (g = yi(g), typeof g != "string"))
|
|
572
572
|
throw Ge("dirty is not a string, aborting");
|
|
573
573
|
if (!n.isSupported)
|
|
574
574
|
return g;
|
|
575
|
-
if (
|
|
576
|
-
const
|
|
577
|
-
if (typeof
|
|
578
|
-
const ne = k(
|
|
575
|
+
if (et || ct(e), n.removed = [], typeof g == "string" && (De = !1), De) {
|
|
576
|
+
const ae = g.nodeName;
|
|
577
|
+
if (typeof ae == "string") {
|
|
578
|
+
const ne = k(ae);
|
|
579
579
|
if (!P[ne] || we[ne])
|
|
580
580
|
throw Ge("root node is forbidden and cannot be sanitized in-place");
|
|
581
581
|
}
|
|
582
582
|
Be(g);
|
|
583
583
|
} else if ($e(g))
|
|
584
|
-
|
|
584
|
+
s = $t("<!---->"), u = s.ownerDocument.importNode(g, !0), u.nodeType === Se.element && u.nodeName === "BODY" || u.nodeName === "HTML" ? s = u : s.appendChild(u), Be(u);
|
|
585
585
|
else {
|
|
586
|
-
if (!pe && !
|
|
586
|
+
if (!pe && !oe && !me && // eslint-disable-next-line unicorn/prefer-includes
|
|
587
587
|
g.indexOf("<") === -1)
|
|
588
|
-
return E &&
|
|
589
|
-
if (
|
|
590
|
-
return pe ? null :
|
|
588
|
+
return E && Ue ? E.createHTML(g) : g;
|
|
589
|
+
if (s = $t(g), !s)
|
|
590
|
+
return pe ? null : Ue ? v : "";
|
|
591
591
|
}
|
|
592
|
-
|
|
593
|
-
const L =
|
|
592
|
+
s && tt && K(s.firstChild);
|
|
593
|
+
const L = Bt(De ? g : s);
|
|
594
594
|
for (; A = L.nextNode(); )
|
|
595
|
-
|
|
595
|
+
Wt(A), Yt(A), A.content instanceof c && ut(A.content);
|
|
596
596
|
if (De)
|
|
597
|
-
return
|
|
597
|
+
return oe && Gt(g), g;
|
|
598
598
|
if (pe) {
|
|
599
|
-
if (
|
|
600
|
-
for (
|
|
601
|
-
|
|
599
|
+
if (oe && Gt(s), ze)
|
|
600
|
+
for (O = Ke.call(s.ownerDocument); s.firstChild; )
|
|
601
|
+
O.appendChild(s.firstChild);
|
|
602
602
|
else
|
|
603
|
-
|
|
604
|
-
return (
|
|
603
|
+
O = s;
|
|
604
|
+
return (z.shadowroot || z.shadowrootmode) && (O = Qe.call(o, O, !0)), O;
|
|
605
605
|
}
|
|
606
|
-
let G = me ?
|
|
607
|
-
return me && P["!doctype"] &&
|
|
608
|
-
` + G),
|
|
609
|
-
G = Ae(G,
|
|
610
|
-
}), E &&
|
|
606
|
+
let G = me ? s.outerHTML : s.innerHTML;
|
|
607
|
+
return me && P["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && U(vi, s.ownerDocument.doctype.name) && (G = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
|
|
608
|
+
` + G), oe && Te([ke, Me, Pe], (ae) => {
|
|
609
|
+
G = Ae(G, ae, " ");
|
|
610
|
+
}), E && Ue ? E.createHTML(G) : G;
|
|
611
611
|
}, n.setConfig = function() {
|
|
612
612
|
let g = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
613
|
-
|
|
613
|
+
ct(g), et = !0;
|
|
614
614
|
}, n.clearConfig = function() {
|
|
615
|
-
be = null,
|
|
616
|
-
}, n.isValidAttribute = function(g, e,
|
|
617
|
-
be ||
|
|
615
|
+
be = null, et = !1;
|
|
616
|
+
}, n.isValidAttribute = function(g, e, s) {
|
|
617
|
+
be || ct({});
|
|
618
618
|
const u = k(g), A = k(e);
|
|
619
|
-
return
|
|
619
|
+
return qt(u, A, s);
|
|
620
620
|
}, n.addHook = function(g, e) {
|
|
621
621
|
typeof e == "function" && ye(j[g], e);
|
|
622
622
|
}, n.removeHook = function(g, e) {
|
|
623
623
|
if (e !== void 0) {
|
|
624
|
-
const
|
|
625
|
-
return
|
|
624
|
+
const s = di(j[g], e);
|
|
625
|
+
return s === -1 ? void 0 : fi(j[g], s, 1)[0];
|
|
626
626
|
}
|
|
627
|
-
return
|
|
627
|
+
return en(j[g]);
|
|
628
628
|
}, n.removeHooks = function(g) {
|
|
629
629
|
j[g] = [];
|
|
630
630
|
}, n.removeAllHooks = function() {
|
|
631
|
-
j =
|
|
631
|
+
j = un();
|
|
632
632
|
}, n;
|
|
633
633
|
}
|
|
634
|
-
var
|
|
635
|
-
const
|
|
634
|
+
var Tt = Cn();
|
|
635
|
+
const dn = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "tel:"]), qe = "http://platform-sanitize.invalid/", fn = /^\s*\/\//, pn = (
|
|
636
|
+
// oxlint-disable-next-line no-control-regex -- intentional security guard
|
|
637
|
+
/^[\u0000-\u0020\u007F-\u00A0\u2000-\u200F\u2028\u2029\u202F\u205F\u2060\u3000\uFEFF]*(?:javascript|data|vbscript|file):/i
|
|
638
|
+
), ki = {
|
|
639
|
+
colon: ":",
|
|
640
|
+
// javascript:alert(1) → javascript:alert(1)
|
|
641
|
+
sol: "/",
|
|
642
|
+
// //evil.com → //evil.com (protocol-relative)
|
|
643
|
+
bsol: "\\",
|
|
644
|
+
// \\evil.com → \\evil.com
|
|
645
|
+
Tab: " ",
|
|
646
|
+
// java	script: — WHATWG strips mid-scheme tabs
|
|
647
|
+
NewLine: `
|
|
648
|
+
`
|
|
649
|
+
// java
script:
|
|
650
|
+
};
|
|
651
|
+
function Mi(t) {
|
|
652
|
+
return t.replace(/&#(\d+);/g, (n, i) => {
|
|
653
|
+
const o = Number(i);
|
|
654
|
+
if (!Number.isFinite(o) || o < 0 || o > 1114111) return "";
|
|
655
|
+
try {
|
|
656
|
+
return String.fromCodePoint(o);
|
|
657
|
+
} catch {
|
|
658
|
+
return "";
|
|
659
|
+
}
|
|
660
|
+
}).replace(/&#x([\da-f]+);/gi, (n, i) => {
|
|
661
|
+
const o = parseInt(i, 16);
|
|
662
|
+
if (!Number.isFinite(o) || o < 0 || o > 1114111) return "";
|
|
663
|
+
try {
|
|
664
|
+
return String.fromCodePoint(o);
|
|
665
|
+
} catch {
|
|
666
|
+
return "";
|
|
667
|
+
}
|
|
668
|
+
}).replace(/&([A-Za-z][A-Za-z0-9]*);/g, (n, i) => ki[i] ?? n);
|
|
669
|
+
}
|
|
670
|
+
function Pi(t) {
|
|
671
|
+
if (!t || !t.trim()) return "about:blank";
|
|
672
|
+
const n = t.replace(/\\/g, "/");
|
|
673
|
+
if (fn.test(n) || pn.test(n)) return "about:blank";
|
|
674
|
+
if (/&[#A-Za-z]/.test(n)) {
|
|
675
|
+
const i = Mi(n);
|
|
676
|
+
if (fn.test(i) || pn.test(i))
|
|
677
|
+
return "about:blank";
|
|
678
|
+
try {
|
|
679
|
+
const o = new URL(i, qe);
|
|
680
|
+
if (!o.href.startsWith(qe) && !dn.has(o.protocol))
|
|
681
|
+
return "about:blank";
|
|
682
|
+
} catch {
|
|
683
|
+
return "about:blank";
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
try {
|
|
687
|
+
const i = new URL(n, qe);
|
|
688
|
+
return !dn.has(i.protocol) || (i.protocol === "http:" || i.protocol === "https:") && (i.username || i.password) ? "about:blank" : i.href.startsWith(qe) ? t : n.replace(/[\x00-\x1F\u2028\u2029]/g, "").replace(/%250[9ad]/gi, "").replace(/%0[9ad]/gi, "");
|
|
689
|
+
} catch {
|
|
690
|
+
return "about:blank";
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
const Fi = /* @__PURE__ */ new Set([
|
|
636
694
|
// layout
|
|
637
695
|
"display",
|
|
638
696
|
"float",
|
|
@@ -874,7 +932,7 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
874
932
|
"caret-color",
|
|
875
933
|
"accent-color",
|
|
876
934
|
"appearance"
|
|
877
|
-
]),
|
|
935
|
+
]), zi = /* @__PURE__ */ new Set([
|
|
878
936
|
"src",
|
|
879
937
|
"href",
|
|
880
938
|
"action",
|
|
@@ -885,7 +943,7 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
885
943
|
"cite",
|
|
886
944
|
"longdesc",
|
|
887
945
|
"xlink:href"
|
|
888
|
-
]),
|
|
946
|
+
]), Ui = ["content"], ji = /url\s*\(\s*['"]?(?:[a-z][a-z0-9+\-.]*:|\/\/)/i, Hi = /* @__PURE__ */ new Set([
|
|
889
947
|
"allow-downloads",
|
|
890
948
|
"allow-forms",
|
|
891
949
|
"allow-modals",
|
|
@@ -898,7 +956,14 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
898
956
|
"allow-scripts",
|
|
899
957
|
"allow-storage-access-by-user-activation",
|
|
900
958
|
"allow-top-navigation-by-user-activation"
|
|
901
|
-
]),
|
|
959
|
+
]), $i = {
|
|
960
|
+
"data-url": "data-custom-url",
|
|
961
|
+
"data-method": "data-custom-method",
|
|
962
|
+
"data-remote": "data-custom-remote",
|
|
963
|
+
"data-remove": "data-custom-remove",
|
|
964
|
+
"data-confirm": "data-custom-confirm",
|
|
965
|
+
"data-disable-with": "data-custom-disable-with"
|
|
966
|
+
}, Bi = /* @__PURE__ */ new Set(["data-item-href"]), Gi = {
|
|
902
967
|
// semantics and annotation are re-allowed because DOMPurify blocks all of
|
|
903
968
|
// mathMlDisallowed by default. semantics is a safe structural wrapper;
|
|
904
969
|
// annotation carries LaTeX source text (e.g. \frac{1}{2}); Canvas emits
|
|
@@ -963,10 +1028,6 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
963
1028
|
"intent",
|
|
964
1029
|
"arg"
|
|
965
1030
|
],
|
|
966
|
-
// Rails UJS turns data-method/data-remote/etc. on clickable elements into
|
|
967
|
-
// state-changing requests carrying the victim's CSRF token. Strip them so
|
|
968
|
-
// user-authored HTML cannot become a CSRF gadget when UJS is on the page.
|
|
969
|
-
FORBID_ATTR: ["data-method", "data-remote", "data-url", "data-confirm", "data-disable-with"],
|
|
970
1031
|
// In browsers that support the Trusted Types API (Chromium, Firefox),
|
|
971
1032
|
// DOMPurify returns a TrustedHTML object rather than a plain string. The
|
|
972
1033
|
// exported sanitizeHtml signature declares string — a deliberate lie that
|
|
@@ -982,17 +1043,17 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
982
1043
|
// confusion attacks where fragments like <svg> could influence parse context.
|
|
983
1044
|
FORCE_BODY: !0
|
|
984
1045
|
};
|
|
985
|
-
let
|
|
986
|
-
function
|
|
987
|
-
if (
|
|
988
|
-
|
|
1046
|
+
let q = null;
|
|
1047
|
+
function Wi() {
|
|
1048
|
+
if (q) return q;
|
|
1049
|
+
q = typeof Tt == "function" ? Tt(window) : Tt, q.addHook("afterSanitizeAttributes", (n) => {
|
|
989
1050
|
if (!(n instanceof Element) || !n.hasAttribute("style")) return;
|
|
990
|
-
const i = n.style,
|
|
1051
|
+
const i = n.style, o = [];
|
|
991
1052
|
for (let m = 0; m < i.length; m++) {
|
|
992
1053
|
const f = i.item(m);
|
|
993
|
-
|
|
1054
|
+
Fi.has(f) || o.push(f);
|
|
994
1055
|
}
|
|
995
|
-
for (const m of
|
|
1056
|
+
for (const m of o) i.removeProperty(m);
|
|
996
1057
|
const l = /* @__PURE__ */ new Set([
|
|
997
1058
|
"static",
|
|
998
1059
|
"relative",
|
|
@@ -1006,59 +1067,68 @@ function Pi() {
|
|
|
1006
1067
|
c && !l.has(c) && i.removeProperty("position");
|
|
1007
1068
|
const d = /* @__PURE__ */ new Set(["initial", "inherit", "unset", "revert", "revert-layer"]), p = i.getPropertyValue("opacity").trim().toLowerCase();
|
|
1008
1069
|
p && !d.has(p) && (p.endsWith("%") ? parseFloat(p) / 100 : parseFloat(p)) < 0.05 && i.removeProperty("opacity");
|
|
1009
|
-
for (const m of
|
|
1070
|
+
for (const m of Ui) {
|
|
1010
1071
|
const f = i.getPropertyValue(m);
|
|
1011
|
-
f &&
|
|
1072
|
+
f && ji.test(f) && i.removeProperty(m);
|
|
1012
1073
|
}
|
|
1013
1074
|
i.length === 0 && n.removeAttribute("style");
|
|
1014
|
-
}),
|
|
1015
|
-
if (!
|
|
1016
|
-
const
|
|
1017
|
-
/^\s*\/\//.test(
|
|
1018
|
-
}),
|
|
1075
|
+
}), q.addHook("uponSanitizeAttribute", (n, i) => {
|
|
1076
|
+
if (!zi.has(i.attrName)) return;
|
|
1077
|
+
const o = i.attrValue;
|
|
1078
|
+
/^\s*\/\//.test(o) ? (i.attrValue = o.trimStart().replace(/^\/\//, "https://"), i.keepAttr = !0) : /^\s*\\/.test(o) && (i.keepAttr = !1);
|
|
1079
|
+
}), q.addHook("uponSanitizeAttribute", (n, i) => {
|
|
1080
|
+
if (!Bi.has(i.attrName)) return;
|
|
1081
|
+
const o = i.attrValue;
|
|
1082
|
+
if (!o.trim()) return;
|
|
1083
|
+
const l = /^\s*\/\//.test(o) ? o.trimStart().replace(/^\/\//, "https://") : o;
|
|
1084
|
+
i.attrValue = Pi(l);
|
|
1085
|
+
}), q.addHook("uponSanitizeAttribute", (n, i) => {
|
|
1086
|
+
const o = $i[i.attrName];
|
|
1087
|
+
!o || !(n instanceof Element) || (n.hasAttribute(o) || n.setAttribute(o, i.attrValue), i.keepAttr = !1);
|
|
1088
|
+
}), q.addHook("afterSanitizeAttributes", (n) => {
|
|
1019
1089
|
if (!(n instanceof Element) || !n.hasAttribute("srcset")) return;
|
|
1020
|
-
const i = (n.getAttribute("srcset") ?? "").split(","),
|
|
1021
|
-
if (i.some((d) => /^\s*\\/.test(
|
|
1090
|
+
const i = (n.getAttribute("srcset") ?? "").split(","), o = (d) => d.trim().split(/\s+/)[0];
|
|
1091
|
+
if (i.some((d) => /^\s*\\/.test(o(d)))) {
|
|
1022
1092
|
n.removeAttribute("srcset");
|
|
1023
1093
|
return;
|
|
1024
1094
|
}
|
|
1025
1095
|
let l = !1;
|
|
1026
1096
|
const c = i.map((d) => {
|
|
1027
|
-
const p =
|
|
1097
|
+
const p = o(d);
|
|
1028
1098
|
if (!p.startsWith("//")) return d;
|
|
1029
1099
|
l = !0;
|
|
1030
1100
|
const m = d.indexOf(p);
|
|
1031
1101
|
return d.slice(0, m) + "https://" + p.slice(2) + d.slice(m + p.length);
|
|
1032
1102
|
});
|
|
1033
1103
|
l && n.setAttribute("srcset", c.join(","));
|
|
1034
|
-
}),
|
|
1104
|
+
}), q.addHook("afterSanitizeAttributes", (n) => {
|
|
1035
1105
|
var i;
|
|
1036
1106
|
if (!(n instanceof Element) || n.tagName !== "A" && n.tagName !== "AREA" || ((i = n.getAttribute("target")) == null ? void 0 : i.toLowerCase()) !== "_blank") return;
|
|
1037
|
-
const
|
|
1107
|
+
const o = n.getAttribute("rel") ?? "", l = new Set(o.split(/\s+/).filter(Boolean));
|
|
1038
1108
|
l.add("noopener"), n.setAttribute("rel", [...l].join(" "));
|
|
1039
|
-
}),
|
|
1109
|
+
}), q.addHook("afterSanitizeAttributes", (n) => {
|
|
1040
1110
|
if (!(n instanceof Element) || n.tagName !== "IFRAME" || !n.hasAttribute("sandbox")) return;
|
|
1041
|
-
const i = (n.getAttribute("sandbox") ?? "").toLowerCase().split(/\s+/).filter(Boolean),
|
|
1042
|
-
|
|
1043
|
-
}),
|
|
1111
|
+
const i = (n.getAttribute("sandbox") ?? "").toLowerCase().split(/\s+/).filter(Boolean), o = i.filter((l) => Hi.has(l));
|
|
1112
|
+
o.length !== i.length && n.setAttribute("sandbox", o.join(" "));
|
|
1113
|
+
}), q.addHook("afterSanitizeAttributes", (n) => {
|
|
1044
1114
|
if (!(n instanceof Element) || n.tagName !== "PARAM") return;
|
|
1045
1115
|
const i = n.getAttribute("value");
|
|
1046
1116
|
i && /^\s*(?:javascript|vbscript):/i.test(i) && n.removeAttribute("value");
|
|
1047
1117
|
});
|
|
1048
1118
|
const t = /* @__PURE__ */ new Set(["text/html", "application/xhtml+xml"]);
|
|
1049
|
-
return
|
|
1119
|
+
return q.addHook("afterSanitizeElements", (n) => {
|
|
1050
1120
|
if (!(n instanceof Element) || n.tagName.toLowerCase() !== "annotation-xml") return;
|
|
1051
1121
|
const i = (n.getAttribute("encoding") ?? "").toLowerCase().trim();
|
|
1052
1122
|
t.has(i) && n.remove();
|
|
1053
|
-
}),
|
|
1123
|
+
}), q;
|
|
1054
1124
|
}
|
|
1055
|
-
function
|
|
1125
|
+
function wt(t, n) {
|
|
1056
1126
|
if (typeof window > "u")
|
|
1057
1127
|
throw new Error("sanitizeHtml requires a DOM environment (window is not defined)");
|
|
1058
|
-
const i =
|
|
1059
|
-
return
|
|
1128
|
+
const i = Gi;
|
|
1129
|
+
return Wi().sanitize(t ?? "", i);
|
|
1060
1130
|
}
|
|
1061
|
-
const
|
|
1131
|
+
const qi = se`
|
|
1062
1132
|
query GetAssignment($courseId: ID!, $assignmentId: ID!, $userId: ID!) {
|
|
1063
1133
|
legacyNode(_id: $assignmentId, type: Assignment) {
|
|
1064
1134
|
... on Assignment {
|
|
@@ -1117,7 +1187,7 @@ const Fi = ae`
|
|
|
1117
1187
|
contentType
|
|
1118
1188
|
submissionPreviewUrl
|
|
1119
1189
|
}
|
|
1120
|
-
`,
|
|
1190
|
+
`, Vi = se`
|
|
1121
1191
|
query GetSubmissionComments(
|
|
1122
1192
|
$submissionId: ID!
|
|
1123
1193
|
$courseId: String
|
|
@@ -1166,7 +1236,7 @@ const Fi = ae`
|
|
|
1166
1236
|
}
|
|
1167
1237
|
}
|
|
1168
1238
|
}
|
|
1169
|
-
`,
|
|
1239
|
+
`, Yi = se`
|
|
1170
1240
|
query getSubmissions($submissionId: ID!) {
|
|
1171
1241
|
node(id: $submissionId) {
|
|
1172
1242
|
... on Submission {
|
|
@@ -1200,197 +1270,197 @@ const Fi = ae`
|
|
|
1200
1270
|
contentType
|
|
1201
1271
|
submissionPreviewUrl
|
|
1202
1272
|
}
|
|
1203
|
-
`,
|
|
1204
|
-
_id:
|
|
1205
|
-
displayName:
|
|
1206
|
-
id:
|
|
1207
|
-
mimeClass:
|
|
1208
|
-
url:
|
|
1209
|
-
contentType:
|
|
1210
|
-
submissionPreviewUrl:
|
|
1211
|
-
}),
|
|
1212
|
-
_id:
|
|
1213
|
-
activeSubmissionType:
|
|
1214
|
-
body:
|
|
1215
|
-
attachments:
|
|
1216
|
-
}),
|
|
1217
|
-
id:
|
|
1218
|
-
submittedAt:
|
|
1219
|
-
body:
|
|
1220
|
-
grade:
|
|
1221
|
-
score:
|
|
1222
|
-
submissionType:
|
|
1223
|
-
attempt:
|
|
1224
|
-
unreadCommentCount:
|
|
1225
|
-
attachment:
|
|
1226
|
-
attachments:
|
|
1227
|
-
submissionDraft:
|
|
1228
|
-
}),
|
|
1229
|
-
_id:
|
|
1230
|
-
name:
|
|
1231
|
-
description:
|
|
1232
|
-
allowedExtensions:
|
|
1233
|
-
allowedAttempts:
|
|
1234
|
-
dueAt:
|
|
1235
|
-
pointsPossible:
|
|
1236
|
-
submissionTypes:
|
|
1237
|
-
gradingType:
|
|
1238
|
-
published:
|
|
1239
|
-
submissionsConnection:
|
|
1240
|
-
nodes:
|
|
1273
|
+
`, Oe = r.object({
|
|
1274
|
+
_id: r.string(),
|
|
1275
|
+
displayName: r.string(),
|
|
1276
|
+
id: r.string(),
|
|
1277
|
+
mimeClass: r.string(),
|
|
1278
|
+
url: r.string(),
|
|
1279
|
+
contentType: r.string(),
|
|
1280
|
+
submissionPreviewUrl: r.string().nullable()
|
|
1281
|
+
}), Xi = r.object({
|
|
1282
|
+
_id: r.string(),
|
|
1283
|
+
activeSubmissionType: r.string(),
|
|
1284
|
+
body: r.string().nullable(),
|
|
1285
|
+
attachments: r.array(Oe).nullable()
|
|
1286
|
+
}), Ki = r.object({
|
|
1287
|
+
id: r.string(),
|
|
1288
|
+
submittedAt: r.string(),
|
|
1289
|
+
body: r.string().nullable(),
|
|
1290
|
+
grade: r.string().nullable(),
|
|
1291
|
+
score: r.number().nullable(),
|
|
1292
|
+
submissionType: r.string(),
|
|
1293
|
+
attempt: r.number(),
|
|
1294
|
+
unreadCommentCount: r.number(),
|
|
1295
|
+
attachment: Oe.nullable(),
|
|
1296
|
+
attachments: r.array(Oe).nullable(),
|
|
1297
|
+
submissionDraft: Xi.nullable()
|
|
1298
|
+
}), Zi = r.object({
|
|
1299
|
+
_id: r.string(),
|
|
1300
|
+
name: r.string(),
|
|
1301
|
+
description: r.string().nullable(),
|
|
1302
|
+
allowedExtensions: r.array(r.string()).nullable(),
|
|
1303
|
+
allowedAttempts: r.number().nullable(),
|
|
1304
|
+
dueAt: r.string().nullable(),
|
|
1305
|
+
pointsPossible: r.number().nullable(),
|
|
1306
|
+
submissionTypes: r.array(r.string()),
|
|
1307
|
+
gradingType: r.string(),
|
|
1308
|
+
published: r.boolean().nullable().optional(),
|
|
1309
|
+
submissionsConnection: r.object({
|
|
1310
|
+
nodes: r.array(Ki)
|
|
1241
1311
|
})
|
|
1242
|
-
}),
|
|
1243
|
-
legacyNode:
|
|
1244
|
-
course:
|
|
1245
|
-
name:
|
|
1312
|
+
}), Qi = r.object({
|
|
1313
|
+
legacyNode: Zi,
|
|
1314
|
+
course: r.object({
|
|
1315
|
+
name: r.string()
|
|
1246
1316
|
})
|
|
1247
|
-
}),
|
|
1248
|
-
startCursor:
|
|
1249
|
-
endCursor:
|
|
1250
|
-
hasPreviousPage:
|
|
1251
|
-
hasNextPage:
|
|
1252
|
-
}),
|
|
1253
|
-
_id:
|
|
1254
|
-
attempt:
|
|
1255
|
-
author:
|
|
1256
|
-
avatarUrl:
|
|
1257
|
-
shortName:
|
|
1258
|
-
courseRoles:
|
|
1317
|
+
}), Dn = r.object({
|
|
1318
|
+
startCursor: r.string(),
|
|
1319
|
+
endCursor: r.string(),
|
|
1320
|
+
hasPreviousPage: r.boolean(),
|
|
1321
|
+
hasNextPage: r.boolean()
|
|
1322
|
+
}), Rn = r.object({
|
|
1323
|
+
_id: r.string(),
|
|
1324
|
+
attempt: r.number(),
|
|
1325
|
+
author: r.object({
|
|
1326
|
+
avatarUrl: r.string().nullable(),
|
|
1327
|
+
shortName: r.string(),
|
|
1328
|
+
courseRoles: r.string().nullable()
|
|
1259
1329
|
}),
|
|
1260
|
-
htmlComment:
|
|
1261
|
-
read:
|
|
1262
|
-
updatedAt:
|
|
1263
|
-
createdAt:
|
|
1264
|
-
attachments:
|
|
1265
|
-
|
|
1266
|
-
url:
|
|
1267
|
-
mimeClass:
|
|
1268
|
-
displayName:
|
|
1269
|
-
contentType:
|
|
1270
|
-
id:
|
|
1330
|
+
htmlComment: r.string(),
|
|
1331
|
+
read: r.boolean(),
|
|
1332
|
+
updatedAt: r.string(),
|
|
1333
|
+
createdAt: r.string(),
|
|
1334
|
+
attachments: r.array(
|
|
1335
|
+
r.object({
|
|
1336
|
+
url: r.string(),
|
|
1337
|
+
mimeClass: r.string(),
|
|
1338
|
+
displayName: r.string(),
|
|
1339
|
+
contentType: r.string(),
|
|
1340
|
+
id: r.string()
|
|
1271
1341
|
})
|
|
1272
1342
|
).nullable()
|
|
1273
|
-
}),
|
|
1274
|
-
submissionComments:
|
|
1275
|
-
commentsConnection:
|
|
1276
|
-
pageInfo:
|
|
1277
|
-
nodes:
|
|
1343
|
+
}), Ji = r.object({
|
|
1344
|
+
submissionComments: r.object({
|
|
1345
|
+
commentsConnection: r.object({
|
|
1346
|
+
pageInfo: Dn,
|
|
1347
|
+
nodes: r.array(Rn)
|
|
1278
1348
|
})
|
|
1279
1349
|
})
|
|
1280
|
-
}),
|
|
1281
|
-
comments:
|
|
1282
|
-
pageInfo:
|
|
1283
|
-
}),
|
|
1284
|
-
submittedAt:
|
|
1285
|
-
body:
|
|
1286
|
-
grade:
|
|
1287
|
-
score:
|
|
1288
|
-
submissionType:
|
|
1289
|
-
state:
|
|
1290
|
-
attempt:
|
|
1291
|
-
attachment:
|
|
1292
|
-
attachments:
|
|
1293
|
-
}),
|
|
1294
|
-
node:
|
|
1295
|
-
submissionHistoriesConnection:
|
|
1296
|
-
nodes:
|
|
1350
|
+
}), qr = r.object({
|
|
1351
|
+
comments: r.array(Rn),
|
|
1352
|
+
pageInfo: Dn
|
|
1353
|
+
}), er = r.object({
|
|
1354
|
+
submittedAt: r.string(),
|
|
1355
|
+
body: r.string().nullable(),
|
|
1356
|
+
grade: r.string().nullable(),
|
|
1357
|
+
score: r.number().nullable(),
|
|
1358
|
+
submissionType: r.string(),
|
|
1359
|
+
state: r.string(),
|
|
1360
|
+
attempt: r.number(),
|
|
1361
|
+
attachment: Oe.nullable(),
|
|
1362
|
+
attachments: r.array(Oe).nullable()
|
|
1363
|
+
}), tr = r.object({
|
|
1364
|
+
node: r.object({
|
|
1365
|
+
submissionHistoriesConnection: r.object({
|
|
1366
|
+
nodes: r.array(er)
|
|
1297
1367
|
})
|
|
1298
1368
|
})
|
|
1299
|
-
}), Le =
|
|
1300
|
-
attribute:
|
|
1301
|
-
message:
|
|
1302
|
-
}),
|
|
1303
|
-
createSubmissionComment:
|
|
1304
|
-
submissionComment:
|
|
1305
|
-
_id:
|
|
1306
|
-
attachments:
|
|
1307
|
-
|
|
1308
|
-
_id:
|
|
1309
|
-
displayName:
|
|
1310
|
-
id:
|
|
1311
|
-
mimeClass:
|
|
1312
|
-
url:
|
|
1369
|
+
}), Le = r.object({
|
|
1370
|
+
attribute: r.string(),
|
|
1371
|
+
message: r.string()
|
|
1372
|
+
}), nr = r.object({
|
|
1373
|
+
createSubmissionComment: r.object({
|
|
1374
|
+
submissionComment: r.object({
|
|
1375
|
+
_id: r.string(),
|
|
1376
|
+
attachments: r.array(
|
|
1377
|
+
r.object({
|
|
1378
|
+
_id: r.string(),
|
|
1379
|
+
displayName: r.string(),
|
|
1380
|
+
id: r.string(),
|
|
1381
|
+
mimeClass: r.string(),
|
|
1382
|
+
url: r.string()
|
|
1313
1383
|
})
|
|
1314
1384
|
).nullable(),
|
|
1315
|
-
author:
|
|
1316
|
-
avatarUrl:
|
|
1317
|
-
shortName:
|
|
1385
|
+
author: r.object({
|
|
1386
|
+
avatarUrl: r.string().nullable(),
|
|
1387
|
+
shortName: r.string()
|
|
1318
1388
|
}),
|
|
1319
|
-
htmlComment:
|
|
1320
|
-
mediaObject:
|
|
1321
|
-
id:
|
|
1322
|
-
_id:
|
|
1323
|
-
mediaSources:
|
|
1324
|
-
|
|
1325
|
-
height:
|
|
1326
|
-
src:
|
|
1327
|
-
type:
|
|
1328
|
-
width:
|
|
1389
|
+
htmlComment: r.string(),
|
|
1390
|
+
mediaObject: r.object({
|
|
1391
|
+
id: r.string(),
|
|
1392
|
+
_id: r.string(),
|
|
1393
|
+
mediaSources: r.array(
|
|
1394
|
+
r.object({
|
|
1395
|
+
height: r.string(),
|
|
1396
|
+
src: r.string(),
|
|
1397
|
+
type: r.string(),
|
|
1398
|
+
width: r.string()
|
|
1329
1399
|
})
|
|
1330
1400
|
),
|
|
1331
|
-
mediaTracks:
|
|
1332
|
-
|
|
1333
|
-
_id:
|
|
1334
|
-
locale:
|
|
1335
|
-
content:
|
|
1336
|
-
kind:
|
|
1401
|
+
mediaTracks: r.array(
|
|
1402
|
+
r.object({
|
|
1403
|
+
_id: r.string(),
|
|
1404
|
+
locale: r.string(),
|
|
1405
|
+
content: r.string(),
|
|
1406
|
+
kind: r.string()
|
|
1337
1407
|
})
|
|
1338
1408
|
),
|
|
1339
|
-
mediaType:
|
|
1340
|
-
title:
|
|
1409
|
+
mediaType: r.string(),
|
|
1410
|
+
title: r.string()
|
|
1341
1411
|
}).nullable(),
|
|
1342
|
-
read:
|
|
1343
|
-
updatedAt:
|
|
1412
|
+
read: r.boolean(),
|
|
1413
|
+
updatedAt: r.string()
|
|
1344
1414
|
}).nullable(),
|
|
1345
|
-
errors:
|
|
1415
|
+
errors: r.array(Le).nullable()
|
|
1346
1416
|
})
|
|
1347
|
-
}),
|
|
1348
|
-
markSubmissionCommentsRead:
|
|
1349
|
-
errors:
|
|
1417
|
+
}), ir = r.object({
|
|
1418
|
+
markSubmissionCommentsRead: r.object({
|
|
1419
|
+
errors: r.array(Le).nullable()
|
|
1350
1420
|
})
|
|
1351
|
-
}),
|
|
1352
|
-
createSubmission:
|
|
1353
|
-
submission:
|
|
1354
|
-
_id:
|
|
1355
|
-
createdAt:
|
|
1356
|
-
attempt:
|
|
1357
|
-
submittedAt:
|
|
1358
|
-
score:
|
|
1421
|
+
}), Vr = r.object({
|
|
1422
|
+
createSubmission: r.object({
|
|
1423
|
+
submission: r.object({
|
|
1424
|
+
_id: r.string(),
|
|
1425
|
+
createdAt: r.string(),
|
|
1426
|
+
attempt: r.number(),
|
|
1427
|
+
submittedAt: r.string().nullable(),
|
|
1428
|
+
score: r.number().nullable()
|
|
1359
1429
|
}).nullable(),
|
|
1360
|
-
errors:
|
|
1430
|
+
errors: r.array(Le).nullable()
|
|
1361
1431
|
})
|
|
1362
|
-
}),
|
|
1432
|
+
}), Yr = r.object(
|
|
1363
1433
|
{
|
|
1364
|
-
createSubmissionDraft:
|
|
1365
|
-
submissionDraft:
|
|
1366
|
-
_id:
|
|
1434
|
+
createSubmissionDraft: r.object({
|
|
1435
|
+
submissionDraft: r.object({
|
|
1436
|
+
_id: r.string()
|
|
1367
1437
|
}).nullable(),
|
|
1368
|
-
errors:
|
|
1438
|
+
errors: r.array(Le).nullable()
|
|
1369
1439
|
})
|
|
1370
1440
|
}
|
|
1371
|
-
),
|
|
1441
|
+
), Xr = r.object(
|
|
1372
1442
|
{
|
|
1373
|
-
deleteSubmissionDraft:
|
|
1374
|
-
submissionDraftIds:
|
|
1375
|
-
errors:
|
|
1443
|
+
deleteSubmissionDraft: r.object({
|
|
1444
|
+
submissionDraftIds: r.array(r.string()).nullable(),
|
|
1445
|
+
errors: r.array(Le).nullable()
|
|
1376
1446
|
})
|
|
1377
1447
|
}
|
|
1378
1448
|
);
|
|
1379
|
-
function
|
|
1449
|
+
function rr({
|
|
1380
1450
|
courseId: t,
|
|
1381
1451
|
assignmentId: n,
|
|
1382
1452
|
userId: i,
|
|
1383
|
-
executeQuery:
|
|
1453
|
+
executeQuery: o,
|
|
1384
1454
|
enabled: l = !0
|
|
1385
1455
|
}) {
|
|
1386
|
-
return
|
|
1456
|
+
return Xe({
|
|
1387
1457
|
queryKey: ["assignment-review", "assignment", t, n, i],
|
|
1388
1458
|
queryFn: async () => {
|
|
1389
|
-
const c = await
|
|
1459
|
+
const c = await o(qi, {
|
|
1390
1460
|
courseId: t,
|
|
1391
1461
|
assignmentId: n,
|
|
1392
1462
|
userId: i
|
|
1393
|
-
}), d =
|
|
1463
|
+
}), d = Qi.parse(c);
|
|
1394
1464
|
return {
|
|
1395
1465
|
...d.legacyNode,
|
|
1396
1466
|
courseName: d.course.name
|
|
@@ -1399,36 +1469,36 @@ function Xi({
|
|
|
1399
1469
|
enabled: l
|
|
1400
1470
|
});
|
|
1401
1471
|
}
|
|
1402
|
-
function
|
|
1472
|
+
function or({
|
|
1403
1473
|
submissionId: t,
|
|
1404
1474
|
executeQuery: n,
|
|
1405
1475
|
enabled: i = !0
|
|
1406
1476
|
}) {
|
|
1407
|
-
return
|
|
1477
|
+
return Xe({
|
|
1408
1478
|
queryKey: ["assignment-review", "submissions", t],
|
|
1409
1479
|
queryFn: async () => {
|
|
1410
|
-
const
|
|
1411
|
-
return
|
|
1480
|
+
const o = await n(Yi, { submissionId: t });
|
|
1481
|
+
return tr.parse(o).node.submissionHistoriesConnection.nodes.slice().sort(
|
|
1412
1482
|
(c, d) => new Date(d.submittedAt).getTime() - new Date(c.submittedAt).getTime()
|
|
1413
1483
|
);
|
|
1414
1484
|
},
|
|
1415
1485
|
enabled: i
|
|
1416
1486
|
});
|
|
1417
1487
|
}
|
|
1418
|
-
function
|
|
1488
|
+
function ar(t) {
|
|
1419
1489
|
if (!t) return "";
|
|
1420
1490
|
const n = new Date(t);
|
|
1421
1491
|
return Number.isNaN(n.getTime()) ? "" : n.toLocaleDateString();
|
|
1422
1492
|
}
|
|
1423
|
-
function
|
|
1493
|
+
function sr({
|
|
1424
1494
|
submission: t,
|
|
1425
1495
|
isSelected: n,
|
|
1426
1496
|
isDraft: i = !1,
|
|
1427
|
-
pointsPossible:
|
|
1497
|
+
pointsPossible: o,
|
|
1428
1498
|
onClick: l
|
|
1429
1499
|
}) {
|
|
1430
|
-
const c =
|
|
1431
|
-
return /* @__PURE__ */
|
|
1500
|
+
const c = V(), d = i ? c.submissionCurrentAttempt() : c.commentsAttempt({ number: t.attempt }), p = t.score != null && o != null ? `${t.score}/${o}` : null;
|
|
1501
|
+
return /* @__PURE__ */ a(
|
|
1432
1502
|
Z,
|
|
1433
1503
|
{
|
|
1434
1504
|
as: "div",
|
|
@@ -1447,48 +1517,48 @@ function Qi({
|
|
|
1447
1517
|
children: /* @__PURE__ */ S(b, { justifyItems: "space-between", alignItems: "center", children: [
|
|
1448
1518
|
/* @__PURE__ */ S(b, { direction: "column", gap: "xx-small", children: [
|
|
1449
1519
|
/* @__PURE__ */ S(b, { gap: "small", alignItems: "center", children: [
|
|
1450
|
-
/* @__PURE__ */
|
|
1451
|
-
i && /* @__PURE__ */
|
|
1520
|
+
/* @__PURE__ */ a(_, { weight: "bold", children: d }),
|
|
1521
|
+
i && /* @__PURE__ */ a(Et, { color: "info", children: c.submissionDraft() })
|
|
1452
1522
|
] }),
|
|
1453
|
-
!i && t.submittedAt && /* @__PURE__ */
|
|
1523
|
+
!i && t.submittedAt && /* @__PURE__ */ a(_, { size: "small", color: "secondary", children: ar(t.submittedAt) })
|
|
1454
1524
|
] }),
|
|
1455
|
-
p && /* @__PURE__ */
|
|
1525
|
+
p && /* @__PURE__ */ a(_, { weight: "bold", children: p })
|
|
1456
1526
|
] })
|
|
1457
1527
|
}
|
|
1458
1528
|
);
|
|
1459
1529
|
}
|
|
1460
|
-
function
|
|
1530
|
+
function lr({
|
|
1461
1531
|
submissionId: t,
|
|
1462
1532
|
selectedAttempt: n,
|
|
1463
1533
|
onAttemptSelect: i,
|
|
1464
|
-
pointsPossible:
|
|
1534
|
+
pointsPossible: o,
|
|
1465
1535
|
executeQuery: l
|
|
1466
1536
|
}) {
|
|
1467
|
-
const c =
|
|
1537
|
+
const c = V(), { data: d, isLoading: p, isError: m } = or({
|
|
1468
1538
|
submissionId: t,
|
|
1469
1539
|
executeQuery: l
|
|
1470
1540
|
});
|
|
1471
1541
|
if (p)
|
|
1472
|
-
return /* @__PURE__ */
|
|
1542
|
+
return /* @__PURE__ */ a(b, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ a(Ye, { renderTitle: c.navigationAttempts(), size: "small" }) });
|
|
1473
1543
|
if (m)
|
|
1474
|
-
return /* @__PURE__ */
|
|
1544
|
+
return /* @__PURE__ */ a(b, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ a(_, { color: "danger", children: c.submissionLoadAttemptsError() }) });
|
|
1475
1545
|
const f = (d == null ? void 0 : d.filter((h) => h.attempt > 0)) ?? [];
|
|
1476
|
-
return f.length === 0 ? /* @__PURE__ */
|
|
1477
|
-
|
|
1546
|
+
return f.length === 0 ? /* @__PURE__ */ a(b, { padding: "medium", children: /* @__PURE__ */ a(_, { color: "secondary", children: c.submissionNoAttempts() }) }) : /* @__PURE__ */ a(b, { direction: "column", gap: "x-small", padding: "none none medium none", children: f.map((h) => /* @__PURE__ */ a(
|
|
1547
|
+
sr,
|
|
1478
1548
|
{
|
|
1479
1549
|
submission: h,
|
|
1480
1550
|
isSelected: n === h.attempt,
|
|
1481
|
-
pointsPossible:
|
|
1551
|
+
pointsPossible: o,
|
|
1482
1552
|
onClick: () => i(h)
|
|
1483
1553
|
},
|
|
1484
1554
|
h.attempt
|
|
1485
1555
|
)) });
|
|
1486
1556
|
}
|
|
1487
|
-
function
|
|
1557
|
+
function Nn({
|
|
1488
1558
|
attachments: t,
|
|
1489
1559
|
size: n = "medium"
|
|
1490
1560
|
}) {
|
|
1491
|
-
return t.length === 0 ? null : /* @__PURE__ */
|
|
1561
|
+
return t.length === 0 ? null : /* @__PURE__ */ a(b, { direction: "column", gap: "x-small", children: t.map((i) => /* @__PURE__ */ a(
|
|
1492
1562
|
Z,
|
|
1493
1563
|
{
|
|
1494
1564
|
as: "div",
|
|
@@ -1497,85 +1567,85 @@ function wn({
|
|
|
1497
1567
|
borderWidth: "small",
|
|
1498
1568
|
borderRadius: "medium",
|
|
1499
1569
|
children: /* @__PURE__ */ S(b, { as: "div", gap: "small", width: "100%", justifyItems: "space-between", alignItems: "center", children: [
|
|
1500
|
-
/* @__PURE__ */
|
|
1501
|
-
/* @__PURE__ */
|
|
1570
|
+
/* @__PURE__ */ a(b.Item, { shouldShrink: !0, children: /* @__PURE__ */ a(An, { children: i.displayName }) }),
|
|
1571
|
+
/* @__PURE__ */ a(ti, { href: i.url, isWithinText: !1, renderIcon: /* @__PURE__ */ a(Wn, {}), children: /* @__PURE__ */ a(It, { children: `Download ${i.displayName}` }) })
|
|
1502
1572
|
] })
|
|
1503
1573
|
},
|
|
1504
1574
|
i.id
|
|
1505
1575
|
)) });
|
|
1506
1576
|
}
|
|
1507
|
-
function
|
|
1508
|
-
return /* @__PURE__ */
|
|
1577
|
+
function cr(t) {
|
|
1578
|
+
return /* @__PURE__ */ a("span", { dangerouslySetInnerHTML: { __html: wt(t) } });
|
|
1509
1579
|
}
|
|
1510
|
-
function
|
|
1580
|
+
function mr({
|
|
1511
1581
|
submission: t,
|
|
1512
1582
|
isLastAttempt: n = !0,
|
|
1513
1583
|
showAttemptLabel: i = !0,
|
|
1514
|
-
renderHTML:
|
|
1584
|
+
renderHTML: o
|
|
1515
1585
|
}) {
|
|
1516
|
-
const l =
|
|
1586
|
+
const l = V(), c = o ?? cr, d = (t == null ? void 0 : t.submissionType) === "online_text_entry", p = (t == null ? void 0 : t.submissionType) === "online_upload", m = d ? l.submissionTextHeading() : l.submissionUploadHeading(), f = Ve(() => {
|
|
1517
1587
|
if (!t) return [];
|
|
1518
1588
|
const C = [];
|
|
1519
1589
|
if (t.attachment && C.push(t.attachment), t.attachments)
|
|
1520
1590
|
for (const I of t.attachments)
|
|
1521
1591
|
C.some((w) => w.id === I.id) || C.push(I);
|
|
1522
1592
|
return C;
|
|
1523
|
-
}, [t]), h =
|
|
1524
|
-
return t ? /* @__PURE__ */
|
|
1525
|
-
i && !n && t.attempt != null && /* @__PURE__ */
|
|
1593
|
+
}, [t]), h = Ve(() => c((t == null ? void 0 : t.body) ?? ""), [t == null ? void 0 : t.body, c]);
|
|
1594
|
+
return t ? /* @__PURE__ */ a(Z, { as: "div", children: /* @__PURE__ */ S(b, { direction: "column", gap: "small", children: [
|
|
1595
|
+
i && !n && t.attempt != null && /* @__PURE__ */ a(_, { size: "small", weight: "bold", color: "secondary", children: l.submissionViewingAttempt({ number: t.attempt }) }),
|
|
1526
1596
|
/* @__PURE__ */ S(b, { gap: "x-small", alignItems: "center", children: [
|
|
1527
|
-
/* @__PURE__ */
|
|
1528
|
-
/* @__PURE__ */
|
|
1597
|
+
/* @__PURE__ */ a(qn, { color: "success" }),
|
|
1598
|
+
/* @__PURE__ */ a(_t, { level: "h3", children: m })
|
|
1529
1599
|
] }),
|
|
1530
1600
|
d && t.body && /* @__PURE__ */ S(b, { alignItems: "stretch", gap: "small", children: [
|
|
1531
|
-
/* @__PURE__ */
|
|
1532
|
-
/* @__PURE__ */
|
|
1601
|
+
/* @__PURE__ */ a(Z, { as: "div", width: "4px", background: "primary", borderRadius: "small" }),
|
|
1602
|
+
/* @__PURE__ */ a(Z, { as: "div", children: /* @__PURE__ */ a(_, { children: h }) })
|
|
1533
1603
|
] }),
|
|
1534
|
-
p && f.length > 0 && /* @__PURE__ */
|
|
1604
|
+
p && f.length > 0 && /* @__PURE__ */ a(Nn, { attachments: f })
|
|
1535
1605
|
] }) }) : null;
|
|
1536
1606
|
}
|
|
1537
|
-
function
|
|
1607
|
+
function ur(t) {
|
|
1538
1608
|
const n = new Date(t);
|
|
1539
1609
|
return Number.isNaN(n.getTime()) ? "" : n.toLocaleDateString(void 0, { month: "short", day: "numeric", year: "numeric" });
|
|
1540
1610
|
}
|
|
1541
|
-
function
|
|
1542
|
-
return /* @__PURE__ */
|
|
1611
|
+
function dr() {
|
|
1612
|
+
return /* @__PURE__ */ a(_, { color: "secondary", size: "small", children: "|" });
|
|
1543
1613
|
}
|
|
1544
|
-
function
|
|
1614
|
+
function fr({
|
|
1545
1615
|
score: t,
|
|
1546
1616
|
pointsPossible: n,
|
|
1547
1617
|
gradingType: i,
|
|
1548
|
-
dueAt:
|
|
1618
|
+
dueAt: o,
|
|
1549
1619
|
allowedAttempts: l,
|
|
1550
1620
|
currentAttempt: c,
|
|
1551
1621
|
isOverdue: d,
|
|
1552
1622
|
estimatedDuration: p,
|
|
1553
1623
|
labels: m
|
|
1554
1624
|
}) {
|
|
1555
|
-
const f =
|
|
1625
|
+
const f = V(), h = [];
|
|
1556
1626
|
return p && h.push(
|
|
1557
|
-
/* @__PURE__ */
|
|
1627
|
+
/* @__PURE__ */ a(_, { size: "small", children: (m == null ? void 0 : m.duration) ?? f.headerDuration({ minutes: p }) }, "duration")
|
|
1558
1628
|
), t != null && n != null ? h.push(
|
|
1559
|
-
/* @__PURE__ */
|
|
1629
|
+
/* @__PURE__ */ a(_, { size: "small", children: (m == null ? void 0 : m.score) ?? f.headerScore({ score: t, total: n }) }, "score")
|
|
1560
1630
|
) : n != null && i !== "not_graded" && h.push(
|
|
1561
|
-
/* @__PURE__ */
|
|
1631
|
+
/* @__PURE__ */ a(_, { size: "small", children: (m == null ? void 0 : m.pointsPossible) ?? f.headerPointsPossible({ points: n }) }, "points")
|
|
1562
1632
|
), l != null && (l === -1 ? h.push(
|
|
1563
|
-
/* @__PURE__ */
|
|
1633
|
+
/* @__PURE__ */ a(_, { size: "small", children: (m == null ? void 0 : m.attempts) ?? f.headerAttemptsUnlimited() }, "attempts")
|
|
1564
1634
|
) : c != null ? h.push(
|
|
1565
|
-
/* @__PURE__ */
|
|
1635
|
+
/* @__PURE__ */ a(_, { size: "small", children: (m == null ? void 0 : m.attempts) ?? f.headerAttemptOf({ current: c, total: l }) }, "attempts")
|
|
1566
1636
|
) : h.push(
|
|
1567
|
-
/* @__PURE__ */
|
|
1568
|
-
)),
|
|
1569
|
-
/* @__PURE__ */
|
|
1637
|
+
/* @__PURE__ */ a(_, { size: "small", children: (m == null ? void 0 : m.attempts) ?? f.headerAttemptsAllowed({ count: l }) }, "attempts")
|
|
1638
|
+
)), o && h.push(
|
|
1639
|
+
/* @__PURE__ */ a(_, { size: "small", children: (m == null ? void 0 : m.dueDate) ?? f.headerDueDate({ date: ur(o) }) }, "due")
|
|
1570
1640
|
), /* @__PURE__ */ S(b, { as: "div", direction: "row", alignItems: "center", gap: "small", children: [
|
|
1571
1641
|
h.map((C, I) => /* @__PURE__ */ S(b, { gap: "small", alignItems: "center", children: [
|
|
1572
|
-
I > 0 && /* @__PURE__ */
|
|
1642
|
+
I > 0 && /* @__PURE__ */ a(dr, {}),
|
|
1573
1643
|
C
|
|
1574
1644
|
] }, `item-${String(I)}`)),
|
|
1575
|
-
d && /* @__PURE__ */
|
|
1645
|
+
d && /* @__PURE__ */ a(Et, { color: "danger", children: (m == null ? void 0 : m.overdue) ?? f.headerOverdue() })
|
|
1576
1646
|
] });
|
|
1577
1647
|
}
|
|
1578
|
-
const
|
|
1648
|
+
const pr = se`
|
|
1579
1649
|
mutation CreateSubmissionComment(
|
|
1580
1650
|
$id: ID!
|
|
1581
1651
|
$submissionAttempt: Int!
|
|
@@ -1665,7 +1735,7 @@ const ro = ae`
|
|
|
1665
1735
|
mimeClass
|
|
1666
1736
|
url
|
|
1667
1737
|
}
|
|
1668
|
-
`,
|
|
1738
|
+
`, gr = se`
|
|
1669
1739
|
mutation MarkSubmissionCommentsRead(
|
|
1670
1740
|
$submissionId: ID!
|
|
1671
1741
|
$submissionCommentIds: [ID!]!
|
|
@@ -1682,7 +1752,7 @@ const ro = ae`
|
|
|
1682
1752
|
}
|
|
1683
1753
|
}
|
|
1684
1754
|
}
|
|
1685
|
-
`,
|
|
1755
|
+
`, Kr = se`
|
|
1686
1756
|
mutation CreateSubmission(
|
|
1687
1757
|
$assignmentLid: ID!
|
|
1688
1758
|
$submissionType: OnlineSubmissionType!
|
|
@@ -1710,7 +1780,7 @@ const ro = ae`
|
|
|
1710
1780
|
}
|
|
1711
1781
|
}
|
|
1712
1782
|
}
|
|
1713
|
-
`,
|
|
1783
|
+
`, Zr = se`
|
|
1714
1784
|
mutation CreateSubmissionDraft(
|
|
1715
1785
|
$submissionId: ID!
|
|
1716
1786
|
$submissionType: DraftableSubmissionType!
|
|
@@ -1736,7 +1806,7 @@ const ro = ae`
|
|
|
1736
1806
|
}
|
|
1737
1807
|
}
|
|
1738
1808
|
}
|
|
1739
|
-
`,
|
|
1809
|
+
`, Qr = se`
|
|
1740
1810
|
mutation DeleteSubmissionDraft($submissionId: ID!) {
|
|
1741
1811
|
deleteSubmissionDraft(input: { submissionId: $submissionId }) {
|
|
1742
1812
|
submissionDraftIds
|
|
@@ -1747,36 +1817,36 @@ const ro = ae`
|
|
|
1747
1817
|
}
|
|
1748
1818
|
}
|
|
1749
1819
|
`;
|
|
1750
|
-
function
|
|
1820
|
+
function hr({
|
|
1751
1821
|
executeQuery: t
|
|
1752
1822
|
}) {
|
|
1753
|
-
const n =
|
|
1754
|
-
return
|
|
1755
|
-
mutationFn: async ({ submissionId: i, attempt:
|
|
1756
|
-
const d = await t(
|
|
1823
|
+
const n = gn();
|
|
1824
|
+
return hn({
|
|
1825
|
+
mutationFn: async ({ submissionId: i, attempt: o, comment: l, fileIds: c }) => {
|
|
1826
|
+
const d = await t(pr, {
|
|
1757
1827
|
id: i,
|
|
1758
|
-
submissionAttempt:
|
|
1828
|
+
submissionAttempt: o,
|
|
1759
1829
|
comment: l,
|
|
1760
1830
|
fileIds: c
|
|
1761
1831
|
});
|
|
1762
|
-
return
|
|
1832
|
+
return nr.parse(d), d;
|
|
1763
1833
|
},
|
|
1764
|
-
onSuccess: (i,
|
|
1834
|
+
onSuccess: (i, o) => {
|
|
1765
1835
|
n.invalidateQueries({
|
|
1766
|
-
queryKey: ["assignment-review", "submission-comments",
|
|
1836
|
+
queryKey: ["assignment-review", "submission-comments", o.submissionId]
|
|
1767
1837
|
});
|
|
1768
1838
|
}
|
|
1769
1839
|
});
|
|
1770
1840
|
}
|
|
1771
|
-
function
|
|
1841
|
+
function br({
|
|
1772
1842
|
submissionId: t,
|
|
1773
1843
|
courseId: n,
|
|
1774
1844
|
pageParams: i,
|
|
1775
|
-
direction:
|
|
1845
|
+
direction: o,
|
|
1776
1846
|
executeQuery: l,
|
|
1777
1847
|
enabled: c
|
|
1778
1848
|
}) {
|
|
1779
|
-
return
|
|
1849
|
+
return Xe({
|
|
1780
1850
|
queryKey: [
|
|
1781
1851
|
"assignment-review",
|
|
1782
1852
|
"submission-comments",
|
|
@@ -1784,17 +1854,17 @@ function lo({
|
|
|
1784
1854
|
n,
|
|
1785
1855
|
i == null ? void 0 : i.startCursor,
|
|
1786
1856
|
i == null ? void 0 : i.endCursor,
|
|
1787
|
-
|
|
1857
|
+
o
|
|
1788
1858
|
],
|
|
1789
1859
|
queryFn: async () => {
|
|
1790
|
-
const d = await l(
|
|
1860
|
+
const d = await l(Vi, {
|
|
1791
1861
|
submissionId: t,
|
|
1792
1862
|
courseId: n,
|
|
1793
|
-
beforeCursor:
|
|
1794
|
-
afterCursor:
|
|
1795
|
-
first:
|
|
1796
|
-
last:
|
|
1797
|
-
}), p =
|
|
1863
|
+
beforeCursor: o === "prev" ? (i == null ? void 0 : i.startCursor) ?? null : null,
|
|
1864
|
+
afterCursor: o === "next" ? (i == null ? void 0 : i.endCursor) ?? null : null,
|
|
1865
|
+
first: o === "next" ? 5 : null,
|
|
1866
|
+
last: o === "prev" || !o ? 5 : null
|
|
1867
|
+
}), p = Ji.parse(d);
|
|
1798
1868
|
return {
|
|
1799
1869
|
comments: [...p.submissionComments.commentsConnection.nodes].sort(
|
|
1800
1870
|
(f, h) => new Date(f.createdAt).getTime() - new Date(h.createdAt).getTime()
|
|
@@ -1805,41 +1875,41 @@ function lo({
|
|
|
1805
1875
|
enabled: c ?? !!t
|
|
1806
1876
|
});
|
|
1807
1877
|
}
|
|
1808
|
-
function
|
|
1878
|
+
function Tr({
|
|
1809
1879
|
executeQuery: t
|
|
1810
1880
|
}) {
|
|
1811
|
-
const n =
|
|
1812
|
-
return
|
|
1813
|
-
mutationFn: async ({ submissionId: i, submissionCommentIds:
|
|
1881
|
+
const n = gn();
|
|
1882
|
+
return hn({
|
|
1883
|
+
mutationFn: async ({ submissionId: i, submissionCommentIds: o }) => {
|
|
1814
1884
|
const l = await t(
|
|
1815
|
-
|
|
1816
|
-
{ submissionId: i, submissionCommentIds:
|
|
1885
|
+
gr,
|
|
1886
|
+
{ submissionId: i, submissionCommentIds: o }
|
|
1817
1887
|
);
|
|
1818
|
-
return
|
|
1888
|
+
return ir.parse(l), l;
|
|
1819
1889
|
},
|
|
1820
|
-
onSuccess: (i,
|
|
1890
|
+
onSuccess: (i, o) => {
|
|
1821
1891
|
n.invalidateQueries({
|
|
1822
1892
|
queryKey: ["assignment-review", "assignment"],
|
|
1823
|
-
predicate: (l) => l.queryKey.includes(
|
|
1893
|
+
predicate: (l) => l.queryKey.includes(o.assignmentId)
|
|
1824
1894
|
});
|
|
1825
1895
|
}
|
|
1826
1896
|
});
|
|
1827
1897
|
}
|
|
1828
|
-
function
|
|
1829
|
-
return /* @__PURE__ */
|
|
1898
|
+
function yr(t) {
|
|
1899
|
+
return /* @__PURE__ */ a("span", { dangerouslySetInnerHTML: { __html: wt(t) } });
|
|
1830
1900
|
}
|
|
1831
|
-
function
|
|
1901
|
+
function Ar(t) {
|
|
1832
1902
|
const n = new Date(t);
|
|
1833
1903
|
return Number.isNaN(n.getTime()) ? "" : n.toLocaleString();
|
|
1834
1904
|
}
|
|
1835
|
-
function
|
|
1905
|
+
function Sr({
|
|
1836
1906
|
comment: t,
|
|
1837
1907
|
isFullWidth: n,
|
|
1838
1908
|
renderHTML: i
|
|
1839
1909
|
}) {
|
|
1840
1910
|
var m;
|
|
1841
|
-
const
|
|
1842
|
-
return /* @__PURE__ */
|
|
1911
|
+
const o = V(), l = i ?? yr, c = ((m = t.author.courseRoles) == null ? void 0 : m.includes("StudentEnrollment")) ?? !1, d = Ve(() => l(t.htmlComment), [t.htmlComment, l]);
|
|
1912
|
+
return /* @__PURE__ */ a(
|
|
1843
1913
|
Z,
|
|
1844
1914
|
{
|
|
1845
1915
|
as: "div",
|
|
@@ -1851,15 +1921,15 @@ function fo({
|
|
|
1851
1921
|
children: /* @__PURE__ */ S(b, { as: "div", direction: "column", gap: "small", children: [
|
|
1852
1922
|
/* @__PURE__ */ S(b, { as: "div", direction: "column", gap: "xx-small", children: [
|
|
1853
1923
|
/* @__PURE__ */ S(b, { as: "div", justifyItems: "space-between", alignItems: "center", children: [
|
|
1854
|
-
/* @__PURE__ */
|
|
1855
|
-
!t.read && /* @__PURE__ */
|
|
1924
|
+
/* @__PURE__ */ a(b.Item, { shouldShrink: !0, children: /* @__PURE__ */ a(_, { weight: "bold", size: "medium", children: /* @__PURE__ */ a(An, { children: t.author.shortName }) }) }),
|
|
1925
|
+
!t.read && /* @__PURE__ */ a(_n, { type: "notification", standalone: !0, children: /* @__PURE__ */ a(It, { children: o.commentsUnreadSingle() }) })
|
|
1856
1926
|
] }),
|
|
1857
|
-
/* @__PURE__ */
|
|
1858
|
-
t.attempt > 0 && /* @__PURE__ */
|
|
1927
|
+
/* @__PURE__ */ a(_, { size: "small", color: "secondary", children: Ar(t.createdAt) }),
|
|
1928
|
+
t.attempt > 0 && /* @__PURE__ */ a(_, { size: "small", color: "secondary", children: o.commentsAttempt({ number: t.attempt }) })
|
|
1859
1929
|
] }),
|
|
1860
|
-
/* @__PURE__ */
|
|
1861
|
-
t.attachments && t.attachments.length > 0 && /* @__PURE__ */
|
|
1862
|
-
|
|
1930
|
+
/* @__PURE__ */ a(_, { size: "medium", children: d }),
|
|
1931
|
+
t.attachments && t.attachments.length > 0 && /* @__PURE__ */ a(
|
|
1932
|
+
Nn,
|
|
1863
1933
|
{
|
|
1864
1934
|
attachments: t.attachments.map((f) => ({
|
|
1865
1935
|
...f,
|
|
@@ -1873,43 +1943,43 @@ function fo({
|
|
|
1873
1943
|
}
|
|
1874
1944
|
);
|
|
1875
1945
|
}
|
|
1876
|
-
function
|
|
1946
|
+
function _r({
|
|
1877
1947
|
submissionId: t,
|
|
1878
1948
|
courseId: n,
|
|
1879
1949
|
assignmentId: i,
|
|
1880
|
-
attempt:
|
|
1950
|
+
attempt: o,
|
|
1881
1951
|
canPostComment: l,
|
|
1882
1952
|
onCommentPosted: c,
|
|
1883
1953
|
renderHTML: d,
|
|
1884
1954
|
executeQuery: p
|
|
1885
1955
|
}) {
|
|
1886
|
-
const m =
|
|
1956
|
+
const m = V(), [f, h] = Ee(""), [C, I] = Ee({}), w = Bn(/* @__PURE__ */ new Set()), { data: y, isLoading: X, isError: fe } = br({
|
|
1887
1957
|
submissionId: t,
|
|
1888
1958
|
courseId: n,
|
|
1889
1959
|
pageParams: C.pageParams,
|
|
1890
1960
|
direction: C.direction,
|
|
1891
1961
|
executeQuery: p
|
|
1892
|
-
}), le =
|
|
1893
|
-
|
|
1962
|
+
}), le = hr({ executeQuery: p }), M = Tr({ executeQuery: p });
|
|
1963
|
+
yt(() => {
|
|
1894
1964
|
if (!(y != null && y.comments) || y.comments.length === 0) return;
|
|
1895
|
-
const E = y.comments.filter((
|
|
1965
|
+
const E = y.comments.filter((v) => !v.read && !w.current.has(v._id)).filter((v) => {
|
|
1896
1966
|
var ee;
|
|
1897
|
-
return !((ee =
|
|
1898
|
-
}).map((
|
|
1967
|
+
return !((ee = v.author.courseRoles) != null && ee.includes("StudentEnrollment"));
|
|
1968
|
+
}).map((v) => v._id);
|
|
1899
1969
|
if (E.length > 0) {
|
|
1900
|
-
for (const
|
|
1901
|
-
w.current.add(
|
|
1970
|
+
for (const v of E)
|
|
1971
|
+
w.current.add(v);
|
|
1902
1972
|
M.mutate({ submissionId: t, assignmentId: i, submissionCommentIds: E });
|
|
1903
1973
|
}
|
|
1904
1974
|
}, [y == null ? void 0 : y.comments, t, i, M]);
|
|
1905
1975
|
const ie = y == null ? void 0 : y.comments.some(
|
|
1906
1976
|
(E) => {
|
|
1907
|
-
var
|
|
1908
|
-
return !((
|
|
1977
|
+
var v;
|
|
1978
|
+
return !((v = E.author.courseRoles) != null && v.includes("StudentEnrollment"));
|
|
1909
1979
|
}
|
|
1910
|
-
),
|
|
1980
|
+
), N = () => {
|
|
1911
1981
|
f.trim() && le.mutate(
|
|
1912
|
-
{ submissionId: t, attempt:
|
|
1982
|
+
{ submissionId: t, attempt: o, comment: f },
|
|
1913
1983
|
{
|
|
1914
1984
|
onSuccess: () => {
|
|
1915
1985
|
h(""), c == null || c();
|
|
@@ -1917,10 +1987,10 @@ function po({
|
|
|
1917
1987
|
}
|
|
1918
1988
|
);
|
|
1919
1989
|
}, ce = (y == null ? void 0 : y.pageInfo.hasNextPage) || (y == null ? void 0 : y.pageInfo.hasPreviousPage);
|
|
1920
|
-
return
|
|
1990
|
+
return X || !y && !fe ? /* @__PURE__ */ a(b, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ a(Ye, { renderTitle: m.commentsPanelTitle(), size: "small" }) }) : fe ? /* @__PURE__ */ a(b, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ a(_, { color: "danger", children: m.commentsLoadError() }) }) : /* @__PURE__ */ S(b, { as: "div", direction: "column", justifyItems: "space-between", height: "100%", children: [
|
|
1921
1991
|
/* @__PURE__ */ S(b, { as: "div", direction: "column", children: [
|
|
1922
|
-
y.comments.length === 0 ? /* @__PURE__ */
|
|
1923
|
-
|
|
1992
|
+
y.comments.length === 0 ? /* @__PURE__ */ a(b, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ a(_, { color: "secondary", children: m.commentsEmpty() }) }) : /* @__PURE__ */ a(b, { direction: "column", gap: "x-small", children: y.comments.map((E) => /* @__PURE__ */ a(
|
|
1993
|
+
Sr,
|
|
1924
1994
|
{
|
|
1925
1995
|
comment: E,
|
|
1926
1996
|
isFullWidth: !ie,
|
|
@@ -1929,20 +1999,20 @@ function po({
|
|
|
1929
1999
|
E._id
|
|
1930
2000
|
)) }),
|
|
1931
2001
|
ce && /* @__PURE__ */ S(b, { justifyItems: "space-between", padding: "small none", children: [
|
|
1932
|
-
/* @__PURE__ */
|
|
2002
|
+
/* @__PURE__ */ a(
|
|
1933
2003
|
$,
|
|
1934
2004
|
{
|
|
1935
|
-
renderIcon: () => /* @__PURE__ */
|
|
2005
|
+
renderIcon: () => /* @__PURE__ */ a(Vn, {}),
|
|
1936
2006
|
size: "small",
|
|
1937
2007
|
interaction: y.pageInfo.hasPreviousPage ? "enabled" : "disabled",
|
|
1938
2008
|
onClick: () => I({ pageParams: y.pageInfo, direction: "prev" }),
|
|
1939
2009
|
children: m.commentsPreviousComments()
|
|
1940
2010
|
}
|
|
1941
2011
|
),
|
|
1942
|
-
/* @__PURE__ */
|
|
2012
|
+
/* @__PURE__ */ a(
|
|
1943
2013
|
$,
|
|
1944
2014
|
{
|
|
1945
|
-
renderIcon: () => /* @__PURE__ */
|
|
2015
|
+
renderIcon: () => /* @__PURE__ */ a(Yn, {}),
|
|
1946
2016
|
size: "small",
|
|
1947
2017
|
interaction: y.pageInfo.hasNextPage ? "enabled" : "disabled",
|
|
1948
2018
|
onClick: () => I({ pageParams: y.pageInfo, direction: "next" }),
|
|
@@ -1952,20 +2022,20 @@ function po({
|
|
|
1952
2022
|
] })
|
|
1953
2023
|
] }),
|
|
1954
2024
|
l && /* @__PURE__ */ S(b, { as: "div", direction: "column", gap: "small", padding: "small none medium", children: [
|
|
1955
|
-
/* @__PURE__ */
|
|
1956
|
-
|
|
2025
|
+
/* @__PURE__ */ a(
|
|
2026
|
+
Sn,
|
|
1957
2027
|
{
|
|
1958
2028
|
resize: "vertical",
|
|
1959
|
-
label: /* @__PURE__ */
|
|
2029
|
+
label: /* @__PURE__ */ a(_, { weight: "bold", size: "medium", children: m.commentsPlaceholder() }),
|
|
1960
2030
|
value: f,
|
|
1961
2031
|
onChange: (E) => h(E.target.value)
|
|
1962
2032
|
}
|
|
1963
2033
|
),
|
|
1964
|
-
/* @__PURE__ */
|
|
2034
|
+
/* @__PURE__ */ a(
|
|
1965
2035
|
$,
|
|
1966
2036
|
{
|
|
1967
2037
|
color: "primary",
|
|
1968
|
-
onClick:
|
|
2038
|
+
onClick: N,
|
|
1969
2039
|
interaction: f.trim().length > 0 && !le.isPending ? "enabled" : "disabled",
|
|
1970
2040
|
children: m.commentsPost()
|
|
1971
2041
|
}
|
|
@@ -1973,112 +2043,112 @@ function po({
|
|
|
1973
2043
|
] })
|
|
1974
2044
|
] });
|
|
1975
2045
|
}
|
|
1976
|
-
function
|
|
1977
|
-
return /* @__PURE__ */
|
|
2046
|
+
function Er(t) {
|
|
2047
|
+
return /* @__PURE__ */ a("span", { dangerouslySetInnerHTML: { __html: wt(t) } });
|
|
1978
2048
|
}
|
|
1979
|
-
function
|
|
2049
|
+
function Jr({
|
|
1980
2050
|
courseId: t,
|
|
1981
2051
|
assignmentId: n,
|
|
1982
2052
|
userId: i,
|
|
1983
|
-
feedbackMode:
|
|
2053
|
+
feedbackMode: o = !1,
|
|
1984
2054
|
onError: l,
|
|
1985
2055
|
renderHTML: c,
|
|
1986
2056
|
renderPanels: d,
|
|
1987
2057
|
executeQuery: p
|
|
1988
2058
|
}) {
|
|
1989
|
-
const m =
|
|
2059
|
+
const m = V(), f = c ?? Er, {
|
|
1990
2060
|
data: h,
|
|
1991
2061
|
isLoading: C,
|
|
1992
2062
|
isError: I,
|
|
1993
2063
|
error: w
|
|
1994
|
-
} =
|
|
1995
|
-
|
|
1996
|
-
), M =
|
|
2064
|
+
} = rr({ courseId: t, assignmentId: n, userId: i, executeQuery: p }), [y, X] = Ee(null), [fe, le] = Ee(
|
|
2065
|
+
o ? "comments" : null
|
|
2066
|
+
), M = Ve(
|
|
1997
2067
|
() => (h == null ? void 0 : h.submissionsConnection.nodes[0]) ?? null,
|
|
1998
2068
|
[h]
|
|
1999
|
-
), ie = M != null && M.attempt > 0,
|
|
2000
|
-
|
|
2069
|
+
), ie = M != null && M.attempt > 0, N = y ?? M, ce = y == null || y.attempt === (M == null ? void 0 : M.attempt), E = ie && ce, v = ((h == null ? void 0 : h.allowedAttempts) ?? 0) !== 1, ee = Gn((Qe) => {
|
|
2070
|
+
X(Qe);
|
|
2001
2071
|
}, []);
|
|
2002
|
-
if (
|
|
2072
|
+
if (yt(() => {
|
|
2003
2073
|
I && w && l && l(w);
|
|
2004
|
-
}, [I, w, l]),
|
|
2005
|
-
|
|
2006
|
-
}, [
|
|
2007
|
-
return /* @__PURE__ */
|
|
2074
|
+
}, [I, w, l]), yt(() => {
|
|
2075
|
+
o && ie && le("comments");
|
|
2076
|
+
}, [o, ie]), C)
|
|
2077
|
+
return /* @__PURE__ */ a(b, { justifyItems: "center", padding: "large", children: /* @__PURE__ */ a(Ye, { renderTitle: m.progressLoading() }) });
|
|
2008
2078
|
if (I || !h)
|
|
2009
|
-
return /* @__PURE__ */
|
|
2010
|
-
const Ie = !!h.dueAt && new Date(h.dueAt) < /* @__PURE__ */ new Date() && !ie, xe = M ? /* @__PURE__ */
|
|
2011
|
-
|
|
2079
|
+
return /* @__PURE__ */ a(b, { justifyItems: "center", padding: "large", children: /* @__PURE__ */ a(_, { color: "danger", children: m.assignmentLoadError() }) });
|
|
2080
|
+
const Ie = !!h.dueAt && new Date(h.dueAt) < /* @__PURE__ */ new Date() && !ie, xe = M ? /* @__PURE__ */ a(
|
|
2081
|
+
_r,
|
|
2012
2082
|
{
|
|
2013
2083
|
submissionId: M.id,
|
|
2014
2084
|
courseId: t,
|
|
2015
2085
|
assignmentId: n,
|
|
2016
|
-
attempt: (
|
|
2086
|
+
attempt: (N == null ? void 0 : N.attempt) ?? 0,
|
|
2017
2087
|
canPostComment: E,
|
|
2018
2088
|
renderHTML: f,
|
|
2019
2089
|
executeQuery: p
|
|
2020
2090
|
}
|
|
2021
|
-
) : null,
|
|
2022
|
-
|
|
2091
|
+
) : null, Ke = v && M ? /* @__PURE__ */ a(
|
|
2092
|
+
lr,
|
|
2023
2093
|
{
|
|
2024
2094
|
submissionId: M.id,
|
|
2025
|
-
selectedAttempt:
|
|
2095
|
+
selectedAttempt: N == null ? void 0 : N.attempt,
|
|
2026
2096
|
onAttemptSelect: ee,
|
|
2027
2097
|
pointsPossible: h.pointsPossible,
|
|
2028
2098
|
executeQuery: p
|
|
2029
2099
|
}
|
|
2030
|
-
) : null,
|
|
2100
|
+
) : null, Ze = {
|
|
2031
2101
|
commentsPanel: xe,
|
|
2032
|
-
attemptsPanel:
|
|
2102
|
+
attemptsPanel: Ke,
|
|
2033
2103
|
activePanel: fe,
|
|
2034
2104
|
setActivePanel: le,
|
|
2035
2105
|
unreadCommentCount: (M == null ? void 0 : M.unreadCommentCount) ?? 0,
|
|
2036
|
-
hasMultipleAttempts:
|
|
2106
|
+
hasMultipleAttempts: v
|
|
2037
2107
|
};
|
|
2038
2108
|
return /* @__PURE__ */ S(b, { direction: "column", gap: "medium", children: [
|
|
2039
|
-
/* @__PURE__ */
|
|
2040
|
-
|
|
2109
|
+
/* @__PURE__ */ a(
|
|
2110
|
+
fr,
|
|
2041
2111
|
{
|
|
2042
|
-
score:
|
|
2112
|
+
score: N == null ? void 0 : N.score,
|
|
2043
2113
|
pointsPossible: h.pointsPossible,
|
|
2044
2114
|
gradingType: h.gradingType,
|
|
2045
2115
|
dueAt: h.dueAt,
|
|
2046
2116
|
allowedAttempts: h.allowedAttempts,
|
|
2047
|
-
currentAttempt:
|
|
2117
|
+
currentAttempt: N == null ? void 0 : N.attempt,
|
|
2048
2118
|
isOverdue: Ie
|
|
2049
2119
|
}
|
|
2050
2120
|
),
|
|
2051
2121
|
h.description && /* @__PURE__ */ S(Z, { as: "div", children: [
|
|
2052
|
-
/* @__PURE__ */
|
|
2053
|
-
/* @__PURE__ */
|
|
2122
|
+
/* @__PURE__ */ a(_t, { level: "h3", children: m.assignmentInstructions() }),
|
|
2123
|
+
/* @__PURE__ */ a(Z, { as: "div", margin: "small none large none", children: f(h.description) })
|
|
2054
2124
|
] }),
|
|
2055
|
-
/* @__PURE__ */
|
|
2056
|
-
|
|
2125
|
+
/* @__PURE__ */ a(
|
|
2126
|
+
mr,
|
|
2057
2127
|
{
|
|
2058
|
-
submission:
|
|
2128
|
+
submission: N,
|
|
2059
2129
|
isLastAttempt: ce,
|
|
2060
2130
|
renderHTML: f
|
|
2061
2131
|
}
|
|
2062
2132
|
),
|
|
2063
|
-
d ? d(
|
|
2133
|
+
d ? d(Ze) : null
|
|
2064
2134
|
] });
|
|
2065
2135
|
}
|
|
2066
|
-
function
|
|
2136
|
+
function eo({
|
|
2067
2137
|
existingFiles: t,
|
|
2068
2138
|
onSubmit: n,
|
|
2069
2139
|
onSaveDraft: i,
|
|
2070
|
-
onDiscardDraft:
|
|
2140
|
+
onDiscardDraft: o,
|
|
2071
2141
|
onSelectFiles: l,
|
|
2072
2142
|
isSubmitting: c = !1
|
|
2073
2143
|
}) {
|
|
2074
|
-
const d =
|
|
2144
|
+
const d = V(), [p, m] = Ee(t ?? []), f = async () => {
|
|
2075
2145
|
const w = await l();
|
|
2076
2146
|
m((y) => [...y, ...w]);
|
|
2077
2147
|
}, h = (w) => {
|
|
2078
|
-
m((y) => y.filter((
|
|
2148
|
+
m((y) => y.filter((X) => X.id !== w));
|
|
2079
2149
|
}, C = p.map((w) => w.id), I = p.length > 0 && !c;
|
|
2080
2150
|
return /* @__PURE__ */ S(b, { direction: "column", gap: "medium", children: [
|
|
2081
|
-
p.length > 0 && /* @__PURE__ */
|
|
2151
|
+
p.length > 0 && /* @__PURE__ */ a(b, { direction: "column", gap: "x-small", children: p.map((w) => /* @__PURE__ */ a(
|
|
2082
2152
|
Z,
|
|
2083
2153
|
{
|
|
2084
2154
|
as: "div",
|
|
@@ -2087,12 +2157,12 @@ function qo({
|
|
|
2087
2157
|
borderColor: "primary",
|
|
2088
2158
|
borderRadius: "medium",
|
|
2089
2159
|
children: /* @__PURE__ */ S(b, { justifyItems: "space-between", alignItems: "center", children: [
|
|
2090
|
-
/* @__PURE__ */
|
|
2091
|
-
/* @__PURE__ */
|
|
2160
|
+
/* @__PURE__ */ a(_, { children: w.name }),
|
|
2161
|
+
/* @__PURE__ */ a(
|
|
2092
2162
|
$,
|
|
2093
2163
|
{
|
|
2094
2164
|
size: "small",
|
|
2095
|
-
renderIcon: () => /* @__PURE__ */
|
|
2165
|
+
renderIcon: () => /* @__PURE__ */ a(Xn, {}),
|
|
2096
2166
|
onClick: () => h(w.id),
|
|
2097
2167
|
children: /* @__PURE__ */ S("span", { className: "screenreader-only", children: [
|
|
2098
2168
|
"Remove ",
|
|
@@ -2104,9 +2174,9 @@ function qo({
|
|
|
2104
2174
|
},
|
|
2105
2175
|
w.id
|
|
2106
2176
|
)) }),
|
|
2107
|
-
/* @__PURE__ */
|
|
2177
|
+
/* @__PURE__ */ a($, { onClick: f, children: d.submissionFormAddFiles() }),
|
|
2108
2178
|
/* @__PURE__ */ S(b, { gap: "small", children: [
|
|
2109
|
-
/* @__PURE__ */
|
|
2179
|
+
/* @__PURE__ */ a(
|
|
2110
2180
|
$,
|
|
2111
2181
|
{
|
|
2112
2182
|
color: "primary",
|
|
@@ -2115,7 +2185,7 @@ function qo({
|
|
|
2115
2185
|
children: d.submissionFormSubmit()
|
|
2116
2186
|
}
|
|
2117
2187
|
),
|
|
2118
|
-
i && /* @__PURE__ */
|
|
2188
|
+
i && /* @__PURE__ */ a(
|
|
2119
2189
|
$,
|
|
2120
2190
|
{
|
|
2121
2191
|
onClick: () => i(C),
|
|
@@ -2123,67 +2193,67 @@ function qo({
|
|
|
2123
2193
|
children: d.submissionFormSaveDraft()
|
|
2124
2194
|
}
|
|
2125
2195
|
),
|
|
2126
|
-
|
|
2196
|
+
o && t && t.length > 0 && /* @__PURE__ */ a($, { color: "primary-inverse", onClick: o, children: d.submissionFormDiscardDraft() })
|
|
2127
2197
|
] })
|
|
2128
2198
|
] });
|
|
2129
2199
|
}
|
|
2130
|
-
function
|
|
2200
|
+
function to({
|
|
2131
2201
|
prevItem: t,
|
|
2132
2202
|
nextItem: n,
|
|
2133
2203
|
onNavigatePrev: i,
|
|
2134
|
-
onNavigateNext:
|
|
2204
|
+
onNavigateNext: o,
|
|
2135
2205
|
labels: l
|
|
2136
2206
|
}) {
|
|
2137
|
-
const c =
|
|
2207
|
+
const c = V();
|
|
2138
2208
|
if (!t && !n)
|
|
2139
2209
|
return null;
|
|
2140
2210
|
const d = (l == null ? void 0 : l.previous) ?? c.navigationPrevious(), p = (l == null ? void 0 : l.next) ?? c.navigationNext();
|
|
2141
2211
|
return /* @__PURE__ */ S(b, { justifyItems: "space-between", padding: "small none", children: [
|
|
2142
|
-
t ? /* @__PURE__ */
|
|
2212
|
+
t ? /* @__PURE__ */ a(
|
|
2143
2213
|
$,
|
|
2144
2214
|
{
|
|
2145
|
-
renderIcon: () => /* @__PURE__ */
|
|
2215
|
+
renderIcon: () => /* @__PURE__ */ a(bn, {}),
|
|
2146
2216
|
onClick: i,
|
|
2147
2217
|
"aria-label": `${d}: ${t.title}`,
|
|
2148
2218
|
children: d
|
|
2149
2219
|
}
|
|
2150
|
-
) : /* @__PURE__ */
|
|
2151
|
-
n ? /* @__PURE__ */
|
|
2220
|
+
) : /* @__PURE__ */ a("div", {}),
|
|
2221
|
+
n ? /* @__PURE__ */ a(
|
|
2152
2222
|
$,
|
|
2153
2223
|
{
|
|
2154
|
-
renderIcon: () => /* @__PURE__ */
|
|
2155
|
-
onClick:
|
|
2224
|
+
renderIcon: () => /* @__PURE__ */ a(Tn, {}),
|
|
2225
|
+
onClick: o,
|
|
2156
2226
|
"aria-label": `${p}: ${n.title}`,
|
|
2157
2227
|
children: p
|
|
2158
2228
|
}
|
|
2159
|
-
) : /* @__PURE__ */
|
|
2229
|
+
) : /* @__PURE__ */ a("div", {})
|
|
2160
2230
|
] });
|
|
2161
2231
|
}
|
|
2162
|
-
function
|
|
2232
|
+
function Ir(t) {
|
|
2163
2233
|
switch (t) {
|
|
2164
2234
|
case "Assignment":
|
|
2165
|
-
return /* @__PURE__ */
|
|
2235
|
+
return /* @__PURE__ */ a(ei, {});
|
|
2166
2236
|
case "Quiz":
|
|
2167
|
-
return /* @__PURE__ */
|
|
2237
|
+
return /* @__PURE__ */ a(Jn, {});
|
|
2168
2238
|
case "Discussion":
|
|
2169
|
-
return /* @__PURE__ */
|
|
2239
|
+
return /* @__PURE__ */ a(Qn, {});
|
|
2170
2240
|
case "Page":
|
|
2171
|
-
return /* @__PURE__ */
|
|
2241
|
+
return /* @__PURE__ */ a(Zt, {});
|
|
2172
2242
|
case "ExternalUrl":
|
|
2173
2243
|
case "ExternalTool":
|
|
2174
|
-
return /* @__PURE__ */
|
|
2244
|
+
return /* @__PURE__ */ a(Zn, {});
|
|
2175
2245
|
default:
|
|
2176
|
-
return /* @__PURE__ */
|
|
2246
|
+
return /* @__PURE__ */ a(Zt, {});
|
|
2177
2247
|
}
|
|
2178
2248
|
}
|
|
2179
|
-
function
|
|
2249
|
+
function wr({
|
|
2180
2250
|
item: t,
|
|
2181
2251
|
isSelected: n,
|
|
2182
2252
|
isLoadingItem: i,
|
|
2183
|
-
onClick:
|
|
2253
|
+
onClick: o
|
|
2184
2254
|
}) {
|
|
2185
2255
|
var m, f, h, C, I;
|
|
2186
|
-
const l =
|
|
2256
|
+
const l = V(), c = ((m = t.content_details) == null ? void 0 : m.locked_for_user) ?? !1, d = (f = t.content_details) == null ? void 0 : f.lock_explanation, p = /* @__PURE__ */ a(
|
|
2187
2257
|
Z,
|
|
2188
2258
|
{
|
|
2189
2259
|
as: "div",
|
|
@@ -2191,33 +2261,33 @@ function bo({
|
|
|
2191
2261
|
background: n ? "secondary" : "primary",
|
|
2192
2262
|
borderRadius: "small",
|
|
2193
2263
|
cursor: c ? "not-allowed" : "pointer",
|
|
2194
|
-
onClick: c ? void 0 :
|
|
2264
|
+
onClick: c ? void 0 : o,
|
|
2195
2265
|
role: c ? void 0 : "button",
|
|
2196
2266
|
tabIndex: c ? void 0 : 0,
|
|
2197
2267
|
onKeyDown: c ? void 0 : (w) => {
|
|
2198
|
-
(w.key === "Enter" || w.key === " ") && (w.preventDefault(),
|
|
2268
|
+
(w.key === "Enter" || w.key === " ") && (w.preventDefault(), o());
|
|
2199
2269
|
},
|
|
2200
2270
|
children: /* @__PURE__ */ S(b, { gap: "small", alignItems: "center", children: [
|
|
2201
|
-
/* @__PURE__ */
|
|
2202
|
-
/* @__PURE__ */
|
|
2203
|
-
/* @__PURE__ */
|
|
2204
|
-
((h = t.content_details) == null ? void 0 : h.due_at) && /* @__PURE__ */
|
|
2271
|
+
/* @__PURE__ */ a(b.Item, { children: c ? /* @__PURE__ */ a(yn, {}) : Ir(t.type) }),
|
|
2272
|
+
/* @__PURE__ */ a(b.Item, { shouldGrow: !0, shouldShrink: !0, children: /* @__PURE__ */ S(b, { direction: "column", gap: "xx-small", children: [
|
|
2273
|
+
/* @__PURE__ */ a(_, { weight: n ? "bold" : "normal", size: "small", children: t.title }),
|
|
2274
|
+
((h = t.content_details) == null ? void 0 : h.due_at) && /* @__PURE__ */ a(_, { size: "x-small", color: "secondary", children: l.progressDueDate({
|
|
2205
2275
|
date: new Date(t.content_details.due_at).toLocaleDateString()
|
|
2206
2276
|
}) }),
|
|
2207
|
-
((C = t.content_details) == null ? void 0 : C.points_possible) != null && /* @__PURE__ */
|
|
2277
|
+
((C = t.content_details) == null ? void 0 : C.points_possible) != null && /* @__PURE__ */ a(_, { size: "x-small", color: "secondary", children: l.progressPoints({ points: t.content_details.points_possible }) })
|
|
2208
2278
|
] }) }),
|
|
2209
|
-
i && /* @__PURE__ */
|
|
2210
|
-
((I = t.completion_requirement) == null ? void 0 : I.completed) && /* @__PURE__ */
|
|
2279
|
+
i && /* @__PURE__ */ a(Ye, { size: "x-small", renderTitle: l.progressLoading() }),
|
|
2280
|
+
((I = t.completion_requirement) == null ? void 0 : I.completed) && /* @__PURE__ */ a(_, { color: "success", size: "small", children: "✓" })
|
|
2211
2281
|
] })
|
|
2212
2282
|
}
|
|
2213
2283
|
);
|
|
2214
|
-
return c && d ? /* @__PURE__ */
|
|
2284
|
+
return c && d ? /* @__PURE__ */ a(ii, { renderTip: d, placement: "end", children: p }) : p;
|
|
2215
2285
|
}
|
|
2216
|
-
function
|
|
2286
|
+
function no({
|
|
2217
2287
|
module: t,
|
|
2218
2288
|
currentItemId: n,
|
|
2219
2289
|
onItemClick: i,
|
|
2220
|
-
onClose:
|
|
2290
|
+
onClose: o,
|
|
2221
2291
|
onNavigateModule: l,
|
|
2222
2292
|
hasPrevModule: c = !1,
|
|
2223
2293
|
hasNextModule: d = !1,
|
|
@@ -2225,21 +2295,21 @@ function Vo({
|
|
|
2225
2295
|
title: m
|
|
2226
2296
|
}) {
|
|
2227
2297
|
var C;
|
|
2228
|
-
const f =
|
|
2298
|
+
const f = V(), h = m ?? f.navigationMyProgress();
|
|
2229
2299
|
return /* @__PURE__ */ S(b, { direction: "column", height: "100%", children: [
|
|
2230
2300
|
/* @__PURE__ */ S(b, { justifyItems: "space-between", alignItems: "center", padding: "small", children: [
|
|
2231
|
-
/* @__PURE__ */
|
|
2232
|
-
/* @__PURE__ */
|
|
2301
|
+
/* @__PURE__ */ a(_t, { level: "h3", children: h }),
|
|
2302
|
+
/* @__PURE__ */ a(ni, { screenReaderLabel: f.navigationClosePanel(), onClick: o, size: "small", children: /* @__PURE__ */ a(Kn, {}) })
|
|
2233
2303
|
] }),
|
|
2234
2304
|
/* @__PURE__ */ S(Z, { as: "div", padding: "none small", overflowY: "auto", children: [
|
|
2235
|
-
t.state === "locked" && /* @__PURE__ */
|
|
2236
|
-
/* @__PURE__ */
|
|
2305
|
+
t.state === "locked" && /* @__PURE__ */ a(b, { padding: "none none small", children: /* @__PURE__ */ S(Et, { color: "warning", children: [
|
|
2306
|
+
/* @__PURE__ */ a(yn, {}),
|
|
2237
2307
|
" ",
|
|
2238
2308
|
f.progressLocked()
|
|
2239
2309
|
] }) }),
|
|
2240
|
-
/* @__PURE__ */
|
|
2241
|
-
/* @__PURE__ */
|
|
2242
|
-
|
|
2310
|
+
/* @__PURE__ */ a(_, { weight: "bold", size: "medium", children: t.name }),
|
|
2311
|
+
/* @__PURE__ */ a(b, { direction: "column", gap: "xx-small", padding: "small none", children: (C = t.items) == null ? void 0 : C.map((I) => /* @__PURE__ */ a(
|
|
2312
|
+
wr,
|
|
2243
2313
|
{
|
|
2244
2314
|
item: I,
|
|
2245
2315
|
isSelected: I.id === n,
|
|
@@ -2250,10 +2320,10 @@ function Vo({
|
|
|
2250
2320
|
)) })
|
|
2251
2321
|
] }),
|
|
2252
2322
|
l && /* @__PURE__ */ S(b, { justifyItems: "space-between", padding: "small", children: [
|
|
2253
|
-
/* @__PURE__ */
|
|
2323
|
+
/* @__PURE__ */ a(
|
|
2254
2324
|
$,
|
|
2255
2325
|
{
|
|
2256
|
-
renderIcon: () => /* @__PURE__ */
|
|
2326
|
+
renderIcon: () => /* @__PURE__ */ a(bn, {}),
|
|
2257
2327
|
size: "small",
|
|
2258
2328
|
interaction: c ? "enabled" : "disabled",
|
|
2259
2329
|
onClick: () => l("prev"),
|
|
@@ -2261,10 +2331,10 @@ function Vo({
|
|
|
2261
2331
|
children: f.navigationPrevious()
|
|
2262
2332
|
}
|
|
2263
2333
|
),
|
|
2264
|
-
/* @__PURE__ */
|
|
2334
|
+
/* @__PURE__ */ a(
|
|
2265
2335
|
$,
|
|
2266
2336
|
{
|
|
2267
|
-
renderIcon: () => /* @__PURE__ */
|
|
2337
|
+
renderIcon: () => /* @__PURE__ */ a(Tn, {}),
|
|
2268
2338
|
size: "small",
|
|
2269
2339
|
interaction: d ? "enabled" : "disabled",
|
|
2270
2340
|
onClick: () => l("next"),
|
|
@@ -2275,17 +2345,17 @@ function Vo({
|
|
|
2275
2345
|
] })
|
|
2276
2346
|
] });
|
|
2277
2347
|
}
|
|
2278
|
-
function
|
|
2348
|
+
function io({
|
|
2279
2349
|
existingDraft: t,
|
|
2280
2350
|
onSubmit: n,
|
|
2281
2351
|
onSaveDraft: i,
|
|
2282
|
-
onDiscardDraft:
|
|
2352
|
+
onDiscardDraft: o,
|
|
2283
2353
|
isSubmitting: l = !1
|
|
2284
2354
|
}) {
|
|
2285
|
-
const c =
|
|
2355
|
+
const c = V(), [d, p] = Ee(t ?? ""), m = d.trim().length > 0 && !l;
|
|
2286
2356
|
return /* @__PURE__ */ S(b, { direction: "column", gap: "medium", children: [
|
|
2287
|
-
/* @__PURE__ */
|
|
2288
|
-
|
|
2357
|
+
/* @__PURE__ */ a(
|
|
2358
|
+
Sn,
|
|
2289
2359
|
{
|
|
2290
2360
|
label: c.submissionTextHeading(),
|
|
2291
2361
|
value: d,
|
|
@@ -2295,7 +2365,7 @@ function Xo({
|
|
|
2295
2365
|
}
|
|
2296
2366
|
),
|
|
2297
2367
|
/* @__PURE__ */ S(b, { gap: "small", children: [
|
|
2298
|
-
/* @__PURE__ */
|
|
2368
|
+
/* @__PURE__ */ a(
|
|
2299
2369
|
$,
|
|
2300
2370
|
{
|
|
2301
2371
|
color: "primary",
|
|
@@ -2304,7 +2374,7 @@ function Xo({
|
|
|
2304
2374
|
children: c.submissionFormSubmit()
|
|
2305
2375
|
}
|
|
2306
2376
|
),
|
|
2307
|
-
i && /* @__PURE__ */
|
|
2377
|
+
i && /* @__PURE__ */ a(
|
|
2308
2378
|
$,
|
|
2309
2379
|
{
|
|
2310
2380
|
onClick: () => i(d),
|
|
@@ -2312,68 +2382,68 @@ function Xo({
|
|
|
2312
2382
|
children: c.submissionFormSaveDraft()
|
|
2313
2383
|
}
|
|
2314
2384
|
),
|
|
2315
|
-
|
|
2385
|
+
o && t && /* @__PURE__ */ a($, { color: "primary-inverse", onClick: o, children: c.submissionFormDiscardDraft() })
|
|
2316
2386
|
] })
|
|
2317
2387
|
] });
|
|
2318
2388
|
}
|
|
2319
|
-
function
|
|
2389
|
+
function ro({
|
|
2320
2390
|
unreadCount: t
|
|
2321
2391
|
}) {
|
|
2322
|
-
const n =
|
|
2392
|
+
const n = V();
|
|
2323
2393
|
if (t === 0)
|
|
2324
2394
|
return null;
|
|
2325
2395
|
const i = t === 1 ? n.commentsUnreadSingle() : n.commentsUnread({ count: t });
|
|
2326
|
-
return /* @__PURE__ */
|
|
2396
|
+
return /* @__PURE__ */ a(_n, { count: t, standalone: !0, children: /* @__PURE__ */ a(It, { children: i }) });
|
|
2327
2397
|
}
|
|
2328
|
-
function
|
|
2398
|
+
function oo({
|
|
2329
2399
|
courseId: t,
|
|
2330
2400
|
moduleItemId: n,
|
|
2331
2401
|
fetchSequence: i,
|
|
2332
|
-
enabled:
|
|
2402
|
+
enabled: o = !0
|
|
2333
2403
|
}) {
|
|
2334
|
-
return
|
|
2404
|
+
return Xe({
|
|
2335
2405
|
queryKey: ["assignment-review", "module-item-sequence", t, n],
|
|
2336
2406
|
queryFn: () => i(t, n),
|
|
2337
|
-
enabled:
|
|
2407
|
+
enabled: o && !!n
|
|
2338
2408
|
});
|
|
2339
2409
|
}
|
|
2340
2410
|
export {
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2411
|
+
Qi as AssignmentResponseSchema,
|
|
2412
|
+
Jr as AssignmentReview,
|
|
2413
|
+
sr as AttemptCard,
|
|
2414
|
+
mr as AttemptView,
|
|
2415
|
+
lr as AttemptsHistory,
|
|
2416
|
+
Kr as CREATE_SUBMISSION,
|
|
2417
|
+
pr as CREATE_SUBMISSION_COMMENT,
|
|
2418
|
+
Zr as CREATE_SUBMISSION_DRAFT,
|
|
2419
|
+
Sr as CommentCard,
|
|
2420
|
+
nr as CreateSubmissionCommentResponseSchema,
|
|
2421
|
+
Yr as CreateSubmissionDraftResponseSchema,
|
|
2422
|
+
Vr as CreateSubmissionResponseSchema,
|
|
2423
|
+
Qr as DELETE_SUBMISSION_DRAFT,
|
|
2424
|
+
Xr as DeleteSubmissionDraftResponseSchema,
|
|
2425
|
+
Nn as DownloadButtons,
|
|
2426
|
+
eo as FileUploadSubmissionForm,
|
|
2427
|
+
qi as GET_ASSIGNMENT,
|
|
2428
|
+
Yi as GET_SUBMISSIONS,
|
|
2429
|
+
Vi as GET_SUBMISSION_COMMENTS,
|
|
2430
|
+
fr as LearningContentHeader,
|
|
2431
|
+
gr as MARK_SUBMISSION_COMMENTS_READ,
|
|
2432
|
+
ir as MarkSubmissionCommentsReadResponseSchema,
|
|
2433
|
+
to as ModuleNavigation,
|
|
2434
|
+
no as MyProgressPanel,
|
|
2435
|
+
_r as SubmissionComments,
|
|
2436
|
+
qr as SubmissionCommentsDataSchema,
|
|
2437
|
+
Ji as SubmissionCommentsQueryResponseSchema,
|
|
2438
|
+
tr as SubmissionsQueryResponseSchema,
|
|
2439
|
+
io as TextEntrySubmissionForm,
|
|
2440
|
+
Wr as TranslationsProvider,
|
|
2441
|
+
ro as UnreadCommentsBadge,
|
|
2442
|
+
hr as useCreateSubmissionComment,
|
|
2443
|
+
rr as useGetAssignment,
|
|
2444
|
+
br as useGetSubmissionComments,
|
|
2445
|
+
or as useGetSubmissions,
|
|
2446
|
+
Tr as useMarkSubmissionCommentsRead,
|
|
2447
|
+
oo as useModuleItemSequence,
|
|
2448
|
+
V as useTranslations
|
|
2379
2449
|
};
|