Chỉ sử dụng cho số {phone}<\/div>';i+="<\/div>";i=i.replace("{email}",n.email).replace("{phone}",n.phone);$(".productbox-bhxapi div._voucher").append(i)}else $(".voucherproduct-bhx .voucher-error").text(t.message),$(".voucherproduct-bhx .voucher-error").removeClass("hidden"),isMobile&&($(".productbox-bhxapi div._voucher").addClass("hide-voucher-note"),$(".voucherproduct-bhx .voucher-note").hide())},error:function(){pdbxbhxapi.loading=!1}})}},checkValid:function(n){var i=$(".voucherproduct-bhx input[name=email]").val(),r=$(".voucherproduct-bhx input[name=phone]").val(),t;if(n=="email"||n==undefined){if(i=="")return $(".voucherproduct-bhx .voucher-error").text("Email không được để trống"),$(".voucherproduct-bhx .voucher-error").removeClass("hidden"),$(".voucherproduct-bhx input[name=email]").addClass("input-warning"),$(".voucherproduct-bhx button").attr("disabled","disabled"),!1;if(t=pdbxbhxapi.validEmail(),!t)return $(".voucherproduct-bhx button").attr("disabled","disabled"),!1}if(n=="phone"||n==undefined){if(r=="")return $(".voucherproduct-bhx .voucher-error").text("Số điện thoại không được để trống"),$(".voucherproduct-bhx .voucher-error").removeClass("hidden"),$(".voucherproduct-bhx input[name=phone]").addClass("input-warning"),$(".voucherproduct-bhx button").attr("disabled","disabled"),!1;if(t=pdbxbhxapi.validPhone(),!t)return $(".voucherproduct-bhx button").attr("disabled","disabled"),!1}return n=="email"&&r!=""&&(t=pdbxbhxapi.validPhone(),!t)?($(".voucherproduct-bhx button").attr("disabled","disabled"),!1):n=="phone"&&i!=""&&(t=pdbxbhxapi.validEmail(),!t)?($(".voucherproduct-bhx button").attr("disabled","disabled"),!1):r!=""&&i!=""?($(".voucherproduct-bhx .voucher-error").addClass("hidden"),$(".voucherproduct-bhx input").removeClass("input-warning"),$(".voucherproduct-bhx button").removeAttr("disabled"),!0):void 0},checkEmail:function(n){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n)},checkPhone:function(n){return/^[0-9]+$/.test(n)},checkActiveSubmit:function(){var n=$(".voucherproduct-bhx input[name=phone]").val(),t=$(".voucherproduct-bhx input[name=email]").val();pdbxbhxapi.checkPhone(n)&&pdbxbhxapi.checkEmail(t)&&($(".voucherproduct-bhx button").removeAttr("disabled"),$(".voucherproduct-bhx .voucher-error").addClass("hidden"),$(".voucherproduct-bhx input").removeClass("input-warning"));pdbxbhxapi.checkPhone(n)&&($(".voucherproduct-bhx input[name=phone]").removeClass("input-warning"),$(".voucherproduct-bhx .voucher-error").text().indexOf("Số điện thoại")!=-1&&$(".voucherproduct-bhx .voucher-error").addClass("hidden"));pdbxbhxapi.checkEmail(t)&&($(".voucherproduct-bhx input[name=email]").removeClass("input-warning"),$(".voucherproduct-bhx .voucher-error").text().indexOf("Email")!=-1&&$(".voucherproduct-bhx .voucher-error").addClass("hidden"))},isNumberKey:function(n){var t=n.which?n.which:n.keyCode;return t!==46&&t>31&&(t<48||t>57)?!1:!0}};onloadCallbackcaptcha_1318718959=function(){var t=$(form.find(".submit")[0]),i,n;t.after("
<\/div>");i=!1;n=!1;t.clone(!1,!1).unbind("click").on("click",function(){return n||(n=!0,pdbxbhxapi.sendCoupon(),setTimeout(()=>{n=!1},5e3)),i}).prependTo(form.find(".dcap")[0]).each(function(){t.hide()})};flagPopupHTML=!1;const gbl_siteId=2;$(document).ready(function(){initMenu();isHasSub&&($(".dropdownsearch").click(function(){$(this).find("ul").slideToggle(300)}),$(".dropdownsearch ul li").click(function(){$(".dropdownsearch ul li").removeClass("active");$(this).addClass("active");$(".dropdownsearch a#type").attr("data-id",$(this).data("id"));$(".dropdownsearch a#type").html($(this).text())}),$.expr[":"].icontains=function(n,t,i){return slugify($(n).text().toUpperCase()).match("^"+slugify(i[3].toUpperCase()))});var n=$(".linkversion").attr("href");setTimeout(function(){if(n!=undefined&&n.includes("issub")){hrefnewdv=location.href;var t=location.pathname+location.search;hrefnewdv=t.includes("?")?urlRoot+t+"&view=mobile"+location.hash:urlRoot+t+"?view=mobile"+location.hash;$(".linkversion").attr("href",hrefnewdv)}},600)});$(document).ready(function(){$(".category").hover(function(){$(".bar-top-left").show();$(".bg-black").length>0&&closePopup()},function(){$(".bar-top-left").hide()});$(".open-menu").click(function(){$(".show-menu").addClass("active");$(".box-fixed").addClass("active");$("body").css({overflow:"hidden"})});$(".btn-closemenu").click(function(){$(".show-menu").removeClass("active");$(".box-fixed").removeClass("active");$("body").css({overflow:"scroll"})})});include=function(){function e(){var n=this.readyState;(!n||/ded|te/.test(n))&&(t--,!t&&f&&u())}var n=arguments,r=document,t=n.length,u=n[t-1],f=u.call,i;for(f&&t--,i=0;i
e.failure_limit)return!1}else i.trigger("appear"),t=0})}var o=this,h,e={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:t,data_attribute:"original|src",skip_invisible:!0,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return f&&(r!==f.failurelimit&&(f.failure_limit=f.failurelimit,delete f.failurelimit),r!==f.effectspeed&&(f.effect_speed=f.effectspeed,delete f.effectspeed),n.extend(e,f)),h=e.container===r||e.container===t?u:n(e.container),0===e.event.indexOf("scroll")&&h.bind(e.event,function(){return s()}),this.each(function(){var i=this,t=n(i);i.loaded=!1;(t.attr("src")===r||t.attr("src")===!1)&&t.is("img")&&t.attr("src",e.placeholder);t.one("appear",function(){var s,u,f;if(!this.loaded){if(e.appear&&(s=o.length,e.appear.call(i,s,e)),u="",e.data_attribute.indexOf("|")>0)for(f=0;f").bind("load",function(){var r,f;t.hide();u!=""&&(t.is("img")?t.attr("src",u):t.css("background-image","url('"+u+"')"));t[e.effect](e.effect_speed);i.loaded=!0;r=n.grep(o,function(n){return!n.loaded});o=n(r);e.load&&(f=o.length,e.load.call(i,f,e))}).attr("src",u)}});0!==e.event.indexOf("scroll")&&t.bind(e.event,function(){i.loaded||t.trigger("appear")})}),u.bind("resize",function(){s()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&u.bind("pageshow",function(t){t.originalEvent&&t.originalEvent.persisted&&o.each(function(){n(this).trigger("appear")})}),n(i).ready(function(){s()}),this};n.belowthefold=function(i,f){var e;return e=f.container===r||f.container===t?(t.innerHeight?t.innerHeight:u.height())+u.scrollTop():n(f.container).offset().top+n(f.container).height(),e<=n(i).offset().top-f.threshold};n.abovethetop=function(i,f){var e;return e=f.container===r||f.container===t?u.scrollTop():n(f.container).offset().top,e>=n(i).offset().top+f.threshold+n(i).height()};n.inviewport=function(t,i){return!n.belowthefold(t,i)&&!n.abovethetop(t,i)};n.extend(n.expr[":"],{"below-the-fold":function(t){return n.belowthefold(t,{threshold:0})},"above-the-top":function(t){return!n.belowthefold(t,{threshold:0})},"in-viewport":function(t){return n.inviewport(t,{threshold:0})},"above-the-fold":function(t){return!n.belowthefold(t,{threshold:0})}})}(jQuery,window,document);