vue-data-ui 2.2.88 → 2.2.89

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vue-data-ui",
3
3
  "private": false,
4
- "version": "2.2.88",
4
+ "version": "2.2.89",
5
5
  "type": "module",
6
6
  "description": "A user-empowering data visualization Vue 3 components library for eloquent data storytelling",
7
7
  "keywords": [
@@ -89,7 +89,7 @@
89
89
  "remove-attr": "^0.0.13",
90
90
  "sass": "^1.57.1",
91
91
  "vite": "^4.5.3",
92
- "vitest": "^0.34.1",
92
+ "vitest": "^1.4.0",
93
93
  "vue": "^3.3.4",
94
94
  "simple-git": "^3.24.0"
95
95
  }
@@ -1,474 +0,0 @@
1
- /*! @license DOMPurify 2.4.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.7/LICENSE */
2
- function I(r) {
3
- "@babel/helpers - typeof";
4
- return I = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
5
- return typeof n;
6
- } : function(n) {
7
- return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
8
- }, I(r);
9
- }
10
- function ke(r, n) {
11
- return ke = Object.setPrototypeOf || function(s, c) {
12
- return s.__proto__ = c, s;
13
- }, ke(r, n);
14
- }
15
- function Ft() {
16
- if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
17
- return !1;
18
- if (typeof Proxy == "function")
19
- return !0;
20
- try {
21
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
22
- })), !0;
23
- } catch {
24
- return !1;
25
- }
26
- }
27
- function oe(r, n, o) {
28
- return Ft() ? oe = Reflect.construct : oe = function(c, g, y) {
29
- var N = [null];
30
- N.push.apply(N, g);
31
- var B = Function.bind.apply(c, N), $ = new B();
32
- return y && ke($, y.prototype), $;
33
- }, oe.apply(null, arguments);
34
- }
35
- function O(r) {
36
- return Ut(r) || Ht(r) || zt(r) || Gt();
37
- }
38
- function Ut(r) {
39
- if (Array.isArray(r))
40
- return Pe(r);
41
- }
42
- function Ht(r) {
43
- if (typeof Symbol < "u" && r[Symbol.iterator] != null || r["@@iterator"] != null)
44
- return Array.from(r);
45
- }
46
- function zt(r, n) {
47
- if (r) {
48
- if (typeof r == "string")
49
- return Pe(r, n);
50
- var o = Object.prototype.toString.call(r).slice(8, -1);
51
- if (o === "Object" && r.constructor && (o = r.constructor.name), o === "Map" || o === "Set")
52
- return Array.from(r);
53
- if (o === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))
54
- return Pe(r, n);
55
- }
56
- }
57
- function Pe(r, n) {
58
- (n == null || n > r.length) && (n = r.length);
59
- for (var o = 0, s = new Array(n); o < n; o++)
60
- s[o] = r[o];
61
- return s;
62
- }
63
- function Gt() {
64
- throw new TypeError(`Invalid attempt to spread non-iterable instance.
65
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
66
- }
67
- var Wt = Object.hasOwnProperty, lt = Object.setPrototypeOf, Bt = Object.isFrozen, $t = Object.getPrototypeOf, jt = Object.getOwnPropertyDescriptor, A = Object.freeze, L = Object.seal, Yt = Object.create, pt = typeof Reflect < "u" && Reflect, se = pt.apply, Fe = pt.construct;
68
- se || (se = function(n, o, s) {
69
- return n.apply(o, s);
70
- });
71
- A || (A = function(n) {
72
- return n;
73
- });
74
- L || (L = function(n) {
75
- return n;
76
- });
77
- Fe || (Fe = function(n, o) {
78
- return oe(n, O(o));
79
- });
80
- var Vt = b(Array.prototype.forEach), st = b(Array.prototype.pop), X = b(Array.prototype.push), le = b(String.prototype.toLowerCase), De = b(String.prototype.toString), Xt = b(String.prototype.match), R = b(String.prototype.replace), qt = b(String.prototype.indexOf), Kt = b(String.prototype.trim), _ = b(RegExp.prototype.test), Me = Zt(TypeError);
81
- function b(r) {
82
- return function(n) {
83
- for (var o = arguments.length, s = new Array(o > 1 ? o - 1 : 0), c = 1; c < o; c++)
84
- s[c - 1] = arguments[c];
85
- return se(r, n, s);
86
- };
87
- }
88
- function Zt(r) {
89
- return function() {
90
- for (var n = arguments.length, o = new Array(n), s = 0; s < n; s++)
91
- o[s] = arguments[s];
92
- return Fe(r, o);
93
- };
94
- }
95
- function l(r, n, o) {
96
- var s;
97
- o = (s = o) !== null && s !== void 0 ? s : le, lt && lt(r, null);
98
- for (var c = n.length; c--; ) {
99
- var g = n[c];
100
- if (typeof g == "string") {
101
- var y = o(g);
102
- y !== g && (Bt(n) || (n[c] = y), g = y);
103
- }
104
- r[g] = !0;
105
- }
106
- return r;
107
- }
108
- function P(r) {
109
- var n = Yt(null), o;
110
- for (o in r)
111
- se(Wt, r, [o]) === !0 && (n[o] = r[o]);
112
- return n;
113
- }
114
- function ne(r, n) {
115
- for (; r !== null; ) {
116
- var o = jt(r, n);
117
- if (o) {
118
- if (o.get)
119
- return b(o.get);
120
- if (typeof o.value == "function")
121
- return b(o.value);
122
- }
123
- r = $t(r);
124
- }
125
- function s(c) {
126
- return console.warn("fallback value for", c), null;
127
- }
128
- return s;
129
- }
130
- var ut = A(["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", "section", "select", "shadow", "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"]), we = A(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Ce = A(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Jt = A(["animate", "color-profile", "cursor", "discard", "fedropshadow", "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"]), Ie = A(["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"]), Qt = A(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), ft = A(["#text"]), ct = A(["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", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "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", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns", "slot"]), xe = A(["accent-height", "accumulate", "additive", "alignment-baseline", "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", "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", "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", "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", "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", "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"]), mt = A(["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"]), ie = A(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), er = L(/\{\{[\w\W]*|[\w\W]*\}\}/gm), tr = L(/<%[\w\W]*|[\w\W]*%>/gm), rr = L(/\${[\w\W]*}/gm), ar = L(/^data-[\-\w.\u00B7-\uFFFF]/), nr = L(/^aria-[\-\w]+$/), ir = L(
131
- /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
132
- // eslint-disable-line no-useless-escape
133
- ), or = L(/^(?:\w+script|data):/i), lr = L(
134
- /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
135
- // eslint-disable-line no-control-regex
136
- ), sr = L(/^html$/i), ur = function() {
137
- return typeof window > "u" ? null : window;
138
- }, fr = function(n, o) {
139
- if (I(n) !== "object" || typeof n.createPolicy != "function")
140
- return null;
141
- var s = null, c = "data-tt-policy-suffix";
142
- o.currentScript && o.currentScript.hasAttribute(c) && (s = o.currentScript.getAttribute(c));
143
- var g = "dompurify" + (s ? "#" + s : "");
144
- try {
145
- return n.createPolicy(g, {
146
- createHTML: function(N) {
147
- return N;
148
- },
149
- createScriptURL: function(N) {
150
- return N;
151
- }
152
- });
153
- } catch {
154
- return console.warn("TrustedTypes policy " + g + " could not be created."), null;
155
- }
156
- };
157
- function dt() {
158
- var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ur(), n = function(e) {
159
- return dt(e);
160
- };
161
- if (n.version = "2.4.7", n.removed = [], !r || !r.document || r.document.nodeType !== 9)
162
- return n.isSupported = !1, n;
163
- var o = r.document, s = r.document, c = r.DocumentFragment, g = r.HTMLTemplateElement, y = r.Node, N = r.Element, B = r.NodeFilter, $ = r.NamedNodeMap, vt = $ === void 0 ? r.NamedNodeMap || r.MozNamedAttrMap : $, Tt = r.HTMLFormElement, ht = r.DOMParser, q = r.trustedTypes, K = N.prototype, _t = ne(K, "cloneNode"), At = ne(K, "nextSibling"), Et = ne(K, "childNodes"), ue = ne(K, "parentNode");
164
- if (typeof g == "function") {
165
- var fe = s.createElement("template");
166
- fe.content && fe.content.ownerDocument && (s = fe.content.ownerDocument);
167
- }
168
- var S = fr(q, o), ce = S ? S.createHTML("") : "", Z = s, me = Z.implementation, yt = Z.createNodeIterator, gt = Z.createDocumentFragment, bt = Z.getElementsByTagName, St = o.importNode, Ue = {};
169
- try {
170
- Ue = P(s).documentMode ? s.documentMode : {};
171
- } catch {
172
- }
173
- var D = {};
174
- n.isSupported = typeof ue == "function" && me && me.createHTMLDocument !== void 0 && Ue !== 9;
175
- var pe = er, de = tr, ve = rr, Rt = ar, Ot = nr, Lt = or, He = lr, Te = ir, m = null, ze = l({}, [].concat(O(ut), O(we), O(Ce), O(Ie), O(ft))), p = null, Ge = l({}, [].concat(O(ct), O(xe), O(mt), O(ie))), f = Object.seal(Object.create(null, {
176
- tagNameCheck: {
177
- writable: !0,
178
- configurable: !1,
179
- enumerable: !0,
180
- value: null
181
- },
182
- attributeNameCheck: {
183
- writable: !0,
184
- configurable: !1,
185
- enumerable: !0,
186
- value: null
187
- },
188
- allowCustomizedBuiltInElements: {
189
- writable: !0,
190
- configurable: !1,
191
- enumerable: !0,
192
- value: !1
193
- }
194
- })), j = null, he = null, We = !0, _e = !0, Be = !1, $e = !0, F = !1, x = !1, Ae = !1, Ee = !1, U = !1, J = !1, Q = !1, je = !0, Ye = !1, Nt = "user-content-", ye = !0, Y = !1, H = {}, z = null, Ve = l({}, ["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"]), Xe = null, qe = l({}, ["audio", "video", "img", "source", "image", "track"]), ge = null, Ke = l({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ee = "http://www.w3.org/1998/Math/MathML", te = "http://www.w3.org/2000/svg", M = "http://www.w3.org/1999/xhtml", G = M, be = !1, Se = null, Dt = l({}, [ee, te, M], De), k, Mt = ["application/xhtml+xml", "text/html"], wt = "text/html", d, W = null, Ct = s.createElement("form"), Ze = function(e) {
195
- return e instanceof RegExp || e instanceof Function;
196
- }, Re = function(e) {
197
- W && W === e || ((!e || I(e) !== "object") && (e = {}), e = P(e), k = // eslint-disable-next-line unicorn/prefer-includes
198
- Mt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? k = wt : k = e.PARSER_MEDIA_TYPE, d = k === "application/xhtml+xml" ? De : le, m = "ALLOWED_TAGS" in e ? l({}, e.ALLOWED_TAGS, d) : ze, p = "ALLOWED_ATTR" in e ? l({}, e.ALLOWED_ATTR, d) : Ge, Se = "ALLOWED_NAMESPACES" in e ? l({}, e.ALLOWED_NAMESPACES, De) : Dt, ge = "ADD_URI_SAFE_ATTR" in e ? l(
199
- P(Ke),
200
- // eslint-disable-line indent
201
- e.ADD_URI_SAFE_ATTR,
202
- // eslint-disable-line indent
203
- d
204
- // eslint-disable-line indent
205
- ) : Ke, Xe = "ADD_DATA_URI_TAGS" in e ? l(
206
- P(qe),
207
- // eslint-disable-line indent
208
- e.ADD_DATA_URI_TAGS,
209
- // eslint-disable-line indent
210
- d
211
- // eslint-disable-line indent
212
- ) : qe, z = "FORBID_CONTENTS" in e ? l({}, e.FORBID_CONTENTS, d) : Ve, j = "FORBID_TAGS" in e ? l({}, e.FORBID_TAGS, d) : {}, he = "FORBID_ATTR" in e ? l({}, e.FORBID_ATTR, d) : {}, H = "USE_PROFILES" in e ? e.USE_PROFILES : !1, We = e.ALLOW_ARIA_ATTR !== !1, _e = e.ALLOW_DATA_ATTR !== !1, Be = e.ALLOW_UNKNOWN_PROTOCOLS || !1, $e = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, F = e.SAFE_FOR_TEMPLATES || !1, x = e.WHOLE_DOCUMENT || !1, U = e.RETURN_DOM || !1, J = e.RETURN_DOM_FRAGMENT || !1, Q = e.RETURN_TRUSTED_TYPE || !1, Ee = e.FORCE_BODY || !1, je = e.SANITIZE_DOM !== !1, Ye = e.SANITIZE_NAMED_PROPS || !1, ye = e.KEEP_CONTENT !== !1, Y = e.IN_PLACE || !1, Te = e.ALLOWED_URI_REGEXP || Te, G = e.NAMESPACE || M, f = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && Ze(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (f.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && Ze(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (f.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (f.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), F && (_e = !1), J && (U = !0), H && (m = l({}, O(ft)), p = [], H.html === !0 && (l(m, ut), l(p, ct)), H.svg === !0 && (l(m, we), l(p, xe), l(p, ie)), H.svgFilters === !0 && (l(m, Ce), l(p, xe), l(p, ie)), H.mathMl === !0 && (l(m, Ie), l(p, mt), l(p, ie))), e.ADD_TAGS && (m === ze && (m = P(m)), l(m, e.ADD_TAGS, d)), e.ADD_ATTR && (p === Ge && (p = P(p)), l(p, e.ADD_ATTR, d)), e.ADD_URI_SAFE_ATTR && l(ge, e.ADD_URI_SAFE_ATTR, d), e.FORBID_CONTENTS && (z === Ve && (z = P(z)), l(z, e.FORBID_CONTENTS, d)), ye && (m["#text"] = !0), x && l(m, ["html", "head", "body"]), m.table && (l(m, ["tbody"]), delete j.tbody), A && A(e), W = e);
213
- }, Je = l({}, ["mi", "mo", "mn", "ms", "mtext"]), Qe = l({}, ["foreignobject", "desc", "title", "annotation-xml"]), It = l({}, ["title", "style", "font", "a", "script"]), re = l({}, we);
214
- l(re, Ce), l(re, Jt);
215
- var Oe = l({}, Ie);
216
- l(Oe, Qt);
217
- var xt = function(e) {
218
- var t = ue(e);
219
- (!t || !t.tagName) && (t = {
220
- namespaceURI: G,
221
- tagName: "template"
222
- });
223
- var a = le(e.tagName), u = le(t.tagName);
224
- return Se[e.namespaceURI] ? e.namespaceURI === te ? t.namespaceURI === M ? a === "svg" : t.namespaceURI === ee ? a === "svg" && (u === "annotation-xml" || Je[u]) : !!re[a] : e.namespaceURI === ee ? t.namespaceURI === M ? a === "math" : t.namespaceURI === te ? a === "math" && Qe[u] : !!Oe[a] : e.namespaceURI === M ? t.namespaceURI === te && !Qe[u] || t.namespaceURI === ee && !Je[u] ? !1 : !Oe[a] && (It[a] || !re[a]) : !!(k === "application/xhtml+xml" && Se[e.namespaceURI]) : !1;
225
- }, w = function(e) {
226
- X(n.removed, {
227
- element: e
228
- });
229
- try {
230
- e.parentNode.removeChild(e);
231
- } catch {
232
- try {
233
- e.outerHTML = ce;
234
- } catch {
235
- e.remove();
236
- }
237
- }
238
- }, Le = function(e, t) {
239
- try {
240
- X(n.removed, {
241
- attribute: t.getAttributeNode(e),
242
- from: t
243
- });
244
- } catch {
245
- X(n.removed, {
246
- attribute: null,
247
- from: t
248
- });
249
- }
250
- if (t.removeAttribute(e), e === "is" && !p[e])
251
- if (U || J)
252
- try {
253
- w(t);
254
- } catch {
255
- }
256
- else
257
- try {
258
- t.setAttribute(e, "");
259
- } catch {
260
- }
261
- }, et = function(e) {
262
- var t, a;
263
- if (Ee)
264
- e = "<remove></remove>" + e;
265
- else {
266
- var u = Xt(e, /^[\r\n\t ]+/);
267
- a = u && u[0];
268
- }
269
- k === "application/xhtml+xml" && G === M && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
270
- var E = S ? S.createHTML(e) : e;
271
- if (G === M)
272
- try {
273
- t = new ht().parseFromString(E, k);
274
- } catch {
275
- }
276
- if (!t || !t.documentElement) {
277
- t = me.createDocument(G, "template", null);
278
- try {
279
- t.documentElement.innerHTML = be ? ce : E;
280
- } catch {
281
- }
282
- }
283
- var h = t.body || t.documentElement;
284
- return e && a && h.insertBefore(s.createTextNode(a), h.childNodes[0] || null), G === M ? bt.call(t, x ? "html" : "body")[0] : x ? t.documentElement : h;
285
- }, tt = function(e) {
286
- return yt.call(
287
- e.ownerDocument || e,
288
- e,
289
- // eslint-disable-next-line no-bitwise
290
- B.SHOW_ELEMENT | B.SHOW_COMMENT | B.SHOW_TEXT,
291
- null,
292
- !1
293
- );
294
- }, kt = function(e) {
295
- return e instanceof Tt && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof vt) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
296
- }, V = function(e) {
297
- return I(y) === "object" ? e instanceof y : e && I(e) === "object" && typeof e.nodeType == "number" && typeof e.nodeName == "string";
298
- }, C = function(e, t, a) {
299
- D[e] && Vt(D[e], function(u) {
300
- u.call(n, t, a, W);
301
- });
302
- }, rt = function(e) {
303
- var t;
304
- if (C("beforeSanitizeElements", e, null), kt(e) || _(/[\u0080-\uFFFF]/, e.nodeName))
305
- return w(e), !0;
306
- var a = d(e.nodeName);
307
- if (C("uponSanitizeElement", e, {
308
- tagName: a,
309
- allowedTags: m
310
- }), e.hasChildNodes() && !V(e.firstElementChild) && (!V(e.content) || !V(e.content.firstElementChild)) && _(/<[/\w]/g, e.innerHTML) && _(/<[/\w]/g, e.textContent) || a === "select" && _(/<template/i, e.innerHTML))
311
- return w(e), !0;
312
- if (!m[a] || j[a]) {
313
- if (!j[a] && nt(a) && (f.tagNameCheck instanceof RegExp && _(f.tagNameCheck, a) || f.tagNameCheck instanceof Function && f.tagNameCheck(a)))
314
- return !1;
315
- if (ye && !z[a]) {
316
- var u = ue(e) || e.parentNode, E = Et(e) || e.childNodes;
317
- if (E && u)
318
- for (var h = E.length, T = h - 1; T >= 0; --T)
319
- u.insertBefore(_t(E[T], !0), At(e));
320
- }
321
- return w(e), !0;
322
- }
323
- return e instanceof N && !xt(e) || (a === "noscript" || a === "noembed" || a === "noframes") && _(/<\/no(script|embed|frames)/i, e.innerHTML) ? (w(e), !0) : (F && e.nodeType === 3 && (t = e.textContent, t = R(t, pe, " "), t = R(t, de, " "), t = R(t, ve, " "), e.textContent !== t && (X(n.removed, {
324
- element: e.cloneNode()
325
- }), e.textContent = t)), C("afterSanitizeElements", e, null), !1);
326
- }, at = function(e, t, a) {
327
- if (je && (t === "id" || t === "name") && (a in s || a in Ct))
328
- return !1;
329
- if (!(_e && !he[t] && _(Rt, t))) {
330
- if (!(We && _(Ot, t))) {
331
- if (!p[t] || he[t]) {
332
- if (
333
- // First condition does a very basic check if a) it's basically a valid custom element tagname AND
334
- // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
335
- // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
336
- !(nt(e) && (f.tagNameCheck instanceof RegExp && _(f.tagNameCheck, e) || f.tagNameCheck instanceof Function && f.tagNameCheck(e)) && (f.attributeNameCheck instanceof RegExp && _(f.attributeNameCheck, t) || f.attributeNameCheck instanceof Function && f.attributeNameCheck(t)) || // Alternative, second condition checks if it's an `is`-attribute, AND
337
- // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
338
- t === "is" && f.allowCustomizedBuiltInElements && (f.tagNameCheck instanceof RegExp && _(f.tagNameCheck, a) || f.tagNameCheck instanceof Function && f.tagNameCheck(a)))
339
- )
340
- return !1;
341
- } else if (!ge[t]) {
342
- if (!_(Te, R(a, He, ""))) {
343
- if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && qt(a, "data:") === 0 && Xe[e])) {
344
- if (!(Be && !_(Lt, R(a, He, "")))) {
345
- if (a)
346
- return !1;
347
- }
348
- }
349
- }
350
- }
351
- }
352
- }
353
- return !0;
354
- }, nt = function(e) {
355
- return e.indexOf("-") > 0;
356
- }, it = function(e) {
357
- var t, a, u, E;
358
- C("beforeSanitizeAttributes", e, null);
359
- var h = e.attributes;
360
- if (h) {
361
- var T = {
362
- attrName: "",
363
- attrValue: "",
364
- keepAttr: !0,
365
- allowedAttributes: p
366
- };
367
- for (E = h.length; E--; ) {
368
- t = h[E];
369
- var ae = t, v = ae.name, Ne = ae.namespaceURI;
370
- if (a = v === "value" ? t.value : Kt(t.value), u = d(v), T.attrName = u, T.attrValue = a, T.keepAttr = !0, T.forceKeepAttr = void 0, C("uponSanitizeAttribute", e, T), a = T.attrValue, !T.forceKeepAttr && (Le(v, e), !!T.keepAttr)) {
371
- if (!$e && _(/\/>/i, a)) {
372
- Le(v, e);
373
- continue;
374
- }
375
- F && (a = R(a, pe, " "), a = R(a, de, " "), a = R(a, ve, " "));
376
- var ot = d(e.nodeName);
377
- if (at(ot, u, a)) {
378
- if (Ye && (u === "id" || u === "name") && (Le(v, e), a = Nt + a), S && I(q) === "object" && typeof q.getAttributeType == "function" && !Ne)
379
- switch (q.getAttributeType(ot, u)) {
380
- case "TrustedHTML": {
381
- a = S.createHTML(a);
382
- break;
383
- }
384
- case "TrustedScriptURL": {
385
- a = S.createScriptURL(a);
386
- break;
387
- }
388
- }
389
- try {
390
- Ne ? e.setAttributeNS(Ne, v, a) : e.setAttribute(v, a), st(n.removed);
391
- } catch {
392
- }
393
- }
394
- }
395
- }
396
- C("afterSanitizeAttributes", e, null);
397
- }
398
- }, Pt = function i(e) {
399
- var t, a = tt(e);
400
- for (C("beforeSanitizeShadowDOM", e, null); t = a.nextNode(); )
401
- C("uponSanitizeShadowNode", t, null), !rt(t) && (t.content instanceof c && i(t.content), it(t));
402
- C("afterSanitizeShadowDOM", e, null);
403
- };
404
- return n.sanitize = function(i) {
405
- var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t, a, u, E, h;
406
- if (be = !i, be && (i = "<!-->"), typeof i != "string" && !V(i))
407
- if (typeof i.toString == "function") {
408
- if (i = i.toString(), typeof i != "string")
409
- throw Me("dirty is not a string, aborting");
410
- } else
411
- throw Me("toString is not a function");
412
- if (!n.isSupported) {
413
- if (I(r.toStaticHTML) === "object" || typeof r.toStaticHTML == "function") {
414
- if (typeof i == "string")
415
- return r.toStaticHTML(i);
416
- if (V(i))
417
- return r.toStaticHTML(i.outerHTML);
418
- }
419
- return i;
420
- }
421
- if (Ae || Re(e), n.removed = [], typeof i == "string" && (Y = !1), Y) {
422
- if (i.nodeName) {
423
- var T = d(i.nodeName);
424
- if (!m[T] || j[T])
425
- throw Me("root node is forbidden and cannot be sanitized in-place");
426
- }
427
- } else if (i instanceof y)
428
- t = et("<!---->"), a = t.ownerDocument.importNode(i, !0), a.nodeType === 1 && a.nodeName === "BODY" || a.nodeName === "HTML" ? t = a : t.appendChild(a);
429
- else {
430
- if (!U && !F && !x && // eslint-disable-next-line unicorn/prefer-includes
431
- i.indexOf("<") === -1)
432
- return S && Q ? S.createHTML(i) : i;
433
- if (t = et(i), !t)
434
- return U ? null : Q ? ce : "";
435
- }
436
- t && Ee && w(t.firstChild);
437
- for (var ae = tt(Y ? i : t); u = ae.nextNode(); )
438
- u.nodeType === 3 && u === E || rt(u) || (u.content instanceof c && Pt(u.content), it(u), E = u);
439
- if (E = null, Y)
440
- return i;
441
- if (U) {
442
- if (J)
443
- for (h = gt.call(t.ownerDocument); t.firstChild; )
444
- h.appendChild(t.firstChild);
445
- else
446
- h = t;
447
- return (p.shadowroot || p.shadowrootmod) && (h = St.call(o, h, !0)), h;
448
- }
449
- var v = x ? t.outerHTML : t.innerHTML;
450
- return x && m["!doctype"] && t.ownerDocument && t.ownerDocument.doctype && t.ownerDocument.doctype.name && _(sr, t.ownerDocument.doctype.name) && (v = "<!DOCTYPE " + t.ownerDocument.doctype.name + `>
451
- ` + v), F && (v = R(v, pe, " "), v = R(v, de, " "), v = R(v, ve, " ")), S && Q ? S.createHTML(v) : v;
452
- }, n.setConfig = function(i) {
453
- Re(i), Ae = !0;
454
- }, n.clearConfig = function() {
455
- W = null, Ae = !1;
456
- }, n.isValidAttribute = function(i, e, t) {
457
- W || Re({});
458
- var a = d(i), u = d(e);
459
- return at(a, u, t);
460
- }, n.addHook = function(i, e) {
461
- typeof e == "function" && (D[i] = D[i] || [], X(D[i], e));
462
- }, n.removeHook = function(i) {
463
- if (D[i])
464
- return st(D[i]);
465
- }, n.removeHooks = function(i) {
466
- D[i] && (D[i] = []);
467
- }, n.removeAllHooks = function() {
468
- D = {};
469
- }, n;
470
- }
471
- var mr = dt();
472
- export {
473
- mr as default
474
- };