var themeCustomizationController=function(){var e="draftVariablesContainer",t="draftCustomCssContainer";function o(e){var t=document.querySelector("#"+e);t||((t=document.createElement("style")).type="text/css",t.id=e,document.getElementsByTagName("body")[0].appendChild(t))}function n(e){var t=document.querySelector("iframe.iframe");t&&t.contentWindow.postMessage(e,"*");var o=document.querySelector("iframe.iframe-modal");o&&o.contentWindow.postMessage(e,"*");var n=document.querySelector(".iframe-helper iframe");n&&n.contentWindow.postMessage(e,"*")}function r(n,r){o(e),o(t);var a=document.querySelector("#"+n);a.innerHTML="",a.appendChild(document.createTextNode(r))}return{reloadVariables:function(t){r(e,t.data.css),n(t)},reloadCustomCss:function(e){r(t,e.data.css),document.querySelectorAll('link[href*="/Css/Custom.css" i]').forEach((function(e){e.parentNode.removeChild(e)})),n(e)}}}();window.addEventListener("message",(function(e){var t=e.data;t&&("@RELOAD_DRAFT_VARS"===t.type&&themeCustomizationController.reloadVariables(t),"@RELOAD_DRAFT_CSS"===t.type&&themeCustomizationController.reloadCustomCss(t),"@RELOAD_DRAFT_WIDGETS"===t.type&&window.location.reload())}));