function updateCarouselFromSwatch(t){const e=$(t).val(),i=$(t).closest(".product-block");if(0===i.find(".product-block-carousel").length)return;const s=$(t).closest(".owl-carousel .owl-stage"),o=i.attr("data-productid");(0===s.length?i:s.find(`.product-block[data-productid="${o}"]`)).each((function(){const t=$(this).find(".product-block-carousel"),i=t.find(`[data-color-option-value="${e}"]`),s=t.find(".carousel-default-item"),o=0===i.length?s:i;t.carousel?t.carousel(o.first().index()):(t.find(".active").removeClass("active"),o.first().addClass("active"))}))}function verifyAddToCartQuantity(t){const e=$(t).closest(".product-block").find("form .product-qty input"),i=+e.val(),s=e.is("[min]")?+e.attr("min"):1,o=e.is("[max]")?+e.attr("max"):1/0;if(oa)}function incrementCartFromProductBlock(t){const e=$(t).closest(".product-block"),i=e.find("form .product-qty input");if(1!==e.length||1!==i.length)return;const s=+i.val(),o=i.is("[min]")?+i.attr("min"):1,a=i.is("[max]")?+i.attr("max"):1/0;i.val(Math.max(o,Math.min(s+1,a))),i.toggleClass("maxStockQty",s+1>a)}function addToCartFromProductBlock(t){const e=$(t).closest(".product-block"),i=e.find("form .product-qty input");if(1!==e.length||1!==i.length)return;addToCart(+e.attr("data-productid"),e.find(".product-block-name").text(),+i.val()||1,{})}function smoothScrollToElement(t){const e=document.querySelector(t).getBoundingClientRect().top+window.scrollY-200;window.scrollTo({top:e,behavior:"smooth"})}function formatTranslation(t,e){const i=/%\{([\d\w_-]+)\}/g;return t.replace(i,((t,i)=>e[i]))}function formatAddedCartProduct(t,e){return formatTranslation(1==e?window.theme.translations.added_singular:window.theme.translations.added_qty_plural,{qty:e,name:t})}function getProductOptions(t){const e={};return $(".prod-options",t).each((function(){const t=$(this);$(this).is("fieldset")?e[t.attr("data-optionid")]=t.find(":checked").first().val():e[t.attr("data-optionid")]=t.val()})),e}function setCartToastrOptions(){toastr.options={closeButton:!0,debug:!1,newestOnTop:!1,progressBar:!0,positionClass:window.theme.options.cart_notification_position,preventDuplicates:!1,onclick:null,showDuration:"500",hideDuration:"1000",timeOut:"5000",extendedTimeOut:"1000",showEasing:"swing",hideEasing:"linear",showMethod:"fadeIn",hideMethod:"fadeOut"}}function addToCart(t,e,i,s){i=parseInt(i),Jumpseller.addProductToCart(t,i,s,{callback:function(t){if(setCartToastrOptions(),t.status&&200!=t.status)return void toastr.error(t.responseJSON.message);const s=window.theme.translations.goto_cart,o=$("#cart-link").attr("href")||"/cart",a=`${formatAddedCartProduct(e,i)} ${s}`;toastr.options.onclick=()=>window.location.href=o,toastr.success(a),$(".cart-size").text(t.products_count)}})}function addMultipleToCart(t,e){Jumpseller.addMultipleProductsToCart(t,{callback:function(i){if(setCartToastrOptions(),404==i.status)return void toastr.error(i.responseJSON.message);const s=window.theme.translations.goto_cart,o=$("#cart-link").attr("href")||"/cart",a=`${t.map(((t,i)=>formatAddedCartProduct(e[i],t[1]))).join("
")} ${s}`;toastr.options.onclick=()=>window.location.href=o,toastr.success(a),$(".cart-size").text(i.products_count)}})}function verifyQuantity(t){const e=t.max;parseInt(t.value)>parseInt(e)?(document.querySelector(".disclaimer").classList.add("fade"),document.querySelector(".disclaimer strong").innerHTML=e,t.classList.add("maxStockQty"),t.value=e):(0==t.value&&(t.value=1),t.classList.remove("maxStockQty"),document.querySelector("#add-to-cart").disabled=!1,document.querySelector(".disclaimer").classList.remove("fade"))}function addQuantityVerifyListener(t){document.querySelectorAll(t).forEach((t=>{t.addEventListener("change",(()=>verifyQuantity(t))),t.querySelectorAll(".quantity-up, .quantity-down").forEach((t=>{t.addEventListener("click",(()=>verifyQuantity(t)))}))}))}function dynamicProductFormListener(t,e=null){const i=+$("script.product-json",t).attr("data-productid"),s=JSON.parse($("script.product-json",t).get(0).textContent);if(productFormListeners.has(t))return;productFormListeners.add(t),console.info(`Listening to product variant changes at ${t} (${s.length} variants)`),$("input[type=button]#add-to-cart",t).on("click",(()=>{console.debug("click add to cart");const e=$(".product-name",t).text(),s=$("input[name=qty]",t).val()||1,o=getProductOptions(t);addToCart(i,e,s,o)}));const o=(e,i)=>{if($.isEmptyObject(i))return;const s=i.image_id,o="not-available"==i.status,a=0==i.stock&&!i.stock_unlimited,n=!o&&!a,d=i.stock>0&&!i.stock_unlimited,c=i.discount>0;$(`.owl-thumbs img[src*="image/${s}"]`,t).trigger("click"),$(".product-sku",t).toggleClass("visible",""!=i.sku),$(".product-sku",t).toggleClass("hidden",""==i.sku),$(".product-sku .product-sku__code").html(i.sku),$(".product-out-stock",t).toggleClass("hidden",!a),$(".product-available",t).toggleClass("hidden",!n),$(".product-unavailable",t).toggleClass("hidden",!o),$(".product-stock",t).parent().toggle(d),$(".product-stock span",t).text(i.stock);const u=$("input[name=qty]",t).first().val();$("input[name=qty]",t).attr("max",i.stock_unlimited?null:i.stock),$("input[name=qty]",t).val(i.stock_unlimited?u:Math.min(i.stock,u)),$(".product-form-price",t).text(i.price_discount_formatted).toggleClass("form-sale-tag",c),$(".product-form-discount",t).text(`(${i.price_formatted})`).toggle(c),r(i.custom_fields),l(i),document.querySelectorAll(`${t} input[name=qty]`).forEach(verifyQuantity)},a=t=>{for(const{value:e}of t)$(`.variants [value="${e.id}"]`).each((function(){$(this).is("input")?$(this).prop("checked",!0).trigger("change"):$(this).prop("selected",!0).trigger("change")}))},n=()=>{if(e>0)return a(s.find((t=>t.variant.id==e)).values);for(const t of s){const e=t.variant;if(e.stock_unlimited||e.stock>0)return a(t.values)}},r=e=>{$(".product-custom_field_value.cfv_only_some_variants",t).addClass("d-none"),Object.values(e||[]).forEach((e=>{$(`.product-custom_field_value.cfv_only_some_variants[data-cfvid=${e.id}]`,t).removeClass("d-none")})),$(".product-custom_field:not(:has(.product-custom_field_value:not(.d-none)))",t).addClass("d-none"),$(".product-custom_field:has(.product-custom_field_value:not(.d-none))",t).removeClass("d-none"),$(".product-custom_fields",t).toggleClass("d-none",0===$(".product-custom_field_value:not(.d-none)",t).length)},l=e=>{if(!window.theme.options.show_out_of_stock_label)return;$(".variants",t).find("option, input, button:has(input)").removeClass("disabled");const i=s.find((t=>t.variant.id==e.id)),o=i.values.map((t=>t.value.id)),a=s.filter((t=>0==t.variant.stock&&!t.variant.stock_unlimited&&t.values.filter((t=>o.includes(t.value.id))).length==o.length-1));0!=e.stock||e.stock_unlimited||a.push(i),a.forEach((i=>{const s=i.values.map((t=>t.value.id)).filter((t=>!o.includes(t)));i.variant.id==e.id&&s.push(...i.values.map((t=>t.value.id))),s.forEach((e=>$(".variants",t).find(`option[value="${e}"], input[value="${e}"], button:has(input[value="${e}"])`).addClass("disabled")))}))},d=()=>{const e=$("product-option__file-upload",t),i=new Array(e.length).fill(0);$('.variants input[type="file"]',t).each((function(t){$(this).change((function(){i[t]=this.files[0].size;const e=i.reduce(((t,e)=>t+e),0),s=document.getElementById(this.id+"_filename");e>10485760?(alert(window.theme.translations.files_too_large),i[t]=0,this.value="",s.value=""):s.value=this.files[0].name}))}))},c=`${t} select.prod-options, ${t} fieldset.prod-options`;Jumpseller.productVariantListener(c,{product:s,callback:o}),n(),d()}const productFormListeners=new Set;class OwlSlider extends HTMLElement{constructor(){super()}connectedCallback(){this.initialized||(this.initialized=!0,this.sliderid=this.getAttribute("data-slider-id"),this.thumbs=$(`.owl-thumbs[data-slider-id="${this.sliderid}"]`),this.items=$(".item",this),this.layout=this.getAttribute("ow-layout"),this.span=+this.getAttribute("ow-span"),this.loop="true"===this.getAttribute("ow-loop"),this.autoplay="true"===this.getAttribute("ow-autoplay"),this.speed=+this.getAttribute("ow-speed")||1e3,this.pause="true"===this.getAttribute("ow-hover-pause"),this.lazy="true"===this.getAttribute("ow-lazy"),this.drag="true"===this.getAttribute("ow-drag"),this.dots="true"===this.getAttribute("ow-dots"),this.nav="true"===this.getAttribute("ow-nav"),this.sliderid&&0===this.thumbs.length&&console.warn(`Enabled thumbs with data-slider-id="${this.sliderid}" but matching .owl-thumbs not found`,this),this.initOwlCarousel())}initOwlCarousel(){$(this).owlCarousel(this.#t())}slideTo(t){$(this).carousel(+t)}#e(){return this.sliderid&&this.thumbs.length>0}#i(){const t={one:{items:1},related:{responsive:{0:{items:1,margin:8,stagePadding:40},600:{items:3,margin:15,stagePadding:30},1e3:{items:4,stagePadding:30}}},logo:{margin:30,stagePadding:30},"product-slider":{margin:30,responsive:{0:{items:window.theme.options.product_block_2_columns?2:1,margin:8},350:{items:2,margin:8},768:{items:3,margin:15},1e3:{items:4}}},"logo-slider":{margin:30,stagePadding:30,responsive:{0:{items:3,margin:8},600:{items:4,margin:15},1e3:{items:this.span||6}}},testimonials:{items:1,margin:30,responsive:{575:{items:this.span||6}}},"featured-reviews":{margin:30,responsive:{0:{items:1},768:{items:2},991:{items:3},1200:{items:4}}},"trust-bar":{responsive:{0:{items:1,margin:0},600:{items:2,margin:30,stagePadding:30},1e3:{items:this.span||3}}}};if(Object.prototype.hasOwnProperty.call(t,this.layout))return t[this.layout];throw new Error(`Missing or invalid data-layout in owl-slider: ${this.layout}`)}#t(){return{loop:this.loop&&this.items.length>1,rewind:!this.loop&&this.items.length>1,margin:0,autoHeight:1!==this.items.length,autoplay:this.autoplay,autoplayTimeout:this.speed,autoplayHoverPause:this.pause,touchDrag:this.drag,mouseDrag:this.drag,lazy:this.lazy,thumbs:this.#e(),thumbsPrerendered:this.#e(),dots:this.dots,nav:this.nav,navText:['',''],...this.#i()}}}window.customElements.define("owl-slider",OwlSlider);class ParallaxWrapper extends HTMLElement{static configs={Right:{orientation:"right"},Up:{delay:.6,transition:"cubic-bezier(0,0,0,1)"},Down:{orientation:"down",scale:1.5,transition:"cubic-bezier(0,0,0,1)"},default:{}};constructor(){super(),this.parallax="true"===this.getAttribute("pw-parallax"),this.direction=this.getAttribute("pw-direction")||"default",this.parallax&&this.initParallax()}initParallax(){new simpleParallax(this,ParallaxWrapper.configs[this.direction])}}window.customElements.define("parallax-wrapper",ParallaxWrapper);class FooterNewsletter extends HTMLElement{constructor(){super(),this.placeholder=this.getAttribute("fn-email-placeholder")}connectedCallback(){const t=this.querySelector("form");t&&this.#s(t)}#s(t){t.classList.add("validate"),t.querySelector(".newsletter_form_group").classList.add("form-group","mb-0"),t.querySelector("input[name='customer[email]']").classList.add("email","field","form-control"),t.querySelector("input[name='customer[email]']").placeholder=this.placeholder,t.querySelector("button").classList.add("btn","btn-link","p0"),t.querySelector("button").innerHTML=''}}window.customElements.define("footer-newsletter",FooterNewsletter);class InstagramFeed extends HTMLElement{connectedCallback(){this.#o()}#o(){const t=+this.getAttribute("ig-limit"),e=new XMLHttpRequest,i=this;e.open("GET",`/instagram-app/media?count=${t}`,!0),e.onreadystatechange=function(){if(this.readyState===XMLHttpRequest.DONE&&200===this.status){JSON.parse(e.responseText).posts.slice(0,t).forEach((t=>{const e=t.thumbnail_url,s=document.createElement("div");s.className="insta_img lazy",s.style.backgroundImage=`url(${e})`;const o=document.createElement("a");o.href=t.permalink,o.target="_blank",o.appendChild(s),i.appendChild(o)}))}},e.send()}}window.customElements.define("instagram-feed",InstagramFeed);class ProductReviews extends HTMLElement{constructor(){super(),this.reviewsPage=1,this.sort="date_desc"}connectedCallback(){this.product=this.getAttribute("data-productid"),this.moreReviewsButton=$(".more-reviews",this),this.currentSortText=$(".current-sort",this),this.loadingIcon=$(".loading-reviews",this),this.sortItems=$(".product-reviews-dropdown .dropdown-item",this),this.container=$(".product-reviews-container",this),this.moreReviewsButton.on("click",(()=>this.#a())),this.#n(),this.#r(),this.#a(),$(window).resize(Jumpseller.throttle(500,(()=>this.#l())))}#n(){$("a[pr-sort]",this).on("click",(t=>{const e=$(t.target);this.sort=e.attr("pr-sort"),this.sortItems.removeClass("selected"),e.addClass("selected"),this.currentSortText.text(e.text()),this.#r(),this.#a()}))}#r(){this.container.empty(),this.reviewsPage=1}async#a(){this.moreReviewsButton.hide(),this.loadingIcon.show();try{const t=await Jumpseller.fetchReviews(this.product,this.reviewsPage++,this.sort,window.theme.options.pp_reviews_limit),{reviews:e,page_count:i}=t;e.forEach((t=>{this.container.append(this.#d(t.text,t.rating,t.customer,t.date))})),this.#l(),this.reviewsPage>i?this.moreReviewsButton.hide():this.moreReviewsButton.show()}catch(t){this.moreReviewsButton.show(),console.error(t)}this.loadingIcon.hide()}#d(t,e,i,s){const o=''.repeat(e),a=''.repeat(5-e),n=$('