@nysds/nys-icon 1.20.1 → 1.21.1
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/nys-icon.js
CHANGED
|
@@ -1,236 +1,236 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { property as
|
|
1
|
+
import { LitElement as Jn, unsafeCSS as Qn, html as to } from "lit";
|
|
2
|
+
import { property as J, state as eo } from "lit/decorators.js";
|
|
3
3
|
/*!
|
|
4
4
|
* █▄ █ █ █ █▀▀▀█ █▀▀▄ █▀▀▀█
|
|
5
5
|
* █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
|
|
6
6
|
* █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
|
|
7
7
|
*
|
|
8
|
-
* Icon Component v1.
|
|
8
|
+
* Icon Component v1.21.1
|
|
9
9
|
* Part of the New York State Design System
|
|
10
10
|
* Repository: https://github.com/its-hcd/nysds
|
|
11
11
|
* License: MIT
|
|
12
12
|
*/
|
|
13
13
|
/*!
|
|
14
|
-
* New York State Design System v1.
|
|
14
|
+
* New York State Design System v1.21.1
|
|
15
15
|
* Description: A design system for New York State's digital products.
|
|
16
16
|
* Repository: https://github.com/its-hcd/nysds
|
|
17
17
|
* License: MIT
|
|
18
18
|
*/
|
|
19
|
-
let
|
|
20
|
-
function
|
|
21
|
-
return `${
|
|
19
|
+
let no = 0;
|
|
20
|
+
function oo(o) {
|
|
21
|
+
return `${o}-${Date.now()}-${no++}`;
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
class n extends
|
|
23
|
+
const io = (o) => {
|
|
24
|
+
class n extends o {
|
|
25
25
|
get idPrefix() {
|
|
26
26
|
return this.localName || "nys-element";
|
|
27
27
|
}
|
|
28
28
|
ensureId() {
|
|
29
|
-
this.id || (this.id =
|
|
29
|
+
this.id || (this.id = oo(this.idPrefix));
|
|
30
30
|
}
|
|
31
31
|
connectedCallback() {
|
|
32
32
|
super.connectedCallback(), this.ensureId();
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
return n;
|
|
36
|
-
},
|
|
37
|
-
let
|
|
38
|
-
async function
|
|
39
|
-
return
|
|
40
|
-
(
|
|
41
|
-
),
|
|
36
|
+
}, ro = /* @__PURE__ */ io(Jn), wt = globalThis.__nysIconRegistry ??= /* @__PURE__ */ new Map(), ut = globalThis.__nysIconWatchers ??= /* @__PURE__ */ new Map();
|
|
37
|
+
let le = null, Ze = null;
|
|
38
|
+
async function so() {
|
|
39
|
+
return le || (Ze ??= import("./nys-icon.library-BxwfG3ym.js").then(
|
|
40
|
+
(o) => le = o.default
|
|
41
|
+
), Ze);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
if (globalThis.__nysIconDefaultRegistered ||
|
|
43
|
+
function ao() {
|
|
44
|
+
if (globalThis.__nysIconDefaultRegistered || wt.has("default")) {
|
|
45
45
|
globalThis.__nysIconDefaultRegistered = !0;
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
|
-
globalThis.__nysIconDefaultRegistered = !0,
|
|
49
|
-
resolver: async (
|
|
50
|
-
if (!
|
|
51
|
-
const s = (await
|
|
48
|
+
globalThis.__nysIconDefaultRegistered = !0, wt.set("default", {
|
|
49
|
+
resolver: async (o) => {
|
|
50
|
+
if (!o) return;
|
|
51
|
+
const s = (await so())[o];
|
|
52
52
|
return s ? { type: "svg", content: s } : void 0;
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
|
|
56
|
+
function Jo(o, n) {
|
|
57
|
+
wt.set(o, n), ut.get(o)?.forEach((s) => s.redraw());
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
59
|
+
function Qo(o) {
|
|
60
|
+
wt.delete(o), ut.get(o)?.forEach((n) => n.redraw());
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
return
|
|
62
|
+
function lo(o) {
|
|
63
|
+
return ao(), wt.get(o);
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
|
|
65
|
+
function Je(o, n) {
|
|
66
|
+
ut.has(o) || ut.set(o, /* @__PURE__ */ new Set()), ut.get(o).add(n);
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
68
|
+
function Qe(o, n) {
|
|
69
|
+
ut.get(o)?.delete(n);
|
|
70
70
|
}
|
|
71
|
-
/*! @license DOMPurify 3.4.
|
|
72
|
-
function
|
|
73
|
-
(n == null || n >
|
|
74
|
-
for (var s = 0,
|
|
75
|
-
return
|
|
71
|
+
/*! @license DOMPurify 3.4.14 | (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.14/LICENSE */
|
|
72
|
+
function tn(o, n) {
|
|
73
|
+
(n == null || n > o.length) && (n = o.length);
|
|
74
|
+
for (var s = 0, c = Array(n); s < n; s++) c[s] = o[s];
|
|
75
|
+
return c;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
if (Array.isArray(
|
|
77
|
+
function co(o) {
|
|
78
|
+
if (Array.isArray(o)) return o;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
var s =
|
|
80
|
+
function uo(o, n) {
|
|
81
|
+
var s = o == null ? null : typeof Symbol < "u" && o[Symbol.iterator] || o["@@iterator"];
|
|
82
82
|
if (s != null) {
|
|
83
|
-
var
|
|
83
|
+
var c, u, m, T, pt = [], N = !0, mt = !1;
|
|
84
84
|
try {
|
|
85
|
-
if (m = (s = s.call(
|
|
86
|
-
} catch (
|
|
87
|
-
|
|
85
|
+
if (m = (s = s.call(o)).next, n !== 0) for (; !(N = (c = m.call(s)).done) && (pt.push(c.value), pt.length !== n); N = !0) ;
|
|
86
|
+
} catch (Gt) {
|
|
87
|
+
mt = !0, u = Gt;
|
|
88
88
|
} finally {
|
|
89
89
|
try {
|
|
90
|
-
if (!
|
|
90
|
+
if (!N && s.return != null && (T = s.return(), Object(T) !== T)) return;
|
|
91
91
|
} finally {
|
|
92
|
-
if (
|
|
92
|
+
if (mt) throw u;
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
return
|
|
95
|
+
return pt;
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function fo() {
|
|
99
99
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
100
100
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
return
|
|
102
|
+
function po(o, n) {
|
|
103
|
+
return co(o) || uo(o, n) || mo(o, n) || fo();
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
if (
|
|
107
|
-
if (typeof
|
|
108
|
-
var s = {}.toString.call(
|
|
109
|
-
return s === "Object" &&
|
|
105
|
+
function mo(o, n) {
|
|
106
|
+
if (o) {
|
|
107
|
+
if (typeof o == "string") return tn(o, n);
|
|
108
|
+
var s = {}.toString.call(o).slice(8, -1);
|
|
109
|
+
return s === "Object" && o.constructor && (s = o.constructor.name), s === "Map" || s === "Set" ? Array.from(o) : s === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s) ? tn(o, n) : void 0;
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
const
|
|
113
|
-
let
|
|
114
|
-
|
|
112
|
+
const gn = Object.entries, en = Object.setPrototypeOf, ho = Object.isFrozen, _o = Object.getPrototypeOf, go = Object.getOwnPropertyDescriptor;
|
|
113
|
+
let b = Object.freeze, S = Object.seal, ct = Object.create, yn = typeof Reflect < "u" && Reflect, he = yn.apply, _e = yn.construct;
|
|
114
|
+
b || (b = function(n) {
|
|
115
115
|
return n;
|
|
116
116
|
});
|
|
117
|
-
|
|
117
|
+
S || (S = function(n) {
|
|
118
118
|
return n;
|
|
119
119
|
});
|
|
120
|
-
|
|
121
|
-
for (var
|
|
120
|
+
he || (he = function(n, s) {
|
|
121
|
+
for (var c = arguments.length, u = new Array(c > 2 ? c - 2 : 0), m = 2; m < c; m++)
|
|
122
122
|
u[m - 2] = arguments[m];
|
|
123
123
|
return n.apply(s, u);
|
|
124
124
|
});
|
|
125
|
-
|
|
126
|
-
for (var s = arguments.length,
|
|
127
|
-
|
|
128
|
-
return new n(...
|
|
125
|
+
_e || (_e = function(n) {
|
|
126
|
+
for (var s = arguments.length, c = new Array(s > 1 ? s - 1 : 0), u = 1; u < s; u++)
|
|
127
|
+
c[u - 1] = arguments[u];
|
|
128
|
+
return new n(...c);
|
|
129
129
|
});
|
|
130
|
-
const
|
|
131
|
-
function
|
|
130
|
+
const Z = A(Array.prototype.forEach), yo = A(Array.prototype.lastIndexOf), nn = A(Array.prototype.pop), Tt = A(Array.prototype.push), To = A(Array.prototype.splice), ft = Array.isArray, bt = A(String.prototype.toLowerCase), ce = A(String.prototype.toString), on = A(String.prototype.match), Et = A(String.prototype.replace), rn = A(String.prototype.indexOf), Eo = A(String.prototype.trim), Ao = A(Number.prototype.toString), bo = A(Boolean.prototype.toString), sn = typeof BigInt > "u" ? null : A(BigInt.prototype.toString), an = typeof Symbol > "u" ? null : A(Symbol.prototype.toString), D = A(Object.prototype.hasOwnProperty), At = A(Object.prototype.toString), w = A(RegExp.prototype.test), K = So(TypeError);
|
|
131
|
+
function A(o) {
|
|
132
132
|
return function(n) {
|
|
133
133
|
n instanceof RegExp && (n.lastIndex = 0);
|
|
134
|
-
for (var s = arguments.length,
|
|
135
|
-
|
|
136
|
-
return
|
|
134
|
+
for (var s = arguments.length, c = new Array(s > 1 ? s - 1 : 0), u = 1; u < s; u++)
|
|
135
|
+
c[u - 1] = arguments[u];
|
|
136
|
+
return he(o, n, c);
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function So(o) {
|
|
140
140
|
return function() {
|
|
141
|
-
for (var n = arguments.length, s = new Array(n),
|
|
142
|
-
s[
|
|
143
|
-
return
|
|
141
|
+
for (var n = arguments.length, s = new Array(n), c = 0; c < n; c++)
|
|
142
|
+
s[c] = arguments[c];
|
|
143
|
+
return _e(o, s);
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
|
-
function p(
|
|
146
|
+
function p(o, n) {
|
|
147
147
|
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : bt;
|
|
148
|
-
if (
|
|
149
|
-
return
|
|
150
|
-
let
|
|
151
|
-
for (;
|
|
152
|
-
let u = n[
|
|
148
|
+
if (en && en(o, null), !ft(n))
|
|
149
|
+
return o;
|
|
150
|
+
let c = n.length;
|
|
151
|
+
for (; c--; ) {
|
|
152
|
+
let u = n[c];
|
|
153
153
|
if (typeof u == "string") {
|
|
154
154
|
const m = s(u);
|
|
155
|
-
m !== u && (
|
|
155
|
+
m !== u && (ho(n) || (n[c] = m), u = m);
|
|
156
156
|
}
|
|
157
|
-
|
|
157
|
+
o[u] = !0;
|
|
158
158
|
}
|
|
159
|
-
return
|
|
159
|
+
return o;
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
for (let n = 0; n <
|
|
163
|
-
|
|
164
|
-
return
|
|
161
|
+
function wo(o) {
|
|
162
|
+
for (let n = 0; n < o.length; n++)
|
|
163
|
+
D(o, n) || (o[n] = null);
|
|
164
|
+
return o;
|
|
165
165
|
}
|
|
166
|
-
function
|
|
167
|
-
const n =
|
|
168
|
-
for (const
|
|
169
|
-
var s =
|
|
166
|
+
function C(o) {
|
|
167
|
+
const n = ct(null);
|
|
168
|
+
for (const c of gn(o)) {
|
|
169
|
+
var s = po(c, 2);
|
|
170
170
|
const u = s[0], m = s[1];
|
|
171
|
-
|
|
171
|
+
D(o, u) && (ft(m) ? n[u] = wo(m) : m && typeof m == "object" && m.constructor === Object ? n[u] = C(m) : n[u] = m);
|
|
172
172
|
}
|
|
173
173
|
return n;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
176
|
-
switch (typeof
|
|
175
|
+
function Oo(o) {
|
|
176
|
+
switch (typeof o) {
|
|
177
177
|
case "string":
|
|
178
|
-
return
|
|
178
|
+
return o;
|
|
179
179
|
case "number":
|
|
180
|
-
return
|
|
180
|
+
return Ao(o);
|
|
181
181
|
case "boolean":
|
|
182
|
-
return
|
|
182
|
+
return bo(o);
|
|
183
183
|
case "bigint":
|
|
184
|
-
return
|
|
184
|
+
return sn ? sn(o) : "0";
|
|
185
185
|
case "symbol":
|
|
186
|
-
return
|
|
186
|
+
return an ? an(o) : "Symbol()";
|
|
187
187
|
case "undefined":
|
|
188
|
-
return At(
|
|
188
|
+
return At(o);
|
|
189
189
|
case "function":
|
|
190
190
|
case "object": {
|
|
191
|
-
if (
|
|
192
|
-
return At(
|
|
193
|
-
const n =
|
|
191
|
+
if (o === null)
|
|
192
|
+
return At(o);
|
|
193
|
+
const n = o, s = M(n, "toString");
|
|
194
194
|
if (typeof s == "function") {
|
|
195
|
-
const
|
|
196
|
-
return typeof
|
|
195
|
+
const c = s(n);
|
|
196
|
+
return typeof c == "string" ? c : At(c);
|
|
197
197
|
}
|
|
198
|
-
return At(
|
|
198
|
+
return At(o);
|
|
199
199
|
}
|
|
200
200
|
default:
|
|
201
|
-
return At(
|
|
201
|
+
return At(o);
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
function
|
|
205
|
-
for (;
|
|
206
|
-
const
|
|
207
|
-
if (
|
|
208
|
-
if (
|
|
209
|
-
return
|
|
210
|
-
if (typeof
|
|
211
|
-
return
|
|
204
|
+
function M(o, n) {
|
|
205
|
+
for (; o !== null; ) {
|
|
206
|
+
const c = go(o, n);
|
|
207
|
+
if (c) {
|
|
208
|
+
if (c.get)
|
|
209
|
+
return A(c.get);
|
|
210
|
+
if (typeof c.value == "function")
|
|
211
|
+
return A(c.value);
|
|
212
212
|
}
|
|
213
|
-
|
|
213
|
+
o = _o(o);
|
|
214
214
|
}
|
|
215
215
|
function s() {
|
|
216
216
|
return null;
|
|
217
217
|
}
|
|
218
218
|
return s;
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function Ro(o) {
|
|
221
221
|
try {
|
|
222
|
-
return
|
|
222
|
+
return w(o, ""), !0;
|
|
223
223
|
} catch {
|
|
224
224
|
return !1;
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
const
|
|
227
|
+
const ln = 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"]), ue = 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"]), fe = 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"]), Lo = 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"]), pe = 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"]), Io = b(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), cn = b(["#text"]), un = 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"]), me = 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", "dominant-baseline", "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", "pointer-events", "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-orientation", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "vector-effect", "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"]), fn = 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"]), Ht = b(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Do = S(/{{[\w\W]*|^[\w\W]*}}/g), No = S(/<%[\w\W]*|^[\w\W]*%>/g), vo = S(/\${[\w\W]*/g), Co = S(/^data-[\-\w.\u00B7-\uFFFF]+$/), Mo = S(/^aria-[\-\w]+$/), pn = S(
|
|
228
228
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
229
229
|
// eslint-disable-line no-useless-escape
|
|
230
|
-
),
|
|
230
|
+
), xo = S(/^(?:\w+script|data):/i), Po = S(
|
|
231
231
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
232
232
|
// eslint-disable-line no-control-regex
|
|
233
|
-
),
|
|
233
|
+
), zo = S(/^html$/i), ko = S(/^[a-z][.\w]*(-[.\w]+)+$/i), mn = S(/<[/\w!]/g), dn = S(/<[/\w]/g), Uo = S(/<\/no(script|embed|frames)/i), Fo = S(/\/>/i), v = {
|
|
234
234
|
element: 1,
|
|
235
235
|
attribute: 2,
|
|
236
236
|
text: 3,
|
|
@@ -246,28 +246,33 @@ const Je = O(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
246
246
|
documentFragment: 11,
|
|
247
247
|
notation: 12
|
|
248
248
|
// Deprecated
|
|
249
|
-
},
|
|
249
|
+
}, Tn = ["style", "script", "xmp", "iframe", "noembed", "noframes", "plaintext", "noscript"], Ho = b(p({}, Tn)), Go = (function() {
|
|
250
|
+
const o = {};
|
|
251
|
+
return Z(Tn, (n) => {
|
|
252
|
+
o[n] = S(new RegExp("</" + n + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
253
|
+
}), b(o);
|
|
254
|
+
})(), Wo = function() {
|
|
250
255
|
return typeof window > "u" ? null : window;
|
|
251
|
-
},
|
|
256
|
+
}, Bo = function(n, s) {
|
|
252
257
|
if (typeof n != "object" || typeof n.createPolicy != "function")
|
|
253
258
|
return null;
|
|
254
|
-
let
|
|
259
|
+
let c = null;
|
|
255
260
|
const u = "data-tt-policy-suffix";
|
|
256
|
-
s && s.hasAttribute(u) && (
|
|
257
|
-
const m = "dompurify" + (
|
|
261
|
+
s && s.hasAttribute(u) && (c = s.getAttribute(u));
|
|
262
|
+
const m = "dompurify" + (c ? "#" + c : "");
|
|
258
263
|
try {
|
|
259
264
|
return n.createPolicy(m, {
|
|
260
|
-
createHTML(
|
|
261
|
-
return
|
|
265
|
+
createHTML(T) {
|
|
266
|
+
return T;
|
|
262
267
|
},
|
|
263
|
-
createScriptURL(
|
|
264
|
-
return
|
|
268
|
+
createScriptURL(T) {
|
|
269
|
+
return T;
|
|
265
270
|
}
|
|
266
271
|
});
|
|
267
272
|
} catch {
|
|
268
273
|
return console.warn("TrustedTypes policy " + m + " could not be created."), null;
|
|
269
274
|
}
|
|
270
|
-
},
|
|
275
|
+
}, hn = function() {
|
|
271
276
|
return {
|
|
272
277
|
afterSanitizeAttributes: [],
|
|
273
278
|
afterSanitizeElements: [],
|
|
@@ -279,53 +284,60 @@ const Je = O(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
279
284
|
uponSanitizeElement: [],
|
|
280
285
|
uponSanitizeShadowNode: []
|
|
281
286
|
};
|
|
282
|
-
},
|
|
283
|
-
return
|
|
287
|
+
}, G = function(n, s, c, u) {
|
|
288
|
+
return D(n, s) && ft(n[s]) ? p(u.base ? C(u.base) : {}, n[s], u.transform) : c;
|
|
289
|
+
}, de = function(n, s, c) {
|
|
290
|
+
const u = D(n, s) ? n[s] : void 0;
|
|
291
|
+
return u && typeof u == "object" ? C(u) : c();
|
|
284
292
|
};
|
|
285
|
-
function
|
|
286
|
-
let
|
|
287
|
-
const n = (r) =>
|
|
288
|
-
if (n.version = "3.4.
|
|
293
|
+
function En() {
|
|
294
|
+
let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Wo();
|
|
295
|
+
const n = (r) => En(r);
|
|
296
|
+
if (n.version = "3.4.14", n.removed = [], !o || !o.document || o.document.nodeType !== v.document || !o.Element)
|
|
289
297
|
return n.isSupported = !1, n;
|
|
290
|
-
let s =
|
|
291
|
-
const
|
|
292
|
-
|
|
293
|
-
const m =
|
|
294
|
-
|
|
295
|
-
const
|
|
298
|
+
let s = o.document;
|
|
299
|
+
const c = s, u = c.currentScript;
|
|
300
|
+
o.DocumentFragment;
|
|
301
|
+
const m = o.HTMLTemplateElement, T = o.Node, pt = o.Element, N = o.NodeFilter, mt = o.NamedNodeMap;
|
|
302
|
+
mt === void 0 && (o.NamedNodeMap || o.MozNamedAttrMap), o.HTMLFormElement;
|
|
303
|
+
const Gt = o.DOMParser, Ot = o.trustedTypes, Y = pt.prototype, bn = M(Y, "cloneNode"), Wt = M(Y, "remove"), Sn = M(Y, "nextSibling"), Q = M(Y, "childNodes"), tt = M(Y, "parentNode"), ye = M(Y, "shadowRoot"), Bt = M(Y, "attributes"), $ = T && T.prototype ? M(T.prototype, "nodeType") : null, et = T && T.prototype ? M(T.prototype, "nodeName") : null, Rt = T && T.prototype ? M(T.prototype, "ownerDocument") : null, dt = function(t) {
|
|
304
|
+
return $ ? $(t) : t.nodeType;
|
|
305
|
+
}, Yt = function(t) {
|
|
306
|
+
return et ? et(t) : t.nodeName;
|
|
307
|
+
};
|
|
296
308
|
if (typeof m == "function") {
|
|
297
309
|
const r = s.createElement("template");
|
|
298
310
|
r.content && r.content.ownerDocument && (s = r.content.ownerDocument);
|
|
299
311
|
}
|
|
300
|
-
let
|
|
301
|
-
const
|
|
302
|
-
if (
|
|
303
|
-
throw
|
|
304
|
-
},
|
|
305
|
-
|
|
312
|
+
let R, j = "", $t, Te = !1, ht = 0;
|
|
313
|
+
const Ee = function() {
|
|
314
|
+
if (ht > 0)
|
|
315
|
+
throw K('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
|
|
316
|
+
}, nt = function(t) {
|
|
317
|
+
Ee(), ht++;
|
|
306
318
|
try {
|
|
307
|
-
return
|
|
319
|
+
return R.createHTML(t);
|
|
308
320
|
} finally {
|
|
309
|
-
|
|
321
|
+
ht--;
|
|
310
322
|
}
|
|
311
|
-
},
|
|
312
|
-
|
|
323
|
+
}, wn = function(t) {
|
|
324
|
+
Ee(), ht++;
|
|
313
325
|
try {
|
|
314
|
-
return
|
|
326
|
+
return R.createScriptURL(t);
|
|
315
327
|
} finally {
|
|
316
|
-
|
|
328
|
+
ht--;
|
|
317
329
|
}
|
|
318
|
-
},
|
|
319
|
-
return
|
|
320
|
-
},
|
|
321
|
-
let h =
|
|
322
|
-
n.isSupported = typeof
|
|
323
|
-
const
|
|
324
|
-
let
|
|
325
|
-
const
|
|
326
|
-
let
|
|
327
|
-
const
|
|
328
|
-
let
|
|
330
|
+
}, On = function() {
|
|
331
|
+
return Te || ($t = Bo(Ot, u), Te = !0), $t;
|
|
332
|
+
}, Lt = s, jt = Lt.implementation, Ae = Lt.createNodeIterator, Rn = Lt.createDocumentFragment, Ln = Lt.getElementsByTagName, In = c.importNode;
|
|
333
|
+
let h = hn();
|
|
334
|
+
n.isSupported = typeof gn == "function" && typeof tt == "function" && jt && jt.createHTMLDocument !== void 0;
|
|
335
|
+
const Dn = Do, Nn = No, vn = vo, Cn = Co, Mn = Mo, xn = xo, be = Po, Pn = ko;
|
|
336
|
+
let Se = pn, _ = null;
|
|
337
|
+
const Xt = p({}, [...ln, ...ue, ...fe, ...pe, ...cn]);
|
|
338
|
+
let g = null;
|
|
339
|
+
const Vt = p({}, [...un, ...me, ...fn, ...Ht]);
|
|
340
|
+
let x = Object.seal(ct(null, {
|
|
329
341
|
tagNameCheck: {
|
|
330
342
|
writable: !0,
|
|
331
343
|
configurable: !1,
|
|
@@ -344,8 +356,8 @@ function un() {
|
|
|
344
356
|
enumerable: !0,
|
|
345
357
|
value: !1
|
|
346
358
|
}
|
|
347
|
-
})),
|
|
348
|
-
const
|
|
359
|
+
})), _t = null, we = null;
|
|
360
|
+
const U = Object.seal(ct(null, {
|
|
349
361
|
tagCheck: {
|
|
350
362
|
writable: !0,
|
|
351
363
|
configurable: !1,
|
|
@@ -359,10 +371,10 @@ function un() {
|
|
|
359
371
|
value: null
|
|
360
372
|
}
|
|
361
373
|
}));
|
|
362
|
-
let
|
|
363
|
-
const
|
|
364
|
-
let
|
|
365
|
-
const
|
|
374
|
+
let Oe = !0, qt = !0, Re = !1, Le = !0, F = !1, X = !0, V = !1, Kt = !1, It = null, Dt = null, Zt = !1, ot = !1, Nt = !1, vt = !1, Ie = !0, De = !1;
|
|
375
|
+
const Ne = "user-content-";
|
|
376
|
+
let Jt = !0, Qt = !1, it = {}, rt = null;
|
|
377
|
+
const ve = p({}, [
|
|
366
378
|
"annotation-xml",
|
|
367
379
|
"audio",
|
|
368
380
|
"colgroup",
|
|
@@ -399,124 +411,146 @@ function un() {
|
|
|
399
411
|
"video",
|
|
400
412
|
"xmp"
|
|
401
413
|
]);
|
|
402
|
-
let
|
|
403
|
-
const
|
|
404
|
-
let
|
|
405
|
-
const
|
|
406
|
-
let
|
|
407
|
-
const
|
|
408
|
-
let
|
|
409
|
-
const
|
|
410
|
-
let
|
|
411
|
-
const
|
|
414
|
+
let Ce = null;
|
|
415
|
+
const Me = p({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
416
|
+
let xe = null;
|
|
417
|
+
const Pe = p({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Ct = "http://www.w3.org/1998/Math/MathML", Mt = "http://www.w3.org/2000/svg", P = "http://www.w3.org/1999/xhtml";
|
|
418
|
+
let st = P, te = !1, ee = null;
|
|
419
|
+
const zn = p({}, [Ct, Mt, P], ce), ze = b(["mi", "mo", "mn", "ms", "mtext"]);
|
|
420
|
+
let ne = p({}, ze);
|
|
421
|
+
const ke = b(["annotation-xml"]);
|
|
422
|
+
let oe = p({}, ke);
|
|
423
|
+
const kn = p({}, ["title", "style", "font", "a", "script"]);
|
|
412
424
|
let gt = null;
|
|
413
|
-
const
|
|
414
|
-
let
|
|
415
|
-
const
|
|
425
|
+
const Un = ["application/xhtml+xml", "text/html"], Fn = "text/html";
|
|
426
|
+
let E = null, at = null;
|
|
427
|
+
const Hn = s.createElement("form"), Ue = function(t) {
|
|
416
428
|
return t instanceof RegExp || t instanceof Function;
|
|
417
|
-
},
|
|
429
|
+
}, ie = function() {
|
|
418
430
|
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
419
|
-
if (
|
|
431
|
+
if (at && at === t)
|
|
420
432
|
return;
|
|
421
|
-
(!t || typeof t != "object") && (t = {}), t =
|
|
422
|
-
|
|
423
|
-
transform:
|
|
424
|
-
}),
|
|
425
|
-
transform:
|
|
426
|
-
}),
|
|
427
|
-
transform:
|
|
428
|
-
}),
|
|
429
|
-
transform:
|
|
430
|
-
base:
|
|
431
|
-
}),
|
|
432
|
-
transform:
|
|
433
|
-
base:
|
|
434
|
-
}),
|
|
435
|
-
transform:
|
|
436
|
-
}),
|
|
437
|
-
transform:
|
|
438
|
-
}),
|
|
439
|
-
transform:
|
|
440
|
-
}),
|
|
441
|
-
|
|
442
|
-
|
|
433
|
+
(!t || typeof t != "object") && (t = {}), t = C(t), gt = // eslint-disable-next-line unicorn/prefer-includes
|
|
434
|
+
Un.indexOf(t.PARSER_MEDIA_TYPE) === -1 ? Fn : t.PARSER_MEDIA_TYPE, E = gt === "application/xhtml+xml" ? ce : bt, _ = G(t, "ALLOWED_TAGS", Xt, {
|
|
435
|
+
transform: E
|
|
436
|
+
}), g = G(t, "ALLOWED_ATTR", Vt, {
|
|
437
|
+
transform: E
|
|
438
|
+
}), ee = G(t, "ALLOWED_NAMESPACES", zn, {
|
|
439
|
+
transform: ce
|
|
440
|
+
}), xe = G(t, "ADD_URI_SAFE_ATTR", Pe, {
|
|
441
|
+
transform: E,
|
|
442
|
+
base: Pe
|
|
443
|
+
}), Ce = G(t, "ADD_DATA_URI_TAGS", Me, {
|
|
444
|
+
transform: E,
|
|
445
|
+
base: Me
|
|
446
|
+
}), rt = G(t, "FORBID_CONTENTS", ve, {
|
|
447
|
+
transform: E
|
|
448
|
+
}), _t = G(t, "FORBID_TAGS", C({}), {
|
|
449
|
+
transform: E
|
|
450
|
+
}), we = G(t, "FORBID_ATTR", C({}), {
|
|
451
|
+
transform: E
|
|
452
|
+
}), it = D(t, "USE_PROFILES") ? t.USE_PROFILES && typeof t.USE_PROFILES == "object" ? C(t.USE_PROFILES) : t.USE_PROFILES : !1, Oe = t.ALLOW_ARIA_ATTR !== !1, qt = t.ALLOW_DATA_ATTR !== !1, Re = t.ALLOW_UNKNOWN_PROTOCOLS || !1, Le = t.ALLOW_SELF_CLOSE_IN_ATTR !== !1, F = t.SAFE_FOR_TEMPLATES || !1, X = t.SAFE_FOR_XML !== !1, V = t.WHOLE_DOCUMENT || !1, ot = t.RETURN_DOM || !1, Nt = t.RETURN_DOM_FRAGMENT || !1, vt = t.RETURN_TRUSTED_TYPE || !1, Zt = t.FORCE_BODY || !1, Ie = t.SANITIZE_DOM !== !1, De = t.SANITIZE_NAMED_PROPS || !1, Jt = t.KEEP_CONTENT !== !1, Qt = t.IN_PLACE || !1, Se = Ro(t.ALLOWED_URI_REGEXP) ? t.ALLOWED_URI_REGEXP : pn, st = typeof t.NAMESPACE == "string" ? t.NAMESPACE : P, ne = de(
|
|
453
|
+
t,
|
|
454
|
+
"MATHML_TEXT_INTEGRATION_POINTS",
|
|
455
|
+
() => p({}, ze)
|
|
456
|
+
// Default built-in map
|
|
457
|
+
), oe = de(
|
|
458
|
+
t,
|
|
459
|
+
"HTML_INTEGRATION_POINTS",
|
|
460
|
+
() => p({}, ke)
|
|
461
|
+
// Default built-in map
|
|
462
|
+
);
|
|
463
|
+
const e = de(t, "CUSTOM_ELEMENT_HANDLING", () => ct(null));
|
|
464
|
+
if (x = ct(null), D(e, "tagNameCheck") && Ue(e.tagNameCheck) && (x.tagNameCheck = e.tagNameCheck), D(e, "attributeNameCheck") && Ue(e.attributeNameCheck) && (x.attributeNameCheck = e.attributeNameCheck), D(e, "allowCustomizedBuiltInElements") && typeof e.allowCustomizedBuiltInElements == "boolean" && (x.allowCustomizedBuiltInElements = e.allowCustomizedBuiltInElements), S(x), F && (qt = !1), Nt && (ot = !0), it && (_ = p({}, cn), g = ct(null), it.html === !0 && (p(_, ln), p(g, un)), it.svg === !0 && (p(_, ue), p(g, me), p(g, Ht)), it.svgFilters === !0 && (p(_, fe), p(g, me), p(g, Ht)), it.mathMl === !0 && (p(_, pe), p(g, fn), p(g, Ht))), U.tagCheck = null, U.attributeCheck = null, D(t, "ADD_TAGS") && (typeof t.ADD_TAGS == "function" ? U.tagCheck = t.ADD_TAGS : ft(t.ADD_TAGS) && (_ === Xt && (_ = C(_)), p(_, t.ADD_TAGS, E))), D(t, "ADD_ATTR") && (typeof t.ADD_ATTR == "function" ? U.attributeCheck = t.ADD_ATTR : ft(t.ADD_ATTR) && (g === Vt && (g = C(g)), p(g, t.ADD_ATTR, E))), D(t, "ADD_FORBID_CONTENTS") && ft(t.ADD_FORBID_CONTENTS) && (rt === ve && (rt = C(rt)), p(rt, t.ADD_FORBID_CONTENTS, E)), Jt && (_["#text"] = !0), V && p(_, ["html", "head", "body"]), _.table && (p(_, ["tbody"]), delete _t.tbody), t.TRUSTED_TYPES_POLICY) {
|
|
443
465
|
if (typeof t.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
444
|
-
throw
|
|
466
|
+
throw K('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
445
467
|
if (typeof t.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
446
|
-
throw
|
|
447
|
-
const
|
|
448
|
-
|
|
468
|
+
throw K('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
469
|
+
const i = R;
|
|
470
|
+
R = t.TRUSTED_TYPES_POLICY;
|
|
449
471
|
try {
|
|
450
|
-
|
|
472
|
+
j = nt("");
|
|
451
473
|
} catch (a) {
|
|
452
|
-
throw
|
|
474
|
+
throw R = i, a;
|
|
453
475
|
}
|
|
454
|
-
} else t.TRUSTED_TYPES_POLICY === null ? (
|
|
455
|
-
|
|
456
|
-
},
|
|
457
|
-
return e.namespaceURI ===
|
|
458
|
-
},
|
|
459
|
-
return e.namespaceURI ===
|
|
460
|
-
},
|
|
461
|
-
return e.namespaceURI ===
|
|
462
|
-
},
|
|
463
|
-
let e =
|
|
476
|
+
} else t.TRUSTED_TYPES_POLICY === null ? (R = void 0, j = "") : (R === void 0 && (R = On()), R && typeof j == "string" && (j = nt("")));
|
|
477
|
+
b && b(t), at = t;
|
|
478
|
+
}, Fe = p({}, [...ue, ...fe, ...Lo]), He = p({}, [...pe, ...Io]), Gn = function(t, e, i) {
|
|
479
|
+
return e.namespaceURI === P ? t === "svg" : e.namespaceURI === Ct ? t === "svg" && (i === "annotation-xml" || ne[i]) : !!Fe[t];
|
|
480
|
+
}, Wn = function(t, e, i) {
|
|
481
|
+
return e.namespaceURI === P ? t === "math" : e.namespaceURI === Mt ? t === "math" && oe[i] : !!He[t];
|
|
482
|
+
}, Bn = function(t, e, i) {
|
|
483
|
+
return e.namespaceURI === Mt && !oe[i] || e.namespaceURI === Ct && !ne[i] ? !1 : !He[t] && (kn[t] || !Fe[t]);
|
|
484
|
+
}, Yn = function(t) {
|
|
485
|
+
let e = tt(t);
|
|
464
486
|
(!e || !e.tagName) && (e = {
|
|
465
|
-
namespaceURI:
|
|
487
|
+
namespaceURI: st,
|
|
466
488
|
tagName: "template"
|
|
467
489
|
});
|
|
468
|
-
const
|
|
469
|
-
return
|
|
470
|
-
},
|
|
471
|
-
|
|
490
|
+
const i = bt(t.tagName), a = bt(e.tagName);
|
|
491
|
+
return ee[t.namespaceURI] ? t.namespaceURI === Mt ? Gn(i, e, a) : t.namespaceURI === Ct ? Wn(i, e, a) : t.namespaceURI === P ? Bn(i, e, a) : !!(gt === "application/xhtml+xml" && ee[t.namespaceURI]) : !1;
|
|
492
|
+
}, H = function(t) {
|
|
493
|
+
Tt(n.removed, {
|
|
472
494
|
element: t
|
|
473
495
|
});
|
|
474
496
|
try {
|
|
475
|
-
|
|
497
|
+
tt(t).removeChild(t);
|
|
476
498
|
} catch {
|
|
477
|
-
if (
|
|
478
|
-
throw
|
|
499
|
+
if (Wt(t), !tt(t))
|
|
500
|
+
throw K("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
479
501
|
}
|
|
480
|
-
},
|
|
481
|
-
|
|
482
|
-
|
|
502
|
+
}, Ge = function(t, e, i) {
|
|
503
|
+
try {
|
|
504
|
+
t.removeAttributeNode(e);
|
|
505
|
+
} catch {
|
|
506
|
+
try {
|
|
507
|
+
t.removeAttribute(i);
|
|
508
|
+
} catch {
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}, xt = function(t) {
|
|
512
|
+
Pt(t);
|
|
513
|
+
const e = Q(t);
|
|
483
514
|
if (e) {
|
|
484
515
|
const a = [];
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
}),
|
|
516
|
+
Z(e, (l) => {
|
|
517
|
+
Tt(a, l);
|
|
518
|
+
}), Z(a, (l) => {
|
|
488
519
|
try {
|
|
489
|
-
|
|
520
|
+
Wt(l);
|
|
490
521
|
} catch {
|
|
491
522
|
}
|
|
492
523
|
});
|
|
493
524
|
}
|
|
494
|
-
const
|
|
495
|
-
if (
|
|
496
|
-
for (let a =
|
|
497
|
-
const
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
525
|
+
const i = Bt(t);
|
|
526
|
+
if (i)
|
|
527
|
+
for (let a = i.length - 1; a >= 0; --a) {
|
|
528
|
+
const l = i[a], f = l && l.name;
|
|
529
|
+
typeof f == "string" && Ge(t, l, f);
|
|
530
|
+
}
|
|
531
|
+
}, q = function(t, e, i) {
|
|
532
|
+
if (!i)
|
|
533
|
+
try {
|
|
534
|
+
i = e.getAttributeNode(t);
|
|
535
|
+
} catch {
|
|
536
|
+
i = null;
|
|
503
537
|
}
|
|
504
|
-
|
|
538
|
+
Tt(n.removed, {
|
|
539
|
+
attribute: i || null,
|
|
540
|
+
from: e
|
|
541
|
+
});
|
|
505
542
|
try {
|
|
506
|
-
|
|
507
|
-
attribute: e.getAttributeNode(t),
|
|
508
|
-
from: e
|
|
509
|
-
});
|
|
543
|
+
i ? e.removeAttributeNode(i) : e.removeAttribute(t);
|
|
510
544
|
} catch {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
}
|
|
545
|
+
try {
|
|
546
|
+
e.removeAttribute(t);
|
|
547
|
+
} catch {
|
|
548
|
+
}
|
|
515
549
|
}
|
|
516
|
-
if (
|
|
517
|
-
if (
|
|
550
|
+
if (t === "is")
|
|
551
|
+
if (ot || Nt)
|
|
518
552
|
try {
|
|
519
|
-
|
|
553
|
+
H(e);
|
|
520
554
|
} catch {
|
|
521
555
|
}
|
|
522
556
|
else
|
|
@@ -524,118 +558,117 @@ function un() {
|
|
|
524
558
|
e.setAttribute(t, "");
|
|
525
559
|
} catch {
|
|
526
560
|
}
|
|
527
|
-
},
|
|
528
|
-
const e =
|
|
561
|
+
}, $n = function(t) {
|
|
562
|
+
const e = Bt(t);
|
|
529
563
|
if (e)
|
|
530
|
-
for (let
|
|
531
|
-
const a = e[
|
|
532
|
-
|
|
533
|
-
try {
|
|
534
|
-
t.removeAttribute(c);
|
|
535
|
-
} catch {
|
|
536
|
-
}
|
|
564
|
+
for (let i = e.length - 1; i >= 0; --i) {
|
|
565
|
+
const a = e[i], l = a && a.name;
|
|
566
|
+
typeof l != "string" || g[E(l)] || Ge(t, a, l);
|
|
537
567
|
}
|
|
538
|
-
},
|
|
568
|
+
}, Pt = function(t) {
|
|
539
569
|
const e = [t];
|
|
540
570
|
for (; e.length > 0; ) {
|
|
541
|
-
const
|
|
542
|
-
(
|
|
543
|
-
const
|
|
544
|
-
if (
|
|
545
|
-
for (let f =
|
|
546
|
-
e.push(
|
|
571
|
+
const i = e.pop();
|
|
572
|
+
dt(i) === v.element && $n(i);
|
|
573
|
+
const l = Q(i);
|
|
574
|
+
if (l)
|
|
575
|
+
for (let f = l.length - 1; f >= 0; --f)
|
|
576
|
+
e.push(l[f]);
|
|
547
577
|
}
|
|
548
|
-
},
|
|
549
|
-
|
|
578
|
+
}, We = function(t, e) {
|
|
579
|
+
return X ? t === "patchsrc" ? !0 : t === "for" && e !== "label" && e !== "output" : !1;
|
|
580
|
+
}, jn = function(t) {
|
|
581
|
+
if (!X)
|
|
550
582
|
return;
|
|
551
583
|
const e = [t];
|
|
552
584
|
for (; e.length > 0; ) {
|
|
553
|
-
const
|
|
554
|
-
if (a === v.processingInstruction || a === v.comment &&
|
|
585
|
+
const i = e.pop(), a = dt(i);
|
|
586
|
+
if (a === v.processingInstruction || a === v.comment && w(dn, i.data)) {
|
|
555
587
|
try {
|
|
556
|
-
|
|
588
|
+
Wt(i);
|
|
557
589
|
} catch {
|
|
558
590
|
}
|
|
559
591
|
continue;
|
|
560
592
|
}
|
|
561
593
|
if (a === v.element) {
|
|
562
|
-
const f =
|
|
594
|
+
const f = i, d = E(Yt(i));
|
|
563
595
|
try {
|
|
564
|
-
f.hasAttribute && f.hasAttribute("patchsrc") && f.removeAttribute("patchsrc"), f.hasAttribute && f.hasAttribute("for") &&
|
|
596
|
+
f.hasAttribute && f.hasAttribute("patchsrc") && f.removeAttribute("patchsrc"), f.hasAttribute && f.hasAttribute("for") && We("for", d) && f.removeAttribute("for");
|
|
565
597
|
} catch {
|
|
566
598
|
}
|
|
567
599
|
}
|
|
568
|
-
const
|
|
569
|
-
if (
|
|
570
|
-
for (let f =
|
|
571
|
-
e.push(
|
|
600
|
+
const l = Q(i);
|
|
601
|
+
if (l)
|
|
602
|
+
for (let f = l.length - 1; f >= 0; --f)
|
|
603
|
+
e.push(l[f]);
|
|
572
604
|
}
|
|
573
|
-
},
|
|
574
|
-
let e = null,
|
|
575
|
-
if (
|
|
605
|
+
}, Be = function(t) {
|
|
606
|
+
let e = null, i = null;
|
|
607
|
+
if (Zt)
|
|
576
608
|
t = "<remove></remove>" + t;
|
|
577
609
|
else {
|
|
578
|
-
const f =
|
|
579
|
-
|
|
610
|
+
const f = on(t, /^[\r\n\t ]+/);
|
|
611
|
+
i = f && f[0];
|
|
580
612
|
}
|
|
581
|
-
gt === "application/xhtml+xml" &&
|
|
582
|
-
const a =
|
|
583
|
-
if (
|
|
613
|
+
gt === "application/xhtml+xml" && st === P && (t = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + t + "</body></html>");
|
|
614
|
+
const a = R ? nt(t) : t;
|
|
615
|
+
if (st === P)
|
|
584
616
|
try {
|
|
585
|
-
e = new
|
|
617
|
+
e = new Gt().parseFromString(a, gt);
|
|
586
618
|
} catch {
|
|
587
619
|
}
|
|
588
620
|
if (!e || !e.documentElement) {
|
|
589
|
-
e =
|
|
621
|
+
e = jt.createDocument(st, "template", null);
|
|
590
622
|
try {
|
|
591
|
-
e.documentElement.innerHTML =
|
|
623
|
+
e.documentElement.innerHTML = te ? j : a;
|
|
592
624
|
} catch {
|
|
593
625
|
}
|
|
594
626
|
}
|
|
595
|
-
const
|
|
596
|
-
return t &&
|
|
597
|
-
},
|
|
598
|
-
|
|
599
|
-
|
|
627
|
+
const l = e.body || e.documentElement;
|
|
628
|
+
return t && i && l.insertBefore(s.createTextNode(i), l.childNodes[0] || null), st === P ? Ln.call(e, V ? "html" : "body")[0] : V ? e.documentElement : l;
|
|
629
|
+
}, Ye = function(t) {
|
|
630
|
+
const e = Rt ? Rt(t) : t.ownerDocument;
|
|
631
|
+
return Ae.call(
|
|
632
|
+
e || t,
|
|
600
633
|
t,
|
|
601
634
|
// eslint-disable-next-line no-bitwise
|
|
602
|
-
|
|
635
|
+
N.SHOW_ELEMENT | N.SHOW_COMMENT | N.SHOW_TEXT | N.SHOW_PROCESSING_INSTRUCTION | N.SHOW_CDATA_SECTION,
|
|
603
636
|
null
|
|
604
637
|
);
|
|
605
|
-
},
|
|
606
|
-
return t = Et(t,
|
|
607
|
-
},
|
|
638
|
+
}, zt = function(t) {
|
|
639
|
+
return t = Et(t, Dn, " "), t = Et(t, Nn, " "), t = Et(t, vn, " "), t;
|
|
640
|
+
}, re = function(t) {
|
|
608
641
|
var e;
|
|
609
642
|
t.normalize();
|
|
610
|
-
const
|
|
611
|
-
|
|
643
|
+
const i = Rt ? Rt(t) : t.ownerDocument, a = Ae.call(
|
|
644
|
+
i || t,
|
|
612
645
|
t,
|
|
613
646
|
// eslint-disable-next-line no-bitwise
|
|
614
|
-
|
|
647
|
+
N.SHOW_TEXT | N.SHOW_COMMENT | N.SHOW_CDATA_SECTION | N.SHOW_PROCESSING_INSTRUCTION,
|
|
615
648
|
null
|
|
616
649
|
);
|
|
617
|
-
let
|
|
618
|
-
for (;
|
|
619
|
-
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
|
|
650
|
+
let l = a.nextNode();
|
|
651
|
+
for (; l; )
|
|
652
|
+
l.data = zt(l.data), l = a.nextNode();
|
|
653
|
+
const f = (e = t.querySelectorAll) === null || e === void 0 ? void 0 : e.call(t, "template");
|
|
654
|
+
f && Z(f, (d) => {
|
|
655
|
+
lt(d.content) && re(d.content);
|
|
623
656
|
});
|
|
624
|
-
},
|
|
625
|
-
const e =
|
|
626
|
-
return typeof e != "string" ||
|
|
657
|
+
}, kt = function(t) {
|
|
658
|
+
const e = et ? et(t) : null;
|
|
659
|
+
return typeof e != "string" || E(e) !== "form" ? !1 : typeof t.nodeName != "string" || typeof t.textContent != "string" || typeof t.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
|
|
627
660
|
// prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
|
|
628
661
|
// makes the direct read diverge from the cached read; a clean form
|
|
629
662
|
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
630
663
|
// canonical NamedNodeMap.
|
|
631
|
-
t.attributes !==
|
|
664
|
+
t.attributes !== Bt(t) || typeof t.removeAttribute != "function" || typeof t.setAttribute != "function" || typeof t.namespaceURI != "string" || typeof t.insertBefore != "function" || typeof t.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
|
|
632
665
|
// returns the integer 1 for any Element regardless of realm; direct
|
|
633
666
|
// read on a clobbered form (e.g. <input name="nodeType">) returns
|
|
634
667
|
// the named child element. Cheap addition — nodeType is read from
|
|
635
668
|
// an internal slot, no serialization cost — and removes a residual
|
|
636
669
|
// clobbering surface used by several mXSS / PI / comment branches
|
|
637
670
|
// in _sanitizeElements that compare currentNode.nodeType directly.
|
|
638
|
-
t.nodeType !==
|
|
671
|
+
t.nodeType !== $(t) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
|
|
639
672
|
// "childNodes" shadows the prototype getter. Direct reads of
|
|
640
673
|
// form.childNodes from a clobbered form return the named child
|
|
641
674
|
// instead of the real NodeList, so any walk that reads it directly
|
|
@@ -646,293 +679,293 @@ function un() {
|
|
|
646
679
|
// select, etc.) regardless of whether the named child happens to
|
|
647
680
|
// carry a numeric .length, which a typeof-based probe would miss
|
|
648
681
|
// (e.g. HTMLSelectElement.length is a defined unsigned-long).
|
|
649
|
-
t.childNodes !==
|
|
650
|
-
},
|
|
651
|
-
if (
|
|
682
|
+
t.childNodes !== Q(t);
|
|
683
|
+
}, lt = function(t) {
|
|
684
|
+
if (!$ || typeof t != "object" || t === null)
|
|
652
685
|
return !1;
|
|
653
686
|
try {
|
|
654
|
-
return
|
|
687
|
+
return $(t) === v.documentFragment;
|
|
655
688
|
} catch {
|
|
656
689
|
return !1;
|
|
657
690
|
}
|
|
658
691
|
}, yt = function(t) {
|
|
659
|
-
if (
|
|
692
|
+
if (!$ || typeof t != "object" || t === null)
|
|
660
693
|
return !1;
|
|
661
694
|
try {
|
|
662
|
-
return typeof
|
|
695
|
+
return typeof $(t) == "number";
|
|
663
696
|
} catch {
|
|
664
697
|
return !1;
|
|
665
698
|
}
|
|
666
699
|
};
|
|
667
|
-
function
|
|
668
|
-
r.length !== 0 &&
|
|
669
|
-
|
|
700
|
+
function z(r, t, e) {
|
|
701
|
+
r.length !== 0 && Z(r, (i) => {
|
|
702
|
+
i.call(n, t, e, at);
|
|
670
703
|
});
|
|
671
704
|
}
|
|
672
|
-
const
|
|
673
|
-
return !!(
|
|
674
|
-
},
|
|
675
|
-
if (
|
|
705
|
+
const Xn = function(t, e) {
|
|
706
|
+
return !!(X && t.hasChildNodes() && !yt(t.firstElementChild) && w(mn, t.textContent) && w(mn, t.innerHTML) || X && t.namespaceURI === P && Ho[e] && (yt(t.firstElementChild) || typeof t.textContent == "string" && w(Go[e], t.textContent)) || t.nodeType === v.processingInstruction || X && t.nodeType === v.comment && w(dn, t.data));
|
|
707
|
+
}, Ut = function(t, e) {
|
|
708
|
+
if (t instanceof RegExp)
|
|
709
|
+
return w(t, e);
|
|
710
|
+
if (t instanceof Function) {
|
|
711
|
+
for (var i = arguments.length, a = new Array(i > 2 ? i - 2 : 0), l = 2; l < i; l++)
|
|
712
|
+
a[l - 2] = arguments[l];
|
|
713
|
+
return !!t(e, ...a);
|
|
714
|
+
}
|
|
715
|
+
return !1;
|
|
716
|
+
}, Vn = function(t, e, i) {
|
|
717
|
+
if (!_t[e] && qe(e) && Ut(x.tagNameCheck, e))
|
|
676
718
|
return !1;
|
|
677
|
-
if (
|
|
678
|
-
const
|
|
679
|
-
if (
|
|
680
|
-
const
|
|
681
|
-
for (let
|
|
682
|
-
const y =
|
|
683
|
-
|
|
719
|
+
if (Jt && !rt[e]) {
|
|
720
|
+
const a = tt(t), l = Q(t);
|
|
721
|
+
if (l && a) {
|
|
722
|
+
const f = l.length;
|
|
723
|
+
for (let d = f - 1; d >= 0; --d) {
|
|
724
|
+
const y = t === i ? bn(l[d], !0) : l[d];
|
|
725
|
+
a.insertBefore(y, Sn(t));
|
|
684
726
|
}
|
|
685
727
|
}
|
|
686
728
|
}
|
|
687
|
-
return
|
|
688
|
-
},
|
|
689
|
-
|
|
729
|
+
return H(t), !0;
|
|
730
|
+
}, $e = function(t, e, i, a) {
|
|
731
|
+
return t.length === 0 ? e : e === i || e === a ? C(e) : e;
|
|
732
|
+
}, je = function(t, e) {
|
|
733
|
+
return t === e || tt(t) !== null ? !1 : (Qt && Pt(t), !0);
|
|
734
|
+
}, Xe = function(t, e) {
|
|
735
|
+
if (z(h.beforeSanitizeElements, t, null), je(t, e))
|
|
690
736
|
return !0;
|
|
691
|
-
if (
|
|
692
|
-
return
|
|
693
|
-
const
|
|
694
|
-
if (
|
|
695
|
-
tagName:
|
|
737
|
+
if (kt(t))
|
|
738
|
+
return H(t), !0;
|
|
739
|
+
const i = E(Yt(t));
|
|
740
|
+
if (_ = $e(h.uponSanitizeElement, _, Xt, It), z(h.uponSanitizeElement, t, {
|
|
741
|
+
tagName: i,
|
|
696
742
|
allowedTags: _
|
|
697
|
-
}), t
|
|
743
|
+
}), je(t, e))
|
|
698
744
|
return !0;
|
|
699
|
-
if (
|
|
700
|
-
return
|
|
701
|
-
if (
|
|
702
|
-
const
|
|
703
|
-
return
|
|
745
|
+
if (Xn(t, i))
|
|
746
|
+
return H(t), !0;
|
|
747
|
+
if (_t[i] || !(U.tagCheck instanceof Function && U.tagCheck(i)) && !_[i]) {
|
|
748
|
+
const l = Vn(t, i, e);
|
|
749
|
+
return l === !1 && z(h.afterSanitizeElements, t, null), l;
|
|
704
750
|
}
|
|
705
|
-
if ((
|
|
706
|
-
return
|
|
707
|
-
if (
|
|
708
|
-
const
|
|
709
|
-
t.textContent !==
|
|
751
|
+
if (dt(t) === v.element && !Yn(t) || (i === "noscript" || i === "noembed" || i === "noframes") && w(Uo, t.innerHTML))
|
|
752
|
+
return H(t), !0;
|
|
753
|
+
if (F && t.nodeType === v.text) {
|
|
754
|
+
const l = zt(t.textContent);
|
|
755
|
+
t.textContent !== l && (Tt(n.removed, {
|
|
710
756
|
element: t.cloneNode()
|
|
711
|
-
}), t.textContent =
|
|
757
|
+
}), t.textContent = l);
|
|
712
758
|
}
|
|
713
|
-
return
|
|
714
|
-
},
|
|
715
|
-
if (
|
|
759
|
+
return z(h.afterSanitizeElements, t, null), !1;
|
|
760
|
+
}, Ve = function(t, e, i) {
|
|
761
|
+
if (we[e] || We(e, t) || Ie && (e === "id" || e === "name") && (i in s || i in Hn))
|
|
716
762
|
return !1;
|
|
717
|
-
const a =
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
733
|
-
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
734
|
-
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
735
|
-
!(He(t) && (g.tagNameCheck instanceof RegExp && b(g.tagNameCheck, t) || g.tagNameCheck instanceof Function && g.tagNameCheck(t)) && (g.attributeNameCheck instanceof RegExp && b(g.attributeNameCheck, e) || g.attributeNameCheck instanceof Function && g.attributeNameCheck(e, t)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
736
|
-
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
737
|
-
e === "is" && g.allowCustomizedBuiltInElements && (g.tagNameCheck instanceof RegExp && b(g.tagNameCheck, o) || g.tagNameCheck instanceof Function && g.tagNameCheck(o)))
|
|
738
|
-
) return !1;
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
return !0;
|
|
742
|
-
}, Un = p({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), He = function(t) {
|
|
743
|
-
return !Un[bt(t)] && b(wn, t);
|
|
744
|
-
}, Hn = function(t, e, o, a) {
|
|
745
|
-
if (D && typeof wt == "object" && typeof wt.getAttributeType == "function" && !o)
|
|
746
|
-
switch (wt.getAttributeType(t, e)) {
|
|
763
|
+
const a = g[e] || U.attributeCheck instanceof Function && U.attributeCheck(e, t);
|
|
764
|
+
return qt && w(Cn, e) || Oe && w(Mn, e) ? !0 : a ? xe[e] || w(Se, Et(i, be, "")) || (e === "src" || e === "xlink:href" || e === "href") && t !== "script" && rn(i, "data:") === 0 && Ce[t] || Re && !w(xn, Et(i, be, "")) ? !0 : !i : (
|
|
765
|
+
// Condition a) covers a basically valid custom element tag name whose
|
|
766
|
+
// tag passes the configured tagNameCheck and whose attribute name
|
|
767
|
+
// passes the configured attributeNameCheck ...
|
|
768
|
+
qe(t) && Ut(x.tagNameCheck, t) && Ut(x.attributeNameCheck, e, t) || // Condition b) covers an `is` attribute whose value passes the
|
|
769
|
+
// configured tagNameCheck while customized built-in elements are
|
|
770
|
+
// allowed.
|
|
771
|
+
e === "is" && x.allowCustomizedBuiltInElements && Ut(x.tagNameCheck, i)
|
|
772
|
+
);
|
|
773
|
+
}, qn = p({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), qe = function(t) {
|
|
774
|
+
return !qn[bt(t)] && w(Pn, t);
|
|
775
|
+
}, Kn = function(t, e, i, a) {
|
|
776
|
+
if (R && typeof Ot == "object" && typeof Ot.getAttributeType == "function" && !i)
|
|
777
|
+
switch (Ot.getAttributeType(t, e)) {
|
|
747
778
|
case "TrustedHTML":
|
|
748
|
-
return
|
|
779
|
+
return nt(a);
|
|
749
780
|
case "TrustedScriptURL":
|
|
750
|
-
return
|
|
781
|
+
return wn(a);
|
|
751
782
|
}
|
|
752
783
|
return a;
|
|
753
|
-
},
|
|
784
|
+
}, Zn = function(t, e, i, a) {
|
|
754
785
|
try {
|
|
755
|
-
|
|
786
|
+
i ? t.setAttributeNS(i, e, a) : t.setAttribute(e, a), kt(t) ? H(t) : nn(n.removed);
|
|
756
787
|
} catch {
|
|
757
|
-
|
|
788
|
+
q(e, t);
|
|
758
789
|
}
|
|
759
|
-
},
|
|
760
|
-
|
|
790
|
+
}, Ke = function(t) {
|
|
791
|
+
z(h.beforeSanitizeAttributes, t, null);
|
|
761
792
|
const e = t.attributes;
|
|
762
|
-
if (!e ||
|
|
793
|
+
if (!e || kt(t))
|
|
763
794
|
return;
|
|
764
|
-
|
|
795
|
+
g = $e(h.uponSanitizeAttribute, g, Vt, Dt);
|
|
796
|
+
const i = {
|
|
765
797
|
attrName: "",
|
|
766
798
|
attrValue: "",
|
|
767
799
|
keepAttr: !0,
|
|
768
|
-
allowedAttributes:
|
|
800
|
+
allowedAttributes: g,
|
|
769
801
|
forceKeepAttr: void 0
|
|
770
802
|
};
|
|
771
803
|
let a = e.length;
|
|
772
|
-
const
|
|
804
|
+
const l = E(t.nodeName);
|
|
773
805
|
for (; a--; ) {
|
|
774
|
-
const f = e[a],
|
|
775
|
-
let
|
|
776
|
-
if (
|
|
777
|
-
|
|
806
|
+
const f = e[a], d = f.name, y = f.namespaceURI, L = f.value, I = E(d), ae = L;
|
|
807
|
+
let O = d === "value" ? ae : Eo(ae);
|
|
808
|
+
if (i.attrName = I, i.attrValue = O, i.keepAttr = !0, i.forceKeepAttr = void 0, z(h.uponSanitizeAttribute, t, i), O = i.attrValue, De && (I === "id" || I === "name") && rn(O, Ne) !== 0 && (q(d, t, f), O = Ne + O), X && w(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, O)) {
|
|
809
|
+
q(d, t, f);
|
|
778
810
|
continue;
|
|
779
811
|
}
|
|
780
|
-
if (
|
|
781
|
-
|
|
812
|
+
if (I === "attributename" && on(O, "href")) {
|
|
813
|
+
q(d, t, f);
|
|
782
814
|
continue;
|
|
783
815
|
}
|
|
784
|
-
if (!
|
|
785
|
-
if (!
|
|
786
|
-
|
|
816
|
+
if (!i.forceKeepAttr) {
|
|
817
|
+
if (!i.keepAttr) {
|
|
818
|
+
q(d, t, f);
|
|
787
819
|
continue;
|
|
788
820
|
}
|
|
789
|
-
if (!
|
|
790
|
-
|
|
821
|
+
if (!Le && w(Fo, O)) {
|
|
822
|
+
q(d, t, f);
|
|
791
823
|
continue;
|
|
792
824
|
}
|
|
793
|
-
if (
|
|
794
|
-
|
|
825
|
+
if (F && (O = zt(O)), !Ve(l, I, O)) {
|
|
826
|
+
q(d, t, f);
|
|
795
827
|
continue;
|
|
796
828
|
}
|
|
797
|
-
|
|
829
|
+
O = Kn(l, I, y, O), O !== ae && Zn(t, d, y, O);
|
|
798
830
|
}
|
|
799
831
|
}
|
|
800
|
-
|
|
801
|
-
},
|
|
832
|
+
z(h.afterSanitizeAttributes, t, null);
|
|
833
|
+
}, Ft = function(t) {
|
|
802
834
|
let e = null;
|
|
803
|
-
const
|
|
804
|
-
for (
|
|
805
|
-
if (
|
|
806
|
-
const
|
|
807
|
-
|
|
835
|
+
const i = Ye(t);
|
|
836
|
+
for (z(h.beforeSanitizeShadowDOM, t, null); e = i.nextNode(); )
|
|
837
|
+
if (z(h.uponSanitizeShadowNode, e, null), Xe(e, t), Ke(e), lt(e.content) && Ft(e.content), dt(e) === v.element) {
|
|
838
|
+
const a = ye(e);
|
|
839
|
+
lt(a) && (se(a), Ft(a));
|
|
808
840
|
}
|
|
809
|
-
|
|
810
|
-
},
|
|
841
|
+
z(h.afterSanitizeShadowDOM, t, null);
|
|
842
|
+
}, se = function(t) {
|
|
811
843
|
const e = [{
|
|
812
844
|
node: t,
|
|
813
845
|
shadow: null
|
|
814
846
|
}];
|
|
815
847
|
for (; e.length > 0; ) {
|
|
816
|
-
const
|
|
817
|
-
if (
|
|
818
|
-
|
|
848
|
+
const i = e.pop();
|
|
849
|
+
if (i.shadow) {
|
|
850
|
+
Ft(i.shadow);
|
|
819
851
|
continue;
|
|
820
852
|
}
|
|
821
|
-
const a =
|
|
822
|
-
if (
|
|
823
|
-
for (let
|
|
853
|
+
const a = i.node, f = dt(a) === v.element, d = Q(a);
|
|
854
|
+
if (d)
|
|
855
|
+
for (let y = d.length - 1; y >= 0; --y)
|
|
824
856
|
e.push({
|
|
825
|
-
node: y
|
|
857
|
+
node: d[y],
|
|
826
858
|
shadow: null
|
|
827
859
|
});
|
|
828
860
|
if (f) {
|
|
829
|
-
const
|
|
830
|
-
if (typeof
|
|
831
|
-
const
|
|
832
|
-
|
|
833
|
-
node:
|
|
861
|
+
const y = et ? et(a) : null;
|
|
862
|
+
if (typeof y == "string" && E(y) === "template") {
|
|
863
|
+
const L = a.content;
|
|
864
|
+
lt(L) && e.push({
|
|
865
|
+
node: L,
|
|
834
866
|
shadow: null
|
|
835
867
|
});
|
|
836
868
|
}
|
|
837
869
|
}
|
|
838
870
|
if (f) {
|
|
839
|
-
const
|
|
840
|
-
|
|
871
|
+
const y = ye(a);
|
|
872
|
+
lt(y) && e.push({
|
|
841
873
|
node: null,
|
|
842
|
-
shadow:
|
|
874
|
+
shadow: y
|
|
843
875
|
}, {
|
|
844
|
-
node:
|
|
876
|
+
node: y,
|
|
845
877
|
shadow: null
|
|
846
878
|
});
|
|
847
879
|
}
|
|
848
880
|
}
|
|
849
881
|
};
|
|
850
882
|
return n.sanitize = function(r) {
|
|
851
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = null,
|
|
852
|
-
if (
|
|
853
|
-
throw
|
|
883
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = null, i = null, a = null, l = null;
|
|
884
|
+
if (te = !r, te && (r = "<!-->"), typeof r != "string" && !yt(r) && (r = Oo(r), typeof r != "string"))
|
|
885
|
+
throw K("dirty is not a string, aborting");
|
|
854
886
|
if (!n.isSupported)
|
|
855
887
|
return r;
|
|
856
|
-
|
|
857
|
-
const f =
|
|
888
|
+
Kt ? (_ = It, g = Dt) : ie(t), (h.uponSanitizeElement.length > 0 || h.uponSanitizeAttribute.length > 0) && (_ = C(_)), h.uponSanitizeAttribute.length > 0 && (g = C(g)), n.removed = [];
|
|
889
|
+
const f = Qt && typeof r != "string" && yt(r);
|
|
858
890
|
if (f) {
|
|
859
|
-
|
|
860
|
-
const
|
|
861
|
-
if (typeof
|
|
862
|
-
const
|
|
863
|
-
if (!_[
|
|
864
|
-
throw
|
|
891
|
+
jn(r);
|
|
892
|
+
const L = Yt(r);
|
|
893
|
+
if (typeof L == "string") {
|
|
894
|
+
const I = E(L);
|
|
895
|
+
if (!_[I] || _t[I])
|
|
896
|
+
throw xt(r), K("root node is forbidden and cannot be sanitized in-place");
|
|
865
897
|
}
|
|
866
|
-
if (
|
|
867
|
-
throw
|
|
898
|
+
if (kt(r))
|
|
899
|
+
throw xt(r), K("root node is clobbered and cannot be sanitized in-place");
|
|
868
900
|
try {
|
|
869
|
-
|
|
870
|
-
} catch (
|
|
871
|
-
throw
|
|
901
|
+
se(r);
|
|
902
|
+
} catch (I) {
|
|
903
|
+
throw xt(r), I;
|
|
872
904
|
}
|
|
873
905
|
} else if (yt(r))
|
|
874
|
-
e =
|
|
906
|
+
e = Be("<!---->"), i = e.ownerDocument.importNode(r, !0), i.nodeType === v.element && i.nodeName === "BODY" || i.nodeName === "HTML" ? e = i : e.appendChild(i), se(i);
|
|
875
907
|
else {
|
|
876
|
-
if (!
|
|
908
|
+
if (!ot && !F && !V && // eslint-disable-next-line unicorn/prefer-includes
|
|
877
909
|
r.indexOf("<") === -1)
|
|
878
|
-
return
|
|
879
|
-
if (e =
|
|
880
|
-
return
|
|
910
|
+
return R && vt ? nt(r) : r;
|
|
911
|
+
if (e = Be(r), !e)
|
|
912
|
+
return ot ? null : vt ? j : "";
|
|
881
913
|
}
|
|
882
|
-
e &&
|
|
883
|
-
const
|
|
914
|
+
e && Zt && H(e.firstChild);
|
|
915
|
+
const d = f ? r : e;
|
|
884
916
|
try {
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
917
|
+
const L = Ye(d);
|
|
918
|
+
for (; a = L.nextNode(); )
|
|
919
|
+
Xe(a, d), Ke(a), lt(a.content) && Ft(a.content);
|
|
920
|
+
} catch (L) {
|
|
921
|
+
throw f && (xt(r), Z(n.removed, (I) => {
|
|
922
|
+
I.element && Pt(I.element);
|
|
923
|
+
})), L;
|
|
891
924
|
}
|
|
892
925
|
if (f)
|
|
893
|
-
return
|
|
894
|
-
|
|
895
|
-
}),
|
|
896
|
-
if (
|
|
897
|
-
if (
|
|
898
|
-
for (
|
|
899
|
-
|
|
926
|
+
return Z(n.removed, (L) => {
|
|
927
|
+
L.element && Pt(L.element);
|
|
928
|
+
}), F && re(r), r;
|
|
929
|
+
if (ot) {
|
|
930
|
+
if (F && re(e), Nt)
|
|
931
|
+
for (l = Rn.call(e.ownerDocument); e.firstChild; )
|
|
932
|
+
l.appendChild(e.firstChild);
|
|
900
933
|
else
|
|
901
|
-
|
|
902
|
-
return (
|
|
934
|
+
l = e;
|
|
935
|
+
return (g.shadowroot || g.shadowrootmode) && (l = In.call(c, l, !0)), l;
|
|
903
936
|
}
|
|
904
|
-
let
|
|
905
|
-
return
|
|
906
|
-
` +
|
|
937
|
+
let y = V ? e.outerHTML : e.innerHTML;
|
|
938
|
+
return V && _["!doctype"] && e.ownerDocument && e.ownerDocument.doctype && e.ownerDocument.doctype.name && w(zo, e.ownerDocument.doctype.name) && (y = "<!DOCTYPE " + e.ownerDocument.doctype.name + `>
|
|
939
|
+
` + y), F && (y = zt(y)), R && vt ? nt(y) : y;
|
|
907
940
|
}, n.setConfig = function() {
|
|
908
941
|
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
909
|
-
|
|
942
|
+
ie(r), Kt = !0, It = _, Dt = g;
|
|
910
943
|
}, n.clearConfig = function() {
|
|
911
|
-
|
|
944
|
+
at = null, Kt = !1, It = null, Dt = null, R = $t, j = "";
|
|
912
945
|
}, n.isValidAttribute = function(r, t, e) {
|
|
913
|
-
|
|
914
|
-
const
|
|
915
|
-
return
|
|
946
|
+
at || ie({});
|
|
947
|
+
const i = E(r), a = E(t);
|
|
948
|
+
return Ve(i, a, e);
|
|
916
949
|
}, n.addHook = function(r, t) {
|
|
917
|
-
typeof t == "function" &&
|
|
950
|
+
typeof t == "function" && D(h, r) && Tt(h[r], t);
|
|
918
951
|
}, n.removeHook = function(r, t) {
|
|
919
|
-
if (
|
|
952
|
+
if (D(h, r)) {
|
|
920
953
|
if (t !== void 0) {
|
|
921
|
-
const e =
|
|
922
|
-
return e === -1 ? void 0 :
|
|
954
|
+
const e = yo(h[r], t);
|
|
955
|
+
return e === -1 ? void 0 : To(h[r], e, 1)[0];
|
|
923
956
|
}
|
|
924
|
-
return
|
|
957
|
+
return nn(h[r]);
|
|
925
958
|
}
|
|
926
959
|
}, n.removeHooks = function(r) {
|
|
927
|
-
|
|
960
|
+
D(h, r) && (h[r] = []);
|
|
928
961
|
}, n.removeAllHooks = function() {
|
|
929
|
-
h =
|
|
962
|
+
h = hn();
|
|
930
963
|
}, n;
|
|
931
964
|
}
|
|
932
|
-
var
|
|
933
|
-
const St = /* @__PURE__ */ new Map(),
|
|
934
|
-
function
|
|
935
|
-
const s =
|
|
965
|
+
var Yo = En();
|
|
966
|
+
const St = /* @__PURE__ */ new Map(), ge = /* @__PURE__ */ new Map();
|
|
967
|
+
function An(o, n) {
|
|
968
|
+
const s = Yo.sanitize(o, {
|
|
936
969
|
USE_PROFILES: { svg: !0, svgFilters: !0 },
|
|
937
970
|
FORBID_TAGS: ["script", "use"],
|
|
938
971
|
// <use> can SSRF to external hrefs
|
|
@@ -942,29 +975,29 @@ function fn(i, n) {
|
|
|
942
975
|
throw new Error(`Invalid SVG from ${n}`);
|
|
943
976
|
return m;
|
|
944
977
|
}
|
|
945
|
-
async function
|
|
946
|
-
const n = await fetch(
|
|
978
|
+
async function $o(o) {
|
|
979
|
+
const n = await fetch(o);
|
|
947
980
|
if (!n.ok)
|
|
948
981
|
throw new Error(`Failed to load icon: ${n.status}`);
|
|
949
|
-
return
|
|
982
|
+
return An(await n.text(), o);
|
|
950
983
|
}
|
|
951
|
-
async function
|
|
952
|
-
return St.has(
|
|
984
|
+
async function _n(o) {
|
|
985
|
+
return St.has(o) || St.set(o, $o(o)), (await St.get(o)).cloneNode(!0);
|
|
953
986
|
}
|
|
954
|
-
function
|
|
955
|
-
let n =
|
|
956
|
-
return n || (n =
|
|
987
|
+
function jo(o) {
|
|
988
|
+
let n = ge.get(o);
|
|
989
|
+
return n || (n = An(o, "inline SVG source"), ge.set(o, n)), n.cloneNode(!0);
|
|
957
990
|
}
|
|
958
|
-
function
|
|
959
|
-
|
|
991
|
+
function ti(o) {
|
|
992
|
+
o ? St.delete(o) : (St.clear(), ge.clear());
|
|
960
993
|
}
|
|
961
|
-
const
|
|
962
|
-
var
|
|
963
|
-
for (var u = void 0, m =
|
|
964
|
-
(
|
|
965
|
-
return u &&
|
|
966
|
-
},
|
|
967
|
-
const
|
|
994
|
+
const Xo = ":host{display:inline-block;width:fit-content;height:fit-content;--_nys-icon-size: var( --nys-icon-size, .7em );box-sizing:content-box!important;vertical-align:middle}@supports (font-size: 1cap){:host{--_nys-icon-size: var(--nys-icon-size, 1cap)}}.nys-icon--svg{width:var(--_nys-icon-size, 1em);height:var(--_nys-icon-size, 1em);display:block;white-space:nowrap}.nys-icon--xs{width:calc(var(--_nys-icon-size) * .75);height:calc(var(--_nys-icon-size) * .75)}.nys-icon--sm{width:calc(var(--_nys-icon-size) * .875);height:calc(var(--_nys-icon-size) * .875)}.nys-icon--md{width:var(--_nys-icon-size);height:var(--_nys-icon-size)}.nys-icon--lg{width:calc(var(--_nys-icon-size) * 1.125);height:calc(var(--_nys-icon-size) * 1.125)}.nys-icon--xl{width:calc(var(--_nys-icon-size) * 1.25);height:calc(var(--_nys-icon-size) * 1.25)}.nys-icon--2xl{width:calc(var(--_nys-icon-size) * 1.5);height:calc(var(--_nys-icon-size) * 1.5)}.nys-icon--3xl{width:calc(var(--_nys-icon-size) * 1.875);height:calc(var(--_nys-icon-size) * 1.875)}.nys-icon--4xl{width:calc(var(--_nys-icon-size) * 2.25);height:calc(var(--_nys-icon-size) * 2.25)}.nys-icon--5xl{width:calc(var(--_nys-icon-size) * 3);height:calc(var(--_nys-icon-size) * 3)}.nys-icon--12{width:.75rem;height:.75rem}.nys-icon--14{width:.875rem;height:.875rem}.nys-icon--16{width:1rem;height:1rem}.nys-icon--18{width:1.125rem;height:1.125rem}.nys-icon--20{width:1.25rem;height:1.25rem}.nys-icon--24{width:1.5rem;height:1.5rem}.nys-icon--32{width:2rem;height:2rem}.nys-icon--40{width:2.5rem;height:2.5rem}.nys-icon--50{width:3.125rem;height:3.125rem}.nys-icon--flip-horizontal{transform:scaleX(-1)}.nys-icon--flip-vertical{transform:scaleY(-1)}.nys-icon--flip-both{transform:scale(-1)}";
|
|
995
|
+
var Vo = Object.defineProperty, B = (o, n, s, c) => {
|
|
996
|
+
for (var u = void 0, m = o.length - 1, T; m >= 0; m--)
|
|
997
|
+
(T = o[m]) && (u = T(n, s, u) || u);
|
|
998
|
+
return u && Vo(n, s, u), u;
|
|
999
|
+
}, W;
|
|
1000
|
+
const k = (W = class extends ro {
|
|
968
1001
|
constructor() {
|
|
969
1002
|
super(...arguments), this.name = "", this.library = "default", this.ariaLabel = "", this.rotate = "0", this.flip = "", this.color = "", this.size = "md", this._svg = null, this._loadSeq = 0, this._loadPromise = null;
|
|
970
1003
|
}
|
|
@@ -976,10 +1009,10 @@ const G = (V = class extends qn {
|
|
|
976
1009
|
})();
|
|
977
1010
|
}
|
|
978
1011
|
connectedCallback() {
|
|
979
|
-
super.connectedCallback(), this._reflectHostSemantics(),
|
|
1012
|
+
super.connectedCallback(), this._reflectHostSemantics(), Je(this.library, this);
|
|
980
1013
|
}
|
|
981
1014
|
disconnectedCallback() {
|
|
982
|
-
super.disconnectedCallback(),
|
|
1015
|
+
super.disconnectedCallback(), Qe(this.library, this);
|
|
983
1016
|
}
|
|
984
1017
|
/** Called by the icon library registry when the current library changes. */
|
|
985
1018
|
redraw() {
|
|
@@ -996,14 +1029,14 @@ const G = (V = class extends qn {
|
|
|
996
1029
|
this._loadIcon();
|
|
997
1030
|
}
|
|
998
1031
|
updated(n) {
|
|
999
|
-
if (n.has("name") && !
|
|
1032
|
+
if (n.has("name") && !W._validName.test(this.name)) {
|
|
1000
1033
|
console.warn(`nys-icon: invalid name "${this.name}" — ignored`), this._svg = null;
|
|
1001
1034
|
return;
|
|
1002
1035
|
}
|
|
1003
1036
|
if (n.has("name") || n.has("library")) {
|
|
1004
1037
|
if (n.has("library")) {
|
|
1005
1038
|
const s = n.get("library");
|
|
1006
|
-
s &&
|
|
1039
|
+
s && Qe(s, this), Je(this.library, this);
|
|
1007
1040
|
}
|
|
1008
1041
|
this._loadIcon();
|
|
1009
1042
|
}
|
|
@@ -1012,19 +1045,19 @@ const G = (V = class extends qn {
|
|
|
1012
1045
|
_loadIcon() {
|
|
1013
1046
|
const n = ++this._loadSeq;
|
|
1014
1047
|
this._loadPromise = (async () => {
|
|
1015
|
-
const s =
|
|
1048
|
+
const s = lo(this.library);
|
|
1016
1049
|
if (!s || !this.name) {
|
|
1017
1050
|
this._svg = null;
|
|
1018
1051
|
return;
|
|
1019
1052
|
}
|
|
1020
1053
|
try {
|
|
1021
|
-
const
|
|
1054
|
+
const c = await s.resolver(this.name);
|
|
1022
1055
|
if (n !== this._loadSeq) return;
|
|
1023
|
-
if (!
|
|
1056
|
+
if (!c) {
|
|
1024
1057
|
this._svg = null;
|
|
1025
1058
|
return;
|
|
1026
1059
|
}
|
|
1027
|
-
const u = typeof
|
|
1060
|
+
const u = typeof c == "string" ? await _n(c) : c.type === "url" ? await _n(c.href) : jo(c.content);
|
|
1028
1061
|
if (n !== this._loadSeq) return;
|
|
1029
1062
|
s.mutator?.(u), this._applyAttributes(u), this._svg = u;
|
|
1030
1063
|
} catch {
|
|
@@ -1051,40 +1084,40 @@ const G = (V = class extends qn {
|
|
|
1051
1084
|
this.ariaLabel ? (this.setAttribute("role", "img"), this.setAttribute("aria-label", this.ariaLabel), this.removeAttribute("aria-hidden")) : (this.removeAttribute("role"), this.removeAttribute("aria-label"), this.setAttribute("aria-hidden", "true"));
|
|
1052
1085
|
}
|
|
1053
1086
|
render() {
|
|
1054
|
-
return this._svg ?
|
|
1087
|
+
return this._svg ? to`${this._svg}` : null;
|
|
1055
1088
|
}
|
|
1056
|
-
},
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
],
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
],
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
],
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
],
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
],
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
],
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
],
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
],
|
|
1081
|
-
let
|
|
1082
|
-
customElements.get("nys-icon") || customElements.define("nys-icon",
|
|
1089
|
+
}, W.styles = Qn(Xo), W._validName = /^[a-zA-Z0-9_-]+$/, W);
|
|
1090
|
+
B([
|
|
1091
|
+
J({ type: String, reflect: !0 })
|
|
1092
|
+
], k.prototype, "name");
|
|
1093
|
+
B([
|
|
1094
|
+
J({ type: String, reflect: !0 })
|
|
1095
|
+
], k.prototype, "library");
|
|
1096
|
+
B([
|
|
1097
|
+
J({ type: String })
|
|
1098
|
+
], k.prototype, "ariaLabel");
|
|
1099
|
+
B([
|
|
1100
|
+
J({ type: String })
|
|
1101
|
+
], k.prototype, "rotate");
|
|
1102
|
+
B([
|
|
1103
|
+
J({ type: String })
|
|
1104
|
+
], k.prototype, "flip");
|
|
1105
|
+
B([
|
|
1106
|
+
J({ type: String })
|
|
1107
|
+
], k.prototype, "color");
|
|
1108
|
+
B([
|
|
1109
|
+
J({ type: String })
|
|
1110
|
+
], k.prototype, "size");
|
|
1111
|
+
B([
|
|
1112
|
+
eo()
|
|
1113
|
+
], k.prototype, "_svg");
|
|
1114
|
+
let qo = k;
|
|
1115
|
+
customElements.get("nys-icon") || customElements.define("nys-icon", qo);
|
|
1083
1116
|
export {
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1117
|
+
qo as NysIcon,
|
|
1118
|
+
ti as clearIconCache,
|
|
1119
|
+
lo as getIconLibrary,
|
|
1120
|
+
Jo as registerIconLibrary,
|
|
1121
|
+
Qo as unregisterIconLibrary
|
|
1089
1122
|
};
|
|
1090
1123
|
//# sourceMappingURL=nys-icon.js.map
|