/* MOONBACK AS A SERVICE 1.54 */ moonback_config.launch_url = 'https://spaceship.moonback.me/record?source=maas&app_id=963e53495493559d84161016efbd3f0b354d9be382b5376ea29a892d4d6475e8&email=&hash='; var MoonBackMaaS = (function () { 'use strict'; var Constructor = function () { var mb = {}, moonback_config = []; var trigger, iframe; var autoreset = false; var debug = function (message) { if (moonback_config.console_debug) { console.log(message); } }; var load_css = function() { var S = document.createElement('style'); S.innerHTML="" + "\n"; S.innerHTML+="*,::before,::after { box-sizing:border-box }" + "\n"; S.innerHTML+=".mb-backdrop { top:0;left:0;width:100%;height:100%;z-index:7000;position:fixed;overflow-x:hidden;overflow-y:auto;background:rgba(0,0,0,0.75);opacity:1;animation-name:mbfadeIn;animation-duration:.4s;animation-fill-mode:forwards }" + "\n"; S.innerHTML+=".mb-overlay { text-align:center;position:absolute;width:100%;height:100%;left:0;top:0 }" + "\n"; S.innerHTML+=".mb-overlay:before { content:'';display:inline-block;height:100%;vertical-align:middle }" + "\n"; S.innerHTML+=".mb-overlay__container { width:100%;position:relative;display:inline-block;vertical-align:middle;margin:0 auto;text-align:left;z-index:8000;padding:0 15px }" + "\n"; S.innerHTML+=".mb-overlay__content { position:relative;background:transparent;width:auto;margin:15px auto;width:100%;max-width:480px;animation-name:mbfadeZoomIn;animation-duration:.4s;opacity:1;animation-fill-mode:forwards;animation-timing-function:cubic-bezier(0.075,0.82,0.165,1) }" + "\n"; S.innerHTML+=".mb-overlay-close { padding:0;background:none;position:absolute;top:2px;right:-30px;display:block;width:15px;height:15px;z-index:1;border:0;color:#eee;background-size:100%;background-repeat:no-repeat;background-position:100% 0;background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDIxLjkgMjEuOSIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjEuOSAyMS45IiB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4Ij4KICA8cGF0aCBkPSJNMTQuMSwxMS4zYy0wLjItMC4yLTAuMi0wLjUsMC0wLjdsNy41LTcuNWMwLjItMC4yLDAuMy0wLjUsMC4zLTAuN3MtMC4xLTAuNS0wLjMtMC43bC0xLjQtMS40QzIwLDAuMSwxOS43LDAsMTkuNSwwICBjLTAuMywwLTAuNSwwLjEtMC43LDAuM2wtNy41LDcuNWMtMC4yLDAuMi0wLjUsMC4yLTAuNywwTDMuMSwwLjNDMi45LDAuMSwyLjYsMCwyLjQsMFMxLjksMC4xLDEuNywwLjNMMC4zLDEuN0MwLjEsMS45LDAsMi4yLDAsMi40ICBzMC4xLDAuNSwwLjMsMC43bDcuNSw3LjVjMC4yLDAuMiwwLjIsMC41LDAsMC43bC03LjUsNy41QzAuMSwxOSwwLDE5LjMsMCwxOS41czAuMSwwLjUsMC4zLDAuN2wxLjQsMS40YzAuMiwwLjIsMC41LDAuMywwLjcsMC4zICBzMC41LTAuMSwwLjctMC4zbDcuNS03LjVjMC4yLTAuMiwwLjUtMC4yLDAuNywwbDcuNSw3LjVjMC4yLDAuMiwwLjUsMC4zLDAuNywwLjNzMC41LTAuMSwwLjctMC4zbDEuNC0xLjRjMC4yLTAuMiwwLjMtMC41LDAuMy0wLjcgIHMtMC4xLTAuNS0wLjMtMC43TDE0LjEsMTEuM3oiIGZpbGw9IiNGRkZGRkYiLz4KPC9zdmc+Cg==) }" + "\n"; S.innerHTML+=".mb-overlay-close:hover,.mb-overlay-close:focus,.mb-overlay-close:active { outline:none;cursor:pointer }" + "\n"; S.innerHTML+=".no-scroll { overflow:hidden }" + "\n"; document.body.appendChild(S); }; var createCSSSelector = function(selector, style) { if (!document.styleSheets) return; if (document.getElementsByTagName('head').length == 0) return; var styleSheet,mediaType; if (document.styleSheets.length > 0) { for (var i = 0, l = document.styleSheets.length; i < l; i++) { if (document.styleSheets[i].disabled) continue; var media = document.styleSheets[i].media; mediaType = typeof media; if (mediaType === 'string') { if (media === '' || (media.indexOf('screen') !== -1)) { styleSheet = document.styleSheets[i]; } } else if (mediaType=='object') { if (media.mediaText === '' || (media.mediaText.indexOf('screen') !== -1)) { styleSheet = document.styleSheets[i]; } } if (typeof styleSheet !== 'undefined') break; } } if (typeof styleSheet === 'undefined') { var styleSheetElement = document.createElement('style'); styleSheetElement.type = 'text/css'; document.getElementsByTagName('head')[0].appendChild(styleSheetElement); for (i = 0; i < document.styleSheets.length; i++) { if (document.styleSheets[i].disabled) { continue; } styleSheet = document.styleSheets[i]; } mediaType = typeof styleSheet.media; } if (mediaType === 'string') { for (var i = 0, l = styleSheet.rules.length; i < l; i++) { if(styleSheet.rules[i].selectorText && styleSheet.rules[i].selectorText.toLowerCase()==selector.toLowerCase()) { styleSheet.rules[i].style.cssText = style; return; } } styleSheet.addRule(selector,style); } else if (mediaType === 'object') { var styleSheetLength = (styleSheet.cssRules) ? styleSheet.cssRules.length : 0; for (var i = 0; i < styleSheetLength; i++) { if (styleSheet.cssRules[i].selectorText && styleSheet.cssRules[i].selectorText.toLowerCase() == selector.toLowerCase()) { styleSheet.cssRules[i].style.cssText = style; return; } } styleSheet.insertRule(selector + '{' + style + '}', styleSheetLength); } } var load_trigger = function() { trigger = document.querySelector(moonback_config.element); if (!moonback_config.element || !trigger) { var mback_trigger = document.createElement ( "img" ); mback_trigger.className = "mback_trigger"; mback_trigger.src = "https://moonback.me/img/favicon/favicon-32x32.png"; var mback_js = document.querySelector('#mbackjs'); if (!mback_js) debug("[MoonBack] ERROR = Wrong snippet, missing mback_js and element to trigger action, please do not modify what you have to copy ;-)"); mback_js.parentNode.insertBefore(mback_trigger, mback_js); moonback_config.element = '.mback_trigger'; trigger = document.querySelector(moonback_config.element); } } var load_modal = function() { trigger.addEventListener('click', function(e){ e.preventDefault(); // Load modal first time if ( document.getElementById('mback_modal') == null ) { var div = document.createElement('div'); div.id = 'mback_modal'; div.innerHTML = '
'; div.style.display = 'none'; document.body.appendChild(div); } var mback_modal = document.getElementById('mback_modal'); // Load iFrame first time iframe = document.getElementById('mback_iframe_el'); if ( iframe.getAttribute("src") != "" ) { debug("[MoonBack] iFrame already loaded"); } else { if (!moonback_config.launch_url) { debug("[MoonBack] ERROR = Wrong snippet, missing launch_url, please do noy modify what you have to copy ;-)"); } else { iframe.onload = function() { debug("iframeresize"); iFrameResize({ log: false, inPageLinks: true, checkOrigin: false, heightCalculationMethod: 'max', initCallback: function(){ window.scrollTo(0,0); }, }, '#mback_iframe_el'); }; var url = new URL(moonback_config.launch_url); url.searchParams.append('maas_config', encodeURIComponent(JSON.stringify(moonback_config))); iframe.setAttribute("src", url.href); } } // Close triggers var mback_close = document.getElementById('js-mb-overlay-close'); mback_close.addEventListener('click', function() { modal_close(false); }); document.addEventListener('keydown', function (e) { if (e.keyCode === 27) { modal_close(false); } }); document.getElementById('js-mb-backdrop').addEventListener('click', function(e){ if(e.target.classList.contains('mb-overlay') || e.target.classList.contains('mb-overlay__container')) { modal_close(false); } }); mback_modal.style.display = 'block'; }); debug("[MoonBack] ready!"); } var load_listener = function() { window.addEventListener("message", (event) => { let origin = event.origin || event.originalEvent.origin if (typeof moonback_config.callback === 'function' && event.data.json && event.data.json.created_at > 0) { debug('[MoonBack] callback called, MoonBack data is yours!'); moonback_config.callback(event.data.json); if (event.data.close) { modal_close(true); mback_modal.style.display = 'none'; } else { autoreset = true; } } }, false); } var modal_close = function(reset) { mback_modal.style.display = 'none'; if (reset || autoreset) document.getElementById('mback_iframe_el').setAttribute("src", ""); } var launch = function() { load_css(); load_trigger(); load_modal(); load_listener(); }; mb.init = function(c) { moonback_config = c || []; window.addEventListener('load', function() { debug('[MoonBack] script loaded, ready to start'); launch(); }); }; return mb; }; return Constructor; })(); /*! iFrame Resizer (iframeSizer.min.js ) - v4.3.2 - 2021-10-18 */ !function(u){var f,l,a,x,M,I,k,r,m,F,i,g,z;function h(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function O(e,n,i){e.addEventListener(n,i,!1)}function R(e,n,i){e.removeEventListener(n,i,!1)}function o(e){return M+"["+(e="Host page: "+(n=e),e=window.top!==window.self?window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+n:"Nested host page: "+n:e)+"]";var n}function t(e){return F[e]?F[e].log:l}function T(e,n){s("log",e,n,t(e))}function E(e,n){s("info",e,n,t(e))}function N(e,n){s("warn",e,n,!0)}function s(e,n,i,t){!0===t&&"object"==typeof window.console&&console[e](o(n),i)}function e(n){function i(){t("Height"),t("Width"),L(function(){A(y),H(v),l("onResized",y)},y,"init")}function e(){var e=b.substr(I).split(":"),n=e[1]?parseInt(e[1],10):0,i=F[e[0]]&&F[e[0]].iframe,t=getComputedStyle(i);return{iframe:i,id:e[0],height:n+function(e){if("border-box"!==e.boxSizing)return 0;var n=e.paddingTop?parseInt(e.paddingTop,10):0,e=e.paddingBottom?parseInt(e.paddingBottom,10):0;return n+e}(t)+function(e){if("border-box"!==e.boxSizing)return 0;var n=e.borderTopWidth?parseInt(e.borderTopWidth,10):0,e=e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0;return n+e}(t),width:e[2],type:e[3]}}function t(e){var n=Number(F[v]["max"+e]),i=Number(F[v]["min"+e]),t=e.toLowerCase(),e=Number(y[t]);T(v,"Checking "+t+" is in range "+i+"-"+n),eF[s]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}s in F&&"iFrameResizer"in t?N(s,"Ignored iFrame, already setup."):(o(e),function(){switch(T(s,"IFrame scrolling "+(F[s]&&F[s].scrolling?"enabled":"disabled")+" for "+s),t.style.overflow=!1===(F[s]&&F[s].scrolling)?"hidden":"auto",F[s]&&F[s].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=F[s]?F[s].scrolling:"no"}}(),c("Height"),c("Width"),d("maxHeight"),d("minHeight"),d("maxWidth"),d("minWidth"),"number"!=typeof(F[s]&&F[s].bodyMargin)&&"0"!==(F[s]&&F[s].bodyMargin)||(F[s].bodyMarginV1=F[s].bodyMargin,F[s].bodyMargin=F[s].bodyMargin+"px"),n(q(s)),F[s]&&(F[s].iframe.iFrameResizer={close:C.bind(null,F[s].iframe),removeListeners:p.bind(null,F[s].iframe),resize:B.bind(null,"Window resize","resize",F[s].iframe),moveToAnchor:function(e){B("Move to anchor","moveToAnchor:"+e,F[s].iframe,s)},sendMessage:function(e){B("Send Message","message:"+(e=JSON.stringify(e)),F[s].iframe,s)}}))}function c(e,n){null===i&&(i=setTimeout(function(){i=null,e()},n))}function n(){"hidden"!==document.visibilityState&&(T("document","Trigger event: Visibility change"),c(function(){w("Tab Visible","resize")},16))}function w(i,t){Object.keys(F).forEach(function(e){var n;F[n=e]&&"parent"===F[n].resizeFrom&&F[n].autoResize&&!F[n].firstRun&&B(i,t,F[e].iframe,e)})}function b(){O(window,"message",e),O(window,"resize",function(){var e;T("window","Trigger event: "+(e="resize")),c(function(){w("Window "+e,"resize")},16)}),O(document,"visibilitychange",n),O(document,"-webkit-visibilitychange",n)}function y(){function t(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected