@commercetools/nimbus 0.0.0-canary-20251013204307 → 0.0.0-canary-20251014070008
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.
|
@@ -1,131 +1,131 @@
|
|
|
1
|
-
import { DEFAULT_FORBIDDEN_TAGS as
|
|
2
|
-
/*! @license DOMPurify 3.
|
|
1
|
+
import { DEFAULT_FORBIDDEN_TAGS as Yt } from "./constants.es.js";
|
|
2
|
+
/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */
|
|
3
3
|
const {
|
|
4
|
-
entries:
|
|
5
|
-
setPrototypeOf:
|
|
6
|
-
isFrozen:
|
|
7
|
-
getPrototypeOf:
|
|
8
|
-
getOwnPropertyDescriptor:
|
|
4
|
+
entries: _t,
|
|
5
|
+
setPrototypeOf: ct,
|
|
6
|
+
isFrozen: Xt,
|
|
7
|
+
getPrototypeOf: jt,
|
|
8
|
+
getOwnPropertyDescriptor: Vt
|
|
9
9
|
} = Object;
|
|
10
10
|
let {
|
|
11
11
|
freeze: R,
|
|
12
12
|
seal: y,
|
|
13
|
-
create:
|
|
13
|
+
create: Pe
|
|
14
14
|
} = Object, {
|
|
15
|
-
apply:
|
|
16
|
-
construct:
|
|
15
|
+
apply: ve,
|
|
16
|
+
construct: ke
|
|
17
17
|
} = typeof Reflect < "u" && Reflect;
|
|
18
|
-
R || (R = function(
|
|
19
|
-
return
|
|
18
|
+
R || (R = function(o) {
|
|
19
|
+
return o;
|
|
20
20
|
});
|
|
21
|
-
y || (y = function(
|
|
22
|
-
return
|
|
21
|
+
y || (y = function(o) {
|
|
22
|
+
return o;
|
|
23
23
|
});
|
|
24
|
-
|
|
24
|
+
ve || (ve = function(o, l) {
|
|
25
25
|
for (var a = arguments.length, c = new Array(a > 2 ? a - 2 : 0), _ = 2; _ < a; _++)
|
|
26
26
|
c[_ - 2] = arguments[_];
|
|
27
|
-
return
|
|
27
|
+
return o.apply(l, c);
|
|
28
28
|
});
|
|
29
|
-
|
|
29
|
+
ke || (ke = function(o) {
|
|
30
30
|
for (var l = arguments.length, a = new Array(l > 1 ? l - 1 : 0), c = 1; c < l; c++)
|
|
31
31
|
a[c - 1] = arguments[c];
|
|
32
|
-
return new
|
|
32
|
+
return new o(...a);
|
|
33
33
|
});
|
|
34
|
-
const
|
|
34
|
+
const ce = /* @__PURE__ */ O(Array.prototype.forEach), $t = /* @__PURE__ */ O(Array.prototype.lastIndexOf), ft = /* @__PURE__ */ O(Array.prototype.pop), q = /* @__PURE__ */ O(Array.prototype.push), qt = /* @__PURE__ */ O(Array.prototype.splice), ue = /* @__PURE__ */ O(String.prototype.toLowerCase), Ie = /* @__PURE__ */ O(String.prototype.toString), Ne = /* @__PURE__ */ O(String.prototype.match), K = /* @__PURE__ */ O(String.prototype.replace), Kt = /* @__PURE__ */ O(String.prototype.indexOf), Zt = /* @__PURE__ */ O(String.prototype.trim), D = /* @__PURE__ */ O(Object.prototype.hasOwnProperty), S = /* @__PURE__ */ O(RegExp.prototype.test), Z = /* @__PURE__ */ Jt(TypeError);
|
|
35
35
|
function O(r) {
|
|
36
|
-
return function(
|
|
37
|
-
|
|
36
|
+
return function(o) {
|
|
37
|
+
o instanceof RegExp && (o.lastIndex = 0);
|
|
38
38
|
for (var l = arguments.length, a = new Array(l > 1 ? l - 1 : 0), c = 1; c < l; c++)
|
|
39
39
|
a[c - 1] = arguments[c];
|
|
40
|
-
return
|
|
40
|
+
return ve(r, o, a);
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function Jt(r) {
|
|
44
44
|
return function() {
|
|
45
|
-
for (var
|
|
45
|
+
for (var o = arguments.length, l = new Array(o), a = 0; a < o; a++)
|
|
46
46
|
l[a] = arguments[a];
|
|
47
|
-
return
|
|
47
|
+
return ke(r, l);
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
function s(r,
|
|
51
|
-
let l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
52
|
-
|
|
53
|
-
let a =
|
|
50
|
+
function s(r, o) {
|
|
51
|
+
let l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ue;
|
|
52
|
+
ct && ct(r, null);
|
|
53
|
+
let a = o.length;
|
|
54
54
|
for (; a--; ) {
|
|
55
|
-
let c =
|
|
55
|
+
let c = o[a];
|
|
56
56
|
if (typeof c == "string") {
|
|
57
57
|
const _ = l(c);
|
|
58
|
-
_ !== c && (
|
|
58
|
+
_ !== c && (Xt(o) || (o[a] = _), c = _);
|
|
59
59
|
}
|
|
60
60
|
r[c] = !0;
|
|
61
61
|
}
|
|
62
62
|
return r;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
for (let
|
|
66
|
-
D(r,
|
|
64
|
+
function Qt(r) {
|
|
65
|
+
for (let o = 0; o < r.length; o++)
|
|
66
|
+
D(r, o) || (r[o] = null);
|
|
67
67
|
return r;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
const
|
|
71
|
-
for (const [l, a] of
|
|
72
|
-
D(r, l) && (Array.isArray(a) ?
|
|
73
|
-
return
|
|
69
|
+
function M(r) {
|
|
70
|
+
const o = Pe(null);
|
|
71
|
+
for (const [l, a] of _t(r))
|
|
72
|
+
D(r, l) && (Array.isArray(a) ? o[l] = Qt(a) : a && typeof a == "object" && a.constructor === Object ? o[l] = M(a) : o[l] = a);
|
|
73
|
+
return o;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function J(r, o) {
|
|
76
76
|
for (; r !== null; ) {
|
|
77
|
-
const a =
|
|
77
|
+
const a = Vt(r, o);
|
|
78
78
|
if (a) {
|
|
79
79
|
if (a.get)
|
|
80
80
|
return O(a.get);
|
|
81
81
|
if (typeof a.value == "function")
|
|
82
82
|
return O(a.value);
|
|
83
83
|
}
|
|
84
|
-
r =
|
|
84
|
+
r = jt(r);
|
|
85
85
|
}
|
|
86
86
|
function l() {
|
|
87
87
|
return null;
|
|
88
88
|
}
|
|
89
89
|
return l;
|
|
90
90
|
}
|
|
91
|
-
const
|
|
91
|
+
const ut = /* @__PURE__ */ R(["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"]), Ce = /* @__PURE__ */ R(["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"]), Me = /* @__PURE__ */ R(["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"]), en = /* @__PURE__ */ R(["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"]), we = /* @__PURE__ */ R(["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"]), tn = /* @__PURE__ */ R(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), mt = /* @__PURE__ */ R(["#text"]), pt = /* @__PURE__ */ R(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "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", "slot"]), xe = /* @__PURE__ */ R(["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"]), dt = /* @__PURE__ */ R(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "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"]), fe = /* @__PURE__ */ R(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), nn = /* @__PURE__ */ y(/\{\{[\w\W]*|[\w\W]*\}\}/gm), on = /* @__PURE__ */ y(/<%[\w\W]*|[\w\W]*%>/gm), an = /* @__PURE__ */ y(/\$\{[\w\W]*/gm), rn = /* @__PURE__ */ y(/^data-[\-\w.\u00B7-\uFFFF]+$/), sn = /* @__PURE__ */ y(/^aria-[\-\w]+$/), At = /* @__PURE__ */ y(
|
|
92
92
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
93
93
|
// eslint-disable-line no-useless-escape
|
|
94
|
-
),
|
|
94
|
+
), ln = /* @__PURE__ */ y(/^(?:\w+script|data):/i), cn = /* @__PURE__ */ y(
|
|
95
95
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
96
96
|
// eslint-disable-line no-control-regex
|
|
97
|
-
), gt = /* @__PURE__ */ y(/^html$/i),
|
|
98
|
-
var
|
|
97
|
+
), gt = /* @__PURE__ */ y(/^html$/i), fn = /* @__PURE__ */ y(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
98
|
+
var Tt = /* @__PURE__ */ Object.freeze({
|
|
99
99
|
__proto__: null,
|
|
100
|
-
ARIA_ATTR:
|
|
101
|
-
ATTR_WHITESPACE:
|
|
102
|
-
CUSTOM_ELEMENT:
|
|
103
|
-
DATA_ATTR:
|
|
100
|
+
ARIA_ATTR: sn,
|
|
101
|
+
ATTR_WHITESPACE: cn,
|
|
102
|
+
CUSTOM_ELEMENT: fn,
|
|
103
|
+
DATA_ATTR: rn,
|
|
104
104
|
DOCTYPE_NAME: gt,
|
|
105
|
-
ERB_EXPR:
|
|
106
|
-
IS_ALLOWED_URI:
|
|
107
|
-
IS_SCRIPT_OR_DATA:
|
|
108
|
-
MUSTACHE_EXPR:
|
|
109
|
-
TMPLIT_EXPR:
|
|
105
|
+
ERB_EXPR: on,
|
|
106
|
+
IS_ALLOWED_URI: At,
|
|
107
|
+
IS_SCRIPT_OR_DATA: ln,
|
|
108
|
+
MUSTACHE_EXPR: nn,
|
|
109
|
+
TMPLIT_EXPR: an
|
|
110
110
|
});
|
|
111
|
-
const
|
|
111
|
+
const Q = {
|
|
112
112
|
element: 1,
|
|
113
113
|
text: 3,
|
|
114
114
|
// Deprecated
|
|
115
115
|
progressingInstruction: 7,
|
|
116
116
|
comment: 8,
|
|
117
117
|
document: 9
|
|
118
|
-
},
|
|
118
|
+
}, un = function() {
|
|
119
119
|
return typeof window > "u" ? null : window;
|
|
120
|
-
},
|
|
121
|
-
if (typeof
|
|
120
|
+
}, mn = function(o, l) {
|
|
121
|
+
if (typeof o != "object" || typeof o.createPolicy != "function")
|
|
122
122
|
return null;
|
|
123
123
|
let a = null;
|
|
124
124
|
const c = "data-tt-policy-suffix";
|
|
125
125
|
l && l.hasAttribute(c) && (a = l.getAttribute(c));
|
|
126
126
|
const _ = "dompurify" + (a ? "#" + a : "");
|
|
127
127
|
try {
|
|
128
|
-
return
|
|
128
|
+
return o.createPolicy(_, {
|
|
129
129
|
createHTML(w) {
|
|
130
130
|
return w;
|
|
131
131
|
},
|
|
@@ -136,7 +136,7 @@ const J = {
|
|
|
136
136
|
} catch {
|
|
137
137
|
return console.warn("TrustedTypes policy " + _ + " could not be created."), null;
|
|
138
138
|
}
|
|
139
|
-
},
|
|
139
|
+
}, Et = function() {
|
|
140
140
|
return {
|
|
141
141
|
afterSanitizeAttributes: [],
|
|
142
142
|
afterSanitizeElements: [],
|
|
@@ -149,57 +149,57 @@ const J = {
|
|
|
149
149
|
uponSanitizeShadowNode: []
|
|
150
150
|
};
|
|
151
151
|
};
|
|
152
|
-
function
|
|
153
|
-
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
154
|
-
const
|
|
155
|
-
if (
|
|
156
|
-
return
|
|
152
|
+
function ht() {
|
|
153
|
+
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : un();
|
|
154
|
+
const o = (i) => ht(i);
|
|
155
|
+
if (o.version = "3.3.0", o.removed = [], !r || !r.document || r.document.nodeType !== Q.document || !r.Element)
|
|
156
|
+
return o.isSupported = !1, o;
|
|
157
157
|
let {
|
|
158
158
|
document: l
|
|
159
159
|
} = r;
|
|
160
160
|
const a = l, c = a.currentScript, {
|
|
161
161
|
DocumentFragment: _,
|
|
162
162
|
HTMLTemplateElement: w,
|
|
163
|
-
Node:
|
|
164
|
-
Element:
|
|
165
|
-
NodeFilter:
|
|
166
|
-
NamedNodeMap:
|
|
167
|
-
HTMLFormElement:
|
|
168
|
-
DOMParser:
|
|
169
|
-
trustedTypes:
|
|
170
|
-
} = r,
|
|
163
|
+
Node: me,
|
|
164
|
+
Element: Ue,
|
|
165
|
+
NodeFilter: B,
|
|
166
|
+
NamedNodeMap: St = r.NamedNodeMap || r.MozNamedAttrMap,
|
|
167
|
+
HTMLFormElement: Rt,
|
|
168
|
+
DOMParser: Ot,
|
|
169
|
+
trustedTypes: ee
|
|
170
|
+
} = r, Y = Ue.prototype, bt = J(Y, "cloneNode"), yt = J(Y, "remove"), Dt = J(Y, "nextSibling"), Lt = J(Y, "childNodes"), te = J(Y, "parentNode");
|
|
171
171
|
if (typeof w == "function") {
|
|
172
172
|
const i = l.createElement("template");
|
|
173
173
|
i.content && i.content.ownerDocument && (l = i.content.ownerDocument);
|
|
174
174
|
}
|
|
175
|
-
let
|
|
175
|
+
let g, X = "";
|
|
176
176
|
const {
|
|
177
|
-
implementation:
|
|
178
|
-
createNodeIterator:
|
|
179
|
-
createDocumentFragment:
|
|
180
|
-
getElementsByTagName:
|
|
177
|
+
implementation: pe,
|
|
178
|
+
createNodeIterator: It,
|
|
179
|
+
createDocumentFragment: Nt,
|
|
180
|
+
getElementsByTagName: Ct
|
|
181
181
|
} = l, {
|
|
182
182
|
importNode: Mt
|
|
183
183
|
} = a;
|
|
184
|
-
let h =
|
|
185
|
-
|
|
184
|
+
let h = Et();
|
|
185
|
+
o.isSupported = typeof _t == "function" && typeof te == "function" && pe && pe.createHTMLDocument !== void 0;
|
|
186
186
|
const {
|
|
187
|
-
MUSTACHE_EXPR:
|
|
188
|
-
ERB_EXPR:
|
|
189
|
-
TMPLIT_EXPR:
|
|
190
|
-
DATA_ATTR:
|
|
191
|
-
ARIA_ATTR:
|
|
192
|
-
IS_SCRIPT_OR_DATA:
|
|
193
|
-
ATTR_WHITESPACE:
|
|
194
|
-
CUSTOM_ELEMENT:
|
|
195
|
-
} =
|
|
187
|
+
MUSTACHE_EXPR: de,
|
|
188
|
+
ERB_EXPR: Te,
|
|
189
|
+
TMPLIT_EXPR: Ee,
|
|
190
|
+
DATA_ATTR: wt,
|
|
191
|
+
ARIA_ATTR: xt,
|
|
192
|
+
IS_SCRIPT_OR_DATA: Pt,
|
|
193
|
+
ATTR_WHITESPACE: Fe,
|
|
194
|
+
CUSTOM_ELEMENT: vt
|
|
195
|
+
} = Tt;
|
|
196
196
|
let {
|
|
197
|
-
IS_ALLOWED_URI:
|
|
198
|
-
} =
|
|
199
|
-
const
|
|
197
|
+
IS_ALLOWED_URI: He
|
|
198
|
+
} = Tt, p = null;
|
|
199
|
+
const ze = s({}, [...ut, ...Ce, ...Me, ...we, ...mt]);
|
|
200
200
|
let T = null;
|
|
201
|
-
const
|
|
202
|
-
let u = Object.seal(
|
|
201
|
+
const Ge = s({}, [...pt, ...xe, ...dt, ...fe]);
|
|
202
|
+
let u = Object.seal(Pe(null, {
|
|
203
203
|
tagNameCheck: {
|
|
204
204
|
writable: !0,
|
|
205
205
|
configurable: !1,
|
|
@@ -218,70 +218,85 @@ function At() {
|
|
|
218
218
|
enumerable: !0,
|
|
219
219
|
value: !1
|
|
220
220
|
}
|
|
221
|
-
})),
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
221
|
+
})), j = null, _e = null;
|
|
222
|
+
const v = Object.seal(Pe(null, {
|
|
223
|
+
tagCheck: {
|
|
224
|
+
writable: !0,
|
|
225
|
+
configurable: !1,
|
|
226
|
+
enumerable: !0,
|
|
227
|
+
value: null
|
|
228
|
+
},
|
|
229
|
+
attributeCheck: {
|
|
230
|
+
writable: !0,
|
|
231
|
+
configurable: !1,
|
|
232
|
+
enumerable: !0,
|
|
233
|
+
value: null
|
|
234
|
+
}
|
|
235
|
+
}));
|
|
236
|
+
let We = !0, Ae = !0, Be = !1, Ye = !0, k = !1, ne = !0, x = !1, ge = !1, he = !1, U = !1, oe = !1, ie = !1, Xe = !0, je = !1;
|
|
237
|
+
const kt = "user-content-";
|
|
238
|
+
let Se = !0, V = !1, F = {}, H = null;
|
|
239
|
+
const Ve = s({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
240
|
+
let $e = null;
|
|
241
|
+
const qe = s({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
242
|
+
let Re = null;
|
|
243
|
+
const Ke = s({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ae = "http://www.w3.org/1998/Math/MathML", re = "http://www.w3.org/2000/svg", I = "http://www.w3.org/1999/xhtml";
|
|
244
|
+
let z = I, Oe = !1, be = null;
|
|
245
|
+
const Ut = s({}, [ae, re, I], Ie);
|
|
246
|
+
let se = s({}, ["mi", "mo", "mn", "ms", "mtext"]), le = s({}, ["annotation-xml"]);
|
|
247
|
+
const Ft = s({}, ["title", "style", "font", "a", "script"]);
|
|
248
|
+
let $ = null;
|
|
249
|
+
const Ht = ["application/xhtml+xml", "text/html"], zt = "text/html";
|
|
250
|
+
let d = null, G = null;
|
|
251
|
+
const Gt = l.createElement("form"), Ze = function(e) {
|
|
237
252
|
return e instanceof RegExp || e instanceof Function;
|
|
238
|
-
},
|
|
253
|
+
}, ye = function() {
|
|
239
254
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
240
|
-
if (!(
|
|
241
|
-
if ((!e || typeof e != "object") && (e = {}), e =
|
|
242
|
-
|
|
255
|
+
if (!(G && G === e)) {
|
|
256
|
+
if ((!e || typeof e != "object") && (e = {}), e = M(e), $ = // eslint-disable-next-line unicorn/prefer-includes
|
|
257
|
+
Ht.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? zt : e.PARSER_MEDIA_TYPE, d = $ === "application/xhtml+xml" ? Ie : ue, p = D(e, "ALLOWED_TAGS") ? s({}, e.ALLOWED_TAGS, d) : ze, T = D(e, "ALLOWED_ATTR") ? s({}, e.ALLOWED_ATTR, d) : Ge, be = D(e, "ALLOWED_NAMESPACES") ? s({}, e.ALLOWED_NAMESPACES, Ie) : Ut, Re = D(e, "ADD_URI_SAFE_ATTR") ? s(M(Ke), e.ADD_URI_SAFE_ATTR, d) : Ke, $e = D(e, "ADD_DATA_URI_TAGS") ? s(M(qe), e.ADD_DATA_URI_TAGS, d) : qe, H = D(e, "FORBID_CONTENTS") ? s({}, e.FORBID_CONTENTS, d) : Ve, j = D(e, "FORBID_TAGS") ? s({}, e.FORBID_TAGS, d) : M({}), _e = D(e, "FORBID_ATTR") ? s({}, e.FORBID_ATTR, d) : M({}), F = D(e, "USE_PROFILES") ? e.USE_PROFILES : !1, We = e.ALLOW_ARIA_ATTR !== !1, Ae = e.ALLOW_DATA_ATTR !== !1, Be = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ye = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, k = e.SAFE_FOR_TEMPLATES || !1, ne = e.SAFE_FOR_XML !== !1, x = e.WHOLE_DOCUMENT || !1, U = e.RETURN_DOM || !1, oe = e.RETURN_DOM_FRAGMENT || !1, ie = e.RETURN_TRUSTED_TYPE || !1, he = e.FORCE_BODY || !1, Xe = e.SANITIZE_DOM !== !1, je = e.SANITIZE_NAMED_PROPS || !1, Se = e.KEEP_CONTENT !== !1, V = e.IN_PLACE || !1, He = e.ALLOWED_URI_REGEXP || At, z = e.NAMESPACE || I, se = e.MATHML_TEXT_INTEGRATION_POINTS || se, le = e.HTML_INTEGRATION_POINTS || le, u = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && Ze(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (u.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && Ze(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (u.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (u.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), k && (Ae = !1), oe && (U = !0), F && (p = s({}, mt), T = [], F.html === !0 && (s(p, ut), s(T, pt)), F.svg === !0 && (s(p, Ce), s(T, xe), s(T, fe)), F.svgFilters === !0 && (s(p, Me), s(T, xe), s(T, fe)), F.mathMl === !0 && (s(p, we), s(T, dt), s(T, fe))), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? v.tagCheck = e.ADD_TAGS : (p === ze && (p = M(p)), s(p, e.ADD_TAGS, d))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? v.attributeCheck = e.ADD_ATTR : (T === Ge && (T = M(T)), s(T, e.ADD_ATTR, d))), e.ADD_URI_SAFE_ATTR && s(Re, e.ADD_URI_SAFE_ATTR, d), e.FORBID_CONTENTS && (H === Ve && (H = M(H)), s(H, e.FORBID_CONTENTS, d)), Se && (p["#text"] = !0), x && s(p, ["html", "head", "body"]), p.table && (s(p, ["tbody"]), delete j.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
243
258
|
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
244
|
-
throw
|
|
259
|
+
throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
245
260
|
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
246
|
-
throw
|
|
247
|
-
|
|
261
|
+
throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
262
|
+
g = e.TRUSTED_TYPES_POLICY, X = g.createHTML("");
|
|
248
263
|
} else
|
|
249
|
-
|
|
250
|
-
R && R(e),
|
|
264
|
+
g === void 0 && (g = mn(ee, c)), g !== null && typeof X == "string" && (X = g.createHTML(""));
|
|
265
|
+
R && R(e), G = e;
|
|
251
266
|
}
|
|
252
|
-
},
|
|
253
|
-
let t =
|
|
267
|
+
}, Je = s({}, [...Ce, ...Me, ...en]), Qe = s({}, [...we, ...tn]), Wt = function(e) {
|
|
268
|
+
let t = te(e);
|
|
254
269
|
(!t || !t.tagName) && (t = {
|
|
255
|
-
namespaceURI:
|
|
270
|
+
namespaceURI: z,
|
|
256
271
|
tagName: "template"
|
|
257
272
|
});
|
|
258
|
-
const
|
|
259
|
-
return
|
|
260
|
-
},
|
|
261
|
-
|
|
273
|
+
const n = ue(e.tagName), f = ue(t.tagName);
|
|
274
|
+
return be[e.namespaceURI] ? e.namespaceURI === re ? t.namespaceURI === I ? n === "svg" : t.namespaceURI === ae ? n === "svg" && (f === "annotation-xml" || se[f]) : !!Je[n] : e.namespaceURI === ae ? t.namespaceURI === I ? n === "math" : t.namespaceURI === re ? n === "math" && le[f] : !!Qe[n] : e.namespaceURI === I ? t.namespaceURI === re && !le[f] || t.namespaceURI === ae && !se[f] ? !1 : !Qe[n] && (Ft[n] || !Je[n]) : !!($ === "application/xhtml+xml" && be[e.namespaceURI]) : !1;
|
|
275
|
+
}, L = function(e) {
|
|
276
|
+
q(o.removed, {
|
|
262
277
|
element: e
|
|
263
278
|
});
|
|
264
279
|
try {
|
|
265
|
-
|
|
280
|
+
te(e).removeChild(e);
|
|
266
281
|
} catch {
|
|
267
|
-
|
|
282
|
+
yt(e);
|
|
268
283
|
}
|
|
269
284
|
}, P = function(e, t) {
|
|
270
285
|
try {
|
|
271
|
-
|
|
286
|
+
q(o.removed, {
|
|
272
287
|
attribute: t.getAttributeNode(e),
|
|
273
288
|
from: t
|
|
274
289
|
});
|
|
275
290
|
} catch {
|
|
276
|
-
|
|
291
|
+
q(o.removed, {
|
|
277
292
|
attribute: null,
|
|
278
293
|
from: t
|
|
279
294
|
});
|
|
280
295
|
}
|
|
281
296
|
if (t.removeAttribute(e), e === "is")
|
|
282
|
-
if (U ||
|
|
297
|
+
if (U || oe)
|
|
283
298
|
try {
|
|
284
|
-
|
|
299
|
+
L(t);
|
|
285
300
|
} catch {
|
|
286
301
|
}
|
|
287
302
|
else
|
|
@@ -289,98 +304,100 @@ function At() {
|
|
|
289
304
|
t.setAttribute(e, "");
|
|
290
305
|
} catch {
|
|
291
306
|
}
|
|
292
|
-
},
|
|
293
|
-
let t = null,
|
|
294
|
-
if (
|
|
307
|
+
}, et = function(e) {
|
|
308
|
+
let t = null, n = null;
|
|
309
|
+
if (he)
|
|
295
310
|
e = "<remove></remove>" + e;
|
|
296
311
|
else {
|
|
297
|
-
const m =
|
|
298
|
-
|
|
312
|
+
const m = Ne(e, /^[\r\n\t ]+/);
|
|
313
|
+
n = m && m[0];
|
|
299
314
|
}
|
|
300
|
-
|
|
301
|
-
const f =
|
|
302
|
-
if (
|
|
315
|
+
$ === "application/xhtml+xml" && z === I && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
|
|
316
|
+
const f = g ? g.createHTML(e) : e;
|
|
317
|
+
if (z === I)
|
|
303
318
|
try {
|
|
304
|
-
t = new
|
|
319
|
+
t = new Ot().parseFromString(f, $);
|
|
305
320
|
} catch {
|
|
306
321
|
}
|
|
307
322
|
if (!t || !t.documentElement) {
|
|
308
|
-
t =
|
|
323
|
+
t = pe.createDocument(z, "template", null);
|
|
309
324
|
try {
|
|
310
|
-
t.documentElement.innerHTML =
|
|
325
|
+
t.documentElement.innerHTML = Oe ? X : f;
|
|
311
326
|
} catch {
|
|
312
327
|
}
|
|
313
328
|
}
|
|
314
|
-
const
|
|
315
|
-
return e &&
|
|
316
|
-
},
|
|
317
|
-
return
|
|
329
|
+
const A = t.body || t.documentElement;
|
|
330
|
+
return e && n && A.insertBefore(l.createTextNode(n), A.childNodes[0] || null), z === I ? Ct.call(t, x ? "html" : "body")[0] : x ? t.documentElement : A;
|
|
331
|
+
}, tt = function(e) {
|
|
332
|
+
return It.call(
|
|
318
333
|
e.ownerDocument || e,
|
|
319
334
|
e,
|
|
320
335
|
// eslint-disable-next-line no-bitwise
|
|
321
|
-
|
|
336
|
+
B.SHOW_ELEMENT | B.SHOW_COMMENT | B.SHOW_TEXT | B.SHOW_PROCESSING_INSTRUCTION | B.SHOW_CDATA_SECTION,
|
|
322
337
|
null
|
|
323
338
|
);
|
|
324
|
-
},
|
|
325
|
-
return e instanceof
|
|
326
|
-
},
|
|
327
|
-
return typeof
|
|
339
|
+
}, De = function(e) {
|
|
340
|
+
return e instanceof Rt && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof St) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
|
|
341
|
+
}, nt = function(e) {
|
|
342
|
+
return typeof me == "function" && e instanceof me;
|
|
328
343
|
};
|
|
329
344
|
function N(i, e, t) {
|
|
330
|
-
|
|
331
|
-
|
|
345
|
+
ce(i, (n) => {
|
|
346
|
+
n.call(o, e, t, G);
|
|
332
347
|
});
|
|
333
348
|
}
|
|
334
|
-
const
|
|
349
|
+
const ot = function(e) {
|
|
335
350
|
let t = null;
|
|
336
|
-
if (N(h.beforeSanitizeElements, e, null),
|
|
337
|
-
return
|
|
338
|
-
const
|
|
351
|
+
if (N(h.beforeSanitizeElements, e, null), De(e))
|
|
352
|
+
return L(e), !0;
|
|
353
|
+
const n = d(e.nodeName);
|
|
339
354
|
if (N(h.uponSanitizeElement, e, {
|
|
340
|
-
tagName:
|
|
355
|
+
tagName: n,
|
|
341
356
|
allowedTags: p
|
|
342
|
-
}),
|
|
343
|
-
return
|
|
344
|
-
if (!p[
|
|
345
|
-
if (!
|
|
357
|
+
}), ne && e.hasChildNodes() && !nt(e.firstElementChild) && S(/<[/\w!]/g, e.innerHTML) && S(/<[/\w!]/g, e.textContent) || e.nodeType === Q.progressingInstruction || ne && e.nodeType === Q.comment && S(/<[/\w]/g, e.data))
|
|
358
|
+
return L(e), !0;
|
|
359
|
+
if (!(v.tagCheck instanceof Function && v.tagCheck(n)) && (!p[n] || j[n])) {
|
|
360
|
+
if (!j[n] && at(n) && (u.tagNameCheck instanceof RegExp && S(u.tagNameCheck, n) || u.tagNameCheck instanceof Function && u.tagNameCheck(n)))
|
|
346
361
|
return !1;
|
|
347
|
-
if (
|
|
348
|
-
const f =
|
|
349
|
-
if (
|
|
350
|
-
const m =
|
|
351
|
-
for (let
|
|
352
|
-
const
|
|
353
|
-
|
|
362
|
+
if (Se && !H[n]) {
|
|
363
|
+
const f = te(e) || e.parentNode, A = Lt(e) || e.childNodes;
|
|
364
|
+
if (A && f) {
|
|
365
|
+
const m = A.length;
|
|
366
|
+
for (let b = m - 1; b >= 0; --b) {
|
|
367
|
+
const C = bt(A[b], !0);
|
|
368
|
+
C.__removalCount = (e.__removalCount || 0) + 1, f.insertBefore(C, Dt(e));
|
|
354
369
|
}
|
|
355
370
|
}
|
|
356
371
|
}
|
|
357
|
-
return
|
|
372
|
+
return L(e), !0;
|
|
358
373
|
}
|
|
359
|
-
return e instanceof
|
|
360
|
-
t =
|
|
361
|
-
}), e.textContent !== t && (
|
|
374
|
+
return e instanceof Ue && !Wt(e) || (n === "noscript" || n === "noembed" || n === "noframes") && S(/<\/no(script|embed|frames)/i, e.innerHTML) ? (L(e), !0) : (k && e.nodeType === Q.text && (t = e.textContent, ce([de, Te, Ee], (f) => {
|
|
375
|
+
t = K(t, f, " ");
|
|
376
|
+
}), e.textContent !== t && (q(o.removed, {
|
|
362
377
|
element: e.cloneNode()
|
|
363
378
|
}), e.textContent = t)), N(h.afterSanitizeElements, e, null), !1);
|
|
364
|
-
},
|
|
365
|
-
if (
|
|
379
|
+
}, it = function(e, t, n) {
|
|
380
|
+
if (Xe && (t === "id" || t === "name") && (n in l || n in Gt))
|
|
366
381
|
return !1;
|
|
367
|
-
if (!(
|
|
368
|
-
if (!(
|
|
369
|
-
if (!
|
|
370
|
-
if (
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
if (!
|
|
380
|
-
if (!(
|
|
381
|
-
if (!(
|
|
382
|
-
if (
|
|
383
|
-
|
|
382
|
+
if (!(Ae && !_e[t] && S(wt, t))) {
|
|
383
|
+
if (!(We && S(xt, t))) {
|
|
384
|
+
if (!(v.attributeCheck instanceof Function && v.attributeCheck(t, e))) {
|
|
385
|
+
if (!T[t] || _e[t]) {
|
|
386
|
+
if (
|
|
387
|
+
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
388
|
+
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
389
|
+
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
390
|
+
!(at(e) && (u.tagNameCheck instanceof RegExp && S(u.tagNameCheck, e) || u.tagNameCheck instanceof Function && u.tagNameCheck(e)) && (u.attributeNameCheck instanceof RegExp && S(u.attributeNameCheck, t) || u.attributeNameCheck instanceof Function && u.attributeNameCheck(t, e)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
391
|
+
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
392
|
+
t === "is" && u.allowCustomizedBuiltInElements && (u.tagNameCheck instanceof RegExp && S(u.tagNameCheck, n) || u.tagNameCheck instanceof Function && u.tagNameCheck(n)))
|
|
393
|
+
) return !1;
|
|
394
|
+
} else if (!Re[t]) {
|
|
395
|
+
if (!S(He, K(n, Fe, ""))) {
|
|
396
|
+
if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Kt(n, "data:") === 0 && $e[e])) {
|
|
397
|
+
if (!(Be && !S(Pt, K(n, Fe, "")))) {
|
|
398
|
+
if (n)
|
|
399
|
+
return !1;
|
|
400
|
+
}
|
|
384
401
|
}
|
|
385
402
|
}
|
|
386
403
|
}
|
|
@@ -388,16 +405,16 @@ function At() {
|
|
|
388
405
|
}
|
|
389
406
|
}
|
|
390
407
|
return !0;
|
|
391
|
-
},
|
|
392
|
-
return e !== "annotation-xml" &&
|
|
393
|
-
},
|
|
408
|
+
}, at = function(e) {
|
|
409
|
+
return e !== "annotation-xml" && Ne(e, vt);
|
|
410
|
+
}, rt = function(e) {
|
|
394
411
|
N(h.beforeSanitizeAttributes, e, null);
|
|
395
412
|
const {
|
|
396
413
|
attributes: t
|
|
397
414
|
} = e;
|
|
398
|
-
if (!t ||
|
|
415
|
+
if (!t || De(e))
|
|
399
416
|
return;
|
|
400
|
-
const
|
|
417
|
+
const n = {
|
|
401
418
|
attrName: "",
|
|
402
419
|
attrValue: "",
|
|
403
420
|
keepAttr: !0,
|
|
@@ -406,157 +423,157 @@ function At() {
|
|
|
406
423
|
};
|
|
407
424
|
let f = t.length;
|
|
408
425
|
for (; f--; ) {
|
|
409
|
-
const
|
|
426
|
+
const A = t[f], {
|
|
410
427
|
name: m,
|
|
411
|
-
namespaceURI:
|
|
412
|
-
value:
|
|
413
|
-
} =
|
|
414
|
-
let E = m === "value" ?
|
|
415
|
-
if (
|
|
428
|
+
namespaceURI: b,
|
|
429
|
+
value: C
|
|
430
|
+
} = A, W = d(m), Le = C;
|
|
431
|
+
let E = m === "value" ? Le : Zt(Le);
|
|
432
|
+
if (n.attrName = W, n.attrValue = E, n.keepAttr = !0, n.forceKeepAttr = void 0, N(h.uponSanitizeAttribute, e, n), E = n.attrValue, je && (W === "id" || W === "name") && (P(m, e), E = kt + E), ne && S(/((--!?|])>)|<\/(style|title|textarea)/i, E)) {
|
|
416
433
|
P(m, e);
|
|
417
434
|
continue;
|
|
418
435
|
}
|
|
419
|
-
if (
|
|
436
|
+
if (W === "attributename" && Ne(E, "href")) {
|
|
420
437
|
P(m, e);
|
|
421
438
|
continue;
|
|
422
439
|
}
|
|
423
|
-
if (
|
|
440
|
+
if (n.forceKeepAttr)
|
|
424
441
|
continue;
|
|
425
|
-
if (!
|
|
442
|
+
if (!n.keepAttr) {
|
|
426
443
|
P(m, e);
|
|
427
444
|
continue;
|
|
428
445
|
}
|
|
429
|
-
if (!
|
|
446
|
+
if (!Ye && S(/\/>/i, E)) {
|
|
430
447
|
P(m, e);
|
|
431
448
|
continue;
|
|
432
449
|
}
|
|
433
|
-
|
|
434
|
-
E =
|
|
450
|
+
k && ce([de, Te, Ee], (lt) => {
|
|
451
|
+
E = K(E, lt, " ");
|
|
435
452
|
});
|
|
436
|
-
const
|
|
437
|
-
if (!
|
|
453
|
+
const st = d(e.nodeName);
|
|
454
|
+
if (!it(st, W, E)) {
|
|
438
455
|
P(m, e);
|
|
439
456
|
continue;
|
|
440
457
|
}
|
|
441
|
-
if (
|
|
442
|
-
switch (
|
|
458
|
+
if (g && typeof ee == "object" && typeof ee.getAttributeType == "function" && !b)
|
|
459
|
+
switch (ee.getAttributeType(st, W)) {
|
|
443
460
|
case "TrustedHTML": {
|
|
444
|
-
E =
|
|
461
|
+
E = g.createHTML(E);
|
|
445
462
|
break;
|
|
446
463
|
}
|
|
447
464
|
case "TrustedScriptURL": {
|
|
448
|
-
E =
|
|
465
|
+
E = g.createScriptURL(E);
|
|
449
466
|
break;
|
|
450
467
|
}
|
|
451
468
|
}
|
|
452
|
-
if (E !==
|
|
469
|
+
if (E !== Le)
|
|
453
470
|
try {
|
|
454
|
-
|
|
471
|
+
b ? e.setAttributeNS(b, m, E) : e.setAttribute(m, E), De(e) ? L(e) : ft(o.removed);
|
|
455
472
|
} catch {
|
|
456
473
|
P(m, e);
|
|
457
474
|
}
|
|
458
475
|
}
|
|
459
476
|
N(h.afterSanitizeAttributes, e, null);
|
|
460
|
-
},
|
|
477
|
+
}, Bt = function i(e) {
|
|
461
478
|
let t = null;
|
|
462
|
-
const
|
|
463
|
-
for (N(h.beforeSanitizeShadowDOM, e, null); t =
|
|
464
|
-
N(h.uponSanitizeShadowNode, t, null),
|
|
479
|
+
const n = tt(e);
|
|
480
|
+
for (N(h.beforeSanitizeShadowDOM, e, null); t = n.nextNode(); )
|
|
481
|
+
N(h.uponSanitizeShadowNode, t, null), ot(t), rt(t), t.content instanceof _ && i(t.content);
|
|
465
482
|
N(h.afterSanitizeShadowDOM, e, null);
|
|
466
483
|
};
|
|
467
|
-
return
|
|
468
|
-
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = null,
|
|
469
|
-
if (
|
|
484
|
+
return o.sanitize = function(i) {
|
|
485
|
+
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = null, n = null, f = null, A = null;
|
|
486
|
+
if (Oe = !i, Oe && (i = "<!-->"), typeof i != "string" && !nt(i))
|
|
470
487
|
if (typeof i.toString == "function") {
|
|
471
488
|
if (i = i.toString(), typeof i != "string")
|
|
472
|
-
throw
|
|
489
|
+
throw Z("dirty is not a string, aborting");
|
|
473
490
|
} else
|
|
474
|
-
throw
|
|
475
|
-
if (!
|
|
491
|
+
throw Z("toString is not a function");
|
|
492
|
+
if (!o.isSupported)
|
|
476
493
|
return i;
|
|
477
|
-
if (ge ||
|
|
494
|
+
if (ge || ye(e), o.removed = [], typeof i == "string" && (V = !1), V) {
|
|
478
495
|
if (i.nodeName) {
|
|
479
|
-
const
|
|
480
|
-
if (!p[
|
|
481
|
-
throw
|
|
496
|
+
const C = d(i.nodeName);
|
|
497
|
+
if (!p[C] || j[C])
|
|
498
|
+
throw Z("root node is forbidden and cannot be sanitized in-place");
|
|
482
499
|
}
|
|
483
|
-
} else if (i instanceof
|
|
484
|
-
t =
|
|
500
|
+
} else if (i instanceof me)
|
|
501
|
+
t = et("<!---->"), n = t.ownerDocument.importNode(i, !0), n.nodeType === Q.element && n.nodeName === "BODY" || n.nodeName === "HTML" ? t = n : t.appendChild(n);
|
|
485
502
|
else {
|
|
486
|
-
if (!U && !
|
|
503
|
+
if (!U && !k && !x && // eslint-disable-next-line unicorn/prefer-includes
|
|
487
504
|
i.indexOf("<") === -1)
|
|
488
|
-
return
|
|
489
|
-
if (t =
|
|
490
|
-
return U ? null :
|
|
505
|
+
return g && ie ? g.createHTML(i) : i;
|
|
506
|
+
if (t = et(i), !t)
|
|
507
|
+
return U ? null : ie ? X : "";
|
|
491
508
|
}
|
|
492
|
-
t &&
|
|
493
|
-
const m =
|
|
509
|
+
t && he && L(t.firstChild);
|
|
510
|
+
const m = tt(V ? i : t);
|
|
494
511
|
for (; f = m.nextNode(); )
|
|
495
|
-
|
|
496
|
-
if (
|
|
512
|
+
ot(f), rt(f), f.content instanceof _ && Bt(f.content);
|
|
513
|
+
if (V)
|
|
497
514
|
return i;
|
|
498
515
|
if (U) {
|
|
499
|
-
if (
|
|
500
|
-
for (
|
|
501
|
-
|
|
516
|
+
if (oe)
|
|
517
|
+
for (A = Nt.call(t.ownerDocument); t.firstChild; )
|
|
518
|
+
A.appendChild(t.firstChild);
|
|
502
519
|
else
|
|
503
|
-
|
|
504
|
-
return (T.shadowroot || T.shadowrootmode) && (
|
|
520
|
+
A = t;
|
|
521
|
+
return (T.shadowroot || T.shadowrootmode) && (A = Mt.call(a, A, !0)), A;
|
|
505
522
|
}
|
|
506
|
-
let
|
|
507
|
-
return x && p["!doctype"] && t.ownerDocument && t.ownerDocument.doctype && t.ownerDocument.doctype.name && S(gt, t.ownerDocument.doctype.name) && (
|
|
508
|
-
` +
|
|
509
|
-
|
|
510
|
-
}),
|
|
511
|
-
},
|
|
523
|
+
let b = x ? t.outerHTML : t.innerHTML;
|
|
524
|
+
return x && p["!doctype"] && t.ownerDocument && t.ownerDocument.doctype && t.ownerDocument.doctype.name && S(gt, t.ownerDocument.doctype.name) && (b = "<!DOCTYPE " + t.ownerDocument.doctype.name + `>
|
|
525
|
+
` + b), k && ce([de, Te, Ee], (C) => {
|
|
526
|
+
b = K(b, C, " ");
|
|
527
|
+
}), g && ie ? g.createHTML(b) : b;
|
|
528
|
+
}, o.setConfig = function() {
|
|
512
529
|
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
513
|
-
|
|
514
|
-
},
|
|
515
|
-
|
|
516
|
-
},
|
|
517
|
-
|
|
518
|
-
const
|
|
519
|
-
return
|
|
520
|
-
},
|
|
521
|
-
typeof e == "function" &&
|
|
522
|
-
},
|
|
530
|
+
ye(i), ge = !0;
|
|
531
|
+
}, o.clearConfig = function() {
|
|
532
|
+
G = null, ge = !1;
|
|
533
|
+
}, o.isValidAttribute = function(i, e, t) {
|
|
534
|
+
G || ye({});
|
|
535
|
+
const n = d(i), f = d(e);
|
|
536
|
+
return it(n, f, t);
|
|
537
|
+
}, o.addHook = function(i, e) {
|
|
538
|
+
typeof e == "function" && q(h[i], e);
|
|
539
|
+
}, o.removeHook = function(i, e) {
|
|
523
540
|
if (e !== void 0) {
|
|
524
|
-
const t =
|
|
525
|
-
return t === -1 ? void 0 :
|
|
541
|
+
const t = $t(h[i], e);
|
|
542
|
+
return t === -1 ? void 0 : qt(h[i], t, 1)[0];
|
|
526
543
|
}
|
|
527
|
-
return
|
|
528
|
-
},
|
|
544
|
+
return ft(h[i]);
|
|
545
|
+
}, o.removeHooks = function(i) {
|
|
529
546
|
h[i] = [];
|
|
530
|
-
},
|
|
531
|
-
h =
|
|
532
|
-
},
|
|
547
|
+
}, o.removeAllHooks = function() {
|
|
548
|
+
h = Et();
|
|
549
|
+
}, o;
|
|
533
550
|
}
|
|
534
|
-
var
|
|
535
|
-
function
|
|
551
|
+
var pn = /* @__PURE__ */ ht();
|
|
552
|
+
function En(r, o = {}) {
|
|
536
553
|
const {
|
|
537
554
|
allowStyles: l = !1,
|
|
538
555
|
forbiddenAttributes: a = [],
|
|
539
556
|
forbiddenTags: c = []
|
|
540
|
-
} =
|
|
557
|
+
} = o;
|
|
541
558
|
if (!r || typeof r != "string")
|
|
542
559
|
return null;
|
|
543
|
-
if (!
|
|
560
|
+
if (!dn())
|
|
544
561
|
return r;
|
|
545
|
-
const _ = [...
|
|
562
|
+
const _ = [...Yt, ...c], w = [
|
|
546
563
|
...l ? [] : ["style"],
|
|
547
564
|
...a
|
|
548
565
|
];
|
|
549
|
-
return
|
|
566
|
+
return pn.sanitize(r, {
|
|
550
567
|
USE_PROFILES: { svg: !0, svgFilters: !0 },
|
|
551
568
|
FORBID_TAGS: _,
|
|
552
569
|
FORBID_ATTR: w
|
|
553
570
|
});
|
|
554
571
|
}
|
|
555
|
-
function
|
|
572
|
+
function dn() {
|
|
556
573
|
return !!(typeof window < "u" && window.document && window.document.createElement);
|
|
557
574
|
}
|
|
558
575
|
export {
|
|
559
|
-
|
|
560
|
-
|
|
576
|
+
dn as canUseDOM,
|
|
577
|
+
En as sanitizeSvg
|
|
561
578
|
};
|
|
562
579
|
//# sourceMappingURL=utils.es.js.map
|