1function trackGoals(){mida.fetch("/test/goal","POST",{k:window._h_key},e=>{try{var o=JSON.parse(e);o&&o.length&&o.forEach(e=>{var o={goal_id:e.id,goal_type:e.type,goal_value:e.value,test_key:e.key};switch(o.goal_type){case"pageview":case"pageviewExact":case"pageviewWildcard":case"pageviewRegex":handlePageviewGoal(o);break;case"scrolling":handleScrollingGoal(o);break;case"duration":handleDurationGoal(o);break;case"clickOnElement":handleClickOnElementGoal(o);break;case"clickOnText":handleClickOnTextGoal(o);break;case"externalLink":handleExternalLinkGoal(o);break;case"formSubmit":handleFormSubmitGoal(o);break;case"revenue":handleRevenueGoal(o);break;case"elementAppears":handleElementAppearsGoal(o)}})}catch(e){console.error("Error in trackGoals:",e)}})}function handleRevenueGoal(e){window._revenueGoals||(window._revenueGoals=[]),window._revenueGoals.push({goal_id:e.goal_id,test_key:e.test_key,goal_value:e.goal_value})}function handlePageviewGoal(e){let o=!1,a=!1,r=!1,t=!1;try{var n=new URL(e.goal_value.startsWith("http")?e.goal_value:"https://"+e.goal_value),i=new URL(window.location.href);o=removeWww(i.hostname+i.pathname)===removeWww(n.hostname+n.pathname),r=removeWww(i.href)===removeWww(n.href)}catch(e){o=!1,r=!1}if(a=regexMatchURL(removeProtocol(removeWww(window.location.href)),removeProtocol(removeWww(e.goal_value))),"pageviewRegex"===e.goal_type)try{var l=new RegExp(e.goal_value);t=l.test(window.location.href)}catch(e){t=!1}"pageviewExact"===e.goal_type&&(o=!1,a=!1,t=!1),"pageviewWildcard"===e.goal_type&&(o=!1,t=!1),"pageviewRegex"===e.goal_type&&(o=!1,a=!1,r=!1),(o||r||a||t)&&(e.goal_id&&mida.track("goal_"+e.goal_id),mida.converted(e.test_key),"function"==typeof window.firePageviewConversion)&&window.firePageviewConversion(e.goal_id)}function handleScrollingGoal(e){window._scrollGoals||(window._scrollGoals=[]),window._scrollGoals.push({percentage:Number(e.goal_value),goalId:e.goal_id,testKey:e.test_key,converted:!1}),1===window._scrollGoals.length&&(document.onscroll=()=>{var e=scrollPerc(document.body),o=Math.round(e);window._scrollGoals.forEach(e=>{o>=e.percentage&&!e.converted&&(e.converted=!0,e.goalId&&mida.track("goal_"+e.goalId),mida.converted(e.testKey))})})}function handleDurationGoal(e){var o=e.goal_value;setTimeout(()=>{e.goal_id&&mida.track("goal_"+e.goal_id),mida.converted(e.test_key)},1e3*o)}function fireClickGoalOnce(e){e.fired||(e.fired=!0,e.goal_id&&mida.track("goal_"+e.goal_id),mida.converted(e.test_key))}function midaDelegatedGoalHandler(e){var o=window._midaClickGoals;if(o&&o.length){var a=e.target;if(a&&1===a.nodeType)for(var r=0;r<o.length;r++){var t=o[r];if(!t.fired)try{t.matcher(a)&&fireClickGoalOnce(t)}catch(e){console.error("Error evaluating click goal matcher:",t.goal_id||t.test_key,e)}}}}function initClickGoalDelegation(){window._midaClickGoalDelegationInit||(window._midaClickGoalDelegationInit=!0,document.addEventListener("click",midaDelegatedGoalHandler,!0),document.addEventListener("touchend",midaDelegatedGoalHandler,!0))}function registerClickGoal(e,o){window._midaClickGoals.push({goal_id:e.goal_id,test_key:e.test_key,fired:!1,matcher:o}),initClickGoalDelegation()}function handleClickOnElementGoal(e){var o=cleanSel(e.goal_value);registerClickGoal(e,function(e){return!(!e.closest||!e.closest(o))})}function handleClickOnTextGoal(e){var a=e.goal_value.trim().toLowerCase();registerClickGoal(e,function(e){for(var o=e;o&&1===o.nodeType;){if((o.textContent||"").trim().toLowerCase()===a)return!0;o=o.parentElement}return!1})}function handleExternalLinkGoal(e){var o=e.goal_value;registerClickGoal(e,function(e){return!!e.closest&&!!(e=e.closest("a[href]"))&&-1!==(e.getAttribute("href")||"").indexOf(o)})}
1function formMatchesSelector(e,o){if(e&&e.matches)try{if("FORM"===e.tagName&&e.matches(o))return!0;if(e.closest&&e.closest(o))return!0;if(e.querySelector){var a=e.querySelector(o);if(a&&/^(submit|image)$/i.test(a.type||""))return!0}}catch(e){console.error("Error evaluating form submit selector:",o,e)}return!1}function goalMatchesGravityFormId(e,o){return!(!e||!o||"form"!==e.selector&&-1===e.selector.indexOf("gform_"+o))}function fireFormSubmitGoals(a,r){window._midaFormSubmitGoals&&window._midaFormSubmitGoals.forEach(function(e){var o=!1;(o=a&&formMatchesSelector(a,e.selector)||!a&&r&&goalMatchesGravityFormId(e,r)?!0:o)&&(e.goal_id&&mida.track("goal_"+e.goal_id),mida.converted(e.test_key))})}function isGravityFormIframeSuccess(e,o){try{var a=e.contentDocument;if(!a||!a.body)return!1;var r=a.body.innerHTML||"";if(0<=r.indexOf("GF_AJAX_POSTBACK"))return!0;if(a.getElementById("gform_confirmation_wrapper_"+o))return!0;if(0<=r.indexOf("gform_confirmation_message"))return!0;if(0<=r.indexOf("window.top")&&/thank\s*you|has\s+been\s+received|we will be in touch/i.test(r))return!0}catch(e){}return!1}function hookGravityFormIframe(e){var o;e.id&&0===e.id.indexOf("gform_ajax_frame_")&&!e.dataset.midaGfIframeHooked&&(e.dataset.midaGfIframeHooked="true",o=e.id.replace("gform_ajax_frame_",""),e.addEventListener("load",function(){isGravityFormIframeSuccess(e,o)&&fireFormSubmitGoals(document.getElementById("gform_"+o),o)}))}function bindGravityFormIframes(){document.querySelectorAll('iframe[id^="gform_ajax_frame_"]').forEach(hookGravityFormIframe)}function initFormSubmitListeners(){window._midaFormSubmitListenersInit||(window._midaFormSubmitListenersInit=!0,document.addEventListener("submit",function(e){fireFormSubmitGoals(e.target)},!0),window.jQuery&&window.jQuery(document).on("submit_success",".elementor-form",function(e){fireFormSubmitGoals((e.target&&e.target.closest?e.target.closest("form"):null)||e.target)}),bindGravityFormIframes())}function handleFormSubmitGoal(e){var o=cleanSel(e.goal_value);window._midaFormSubmitGoals||(window._midaFormSubmitGoals=[]),window._midaFormSubmitGoals.push({selector:o,goal_id:e.goal_id,test_key:e.test_key}),initFormSubmitListeners(),setTimeout(bindGravityFormIframes,500),!window._midaFormSubmitObserver&&document.body&&(window._midaFormSubmitObserver=new MutationObserver(bindGravityFormIframes),window._midaFormSubmitObserver.observe(document.body,{childList:!0,subtree:!0}))}function regexMatchURL(e,o){o="^"+o.replace(/\?/g,"\\?").replace(/\//g,"\\/").replace(/(\*|\%)/g,".*")+"$";o=new RegExp(o);return null!==e.match(o)}function removeWww(e){return"string"==typeof e?e.replace(/\/\/www\./g,"//").replace(/\/$/g,""):e}function removeProtocol(e){return e.replace(/(^\w+:|^)\/\//,"")}function cleanSel(e){return e.replace(/\#[0-9]/,function(e){return e.replace("#","#\\3")}).replace(/\.[0-9]/,function(e){return e.replace(".",".\\3")})}function scrollPerc(e){var o=e.parentNode;return(e.scrollTop||o.scrollTop)/(o.scrollHeight-o.clientHeight)*100}function handleElementAppearsGoal(o){var a=!1,e=0,r=!1;function t(){a||(a=!0,o.goal_id&&mida.track("goal_"+o.goal_id),mida.converted(o.test_key))}try{document.querySelector(cleanSel(o.goal_value))&&(t(),r=!0)}catch(e){console.error("Error checking for element:",e)}if(!r){var n=null;try{(n=new MutationObserver(function(e){if(!a)try{document.querySelector(cleanSel(o.goal_value))&&(t(),n)&&(n.disconnect(),n=null)}catch(e){console.error("Error in MutationObserver:",e)}})).observe(document.body,{childList:!0,subtree:!0,attributes:!1})}catch(e){console.error("Error setting up MutationObserver:",e)}var i=setInterval(function(){if(a)clearInterval(i),n&&(n.disconnect(),n=null);else{e+=100;try{document.querySelector(cleanSel(o.goal_value))&&(t(),clearInterval(i),n)&&(n.disconnect(),n=null)}catch(e){console.error("Error checking for element:",e)}6e4<=e&&(clearInterval(i),n)&&(n.disconnect(),n=null)}},100)}}window._midaClickGoals=window._midaClickGoals||[],trackGoals();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.