window.theme=window.theme||{},function(t){theme.woocommerce={init:function(){this.removerId=0,this.initProductsAttributeAction(),this.initProductsQuickview(),this.initProductsCartAction(),this.initProductsWishlistAction(),this.initProductsHover(),this.initAjaxAddToCart(),this.initResetVariation(),theme.call(this.initProducts.bind(this),500)},initProducts:function(t){this.ratingTooltip(t)},initAjaxAddToCart:function(){theme.$body.on("click",".single_add_to_cart_button",(function(e){var a=t(e.currentTarget);if(!a.hasClass("disabled")&&!a.hasClass("has_buy_now")){var i=a.closest(".product-single");if(i.length&&!i.hasClass("product-type-external")&&!i.hasClass("product-type-grouped")&&(i.hasClass("product-widget")||i.hasClass("product-quickview"))){e.preventDefault();var o=a.closest("form.cart");if(!o.hasClass("d-loading")){var n=o.find('input[name="variation_id"]').val(),s=n?o.find('input[name="product_id"]').val():a.val(),r=o.find('input[name="quantity"]').val(),c=o.find("select[data-attribute_name]"),l={product_id:n||s,quantity:r};c.each((function(){var e=t(this);l[e.attr("data-attribute_name")]=e.val()}));var d="";i.hasClass("product-widget")||i.hasClass("product-quickview")?(d=alpha_vars.ajax_url,l.action="alpha_ajax_add_to_cart"):d=wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_cart"),theme.doLoading(a,"small"),a.removeClass("added"),theme.$body.trigger("adding_to_cart",[a,l]),t.ajax({type:"POST",url:d,data:l,dataType:"json",success:function(e){if(e)if(e.error&&e.product_url)location=e.product_url;else if("yes"!==wc_add_to_cart_params.cart_redirect_after_add){t(document.body).trigger("added_to_cart",[e.fragments,e.cart_hash,a]);var s=o.attr("action"),r=i.find(".wp-post-image").attr("src"),c=i.find(".product_title").text(),l=n?o.find(".woocommerce-variation-price .price").html():i.find(".price").html(),d=parseInt(o.find(".qty").val()),u=i.attr("id");l||(l=i.find(".price").html());var p=t(".minipopup-area").find("#"+u);u==p.attr("id")?p.find(".cart-count").html(parseInt(p.find(".cart-count").html())+d):theme.minipopup.open({content:'
"})}else location=wc_add_to_cart_params.cart_url},complete:function(){theme.endLoading(a)}})}}}}))},initProductsAttributeAction:function(){theme.$body.on("click",".product-variation-wrapper button",(function(e){var a=t(this),i=a.parent(),o=a.closest(".product-variation-wrapper"),n="attribute_"+String(i.data("attr")),s=o.data("product_variations"),r=o.data("product_attrs"),c=a.attr("name"),l=o.closest(".product-loop").find(".price"),d=o.data("price");if(!a.hasClass("disabled")){var u=s;if(null==r&&(r=[],o.find(".product-variations").each((function(){r.push("attribute_"+String(t(this).data("attr")))})),o.data("product_attrs",r)),null==d&&(d=l.html(),o.data("price",d)),c==o.data(n)){o.removeData(n);let t=[];s.forEach((function(e,a){var i=!0;r.forEach((function(t){null!=o.data(t)&&o.data(t)!=e.attributes[t]&&""!=e.attributes[t]&&(i=!1)})),i&&t.push(e)})),u=t}else{o.data(n,c);let t=[];s.forEach((function(e,a){var i=!0;r.forEach((function(t){null!=o.data(t)&&o.data(t)!=e.attributes[t]&&""!=e.attributes[t]&&(i=!1)})),i&&t.push(e)})),u=t}var p=!0;r.forEach((function(e){if(n!=e||e==n&&null==o.data(n)){let a=o.find("."+e.slice(10)+" > *:not(.guide-link)");a.each((function(){var e=t(this);e.hasClass("select-box")?e.find("option").css("display","none"):e.addClass("disabled")})),s.forEach((function(i){let n=!0;r.forEach((function(t){null!=o.data(t)&&e!=t&&i.attributes[t]!=o.data(t)&&""!=i.attributes[t]&&(n=!1)})),1==n&&(""==i.attributes[e]?(a.removeClass("disabled"),a.each((function(){var e=t(this);e.hasClass("select-box")?e.find("option").css("display",""):e.removeClass("disabled")}))):a.each((function(){var a=t(this);a.hasClass("select-box")?a.find("option").each((function(){var a=t(this);a.attr("value")!=i.attributes[e]&&""!=a.attr("value")||a.css("display","")})):a.attr("name")==i.attributes[e]&&a.removeClass("disabled")})))}))}null==o.data(e)&&(p=!1)})),1==p&&1==u.length?(l.closest(".product-loop").data("variation",u[0].variation_id),l.html(t(u[0].price_html).html()),l.closest(".product-loop").find(".add_to_cart_button").removeClass("product_type_variable").addClass("product_type_simple")):(l.html(d),l.closest(".product-loop").removeData("variation").find(".add_to_cart_button").removeClass("product_type_simple").addClass("product_type_variable"))}})).on("change",".product-variation-wrapper select",(function(e){var a=t(this),i=(a.parent(),a.closest(".product-variation-wrapper")),o=a.data("attribute_name"),n=i.data("product_variations"),s=i.data("product_attrs"),r=a.val(),c=i.closest(".product-loop").find(".price"),l=i.data("price"),d=n;if(null==s&&(s=[],i.find(".product-variations").each((function(){s.push("attribute_"+String(t(this).data("attr")))})),i.data("product_attrs",s)),null==l&&(l=c.html(),i.data("price",l)),""==r){i.removeData(o);let t=[];n.forEach((function(e,a){var o=!0;s.forEach((function(t){null!=i.data(t)&&i.data(t)!=e.attributes[t]&&""!=e.attributes[t]&&(o=!1)})),o&&t.push(e)})),d=t}else{i.data(o,r);let t=[];n.forEach((function(e,a){var o=!0;s.forEach((function(t){null!=i.data(t)&&i.data(t)!=e.attributes[t]&&""!=e.attributes[t]&&(o=!1)})),o&&t.push(e)})),d=t}var u=!0;s.forEach((function(e){if(o!=e||e==o&&null==i.data(o)){let a=i.find("."+e.slice(10)+" > *");a.each((function(){var e=t(this);e.hasClass("select-box")?e.find("option").css("display","none"):e.addClass("disabled")})),n.forEach((function(o){let n=!0;s.forEach((function(t){null!=i.data(t)&&e!=t&&o.attributes[t]!=i.data(t)&&""!=o.attributes[t]&&(n=!1)})),1==n&&(""==o.attributes[e]?(a.removeClass("disabled"),a.each((function(){var e=t(this);e.hasClass("select-box")?e.find("option").css("display",""):e.removeClass("disabled")}))):a.each((function(){var a=t(this);a.hasClass("select-box")?a.find("option").each((function(){var a=t(this);a.attr("value")!=o.attributes[e]&&""!=a.attr("value")||a.css("display","")})):a.attr("name")==o.attributes[e]&&a.removeClass("disabled")})))}))}null==i.data(e)&&(u=!1)})),1==u&&1==d.length?(c.closest(".product-loop").data("variation",d[0].variation_id),c.html(t(d[0].price_html).html()),c.closest(".product-loop").find(".add_to_cart_button").removeClass("product_type_variable").addClass("product_type_simple")):(c.html(l),c.closest(".product-loop").removeData("variation").find(".add_to_cart_button").removeClass("product_type_simple").addClass("product_type_variable"))})).on("click",".product-loop.product-type-variable .add_to_cart_button",(function(e){var a=t(this),i=a.closest(".product").find(".product-variation-wrapper"),o=i.data("product_attrs"),n=a.closest(".product-loop");if(null!=n.data("variation")){let s={action:"alpha_add_to_cart",product_id:n.data("variation"),quantity:1};o.forEach((function(t){s[t]=i.data(t)})),t.ajax({type:"POST",dataType:"json",url:alpha_vars.ajax_url,data:s,success:function(e){t(document.body).trigger("added_to_cart",[e.fragments,e.cart_hash,a])}}),e.preventDefault()}})).on("found_variation",".variations_form",(function(e,a){var i=t(e.currentTarget).closest(".product").find(".countdown-variations");if(i.length)if(a&&a.is_purchasable&&a.alpha_date_on_sale_to){var o=i.find(".countdown");o.data("until")!=a.alpha_date_on_sale_to&&"function"==typeof theme.countdown&&(theme.countdown(o,{until:new Date(a.alpha_date_on_sale_to)}),o.data("until",a.alpha_date_on_sale_to)),i.slideDown()}else i.slideUp();t(".product-sticky-content .price").length&&void 0!==a.price_html&&t(".product-sticky-content .price").html(a.price_html)})).on("reset_image",".variations_form",(function(e){var a=t(e.currentTarget).closest(".product");a.find(".countdown-variations").slideUp(),t(".product-sticky-content .price").length&&t(".product-sticky-content .price").html(a.find("p.price:not(.price-sticky)").html())}))},initProductsQuickview:function(){theme.$body.on("click",".btn-quickview",(function(e){e.preventDefault();var a=t(this),i={action:"alpha_quickview",product_id:a.data("product")},o=alpha_vars.quickview_type||"loading";function n(){theme.createProductSingle(".mfp-product .product-single"),a.closest(".shop_table").length&&theme.endLoading(a),theme.woocommerce.ratingTooltip(".mfp-product .product-single"),theme.$body.trigger("alpha_ajax_yith_wcwl_require")}function s(t){theme.popup({type:"ajax",mainClass:"mfp-product mfp-fade"+("offcanvas"==t?" mfp-offcanvas":""),items:{src:alpha_vars.ajax_url},ajax:{settings:{method:"POST",data:i},cursor:"mfp-ajax-cur",tError:''+alpha_vars.texts.popup_error+'
'},preloader:!1,callbacks:{afterChange:function(){var e;if(alpha_vars.skeleton_screen){var a="horizontal"==alpha_vars.quickview_thumbs?"":" pg-vertical";e="offcanvas"==t?'':''}else e='';this.container.html(''+e+"
"),this.contentContainer=this.container.children(".mfp-content"),this.preloader=!1},beforeClose:function(){this.container.empty()},ajaxContentAdded:function(){var t=this;this.wrap.imagesLoaded((function(){n()})),this.wrap.find(".mfp-close").appendTo(this.content),setTimeout((function(){t.contentContainer.next(".mfp-preloader").remove()}),300)}}})}if("zoom"==o&&window.innerWidth<768&&(o="loading"),a.closest(".shop_table").length&&theme.doLoading(a,"small"),alpha_vars.skeleton_screen&&"zoom"!=o)s(o);else if("zoom"==o){var r,c="";function l(){var e=t.magnificPopup.instance;if(e.isOpen&&e.content&&e.wrap.hasClass("zoom-start2")&&!e.wrap.hasClass("zoom-finish")&&c)var a=1,i=theme.requestInterval((function(){if(e.wrap.addClass("zoom-start3"),e.content){var o=t(c),s=o.find(".woocommerce-product-gallery"),r=o.find(".summary"),l=e.content.find(".product-single");l.children("div:first-child").html(s),l.find(".entry-summary.summary").remove(),l.attr("id",o.attr("id")),l.attr("class",o.attr("class")),e.content.css("clip-path",a<30?"inset(0 calc("+50*(31-a)/30+"% - 20px) 0 0)":"none"),a>=30&&(theme.deleteTimeout(i),e.wrap.addClass("zoom-finish"),l.children("div:last-child").append(r),t(".mfp-animated-image").remove(),theme.requestTimeout((function(){e.wrap.addClass("zoom-loaded mfp-anim-finish"),theme.endLoading(l.children("div:last-child")),n()}),50)),++a}else theme.deleteTimeout(i)}),16)}if(!(r=a.hasClass("alpha-tb-quickview")?a.parent().find(".alpha-tb-featured-image img:first-child"):a.parent(".hotspot-product").length?a.parent().find(".product-media img"):a.closest(".shop_table").length?a.closest("tr").find(".product-thumbnail img"):a.closest(".product").find(".product-media img:first-child")).length)return void s("loading");var d=a.data("mfp-src");t('
').imagesLoaded((function(){a.data("magnificPoup")||a.magnificPopup({type:"image",mainClass:"mfp-product mfp-zoom mfp-anim",preloader:!1,item:{src:d},closeOnBgClick:!1,zoom:{enabled:!0,duration:550,easing:"cubic-bezier(.55,0,.1,1)",opener:function(){return r}},callbacks:{beforeOpen:theme.defaults.popup.callbacks.beforeOpen,open:function(){var t='';if("horizontal"!=alpha_vars.quickview_thumbs&&window.innerWidth>=992&&this.content.addClass("vertical"),this.content.find("figcaption").remove(),this.items[0]){var e=this.items[0].img.wrap(t);this.items[0].el.closest(".product").find(".woocommerce-placeholder").length||e.after('')}var a=this;setTimeout((function(){a.bgOverlay.removeClass("mfp-ready")}),16),setTimeout((function(){a.wrap.addClass("zoom-start"),theme.requestFrame((function(){var t=a.content.find(".thumbs>img:first-child"),e=t.length?t.width():0,i=t.length?t.height():0,o=0;a.bgOverlay.addClass("mfp-ready");var n=theme.requestInterval((function(){a.content?(a.content.css("clip-path","horizontal"!=alpha_vars.quickview_thumbs&&window.innerWidth>=992?"inset("+(30-o)+"px calc("+alpha_vars.quickview_percent+" + "+(10-o)+"px) "+(30-o)+"px "+(30-o)*(30+e)/30+"px)":"inset("+(30-o)+"px calc("+alpha_vars.quickview_percent+" + "+(10-o)+"px) "+(30-o)*(30+i)/30+"px "+(30-o)+"px)"),o>=30?(theme.deleteTimeout(n),a.wrap.addClass("zoom-start2"),c||theme.doLoading(a.content.find(".product > div:first-child")),l()):o+=3):theme.deleteTimeout(n)}),16)}))}),560)},beforeClose:function(){a.removeData("magnificPopup"),a.off("click.magnificPopup"),t(".mfp-animated-image").remove()},close:theme.defaults.popup.callbacks.close}}),a.magnificPopup("open")})),t.post(alpha_vars.ajax_url,i).done((function(e){t(e).imagesLoaded((function(){c=e,l()}))}))}else a.hasClass("alpha-tb-quickview")?theme.doLoading(a.closest(".product").find(".alpha-tb-featured-image")):theme.doLoading(a.closest(".product").find(".product-media")),t.post(alpha_vars.ajax_url,i).done((function(e){t(e).imagesLoaded((function(){theme.popup({type:"inline",mainClass:"mfp-product mfp-fade "+("offcanvas"==o?"mfp-offcanvas":"mfp-anim"),items:{src:e},callbacks:{open:function(){var t=this;function e(){t.wrap.addClass("mfp-anim-finish")}"offcanvas"==o?setTimeout(e,316):theme.requestFrame(e),n()}}}),a.hasClass("alpha-tb-quickview")?theme.endLoading(a.closest(".product").find(".alpha-tb-featured-image")):theme.endLoading(a.closest(".product").find(".product-media"))}))}))}))},initProductsCartAction:function(){theme.$body.on("click",".add_to_cart_button:not(.product_type_variable)",(function(e){t(".minicart-icon").addClass("adding"),theme.doLoading(e.currentTarget,"small")})).on("added_to_cart",(function(e,a,i,o){var n=o.closest(".product");if(o.closest(".minipopup-area").length&&(n=theme.$body.find(".product.post-"+o.attr("data-product_id"))),"undefined"!=typeof alpha_elementor?setTimeout((function(){o.next(".added_to_cart").remove()})):o.next(".added_to_cart").remove(),!n.hasClass("product-single")){var s,r,c,l;if(n.length){s=n.find(".product-media .woocommerce-loop-product__link").attr("href"),r=n.find(".product-media img:first-child, .alpha-tb-featured-image img:first-child").attr("src"),c=n.find(".woocommerce-loop-product__title a").text(),n.find(".price").html(),l=o.data("product_id");var d=t(".minipopup-area").find("#product-"+l)}else s=(n=o.closest(".compare-basic-info")).find(".product-title").attr("href"),r=n.find(".product-media img").attr("src"),null==(c=n.closest(".alpha-compare-table").find(".compare-title .compare-value").eq(o.closest(".compare-value").index()-1).find(".product-title").html())&&(c=n.children(".product-title").html()),n.closest(".alpha-compare-table").find(".compare-price .compare-value").eq(o.closest(".compare-value").index()-1).html();d&&l==d.attr("data-product-id")?d.find(".cart-count").html(parseInt(d.find(".cart-count").html())+1):(n.hasClass("alpha-tb-item")&&(c=n.data("title"),s=n.data("link")),theme.minipopup.open({content:'"}))}theme.quantityInput(".qty"),t(".minicart-icon").removeClass("adding")})).on("added_to_cart ajax_request_not_sent.adding_to_cart",(function(t,e,a,i){void 0!==i&&theme.endLoading(i)})).on("wc_fragments_refreshed",(function(e,a){theme.quantityInput(".qty"),setTimeout((function(){t(".sticky-sidebar").trigger("recalc.pin")}),400)})).off("click",".widget_shopping_cart .remove").on("click",".widget_shopping_cart .remove",(function(e){e.preventDefault();var a=t(this).data("cart_item_key");return t.ajax({type:"POST",dataType:"json",url:alpha_vars.ajax_url,data:{action:"alpha_cart_item_remove",nonce:alpha_vars.nonce,cart_id:a},success:function(e){var a=location.toString(),i=t(e.fragments["div.widget_shopping_cart_content"]).find(".mini_cart_item").length;if(a=a.replace("add-to-cart","added-to-cart"),t(document.body).trigger("wc_fragment_refresh"),t(".mini-basket-box.cart-dropdown").length){var o=t(".mini-basket-box.cart-dropdown"),n=o.find(".dropdown-box");n.length&&(o.find(".mini-basket-empty").length?n.hasClass("empty")||n.addClass("empty"):n.hasClass("empty")&&n.removeClass("empty"))}0==i&&(t("body").hasClass("woocommerce-cart")||t("body").hasClass("woocommerce-checkout"))?t(".page-content").block():t(".shop_table.cart, .shop_table.review-order, .updating, .cart_totals").block(),t(".widget_shopping_cart, .updating").stop(!0).unblock(),0==i&&(t("body").hasClass("woocommerce-cart")||t("body").hasClass("woocommerce-checkout"))?t(".page-content").load(a+" .page-content:eq(0) > *",(function(){t(".page-content").unblock()})):(t(".shop_table.cart").load(a+" .shop_table.cart:eq(0) > *",(function(){t(".shop_table.cart").unblock(),theme.quantityInput(".shop_table .qty")})),t(".cart_totals").load(a+" .cart_totals:eq(0) > *",(function(){t(".cart_totals").unblock()})),t(".shop_table.review-order").load(a+" .shop_table.review-order:eq(0) > *",(function(){t(".shop_table.review-order").unblock()})))}}),!1})).on("click",".remove_from_cart_button",(function(e){theme.doLoading(t(this).closest(".mini_cart_item"),"small")}))},initProductsWishlistAction:function(){function e(){var e=t(".mini-basket-box .widget_wishlist_content");e.length&&(e.find(".d-loading").length||theme.doLoading(e,"small"),t.ajax({url:alpha_vars.ajax_url,data:{action:"alpha_update_mini_wishlist"},type:"post",success:function(a){e.closest(".mini-basket-box").find(".wish-count").length&&e.closest(".mini-basket-box").find(".wish-count").text(t(a).find(".wish-count").text()),e.html(t(a).find(".widget_wishlist_content").html());var i=e.closest(".dropdown-box");i.length&&(e.find(".mini-basket-empty").length?i.hasClass("empty")||i.addClass("empty"):i.hasClass("empty")&&i.removeClass("empty"))}}))}theme.$body.on("click",".add_to_wishlist, .yith-wcwl-add-button .delete_item",(function(e){theme.doLoading(t(e.currentTarget).closest(".yith-wcwl-add-to-wishlist"),"small")})).on("added_to_wishlist",(function(){t(".wish-count").each((function(){t(this).html(parseInt(t(this).html())+1)})),e()})).on("removed_from_wishlist",(function(){t(".wish-count").each((function(){t(this).html(parseInt(t(this).html())-1)})),e()})).on("added_to_cart",(function(a,i,o,n){if(n.closest("#yith-wcwl-form").length&&t(".wish-count").each((function(){t(this).html(parseInt(t(this).html())-1)})),t(".mini-basket-box.cart-dropdown").length){var s=t(".mini-basket-box.cart-dropdown"),r=s.find(".dropdown-box");r.length&&(s.find(".mini-basket-empty").length?r.hasClass("empty")||r.addClass("empty"):r.hasClass("empty")&&r.removeClass("empty"))}e()})).on("alpha_ajax_yith_wcwl_require",(function(){if("undefined"!=typeof yith_wcwl_l10n&&yith_wcwl_l10n.enable_ajax_loading&&t(".wishlist-fragment").length){var e={},a=t(".wishlist-fragment");if(e[a.attr("class").split(" ").filter((t=>t.length&&"exists"!==t)).join(yith_wcwl_l10n.fragments_index_glue)]=a.data("fragment-options"),!e)return;var i={action:yith_wcwl_l10n.actions.load_fragments,context:"frontend",fragments:e};void 0!==yith_wcwl_l10n.nonce&&(i.nonce=yith_wcwl_l10n.nonce.load_fragments_nonce),t.ajax({data:i,method:"post",success:function(e){void 0!==e.fragments&&t.each(e.fragments,(function(e,a){var i="."+e.split(yith_wcwl_l10n.fragments_index_glue).filter((t=>t.length&&"exists"!==t&&"with-count"!==t)).join("."),o=t(i),n=t(a).filter(i);n.length||(n=t(a).find(i)),o.length&&n.length&&o.replaceWith(n)}))},url:yith_wcwl_l10n.ajax_url})}})).on("click",".wishlist-dropdown .wishlist-item .remove_from_wishlist",(function(e){e.preventDefault();var a=t(this).attr("data-product_id"),i=t(".wishlist_table #yith-wcwl-row-"+a+" .remove_from_wishlist");theme.doLoading(t(this).closest(".wishlist-item"),"small"),i.length?i.trigger("click"):t.ajax({url:yith_wcwl_l10n.ajax_url,data:{action:yith_wcwl_l10n.actions.remove_from_wishlist_action,nonce:yith_wcwl_l10n.nonce.remove_from_wishlist_nonce,remove_from_wishlist:a,from:"theme"},method:"post",success:function(t){theme.$body.trigger("removed_from_wishlist")}})})),alpha_vars.skeleton_screen&&theme.$body.trigger("yith_wcwl_reload_fragments")},initProductsHover:function(){if(t("html").hasClass("touchable")&&alpha_vars.prod_open_click_mob){var e=!1;theme.$body.on("click",".product-wrap .product",(function(a){e&&!t(this).hasClass("hover-active")&&(a.preventDefault(),t(".hover-active").removeClass("hover-active"),t(this).addClass("hover-active"))})),t(document).on("click",a),document.addEventListener("touchstart",a,{passive:!0})}function a(a){e="touchstart"==a.type,t(a.target).closest(".hover-active").length||t(".hover-active").removeClass("hover-active")}},ratingTooltip:function(t){var e=function(){var t=this.firstElementChild.getBoundingClientRect().width/this.getBoundingClientRect().width*5;this.lastElementChild.innerText=t?t.toFixed(2):t,this.classList.add("rating-loaded")};theme.$(t,".star-rating").each((function(){if(this.lastElementChild&&!this.lastElementChild.classList.contains("tooltiptext")){var t=document.createElement("span");t.classList.add("tooltiptext"),t.classList.add("tooltip-top"),this.appendChild(t),this.addEventListener("mouseover",e),this.addEventListener("touchstart",e,{passive:!0})}}))},initAlertAction:function(){this.removerId&&clearTimeout(this.removerId),this.removerId=setTimeout((function(){t(".woocommerce-page .main-content .alert:not(.woocommerce-info) .btn-close").not(":hidden").trigger("click")}),1e4)},initResetVariation:function(){theme.$body.on("check_variations",".variations_form",(function(){var e=t(theme.byClass("reset_variations",this));"hidden"==e.css("visibility")?e.hide():e.show()}))}},theme.createProductGallery=function(){function e(t){return this.init(t)}var a=!0;return e.prototype.init=function(e){var a=this;void 0===e.data("product_gallery")&&e.wc_product_gallery(),this.$wc_gallery=e,this.wc_gallery=e.data("product_gallery"),t(".woocommerce-product-gallery__trigger").remove(),this.$slider=e.find(".product-single-carousel"),this.$slider.length?this.initThumbs():(this.$slider=this.$wc_gallery.find(".product-gallery-carousel"),this.$slider.length?this.$slider.on("initialized.slider",this.initZoom.bind(this)):this.initZoom()),e.off("click",".woocommerce-product-gallery__image a").on("click",theme.preventDefault),e.closest(".product-quickview").length||e.closest(".product-widget").length||(document.body.classList.contains("single-"+alpha_vars.theme+"_template")||e.on("click",".woocommerce-product-gallery__image a",this.openImageFull.bind(this)),e.find(".product-sticky-thumbs").length&&(e.on("click",".product-sticky-thumbs img",this.clickStickyThumbnail.bind(this)),window.addEventListener("scroll",this.scrollStickyThumbnail.bind(this),{passive:!0}))),"complete"===theme.status&&a.$slider&&a.$slider.length&&theme.slider(a.$slider),theme.$window.on("alpha_complete",(function(){setTimeout(a.initAfterLazyload.bind(a),200)}))},e.prototype.initAfterLazyload=function(){this.currentPostImageSrc=this.$wc_gallery.find(".wp-post-image").attr("src")},e.prototype.initThumbs=function(){var t=this;!function(t){t.$thumbs=t.$wc_gallery.find(".product-thumbs"),t.$thumbsDots=t.$thumbs.children(),t.isVertical=t.$thumbs.parent().parent().hasClass("pg-vertical"),t.$thumbsWrap=t.$thumbs.parent(),theme.slider(t.$thumbs,{},!0),t.isVertical&&window.addEventListener("resize",(function(){theme.requestTimeout((function(){t.$thumbs.data("slider").update()}),100)}),{passive:!0})}(t),this.$slider.on("initialized.slider",(function(e){t.initZoom()}))},e.prototype.openImageFull=function(e){if(wc_single_product_params.photoswipe_options){e.preventDefault();var a=this.$wc_gallery.find(".product-single-carousel").data("slider");a&&(wc_single_product_params.photoswipe_options.index=a.activeIndex),this.wc_gallery.$images.filter(".yith_featured_content").length&&(wc_single_product_params.photoswipe_options.index=a?a.activeIndex-1:t(e.currentTarget).closest(".woocommerce-product-gallery__image").index()-1),this.wc_gallery.openPhotoswipe(e),e.stopPropagation()}},e.prototype.clickStickyThumbnail=function(e){var a=this,i=t(e.currentTarget);i.addClass("active").siblings(".active").removeClass("active"),this.isStickyScrolling=!0,theme.scrollTo(this.$wc_gallery.find(".product-sticky-images > :nth-child("+(i.index()+1)+")")),setTimeout((function(){a.isStickyScrolling=!1}),300)},e.prototype.scrollStickyThumbnail=function(){var e=this;this.isStickyScrolling||this.$wc_gallery.find(".product-sticky-images img:not(.zoomImg)").each((function(){if(theme.isOnScreen(this))return e.$wc_gallery.find(".product-sticky-thumbs-inner > :nth-child("+(t(this).closest(".woocommerce-product-gallery__image").index()+1)+")").addClass("active").siblings().removeClass("active"),!1}))},e.prototype.initZoomImage=function(e){if(alpha_vars.single_product.zoom_enabled){var a=e.children("img").attr("data-large_image_width"),i=t.extend({touch:!1},alpha_vars.single_product.zoom_options);"ontouchstart"in document.documentElement&&(i.on="click"),e.trigger("zoom.destroy").children(".zoomImg").remove(),void 0!==a&&e.width()'),a+=this.$wc_gallery.data("buttons")||"",this.$slider.length&&this.$slider.hasClass("product-single-carousel")?this.$slider.find(".product-gallery-btn").length||this.$slider.after(a):this.$wc_gallery.find(".woocommerce-product-gallery__image > a").each((function(){t(this).parent().find(".product-gallery-btn").length||t(this).after(a)}))}this.$wc_gallery.find(".woocommerce-product-gallery__image > a").each((function(){e.initZoomImage(t(this))}))}},function(a){t.fn.wc_product_gallery&&theme.$(a).each((function(){var a=t(this);a.data("alpha_product_gallery",new e(a))}))}}(),theme.createProductSingle=function(){function e(t){return this.init(t)}return e.prototype.init=function(e){this.$product=e,e.find(".woocommerce-product-gallery").each((function(){theme.createProductGallery(t(this))})),t(".reset_variations").hide().removeClass("d-none"),"complete"===theme.status?(t.fn.wc_variation_form&&"undefined"!=typeof wc_add_to_cart_variation_params&&this.$product.find(".variations_form").wc_variation_form(),theme.quantityInput(this.$product.find(".qty")),"function"==typeof theme.countdown&&theme.countdown(this.$product.find(".product-countdown"))):this.$product.hasClass("product-widget")&&!this.$product.hasClass("product-quickview")||this.stickyCartForm(this.$product.find(".product-sticky-content"))},e.prototype.stickyCartForm=function(t){var e=theme.$(t);if(1==e.length){var a=e.closest(".product"),i=e.data("sticky-content");i&&(i.getTop=function(){var t;return(t=e.closest(".sticky-sidebar").length?a.find(".woocommerce-product-gallery"):e.closest("form.cart")).offset().top+t.height()},i.onFixed=function(){theme.$body.addClass("addtocart-fixed")},i.onUnfixed=function(){theme.$body.removeClass("addtocart-fixed")}),theme.$window.on("sticky_refresh_size.alpha",o),o()}function o(){theme.requestTimeout((function(){e.removeClass("fix-top fix-bottom").addClass(window.innerWidth<768?"fix-top":"fix-bottom")}),50)}},function(a){theme.$(a).each((function(){var a=t(this);a.data("alpha_product_single",new e(a))}))}}(),theme.quantityInput=function(){function e(t){return this.init(t)}return e.min=1,e.max=1e6,e.prototype.init=function(t){var a=this;a.$minus=!1,a.$plus=!1,a.$value=!1,a.value=!1,a.startIncrease=a.startIncrease.bind(a),a.startDecrease=a.startDecrease.bind(a),a.stop=a.stop.bind(a),a.min=parseInt(t.attr("min")),a.max=parseInt(t.attr("max")),a.min||t.attr("min",a.min=e.min),a.max||t.attr("max",a.max=e.max),a.$value=t.val(a.value=Math.max(parseInt(t.val()),1)),a.$minus=t.parent().find(".quantity-minus").on("click",theme.preventDefault),a.$plus=t.parent().find(".quantity-plus").on("click",theme.preventDefault),"ontouchstart"in document?(a.$minus.get(0).addEventListener("touchstart",a.startDecrease,{passive:!0}),a.$plus.get(0).addEventListener("touchstart",a.startIncrease,{passive:!0})):(a.$minus.on("mousedown",a.startDecrease),a.$plus.on("mousedown",a.startIncrease)),theme.$body.on("mouseup",a.stop).on("touchend",a.stop)},e.prototype.startIncrease=function(t){var e=this;e.value=e.$value.val(),e.valuee.min&&(e.$value.val(--e.value),e.$value.trigger("change")),e.decreaseTimer=theme.requestTimeout((function(){e.speed=1,e.decreaseTimer=theme.requestInterval((function(){e.$value.val(e.value=Math.max(e.value-Math.floor(e.speed*=1.05),e.min))}),50)}),400)},function(a){theme.$(a).each((function(){var a=t(this);a.data("quantityinput")||a.data("quantityinput",new e(a))}))}}(),t(window).on("alpha_complete",(function(){theme.woocommerce.init(),theme.quantityInput(".qty")}))}(window.jQuery);