mapicgc-gl-js 1.0.2 → 1.0.3

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,480 +0,0 @@
1
- /*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
2
- const {
3
- entries: ft,
4
- setPrototypeOf: ot,
5
- isFrozen: Bt,
6
- getPrototypeOf: Gt,
7
- getOwnPropertyDescriptor: Yt
8
- } = Object;
9
- let {
10
- freeze: A,
11
- seal: N,
12
- create: pt
13
- } = Object, {
14
- apply: Ce,
15
- construct: De
16
- } = typeof Reflect < "u" && Reflect;
17
- A || (A = function(r) {
18
- return r;
19
- });
20
- N || (N = function(r) {
21
- return r;
22
- });
23
- Ce || (Ce = function(r, o, l) {
24
- return r.apply(o, l);
25
- });
26
- De || (De = function(r, o) {
27
- return new r(...o);
28
- });
29
- const ie = _(Array.prototype.forEach), jt = _(Array.prototype.lastIndexOf), rt = _(Array.prototype.pop), X = _(Array.prototype.push), Xt = _(Array.prototype.splice), se = _(String.prototype.toLowerCase), Re = _(String.prototype.toString), at = _(String.prototype.match), q = _(String.prototype.replace), qt = _(String.prototype.indexOf), $t = _(String.prototype.trim), b = _(Object.prototype.hasOwnProperty), E = _(RegExp.prototype.test), $ = Kt(TypeError);
30
- function _(r) {
31
- return function(o) {
32
- o instanceof RegExp && (o.lastIndex = 0);
33
- for (var l = arguments.length, i = new Array(l > 1 ? l - 1 : 0), h = 1; h < l; h++) i[h - 1] = arguments[h];
34
- return Ce(r, o, i);
35
- };
36
- }
37
- function Kt(r) {
38
- return function() {
39
- for (var o = arguments.length, l = new Array(o), i = 0; i < o; i++) l[i] = arguments[i];
40
- return De(r, l);
41
- };
42
- }
43
- function a(r, o) {
44
- let l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : se;
45
- ot && ot(r, null);
46
- let i = o.length;
47
- for (; i--; ) {
48
- let h = o[i];
49
- if (typeof h == "string") {
50
- const R = l(h);
51
- R !== h && (Bt(o) || (o[i] = R), h = R);
52
- }
53
- r[h] = !0;
54
- }
55
- return r;
56
- }
57
- function Vt(r) {
58
- for (let o = 0; o < r.length; o++) b(r, o) || (r[o] = null);
59
- return r;
60
- }
61
- function C(r) {
62
- const o = pt(null);
63
- for (const [l, i] of ft(r)) b(r, l) && (Array.isArray(i) ? o[l] = Vt(i) : i && typeof i == "object" && i.constructor === Object ? o[l] = C(i) : o[l] = i);
64
- return o;
65
- }
66
- function K(r, o) {
67
- for (; r !== null; ) {
68
- const i = Yt(r, o);
69
- if (i) {
70
- if (i.get) return _(i.get);
71
- if (typeof i.value == "function") return _(i.value);
72
- }
73
- r = Gt(r);
74
- }
75
- function l() {
76
- return null;
77
- }
78
- return l;
79
- }
80
- const it = 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"]), Oe = A(["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"]), Zt = A(["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"]), Le = 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", "mprescripts"]), Jt = A(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), lt = A(["#text"]), st = 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", "popover", "popovertarget", "popovertargetaction", "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", "wrap", "xmlns", "slot"]), ve = A(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), ct = 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"]), le = A(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Qt = N(/\{\{[\w\W]*|[\w\W]*\}\}/gm), en = N(/<%[\w\W]*|[\w\W]*%>/gm), tn = N(/\$\{[\w\W]*/gm), nn = N(/^data-[\-\w.\u00B7-\uFFFF]+$/), on = N(/^aria-[\-\w]+$/), dt = N(
81
- /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
82
- // eslint-disable-line no-useless-escape
83
- ), rn = N(/^(?:\w+script|data):/i), an = N(
84
- /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
85
- // eslint-disable-line no-control-regex
86
- ), gt = N(/^html$/i), ln = N(/^[a-z][.\w]*(-[.\w]+)+$/i);
87
- var ut = /* @__PURE__ */ Object.freeze({
88
- __proto__: null,
89
- ARIA_ATTR: on,
90
- ATTR_WHITESPACE: an,
91
- CUSTOM_ELEMENT: ln,
92
- DATA_ATTR: nn,
93
- DOCTYPE_NAME: gt,
94
- ERB_EXPR: en,
95
- IS_ALLOWED_URI: dt,
96
- IS_SCRIPT_OR_DATA: rn,
97
- MUSTACHE_EXPR: Qt,
98
- TMPLIT_EXPR: tn
99
- });
100
- const V = {
101
- element: 1,
102
- text: 3,
103
- // Deprecated
104
- progressingInstruction: 7,
105
- comment: 8,
106
- document: 9
107
- }, sn = function() {
108
- return typeof window > "u" ? null : window;
109
- }, cn = function(r, o) {
110
- if (typeof r != "object" || typeof r.createPolicy != "function") return null;
111
- let l = null;
112
- const i = "data-tt-policy-suffix";
113
- o && o.hasAttribute(i) && (l = o.getAttribute(i));
114
- const h = "dompurify" + (l ? "#" + l : "");
115
- try {
116
- return r.createPolicy(h, {
117
- createHTML(R) {
118
- return R;
119
- },
120
- createScriptURL(R) {
121
- return R;
122
- }
123
- });
124
- } catch {
125
- return console.warn("TrustedTypes policy " + h + " could not be created."), null;
126
- }
127
- }, mt = function() {
128
- return {
129
- afterSanitizeAttributes: [],
130
- afterSanitizeElements: [],
131
- afterSanitizeShadowDOM: [],
132
- beforeSanitizeAttributes: [],
133
- beforeSanitizeElements: [],
134
- beforeSanitizeShadowDOM: [],
135
- uponSanitizeAttribute: [],
136
- uponSanitizeElement: [],
137
- uponSanitizeShadowNode: []
138
- };
139
- };
140
- function ht() {
141
- let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : sn();
142
- const o = (e) => ht(e);
143
- if (o.version = "3.2.6", o.removed = [], !r || !r.document || r.document.nodeType !== V.document || !r.Element) return o.isSupported = !1, o;
144
- let {
145
- document: l
146
- } = r;
147
- const i = l, h = i.currentScript, {
148
- DocumentFragment: R,
149
- HTMLTemplateElement: Tt,
150
- Node: ce,
151
- Element: xe,
152
- NodeFilter: F,
153
- NamedNodeMap: yt = r.NamedNodeMap || r.MozNamedAttrMap,
154
- HTMLFormElement: Et,
155
- DOMParser: At,
156
- trustedTypes: Z
157
- } = r, W = xe.prototype, _t = K(W, "cloneNode"), Nt = K(W, "remove"), St = K(W, "nextSibling"), bt = K(W, "childNodes"), J = K(W, "parentNode");
158
- if (typeof Tt == "function") {
159
- const e = l.createElement("template");
160
- e.content && e.content.ownerDocument && (l = e.content.ownerDocument);
161
- }
162
- let T, B = "";
163
- const {
164
- implementation: ue,
165
- createNodeIterator: Rt,
166
- createDocumentFragment: wt,
167
- getElementsByTagName: Ot
168
- } = l, {
169
- importNode: Lt
170
- } = i;
171
- let y = mt();
172
- o.isSupported = typeof ft == "function" && typeof J == "function" && ue && ue.createHTMLDocument !== void 0;
173
- const {
174
- MUSTACHE_EXPR: me,
175
- ERB_EXPR: fe,
176
- TMPLIT_EXPR: pe,
177
- DATA_ATTR: vt,
178
- ARIA_ATTR: Ct,
179
- IS_SCRIPT_OR_DATA: Dt,
180
- ATTR_WHITESPACE: Ie,
181
- CUSTOM_ELEMENT: xt
182
- } = ut;
183
- let {
184
- IS_ALLOWED_URI: ke
185
- } = ut, m = null;
186
- const Me = a({}, [...it, ...we, ...Oe, ...Le, ...lt]);
187
- let p = null;
188
- const Ue = a({}, [...st, ...ve, ...ct, ...le]);
189
- let u = Object.seal(pt(null, {
190
- tagNameCheck: {
191
- writable: !0,
192
- configurable: !1,
193
- enumerable: !0,
194
- value: null
195
- },
196
- attributeNameCheck: {
197
- writable: !0,
198
- configurable: !1,
199
- enumerable: !0,
200
- value: null
201
- },
202
- allowCustomizedBuiltInElements: {
203
- writable: !0,
204
- configurable: !1,
205
- enumerable: !0,
206
- value: !1
207
- }
208
- })), G = null, de = null, Pe = !0, ge = !0, ze = !1, He = !0, I = !1, Q = !0, D = !1, he = !1, Te = !1, k = !1, ee = !1, te = !1, Fe = !0, We = !1;
209
- const It = "user-content-";
210
- let ye = !0, Y = !1, M = {}, U = null;
211
- const Be = a({}, ["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"]);
212
- let Ge = null;
213
- const Ye = a({}, ["audio", "video", "img", "source", "image", "track"]);
214
- let Ee = null;
215
- const je = a({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ne = "http://www.w3.org/1998/Math/MathML", oe = "http://www.w3.org/2000/svg", O = "http://www.w3.org/1999/xhtml";
216
- let P = O, Ae = !1, _e = null;
217
- const kt = a({}, [ne, oe, O], Re);
218
- let re = a({}, ["mi", "mo", "mn", "ms", "mtext"]), ae = a({}, ["annotation-xml"]);
219
- const Mt = a({}, ["title", "style", "font", "a", "script"]);
220
- let j = null;
221
- const Ut = ["application/xhtml+xml", "text/html"], Pt = "text/html";
222
- let f = null, z = null;
223
- const zt = l.createElement("form"), Xe = function(e) {
224
- return e instanceof RegExp || e instanceof Function;
225
- }, Ne = function() {
226
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
227
- if (!(z && z === e)) {
228
- if ((!e || typeof e != "object") && (e = {}), e = C(e), j = // eslint-disable-next-line unicorn/prefer-includes
229
- Ut.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? Pt : e.PARSER_MEDIA_TYPE, f = j === "application/xhtml+xml" ? Re : se, m = b(e, "ALLOWED_TAGS") ? a({}, e.ALLOWED_TAGS, f) : Me, p = b(e, "ALLOWED_ATTR") ? a({}, e.ALLOWED_ATTR, f) : Ue, _e = b(e, "ALLOWED_NAMESPACES") ? a({}, e.ALLOWED_NAMESPACES, Re) : kt, Ee = b(e, "ADD_URI_SAFE_ATTR") ? a(C(je), e.ADD_URI_SAFE_ATTR, f) : je, Ge = b(e, "ADD_DATA_URI_TAGS") ? a(C(Ye), e.ADD_DATA_URI_TAGS, f) : Ye, U = b(e, "FORBID_CONTENTS") ? a({}, e.FORBID_CONTENTS, f) : Be, G = b(e, "FORBID_TAGS") ? a({}, e.FORBID_TAGS, f) : C({}), de = b(e, "FORBID_ATTR") ? a({}, e.FORBID_ATTR, f) : C({}), M = b(e, "USE_PROFILES") ? e.USE_PROFILES : !1, Pe = e.ALLOW_ARIA_ATTR !== !1, ge = e.ALLOW_DATA_ATTR !== !1, ze = e.ALLOW_UNKNOWN_PROTOCOLS || !1, He = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, I = e.SAFE_FOR_TEMPLATES || !1, Q = e.SAFE_FOR_XML !== !1, D = e.WHOLE_DOCUMENT || !1, k = e.RETURN_DOM || !1, ee = e.RETURN_DOM_FRAGMENT || !1, te = e.RETURN_TRUSTED_TYPE || !1, Te = e.FORCE_BODY || !1, Fe = e.SANITIZE_DOM !== !1, We = e.SANITIZE_NAMED_PROPS || !1, ye = e.KEEP_CONTENT !== !1, Y = e.IN_PLACE || !1, ke = e.ALLOWED_URI_REGEXP || dt, P = e.NAMESPACE || O, re = e.MATHML_TEXT_INTEGRATION_POINTS || re, ae = e.HTML_INTEGRATION_POINTS || ae, u = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && Xe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (u.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && Xe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (u.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (u.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), I && (ge = !1), ee && (k = !0), M && (m = a({}, lt), p = [], M.html === !0 && (a(m, it), a(p, st)), M.svg === !0 && (a(m, we), a(p, ve), a(p, le)), M.svgFilters === !0 && (a(m, Oe), a(p, ve), a(p, le)), M.mathMl === !0 && (a(m, Le), a(p, ct), a(p, le))), e.ADD_TAGS && (m === Me && (m = C(m)), a(m, e.ADD_TAGS, f)), e.ADD_ATTR && (p === Ue && (p = C(p)), a(p, e.ADD_ATTR, f)), e.ADD_URI_SAFE_ATTR && a(Ee, e.ADD_URI_SAFE_ATTR, f), e.FORBID_CONTENTS && (U === Be && (U = C(U)), a(U, e.FORBID_CONTENTS, f)), ye && (m["#text"] = !0), D && a(m, ["html", "head", "body"]), m.table && (a(m, ["tbody"]), delete G.tbody), e.TRUSTED_TYPES_POLICY) {
230
- if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw $('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
231
- if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw $('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
232
- T = e.TRUSTED_TYPES_POLICY, B = T.createHTML("");
233
- } else T === void 0 && (T = cn(Z, h)), T !== null && typeof B == "string" && (B = T.createHTML(""));
234
- A && A(e), z = e;
235
- }
236
- }, qe = a({}, [...we, ...Oe, ...Zt]), $e = a({}, [...Le, ...Jt]), Ht = function(e) {
237
- let n = J(e);
238
- (!n || !n.tagName) && (n = {
239
- namespaceURI: P,
240
- tagName: "template"
241
- });
242
- const t = se(e.tagName), s = se(n.tagName);
243
- return _e[e.namespaceURI] ? e.namespaceURI === oe ? n.namespaceURI === O ? t === "svg" : n.namespaceURI === ne ? t === "svg" && (s === "annotation-xml" || re[s]) : !!qe[t] : e.namespaceURI === ne ? n.namespaceURI === O ? t === "math" : n.namespaceURI === oe ? t === "math" && ae[s] : !!$e[t] : e.namespaceURI === O ? n.namespaceURI === oe && !ae[s] || n.namespaceURI === ne && !re[s] ? !1 : !$e[t] && (Mt[t] || !qe[t]) : !!(j === "application/xhtml+xml" && _e[e.namespaceURI]) : !1;
244
- }, x = function(e) {
245
- X(o.removed, {
246
- element: e
247
- });
248
- try {
249
- J(e).removeChild(e);
250
- } catch {
251
- Nt(e);
252
- }
253
- }, H = function(e, n) {
254
- try {
255
- X(o.removed, {
256
- attribute: n.getAttributeNode(e),
257
- from: n
258
- });
259
- } catch {
260
- X(o.removed, {
261
- attribute: null,
262
- from: n
263
- });
264
- }
265
- if (n.removeAttribute(e), e === "is") if (k || ee) try {
266
- x(n);
267
- } catch {
268
- }
269
- else try {
270
- n.setAttribute(e, "");
271
- } catch {
272
- }
273
- }, Ke = function(e) {
274
- let n = null, t = null;
275
- if (Te) e = "<remove></remove>" + e;
276
- else {
277
- const c = at(e, /^[\r\n\t ]+/);
278
- t = c && c[0];
279
- }
280
- j === "application/xhtml+xml" && P === O && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
281
- const s = T ? T.createHTML(e) : e;
282
- if (P === O) try {
283
- n = new At().parseFromString(s, j);
284
- } catch {
285
- }
286
- if (!n || !n.documentElement) {
287
- n = ue.createDocument(P, "template", null);
288
- try {
289
- n.documentElement.innerHTML = Ae ? B : s;
290
- } catch {
291
- }
292
- }
293
- const d = n.body || n.documentElement;
294
- return e && t && d.insertBefore(l.createTextNode(t), d.childNodes[0] || null), P === O ? Ot.call(n, D ? "html" : "body")[0] : D ? n.documentElement : d;
295
- }, Ve = function(e) {
296
- return Rt.call(
297
- e.ownerDocument || e,
298
- e,
299
- // eslint-disable-next-line no-bitwise
300
- F.SHOW_ELEMENT | F.SHOW_COMMENT | F.SHOW_TEXT | F.SHOW_PROCESSING_INSTRUCTION | F.SHOW_CDATA_SECTION,
301
- null
302
- );
303
- }, Se = function(e) {
304
- return e instanceof Et && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof yt) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
305
- }, Ze = function(e) {
306
- return typeof ce == "function" && e instanceof ce;
307
- };
308
- function L(e, n, t) {
309
- ie(e, (s) => {
310
- s.call(o, n, t, z);
311
- });
312
- }
313
- const Je = function(e) {
314
- let n = null;
315
- if (L(y.beforeSanitizeElements, e, null), Se(e)) return x(e), !0;
316
- const t = f(e.nodeName);
317
- if (L(y.uponSanitizeElement, e, {
318
- tagName: t,
319
- allowedTags: m
320
- }), Q && e.hasChildNodes() && !Ze(e.firstElementChild) && E(/<[/\w!]/g, e.innerHTML) && E(/<[/\w!]/g, e.textContent) || e.nodeType === V.progressingInstruction || Q && e.nodeType === V.comment && E(/<[/\w]/g, e.data)) return x(e), !0;
321
- if (!m[t] || G[t]) {
322
- if (!G[t] && et(t) && (u.tagNameCheck instanceof RegExp && E(u.tagNameCheck, t) || u.tagNameCheck instanceof Function && u.tagNameCheck(t))) return !1;
323
- if (ye && !U[t]) {
324
- const s = J(e) || e.parentNode, d = bt(e) || e.childNodes;
325
- if (d && s) {
326
- const c = d.length;
327
- for (let v = c - 1; v >= 0; --v) {
328
- const S = _t(d[v], !0);
329
- S.__removalCount = (e.__removalCount || 0) + 1, s.insertBefore(S, St(e));
330
- }
331
- }
332
- }
333
- return x(e), !0;
334
- }
335
- return e instanceof xe && !Ht(e) || (t === "noscript" || t === "noembed" || t === "noframes") && E(/<\/no(script|embed|frames)/i, e.innerHTML) ? (x(e), !0) : (I && e.nodeType === V.text && (n = e.textContent, ie([me, fe, pe], (s) => {
336
- n = q(n, s, " ");
337
- }), e.textContent !== n && (X(o.removed, {
338
- element: e.cloneNode()
339
- }), e.textContent = n)), L(y.afterSanitizeElements, e, null), !1);
340
- }, Qe = function(e, n, t) {
341
- if (Fe && (n === "id" || n === "name") && (t in l || t in zt)) return !1;
342
- if (!(ge && !de[n] && E(vt, n)) && !(Pe && E(Ct, n))) {
343
- if (!p[n] || de[n]) {
344
- if (
345
- // First condition does a very basic check if a) it's basically a valid custom element tagname AND
346
- // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
347
- // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
348
- !(et(e) && (u.tagNameCheck instanceof RegExp && E(u.tagNameCheck, e) || u.tagNameCheck instanceof Function && u.tagNameCheck(e)) && (u.attributeNameCheck instanceof RegExp && E(u.attributeNameCheck, n) || u.attributeNameCheck instanceof Function && u.attributeNameCheck(n)) || // Alternative, second condition checks if it's an `is`-attribute, AND
349
- // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
350
- n === "is" && u.allowCustomizedBuiltInElements && (u.tagNameCheck instanceof RegExp && E(u.tagNameCheck, t) || u.tagNameCheck instanceof Function && u.tagNameCheck(t)))
351
- ) return !1;
352
- } else if (!Ee[n] && !E(ke, q(t, Ie, "")) && !((n === "src" || n === "xlink:href" || n === "href") && e !== "script" && qt(t, "data:") === 0 && Ge[e]) && !(ze && !E(Dt, q(t, Ie, ""))) && t)
353
- return !1;
354
- }
355
- return !0;
356
- }, et = function(e) {
357
- return e !== "annotation-xml" && at(e, xt);
358
- }, tt = function(e) {
359
- L(y.beforeSanitizeAttributes, e, null);
360
- const {
361
- attributes: n
362
- } = e;
363
- if (!n || Se(e)) return;
364
- const t = {
365
- attrName: "",
366
- attrValue: "",
367
- keepAttr: !0,
368
- allowedAttributes: p,
369
- forceKeepAttr: void 0
370
- };
371
- let s = n.length;
372
- for (; s--; ) {
373
- const d = n[s], {
374
- name: c,
375
- namespaceURI: v,
376
- value: S
377
- } = d, w = f(c), be = S;
378
- let g = c === "value" ? be : $t(be);
379
- if (t.attrName = w, t.attrValue = g, t.keepAttr = !0, t.forceKeepAttr = void 0, L(y.uponSanitizeAttribute, e, t), g = t.attrValue, We && (w === "id" || w === "name") && (H(c, e), g = It + g), Q && E(/((--!?|])>)|<\/(style|title)/i, g)) {
380
- H(c, e);
381
- continue;
382
- }
383
- if (t.forceKeepAttr) continue;
384
- if (!t.keepAttr) {
385
- H(c, e);
386
- continue;
387
- }
388
- if (!He && E(/\/>/i, g)) {
389
- H(c, e);
390
- continue;
391
- }
392
- I && ie([me, fe, pe], (Wt) => {
393
- g = q(g, Wt, " ");
394
- });
395
- const nt = f(e.nodeName);
396
- if (!Qe(nt, w, g)) {
397
- H(c, e);
398
- continue;
399
- }
400
- if (T && typeof Z == "object" && typeof Z.getAttributeType == "function" && !v) switch (Z.getAttributeType(nt, w)) {
401
- case "TrustedHTML": {
402
- g = T.createHTML(g);
403
- break;
404
- }
405
- case "TrustedScriptURL": {
406
- g = T.createScriptURL(g);
407
- break;
408
- }
409
- }
410
- if (g !== be) try {
411
- v ? e.setAttributeNS(v, c, g) : e.setAttribute(c, g), Se(e) ? x(e) : rt(o.removed);
412
- } catch {
413
- H(c, e);
414
- }
415
- }
416
- L(y.afterSanitizeAttributes, e, null);
417
- }, Ft = function e(n) {
418
- let t = null;
419
- const s = Ve(n);
420
- for (L(y.beforeSanitizeShadowDOM, n, null); t = s.nextNode(); ) L(y.uponSanitizeShadowNode, t, null), Je(t), tt(t), t.content instanceof R && e(t.content);
421
- L(y.afterSanitizeShadowDOM, n, null);
422
- };
423
- return o.sanitize = function(e) {
424
- let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = null, s = null, d = null, c = null;
425
- if (Ae = !e, Ae && (e = "<!-->"), typeof e != "string" && !Ze(e)) if (typeof e.toString == "function") {
426
- if (e = e.toString(), typeof e != "string") throw $("dirty is not a string, aborting");
427
- } else throw $("toString is not a function");
428
- if (!o.isSupported) return e;
429
- if (he || Ne(n), o.removed = [], typeof e == "string" && (Y = !1), Y) {
430
- if (e.nodeName) {
431
- const w = f(e.nodeName);
432
- if (!m[w] || G[w]) throw $("root node is forbidden and cannot be sanitized in-place");
433
- }
434
- } else if (e instanceof ce) t = Ke("<!---->"), s = t.ownerDocument.importNode(e, !0), s.nodeType === V.element && s.nodeName === "BODY" || s.nodeName === "HTML" ? t = s : t.appendChild(s);
435
- else {
436
- if (!k && !I && !D && // eslint-disable-next-line unicorn/prefer-includes
437
- e.indexOf("<") === -1) return T && te ? T.createHTML(e) : e;
438
- if (t = Ke(e), !t) return k ? null : te ? B : "";
439
- }
440
- t && Te && x(t.firstChild);
441
- const v = Ve(Y ? e : t);
442
- for (; d = v.nextNode(); ) Je(d), tt(d), d.content instanceof R && Ft(d.content);
443
- if (Y) return e;
444
- if (k) {
445
- if (ee) for (c = wt.call(t.ownerDocument); t.firstChild; ) c.appendChild(t.firstChild);
446
- else c = t;
447
- return (p.shadowroot || p.shadowrootmode) && (c = Lt.call(i, c, !0)), c;
448
- }
449
- let S = D ? t.outerHTML : t.innerHTML;
450
- return D && m["!doctype"] && t.ownerDocument && t.ownerDocument.doctype && t.ownerDocument.doctype.name && E(gt, t.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + t.ownerDocument.doctype.name + `>
451
- ` + S), I && ie([me, fe, pe], (w) => {
452
- S = q(S, w, " ");
453
- }), T && te ? T.createHTML(S) : S;
454
- }, o.setConfig = function() {
455
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
456
- Ne(e), he = !0;
457
- }, o.clearConfig = function() {
458
- z = null, he = !1;
459
- }, o.isValidAttribute = function(e, n, t) {
460
- z || Ne({});
461
- const s = f(e), d = f(n);
462
- return Qe(s, d, t);
463
- }, o.addHook = function(e, n) {
464
- typeof n == "function" && X(y[e], n);
465
- }, o.removeHook = function(e, n) {
466
- if (n !== void 0) {
467
- const t = jt(y[e], n);
468
- return t === -1 ? void 0 : Xt(y[e], t, 1)[0];
469
- }
470
- return rt(y[e]);
471
- }, o.removeHooks = function(e) {
472
- y[e] = [];
473
- }, o.removeAllHooks = function() {
474
- y = mt();
475
- }, o;
476
- }
477
- var un = ht();
478
- export {
479
- un as default
480
- };