@mlightcad/cad-pdf-plugin 1.5.5 → 1.5.6

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,663 +0,0 @@
1
- /*! @license DOMPurify 3.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/3.4.7/LICENSE */
2
- function yt(n, o) {
3
- (o == null || o > n.length) && (o = n.length);
4
- for (var a = 0, s = Array(o); a < o; a++) s[a] = n[a];
5
- return s;
6
- }
7
- function nn(n) {
8
- if (Array.isArray(n)) return n;
9
- }
10
- function on(n, o) {
11
- var a = n == null ? null : typeof Symbol < "u" && n[Symbol.iterator] || n["@@iterator"];
12
- if (a != null) {
13
- var s, f, p, b, te = [], I = !0, ne = !1;
14
- try {
15
- if (p = (a = a.call(n)).next, o !== 0) for (; !(I = (s = p.call(a)).done) && (te.push(s.value), te.length !== o); I = !0) ;
16
- } catch (Le) {
17
- ne = !0, f = Le;
18
- } finally {
19
- try {
20
- if (!I && a.return != null && (b = a.return(), Object(b) !== b)) return;
21
- } finally {
22
- if (ne) throw f;
23
- }
24
- }
25
- return te;
26
- }
27
- }
28
- function rn() {
29
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
30
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
31
- }
32
- function an(n, o) {
33
- return nn(n) || on(n, o) || sn(n, o) || rn();
34
- }
35
- function sn(n, o) {
36
- if (n) {
37
- if (typeof n == "string") return yt(n, o);
38
- var a = {}.toString.call(n).slice(8, -1);
39
- return a === "Object" && n.constructor && (a = n.constructor.name), a === "Map" || a === "Set" ? Array.from(n) : a === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a) ? yt(n, o) : void 0;
40
- }
41
- }
42
- const kt = Object.entries, bt = Object.setPrototypeOf, ln = Object.isFrozen, cn = Object.getPrototypeOf, fn = Object.getOwnPropertyDescriptor;
43
- let D = Object.freeze, C = Object.seal, ee = Object.create, Ft = typeof Reflect < "u" && Reflect, Ke = Ft.apply, Ze = Ft.construct;
44
- D || (D = function(o) {
45
- return o;
46
- });
47
- C || (C = function(o) {
48
- return o;
49
- });
50
- Ke || (Ke = function(o, a) {
51
- for (var s = arguments.length, f = new Array(s > 2 ? s - 2 : 0), p = 2; p < s; p++)
52
- f[p - 2] = arguments[p];
53
- return o.apply(a, f);
54
- });
55
- Ze || (Ze = function(o) {
56
- for (var a = arguments.length, s = new Array(a > 1 ? a - 1 : 0), f = 1; f < a; f++)
57
- s[f - 1] = arguments[f];
58
- return new o(...s);
59
- });
60
- const Z = A(Array.prototype.forEach), un = A(Array.prototype.lastIndexOf), Rt = A(Array.prototype.pop), J = A(Array.prototype.push), mn = A(Array.prototype.splice), N = Array.isArray, ue = A(String.prototype.toLowerCase), Ye = A(String.prototype.toString), Ot = A(String.prototype.match), Q = A(String.prototype.replace), Nt = A(String.prototype.indexOf), pn = A(String.prototype.trim), dn = A(Number.prototype.toString), Tn = A(Boolean.prototype.toString), Dt = typeof BigInt > "u" ? null : A(BigInt.prototype.toString), It = typeof Symbol > "u" ? null : A(Symbol.prototype.toString), d = A(Object.prototype.hasOwnProperty), ce = A(Object.prototype.toString), y = A(RegExp.prototype.test), fe = gn(TypeError);
61
- function A(n) {
62
- return function(o) {
63
- o instanceof RegExp && (o.lastIndex = 0);
64
- for (var a = arguments.length, s = new Array(a > 1 ? a - 1 : 0), f = 1; f < a; f++)
65
- s[f - 1] = arguments[f];
66
- return Ke(n, o, s);
67
- };
68
- }
69
- function gn(n) {
70
- return function() {
71
- for (var o = arguments.length, a = new Array(o), s = 0; s < o; s++)
72
- a[s] = arguments[s];
73
- return Ze(n, a);
74
- };
75
- }
76
- function l(n, o) {
77
- let a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ue;
78
- if (bt && bt(n, null), !N(o))
79
- return n;
80
- let s = o.length;
81
- for (; s--; ) {
82
- let f = o[s];
83
- if (typeof f == "string") {
84
- const p = a(f);
85
- p !== f && (ln(o) || (o[s] = p), f = p);
86
- }
87
- n[f] = !0;
88
- }
89
- return n;
90
- }
91
- function _n(n) {
92
- for (let o = 0; o < n.length; o++)
93
- d(n, o) || (n[o] = null);
94
- return n;
95
- }
96
- function R(n) {
97
- const o = ee(null);
98
- for (const s of kt(n)) {
99
- var a = an(s, 2);
100
- const f = a[0], p = a[1];
101
- d(n, f) && (N(p) ? o[f] = _n(p) : p && typeof p == "object" && p.constructor === Object ? o[f] = R(p) : o[f] = p);
102
- }
103
- return o;
104
- }
105
- function hn(n) {
106
- switch (typeof n) {
107
- case "string":
108
- return n;
109
- case "number":
110
- return dn(n);
111
- case "boolean":
112
- return Tn(n);
113
- case "bigint":
114
- return Dt ? Dt(n) : "0";
115
- case "symbol":
116
- return It ? It(n) : "Symbol()";
117
- case "undefined":
118
- return ce(n);
119
- case "function":
120
- case "object": {
121
- if (n === null)
122
- return ce(n);
123
- const o = n, a = U(o, "toString");
124
- if (typeof a == "function") {
125
- const s = a(o);
126
- return typeof s == "string" ? s : ce(s);
127
- }
128
- return ce(n);
129
- }
130
- default:
131
- return ce(n);
132
- }
133
- }
134
- function U(n, o) {
135
- for (; n !== null; ) {
136
- const s = fn(n, o);
137
- if (s) {
138
- if (s.get)
139
- return A(s.get);
140
- if (typeof s.value == "function")
141
- return A(s.value);
142
- }
143
- n = cn(n);
144
- }
145
- function a() {
146
- return null;
147
- }
148
- return a;
149
- }
150
- function An(n) {
151
- try {
152
- return y(n, ""), !0;
153
- } catch {
154
- return !1;
155
- }
156
- }
157
- const Lt = D(["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"]), $e = D(["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"]), Xe = D(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), En = D(["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"]), Ve = D(["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"]), Sn = D(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ct = D(["#text"]), wt = D(["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"]), qe = D(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Mt = D(["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"]), Ie = D(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), yn = C(/{{[\w\W]*|^[\w\W]*}}/g), bn = C(/<%[\w\W]*|^[\w\W]*%>/g), Rn = C(/\${[\w\W]*/g), On = C(/^data-[\-\w.\u00B7-\uFFFF]+$/), Nn = C(/^aria-[\-\w]+$/), xt = C(
158
- /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
159
- // eslint-disable-line no-useless-escape
160
- ), Dn = C(/^(?:\w+script|data):/i), In = C(
161
- /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
162
- // eslint-disable-line no-control-regex
163
- ), Ln = C(/^html$/i), Cn = C(/^[a-z][.\w]*(-[.\w]+)+$/i), v = {
164
- element: 1,
165
- attribute: 2,
166
- text: 3,
167
- cdataSection: 4,
168
- entityReference: 5,
169
- // Deprecated
170
- entityNode: 6,
171
- // Deprecated
172
- progressingInstruction: 7,
173
- comment: 8,
174
- document: 9,
175
- documentType: 10,
176
- documentFragment: 11,
177
- notation: 12
178
- // Deprecated
179
- }, wn = function() {
180
- return typeof window > "u" ? null : window;
181
- }, Mn = function(o, a) {
182
- if (typeof o != "object" || typeof o.createPolicy != "function")
183
- return null;
184
- let s = null;
185
- const f = "data-tt-policy-suffix";
186
- a && a.hasAttribute(f) && (s = a.getAttribute(f));
187
- const p = "dompurify" + (s ? "#" + s : "");
188
- try {
189
- return o.createPolicy(p, {
190
- createHTML(b) {
191
- return b;
192
- },
193
- createScriptURL(b) {
194
- return b;
195
- }
196
- });
197
- } catch {
198
- return console.warn("TrustedTypes policy " + p + " could not be created."), null;
199
- }
200
- }, Pt = function() {
201
- return {
202
- afterSanitizeAttributes: [],
203
- afterSanitizeElements: [],
204
- afterSanitizeShadowDOM: [],
205
- beforeSanitizeAttributes: [],
206
- beforeSanitizeElements: [],
207
- beforeSanitizeShadowDOM: [],
208
- uponSanitizeAttribute: [],
209
- uponSanitizeElement: [],
210
- uponSanitizeShadowNode: []
211
- };
212
- };
213
- function vt() {
214
- let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : wn();
215
- const o = (i) => vt(i);
216
- if (o.version = "3.4.7", o.removed = [], !n || !n.document || n.document.nodeType !== v.document || !n.Element)
217
- return o.isSupported = !1, o;
218
- let a = n.document;
219
- const s = a, f = s.currentScript;
220
- n.DocumentFragment;
221
- const p = n.HTMLTemplateElement, b = n.Node, te = n.Element, I = n.NodeFilter, ne = n.NamedNodeMap;
222
- ne === void 0 && (n.NamedNodeMap || n.MozNamedAttrMap), n.HTMLFormElement;
223
- const Le = n.DOMParser, me = n.trustedTypes, W = te.prototype, Ut = U(W, "cloneNode"), Ht = U(W, "remove"), zt = U(W, "nextSibling"), pe = U(W, "childNodes"), de = U(W, "parentNode"), Te = U(W, "shadowRoot"), Gt = U(W, "attributes"), w = b && b.prototype ? U(b.prototype, "nodeType") : null, Y = b && b.prototype ? U(b.prototype, "nodeName") : null;
224
- if (typeof p == "function") {
225
- const i = a.createElement("template");
226
- i.content && i.content.ownerDocument && (a = i.content.ownerDocument);
227
- }
228
- let O, oe = "";
229
- const ge = a, Ce = ge.implementation, Je = ge.createNodeIterator, Wt = ge.createDocumentFragment, Bt = ge.getElementsByTagName, jt = s.importNode;
230
- let E = Pt();
231
- o.isSupported = typeof kt == "function" && typeof de == "function" && Ce && Ce.createHTMLDocument !== void 0;
232
- const _e = yn, he = bn, Ae = Rn, Yt = On, $t = Nn, Xt = Dn, Qe = In, Vt = Cn;
233
- let et = xt, T = null;
234
- const we = l({}, [...Lt, ...$e, ...Xe, ...Ve, ...Ct]);
235
- let h = null;
236
- const Me = l({}, [...wt, ...qe, ...Mt, ...Ie]);
237
- let g = Object.seal(ee(null, {
238
- tagNameCheck: {
239
- writable: !0,
240
- configurable: !1,
241
- enumerable: !0,
242
- value: null
243
- },
244
- attributeNameCheck: {
245
- writable: !0,
246
- configurable: !1,
247
- enumerable: !0,
248
- value: null
249
- },
250
- allowCustomizedBuiltInElements: {
251
- writable: !0,
252
- configurable: !1,
253
- enumerable: !0,
254
- value: !1
255
- }
256
- })), re = null, Ee = null;
257
- const z = Object.seal(ee(null, {
258
- tagCheck: {
259
- writable: !0,
260
- configurable: !1,
261
- enumerable: !0,
262
- value: null
263
- },
264
- attributeCheck: {
265
- writable: !0,
266
- configurable: !1,
267
- enumerable: !0,
268
- value: null
269
- }
270
- }));
271
- let tt = !0, xe = !0, nt = !1, ot = !0, G = !1, ie = !0, B = !1, Pe = !1, ke = !1, $ = !1, Se = !1, ye = !1, rt = !0, it = !1;
272
- const at = "user-content-";
273
- let Fe = !0, ae = !1, X = {}, P = null;
274
- const 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"]);
275
- let st = null;
276
- const lt = l({}, ["audio", "video", "img", "source", "image", "track"]);
277
- let Ue = null;
278
- const ct = l({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), be = "http://www.w3.org/1998/Math/MathML", Re = "http://www.w3.org/2000/svg", k = "http://www.w3.org/1999/xhtml";
279
- let V = k, He = !1, ze = null;
280
- const qt = l({}, [be, Re, k], Ye);
281
- let Ge = l({}, ["mi", "mo", "mn", "ms", "mtext"]), We = l({}, ["annotation-xml"]);
282
- const Kt = l({}, ["title", "style", "font", "a", "script"]);
283
- let se = null;
284
- const Zt = ["application/xhtml+xml", "text/html"], Jt = "text/html";
285
- let _ = null, q = null;
286
- const Qt = a.createElement("form"), ft = function(e) {
287
- return e instanceof RegExp || e instanceof Function;
288
- }, Be = function() {
289
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
290
- if (q && q === e)
291
- return;
292
- (!e || typeof e != "object") && (e = {}), e = R(e), se = // eslint-disable-next-line unicorn/prefer-includes
293
- Zt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? Jt : e.PARSER_MEDIA_TYPE, _ = se === "application/xhtml+xml" ? Ye : ue, T = d(e, "ALLOWED_TAGS") && N(e.ALLOWED_TAGS) ? l({}, e.ALLOWED_TAGS, _) : we, h = d(e, "ALLOWED_ATTR") && N(e.ALLOWED_ATTR) ? l({}, e.ALLOWED_ATTR, _) : Me, ze = d(e, "ALLOWED_NAMESPACES") && N(e.ALLOWED_NAMESPACES) ? l({}, e.ALLOWED_NAMESPACES, Ye) : qt, Ue = d(e, "ADD_URI_SAFE_ATTR") && N(e.ADD_URI_SAFE_ATTR) ? l(R(ct), e.ADD_URI_SAFE_ATTR, _) : ct, st = d(e, "ADD_DATA_URI_TAGS") && N(e.ADD_DATA_URI_TAGS) ? l(R(lt), e.ADD_DATA_URI_TAGS, _) : lt, P = d(e, "FORBID_CONTENTS") && N(e.FORBID_CONTENTS) ? l({}, e.FORBID_CONTENTS, _) : ve, re = d(e, "FORBID_TAGS") && N(e.FORBID_TAGS) ? l({}, e.FORBID_TAGS, _) : R({}), Ee = d(e, "FORBID_ATTR") && N(e.FORBID_ATTR) ? l({}, e.FORBID_ATTR, _) : R({}), X = d(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? R(e.USE_PROFILES) : e.USE_PROFILES : !1, tt = e.ALLOW_ARIA_ATTR !== !1, xe = e.ALLOW_DATA_ATTR !== !1, nt = e.ALLOW_UNKNOWN_PROTOCOLS || !1, ot = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, G = e.SAFE_FOR_TEMPLATES || !1, ie = e.SAFE_FOR_XML !== !1, B = e.WHOLE_DOCUMENT || !1, $ = e.RETURN_DOM || !1, Se = e.RETURN_DOM_FRAGMENT || !1, ye = e.RETURN_TRUSTED_TYPE || !1, ke = e.FORCE_BODY || !1, rt = e.SANITIZE_DOM !== !1, it = e.SANITIZE_NAMED_PROPS || !1, Fe = e.KEEP_CONTENT !== !1, ae = e.IN_PLACE || !1, et = An(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : xt, V = typeof e.NAMESPACE == "string" ? e.NAMESPACE : k, Ge = d(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? R(e.MATHML_TEXT_INTEGRATION_POINTS) : l({}, ["mi", "mo", "mn", "ms", "mtext"]), We = d(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? R(e.HTML_INTEGRATION_POINTS) : l({}, ["annotation-xml"]);
294
- const t = d(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? R(e.CUSTOM_ELEMENT_HANDLING) : ee(null);
295
- if (g = ee(null), d(t, "tagNameCheck") && ft(t.tagNameCheck) && (g.tagNameCheck = t.tagNameCheck), d(t, "attributeNameCheck") && ft(t.attributeNameCheck) && (g.attributeNameCheck = t.attributeNameCheck), d(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (g.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), G && (xe = !1), Se && ($ = !0), X && (T = l({}, Ct), h = ee(null), X.html === !0 && (l(T, Lt), l(h, wt)), X.svg === !0 && (l(T, $e), l(h, qe), l(h, Ie)), X.svgFilters === !0 && (l(T, Xe), l(h, qe), l(h, Ie)), X.mathMl === !0 && (l(T, Ve), l(h, Mt), l(h, Ie))), z.tagCheck = null, z.attributeCheck = null, d(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? z.tagCheck = e.ADD_TAGS : N(e.ADD_TAGS) && (T === we && (T = R(T)), l(T, e.ADD_TAGS, _))), d(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? z.attributeCheck = e.ADD_ATTR : N(e.ADD_ATTR) && (h === Me && (h = R(h)), l(h, e.ADD_ATTR, _))), d(e, "ADD_URI_SAFE_ATTR") && N(e.ADD_URI_SAFE_ATTR) && l(Ue, e.ADD_URI_SAFE_ATTR, _), d(e, "FORBID_CONTENTS") && N(e.FORBID_CONTENTS) && (P === ve && (P = R(P)), l(P, e.FORBID_CONTENTS, _)), d(e, "ADD_FORBID_CONTENTS") && N(e.ADD_FORBID_CONTENTS) && (P === ve && (P = R(P)), l(P, e.ADD_FORBID_CONTENTS, _)), Fe && (T["#text"] = !0), B && l(T, ["html", "head", "body"]), T.table && (l(T, ["tbody"]), delete re.tbody), e.TRUSTED_TYPES_POLICY) {
296
- if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
297
- throw fe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
298
- if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
299
- throw fe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
300
- O = e.TRUSTED_TYPES_POLICY, oe = O.createHTML("");
301
- } else
302
- O === void 0 && (O = Mn(me, f)), O !== null && typeof oe == "string" && (oe = O.createHTML(""));
303
- (E.uponSanitizeElement.length > 0 || E.uponSanitizeAttribute.length > 0) && T === we && (T = R(T)), E.uponSanitizeAttribute.length > 0 && h === Me && (h = R(h)), D && D(e), q = e;
304
- }, ut = l({}, [...$e, ...Xe, ...En]), mt = l({}, [...Ve, ...Sn]), en = function(e) {
305
- let t = de(e);
306
- (!t || !t.tagName) && (t = {
307
- namespaceURI: V,
308
- tagName: "template"
309
- });
310
- const r = ue(e.tagName), u = ue(t.tagName);
311
- return ze[e.namespaceURI] ? e.namespaceURI === Re ? t.namespaceURI === k ? r === "svg" : t.namespaceURI === be ? r === "svg" && (u === "annotation-xml" || Ge[u]) : !!ut[r] : e.namespaceURI === be ? t.namespaceURI === k ? r === "math" : t.namespaceURI === Re ? r === "math" && We[u] : !!mt[r] : e.namespaceURI === k ? t.namespaceURI === Re && !We[u] || t.namespaceURI === be && !Ge[u] ? !1 : !mt[r] && (Kt[r] || !ut[r]) : !!(se === "application/xhtml+xml" && ze[e.namespaceURI]) : !1;
312
- }, M = function(e) {
313
- J(o.removed, {
314
- element: e
315
- });
316
- try {
317
- de(e).removeChild(e);
318
- } catch {
319
- Ht(e);
320
- }
321
- }, j = function(e, t) {
322
- try {
323
- J(o.removed, {
324
- attribute: t.getAttributeNode(e),
325
- from: t
326
- });
327
- } catch {
328
- J(o.removed, {
329
- attribute: null,
330
- from: t
331
- });
332
- }
333
- if (t.removeAttribute(e), e === "is")
334
- if ($ || Se)
335
- try {
336
- M(t);
337
- } catch {
338
- }
339
- else
340
- try {
341
- t.setAttribute(e, "");
342
- } catch {
343
- }
344
- }, pt = function(e) {
345
- let t = null, r = null;
346
- if (ke)
347
- e = "<remove></remove>" + e;
348
- else {
349
- const m = Ot(e, /^[\r\n\t ]+/);
350
- r = m && m[0];
351
- }
352
- se === "application/xhtml+xml" && V === k && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
353
- const u = O ? O.createHTML(e) : e;
354
- if (V === k)
355
- try {
356
- t = new Le().parseFromString(u, se);
357
- } catch {
358
- }
359
- if (!t || !t.documentElement) {
360
- t = Ce.createDocument(V, "template", null);
361
- try {
362
- t.documentElement.innerHTML = He ? oe : u;
363
- } catch {
364
- }
365
- }
366
- const c = t.body || t.documentElement;
367
- return e && r && c.insertBefore(a.createTextNode(r), c.childNodes[0] || null), V === k ? Bt.call(t, B ? "html" : "body")[0] : B ? t.documentElement : c;
368
- }, dt = function(e) {
369
- return Je.call(
370
- e.ownerDocument || e,
371
- e,
372
- // eslint-disable-next-line no-bitwise
373
- I.SHOW_ELEMENT | I.SHOW_COMMENT | I.SHOW_TEXT | I.SHOW_PROCESSING_INSTRUCTION | I.SHOW_CDATA_SECTION,
374
- null
375
- );
376
- }, Tt = function(e) {
377
- e.normalize();
378
- const t = Je.call(
379
- e.ownerDocument || e,
380
- e,
381
- // eslint-disable-next-line no-bitwise
382
- I.SHOW_TEXT | I.SHOW_COMMENT | I.SHOW_CDATA_SECTION | I.SHOW_PROCESSING_INSTRUCTION,
383
- null
384
- );
385
- let r = t.nextNode();
386
- for (; r; ) {
387
- let u = r.data;
388
- Z([_e, he, Ae], (c) => {
389
- u = Q(u, c, " ");
390
- }), r.data = u, r = t.nextNode();
391
- }
392
- }, Oe = function(e) {
393
- const t = Y ? Y(e) : null;
394
- return typeof t != "string" || _(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
395
- // prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
396
- // makes the direct read diverge from the cached read; a clean form
397
- // (same-realm OR foreign-realm) has both reads pointing at the same
398
- // canonical NamedNodeMap.
399
- e.attributes !== Gt(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
400
- // returns the integer 1 for any Element regardless of realm; direct
401
- // read on a clobbered form (e.g. <input name="nodeType">) returns
402
- // the named child element. Cheap addition — nodeType is read from
403
- // an internal slot, no serialization cost — and removes a residual
404
- // clobbering surface used by several mXSS / PI / comment branches
405
- // in _sanitizeElements that compare currentNode.nodeType directly.
406
- e.nodeType !== w(e) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
407
- // "childNodes" shadows the prototype getter. Direct reads of
408
- // form.childNodes from a clobbered form return the named child
409
- // instead of the real NodeList, so any walk that reads it directly
410
- // skips the form's real children. Compare the direct read to the
411
- // cached Node.prototype getter — when the form's named-property
412
- // getter intercepts the read, the two values differ and we flag
413
- // the form. This catches every clobbering child type (input,
414
- // select, etc.) regardless of whether the named child happens to
415
- // carry a numeric .length, which a typeof-based probe would miss
416
- // (e.g. HTMLSelectElement.length is a defined unsigned-long).
417
- e.childNodes !== pe(e);
418
- }, le = function(e) {
419
- if (!w || typeof e != "object" || e === null)
420
- return !1;
421
- try {
422
- return w(e) === v.documentFragment;
423
- } catch {
424
- return !1;
425
- }
426
- }, Ne = function(e) {
427
- if (!w || typeof e != "object" || e === null)
428
- return !1;
429
- try {
430
- return typeof w(e) == "number";
431
- } catch {
432
- return !1;
433
- }
434
- };
435
- function H(i, e, t) {
436
- Z(i, (r) => {
437
- r.call(o, e, t, q);
438
- });
439
- }
440
- const gt = function(e) {
441
- let t = null;
442
- if (H(E.beforeSanitizeElements, e, null), Oe(e))
443
- return M(e), !0;
444
- const r = _(e.nodeName);
445
- if (H(E.uponSanitizeElement, e, {
446
- tagName: r,
447
- allowedTags: T
448
- }), ie && e.hasChildNodes() && !Ne(e.firstElementChild) && y(/<[/\w!]/g, e.innerHTML) && y(/<[/\w!]/g, e.textContent) || ie && e.namespaceURI === k && r === "style" && Ne(e.firstElementChild) || e.nodeType === v.progressingInstruction || ie && e.nodeType === v.comment && y(/<[/\w]/g, e.data))
449
- return M(e), !0;
450
- if (re[r] || !(z.tagCheck instanceof Function && z.tagCheck(r)) && !T[r]) {
451
- if (!re[r] && ht(r) && (g.tagNameCheck instanceof RegExp && y(g.tagNameCheck, r) || g.tagNameCheck instanceof Function && g.tagNameCheck(r)))
452
- return !1;
453
- if (Fe && !P[r]) {
454
- const c = de(e), m = pe(e);
455
- if (m && c) {
456
- const L = m.length;
457
- for (let F = L - 1; F >= 0; --F) {
458
- const x = Ut(m[F], !0);
459
- c.insertBefore(x, zt(e));
460
- }
461
- }
462
- }
463
- return M(e), !0;
464
- }
465
- return (w ? w(e) : e.nodeType) === v.element && !en(e) || (r === "noscript" || r === "noembed" || r === "noframes") && y(/<\/no(script|embed|frames)/i, e.innerHTML) ? (M(e), !0) : (G && e.nodeType === v.text && (t = e.textContent, Z([_e, he, Ae], (c) => {
466
- t = Q(t, c, " ");
467
- }), e.textContent !== t && (J(o.removed, {
468
- element: e.cloneNode()
469
- }), e.textContent = t)), H(E.afterSanitizeElements, e, null), !1);
470
- }, _t = function(e, t, r) {
471
- if (Ee[t] || rt && (t === "id" || t === "name") && (r in a || r in Qt))
472
- return !1;
473
- const u = h[t] || z.attributeCheck instanceof Function && z.attributeCheck(t, e);
474
- if (!(xe && !Ee[t] && y(Yt, t))) {
475
- if (!(tt && y($t, t))) {
476
- if (!u || Ee[t]) {
477
- if (
478
- // First condition does a very basic check if a) it's basically a valid custom element tagname AND
479
- // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
480
- // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
481
- !(ht(e) && (g.tagNameCheck instanceof RegExp && y(g.tagNameCheck, e) || g.tagNameCheck instanceof Function && g.tagNameCheck(e)) && (g.attributeNameCheck instanceof RegExp && y(g.attributeNameCheck, t) || g.attributeNameCheck instanceof Function && g.attributeNameCheck(t, e)) || // Alternative, second condition checks if it's an `is`-attribute, AND
482
- // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
483
- t === "is" && g.allowCustomizedBuiltInElements && (g.tagNameCheck instanceof RegExp && y(g.tagNameCheck, r) || g.tagNameCheck instanceof Function && g.tagNameCheck(r)))
484
- ) return !1;
485
- } else if (!Ue[t]) {
486
- if (!y(et, Q(r, Qe, ""))) {
487
- if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Nt(r, "data:") === 0 && st[e])) {
488
- if (!(nt && !y(Xt, Q(r, Qe, "")))) {
489
- if (r)
490
- return !1;
491
- }
492
- }
493
- }
494
- }
495
- }
496
- }
497
- return !0;
498
- }, tn = l({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), ht = function(e) {
499
- return !tn[ue(e)] && y(Vt, e);
500
- }, At = function(e) {
501
- H(E.beforeSanitizeAttributes, e, null);
502
- const t = e.attributes;
503
- if (!t || Oe(e))
504
- return;
505
- const r = {
506
- attrName: "",
507
- attrValue: "",
508
- keepAttr: !0,
509
- allowedAttributes: h,
510
- forceKeepAttr: void 0
511
- };
512
- let u = t.length;
513
- for (; u--; ) {
514
- const c = t[u], m = c.name, L = c.namespaceURI, F = c.value, x = _(m), je = F;
515
- let S = m === "value" ? je : pn(je);
516
- if (r.attrName = x, r.attrValue = S, r.keepAttr = !0, r.forceKeepAttr = void 0, H(E.uponSanitizeAttribute, e, r), S = r.attrValue, it && (x === "id" || x === "name") && Nt(S, at) !== 0 && (j(m, e), S = at + S), ie && y(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, S)) {
517
- j(m, e);
518
- continue;
519
- }
520
- if (x === "attributename" && Ot(S, "href")) {
521
- j(m, e);
522
- continue;
523
- }
524
- if (r.forceKeepAttr)
525
- continue;
526
- if (!r.keepAttr) {
527
- j(m, e);
528
- continue;
529
- }
530
- if (!ot && y(/\/>/i, S)) {
531
- j(m, e);
532
- continue;
533
- }
534
- G && Z([_e, he, Ae], (St) => {
535
- S = Q(S, St, " ");
536
- });
537
- const Et = _(e.nodeName);
538
- if (!_t(Et, x, S)) {
539
- j(m, e);
540
- continue;
541
- }
542
- if (O && typeof me == "object" && typeof me.getAttributeType == "function" && !L)
543
- switch (me.getAttributeType(Et, x)) {
544
- case "TrustedHTML": {
545
- S = O.createHTML(S);
546
- break;
547
- }
548
- case "TrustedScriptURL": {
549
- S = O.createScriptURL(S);
550
- break;
551
- }
552
- }
553
- if (S !== je)
554
- try {
555
- L ? e.setAttributeNS(L, m, S) : e.setAttribute(m, S), Oe(e) ? M(e) : Rt(o.removed);
556
- } catch {
557
- j(m, e);
558
- }
559
- }
560
- H(E.afterSanitizeAttributes, e, null);
561
- }, De = function(e) {
562
- let t = null;
563
- const r = dt(e);
564
- for (H(E.beforeSanitizeShadowDOM, e, null); t = r.nextNode(); )
565
- if (H(E.uponSanitizeShadowNode, t, null), gt(t), At(t), le(t.content) && De(t.content), (w ? w(t) : t.nodeType) === v.element) {
566
- const c = Te ? Te(t) : t.shadowRoot;
567
- le(c) && (K(c), De(c));
568
- }
569
- H(E.afterSanitizeShadowDOM, e, null);
570
- }, K = function(e) {
571
- const t = w ? w(e) : e.nodeType;
572
- if (t === v.element) {
573
- const c = Te ? Te(e) : e.shadowRoot;
574
- le(c) && (K(c), De(c));
575
- }
576
- const r = pe ? pe(e) : e.childNodes;
577
- if (!r)
578
- return;
579
- const u = [];
580
- Z(r, (c) => {
581
- J(u, c);
582
- });
583
- for (const c of u)
584
- K(c);
585
- if (t === v.element) {
586
- const c = Y ? Y(e) : null;
587
- if (typeof c == "string" && _(c) === "template") {
588
- const m = e.content;
589
- le(m) && K(m);
590
- }
591
- }
592
- };
593
- return o.sanitize = function(i) {
594
- let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = null, r = null, u = null, c = null;
595
- if (He = !i, He && (i = "<!-->"), typeof i != "string" && !Ne(i) && (i = hn(i), typeof i != "string"))
596
- throw fe("dirty is not a string, aborting");
597
- if (!o.isSupported)
598
- return i;
599
- if (Pe || Be(e), o.removed = [], typeof i == "string" && (ae = !1), ae) {
600
- const F = Y ? Y(i) : i.nodeName;
601
- if (typeof F == "string") {
602
- const x = _(F);
603
- if (!T[x] || re[x])
604
- throw fe("root node is forbidden and cannot be sanitized in-place");
605
- }
606
- if (Oe(i))
607
- throw fe("root node is clobbered and cannot be sanitized in-place");
608
- K(i);
609
- } else if (Ne(i))
610
- t = pt("<!---->"), r = t.ownerDocument.importNode(i, !0), r.nodeType === v.element && r.nodeName === "BODY" || r.nodeName === "HTML" ? t = r : t.appendChild(r), K(r);
611
- else {
612
- if (!$ && !G && !B && // eslint-disable-next-line unicorn/prefer-includes
613
- i.indexOf("<") === -1)
614
- return O && ye ? O.createHTML(i) : i;
615
- if (t = pt(i), !t)
616
- return $ ? null : ye ? oe : "";
617
- }
618
- t && ke && M(t.firstChild);
619
- const m = dt(ae ? i : t);
620
- for (; u = m.nextNode(); )
621
- gt(u), At(u), le(u.content) && De(u.content);
622
- if (ae)
623
- return G && Tt(i), i;
624
- if ($) {
625
- if (G && Tt(t), Se)
626
- for (c = Wt.call(t.ownerDocument); t.firstChild; )
627
- c.appendChild(t.firstChild);
628
- else
629
- c = t;
630
- return (h.shadowroot || h.shadowrootmode) && (c = jt.call(s, c, !0)), c;
631
- }
632
- let L = B ? t.outerHTML : t.innerHTML;
633
- return B && T["!doctype"] && t.ownerDocument && t.ownerDocument.doctype && t.ownerDocument.doctype.name && y(Ln, t.ownerDocument.doctype.name) && (L = "<!DOCTYPE " + t.ownerDocument.doctype.name + `>
634
- ` + L), G && Z([_e, he, Ae], (F) => {
635
- L = Q(L, F, " ");
636
- }), O && ye ? O.createHTML(L) : L;
637
- }, o.setConfig = function() {
638
- let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
639
- Be(i), Pe = !0;
640
- }, o.clearConfig = function() {
641
- q = null, Pe = !1;
642
- }, o.isValidAttribute = function(i, e, t) {
643
- q || Be({});
644
- const r = _(i), u = _(e);
645
- return _t(r, u, t);
646
- }, o.addHook = function(i, e) {
647
- typeof e == "function" && J(E[i], e);
648
- }, o.removeHook = function(i, e) {
649
- if (e !== void 0) {
650
- const t = un(E[i], e);
651
- return t === -1 ? void 0 : mn(E[i], t, 1)[0];
652
- }
653
- return Rt(E[i]);
654
- }, o.removeHooks = function(i) {
655
- E[i] = [];
656
- }, o.removeAllHooks = function() {
657
- E = Pt();
658
- }, o;
659
- }
660
- var xn = vt();
661
- export {
662
- xn as default
663
- };