@kg-ui/kg-ui-plus 0.2.2 → 0.2.4

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 (76) hide show
  1. package/dist/es/directives/heighlight/index.mjs +27 -27
  2. package/dist/es/home/LFilter/FilterHead.vue.mjs +1 -1
  3. package/dist/es/kgCopilot/copilotCanvas/InitWrap.vue2.mjs +1 -1
  4. package/dist/es/kgCopilot/copilotCanvas/codeViewer/CodeTypewriter.vue.mjs +154 -0
  5. package/dist/es/kgCopilot/copilotCanvas/codeViewer/CodeTypewriter.vue2.mjs +4 -0
  6. package/dist/es/kgCopilot/copilotCanvas/codeViewer/index.vue.mjs +27 -0
  7. package/dist/es/kgCopilot/copilotCanvas/codeViewer/index.vue2.mjs +4 -0
  8. package/dist/es/kgCopilot/copilotCanvas/docViewer/index.vue.mjs +2 -2
  9. package/dist/es/kgCopilot/copilotCanvas/docViewer/wpsFileViewer/wpsAi/AiInput.vue2.mjs +1 -1
  10. package/dist/es/kgCopilot/copilotCanvas/index.vue.mjs +1 -1
  11. package/dist/es/kgCopilot/copilotCanvas/index.vue2.mjs +46 -6
  12. package/dist/es/kgCopilot/copilotCanvas/index.vue3.mjs +2 -2
  13. package/dist/es/kgCopilot/copilotDialog/CopiContent/SuggestMessage.vue2.mjs +1 -1
  14. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/codeBox.vue.mjs +102 -0
  15. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/codeBox.vue2.mjs +4 -0
  16. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/index.vue.mjs +1 -1
  17. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/index.vue2.mjs +19 -2
  18. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/index.vue3.mjs +2 -2
  19. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/readMd.vue2.mjs +3 -3
  20. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/readStreamMd.vue2.mjs +2 -2
  21. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/reportBox.vue.mjs +2 -2
  22. package/dist/es/kgCopilot/copilotDialog/CopiContent/messageParse/reportBox.vue2.mjs +2 -2
  23. package/dist/es/kgCopilot/copilotDialog/CopiFooter/SearchInput/InputFootTool.vue2.mjs +1 -1
  24. package/dist/es/kgCopilot/copilotDialog/CopiFooter/SearchInput/SelectPluginByKey.vue2.mjs +1 -1
  25. package/dist/es/kgCopilot/copilotDialog/CopiFooter/SearchInput/index.vue2.mjs +1 -1
  26. package/dist/es/kgCopilot/copilotHistory/index.vue2.mjs +5 -5
  27. package/dist/es/kgCopilot/index.vue2.mjs +3 -3
  28. package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/code-s-slash-fill.mjs +8 -0
  29. package/dist/es/node_modules/.pnpm/{dompurify@3.0.10 → dompurify@3.2.6}/node_modules/dompurify/dist/purify.es.mjs +145 -103
  30. package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/apache.mjs +4 -0
  31. package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/bash.mjs +20 -2
  32. package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/basic.mjs +7 -1
  33. package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/c.mjs +19 -4
  34. package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/css.mjs +214 -8
  35. package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/dart.mjs +10 -2
  36. package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/erlang.mjs +48 -6
  37. package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/go.mjs +23 -3
  38. package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/java.mjs +3 -1
  39. package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/javascript.mjs +15 -11
  40. package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/json.mjs +1 -0
  41. package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/markdown.mjs +7 -1
  42. package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/php.mjs +16 -2
  43. package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/python.mjs +3 -1
  44. package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/ruby.mjs +1 -1
  45. package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/stylus.mjs +214 -8
  46. package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/swift.mjs +60 -14
  47. package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/typescript.mjs +45 -18
  48. package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/lib/core.mjs +8 -8
  49. package/dist/es/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/styles/github.css.mjs +4 -0
  50. package/dist/es/node_modules/.pnpm/{marked@12.0.1 → marked@12.0.2}/node_modules/marked/lib/marked.esm.mjs +2 -1
  51. package/dist/es/store/modules/copilot.mjs +69 -19
  52. package/dist/es/style.css +11 -1
  53. package/package.json +2 -2
  54. /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/arrow-left.mjs +0 -0
  55. /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/arrow-right.mjs +0 -0
  56. /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/check.mjs +0 -0
  57. /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/close.mjs +0 -0
  58. /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/copy-document.mjs +0 -0
  59. /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/delete.mjs +0 -0
  60. /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/edit.mjs +0 -0
  61. /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/folder-opened.mjs +0 -0
  62. /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/loading.mjs +0 -0
  63. /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/notebook.mjs +0 -0
  64. /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/promotion.mjs +0 -0
  65. /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/reading.mjs +0 -0
  66. /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/refresh.mjs +0 -0
  67. /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/search.mjs +0 -0
  68. /package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/core.mjs +0 -0
  69. /package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/django.mjs +0 -0
  70. /package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/dns.mjs +0 -0
  71. /package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/dos.mjs +0 -0
  72. /package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/dust.mjs +0 -0
  73. /package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/http.mjs +0 -0
  74. /package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/nginx.mjs +0 -0
  75. /package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/xml.mjs +0 -0
  76. /package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/styles/sunburst.css.mjs +0 -0
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, resolveComponent, openBlock, createElementBlock, unref, createBlock, withCtx, createElementVNode, normalizeClass, createVNode, createCommentVNode, Fragment, renderList, toDisplayString } from "vue";
2
2
  import { storeToRefs } from "pinia";
3
- import data from "../../../../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/reading.mjs";
3
+ import data from "../../../../node_modules/.pnpm/@iconify-icons_ep@1.2.12/node_modules/@iconify-icons/ep/reading.mjs";
4
4
  import { useCopilotStoreHook } from "../../../../store/modules/copilot.mjs";
5
5
  import { useDebounceFn } from "../../../../node_modules/.pnpm/@vueuse_shared@9.13.0_vue@3.2.45/node_modules/@vueuse/shared/index.mjs";
6
6
  const _hoisted_1 = {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, ref, watch, nextTick, resolveComponent, openBlock, createBlock, Transition, withCtx, withDirectives, createElementBlock, normalizeStyle, createElementVNode, Fragment, renderList, normalizeClass, toDisplayString, unref, createVNode, createCommentVNode } from "vue";
2
2
  import { ClickOutside } from "element-plus";
3
- import data from "../../../../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/check.mjs";
3
+ import data from "../../../../node_modules/.pnpm/@iconify-icons_ep@1.2.12/node_modules/@iconify-icons/ep/check.mjs";
4
4
  import { useCopilotStoreHook } from "../../../../store/modules/copilot.mjs";
5
5
  import { storeToRefs } from "pinia";
6
6
  const _hoisted_1 = { class: "plugin-content" };
@@ -6,7 +6,7 @@ import SelectPluginByKey from "./SelectPluginByKey.vue.mjs";
6
6
  import InputFootTool from "./InputFootTool.vue.mjs";
7
7
  import { useCopilotStoreHook } from "../../../../store/modules/copilot.mjs";
8
8
  import { plusParamToStr } from "../../../../utils/copilot.mjs";
9
- import data$2 from "../../../../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/promotion.mjs";
9
+ import data$2 from "../../../../node_modules/.pnpm/@iconify-icons_ep@1.2.12/node_modules/@iconify-icons/ep/promotion.mjs";
10
10
  import data from "../../../../node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/braces-line.mjs";
11
11
  import data$1 from "../../../../node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/close-circle-line.mjs";
12
12
  const _withScopeId = (n) => (pushScopeId("data-v-f1f0ba48"), n = n(), popScopeId(), n);
@@ -1,11 +1,11 @@
1
1
  import { defineComponent, ref, computed, resolveComponent, openBlock, createElementBlock, normalizeStyle, createElementVNode, createVNode, withCtx, unref, Fragment, renderList, normalizeClass, withDirectives, toDisplayString, vShow, withModifiers, withKeys, createCommentVNode, nextTick, pushScopeId, popScopeId } from "vue";
2
2
  import { storeToRefs } from "pinia";
3
3
  import { ElMessageBox } from "element-plus";
4
- import data$1 from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/delete.mjs";
5
- import data$4 from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/edit.mjs";
6
- import data from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/search.mjs";
7
- import data$2 from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/check.mjs";
8
- import data$3 from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/close.mjs";
4
+ import data$1 from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.12/node_modules/@iconify-icons/ep/delete.mjs";
5
+ import data$4 from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.12/node_modules/@iconify-icons/ep/edit.mjs";
6
+ import data from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.12/node_modules/@iconify-icons/ep/search.mjs";
7
+ import data$2 from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.12/node_modules/@iconify-icons/ep/check.mjs";
8
+ import data$3 from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.12/node_modules/@iconify-icons/ep/close.mjs";
9
9
  import { useCopilotStoreHook } from "../../store/modules/copilot.mjs";
10
10
  const _withScopeId = (n) => (pushScopeId("data-v-9b95ecce"), n = n(), popScopeId(), n);
11
11
  const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("h3", { class: "history-title" }, "历史记录", -1));
@@ -6,9 +6,9 @@ import Dialogue from "./copilotDialog/CopiContent/index.vue.mjs";
6
6
  import CopiCanvas from "./copilotCanvas/index.vue.mjs";
7
7
  import "../style/tailwind.css.mjs";
8
8
  import "../style/index.scss.mjs";
9
- import data$2 from "../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/arrow-right.mjs";
10
- import data$1 from "../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/arrow-left.mjs";
11
- import data from "../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/notebook.mjs";
9
+ import data$2 from "../node_modules/.pnpm/@iconify-icons_ep@1.2.12/node_modules/@iconify-icons/ep/arrow-right.mjs";
10
+ import data$1 from "../node_modules/.pnpm/@iconify-icons_ep@1.2.12/node_modules/@iconify-icons/ep/arrow-left.mjs";
11
+ import data from "../node_modules/.pnpm/@iconify-icons_ep@1.2.12/node_modules/@iconify-icons/ep/notebook.mjs";
12
12
  import { deviceDetection as Rn } from "../node_modules/.pnpm/@pureadmin_utils@1.8.5_vue@3.2.45/node_modules/@pureadmin/utils/dist/index.mjs";
13
13
  import { useCopilotStoreHook } from "../store/modules/copilot.mjs";
14
14
  const _hoisted_1 = {
@@ -0,0 +1,8 @@
1
+ const data = {
2
+ "width": 24,
3
+ "height": 24,
4
+ "body": '<path fill="currentColor" d="m24 12l-5.657 5.657l-1.414-1.414L21.172 12l-4.243-4.243l1.414-1.414L24 12zM2.828 12l4.243 4.243l-1.414 1.414L0 12l5.657-5.657L7.07 7.757L2.828 12zm6.96 9H7.66l6.552-18h2.128L9.788 21z"/>'
5
+ };
6
+ export {
7
+ data as default
8
+ };
@@ -1,4 +1,4 @@
1
- /*! @license DOMPurify 3.0.10 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.10/LICENSE */
1
+ /*! @license DOMPurify 3.2.6 | (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.6/LICENSE */
2
2
  const {
3
3
  entries,
4
4
  setPrototypeOf,
@@ -36,8 +36,10 @@ if (!construct) {
36
36
  };
37
37
  }
38
38
  const arrayForEach = unapply(Array.prototype.forEach);
39
+ const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
39
40
  const arrayPop = unapply(Array.prototype.pop);
40
41
  const arrayPush = unapply(Array.prototype.push);
42
+ const arraySplice = unapply(Array.prototype.splice);
41
43
  const stringToLowerCase = unapply(String.prototype.toLowerCase);
42
44
  const stringToString = unapply(String.prototype.toString);
43
45
  const stringMatch = unapply(String.prototype.match);
@@ -49,6 +51,9 @@ const regExpTest = unapply(RegExp.prototype.test);
49
51
  const typeErrorCreate = unconstruct(TypeError);
50
52
  function unapply(func) {
51
53
  return function(thisArg) {
54
+ if (thisArg instanceof RegExp) {
55
+ thisArg.lastIndex = 0;
56
+ }
52
57
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
53
58
  args[_key - 1] = arguments[_key];
54
59
  }
@@ -134,17 +139,17 @@ const svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "
134
139
  const mathMl$1 = freeze(["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"]);
135
140
  const mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]);
136
141
  const text = freeze(["#text"]);
137
- const html = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns", "slot"]);
138
- const svg = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]);
142
+ const html = freeze(["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"]);
143
+ const svg = freeze(["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"]);
139
144
  const mathMl = freeze(["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"]);
140
145
  const xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]);
141
146
  const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm);
142
147
  const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
143
- const TMPLIT_EXPR = seal(/\${[\w\W]*}/gm);
144
- const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/);
148
+ const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm);
149
+ const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/);
145
150
  const ARIA_ATTR = seal(/^aria-[\-\w]+$/);
146
151
  const IS_ALLOWED_URI = seal(
147
- /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
152
+ /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
148
153
  // eslint-disable-line no-useless-escape
149
154
  );
150
155
  const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
@@ -153,20 +158,37 @@ const ATTR_WHITESPACE = seal(
153
158
  // eslint-disable-line no-control-regex
154
159
  );
155
160
  const DOCTYPE_NAME = seal(/^html$/i);
156
- const CUSTOM_ELEMENT = seal(/^[a-z][a-z\d]*(-[a-z\d]+)+$/i);
161
+ const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
157
162
  var EXPRESSIONS = /* @__PURE__ */ Object.freeze({
158
163
  __proto__: null,
159
- MUSTACHE_EXPR,
160
- ERB_EXPR,
161
- TMPLIT_EXPR,
162
- DATA_ATTR,
163
164
  ARIA_ATTR,
164
- IS_ALLOWED_URI,
165
- IS_SCRIPT_OR_DATA,
166
165
  ATTR_WHITESPACE,
166
+ CUSTOM_ELEMENT,
167
+ DATA_ATTR,
167
168
  DOCTYPE_NAME,
168
- CUSTOM_ELEMENT
169
+ ERB_EXPR,
170
+ IS_ALLOWED_URI,
171
+ IS_SCRIPT_OR_DATA,
172
+ MUSTACHE_EXPR,
173
+ TMPLIT_EXPR
169
174
  });
175
+ const NODE_TYPE = {
176
+ element: 1,
177
+ attribute: 2,
178
+ text: 3,
179
+ cdataSection: 4,
180
+ entityReference: 5,
181
+ // Deprecated
182
+ entityNode: 6,
183
+ // Deprecated
184
+ progressingInstruction: 7,
185
+ comment: 8,
186
+ document: 9,
187
+ documentType: 10,
188
+ documentFragment: 11,
189
+ notation: 12
190
+ // Deprecated
191
+ };
170
192
  const getGlobal = function getGlobal2() {
171
193
  return typeof window === "undefined" ? null : window;
172
194
  };
@@ -194,12 +216,25 @@ const _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTyp
194
216
  return null;
195
217
  }
196
218
  };
219
+ const _createHooksMap = function _createHooksMap2() {
220
+ return {
221
+ afterSanitizeAttributes: [],
222
+ afterSanitizeElements: [],
223
+ afterSanitizeShadowDOM: [],
224
+ beforeSanitizeAttributes: [],
225
+ beforeSanitizeElements: [],
226
+ beforeSanitizeShadowDOM: [],
227
+ uponSanitizeAttribute: [],
228
+ uponSanitizeElement: [],
229
+ uponSanitizeShadowNode: []
230
+ };
231
+ };
197
232
  function createDOMPurify() {
198
233
  let window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
199
234
  const DOMPurify = (root) => createDOMPurify(root);
200
- DOMPurify.version = "3.0.10";
235
+ DOMPurify.version = "3.2.6";
201
236
  DOMPurify.removed = [];
202
- if (!window2 || !window2.document || window2.document.nodeType !== 9) {
237
+ if (!window2 || !window2.document || window2.document.nodeType !== NODE_TYPE.document || !window2.Element) {
203
238
  DOMPurify.isSupported = false;
204
239
  return DOMPurify;
205
240
  }
@@ -221,6 +256,7 @@ function createDOMPurify() {
221
256
  } = window2;
222
257
  const ElementPrototype = Element.prototype;
223
258
  const cloneNode = lookupGetter(ElementPrototype, "cloneNode");
259
+ const remove = lookupGetter(ElementPrototype, "remove");
224
260
  const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
225
261
  const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
226
262
  const getParentNode = lookupGetter(ElementPrototype, "parentNode");
@@ -241,7 +277,7 @@ function createDOMPurify() {
241
277
  const {
242
278
  importNode
243
279
  } = originalDocument;
244
- let hooks = {};
280
+ let hooks = _createHooksMap();
245
281
  DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0;
246
282
  const {
247
283
  MUSTACHE_EXPR: MUSTACHE_EXPR2,
@@ -287,6 +323,7 @@ function createDOMPurify() {
287
323
  let ALLOW_UNKNOWN_PROTOCOLS = false;
288
324
  let ALLOW_SELF_CLOSE_IN_ATTR = true;
289
325
  let SAFE_FOR_TEMPLATES = false;
326
+ let SAFE_FOR_XML = true;
290
327
  let WHOLE_DOCUMENT = false;
291
328
  let SET_CONFIG = false;
292
329
  let FORCE_BODY = false;
@@ -312,6 +349,9 @@ function createDOMPurify() {
312
349
  let IS_EMPTY_INPUT = false;
313
350
  let ALLOWED_NAMESPACES = null;
314
351
  const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
352
+ let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]);
353
+ let HTML_INTEGRATION_POINTS = addToSet({}, ["annotation-xml"]);
354
+ const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]);
315
355
  let PARSER_MEDIA_TYPE = null;
316
356
  const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
317
357
  const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
@@ -336,31 +376,18 @@ function createDOMPurify() {
336
376
  ALLOWED_TAGS = objectHasOwnProperty(cfg, "ALLOWED_TAGS") ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
337
377
  ALLOWED_ATTR = objectHasOwnProperty(cfg, "ALLOWED_ATTR") ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
338
378
  ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, "ALLOWED_NAMESPACES") ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
339
- URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") ? addToSet(
340
- clone(DEFAULT_URI_SAFE_ATTRIBUTES),
341
- // eslint-disable-line indent
342
- cfg.ADD_URI_SAFE_ATTR,
343
- // eslint-disable-line indent
344
- transformCaseFunc
345
- // eslint-disable-line indent
346
- ) : DEFAULT_URI_SAFE_ATTRIBUTES;
347
- DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") ? addToSet(
348
- clone(DEFAULT_DATA_URI_TAGS),
349
- // eslint-disable-line indent
350
- cfg.ADD_DATA_URI_TAGS,
351
- // eslint-disable-line indent
352
- transformCaseFunc
353
- // eslint-disable-line indent
354
- ) : DEFAULT_DATA_URI_TAGS;
379
+ URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
380
+ DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
355
381
  FORBID_CONTENTS = objectHasOwnProperty(cfg, "FORBID_CONTENTS") ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
356
- FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
357
- FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
382
+ FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
383
+ FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
358
384
  USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES : false;
359
385
  ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
360
386
  ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
361
387
  ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
362
388
  ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
363
389
  SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
390
+ SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;
364
391
  WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
365
392
  RETURN_DOM = cfg.RETURN_DOM || false;
366
393
  RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
@@ -372,6 +399,8 @@ function createDOMPurify() {
372
399
  IN_PLACE = cfg.IN_PLACE || false;
373
400
  IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
374
401
  NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
402
+ MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
403
+ HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
375
404
  CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
376
405
  if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
377
406
  CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
@@ -464,9 +493,6 @@ function createDOMPurify() {
464
493
  }
465
494
  CONFIG = cfg;
466
495
  };
467
- const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]);
468
- const HTML_INTEGRATION_POINTS = addToSet({}, ["foreignobject", "desc", "title", "annotation-xml"]);
469
- const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]);
470
496
  const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
471
497
  const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
472
498
  const _checkValidNamespace = function _checkValidNamespace2(element) {
@@ -519,33 +545,33 @@ function createDOMPurify() {
519
545
  element: node
520
546
  });
521
547
  try {
522
- node.parentNode.removeChild(node);
548
+ getParentNode(node).removeChild(node);
523
549
  } catch (_) {
524
- node.remove();
550
+ remove(node);
525
551
  }
526
552
  };
527
- const _removeAttribute = function _removeAttribute2(name, node) {
553
+ const _removeAttribute = function _removeAttribute2(name, element) {
528
554
  try {
529
555
  arrayPush(DOMPurify.removed, {
530
- attribute: node.getAttributeNode(name),
531
- from: node
556
+ attribute: element.getAttributeNode(name),
557
+ from: element
532
558
  });
533
559
  } catch (_) {
534
560
  arrayPush(DOMPurify.removed, {
535
561
  attribute: null,
536
- from: node
562
+ from: element
537
563
  });
538
564
  }
539
- node.removeAttribute(name);
540
- if (name === "is" && !ALLOWED_ATTR[name]) {
565
+ element.removeAttribute(name);
566
+ if (name === "is") {
541
567
  if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
542
568
  try {
543
- _forceRemove(node);
569
+ _forceRemove(element);
544
570
  } catch (_) {
545
571
  }
546
572
  } else {
547
573
  try {
548
- node.setAttribute(name, "");
574
+ element.setAttribute(name, "");
549
575
  } catch (_) {
550
576
  }
551
577
  }
@@ -591,37 +617,42 @@ function createDOMPurify() {
591
617
  root.ownerDocument || root,
592
618
  root,
593
619
  // eslint-disable-next-line no-bitwise
594
- NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION,
620
+ NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION,
595
621
  null
596
622
  );
597
623
  };
598
- const _isClobbered = function _isClobbered2(elm) {
599
- return elm instanceof HTMLFormElement && (typeof elm.nodeName !== "string" || typeof elm.textContent !== "string" || typeof elm.removeChild !== "function" || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== "function" || typeof elm.setAttribute !== "function" || typeof elm.namespaceURI !== "string" || typeof elm.insertBefore !== "function" || typeof elm.hasChildNodes !== "function");
624
+ const _isClobbered = function _isClobbered2(element) {
625
+ return element instanceof HTMLFormElement && (typeof element.nodeName !== "string" || typeof element.textContent !== "string" || typeof element.removeChild !== "function" || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function");
600
626
  };
601
- const _isNode = function _isNode2(object) {
602
- return typeof Node === "function" && object instanceof Node;
627
+ const _isNode = function _isNode2(value) {
628
+ return typeof Node === "function" && value instanceof Node;
603
629
  };
604
- const _executeHook = function _executeHook2(entryPoint, currentNode, data) {
605
- if (!hooks[entryPoint]) {
606
- return;
607
- }
608
- arrayForEach(hooks[entryPoint], (hook) => {
630
+ function _executeHooks(hooks2, currentNode, data) {
631
+ arrayForEach(hooks2, (hook) => {
609
632
  hook.call(DOMPurify, currentNode, data, CONFIG);
610
633
  });
611
- };
634
+ }
612
635
  const _sanitizeElements = function _sanitizeElements2(currentNode) {
613
636
  let content = null;
614
- _executeHook("beforeSanitizeElements", currentNode, null);
637
+ _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
615
638
  if (_isClobbered(currentNode)) {
616
639
  _forceRemove(currentNode);
617
640
  return true;
618
641
  }
619
642
  const tagName = transformCaseFunc(currentNode.nodeName);
620
- _executeHook("uponSanitizeElement", currentNode, {
643
+ _executeHooks(hooks.uponSanitizeElement, currentNode, {
621
644
  tagName,
622
645
  allowedTags: ALLOWED_TAGS
623
646
  });
624
- if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
647
+ if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
648
+ _forceRemove(currentNode);
649
+ return true;
650
+ }
651
+ if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
652
+ _forceRemove(currentNode);
653
+ return true;
654
+ }
655
+ if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
625
656
  _forceRemove(currentNode);
626
657
  return true;
627
658
  }
@@ -640,7 +671,9 @@ function createDOMPurify() {
640
671
  if (childNodes && parentNode) {
641
672
  const childCount = childNodes.length;
642
673
  for (let i = childCount - 1; i >= 0; --i) {
643
- parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));
674
+ const childClone = cloneNode(childNodes[i], true);
675
+ childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
676
+ parentNode.insertBefore(childClone, getNextSibling(currentNode));
644
677
  }
645
678
  }
646
679
  }
@@ -655,7 +688,7 @@ function createDOMPurify() {
655
688
  _forceRemove(currentNode);
656
689
  return true;
657
690
  }
658
- if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {
691
+ if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
659
692
  content = currentNode.textContent;
660
693
  arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => {
661
694
  content = stringReplace(content, expr, " ");
@@ -667,7 +700,7 @@ function createDOMPurify() {
667
700
  currentNode.textContent = content;
668
701
  }
669
702
  }
670
- _executeHook("afterSanitizeElements", currentNode, null);
703
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
671
704
  return false;
672
705
  };
673
706
  const _isValidAttribute = function _isValidAttribute2(lcTag, lcName, value) {
@@ -709,18 +742,19 @@ function createDOMPurify() {
709
742
  return tagName !== "annotation-xml" && stringMatch(tagName, CUSTOM_ELEMENT2);
710
743
  };
711
744
  const _sanitizeAttributes = function _sanitizeAttributes2(currentNode) {
712
- _executeHook("beforeSanitizeAttributes", currentNode, null);
745
+ _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
713
746
  const {
714
747
  attributes
715
748
  } = currentNode;
716
- if (!attributes) {
749
+ if (!attributes || _isClobbered(currentNode)) {
717
750
  return;
718
751
  }
719
752
  const hookEvent = {
720
753
  attrName: "",
721
754
  attrValue: "",
722
755
  keepAttr: true,
723
- allowedAttributes: ALLOWED_ATTR
756
+ allowedAttributes: ALLOWED_ATTR,
757
+ forceKeepAttr: void 0
724
758
  };
725
759
  let l = attributes.length;
726
760
  while (l--) {
@@ -731,18 +765,27 @@ function createDOMPurify() {
731
765
  value: attrValue
732
766
  } = attr;
733
767
  const lcName = transformCaseFunc(name);
734
- let value = name === "value" ? attrValue : stringTrim(attrValue);
768
+ const initValue = attrValue;
769
+ let value = name === "value" ? initValue : stringTrim(initValue);
735
770
  hookEvent.attrName = lcName;
736
771
  hookEvent.attrValue = value;
737
772
  hookEvent.keepAttr = true;
738
773
  hookEvent.forceKeepAttr = void 0;
739
- _executeHook("uponSanitizeAttribute", currentNode, hookEvent);
774
+ _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
740
775
  value = hookEvent.attrValue;
776
+ if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) {
777
+ _removeAttribute(name, currentNode);
778
+ value = SANITIZE_NAMED_PROPS_PREFIX + value;
779
+ }
780
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
781
+ _removeAttribute(name, currentNode);
782
+ continue;
783
+ }
741
784
  if (hookEvent.forceKeepAttr) {
742
785
  continue;
743
786
  }
744
- _removeAttribute(name, currentNode);
745
787
  if (!hookEvent.keepAttr) {
788
+ _removeAttribute(name, currentNode);
746
789
  continue;
747
790
  }
748
791
  if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
@@ -756,11 +799,8 @@ function createDOMPurify() {
756
799
  }
757
800
  const lcTag = transformCaseFunc(currentNode.nodeName);
758
801
  if (!_isValidAttribute(lcTag, lcName, value)) {
759
- continue;
760
- }
761
- if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) {
762
802
  _removeAttribute(name, currentNode);
763
- value = SANITIZE_NAMED_PROPS_PREFIX + value;
803
+ continue;
764
804
  }
765
805
  if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function") {
766
806
  if (namespaceURI)
@@ -778,33 +818,38 @@ function createDOMPurify() {
778
818
  }
779
819
  }
780
820
  }
781
- try {
782
- if (namespaceURI) {
783
- currentNode.setAttributeNS(namespaceURI, name, value);
784
- } else {
785
- currentNode.setAttribute(name, value);
821
+ if (value !== initValue) {
822
+ try {
823
+ if (namespaceURI) {
824
+ currentNode.setAttributeNS(namespaceURI, name, value);
825
+ } else {
826
+ currentNode.setAttribute(name, value);
827
+ }
828
+ if (_isClobbered(currentNode)) {
829
+ _forceRemove(currentNode);
830
+ } else {
831
+ arrayPop(DOMPurify.removed);
832
+ }
833
+ } catch (_) {
834
+ _removeAttribute(name, currentNode);
786
835
  }
787
- arrayPop(DOMPurify.removed);
788
- } catch (_) {
789
836
  }
790
837
  }
791
- _executeHook("afterSanitizeAttributes", currentNode, null);
838
+ _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
792
839
  };
793
840
  const _sanitizeShadowDOM = function _sanitizeShadowDOM2(fragment) {
794
841
  let shadowNode = null;
795
842
  const shadowIterator = _createNodeIterator(fragment);
796
- _executeHook("beforeSanitizeShadowDOM", fragment, null);
843
+ _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
797
844
  while (shadowNode = shadowIterator.nextNode()) {
798
- _executeHook("uponSanitizeShadowNode", shadowNode, null);
799
- if (_sanitizeElements(shadowNode)) {
800
- continue;
801
- }
845
+ _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
846
+ _sanitizeElements(shadowNode);
847
+ _sanitizeAttributes(shadowNode);
802
848
  if (shadowNode.content instanceof DocumentFragment) {
803
849
  _sanitizeShadowDOM2(shadowNode.content);
804
850
  }
805
- _sanitizeAttributes(shadowNode);
806
851
  }
807
- _executeHook("afterSanitizeShadowDOM", fragment, null);
852
+ _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
808
853
  };
809
854
  DOMPurify.sanitize = function(dirty) {
810
855
  let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
@@ -846,7 +891,7 @@ function createDOMPurify() {
846
891
  } else if (dirty instanceof Node) {
847
892
  body = _initDocument("<!---->");
848
893
  importedNode = body.ownerDocument.importNode(dirty, true);
849
- if (importedNode.nodeType === 1 && importedNode.nodeName === "BODY") {
894
+ if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") {
850
895
  body = importedNode;
851
896
  } else if (importedNode.nodeName === "HTML") {
852
897
  body = importedNode;
@@ -868,13 +913,11 @@ function createDOMPurify() {
868
913
  }
869
914
  const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
870
915
  while (currentNode = nodeIterator.nextNode()) {
871
- if (_sanitizeElements(currentNode)) {
872
- continue;
873
- }
916
+ _sanitizeElements(currentNode);
917
+ _sanitizeAttributes(currentNode);
874
918
  if (currentNode.content instanceof DocumentFragment) {
875
919
  _sanitizeShadowDOM(currentNode.content);
876
920
  }
877
- _sanitizeAttributes(currentNode);
878
921
  }
879
922
  if (IN_PLACE) {
880
923
  return dirty;
@@ -925,21 +968,20 @@ function createDOMPurify() {
925
968
  if (typeof hookFunction !== "function") {
926
969
  return;
927
970
  }
928
- hooks[entryPoint] = hooks[entryPoint] || [];
929
971
  arrayPush(hooks[entryPoint], hookFunction);
930
972
  };
931
- DOMPurify.removeHook = function(entryPoint) {
932
- if (hooks[entryPoint]) {
933
- return arrayPop(hooks[entryPoint]);
973
+ DOMPurify.removeHook = function(entryPoint, hookFunction) {
974
+ if (hookFunction !== void 0) {
975
+ const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
976
+ return index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0];
934
977
  }
978
+ return arrayPop(hooks[entryPoint]);
935
979
  };
936
980
  DOMPurify.removeHooks = function(entryPoint) {
937
- if (hooks[entryPoint]) {
938
- hooks[entryPoint] = [];
939
- }
981
+ hooks[entryPoint] = [];
940
982
  };
941
983
  DOMPurify.removeAllHooks = function() {
942
- hooks = {};
984
+ hooks = _createHooksMap();
943
985
  };
944
986
  return DOMPurify;
945
987
  }
@@ -62,6 +62,10 @@ function apache(hljs) {
62
62
  relevance: 0,
63
63
  keywords: { literal: "on off all deny allow" },
64
64
  contains: [
65
+ {
66
+ scope: "punctuation",
67
+ match: /\\\n/
68
+ },
65
69
  {
66
70
  className: "meta",
67
71
  begin: /\s\[/,