!function(e){"use strict";e(document).ready(function(){function t(){var t=e(".featured-posts-left .featured-post-item"),h=e(".featured-posts-right .featured-post-item"),i=e(".featured-post-item.main-post .featured-post-image");t.length>0&&t.eq(0).css({"min-height":"",height:""}),t.length>1&&t.eq(1).css({"min-height":"",height:""}),h.length>0&&h.eq(0).css({"min-height":"",height:""}),h.length>1&&h.eq(1).css({"min-height":"",height:""});var g=i.length?i.outerHeight()-30:0;if(t.length>0||h.length>0){var n=t.length>0?t.eq(0).outerHeight():0,s=h.length>0?h.eq(0).outerHeight():0,a=Math.max(n,s,g);g>0&&(a=n&&n0&&t.eq(0).css({"min-height":a+"px",height:""}),h.length>0&&h.eq(0).css({"min-height":a+"px",height:""})}if(t.length>1||h.length>1){var o=t.length>1?t.eq(1).outerHeight():0,r=h.length>1?h.eq(1).outerHeight():0,u=Math.max(o,r);t.length>1&&t.eq(1).css({"min-height":u+"px",height:""}),h.length>1&&h.eq(1).css({"min-height":u+"px",height:""})}}var h;t(),e(window).on("resize",function(){clearTimeout(h),h=setTimeout(function(){t()},100)})})}(jQuery);;
!function(){"use strict";document.addEventListener("keydown",function(e){"Escape"===e.key&&(document.getElementById("signup-modal").classList.remove("active"),document.body.style.overflow="auto")}),jQuery(document).ready(function(e){jQuery(document).on("click",".open-signup-modal",function(){jQuery(this).parents(".giveaway-posts-item").find(".signup-modal").addClass("active"),jQuery("body").addClass("off-scroll")}),jQuery(document).on("click",".signup-modal-close",function(){jQuery(this).parents(".signup-modal").removeClass("active"),jQuery("body").removeClass("off-scroll")}),e(".giveaway-posts-signup-modal").each(function(){const n=e(this),i=n.find(".vmg-newsletter-form__form");i.on("submit",function(e){e.preventDefault();const a=i.find('input[name="email"]').val(),t=i.find('input[name="zip"]').val(),s=i.find('input[name="first-name"]').val(),o=i.find('input[name="last-name"]').val(),l=i.find('input[name="newsletters"]').val(),r=i.find('input[name="category"]').val(),c=grecaptcha.getResponse();if(!(a&&t&&s&&o))return void alert("Please fill in all fields");if(""===a.replace(/\s/g,"")||""===t.replace(/\s/g,"")||""===s.replace(/\s/g,"")||""===o.replace(/\s/g,""))return void alert("Please fill in all fields");if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a))return void alert("Please enter a valid email address");if(!c)return void alert("Please complete the reCAPTCHA verification.");const d={[l]:1},u={source_description:r,source_primary:"Website-Local",source_sub:"Sign Up Widget",first_name:s,last_name:o,postal_code:t,full_name:s+" "+o,product_level:"Subscriber",account_created:`${(new Date).getTime()}`};Sailthru.integration("userSignUp",{email:a,lists:d,vars:u,source:"Website-Local|Sign Up Widget|"+r,onSuccess:function(e){n.find(".step-1").addClass("hidden"),n.find(".step-2").removeClass("hidden")},onError:function(e){console.error(e.error)}})}),n.find(".signup-form-widget-close").on("click",function(){n.removeClass("active"),jQuery("body").removeClass("off-scroll"),i.find('input[name="email"]').val(""),i.find('input[name="zip"]').val(""),i.find('input[name="first-name"]').val(""),i.find('input[name="last-name"]').val("")})})})}(jQuery);;