@remyxjs/react 1.0.0-beta → 1.0.4-beta

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 (64) hide show
  1. package/dist/{AttachmentModal-D-uxbXvb.cjs → AttachmentModal-BDFFiZJt.cjs} +2 -2
  2. package/dist/{AttachmentModal-D-uxbXvb.cjs.map → AttachmentModal-BDFFiZJt.cjs.map} +1 -1
  3. package/dist/{AttachmentModal--6T-vYJt.js → AttachmentModal-Di5V6QX-.js} +2 -2
  4. package/dist/{AttachmentModal--6T-vYJt.js.map → AttachmentModal-Di5V6QX-.js.map} +1 -1
  5. package/dist/{ContextMenu-B4K3Zbfp.cjs → ContextMenu-BafbP2Uh.cjs} +2 -2
  6. package/dist/{ContextMenu-B4K3Zbfp.cjs.map → ContextMenu-BafbP2Uh.cjs.map} +1 -1
  7. package/dist/{ContextMenu-D8wNSMc3.js → ContextMenu-DsA0YsY7.js} +2 -2
  8. package/dist/{ContextMenu-D8wNSMc3.js.map → ContextMenu-DsA0YsY7.js.map} +1 -1
  9. package/dist/{EmbedModal-Bh2Tcow9.cjs → EmbedModal-C73lODIT.cjs} +2 -2
  10. package/dist/{EmbedModal-Bh2Tcow9.cjs.map → EmbedModal-C73lODIT.cjs.map} +1 -1
  11. package/dist/{EmbedModal-cxE4maD2.js → EmbedModal-alpHQiAP.js} +2 -2
  12. package/dist/{EmbedModal-cxE4maD2.js.map → EmbedModal-alpHQiAP.js.map} +1 -1
  13. package/dist/{ExportModal-Cf1uE4r_.js → ExportModal-BN8LUaSR.js} +2 -2
  14. package/dist/{ExportModal-Cf1uE4r_.js.map → ExportModal-BN8LUaSR.js.map} +1 -1
  15. package/dist/{ExportModal-DwQVsrZE.cjs → ExportModal-Cu-cCwa6.cjs} +2 -2
  16. package/dist/{ExportModal-DwQVsrZE.cjs.map → ExportModal-Cu-cCwa6.cjs.map} +1 -1
  17. package/dist/{FindReplaceModal-Dgt_MrWb.js → FindReplaceModal-BqNcotUr.js} +2 -2
  18. package/dist/{FindReplaceModal-Dgt_MrWb.js.map → FindReplaceModal-BqNcotUr.js.map} +1 -1
  19. package/dist/{FindReplaceModal-DYL_2z8U.cjs → FindReplaceModal-DgysYT04.cjs} +2 -2
  20. package/dist/{FindReplaceModal-DYL_2z8U.cjs.map → FindReplaceModal-DgysYT04.cjs.map} +1 -1
  21. package/dist/{ImageModal-D39ywxqI.cjs → ImageModal-BzgYXY9y.cjs} +2 -2
  22. package/dist/{ImageModal-D39ywxqI.cjs.map → ImageModal-BzgYXY9y.cjs.map} +1 -1
  23. package/dist/{ImageModal-DqScpPrc.js → ImageModal-bCzSSTmd.js} +2 -2
  24. package/dist/{ImageModal-DqScpPrc.js.map → ImageModal-bCzSSTmd.js.map} +1 -1
  25. package/dist/{ImportDocumentModal-BKqMxO3z.js → ImportDocumentModal-BypTEn2i.js} +4 -4
  26. package/dist/{ImportDocumentModal-BKqMxO3z.js.map → ImportDocumentModal-BypTEn2i.js.map} +1 -1
  27. package/dist/{ImportDocumentModal-Bev9hp_J.cjs → ImportDocumentModal-gCFept9p.cjs} +2 -2
  28. package/dist/{ImportDocumentModal-Bev9hp_J.cjs.map → ImportDocumentModal-gCFept9p.cjs.map} +1 -1
  29. package/dist/{LinkModal-k9IeDtAb.js → LinkModal-CmkK4m-k.js} +3 -3
  30. package/dist/{LinkModal-k9IeDtAb.js.map → LinkModal-CmkK4m-k.js.map} +1 -1
  31. package/dist/{LinkModal-B-igSa-g.cjs → LinkModal-DPxg7YCE.cjs} +2 -2
  32. package/dist/{LinkModal-B-igSa-g.cjs.map → LinkModal-DPxg7YCE.cjs.map} +1 -1
  33. package/dist/{MenuBar-DWxJNHmb.js → MenuBar-DOv7JPwR.js} +2 -2
  34. package/dist/{MenuBar-DWxJNHmb.js.map → MenuBar-DOv7JPwR.js.map} +1 -1
  35. package/dist/{MenuBar-B-ZAX9rH.cjs → MenuBar-Lw_5Jp8u.cjs} +2 -2
  36. package/dist/{MenuBar-B-ZAX9rH.cjs.map → MenuBar-Lw_5Jp8u.cjs.map} +1 -1
  37. package/dist/{ModalOverlay-BDsGgv3_.cjs → ModalOverlay-Dh5quv7X.cjs} +2 -2
  38. package/dist/{ModalOverlay-BDsGgv3_.cjs.map → ModalOverlay-Dh5quv7X.cjs.map} +1 -1
  39. package/dist/{ModalOverlay-CLvRNHmp.js → ModalOverlay-Dt0JiW3M.js} +2 -2
  40. package/dist/{ModalOverlay-CLvRNHmp.js.map → ModalOverlay-Dt0JiW3M.js.map} +1 -1
  41. package/dist/{SourceModal-BNI_i4iW.cjs → SourceModal-CHKC5xcv.cjs} +2 -2
  42. package/dist/{SourceModal-BNI_i4iW.cjs.map → SourceModal-CHKC5xcv.cjs.map} +1 -1
  43. package/dist/{SourceModal-MdTGK3Uf.js → SourceModal-ChhNVz7y.js} +2 -2
  44. package/dist/{SourceModal-MdTGK3Uf.js.map → SourceModal-ChhNVz7y.js.map} +1 -1
  45. package/dist/{TablePickerModal-DYODWEA1.js → TablePickerModal-BnZHyMsk.js} +2 -2
  46. package/dist/{TablePickerModal-DYODWEA1.js.map → TablePickerModal-BnZHyMsk.js.map} +1 -1
  47. package/dist/{TablePickerModal-Do1QyoyM.cjs → TablePickerModal-Dr0wUx_h.cjs} +2 -2
  48. package/dist/{TablePickerModal-Do1QyoyM.cjs.map → TablePickerModal-Dr0wUx_h.cjs.map} +1 -1
  49. package/dist/index-Bg_uAWlM.js +3 -0
  50. package/dist/index-Bg_uAWlM.js.map +1 -0
  51. package/dist/index-DL-qBZZU.js +357 -0
  52. package/dist/index-DL-qBZZU.js.map +1 -0
  53. package/dist/index-OfJxpaev.cjs +2 -0
  54. package/dist/index-OfJxpaev.cjs.map +1 -0
  55. package/dist/index-qh1Yzh-l.cjs +2 -0
  56. package/dist/index-qh1Yzh-l.cjs.map +1 -0
  57. package/dist/remyx-react.cjs +1 -1
  58. package/dist/remyx-react.css +1 -1
  59. package/dist/remyx-react.js +1 -1
  60. package/package.json +3 -3
  61. package/dist/index-C720tbJA.js +0 -359
  62. package/dist/index-C720tbJA.js.map +0 -1
  63. package/dist/index-Dc63uIP0.cjs +0 -2
  64. package/dist/index-Dc63uIP0.cjs.map +0 -1
@@ -0,0 +1,357 @@
1
+ import{EditorEngine as e,registerFormattingCommands as t,registerHeadingCommands as n,registerAlignmentCommands as r,registerListCommands as o,registerLinkCommands as a,registerImageCommands as l,registerTableCommands as i,registerBlockCommands as c,registerFontCommands as s,registerMediaCommands as u,registerFindReplaceCommands as d,registerSourceModeCommands as m,registerFullscreenCommands as p,registerDistractionFreeCommands as f,registerSplitViewCommands as h,registerColorPresetCommands as y,registerMarkdownToggleCommands as g,registerAttachmentCommands as v,registerImportDocumentCommands as b,registerBlockConvertCommands as x,WordCountPlugin as w,PlaceholderPlugin as C,AutolinkPlugin as k,markdownToHtml as S,htmlToMarkdown as N,cleanPastedHTML as E,insertPlainText as M,DEFAULT_MENU_BAR as T,DEFAULT_TOOLBAR as L,AutosaveManager as D,DEFAULT_COLORS as R,loadColorPresets as B,saveColorPreset as O,DEFAULT_FONTS as A,DEFAULT_FONT_SIZES as P,TOOLTIP_MAP as z,getShortcutLabel as $,BUTTON_COMMANDS as j,getCommandActiveState as F,HEADING_OPTIONS as _,loadGoogleFonts as I}from"@remyxjs/core";import{jsx as H,jsxs as W,Fragment as V}from"react/jsx-runtime";import q,{useRef as Y,useState as U,useCallback as X,useEffect as G,useReducer as K,useMemo as J,createContext as Z,useContext as Q,forwardRef as ee,Suspense as te}from"react";const ne=[t,n,r,o,a,l,i,c,s,u,d,m,p,f,h,y,g,v,b,x];function re(t,n){const r=new e(t,n);for(const e of ne)e(r);r.commands.register("undo",{execute(e){e.history.undo()},isEnabled:e=>e.history.canUndo(),shortcut:"mod+z",meta:{icon:"undo",tooltip:"Undo"}}),r.commands.register("redo",{execute(e){e.history.redo()},isEnabled:e=>e.history.canRedo(),shortcut:"mod+shift+z",meta:{icon:"redo",tooltip:"Redo"}});const o=new Set((n.plugins||[]).map((e=>e?.name)).filter(Boolean));o.has("wordCount")||r.plugins.register(w()),n.placeholder&&!o.has("placeholder")&&r.plugins.register(C(n.placeholder)),o.has("autolink")||r.plugins.register(k()),n.plugins&&n.plugins.forEach((e=>r.plugins.register(e)));const a="markdown"===n.outputFormat;let l=n.value||n.defaultValue||"";return l&&a&&(l=S(l)),l&&r.setHTML(l),{engine:r,initialContent:l}}function oe(e,t,n){const r=Y(null),[o,a]=U(!1),l=Y(t.value||t.defaultValue||""),i=Y(null),c=Y(t);c.current=t;const s=X((()=>{if(!e.current||r.current)return;const t=c.current,{engine:n}=re(e.current,t);return n.init(),r.current=n,a(!0),t.onReady?.(n),n.eventBus.emit("content:change"),n.on("content:change",(()=>{i.current&&cancelAnimationFrame(i.current),i.current=requestAnimationFrame((()=>{let e;if(i.current=null,n.isMarkdownMode)e=n.element.textContent;else{const t=n.getHTML();e="markdown"===c.current.outputFormat?N(t):t}e!==l.current&&(l.current=e,c.current.onChange?.(e))}))})),n.on("focus",(()=>c.current.onFocus?.())),n.on("blur",(()=>c.current.onBlur?.())),n}),[]);return G((()=>{const e=s();return()=>{i.current&&(cancelAnimationFrame(i.current),i.current=null),e&&(e.destroy(),r.current=null,a(!1))}}),[s,n]),G((()=>{if(!r.current||!o)return;if(void 0===t.value)return;if(t.value===l.current)return;l.current=t.value;const e="markdown"===t.outputFormat?S(t.value):t.value;r.current.setHTML(e)}),[t.value,t.outputFormat,o]),{engine:r.current,ready:o}}const ae={bold:!1,italic:!1,underline:!1,strikethrough:!1,subscript:!1,superscript:!1,heading:null,alignment:"left",orderedList:!1,unorderedList:!1,blockquote:!1,codeBlock:!1,link:null,fontFamily:null,fontSize:null,foreColor:null,backColor:null},le={hasSelection:!1,selectionRect:null,focusedImage:null,focusedTable:null,focusedCodeBlock:null},ie=Object.keys(ae);const ce={link:{open:!1,data:null},image:{open:!1,data:null},table:{open:!1,data:null},embed:{open:!1,data:null},findReplace:{open:!1,data:null},source:{open:!1,data:null},attachment:{open:!1,data:null},importDocument:{open:!1,data:null},export:{open:!1,data:null}};function se(e,t){switch(t.type){case"OPEN":return{...e,[t.name]:{open:!0,data:t.data}};case"CLOSE":return{...e,[t.name]:{open:!1,data:null}};default:return e}}function ue(e,t){const[n,r]=U({visible:!1,x:0,y:0,items:[]}),o=X((async()=>{const e=window.getSelection();if(e&&!e.isCollapsed)try{await navigator.clipboard.writeText(e.toString()),e.getRangeAt(0).deleteContents()}catch{}}),[]),a=X((async()=>{const e=window.getSelection();if(e&&!e.isCollapsed)try{await navigator.clipboard.writeText(e.toString())}catch{}}),[]),l=X((()=>async function(e){if(e){e.history.snapshot();try{if(navigator.clipboard?.read){const t=await navigator.clipboard.read();for(const n of t){if(n.types.includes("text/html")){const t=await n.getType("text/html");let r=await t.text();return r=E(r),r=e.sanitizer.sanitize(r),e.selection.insertHTML(r),void e.eventBus.emit("content:change")}if(n.types.includes("text/plain")){const t=await n.getType("text/plain"),r=await t.text();return M(e,r),void e.eventBus.emit("content:change")}}}if(navigator.clipboard?.readText){const t=await navigator.clipboard.readText();t&&(M(e,t),e.eventBus.emit("content:change"))}}catch{try{const t=await(navigator.clipboard?.readText?.());t&&(M(e,t),e.eventBus.emit("content:change"))}catch{}}}}(e)),[e]),i=X((()=>{if(!e)return;const t=window.getSelection(),n=document.createRange();n.selectNodeContents(e.element),t.removeAllRanges(),t.addRange(n)}),[e]),c=X((t=>{if(!e)return;t.preventDefault();const n=t.target,c=[];c.push({label:"Cut",command:o},{label:"Copy",command:a},{label:"Paste",command:l},{separator:!0},{label:"Select All",command:i});const s=n.closest?.("a");s&&c.push({separator:!0},{label:"Edit Link",command:"editLinkModal",data:s},{label:"Remove Link",command:()=>e.executeCommand("removeLink")},{label:"Open Link",command:()=>{const e=s.href;/^\s*(javascript|vbscript|data\s*:\s*text\/html)\s*:/i.test(e)||window.open(e,"_blank")}});const u="IMG"===n.tagName?n:null;u&&c.push({separator:!0},{label:"Align Left",command:()=>e.executeCommand("alignImage",{element:u,alignment:"left"})},{label:"Align Center",command:()=>e.executeCommand("alignImage",{element:u,alignment:"center"})},{label:"Align Right",command:()=>e.executeCommand("alignImage",{element:u,alignment:"right"})},{label:"Remove Image",command:()=>e.executeCommand("removeImage",{element:u})});const d=n.closest?.("table");d&&c.push({separator:!0},{label:"Insert Row Before",command:()=>e.executeCommand("addRowBefore")},{label:"Insert Row After",command:()=>e.executeCommand("addRowAfter")},{label:"Insert Column Before",command:()=>e.executeCommand("addColBefore")},{label:"Insert Column After",command:()=>e.executeCommand("addColAfter")},{separator:!0},{label:"Toggle Header Row",command:()=>e.executeCommand("toggleHeaderRow")},{separator:!0},{label:"Format as Number",command:()=>e.executeCommand("formatCell",{format:"number"})},{label:"Format as Currency",command:()=>e.executeCommand("formatCell",{format:"currency"})},{label:"Format as Percentage",command:()=>e.executeCommand("formatCell",{format:"percentage"})},{label:"Format as Date",command:()=>e.executeCommand("formatCell",{format:"date"})},{separator:!0},{label:"Clear Filters",command:()=>e.executeCommand("clearTableFilters")},{separator:!0},{label:"Delete Row",command:()=>e.executeCommand("deleteRow")},{label:"Delete Column",command:()=>e.executeCommand("deleteCol")},{label:"Delete Table",command:()=>e.executeCommand("deleteTable")}),r({visible:!0,x:t.clientX,y:t.clientY,items:c})}),[e,o,a,l,i]),s=X((()=>{r((e=>({...e,visible:!1})))}),[]),u=Y(!1);return u.current=n.visible,G((()=>{const e=t?.current;if(!e)return;e.addEventListener("contextmenu",c),document.addEventListener("click",s);const n=()=>{u.current&&s()};return document.addEventListener("scroll",n,!0),()=>{e.removeEventListener("contextmenu",c),document.removeEventListener("click",s),document.removeEventListener("scroll",n,!0)}}),[t,c,s]),{contextMenu:n,hideContextMenu:s}}const de="ocean",me="Write your blog post...",pe="markdown",fe=!1,he=[["undo","redo"],["heading"],["bold","italic","underline","strikethrough"],["link","image","blockquote","codeBlock","hr"],["orderedList","bulletList","checklist"],["table"]],ye=!1,ge="bottom",ve=!0,be=!0,xe=!0,we={"syntax-highlight":{enabled:!0},table:{enabled:!0},callout:{enabled:!0},link:{enabled:!0},toc:{enabled:!0},analytics:{enabled:!0},spellcheck:{enabled:!0}},Ce={theme:de,placeholder:me,height:500,outputFormat:pe,readOnly:fe,toolbar:he,menuBar:ye,statusBar:ge,floatingToolbar:ve,contextMenu:be,commandPalette:xe,plugins:we},ke=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,commandPalette:xe,contextMenu:be,default:Ce,floatingToolbar:ve,height:500,menuBar:ye,outputFormat:pe,placeholder:me,plugins:we,readOnly:fe,statusBar:ge,theme:de,toolbar:he},Symbol.toStringTag,{value:"Module"})),Se="light",Ne="Start typing to explore all the features...",Ee="html",Me=!1,Te=[["undo","redo"],["heading"],["font","fontSize"],["bold","italic","underline","strikethrough"],["textColor","bgColor"],["align"],["orderedList","bulletList","checklist"],["indent","outdent"],["link","image","table","codeBlock","blockquote","hr"]],Le=!0,De="bottom",Re=!0,Be=!0,Oe=!0,Ae={"syntax-highlight":{enabled:!0},table:{enabled:!0},comments:{enabled:!0},callout:{enabled:!0},"block-templates":{enabled:!0},template:{enabled:!0},keyboard:{enabled:!0},"drag-drop":{enabled:!0},link:{enabled:!0},math:{enabled:!0},toc:{enabled:!0},analytics:{enabled:!0},spellcheck:{enabled:!0},collaboration:{enabled:!1}},Pe={theme:Se,placeholder:Ne,height:400,outputFormat:Ee,readOnly:Me,toolbar:Te,menuBar:Le,statusBar:De,floatingToolbar:Re,contextMenu:Be,commandPalette:Oe,plugins:Ae},ze=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,commandPalette:Oe,contextMenu:Be,default:Pe,floatingToolbar:Re,height:400,menuBar:Le,outputFormat:Ee,placeholder:Ne,plugins:Ae,readOnly:Me,statusBar:De,theme:Se,toolbar:Te},Symbol.toStringTag,{value:"Module"})),$e="light",je="Write something...",Fe="html",_e=!1,Ie=[["bold","italic","underline"],["link"]],He=!1,We=!1,Ve=!0,qe=!0,Ye=!1,Ue={},Xe={theme:$e,placeholder:je,height:200,outputFormat:Fe,readOnly:_e,toolbar:Ie,menuBar:He,statusBar:We,floatingToolbar:Ve,contextMenu:qe,commandPalette:Ye,plugins:Ue},Ge=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,commandPalette:Ye,contextMenu:qe,default:Xe,floatingToolbar:Ve,height:200,menuBar:He,outputFormat:Fe,placeholder:je,plugins:Ue,readOnly:_e,statusBar:We,theme:$e,toolbar:Ie},Symbol.toStringTag,{value:"Module"})),Ke=/* @__PURE__ */Object.assign({"../../../../remyxjs/config/blog-editor.json":ke,"../../../../remyxjs/config/default.json":ze,"../../../../remyxjs/config/minimal.json":Ge}),Je=/* @__PURE__ */new Map;for(const[Wr,Vr]of Object.entries(Ke)){const e=Wr.split("/").pop().replace(".json","");Je.set(e,Vr.default||Vr)}function Ze(e,t){const n=Y("saved"),[r,o]=U("saved"),[a,l]=U(null),[i,c]=U(null),s=Y(null),u=Y(t?.onRecover);u.current=t?.onRecover;const d=t?.enabled??!1,m=t?.key,p=t?.interval,f=t?.debounce,h=t?.provider;G((()=>{if(!e||!d)return;const t=new D(e,{enabled:!0,key:m,interval:p,debounce:f,provider:h});s.current=t;const r=e=>{n.current!==e&&(n.current=e,o(e))},a=[e.eventBus.on("autosave:saving",(()=>r("saving"))),e.eventBus.on("autosave:saved",(({timestamp:e})=>{r("saved"),l(e)})),e.eventBus.on("autosave:error",(()=>r("error"))),e.eventBus.on("content:change",(()=>{"saving"!==n.current&&r("unsaved")}))],i=e.getHTML();return t.checkRecovery(i).then((n=>{n&&(c(n),e.eventBus.emit("autosave:recovered",n),u.current?.(n)),t.init()})).catch((e=>{t.init()})),()=>{a.forEach((e=>e())),t.destroy(),s.current=null}}),[e,d,m,p,f,h]);const y=X((()=>{e&&i&&(e.setHTML(i.recoveredContent),e.eventBus.emit("content:change"),c(null),s.current?.clearRecovery())}),[e,i]),g=X((()=>{c(null),s.current?.clearRecovery()}),[]);return J((()=>({saveStatus:r,lastSaved:a,recoveryData:i,recoverContent:y,dismissRecovery:g})),[r,a,i,y,g])}function Qe(e){const[t,n]=U(null),r=Y(null);return G((()=>{const t=e.current;if(!t)return;const o=()=>{const e=t.getBoundingClientRect();e&&n(e)};o();const a=new ResizeObserver((()=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(o)}));a.observe(t);const l=function(e){let t=e.parentElement;for(;t&&t!==document.body;){const e=window.getComputedStyle(t),n=e.overflow+e.overflowY;if(/auto|scroll/.test(n))return t;t=t.parentElement}return null}(t)||window,i=()=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(o)};return l.addEventListener("scroll",i,{passive:!0}),()=>{a.disconnect(),l.removeEventListener("scroll",i),r.current&&cancelAnimationFrame(r.current)}}),[e]),t}function et(e){const[t,n]=U(!1),[r,o]=U([]);return G((()=>{if(!e)return;const t=[e.eventBus.on("drag:enter",(({isExternal:e,types:t})=>{e&&(n(!0),o(t||[]))})),e.eventBus.on("drag:leave",(()=>{n(!1),o([])})),e.eventBus.on("drag:end",(()=>{n(!1),o([])})),e.eventBus.on("drop",(()=>{n(!1),o([])}))];return()=>t.forEach((e=>e()))}),[e]),{isExternalDrag:t,dragFileTypes:r}}function tt(e,t){const n=e.clientX-t.clientX,r=e.clientY-t.clientY;return Math.sqrt(n*n+r*r)}const nt=Z(null);function rt(){return Q(nt)}function ot(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var at,lt={exports:{}},it={exports:{}},ct={};var st,ut,dt,mt,pt,ft,ht,yt,gt,vt,bt,xt,wt,Ct,kt,St={};function Nt(){return ut||(ut=1,"production"===process.env.NODE_ENV?it.exports=function(){if(at)return ct;at=1;var e="function"==typeof Symbol&&Symbol.for,t=e?/* @__PURE__ */Symbol.for("react.element"):60103,n=e?/* @__PURE__ */Symbol.for("react.portal"):60106,r=e?/* @__PURE__ */Symbol.for("react.fragment"):60107,o=e?/* @__PURE__ */Symbol.for("react.strict_mode"):60108,a=e?/* @__PURE__ */Symbol.for("react.profiler"):60114,l=e?/* @__PURE__ */Symbol.for("react.provider"):60109,i=e?/* @__PURE__ */Symbol.for("react.context"):60110,c=e?/* @__PURE__ */Symbol.for("react.async_mode"):60111,s=e?/* @__PURE__ */Symbol.for("react.concurrent_mode"):60111,u=e?/* @__PURE__ */Symbol.for("react.forward_ref"):60112,d=e?/* @__PURE__ */Symbol.for("react.suspense"):60113,m=e?/* @__PURE__ */Symbol.for("react.suspense_list"):60120,p=e?/* @__PURE__ */Symbol.for("react.memo"):60115,f=e?/* @__PURE__ */Symbol.for("react.lazy"):60116,h=e?/* @__PURE__ */Symbol.for("react.block"):60121,y=e?/* @__PURE__ */Symbol.for("react.fundamental"):60117,g=e?/* @__PURE__ */Symbol.for("react.responder"):60118,v=e?/* @__PURE__ */Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var m=e.$$typeof;switch(m){case t:switch(e=e.type){case c:case s:case r:case a:case o:case d:return e;default:switch(e=e&&e.$$typeof){case i:case u:case f:case p:case l:return e;default:return m}}case n:return m}}}function x(e){return b(e)===s}return ct.AsyncMode=c,ct.ConcurrentMode=s,ct.ContextConsumer=i,ct.ContextProvider=l,ct.Element=t,ct.ForwardRef=u,ct.Fragment=r,ct.Lazy=f,ct.Memo=p,ct.Portal=n,ct.Profiler=a,ct.StrictMode=o,ct.Suspense=d,ct.isAsyncMode=function(e){return x(e)||b(e)===c},ct.isConcurrentMode=x,ct.isContextConsumer=function(e){return b(e)===i},ct.isContextProvider=function(e){return b(e)===l},ct.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},ct.isForwardRef=function(e){return b(e)===u},ct.isFragment=function(e){return b(e)===r},ct.isLazy=function(e){return b(e)===f},ct.isMemo=function(e){return b(e)===p},ct.isPortal=function(e){return b(e)===n},ct.isProfiler=function(e){return b(e)===a},ct.isStrictMode=function(e){return b(e)===o},ct.isSuspense=function(e){return b(e)===d},ct.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===s||e===a||e===o||e===d||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===p||e.$$typeof===l||e.$$typeof===i||e.$$typeof===u||e.$$typeof===y||e.$$typeof===g||e.$$typeof===v||e.$$typeof===h)},ct.typeOf=b,ct}():it.exports=(st||(st=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?/* @__PURE__ */Symbol.for("react.element"):60103,n=e?/* @__PURE__ */Symbol.for("react.portal"):60106,r=e?/* @__PURE__ */Symbol.for("react.fragment"):60107,o=e?/* @__PURE__ */Symbol.for("react.strict_mode"):60108,a=e?/* @__PURE__ */Symbol.for("react.profiler"):60114,l=e?/* @__PURE__ */Symbol.for("react.provider"):60109,i=e?/* @__PURE__ */Symbol.for("react.context"):60110,c=e?/* @__PURE__ */Symbol.for("react.async_mode"):60111,s=e?/* @__PURE__ */Symbol.for("react.concurrent_mode"):60111,u=e?/* @__PURE__ */Symbol.for("react.forward_ref"):60112,d=e?/* @__PURE__ */Symbol.for("react.suspense"):60113,m=e?/* @__PURE__ */Symbol.for("react.suspense_list"):60120,p=e?/* @__PURE__ */Symbol.for("react.memo"):60115,f=e?/* @__PURE__ */Symbol.for("react.lazy"):60116,h=e?/* @__PURE__ */Symbol.for("react.block"):60121,y=e?/* @__PURE__ */Symbol.for("react.fundamental"):60117,g=e?/* @__PURE__ */Symbol.for("react.responder"):60118,v=e?/* @__PURE__ */Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var m=e.$$typeof;switch(m){case t:var h=e.type;switch(h){case c:case s:case r:case a:case o:case d:return h;default:var y=h&&h.$$typeof;switch(y){case i:case u:case f:case p:case l:return y;default:return m}}case n:return m}}}var x=c,w=s,C=i,k=l,S=t,N=u,E=r,M=f,T=p,L=n,D=a,R=o,B=d,O=!1;function A(e){return b(e)===s}St.AsyncMode=x,St.ConcurrentMode=w,St.ContextConsumer=C,St.ContextProvider=k,St.Element=S,St.ForwardRef=N,St.Fragment=E,St.Lazy=M,St.Memo=T,St.Portal=L,St.Profiler=D,St.StrictMode=R,St.Suspense=B,St.isAsyncMode=function(e){return O||(O=!0),A(e)||b(e)===c},St.isConcurrentMode=A,St.isContextConsumer=function(e){return b(e)===i},St.isContextProvider=function(e){return b(e)===l},St.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},St.isForwardRef=function(e){return b(e)===u},St.isFragment=function(e){return b(e)===r},St.isLazy=function(e){return b(e)===f},St.isMemo=function(e){return b(e)===p},St.isPortal=function(e){return b(e)===n},St.isProfiler=function(e){return b(e)===a},St.isStrictMode=function(e){return b(e)===o},St.isSuspense=function(e){return b(e)===d},St.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===s||e===a||e===o||e===d||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===p||e.$$typeof===l||e.$$typeof===i||e.$$typeof===u||e.$$typeof===y||e.$$typeof===g||e.$$typeof===v||e.$$typeof===h)},St.typeOf=b}()),St)),it.exports}function Et(){if(mt)return dt;mt=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return dt=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(o){return!1}}()?Object.assign:function(r,o){for(var a,l,i=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),c=1;c<arguments.length;c++){for(var s in a=Object(arguments[c]))t.call(a,s)&&(i[s]=a[s]);if(e){l=e(a);for(var u=0;u<l.length;u++)n.call(a,l[u])&&(i[l[u]]=a[l[u]])}}return i},dt}function Mt(){if(ft)return pt;ft=1;return pt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Tt(){return yt?ht:(yt=1,ht=Function.call.bind(Object.prototype.hasOwnProperty))}function Lt(){if(vt)return gt;vt=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=/* @__PURE__ */Mt(),n={},r=/* @__PURE__ */Tt();e=function(e){var t="Warning: "+e;try{throw new Error(t)}catch(n){}}}function o(o,a,l,i,c){if("production"!==process.env.NODE_ENV)for(var s in o)if(r(o,s)){var u;try{if("function"!=typeof o[s]){var d=Error((i||"React class")+": "+l+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}u=o[s](a,s,i,l,null,t)}catch(p){u=p}if(!u||u instanceof Error||e((i||"React class")+": type specification of "+l+" `"+s+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in n)){n[u.message]=!0;var m=c?c():"";e("Failed "+l+" type: "+u.message+(null!=m?m:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},gt=o}function Dt(){if(xt)return bt;xt=1;var e=Nt(),t=Et(),n=/* @__PURE__ */Mt(),r=/* @__PURE__ */Tt(),o=/* @__PURE__ */Lt(),a=function(){};function l(){return null}return"production"!==process.env.NODE_ENV&&(a=function(e){var t="Warning: "+e;try{throw new Error(t)}catch(n){}}),bt=function(i,c){var s="function"==typeof Symbol&&Symbol.iterator;var u="<<anonymous>>",d={array:h("array"),bigint:h("bigint"),bool:h("boolean"),func:h("function"),number:h("number"),object:h("object"),string:h("string"),symbol:h("symbol"),any:f(l),arrayOf:function(e){return f((function(t,r,o,a,l){if("function"!=typeof e)return new p("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var i=t[r];if(!Array.isArray(i))return new p("Invalid "+a+" `"+l+"` of type `"+v(i)+"` supplied to `"+o+"`, expected an array.");for(var c=0;c<i.length;c++){var s=e(i,c,o,a,l+"["+c+"]",n);if(s instanceof Error)return s}return null}))},element:f((function(e,t,n,r,o){var a=e[t];return i(a)?null:new p("Invalid "+r+" `"+o+"` of type `"+v(a)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:f((function(t,n,r,o,a){var l=t[n];return e.isValidElementType(l)?null:new p("Invalid "+o+" `"+a+"` of type `"+v(l)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return f((function(t,n,r,o,a){if(!(t[n]instanceof e)){var l=e.name||u;return new p("Invalid "+o+" `"+a+"` of type `"+(((i=t[n]).constructor&&i.constructor.name?i.constructor.name:u)+"` supplied to `")+r+"`, expected instance of `"+l+"`.")}var i;return null}))},node:f((function(e,t,n,r,o){return g(e[t])?null:new p("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return f((function(t,o,a,l,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+a+"` has invalid PropType notation inside objectOf.");var c=t[o],s=v(c);if("object"!==s)return new p("Invalid "+l+" `"+i+"` of type `"+s+"` supplied to `"+a+"`, expected an object.");for(var u in c)if(r(c,u)){var d=e(c,u,a,l,i+"."+u,n);if(d instanceof Error)return d}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&a(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),l;return f((function(t,n,r,o,a){for(var l=t[n],i=0;i<e.length;i++)if(m(l,e[i]))return null;var c=JSON.stringify(e,(function(e,t){return"symbol"===b(t)?String(t):t}));return new p("Invalid "+o+" `"+a+"` of value `"+String(l)+"` supplied to `"+r+"`, expected one of "+c+".")}))},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&a("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+x(o)+" at index "+t+"."),l}return f((function(t,o,a,l,i){for(var c=[],s=0;s<e.length;s++){var u=(0,e[s])(t,o,a,l,i,n);if(null==u)return null;u.data&&r(u.data,"expectedType")&&c.push(u.data.expectedType)}return new p("Invalid "+l+" `"+i+"` supplied to `"+a+"`"+(c.length>0?", expected one of type ["+c.join(", ")+"]":"")+".")}))},shape:function(e){return f((function(t,r,o,a,l){var i=t[r],c=v(i);if("object"!==c)return new p("Invalid "+a+" `"+l+"` of type `"+c+"` supplied to `"+o+"`, expected `object`.");for(var s in e){var u=e[s];if("function"!=typeof u)return y(o,a,l,s,b(u));var d=u(i,s,o,a,l+"."+s,n);if(d)return d}return null}))},exact:function(e){return f((function(o,a,l,i,c){var s=o[a],u=v(s);if("object"!==u)return new p("Invalid "+i+" `"+c+"` of type `"+u+"` supplied to `"+l+"`, expected `object`.");var d=t({},o[a],e);for(var m in d){var f=e[m];if(r(e,m)&&"function"!=typeof f)return y(l,i,c,m,b(f));if(!f)return new p("Invalid "+i+" `"+c+"` key `"+m+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(o[a],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=f(s,m,l,i,c+"."+m,n);if(h)return h}return null}))}};function m(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function f(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function o(o,l,i,s,d,m,f){if(s=s||u,m=m||i,f!==n){if(c){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var y=s+":"+i;!t[y]&&r<3&&(a("You are manually calling a React.PropTypes validation function for the `"+m+"` prop on `"+s+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[y]=!0,r++)}}return null==l[i]?o?null===l[i]?new p("The "+d+" `"+m+"` is marked as required in `"+s+"`, but its value is `null`."):new p("The "+d+" `"+m+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:e(l,i,s,d,m)}var l=o.bind(null,!1);return l.isRequired=o.bind(null,!0),l}function h(e){return f((function(t,n,r,o,a,l){var i=t[n];return v(i)!==e?new p("Invalid "+o+" `"+a+"` of type `"+b(i)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function y(e,t,n,r,o){return new p((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function g(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(g);if(null===e||i(e))return!0;var t=function(e){var t=e&&(s&&e[s]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!g(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.value;if(o&&!g(o[1]))return!1}return!0;default:return!1}}function v(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function b(e){if(null==e)return""+e;var t=v(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function x(e){var t=b(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return p.prototype=Error.prototype,d.checkPropTypes=o,d.resetWarningCache=o.resetWarningCache,d.PropTypes=d,d},bt}function Rt(){if(Ct)return wt;Ct=1;var e=/* @__PURE__ */Mt();function t(){}function n(){}return n.resetWarningCache=t,wt=function(){function r(t,n,r,o,a,l){if(l!==e){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function o(){return r}r.isRequired=r;var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a}}function Bt(){if(kt)return lt.exports;if(kt=1,"production"!==process.env.NODE_ENV){var e=Nt();lt.exports=/* @__PURE__ */Dt()(e.isElement,true)}else lt.exports=/* @__PURE__ */Rt()();return lt.exports}const Ot=/* @__PURE__ */ot(/* @__PURE__ */Bt()),At=(e,t="0 0 24 24")=>({size:n=18,className:r=""})=>/* @__PURE__ */H("svg",{width:n,height:n,viewBox:t,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`rmx-icon ${r}`,children:"string"==typeof e?/* @__PURE__ */H("path",{d:e}):e}),Pt=(e,t="0 0 24 24")=>({size:n=18,className:r=""})=>/* @__PURE__ */H("svg",{width:n,height:n,viewBox:t,fill:"currentColor",className:`rmx-icon ${r}`,children:e}),zt=Pt(
2
+ /* @__PURE__ */H("path",{d:"M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6zM6 12h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})),$t=At(
3
+ /* @__PURE__ */W(V,{children:[
4
+ /* @__PURE__ */H("line",{x1:"19",y1:"4",x2:"10",y2:"4"}),
5
+ /* @__PURE__ */H("line",{x1:"14",y1:"20",x2:"5",y2:"20"}),
6
+ /* @__PURE__ */H("line",{x1:"15",y1:"4",x2:"9",y2:"20"})]})),jt=At(
7
+ /* @__PURE__ */W(V,{children:[
8
+ /* @__PURE__ */H("path",{d:"M6 3v7a6 6 0 0 0 6 6 6 6 0 0 0 6-6V3"}),
9
+ /* @__PURE__ */H("line",{x1:"4",y1:"21",x2:"20",y2:"21"})]})),Ft=At(
10
+ /* @__PURE__ */W(V,{children:[
11
+ /* @__PURE__ */H("path",{d:"M16 4H9a3 3 0 0 0-3 3c0 2 1.5 3 4 3.5"}),
12
+ /* @__PURE__ */H("path",{d:"M14 16.5c0 1.38-1.12 2.5-2.5 2.5H9"}),
13
+ /* @__PURE__ */H("line",{x1:"4",y1:"12",x2:"20",y2:"12"})]})),_t=Pt(
14
+ /* @__PURE__ */W(V,{children:[
15
+ /* @__PURE__ */H("text",{x:"2",y:"16",fontSize:"16",fontWeight:"bold",fill:"currentColor",stroke:"none",children:"x"}),
16
+ /* @__PURE__ */H("text",{x:"14",y:"20",fontSize:"10",fill:"currentColor",stroke:"none",children:"2"})]})),It=Pt(
17
+ /* @__PURE__ */W(V,{children:[
18
+ /* @__PURE__ */H("text",{x:"2",y:"18",fontSize:"16",fontWeight:"bold",fill:"currentColor",stroke:"none",children:"x"}),
19
+ /* @__PURE__ */H("text",{x:"14",y:"10",fontSize:"10",fill:"currentColor",stroke:"none",children:"2"})]})),Ht=Pt(
20
+ /* @__PURE__ */H(V,{children:/* @__PURE__ */H("path",{d:"M6 4v16M18 4v16M6 12h12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})),Wt=At(
21
+ /* @__PURE__ */W(V,{children:[
22
+ /* @__PURE__ */H("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),
23
+ /* @__PURE__ */H("line",{x1:"3",y1:"12",x2:"15",y2:"12"}),
24
+ /* @__PURE__ */H("line",{x1:"3",y1:"18",x2:"18",y2:"18"})]})),Vt=At(
25
+ /* @__PURE__ */W(V,{children:[
26
+ /* @__PURE__ */H("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),
27
+ /* @__PURE__ */H("line",{x1:"6",y1:"12",x2:"18",y2:"12"}),
28
+ /* @__PURE__ */H("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]})),qt=At(
29
+ /* @__PURE__ */W(V,{children:[
30
+ /* @__PURE__ */H("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),
31
+ /* @__PURE__ */H("line",{x1:"9",y1:"12",x2:"21",y2:"12"}),
32
+ /* @__PURE__ */H("line",{x1:"6",y1:"18",x2:"21",y2:"18"})]})),Yt=At(
33
+ /* @__PURE__ */W(V,{children:[
34
+ /* @__PURE__ */H("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),
35
+ /* @__PURE__ */H("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),
36
+ /* @__PURE__ */H("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})),Ut=At(
37
+ /* @__PURE__ */W(V,{children:[
38
+ /* @__PURE__ */H("line",{x1:"10",y1:"6",x2:"21",y2:"6"}),
39
+ /* @__PURE__ */H("line",{x1:"10",y1:"12",x2:"21",y2:"12"}),
40
+ /* @__PURE__ */H("line",{x1:"10",y1:"18",x2:"21",y2:"18"}),
41
+ /* @__PURE__ */H("text",{x:"4",y:"7.5",fontSize:"6",fill:"currentColor",stroke:"none",fontWeight:"bold",children:"1."}),
42
+ /* @__PURE__ */H("text",{x:"4",y:"13.5",fontSize:"6",fill:"currentColor",stroke:"none",fontWeight:"bold",children:"2."}),
43
+ /* @__PURE__ */H("text",{x:"4",y:"19.5",fontSize:"6",fill:"currentColor",stroke:"none",fontWeight:"bold",children:"3."})]})),Xt=At(
44
+ /* @__PURE__ */W(V,{children:[
45
+ /* @__PURE__ */H("line",{x1:"9",y1:"6",x2:"21",y2:"6"}),
46
+ /* @__PURE__ */H("line",{x1:"9",y1:"12",x2:"21",y2:"12"}),
47
+ /* @__PURE__ */H("line",{x1:"9",y1:"18",x2:"21",y2:"18"}),
48
+ /* @__PURE__ */H("circle",{cx:"5",cy:"6",r:"1.5",fill:"currentColor",stroke:"none"}),
49
+ /* @__PURE__ */H("circle",{cx:"5",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),
50
+ /* @__PURE__ */H("circle",{cx:"5",cy:"18",r:"1.5",fill:"currentColor",stroke:"none"})]})),Gt=At(
51
+ /* @__PURE__ */W(V,{children:[
52
+ /* @__PURE__ */H("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),
53
+ /* @__PURE__ */H("line",{x1:"13",y1:"6",x2:"21",y2:"6"}),
54
+ /* @__PURE__ */H("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),
55
+ /* @__PURE__ */H("line",{x1:"13",y1:"18",x2:"21",y2:"18"}),
56
+ /* @__PURE__ */H("polyline",{points:"5.5 5.5 6.5 7 8.5 4",strokeWidth:"1.5"})]})),Kt=At(
57
+ /* @__PURE__ */W(V,{children:[
58
+ /* @__PURE__ */H("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),
59
+ /* @__PURE__ */H("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})),Jt=At(
60
+ /* @__PURE__ */W(V,{children:[
61
+ /* @__PURE__ */H("path",{d:"M18.84 12.25l1.72-1.71a5 5 0 0 0-7.07-7.07l-3 3a5 5 0 0 0 .12 7.19"}),
62
+ /* @__PURE__ */H("path",{d:"M5.16 11.75l-1.72 1.71a5 5 0 0 0 7.07 7.07l3-3a5 5 0 0 0-.12-7.19"}),
63
+ /* @__PURE__ */H("line",{x1:"2",y1:"2",x2:"22",y2:"22"})]})),Zt=At(
64
+ /* @__PURE__ */W(V,{children:[
65
+ /* @__PURE__ */H("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),
66
+ /* @__PURE__ */H("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),
67
+ /* @__PURE__ */H("polyline",{points:"21 15 16 10 5 21"})]})),Qt=At(
68
+ /* @__PURE__ */W(V,{children:[
69
+ /* @__PURE__ */H("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),
70
+ /* @__PURE__ */H("line",{x1:"3",y1:"9",x2:"21",y2:"9"}),
71
+ /* @__PURE__ */H("line",{x1:"3",y1:"15",x2:"21",y2:"15"}),
72
+ /* @__PURE__ */H("line",{x1:"9",y1:"3",x2:"9",y2:"21"}),
73
+ /* @__PURE__ */H("line",{x1:"15",y1:"3",x2:"15",y2:"21"})]})),en=Pt(
74
+ /* @__PURE__ */W(V,{children:[
75
+ /* @__PURE__ */H("path",{d:"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z"}),
76
+ /* @__PURE__ */H("path",{d:"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z"})]})),tn=At(
77
+ /* @__PURE__ */W(V,{children:[
78
+ /* @__PURE__ */H("polyline",{points:"16 18 22 12 16 6"}),
79
+ /* @__PURE__ */H("polyline",{points:"8 6 2 12 8 18"})]})),nn=At(
80
+ /* @__PURE__ */H("line",{x1:"3",y1:"12",x2:"21",y2:"12",strokeWidth:"3"})),rn=At(
81
+ /* @__PURE__ */W(V,{children:[
82
+ /* @__PURE__ */H("polyline",{points:"1 4 1 10 7 10"}),
83
+ /* @__PURE__ */H("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]})),on=At(
84
+ /* @__PURE__ */W(V,{children:[
85
+ /* @__PURE__ */H("polyline",{points:"23 4 23 10 17 10"}),
86
+ /* @__PURE__ */H("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})),an=Pt(
87
+ /* @__PURE__ */H("text",{x:"3",y:"18",fontSize:"18",fontWeight:"bold",fill:"currentColor",stroke:"none",fontFamily:"serif",children:"T"})),ln=Pt(
88
+ /* @__PURE__ */W(V,{children:[
89
+ /* @__PURE__ */H("text",{x:"1",y:"20",fontSize:"20",fontWeight:"bold",fill:"currentColor",stroke:"none",children:"A"}),
90
+ /* @__PURE__ */H("text",{x:"14",y:"20",fontSize:"12",fill:"currentColor",stroke:"none",children:"A"})]})),cn=At(
91
+ /* @__PURE__ */W(V,{children:[
92
+ /* @__PURE__ */H("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),
93
+ /* @__PURE__ */H("polygon",{points:"10 9 15 12 10 15",fill:"currentColor",stroke:"none"})]})),sn=At(
94
+ /* @__PURE__ */W(V,{children:[
95
+ /* @__PURE__ */H("circle",{cx:"11",cy:"11",r:"8"}),
96
+ /* @__PURE__ */H("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})),un=At(
97
+ /* @__PURE__ */W(V,{children:[
98
+ /* @__PURE__ */H("polyline",{points:"16 18 22 12 16 6"}),
99
+ /* @__PURE__ */H("polyline",{points:"8 6 2 12 8 18"}),
100
+ /* @__PURE__ */H("line",{x1:"14",y1:"4",x2:"10",y2:"20",strokeWidth:"1"})]})),dn=At(
101
+ /* @__PURE__ */W(V,{children:[
102
+ /* @__PURE__ */H("polyline",{points:"15 3 21 3 21 9"}),
103
+ /* @__PURE__ */H("polyline",{points:"9 21 3 21 3 15"}),
104
+ /* @__PURE__ */H("line",{x1:"21",y1:"3",x2:"14",y2:"10"}),
105
+ /* @__PURE__ */H("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]})),mn=At(
106
+ /* @__PURE__ */W(V,{children:[
107
+ /* @__PURE__ */H("polyline",{points:"4 14 10 14 10 20"}),
108
+ /* @__PURE__ */H("polyline",{points:"20 10 14 10 14 4"}),
109
+ /* @__PURE__ */H("line",{x1:"14",y1:"10",x2:"21",y2:"3"}),
110
+ /* @__PURE__ */H("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]})),pn=At(
111
+ /* @__PURE__ */W(V,{children:[
112
+ /* @__PURE__ */H("line",{x1:"21",y1:"6",x2:"11",y2:"6"}),
113
+ /* @__PURE__ */H("line",{x1:"21",y1:"12",x2:"11",y2:"12"}),
114
+ /* @__PURE__ */H("line",{x1:"21",y1:"18",x2:"11",y2:"18"}),
115
+ /* @__PURE__ */H("polyline",{points:"3 8 7 12 3 16"})]})),fn=At(
116
+ /* @__PURE__ */W(V,{children:[
117
+ /* @__PURE__ */H("line",{x1:"21",y1:"6",x2:"11",y2:"6"}),
118
+ /* @__PURE__ */H("line",{x1:"21",y1:"12",x2:"11",y2:"12"}),
119
+ /* @__PURE__ */H("line",{x1:"21",y1:"18",x2:"11",y2:"18"}),
120
+ /* @__PURE__ */H("polyline",{points:"7 8 3 12 7 16"})]})),hn=At(
121
+ /* @__PURE__ */W(V,{children:[
122
+ /* @__PURE__ */H("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),
123
+ /* @__PURE__ */H("polyline",{points:"7 10 12 15 17 10"}),
124
+ /* @__PURE__ */H("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})),yn=At(
125
+ /* @__PURE__ */W(V,{children:[
126
+ /* @__PURE__ */H("polyline",{points:"4 17 10 11 4 5"}),
127
+ /* @__PURE__ */H("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})),gn=Pt(
128
+ /* @__PURE__ */W(V,{children:[
129
+ /* @__PURE__ */H("path",{d:"M3 5h18v14H3V5zm2 2v10h14V7H5z",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),
130
+ /* @__PURE__ */H("path",{d:"M7 15V9l2.5 3L12 9v6",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),
131
+ /* @__PURE__ */H("path",{d:"M17 15l-2-2.5V15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),
132
+ /* @__PURE__ */H("path",{d:"M15 12.5V9",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})),vn=At(
133
+ /* @__PURE__ */W(V,{children:[
134
+ /* @__PURE__ */H("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),
135
+ /* @__PURE__ */H("polyline",{points:"14 2 14 8 20 8"}),
136
+ /* @__PURE__ */H("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),
137
+ /* @__PURE__ */H("polyline",{points:"9 15 12 12 15 15"})]})),bn=At(
138
+ /* @__PURE__ */H(V,{children:/* @__PURE__ */H("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})})),xn=At(
139
+ /* @__PURE__ */W(V,{children:[
140
+ /* @__PURE__ */H("path",{d:"M6 4h12l-4 16"}),
141
+ /* @__PURE__ */H("line",{x1:"2",y1:"21",x2:"22",y2:"3",strokeWidth:"2"})]})),wn=At(
142
+ /* @__PURE__ */W(V,{children:[
143
+ /* @__PURE__ */H("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),
144
+ /* @__PURE__ */H("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})),Cn=At(
145
+ /* @__PURE__ */H("polyline",{points:"6 9 12 15 18 9"})),kn=At(
146
+ /* @__PURE__ */H("polyline",{points:"9 6 15 12 9 18"})),Sn=At(
147
+ /* @__PURE__ */H("polyline",{points:"20 6 9 17 4 12"})),Nn=At(
148
+ /* @__PURE__ */W(V,{children:[
149
+ /* @__PURE__ */H("polyline",{points:"3 6 5 6 21 6"}),
150
+ /* @__PURE__ */H("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})),En=At(
151
+ /* @__PURE__ */W(V,{children:[
152
+ /* @__PURE__ */H("rect",{x:"3",y:"3",width:"18",height:"18",rx:"3"}),
153
+ /* @__PURE__ */H("line",{x1:"12",y1:"8",x2:"12",y2:"12",strokeWidth:"2"}),
154
+ /* @__PURE__ */H("circle",{cx:"12",cy:"16",r:"1",fill:"currentColor",stroke:"none"})]})),Mn=Pt(
155
+ /* @__PURE__ */W(V,{children:[
156
+ /* @__PURE__ */H("text",{x:"2",y:"18",fontSize:"16",fontWeight:"bold",fill:"currentColor",stroke:"none",fontStyle:"italic",fontFamily:"serif",children:"f"}),
157
+ /* @__PURE__ */H("text",{x:"10",y:"14",fontSize:"12",fill:"currentColor",stroke:"none",children:"(x)"})]})),Tn=At(
158
+ /* @__PURE__ */W(V,{children:[
159
+ /* @__PURE__ */H("line",{x1:"3",y1:"6",x2:"5",y2:"6",strokeWidth:"2"}),
160
+ /* @__PURE__ */H("line",{x1:"8",y1:"6",x2:"18",y2:"6"}),
161
+ /* @__PURE__ */H("line",{x1:"5",y1:"12",x2:"7",y2:"12",strokeWidth:"2"}),
162
+ /* @__PURE__ */H("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),
163
+ /* @__PURE__ */H("line",{x1:"5",y1:"18",x2:"7",y2:"18",strokeWidth:"2"}),
164
+ /* @__PURE__ */H("line",{x1:"10",y1:"18",x2:"17",y2:"18"})]})),Ln=At(
165
+ /* @__PURE__ */H("path",{d:"M6 2h12a1 1 0 0 1 1 1v18l-7-4-7 4V3a1 1 0 0 1 1-1z"})),Dn=At(
166
+ /* @__PURE__ */W(V,{children:[
167
+ /* @__PURE__ */H("path",{d:"M7 8l-4 4 4 4"}),
168
+ /* @__PURE__ */H("path",{d:"M17 8l4 4-4 4"}),
169
+ /* @__PURE__ */H("line",{x1:"14",y1:"4",x2:"10",y2:"20"})]})),Rn=At(
170
+ /* @__PURE__ */W(V,{children:[
171
+ /* @__PURE__ */H("text",{x:"2",y:"15",fontSize:"14",fontWeight:"bold",fill:"currentColor",stroke:"none",children:"ABC"}),
172
+ /* @__PURE__ */H("polyline",{points:"16 18 18 20 22 14",strokeWidth:"2.5"})]})),Bn=At(
173
+ /* @__PURE__ */W(V,{children:[
174
+ /* @__PURE__ */H("rect",{x:"3",y:"14",width:"4",height:"7",rx:"1"}),
175
+ /* @__PURE__ */H("rect",{x:"10",y:"9",width:"4",height:"12",rx:"1"}),
176
+ /* @__PURE__ */H("rect",{x:"17",y:"4",width:"4",height:"17",rx:"1"})]})),On=At(
177
+ /* @__PURE__ */H(V,{children:/* @__PURE__ */H("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})),An=At(
178
+ /* @__PURE__ */W(V,{children:[
179
+ /* @__PURE__ */H("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),
180
+ /* @__PURE__ */H("circle",{cx:"9",cy:"7",r:"4"}),
181
+ /* @__PURE__ */H("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),
182
+ /* @__PURE__ */H("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})),Pn=At(
183
+ /* @__PURE__ */W(V,{children:[
184
+ /* @__PURE__ */H("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),
185
+ /* @__PURE__ */H("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]})),zn=At(
186
+ /* @__PURE__ */W(V,{children:[
187
+ /* @__PURE__ */H("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),
188
+ /* @__PURE__ */H("line",{x1:"12",y1:"3",x2:"12",y2:"21"})]})),$n={bold:zt,italic:$t,underline:jt,strikethrough:Ft,subscript:_t,superscript:It,heading:Ht,headings:Ht,alignLeft:Wt,alignCenter:Vt,alignRight:qt,alignJustify:Yt,orderedList:Ut,unorderedList:Xt,taskList:Gt,link:Kt,insertLink:Kt,unlink:Jt,image:Zt,insertImage:Zt,table:Qt,insertTable:Qt,blockquote:en,codeBlock:tn,horizontalRule:nn,undo:rn,redo:on,foreColor:({size:e=18,color:t="#000000",className:n=""})=>/* @__PURE__ */W("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:`rmx-icon ${n}`,children:[
189
+ /* @__PURE__ */H("text",{x:"6",y:"16",fontSize:"16",fontWeight:"bold",fill:"currentColor",stroke:"none",children:"A"}),
190
+ /* @__PURE__ */H("rect",{x:"3",y:"20",width:"18",height:"3",rx:"1",fill:t})]}),backColor:({size:e=18,color:t="#ffff00",className:n=""})=>/* @__PURE__ */W("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:`rmx-icon ${n}`,children:[
191
+ /* @__PURE__ */H("rect",{x:"2",y:"2",width:"20",height:"16",rx:"2",fill:t,opacity:"0.3"}),
192
+ /* @__PURE__ */H("text",{x:"6",y:"14",fontSize:"14",fontWeight:"bold",fill:"currentColor",stroke:"none",children:"A"}),
193
+ /* @__PURE__ */H("rect",{x:"3",y:"20",width:"18",height:"3",rx:"1",fill:t})]}),fontFamily:an,fontSize:ln,embedMedia:cn,findReplace:sn,sourceMode:un,fullscreen:dn,exitFullscreen:mn,indent:pn,outdent:fn,removeFormat:xn,close:wn,chevronDown:Cn,check:Sn,trash:Nn,attachment:bn,insertAttachment:bn,importDocument:vn,toggleMarkdown:gn,export:hn,commandPalette:yn,insertCallout:En,callout:En,insertMath:Mn,math:Mn,insertToc:Tn,toc:Tn,insertBookmark:Ln,bookmark:Ln,insertMergeTag:Dn,mergeTag:Dn,analytics:Bn,getAnalytics:Bn,toggleAnalytics:Bn,spellcheck:Rn,toggleSpellcheck:Rn,checkGrammar:Rn,addComment:On,comment:On,collaboration:An,startCollaboration:An,stopCollaboration:An,distractionFree:Pn,splitView:zn,toggleSplitView:zn};const jn=q.memo((function({text:e,shortcut:t,children:n}){const[r,o]=U(!1),a=Y(null),l=X((()=>{a.current=setTimeout((()=>o(!0)),200)}),[]),i=X((()=>{clearTimeout(a.current),o(!1)}),[]);return e?/* @__PURE__ */W("span",{className:"rmx-tooltip-wrap",onMouseEnter:l,onMouseLeave:i,onFocus:l,onBlur:i,children:[n,r&&/* @__PURE__ */W("span",{className:"rmx-tooltip",role:"tooltip","aria-hidden":"true",children:[
194
+ /* @__PURE__ */H("span",{className:"rmx-tooltip-text",children:t?`${e} — ${t}`:e}),
195
+ /* @__PURE__ */H("span",{className:"rmx-tooltip-arrow"})]})]}):n})),Fn=q.memo((function({command:e,icon:t,tooltip:n,active:r,disabled:o,onClick:a,shortcutLabel:l,children:i,itemStyle:c}){const s=i?null:$n[t||e],u=X((e=>{e.preventDefault(),e.stopPropagation(),o||a?.()}),[o,a]),d=X((e=>e.preventDefault()),[]);/* @__PURE__ */
196
+ return H(jn,{text:n,shortcut:l,children:/* @__PURE__ */H("button",{className:`rmx-toolbar-btn ${r?"rmx-active":""} ${o?"rmx-disabled":""}`,style:c||void 0,onClick:u,onMouseDown:d,disabled:o,type:"button","aria-pressed":r,"aria-label":n,children:i||(s?/* @__PURE__ */H(s,{size:18}):e)})})}));Fn.propTypes={command:Ot.string,icon:Ot.string,tooltip:Ot.string,active:Ot.bool,disabled:Ot.bool,onClick:Ot.func,shortcutLabel:Ot.string,children:Ot.node,itemStyle:Ot.object};const _n=q.memo((function({label:e,value:t,options:n,onChange:r,tooltip:o,icon:a,width:l=120,itemStyle:i}){const[c,s]=U(!1),[u,d]=U(-1),m=Y(null),p=Y(null);G((()=>{if(!c)return;const e=e=>{m.current&&!m.current.contains(e.target)&&s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[c]),G((()=>{if(c){const e=n.findIndex((e=>e.value===t));d(e>=0?e:0)}}),[c,n,t]);const f=n.find((e=>e.value===t)),h=f?.label||e,y=X((e=>{e.preventDefault(),s((e=>!e))}),[]),g=X((e=>e.preventDefault()),[]),v=X((e=>{if(c)switch(e.key){case"ArrowDown":e.preventDefault(),d((e=>(e+1)%n.length));break;case"ArrowUp":e.preventDefault(),d((e=>(e-1+n.length)%n.length));break;case"Enter":case" ":e.preventDefault(),u>=0&&u<n.length&&(r(n[u].value),s(!1));break;case"Escape":e.preventDefault(),s(!1)}else"ArrowDown"!==e.key&&"ArrowUp"!==e.key&&"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),s(!0))}),[c,u,n,r]);G((()=>{if(c&&p.current&&u>=0){const e=p.current.querySelectorAll('[role="option"]');e[u]&&e[u].scrollIntoView({block:"nearest"})}}),[c,u]);const b=c&&u>=0?`rmx-dd-opt-${n[u]?.value}`:void 0;/* @__PURE__ */
197
+ return W("div",{className:"rmx-toolbar-dropdown",ref:m,style:{minWidth:l,...i},children:[
198
+ /* @__PURE__ */W("button",{className:"rmx-toolbar-btn rmx-toolbar-dropdown-btn",onClick:y,onMouseDown:g,onKeyDown:v,title:o,"aria-label":o,type:"button","aria-haspopup":"listbox","aria-expanded":c,"aria-activedescendant":b,children:[a&&/* @__PURE__ */H(a,{size:16}),
199
+ /* @__PURE__ */H("span",{className:"rmx-toolbar-dropdown-label",children:h}),
200
+ /* @__PURE__ */H(Cn,{size:14})]}),c&&/* @__PURE__ */H("div",{className:"rmx-toolbar-dropdown-menu",role:"listbox",ref:p,children:n.map(((e,n)=>/* @__PURE__ */H("button",{id:`rmx-dd-opt-${e.value}`,className:`rmx-toolbar-dropdown-item ${e.value===t?"rmx-active":""} ${n===u?"rmx-focused":""}`,onClick:t=>{t.preventDefault(),r(e.value),s(!1)},onMouseDown:g,onMouseEnter:()=>d(n),role:"option","aria-selected":e.value===t,type:"button",style:e.style,children:e.label},e.value)))})]})}));_n.propTypes={label:Ot.string,value:Ot.string,options:Ot.arrayOf(Ot.shape({value:Ot.string.isRequired,label:Ot.string.isRequired,style:Ot.object})).isRequired,onChange:Ot.func.isRequired,tooltip:Ot.string,icon:Ot.elementType,width:Ot.number,itemStyle:Ot.object};const In={"#000000":"Black","#ffffff":"White","#ff0000":"Red","#00ff00":"Lime","#0000ff":"Blue","#ffff00":"Yellow","#ff00ff":"Magenta","#00ffff":"Cyan","#808080":"Gray","#800000":"Maroon","#808000":"Olive","#008000":"Green","#800080":"Purple","#008080":"Teal","#000080":"Navy","#c0c0c0":"Silver","#ffa500":"Orange","#ffc0cb":"Pink","#a52a2a":"Brown","#f5f5dc":"Beige","#ff6347":"Tomato","#4682b4":"Steel Blue","#2e8b57":"Sea Green","#daa520":"Goldenrod","#cd5c5c":"Indian Red","#4b0082":"Indigo","#ee82ee":"Violet","#f0e68c":"Khaki","#e6e6fa":"Lavender","#fa8072":"Salmon","#40e0d0":"Turquoise","#ff69b4":"Hot Pink"},Hn=q.memo((function({command:e,tooltip:t,currentColor:n,onColorSelect:r,itemStyle:o,engine:a}){const[l,i]=U(!1),[c,s]=U(-1),u=Y(null),d=Y([]);G((()=>{if(!l)return;const e=e=>{u.current&&!u.current.contains(e.target)&&i(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[l]),G((()=>{if(!l)return;const e=e=>{"Escape"===e.key&&(e.preventDefault(),i(!1))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[l]),G((()=>{if(l){const e=R.findIndex((e=>e===n));s(e>=0?e:0)}}),[l,n]),G((()=>{l&&c>=0&&d.current[c]&&d.current[c].focus()}),[l,c]);const m=$n[e],p=X((e=>{e.preventDefault(),i((e=>!e))}),[]),f=X((e=>e.preventDefault()),[]),h=X(((e,t)=>{const n=R.length;let o=t;switch(e.key){case"ArrowRight":e.preventDefault(),o=(t+1)%n;break;case"ArrowLeft":e.preventDefault(),o=(t-1+n)%n;break;case"ArrowDown":e.preventDefault(),o=t+10<n?t+10:t;break;case"ArrowUp":e.preventDefault(),o=t-10>=0?t-10:t;break;case"Enter":case" ":return e.preventDefault(),r(R[t]),void i(!1);case"Escape":return e.preventDefault(),void i(!1);default:return}s(o)}),[r]),y=X((e=>{e.preventDefault(),r(""),i(!1)}),[r]);/* @__PURE__ */
201
+ return W("div",{className:"rmx-toolbar-colorpicker",ref:u,style:o||void 0,children:[
202
+ /* @__PURE__ */H("button",{className:"rmx-toolbar-btn",onClick:p,onMouseDown:f,title:t,"aria-label":t,type:"button","aria-haspopup":"true","aria-expanded":l,children:m&&/* @__PURE__ */H(m,{size:18,color:n||("foreColor"===e?"#000000":"#ffff00")})}),l&&/* @__PURE__ */W("div",{className:"rmx-color-palette",children:[
203
+ /* @__PURE__ */H("button",{type:"button",className:"rmx-color-default-btn",onClick:y,onMouseDown:f,children:"Default"}),
204
+ /* @__PURE__ */H("div",{className:"rmx-color-grid",role:"grid",children:R.map(((e,t)=>/* @__PURE__ */H("button",{ref:e=>{d.current[t]=e},className:"rmx-color-swatch "+(e===n?"rmx-active":""),style:{backgroundColor:e},onClick:t=>{t.preventDefault(),r(e),i(!1)},onMouseDown:f,onKeyDown:e=>h(e,t),title:In[e.toLowerCase()]||e,type:"button",tabIndex:t===c?0:-1,"aria-label":`Color ${In[e.toLowerCase()]||e}`},e)))}),
205
+ /* @__PURE__ */H("div",{className:"rmx-color-custom",children:/* @__PURE__ */W("label",{children:["Custom:",
206
+ /* @__PURE__ */H("input",{type:"color",value:n||"#000000",onChange:e=>{r(e.target.value),i(!1)},onMouseDown:e=>e.stopPropagation()})]})}),
207
+ /* @__PURE__ */H(Wn,{engine:a,onColorSelect:r})]})]})}));function Wn({engine:e,onColorSelect:t}){const[n,r]=U((()=>B())),[o,a]=U(!1),[l,i]=U("");G((()=>{if(!e)return;const t=e.eventBus?.on("colorPresets:change",(({presets:e})=>r(e)));return t}),[e]);const c=()=>{l.trim()&&(O(l.trim(),[...R]),r(B()),i(""),a(!1))};return 0!==n.length||o?/* @__PURE__ */W("div",{className:"rmx-color-presets",children:[n.map((e=>/* @__PURE__ */W("div",{className:"rmx-color-preset-row",children:[
208
+ /* @__PURE__ */H("span",{className:"rmx-color-preset-name",children:e.name}),
209
+ /* @__PURE__ */H("div",{className:"rmx-color-preset-swatches",children:e.colors.slice(0,6).map(((e,n)=>/* @__PURE__ */H("button",{type:"button",className:"rmx-color-preset-swatch",style:{backgroundColor:e},onClick:()=>t(e),title:In[e.toLowerCase()]||e},n)))})]},e.name))),o?/* @__PURE__ */W("div",{className:"rmx-color-preset-save-form",children:[
210
+ /* @__PURE__ */H("input",{type:"text",value:l,onChange:e=>i(e.target.value),placeholder:"Preset name...",className:"rmx-color-preset-save-input",onKeyDown:e=>"Enter"===e.key&&c(),onMouseDown:e=>e.stopPropagation()}),
211
+ /* @__PURE__ */H("button",{type:"button",onClick:c,className:"rmx-color-preset-save-confirm",children:"Save"})]}):/* @__PURE__ */H("button",{type:"button",onClick:()=>a(!0),className:"rmx-color-preset-save-btn",style:{marginTop:2},children:"+ Save Preset"})]}):/* @__PURE__ */H("div",{className:"rmx-color-presets",children:/* @__PURE__ */H("button",{type:"button",onClick:()=>a(!0),className:"rmx-color-preset-save-btn",children:"+ Save Preset"})})}Hn.propTypes={command:Ot.string.isRequired,tooltip:Ot.string,currentColor:Ot.string,onColorSelect:Ot.func.isRequired,itemStyle:Ot.object,engine:Ot.object};const Vn=q.memo((function({separatorStyle:e}){/* @__PURE__ */
212
+ return H("div",{className:"rmx-toolbar-separator",role:"separator",style:e||void 0})}));Vn.propTypes={separatorStyle:Ot.object};const qn=["1","1.15","1.5","1.7","2","2.5","3"],Yn=["-0.5px","0","0.5px","1px","1.5px","2px","3px","5px"],Un=["0","4px","8px","12px","16px","24px","32px"],Xn=q.memo((function({engine:e,itemStyle:t}){const[n,r]=U(!1),o=Y(null);G((()=>{if(!n)return;const e=e=>{o.current&&!o.current.contains(e.target)&&r(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[n]);const a=X((e=>{e.preventDefault(),r((e=>!e))}),[]),l=X((e=>e.preventDefault()),[]),i=X((t=>{e?.executeCommand("lineHeight",t.target.value)}),[e]),c=X((t=>{e?.executeCommand("letterSpacing",t.target.value)}),[e]),s=X((t=>{e?.executeCommand("paragraphSpacing",t.target.value)}),[e]);/* @__PURE__ */
213
+ return W("div",{className:"rmx-typography-dropdown",ref:o,style:t||void 0,children:[
214
+ /* @__PURE__ */H("button",{className:"rmx-toolbar-btn",onClick:a,onMouseDown:l,title:"Typography",type:"button","aria-haspopup":"true","aria-expanded":n,children:/* @__PURE__ */H("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:/* @__PURE__ */H("path",{d:"M3 4h12M5 4v10M13 4v10M7 14h-4M15 14h-4M6 9h6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),n&&/* @__PURE__ */W("div",{className:"rmx-typography-menu",onMouseDown:l,children:[
215
+ /* @__PURE__ */W("div",{className:"rmx-typography-row",children:[
216
+ /* @__PURE__ */H("label",{children:"Line Height"}),
217
+ /* @__PURE__ */W("select",{onChange:i,defaultValue:"",children:[
218
+ /* @__PURE__ */H("option",{value:"",disabled:!0,children:"Select..."}),qn.map((e=>/* @__PURE__ */H("option",{value:e,children:e},e)))]})]}),
219
+ /* @__PURE__ */W("div",{className:"rmx-typography-row",children:[
220
+ /* @__PURE__ */H("label",{children:"Letter Spacing"}),
221
+ /* @__PURE__ */W("select",{onChange:c,defaultValue:"",children:[
222
+ /* @__PURE__ */H("option",{value:"",disabled:!0,children:"Select..."}),Yn.map((e=>/* @__PURE__ */H("option",{value:e,children:e},e)))]})]}),
223
+ /* @__PURE__ */W("div",{className:"rmx-typography-row",children:[
224
+ /* @__PURE__ */H("label",{children:"Paragraph Spacing"}),
225
+ /* @__PURE__ */W("select",{onChange:s,defaultValue:"",children:[
226
+ /* @__PURE__ */H("option",{value:"",disabled:!0,children:"Select..."}),Un.map((e=>/* @__PURE__ */H("option",{value:e,children:e},e)))]})]})]})]})})),Gn=_.map((e=>({...e,style:"p"!==e.tag?{fontSize:22-2*(parseInt(e.tag?.[1])||0)+"px",fontWeight:"bold"}:{}}))),Kn=q.memo((function({config:e,engine:t,onOpenModal:n,fonts:r=A,wordCountButton:o,toolbarItemTheme:a,customizableToolbar:l,onToolbarChange:i}){const c=rt(),s=e||L,u=Y(null),d=Y(null),[m,p]=U(-1),[f,h]=U(!1),y=Y(null),[g,v]=U(null),[b,x]=U(null),[w,C]=U((()=>{if(!l)return null;try{const e=localStorage.getItem("rmx-toolbar-order");return e?JSON.parse(e):null}catch{return null}})),k=J((()=>r.map((e=>({label:e,value:e,style:{fontFamily:e}})))),[r]),S=X((e=>{t?.executeCommand("heading","p"===e?"p":e.replace("h",""))}),[t]),N=X((e=>{t?.executeCommand("fontFamily",e)}),[t]),E=X((e=>{t?.executeCommand("fontSize",e)}),[t]),M=X((e=>{t?.executeCommand("foreColor",e)}),[t]),T=X((e=>{t?.executeCommand("backColor",e)}),[t]),D=X((()=>n?.("image")),[n]),R=X((()=>n?.("attachment")),[n]),B=X((()=>n?.("importDocument")),[n]),O=X((()=>n?.("table")),[n]),_=X((()=>n?.("embed")),[n]),I=X((()=>n?.("findReplace")),[n]),q=X((()=>n?.("export")),[n]),K=X((()=>n?.("commandPalette")),[n]),Z=J((()=>{const e=[];return s.forEach(((t,n)=>{n>0&&e.push({type:"separator",key:`sep-${n}`});(Array.isArray(t)?t:[t]).forEach((t=>{"|"===t?e.push({type:"separator",key:`sep-${n}-inline`}):"string"==typeof t?e.push({type:"item",command:t,key:t}):e.push({type:"custom",...t,key:t.command||t.name})}))})),e}),[s]);G((()=>{const e=u.current,t=d.current;if(!e||!t)return;const n=()=>{const n=e.clientWidth,r=Array.from(t.children);let o=-1;let a=0;for(let e=0;e<r.length;e++){const t=r[e];if(!t.classList.contains("rmx-toolbar-overflow-btn")&&(a+=t.offsetWidth+1,a>n-40)){o=e;break}}p(o)},r=new ResizeObserver(n);return r.observe(e),n(),()=>r.disconnect()}),[Z]),G((()=>{if(!f)return;const e=e=>{y.current&&!y.current.contains(e.target)&&h(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)}),[f]),G((()=>{if(!f||!y.current)return;const e=y.current.querySelector("button:not([disabled])");e&&e.focus()}),[f]);const Q=X((e=>{if(!y.current)return;const t=Array.from(y.current.querySelectorAll("button:not([disabled])")),n=t.indexOf(document.activeElement);switch(e.key){case"ArrowDown":e.preventDefault(),n<t.length-1?t[n+1].focus():t[0].focus();break;case"ArrowUp":e.preventDefault(),n>0?t[n-1].focus():t[t.length-1].focus();break;case"Escape":e.preventDefault(),h(!1)}}),[]),ee=J((()=>{if(!l||!w)return Z;const e=new Map(w.map(((e,t)=>[e,t])));return[...Z].sort(((t,n)=>{const r=e.get(t.key),o=e.get(n.key);return void 0===r&&void 0===o?0:void 0===r?1:void 0===o?-1:r-o}))}),[Z,w,l]),te=X(((e,t)=>{l&&(v(t.key),e.dataTransfer.effectAllowed="move")}),[l]),ne=X(((e,t)=>{l&&g&&(e.preventDefault(),e.dataTransfer.dropEffect="move",x(t.key))}),[l,g]),re=X(((e,t)=>{if(!l||!g)return;e.preventDefault();const n=ee.map((e=>e.key)),r=n.indexOf(g),o=n.indexOf(t.key);if(r<0||o<0||r===o)return;const a=[...n],[c]=a.splice(r,1);a.splice(o,0,c),C(a);try{localStorage.setItem("rmx-toolbar-order",JSON.stringify(a))}catch{}i?.(a),v(null),x(null)}),[l,g,ee,i]),oe=X((()=>{v(null),x(null)}),[]);if(!t)/* @__PURE__ */
227
+ return H("div",{className:"rmx-toolbar",role:"toolbar","aria-label":"Editor toolbar",style:{minHeight:44},children:/* @__PURE__ */H("div",{className:"rmx-toolbar-inner"})});const ae=e=>{if("separator"===e.type)/* @__PURE__ */
228
+ return H(Vn,{separatorStyle:a?._separator},e.key);const{command:r}=e,o=a?.[r]||null;if("headings"===r){const e=c.heading||"p";/* @__PURE__ */
229
+ return H(_n,{label:"Normal",value:e,options:Gn,onChange:S,tooltip:"Block Type",width:130,itemStyle:o},r)}if("fontFamily"===r){const e=c.fontFamily?.replace(/['"]/g,"")||"";/* @__PURE__ */
230
+ return H(_n,{label:"Font",value:e,options:k,onChange:N,tooltip:"Font Family",width:140,itemStyle:o},r)}if("fontSize"===r)/* @__PURE__ */
231
+ return H(_n,{label:"Size",value:c.fontSize||"",options:P,onChange:E,tooltip:"Font Size",width:80,itemStyle:o},r);if("foreColor"===r)/* @__PURE__ */
232
+ return H(Hn,{command:"foreColor",tooltip:"Text Color",currentColor:c.foreColor,onColorSelect:M,itemStyle:o,engine:t},r);if("backColor"===r)/* @__PURE__ */
233
+ return H(Hn,{command:"backColor",tooltip:"Background Color",currentColor:c.backColor,onColorSelect:T,itemStyle:o,engine:t},r);if("typography"===r)/* @__PURE__ */
234
+ return H(Xn,{engine:t,itemStyle:o},r);if("link"===r)/* @__PURE__ */
235
+ return H(Fn,{command:r,tooltip:z[r],active:!!c.link,onClick:()=>{c.link?n?.("link",c.link):n?.("link",{text:t.selection.getSelectedText()})},shortcutLabel:$("insertLink"),itemStyle:o},r);if("image"===r)/* @__PURE__ */
236
+ return H(Fn,{command:r,tooltip:z[r],onClick:D,itemStyle:o},r);if("attachment"===r)/* @__PURE__ */
237
+ return H(Fn,{command:r,tooltip:z[r],onClick:R,itemStyle:o},r);if("importDocument"===r)/* @__PURE__ */
238
+ return H(Fn,{command:r,tooltip:z[r],onClick:B,itemStyle:o},r);if("table"===r)/* @__PURE__ */
239
+ return H(Fn,{command:r,tooltip:z[r],onClick:O,itemStyle:o},r);if("embedMedia"===r)/* @__PURE__ */
240
+ return H(Fn,{command:r,tooltip:z[r],onClick:_,itemStyle:o},r);if("findReplace"===r)/* @__PURE__ */
241
+ return H(Fn,{command:r,tooltip:z[r],onClick:I,shortcutLabel:$(r),itemStyle:o},r);if("export"===r)/* @__PURE__ */
242
+ return H(Fn,{command:r,tooltip:z[r],onClick:q,itemStyle:o},r);if("commandPalette"===r)/* @__PURE__ */
243
+ return H(Fn,{command:r,tooltip:z[r],onClick:K,shortcutLabel:$(r),itemStyle:o},r);if(j.has(r)){const e=F(r,c,t),n=t.commands?.has?.(r)??!0;/* @__PURE__ */
244
+ return H(Fn,{command:r,tooltip:z[r]||r,active:e,disabled:!n,onClick:()=>{n&&t.executeCommand(r)},shortcutLabel:$(r),itemStyle:o},r)}const l=t.commands?.has?.(r)??!0;/* @__PURE__ */
245
+ return H(Fn,{command:r,tooltip:z[r]||r,disabled:!l,onClick:()=>{l&&t.executeCommand(r)},itemStyle:o},r)},le=l?ee:Z,ie=m>0?le.slice(0,m):le,ce=m>0?le.slice(m):[];/* @__PURE__ */
246
+ return H("div",{className:"rmx-toolbar"+(l?" rmx-toolbar-customizable":""),role:"toolbar","aria-label":"Editor toolbar",ref:u,children:/* @__PURE__ */W("div",{className:"rmx-toolbar-inner",ref:d,children:[ie.map(l?e=>{const t=ae(e);return l&&"separator"!==e.type?/* @__PURE__ */H("span",{draggable:!0,onDragStart:t=>te(t,e),onDragOver:t=>ne(t,e),onDrop:t=>re(t,e),onDragEnd:oe,className:`${g===e.key?"rmx-dragging":""} ${b===e.key?"rmx-toolbar-drag-over":""}`,role:"listitem","aria-roledescription":"draggable toolbar item",children:t},`drag-${e.key}`):t}:ae),ce.length>0&&/* @__PURE__ */W("div",{className:"rmx-toolbar-overflow-container",style:{position:"relative"},children:[
247
+ /* @__PURE__ */H("button",{className:"rmx-toolbar-btn rmx-toolbar-overflow-btn",onClick:()=>h((e=>!e)),"aria-label":"More toolbar options","aria-expanded":f,type:"button",children:"⋯"}),f&&/* @__PURE__ */H("div",{ref:y,className:"rmx-toolbar-overflow-menu",role:"menu",onKeyDown:Q,children:ce.map(ae)})]}),o&&/* @__PURE__ */W(V,{children:[
248
+ /* @__PURE__ */H(Vn,{}),o]})]})})})),Jn=ee((function({style:e,readOnly:t,className:n="",id:r},o){/* @__PURE__ */
249
+ return W("div",{className:`rmx-edit-area ${n}`,id:r,children:[
250
+ /* @__PURE__ */H("div",{ref:o,className:"rmx-content",style:e,suppressContentEditableWarning:!0}),t&&/* @__PURE__ */H("div",{className:"rmx-readonly-overlay"})]})}));Jn.propTypes={style:Ot.object,readOnly:Ot.bool,className:Ot.string,id:Ot.string};const Zn=["bold","italic","underline","strikethrough","link"];const Qn=q.memo((function({visible:e,selectionRect:t,engine:n,editorRect:r,onOpenModal:o,onDismiss:a}){const l=rt(),i=Y(null),c=Y({width:0,height:0}),[s,u]=U({top:0,left:0}),[d,m]=U(!1),[p,f]=U(!1),[h,y]=U({x:0,y:0}),g=Y(null),v=Y(!1),[b,x]=U(!1),w=Y(null);G((()=>{if(!n?.element)return;const e=n.element,t=()=>{w.current&&clearTimeout(w.current),w.current=setTimeout((()=>{const e=window.getSelection();e&&!e.isCollapsed&&e.rangeCount>0?x(!0):x(!1)}),300)},r=n.eventBus.on("selection:change",(()=>{const e=window.getSelection();e&&!e.isCollapsed||x(!1)}));return e.addEventListener("touchend",t,{passive:!0}),()=>{e.removeEventListener("touchend",t),r(),w.current&&clearTimeout(w.current)}}),[n]),G((()=>{if(!i.current)return;const e=new ResizeObserver((([e])=>{c.current={width:e.contentRect.width,height:e.contentRect.height}}));return e.observe(i.current),()=>e.disconnect()}),[]),G((()=>{if(!e&&!b||!t||!r)return;const n=c.current.height||i.current?.offsetHeight||40,o=c.current.width||i.current?.offsetWidth||200;let a=t.top-r.top-n-8,l=t.left-r.left+t.width/2-o/2,s=!1;a<0&&(a=t.bottom-r.top+8,s=!0),l<0&&(l=4),l+o>r.width&&(l=r.width-o-4),u({top:a,left:l}),f(s),y({x:0,y:0})}),[e,b,t,r]);const C=X((e=>{const t=i.current;if(!t)return;const n=Array.from(t.querySelectorAll("button:not([disabled])")),r=n.indexOf(document.activeElement);let o=-1;"ArrowRight"===e.key||"ArrowDown"===e.key?(e.preventDefault(),o=r<n.length-1?r+1:0):"ArrowLeft"===e.key||"ArrowUp"===e.key?(e.preventDefault(),o=r>0?r-1:n.length-1):"Home"===e.key?(e.preventDefault(),o=0):"End"===e.key&&(e.preventDefault(),o=n.length-1),o>=0&&n[o]&&n[o].focus()}),[]),k=X((()=>m(!0)),[]),S=X((()=>m(!1)),[]),N=X((e=>e.preventDefault()),[]),E=X((e=>{e.preventDefault(),e.stopPropagation(),v.current=!0,g.current={x:e.clientX,y:e.clientY,offsetX:h.x,offsetY:h.y};const t=e.currentTarget;t.setPointerCapture(e.pointerId);const n=e=>{if(!v.current||!g.current)return;const t=e.clientX-g.current.x,n=e.clientY-g.current.y;y({x:g.current.offsetX+t,y:g.current.offsetY+n})},r=()=>{v.current=!1,g.current=null,t.removeEventListener("pointermove",n),t.removeEventListener("pointerup",r)};t.addEventListener("pointermove",n),t.addEventListener("pointerup",r)}),[h]);return(e||b||d)&&n?/* @__PURE__ */W("div",{ref:i,className:"rmx-floating-toolbar rmx-floating-toolbar-touch "+(p?"rmx-floating-below":""),style:{top:s.top+h.y,left:s.left+h.x},role:"toolbar","aria-label":"Formatting toolbar",onPointerDown:N,onKeyDown:C,onFocus:k,onBlur:S,children:[Zn.map(((e,t)=>{if("link"===e)/* @__PURE__ */
251
+ return H(Fn,{command:e,tooltip:"Insert Link",active:!!l.link,onClick:()=>o?.("link",{text:n.selection.getSelectedText()})},e);const r=l[e]||!1;/* @__PURE__ */
252
+ return H(Fn,{command:e,tooltip:e.charAt(0).toUpperCase()+e.slice(1),active:r,onClick:()=>n.executeCommand(e)},e)})),
253
+ /* @__PURE__ */H("div",{className:"rmx-floating-toolbar-grip",onPointerDown:E,"aria-label":"Drag to reposition toolbar",role:"separator",children:/* @__PURE__ */W("svg",{width:"20",height:"6",viewBox:"0 0 20 6",fill:"currentColor","aria-hidden":"true",children:[
254
+ /* @__PURE__ */H("rect",{x:"2",y:"0",width:"16",height:"2",rx:"1",opacity:"0.4"}),
255
+ /* @__PURE__ */H("rect",{x:"2",y:"4",width:"16",height:"2",rx:"1",opacity:"0.4"})]})})]}):null}));function er({image:e,engine:t,editorRect:n}){const[r,o]=U(!1),[a,l]=U(null),[i,c]=U(null),[s,u]=U(!1),[d,m]=U(""),p=Y(null);if(G((()=>{e&&(m(e.getAttribute("alt")||""),u(!1))}),[e]),G((()=>{s&&p.current&&p.current.focus()}),[s]),!e||!n)return null;const f=e.getBoundingClientRect(),h=f.top-n.top,y=f.left-n.left,g=X(((t,n)=>{t.preventDefault(),t.stopPropagation(),t.target.setPointerCapture(t.pointerId),o(!0),l({x:t.clientX,y:t.clientY}),c({width:e.offsetWidth,height:e.offsetHeight})}),[e]);G((()=>{if(!r)return;const n=t=>{if(!a||!i)return;const n=t.clientX-a.x,r=i.width>0?i.height/i.width:1,o=Math.max(50,i.width+n),l=o*r;e.style.width=`${o}px`,e.style.height=`${l}px`},l=()=>{o(!1),t?.eventBus.emit("content:change")};return document.addEventListener("pointermove",n),document.addEventListener("pointerup",l),()=>{document.removeEventListener("pointermove",n),document.removeEventListener("pointerup",l)}}),[r,a,i,e,t]);const v=X((()=>{e&&(e.setAttribute("alt",d),t?.eventBus.emit("content:change")),u(!1)}),[e,d,t]),b=X((t=>{"Enter"===t.key?(t.preventDefault(),v()):"Escape"===t.key&&(u(!1),m(e?.getAttribute("alt")||""))}),[v,e]);/* @__PURE__ */
256
+ return W("div",{className:"rmx-image-handles",style:{position:"absolute",top:h,left:y,width:f.width,height:f.height,pointerEvents:"none"},children:[
257
+ /* @__PURE__ */H("div",{className:"rmx-image-handle rmx-handle-border"}),["nw","ne","sw","se"].map((e=>/* @__PURE__ */H("div",{className:`rmx-image-handle rmx-handle-${e}`,style:{pointerEvents:"all",touchAction:"none"},onPointerDown:t=>g(t,e)},e))),
258
+ /* @__PURE__ */H("div",{className:"rmx-image-alt-overlay",style:{pointerEvents:"all"},onMouseDown:e=>e.stopPropagation(),children:s?/* @__PURE__ */H("input",{ref:p,className:"rmx-image-alt-input",type:"text",value:d,onChange:e=>m(e.target.value),onBlur:v,onKeyDown:b,placeholder:"Enter alt text..."}):/* @__PURE__ */H("button",{className:"rmx-image-alt-label",onClick:()=>u(!0),type:"button",title:"Edit alt text",children:d?`Alt: ${d}`:"Add alt text"})})]})}function tr({table:e,engine:t,editorRect:n}){if(!e||!t||!n)return null;const r=e.getBoundingClientRect(),o=r.top-n.top,a=r.left-n.left,l=X((()=>{window.confirm("Are you sure you want to delete this table? This cannot be undone.")&&t.executeCommand("deleteTable")}),[t]);/* @__PURE__ */
259
+ return W("div",{className:"rmx-table-controls",style:{position:"absolute",top:o-28,left:a},onMouseDown:e=>e.preventDefault(),children:[
260
+ /* @__PURE__ */H("button",{className:"rmx-table-control-btn",onClick:()=>t.executeCommand("addRowBefore"),"aria-label":"Add row above",title:"Add row above",type:"button",children:"+Row"}),
261
+ /* @__PURE__ */H("button",{className:"rmx-table-control-btn",onClick:()=>t.executeCommand("addRowAfter"),"aria-label":"Add row below",title:"Add row below",type:"button",children:"Row+"}),
262
+ /* @__PURE__ */H("button",{className:"rmx-table-control-btn",onClick:()=>t.executeCommand("addColBefore"),"aria-label":"Add column before",title:"Add column before",type:"button",children:"+Col"}),
263
+ /* @__PURE__ */H("button",{className:"rmx-table-control-btn",onClick:()=>t.executeCommand("addColAfter"),"aria-label":"Add column after",title:"Add column after",type:"button",children:"Col+"}),
264
+ /* @__PURE__ */H("button",{className:"rmx-table-control-btn rmx-danger",onClick:l,"aria-label":"Delete table",title:"Delete table",type:"button",children:"Delete"})]})}Qn.propTypes={visible:Ot.bool.isRequired,selectionRect:Ot.object,engine:Ot.object,editorRect:Ot.object,onOpenModal:Ot.func,onDismiss:Ot.func};const nr=[{id:"javascript",label:"JavaScript"},{id:"python",label:"Python"},{id:"html",label:"HTML"},{id:"css",label:"CSS"},{id:"json",label:"JSON"},{id:"bash",label:"Bash"},{id:"sql",label:"SQL"},{id:"java",label:"Java"},{id:"go",label:"Go"},{id:"rust",label:"Rust"},{id:"plaintext",label:"Plain Text"}];function rr({codeBlock:e,engine:t,editorRect:n}){if(!e||!t||!n)return null;const r=e.querySelector("code"),o=r?.getAttribute("data-language")||"",[a,l]=U(!1),[i,c]=U(""),s=Y(null),u=Y(null);G((()=>{if(!a)return;const e=e=>{s.current&&!s.current.contains(e.target)&&(l(!1),c(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[a,e]),G((()=>{l(!1),c("")}),[e]),G((()=>{a&&u.current&&u.current.focus()}),[a]);const d=X((e=>{t.executeCommand("setCodeLanguage",{language:e}),l(!1),c("")}),[t]),m=t?._syntaxHighlight?.SUPPORTED_LANGUAGES||nr,p=m.filter((e=>e.label.toLowerCase().includes(i.toLowerCase())||e.id.toLowerCase().includes(i.toLowerCase()))),f=e.getBoundingClientRect(),h=f.top-n.top,y=n.right-f.right,g=m.find((e=>e.id===o))?.label||o||"Auto";/* @__PURE__ */
265
+ return W("div",{ref:s,className:"rmx-codeblock-controls",style:{position:"absolute",top:h+4,right:y+4,zIndex:10},onMouseDown:e=>e.preventDefault(),children:[
266
+ /* @__PURE__ */H("button",{className:"rmx-codeblock-lang-btn",onClick:()=>l(!a),type:"button",title:"Change language",children:g}),a&&/* @__PURE__ */W("div",{className:"rmx-codeblock-lang-dropdown",children:[
267
+ /* @__PURE__ */H("input",{ref:u,className:"rmx-codeblock-lang-search",type:"text",placeholder:"Search languages...",value:i,onChange:e=>c(e.target.value),onKeyDown:e=>{"Escape"===e.key?(l(!1),c("")):"Enter"===e.key&&p.length>0&&d(p[0].id)}}),
268
+ /* @__PURE__ */W("ul",{className:"rmx-codeblock-lang-list",children:[p.map((e=>/* @__PURE__ */H("li",{children:/* @__PURE__ */H("button",{className:"rmx-codeblock-lang-option "+(e.id===o?"rmx-active":""),onClick:()=>d(e.id),type:"button",children:e.label})},e.id))),0===p.length&&/* @__PURE__ */H("li",{className:"rmx-codeblock-lang-empty",children:"No languages found"})]})]})]})}function or({visible:e,fileTypes:t}){if(!e)return null;const n=t.includes("Files")||t.some((e=>e.startsWith("image/"))),r=n?"Drop files here":"Drop content here",o=n?"Images, documents, and rich text":"Rich text and HTML content";/* @__PURE__ */
269
+ return W("div",{className:"rmx-drop-zone-overlay","aria-hidden":"true",children:[
270
+ /* @__PURE__ */W("svg",{className:"rmx-drop-zone-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[
271
+ /* @__PURE__ */H("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),
272
+ /* @__PURE__ */H("polyline",{points:"7 10 12 15 17 10"}),
273
+ /* @__PURE__ */H("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),
274
+ /* @__PURE__ */H("span",{className:"rmx-drop-zone-text",children:r}),
275
+ /* @__PURE__ */H("span",{className:"rmx-drop-zone-hint",children:o})]})}function ar({engine:e,editorRect:t,editAreaRef:n}){const[r,o]=U(null),[a,l]=U(null),[i,c]=U(!1),[s,u]=U(null),[d,m]=U(null),p=Y(null),f=Y(null),h=Y(null),y=Y(null),g=Y(null),v=X((t=>{if(!e||!n.current)return;if(e.dragDrop.isDragging())return void o(null);const a=t.target,i=e.dragDrop.getDraggableBlock(a);if(i&&i!==r){o(i);const t=i.getBoundingClientRect(),n=e.element,r=n.getBoundingClientRect();l({top:t.top-r.top+n.scrollTop+2,left:-24})}else i||o(null)}),[e,n,r]);G((()=>{if(!e)return;const t=e.element,n=e=>{f.current&&cancelAnimationFrame(f.current),f.current=requestAnimationFrame((()=>v(e)))},r=()=>{o(null)};return t.addEventListener("pointermove",n),t.addEventListener("pointerleave",r),()=>{t.removeEventListener("pointermove",n),t.removeEventListener("pointerleave",r),f.current&&cancelAnimationFrame(f.current)}}),[e,v]),G((()=>{if(e&&r)return e.dragDrop.makeBlockDraggable(r),()=>{e.dragDrop.unmakeBlockDraggable(r)}}),[e,r]);const b=X((t=>{if(!r||!e)return;if(!("touch"===t.pointerType||"pen"===t.pointerType))return;t.preventDefault();const n=p.current;if(!n)return;n.setPointerCapture(t.pointerId),c(!0),h.current=r;const o=r.getBoundingClientRect();u({x:t.clientX,y:t.clientY,width:o.width,text:r.textContent?.slice(0,50)||"Block"}),r.style.opacity="0.4";const a=t=>{u((e=>e?{...e,x:t.clientX,y:t.clientY}:null));const n=e.element,r=n.querySelectorAll("[data-block-id], p, h1, h2, h3, h4, h5, h6, ul, ol, blockquote, pre, table, hr");let o=null,a=1/0;for(const e of r){if(e===h.current)continue;const n=e.getBoundingClientRect(),r=n.top+n.height/2,l=Math.abs(t.clientY-r);l<a&&(a=l,o=e)}if(o){const e=o.getBoundingClientRect(),r=n.getBoundingClientRect(),a=t.clientY<e.top+e.height/2,l=a?e.top-r.top+n.scrollTop:e.bottom-r.top+n.scrollTop;m({top:l,left:12,width:r.width-24}),g.current={block:o,insertBefore:a}}else m(null),g.current=null},l=()=>{if(n.removeEventListener("pointermove",a),n.removeEventListener("pointerup",l),c(!1),u(null),m(null),h.current&&(h.current.style.opacity=""),g.current&&h.current){const{block:e,insertBefore:t}=g.current;e.parentNode&&(t?e.parentNode.insertBefore(h.current,e):e.parentNode.insertBefore(h.current,e.nextSibling))}h.current=null,g.current=null};n.addEventListener("pointermove",a),n.addEventListener("pointerup",l)}),[r,e]);return r&&a?/* @__PURE__ */W(V,{children:[
276
+ /* @__PURE__ */H("div",{ref:p,className:"rmx-block-drag-handle rmx-block-drag-handle-touch rmx-visible",style:{top:a.top,left:a.left,touchAction:"none"},title:"Drag to reorder","aria-label":"Drag to reorder block",role:"button",onPointerDown:b,children:/* @__PURE__ */W("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"currentColor",children:[
277
+ /* @__PURE__ */H("circle",{cx:"4",cy:"3",r:"1.2"}),
278
+ /* @__PURE__ */H("circle",{cx:"10",cy:"3",r:"1.2"}),
279
+ /* @__PURE__ */H("circle",{cx:"4",cy:"7",r:"1.2"}),
280
+ /* @__PURE__ */H("circle",{cx:"10",cy:"7",r:"1.2"}),
281
+ /* @__PURE__ */H("circle",{cx:"4",cy:"11",r:"1.2"}),
282
+ /* @__PURE__ */H("circle",{cx:"10",cy:"11",r:"1.2"})]})}),i&&d&&/* @__PURE__ */H("div",{className:"rmx-touch-drop-indicator",style:{position:"absolute",top:d.top,left:d.left,width:d.width,height:2,background:"var(--rmx-primary, #6366f1)",borderRadius:1,pointerEvents:"none",zIndex:50}}),i&&s&&/* @__PURE__ */H("div",{ref:y,className:"rmx-drag-ghost",style:{position:"fixed",left:s.x-20,top:s.y-20,width:Math.min(s.width,300),pointerEvents:"none",zIndex:1e4},children:s.text})]}):null}const lr={saved:"Saved",saving:"Saving…",unsaved:"Unsaved changes",error:"Save failed"};const ir=q.memo((function({saveStatus:e}){const t=lr[e]||"";/* @__PURE__ */
283
+ return W("span",{className:`rmx-save-status rmx-save-status--${e}`,role:"status","aria-live":"polite",children:[
284
+ /* @__PURE__ */H("span",{className:"rmx-save-status-dot","aria-hidden":"true"}),
285
+ /* @__PURE__ */H("span",{className:"rmx-save-status-label",children:t})]})}));ir.propTypes={saveStatus:Ot.oneOf(["saved","saving","unsaved","error"]).isRequired};const cr=q.memo((function({engine:e,position:t="bottom",saveStatus:n,showSaveStatus:r}){const[o,a]=U({wordCount:0,charCount:0}),[l,i]=U(!1),c=X((e=>{a((t=>t.wordCount===e.wordCount&&t.charCount===e.charCount?t:e))}),[]);G((()=>{if(!e)return;e._wordCount&&c(e._wordCount);return e.eventBus.on("wordcount:update",c)}),[e,c]),G((()=>{if(!e)return;const t=()=>i(!1),n=[e.eventBus.on("content:change",(()=>i(!0))),e.eventBus.on("autosave:saved",t),e.eventBus.on("save",t)];return()=>n.forEach((e=>e()))}),[e]);const s=l&&!r;/* @__PURE__ */
286
+ return W("div",{className:"rmx-statusbar"+("top"===t?" rmx-statusbar-top":""),children:[r&&/* @__PURE__ */W(V,{children:[
287
+ /* @__PURE__ */H(ir,{saveStatus:n}),
288
+ /* @__PURE__ */H("span",{className:"rmx-statusbar-sep","aria-hidden":"true"})]}),s&&/* @__PURE__ */W(V,{children:[
289
+ /* @__PURE__ */W("span",{className:"rmx-statusbar-dirty",role:"status","aria-live":"polite",children:[
290
+ /* @__PURE__ */H("span",{className:"rmx-statusbar-dirty-dot","aria-hidden":"true"}),"Edited"]}),
291
+ /* @__PURE__ */H("span",{className:"rmx-statusbar-sep","aria-hidden":"true"})]}),
292
+ /* @__PURE__ */W("span",{className:"rmx-statusbar-item",children:[o.wordCount," ",1===o.wordCount?"word":"words"]}),
293
+ /* @__PURE__ */H("span",{className:"rmx-statusbar-sep","aria-hidden":"true"}),
294
+ /* @__PURE__ */W("span",{className:"rmx-statusbar-item",children:[o.charCount," ",1===o.charCount?"character":"characters"]})]})}));const sr=q.memo((function({engine:e}){const[t,n]=U({wordCount:0,charCount:0}),[r,o]=U(!1),a=Y(null),l=X((e=>{n((t=>t.wordCount===e.wordCount&&t.charCount===e.charCount?t:e))}),[]);return G((()=>{if(!e)return;e._wordCount&&l(e._wordCount);return e.eventBus.on("wordcount:update",l)}),[e,l]),G((()=>{if(!r)return;const e=e=>{a.current&&!a.current.contains(e.target)&&o(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[r]),/* @__PURE__ */W("div",{ref:a,className:"rmx-wordcount-btn-wrap rmx-inline-flex-relative",children:[
295
+ /* @__PURE__ */H("button",{className:"rmx-toolbar-btn "+(r?"rmx-active":""),onClick:e=>{e.preventDefault(),e.stopPropagation(),o((e=>!e))},onMouseDown:e=>e.preventDefault(),title:"Word Count",type:"button","aria-label":"Word Count","aria-expanded":r,children:/* @__PURE__ */H("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */H("path",{d:"M4 7h16M4 12h10M4 17h12"})})}),r&&/* @__PURE__ */W("div",{className:"rmx-wordcount-popover",children:[
296
+ /* @__PURE__ */W("div",{className:"rmx-wordcount-popover-row",children:[
297
+ /* @__PURE__ */H("span",{className:"rmx-wordcount-popover-label",children:"Words"}),
298
+ /* @__PURE__ */H("span",{className:"rmx-wordcount-popover-value",children:t.wordCount})]}),
299
+ /* @__PURE__ */W("div",{className:"rmx-wordcount-popover-row",children:[
300
+ /* @__PURE__ */H("span",{className:"rmx-wordcount-popover-label",children:"Characters"}),
301
+ /* @__PURE__ */H("span",{className:"rmx-wordcount-popover-value",children:t.charCount})]})]})]})}));const ur=q.memo((function({recoveryData:e,onRecover:t,onDismiss:n}){if(!e)return null;const r=function(e){if(!e)return"a previous session";const t=Math.floor((Date.now()-e)/1e3);if(t<10)return"just now";if(t<60)return`${t} seconds ago`;const n=Math.floor(t/60);if(1===n)return"1 minute ago";if(n<60)return`${n} minutes ago`;const r=Math.floor(n/60);if(1===r)return"1 hour ago";if(r<24)return`${r} hours ago`;const o=Math.floor(r/24);return 1===o?"yesterday":`${o} days ago`}(e.timestamp);/* @__PURE__ */
302
+ return W("div",{className:"rmx-recovery-banner",role:"alert",children:[
303
+ /* @__PURE__ */W("svg",{className:"rmx-recovery-banner-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[
304
+ /* @__PURE__ */H("circle",{cx:"12",cy:"12",r:"10"}),
305
+ /* @__PURE__ */H("polyline",{points:"12 6 12 12 16 14"})]}),
306
+ /* @__PURE__ */W("span",{className:"rmx-recovery-banner-text",children:["Unsaved changes found from ",r]}),
307
+ /* @__PURE__ */W("div",{className:"rmx-recovery-banner-actions",children:[
308
+ /* @__PURE__ */H("button",{className:"rmx-recovery-btn rmx-recovery-btn--restore",onClick:t,type:"button",children:"Restore"}),
309
+ /* @__PURE__ */H("button",{className:"rmx-recovery-btn rmx-recovery-btn--dismiss",onClick:n,type:"button",children:"Dismiss"})]})]})}));ur.propTypes={recoveryData:Ot.shape({recoveredContent:Ot.string.isRequired,timestamp:Ot.number.isRequired}),onRecover:Ot.func.isRequired,onDismiss:Ot.func.isRequired};class dr extends q.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){this.props.onError?.(e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:/* @__PURE__ */W("div",{className:"rmx-error-boundary",children:[
310
+ /* @__PURE__ */H("p",{children:"Something went wrong with the editor."}),
311
+ /* @__PURE__ */H("button",{onClick:()=>this.setState({hasError:!1,error:null}),children:"Try again"})]}):this.props.children}}function mr({custom:e,onClick:t}){return e&&!0!==e?/* @__PURE__ */H("div",{className:"rmx-empty-state",onClick:t,role:"button",tabIndex:0,children:e}):/* @__PURE__ */W("div",{className:"rmx-empty-state",onClick:t,role:"button",tabIndex:0,children:[
312
+ /* @__PURE__ */H("div",{className:"rmx-empty-state-icon",children:/* @__PURE__ */W("svg",{viewBox:"0 0 64 64",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[
313
+ /* @__PURE__ */H("rect",{x:"8",y:"8",width:"48",height:"48",rx:"6",fill:"none",stroke:"currentColor",strokeWidth:"2"}),
314
+ /* @__PURE__ */H("line",{x1:"16",y1:"20",x2:"48",y2:"20",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),
315
+ /* @__PURE__ */H("line",{x1:"16",y1:"28",x2:"40",y2:"28",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",opacity:"0.6"}),
316
+ /* @__PURE__ */H("line",{x1:"16",y1:"36",x2:"44",y2:"36",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",opacity:"0.4"}),
317
+ /* @__PURE__ */H("line",{x1:"16",y1:"44",x2:"32",y2:"44",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",opacity:"0.2"})]})}),
318
+ /* @__PURE__ */H("div",{className:"rmx-empty-state-text",children:"Start typing..."}),
319
+ /* @__PURE__ */H("div",{className:"rmx-empty-state-hint",children:"or paste content, drag a file, or use the toolbar above"})]})}const pr={P:"Paragraph",H1:"Heading 1",H2:"Heading 2",H3:"Heading 3",H4:"Heading 4",H5:"Heading 5",H6:"Heading 6",BLOCKQUOTE:"Blockquote",PRE:"Code Block",UL:"Bulleted List",OL:"Numbered List",LI:"List Item",TABLE:"Table",THEAD:"Header",TBODY:"Body",TR:"Row",TH:"Header Cell",TD:"Cell",A:"Link",STRONG:"Bold",EM:"Italic",U:"Underline",S:"Strikethrough",DIV:"Block",SPAN:"Inline",DETAILS:"Collapsible",SUMMARY:"Summary",FIGURE:"Figure",FIGCAPTION:"Caption",IMG:"Image"};function fr(e){const t=e.tagName;let n=pr[t]||t.toLowerCase();if("TR"===t&&e.parentElement){n=`Row ${Array.from(e.parentElement.children).indexOf(e)+1}`}if(("TD"===t||"TH"===t)&&e.parentElement){n=`Cell ${Array.from(e.parentElement.children).indexOf(e)+1}`}if("LI"===t&&e.parentElement){n=`Item ${Array.from(e.parentElement.children).indexOf(e)+1}`}return n}const hr=q.memo((function({engine:e}){const[t,n]=U([{label:"Paragraph",element:null}]),r=X((()=>{if(!e?.element)return;const t=window.getSelection();if(!t||0===t.rangeCount)return;let r=t.anchorNode;r&&(r.nodeType===Node.TEXT_NODE&&(r=r.parentElement),r&&e.element.contains(r)&&n(function(e,t){const n=[];let r=e;for(;r&&r!==t&&r!==document.body;){if(r.nodeType===Node.ELEMENT_NODE){if(r.classList?.contains("rmx-edit-area")||r.classList?.contains("rmx-content")){r=r.parentElement;continue}n.unshift({label:fr(r),element:r})}r=r.parentElement}return n.length>0?n:[{label:"Paragraph",element:null}]}(r,e.element)))}),[e]);G((()=>{if(!e)return;const t=e.eventBus.on("selection:change",r);return r(),t}),[e,r]);const o=X((t=>{if(t&&e)try{const n=document.createRange();n.selectNodeContents(t);const r=window.getSelection();r.removeAllRanges(),r.addRange(n),e.eventBus.emit("selection:change")}catch{}}),[e]);/* @__PURE__ */
320
+ return H("div",{className:"rmx-breadcrumb-bar",role:"navigation","aria-label":"Document path",children:t.map(((e,t)=>/* @__PURE__ */W(q.Fragment,{children:[t>0&&/* @__PURE__ */H("span",{className:"rmx-breadcrumb-separator","aria-hidden":"true",children:"›"}),
321
+ /* @__PURE__ */H("button",{type:"button",className:"rmx-breadcrumb-item",onClick:()=>o(e.element),style:{background:"none",border:"none",cursor:"pointer",padding:"0 2px",font:"inherit",color:"inherit"},children:e.label})]},t)))})})),yr=q.memo((function({engine:e,editAreaRef:t}){const n=Y(null),r=Y(null),[o,a]=U(0),[l,i]=U(20),[c,s]=U(""),u=X((()=>{if(!e?.element)return;const t=e.element.textContent||"";s(t)}),[e]),d=X((()=>{if(!t?.current||!n.current)return;const e=t.current,r=n.current,o=e.scrollTop/(e.scrollHeight||1),l=e.clientHeight/(e.scrollHeight||1),c=r.clientHeight;a(o*c),i(Math.max(l*c,10))}),[t]);G((()=>{if(!e)return;const t=e.eventBus.on("content:change",u);return u(),t}),[e,u]),G((()=>{const e=t?.current;if(!e)return;let n=null;const r=()=>{n||(n=requestAnimationFrame((()=>{d(),n=null})))};return e.addEventListener("scroll",r),d(),()=>{e.removeEventListener("scroll",r),n&&cancelAnimationFrame(n)}}),[t,d]);const m=X((e=>{if(!t?.current||!n.current)return;const r=n.current,o=t.current,a=r.getBoundingClientRect(),l=(e.clientY-a.top)/a.height*o.scrollHeight-o.clientHeight/2;o.scrollTo({top:Math.max(0,l),behavior:"smooth"})}),[t]);/* @__PURE__ */
322
+ return W("div",{className:"rmx-minimap",ref:n,onClick:m,"aria-hidden":"true",children:[
323
+ /* @__PURE__ */H("div",{className:"rmx-minimap-content",ref:r,children:c}),
324
+ /* @__PURE__ */H("div",{className:"rmx-minimap-viewport",style:{top:o,height:l}})]})})),gr=q.memo((function({engine:e,format:t}){const[n,r]=U(""),o=t||"html",a=Y(null),l=X((()=>{if(!e)return;const t=e.getHTML();r("markdown"===o?N(t):t)}),[e,o]);return G((()=>{if(!e)return;const t=e.eventBus.on("content:change",(()=>{clearTimeout(a.current),a.current=setTimeout(l,200)}));return l(),()=>{t(),clearTimeout(a.current)}}),[e,l]),/* @__PURE__ */W("div",{className:"rmx-split-preview-container",style:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:[
325
+ /* @__PURE__ */H("div",{className:"rmx-split-preview-label",children:/* @__PURE__ */W("span",{children:["markdown"===o?"Markdown":"HTML"," Preview"]})}),
326
+ /* @__PURE__ */H("div",{className:"rmx-split-preview",children:n})]})}));function vr({message:e,type:t="info",duration:n=3e3,onDismiss:r}){const[o,a]=U(!0);return G((()=>{if(!e)return;a(!0);const t=setTimeout((()=>{a(!1),r?.()}),n);return()=>clearTimeout(t)}),[e,n,r]),o&&e?/* @__PURE__ */H("div",{className:`rmx-toast rmx-toast--${t}`,role:"status","aria-live":"polite",style:{animationDuration:`${n}ms`},children:e}):null}function br(){const[e,t]=U(null),n=X(((e,n="info",r=3e3)=>{t({message:e,type:n,duration:r,key:Date.now()})}),[]),r=X((()=>{t(null)}),[]);return[e?/* @__PURE__ */H(vr,{message:e.message,type:e.type,duration:e.duration,onDismiss:r},e.key):null,n]}const xr=q.lazy((()=>import("./CommandPalette-DXWyTGOU.js").then((e=>({default:e.CommandPalette}))))),wr=q.lazy((()=>import("./LinkModal-CmkK4m-k.js").then((e=>({default:e.LinkModal}))))),Cr=q.lazy((()=>import("./ImageModal-bCzSSTmd.js").then((e=>({default:e.ImageModal}))))),kr=q.lazy((()=>import("./TablePickerModal-BnZHyMsk.js").then((e=>({default:e.TablePickerModal}))))),Sr=q.lazy((()=>import("./EmbedModal-alpHQiAP.js").then((e=>({default:e.EmbedModal}))))),Nr=q.lazy((()=>import("./FindReplaceModal-BqNcotUr.js").then((e=>({default:e.FindReplacePanel}))))),Er=q.lazy((()=>import("./SourceModal-ChhNVz7y.js").then((e=>({default:e.SourceModal}))))),Mr=q.lazy((()=>import("./ExportModal-BN8LUaSR.js").then((e=>({default:e.ExportModal}))))),Tr=q.lazy((()=>import("./AttachmentModal-Di5V6QX-.js").then((e=>({default:e.AttachmentModal}))))),Lr=q.lazy((()=>import("./ImportDocumentModal-BypTEn2i.js").then((e=>({default:e.ImportDocumentModal})))));function Dr({modals:e,closeModal:t,engine:n,showCommandPalette:r,commandPaletteOpen:o,setCommandPaletteOpen:a,handleOpenModal:l}){/* @__PURE__ */
327
+ return W(te,{fallback:/* @__PURE__ */H("div",{className:"rmx-loading-spinner"}),children:[e.link.open&&/* @__PURE__ */H(wr,{open:e.link.open,onClose:()=>t("link"),engine:n,data:e.link.data}),e.image.open&&/* @__PURE__ */H(Cr,{open:e.image.open,onClose:()=>t("image"),engine:n}),e.attachment?.open&&/* @__PURE__ */H(Tr,{open:e.attachment.open,onClose:()=>t("attachment"),engine:n}),e.importDocument?.open&&/* @__PURE__ */H(Lr,{open:e.importDocument.open,onClose:()=>t("importDocument"),engine:n}),e.table.open&&/* @__PURE__ */H(kr,{open:e.table.open,onClose:()=>t("table"),engine:n}),e.embed.open&&/* @__PURE__ */H(Sr,{open:e.embed.open,onClose:()=>t("embed"),engine:n}),e.source.open&&/* @__PURE__ */H(Er,{open:e.source.open,onClose:()=>{t("source"),n?.isSourceMode&&(n.isSourceMode=!1,n.eventBus.emit("mode:change",{sourceMode:!1}))},engine:n}),e.export.open&&/* @__PURE__ */H(Mr,{open:e.export.open,onClose:()=>t("export"),engine:n}),r&&o&&/* @__PURE__ */H(xr,{open:o,onClose:()=>a(!1),engine:n,onOpenModal:l})]})}const Rr=q.lazy((()=>import("./MenuBar-DOv7JPwR.js").then((e=>({default:e.MenuBar}))))),Br=q.lazy((()=>import("./ContextMenu-DsA0YsY7.js").then((e=>({default:e.ContextMenu})))));function Or(e){const t=function(e,t={}){const[n,r]=U(null),o=Je.get(e);G((()=>{o?.plugins?import("./index-Bg_uAWlM.js").then((({resolvePluginsFromConfig:e})=>{r(e(o.plugins))})):r([])}),[o]);const a=J((()=>{if(!o)return null;const e=o.menuBar;return!0===e?T:Array.isArray(e)?e:null}),[o]),l=J((()=>o&&o.toolbar||L),[o]);return J((()=>o?{theme:o.theme||"light",placeholder:o.placeholder||"",height:o.height||300,minHeight:o.minHeight,maxHeight:o.maxHeight,readOnly:o.readOnly||!1,outputFormat:o.outputFormat||"html",toolbar:l,menuBarConfig:a,statusBar:o.statusBar??"bottom",showFloatingToolbar:o.floatingToolbar??!0,showContextMenu:o.contextMenu??!0,showCommandPalette:o.commandPalette??!0,autosaveConfig:o.autosave?!0===o.autosave?{enabled:!0}:{enabled:!0,...o.autosave}:{enabled:!1},showBreadcrumb:o.breadcrumb||!1,showMinimap:o.minimap||!1,splitViewFormat:o.splitViewFormat,fonts:o.fonts,googleFonts:o.googleFonts,customTheme:o.customTheme,toolbarItemTheme:o.toolbarItemTheme,sanitize:o.sanitize,shortcuts:o.shortcuts,baseHeadingLevel:o.baseHeadingLevel,uploadHandler:o.uploadHandler,plugins:n||[],value:t.value,defaultValue:t.defaultValue,onChange:t.onChange,onReady:t.onReady,onError:t.onError,onFocus:t.onFocus,onBlur:t.onBlur,className:t.className||"",style:t.style,errorFallback:t.errorFallback}:null),[o,e,n,l,a,t.value,t.defaultValue,t.onChange,t.onReady,t.onError,t.onFocus,t.onBlur,t.className,t.style,t.errorFallback])}(e.config,e);if(!t)/* @__PURE__ */
328
+ return W("div",{className:"rmx-editor rmx-error",children:['Config "',e.config,'" not found']});const{value:n,defaultValue:r,onChange:o,toolbar:a,theme:l,placeholder:i,height:c,minHeight:s,maxHeight:u,readOnly:d,plugins:m,onReady:p,onFocus:f,onBlur:h,className:y,style:g,uploadHandler:v,outputFormat:b,showFloatingToolbar:x,showContextMenu:w,fonts:C,googleFonts:k,statusBar:S,customTheme:N,toolbarItemTheme:E,sanitize:M,shortcuts:D,baseHeadingLevel:R,menuBarConfig:B,onError:O,errorFallback:P,showCommandPalette:z,autosaveConfig:$,showBreadcrumb:j,showMinimap:F,splitViewFormat:_}=t,V=Y(null),q=Y(null);G((()=>{k&&k.length>0&&I(k)}),[k]);const Z=J((()=>{if(!k||0===k.length)return C;const e=k.map((e=>e.split(":")[0])),t=C||A,n=new Set(t.map((e=>e.toLowerCase()))),r=e.filter((e=>!n.has(e.toLowerCase())));return[...t,...r]}),[C,k]),{engine:Q,ready:ee}=oe(V,{value:n,defaultValue:r,onChange:o,outputFormat:b,placeholder:i,readOnly:d,plugins:m,onReady:p,onFocus:f,onBlur:h,uploadHandler:v,sanitize:M,shortcuts:D,baseHeadingLevel:R}),{formatState:ne,uiState:re}=function(e){const t=Y(/* @__PURE__ */new WeakMap),[n,r]=U(ae),[o,a]=U(le),l=Y({image:null,table:null}),i=X((e=>{r((t=>{const n={};for(const r of ie)n[r]=r in e?e[r]:ae[r];return function(e,t,n){for(const r of n)if(e[r]!==t[r])return!1;return!0}(t,n,ie)?t:n}));const n=window.getSelection(),o=n&&!n.isCollapsed&&n.toString().length>0;let i=null;if(o&&n.rangeCount>0)try{i=n.getRangeAt(0).getBoundingClientRect()}catch{i=null}let c=null,s=null,u=null;if(n&&n.focusNode){const e=n.focusNode.nodeType===Node.TEXT_NODE?n.focusNode.parentElement:n.focusNode;if(e){const r=n.focusNode;let o=t.current.get(r);if(o)c=o.image,s=o.table,u=o.codeBlock;else{const n="IMG"===e.tagName?e:e.querySelector?.(":scope > img");n&&(c=n);const o=e.closest?.("table");o&&(s=o);const a=e.closest?.("pre");a&&(u=a),t.current.set(r,{image:c,table:s,codeBlock:u})}}}c===l.current.image&&s===l.current.table&&u===l.current.codeBlock?(c=l.current.image,s=l.current.table,u=l.current.codeBlock):l.current={image:c,table:s,codeBlock:u},a((e=>{const t=!o||e.selectionRect&&i&&e.selectionRect.top===i.top&&e.selectionRect.left===i.left&&e.selectionRect.width===i.width&&e.selectionRect.height===i.height;return e.hasSelection===o&&e.focusedImage===c&&e.focusedTable===s&&e.focusedCodeBlock===u&&t?e:{hasSelection:o,selectionRect:i,focusedImage:c,focusedTable:s,focusedCodeBlock:u}}))}),[]);return G((()=>{if(e)return e.eventBus.on("selection:change",i)}),[e,i]),G((()=>{if(e)return e.eventBus.on("content:change",(()=>{l.current={image:null,table:null,codeBlock:null}}))}),[e]),{formatState:n,uiState:o}}(Q),{modals:de,openModal:me,closeModal:pe}=function(){const[e,t]=K(se,ce),n=X(((e,n=null)=>{t({type:"OPEN",name:e,data:n})}),[]),r=X((e=>{t({type:"CLOSE",name:e})}),[]),o=X((t=>e[t]?.open||!1),[e]),a=X((t=>e[t]?.data||null),[e]);return{modals:e,openModal:n,closeModal:r,isOpen:o,getData:a}}(),{contextMenu:fe,hideContextMenu:he}=ue(Q,V),{saveStatus:ye,recoveryData:ge,recoverContent:ve,dismissRecovery:be}=Ze(Q,$),[xe,we]=br();G((()=>{if(!Q)return;const e=[Q.eventBus.on("export:success",(()=>we("Export successful","success"))),Q.eventBus.on("clipboard:copy",(()=>we("Copied to clipboard","info")))];return()=>e.forEach((e=>"function"==typeof e&&e()))}),[Q,we]);const Ce=Qe(q);G((()=>{q.current&&Q&&(q.current.__engine=Q)}),[Q]);const{isExternalDrag:ke,dragFileTypes:Se}=et(Q);!function(e,t,n={}){const r=Y(null),o=Y(null),a=X((e=>{if(!e.touches.length)return;const t=e.touches[0];r.current={startX:t.clientX,startY:t.clientY,currentX:t.clientX,currentY:t.clientY};const n=e.target.closest("li, blockquote");o.current=n||null}),[]),l=X((e=>{if(!r.current)return;const t=e.touches[0];r.current.currentX=t.clientX,r.current.currentY=t.clientY;const n=t.clientX-r.current.startX,a=Math.abs(t.clientY-r.current.startY);if(o.current&&a<30){const e=Math.max(-80,Math.min(80,n));o.current.style.transform=`translateX(${e}px)`,o.current.style.transition="none"}}),[]),i=X((t=>{if(!r.current||!e)return void(r.current=null);const{startX:a,startY:l,currentX:i,currentY:c}=r.current,s=i-a,u=c-l,d=Math.abs(s),m=Math.abs(u);o.current&&(o.current.style.transform="",o.current.style.transition="transform 0.2s ease",setTimeout((()=>{o.current&&(o.current.style.transition="")}),200)),o.current&&d>=50&&m<30&&(s>0?e.executeCommand("indent"):e.executeCommand("outdent")),u>50&&d<30&&t.target.closest(".rmx-floating-toolbar")&&n.onDismissToolbar?.(),r.current=null,o.current=null}),[e,n]);G((()=>{const e=t?.current;if(e)return e.addEventListener("touchstart",a,{passive:!0}),e.addEventListener("touchmove",l,{passive:!0}),e.addEventListener("touchend",i,{passive:!0}),()=>{e.removeEventListener("touchstart",a),e.removeEventListener("touchmove",l),e.removeEventListener("touchend",i)}}),[t,a,l,i])}(Q,V,{onDismissToolbar:()=>{Q?.element&&window.getSelection()?.removeAllRanges()}});!function(e,t,n={}){const{enabled:r=!0}=n,o=Y(null),a=Y(null),l=Y(!1),i=X((()=>{o.current&&(clearTimeout(o.current),o.current=null),a.current=null,l.current=!1}),[]),c=X((e=>{if(!r||!e.touches.length)return;const n=e.touches[0];a.current={x:n.clientX,y:n.clientY},l.current=!1,o.current=setTimeout((()=>{if(navigator.vibrate)try{navigator.vibrate(10)}catch(e){}l.current=!0,t?.({x:a.current.x,y:a.current.y})}),500)}),[r,t]),s=X((e=>{if(!a.current||!e.touches.length)return;const t=e.touches[0],n=Math.abs(t.clientX-a.current.x),r=Math.abs(t.clientY-a.current.y);(n>10||r>10)&&i()}),[i]),u=X((e=>{l.current&&e.preventDefault(),i()}),[i]),d=X((e=>{l.current&&e.preventDefault()}),[]);G((()=>{const t=e?.current;if(t&&r)return t.addEventListener("touchstart",c,{passive:!0}),t.addEventListener("touchmove",s,{passive:!0}),t.addEventListener("touchend",u),t.addEventListener("contextmenu",d),()=>{t.removeEventListener("touchstart",c),t.removeEventListener("touchmove",s),t.removeEventListener("touchend",u),t.removeEventListener("contextmenu",d),i()}}),[e,r,c,s,u,d,i])}(V,X((({x:e,y:t})=>{Q&&Q.eventBus.emit("contextmenu",{clientX:e,clientY:t,preventDefault:()=>{}})}),[Q]),{enabled:w&&!d});const{zoomedElement:Ne,resetZoom:Ee}=function(e){const[t,n]=U(null),r=Y(null),o=Y(1),a=X((()=>{if(t){if(t.style.transform="",t.style.transformOrigin="","IMG"===t.tagName)t.removeAttribute("data-rmx-zoomed");else{const e=t.closest(".rmx-pinch-zoom-wrapper");e&&(e.style.transform=""),t.removeAttribute("data-rmx-zoomed")}n(null)}}),[t]),l=X((e=>{if(2!==e.touches.length)return;const t=e.target.closest("img, table");if(!t)return;e.preventDefault();const n=tt(e.touches[0],e.touches[1]),o=t.style.transform.match(/scale\(([^)]+)\)/),a=o?parseFloat(o[1]):1;r.current={element:t,initialDistance:n,initialScale:a},t.style.transformOrigin="center center"}),[]),i=X((e=>{if(!r.current||2!==e.touches.length)return;e.preventDefault();const t=tt(e.touches[0],e.touches[1]),{initialDistance:n,initialScale:a,element:l}=r.current;let i=a*(t/n);i=Math.max(.5,Math.min(3,i)),o.current=i,l.style.transform=`scale(${i})`}),[]),c=X((e=>{if(!r.current)return;const{element:t}=r.current,a=o.current;if(Math.abs(a-1)>.05)if("IMG"===t.tagName){const e=t.getBoundingClientRect(),r=Math.round(e.width),o=Math.round(e.height);t.style.transform="",t.setAttribute("width",r),t.setAttribute("height",o),t.style.width=`${r}px`,t.style.height=`${o}px`,t.setAttribute("data-rmx-zoomed","true"),n(t)}else"TABLE"===t.tagName&&(t.setAttribute("data-rmx-zoomed","true"),n(t));else t.style.transform="",t.style.transformOrigin="";r.current=null,o.current=1}),[]);return G((()=>{const t=e?.current;if(t)return t.addEventListener("touchstart",l,{passive:!1}),t.addEventListener("touchmove",i,{passive:!1}),t.addEventListener("touchend",c,{passive:!0}),()=>{t.removeEventListener("touchstart",l),t.removeEventListener("touchmove",i),t.removeEventListener("touchend",c)}}),[e,l,i,c]),{zoomedElement:t,resetZoom:a}}(V);!function(e,t){const[n,r]=U(!1),[o,a]=U(0),l=Y(null),i=X((t=>{if(!e?.element)return;const n=window.getSelection();if(!n||0===n.rangeCount)return;const r=n.getRangeAt(0).getBoundingClientRect();if(!r||0===r.top&&0===r.left)return;const o=window.visualViewport?window.visualViewport.height:window.innerHeight-t;if(r.bottom>o-20){const t=r.bottom-o+60;e.element.scrollTop+=t}}),[e]);G((()=>{if("undefined"==typeof window)return;if(l.current=window.innerHeight,window.visualViewport){const e=window.visualViewport,n=()=>{const n=(l.current||window.screen.height)-e.height;n>100?(r(!0),a(n),t?.current&&(t.current.style.paddingBottom=`${n}px`),i(n)):(r(!1),a(0),t?.current&&(t.current.style.paddingBottom=""))};return e.addEventListener("resize",n),()=>e.removeEventListener("resize",n)}let e=window.innerHeight;const n=()=>{const n=window.innerHeight,o=e-n;o>100?(r(!0),a(o),t?.current&&(t.current.style.paddingBottom=`${o}px`),i(o)):n>=(l.current||e)-50&&(r(!1),a(0),t?.current&&(t.current.style.paddingBottom="")),e=n};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e,t,i])}(Q,q),G((()=>{if(Q)return Q.eventBus.on("mode:change",(({sourceMode:e})=>{e&&me("source")}))}),[Q,me]);const[Me,Te]=U(!1);G((()=>{if(!Q)return;const e=e=>{const t=navigator.platform.includes("Mac")?e.metaKey:e.ctrlKey;t&&"f"===e.key&&(e.preventDefault(),me("findReplace")),z&&t&&e.shiftKey&&("p"===e.key||"P"===e.key)&&(e.preventDefault(),Te((e=>!e)))};return Q.element?.addEventListener("keydown",e),()=>Q.element?.removeEventListener("keydown",e)}),[Q,me,z]),G((()=>{if(!Q||!O)return;const e=[Q.eventBus.on("plugin:error",(({name:e,error:t})=>O(t,{source:"plugin",pluginName:e}))),Q.eventBus.on("editor:error",(({phase:e,error:t})=>O(t,{source:"engine",phase:e}))),Q.eventBus.on("upload:error",(({file:e,error:t})=>O(t,{source:"upload",file:e})))];return()=>e.forEach((e=>e()))}),[Q,O]);const Le=X(((e,t)=>{"commandPalette"!==e?me(e,t):Te(!0)}),[me]),[De,Re]=U(!0);G((()=>{if(!Q)return;const e=()=>{const e=Q.getText().trim();Re(""===e||"\n"===e)},t=Q.eventBus.on("content:change",e);return e(),t}),[Q]);const[Be,Oe]=U(!1);G((()=>{if(Q)return Q.eventBus.on("splitView:toggle",(({active:e})=>Oe(e)))}),[Q]);const Ae=J((()=>"popup"===S?/* @__PURE__ */H(sr,{engine:Q}):null),[S,Q]),Pe=J((()=>`rmx-editor rmx-theme-${/^[a-zA-Z0-9_-]+$/.test(l)?l:"light"} ${y||""}`),[l,y]),ze=J((()=>({minHeight:s||c,maxHeight:u||void 0,height:u?void 0:c,overflowY:"auto"})),[s,c,u]),$e=J((()=>N?{...N,...g}:g),[N,g]);/* @__PURE__ */
329
+ return H(dr,{onError:O,fallback:P,children:/* @__PURE__ */H(nt.Provider,{value:ne,children:/* @__PURE__ */W("div",{ref:q,className:Pe,style:$e,children:[
330
+ /* @__PURE__ */H("a",{className:"rmx-skip-link",href:"#rmx-edit-area",children:"Skip to editor content"}),B&&/* @__PURE__ */H(te,{fallback:/* @__PURE__ */H("div",{className:"rmx-loading-spinner"}),children:/* @__PURE__ */H(Rr,{config:B,engine:Q,onOpenModal:Le})}),
331
+ /* @__PURE__ */H(Kn,{config:a,engine:Q,onOpenModal:Le,fonts:Z,statusBarMode:S,wordCountButton:Ae,toolbarItemTheme:E}),$.enabled&&!1!==$.showRecoveryBanner&&/* @__PURE__ */H(ur,{recoveryData:ge,onRecover:ve,onDismiss:be}),j&&Q&&/* @__PURE__ */H(hr,{engine:Q}),"top"===S&&/* @__PURE__ */H(cr,{engine:Q,position:"top",saveStatus:ye,showSaveStatus:$.enabled&&!1!==$.showSaveStatus}),
332
+ /* @__PURE__ */W("div",{className:"rmx-editor-body",style:{position:"relative"},children:[
333
+ /* @__PURE__ */H(Jn,{ref:V,style:ze,readOnly:d,id:"rmx-edit-area"}),Be&&Q&&/* @__PURE__ */H(gr,{engine:Q,format:_}),F&&Q&&/* @__PURE__ */H(yr,{engine:Q,editAreaRef:V}),x&&/* @__PURE__ */H(Qn,{visible:re.hasSelection,selectionRect:re.selectionRect,engine:Q,editorRect:Ce,onOpenModal:Le}),re.focusedImage&&/* @__PURE__ */H(er,{image:re.focusedImage,engine:Q,editorRect:Ce}),re.focusedTable&&/* @__PURE__ */H(tr,{table:re.focusedTable,engine:Q,editorRect:Ce}),re.focusedCodeBlock&&/* @__PURE__ */H(rr,{codeBlock:re.focusedCodeBlock,engine:Q,editorRect:Ce}),!d&&Q&&/* @__PURE__ */H(ar,{engine:Q,editorRect:Ce,editAreaRef:V}),Ne&&/* @__PURE__ */H("button",{className:"rmx-pinch-zoom-reset",onClick:Ee,type:"button","aria-label":"Reset zoom",children:"Reset Zoom"}),
334
+ /* @__PURE__ */H(or,{visible:ke,fileTypes:Se}),
335
+ /* @__PURE__ */H(te,{fallback:/* @__PURE__ */H("div",{className:"rmx-loading-spinner"}),children:de.findReplace.open&&/* @__PURE__ */H(Nr,{open:de.findReplace.open,onClose:()=>pe("findReplace"),engine:Q})})]}),"bottom"===S&&/* @__PURE__ */H(cr,{engine:Q,saveStatus:ye,showSaveStatus:$.enabled&&!1!==$.showSaveStatus}),w&&/* @__PURE__ */H(te,{fallback:/* @__PURE__ */H("div",{className:"rmx-loading-spinner"}),children:/* @__PURE__ */H(Br,{contextMenu:fe,onHide:he,onOpenModal:Le})}),xe,
336
+ /* @__PURE__ */H(Dr,{modals:de,closeModal:pe,engine:Q,showCommandPalette:z,commandPaletteOpen:Me,setCommandPaletteOpen:Te,handleOpenModal:Le})]})})})}function Ar(e,t={}){const n=Y(null),r=Y(null),o=Y(null),[a,l]=U(!1),i=Y(""),c=Y(null),s=Y(null),u=Y(null),d=X((()=>{const a=e.current;if(!a||n.current)return;const d=a.tagName.toLowerCase(),m="textarea"===d,p="input"===d;let f="";f=m||p?a.value||"":a.innerHTML||"",void 0!==t.value?f=t.value:void 0!==t.defaultValue&&(f=t.defaultValue);const h=document.createElement("div"),y=/^[a-zA-Z0-9_-]+$/.test(t.theme)?t.theme:"light";if(h.className=`rmx-editor rmx-theme-${y} ${t.className||""}`,t.style){const e=/* @__PURE__ */new Set(["width","height","minHeight","maxHeight","minWidth","maxWidth","margin","padding","border","borderRadius","background","backgroundColor","color","fontSize","fontFamily","overflow","overflowY","overflowX"]);for(const[n,r]of Object.entries(t.style))e.has(n)&&(h.style[n]=r)}r.current=h;const g=document.createElement("div");g.className="rmx-content";const v=t.height||300;g.style.minHeight="number"==typeof v?`${v}px`:v,g.style.overflowY="auto";const b=document.createElement("div");if(b.className="rmx-edit-area",b.appendChild(g),h.appendChild(b),o.current=g,m||p){a.style.display="none",a.parentNode.insertBefore(h,a.nextSibling);const e=()=>{n.current&&(a.value=n.current.getHTML())};c.current=()=>{e(),a.style.display="",h.parentNode&&h.parentNode.removeChild(h)};const t=a.closest("form");if(t){s.current=t,u.current=e,t.addEventListener("submit",e);const n=c.current;c.current=()=>{s.current?.removeEventListener("submit",u.current),s.current=null,u.current=null,n()}}}else{const e=a.textContent;a.innerHTML="",a.appendChild(h),c.current=()=>{a.textContent=e}}const x={...t,value:f},{engine:w}=re(g,x);w.init(),n.current=w;const C="markdown"===t.outputFormat;return i.current=C?N(f):f,l(!0),t.onReady?.(w),w.eventBus.emit("content:change"),w.on("content:change",(()=>{const e=w.getHTML(),n=C?N(e):e;n!==i.current&&(i.current=n,t.onChange?.(n),(m||p)&&a&&(a.value=n))})),w.on("focus",(()=>t.onFocus?.())),w.on("blur",(()=>t.onBlur?.())),w}),[]);return G((()=>{const e=d();return()=>{e&&(e.destroy(),n.current=null,l(!1)),c.current&&(c.current(),c.current=null)}}),[d]),G((()=>{if(!n.current||!a)return;if(void 0===t.value)return;if(t.value===i.current)return;i.current=t.value;const e="markdown"===t.outputFormat?S(t.value):t.value;n.current.setHTML(e)}),[t.value,t.outputFormat,a]),{engine:n.current,containerRef:r,editableRef:o,ready:a}}function Pr(e){const[t,n]=U([]),[r,o]=U(null),a=Y([]),l=X((()=>{e?._comments&&n(e._comments.getAllThreads())}),[e]);G((()=>{if(!e?.eventBus)return;l();const t=["comment:created","comment:deleted","comment:resolved","comment:replied","comment:updated","comment:imported"].map((t=>e.eventBus.on(t,l))),n=e.eventBus.on("comment:clicked",(({thread:e})=>{o(e)}));return t.push(n),a.current=t,()=>{for(const e of a.current)e?.();a.current=[]}}),[e,l]);const i=X((t=>e?._comments?.addComment(t)??null),[e]),c=X((t=>{e?._comments?.deleteComment(t)}),[e]),s=X(((t,n=!0)=>{e?._comments?.resolveComment(t,n)}),[e]),u=X(((t,n)=>e?._comments?.replyToComment(t,n)??null),[e]),d=X(((t,n)=>{e?._comments?.editComment(t,n)}),[e]),m=X((t=>{e?._comments?.navigateToComment(t);const n=e?._comments?.getThread(t);n&&o(n)}),[e]),p=X((t=>{e?._comments?.importThreads(t)}),[e]),f=X((()=>e?._comments?.exportThreads()??[]),[e]),h=X((()=>e?._comments?.getMentionUsers()??[]),[e]);return{threads:t,activeThread:r,setActiveThread:o,addComment:i,deleteComment:c,resolveComment:s,replyToComment:u,editComment:d,navigateToComment:m,importThreads:p,exportThreads:f,getMentionUsers:h,refresh:l}}function zr(e){const t=Math.floor((Date.now()-e)/1e3);if(t<60)return"just now";const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);if(r<24)return`${r}h ago`;return`${Math.floor(r/24)}d ago`}function $r({text:e}){if(!e)return null;const t=e.split(/(@[\w.-]+)/g);/* @__PURE__ */
337
+ return H("span",{children:t.map(((e,t)=>e.startsWith("@")?/* @__PURE__ */H("span",{className:"rmx-comment-mention",children:e},t):/* @__PURE__ */H("span",{children:e},t)))})}const jr=q.memo((function({threads:e=[],activeThread:t,onNavigate:n,onResolve:r,onDelete:o,onReply:a,className:l="",filter:i="all"}){const[c,s]=U(null),[u,d]=U(""),m=Y(null),p=e.filter((e=>"open"===i?!e.resolved:"resolved"!==i||e.resolved)),f=e.filter((e=>!e.resolved)).length,h=X((e=>{u.trim()&&(a?.(e,{author:"You",body:u.trim()}),d(""),s(null))}),[u,a]),y=X((e=>{s(e),d(""),requestAnimationFrame((()=>m.current?.focus()))}),[]);/* @__PURE__ */
338
+ return W("div",{className:`rmx-comments-panel ${l}`.trim(),role:"complementary","aria-label":"Comments",children:[
339
+ /* @__PURE__ */W("div",{className:"rmx-comments-panel-header",children:[
340
+ /* @__PURE__ */H("span",{children:"Comments"}),
341
+ /* @__PURE__ */W("span",{className:"rmx-comments-panel-count",children:[f," open · ",e.length-f," resolved"]})]}),0===p.length?/* @__PURE__ */H("div",{style:{color:"var(--rmx-text-secondary)",fontSize:13,padding:"8px 0"},children:"resolved"===i?"No resolved comments":"open"===i?"No open comments":'No comments yet. Select text and click "Add Comment" to start.'}):p.map((e=>/* @__PURE__ */W("div",{className:`rmx-comment-thread${e.resolved?" rmx-resolved":""}${t?.id===e.id?" rmx-active":""}`,onClick:()=>n?.(e.id),children:[
342
+ /* @__PURE__ */W("div",{className:"rmx-comment-thread-header",children:[
343
+ /* @__PURE__ */H("span",{className:"rmx-comment-author",children:e.author}),
344
+ /* @__PURE__ */H("span",{className:"rmx-comment-time",children:zr(e.createdAt)})]}),
345
+ /* @__PURE__ */H("div",{className:"rmx-comment-body",children:/* @__PURE__ */H($r,{text:e.body})}),
346
+ /* @__PURE__ */H("span",{className:"rmx-comment-status "+(e.resolved?"rmx-closed":"rmx-open"),children:e.resolved?"Resolved":"Open"}),e.replies.map((e=>/* @__PURE__ */W("div",{className:"rmx-comment-reply",children:[
347
+ /* @__PURE__ */W("div",{className:"rmx-comment-thread-header",children:[
348
+ /* @__PURE__ */H("span",{className:"rmx-comment-author",children:e.author}),
349
+ /* @__PURE__ */H("span",{className:"rmx-comment-time",children:zr(e.createdAt)})]}),
350
+ /* @__PURE__ */H("div",{className:"rmx-comment-body",children:/* @__PURE__ */H($r,{text:e.body})})]},e.id))),c===e.id&&/* @__PURE__ */H("div",{className:"rmx-comment-reply",style:{marginTop:6},children:/* @__PURE__ */H("input",{ref:m,type:"text",placeholder:"Reply...",value:u,onChange:e=>d(e.target.value),onKeyDown:t=>{"Enter"===t.key&&h(e.id),"Escape"===t.key&&s(null)},onClick:e=>e.stopPropagation(),style:{width:"100%",padding:"4px 8px",fontSize:12,border:"1px solid var(--rmx-border, #e2e8f0)",borderRadius:4,outline:"none"}})}),
351
+ /* @__PURE__ */W("div",{className:"rmx-comment-actions",onClick:e=>e.stopPropagation(),children:[
352
+ /* @__PURE__ */H("button",{className:"rmx-comment-action-btn",onClick:()=>y(e.id),children:"Reply"}),
353
+ /* @__PURE__ */H("button",{className:"rmx-comment-action-btn rmx-resolve-btn",onClick:()=>r?.(e.id,!e.resolved),children:e.resolved?"Reopen":"Resolve"}),
354
+ /* @__PURE__ */H("button",{className:"rmx-comment-action-btn rmx-delete-btn",onClick:()=>o?.(e.id),children:"Delete"})]})]},e.id)))]})}));function Fr(e){const[t,n]=U([]),[r,o]=U({total:0,grammar:0,style:0,byRule:{}}),[a,l]=U(!0),[i,c]=U("formal"),[s,u]=U("en-US"),d=Y([]),m=X((()=>{if(!e?._spellcheck)return;const t=e._spellcheck.getStats();n(e._spellcheck.getErrors()),o(t),l(e._spellcheck.isEnabled()),c(e._spellcheck.getWritingStyle()),u(e._spellcheck.getLanguage())}),[e]);G((()=>{if(!e?.eventBus)return;m();const t=["spellcheck:update","spellcheck:toggle","spellcheck:style:change","spellcheck:language:change","spellcheck:dictionary:add","spellcheck:ignored:add","spellcheck:correction"].map((t=>e.eventBus.on(t,m)));return d.current=t,()=>{for(const e of d.current)e?.();d.current=[]}}),[e,m]);return{errors:t,stats:r,enabled:a,stylePreset:i,language:s,toggleSpellcheck:X((()=>e?.executeCommand?.("toggleSpellcheck")??!1),[e]),checkGrammar:X((async()=>e?._spellcheck?.runCheck()??[]),[e]),addToDictionary:X((t=>{e?._spellcheck?.addToDictionary(t)}),[e]),removeFromDictionary:X((t=>{e?._spellcheck?.removeFromDictionary(t)}),[e]),ignoreWord:X((t=>{e?._spellcheck?.ignoreWord(t)}),[e]),setWritingStyle:X((t=>{e?._spellcheck?.setWritingStyle(t)}),[e]),setLanguage:X((t=>{e?._spellcheck?.setLanguage(t)}),[e]),getDictionary:X((()=>e?._spellcheck?.getDictionary()??[]),[e]),getIgnoredWords:X((()=>e?._spellcheck?.getIgnoredWords()??[]),[e]),refresh:m}}function _r(e){const[t,n]=U([]),[r,o]=U("disconnected"),a=Y([]);G((()=>{if(!e?.eventBus)return;const t=()=>{e._collaboration&&(n(e._collaboration.getCollaborators()),o(e._collaboration.getConnectionStatus()))};t();const r=["collab:userJoin","collab:userLeave","collab:connected","collab:disconnected","collab:sync"].map((n=>e.eventBus.on(n,t)));return a.current=r,()=>{for(const e of a.current)e?.();a.current=[]}}),[e]);return{collaborators:t,connectionStatus:r,startCollaboration:X((()=>{e?._collaboration?.startCollaboration()}),[e]),stopCollaboration:X((()=>{e?._collaboration?.stopCollaboration()}),[e]),localUser:e?._collaboration?{userId:e._collaboration.userId,userName:e._collaboration.userName,userColor:e._collaboration.userColor}:null}}function Ir({collaborators:e=[],connectionStatus:t="disconnected",localUser:n,className:r="",showCount:o=!0}){/* @__PURE__ */
355
+ return W("div",{className:`rmx-collab-bar ${r}`,role:"status","aria-label":"Collaborators",children:[
356
+ /* @__PURE__ */H("div",{className:"rmx-collab-status-dot","data-status":t,title:t}),n&&/* @__PURE__ */H("div",{className:"rmx-collab-avatar rmx-collab-avatar-local",style:{backgroundColor:n.userColor},title:`${n.userName} (you)`,children:n.userName.charAt(0).toUpperCase()}),e.map((e=>/* @__PURE__ */H("div",{className:"rmx-collab-avatar",style:{backgroundColor:e.userColor,opacity:"idle"===e.status?.6:1},title:`${e.userName} (${e.status})`,children:e.userName.charAt(0).toUpperCase()},e.userId))),o&&/* @__PURE__ */W("span",{style:{fontSize:11,color:"#64748b",marginLeft:4},children:[e.length+(n?1:0)," user",e.length>0?"s":""]})]})}Ir.propTypes={collaborators:Ot.arrayOf(Ot.shape({userId:Ot.string.isRequired,userName:Ot.string.isRequired,userColor:Ot.string.isRequired,status:Ot.string})),connectionStatus:Ot.string,localUser:Ot.shape({userId:Ot.string,userName:Ot.string.isRequired,userColor:Ot.string.isRequired}),className:Ot.string,showCount:Ot.bool};const Hr=q.memo(Ir);export{hr as B,kn as C,dr as E,$n as I,yr as M,Ot as P,ur as R,ir as S,vr as T,wn as a,Hr as b,jr as c,mr as d,Or as e,gr as f,Xn as g,Ze as h,_r as i,Pr as j,et as k,oe as l,Ar as m,Fr as n,br as o,rt as u};
357
+ //# sourceMappingURL=index-DL-qBZZU.js.map