(function(window){ var replaceUrl = false; var url = new URL(window.location.href); var searchParams = new URLSearchParams(url.search); if ('undefined' === typeof window.kuuid) { setUuidParam(); } if ('undefined' === typeof window.kll) { setKllParam(); } if ('undefined' === typeof window.kref) { setKrefParam(); } setKaffParam(); if (replaceUrl) { window.history.replaceState( null, null, url.toString() ); } function getCookie(name) { var cookieRegex = '(?:(?:^|.*; *)' + name + ' *= *([^;]*).*$)|^.*$'; var cookie = document.cookie.match(cookieRegex)[1]; if (cookie) { return decodeURIComponent(cookie); } } function setCookie(name, value, options) { if (options && options.days) { options['max-age'] = options.days * 60 * 60 * 24; delete options.days; } var optionString = ''; Object.keys(options).map(function(key) { optionString += '; ' + key + '=' + options[key]; }); document.cookie = name + '=' + encodeURIComponent(value) + optionString + "; path=/; domain=" + getMainDomain(); } function getMainDomain() { var parts = document.domain.split('.').reverse(); var mainDomain = parts[1] + '.' + parts[0]; return mainDomain; } function generateUUID() { var d = new Date().getTime(); var d2 = ( 'undefined' !== typeof performance && performance.now && (performance.now() * 1000) ) || 0; return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { var r = Math.random() * 16; if (d > 0) { r = (d + r) % 16 | 0; d = Math.floor(d / 16); } else { r = (d2 + r) % 16 | 0; d2 = Math.floor(d2 / 16); } return ( c === 'x' ? r : (r & 0x3 | 0x8) ).toString(16); }); } function isInIframe() { try { return window.self !== window.top; } catch (e) { return true; } } function setUuidParam() { var inIframe = isInIframe(); var uuid; if (inIframe) { if (searchParams.has('kuid')) { uuid = searchParams.get('kuid'); } else { uuid = getCookie('kuuid'); if (!uuid) { uuid = generateUUID(); } } } else { uuid = getCookie('kuuid'); if (!uuid) { if (searchParams.has('kuid')) { uuid = searchParams.get('kuid'); } else { uuid = generateUUID(); } } } window.kuuid = uuid; if (searchParams.has('kuid')) { url.searchParams.delete('kuid'); replaceUrl = true; } } function setKllParam() { var kll = getCookie('kll'); if (!kll) { if (searchParams.has('kll')) { kll = searchParams.get('kll'); } } window.kll = kll; if (searchParams.has('kll')) { url.searchParams.delete('kll'); replaceUrl = true; } } function setKrefParam() { var referrer; var inIframe = isInIframe(); if (inIframe) { if (searchParams.has('referrer')) { referrer = searchParams.get('referrer'); } } else { referrer = (document.referrer && document.referrer.split('?')[0]) || ''; } if (searchParams.has('kref')) { referrer = searchParams.get('kref'); replaceUrl = true; url.searchParams.delete('kref'); } window.kref = referrer; } function setKaffParam() { if ( searchParams.has('kaff') && searchParams.has('kmid') ) { var affiliateHash = searchParams.get('kaff'); var memberHash = searchParams.get('kmid'); var cookieName = 'kaff_' + memberHash; url.searchParams.delete('kaff'); url.searchParams.delete('kmid'); setCookie( cookieName, affiliateHash, { path: '/', days: 30, secure: true, samesite: 'none', } ); replaceUrl = true; } } }(window)); var container_is_arrayeccbc87e4b5ce2fe28308fd9f2a7baf3 = 1; if (document.getElementsByClassName('kartra_optin_containereccbc87e4b5ce2fe28308fd9f2a7baf3').length != 0) { var kartra_containerseccbc87e4b5ce2fe28308fd9f2a7baf3 = document.getElementsByClassName('kartra_optin_containereccbc87e4b5ce2fe28308fd9f2a7baf3'); } else if (document.getElementsByClassName('kartra_optin_containerRWGjqJQ2CcrK').length != 0) { var kartra_containerseccbc87e4b5ce2fe28308fd9f2a7baf3 = document.getElementsByClassName('kartra_optin_containerRWGjqJQ2CcrK'); } else { var currentScript = document.currentScript || (function() { var scripts = document.getElementsByTagName('script'); return scripts[scripts.length - 1]; })(); var kartra_containerseccbc87e4b5ce2fe28308fd9f2a7baf3 = currentScript.parentNode; container_is_arrayeccbc87e4b5ce2fe28308fd9f2a7baf3 = 0 } function kartra_do_the_optin_formeccbc87e4b5ce2fe28308fd9f2a7baf3() { if (container_is_arrayeccbc87e4b5ce2fe28308fd9f2a7baf3 == 1) { for (i_optin_kartra = 0; i_optin_kartra < kartra_containerseccbc87e4b5ce2fe28308fd9f2a7baf3.length; i_optin_kartra++) { kartra_containerseccbc87e4b5ce2fe28308fd9f2a7baf3[i_optin_kartra].innerHTML = '\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ \ \ \ \ Register!\ \ \ \ \ '; } } else { kartra_containerseccbc87e4b5ce2fe28308fd9f2a7baf3.innerHTML = '\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Register!\ \ \ \ \ '; } } js_jquery = document.createElement('script'); js_jquery.type = 'text/javascript'; js_jquery.src = 'https://app.kartra.com/js/node_modules/kartra-jquery/jquery-1.10.2/jquery-1.10.2.min.js'; analytics_script = document.createElement('script'); analytics_script.type = 'text/javascript'; analytics_script.src = 'https://app.kartra.com/resources/js/analytics/QpL941ga'; santitation_script = document.createElement('script'); santitation_script.type = 'text/javascript'; santitation_script.src = 'https://app.kartra.com/js/santitation_for_naked_checkout.js'; js_jquery.onload = function() { if (typeof r_done !== 'undefined' && r_done === false) { return; } kartra_do_the_optin_formeccbc87e4b5ce2fe28308fd9f2a7baf3(); jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3 = jQuery.noConflict(true); if (jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('.form_eccbc87e4b5ce2fe28308fd9f2a7baf3_overlay').length) { var $videoIframe = jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('.form_eccbc87e4b5ce2fe28308fd9f2a7baf3_overlay iframe[data-video-type]'); //If there is an iframe with video, it should have it's src rewritten to not autoplay it's content until needed if ($videoIframe.length) { var src = $videoIframe.attr('src'), type = $videoIframe.attr('data-video-type'); if ($videoIframe.attr('src') !== '') { if (type === 'kartra') { var videoData = $videoIframe.attr('data-video'); if (typeof videoData === 'undefined') { videoData = $videoIframe.attr('data-playlist'); $videoIframe.attr('data-playlist', videoData.replace(/autoplay/g, 'autoplay=false&autoplaceholder')); } else { $videoIframe.attr('data-video', videoData.replace(/autoplay/g, 'autoplay=false&autoplaceholder')); } $videoIframe.attr('src', src.replace(/autoplay/g, 'autoplay=false&autoplaceholder')); } else { $videoIframe.attr('src', src.replace(/autoplay/g, 'noautoplay')); } } } } jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(document).ready(function() { var $optinForm = jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('.form_class_eccbc87e4b5ce2fe28308fd9f2a7baf3 form'); var $existingReferrerInput = $optinForm.find('input [name="referrer"]'); var $existingUuidInput = $optinForm.find('input [name="kuid"]'); var $existingAffiliateInput = $optinForm.find('input [name="kaff"]'); var urlParams = getUrlParams(); var kartraPage = getKartraPage(); var inIframe = isInIframe(); var referrer = ''; var affiliateData = ''; var uuid = window.kuuid; var searchParams = new URLSearchParams(window.location.search); var memberHash = $optinForm.attr('data-kt-owner') || ''; if (inIframe) { if ( 'undefined' !== typeof window.jsVars && 'undefined' !== typeof window.jsVars.current_trackable_asset ) { referrer = window.jsVars.current_trackable_asset; } else if (searchParams.has('referrer')) { referrer = searchParams.get('referrer'); } else { referrer = window.location.href.split('?')[0]; } affiliateData = searchParams.get('kaff'); } else { if (kartraPage) { referrer = kartraPage; } else { referrer = window.location.href.split('?')[0]; } affiliateData = memberHash && checkForAffiliate(memberHash); } jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3.each(urlParams, function(index, param) { var existingUrlParamInput = $optinForm.find('input [name="' + param.key + '"]'); if (!existingUrlParamInput.length) { $optinForm.append(''); } }); if (!$existingReferrerInput.length) { $optinForm.append(''); } if (!$existingUuidInput.length) { $optinForm.append(''); } if ( affiliateData && affiliateData !== '' ) { if ($existingAffiliateInput.length) { $existingAffiliateInput.val(affiliateData); } else { $optinForm.append(''); } } setTimeout(function(){ changeCaptchaColor(jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('.form_class_eccbc87e4b5ce2fe28308fd9f2a7baf3 form')); }, 1000); //Custom dropdown close jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(document).click(function(event) { if (jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(event.target).closest('.kartra_optin_selectpicker').length === 0 ) { jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('.kartra_optin_dropdown-menu').hide(); } }); //Custom dropdown open jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(document).on('click', '[data-toggle="kartra_dropdown"]', function() { jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(this).parent().find('.kartra_optin_dropdown-menu').show(); }); //Handle custom dropdown mimicking the selectpicker behaviour jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(document).on('click', '.kartra_optin_customDropdown li a', function(){ var $element = jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(this), $parent = $element.parents('li:first'), $bootstrapSelect = $element.parents('.kartra_optin_bootstrap-select:first'), $customDropdown = $element.parents('.kartra_optin_customDropdown:first'); if (!$parent.hasClass('disabled')) { var identifier = jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('span', $element).attr('data-for'), value = jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('span', $element).attr('data-value').toString(), text = jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('.text', $element).text(), selectedText = ''; if (identifier === 'country_code') { selectedText = '+' + value; } else { selectedText = text; } if (value !== '' && typeof value !== 'undefined') { jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('.kartra_optin_filter-option', $bootstrapSelect).text(selectedText).addClass('selected'); jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('input[name="' + identifier + '"]').val(value); jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('li', $customDropdown).removeClass('selected'); $parent.addClass('selected'); } $customDropdown.hide(); } }); jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(document).on('click', '.closecross, .js_kartra_optin_collapser', function(event) { jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('.form_class_eccbc87e4b5ce2fe28308fd9f2a7baf3 iframe').each(function(index, el) { var frameDOM = jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(this)[0]; var frameWindow = frameDOM.contentWindow ? frameDOM.contentWindow : frameDOM.contentDocument.defaultView; frameWindow.postMessage({"func":"pause"}, '*'); }); }); jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(document).on("click", ".kartra_optin_radio", function(){ jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3("[name='"+jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(this).attr("name")+"']").parents(".kartra_optin_radio_parent").removeClass("ez-selected").removeClass("kartra_optin-selected"); jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3("[name='"+jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(this).attr("name")+"']").each(function(index, element){ if (jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(element).is(":checked")) { jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(element).parents(".kartra_optin_radio_parent").addClass("ez-selected").addClass("kartra_optin-selected"); } }); }); jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(document).on("click", ".kartra_optin_chk", function(){ if (jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(this).is(":checked")) { jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(this).parents(".kartra_optin_chk_parent").addClass("ez-checked").addClass("kartra_optin-checked"); } else { jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(this).parents(".kartra_optin_chk_parent").removeClass("ez-checked").removeClass("kartra_optin-checked"); } }); jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('.form_class_eccbc87e4b5ce2fe28308fd9f2a7baf3 .close').on('click', function() { jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('.form_eccbc87e4b5ce2fe28308fd9f2a7baf3_overlay').fadeOut(); jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3("body").css('overflow',''); jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('html').css('overflow',''); jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('body').removeClass("kartra_body_reset"); }); jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(document).on('change', '#terms_eccbc87e4b5ce2fe28308fd9f2a7baf3', function() { var $tncCheck = jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(this), $form = $tncCheck.parents('.form_class_eccbc87e4b5ce2fe28308fd9f2a7baf3:first'), $submitButton = $form.find('.submit_button_eccbc87e4b5ce2fe28308fd9f2a7baf3, .kartra_optin_submit_btn'); kartra_validate_optin('eccbc87e4b5ce2fe28308fd9f2a7baf3'); }); jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('.js_gdpr_terms_check').on("change", function() { kartra_validate_optin('eccbc87e4b5ce2fe28308fd9f2a7baf3'); }); jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('.js_gdpr_communications_check').on("change", function() { kartra_validate_optin('eccbc87e4b5ce2fe28308fd9f2a7baf3'); }); jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(document).on("click", '.show_modal_eccbc87e4b5ce2fe28308fd9f2a7baf3,.show_modal_own_eccbc87e4b5ce2fe28308fd9f2a7baf3', function(){ if (jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('.form_eccbc87e4b5ce2fe28308fd9f2a7baf3_overlay:first').attr('data-autoplay-triggered') !== 'true') { jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('.form_eccbc87e4b5ce2fe28308fd9f2a7baf3_overlay:first').attr('data-autoplay-triggered', 'true'); var $videoIframe = jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('.form_eccbc87e4b5ce2fe28308fd9f2a7baf3_overlay:first iframe[data-video-type]'); if ($videoIframe.length) { var src = $videoIframe.attr('src'), type = $videoIframe.attr('data-video-type'); if ($videoIframe.attr('src') !== '' && src.indexOf('autop') > -1) { if (type === 'kartra') { var videoData = $videoIframe.attr('data-video'); if (typeof videoData === 'undefined') { videoData = $videoIframe.attr('data-playlist'); $videoIframe.attr('data-playlist', videoData.replace(/autoplay=false&/g, '')); $videoIframe.attr('data-playlist', videoData.replace(/autoplaceholder/g, 'autoplay')); } else { $videoIframe.attr('data-video', videoData.replace(/autoplay=false&/g, '')); $videoIframe.attr('data-video', videoData.replace(/autoplaceholder/g, 'autoplay')); } $videoIframe.attr('src', src.replace(/autoplay=false&/g, '')); $videoIframe.attr('src', src.replace(/autoplaceholder/g, 'autoplay')); } else { $videoIframe.attr('src', src.replace(/noautoplay/g, 'autoplay')); } } } } jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('.form_eccbc87e4b5ce2fe28308fd9f2a7baf3_overlay:first').show(); // trigger the analytics - start jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('.form_eccbc87e4b5ce2fe28308fd9f2a7baf3_overlay:first').attr('id', 'form_eccbc87e4b5ce2fe28308fd9f2a7baf3_overlay_shown'); var elem = document.getElementById('form_eccbc87e4b5ce2fe28308fd9f2a7baf3_overlay_shown'); var event = new Event('kartra_show_hidden_asset'); elem.dispatchEvent(event); jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('.form_eccbc87e4b5ce2fe28308fd9f2a7baf3_overlay:first').removeAttr('id'); // trigger the analytics - end jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3("html").css('overflow','hidden'); jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('body').addClass("kartra_body_reset"); adjustFormByResolution(); }); jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3('[data-screenshot="true"]').each(function() { var src = jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(this).attr('data-thumbnail'); jquery_eccbc87e4b5ce2fe28308fd9f2a7baf3(this).html('