@richscripts/richtexteditor 2.13.0 → 2.14.1

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 (86) hide show
  1. package/package.json +1 -1
  2. package/richtexteditor/all_plugins.js +126 -10
  3. package/richtexteditor/all_plugins.min.js +53 -53
  4. package/richtexteditor/plugins/a11yenhance.min.js +1 -0
  5. package/richtexteditor/plugins/accessibilitychecker.min.js +1 -0
  6. package/richtexteditor/plugins/aitoolkit.min.js +14 -0
  7. package/richtexteditor/plugins/all_plugins.js +126 -10
  8. package/richtexteditor/plugins/all_plugins.min.js +53 -53
  9. package/richtexteditor/plugins/autocorrect.min.js +1 -0
  10. package/richtexteditor/plugins/autoembed.min.js +1 -0
  11. package/richtexteditor/plugins/blocktypes.min.js +2 -0
  12. package/richtexteditor/plugins/bookmarkcard.min.js +2 -0
  13. package/richtexteditor/plugins/changecase.min.js +1 -0
  14. package/richtexteditor/plugins/charlimit.min.js +2 -0
  15. package/richtexteditor/plugins/comments.min.js +3 -0
  16. package/richtexteditor/plugins/contentminimap.min.js +1 -0
  17. package/richtexteditor/plugins/crossreference.min.js +1 -0
  18. package/richtexteditor/plugins/dialoga11y.min.js +1 -0
  19. package/richtexteditor/plugins/dictation.min.js +1 -0
  20. package/richtexteditor/plugins/documentimport.min.js +4 -0
  21. package/richtexteditor/plugins/documentoutline.js +54 -6
  22. package/richtexteditor/plugins/documentoutline.min.js +1 -0
  23. package/richtexteditor/plugins/docxexport.min.js +2 -0
  24. package/richtexteditor/plugins/draghandle.min.js +1 -0
  25. package/richtexteditor/plugins/emailtoolkit.min.js +1 -0
  26. package/richtexteditor/plugins/emojiautocomplete.min.js +1 -0
  27. package/richtexteditor/plugins/foldheadings.min.js +1 -0
  28. package/richtexteditor/plugins/footnotes.min.js +1 -0
  29. package/richtexteditor/plugins/formatpainter.min.js +1 -0
  30. package/richtexteditor/plugins/formattingmarks.js +48 -3
  31. package/richtexteditor/plugins/formattingmarks.min.js +1 -0
  32. package/richtexteditor/plugins/gapcursor.min.js +1 -0
  33. package/richtexteditor/plugins/ghostcomplete.min.js +1 -0
  34. package/richtexteditor/plugins/html2pdf.min.js +1 -0
  35. package/richtexteditor/plugins/imageeditor.min.js +1 -0
  36. package/richtexteditor/plugins/importstyles.min.js +1 -0
  37. package/richtexteditor/plugins/inlinecode.min.js +1 -0
  38. package/richtexteditor/plugins/insertcode.min.js +8 -0
  39. package/richtexteditor/plugins/insertemoji.min.js +1 -0
  40. package/richtexteditor/plugins/insertgallery.min.js +1 -0
  41. package/richtexteditor/plugins/inserttemplate.min.js +1 -0
  42. package/richtexteditor/plugins/keyboarda11y.min.js +1 -0
  43. package/richtexteditor/plugins/layouttable.min.js +1 -0
  44. package/richtexteditor/plugins/linenumbers.min.js +1 -0
  45. package/richtexteditor/plugins/linkchecker.min.js +1 -0
  46. package/richtexteditor/plugins/localdraft.min.js +1 -0
  47. package/richtexteditor/plugins/markdownexport.min.js +2 -0
  48. package/richtexteditor/plugins/mathdialog.min.js +1 -0
  49. package/richtexteditor/plugins/mentionplugin.min.js +3 -0
  50. package/richtexteditor/plugins/mergefields.min.js +1 -0
  51. package/richtexteditor/plugins/mermaiddiagram.min.js +16 -0
  52. package/richtexteditor/plugins/multilevellist.min.js +1 -0
  53. package/richtexteditor/plugins/multiroot.min.js +1 -0
  54. package/richtexteditor/plugins/nodetypes.min.js +1 -0
  55. package/richtexteditor/plugins/pagination.min.js +1 -0
  56. package/richtexteditor/plugins/pdfexport.min.js +19 -0
  57. package/richtexteditor/plugins/permanentpen.min.js +1 -0
  58. package/richtexteditor/plugins/readabilitystats.min.js +1 -0
  59. package/richtexteditor/plugins/readaloud.min.js +1 -0
  60. package/richtexteditor/plugins/restrictedediting.min.js +2 -0
  61. package/richtexteditor/plugins/revisionhistory.min.js +3 -0
  62. package/richtexteditor/plugins/rtlui.min.js +2 -0
  63. package/richtexteditor/plugins/rubyannotation.min.js +1 -0
  64. package/richtexteditor/plugins/sanitizer.js +24 -1
  65. package/richtexteditor/plugins/sanitizer.min.js +1 -0
  66. package/richtexteditor/plugins/shadowdom.min.js +1 -0
  67. package/richtexteditor/plugins/slashcommand.min.js +2 -0
  68. package/richtexteditor/plugins/smartchips.min.js +2 -0
  69. package/richtexteditor/plugins/spellcheck.min.js +2 -0
  70. package/richtexteditor/plugins/stateinspector.min.js +2 -0
  71. package/richtexteditor/plugins/structured-content-bridge.js +5178 -0
  72. package/richtexteditor/plugins/structured-content-bridge.min.js +19 -0
  73. package/richtexteditor/plugins/tableofcontents.min.js +1 -0
  74. package/richtexteditor/plugins/tabletools.min.js +1 -0
  75. package/richtexteditor/plugins/textdirection.min.js +1 -0
  76. package/richtexteditor/plugins/textpartlanguage.min.js +1 -0
  77. package/richtexteditor/plugins/todolist.min.js +1 -0
  78. package/richtexteditor/plugins/trackedchanges.min.js +3 -0
  79. package/richtexteditor/plugins/typewriter.min.js +1 -0
  80. package/richtexteditor/plugins/watermark.min.js +1 -0
  81. package/richtexteditor/plugins/wordexport.min.js +23 -0
  82. package/richtexteditor/plugins/yjscollab.min.js +2 -0
  83. package/richtexteditor/plugins/zz_richtextbox_dialog_style.min.js +1 -0
  84. package/richtexteditor/rte-config.js +3 -0
  85. package/richtexteditor/rte.js +5 -2
  86. package/richtexteditor/runtime/colorpicker_more_ns.htm +93 -16
@@ -0,0 +1,2 @@
1
+ window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_slashcommand=RTE_Plugin_SlashCommand;function RTE_Plugin_SlashCommand(){var T=this,d,e,v=null,a=null,g=null,h=[],m=[],p=0,E=!1,R=!1;T.PluginName="SlashCommand",T.InitConfig=function(o){d=o,d.slashCommandEnabled!==!1&&(d.slashCommandTrigger=d.slashCommandTrigger||"/",d.slashCommandMaxItems=d.slashCommandMaxItems||40,d.slashCommandIncludeAi=d.slashCommandIncludeAi!==!1,d.slashCommands=d.slashCommands||null)},T.InitEditor=function(o){if(e=o,d.slashCommandEnabled!==!1){if(e.slashCommands={register:P,remove:te,list:function(){return B(),h.slice()},open:function(){O(!0)},close:f,isOpen:function(){return!!a}},h=N(),Array.isArray(d.slashCommands))for(var t=0;t<d.slashCommands.length;t++)P(d.slashCommands[t]);setTimeout(B,0),he();var n=e.getDocument();n.addEventListener("keydown",re,!0),n.addEventListener("input",ie,!0),n.addEventListener("compositionstart",function(){E=!0}),n.addEventListener("compositionend",function(){E=!1}),n.addEventListener("mousedown",function(){f()},!0),n.addEventListener("blur",function(){setTimeout(f,150)},!0),window.addEventListener("scroll",U,!0),window.addEventListener("resize",U,!0)}};function P(o){if(!(!o||!o.id)){var t=F(o.id);t>=0?h[t]=b(o):h.push(b(o))}}var H={};function B(){if(e){for(var o=[],t=0;t<h.length;t++)h[t]._default||o.push(h[t]);for(var n=N(),i=[],s=0;s<n.length;s++){var l=n[s].id;if(!H[l]){for(var c=!1,r=0;r<o.length;r++)if(o[r].id===l){c=!0;break}c||i.push(n[s])}}h=i.concat(o)}}function te(o){H[o]=!0;var t=F(o);t>=0&&h.splice(t,1)}function F(o){for(var t=0;t<h.length;t++)if(h[t].id===o)return t;return-1}function I(o,t){try{var n=String(o).toLowerCase().replace(/[^a-z0-9_]/g,"_");if(d&&d["text_"+n]&&e&&typeof e.getLangText=="function")return e.getLangText(n)}catch{}return t}function b(o){var t=o.section||"Blocks";return{id:o.id,section:I("slash_section_"+t,t),title:I("slash_"+o.id,o.title||o.id),description:I("slash_"+o.id+"_desc",o.description||""),keywords:(o.keywords||[]).slice(),icon:o.icon||"",iconSvg:o.iconSvg||"",run:o.run||o.action}}var oe={P:1,DIV:1,H1:1,H2:1,H3:1,H4:1,H5:1,H6:1,BLOCKQUOTE:1,PRE:1,LI:1};function ne(){var o=e.getSelection();if(!o||o.rangeCount===0)return null;for(var t=o.getRangeAt(0).startContainer,n=e.getEditable();t&&t!==n;){if(t.nodeType===1&&oe[t.nodeName])return t;t=t.parentNode}return null}function C(o){var t=ne();if(o=o.toUpperCase(),t&&!t.textContent.trim()){var n=e.getDocument(),i=n.createElement(o);i.appendChild(n.createElement("br")),t.parentNode.replaceChild(i,t);var s=n.createRange();s.setStart(i,0),s.setEnd(i,0);var l=e.getSelection();l.removeAllRanges(),l.addRange(s);return}e.execCommand("formatblock",o)}function N(){var o=[];function t(r,u,x,w,k,Qe,Ge){var ee=b({id:u,section:r,title:x,description:w,keywords:k,iconSvg:Qe,run:Ge});ee._default=!0,o.push(ee)}if(t("Blocks","heading1","Heading 1","Large section heading",["h1","title"],S("1"),function(){C("H1")}),t("Blocks","heading2","Heading 2","Medium section heading",["h2","subtitle"],S("2"),function(){C("H2")}),t("Blocks","heading3","Heading 3","Small section heading",["h3"],S("3"),function(){C("H3")}),t("Blocks","paragraph","Paragraph","Plain body text",["p","text","body"],pe(),function(){C("P")}),t("Blocks","bulletlist","Bulleted list","Unordered list",["ul","bullets","list"],fe(),function(){e.execCommand("insertunorderedlist")}),t("Blocks","numberlist","Numbered list","Ordered list",["ol","numbered"],ge(),function(){e.execCommand("insertorderedlist")}),t("Blocks","quote","Quote","Block quotation",["blockquote"],me(),function(){e.execCommand("insertblockquote")}),t("Blocks","code","Code block","Monospaced code block",["pre","snippet"],ve(),function(){e.isCommandEnabled&&e.isCommandEnabled("insertcode")?e.execCommand("insertcode"):e.execCommand("formatblock","PRE")}),t("Blocks","divider","Divider","Horizontal rule",["hr","line","separator"],ke(),function(){e.execCommand("inserthorizontalrule")}),(!e.isCommandEnabled||e.isCommandEnabled("insertcallout"))&&t("Blocks","callout","Callout","Highlighted info / warning box",["admonition","info","warning","note","tip"],Te(),function(){e.execCommand("insertcallout")}),(!e.isCommandEnabled||e.isCommandEnabled("insertcolumns"))&&t("Blocks","columns","Columns","Multi-column layout",["layout","grid","column"],Ee(),function(){e.execCommand("insertcolumns")}),(!e.isCommandEnabled||e.isCommandEnabled("inserttoggle"))&&t("Blocks","toggle","Toggle list","Collapsible toggle block",["collapse","details","accordion","expand"],Be(),function(){e.execCommand("inserttoggle")}),(!e.isCommandEnabled||e.isCommandEnabled("insertmath"))&&t("Insert","equation","Equation","Insert a math equation (TeX)",["math","latex","tex","formula","katex"],Ie(),function(){e.execCommand("insertmath")}),(!e.isCommandEnabled||e.isCommandEnabled("inserttodolist"))&&t("Blocks","todolist","To-do list","Checklist with clickable checkboxes",["task","todo","checklist","checkbox","check"],ze(),function(){e.execCommand("inserttodolist")}),(!e.isCommandEnabled||e.isCommandEnabled("insertdiagram"))&&t("Insert","diagram","Diagram","Insert a Mermaid diagram",["mermaid","flowchart","sequence","gantt","graph","uml"],Se(),function(){e.execCommand("insertdiagram")}),(!e.isCommandEnabled||e.isCommandEnabled("insertbookmark"))&&t("Insert","bookmark","Bookmark","Insert a link preview card",["link","url","embed","preview","card"],Ae(),function(){e.execCommand("insertbookmark")}),(!e.isCommandEnabled||e.isCommandEnabled("spellcheck"))&&t("Tools","spellcheck","Spell check","Check spelling",["spelling","grammar","proofread","typo"],V(),function(){e.execCommand("spellcheck")}),(!e.isCommandEnabled||e.isCommandEnabled("insertdatechip"))&&t("Insert","datechip","Date chip","Insert an interactive date chip",["date","calendar","chip","today"],K(),function(){e.execCommand("insertdatechip")}),(!e.isCommandEnabled||e.isCommandEnabled("insertchip"))&&t("Insert","chip","Smart chip","Insert a date / person / link chip",["chip","person","mention","link","pill"],K(),function(){e.execCommand("insertchip")}),(!e.isCommandEnabled||e.isCommandEnabled("emailexport"))&&t("Tools","emailexport","Export email HTML","Inline-styled HTML for email",["email","inline","mail","newsletter","html"],Le(),function(){e.execCommand("emailexport")}),typeof e.openFindDialog=="function"&&t("Tools","findreplace","Find & replace","Search the document and replace text",["find","replace","search","query","substitute"],_e(),function(){e.openFindDialog()}),typeof e.showShortcuts=="function"&&t("Tools","shortcuts","Keyboard shortcuts","Show the keyboard shortcut cheat sheet (Ctrl+/)",["keyboard","shortcuts","hotkeys","keys","help","cheat"],qe(),function(){e.showShortcuts()}),typeof e.foldAtCaret=="function"&&(t("Tools","foldsection","Fold section","Collapse the section under the current heading",["fold","collapse","heading","outline","section"],J(),function(){e.foldAtCaret()}),t("Tools","unfoldall","Unfold all","Expand every collapsed heading section",["unfold","expand","headings","collapse"],J(),function(){e.unfoldAll&&e.unfoldAll()})),(!e.isCommandEnabled||e.isCommandEnabled("readaloud"))&&t("Tools","readaloud","Read aloud","Speak the selection or document (text-to-speech)",["tts","speak","speech","voice","accessibility","narrate"],W(),function(){e.execCommand("readaloud")}),typeof e.sortTableAtCaret=="function"&&(t("Tools","sorttableasc","Sort table by this column","Sort the table rows by the column the caret is in",["sort","table","column","order","ascending"],D(),function(){e.sortTableAtCaret("asc")}),t("Tools","sorttabledesc","Sort table (descending)","Sort the table rows by this column, largest first",["sort","table","column","descending","reverse"],D(),function(){e.sortTableAtCaret("desc")}),t("Tools","tablerownumbers","Number table rows","Add or remove an automatic row-numbering column",["number","rows","table","count","index"],D(),function(){e.execCommand("tablerownumbers")})),typeof e.setTableLayoutMode=="function"&&(t("Insert","layouttable","Layout table","Insert a borderless table for positioning content (role=presentation)",["layout","table","grid","email","columns","presentation"],y(),function(){e.insertLayoutTable(2,2)}),t("Tools","tablelayoutmode","Mark table as layout","This table only positions content \u2014 stop screen readers announcing it as data",["layout","table","presentation","accessibility","screen reader"],y(),function(){e.setTableLayoutMode("layout")}),t("Tools","tabledatamode","Mark table as data","This table states relationships \u2014 restore its header cells",["data","table","header","accessibility"],y(),function(){e.setTableLayoutMode("data",null,{promoteFirstRow:!0})})),typeof e.moveBlockUp=="function"&&(t("Tools","moveblockup","Move block up","Move this paragraph or block above the previous one (Alt+Shift+Up)",["move","block","up","reorder","drag"],Q(),function(){e.moveBlockUp()}),t("Tools","moveblockdown","Move block down","Move this paragraph or block below the next one (Alt+Shift+Down)",["move","block","down","reorder","drag"],Q(),function(){e.moveBlockDown()})),typeof e.toggleRtlUserInterface=="function"&&t("Tools","rtlui","Mirror editor for RTL","Flip the toolbar, menus and dialogs for right-to-left languages",["rtl","mirror","interface","toolbar","arabic","hebrew"],j(),function(){e.toggleRtlUserInterface()}),typeof e.setTextDirection=="function"&&(t("Tools","rtl","Right-to-left","Set this paragraph to right-to-left (Arabic, Hebrew, Persian)",["rtl","arabic","hebrew","persian","urdu","direction","bidi"],j(),function(){e.setTextDirection("rtl")}),t("Tools","ltr","Left-to-right","Set this paragraph to left-to-right",["ltr","direction","bidi"],je(),function(){e.setTextDirection("ltr")}),t("Tools","autodir","Detect text direction","Set each paragraph's direction from its own content",["direction","detect","auto","rtl","bidi"],j(),function(){e.autoDetectTextDirection()})),typeof e.toggleFormattingMarks=="function"&&t("Tools","formattingmarks","Formatting marks","Show paragraph marks, block outlines and invisible characters",["marks","pilcrow","paragraph","invisible","whitespace","nbsp"],De(),function(){e.toggleFormattingMarks()}),typeof e.toggleWatermark=="function"&&t("Tools","watermark","Watermark","Draw DRAFT or CONFIDENTIAL behind the content",["watermark","draft","confidential","background","stamp"],Re(),function(){e.toggleWatermark()}),typeof e.toggleLineNumbers=="function"&&t("Tools","linenumbers","Line numbers","Number every line in the margin, as pleadings and transcripts require",["line","numbers","margin","pleading","legal","transcript"],Pe(),function(){e.toggleLineNumbers()}),typeof e.togglePermanentPen=="function"&&t("Tools","permanentpen","Permanent pen","Keep typing in a fixed annotation format until switched off",["pen","marker","annotate","highlight","review"],G(),function(){e.togglePermanentPen()}),typeof e.checkLinks=="function"&&t("Tools","checklinks","Check links","Find broken anchors, unsafe schemes and unlabelled links",["link","check","broken","audit","url","accessibility"],He(),function(){e.highlightLinkIssues(!0),e.checkLinks()}),typeof e.getMergeFieldDefinitions=="function"){for(var n=e.getMergeFieldDefinitions(),i=0;i<n.length;i++)(function(r){!r||!r.id||t("Insert","mergefield-"+r.id,r.label||r.id,"Insert the "+(r.label||r.id)+" merge field",["merge","field","placeholder","variable","mail merge",r.id],X(),function(){e.insertMergeField(r.id)})})(n[i]);t("Tools","mergepreview","Preview merge fields","Swap merge-field placeholders for sample data",["merge","preview","sample","data","placeholder"],X(),function(){e.toggleMergeFieldPreview()})}if(typeof e.listCrossReferenceTargets=="function"){var s=[];try{s=e.listCrossReferenceTargets()}catch{s=[]}for(var l=0;l<s.length&&l<40;l++)(function(r){if(!(!r||!r.id)){var u=r.number?r.number+" "+r.label:r.label;t("Insert","xref-"+r.id,"Reference: "+u,"Insert a cross-reference to this "+r.type+" that updates itself",["cross","reference","xref","see","refer",r.type,r.number||""],Y(),function(){e.insertCrossReference(r.id,r.number?"label":"text")})}})(s[l])}if(typeof e.insertTableOfContents=="function"&&t("Insert","toc","Table of contents","Insert a contents block that updates itself from your headings",["toc","contents","outline","index","headings"],Fe(),function(){e.insertTableOfContents()}),typeof e.insertFootnote=="function"&&t("Insert","footnote","Footnote","Insert a numbered footnote reference and note",["footnote","note","citation","reference","endnote","cite"],Ne(),function(){e.insertFootnote()}),typeof e.toggleFormatPainter=="function"&&t("Tools","formatpainter","Format painter","Copy formatting here, then select the text to paint it onto",["format","painter","brush","copy","style","clone"],Oe(),function(){e.toggleFormatPainter()}),typeof e.changeCase=="function"&&(t("Tools","caseupper","UPPERCASE","Convert the selection to upper case",["case","upper","caps","capitals"],M(),function(){e.changeCase("upper")}),t("Tools","caselower","lowercase","Convert the selection to lower case",["case","lower","small"],M(),function(){e.changeCase("lower")}),t("Tools","casetitle","Title Case","Capitalise each significant word in the selection",["case","title","headline","capitalise","capitalize"],M(),function(){e.changeCase("title")}),t("Tools","casesentence","Sentence case","Capitalise the first letter of each sentence",["case","sentence","capitalise","capitalize"],M(),function(){e.changeCase("sentence")})),typeof e.requestGhostText=="function"&&t("Tools","aicomplete","AI complete","Suggest an inline AI completion of the current sentence",["ai","complete","autocomplete","ghost","suggest","continue","copilot"],Ke(),function(){e.requestGhostText()}),typeof e.exportToPdf=="function"&&t("Tools","exportpdf","Export to PDF","Real text, not a screenshot \u2014 selectable, searchable and screen-reader friendly",["pdf","export","download","save","print","text","accessible","searchable"],We(),function(){e.exportToPdf()}),typeof e.exportToDocx=="function"&&t("Tools","exportdocx","Export to Word (.docx)","A real OOXML document, built in the browser with no upload",["word","docx","ooxml","export","download","save","office"],$(),function(){e.exportToDocx()}),typeof e.openImportDialog=="function"&&t("Tools","import-document","Import document","Open a Markdown, HTML, text, or Word file into the editor",["import","open","file","word","docx","markdown","upload"],$(),function(){e.openImportDialog({})}),typeof e.getReadabilityStats=="function"&&t("Tools","readability-stats","Readability statistics","Flesch reading ease, grade level, and reading time",["readability","flesch","grade","reading","stats","score"],V(),function(){e.execCommand("readability")}),typeof e.insertCrossReference=="function"&&t("Insert","crossreference","Cross-reference","Insert a live reference to a heading, figure, table, or bookmark",["cross","reference","xref","see","figure","heading"],Y(),function(){e.execCommand("insertcrossreference")}),e.restrictedEditing&&t("Tools","restrictedediting","Restricted editing","Lock the document and mark only the regions others may edit",["restrict","lock","protect","editable","region","permission"],G(),function(){e.execCommand("restrictedediting")}),e.dictation&&t("Tools","dictation","Dictation","Speak and have your words typed into the document",["dictate","speech","voice","microphone","talk"],W(),function(){e.execCommand("dictation")}),typeof e.copyAsMarkdown=="function"&&(t("Tools","copymarkdown","Copy as Markdown","Copy the whole document to the clipboard as Markdown",["markdown","md","copy","clipboard","export"],Z(),function(){e.copyAsMarkdown()}),t("Tools","downloadmarkdown","Download as Markdown","Save the document as a .md file",["markdown","md","download","export","save","file"],Z(),function(){e.downloadMarkdown()})),typeof e.toggleTypewriterMode=="function"&&(t("Tools","typewriter","Typewriter mode","Keep the caret line centred as you type",["typewriter","center","scroll","focus","distraction","zen"],Ue(),function(){e.toggleTypewriterMode()}),t("Tools","focusmode","Focus mode","Dim everything except the current paragraph",["focus","dim","highlight","distraction","zen","concentrate"],Ve(),function(){e.toggleFocusMode()})),t("Insert","table","Table","Insert a table",["grid","rows","columns"],y(),function(){e.execCommand("inserttable")}),t("Insert","image","Image","Upload or embed an image",["picture","photo","img"],xe(),function(){e.execCommand("imageupload")}),t("Insert","link","Link","Insert a hyperlink",["url","anchor"],we(),function(){e.execCommand("insertlink")}),t("Insert","emoji","Emoji","Insert an emoji",["smiley","icon"],be(),function(){e.execCommand("insertemoji")}),t("Insert","template","Template","Insert from template gallery",["snippet"],Ce(),function(){e.execCommand("inserttemplate")}),t("Insert","date","Today's date","Insert the current date",["time","now"],ye(),function(){e.execCommand("insertdate")}),d.slashCommandIncludeAi&&Array.isArray(d.aiToolkitActions))for(var c=0;c<d.aiToolkitActions.length;c++)(function(r){o.push(b({id:"ai-"+r.id,section:"AI",title:r.title||r.id,description:r.description||"",keywords:["ai",r.id],iconSvg:d["svgCode_aiassist_"+(r.icon||r.id)]||d.svgCode_aiassist||"",run:function(){var u=e.aiToolkit;if(u){if(r.id==="chat-panel"&&typeof u.openChatPanel=="function"){u.openChatPanel();return}if(r.id==="review-panel"&&typeof u.openReviewPanel=="function"){u.openReviewPanel();return}if(r.id==="open-dialog"&&typeof u.openDialog=="function"){u.openDialog();return}if(typeof u.runQuickAction=="function"){u.runQuickAction(r.id);return}typeof u.resolveAction=="function"&&u.resolveAction(r.id)}}}))})(d.aiToolkitActions[c]);return o}function re(o){if(!E){if(a)switch(o.key){case"ArrowDown":o.preventDefault(),o.stopPropagation(),_(1);return;case"ArrowUp":o.preventDefault(),o.stopPropagation(),_(-1);return;case"Enter":case"Tab":if(m.length){o.preventDefault(),o.stopPropagation(),A();return}f();return;case"Escape":case"Esc":o.preventDefault(),o.stopPropagation(),f();return}if(o.key===d.slashCommandTrigger&&!o.ctrlKey&&!o.metaKey&&!o.altKey){if(!ae())return;R=!1,setTimeout(function(){R||O(!1)},0)}}}function ie(){a&&se()}function ae(){var o=e.getSelection();if(!o||o.rangeCount===0||!o.isCollapsed)return!1;for(var t=o.getRangeAt(0),n=t.startContainer,i=t.startOffset,s=e.getEditable(),l=n.nodeType===1?n:n.parentNode;l&&l!==s;){var c=l.nodeName;if(c==="CODE"||c==="PRE")return!1;l=l.parentNode}if(n.nodeType===3){if(i===0)return!0;var r=n.nodeValue.charAt(i-1);return/\s/.test(r)}return!0}function O(o){B(),f();var t=e.getSelection();if(!(!t||t.rangeCount===0)){var n=t.getRangeAt(0).cloneRange();g={range:n,startNode:n.startContainer,startOffset:n.startOffset,triggerCharCount:o?0:1,query:""},le(),L(),z("")}}function f(){a&&a.parentNode&&a.parentNode.removeChild(a),a=null,g=null,m=[],p=0}function se(){if(g){var o=e.getSelection();if(!o||o.rangeCount===0||!o.isCollapsed){f();return}var t=o.getRangeAt(0),n=t.startContainer;if(n!==g.startNode){f();return}var i=t.startOffset;if(i<g.startOffset){f();return}var s=(n.nodeType===3?n.nodeValue:"")||"",l=s.substring(g.startOffset,i);if(/\s/.test(l)){f();return}g.query=l,z(l),L()}}function z(o){var t=(o||"").toLowerCase();m=h.filter(function(n){if(!t||n.title.toLowerCase().indexOf(t)!==-1||n.description&&n.description.toLowerCase().indexOf(t)!==-1)return!0;for(var i=0;i<n.keywords.length;i++)if(String(n.keywords[i]).toLowerCase().indexOf(t)!==-1)return!0;return!1}).slice(0,d.slashCommandMaxItems),p=0,ce()}function le(){v=e.iframe.ownerDocument,a=v.createElement("div"),a.className="rte-slash-popup";try{var o=e.container||e.getEditable&&e.getEditable().closest&&e.getEditable().closest(".richtexteditor");o&&o.classList&&o.classList.contains("rte-dark")&&(a.className+=" rte-slash-popup-dark")}catch{}a.setAttribute("role","listbox"),a.setAttribute("aria-label","Slash commands"),v.body.appendChild(a)}function ce(){if(a){if(a.innerHTML="",!m.length){var o=v.createElement("div");o.className="rte-slash-empty",o.textContent="No matching commands",a.appendChild(o);return}for(var t="",n=0;n<m.length;n++)(function(i,s){if(i.section!==t){var l=v.createElement("div");l.className="rte-slash-section",l.textContent=i.section,a.appendChild(l),t=i.section}var c=v.createElement("button");c.type="button",c.className="rte-slash-item"+(s===p?" rte-slash-item-active":""),c.setAttribute("role","option"),c.setAttribute("aria-selected",s===p?"true":"false"),c.setAttribute("data-index",s);var r=v.createElement("span");r.className="rte-slash-item-icon",r.innerHTML=i.iconSvg||Me(),c.appendChild(r);var u=v.createElement("span");u.className="rte-slash-item-body";var x=v.createElement("span");if(x.className="rte-slash-item-title",x.textContent=i.title,u.appendChild(x),i.description){var w=v.createElement("span");w.className="rte-slash-item-desc",w.textContent=i.description,u.appendChild(w)}c.appendChild(u),c.addEventListener("mousedown",function(k){k.preventDefault(),k.stopPropagation(),p=s,A()}),c.addEventListener("click",function(k){a&&(k.preventDefault(),k.stopPropagation(),p=s,A())}),c.addEventListener("mouseenter",function(){p!==s&&(p=s,q())}),a.appendChild(c)})(m[n],n)}}function q(){if(a){for(var o=a.querySelectorAll(".rte-slash-item"),t=0;t<o.length;t++){var n=+o[t].getAttribute("data-index"),i=n===p;o[t].classList.toggle("rte-slash-item-active",i),o[t].setAttribute("aria-selected",i?"true":"false")}de()}}function de(){if(a){var o=a.querySelector(".rte-slash-item-active");if(o){var t=o.offsetTop,n=t+o.offsetHeight;t<a.scrollTop?a.scrollTop=t:n>a.scrollTop+a.clientHeight&&(a.scrollTop=n-a.clientHeight)}}}function _(o){m.length&&(p=(p+o+m.length)%m.length,q())}function A(){if(!m.length){f();return}var o=m[p],t=g;if(f(),!(!o||!t)){ue(t);var n=e.getDocument();n.activeElement!==e.getEditable()&&!n.hasFocus()&&e.focus();try{o.run(e)}catch(i){console.warn("Slash command failed:",i)}}}function ue(o){var t=o.startNode;if(t){var n=o.startOffset-(o.triggerCharCount||0);n<0&&(n=0);var i=e.getSelection();if(!(!i||i.rangeCount===0)){var s=i.getRangeAt(0),l,c;t.nodeType===3&&s.startContainer===t?(l=t,c=s.startOffset):(l=s.startContainer,c=s.startOffset);var r=e.getDocument().createRange();r.setStart(t,n),r.setEnd(l,c);try{r.deleteContents()}catch{return}i.removeAllRanges(),i.addRange(r)}}}function L(){if(!(!a||!g)){var o=e.iframe,t=o.getBoundingClientRect(),n=g.range.getClientRects(),i=n&&n.length?n[n.length-1]:null;i||(i=g.range.getBoundingClientRect());var s=t.left+(i.left||0)+window.pageXOffset,l=t.top+(i.bottom||i.top||0)+window.pageYOffset+4;a.style.position="absolute",a.style.left=s+"px",a.style.top=l+"px";var c=window.innerHeight||document.documentElement.clientHeight,r=a.getBoundingClientRect();r.bottom>c-8&&t.top+(i.top||0)>r.height+16&&(a.style.top=t.top+(i.top||0)+window.pageYOffset-r.height-4+"px")}}function U(){a&&L()}function he(){var o=e&&e.iframe&&e.iframe.ownerDocument||document;if(!o.querySelector("style[data-rte-slashcommand]")){var t=o.createElement("style");t.setAttribute("data-rte-slashcommand","1"),t.textContent=["/* 2026-07-03 slash command polish */",".rte-slash-popup{position:absolute;z-index:2147483000;min-width:280px;max-width:min(390px,calc(100vw - 24px));max-height:min(360px,64vh);overflow-y:auto;overscroll-behavior:contain;padding:6px;background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(248,251,255,.96));background-clip:padding-box;border:1px solid rgba(148,163,184,.22);box-shadow:0 16px 36px rgba(29,78,216,.14),0 2px 8px rgba(15,23,42,.08);border-radius:8px;font-family:Aptos,'Segoe UI',sans-serif;font-size:13px;color:#172033;scrollbar-width:thin}",".rte-slash-section{position:sticky;top:0;z-index:1;margin:4px 0 2px;padding:6px 8px 4px;background:linear-gradient(180deg,rgba(248,251,255,.98),rgba(248,251,255,.86));color:#52657e;font-size:10px;font-weight:850;letter-spacing:.08em;text-transform:uppercase}",".rte-slash-item{display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;gap:8px;width:100%;min-height:40px;padding:6px 8px;border:0;background:transparent;text-align:left;cursor:pointer;color:inherit;font:inherit;border-radius:8px}",".rte-slash-item:hover,.rte-slash-item-active{background:#eef4ff;color:#1559d6}",".rte-slash-item:focus-visible{outline:2px solid rgba(37,99,235,.22);outline-offset:2px}",".rte-slash-item-icon{flex:0 0 28px;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;color:#315277;background:#ffffff;border-radius:8px;box-shadow:inset 0 0 0 1px rgba(148,163,184,.18)}",".rte-slash-item-active .rte-slash-item-icon{color:#1559d6;background:#ffffff}",".rte-slash-item-icon svg{display:block;width:16px;height:16px;pointer-events:none}",".rte-slash-item-body{display:flex;flex-direction:column;min-width:0;flex:1}",".rte-slash-item-title{font-weight:780;font-size:13px;line-height:1.24;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".rte-slash-item-desc{font-size:11px;color:#64748b;line-height:1.24;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".rte-slash-item-active .rte-slash-item-desc{color:#315277}",".rte-slash-empty{padding:16px;color:#52657e;font-size:12px;font-weight:700;text-align:center}",".rte-slash-popup-dark{background:linear-gradient(180deg,#1e293b,#0f172a);border-color:#334155;color:#e2e8f0;box-shadow:0 20px 46px rgba(0,0,0,.5),0 2px 8px rgba(0,0,0,.4)}",".rte-slash-popup-dark .rte-slash-section{background:linear-gradient(180deg,rgba(30,41,59,.98),rgba(30,41,59,.86));color:#94a3b8}",".rte-slash-popup-dark .rte-slash-item:hover,.rte-slash-popup-dark .rte-slash-item-active{background:#1d4ed8;color:#fff}",".rte-slash-popup-dark .rte-slash-item-icon{color:#cbd5e1;background:#0f172a;box-shadow:inset 0 0 0 1px rgba(148,163,184,.25)}",".rte-slash-popup-dark .rte-slash-item-active .rte-slash-item-icon{color:#fff;background:#1e3a8a}",".rte-slash-popup-dark .rte-slash-item-desc{color:#94a3b8}",".rte-slash-popup-dark .rte-slash-item-active .rte-slash-item-desc{color:#dbeafe}",".rte-slash-popup-dark .rte-slash-empty{color:#94a3b8}"].join(`
2
+ `),o.head.appendChild(t),e&&typeof e.ensureStyleSheetLive=="function"&&e.ensureStyleSheetLive(o,t,"rte-slashcommand-style",t.textContent)}}function S(o){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 4v16"/><path d="M14 4v16"/><path d="M6 12h8"/><text x="16" y="18" font-size="9" font-weight="700" fill="currentColor" stroke="none" font-family="-apple-system,Segoe UI,sans-serif">'+o+"</text></svg>"}function pe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 4h5"/><path d="M13 4v16"/><path d="M17 4v16"/><path d="M13 4a4 4 0 000 8h0"/></svg>'}function fe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="5" cy="7" r="1"/><circle cx="5" cy="12" r="1"/><circle cx="5" cy="17" r="1"/><path d="M9 7h11"/><path d="M9 12h11"/><path d="M9 17h11"/></svg>'}function ge(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h1v3"/><path d="M4 9h2"/><path d="M4 14h2a1 1 0 010 2H4v1h2"/><path d="M9 7h11"/><path d="M9 12h11"/><path d="M9 17h11"/></svg>'}function me(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 8c-2 0-3 1.5-3 4s1 4 3 4V8z"/><path d="M16 8c-2 0-3 1.5-3 4s1 4 3 4V8z"/></svg>'}function ve(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 8l-4 4 4 4"/><path d="M15 8l4 4-4 4"/></svg>'}function ke(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12h16"/><path d="M4 6h10"/><path d="M4 18h10"/></svg>'}function y(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="5" width="16" height="14" rx="1"/><path d="M4 10h16"/><path d="M4 15h16"/><path d="M10 5v14"/><path d="M16 5v14"/></svg>'}function xe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><circle cx="9" cy="10" r="1.5"/><path d="M21 16l-5-5-8 8"/></svg>'}function we(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 14a4 4 0 005.7 0l3-3a4 4 0 10-5.7-5.7L11 7"/><path d="M14 10a4 4 0 00-5.7 0l-3 3a4 4 0 105.7 5.7L13 17"/></svg>'}function be(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M8 14c1 1.5 2.5 2 4 2s3-.5 4-2"/><circle cx="9" cy="10" r=".8"/><circle cx="15" cy="10" r=".8"/></svg>'}function Ce(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M4 9h16"/><path d="M9 9v11"/></svg>'}function ye(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="6" width="16" height="14" rx="1.5"/><path d="M4 10h16"/><path d="M9 3v4"/><path d="M15 3v4"/></svg>'}function Me(){return'<svg viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="12" r="3"/></svg>'}function Te(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M12 9v4"/><path d="M12 16h.01"/></svg>'}function Ee(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="7" height="16" rx="1"/><rect x="14" y="4" width="7" height="16" rx="1"/></svg>'}function Be(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l6 6-6 6"/></svg>'}function Ie(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 5h9l-5 14"/><path d="M14 11h6"/><path d="M14 16h6"/></svg>'}function Ae(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3 10h18"/><circle cx="7" cy="7.5" r=".6" fill="currentColor"/></svg>'}function V(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 17l4-10 4 10"/><path d="M5.5 13.5h5"/><path d="M14 14a2.5 2.5 0 105 0v-3"/><path d="M14 20l2 2 4-4"/></svg>'}function K(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="7" width="18" height="10" rx="5"/><circle cx="8" cy="12" r="1.6"/><path d="M12 12h6"/></svg>'}function Le(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M4 7l8 6 8-6"/></svg>'}function Se(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="6" height="5" rx="1"/><rect x="15" y="3" width="6" height="5" rx="1"/><rect x="9" y="16" width="6" height="5" rx="1"/><path d="M6 8v3h12V8M12 11v5"/></svg>'}function W(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 9v6h4l5 4V5L8 9H4z"/><path d="M16 8.5a4 4 0 010 7"/><path d="M19 6a7 7 0 010 12"/></svg>'}function Q(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3v18"/><path d="M8 7l4-4 4 4"/><path d="M8 17l4 4 4-4"/></svg>'}function j(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6H10a3 3 0 000 6h3"/><path d="M13 6v12"/><path d="M17 6v12"/><path d="M7 18l-3-3 3-3"/></svg>'}function je(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 6H7a3 3 0 000 6h3"/><path d="M11 6v12"/><path d="M7 6v12"/><path d="M17 12l3 3-3 3"/></svg>'}function De(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 4v16"/><path d="M17 4v16"/><path d="M13 4H9a4 4 0 000 8h4"/></svg>'}function Re(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M7 15l4-5 3 3 3-4"/></svg>'}function Pe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h1v4"/><path d="M4 14h2l-2 3h2"/><path d="M10 7h10"/><path d="M10 12h10"/><path d="M10 17h10"/></svg>'}function D(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 4v16"/><path d="M4 8l3-4 3 4"/><path d="M14 6h6"/><path d="M14 12h5"/><path d="M14 18h3"/></svg>'}function G(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3l6 6L9 21H3v-6z"/><path d="M13 5l6 6"/></svg>'}function He(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 13a4 4 0 005.7 0l2-2a4 4 0 10-5.7-5.7l-1 1"/><path d="M13 11a4 4 0 00-5.7 0l-2 2a4 4 0 105.7 5.7l1-1"/><path d="M16 18l2 2 4-4"/></svg>'}function X(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4H7a2 2 0 00-2 2v3a2 2 0 01-2 2 2 2 0 012 2v3a2 2 0 002 2h2"/><path d="M15 4h2a2 2 0 012 2v3a2 2 0 002 2 2 2 0 00-2 2v3a2 2 0 01-2 2h-2"/></svg>'}function Y(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7h8"/><path d="M4 12h5"/><path d="M4 17h8"/><path d="M14 12h6"/><path d="M17 9l3 3-3 3"/></svg>'}function Fe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h7"/><path d="M4 11h9"/><path d="M4 16h5"/><path d="M17 6h3"/><path d="M17 11h3"/><path d="M17 16h3"/></svg>'}function Ne(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h9"/><path d="M4 11h9"/><path d="M4 18h16"/><path d="M17 4v6"/><path d="M20 7h-6"/></svg>'}function Oe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 3h11a2 2 0 012 2v4a2 2 0 01-2 2H6z"/><path d="M12 11v3"/><path d="M10 14h4v5a2 2 0 01-4 0z"/></svg>'}function M(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 18L8 6l5 12"/><path d="M4.6 14.5h6.8"/><path d="M21 11.5a3 3 0 00-6 0"/><path d="M21 11.5V18"/><path d="M21 15.5a3 3 0 11-6 0 3 3 0 016 0z"/></svg>'}function ze(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="7" height="7" rx="1.5"/><path d="M4.5 7.5 6 9l2.5-3"/><line x1="13" y1="6" x2="21" y2="6"/><line x1="13" y1="13" x2="21" y2="13"/><line x1="3" y1="17" x2="21" y2="17"/><line x1="3" y1="20.5" x2="14" y2="20.5"/></svg>'}function J(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l3 3 3-3"/><path d="M9 18l3-3 3 3"/><line x1="4" y1="12" x2="20" y2="12"/></svg>'}function qe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="6" width="20" height="12" rx="2"/><path d="M6 10h.01M10 10h.01M14 10h.01M18 10h.01M6 14h.01M18 14h.01M9 14h6"/></svg>'}function _e(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="10.5" cy="10.5" r="6.5"/><line x1="15.5" y1="15.5" x2="21" y2="21"/></svg>'}function Ue(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="9" width="18" height="7" rx="1"/><path d="M7 9V5h10v4"/><line x1="7" y1="20" x2="17" y2="20"/></svg>'}function Ve(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M3 12h3M18 12h3M12 3v3M12 18v3"/></svg>'}function Z(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="5" width="20" height="14" rx="2"/><path d="M6 15V9l3 3 3-3v6"/><path d="M17 9v6M14.5 12.5L17 15l2.5-2.5"/></svg>'}function Ke(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 21V9a7 7 0 0114 0v12l-3-2-2 2-2-2-2 2-3-2z"/><circle cx="9.5" cy="10" r="1" fill="currentColor"/><circle cx="14.5" cy="10" r="1" fill="currentColor"/></svg>'}function We(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V8z"/><path d="M14 3v5h5"/><path d="M9 13h6M9 17h4"/></svg>'}function $(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V8z"/><path d="M14 3v5h5"/><path d="M8.5 12l1.3 5 2.2-3.6 2.2 3.6 1.3-5"/></svg>'}}
@@ -0,0 +1,2 @@
1
+ window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_smartchips=RTE_Plugin_SmartChips,RTE_DefaultConfig.chipResolver=RTE_DefaultConfig.chipResolver||null,RTE_DefaultConfig.chipDateFormat=RTE_DefaultConfig.chipDateFormat||null;function RTE_Plugin_SmartChips(){var g=this,b,o;g.PluginName="SmartChips",g.InitConfig=function(e){b=e},g.InitEditor=function(e){o=e,o.attachEvent("exec_command_insertdatechip",function(t){t.returnValue=!0,g.OpenDateChip()}),o.attachEvent("exec_command_insertchip",function(t){t.returnValue=!0,g.OpenChipMenu()}),_()};function a(e,t,i,n){var s=e.ownerDocument.createElement(t);return i&&(s.style.cssText=i),n&&(s.className=n),e.appendChild(s),s}function k(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function y(e){if(b.chipDateFormat&&typeof b.chipDateFormat=="function")try{return String(b.chipDateFormat(e))}catch{}return M[e.getMonth()]+" "+e.getDate()+", "+e.getFullYear()}function R(e){function t(i){return(i<10?"0":"")+i}return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())}var A={date:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><rect x="2" y="3" width="12" height="11" rx="1.5"/><path d="M2 6.5h12"/><path d="M5 1.5v3"/><path d="M11 1.5v3"/></svg>',person:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><circle cx="8" cy="5" r="2.6"/><path d="M3 13.5c0-2.5 2.2-4 5-4s5 1.5 5 4"/></svg>',link:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><path d="M6.5 9.5a3 3 0 004.2 0l2-2a3 3 0 10-4.2-4.2L7.4 4.3"/><path d="M9.5 6.5a3 3 0 00-4.2 0l-2 2a3 3 0 104.2 4.2l1-1"/></svg>'};function I(e,t,i,n){var s=A[e]||"",l='class="rte-chip rte-chip-'+k(e)+'" data-rte-chip="'+k(e)+'" data-rte-chip-value="'+k(i||t)+'" contenteditable="false"',u='<span class="rte-chip-icon">'+s+'</span><span class="rte-chip-label">'+k(t)+"</span>";if(e==="link"&&n){var d=/^(javascript|data|vbscript):/i.test(n)?"#":n;return"<a "+l+' href="'+k(d)+'" target="_blank" rel="noopener noreferrer">'+u+"</a>"}return"<span "+l+">"+u+"</span>"}function x(e,t,i,n){_(),o.insertHTML(I(e,t,i,n)+"\u200B"),o.focus()}g.OpenDateChip=function(){var e=o.createDialog(o.getLangText&&o.getLangText("insertdatechiptitle")||"Date","rte-dialog-datechip"),t=typeof e.close=="function"?function(){e.close()}:function(){o.closeCurrentPopup()},i=a(e,"div","","rte-chip-dialog rte-chip-date-dialog");a(i,"div","","rte-chip-dialog-copy").textContent="Choose a quick date or insert a custom date chip.";function n(h,v){var r=a(i,"button","","rte-chip-quick");return r.type="button",r.textContent=h+" \u2014 "+y(v),r.onmouseover=function(){r.style.background="#eef2ff"},r.onmouseout=function(){r.style.background="transparent"},r.textContent="",a(r,"span","","rte-chip-quick-label").textContent=h,a(r,"span","","rte-chip-quick-value").textContent=y(v),r.onmouseover=null,r.onmouseout=null,r.setAttribute("aria-label","Insert "+h+", "+y(v)),r.onclick=function(){t(),x("date",y(v),R(v))},r}var s=new Date(o.__chipNow||Date.now());function l(h,v){var r=new Date(h.getTime());return r.setDate(r.getDate()+v),r}n("Today",s),n("Tomorrow",l(s,1)),n("Yesterday",l(s,-1)),n("Next week",l(s,7));var u=a(i,"div","","rte-chip-pick-row"),d=a(u,"input","","rte-chip-input");d.type="date",d.value=R(s),d.setAttribute("aria-label","Custom date");var C=a(u,"button","","rte-chip-action rte-chip-action-primary");C.type="button",C.textContent="Insert",C.onclick=function(){var h=(d.value||"").split("-");if(h.length===3){var v=new Date(parseInt(h[0],10),parseInt(h[1],10)-1,parseInt(h[2],10));t(),x("date",y(v),d.value)}else t()},setTimeout(function(){d.focus()},0)},g.OpenChipMenu=function(){var e=o.createDialog(o.getLangText&&o.getLangText("insertchiptitle")||"Insert chip","rte-dialog-chip"),t=typeof e.close=="function"?function(){e.close()}:function(){o.closeCurrentPopup()},i=a(e,"div","","rte-chip-dialog rte-chip-menu-dialog");a(i,"div","","rte-chip-dialog-copy").textContent="Insert a date, person, or link chip into the document.";var n=a(i,"div","","rte-chip-type-tabs");n.setAttribute("role","tablist"),n.setAttribute("aria-label","Chip type");var s=[["date","Date"],["person","Person"],["link","Link"]],l="date",u=a(i,"div","","rte-chip-dialog-body"),d={};s.forEach(function(r){var p=a(n,"button","","rte-chip-type-tab");p.type="button",p.textContent=r[1],p.setAttribute("role","tab"),p.setAttribute("aria-selected",r[0]===l?"true":"false"),d[r[0]]=p,p.onclick=function(){l=r[0],C(),h()}});function C(){s.forEach(function(r){var p=r[0]===l;d[r[0]].classList.toggle("is-selected",p),d[r[0]].setAttribute("aria-selected",p?"true":"false")})}function h(){if(u.innerHTML="",l==="date"){var r=a(u,"div","","rte-chip-field-label");r.textContent="Insert a date chip:";var p=a(u,"input","","rte-chip-input");p.type="date",p.value=R(new Date(o.__chipNow||Date.now())),p.setAttribute("aria-label","Date chip value"),v(function(){var c=(p.value||"").split("-");if(c.length===3){var T=new Date(+c[0],+c[1]-1,+c[2]);t(),x("date",y(T),p.value)}})}else{var D=a(u,"div","","rte-chip-field-label");D.textContent=l==="person"?"Name (or search):":"URL:";var f=a(u,"input","","rte-chip-input");f.type=l==="link"?"url":"text",f.placeholder=l==="person"?"Jane Doe":"https://example.com",f.setAttribute("aria-label",l==="person"?"Person chip name":"Link chip URL");var w=a(u,"div","","rte-chip-results");w.setAttribute("role","listbox"),w.setAttribute("aria-label","Chip suggestions"),b.chipResolver&&typeof b.chipResolver=="function"&&(f.oninput=function(){var c=f.value.trim();if(w.innerHTML="",!!c)try{var T=b.chipResolver(c,l);T&&T.then&&T.then(function(L){w.innerHTML="",(L||[]).slice(0,6).forEach(function(m){var E=a(w,"button","","rte-chip-suggestion");E.type="button",E.textContent=m.label||m.value,E.setAttribute("role","option"),E.onclick=function(){t(),x(l,m.label||m.value,m.value||m.label,m.href)}})})}catch{}}),v(function(){var c=f.value.trim();if(!c){t();return}if(l==="link"){if(/^(javascript|data|vbscript|file):/i.test(c)){f.style.borderColor="#dc2626",f.placeholder="Enter a valid http(s) URL",f.value="";return}if(!/^https?:\/\//i.test(c))if(/^[a-z0-9.-]+\.[a-z]{2,}([\/?#].*)?$/i.test(c))c="https://"+c;else{f.style.borderColor="#dc2626",f.placeholder="Enter a valid http(s) URL",f.value="";return}t(),x("link",c.replace(/^https?:\/\//i,"").replace(/\/$/,""),c,c)}else t(),x("person",c,c)}),setTimeout(function(){f.focus()},0)}}function v(r){var p=a(u,"div","","rte-chip-dialog-footer"),D=a(p,"button","","rte-chip-action rte-chip-action-primary");D.type="button",D.textContent="Insert",D.onclick=r}C(),h()};function _(){var e=[".rte-chip{display:inline-flex;align-items:center;gap:4px;padding:2px 8px 2px 6px;margin:0 1px;border:1px solid rgba(100,116,139,.16);border-radius:999px;background:linear-gradient(180deg,#f8fbff,#eef4ff);color:#315277;font-size:.92em;line-height:1.45;white-space:nowrap;text-decoration:none;vertical-align:baseline;cursor:default;user-select:none;box-shadow:0 1px 2px rgba(15,23,42,.06)}",".rte-chip-icon{display:inline-flex;align-items:center;opacity:.9}",".rte-chip-date{background:linear-gradient(180deg,#f0fdff,#e6f8fb);color:#0e7490;border-color:rgba(14,116,144,.18)}",".rte-chip-person{background:linear-gradient(180deg,#f6f7ff,#eef2ff);color:#3730a3;border-color:rgba(55,48,163,.18)}",".rte-chip-link{background:linear-gradient(180deg,#f5fff8,#ecfdf4);color:#15803d;border-color:rgba(21,128,61,.18);cursor:pointer}",".rte-chip-link:hover{text-decoration:underline}"].join(`
2
+ `);try{var t=o.getDocument();if(!t)return;var i=t.head||t.getElementsByTagName&&t.getElementsByTagName("head")[0]||t.documentElement;if(i&&!t.querySelector("style[data-rte-smartchips]")){var n=t.createElement("style");n.setAttribute("data-rte-smartchips","1"),n.textContent=e,i.appendChild(n),o&&typeof o.ensureStyleSheetLive=="function"&&o.ensureStyleSheetLive(t,n,"rte-smartchips-st",n.textContent)}}catch{}}}
@@ -0,0 +1,2 @@
1
+ window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_spellcheck=RTE_Plugin_SpellCheck,RTE_DefaultConfig.spellCheckResolver=RTE_DefaultConfig.spellCheckResolver||null,typeof RTE_DefaultConfig.spellCheckEnabled>"u"&&(RTE_DefaultConfig.spellCheckEnabled=!0);function RTE_Plugin_SpellCheck(){var u=this,s,e;u.PluginName="SpellCheck",u.InitConfig=function(t){s=t},u.InitEditor=function(t){e=t;try{var r=e.getEditable&&e.getEditable();r&&r.setAttribute("spellcheck",s.spellCheckEnabled===!1?"false":"true")}catch{}e.attachEvent("exec_command_spellcheck",function(n){n.returnValue=!0,u.RunSpellCheck()}),R()};function c(t,r,n,o){var i=t.ownerDocument.createElement(r);return n&&(i.style.cssText=n),o&&(i.className=o),t.appendChild(i),i}function C(t){return String(t??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function E(t){try{!e.InvokeEventHook||e.InvokeEventHook("customdialog","spellcheck",t)}catch{}try{var r=e.getEditable(),n=r.ownerDocument,o=n.createElement("div");o.className="rte-spell-toast",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.textContent=t,n.body.appendChild(o),setTimeout(function(){o.parentNode&&o.parentNode.removeChild(o)},2600)}catch{}}function S(t,r){try{for(var n=e.getEditable(),o=e.getDocument(),i=o.createTreeWalker(n,NodeFilter.SHOW_TEXT,null),l,g=new RegExp("\\b"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b");l=i.nextNode();){var d=l.parentNode;if(!(d&&(d.nodeName==="CODE"||d.nodeName==="PRE"))){var p=l.data.search(g);if(p>=0)return l.data=l.data.substring(0,p)+r+l.data.substring(p+t.length),!0}}}catch{}return!1}u.RunSpellCheck=function(){if(!s.spellCheckResolver||typeof s.spellCheckResolver!="function"){try{var t=e.getEditable();t.setAttribute("spellcheck","true"),t.focus()}catch{}E(e.getLangText&&e.getLangText("spellchecknative")||"Browser spell-check is on \u2014 misspellings are underlined as you type.");return}var r;try{r=e.getEditable().innerText||""}catch{r=""}if(!r.trim()){E("Nothing to check.");return}var n=e.createDialog(e.getLangText&&e.getLangText("spellchecktitle")||"Spelling","rte-dialog-spell"),o=typeof n.close=="function"?function(){n.close()}:function(){e.closeCurrentPopup()},i=c(n,"div","box-sizing:border-box;width:min(420px,calc(100vw - 32px));max-height:60vh;overflow:auto;padding:14px;font:13px -apple-system,Segoe UI,sans-serif"),l=c(i,"div","color:#64748b;margin-bottom:8px");l.innerText="Checking\u2026";var g=c(i,"div","");function d(a){if(g.innerHTML="",!a||!a.length){l.innerText=e.getLangText&&e.getLangText("spellcheckclean")||"No spelling issues found.";return}l.innerText=a.length+" issue"+(a.length===1?"":"s")+" found.",a.forEach(function(f){if(!(!f||!f.word)){var b=c(g,"div","padding:8px 0;border-bottom:1px solid rgba(15,23,42,.08)","rte-spell-row"),T=c(b,"div","font-weight:600;color:#b91c1c;margin-bottom:4px");T.textContent=f.word;var k=c(b,"div","display:flex;flex-wrap:wrap;gap:6px"),w=(f.suggestions||[]).slice(0,6);w.length||(c(k,"span","font-size:12px;color:#94a3b8").textContent="(no suggestions)"),w.forEach(function(m){var y=c(k,"button","font-size:12px;padding:4px 9px;border:1px solid #cbd5e1;border-radius:6px;background:#f8fbff;color:#315277;cursor:pointer");y.type="button",y.textContent=m,y.onclick=function(){S(f.word,m)&&(b.style.opacity="0.45",T.innerHTML=C(f.word)+' &rarr; <span style="color:#16a34a">'+C(m)+"</span>",k.innerHTML="")}})}})}var p=!1;function x(a){p||(p=!0,d(a))}try{var h=s.spellCheckResolver(r);h&&typeof h.then=="function"?(h.then(function(a){x(a||[])},function(){l.innerText="Spell-check service error."}),setTimeout(function(){p||(l.innerText="Spell-check timed out.",p=!0)},12e3)):x(h||[])}catch{l.innerText="Spell-check error."}var D=c(i,"div","display:flex;justify-content:flex-end;margin-top:12px"),v=c(D,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;cursor:pointer");v.type="button",v.textContent="Done",v.onclick=function(){o(),e.focus()}};function R(){var t=["/* 2026-07-12 spell-check feedback precision */",".rte-spell-toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);max-width:calc(100vw - 32px);padding:9px 12px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#172033;font:600 13px/1.35 -apple-system,Segoe UI,sans-serif;z-index:2147483600;box-shadow:0 10px 24px rgba(15,23,42,.14)}",".rte-spell-row:last-child{border-bottom:0}"].join(`
2
+ `);try{var r=e&&e.iframe&&e.iframe.ownerDocument||document;if(!r.querySelector("style[data-rte-spellcheck]")){var n=r.createElement("style");n.setAttribute("data-rte-spellcheck","1"),n.textContent=t,(r.head||r.documentElement).appendChild(n),e&&typeof e.ensureStyleSheetLive=="function"&&e.ensureStyleSheetLive(r,n,"rte-spellcheck-st",n.textContent)}}catch{}}}
@@ -0,0 +1,2 @@
1
+ window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_stateinspector=RTE_Plugin_StateInspector;function RTE_Plugin_StateInspector(){var T=this,o,c,p=null,g=null,u=null,b=null,y=null,R=0,v="issues",C=[],h=[],I=60,M=[{id:"issues",label:"Issues"},{id:"tree",label:"Tree"},{id:"selection",label:"Selection"},{id:"plugins",label:"Plugins"},{id:"log",label:"Log"}],A={A:1,ABBR:1,B:1,BDI:1,BDO:1,CITE:1,CODE:1,DEL:1,DFN:1,EM:1,I:1,INS:1,KBD:1,MARK:1,Q:1,S:1,SAMP:1,SMALL:1,SPAN:1,STRONG:1,SUB:1,SUP:1,U:1,VAR:1,FONT:1},q={AREA:1,BASE:1,BR:1,COL:1,EMBED:1,HR:1,IMG:1,INPUT:1,LINK:1,META:1,PARAM:1,SOURCE:1,TRACK:1,WBR:1},Z={ADDRESS:1,ARTICLE:1,ASIDE:1,BLOCKQUOTE:1,DIV:1,DL:1,DT:1,DD:1,FIELDSET:1,FIGCAPTION:1,FIGURE:1,FOOTER:1,FORM:1,H1:1,H2:1,H3:1,H4:1,H5:1,H6:1,HEADER:1,HR:1,LI:1,MAIN:1,NAV:1,OL:1,P:1,PRE:1,SECTION:1,TABLE:1,UL:1},X=/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/;T.PluginName="StateInspector",T.InitConfig=function(e){o=e,o.stateInspectorEnabled!==!1&&(o.stateInspectorTitle=o.stateInspectorTitle||"State inspector",o.stateInspectorHint=o.stateInspectorHint||"Derived document model, structural checks, and a copyable snapshot for bug reports.",o.stateInspectorEmptyText=o.stateInspectorEmptyText||"No content to inspect yet.",typeof o.stateInspectorAutoOpen!="boolean"&&(o.stateInspectorAutoOpen=!1),typeof o.stateInspectorToolbarButton!="boolean"&&(o.stateInspectorToolbarButton=!1),typeof o.stateInspectorMaxDepth!="number"&&(o.stateInspectorMaxDepth=24),typeof o.stateInspectorLogLimit=="number"&&(I=Math.max(10,Math.min(500,o.stateInspectorLogLimit))),C=Y(o),o.stateInspectorToolbarButton&&(D("toolbar_default","#{stateinspector}"),D("toolbar_full","#{stateinspector}")))},T.InitEditor=function(e){c=e,o.stateInspectorEnabled!==!1&&(c.stateInspector={close:function(){k()},isOpen:function(){return!!(p&&p.classList.contains("is-open"))},issues:function(){return S(L()).issues},log:function(){return h.slice(0)},open:function(){E()},plugins:function(){return C.slice(0)},refresh:function(){N()},snapshot:function(){return _()},toggle:function(){G()}},ie(),c.toolbarFactoryMap=c.toolbarFactoryMap||{},c.toolbarFactoryMap.stateinspector=function(t){return c.createToolbarButton(t)},c.attachEvent("exec_command_stateinspector",function(t){t.returnValue=!0,t.stopBubble=!0,G()}),c.attachEvent("change",function(){z("change"),K()}),c.attachEvent("selectionchange",function(){z("selectionchange"),K()}),c.slashCommands&&c.slashCommands.register&&c.slashCommands.register({id:"stateinspector",section:"Tools",title:o.stateInspectorTitle,description:"Inspect document structure, selection, and structural issues",keywords:["inspect","debug","devtools","state","structure"],run:function(){E()}}),U(),o.stateInspectorAutoOpen&&E())};function D(e,t){o[e]&&o[e].indexOf(t)===-1&&(o[e]=o[e]+t)}function Y(e){var t=[];for(var r in e)r[0]!=="p"||r.substr(0,7)!=="plugin_"||!e[r]||!(e[r]instanceof Function)||t.push({index:t.length,key:r,name:r.substring(7)});return t}function z(e){h.push({at:Date.now(),event:e}),h.length>I&&h.splice(0,h.length-I)}function $(e){var t={},r=e.attributes;if(!r)return t;for(var n=0;n<r.length;n++){var a=r[n].value;t[r[n].name]=a.length>220?a.substring(0,220)+"\u2026":a}return t}function H(e,t,r,n){if(e.nodeType===3){var a=e.nodeValue||"";return n.textNodes++,n.characters+=a.length,{type:"text",length:a.length,text:a.length>80?a.substring(0,80)+"\u2026":a}}if(e.nodeType===8)return n.comments++,{type:"comment",length:(e.nodeValue||"").length};if(e.nodeType!==1)return null;n.elements++;var i=e.nodeName;n.tags[i]=(n.tags[i]||0)+1;var s={type:"element",name:i.toLowerCase(),attrs:$(e),children:[]};if(t>=r)return s.truncated=!0,s.childCount=e.childNodes.length,s;for(var l=0;l<e.childNodes.length;l++){var d=H(e.childNodes[l],t+1,r,n);d&&s.children.push(d)}return s}function L(){var e=c&&c.getEditable?c.getEditable():null,t={elements:0,textNodes:0,comments:0,characters:0,tags:{}};if(!e)return{root:null,counters:t,editable:null};for(var r=Math.max(2,o.stateInspectorMaxDepth||24),n={type:"element",name:"root",attrs:{},children:[]},a=0;a<e.childNodes.length;a++){var i=H(e.childNodes[a],1,r,t);i&&n.children.push(i)}return{root:n,counters:t,editable:e}}function P(){var e=c&&c.getDocument?c.getDocument():null,t=c&&c.getEditable?c.getEditable():null,r={available:!1};if(!e||!e.getSelection)return r;var n;try{n=e.getSelection()}catch{return r}if(!n||n.rangeCount===0)return r;var a;try{a=n.getRangeAt(0)}catch{return r}if(!a)return r;r.available=!0,r.collapsed=!!a.collapsed,r.anchor=F(a.startContainer,a.startOffset),r.focus=F(a.endContainer,a.endOffset),r.insideEditable=!!(t&&t.contains(a.startContainer)&&t.contains(a.endContainer));try{var i=String(a.toString()||"");r.textLength=i.length,r.text=i.length>120?i.substring(0,120)+"\u2026":i}catch{r.textLength=0}return r.block=ee(a.startContainer,t),r}function F(e,t){if(!e)return{node:"(none)",offset:t};if(e.nodeType===3){var r=e.nodeValue||"";return{node:"#text",offset:t,length:r.length,zeroLength:r.length===0}}return{node:e.nodeName?e.nodeName.toLowerCase():"(unknown)",offset:t,childCount:e.childNodes?e.childNodes.length:0}}function ee(e,t){for(var r=[],n=e;n&&n!==t;)n.nodeType===1&&r.unshift(n.nodeName.toLowerCase()),n=n.parentNode;return r.join(" > ")}function _(){var e=L(),t=S(e);return{snapshotVersion:1,generatedAt:new Date().toISOString(),counters:e.counters,issues:t.issues,plugins:C.slice(0),recentEvents:h.slice(-20),selection:P(),tree:e.root}}function f(e,t,r,n,a){e.push({id:t,severity:r,message:n,detail:a||""})}function w(e,t){for(var r=[],n=e;n&&n!==t&&n.nodeType===1;){var a=n.nodeName.toLowerCase();n.id&&(a+="#"+n.id),r.unshift(a),n=n.parentNode}return r.join(" > ")}function te(e){if((e.textContent||"").replace(/[\s\u200B\uFEFF]/g,"")!=="")return!0;for(var t=0;t<e.childNodes.length;t++){var r=e.childNodes[t];if(r.nodeType===1&&q[r.nodeName])return!0}return!1}function S(e){var t=[],r=e.editable;if(!r)return{issues:t};for(var n=r.ownerDocument.createTreeWalker(r,5,null,!1),a=0,i;i=n.nextNode();){if(i.nodeType===3){ne(i,r,t);continue}ae(i,r,t);var s=re(i);s&&(a&&s>a+1&&f(t,"heading-skip","warn","Heading level jumps from h"+a+" to h"+s,w(i,r)),a=s)}for(var l=0;l<r.childNodes.length;l++){var d=r.childNodes[l];d.nodeType===1&&d.nodeName==="IMG"&&j(d,r,t)}return{issues:t}}function re(e){var t=e.nodeName;return t.length===2&&t[0]==="H"&&t[1]>="1"&&t[1]<="6"?parseInt(t[1],10):0}function ne(e,t,r){var n=e.nodeValue||"";if(n.length===0){f(r,"zero-length-text","warn","Zero-length text node",w(e.parentNode,t));return}X.test(n)&&f(r,"control-characters","error","Text contains control characters - Word will reject an exported .docx",w(e.parentNode,t))}function ae(e,t,r){for(var n=e.nodeName,a=w(e,t),i=e.attributes,s=0;i&&s<i.length;s++){var l=i[s].name.toLowerCase(),d=i[s].value||"";if(l.indexOf("on")===0&&l.length>2&&f(r,"event-handler-attribute","error","Inline event handler "+l+" present in document content",a),l==="href"||l==="src"||l==="xlink:href"){var x=d.replace(/[\u0000-\u0020]/g,"").toLowerCase();x.indexOf("javascript:")===0?f(r,"unsafe-url-scheme","error","javascript: URL in "+l,a):(x.indexOf("data:text/html")===0||x.indexOf("data:image/svg+xml")===0)&&f(r,"unsafe-url-scheme","error","Scriptable data: URL in "+l,a)}}if(n==="IFRAME"&&e.hasAttribute("srcdoc")&&f(r,"iframe-srcdoc","error","iframe[srcdoc] executes when the saved content is rendered downstream",a),A[n]&&!te(e)&&f(r,"empty-inline","warn","Empty inline <"+n.toLowerCase()+"> - a caret entering it cannot leave by typing",a),A[n]&&e.parentNode&&e.parentNode.nodeName===n&&f(r,"nested-duplicate-inline","warn","<"+n.toLowerCase()+"> nested directly inside another <"+n.toLowerCase()+">",a),A[n])for(var O=0;O<e.childNodes.length;O++){var B=e.childNodes[O];if(B.nodeType===1&&Z[B.nodeName]){f(r,"block-inside-inline","warn","Block <"+B.nodeName.toLowerCase()+"> inside inline <"+n.toLowerCase()+">",a);break}}if(n==="LI"){var Q=e.parentNode?e.parentNode.nodeName:"";Q!=="UL"&&Q!=="OL"&&f(r,"orphan-list-item","warn","<li> outside a <ul> or <ol>",a)}n==="IMG"&&j(e,t,r),e.hasAttribute&&e.hasAttribute("data-rte-atomic")&&e.getAttribute("contenteditable")!=="false"&&f(r,"atomic-not-protected","error",'Atomic element without contenteditable="false"',a)}function j(e,t,r){if(!(e.getAttribute("role")==="presentation"||e.getAttribute("aria-hidden")==="true")){var n=e.getAttribute("alt");n===null&&f(r,"image-missing-alt","warn","Image has no alt attribute",w(e,t))}}function ie(){var e=o.container.ownerDocument;if(!e.getElementById("rte-state-inspector-style")){var t=e.createElement("style");t.id="rte-state-inspector-style",t.innerHTML=[".rte-state-inspector-shell{display:flex;align-items:stretch;gap:10px;}",".rte-state-inspector-shell>.rte-state-inspector-host{flex:1 1 auto;min-width:0;}",".rte-state-inspector-panel{display:none;flex:0 0 340px;min-width:290px;max-width:min(400px,36vw);border:1px solid rgba(148,163,184,.22);border-radius:8px;background:#fff;box-shadow:0 14px 32px rgba(29,78,216,.1),0 2px 8px rgba(15,23,42,.06);overflow:hidden;color:#172033;font-family:Aptos,'Segoe UI',sans-serif;}",".rte-state-inspector-shell.is-open>.rte-state-inspector-panel{display:flex;flex-direction:column;}",".rte-state-inspector-header{padding:12px 12px 9px 14px;border-bottom:1px solid rgba(148,163,184,.16);background:rgba(248,251,255,.72);}",".rte-state-inspector-kicker{font-size:10px;line-height:1.3;letter-spacing:.08em;text-transform:uppercase;color:#52657e;font-weight:850;}",".rte-state-inspector-title{margin-top:3px;font-size:15px;line-height:1.2;font-weight:850;color:#172033;}",".rte-state-inspector-copy{margin-top:5px;font-size:12px;line-height:1.42;color:#52657e;}",".rte-state-inspector-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px 8px 14px;border-bottom:1px solid rgba(148,163,184,.16);}",".rte-state-inspector-summary{min-width:0;font-size:12px;font-weight:750;color:#52657e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}",".rte-state-inspector-actions{display:flex;gap:6px;flex:0 0 auto;}",".rte-state-inspector-btn{appearance:none;border:1px solid rgba(100,116,139,.18);background:#fff;color:#315277;cursor:pointer;font-size:12px;font-weight:750;padding:6px 9px;border-radius:7px;line-height:1;}",".rte-state-inspector-btn:hover,.rte-state-inspector-btn:focus-visible{background:#eef4ff;color:#0f3f9f;border-color:rgba(37,99,235,.28);}",".rte-state-inspector-tabs{display:flex;gap:2px;padding:8px 10px 0 10px;border-bottom:1px solid rgba(148,163,184,.16);}",".rte-state-inspector-tab{appearance:none;border:1px solid transparent;border-bottom:none;background:transparent;color:#52657e;cursor:pointer;font-size:12px;font-weight:800;padding:7px 10px;border-radius:7px 7px 0 0;line-height:1;}",".rte-state-inspector-tab:hover,.rte-state-inspector-tab:focus-visible{background:#f8fbff;color:#0f3f9f;}",".rte-state-inspector-tab[aria-selected='true']{background:#eef4ff;border-color:rgba(37,99,235,.26);color:#0f3f9f;}",".rte-state-inspector-body{padding:10px;overflow:auto;min-height:160px;max-height:540px;scrollbar-width:thin;font-size:12px;line-height:1.5;}",".rte-state-inspector-issue{display:block;padding:8px 10px;margin-bottom:6px;border:1px solid rgba(148,163,184,.24);border-left-width:3px;border-radius:7px;background:#fff;}",".rte-state-inspector-issue.is-error{border-left-color:#dc2626;background:#fef4f4;}",".rte-state-inspector-issue.is-warn{border-left-color:#d97706;background:#fffaf1;}",".rte-state-inspector-issue-msg{font-weight:750;color:#172033;}",".rte-state-inspector-issue-meta{margin-top:3px;font-size:11px;color:#52657e;font-family:Consolas,'Cascadia Mono',monospace;word-break:break-all;}",".rte-state-inspector-ok{padding:14px;color:#166534;font-weight:750;background:#f0fdf4;border:1px dashed rgba(22,101,52,.3);border-radius:8px;}",".rte-state-inspector-empty{padding:14px;color:#52657e;font-weight:700;background:#fff;border:1px dashed rgba(148,163,184,.34);border-radius:8px;}",".rte-state-inspector-pre{margin:0;font-family:Consolas,'Cascadia Mono',monospace;font-size:11px;line-height:1.55;color:#172033;white-space:pre;}",".rte-state-inspector-row{display:flex;gap:8px;padding:4px 0;border-bottom:1px solid rgba(148,163,184,.14);}",".rte-state-inspector-row-key{flex:0 0 116px;color:#52657e;font-weight:750;}",".rte-state-inspector-row-val{flex:1 1 auto;min-width:0;font-family:Consolas,'Cascadia Mono',monospace;word-break:break-all;}",".rte-state-inspector-row.is-flagged .rte-state-inspector-row-val{color:#b91c1c;font-weight:750;}","@media (max-width: 1100px){.rte-state-inspector-shell{display:block;}.rte-state-inspector-panel{margin-top:12px;max-width:none;width:100%;}.rte-state-inspector-body{max-height:340px;}}"].join(""),e.head.appendChild(t),c&&typeof c.ensureStyleSheetLive=="function"&&c.ensureStyleSheetLive(e,t,"rte-state-inspector-style",t.textContent)}}function U(){if(p)return p;var e=o.container,t=e.ownerDocument;p=t.createElement("div"),p.className="rte-state-inspector-shell";var r=t.createElement("div");r.className="rte-state-inspector-host",e.parentNode.insertBefore(p,e),p.appendChild(r),r.appendChild(e),g=t.createElement("aside"),g.className="rte-state-inspector-panel",g.setAttribute("role","complementary"),g.setAttribute("aria-label",o.stateInspectorTitle);var n=t.createElement("div");n.className="rte-state-inspector-header";var a=t.createElement("div");a.className="rte-state-inspector-kicker",a.innerText="Developer";var i=t.createElement("div");i.className="rte-state-inspector-title",i.innerText=o.stateInspectorTitle;var s=t.createElement("div");s.className="rte-state-inspector-copy",s.innerText=o.stateInspectorHint,n.appendChild(a),n.appendChild(i),n.appendChild(s);var l=t.createElement("div");l.className="rte-state-inspector-toolbar",y=t.createElement("div"),y.className="rte-state-inspector-summary",y.setAttribute("data-rte-inspector-summary","1");var d=t.createElement("div");d.className="rte-state-inspector-actions",d.appendChild(V(t,"Copy","Copy the state snapshot as JSON",le)),d.appendChild(V(t,"Hide","Hide the state inspector",k)),l.appendChild(y),l.appendChild(d),b=t.createElement("div"),b.className="rte-state-inspector-tabs",b.setAttribute("role","tablist");for(var x=0;x<M.length;x++)b.appendChild(oe(t,M[x]));return u=t.createElement("div"),u.className="rte-state-inspector-body",g.appendChild(n),g.appendChild(l),g.appendChild(b),g.appendChild(u),p.appendChild(g),p}function V(e,t,r,n){var a=e.createElement("button");return a.type="button",a.className="rte-state-inspector-btn",a.innerText=t,a.setAttribute("aria-label",r),a.onclick=n,a}function oe(e,t){var r=e.createElement("button");return r.type="button",r.className="rte-state-inspector-tab",r.innerText=t.label,r.setAttribute("role","tab"),r.setAttribute("data-rte-inspector-tab",t.id),r.setAttribute("aria-selected",t.id===v?"true":"false"),r.onclick=function(){v=t.id,se(),N()},r}function se(){if(b)for(var e=b.querySelectorAll("[data-rte-inspector-tab]"),t=0;t<e.length;t++){var r=e[t].getAttribute("data-rte-inspector-tab");e[t].setAttribute("aria-selected",r===v?"true":"false")}}function G(){p&&p.classList.contains("is-open")?k():E()}function E(){U(),p.classList.add("is-open"),N()}function k(){p&&p.classList.remove("is-open")}function K(){!p||!p.classList.contains("is-open")||(clearTimeout(R),R=setTimeout(function(){N()},120))}function le(){var e=JSON.stringify(_(),null,2);if(navigator.clipboard&&navigator.clipboard.writeText){navigator.clipboard.writeText(e);return}var t=o.container.ownerDocument,r=t.createElement("textarea");r.value=e,r.style.position="fixed",r.style.opacity="0",t.body.appendChild(r),r.select();try{t.execCommand("copy")}catch{}t.body.removeChild(r)}function ce(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function N(){if(!(!p||!u)){for(var e=L(),t=S(e),r=o.container.ownerDocument,n=0,a=0;a<t.issues.length;a++)t.issues[a].severity==="error"&&n++;y&&(y.innerText=e.counters.elements+" el \xB7 "+t.issues.length+" issue"+(t.issues.length===1?"":"s")+(n?" \xB7 "+n+" error"+(n===1?"":"s"):"")),ce(u),v==="issues"?pe(r,t.issues):v==="tree"?de(r,e):v==="selection"?ue(r):v==="plugins"?fe(r):v==="log"&&he(r)}}function pe(e,t){if(!t.length){var r=e.createElement("div");r.className="rte-state-inspector-ok",r.innerText="No structural issues found.",u.appendChild(r);return}for(var n=0;n<t.length;n++){var a=t[n],i=e.createElement("div");i.className="rte-state-inspector-issue is-"+(a.severity==="error"?"error":"warn"),i.setAttribute("data-rte-issue-id",a.id);var s=e.createElement("div");s.className="rte-state-inspector-issue-msg",s.innerText=a.message;var l=e.createElement("div");l.className="rte-state-inspector-issue-meta",l.innerText=(a.detail||"(document root)")+" \xB7 "+a.id,i.appendChild(s),i.appendChild(l),u.appendChild(i)}}function de(e,t){if(!t.root||!t.root.children.length){var r=e.createElement("div");r.className="rte-state-inspector-empty",r.innerText=o.stateInspectorEmptyText,u.appendChild(r);return}var n=e.createElement("pre");n.className="rte-state-inspector-pre",n.innerText=J(t.root,0).join(`
2
+ `),u.appendChild(n)}function J(e,t){var r=[],n=new Array(t+1).join(" ");if(e.type==="text")return r.push(n+"#text("+e.length+") "+JSON.stringify(e.text)),r;if(e.type==="comment")return r.push(n+"#comment("+e.length+")"),r;var a=n+"<"+e.name,i=[];for(var s in e.attrs)i.push(s);if(i.length){i.sort();for(var l=0;l<i.length&&l<4;l++)a+=" "+i[l]+"="+JSON.stringify(e.attrs[i[l]]);i.length>4&&(a+=" \u2026+"+(i.length-4))}a+=">",e.truncated&&(a+=" \u2026 "+e.childCount+" children (depth limit)"),r.push(a);for(var d=0;d<(e.children||[]).length;d++)r=r.concat(J(e.children[d],t+1));return r}function ue(e){var t=P();if(!t.available){var r=e.createElement("div");r.className="rte-state-inspector-empty",r.innerText="No selection in the document.",u.appendChild(r);return}m(e,"Collapsed",String(t.collapsed)),m(e,"In editable",String(t.insideEditable),!t.insideEditable),m(e,"Block path",t.block||"(root)"),m(e,"Anchor",W(t.anchor),!!(t.anchor&&t.anchor.zeroLength)),m(e,"Focus",W(t.focus),!!(t.focus&&t.focus.zeroLength)),m(e,"Selected",t.textLength+" chars"),t.text&&m(e,"Text",t.text)}function W(e){if(!e)return"(none)";var t=e.node+" @ "+e.offset;return typeof e.length=="number"&&(t+=" (len "+e.length+")"),typeof e.childCount=="number"&&(t+=" ("+e.childCount+" children)"),e.zeroLength&&(t+=" \u2190 zero-length text node"),t}function m(e,t,r,n){var a=e.createElement("div");a.className="rte-state-inspector-row"+(n?" is-flagged":"");var i=e.createElement("div");i.className="rte-state-inspector-row-key",i.innerText=t;var s=e.createElement("div");s.className="rte-state-inspector-row-val",s.innerText=r,a.appendChild(i),a.appendChild(s),u.appendChild(a)}function fe(e){if(!C.length){var t=e.createElement("div");t.className="rte-state-inspector-empty",t.innerText="No plugins registered.",u.appendChild(t);return}var r=e.createElement("div");r.className="rte-state-inspector-copy",r.innerText="Initialization order. A plugin can only register into another plugin's API if it appears below it.",u.appendChild(r);for(var n=0;n<C.length;n++)m(e,String(n+1).padStart?String(n+1).padStart(3,"0"):String(n+1),C[n].name)}function he(e){if(!h.length){var t=e.createElement("div");t.className="rte-state-inspector-empty",t.innerText="No editor events recorded yet.",u.appendChild(t);return}for(var r=h[0].at,n=h.length-1;n>=0;n--)m(e,"+"+(h[n].at-r)+"ms",h[n].event)}}