@amsom-habitat/amsom-excel-extractor 2.3.0 → 2.3.1

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