(()=>{(()=>{"use strict";var a={};a.n=i=>{var r=i&&i.__esModule?()=>i.default:()=>i;return a.d(r,{a:r}),r},a.d=(i,r)=>{for(var o in r)a.o(r,o)&&!a.o(i,o)&&Object.defineProperty(i,o,{enumerable:!0,get:r[o]})},a.o=(i,r)=>Object.prototype.hasOwnProperty.call(i,r);var b={};(()=>{const i=jQuery;var r=a.n(i),o=(n,e,t)=>new Promise((s,l)=>{var d=c=>{try{S(t.next(c))}catch(p){l(p)}},u=c=>{try{S(t.throw(c))}catch(p){l(p)}},S=c=>c.done?s(c.value):Promise.resolve(c.value).then(d,u);S((t=t.apply(n,e)).next())});class h{constructor({thumbsSliderSelector:e=".js-product-thumbs",mainSliderSelector:t=".js-product-main-images",modalSliderSelector:s=".js-modal-gallery",galleryModalSelector:l=".js-product-images-modal"}={}){this.thumbsSliderSelector=e,this.mainSliderSelector=t,this.modalSliderSelector=s,this.galleryModalSelector=l,this.mainSliderSwiperInstance=null,this.modalSliderSwiperInstance=null}init(){this.mainSliderSwiperInstance=null,this.modalSliderSwiperInstance=null,this.initProductImageSlider(),this.initModalGallerySlider()}initProductImageSlider(){return o(this,null,function*(){const e=document.querySelector(this.thumbsSliderSelector),t=document.querySelector(this.mainSliderSelector);if(!e&&!t)return;const l=yield new prestashop.SwiperSlider(e,{breakpoints:{320:{slidesPerView:3},576:{slidesPerView:4}},watchSlidesVisibility:!0,watchSlidesProgress:!0}).initSlider(),u=yield new prestashop.SwiperSlider(t,{spaceBetween:10,navigation:{nextEl:t.querySelector(".swiper-button-next"),prevEl:t.querySelector(".swiper-button-prev")},thumbs:{swiper:l}}).initSlider();this.mainSliderSwiperInstance=u})}initModalGallerySlider(){const e=document.querySelector(this.modalSliderSelector);if(!e)return;const t=()=>o(this,null,function*(){if(this.modalSliderSwiperInstance)e.style.opacity=0,setTimeout(()=>{this.modalSliderSwiperInstance.update(),this.modalSliderSwiperInstance.slideTo(this.mainSliderSwiperInstance?this.mainSliderSwiperInstance.activeIndex:0,0),e.style.opacity=1},200);else{const l=yield new prestashop.SwiperSlider(e,{slidesPerView:1,spaceBetween:10,initialSlide:this.mainSliderSwiperInstance?this.mainSliderSwiperInstance.activeIndex:0,navigation:{nextEl:e.querySelector(".swiper-button-next"),prevEl:e.querySelector(".swiper-button-prev")}}).initSlider();this.modalSliderSwiperInstance=l}});$(this.galleryModalSelector).on("show.bs.modal",t)}}const m=h;function w(){r()(".product-tabs .nav .nav-item:first-child a").tab("show")}function y(){const n=r()('[href="#product-details"]'),e=r()(n.attr("href"));e.length&&n.length&&n.hasClass("active")&&e.addClass("show active")}r()(()=>{w();const n=new m;n.init(),prestashop.on("updatedProductCombination",e=>{n.init();const{product_add_to_cart:t}=e;if(t){const s=document.createElement("div");s.innerHTML=t;const l=s.querySelector(".js-product-actions-buttons");l&&document.querySelector(".js-product-actions-buttons").replaceWith(l)}}),prestashop.on("updatedProduct",()=>{y()})})})()})();})();
