@nysds/nys-icon 1.19.2 → 1.19.3
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 +350 -343
- package/dist/nys-icon.js.map +1 -1
- package/dist/nys-icon.library-BwGLLd_g.js +700 -0
- package/dist/nys-icon.library-BwGLLd_g.js.map +1 -0
- package/package.json +8 -2
- package/dist/nys-icon.d.ts +0 -74
package/dist/nys-icon.js
CHANGED
|
@@ -1,168 +1,166 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { property as Q, state as
|
|
1
|
+
import { LitElement as Hn, unsafeCSS as Gn, html as Bn } from "lit";
|
|
2
|
+
import { property as Q, state as Wn } from "lit/decorators.js";
|
|
3
3
|
/*!
|
|
4
4
|
* █▄ █ █ █ █▀▀▀█ █▀▀▄ █▀▀▀█
|
|
5
5
|
* █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
|
|
6
6
|
* █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
|
|
7
7
|
*
|
|
8
|
-
* Icon Component v1.19.
|
|
8
|
+
* Icon Component v1.19.3
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const s = document.currentScript;
|
|
20
|
-
if (s?.src) return new URL("./icons/", s.src).href;
|
|
21
|
-
const l = Array.from(
|
|
22
|
-
document.querySelectorAll("script[src]")
|
|
23
|
-
).find((m) => o.test(m.src));
|
|
24
|
-
if (l?.src) return new URL("./icons/", l.src).href;
|
|
25
|
-
}
|
|
26
|
-
const n = import.meta.url;
|
|
27
|
-
return n ? new URL("./icons/", n).href : new URL("./icons/", document.baseURI).href;
|
|
13
|
+
const bt = globalThis.__nysIconRegistry ??= /* @__PURE__ */ new Map(), lt = globalThis.__nysIconWatchers ??= /* @__PURE__ */ new Map();
|
|
14
|
+
let ee = null, Ge = null;
|
|
15
|
+
async function Yn() {
|
|
16
|
+
return ee || (Ge ??= import("./nys-icon.library-BwGLLd_g.js").then(
|
|
17
|
+
(o) => ee = o.default
|
|
18
|
+
), Ge);
|
|
28
19
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
function jn() {
|
|
21
|
+
if (globalThis.__nysIconDefaultRegistered || bt.has("default")) {
|
|
22
|
+
globalThis.__nysIconDefaultRegistered = !0;
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
globalThis.__nysIconDefaultRegistered = !0, bt.set("default", {
|
|
26
|
+
resolver: async (o) => {
|
|
27
|
+
if (!o) return;
|
|
28
|
+
const s = (await Yn())[o];
|
|
29
|
+
return s ? { type: "svg", content: s } : void 0;
|
|
30
|
+
}
|
|
33
31
|
});
|
|
34
32
|
}
|
|
35
|
-
function
|
|
36
|
-
bt.set(o, n),
|
|
33
|
+
function xo(o, n) {
|
|
34
|
+
bt.set(o, n), lt.get(o)?.forEach((s) => s.redraw());
|
|
37
35
|
}
|
|
38
|
-
function
|
|
39
|
-
bt.delete(o),
|
|
36
|
+
function ko(o) {
|
|
37
|
+
bt.delete(o), lt.get(o)?.forEach((n) => n.redraw());
|
|
40
38
|
}
|
|
41
|
-
function
|
|
42
|
-
return bt.get(o);
|
|
39
|
+
function $n(o) {
|
|
40
|
+
return jn(), bt.get(o);
|
|
43
41
|
}
|
|
44
|
-
function
|
|
45
|
-
|
|
42
|
+
function Be(o, n) {
|
|
43
|
+
lt.has(o) || lt.set(o, /* @__PURE__ */ new Set()), lt.get(o).add(n);
|
|
46
44
|
}
|
|
47
|
-
function
|
|
48
|
-
|
|
45
|
+
function We(o, n) {
|
|
46
|
+
lt.get(o)?.delete(n);
|
|
49
47
|
}
|
|
50
48
|
/*! @license DOMPurify 3.4.11 | (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.11/LICENSE */
|
|
51
|
-
function
|
|
49
|
+
function Ye(o, n) {
|
|
52
50
|
(n == null || n > o.length) && (n = o.length);
|
|
53
|
-
for (var s = 0,
|
|
54
|
-
return
|
|
51
|
+
for (var s = 0, l = Array(n); s < n; s++) l[s] = o[s];
|
|
52
|
+
return l;
|
|
55
53
|
}
|
|
56
|
-
function
|
|
54
|
+
function Xn(o) {
|
|
57
55
|
if (Array.isArray(o)) return o;
|
|
58
56
|
}
|
|
59
|
-
function
|
|
57
|
+
function Vn(o, n) {
|
|
60
58
|
var s = o == null ? null : typeof Symbol < "u" && o[Symbol.iterator] || o["@@iterator"];
|
|
61
59
|
if (s != null) {
|
|
62
|
-
var
|
|
60
|
+
var l, c, m, A, ct = [], D = !0, ut = !1;
|
|
63
61
|
try {
|
|
64
|
-
if (m = (s = s.call(o)).next, n !== 0) for (; !(D = (
|
|
65
|
-
} catch (
|
|
66
|
-
ut = !0,
|
|
62
|
+
if (m = (s = s.call(o)).next, n !== 0) for (; !(D = (l = m.call(s)).done) && (ct.push(l.value), ct.length !== n); D = !0) ;
|
|
63
|
+
} catch (Pt) {
|
|
64
|
+
ut = !0, c = Pt;
|
|
67
65
|
} finally {
|
|
68
66
|
try {
|
|
69
|
-
if (!D && s.return != null && (
|
|
67
|
+
if (!D && s.return != null && (A = s.return(), Object(A) !== A)) return;
|
|
70
68
|
} finally {
|
|
71
|
-
if (ut) throw
|
|
69
|
+
if (ut) throw c;
|
|
72
70
|
}
|
|
73
71
|
}
|
|
74
|
-
return
|
|
72
|
+
return ct;
|
|
75
73
|
}
|
|
76
74
|
}
|
|
77
|
-
function
|
|
75
|
+
function qn() {
|
|
78
76
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
79
77
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
80
78
|
}
|
|
81
|
-
function
|
|
82
|
-
return
|
|
79
|
+
function Kn(o, n) {
|
|
80
|
+
return Xn(o) || Vn(o, n) || Zn(o, n) || qn();
|
|
83
81
|
}
|
|
84
|
-
function
|
|
82
|
+
function Zn(o, n) {
|
|
85
83
|
if (o) {
|
|
86
|
-
if (typeof o == "string") return
|
|
84
|
+
if (typeof o == "string") return Ye(o, n);
|
|
87
85
|
var s = {}.toString.call(o).slice(8, -1);
|
|
88
|
-
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) ?
|
|
86
|
+
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) ? Ye(o, n) : void 0;
|
|
89
87
|
}
|
|
90
88
|
}
|
|
91
|
-
const
|
|
92
|
-
let
|
|
93
|
-
|
|
89
|
+
const sn = Object.entries, je = Object.setPrototypeOf, Jn = Object.isFrozen, Qn = Object.getPrototypeOf, to = Object.getOwnPropertyDescriptor;
|
|
90
|
+
let w = Object.freeze, R = Object.seal, at = Object.create, an = typeof Reflect < "u" && Reflect, ae = an.apply, le = an.construct;
|
|
91
|
+
w || (w = function(n) {
|
|
94
92
|
return n;
|
|
95
93
|
});
|
|
96
94
|
R || (R = function(n) {
|
|
97
95
|
return n;
|
|
98
96
|
});
|
|
99
|
-
|
|
100
|
-
for (var
|
|
101
|
-
|
|
102
|
-
return n.apply(s,
|
|
97
|
+
ae || (ae = function(n, s) {
|
|
98
|
+
for (var l = arguments.length, c = new Array(l > 2 ? l - 2 : 0), m = 2; m < l; m++)
|
|
99
|
+
c[m - 2] = arguments[m];
|
|
100
|
+
return n.apply(s, c);
|
|
103
101
|
});
|
|
104
|
-
|
|
105
|
-
for (var s = arguments.length,
|
|
106
|
-
c
|
|
107
|
-
return new n(...
|
|
102
|
+
le || (le = function(n) {
|
|
103
|
+
for (var s = arguments.length, l = new Array(s > 1 ? s - 1 : 0), c = 1; c < s; c++)
|
|
104
|
+
l[c - 1] = arguments[c];
|
|
105
|
+
return new n(...l);
|
|
108
106
|
});
|
|
109
|
-
const
|
|
110
|
-
function
|
|
107
|
+
const gt = E(Array.prototype.forEach), eo = E(Array.prototype.lastIndexOf), $e = E(Array.prototype.pop), st = E(Array.prototype.push), no = E(Array.prototype.splice), j = Array.isArray, At = E(String.prototype.toLowerCase), ne = E(String.prototype.toString), Xe = E(String.prototype.match), yt = E(String.prototype.replace), Ve = E(String.prototype.indexOf), oo = E(String.prototype.trim), io = E(Number.prototype.toString), ro = E(Boolean.prototype.toString), qe = typeof BigInt > "u" ? null : E(BigInt.prototype.toString), Ke = typeof Symbol > "u" ? null : E(Symbol.prototype.toString), b = E(Object.prototype.hasOwnProperty), Et = E(Object.prototype.toString), O = E(RegExp.prototype.test), J = so(TypeError);
|
|
108
|
+
function E(o) {
|
|
111
109
|
return function(n) {
|
|
112
110
|
n instanceof RegExp && (n.lastIndex = 0);
|
|
113
|
-
for (var s = arguments.length,
|
|
114
|
-
c
|
|
115
|
-
return
|
|
111
|
+
for (var s = arguments.length, l = new Array(s > 1 ? s - 1 : 0), c = 1; c < s; c++)
|
|
112
|
+
l[c - 1] = arguments[c];
|
|
113
|
+
return ae(o, n, l);
|
|
116
114
|
};
|
|
117
115
|
}
|
|
118
|
-
function
|
|
116
|
+
function so(o) {
|
|
119
117
|
return function() {
|
|
120
|
-
for (var n = arguments.length, s = new Array(n),
|
|
121
|
-
s[
|
|
122
|
-
return
|
|
118
|
+
for (var n = arguments.length, s = new Array(n), l = 0; l < n; l++)
|
|
119
|
+
s[l] = arguments[l];
|
|
120
|
+
return le(o, s);
|
|
123
121
|
};
|
|
124
122
|
}
|
|
125
123
|
function f(o, n) {
|
|
126
124
|
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : At;
|
|
127
|
-
if (
|
|
125
|
+
if (je && je(o, null), !j(n))
|
|
128
126
|
return o;
|
|
129
|
-
let
|
|
130
|
-
for (;
|
|
131
|
-
let
|
|
132
|
-
if (typeof
|
|
133
|
-
const m = s(
|
|
134
|
-
m !==
|
|
127
|
+
let l = n.length;
|
|
128
|
+
for (; l--; ) {
|
|
129
|
+
let c = n[l];
|
|
130
|
+
if (typeof c == "string") {
|
|
131
|
+
const m = s(c);
|
|
132
|
+
m !== c && (Jn(n) || (n[l] = m), c = m);
|
|
135
133
|
}
|
|
136
|
-
o[
|
|
134
|
+
o[c] = !0;
|
|
137
135
|
}
|
|
138
136
|
return o;
|
|
139
137
|
}
|
|
140
|
-
function
|
|
138
|
+
function ao(o) {
|
|
141
139
|
for (let n = 0; n < o.length; n++)
|
|
142
140
|
b(o, n) || (o[n] = null);
|
|
143
141
|
return o;
|
|
144
142
|
}
|
|
145
143
|
function N(o) {
|
|
146
144
|
const n = at(null);
|
|
147
|
-
for (const
|
|
148
|
-
var s =
|
|
149
|
-
const
|
|
150
|
-
b(o,
|
|
145
|
+
for (const l of sn(o)) {
|
|
146
|
+
var s = Kn(l, 2);
|
|
147
|
+
const c = s[0], m = s[1];
|
|
148
|
+
b(o, c) && (j(m) ? n[c] = ao(m) : m && typeof m == "object" && m.constructor === Object ? n[c] = N(m) : n[c] = m);
|
|
151
149
|
}
|
|
152
150
|
return n;
|
|
153
151
|
}
|
|
154
|
-
function
|
|
152
|
+
function lo(o) {
|
|
155
153
|
switch (typeof o) {
|
|
156
154
|
case "string":
|
|
157
155
|
return o;
|
|
158
156
|
case "number":
|
|
159
|
-
return
|
|
157
|
+
return io(o);
|
|
160
158
|
case "boolean":
|
|
161
|
-
return
|
|
159
|
+
return ro(o);
|
|
162
160
|
case "bigint":
|
|
163
|
-
return
|
|
161
|
+
return qe ? qe(o) : "0";
|
|
164
162
|
case "symbol":
|
|
165
|
-
return
|
|
163
|
+
return Ke ? Ke(o) : "Symbol()";
|
|
166
164
|
case "undefined":
|
|
167
165
|
return Et(o);
|
|
168
166
|
case "function":
|
|
@@ -171,8 +169,8 @@ function no(o) {
|
|
|
171
169
|
return Et(o);
|
|
172
170
|
const n = o, s = z(n, "toString");
|
|
173
171
|
if (typeof s == "function") {
|
|
174
|
-
const
|
|
175
|
-
return typeof
|
|
172
|
+
const l = s(n);
|
|
173
|
+
return typeof l == "string" ? l : Et(l);
|
|
176
174
|
}
|
|
177
175
|
return Et(o);
|
|
178
176
|
}
|
|
@@ -182,34 +180,34 @@ function no(o) {
|
|
|
182
180
|
}
|
|
183
181
|
function z(o, n) {
|
|
184
182
|
for (; o !== null; ) {
|
|
185
|
-
const
|
|
186
|
-
if (
|
|
187
|
-
if (
|
|
188
|
-
return
|
|
189
|
-
if (typeof
|
|
190
|
-
return
|
|
183
|
+
const l = to(o, n);
|
|
184
|
+
if (l) {
|
|
185
|
+
if (l.get)
|
|
186
|
+
return E(l.get);
|
|
187
|
+
if (typeof l.value == "function")
|
|
188
|
+
return E(l.value);
|
|
191
189
|
}
|
|
192
|
-
o =
|
|
190
|
+
o = Qn(o);
|
|
193
191
|
}
|
|
194
192
|
function s() {
|
|
195
193
|
return null;
|
|
196
194
|
}
|
|
197
195
|
return s;
|
|
198
196
|
}
|
|
199
|
-
function
|
|
197
|
+
function co(o) {
|
|
200
198
|
try {
|
|
201
|
-
return
|
|
199
|
+
return O(o, ""), !0;
|
|
202
200
|
} catch {
|
|
203
201
|
return !1;
|
|
204
202
|
}
|
|
205
203
|
}
|
|
206
|
-
const
|
|
204
|
+
const Ze = w(["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"]), oe = w(["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"]), ie = w(["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"]), uo = w(["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"]), re = w(["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"]), fo = w(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Je = w(["#text"]), Qe = w(["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"]), se = w(["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"]), tn = w(["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"]), vt = w(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), po = R(/{{[\w\W]*|^[\w\W]*}}/g), mo = R(/<%[\w\W]*|^[\w\W]*%>/g), ho = R(/\${[\w\W]*/g), _o = R(/^data-[\-\w.\u00B7-\uFFFF]+$/), To = R(/^aria-[\-\w]+$/), en = R(
|
|
207
205
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
208
206
|
// eslint-disable-line no-useless-escape
|
|
209
|
-
),
|
|
207
|
+
), go = R(/^(?:\w+script|data):/i), yo = R(
|
|
210
208
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
211
209
|
// eslint-disable-line no-control-regex
|
|
212
|
-
),
|
|
210
|
+
), Eo = R(/^html$/i), Ao = R(/^[a-z][.\w]*(-[.\w]+)+$/i), nn = R(/<[/\w!]/g), So = R(/<[/\w]/g), bo = R(/<\/no(script|embed|frames)/i), Oo = R(/\/>/i), k = {
|
|
213
211
|
element: 1,
|
|
214
212
|
attribute: 2,
|
|
215
213
|
text: 3,
|
|
@@ -225,28 +223,28 @@ const Ve = O(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
225
223
|
documentFragment: 11,
|
|
226
224
|
notation: 12
|
|
227
225
|
// Deprecated
|
|
228
|
-
},
|
|
226
|
+
}, wo = function() {
|
|
229
227
|
return typeof window > "u" ? null : window;
|
|
230
|
-
},
|
|
228
|
+
}, Ro = function(n, s) {
|
|
231
229
|
if (typeof n != "object" || typeof n.createPolicy != "function")
|
|
232
230
|
return null;
|
|
233
|
-
let
|
|
234
|
-
const
|
|
235
|
-
s && s.hasAttribute(
|
|
236
|
-
const m = "dompurify" + (
|
|
231
|
+
let l = null;
|
|
232
|
+
const c = "data-tt-policy-suffix";
|
|
233
|
+
s && s.hasAttribute(c) && (l = s.getAttribute(c));
|
|
234
|
+
const m = "dompurify" + (l ? "#" + l : "");
|
|
237
235
|
try {
|
|
238
236
|
return n.createPolicy(m, {
|
|
239
|
-
createHTML(
|
|
240
|
-
return
|
|
237
|
+
createHTML(A) {
|
|
238
|
+
return A;
|
|
241
239
|
},
|
|
242
|
-
createScriptURL(
|
|
243
|
-
return
|
|
240
|
+
createScriptURL(A) {
|
|
241
|
+
return A;
|
|
244
242
|
}
|
|
245
243
|
});
|
|
246
244
|
} catch {
|
|
247
245
|
return console.warn("TrustedTypes policy " + m + " could not be created."), null;
|
|
248
246
|
}
|
|
249
|
-
},
|
|
247
|
+
}, on = function() {
|
|
250
248
|
return {
|
|
251
249
|
afterSanitizeAttributes: [],
|
|
252
250
|
afterSanitizeElements: [],
|
|
@@ -258,53 +256,53 @@ const Ve = O(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
258
256
|
uponSanitizeElement: [],
|
|
259
257
|
uponSanitizeShadowNode: []
|
|
260
258
|
};
|
|
261
|
-
}, Y = function(n, s,
|
|
262
|
-
return b(n, s) && j(n[s]) ? f(
|
|
259
|
+
}, Y = function(n, s, l, c) {
|
|
260
|
+
return b(n, s) && j(n[s]) ? f(c.base ? N(c.base) : {}, n[s], c.transform) : l;
|
|
263
261
|
};
|
|
264
|
-
function
|
|
265
|
-
let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
266
|
-
const n = (r) =>
|
|
262
|
+
function ln() {
|
|
263
|
+
let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : wo();
|
|
264
|
+
const n = (r) => ln(r);
|
|
267
265
|
if (n.version = "3.4.11", n.removed = [], !o || !o.document || o.document.nodeType !== k.document || !o.Element)
|
|
268
266
|
return n.isSupported = !1, n;
|
|
269
267
|
let s = o.document;
|
|
270
|
-
const
|
|
268
|
+
const l = s, c = l.currentScript;
|
|
271
269
|
o.DocumentFragment;
|
|
272
|
-
const m = o.HTMLTemplateElement,
|
|
270
|
+
const m = o.HTMLTemplateElement, A = o.Node, ct = o.Element, D = o.NodeFilter, ut = o.NamedNodeMap;
|
|
273
271
|
ut === void 0 && (o.NamedNodeMap || o.MozNamedAttrMap), o.HTMLFormElement;
|
|
274
|
-
const
|
|
272
|
+
const Pt = o.DOMParser, Ot = o.trustedTypes, V = ct.prototype, un = z(V, "cloneNode"), ue = z(V, "remove"), fn = z(V, "nextSibling"), ft = z(V, "childNodes"), pt = z(V, "parentNode"), fe = z(V, "shadowRoot"), xt = z(V, "attributes"), C = A && A.prototype ? z(A.prototype, "nodeType") : null, H = A && A.prototype ? z(A.prototype, "nodeName") : null;
|
|
275
273
|
if (typeof m == "function") {
|
|
276
274
|
const r = s.createElement("template");
|
|
277
275
|
r.content && r.content.ownerDocument && (s = r.content.ownerDocument);
|
|
278
276
|
}
|
|
279
|
-
let L, q = "", kt,
|
|
280
|
-
const
|
|
277
|
+
let L, q = "", kt, pe = !1, mt = 0;
|
|
278
|
+
const me = function() {
|
|
281
279
|
if (mt > 0)
|
|
282
280
|
throw J('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.');
|
|
283
281
|
}, tt = function(t) {
|
|
284
|
-
|
|
282
|
+
me(), mt++;
|
|
285
283
|
try {
|
|
286
284
|
return L.createHTML(t);
|
|
287
285
|
} finally {
|
|
288
286
|
mt--;
|
|
289
287
|
}
|
|
290
|
-
},
|
|
291
|
-
|
|
288
|
+
}, pn = function(t) {
|
|
289
|
+
me(), mt++;
|
|
292
290
|
try {
|
|
293
291
|
return L.createScriptURL(t);
|
|
294
292
|
} finally {
|
|
295
293
|
mt--;
|
|
296
294
|
}
|
|
297
|
-
},
|
|
298
|
-
return
|
|
299
|
-
},
|
|
300
|
-
let g =
|
|
301
|
-
n.isSupported = typeof
|
|
302
|
-
const
|
|
303
|
-
let
|
|
304
|
-
const
|
|
305
|
-
let
|
|
306
|
-
const
|
|
307
|
-
let
|
|
295
|
+
}, mn = function() {
|
|
296
|
+
return pe || (kt = Ro(Ot, c), pe = !0), kt;
|
|
297
|
+
}, wt = s, zt = wt.implementation, de = wt.createNodeIterator, dn = wt.createDocumentFragment, hn = wt.getElementsByTagName, _n = l.importNode;
|
|
298
|
+
let g = on();
|
|
299
|
+
n.isSupported = typeof sn == "function" && typeof pt == "function" && zt && zt.createHTMLDocument !== void 0;
|
|
300
|
+
const Tn = po, gn = mo, yn = ho, En = _o, An = To, Sn = go, he = yo, bn = Ao;
|
|
301
|
+
let _e = en, d = null;
|
|
302
|
+
const Te = f({}, [...Ze, ...oe, ...ie, ...re, ...Je]);
|
|
303
|
+
let h = null;
|
|
304
|
+
const ge = f({}, [...Qe, ...se, ...tn, ...vt]);
|
|
305
|
+
let _ = Object.seal(at(null, {
|
|
308
306
|
tagNameCheck: {
|
|
309
307
|
writable: !0,
|
|
310
308
|
configurable: !1,
|
|
@@ -323,7 +321,7 @@ function on() {
|
|
|
323
321
|
enumerable: !0,
|
|
324
322
|
value: !1
|
|
325
323
|
}
|
|
326
|
-
})), dt = null,
|
|
324
|
+
})), dt = null, ye = null;
|
|
327
325
|
const G = Object.seal(at(null, {
|
|
328
326
|
tagCheck: {
|
|
329
327
|
writable: !0,
|
|
@@ -338,9 +336,9 @@ function on() {
|
|
|
338
336
|
value: null
|
|
339
337
|
}
|
|
340
338
|
}));
|
|
341
|
-
let
|
|
342
|
-
const
|
|
343
|
-
let Wt = !0, Yt = !1, nt = {},
|
|
339
|
+
let Ee = !0, Ft = !0, Ae = !1, Se = !0, B = !1, ht = !0, K = !1, Ut = !1, Ht = null, Gt = null, Bt = !1, et = !1, Rt = !1, It = !1, be = !0, Oe = !1;
|
|
340
|
+
const we = "user-content-";
|
|
341
|
+
let Wt = !0, Yt = !1, nt = {}, P = null;
|
|
344
342
|
const jt = f({}, [
|
|
345
343
|
"annotation-xml",
|
|
346
344
|
"audio",
|
|
@@ -378,47 +376,47 @@ function on() {
|
|
|
378
376
|
"video",
|
|
379
377
|
"xmp"
|
|
380
378
|
]);
|
|
381
|
-
let
|
|
382
|
-
const
|
|
379
|
+
let Re = null;
|
|
380
|
+
const Ie = f({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
383
381
|
let $t = null;
|
|
384
|
-
const
|
|
385
|
-
let ot =
|
|
386
|
-
const
|
|
387
|
-
let qt = f({},
|
|
388
|
-
const
|
|
389
|
-
let Kt = f({},
|
|
390
|
-
const
|
|
382
|
+
const Ne = f({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Nt = "http://www.w3.org/1998/Math/MathML", Lt = "http://www.w3.org/2000/svg", x = "http://www.w3.org/1999/xhtml";
|
|
383
|
+
let ot = x, Xt = !1, Vt = null;
|
|
384
|
+
const On = f({}, [Nt, Lt, x], ne), Le = w(["mi", "mo", "mn", "ms", "mtext"]);
|
|
385
|
+
let qt = f({}, Le);
|
|
386
|
+
const De = w(["annotation-xml"]);
|
|
387
|
+
let Kt = f({}, De);
|
|
388
|
+
const wn = f({}, ["title", "style", "font", "a", "script"]);
|
|
391
389
|
let _t = null;
|
|
392
|
-
const
|
|
393
|
-
let
|
|
394
|
-
const
|
|
390
|
+
const Rn = ["application/xhtml+xml", "text/html"], In = "text/html";
|
|
391
|
+
let T = null, it = null;
|
|
392
|
+
const Nn = s.createElement("form"), Ce = function(t) {
|
|
395
393
|
return t instanceof RegExp || t instanceof Function;
|
|
396
394
|
}, Zt = function() {
|
|
397
395
|
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
398
396
|
if (it && it === t)
|
|
399
397
|
return;
|
|
400
398
|
(!t || typeof t != "object") && (t = {}), t = N(t), _t = // eslint-disable-next-line unicorn/prefer-includes
|
|
401
|
-
|
|
402
|
-
transform:
|
|
403
|
-
}),
|
|
404
|
-
transform:
|
|
405
|
-
}), Vt = Y(t, "ALLOWED_NAMESPACES",
|
|
406
|
-
transform:
|
|
407
|
-
}), $t = Y(t, "ADD_URI_SAFE_ATTR",
|
|
408
|
-
transform:
|
|
409
|
-
base:
|
|
410
|
-
}),
|
|
411
|
-
transform:
|
|
412
|
-
base:
|
|
413
|
-
}),
|
|
414
|
-
transform:
|
|
399
|
+
Rn.indexOf(t.PARSER_MEDIA_TYPE) === -1 ? In : t.PARSER_MEDIA_TYPE, T = _t === "application/xhtml+xml" ? ne : At, d = Y(t, "ALLOWED_TAGS", Te, {
|
|
400
|
+
transform: T
|
|
401
|
+
}), h = Y(t, "ALLOWED_ATTR", ge, {
|
|
402
|
+
transform: T
|
|
403
|
+
}), Vt = Y(t, "ALLOWED_NAMESPACES", On, {
|
|
404
|
+
transform: ne
|
|
405
|
+
}), $t = Y(t, "ADD_URI_SAFE_ATTR", Ne, {
|
|
406
|
+
transform: T,
|
|
407
|
+
base: Ne
|
|
408
|
+
}), Re = Y(t, "ADD_DATA_URI_TAGS", Ie, {
|
|
409
|
+
transform: T,
|
|
410
|
+
base: Ie
|
|
411
|
+
}), P = Y(t, "FORBID_CONTENTS", jt, {
|
|
412
|
+
transform: T
|
|
415
413
|
}), dt = Y(t, "FORBID_TAGS", N({}), {
|
|
416
|
-
transform:
|
|
417
|
-
}),
|
|
418
|
-
transform:
|
|
419
|
-
}), nt = b(t, "USE_PROFILES") ? t.USE_PROFILES && typeof t.USE_PROFILES == "object" ? N(t.USE_PROFILES) : t.USE_PROFILES : !1,
|
|
414
|
+
transform: T
|
|
415
|
+
}), ye = Y(t, "FORBID_ATTR", N({}), {
|
|
416
|
+
transform: T
|
|
417
|
+
}), nt = b(t, "USE_PROFILES") ? t.USE_PROFILES && typeof t.USE_PROFILES == "object" ? N(t.USE_PROFILES) : t.USE_PROFILES : !1, Ee = t.ALLOW_ARIA_ATTR !== !1, Ft = t.ALLOW_DATA_ATTR !== !1, Ae = t.ALLOW_UNKNOWN_PROTOCOLS || !1, Se = t.ALLOW_SELF_CLOSE_IN_ATTR !== !1, B = t.SAFE_FOR_TEMPLATES || !1, ht = t.SAFE_FOR_XML !== !1, K = t.WHOLE_DOCUMENT || !1, et = t.RETURN_DOM || !1, Rt = t.RETURN_DOM_FRAGMENT || !1, It = t.RETURN_TRUSTED_TYPE || !1, Bt = t.FORCE_BODY || !1, be = t.SANITIZE_DOM !== !1, Oe = t.SANITIZE_NAMED_PROPS || !1, Wt = t.KEEP_CONTENT !== !1, Yt = t.IN_PLACE || !1, _e = co(t.ALLOWED_URI_REGEXP) ? t.ALLOWED_URI_REGEXP : en, ot = typeof t.NAMESPACE == "string" ? t.NAMESPACE : x, qt = b(t, "MATHML_TEXT_INTEGRATION_POINTS") && t.MATHML_TEXT_INTEGRATION_POINTS && typeof t.MATHML_TEXT_INTEGRATION_POINTS == "object" ? N(t.MATHML_TEXT_INTEGRATION_POINTS) : f({}, Le), Kt = b(t, "HTML_INTEGRATION_POINTS") && t.HTML_INTEGRATION_POINTS && typeof t.HTML_INTEGRATION_POINTS == "object" ? N(t.HTML_INTEGRATION_POINTS) : f({}, De);
|
|
420
418
|
const e = b(t, "CUSTOM_ELEMENT_HANDLING") && t.CUSTOM_ELEMENT_HANDLING && typeof t.CUSTOM_ELEMENT_HANDLING == "object" ? N(t.CUSTOM_ELEMENT_HANDLING) : at(null);
|
|
421
|
-
if (
|
|
419
|
+
if (_ = at(null), b(e, "tagNameCheck") && Ce(e.tagNameCheck) && (_.tagNameCheck = e.tagNameCheck), b(e, "attributeNameCheck") && Ce(e.attributeNameCheck) && (_.attributeNameCheck = e.attributeNameCheck), b(e, "allowCustomizedBuiltInElements") && typeof e.allowCustomizedBuiltInElements == "boolean" && (_.allowCustomizedBuiltInElements = e.allowCustomizedBuiltInElements), R(_), B && (Ft = !1), Rt && (et = !0), nt && (d = f({}, Je), h = at(null), nt.html === !0 && (f(d, Ze), f(h, Qe)), nt.svg === !0 && (f(d, oe), f(h, se), f(h, vt)), nt.svgFilters === !0 && (f(d, ie), f(h, se), f(h, vt)), nt.mathMl === !0 && (f(d, re), f(h, tn), f(h, vt))), G.tagCheck = null, G.attributeCheck = null, b(t, "ADD_TAGS") && (typeof t.ADD_TAGS == "function" ? G.tagCheck = t.ADD_TAGS : j(t.ADD_TAGS) && (d === Te && (d = N(d)), f(d, t.ADD_TAGS, T))), b(t, "ADD_ATTR") && (typeof t.ADD_ATTR == "function" ? G.attributeCheck = t.ADD_ATTR : j(t.ADD_ATTR) && (h === ge && (h = N(h)), f(h, t.ADD_ATTR, T))), b(t, "ADD_URI_SAFE_ATTR") && j(t.ADD_URI_SAFE_ATTR) && f($t, t.ADD_URI_SAFE_ATTR, T), b(t, "FORBID_CONTENTS") && j(t.FORBID_CONTENTS) && (P === jt && (P = N(P)), f(P, t.FORBID_CONTENTS, T)), b(t, "ADD_FORBID_CONTENTS") && j(t.ADD_FORBID_CONTENTS) && (P === jt && (P = N(P)), f(P, t.ADD_FORBID_CONTENTS, T)), Wt && (d["#text"] = !0), K && f(d, ["html", "head", "body"]), d.table && (f(d, ["tbody"]), delete dt.tbody), t.TRUSTED_TYPES_POLICY) {
|
|
422
420
|
if (typeof t.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
423
421
|
throw J('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
424
422
|
if (typeof t.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
@@ -430,22 +428,22 @@ function on() {
|
|
|
430
428
|
} catch (a) {
|
|
431
429
|
throw L = i, a;
|
|
432
430
|
}
|
|
433
|
-
} else t.TRUSTED_TYPES_POLICY === null ? (L = void 0, q = "") : (L === void 0 && (L =
|
|
434
|
-
|
|
435
|
-
},
|
|
436
|
-
return e.namespaceURI ===
|
|
437
|
-
},
|
|
438
|
-
return e.namespaceURI ===
|
|
439
|
-
},
|
|
440
|
-
return e.namespaceURI === Lt && !Kt[i] || e.namespaceURI === Nt && !qt[i] ? !1 : !
|
|
441
|
-
},
|
|
431
|
+
} else t.TRUSTED_TYPES_POLICY === null ? (L = void 0, q = "") : (L === void 0 && (L = mn()), L && typeof q == "string" && (q = tt("")));
|
|
432
|
+
w && w(t), it = t;
|
|
433
|
+
}, Me = f({}, [...oe, ...ie, ...uo]), ve = f({}, [...re, ...fo]), Ln = function(t, e, i) {
|
|
434
|
+
return e.namespaceURI === x ? t === "svg" : e.namespaceURI === Nt ? t === "svg" && (i === "annotation-xml" || qt[i]) : !!Me[t];
|
|
435
|
+
}, Dn = function(t, e, i) {
|
|
436
|
+
return e.namespaceURI === x ? t === "math" : e.namespaceURI === Lt ? t === "math" && Kt[i] : !!ve[t];
|
|
437
|
+
}, Cn = function(t, e, i) {
|
|
438
|
+
return e.namespaceURI === Lt && !Kt[i] || e.namespaceURI === Nt && !qt[i] ? !1 : !ve[t] && (wn[t] || !Me[t]);
|
|
439
|
+
}, Mn = function(t) {
|
|
442
440
|
let e = pt(t);
|
|
443
441
|
(!e || !e.tagName) && (e = {
|
|
444
442
|
namespaceURI: ot,
|
|
445
443
|
tagName: "template"
|
|
446
444
|
});
|
|
447
445
|
const i = At(t.tagName), a = At(e.tagName);
|
|
448
|
-
return Vt[t.namespaceURI] ? t.namespaceURI === Lt ?
|
|
446
|
+
return Vt[t.namespaceURI] ? t.namespaceURI === Lt ? Ln(i, e, a) : t.namespaceURI === Nt ? Dn(i, e, a) : t.namespaceURI === x ? Cn(i, e, a) : !!(_t === "application/xhtml+xml" && Vt[t.namespaceURI]) : !1;
|
|
449
447
|
}, W = function(t) {
|
|
450
448
|
st(n.removed, {
|
|
451
449
|
element: t
|
|
@@ -453,23 +451,23 @@ function on() {
|
|
|
453
451
|
try {
|
|
454
452
|
pt(t).removeChild(t);
|
|
455
453
|
} catch {
|
|
456
|
-
if (
|
|
454
|
+
if (ue(t), !pt(t))
|
|
457
455
|
throw J("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
458
456
|
}
|
|
459
|
-
},
|
|
457
|
+
}, Pe = function(t) {
|
|
460
458
|
const e = ft(t);
|
|
461
459
|
if (e) {
|
|
462
460
|
const a = [];
|
|
463
|
-
|
|
461
|
+
gt(e, (u) => {
|
|
464
462
|
st(a, u);
|
|
465
|
-
}),
|
|
463
|
+
}), gt(a, (u) => {
|
|
466
464
|
try {
|
|
467
|
-
|
|
465
|
+
ue(u);
|
|
468
466
|
} catch {
|
|
469
467
|
}
|
|
470
468
|
});
|
|
471
469
|
}
|
|
472
|
-
const i =
|
|
470
|
+
const i = xt(t);
|
|
473
471
|
if (i)
|
|
474
472
|
for (let a = i.length - 1; a >= 0; --a) {
|
|
475
473
|
const u = i[a], p = u && u.name;
|
|
@@ -502,40 +500,40 @@ function on() {
|
|
|
502
500
|
e.setAttribute(t, "");
|
|
503
501
|
} catch {
|
|
504
502
|
}
|
|
505
|
-
},
|
|
506
|
-
const e =
|
|
503
|
+
}, vn = function(t) {
|
|
504
|
+
const e = xt(t);
|
|
507
505
|
if (e)
|
|
508
506
|
for (let i = e.length - 1; i >= 0; --i) {
|
|
509
507
|
const a = e[i], u = a && a.name;
|
|
510
|
-
if (!(typeof u != "string" ||
|
|
508
|
+
if (!(typeof u != "string" || h[T(u)]))
|
|
511
509
|
try {
|
|
512
510
|
t.removeAttribute(u);
|
|
513
511
|
} catch {
|
|
514
512
|
}
|
|
515
513
|
}
|
|
516
|
-
},
|
|
514
|
+
}, Pn = function(t) {
|
|
517
515
|
const e = [t];
|
|
518
516
|
for (; e.length > 0; ) {
|
|
519
517
|
const i = e.pop();
|
|
520
|
-
(C ? C(i) : i.nodeType) === k.element &&
|
|
518
|
+
(C ? C(i) : i.nodeType) === k.element && vn(i);
|
|
521
519
|
const u = ft(i);
|
|
522
520
|
if (u)
|
|
523
521
|
for (let p = u.length - 1; p >= 0; --p)
|
|
524
522
|
e.push(u[p]);
|
|
525
523
|
}
|
|
526
|
-
},
|
|
524
|
+
}, xe = function(t) {
|
|
527
525
|
let e = null, i = null;
|
|
528
526
|
if (Bt)
|
|
529
527
|
t = "<remove></remove>" + t;
|
|
530
528
|
else {
|
|
531
|
-
const p =
|
|
529
|
+
const p = Xe(t, /^[\r\n\t ]+/);
|
|
532
530
|
i = p && p[0];
|
|
533
531
|
}
|
|
534
|
-
_t === "application/xhtml+xml" && ot ===
|
|
532
|
+
_t === "application/xhtml+xml" && ot === x && (t = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + t + "</body></html>");
|
|
535
533
|
const a = L ? tt(t) : t;
|
|
536
|
-
if (ot ===
|
|
534
|
+
if (ot === x)
|
|
537
535
|
try {
|
|
538
|
-
e = new
|
|
536
|
+
e = new Pt().parseFromString(a, _t);
|
|
539
537
|
} catch {
|
|
540
538
|
}
|
|
541
539
|
if (!e || !e.documentElement) {
|
|
@@ -546,9 +544,9 @@ function on() {
|
|
|
546
544
|
}
|
|
547
545
|
}
|
|
548
546
|
const u = e.body || e.documentElement;
|
|
549
|
-
return t && i && u.insertBefore(s.createTextNode(i), u.childNodes[0] || null), ot ===
|
|
550
|
-
},
|
|
551
|
-
return
|
|
547
|
+
return t && i && u.insertBefore(s.createTextNode(i), u.childNodes[0] || null), ot === x ? hn.call(e, K ? "html" : "body")[0] : K ? e.documentElement : u;
|
|
548
|
+
}, ke = function(t) {
|
|
549
|
+
return de.call(
|
|
552
550
|
t.ownerDocument || t,
|
|
553
551
|
t,
|
|
554
552
|
// eslint-disable-next-line no-bitwise
|
|
@@ -556,11 +554,11 @@ function on() {
|
|
|
556
554
|
null
|
|
557
555
|
);
|
|
558
556
|
}, Dt = function(t) {
|
|
559
|
-
return t =
|
|
557
|
+
return t = yt(t, Tn, " "), t = yt(t, gn, " "), t = yt(t, yn, " "), t;
|
|
560
558
|
}, Jt = function(t) {
|
|
561
559
|
var e;
|
|
562
560
|
t.normalize();
|
|
563
|
-
const i =
|
|
561
|
+
const i = de.call(
|
|
564
562
|
t.ownerDocument || t,
|
|
565
563
|
t,
|
|
566
564
|
// eslint-disable-next-line no-bitwise
|
|
@@ -571,17 +569,17 @@ function on() {
|
|
|
571
569
|
for (; a; )
|
|
572
570
|
a.data = Dt(a.data), a = i.nextNode();
|
|
573
571
|
const u = (e = t.querySelectorAll) === null || e === void 0 ? void 0 : e.call(t, "template");
|
|
574
|
-
u &&
|
|
572
|
+
u && gt(u, (p) => {
|
|
575
573
|
rt(p.content) && Jt(p.content);
|
|
576
574
|
});
|
|
577
575
|
}, Ct = function(t) {
|
|
578
576
|
const e = H ? H(t) : null;
|
|
579
|
-
return typeof e != "string" ||
|
|
577
|
+
return typeof e != "string" || T(e) !== "form" ? !1 : typeof t.nodeName != "string" || typeof t.textContent != "string" || typeof t.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
|
|
580
578
|
// prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
|
|
581
579
|
// makes the direct read diverge from the cached read; a clean form
|
|
582
580
|
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
583
581
|
// canonical NamedNodeMap.
|
|
584
|
-
t.attributes !==
|
|
582
|
+
t.attributes !== xt(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
|
|
585
583
|
// returns the integer 1 for any Element regardless of realm; direct
|
|
586
584
|
// read on a clobbered form (e.g. <input name="nodeType">) returns
|
|
587
585
|
// the named child element. Cheap addition — nodeType is read from
|
|
@@ -617,39 +615,39 @@ function on() {
|
|
|
617
615
|
return !1;
|
|
618
616
|
}
|
|
619
617
|
};
|
|
620
|
-
function
|
|
621
|
-
r.length !== 0 &&
|
|
618
|
+
function F(r, t, e) {
|
|
619
|
+
r.length !== 0 && gt(r, (i) => {
|
|
622
620
|
i.call(n, t, e, it);
|
|
623
621
|
});
|
|
624
622
|
}
|
|
625
|
-
const
|
|
626
|
-
return !!(ht && t.hasChildNodes() && !Tt(t.firstElementChild) &&
|
|
627
|
-
},
|
|
628
|
-
if (!dt[e] &&
|
|
623
|
+
const xn = function(t, e) {
|
|
624
|
+
return !!(ht && t.hasChildNodes() && !Tt(t.firstElementChild) && O(nn, t.textContent) && O(nn, t.innerHTML) || ht && t.namespaceURI === x && e === "style" && Tt(t.firstElementChild) || t.nodeType === k.processingInstruction || ht && t.nodeType === k.comment && O(So, t.data));
|
|
625
|
+
}, kn = function(t, e) {
|
|
626
|
+
if (!dt[e] && Ue(e) && (_.tagNameCheck instanceof RegExp && O(_.tagNameCheck, e) || _.tagNameCheck instanceof Function && _.tagNameCheck(e)))
|
|
629
627
|
return !1;
|
|
630
|
-
if (Wt && !
|
|
628
|
+
if (Wt && !P[e]) {
|
|
631
629
|
const i = pt(t), a = ft(t);
|
|
632
630
|
if (a && i) {
|
|
633
631
|
const u = a.length;
|
|
634
632
|
for (let p = u - 1; p >= 0; --p) {
|
|
635
|
-
const S = Yt ? a[p] :
|
|
636
|
-
i.insertBefore(S,
|
|
633
|
+
const S = Yt ? a[p] : un(a[p], !0);
|
|
634
|
+
i.insertBefore(S, fn(t));
|
|
637
635
|
}
|
|
638
636
|
}
|
|
639
637
|
}
|
|
640
638
|
return W(t), !0;
|
|
641
|
-
},
|
|
642
|
-
if (
|
|
639
|
+
}, ze = function(t) {
|
|
640
|
+
if (F(g.beforeSanitizeElements, t, null), Ct(t))
|
|
643
641
|
return W(t), !0;
|
|
644
|
-
const e =
|
|
645
|
-
if (
|
|
642
|
+
const e = T(H ? H(t) : t.nodeName);
|
|
643
|
+
if (F(g.uponSanitizeElement, t, {
|
|
646
644
|
tagName: e,
|
|
647
|
-
allowedTags:
|
|
648
|
-
}),
|
|
645
|
+
allowedTags: d
|
|
646
|
+
}), xn(t, e))
|
|
649
647
|
return W(t), !0;
|
|
650
|
-
if (dt[e] || !(G.tagCheck instanceof Function && G.tagCheck(e)) && !
|
|
651
|
-
return
|
|
652
|
-
if ((C ? C(t) : t.nodeType) === k.element && !
|
|
648
|
+
if (dt[e] || !(G.tagCheck instanceof Function && G.tagCheck(e)) && !d[e])
|
|
649
|
+
return kn(t, e);
|
|
650
|
+
if ((C ? C(t) : t.nodeType) === k.element && !Mn(t) || (e === "noscript" || e === "noembed" || e === "noframes") && O(bo, t.innerHTML))
|
|
653
651
|
return W(t), !0;
|
|
654
652
|
if (B && t.nodeType === k.text) {
|
|
655
653
|
const a = Dt(t.textContent);
|
|
@@ -657,18 +655,18 @@ function on() {
|
|
|
657
655
|
element: t.cloneNode()
|
|
658
656
|
}), t.textContent = a);
|
|
659
657
|
}
|
|
660
|
-
return
|
|
661
|
-
},
|
|
662
|
-
if (
|
|
658
|
+
return F(g.afterSanitizeElements, t, null), !1;
|
|
659
|
+
}, Fe = function(t, e, i) {
|
|
660
|
+
if (ye[e] || be && (e === "id" || e === "name") && (i in s || i in Nn))
|
|
663
661
|
return !1;
|
|
664
|
-
const a =
|
|
665
|
-
if (!(
|
|
666
|
-
if (!(
|
|
662
|
+
const a = h[e] || G.attributeCheck instanceof Function && G.attributeCheck(e, t);
|
|
663
|
+
if (!(Ft && O(En, e))) {
|
|
664
|
+
if (!(Ee && O(An, e))) {
|
|
667
665
|
if (a) {
|
|
668
666
|
if (!$t[e]) {
|
|
669
|
-
if (!
|
|
670
|
-
if (!((e === "src" || e === "xlink:href" || e === "href") && t !== "script" &&
|
|
671
|
-
if (!(
|
|
667
|
+
if (!O(_e, yt(i, he, ""))) {
|
|
668
|
+
if (!((e === "src" || e === "xlink:href" || e === "href") && t !== "script" && Ve(i, "data:") === 0 && Re[t])) {
|
|
669
|
+
if (!(Ae && !O(Sn, yt(i, he, "")))) {
|
|
672
670
|
if (i)
|
|
673
671
|
return !1;
|
|
674
672
|
}
|
|
@@ -679,32 +677,32 @@ function on() {
|
|
|
679
677
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
680
678
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
681
679
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
682
|
-
!(
|
|
680
|
+
!(Ue(t) && (_.tagNameCheck instanceof RegExp && O(_.tagNameCheck, t) || _.tagNameCheck instanceof Function && _.tagNameCheck(t)) && (_.attributeNameCheck instanceof RegExp && O(_.attributeNameCheck, e) || _.attributeNameCheck instanceof Function && _.attributeNameCheck(e, t)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
683
681
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
684
|
-
e === "is" &&
|
|
682
|
+
e === "is" && _.allowCustomizedBuiltInElements && (_.tagNameCheck instanceof RegExp && O(_.tagNameCheck, i) || _.tagNameCheck instanceof Function && _.tagNameCheck(i)))
|
|
685
683
|
) return !1;
|
|
686
684
|
}
|
|
687
685
|
}
|
|
688
686
|
return !0;
|
|
689
|
-
},
|
|
690
|
-
return !
|
|
691
|
-
},
|
|
692
|
-
if (L && typeof
|
|
693
|
-
switch (
|
|
687
|
+
}, zn = f({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), Ue = function(t) {
|
|
688
|
+
return !zn[At(t)] && O(bn, t);
|
|
689
|
+
}, Fn = function(t, e, i, a) {
|
|
690
|
+
if (L && typeof Ot == "object" && typeof Ot.getAttributeType == "function" && !i)
|
|
691
|
+
switch (Ot.getAttributeType(t, e)) {
|
|
694
692
|
case "TrustedHTML":
|
|
695
693
|
return tt(a);
|
|
696
694
|
case "TrustedScriptURL":
|
|
697
|
-
return
|
|
695
|
+
return pn(a);
|
|
698
696
|
}
|
|
699
697
|
return a;
|
|
700
|
-
},
|
|
698
|
+
}, Un = function(t, e, i, a) {
|
|
701
699
|
try {
|
|
702
|
-
i ? t.setAttributeNS(i, e, a) : t.setAttribute(e, a), Ct(t) ? W(t) :
|
|
700
|
+
i ? t.setAttributeNS(i, e, a) : t.setAttribute(e, a), Ct(t) ? W(t) : $e(n.removed);
|
|
703
701
|
} catch {
|
|
704
702
|
Z(e, t);
|
|
705
703
|
}
|
|
706
|
-
},
|
|
707
|
-
|
|
704
|
+
}, He = function(t) {
|
|
705
|
+
F(g.beforeSanitizeAttributes, t, null);
|
|
708
706
|
const e = t.attributes;
|
|
709
707
|
if (!e || Ct(t))
|
|
710
708
|
return;
|
|
@@ -712,19 +710,19 @@ function on() {
|
|
|
712
710
|
attrName: "",
|
|
713
711
|
attrValue: "",
|
|
714
712
|
keepAttr: !0,
|
|
715
|
-
allowedAttributes:
|
|
713
|
+
allowedAttributes: h,
|
|
716
714
|
forceKeepAttr: void 0
|
|
717
715
|
};
|
|
718
716
|
let a = e.length;
|
|
719
|
-
const u =
|
|
717
|
+
const u = T(t.nodeName);
|
|
720
718
|
for (; a--; ) {
|
|
721
|
-
const p = e[a], S = p.name,
|
|
722
|
-
let I = S === "value" ? te :
|
|
723
|
-
if (i.attrName = v, i.attrValue = I, i.keepAttr = !0, i.forceKeepAttr = void 0,
|
|
719
|
+
const p = e[a], S = p.name, y = p.namespaceURI, M = p.value, v = T(S), te = M;
|
|
720
|
+
let I = S === "value" ? te : oo(te);
|
|
721
|
+
if (i.attrName = v, i.attrValue = I, i.keepAttr = !0, i.forceKeepAttr = void 0, F(g.uponSanitizeAttribute, t, i), I = i.attrValue, Oe && (v === "id" || v === "name") && Ve(I, we) !== 0 && (Z(S, t), I = we + I), ht && O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, I)) {
|
|
724
722
|
Z(S, t);
|
|
725
723
|
continue;
|
|
726
724
|
}
|
|
727
|
-
if (v === "attributename" &&
|
|
725
|
+
if (v === "attributename" && Xe(I, "href")) {
|
|
728
726
|
Z(S, t);
|
|
729
727
|
continue;
|
|
730
728
|
}
|
|
@@ -733,27 +731,27 @@ function on() {
|
|
|
733
731
|
Z(S, t);
|
|
734
732
|
continue;
|
|
735
733
|
}
|
|
736
|
-
if (!
|
|
734
|
+
if (!Se && O(Oo, I)) {
|
|
737
735
|
Z(S, t);
|
|
738
736
|
continue;
|
|
739
737
|
}
|
|
740
|
-
if (B && (I = Dt(I)), !
|
|
738
|
+
if (B && (I = Dt(I)), !Fe(u, v, I)) {
|
|
741
739
|
Z(S, t);
|
|
742
740
|
continue;
|
|
743
741
|
}
|
|
744
|
-
I =
|
|
742
|
+
I = Fn(u, v, y, I), I !== te && Un(t, S, y, I);
|
|
745
743
|
}
|
|
746
744
|
}
|
|
747
|
-
|
|
745
|
+
F(g.afterSanitizeAttributes, t, null);
|
|
748
746
|
}, Mt = function(t) {
|
|
749
747
|
let e = null;
|
|
750
|
-
const i =
|
|
751
|
-
for (
|
|
752
|
-
if (
|
|
753
|
-
const u =
|
|
748
|
+
const i = ke(t);
|
|
749
|
+
for (F(g.beforeSanitizeShadowDOM, t, null); e = i.nextNode(); )
|
|
750
|
+
if (F(g.uponSanitizeShadowNode, e, null), ze(e), He(e), rt(e.content) && Mt(e.content), (C ? C(e) : e.nodeType) === k.element) {
|
|
751
|
+
const u = fe(e);
|
|
754
752
|
rt(u) && (Qt(u), Mt(u));
|
|
755
753
|
}
|
|
756
|
-
|
|
754
|
+
F(g.afterSanitizeShadowDOM, t, null);
|
|
757
755
|
}, Qt = function(t) {
|
|
758
756
|
const e = [{
|
|
759
757
|
node: t,
|
|
@@ -767,14 +765,14 @@ function on() {
|
|
|
767
765
|
}
|
|
768
766
|
const a = i.node, p = (C ? C(a) : a.nodeType) === k.element, S = ft(a);
|
|
769
767
|
if (S)
|
|
770
|
-
for (let
|
|
768
|
+
for (let y = S.length - 1; y >= 0; --y)
|
|
771
769
|
e.push({
|
|
772
|
-
node: S[
|
|
770
|
+
node: S[y],
|
|
773
771
|
shadow: null
|
|
774
772
|
});
|
|
775
773
|
if (p) {
|
|
776
|
-
const
|
|
777
|
-
if (typeof
|
|
774
|
+
const y = H ? H(a) : null;
|
|
775
|
+
if (typeof y == "string" && T(y) === "template") {
|
|
778
776
|
const M = a.content;
|
|
779
777
|
rt(M) && e.push({
|
|
780
778
|
node: M,
|
|
@@ -783,12 +781,12 @@ function on() {
|
|
|
783
781
|
}
|
|
784
782
|
}
|
|
785
783
|
if (p) {
|
|
786
|
-
const
|
|
787
|
-
rt(
|
|
784
|
+
const y = fe(a);
|
|
785
|
+
rt(y) && e.push({
|
|
788
786
|
node: null,
|
|
789
|
-
shadow:
|
|
787
|
+
shadow: y
|
|
790
788
|
}, {
|
|
791
|
-
node:
|
|
789
|
+
node: y,
|
|
792
790
|
shadow: null
|
|
793
791
|
});
|
|
794
792
|
}
|
|
@@ -796,17 +794,17 @@ function on() {
|
|
|
796
794
|
};
|
|
797
795
|
return n.sanitize = function(r) {
|
|
798
796
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = null, i = null, a = null, u = null;
|
|
799
|
-
if (Xt = !r, Xt && (r = "<!-->"), typeof r != "string" && !Tt(r) && (r =
|
|
797
|
+
if (Xt = !r, Xt && (r = "<!-->"), typeof r != "string" && !Tt(r) && (r = lo(r), typeof r != "string"))
|
|
800
798
|
throw J("dirty is not a string, aborting");
|
|
801
799
|
if (!n.isSupported)
|
|
802
800
|
return r;
|
|
803
|
-
|
|
801
|
+
Ut ? (d = Ht, h = Gt) : Zt(t), (g.uponSanitizeElement.length > 0 || g.uponSanitizeAttribute.length > 0) && (d = N(d)), g.uponSanitizeAttribute.length > 0 && (h = N(h)), n.removed = [];
|
|
804
802
|
const p = Yt && typeof r != "string" && Tt(r);
|
|
805
803
|
if (p) {
|
|
806
804
|
const M = H ? H(r) : r.nodeName;
|
|
807
805
|
if (typeof M == "string") {
|
|
808
|
-
const v =
|
|
809
|
-
if (!
|
|
806
|
+
const v = T(M);
|
|
807
|
+
if (!d[v] || dt[v])
|
|
810
808
|
throw J("root node is forbidden and cannot be sanitized in-place");
|
|
811
809
|
}
|
|
812
810
|
if (Ct(r))
|
|
@@ -814,94 +812,101 @@ function on() {
|
|
|
814
812
|
try {
|
|
815
813
|
Qt(r);
|
|
816
814
|
} catch (v) {
|
|
817
|
-
throw
|
|
815
|
+
throw Pe(r), v;
|
|
818
816
|
}
|
|
819
817
|
} else if (Tt(r))
|
|
820
|
-
e =
|
|
818
|
+
e = xe("<!---->"), i = e.ownerDocument.importNode(r, !0), i.nodeType === k.element && i.nodeName === "BODY" || i.nodeName === "HTML" ? e = i : e.appendChild(i), Qt(i);
|
|
821
819
|
else {
|
|
822
820
|
if (!et && !B && !K && // eslint-disable-next-line unicorn/prefer-includes
|
|
823
821
|
r.indexOf("<") === -1)
|
|
824
822
|
return L && It ? tt(r) : r;
|
|
825
|
-
if (e =
|
|
823
|
+
if (e = xe(r), !e)
|
|
826
824
|
return et ? null : It ? q : "";
|
|
827
825
|
}
|
|
828
826
|
e && Bt && W(e.firstChild);
|
|
829
|
-
const S =
|
|
827
|
+
const S = ke(p ? r : e);
|
|
830
828
|
try {
|
|
831
829
|
for (; a = S.nextNode(); )
|
|
832
|
-
|
|
830
|
+
ze(a), He(a), rt(a.content) && Mt(a.content);
|
|
833
831
|
} catch (M) {
|
|
834
|
-
throw p &&
|
|
832
|
+
throw p && Pe(r), M;
|
|
835
833
|
}
|
|
836
834
|
if (p)
|
|
837
|
-
return
|
|
838
|
-
M.element &&
|
|
835
|
+
return gt(n.removed, (M) => {
|
|
836
|
+
M.element && Pn(M.element);
|
|
839
837
|
}), B && Jt(r), r;
|
|
840
838
|
if (et) {
|
|
841
839
|
if (B && Jt(e), Rt)
|
|
842
|
-
for (u =
|
|
840
|
+
for (u = dn.call(e.ownerDocument); e.firstChild; )
|
|
843
841
|
u.appendChild(e.firstChild);
|
|
844
842
|
else
|
|
845
843
|
u = e;
|
|
846
|
-
return (
|
|
844
|
+
return (h.shadowroot || h.shadowrootmode) && (u = _n.call(l, u, !0)), u;
|
|
847
845
|
}
|
|
848
|
-
let
|
|
849
|
-
return K &&
|
|
850
|
-
` +
|
|
846
|
+
let y = K ? e.outerHTML : e.innerHTML;
|
|
847
|
+
return K && d["!doctype"] && e.ownerDocument && e.ownerDocument.doctype && e.ownerDocument.doctype.name && O(Eo, e.ownerDocument.doctype.name) && (y = "<!DOCTYPE " + e.ownerDocument.doctype.name + `>
|
|
848
|
+
` + y), B && (y = Dt(y)), L && It ? tt(y) : y;
|
|
851
849
|
}, n.setConfig = function() {
|
|
852
850
|
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
853
|
-
Zt(r),
|
|
851
|
+
Zt(r), Ut = !0, Ht = d, Gt = h;
|
|
854
852
|
}, n.clearConfig = function() {
|
|
855
|
-
it = null,
|
|
853
|
+
it = null, Ut = !1, Ht = null, Gt = null, L = kt, q = "";
|
|
856
854
|
}, n.isValidAttribute = function(r, t, e) {
|
|
857
855
|
it || Zt({});
|
|
858
|
-
const i =
|
|
859
|
-
return
|
|
856
|
+
const i = T(r), a = T(t);
|
|
857
|
+
return Fe(i, a, e);
|
|
860
858
|
}, n.addHook = function(r, t) {
|
|
861
859
|
typeof t == "function" && b(g, r) && st(g[r], t);
|
|
862
860
|
}, n.removeHook = function(r, t) {
|
|
863
861
|
if (b(g, r)) {
|
|
864
862
|
if (t !== void 0) {
|
|
865
|
-
const e =
|
|
866
|
-
return e === -1 ? void 0 :
|
|
863
|
+
const e = eo(g[r], t);
|
|
864
|
+
return e === -1 ? void 0 : no(g[r], e, 1)[0];
|
|
867
865
|
}
|
|
868
|
-
return
|
|
866
|
+
return $e(g[r]);
|
|
869
867
|
}
|
|
870
868
|
}, n.removeHooks = function(r) {
|
|
871
869
|
b(g, r) && (g[r] = []);
|
|
872
870
|
}, n.removeAllHooks = function() {
|
|
873
|
-
g =
|
|
871
|
+
g = on();
|
|
874
872
|
}, n;
|
|
875
873
|
}
|
|
876
|
-
var
|
|
877
|
-
const St = /* @__PURE__ */ new Map();
|
|
878
|
-
|
|
879
|
-
const
|
|
880
|
-
if (!n.ok)
|
|
881
|
-
throw new Error(`Failed to load icon: ${n.status}`);
|
|
882
|
-
const s = await n.text(), c = Ao.sanitize(s, {
|
|
874
|
+
var Io = ln();
|
|
875
|
+
const St = /* @__PURE__ */ new Map(), ce = /* @__PURE__ */ new Map();
|
|
876
|
+
function cn(o, n) {
|
|
877
|
+
const s = Io.sanitize(o, {
|
|
883
878
|
USE_PROFILES: { svg: !0, svgFilters: !0 },
|
|
884
879
|
FORBID_TAGS: ["script", "use"],
|
|
885
880
|
// <use> can SSRF to external hrefs
|
|
886
881
|
FORBID_ATTR: ["onload", "onerror", "onbegin", "href", "xlink:href"]
|
|
887
|
-
}),
|
|
888
|
-
if (!(
|
|
889
|
-
throw new Error(`Invalid SVG from ${
|
|
890
|
-
return
|
|
882
|
+
}), m = new DOMParser().parseFromString(s, "image/svg+xml").documentElement;
|
|
883
|
+
if (!(m instanceof SVGElement))
|
|
884
|
+
throw new Error(`Invalid SVG from ${n}`);
|
|
885
|
+
return m;
|
|
891
886
|
}
|
|
892
|
-
async function
|
|
893
|
-
|
|
887
|
+
async function No(o) {
|
|
888
|
+
const n = await fetch(o);
|
|
889
|
+
if (!n.ok)
|
|
890
|
+
throw new Error(`Failed to load icon: ${n.status}`);
|
|
891
|
+
return cn(await n.text(), o);
|
|
892
|
+
}
|
|
893
|
+
async function rn(o) {
|
|
894
|
+
return St.has(o) || St.set(o, No(o)), (await St.get(o)).cloneNode(!0);
|
|
895
|
+
}
|
|
896
|
+
function Lo(o) {
|
|
897
|
+
let n = ce.get(o);
|
|
898
|
+
return n || (n = cn(o, "inline SVG source"), ce.set(o, n)), n.cloneNode(!0);
|
|
894
899
|
}
|
|
895
|
-
function
|
|
896
|
-
o ? St.delete(o) : St.clear();
|
|
900
|
+
function zo(o) {
|
|
901
|
+
o ? St.delete(o) : (St.clear(), ce.clear());
|
|
897
902
|
}
|
|
898
|
-
const
|
|
899
|
-
var
|
|
900
|
-
for (var
|
|
901
|
-
(
|
|
902
|
-
return
|
|
903
|
+
const Do = ":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)}";
|
|
904
|
+
var Co = Object.defineProperty, X = (o, n, s, l) => {
|
|
905
|
+
for (var c = void 0, m = o.length - 1, A; m >= 0; m--)
|
|
906
|
+
(A = o[m]) && (c = A(n, s, c) || c);
|
|
907
|
+
return c && Co(n, s, c), c;
|
|
903
908
|
}, $;
|
|
904
|
-
const
|
|
909
|
+
const U = ($ = class extends Hn {
|
|
905
910
|
constructor() {
|
|
906
911
|
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;
|
|
907
912
|
}
|
|
@@ -913,10 +918,10 @@ const F = ($ = class extends Pn {
|
|
|
913
918
|
})();
|
|
914
919
|
}
|
|
915
920
|
connectedCallback() {
|
|
916
|
-
super.connectedCallback(),
|
|
921
|
+
super.connectedCallback(), Be(this.library, this);
|
|
917
922
|
}
|
|
918
923
|
disconnectedCallback() {
|
|
919
|
-
super.disconnectedCallback(),
|
|
924
|
+
super.disconnectedCallback(), We(this.library, this);
|
|
920
925
|
}
|
|
921
926
|
/** Called by the icon library registry when the current library changes. */
|
|
922
927
|
redraw() {
|
|
@@ -940,7 +945,7 @@ const F = ($ = class extends Pn {
|
|
|
940
945
|
if (n.has("name") || n.has("library")) {
|
|
941
946
|
if (n.has("library")) {
|
|
942
947
|
const s = n.get("library");
|
|
943
|
-
s &&
|
|
948
|
+
s && We(s, this), Be(this.library, this);
|
|
944
949
|
}
|
|
945
950
|
this._loadIcon();
|
|
946
951
|
}
|
|
@@ -949,62 +954,64 @@ const F = ($ = class extends Pn {
|
|
|
949
954
|
_loadIcon() {
|
|
950
955
|
const n = ++this._loadSeq;
|
|
951
956
|
this._loadPromise = (async () => {
|
|
952
|
-
const s =
|
|
957
|
+
const s = $n(this.library);
|
|
953
958
|
if (!s || !this.name) {
|
|
954
959
|
this._svg = null;
|
|
955
960
|
return;
|
|
956
961
|
}
|
|
957
|
-
const c = s.resolver(this.name);
|
|
958
|
-
if (!c) {
|
|
959
|
-
this._svg = null;
|
|
960
|
-
return;
|
|
961
|
-
}
|
|
962
962
|
try {
|
|
963
|
-
const l = await
|
|
963
|
+
const l = await s.resolver(this.name);
|
|
964
|
+
if (n !== this._loadSeq) return;
|
|
965
|
+
if (!l) {
|
|
966
|
+
this._svg = null;
|
|
967
|
+
return;
|
|
968
|
+
}
|
|
969
|
+
const c = typeof l == "string" ? await rn(l) : l.type === "url" ? await rn(l.href) : Lo(l.content);
|
|
964
970
|
if (n !== this._loadSeq) return;
|
|
965
|
-
s.mutator?.(
|
|
971
|
+
s.mutator?.(c), this._applyAttributes(c), this._svg = c;
|
|
966
972
|
} catch {
|
|
967
973
|
n === this._loadSeq && (this._svg = null);
|
|
968
974
|
}
|
|
969
975
|
})();
|
|
970
976
|
}
|
|
971
977
|
_applyAttributes(n) {
|
|
972
|
-
n.setAttribute("role", "img"), this.ariaLabel ? (n.setAttribute("aria-label", this.ariaLabel), n.removeAttribute("aria-hidden")) : (n.setAttribute("aria-hidden", "true"), n.removeAttribute("aria-label")), n.style.rotate = `${this.rotate}deg
|
|
978
|
+
n.setAttribute("role", "img"), this.ariaLabel ? (n.setAttribute("aria-label", this.ariaLabel), n.removeAttribute("aria-hidden")) : (n.setAttribute("aria-hidden", "true"), n.removeAttribute("aria-label")), this.rotate && this.rotate !== "0" ? n.style.rotate = `${this.rotate}deg` : n.style.removeProperty("rotate"), n.style.color = this.color || "currentcolor", n.classList.add(`nys-icon--${this.size}`), n.classList.add("nys-icon--svg"), this.flip && n.classList.add(`nys-icon--flip-${this.flip}`);
|
|
973
979
|
}
|
|
974
980
|
render() {
|
|
975
|
-
return this._svg ?
|
|
981
|
+
return this._svg ? Bn`${this._svg}` : null;
|
|
976
982
|
}
|
|
977
|
-
}, $.styles =
|
|
983
|
+
}, $.styles = Gn(Do), $._validName = /^[a-zA-Z0-9_-]+$/, $);
|
|
978
984
|
X([
|
|
979
985
|
Q({ type: String, reflect: !0 })
|
|
980
|
-
],
|
|
986
|
+
], U.prototype, "name");
|
|
981
987
|
X([
|
|
982
988
|
Q({ type: String, reflect: !0 })
|
|
983
|
-
],
|
|
989
|
+
], U.prototype, "library");
|
|
984
990
|
X([
|
|
985
991
|
Q({ type: String })
|
|
986
|
-
],
|
|
992
|
+
], U.prototype, "ariaLabel");
|
|
987
993
|
X([
|
|
988
994
|
Q({ type: String })
|
|
989
|
-
],
|
|
995
|
+
], U.prototype, "rotate");
|
|
990
996
|
X([
|
|
991
997
|
Q({ type: String })
|
|
992
|
-
],
|
|
998
|
+
], U.prototype, "flip");
|
|
993
999
|
X([
|
|
994
1000
|
Q({ type: String })
|
|
995
|
-
],
|
|
1001
|
+
], U.prototype, "color");
|
|
996
1002
|
X([
|
|
997
1003
|
Q({ type: String })
|
|
998
|
-
],
|
|
1004
|
+
], U.prototype, "size");
|
|
999
1005
|
X([
|
|
1000
|
-
|
|
1001
|
-
],
|
|
1002
|
-
let
|
|
1003
|
-
customElements.get("nys-icon") || customElements.define("nys-icon",
|
|
1006
|
+
Wn()
|
|
1007
|
+
], U.prototype, "_svg");
|
|
1008
|
+
let Mo = U;
|
|
1009
|
+
customElements.get("nys-icon") || customElements.define("nys-icon", Mo);
|
|
1004
1010
|
export {
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1011
|
+
Mo as NysIcon,
|
|
1012
|
+
zo as clearIconCache,
|
|
1013
|
+
$n as getIconLibrary,
|
|
1014
|
+
xo as registerIconLibrary,
|
|
1015
|
+
ko as unregisterIconLibrary
|
|
1009
1016
|
};
|
|
1010
1017
|
//# sourceMappingURL=nys-icon.js.map
|