"use strict";!function(r){var e=e||{};e.gallery={productGallerySelector:".woocommerce-product-gallery",init:function(){r(document).on("wc-product-gallery-before-init",this.productGallerySelector,this.beforeProductGalleryInitHandler.bind(this)),r(document).on("wc-product-gallery-after-init",this.productGallerySelector,this.afterProductGalleryInitHandler.bind(this))},beforeProductGalleryInitHandler:function(e,i){r(i).parent().is(".gallery-quickview")&&(wc_single_product_params.flexslider.controlNav="thumbnails")},afterProductGalleryInitHandler:function(e,i){var t,a,l=r(i);!l.parent().is(".gallery-default, .gallery-vertical, .gallery-quickview, .gallery-showcase, .gallery-full-width")||(i=l.data("product_gallery"))&&i.$images&&((i=l.find(".flex-control-thumbs")).find("li").length<=5||(l.parent().is(".gallery-vertical, .gallery-showcase")?(i.addClass("swiper-wrapper botiga-slides"),i.find("li").addClass("swiper-slide"),i.wrapAll('<div class="swiper botiga-swiper"></div>'),(a=l.find(".botiga-swiper")).append('<div class="botiga-swiper-button botiga-swiper-button-next"></div>'),a.append('<div class="botiga-swiper-button botiga-swiper-button-prev"></div>'),t=new Swiper(a.get(0),{direction:"vertical",slidesPerView:6,spaceBetween:20,navigation:{nextEl:".botiga-swiper-button-next",prevEl:".botiga-swiper-button-prev"}}),r(window).on("resize botiga.resize",function(){var e=window.innerWidth||document.documentElement.clientWidth;e<991&&"horizontal"!==t.params.direction?(t.changeDirection("horizontal"),t.params.slidesPerView=5,t.update()):991<e&&"vertical"!==t.params.direction&&(t.changeDirection("vertical"),t.params.slidesPerView=6,t.update())}).trigger("botiga.resize")):l.parent().is(".gallery-default, .gallery-quickview, .gallery-full-width")&&(i.addClass("botiga-slides"),i.wrapAll('<div class="botiga-flexslider"></div>'),a=l.find(".botiga-flexslider"),i=l.parent().is(".gallery-quickview")?85:95,a.flexslider({namespace:"botiga-flex-",selector:".botiga-slides > li",animation:"slide",controlNav:!1,animationLoop:!1,slideshow:!1,itemWidth:i,itemMargin:20,keyboard:!1,asNavFor:l.get(0)}),l=r(".botiga-flexslider .botiga-flex-next").text(),r(".botiga-flexslider .botiga-flex-next").text("").append("<span>"+l+"</span>"),l=r(".botiga-flexslider .botiga-flex-prev").text(),r(".botiga-flexslider .botiga-flex-prev").text("").append("<span>"+l+"</span>"))))}},r(document).ready(function(){e.gallery.init()})}(jQuery);