((t,o)=>{if(!t)return;const i=(null===(o=globalThis._googlesitekit)||void 0===o?void 0:o.wcdata)||{},e=i.currency,l=i.products,n=i.purchase,a=i.add_to_cart,c=i.eventsToTrack,r=null==c?void 0:c.includes("add_to_cart"),d=null==c?void 0:c.includes("purchase");if(a&&r){var s,u;const t=h(a.price,e,a);null===(s=globalThis._googlesitekit)||void 0===s||null===(u=s.gtagEvent)||void 0===u||u.call(s,"add_to_cart",t)}if(n&&d){var g,_,p;const t=n.id,o=n.totals,i=n.items,e=n.user_data,l=h(o.total_price,o.currency_code,i,t,o.shipping_total,o.tax_total);null!==(g=globalThis._googlesitekit)&&void 0!==g&&g.gtagUserData&&e&&(l.user_data=e),null===(_=globalThis._googlesitekit)||void 0===_||null===(p=_.gtagEvent)||void 0===p||p.call(_,"purchase",l)}const v=t("body");function h(t,o,i){let e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;const a={value:m(t),currency:o,items:[],googlesitekit_event_provider:"woocommerce"};if(e&&(a.transaction_id=e),"number"==typeof l&&(a.shipping=l),"number"==typeof n&&(a.tax=n),i&&i.length)for(const t of i)a.items.push(f(t));else i&&i.id&&(a.items=[f(i)]);return a}function f(t){const o=t.id,i=t.name,e=t.price,l=t.variation,n=t.quantity,a=t.categories,c={item_id:o,item_name:i,price:m(e)};if(n&&(c.quantity=n),l&&(c.item_variant=l),a&&null!=a&&a.length){let t=1;for(const o of a)c[t>1?"item_category".concat(t):"item_category"]=o.name,t++}return c}function m(t){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return parseInt(t,10)/10**o}r&&(v.on("added_to_cart",(t,o,i,n)=>{var a,c;if(null==n||!n.jquery)return;const r=parseInt(n.data("product_id"),10);if(!r)return;const d=(null==l?void 0:l.find(t=>(null==t?void 0:t.id)===r))||{},s=h(d.price,e,d);null===(a=globalThis._googlesitekit)||void 0===a||null===(c=a.gtagEvent)||void 0===c||c.call(a,"add_to_cart",s)}),t(".products-block-post-template .product, .wc-block-product-template .product").each(function(){const o=t(this),i=parseInt(o.find("[data-product_id]").attr("data-product_id"),10);i&&o.on("click",o=>{var n,a;const c=t(o.target).closest(".wc-block-components-product-button [data-product_id]");if(!c.length||!c.hasClass("add_to_cart_button")||c.hasClass("product_type_variable"))return;const r=(null==l?void 0:l.find(t=>(null==t?void 0:t.id)===i))||{},d=h(r.price,e,r);null===(n=globalThis._googlesitekit)||void 0===n||null===(a=n.gtagEvent)||void 0===a||a.call(n,"add_to_cart",d)})}))})(globalThis.jQuery);
!function(e){woodmartThemeModule.headerBuilder=function(){var s,l=e(".whb-header"),d=e(".wd-hb"),o=e(".whb-sticky-row"),a="",r=woodmartThemeModule.$window,t=!1,h=300,n="",w=l.hasClass("whb-hide-on-scroll");if(o.each(function(){var s=e(this);if(s[0].offsetHeight>10)return a=s,!1}),l.hasClass("whb-sticky-real")||l.hasClass("whb-scroll-slide")){var i=e("#wpadminbar"),c=l.find(".whb-main-header")[0].offsetHeight,f=i.length>0?i[0].offsetHeight:0;if(l.hasClass("whb-sticky-real")){if(0===a.length||a[0].offsetHeight<10||"undefined"!=typeof elementorFrontend&&elementorFrontend.isEditMode())return;l.addClass("whb-sticky-prepared"),h=Math.ceil(a.offset().top)-f}l.hasClass("whb-scroll-slide")&&(h=c+f)}if(l.hasClass("whb-sticky-clone")){var b=[];b.cloneClass=l.find(".whb-general-header").attr("class"),w&&(b.wrapperClasses="whb-hide-on-scroll"),e(".whb-clone").length&&e(".whb-clone").remove(),n=(n=(n=(n=(n=woodmart_settings.whb_header_clone).replace(/<%([^%>]+)?%>|{{([^{}]+)}}/g,function(s){var d=s.slice(2,-2);return l.find(d).length?e("<div>").append(l.find(d).first().clone()).html():void 0!==b[d]?b[d]:""})).replace(/<link[^>]*>/g,"")).replace("whb-col-1","")).replace("dropdowns-loading",""),l.after(n),(l=l.parent().find(".whb-clone")).find(".whb-row").removeClass("whb-flex-equal-sides").addClass("whb-flex-flex-middle"),window.dispatchEvent(new CustomEvent("wdHeaderBuilderCloneCreated"))}function u(){l.hasClass("whb-boxed")&&(e(".wd-offsets-calculated .wd-dropdown-menu").attr("style",""),e(".wd-offsets-calculated").removeClass("wd-offsets-calculated"),woodmartThemeModule.$window.trigger("wdHeaderBuilderStickyChanged"))}r.on("scroll",function(){var o=h,a=woodmartThemeModule.$window.scrollTop(),r=woodmartThemeModule.$window.height(),n=woodmartThemeModule.$document.height();d.length>0&&d.hasClass("wd-display")&&(o+=d[0].offsetHeight),!e(".wd-hb-close").length&&l.hasClass("whb-scroll-stick")&&(o=h),a>o?t||(t=!0,l.addClass("whb-sticked"),u()):t&&(t=!1,l.removeClass("whb-sticked"),u());var i=100;l.hasClass("whb-scroll-stick")&&(i=500),w&&(s-a>0&&a>o?(l.addClass("whb-scroll-up"),l.removeClass("whb-scroll-down")):a-s>0&&a+r!==n&&a>o+i?(l.addClass("whb-scroll-down"),l.removeClass("whb-scroll-up")):a<=o?(l.removeClass("whb-scroll-down"),l.removeClass("whb-scroll-up")):a+r>=n-5&&(l.addClass("whb-scroll-up"),l.removeClass("whb-scroll-down"))),s=a}),woodmartThemeModule.$document.trigger("wdHeaderBuilderInited")},["wdEventStarted","wdUpdatedHeader"].forEach(e=>{window.addEventListener(e,function(){woodmartThemeModule.headerBuilder()})})}(jQuery);
!function(o){woodmartThemeModule.onRemoveFromCart=function(){"no"!==woodmart_settings.woocommerce_ajax_add_to_cart&&woodmartThemeModule.$document.on("click",".widget_shopping_cart .remove",function(e){e.preventDefault(),o(this).parent().addClass("removing-process")})},o(document).ready(function(){woodmartThemeModule.onRemoveFromCart()})}(jQuery);
!function(e){woodmartThemeModule.menuOffsets=function(){e(".wd-header-main-nav ul.menu > li, .wd-header-secondary-nav ul.menu > li, .widget_nav_mega_menu ul.menu:not(.wd-nav-vertical) > li, .wd-header-main-nav .wd-dropdown.wd-design-aside ul > li").each(function(){var d=e(this);function s(){d.hasClass("wd-offsets-calculated")||d.parents(".wd-design-aside").length||(d.find(" > .menu-item-has-children").each(function(){!function(d){var s,o,n,a=d.find(" > .wd-dropdown-menu"),t=a.outerWidth(),w=a.offset();if(a.attr("style",""),t&&w)if(a.hasClass("wd-design-full-width")||a.hasClass("wd-design-aside"))o=woodmartThemeModule.$window.width(),woodmartThemeModule.$body.hasClass("rtl")?(n=o-w.left-t)+t>=o&&(s=n+t-o,a.css({right:-s})):w.left+t>=o&&(s=w.left+t-o,a.css({left:-s}));else if(a.hasClass("wd-design-sized")||a.hasClass("wd-design-full-height")){o=woodmart_settings.site_width,(woodmartThemeModule.$window.width()<o||!o||d.parents(".whb-header").hasClass("whb-full-width"))&&(o=woodmartThemeModule.$window.width()),n=o-w.left-t;var i,l=15,r=(woodmartThemeModule.$window.width()-o)/2,m=e(".wd-sticky-nav");woodmartThemeModule.$body.hasClass("wd-sticky-nav-enabled")&&m.length&&(l-=m.width()/2),woodmartThemeModule.$body.hasClass("rtl")?(i=r+n)+t>=o&&(s=i+t-o,a.css({right:-s-l})):(i=w.left-r)+t>=o&&(s=i+t-o,a.css({left:-s-l}))}}(e(this))}),woodmartThemeModule.$document.trigger("resize.vcRowBehaviour"),d.addClass("wd-offsets-calculated"))}d.hasClass("menu-item")&&(d=e(this).parent()),d.on("mouseenter mousemove",function(){s()}),woodmartThemeModule.$window.on("wdHeaderBuilderStickyChanged",s),"yes"===woodmart_settings.clear_menu_offsets_on_resize&&setTimeout(function(){woodmartThemeModule.$window.on("resize",woodmartThemeModule.debounce(function(){d.removeClass("wd-offsets-calculated"),d.find(" > .menu-item-has-children > .wd-dropdown-menu").attr("style","")},300))},2e3)})},woodmartThemeModule.menuDropdownAside=function(){e(".wd-nav .wd-design-aside, .wd-header-cats.wd-open-dropdown .wd-nav").each(function(){var d=e(this).find(".menu-item");if(d.length){var s=d.first();s.hasClass("menu-item-has-children")||s.parents(".wd-sub-menu-wrapp").addClass("wd-empty-item"),s.addClass("wd-opened").find(".wd-dropdown").addClass("wd-opened"),d.on("mouseover",function(){var d=e(this),s=d.parents(".wd-sub-menu-wrapp");d.hasClass("wd-opened")||(d.hasClass("item-level-1")&&(d.hasClass("menu-item-has-children")?s.removeClass("wd-empty-item"):s.addClass("wd-empty-item")),d.siblings().removeClass("wd-opened").find(".wd-dropdown").removeClass("wd-opened"),d.addClass("wd-opened").find(".wd-dropdown").addClass("wd-opened"))})}})},window.addEventListener("wdEventStarted",function(){setTimeout(function(){woodmartThemeModule.menuDropdownAside(),woodmartThemeModule.menuOffsets()},100)}),window.addEventListener("wdUpdatedHeader",function(){e(".whb-header .wd-offsets-calculated").removeClass("wd-offsets-calculated"),e(".whb-header .menu-item.wd-opened, .whb-header .wd-dropdown.wd-opened").removeClass("wd-opened"),e(".whb-header .wd-dropdown-menu").attr("style",""),woodmartThemeModule.menuDropdownAside(),woodmartThemeModule.menuOffsets()})}(jQuery);
!function(e){woodmartThemeModule.menuSetUp=function(){var n=e(".wd-nav, .wd-header-cats, .wd-search-cat"),d="wd-opened";if(e(".mobile-nav").find("ul.wd-nav-mobile").find(" > li").has(".wd-dropdown-menu").addClass("menu-item-has-children"),woodmartThemeModule.$document.on("click",".wd-nav .wd-event-click > a, .wd-header-cats.wd-event-click > span, .wd-search-cat-btn",function(n){n.preventDefault();var t=e(this);t.parent().siblings().hasClass(d)&&t.parent().siblings().removeClass(d),t.parent().toggleClass(d)}),woodmartThemeModule.$document.on("click",function(t){var o=t.target;if(!(!(e("."+d).length>0)||e(o).is(".wd-event-hover")||e(o).parents().is(".wd-event-hover")||e(o).parents().is("."+d)||e(o).is("."+d)||e(o).is(".wd-sticky-nav")||o.closest(".wd-cookies-popup")||o.closest(".wd-fb-holder")||0!==e(".mfp-ready").length||0!==e(".pswp--open").length)){if(n.find(".wd-event-click."+d).removeClass(d),n.hasClass("wd-event-click")&&n.removeClass(d),e(o).closest(".wd-with-overlay").length)return;e(".wd-close-side").trigger("wdCloseSideAction",["hide","click"])}}),"yes"===woodmart_settings.menu_item_hover_to_click_on_responsive){function t(){woodmartThemeModule.$window.width()<=1024?n.find(" > .menu-item-has-children.wd-event-hover").each(function(){e(this).data("original-event","hover").removeClass("wd-event-hover").addClass("wd-event-click")}):n.find(" > .wd-event-click").each(function(){var n=e(this);"hover"===n.data("original-event")&&n.removeClass("wd-event-click").addClass("wd-event-hover")})}t(),woodmartThemeModule.$window.on("resize",woodmartThemeModule.debounce(function(){t()},300))}},["wdEventStarted","wdUpdatedHeader"].forEach(e=>{window.addEventListener(e,function(){woodmartThemeModule.menuSetUp()})})}(jQuery);
!function(e){woodmartThemeModule.$document.on("wdShopPageInit",function(){woodmartThemeModule.loginSidebar()}),woodmartThemeModule.loginSidebar=function(){var o=woodmartThemeModule.$body,d=e(".login-form-side"),n=e(".wd-close-side");woodmartThemeModule.$document.on("click",".login-side-opener",function(e){d.length&&(e.preventDefault(),r()?i():setTimeout(function(){t()},10))}),o.on("click touchstart",".wd-close-side",function(){r()&&i()}),o.on("click",".close-side-widget",function(e){e.preventDefault(),r()&&i()}),woodmartThemeModule.$document.on("keyup",function(e){27===e.keyCode&&r()&&i()});var i=function(){d.trigger("wdCloseSide"),d.removeClass("wd-opened"),n.removeClass("wd-close-side-opened")},t=function(){d.trigger("wdOpenSide"),d.find("form").removeClass("hidden-form"),d.addClass("wd-opened"),n.addClass("wd-close-side-opened")};d.find(".woocommerce-notices-wrapper > ul").length>0&&t();var r=function(){return d.hasClass("wd-opened")}},e(document).ready(function(){woodmartThemeModule.loginSidebar()})}(jQuery);
!function(t){woodmartThemeModule.$document.on("wdShopPageInit wdArrowsLoadProducts wdLoadMoreLoadProducts wdProductsTabsLoaded wdSearchFullScreenContentLoaded wdBackHistory wdRecentlyViewedProductLoaded",function(){woodmartThemeModule.updateWishlistButtonState()}),woodmartThemeModule.wishlist=function(){var e="woodmart_wishlist_count",o="woodmart_wishlist_products";if(woodmart_settings.is_multisite&&(e+="_"+woodmart_settings.current_blog_id,o+="_"+woodmart_settings.current_blog_id),"undefined"!=typeof Cookies){var s=Cookies.get(e),d=0;if(void 0!==s)try{d=JSON.parse(s)}catch(l){console.log("cant parse cookies json")}void 0!==woodmart_settings.wishlist_expanded&&"yes"===woodmart_settings.wishlist_expanded||i(d),woodmartThemeModule.$body.on("click",".wd-wishlist-btn a",function(s){var d=t(this);s.preventDefault();var n=d.data("product-id"),l=t(`.wd-wishlist-btn a[data-product-id='${n}']`),c=d.data("key");if(woodmartThemeModule.$body.hasClass("logged-in")||"undefined"==typeof Cookies){if(l.addClass("loading"),!l.hasClass("added")&&void 0!==woodmart_settings.wishlist_expanded&&"yes"===woodmart_settings.wishlist_expanded&&"disable"!==woodmart_settings.wishlist_show_popup&&woodmartThemeModule.$body.hasClass("logged-in"))return void woodmartThemeModule.$document.trigger("wdShowWishlistGroupPopup",[n,c]);l.hasClass("added")?t.ajax({url:woodmart_settings.ajaxurl,data:{action:"woodmart_remove_from_wishlist",product_id:n,key:woodmart_settings.wishlist_page_nonce},dataType:"json",method:"GET",success:function(e){void 0!==e.count&&i(e.count),e.fragments&&(woodmartThemeModule.$document.trigger("wdWishlistSaveFragments",[e.fragments,e.hash]),t.each(e.fragments,function(e,o){var s=t(e);woodmartThemeModule.removeDuplicatedStylesFromHTML(o,function(t){s.replaceWith(t)},s)})),r(l,!1)},error:function(){console.log("We cant remove from wishlist. Something wrong with AJAX response. Probably some PHP conflict.")},complete:function(){l.removeClass("loading")}}):a(n,"",c)}else{var w=!0,u={},h=Cookies.get(o);if(void 0!==h&&h){var m=JSON.parse(h);Object.keys(m).length&&(u=m)}l.hasClass("added")&&void 0!==u[n]?(w=!1,delete u[n]):u[n]={product_id:n};var p=Object.keys(u).length;i(p),Cookies.set(o,JSON.stringify(u),{expires:parseInt(woodmart_settings.wishlist_cookie_expires),path:woodmart_settings.cookie_path,secure:woodmart_settings.cookie_secure_param}),Cookies.set(e,p,{expires:parseInt(woodmart_settings.wishlist_cookie_expires),path:woodmart_settings.cookie_path,secure:woodmart_settings.cookie_secure_param}),r(l,w)}}),woodmartThemeModule.$body.on("click",".wd-wishlist-remove",function(s){s.preventDefault();var d=t(this),a="";if(d.parents(".wd-wishlist-group").length&&(a=d.parents(".wd-wishlist-group").data("group-id")),d.addClass("loading"),woodmartThemeModule.$body.hasClass("logged-in")||"undefined"==typeof Cookies||1===d.parents(".wd-products").find(".wd-product").length)n(d.data("product-id"),a,d.parents(".wd-products"),function(){d.removeClass("loading")});else{d.parents(".wd-product").find("link").appendTo("head"),d.parents(".wd-product").remove();var r=Cookies.get(o),l={};void 0!==r&&r&&(l=JSON.parse(r),Object.keys(l).length&&delete l[d.data("product-id")]);var c=Object.keys(l).length;i(c),Cookies.set(o,JSON.stringify(l),{expires:parseInt(woodmart_settings.wishlist_cookie_expires),path:woodmart_settings.cookie_path,secure:woodmart_settings.cookie_secure_param}),Cookies.set(e,c,{expires:parseInt(woodmart_settings.wishlist_cookie_expires),path:woodmart_settings.cookie_path,secure:woodmart_settings.cookie_secure_param})}}),woodmartThemeModule.$body.on("click",".wd-wishlist-checkbox",function(e){var o=t(this),s=o.parents(".wd-product"),d=o.parents(".wd-products-element").siblings(".wd-wishlist-bulk-action"),i=d.find(".wd-wishlist-select-all");s.toggleClass("wd-current-product"),i.hasClass("wd-selected")&&d.hasClass("wd-visible")&&!s.hasClass("wd-current-product")&&i.removeClass("wd-selected"),s.siblings(".product").length===s.siblings(".wd-current-product").length&&s.hasClass("wd-current-product")&&i.addClass("wd-selected"),s.siblings(".wd-current-product").length||!d.hasClass("wd-visible")||s.hasClass("wd-current-product")?d.addClass("wd-visible"):d.removeClass("wd-visible")}),woodmartThemeModule.$body.on("click",".wd-wishlist-remove-action > a",function(e){e.preventDefault();var o=t(this),s=o.parents(".wd-wishlist-bulk-action").siblings(".wd-products-element").find(".products"),d=s.find(".wd-current-product"),i=[],a="";d.length&&confirm(woodmart_settings.wishlist_remove_notice)&&(o.addClass("loading"),o.parents(".wd-wishlist-group").length&&(a=o.parents(".wd-wishlist-group").data("group-id")),d.each(function(){i.push(t(this).data("id"))}),n(i,a,s,function(){o.parents(".wd-wishlist-bulk-action").removeClass("wd-visible"),o.removeClass("loading")}))}),woodmartThemeModule.$body.on("click",".wd-wishlist-select-all > a",function(e){e.preventDefault();var o=t(this).parent(),s=o.parents(".wd-wishlist-bulk-action").siblings(".wd-products-element").find(".products");o.hasClass("wd-selected")?(s.find(".product").removeClass("wd-current-product").find(".wd-wishlist-checkbox").prop("checked",!1),o.removeClass("wd-selected"),o.parents(".wd-wishlist-bulk-action").removeClass("wd-visible")):(s.find(".product").addClass("wd-current-product").find(".wd-wishlist-checkbox").prop("checked",!0),o.addClass("wd-selected"))}),woodmartThemeModule.$document.on("wdAddProductToWishlist",function(t,e,o,s,d){a(e,o,s,d)}),woodmartThemeModule.$document.on("wdRemoveProductToWishlist",function(t,e,o,s,d){n(e,o,s,d)}),woodmartThemeModule.$document.on("wdUpdateWishlistContent",function(e,o){var s,d;s=o,d=t(".wd-wishlist-content"),i(s.count),d.length>0&&!d.hasClass("wd-wishlist-preview")&&woodmartThemeModule.removeDuplicatedStylesFromHTML(s.wishlist_content,function(t){d.replaceWith(t),woodmartThemeModule.$document.trigger("wdUpdateWishlist")},d)})}function i(e){var o=t(".wd-header-wishlist");o.length>0&&o.find(".wd-tools-count").text(e)}function a(e,o,s,d=""){var a=t(".wd-wishlist-btn a[data-product-id="+e+"]");t.ajax({url:woodmart_settings.ajaxurl,data:{action:"woodmart_add_to_wishlist",product_id:e,group:o,key:s},dataType:"json",method:"GET",success:function(e){e?(e.count&&i(e.count),e.fragments&&(woodmartThemeModule.$document.trigger("wdWishlistSaveFragments",[e.fragments,e.hash]),t.each(e.fragments,function(e,o){var s=t(e);woodmartThemeModule.removeDuplicatedStylesFromHTML(o,function(t){s.replaceWith(t)},s)})),r(a)):console.log("something wrong loading wishlist data ",e),d&&d()},error:function(){console.log("We cant add to wishlist. Something wrong with AJAX response. Probably some PHP conflict.")},complete:function(){a.removeClass("loading")}})}function n(e,o,s,d=""){var a="";s&&void 0!==s.data("atts")&&((a=s.data("atts")).ajax_page=s.attr("data-paged")),t.ajax({url:woodmart_settings.ajaxurl,data:{action:"woodmart_remove_from_wishlist",product_id:e,group_id:o,key:woodmart_settings.wishlist_page_nonce,atts:a},dataType:"json",method:"GET",success:function(e){if(e.wishlist_content){var o=s.parents(".wd-products-element"),a=o.parents(".wd-wishlist-content");i(e.count),n=e,(r=o).length&&!t(".wd-wishlist-content").hasClass("wd-wishlist-preview")&&woodmartThemeModule.removeDuplicatedStylesFromHTML(n.wishlist_content,function(t){r.replaceWith(t),woodmartThemeModule.$document.trigger("wdUpdateWishlist")},r),setTimeout(function(){var e=t(".wd-wishlist-content .wd-pagination").find("a.page-numbers");e.length&&e.each(function(){var e=t(this),o=e.attr("href").split("product-page=")[1],s=parseInt(o);e.attr("href",window.location.origin+window.location.pathname+"?product-page="+s)})},500),e.hasOwnProperty("count")&&0===e.count&&a.find(".wd-wishlist-head, .wd-wishlist-bulk-action").remove()}else console.log("something wrong loading wishlist data ",e);var n,r;e.fragments&&woodmartThemeModule.$document.trigger("wdUpdateWishlistFragments",[e.fragments,e.hash]),d&&d()},error:function(){console.log("We cant remove from wishlist. Something wrong with AJAX response. Probably some PHP conflict.")}})}function r(t,e=!0){var o=woodmart_settings.wishlist_remove_button_text;e||(o=woodmart_settings.wishlist_add_button_text),t.find(".wd-action-text").length>0?t.find(".wd-action-text").text(o):t.text(o),e?t.addClass("added"):t.removeClass("added"),woodmartThemeModule.$document.trigger("added_to_wishlist"),setTimeout(function(){woodmartThemeModule.$document.trigger("wdUpdateTooltip",t)})}},woodmartThemeModule.updateWishlistButtonState=function(){if(void 0!==woodmart_settings.wishlist_save_button_state&&"yes"===woodmart_settings.wishlist_save_button_state&&"undefined"!=typeof Cookies&&!woodmartThemeModule.$body.hasClass("logged-in")){var e="woodmart_wishlist_products",o={};woodmart_settings.is_multisite&&(e+="_"+woodmart_settings.current_blog_id);var s=Cookies.get(e);void 0!==s&&s&&(o=Object.values(JSON.parse(s))),o.length&&t.each(o,function(e,o){var s=t(".wd-wishlist-btn a[data-product-id="+o.product_id+"]");if(s.length&&!s.hasClass("added")){s.addClass("added");var d=woodmart_settings.wishlist_remove_button_text;s.find(".wd-action-text").length>0?s.find(".wd-action-text").text(d):s.text(d)}})}},t(document).ready(function(){woodmartThemeModule.wishlist(),woodmartThemeModule.updateWishlistButtonState()})}(jQuery);
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports&&"function"==typeof require?e(require("jquery")):e(jQuery)}(function(e){"use strict";var t={escapeRegExChars:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},createNode:function(e){var t=document.createElement("div");return t.className=e,t.style.position="absolute",t.style.display="none",t}};function n(t,s){var i=function(){},o=this,a={ajaxSettings:{},autoSelectFirst:!1,appendTo:document.body,serviceUrl:null,lookup:null,onSelect:null,width:"auto",minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:n.formatResult,delimiter:null,zIndex:9999,type:"GET",noCache:!1,onSearchStart:i,onSearchComplete:i,onSearchError:i,preserveInput:!1,containerClass:"wd-search-suggestions",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,preventBadQueries:!0,lookupFilter:function(e,t,n){return-1!==e.value.toLowerCase().indexOf(n)},paramName:"query",transformResult:function(e){return"string"==typeof e?JSON.parse(e):e},showNoSuggestionNotice:!1,noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1};o.element=t,o.el=e(t),o.suggestions=[],o.badQueries=[],o.selectedIndex=-1,o.currentValue=o.element.value,o.intervalId=0,o.cachedResponse={},o.onChangeInterval=null,o.onChange=null,o.isLocal=!1,o.suggestionsContainer=null,o.noSuggestionsContainer=null,o.options=e.extend({},a,s),o.classes={selected:"wd-active",suggestion:"wd-suggestion"},o.hint=null,o.hintValue="",o.selection=null,o.initialize(),o.setOptions(s)}n.utils=t,e.Autocomplete=n,n.formatResult=function(e,n){var s="("+t.escapeRegExChars(n)+")";return e.value.replace(new RegExp(s,"gi"),"<strong>$1</strong>").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/&lt;(\/?strong)&gt;/g,"<$1>")},n.prototype={killerFn:null,initialize:function(){var t,s=this,i=`.${s.classes.suggestion}`,o=s.classes.selected,a=s.options;s.element.setAttribute("autocomplete","off"),s.killerFn=function(t){0===e(t.target).closest("."+s.options.containerClass).length&&(s.killSuggestions(t),s.disableKillerFn())},s.noSuggestionsContainer=e('<div class="autocomplete-no-suggestion"></div>').html(this.options.noSuggestionNotice).get(0),s.suggestionsContainer=n.utils.createNode(a.containerClass),(t=e(s.suggestionsContainer)).appendTo(a.appendTo),"auto"!==a.width&&t.width(a.width),t.on("mouseover.autocomplete",i,function(t){if(e(this).hasClass("wd-not-found"))return t.preventDefault(),!1;s.activate(e(this).data("index"))}),t.on("mouseout.autocomplete",function(){s.selectedIndex=-1,t.find("."+o).removeClass(o)}),t.on("click.autocomplete",i,function(t){if(e(this).hasClass("wd-not-found")||e(this).hasClass("wd-search-title"))return t.preventDefault(),!1;var n=e(this).find("> a").length>0;s.select(e(this).data("index"),n)}),s.fixPositionCapture=function(){s.visible&&s.fixPosition()},e(window).on("resize.autocomplete",s.fixPositionCapture),s.el.on("keydown.autocomplete",function(e){s.onKeyPress(e)}),s.el.on("keyup.autocomplete",function(e){s.onKeyUp(e)}),s.el.on("blur.autocomplete",function(){s.onBlur()}),s.el.on("focus.autocomplete",function(){s.onFocus()}),s.el.on("change.autocomplete",function(e){s.onKeyUp(e)}),s.el.on("input.autocomplete",function(e){s.onKeyUp(e)});var l=s.el.parent().find(".wd-clear-search");l&&l.on("click",function(e){s.onClearSearch(e)})},onClearSearch:function(e){var t=this;e.target.classList.contains("wd-clear-search")&&e.target.classList.add("wd-hide"),t.clear(),t.killSuggestions(e),t.el.trigger("focus")},onFocus:function(){var e=this;e.fixPosition(),0===e.options.minChars&&0===e.el.val().length&&e.onValueChange()},onBlur:function(){this.enableKillerFn()},abortAjax:function(){var e=this;e.currentRequest&&(e.currentRequest.abort(),e.currentRequest=null)},setOptions:function(t){var n=this,s=n.options;e.extend(s,t),n.isLocal=Array.isArray(s.lookup),n.isLocal&&(s.lookup=n.verifySuggestionsFormat(s.lookup)),s.orientation=n.validateOrientation(s.orientation,"bottom"),e(n.suggestionsContainer).css({"max-height":s.maxHeight+"px",width:s.width+"px","z-index":s.zIndex})},clearCache:function(){this.cachedResponse={},this.badQueries=[]},clear:function(){this.clearCache(),this.currentValue="",this.suggestions=[]},disable:function(){var e=this;e.disabled=!0,clearInterval(e.onChangeInterval),e.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var t=this,n=e(t.suggestionsContainer),s=n.parent().get(0);if(s===document.body||t.options.forceFixPosition){var i=t.options.orientation,o=n.outerHeight(),a=t.el.outerHeight(),l=t.el.offset(),r={top:l.top,left:l.left};if("auto"===i){var u=e(window).height(),c=e(window).scrollTop(),g=-c+l.top-o,d=c+u-(l.top+a+o);i=Math.max(g,d)===g?"top":"bottom"}if(r.top+="top"===i?-o:a,s!==document.body){var h,p=n.css("opacity");t.visible||n.css("opacity",0).show(),h=n.offsetParent().offset(),r.top-=h.top,r.left-=h.left,t.visible||n.css("opacity",p).hide()}"auto"===t.options.width&&(r.width=t.el.outerWidth()-2+"px"),n.css(r)}},enableKillerFn:function(){e(document).on("click.autocomplete",this.killerFn)},disableKillerFn:function(){e(document).off("click.autocomplete",this.killerFn)},killSuggestions:function(t){var n=this,s=e(t.target).hasClass("wd-clear-search");n.stopKillSuggestions(),n.intervalId=window.setInterval(function(){n.visible&&(n.el.val(n.currentValue),n.hide(!1,s)),n.stopKillSuggestions()},50)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},isCursorAtEnd:function(){var e,t=this.el.val().length,n=this.element.selectionStart;return"number"==typeof n?n===t:!document.selection||((e=document.selection.createRange()).moveStart("character",-t),t===e.text.length)},onKeyPress:function(e){var t=this;if(t.disabled||t.visible||40!==e.which||!t.currentValue){if(!t.disabled&&t.visible){switch(e.which){case 27:t.el.val(t.currentValue),t.hide();break;case 39:if(t.hint&&t.options.onHint&&t.isCursorAtEnd()){t.selectHint();break}return;case 9:if(t.hint&&t.options.onHint)return void t.selectHint();if(-1===t.selectedIndex)return void t.hide();if(t.select(t.selectedIndex),!1===t.options.tabDisabled)return;break;case 13:if(-1===t.selectedIndex)return void t.hide(!0);t.select(t.selectedIndex,!0);break;case 38:t.moveUp();break;case 40:t.moveDown();break;default:return}e.stopImmediatePropagation(),e.preventDefault()}}else t.suggest()},onKeyUp:function(e){var t=this;if(!t.disabled){switch(e.which){case 38:case 40:return}clearInterval(t.onChangeInterval),t.currentValue!==t.el.val()&&(t.findBestHint(),t.options.deferRequestBy>0?t.onChangeInterval=setInterval(function(){t.onValueChange()},t.options.deferRequestBy):t.onValueChange())}},onValueChange:function(){var t=this,n=t.options,s=t.el.val(),i=t.getQuery(s);t.selection&&t.currentValue!==i&&(t.selection=null,(n.onInvalidateSelection||e.noop).call(t.element)),clearInterval(t.onChangeInterval),t.currentValue=s,t.selectedIndex=-1,n.triggerSelectOnValidInput&&t.isExactMatch(i)?t.select(0):i.length<n.minChars?t.hide():t.getSuggestions(i)},isExactMatch:function(e){var t=this.suggestions;return 1===t.length&&t[0].value.toLowerCase()===e.toLowerCase()},getQuery:function(e){var t,n,s=this.options.delimiter;return s?null==(n=(t=e.split(s))[t.length-1])?"":"string"==typeof n?n.trim():(n+"").replace("/^[\\s\ufeff ]+|[\\s\ufeff ]+$/g",""):e},getSuggestionsLocal:function(t){var n,s=this.options,i=t.toLowerCase(),o=s.lookupFilter,a=parseInt(s.lookupLimit,10);return n={suggestions:e.grep(s.lookup,function(e){return o(e,t,i)})},a&&n.suggestions.length>a&&(n.suggestions=n.suggestions.slice(0,a)),n},getSuggestions:function(t){var n,s,i,o,a=this,l=a.options,r=l.serviceUrl;l.params[l.paramName]=t,s=l.ignoreParams?null:l.params,!1!==l.onSearchStart.call(a.element,l.params)&&("function"!=typeof l.lookup?(a.isLocal?n=a.getSuggestionsLocal(t):("function"==typeof r&&(r=r.call(a.element,t)),i=r+"?"+e.param(s||{}),n=a.cachedResponse[i]),n&&Array.isArray(n.suggestions)?(a.suggestions=n.suggestions,a.suggest(),l.onSearchComplete.call(a.element,t,n.suggestions)):a.isBadQuery(t)?l.onSearchComplete.call(a.element,t,[]):(a.abortAjax(),o={url:r,data:s,type:l.type,dataType:l.dataType},e.extend(o,l.ajaxSettings),a.currentRequest=e.ajax(o).done(function(e){var n;a.currentRequest=null,n=l.transformResult(e,t),a.processResponse(n,t,i),l.onSearchComplete.call(a.element,t,n.suggestions)}).fail(function(e,n,s){l.onSearchError.call(a.element,t,e,n,s)}))):l.lookup(t,function(e){a.suggestions=e.suggestions,a.suggest(),l.onSearchComplete.call(a.element,t,e.suggestions)}))},isBadQuery:function(e){if(!this.options.preventBadQueries)return!1;for(var t=this.badQueries,n=t.length;n--;)if(0===e.indexOf(t[n]))return!0;return!1},hide:function(t=!1,n=!1){if(!t){var s=this,i=e(s.suggestionsContainer);"function"==typeof s.options.onHide&&s.visible&&s.options.onHide.call(s.element,i,n),s.visible=!1,s.selectedIndex=-1,clearInterval(s.onChangeInterval),e(s.suggestionsContainer).hide(),s.signalHint(null)}},suggest:function(){if(0!==this.suggestions.length){var t,n=this,s=n.options,i=s.groupBy,o=s.formatResult,a=n.getQuery(n.currentValue),l=n.classes.suggestion,r=n.classes.selected,u=e(n.suggestionsContainer),c=e(n.noSuggestionsContainer),g=s.beforeRender,d="";if(s.triggerSelectOnValidInput&&n.isExactMatch(a))n.select(0);else{var h=function(n,s=""){return e.each(n,function(e,n){i&&(s+=function(e){var n=e.data[i];return t===n?"":'<div class="autocomplete-group"><strong>'+(t=n)+"</strong></div>"}(n));var r=l;n.item_classes&&(r+=" "+n.item_classes),s+='<div class="'+r+'" data-index="'+e+'">'+o(n,a)+"</div>"}),s},p=0,f=n.suggestions.reduce((e,t)=>{const n=t.group||"default";return e[n]||(e[n]={}),e[n][p]=t,p++,e},{});f?e.each(f,function(t,n){e.each(n,function(e,t){t&&t.divider&&(d+='<div class="wd-search-title title" data-index="'+e+'">'+t.divider+"</div>",delete n[e])}),d=h(n,d+=`<div class="wd-suggestions-group wd-type-${t}">`),d+="</div>"}):d=h(n.suggestions),this.adjustContainerWidth(),c.detach(),u.html(d),"function"==typeof g&&g.call(n.element,u),n.fixPosition(),u.show(),s.autoSelectFirst&&(n.selectedIndex=0,u.scrollTop(0),u.children("."+l).first().addClass(r)),n.visible=!0,n.findBestHint()}}else this.options.showNoSuggestionNotice?this.noSuggestions():this.hide()},noSuggestions:function(){var t=this,n=e(t.suggestionsContainer),s=e(t.noSuggestionsContainer);this.adjustContainerWidth(),s.detach(),n.empty(),n.append(s),t.fixPosition(),n.show(),t.visible=!0},adjustContainerWidth:function(){var t,n=this,s=n.options,i=e(n.suggestionsContainer);"auto"===s.width&&(t=n.el.outerWidth()-2,i.width(t>0?t:300))},findBestHint:function(){var t=this,n=t.el.val().toLowerCase(),s=null;n&&(e.each(t.suggestions,function(e,t){var i=0===t.value.toLowerCase().indexOf(n);return i&&(s=t),!i}),t.signalHint(s))},signalHint:function(t){var n="",s=this;t&&(n=s.currentValue+t.value.substr(s.currentValue.length)),s.hintValue!==n&&(s.hintValue=n,s.hint=t,(this.options.onHint||e.noop)(n))},verifySuggestionsFormat:function(t){return t.length&&"string"==typeof t[0]?e.map(t,function(e){return{value:e,data:null}}):t},validateOrientation:function(t,n){return t=e.trim(t||"").toLowerCase(),-1===e.inArray(t,["auto","bottom","top"])&&(t=n),t},processResponse:function(e,t,n){var s=this,i=s.options;e.suggestions=s.verifySuggestionsFormat(e.suggestions),i.noCache||(s.cachedResponse[n]=e,i.preventBadQueries&&0===e.suggestions.length&&s.badQueries.push(t)),t===s.getQuery(s.currentValue)&&(s.suggestions=e.suggestions,s.suggest())},activate:function(t){var n=this,s=n.classes.selected,i=e(n.suggestionsContainer),o=i.find(`.${n.classes.suggestion}[data-index="${t}"]`);return i.find("."+s).removeClass(s),n.selectedIndex=t,-1!==n.selectedIndex&&o?(e(o).addClass(s),o):null},selectHint:function(){var t=this,n=e.inArray(t.hint,t.suggestions);t.select(n)},select:function(e,t=!1){t||(this.hide(),this.onSelect(e))},moveUp:function(){var t=this;if(-1!==t.selectedIndex)return 0===t.selectedIndex?(e(t.suggestionsContainer).children().first().removeClass(t.classes.selected),t.selectedIndex=-1,t.el.val(t.currentValue),void t.findBestHint()):void t.adjustScroll(t.selectedIndex-1)},moveDown:function(){var e=this;e.selectedIndex!==e.suggestions.length-1&&e.adjustScroll(e.selectedIndex+1)},adjustScroll:function(t){var n=this,s=n.activate(t);if(s){var i,o,a,l=e(s).outerHeight();i=s.offsetTop,a=(o=e(n.suggestionsContainer).scrollTop())+n.options.maxHeight-l,i<o?e(n.suggestionsContainer).scrollTop(i):i>a&&e(n.suggestionsContainer).scrollTop(i-n.options.maxHeight+l),n.options.preserveInput||n.el.val(n.getValue(n.suggestions[t].value)),n.signalHint(null)}},onSelect:function(e){var t=this,n=t.options.onSelect,s=t.suggestions[e];t.currentValue=t.getValue(s.value),t.currentValue===t.el.val()||t.options.preserveInput||t.el.val(t.currentValue),t.signalHint(null),t.suggestions=[],t.selection=s,"function"==typeof n&&n.call(t.element,s)},getValue:function(e){var t,n,s=this.options.delimiter;return s?1===(n=(t=this.currentValue).split(s)).length?e:t.substr(0,t.length-n[n.length-1].length)+e:e},dispose:function(){var t=this;t.el.off(".autocomplete").removeData("autocomplete"),t.disableKillerFn(),e(window).off("resize.autocomplete",t.fixPositionCapture),e(t.suggestionsContainer).remove()}},e.fn.devbridgeAutocomplete=function(t,s){var i="autocomplete";return 0===arguments.length?this.first().data(i):this.each(function(){var o=e(this),a=o.data(i);"string"==typeof t?a&&"function"==typeof a[t]&&a[t](s):(a&&a.dispose&&a.dispose(),a=new n(this,t),o.data(i,a))})}});
!function(e){woodmartThemeModule.$document.on("wdShopPageInit",function(){woodmartThemeModule.ajaxSearch()}),e.each(["frontend/element_ready/wd_search.default"],function(e,a){woodmartThemeModule.wdElementorAddAction(a,function(){woodmartThemeModule.ajaxSearch()})}),woodmartThemeModule.ajaxSearch=function(){void 0!==e.fn.devbridgeAutocomplete&&(e("form.woodmart-ajax-search").each(function(){var a=e(this),t=parseInt(a.data("count")),d=parseInt(a.data("thumbnail")),s=parseInt(a.data("symbols_count")),n=a.find('[name="product_cat"]'),r=a.parent(),o=a.data("post_type"),l=woodmart_settings.ajaxurl+"?action=woodmart_ajax_search",c=parseInt(a.data("price")),i=a.data("sku"),u=a.parents(".wd-search-full-screen").length,h=a.parents(".wd-search-full-screen-2").length,w=a.parents(".wd-search-dropdown").length,p=r.find(`.wd-search-results${u||h?"":" > "}.wd-scroll-content`),m=r.find(".wd-search-results"),f=a.data("include_cat_search");function g(t){0!==a.parents(".wd-search-form.wd-display-form.wd-with-overlay").length&&e(".wd-close-side").trigger("wdCloseSideAction",["open"===t?"show":"hide","click"])}t>0&&(l+="&number="+t),l+="&post_type="+o,n.length&&""!==n.val()&&(l+="&product_cat="+n.val()),f&&"yes"===f&&(l+="&include_cat_search="+f),a.find('[type="text"]').on("focus keyup cat_selected",function(r){let v=e(this),_={action:"woodmart_ajax_search",number:t>0?t:void 0,post_type:o};if(v.hasClass("wd-search-inited")||(v.devbridgeAutocomplete({serviceUrl:l,appendTo:p,minChars:s,deferRequestBy:woodmart_settings.ajax_search_delay,onHide:function(e,t){h&&m.removeClass("wd-no-results");var d=h?a.parent().parent():a.parent(),s="function"==typeof woodmartThemeModule.beforeSearchcontent&&d.find(".wd-search-history, .wd-search-requests, .wd-search-area").length;t||s||g("close"),s||d.find(".wd-search-results").removeClass("wd-opened"),t||h||u?d.removeClass("wd-searched"):s||setTimeout(function(){d.removeClass("wd-searched")},400)},onSearchStart:function(){a.addClass("wd-search-loading")},beforeRender:function(t){w||g("open"),e(t).find(".wd-not-found-msg").parent().addClass("wd-not-found");var d=e(t).find(".wd-suggestion:not(.wd-not-found)").length>0;if(e(t).find('[class*="wd-type-"]')||(d=t[0].childElementCount>2),d){var s=a.serializeArray(),n=a.attr("action")+"?"+e.param(s);e(t).append('<a class="wd-all-results" href="'+n+'">'+woodmart_settings.all_results+"</a>")}e(t).removeAttr("style")},onSelect:function(e){e.permalink.length>0&&(window.location.href=e.permalink),a.parent().find(".wd-search-results").removeClass("wd-opened")},onSearchComplete:function(){a.removeClass("wd-search-loading"),woodmartThemeModule.$document.trigger("wood-images-loaded")},formatResult:function(e,t){"&"===t&&(t="&#038;");var s="("+t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")+")",n="";if(e.divider&&(n+=' <div class="suggestion-divider-title title">'+e.divider+"</div>"),d&&e.thumbnail&&(n+=' <div class="wd-suggestion-thumb">'+e.thumbnail+"</div>"),e.value&&(n+=' <div class="wd-suggestion-content wd-set-mb reset-last-child">',n+='<div class="wd-entities-title">'+e.value.replace(new RegExp(s,"gi"),"<strong>$1</strong>").replace(/&lt;(\/?strong)&gt;/g,"<$1>")+"</div>"),i&&e.sku&&(n+=' <p class="wd-suggestion-sku">'+e.sku+"</p>"),c&&e.price&&(n+=' <p class="price">'+e.price+"</p>"),e.value&&(n+=" </div>"),e.permalink){var r="";e.value&&(r=`aria-label="${e.value.replace(/(<([^>]+)>)/gi,"")}"`),n+=` <a class="wd-fill" href="${e.permalink}" ${r}></a>`}return e.products_not_found&&(n='<span class="wd-not-found-msg">'+e.value+"</span>"),h&&(e.no_results?m.addClass("wd-no-results"):m.removeClass("wd-no-results")),u||h||m.addClass("wd-opened"),h?a.parent().parent().addClass("wd-searched"):a.parent().addClass("wd-searched"),n}}),v.addClass("wd-search-inited")),n.length&&"cat_selected"===r.type){""!==n.val()&&(_.product_cat=n.val());let e=a.find('[type="text"]').devbridgeAutocomplete(),t=woodmart_settings.ajaxurl+"?"+new URLSearchParams(_).toString();f&&"yes"===f&&(t+="&include_cat_search="+f),e.setOptions({serviceUrl:t}),e.hide(),e.onValueChange()}}),woodmartThemeModule.$document.on("click",function(t){var d=t.target;e(d).is(".wd-search-form")||e(d).parents().is(".wd-search-form")||e(d).is(".wd-search-full-screen")||e(d).parents().is(".wd-search-full-screen")||e(d).is(".wd-clear-search")||a.find('[type="text"]').devbridgeAutocomplete("hide")}),e(".wd-search-results > .wd-scroll-content").on("click",function(e){e.stopPropagation()})}),e(".wd-header-search.wd-display-dropdown > a").on("click",function(e){e.preventDefault()}))},e(document).ready(function(){woodmartThemeModule.ajaxSearch()}),window.addEventListener("wdUpdatedHeader",function(){woodmartThemeModule.ajaxSearch()})}(jQuery);
woodmartThemeModule.$document.on("wdShopPageInit",function(){woodmartThemeModule.clearSearch()}),jQuery.each(["frontend/element_ready/wd_search.default"],function(e,t){woodmartThemeModule.wdElementorAddAction(t,function(){woodmartThemeModule.clearSearch()})}),woodmartThemeModule.clearSearch=function(){function e(e,t){e.value.length?t.classList.remove("wd-hide"):t.classList.add("wd-hide")}document.querySelectorAll("form .wd-clear-search").forEach(function(t){var o=t.closest("form").querySelector("input");o&&(e(o,t),o.addEventListener("keyup",function(){e(o,t)})),t.addEventListener("click",function(o){o.preventDefault();var r=t.parentNode.querySelector("input");r.value="",e(r,t);var d=r.closest(".wd-search-form.wd-display-form.wd-with-overlay"),n=d?d.querySelector(".wd-dropdown-results"):null;if(n){var c=n.querySelector(".wd-search-history"),l=n.querySelector(".wd-search-requests"),a=n.querySelector(".wd-search-area");c&&0!==c.childElementCount||l&&0!==l.childElementCount||a&&(0!==a.childElementCount||0!==a.textContent.length)||document.querySelectorAll(".wd-close-side").forEach(function(e){var t=new CustomEvent("wdCloseSideAction",{detail:["hide","click"]});e.dispatchEvent(t)})}})})},window.addEventListener("wdEventStarted",function(){woodmartThemeModule.clearSearch()});
function openMobileNavEvent(e){e.preventDefault();var t=document.querySelector(".wd-side-hidden-nav");t.classList.contains("wd-opened")?woodmartThemeModule.closeMobileNavigation():(this.parentNode.classList.add("wd-opened"),woodmartThemeModule.openMobileNavigation(t))}woodmartThemeModule.$document.on("wdCloseMobileMenu wdPjaxStart",function(){woodmartThemeModule.closeMobileNavigation()}),woodmartThemeModule.mobileNavigationClickAction=function(e){e&&e.addEventListener("click",function(e){var t=e.target.closest(".wd-nav");if(t){var o,n,i=t.classList.contains("wd-layout-dropdown"),d=t.classList.contains("wd-layout-drilldown"),a=t.classList.contains("wd-drilldown-slide"),l=e.target.closest(".wd-nav-mob-tab li"),s=e.target.closest(".menu-item-has-children > a"),r=e.target.closest(".menu-item-has-children > .wd-nav-opener"),c=e.target.closest(".mobile-nav"),u="arrow";if(this.classList.contains("wd-opener-item")&&(u="item"),woodmartThemeModule.$document.trigger("wood-images-loaded"),l){if(e.preventDefault(),l.classList.contains("wd-active"))return;var m=l.dataset.menu,w=null!==c&&c.querySelector(".wd-active");w&&w.classList.remove("wd-active"),l.classList.add("wd-active"),null!==c&&(c.querySelectorAll(".wd-nav-mobile").forEach(function(e){e.classList.remove("wd-active")}),void 0!==m&&c.querySelectorAll(`.mobile-${m}-menu`).forEach(function(e){e.classList.add("wd-active")}))}if(i){if("item"===u&&(s||r)||"arrow"===u&&r){e.preventDefault(),o=("item"===u&&s||r).parentNode;var v=(n=Array.from(o.children)).find(function(e){return e.classList.contains("wd-nav-opener")}),h=n.filter(function(e){return"UL"===e.tagName||e.classList.contains("wd-sub-menu")});o.classList.contains("opener-page")?(o.classList.remove("opener-page"),0!==h.length&&h.forEach(function(e){woodmartThemeModule.slideUp(e,200)}),[".wd-dropdown-menu .container > ul",".wd-dropdown-menu > ul"].forEach(function(e){var t=o.querySelectorAll(e);0!==t.length&&t.forEach(function(e){woodmartThemeModule.slideUp(e,200)})}),void 0!==v&&v.classList.remove("wd-active")):(o.classList.add("opener-page"),0!==h.length&&h.forEach(function(e){woodmartThemeModule.slideDown(e,200)}),[".wd-dropdown-menu .container > ul",".wd-dropdown-menu > ul"].forEach(function(e){var t=o.querySelectorAll(e);0!==t.length&&t.forEach(function(e){woodmartThemeModule.slideDown(e,200)})}),void 0!==v&&v.classList.add("wd-active"))}}else if(d){var f,p,g=e.target.closest(".menu-item-has-children .wd-drilldown-back a"),b=e.target.closest(".menu-item-has-children .wd-drilldown-back .wd-nav-opener");if(("item"===u&&(s||r)||"arrow"===u&&r)&&(f=(o=("item"===u&&s||r).parentNode).closest("ul"),void 0!==(p=(n=Array.from(o.children)).find(function(e){return e.classList.contains("wd-sub-menu")||e.classList.contains("sub-sub-menu")})))){e.preventDefault(),o.setAttribute("aria-expanded",!0),f.classList.add("wd-drilldown-hide"),f.classList.remove("wd-drilldown-show"),p.classList.add("wd-drilldown-show"),p.setAttribute("aria-expanded",!1);var L=p.querySelector(".wd-drilldown-back a"),y=L.textContent;if(y=(y=y.replaceAll("\t","")).replaceAll("\n",""),o.classList.contains("item-level-0")){var M=null;if(null!==c&&(M=c.querySelector(".wd-nav-mob-tab li.wd-active .nav-link-text")),null!==M){var S=M.textContent;S=(S=S.replaceAll("\t","")).replaceAll("\n",""),!y.includes(S)&&S.length>0&&(L.textContent=woodmart_settings.mobile_navigation_drilldown_back_to.replace("%s",S))}else o.classList.contains("cat-item")?L.textContent=woodmart_settings.mobile_navigation_drilldown_back_to_categories:y.includes(woodmart_settings.mobile_navigation_drilldown_back_to_main_menu)||(L.textContent=woodmart_settings.mobile_navigation_drilldown_back_to_main_menu)}else{var _,q=f.closest("li").querySelector(".woodmart-nav-link");_=null!==q.querySelector(".nav-link-text")?q.querySelector(".nav-link-text").textContent:null!==q.querySelector("span")?q.querySelector("span").textContent:q.textContent,!y.includes(_)&&_.length>0&&(L.textContent=woodmart_settings.mobile_navigation_drilldown_back_to.replace("%s",_))}a&&(this.querySelector("ul.wd-active").style.height=`${p.offsetHeight}px`)}(g||b)&&(e.preventDefault(),f=(o=(g||b).closest(".menu-item")).closest("ul"),p=(n=Array.from(o.children)).find(function(e){return e.classList.contains("wd-sub-menu")||e.classList.contains("sub-sub-menu")}),o.setAttribute("aria-expanded",!1),o.classList.contains("item-level-0")||f.classList.add("wd-drilldown-show"),f.classList.remove("wd-drilldown-hide"),p.classList.remove("wd-drilldown-show"),p.setAttribute("aria-expanded",!0),a&&(o.classList.contains("item-level-0")?this.querySelector("ul.wd-active").style.height="":this.querySelector("ul.wd-active").style.height=`${f.offsetHeight}px`))}}})},woodmartThemeModule.mobileNavigationAddOpeners=function(e){e.forEach(function(e){if(!e.querySelector(":scope > .wd-nav-opener")&&!e.closest(".widget_nav_mega_menu")){var t=document.createElement("span");t.classList.add("wd-nav-opener"),e.appendChild(t)}})},woodmartThemeModule.mobileNavigationCloseSideWidgets=function(e){e&&e.forEach(function(e){e.addEventListener("click",function(e){e.preventDefault(),woodmartThemeModule.closeMobileNavigation()})})},woodmartThemeModule.openMobileNavigation=function(e){var t=document.querySelector(".wd-close-side");e&&(e.classList.add("wd-opened"),jQuery(e).trigger("wdOpenSide")),t&&t.classList.add("wd-close-side-opened"),woodmartThemeModule.$document.trigger("wood-images-loaded")},woodmartThemeModule.closeMobileNavigation=function(){var e=document.querySelector(".wd-header-mobile-nav.wd-opened"),t=document.querySelector(".mobile-nav.wd-opened"),o=document.querySelector(".wd-close-side.wd-close-side-opened"),n=document.querySelector(".mobile-nav .searchform input[type=text]");e&&e.classList.remove("wd-opened"),t&&(t.classList.remove("wd-opened"),jQuery(t).trigger("wdCloseSide")),t&&o&&o.classList.remove("wd-close-side-opened"),n&&n.blur()},woodmartThemeModule.mobileNavigation=function(){var e=document.querySelectorAll(".wd-side-hidden-nav .wd-nav-mobile .menu-item-has-children"),t=document.querySelectorAll(".wd-side-hidden-nav"),o=document.querySelector(".wd-close-side"),n=document.querySelectorAll(".mobile-nav .login-side-opener, .mobile-nav .close-side-widget");woodmartThemeModule.mobileNavigationAddOpeners(e),t.forEach(function(e){woodmartThemeModule.mobileNavigationClickAction(e)}),document.querySelectorAll(".wd-header-mobile-nav > a").forEach(function(e){e.addEventListener("click",openMobileNavEvent)}),o&&(o.addEventListener("click",function(e){e.preventDefault(),woodmartThemeModule.closeMobileNavigation()}),o.addEventListener("touchstart",function(e){e.preventDefault(),woodmartThemeModule.closeMobileNavigation()},{passive:!1})),woodmartThemeModule.$document.on("keyup",function(e){27===e.keyCode&&document.querySelector(".wd-side-hidden-nav").classList.contains("wd-opened")&&woodmartThemeModule.closeMobileNavigation()}),woodmartThemeModule.mobileNavigationCloseSideWidgets(n)},window.addEventListener("load",function(){woodmartThemeModule.mobileNavigation()}),window.addEventListener("wdUpdatedHeader",function(){woodmartThemeModule.mobileNavigation()}),window.addEventListener("wdHeaderBuilderCloneCreated",function(){var e=document.querySelector(".whb-clone .wd-header-mobile-nav > a");e&&e.addEventListener("click",openMobileNavEvent)});
!function(t){woodmartThemeModule.miniCartQuantity=function(){var e;woodmartThemeModule.$document.on("change input",".woocommerce-mini-cart .quantity .qty",function(){var a=t(this),o=a.val(),r=a.parents(".woocommerce-mini-cart-item").data("key"),i=a.attr("max"),n=woodmart_settings.cart_hash_key,m=woodmart_settings.fragment_name;clearTimeout(e),parseInt(o)>parseInt(i)&&(o=i),e=setTimeout(function(){a.parents(".mini_cart_item").addClass("wd-loading"),t.ajax({url:woodmart_settings.ajaxurl,data:{action:"woodmart_update_cart_item",item_id:r,qty:o},success:function(e){e&&e.fragments&&(t.each(e.fragments,function(a,o){if(t(a).hasClass("widget_shopping_cart_content")){var i=t(o).find('.woocommerce-mini-cart-item[data-key="'+r+'"]'),n=t(o).find(".shopping-cart-widget-footer"),m=t(a).find('.woocommerce-mini-cart-item[data-key="'+r+'"]');e.cart_hash&&i.length?(m.replaceWith(i),t(".shopping-cart-widget-footer").replaceWith(n)):t(a).replaceWith(o)}else t(a.replace("_wd","")).replaceWith(o)}),woodmartThemeModule.supports_html5_storage&&(sessionStorage.setItem(m,JSON.stringify(e.fragments)),localStorage.setItem(n,e.cart_hash),sessionStorage.setItem(n,e.cart_hash),e.cart_hash&&sessionStorage.setItem("wc_cart_created",(new Date).getTime())),woodmartThemeModule.$body.trigger("wc_fragments_refreshed"))},dataType:"json",method:"GET"})},500)})},t(document).ready(function(){woodmartThemeModule.miniCartQuantity()})}(jQuery);
!function(e){woodmartThemeModule.woocommerceQuantity=function(){String.prototype.getDecimals||Object.defineProperty(String.prototype,"getDecimals",{value:function(){var e=(""+this).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return e?Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)):0},enumerable:!1}),woodmartThemeModule.$document.on("click",".plus, .minus",function(t){t.preventDefault();var a=e(this),o=a.closest(".quantity").find(".qty"),r=parseFloat(o.val()),i=parseFloat(o.attr("max")),l=parseFloat(o.attr("min")),n=o.attr("step");r&&""!==r&&"NaN"!==r||(r=0),""!==i&&"NaN"!==i||(i=""),""!==l&&"NaN"!==l||(l=0),"any"!==n&&""!==n&&void 0!==n&&"NaN"!=parseFloat(n)||(n="1"),a.is(".plus")?i&&(r+parseFloat(n)).toFixed(n.getDecimals())>=i?o.val(i):o.val((r+parseFloat(n)).toFixed(n.getDecimals())):l&&(r-parseFloat(n)).toFixed(n.getDecimals())<=l?o.val(l):r>0&&o.val((r-parseFloat(n)).toFixed(n.getDecimals())),o.trigger("change")})},e(document).ready(function(){woodmartThemeModule.woocommerceQuantity()})}(jQuery);
!function(e){woodmartThemeModule.cartWidget=function(){var o=woodmartThemeModule.$body,d=e(".cart-widget-side"),t=e(".wd-close-side");o.on("click wdOpenWidgetCart",".cart-widget-opener",function(e){i()||a()||e.preventDefault(),r()?n():setTimeout(function(){c()},10)}),o.on("click touchstart",".wd-close-side",function(){r()&&n()}),o.on("click",".close-side-widget",function(e){e.preventDefault(),r()&&n()}),woodmartThemeModule.$document.on("keyup",function(e){27===e.keyCode&&r()&&n()});var n=function(){d.trigger("wdCloseSide"),d.removeClass("wd-opened"),t.removeClass("wd-close-side-opened")},c=function(){if(i()||a())return!1;d.trigger("wdOpenSide"),d.addClass("wd-opened"),t.addClass("wd-close-side-opened")},r=function(){return d.hasClass("wd-opened")},i=function(){return woodmartThemeModule.$body.hasClass("woocommerce-cart")},a=function(){return woodmartThemeModule.$body.hasClass("woocommerce-checkout")}},e(document).ready(function(){woodmartThemeModule.cartWidget()}),window.addEventListener("wdUpdatedHeader",function(){woodmartThemeModule.cartWidget()})}(jQuery);
jQuery(function(e){if("undefined"==typeof wc_cart_fragments_params)return!1;var t=!0,r=wc_cart_fragments_params.cart_hash_key;try{t="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("wc","test"),window.sessionStorage.removeItem("wc"),window.localStorage.setItem("wc","test"),window.localStorage.removeItem("wc")}catch(f){t=!1}function n(){t&&sessionStorage.setItem("wc_cart_created",(new Date).getTime())}function o(e){t&&(localStorage.setItem(r,e),sessionStorage.setItem(r,e))}var a={url:wc_cart_fragments_params.wc_ajax_url.toString().replace("%%endpoint%%","get_refreshed_fragments"),type:"POST",data:{time:(new Date).getTime()},timeout:wc_cart_fragments_params.request_timeout,success:function(r){r&&r.fragments&&(e.each(r.fragments,function(t,r){e(t).replaceWith(r)}),t&&(sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(r.fragments)),o(r.cart_hash),r.cart_hash&&n()),e(document.body).trigger("wc_fragments_refreshed"))},error:function(){e(document.body).trigger("wc_fragments_ajax_error")}};function s(){e.ajax(a)}if(t){var i=null;e(document.body).on("wc_fragment_refresh updated_wc_div",function(){s()}),e(document.body).on("added_to_cart removed_from_cart",function(e,t,a){var s=sessionStorage.getItem(r);null!==s&&s!==undefined&&""!==s||n(),sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(t)),o(a)}),e(document.body).on("wc_fragments_refreshed",function(){clearTimeout(i),i=setTimeout(s,864e5)}),e(window).on("storage onstorage",function(e){r===e.originalEvent.key&&localStorage.getItem(r)!==sessionStorage.getItem(r)&&s()}),e(window).on("pageshow",function(t){t.originalEvent.persisted&&(e(".widget_shopping_cart_content").empty(),e(document.body).trigger("wc_fragment_refresh"))});try{var c=JSON.parse(sessionStorage.getItem(wc_cart_fragments_params.fragment_name)),_=sessionStorage.getItem(r),g=Cookies.get("woocommerce_cart_hash"),m=sessionStorage.getItem("wc_cart_created");if(null!==_&&_!==undefined&&""!==_||(_=""),null!==g&&g!==undefined&&""!==g||(g=""),_&&(null===m||m===undefined||""===m))throw"No cart_created";if(m){var d=1*m+864e5,w=(new Date).getTime();if(d<w)throw"Fragment expired";i=setTimeout(s,d-w)}if(!c||!c["div.widget_shopping_cart_content"]||_!==g)throw"No fragment";e.each(c,function(t,r){e(t).replaceWith(r)}),e(document.body).trigger("wc_fragments_loaded")}catch(f){s()}}else s();Cookies.get("woocommerce_items_in_cart")>0?e(".hide_cart_widget_if_empty").closest(".widget_shopping_cart").show():e(".hide_cart_widget_if_empty").closest(".widget_shopping_cart").hide(),e(document.body).on("adding_to_cart",function(){e(".hide_cart_widget_if_empty").closest(".widget_shopping_cart").show()}),"undefined"!=typeof wp&&wp.customize&&wp.customize.selectiveRefresh&&wp.customize.widgetsPreview&&wp.customize.widgetsPreview.WidgetPartial&&wp.customize.selectiveRefresh.bind("partial-content-rendered",function(){s()})});