@editora/plugins 1.0.17 → 1.0.18

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 (100) hide show
  1. package/dist/{CodePlugin.native-Cqi46sxh.js → CodePlugin.native-Bwf25lLX.js} +6 -6
  2. package/dist/{CodePlugin.native-CmnEFfJi.mjs → CodePlugin.native-Cpp4u3Jl.mjs} +23 -21
  3. package/dist/a11y-checker.cjs.js +16 -16
  4. package/dist/a11y-checker.esm.js +79 -75
  5. package/dist/anchor.cjs.js +9 -9
  6. package/dist/anchor.esm.js +61 -60
  7. package/dist/anchoredPopover-Bg-ey7Yo.js +1 -0
  8. package/dist/anchoredPopover-D_JbjvdA.mjs +111 -0
  9. package/dist/approval-workflow.cjs.js +5 -5
  10. package/dist/approval-workflow.esm.js +105 -104
  11. package/dist/background-color.cjs.js +1 -1
  12. package/dist/background-color.esm.js +1 -1
  13. package/dist/blocks-library.cjs.js +6 -6
  14. package/dist/blocks-library.esm.js +226 -202
  15. package/dist/capitalization.cjs.js +1 -1
  16. package/dist/capitalization.esm.js +9 -4
  17. package/dist/checklist.cjs.js +1 -1
  18. package/dist/checklist.esm.js +154 -116
  19. package/dist/citations.cjs.js +43 -18
  20. package/dist/citations.esm.js +465 -446
  21. package/dist/clear-formatting.cjs.js +1 -1
  22. package/dist/clear-formatting.esm.js +21 -20
  23. package/dist/code-sample.cjs.js +85 -66
  24. package/dist/code-sample.esm.js +301 -190
  25. package/dist/code.cjs.js +1 -1
  26. package/dist/code.esm.js +1 -1
  27. package/dist/collaboration.cjs.js +68 -0
  28. package/dist/collaboration.esm.js +7428 -0
  29. package/dist/comments.cjs.js +11 -11
  30. package/dist/comments.esm.js +284 -237
  31. package/dist/conditional-content.cjs.js +67 -60
  32. package/dist/conditional-content.esm.js +270 -220
  33. package/dist/data-binding.cjs.js +3 -3
  34. package/dist/data-binding.esm.js +28 -27
  35. package/dist/dialogHelpers-5d5BuOCW.mjs +39 -0
  36. package/dist/dialogHelpers-zU6zpMIA.js +12 -0
  37. package/dist/document-manager.cjs.js +1 -1
  38. package/dist/document-manager.esm.js +1 -1
  39. package/dist/{documentManager-3nPkITwx.js → documentManager-BDz6tovy.js} +1 -1
  40. package/dist/{documentManager-CRumGpCT.mjs → documentManager-yjRBab4v.mjs} +1 -1
  41. package/dist/embed-iframe.cjs.js +37 -17
  42. package/dist/embed-iframe.esm.js +188 -143
  43. package/dist/emojis.cjs.js +13 -10
  44. package/dist/emojis.esm.js +288 -76
  45. package/dist/enterprise.cjs.js +1 -1
  46. package/dist/enterprise.esm.js +9 -7
  47. package/dist/escapeHtml-D2Zh82pD.js +1 -0
  48. package/dist/escapeHtml-DyksyvcZ.mjs +6 -0
  49. package/dist/font-family.cjs.js +1 -1
  50. package/dist/font-family.esm.js +48 -41
  51. package/dist/font-size.cjs.js +1 -1
  52. package/dist/font-size.esm.js +67 -60
  53. package/dist/format-painter.cjs.js +1 -1
  54. package/dist/format-painter.esm.js +2 -1
  55. package/dist/history.cjs.js +1 -1
  56. package/dist/history.esm.js +40 -36
  57. package/dist/historyHelpers-BEKwNOtA.mjs +14 -0
  58. package/dist/historyHelpers-Cu8Pk7m1.js +1 -0
  59. package/dist/index-Bm1eqYHh.mjs +194 -0
  60. package/dist/index-CoflqYuK.js +30 -0
  61. package/dist/index.cjs.js +1 -1
  62. package/dist/index.esm.js +17 -15
  63. package/dist/link.cjs.js +17 -13
  64. package/dist/link.esm.js +138 -69
  65. package/dist/list.cjs.js +1 -1
  66. package/dist/list.esm.js +66 -33
  67. package/dist/math.cjs.js +22 -22
  68. package/dist/math.esm.js +221 -126
  69. package/dist/media-manager.cjs.js +12 -12
  70. package/dist/media-manager.esm.js +55 -50
  71. package/dist/mentions.cjs.js +2 -2
  72. package/dist/mentions.esm.js +17 -12
  73. package/dist/merge-tag.cjs.js +2 -2
  74. package/dist/merge-tag.esm.js +43 -42
  75. package/dist/plugins.css +1 -1
  76. package/dist/preview.cjs.js +3 -3
  77. package/dist/preview.esm.js +30 -27
  78. package/dist/slash-commands.cjs.js +13 -7
  79. package/dist/slash-commands.esm.js +90 -79
  80. package/dist/smart-paste.cjs.js +5 -5
  81. package/dist/smart-paste.esm.js +85 -81
  82. package/dist/special-characters.cjs.js +6 -3
  83. package/dist/special-characters.esm.js +72 -25
  84. package/dist/spell-check.cjs.js +8 -8
  85. package/dist/spell-check.esm.js +10189 -295
  86. package/dist/table.cjs.js +166 -13
  87. package/dist/table.esm.js +543 -266
  88. package/dist/template.cjs.js +11 -11
  89. package/dist/template.esm.js +290 -264
  90. package/dist/text-color.cjs.js +1 -1
  91. package/dist/text-color.esm.js +1 -1
  92. package/dist/translation-workflow.cjs.js +4 -4
  93. package/dist/translation-workflow.esm.js +33 -31
  94. package/dist/version-diff.cjs.js +6 -6
  95. package/dist/version-diff.esm.js +40 -40
  96. package/package.json +11 -5
  97. package/dist/anchoredPopover-BzqGPOAE.js +0 -1
  98. package/dist/anchoredPopover-Dts0IrgU.mjs +0 -106
  99. package/dist/index-CJ90EVWy.mjs +0 -145
  100. package/dist/index-DTkvH8gX.js +0 -1
@@ -1,13 +1,15 @@
1
+ import { e as hn } from "./escapeHtml-DyksyvcZ.mjs";
2
+ import { i as Tn } from "./dialogHelpers-5d5BuOCW.mjs";
1
3
  const {
2
- entries: Ht,
3
- setPrototypeOf: wt,
4
- isFrozen: gn,
5
- getPrototypeOf: hn,
6
- getOwnPropertyDescriptor: Tn
4
+ entries: Ut,
5
+ setPrototypeOf: Ct,
6
+ isFrozen: bn,
7
+ getPrototypeOf: En,
8
+ getOwnPropertyDescriptor: An
7
9
  } = Object;
8
10
  let {
9
11
  freeze: R,
10
- seal: O,
12
+ seal: N,
11
13
  create: De
12
14
  } = Object, {
13
15
  apply: et,
@@ -16,12 +18,12 @@ let {
16
18
  R || (R = function(t) {
17
19
  return t;
18
20
  });
19
- O || (O = function(t) {
21
+ N || (N = function(t) {
20
22
  return t;
21
23
  });
22
24
  et || (et = function(t, o) {
23
- for (var l = arguments.length, c = new Array(l > 2 ? l - 2 : 0), f = 2; f < l; f++)
24
- c[f - 2] = arguments[f];
25
+ for (var l = arguments.length, c = new Array(l > 2 ? l - 2 : 0), d = 2; d < l; d++)
26
+ c[d - 2] = arguments[d];
25
27
  return t.apply(o, c);
26
28
  });
27
29
  tt || (tt = function(t) {
@@ -29,7 +31,7 @@ tt || (tt = function(t) {
29
31
  l[c - 1] = arguments[c];
30
32
  return new t(...l);
31
33
  });
32
- const Re = L(Array.prototype.forEach), bn = L(Array.prototype.lastIndexOf), Ct = L(Array.prototype.pop), se = L(Array.prototype.push), En = L(Array.prototype.splice), we = L(String.prototype.toLowerCase), $e = L(String.prototype.toString), qe = L(String.prototype.match), ce = L(String.prototype.replace), An = L(String.prototype.indexOf), _n = L(String.prototype.trim), C = L(Object.prototype.hasOwnProperty), x = L(RegExp.prototype.test), ue = yn(TypeError);
34
+ const Re = L(Array.prototype.forEach), _n = L(Array.prototype.lastIndexOf), wt = L(Array.prototype.pop), se = L(Array.prototype.push), yn = L(Array.prototype.splice), Ce = L(String.prototype.toLowerCase), $e = L(String.prototype.toString), qe = L(String.prototype.match), ce = L(String.prototype.replace), vn = L(String.prototype.indexOf), Sn = L(String.prototype.trim), C = L(Object.prototype.hasOwnProperty), x = L(RegExp.prototype.test), ue = xn(TypeError);
33
35
  function L(n) {
34
36
  return function(t) {
35
37
  t instanceof RegExp && (t.lastIndex = 0);
@@ -38,7 +40,7 @@ function L(n) {
38
40
  return et(n, t, l);
39
41
  };
40
42
  }
41
- function yn(n) {
43
+ function xn(n) {
42
44
  return function() {
43
45
  for (var t = arguments.length, o = new Array(t), l = 0; l < t; l++)
44
46
  o[l] = arguments[l];
@@ -46,65 +48,65 @@ function yn(n) {
46
48
  };
47
49
  }
48
50
  function s(n, t) {
49
- let o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : we;
50
- wt && wt(n, null);
51
+ let o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Ce;
52
+ Ct && Ct(n, null);
51
53
  let l = t.length;
52
54
  for (; l--; ) {
53
55
  let c = t[l];
54
56
  if (typeof c == "string") {
55
- const f = o(c);
56
- f !== c && (gn(t) || (t[l] = f), c = f);
57
+ const d = o(c);
58
+ d !== c && (bn(t) || (t[l] = d), c = d);
57
59
  }
58
60
  n[c] = !0;
59
61
  }
60
62
  return n;
61
63
  }
62
- function vn(n) {
64
+ function Rn(n) {
63
65
  for (let t = 0; t < n.length; t++)
64
66
  C(n, t) || (n[t] = null);
65
67
  return n;
66
68
  }
67
- function I(n) {
69
+ function k(n) {
68
70
  const t = De(null);
69
- for (const [o, l] of Ht(n))
70
- C(n, o) && (Array.isArray(l) ? t[o] = vn(l) : l && typeof l == "object" && l.constructor === Object ? t[o] = I(l) : t[o] = l);
71
+ for (const [o, l] of Ut(n))
72
+ C(n, o) && (Array.isArray(l) ? t[o] = Rn(l) : l && typeof l == "object" && l.constructor === Object ? t[o] = k(l) : t[o] = l);
71
73
  return t;
72
74
  }
73
75
  function pe(n, t) {
74
76
  for (; n !== null; ) {
75
- const l = Tn(n, t);
77
+ const l = An(n, t);
76
78
  if (l) {
77
79
  if (l.get)
78
80
  return L(l.get);
79
81
  if (typeof l.value == "function")
80
82
  return L(l.value);
81
83
  }
82
- n = hn(n);
84
+ n = En(n);
83
85
  }
84
86
  function o() {
85
87
  return null;
86
88
  }
87
89
  return o;
88
90
  }
89
- const Ot = R(["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"]), Xe = R(["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"]), Ze = R(["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"]), Sn = R(["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"]), Ke = R(["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"]), xn = R(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Mt = R(["#text"]), Nt = R(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), Qe = R(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), It = R(["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 = R(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Rn = O(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Ln = O(/<%[\w\W]*|[\w\W]*%>/gm), Dn = O(/\$\{[\w\W]*/gm), wn = O(/^data-[\-\w.\u00B7-\uFFFF]+$/), Cn = O(/^aria-[\-\w]+$/), Ut = O(
91
+ const Ot = R(["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"]), Xe = R(["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"]), Ke = R(["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"]), Ln = R(["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"]), Ze = R(["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"]), Dn = R(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Nt = R(["#text"]), Mt = R(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), Qe = R(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), It = R(["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 = R(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Cn = N(/\{\{[\w\W]*|[\w\W]*\}\}/gm), wn = N(/<%[\w\W]*|[\w\W]*%>/gm), On = N(/\$\{[\w\W]*/gm), Nn = N(/^data-[\-\w.\u00B7-\uFFFF]+$/), Mn = N(/^aria-[\-\w]+$/), zt = N(
90
92
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
91
93
  // eslint-disable-line no-useless-escape
92
- ), On = O(/^(?:\w+script|data):/i), Mn = O(
94
+ ), In = N(/^(?:\w+script|data):/i), kn = N(
93
95
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
94
96
  // eslint-disable-line no-control-regex
95
- ), zt = O(/^html$/i), Nn = O(/^[a-z][.\w]*(-[.\w]+)+$/i);
97
+ ), Bt = N(/^html$/i), Pn = N(/^[a-z][.\w]*(-[.\w]+)+$/i);
96
98
  var kt = /* @__PURE__ */ Object.freeze({
97
99
  __proto__: null,
98
- ARIA_ATTR: Cn,
99
- ATTR_WHITESPACE: Mn,
100
- CUSTOM_ELEMENT: Nn,
101
- DATA_ATTR: wn,
102
- DOCTYPE_NAME: zt,
103
- ERB_EXPR: Ln,
104
- IS_ALLOWED_URI: Ut,
105
- IS_SCRIPT_OR_DATA: On,
106
- MUSTACHE_EXPR: Rn,
107
- TMPLIT_EXPR: Dn
100
+ ARIA_ATTR: Mn,
101
+ ATTR_WHITESPACE: kn,
102
+ CUSTOM_ELEMENT: Pn,
103
+ DATA_ATTR: Nn,
104
+ DOCTYPE_NAME: Bt,
105
+ ERB_EXPR: wn,
106
+ IS_ALLOWED_URI: zt,
107
+ IS_SCRIPT_OR_DATA: In,
108
+ MUSTACHE_EXPR: Cn,
109
+ TMPLIT_EXPR: On
108
110
  });
109
111
  const de = {
110
112
  element: 1,
@@ -113,17 +115,17 @@ const de = {
113
115
  progressingInstruction: 7,
114
116
  comment: 8,
115
117
  document: 9
116
- }, In = function() {
118
+ }, Hn = function() {
117
119
  return typeof window > "u" ? null : window;
118
- }, kn = function(t, o) {
120
+ }, Fn = function(t, o) {
119
121
  if (typeof t != "object" || typeof t.createPolicy != "function")
120
122
  return null;
121
123
  let l = null;
122
124
  const c = "data-tt-policy-suffix";
123
125
  o && o.hasAttribute(c) && (l = o.getAttribute(c));
124
- const f = "dompurify" + (l ? "#" + l : "");
126
+ const d = "dompurify" + (l ? "#" + l : "");
125
127
  try {
126
- return t.createPolicy(f, {
128
+ return t.createPolicy(d, {
127
129
  createHTML(w) {
128
130
  return w;
129
131
  },
@@ -132,7 +134,7 @@ const de = {
132
134
  }
133
135
  });
134
136
  } catch {
135
- return console.warn("TrustedTypes policy " + f + " could not be created."), null;
137
+ return console.warn("TrustedTypes policy " + d + " could not be created."), null;
136
138
  }
137
139
  }, Pt = function() {
138
140
  return {
@@ -147,57 +149,57 @@ const de = {
147
149
  uponSanitizeShadowNode: []
148
150
  };
149
151
  };
150
- function Bt() {
151
- let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : In();
152
- const t = (i) => Bt(i);
152
+ function Gt() {
153
+ let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Hn();
154
+ const t = (i) => Gt(i);
153
155
  if (t.version = "3.3.2", t.removed = [], !n || !n.document || n.document.nodeType !== de.document || !n.Element)
154
156
  return t.isSupported = !1, t;
155
157
  let {
156
158
  document: o
157
159
  } = n;
158
160
  const l = o, c = l.currentScript, {
159
- DocumentFragment: f,
161
+ DocumentFragment: d,
160
162
  HTMLTemplateElement: w,
161
- Node: z,
162
- Element: b,
163
- NodeFilter: E,
163
+ Node: H,
164
+ Element: p,
165
+ NodeFilter: m,
164
166
  NamedNodeMap: W = n.NamedNodeMap || n.MozNamedAttrMap,
165
- HTMLFormElement: j,
167
+ HTMLFormElement: V,
166
168
  DOMParser: Oe,
167
169
  trustedTypes: he
168
- } = n, re = b.prototype, qt = pe(re, "cloneNode"), Xt = pe(re, "remove"), Zt = pe(re, "nextSibling"), Kt = pe(re, "childNodes"), Te = pe(re, "parentNode");
170
+ } = n, re = p.prototype, Xt = pe(re, "cloneNode"), Kt = pe(re, "remove"), Zt = pe(re, "nextSibling"), Qt = pe(re, "childNodes"), Te = pe(re, "parentNode");
169
171
  if (typeof w == "function") {
170
172
  const i = o.createElement("template");
171
173
  i.content && i.content.ownerDocument && (o = i.content.ownerDocument);
172
174
  }
173
175
  let v, oe = "";
174
176
  const {
175
- implementation: Me,
176
- createNodeIterator: Qt,
177
- createDocumentFragment: Jt,
178
- getElementsByTagName: en
177
+ implementation: Ne,
178
+ createNodeIterator: Jt,
179
+ createDocumentFragment: en,
180
+ getElementsByTagName: tn
179
181
  } = o, {
180
- importNode: tn
182
+ importNode: nn
181
183
  } = l;
182
184
  let S = Pt();
183
- t.isSupported = typeof Ht == "function" && typeof Te == "function" && Me && Me.createHTMLDocument !== void 0;
185
+ t.isSupported = typeof Ut == "function" && typeof Te == "function" && Ne && Ne.createHTMLDocument !== void 0;
184
186
  const {
185
- MUSTACHE_EXPR: Ne,
187
+ MUSTACHE_EXPR: Me,
186
188
  ERB_EXPR: Ie,
187
189
  TMPLIT_EXPR: ke,
188
- DATA_ATTR: nn,
189
- ARIA_ATTR: rn,
190
- IS_SCRIPT_OR_DATA: on,
190
+ DATA_ATTR: rn,
191
+ ARIA_ATTR: on,
192
+ IS_SCRIPT_OR_DATA: an,
191
193
  ATTR_WHITESPACE: at,
192
- CUSTOM_ELEMENT: an
194
+ CUSTOM_ELEMENT: ln
193
195
  } = kt;
194
196
  let {
195
197
  IS_ALLOWED_URI: it
196
- } = kt, h = null;
197
- const lt = s({}, [...Ot, ...Xe, ...Ze, ...Ke, ...Mt]);
198
+ } = kt, b = null;
199
+ const lt = s({}, [...Ot, ...Xe, ...Ke, ...Ze, ...Nt]);
198
200
  let A = null;
199
- const st = s({}, [...Nt, ...Qe, ...It, ...Le]);
200
- let p = Object.seal(De(null, {
201
+ const st = s({}, [...Mt, ...Qe, ...It, ...Le]);
202
+ let f = Object.seal(De(null, {
201
203
  tagNameCheck: {
202
204
  writable: !0,
203
205
  configurable: !1,
@@ -217,7 +219,7 @@ function Bt() {
217
219
  value: !1
218
220
  }
219
221
  })), ae = null, be = null;
220
- const B = Object.seal(De(null, {
222
+ const G = Object.seal(De(null, {
221
223
  tagCheck: {
222
224
  writable: !0,
223
225
  configurable: !1,
@@ -231,53 +233,53 @@ function Bt() {
231
233
  value: null
232
234
  }
233
235
  }));
234
- let ct = !0, Pe = !0, ut = !1, pt = !0, $ = !1, Ee = !0, V = !1, Fe = !1, He = !1, q = !1, Ae = !1, _e = !1, dt = !0, mt = !1;
235
- const ln = "user-content-";
236
+ let ct = !0, Pe = !0, ut = !1, pt = !0, $ = !1, Ee = !0, j = !1, He = !1, Fe = !1, q = !1, Ae = !1, _e = !1, dt = !0, mt = !1;
237
+ const sn = "user-content-";
236
238
  let Ue = !0, ie = !1, X = {}, M = null;
237
239
  const ze = 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"]);
238
240
  let ft = null;
239
241
  const gt = s({}, ["audio", "video", "img", "source", "image", "track"]);
240
242
  let Be = null;
241
243
  const ht = s({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ye = "http://www.w3.org/1998/Math/MathML", ve = "http://www.w3.org/2000/svg", F = "http://www.w3.org/1999/xhtml";
242
- let Z = F, Ge = !1, We = null;
243
- const sn = s({}, [ye, ve, F], $e);
244
+ let K = F, Ge = !1, We = null;
245
+ const cn = s({}, [ye, ve, F], $e);
244
246
  let Se = s({}, ["mi", "mo", "mn", "ms", "mtext"]), xe = s({}, ["annotation-xml"]);
245
- const cn = s({}, ["title", "style", "font", "a", "script"]);
247
+ const un = s({}, ["title", "style", "font", "a", "script"]);
246
248
  let le = null;
247
- const un = ["application/xhtml+xml", "text/html"], pn = "text/html";
248
- let g = null, K = null;
249
- const dn = o.createElement("form"), Tt = function(e) {
249
+ const pn = ["application/xhtml+xml", "text/html"], dn = "text/html";
250
+ let T = null, Z = null;
251
+ const mn = o.createElement("form"), Tt = function(e) {
250
252
  return e instanceof RegExp || e instanceof Function;
251
- }, je = function() {
253
+ }, Ve = function() {
252
254
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
253
- if (!(K && K === e)) {
254
- if ((!e || typeof e != "object") && (e = {}), e = I(e), le = // eslint-disable-next-line unicorn/prefer-includes
255
- un.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? pn : e.PARSER_MEDIA_TYPE, g = le === "application/xhtml+xml" ? $e : we, h = C(e, "ALLOWED_TAGS") ? s({}, e.ALLOWED_TAGS, g) : lt, A = C(e, "ALLOWED_ATTR") ? s({}, e.ALLOWED_ATTR, g) : st, We = C(e, "ALLOWED_NAMESPACES") ? s({}, e.ALLOWED_NAMESPACES, $e) : sn, Be = C(e, "ADD_URI_SAFE_ATTR") ? s(I(ht), e.ADD_URI_SAFE_ATTR, g) : ht, ft = C(e, "ADD_DATA_URI_TAGS") ? s(I(gt), e.ADD_DATA_URI_TAGS, g) : gt, M = C(e, "FORBID_CONTENTS") ? s({}, e.FORBID_CONTENTS, g) : ze, ae = C(e, "FORBID_TAGS") ? s({}, e.FORBID_TAGS, g) : I({}), be = C(e, "FORBID_ATTR") ? s({}, e.FORBID_ATTR, g) : I({}), X = C(e, "USE_PROFILES") ? e.USE_PROFILES : !1, ct = e.ALLOW_ARIA_ATTR !== !1, Pe = e.ALLOW_DATA_ATTR !== !1, ut = e.ALLOW_UNKNOWN_PROTOCOLS || !1, pt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, $ = e.SAFE_FOR_TEMPLATES || !1, Ee = e.SAFE_FOR_XML !== !1, V = e.WHOLE_DOCUMENT || !1, q = e.RETURN_DOM || !1, Ae = e.RETURN_DOM_FRAGMENT || !1, _e = e.RETURN_TRUSTED_TYPE || !1, He = e.FORCE_BODY || !1, dt = e.SANITIZE_DOM !== !1, mt = e.SANITIZE_NAMED_PROPS || !1, Ue = e.KEEP_CONTENT !== !1, ie = e.IN_PLACE || !1, it = e.ALLOWED_URI_REGEXP || Ut, Z = e.NAMESPACE || F, Se = e.MATHML_TEXT_INTEGRATION_POINTS || Se, xe = e.HTML_INTEGRATION_POINTS || xe, p = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && Tt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (p.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && Tt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (p.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (p.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), $ && (Pe = !1), Ae && (q = !0), X && (h = s({}, Mt), A = De(null), X.html === !0 && (s(h, Ot), s(A, Nt)), X.svg === !0 && (s(h, Xe), s(A, Qe), s(A, Le)), X.svgFilters === !0 && (s(h, Ze), s(A, Qe), s(A, Le)), X.mathMl === !0 && (s(h, Ke), s(A, It), s(A, Le))), C(e, "ADD_TAGS") || (B.tagCheck = null), C(e, "ADD_ATTR") || (B.attributeCheck = null), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? B.tagCheck = e.ADD_TAGS : (h === lt && (h = I(h)), s(h, e.ADD_TAGS, g))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? B.attributeCheck = e.ADD_ATTR : (A === st && (A = I(A)), s(A, e.ADD_ATTR, g))), e.ADD_URI_SAFE_ATTR && s(Be, e.ADD_URI_SAFE_ATTR, g), e.FORBID_CONTENTS && (M === ze && (M = I(M)), s(M, e.FORBID_CONTENTS, g)), e.ADD_FORBID_CONTENTS && (M === ze && (M = I(M)), s(M, e.ADD_FORBID_CONTENTS, g)), Ue && (h["#text"] = !0), V && s(h, ["html", "head", "body"]), h.table && (s(h, ["tbody"]), delete ae.tbody), e.TRUSTED_TYPES_POLICY) {
255
+ if (!(Z && Z === e)) {
256
+ if ((!e || typeof e != "object") && (e = {}), e = k(e), le = // eslint-disable-next-line unicorn/prefer-includes
257
+ pn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? dn : e.PARSER_MEDIA_TYPE, T = le === "application/xhtml+xml" ? $e : Ce, b = C(e, "ALLOWED_TAGS") ? s({}, e.ALLOWED_TAGS, T) : lt, A = C(e, "ALLOWED_ATTR") ? s({}, e.ALLOWED_ATTR, T) : st, We = C(e, "ALLOWED_NAMESPACES") ? s({}, e.ALLOWED_NAMESPACES, $e) : cn, Be = C(e, "ADD_URI_SAFE_ATTR") ? s(k(ht), e.ADD_URI_SAFE_ATTR, T) : ht, ft = C(e, "ADD_DATA_URI_TAGS") ? s(k(gt), e.ADD_DATA_URI_TAGS, T) : gt, M = C(e, "FORBID_CONTENTS") ? s({}, e.FORBID_CONTENTS, T) : ze, ae = C(e, "FORBID_TAGS") ? s({}, e.FORBID_TAGS, T) : k({}), be = C(e, "FORBID_ATTR") ? s({}, e.FORBID_ATTR, T) : k({}), X = C(e, "USE_PROFILES") ? e.USE_PROFILES : !1, ct = e.ALLOW_ARIA_ATTR !== !1, Pe = e.ALLOW_DATA_ATTR !== !1, ut = e.ALLOW_UNKNOWN_PROTOCOLS || !1, pt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, $ = e.SAFE_FOR_TEMPLATES || !1, Ee = e.SAFE_FOR_XML !== !1, j = e.WHOLE_DOCUMENT || !1, q = e.RETURN_DOM || !1, Ae = e.RETURN_DOM_FRAGMENT || !1, _e = e.RETURN_TRUSTED_TYPE || !1, Fe = e.FORCE_BODY || !1, dt = e.SANITIZE_DOM !== !1, mt = e.SANITIZE_NAMED_PROPS || !1, Ue = e.KEEP_CONTENT !== !1, ie = e.IN_PLACE || !1, it = e.ALLOWED_URI_REGEXP || zt, K = e.NAMESPACE || F, Se = e.MATHML_TEXT_INTEGRATION_POINTS || Se, xe = e.HTML_INTEGRATION_POINTS || xe, f = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && Tt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (f.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && Tt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (f.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (f.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), $ && (Pe = !1), Ae && (q = !0), X && (b = s({}, Nt), A = De(null), X.html === !0 && (s(b, Ot), s(A, Mt)), X.svg === !0 && (s(b, Xe), s(A, Qe), s(A, Le)), X.svgFilters === !0 && (s(b, Ke), s(A, Qe), s(A, Le)), X.mathMl === !0 && (s(b, Ze), s(A, It), s(A, Le))), C(e, "ADD_TAGS") || (G.tagCheck = null), C(e, "ADD_ATTR") || (G.attributeCheck = null), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? G.tagCheck = e.ADD_TAGS : (b === lt && (b = k(b)), s(b, e.ADD_TAGS, T))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? G.attributeCheck = e.ADD_ATTR : (A === st && (A = k(A)), s(A, e.ADD_ATTR, T))), e.ADD_URI_SAFE_ATTR && s(Be, e.ADD_URI_SAFE_ATTR, T), e.FORBID_CONTENTS && (M === ze && (M = k(M)), s(M, e.FORBID_CONTENTS, T)), e.ADD_FORBID_CONTENTS && (M === ze && (M = k(M)), s(M, e.ADD_FORBID_CONTENTS, T)), Ue && (b["#text"] = !0), j && s(b, ["html", "head", "body"]), b.table && (s(b, ["tbody"]), delete ae.tbody), e.TRUSTED_TYPES_POLICY) {
256
258
  if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
257
259
  throw ue('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
258
260
  if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
259
261
  throw ue('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
260
262
  v = e.TRUSTED_TYPES_POLICY, oe = v.createHTML("");
261
263
  } else
262
- v === void 0 && (v = kn(he, c)), v !== null && typeof oe == "string" && (oe = v.createHTML(""));
263
- R && R(e), K = e;
264
+ v === void 0 && (v = Fn(he, c)), v !== null && typeof oe == "string" && (oe = v.createHTML(""));
265
+ R && R(e), Z = e;
264
266
  }
265
- }, bt = s({}, [...Xe, ...Ze, ...Sn]), Et = s({}, [...Ke, ...xn]), mn = function(e) {
267
+ }, bt = s({}, [...Xe, ...Ke, ...Ln]), Et = s({}, [...Ze, ...Dn]), fn = function(e) {
266
268
  let r = Te(e);
267
269
  (!r || !r.tagName) && (r = {
268
- namespaceURI: Z,
270
+ namespaceURI: K,
269
271
  tagName: "template"
270
272
  });
271
- const a = we(e.tagName), u = we(r.tagName);
272
- return We[e.namespaceURI] ? e.namespaceURI === ve ? r.namespaceURI === F ? a === "svg" : r.namespaceURI === ye ? a === "svg" && (u === "annotation-xml" || Se[u]) : !!bt[a] : e.namespaceURI === ye ? r.namespaceURI === F ? a === "math" : r.namespaceURI === ve ? a === "math" && xe[u] : !!Et[a] : e.namespaceURI === F ? r.namespaceURI === ve && !xe[u] || r.namespaceURI === ye && !Se[u] ? !1 : !Et[a] && (cn[a] || !bt[a]) : !!(le === "application/xhtml+xml" && We[e.namespaceURI]) : !1;
273
- }, N = function(e) {
273
+ const a = Ce(e.tagName), u = Ce(r.tagName);
274
+ return We[e.namespaceURI] ? e.namespaceURI === ve ? r.namespaceURI === F ? a === "svg" : r.namespaceURI === ye ? a === "svg" && (u === "annotation-xml" || Se[u]) : !!bt[a] : e.namespaceURI === ye ? r.namespaceURI === F ? a === "math" : r.namespaceURI === ve ? a === "math" && xe[u] : !!Et[a] : e.namespaceURI === F ? r.namespaceURI === ve && !xe[u] || r.namespaceURI === ye && !Se[u] ? !1 : !Et[a] && (un[a] || !bt[a]) : !!(le === "application/xhtml+xml" && We[e.namespaceURI]) : !1;
275
+ }, I = function(e) {
274
276
  se(t.removed, {
275
277
  element: e
276
278
  });
277
279
  try {
278
280
  Te(e).removeChild(e);
279
281
  } catch {
280
- Xt(e);
282
+ Kt(e);
281
283
  }
282
284
  }, Y = function(e, r) {
283
285
  try {
@@ -294,7 +296,7 @@ function Bt() {
294
296
  if (r.removeAttribute(e), e === "is")
295
297
  if (q || Ae)
296
298
  try {
297
- N(r);
299
+ I(r);
298
300
  } catch {
299
301
  }
300
302
  else
@@ -304,95 +306,95 @@ function Bt() {
304
306
  }
305
307
  }, At = function(e) {
306
308
  let r = null, a = null;
307
- if (He)
309
+ if (Fe)
308
310
  e = "<remove></remove>" + e;
309
311
  else {
310
- const d = qe(e, /^[\r\n\t ]+/);
311
- a = d && d[0];
312
+ const g = qe(e, /^[\r\n\t ]+/);
313
+ a = g && g[0];
312
314
  }
313
- le === "application/xhtml+xml" && Z === F && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
315
+ le === "application/xhtml+xml" && K === F && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
314
316
  const u = v ? v.createHTML(e) : e;
315
- if (Z === F)
317
+ if (K === F)
316
318
  try {
317
319
  r = new Oe().parseFromString(u, le);
318
320
  } catch {
319
321
  }
320
322
  if (!r || !r.documentElement) {
321
- r = Me.createDocument(Z, "template", null);
323
+ r = Ne.createDocument(K, "template", null);
322
324
  try {
323
325
  r.documentElement.innerHTML = Ge ? oe : u;
324
326
  } catch {
325
327
  }
326
328
  }
327
329
  const y = r.body || r.documentElement;
328
- return e && a && y.insertBefore(o.createTextNode(a), y.childNodes[0] || null), Z === F ? en.call(r, V ? "html" : "body")[0] : V ? r.documentElement : y;
330
+ return e && a && y.insertBefore(o.createTextNode(a), y.childNodes[0] || null), K === F ? tn.call(r, j ? "html" : "body")[0] : j ? r.documentElement : y;
329
331
  }, _t = function(e) {
330
- return Qt.call(
332
+ return Jt.call(
331
333
  e.ownerDocument || e,
332
334
  e,
333
335
  // eslint-disable-next-line no-bitwise
334
- E.SHOW_ELEMENT | E.SHOW_COMMENT | E.SHOW_TEXT | E.SHOW_PROCESSING_INSTRUCTION | E.SHOW_CDATA_SECTION,
336
+ m.SHOW_ELEMENT | m.SHOW_COMMENT | m.SHOW_TEXT | m.SHOW_PROCESSING_INSTRUCTION | m.SHOW_CDATA_SECTION,
335
337
  null
336
338
  );
337
- }, Ve = function(e) {
338
- return e instanceof j && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof W) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
339
+ }, je = function(e) {
340
+ return e instanceof V && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof W) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
339
341
  }, yt = function(e) {
340
- return typeof z == "function" && e instanceof z;
342
+ return typeof H == "function" && e instanceof H;
341
343
  };
342
- function H(i, e, r) {
344
+ function U(i, e, r) {
343
345
  Re(i, (a) => {
344
- a.call(t, e, r, K);
346
+ a.call(t, e, r, Z);
345
347
  });
346
348
  }
347
349
  const vt = function(e) {
348
350
  let r = null;
349
- if (H(S.beforeSanitizeElements, e, null), Ve(e))
350
- return N(e), !0;
351
- const a = g(e.nodeName);
352
- if (H(S.uponSanitizeElement, e, {
351
+ if (U(S.beforeSanitizeElements, e, null), je(e))
352
+ return I(e), !0;
353
+ const a = T(e.nodeName);
354
+ if (U(S.uponSanitizeElement, e, {
353
355
  tagName: a,
354
- allowedTags: h
356
+ allowedTags: b
355
357
  }), Ee && e.hasChildNodes() && !yt(e.firstElementChild) && x(/<[/\w!]/g, e.innerHTML) && x(/<[/\w!]/g, e.textContent) || e.nodeType === de.progressingInstruction || Ee && e.nodeType === de.comment && x(/<[/\w]/g, e.data))
356
- return N(e), !0;
357
- if (!(B.tagCheck instanceof Function && B.tagCheck(a)) && (!h[a] || ae[a])) {
358
- if (!ae[a] && xt(a) && (p.tagNameCheck instanceof RegExp && x(p.tagNameCheck, a) || p.tagNameCheck instanceof Function && p.tagNameCheck(a)))
358
+ return I(e), !0;
359
+ if (!(G.tagCheck instanceof Function && G.tagCheck(a)) && (!b[a] || ae[a])) {
360
+ if (!ae[a] && xt(a) && (f.tagNameCheck instanceof RegExp && x(f.tagNameCheck, a) || f.tagNameCheck instanceof Function && f.tagNameCheck(a)))
359
361
  return !1;
360
362
  if (Ue && !M[a]) {
361
- const u = Te(e) || e.parentNode, y = Kt(e) || e.childNodes;
363
+ const u = Te(e) || e.parentNode, y = Qt(e) || e.childNodes;
362
364
  if (y && u) {
363
- const d = y.length;
364
- for (let D = d - 1; D >= 0; --D) {
365
- const U = qt(y[D], !0);
366
- U.__removalCount = (e.__removalCount || 0) + 1, u.insertBefore(U, Zt(e));
365
+ const g = y.length;
366
+ for (let D = g - 1; D >= 0; --D) {
367
+ const z = Xt(y[D], !0);
368
+ z.__removalCount = (e.__removalCount || 0) + 1, u.insertBefore(z, Zt(e));
367
369
  }
368
370
  }
369
371
  }
370
- return N(e), !0;
372
+ return I(e), !0;
371
373
  }
372
- return e instanceof b && !mn(e) || (a === "noscript" || a === "noembed" || a === "noframes") && x(/<\/no(script|embed|frames)/i, e.innerHTML) ? (N(e), !0) : ($ && e.nodeType === de.text && (r = e.textContent, Re([Ne, Ie, ke], (u) => {
374
+ return e instanceof p && !fn(e) || (a === "noscript" || a === "noembed" || a === "noframes") && x(/<\/no(script|embed|frames)/i, e.innerHTML) ? (I(e), !0) : ($ && e.nodeType === de.text && (r = e.textContent, Re([Me, Ie, ke], (u) => {
373
375
  r = ce(r, u, " ");
374
376
  }), e.textContent !== r && (se(t.removed, {
375
377
  element: e.cloneNode()
376
- }), e.textContent = r)), H(S.afterSanitizeElements, e, null), !1);
378
+ }), e.textContent = r)), U(S.afterSanitizeElements, e, null), !1);
377
379
  }, St = function(e, r, a) {
378
- if (be[r] || dt && (r === "id" || r === "name") && (a in o || a in dn))
380
+ if (be[r] || dt && (r === "id" || r === "name") && (a in o || a in mn))
379
381
  return !1;
380
- if (!(Pe && !be[r] && x(nn, r))) {
381
- if (!(ct && x(rn, r))) {
382
- if (!(B.attributeCheck instanceof Function && B.attributeCheck(r, e))) {
382
+ if (!(Pe && !be[r] && x(rn, r))) {
383
+ if (!(ct && x(on, r))) {
384
+ if (!(G.attributeCheck instanceof Function && G.attributeCheck(r, e))) {
383
385
  if (!A[r] || be[r]) {
384
386
  if (
385
387
  // First condition does a very basic check if a) it's basically a valid custom element tagname AND
386
388
  // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
387
389
  // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
388
- !(xt(e) && (p.tagNameCheck instanceof RegExp && x(p.tagNameCheck, e) || p.tagNameCheck instanceof Function && p.tagNameCheck(e)) && (p.attributeNameCheck instanceof RegExp && x(p.attributeNameCheck, r) || p.attributeNameCheck instanceof Function && p.attributeNameCheck(r, e)) || // Alternative, second condition checks if it's an `is`-attribute, AND
390
+ !(xt(e) && (f.tagNameCheck instanceof RegExp && x(f.tagNameCheck, e) || f.tagNameCheck instanceof Function && f.tagNameCheck(e)) && (f.attributeNameCheck instanceof RegExp && x(f.attributeNameCheck, r) || f.attributeNameCheck instanceof Function && f.attributeNameCheck(r, e)) || // Alternative, second condition checks if it's an `is`-attribute, AND
389
391
  // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
390
- r === "is" && p.allowCustomizedBuiltInElements && (p.tagNameCheck instanceof RegExp && x(p.tagNameCheck, a) || p.tagNameCheck instanceof Function && p.tagNameCheck(a)))
392
+ r === "is" && f.allowCustomizedBuiltInElements && (f.tagNameCheck instanceof RegExp && x(f.tagNameCheck, a) || f.tagNameCheck instanceof Function && f.tagNameCheck(a)))
391
393
  ) return !1;
392
394
  } else if (!Be[r]) {
393
395
  if (!x(it, ce(a, at, ""))) {
394
- if (!((r === "src" || r === "xlink:href" || r === "href") && e !== "script" && An(a, "data:") === 0 && ft[e])) {
395
- if (!(ut && !x(on, ce(a, at, "")))) {
396
+ if (!((r === "src" || r === "xlink:href" || r === "href") && e !== "script" && vn(a, "data:") === 0 && ft[e])) {
397
+ if (!(ut && !x(an, ce(a, at, "")))) {
396
398
  if (a)
397
399
  return !1;
398
400
  }
@@ -404,13 +406,13 @@ function Bt() {
404
406
  }
405
407
  return !0;
406
408
  }, xt = function(e) {
407
- return e !== "annotation-xml" && qe(e, an);
409
+ return e !== "annotation-xml" && qe(e, ln);
408
410
  }, Rt = function(e) {
409
- H(S.beforeSanitizeAttributes, e, null);
411
+ U(S.beforeSanitizeAttributes, e, null);
410
412
  const {
411
413
  attributes: r
412
414
  } = e;
413
- if (!r || Ve(e))
415
+ if (!r || je(e))
414
416
  return;
415
417
  const a = {
416
418
  attrName: "",
@@ -422,35 +424,35 @@ function Bt() {
422
424
  let u = r.length;
423
425
  for (; u--; ) {
424
426
  const y = r[u], {
425
- name: d,
427
+ name: g,
426
428
  namespaceURI: D,
427
- value: U
428
- } = y, Q = g(d), Ye = U;
429
- let _ = d === "value" ? Ye : _n(Ye);
430
- if (a.attrName = Q, a.attrValue = _, a.keepAttr = !0, a.forceKeepAttr = void 0, H(S.uponSanitizeAttribute, e, a), _ = a.attrValue, mt && (Q === "id" || Q === "name") && (Y(d, e), _ = ln + _), Ee && x(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, _)) {
431
- Y(d, e);
429
+ value: z
430
+ } = y, Q = T(g), Ye = z;
431
+ let _ = g === "value" ? Ye : Sn(Ye);
432
+ if (a.attrName = Q, a.attrValue = _, a.keepAttr = !0, a.forceKeepAttr = void 0, U(S.uponSanitizeAttribute, e, a), _ = a.attrValue, mt && (Q === "id" || Q === "name") && (Y(g, e), _ = sn + _), Ee && x(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, _)) {
433
+ Y(g, e);
432
434
  continue;
433
435
  }
434
436
  if (Q === "attributename" && qe(_, "href")) {
435
- Y(d, e);
437
+ Y(g, e);
436
438
  continue;
437
439
  }
438
440
  if (a.forceKeepAttr)
439
441
  continue;
440
442
  if (!a.keepAttr) {
441
- Y(d, e);
443
+ Y(g, e);
442
444
  continue;
443
445
  }
444
446
  if (!pt && x(/\/>/i, _)) {
445
- Y(d, e);
447
+ Y(g, e);
446
448
  continue;
447
449
  }
448
- $ && Re([Ne, Ie, ke], (Dt) => {
450
+ $ && Re([Me, Ie, ke], (Dt) => {
449
451
  _ = ce(_, Dt, " ");
450
452
  });
451
- const Lt = g(e.nodeName);
453
+ const Lt = T(e.nodeName);
452
454
  if (!St(Lt, Q, _)) {
453
- Y(d, e);
455
+ Y(g, e);
454
456
  continue;
455
457
  }
456
458
  if (v && typeof he == "object" && typeof he.getAttributeType == "function" && !D)
@@ -466,18 +468,18 @@ function Bt() {
466
468
  }
467
469
  if (_ !== Ye)
468
470
  try {
469
- D ? e.setAttributeNS(D, d, _) : e.setAttribute(d, _), Ve(e) ? N(e) : Ct(t.removed);
471
+ D ? e.setAttributeNS(D, g, _) : e.setAttribute(g, _), je(e) ? I(e) : wt(t.removed);
470
472
  } catch {
471
- Y(d, e);
473
+ Y(g, e);
472
474
  }
473
475
  }
474
- H(S.afterSanitizeAttributes, e, null);
475
- }, fn = function i(e) {
476
+ U(S.afterSanitizeAttributes, e, null);
477
+ }, gn = function i(e) {
476
478
  let r = null;
477
479
  const a = _t(e);
478
- for (H(S.beforeSanitizeShadowDOM, e, null); r = a.nextNode(); )
479
- H(S.uponSanitizeShadowNode, r, null), vt(r), Rt(r), r.content instanceof f && i(r.content);
480
- H(S.afterSanitizeShadowDOM, e, null);
480
+ for (U(S.beforeSanitizeShadowDOM, e, null); r = a.nextNode(); )
481
+ U(S.uponSanitizeShadowNode, r, null), vt(r), Rt(r), r.content instanceof d && i(r.content);
482
+ U(S.afterSanitizeShadowDOM, e, null);
481
483
  };
482
484
  return t.sanitize = function(i) {
483
485
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = null, a = null, u = null, y = null;
@@ -489,66 +491,66 @@ function Bt() {
489
491
  throw ue("toString is not a function");
490
492
  if (!t.isSupported)
491
493
  return i;
492
- if (Fe || je(e), t.removed = [], typeof i == "string" && (ie = !1), ie) {
494
+ if (He || Ve(e), t.removed = [], typeof i == "string" && (ie = !1), ie) {
493
495
  if (i.nodeName) {
494
- const U = g(i.nodeName);
495
- if (!h[U] || ae[U])
496
+ const z = T(i.nodeName);
497
+ if (!b[z] || ae[z])
496
498
  throw ue("root node is forbidden and cannot be sanitized in-place");
497
499
  }
498
- } else if (i instanceof z)
500
+ } else if (i instanceof H)
499
501
  r = At("<!---->"), a = r.ownerDocument.importNode(i, !0), a.nodeType === de.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? r = a : r.appendChild(a);
500
502
  else {
501
- if (!q && !$ && !V && // eslint-disable-next-line unicorn/prefer-includes
503
+ if (!q && !$ && !j && // eslint-disable-next-line unicorn/prefer-includes
502
504
  i.indexOf("<") === -1)
503
505
  return v && _e ? v.createHTML(i) : i;
504
506
  if (r = At(i), !r)
505
507
  return q ? null : _e ? oe : "";
506
508
  }
507
- r && He && N(r.firstChild);
508
- const d = _t(ie ? i : r);
509
- for (; u = d.nextNode(); )
510
- vt(u), Rt(u), u.content instanceof f && fn(u.content);
509
+ r && Fe && I(r.firstChild);
510
+ const g = _t(ie ? i : r);
511
+ for (; u = g.nextNode(); )
512
+ vt(u), Rt(u), u.content instanceof d && gn(u.content);
511
513
  if (ie)
512
514
  return i;
513
515
  if (q) {
514
516
  if (Ae)
515
- for (y = Jt.call(r.ownerDocument); r.firstChild; )
517
+ for (y = en.call(r.ownerDocument); r.firstChild; )
516
518
  y.appendChild(r.firstChild);
517
519
  else
518
520
  y = r;
519
- return (A.shadowroot || A.shadowrootmode) && (y = tn.call(l, y, !0)), y;
521
+ return (A.shadowroot || A.shadowrootmode) && (y = nn.call(l, y, !0)), y;
520
522
  }
521
- let D = V ? r.outerHTML : r.innerHTML;
522
- return V && h["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && x(zt, r.ownerDocument.doctype.name) && (D = "<!DOCTYPE " + r.ownerDocument.doctype.name + `>
523
- ` + D), $ && Re([Ne, Ie, ke], (U) => {
524
- D = ce(D, U, " ");
523
+ let D = j ? r.outerHTML : r.innerHTML;
524
+ return j && b["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && x(Bt, r.ownerDocument.doctype.name) && (D = "<!DOCTYPE " + r.ownerDocument.doctype.name + `>
525
+ ` + D), $ && Re([Me, Ie, ke], (z) => {
526
+ D = ce(D, z, " ");
525
527
  }), v && _e ? v.createHTML(D) : D;
526
528
  }, t.setConfig = function() {
527
529
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
528
- je(i), Fe = !0;
530
+ Ve(i), He = !0;
529
531
  }, t.clearConfig = function() {
530
- K = null, Fe = !1;
532
+ Z = null, He = !1;
531
533
  }, t.isValidAttribute = function(i, e, r) {
532
- K || je({});
533
- const a = g(i), u = g(e);
534
+ Z || Ve({});
535
+ const a = T(i), u = T(e);
534
536
  return St(a, u, r);
535
537
  }, t.addHook = function(i, e) {
536
538
  typeof e == "function" && se(S[i], e);
537
539
  }, t.removeHook = function(i, e) {
538
540
  if (e !== void 0) {
539
- const r = bn(S[i], e);
540
- return r === -1 ? void 0 : En(S[i], r, 1)[0];
541
+ const r = _n(S[i], e);
542
+ return r === -1 ? void 0 : yn(S[i], r, 1)[0];
541
543
  }
542
- return Ct(S[i]);
544
+ return wt(S[i]);
543
545
  }, t.removeHooks = function(i) {
544
546
  S[i] = [];
545
547
  }, t.removeAllHooks = function() {
546
548
  S = Pt();
547
549
  }, t;
548
550
  }
549
- var Pn = Bt();
550
- let m = null, P = null, J = null, T = null, ee = "", te = "", me = "insert", fe = null, k = null, Ce = null;
551
- function Gt(n, t) {
551
+ var Un = Gt();
552
+ let h = null, O = null, J = null, E = null, ee = "", te = "", me = "insert", fe = null, P = null, we = null;
553
+ function Wt(n, t) {
552
554
  if (t === n.innerHTML) return;
553
555
  const o = window.execEditorCommand || window.executeEditorCommand;
554
556
  if (typeof o == "function")
@@ -557,7 +559,7 @@ function Gt(n, t) {
557
559
  } catch {
558
560
  }
559
561
  }
560
- function Fn(n) {
562
+ function zn(n) {
561
563
  if (!n) return null;
562
564
  let t = n.startContainer;
563
565
  for (; t && t !== document.body; ) {
@@ -570,7 +572,7 @@ function Fn(n) {
570
572
  }
571
573
  return null;
572
574
  }
573
- const Hn = [
575
+ const Bn = [
574
576
  {
575
577
  id: "formal-letter",
576
578
  name: "Formal Letter",
@@ -641,55 +643,53 @@ const Hn = [
641
643
  <h3>Q: What are the requirements?</h3>
642
644
  <p>A: [Answer here]</p>`
643
645
  }
644
- ];
645
- let ne = [...Hn];
646
- const Wt = () => ne, Zn = (n) => ne.filter((t) => t.category === n), jt = () => {
646
+ ], ne = [...Bn], Vt = () => ne, nr = (n) => ne.filter((t) => t.category === n), jt = () => {
647
647
  const n = new Set(ne.map((t) => t.category));
648
648
  return Array.from(n);
649
- }, Un = (n) => {
649
+ }, Gn = (n) => {
650
650
  const t = n.toLowerCase();
651
651
  return ne.filter(
652
652
  (o) => o.name.toLowerCase().includes(t) || o.description?.toLowerCase().includes(t) || o.tags?.some((l) => l.toLowerCase().includes(t))
653
653
  );
654
- }, Vt = (n) => Pn.sanitize(n, {
654
+ }, Yt = (n) => Un.sanitize(n, {
655
655
  ALLOWED_TAGS: ["p", "br", "strong", "em", "u", "h1", "h2", "h3", "h4", "ul", "ol", "li", "blockquote", "table", "thead", "tbody", "tr", "th", "td", "a", "span"],
656
656
  ALLOWED_ATTR: ["href", "target", "class", "data-key", "data-category"]
657
- }), Kn = (n) => ne.some((t) => t.id === n.id) ? (console.warn(`Template with ID ${n.id} already exists`), !1) : (ne.push(n), !0), Qn = (n) => !!(n.id && n.name && n.category && n.html && n.html.trim().length > 0);
658
- function zn(n) {
659
- P = document.createElement("div"), P.className = "rte-dialog-overlay", Wn(n) && P.classList.add("rte-ui-theme-dark"), P.addEventListener("click", () => G()), m = document.createElement("div"), m.className = "rte-dialog rte-template-dialog", m.addEventListener("click", (o) => o.stopPropagation());
657
+ }), rr = (n) => ne.some((t) => t.id === n.id) ? (console.warn(`Template with ID ${n.id} already exists`), !1) : (ne.push(n), !0), or = (n) => !!(n.id && n.name && n.category && n.html && n.html.trim().length > 0);
658
+ function Wn(n) {
659
+ O && B(), O = document.createElement("div"), Tn(O), O.className = "rte-dialog-overlay", Yn(n) && O.classList.add("rte-ui-theme-dark"), O.addEventListener("click", () => B()), h = document.createElement("div"), h.className = "rte-dialog rte-template-dialog", h.addEventListener("click", (o) => o.stopPropagation());
660
660
  const t = jt();
661
- t.length > 0 && !ee && (ee = t[0]), ge(), P.appendChild(m), document.body.appendChild(P), Bn(), Xn();
661
+ t.length > 0 && !ee && (ee = t[0]), ge(), O.appendChild(h), document.body.appendChild(O), Vn(), Jn();
662
662
  }
663
- function Bn() {
664
- Yt(), fe = (n) => {
665
- n.key === "Escape" && (!P || !m || (n.preventDefault(), n.stopPropagation(), G()));
663
+ function Vn() {
664
+ $t(), fe = (n) => {
665
+ n.key === "Escape" && (!O || !h || (n.preventDefault(), n.stopPropagation(), B()));
666
666
  }, document.addEventListener("keydown", fe, !0);
667
667
  }
668
- function Yt() {
668
+ function $t() {
669
669
  fe && (document.removeEventListener("keydown", fe, !0), fe = null);
670
670
  }
671
- const Gn = '[data-theme="dark"], .dark, .editora-theme-dark', nt = () => {
671
+ const jn = '[data-theme="dark"], .dark, .editora-theme-dark', nt = () => {
672
672
  const n = window.getSelection();
673
673
  if (!n || n.rangeCount === 0) return null;
674
674
  const t = n.anchorNode;
675
675
  return (t instanceof HTMLElement ? t : t?.parentElement)?.closest(
676
676
  ".rte-content, .editora-content"
677
677
  ) || null;
678
- }, Wn = (n) => {
678
+ }, Yn = (n) => {
679
679
  const t = n || nt();
680
- return t ? !!t.closest(Gn) : !1;
680
+ return t ? !!t.closest(jn) : !1;
681
681
  };
682
682
  function rt() {
683
- const n = Fn(J);
683
+ const n = zn(J);
684
684
  if (n) return n;
685
- if (Ce?.isConnected) return Ce;
685
+ if (we?.isConnected) return we;
686
686
  const t = nt();
687
687
  return t || document.querySelector(".rte-content, .editora-content");
688
688
  }
689
689
  function ge() {
690
- if (!m) return;
690
+ if (!h) return;
691
691
  const n = jt(), t = ot();
692
- m.innerHTML = `
692
+ h.innerHTML = `
693
693
  <div class="rte-dialog-header">
694
694
  <h2>Insert Template</h2>
695
695
  <button class="rte-dialog-close" aria-label="Close">✕</button>
@@ -700,7 +700,7 @@ function ge() {
700
700
  <input
701
701
  type="text"
702
702
  placeholder="Search templates..."
703
- value="${te}"
703
+ value="${hn(te)}"
704
704
  class="rte-input rte-template-search"
705
705
  aria-label="Search templates"
706
706
  />
@@ -718,7 +718,7 @@ function ge() {
718
718
  <div class="rte-template-list">
719
719
  ${t.length > 0 ? t.map((o) => `
720
720
  <div
721
- class="rte-template-item ${T?.id === o.id ? "selected" : ""}"
721
+ class="rte-template-item ${E?.id === o.id ? "selected" : ""}"
722
722
  data-template-id="${o.id}"
723
723
  >
724
724
  <div class="template-name">${o.name}</div>
@@ -728,10 +728,10 @@ function ge() {
728
728
  </div>
729
729
 
730
730
  <!-- Preview -->
731
- ${T ? `
731
+ ${E ? `
732
732
  <div class="rte-template-preview">
733
733
  <strong>Preview:</strong>
734
- <div class="template-preview-content">${T.html}</div>
734
+ <div class="template-preview-content">${E.html}</div>
735
735
  </div>
736
736
  ` : ""}
737
737
 
@@ -750,15 +750,15 @@ function ge() {
750
750
 
751
751
  <div class="rte-dialog-footer">
752
752
  <button class="rte-button-secondary rte-cancel-btn">Cancel</button>
753
- <button class="rte-button-primary rte-insert-btn" ${T ? "" : "disabled"}>
753
+ <button class="rte-button-primary rte-insert-btn" ${E ? "" : "disabled"}>
754
754
  ${me === "insert" ? "Insert" : "Replace"}
755
755
  </button>
756
756
  </div>
757
- `, Vn();
757
+ `, qn();
758
758
  }
759
- function jn() {
760
- if (!m) return;
761
- m.innerHTML = `
759
+ function $n() {
760
+ if (!h) return;
761
+ h.innerHTML = `
762
762
  <div class="rte-dialog-header">
763
763
  <h2>Replace Document?</h2>
764
764
  </div>
@@ -770,65 +770,89 @@ function jn() {
770
770
  <button class="rte-button-primary rte-confirm-replace-btn">Replace</button>
771
771
  </div>
772
772
  `;
773
- const n = m.querySelector(".rte-cancel-warning-btn"), t = m.querySelector(".rte-confirm-replace-btn");
774
- n?.addEventListener("click", () => ge()), t?.addEventListener("click", () => Yn());
773
+ const n = h.querySelector(".rte-cancel-warning-btn"), t = h.querySelector(".rte-confirm-replace-btn");
774
+ n?.addEventListener("click", () => ge()), t?.addEventListener("click", () => Xn());
775
775
  }
776
776
  function ot() {
777
- const n = Wt();
778
- return te.trim() ? Un(te) : ee ? n.filter((t) => t.category === ee) : n;
777
+ const n = Vt();
778
+ return te.trim() ? Gn(te) : ee ? n.filter((t) => t.category === ee) : n;
779
779
  }
780
- function Vn() {
781
- if (!m) return;
782
- m.querySelector(".rte-dialog-close")?.addEventListener("click", () => G()), m.querySelector(".rte-cancel-btn")?.addEventListener("click", () => G()), m.querySelector(".rte-insert-btn")?.addEventListener("click", () => Je());
783
- const l = m.querySelector(".rte-template-search");
784
- l?.addEventListener("input", (b) => {
785
- k !== null && cancelAnimationFrame(k), te = b.target.value, k = requestAnimationFrame(() => {
786
- k = null, Ft();
780
+ function qn() {
781
+ if (!h) return;
782
+ h.querySelector(".rte-dialog-close")?.addEventListener("click", () => B()), h.querySelector(".rte-cancel-btn")?.addEventListener("click", () => B()), h.querySelector(".rte-insert-btn")?.addEventListener("click", () => Je());
783
+ const l = h.querySelector(".rte-template-search");
784
+ l?.addEventListener("input", (p) => {
785
+ P !== null && cancelAnimationFrame(P), te = p.target.value, P = requestAnimationFrame(() => {
786
+ P = null, Ht();
787
787
  });
788
- }), l?.addEventListener("keydown", (b) => {
789
- b.key === "Enter" && T ? Je() : b.key === "Escape" && G();
790
- }), m.querySelector(".rte-tabs")?.addEventListener("click", (b) => {
791
- const W = b.target.closest(".rte-tab");
788
+ }), l?.addEventListener("keydown", (p) => {
789
+ p.key === "Enter" && E ? Je() : p.key === "Escape" && B();
790
+ }), h.querySelector(".rte-tabs")?.addEventListener("click", (p) => {
791
+ const W = p.target.closest(".rte-tab");
792
792
  if (!W) return;
793
- const j = W.getAttribute("data-category");
794
- j && (ee = j, te = "", k !== null && (cancelAnimationFrame(k), k = null), Ft());
793
+ const V = W.getAttribute("data-category");
794
+ V && (ee = V, te = "", P !== null && (cancelAnimationFrame(P), P = null), Ht());
795
795
  });
796
- const f = m.querySelector(".rte-template-list"), w = (b) => {
797
- const W = b.target.closest(".rte-template-item");
796
+ const d = h.querySelector(".rte-template-list"), w = (p) => {
797
+ const W = p.target.closest(".rte-template-item");
798
798
  if (!W) return null;
799
- const j = W.getAttribute("data-template-id");
800
- return j && Wt().find((Oe) => Oe.id === j) || null;
799
+ const V = W.getAttribute("data-template-id");
800
+ return V && Vt().find((Oe) => Oe.id === V) || null;
801
801
  };
802
- f?.addEventListener("click", (b) => {
803
- const E = w(b);
804
- E && (T = E, ge());
805
- }), f?.addEventListener("dblclick", (b) => {
806
- const E = w(b);
807
- E && (T = E, Je());
808
- }), m.querySelector(".rte-insert-mode")?.addEventListener("change", (b) => {
809
- const E = b.target;
810
- !E || E.name !== "insertMode" || (me = E.value, ge());
802
+ d?.addEventListener("click", (p) => {
803
+ const m = w(p);
804
+ m && (E = m, ge());
805
+ }), d?.addEventListener("dblclick", (p) => {
806
+ const m = w(p);
807
+ m && (E = m, Je());
808
+ }), h.querySelector(".rte-insert-mode")?.addEventListener("change", (p) => {
809
+ const m = p.target;
810
+ !m || m.name !== "insertMode" || (me = m.value, ge());
811
811
  });
812
812
  }
813
- function Ft() {
813
+ function Ht() {
814
814
  const n = ot();
815
- n.length > 0 ? (!T || !n.find((t) => t.id === T.id)) && (T = n[0]) : T = null, ge();
815
+ n.length > 0 ? (!E || !n.find((t) => t.id === E.id)) && (E = n[0]) : E = null, ge();
816
816
  }
817
817
  function Je() {
818
- if (T)
818
+ if (E)
819
819
  if (me === "replace") {
820
820
  if (rt()?.innerHTML?.trim()) {
821
- jn();
821
+ $n();
822
822
  return;
823
823
  }
824
- $t(T), G();
824
+ qt(E), B();
825
825
  } else
826
- $n(T), G();
826
+ Zn(E), B();
827
827
  }
828
- function Yn() {
829
- T && ($t(T), G());
828
+ function Xn() {
829
+ E && (qt(E), B());
830
830
  }
831
- function $n(n) {
831
+ const Kn = /* @__PURE__ */ new Set([
832
+ "DIV",
833
+ "P",
834
+ "BLOCKQUOTE",
835
+ "PRE",
836
+ "H1",
837
+ "H2",
838
+ "H3",
839
+ "H4",
840
+ "H5",
841
+ "H6",
842
+ "LI",
843
+ "TD",
844
+ "TH"
845
+ ]);
846
+ function Ft(n, t) {
847
+ let o = n;
848
+ for (; o && o !== t; ) {
849
+ if (o.nodeType === Node.ELEMENT_NODE && Kn.has(o.tagName))
850
+ return o;
851
+ o = o.parentNode;
852
+ }
853
+ return null;
854
+ }
855
+ function Zn(n) {
832
856
  const t = window.getSelection();
833
857
  if (!t) return;
834
858
  const o = rt();
@@ -836,34 +860,36 @@ function $n(n) {
836
860
  if (J)
837
861
  t.removeAllRanges(), t.addRange(J);
838
862
  else {
839
- const z = document.createRange();
840
- z.selectNodeContents(o), z.collapse(!1), t.removeAllRanges(), t.addRange(z);
863
+ const m = document.createRange();
864
+ m.selectNodeContents(o), m.collapse(!1), t.removeAllRanges(), t.addRange(m);
841
865
  }
842
866
  if (t.rangeCount === 0) return;
843
- const l = t.getRangeAt(0), c = o?.innerHTML ?? "", f = document.createRange().createContextualFragment(Vt(n.html));
844
- l.deleteContents(), l.insertNode(f);
845
- const w = document.createRange();
846
- w.setStartAfter(l.endContainer), w.collapse(!0), t.removeAllRanges(), t.addRange(w), o && (Gt(o, c), o.dispatchEvent(new Event("input", { bubbles: !0 })));
867
+ const l = t.getRangeAt(0), c = o?.innerHTML ?? "", d = document.createRange().createContextualFragment(Yt(n.html));
868
+ l.deleteContents();
869
+ const w = d.lastChild, H = Ft(l.endContainer, o) || Ft(l.startContainer, o);
870
+ H && H.parentNode ? H.parentNode.insertBefore(d, H.nextSibling) : l.insertNode(d);
871
+ const p = document.createRange();
872
+ w ? p.setStartAfter(w) : p.setStartAfter(l.endContainer), p.collapse(!0), t.removeAllRanges(), t.addRange(p), o && (Wt(o, c), o.dispatchEvent(new Event("input", { bubbles: !0 })));
847
873
  }
848
- function $t(n) {
874
+ function qt(n) {
849
875
  const t = rt();
850
876
  if (t) {
851
877
  const o = t.innerHTML;
852
- t.innerHTML = Vt(n.html), Gt(t, o), t.dispatchEvent(new Event("input", { bubbles: !0 }));
878
+ t.innerHTML = Yt(n.html), Wt(t, o), t.dispatchEvent(new Event("input", { bubbles: !0 }));
853
879
  }
854
880
  }
855
- function G() {
856
- Yt(), k !== null && (cancelAnimationFrame(k), k = null), P && (P.remove(), P = null), m = null, J = null, te = "", Ce = null;
881
+ function B() {
882
+ $t(), P !== null && (cancelAnimationFrame(P), P = null), O && (O.remove(), O = null), h = null, J = null, te = "", we = null;
857
883
  }
858
- function qn(n) {
884
+ function Qn(n) {
859
885
  const t = window.getSelection();
860
886
  t && t.rangeCount > 0 ? J = t.getRangeAt(0).cloneRange() : J = null;
861
887
  const o = ot();
862
- o.length > 0 && !T && (T = o[0]);
888
+ o.length > 0 && !E && (E = o[0]);
863
889
  const l = n?.contentElement instanceof HTMLElement ? n.contentElement : nt();
864
- Ce = l || null, zn(l);
890
+ we = l || null, Wn(l);
865
891
  }
866
- function Xn() {
892
+ function Jn() {
867
893
  if (typeof document > "u") return;
868
894
  const n = "template-plugin-dialog-styles";
869
895
  if (document.getElementById(n)) return;
@@ -1107,7 +1133,7 @@ function Xn() {
1107
1133
  }
1108
1134
  `, document.head.appendChild(t);
1109
1135
  }
1110
- const Jn = () => ({
1136
+ const ar = () => ({
1111
1137
  name: "template",
1112
1138
  toolbar: [
1113
1139
  {
@@ -1117,18 +1143,18 @@ const Jn = () => ({
1117
1143
  }
1118
1144
  ],
1119
1145
  commands: {
1120
- insertTemplate: (n, t) => (qn(t), !0)
1146
+ insertTemplate: (n, t) => (Qn(t), !0)
1121
1147
  },
1122
1148
  keymap: {}
1123
1149
  });
1124
1150
  export {
1125
- Hn as PREDEFINED_TEMPLATES,
1126
- Jn as TemplatePlugin,
1127
- Kn as addCustomTemplate,
1128
- Wt as getAllTemplates,
1151
+ Bn as PREDEFINED_TEMPLATES,
1152
+ ar as TemplatePlugin,
1153
+ rr as addCustomTemplate,
1154
+ Vt as getAllTemplates,
1129
1155
  jt as getTemplateCategories,
1130
- Zn as getTemplatesByCategory,
1131
- Vt as sanitizeTemplate,
1132
- Un as searchTemplates,
1133
- Qn as validateTemplate
1156
+ nr as getTemplatesByCategory,
1157
+ Yt as sanitizeTemplate,
1158
+ Gn as searchTemplates,
1159
+ or as validateTemplate
1134
1160
  };