import { jsx as Wt } from "react/jsx-runtime";
import { useState as Bt, useEffect as Yt, useMemo as Xt } from "react";
/*! @license DOMPurify 3.2.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.1/LICENSE */
const {
  entries: Tt,
  setPrototypeOf: rt,
  isFrozen: jt,
  getPrototypeOf: Vt,
  getOwnPropertyDescriptor: $t
} = Object;
let {
  freeze: A,
  seal: L,
  create: dt
} = Object, {
  apply: Me,
  construct: Ce
} = typeof Reflect < "u" && Reflect;
A || (A = function(n) {
  return n;
});
L || (L = function(n) {
  return n;
});
Me || (Me = function(n, l, a) {
  return n.apply(l, a);
});
Ce || (Ce = function(n, l) {
  return new n(...l);
});
const se = R(Array.prototype.forEach), at = R(Array.prototype.pop), V = R(Array.prototype.push), ce = R(String.prototype.toLowerCase), ye = R(String.prototype.toString), st = R(String.prototype.match), $ = R(String.prototype.replace), qt = R(String.prototype.indexOf), Kt = R(String.prototype.trim), O = R(Object.prototype.hasOwnProperty), h = R(RegExp.prototype.test), q = Zt(TypeError);
function R(r) {
  return function(n) {
    for (var l = arguments.length, a = new Array(l > 1 ? l - 1 : 0), c = 1; c < l; c++)
      a[c - 1] = arguments[c];
    return Me(r, n, a);
  };
}
function Zt(r) {
  return function() {
    for (var n = arguments.length, l = new Array(n), a = 0; a < n; a++)
      l[a] = arguments[a];
    return Ce(r, l);
  };
}
function s(r, n) {
  let l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ce;
  rt && rt(r, null);
  let a = n.length;
  for (; a--; ) {
    let c = n[a];
    if (typeof c == "string") {
      const D = l(c);
      D !== c && (jt(n) || (n[a] = D), c = D);
    }
    r[c] = !0;
  }
  return r;
}
function Jt(r) {
  for (let n = 0; n < r.length; n++)
    O(r, n) || (r[n] = null);
  return r;
}
function w(r) {
  const n = dt(null);
  for (const [l, a] of Tt(r))
    O(r, l) && (Array.isArray(a) ? n[l] = Jt(a) : a && typeof a == "object" && a.constructor === Object ? n[l] = w(a) : n[l] = a);
  return n;
}
function K(r, n) {
  for (; r !== null; ) {
    const a = $t(r, n);
    if (a) {
      if (a.get)
        return R(a.get);
      if (typeof a.value == "function")
        return R(a.value);
    }
    r = Vt(r);
  }
  function l() {
    return null;
  }
  return l;
}
const lt = A(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Ne = A(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), be = A(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Qt = A(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), De = A(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), en = A(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), ct = A(["#text"]), ft = A(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), Ie = A(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), ut = A(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), le = A(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), tn = L(/\{\{[\w\W]*|[\w\W]*\}\}/gm), nn = L(/<%[\w\W]*|[\w\W]*%>/gm), on = L(/\${[\w\W]*}/gm), rn = L(/^data-[\-\w.\u00B7-\uFFFF]/), an = L(/^aria-[\-\w]+$/), _t = L(
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
  // eslint-disable-line no-useless-escape
), sn = L(/^(?:\w+script|data):/i), ln = L(
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
  // eslint-disable-line no-control-regex
), Et = L(/^html$/i), cn = L(/^[a-z][.\w]*(-[.\w]+)+$/i);
var mt = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  ARIA_ATTR: an,
  ATTR_WHITESPACE: ln,
  CUSTOM_ELEMENT: cn,
  DATA_ATTR: rn,
  DOCTYPE_NAME: Et,
  ERB_EXPR: nn,
  IS_ALLOWED_URI: _t,
  IS_SCRIPT_OR_DATA: sn,
  MUSTACHE_EXPR: tn,
  TMPLIT_EXPR: on
});
const Z = {
  element: 1,
  text: 3,
  // Deprecated
  progressingInstruction: 7,
  comment: 8,
  document: 9
}, fn = function() {
  return typeof window > "u" ? null : window;
}, un = function(n, l) {
  if (typeof n != "object" || typeof n.createPolicy != "function")
    return null;
  let a = null;
  const c = "data-tt-policy-suffix";
  l && l.hasAttribute(c) && (a = l.getAttribute(c));
  const D = "dompurify" + (a ? "#" + a : "");
  try {
    return n.createPolicy(D, {
      createHTML(x) {
        return x;
      },
      createScriptURL(x) {
        return x;
      }
    });
  } catch {
    return console.warn("TrustedTypes policy " + D + " could not be created."), null;
  }
};
function gt() {
  let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : fn();
  const n = (i) => gt(i);
  if (n.version = "3.2.1", n.removed = [], !r || !r.document || r.document.nodeType !== Z.document)
    return n.isSupported = !1, n;
  let {
    document: l
  } = r;
  const a = l, c = a.currentScript, {
    DocumentFragment: D,
    HTMLTemplateElement: x,
    Node: fe,
    Element: we,
    NodeFilter: z,
    NamedNodeMap: ht = r.NamedNodeMap || r.MozNamedAttrMap,
    HTMLFormElement: At,
    DOMParser: St,
    trustedTypes: J
  } = r, G = we.prototype, Rt = K(G, "cloneNode"), Lt = K(G, "remove"), Ot = K(G, "nextSibling"), yt = K(G, "childNodes"), Q = K(G, "parentNode");
  if (typeof x == "function") {
    const i = l.createElement("template");
    i.content && i.content.ownerDocument && (l = i.content.ownerDocument);
  }
  let E, W = "";
  const {
    implementation: ue,
    createNodeIterator: Nt,
    createDocumentFragment: bt,
    getElementsByTagName: Dt
  } = l, {
    importNode: It
  } = a;
  let y = {};
  n.isSupported = typeof Tt == "function" && typeof Q == "function" && ue && ue.createHTMLDocument !== void 0;
  const {
    MUSTACHE_EXPR: me,
    ERB_EXPR: pe,
    TMPLIT_EXPR: Te,
    DATA_ATTR: Mt,
    ARIA_ATTR: Ct,
    IS_SCRIPT_OR_DATA: wt,
    ATTR_WHITESPACE: xe,
    CUSTOM_ELEMENT: xt
  } = mt;
  let {
    IS_ALLOWED_URI: Pe
  } = mt, m = null;
  const ke = s({}, [...lt, ...Ne, ...be, ...De, ...ct]);
  let p = null;
  const ve = s({}, [...ft, ...Ie, ...ut, ...le]);
  let u = Object.seal(dt(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
    }
  })), B = null, de = null, Ue = !0, _e = !0, Fe = !1, He = !0, P = !1, Ee = !0, C = !1, ge = !1, he = !1, k = !1, ee = !1, te = !1, ze = !0, Ge = !1;
  const Pt = "user-content-";
  let Ae = !0, Y = !1, v = {}, U = null;
  const We = s({}, ["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"]);
  let Be = null;
  const Ye = s({}, ["audio", "video", "img", "source", "image", "track"]);
  let Se = null;
  const Xe = s({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ne = "http://www.w3.org/1998/Math/MathML", oe = "http://www.w3.org/2000/svg", I = "http://www.w3.org/1999/xhtml";
  let F = I, Re = !1, Le = null;
  const kt = s({}, [ne, oe, I], ye);
  let ie = s({}, ["mi", "mo", "mn", "ms", "mtext"]), re = s({}, ["annotation-xml"]);
  const vt = s({}, ["title", "style", "font", "a", "script"]);
  let X = null;
  const Ut = ["application/xhtml+xml", "text/html"], Ft = "text/html";
  let T = null, H = null;
  const Ht = l.createElement("form"), je = function(e) {
    return e instanceof RegExp || e instanceof Function;
  }, Oe = function() {
    let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    if (!(H && H === e)) {
      if ((!e || typeof e != "object") && (e = {}), e = w(e), X = // eslint-disable-next-line unicorn/prefer-includes
      Ut.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? Ft : e.PARSER_MEDIA_TYPE, T = X === "application/xhtml+xml" ? ye : ce, m = O(e, "ALLOWED_TAGS") ? s({}, e.ALLOWED_TAGS, T) : ke, p = O(e, "ALLOWED_ATTR") ? s({}, e.ALLOWED_ATTR, T) : ve, Le = O(e, "ALLOWED_NAMESPACES") ? s({}, e.ALLOWED_NAMESPACES, ye) : kt, Se = O(e, "ADD_URI_SAFE_ATTR") ? s(w(Xe), e.ADD_URI_SAFE_ATTR, T) : Xe, Be = O(e, "ADD_DATA_URI_TAGS") ? s(w(Ye), e.ADD_DATA_URI_TAGS, T) : Ye, U = O(e, "FORBID_CONTENTS") ? s({}, e.FORBID_CONTENTS, T) : We, B = O(e, "FORBID_TAGS") ? s({}, e.FORBID_TAGS, T) : {}, de = O(e, "FORBID_ATTR") ? s({}, e.FORBID_ATTR, T) : {}, v = O(e, "USE_PROFILES") ? e.USE_PROFILES : !1, Ue = e.ALLOW_ARIA_ATTR !== !1, _e = e.ALLOW_DATA_ATTR !== !1, Fe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, He = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, P = e.SAFE_FOR_TEMPLATES || !1, Ee = e.SAFE_FOR_XML !== !1, C = e.WHOLE_DOCUMENT || !1, k = e.RETURN_DOM || !1, ee = e.RETURN_DOM_FRAGMENT || !1, te = e.RETURN_TRUSTED_TYPE || !1, he = e.FORCE_BODY || !1, ze = e.SANITIZE_DOM !== !1, Ge = e.SANITIZE_NAMED_PROPS || !1, Ae = e.KEEP_CONTENT !== !1, Y = e.IN_PLACE || !1, Pe = e.ALLOWED_URI_REGEXP || _t, F = e.NAMESPACE || I, ie = e.MATHML_TEXT_INTEGRATION_POINTS || ie, re = e.HTML_INTEGRATION_POINTS || re, u = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && je(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (u.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && je(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), P && (_e = !1), ee && (k = !0), v && (m = s({}, ct), p = [], v.html === !0 && (s(m, lt), s(p, ft)), v.svg === !0 && (s(m, Ne), s(p, Ie), s(p, le)), v.svgFilters === !0 && (s(m, be), s(p, Ie), s(p, le)), v.mathMl === !0 && (s(m, De), s(p, ut), s(p, le))), e.ADD_TAGS && (m === ke && (m = w(m)), s(m, e.ADD_TAGS, T)), e.ADD_ATTR && (p === ve && (p = w(p)), s(p, e.ADD_ATTR, T)), e.ADD_URI_SAFE_ATTR && s(Se, e.ADD_URI_SAFE_ATTR, T), e.FORBID_CONTENTS && (U === We && (U = w(U)), s(U, e.FORBID_CONTENTS, T)), Ae && (m["#text"] = !0), C && s(m, ["html", "head", "body"]), m.table && (s(m, ["tbody"]), delete B.tbody), e.TRUSTED_TYPES_POLICY) {
        if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
          throw q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
        if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
          throw q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
        E = e.TRUSTED_TYPES_POLICY, W = E.createHTML("");
      } else
        E === void 0 && (E = un(J, c)), E !== null && typeof W == "string" && (W = E.createHTML(""));
      A && A(e), H = e;
    }
  }, Ve = s({}, [...Ne, ...be, ...Qt]), $e = s({}, [...De, ...en]), zt = function(e) {
    let t = Q(e);
    (!t || !t.tagName) && (t = {
      namespaceURI: F,
      tagName: "template"
    });
    const o = ce(e.tagName), f = ce(t.tagName);
    return Le[e.namespaceURI] ? e.namespaceURI === oe ? t.namespaceURI === I ? o === "svg" : t.namespaceURI === ne ? o === "svg" && (f === "annotation-xml" || ie[f]) : !!Ve[o] : e.namespaceURI === ne ? t.namespaceURI === I ? o === "math" : t.namespaceURI === oe ? o === "math" && re[f] : !!$e[o] : e.namespaceURI === I ? t.namespaceURI === oe && !re[f] || t.namespaceURI === ne && !ie[f] ? !1 : !$e[o] && (vt[o] || !Ve[o]) : !!(X === "application/xhtml+xml" && Le[e.namespaceURI]) : !1;
  }, N = function(e) {
    V(n.removed, {
      element: e
    });
    try {
      Q(e).removeChild(e);
    } catch {
      Lt(e);
    }
  }, ae = function(e, t) {
    try {
      V(n.removed, {
        attribute: t.getAttributeNode(e),
        from: t
      });
    } catch {
      V(n.removed, {
        attribute: null,
        from: t
      });
    }
    if (t.removeAttribute(e), e === "is" && !p[e])
      if (k || ee)
        try {
          N(t);
        } catch {
        }
      else
        try {
          t.setAttribute(e, "");
        } catch {
        }
  }, qe = function(e) {
    let t = null, o = null;
    if (he)
      e = "<remove></remove>" + e;
    else {
      const d = st(e, /^[\r\n\t ]+/);
      o = d && d[0];
    }
    X === "application/xhtml+xml" && F === I && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
    const f = E ? E.createHTML(e) : e;
    if (F === I)
      try {
        t = new St().parseFromString(f, X);
      } catch {
      }
    if (!t || !t.documentElement) {
      t = ue.createDocument(F, "template", null);
      try {
        t.documentElement.innerHTML = Re ? W : f;
      } catch {
      }
    }
    const _ = t.body || t.documentElement;
    return e && o && _.insertBefore(l.createTextNode(o), _.childNodes[0] || null), F === I ? Dt.call(t, C ? "html" : "body")[0] : C ? t.documentElement : _;
  }, Ke = function(e) {
    return Nt.call(
      e.ownerDocument || e,
      e,
      // eslint-disable-next-line no-bitwise
      z.SHOW_ELEMENT | z.SHOW_COMMENT | z.SHOW_TEXT | z.SHOW_PROCESSING_INSTRUCTION | z.SHOW_CDATA_SECTION,
      null
    );
  }, Ze = function(e) {
    return e instanceof At && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof ht) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
  }, Je = function(e) {
    return typeof fe == "function" && e instanceof fe;
  };
  function M(i, e, t) {
    y[i] && se(y[i], (o) => {
      o.call(n, e, t, H);
    });
  }
  const Qe = function(e) {
    let t = null;
    if (M("beforeSanitizeElements", e, null), Ze(e))
      return N(e), !0;
    const o = T(e.nodeName);
    if (M("uponSanitizeElement", e, {
      tagName: o,
      allowedTags: m
    }), e.hasChildNodes() && !Je(e.firstElementChild) && h(/<[/\w]/g, e.innerHTML) && h(/<[/\w]/g, e.textContent) || e.nodeType === Z.progressingInstruction || Ee && e.nodeType === Z.comment && h(/<[/\w]/g, e.data))
      return N(e), !0;
    if (!m[o] || B[o]) {
      if (!B[o] && tt(o) && (u.tagNameCheck instanceof RegExp && h(u.tagNameCheck, o) || u.tagNameCheck instanceof Function && u.tagNameCheck(o)))
        return !1;
      if (Ae && !U[o]) {
        const f = Q(e) || e.parentNode, _ = yt(e) || e.childNodes;
        if (_ && f) {
          const d = _.length;
          for (let S = d - 1; S >= 0; --S) {
            const b = Rt(_[S], !0);
            b.__removalCount = (e.__removalCount || 0) + 1, f.insertBefore(b, Ot(e));
          }
        }
      }
      return N(e), !0;
    }
    return e instanceof we && !zt(e) || (o === "noscript" || o === "noembed" || o === "noframes") && h(/<\/no(script|embed|frames)/i, e.innerHTML) ? (N(e), !0) : (P && e.nodeType === Z.text && (t = e.textContent, se([me, pe, Te], (f) => {
      t = $(t, f, " ");
    }), e.textContent !== t && (V(n.removed, {
      element: e.cloneNode()
    }), e.textContent = t)), M("afterSanitizeElements", e, null), !1);
  }, et = function(e, t, o) {
    if (ze && (t === "id" || t === "name") && (o in l || o in Ht))
      return !1;
    if (!(_e && !de[t] && h(Mt, t))) {
      if (!(Ue && h(Ct, t))) {
        if (!p[t] || de[t]) {
          if (
            // First condition does a very basic check if a) it's basically a valid custom element tagname AND
            // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
            // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
            !(tt(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)) || // Alternative, second condition checks if it's an `is`-attribute, AND
            // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
            t === "is" && u.allowCustomizedBuiltInElements && (u.tagNameCheck instanceof RegExp && h(u.tagNameCheck, o) || u.tagNameCheck instanceof Function && u.tagNameCheck(o)))
          ) return !1;
        } else if (!Se[t]) {
          if (!h(Pe, $(o, xe, ""))) {
            if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && qt(o, "data:") === 0 && Be[e])) {
              if (!(Fe && !h(wt, $(o, xe, "")))) {
                if (o)
                  return !1;
              }
            }
          }
        }
      }
    }
    return !0;
  }, tt = function(e) {
    return e !== "annotation-xml" && st(e, xt);
  }, nt = function(e) {
    M("beforeSanitizeAttributes", e, null);
    const {
      attributes: t
    } = e;
    if (!t)
      return;
    const o = {
      attrName: "",
      attrValue: "",
      keepAttr: !0,
      allowedAttributes: p,
      forceKeepAttr: void 0
    };
    let f = t.length;
    for (; f--; ) {
      const _ = t[f], {
        name: d,
        namespaceURI: S,
        value: b
      } = _, j = T(d);
      let g = d === "value" ? b : Kt(b);
      if (o.attrName = j, o.attrValue = g, o.keepAttr = !0, o.forceKeepAttr = void 0, M("uponSanitizeAttribute", e, o), g = o.attrValue, Ge && (j === "id" || j === "name") && (ae(d, e), g = Pt + g), Ee && h(/((--!?|])>)|<\/(style|title)/i, g)) {
        ae(d, e);
        continue;
      }
      if (o.forceKeepAttr || (ae(d, e), !o.keepAttr))
        continue;
      if (!He && h(/\/>/i, g)) {
        ae(d, e);
        continue;
      }
      P && se([me, pe, Te], (it) => {
        g = $(g, it, " ");
      });
      const ot = T(e.nodeName);
      if (et(ot, j, g)) {
        if (E && typeof J == "object" && typeof J.getAttributeType == "function" && !S)
          switch (J.getAttributeType(ot, j)) {
            case "TrustedHTML": {
              g = E.createHTML(g);
              break;
            }
            case "TrustedScriptURL": {
              g = E.createScriptURL(g);
              break;
            }
          }
        try {
          S ? e.setAttributeNS(S, d, g) : e.setAttribute(d, g), Ze(e) ? N(e) : at(n.removed);
        } catch {
        }
      }
    }
    M("afterSanitizeAttributes", e, null);
  }, Gt = function i(e) {
    let t = null;
    const o = Ke(e);
    for (M("beforeSanitizeShadowDOM", e, null); t = o.nextNode(); )
      M("uponSanitizeShadowNode", t, null), !Qe(t) && (t.content instanceof D && i(t.content), nt(t));
    M("afterSanitizeShadowDOM", e, null);
  };
  return n.sanitize = function(i) {
    let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = null, o = null, f = null, _ = null;
    if (Re = !i, Re && (i = "<!-->"), typeof i != "string" && !Je(i))
      if (typeof i.toString == "function") {
        if (i = i.toString(), typeof i != "string")
          throw q("dirty is not a string, aborting");
      } else
        throw q("toString is not a function");
    if (!n.isSupported)
      return i;
    if (ge || Oe(e), n.removed = [], typeof i == "string" && (Y = !1), Y) {
      if (i.nodeName) {
        const b = T(i.nodeName);
        if (!m[b] || B[b])
          throw q("root node is forbidden and cannot be sanitized in-place");
      }
    } else if (i instanceof fe)
      t = qe("<!---->"), o = t.ownerDocument.importNode(i, !0), o.nodeType === Z.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? t = o : t.appendChild(o);
    else {
      if (!k && !P && !C && // eslint-disable-next-line unicorn/prefer-includes
      i.indexOf("<") === -1)
        return E && te ? E.createHTML(i) : i;
      if (t = qe(i), !t)
        return k ? null : te ? W : "";
    }
    t && he && N(t.firstChild);
    const d = Ke(Y ? i : t);
    for (; f = d.nextNode(); )
      Qe(f) || (f.content instanceof D && Gt(f.content), nt(f));
    if (Y)
      return i;
    if (k) {
      if (ee)
        for (_ = bt.call(t.ownerDocument); t.firstChild; )
          _.appendChild(t.firstChild);
      else
        _ = t;
      return (p.shadowroot || p.shadowrootmode) && (_ = It.call(a, _, !0)), _;
    }
    let S = C ? t.outerHTML : t.innerHTML;
    return C && m["!doctype"] && t.ownerDocument && t.ownerDocument.doctype && t.ownerDocument.doctype.name && h(Et, t.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + t.ownerDocument.doctype.name + `>
` + S), P && se([me, pe, Te], (b) => {
      S = $(S, b, " ");
    }), E && te ? E.createHTML(S) : S;
  }, n.setConfig = function() {
    let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    Oe(i), ge = !0;
  }, n.clearConfig = function() {
    H = null, ge = !1;
  }, n.isValidAttribute = function(i, e, t) {
    H || Oe({});
    const o = T(i), f = T(e);
    return et(o, f, t);
  }, n.addHook = function(i, e) {
    typeof e == "function" && (y[i] = y[i] || [], V(y[i], e));
  }, n.removeHook = function(i) {
    if (y[i])
      return at(y[i]);
  }, n.removeHooks = function(i) {
    y[i] && (y[i] = []);
  }, n.removeAllHooks = function() {
    y = {};
  }, n;
}
var pt = gt();
const mn = "creator_html_oVkdm", pn = { html: mn }, _n = ({ html: r }) => {
  const [n, l] = Bt(!1);
  Yt(() => {
    n || (pt.addHook("afterSanitizeAttributes", (c) => {
      c instanceof Element && ("target" in c && (c.setAttribute("target", "_blank"), c.setAttribute("rel", "noopener noreferrer")), !c.hasAttribute("target") && (c.hasAttribute("xlink:href") || c.hasAttribute("href")) && c.setAttribute("xlink:show", "new"));
    }), l(!0));
  }, [n]);
  const a = Xt(() => n ? pt.sanitize(r, {
    ALLOWED_TAGS: [
      "p",
      "strong",
      "em",
      "u",
      "ul",
      "ol",
      "li",
      "a",
      "s",
      "span"
    ],
    ALLOWED_URI_REGEXP: /^https?:\/\//
  }) : "", [r, n]);
  return /* @__PURE__ */ Wt(
    "div",
    {
      className: pn.html,
      dangerouslySetInnerHTML: { __html: a }
    }
  );
};
export {
  _n as S
};
