var iframeParent_kxJF3OHPz1cFayXFw9Xi = document.getElementById( 'miniextensions-iframe-embed-kxJF3OHPz1cFayXFw9Xi' ); iframeParent_kxJF3OHPz1cFayXFw9Xi.innerHTML = ` `; if (1050) { document.getElementById('miniextensions-iframe-embed-kxJF3OHPz1cFayXFw9Xi').style.height = '1050px'; } var eventMethod_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F = window.addEventListener ? "addEventListener" : "attachEvent"; var eventer_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F = window[eventMethod_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F]; var messageEvent_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F = eventMethod_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F == "attachEvent" ? "onmessage" : "message"; function toggleModal_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F(url, shouldConfirmIfClosing) { var modal_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F = document.querySelector( '.modal-kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F' ); if (url) { if (modal_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F) { modal_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F.remove(); } var elem = document.createElement('div'); elem.className = "modal-kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F show-modal-kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F"; elem.innerHTML = ''; document.body.appendChild(elem); } else { if (modal_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F) { if (shouldConfirmIfClosing && !window.confirm('Are you sure want to leave? Your unsaved changes will be lost.')) { return; } modal_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F.remove(); } } } function windowOnClick_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F(event) { var modal_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F = document.querySelector( '.modal-kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F' ); if (event.target === modal_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F) { toggleModal_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F(null, true); } } window.addEventListener('click', windowOnClick_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F); function debounce_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F(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_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F(function(e) { const iframe = document.getElementById('miniExtensionsIframe-kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F'); if (false && 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: 'kxJF3OHPz1cFayXFw9Xi', }, '*'); } } }, 250)); eventer_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F(messageEvent_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F, function(e) { if (!e.data) return; if (e && e.data && e.data.type && e.data.type === 'miniExtensionsOpenUrl') { if (e.data.iframeMessageId != null && e.data.iframeMessageId !== 'tI4MXtOh0F') { 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-kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F').src = e.data.url; if (true || !(e.data.url.startsWith('https://app.miniextensions.com') || e.data.url.startsWith('http://localhost'))) { document.getElementById('miniExtensionsIframe-kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F').scrolling = 'yes'; } else { document.getElementById('miniExtensionsIframe-kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F').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 !== 'tI4MXtOh0F') { return; } const finalUrlObject = new URL(e.data.url); finalUrlObject.searchParams.append( 'iframeMessageId', 'DGwUIiuJvX' ); finalUrlObject.searchParams.append( 'iframeToCloseMessageId', 'tI4MXtOh0F' ); const finalUrl = finalUrlObject.toString(); toggleModal_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F(finalUrl, false); } else if (e && e.data && e.data.type && e.data.type === 'miniExtensionsCloseModalEditor') { if (e.data.iframeMessageId != null && e.data.iframeMessageId !== 'tI4MXtOh0F') { return; } toggleModal_kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F(null, false); } else if (e && e.data && e.data.type && e.data.type === 'reloadPortalDataAfterChange') { const iframe = document.getElementById('miniExtensionsIframe-kxJF3OHPz1cFayXFw9Xi_tI4MXtOh0F'); if (iframe && iframe.contentWindow && iframe.contentWindow.postMessage) { iframe.contentWindow.postMessage(e.data, '*'); } } }, false);