@signalwire/web-components 4.0.0-dev-20260714201720 → 4.0.0-dev-20260721161304
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/embed/signalwire-web-components-embed.iife.js +179 -178
- package/dist/embed/signalwire-web-components-embed.iife.js.map +1 -1
- package/dist/embed/signalwire-web-components-embed.umd.cjs +175 -174
- package/dist/embed/signalwire-web-components-embed.umd.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/node_modules/dompurify/dist/purify.es.js +692 -423
- package/dist/node_modules/dompurify/dist/purify.es.js.map +1 -1
- package/package.json +3 -2
|
@@ -1,178 +1,203 @@
|
|
|
1
|
-
/*! @license DOMPurify 3.4.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
/*! @license DOMPurify 3.4.12 | (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.12/LICENSE */
|
|
2
|
+
function Pe(o, i) {
|
|
3
|
+
(i == null || i > o.length) && (i = o.length);
|
|
4
|
+
for (var s = 0, c = Array(i); s < i; s++) c[s] = o[s];
|
|
5
|
+
return c;
|
|
6
|
+
}
|
|
7
|
+
function Dn(o) {
|
|
8
|
+
if (Array.isArray(o)) return o;
|
|
9
|
+
}
|
|
10
|
+
function Ln(o, i) {
|
|
11
|
+
var s = o == null ? null : typeof Symbol < "u" && o[Symbol.iterator] || o["@@iterator"];
|
|
12
|
+
if (s != null) {
|
|
13
|
+
var c, f, m, R, ct = [], M = !0, ut = !1;
|
|
14
|
+
try {
|
|
15
|
+
if (m = (s = s.call(o)).next, i !== 0) for (; !(M = (c = m.call(s)).done) && (ct.push(c.value), ct.length !== i); M = !0) ;
|
|
16
|
+
} catch (Lt) {
|
|
17
|
+
ut = !0, f = Lt;
|
|
18
|
+
} finally {
|
|
19
|
+
try {
|
|
20
|
+
if (!M && s.return != null && (R = s.return(), Object(R) !== R)) return;
|
|
21
|
+
} finally {
|
|
22
|
+
if (ut) throw f;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return ct;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function wn() {
|
|
29
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
30
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
31
|
+
}
|
|
32
|
+
function Cn(o, i) {
|
|
33
|
+
return Dn(o) || Ln(o, i) || Mn(o, i) || wn();
|
|
34
|
+
}
|
|
35
|
+
function Mn(o, i) {
|
|
36
|
+
if (o) {
|
|
37
|
+
if (typeof o == "string") return Pe(o, i);
|
|
38
|
+
var s = {}.toString.call(o).slice(8, -1);
|
|
39
|
+
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) ? Pe(o, i) : void 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const Ve = Object.entries, xe = Object.setPrototypeOf, Pn = Object.isFrozen, xn = Object.getPrototypeOf, kn = Object.getOwnPropertyDescriptor;
|
|
43
|
+
let b = Object.freeze, O = Object.seal, lt = Object.create, qe = typeof Reflect < "u" && Reflect, ne = qe.apply, oe = qe.construct;
|
|
44
|
+
b || (b = function(i) {
|
|
45
|
+
return i;
|
|
19
46
|
});
|
|
20
|
-
|
|
21
|
-
return
|
|
47
|
+
O || (O = function(i) {
|
|
48
|
+
return i;
|
|
22
49
|
});
|
|
23
|
-
|
|
24
|
-
for (var
|
|
25
|
-
|
|
26
|
-
return
|
|
50
|
+
ne || (ne = function(i, s) {
|
|
51
|
+
for (var c = arguments.length, f = new Array(c > 2 ? c - 2 : 0), m = 2; m < c; m++)
|
|
52
|
+
f[m - 2] = arguments[m];
|
|
53
|
+
return i.apply(s, f);
|
|
27
54
|
});
|
|
28
|
-
|
|
29
|
-
for (var
|
|
30
|
-
|
|
31
|
-
return new
|
|
55
|
+
oe || (oe = function(i) {
|
|
56
|
+
for (var s = arguments.length, c = new Array(s > 1 ? s - 1 : 0), f = 1; f < s; f++)
|
|
57
|
+
c[f - 1] = arguments[f];
|
|
58
|
+
return new i(...c);
|
|
32
59
|
});
|
|
33
|
-
const
|
|
34
|
-
function
|
|
35
|
-
return function(
|
|
36
|
-
|
|
37
|
-
for (var
|
|
38
|
-
|
|
39
|
-
return
|
|
60
|
+
const at = A(Array.prototype.forEach), vn = A(Array.prototype.lastIndexOf), ke = A(Array.prototype.pop), st = A(Array.prototype.push), Un = A(Array.prototype.splice), $ = Array.isArray, _t = A(String.prototype.toLowerCase), Zt = A(String.prototype.toString), ve = A(String.prototype.match), Tt = A(String.prototype.replace), Ue = A(String.prototype.indexOf), Fn = A(String.prototype.trim), zn = A(Number.prototype.toString), Hn = A(Boolean.prototype.toString), Fe = typeof BigInt > "u" ? null : A(BigInt.prototype.toString), ze = typeof Symbol > "u" ? null : A(Symbol.prototype.toString), S = A(Object.prototype.hasOwnProperty), ht = A(Object.prototype.toString), y = A(RegExp.prototype.test), J = Gn(TypeError);
|
|
61
|
+
function A(o) {
|
|
62
|
+
return function(i) {
|
|
63
|
+
i instanceof RegExp && (i.lastIndex = 0);
|
|
64
|
+
for (var s = arguments.length, c = new Array(s > 1 ? s - 1 : 0), f = 1; f < s; f++)
|
|
65
|
+
c[f - 1] = arguments[f];
|
|
66
|
+
return ne(o, i, c);
|
|
40
67
|
};
|
|
41
68
|
}
|
|
42
|
-
function
|
|
69
|
+
function Gn(o) {
|
|
43
70
|
return function() {
|
|
44
|
-
for (var
|
|
45
|
-
|
|
46
|
-
return
|
|
71
|
+
for (var i = arguments.length, s = new Array(i), c = 0; c < i; c++)
|
|
72
|
+
s[c] = arguments[c];
|
|
73
|
+
return oe(o, s);
|
|
47
74
|
};
|
|
48
75
|
}
|
|
49
|
-
function
|
|
50
|
-
let
|
|
51
|
-
if (
|
|
52
|
-
return
|
|
53
|
-
let
|
|
54
|
-
for (;
|
|
55
|
-
let
|
|
56
|
-
if (typeof
|
|
57
|
-
const
|
|
58
|
-
|
|
76
|
+
function p(o, i) {
|
|
77
|
+
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _t;
|
|
78
|
+
if (xe && xe(o, null), !$(i))
|
|
79
|
+
return o;
|
|
80
|
+
let c = i.length;
|
|
81
|
+
for (; c--; ) {
|
|
82
|
+
let f = i[c];
|
|
83
|
+
if (typeof f == "string") {
|
|
84
|
+
const m = s(f);
|
|
85
|
+
m !== f && (Pn(i) || (i[c] = m), f = m);
|
|
59
86
|
}
|
|
60
|
-
|
|
87
|
+
o[f] = !0;
|
|
61
88
|
}
|
|
62
|
-
return
|
|
89
|
+
return o;
|
|
63
90
|
}
|
|
64
|
-
function
|
|
65
|
-
for (let
|
|
66
|
-
|
|
67
|
-
return
|
|
91
|
+
function Bn(o) {
|
|
92
|
+
for (let i = 0; i < o.length; i++)
|
|
93
|
+
S(o, i) || (o[i] = null);
|
|
94
|
+
return o;
|
|
68
95
|
}
|
|
69
|
-
function
|
|
70
|
-
const
|
|
71
|
-
for (const
|
|
72
|
-
|
|
73
|
-
|
|
96
|
+
function L(o) {
|
|
97
|
+
const i = lt(null);
|
|
98
|
+
for (const c of Ve(o)) {
|
|
99
|
+
var s = Cn(c, 2);
|
|
100
|
+
const f = s[0], m = s[1];
|
|
101
|
+
S(o, f) && ($(m) ? i[f] = Bn(m) : m && typeof m == "object" && m.constructor === Object ? i[f] = L(m) : i[f] = m);
|
|
102
|
+
}
|
|
103
|
+
return i;
|
|
74
104
|
}
|
|
75
|
-
function
|
|
76
|
-
switch (typeof
|
|
105
|
+
function Wn(o) {
|
|
106
|
+
switch (typeof o) {
|
|
77
107
|
case "string":
|
|
78
|
-
return
|
|
108
|
+
return o;
|
|
79
109
|
case "number":
|
|
80
|
-
return
|
|
110
|
+
return zn(o);
|
|
81
111
|
case "boolean":
|
|
82
|
-
return
|
|
112
|
+
return Hn(o);
|
|
83
113
|
case "bigint":
|
|
84
|
-
return
|
|
114
|
+
return Fe ? Fe(o) : "0";
|
|
85
115
|
case "symbol":
|
|
86
|
-
return
|
|
116
|
+
return ze ? ze(o) : "Symbol()";
|
|
87
117
|
case "undefined":
|
|
88
|
-
return
|
|
118
|
+
return ht(o);
|
|
89
119
|
case "function":
|
|
90
120
|
case "object": {
|
|
91
|
-
if (
|
|
92
|
-
return
|
|
93
|
-
const
|
|
94
|
-
if (typeof
|
|
95
|
-
const
|
|
96
|
-
return typeof
|
|
121
|
+
if (o === null)
|
|
122
|
+
return ht(o);
|
|
123
|
+
const i = o, s = H(i, "toString");
|
|
124
|
+
if (typeof s == "function") {
|
|
125
|
+
const c = s(i);
|
|
126
|
+
return typeof c == "string" ? c : ht(c);
|
|
97
127
|
}
|
|
98
|
-
return
|
|
128
|
+
return ht(o);
|
|
99
129
|
}
|
|
100
130
|
default:
|
|
101
|
-
return
|
|
131
|
+
return ht(o);
|
|
102
132
|
}
|
|
103
133
|
}
|
|
104
|
-
function
|
|
105
|
-
for (;
|
|
106
|
-
const
|
|
107
|
-
if (
|
|
108
|
-
if (
|
|
109
|
-
return
|
|
110
|
-
if (typeof
|
|
111
|
-
return
|
|
134
|
+
function H(o, i) {
|
|
135
|
+
for (; o !== null; ) {
|
|
136
|
+
const c = kn(o, i);
|
|
137
|
+
if (c) {
|
|
138
|
+
if (c.get)
|
|
139
|
+
return A(c.get);
|
|
140
|
+
if (typeof c.value == "function")
|
|
141
|
+
return A(c.value);
|
|
112
142
|
}
|
|
113
|
-
|
|
143
|
+
o = xn(o);
|
|
114
144
|
}
|
|
115
|
-
function
|
|
145
|
+
function s() {
|
|
116
146
|
return null;
|
|
117
147
|
}
|
|
118
|
-
return
|
|
148
|
+
return s;
|
|
119
149
|
}
|
|
120
|
-
function
|
|
150
|
+
function Yn(o) {
|
|
121
151
|
try {
|
|
122
|
-
return
|
|
152
|
+
return y(o, ""), !0;
|
|
123
153
|
} catch {
|
|
124
154
|
return !1;
|
|
125
155
|
}
|
|
126
156
|
}
|
|
127
|
-
const
|
|
157
|
+
const He = 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"]), Jt = 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"]), Qt = 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"]), jn = 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"]), te = 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"]), $n = b(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ge = b(["#text"]), Be = 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"]), ee = 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", "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", "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"]), We = 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"]), Dt = b(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Xn = O(/{{[\w\W]*|^[\w\W]*}}/g), Vn = O(/<%[\w\W]*|^[\w\W]*%>/g), qn = O(/\${[\w\W]*/g), Kn = O(/^data-[\-\w.\u00B7-\uFFFF]+$/), Zn = O(/^aria-[\-\w]+$/), Ye = O(
|
|
128
158
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
129
159
|
// eslint-disable-line no-useless-escape
|
|
130
|
-
),
|
|
160
|
+
), Jn = O(/^(?:\w+script|data):/i), Qn = O(
|
|
131
161
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
132
162
|
// eslint-disable-line no-control-regex
|
|
133
|
-
),
|
|
134
|
-
var Rt = /* @__PURE__ */ Object.freeze({
|
|
135
|
-
__proto__: null,
|
|
136
|
-
ARIA_ATTR: dn,
|
|
137
|
-
ATTR_WHITESPACE: En,
|
|
138
|
-
CUSTOM_ELEMENT: An,
|
|
139
|
-
DATA_ATTR: Tn,
|
|
140
|
-
DOCTYPE_NAME: Dt,
|
|
141
|
-
ERB_EXPR: mn,
|
|
142
|
-
IS_ALLOWED_URI: bt,
|
|
143
|
-
IS_SCRIPT_OR_DATA: _n,
|
|
144
|
-
MUSTACHE_EXPR: un,
|
|
145
|
-
TMPLIT_EXPR: pn
|
|
146
|
-
});
|
|
147
|
-
const oe = {
|
|
163
|
+
), to = O(/^html$/i), eo = O(/^[a-z][.\w]*(-[.\w]+)+$/i), je = O(/<[/\w!]/g), $e = O(/<[/\w]/g), no = O(/<\/no(script|embed|frames)/i), oo = O(/\/>/i), P = {
|
|
148
164
|
element: 1,
|
|
165
|
+
attribute: 2,
|
|
149
166
|
text: 3,
|
|
167
|
+
cdataSection: 4,
|
|
168
|
+
entityReference: 5,
|
|
169
|
+
// Deprecated
|
|
170
|
+
entityNode: 6,
|
|
150
171
|
// Deprecated
|
|
151
|
-
|
|
172
|
+
processingInstruction: 7,
|
|
152
173
|
comment: 8,
|
|
153
|
-
document: 9
|
|
154
|
-
|
|
174
|
+
document: 9,
|
|
175
|
+
documentType: 10,
|
|
176
|
+
documentFragment: 11,
|
|
177
|
+
notation: 12
|
|
178
|
+
// Deprecated
|
|
179
|
+
}, ro = function() {
|
|
155
180
|
return typeof window > "u" ? null : window;
|
|
156
|
-
},
|
|
157
|
-
if (typeof
|
|
181
|
+
}, io = function(i, s) {
|
|
182
|
+
if (typeof i != "object" || typeof i.createPolicy != "function")
|
|
158
183
|
return null;
|
|
159
|
-
let
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
const
|
|
184
|
+
let c = null;
|
|
185
|
+
const f = "data-tt-policy-suffix";
|
|
186
|
+
s && s.hasAttribute(f) && (c = s.getAttribute(f));
|
|
187
|
+
const m = "dompurify" + (c ? "#" + c : "");
|
|
163
188
|
try {
|
|
164
|
-
return
|
|
165
|
-
createHTML(
|
|
166
|
-
return
|
|
189
|
+
return i.createPolicy(m, {
|
|
190
|
+
createHTML(R) {
|
|
191
|
+
return R;
|
|
167
192
|
},
|
|
168
|
-
createScriptURL(
|
|
169
|
-
return
|
|
193
|
+
createScriptURL(R) {
|
|
194
|
+
return R;
|
|
170
195
|
}
|
|
171
196
|
});
|
|
172
197
|
} catch {
|
|
173
|
-
return console.warn("TrustedTypes policy " +
|
|
198
|
+
return console.warn("TrustedTypes policy " + m + " could not be created."), null;
|
|
174
199
|
}
|
|
175
|
-
},
|
|
200
|
+
}, Xe = function() {
|
|
176
201
|
return {
|
|
177
202
|
afterSanitizeAttributes: [],
|
|
178
203
|
afterSanitizeElements: [],
|
|
@@ -184,58 +209,53 @@ const oe = {
|
|
|
184
209
|
uponSanitizeElement: [],
|
|
185
210
|
uponSanitizeShadowNode: []
|
|
186
211
|
};
|
|
212
|
+
}, j = function(i, s, c, f) {
|
|
213
|
+
return S(i, s) && $(i[s]) ? p(f.base ? L(f.base) : {}, i[s], f.transform) : c;
|
|
187
214
|
};
|
|
188
|
-
function
|
|
189
|
-
let
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
192
|
-
return
|
|
193
|
-
let
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
NamedNodeMap: Lt = i.NamedNodeMap || i.MozNamedAttrMap,
|
|
203
|
-
HTMLFormElement: Nt,
|
|
204
|
-
DOMParser: Ct,
|
|
205
|
-
trustedTypes: re
|
|
206
|
-
} = i, $ = ze.prototype, Mt = j($, "cloneNode"), wt = j($, "remove"), Pt = j($, "nextSibling"), xt = j($, "childNodes"), ae = j($, "parentNode");
|
|
207
|
-
if (typeof H == "function") {
|
|
208
|
-
const r = l.createElement("template");
|
|
209
|
-
r.content && r.content.ownerDocument && (l = r.content.ownerDocument);
|
|
215
|
+
function Ke() {
|
|
216
|
+
let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ro();
|
|
217
|
+
const i = (r) => Ke(r);
|
|
218
|
+
if (i.version = "3.4.12", i.removed = [], !o || !o.document || o.document.nodeType !== P.document || !o.Element)
|
|
219
|
+
return i.isSupported = !1, i;
|
|
220
|
+
let s = o.document;
|
|
221
|
+
const c = s, f = c.currentScript;
|
|
222
|
+
o.DocumentFragment;
|
|
223
|
+
const m = o.HTMLTemplateElement, R = o.Node, ct = o.Element, M = o.NodeFilter, ut = o.NamedNodeMap;
|
|
224
|
+
ut === void 0 && (o.NamedNodeMap || o.MozNamedAttrMap), o.HTMLFormElement;
|
|
225
|
+
const Lt = o.DOMParser, gt = o.trustedTypes, X = ct.prototype, Ze = H(X, "cloneNode"), wt = H(X, "remove"), Je = H(X, "nextSibling"), Q = H(X, "childNodes"), V = H(X, "parentNode"), re = H(X, "shadowRoot"), Ct = H(X, "attributes"), I = R && R.prototype ? H(R.prototype, "nodeType") : null, v = R && R.prototype ? H(R.prototype, "nodeName") : null;
|
|
226
|
+
if (typeof m == "function") {
|
|
227
|
+
const r = s.createElement("template");
|
|
228
|
+
r.content && r.content.ownerDocument && (s = r.content.ownerDocument);
|
|
210
229
|
}
|
|
211
|
-
let
|
|
212
|
-
const {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
} =
|
|
232
|
-
let
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
230
|
+
let w, q = "", Mt, ie = !1, ft = 0;
|
|
231
|
+
const ae = function() {
|
|
232
|
+
if (ft > 0)
|
|
233
|
+
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.');
|
|
234
|
+
}, tt = function(t) {
|
|
235
|
+
ae(), ft++;
|
|
236
|
+
try {
|
|
237
|
+
return w.createHTML(t);
|
|
238
|
+
} finally {
|
|
239
|
+
ft--;
|
|
240
|
+
}
|
|
241
|
+
}, Qe = function(t) {
|
|
242
|
+
ae(), ft++;
|
|
243
|
+
try {
|
|
244
|
+
return w.createScriptURL(t);
|
|
245
|
+
} finally {
|
|
246
|
+
ft--;
|
|
247
|
+
}
|
|
248
|
+
}, tn = function() {
|
|
249
|
+
return ie || (Mt = io(gt, f), ie = !0), Mt;
|
|
250
|
+
}, Et = s, Pt = Et.implementation, se = Et.createNodeIterator, en = Et.createDocumentFragment, nn = Et.getElementsByTagName, on = c.importNode;
|
|
251
|
+
let T = Xe();
|
|
252
|
+
i.isSupported = typeof Ve == "function" && typeof V == "function" && Pt && Pt.createHTMLDocument !== void 0;
|
|
253
|
+
const rn = Xn, an = Vn, sn = qn, ln = Kn, cn = Zn, un = Jn, le = Qn, fn = eo;
|
|
254
|
+
let ce = Ye, h = null;
|
|
255
|
+
const ue = p({}, [...He, ...Jt, ...Qt, ...te, ...Ge]);
|
|
256
|
+
let _ = null;
|
|
257
|
+
const fe = p({}, [...Be, ...ee, ...We, ...Dt]);
|
|
258
|
+
let g = Object.seal(lt(null, {
|
|
239
259
|
tagNameCheck: {
|
|
240
260
|
writable: !0,
|
|
241
261
|
configurable: !1,
|
|
@@ -254,8 +274,8 @@ function It() {
|
|
|
254
274
|
enumerable: !0,
|
|
255
275
|
value: !1
|
|
256
276
|
}
|
|
257
|
-
})),
|
|
258
|
-
const
|
|
277
|
+
})), pt = null, pe = null;
|
|
278
|
+
const G = Object.seal(lt(null, {
|
|
259
279
|
tagCheck: {
|
|
260
280
|
writable: !0,
|
|
261
281
|
configurable: !1,
|
|
@@ -269,329 +289,578 @@ function It() {
|
|
|
269
289
|
value: null
|
|
270
290
|
}
|
|
271
291
|
}));
|
|
272
|
-
let
|
|
273
|
-
const
|
|
274
|
-
let
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
+
let me = !0, xt = !0, de = !1, Te = !0, B = !1, W = !0, K = !1, kt = !1, vt = null, Ut = null, Ft = !1, et = !1, At = !1, yt = !1, he = !0, _e = !1;
|
|
293
|
+
const ge = "user-content-";
|
|
294
|
+
let zt = !0, Ht = !1, nt = {}, U = null;
|
|
295
|
+
const Gt = p({}, [
|
|
296
|
+
"annotation-xml",
|
|
297
|
+
"audio",
|
|
298
|
+
"colgroup",
|
|
299
|
+
"desc",
|
|
300
|
+
"foreignobject",
|
|
301
|
+
"head",
|
|
302
|
+
"iframe",
|
|
303
|
+
"math",
|
|
304
|
+
"mi",
|
|
305
|
+
"mn",
|
|
306
|
+
"mo",
|
|
307
|
+
"ms",
|
|
308
|
+
"mtext",
|
|
309
|
+
"noembed",
|
|
310
|
+
"noframes",
|
|
311
|
+
"noscript",
|
|
312
|
+
"plaintext",
|
|
313
|
+
"script",
|
|
314
|
+
// <selectedcontent> mirrors the selected <option>'s subtree, cloned by
|
|
315
|
+
// the UA (customizable <select>) — including any on* handlers — and the
|
|
316
|
+
// engine re-mirrors synchronously whenever a removal changes which
|
|
317
|
+
// option/selectedcontent is current, even inside DOMPurify's inert
|
|
318
|
+
// DOMParser document. Hoisting its children on removal re-inserts a fresh
|
|
319
|
+
// mirror target ahead of the walk, which the engine refills, looping
|
|
320
|
+
// forever (DoS) and amplifying output. Dropping its content on removal
|
|
321
|
+
// (rather than hoisting) breaks that cascade; the content is a duplicate
|
|
322
|
+
// of the option, which is sanitized on its own. See campaign-3 F1/F6.
|
|
323
|
+
"selectedcontent",
|
|
324
|
+
"style",
|
|
325
|
+
"svg",
|
|
326
|
+
"template",
|
|
327
|
+
"thead",
|
|
328
|
+
"title",
|
|
329
|
+
"video",
|
|
330
|
+
"xmp"
|
|
331
|
+
]);
|
|
332
|
+
let Ee = null;
|
|
333
|
+
const Ae = p({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
334
|
+
let Bt = null;
|
|
335
|
+
const ye = p({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), St = "http://www.w3.org/1998/Math/MathML", bt = "http://www.w3.org/2000/svg", F = "http://www.w3.org/1999/xhtml";
|
|
336
|
+
let ot = F, Wt = !1, Yt = null;
|
|
337
|
+
const pn = p({}, [St, bt, F], Zt), Se = b(["mi", "mo", "mn", "ms", "mtext"]);
|
|
338
|
+
let jt = p({}, Se);
|
|
339
|
+
const be = b(["annotation-xml"]);
|
|
340
|
+
let $t = p({}, be);
|
|
341
|
+
const mn = p({}, ["title", "style", "font", "a", "script"]);
|
|
342
|
+
let mt = null;
|
|
343
|
+
const dn = ["application/xhtml+xml", "text/html"], Tn = "text/html";
|
|
344
|
+
let d = null, rt = null;
|
|
345
|
+
const hn = s.createElement("form"), Oe = function(t) {
|
|
346
|
+
return t instanceof RegExp || t instanceof Function;
|
|
347
|
+
}, Xt = function() {
|
|
348
|
+
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
349
|
+
if (rt && rt === t)
|
|
292
350
|
return;
|
|
293
|
-
(!
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
351
|
+
(!t || typeof t != "object") && (t = {}), t = L(t), mt = // eslint-disable-next-line unicorn/prefer-includes
|
|
352
|
+
dn.indexOf(t.PARSER_MEDIA_TYPE) === -1 ? Tn : t.PARSER_MEDIA_TYPE, d = mt === "application/xhtml+xml" ? Zt : _t, h = j(t, "ALLOWED_TAGS", ue, {
|
|
353
|
+
transform: d
|
|
354
|
+
}), _ = j(t, "ALLOWED_ATTR", fe, {
|
|
355
|
+
transform: d
|
|
356
|
+
}), Yt = j(t, "ALLOWED_NAMESPACES", pn, {
|
|
357
|
+
transform: Zt
|
|
358
|
+
}), Bt = j(t, "ADD_URI_SAFE_ATTR", ye, {
|
|
359
|
+
transform: d,
|
|
360
|
+
base: ye
|
|
361
|
+
}), Ee = j(t, "ADD_DATA_URI_TAGS", Ae, {
|
|
362
|
+
transform: d,
|
|
363
|
+
base: Ae
|
|
364
|
+
}), U = j(t, "FORBID_CONTENTS", Gt, {
|
|
365
|
+
transform: d
|
|
366
|
+
}), pt = j(t, "FORBID_TAGS", L({}), {
|
|
367
|
+
transform: d
|
|
368
|
+
}), pe = j(t, "FORBID_ATTR", L({}), {
|
|
369
|
+
transform: d
|
|
370
|
+
}), nt = S(t, "USE_PROFILES") ? t.USE_PROFILES && typeof t.USE_PROFILES == "object" ? L(t.USE_PROFILES) : t.USE_PROFILES : !1, me = t.ALLOW_ARIA_ATTR !== !1, xt = t.ALLOW_DATA_ATTR !== !1, de = t.ALLOW_UNKNOWN_PROTOCOLS || !1, Te = t.ALLOW_SELF_CLOSE_IN_ATTR !== !1, B = t.SAFE_FOR_TEMPLATES || !1, W = t.SAFE_FOR_XML !== !1, K = t.WHOLE_DOCUMENT || !1, et = t.RETURN_DOM || !1, At = t.RETURN_DOM_FRAGMENT || !1, yt = t.RETURN_TRUSTED_TYPE || !1, Ft = t.FORCE_BODY || !1, he = t.SANITIZE_DOM !== !1, _e = t.SANITIZE_NAMED_PROPS || !1, zt = t.KEEP_CONTENT !== !1, Ht = t.IN_PLACE || !1, ce = Yn(t.ALLOWED_URI_REGEXP) ? t.ALLOWED_URI_REGEXP : Ye, ot = typeof t.NAMESPACE == "string" ? t.NAMESPACE : F, jt = S(t, "MATHML_TEXT_INTEGRATION_POINTS") && t.MATHML_TEXT_INTEGRATION_POINTS && typeof t.MATHML_TEXT_INTEGRATION_POINTS == "object" ? L(t.MATHML_TEXT_INTEGRATION_POINTS) : p({}, Se), $t = S(t, "HTML_INTEGRATION_POINTS") && t.HTML_INTEGRATION_POINTS && typeof t.HTML_INTEGRATION_POINTS == "object" ? L(t.HTML_INTEGRATION_POINTS) : p({}, be);
|
|
371
|
+
const e = S(t, "CUSTOM_ELEMENT_HANDLING") && t.CUSTOM_ELEMENT_HANDLING && typeof t.CUSTOM_ELEMENT_HANDLING == "object" ? L(t.CUSTOM_ELEMENT_HANDLING) : lt(null);
|
|
372
|
+
if (g = lt(null), S(e, "tagNameCheck") && Oe(e.tagNameCheck) && (g.tagNameCheck = e.tagNameCheck), S(e, "attributeNameCheck") && Oe(e.attributeNameCheck) && (g.attributeNameCheck = e.attributeNameCheck), S(e, "allowCustomizedBuiltInElements") && typeof e.allowCustomizedBuiltInElements == "boolean" && (g.allowCustomizedBuiltInElements = e.allowCustomizedBuiltInElements), O(g), B && (xt = !1), At && (et = !0), nt && (h = p({}, Ge), _ = lt(null), nt.html === !0 && (p(h, He), p(_, Be)), nt.svg === !0 && (p(h, Jt), p(_, ee), p(_, Dt)), nt.svgFilters === !0 && (p(h, Qt), p(_, ee), p(_, Dt)), nt.mathMl === !0 && (p(h, te), p(_, We), p(_, Dt))), G.tagCheck = null, G.attributeCheck = null, S(t, "ADD_TAGS") && (typeof t.ADD_TAGS == "function" ? G.tagCheck = t.ADD_TAGS : $(t.ADD_TAGS) && (h === ue && (h = L(h)), p(h, t.ADD_TAGS, d))), S(t, "ADD_ATTR") && (typeof t.ADD_ATTR == "function" ? G.attributeCheck = t.ADD_ATTR : $(t.ADD_ATTR) && (_ === fe && (_ = L(_)), p(_, t.ADD_ATTR, d))), S(t, "ADD_URI_SAFE_ATTR") && $(t.ADD_URI_SAFE_ATTR) && p(Bt, t.ADD_URI_SAFE_ATTR, d), S(t, "FORBID_CONTENTS") && $(t.FORBID_CONTENTS) && (U === Gt && (U = L(U)), p(U, t.FORBID_CONTENTS, d)), S(t, "ADD_FORBID_CONTENTS") && $(t.ADD_FORBID_CONTENTS) && (U === Gt && (U = L(U)), p(U, t.ADD_FORBID_CONTENTS, d)), zt && (h["#text"] = !0), K && p(h, ["html", "head", "body"]), h.table && (p(h, ["tbody"]), delete pt.tbody), t.TRUSTED_TYPES_POLICY) {
|
|
373
|
+
if (typeof t.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
374
|
+
throw J('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
375
|
+
if (typeof t.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
376
|
+
throw J('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
377
|
+
const n = w;
|
|
378
|
+
w = t.TRUSTED_TYPES_POLICY;
|
|
379
|
+
try {
|
|
380
|
+
q = tt("");
|
|
381
|
+
} catch (a) {
|
|
382
|
+
throw w = n, a;
|
|
383
|
+
}
|
|
384
|
+
} else t.TRUSTED_TYPES_POLICY === null ? (w = void 0, q = "") : (w === void 0 && (w = tn()), w && typeof q == "string" && (q = tt("")));
|
|
385
|
+
b && b(t), rt = t;
|
|
386
|
+
}, Re = p({}, [...Jt, ...Qt, ...jn]), Ne = p({}, [...te, ...$n]), _n = function(t, e, n) {
|
|
387
|
+
return e.namespaceURI === F ? t === "svg" : e.namespaceURI === St ? t === "svg" && (n === "annotation-xml" || jt[n]) : !!Re[t];
|
|
388
|
+
}, gn = function(t, e, n) {
|
|
389
|
+
return e.namespaceURI === F ? t === "math" : e.namespaceURI === bt ? t === "math" && $t[n] : !!Ne[t];
|
|
390
|
+
}, En = function(t, e, n) {
|
|
391
|
+
return e.namespaceURI === bt && !$t[n] || e.namespaceURI === St && !jt[n] ? !1 : !Ne[t] && (mn[t] || !Re[t]);
|
|
392
|
+
}, An = function(t) {
|
|
393
|
+
let e = V(t);
|
|
394
|
+
(!e || !e.tagName) && (e = {
|
|
395
|
+
namespaceURI: ot,
|
|
309
396
|
tagName: "template"
|
|
310
397
|
});
|
|
311
|
-
const
|
|
312
|
-
return
|
|
313
|
-
},
|
|
314
|
-
|
|
315
|
-
element:
|
|
398
|
+
const n = _t(t.tagName), a = _t(e.tagName);
|
|
399
|
+
return Yt[t.namespaceURI] ? t.namespaceURI === bt ? _n(n, e, a) : t.namespaceURI === St ? gn(n, e, a) : t.namespaceURI === F ? En(n, e, a) : !!(mt === "application/xhtml+xml" && Yt[t.namespaceURI]) : !1;
|
|
400
|
+
}, Y = function(t) {
|
|
401
|
+
st(i.removed, {
|
|
402
|
+
element: t
|
|
316
403
|
});
|
|
317
404
|
try {
|
|
318
|
-
|
|
405
|
+
V(t).removeChild(t);
|
|
319
406
|
} catch {
|
|
320
|
-
wt(
|
|
407
|
+
if (wt(t), !V(t))
|
|
408
|
+
throw J("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
409
|
+
}
|
|
410
|
+
}, Ot = function(t) {
|
|
411
|
+
Vt(t);
|
|
412
|
+
const e = Q(t);
|
|
413
|
+
if (e) {
|
|
414
|
+
const a = [];
|
|
415
|
+
at(e, (l) => {
|
|
416
|
+
st(a, l);
|
|
417
|
+
}), at(a, (l) => {
|
|
418
|
+
try {
|
|
419
|
+
wt(l);
|
|
420
|
+
} catch {
|
|
421
|
+
}
|
|
422
|
+
});
|
|
321
423
|
}
|
|
322
|
-
|
|
424
|
+
const n = Ct(t);
|
|
425
|
+
if (n)
|
|
426
|
+
for (let a = n.length - 1; a >= 0; --a) {
|
|
427
|
+
const l = n[a], u = l && l.name;
|
|
428
|
+
if (typeof u == "string")
|
|
429
|
+
try {
|
|
430
|
+
t.removeAttribute(u);
|
|
431
|
+
} catch {
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}, Z = function(t, e) {
|
|
323
435
|
try {
|
|
324
|
-
|
|
325
|
-
attribute:
|
|
326
|
-
from:
|
|
436
|
+
st(i.removed, {
|
|
437
|
+
attribute: e.getAttributeNode(t),
|
|
438
|
+
from: e
|
|
327
439
|
});
|
|
328
440
|
} catch {
|
|
329
|
-
|
|
441
|
+
st(i.removed, {
|
|
330
442
|
attribute: null,
|
|
331
|
-
from:
|
|
443
|
+
from: e
|
|
332
444
|
});
|
|
333
445
|
}
|
|
334
|
-
if (
|
|
335
|
-
if (
|
|
446
|
+
if (e.removeAttribute(t), t === "is")
|
|
447
|
+
if (et || At)
|
|
336
448
|
try {
|
|
337
|
-
|
|
449
|
+
Y(e);
|
|
338
450
|
} catch {
|
|
339
451
|
}
|
|
340
452
|
else
|
|
341
453
|
try {
|
|
342
|
-
|
|
454
|
+
e.setAttribute(t, "");
|
|
343
455
|
} catch {
|
|
344
456
|
}
|
|
345
|
-
},
|
|
346
|
-
|
|
347
|
-
if (
|
|
348
|
-
|
|
457
|
+
}, yn = function(t) {
|
|
458
|
+
const e = Ct(t);
|
|
459
|
+
if (e)
|
|
460
|
+
for (let n = e.length - 1; n >= 0; --n) {
|
|
461
|
+
const a = e[n], l = a && a.name;
|
|
462
|
+
if (!(typeof l != "string" || _[d(l)]))
|
|
463
|
+
try {
|
|
464
|
+
t.removeAttribute(l);
|
|
465
|
+
} catch {
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}, Vt = function(t) {
|
|
469
|
+
const e = [t];
|
|
470
|
+
for (; e.length > 0; ) {
|
|
471
|
+
const n = e.pop();
|
|
472
|
+
(I ? I(n) : n.nodeType) === P.element && yn(n);
|
|
473
|
+
const l = Q(n);
|
|
474
|
+
if (l)
|
|
475
|
+
for (let u = l.length - 1; u >= 0; --u)
|
|
476
|
+
e.push(l[u]);
|
|
477
|
+
}
|
|
478
|
+
}, Sn = function(t) {
|
|
479
|
+
if (!W)
|
|
480
|
+
return;
|
|
481
|
+
const e = [t];
|
|
482
|
+
for (; e.length > 0; ) {
|
|
483
|
+
const n = e.pop(), a = I ? I(n) : n.nodeType;
|
|
484
|
+
if (a === P.processingInstruction || a === P.comment && y($e, n.data)) {
|
|
485
|
+
try {
|
|
486
|
+
wt(n);
|
|
487
|
+
} catch {
|
|
488
|
+
}
|
|
489
|
+
continue;
|
|
490
|
+
}
|
|
491
|
+
if (a === P.element) {
|
|
492
|
+
const u = n, E = d(v ? v(n) : n.nodeName);
|
|
493
|
+
try {
|
|
494
|
+
u.hasAttribute && u.hasAttribute("patchsrc") && u.removeAttribute("patchsrc"), u.hasAttribute && u.hasAttribute("for") && E !== "label" && E !== "output" && u.removeAttribute("for");
|
|
495
|
+
} catch {
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
const l = Q(n);
|
|
499
|
+
if (l)
|
|
500
|
+
for (let u = l.length - 1; u >= 0; --u)
|
|
501
|
+
e.push(l[u]);
|
|
502
|
+
}
|
|
503
|
+
}, Ie = function(t) {
|
|
504
|
+
let e = null, n = null;
|
|
505
|
+
if (Ft)
|
|
506
|
+
t = "<remove></remove>" + t;
|
|
349
507
|
else {
|
|
350
|
-
const
|
|
351
|
-
|
|
508
|
+
const u = ve(t, /^[\r\n\t ]+/);
|
|
509
|
+
n = u && u[0];
|
|
352
510
|
}
|
|
353
|
-
|
|
354
|
-
const
|
|
355
|
-
if (
|
|
511
|
+
mt === "application/xhtml+xml" && ot === F && (t = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + t + "</body></html>");
|
|
512
|
+
const a = w ? tt(t) : t;
|
|
513
|
+
if (ot === F)
|
|
356
514
|
try {
|
|
357
|
-
|
|
515
|
+
e = new Lt().parseFromString(a, mt);
|
|
358
516
|
} catch {
|
|
359
517
|
}
|
|
360
|
-
if (!
|
|
361
|
-
|
|
518
|
+
if (!e || !e.documentElement) {
|
|
519
|
+
e = Pt.createDocument(ot, "template", null);
|
|
362
520
|
try {
|
|
363
|
-
|
|
521
|
+
e.documentElement.innerHTML = Wt ? q : a;
|
|
364
522
|
} catch {
|
|
365
523
|
}
|
|
366
524
|
}
|
|
367
|
-
const
|
|
368
|
-
return
|
|
369
|
-
},
|
|
370
|
-
return
|
|
371
|
-
|
|
372
|
-
|
|
525
|
+
const l = e.body || e.documentElement;
|
|
526
|
+
return t && n && l.insertBefore(s.createTextNode(n), l.childNodes[0] || null), ot === F ? nn.call(e, K ? "html" : "body")[0] : K ? e.documentElement : l;
|
|
527
|
+
}, De = function(t) {
|
|
528
|
+
return se.call(
|
|
529
|
+
t.ownerDocument || t,
|
|
530
|
+
t,
|
|
531
|
+
// eslint-disable-next-line no-bitwise
|
|
532
|
+
M.SHOW_ELEMENT | M.SHOW_COMMENT | M.SHOW_TEXT | M.SHOW_PROCESSING_INSTRUCTION | M.SHOW_CDATA_SECTION,
|
|
533
|
+
null
|
|
534
|
+
);
|
|
535
|
+
}, Rt = function(t) {
|
|
536
|
+
return t = Tt(t, rn, " "), t = Tt(t, an, " "), t = Tt(t, sn, " "), t;
|
|
537
|
+
}, qt = function(t) {
|
|
538
|
+
var e;
|
|
539
|
+
t.normalize();
|
|
540
|
+
const n = se.call(
|
|
541
|
+
t.ownerDocument || t,
|
|
542
|
+
t,
|
|
373
543
|
// eslint-disable-next-line no-bitwise
|
|
374
|
-
|
|
544
|
+
M.SHOW_TEXT | M.SHOW_COMMENT | M.SHOW_CDATA_SECTION | M.SHOW_PROCESSING_INSTRUCTION,
|
|
375
545
|
null
|
|
376
546
|
);
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
547
|
+
let a = n.nextNode();
|
|
548
|
+
for (; a; )
|
|
549
|
+
a.data = Rt(a.data), a = n.nextNode();
|
|
550
|
+
const l = (e = t.querySelectorAll) === null || e === void 0 ? void 0 : e.call(t, "template");
|
|
551
|
+
l && at(l, (u) => {
|
|
552
|
+
it(u.content) && qt(u.content);
|
|
553
|
+
});
|
|
554
|
+
}, Nt = function(t) {
|
|
555
|
+
const e = v ? v(t) : null;
|
|
556
|
+
return typeof e != "string" || d(e) !== "form" ? !1 : typeof t.nodeName != "string" || typeof t.textContent != "string" || typeof t.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
|
|
557
|
+
// prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
|
|
558
|
+
// makes the direct read diverge from the cached read; a clean form
|
|
559
|
+
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
560
|
+
// canonical NamedNodeMap.
|
|
561
|
+
t.attributes !== Ct(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
|
|
562
|
+
// returns the integer 1 for any Element regardless of realm; direct
|
|
563
|
+
// read on a clobbered form (e.g. <input name="nodeType">) returns
|
|
564
|
+
// the named child element. Cheap addition — nodeType is read from
|
|
565
|
+
// an internal slot, no serialization cost — and removes a residual
|
|
566
|
+
// clobbering surface used by several mXSS / PI / comment branches
|
|
567
|
+
// in _sanitizeElements that compare currentNode.nodeType directly.
|
|
568
|
+
t.nodeType !== I(t) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
|
|
569
|
+
// "childNodes" shadows the prototype getter. Direct reads of
|
|
570
|
+
// form.childNodes from a clobbered form return the named child
|
|
571
|
+
// instead of the real NodeList, so any walk that reads it directly
|
|
572
|
+
// skips the form's real children. Compare the direct read to the
|
|
573
|
+
// cached Node.prototype getter — when the form's named-property
|
|
574
|
+
// getter intercepts the read, the two values differ and we flag
|
|
575
|
+
// the form. This catches every clobbering child type (input,
|
|
576
|
+
// select, etc.) regardless of whether the named child happens to
|
|
577
|
+
// carry a numeric .length, which a typeof-based probe would miss
|
|
578
|
+
// (e.g. HTMLSelectElement.length is a defined unsigned-long).
|
|
579
|
+
t.childNodes !== Q(t);
|
|
580
|
+
}, it = function(t) {
|
|
581
|
+
if (!I || typeof t != "object" || t === null)
|
|
582
|
+
return !1;
|
|
583
|
+
try {
|
|
584
|
+
return I(t) === P.documentFragment;
|
|
585
|
+
} catch {
|
|
586
|
+
return !1;
|
|
587
|
+
}
|
|
588
|
+
}, dt = function(t) {
|
|
589
|
+
if (!I || typeof t != "object" || t === null)
|
|
590
|
+
return !1;
|
|
591
|
+
try {
|
|
592
|
+
return typeof I(t) == "number";
|
|
593
|
+
} catch {
|
|
594
|
+
return !1;
|
|
595
|
+
}
|
|
381
596
|
};
|
|
382
|
-
function
|
|
383
|
-
|
|
384
|
-
|
|
597
|
+
function z(r, t, e) {
|
|
598
|
+
r.length !== 0 && at(r, (n) => {
|
|
599
|
+
n.call(i, t, e, rt);
|
|
385
600
|
});
|
|
386
601
|
}
|
|
387
|
-
const
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
if (
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
return !1;
|
|
400
|
-
if (Re && !w[o]) {
|
|
401
|
-
const f = ae(e) || e.parentNode, h = xt(e) || e.childNodes;
|
|
402
|
-
if (h && f) {
|
|
403
|
-
const p = h.length;
|
|
404
|
-
for (let D = p - 1; D >= 0; --D) {
|
|
405
|
-
const L = Mt(h[D], !0);
|
|
406
|
-
f.insertBefore(L, Pt(e));
|
|
407
|
-
}
|
|
602
|
+
const bn = function(t, e) {
|
|
603
|
+
return !!(W && t.hasChildNodes() && !dt(t.firstElementChild) && y(je, t.textContent) && y(je, t.innerHTML) || W && t.namespaceURI === F && e === "style" && dt(t.firstElementChild) || t.nodeType === P.processingInstruction || W && t.nodeType === P.comment && y($e, t.data));
|
|
604
|
+
}, On = function(t, e) {
|
|
605
|
+
if (!pt[e] && Ce(e) && (g.tagNameCheck instanceof RegExp && y(g.tagNameCheck, e) || g.tagNameCheck instanceof Function && g.tagNameCheck(e)))
|
|
606
|
+
return !1;
|
|
607
|
+
if (zt && !U[e]) {
|
|
608
|
+
const n = V(t), a = Q(t);
|
|
609
|
+
if (a && n) {
|
|
610
|
+
const l = a.length;
|
|
611
|
+
for (let u = l - 1; u >= 0; --u) {
|
|
612
|
+
const E = Ht ? a[u] : Ze(a[u], !0);
|
|
613
|
+
n.insertBefore(E, Je(t));
|
|
408
614
|
}
|
|
409
615
|
}
|
|
410
|
-
return C(e), !0;
|
|
411
616
|
}
|
|
412
|
-
return
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
617
|
+
return Y(t), !0;
|
|
618
|
+
}, Le = function(t, e) {
|
|
619
|
+
if (z(T.beforeSanitizeElements, t, null), t !== e && V(t) === null)
|
|
620
|
+
return !0;
|
|
621
|
+
if (Nt(t))
|
|
622
|
+
return Y(t), !0;
|
|
623
|
+
const n = d(v ? v(t) : t.nodeName);
|
|
624
|
+
if (z(T.uponSanitizeElement, t, {
|
|
625
|
+
tagName: n,
|
|
626
|
+
allowedTags: h
|
|
627
|
+
}), t !== e && V(t) === null)
|
|
628
|
+
return !0;
|
|
629
|
+
if (bn(t, n))
|
|
630
|
+
return Y(t), !0;
|
|
631
|
+
if (pt[n] || !(G.tagCheck instanceof Function && G.tagCheck(n)) && !h[n]) {
|
|
632
|
+
const l = On(t, n);
|
|
633
|
+
return l === !1 && z(T.afterSanitizeElements, t, null), l;
|
|
634
|
+
}
|
|
635
|
+
if ((I ? I(t) : t.nodeType) === P.element && !An(t) || (n === "noscript" || n === "noembed" || n === "noframes") && y(no, t.innerHTML))
|
|
636
|
+
return Y(t), !0;
|
|
637
|
+
if (B && t.nodeType === P.text) {
|
|
638
|
+
const l = Rt(t.textContent);
|
|
639
|
+
t.textContent !== l && (st(i.removed, {
|
|
640
|
+
element: t.cloneNode()
|
|
641
|
+
}), t.textContent = l);
|
|
642
|
+
}
|
|
643
|
+
return z(T.afterSanitizeElements, t, null), !1;
|
|
644
|
+
}, we = function(t, e, n) {
|
|
645
|
+
if (pe[e] || W && e === "patchsrc" || W && e === "for" && t !== "label" && t !== "output" || he && (e === "id" || e === "name") && (n in s || n in hn))
|
|
419
646
|
return !1;
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
430
|
-
t === "is" && m.allowCustomizedBuiltInElements && (m.tagNameCheck instanceof RegExp && g(m.tagNameCheck, o) || m.tagNameCheck instanceof Function && m.tagNameCheck(o)))
|
|
431
|
-
) return !1;
|
|
432
|
-
} else if (!ye[t]) {
|
|
433
|
-
if (!g(Be, Y(o, Ge, ""))) {
|
|
434
|
-
if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && dt(o, "data:") === 0 && Ze[e])) {
|
|
435
|
-
if (!(je && !g(Gt, Y(o, Ge, "")))) {
|
|
436
|
-
if (o)
|
|
647
|
+
const a = _[e] || G.attributeCheck instanceof Function && G.attributeCheck(e, t);
|
|
648
|
+
if (!(xt && y(ln, e))) {
|
|
649
|
+
if (!(me && y(cn, e))) {
|
|
650
|
+
if (a) {
|
|
651
|
+
if (!Bt[e]) {
|
|
652
|
+
if (!y(ce, Tt(n, le, ""))) {
|
|
653
|
+
if (!((e === "src" || e === "xlink:href" || e === "href") && t !== "script" && Ue(n, "data:") === 0 && Ee[t])) {
|
|
654
|
+
if (!(de && !y(un, Tt(n, le, "")))) {
|
|
655
|
+
if (n)
|
|
437
656
|
return !1;
|
|
438
657
|
}
|
|
439
658
|
}
|
|
440
659
|
}
|
|
441
660
|
}
|
|
442
|
-
}
|
|
661
|
+
} else if (
|
|
662
|
+
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
663
|
+
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
664
|
+
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
665
|
+
!(Ce(t) && (g.tagNameCheck instanceof RegExp && y(g.tagNameCheck, t) || g.tagNameCheck instanceof Function && g.tagNameCheck(t)) && (g.attributeNameCheck instanceof RegExp && y(g.attributeNameCheck, e) || g.attributeNameCheck instanceof Function && g.attributeNameCheck(e, t)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
666
|
+
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
667
|
+
e === "is" && g.allowCustomizedBuiltInElements && (g.tagNameCheck instanceof RegExp && y(g.tagNameCheck, n) || g.tagNameCheck instanceof Function && g.tagNameCheck(n)))
|
|
668
|
+
) return !1;
|
|
443
669
|
}
|
|
444
670
|
}
|
|
445
671
|
return !0;
|
|
446
|
-
},
|
|
447
|
-
return !
|
|
448
|
-
},
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
672
|
+
}, Rn = p({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), Ce = function(t) {
|
|
673
|
+
return !Rn[_t(t)] && y(fn, t);
|
|
674
|
+
}, Nn = function(t, e, n, a) {
|
|
675
|
+
if (w && typeof gt == "object" && typeof gt.getAttributeType == "function" && !n)
|
|
676
|
+
switch (gt.getAttributeType(t, e)) {
|
|
677
|
+
case "TrustedHTML":
|
|
678
|
+
return tt(a);
|
|
679
|
+
case "TrustedScriptURL":
|
|
680
|
+
return Qe(a);
|
|
681
|
+
}
|
|
682
|
+
return a;
|
|
683
|
+
}, In = function(t, e, n, a) {
|
|
684
|
+
try {
|
|
685
|
+
n ? t.setAttributeNS(n, e, a) : t.setAttribute(e, a), Nt(t) ? Y(t) : ke(i.removed);
|
|
686
|
+
} catch {
|
|
687
|
+
Z(e, t);
|
|
688
|
+
}
|
|
689
|
+
}, Me = function(t) {
|
|
690
|
+
z(T.beforeSanitizeAttributes, t, null);
|
|
691
|
+
const e = t.attributes;
|
|
692
|
+
if (!e || Nt(t))
|
|
454
693
|
return;
|
|
455
|
-
const
|
|
694
|
+
const n = {
|
|
456
695
|
attrName: "",
|
|
457
696
|
attrValue: "",
|
|
458
697
|
keepAttr: !0,
|
|
459
|
-
allowedAttributes:
|
|
698
|
+
allowedAttributes: _,
|
|
460
699
|
forceKeepAttr: void 0
|
|
461
700
|
};
|
|
462
|
-
let
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
let E = p === "value" ? we : tn(we);
|
|
470
|
-
if (o.attrName = M, o.attrValue = E, o.keepAttr = !0, o.forceKeepAttr = void 0, x(R.uponSanitizeAttribute, e, o), E = o.attrValue, qe && (M === "id" || M === "name") && dt(E, Ke) !== 0 && (F(p, e), E = Ke + E), Z && g(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, E)) {
|
|
471
|
-
F(p, e);
|
|
701
|
+
let a = e.length;
|
|
702
|
+
const l = d(t.nodeName);
|
|
703
|
+
for (; a--; ) {
|
|
704
|
+
const u = e[a], E = u.name, N = u.namespaceURI, x = u.value, C = d(E), k = x;
|
|
705
|
+
let D = E === "value" ? k : Fn(k);
|
|
706
|
+
if (n.attrName = C, n.attrValue = D, n.keepAttr = !0, n.forceKeepAttr = void 0, z(T.uponSanitizeAttribute, t, n), D = n.attrValue, _e && (C === "id" || C === "name") && Ue(D, ge) !== 0 && (Z(E, t), D = ge + D), W && y(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, D)) {
|
|
707
|
+
Z(E, t);
|
|
472
708
|
continue;
|
|
473
709
|
}
|
|
474
|
-
if (
|
|
475
|
-
|
|
710
|
+
if (C === "attributename" && ve(D, "href")) {
|
|
711
|
+
Z(E, t);
|
|
476
712
|
continue;
|
|
477
713
|
}
|
|
478
|
-
if (
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
714
|
+
if (!n.forceKeepAttr) {
|
|
715
|
+
if (!n.keepAttr) {
|
|
716
|
+
Z(E, t);
|
|
717
|
+
continue;
|
|
718
|
+
}
|
|
719
|
+
if (!Te && y(oo, D)) {
|
|
720
|
+
Z(E, t);
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
723
|
+
if (B && (D = Rt(D)), !we(l, C, D)) {
|
|
724
|
+
Z(E, t);
|
|
725
|
+
continue;
|
|
726
|
+
}
|
|
727
|
+
D = Nn(l, C, N, D), D !== k && In(t, E, N, D);
|
|
483
728
|
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
729
|
+
}
|
|
730
|
+
z(T.afterSanitizeAttributes, t, null);
|
|
731
|
+
}, It = function(t) {
|
|
732
|
+
let e = null;
|
|
733
|
+
const n = De(t);
|
|
734
|
+
for (z(T.beforeSanitizeShadowDOM, t, null); e = n.nextNode(); )
|
|
735
|
+
if (z(T.uponSanitizeShadowNode, e, null), Le(e, t), Me(e), it(e.content) && It(e.content), (I ? I(e) : e.nodeType) === P.element) {
|
|
736
|
+
const l = re(e);
|
|
737
|
+
it(l) && (Kt(l), It(l));
|
|
487
738
|
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
739
|
+
z(T.afterSanitizeShadowDOM, t, null);
|
|
740
|
+
}, Kt = function(t) {
|
|
741
|
+
const e = [{
|
|
742
|
+
node: t,
|
|
743
|
+
shadow: null
|
|
744
|
+
}];
|
|
745
|
+
for (; e.length > 0; ) {
|
|
746
|
+
const n = e.pop();
|
|
747
|
+
if (n.shadow) {
|
|
748
|
+
It(n.shadow);
|
|
494
749
|
continue;
|
|
495
750
|
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
F(p, e);
|
|
751
|
+
const a = n.node, u = (I ? I(a) : a.nodeType) === P.element, E = Q(a);
|
|
752
|
+
if (E)
|
|
753
|
+
for (let N = E.length - 1; N >= 0; --N)
|
|
754
|
+
e.push({
|
|
755
|
+
node: E[N],
|
|
756
|
+
shadow: null
|
|
757
|
+
});
|
|
758
|
+
if (u) {
|
|
759
|
+
const N = v ? v(a) : null;
|
|
760
|
+
if (typeof N == "string" && d(N) === "template") {
|
|
761
|
+
const x = a.content;
|
|
762
|
+
it(x) && e.push({
|
|
763
|
+
node: x,
|
|
764
|
+
shadow: null
|
|
765
|
+
});
|
|
512
766
|
}
|
|
767
|
+
}
|
|
768
|
+
if (u) {
|
|
769
|
+
const N = re(a);
|
|
770
|
+
it(N) && e.push({
|
|
771
|
+
node: null,
|
|
772
|
+
shadow: N
|
|
773
|
+
}, {
|
|
774
|
+
node: N,
|
|
775
|
+
shadow: null
|
|
776
|
+
});
|
|
777
|
+
}
|
|
513
778
|
}
|
|
514
|
-
x(R.afterSanitizeAttributes, e, null);
|
|
515
|
-
}, ct = function(e) {
|
|
516
|
-
let t = null;
|
|
517
|
-
const o = it(e);
|
|
518
|
-
for (x(R.beforeSanitizeShadowDOM, e, null); t = o.nextNode(); )
|
|
519
|
-
x(R.uponSanitizeShadowNode, t, null), rt(t), lt(t), t.content instanceof b && ct(t.content);
|
|
520
|
-
x(R.afterSanitizeShadowDOM, e, null);
|
|
521
779
|
};
|
|
522
|
-
return
|
|
523
|
-
let
|
|
524
|
-
if (
|
|
525
|
-
throw
|
|
526
|
-
if (!
|
|
780
|
+
return i.sanitize = function(r) {
|
|
781
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = null, n = null, a = null, l = null;
|
|
782
|
+
if (Wt = !r, Wt && (r = "<!-->"), typeof r != "string" && !dt(r) && (r = Wn(r), typeof r != "string"))
|
|
783
|
+
throw J("dirty is not a string, aborting");
|
|
784
|
+
if (!i.isSupported)
|
|
527
785
|
return r;
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
786
|
+
kt ? (h = vt, _ = Ut) : Xt(t), (T.uponSanitizeElement.length > 0 || T.uponSanitizeAttribute.length > 0) && (h = L(h)), T.uponSanitizeAttribute.length > 0 && (_ = L(_)), i.removed = [];
|
|
787
|
+
const u = Ht && typeof r != "string" && dt(r);
|
|
788
|
+
if (u) {
|
|
789
|
+
Sn(r);
|
|
790
|
+
const C = v ? v(r) : r.nodeName;
|
|
791
|
+
if (typeof C == "string") {
|
|
792
|
+
const k = d(C);
|
|
793
|
+
if (!h[k] || pt[k])
|
|
794
|
+
throw Ot(r), J("root node is forbidden and cannot be sanitized in-place");
|
|
795
|
+
}
|
|
796
|
+
if (Nt(r))
|
|
797
|
+
throw Ot(r), J("root node is clobbered and cannot be sanitized in-place");
|
|
798
|
+
try {
|
|
799
|
+
Kt(r);
|
|
800
|
+
} catch (k) {
|
|
801
|
+
throw Ot(r), k;
|
|
534
802
|
}
|
|
535
|
-
} else if (r
|
|
536
|
-
|
|
803
|
+
} else if (dt(r))
|
|
804
|
+
e = Ie("<!---->"), n = e.ownerDocument.importNode(r, !0), n.nodeType === P.element && n.nodeName === "BODY" || n.nodeName === "HTML" ? e = n : e.appendChild(n), Kt(n);
|
|
537
805
|
else {
|
|
538
|
-
if (!
|
|
806
|
+
if (!et && !B && !K && // eslint-disable-next-line unicorn/prefer-includes
|
|
539
807
|
r.indexOf("<") === -1)
|
|
540
|
-
return
|
|
541
|
-
if (
|
|
542
|
-
return
|
|
808
|
+
return w && yt ? tt(r) : r;
|
|
809
|
+
if (e = Ie(r), !e)
|
|
810
|
+
return et ? null : yt ? q : "";
|
|
543
811
|
}
|
|
544
|
-
|
|
545
|
-
const
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
812
|
+
e && Ft && Y(e.firstChild);
|
|
813
|
+
const E = u ? r : e, N = De(E);
|
|
814
|
+
try {
|
|
815
|
+
for (; a = N.nextNode(); )
|
|
816
|
+
Le(a, E), Me(a), it(a.content) && It(a.content);
|
|
817
|
+
} catch (C) {
|
|
818
|
+
throw u && (Ot(r), at(i.removed, (k) => {
|
|
819
|
+
k.element && Vt(k.element);
|
|
820
|
+
})), C;
|
|
821
|
+
}
|
|
822
|
+
if (u)
|
|
823
|
+
return at(i.removed, (C) => {
|
|
824
|
+
C.element && Vt(C.element);
|
|
825
|
+
}), B && qt(r), r;
|
|
826
|
+
if (et) {
|
|
827
|
+
if (B && qt(e), At)
|
|
828
|
+
for (l = en.call(e.ownerDocument); e.firstChild; )
|
|
829
|
+
l.appendChild(e.firstChild);
|
|
561
830
|
else
|
|
562
|
-
|
|
563
|
-
return (
|
|
831
|
+
l = e;
|
|
832
|
+
return (_.shadowroot || _.shadowrootmode) && (l = on.call(c, l, !0)), l;
|
|
564
833
|
}
|
|
565
|
-
let
|
|
566
|
-
return
|
|
567
|
-
` +
|
|
568
|
-
|
|
569
|
-
}), S && me ? S.createHTML(D) : D;
|
|
570
|
-
}, n.setConfig = function() {
|
|
834
|
+
let x = K ? e.outerHTML : e.innerHTML;
|
|
835
|
+
return K && h["!doctype"] && e.ownerDocument && e.ownerDocument.doctype && e.ownerDocument.doctype.name && y(to, e.ownerDocument.doctype.name) && (x = "<!DOCTYPE " + e.ownerDocument.doctype.name + `>
|
|
836
|
+
` + x), B && (x = Rt(x)), w && yt ? tt(x) : x;
|
|
837
|
+
}, i.setConfig = function() {
|
|
571
838
|
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
572
|
-
|
|
573
|
-
},
|
|
574
|
-
|
|
575
|
-
},
|
|
576
|
-
|
|
577
|
-
const
|
|
578
|
-
return
|
|
579
|
-
},
|
|
580
|
-
typeof
|
|
581
|
-
},
|
|
582
|
-
if (
|
|
583
|
-
|
|
584
|
-
|
|
839
|
+
Xt(r), kt = !0, vt = h, Ut = _;
|
|
840
|
+
}, i.clearConfig = function() {
|
|
841
|
+
rt = null, kt = !1, vt = null, Ut = null, w = Mt, q = "";
|
|
842
|
+
}, i.isValidAttribute = function(r, t, e) {
|
|
843
|
+
rt || Xt({});
|
|
844
|
+
const n = d(r), a = d(t);
|
|
845
|
+
return we(n, a, e);
|
|
846
|
+
}, i.addHook = function(r, t) {
|
|
847
|
+
typeof t == "function" && S(T, r) && st(T[r], t);
|
|
848
|
+
}, i.removeHook = function(r, t) {
|
|
849
|
+
if (S(T, r)) {
|
|
850
|
+
if (t !== void 0) {
|
|
851
|
+
const e = vn(T[r], t);
|
|
852
|
+
return e === -1 ? void 0 : Un(T[r], e, 1)[0];
|
|
853
|
+
}
|
|
854
|
+
return ke(T[r]);
|
|
585
855
|
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
}, n;
|
|
856
|
+
}, i.removeHooks = function(r) {
|
|
857
|
+
S(T, r) && (T[r] = []);
|
|
858
|
+
}, i.removeAllHooks = function() {
|
|
859
|
+
T = Xe();
|
|
860
|
+
}, i;
|
|
592
861
|
}
|
|
593
|
-
var
|
|
862
|
+
var ao = Ke();
|
|
594
863
|
export {
|
|
595
|
-
|
|
864
|
+
ao as default
|
|
596
865
|
};
|
|
597
866
|
//# sourceMappingURL=purify.es.js.map
|