(function($,wetheme){var sliders={};function toHandle(o){return o.replace(/[()]/g,"").replace(/[\W]/g,"-")}function block_select(event2){var slider=sliders[event2.detail.sectionId];if(slider){var index=parseInt(event2.target.dataset.slideIndex);slider.show_slide(index)}event2.target.dataset.megaMenuBlockId&&($("[data-mega-menu-block-id="+event2.target.dataset.megaMenuBlockId+"]").closest("li.mega-menu").addClass("force-open"),$(".overlay-header").addClass("force-hover"))}function block_deselect(event2){var slider=sliders[event2.detail.sectionId];slider&&slider.start_animation(),$("li.mega-menu.force-open").removeClass("force-open"),$(".overlay-header").removeClass("force-hover")}function get_section_name(event2){var section=null;if(event2&&event2.detail){var data={},dataset=event2.target.dataset;for(var key in dataset)dataset.hasOwnProperty(key)&&key.indexOf("themeEditorSection-")===0&&(data=JSON.parse(dataset[key]));data.hasOwnProperty("type")&&(section=data.type)}return section}function section_select(event2){(event2.target.classList.contains("image-with-text-overlay-wrapper")||event2.target.classList.contains("image-with-text-wrapper"))&&event2.detail.load==!0&&reapply_kb_effect(event2.target),header_height()}document.addEventListener("shopify:section:select",section_select),document.addEventListener("shopify:section:load",load_all),document.addEventListener("shopify:section:unload",unload_all),window.addEventListener("load",load_all);try{window.parent.messenger.on("stylesheetContent",load_all),window.addEventListener("unload",function(){window.parent.messenger.off("stylesheetContent",load_all)})}catch{}$(document).ready(function(){load_show_on_scroll()});function load_all(event2){document.addEventListener("shopify:block:select",block_select),document.addEventListener("shopify:block:deselect",block_deselect);var section=get_section_name(event2);(!section||section==="products-block")&&(load_homepage_fading(),load_featured_masonry()),load_blog_masonry(),(!section||section==="slideshow")&&(load_slider(event2&&event2.target),header_height(),$(window).off("resize",header_height).on("resize",header_height)),(!section||section==="featured-blog")&&load_carousel(),(!section||section==="text-adverts")&&load_TextAdvertCarousel(),(!section||section==="product-template")&&(load_swatches(),load_reviews(),load_imageZoomEvents(),load_sticky()),(!section||section==="product-recommendations")&&load_product_recommendations(),(!section||section==="indiv-product")&&load_product_review_badges(),(!section||section==="product-template"||section==="indiv-product")&&(load_ownCarousel(),load_quantity_selector(),load_option_selectors(event2.target),load_tabs(),load_readmore()),(!section||section==="header")&&(load_accessible_menu(),load_sticky(),load_sticky_header(),load_log_in(),load_search_drawer(),load_cart_indicator()),load_ken_burns(),(!section||section==="products-block")&&load_product_block(),(!section||section==="home-hero"||section==="video"||section==="video-hero")&&(load_youtube_section(),load_vimeo_api()),(!section||section==="home-hero")&&load_hero(),(!section||section==="video-hero")&&(load_mp4_video_hero(),header_height(),$(window).off("resize",header_height).on("resize",header_height)),(!section||section==="map"||section==="page-contact-template")&&load_googlemaps(),(!section||section==="feature-row"||section==="image-with-text-overlay"||section==="collection-template"||section==="page-contact-template"||section==="list-collections-template")&&load_parallax(),(!section||section==="featured-products")&&load_image_badge_positions(),section||load_drawer_sticky_menu(),$("#DrawerOverlay").off("click").on("click",function(evt){timber.LeftDrawer.drawerIsOpen&&(timber.LeftDrawer.close(),evt.stopImmediatePropagation()),timber.RightDrawer.drawerIsOpen&&(timber.RightDrawer.close(),evt.stopImmediatePropagation())}),$(document).on("keyup",function(evt){evt.keyCode==27&&timber.RightDrawer.drawerIsOpen&&(timber.RightDrawer.close(),evt.stopImmediatePropagation())});var has_search=$(".search-button").length>0;$(".input-group.search-bar").toggle(has_search),load_page_fade(),load_popup()}function unload_all(){document.removeEventListener("shopify:block:select",block_select),document.removeEventListener("shopify:block:deselect",block_deselect),sliders={}}function load_popup(){var popup=document.querySelector("#popup");popup&&new Popup(popup)}function Popup(el){this.el=el,this.STORAGE_KEY="wetheme-popup",this.isFullscreen=this.el.dataset.desktopType==="fullscreen",this.popupSkipDays=parseInt(this.el.dataset.popupTime,10),this.popupDelay=parseInt(this.el.dataset.popupDelay,10),this.testMode=this.el.dataset.popupTestMode==="true",this.testMode?this.show():this.isExpiredOrNotSet()&&setTimeout(function(){this.setExpiry(this.popupSkipDays),this.show()}.bind(this),1e3*this.popupDelay),$(".popup--close-btn").on("click",function(){this.el.classList.remove("visible")}.bind(this)),$(window).on("resize",this.onResize.bind(this))}Popup.prototype.isExpiredOrNotSet=function(){var expired=!0,popupInfo=window.localStorage.getItem(this.STORAGE_KEY);if(popupInfo)try{var expiry=Date.parse(JSON.parse(popupInfo).expiry);expiry>Date.now()&&(expired=!1)}catch(e){console.warn("Unable to read popup expiry date",e)}return expired},Popup.prototype.setExpiry=function(days){var expiry=new Date(Date.now()+days*24*60*60*1e3);try{localStorage.setItem(this.STORAGE_KEY,JSON.stringify({expiry:expiry.toISOString()}))}catch(e){console.warn("Unable to set popup expiry:",e)}},Popup.prototype.onResize=function(){var isFullscreenOpen=$.fancybox.isOpen;$(window).width()<769?isFullscreenOpen&&($.fancybox.close(),this.showSlideUp()):(this.el.classList.contains("visible")&&this.isFullscreen&&(this.el.classList.remove("visible"),this.showFullscreen()),isFullscreenOpen&&$.fancybox.reposition())},Popup.prototype.show=function(){$(window).width()<769?($.fancybox.close(),this.showSlideUp()):this.isFullscreen?(this.el.classList.remove("visible"),this.showFullscreen()):this.showSlideUp()},Popup.prototype.showSlideUp=function(){document.querySelector("#slide-up").removeAttribute("style"),document.querySelector("#popup").classList.add("slide-up"),document.querySelector("#popup").classList.add("visible")},Popup.prototype.showFullscreen=function(){document.querySelector("#popup").classList.add("fullscreen"),document.querySelector("#fullscreen").removeAttribute("style"),$.fancybox({autoScale:!0,transitionIn:"elastic",transitionOut:"elastic",speedIn:500,speedOut:300,autoDimensions:!0,centerOnScroll:!0,href:"#popup #fullscreen",wrapCSS:"fullscreen-popup-fancybox",tpl:{closeBtn:''}})};function load_page_fade(){document.body.classList.add("loaded"),window.addEventListener("beforeunload",function(){document.body.classList.add("unloading")})}function load_show_on_scroll(){$(window).on("scroll",function(){show_on_scroll_checker()}),show_on_scroll_checker(),new WOW().init()}function show_on_scroll_checker(){var window_height=$(window).height();$(".show-on-scroll").each(function(index,section){var rect=section.getBoundingClientRect();rect.bottom>=0&&rect.top768){var context=$(".context");if(context.height()>$productSticky.height()){var $site_header=$(".site-header"),offset=0;$site_header.hasClass("sticky-header")&&(offset=$site_header.outerHeight()||0),$productSticky.sticky({context:".context",offset,bottomOffset:50,observeChanges:!0})}}}if(checkWidth(),$(window).on("resize",checkWidth),$("#shopify-product-reviews").length>=0)var wait_for_review=setInterval(function(){var review_button=$(".spr-summary-actions-newreview");review_button.length!==0&&(clearInterval(wait_for_review),review_button.on("click",function(){checkWidth()}))},1e3)}function load_quantity_selector(){var $quantity=$(".nonajax-quantity-selector");if($quantity.length!==0){var $input=$quantity.find("input");$quantity.find(".js-qty__adjust--minus").on("click",function(){$input.val(Math.max(1,parseInt($input.val())-1))}),$quantity.find(".js-qty__adjust--plus").on("click",function(){$input.val(parseInt($input.val())+1)})}}var currentIndex=0;function load_ownCarousel_ondemand(){var all_product_images=$(".product-images-slider-mobile");if(all_product_images.length!==0){var isMobile=window.matchMedia("only screen and (max-width: 480px)").matches;all_product_images.each(function(){var product_images=$(this),product_single=product_images.closest(".product-single")[0],forceSlider=product_images.hasClass("product-images-slider-desktop");if(isMobile||forceSlider){if(!product_images.hasClass("owl-carousel")){let fixTabIndex2=function(){requestAnimationFrame(function(){product_images.find(".owl-item button,.owl-item model-viewer, .owl-item input, .owl-item .plyr,.owl-item iframe").attr("tabindex","-1"),options.center?product_images.find(".owl-item.active.center button, .owl-item.active.center model-viewer, .owl-item.active.center input,.owl-item.active.center iframe").attr("tabindex","0"):product_images.find(".owl-item.active button, .owl-item.active model-viewer, .owl-item.active input,.owl-item.active iframe").attr("tabindex","0")})},dragStart2=function(event2){if(["BUTTON","INPUT","MODEL-VIEWER"].indexOf(event2.target.tagName)>=0){console.log("Drag prevented, clicked on ",event2.target);return}owlInternal.onDragStart.call(owlInternal,event2)},refreshHeight2=function(){setTimeout(function(){var heightDiff=Math.abs(owl.find(".owl-item.active").height()-owl.find(".owl-height").height());heightDiff>1&&owl.trigger("refresh.owl.carousel")},100)};var fixTabIndex=fixTabIndex2,dragStart=dragStart2,refreshHeight=refreshHeight2,is_shop_now=product_images.closest("#ShopNowContainer").length>0,options={autoHeight:!0,dots:!0},owlInternal;is_shop_now?(options.center=!0,options.items=2):options.items=1,options.onChanged=function(e){var newIndex=e.page.index!==-1?e.page.index:options.startPosition;if(newIndex!==currentIndex){currentIndex=newIndex;var evt2=new CustomEvent("product-media-select",{detail:{index:currentIndex,forceLoad:!1}});product_single.dispatchEvent(evt2),fixTabIndex2()}};var index=product_images.find(".product-single__media--first").index();options.startPosition=index>0?index:0,currentIndex=options.startPosition;var owl=product_images.addClass("owl-carousel owl-theme").owlCarousel(options);owlInternal=owl.data("owl.carousel"),owlInternal.$stage.off("mousedown.owl.core").on("mousedown.owl.core",dragStart2),owlInternal.$stage.off("touchstart.owl.core").on("touchstart.owl.core",dragStart2),product_images.find(".product-single__media").off("media-play media-load").on("media-play media-load",refreshHeight2),product_images.find(".owl-item.active img").one("load",refreshHeight2),fixTabIndex2(),product_images.find(".owl-dot").off("keydown").on("keydown",function(e){if(e.keyCode===13&&e.target.classList.contains("active")){var evt2=new CustomEvent("product-media-select",{detail:{index:currentIndex,forcePlay:!0,focus:!0}});product_single.dispatchEvent(evt2)}})}}else{if(product_images.hasClass("owl-carousel")){product_images.removeClass("owl-carousel owl-theme").owlCarousel("destroy");var evt=new CustomEvent("product-media-select",{detail:{index:currentIndex,forceLoad:!0}});product_single.dispatchEvent(evt)}product_images.hasClass("product-single__thumbnails")&&product_images.find(".product-single__media").attr("tabindex","0")}})}}function load_ownCarousel(){window.removeEventListener("resize",load_ownCarousel_ondemand),window.addEventListener("resize",load_ownCarousel_ondemand),load_ownCarousel_ondemand()}function Media(parent){this.parent=parent,this.media_id=parent.dataset.mediaId,this.type=parent.dataset.mediaType,this.loaded=!1,this.active=!1,this.controller=null}Media.prototype.load=function(){return new Promise(function(resolve){if(this.loaded){resolve();return}var template=this.parent.querySelector("template");if(!template){this.on_load(),resolve();return}var fragment=document.importNode(template.content,!0),oldMedia=this.parent.querySelector(".media-wrapper");switch(oldMedia&&this.parent.removeChild(oldMedia),this.parent.insertBefore(fragment,template),this.type){case"model":window.Shopify.loadFeatures([{name:"model-viewer-ui",version:"1.0"}],function(){this.controller=new Shopify.ModelViewerUI(this.parent.querySelector("model-viewer")),this.controller.viewer.parentElement.addEventListener("mouseup",function(e){e.stopPropagation=function(){}}.bind(this),{capture:!0}),this.controller.elements.controlButton.addEventListener("click",function(e){e.stopImmediatePropagation()}.bind(this),{capture:!0}),this.controller.viewer.addEventListener("shopify_model_viewer_ui_toggle_pause",this.on_pause.bind(this)),this.controller.viewer.addEventListener("shopify_model_viewer_ui_toggle_play",this.on_play.bind(this)),this.on_load(),resolve()}.bind(this));break;case"video":window.Shopify.loadFeatures([{name:"video-ui",version:"1.0",onLoad:function(){var video=this.parent.querySelector("video"),loop=video.parentNode.dataset.videoLoop==="true";this.controller=new Shopify.Plyr(video,{loop:{active:loop},focusOnPlay:!1}),video.addEventListener("play",this.on_play.bind(this)),video.addEventListener("pause",this.on_pause.bind(this)),video.addEventListener("ended",this.on_pause.bind(this)),this.on_load(),resolve()}.bind(this)}]);break;case"external_video":load_youtube_api().then(function(){var iframe=this.parent.querySelector("iframe"),loop=iframe.parentNode.dataset.videoLoop==="true";new window.YT.Player(iframe,{events:{onReady:function(event2){this.controller=event2.target,this.on_load(),resolve()}.bind(this),onStateChange:function(event2){event2.data===window.YT.PlayerState.PLAYING?this.on_play():event2.data===window.YT.PlayerState.PAUSED?this.on_pause():event2.data===window.YT.PlayerState.ENDED&&(loop?this.controller.playVideo():this.on_pause())}.bind(this),onError:function(event2){console.warn("Youtube video error",event2,event2.data),this.on_pause()}.bind(this)}})}.bind(this));break;case"image":this.parent.querySelector(".media-wrapper img").addEventListener("load",function(){load_imageZoomEvents(),this.on_load(),resolve()}.bind(this));break;default:this.on_load(),resolve()}}.bind(this))},Media.prototype.on_load=function(){this.loaded=!0,this.parent.classList.add("product-single__media--loaded");var e=new CustomEvent("media-load",{detail:{parent:this.parent,media:this}});this.parent.dispatchEvent(e),window.ShopifyXR&&window.ShopifyXR.setupXRElements&&window.ShopifyXR.setupXRElements()},Media.prototype.play=function(){this.loaded?this._play():this.load().then(this._play.bind(this))},Media.prototype._play=function(){switch(this.type){case"model":this.controller.play(),this.on_play();break;case"video":this.controller.play().then(this.on_play.bind(this)).catch(console.warn);break;case"external_video":this.controller.playVideo(),this.on_play();break}},Media.prototype.on_play=function(){this.active=!0,this.parent.classList.add("product-single__media--active"),this.loaded||(this.loaded=!0,this.parent.classList.add("product-single__media--loaded"));var e=new CustomEvent("media-play",{detail:{parent:this.parent,media:this}});this.parent.dispatchEvent(e),document.activeElement===document.body&&this.focus()},Media.prototype.autoplay=function(){$(window).width()>767&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches&&this.play()},Media.prototype.pause=function(){if(this.active){switch(this.type){case"model":break;case"video":this.controller.pause();break;case"external_video":this.controller.pauseVideo();break}this.on_pause()}},Media.prototype.togglePlay=function(){this.active?this.pause():this.play()},Media.prototype.on_pause=function(){this.active=!1,this.parent.classList.remove("product-single__media--active");var e=new CustomEvent("media-pause",{detail:{parent:this.parent,media:this}});this.parent.dispatchEvent(e)},Media.prototype.focus=function(){switch(this.type){case"video":this.parent.querySelector(".plyr").focus();break;case"model":var viewer=this.parent.querySelector("model-viewer");viewer&&viewer.shadowRoot?viewer.focus():setTimeout(this.focus.bind(this),1e3);break;case"external_video":this.parent.querySelector("iframe").contentWindow.focus();break;default:this.parent.focus()}},Media.prototype.destroy=function(){};function Product(element2){if(this.element=element2,!!this.element){this.$element=$(this.element),this.sectionId=this.element.dataset.sectionId;var product_json_el=document.querySelector("#ProductJson-"+this.sectionId);if(product_json_el){this.product=JSON.parse(product_json_el.innerText),this.selectors={},this.$media_wrapper=this.$element.find(".product-single__medias"),this.$medias=this.$media_wrapper.find(".product-single__media");var isThumbnailsEnabled=this.$media_wrapper.hasClass("product-single__thumbnails");isThumbnailsEnabled||this.$element.find('[data-image-zoom-enable="true"]').addClass("product-single__media--selected"),this.media_by_id=new Map;var isMobile=window.matchMedia("only screen and (max-width: 480px)").matches,self=this;Array.prototype.forEach.call(this.element.querySelectorAll(".product-single__media"),function(media_root){var media=new Media(media_root);self.media_by_id.set(media_root.dataset.mediaId,media),media_root.classList.contains("product-single__media--selected")&&isThumbnailsEnabled&&!isMobile&&self.on_media_element_select(media_root,{load:!0})}),this.$element.find(".product-single__view-in-space").length>0&&(window.Shopify.loadFeatures([{name:"shopify-xr",version:"1.0"}]),document.addEventListener("shopify_xr_launch",function(){setTimeout(function(){document.body.classList.remove("unloading")},100)})),this.$add_to_cart_form=this.$element.find("#AddToCartForm"),this.$selects=this.$element.find(".selector-wrapper select"),this.$selects.on("change",this.on_select_change.bind(this)),this.$original_select=this.$element.find(".original-select"),this.$swatch_inputs=this.$element.find("#AddToCartForm").find(".swatch input"),this.thumbnail_changes_variant=this.$element.find("#thumbnail_changes_variant").val()==="true",this.$main_image=this.$element.find(".product-single__photo"),this.$main_image_wrapper=this.$main_image.closest(".product-single__photo-wrapper"),this.$medias.off("click keydown").on("click keydown",function(e){if(e.type==="keydown"&&(e.keyCode!==13&&e.keyCode!==27||e.target.classList.contains("shopify-model-viewer-ui__button")||e.target.classList.contains("plyr__controls__item"))||(e.preventDefault(),e.target.classList.contains("product-single__view-in-space"))||e.target.tagName==="MODEL-VIEWER"||e.target.classList.contains("shopify-model-viewer-ui__controls-overlay"))return;const isZoomDisabled=e.currentTarget.dataset.imageZoomEnable==="false",isLoaded=e.currentTarget.classList.contains("product-single__media--loaded"),isActive=e.currentTarget.classList.contains("product-single__media--active");isThumbnailsEnabled&&this.on_thumbnail_click(e.currentTarget,!0),!(isZoomDisabled&&!isThumbnailsEnabled)&&(isLoaded&&isActive||this.on_media_element_select(e.currentTarget,{load:!0,togglePlay:!0}))}.bind(this)),this.$element.off("product-media-select").on("product-media-select",this.on_media_select.bind(this)),this.fix_media_spacing(this.$media_wrapper.find(".product-single__media--selected")[0]),this.$swatch_inputs.length>0?(this.on_swatch_change(),this.$swatch_inputs.on("change",this.on_swatch_change.bind(this))):this.on_select_change()}}}Product.prototype.set_variant_options=function(values){var matching_variants=this.product.variants.filter(function(variant){for(var i2=0;i20;this.on_media_element_select(element2,{load:e.detail.forceLoad,forcePlay:e.detail.forcePlay||!isMobile&&!isQuickShop&&isVideo,focus:e.detail.focus})},Product.prototype.on_media_element_select=function(element2,options){if(element2){var media=this.media_by_id.get(element2.dataset.mediaId);this.media_by_id.forEach(function(otherMedia){otherMedia.media_id!==media.media_id&&otherMedia.pause()});var $other_medias=this.$medias.not(element2);$other_medias.removeClass("product-single__media--selected"),element2.classList.add("product-single__media--selected"),this.fix_media_spacing(element2),options.togglePlay?media.togglePlay():options.forcePlay?media.play():options.load&&media.load(),options.focus&&media.focus()}},Product.prototype.on_thumbnail_click=function(thumbnail,update_variant){if(this.thumbnail_changes_variant&&update_variant){var variant_id=$(thumbnail).data("variant");variant_id&&this.on_variant_selected(variant_id)}},Product.prototype.on_variant_selected=function(variant_id){var matching_variants=this.product.variants.filter(function(variant2){return variant2.id==variant_id});if(matching_variants.length===0)this.update_variant(null);else{var variant=matching_variants[0];this.update_variant(matching_variants[0]);for(var i2=0;i20){this.$element.find(".product-single__media--first").removeClass("product-single__media--first"),$newImageThumb.addClass("product-single__media--first");var owl=this.$element.find(".owl-carousel");owl.length>0&&owl.trigger("to.owl.carousel",$newImageThumb.closest(".owl-item").index()),this.on_media_element_select($newImageThumb[0],{load:!0}),$.smoothScroll({offset:-$(".site-header.sticky-header").outerHeight(),scrollTarget:"div.product-single__photos"})}}this.$original_select.val(variant.id);var is_indiv_product=this.$element.closest(".shopify-section").hasClass("homepage-section--indiv-product-wrapper"),has_more_variants=this.product.variants.length>1;if(history.replaceState&&!is_indiv_product&&has_more_variants){var search=[];window.location.search.length>1&&(search=window.location.search.slice(1).split("&").filter(function(q){return q.indexOf("variant=")!==0})),search.push("variant="+variant.id);var newurl=window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+search.join("&");window.history.replaceState({path:newurl},"",newurl)}var is_sale=variant.compare_at_price&&variant.compare_at_price>variant.price;this.$element.closest(".product-page--sale-badge").toggleClass("hide",!is_sale),this.$element.find(".product-details-wrapper").data("show-sku")&&(this.$element.find(".js__currentVariantSKU").text(variant.sku),this.$element.find(".product__meta--sku").toggleClass("hide",!variant.sku));var money_format=window.Currency?window.Currency.moneyFormats[window.Currency.shopCurrency].money_format:window.default_currency_format;if(variant.unit_price&&variant.unit_price_measurement?(this.$element.find(".unit-price").removeClass("hide"),this.$element.find(".unit-price__price").html(''+Shopify.formatMoney(variant.unit_price,money_format)+""),this.$element.find(".unit-price__ref-value").html(variant.unit_price_measurement.reference_value),this.$element.find(".unit-price__ref-unit").html(variant.unit_price_measurement.reference_unit),window.Currency.convertAll(window.Currency.shopCurrency,window.Currency.currentCurrency)):this.$element.find(".unit-price").addClass("hide"),$(".out-of-stock-form").length&&load_out_of_stock_form(variant),this.$swatch_inputs.length>0){var section_id=this.$element.data("section-id");variant.options.forEach(function(option,index){var itemId="#swatch-"+index+"-"+toHandle(option);this.$swatch_inputs.filter(itemId).prop("checked",!0)}.bind(this))}}return!1};function load_option_selectors(section){var root=section||document;Array.prototype.forEach.call(root.querySelectorAll(".product-single"),function(element2){var product=new Product(element2)})}function load_tabs(){$("ul.tabs").each(function(){var active,content,links=$(this).find("a");active=links.first().addClass("active"),content=$(active.attr("href")),links.not(":first").each(function(){$($(this).attr("href")).hide()}),$(this).find("a").click(function(e){return active.removeClass("active"),content.hide(),active=$(this),content=$($(this).attr("href")),active.addClass("active"),content.fadeIn(),!1})})}function load_readmore(){if($(".product-description.readmore").length!==0){var thisHeight=100;$(".product-description_full-width").length&&(thisHeight=150,$(window).width()<=768&&(thisHeight=140)),$(".product-description.readmore").hasClass("rmjs-1")||new Readmore($(".product-description.readmore"),{speed:100,collapsedHeight:thisHeight,moreLink:'',lessLink:'',beforeToggle:function(trigger,element2,expanded){expanded&&$("html, body").animate({scrollTop:$(element2).offset().top},100),$(element2).toggleClass("closed")}});var resizeTimer;$(window).on("resize",function(){clearTimeout(resizeTimer),resizeTimer=setTimeout(function(){load_readmore()},300)})}}function load_swatches(){$(".swatch :radio").on("change",function(){var $this=$(this),optionIndex=$this.closest(".swatch").attr("data-option-index"),optionValue=$this.val();$this.closest("form").find("#SingleOptionSelector-"+optionIndex).val(optionValue).trigger("change")})}function tmpl_handlebar(context){Handlebars.registerHelper("formatMoney",function(price){return Shopify.formatMoney(price,window.Currency?window.Currency.moneyFormats[window.Currency.shopCurrency].money_format:window.default_currency_format)});var template=Handlebars.compile(this.text()),image=context.media&&context.media.length>0?context.media[0].preview_image.src:void 0;image||(image=$(".recently-viewed-products").data("no-image-url"));var first_variant=context.variants[0];return $.extend(context,{responsiveImage:Shopify.Products.resizeImage(image,"{width}"),imageSrc:Shopify.Products.resizeImage(image,"medium"),sale:context.compare_at_price_max>context.price&&context.available,sold_out:!context.available,id:context.id,unit_price:first_variant.unit_price,unit_price_measurement:first_variant.unit_price_measurement,reference_value_not_one:(first_variant.unit_price_measurement?first_variant.unit_price_measurement.reference_value:0)!==1},first_variant.unit_price_measurement),window.Currency&&setTimeout(function(){window.Currency.convertAll(window.Currency.shopCurrency,window.Currency.currentCurrency)},10),window.wetheme.$(template(context))}window.wetheme.$.fn.tmpl=tmpl_handlebar;function load_recently_viewed(){}function load_product_recommendations(){var productRecommendationsSection=document.querySelector(".product-recommendations");if(productRecommendationsSection!==null){var productId=productRecommendationsSection.dataset.productId,limit=productRecommendationsSection.dataset.limit,requestUrl="/recommendations/products?section_id=product-recommendations&limit="+limit+"&product_id="+productId,request=new XMLHttpRequest;request.open("GET",requestUrl),request.onload=function(){if(request.status>=200&&request.status<300){var container=document.createElement("div");container.innerHTML=request.response,productRecommendationsSection.parentElement.innerHTML=container.querySelector(".product-recommendations").innerHTML}$(".product-recommendations__slideshow").addClass("owl-carousel owl-theme").owlCarousel({loop:!1,margin:0,nav:!0,dots:!1,navText:["",""],responsive:{0:{items:2},600:{items:4},1e3:{items:4}}}),window.Currency&&window.Currency.convertAll(window.Currency.shopCurrency,window.Currency.currentCurrency)},request.send()}}function load_spr(){var wait_for_review=setInterval(function(){!window.SPR||!window.SPR.$||(clearInterval(wait_for_review),window.SPR.initDomEls(),window.SPR.loadProducts(),window.SPR.loadBadges())},500)}function load_reviews(){$("#shopify-product-reviews").length>=0&&load_spr()}function load_product_review_badges(){$("#shopify-product-reviews-badge").length>=0&&load_spr()}function load_out_of_stock_form(variant){if(variant.available)$("#notify-me").hide(),$(".out-of-stock-form").removeClass("out-of-stock-form--active"),$("#notify-me-wrapper").removeClass("show-form"),$('#notify-me-wrapper input[name="contact[body]"]').val("");else{$(".out-of-stock-form").addClass("out-of-stock-form--active"),$("#notify-me").fadeIn(),$("#notify-me a").on("click",function(e){e.preventDefault(),$(".logged-in").val()=="0"?$(".out-of-stock-form form").submit():$("#notify-me-wrapper").addClass("show-form")});var emailString="Please notify me when "+variant.name+" becomes available.";$('#notify-me-wrapper input[name="contact[body]"]').val(emailString)}}function load_blog_masonry(){var $grid2=$(".blog-article-wrapper").masonry({itemSelector:".blog-grid-item",columnWidth:".blog-grid-item",gutter:".blog-gutter-sizer",percentPosition:!0})}function load_featured_masonry(){var $grid=$(".homepage-featured-products-grid").masonry({itemSelector:".homepage-featured-grid-item",columnWidth:".homepage-featured-grid-item",percentPosition:!0,gutter:".gutter-sizer"});$grid.imagesLoaded().progress(function(){$grid.masonry("layout")})}function load_accessible_menu(){$(".site-nav").addClass("js"),$(".site-nav li a").focus(function(){$(this).parent().children("ul").fadeIn()}),$(".site-nav li li a").off(),$(".mobile-nav__link").on("click",function(){this.href&&this.href.split("#")[0]===window.location.href.split("#")[0]&&timber.LeftDrawer.close()})}function resize_sticky_header(){var stickyHeader=$(".sticky-header"),height=Math.max(stickyHeader.first().outerHeight(!0),stickyHeader.last().outerHeight(!0));stickyHeader.parent().innerHeight(height)}function load_sticky_header(skip_reload_on_image_load){var stickyHeader=$(".sticky-header");stickyHeader.sticky({observeChanges:!0,context:"body",silent:!0});var $logo=$(".site-header__logo-image img");skip_reload_on_image_load?resize_sticky_header():$logo.imagesLoaded(function(){load_sticky_header(!0)}),$(window).off("resize",resize_sticky_header).on("resize",resize_sticky_header)}function load_product_block(){var $grid=$(".homepage-featured-products-grid").masonry({itemSelector:".homepage-featured-grid-item",columnWidth:".homepage-featured-grid-item",percentPosition:!0,gutter:".gutter-sizer"});$grid.imagesLoaded().progress(function(){$grid.masonry("layout")})}function load_youtube(element2,isVideoHero){if(typeof isVideoHero==null&&(isVideoHero=!1),isVideoHero){var parentCont=$(element2).closest(".hero-video--media").get(0),autoplay=parentCont.dataset.autoplay==="true",mute=parentCont.dataset.mute==="true",loop=parentCont.dataset.loop==="true",hideControls=parentCont.dataset.hideControls==="true";videoId=youtube_get_id(parentCont.dataset.videoid),autoplay&&(mute=!0)}else var autoplay=element2.dataset.homepageHeroVideoAutoplay==="true",mute=element2.dataset.homepageHeroVideoMute==="true",loop=element2.dataset.homepageHeroVideoLoop==="true",videoId=element2.dataset.homepageHeroVideoLink;navigator.appVersion.indexOf("Edge")!==-1&&window.matchMedia("(prefers-reduced-motion: reduce)").matches&&(autoplay=!1);var thisPlayer=!1;player=new window.YT.Player(element2.id,{videoId,playerVars:{showinfo:0,modestbranding:1,rel:0,autoplay:autoplay?1:0,controls:hideControls?0:1,playlist:videoId,cc_load_policy:0,fs:0,iv_load_policy:3,playsinline:1,branding:0,origin:window.location.origin},events:{onReady:function(event2){youtube_heroes[element2.id]=event2.target;var el=document.getElementById(element2.id);(mute||autoplay)&&event2.target.mute(),registerVideoPlayButton(el,"youtube",event2.target,isVideoHero);var customBtn=$(parentCont).parent().find(".hero-video-play-button");customBtn.length&&isVideoHero&&(btnEl=customBtn.get(0),registerVideoPlayButton(btnEl,"youtube",event2.target,isVideoHero)),$(".video-hero-youtube").attr("tabindex",-1),"connection"in navigator?navigator.connection.saveData!==!0&&autoplay&&event2.target.playVideo():autoplay&&event2.target.playVideo()},onStateChange:function(event2){event2.data===window.YT.PlayerState.PLAYING&&(isVideoHero?$(parentCont).addClass("media-playing"):hideVideoOverlays(element2)),event2.data===window.YT.PlayerState.ENDED&&loop&&(youtube_heroes[element2.id].seekTo(0),youtube_heroes[element2.id].playVideo())}}})}function load_youtube_all(){$(".homepage-hero-youtube-video").each(function(index,el){load_youtube(el)}),$(".video-hero-youtube").each(function(index,el){load_youtube(el,!0)})}var youtube_loaded_callbacks=[],youtube_heroes=[];window.onYouTubePlayerAPIReady=function(){youtube_loaded_callbacks.forEach(function(callback){callback()}),youtube_loaded_callbacks.splice(0)};function load_youtube_api(force){return new Promise(function(resolve){window.YT?resolve():document.querySelector("#youtube_api")?youtube_loaded_callbacks.push(resolve):(youtube_loaded_callbacks.push(resolve),create_script("youtube_api","https://www.youtube.com/player_api"))})}function youtube_get_id(url){var ID="";return url=url.replace(/(>|<)/gi,"").split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/),url[2]!==void 0?(ID=url[2].split(/[^0-9a-z_\-]/i),ID=ID[0]):ID=url,ID}function vimeo_get_id(url){var regex=/(videos|video|channels|\.com)\/([\d]+)/;return url.match(regex)[2]}function load_youtube_section(){!document.querySelector(".homepage-hero-youtube-video")&&!document.querySelector(".video-hero-youtube")||load_youtube_api().then(load_youtube_all)}function load_vimeo(element2,isVideoHero){if(typeof isVideoHero==null&&(isVideoHero=!1),isVideoHero){var parentCont=$(element2).closest(".hero-video--media").get(0),autoplay=parentCont.dataset.autoplay==="true",mute=parentCont.dataset.mute==="true",loop=parentCont.dataset.loop==="true",hideControls=parentCont.dataset.hideControls==="true";videoId=vimeo_get_id(parentCont.dataset.videoid),autoplay&&(mute=!0)}else var autoplay=element2.dataset.vimeoAutoplay==="true",mute=element2.dataset.homepageHeroVideoMute==="true",loop=element2.dataset.homepageHeroVideoLoop==="true",videoId=element2.dataset.homepageHeroVideoLink;window.matchMedia("(prefers-reduced-motion: reduce)").matches&&(autoplay=!1);var player2=new Vimeo.Player(element2.id,{id:videoId,autoplay:!!autoplay,controls:!hideControls});player2.ready().then(function(){registerVideoPlayButton(element2,"vimeo",player2,isVideoHero);var customBtn=$(parentCont).parent().find(".hero-video-play-button");isVideoHero?((mute||autoplay)&&player2.setVolume(0),loop&&player2.setLoop(!0),customBtn.length&&(btnEl=customBtn.get(0),registerVideoPlayButton(btnEl,"vimeo",player2,isVideoHero)),"connection"in navigator?navigator.connection.saveData===!1&&autoplay&&player2.play():player2.play()):(document.querySelector("#"+element2.id).dataset.vimeoAutoplay==="true"&&hideVideoOverlays(element2),document.querySelector("#"+element2.id).dataset.homepageHeroVideoMute==="true"&&player2.setVolume(0))}).catch(function(e){document.getElementById(element2.id).innerText=e})}function load_vimeo_all(){$(".homepage-hero-vimeo-video").each(function(index,el){load_vimeo(el)}),$(".video-hero-vimeo").each(function(index,el){load_vimeo(el,!0)})}function load_vimeo_api(){if(!(!document.querySelector(".homepage-hero-vimeo-video")&&!document.querySelector(".video-hero-vimeo")))if(document.querySelector("#vimeo_api"))window.Vimeo&&load_vimeo_all();else{var script=create_script("vimeo_api","https://player.vimeo.com/api/player.js");script.readyState?script.onreadystatechange=function(){(element.readyState=="loaded"||element.readyState=="complete")&&(element.onreadystatechange=null,load_vimeo_all())}:script.onload=function(){load_vimeo_all()}}}function registerVideoPlayButton(element2,type,player2,isVideoHero){if(typeof isVideoHero==null&&(isVideoHero=!1),isVideoHero){var videoParent=$(element2).closest(".hero-video--wrapper").find(".hero-video--media");if(!videoParent)return;if($(element2).is("button"))var $playButton=$(element2);else var $playButton=$(videoParent)}else{var videoParent=element2.closest(".homepage-hero-content--video");if(!videoParent)return;var $playButton=$(".homepage-video-play-button",videoParent);$playButton.off("keyup").on("keyup",function(event2){(event2.keyCode==13||event2.keyCode==32)&&(videoTogglePlay(type,player2,videoParent,isVideoHero),event2.stopImmediatePropagation())}),$playButton.off("click").on("click",function(event2){videoTogglePlay(type,player2,videoParent,isVideoHero),event2.stopImmediatePropagation()})}}function videoTogglePlay(type,player2,videoParent,isVideoHero){type==="youtube"?$(videoParent).hasClass("media-playing")?typeof $(videoParent).data("autoplay")!==void 0&&(player2.pauseVideo(),$(videoParent).removeClass("media-playing")):player2.playVideo():type==="vimeo"?player2.getPaused().then(function(paused){paused?player2.play():player2.pause()}):type==="plyr"&&player2.togglePlay(),isVideoHero||hideVideoOverlays(element)}function hideVideoOverlays(videoElement){var videoParent=videoElement.closest(".homepage-hero-content--video");$(".js__hide-on-play",videoParent).fadeOut(750),$(".homepage-hero-content-overlay-wrapper",videoParent).addClass("overlay-hidden")}function create_script(id,src){var tag=document.createElement("script");tag.id=id,tag.src=src;var firstScriptTag=document.getElementsByTagName("script")[0];return firstScriptTag.parentNode.insertBefore(tag,firstScriptTag),tag}function hover_effect($link){var $overlay=$("#"+$link.data("overlayId"));$link.hover(function(){$overlay.addClass("active")},function(){$overlay.removeClass("active")}),$link.is(":hover")&&$overlay.addClass("active")}function load_hero(){$(".homepage-hero-content-overlay-menu-item").imagesLoaded({background:!0},function(){$(".homepage-hero-text-advert-link").each(function(index,link){hover_effect($(link))}),$(".homepage-hero-menu li").each(function(index,link){hover_effect($(link))})})}function load_drawer_sticky_menu(){var body_scroll=0;$(document.body).off("beforeDrawerOpen.timber").on("beforeDrawerOpen.timber",function(){$(document.body).css("position")!=="fixed"&&(body_scroll=$(window).scrollTop(),$(document.body).css({position:"fixed",height:"100%",width:"100%",overflow:"hidden",marginTop:"-"+body_scroll+"px"}),load_sticky(),load_sticky_header())}),$(document.body).off("beforeDrawerClose.timber").on("beforeDrawerClose.timber",function(){$(document.body).css({position:"static",height:"auto",width:"auto",overflow:"auto",marginTop:"0"}),$(window).scrollTop(body_scroll),load_sticky(),load_sticky_header()})}function load_ken_burns(){var kbSelector=".kb-enabled",kbElements=$(kbSelector);kb_apply_classes(kbElements),window.addEventListener("scroll",function(){var resizeTimer;clearTimeout(resizeTimer),resizeTimer=setTimeout(function(){kb_apply_classes(kbElements)},750)})}function kb_apply_classes(elements){elements.each(function(index,val){isScrolledIntoView(val)&&$(val).delay(150*index).animate({opacity:1},50,function(){var thisItem=$(this);thisItem.not(".in-viewport").length&&$(val).imagesLoaded({background:!0},function(){thisItem.addClass("in-viewport")})})})}function kb_remove_classes(){$(".kb-enabled").removeClass("in-viewport")}var DEFAULT_OPTIONS={directionNav:!0,controlNav:!0,startAt:0},SLIDER_SELECTOR=".flexslider-homepage",SLIDER_REENABLE_INTERVAL=6e3;function load_slider(section){sliders={},section=section||document;var slider_elements=section.querySelectorAll(SLIDER_SELECTOR);Array.prototype.forEach.call(slider_elements,function(slider_element){$(slider_element).find("li").css("width",$(slider_element).width()),sliders[slider_element.dataset.sliderId]=new Slider(slider_element)})}function header_height(){var announcementBar=$("#shopify-section-announcement-bar").height(),header=$("#shopify-section-header").height(),textAdverts=$("#shopify-section-text-adverts").height(),textAdsPosition=$("#shopify-section-text-adverts").position(),slideshowPosition=$(".homepage-section--slideshow-wrapper").position(),videoHeroPosition=$(".desktop-height-fullscreen").position();$("#shopify-section-text-adverts").length&&($(".homepage-section--slideshow-wrapper").length&&textAdsPosition.top>slideshowPosition.top&&(textAdverts=0),$(".desktop-height-fullscreen").length&&textAdsPosition.top>videoHeroPosition.top&&(textAdverts=0));var headerHeight=announcementBar+header+textAdverts,nonOverlayHeight=announcementBar+textAdverts;$(".slideshow--full-screen").length&&($(".overlay-header").length===0?($(".slideshow--full-screen").css("height","calc(100vh - "+headerHeight+"px)"),$(".slideshow--full-screen ul.slides li").css("height","calc(100vh - "+headerHeight+"px)")):($(".slideshow--full-screen").css("height","calc(100vh - "+nonOverlayHeight+"px)"),$(".slideshow--full-screen ul.slides li").css("height","calc(100vh - "+nonOverlayHeight+"px)"))),$(".desktop-height-fullscreen").length&&$(window).width()>=768?$(".overlay-header").length===0?$(".desktop-height-fullscreen").css("height","calc(100vh - "+headerHeight+"px)"):$(".desktop-height-fullscreen").css("height","calc(100vh - "+nonOverlayHeight+"px)"):$(".mobile-height-fullscreen").length&&$(window).width()<768?$(".overlay-header").length&&$(".mobile-height-fullscreen").css("height","calc(100vh - "+announcementBar+"px)"):$(".hero-video").css("height","")}function Slider(element2){this.$element=$(element2),this.restartTimer=null,this.running=!0,this.get_speed=function(){return parseInt(this.$element.data("sliderSlideTime"))},this.get_animation=function(){return this.$element.data("sliderAnimation")},this.show_slide=function(index){this.get_speed()>0&&this.$element.flexslider("stop"),this.running=!1,this.$element.flexslider(index)},this.start_animation=function(){this.running=!0,this.get_speed()>0&&this.$element.flexslider("play")},this.on_slide_change=function(slider){speed=this.get_speed(),this.running&&!slider.playing&&speed>0&&(clearTimeout(this.restartTimer),this.restartTimer=setTimeout(function(){slider.play()},Math.max(0,SLIDER_REENABLE_INTERVAL-speed)))},this.configure=function(options){var speed2=this.get_speed(),$navigation=this.$element.parent().find(".custom-navigation"),opts=$.extend({controlsContainer:$navigation,slideshowSpeed:speed2,animation:this.get_animation(),slideshow:speed2>0,useCSS:!1,pauseOnAction:!0,after:this.on_slide_change.bind(this),customDirectionNav:$navigation.find("a")},DEFAULT_OPTIONS,options);this.$element.flexslider(opts)},this.configure({}),$(window).off("blur")}function load_collection_tag_filter(){var collFilters=$(".coll-filter");collFilters.on("change",function(){var newTags=[];if(collFilters.each(function(){var val=$(this).val();val&&newTags.push(val)}),newTags.length){var query=newTags.join("+"),link=$("#link-to-tag-generic a").attr("href").replace(/\+/g,"%20");window.location.href=link.replace(/(\/|=)tag($|\?|&)/,"$1"+query+"$2")}else window.location.href=$("#link-to-collection").val()}),$(".collection-filter-tag-checkbox").on("change",function(){var filter=Array.prototype.map.call(document.querySelectorAll("input.collection-filter-tag-checkbox:checked"),function(el){return el.value}).join("+"),link=$("#link-to-tag-generic a").attr("href").replace(/\+/g,"%20");window.location.href=link.replace(/(\/|=)tag($|\?|&)/,"$1"+filter+"$2")})}var rellax_by_id={},was_mobile=!1,resize_handler=null,rellax_elements=[];function apply_parallax(id){var old_relax=rellax_by_id[id];old_relax&&old_relax.destroy(),rellax_by_id[id]=new Rellax("#"+id,{center:!0})}function destroy_parallax(id){var old_relax=rellax_by_id[id];old_relax&&old_relax.destroy()}function parallaxes(apply){Array.prototype.forEach.call(document.querySelectorAll(".rellax"),function(el){apply&&($(el).parents(".in-viewport.kb-enabled").length==0?apply_parallax(el.id):window.addEventListener("scroll",function(){el.style.transform||apply_parallax(el.id)}))})}function load_parallax(){rellax_elements=document.querySelectorAll(".rellax"),rellax_elements.length!==0&&($(window).width()<=768?was_mobile=!0:setTimeout(parallaxes.bind(null,!0),100),resize_handler&&window.removeEventListener(resize_handler),resize_handler=window.addEventListener("resize",function(){for(var key in rellax_by_id)if(rellax_by_id.hasOwnProperty(key)){var id=key,rellax=rellax_by_id[key];rellax.destroy()}rellax_by_id={},setTimeout(function(){$(window).width()>=768?(Array.prototype.forEach.call(rellax_elements,function(el){el.style.transform=""}),parallaxes(!0)):Array.prototype.forEach.call(rellax_elements,function(el){setTimeout(function(){el.style.transform="translate3d(0,0,0)"},100),destroy_parallax(el.id)})},100)}))}function isScrolledIntoView(elem){var docViewTop=$(window).scrollTop(),docViewBottom=docViewTop+$(window).height(),elemTop=$(elem).offset().top,elemBottom=elemTop+$(elem).height(),offsetHeight=$(elem).height()/1.333,topOffset=offsetHeight,bottomOffset=offsetHeight;return elemBottom<=docViewBottom+bottomOffset&&elemTop>=docViewTop-topOffset}function Drawer(container_selector,title_selector){this.animation_duration=800,this.$body=$("body"),this.$drawer=$("#CartDrawer"),this.$primary_container=$("#CartContainer"),this.$primary_title=$("#CartTitle"),this.$secondary_container=$(container_selector),this.$secondary_title=$(title_selector),this.$primary_group=this.$primary_container.add(this.$primary_title),this.$secondary_group=this.$secondary_container.add(this.$secondary_title)}Drawer.prototype.show_primary=function(){this.$secondary_group.addClass("hide"),this.$primary_group.removeClass("hide")},Drawer.prototype.show_secondary=function(){this.$primary_group.addClass("hide"),this.$secondary_group.removeClass("hide")},Drawer.prototype.open=function(){this.show_secondary(),this.$body.one("afterDrawerClose.timber",this.close.bind(this)),timber.RightDrawer.open(),load_readmore()},Drawer.prototype.set_content_type=function(content){this.$drawer.removeClass("drawer--cart drawer--log-in drawer--show-now drawer--search").addClass("drawer--"+content)},Drawer.prototype.close=function(){setTimeout(function(){this.show_primary(),this.set_content_type("cart")}.bind(this),this.animation_duration)};function ShopNow(url){this.$body=$("body"),this.drawer=new Drawer("#ShopNowContainer","#ShopNowTitle"),this.$body.on("afterAddItem.ajaxCart",this.animate_to_cart.bind(this)),$.ajax({type:"GET",url,dataType:"html"}).then(this.page_loaded.bind(this)).catch(function(error){alert(error)})}ShopNow.prototype.page_loaded=function(data){var data_dom=$(data),product_single=data_dom.find(".product-single");product_single.find("#shopify-product-reviews").remove(),product_single.find(".product-images-slider-mobile").addClass("product-images-slider-desktop"),product_single.find('[data-image-zoom-enable="true"]').attr("data-image-zoom-enable","false");var container=this.drawer.$secondary_container;container.find(".product-single").remove(),container.append(product_single),container.find("#ProductJson-product-template").remove(),container.append(data_dom.find("#ProductJson-product-template")),load_quantity_selector(),load_ownCarousel(),load_option_selectors(container[0]),load_tabs(),load_swatches(),Shopify.PaymentButton&&Shopify.PaymentButton.init&&Shopify.PaymentButton.init(),typeof ajaxCart<"u"&&ajaxCart.init({formSelector:"#AddToCartForm",cartContainer:"#CartContainer",addToCartSelector:"#AddToCart",cartCountSelector:"#CartCount",moneyFormat:window.Currency?window.Currency.moneyFormats[window.Currency.shopCurrency].money_format:window.default_currency_format}),this.drawer.set_content_type("show-now"),this.drawer.open()},ShopNow.prototype.animate_to_cart=function(){this.$body.one("afterCartLoad.ajaxCart",function(){timber.RightDrawer.close(),setTimeout(function(){this.drawer.show_primary(),this.drawer.set_content_type("cart"),timber.RightDrawer.open(),this.drawer.$drawer.scrollTop(0)}.bind(this),this.drawer.animation_duration)}.bind(this))};function shop_now_handler(e){var url=$(this).attr("href");return new ShopNow(url),!1}function load_shop_now(){$(".shop-now-button").off("click",shop_now_handler).on("click",shop_now_handler)}function LogInDrawer(url){this.drawer=new Drawer("#LogInContainer","#LogInTitle"),this.$body=$("body"),$.ajax({type:"GET",url,dataType:"html"}).then(this.page_loaded.bind(this)).catch(function(error){alert(error)})}LogInDrawer.prototype.page_loaded=function(data){var data_dom=$(data),main_content=data_dom.find(".main-content");main_content.find(".login-form-cancel").remove(),main_content.find(".sitewide--title-wrapper").remove(),this.drawer.$secondary_container.empty().append(main_content),timber.cacheSelectors(),timber.loginForms(),this.drawer.set_content_type("log-in"),this.drawer.open()};function log_in_handler(e){var url=$(this).attr("href");return new LogInDrawer(url),!1}function load_log_in(){$(".log-in-button").off("click",log_in_handler).on("click",log_in_handler)}function SearchDrawer(){this.drawer=new Drawer("#SearchContainer","#SearchTitle"),this.drawer.set_content_type("search"),this.drawer.open(),$("#search-input").focus(),this.section_by_type={article:"Articles",page:"Pages",product:"Products"},this.current_xhr=null,this.onchange_timer=null,this.$results=$("#search-results");var source=$("#LiveSearchResultTemplate").html();this.template=Handlebars.compile(source);var self=this;self.lastQ=null,$("#search-input").on("keyup change",function(){var q=$(this).val();q!==self.lastQ&&(self.onchange(q),self.lastQ=q)})}SearchDrawer.prototype.onchange=function(query){this.onchange_timer&&clearTimeout(this.onchange_timer),this.onchange_timer=setTimeout(this.onchange_throttled.bind(this,query),200),this.current_xhr&&this.current_xhr.abort()},SearchDrawer.prototype.get_search_url=function(query,json){var types="product,article,page",view="";return json&&(view="&view=json"),"/search?type="+types+view+"&q="+encodeURIComponent(query)},SearchDrawer.prototype.onchange_throttled=function(query){var url=this.get_search_url(query,!0);this.$results.empty(),this.$results.append('Loading...'),this.current_xhr=$.getJSON(url),this.current_xhr.done(this.show_results.bind(this)),this.current_xhr.fail(this.show_error.bind(this)),this.current_xhr.always(function(){this.current_xhr=null}.bind(this))},SearchDrawer.prototype.show_results=function(data){var $show_more=$("#search-show-more");$show_more.addClass("hide"),this.$results.empty();var results_by_type={};if(data.results.forEach(function(result){results_by_type.hasOwnProperty(result.type)?results_by_type[result.type].push(result):results_by_type[result.type]=[result]}),data.terms)if(data.results.length>0){this.$results.append(".grid:after { content: none !important;} header { font-weight: bold } #shopify-section-header{display:none;} ol, ul { margin: 0 0 0 0; padding: 0; li { margin-bottom: 0;} }
"+SearchTranslations.results_for_html.replace("{{ terms }}",data.terms)+"
");for(var type in results_by_type)results_by_type.hasOwnProperty(type)&&(this.$results.append(""+this.section_by_type[type]+"
"),results_by_type[type].forEach(this.show_result.bind(this)));data.has_more&&$show_more.removeClass("hide").attr("href",this.get_search_url(data.terms,!1)),window.Currency&&window.Currency.convertAll(window.Currency.shopCurrency,window.Currency.currentCurrency)}else this.$results.append(""+SearchTranslations.no_results_html.replace("{{ terms }}",data.terms)+"
")},SearchDrawer.prototype.show_result=function(result){this.$results.append(this.template(result))},SearchDrawer.prototype.show_error=function(error){if(error.statusText!=="abort"){console.error("statusText",error.statusText),console.error("error",JSON.stringify(error));var query=$("#search-input").val();window.location=this.get_search_url(query,!1)}};function search_handler(e){return new SearchDrawer,!1}function load_search_drawer(){$(".search-button").off("click",search_handler).on("click",search_handler)}function load_cart_indicator(){$(document.body).on("afterGetCart.ajaxCart",function(e,cart){$(".cart-item-count-header--quantity").text(cart.item_count),$("#cartFloatingButton").css("right","2%");var $total=$(".cart-item-count-header--total");if($total.length>0){var total_price=Shopify.formatMoney(cart.items_subtotal_price,window.Currency?window.Currency.moneyFormats[window.Currency.shopCurrency].money_format:window.default_currency_format);$total.html(''+total_price+""),window.Currency&&window.Currency.convertAll(window.Currency.shopCurrency,window.Currency.currentCurrency)}})}function load_image_badge_positions(timeout){timeout===void 0&&(timeout=0);var container=$(".grid-view-item .grid-view-item-image");calculateBadgePositions(container),timeout>0&&setTimeout(function(){calculateBadgePositions(container)},timeout);var resizeTimer;$(window).on("resize",function(e){$(".grid-view-item .badge").css("opacity",0),clearTimeout(resizeTimer),resizeTimer=setTimeout(function(){calculateBadgePositions(container),$(".grid-view-item .badge").css("opacity",1)},500)}),container.find(".hidden").length>0&&$(window).width()>767&&container.hoverIntent({over:function(){if(!$(this).parent(".grid-view-item").hasClass("hovering")){var self=$(this);self.parent(".grid-view-item").addClass("hovering"),self.find(".hidden").fadeTo(200,1,function(){calculateHoverBadgePositions($(self))})}},out:function(){var self=$(this);$(this).find(".hidden").fadeTo(200,0,function(){self.parent(".grid-view-item").removeClass("hovering"),calculateBadgePositions(container)})},sensitivity:10,interval:25})}function calculateHoverBadgePositions(item){item.find(".reveal .hidden").length&&(item.find(".reveal .hidden").css("z-index",4),placeBadge(item,!0))}function calculateBadgePositions(container){container.each(function(index){placeBadge($(this)),$(this).find("*").stop(!0,!0)})}function getContainedSize(img){var ratio=img.naturalWidth/img.naturalHeight,width=img.height*ratio,height=img.height;return width>img.width&&(width=img.width,height=img.width/ratio),[width,height]}function placeBadge(item,hover){hover===void 0&&(hover=!1);var badgeDiv=item.parent().find(".badge");if(badgeDiv.length){var containerWidth=item.width(),containerHeight=item.height();if(hover===!0)var thisImg=item.find(".hidden img");else var thisImg=item.find("img");var actualSize=getContainedSize(thisImg.get(0)),thisWidth=Math.round(actualSize[0]),thisHeight=Math.round(actualSize[1]),offsetX=(containerWidth-thisWidth)/2,offsetY=(containerHeight-thisHeight)/2;offsetX<1&&(offsetX=0),offsetY<1&&(offsetY=0),badgeDiv.css("top",offsetY+"px"),badgeDiv.css("left",offsetX+"px")}}function throttle(func,msWait){var time=Date.now();return function(){time+(msWait||100)-Date.now()<0&&(func(),time=Date.now())}}function reapply_kb_effect(target){var $target=$(event.target),kb_target=$target.find(".kb-enabled");if(kb_target.removeClass("in-viewport"),$target.find("#rellax--text-with-image-overlay").length)var bg_selector="#rellax--text-with-image-overlay";else var bg_selector=".img.rellax";var bgimg=$target.find(bg_selector).css("background-image").replace(/(url\(|\)|")/g,""),image=new Image,onload=function(){kb_target.length?kb_target.hasClass("in-viewport")&&kb_target.delay(1500).queue(function(next){kb_target.addClass("in-viewport"),next()}):section_select(event)};image.addEventListener("load",onload),image.crossOrigin="Anonymous",image.src=bgimg,image.complete&&onload()}function load_imageZoomEvents(){loadImageZoom(),$(window).off("resize",loadImageZoom).on("resize",loadImageZoom)}function loadImageZoom(){$(window).width()>768?$('[data-image-zoom-enable="true"] [data-image-zoom]').off("mouseenter").off("mouseleave").removeProp("hoverIntent_t").removeProp("hoverIntent_s").hoverIntent(hoverZoomIn,hoverZoomOut):$("[data-image-zoom]").trigger("zoom.destroy").off("mouseenter").off("mouseleave")}function hoverZoomIn(event2){var image=$(this),parent=image.closest(".media-wrapper"),alreadyLoaded=image.hasClass("js__image_already_loaded"),smallImage=image.hasClass("js__smallImage");if(!alreadyLoaded&&!smallImage){image.css({opacity:.5});var imageZoom=image.data().imageZoom,imageZoomLoader=parent.find(".featured-image-loader").fadeIn("fast");parent.zoom({url:imageZoom,callback:function(){image.addClass("js__image_already_loaded"),imageZoomLoader.fadeOut("slow"),image.trigger("mouseover"),image.css({opacity:1})},onZoomIn:function(){var zoomImg=parent.find(".zoomImg");zoomImg.width()<=image.width()?(image.css({opacity:1}),zoomImg.css("visibility","hidden")):zoomImg.css("visibility","visible")}})}}function hoverZoomOut(){var image=$(this);image.css({opacity:1})}if($("#shopify-product-reviews").length>0){var $productReviewsPlaceholder=$(".desktop_review_placeholder"),$productReviews=$("#shopify-product-reviews",$productReviewsPlaceholder),$productReviewsClone=$productReviews.clone();moveProductReviews($productReviewsClone),$(window).on("resize",function(){moveProductReviews($productReviewsClone)})}function moveProductReviews($productReviews2){$(window).width()<768?$(".mobile_review_placeholder").append($productReviews2):$(".mobile_review_placeholder #shopify-product-reviews").remove()}load_TextAdvertCarousel();function load_TextAdvertCarousel(){$(".text-advert-section").length>0&&$(".text-advert-section .slides").addClass("owl-carousel owl-theme").owlCarousel({items:1,autoHeight:!0})}var MAP_SELECTOR=".map-wrapper",MAP_API_FAILED=!1,map_objects=[];function set_map_error(message,container){container||(container=$(".map-section__container")),container.addClass("hide"),Shopify.designMode&&$('').text(message).appendTo(container.parent().find(".map-section__overlay")),container.parent().find(".homepage-map--fallback").removeClass("hide")}function maps_resize(){map_objects.forEach(function(map){var currCenter=map.getCenter();google.maps.event.trigger(map,"resize"),map.setCenter(currCenter)})}function map_init(map_element){var config={zoom:14},section=map_element.dataset.id,colors=map_element.dataset.colors,style=[];try{style=JSON.parse(document.getElementById("homepage-map--theme--"+section).textContent)}catch(e){console.error("Unable to parse theme style:",e)}var container=document.querySelector("#map-container-"+section);if(!container)return;var $container=$(container);MAP_API_FAILED&&set_map_error("Google Maps authentication error, API key might be invalid",$container);var map=new google.maps.Map(container,{zoom:config.zoom,styles:style,disableDefaultUI:!0,draggable:!1,clickableIcons:!1,scrollwheel:!1,disableDoubleClickZoom:!0});map_objects.push(map);var geocoder=new google.maps.Geocoder;geocodeAddress(geocoder,map);function geocodeAddress(geocoder2,resultsMap){var address=$("#map-container-"+section).data("address-setting");geocoder2.geocode({address},function(results,status){if(status==="OK"){resultsMap.setCenter(results[0].geometry.location);var marker=new google.maps.Marker({map:resultsMap,position:results[0].geometry.location})}else set_map_error("Error looking up that address",$container)})}}function load_googlemaps(){var mapElements=document.querySelectorAll(MAP_SELECTOR);if(mapElements.length!==0){var apiKey=null;if(Array.prototype.forEach.call(mapElements,function(map_element){var section=map_element.dataset.id,elementApiKey=document.querySelector("#apikey-"+section).value;if(elementApiKey){if(apiKey&&elementApiKey&&elementApiKey!==apiKey){console.warn("Multiple different Google Maps API keys are not allowed, using only the first one");return}apiKey=elementApiKey}}),!apiKey){console.error("Google Maps API key not provided!"),set_map_error("Google Maps API key not provided!",null);return}MAP_API_FAILED||!window.google||!window.google.maps||!window.google.maps.Geocoder||!window.google.maps.Map?(MAP_API_FAILED=!1,$.getScript("https://maps.googleapis.com/maps/api/js?key="+apiKey+"&callback=google_maps_loaded")):window.google_maps_loaded()}}window.google_maps_loaded=function(){Array.prototype.forEach.call(document.querySelectorAll(MAP_SELECTOR),map_init),$(window).off("resize",maps_resize).on("resize",maps_resize)},window.gm_authFailure=function(){MAP_API_FAILED=!0,console.error("Authentication Failure");var $container=$(".map-section__container");set_map_error("Google Maps authentication error, API key might be invalid",null)},wetheme.load_SPB_hide=function(){$(".shopify-payment-button").hide(),$("#ShopNowContainer #AddToCart").addClass("full-width-button")},wetheme.load_SPB_show=function(){$(".shopify-payment-button").show(),$("#ShopNowContainer #AddToCart").removeClass("full-width-button")},wetheme.load_all=load_all})(window.wetheme.$,window.wetheme);var coll=document.getElementsByClassName("collapsible"),i;for(i=0;i