(function () { document.addEventListener("DOMContentLoaded", () => { var widgetScript = document.getElementById("ee-inquiry-form-widget"); if (widgetScript) { var buttonNode = document.createElement('button'); buttonNode.setAttribute('type', 'button'); buttonNode.setAttribute('style', 'background-color: #31A1A1; color: #FFFFFF; border-radius: 6px;-webkit-text-size-adjust: 100%;-webkit-tap-highlight-color: transparent;box-sizing: border-box;margin: 0;text-transform: none;-webkit-appearance: button;display: inline-block;padding: 0.375rem 0.75rem;font-size: 1rem;font-weight: 400;line-height: 1.5;text-align: center;text-decoration: none;vertical-align: middle;user-select: none;border: 1px solid transparent;transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;cursor: pointer;'); buttonNode.innerText = 'Book Your Event'; buttonNode.onclick = (e) => { var providerHash = 'UDU4bjM2S2ZGNUUrWFB3VDNEeSt2dW91bnE0d3hXYW9NNzhBY2MwUlBLWGNyTnEwcGJ6MGhZRzcxa3dSQ2FySA'; var widgetOrigin = 'https://eventective.com'; var widgetSrc = widgetOrigin + '/providerwidget/widget/frame/' + providerHash; var widgetFrameWrapper = document.getElementById('ee-inquiry-form-widget-wrapper'); if (widgetFrameWrapper !== null) { widgetFrameWrapper.remove(); widgetFrameWrapper = null; } widgetFrameWrapper = document.createElement('div'); widgetFrameWrapper.setAttribute('id', 'ee-inquiry-form-widget-wrapper') widgetFrameWrapper.setAttribute('style', 'background-color: transparent; overflow: hidden;'); var widgetFrame = document.getElementById('ee-inquiry-form-widget-frame'); if (widgetFrame !== null) { widgetFrame.remove(); widgetFrame = null; } widgetFrame = document.createElement('iframe'); widgetFrame.setAttribute('id', 'ee-inquiry-form-widget-frame'); widgetFrame.setAttribute('src', widgetSrc); widgetFrame.setAttribute('allowtransparency', 'true'); widgetFrame.setAttribute('style', 'z-index:9999; display: block; position: absolute; inset: 0px; width: 100%; height: 100%; overflow-y: auto; border: 0px; margin: 0px; padding: 0px; background: transparent;'); widgetFrame.setAttribute('frameborder', '0'); widgetFrame.onload = (e) => { if (e && e.currentTarget && e.currentTarget.contentWindow) { e.currentTarget.contentWindow.postMessage('Message Pump Setup', widgetOrigin); // setup msg pump } } widgetFrameWrapper.append(widgetFrame); document.body.appendChild(widgetFrameWrapper); }; widgetScript.after(buttonNode); window.addEventListener('message', (evt) => { if (evt.source === window) return; var origin = evt.origin.toLowerCase(); if (origin !== 'https://eventective.com' && origin !== 'http://eventective.com') return; try { var msg = JSON.parse(evt.data); if (msg) { if (msg.messageType) { if (msg.messageType === 'dialogClose') { var widgetFrameWrapper = document.getElementById('ee-inquiry-form-widget-wrapper'); if (widgetFrameWrapper !== null) { widgetFrameWrapper.remove(); } } else if (msg.messageType === 'formDisplayed') { var dataLayer = window.dataLayer = window.dataLayer || []; dataLayer.push({'event': 'EventectiveFormDisplayed'}); } else if (msg.messageType === 'formSubmitted') { var dataLayer = window.dataLayer = window.dataLayer || []; dataLayer.push({'event': 'EventectiveFormSubmitted'}); } } } } catch(e){} }); } }); })();