function initSelect2(){$j(".woocommerce-ordering .orderby, #calc_shipping_country, #dropdown_product_cat").select2({minimumResultsForSearch:-1}),$j(".woocommerce-account .country_select").select2()}function initAddToCartPlusMinus(){$j(document).on("click",".quantity .plus, .quantity .minus",function(){var e=$j(this).closest(".quantity").find(".qty"),t=parseFloat(e.val()),o=parseFloat(e.attr("max")),i=parseFloat(e.attr("min")),a=e.attr("step");t&&""!==t&&"NaN"!==t||(t=0),""!==o&&"NaN"!==o||(o=""),""!==i&&"NaN"!==i||(i=0),"any"!==a&&""!==a&&void 0!==a&&"NaN"!==parseFloat(a)||(a=1),$j(this).is(".plus")?o&&(o==t||o',''],onInitialize:function(){e.css("visibility","visible")}})}),$j(".yith-wcqv-wrapper").css("top",$scroll+20)})}}}function qodeQuickViewSelect2(){$j(document).on("qv_loader_stop",function(){$j("#yith-quick-view-modal select").select2()})}function qodeProductImageSizes(e){var t=e.find(".qode-pl-sizer").width(),o=e.find(".qode-woo-image-normal-width"),i=e.find(".qode-woo-image-large-width"),a=e.find(".qode-woo-image-large-height"),n=e.find(".qode-woo-image-large-width-height");e.find(".qode-landscape-size").length&&(t*=.8),o.css("height",t),600<$window_width?(n.css("height",Math.round(2*t)),a.css("height",Math.round(2*t)),i.css("height",t)):(n.css("height",t),a.css("height",t))}function qodeInitProductListMasonryShortcode(){var e=$j(".qode-pl-holder.qode-masonry-layout .qode-pl-outer");e.length&&e.each(function(){var e=$j(this);qodeProductImageSizes(e),e.waitForImages(function(){e.isotope({itemSelector:".qode-pli",resizable:!1,layoutMode:"packery",masonry:{columnWidth:".qode-pl-sizer",gutter:".qode-pl-gutter"}}),e.isotope("layout"),e.css("opacity",1)})})}function qodeInitProductListFilter(){function t(t){t.find(".qode-pl-categories a, .qode-pl-ordering a").on("click",function(e){e.preventDefault(),e.stopPropagation();var o,i,a,n,e=$j(this);e.hasClass("active")||(i=e,a=(o=t).find(".qode-pl-outer"),e=qode.modules.common.getLoadMoreData(o),n=o.find(".qode-prl-loading"),c(d,i.data()),e.category=void 0!==d.category?d.category:"",e.metaKey=void 0!==d.metaKey?d.metaKey:"",e.order=void 0!==d.order?d.order:"",e.orderby=void 0!==d.orderby?d.orderby:"",e.minPrice=void 0!==d.minprice?d.minprice:"",e.maxPrice=void 0!==d.maxprice?d.maxprice:"",e.categoryNonce=void 0!==i.parents(".qode-pl-categories-nonce-holder").data("nonce")?i.parents("ul").data("nonce"):"",n.fadeIn(),e=qode.modules.common.setLoadMoreAjaxData(e,"bridge_qode_product_ajax_load_category"),$j.ajax({type:"POST",data:e,url:QodeAdminAjax.ajaxurl,success:function(e){var t=$j.parseJSON(e).html;o.waitForImages(function(){i.parent().siblings().find("a").removeClass("active"),i.addClass("active"),(o.hasClass("qode-masonry-layout")?s:r)(a,n,t),qodeAddingToCart(),qodeAddingToWishlist()})}}))})}function o(e,t){e.on("click",function(){qode.windowWidth<=768&&(e.hasClass("opened")?(e.removeClass("opened"),t.slideUp()):(e.addClass("opened"),t.slideDown()))})}var e=$j(".qode-pl-holder"),d={},r=function(e,t,o){e.html(o),t.fadeOut()},s=function(e,t,o){e.find(".qode-pli").remove(),e.append(o).isotope("reloadItems").isotope({sortBy:"original-order"}),qodeProductImageSizes(e),setTimeout(function(){e.isotope("layout"),t.fadeOut()},400)},c=function(e,t){for(var o in t)e[o]=t[o];switch(e.ordering){case"menu_order":e.metaKey="",e.order="asc",e.orderby="menu_order title";break;case"popularity":e.metaKey="total_sales",e.order="desc",e.orderby="meta_value_num";break;case"rating":e.metaKey="_wc_average_rating",e.order="desc",e.orderby="meta_value_num";break;case"newness":e.metaKey="",e.order="desc",e.orderby="date";break;case"price":e.metaKey="_price",e.order="asc",e.orderby="meta_value_num";break;case"price-desc":e.metaKey="_price",e.order="desc",e.orderby="meta_value_num"}return e};return{init:function(){e.length&&e.each(function(){var e=$j(this);t(e),o(e.find(".qode-pl-ordering-outer h6"),e.find(".qode-pl-ordering")),o(e.find(".qode-pl-categories-label"),e.find(".qode-pl-categories-label").next("ul"))})}}}function qodeAddingToCart(){var e=$j(".qode-pli-add-to-cart .add_to_cart_button");e.length&&e.on("click",function(){$j(this).parents(".product-type-variable").length||$j(this).parents(".product-type-external").length||$j(this).parents(".product-type-grouped").length||$j(this).text(qodeGlobalVars.vars.qodeAddingToCartLabel)})}function qodeAddingToWishlist(){var e=$j(".add_to_wishlist");e.length&&e.on("click",function(){var e,t,o,i=$j(this);i.closest(".qode-pli").length?o=i.closest(".qode-pli"):i.closest(".qode-plc-item").length?o=i.closest(".qode-plc-item"):i.closest(".product").length&&(o=i.closest(".product")),e=o.find("img").offset(),t=o.find("img").height()/2,o=o.find("img").width()/2,$j("#yith-wcwl-popup-message").css({top:e.top+t,left:e.left+o}),i.addClass("qode-adding-to-wishlist"),$j(document).on("added_to_wishlist",function(){i.removeClass("qode-adding-to-wishlist"),setTimeout(function(){var e=$j("#yith-wcwl-popup-message");e.stop().addClass("qode-wishlist-vanish-out"),e.one("webkitAnimationEnd oanimationend msAnimationEnd animationend",function(){e.removeClass("qode-wishlist-vanish-out")})},1e3)})})}function qodeOpenSingleProductReviewsAccordion(){var e,t,o=$j(".qode-single-product-summary");o.length&&(e=o.find(".woocommerce-review-link"),t=o.find(".reviews_tab"),e.length&&t.length&&e.on("click",function(){t.hasClass("ui-state-active")||t.trigger("click")}))}$j(document).ready(function(){"use strict";$j(".price_slider_wrapper").parents(".widget").addClass("widget_price_filter"),initSelect2(),initAddToCartPlusMinus(),qodeInitProductListMasonryPinterestShortcode(),qodeProductPinterestAddedToCartButton(),qodeProductElegantAddedToCartButton(),qodeInitSingleProductLightbox(),qodeWishlistRefresh().init(),qodeQuickViewGallery().init(),qodeQuickViewSelect2(),qodeInitProductListMasonryShortcode(),qodeInitProductListFilter().init(),qodeAddingToCart(),qodeAddingToWishlist(),$j(document).on("qodeAjaxPageLoad",function(){qodeInitProductListMasonryPinterestShortcode()}),qodeOpenSingleProductReviewsAccordion()});