@hkyhy/marsun-components-core 0.1.101 → 0.1.113

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.
Files changed (71) hide show
  1. package/dist/components/Editor/VariablePicker.js +13 -13
  2. package/dist/components/Editor/VariablePicker.js.map +1 -1
  3. package/dist/components/Filter/createKneFilterField.js +42 -39
  4. package/dist/components/Filter/createKneFilterField.js.map +1 -1
  5. package/dist/components/Form/SuperSelect.js +48 -45
  6. package/dist/components/Form/SuperSelect.js.map +1 -1
  7. package/dist/components/FormInfo/RichTextField/index.js +46 -69
  8. package/dist/components/FormInfo/RichTextField/index.js.map +1 -1
  9. package/dist/components/FormInfo/VariableMentionInput/index.d.ts +1 -0
  10. package/dist/components/FormInfo/VariableMentionInput/index.js +53 -47
  11. package/dist/components/FormInfo/VariableMentionInput/index.js.map +1 -1
  12. package/dist/components/FormInfo/VariableMentionInput/style.module.scss.js +6 -5
  13. package/dist/components/FormInfo/VariableMentionInput/style.module.scss.js.map +1 -1
  14. package/dist/components/ReactFilter/fields/index.js +33 -26
  15. package/dist/components/ReactFilter/fields/index.js.map +1 -1
  16. package/dist/components/ReactFilter/renderSelectListItemContent.d.ts +8 -0
  17. package/dist/components/ReactFilter/renderSelectListItemContent.js +12 -0
  18. package/dist/components/ReactFilter/renderSelectListItemContent.js.map +1 -0
  19. package/dist/components/Tools/Inbox/InboxBell/InboxBell.d.ts +3 -0
  20. package/dist/components/Tools/Inbox/InboxBell/InboxBell.js +59 -49
  21. package/dist/components/Tools/Inbox/InboxBell/InboxBell.js.map +1 -1
  22. package/dist/components/Tools/Inbox/InboxBell/style.module.scss.js +20 -18
  23. package/dist/components/Tools/Inbox/InboxBell/style.module.scss.js.map +1 -1
  24. package/dist/components/Tools/Inbox/index.d.ts +1 -0
  25. package/dist/components/Tools/Inbox/sanitizeInboxHtml.d.ts +5 -0
  26. package/dist/components/Tools/Inbox/sanitizeInboxHtml.js +14 -0
  27. package/dist/components/Tools/Inbox/sanitizeInboxHtml.js.map +1 -0
  28. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/MessageTemplateAdmin.d.ts +1 -1
  29. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/MessageTemplateAdmin.js +158 -137
  30. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/MessageTemplateAdmin.js.map +1 -1
  31. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/Modal/TemplateFormModal.js +217 -124
  32. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/Modal/TemplateFormModal.js.map +1 -1
  33. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/PushRulesPanel/index.d.ts +8 -1
  34. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/PushRulesPanel/index.js +312 -170
  35. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/PushRulesPanel/index.js.map +1 -1
  36. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/VariablesPanel/index.js +87 -76
  37. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/VariablesPanel/index.js.map +1 -1
  38. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/audienceSlots.d.ts +14 -0
  39. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/audienceSlots.js +31 -0
  40. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/audienceSlots.js.map +1 -0
  41. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/index.d.ts +3 -1
  42. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/style.module.scss.js +18 -6
  43. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/style.module.scss.js.map +1 -1
  44. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/types.d.ts +27 -0
  45. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/types.js.map +1 -1
  46. package/dist/components/Tools/MessageCenter/MsgCenterAppSwitcher/MsgCenterAppSwitcher.d.ts +22 -0
  47. package/dist/components/Tools/MessageCenter/MsgCenterAppSwitcher/MsgCenterAppSwitcher.js +64 -0
  48. package/dist/components/Tools/MessageCenter/MsgCenterAppSwitcher/MsgCenterAppSwitcher.js.map +1 -0
  49. package/dist/components/Tools/MessageCenter/MsgCenterAppSwitcher/index.d.ts +2 -0
  50. package/dist/components/Tools/MessageCenter/index.d.ts +8 -1
  51. package/dist/components/Tools/MessageCenter/msgCenterAppSwitch.d.ts +39 -0
  52. package/dist/components/Tools/MessageCenter/msgCenterAppSwitch.js +94 -0
  53. package/dist/components/Tools/MessageCenter/msgCenterAppSwitch.js.map +1 -0
  54. package/dist/components/Tools/MessageCenter/useMsgCenterAppKey.d.ts +2 -0
  55. package/dist/components/Tools/MessageCenter/useMsgCenterAppKey.js +18 -0
  56. package/dist/components/Tools/MessageCenter/useMsgCenterAppKey.js.map +1 -0
  57. package/dist/components/Tools/MessageCenter/utils/audienceUserSelectOptions.d.ts +16 -0
  58. package/dist/components/Tools/MessageCenter/utils/audienceUserSelectOptions.js +33 -0
  59. package/dist/components/Tools/MessageCenter/utils/audienceUserSelectOptions.js.map +1 -0
  60. package/dist/components/Tools/MessageCenter/utils/templateCode.js +11 -17
  61. package/dist/components/Tools/MessageCenter/utils/templateCode.js.map +1 -1
  62. package/dist/components/Tools/index.d.ts +3 -2
  63. package/dist/index.js +641 -626
  64. package/dist/index.js.map +1 -1
  65. package/dist/marsun-components-core.css +1 -1
  66. package/dist/node_modules/dompurify/dist/purify.es.js +908 -0
  67. package/dist/node_modules/dompurify/dist/purify.es.js.map +1 -0
  68. package/dist/node_modules/isomorphic-dompurify/dist/browser.js +17 -0
  69. package/dist/node_modules/isomorphic-dompurify/dist/browser.js.map +1 -0
  70. package/dist/styles/global.css +1 -1
  71. package/package.json +9 -1
@@ -0,0 +1,908 @@
1
+ /*! @license DOMPurify 3.4.15 | (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.15/LICENSE */
2
+ function Ye(r, i) {
3
+ (i == null || i > r.length) && (i = r.length);
4
+ for (var s = 0, c = Array(i); s < i; s++) c[s] = r[s];
5
+ return c;
6
+ }
7
+ function Hn(r) {
8
+ if (Array.isArray(r)) return r;
9
+ }
10
+ function Wn(r, i) {
11
+ var s = r == null ? null : typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
12
+ if (s != null) {
13
+ var c, f, d, y, st = [], I = !0, lt = !1;
14
+ try {
15
+ if (d = (s = s.call(r)).next, i !== 0) for (; !(I = (c = d.call(s)).done) && (st.push(c.value), st.length !== i); I = !0) ;
16
+ } catch (xt) {
17
+ lt = !0, f = xt;
18
+ } finally {
19
+ try {
20
+ if (!I && s.return != null && (y = s.return(), Object(y) !== y)) return;
21
+ } finally {
22
+ if (lt) throw f;
23
+ }
24
+ }
25
+ return st;
26
+ }
27
+ }
28
+ function Gn() {
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 Bn(r, i) {
33
+ return Hn(r) || Wn(r, i) || Yn(r, i) || Gn();
34
+ }
35
+ function Yn(r, i) {
36
+ if (r) {
37
+ if (typeof r == "string") return Ye(r, i);
38
+ var s = {}.toString.call(r).slice(8, -1);
39
+ return s === "Object" && r.constructor && (s = r.constructor.name), s === "Map" || s === "Set" ? Array.from(r) : s === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s) ? Ye(r, i) : void 0;
40
+ }
41
+ }
42
+ const an = Object.entries, je = Object.setPrototypeOf, jn = Object.isFrozen, $n = Object.getPrototypeOf, Xn = Object.getOwnPropertyDescriptor;
43
+ let S = Object.freeze, b = Object.seal, it = Object.create, sn = typeof Reflect < "u" && Reflect, se = sn.apply, le = sn.construct;
44
+ S || (S = function(i) {
45
+ return i;
46
+ });
47
+ b || (b = function(i) {
48
+ return i;
49
+ });
50
+ se || (se = function(i, s) {
51
+ for (var c = arguments.length, f = new Array(c > 2 ? c - 2 : 0), d = 2; d < c; d++)
52
+ f[d - 2] = arguments[d];
53
+ return i.apply(s, f);
54
+ });
55
+ le || (le = function(i) {
56
+ for (var s = arguments.length, c = new Array(s > 1 ? s - 1 : 0), f = 1; f < s; f++)
57
+ c[f - 1] = arguments[f];
58
+ return new i(...c);
59
+ });
60
+ const V = A(Array.prototype.forEach), Vn = A(Array.prototype.lastIndexOf), $e = A(Array.prototype.pop), dt = A(Array.prototype.push), qn = A(Array.prototype.splice), at = Array.isArray, _t = A(String.prototype.toLowerCase), ee = A(String.prototype.toString), Xe = A(String.prototype.match), Tt = A(String.prototype.replace), Ve = A(String.prototype.indexOf), Kn = A(String.prototype.trim), Zn = A(Number.prototype.toString), Jn = A(Boolean.prototype.toString), qe = typeof BigInt > "u" ? null : A(BigInt.prototype.toString), Ke = typeof Symbol > "u" ? null : A(Symbol.prototype.toString), N = A(Object.prototype.hasOwnProperty), ht = A(Object.prototype.toString), O = A(RegExp.prototype.test), X = Qn(TypeError);
61
+ function A(r) {
62
+ return function(i) {
63
+ i instanceof RegExp && (i.lastIndex = 0);
64
+ for (var s = arguments.length, c = new Array(s > 1 ? s - 1 : 0), f = 1; f < s; f++)
65
+ c[f - 1] = arguments[f];
66
+ return se(r, i, c);
67
+ };
68
+ }
69
+ function Qn(r) {
70
+ return function() {
71
+ for (var i = arguments.length, s = new Array(i), c = 0; c < i; c++)
72
+ s[c] = arguments[c];
73
+ return le(r, s);
74
+ };
75
+ }
76
+ function p(r, i) {
77
+ let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _t;
78
+ if (je && je(r, null), !at(i))
79
+ return r;
80
+ let c = i.length;
81
+ for (; c--; ) {
82
+ let f = i[c];
83
+ if (typeof f == "string") {
84
+ const d = s(f);
85
+ d !== f && (jn(i) || (i[c] = d), f = d);
86
+ }
87
+ r[f] = !0;
88
+ }
89
+ return r;
90
+ }
91
+ function to(r) {
92
+ for (let i = 0; i < r.length; i++)
93
+ N(r, i) || (r[i] = null);
94
+ return r;
95
+ }
96
+ function C(r) {
97
+ const i = it(null);
98
+ for (const c of an(r)) {
99
+ var s = Bn(c, 2);
100
+ const f = s[0], d = s[1];
101
+ N(r, f) && (at(d) ? i[f] = to(d) : d && typeof d == "object" && d.constructor === Object ? i[f] = C(d) : i[f] = d);
102
+ }
103
+ return i;
104
+ }
105
+ function eo(r) {
106
+ switch (typeof r) {
107
+ case "string":
108
+ return r;
109
+ case "number":
110
+ return Zn(r);
111
+ case "boolean":
112
+ return Jn(r);
113
+ case "bigint":
114
+ return qe ? qe(r) : "0";
115
+ case "symbol":
116
+ return Ke ? Ke(r) : "Symbol()";
117
+ case "undefined":
118
+ return ht(r);
119
+ case "function":
120
+ case "object": {
121
+ if (r === null)
122
+ return ht(r);
123
+ const i = r, s = P(i, "toString");
124
+ if (typeof s == "function") {
125
+ const c = s(i);
126
+ return typeof c == "string" ? c : ht(c);
127
+ }
128
+ return ht(r);
129
+ }
130
+ default:
131
+ return ht(r);
132
+ }
133
+ }
134
+ function P(r, i) {
135
+ for (; r !== null; ) {
136
+ const c = Xn(r, i);
137
+ if (c) {
138
+ if (c.get)
139
+ return A(c.get);
140
+ if (typeof c.value == "function")
141
+ return A(c.value);
142
+ }
143
+ r = $n(r);
144
+ }
145
+ function s() {
146
+ return null;
147
+ }
148
+ return s;
149
+ }
150
+ function no(r) {
151
+ try {
152
+ return O(r, ""), !0;
153
+ } catch {
154
+ return !1;
155
+ }
156
+ }
157
+ const Ze = 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"]), ne = 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"]), oe = 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"]), oo = 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"]), re = 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"]), ro = S(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Je = S(["#text"]), Qe = S(["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"]), ie = 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", "dominant-baseline", "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", "pointer-events", "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-orientation", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "vector-effect", "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"]), tn = S(["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"]), Pt = S(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), io = b(/{{[\w\W]*|^[\w\W]*}}/g), ao = b(/<%[\w\W]*|^[\w\W]*%>/g), so = b(/\${[\w\W]*/g), lo = b(/^data-[\-\w.\u00B7-\uFFFF]+$/), co = b(/^aria-[\-\w]+$/), en = b(
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
+ ), uo = b(/^(?:\w+script|data):/i), fo = b(
161
+ /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
162
+ // eslint-disable-line no-control-regex
163
+ ), po = b(/^html$/i), mo = b(/^[a-z][.\w]*(-[.\w]+)+$/i), nn = b(/<[/\w!]/g), on = b(/<[/\w]/g), To = b(/<\/no(script|embed|frames)/i), ho = b(/\/>/i), M = {
164
+ element: 1,
165
+ attribute: 2,
166
+ text: 3,
167
+ cdataSection: 4,
168
+ entityReference: 5,
169
+ // Deprecated
170
+ entityNode: 6,
171
+ // Deprecated
172
+ processingInstruction: 7,
173
+ comment: 8,
174
+ document: 9,
175
+ documentType: 10,
176
+ documentFragment: 11,
177
+ notation: 12
178
+ // Deprecated
179
+ }, ln = ["style", "script", "xmp", "iframe", "noembed", "noframes", "plaintext", "noscript"], _o = S(p({}, ln)), go = (function() {
180
+ const r = {};
181
+ return V(ln, (i) => {
182
+ r[i] = b(new RegExp("</" + i + "(?=[\\t\\n\\f\\r />])", "i"));
183
+ }), S(r);
184
+ })(), Eo = function() {
185
+ return typeof window > "u" ? null : window;
186
+ }, Ao = function(i, s) {
187
+ if (typeof i != "object" || typeof i.createPolicy != "function")
188
+ return null;
189
+ let c = null;
190
+ const f = "data-tt-policy-suffix";
191
+ s && s.hasAttribute(f) && (c = s.getAttribute(f));
192
+ const d = "dompurify" + (c ? "#" + c : "");
193
+ try {
194
+ return i.createPolicy(d, {
195
+ createHTML(y) {
196
+ return y;
197
+ },
198
+ createScriptURL(y) {
199
+ return y;
200
+ }
201
+ });
202
+ } catch {
203
+ return console.warn("TrustedTypes policy " + d + " could not be created."), null;
204
+ }
205
+ }, rn = function() {
206
+ return {
207
+ afterSanitizeAttributes: [],
208
+ afterSanitizeElements: [],
209
+ afterSanitizeShadowDOM: [],
210
+ beforeSanitizeAttributes: [],
211
+ beforeSanitizeElements: [],
212
+ beforeSanitizeShadowDOM: [],
213
+ uponSanitizeAttribute: [],
214
+ uponSanitizeElement: [],
215
+ uponSanitizeShadowNode: []
216
+ };
217
+ }, W = function(i, s, c, f) {
218
+ return N(i, s) && at(i[s]) ? p(f.base ? C(f.base) : {}, i[s], f.transform) : c;
219
+ }, ae = function(i, s, c) {
220
+ const f = N(i, s) ? i[s] : void 0;
221
+ return f && typeof f == "object" ? C(f) : c();
222
+ };
223
+ function cn() {
224
+ let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Eo();
225
+ const i = (o) => cn(o);
226
+ if (i.version = "3.4.15", i.removed = [], !r || !r.document || r.document.nodeType !== M.document || !r.Element)
227
+ return i.isSupported = !1, i;
228
+ let s = r.document;
229
+ const c = s, f = c.currentScript;
230
+ r.DocumentFragment;
231
+ const d = r.HTMLTemplateElement, y = r.Node, st = r.Element, I = r.NodeFilter, lt = r.NamedNodeMap;
232
+ lt === void 0 && (r.NamedNodeMap || r.MozNamedAttrMap), r.HTMLFormElement;
233
+ const xt = r.DOMParser, gt = r.trustedTypes, U = st.prototype, un = P(U, "cloneNode"), vt = P(U, "remove"), ce = P(U, "removeAttributeNode"), fn = P(U, "nextSibling"), q = P(U, "childNodes"), K = P(U, "parentNode"), ue = P(U, "shadowRoot"), kt = P(U, "attributes"), G = y && y.prototype ? P(y.prototype, "nodeType") : null, Z = y && y.prototype ? P(y.prototype, "nodeName") : null, Et = y && y.prototype ? P(y.prototype, "ownerDocument") : null, ct = function(t) {
234
+ return G ? G(t) : t.nodeType;
235
+ }, Ut = function(t) {
236
+ return Z ? Z(t) : t.nodeName;
237
+ };
238
+ if (typeof d == "function") {
239
+ const o = s.createElement("template");
240
+ o.content && o.content.ownerDocument && (s = o.content.ownerDocument);
241
+ }
242
+ let L, B = "", Ft, fe = !1, ut = 0;
243
+ const pe = function() {
244
+ if (ut > 0)
245
+ throw X('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
246
+ }, J = function(t) {
247
+ pe(), ut++;
248
+ try {
249
+ return L.createHTML(t);
250
+ } finally {
251
+ ut--;
252
+ }
253
+ }, pn = function(t) {
254
+ pe(), ut++;
255
+ try {
256
+ return L.createScriptURL(t);
257
+ } finally {
258
+ ut--;
259
+ }
260
+ }, mn = function() {
261
+ return fe || (Ft = Ao(gt, f), fe = !0), Ft;
262
+ }, At = s, zt = At.implementation, me = At.createNodeIterator, dn = At.createDocumentFragment, Tn = At.getElementsByTagName, hn = c.importNode;
263
+ let T = rn();
264
+ i.isSupported = typeof an == "function" && typeof K == "function" && zt && zt.createHTMLDocument !== void 0;
265
+ const _n = io, gn = ao, En = so, An = lo, yn = co, Sn = uo, de = fo, bn = mo;
266
+ let Te = en, h = null;
267
+ const Ht = p({}, [...Ze, ...ne, ...oe, ...re, ...Je]);
268
+ let _ = null;
269
+ const Wt = p({}, [...Qe, ...ie, ...tn, ...Pt]);
270
+ let x = Object.seal(it(null, {
271
+ tagNameCheck: {
272
+ writable: !0,
273
+ configurable: !1,
274
+ enumerable: !0,
275
+ value: null
276
+ },
277
+ attributeNameCheck: {
278
+ writable: !0,
279
+ configurable: !1,
280
+ enumerable: !0,
281
+ value: null
282
+ },
283
+ allowCustomizedBuiltInElements: {
284
+ writable: !0,
285
+ configurable: !1,
286
+ enumerable: !0,
287
+ value: !1
288
+ }
289
+ })), ft = null, he = null;
290
+ const F = Object.seal(it(null, {
291
+ tagCheck: {
292
+ writable: !0,
293
+ configurable: !1,
294
+ enumerable: !0,
295
+ value: null
296
+ },
297
+ attributeCheck: {
298
+ writable: !0,
299
+ configurable: !1,
300
+ enumerable: !0,
301
+ value: null
302
+ }
303
+ }));
304
+ let _e = !0, Gt = !0, ge = !1, Ee = !0, z = !1, Y = !0, j = !1, Bt = !1, yt = null, St = null, Yt = !1, Q = !1, bt = !1, Ot = !1, Ae = !0, ye = !1;
305
+ const Se = "user-content-";
306
+ let jt = !0, $t = !1, tt = {}, et = null;
307
+ const be = p({}, [
308
+ "annotation-xml",
309
+ "audio",
310
+ "colgroup",
311
+ "desc",
312
+ "foreignobject",
313
+ "head",
314
+ "iframe",
315
+ "math",
316
+ "mi",
317
+ "mn",
318
+ "mo",
319
+ "ms",
320
+ "mtext",
321
+ "noembed",
322
+ "noframes",
323
+ "noscript",
324
+ "plaintext",
325
+ "script",
326
+ // <selectedcontent> mirrors the selected <option>'s subtree, cloned by
327
+ // the UA (customizable <select>) — including any on* handlers — and the
328
+ // engine re-mirrors synchronously whenever a removal changes which
329
+ // option/selectedcontent is current, even inside DOMPurify's inert
330
+ // DOMParser document. Hoisting its children on removal re-inserts a fresh
331
+ // mirror target ahead of the walk, which the engine refills, looping
332
+ // forever (DoS) and amplifying output. Dropping its content on removal
333
+ // (rather than hoisting) breaks that cascade; the content is a duplicate
334
+ // of the option, which is sanitized on its own. See campaign-3 F1/F6.
335
+ "selectedcontent",
336
+ "style",
337
+ "svg",
338
+ "template",
339
+ "thead",
340
+ "title",
341
+ "video",
342
+ "xmp"
343
+ ]);
344
+ let Oe = null;
345
+ const Re = p({}, ["audio", "video", "img", "source", "image", "track"]);
346
+ let Le = null;
347
+ const De = p({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Rt = "http://www.w3.org/1998/Math/MathML", Lt = "http://www.w3.org/2000/svg", v = "http://www.w3.org/1999/xhtml";
348
+ let nt = v, Xt = !1, Vt = null;
349
+ const On = p({}, [Rt, Lt, v], ee), we = S(["mi", "mo", "mn", "ms", "mtext"]);
350
+ let qt = p({}, we);
351
+ const Ne = S(["annotation-xml"]);
352
+ let Kt = p({}, Ne);
353
+ const Rn = p({}, ["title", "style", "font", "a", "script"]);
354
+ let pt = null;
355
+ const Ln = ["application/xhtml+xml", "text/html"], Dn = "text/html";
356
+ let E = null, ot = null;
357
+ const wn = s.createElement("form"), Ie = function(t) {
358
+ return t instanceof RegExp || t instanceof Function;
359
+ }, Zt = function() {
360
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
361
+ if (ot && ot === t)
362
+ return;
363
+ (!t || typeof t != "object") && (t = {}), t = C(t), pt = // eslint-disable-next-line unicorn/prefer-includes
364
+ Ln.indexOf(t.PARSER_MEDIA_TYPE) === -1 ? Dn : t.PARSER_MEDIA_TYPE, E = pt === "application/xhtml+xml" ? ee : _t, h = W(t, "ALLOWED_TAGS", Ht, {
365
+ transform: E
366
+ }), _ = W(t, "ALLOWED_ATTR", Wt, {
367
+ transform: E
368
+ }), Vt = W(t, "ALLOWED_NAMESPACES", On, {
369
+ transform: ee
370
+ }), Le = W(t, "ADD_URI_SAFE_ATTR", De, {
371
+ transform: E,
372
+ base: De
373
+ }), Oe = W(t, "ADD_DATA_URI_TAGS", Re, {
374
+ transform: E,
375
+ base: Re
376
+ }), et = W(t, "FORBID_CONTENTS", be, {
377
+ transform: E
378
+ }), ft = W(t, "FORBID_TAGS", C({}), {
379
+ transform: E
380
+ }), he = W(t, "FORBID_ATTR", C({}), {
381
+ transform: E
382
+ }), tt = N(t, "USE_PROFILES") ? t.USE_PROFILES && typeof t.USE_PROFILES == "object" ? C(t.USE_PROFILES) : t.USE_PROFILES : !1, _e = t.ALLOW_ARIA_ATTR !== !1, Gt = t.ALLOW_DATA_ATTR !== !1, ge = t.ALLOW_UNKNOWN_PROTOCOLS || !1, Ee = t.ALLOW_SELF_CLOSE_IN_ATTR !== !1, z = t.SAFE_FOR_TEMPLATES || !1, Y = t.SAFE_FOR_XML !== !1, j = t.WHOLE_DOCUMENT || !1, Q = t.RETURN_DOM || !1, bt = t.RETURN_DOM_FRAGMENT || !1, Ot = t.RETURN_TRUSTED_TYPE || !1, Yt = t.FORCE_BODY || !1, Ae = t.SANITIZE_DOM !== !1, ye = t.SANITIZE_NAMED_PROPS || !1, jt = t.KEEP_CONTENT !== !1, $t = t.IN_PLACE || !1, Te = no(t.ALLOWED_URI_REGEXP) ? t.ALLOWED_URI_REGEXP : en, nt = typeof t.NAMESPACE == "string" ? t.NAMESPACE : v, qt = ae(
383
+ t,
384
+ "MATHML_TEXT_INTEGRATION_POINTS",
385
+ () => p({}, we)
386
+ // Default built-in map
387
+ ), Kt = ae(
388
+ t,
389
+ "HTML_INTEGRATION_POINTS",
390
+ () => p({}, Ne)
391
+ // Default built-in map
392
+ );
393
+ const e = ae(t, "CUSTOM_ELEMENT_HANDLING", () => it(null));
394
+ if (x = it(null), N(e, "tagNameCheck") && Ie(e.tagNameCheck) && (x.tagNameCheck = e.tagNameCheck), N(e, "attributeNameCheck") && Ie(e.attributeNameCheck) && (x.attributeNameCheck = e.attributeNameCheck), N(e, "allowCustomizedBuiltInElements") && typeof e.allowCustomizedBuiltInElements == "boolean" && (x.allowCustomizedBuiltInElements = e.allowCustomizedBuiltInElements), b(x), z && (Gt = !1), bt && (Q = !0), tt && (h = p({}, Je), _ = it(null), tt.html === !0 && (p(h, Ze), p(_, Qe)), tt.svg === !0 && (p(h, ne), p(_, ie), p(_, Pt)), tt.svgFilters === !0 && (p(h, oe), p(_, ie), p(_, Pt)), tt.mathMl === !0 && (p(h, re), p(_, tn), p(_, Pt))), F.tagCheck = null, F.attributeCheck = null, N(t, "ADD_TAGS") && (typeof t.ADD_TAGS == "function" ? F.tagCheck = t.ADD_TAGS : at(t.ADD_TAGS) && (h === Ht && (h = C(h)), p(h, t.ADD_TAGS, E))), N(t, "ADD_ATTR") && (typeof t.ADD_ATTR == "function" ? F.attributeCheck = t.ADD_ATTR : at(t.ADD_ATTR) && (_ === Wt && (_ = C(_)), p(_, t.ADD_ATTR, E))), N(t, "ADD_FORBID_CONTENTS") && at(t.ADD_FORBID_CONTENTS) && (et === be && (et = C(et)), p(et, t.ADD_FORBID_CONTENTS, E)), jt && (h["#text"] = !0), j && p(h, ["html", "head", "body"]), h.table && (p(h, ["tbody"]), delete ft.tbody), t.TRUSTED_TYPES_POLICY) {
395
+ if (typeof t.TRUSTED_TYPES_POLICY.createHTML != "function")
396
+ throw X('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
397
+ if (typeof t.TRUSTED_TYPES_POLICY.createScriptURL != "function")
398
+ throw X('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
399
+ const n = L;
400
+ L = t.TRUSTED_TYPES_POLICY;
401
+ try {
402
+ B = J("");
403
+ } catch (a) {
404
+ throw L = n, a;
405
+ }
406
+ } else t.TRUSTED_TYPES_POLICY === null ? (L = void 0, B = "") : (L === void 0 && (L = mn()), L && typeof B == "string" && (B = J("")));
407
+ S && S(t), ot = t;
408
+ }, Me = p({}, [...ne, ...oe, ...oo]), Ce = p({}, [...re, ...ro]), Nn = function(t, e, n) {
409
+ return e.namespaceURI === v ? t === "svg" : e.namespaceURI === Rt ? t === "svg" && (n === "annotation-xml" || qt[n]) : !!Me[t];
410
+ }, In = function(t, e, n) {
411
+ return e.namespaceURI === v ? t === "math" : e.namespaceURI === Lt ? t === "math" && Kt[n] : !!Ce[t];
412
+ }, Mn = function(t, e, n) {
413
+ return e.namespaceURI === Lt && !Kt[n] || e.namespaceURI === Rt && !qt[n] ? !1 : !Ce[t] && (Rn[t] || !Me[t]);
414
+ }, Cn = function(t) {
415
+ let e = K(t);
416
+ (!e || !e.tagName) && (e = {
417
+ namespaceURI: nt,
418
+ tagName: "template"
419
+ });
420
+ const n = _t(t.tagName), a = _t(e.tagName);
421
+ return Vt[t.namespaceURI] ? t.namespaceURI === Lt ? Nn(n, e, a) : t.namespaceURI === Rt ? In(n, e, a) : t.namespaceURI === v ? Mn(n, e, a) : !!(pt === "application/xhtml+xml" && Vt[t.namespaceURI]) : !1;
422
+ }, H = function(t) {
423
+ dt(i.removed, {
424
+ element: t
425
+ });
426
+ try {
427
+ K(t).removeChild(t);
428
+ } catch {
429
+ if (vt(t), !K(t))
430
+ throw X("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
431
+ }
432
+ }, Pe = function(t, e, n) {
433
+ try {
434
+ ce(t, e);
435
+ } catch {
436
+ try {
437
+ t.removeAttribute(n);
438
+ } catch {
439
+ }
440
+ }
441
+ }, Dt = function(t) {
442
+ wt(t);
443
+ const e = q(t);
444
+ if (e) {
445
+ const a = [];
446
+ V(e, (l) => {
447
+ dt(a, l);
448
+ }), V(a, (l) => {
449
+ try {
450
+ vt(l);
451
+ } catch {
452
+ }
453
+ });
454
+ }
455
+ const n = kt(t);
456
+ if (n)
457
+ for (let a = n.length - 1; a >= 0; --a) {
458
+ const l = n[a], u = l && l.name;
459
+ typeof u == "string" && Pe(t, l, u);
460
+ }
461
+ }, $ = function(t, e, n) {
462
+ if (!n)
463
+ try {
464
+ n = e.getAttributeNode(t);
465
+ } catch {
466
+ n = null;
467
+ }
468
+ dt(i.removed, {
469
+ attribute: n || null,
470
+ from: e
471
+ });
472
+ try {
473
+ n ? ce(e, n) : e.removeAttribute(t);
474
+ } catch {
475
+ try {
476
+ e.removeAttribute(t);
477
+ } catch {
478
+ }
479
+ }
480
+ if (t === "is")
481
+ if (Q || bt)
482
+ try {
483
+ H(e);
484
+ } catch {
485
+ }
486
+ else
487
+ try {
488
+ e.setAttribute(t, "");
489
+ } catch {
490
+ }
491
+ }, Pn = function(t) {
492
+ const e = kt(t);
493
+ if (e)
494
+ for (let n = e.length - 1; n >= 0; --n) {
495
+ const a = e[n], l = a && a.name;
496
+ typeof l != "string" || _[E(l)] || Pe(t, a, l);
497
+ }
498
+ }, wt = function(t) {
499
+ const e = [t];
500
+ for (; e.length > 0; ) {
501
+ const n = e.pop();
502
+ ct(n) === M.element && Pn(n);
503
+ const l = q(n);
504
+ if (l)
505
+ for (let u = l.length - 1; u >= 0; --u)
506
+ e.push(l[u]);
507
+ }
508
+ }, xe = function(t, e) {
509
+ return Y ? t === "patchsrc" ? !0 : t === "for" && e !== "label" && e !== "output" : !1;
510
+ }, xn = function(t) {
511
+ if (!Y)
512
+ return;
513
+ const e = [t];
514
+ for (; e.length > 0; ) {
515
+ const n = e.pop(), a = ct(n);
516
+ if (a === M.processingInstruction || a === M.comment && O(on, n.data)) {
517
+ try {
518
+ vt(n);
519
+ } catch {
520
+ }
521
+ continue;
522
+ }
523
+ if (a === M.element) {
524
+ const u = n, m = E(Ut(n));
525
+ try {
526
+ u.hasAttribute && u.hasAttribute("patchsrc") && u.removeAttribute("patchsrc"), u.hasAttribute && u.hasAttribute("for") && xe("for", m) && u.removeAttribute("for");
527
+ } catch {
528
+ }
529
+ }
530
+ const l = q(n);
531
+ if (l)
532
+ for (let u = l.length - 1; u >= 0; --u)
533
+ e.push(l[u]);
534
+ }
535
+ }, ve = function(t) {
536
+ let e = null, n = null;
537
+ if (Yt)
538
+ t = "<remove></remove>" + t;
539
+ else {
540
+ const u = Xe(t, /^[\r\n\t ]+/);
541
+ n = u && u[0];
542
+ }
543
+ pt === "application/xhtml+xml" && nt === v && (t = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + t + "</body></html>");
544
+ const a = L ? J(t) : t;
545
+ if (nt === v)
546
+ try {
547
+ e = new xt().parseFromString(a, pt);
548
+ } catch {
549
+ }
550
+ if (!e || !e.documentElement) {
551
+ e = zt.createDocument(nt, "template", null);
552
+ try {
553
+ e.documentElement.innerHTML = Xt ? B : a;
554
+ } catch {
555
+ }
556
+ }
557
+ const l = e.body || e.documentElement;
558
+ return t && n && l.insertBefore(s.createTextNode(n), l.childNodes[0] || null), nt === v ? Tn.call(e, j ? "html" : "body")[0] : j ? e.documentElement : l;
559
+ }, ke = function(t) {
560
+ const e = Et ? Et(t) : t.ownerDocument;
561
+ return me.call(
562
+ e || t,
563
+ t,
564
+ // eslint-disable-next-line no-bitwise
565
+ I.SHOW_ELEMENT | I.SHOW_COMMENT | I.SHOW_TEXT | I.SHOW_PROCESSING_INSTRUCTION | I.SHOW_CDATA_SECTION,
566
+ null
567
+ );
568
+ }, Nt = function(t) {
569
+ return t = Tt(t, _n, " "), t = Tt(t, gn, " "), t = Tt(t, En, " "), t;
570
+ }, Jt = function(t) {
571
+ var e;
572
+ t.normalize();
573
+ const n = Et ? Et(t) : t.ownerDocument, a = me.call(
574
+ n || t,
575
+ t,
576
+ // eslint-disable-next-line no-bitwise
577
+ I.SHOW_TEXT | I.SHOW_COMMENT | I.SHOW_CDATA_SECTION | I.SHOW_PROCESSING_INSTRUCTION,
578
+ null
579
+ );
580
+ let l = a.nextNode();
581
+ for (; l; )
582
+ l.data = Nt(l.data), l = a.nextNode();
583
+ const u = (e = t.querySelectorAll) === null || e === void 0 ? void 0 : e.call(t, "template");
584
+ u && V(u, (m) => {
585
+ rt(m.content) && Jt(m.content);
586
+ });
587
+ }, It = function(t) {
588
+ const e = Z ? Z(t) : null;
589
+ return typeof e != "string" || E(e) !== "form" ? !1 : typeof t.nodeName != "string" || typeof t.textContent != "string" || typeof t.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
590
+ // prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
591
+ // makes the direct read diverge from the cached read; a clean form
592
+ // (same-realm OR foreign-realm) has both reads pointing at the same
593
+ // canonical NamedNodeMap.
594
+ t.attributes !== kt(t) || typeof t.removeAttribute != "function" || // A form descendant named "removeAttributeNode" or "getAttributeNode"
595
+ // shadows these Attr-node methods via [LegacyOverrideBuiltIns].
596
+ // _removeAttribute() / _stripAttributeNode() reach for
597
+ // element.removeAttributeNode(attr) first; when it is shadowed the call
598
+ // throws and the name-based fallback element.removeAttribute(name)
599
+ // ASCII-lowercases its lookup key in an HTML document, silently missing
600
+ // a case-preserved event-handler attribute (e.g. an ONANIMATIONSTART
601
+ // that reached the sanitizer through an XML/XHTML parse). Flag the form
602
+ // so it is removed wholesale, exactly as for the other shadowed methods.
603
+ typeof t.removeAttributeNode != "function" || typeof t.getAttributeNode != "function" || typeof t.setAttribute != "function" || typeof t.namespaceURI != "string" || typeof t.insertBefore != "function" || typeof t.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
604
+ // returns the integer 1 for any Element regardless of realm; direct
605
+ // read on a clobbered form (e.g. <input name="nodeType">) returns
606
+ // the named child element. Cheap addition — nodeType is read from
607
+ // an internal slot, no serialization cost — and removes a residual
608
+ // clobbering surface used by several mXSS / PI / comment branches
609
+ // in _sanitizeElements that compare currentNode.nodeType directly.
610
+ t.nodeType !== G(t) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
611
+ // "childNodes" shadows the prototype getter. Direct reads of
612
+ // form.childNodes from a clobbered form return the named child
613
+ // instead of the real NodeList, so any walk that reads it directly
614
+ // skips the form's real children. Compare the direct read to the
615
+ // cached Node.prototype getter — when the form's named-property
616
+ // getter intercepts the read, the two values differ and we flag
617
+ // the form. This catches every clobbering child type (input,
618
+ // select, etc.) regardless of whether the named child happens to
619
+ // carry a numeric .length, which a typeof-based probe would miss
620
+ // (e.g. HTMLSelectElement.length is a defined unsigned-long).
621
+ t.childNodes !== q(t);
622
+ }, rt = function(t) {
623
+ if (!G || typeof t != "object" || t === null)
624
+ return !1;
625
+ try {
626
+ return G(t) === M.documentFragment;
627
+ } catch {
628
+ return !1;
629
+ }
630
+ }, mt = function(t) {
631
+ if (!G || typeof t != "object" || t === null)
632
+ return !1;
633
+ try {
634
+ return typeof G(t) == "number";
635
+ } catch {
636
+ return !1;
637
+ }
638
+ };
639
+ function k(o, t, e) {
640
+ o.length !== 0 && V(o, (n) => {
641
+ n.call(i, t, e, ot);
642
+ });
643
+ }
644
+ const vn = function(t, e) {
645
+ return !!(Y && t.hasChildNodes() && !mt(t.firstElementChild) && O(nn, t.textContent) && O(nn, t.innerHTML) || Y && t.namespaceURI === v && _o[e] && (mt(t.firstElementChild) || typeof t.textContent == "string" && O(go[e], t.textContent)) || t.nodeType === M.processingInstruction || Y && t.nodeType === M.comment && O(on, t.data));
646
+ }, Mt = function(t, e) {
647
+ if (t instanceof RegExp)
648
+ return O(t, e);
649
+ if (t instanceof Function) {
650
+ for (var n = arguments.length, a = new Array(n > 2 ? n - 2 : 0), l = 2; l < n; l++)
651
+ a[l - 2] = arguments[l];
652
+ return !!t(e, ...a);
653
+ }
654
+ return !1;
655
+ }, kn = function(t, e, n) {
656
+ if (!ft[e] && We(e) && Mt(x.tagNameCheck, e))
657
+ return !1;
658
+ if (jt && !et[e]) {
659
+ const a = K(t), l = q(t);
660
+ if (l && a) {
661
+ const u = l.length;
662
+ for (let m = u - 1; m >= 0; --m) {
663
+ const g = t === n ? un(l[m], !0) : l[m];
664
+ a.insertBefore(g, fn(t));
665
+ }
666
+ }
667
+ }
668
+ return H(t), !0;
669
+ }, Ue = function(t, e, n, a) {
670
+ return t.length === 0 ? e : e === n || e === a ? C(e) : e;
671
+ }, Fe = function(t, e) {
672
+ return t === e || K(t) !== null ? !1 : ($t && wt(t), !0);
673
+ }, ze = function(t, e) {
674
+ if (k(T.beforeSanitizeElements, t, null), Fe(t, e))
675
+ return !0;
676
+ if (It(t))
677
+ return H(t), !0;
678
+ const n = E(Ut(t));
679
+ if (h = Ue(T.uponSanitizeElement, h, Ht, yt), k(T.uponSanitizeElement, t, {
680
+ tagName: n,
681
+ allowedTags: h
682
+ }), Fe(t, e))
683
+ return !0;
684
+ if (vn(t, n))
685
+ return H(t), !0;
686
+ if (ft[n] || !(F.tagCheck instanceof Function && F.tagCheck(n)) && !h[n]) {
687
+ const l = kn(t, n, e);
688
+ return l === !1 && k(T.afterSanitizeElements, t, null), l;
689
+ }
690
+ if (ct(t) === M.element && !Cn(t) || (n === "noscript" || n === "noembed" || n === "noframes") && O(To, t.innerHTML))
691
+ return H(t), !0;
692
+ if (z && t.nodeType === M.text) {
693
+ const l = Nt(t.textContent);
694
+ t.textContent !== l && (dt(i.removed, {
695
+ element: t.cloneNode()
696
+ }), t.textContent = l);
697
+ }
698
+ return k(T.afterSanitizeElements, t, null), !1;
699
+ }, He = function(t, e, n) {
700
+ if (he[e] || xe(e, t) || Ae && (e === "id" || e === "name") && (n in s || n in wn))
701
+ return !1;
702
+ const a = _[e] || F.attributeCheck instanceof Function && F.attributeCheck(e, t);
703
+ return Gt && O(An, e) || _e && O(yn, e) ? !0 : a ? Le[e] || O(Te, Tt(n, de, "")) || (e === "src" || e === "xlink:href" || e === "href") && t !== "script" && Ve(n, "data:") === 0 && Oe[t] || ge && !O(Sn, Tt(n, de, "")) ? !0 : !n : (
704
+ // Condition a) covers a basically valid custom element tag name whose
705
+ // tag passes the configured tagNameCheck and whose attribute name
706
+ // passes the configured attributeNameCheck ...
707
+ We(t) && Mt(x.tagNameCheck, t) && Mt(x.attributeNameCheck, e, t) || // Condition b) covers an `is` attribute whose value passes the
708
+ // configured tagNameCheck while customized built-in elements are
709
+ // allowed.
710
+ e === "is" && x.allowCustomizedBuiltInElements && Mt(x.tagNameCheck, n)
711
+ );
712
+ }, Un = p({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), We = function(t) {
713
+ return !Un[_t(t)] && O(bn, t);
714
+ }, Fn = function(t, e, n, a) {
715
+ if (L && typeof gt == "object" && typeof gt.getAttributeType == "function" && !n)
716
+ switch (gt.getAttributeType(t, e)) {
717
+ case "TrustedHTML":
718
+ return J(a);
719
+ case "TrustedScriptURL":
720
+ return pn(a);
721
+ }
722
+ return a;
723
+ }, zn = function(t, e, n, a) {
724
+ try {
725
+ return n ? t.setAttributeNS(n, e, a) : t.setAttribute(e, a), It(t) ? (H(t), !1) : !0;
726
+ } catch {
727
+ return $(e, t), !1;
728
+ }
729
+ }, Ge = function(t) {
730
+ k(T.beforeSanitizeAttributes, t, null);
731
+ const e = t.attributes;
732
+ if (!e || It(t))
733
+ return;
734
+ _ = Ue(T.uponSanitizeAttribute, _, Wt, St);
735
+ const n = {
736
+ attrName: "",
737
+ attrValue: "",
738
+ keepAttr: !0,
739
+ allowedAttributes: _,
740
+ forceKeepAttr: void 0
741
+ };
742
+ let a = e.length;
743
+ const l = E(t.nodeName);
744
+ for (; a--; ) {
745
+ const u = e[a], m = u.name, g = u.namespaceURI, D = u.value, w = E(m), te = D;
746
+ let R = m === "value" ? te : Kn(te), Be = !1;
747
+ if (n.attrName = w, n.attrValue = R, n.keepAttr = !0, n.forceKeepAttr = void 0, k(T.uponSanitizeAttribute, t, n), R = n.attrValue, ye && (w === "id" || w === "name") && Ve(R, Se) !== 0 && ($(m, t, u), R = Se + R, Be = !0), Y && O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
748
+ $(m, t, u);
749
+ continue;
750
+ }
751
+ if (w === "attributename" && Xe(R, "href")) {
752
+ $(m, t, u);
753
+ continue;
754
+ }
755
+ if (!n.forceKeepAttr) {
756
+ if (!n.keepAttr) {
757
+ $(m, t, u);
758
+ continue;
759
+ }
760
+ if (!Ee && O(ho, R)) {
761
+ $(m, t, u);
762
+ continue;
763
+ }
764
+ if (z && (R = Nt(R)), !He(l, w, R)) {
765
+ $(m, t, u);
766
+ continue;
767
+ }
768
+ R = Fn(l, w, g, R), R !== te && zn(t, m, g, R) && Be && $e(i.removed);
769
+ }
770
+ }
771
+ k(T.afterSanitizeAttributes, t, null);
772
+ }, Ct = function(t) {
773
+ let e = null;
774
+ const n = ke(t);
775
+ for (k(T.beforeSanitizeShadowDOM, t, null); e = n.nextNode(); )
776
+ if (k(T.uponSanitizeShadowNode, e, null), ze(e, t), Ge(e), rt(e.content) && Ct(e.content), ct(e) === M.element) {
777
+ const a = ue(e);
778
+ rt(a) && (Qt(a), Ct(a));
779
+ }
780
+ k(T.afterSanitizeShadowDOM, t, null);
781
+ }, Qt = function(t) {
782
+ const e = [{
783
+ node: t,
784
+ shadow: null
785
+ }];
786
+ for (; e.length > 0; ) {
787
+ const n = e.pop();
788
+ if (n.shadow) {
789
+ Ct(n.shadow);
790
+ continue;
791
+ }
792
+ const a = n.node, u = ct(a) === M.element, m = q(a);
793
+ if (m)
794
+ for (let g = m.length - 1; g >= 0; --g)
795
+ e.push({
796
+ node: m[g],
797
+ shadow: null
798
+ });
799
+ if (u) {
800
+ const g = Z ? Z(a) : null;
801
+ if (typeof g == "string" && E(g) === "template") {
802
+ const D = a.content;
803
+ rt(D) && e.push({
804
+ node: D,
805
+ shadow: null
806
+ });
807
+ }
808
+ }
809
+ if (u) {
810
+ const g = ue(a);
811
+ rt(g) && e.push({
812
+ node: null,
813
+ shadow: g
814
+ }, {
815
+ node: g,
816
+ shadow: null
817
+ });
818
+ }
819
+ }
820
+ };
821
+ return i.sanitize = function(o) {
822
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = null, n = null, a = null, l = null;
823
+ if (Xt = !o, Xt && (o = "<!-->"), typeof o != "string" && !mt(o) && (o = eo(o), typeof o != "string"))
824
+ throw X("dirty is not a string, aborting");
825
+ if (!i.isSupported)
826
+ return o;
827
+ Bt ? (h = yt, _ = St) : Zt(t), (T.uponSanitizeElement.length > 0 || T.uponSanitizeAttribute.length > 0) && (h = C(h)), T.uponSanitizeAttribute.length > 0 && (_ = C(_)), i.removed = [];
828
+ const u = $t && typeof o != "string" && mt(o);
829
+ if (u) {
830
+ xn(o);
831
+ const D = Ut(o);
832
+ if (typeof D == "string") {
833
+ const w = E(D);
834
+ if (!h[w] || ft[w])
835
+ throw Dt(o), X("root node is forbidden and cannot be sanitized in-place");
836
+ }
837
+ if (It(o))
838
+ throw Dt(o), X("root node is clobbered and cannot be sanitized in-place");
839
+ try {
840
+ Qt(o);
841
+ } catch (w) {
842
+ throw Dt(o), w;
843
+ }
844
+ } else if (mt(o))
845
+ e = ve("<!---->"), n = e.ownerDocument.importNode(o, !0), n.nodeType === M.element && n.nodeName === "BODY" || n.nodeName === "HTML" ? e = n : e.appendChild(n), Qt(e);
846
+ else {
847
+ if (!Q && !z && !j && // eslint-disable-next-line unicorn/prefer-includes
848
+ o.indexOf("<") === -1)
849
+ return L && Ot ? J(o) : o;
850
+ if (e = ve(o), !e)
851
+ return Q ? null : Ot ? B : "";
852
+ }
853
+ e && Yt && H(e.firstChild);
854
+ const m = u ? o : e;
855
+ try {
856
+ const D = ke(m);
857
+ for (; a = D.nextNode(); )
858
+ ze(a, m), Ge(a), rt(a.content) && Ct(a.content);
859
+ } catch (D) {
860
+ throw u && (Dt(o), V(i.removed, (w) => {
861
+ w.element && wt(w.element);
862
+ })), D;
863
+ }
864
+ if (u)
865
+ return V(i.removed, (D) => {
866
+ D.element && wt(D.element);
867
+ }), z && Jt(o), o;
868
+ if (Q) {
869
+ if (z && Jt(e), bt)
870
+ for (l = dn.call(e.ownerDocument); e.firstChild; )
871
+ l.appendChild(e.firstChild);
872
+ else
873
+ l = e;
874
+ return (_.shadowroot || _.shadowrootmode) && (l = hn.call(c, l, !0)), l;
875
+ }
876
+ let g = j ? e.outerHTML : e.innerHTML;
877
+ return j && h["!doctype"] && e.ownerDocument && e.ownerDocument.doctype && e.ownerDocument.doctype.name && O(po, e.ownerDocument.doctype.name) && (g = "<!DOCTYPE " + e.ownerDocument.doctype.name + `>
878
+ ` + g), z && (g = Nt(g)), L && Ot ? J(g) : g;
879
+ }, i.setConfig = function() {
880
+ let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
881
+ Zt(o), Bt = !0, yt = h, St = _;
882
+ }, i.clearConfig = function() {
883
+ ot = null, Bt = !1, yt = null, St = null, L = Ft, B = "";
884
+ }, i.isValidAttribute = function(o, t, e) {
885
+ ot || Zt({});
886
+ const n = E(o), a = E(t);
887
+ return He(n, a, e);
888
+ }, i.addHook = function(o, t) {
889
+ typeof t == "function" && N(T, o) && dt(T[o], t);
890
+ }, i.removeHook = function(o, t) {
891
+ if (N(T, o)) {
892
+ if (t !== void 0) {
893
+ const e = Vn(T[o], t);
894
+ return e === -1 ? void 0 : qn(T[o], e, 1)[0];
895
+ }
896
+ return $e(T[o]);
897
+ }
898
+ }, i.removeHooks = function(o) {
899
+ N(T, o) && (T[o] = []);
900
+ }, i.removeAllHooks = function() {
901
+ T = rn();
902
+ }, i;
903
+ }
904
+ var So = cn();
905
+ export {
906
+ So as default
907
+ };
908
+ //# sourceMappingURL=purify.es.js.map