@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,2 @@
1
+ "use strict";const e=require("@remyxjs/core"),t=require("react/jsx-runtime"),n=require("react"),r=[e.registerFormattingCommands,e.registerHeadingCommands,e.registerAlignmentCommands,e.registerListCommands,e.registerLinkCommands,e.registerImageCommands,e.registerTableCommands,e.registerBlockCommands,e.registerFontCommands,e.registerMediaCommands,e.registerFindReplaceCommands,e.registerSourceModeCommands,e.registerFullscreenCommands,e.registerDistractionFreeCommands,e.registerSplitViewCommands,e.registerColorPresetCommands,e.registerMarkdownToggleCommands,e.registerAttachmentCommands,e.registerImportDocumentCommands,e.registerBlockConvertCommands];function o(t,n){const o=new e.EditorEngine(t,n);for(const e of r)e(o);o.commands.register("undo",{execute(e){e.history.undo()},isEnabled:e=>e.history.canUndo(),shortcut:"mod+z",meta:{icon:"undo",tooltip:"Undo"}}),o.commands.register("redo",{execute(e){e.history.redo()},isEnabled:e=>e.history.canRedo(),shortcut:"mod+shift+z",meta:{icon:"redo",tooltip:"Redo"}});const a=new Set((n.plugins||[]).map((e=>e?.name)).filter(Boolean));a.has("wordCount")||o.plugins.register(e.WordCountPlugin()),n.placeholder&&!a.has("placeholder")&&o.plugins.register(e.PlaceholderPlugin(n.placeholder)),a.has("autolink")||o.plugins.register(e.AutolinkPlugin()),n.plugins&&n.plugins.forEach((e=>o.plugins.register(e)));const s="markdown"===n.outputFormat;let l=n.value||n.defaultValue||"";return l&&s&&(l=e.markdownToHtml(l)),l&&o.setHTML(l),{engine:o,initialContent:l}}function a(t,r,a){const s=n.useRef(null),[l,i]=n.useState(!1),c=n.useRef(r.value||r.defaultValue||""),u=n.useRef(null),d=n.useRef(r);d.current=r;const m=n.useCallback((()=>{if(!t.current||s.current)return;const n=d.current,{engine:r}=o(t.current,n);return r.init(),s.current=r,i(!0),n.onReady?.(r),r.eventBus.emit("content:change"),r.on("content:change",(()=>{u.current&&cancelAnimationFrame(u.current),u.current=requestAnimationFrame((()=>{let t;if(u.current=null,r.isMarkdownMode)t=r.element.textContent;else{const n=r.getHTML();t="markdown"===d.current.outputFormat?e.htmlToMarkdown(n):n}t!==c.current&&(c.current=t,d.current.onChange?.(t))}))})),r.on("focus",(()=>d.current.onFocus?.())),r.on("blur",(()=>d.current.onBlur?.())),r}),[]);return n.useEffect((()=>{const e=m();return()=>{u.current&&(cancelAnimationFrame(u.current),u.current=null),e&&(e.destroy(),s.current=null,i(!1))}}),[m,a]),n.useEffect((()=>{if(!s.current||!l)return;if(void 0===r.value)return;if(r.value===c.current)return;c.current=r.value;const t="markdown"===r.outputFormat?e.markdownToHtml(r.value):r.value;s.current.setHTML(t)}),[r.value,r.outputFormat,l]),{engine:s.current,ready:l}}const s={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},l={hasSelection:!1,selectionRect:null,focusedImage:null,focusedTable:null,focusedCodeBlock:null},i=Object.keys(s);const c={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 u(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 d(t,r){const[o,a]=n.useState({visible:!1,x:0,y:0,items:[]}),s=n.useCallback((async()=>{const e=window.getSelection();if(e&&!e.isCollapsed)try{await navigator.clipboard.writeText(e.toString()),e.getRangeAt(0).deleteContents()}catch{}}),[]),l=n.useCallback((async()=>{const e=window.getSelection();if(e&&!e.isCollapsed)try{await navigator.clipboard.writeText(e.toString())}catch{}}),[]),i=n.useCallback((()=>async function(t){if(t){t.history.snapshot();try{if(navigator.clipboard?.read){const n=await navigator.clipboard.read();for(const r of n){if(r.types.includes("text/html")){const n=await r.getType("text/html");let o=await n.text();return o=e.cleanPastedHTML(o),o=t.sanitizer.sanitize(o),t.selection.insertHTML(o),void t.eventBus.emit("content:change")}if(r.types.includes("text/plain")){const n=await r.getType("text/plain"),o=await n.text();return e.insertPlainText(t,o),void t.eventBus.emit("content:change")}}}if(navigator.clipboard?.readText){const n=await navigator.clipboard.readText();n&&(e.insertPlainText(t,n),t.eventBus.emit("content:change"))}}catch{try{const n=await(navigator.clipboard?.readText?.());n&&(e.insertPlainText(t,n),t.eventBus.emit("content:change"))}catch{}}}}(t)),[t]),c=n.useCallback((()=>{if(!t)return;const e=window.getSelection(),n=document.createRange();n.selectNodeContents(t.element),e.removeAllRanges(),e.addRange(n)}),[t]),u=n.useCallback((e=>{if(!t)return;e.preventDefault();const n=e.target,r=[];r.push({label:"Cut",command:s},{label:"Copy",command:l},{label:"Paste",command:i},{separator:!0},{label:"Select All",command:c});const o=n.closest?.("a");o&&r.push({separator:!0},{label:"Edit Link",command:"editLinkModal",data:o},{label:"Remove Link",command:()=>t.executeCommand("removeLink")},{label:"Open Link",command:()=>{const e=o.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&&r.push({separator:!0},{label:"Align Left",command:()=>t.executeCommand("alignImage",{element:u,alignment:"left"})},{label:"Align Center",command:()=>t.executeCommand("alignImage",{element:u,alignment:"center"})},{label:"Align Right",command:()=>t.executeCommand("alignImage",{element:u,alignment:"right"})},{label:"Remove Image",command:()=>t.executeCommand("removeImage",{element:u})});const d=n.closest?.("table");d&&r.push({separator:!0},{label:"Insert Row Before",command:()=>t.executeCommand("addRowBefore")},{label:"Insert Row After",command:()=>t.executeCommand("addRowAfter")},{label:"Insert Column Before",command:()=>t.executeCommand("addColBefore")},{label:"Insert Column After",command:()=>t.executeCommand("addColAfter")},{separator:!0},{label:"Toggle Header Row",command:()=>t.executeCommand("toggleHeaderRow")},{separator:!0},{label:"Format as Number",command:()=>t.executeCommand("formatCell",{format:"number"})},{label:"Format as Currency",command:()=>t.executeCommand("formatCell",{format:"currency"})},{label:"Format as Percentage",command:()=>t.executeCommand("formatCell",{format:"percentage"})},{label:"Format as Date",command:()=>t.executeCommand("formatCell",{format:"date"})},{separator:!0},{label:"Clear Filters",command:()=>t.executeCommand("clearTableFilters")},{separator:!0},{label:"Delete Row",command:()=>t.executeCommand("deleteRow")},{label:"Delete Column",command:()=>t.executeCommand("deleteCol")},{label:"Delete Table",command:()=>t.executeCommand("deleteTable")}),a({visible:!0,x:e.clientX,y:e.clientY,items:r})}),[t,s,l,i,c]),d=n.useCallback((()=>{a((e=>({...e,visible:!1})))}),[]),m=n.useRef(!1);return m.current=o.visible,n.useEffect((()=>{const e=r?.current;if(!e)return;e.addEventListener("contextmenu",u),document.addEventListener("click",d);const t=()=>{m.current&&d()};return document.addEventListener("scroll",t,!0),()=>{e.removeEventListener("contextmenu",u),document.removeEventListener("click",d),document.removeEventListener("scroll",t,!0)}}),[r,u,d]),{contextMenu:o,hideContextMenu:d}}const m="ocean",p="Write your blog post...",f="markdown",x=!1,h=[["undo","redo"],["heading"],["bold","italic","underline","strikethrough"],["link","image","blockquote","codeBlock","hr"],["orderedList","bulletList","checklist"],["table"]],g=!1,y="bottom",b=!0,v=!0,j=!0,C={"syntax-highlight":{enabled:!0},table:{enabled:!0},callout:{enabled:!0},link:{enabled:!0},toc:{enabled:!0},analytics:{enabled:!0},spellcheck:{enabled:!0}},k={theme:m,placeholder:p,height:500,outputFormat:f,readOnly:x,toolbar:h,menuBar:g,statusBar:y,floatingToolbar:b,contextMenu:v,commandPalette:j,plugins:C},w=Object.freeze(Object.defineProperty({__proto__:null,commandPalette:j,contextMenu:v,default:k,floatingToolbar:b,height:500,menuBar:g,outputFormat:f,placeholder:p,plugins:C,readOnly:x,statusBar:y,theme:m,toolbar:h},Symbol.toStringTag,{value:"Module"})),S="light",E="Start typing to explore all the features...",N="html",T=!1,M=[["undo","redo"],["heading"],["font","fontSize"],["bold","italic","underline","strikethrough"],["textColor","bgColor"],["align"],["orderedList","bulletList","checklist"],["indent","outdent"],["link","image","table","codeBlock","blockquote","hr"]],R=!0,L="bottom",D=!0,O=!0,B=!0,F={"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}},A={theme:S,placeholder:E,height:400,outputFormat:N,readOnly:T,toolbar:M,menuBar:R,statusBar:L,floatingToolbar:D,contextMenu:O,commandPalette:B,plugins:F},P=Object.freeze(Object.defineProperty({__proto__:null,commandPalette:B,contextMenu:O,default:A,floatingToolbar:D,height:400,menuBar:R,outputFormat:N,placeholder:E,plugins:F,readOnly:T,statusBar:L,theme:S,toolbar:M},Symbol.toStringTag,{value:"Module"})),_="light",I="Write something...",z="html",$=!1,H=[["bold","italic","underline"],["link"]],W=!1,q=!1,V=!0,U=!0,Y=!1,X={},G={theme:_,placeholder:I,height:200,outputFormat:z,readOnly:$,toolbar:H,menuBar:W,statusBar:q,floatingToolbar:V,contextMenu:U,commandPalette:Y,plugins:X},K=Object.freeze(Object.defineProperty({__proto__:null,commandPalette:Y,contextMenu:U,default:G,floatingToolbar:V,height:200,menuBar:W,outputFormat:z,placeholder:I,plugins:X,readOnly:$,statusBar:q,theme:_,toolbar:H},Symbol.toStringTag,{value:"Module"})),J=Object.assign({"../../../../remyxjs/config/blog-editor.json":w,"../../../../remyxjs/config/default.json":P,"../../../../remyxjs/config/minimal.json":K}),Z=new Map;for(const[_n,In]of Object.entries(J)){const e=_n.split("/").pop().replace(".json","");Z.set(e,In.default||In)}function Q(t,r){const o=n.useRef("saved"),[a,s]=n.useState("saved"),[l,i]=n.useState(null),[c,u]=n.useState(null),d=n.useRef(null),m=n.useRef(r?.onRecover);m.current=r?.onRecover;const p=r?.enabled??!1,f=r?.key,x=r?.interval,h=r?.debounce,g=r?.provider;n.useEffect((()=>{if(!t||!p)return;const n=new e.AutosaveManager(t,{enabled:!0,key:f,interval:x,debounce:h,provider:g});d.current=n;const r=e=>{o.current!==e&&(o.current=e,s(e))},a=[t.eventBus.on("autosave:saving",(()=>r("saving"))),t.eventBus.on("autosave:saved",(({timestamp:e})=>{r("saved"),i(e)})),t.eventBus.on("autosave:error",(()=>r("error"))),t.eventBus.on("content:change",(()=>{"saving"!==o.current&&r("unsaved")}))],l=t.getHTML();return n.checkRecovery(l).then((e=>{e&&(u(e),t.eventBus.emit("autosave:recovered",e),m.current?.(e)),n.init()})).catch((e=>{n.init()})),()=>{a.forEach((e=>e())),n.destroy(),d.current=null}}),[t,p,f,x,h,g]);const y=n.useCallback((()=>{t&&c&&(t.setHTML(c.recoveredContent),t.eventBus.emit("content:change"),u(null),d.current?.clearRecovery())}),[t,c]),b=n.useCallback((()=>{u(null),d.current?.clearRecovery()}),[]);return n.useMemo((()=>({saveStatus:a,lastSaved:l,recoveryData:c,recoverContent:y,dismissRecovery:b})),[a,l,c,y,b])}function ee(e){const[t,r]=n.useState(null),o=n.useRef(null);return n.useEffect((()=>{const t=e.current;if(!t)return;const n=()=>{const e=t.getBoundingClientRect();e&&r(e)};n();const a=new ResizeObserver((()=>{o.current&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(n)}));a.observe(t);const s=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,l=()=>{o.current&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(n)};return s.addEventListener("scroll",l,{passive:!0}),()=>{a.disconnect(),s.removeEventListener("scroll",l),o.current&&cancelAnimationFrame(o.current)}}),[e]),t}function te(e){const[t,r]=n.useState(!1),[o,a]=n.useState([]);return n.useEffect((()=>{if(!e)return;const t=[e.eventBus.on("drag:enter",(({isExternal:e,types:t})=>{e&&(r(!0),a(t||[]))})),e.eventBus.on("drag:leave",(()=>{r(!1),a([])})),e.eventBus.on("drag:end",(()=>{r(!1),a([])})),e.eventBus.on("drop",(()=>{r(!1),a([])}))];return()=>t.forEach((e=>e()))}),[e]),{isExternalDrag:t,dragFileTypes:o}}function ne(e,t){const n=e.clientX-t.clientX,r=e.clientY-t.clientY;return Math.sqrt(n*n+r*r)}const re=n.createContext(null);function oe(){return n.useContext(re)}function ae(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var se,le={exports:{}},ie={exports:{}},ce={};var ue,de,me,pe,fe,xe,he,ge,ye,be,ve,je,Ce,ke,we,Se={};function Ee(){return de||(de=1,"production"===process.env.NODE_ENV?ie.exports=function(){if(se)return ce;se=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,i=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,x=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,g=e?Symbol.for("react.responder"):60118,y=e?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 i:case c:case r:case a:case o:case d:return e;default:switch(e=e&&e.$$typeof){case l:case u:case f:case p:case s:return e;default:return m}}case n:return m}}}function v(e){return b(e)===c}return ce.AsyncMode=i,ce.ConcurrentMode=c,ce.ContextConsumer=l,ce.ContextProvider=s,ce.Element=t,ce.ForwardRef=u,ce.Fragment=r,ce.Lazy=f,ce.Memo=p,ce.Portal=n,ce.Profiler=a,ce.StrictMode=o,ce.Suspense=d,ce.isAsyncMode=function(e){return v(e)||b(e)===i},ce.isConcurrentMode=v,ce.isContextConsumer=function(e){return b(e)===l},ce.isContextProvider=function(e){return b(e)===s},ce.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},ce.isForwardRef=function(e){return b(e)===u},ce.isFragment=function(e){return b(e)===r},ce.isLazy=function(e){return b(e)===f},ce.isMemo=function(e){return b(e)===p},ce.isPortal=function(e){return b(e)===n},ce.isProfiler=function(e){return b(e)===a},ce.isStrictMode=function(e){return b(e)===o},ce.isSuspense=function(e){return b(e)===d},ce.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===a||e===o||e===d||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===p||e.$$typeof===s||e.$$typeof===l||e.$$typeof===u||e.$$typeof===h||e.$$typeof===g||e.$$typeof===y||e.$$typeof===x)},ce.typeOf=b,ce}():ie.exports=(ue||(ue=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,i=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,x=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,g=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var m=e.$$typeof;switch(m){case t:var x=e.type;switch(x){case i:case c:case r:case a:case o:case d:return x;default:var h=x&&x.$$typeof;switch(h){case l:case u:case f:case p:case s:return h;default:return m}}case n:return m}}}var v=i,j=c,C=l,k=s,w=t,S=u,E=r,N=f,T=p,M=n,R=a,L=o,D=d,O=!1;function B(e){return b(e)===c}Se.AsyncMode=v,Se.ConcurrentMode=j,Se.ContextConsumer=C,Se.ContextProvider=k,Se.Element=w,Se.ForwardRef=S,Se.Fragment=E,Se.Lazy=N,Se.Memo=T,Se.Portal=M,Se.Profiler=R,Se.StrictMode=L,Se.Suspense=D,Se.isAsyncMode=function(e){return O||(O=!0),B(e)||b(e)===i},Se.isConcurrentMode=B,Se.isContextConsumer=function(e){return b(e)===l},Se.isContextProvider=function(e){return b(e)===s},Se.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Se.isForwardRef=function(e){return b(e)===u},Se.isFragment=function(e){return b(e)===r},Se.isLazy=function(e){return b(e)===f},Se.isMemo=function(e){return b(e)===p},Se.isPortal=function(e){return b(e)===n},Se.isProfiler=function(e){return b(e)===a},Se.isStrictMode=function(e){return b(e)===o},Se.isSuspense=function(e){return b(e)===d},Se.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===a||e===o||e===d||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===p||e.$$typeof===s||e.$$typeof===l||e.$$typeof===u||e.$$typeof===h||e.$$typeof===g||e.$$typeof===y||e.$$typeof===x)},Se.typeOf=b}()),Se)),ie.exports}function Ne(){if(pe)return me;pe=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return me=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,s,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),i=1;i<arguments.length;i++){for(var c in a=Object(arguments[i]))t.call(a,c)&&(l[c]=a[c]);if(e){s=e(a);for(var u=0;u<s.length;u++)n.call(a,s[u])&&(l[s[u]]=a[s[u]])}}return l},me}function Te(){if(xe)return fe;xe=1;return fe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Me(){return ge?he:(ge=1,he=Function.call.bind(Object.prototype.hasOwnProperty))}function Re(){if(be)return ye;be=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=Te(),n={},r=Me();e=function(e){var t="Warning: "+e;try{throw new Error(t)}catch(n){}}}function o(o,a,s,l,i){if("production"!==process.env.NODE_ENV)for(var c in o)if(r(o,c)){var u;try{if("function"!=typeof o[c]){var d=Error((l||"React class")+": "+s+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}u=o[c](a,c,l,s,null,t)}catch(p){u=p}if(!u||u instanceof Error||e((l||"React class")+": type specification of "+s+" `"+c+"` 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=i?i():"";e("Failed "+s+" type: "+u.message+(null!=m?m:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},ye=o}function Le(){if(je)return ve;je=1;var e=Ee(),t=Ne(),n=Te(),r=Me(),o=Re(),a=function(){};function s(){return null}return"production"!==process.env.NODE_ENV&&(a=function(e){var t="Warning: "+e;try{throw new Error(t)}catch(n){}}),ve=function(l,i){var c="function"==typeof Symbol&&Symbol.iterator;var u="<<anonymous>>",d={array:x("array"),bigint:x("bigint"),bool:x("boolean"),func:x("function"),number:x("number"),object:x("object"),string:x("string"),symbol:x("symbol"),any:f(s),arrayOf:function(e){return f((function(t,r,o,a,s){if("function"!=typeof e)return new p("Property `"+s+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var l=t[r];if(!Array.isArray(l))return new p("Invalid "+a+" `"+s+"` of type `"+y(l)+"` supplied to `"+o+"`, expected an array.");for(var i=0;i<l.length;i++){var c=e(l,i,o,a,s+"["+i+"]",n);if(c instanceof Error)return c}return null}))},element:f((function(e,t,n,r,o){var a=e[t];return l(a)?null:new p("Invalid "+r+" `"+o+"` of type `"+y(a)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:f((function(t,n,r,o,a){var s=t[n];return e.isValidElementType(s)?null:new p("Invalid "+o+" `"+a+"` of type `"+y(s)+"` 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 s=e.name||u;return new p("Invalid "+o+" `"+a+"` of type `"+(((l=t[n]).constructor&&l.constructor.name?l.constructor.name:u)+"` supplied to `")+r+"`, expected instance of `"+s+"`.")}var l;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,s,l){if("function"!=typeof e)return new p("Property `"+l+"` of component `"+a+"` has invalid PropType notation inside objectOf.");var i=t[o],c=y(i);if("object"!==c)return new p("Invalid "+s+" `"+l+"` of type `"+c+"` supplied to `"+a+"`, expected an object.");for(var u in i)if(r(i,u)){var d=e(i,u,a,s,l+"."+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."),s;return f((function(t,n,r,o,a){for(var s=t[n],l=0;l<e.length;l++)if(m(s,e[l]))return null;var i=JSON.stringify(e,(function(e,t){return"symbol"===b(t)?String(t):t}));return new p("Invalid "+o+" `"+a+"` of value `"+String(s)+"` supplied to `"+r+"`, expected one of "+i+".")}))},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&a("Invalid argument supplied to oneOfType, expected an instance of array."),s;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 "+v(o)+" at index "+t+"."),s}return f((function(t,o,a,s,l){for(var i=[],c=0;c<e.length;c++){var u=(0,e[c])(t,o,a,s,l,n);if(null==u)return null;u.data&&r(u.data,"expectedType")&&i.push(u.data.expectedType)}return new p("Invalid "+s+" `"+l+"` supplied to `"+a+"`"+(i.length>0?", expected one of type ["+i.join(", ")+"]":"")+".")}))},shape:function(e){return f((function(t,r,o,a,s){var l=t[r],i=y(l);if("object"!==i)return new p("Invalid "+a+" `"+s+"` of type `"+i+"` supplied to `"+o+"`, expected `object`.");for(var c in e){var u=e[c];if("function"!=typeof u)return h(o,a,s,c,b(u));var d=u(l,c,o,a,s+"."+c,n);if(d)return d}return null}))},exact:function(e){return f((function(o,a,s,l,i){var c=o[a],u=y(c);if("object"!==u)return new p("Invalid "+l+" `"+i+"` of type `"+u+"` supplied to `"+s+"`, 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 h(s,l,i,m,b(f));if(!f)return new p("Invalid "+l+" `"+i+"` key `"+m+"` supplied to `"+s+"`.\nBad object: "+JSON.stringify(o[a],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var x=f(c,m,s,l,i+"."+m,n);if(x)return x}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,s,l,c,d,m,f){if(c=c||u,m=m||l,f!==n){if(i){var x=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 x.name="Invariant Violation",x}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var h=c+":"+l;!t[h]&&r<3&&(a("You are manually calling a React.PropTypes validation function for the `"+m+"` prop on `"+c+"`. 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[h]=!0,r++)}}return null==s[l]?o?null===s[l]?new p("The "+d+" `"+m+"` is marked as required in `"+c+"`, but its value is `null`."):new p("The "+d+" `"+m+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(s,l,c,d,m)}var s=o.bind(null,!1);return s.isRequired=o.bind(null,!0),s}function x(e){return f((function(t,n,r,o,a,s){var l=t[n];return y(l)!==e?new p("Invalid "+o+" `"+a+"` of type `"+b(l)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function h(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||l(e))return!0;var t=function(e){var t=e&&(c&&e[c]||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 y(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=y(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function v(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},ve}function De(){if(ke)return Ce;ke=1;var e=Te();function t(){}function n(){}return n.resetWarningCache=t,Ce=function(){function r(t,n,r,o,a,s){if(s!==e){var l=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 l.name="Invariant Violation",l}}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 Oe(){if(we)return le.exports;if(we=1,"production"!==process.env.NODE_ENV){var e=Ee();le.exports=Le()(e.isElement,true)}else le.exports=De()();return le.exports}const Be=ae(Oe()),Fe=(e,n="0 0 24 24")=>({size:r=18,className:o=""})=>t.jsx("svg",{width:r,height:r,viewBox:n,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`rmx-icon ${o}`,children:"string"==typeof e?t.jsx("path",{d:e}):e}),Ae=(e,n="0 0 24 24")=>({size:r=18,className:o=""})=>t.jsx("svg",{width:r,height:r,viewBox:n,fill:"currentColor",className:`rmx-icon ${o}`,children:e}),Pe=Ae(t.jsx("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"})),_e=Fe(t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"19",y1:"4",x2:"10",y2:"4"}),t.jsx("line",{x1:"14",y1:"20",x2:"5",y2:"20"}),t.jsx("line",{x1:"15",y1:"4",x2:"9",y2:"20"})]})),Ie=Fe(t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M6 3v7a6 6 0 0 0 6 6 6 6 0 0 0 6-6V3"}),t.jsx("line",{x1:"4",y1:"21",x2:"20",y2:"21"})]})),ze=Fe(t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M16 4H9a3 3 0 0 0-3 3c0 2 1.5 3 4 3.5"}),t.jsx("path",{d:"M14 16.5c0 1.38-1.12 2.5-2.5 2.5H9"}),t.jsx("line",{x1:"4",y1:"12",x2:"20",y2:"12"})]})),$e=Ae(t.jsxs(t.Fragment,{children:[t.jsx("text",{x:"2",y:"16",fontSize:"16",fontWeight:"bold",fill:"currentColor",stroke:"none",children:"x"}),t.jsx("text",{x:"14",y:"20",fontSize:"10",fill:"currentColor",stroke:"none",children:"2"})]})),He=Ae(t.jsxs(t.Fragment,{children:[t.jsx("text",{x:"2",y:"18",fontSize:"16",fontWeight:"bold",fill:"currentColor",stroke:"none",children:"x"}),t.jsx("text",{x:"14",y:"10",fontSize:"10",fill:"currentColor",stroke:"none",children:"2"})]})),We=Ae(t.jsx(t.Fragment,{children:t.jsx("path",{d:"M6 4v16M18 4v16M6 12h12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})),qe=Fe(t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),t.jsx("line",{x1:"3",y1:"12",x2:"15",y2:"12"}),t.jsx("line",{x1:"3",y1:"18",x2:"18",y2:"18"})]})),Ve=Fe(t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),t.jsx("line",{x1:"6",y1:"12",x2:"18",y2:"12"}),t.jsx("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]})),Ue=Fe(t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),t.jsx("line",{x1:"9",y1:"12",x2:"21",y2:"12"}),t.jsx("line",{x1:"6",y1:"18",x2:"21",y2:"18"})]})),Ye=Fe(t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),t.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),t.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})),Xe=Fe(t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"10",y1:"6",x2:"21",y2:"6"}),t.jsx("line",{x1:"10",y1:"12",x2:"21",y2:"12"}),t.jsx("line",{x1:"10",y1:"18",x2:"21",y2:"18"}),t.jsx("text",{x:"4",y:"7.5",fontSize:"6",fill:"currentColor",stroke:"none",fontWeight:"bold",children:"1."}),t.jsx("text",{x:"4",y:"13.5",fontSize:"6",fill:"currentColor",stroke:"none",fontWeight:"bold",children:"2."}),t.jsx("text",{x:"4",y:"19.5",fontSize:"6",fill:"currentColor",stroke:"none",fontWeight:"bold",children:"3."})]})),Ge=Fe(t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"9",y1:"6",x2:"21",y2:"6"}),t.jsx("line",{x1:"9",y1:"12",x2:"21",y2:"12"}),t.jsx("line",{x1:"9",y1:"18",x2:"21",y2:"18"}),t.jsx("circle",{cx:"5",cy:"6",r:"1.5",fill:"currentColor",stroke:"none"}),t.jsx("circle",{cx:"5",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),t.jsx("circle",{cx:"5",cy:"18",r:"1.5",fill:"currentColor",stroke:"none"})]})),Ke=Fe(t.jsxs(t.Fragment,{children:[t.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),t.jsx("line",{x1:"13",y1:"6",x2:"21",y2:"6"}),t.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),t.jsx("line",{x1:"13",y1:"18",x2:"21",y2:"18"}),t.jsx("polyline",{points:"5.5 5.5 6.5 7 8.5 4",strokeWidth:"1.5"})]})),Je=Fe(t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),t.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})),Ze=Fe(t.jsxs(t.Fragment,{children:[t.jsx("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"}),t.jsx("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"}),t.jsx("line",{x1:"2",y1:"2",x2:"22",y2:"22"})]})),Qe=Fe(t.jsxs(t.Fragment,{children:[t.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),t.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),t.jsx("polyline",{points:"21 15 16 10 5 21"})]})),et=Fe(t.jsxs(t.Fragment,{children:[t.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),t.jsx("line",{x1:"3",y1:"9",x2:"21",y2:"9"}),t.jsx("line",{x1:"3",y1:"15",x2:"21",y2:"15"}),t.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"}),t.jsx("line",{x1:"15",y1:"3",x2:"15",y2:"21"})]})),tt=Ae(t.jsxs(t.Fragment,{children:[t.jsx("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"}),t.jsx("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"})]})),nt=Fe(t.jsxs(t.Fragment,{children:[t.jsx("polyline",{points:"16 18 22 12 16 6"}),t.jsx("polyline",{points:"8 6 2 12 8 18"})]})),rt=Fe(t.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12",strokeWidth:"3"})),ot=Fe(t.jsxs(t.Fragment,{children:[t.jsx("polyline",{points:"1 4 1 10 7 10"}),t.jsx("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]})),at=Fe(t.jsxs(t.Fragment,{children:[t.jsx("polyline",{points:"23 4 23 10 17 10"}),t.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})),st=Ae(t.jsx("text",{x:"3",y:"18",fontSize:"18",fontWeight:"bold",fill:"currentColor",stroke:"none",fontFamily:"serif",children:"T"})),lt=Ae(t.jsxs(t.Fragment,{children:[t.jsx("text",{x:"1",y:"20",fontSize:"20",fontWeight:"bold",fill:"currentColor",stroke:"none",children:"A"}),t.jsx("text",{x:"14",y:"20",fontSize:"12",fill:"currentColor",stroke:"none",children:"A"})]})),it=Fe(t.jsxs(t.Fragment,{children:[t.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),t.jsx("polygon",{points:"10 9 15 12 10 15",fill:"currentColor",stroke:"none"})]})),ct=Fe(t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"11",cy:"11",r:"8"}),t.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})),ut=Fe(t.jsxs(t.Fragment,{children:[t.jsx("polyline",{points:"16 18 22 12 16 6"}),t.jsx("polyline",{points:"8 6 2 12 8 18"}),t.jsx("line",{x1:"14",y1:"4",x2:"10",y2:"20",strokeWidth:"1"})]})),dt=Fe(t.jsxs(t.Fragment,{children:[t.jsx("polyline",{points:"15 3 21 3 21 9"}),t.jsx("polyline",{points:"9 21 3 21 3 15"}),t.jsx("line",{x1:"21",y1:"3",x2:"14",y2:"10"}),t.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]})),mt=Fe(t.jsxs(t.Fragment,{children:[t.jsx("polyline",{points:"4 14 10 14 10 20"}),t.jsx("polyline",{points:"20 10 14 10 14 4"}),t.jsx("line",{x1:"14",y1:"10",x2:"21",y2:"3"}),t.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]})),pt=Fe(t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"21",y1:"6",x2:"11",y2:"6"}),t.jsx("line",{x1:"21",y1:"12",x2:"11",y2:"12"}),t.jsx("line",{x1:"21",y1:"18",x2:"11",y2:"18"}),t.jsx("polyline",{points:"3 8 7 12 3 16"})]})),ft=Fe(t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"21",y1:"6",x2:"11",y2:"6"}),t.jsx("line",{x1:"21",y1:"12",x2:"11",y2:"12"}),t.jsx("line",{x1:"21",y1:"18",x2:"11",y2:"18"}),t.jsx("polyline",{points:"7 8 3 12 7 16"})]})),xt=Fe(t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),t.jsx("polyline",{points:"7 10 12 15 17 10"}),t.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})),ht=Fe(t.jsxs(t.Fragment,{children:[t.jsx("polyline",{points:"4 17 10 11 4 5"}),t.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})),gt=Ae(t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M3 5h18v14H3V5zm2 2v10h14V7H5z",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),t.jsx("path",{d:"M7 15V9l2.5 3L12 9v6",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M17 15l-2-2.5V15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M15 12.5V9",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})),yt=Fe(t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),t.jsx("polyline",{points:"14 2 14 8 20 8"}),t.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),t.jsx("polyline",{points:"9 15 12 12 15 15"})]})),bt=Fe(t.jsx(t.Fragment,{children:t.jsx("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"})})),vt=Fe(t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M6 4h12l-4 16"}),t.jsx("line",{x1:"2",y1:"21",x2:"22",y2:"3",strokeWidth:"2"})]})),jt=Fe(t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})),Ct=Fe(t.jsx("polyline",{points:"6 9 12 15 18 9"})),kt=Fe(t.jsx("polyline",{points:"9 6 15 12 9 18"})),wt=Fe(t.jsx("polyline",{points:"20 6 9 17 4 12"})),St=Fe(t.jsxs(t.Fragment,{children:[t.jsx("polyline",{points:"3 6 5 6 21 6"}),t.jsx("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"})]})),Et=Fe(t.jsxs(t.Fragment,{children:[t.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"3"}),t.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12",strokeWidth:"2"}),t.jsx("circle",{cx:"12",cy:"16",r:"1",fill:"currentColor",stroke:"none"})]})),Nt=Ae(t.jsxs(t.Fragment,{children:[t.jsx("text",{x:"2",y:"18",fontSize:"16",fontWeight:"bold",fill:"currentColor",stroke:"none",fontStyle:"italic",fontFamily:"serif",children:"f"}),t.jsx("text",{x:"10",y:"14",fontSize:"12",fill:"currentColor",stroke:"none",children:"(x)"})]})),Tt=Fe(t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"3",y1:"6",x2:"5",y2:"6",strokeWidth:"2"}),t.jsx("line",{x1:"8",y1:"6",x2:"18",y2:"6"}),t.jsx("line",{x1:"5",y1:"12",x2:"7",y2:"12",strokeWidth:"2"}),t.jsx("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),t.jsx("line",{x1:"5",y1:"18",x2:"7",y2:"18",strokeWidth:"2"}),t.jsx("line",{x1:"10",y1:"18",x2:"17",y2:"18"})]})),Mt=Fe(t.jsx("path",{d:"M6 2h12a1 1 0 0 1 1 1v18l-7-4-7 4V3a1 1 0 0 1 1-1z"})),Rt=Fe(t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M7 8l-4 4 4 4"}),t.jsx("path",{d:"M17 8l4 4-4 4"}),t.jsx("line",{x1:"14",y1:"4",x2:"10",y2:"20"})]})),Lt=Fe(t.jsxs(t.Fragment,{children:[t.jsx("text",{x:"2",y:"15",fontSize:"14",fontWeight:"bold",fill:"currentColor",stroke:"none",children:"ABC"}),t.jsx("polyline",{points:"16 18 18 20 22 14",strokeWidth:"2.5"})]})),Dt=Fe(t.jsxs(t.Fragment,{children:[t.jsx("rect",{x:"3",y:"14",width:"4",height:"7",rx:"1"}),t.jsx("rect",{x:"10",y:"9",width:"4",height:"12",rx:"1"}),t.jsx("rect",{x:"17",y:"4",width:"4",height:"17",rx:"1"})]})),Ot=Fe(t.jsx(t.Fragment,{children:t.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})),Bt=Fe(t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),t.jsx("circle",{cx:"9",cy:"7",r:"4"}),t.jsx("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),t.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})),Ft=Fe(t.jsxs(t.Fragment,{children:[t.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),t.jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]})),At=Fe(t.jsxs(t.Fragment,{children:[t.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),t.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"21"})]})),Pt={bold:Pe,italic:_e,underline:Ie,strikethrough:ze,subscript:$e,superscript:He,heading:We,headings:We,alignLeft:qe,alignCenter:Ve,alignRight:Ue,alignJustify:Ye,orderedList:Xe,unorderedList:Ge,taskList:Ke,link:Je,insertLink:Je,unlink:Ze,image:Qe,insertImage:Qe,table:et,insertTable:et,blockquote:tt,codeBlock:nt,horizontalRule:rt,undo:ot,redo:at,foreColor:({size:e=18,color:n="#000000",className:r=""})=>t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:`rmx-icon ${r}`,children:[t.jsx("text",{x:"6",y:"16",fontSize:"16",fontWeight:"bold",fill:"currentColor",stroke:"none",children:"A"}),t.jsx("rect",{x:"3",y:"20",width:"18",height:"3",rx:"1",fill:n})]}),backColor:({size:e=18,color:n="#ffff00",className:r=""})=>t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:`rmx-icon ${r}`,children:[t.jsx("rect",{x:"2",y:"2",width:"20",height:"16",rx:"2",fill:n,opacity:"0.3"}),t.jsx("text",{x:"6",y:"14",fontSize:"14",fontWeight:"bold",fill:"currentColor",stroke:"none",children:"A"}),t.jsx("rect",{x:"3",y:"20",width:"18",height:"3",rx:"1",fill:n})]}),fontFamily:st,fontSize:lt,embedMedia:it,findReplace:ct,sourceMode:ut,fullscreen:dt,exitFullscreen:mt,indent:pt,outdent:ft,removeFormat:vt,close:jt,chevronDown:Ct,check:wt,trash:St,attachment:bt,insertAttachment:bt,importDocument:yt,toggleMarkdown:gt,export:xt,commandPalette:ht,insertCallout:Et,callout:Et,insertMath:Nt,math:Nt,insertToc:Tt,toc:Tt,insertBookmark:Mt,bookmark:Mt,insertMergeTag:Rt,mergeTag:Rt,analytics:Dt,getAnalytics:Dt,toggleAnalytics:Dt,spellcheck:Lt,toggleSpellcheck:Lt,checkGrammar:Lt,addComment:Ot,comment:Ot,collaboration:Bt,startCollaboration:Bt,stopCollaboration:Bt,distractionFree:Ft,splitView:At,toggleSplitView:At};const _t=n.memo((function({text:e,shortcut:r,children:o}){const[a,s]=n.useState(!1),l=n.useRef(null),i=n.useCallback((()=>{l.current=setTimeout((()=>s(!0)),200)}),[]),c=n.useCallback((()=>{clearTimeout(l.current),s(!1)}),[]);if(!e)return o;const u=r?`${e} — ${r}`:e;return t.jsxs("span",{className:"rmx-tooltip-wrap",onMouseEnter:i,onMouseLeave:c,onFocus:i,onBlur:c,children:[o,a&&t.jsxs("span",{className:"rmx-tooltip",role:"tooltip","aria-hidden":"true",children:[t.jsx("span",{className:"rmx-tooltip-text",children:u}),t.jsx("span",{className:"rmx-tooltip-arrow"})]})]})})),It=n.memo((function({command:e,icon:r,tooltip:o,active:a,disabled:s,onClick:l,shortcutLabel:i,children:c,itemStyle:u}){const d=c?null:Pt[r||e],m=n.useCallback((e=>{e.preventDefault(),e.stopPropagation(),s||l?.()}),[s,l]),p=n.useCallback((e=>e.preventDefault()),[]);return t.jsx(_t,{text:o,shortcut:i,children:t.jsx("button",{className:`rmx-toolbar-btn ${a?"rmx-active":""} ${s?"rmx-disabled":""}`,style:u||void 0,onClick:m,onMouseDown:p,disabled:s,type:"button","aria-pressed":a,"aria-label":o,children:c||(d?t.jsx(d,{size:18}):e)})})}));It.propTypes={command:Be.string,icon:Be.string,tooltip:Be.string,active:Be.bool,disabled:Be.bool,onClick:Be.func,shortcutLabel:Be.string,children:Be.node,itemStyle:Be.object};const zt=n.memo((function({label:e,value:r,options:o,onChange:a,tooltip:s,icon:l,width:i=120,itemStyle:c}){const[u,d]=n.useState(!1),[m,p]=n.useState(-1),f=n.useRef(null),x=n.useRef(null);n.useEffect((()=>{if(!u)return;const e=e=>{f.current&&!f.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[u]),n.useEffect((()=>{if(u){const e=o.findIndex((e=>e.value===r));p(e>=0?e:0)}}),[u,o,r]);const h=o.find((e=>e.value===r)),g=h?.label||e,y=n.useCallback((e=>{e.preventDefault(),d((e=>!e))}),[]),b=n.useCallback((e=>e.preventDefault()),[]),v=n.useCallback((e=>{if(u)switch(e.key){case"ArrowDown":e.preventDefault(),p((e=>(e+1)%o.length));break;case"ArrowUp":e.preventDefault(),p((e=>(e-1+o.length)%o.length));break;case"Enter":case" ":e.preventDefault(),m>=0&&m<o.length&&(a(o[m].value),d(!1));break;case"Escape":e.preventDefault(),d(!1)}else"ArrowDown"!==e.key&&"ArrowUp"!==e.key&&"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),d(!0))}),[u,m,o,a]);n.useEffect((()=>{if(u&&x.current&&m>=0){const e=x.current.querySelectorAll('[role="option"]');e[m]&&e[m].scrollIntoView({block:"nearest"})}}),[u,m]);const j=u&&m>=0?`rmx-dd-opt-${o[m]?.value}`:void 0;return t.jsxs("div",{className:"rmx-toolbar-dropdown",ref:f,style:{minWidth:i,...c},children:[t.jsxs("button",{className:"rmx-toolbar-btn rmx-toolbar-dropdown-btn",onClick:y,onMouseDown:b,onKeyDown:v,title:s,"aria-label":s,type:"button","aria-haspopup":"listbox","aria-expanded":u,"aria-activedescendant":j,children:[l&&t.jsx(l,{size:16}),t.jsx("span",{className:"rmx-toolbar-dropdown-label",children:g}),t.jsx(Ct,{size:14})]}),u&&t.jsx("div",{className:"rmx-toolbar-dropdown-menu",role:"listbox",ref:x,children:o.map(((e,n)=>t.jsx("button",{id:`rmx-dd-opt-${e.value}`,className:`rmx-toolbar-dropdown-item ${e.value===r?"rmx-active":""} ${n===m?"rmx-focused":""}`,onClick:t=>{t.preventDefault(),a(e.value),d(!1)},onMouseDown:b,onMouseEnter:()=>p(n),role:"option","aria-selected":e.value===r,type:"button",style:e.style,children:e.label},e.value)))})]})}));zt.propTypes={label:Be.string,value:Be.string,options:Be.arrayOf(Be.shape({value:Be.string.isRequired,label:Be.string.isRequired,style:Be.object})).isRequired,onChange:Be.func.isRequired,tooltip:Be.string,icon:Be.elementType,width:Be.number,itemStyle:Be.object};const $t={"#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"},Ht=n.memo((function({command:r,tooltip:o,currentColor:a,onColorSelect:s,itemStyle:l,engine:i}){const[c,u]=n.useState(!1),[d,m]=n.useState(-1),p=n.useRef(null),f=n.useRef([]);n.useEffect((()=>{if(!c)return;const e=e=>{p.current&&!p.current.contains(e.target)&&u(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[c]),n.useEffect((()=>{if(!c)return;const e=e=>{"Escape"===e.key&&(e.preventDefault(),u(!1))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[c]),n.useEffect((()=>{if(c){const t=e.DEFAULT_COLORS.findIndex((e=>e===a));m(t>=0?t:0)}}),[c,a]),n.useEffect((()=>{c&&d>=0&&f.current[d]&&f.current[d].focus()}),[c,d]);const x=Pt[r],h=n.useCallback((e=>{e.preventDefault(),u((e=>!e))}),[]),g=n.useCallback((e=>e.preventDefault()),[]),y=n.useCallback(((t,n)=>{const r=e.DEFAULT_COLORS.length;let o=n;switch(t.key){case"ArrowRight":t.preventDefault(),o=(n+1)%r;break;case"ArrowLeft":t.preventDefault(),o=(n-1+r)%r;break;case"ArrowDown":t.preventDefault(),o=n+10<r?n+10:n;break;case"ArrowUp":t.preventDefault(),o=n-10>=0?n-10:n;break;case"Enter":case" ":return t.preventDefault(),s(e.DEFAULT_COLORS[n]),void u(!1);case"Escape":return t.preventDefault(),void u(!1);default:return}m(o)}),[s]),b=n.useCallback((e=>{e.preventDefault(),s(""),u(!1)}),[s]);return t.jsxs("div",{className:"rmx-toolbar-colorpicker",ref:p,style:l||void 0,children:[t.jsx("button",{className:"rmx-toolbar-btn",onClick:h,onMouseDown:g,title:o,"aria-label":o,type:"button","aria-haspopup":"true","aria-expanded":c,children:x&&t.jsx(x,{size:18,color:a||("foreColor"===r?"#000000":"#ffff00")})}),c&&t.jsxs("div",{className:"rmx-color-palette",children:[t.jsx("button",{type:"button",className:"rmx-color-default-btn",onClick:b,onMouseDown:g,children:"Default"}),t.jsx("div",{className:"rmx-color-grid",role:"grid",children:e.DEFAULT_COLORS.map(((e,n)=>t.jsx("button",{ref:e=>{f.current[n]=e},className:"rmx-color-swatch "+(e===a?"rmx-active":""),style:{backgroundColor:e},onClick:t=>{t.preventDefault(),s(e),u(!1)},onMouseDown:g,onKeyDown:e=>y(e,n),title:$t[e.toLowerCase()]||e,type:"button",tabIndex:n===d?0:-1,"aria-label":`Color ${$t[e.toLowerCase()]||e}`},e)))}),t.jsx("div",{className:"rmx-color-custom",children:t.jsxs("label",{children:["Custom:",t.jsx("input",{type:"color",value:a||"#000000",onChange:e=>{s(e.target.value),u(!1)},onMouseDown:e=>e.stopPropagation()})]})}),t.jsx(Wt,{engine:i,onColorSelect:s})]})]})}));function Wt({engine:r,onColorSelect:o}){const[a,s]=n.useState((()=>e.loadColorPresets())),[l,i]=n.useState(!1),[c,u]=n.useState("");n.useEffect((()=>{if(!r)return;const e=r.eventBus?.on("colorPresets:change",(({presets:e})=>s(e)));return e}),[r]);const d=()=>{c.trim()&&(e.saveColorPreset(c.trim(),[...e.DEFAULT_COLORS]),s(e.loadColorPresets()),u(""),i(!1))};return 0!==a.length||l?t.jsxs("div",{className:"rmx-color-presets",children:[a.map((e=>t.jsxs("div",{className:"rmx-color-preset-row",children:[t.jsx("span",{className:"rmx-color-preset-name",children:e.name}),t.jsx("div",{className:"rmx-color-preset-swatches",children:e.colors.slice(0,6).map(((e,n)=>t.jsx("button",{type:"button",className:"rmx-color-preset-swatch",style:{backgroundColor:e},onClick:()=>o(e),title:$t[e.toLowerCase()]||e},n)))})]},e.name))),l?t.jsxs("div",{className:"rmx-color-preset-save-form",children:[t.jsx("input",{type:"text",value:c,onChange:e=>u(e.target.value),placeholder:"Preset name...",className:"rmx-color-preset-save-input",onKeyDown:e=>"Enter"===e.key&&d(),onMouseDown:e=>e.stopPropagation()}),t.jsx("button",{type:"button",onClick:d,className:"rmx-color-preset-save-confirm",children:"Save"})]}):t.jsx("button",{type:"button",onClick:()=>i(!0),className:"rmx-color-preset-save-btn",style:{marginTop:2},children:"+ Save Preset"})]}):t.jsx("div",{className:"rmx-color-presets",children:t.jsx("button",{type:"button",onClick:()=>i(!0),className:"rmx-color-preset-save-btn",children:"+ Save Preset"})})}Ht.propTypes={command:Be.string.isRequired,tooltip:Be.string,currentColor:Be.string,onColorSelect:Be.func.isRequired,itemStyle:Be.object,engine:Be.object};const qt=n.memo((function({separatorStyle:e}){return t.jsx("div",{className:"rmx-toolbar-separator",role:"separator",style:e||void 0})}));qt.propTypes={separatorStyle:Be.object};const Vt=["1","1.15","1.5","1.7","2","2.5","3"],Ut=["-0.5px","0","0.5px","1px","1.5px","2px","3px","5px"],Yt=["0","4px","8px","12px","16px","24px","32px"],Xt=n.memo((function({engine:e,itemStyle:r}){const[o,a]=n.useState(!1),s=n.useRef(null);n.useEffect((()=>{if(!o)return;const e=e=>{s.current&&!s.current.contains(e.target)&&a(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[o]);const l=n.useCallback((e=>{e.preventDefault(),a((e=>!e))}),[]),i=n.useCallback((e=>e.preventDefault()),[]),c=n.useCallback((t=>{e?.executeCommand("lineHeight",t.target.value)}),[e]),u=n.useCallback((t=>{e?.executeCommand("letterSpacing",t.target.value)}),[e]),d=n.useCallback((t=>{e?.executeCommand("paragraphSpacing",t.target.value)}),[e]);return t.jsxs("div",{className:"rmx-typography-dropdown",ref:s,style:r||void 0,children:[t.jsx("button",{className:"rmx-toolbar-btn",onClick:l,onMouseDown:i,title:"Typography",type:"button","aria-haspopup":"true","aria-expanded":o,children:t.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M3 4h12M5 4v10M13 4v10M7 14h-4M15 14h-4M6 9h6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),o&&t.jsxs("div",{className:"rmx-typography-menu",onMouseDown:i,children:[t.jsxs("div",{className:"rmx-typography-row",children:[t.jsx("label",{children:"Line Height"}),t.jsxs("select",{onChange:c,defaultValue:"",children:[t.jsx("option",{value:"",disabled:!0,children:"Select..."}),Vt.map((e=>t.jsx("option",{value:e,children:e},e)))]})]}),t.jsxs("div",{className:"rmx-typography-row",children:[t.jsx("label",{children:"Letter Spacing"}),t.jsxs("select",{onChange:u,defaultValue:"",children:[t.jsx("option",{value:"",disabled:!0,children:"Select..."}),Ut.map((e=>t.jsx("option",{value:e,children:e},e)))]})]}),t.jsxs("div",{className:"rmx-typography-row",children:[t.jsx("label",{children:"Paragraph Spacing"}),t.jsxs("select",{onChange:d,defaultValue:"",children:[t.jsx("option",{value:"",disabled:!0,children:"Select..."}),Yt.map((e=>t.jsx("option",{value:e,children:e},e)))]})]})]})]})})),Gt=e.HEADING_OPTIONS.map((e=>({...e,style:"p"!==e.tag?{fontSize:22-2*(parseInt(e.tag?.[1])||0)+"px",fontWeight:"bold"}:{}}))),Kt=n.memo((function({config:r,engine:o,onOpenModal:a,fonts:s=e.DEFAULT_FONTS,wordCountButton:l,toolbarItemTheme:i,customizableToolbar:c,onToolbarChange:u}){const d=oe(),m=r||e.DEFAULT_TOOLBAR,p=n.useRef(null),f=n.useRef(null),[x,h]=n.useState(-1),[g,y]=n.useState(!1),b=n.useRef(null),[v,j]=n.useState(null),[C,k]=n.useState(null),[w,S]=n.useState((()=>{if(!c)return null;try{const e=localStorage.getItem("rmx-toolbar-order");return e?JSON.parse(e):null}catch{return null}})),E=n.useMemo((()=>s.map((e=>({label:e,value:e,style:{fontFamily:e}})))),[s]),N=n.useCallback((e=>{o?.executeCommand("heading","p"===e?"p":e.replace("h",""))}),[o]),T=n.useCallback((e=>{o?.executeCommand("fontFamily",e)}),[o]),M=n.useCallback((e=>{o?.executeCommand("fontSize",e)}),[o]),R=n.useCallback((e=>{o?.executeCommand("foreColor",e)}),[o]),L=n.useCallback((e=>{o?.executeCommand("backColor",e)}),[o]),D=n.useCallback((()=>a?.("image")),[a]),O=n.useCallback((()=>a?.("attachment")),[a]),B=n.useCallback((()=>a?.("importDocument")),[a]),F=n.useCallback((()=>a?.("table")),[a]),A=n.useCallback((()=>a?.("embed")),[a]),P=n.useCallback((()=>a?.("findReplace")),[a]),_=n.useCallback((()=>a?.("export")),[a]),I=n.useCallback((()=>a?.("commandPalette")),[a]),z=n.useMemo((()=>{const e=[];return m.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}),[m]);n.useEffect((()=>{const e=p.current,t=f.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}}h(o)},r=new ResizeObserver(n);return r.observe(e),n(),()=>r.disconnect()}),[z]),n.useEffect((()=>{if(!g)return;const e=e=>{b.current&&!b.current.contains(e.target)&&y(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)}),[g]),n.useEffect((()=>{if(!g||!b.current)return;const e=b.current.querySelector("button:not([disabled])");e&&e.focus()}),[g]);const $=n.useCallback((e=>{if(!b.current)return;const t=Array.from(b.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(),y(!1)}}),[]),H=n.useMemo((()=>{if(!c||!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,c]),W=n.useCallback(((e,t)=>{c&&(j(t.key),e.dataTransfer.effectAllowed="move")}),[c]),q=n.useCallback(((e,t)=>{c&&v&&(e.preventDefault(),e.dataTransfer.dropEffect="move",k(t.key))}),[c,v]),V=n.useCallback(((e,t)=>{if(!c||!v)return;e.preventDefault();const n=H.map((e=>e.key)),r=n.indexOf(v),o=n.indexOf(t.key);if(r<0||o<0||r===o)return;const a=[...n],[s]=a.splice(r,1);a.splice(o,0,s),S(a);try{localStorage.setItem("rmx-toolbar-order",JSON.stringify(a))}catch{}u?.(a),j(null),k(null)}),[c,v,H,u]),U=n.useCallback((()=>{j(null),k(null)}),[]);if(!o)return t.jsx("div",{className:"rmx-toolbar",role:"toolbar","aria-label":"Editor toolbar",style:{minHeight:44},children:t.jsx("div",{className:"rmx-toolbar-inner"})});const Y=n=>{if("separator"===n.type)return t.jsx(qt,{separatorStyle:i?._separator},n.key);const{command:r}=n,s=i?.[r]||null;if("headings"===r){const e=d.heading||"p";return t.jsx(zt,{label:"Normal",value:e,options:Gt,onChange:N,tooltip:"Block Type",width:130,itemStyle:s},r)}if("fontFamily"===r){const e=d.fontFamily?.replace(/['"]/g,"")||"";return t.jsx(zt,{label:"Font",value:e,options:E,onChange:T,tooltip:"Font Family",width:140,itemStyle:s},r)}if("fontSize"===r)return t.jsx(zt,{label:"Size",value:d.fontSize||"",options:e.DEFAULT_FONT_SIZES,onChange:M,tooltip:"Font Size",width:80,itemStyle:s},r);if("foreColor"===r)return t.jsx(Ht,{command:"foreColor",tooltip:"Text Color",currentColor:d.foreColor,onColorSelect:R,itemStyle:s,engine:o},r);if("backColor"===r)return t.jsx(Ht,{command:"backColor",tooltip:"Background Color",currentColor:d.backColor,onColorSelect:L,itemStyle:s,engine:o},r);if("typography"===r)return t.jsx(Xt,{engine:o,itemStyle:s},r);if("link"===r)return t.jsx(It,{command:r,tooltip:e.TOOLTIP_MAP[r],active:!!d.link,onClick:()=>{d.link?a?.("link",d.link):a?.("link",{text:o.selection.getSelectedText()})},shortcutLabel:e.getShortcutLabel("insertLink"),itemStyle:s},r);if("image"===r)return t.jsx(It,{command:r,tooltip:e.TOOLTIP_MAP[r],onClick:D,itemStyle:s},r);if("attachment"===r)return t.jsx(It,{command:r,tooltip:e.TOOLTIP_MAP[r],onClick:O,itemStyle:s},r);if("importDocument"===r)return t.jsx(It,{command:r,tooltip:e.TOOLTIP_MAP[r],onClick:B,itemStyle:s},r);if("table"===r)return t.jsx(It,{command:r,tooltip:e.TOOLTIP_MAP[r],onClick:F,itemStyle:s},r);if("embedMedia"===r)return t.jsx(It,{command:r,tooltip:e.TOOLTIP_MAP[r],onClick:A,itemStyle:s},r);if("findReplace"===r)return t.jsx(It,{command:r,tooltip:e.TOOLTIP_MAP[r],onClick:P,shortcutLabel:e.getShortcutLabel(r),itemStyle:s},r);if("export"===r)return t.jsx(It,{command:r,tooltip:e.TOOLTIP_MAP[r],onClick:_,itemStyle:s},r);if("commandPalette"===r)return t.jsx(It,{command:r,tooltip:e.TOOLTIP_MAP[r],onClick:I,shortcutLabel:e.getShortcutLabel(r),itemStyle:s},r);if(e.BUTTON_COMMANDS.has(r)){const n=e.getCommandActiveState(r,d,o),a=o.commands?.has?.(r)??!0;return t.jsx(It,{command:r,tooltip:e.TOOLTIP_MAP[r]||r,active:n,disabled:!a,onClick:()=>{a&&o.executeCommand(r)},shortcutLabel:e.getShortcutLabel(r),itemStyle:s},r)}const l=o.commands?.has?.(r)??!0;return t.jsx(It,{command:r,tooltip:e.TOOLTIP_MAP[r]||r,disabled:!l,onClick:()=>{l&&o.executeCommand(r)},itemStyle:s},r)},X=c?H:z,G=x>0?X.slice(0,x):X,K=x>0?X.slice(x):[];return t.jsx("div",{className:"rmx-toolbar"+(c?" rmx-toolbar-customizable":""),role:"toolbar","aria-label":"Editor toolbar",ref:p,children:t.jsxs("div",{className:"rmx-toolbar-inner",ref:f,children:[G.map(c?e=>{const n=Y(e);return c&&"separator"!==e.type?t.jsx("span",{draggable:!0,onDragStart:t=>W(t,e),onDragOver:t=>q(t,e),onDrop:t=>V(t,e),onDragEnd:U,className:`${v===e.key?"rmx-dragging":""} ${C===e.key?"rmx-toolbar-drag-over":""}`,role:"listitem","aria-roledescription":"draggable toolbar item",children:n},`drag-${e.key}`):n}:Y),K.length>0&&t.jsxs("div",{className:"rmx-toolbar-overflow-container",style:{position:"relative"},children:[t.jsx("button",{className:"rmx-toolbar-btn rmx-toolbar-overflow-btn",onClick:()=>y((e=>!e)),"aria-label":"More toolbar options","aria-expanded":g,type:"button",children:"⋯"}),g&&t.jsx("div",{ref:b,className:"rmx-toolbar-overflow-menu",role:"menu",onKeyDown:$,children:K.map(Y)})]}),l&&t.jsxs(t.Fragment,{children:[t.jsx(qt,{}),l]})]})})})),Jt=n.forwardRef((function({style:e,readOnly:n,className:r="",id:o},a){return t.jsxs("div",{className:`rmx-edit-area ${r}`,id:o,children:[t.jsx("div",{ref:a,className:"rmx-content",style:e,suppressContentEditableWarning:!0}),n&&t.jsx("div",{className:"rmx-readonly-overlay"})]})}));Jt.propTypes={style:Be.object,readOnly:Be.bool,className:Be.string,id:Be.string};const Zt=["bold","italic","underline","strikethrough","link"];const Qt=n.memo((function({visible:e,selectionRect:r,engine:o,editorRect:a,onOpenModal:s,onDismiss:l}){const i=oe(),c=n.useRef(null),u=n.useRef({width:0,height:0}),[d,m]=n.useState({top:0,left:0}),[p,f]=n.useState(!1),[x,h]=n.useState(!1),[g,y]=n.useState({x:0,y:0}),b=n.useRef(null),v=n.useRef(!1),[j,C]=n.useState(!1),k=n.useRef(null);n.useEffect((()=>{if(!o?.element)return;const e=o.element,t=()=>{k.current&&clearTimeout(k.current),k.current=setTimeout((()=>{const e=window.getSelection();e&&!e.isCollapsed&&e.rangeCount>0?C(!0):C(!1)}),300)},n=o.eventBus.on("selection:change",(()=>{const e=window.getSelection();e&&!e.isCollapsed||C(!1)}));return e.addEventListener("touchend",t,{passive:!0}),()=>{e.removeEventListener("touchend",t),n(),k.current&&clearTimeout(k.current)}}),[o]),n.useEffect((()=>{if(!c.current)return;const e=new ResizeObserver((([e])=>{u.current={width:e.contentRect.width,height:e.contentRect.height}}));return e.observe(c.current),()=>e.disconnect()}),[]),n.useEffect((()=>{if(!e&&!j||!r||!a)return;const t=u.current.height||c.current?.offsetHeight||40,n=u.current.width||c.current?.offsetWidth||200;let o=r.top-a.top-t-8,s=r.left-a.left+r.width/2-n/2,l=!1;o<0&&(o=r.bottom-a.top+8,l=!0),s<0&&(s=4),s+n>a.width&&(s=a.width-n-4),m({top:o,left:s}),h(l),y({x:0,y:0})}),[e,j,r,a]);const w=n.useCallback((e=>{const t=c.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()}),[]),S=n.useCallback((()=>f(!0)),[]),E=n.useCallback((()=>f(!1)),[]),N=n.useCallback((e=>e.preventDefault()),[]),T=n.useCallback((e=>{e.preventDefault(),e.stopPropagation(),v.current=!0,b.current={x:e.clientX,y:e.clientY,offsetX:g.x,offsetY:g.y};const t=e.currentTarget;t.setPointerCapture(e.pointerId);const n=e=>{if(!v.current||!b.current)return;const t=e.clientX-b.current.x,n=e.clientY-b.current.y;y({x:b.current.offsetX+t,y:b.current.offsetY+n})},r=()=>{v.current=!1,b.current=null,t.removeEventListener("pointermove",n),t.removeEventListener("pointerup",r)};t.addEventListener("pointermove",n),t.addEventListener("pointerup",r)}),[g]);return(e||j||p)&&o?t.jsxs("div",{ref:c,className:"rmx-floating-toolbar rmx-floating-toolbar-touch "+(x?"rmx-floating-below":""),style:{top:d.top+g.y,left:d.left+g.x},role:"toolbar","aria-label":"Formatting toolbar",onPointerDown:N,onKeyDown:w,onFocus:S,onBlur:E,children:[Zt.map(((e,n)=>{if("link"===e)return t.jsx(It,{command:e,tooltip:"Insert Link",active:!!i.link,onClick:()=>s?.("link",{text:o.selection.getSelectedText()})},e);const r=i[e]||!1;return t.jsx(It,{command:e,tooltip:e.charAt(0).toUpperCase()+e.slice(1),active:r,onClick:()=>o.executeCommand(e)},e)})),t.jsx("div",{className:"rmx-floating-toolbar-grip",onPointerDown:T,"aria-label":"Drag to reposition toolbar",role:"separator",children:t.jsxs("svg",{width:"20",height:"6",viewBox:"0 0 20 6",fill:"currentColor","aria-hidden":"true",children:[t.jsx("rect",{x:"2",y:"0",width:"16",height:"2",rx:"1",opacity:"0.4"}),t.jsx("rect",{x:"2",y:"4",width:"16",height:"2",rx:"1",opacity:"0.4"})]})})]}):null}));function en({image:e,engine:r,editorRect:o}){const[a,s]=n.useState(!1),[l,i]=n.useState(null),[c,u]=n.useState(null),[d,m]=n.useState(!1),[p,f]=n.useState(""),x=n.useRef(null);if(n.useEffect((()=>{e&&(f(e.getAttribute("alt")||""),m(!1))}),[e]),n.useEffect((()=>{d&&x.current&&x.current.focus()}),[d]),!e||!o)return null;const h=e.getBoundingClientRect(),g=h.top-o.top,y=h.left-o.left,b=n.useCallback(((t,n)=>{t.preventDefault(),t.stopPropagation(),t.target.setPointerCapture(t.pointerId),s(!0),i({x:t.clientX,y:t.clientY}),u({width:e.offsetWidth,height:e.offsetHeight})}),[e]);n.useEffect((()=>{if(!a)return;const t=t=>{if(!l||!c)return;const n=t.clientX-l.x,r=c.width>0?c.height/c.width:1,o=Math.max(50,c.width+n),a=o*r;e.style.width=`${o}px`,e.style.height=`${a}px`},n=()=>{s(!1),r?.eventBus.emit("content:change")};return document.addEventListener("pointermove",t),document.addEventListener("pointerup",n),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n)}}),[a,l,c,e,r]);const v=n.useCallback((()=>{e&&(e.setAttribute("alt",p),r?.eventBus.emit("content:change")),m(!1)}),[e,p,r]),j=n.useCallback((t=>{"Enter"===t.key?(t.preventDefault(),v()):"Escape"===t.key&&(m(!1),f(e?.getAttribute("alt")||""))}),[v,e]);return t.jsxs("div",{className:"rmx-image-handles",style:{position:"absolute",top:g,left:y,width:h.width,height:h.height,pointerEvents:"none"},children:[t.jsx("div",{className:"rmx-image-handle rmx-handle-border"}),["nw","ne","sw","se"].map((e=>t.jsx("div",{className:`rmx-image-handle rmx-handle-${e}`,style:{pointerEvents:"all",touchAction:"none"},onPointerDown:t=>b(t,e)},e))),t.jsx("div",{className:"rmx-image-alt-overlay",style:{pointerEvents:"all"},onMouseDown:e=>e.stopPropagation(),children:d?t.jsx("input",{ref:x,className:"rmx-image-alt-input",type:"text",value:p,onChange:e=>f(e.target.value),onBlur:v,onKeyDown:j,placeholder:"Enter alt text..."}):t.jsx("button",{className:"rmx-image-alt-label",onClick:()=>m(!0),type:"button",title:"Edit alt text",children:p?`Alt: ${p}`:"Add alt text"})})]})}function tn({table:e,engine:r,editorRect:o}){if(!e||!r||!o)return null;const a=e.getBoundingClientRect(),s=a.top-o.top,l=a.left-o.left,i=n.useCallback((()=>{window.confirm("Are you sure you want to delete this table? This cannot be undone.")&&r.executeCommand("deleteTable")}),[r]);return t.jsxs("div",{className:"rmx-table-controls",style:{position:"absolute",top:s-28,left:l},onMouseDown:e=>e.preventDefault(),children:[t.jsx("button",{className:"rmx-table-control-btn",onClick:()=>r.executeCommand("addRowBefore"),"aria-label":"Add row above",title:"Add row above",type:"button",children:"+Row"}),t.jsx("button",{className:"rmx-table-control-btn",onClick:()=>r.executeCommand("addRowAfter"),"aria-label":"Add row below",title:"Add row below",type:"button",children:"Row+"}),t.jsx("button",{className:"rmx-table-control-btn",onClick:()=>r.executeCommand("addColBefore"),"aria-label":"Add column before",title:"Add column before",type:"button",children:"+Col"}),t.jsx("button",{className:"rmx-table-control-btn",onClick:()=>r.executeCommand("addColAfter"),"aria-label":"Add column after",title:"Add column after",type:"button",children:"Col+"}),t.jsx("button",{className:"rmx-table-control-btn rmx-danger",onClick:i,"aria-label":"Delete table",title:"Delete table",type:"button",children:"Delete"})]})}Qt.propTypes={visible:Be.bool.isRequired,selectionRect:Be.object,engine:Be.object,editorRect:Be.object,onOpenModal:Be.func,onDismiss:Be.func};const nn=[{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 rn({codeBlock:e,engine:r,editorRect:o}){if(!e||!r||!o)return null;const a=e.querySelector("code"),s=a?.getAttribute("data-language")||"",[l,i]=n.useState(!1),[c,u]=n.useState(""),d=n.useRef(null),m=n.useRef(null);n.useEffect((()=>{if(!l)return;const e=e=>{d.current&&!d.current.contains(e.target)&&(i(!1),u(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[l,e]),n.useEffect((()=>{i(!1),u("")}),[e]),n.useEffect((()=>{l&&m.current&&m.current.focus()}),[l]);const p=n.useCallback((e=>{r.executeCommand("setCodeLanguage",{language:e}),i(!1),u("")}),[r]),f=r?._syntaxHighlight?.SUPPORTED_LANGUAGES||nn,x=f.filter((e=>e.label.toLowerCase().includes(c.toLowerCase())||e.id.toLowerCase().includes(c.toLowerCase()))),h=e.getBoundingClientRect(),g=h.top-o.top,y=o.right-h.right,b=f.find((e=>e.id===s))?.label||s||"Auto";return t.jsxs("div",{ref:d,className:"rmx-codeblock-controls",style:{position:"absolute",top:g+4,right:y+4,zIndex:10},onMouseDown:e=>e.preventDefault(),children:[t.jsx("button",{className:"rmx-codeblock-lang-btn",onClick:()=>i(!l),type:"button",title:"Change language",children:b}),l&&t.jsxs("div",{className:"rmx-codeblock-lang-dropdown",children:[t.jsx("input",{ref:m,className:"rmx-codeblock-lang-search",type:"text",placeholder:"Search languages...",value:c,onChange:e=>u(e.target.value),onKeyDown:e=>{"Escape"===e.key?(i(!1),u("")):"Enter"===e.key&&x.length>0&&p(x[0].id)}}),t.jsxs("ul",{className:"rmx-codeblock-lang-list",children:[x.map((e=>t.jsx("li",{children:t.jsx("button",{className:"rmx-codeblock-lang-option "+(e.id===s?"rmx-active":""),onClick:()=>p(e.id),type:"button",children:e.label})},e.id))),0===x.length&&t.jsx("li",{className:"rmx-codeblock-lang-empty",children:"No languages found"})]})]})]})}function on({visible:e,fileTypes:n}){if(!e)return null;const r=n.includes("Files")||n.some((e=>e.startsWith("image/"))),o=r?"Drop files here":"Drop content here",a=r?"Images, documents, and rich text":"Rich text and HTML content";return t.jsxs("div",{className:"rmx-drop-zone-overlay","aria-hidden":"true",children:[t.jsxs("svg",{className:"rmx-drop-zone-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),t.jsx("polyline",{points:"7 10 12 15 17 10"}),t.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),t.jsx("span",{className:"rmx-drop-zone-text",children:o}),t.jsx("span",{className:"rmx-drop-zone-hint",children:a})]})}function an({engine:e,editorRect:r,editAreaRef:o}){const[a,s]=n.useState(null),[l,i]=n.useState(null),[c,u]=n.useState(!1),[d,m]=n.useState(null),[p,f]=n.useState(null),x=n.useRef(null),h=n.useRef(null),g=n.useRef(null),y=n.useRef(null),b=n.useRef(null),v=n.useCallback((t=>{if(!e||!o.current)return;if(e.dragDrop.isDragging())return void s(null);const n=t.target,r=e.dragDrop.getDraggableBlock(n);if(r&&r!==a){s(r);const t=r.getBoundingClientRect(),n=e.element,o=n.getBoundingClientRect();i({top:t.top-o.top+n.scrollTop+2,left:-24})}else r||s(null)}),[e,o,a]);n.useEffect((()=>{if(!e)return;const t=e.element,n=e=>{h.current&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame((()=>v(e)))},r=()=>{s(null)};return t.addEventListener("pointermove",n),t.addEventListener("pointerleave",r),()=>{t.removeEventListener("pointermove",n),t.removeEventListener("pointerleave",r),h.current&&cancelAnimationFrame(h.current)}}),[e,v]),n.useEffect((()=>{if(e&&a)return e.dragDrop.makeBlockDraggable(a),()=>{e.dragDrop.unmakeBlockDraggable(a)}}),[e,a]);const j=n.useCallback((t=>{if(!a||!e)return;if(!("touch"===t.pointerType||"pen"===t.pointerType))return;t.preventDefault();const n=x.current;if(!n)return;n.setPointerCapture(t.pointerId),u(!0),g.current=a;const r=a.getBoundingClientRect();m({x:t.clientX,y:t.clientY,width:r.width,text:a.textContent?.slice(0,50)||"Block"}),a.style.opacity="0.4";const o=t=>{m((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===g.current)continue;const n=e.getBoundingClientRect(),r=n.top+n.height/2,s=Math.abs(t.clientY-r);s<a&&(a=s,o=e)}if(o){const e=o.getBoundingClientRect(),r=n.getBoundingClientRect(),a=t.clientY<e.top+e.height/2,s=a?e.top-r.top+n.scrollTop:e.bottom-r.top+n.scrollTop;f({top:s,left:12,width:r.width-24}),b.current={block:o,insertBefore:a}}else f(null),b.current=null},s=()=>{if(n.removeEventListener("pointermove",o),n.removeEventListener("pointerup",s),u(!1),m(null),f(null),g.current&&(g.current.style.opacity=""),b.current&&g.current){const{block:e,insertBefore:t}=b.current;e.parentNode&&(t?e.parentNode.insertBefore(g.current,e):e.parentNode.insertBefore(g.current,e.nextSibling))}g.current=null,b.current=null};n.addEventListener("pointermove",o),n.addEventListener("pointerup",s)}),[a,e]);return a&&l?t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:x,className:"rmx-block-drag-handle rmx-block-drag-handle-touch rmx-visible",style:{top:l.top,left:l.left,touchAction:"none"},title:"Drag to reorder","aria-label":"Drag to reorder block",role:"button",onPointerDown:j,children:t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"currentColor",children:[t.jsx("circle",{cx:"4",cy:"3",r:"1.2"}),t.jsx("circle",{cx:"10",cy:"3",r:"1.2"}),t.jsx("circle",{cx:"4",cy:"7",r:"1.2"}),t.jsx("circle",{cx:"10",cy:"7",r:"1.2"}),t.jsx("circle",{cx:"4",cy:"11",r:"1.2"}),t.jsx("circle",{cx:"10",cy:"11",r:"1.2"})]})}),c&&p&&t.jsx("div",{className:"rmx-touch-drop-indicator",style:{position:"absolute",top:p.top,left:p.left,width:p.width,height:2,background:"var(--rmx-primary, #6366f1)",borderRadius:1,pointerEvents:"none",zIndex:50}}),c&&d&&t.jsx("div",{ref:y,className:"rmx-drag-ghost",style:{position:"fixed",left:d.x-20,top:d.y-20,width:Math.min(d.width,300),pointerEvents:"none",zIndex:1e4},children:d.text})]}):null}const sn={saved:"Saved",saving:"Saving…",unsaved:"Unsaved changes",error:"Save failed"};const ln=n.memo((function({saveStatus:e}){const n=sn[e]||"",r=`rmx-save-status rmx-save-status--${e}`;return t.jsxs("span",{className:r,role:"status","aria-live":"polite",children:[t.jsx("span",{className:"rmx-save-status-dot","aria-hidden":"true"}),t.jsx("span",{className:"rmx-save-status-label",children:n})]})}));ln.propTypes={saveStatus:Be.oneOf(["saved","saving","unsaved","error"]).isRequired};const cn=n.memo((function({engine:e,position:r="bottom",saveStatus:o,showSaveStatus:a}){const[s,l]=n.useState({wordCount:0,charCount:0}),[i,c]=n.useState(!1),u=n.useCallback((e=>{l((t=>t.wordCount===e.wordCount&&t.charCount===e.charCount?t:e))}),[]);n.useEffect((()=>{if(!e)return;e._wordCount&&u(e._wordCount);return e.eventBus.on("wordcount:update",u)}),[e,u]),n.useEffect((()=>{if(!e)return;const t=()=>c(!1),n=[e.eventBus.on("content:change",(()=>c(!0))),e.eventBus.on("autosave:saved",t),e.eventBus.on("save",t)];return()=>n.forEach((e=>e()))}),[e]);const d="rmx-statusbar"+("top"===r?" rmx-statusbar-top":""),m=i&&!a;return t.jsxs("div",{className:d,children:[a&&t.jsxs(t.Fragment,{children:[t.jsx(ln,{saveStatus:o}),t.jsx("span",{className:"rmx-statusbar-sep","aria-hidden":"true"})]}),m&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"rmx-statusbar-dirty",role:"status","aria-live":"polite",children:[t.jsx("span",{className:"rmx-statusbar-dirty-dot","aria-hidden":"true"}),"Edited"]}),t.jsx("span",{className:"rmx-statusbar-sep","aria-hidden":"true"})]}),t.jsxs("span",{className:"rmx-statusbar-item",children:[s.wordCount," ",1===s.wordCount?"word":"words"]}),t.jsx("span",{className:"rmx-statusbar-sep","aria-hidden":"true"}),t.jsxs("span",{className:"rmx-statusbar-item",children:[s.charCount," ",1===s.charCount?"character":"characters"]})]})}));const un=n.memo((function({engine:e}){const[r,o]=n.useState({wordCount:0,charCount:0}),[a,s]=n.useState(!1),l=n.useRef(null),i=n.useCallback((e=>{o((t=>t.wordCount===e.wordCount&&t.charCount===e.charCount?t:e))}),[]);return n.useEffect((()=>{if(!e)return;e._wordCount&&i(e._wordCount);return e.eventBus.on("wordcount:update",i)}),[e,i]),n.useEffect((()=>{if(!a)return;const e=e=>{l.current&&!l.current.contains(e.target)&&s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[a]),t.jsxs("div",{ref:l,className:"rmx-wordcount-btn-wrap rmx-inline-flex-relative",children:[t.jsx("button",{className:"rmx-toolbar-btn "+(a?"rmx-active":""),onClick:e=>{e.preventDefault(),e.stopPropagation(),s((e=>!e))},onMouseDown:e=>e.preventDefault(),title:"Word Count",type:"button","aria-label":"Word Count","aria-expanded":a,children:t.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"M4 7h16M4 12h10M4 17h12"})})}),a&&t.jsxs("div",{className:"rmx-wordcount-popover",children:[t.jsxs("div",{className:"rmx-wordcount-popover-row",children:[t.jsx("span",{className:"rmx-wordcount-popover-label",children:"Words"}),t.jsx("span",{className:"rmx-wordcount-popover-value",children:r.wordCount})]}),t.jsxs("div",{className:"rmx-wordcount-popover-row",children:[t.jsx("span",{className:"rmx-wordcount-popover-label",children:"Characters"}),t.jsx("span",{className:"rmx-wordcount-popover-value",children:r.charCount})]})]})]})}));const dn=n.memo((function({recoveryData:e,onRecover:n,onDismiss:r}){if(!e)return null;const o=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);return t.jsxs("div",{className:"rmx-recovery-banner",role:"alert",children:[t.jsxs("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:[t.jsx("circle",{cx:"12",cy:"12",r:"10"}),t.jsx("polyline",{points:"12 6 12 12 16 14"})]}),t.jsxs("span",{className:"rmx-recovery-banner-text",children:["Unsaved changes found from ",o]}),t.jsxs("div",{className:"rmx-recovery-banner-actions",children:[t.jsx("button",{className:"rmx-recovery-btn rmx-recovery-btn--restore",onClick:n,type:"button",children:"Restore"}),t.jsx("button",{className:"rmx-recovery-btn rmx-recovery-btn--dismiss",onClick:r,type:"button",children:"Dismiss"})]})]})}));dn.propTypes={recoveryData:Be.shape({recoveredContent:Be.string.isRequired,timestamp:Be.number.isRequired}),onRecover:Be.func.isRequired,onDismiss:Be.func.isRequired};class mn extends n.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:t.jsxs("div",{className:"rmx-error-boundary",children:[t.jsx("p",{children:"Something went wrong with the editor."}),t.jsx("button",{onClick:()=>this.setState({hasError:!1,error:null}),children:"Try again"})]}):this.props.children}}const pn={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 fn(e){const t=e.tagName;let n=pn[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 xn=n.memo((function({engine:e}){const[r,o]=n.useState([{label:"Paragraph",element:null}]),a=n.useCallback((()=>{if(!e?.element)return;const t=window.getSelection();if(!t||0===t.rangeCount)return;let n=t.anchorNode;n&&(n.nodeType===Node.TEXT_NODE&&(n=n.parentElement),n&&e.element.contains(n)&&o(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:fn(r),element:r})}r=r.parentElement}return n.length>0?n:[{label:"Paragraph",element:null}]}(n,e.element)))}),[e]);n.useEffect((()=>{if(!e)return;const t=e.eventBus.on("selection:change",a);return a(),t}),[e,a]);const s=n.useCallback((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]);return t.jsx("div",{className:"rmx-breadcrumb-bar",role:"navigation","aria-label":"Document path",children:r.map(((e,r)=>t.jsxs(n.Fragment,{children:[r>0&&t.jsx("span",{className:"rmx-breadcrumb-separator","aria-hidden":"true",children:"›"}),t.jsx("button",{type:"button",className:"rmx-breadcrumb-item",onClick:()=>s(e.element),style:{background:"none",border:"none",cursor:"pointer",padding:"0 2px",font:"inherit",color:"inherit"},children:e.label})]},r)))})})),hn=n.memo((function({engine:e,editAreaRef:r}){const o=n.useRef(null),a=n.useRef(null),[s,l]=n.useState(0),[i,c]=n.useState(20),[u,d]=n.useState(""),m=n.useCallback((()=>{if(!e?.element)return;const t=e.element.textContent||"";d(t)}),[e]),p=n.useCallback((()=>{if(!r?.current||!o.current)return;const e=r.current,t=o.current,n=e.scrollTop/(e.scrollHeight||1),a=e.clientHeight/(e.scrollHeight||1),s=t.clientHeight;l(n*s),c(Math.max(a*s,10))}),[r]);n.useEffect((()=>{if(!e)return;const t=e.eventBus.on("content:change",m);return m(),t}),[e,m]),n.useEffect((()=>{const e=r?.current;if(!e)return;let t=null;const n=()=>{t||(t=requestAnimationFrame((()=>{p(),t=null})))};return e.addEventListener("scroll",n),p(),()=>{e.removeEventListener("scroll",n),t&&cancelAnimationFrame(t)}}),[r,p]);const f=n.useCallback((e=>{if(!r?.current||!o.current)return;const t=o.current,n=r.current,a=t.getBoundingClientRect(),s=(e.clientY-a.top)/a.height*n.scrollHeight-n.clientHeight/2;n.scrollTo({top:Math.max(0,s),behavior:"smooth"})}),[r]);return t.jsxs("div",{className:"rmx-minimap",ref:o,onClick:f,"aria-hidden":"true",children:[t.jsx("div",{className:"rmx-minimap-content",ref:a,children:u}),t.jsx("div",{className:"rmx-minimap-viewport",style:{top:s,height:i}})]})})),gn=n.memo((function({engine:r,format:o}){const[a,s]=n.useState(""),l=o||"html",i=n.useRef(null),c=n.useCallback((()=>{if(!r)return;const t=r.getHTML();s("markdown"===l?e.htmlToMarkdown(t):t)}),[r,l]);return n.useEffect((()=>{if(!r)return;const e=r.eventBus.on("content:change",(()=>{clearTimeout(i.current),i.current=setTimeout(c,200)}));return c(),()=>{e(),clearTimeout(i.current)}}),[r,c]),t.jsxs("div",{className:"rmx-split-preview-container",style:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:[t.jsx("div",{className:"rmx-split-preview-label",children:t.jsxs("span",{children:["markdown"===l?"Markdown":"HTML"," Preview"]})}),t.jsx("div",{className:"rmx-split-preview",children:a})]})}));function yn({message:e,type:r="info",duration:o=3e3,onDismiss:a}){const[s,l]=n.useState(!0);return n.useEffect((()=>{if(!e)return;l(!0);const t=setTimeout((()=>{l(!1),a?.()}),o);return()=>clearTimeout(t)}),[e,o,a]),s&&e?t.jsx("div",{className:`rmx-toast rmx-toast--${r}`,role:"status","aria-live":"polite",style:{animationDuration:`${o}ms`},children:e}):null}function bn(){const[e,r]=n.useState(null),o=n.useCallback(((e,t="info",n=3e3)=>{r({message:e,type:t,duration:n,key:Date.now()})}),[]),a=n.useCallback((()=>{r(null)}),[]);return[e?t.jsx(yn,{message:e.message,type:e.type,duration:e.duration,onDismiss:a},e.key):null,o]}const vn=n.lazy((()=>Promise.resolve().then((()=>require("./CommandPalette-t9J8JGNJ.cjs"))).then((e=>({default:e.CommandPalette}))))),jn=n.lazy((()=>Promise.resolve().then((()=>require("./LinkModal-DPxg7YCE.cjs"))).then((e=>({default:e.LinkModal}))))),Cn=n.lazy((()=>Promise.resolve().then((()=>require("./ImageModal-BzgYXY9y.cjs"))).then((e=>({default:e.ImageModal}))))),kn=n.lazy((()=>Promise.resolve().then((()=>require("./TablePickerModal-Dr0wUx_h.cjs"))).then((e=>({default:e.TablePickerModal}))))),wn=n.lazy((()=>Promise.resolve().then((()=>require("./EmbedModal-C73lODIT.cjs"))).then((e=>({default:e.EmbedModal}))))),Sn=n.lazy((()=>Promise.resolve().then((()=>require("./FindReplaceModal-DgysYT04.cjs"))).then((e=>({default:e.FindReplacePanel}))))),En=n.lazy((()=>Promise.resolve().then((()=>require("./SourceModal-CHKC5xcv.cjs"))).then((e=>({default:e.SourceModal}))))),Nn=n.lazy((()=>Promise.resolve().then((()=>require("./ExportModal-Cu-cCwa6.cjs"))).then((e=>({default:e.ExportModal}))))),Tn=n.lazy((()=>Promise.resolve().then((()=>require("./AttachmentModal-BDFFiZJt.cjs"))).then((e=>({default:e.AttachmentModal}))))),Mn=n.lazy((()=>Promise.resolve().then((()=>require("./ImportDocumentModal-gCFept9p.cjs"))).then((e=>({default:e.ImportDocumentModal})))));function Rn({modals:e,closeModal:r,engine:o,showCommandPalette:a,commandPaletteOpen:s,setCommandPaletteOpen:l,handleOpenModal:i}){return t.jsxs(n.Suspense,{fallback:t.jsx("div",{className:"rmx-loading-spinner"}),children:[e.link.open&&t.jsx(jn,{open:e.link.open,onClose:()=>r("link"),engine:o,data:e.link.data}),e.image.open&&t.jsx(Cn,{open:e.image.open,onClose:()=>r("image"),engine:o}),e.attachment?.open&&t.jsx(Tn,{open:e.attachment.open,onClose:()=>r("attachment"),engine:o}),e.importDocument?.open&&t.jsx(Mn,{open:e.importDocument.open,onClose:()=>r("importDocument"),engine:o}),e.table.open&&t.jsx(kn,{open:e.table.open,onClose:()=>r("table"),engine:o}),e.embed.open&&t.jsx(wn,{open:e.embed.open,onClose:()=>r("embed"),engine:o}),e.source.open&&t.jsx(En,{open:e.source.open,onClose:()=>{r("source"),o?.isSourceMode&&(o.isSourceMode=!1,o.eventBus.emit("mode:change",{sourceMode:!1}))},engine:o}),e.export.open&&t.jsx(Nn,{open:e.export.open,onClose:()=>r("export"),engine:o}),a&&s&&t.jsx(vn,{open:s,onClose:()=>l(!1),engine:o,onOpenModal:i})]})}const Ln=n.lazy((()=>Promise.resolve().then((()=>require("./MenuBar-Lw_5Jp8u.cjs"))).then((e=>({default:e.MenuBar}))))),Dn=n.lazy((()=>Promise.resolve().then((()=>require("./ContextMenu-BafbP2Uh.cjs"))).then((e=>({default:e.ContextMenu})))));function On(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 Bn({text:e}){if(!e)return null;const n=e.split(/(@[\w.-]+)/g);return t.jsx("span",{children:n.map(((e,n)=>e.startsWith("@")?t.jsx("span",{className:"rmx-comment-mention",children:e},n):t.jsx("span",{children:e},n)))})}const Fn=n.memo((function({threads:e=[],activeThread:r,onNavigate:o,onResolve:a,onDelete:s,onReply:l,className:i="",filter:c="all"}){const[u,d]=n.useState(null),[m,p]=n.useState(""),f=n.useRef(null),x=e.filter((e=>"open"===c?!e.resolved:"resolved"!==c||e.resolved)),h=e.filter((e=>!e.resolved)).length,g=n.useCallback((e=>{m.trim()&&(l?.(e,{author:"You",body:m.trim()}),p(""),d(null))}),[m,l]),y=n.useCallback((e=>{d(e),p(""),requestAnimationFrame((()=>f.current?.focus()))}),[]);return t.jsxs("div",{className:`rmx-comments-panel ${i}`.trim(),role:"complementary","aria-label":"Comments",children:[t.jsxs("div",{className:"rmx-comments-panel-header",children:[t.jsx("span",{children:"Comments"}),t.jsxs("span",{className:"rmx-comments-panel-count",children:[h," open · ",e.length-h," resolved"]})]}),0===x.length?t.jsx("div",{style:{color:"var(--rmx-text-secondary)",fontSize:13,padding:"8px 0"},children:"resolved"===c?"No resolved comments":"open"===c?"No open comments":'No comments yet. Select text and click "Add Comment" to start.'}):x.map((e=>t.jsxs("div",{className:`rmx-comment-thread${e.resolved?" rmx-resolved":""}${r?.id===e.id?" rmx-active":""}`,onClick:()=>o?.(e.id),children:[t.jsxs("div",{className:"rmx-comment-thread-header",children:[t.jsx("span",{className:"rmx-comment-author",children:e.author}),t.jsx("span",{className:"rmx-comment-time",children:On(e.createdAt)})]}),t.jsx("div",{className:"rmx-comment-body",children:t.jsx(Bn,{text:e.body})}),t.jsx("span",{className:"rmx-comment-status "+(e.resolved?"rmx-closed":"rmx-open"),children:e.resolved?"Resolved":"Open"}),e.replies.map((e=>t.jsxs("div",{className:"rmx-comment-reply",children:[t.jsxs("div",{className:"rmx-comment-thread-header",children:[t.jsx("span",{className:"rmx-comment-author",children:e.author}),t.jsx("span",{className:"rmx-comment-time",children:On(e.createdAt)})]}),t.jsx("div",{className:"rmx-comment-body",children:t.jsx(Bn,{text:e.body})})]},e.id))),u===e.id&&t.jsx("div",{className:"rmx-comment-reply",style:{marginTop:6},children:t.jsx("input",{ref:f,type:"text",placeholder:"Reply...",value:m,onChange:e=>p(e.target.value),onKeyDown:t=>{"Enter"===t.key&&g(e.id),"Escape"===t.key&&d(null)},onClick:e=>e.stopPropagation(),style:{width:"100%",padding:"4px 8px",fontSize:12,border:"1px solid var(--rmx-border, #e2e8f0)",borderRadius:4,outline:"none"}})}),t.jsxs("div",{className:"rmx-comment-actions",onClick:e=>e.stopPropagation(),children:[t.jsx("button",{className:"rmx-comment-action-btn",onClick:()=>y(e.id),children:"Reply"}),t.jsx("button",{className:"rmx-comment-action-btn rmx-resolve-btn",onClick:()=>a?.(e.id,!e.resolved),children:e.resolved?"Reopen":"Resolve"}),t.jsx("button",{className:"rmx-comment-action-btn rmx-delete-btn",onClick:()=>s?.(e.id),children:"Delete"})]})]},e.id)))]})}));function An({collaborators:e=[],connectionStatus:n="disconnected",localUser:r,className:o="",showCount:a=!0}){return t.jsxs("div",{className:`rmx-collab-bar ${o}`,role:"status","aria-label":"Collaborators",children:[t.jsx("div",{className:"rmx-collab-status-dot","data-status":n,title:n}),r&&t.jsx("div",{className:"rmx-collab-avatar rmx-collab-avatar-local",style:{backgroundColor:r.userColor},title:`${r.userName} (you)`,children:r.userName.charAt(0).toUpperCase()}),e.map((e=>t.jsx("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))),a&&t.jsxs("span",{style:{fontSize:11,color:"#64748b",marginLeft:4},children:[e.length+(r?1:0)," user",e.length>0?"s":""]})]})}An.propTypes={collaborators:Be.arrayOf(Be.shape({userId:Be.string.isRequired,userName:Be.string.isRequired,userColor:Be.string.isRequired,status:Be.string})),connectionStatus:Be.string,localUser:Be.shape({userId:Be.string,userName:Be.string.isRequired,userColor:Be.string.isRequired}),className:Be.string,showCount:Be.bool};const Pn=n.memo(An);exports.BreadcrumbBar=xn,exports.ChevronRightIcon=kt,exports.CloseIcon=jt,exports.CollaborationBar=Pn,exports.CommentsPanel=Fn,exports.EditorErrorBoundary=mn,exports.EmptyState=function({custom:e,onClick:n}){return e&&!0!==e?t.jsx("div",{className:"rmx-empty-state",onClick:n,role:"button",tabIndex:0,children:e}):t.jsxs("div",{className:"rmx-empty-state",onClick:n,role:"button",tabIndex:0,children:[t.jsx("div",{className:"rmx-empty-state-icon",children:t.jsxs("svg",{viewBox:"0 0 64 64",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[t.jsx("rect",{x:"8",y:"8",width:"48",height:"48",rx:"6",fill:"none",stroke:"currentColor",strokeWidth:"2"}),t.jsx("line",{x1:"16",y1:"20",x2:"48",y2:"20",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),t.jsx("line",{x1:"16",y1:"28",x2:"40",y2:"28",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",opacity:"0.6"}),t.jsx("line",{x1:"16",y1:"36",x2:"44",y2:"36",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",opacity:"0.4"}),t.jsx("line",{x1:"16",y1:"44",x2:"32",y2:"44",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",opacity:"0.2"})]})}),t.jsx("div",{className:"rmx-empty-state-text",children:"Start typing..."}),t.jsx("div",{className:"rmx-empty-state-hint",children:"or paste content, drag a file, or use the toolbar above"})]})},exports.ICON_MAP=Pt,exports.Minimap=hn,exports.PropTypes=Be,exports.RecoveryBanner=dn,exports.RemyxEditor=function(r){const o=function(t,r={}){const[o,a]=n.useState(null),s=Z.get(t);n.useEffect((()=>{s?.plugins?Promise.resolve().then((()=>require("./index-OfJxpaev.cjs"))).then((({resolvePluginsFromConfig:e})=>{a(e(s.plugins))})):a([])}),[s]);const l=n.useMemo((()=>{if(!s)return null;const t=s.menuBar;return!0===t?e.DEFAULT_MENU_BAR:Array.isArray(t)?t:null}),[s]),i=n.useMemo((()=>s&&s.toolbar||e.DEFAULT_TOOLBAR),[s]);return n.useMemo((()=>s?{theme:s.theme||"light",placeholder:s.placeholder||"",height:s.height||300,minHeight:s.minHeight,maxHeight:s.maxHeight,readOnly:s.readOnly||!1,outputFormat:s.outputFormat||"html",toolbar:i,menuBarConfig:l,statusBar:s.statusBar??"bottom",showFloatingToolbar:s.floatingToolbar??!0,showContextMenu:s.contextMenu??!0,showCommandPalette:s.commandPalette??!0,autosaveConfig:s.autosave?!0===s.autosave?{enabled:!0}:{enabled:!0,...s.autosave}:{enabled:!1},showBreadcrumb:s.breadcrumb||!1,showMinimap:s.minimap||!1,splitViewFormat:s.splitViewFormat,fonts:s.fonts,googleFonts:s.googleFonts,customTheme:s.customTheme,toolbarItemTheme:s.toolbarItemTheme,sanitize:s.sanitize,shortcuts:s.shortcuts,baseHeadingLevel:s.baseHeadingLevel,uploadHandler:s.uploadHandler,plugins:o||[],value:r.value,defaultValue:r.defaultValue,onChange:r.onChange,onReady:r.onReady,onError:r.onError,onFocus:r.onFocus,onBlur:r.onBlur,className:r.className||"",style:r.style,errorFallback:r.errorFallback}:null),[s,t,o,i,l,r.value,r.defaultValue,r.onChange,r.onReady,r.onError,r.onFocus,r.onBlur,r.className,r.style,r.errorFallback])}(r.config,r);if(!o)return t.jsxs("div",{className:"rmx-editor rmx-error",children:['Config "',r.config,'" not found']});const{value:m,defaultValue:p,onChange:f,toolbar:x,theme:h,placeholder:g,height:y,minHeight:b,maxHeight:v,readOnly:j,plugins:C,onReady:k,onFocus:w,onBlur:S,className:E,style:N,uploadHandler:T,outputFormat:M,showFloatingToolbar:R,showContextMenu:L,fonts:D,googleFonts:O,statusBar:B,customTheme:F,toolbarItemTheme:A,sanitize:P,shortcuts:_,baseHeadingLevel:I,menuBarConfig:z,onError:$,errorFallback:H,showCommandPalette:W,autosaveConfig:q,showBreadcrumb:V,showMinimap:U,splitViewFormat:Y}=o,X=n.useRef(null),G=n.useRef(null);n.useEffect((()=>{O&&O.length>0&&e.loadGoogleFonts(O)}),[O]);const K=n.useMemo((()=>{if(!O||0===O.length)return D;const t=O.map((e=>e.split(":")[0])),n=D||e.DEFAULT_FONTS,r=new Set(n.map((e=>e.toLowerCase()))),o=t.filter((e=>!r.has(e.toLowerCase())));return[...n,...o]}),[D,O]),{engine:J,ready:oe}=a(X,{value:m,defaultValue:p,onChange:f,outputFormat:M,placeholder:g,readOnly:j,plugins:C,onReady:k,onFocus:w,onBlur:S,uploadHandler:T,sanitize:P,shortcuts:_,baseHeadingLevel:I}),{formatState:ae,uiState:se}=function(e){const t=n.useRef(new WeakMap),[r,o]=n.useState(s),[a,c]=n.useState(l),u=n.useRef({image:null,table:null}),d=n.useCallback((e=>{o((t=>{const n={};for(const r of i)n[r]=r in e?e[r]:s[r];return function(e,t,n){for(const r of n)if(e[r]!==t[r])return!1;return!0}(t,n,i)?t:n}));const n=window.getSelection(),r=n&&!n.isCollapsed&&n.toString().length>0;let a=null;if(r&&n.rangeCount>0)try{a=n.getRangeAt(0).getBoundingClientRect()}catch{a=null}let l=null,d=null,m=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)l=o.image,d=o.table,m=o.codeBlock;else{const n="IMG"===e.tagName?e:e.querySelector?.(":scope > img");n&&(l=n);const o=e.closest?.("table");o&&(d=o);const a=e.closest?.("pre");a&&(m=a),t.current.set(r,{image:l,table:d,codeBlock:m})}}}l===u.current.image&&d===u.current.table&&m===u.current.codeBlock?(l=u.current.image,d=u.current.table,m=u.current.codeBlock):u.current={image:l,table:d,codeBlock:m},c((e=>{const t=!r||e.selectionRect&&a&&e.selectionRect.top===a.top&&e.selectionRect.left===a.left&&e.selectionRect.width===a.width&&e.selectionRect.height===a.height;return e.hasSelection===r&&e.focusedImage===l&&e.focusedTable===d&&e.focusedCodeBlock===m&&t?e:{hasSelection:r,selectionRect:a,focusedImage:l,focusedTable:d,focusedCodeBlock:m}}))}),[]);return n.useEffect((()=>{if(e)return e.eventBus.on("selection:change",d)}),[e,d]),n.useEffect((()=>{if(e)return e.eventBus.on("content:change",(()=>{u.current={image:null,table:null,codeBlock:null}}))}),[e]),{formatState:r,uiState:a}}(J),{modals:le,openModal:ie,closeModal:ce}=function(){const[e,t]=n.useReducer(u,c),r=n.useCallback(((e,n=null)=>{t({type:"OPEN",name:e,data:n})}),[]),o=n.useCallback((e=>{t({type:"CLOSE",name:e})}),[]),a=n.useCallback((t=>e[t]?.open||!1),[e]),s=n.useCallback((t=>e[t]?.data||null),[e]);return{modals:e,openModal:r,closeModal:o,isOpen:a,getData:s}}(),{contextMenu:ue,hideContextMenu:de}=d(J,X),{saveStatus:me,recoveryData:pe,recoverContent:fe,dismissRecovery:xe}=Q(J,q),[he,ge]=bn();n.useEffect((()=>{if(!J)return;const e=[J.eventBus.on("export:success",(()=>ge("Export successful","success"))),J.eventBus.on("clipboard:copy",(()=>ge("Copied to clipboard","info")))];return()=>e.forEach((e=>"function"==typeof e&&e()))}),[J,ge]);const ye=ee(G);n.useEffect((()=>{G.current&&J&&(G.current.__engine=J)}),[J]);const{isExternalDrag:be,dragFileTypes:ve}=te(J);!function(e,t,r={}){const o=n.useRef(null),a=n.useRef(null),s=n.useCallback((e=>{if(!e.touches.length)return;const t=e.touches[0];o.current={startX:t.clientX,startY:t.clientY,currentX:t.clientX,currentY:t.clientY};const n=e.target.closest("li, blockquote");a.current=n||null}),[]),l=n.useCallback((e=>{if(!o.current)return;const t=e.touches[0];o.current.currentX=t.clientX,o.current.currentY=t.clientY;const n=t.clientX-o.current.startX,r=Math.abs(t.clientY-o.current.startY);if(a.current&&r<30){const e=Math.max(-80,Math.min(80,n));a.current.style.transform=`translateX(${e}px)`,a.current.style.transition="none"}}),[]),i=n.useCallback((t=>{if(!o.current||!e)return void(o.current=null);const{startX:n,startY:s,currentX:l,currentY:i}=o.current,c=l-n,u=i-s,d=Math.abs(c),m=Math.abs(u);a.current&&(a.current.style.transform="",a.current.style.transition="transform 0.2s ease",setTimeout((()=>{a.current&&(a.current.style.transition="")}),200)),a.current&&d>=50&&m<30&&(c>0?e.executeCommand("indent"):e.executeCommand("outdent")),u>50&&d<30&&t.target.closest(".rmx-floating-toolbar")&&r.onDismissToolbar?.(),o.current=null,a.current=null}),[e,r]);n.useEffect((()=>{const e=t?.current;if(e)return e.addEventListener("touchstart",s,{passive:!0}),e.addEventListener("touchmove",l,{passive:!0}),e.addEventListener("touchend",i,{passive:!0}),()=>{e.removeEventListener("touchstart",s),e.removeEventListener("touchmove",l),e.removeEventListener("touchend",i)}}),[t,s,l,i])}(J,X,{onDismissToolbar:()=>{J?.element&&window.getSelection()?.removeAllRanges()}}),function(e,t,r={}){const{enabled:o=!0}=r,a=n.useRef(null),s=n.useRef(null),l=n.useRef(!1),i=n.useCallback((()=>{a.current&&(clearTimeout(a.current),a.current=null),s.current=null,l.current=!1}),[]),c=n.useCallback((e=>{if(!o||!e.touches.length)return;const n=e.touches[0];s.current={x:n.clientX,y:n.clientY},l.current=!1,a.current=setTimeout((()=>{if(navigator.vibrate)try{navigator.vibrate(10)}catch(e){}l.current=!0,t?.({x:s.current.x,y:s.current.y})}),500)}),[o,t]),u=n.useCallback((e=>{if(!s.current||!e.touches.length)return;const t=e.touches[0],n=Math.abs(t.clientX-s.current.x),r=Math.abs(t.clientY-s.current.y);(n>10||r>10)&&i()}),[i]),d=n.useCallback((e=>{l.current&&e.preventDefault(),i()}),[i]),m=n.useCallback((e=>{l.current&&e.preventDefault()}),[]);n.useEffect((()=>{const t=e?.current;if(t&&o)return t.addEventListener("touchstart",c,{passive:!0}),t.addEventListener("touchmove",u,{passive:!0}),t.addEventListener("touchend",d),t.addEventListener("contextmenu",m),()=>{t.removeEventListener("touchstart",c),t.removeEventListener("touchmove",u),t.removeEventListener("touchend",d),t.removeEventListener("contextmenu",m),i()}}),[e,o,c,u,d,m,i])}(X,n.useCallback((({x:e,y:t})=>{J&&J.eventBus.emit("contextmenu",{clientX:e,clientY:t,preventDefault:()=>{}})}),[J]),{enabled:L&&!j});const{zoomedElement:je,resetZoom:Ce}=function(e){const[t,r]=n.useState(null),o=n.useRef(null),a=n.useRef(1),s=n.useCallback((()=>{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")}r(null)}}),[t]),l=n.useCallback((e=>{if(2!==e.touches.length)return;const t=e.target.closest("img, table");if(!t)return;e.preventDefault();const n=ne(e.touches[0],e.touches[1]),r=t.style.transform.match(/scale\(([^)]+)\)/),a=r?parseFloat(r[1]):1;o.current={element:t,initialDistance:n,initialScale:a},t.style.transformOrigin="center center"}),[]),i=n.useCallback((e=>{if(!o.current||2!==e.touches.length)return;e.preventDefault();const t=ne(e.touches[0],e.touches[1]),{initialDistance:n,initialScale:r,element:s}=o.current;let l=r*(t/n);l=Math.max(.5,Math.min(3,l)),a.current=l,s.style.transform=`scale(${l})`}),[]),c=n.useCallback((e=>{if(!o.current)return;const{element:t}=o.current,n=a.current;if(Math.abs(n-1)>.05)if("IMG"===t.tagName){const e=t.getBoundingClientRect(),n=Math.round(e.width),o=Math.round(e.height);t.style.transform="",t.setAttribute("width",n),t.setAttribute("height",o),t.style.width=`${n}px`,t.style.height=`${o}px`,t.setAttribute("data-rmx-zoomed","true"),r(t)}else"TABLE"===t.tagName&&(t.setAttribute("data-rmx-zoomed","true"),r(t));else t.style.transform="",t.style.transformOrigin="";o.current=null,a.current=1}),[]);return n.useEffect((()=>{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:s}}(X);!function(e,t){const[r,o]=n.useState(!1),[a,s]=n.useState(0),l=n.useRef(null),i=n.useCallback((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]);n.useEffect((()=>{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?(o(!0),s(n),t?.current&&(t.current.style.paddingBottom=`${n}px`),i(n)):(o(!1),s(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,r=e-n;r>100?(o(!0),s(r),t?.current&&(t.current.style.paddingBottom=`${r}px`),i(r)):n>=(l.current||e)-50&&(o(!1),s(0),t?.current&&(t.current.style.paddingBottom="")),e=n};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e,t,i])}(J,G),n.useEffect((()=>{if(J)return J.eventBus.on("mode:change",(({sourceMode:e})=>{e&&ie("source")}))}),[J,ie]);const[ke,we]=n.useState(!1);n.useEffect((()=>{if(!J)return;const e=e=>{const t=navigator.platform.includes("Mac")?e.metaKey:e.ctrlKey;t&&"f"===e.key&&(e.preventDefault(),ie("findReplace")),W&&t&&e.shiftKey&&("p"===e.key||"P"===e.key)&&(e.preventDefault(),we((e=>!e)))};return J.element?.addEventListener("keydown",e),()=>J.element?.removeEventListener("keydown",e)}),[J,ie,W]),n.useEffect((()=>{if(!J||!$)return;const e=[J.eventBus.on("plugin:error",(({name:e,error:t})=>$(t,{source:"plugin",pluginName:e}))),J.eventBus.on("editor:error",(({phase:e,error:t})=>$(t,{source:"engine",phase:e}))),J.eventBus.on("upload:error",(({file:e,error:t})=>$(t,{source:"upload",file:e})))];return()=>e.forEach((e=>e()))}),[J,$]);const Se=n.useCallback(((e,t)=>{"commandPalette"!==e?ie(e,t):we(!0)}),[ie]),[Ee,Ne]=n.useState(!0);n.useEffect((()=>{if(!J)return;const e=()=>{const e=J.getText().trim();Ne(""===e||"\n"===e)},t=J.eventBus.on("content:change",e);return e(),t}),[J]);const[Te,Me]=n.useState(!1);n.useEffect((()=>{if(J)return J.eventBus.on("splitView:toggle",(({active:e})=>Me(e)))}),[J]);const Re=n.useMemo((()=>"popup"===B?t.jsx(un,{engine:J}):null),[B,J]),Le=n.useMemo((()=>`rmx-editor rmx-theme-${/^[a-zA-Z0-9_-]+$/.test(h)?h:"light"} ${E||""}`),[h,E]),De=n.useMemo((()=>({minHeight:b||y,maxHeight:v||void 0,height:v?void 0:y,overflowY:"auto"})),[b,y,v]),Oe=n.useMemo((()=>F?{...F,...N}:N),[F,N]);return t.jsx(mn,{onError:$,fallback:H,children:t.jsx(re.Provider,{value:ae,children:t.jsxs("div",{ref:G,className:Le,style:Oe,children:[t.jsx("a",{className:"rmx-skip-link",href:"#rmx-edit-area",children:"Skip to editor content"}),z&&t.jsx(n.Suspense,{fallback:t.jsx("div",{className:"rmx-loading-spinner"}),children:t.jsx(Ln,{config:z,engine:J,onOpenModal:Se})}),t.jsx(Kt,{config:x,engine:J,onOpenModal:Se,fonts:K,statusBarMode:B,wordCountButton:Re,toolbarItemTheme:A}),q.enabled&&!1!==q.showRecoveryBanner&&t.jsx(dn,{recoveryData:pe,onRecover:fe,onDismiss:xe}),V&&J&&t.jsx(xn,{engine:J}),"top"===B&&t.jsx(cn,{engine:J,position:"top",saveStatus:me,showSaveStatus:q.enabled&&!1!==q.showSaveStatus}),t.jsxs("div",{className:"rmx-editor-body",style:{position:"relative"},children:[t.jsx(Jt,{ref:X,style:De,readOnly:j,id:"rmx-edit-area"}),Te&&J&&t.jsx(gn,{engine:J,format:Y}),U&&J&&t.jsx(hn,{engine:J,editAreaRef:X}),R&&t.jsx(Qt,{visible:se.hasSelection,selectionRect:se.selectionRect,engine:J,editorRect:ye,onOpenModal:Se}),se.focusedImage&&t.jsx(en,{image:se.focusedImage,engine:J,editorRect:ye}),se.focusedTable&&t.jsx(tn,{table:se.focusedTable,engine:J,editorRect:ye}),se.focusedCodeBlock&&t.jsx(rn,{codeBlock:se.focusedCodeBlock,engine:J,editorRect:ye}),!j&&J&&t.jsx(an,{engine:J,editorRect:ye,editAreaRef:X}),je&&t.jsx("button",{className:"rmx-pinch-zoom-reset",onClick:Ce,type:"button","aria-label":"Reset zoom",children:"Reset Zoom"}),t.jsx(on,{visible:be,fileTypes:ve}),t.jsx(n.Suspense,{fallback:t.jsx("div",{className:"rmx-loading-spinner"}),children:le.findReplace.open&&t.jsx(Sn,{open:le.findReplace.open,onClose:()=>ce("findReplace"),engine:J})})]}),"bottom"===B&&t.jsx(cn,{engine:J,saveStatus:me,showSaveStatus:q.enabled&&!1!==q.showSaveStatus}),L&&t.jsx(n.Suspense,{fallback:t.jsx("div",{className:"rmx-loading-spinner"}),children:t.jsx(Dn,{contextMenu:ue,onHide:de,onOpenModal:Se})}),he,t.jsx(Rn,{modals:le,closeModal:ce,engine:J,showCommandPalette:W,commandPaletteOpen:ke,setCommandPaletteOpen:we,handleOpenModal:Se})]})})})},exports.SaveStatus=ln,exports.SplitPreview=gn,exports.Toast=yn,exports.TypographyDropdown=Xt,exports.useAutosave=Q,exports.useCollaboration=function(e){const[t,r]=n.useState([]),[o,a]=n.useState("disconnected"),s=n.useRef([]);return n.useEffect((()=>{if(!e?.eventBus)return;const t=()=>{e._collaboration&&(r(e._collaboration.getCollaborators()),a(e._collaboration.getConnectionStatus()))};t();const n=["collab:userJoin","collab:userLeave","collab:connected","collab:disconnected","collab:sync"].map((n=>e.eventBus.on(n,t)));return s.current=n,()=>{for(const e of s.current)e?.();s.current=[]}}),[e]),{collaborators:t,connectionStatus:o,startCollaboration:n.useCallback((()=>{e?._collaboration?.startCollaboration()}),[e]),stopCollaboration:n.useCallback((()=>{e?._collaboration?.stopCollaboration()}),[e]),localUser:e?._collaboration?{userId:e._collaboration.userId,userName:e._collaboration.userName,userColor:e._collaboration.userColor}:null}},exports.useComments=function(e){const[t,r]=n.useState([]),[o,a]=n.useState(null),s=n.useRef([]),l=n.useCallback((()=>{e?._comments&&r(e._comments.getAllThreads())}),[e]);n.useEffect((()=>{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})=>{a(e)}));return t.push(n),s.current=t,()=>{for(const e of s.current)e?.();s.current=[]}}),[e,l]);const i=n.useCallback((t=>e?._comments?.addComment(t)??null),[e]),c=n.useCallback((t=>{e?._comments?.deleteComment(t)}),[e]),u=n.useCallback(((t,n=!0)=>{e?._comments?.resolveComment(t,n)}),[e]),d=n.useCallback(((t,n)=>e?._comments?.replyToComment(t,n)??null),[e]),m=n.useCallback(((t,n)=>{e?._comments?.editComment(t,n)}),[e]),p=n.useCallback((t=>{e?._comments?.navigateToComment(t);const n=e?._comments?.getThread(t);n&&a(n)}),[e]),f=n.useCallback((t=>{e?._comments?.importThreads(t)}),[e]),x=n.useCallback((()=>e?._comments?.exportThreads()??[]),[e]),h=n.useCallback((()=>e?._comments?.getMentionUsers()??[]),[e]);return{threads:t,activeThread:o,setActiveThread:a,addComment:i,deleteComment:c,resolveComment:u,replyToComment:d,editComment:m,navigateToComment:p,importThreads:f,exportThreads:x,getMentionUsers:h,refresh:l}},exports.useDragDrop=te,exports.useEditorEngine=a,exports.useRemyxEditor=function(t,r={}){const a=n.useRef(null),s=n.useRef(null),l=n.useRef(null),[i,c]=n.useState(!1),u=n.useRef(""),d=n.useRef(null),m=n.useRef(null),p=n.useRef(null),f=n.useCallback((()=>{const n=t.current;if(!n||a.current)return;const i=n.tagName.toLowerCase(),f="textarea"===i,x="input"===i;let h="";h=f||x?n.value||"":n.innerHTML||"",void 0!==r.value?h=r.value:void 0!==r.defaultValue&&(h=r.defaultValue);const g=document.createElement("div"),y=/^[a-zA-Z0-9_-]+$/.test(r.theme)?r.theme:"light";if(g.className=`rmx-editor rmx-theme-${y} ${r.className||""}`,r.style){const e=new Set(["width","height","minHeight","maxHeight","minWidth","maxWidth","margin","padding","border","borderRadius","background","backgroundColor","color","fontSize","fontFamily","overflow","overflowY","overflowX"]);for(const[t,n]of Object.entries(r.style))e.has(t)&&(g.style[t]=n)}s.current=g;const b=document.createElement("div");b.className="rmx-content";const v=r.height||300;b.style.minHeight="number"==typeof v?`${v}px`:v,b.style.overflowY="auto";const j=document.createElement("div");if(j.className="rmx-edit-area",j.appendChild(b),g.appendChild(j),l.current=b,f||x){n.style.display="none",n.parentNode.insertBefore(g,n.nextSibling);const e=()=>{a.current&&(n.value=a.current.getHTML())};d.current=()=>{e(),n.style.display="",g.parentNode&&g.parentNode.removeChild(g)};const t=n.closest("form");if(t){m.current=t,p.current=e,t.addEventListener("submit",e);const n=d.current;d.current=()=>{m.current?.removeEventListener("submit",p.current),m.current=null,p.current=null,n()}}}else{const e=n.textContent;n.innerHTML="",n.appendChild(g),d.current=()=>{n.textContent=e}}const C={...r,value:h},{engine:k}=o(b,C);k.init(),a.current=k;const w="markdown"===r.outputFormat;return u.current=w?e.htmlToMarkdown(h):h,c(!0),r.onReady?.(k),k.eventBus.emit("content:change"),k.on("content:change",(()=>{const t=k.getHTML(),o=w?e.htmlToMarkdown(t):t;o!==u.current&&(u.current=o,r.onChange?.(o),(f||x)&&n&&(n.value=o))})),k.on("focus",(()=>r.onFocus?.())),k.on("blur",(()=>r.onBlur?.())),k}),[]);return n.useEffect((()=>{const e=f();return()=>{e&&(e.destroy(),a.current=null,c(!1)),d.current&&(d.current(),d.current=null)}}),[f]),n.useEffect((()=>{if(!a.current||!i)return;if(void 0===r.value)return;if(r.value===u.current)return;u.current=r.value;const t="markdown"===r.outputFormat?e.markdownToHtml(r.value):r.value;a.current.setHTML(t)}),[r.value,r.outputFormat,i]),{engine:a.current,containerRef:s,editableRef:l,ready:i}},exports.useSelectionContext=oe,exports.useSpellcheck=function(e){const[t,r]=n.useState([]),[o,a]=n.useState({total:0,grammar:0,style:0,byRule:{}}),[s,l]=n.useState(!0),[i,c]=n.useState("formal"),[u,d]=n.useState("en-US"),m=n.useRef([]),p=n.useCallback((()=>{if(!e?._spellcheck)return;const t=e._spellcheck.getStats();r(e._spellcheck.getErrors()),a(t),l(e._spellcheck.isEnabled()),c(e._spellcheck.getWritingStyle()),d(e._spellcheck.getLanguage())}),[e]);return n.useEffect((()=>{if(!e?.eventBus)return;p();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,p)));return m.current=t,()=>{for(const e of m.current)e?.();m.current=[]}}),[e,p]),{errors:t,stats:o,enabled:s,stylePreset:i,language:u,toggleSpellcheck:n.useCallback((()=>e?.executeCommand?.("toggleSpellcheck")??!1),[e]),checkGrammar:n.useCallback((async()=>e?._spellcheck?.runCheck()??[]),[e]),addToDictionary:n.useCallback((t=>{e?._spellcheck?.addToDictionary(t)}),[e]),removeFromDictionary:n.useCallback((t=>{e?._spellcheck?.removeFromDictionary(t)}),[e]),ignoreWord:n.useCallback((t=>{e?._spellcheck?.ignoreWord(t)}),[e]),setWritingStyle:n.useCallback((t=>{e?._spellcheck?.setWritingStyle(t)}),[e]),setLanguage:n.useCallback((t=>{e?._spellcheck?.setLanguage(t)}),[e]),getDictionary:n.useCallback((()=>e?._spellcheck?.getDictionary()??[]),[e]),getIgnoredWords:n.useCallback((()=>e?._spellcheck?.getIgnoredWords()??[]),[e]),refresh:p}},exports.useToast=bn;
2
+ //# sourceMappingURL=index-qh1Yzh-l.cjs.map