import{r as e}from"./rolldown-runtime.WmLfqUcM.js";var t=e({plugin_exports:()=>n});(function(){let e=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}};var t=hugerte.util.Tools.resolve(`hugerte.PluginManager`);let n=(e,t)=>{e.dispatch(`VisualBlocks`,{state:t})},r=(e,t,r)=>{e.dom.toggleClass(e.getBody(),`mce-visualblocks`),r.set(!r.get()),n(e,r.get())},i=(e,t,n)=>{e.addCommand(`mceVisualBlocks`,()=>{r(e,t,n)})},a=e=>t=>t.options.get(e),o=e=>{let t=e.options.register;t(`visualblocks_default_state`,{processor:`boolean`,default:!1})},s=a(`visualblocks_default_state`),c=(e,t,n)=>{e.on(`PreviewFormats AfterPreviewFormats`,t=>{n.get()&&e.dom.toggleClass(e.getBody(),`mce-visualblocks`,t.type===`afterpreviewformats`)}),e.on(`init`,()=>{s(e)&&r(e,t,n)})},l=(e,t)=>n=>{n.setActive(t.get());let r=e=>n.setActive(e.state);return e.on(`VisualBlocks`,r),()=>e.off(`VisualBlocks`,r)},u=(e,t)=>{let n=()=>e.execCommand(`mceVisualBlocks`);e.ui.registry.addToggleButton(`visualblocks`,{icon:`visualblocks`,tooltip:`Show blocks`,onAction:n,onSetup:l(e,t)}),e.ui.registry.addToggleMenuItem(`visualblocks`,{text:`Show blocks`,icon:`visualblocks`,onAction:n,onSetup:l(e,t)})};t.add(`visualblocks`,(t,n)=>{o(t);let r=e(!1);i(t,n,r),u(t,r),c(t,n,r)})})();var n={};export{t};