tinymce.PluginManager.add("dracula_tinymce_js",function(a){var e=function(e){var t=a.getBody(),d=draculaDarkMode.colors;e||draculaDarkMode.isEnabled()||draculaDarkMode.enable(),t.parentNode.setAttribute("data-dracula-scheme","dark"),document.querySelector(".mce-i-dracula_toggle").classList.add("mode-dark"),t.style.setProperty("--dracula-background",d.background),t.style.setProperty("--dracula-text",d.text)},t=function(e){!e&&draculaDarkMode.isEnabled()&&draculaDarkMode.disable(),a.getBody().parentNode.removeAttribute("data-dracula-scheme"),document.querySelector(".mce-i-dracula_toggle").classList.remove("mode-dark")};a.addButton("dracula_toggle",{title:wp.i18n.__("Dark Mode","dracula-dark-mode"),classes:"dracula-toggle",onclick:function(a){var d=a.target,r=!d.classList.contains("mode-dark");r?(d.classList.add("mode-dark"),e()):(d.classList.remove("mode-dark"),t());var c=r?"dark":"light";localStorage.setItem("dracula_mode_admin",c)}}),a.on("init",function(){draculaDarkMode.isEnabled()&&e()}),new MutationObserver(function(a){a.forEach(function(a){"attributes"===a.type&&"data-dracula-scheme"===a.attributeName&&("dark"===document.documentElement.getAttribute("data-dracula-scheme")?e():t())})}).observe(document.documentElement,{attributes:!0})});