theme.CarouselProducts=function(){function t(t){this.$container=$(t),this.namespace=".carousel-products",this.onLoad()}return t.prototype=$.extend({},Section.prototype,t.prototype,{_checkProduct:function(a,t){var o=this,i=a.attr("data-handle");return!!i&&(t&&t(a),$.ajax({type:"GET",url:"https://"+window.location.hostname+"/products/"+i,data:{view:"collection"},cache:!1,dataType:"html",success:function(t){var e=$(t).clone();e.find("img").one("load",function(){a.add(o.$slick.find('.slick-cloned[data-handle="'+i+'"]')).html(e).removeAttr("data-handle")}),a.trigger("loaded")}}),!0)},onLoad:function(){var d=this,o=this.$container.find("[data-js-carousel]"),l=this.$container.find("[data-js-carousel-slick]"),i=this.$container.find("[data-carousel-control]"),n=this.$container.find("[data-carousel-items]"),s=null;if(this.$control=i,l.length){var c=l.find("> *"),t=o.find("[data-js-carousel-prev]"),e=o.find("[data-js-carousel-next]"),a=t.add(e),u=+o.attr("data-count"),r="true"===o.attr("data-autoplay"),h=+o.attr("data-speed"),p="true"===o.attr("data-infinite"),f="true"===o.attr("data-arrows"),m="true"===o.attr("data-bullets");if(this.$slick=l,f){function v(){var t=0;l.find(".carousel__item img").each(function(){t=Math.max(t,$(this).innerHeight())}),a.css({top:t/2})}$window.on("theme.resize.carousel-products",v)}function k(){l.one("init",function(){f&&v(),o.removeClass("invisible"),theme.Loader.unset(o.parent())}),l.on("beforeChange",function(t,e,a,o){var i=o-1,n=o+u;function s(t){c.unbind("loaded"),t.one("loaded",function(){theme.ProductReview.update()})}d._checkProduct(l.find('[data-slick-index="'+i+'"]'),s);for(var r=n;a+1 *"),k(),theme.ImagesLazyLoad.update(),theme.ProductReview.update(),theme.Tooltip&&theme.Tooltip.init(),i.find("a").removeClass("active"),e.addClass("active"),s=null}})}return t.preventDefault(),!1}),theme.is_loaded&&(theme.ImagesLazyLoad.update(),theme.ProductReview.update(),theme.Tooltip&&theme.Tooltip.init())}},onUnload:function(){this.$container.off(this.namespace),this.$slick&&(this.$slick.slick("destroy").off(),this.$slick=null,$window.unbind("theme.resize.carousel-products")),this.$control.off(),theme.Tooltip&&theme.Tooltip.destroy()}}),t}(),$(function(){theme.sections.register("carousel-products",theme.CarouselProducts)});