!function(e){"use strict";function i(e,m){var i,c,g,h,n=(e=e.find(".minimog-feature-product")).find(".woo-single-gallery");n.length<=0||(i={},n.hasClass("has-thumbs-slider")&&(i={thumbs:{swiper:n.find(".minimog-thumbs-swiper").MinimogSwiper()}}),c=n.children(".minimog-main-swiper").MinimogSwiper(i),g=e.find(".variations_form"),h=g.data("product_variations"),g.find("select").on("change",function(){for(var e=!0,i=!1,n={},r=g.serializeArray(),t=0;t<r.length;t++){var a=r[t].name;if("attribute_"===a.substring(0,10)&&(n[a]=r[t].value,""===r[t].value)){e=!1;break}}if(!0===e){for(var o=Object.entries(n),s=0,d=0,t=h.length-1;0<=t;t--){var f=h[t],l=Object.entries(f.attributes),u=0;l.forEach(([n,r])=>{o.forEach(([e,i])=>{e!==n||i!==r&&""!==r||u++})}),d<u&&(d=u,s=f.image_id)}s?c.$wrapperEl.find(".swiper-slide").each(function(e){var i=m(this).attr("data-image-id");if(parseInt(i)===s)return c.slideTo(e),!1}):i=!0}else i=!0;i&&(i=c.$wrapperEl.find(".product-main-image").index(),c.slideTo(i))}))}e(window).on("elementor/frontend/init",function(){elementorFrontend.hooks.addAction("frontend/element_ready/tm-feature-product.default",i)})}(jQuery);