var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opens = _____WB$wombat$assign$function_____("opens");
!function(r){woodmartThemeModule.$document.on("wdReplaceMainGallery",function(){woodmartThemeModule.productImagesGallery(!0)}),r.each(["frontend/element_ready/wd_single_product_gallery.default"],function(e,o){woodmartThemeModule.wdElementorAddAction(o,function(e){woodmartThemeModule.productImagesGallery(),e.find(".woocommerce-product-gallery").css("opacity","1")})}),woodmartThemeModule.productImagesGallery=function(n=!1){woodmartThemeModule.setupMainCarouselArg(),r(".woocommerce-product-gallery").each(function(){var s,o,e=r(this),t=e.find(".woocommerce-product-gallery__wrapper:not(.quick-view-gallery)"),a=e.find(".thumbnails"),i=t.find(".wp-post-image").first();function d(){void 0!==r.fn.owlCarousel&&(t.trigger("destroy.owl.carousel"),t.addClass("owl-carousel").owlCarousel(woodmartThemeModule.mainCarouselArg),woodmartThemeModule.$document.trigger("wood-images-loaded"))}function l(){var e,o=a.data("vertical_items");i.hasClass("wd-lazy-load")&&!i.hasClass("wd-loaded")||(i.attr("data-loaded",!0),a.hasClass("wd-v-thumb-default")||a.hasClass("wd-height-calculated")||(e=t.height(),"undefined"!=typeof elementorFrontend&&elementorFrontend.isEditMode()&&(e=t.find(".wp-post-image").height()),a.css("--wd-slick-h",e+"px"),a.addClass("wd-height-calculated")),a.slick({slidesToShow:o,slidesToScroll:o,vertical:!0,verticalSwiping:!0,infinite:!1,listHeight:100,adaptiveHeight:!0}),a.on("click",".product-image-thumbnail",function(){t.trigger("to.owl.carousel",r(this).index())}),t.on("changed.owl.carousel",function(e){e=e.item.index;a.slick("slickGoTo",e),a.find(".active-thumb").removeClass("active-thumb"),a.find(".product-image-thumbnail").eq(e).addClass("active-thumb")}),a.find(".product-image-thumbnail").eq(0).addClass("active-thumb"),a.imagesLoaded(function(){a.slick("setPosition")}))}a.addClass("thumbnails-ready"),(e.hasClass("thumbs-position-without")||e.hasClass("thumbs-position-centered")||e.hasClass("thumbs-position-bottom")||e.hasClass("thumbs-position-left")||e.hasClass("thumbs-position-carousel_two_columns"))&&("yes"===woodmart_settings.product_slider_auto_height?e.imagesLoaded(function(){d()}):d()),woodmartThemeModule.$window.width()<=1024&&(e.hasClass("thumbs-position-bottom_combined")||e.hasClass("thumbs-position-bottom_column")||e.hasClass("thumbs-position-bottom_grid"))&&d(),0!==a.length&&(n&&(s="",t.find(".woocommerce-product-gallery__image").each(function(){var e=r(this),o=e.data("thumb"),t=e.find("a img").attr("alt"),a=e.find("a img").attr("title"),i="";!a&&e.find("a picture").length&&(a=e.find("a picture").attr("title")),e.find(".wd-product-video").length&&(i+=" wd-with-video"),s=(s+='<div class="product-image-thumbnail'+i+'">')+'<img alt="'+t+'" title="'+a+'" src="'+o+'" /></div>'}),a.hasClass("slick-slider")?a.slick("unslick"):a.hasClass("owl-carousel")&&a.trigger("destroy.owl.carousel"),a.empty(),a.append(s)),e.hasClass("thumbs-position-left")&&1024<woodmartThemeModule.$body.width()&&void 0!==r.fn.slick?l():void 0!==r.fn.owlCarousel&&(a.addClass("owl-carousel").owlCarousel({rtl:woodmartThemeModule.$body.hasClass("rtl"),items:a.data("desktop"),responsive:{1025:{items:a.data("desktop")},769:{items:a.data("tablet")},577:{items:a.data("tablet")},0:{items:a.data("mobile")}},dots:!1,nav:!0,navText:!1,navClass:["owl-prev wd-btn-arrow","owl-next wd-btn-arrow"]}),o=a.owlCarousel(),a.on("mouseup",".owl-item",function(){var e=r(this).index();o.trigger("to.owl.carousel",e),t.trigger("to.owl.carousel",e)}),t.on("changed.owl.carousel",function(e){e=e.item.index;o.trigger("to.owl.carousel",e),a.find(".active-thumb").removeClass("active-thumb"),a.find(".product-image-thumbnail").eq(e).addClass("active-thumb")}),a.find(".product-image-thumbnail").eq(0).addClass("active-thumb"))),i.on("load",function(){e.hasClass("thumbs-position-left")&&!i.attr("data-loaded")&&1024<woodmartThemeModule.$body.width()&&void 0!==r.fn.slick&&(a.hasClass("slick-slider")&&a.slick("unslick"),setTimeout(l))})})},woodmartThemeModule.$window.on("elementor/frontend/init",function(){elementorFrontend.isEditMode()&&woodmartThemeModule.$window.on("resize",woodmartThemeModule.debounce(function(){woodmartThemeModule.productImagesGallery()},300))}),r(document).ready(function(){woodmartThemeModule.productImagesGallery()})}(jQuery);
}