!function(u){"use strict";u.ajaxChimp={responses:{"Thank you! You have subscribed successfully.":0,"Please enter a value":1,"An email address must contain a single @":2,"The domain portion of the email address is invalid (the portion after the @: )":3,"The username portion of the email address is invalid (the portion before the @: )":4,"This email address looks fake or invalid. Please enter a real email address":5},translations:{en:null},init:function(a,s){u(a).ajaxChimp(s)}},u.fn.ajaxChimp=function(e){return u(this).each(function(a,s){var i=u(s),r=i.find("input[type=email]"),t=i.find("label[for="+r.attr("id")+"]"),l=u.extend({url:i.attr("action"),language:"en"},e),o=l.url.replace("/post?","/post-json?").concat("&c=?");i.attr("novalidate","true"),r.attr("name","EMAIL"),i.submit(function(){var e,n={},a=i.serializeArray();u.each(a,function(a,s){n[s.name]=s.value}),u.ajax({url:o,data:n,success:function(s){if("success"===s.result)e=s.msg,t.removeClass("error").unwrap().wrap("<div class='success'></div>"),r.removeClass("error").addClass("valid");else{r.removeClass("valid").addClass("error"),t.removeClass("valid").unwrap().wrap("<div class='error'></div>");try{var a=s.msg.split(" - ",2);e=void 0!==a[1]&&parseInt(a[0],10).toString()===a[0]?(a[0],a[1]):s.msg}catch(a){e=s.msg}}"en"!==l.language&&void 0!==u.ajaxChimp.responses[e]&&u.ajaxChimp.translations&&u.ajaxChimp.translations[l.language]&&u.ajaxChimp.translations[l.language][u.ajaxChimp.responses[e]]&&(e=u.ajaxChimp.translations[l.language][u.ajaxChimp.responses[e]]),t.html(e),t.show(),l.callback&&l.callback(s)},dataType:"jsonp",error:function(a,s){console.log("mailchimp ajax submit error: "+s)}});var s="Submitting...";return"en"!==l.language&&u.ajaxChimp.translations&&u.ajaxChimp.translations[l.language]&&u.ajaxChimp.translations[l.language].submit&&(s=u.ajaxChimp.translations[l.language].submit),t.unwrap().wrap("<div class='success'></div>").html(s).show(),!1})}),this}}(jQuery);

(function($){
    "use strict";
    
    $("#mailchimp").find(".newsletter-field").first().attr("id", "newsletter_field")
    $("#subscribe-result").html("<label for='newsletter_field'></label>");
    $("#mailchimp").ajaxChimp({
        url: "https://bestlooker.us10.list-manage.com/subscribe/post?u=e16312d09b1b43f5c26fc526c&id=195aaab5cb" //Replace this with your own mailchimp post URL. 
    });
    
})(jQuery);
