function isValidEmailAddress(e){return new RegExp(/^(("[\w-+\s]+")|([\w-+]+(?:\.[\w-+]+)*)|("[\w-+\s]+")([\w-+]+(?:\.[\w-+]+)*))(@((?:[\w-+]+\.)*\w[\w-+]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][\d]\.|1[\d]{2}\.|[\d]{1,2}\.))((25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\.){2}(25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\]?$)/i).test(e)}jQuery(document).ready(function(n){n(".oceanwp-newsletter-form-wrap #mc-embedded-subscribe-form").on("submit",function(e){e.preventDefault();var d=n(this),i=d.find(".email").val(),a=!0;if(d.find(".err-msg").hide(),0==n.trim(i).length?(a=!1,d.find(".email-err.req").show()):isValidEmailAddress(i)||(a=!1,d.find(".email-err.not-valid").show()),d.find(".gdpr").length&&!d.find(".gdpr").is(":checked")&&(a=!1,d.find(".gdpr-err.err-msg").show()),d.find(".res-msg").hide(),a){d.find("button").attr("disabled",!0);var s={action:"oceanwp_mailchimp_request",email:i};n.ajax({type:"POST",url:oceanwpLocalize.ajax_url,data:s,success:function(e){d.find("button").attr("disabled",!1),e.status?d.find(".res-msg.success").show().delay(5e3).fadeOut():d.find(".res-msg.failed").show().delay(5e3).fadeOut()},complete:function(){}})}})});