var iframeParent_F85l10dYccUsTgcyS1Be = document.getElementById( 'miniextensions-iframe-embed-F85l10dYccUsTgcyS1Be' ); iframeParent_F85l10dYccUsTgcyS1Be.innerHTML = ` `; var eventMethod_F85l10dYccUsTgcyS1Be_xJoMNzuOzb = window.addEventListener ? "addEventListener" : "attachEvent"; var eventer_F85l10dYccUsTgcyS1Be_xJoMNzuOzb = window[eventMethod_F85l10dYccUsTgcyS1Be_xJoMNzuOzb]; var messageEvent_F85l10dYccUsTgcyS1Be_xJoMNzuOzb = eventMethod_F85l10dYccUsTgcyS1Be_xJoMNzuOzb == "attachEvent" ? "onmessage" : "message"; function toggleModal_F85l10dYccUsTgcyS1Be_xJoMNzuOzb(url, shouldConfirmIfClosing) { var modal_F85l10dYccUsTgcyS1Be_xJoMNzuOzb = document.querySelector( '.modal-F85l10dYccUsTgcyS1Be_xJoMNzuOzb' ); if (url) { if (modal_F85l10dYccUsTgcyS1Be_xJoMNzuOzb) { modal_F85l10dYccUsTgcyS1Be_xJoMNzuOzb.remove(); } var elem = document.createElement('div'); elem.className = "modal-F85l10dYccUsTgcyS1Be_xJoMNzuOzb show-modal-F85l10dYccUsTgcyS1Be_xJoMNzuOzb"; elem.innerHTML = '
'; document.body.appendChild(elem); } else { if (modal_F85l10dYccUsTgcyS1Be_xJoMNzuOzb) { if (shouldConfirmIfClosing && !window.confirm('Are you sure want to leave? Your unsaved changes will be lost.')) { return; } modal_F85l10dYccUsTgcyS1Be_xJoMNzuOzb.remove(); } } } function windowOnClick_F85l10dYccUsTgcyS1Be_xJoMNzuOzb(event) { var modal_F85l10dYccUsTgcyS1Be_xJoMNzuOzb = document.querySelector( '.modal-F85l10dYccUsTgcyS1Be_xJoMNzuOzb' ); if (event.target === modal_F85l10dYccUsTgcyS1Be_xJoMNzuOzb) { toggleModal_F85l10dYccUsTgcyS1Be_xJoMNzuOzb(null, true); } } window.addEventListener('click', windowOnClick_F85l10dYccUsTgcyS1Be_xJoMNzuOzb); function debounce_F85l10dYccUsTgcyS1Be_xJoMNzuOzb(func, wait, immediate) { var timeout; return function() { var context = this, args = arguments; var later = function() { timeout = null; if (!immediate) func.apply(context, args); }; var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (callNow) func.apply(context, args); }; }; window.addEventListener('scroll', debounce_F85l10dYccUsTgcyS1Be_xJoMNzuOzb(function(e) { const iframe = document.getElementById('miniExtensionsIframe-F85l10dYccUsTgcyS1Be_xJoMNzuOzb'); if (true && window && iframe && iframe.contentWindow && iframe.contentWindow.postMessage) { const iframeRect = iframe.getBoundingClientRect() const innerHeight = window.innerHeight; if (innerHeight != null && iframeRect != null && iframeRect.top != null) { iframe.contentWindow.postMessage({ type: 'miniExtensionsOnScrollParent', offsetWithScroll: iframeRect.top * -1, id: 'F85l10dYccUsTgcyS1Be', }, '*'); } } }, 250)); eventer_F85l10dYccUsTgcyS1Be_xJoMNzuOzb(messageEvent_F85l10dYccUsTgcyS1Be_xJoMNzuOzb, function(e) { if (!e.data) return; if (e && e.data && e.data.type && e.data.type === 'miniExtensionsResize') { if (e.data.iframeMessageId != null && e.data.iframeMessageId !== 'xJoMNzuOzb') { return; } document.getElementById('miniExtensionsIframe-F85l10dYccUsTgcyS1Be_xJoMNzuOzb').style.height = e.data.height + 'px'; document.getElementById('miniextensions-iframe-embed-F85l10dYccUsTgcyS1Be').style.height = e.data.height + 'px'; } else if (e && e.data && e.data.type && e.data.type === 'miniExtensionsOpenUrl') { if (e.data.iframeMessageId != null && e.data.iframeMessageId !== 'xJoMNzuOzb') { return; } if (e.data.mode === 'replace-parent') { window.location.href = e.data.url; } else if (e.data.newTab || e.data.mode === 'new-tab') { window.open(e.data.url); } else if (e.data.mode === 'replace-iframe' || e.data.mode === 'replace-iframe-not-href') { document.getElementById('miniExtensionsIframe-F85l10dYccUsTgcyS1Be_xJoMNzuOzb').src = e.data.url; if (false || !(e.data.url.startsWith('https://app.miniextensions.com') || e.data.url.startsWith('http://localhost'))) { document.getElementById('miniExtensionsIframe-F85l10dYccUsTgcyS1Be_xJoMNzuOzb').scrolling = 'yes'; } else { document.getElementById('miniExtensionsIframe-F85l10dYccUsTgcyS1Be_xJoMNzuOzb').scrolling = 'no'; } } else if (e.data.mode === 'replace-parent-not-href') { window.location.replace(e.data.url); } else { window.open(e.data.url); } } else if (e && e.data && e.data.type && e.data.type === 'miniExtensionsOpenModalEditor') { if (e.data.iframeMessageId != null && e.data.iframeMessageId !== 'xJoMNzuOzb') { return; } const finalUrlObject = new URL(e.data.url); finalUrlObject.searchParams.append( 'iframeMessageId', '84GEkGJip1' ); finalUrlObject.searchParams.append( 'iframeToCloseMessageId', 'xJoMNzuOzb' ); const finalUrl = finalUrlObject.toString(); toggleModal_F85l10dYccUsTgcyS1Be_xJoMNzuOzb(finalUrl, false); } else if (e && e.data && e.data.type && e.data.type === 'miniExtensionsCloseModalEditor') { if (e.data.iframeMessageId != null && e.data.iframeMessageId !== 'xJoMNzuOzb') { return; } toggleModal_F85l10dYccUsTgcyS1Be_xJoMNzuOzb(null, false); } else if (e && e.data && e.data.type && e.data.type === 'reloadPortalDataAfterChange') { const iframe = document.getElementById('miniExtensionsIframe-F85l10dYccUsTgcyS1Be_xJoMNzuOzb'); if (iframe && iframe.contentWindow && iframe.contentWindow.postMessage) { iframe.contentWindow.postMessage(e.data, '*'); } } }, false);