File: /home/zwafgyp/lacalita/wp-content/plugins/rey-core/assets/js/woocommerce/loop-slideshows.js
!function(t){"use strict";var e=function(e){var i=this;this.init=function(){if(!rey.util.alreadyLoaded(e)&&(this.$slider=t(e),this.$product=this.$slider.closest("li.product"),this.$wrapper=this.$slider.closest(".splide"),this.$productsGrid=this.$slider.closest("ul.products"),this.$dots=t(".rey-productSlideshow-dots",this.$wrapper),this.$thPos=t(".rey-thPos",this.$product),!this.$wrapper.hasClass("is-active")&&(!reyParams.js_params.product_item_slideshow_disable_mobile||rey.vars.is_desktop)&&!this.$productsGrid.hasClass("--prevent-thumbnail-sliders")&&!this.$slider.hasClass("--prevent-thumbnail-sliders"))){if(this.$dots.length){var i=["top-left","top-right","bottom-left","bottom-right","bottom-center"];this.$product.is(".rey-wc-skin--wrapped")&&i.splice(2,3),this.$thPos.each((function(e,r){var s=t(r).attr("data-position");"bottom-center"===s&&i.splice(2,2);var o=i.indexOf(s);-1!==o&&i.splice(o,1)})),this.$dots.attr("data-position")||(i.length?this.$dots.attr("data-position",i[0]):this.$dots.attr("data-position","top-center"))}return t(".rey-productThumbnail-extra[data-slideshow-lazy]",this.$slider).each((function(){var e=t(this);e.attr("src",e.attr("data-slideshow-lazy")).removeAttr("data-slideshow-lazy")})),this.makeSlider(),this}},this.checkMasonry=function(){void 0!==t.fn.masonry&&this.$productsGrid.hasClass("--msnry-initialised")&&this.$productsGrid.masonry()},this.makeSlider=function(){if(!rey.vars.is_mobile||!this.$product.hasClass("--extraImg-mobile-disabled")){var e="."+this.$wrapper.attr("data-pagination-id"),r="."+this.$wrapper.attr("data-arrows-id"),s={type:"slide",rewind:!0,perPage:1,perMove:1,autoplay:!1,gap:0,arrows:!1,pagination:!1,autoWidth:!0};rey.hooks.addAction("rey/slider",((r,s)=>{if(this.$wrapper[0].isEqualNode(r.element)){var o,a=t(e,i.$wrapper);if(i.$wrapper.hasClass("--dots-hover")&&t("button",a).on("mouseenter",(function(){s.go(t(this).attr("data-go"))})),i.$wrapper.hasClass("--slide-hover"))i.$wrapper.on("mouseenter",(function(){clearTimeout(o),o=setTimeout((function(){0===s.index&&s.go(1)}),reyParams.js_params.product_item_slideshow_hover_delay)})).on("mouseleave",(function(){clearTimeout(o),1===s.index&&s.go(0)}));i.checkMasonry(),rey.hooks.addAction("view_selector/change_cols",(function(){var t=s.root.querySelector(".splide__list.--auto-height");t&&(t.style.height="",s.refresh()),s.go(0)})),s.on("move",(function(t,e){i.checkMasonry()}))}}));var o=!0;this.$product.hasClass("--customImageContainerHeight")&&(o=!1),rey.frontend.inView({target:this.$wrapper[0],cb:t=>{rey.components.slider({element:t.target,config:s,customPagination:e,customArrows:r,animateHeight:o})},once:!0})}},this.init()},i=function(t,i){var r=[],s=[];i?r=i:t?r.push(t):r.push(document),r.forEach((t=>{t.querySelectorAll(".rey-productSlideshow").forEach((t=>{s.push(t)}))})),s.length&&rey.frontend.inView({target:s,once:!0,cb:function(t){new e(t.target)}})};document.addEventListener("rey-DOMContentLoaded",(function(){i()})),rey.hooks.addAction("ajaxfilters/finished",(function(t){i(t)})),rey.hooks.addAction("product/loaded",(function(t){i(!1,t)})),rey.hooks.addAction("infinite/refresh",(function(t){i(t)})),rey.hooks.addAction("elementor/init",(function(t){t.registerElement({name:"reycore-product-grid.default",cb:function(t){var e=t[0].querySelector(".reyEl-productGrid ul.products");e&&i(e)}})}))}(jQuery);