!function(t){"use strict";var e=function(t){this.createArrowsArgs=!1,this.init=function(){if(!t.closest(".splide.is-initialized")&&(this.grid=t,this.appSettings=JSON.parse(this.grid.getAttribute("data-prod-carousel-config")||"{}"),Object.keys(this.appSettings).length&&(this.gridItems=Array.from(this.grid.querySelectorAll("li")),this.gridItems.length)))return this.getSliderConfig(),this.getArrowsArgs(),this.grid.addEventListener("rey/masonry",(t=>{t.detail.masonry("destroy")})),rey.frontend.inView({target:this.grid.closest(".splide"),cb:t=>{rey.components.slider({element:t.target,config:this.sliderConfig,createArrows:this.createArrowsArgs,delay:1e3})},once:!0}),this},this.getSliderConfig=function(){this.cols=parseInt(this.appSettings.per_page),this.colsTablet=parseInt(this.appSettings.per_page_tablet),this.colsMobile=parseInt(this.appSettings.per_page_mobile),this.sliderConfig={type:"slide",autoplay:this.appSettings.autoplay,interval:parseInt(this.appSettings.interval),rewind:this.appSettings.rewind,perPage:this.cols,gap:0,arrows:!1,pagination:!1,autoWidth:this.appSettings.auto_width,breakpoints:{1024:{perPage:this.colsTablet},767:{perPage:this.colsMobile}}},!1!==this.appSettings.rewind&&(this.sliderConfig.breakpoints[1024].type="loop")},this.getArrowsArgs=function(){if(!this.appSettings.desktop_only_arrows||rey.vars.is_desktop){this.createArrowsArgs=!0;var t="";this.gridItems.length<=this.cols&&(t+="--dnone-lg",this.sliderConfig.breakpoints[2560]={destroy:!0}),this.gridItems.length<=this.colsTablet&&(this.sliderConfig.breakpoints[1024]={destroy:!0},t+=" --dnone-md --dnone-sm"),t&&(this.createArrowsArgs={navSelector:t})}},this.init()},i=function(t){(t||document).querySelectorAll("ul.products[data-prod-carousel-config]").forEach((t=>{new e(t)}))};document.addEventListener("rey-DOMContentLoaded",(function(t){i()})),rey.hooks.addAction("woocommerce/carousel/loaded",(function(t){i(t)}))}(jQuery);