!(function (e, t) { "object" == typeof exports && "undefined" != typeof module ? t(exports, require("react"), require("react-dom")) : "function" == typeof define && define.amd ? define(["exports", "react", "react-dom"], t) : t( ((e = "undefined" != typeof globalThis ? globalThis : e || self).ChatUI = {}), e.React, e.ReactDOM, ); })(this, function (e, t, n) { "use strict"; function r(e) { return e && "object" == typeof e && "default" in e ? e : { default: e }; } e.version = "2.3.1"; var o = r(t), a = r(n); function i(e) { var t, n, r = ""; if ("string" == typeof e || "number" == typeof e) r += e; else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (n = i(e[t])) && (r && (r += " "), (r += n)); else for (t in e) e[t] && (r && (r += " "), (r += t)); return r; } function c() { for (var e, t, n = 0, r = ""; n < arguments.length; ) (e = arguments[n++]) && (t = i(e)) && (r && (r += " "), (r += t)); return r; } function u(e) { return ( (u = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e; } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; }), u(e) ); } function l(e, t) { return ( (l = Object.setPrototypeOf || function (e, t) { return (e.__proto__ = t), e; }), l(e, t) ); } function s() { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (e) { return !1; } } function f(e, t, n) { return ( (f = s() ? Reflect.construct : function (e, t, n) { var r = [null]; r.push.apply(r, t); var o = new (Function.bind.apply(e, r))(); return n && l(o, n.prototype), o; }), f.apply(null, arguments) ); } function d(e) { return ( (function (e) { if (Array.isArray(e)) return p(e); })(e) || (function (e) { if ( ("undefined" != typeof Symbol && null != e[Symbol.iterator]) || null != e["@@iterator"] ) return Array.from(e); })(e) || (function (e, t) { if (!e) return; if ("string" == typeof e) return p(e, t); var n = Object.prototype.toString.call(e).slice(8, -1); "Object" === n && e.constructor && (n = e.constructor.name); if ("Map" === n || "Set" === n) return Array.from(e); if ( "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ) return p(e, t); })(e) || (function () { throw new TypeError( "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.", ); })() ); } function p(e, t) { (null == t || t > e.length) && (t = e.length); for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n]; return r; } !(function () { if ("object" == typeof window) if ( "IntersectionObserver" in window && "IntersectionObserverEntry" in window && "intersectionRatio" in window.IntersectionObserverEntry.prototype ) "isIntersecting" in window.IntersectionObserverEntry.prototype || Object.defineProperty( window.IntersectionObserverEntry.prototype, "isIntersecting", { get: function () { return this.intersectionRatio > 0; }, }, ); else { var e = (function (e) { for (var t = window.document, n = o(t); n; ) n = o((t = n.ownerDocument)); return t; })(), t = [], n = null, r = null; (i.prototype.THROTTLE_TIMEOUT = 100), (i.prototype.POLL_INTERVAL = null), (i.prototype.USE_MUTATION_OBSERVER = !0), (i._setupCrossOriginUpdater = function () { return ( n || (n = function (e, n) { (r = e && n ? f(e, n) : { top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0, }), t.forEach(function (e) { e._checkForIntersections(); }); }), n ); }), (i._resetCrossOriginUpdater = function () { (n = null), (r = null); }), (i.prototype.observe = function (e) { if ( !this._observationTargets.some(function (t) { return t.element == e; }) ) { if (!e || 1 != e.nodeType) throw new Error("target must be an Element"); this._registerInstance(), this._observationTargets.push({ element: e, entry: null }), this._monitorIntersections(e.ownerDocument), this._checkForIntersections(); } }), (i.prototype.unobserve = function (e) { (this._observationTargets = this._observationTargets.filter( function (t) { return t.element != e; }, )), this._unmonitorIntersections(e.ownerDocument), 0 == this._observationTargets.length && this._unregisterInstance(); }), (i.prototype.disconnect = function () { (this._observationTargets = []), this._unmonitorAllIntersections(), this._unregisterInstance(); }), (i.prototype.takeRecords = function () { var e = this._queuedEntries.slice(); return (this._queuedEntries = []), e; }), (i.prototype._initThresholds = function (e) { var t = e || [0]; return ( Array.isArray(t) || (t = [t]), t.sort().filter(function (e, t, n) { if ("number" != typeof e || isNaN(e) || e < 0 || e > 1) throw new Error( "threshold must be a number between 0 and 1 inclusively", ); return e !== n[t - 1]; }) ); }), (i.prototype._parseRootMargin = function (e) { var t = (e || "0px").split(/\s+/).map(function (e) { var t = /^(-?\d*\.?\d+)(px|%)$/.exec(e); if (!t) throw new Error( "rootMargin must be specified in pixels or percent", ); return { value: parseFloat(t[1]), unit: t[2] }; }); return ( (t[1] = t[1] || t[0]), (t[2] = t[2] || t[0]), (t[3] = t[3] || t[1]), t ); }), (i.prototype._monitorIntersections = function (t) { var n = t.defaultView; if (n && -1 == this._monitoringDocuments.indexOf(t)) { var r = this._checkForIntersections, a = null, i = null; this.POLL_INTERVAL ? (a = n.setInterval(r, this.POLL_INTERVAL)) : (c(n, "resize", r, !0), c(t, "scroll", r, !0), this.USE_MUTATION_OBSERVER && "MutationObserver" in n && (i = new n.MutationObserver(r)).observe(t, { attributes: !0, childList: !0, characterData: !0, subtree: !0, })), this._monitoringDocuments.push(t), this._monitoringUnsubscribes.push(function () { var e = t.defaultView; e && (a && e.clearInterval(a), u(e, "resize", r, !0)), u(t, "scroll", r, !0), i && i.disconnect(); }); var l = (this.root && (this.root.ownerDocument || this.root)) || e; if (t != l) { var s = o(t); s && this._monitorIntersections(s.ownerDocument); } } }), (i.prototype._unmonitorIntersections = function (t) { var n = this._monitoringDocuments.indexOf(t); if (-1 != n) { var r = (this.root && (this.root.ownerDocument || this.root)) || e, a = this._observationTargets.some(function (e) { var n = e.element.ownerDocument; if (n == t) return !0; for (; n && n != r; ) { var a = o(n); if ((n = a && a.ownerDocument) == t) return !0; } return !1; }); if (!a) { var i = this._monitoringUnsubscribes[n]; if ( (this._monitoringDocuments.splice(n, 1), this._monitoringUnsubscribes.splice(n, 1), i(), t != r) ) { var c = o(t); c && this._unmonitorIntersections(c.ownerDocument); } } } }), (i.prototype._unmonitorAllIntersections = function () { var e = this._monitoringUnsubscribes.slice(0); (this._monitoringDocuments.length = 0), (this._monitoringUnsubscribes.length = 0); for (var t = 0; t < e.length; t++) e[t](); }), (i.prototype._checkForIntersections = function () { if (this.root || !n || r) { var e = this._rootIsInDom(), t = e ? this._getRootRect() : { top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0, }; this._observationTargets.forEach(function (r) { var o = r.element, i = l(o), c = this._rootContainsTarget(o), u = r.entry, s = e && c && this._computeTargetAndRootIntersection(o, i, t), f = null; this._rootContainsTarget(o) ? (n && !this.root) || (f = t) : (f = { top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0, }); var d = (r.entry = new a({ time: window.performance && performance.now && performance.now(), target: o, boundingClientRect: i, rootBounds: f, intersectionRect: s, })); u ? e && c ? this._hasCrossedThreshold(u, d) && this._queuedEntries.push(d) : u && u.isIntersecting && this._queuedEntries.push(d) : this._queuedEntries.push(d); }, this), this._queuedEntries.length && this._callback(this.takeRecords(), this); } }), (i.prototype._computeTargetAndRootIntersection = function (t, o, a) { if ("none" != window.getComputedStyle(t).display) { for ( var i, c, u, s, d, m, v, h, g = o, y = p(t), b = !1; !b && y; ) { var E = null, w = 1 == y.nodeType ? window.getComputedStyle(y) : {}; if ("none" == w.display) return null; if (y == this.root || 9 == y.nodeType) if (((b = !0), y == this.root || y == e)) n && !this.root ? !r || (0 == r.width && 0 == r.height) ? ((y = null), (E = null), (g = null)) : (E = r) : (E = a); else { var x = p(y), N = x && l(x), T = x && this._computeTargetAndRootIntersection(x, N, a); N && T ? ((y = x), (E = f(N, T))) : ((y = null), (g = null)); } else { var S = y.ownerDocument; y != S.body && y != S.documentElement && "visible" != w.overflow && (E = l(y)); } if ( (E && ((i = E), (c = g), (u = void 0), (s = void 0), (d = void 0), (m = void 0), (v = void 0), (h = void 0), (u = Math.max(i.top, c.top)), (s = Math.min(i.bottom, c.bottom)), (d = Math.max(i.left, c.left)), (m = Math.min(i.right, c.right)), (h = s - u), (g = ((v = m - d) >= 0 && h >= 0 && { top: u, bottom: s, left: d, right: m, width: v, height: h, }) || null)), !g) ) break; y = y && p(y); } return g; } }), (i.prototype._getRootRect = function () { var t; if (this.root && !m(this.root)) t = l(this.root); else { var n = m(this.root) ? this.root : e, r = n.documentElement, o = n.body; t = { top: 0, left: 0, right: r.clientWidth || o.clientWidth, width: r.clientWidth || o.clientWidth, bottom: r.clientHeight || o.clientHeight, height: r.clientHeight || o.clientHeight, }; } return this._expandRectByRootMargin(t); }), (i.prototype._expandRectByRootMargin = function (e) { var t = this._rootMarginValues.map(function (t, n) { return "px" == t.unit ? t.value : (t.value * (n % 2 ? e.width : e.height)) / 100; }), n = { top: e.top - t[0], right: e.right + t[1], bottom: e.bottom + t[2], left: e.left - t[3], }; return ( (n.width = n.right - n.left), (n.height = n.bottom - n.top), n ); }), (i.prototype._hasCrossedThreshold = function (e, t) { var n = e && e.isIntersecting ? e.intersectionRatio || 0 : -1, r = t.isIntersecting ? t.intersectionRatio || 0 : -1; if (n !== r) for (var o = 0; o < this.thresholds.length; o++) { var a = this.thresholds[o]; if (a == n || a == r || a < n != a < r) return !0; } }), (i.prototype._rootIsInDom = function () { return !this.root || d(e, this.root); }), (i.prototype._rootContainsTarget = function (t) { var n = (this.root && (this.root.ownerDocument || this.root)) || e; return d(n, t) && (!this.root || n == t.ownerDocument); }), (i.prototype._registerInstance = function () { t.indexOf(this) < 0 && t.push(this); }), (i.prototype._unregisterInstance = function () { var e = t.indexOf(this); -1 != e && t.splice(e, 1); }), (window.IntersectionObserver = i), (window.IntersectionObserverEntry = a); } function o(e) { try { return (e.defaultView && e.defaultView.frameElement) || null; } catch (e) { return null; } } function a(e) { (this.time = e.time), (this.target = e.target), (this.rootBounds = s(e.rootBounds)), (this.boundingClientRect = s(e.boundingClientRect)), (this.intersectionRect = s( e.intersectionRect || { top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0, }, )), (this.isIntersecting = !!e.intersectionRect); var t = this.boundingClientRect, n = t.width * t.height, r = this.intersectionRect, o = r.width * r.height; this.intersectionRatio = n ? Number((o / n).toFixed(4)) : this.isIntersecting ? 1 : 0; } function i(e, t) { var n, r, o, a = t || {}; if ("function" != typeof e) throw new Error("callback must be a function"); if (a.root && 1 != a.root.nodeType && 9 != a.root.nodeType) throw new Error("root must be a Document or Element"); (this._checkForIntersections = ((n = this._checkForIntersections.bind(this)), (r = this.THROTTLE_TIMEOUT), (o = null), function () { o || (o = setTimeout(function () { n(), (o = null); }, r)); })), (this._callback = e), (this._observationTargets = []), (this._queuedEntries = []), (this._rootMarginValues = this._parseRootMargin(a.rootMargin)), (this.thresholds = this._initThresholds(a.threshold)), (this.root = a.root || null), (this.rootMargin = this._rootMarginValues .map(function (e) { return e.value + e.unit; }) .join(" ")), (this._monitoringDocuments = []), (this._monitoringUnsubscribes = []); } function c(e, t, n, r) { "function" == typeof e.addEventListener ? e.addEventListener(t, n, r || !1) : "function" == typeof e.attachEvent && e.attachEvent("on" + t, n); } function u(e, t, n, r) { "function" == typeof e.removeEventListener ? e.removeEventListener(t, n, r || !1) : "function" == typeof e.detachEvent && e.detachEvent("on" + t, n); } function l(e) { var t; try { t = e.getBoundingClientRect(); } catch (e) {} return t ? ((t.width && t.height) || (t = { top: t.top, right: t.right, bottom: t.bottom, left: t.left, width: t.right - t.left, height: t.bottom - t.top, }), t) : { top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0 }; } function s(e) { return !e || "x" in e ? e : { top: e.top, y: e.top, bottom: e.bottom, left: e.left, x: e.left, right: e.right, width: e.width, height: e.height, }; } function f(e, t) { var n = t.top - e.top, r = t.left - e.left; return { top: n, left: r, height: t.height, width: t.width, bottom: n + t.height, right: r + t.width, }; } function d(e, t) { for (var n = t; n; ) { if (n == e) return !0; n = p(n); } return !1; } function p(t) { var n = t.parentNode; return 9 == t.nodeType && t != e ? o(t) : (n && n.assignedSlot && (n = n.assignedSlot.parentNode), n && 11 == n.nodeType && n.host ? n.host : n); } function m(e) { return e && 9 === e.nodeType; } })(); var m = Object.hasOwnProperty, v = Object.setPrototypeOf, h = Object.isFrozen, g = Object.getPrototypeOf, y = Object.getOwnPropertyDescriptor, b = Object.freeze, E = Object.seal, w = Object.create, x = "undefined" != typeof Reflect && Reflect, N = x.apply, T = x.construct; N || (N = function (e, t, n) { return e.apply(t, n); }), b || (b = function (e) { return e; }), E || (E = function (e) { return e; }), T || (T = function (e, t) { return f(e, d(t)); }); var S, C = P(Array.prototype.forEach), O = P(Array.prototype.pop), R = P(Array.prototype.push), k = P(String.prototype.toLowerCase), I = P(String.prototype.match), A = P(String.prototype.replace), M = P(String.prototype.indexOf), _ = P(String.prototype.trim), j = P(RegExp.prototype.test), L = ((S = TypeError), function () { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n]; return T(S, t); }); function P(e) { return function (t) { for ( var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), o = 1; o < n; o++ ) r[o - 1] = arguments[o]; return N(e, t, r); }; } function D(e, t, n) { (n = n || k), v && v(e, null); for (var r = t.length; r--; ) { var o = t[r]; if ("string" == typeof o) { var a = n(o); a !== o && (h(t) || (t[r] = a), (o = a)); } e[o] = !0; } return e; } function F(e) { var t, n = w(null); for (t in e) N(m, e, [t]) && (n[t] = e[t]); return n; } function H(e, t) { for (; null !== e; ) { var n = y(e, t); if (n) { if (n.get) return P(n.get); if ("function" == typeof n.value) return P(n.value); } e = g(e); } return function (e) { return null; }; } var B = b([ "a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", ]), U = b([ "svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern", ]), z = b([ "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", ]), G = b([ "animate", "color-profile", "cursor", "discard", "fedropshadow", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use", ]), V = b([ "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", ]), Y = b([ "maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none", ]), W = b(["#text"]), X = b([ "accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns", "slot", ]), q = b([ "accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan", ]), $ = b([ "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", ]), K = b(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), J = E(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Q = E(/<%[\w\W]*|[\w\W]*%>/gm), Z = E(/^data-[\-\w.\u00B7-\uFFFF]/), ee = E(/^aria-[\-\w]+$/), te = E( /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i, ), ne = E(/^(?:\w+script|data):/i), re = E(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), oe = E(/^html$/i), ae = function () { return "undefined" == typeof window ? null : window; }, ie = function (e, t) { if ("object" !== u(e) || "function" != typeof e.createPolicy) return null; var n = null, r = "data-tt-policy-suffix"; t.currentScript && t.currentScript.hasAttribute(r) && (n = t.currentScript.getAttribute(r)); var o = "dompurify" + (n ? "#" + n : ""); try { return e.createPolicy(o, { createHTML: function (e) { return e; }, createScriptURL: function (e) { return e; }, }); } catch (e) { return null; } }; var ce = (function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ae(), n = function (t) { return e(t); }; if ( ((n.version = "2.4.0"), (n.removed = []), !t || !t.document || 9 !== t.document.nodeType) ) return (n.isSupported = !1), n; var r = t.document, o = t.document, a = t.DocumentFragment, i = t.HTMLTemplateElement, c = t.Node, l = t.Element, s = t.NodeFilter, f = t.NamedNodeMap, p = void 0 === f ? t.NamedNodeMap || t.MozNamedAttrMap : f, m = t.HTMLFormElement, v = t.DOMParser, h = t.trustedTypes, g = l.prototype, y = H(g, "cloneNode"), E = H(g, "nextSibling"), w = H(g, "childNodes"), x = H(g, "parentNode"); if ("function" == typeof i) { var N = o.createElement("template"); N.content && N.content.ownerDocument && (o = N.content.ownerDocument); } var T = ie(h, r), S = T ? T.createHTML("") : "", P = o, ce = P.implementation, ue = P.createNodeIterator, le = P.createDocumentFragment, se = P.getElementsByTagName, fe = r.importNode, de = {}; try { de = F(o).documentMode ? o.documentMode : {}; } catch (e) {} var pe = {}; n.isSupported = "function" == typeof x && ce && void 0 !== ce.createHTMLDocument && 9 !== de; var me, ve, he = J, ge = Q, ye = Z, be = ee, Ee = ne, we = re, xe = te, Ne = null, Te = D({}, [].concat(d(B), d(U), d(z), d(V), d(W))), Se = null, Ce = D({}, [].concat(d(X), d(q), d($), d(K))), Oe = Object.seal( Object.create(null, { tagNameCheck: { writable: !0, configurable: !1, enumerable: !0, value: null, }, attributeNameCheck: { writable: !0, configurable: !1, enumerable: !0, value: null, }, allowCustomizedBuiltInElements: { writable: !0, configurable: !1, enumerable: !0, value: !1, }, }), ), Re = null, ke = null, Ie = !0, Ae = !0, Me = !1, _e = !1, je = !1, Le = !1, Pe = !1, De = !1, Fe = !1, He = !1, Be = !0, Ue = !1, ze = "user-content-", Ge = !0, Ve = !1, Ye = {}, We = null, Xe = D({}, [ "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", ]), qe = null, $e = D({}, ["audio", "video", "img", "source", "image", "track"]), Ke = null, Je = D({}, [ "alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns", ]), Qe = "http://www.w3.org/1998/Math/MathML", Ze = "http://www.w3.org/2000/svg", et = "http://www.w3.org/1999/xhtml", tt = et, nt = !1, rt = ["application/xhtml+xml", "text/html"], ot = "text/html", at = null, it = o.createElement("form"), ct = function (e) { return e instanceof RegExp || e instanceof Function; }, ut = function (e) { (at && at === e) || ((e && "object" === u(e)) || (e = {}), (e = F(e)), (me = me = -1 === rt.indexOf(e.PARSER_MEDIA_TYPE) ? ot : e.PARSER_MEDIA_TYPE), (ve = "application/xhtml+xml" === me ? function (e) { return e; } : k), (Ne = "ALLOWED_TAGS" in e ? D({}, e.ALLOWED_TAGS, ve) : Te), (Se = "ALLOWED_ATTR" in e ? D({}, e.ALLOWED_ATTR, ve) : Ce), (Ke = "ADD_URI_SAFE_ATTR" in e ? D(F(Je), e.ADD_URI_SAFE_ATTR, ve) : Je), (qe = "ADD_DATA_URI_TAGS" in e ? D(F($e), e.ADD_DATA_URI_TAGS, ve) : $e), (We = "FORBID_CONTENTS" in e ? D({}, e.FORBID_CONTENTS, ve) : Xe), (Re = "FORBID_TAGS" in e ? D({}, e.FORBID_TAGS, ve) : {}), (ke = "FORBID_ATTR" in e ? D({}, e.FORBID_ATTR, ve) : {}), (Ye = "USE_PROFILES" in e && e.USE_PROFILES), (Ie = !1 !== e.ALLOW_ARIA_ATTR), (Ae = !1 !== e.ALLOW_DATA_ATTR), (Me = e.ALLOW_UNKNOWN_PROTOCOLS || !1), (_e = e.SAFE_FOR_TEMPLATES || !1), (je = e.WHOLE_DOCUMENT || !1), (De = e.RETURN_DOM || !1), (Fe = e.RETURN_DOM_FRAGMENT || !1), (He = e.RETURN_TRUSTED_TYPE || !1), (Pe = e.FORCE_BODY || !1), (Be = !1 !== e.SANITIZE_DOM), (Ue = e.SANITIZE_NAMED_PROPS || !1), (Ge = !1 !== e.KEEP_CONTENT), (Ve = e.IN_PLACE || !1), (xe = e.ALLOWED_URI_REGEXP || xe), (tt = e.NAMESPACE || et), e.CUSTOM_ELEMENT_HANDLING && ct(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (Oe.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && ct(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (Oe.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && "boolean" == typeof e.CUSTOM_ELEMENT_HANDLING .allowCustomizedBuiltInElements && (Oe.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), _e && (Ae = !1), Fe && (De = !0), Ye && ((Ne = D({}, d(W))), (Se = []), !0 === Ye.html && (D(Ne, B), D(Se, X)), !0 === Ye.svg && (D(Ne, U), D(Se, q), D(Se, K)), !0 === Ye.svgFilters && (D(Ne, z), D(Se, q), D(Se, K)), !0 === Ye.mathMl && (D(Ne, V), D(Se, $), D(Se, K))), e.ADD_TAGS && (Ne === Te && (Ne = F(Ne)), D(Ne, e.ADD_TAGS, ve)), e.ADD_ATTR && (Se === Ce && (Se = F(Se)), D(Se, e.ADD_ATTR, ve)), e.ADD_URI_SAFE_ATTR && D(Ke, e.ADD_URI_SAFE_ATTR, ve), e.FORBID_CONTENTS && (We === Xe && (We = F(We)), D(We, e.FORBID_CONTENTS, ve)), Ge && (Ne["#text"] = !0), je && D(Ne, ["html", "head", "body"]), Ne.table && (D(Ne, ["tbody"]), delete Re.tbody), b && b(e), (at = e)); }, lt = D({}, ["mi", "mo", "mn", "ms", "mtext"]), st = D({}, ["foreignobject", "desc", "title", "annotation-xml"]), ft = D({}, ["title", "style", "font", "a", "script"]), dt = D({}, U); D(dt, z), D(dt, G); var pt = D({}, V); D(pt, Y); var mt = function (e) { var t = x(e); (t && t.tagName) || (t = { namespaceURI: et, tagName: "template" }); var n = k(e.tagName), r = k(t.tagName); return e.namespaceURI === Ze ? t.namespaceURI === et ? "svg" === n : t.namespaceURI === Qe ? "svg" === n && ("annotation-xml" === r || lt[r]) : Boolean(dt[n]) : e.namespaceURI === Qe ? t.namespaceURI === et ? "math" === n : t.namespaceURI === Ze ? "math" === n && st[r] : Boolean(pt[n]) : e.namespaceURI === et && !(t.namespaceURI === Ze && !st[r]) && !(t.namespaceURI === Qe && !lt[r]) && !pt[n] && (ft[n] || !dt[n]); }, vt = function (e) { R(n.removed, { element: e }); try { e.parentNode.removeChild(e); } catch (t) { try { e.outerHTML = S; } catch (t) { e.remove(); } } }, ht = function (e, t) { try { R(n.removed, { attribute: t.getAttributeNode(e), from: t }); } catch (e) { R(n.removed, { attribute: null, from: t }); } if ((t.removeAttribute(e), "is" === e && !Se[e])) if (De || Fe) try { vt(t); } catch (e) {} else try { t.setAttribute(e, ""); } catch (e) {} }, gt = function (e) { var t, n; if (Pe) e = "" + e; else { var r = I(e, /^[\r\n\t ]+/); n = r && r[0]; } "application/xhtml+xml" === me && (e = '' + e + ""); var a = T ? T.createHTML(e) : e; if (tt === et) try { t = new v().parseFromString(a, me); } catch (e) {} if (!t || !t.documentElement) { t = ce.createDocument(tt, "template", null); try { t.documentElement.innerHTML = nt ? "" : a; } catch (e) {} } var i = t.body || t.documentElement; return ( e && n && i.insertBefore(o.createTextNode(n), i.childNodes[0] || null), tt === et ? se.call(t, je ? "html" : "body")[0] : je ? t.documentElement : i ); }, yt = function (e) { return ue.call( e.ownerDocument || e, e, s.SHOW_ELEMENT | s.SHOW_COMMENT | s.SHOW_TEXT, null, !1, ); }, bt = function (e) { return ( e instanceof m && ("string" != typeof e.nodeName || "string" != typeof e.textContent || "function" != typeof e.removeChild || !(e.attributes instanceof p) || "function" != typeof e.removeAttribute || "function" != typeof e.setAttribute || "string" != typeof e.namespaceURI || "function" != typeof e.insertBefore) ); }, Et = function (e) { return "object" === u(c) ? e instanceof c : e && "object" === u(e) && "number" == typeof e.nodeType && "string" == typeof e.nodeName; }, wt = function (e, t, r) { pe[e] && C(pe[e], function (e) { e.call(n, t, r, at); }); }, xt = function (e) { var t; if ((wt("beforeSanitizeElements", e, null), bt(e))) return vt(e), !0; if (j(/[\u0080-\uFFFF]/, e.nodeName)) return vt(e), !0; var r = ve(e.nodeName); if ( (wt("uponSanitizeElement", e, { tagName: r, allowedTags: Ne }), e.hasChildNodes() && !Et(e.firstElementChild) && (!Et(e.content) || !Et(e.content.firstElementChild)) && j(/<[/\w]/g, e.innerHTML) && j(/<[/\w]/g, e.textContent)) ) return vt(e), !0; if ("select" === r && j(/