@instructure/platform-assignment-review 0.4.17 → 0.4.19
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 +806 -710
- 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
|
|
@@ -932,7 +997,33 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
932
997
|
// files from a separate sandboxed origin. object/embed also have no usable
|
|
933
998
|
// sandbox attribute, so the sandbox-token hook cannot constrain them — again,
|
|
934
999
|
// parity with an unsandboxed iframe, which is already permitted.
|
|
935
|
-
|
|
1000
|
+
//
|
|
1001
|
+
// maction…none are the remaining MathML presentation/layout containers from
|
|
1002
|
+
// DOMPurify's mathMlDisallowed set (RCX-5259). They are re-added as tags only:
|
|
1003
|
+
// unlike annotation-xml they are NOT HTML integration points, so they carry no
|
|
1004
|
+
// namespace-confusion (mXSS) risk and need no guarding hook. Because they go in
|
|
1005
|
+
// ADD_TAGS and not ADD_ATTR, DOMPurify keeps filtering their attributes — an
|
|
1006
|
+
// event handler like onclick on <maction> is still stripped.
|
|
1007
|
+
ADD_TAGS: [
|
|
1008
|
+
"iframe",
|
|
1009
|
+
"semantics",
|
|
1010
|
+
"annotation",
|
|
1011
|
+
"annotation-xml",
|
|
1012
|
+
"object",
|
|
1013
|
+
"embed",
|
|
1014
|
+
"param",
|
|
1015
|
+
"maction",
|
|
1016
|
+
"maligngroup",
|
|
1017
|
+
"malignmark",
|
|
1018
|
+
"mlongdiv",
|
|
1019
|
+
"mscarries",
|
|
1020
|
+
"mscarry",
|
|
1021
|
+
"msgroup",
|
|
1022
|
+
"mstack",
|
|
1023
|
+
"msline",
|
|
1024
|
+
"msrow",
|
|
1025
|
+
"none"
|
|
1026
|
+
],
|
|
936
1027
|
ADD_ATTR: [
|
|
937
1028
|
"allowfullscreen",
|
|
938
1029
|
"allow",
|
|
@@ -963,10 +1054,6 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
963
1054
|
"intent",
|
|
964
1055
|
"arg"
|
|
965
1056
|
],
|
|
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
1057
|
// In browsers that support the Trusted Types API (Chromium, Firefox),
|
|
971
1058
|
// DOMPurify returns a TrustedHTML object rather than a plain string. The
|
|
972
1059
|
// exported sanitizeHtml signature declares string — a deliberate lie that
|
|
@@ -982,17 +1069,17 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
982
1069
|
// confusion attacks where fragments like <svg> could influence parse context.
|
|
983
1070
|
FORCE_BODY: !0
|
|
984
1071
|
};
|
|
985
|
-
let
|
|
986
|
-
function
|
|
987
|
-
if (
|
|
988
|
-
|
|
1072
|
+
let q = null;
|
|
1073
|
+
function Wi() {
|
|
1074
|
+
if (q) return q;
|
|
1075
|
+
q = typeof Tt == "function" ? Tt(window) : Tt, q.addHook("afterSanitizeAttributes", (n) => {
|
|
989
1076
|
if (!(n instanceof Element) || !n.hasAttribute("style")) return;
|
|
990
|
-
const i = n.style,
|
|
1077
|
+
const i = n.style, o = [];
|
|
991
1078
|
for (let m = 0; m < i.length; m++) {
|
|
992
1079
|
const f = i.item(m);
|
|
993
|
-
|
|
1080
|
+
Fi.has(f) || o.push(f);
|
|
994
1081
|
}
|
|
995
|
-
for (const m of
|
|
1082
|
+
for (const m of o) i.removeProperty(m);
|
|
996
1083
|
const l = /* @__PURE__ */ new Set([
|
|
997
1084
|
"static",
|
|
998
1085
|
"relative",
|
|
@@ -1006,59 +1093,68 @@ function Pi() {
|
|
|
1006
1093
|
c && !l.has(c) && i.removeProperty("position");
|
|
1007
1094
|
const d = /* @__PURE__ */ new Set(["initial", "inherit", "unset", "revert", "revert-layer"]), p = i.getPropertyValue("opacity").trim().toLowerCase();
|
|
1008
1095
|
p && !d.has(p) && (p.endsWith("%") ? parseFloat(p) / 100 : parseFloat(p)) < 0.05 && i.removeProperty("opacity");
|
|
1009
|
-
for (const m of
|
|
1096
|
+
for (const m of Ui) {
|
|
1010
1097
|
const f = i.getPropertyValue(m);
|
|
1011
|
-
f &&
|
|
1098
|
+
f && ji.test(f) && i.removeProperty(m);
|
|
1012
1099
|
}
|
|
1013
1100
|
i.length === 0 && n.removeAttribute("style");
|
|
1014
|
-
}),
|
|
1015
|
-
if (!
|
|
1016
|
-
const
|
|
1017
|
-
/^\s*\/\//.test(
|
|
1018
|
-
}),
|
|
1101
|
+
}), q.addHook("uponSanitizeAttribute", (n, i) => {
|
|
1102
|
+
if (!zi.has(i.attrName)) return;
|
|
1103
|
+
const o = i.attrValue;
|
|
1104
|
+
/^\s*\/\//.test(o) ? (i.attrValue = o.trimStart().replace(/^\/\//, "https://"), i.keepAttr = !0) : /^\s*\\/.test(o) && (i.keepAttr = !1);
|
|
1105
|
+
}), q.addHook("uponSanitizeAttribute", (n, i) => {
|
|
1106
|
+
if (!Bi.has(i.attrName)) return;
|
|
1107
|
+
const o = i.attrValue;
|
|
1108
|
+
if (!o.trim()) return;
|
|
1109
|
+
const l = /^\s*\/\//.test(o) ? o.trimStart().replace(/^\/\//, "https://") : o;
|
|
1110
|
+
i.attrValue = Pi(l);
|
|
1111
|
+
}), q.addHook("uponSanitizeAttribute", (n, i) => {
|
|
1112
|
+
const o = $i[i.attrName];
|
|
1113
|
+
!o || !(n instanceof Element) || (n.hasAttribute(o) || n.setAttribute(o, i.attrValue), i.keepAttr = !1);
|
|
1114
|
+
}), q.addHook("afterSanitizeAttributes", (n) => {
|
|
1019
1115
|
if (!(n instanceof Element) || !n.hasAttribute("srcset")) return;
|
|
1020
|
-
const i = (n.getAttribute("srcset") ?? "").split(","),
|
|
1021
|
-
if (i.some((d) => /^\s*\\/.test(
|
|
1116
|
+
const i = (n.getAttribute("srcset") ?? "").split(","), o = (d) => d.trim().split(/\s+/)[0];
|
|
1117
|
+
if (i.some((d) => /^\s*\\/.test(o(d)))) {
|
|
1022
1118
|
n.removeAttribute("srcset");
|
|
1023
1119
|
return;
|
|
1024
1120
|
}
|
|
1025
1121
|
let l = !1;
|
|
1026
1122
|
const c = i.map((d) => {
|
|
1027
|
-
const p =
|
|
1123
|
+
const p = o(d);
|
|
1028
1124
|
if (!p.startsWith("//")) return d;
|
|
1029
1125
|
l = !0;
|
|
1030
1126
|
const m = d.indexOf(p);
|
|
1031
1127
|
return d.slice(0, m) + "https://" + p.slice(2) + d.slice(m + p.length);
|
|
1032
1128
|
});
|
|
1033
1129
|
l && n.setAttribute("srcset", c.join(","));
|
|
1034
|
-
}),
|
|
1130
|
+
}), q.addHook("afterSanitizeAttributes", (n) => {
|
|
1035
1131
|
var i;
|
|
1036
1132
|
if (!(n instanceof Element) || n.tagName !== "A" && n.tagName !== "AREA" || ((i = n.getAttribute("target")) == null ? void 0 : i.toLowerCase()) !== "_blank") return;
|
|
1037
|
-
const
|
|
1133
|
+
const o = n.getAttribute("rel") ?? "", l = new Set(o.split(/\s+/).filter(Boolean));
|
|
1038
1134
|
l.add("noopener"), n.setAttribute("rel", [...l].join(" "));
|
|
1039
|
-
}),
|
|
1135
|
+
}), q.addHook("afterSanitizeAttributes", (n) => {
|
|
1040
1136
|
if (!(n instanceof Element) || n.tagName !== "IFRAME" || !n.hasAttribute("sandbox")) return;
|
|
1041
|
-
const i = (n.getAttribute("sandbox") ?? "").toLowerCase().split(/\s+/).filter(Boolean),
|
|
1042
|
-
|
|
1043
|
-
}),
|
|
1137
|
+
const i = (n.getAttribute("sandbox") ?? "").toLowerCase().split(/\s+/).filter(Boolean), o = i.filter((l) => Hi.has(l));
|
|
1138
|
+
o.length !== i.length && n.setAttribute("sandbox", o.join(" "));
|
|
1139
|
+
}), q.addHook("afterSanitizeAttributes", (n) => {
|
|
1044
1140
|
if (!(n instanceof Element) || n.tagName !== "PARAM") return;
|
|
1045
1141
|
const i = n.getAttribute("value");
|
|
1046
1142
|
i && /^\s*(?:javascript|vbscript):/i.test(i) && n.removeAttribute("value");
|
|
1047
1143
|
});
|
|
1048
1144
|
const t = /* @__PURE__ */ new Set(["text/html", "application/xhtml+xml"]);
|
|
1049
|
-
return
|
|
1145
|
+
return q.addHook("afterSanitizeElements", (n) => {
|
|
1050
1146
|
if (!(n instanceof Element) || n.tagName.toLowerCase() !== "annotation-xml") return;
|
|
1051
1147
|
const i = (n.getAttribute("encoding") ?? "").toLowerCase().trim();
|
|
1052
1148
|
t.has(i) && n.remove();
|
|
1053
|
-
}),
|
|
1149
|
+
}), q;
|
|
1054
1150
|
}
|
|
1055
|
-
function
|
|
1151
|
+
function wt(t, n) {
|
|
1056
1152
|
if (typeof window > "u")
|
|
1057
1153
|
throw new Error("sanitizeHtml requires a DOM environment (window is not defined)");
|
|
1058
|
-
const i =
|
|
1059
|
-
return
|
|
1154
|
+
const i = Gi;
|
|
1155
|
+
return Wi().sanitize(t ?? "", i);
|
|
1060
1156
|
}
|
|
1061
|
-
const
|
|
1157
|
+
const qi = se`
|
|
1062
1158
|
query GetAssignment($courseId: ID!, $assignmentId: ID!, $userId: ID!) {
|
|
1063
1159
|
legacyNode(_id: $assignmentId, type: Assignment) {
|
|
1064
1160
|
... on Assignment {
|
|
@@ -1117,7 +1213,7 @@ const Fi = ae`
|
|
|
1117
1213
|
contentType
|
|
1118
1214
|
submissionPreviewUrl
|
|
1119
1215
|
}
|
|
1120
|
-
`,
|
|
1216
|
+
`, Vi = se`
|
|
1121
1217
|
query GetSubmissionComments(
|
|
1122
1218
|
$submissionId: ID!
|
|
1123
1219
|
$courseId: String
|
|
@@ -1166,7 +1262,7 @@ const Fi = ae`
|
|
|
1166
1262
|
}
|
|
1167
1263
|
}
|
|
1168
1264
|
}
|
|
1169
|
-
`,
|
|
1265
|
+
`, Yi = se`
|
|
1170
1266
|
query getSubmissions($submissionId: ID!) {
|
|
1171
1267
|
node(id: $submissionId) {
|
|
1172
1268
|
... on Submission {
|
|
@@ -1200,197 +1296,197 @@ const Fi = ae`
|
|
|
1200
1296
|
contentType
|
|
1201
1297
|
submissionPreviewUrl
|
|
1202
1298
|
}
|
|
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:
|
|
1299
|
+
`, Oe = r.object({
|
|
1300
|
+
_id: r.string(),
|
|
1301
|
+
displayName: r.string(),
|
|
1302
|
+
id: r.string(),
|
|
1303
|
+
mimeClass: r.string(),
|
|
1304
|
+
url: r.string(),
|
|
1305
|
+
contentType: r.string(),
|
|
1306
|
+
submissionPreviewUrl: r.string().nullable()
|
|
1307
|
+
}), Xi = r.object({
|
|
1308
|
+
_id: r.string(),
|
|
1309
|
+
activeSubmissionType: r.string(),
|
|
1310
|
+
body: r.string().nullable(),
|
|
1311
|
+
attachments: r.array(Oe).nullable()
|
|
1312
|
+
}), Ki = r.object({
|
|
1313
|
+
id: r.string(),
|
|
1314
|
+
submittedAt: r.string(),
|
|
1315
|
+
body: r.string().nullable(),
|
|
1316
|
+
grade: r.string().nullable(),
|
|
1317
|
+
score: r.number().nullable(),
|
|
1318
|
+
submissionType: r.string(),
|
|
1319
|
+
attempt: r.number(),
|
|
1320
|
+
unreadCommentCount: r.number(),
|
|
1321
|
+
attachment: Oe.nullable(),
|
|
1322
|
+
attachments: r.array(Oe).nullable(),
|
|
1323
|
+
submissionDraft: Xi.nullable()
|
|
1324
|
+
}), Zi = r.object({
|
|
1325
|
+
_id: r.string(),
|
|
1326
|
+
name: r.string(),
|
|
1327
|
+
description: r.string().nullable(),
|
|
1328
|
+
allowedExtensions: r.array(r.string()).nullable(),
|
|
1329
|
+
allowedAttempts: r.number().nullable(),
|
|
1330
|
+
dueAt: r.string().nullable(),
|
|
1331
|
+
pointsPossible: r.number().nullable(),
|
|
1332
|
+
submissionTypes: r.array(r.string()),
|
|
1333
|
+
gradingType: r.string(),
|
|
1334
|
+
published: r.boolean().nullable().optional(),
|
|
1335
|
+
submissionsConnection: r.object({
|
|
1336
|
+
nodes: r.array(Ki)
|
|
1241
1337
|
})
|
|
1242
|
-
}),
|
|
1243
|
-
legacyNode:
|
|
1244
|
-
course:
|
|
1245
|
-
name:
|
|
1338
|
+
}), Qi = r.object({
|
|
1339
|
+
legacyNode: Zi,
|
|
1340
|
+
course: r.object({
|
|
1341
|
+
name: r.string()
|
|
1246
1342
|
})
|
|
1247
|
-
}),
|
|
1248
|
-
startCursor:
|
|
1249
|
-
endCursor:
|
|
1250
|
-
hasPreviousPage:
|
|
1251
|
-
hasNextPage:
|
|
1252
|
-
}),
|
|
1253
|
-
_id:
|
|
1254
|
-
attempt:
|
|
1255
|
-
author:
|
|
1256
|
-
avatarUrl:
|
|
1257
|
-
shortName:
|
|
1258
|
-
courseRoles:
|
|
1343
|
+
}), Dn = r.object({
|
|
1344
|
+
startCursor: r.string(),
|
|
1345
|
+
endCursor: r.string(),
|
|
1346
|
+
hasPreviousPage: r.boolean(),
|
|
1347
|
+
hasNextPage: r.boolean()
|
|
1348
|
+
}), Rn = r.object({
|
|
1349
|
+
_id: r.string(),
|
|
1350
|
+
attempt: r.number(),
|
|
1351
|
+
author: r.object({
|
|
1352
|
+
avatarUrl: r.string().nullable(),
|
|
1353
|
+
shortName: r.string(),
|
|
1354
|
+
courseRoles: r.string().nullable()
|
|
1259
1355
|
}),
|
|
1260
|
-
htmlComment:
|
|
1261
|
-
read:
|
|
1262
|
-
updatedAt:
|
|
1263
|
-
createdAt:
|
|
1264
|
-
attachments:
|
|
1265
|
-
|
|
1266
|
-
url:
|
|
1267
|
-
mimeClass:
|
|
1268
|
-
displayName:
|
|
1269
|
-
contentType:
|
|
1270
|
-
id:
|
|
1356
|
+
htmlComment: r.string(),
|
|
1357
|
+
read: r.boolean(),
|
|
1358
|
+
updatedAt: r.string(),
|
|
1359
|
+
createdAt: r.string(),
|
|
1360
|
+
attachments: r.array(
|
|
1361
|
+
r.object({
|
|
1362
|
+
url: r.string(),
|
|
1363
|
+
mimeClass: r.string(),
|
|
1364
|
+
displayName: r.string(),
|
|
1365
|
+
contentType: r.string(),
|
|
1366
|
+
id: r.string()
|
|
1271
1367
|
})
|
|
1272
1368
|
).nullable()
|
|
1273
|
-
}),
|
|
1274
|
-
submissionComments:
|
|
1275
|
-
commentsConnection:
|
|
1276
|
-
pageInfo:
|
|
1277
|
-
nodes:
|
|
1369
|
+
}), Ji = r.object({
|
|
1370
|
+
submissionComments: r.object({
|
|
1371
|
+
commentsConnection: r.object({
|
|
1372
|
+
pageInfo: Dn,
|
|
1373
|
+
nodes: r.array(Rn)
|
|
1278
1374
|
})
|
|
1279
1375
|
})
|
|
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:
|
|
1376
|
+
}), qr = r.object({
|
|
1377
|
+
comments: r.array(Rn),
|
|
1378
|
+
pageInfo: Dn
|
|
1379
|
+
}), er = r.object({
|
|
1380
|
+
submittedAt: r.string(),
|
|
1381
|
+
body: r.string().nullable(),
|
|
1382
|
+
grade: r.string().nullable(),
|
|
1383
|
+
score: r.number().nullable(),
|
|
1384
|
+
submissionType: r.string(),
|
|
1385
|
+
state: r.string(),
|
|
1386
|
+
attempt: r.number(),
|
|
1387
|
+
attachment: Oe.nullable(),
|
|
1388
|
+
attachments: r.array(Oe).nullable()
|
|
1389
|
+
}), tr = r.object({
|
|
1390
|
+
node: r.object({
|
|
1391
|
+
submissionHistoriesConnection: r.object({
|
|
1392
|
+
nodes: r.array(er)
|
|
1297
1393
|
})
|
|
1298
1394
|
})
|
|
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:
|
|
1395
|
+
}), Le = r.object({
|
|
1396
|
+
attribute: r.string(),
|
|
1397
|
+
message: r.string()
|
|
1398
|
+
}), nr = r.object({
|
|
1399
|
+
createSubmissionComment: r.object({
|
|
1400
|
+
submissionComment: r.object({
|
|
1401
|
+
_id: r.string(),
|
|
1402
|
+
attachments: r.array(
|
|
1403
|
+
r.object({
|
|
1404
|
+
_id: r.string(),
|
|
1405
|
+
displayName: r.string(),
|
|
1406
|
+
id: r.string(),
|
|
1407
|
+
mimeClass: r.string(),
|
|
1408
|
+
url: r.string()
|
|
1313
1409
|
})
|
|
1314
1410
|
).nullable(),
|
|
1315
|
-
author:
|
|
1316
|
-
avatarUrl:
|
|
1317
|
-
shortName:
|
|
1411
|
+
author: r.object({
|
|
1412
|
+
avatarUrl: r.string().nullable(),
|
|
1413
|
+
shortName: r.string()
|
|
1318
1414
|
}),
|
|
1319
|
-
htmlComment:
|
|
1320
|
-
mediaObject:
|
|
1321
|
-
id:
|
|
1322
|
-
_id:
|
|
1323
|
-
mediaSources:
|
|
1324
|
-
|
|
1325
|
-
height:
|
|
1326
|
-
src:
|
|
1327
|
-
type:
|
|
1328
|
-
width:
|
|
1415
|
+
htmlComment: r.string(),
|
|
1416
|
+
mediaObject: r.object({
|
|
1417
|
+
id: r.string(),
|
|
1418
|
+
_id: r.string(),
|
|
1419
|
+
mediaSources: r.array(
|
|
1420
|
+
r.object({
|
|
1421
|
+
height: r.string(),
|
|
1422
|
+
src: r.string(),
|
|
1423
|
+
type: r.string(),
|
|
1424
|
+
width: r.string()
|
|
1329
1425
|
})
|
|
1330
1426
|
),
|
|
1331
|
-
mediaTracks:
|
|
1332
|
-
|
|
1333
|
-
_id:
|
|
1334
|
-
locale:
|
|
1335
|
-
content:
|
|
1336
|
-
kind:
|
|
1427
|
+
mediaTracks: r.array(
|
|
1428
|
+
r.object({
|
|
1429
|
+
_id: r.string(),
|
|
1430
|
+
locale: r.string(),
|
|
1431
|
+
content: r.string(),
|
|
1432
|
+
kind: r.string()
|
|
1337
1433
|
})
|
|
1338
1434
|
),
|
|
1339
|
-
mediaType:
|
|
1340
|
-
title:
|
|
1435
|
+
mediaType: r.string(),
|
|
1436
|
+
title: r.string()
|
|
1341
1437
|
}).nullable(),
|
|
1342
|
-
read:
|
|
1343
|
-
updatedAt:
|
|
1438
|
+
read: r.boolean(),
|
|
1439
|
+
updatedAt: r.string()
|
|
1344
1440
|
}).nullable(),
|
|
1345
|
-
errors:
|
|
1441
|
+
errors: r.array(Le).nullable()
|
|
1346
1442
|
})
|
|
1347
|
-
}),
|
|
1348
|
-
markSubmissionCommentsRead:
|
|
1349
|
-
errors:
|
|
1443
|
+
}), ir = r.object({
|
|
1444
|
+
markSubmissionCommentsRead: r.object({
|
|
1445
|
+
errors: r.array(Le).nullable()
|
|
1350
1446
|
})
|
|
1351
|
-
}),
|
|
1352
|
-
createSubmission:
|
|
1353
|
-
submission:
|
|
1354
|
-
_id:
|
|
1355
|
-
createdAt:
|
|
1356
|
-
attempt:
|
|
1357
|
-
submittedAt:
|
|
1358
|
-
score:
|
|
1447
|
+
}), Vr = r.object({
|
|
1448
|
+
createSubmission: r.object({
|
|
1449
|
+
submission: r.object({
|
|
1450
|
+
_id: r.string(),
|
|
1451
|
+
createdAt: r.string(),
|
|
1452
|
+
attempt: r.number(),
|
|
1453
|
+
submittedAt: r.string().nullable(),
|
|
1454
|
+
score: r.number().nullable()
|
|
1359
1455
|
}).nullable(),
|
|
1360
|
-
errors:
|
|
1456
|
+
errors: r.array(Le).nullable()
|
|
1361
1457
|
})
|
|
1362
|
-
}),
|
|
1458
|
+
}), Yr = r.object(
|
|
1363
1459
|
{
|
|
1364
|
-
createSubmissionDraft:
|
|
1365
|
-
submissionDraft:
|
|
1366
|
-
_id:
|
|
1460
|
+
createSubmissionDraft: r.object({
|
|
1461
|
+
submissionDraft: r.object({
|
|
1462
|
+
_id: r.string()
|
|
1367
1463
|
}).nullable(),
|
|
1368
|
-
errors:
|
|
1464
|
+
errors: r.array(Le).nullable()
|
|
1369
1465
|
})
|
|
1370
1466
|
}
|
|
1371
|
-
),
|
|
1467
|
+
), Xr = r.object(
|
|
1372
1468
|
{
|
|
1373
|
-
deleteSubmissionDraft:
|
|
1374
|
-
submissionDraftIds:
|
|
1375
|
-
errors:
|
|
1469
|
+
deleteSubmissionDraft: r.object({
|
|
1470
|
+
submissionDraftIds: r.array(r.string()).nullable(),
|
|
1471
|
+
errors: r.array(Le).nullable()
|
|
1376
1472
|
})
|
|
1377
1473
|
}
|
|
1378
1474
|
);
|
|
1379
|
-
function
|
|
1475
|
+
function rr({
|
|
1380
1476
|
courseId: t,
|
|
1381
1477
|
assignmentId: n,
|
|
1382
1478
|
userId: i,
|
|
1383
|
-
executeQuery:
|
|
1479
|
+
executeQuery: o,
|
|
1384
1480
|
enabled: l = !0
|
|
1385
1481
|
}) {
|
|
1386
|
-
return
|
|
1482
|
+
return Xe({
|
|
1387
1483
|
queryKey: ["assignment-review", "assignment", t, n, i],
|
|
1388
1484
|
queryFn: async () => {
|
|
1389
|
-
const c = await
|
|
1485
|
+
const c = await o(qi, {
|
|
1390
1486
|
courseId: t,
|
|
1391
1487
|
assignmentId: n,
|
|
1392
1488
|
userId: i
|
|
1393
|
-
}), d =
|
|
1489
|
+
}), d = Qi.parse(c);
|
|
1394
1490
|
return {
|
|
1395
1491
|
...d.legacyNode,
|
|
1396
1492
|
courseName: d.course.name
|
|
@@ -1399,36 +1495,36 @@ function Xi({
|
|
|
1399
1495
|
enabled: l
|
|
1400
1496
|
});
|
|
1401
1497
|
}
|
|
1402
|
-
function
|
|
1498
|
+
function or({
|
|
1403
1499
|
submissionId: t,
|
|
1404
1500
|
executeQuery: n,
|
|
1405
1501
|
enabled: i = !0
|
|
1406
1502
|
}) {
|
|
1407
|
-
return
|
|
1503
|
+
return Xe({
|
|
1408
1504
|
queryKey: ["assignment-review", "submissions", t],
|
|
1409
1505
|
queryFn: async () => {
|
|
1410
|
-
const
|
|
1411
|
-
return
|
|
1506
|
+
const o = await n(Yi, { submissionId: t });
|
|
1507
|
+
return tr.parse(o).node.submissionHistoriesConnection.nodes.slice().sort(
|
|
1412
1508
|
(c, d) => new Date(d.submittedAt).getTime() - new Date(c.submittedAt).getTime()
|
|
1413
1509
|
);
|
|
1414
1510
|
},
|
|
1415
1511
|
enabled: i
|
|
1416
1512
|
});
|
|
1417
1513
|
}
|
|
1418
|
-
function
|
|
1514
|
+
function ar(t) {
|
|
1419
1515
|
if (!t) return "";
|
|
1420
1516
|
const n = new Date(t);
|
|
1421
1517
|
return Number.isNaN(n.getTime()) ? "" : n.toLocaleDateString();
|
|
1422
1518
|
}
|
|
1423
|
-
function
|
|
1519
|
+
function sr({
|
|
1424
1520
|
submission: t,
|
|
1425
1521
|
isSelected: n,
|
|
1426
1522
|
isDraft: i = !1,
|
|
1427
|
-
pointsPossible:
|
|
1523
|
+
pointsPossible: o,
|
|
1428
1524
|
onClick: l
|
|
1429
1525
|
}) {
|
|
1430
|
-
const c =
|
|
1431
|
-
return /* @__PURE__ */
|
|
1526
|
+
const c = V(), d = i ? c.submissionCurrentAttempt() : c.commentsAttempt({ number: t.attempt }), p = t.score != null && o != null ? `${t.score}/${o}` : null;
|
|
1527
|
+
return /* @__PURE__ */ a(
|
|
1432
1528
|
Z,
|
|
1433
1529
|
{
|
|
1434
1530
|
as: "div",
|
|
@@ -1447,48 +1543,48 @@ function Qi({
|
|
|
1447
1543
|
children: /* @__PURE__ */ S(b, { justifyItems: "space-between", alignItems: "center", children: [
|
|
1448
1544
|
/* @__PURE__ */ S(b, { direction: "column", gap: "xx-small", children: [
|
|
1449
1545
|
/* @__PURE__ */ S(b, { gap: "small", alignItems: "center", children: [
|
|
1450
|
-
/* @__PURE__ */
|
|
1451
|
-
i && /* @__PURE__ */
|
|
1546
|
+
/* @__PURE__ */ a(_, { weight: "bold", children: d }),
|
|
1547
|
+
i && /* @__PURE__ */ a(Et, { color: "info", children: c.submissionDraft() })
|
|
1452
1548
|
] }),
|
|
1453
|
-
!i && t.submittedAt && /* @__PURE__ */
|
|
1549
|
+
!i && t.submittedAt && /* @__PURE__ */ a(_, { size: "small", color: "secondary", children: ar(t.submittedAt) })
|
|
1454
1550
|
] }),
|
|
1455
|
-
p && /* @__PURE__ */
|
|
1551
|
+
p && /* @__PURE__ */ a(_, { weight: "bold", children: p })
|
|
1456
1552
|
] })
|
|
1457
1553
|
}
|
|
1458
1554
|
);
|
|
1459
1555
|
}
|
|
1460
|
-
function
|
|
1556
|
+
function lr({
|
|
1461
1557
|
submissionId: t,
|
|
1462
1558
|
selectedAttempt: n,
|
|
1463
1559
|
onAttemptSelect: i,
|
|
1464
|
-
pointsPossible:
|
|
1560
|
+
pointsPossible: o,
|
|
1465
1561
|
executeQuery: l
|
|
1466
1562
|
}) {
|
|
1467
|
-
const c =
|
|
1563
|
+
const c = V(), { data: d, isLoading: p, isError: m } = or({
|
|
1468
1564
|
submissionId: t,
|
|
1469
1565
|
executeQuery: l
|
|
1470
1566
|
});
|
|
1471
1567
|
if (p)
|
|
1472
|
-
return /* @__PURE__ */
|
|
1568
|
+
return /* @__PURE__ */ a(b, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ a(Ye, { renderTitle: c.navigationAttempts(), size: "small" }) });
|
|
1473
1569
|
if (m)
|
|
1474
|
-
return /* @__PURE__ */
|
|
1570
|
+
return /* @__PURE__ */ a(b, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ a(_, { color: "danger", children: c.submissionLoadAttemptsError() }) });
|
|
1475
1571
|
const f = (d == null ? void 0 : d.filter((h) => h.attempt > 0)) ?? [];
|
|
1476
|
-
return f.length === 0 ? /* @__PURE__ */
|
|
1477
|
-
|
|
1572
|
+
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(
|
|
1573
|
+
sr,
|
|
1478
1574
|
{
|
|
1479
1575
|
submission: h,
|
|
1480
1576
|
isSelected: n === h.attempt,
|
|
1481
|
-
pointsPossible:
|
|
1577
|
+
pointsPossible: o,
|
|
1482
1578
|
onClick: () => i(h)
|
|
1483
1579
|
},
|
|
1484
1580
|
h.attempt
|
|
1485
1581
|
)) });
|
|
1486
1582
|
}
|
|
1487
|
-
function
|
|
1583
|
+
function Nn({
|
|
1488
1584
|
attachments: t,
|
|
1489
1585
|
size: n = "medium"
|
|
1490
1586
|
}) {
|
|
1491
|
-
return t.length === 0 ? null : /* @__PURE__ */
|
|
1587
|
+
return t.length === 0 ? null : /* @__PURE__ */ a(b, { direction: "column", gap: "x-small", children: t.map((i) => /* @__PURE__ */ a(
|
|
1492
1588
|
Z,
|
|
1493
1589
|
{
|
|
1494
1590
|
as: "div",
|
|
@@ -1497,85 +1593,85 @@ function wn({
|
|
|
1497
1593
|
borderWidth: "small",
|
|
1498
1594
|
borderRadius: "medium",
|
|
1499
1595
|
children: /* @__PURE__ */ S(b, { as: "div", gap: "small", width: "100%", justifyItems: "space-between", alignItems: "center", children: [
|
|
1500
|
-
/* @__PURE__ */
|
|
1501
|
-
/* @__PURE__ */
|
|
1596
|
+
/* @__PURE__ */ a(b.Item, { shouldShrink: !0, children: /* @__PURE__ */ a(An, { children: i.displayName }) }),
|
|
1597
|
+
/* @__PURE__ */ a(ti, { href: i.url, isWithinText: !1, renderIcon: /* @__PURE__ */ a(Wn, {}), children: /* @__PURE__ */ a(It, { children: `Download ${i.displayName}` }) })
|
|
1502
1598
|
] })
|
|
1503
1599
|
},
|
|
1504
1600
|
i.id
|
|
1505
1601
|
)) });
|
|
1506
1602
|
}
|
|
1507
|
-
function
|
|
1508
|
-
return /* @__PURE__ */
|
|
1603
|
+
function cr(t) {
|
|
1604
|
+
return /* @__PURE__ */ a("span", { dangerouslySetInnerHTML: { __html: wt(t) } });
|
|
1509
1605
|
}
|
|
1510
|
-
function
|
|
1606
|
+
function mr({
|
|
1511
1607
|
submission: t,
|
|
1512
1608
|
isLastAttempt: n = !0,
|
|
1513
1609
|
showAttemptLabel: i = !0,
|
|
1514
|
-
renderHTML:
|
|
1610
|
+
renderHTML: o
|
|
1515
1611
|
}) {
|
|
1516
|
-
const l =
|
|
1612
|
+
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
1613
|
if (!t) return [];
|
|
1518
1614
|
const C = [];
|
|
1519
1615
|
if (t.attachment && C.push(t.attachment), t.attachments)
|
|
1520
1616
|
for (const I of t.attachments)
|
|
1521
1617
|
C.some((w) => w.id === I.id) || C.push(I);
|
|
1522
1618
|
return C;
|
|
1523
|
-
}, [t]), h =
|
|
1524
|
-
return t ? /* @__PURE__ */
|
|
1525
|
-
i && !n && t.attempt != null && /* @__PURE__ */
|
|
1619
|
+
}, [t]), h = Ve(() => c((t == null ? void 0 : t.body) ?? ""), [t == null ? void 0 : t.body, c]);
|
|
1620
|
+
return t ? /* @__PURE__ */ a(Z, { as: "div", children: /* @__PURE__ */ S(b, { direction: "column", gap: "small", children: [
|
|
1621
|
+
i && !n && t.attempt != null && /* @__PURE__ */ a(_, { size: "small", weight: "bold", color: "secondary", children: l.submissionViewingAttempt({ number: t.attempt }) }),
|
|
1526
1622
|
/* @__PURE__ */ S(b, { gap: "x-small", alignItems: "center", children: [
|
|
1527
|
-
/* @__PURE__ */
|
|
1528
|
-
/* @__PURE__ */
|
|
1623
|
+
/* @__PURE__ */ a(qn, { color: "success" }),
|
|
1624
|
+
/* @__PURE__ */ a(_t, { level: "h3", children: m })
|
|
1529
1625
|
] }),
|
|
1530
1626
|
d && t.body && /* @__PURE__ */ S(b, { alignItems: "stretch", gap: "small", children: [
|
|
1531
|
-
/* @__PURE__ */
|
|
1532
|
-
/* @__PURE__ */
|
|
1627
|
+
/* @__PURE__ */ a(Z, { as: "div", width: "4px", background: "primary", borderRadius: "small" }),
|
|
1628
|
+
/* @__PURE__ */ a(Z, { as: "div", children: /* @__PURE__ */ a(_, { children: h }) })
|
|
1533
1629
|
] }),
|
|
1534
|
-
p && f.length > 0 && /* @__PURE__ */
|
|
1630
|
+
p && f.length > 0 && /* @__PURE__ */ a(Nn, { attachments: f })
|
|
1535
1631
|
] }) }) : null;
|
|
1536
1632
|
}
|
|
1537
|
-
function
|
|
1633
|
+
function ur(t) {
|
|
1538
1634
|
const n = new Date(t);
|
|
1539
1635
|
return Number.isNaN(n.getTime()) ? "" : n.toLocaleDateString(void 0, { month: "short", day: "numeric", year: "numeric" });
|
|
1540
1636
|
}
|
|
1541
|
-
function
|
|
1542
|
-
return /* @__PURE__ */
|
|
1637
|
+
function dr() {
|
|
1638
|
+
return /* @__PURE__ */ a(_, { color: "secondary", size: "small", children: "|" });
|
|
1543
1639
|
}
|
|
1544
|
-
function
|
|
1640
|
+
function fr({
|
|
1545
1641
|
score: t,
|
|
1546
1642
|
pointsPossible: n,
|
|
1547
1643
|
gradingType: i,
|
|
1548
|
-
dueAt:
|
|
1644
|
+
dueAt: o,
|
|
1549
1645
|
allowedAttempts: l,
|
|
1550
1646
|
currentAttempt: c,
|
|
1551
1647
|
isOverdue: d,
|
|
1552
1648
|
estimatedDuration: p,
|
|
1553
1649
|
labels: m
|
|
1554
1650
|
}) {
|
|
1555
|
-
const f =
|
|
1651
|
+
const f = V(), h = [];
|
|
1556
1652
|
return p && h.push(
|
|
1557
|
-
/* @__PURE__ */
|
|
1653
|
+
/* @__PURE__ */ a(_, { size: "small", children: (m == null ? void 0 : m.duration) ?? f.headerDuration({ minutes: p }) }, "duration")
|
|
1558
1654
|
), t != null && n != null ? h.push(
|
|
1559
|
-
/* @__PURE__ */
|
|
1655
|
+
/* @__PURE__ */ a(_, { size: "small", children: (m == null ? void 0 : m.score) ?? f.headerScore({ score: t, total: n }) }, "score")
|
|
1560
1656
|
) : n != null && i !== "not_graded" && h.push(
|
|
1561
|
-
/* @__PURE__ */
|
|
1657
|
+
/* @__PURE__ */ a(_, { size: "small", children: (m == null ? void 0 : m.pointsPossible) ?? f.headerPointsPossible({ points: n }) }, "points")
|
|
1562
1658
|
), l != null && (l === -1 ? h.push(
|
|
1563
|
-
/* @__PURE__ */
|
|
1659
|
+
/* @__PURE__ */ a(_, { size: "small", children: (m == null ? void 0 : m.attempts) ?? f.headerAttemptsUnlimited() }, "attempts")
|
|
1564
1660
|
) : c != null ? h.push(
|
|
1565
|
-
/* @__PURE__ */
|
|
1661
|
+
/* @__PURE__ */ a(_, { size: "small", children: (m == null ? void 0 : m.attempts) ?? f.headerAttemptOf({ current: c, total: l }) }, "attempts")
|
|
1566
1662
|
) : h.push(
|
|
1567
|
-
/* @__PURE__ */
|
|
1568
|
-
)),
|
|
1569
|
-
/* @__PURE__ */
|
|
1663
|
+
/* @__PURE__ */ a(_, { size: "small", children: (m == null ? void 0 : m.attempts) ?? f.headerAttemptsAllowed({ count: l }) }, "attempts")
|
|
1664
|
+
)), o && h.push(
|
|
1665
|
+
/* @__PURE__ */ a(_, { size: "small", children: (m == null ? void 0 : m.dueDate) ?? f.headerDueDate({ date: ur(o) }) }, "due")
|
|
1570
1666
|
), /* @__PURE__ */ S(b, { as: "div", direction: "row", alignItems: "center", gap: "small", children: [
|
|
1571
1667
|
h.map((C, I) => /* @__PURE__ */ S(b, { gap: "small", alignItems: "center", children: [
|
|
1572
|
-
I > 0 && /* @__PURE__ */
|
|
1668
|
+
I > 0 && /* @__PURE__ */ a(dr, {}),
|
|
1573
1669
|
C
|
|
1574
1670
|
] }, `item-${String(I)}`)),
|
|
1575
|
-
d && /* @__PURE__ */
|
|
1671
|
+
d && /* @__PURE__ */ a(Et, { color: "danger", children: (m == null ? void 0 : m.overdue) ?? f.headerOverdue() })
|
|
1576
1672
|
] });
|
|
1577
1673
|
}
|
|
1578
|
-
const
|
|
1674
|
+
const pr = se`
|
|
1579
1675
|
mutation CreateSubmissionComment(
|
|
1580
1676
|
$id: ID!
|
|
1581
1677
|
$submissionAttempt: Int!
|
|
@@ -1665,7 +1761,7 @@ const ro = ae`
|
|
|
1665
1761
|
mimeClass
|
|
1666
1762
|
url
|
|
1667
1763
|
}
|
|
1668
|
-
`,
|
|
1764
|
+
`, gr = se`
|
|
1669
1765
|
mutation MarkSubmissionCommentsRead(
|
|
1670
1766
|
$submissionId: ID!
|
|
1671
1767
|
$submissionCommentIds: [ID!]!
|
|
@@ -1682,7 +1778,7 @@ const ro = ae`
|
|
|
1682
1778
|
}
|
|
1683
1779
|
}
|
|
1684
1780
|
}
|
|
1685
|
-
`,
|
|
1781
|
+
`, Kr = se`
|
|
1686
1782
|
mutation CreateSubmission(
|
|
1687
1783
|
$assignmentLid: ID!
|
|
1688
1784
|
$submissionType: OnlineSubmissionType!
|
|
@@ -1710,7 +1806,7 @@ const ro = ae`
|
|
|
1710
1806
|
}
|
|
1711
1807
|
}
|
|
1712
1808
|
}
|
|
1713
|
-
`,
|
|
1809
|
+
`, Zr = se`
|
|
1714
1810
|
mutation CreateSubmissionDraft(
|
|
1715
1811
|
$submissionId: ID!
|
|
1716
1812
|
$submissionType: DraftableSubmissionType!
|
|
@@ -1736,7 +1832,7 @@ const ro = ae`
|
|
|
1736
1832
|
}
|
|
1737
1833
|
}
|
|
1738
1834
|
}
|
|
1739
|
-
`,
|
|
1835
|
+
`, Qr = se`
|
|
1740
1836
|
mutation DeleteSubmissionDraft($submissionId: ID!) {
|
|
1741
1837
|
deleteSubmissionDraft(input: { submissionId: $submissionId }) {
|
|
1742
1838
|
submissionDraftIds
|
|
@@ -1747,36 +1843,36 @@ const ro = ae`
|
|
|
1747
1843
|
}
|
|
1748
1844
|
}
|
|
1749
1845
|
`;
|
|
1750
|
-
function
|
|
1846
|
+
function hr({
|
|
1751
1847
|
executeQuery: t
|
|
1752
1848
|
}) {
|
|
1753
|
-
const n =
|
|
1754
|
-
return
|
|
1755
|
-
mutationFn: async ({ submissionId: i, attempt:
|
|
1756
|
-
const d = await t(
|
|
1849
|
+
const n = gn();
|
|
1850
|
+
return hn({
|
|
1851
|
+
mutationFn: async ({ submissionId: i, attempt: o, comment: l, fileIds: c }) => {
|
|
1852
|
+
const d = await t(pr, {
|
|
1757
1853
|
id: i,
|
|
1758
|
-
submissionAttempt:
|
|
1854
|
+
submissionAttempt: o,
|
|
1759
1855
|
comment: l,
|
|
1760
1856
|
fileIds: c
|
|
1761
1857
|
});
|
|
1762
|
-
return
|
|
1858
|
+
return nr.parse(d), d;
|
|
1763
1859
|
},
|
|
1764
|
-
onSuccess: (i,
|
|
1860
|
+
onSuccess: (i, o) => {
|
|
1765
1861
|
n.invalidateQueries({
|
|
1766
|
-
queryKey: ["assignment-review", "submission-comments",
|
|
1862
|
+
queryKey: ["assignment-review", "submission-comments", o.submissionId]
|
|
1767
1863
|
});
|
|
1768
1864
|
}
|
|
1769
1865
|
});
|
|
1770
1866
|
}
|
|
1771
|
-
function
|
|
1867
|
+
function br({
|
|
1772
1868
|
submissionId: t,
|
|
1773
1869
|
courseId: n,
|
|
1774
1870
|
pageParams: i,
|
|
1775
|
-
direction:
|
|
1871
|
+
direction: o,
|
|
1776
1872
|
executeQuery: l,
|
|
1777
1873
|
enabled: c
|
|
1778
1874
|
}) {
|
|
1779
|
-
return
|
|
1875
|
+
return Xe({
|
|
1780
1876
|
queryKey: [
|
|
1781
1877
|
"assignment-review",
|
|
1782
1878
|
"submission-comments",
|
|
@@ -1784,17 +1880,17 @@ function lo({
|
|
|
1784
1880
|
n,
|
|
1785
1881
|
i == null ? void 0 : i.startCursor,
|
|
1786
1882
|
i == null ? void 0 : i.endCursor,
|
|
1787
|
-
|
|
1883
|
+
o
|
|
1788
1884
|
],
|
|
1789
1885
|
queryFn: async () => {
|
|
1790
|
-
const d = await l(
|
|
1886
|
+
const d = await l(Vi, {
|
|
1791
1887
|
submissionId: t,
|
|
1792
1888
|
courseId: n,
|
|
1793
|
-
beforeCursor:
|
|
1794
|
-
afterCursor:
|
|
1795
|
-
first:
|
|
1796
|
-
last:
|
|
1797
|
-
}), p =
|
|
1889
|
+
beforeCursor: o === "prev" ? (i == null ? void 0 : i.startCursor) ?? null : null,
|
|
1890
|
+
afterCursor: o === "next" ? (i == null ? void 0 : i.endCursor) ?? null : null,
|
|
1891
|
+
first: o === "next" ? 5 : null,
|
|
1892
|
+
last: o === "prev" || !o ? 5 : null
|
|
1893
|
+
}), p = Ji.parse(d);
|
|
1798
1894
|
return {
|
|
1799
1895
|
comments: [...p.submissionComments.commentsConnection.nodes].sort(
|
|
1800
1896
|
(f, h) => new Date(f.createdAt).getTime() - new Date(h.createdAt).getTime()
|
|
@@ -1805,41 +1901,41 @@ function lo({
|
|
|
1805
1901
|
enabled: c ?? !!t
|
|
1806
1902
|
});
|
|
1807
1903
|
}
|
|
1808
|
-
function
|
|
1904
|
+
function Tr({
|
|
1809
1905
|
executeQuery: t
|
|
1810
1906
|
}) {
|
|
1811
|
-
const n =
|
|
1812
|
-
return
|
|
1813
|
-
mutationFn: async ({ submissionId: i, submissionCommentIds:
|
|
1907
|
+
const n = gn();
|
|
1908
|
+
return hn({
|
|
1909
|
+
mutationFn: async ({ submissionId: i, submissionCommentIds: o }) => {
|
|
1814
1910
|
const l = await t(
|
|
1815
|
-
|
|
1816
|
-
{ submissionId: i, submissionCommentIds:
|
|
1911
|
+
gr,
|
|
1912
|
+
{ submissionId: i, submissionCommentIds: o }
|
|
1817
1913
|
);
|
|
1818
|
-
return
|
|
1914
|
+
return ir.parse(l), l;
|
|
1819
1915
|
},
|
|
1820
|
-
onSuccess: (i,
|
|
1916
|
+
onSuccess: (i, o) => {
|
|
1821
1917
|
n.invalidateQueries({
|
|
1822
1918
|
queryKey: ["assignment-review", "assignment"],
|
|
1823
|
-
predicate: (l) => l.queryKey.includes(
|
|
1919
|
+
predicate: (l) => l.queryKey.includes(o.assignmentId)
|
|
1824
1920
|
});
|
|
1825
1921
|
}
|
|
1826
1922
|
});
|
|
1827
1923
|
}
|
|
1828
|
-
function
|
|
1829
|
-
return /* @__PURE__ */
|
|
1924
|
+
function yr(t) {
|
|
1925
|
+
return /* @__PURE__ */ a("span", { dangerouslySetInnerHTML: { __html: wt(t) } });
|
|
1830
1926
|
}
|
|
1831
|
-
function
|
|
1927
|
+
function Ar(t) {
|
|
1832
1928
|
const n = new Date(t);
|
|
1833
1929
|
return Number.isNaN(n.getTime()) ? "" : n.toLocaleString();
|
|
1834
1930
|
}
|
|
1835
|
-
function
|
|
1931
|
+
function Sr({
|
|
1836
1932
|
comment: t,
|
|
1837
1933
|
isFullWidth: n,
|
|
1838
1934
|
renderHTML: i
|
|
1839
1935
|
}) {
|
|
1840
1936
|
var m;
|
|
1841
|
-
const
|
|
1842
|
-
return /* @__PURE__ */
|
|
1937
|
+
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]);
|
|
1938
|
+
return /* @__PURE__ */ a(
|
|
1843
1939
|
Z,
|
|
1844
1940
|
{
|
|
1845
1941
|
as: "div",
|
|
@@ -1851,15 +1947,15 @@ function fo({
|
|
|
1851
1947
|
children: /* @__PURE__ */ S(b, { as: "div", direction: "column", gap: "small", children: [
|
|
1852
1948
|
/* @__PURE__ */ S(b, { as: "div", direction: "column", gap: "xx-small", children: [
|
|
1853
1949
|
/* @__PURE__ */ S(b, { as: "div", justifyItems: "space-between", alignItems: "center", children: [
|
|
1854
|
-
/* @__PURE__ */
|
|
1855
|
-
!t.read && /* @__PURE__ */
|
|
1950
|
+
/* @__PURE__ */ a(b.Item, { shouldShrink: !0, children: /* @__PURE__ */ a(_, { weight: "bold", size: "medium", children: /* @__PURE__ */ a(An, { children: t.author.shortName }) }) }),
|
|
1951
|
+
!t.read && /* @__PURE__ */ a(_n, { type: "notification", standalone: !0, children: /* @__PURE__ */ a(It, { children: o.commentsUnreadSingle() }) })
|
|
1856
1952
|
] }),
|
|
1857
|
-
/* @__PURE__ */
|
|
1858
|
-
t.attempt > 0 && /* @__PURE__ */
|
|
1953
|
+
/* @__PURE__ */ a(_, { size: "small", color: "secondary", children: Ar(t.createdAt) }),
|
|
1954
|
+
t.attempt > 0 && /* @__PURE__ */ a(_, { size: "small", color: "secondary", children: o.commentsAttempt({ number: t.attempt }) })
|
|
1859
1955
|
] }),
|
|
1860
|
-
/* @__PURE__ */
|
|
1861
|
-
t.attachments && t.attachments.length > 0 && /* @__PURE__ */
|
|
1862
|
-
|
|
1956
|
+
/* @__PURE__ */ a(_, { size: "medium", children: d }),
|
|
1957
|
+
t.attachments && t.attachments.length > 0 && /* @__PURE__ */ a(
|
|
1958
|
+
Nn,
|
|
1863
1959
|
{
|
|
1864
1960
|
attachments: t.attachments.map((f) => ({
|
|
1865
1961
|
...f,
|
|
@@ -1873,43 +1969,43 @@ function fo({
|
|
|
1873
1969
|
}
|
|
1874
1970
|
);
|
|
1875
1971
|
}
|
|
1876
|
-
function
|
|
1972
|
+
function _r({
|
|
1877
1973
|
submissionId: t,
|
|
1878
1974
|
courseId: n,
|
|
1879
1975
|
assignmentId: i,
|
|
1880
|
-
attempt:
|
|
1976
|
+
attempt: o,
|
|
1881
1977
|
canPostComment: l,
|
|
1882
1978
|
onCommentPosted: c,
|
|
1883
1979
|
renderHTML: d,
|
|
1884
1980
|
executeQuery: p
|
|
1885
1981
|
}) {
|
|
1886
|
-
const m =
|
|
1982
|
+
const m = V(), [f, h] = Ee(""), [C, I] = Ee({}), w = Bn(/* @__PURE__ */ new Set()), { data: y, isLoading: X, isError: fe } = br({
|
|
1887
1983
|
submissionId: t,
|
|
1888
1984
|
courseId: n,
|
|
1889
1985
|
pageParams: C.pageParams,
|
|
1890
1986
|
direction: C.direction,
|
|
1891
1987
|
executeQuery: p
|
|
1892
|
-
}), le =
|
|
1893
|
-
|
|
1988
|
+
}), le = hr({ executeQuery: p }), M = Tr({ executeQuery: p });
|
|
1989
|
+
yt(() => {
|
|
1894
1990
|
if (!(y != null && y.comments) || y.comments.length === 0) return;
|
|
1895
|
-
const E = y.comments.filter((
|
|
1991
|
+
const E = y.comments.filter((v) => !v.read && !w.current.has(v._id)).filter((v) => {
|
|
1896
1992
|
var ee;
|
|
1897
|
-
return !((ee =
|
|
1898
|
-
}).map((
|
|
1993
|
+
return !((ee = v.author.courseRoles) != null && ee.includes("StudentEnrollment"));
|
|
1994
|
+
}).map((v) => v._id);
|
|
1899
1995
|
if (E.length > 0) {
|
|
1900
|
-
for (const
|
|
1901
|
-
w.current.add(
|
|
1996
|
+
for (const v of E)
|
|
1997
|
+
w.current.add(v);
|
|
1902
1998
|
M.mutate({ submissionId: t, assignmentId: i, submissionCommentIds: E });
|
|
1903
1999
|
}
|
|
1904
2000
|
}, [y == null ? void 0 : y.comments, t, i, M]);
|
|
1905
2001
|
const ie = y == null ? void 0 : y.comments.some(
|
|
1906
2002
|
(E) => {
|
|
1907
|
-
var
|
|
1908
|
-
return !((
|
|
2003
|
+
var v;
|
|
2004
|
+
return !((v = E.author.courseRoles) != null && v.includes("StudentEnrollment"));
|
|
1909
2005
|
}
|
|
1910
|
-
),
|
|
2006
|
+
), N = () => {
|
|
1911
2007
|
f.trim() && le.mutate(
|
|
1912
|
-
{ submissionId: t, attempt:
|
|
2008
|
+
{ submissionId: t, attempt: o, comment: f },
|
|
1913
2009
|
{
|
|
1914
2010
|
onSuccess: () => {
|
|
1915
2011
|
h(""), c == null || c();
|
|
@@ -1917,10 +2013,10 @@ function po({
|
|
|
1917
2013
|
}
|
|
1918
2014
|
);
|
|
1919
2015
|
}, ce = (y == null ? void 0 : y.pageInfo.hasNextPage) || (y == null ? void 0 : y.pageInfo.hasPreviousPage);
|
|
1920
|
-
return
|
|
2016
|
+
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
2017
|
/* @__PURE__ */ S(b, { as: "div", direction: "column", children: [
|
|
1922
|
-
y.comments.length === 0 ? /* @__PURE__ */
|
|
1923
|
-
|
|
2018
|
+
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(
|
|
2019
|
+
Sr,
|
|
1924
2020
|
{
|
|
1925
2021
|
comment: E,
|
|
1926
2022
|
isFullWidth: !ie,
|
|
@@ -1929,20 +2025,20 @@ function po({
|
|
|
1929
2025
|
E._id
|
|
1930
2026
|
)) }),
|
|
1931
2027
|
ce && /* @__PURE__ */ S(b, { justifyItems: "space-between", padding: "small none", children: [
|
|
1932
|
-
/* @__PURE__ */
|
|
2028
|
+
/* @__PURE__ */ a(
|
|
1933
2029
|
$,
|
|
1934
2030
|
{
|
|
1935
|
-
renderIcon: () => /* @__PURE__ */
|
|
2031
|
+
renderIcon: () => /* @__PURE__ */ a(Vn, {}),
|
|
1936
2032
|
size: "small",
|
|
1937
2033
|
interaction: y.pageInfo.hasPreviousPage ? "enabled" : "disabled",
|
|
1938
2034
|
onClick: () => I({ pageParams: y.pageInfo, direction: "prev" }),
|
|
1939
2035
|
children: m.commentsPreviousComments()
|
|
1940
2036
|
}
|
|
1941
2037
|
),
|
|
1942
|
-
/* @__PURE__ */
|
|
2038
|
+
/* @__PURE__ */ a(
|
|
1943
2039
|
$,
|
|
1944
2040
|
{
|
|
1945
|
-
renderIcon: () => /* @__PURE__ */
|
|
2041
|
+
renderIcon: () => /* @__PURE__ */ a(Yn, {}),
|
|
1946
2042
|
size: "small",
|
|
1947
2043
|
interaction: y.pageInfo.hasNextPage ? "enabled" : "disabled",
|
|
1948
2044
|
onClick: () => I({ pageParams: y.pageInfo, direction: "next" }),
|
|
@@ -1952,20 +2048,20 @@ function po({
|
|
|
1952
2048
|
] })
|
|
1953
2049
|
] }),
|
|
1954
2050
|
l && /* @__PURE__ */ S(b, { as: "div", direction: "column", gap: "small", padding: "small none medium", children: [
|
|
1955
|
-
/* @__PURE__ */
|
|
1956
|
-
|
|
2051
|
+
/* @__PURE__ */ a(
|
|
2052
|
+
Sn,
|
|
1957
2053
|
{
|
|
1958
2054
|
resize: "vertical",
|
|
1959
|
-
label: /* @__PURE__ */
|
|
2055
|
+
label: /* @__PURE__ */ a(_, { weight: "bold", size: "medium", children: m.commentsPlaceholder() }),
|
|
1960
2056
|
value: f,
|
|
1961
2057
|
onChange: (E) => h(E.target.value)
|
|
1962
2058
|
}
|
|
1963
2059
|
),
|
|
1964
|
-
/* @__PURE__ */
|
|
2060
|
+
/* @__PURE__ */ a(
|
|
1965
2061
|
$,
|
|
1966
2062
|
{
|
|
1967
2063
|
color: "primary",
|
|
1968
|
-
onClick:
|
|
2064
|
+
onClick: N,
|
|
1969
2065
|
interaction: f.trim().length > 0 && !le.isPending ? "enabled" : "disabled",
|
|
1970
2066
|
children: m.commentsPost()
|
|
1971
2067
|
}
|
|
@@ -1973,112 +2069,112 @@ function po({
|
|
|
1973
2069
|
] })
|
|
1974
2070
|
] });
|
|
1975
2071
|
}
|
|
1976
|
-
function
|
|
1977
|
-
return /* @__PURE__ */
|
|
2072
|
+
function Er(t) {
|
|
2073
|
+
return /* @__PURE__ */ a("span", { dangerouslySetInnerHTML: { __html: wt(t) } });
|
|
1978
2074
|
}
|
|
1979
|
-
function
|
|
2075
|
+
function Jr({
|
|
1980
2076
|
courseId: t,
|
|
1981
2077
|
assignmentId: n,
|
|
1982
2078
|
userId: i,
|
|
1983
|
-
feedbackMode:
|
|
2079
|
+
feedbackMode: o = !1,
|
|
1984
2080
|
onError: l,
|
|
1985
2081
|
renderHTML: c,
|
|
1986
2082
|
renderPanels: d,
|
|
1987
2083
|
executeQuery: p
|
|
1988
2084
|
}) {
|
|
1989
|
-
const m =
|
|
2085
|
+
const m = V(), f = c ?? Er, {
|
|
1990
2086
|
data: h,
|
|
1991
2087
|
isLoading: C,
|
|
1992
2088
|
isError: I,
|
|
1993
2089
|
error: w
|
|
1994
|
-
} =
|
|
1995
|
-
|
|
1996
|
-
), M =
|
|
2090
|
+
} = rr({ courseId: t, assignmentId: n, userId: i, executeQuery: p }), [y, X] = Ee(null), [fe, le] = Ee(
|
|
2091
|
+
o ? "comments" : null
|
|
2092
|
+
), M = Ve(
|
|
1997
2093
|
() => (h == null ? void 0 : h.submissionsConnection.nodes[0]) ?? null,
|
|
1998
2094
|
[h]
|
|
1999
|
-
), ie = M != null && M.attempt > 0,
|
|
2000
|
-
|
|
2095
|
+
), 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) => {
|
|
2096
|
+
X(Qe);
|
|
2001
2097
|
}, []);
|
|
2002
|
-
if (
|
|
2098
|
+
if (yt(() => {
|
|
2003
2099
|
I && w && l && l(w);
|
|
2004
|
-
}, [I, w, l]),
|
|
2005
|
-
|
|
2006
|
-
}, [
|
|
2007
|
-
return /* @__PURE__ */
|
|
2100
|
+
}, [I, w, l]), yt(() => {
|
|
2101
|
+
o && ie && le("comments");
|
|
2102
|
+
}, [o, ie]), C)
|
|
2103
|
+
return /* @__PURE__ */ a(b, { justifyItems: "center", padding: "large", children: /* @__PURE__ */ a(Ye, { renderTitle: m.progressLoading() }) });
|
|
2008
2104
|
if (I || !h)
|
|
2009
|
-
return /* @__PURE__ */
|
|
2010
|
-
const Ie = !!h.dueAt && new Date(h.dueAt) < /* @__PURE__ */ new Date() && !ie, xe = M ? /* @__PURE__ */
|
|
2011
|
-
|
|
2105
|
+
return /* @__PURE__ */ a(b, { justifyItems: "center", padding: "large", children: /* @__PURE__ */ a(_, { color: "danger", children: m.assignmentLoadError() }) });
|
|
2106
|
+
const Ie = !!h.dueAt && new Date(h.dueAt) < /* @__PURE__ */ new Date() && !ie, xe = M ? /* @__PURE__ */ a(
|
|
2107
|
+
_r,
|
|
2012
2108
|
{
|
|
2013
2109
|
submissionId: M.id,
|
|
2014
2110
|
courseId: t,
|
|
2015
2111
|
assignmentId: n,
|
|
2016
|
-
attempt: (
|
|
2112
|
+
attempt: (N == null ? void 0 : N.attempt) ?? 0,
|
|
2017
2113
|
canPostComment: E,
|
|
2018
2114
|
renderHTML: f,
|
|
2019
2115
|
executeQuery: p
|
|
2020
2116
|
}
|
|
2021
|
-
) : null,
|
|
2022
|
-
|
|
2117
|
+
) : null, Ke = v && M ? /* @__PURE__ */ a(
|
|
2118
|
+
lr,
|
|
2023
2119
|
{
|
|
2024
2120
|
submissionId: M.id,
|
|
2025
|
-
selectedAttempt:
|
|
2121
|
+
selectedAttempt: N == null ? void 0 : N.attempt,
|
|
2026
2122
|
onAttemptSelect: ee,
|
|
2027
2123
|
pointsPossible: h.pointsPossible,
|
|
2028
2124
|
executeQuery: p
|
|
2029
2125
|
}
|
|
2030
|
-
) : null,
|
|
2126
|
+
) : null, Ze = {
|
|
2031
2127
|
commentsPanel: xe,
|
|
2032
|
-
attemptsPanel:
|
|
2128
|
+
attemptsPanel: Ke,
|
|
2033
2129
|
activePanel: fe,
|
|
2034
2130
|
setActivePanel: le,
|
|
2035
2131
|
unreadCommentCount: (M == null ? void 0 : M.unreadCommentCount) ?? 0,
|
|
2036
|
-
hasMultipleAttempts:
|
|
2132
|
+
hasMultipleAttempts: v
|
|
2037
2133
|
};
|
|
2038
2134
|
return /* @__PURE__ */ S(b, { direction: "column", gap: "medium", children: [
|
|
2039
|
-
/* @__PURE__ */
|
|
2040
|
-
|
|
2135
|
+
/* @__PURE__ */ a(
|
|
2136
|
+
fr,
|
|
2041
2137
|
{
|
|
2042
|
-
score:
|
|
2138
|
+
score: N == null ? void 0 : N.score,
|
|
2043
2139
|
pointsPossible: h.pointsPossible,
|
|
2044
2140
|
gradingType: h.gradingType,
|
|
2045
2141
|
dueAt: h.dueAt,
|
|
2046
2142
|
allowedAttempts: h.allowedAttempts,
|
|
2047
|
-
currentAttempt:
|
|
2143
|
+
currentAttempt: N == null ? void 0 : N.attempt,
|
|
2048
2144
|
isOverdue: Ie
|
|
2049
2145
|
}
|
|
2050
2146
|
),
|
|
2051
2147
|
h.description && /* @__PURE__ */ S(Z, { as: "div", children: [
|
|
2052
|
-
/* @__PURE__ */
|
|
2053
|
-
/* @__PURE__ */
|
|
2148
|
+
/* @__PURE__ */ a(_t, { level: "h3", children: m.assignmentInstructions() }),
|
|
2149
|
+
/* @__PURE__ */ a(Z, { as: "div", margin: "small none large none", children: f(h.description) })
|
|
2054
2150
|
] }),
|
|
2055
|
-
/* @__PURE__ */
|
|
2056
|
-
|
|
2151
|
+
/* @__PURE__ */ a(
|
|
2152
|
+
mr,
|
|
2057
2153
|
{
|
|
2058
|
-
submission:
|
|
2154
|
+
submission: N,
|
|
2059
2155
|
isLastAttempt: ce,
|
|
2060
2156
|
renderHTML: f
|
|
2061
2157
|
}
|
|
2062
2158
|
),
|
|
2063
|
-
d ? d(
|
|
2159
|
+
d ? d(Ze) : null
|
|
2064
2160
|
] });
|
|
2065
2161
|
}
|
|
2066
|
-
function
|
|
2162
|
+
function eo({
|
|
2067
2163
|
existingFiles: t,
|
|
2068
2164
|
onSubmit: n,
|
|
2069
2165
|
onSaveDraft: i,
|
|
2070
|
-
onDiscardDraft:
|
|
2166
|
+
onDiscardDraft: o,
|
|
2071
2167
|
onSelectFiles: l,
|
|
2072
2168
|
isSubmitting: c = !1
|
|
2073
2169
|
}) {
|
|
2074
|
-
const d =
|
|
2170
|
+
const d = V(), [p, m] = Ee(t ?? []), f = async () => {
|
|
2075
2171
|
const w = await l();
|
|
2076
2172
|
m((y) => [...y, ...w]);
|
|
2077
2173
|
}, h = (w) => {
|
|
2078
|
-
m((y) => y.filter((
|
|
2174
|
+
m((y) => y.filter((X) => X.id !== w));
|
|
2079
2175
|
}, C = p.map((w) => w.id), I = p.length > 0 && !c;
|
|
2080
2176
|
return /* @__PURE__ */ S(b, { direction: "column", gap: "medium", children: [
|
|
2081
|
-
p.length > 0 && /* @__PURE__ */
|
|
2177
|
+
p.length > 0 && /* @__PURE__ */ a(b, { direction: "column", gap: "x-small", children: p.map((w) => /* @__PURE__ */ a(
|
|
2082
2178
|
Z,
|
|
2083
2179
|
{
|
|
2084
2180
|
as: "div",
|
|
@@ -2087,12 +2183,12 @@ function qo({
|
|
|
2087
2183
|
borderColor: "primary",
|
|
2088
2184
|
borderRadius: "medium",
|
|
2089
2185
|
children: /* @__PURE__ */ S(b, { justifyItems: "space-between", alignItems: "center", children: [
|
|
2090
|
-
/* @__PURE__ */
|
|
2091
|
-
/* @__PURE__ */
|
|
2186
|
+
/* @__PURE__ */ a(_, { children: w.name }),
|
|
2187
|
+
/* @__PURE__ */ a(
|
|
2092
2188
|
$,
|
|
2093
2189
|
{
|
|
2094
2190
|
size: "small",
|
|
2095
|
-
renderIcon: () => /* @__PURE__ */
|
|
2191
|
+
renderIcon: () => /* @__PURE__ */ a(Xn, {}),
|
|
2096
2192
|
onClick: () => h(w.id),
|
|
2097
2193
|
children: /* @__PURE__ */ S("span", { className: "screenreader-only", children: [
|
|
2098
2194
|
"Remove ",
|
|
@@ -2104,9 +2200,9 @@ function qo({
|
|
|
2104
2200
|
},
|
|
2105
2201
|
w.id
|
|
2106
2202
|
)) }),
|
|
2107
|
-
/* @__PURE__ */
|
|
2203
|
+
/* @__PURE__ */ a($, { onClick: f, children: d.submissionFormAddFiles() }),
|
|
2108
2204
|
/* @__PURE__ */ S(b, { gap: "small", children: [
|
|
2109
|
-
/* @__PURE__ */
|
|
2205
|
+
/* @__PURE__ */ a(
|
|
2110
2206
|
$,
|
|
2111
2207
|
{
|
|
2112
2208
|
color: "primary",
|
|
@@ -2115,7 +2211,7 @@ function qo({
|
|
|
2115
2211
|
children: d.submissionFormSubmit()
|
|
2116
2212
|
}
|
|
2117
2213
|
),
|
|
2118
|
-
i && /* @__PURE__ */
|
|
2214
|
+
i && /* @__PURE__ */ a(
|
|
2119
2215
|
$,
|
|
2120
2216
|
{
|
|
2121
2217
|
onClick: () => i(C),
|
|
@@ -2123,67 +2219,67 @@ function qo({
|
|
|
2123
2219
|
children: d.submissionFormSaveDraft()
|
|
2124
2220
|
}
|
|
2125
2221
|
),
|
|
2126
|
-
|
|
2222
|
+
o && t && t.length > 0 && /* @__PURE__ */ a($, { color: "primary-inverse", onClick: o, children: d.submissionFormDiscardDraft() })
|
|
2127
2223
|
] })
|
|
2128
2224
|
] });
|
|
2129
2225
|
}
|
|
2130
|
-
function
|
|
2226
|
+
function to({
|
|
2131
2227
|
prevItem: t,
|
|
2132
2228
|
nextItem: n,
|
|
2133
2229
|
onNavigatePrev: i,
|
|
2134
|
-
onNavigateNext:
|
|
2230
|
+
onNavigateNext: o,
|
|
2135
2231
|
labels: l
|
|
2136
2232
|
}) {
|
|
2137
|
-
const c =
|
|
2233
|
+
const c = V();
|
|
2138
2234
|
if (!t && !n)
|
|
2139
2235
|
return null;
|
|
2140
2236
|
const d = (l == null ? void 0 : l.previous) ?? c.navigationPrevious(), p = (l == null ? void 0 : l.next) ?? c.navigationNext();
|
|
2141
2237
|
return /* @__PURE__ */ S(b, { justifyItems: "space-between", padding: "small none", children: [
|
|
2142
|
-
t ? /* @__PURE__ */
|
|
2238
|
+
t ? /* @__PURE__ */ a(
|
|
2143
2239
|
$,
|
|
2144
2240
|
{
|
|
2145
|
-
renderIcon: () => /* @__PURE__ */
|
|
2241
|
+
renderIcon: () => /* @__PURE__ */ a(bn, {}),
|
|
2146
2242
|
onClick: i,
|
|
2147
2243
|
"aria-label": `${d}: ${t.title}`,
|
|
2148
2244
|
children: d
|
|
2149
2245
|
}
|
|
2150
|
-
) : /* @__PURE__ */
|
|
2151
|
-
n ? /* @__PURE__ */
|
|
2246
|
+
) : /* @__PURE__ */ a("div", {}),
|
|
2247
|
+
n ? /* @__PURE__ */ a(
|
|
2152
2248
|
$,
|
|
2153
2249
|
{
|
|
2154
|
-
renderIcon: () => /* @__PURE__ */
|
|
2155
|
-
onClick:
|
|
2250
|
+
renderIcon: () => /* @__PURE__ */ a(Tn, {}),
|
|
2251
|
+
onClick: o,
|
|
2156
2252
|
"aria-label": `${p}: ${n.title}`,
|
|
2157
2253
|
children: p
|
|
2158
2254
|
}
|
|
2159
|
-
) : /* @__PURE__ */
|
|
2255
|
+
) : /* @__PURE__ */ a("div", {})
|
|
2160
2256
|
] });
|
|
2161
2257
|
}
|
|
2162
|
-
function
|
|
2258
|
+
function Ir(t) {
|
|
2163
2259
|
switch (t) {
|
|
2164
2260
|
case "Assignment":
|
|
2165
|
-
return /* @__PURE__ */
|
|
2261
|
+
return /* @__PURE__ */ a(ei, {});
|
|
2166
2262
|
case "Quiz":
|
|
2167
|
-
return /* @__PURE__ */
|
|
2263
|
+
return /* @__PURE__ */ a(Jn, {});
|
|
2168
2264
|
case "Discussion":
|
|
2169
|
-
return /* @__PURE__ */
|
|
2265
|
+
return /* @__PURE__ */ a(Qn, {});
|
|
2170
2266
|
case "Page":
|
|
2171
|
-
return /* @__PURE__ */
|
|
2267
|
+
return /* @__PURE__ */ a(Zt, {});
|
|
2172
2268
|
case "ExternalUrl":
|
|
2173
2269
|
case "ExternalTool":
|
|
2174
|
-
return /* @__PURE__ */
|
|
2270
|
+
return /* @__PURE__ */ a(Zn, {});
|
|
2175
2271
|
default:
|
|
2176
|
-
return /* @__PURE__ */
|
|
2272
|
+
return /* @__PURE__ */ a(Zt, {});
|
|
2177
2273
|
}
|
|
2178
2274
|
}
|
|
2179
|
-
function
|
|
2275
|
+
function wr({
|
|
2180
2276
|
item: t,
|
|
2181
2277
|
isSelected: n,
|
|
2182
2278
|
isLoadingItem: i,
|
|
2183
|
-
onClick:
|
|
2279
|
+
onClick: o
|
|
2184
2280
|
}) {
|
|
2185
2281
|
var m, f, h, C, I;
|
|
2186
|
-
const l =
|
|
2282
|
+
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
2283
|
Z,
|
|
2188
2284
|
{
|
|
2189
2285
|
as: "div",
|
|
@@ -2191,33 +2287,33 @@ function bo({
|
|
|
2191
2287
|
background: n ? "secondary" : "primary",
|
|
2192
2288
|
borderRadius: "small",
|
|
2193
2289
|
cursor: c ? "not-allowed" : "pointer",
|
|
2194
|
-
onClick: c ? void 0 :
|
|
2290
|
+
onClick: c ? void 0 : o,
|
|
2195
2291
|
role: c ? void 0 : "button",
|
|
2196
2292
|
tabIndex: c ? void 0 : 0,
|
|
2197
2293
|
onKeyDown: c ? void 0 : (w) => {
|
|
2198
|
-
(w.key === "Enter" || w.key === " ") && (w.preventDefault(),
|
|
2294
|
+
(w.key === "Enter" || w.key === " ") && (w.preventDefault(), o());
|
|
2199
2295
|
},
|
|
2200
2296
|
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__ */
|
|
2297
|
+
/* @__PURE__ */ a(b.Item, { children: c ? /* @__PURE__ */ a(yn, {}) : Ir(t.type) }),
|
|
2298
|
+
/* @__PURE__ */ a(b.Item, { shouldGrow: !0, shouldShrink: !0, children: /* @__PURE__ */ S(b, { direction: "column", gap: "xx-small", children: [
|
|
2299
|
+
/* @__PURE__ */ a(_, { weight: n ? "bold" : "normal", size: "small", children: t.title }),
|
|
2300
|
+
((h = t.content_details) == null ? void 0 : h.due_at) && /* @__PURE__ */ a(_, { size: "x-small", color: "secondary", children: l.progressDueDate({
|
|
2205
2301
|
date: new Date(t.content_details.due_at).toLocaleDateString()
|
|
2206
2302
|
}) }),
|
|
2207
|
-
((C = t.content_details) == null ? void 0 : C.points_possible) != null && /* @__PURE__ */
|
|
2303
|
+
((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
2304
|
] }) }),
|
|
2209
|
-
i && /* @__PURE__ */
|
|
2210
|
-
((I = t.completion_requirement) == null ? void 0 : I.completed) && /* @__PURE__ */
|
|
2305
|
+
i && /* @__PURE__ */ a(Ye, { size: "x-small", renderTitle: l.progressLoading() }),
|
|
2306
|
+
((I = t.completion_requirement) == null ? void 0 : I.completed) && /* @__PURE__ */ a(_, { color: "success", size: "small", children: "✓" })
|
|
2211
2307
|
] })
|
|
2212
2308
|
}
|
|
2213
2309
|
);
|
|
2214
|
-
return c && d ? /* @__PURE__ */
|
|
2310
|
+
return c && d ? /* @__PURE__ */ a(ii, { renderTip: d, placement: "end", children: p }) : p;
|
|
2215
2311
|
}
|
|
2216
|
-
function
|
|
2312
|
+
function no({
|
|
2217
2313
|
module: t,
|
|
2218
2314
|
currentItemId: n,
|
|
2219
2315
|
onItemClick: i,
|
|
2220
|
-
onClose:
|
|
2316
|
+
onClose: o,
|
|
2221
2317
|
onNavigateModule: l,
|
|
2222
2318
|
hasPrevModule: c = !1,
|
|
2223
2319
|
hasNextModule: d = !1,
|
|
@@ -2225,21 +2321,21 @@ function Vo({
|
|
|
2225
2321
|
title: m
|
|
2226
2322
|
}) {
|
|
2227
2323
|
var C;
|
|
2228
|
-
const f =
|
|
2324
|
+
const f = V(), h = m ?? f.navigationMyProgress();
|
|
2229
2325
|
return /* @__PURE__ */ S(b, { direction: "column", height: "100%", children: [
|
|
2230
2326
|
/* @__PURE__ */ S(b, { justifyItems: "space-between", alignItems: "center", padding: "small", children: [
|
|
2231
|
-
/* @__PURE__ */
|
|
2232
|
-
/* @__PURE__ */
|
|
2327
|
+
/* @__PURE__ */ a(_t, { level: "h3", children: h }),
|
|
2328
|
+
/* @__PURE__ */ a(ni, { screenReaderLabel: f.navigationClosePanel(), onClick: o, size: "small", children: /* @__PURE__ */ a(Kn, {}) })
|
|
2233
2329
|
] }),
|
|
2234
2330
|
/* @__PURE__ */ S(Z, { as: "div", padding: "none small", overflowY: "auto", children: [
|
|
2235
|
-
t.state === "locked" && /* @__PURE__ */
|
|
2236
|
-
/* @__PURE__ */
|
|
2331
|
+
t.state === "locked" && /* @__PURE__ */ a(b, { padding: "none none small", children: /* @__PURE__ */ S(Et, { color: "warning", children: [
|
|
2332
|
+
/* @__PURE__ */ a(yn, {}),
|
|
2237
2333
|
" ",
|
|
2238
2334
|
f.progressLocked()
|
|
2239
2335
|
] }) }),
|
|
2240
|
-
/* @__PURE__ */
|
|
2241
|
-
/* @__PURE__ */
|
|
2242
|
-
|
|
2336
|
+
/* @__PURE__ */ a(_, { weight: "bold", size: "medium", children: t.name }),
|
|
2337
|
+
/* @__PURE__ */ a(b, { direction: "column", gap: "xx-small", padding: "small none", children: (C = t.items) == null ? void 0 : C.map((I) => /* @__PURE__ */ a(
|
|
2338
|
+
wr,
|
|
2243
2339
|
{
|
|
2244
2340
|
item: I,
|
|
2245
2341
|
isSelected: I.id === n,
|
|
@@ -2250,10 +2346,10 @@ function Vo({
|
|
|
2250
2346
|
)) })
|
|
2251
2347
|
] }),
|
|
2252
2348
|
l && /* @__PURE__ */ S(b, { justifyItems: "space-between", padding: "small", children: [
|
|
2253
|
-
/* @__PURE__ */
|
|
2349
|
+
/* @__PURE__ */ a(
|
|
2254
2350
|
$,
|
|
2255
2351
|
{
|
|
2256
|
-
renderIcon: () => /* @__PURE__ */
|
|
2352
|
+
renderIcon: () => /* @__PURE__ */ a(bn, {}),
|
|
2257
2353
|
size: "small",
|
|
2258
2354
|
interaction: c ? "enabled" : "disabled",
|
|
2259
2355
|
onClick: () => l("prev"),
|
|
@@ -2261,10 +2357,10 @@ function Vo({
|
|
|
2261
2357
|
children: f.navigationPrevious()
|
|
2262
2358
|
}
|
|
2263
2359
|
),
|
|
2264
|
-
/* @__PURE__ */
|
|
2360
|
+
/* @__PURE__ */ a(
|
|
2265
2361
|
$,
|
|
2266
2362
|
{
|
|
2267
|
-
renderIcon: () => /* @__PURE__ */
|
|
2363
|
+
renderIcon: () => /* @__PURE__ */ a(Tn, {}),
|
|
2268
2364
|
size: "small",
|
|
2269
2365
|
interaction: d ? "enabled" : "disabled",
|
|
2270
2366
|
onClick: () => l("next"),
|
|
@@ -2275,17 +2371,17 @@ function Vo({
|
|
|
2275
2371
|
] })
|
|
2276
2372
|
] });
|
|
2277
2373
|
}
|
|
2278
|
-
function
|
|
2374
|
+
function io({
|
|
2279
2375
|
existingDraft: t,
|
|
2280
2376
|
onSubmit: n,
|
|
2281
2377
|
onSaveDraft: i,
|
|
2282
|
-
onDiscardDraft:
|
|
2378
|
+
onDiscardDraft: o,
|
|
2283
2379
|
isSubmitting: l = !1
|
|
2284
2380
|
}) {
|
|
2285
|
-
const c =
|
|
2381
|
+
const c = V(), [d, p] = Ee(t ?? ""), m = d.trim().length > 0 && !l;
|
|
2286
2382
|
return /* @__PURE__ */ S(b, { direction: "column", gap: "medium", children: [
|
|
2287
|
-
/* @__PURE__ */
|
|
2288
|
-
|
|
2383
|
+
/* @__PURE__ */ a(
|
|
2384
|
+
Sn,
|
|
2289
2385
|
{
|
|
2290
2386
|
label: c.submissionTextHeading(),
|
|
2291
2387
|
value: d,
|
|
@@ -2295,7 +2391,7 @@ function Xo({
|
|
|
2295
2391
|
}
|
|
2296
2392
|
),
|
|
2297
2393
|
/* @__PURE__ */ S(b, { gap: "small", children: [
|
|
2298
|
-
/* @__PURE__ */
|
|
2394
|
+
/* @__PURE__ */ a(
|
|
2299
2395
|
$,
|
|
2300
2396
|
{
|
|
2301
2397
|
color: "primary",
|
|
@@ -2304,7 +2400,7 @@ function Xo({
|
|
|
2304
2400
|
children: c.submissionFormSubmit()
|
|
2305
2401
|
}
|
|
2306
2402
|
),
|
|
2307
|
-
i && /* @__PURE__ */
|
|
2403
|
+
i && /* @__PURE__ */ a(
|
|
2308
2404
|
$,
|
|
2309
2405
|
{
|
|
2310
2406
|
onClick: () => i(d),
|
|
@@ -2312,68 +2408,68 @@ function Xo({
|
|
|
2312
2408
|
children: c.submissionFormSaveDraft()
|
|
2313
2409
|
}
|
|
2314
2410
|
),
|
|
2315
|
-
|
|
2411
|
+
o && t && /* @__PURE__ */ a($, { color: "primary-inverse", onClick: o, children: c.submissionFormDiscardDraft() })
|
|
2316
2412
|
] })
|
|
2317
2413
|
] });
|
|
2318
2414
|
}
|
|
2319
|
-
function
|
|
2415
|
+
function ro({
|
|
2320
2416
|
unreadCount: t
|
|
2321
2417
|
}) {
|
|
2322
|
-
const n =
|
|
2418
|
+
const n = V();
|
|
2323
2419
|
if (t === 0)
|
|
2324
2420
|
return null;
|
|
2325
2421
|
const i = t === 1 ? n.commentsUnreadSingle() : n.commentsUnread({ count: t });
|
|
2326
|
-
return /* @__PURE__ */
|
|
2422
|
+
return /* @__PURE__ */ a(_n, { count: t, standalone: !0, children: /* @__PURE__ */ a(It, { children: i }) });
|
|
2327
2423
|
}
|
|
2328
|
-
function
|
|
2424
|
+
function oo({
|
|
2329
2425
|
courseId: t,
|
|
2330
2426
|
moduleItemId: n,
|
|
2331
2427
|
fetchSequence: i,
|
|
2332
|
-
enabled:
|
|
2428
|
+
enabled: o = !0
|
|
2333
2429
|
}) {
|
|
2334
|
-
return
|
|
2430
|
+
return Xe({
|
|
2335
2431
|
queryKey: ["assignment-review", "module-item-sequence", t, n],
|
|
2336
2432
|
queryFn: () => i(t, n),
|
|
2337
|
-
enabled:
|
|
2433
|
+
enabled: o && !!n
|
|
2338
2434
|
});
|
|
2339
2435
|
}
|
|
2340
2436
|
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
|
-
|
|
2437
|
+
Qi as AssignmentResponseSchema,
|
|
2438
|
+
Jr as AssignmentReview,
|
|
2439
|
+
sr as AttemptCard,
|
|
2440
|
+
mr as AttemptView,
|
|
2441
|
+
lr as AttemptsHistory,
|
|
2442
|
+
Kr as CREATE_SUBMISSION,
|
|
2443
|
+
pr as CREATE_SUBMISSION_COMMENT,
|
|
2444
|
+
Zr as CREATE_SUBMISSION_DRAFT,
|
|
2445
|
+
Sr as CommentCard,
|
|
2446
|
+
nr as CreateSubmissionCommentResponseSchema,
|
|
2447
|
+
Yr as CreateSubmissionDraftResponseSchema,
|
|
2448
|
+
Vr as CreateSubmissionResponseSchema,
|
|
2449
|
+
Qr as DELETE_SUBMISSION_DRAFT,
|
|
2450
|
+
Xr as DeleteSubmissionDraftResponseSchema,
|
|
2451
|
+
Nn as DownloadButtons,
|
|
2452
|
+
eo as FileUploadSubmissionForm,
|
|
2453
|
+
qi as GET_ASSIGNMENT,
|
|
2454
|
+
Yi as GET_SUBMISSIONS,
|
|
2455
|
+
Vi as GET_SUBMISSION_COMMENTS,
|
|
2456
|
+
fr as LearningContentHeader,
|
|
2457
|
+
gr as MARK_SUBMISSION_COMMENTS_READ,
|
|
2458
|
+
ir as MarkSubmissionCommentsReadResponseSchema,
|
|
2459
|
+
to as ModuleNavigation,
|
|
2460
|
+
no as MyProgressPanel,
|
|
2461
|
+
_r as SubmissionComments,
|
|
2462
|
+
qr as SubmissionCommentsDataSchema,
|
|
2463
|
+
Ji as SubmissionCommentsQueryResponseSchema,
|
|
2464
|
+
tr as SubmissionsQueryResponseSchema,
|
|
2465
|
+
io as TextEntrySubmissionForm,
|
|
2466
|
+
Wr as TranslationsProvider,
|
|
2467
|
+
ro as UnreadCommentsBadge,
|
|
2468
|
+
hr as useCreateSubmissionComment,
|
|
2469
|
+
rr as useGetAssignment,
|
|
2470
|
+
br as useGetSubmissionComments,
|
|
2471
|
+
or as useGetSubmissions,
|
|
2472
|
+
Tr as useMarkSubmissionCommentsRead,
|
|
2473
|
+
oo as useModuleItemSequence,
|
|
2474
|
+
V as useTranslations
|
|
2379
2475
|
};
|