@ranty/ranty-sdk 4.0.0-beta.23 → 4.0.0-beta.24

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