ruạṛ
!function(){"use strict";function a(){void 0!==window.jQuery&&(window.ml_jQuery=window.jQuery.noConflict(!0)),c()}function b(a,b){if("function"==typeof window.ml_webform_after_success&&window.ml_webform_after_success(),!a.data("continue")&&!a.data("redirect")){var c="ml_webform_success_"+b.attr("id").substr(5);"function"==typeof window[c]?(window[c](),d()):(b.find(".ml-block-success").show(),b.find(".ml-block-form").hide())}window!=window.parent&&window.parent.postMessage("mlWebformSubmitSuccess-"+b.attr("id").substr(5),"*");"function"==typeof window.ml_survey_success&&(window.ml_survey_success(),d())}function c(){var a=[g+"/js/w/ml_jQuery.inputmask.bundle.min.js?v3.3.1"];for(var b in a)if(a.hasOwnProperty(b)){var c=document.createElement("script");c.setAttribute("type","text/javascript"),c.setAttribute("src",a[b]),b==a.length-1&&(c.onload=d,c.onreadystatechange=function(){"complete"!==this.readyState&&"loaded"!==this.readyState||d()}),document.getElementsByTagName("head")[0].appendChild(c)}}function d(){var a="";if("function"==typeof window.ml_guid){a=window.ml_guid();try{window.localStorage&&(window.localStorage.ml_guid?a=window.localStorage.ml_guid:window.localStorage.ml_guid=a)}catch(a){}}var c=!1;try{window&&window.location&&window.location.hostname&&window.parent&&window.parent.window&&window.parent.window.location&&window.parent.window.location.hostname&&(c=window.location.hostname===window.parent.window.location.hostname)}catch(a){c=!1}window.ml_jQuery(".ml-subscribe-form form, .ml-contact-form form").each(function(){var d=window.ml_jQuery(this),f=window.ml_jQuery(this).closest(".ml-subscribe-form, .ml-contact-form"),g=window.ml_jQuery(this).find("button.primary"),i=window.ml_jQuery(this).find("button.loading"),j=i.length>0;if(d.find(".ml-validate-date input").inputmask(void 0,{oncomplete:function(){window.ml_jQuery(this).closest(".ml-validate-date").addClass("ml-validate-date-valid")},onincomplete:function(){window.ml_jQuery(this).closest(".ml-validate-date").removeClass("ml-validate-date-valid")},oncleared:function(){window.ml_jQuery(this).closest(".ml-validate-date").removeClass("ml-validate-date-valid")},onKeyValidation:function(){window.ml_jQuery(this).closest(".ml-validate-date").removeClass("ml-validate-date-valid")}}),d.find(".ml-validate-phone input").inputmask(void 0,{oncomplete:function(){window.ml_jQuery(this).closest(".ml-validate-phone").addClass("ml-validate-phone-valid")},onincomplete:function(){window.ml_jQuery(this).closest(".ml-validate-phone").removeClass("ml-validate-phone-valid")},oncleared:function(){window.ml_jQuery(this).closest(".ml-validate-phone").removeClass("ml-validate-phone-valid")},onKeyValidation:function(){window.ml_jQuery(this).closest(".ml-validate-phone").removeClass("ml-validate-phone-valid")}}),void 0===d.data("ml-submit-bound")||!d.data("ml-submit-bound")){d.data("ml-submit-bound",1),f.find(".ml-block-success").bind("click",function(){f.find(".ml-block-success").hide(),f.find(".ml-block-form").find('input[type="text"]').val("");var a=f.find(".ml-block-form").find('input[type="checkbox"],input[type="radio"]');void 0!==a.prop?a.prop("checked",!1):a.attr("checked",!1),f.find(".ml-block-form").show()}),window.ml_jQuery(":submit",d).click(function(){d.find('input[type="hidden"].ml-submit-hidden-value').remove(),window.ml_jQuery(this).attr("name")&&d.append(window.ml_jQuery('<input type="hidden" class="ml-submit-hidden-value">').attr({name:window.ml_jQuery(this).attr("name"),value:window.ml_jQuery(this).attr("value")}))}),window.ml_jQuery("body").hasClass("ml-submit-success")&&b(d,f),d.bind("submit",function(h){if(h.preventDefault(),d.data("loading"))return!1;if(d.find(".ml-error").removeClass("ml-error"),e(d)){j&&(g.hide(),i.show());var k=d.serialize();k=k+"&ajax=1&guid="+a;var l=d.attr("action");d.data("loading",!0),(!c||k.toLowerCase().indexOf("email")>=0)&&window.ml_jQuery.ajax({type:"GET",url:l,data:k,dataType:"jsonp",success:function(a){if(d.data("loading",!1),j&&(g.show(),i.hide()),a.success?b(d,f):void 0!==a.errors&&(void 0!==a.errors.groups&&a.errors.groups&&d.find(".ml-block-groups").addClass("ml-error"),void 0!==a.errors.fields&&a.errors.fields&&window.ml_jQuery.each(a.errors.fields,function(a){d.find(".ml-field-"+a).addClass("ml-error")})),d.data("redirect")){var e=d.data("redirect-target");c?window.top.open(d.data("redirect"),e||"_blank"):window.parent.postMessage("mlWebformRedirect-"+encodeURIComponent(d.data("redirect"))+(e?"-"+e:""),"*")}},error:function(){d.data("loading",!1),j&&(g.show(),i.hide())}});d.data("close")&&"function"==typeof window.close&&window.close()}});var k=d.attr("data-id"),l=d.attr("data-code");k&&((new Image).src=h+"/webforms/o/"+k+"/"+l+"?v"+Math.floor(Date.now()/1e3))}window!=window.parent&&(window.ml_jQuery(document).on("click",".overlay, .ml-subscribe-close",function(){window.parent.postMessage("mlCloseIframe-"+d.data("code"),"*")}),window.ml_jQuery(".ml-subscribe-form").bind("click",function(a){var b=a.target||a.srcElement;window.ml_jQuery(b).is("div.ml-subscribe-close")||a.stopPropagation()}))})}function e(a){var b=!0;return a.find(".ml-validate-required").each(function(a,c){var d=!1;window.ml_jQuery(c).find('input[type="text"], input[type="email"], input[type="number"], select, textarea').each(function(a,b){void 0!==window.ml_jQuery(b).val()&&""!==window.ml_jQuery(b).val()&&(d=!0)}),window.ml_jQuery(c).find('input[type="checkbox"],input[type="radio"]').each(function(a,b){void 0!==window.ml_jQuery(b).prop?window.ml_jQuery(b).prop("checked")&&(d=!0):window.ml_jQuery(b).attr("checked")&&(d=!0)}),d||(window.ml_jQuery(c).addClass("ml-error"),b=!1)}),a.find(".ml-validate-email").each(function(a,c){var d=!0;window.ml_jQuery(c).find('input[type="text"], input[type="email"]').each(function(a,b){void 0===window.ml_jQuery(b).val()||""===window.ml_jQuery(b).val()||f(window.ml_jQuery(b).val())||(d=!1)}),d||(window.ml_jQuery(c).addClass("ml-error"),b=!1)}),a.find(".ml-validate-date").each(function(a,c){var d=!0;window.ml_jQuery(c).find('input[type="text"]').each(function(a,b){void 0===window.ml_jQuery(b).val()||""===window.ml_jQuery(b).val()||window.ml_jQuery(c).hasClass("ml-validate-date-valid")||(d=!1)}),d||(window.ml_jQuery(c).addClass("ml-error"),b=!1)}),a.find(".ml-validate-phone").each(function(a,c){var d=!0;window.ml_jQuery(c).find('input[type="text"]').each(function(a,b){void 0===window.ml_jQuery(b).val()||""===window.ml_jQuery(b).val()||window.ml_jQuery(c).hasClass("ml-validate-phone-valid")||(d=!1)}),d||(window.ml_jQuery(c).addClass("ml-error"),b=!1)}),b}function f(a){return/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]){2,40}$/.test(a.trim())}var g="https://static.mailerlite.com",h="https://track.mailerlite.com";if(void 0!==window.ml_jQuery&&"function"==typeof window.ml_jQuery.ajax)return void c();if(void 0!==window.jQuery&&"function"==typeof window.jQuery.ajax)return window.ml_jQuery=window.jQuery,void c();var i=document.createElement("script");i.setAttribute("type","text/javascript"),i.setAttribute("src","//cdn.mailerlite.com/ajax/libs/jquery/1.8.3/jquery.min.js"),i.onload=a,i.onreadystatechange=function(){"complete"!==this.readyState&&"loaded"!==this.readyState||a()},document.getElementsByTagName("head")[0].appendChild(i),window.ml_guid=function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}}();
cải xoăn