@ranty/ranty-sdk 3.29.0 → 3.31.1-beta.0

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