let themeStyleEl,themeFontsStyleEl,iframeHeightEvent=null,iframeHeightData={};const sendIframeHeight=()=>{iframeHeightData.iframeHeight!==document.body.scrollHeight&&(iframeHeightData.iframeHeight=document.body.scrollHeight,iframeHeightEvent.source.postMessage(iframeHeightData,iframeHeightEvent.origin))},ro=new ResizeObserver(n=>{n.forEach(()=>sendIframeHeight())}),communicationAllowed=n=>n.indexOf("://localhost:")!==-1||n==="https://app.ungapped.com"||n==="https://app.stage.ungapped.com"||n==="https://app.dev.ungapped.com";window.addEventListener("message",n=>{(n.data.getIframeHeight&&(document.body.classList.add("inIframe"),iframeHeightData.iframeId=n.data.getIframeHeight.iframeId,iframeHeightEvent=n,sendIframeHeight(),ro.observe(document.body)),communicationAllowed(n.origin))&&(n.data.cssVars&&(themeStyleEl||(themeStyleEl=document.createElement("style"),document.body.append(themeStyleEl)),themeStyleEl.innerHTML=":root {"+n.data.cssVars+"}"),n.data.googleFontsImport&&(themeFontsStyleEl||(themeFontsStyleEl=document.createElement("style"),document.body.append(themeFontsStyleEl)),themeFontsStyleEl.innerHTML=n.data.googleFontsImport),n.data.reloadIframeContent&&location.reload(),n.data.updateIframeText&&document.querySelectorAll('[data-identifier*="'+n.data.updateIframeText.key+'"]').forEach(t=>{t.innerText=n.data.updateIframeText.value}))})