@editora/plugins 1.0.10 → 1.0.12

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 (139) hide show
  1. package/README.md +1 -1
  2. package/dist/_commonjsHelpers-BH3jXuIh.js +1 -0
  3. package/dist/_commonjsHelpers-ByX85dGu.mjs +33 -0
  4. package/dist/a11y-checker.cjs.js +12 -12
  5. package/dist/a11y-checker.esm.js +80 -98
  6. package/dist/anchor.cjs.js +12 -12
  7. package/dist/anchor.esm.js +115 -128
  8. package/dist/anchoredPopover-BzqGPOAE.js +1 -0
  9. package/dist/anchoredPopover-Dts0IrgU.mjs +106 -0
  10. package/dist/approval-workflow.cjs.js +40 -40
  11. package/dist/approval-workflow.esm.js +208 -249
  12. package/dist/background-color.cjs.js +2 -2
  13. package/dist/background-color.esm.js +55 -68
  14. package/dist/blockquote.esm.js +1 -2
  15. package/dist/blocks-library.cjs.js +45 -45
  16. package/dist/blocks-library.esm.js +178 -245
  17. package/dist/capitalization.esm.js +1 -2
  18. package/dist/checklist.cjs.js +1 -1
  19. package/dist/checklist.esm.js +58 -82
  20. package/dist/citations.cjs.js +37 -37
  21. package/dist/citations.esm.js +439 -512
  22. package/dist/clear-formatting.cjs.js +1 -1
  23. package/dist/clear-formatting.esm.js +27 -33
  24. package/dist/code-sample.cjs.js +14 -14
  25. package/dist/code-sample.esm.js +82 -93
  26. package/dist/code.cjs.js +119 -42
  27. package/dist/code.esm.js +2560 -760
  28. package/dist/comments.cjs.js +6 -6
  29. package/dist/comments.esm.js +116 -158
  30. package/dist/conditional-content.cjs.js +90 -90
  31. package/dist/conditional-content.esm.js +371 -432
  32. package/dist/content-rules.cjs.js +7 -7
  33. package/dist/content-rules.esm.js +105 -159
  34. package/dist/data-binding.cjs.js +46 -46
  35. package/dist/data-binding.esm.js +328 -368
  36. package/dist/direction.esm.js +9 -18
  37. package/dist/doc-schema.cjs.js +29 -29
  38. package/dist/doc-schema.esm.js +240 -308
  39. package/dist/document-manager.cjs.js +1 -1
  40. package/dist/document-manager.esm.js +4 -5
  41. package/dist/documentManager-CTqRftU8.mjs +8369 -0
  42. package/dist/documentManager-Jf0RbSks.js +17 -0
  43. package/dist/{editorContainerHelpers-69585c07.mjs → editorContainerHelpers-C7kdWnS0.mjs} +1 -2
  44. package/dist/embed-iframe.cjs.js +4 -4
  45. package/dist/embed-iframe.esm.js +73 -81
  46. package/dist/emojis.cjs.js +8 -8
  47. package/dist/emojis.esm.js +65 -77
  48. package/dist/enterprise.cjs.js +1 -1
  49. package/dist/enterprise.esm.js +54 -56
  50. package/dist/font-family.cjs.js +1 -1
  51. package/dist/font-family.esm.js +39 -47
  52. package/dist/font-size.cjs.js +1 -1
  53. package/dist/font-size.esm.js +37 -53
  54. package/dist/footnote.cjs.js +2 -2
  55. package/dist/footnote.esm.js +76 -117
  56. package/dist/history.cjs.js +1 -1
  57. package/dist/history.esm.js +70 -92
  58. package/dist/html2canvas.esm-B5qzocYs.js +5 -0
  59. package/dist/{html2canvas.esm-1a1724a1.mjs → html2canvas.esm-BWVIUcAF.mjs} +141 -225
  60. package/dist/indent.cjs.js +1 -1
  61. package/dist/indent.esm.js +12 -24
  62. package/dist/{index-f04538f2.mjs → index-BFsKNTTj.mjs} +70 -71
  63. package/dist/index-CvJk4DKa.js +221 -0
  64. package/dist/index-D3CycEFU.mjs +16543 -0
  65. package/dist/index-tqLTHcO6.js +1 -0
  66. package/dist/index.cjs.js +1 -1
  67. package/dist/index.es-CE_A4QSm.js +5 -0
  68. package/dist/index.es-DQ78mYYo.mjs +6665 -0
  69. package/dist/index.esm.js +125 -128
  70. package/dist/italic.cjs.js +1 -1
  71. package/dist/italic.esm.js +8 -9
  72. package/dist/jspdf.es.min-BoS80556.js +77 -0
  73. package/dist/{jspdf.es.min-c36a4fd8.mjs → jspdf.es.min-DQCoX5yh.mjs} +3658 -4682
  74. package/dist/line-height.cjs.js +1 -1
  75. package/dist/line-height.esm.js +11 -24
  76. package/dist/link.cjs.js +5 -5
  77. package/dist/link.esm.js +24 -30
  78. package/dist/list.cjs.js +1 -1
  79. package/dist/list.esm.js +20 -25
  80. package/dist/lite.cjs.js +1 -1
  81. package/dist/lite.esm.js +59 -61
  82. package/dist/math.cjs.js +21 -21
  83. package/dist/math.esm.js +139 -146
  84. package/dist/media-manager.cjs.js +31 -31
  85. package/dist/media-manager.esm.js +285 -300
  86. package/dist/mentions.cjs.js +9 -9
  87. package/dist/mentions.esm.js +238 -286
  88. package/dist/merge-tag.cjs.js +2 -2
  89. package/dist/merge-tag.esm.js +177 -216
  90. package/dist/page-break.cjs.js +2 -2
  91. package/dist/page-break.esm.js +33 -49
  92. package/dist/pii-redaction.cjs.js +19 -19
  93. package/dist/pii-redaction.esm.js +393 -463
  94. package/dist/plugins.css +1 -0
  95. package/dist/preview.esm.js +5 -10
  96. package/dist/print.cjs.js +4 -4
  97. package/dist/print.esm.js +17 -20
  98. package/dist/{purify.es-35a15df8.mjs → purify.es-DHhaBdbu.mjs} +9 -19
  99. package/dist/{purify.es-a8d731c6.js → purify.es-T2a3nLiC.js} +1 -1
  100. package/dist/slash-commands.cjs.js +2 -2
  101. package/dist/slash-commands.esm.js +39 -75
  102. package/dist/smart-paste.cjs.js +27 -27
  103. package/dist/smart-paste.esm.js +280 -336
  104. package/dist/special-characters.cjs.js +7 -7
  105. package/dist/special-characters.esm.js +61 -69
  106. package/dist/spell-check.cjs.js +5 -5
  107. package/dist/spell-check.esm.js +97 -123
  108. package/dist/strikethrough.cjs.js +1 -1
  109. package/dist/strikethrough.esm.js +14 -19
  110. package/dist/table.cjs.js +4 -4
  111. package/dist/table.esm.js +191 -225
  112. package/dist/template.cjs.js +21 -20
  113. package/dist/template.esm.js +715 -196
  114. package/dist/text-alignment.cjs.js +1 -1
  115. package/dist/text-alignment.esm.js +21 -27
  116. package/dist/text-color.cjs.js +3 -3
  117. package/dist/text-color.esm.js +70 -87
  118. package/dist/track-changes.cjs.js +2 -2
  119. package/dist/track-changes.esm.js +100 -162
  120. package/dist/translation-workflow.cjs.js +74 -74
  121. package/dist/translation-workflow.esm.js +602 -678
  122. package/dist/version-diff.cjs.js +14 -14
  123. package/dist/version-diff.esm.js +128 -157
  124. package/package.json +1 -1
  125. package/dist/_commonjsHelpers-6763f629.js +0 -1
  126. package/dist/_commonjsHelpers-c5d32002.mjs +0 -30
  127. package/dist/anchoredPopover-33f1358d.mjs +0 -109
  128. package/dist/anchoredPopover-8151d535.js +0 -1
  129. package/dist/documentManager-25b6203c.mjs +0 -9122
  130. package/dist/documentManager-b69e7054.js +0 -17
  131. package/dist/html2canvas.esm-09133e29.js +0 -22
  132. package/dist/index-656d224b.js +0 -231
  133. package/dist/index-6a8c48bb.js +0 -1
  134. package/dist/index-d027b7e2.mjs +0 -16859
  135. package/dist/index.es-730f2d98.mjs +0 -5775
  136. package/dist/index.es-dd40173b.js +0 -18
  137. package/dist/jspdf.es.min-90db2c97.js +0 -243
  138. package/dist/style.css +0 -1
  139. /package/dist/{editorContainerHelpers-36b8ddf3.js → editorContainerHelpers-CFbfiOJI.js} +0 -0
@@ -0,0 +1 @@
1
+ .rte-table,table{border-collapse:collapse;width:100%;margin:1rem 0;border:1px solid #ddd;font-size:14px;line-height:1.4;position:relative}.rte-table td,.rte-table th,table td,table th{border:1px solid #ddd;padding:8px 12px;min-width:80px;vertical-align:top;position:relative;-webkit-user-select:none;user-select:none}.rte-table td:focus,.rte-table th:focus,table td:focus,table th:focus{outline:2px solid #007acc;outline-offset:-2px}.rte-table th,table th{background-color:#f8f9fa;font-weight:600;text-align:left}.rte-table td p,table td p{margin:0;padding:0}.rte-table td p:empty:before,table td p:empty:before{content:"​";display:inline-block}.rte-table td[contenteditable]:empty:before,table td[contenteditable]:empty:before{content:"Type here...";color:#999;font-style:italic;pointer-events:none}.rte-table tr:hover,table tr:hover{background-color:#f8f9fa}.rte-table td.selected,table td.selected{background-color:#e3f2fd;border-color:#2196f3}.table-toolbar{background:#fff;border:1px solid #d0d0d0;border-radius:4px;box-shadow:0 2px 8px #0000001a;padding:4px;display:flex;align-items:center;gap:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;min-width:max-content}.toolbar-section{display:flex;align-items:center;gap:2px}.toolbar-divider{width:1px;height:20px;background:#e0e0e0;margin:0 4px}.toolbar-icon-btn{display:flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid transparent;background:transparent;cursor:pointer;color:#333;border-radius:3px;transition:all .2s ease;flex-shrink:0;font-size:14px;line-height:1}.toolbar-icon-btn svg{width:16px;height:16px}.toolbar-icon-btn:hover:not(:disabled){background:#f0f0f0;border-color:#d0d0d0;color:#06c}.toolbar-icon-btn:active:not(:disabled){background:#e8f0ff;border-color:#06c;transform:scale(.95)}.toolbar-icon-btn:disabled{opacity:.4;cursor:not-allowed;color:#ccc}.toolbar-icon-btn-danger{color:#d32f2f}.toolbar-icon-btn-danger:hover:not(:disabled){background:#fff3f3;border-color:#fcc;color:#d32f2f}.toolbar-icon-btn-danger:active:not(:disabled){background:#ffebee}.toolbar-icon-btn-delete{color:#d32f2f}.toolbar-icon-btn-delete:hover:not(:disabled){background:#fff3f3;border-color:#fcc;color:#d32f2f}.toolbar-icon-btn-delete:active:not(:disabled){background:#ffebee}.resize-handle{opacity:0;transition:all .15s ease}.resize-handle:hover{opacity:1}td:hover>.resize-handle,th:hover>.resize-handle{opacity:1}.table-resize-handle{position:absolute;bottom:-4px;right:-4px;width:12px;height:12px;background:transparent;cursor:nwse-resize;z-index:10;transition:background .15s ease}.table-resize-handle:after{content:"";position:absolute;bottom:0;right:0;width:8px;height:8px;background:#0066cc4d;border-bottom:2px solid #0066cc;border-right:2px solid #0066cc;border-radius:0 0 2px;opacity:0;transition:opacity .15s ease}.table-resize-handle:hover:after{opacity:1}.rte-table:hover .table-resize-handle:after,table:hover .table-resize-handle:after{opacity:1}:is([data-theme=dark],.dark,.editora-theme-dark) :is(.rte-table,table){border-color:#607088;background:#24303c;color:#e6eefb}:is([data-theme=dark],.dark,.editora-theme-dark) :is(.rte-table td,.rte-table th,table td,table th){border-color:#607088;color:#e6eefb}:is([data-theme=dark],.dark,.editora-theme-dark) :is(.rte-table th,table th){background:linear-gradient(180deg,#3b4553,#333d4a);color:#f3f8ff}:is([data-theme=dark],.dark,.editora-theme-dark) :is(.rte-table tr:hover,table tr:hover){background-color:#58a6ff1f}:is([data-theme=dark],.dark,.editora-theme-dark) :is(.rte-table td.selected,table td.selected){background-color:#58a6ff47;border-color:#79beff}:is([data-theme=dark],.dark,.editora-theme-dark) :is(.rte-table td[contenteditable]:empty:before,table td[contenteditable]:empty:before){color:#94a3b8}:is([data-theme=dark],.dark,.editora-theme-dark) .table-toolbar{background:linear-gradient(180deg,#2f3844,#2a323c);border-color:#4d596b;box-shadow:0 8px 20px #00000073}.table-toolbar.rte-theme-dark{background:linear-gradient(180deg,#2f3844,#2a323c);border-color:#4d596b;box-shadow:0 8px 20px #00000073}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-divider{background:#4d596b}.table-toolbar.rte-theme-dark .toolbar-divider{background:#4d596b}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn{color:#d7deea;border-color:transparent}.table-toolbar.rte-theme-dark .toolbar-icon-btn{color:#d7deea;border-color:transparent}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg{color:currentColor;fill:currentColor}.table-toolbar.rte-theme-dark .toolbar-icon-btn svg{color:currentColor;fill:currentColor}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg [stroke="#000" i],:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg [stroke="#000000" i],:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg [stroke=black i]{stroke:currentColor!important}.table-toolbar.rte-theme-dark .toolbar-icon-btn svg [stroke="#000" i],.table-toolbar.rte-theme-dark .toolbar-icon-btn svg [stroke="#000000" i],.table-toolbar.rte-theme-dark .toolbar-icon-btn svg [stroke=black i]{stroke:currentColor!important}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg [fill="#000" i],:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg [fill="#000000" i],:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg [fill=black i]{fill:currentColor!important}.table-toolbar.rte-theme-dark .toolbar-icon-btn svg [fill="#000" i],.table-toolbar.rte-theme-dark .toolbar-icon-btn svg [fill="#000000" i],.table-toolbar.rte-theme-dark .toolbar-icon-btn svg [fill=black i]{fill:currentColor!important}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn:hover:not(:disabled){background:#3a4554;border-color:#607088;color:#f3f8ff}.table-toolbar.rte-theme-dark .toolbar-icon-btn:hover:not(:disabled){background:#3a4554;border-color:#607088;color:#f3f8ff}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn:active:not(:disabled){background:#4a95de;border-color:#67adf4;color:#0f1b2a}.table-toolbar.rte-theme-dark .toolbar-icon-btn:active:not(:disabled){background:#4a95de;border-color:#67adf4;color:#0f1b2a}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn:disabled{color:#7f8ca1}.table-toolbar.rte-theme-dark .toolbar-icon-btn:disabled{color:#7f8ca1}@media(max-width:768px){.rte-table,table{font-size:12px}.rte-table td,.rte-table th,table td,table th{padding:4px 6px;min-width:60px}.table-toolbar{padding:3px;gap:0;max-width:90vw;overflow-x:auto}.toolbar-icon-btn{width:26px;height:26px}.toolbar-divider{height:18px}}@media print{.rte-table,table{border:1px solid #000}.rte-table td,.rte-table th,table td,table th{border:1px solid #000;padding:4px}.table-toolbar{display:none}}
@@ -1,10 +1,8 @@
1
1
  let c = !1;
2
2
  const g = () => {
3
- if (typeof document > "u")
4
- return;
3
+ if (typeof document > "u") return;
5
4
  const i = "rte-preview-plugin-styles";
6
- if (document.getElementById(i))
7
- return;
5
+ if (document.getElementById(i)) return;
8
6
  const t = document.createElement("style");
9
7
  t.id = i, t.textContent = `
10
8
  /* Preview Editor Dialog Styles */
@@ -244,14 +242,12 @@ const g = () => {
244
242
  if (t.getAttribute("contenteditable") === "true")
245
243
  return t;
246
244
  const e = t.closest('[contenteditable="true"]');
247
- if (e)
248
- return e;
245
+ if (e) return e;
249
246
  }
250
247
  return document.querySelector('[contenteditable="true"]');
251
248
  }, h = () => {
252
249
  const i = v();
253
- if (!i)
254
- return "";
250
+ if (!i) return "";
255
251
  const t = i.cloneNode(!0);
256
252
  return [
257
253
  ".rte-floating-toolbar",
@@ -272,8 +268,7 @@ const g = () => {
272
268
  }), r.setAttribute("contenteditable", "false");
273
269
  }), t.innerHTML;
274
270
  }, u = () => {
275
- if (typeof window > "u" || c)
276
- return;
271
+ if (typeof window > "u" || c) return;
277
272
  c = !0, g();
278
273
  const i = h(), t = w(i), e = document.createElement("div");
279
274
  e.className = "rte-preview-editor-overlay", e.setAttribute("role", "dialog"), e.setAttribute("aria-modal", "true"), e.setAttribute("aria-labelledby", "preview-editor-title");
package/dist/print.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=()=>`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=()=>`
2
2
  * {
3
3
  margin: 0;
4
4
  padding: 0;
@@ -238,17 +238,17 @@
238
238
  page-break-inside: avoid;
239
239
  }
240
240
  }
241
- `,c=()=>{var d;if(typeof window>"u")return!1;const a=(()=>{const i=window.getSelection();if(i&&i.rangeCount>0){let t=i.getRangeAt(0).startContainer;for(;t&&t!==document.body;){if(t.nodeType===Node.ELEMENT_NODE){const l=t;if(l.getAttribute("contenteditable")==="true")return l}t=t.parentNode}}const n=document.activeElement;if(n){if(n.getAttribute("contenteditable")==="true")return n;const t=n.closest('[contenteditable="true"]');if(t)return t}return document.querySelector('[contenteditable="true"]')})();if(!a)return console.warn("Editor content not found"),!1;const p=a.cloneNode(!0),r=document.createElement("article");r.className="rte-document rte-print",r.appendChild(p);const s=`
241
+ `,l=()=>{if(typeof window>"u")return!1;const a=(()=>{const i=window.getSelection();if(i&&i.rangeCount>0){let t=i.getRangeAt(0).startContainer;for(;t&&t!==document.body;){if(t.nodeType===Node.ELEMENT_NODE){const d=t;if(d.getAttribute("contenteditable")==="true")return d}t=t.parentNode}}const n=document.activeElement;if(n){if(n.getAttribute("contenteditable")==="true")return n;const t=n.closest('[contenteditable="true"]');if(t)return t}return document.querySelector('[contenteditable="true"]')})();if(!a)return console.warn("Editor content not found"),!1;const c=a.cloneNode(!0),r=document.createElement("article");r.className="rte-document rte-print",r.appendChild(c);const p=`
242
242
  <!DOCTYPE html>
243
243
  <html>
244
244
  <head>
245
245
  <meta charset="UTF-8">
246
246
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
247
247
  <title>Print Document</title>
248
- <style>${g()}</style>
248
+ <style>${s()}</style>
249
249
  </head>
250
250
  <body>
251
251
  ${r.outerHTML}
252
252
  </body>
253
253
  </html>
254
- `,e=document.createElement("iframe");e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0",e.style.height="0",document.body.appendChild(e);const o=e.contentDocument||((d=e.contentWindow)==null?void 0:d.document);return o?(o.open(),o.write(s),o.close(),setTimeout(()=>{e.contentWindow&&(e.contentWindow.print(),setTimeout(()=>{document.body.removeChild(e)},100))},250),!0):(console.error("Could not access print frame document"),document.body.removeChild(e),!1)},m=()=>({name:"print",toolbar:[{label:"Print",command:"print",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><path d="M7 9V4h10v5M6 18h12v-4H6v4Zm0 0v2h12v-2M6 9H5a2 2 0 0 0-2 2v3h3m12-5h1a2 2 0 0 1 2 2v3h-3" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>',shortcut:"Mod-p"}],commands:{print:c},keymap:{"Mod-p":()=>(c(),!0)}});exports.PrintPlugin=m;
254
+ `,e=document.createElement("iframe");e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0",e.style.height="0",document.body.appendChild(e);const o=e.contentDocument||e.contentWindow?.document;return o?(o.open(),o.write(p),o.close(),setTimeout(()=>{e.contentWindow&&(e.contentWindow.print(),setTimeout(()=>{document.body.removeChild(e)},100))},250),!0):(console.error("Could not access print frame document"),document.body.removeChild(e),!1)},g=()=>({name:"print",toolbar:[{label:"Print",command:"print",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><path d="M7 9V4h10v5M6 18h12v-4H6v4Zm0 0v2h12v-2M6 9H5a2 2 0 0 0-2 2v3h3m12-5h1a2 2 0 0 1 2 2v3h-3" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>',shortcut:"Mod-p"}],commands:{print:l},keymap:{"Mod-p":()=>(l(),!0)}});exports.PrintPlugin=g;
package/dist/print.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- const g = () => `
1
+ const s = () => `
2
2
  * {
3
3
  margin: 0;
4
4
  padding: 0;
@@ -238,19 +238,17 @@ const g = () => `
238
238
  page-break-inside: avoid;
239
239
  }
240
240
  }
241
- `, p = () => {
242
- var d;
243
- if (typeof window > "u")
244
- return !1;
241
+ `, l = () => {
242
+ if (typeof window > "u") return !1;
245
243
  const a = (() => {
246
244
  const i = window.getSelection();
247
245
  if (i && i.rangeCount > 0) {
248
246
  let t = i.getRangeAt(0).startContainer;
249
247
  for (; t && t !== document.body; ) {
250
248
  if (t.nodeType === Node.ELEMENT_NODE) {
251
- const l = t;
252
- if (l.getAttribute("contenteditable") === "true")
253
- return l;
249
+ const d = t;
250
+ if (d.getAttribute("contenteditable") === "true")
251
+ return d;
254
252
  }
255
253
  t = t.parentNode;
256
254
  }
@@ -260,23 +258,22 @@ const g = () => `
260
258
  if (n.getAttribute("contenteditable") === "true")
261
259
  return n;
262
260
  const t = n.closest('[contenteditable="true"]');
263
- if (t)
264
- return t;
261
+ if (t) return t;
265
262
  }
266
263
  return document.querySelector('[contenteditable="true"]');
267
264
  })();
268
265
  if (!a)
269
266
  return console.warn("Editor content not found"), !1;
270
- const c = a.cloneNode(!0), r = document.createElement("article");
271
- r.className = "rte-document rte-print", r.appendChild(c);
272
- const s = `
267
+ const p = a.cloneNode(!0), r = document.createElement("article");
268
+ r.className = "rte-document rte-print", r.appendChild(p);
269
+ const c = `
273
270
  <!DOCTYPE html>
274
271
  <html>
275
272
  <head>
276
273
  <meta charset="UTF-8">
277
274
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
278
275
  <title>Print Document</title>
279
- <style>${g()}</style>
276
+ <style>${s()}</style>
280
277
  </head>
281
278
  <body>
282
279
  ${r.outerHTML}
@@ -284,13 +281,13 @@ const g = () => `
284
281
  </html>
285
282
  `, e = document.createElement("iframe");
286
283
  e.style.position = "absolute", e.style.left = "-9999px", e.style.top = "-9999px", e.style.width = "0", e.style.height = "0", document.body.appendChild(e);
287
- const o = e.contentDocument || ((d = e.contentWindow) == null ? void 0 : d.document);
288
- return o ? (o.open(), o.write(s), o.close(), setTimeout(() => {
284
+ const o = e.contentDocument || e.contentWindow?.document;
285
+ return o ? (o.open(), o.write(c), o.close(), setTimeout(() => {
289
286
  e.contentWindow && (e.contentWindow.print(), setTimeout(() => {
290
287
  document.body.removeChild(e);
291
288
  }, 100));
292
289
  }, 250), !0) : (console.error("Could not access print frame document"), document.body.removeChild(e), !1);
293
- }, b = () => ({
290
+ }, m = () => ({
294
291
  name: "print",
295
292
  toolbar: [
296
293
  {
@@ -301,12 +298,12 @@ const g = () => `
301
298
  }
302
299
  ],
303
300
  commands: {
304
- print: p
301
+ print: l
305
302
  },
306
303
  keymap: {
307
- "Mod-p": () => (p(), !0)
304
+ "Mod-p": () => (l(), !0)
308
305
  }
309
306
  });
310
307
  export {
311
- b as PrintPlugin
308
+ m as PrintPlugin
312
309
  };
@@ -1,4 +1,3 @@
1
- /*! @license DOMPurify 2.5.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.8/LICENSE */
2
1
  function I(a) {
3
2
  "@babel/helpers - typeof";
4
3
  return I = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
@@ -13,10 +12,8 @@ function Fe(a, n) {
13
12
  }, Fe(a, n);
14
13
  }
15
14
  function zt() {
16
- if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
17
- return !1;
18
- if (typeof Proxy == "function")
19
- return !0;
15
+ if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
16
+ if (typeof Proxy == "function") return !0;
20
17
  try {
21
18
  return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
22
19
  })), !0;
@@ -36,28 +33,22 @@ function M(a) {
36
33
  return Gt(a) || Wt(a) || Bt(a) || $t();
37
34
  }
38
35
  function Gt(a) {
39
- if (Array.isArray(a))
40
- return Ue(a);
36
+ if (Array.isArray(a)) return Ue(a);
41
37
  }
42
38
  function Wt(a) {
43
- if (typeof Symbol < "u" && a[Symbol.iterator] != null || a["@@iterator"] != null)
44
- return Array.from(a);
39
+ if (typeof Symbol < "u" && a[Symbol.iterator] != null || a["@@iterator"] != null) return Array.from(a);
45
40
  }
46
41
  function Bt(a, n) {
47
42
  if (a) {
48
- if (typeof a == "string")
49
- return Ue(a, n);
43
+ if (typeof a == "string") return Ue(a, n);
50
44
  var o = Object.prototype.toString.call(a).slice(8, -1);
51
- if (o === "Object" && a.constructor && (o = a.constructor.name), o === "Map" || o === "Set")
52
- return Array.from(a);
53
- if (o === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))
54
- return Ue(a, n);
45
+ if (o === "Object" && a.constructor && (o = a.constructor.name), o === "Map" || o === "Set") return Array.from(a);
46
+ if (o === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)) return Ue(a, n);
55
47
  }
56
48
  }
57
49
  function Ue(a, n) {
58
50
  (n == null || n > a.length) && (n = a.length);
59
- for (var o = 0, s = new Array(n); o < n; o++)
60
- s[o] = a[o];
51
+ for (var o = 0, s = new Array(n); o < n; o++) s[o] = a[o];
61
52
  return s;
62
53
  }
63
54
  function $t() {
@@ -338,8 +329,7 @@ function _t() {
338
329
  !(ot(e) && (f.tagNameCheck instanceof RegExp && _(f.tagNameCheck, e) || f.tagNameCheck instanceof Function && f.tagNameCheck(e)) && (f.attributeNameCheck instanceof RegExp && _(f.attributeNameCheck, t) || f.attributeNameCheck instanceof Function && f.attributeNameCheck(t)) || // Alternative, second condition checks if it's an `is`-attribute, AND
339
330
  // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
340
331
  t === "is" && f.allowCustomizedBuiltInElements && (f.tagNameCheck instanceof RegExp && _(f.tagNameCheck, r) || f.tagNameCheck instanceof Function && f.tagNameCheck(r)))
341
- )
342
- return !1;
332
+ ) return !1;
343
333
  } else if (!be[t]) {
344
334
  if (!_(_e, L(r, Ge, ""))) {
345
335
  if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Zt(r, "data:") === 0 && Ke[e])) {
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/*! @license DOMPurify 2.5.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.8/LICENSE */function I(a){"@babel/helpers - typeof";return I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},I(a)}function Fe(a,n){return Fe=Object.setPrototypeOf||function(s,c){return s.__proto__=c,s},Fe(a,n)}function zt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function le(a,n,o){return zt()?le=Reflect.construct:le=function(c,g,y){var D=[null];D.push.apply(D,g);var x=Function.bind.apply(c,D),j=new x;return y&&Fe(j,y.prototype),j},le.apply(null,arguments)}function M(a){return Gt(a)||Wt(a)||Bt(a)||$t()}function Gt(a){if(Array.isArray(a))return Ue(a)}function Wt(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function Bt(a,n){if(a){if(typeof a=="string")return Ue(a,n);var o=Object.prototype.toString.call(a).slice(8,-1);if(o==="Object"&&a.constructor&&(o=a.constructor.name),o==="Map"||o==="Set")return Array.from(a);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return Ue(a,n)}}function Ue(a,n){(n==null||n>a.length)&&(n=a.length);for(var o=0,s=new Array(n);o<n;o++)s[o]=a[o];return s}function $t(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function I(a){"@babel/helpers - typeof";return I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},I(a)}function Fe(a,n){return Fe=Object.setPrototypeOf||function(s,c){return s.__proto__=c,s},Fe(a,n)}function zt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function le(a,n,o){return zt()?le=Reflect.construct:le=function(c,g,y){var D=[null];D.push.apply(D,g);var x=Function.bind.apply(c,D),j=new x;return y&&Fe(j,y.prototype),j},le.apply(null,arguments)}function M(a){return Gt(a)||Wt(a)||Bt(a)||$t()}function Gt(a){if(Array.isArray(a))return Ue(a)}function Wt(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function Bt(a,n){if(a){if(typeof a=="string")return Ue(a,n);var o=Object.prototype.toString.call(a).slice(8,-1);if(o==="Object"&&a.constructor&&(o=a.constructor.name),o==="Map"||o==="Set")return Array.from(a);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return Ue(a,n)}}function Ue(a,n){(n==null||n>a.length)&&(n=a.length);for(var o=0,s=new Array(n);o<n;o++)s[o]=a[o];return s}function $t(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var jt=Object.hasOwnProperty,ut=Object.setPrototypeOf,Yt=Object.isFrozen,Xt=Object.getPrototypeOf,Vt=Object.getOwnPropertyDescriptor,E=Object.freeze,b=Object.seal,qt=Object.create,vt=typeof Reflect<"u"&&Reflect,ue=vt.apply,He=vt.construct;ue||(ue=function(n,o,s){return n.apply(o,s)});E||(E=function(n){return n});b||(b=function(n){return n});He||(He=function(n,o){return le(n,M(o))});var Kt=O(Array.prototype.forEach),ft=O(Array.prototype.pop),q=O(Array.prototype.push),se=O(String.prototype.toLowerCase),we=O(String.prototype.toString),ct=O(String.prototype.match),L=O(String.prototype.replace),Zt=O(String.prototype.indexOf),Jt=O(String.prototype.trim),_=O(RegExp.prototype.test),Ce=Qt(TypeError);function O(a){return function(n){for(var o=arguments.length,s=new Array(o>1?o-1:0),c=1;c<o;c++)s[c-1]=arguments[c];return ue(a,n,s)}}function Qt(a){return function(){for(var n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return He(a,o)}}function l(a,n,o){var s;o=(s=o)!==null&&s!==void 0?s:se,ut&&ut(a,null);for(var c=n.length;c--;){var g=n[c];if(typeof g=="string"){var y=o(g);y!==g&&(Yt(n)||(n[c]=y),g=y)}a[g]=!0}return a}function U(a){var n=qt(null),o;for(o in a)ue(jt,a,[o])===!0&&(n[o]=a[o]);return n}function ie(a,n){for(;a!==null;){var o=Vt(a,n);if(o){if(o.get)return O(o.get);if(typeof o.value=="function")return O(o.value)}a=Xt(a)}function s(c){return console.warn("fallback value for",c),null}return s}var mt=E(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ie=E(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),xe=E(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),er=E(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ke=E(["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"]),tr=E(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pt=E(["#text"]),dt=E(["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"]),Pe=E(["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"]),Tt=E(["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"]),oe=E(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rr=b(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ar=b(/<%[\w\W]*|[\w\W]*%>/gm),nr=b(/\${[\w\W]*}/gm),ir=b(/^data-[\-\w.\u00B7-\uFFFF]+$/),or=b(/^aria-[\-\w]+$/),lr=b(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),sr=b(/^(?:\w+script|data):/i),ur=b(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fr=b(/^html$/i),cr=b(/^[a-z][.\w]*(-[.\w]+)+$/i),mr=function(){return typeof window>"u"?null:window},pr=function(n,o){if(I(n)!=="object"||typeof n.createPolicy!="function")return null;var s=null,c="data-tt-policy-suffix";o.currentScript&&o.currentScript.hasAttribute(c)&&(s=o.currentScript.getAttribute(c));var g="dompurify"+(s?"#"+s:"");try{return n.createPolicy(g,{createHTML:function(D){return D},createScriptURL:function(D){return D}})}catch{return console.warn("TrustedTypes policy "+g+" could not be created."),null}};function _t(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mr(),n=function(e){return _t(e)};if(n.version="2.5.8",n.removed=[],!a||!a.document||a.document.nodeType!==9)return n.isSupported=!1,n;var o=a.document,s=a.document,c=a.DocumentFragment,g=a.HTMLTemplateElement,y=a.Node,D=a.Element,x=a.NodeFilter,j=a.NamedNodeMap,ht=j===void 0?a.NamedNodeMap||a.MozNamedAttrMap:j,Et=a.HTMLFormElement,At=a.DOMParser,K=a.trustedTypes,Z=D.prototype,yt=ie(Z,"cloneNode"),gt=ie(Z,"nextSibling"),St=ie(Z,"childNodes"),fe=ie(Z,"parentNode");if(typeof g=="function"){var ce=s.createElement("template");ce.content&&ce.content.ownerDocument&&(s=ce.content.ownerDocument)}var R=pr(K,o),me=R?R.createHTML(""):"",J=s,pe=J.implementation,bt=J.createNodeIterator,Ot=J.createDocumentFragment,Rt=J.getElementsByTagName,Lt=o.importNode,ze={};try{ze=U(s).documentMode?s.documentMode:{}}catch{}var N={};n.isSupported=typeof fe=="function"&&pe&&pe.createHTMLDocument!==void 0&&ze!==9;var de=rr,Te=ar,ve=nr,Mt=ir,Dt=or,Nt=sr,Ge=ur,wt=cr,_e=lr,p=null,We=l({},[].concat(M(mt),M(Ie),M(xe),M(ke),M(pt))),d=null,Be=l({},[].concat(M(dt),M(Pe),M(Tt),M(oe))),f=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Y=null,he=null,$e=!0,Ee=!0,je=!1,Ye=!0,H=!1,Ae=!0,k=!1,ye=!1,ge=!1,z=!1,Q=!1,ee=!1,Xe=!0,Ve=!1,Ct="user-content-",Se=!0,X=!1,G={},W=null,qe=l({},["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"]),Ke=null,Ze=l({},["audio","video","img","source","image","track"]),be=null,Je=l({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),te="http://www.w3.org/1998/Math/MathML",re="http://www.w3.org/2000/svg",w="http://www.w3.org/1999/xhtml",B=w,Oe=!1,Re=null,It=l({},[te,re,w],we),P,xt=["application/xhtml+xml","text/html"],kt="text/html",T,$=null,Pt=s.createElement("form"),Qe=function(e){return e instanceof RegExp||e instanceof Function},Le=function(e){$&&$===e||((!e||I(e)!=="object")&&(e={}),e=U(e),P=xt.indexOf(e.PARSER_MEDIA_TYPE)===-1?P=kt:P=e.PARSER_MEDIA_TYPE,T=P==="application/xhtml+xml"?we:se,p="ALLOWED_TAGS"in e?l({},e.ALLOWED_TAGS,T):We,d="ALLOWED_ATTR"in e?l({},e.ALLOWED_ATTR,T):Be,Re="ALLOWED_NAMESPACES"in e?l({},e.ALLOWED_NAMESPACES,we):It,be="ADD_URI_SAFE_ATTR"in e?l(U(Je),e.ADD_URI_SAFE_ATTR,T):Je,Ke="ADD_DATA_URI_TAGS"in e?l(U(Ze),e.ADD_DATA_URI_TAGS,T):Ze,W="FORBID_CONTENTS"in e?l({},e.FORBID_CONTENTS,T):qe,Y="FORBID_TAGS"in e?l({},e.FORBID_TAGS,T):{},he="FORBID_ATTR"in e?l({},e.FORBID_ATTR,T):{},G="USE_PROFILES"in e?e.USE_PROFILES:!1,$e=e.ALLOW_ARIA_ATTR!==!1,Ee=e.ALLOW_DATA_ATTR!==!1,je=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ye=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,H=e.SAFE_FOR_TEMPLATES||!1,Ae=e.SAFE_FOR_XML!==!1,k=e.WHOLE_DOCUMENT||!1,z=e.RETURN_DOM||!1,Q=e.RETURN_DOM_FRAGMENT||!1,ee=e.RETURN_TRUSTED_TYPE||!1,ge=e.FORCE_BODY||!1,Xe=e.SANITIZE_DOM!==!1,Ve=e.SANITIZE_NAMED_PROPS||!1,Se=e.KEEP_CONTENT!==!1,X=e.IN_PLACE||!1,_e=e.ALLOWED_URI_REGEXP||_e,B=e.NAMESPACE||w,f=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Qe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(f.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Qe(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),H&&(Ee=!1),Q&&(z=!0),G&&(p=l({},M(pt)),d=[],G.html===!0&&(l(p,mt),l(d,dt)),G.svg===!0&&(l(p,Ie),l(d,Pe),l(d,oe)),G.svgFilters===!0&&(l(p,xe),l(d,Pe),l(d,oe)),G.mathMl===!0&&(l(p,ke),l(d,Tt),l(d,oe))),e.ADD_TAGS&&(p===We&&(p=U(p)),l(p,e.ADD_TAGS,T)),e.ADD_ATTR&&(d===Be&&(d=U(d)),l(d,e.ADD_ATTR,T)),e.ADD_URI_SAFE_ATTR&&l(be,e.ADD_URI_SAFE_ATTR,T),e.FORBID_CONTENTS&&(W===qe&&(W=U(W)),l(W,e.FORBID_CONTENTS,T)),Se&&(p["#text"]=!0),k&&l(p,["html","head","body"]),p.table&&(l(p,["tbody"]),delete Y.tbody),E&&E(e),$=e)},et=l({},["mi","mo","mn","ms","mtext"]),tt=l({},["annotation-xml"]),Ft=l({},["title","style","font","a","script"]),ae=l({},Ie);l(ae,xe),l(ae,er);var Me=l({},ke);l(Me,tr);var Ut=function(e){var t=fe(e);(!t||!t.tagName)&&(t={namespaceURI:B,tagName:"template"});var r=se(e.tagName),u=se(t.tagName);return Re[e.namespaceURI]?e.namespaceURI===re?t.namespaceURI===w?r==="svg":t.namespaceURI===te?r==="svg"&&(u==="annotation-xml"||et[u]):!!ae[r]:e.namespaceURI===te?t.namespaceURI===w?r==="math":t.namespaceURI===re?r==="math"&&tt[u]:!!Me[r]:e.namespaceURI===w?t.namespaceURI===re&&!tt[u]||t.namespaceURI===te&&!et[u]?!1:!Me[r]&&(Ft[r]||!ae[r]):!!(P==="application/xhtml+xml"&&Re[e.namespaceURI]):!1},S=function(e){q(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch{try{e.outerHTML=me}catch{e.remove()}}},ne=function(e,t){try{q(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch{q(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is"&&!d[e])if(z||Q)try{S(t)}catch{}else try{t.setAttribute(e,"")}catch{}},rt=function(e){var t,r;if(ge)e="<remove></remove>"+e;else{var u=ct(e,/^[\r\n\t ]+/);r=u&&u[0]}P==="application/xhtml+xml"&&B===w&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var A=R?R.createHTML(e):e;if(B===w)try{t=new At().parseFromString(A,P)}catch{}if(!t||!t.documentElement){t=pe.createDocument(B,"template",null);try{t.documentElement.innerHTML=Oe?me:A}catch{}}var h=t.body||t.documentElement;return e&&r&&h.insertBefore(s.createTextNode(r),h.childNodes[0]||null),B===w?Rt.call(t,k?"html":"body")[0]:k?t.documentElement:h},at=function(e){return bt.call(e.ownerDocument||e,e,x.SHOW_ELEMENT|x.SHOW_COMMENT|x.SHOW_TEXT|x.SHOW_PROCESSING_INSTRUCTION|x.SHOW_CDATA_SECTION,null,!1)},De=function(e){return e instanceof Et&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof ht)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},V=function(e){return I(y)==="object"?e instanceof y:e&&I(e)==="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string"},C=function(e,t,r){N[e]&&Kt(N[e],function(u){u.call(n,t,r,$)})},nt=function(e){var t;if(C("beforeSanitizeElements",e,null),De(e)||_(/[\u0080-\uFFFF]/,e.nodeName))return S(e),!0;var r=T(e.nodeName);if(C("uponSanitizeElement",e,{tagName:r,allowedTags:p}),e.hasChildNodes()&&!V(e.firstElementChild)&&(!V(e.content)||!V(e.content.firstElementChild))&&_(/<[/\w]/g,e.innerHTML)&&_(/<[/\w]/g,e.textContent)||r==="select"&&_(/<template/i,e.innerHTML)||e.nodeType===7||Ae&&e.nodeType===8&&_(/<[/\w]/g,e.data))return S(e),!0;if(!p[r]||Y[r]){if(!Y[r]&&ot(r)&&(f.tagNameCheck instanceof RegExp&&_(f.tagNameCheck,r)||f.tagNameCheck instanceof Function&&f.tagNameCheck(r)))return!1;if(Se&&!W[r]){var u=fe(e)||e.parentNode,A=St(e)||e.childNodes;if(A&&u)for(var h=A.length,v=h-1;v>=0;--v){var F=yt(A[v],!0);F.__removalCount=(e.__removalCount||0)+1,u.insertBefore(F,gt(e))}}return S(e),!0}return e instanceof D&&!Ut(e)||(r==="noscript"||r==="noembed"||r==="noframes")&&_(/<\/no(script|embed|frames)/i,e.innerHTML)?(S(e),!0):(H&&e.nodeType===3&&(t=e.textContent,t=L(t,de," "),t=L(t,Te," "),t=L(t,ve," "),e.textContent!==t&&(q(n.removed,{element:e.cloneNode()}),e.textContent=t)),C("afterSanitizeElements",e,null),!1)},it=function(e,t,r){if(Xe&&(t==="id"||t==="name")&&(r in s||r in Pt))return!1;if(!(Ee&&!he[t]&&_(Mt,t))){if(!($e&&_(Dt,t))){if(!d[t]||he[t]){if(!(ot(e)&&(f.tagNameCheck instanceof RegExp&&_(f.tagNameCheck,e)||f.tagNameCheck instanceof Function&&f.tagNameCheck(e))&&(f.attributeNameCheck instanceof RegExp&&_(f.attributeNameCheck,t)||f.attributeNameCheck instanceof Function&&f.attributeNameCheck(t))||t==="is"&&f.allowCustomizedBuiltInElements&&(f.tagNameCheck instanceof RegExp&&_(f.tagNameCheck,r)||f.tagNameCheck instanceof Function&&f.tagNameCheck(r))))return!1}else if(!be[t]){if(!_(_e,L(r,Ge,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&Zt(r,"data:")===0&&Ke[e])){if(!(je&&!_(Nt,L(r,Ge,"")))){if(r)return!1}}}}}}return!0},ot=function(e){return e!=="annotation-xml"&&ct(e,wt)},lt=function(e){var t,r,u,A;C("beforeSanitizeAttributes",e,null);var h=e.attributes;if(!(!h||De(e))){var v={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:d};for(A=h.length;A--;){t=h[A];var F=t,m=F.name,Ne=F.namespaceURI;if(r=m==="value"?t.value:Jt(t.value),u=T(m),v.attrName=u,v.attrValue=r,v.keepAttr=!0,v.forceKeepAttr=void 0,C("uponSanitizeAttribute",e,v),r=v.attrValue,!v.forceKeepAttr&&(ne(m,e),!!v.keepAttr)){if(!Ye&&_(/\/>/i,r)){ne(m,e);continue}H&&(r=L(r,de," "),r=L(r,Te," "),r=L(r,ve," "));var st=T(e.nodeName);if(it(st,u,r)){if(Ve&&(u==="id"||u==="name")&&(ne(m,e),r=Ct+r),Ae&&_(/((--!?|])>)|<\/(style|title)/i,r)){ne(m,e);continue}if(R&&I(K)==="object"&&typeof K.getAttributeType=="function"&&!Ne)switch(K.getAttributeType(st,u)){case"TrustedHTML":{r=R.createHTML(r);break}case"TrustedScriptURL":{r=R.createScriptURL(r);break}}try{Ne?e.setAttributeNS(Ne,m,r):e.setAttribute(m,r),De(e)?S(e):ft(n.removed)}catch{}}}}C("afterSanitizeAttributes",e,null)}},Ht=function i(e){var t,r=at(e);for(C("beforeSanitizeShadowDOM",e,null);t=r.nextNode();)C("uponSanitizeShadowNode",t,null),nt(t),lt(t),t.content instanceof c&&i(t.content);C("afterSanitizeShadowDOM",e,null)};return n.sanitize=function(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t,r,u,A,h;if(Oe=!i,Oe&&(i="<!-->"),typeof i!="string"&&!V(i))if(typeof i.toString=="function"){if(i=i.toString(),typeof i!="string")throw Ce("dirty is not a string, aborting")}else throw Ce("toString is not a function");if(!n.isSupported){if(I(a.toStaticHTML)==="object"||typeof a.toStaticHTML=="function"){if(typeof i=="string")return a.toStaticHTML(i);if(V(i))return a.toStaticHTML(i.outerHTML)}return i}if(ye||Le(e),n.removed=[],typeof i=="string"&&(X=!1),X){if(i.nodeName){var v=T(i.nodeName);if(!p[v]||Y[v])throw Ce("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof y)t=rt("<!---->"),r=t.ownerDocument.importNode(i,!0),r.nodeType===1&&r.nodeName==="BODY"||r.nodeName==="HTML"?t=r:t.appendChild(r);else{if(!z&&!H&&!k&&i.indexOf("<")===-1)return R&&ee?R.createHTML(i):i;if(t=rt(i),!t)return z?null:ee?me:""}t&&ge&&S(t.firstChild);for(var F=at(X?i:t);u=F.nextNode();)u.nodeType===3&&u===A||(nt(u),lt(u),u.content instanceof c&&Ht(u.content),A=u);if(A=null,X)return i;if(z){if(Q)for(h=Ot.call(t.ownerDocument);t.firstChild;)h.appendChild(t.firstChild);else h=t;return(d.shadowroot||d.shadowrootmod)&&(h=Lt.call(o,h,!0)),h}var m=k?t.outerHTML:t.innerHTML;return k&&p["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&_(fr,t.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
3
3
  `+m),H&&(m=L(m,de," "),m=L(m,Te," "),m=L(m,ve," ")),R&&ee?R.createHTML(m):m},n.setConfig=function(i){Le(i),ye=!0},n.clearConfig=function(){$=null,ye=!1},n.isValidAttribute=function(i,e,t){$||Le({});var r=T(i),u=T(e);return it(r,u,t)},n.addHook=function(i,e){typeof e=="function"&&(N[i]=N[i]||[],q(N[i],e))},n.removeHook=function(i){if(N[i])return ft(N[i])},n.removeHooks=function(i){N[i]&&(N[i]=[])},n.removeAllHooks=function(){N={}},n}var dr=_t();exports.default=dr;
@@ -84,7 +84,7 @@
84
84
  ${u} .rte-slash-empty {
85
85
  color: #9ca3af;
86
86
  }
87
- `,document.head.appendChild(e)}const s=".rte-content, .editora-content",g=new WeakMap,p=new WeakMap;let b=!1,f=null,h=0,z=0;function P(e){return e?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null}function I(e){return e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||e}function _(e){if((e==null?void 0:e.contentElement)instanceof HTMLElement)return e.contentElement;if((e==null?void 0:e.editorElement)instanceof HTMLElement){const n=e.editorElement;if(n.matches(s))return n;const r=n.querySelector(s);if(r instanceof HTMLElement)return r}const t=window.getSelection();if(t&&t.rangeCount>0){const n=t.getRangeAt(0).startContainer,r=n.nodeType===Node.ELEMENT_NODE?n:n.parentElement,i=r==null?void 0:r.closest(s);if(i)return i}const o=document.activeElement;if(o){if(o.matches(s))return o;const n=o.closest(s);if(n)return n}return document.querySelector(s)}function m(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function F(e){return e?/\s|[([{"'`]/.test(e):!0}function v(e){const t=window.getSelection();if(!t||t.rangeCount===0)return null;const o=t.getRangeAt(0);return e.contains(o.commonAncestorContainer)?o.cloneRange():null}function y(e,t){const o=window.getSelection();o&&(o.removeAllRanges(),o.addRange(t),e.focus({preventScroll:!0}))}function j(e){if(!e.collapsed)return null;const t=e.startContainer,o=e.startOffset;if(t.nodeType===Node.TEXT_NODE){const n=t;return{node:n,textBefore:n.data.slice(0,o),caretOffset:o}}if(t.nodeType===Node.ELEMENT_NODE){const n=t;if(o>0){const r=n.childNodes[o-1];if(r&&r.nodeType===Node.TEXT_NODE){const i=r;return{node:i,textBefore:i.data,caretOffset:i.length}}}}return null}function K(e,t,o,n){const r=e.lastIndexOf(t);if(r<0||n&&!F(e[r-1]))return null;const i=e.slice(r+1);return/\s/.test(i)||i.length>o?null:{trigger:t,query:i,startOffset:r}}function Q(e,t){const o=t.cloneRange();o.collapse(!1);const n=o.getClientRects();if(n.length>0)return n[n.length-1];const r=document.createElement("span");r.textContent="​",o.insertNode(r);const i=r.getBoundingClientRect();return r.remove(),e.normalize(),i}function A(e,t){if(!e.panel)return;const o=Q(e.editor,t),n=e.panel;n.style.display="block",n.classList.add("show"),n.style.left="0px",n.style.top="0px";const r=n.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight;let l=Math.max(8,Math.min(o.left,i-r.width-8)),d=o.bottom+8;d+r.height>a-8&&(d=Math.max(8,o.top-r.height-8)),n.style.position="fixed",n.style.left=`${l}px`,n.style.top=`${d}px`}function k(e,t){if(!t)return m(e);const o=e.toLowerCase(),n=t.toLowerCase(),r=o.indexOf(n);if(r<0)return m(e);const i=m(e.slice(0,r)),a=m(e.slice(r,r+t.length)),l=m(e.slice(r+t.length));return`${i}<mark>${a}</mark>${l}`}function U(e,t){if(e.panel&&e.list)return;const o=document.createElement("div");o.className="rte-slash-panel",o.style.display="none",o.setAttribute("role","dialog"),o.setAttribute("aria-modal","false");const n=document.createElement("div");n.className="rte-slash-list",n.setAttribute("role","listbox"),n.setAttribute("aria-label",t.panelLabel),o.appendChild(n),document.body.appendChild(o),e.panel=o,e.list=n,o.addEventListener("mousedown",r=>{r.preventDefault()}),o.addEventListener("click",r=>{const i=r.target;if(!i)return;const a=i.closest(".rte-slash-item");if(!a)return;const l=Number(a.getAttribute("data-index"));Number.isFinite(l)&&M(e,l)})}function c(e){e.panel&&(e.panel.style.display="none",e.panel.classList.remove("show"),e.isOpen=!1,e.filteredItems=[],e.activeIndex=0,e.query="",e.replaceRange=null,e.anchorRange=null)}function W(e,t,o){if(!t)return e.slice(0,o);const n=t.toLowerCase();return e.filter(i=>[i.id,i.label,i.description||"",i.command||"",...i.keywords||[]].join(" ").toLowerCase().includes(n)).slice(0,o)}function Z(e,t){if(!e.list)return;const o=e.list;if(o.innerHTML="",e.filteredItems.length===0){const n=document.createElement("div");n.className="rte-slash-empty",n.textContent=t.emptyStateText,o.appendChild(n),o.removeAttribute("aria-activedescendant");return}e.filteredItems.forEach((n,r)=>{const i=document.createElement("button");i.type="button",i.className="rte-slash-item",i.setAttribute("role","option"),i.setAttribute("data-index",String(r)),i.setAttribute("id",`rte-slash-item-${e.instanceId}-${r}`),i.setAttribute("aria-selected",r===e.activeIndex?"true":"false"),i.setAttribute("aria-label",n.description?`${n.label} - ${n.description}`:n.label),r===e.activeIndex&&i.classList.add("active"),t.itemRenderer?i.innerHTML=t.itemRenderer(n,e.query):i.innerHTML=`
87
+ `,document.head.appendChild(e)}const s=".rte-content, .editora-content",g=new WeakMap,p=new WeakMap;let b=!1,f=null,h=0,z=0;function P(e){return e?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null}function I(e){return e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||e}function _(e){if(e?.contentElement instanceof HTMLElement)return e.contentElement;if(e?.editorElement instanceof HTMLElement){const n=e.editorElement;if(n.matches(s))return n;const r=n.querySelector(s);if(r instanceof HTMLElement)return r}const t=window.getSelection();if(t&&t.rangeCount>0){const n=t.getRangeAt(0).startContainer,i=(n.nodeType===Node.ELEMENT_NODE?n:n.parentElement)?.closest(s);if(i)return i}const o=document.activeElement;if(o){if(o.matches(s))return o;const n=o.closest(s);if(n)return n}return document.querySelector(s)}function m(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function F(e){return e?/\s|[([{"'`]/.test(e):!0}function v(e){const t=window.getSelection();if(!t||t.rangeCount===0)return null;const o=t.getRangeAt(0);return e.contains(o.commonAncestorContainer)?o.cloneRange():null}function y(e,t){const o=window.getSelection();o&&(o.removeAllRanges(),o.addRange(t),e.focus({preventScroll:!0}))}function j(e){if(!e.collapsed)return null;const t=e.startContainer,o=e.startOffset;if(t.nodeType===Node.TEXT_NODE){const n=t;return{node:n,textBefore:n.data.slice(0,o),caretOffset:o}}if(t.nodeType===Node.ELEMENT_NODE){const n=t;if(o>0){const r=n.childNodes[o-1];if(r&&r.nodeType===Node.TEXT_NODE){const i=r;return{node:i,textBefore:i.data,caretOffset:i.length}}}}return null}function K(e,t,o,n){const r=e.lastIndexOf(t);if(r<0||n&&!F(e[r-1]))return null;const i=e.slice(r+1);return/\s/.test(i)||i.length>o?null:{trigger:t,query:i,startOffset:r}}function Q(e,t){const o=t.cloneRange();o.collapse(!1);const n=o.getClientRects();if(n.length>0)return n[n.length-1];const r=document.createElement("span");r.textContent="​",o.insertNode(r);const i=r.getBoundingClientRect();return r.remove(),e.normalize(),i}function A(e,t){if(!e.panel)return;const o=Q(e.editor,t),n=e.panel;n.style.display="block",n.classList.add("show"),n.style.left="0px",n.style.top="0px";const r=n.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight;let l=Math.max(8,Math.min(o.left,i-r.width-8)),d=o.bottom+8;d+r.height>a-8&&(d=Math.max(8,o.top-r.height-8)),n.style.position="fixed",n.style.left=`${l}px`,n.style.top=`${d}px`}function k(e,t){if(!t)return m(e);const o=e.toLowerCase(),n=t.toLowerCase(),r=o.indexOf(n);if(r<0)return m(e);const i=m(e.slice(0,r)),a=m(e.slice(r,r+t.length)),l=m(e.slice(r+t.length));return`${i}<mark>${a}</mark>${l}`}function U(e,t){if(e.panel&&e.list)return;const o=document.createElement("div");o.className="rte-slash-panel",o.style.display="none",o.setAttribute("role","dialog"),o.setAttribute("aria-modal","false");const n=document.createElement("div");n.className="rte-slash-list",n.setAttribute("role","listbox"),n.setAttribute("aria-label",t.panelLabel),o.appendChild(n),document.body.appendChild(o),e.panel=o,e.list=n,o.addEventListener("mousedown",r=>{r.preventDefault()}),o.addEventListener("click",r=>{const i=r.target;if(!i)return;const a=i.closest(".rte-slash-item");if(!a)return;const l=Number(a.getAttribute("data-index"));Number.isFinite(l)&&M(e,l)})}function c(e){e.panel&&(e.panel.style.display="none",e.panel.classList.remove("show"),e.isOpen=!1,e.filteredItems=[],e.activeIndex=0,e.query="",e.replaceRange=null,e.anchorRange=null)}function W(e,t,o){if(!t)return e.slice(0,o);const n=t.toLowerCase();return e.filter(i=>[i.id,i.label,i.description||"",i.command||"",...i.keywords||[]].join(" ").toLowerCase().includes(n)).slice(0,o)}function Z(e,t){if(!e.list)return;const o=e.list;if(o.innerHTML="",e.filteredItems.length===0){const n=document.createElement("div");n.className="rte-slash-empty",n.textContent=t.emptyStateText,o.appendChild(n),o.removeAttribute("aria-activedescendant");return}e.filteredItems.forEach((n,r)=>{const i=document.createElement("button");i.type="button",i.className="rte-slash-item",i.setAttribute("role","option"),i.setAttribute("data-index",String(r)),i.setAttribute("id",`rte-slash-item-${e.instanceId}-${r}`),i.setAttribute("aria-selected",r===e.activeIndex?"true":"false"),i.setAttribute("aria-label",n.description?`${n.label} - ${n.description}`:n.label),r===e.activeIndex&&i.classList.add("active"),t.itemRenderer?i.innerHTML=t.itemRenderer(n,e.query):i.innerHTML=`
88
88
  <span class="rte-slash-item-title">${k(n.label,e.query)}</span>
89
89
  ${n.description?`<span class="rte-slash-item-description">${k(n.description,e.query)}</span>`:""}
90
- `,o.appendChild(i)}),e.filteredItems.length>0&&o.setAttribute("aria-activedescendant",`rte-slash-item-${e.instanceId}-${e.activeIndex}`)}function G(e,t){if(t===e.innerHTML)return;const o=window.execEditorCommand||window.executeEditorCommand;if(typeof o=="function")try{o("recordDomTransaction",e,t,e.innerHTML)}catch{}}function V(e){e.dispatchEvent(new Event("input",{bubbles:!0}))}function L(e,t){e.focus({preventScroll:!0});try{if(document.execCommand("insertHTML",!1,t))return!0}catch{}const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);if(!e.contains(n.commonAncestorContainer))return!1;n.deleteContents();const r=document.createElement("template");r.innerHTML=t;const i=r.content,a=i.lastChild;if(n.insertNode(i),a){const l=document.createRange();l.setStartAfter(a),l.collapse(!0),y(e,l)}return!0}function X(e,t){e.focus({preventScroll:!0});try{if(document.execCommand("insertText",!1,t))return!0}catch{}const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);if(!e.contains(n.commonAncestorContainer))return!1;n.deleteContents();const r=document.createTextNode(t);n.insertNode(r);const i=document.createRange();return i.setStart(r,r.length),i.collapse(!0),y(e,i),!0}function J(e,t){switch(e.toLowerCase()){case"paragraph":case"p":return document.execCommand("formatBlock",!1,"<p>");case"heading1":case"h1":return document.execCommand("formatBlock",!1,"<h1>");case"heading2":case"h2":return document.execCommand("formatBlock",!1,"<h2>");case"heading3":case"h3":return document.execCommand("formatBlock",!1,"<h3>");case"blockquote":case"toggleblockquote":return document.execCommand("formatBlock",!1,"<blockquote>");case"bulletlist":case"togglebulletlist":case"insertunorderedlist":return document.execCommand("insertUnorderedList");case"numberedlist":case"toggleorderedlist":case"insertorderedlist":return document.execCommand("insertOrderedList");case"horizontalrule":case"divider":case"inserthorizontalrule":return document.execCommand("insertHorizontalRule");case"bold":case"togglebold":return document.execCommand("bold");case"italic":case"toggleitalic":return document.execCommand("italic");case"underline":case"toggleunderline":return document.execCommand("underline");case"strikethrough":case"togglestrikethrough":return document.execCommand("strikeThrough");case"clearformatting":case"removeformat":return document.execCommand("removeFormat");default:try{return document.execCommand(e,!1,t)}catch{return!1}}}function S(e,t,o){const n=I(e);if(n&&typeof n.execCommand=="function")try{if(n.execCommand(t,o)!==!1)return!0}catch{}const r=window.execEditorCommand||window.executeEditorCommand;if(typeof r=="function")try{if(r(t,o,{editorElement:n,contentElement:e})!==!1)return!0}catch{}return J(t,o)}async function Y(e,t){const o=e.editor,n=I(o),r={editor:o,editorRoot:n,query:e.query,trigger:e.trigger,executeCommand:(i,a)=>S(o,i,a),insertHTML:i=>L(o,i)};return t.action?await Promise.resolve(t.action(r))!==!1:t.insertHTML?L(o,t.insertHTML):t.command?S(o,t.command,t.commandValue):!1}async function M(e,t){if(t<0||t>=e.filteredItems.length||!e.replaceRange)return;const o=e.filteredItems[t],n=e.editor,r=n.innerHTML,i=`${e.trigger}${e.query}`;if(!window.getSelection())return;const l=e.replaceRange.cloneRange();if(!n.contains(l.commonAncestorContainer))return;l.deleteContents();const d=l.cloneRange();d.collapse(!0),y(n,d);let x=!1;try{x=await Y(e,o)}catch{x=!1}c(e),x?(V(n),G(n,r)):i&&X(n,i),n.focus({preventScroll:!0})}function R(e,t){if(e.filteredItems.length===0)return;const o=e.filteredItems.length;if(e.activeIndex=((e.activeIndex+t)%o+o)%o,!e.list)return;const n=Array.from(e.list.querySelectorAll(".rte-slash-item"));n.forEach((i,a)=>{const l=a===e.activeIndex;i.classList.toggle("active",l),i.setAttribute("aria-selected",l?"true":"false")});const r=n[e.activeIndex];r&&(e.list.setAttribute("aria-activedescendant",r.id),r.scrollIntoView({block:"nearest"}))}function T(e){if(!(!e.isOpen||!e.panel||!e.anchorRange)){if(!e.editor.isConnected){c(e);return}A(e,e.anchorRange)}}function N(e,t,o,n,r,i){U(e,t),e.query=n,e.trigger=r,e.replaceRange=i.cloneRange(),e.anchorRange=o.cloneRange(),e.filteredItems=W(e.items,n,t.maxSuggestions),e.activeIndex=0,e.isOpen=!0,e.panel&&(Z(e,t),A(e,o))}function ee(e,t){const o=e.editor;if(o.getAttribute("contenteditable")==="false"){c(e);return}const n=v(o);if(!n||!n.collapsed){c(e);return}const r=j(n);if(!r){c(e);return}const i=K(r.textBefore,t.triggerChar,t.maxQueryLength,t.requireBoundary);if(!i){c(e);return}if(i.query.length<t.minChars){c(e);return}const a=n.cloneRange();a.setStart(r.node,i.startOffset),a.setEnd(r.node,r.caretOffset),N(e,t,n,i.query,i.trigger,a)}function O(e,t){const o=e.editor;if(o.getAttribute("contenteditable")==="false")return!1;let n=v(o);n||(n=document.createRange(),n.selectNodeContents(o),n.collapse(!1),y(o,n));const r=n.cloneRange();return r.collapse(!0),N(e,t,n,"",t.triggerChar,r),!0}function te(e){return!(e.metaKey||e.ctrlKey)||e.altKey?!1:e.key==="/"||e.code==="Slash"}function ne(e,t){return{editor:e,panel:null,list:null,replaceRange:null,items:t.items,filteredItems:[],activeIndex:0,query:"",trigger:t.triggerChar,isOpen:!1,instanceId:++z,anchorRange:null}}function w(e,t){const o=g.get(e);if(o)return o.items=t.items,o;const n=ne(e,t);return g.set(e,n),n}function re(e){var o;const t=g.get(e);t&&((o=t.panel)!=null&&o.parentNode&&t.panel.parentNode.removeChild(t.panel),g.delete(e))}function C(e,t,o){if(p.has(e))return;const n={input:()=>{ee(t,o)},keydown:r=>{if(t.editor.getAttribute("contenteditable")==="false"){c(t);return}if(!t.isOpen&&te(r)){r.preventDefault(),O(t,o);return}if(t.isOpen){if(r.key==="ArrowDown"){r.preventDefault(),R(t,1);return}if(r.key==="ArrowUp"){r.preventDefault(),R(t,-1);return}if(r.key==="Enter"||r.key==="Tab"){if(t.filteredItems.length===0){r.key==="Tab"&&r.preventDefault(),c(t);return}r.preventDefault(),M(t,t.activeIndex);return}if(r.key==="Escape"){r.preventDefault(),c(t);return}}},blur:()=>{window.setTimeout(()=>{const r=document.activeElement;t.panel&&r&&t.panel.contains(r)||c(t)},0)},mousedown:r=>{if(!t.isOpen||!t.panel)return;const i=r.target;i&&!t.panel.contains(i)&&!e.contains(i)&&c(t)},selectionchange:()=>{if(!t.isOpen)return;const r=v(e);if(!r||!r.collapsed){c(t);return}t.anchorRange=r.cloneRange(),T(t)},reposition:()=>{T(t)}};e.addEventListener("input",n.input),e.addEventListener("keydown",n.keydown),e.addEventListener("blur",n.blur),document.addEventListener("mousedown",n.mousedown,!0),document.addEventListener("selectionchange",n.selectionchange),window.addEventListener("resize",n.reposition,{passive:!0}),window.addEventListener("scroll",n.reposition,!0),p.set(e,n)}function oe(e){const t=p.get(e);t&&(e.removeEventListener("input",t.input),e.removeEventListener("keydown",t.keydown),e.removeEventListener("blur",t.blur),document.removeEventListener("mousedown",t.mousedown,!0),document.removeEventListener("selectionchange",t.selectionchange),window.removeEventListener("resize",t.reposition),window.removeEventListener("scroll",t.reposition,!0),p.delete(e))}function ie(e){b||(b=!0,f=t=>{const o=t.target;if(!(o instanceof Node))return;const n=P(o),r=(n==null?void 0:n.closest(s))||null;if(!r)return;const i=w(r,e);C(r,i,e)},document.addEventListener("focusin",f,!0))}function ae(){!b||!f||(document.removeEventListener("focusin",f,!0),b=!1,f=null)}const le=(e={})=>{B();const t=D(e);return{name:"slashCommands",toolbar:[{id:"slashCommands",label:"Slash Commands",command:"openSlashCommands",icon:'<svg width="24" height="24" focusable="false" aria-hidden="true"><path d="M8.7 20a1 1 0 0 1-.7-.3c-.4-.4-.4-1 0-1.4L15.6 5a1 1 0 0 1 1.4 1.4L9.4 19.7a1 1 0 0 1-.7.3Zm7.8 0c-.3 0-.5 0-.7-.3l-1.8-1.8a1 1 0 1 1 1.4-1.4l1.8 1.8a1 1 0 0 1-.7 1.7Zm-9-12a1 1 0 0 1-.7-1.7L8.6 4.5A1 1 0 1 1 10 6L8.2 7.8a1 1 0 0 1-.7.3Z"></path></svg>'}],commands:{openSlashCommands:(o,n)=>{const r=_(n);if(!r)return!1;const i=w(r,t);return C(r,i,t),O(i,t)}},keymap:{"Mod-/":"openSlashCommands","Mod-Shift-7":"openSlashCommands"},init:()=>{h+=1,ie(t),Array.from(document.querySelectorAll(s)).forEach(n=>{const r=w(n,t);C(n,r,t)})},destroy:()=>{h=Math.max(0,h-1),Array.from(document.querySelectorAll(s)).forEach(n=>{const r=g.get(n);r&&(c(r),oe(n),re(n))}),h===0&&ae()}}};exports.SlashCommandsPlugin=le;
90
+ `,o.appendChild(i)}),e.filteredItems.length>0&&o.setAttribute("aria-activedescendant",`rte-slash-item-${e.instanceId}-${e.activeIndex}`)}function G(e,t){if(t===e.innerHTML)return;const o=window.execEditorCommand||window.executeEditorCommand;if(typeof o=="function")try{o("recordDomTransaction",e,t,e.innerHTML)}catch{}}function V(e){e.dispatchEvent(new Event("input",{bubbles:!0}))}function L(e,t){e.focus({preventScroll:!0});try{if(document.execCommand("insertHTML",!1,t))return!0}catch{}const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);if(!e.contains(n.commonAncestorContainer))return!1;n.deleteContents();const r=document.createElement("template");r.innerHTML=t;const i=r.content,a=i.lastChild;if(n.insertNode(i),a){const l=document.createRange();l.setStartAfter(a),l.collapse(!0),y(e,l)}return!0}function X(e,t){e.focus({preventScroll:!0});try{if(document.execCommand("insertText",!1,t))return!0}catch{}const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);if(!e.contains(n.commonAncestorContainer))return!1;n.deleteContents();const r=document.createTextNode(t);n.insertNode(r);const i=document.createRange();return i.setStart(r,r.length),i.collapse(!0),y(e,i),!0}function J(e,t){switch(e.toLowerCase()){case"paragraph":case"p":return document.execCommand("formatBlock",!1,"<p>");case"heading1":case"h1":return document.execCommand("formatBlock",!1,"<h1>");case"heading2":case"h2":return document.execCommand("formatBlock",!1,"<h2>");case"heading3":case"h3":return document.execCommand("formatBlock",!1,"<h3>");case"blockquote":case"toggleblockquote":return document.execCommand("formatBlock",!1,"<blockquote>");case"bulletlist":case"togglebulletlist":case"insertunorderedlist":return document.execCommand("insertUnorderedList");case"numberedlist":case"toggleorderedlist":case"insertorderedlist":return document.execCommand("insertOrderedList");case"horizontalrule":case"divider":case"inserthorizontalrule":return document.execCommand("insertHorizontalRule");case"bold":case"togglebold":return document.execCommand("bold");case"italic":case"toggleitalic":return document.execCommand("italic");case"underline":case"toggleunderline":return document.execCommand("underline");case"strikethrough":case"togglestrikethrough":return document.execCommand("strikeThrough");case"clearformatting":case"removeformat":return document.execCommand("removeFormat");default:try{return document.execCommand(e,!1,t)}catch{return!1}}}function S(e,t,o){const n=I(e);if(n&&typeof n.execCommand=="function")try{if(n.execCommand(t,o)!==!1)return!0}catch{}const r=window.execEditorCommand||window.executeEditorCommand;if(typeof r=="function")try{if(r(t,o,{editorElement:n,contentElement:e})!==!1)return!0}catch{}return J(t,o)}async function Y(e,t){const o=e.editor,n=I(o),r={editor:o,editorRoot:n,query:e.query,trigger:e.trigger,executeCommand:(i,a)=>S(o,i,a),insertHTML:i=>L(o,i)};return t.action?await Promise.resolve(t.action(r))!==!1:t.insertHTML?L(o,t.insertHTML):t.command?S(o,t.command,t.commandValue):!1}async function M(e,t){if(t<0||t>=e.filteredItems.length||!e.replaceRange)return;const o=e.filteredItems[t],n=e.editor,r=n.innerHTML,i=`${e.trigger}${e.query}`;if(!window.getSelection())return;const l=e.replaceRange.cloneRange();if(!n.contains(l.commonAncestorContainer))return;l.deleteContents();const d=l.cloneRange();d.collapse(!0),y(n,d);let x=!1;try{x=await Y(e,o)}catch{x=!1}c(e),x?(V(n),G(n,r)):i&&X(n,i),n.focus({preventScroll:!0})}function R(e,t){if(e.filteredItems.length===0)return;const o=e.filteredItems.length;if(e.activeIndex=((e.activeIndex+t)%o+o)%o,!e.list)return;const n=Array.from(e.list.querySelectorAll(".rte-slash-item"));n.forEach((i,a)=>{const l=a===e.activeIndex;i.classList.toggle("active",l),i.setAttribute("aria-selected",l?"true":"false")});const r=n[e.activeIndex];r&&(e.list.setAttribute("aria-activedescendant",r.id),r.scrollIntoView({block:"nearest"}))}function T(e){if(!(!e.isOpen||!e.panel||!e.anchorRange)){if(!e.editor.isConnected){c(e);return}A(e,e.anchorRange)}}function N(e,t,o,n,r,i){U(e,t),e.query=n,e.trigger=r,e.replaceRange=i.cloneRange(),e.anchorRange=o.cloneRange(),e.filteredItems=W(e.items,n,t.maxSuggestions),e.activeIndex=0,e.isOpen=!0,e.panel&&(Z(e,t),A(e,o))}function ee(e,t){const o=e.editor;if(o.getAttribute("contenteditable")==="false"){c(e);return}const n=v(o);if(!n||!n.collapsed){c(e);return}const r=j(n);if(!r){c(e);return}const i=K(r.textBefore,t.triggerChar,t.maxQueryLength,t.requireBoundary);if(!i){c(e);return}if(i.query.length<t.minChars){c(e);return}const a=n.cloneRange();a.setStart(r.node,i.startOffset),a.setEnd(r.node,r.caretOffset),N(e,t,n,i.query,i.trigger,a)}function O(e,t){const o=e.editor;if(o.getAttribute("contenteditable")==="false")return!1;let n=v(o);n||(n=document.createRange(),n.selectNodeContents(o),n.collapse(!1),y(o,n));const r=n.cloneRange();return r.collapse(!0),N(e,t,n,"",t.triggerChar,r),!0}function te(e){return!(e.metaKey||e.ctrlKey)||e.altKey?!1:e.key==="/"||e.code==="Slash"}function ne(e,t){return{editor:e,panel:null,list:null,replaceRange:null,items:t.items,filteredItems:[],activeIndex:0,query:"",trigger:t.triggerChar,isOpen:!1,instanceId:++z,anchorRange:null}}function w(e,t){const o=g.get(e);if(o)return o.items=t.items,o;const n=ne(e,t);return g.set(e,n),n}function re(e){const t=g.get(e);t&&(t.panel?.parentNode&&t.panel.parentNode.removeChild(t.panel),g.delete(e))}function C(e,t,o){if(p.has(e))return;const n={input:()=>{ee(t,o)},keydown:r=>{if(t.editor.getAttribute("contenteditable")==="false"){c(t);return}if(!t.isOpen&&te(r)){r.preventDefault(),O(t,o);return}if(t.isOpen){if(r.key==="ArrowDown"){r.preventDefault(),R(t,1);return}if(r.key==="ArrowUp"){r.preventDefault(),R(t,-1);return}if(r.key==="Enter"||r.key==="Tab"){if(t.filteredItems.length===0){r.key==="Tab"&&r.preventDefault(),c(t);return}r.preventDefault(),M(t,t.activeIndex);return}if(r.key==="Escape"){r.preventDefault(),c(t);return}}},blur:()=>{window.setTimeout(()=>{const r=document.activeElement;t.panel&&r&&t.panel.contains(r)||c(t)},0)},mousedown:r=>{if(!t.isOpen||!t.panel)return;const i=r.target;i&&!t.panel.contains(i)&&!e.contains(i)&&c(t)},selectionchange:()=>{if(!t.isOpen)return;const r=v(e);if(!r||!r.collapsed){c(t);return}t.anchorRange=r.cloneRange(),T(t)},reposition:()=>{T(t)}};e.addEventListener("input",n.input),e.addEventListener("keydown",n.keydown),e.addEventListener("blur",n.blur),document.addEventListener("mousedown",n.mousedown,!0),document.addEventListener("selectionchange",n.selectionchange),window.addEventListener("resize",n.reposition,{passive:!0}),window.addEventListener("scroll",n.reposition,!0),p.set(e,n)}function oe(e){const t=p.get(e);t&&(e.removeEventListener("input",t.input),e.removeEventListener("keydown",t.keydown),e.removeEventListener("blur",t.blur),document.removeEventListener("mousedown",t.mousedown,!0),document.removeEventListener("selectionchange",t.selectionchange),window.removeEventListener("resize",t.reposition),window.removeEventListener("scroll",t.reposition,!0),p.delete(e))}function ie(e){b||(b=!0,f=t=>{const o=t.target;if(!(o instanceof Node))return;const r=P(o)?.closest(s)||null;if(!r)return;const i=w(r,e);C(r,i,e)},document.addEventListener("focusin",f,!0))}function ae(){!b||!f||(document.removeEventListener("focusin",f,!0),b=!1,f=null)}const le=(e={})=>{B();const t=D(e);return{name:"slashCommands",toolbar:[{id:"slashCommands",label:"Slash Commands",command:"openSlashCommands",icon:'<svg width="24" height="24" focusable="false" aria-hidden="true"><path d="M8.7 20a1 1 0 0 1-.7-.3c-.4-.4-.4-1 0-1.4L15.6 5a1 1 0 0 1 1.4 1.4L9.4 19.7a1 1 0 0 1-.7.3Zm7.8 0c-.3 0-.5 0-.7-.3l-1.8-1.8a1 1 0 1 1 1.4-1.4l1.8 1.8a1 1 0 0 1-.7 1.7Zm-9-12a1 1 0 0 1-.7-1.7L8.6 4.5A1 1 0 1 1 10 6L8.2 7.8a1 1 0 0 1-.7.3Z"></path></svg>'}],commands:{openSlashCommands:(o,n)=>{const r=_(n);if(!r)return!1;const i=w(r,t);return C(r,i,t),O(i,t)}},keymap:{"Mod-/":"openSlashCommands","Mod-Shift-7":"openSlashCommands"},init:()=>{h+=1,ie(t),Array.from(document.querySelectorAll(s)).forEach(n=>{const r=w(n,t);C(n,r,t)})},destroy:()=>{h=Math.max(0,h-1),Array.from(document.querySelectorAll(s)).forEach(n=>{const r=g.get(n);r&&(c(r),oe(n),re(n))}),h===0&&ae()}}};exports.SlashCommandsPlugin=le;