!function(c){woodmartThemeModule.wishlist=function(){var d="woodmart_wishlist_count",i="woodmart_wishlist_products";if(woodmartThemeModule.$body.hasClass("logged-in")&&(d+="_logged"),woodmart_settings.is_multisite&&(d+="_"+woodmart_settings.current_blog_id,i+="_"+woodmart_settings.current_blog_id),"undefined"!=typeof Cookies){var e=Cookies.get(d),t=0;if(void 0!==e)try{t=JSON.parse(e)}catch(e){console.log("cant parse cookies json")}void 0!==woodmart_settings.wishlist_expanded&&"yes"===woodmart_settings.wishlist_expanded||a(t),woodmartThemeModule.$body.on("click",".wd-wishlist-btn a",function(e){var t=c(this);if(t.hasClass("added"))return!0;e.preventDefault();var o,e=t.data("product-id"),s=t.data("key");woodmartThemeModule.$body.hasClass("logged-in")||"undefined"==typeof Cookies?(t.addClass("loading"),void 0!==woodmart_settings.wishlist_expanded&&"yes"===woodmart_settings.wishlist_expanded&&"disable"!==woodmart_settings.wishlist_show_popup&&woodmartThemeModule.$body.hasClass("logged-in")?woodmartThemeModule.$document.trigger("wdShowWishlistGroupPopup",[e,s]):n(e,"",s)):(s={},void 0!==(o=Cookies.get(i))&&o&&(o=JSON.parse(o),Object.keys(o).length&&(s=o)),s[e]={product_id:e},a(o=Object.keys(s).length),Cookies.set(i,JSON.stringify(s),{expires:7,path:"/",secure:woodmart_settings.cookie_secure_param}),Cookies.set(d,o,{expires:7,path:"/",secure:woodmart_settings.cookie_secure_param}),l(t))}),woodmartThemeModule.$body.on("click",".wd-wishlist-remove",function(e){e.preventDefault();var t,o=c(this),e="";o.parents(".wd-wishlist-group").length&&(e=o.parents(".wd-wishlist-group").data("group-id")),o.addClass("loading"),woodmartThemeModule.$body.hasClass("logged-in")||"undefined"==typeof Cookies||1===o.parents(".products.elements-grid").find(".product-grid-item").length?r(o.data("product-id"),e,o.parents(".wd-products-holder"),function(){o.removeClass("loading")}):(o.parents(".product-grid-item").remove(),e={},void 0!==(t=Cookies.get(i))&&t&&(e=JSON.parse(t),Object.keys(e).length&&delete e[o.data("product-id")]),a(t=Object.keys(e).length),Cookies.set(i,JSON.stringify(e),{expires:7,path:"/",secure:woodmart_settings.cookie_secure_param}),Cookies.set(d,t,{expires:7,path:"/",secure:woodmart_settings.cookie_secure_param}))}),woodmartThemeModule.$body.on("click",".wd-wishlist-checkbox",function(e){var t=c(this),o=t.parents(".product-grid-item"),t=t.parents(".wd-products-element").siblings(".wd-wishlist-bulk-action"),s=t.find(".wd-wishlist-select-all");o.toggleClass("wd-current-product"),s.hasClass("wd-selected")&&t.hasClass("wd-visible")&&!o.hasClass("wd-current-product")&&s.removeClass("wd-selected"),o.siblings(".product").length===o.siblings(".wd-current-product").length&&o.hasClass("wd-current-product")&&s.addClass("wd-selected"),o.siblings(".wd-current-product").length||!t.hasClass("wd-visible")||o.hasClass("wd-current-product")?t.addClass("wd-visible"):t.removeClass("wd-visible")}),woodmartThemeModule.$body.on("click",".wd-wishlist-remove-action > a",function(e){e.preventDefault();var t=c(this),e=t.parents(".wd-wishlist-bulk-action").siblings(".wd-products-element").find(".products"),o=e.find(".wd-current-product"),s=[],d="";o.length&&confirm(woodmart_settings.wishlist_remove_notice)&&(t.addClass("loading"),t.parents(".wd-wishlist-group").length&&(d=t.parents(".wd-wishlist-group").data("group-id")),o.each(function(){s.push(c(this).data("id"))}),r(s,d,e,function(){t.parents(".wd-wishlist-bulk-action").removeClass("wd-visible"),t.removeClass("loading")}))}),woodmartThemeModule.$body.on("click",".wd-wishlist-select-all > a",function(e){e.preventDefault();var e=c(this).parent(),t=e.parents(".wd-wishlist-bulk-action").siblings(".wd-products-element").find(".products");e.hasClass("wd-selected")?(t.find(".product").removeClass("wd-current-product").find(".wd-wishlist-checkbox").prop("checked",!1),e.removeClass("wd-selected"),e.parents(".wd-wishlist-bulk-action").removeClass("wd-visible")):(t.find(".product").addClass("wd-current-product").find(".wd-wishlist-checkbox").prop("checked",!0),e.addClass("wd-selected"))}),woodmartThemeModule.$document.on("wdAddProductToWishlist",function(e,t,o,s,d){n(t,o,s,d)}),woodmartThemeModule.$document.on("wdRemoveProductToWishlist",function(e,t,o,s,d){r(t,o,s,d)}),woodmartThemeModule.$document.on("wdUpdateWishlistContent",function(e,t){var o;t=t,o=c(".wd-wishlist-content"),a(t.count),0