typeof Shopify=="undefined"&&(window.Shopify={}),typeof Shopify.getCart=="undefined"&&(Shopify.getCart=function(callback,cart){if(cart)typeof callback=="function"?callback(cart):typeof Shopify.onCartUpdate=="function"&&Shopify.onCartUpdate(cart);else return jQuery.getJSON("/cart.js",function(cart2,textStatus,xhr){typeof callback=="function"?callback(cart2,textStatus,xhr):Shopify.onCartUpdate(cart2)})}),window.theme=window.theme||{},console&&console.log&&console.log("Motion theme ("+theme.settings.themeVersion+") by ARCH\u039ETYPE | Learn more at https://archetypethemes.co"),window.lazySizesConfig=window.lazySizesConfig||{},lazySizesConfig.expFactor=4,function($){var $=jQuery=$;theme.utils={defaultTo:function(value,defaultValue){return value==null||value!==value?defaultValue:value}},theme.a11y={trapFocus:function(options){var eventsName={focusin:options.namespace?"focusin."+options.namespace:"focusin",focusout:options.namespace?"focusout."+options.namespace:"focusout",keydown:options.namespace?"keydown."+options.namespace:"keydown.handleFocus"},$focusableElements=options.$container.find($('button, [href], input, select, textarea, [tabindex]:not([tabindex^="-"])').filter(":visible")),firstFocusable=$focusableElements[0],lastFocusable=$focusableElements[$focusableElements.length-1];options.$elementToFocus||(options.$elementToFocus=options.$container);function _manageFocus(evt){evt.keyCode===9&&(evt.target===lastFocusable&&!evt.shiftKey&&(evt.preventDefault(),firstFocusable.focus()),evt.target===firstFocusable&&evt.shiftKey&&(evt.preventDefault(),lastFocusable.focus()))}options.$container.attr("tabindex","-1"),options.$elementToFocus.focus(),$(document).off("focusin"),$(document).on(eventsName.focusout,function(){$(document).off(eventsName.keydown)}),$(document).on(eventsName.focusin,function(evt){evt.target!==lastFocusable&&evt.target!==firstFocusable||$(document).on(eventsName.keydown,function(evt2){_manageFocus(evt2)})})},removeTrapFocus:function(options){var eventName=options.namespace?"focusin."+options.namespace:"focusin";options.$container&&options.$container.length&&options.$container.removeAttr("tabindex"),$(document).off(eventName)},lockMobileScrolling:function(namespace,$element){if($element)var $el=$element;else var $el=$(document.documentElement).add("body");$el.on("touchmove"+namespace,function(){return!1})},unlockMobileScrolling:function(namespace,$element){if($element)var $el=$element;else var $el=$(document.documentElement).add("body");$el.off(namespace)}},theme.Sections=function(){this.constructors={},this.instances=[],$(document).on("shopify:section:load",this._onSectionLoad.bind(this)).on("shopify:section:unload",this._onSectionUnload.bind(this)).on("shopify:section:select",this._onSelect.bind(this)).on("shopify:section:deselect",this._onDeselect.bind(this)).on("shopify:block:select",this._onBlockSelect.bind(this)).on("shopify:block:deselect",this._onBlockDeselect.bind(this))},theme.Sections.prototype=$.extend({},theme.Sections.prototype,{createInstance:function(container,constructor,customScope){var $container=$(container),id=$container.attr("data-section-id"),type=$container.attr("data-section-type");if(constructor=constructor||this.constructors[type],typeof constructor!="undefined"){if(customScope){var instanceExists=this._findInstance(id);if(instanceExists)return}var instance=$.extend(new constructor(container),{id:id,type:type,container:container});this.instances.push(instance)}},_onSectionLoad:function(evt,subSection,subSectionId){AOS&&AOS.refreshHard();var container=subSection||$("[data-section-id]",evt.target)[0];if(container){this.createInstance(container);var instance=subSection?subSectionId:this._findInstance(evt.detail.sectionId);subSection||this._loadSubSections(),instance&&typeof instance.onLoad=="function"&&instance.onLoad(evt)}},_loadSubSections:function(){AOS&&AOS.refreshHard(),$("[data-subsection]").each(function(evt,el){this._onSectionLoad(null,el,$(el).data("section-id"))}.bind(this))},_onSectionUnload:function(evt){var instance=this._removeInstance(evt.detail.sectionId);instance&&typeof instance.onUnload=="function"&&instance.onUnload(evt)},_onSelect:function(evt){var instance=this._findInstance(evt.detail.sectionId);instance&&typeof instance.onSelect=="function"&&instance.onSelect(evt)},_onDeselect:function(evt){var instance=this._findInstance(evt.detail.sectionId);instance&&typeof instance.onDeselect=="function"&&instance.onDeselect(evt)},_onBlockSelect:function(evt){var instance=this._findInstance(evt.detail.sectionId);instance&&typeof instance.onBlockSelect=="function"&&instance.onBlockSelect(evt)},_onBlockDeselect:function(evt){var instance=this._findInstance(evt.detail.sectionId);instance&&typeof instance.onBlockDeselect=="function"&&instance.onBlockDeselect(evt)},_findInstance:function(id){for(var i=0;i')},wrapVideo:function(){var $iframeVideo=$('.rte iframe[src*="youtube.com/embed"], .rte iframe[src*="player.vimeo"]'),$iframeReset=$iframeVideo.add("iframe#admin_bar_iframe");$iframeVideo.each(function(){$(this).parents(".video-wrapper").length||$(this).wrap('
')}),$iframeReset.each(function(){this.src=this.src})},imageLinks:function(){$(".rte a img").parent().addClass("rte__image")}},theme.LibraryLoader=function(){var types={link:"link",script:"script"},status2={requested:"requested",loaded:"loaded"},cloudCdn="https://cdn.shopify.com/shopifycloud/",libraries={youtubeSdk:{tagId:"youtube-sdk",src:"https://www.youtube.com/iframe_api",type:types.script},shopifyXr:{tagId:"shopify-model-viewer-xr",src:cloudCdn+"shopify-xr-js/assets/v1.0/shopify-xr.en.js",type:types.script},modelViewerUi:{tagId:"shopify-model-viewer-ui",src:cloudCdn+"model-viewer-ui/assets/v1.0/model-viewer-ui.en.js",type:types.script},modelViewerUiStyles:{tagId:"shopify-model-viewer-ui-styles",src:cloudCdn+"model-viewer-ui/assets/v1.0/model-viewer-ui.css",type:types.link}};function load(libraryName,callback){var library=libraries[libraryName];if(library&&library.status!==status2.requested){if(callback=callback||function(){},library.status===status2.loaded){callback();return}library.status=status2.requested;var tag;switch(library.type){case types.script:tag=createScriptTag(library,callback);break;case types.link:tag=createLinkTag(library,callback);break}tag.id=library.tagId,library.element=tag;var firstScriptTag=document.getElementsByTagName(library.type)[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)}}function createScriptTag(library,callback){var tag=document.createElement("script");return tag.src=library.src,tag.addEventListener("load",function(){library.status=status2.loaded,callback()}),tag}function createLinkTag(library,callback){var tag=document.createElement("link");return tag.href=library.src,tag.rel="stylesheet",tag.type="text/css",tag.addEventListener("load",function(){library.status=status2.loaded,callback()}),tag}return{load:load}}(),theme.Modals=function(){function Modal(id,name,options){var defaults={close:".js-modal-close",open:".js-modal-open-"+name,openClass:"modal--is-active",closingClass:"modal--is-closing",bodyOpenClass:"modal-open",bodyOpenSolidClass:"modal-open--solid",bodyClosingClass:"modal-closing",closeOffContentClick:!0};if(this.id=id,this.$modal=$("#"+id),!this.$modal.length)return!1;this.nodes={$parent:$("html").add("body"),$modalContent:this.$modal.find(".modal__inner")},this.config=$.extend(defaults,options),this.modalIsOpen=!1,this.$focusOnOpen=this.config.focusOnOpen?$(this.config.focusOnOpen):this.$modal,this.isSolid=this.config.solid,this.init()}return Modal.prototype.init=function(){var $openBtn=$(this.config.open);$openBtn.attr("aria-expanded","false"),$(this.config.open).on("click",this.open.bind(this)),this.$modal.find(this.config.close).on("click",this.close.bind(this)),$("body").on("drawerOpen",function(){this.close()}.bind(this))},Modal.prototype.open=function(evt){var externalCall=!1;this.modalIsOpen||(evt?evt.preventDefault():externalCall=!0,evt&&evt.stopPropagation&&(evt.stopPropagation(),this.$activeSource=$(evt.currentTarget).attr("aria-expanded","true")),this.modalIsOpen&&!externalCall&&this.close(),this.$modal.prepareTransition().addClass(this.config.openClass),this.nodes.$parent.addClass(this.config.bodyOpenClass),this.isSolid&&this.nodes.$parent.addClass(this.config.bodyOpenSolidClass),this.modalIsOpen=!0,theme.a11y.trapFocus({$container:this.$modal,$elementToFocus:this.$focusOnOpen,namespace:"modal_focus"}),$("body").trigger("productModalOpen").trigger("modalOpen."+this.id),this.bindEvents())},Modal.prototype.close=function(){this.modalIsOpen&&($(document.activeElement).trigger("blur"),this.$modal.prepareTransition().removeClass(this.config.openClass).addClass(this.config.closingClass),this.nodes.$parent.removeClass(this.config.bodyOpenClass),this.nodes.$parent.addClass(this.config.bodyClosingClass),window.setTimeout(function(){this.nodes.$parent.removeClass(this.config.bodyClosingClass),this.$modal.removeClass(this.config.closingClass),this.$activeSource&&this.$activeSource.attr("aria-expanded")&&this.$activeSource.attr("aria-expanded","false").focus()}.bind(this),500),this.isSolid&&this.nodes.$parent.removeClass(this.config.bodyOpenSolidClass),this.modalIsOpen=!1,theme.a11y.removeTrapFocus({$container:this.$modal,namespace:"modal_focus"}),$("body").trigger("modalClose."+this.id),this.unbindEvents())},Modal.prototype.bindEvents=function(){this.nodes.$parent.on("keyup.modal",function(evt){evt.keyCode===27&&this.close()}.bind(this)),this.config.closeOffContentClick&&(this.$modal.on("click.modal",this.close.bind(this)),this.nodes.$modalContent.on("click.modal",function(evt){evt.stopImmediatePropagation()}))},Modal.prototype.unbindEvents=function(){this.nodes.$parent.off(".modal"),this.config.closeOffContentClick&&(this.$modal.off(".modal"),this.nodes.$modalContent.off(".modal"))},Modal}(),theme.Drawers=function(){function Drawer(id,name){if(this.config={id:id,close:".js-drawer-close",open:".js-drawer-open-"+name,openClass:"js-drawer-open",closingClass:"js-drawer-closing",activeDrawer:"drawer--is-open",namespace:".drawer-"+name},this.$nodes={parent:$(document.documentElement).add("body"),page:$("#MainContent")},this.$drawer=$("#"+id),!this.$drawer.length)return!1;this.isOpen=!1,this.init()}return Drawer.prototype=$.extend({},Drawer.prototype,{init:function(){var $openBtn=$(this.config.open);$openBtn.attr("aria-expanded","false"),$openBtn.on("click",this.open.bind(this)),this.$drawer.find(this.config.close).on("click",this.close.bind(this)),$("body").on("productModalOpen",function(){this.close()}.bind(this))},open:function(evt,returnFocusEl){if(evt&&evt.preventDefault(),!this.isOpen){if(evt&&evt.stopPropagation)evt.stopPropagation(),this.$activeSource=$(evt.currentTarget).attr("aria-expanded","true");else if(returnFocusEl){var $el=$(returnFocusEl);this.$activeSource=$el.attr("aria-expanded","true")}this.$drawer.prepareTransition().addClass(this.config.activeDrawer),this.$nodes.parent.addClass(this.config.openClass),this.isOpen=!0,theme.a11y.trapFocus({$container:this.$drawer,namespace:"drawer_focus"}),$("body").trigger("drawerOpen").trigger("drawerOpen."+this.config.id),this.bindEvents()}},close:function(){this.isOpen&&($(document.activeElement).trigger("blur"),this.$drawer.prepareTransition().removeClass(this.config.activeDrawer),this.$nodes.parent.removeClass(this.config.openClass),this.$nodes.parent.addClass(this.config.closingClass),window.setTimeout(function(){this.$nodes.parent.removeClass(this.config.closingClass),this.$activeSource&&this.$activeSource.attr("aria-expanded")&&this.$activeSource.attr("aria-expanded","false").focus()}.bind(this),500),this.isOpen=!1,theme.a11y.removeTrapFocus({$container:this.$drawer,namespace:"drawer_focus"}),this.unbindEvents())},bindEvents:function(){theme.a11y.lockMobileScrolling(this.config.namespace,this.$nodes.page),this.$nodes.page.on("click"+this.config.namespace,function(){return this.close(),!1}.bind(this)),this.$nodes.parent.on("keyup"+this.config.namespace,function(evt){evt.keyCode===27&&this.close()}.bind(this))},unbindEvents:function(){theme.a11y.unlockMobileScrolling(this.config.namespace,this.$nodes.page),this.$nodes.parent.off(this.config.namespace),this.$nodes.page.off(this.config.namespace)}}),Drawer}(),theme.cart={getCart:function(){return $.getJSON("/cart.js")},changeItem:function(key2,qty){return this._updateCart({type:"POST",url:"/cart/change.js",data:"quantity="+qty+"&id="+key2,dataType:"json"})},addItemFromForm:function(data){return this._updateCart({type:"POST",url:"/cart/add.js",data:data,dataType:"json"})},_updateCart:function(params){return $.ajax(params).then(function(cart){return cart}.bind(this))},updateNote:function(note){var params={type:"POST",url:"/cart/update.js",data:"note="+theme.cart.attributeToString(note),dataType:"json",success:function(cart){},error:function(XMLHttpRequest,textStatus){}};$.ajax(params)},attributeToString:function(attribute){return typeof attribute!="string"&&(attribute+="",attribute==="undefined"&&(attribute="")),$.trim(attribute)}},$(function(){$("body").on("click",".cart__checkout",function(){$(this).addClass("btn--loading")}),$("body").on("change",'textarea[name="note"]',function(){var newNote=$(this).val();theme.cart.updateNote(newNote)}),$("body").on("click",".cart__checkout--ajax",function(evt){if(!$("#CartAgree").is(":checked"))return alert(theme.strings.cartTermsConfirmation),$(this).removeClass("btn--loading"),!1}),$("body").on("click",".cart__checkout--page",function(evt){if(!$("#CartPageAgree").is(":checked"))return alert(theme.strings.cartTermsConfirmation),$(this).removeClass("btn--loading"),!1})}),theme.QtySelector=function(){var classes={input:".js-qty__num",plus:".js-qty__adjust--plus",minus:".js-qty__adjust--minus"};function QtySelector($el,options){this.$wrapper=$el,this.$input=$el.find(classes.input),this.$plus=$el.find(classes.plus),this.$minus=$el.find(classes.minus),this.minValue=this.$input.attr("min")||1;var defaults={namespace:null,key:this.$input.data("id")};this.options=$.extend(defaults,options),this.initEventListeners()}return QtySelector.prototype=$.extend({},QtySelector.prototype,{initEventListeners:function(){this.$plus.on("click",function(){var qty=this.validateQty(this.$input.val());this.addQty(qty)}.bind(this)),this.$minus.on("click",function(){var qty=this.validateQty(this.$input.val());this.subtractQty(qty)}.bind(this)),this.$input.on("change",function(){var qty=this.validateQty(this.$input.val());this.changeQty(qty)}.bind(this))},addQty:function(number){var qty=number+1;this.changeQty(qty)},subtractQty:function(number){var qty=number-1;qty<=this.minValue&&(qty=this.minValue),this.changeQty(qty)},changeQty:function(qty){this.$input.val(qty),$("body").trigger("qty"+this.options.namespace,[this.options.key,qty])},validateQty:function(number){return parseFloat(number)==parseInt(number)&&!isNaN(number)||(number=1),parseInt(number)}}),QtySelector}(),theme.CartDrawer=function(){var config={namespace:".ajaxcart"},selectors={drawer:"#CartDrawer",container:"#CartContainer",template:"#CartTemplate",cartBubble:".cart-link__bubble"};function CartDrawer(){this.status={loaded:!1,loading:!1},this.drawer=new theme.Drawers("CartDrawer","cart");var source=$(selectors.template).html();this.template=Handlebars.compile(source),theme.cart.getCart().then(this.buildCart.bind(this)),this.initEventListeners()}return CartDrawer.prototype=$.extend({},CartDrawer.prototype,{initEventListeners:function(){$("body").on("updateCart"+config.namespace,this.initQtySelectors.bind(this)),$("body").on("updateCart"+config.namespace,this.updateCartNotification.bind(this)),$("body").on("added.ajaxProduct",function(evt,returnFocusEl){theme.cart.getCart().then(function(cart){this.buildCart(cart,!0,returnFocusEl)}.bind(this))}.bind(this))},buildCart:function(cart,openDrawer,returnFocusEl){if(this.loading(!0),this.emptyCart(),cart.item_count===0)$(selectors.container).append('

'+theme.strings.cartEmpty+"

");else{var items=[],item={},data={},animation_row=1;$.each(cart.items,function(index,product){var prodImg;product.image!==null?prodImg=product.image.replace(/(\.[^.]*)$/,"_180x$1"):prodImg="//cdn.shopify.com/s/assets/admin/no-image-medium-cc9732cb976dd349a0df1d39816fbcc7.gif",product.properties!==null&&$.each(product.properties,function(key2,value){(key2.charAt(0)==="_"||!value)&&delete product.properties[key2]});var amount=0;if(product.line_level_discount_allocations.length!==0)for(var discount in product.line_level_discount_allocations)amount=product.line_level_discount_allocations[discount].amount,product.line_level_discount_allocations[discount].formattedAmount=theme.Currency.formatMoney(amount,theme.settings.moneyFormat);animation_row+=2,item={key:product.key,url:product.url,img:prodImg,animationRow:animation_row,name:product.product_title,variation:product.variant_title,properties:product.properties,itemQty:product.quantity,price:theme.Currency.formatMoney(product.price,theme.settings.moneyFormat),unitPrice:theme.Currency.formatMoney(product.unit_price,theme.settings.moneyFormat),unitBase:theme.Currency.getBaseUnit(product),discountedPrice:theme.Currency.formatMoney(product.price-product.total_discount/product.quantity,theme.settings.moneyFormat),discounts:product.line_level_discount_allocations,discountsApplied:product.line_level_discount_allocations.length!==0,vendor:product.vendor},items.push(item)}),animation_row+=2;var cartAmount=0;if(cart.cart_level_discount_applications.length!==0)for(var cartDiscount in cart.cart_level_discount_applications)cartAmount=cart.cart_level_discount_applications[cartDiscount].total_allocated_amount,cart.cart_level_discount_applications[cartDiscount].formattedAmount=theme.Currency.formatMoney(cartAmount,theme.settings.moneyFormat);data={items:items,note:cart.note,lastAnimationRow:animation_row,cartDiscounts:cart.cart_level_discount_applications,cartDiscountsApplied:cart.cart_level_discount_applications.length!==0,totalPrice:theme.Currency.formatMoney(cart.total_price,theme.settings.moneyFormat)},$(selectors.container).append(this.template(data))}this.status.loaded=!0,this.loading(!1),$("body").trigger("updateCart"+config.namespace,cart),window.Shopify&&Shopify.StorefrontExpressButtons&&Shopify.StorefrontExpressButtons.initialize(),openDrawer===!0&&this.drawer.open(!1,returnFocusEl),window.BOLD&&BOLD.common&&BOLD.common.eventEmitter&&typeof BOLD.common.eventEmitter.emit=="function"&&BOLD.common.eventEmitter.emit("BOLD_COMMON_cart_loaded")},initQtySelectors:function(){$(selectors.container).find(".js-qty__wrapper").each(function(index,el){var selector=new theme.QtySelector($(el),{namespace:".cart-drawer"})}.bind(this)),$("body").on("qty.cart-drawer",this.updateItem.bind(this))},updateItem:function(evt,key2,qty){this.status.loading||(this.loading(!0),theme.cart.changeItem(key2,qty).then(function(cart){Shopify.getCart(function(cart2){this.updateSuccess(cart2)}.bind(this))}.bind(this)).catch(function(XMLHttpRequest){this.updateError(XMLHttpRequest)}.bind(this)).always(function(){this.loading(!1)}.bind(this)))},loading:function(state){this.status.loading=state,state?$(selectors.container).addClass("is-loading"):$(selectors.container).removeClass("is-loading")},emptyCart:function(){$(selectors.container).empty()},updateSuccess:function(cart){this.buildCart(cart)},updateError:function(XMLHttpRequest){XMLHttpRequest.responseJSON&&XMLHttpRequest.responseJSON.description},updateCartNotification:function(evt,cart){cart.items.length>0?$(selectors.cartBubble).addClass("cart-link__bubble--visible"):$(selectors.cartBubble).removeClass("cart-link__bubble--visible")}}),CartDrawer}(),theme.AjaxProduct=function(){var status2={loading:!1};function ProductForm($form){this.$form=$form,this.$addToCart=this.$form.find(".add-to-cart"),this.$form.length&&this.$form.on("submit",this.addItemFromForm.bind(this))}return ProductForm.prototype=$.extend({},ProductForm.prototype,{addItemFromForm:function(evt,callback){if(evt.preventDefault(),!status2.loading){this.$addToCart.addClass("btn--loading"),status2.loading=!0;var data=this.$form.serialize();theme.cart.addItemFromForm(data).then(function(product){Shopify.getCart(function(cart){this.success(product)}.bind(this))}.bind(this)).catch(function(XMLHttpRequest){this.error(XMLHttpRequest)}.bind(this)).always(function(){status2.loading=!1,this.$addToCart.removeClass("btn--loading")}.bind(this))}},success:function(product){this.$form.find(".errors").remove(),$("body").trigger("added.ajaxProduct",this.$addToCart)},error:function(XMLHttpRequest){this.$form.find(".errors").remove(),XMLHttpRequest.responseJSON&&XMLHttpRequest.responseJSON.description&&this.$form.prepend('
'+XMLHttpRequest.responseJSON.description+"
")}}),ProductForm}(),theme.collapsibles=function(){var selectors={trigger:".collapsible-trigger",module:".collapsible-content",moduleInner:".collapsible-content__inner"},classes={hide:"hide",open:"is-open",autoHeight:"collapsible--auto-height"},namespace=".collapsible",isTransitioning=!1;function init(){$(selectors.trigger).each(function(){var $el=$(this),state=$el.hasClass(classes.open);$el.attr("aria-expanded",state)}),$("body, .modal__inner").off(namespace).on("click"+namespace,selectors.trigger,function(){if(!isTransitioning){isTransitioning=!0;var $el=$(this),isOpen=$el.hasClass(classes.open),moduleId=$el.attr("aria-controls"),$module=$("#"+moduleId),height=$module.find(selectors.moduleInner).outerHeight(),isAutoHeight=$el.hasClass(classes.autoHeight);isOpen&&isAutoHeight&&setTimeout(function(){height=0,setTransitionHeight($module,height,isOpen,isAutoHeight)},0),isOpen&&!isAutoHeight&&(height=0),$el.attr("aria-expanded",!isOpen).toggleClass(classes.open,!isOpen),setTransitionHeight($module,height,isOpen,isAutoHeight)}})}function setTransitionHeight($module,height,isOpen,isAutoHeight){if($module.removeClass(classes.hide).prepareTransition().css("height",height).toggleClass(classes.open,!isOpen),!isOpen&&isAutoHeight){var o=$module;window.setTimeout(function(){o.css("height","auto"),isTransitioning=!1},500)}else isTransitioning=!1}return{init:init}}(),theme.headerNav=function(){var $parent=$(document.documentElement).add("body"),$page=$("#MainContent"),selectors={wrapper:".header-wrapper",siteHeader:".site-header",searchBtn:".js-search-header",closeSearch:".js-search-header-close",searchContainer:".site-header__search-container",logoContainer:".site-header__logo",logo:".site-header__logo img",navigation:".site-navigation",navContainerWithLogo:".header-item--logo",navItems:".site-nav__item",navLinks:".site-nav__link",navLinksWithDropdown:".site-nav__link--has-dropdown",navDropdownLinks:".site-nav__dropdown-link--second-level"},classes={hasDropdownClass:"site-nav--has-dropdown",hasSubDropdownClass:"site-nav__deep-dropdown-trigger",dropdownActive:"is-focused"},config={namespace:".siteNav",wrapperOverlayed:!1,overlayedClass:"is-light",overlayEnabledClass:"header-wrapper--overlay",stickyEnabled:!1,stickyActive:!1,stickyClass:"site-header--stuck",openTransitionClass:"site-header--opening",lastScroll:0},$window,$navContainerWithLogo,$logoContainer,$nav,$wrapper,$siteHeader;function init(){$window=$(window),$navContainerWithLogo=$(selectors.navContainerWithLogo),$logoContainer=$(selectors.logoContainer),$nav=$(selectors.navigation),$wrapper=$(selectors.wrapper),$siteHeader=$(selectors.siteHeader),config.stickyEnabled=$siteHeader.data("sticky"),config.stickyEnabled&&(config.wrapperOverlayed=$wrapper.hasClass(config.overlayedClass),stickyHeader()),theme.settings.overlayHeader=$siteHeader.data("overlay"),theme.settings.overlayHeader&&Shopify.designMode&&$("body").hasClass("template-collection")&&!$(".collection-hero").length&&this.disableOverlayHeader(),accessibleDropdowns(),searchDrawer(),$window.on("load"+config.namespace,resizeLogo),$window.on("resize"+config.namespace,$.debounce(150,resizeLogo))}function unload(){$(window).off(config.namespace),$(selectors.searchBtn).off(config.namespace),$(selectors.closeSearch).off(config.namespace),$parent.off(config.namespace),$(selectors.navLinks).off(config.namespace),$(selectors.navDropdownLinks).off(config.namespace)}function searchDrawer(){$(selectors.searchBtn).on("click"+config.namespace,function(evt){evt.preventDefault(),openSearchDrawer()}),$(selectors.closeSearch).on("click"+config.namespace,function(){closeSearchDrawer()})}function openSearchDrawer(){$(selectors.searchContainer).addClass("is-active"),$parent.addClass("js-drawer-open js-drawer-open--search"),theme.a11y.trapFocus({$container:$(selectors.searchContainer),namespace:"header_search",$elementToFocus:$(selectors.searchContainer).find("input")}),theme.config.bpSmall&&config.stickyEnabled&&config.lastScroll<300&&window.scrollTo(0,0),theme.a11y.lockMobileScrolling(config.namespace),$page.on("click"+config.namespace,function(){return closeSearchDrawer(),!1}),$parent.on("keyup"+config.namespace,function(evt){evt.keyCode===27&&closeSearchDrawer()})}function closeSearchDrawer(){$(document.activeElement).trigger("blur"),$parent.removeClass("js-drawer-open js-drawer-open--search").off(config.namespace),$(selectors.searchContainer).removeClass("is-active"),theme.a11y.removeTrapFocus({$container:$(selectors.searchContainer),namespace:"header_search"}),theme.a11y.unlockMobileScrolling(config.namespace),$page.off("click"+config.namespace),$parent.off("keyup"+config.namespace)}function resizeLogo(){$(selectors.logo).each(function(){var $el=$(this),logoWidthOnScreen=$el.width(),containerWidth=$el.closest(".grid__item").width();logoWidthOnScreen>containerWidth?$el.css("maxWidth",containerWidth):$el.removeAttr("style")})}function accessibleDropdowns(){var hasActiveDropdown=!1,hasActiveSubDropdown=!1,closeOnClickActive=!1;theme.config.isTouch&&($(selectors.navLinksWithDropdown).on("touchend"+config.namespace,function(evt){var $el=$(this),$parentItem=$el.parent();$parentItem.hasClass(classes.dropdownActive)?window.location.replace($el.attr("href")):(evt.preventDefault(),closeDropdowns(),openFirstLevelDropdown($el))}),$(selectors.navDropdownLinks).on("touchend"+config.namespace,function(evt){var $el=$(this),$parentItem=$el.parent();$parentItem.hasClass(classes.hasSubDropdownClass)?$parentItem.hasClass(classes.dropdownActive)?window.location.replace($el.attr("href")):(evt.preventDefault(),closeThirdLevelDropdown(),openSecondLevelDropdown($el)):window.location.replace($el.attr("href"))})),$(selectors.navLinks).on("focusin mouseover"+config.namespace,function(){hasActiveDropdown&&closeSecondLevelDropdown(),hasActiveSubDropdown&&closeThirdLevelDropdown(),openFirstLevelDropdown($(this))}),$(selectors.navLinks).on("mouseleave"+config.namespace,function(){closeDropdowns()}),$(selectors.navDropdownLinks).on("focusin"+config.namespace,function(){closeThirdLevelDropdown(),openSecondLevelDropdown($(this),!0)});function openFirstLevelDropdown($el){var $parentItem=$el.parent();if($parentItem.hasClass(classes.hasDropdownClass)&&($parentItem.addClass(classes.dropdownActive),hasActiveDropdown=!0),!theme.config.isTouch&&!closeOnClickActive){var eventType=theme.config.isTouch?"touchend":"click";closeOnClickActive=!0,$("body").on(eventType+config.namespace,function(){closeDropdowns(),$("body").off(config.namespace),closeOnClickActive=!1})}}function openSecondLevelDropdown($el,skipCheck){var $parentItem=$el.parent();($parentItem.hasClass(classes.hasSubDropdownClass)||skipCheck)&&($parentItem.addClass(classes.dropdownActive),hasActiveSubDropdown=!0)}function closeDropdowns(){closeSecondLevelDropdown(),closeThirdLevelDropdown()}function closeSecondLevelDropdown(){$(selectors.navItems).removeClass(classes.dropdownActive)}function closeThirdLevelDropdown(){$(selectors.navDropdownLinks).parent().removeClass(classes.dropdownActive)}}function stickyHeader(){config.lastScroll=0,$siteHeader.wrap('
'),stickyHeaderHeight(),$window.on("resize"+config.namespace,$.debounce(50,stickyHeaderHeight)),$window.on("scroll"+config.namespace,$.throttle(15,stickyHeaderScroll)),Shopify&&Shopify.designMode&&setTimeout(function(){stickyHeaderHeight()},250)}function stickyHeaderHeight(){var $stickyHeader=$(".site-header-sticky").css("height",$siteHeader.outerHeight(!0))}function stickyHeaderScroll(){var scroll=$window.scrollTop(),threshold=250;if(scroll>threshold){if(config.stickyActive)return;config.stickyActive=!0,$siteHeader.addClass(config.stickyClass),config.wrapperOverlayed&&$wrapper.removeClass(config.overlayedClass),setTimeout(function(){$siteHeader.addClass(config.openTransitionClass)},100)}else{if(!config.stickyActive)return;config.stickyActive=!1,$siteHeader.removeClass(config.openTransitionClass).removeClass(config.stickyClass),config.wrapperOverlayed&&$wrapper.addClass(config.overlayedClass)}config.lastScroll=scroll}function disableOverlayHeader(){$(selectors.wrapper).removeClass(config.overlayEnabledClass).removeClass(config.overlayedClass),config.wrapperOverlayed=!1}return{init:init,disableOverlayHeader:disableOverlayHeader,unload:unload}}(),theme.articleImages=function(){var cache={};function init(){cache.$rteImages=$(".rte--indented-images"),cache.$rteImages.length&&$(window).on("load",setImages)}function setImages(){cache.$rteImages.find("img").each(function(){var $el=$(this),attr=$el.attr("style");(!attr||attr=="float: none;")&&$el.width()=0;i--){var obj=resultTypes[i],type=obj[0],results=obj[1];switch(resultCount+=results.length,type){case"products":data[type]=buildProducts(results);break;default:data[type]=parseResultImages(results);break}}resultCount===0&&reset(),$(selectors.resultDiv).empty().append(resultTemplate(data)),$(selectors.searchTerm,selectors.wrapper).text(q)}))}function buildProducts(results){for(var products=[],i=results.length-1;i>=0;i--){var product=results[i],new_product={title:product.title,url:product.url,image:theme.Images.getSizedImageUrl(product.image,"200x200_crop_center"),vendor:product.vendor,price:theme.Currency.formatMoney(product.price),compare_price_max:theme.Currency.formatMoney(product.compare_at_price_max),on_sale:parseInt(product.compare_at_price_max)>parseInt(product.price)};products.push(new_product)}return products}function parseResultImages(results){for(var i=results.length-1;i>=0;i--)if(results[i].image){var image=theme.Images.getSizedImageUrl(results[i].image,"200x200_crop_center");results[i].image=image}return results}function _normalizeQuery(string){return typeof string!="string"?null:string.trim().replace(/\ /g,"-").toLowerCase()}function navigationEvent(evt,direction){}return{init:init}}(),theme.initQuickShop=function(reinit){var ids=[],$buttons=$(".quick-product__btn");$buttons.each(function(){var id=$(this).data("product-id"),modalId="QuickShopModal-"+id,name="quick-modal-"+id;if(ids.indexOf(id)>-1){$('.modal--quick-shop[data-product-id="'+id+'"]').each(function(i){i>0&&$(this).remove()});return}new theme.Modals(modalId,name),ids.push(id)})},theme.videoModal=function(){var youtubePlayer=null,videoOptions={width:1280,height:720,playerVars:{autohide:0,autoplay:1,branding:0,cc_load_policy:0,fs:0,iv_load_policy:3,modestbranding:1,playsinline:1,quality:"hd720",rel:0,showinfo:0,wmode:"opaque"},events:{onReady:onPlayerReady}},videoHolderId="VideoHolder",activeVideo=!1,selectors={videoHolder:"#"+videoHolderId,youtube:'a[href*="youtube.com/watch"], a[href*="youtu.be/"]',mp4Trigger:".product-video-trigger--mp4",mp4Player:".product-video-mp4-sound"};if(!$(selectors.youtube).length&&!$(selectors.mp4Trigger).length)return;var modal=new theme.Modals("VideoModal","video-modal",{closeOffContentClick:!0,solid:!0});$(selectors.youtube).on("click",triggerYouTubeModal),$(selectors.mp4Trigger).on("click",triggerMp4Modal),$("body").on("modalClose.VideoModal",function(){youtubePlayer&&activeVideo==="youtube"?setTimeout(function(){youtubePlayer.destroy()},500):emptyVideoHolder()});function triggerYouTubeModal(evt){emptyVideoHolder(),evt.preventDefault(),theme.LibraryLoader.load("youtubeSdk"),theme.config.youTubeReady?startYoutubeOnClick(evt):$("body").on("youTubeReady",function(){startYoutubeOnClick(evt)})}function triggerMp4Modal(evt){emptyVideoHolder();var $el=$(evt.currentTarget),$mp4Player=$el.next(selectors.mp4Player);$mp4Player.clone().removeClass("hide").appendTo(selectors.videoHolder),modal.open(evt),$(selectors.videoHolder).find("video")[0].play(),activeVideo="mp4"}function startYoutubeOnClick(evt){var $el=$(evt.currentTarget),videoId=getYoutubeVideoId($el.attr("href")),args=$.extend({},videoOptions,{videoId:videoId});args.playerVars.playsinline=theme.config.bpSmall?0:1,youtubePlayer=new YT.Player(videoHolderId,args),modal.open(evt),activeVideo="youtube"}function onPlayerReady(evt){evt.target.playVideo()}function getYoutubeVideoId(url){var regExp=/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/,match=url.match(regExp);return match&&match[7].length==11?match[7]:!1}function emptyVideoHolder(){$(selectors.videoHolder).empty()}},theme.parallaxSections={},theme.Parallax=function(){var speed=7;function parallax(el,args){this.$container=$(el),this.namespace=args.namespace,this.$container.length&&(args.desktopOnly?this.desktopInit():this.init(this.$container,args))}return parallax.prototype=$.extend({},parallax.prototype,{init:function(desktopOnly){var $window=this.$window=$(window),elTop=this.$container.offset().top;$window.on("scroll"+this.namespace,function(evt){var scrolled=$window.scrollTop(),shiftDistance=(elTop-scrolled)/speed;this.$container.css({transform:"translate3d(0, "+shiftDistance+"px, 0)"})}.bind(this)),$window.on("resize"+this.namespace,$.debounce(350,function(){if($window.off(this.namespace),desktopOnly&&!theme.config.bpSmall){this.init(!0);return}this.init()}.bind(this)))},desktopInit:function(){theme.config.bpSmall||this.init(!0),$("body").on("matchSmall",function(){this.destroy()}.bind(this)),$("body").on("matchLarge",function(){this.init(!0)}.bind(this))},destroy:function(){this.$container.removeAttr("style"),this.$window.off(this.namespace)}}),parallax}(),theme.Disclosure=function(){var selectors={disclosureList:"[data-disclosure-list]",disclosureToggle:"[data-disclosure-toggle]",disclosureInput:"[data-disclosure-input]",disclosureOptions:"[data-disclosure-option]"},classes={listVisible:"disclosure-list--visible"};function Disclosure($disclosure){this.$container=$disclosure,this.cache={},this._cacheSelectors(),this._connectOptions(),this._connectToggle(),this._onFocusOut()}return Disclosure.prototype=$.extend({},Disclosure.prototype,{_cacheSelectors:function(){this.cache={$disclosureList:this.$container.find(selectors.disclosureList),$disclosureToggle:this.$container.find(selectors.disclosureToggle),$disclosureInput:this.$container.find(selectors.disclosureInput),$disclosureOptions:this.$container.find(selectors.disclosureOptions)}},_connectToggle:function(){this.cache.$disclosureToggle.on("click",function(evt){var ariaExpanded=$(evt.currentTarget).attr("aria-expanded")==="true";$(evt.currentTarget).attr("aria-expanded",!ariaExpanded),this.cache.$disclosureList.toggleClass(classes.listVisible)}.bind(this))},_connectOptions:function(){this.cache.$disclosureOptions.on("click",function(evt){evt.preventDefault(),this._submitForm($(evt.currentTarget).data("value"))}.bind(this))},_onFocusOut:function(){this.cache.$disclosureToggle.on("focusout",function(evt){var disclosureLostFocus=this.$container.has(evt.relatedTarget).length===0;disclosureLostFocus&&this._hideList()}.bind(this)),this.cache.$disclosureList.on("focusout",function(evt){var childInFocus=$(evt.currentTarget).has(evt.relatedTarget).length>0,isVisible=this.cache.$disclosureList.hasClass(classes.listVisible);isVisible&&!childInFocus&&this._hideList()}.bind(this)),this.$container.on("keyup",function(evt){evt.which===27&&(this._hideList(),this.cache.$disclosureToggle.focus())}.bind(this)),$("body").on("click",function(evt){var isOption=this.$container.has(evt.target).length>0,isVisible=this.cache.$disclosureList.hasClass(classes.listVisible);isVisible&&!isOption&&this._hideList()}.bind(this))},_submitForm:function(value){$("body").addClass("unloading"),this.cache.$disclosureInput.val(value),this.$container.parents("form").submit()},_hideList:function(){this.cache.$disclosureList.removeClass(classes.listVisible),this.cache.$disclosureToggle.attr("aria-expanded",!1)},unload:function(){this.cache.$disclosureOptions.off(),this.cache.$disclosureToggle.off(),this.cache.$disclosureList.off(),this.$container.off()}}),Disclosure}(),theme.ProductMedia=function(){var modelJsonSections={},models={},xrButtons={},selectors={mediaGroup:"[data-product-single-media-group]",xrButton:"[data-shopify-xr]"};function init(modelViewerContainers,sectionId){modelJsonSections[sectionId]={loaded:!1},modelViewerContainers.each(function(index){var $modelViewerContainer=$(this),mediaId=$modelViewerContainer.data("media-id"),$modelViewerElement=$($modelViewerContainer.find("model-viewer")[0]),modelId=$modelViewerElement.data("model-id");if(index===0){var $xrButton=$modelViewerContainer.closest(selectors.mediaGroup).find(selectors.xrButton);xrButtons[sectionId]={$element:$xrButton,defaultId:modelId}}models[mediaId]={modelId:modelId,sectionId:sectionId,$container:$modelViewerContainer,$element:$modelViewerElement}}),window.Shopify.loadFeatures([{name:"shopify-xr",version:"1.0",onLoad:setupShopifyXr},{name:"model-viewer-ui",version:"1.0",onLoad:setupModelViewerUi}]),theme.LibraryLoader.load("modelViewerUiStyles")}function setupShopifyXr(errors){if(!errors){if(!window.ShopifyXR){document.addEventListener("shopify_xr_initialized",function(){setupShopifyXr()});return}for(var sectionId in modelJsonSections)if(modelJsonSections.hasOwnProperty(sectionId)){var modelSection=modelJsonSections[sectionId];if(modelSection.loaded)continue;var $modelJson=$("#ModelJson-"+sectionId);window.ShopifyXR.addModels(JSON.parse($modelJson.html())),modelSection.loaded=!0}window.ShopifyXR.setupXRElements()}}function setupModelViewerUi(errors){if(!errors){for(var key2 in models)if(models.hasOwnProperty(key2)){var model=models[key2];model.modelViewerUi||(model.modelViewerUi=new Shopify.ModelViewerUI(model.$element)),setupModelViewerListeners(model)}}}function setupModelViewerListeners(model){var xrButton=xrButtons[model.sectionId];model.$container.on("mediaVisible",function(){xrButton.$element.attr("data-shopify-model3d-id",model.modelId),!theme.config.isTouch&&model.modelViewerUi.play()}),model.$container.on("mediaHidden",function(){xrButton.$element.attr("data-shopify-model3d-id",xrButton.defaultId),model.modelViewerUi.pause()}).on("xrLaunch",function(){model.modelViewerUi.pause()})}function removeSectionModels(sectionId){for(var key2 in models)if(models.hasOwnProperty(key2)){var model=models[key2];model.sectionId===sectionId&&delete models[key2]}delete modelJsonSections[sectionId]}return{init:init,removeSectionModels:removeSectionModels}}(),theme.customerTemplates=function(){function initEventListeners(){$("#RecoverPassword").on("click",function(evt){evt.preventDefault(),toggleRecoverPasswordForm()}),$("#HideRecoverPasswordLink").on("click",function(evt){evt.preventDefault(),toggleRecoverPasswordForm()})}function toggleRecoverPasswordForm(){$("#RecoverPasswordForm").toggleClass("hide"),$("#CustomerLoginForm").toggleClass("hide")}function resetPasswordSuccess(){var $formState=$(".reset-password-success");$formState.length&&$("#ResetSuccess").removeClass("hide")}function customerAddressForm(){var $newAddressForm=$("#AddressNewForm"),$addressForms=$(".js-address-form");!$newAddressForm.length||!$addressForms.length||(Shopify&&$(".js-address-country").each(function(){var $container=$(this),countryId=$container.data("country-id"),provinceId=$container.data("province-id"),provinceContainerId=$container.data("province-container-id");new Shopify.CountryProvinceSelector(countryId,provinceId,{hideElement:provinceContainerId})}),$(".address-new-toggle").on("click",function(){$newAddressForm.toggleClass("hide")}),$(".address-edit-toggle").on("click",function(){var formId=$(this).data("form-id");$("#EditAddress_"+formId).toggleClass("hide")}),$(".address-delete").on("click",function(){var $el=$(this),formId=$el.data("form-id"),confirmMessage=$el.data("confirm-message");confirm(confirmMessage||"Are you sure you wish to delete this address?")&&Shopify.postLink("/account/addresses/"+formId,{parameters:{_method:"delete"}})}))}function checkUrlHash(){var hash=window.location.hash;hash==="#recover"&&toggleRecoverPasswordForm()}return{init:function(){checkUrlHash(),initEventListeners(),resetPasswordSuccess(),customerAddressForm()}}}(),theme.Product=function(){var classes={onSale:"sale-price",disabled:"disabled",isModal:"is-modal",loading:"loading",loaded:"loaded",hidden:"hide",interactable:"video-interactable",visuallyHide:"visually-invisible"},selectors={productVideo:".product__video",videoParent:".product__video-wrapper",currentSlide:".slick-current",startingSlide:".starting-slide"},youtubeReady,videos={},youtubePlayers=[],youtubeVideoOptions={height:"480",width:"850",playerVars:{autohide:0,autoplay:0,branding:0,cc_load_policy:0,controls:0,fs:0,iv_load_policy:3,modestbranding:1,playsinline:1,quality:"hd720",rel:0,showinfo:0,wmode:"opaque"}};function onVideoPlayerReady(evt,id){var $player=$("#"+id),playerId=$player.attr("id");youtubePlayers[playerId]=evt.target;var player=youtubePlayers[playerId];setParentAsLoading($player),videos[playerId].style==="muted"?youtubePlayers[playerId].mute():setParentAsLoaded($player),($player.closest(selectors.startingSlide).length||$player.data("image-count")===1)&&videos[playerId].style==="muted"&&(youtubePlayers[playerId].playVideo(),initCheckVisibility(playerId))}function initCheckVisibility(playerId){videoVisibilityCheck(playerId),$(window).on("scroll."+playerId,{id:playerId},$.throttle(150,videoVisibilityCheck))}function videoVisibilityCheck(id){var playerId;if(typeof id=="string")playerId=id;else{if(!id.data)return;playerId=id.data.id}if(theme.isElementVisible($("#"+playerId))){if(videos[playerId]&&videos[playerId].style==="unmuted")return;playVisibleVideo(playerId)}else pauseHiddenVideo(playerId)}function playVisibleVideo(id){youtubePlayers[id]&&typeof youtubePlayers[id].playVideo=="function"&&youtubePlayers[id].playVideo()}function pauseHiddenVideo(id){youtubePlayers[id]&&typeof youtubePlayers[id].pauseVideo=="function"&&youtubePlayers[id].pauseVideo()}function onVideoStateChange(evt,id){var $player=$("#"+id),playerId=$player.attr("id"),player=youtubePlayers[playerId];switch(evt.data){case-1:videos[playerId].attemptedToPlay&&(setParentAsLoaded($player),setVideoToBeInteractedWith($player));break;case 0:videos[playerId]&&videos[playerId].loop&&player.playVideo();break;case 1:setParentAsLoaded($player);break;case 3:videos[playerId].attemptedToPlay=!0;break}}function setParentAsLoading($el){$el.closest(selectors.videoParent).addClass(classes.loading)}function setParentAsLoaded($el){$el.closest(selectors.videoParent).removeClass(classes.loading).addClass(classes.loaded)}function setVideoToBeInteractedWith($el){$el.closest(selectors.videoParent).addClass(classes.interactable)}function Product(container){var $container=this.$container=$(container),sectionId=this.sectionId=$container.attr("data-section-id");this.inModal=$container.closest(".modal").length,this.$modal,this.settings={enableHistoryState:$container.data("enable-history-state")||!1,namespace:".product-"+sectionId,inventory:$container.data("inventory")||!1,incomingInventory:$container.data("incoming-inventory")||!1,modalInit:!1,slickMainInitialized:!1,slickThumbInitialized:!1,thumbArrows:!1,thumbVertical:!1,hasImages:!0,hasMultipleImages:!1,imageSize:"620x",currentSlideIndex:0,videoLooping:$container.data("video-looping")},this.inModal&&(this.settings.enableHistoryState=!1,this.settings.namespace=".product-"+sectionId+"-modal",this.$modal=$("#QuickShopModal-"+sectionId)),this.selectors={variantsJson:"VariantsJson-"+sectionId,currentVariantJson:"CurrentVariantJson-"+sectionId,media:"[data-product-media-type-model]",closeMedia:".product-single__close-media",photoThumbs:".product__thumb-"+sectionId,thumbSlider:"#ProductThumbs-"+sectionId,mainSlider:"#ProductPhotos-"+sectionId,imageContainer:"[data-product-images]",productImageMain:".product-image-main--"+sectionId,dotsContainer:".product__photo-dots--"+sectionId,priceWrapper:".product__price-wrap-"+sectionId,price:"#ProductPrice-"+sectionId,comparePrice:"#ComparePrice-"+sectionId,priceA11y:"#PriceA11y-"+sectionId,comparePriceA11y:"#ComparePriceA11y-"+sectionId,unitWrapper:".product__unit-price-wrapper--"+sectionId,unitPrice:".product__unit-price--"+sectionId,unitPriceBaseUnit:".product__unit-base--"+sectionId,sku:"#Sku-"+sectionId,inventory:"#ProductInventory-"+sectionId,incomingInventory:"#ProductIncomingInventory-"+sectionId,addToCart:"#AddToCart-"+sectionId,addToCartText:"#AddToCartText-"+sectionId,originalSelectorId:"#ProductSelect-"+sectionId,singleOptionSelector:".variant__input-"+sectionId,variantColorSwatch:".variant__input--color-swatch-"+sectionId,modalFormHolder:"#ProductFormHolder-"+sectionId,formContainer:"#AddToCartForm-"+sectionId},this.$mainSlider=$(this.selectors.mainSlider),this.$thumbSlider=$(this.selectors.thumbSlider),this.$firstProductImage=this.$mainSlider.find("img").first(),this.$firstProductImage.length||(this.settings.hasImages=!1),this.init()}return Product.prototype=$.extend({},Product.prototype,{init:function(){this.inModal&&(this.$container.addClass(classes.isModal),$("body").off("modalOpen.QuickShopModal-"+this.sectionId).off("modalClose.QuickShopModal-"+this.sectionId),$("body").on("modalOpen.QuickShopModal-"+this.sectionId,this.openModalProduct.bind(this)),$("body").on("modalClose.QuickShopModal-"+this.sectionId,this.closeModalProduct.bind(this))),this.inModal||(this.stringOverrides(),this.formSetup(),this.productSetup(),this.checkIfVideos(),this.createImageCarousels(),this.customMediaListners())},formSetup:function(){theme.settings.dynamicVariantsEnable&&(this.$variantSelectors=$(this.selectors.formContainer).find(this.selectors.singleOptionSelector)),this.initQtySelector(),this.initAjaxProductForm(),this.initVariants()},productSetup:function(){this.setImageSizes(),this.initImageSwitch(),this.initImageZoom(),this.initModelViewerLibraries(),this.initShopifyXrLaunch()},stringOverrides:function(){theme.productStrings=theme.productStrings||{},$.extend(theme.strings,theme.productStrings)},setImageSizes:function(){if(this.settings.hasImages){var currentImage=this.$firstProductImage[0].currentSrc;currentImage&&(this.settings.imageSize=theme.Images.imageSize(currentImage))}},initVariants:function(){if(document.getElementById(this.selectors.variantsJson)){this.variantsObject=JSON.parse(document.getElementById(this.selectors.variantsJson).innerHTML);var options={$container:this.$container,enableHistoryState:this.settings.enableHistoryState,singleOptionSelector:this.selectors.singleOptionSelector,originalSelectorId:this.selectors.originalSelectorId,variants:this.variantsObject};$(this.selectors.variantColorSwatch).length&&$(this.selectors.variantColorSwatch).on("change",function(evt){var $el=$(evt.currentTarget),color=$el.data("color-name"),index=$el.data("color-index");this.updateColorName(color,index)}.bind(this)),this.variants=new theme.Variants(options),this.$container.on("variantChange"+this.settings.namespace,this.updateCartButton.bind(this)).on("variantImageChange"+this.settings.namespace,this.updateVariantImage.bind(this)).on("variantPriceChange"+this.settings.namespace,this.updatePrice.bind(this)).on("variantUnitPriceChange"+this.settings.namespace,this.updateUnitPrice.bind(this)),$(this.selectors.sku).length&&this.$container.on("variantSKUChange"+this.settings.namespace,this.updateSku.bind(this)),(this.settings.inventory||this.settings.incomingInventory)&&this.$container.on("variantChange"+this.settings.namespace,this.updateInventory.bind(this)),theme.settings.dynamicVariantsEnable&&document.getElementById(this.selectors.currentVariantJson)&&(this.currentVariantObject=JSON.parse(document.getElementById(this.selectors.currentVariantJson).innerHTML),this.$variantSelectors.on("change"+this.settings.namespace,this.updateVariantAvailability.bind(this)),this.setCurrentVariantAvailability(this.currentVariantObject,!0))}},updateColorName:function(color,index){$("#VariantColorLabel-"+this.sectionId+"-"+index).text(color)},initQtySelector:function(){this.$container.find(".js-qty__wrapper").each(function(){new theme.QtySelector($(this),{namespace:".product"})})},initAjaxProductForm:function(){theme.settings.cartType==="drawer"&&new theme.AjaxProduct($(this.selectors.formContainer))},setCurrentVariantAvailability:function(variant){var valuesToEnable={option1:[],option2:[],option3:[]};this.disableVariantGroup($(this.selectors.formContainer).find(".variant-input-wrap"));var availableVariants=this.variantsObject.filter(function(el){if(variant.id===el.id)return!1;if(variant.option2===el.option2&&variant.option3===el.option3||variant.option1===el.option1&&variant.option3===el.option3||variant.option1===el.option1&&variant.option2===el.option2)return!0}),variantObject={variant:variant};availableVariants=Object.assign({},variantObject,availableVariants);for(var property in availableVariants)if(availableVariants.hasOwnProperty(property)){var item=availableVariants[property],option1=item.option1,option2=item.option2,option3=item.option3;option1&&valuesToEnable.option1.indexOf(option1)===-1&&valuesToEnable.option1.push(option1),option2&&valuesToEnable.option2.indexOf(option2)===-1&&valuesToEnable.option2.push(option2),option3&&valuesToEnable.option3.indexOf(option3)===-1&&valuesToEnable.option3.push(option3)}valuesToEnable.option1.length&&this.enableVariantOptionByValue(valuesToEnable.option1,"option1"),valuesToEnable.option2.length&&this.enableVariantOptionByValue(valuesToEnable.option2,"option2"),valuesToEnable.option3.length&&this.enableVariantOptionByValue(valuesToEnable.option3,"option3")},updateVariantAvailability:function(evt,value,index){if(value&&index)var newVal=value,optionIndex=index;else var $el=$(evt.currentTarget),newVal=$el.val()?$el.val():evt.currentTarget.value,optionIndex=$el.data("index");var variants=this.variantsObject.filter(function(el){return el[optionIndex]===newVal});$(this.selectors.formContainer).find(".variant-input-wrap").each(function(index2,el){var $group=$(el),currentOptionIndex=$group.data("index");if(currentOptionIndex!==optionIndex){this.disableVariantGroup($group);for(var i=0;i|\/@])/g,"\\$1"),theme.settings.dynamicVariantType==="dropdown")$group.find('option[value="'+value+'"]').prop("disabled",!1);else{var $buttonGroup=$group.find('.variant-input[data-value="'+value+'"]');$buttonGroup.find("input").prop("disabled",!1),$buttonGroup.find("label").toggleClass("disabled",!1)}},updateCartButton:function(evt){var variant=evt.variant;variant?variant.available?($(this.selectors.addToCart).removeClass(classes.disabled).prop("disabled",!1),$(this.selectors.addToCartText).html(theme.strings.addToCart)):($(this.selectors.addToCart).addClass(classes.disabled).prop("disabled",!0),$(this.selectors.addToCartText).html(theme.strings.soldOut)):($(this.selectors.addToCart).addClass(classes.disabled).prop("disabled",!0),$(this.selectors.addToCartText).html(theme.strings.unavailable))},updatePrice:function(evt){var variant=evt.variant;variant&&($(this.selectors.price).html(theme.Currency.formatMoney(variant.price,theme.settings.moneyFormat)).show(),variant.compare_at_price>variant.price?($(this.selectors.comparePrice).html(theme.Currency.formatMoney(variant.compare_at_price,theme.settings.moneyFormat)),$(this.selectors.priceWrapper).removeClass(classes.hidden),$(this.selectors.price).addClass(classes.onSale),$(this.selectors.comparePriceA11y).attr("aria-hidden","false"),$(this.selectors.priceA11y).attr("aria-hidden","false")):($(this.selectors.priceWrapper).addClass(classes.hidden),$(this.selectors.price).removeClass(classes.onSale),$(this.selectors.comparePriceA11y).attr("aria-hidden","true"),$(this.selectors.priceA11y).attr("aria-hidden","true")))},updateUnitPrice:function(evt){var variant=evt.variant;variant&&variant.unit_price?($(this.selectors.unitPrice).html(theme.Currency.formatMoney(variant.unit_price,theme.settings.moneyFormat)),$(this.selectors.unitPriceBaseUnit).text(theme.Currency.getBaseUnit(variant)),$(this.selectors.unitWrapper).removeClass(classes.hidden).removeClass(classes.visuallyHide)):$(this.selectors.unitWrapper).addClass(classes.visuallyHide)},updateSku:function(evt){var variant=evt.variant,newSku="";variant&&(variant.sku&&(newSku=variant.sku),$(this.selectors.sku).html(newSku))},updateInventory:function(evt){var variant=evt.variant;if(!variant||!variant.inventory_management){this.toggleInventoryQuantity(!1),this.toggleIncomingInventory(!1);return}if(variant.inventory_management==="shopify"&&window.inventories&&window.inventories[this.sectionId]){variantInventoryObject=window.inventories[this.sectionId][variant.id];var quantity=variantInventoryObject.quantity,showInventory=!0,showIncomingInventory=!1;(quantity<=0||quantity>theme.settings.inventoryThreshold)&&(showInventory=!1),this.toggleInventoryQuantity(showInventory,quantity),!showInventory&&variantInventoryObject.incoming&&(showIncomingInventory=!0),this.toggleIncomingInventory(showIncomingInventory,variant.available,variantInventoryObject.next_incoming_date)}},toggleInventoryQuantity:function(show,qty){this.settings.inventory||(show=!1),show?$(this.selectors.inventory).removeClass(classes.hidden).text(theme.strings.stockLabel.replace("[count]",qty)):$(this.selectors.inventory).addClass(classes.hidden)},toggleIncomingInventory:function(show,available,date){if(this.settings.incomingInventory||(show=!1),show){var string=available?theme.strings.willNotShipUntil.replace("[date]",date):theme.strings.willBeInStockAfter.replace("[date]",date);date||(string=theme.strings.waitingForStock),$(this.selectors.incomingInventory).removeClass(classes.hidden).text(string)}else $(this.selectors.incomingInventory).addClass(classes.hidden)},checkIfVideos:function(){var $productVideos=this.$mainSlider.find(selectors.productVideo);if(!$productVideos.length)return!1;var videoTypes=[];return $productVideos.each(function(){var type=$(this).data("video-type");videoTypes.indexOf(type)<0&&videoTypes.push(type)}),videoTypes.indexOf("youtube")>-1&&(theme.config.youTubeReady?this.loadYoutubeVideos($productVideos):(theme.LibraryLoader.load("youtubeSdk"),$("body").on("youTubeReady"+this.settings.namespace,function(){this.loadYoutubeVideos($productVideos)}.bind(this)))),videoTypes.indexOf("mp4")>-1&&this.loadMp4Videos($productVideos),videoTypes},loadMp4Videos:function($videos){$videos.each(function(){var $el=$(this);if($el.data("video-type")=="mp4"){var id=$el.attr("id"),videoId=$el.data("video-id");videos[id]={type:"mp4",divId:id,style:$el.data("video-style")}}})},loadYoutubeVideos:function($videos){$videos.each(function(){var $el=$(this);if($el.data("video-type")=="youtube"){var id=$el.attr("id"),videoId=$el.data("youtube-id");videos[id]={type:"youtube",id:id,videoId:videoId,style:$el.data("video-style"),loop:$el.data("video-loop"),attemptedToPlay:!1,events:{onReady:function(evt){onVideoPlayerReady(evt,id)},onStateChange:function(evt){onVideoStateChange(evt,id)}}}}});for(var key2 in videos)if(videos[key2].type==="youtube"&&videos.hasOwnProperty(key2)){var args=$.extend({},youtubeVideoOptions,videos[key2]);args.style==="muted"||(args.playerVars.controls=1,args.playerVars.autoplay=0),youtubePlayers[key2]=new YT.Player(key2,args)}youtubeReady=!0},initVideo:function($video){var videoType=$video.data("video-type"),divId=$video.attr("id");videoType==="mp4"&&videos[divId].style==="muted"&&this.playMp4Video(divId),videoType==="youtube"&&youtubeReady&&videos[divId].style==="muted"&&this.requestToPlayYoutubeVideo(divId),this.inModal&&this.resizeSlides()},stopVideo:function(id,type){id||(this.stopYoutubeVideo(),this.stopMp4Video()),type==="youtube"&&this.stopYoutubeVideo(id),type==="mp4"&&this.stopMp4Video(id)},getVideoType:function($video){return $video.data("video-type")},getVideoId:function($video){return $video.attr("id")},requestToPlayYoutubeVideo:function(id,forcePlay){if(theme.config.youTubeReady){var $player=$("#"+id);if(setParentAsLoading($player),typeof youtubePlayers[id].playVideo!="function"){setTimeout(function(){this.playYoutubeVideo(id,forcePlay)}.bind(this),1e3);return}this.playYoutubeVideo(id,forcePlay)}},playYoutubeVideo:function(id,forcePlay){var $player=$("#"+id);setParentAsLoaded($player),typeof youtubePlayers[id].playVideo=="function"&&youtubePlayers[id].playVideo(),forcePlay||initCheckVisibility(id)},stopYoutubeVideo:function(id){if(theme.config.youTubeReady)if(id&&youtubePlayers[id])typeof youtubePlayers[id].pauseVideo=="function"&&youtubePlayers[id].pauseVideo(),$(window).off("scroll."+id);else for(key in youtubePlayers){var childVideo=this.$container.find("#"+key);childVideo.length&&typeof youtubePlayers[key].pauseVideo=="function"&&(youtubePlayers[key].pauseVideo(),$(window).off("scroll."+key))}},playMp4Video:function(id){var $player=$("#"+id);setParentAsLoaded($player);var playPromise=$player[0].play();playPromise!==void 0&&playPromise.then(function(){}).catch(function(error){$player[0].setAttribute("controls",""),$player.closest(selectors.videoParent).attr("data-video-style","unmuted")})},stopMp4Video:function(id){if(id)$("#"+id)[0].pause();else for(var key2 in videos){var childVideo=this.$container.find("#"+key2);if(childVideo.length&&videos[key2].type==="mp4"){var player=$("#"+videos[key2].divId)[0];player&&typeof player.pause=="function"&&player.pause()}}},initImageSwitch:function(){if($(this.selectors.photoThumbs).length){var self=this;$(this.selectors.photoThumbs).on("click",function(evt){evt.preventDefault()}).on("focus",function(evt){if(this.settings.slickThumbInitialized){var index=$(evt.currentTarget).data("index");index!==void 0&&this.$thumbSlider.slick("slickGoTo",index)}}.bind(this)).on("keydown",function(evt){evt.keyCode===13&&this.$container.find(selectors.currentSlide).focus()}.bind(this))}},initImageZoom:function(){var $container=$(this.selectors.imageContainer,this.$container),imageZoom=new theme.Photoswipe($container[0],this.sectionId)},updateVariantImage:function(evt){var variant=evt.variant,sizedImgUrl=theme.Images.getSizedImageUrl(variant.featured_media.preview_image.src,this.settings.imageSize),$newImage=$('.product__thumb[data-id="'+variant.featured_media.id+'"]'),imageIndex=this._slideIndex($newImage.closest(".product__thumb-item"));typeof imageIndex!="undefined"&&this.$mainSlider.slick("slickGoTo",imageIndex)},createImageCarousels:function(){if(!this.$thumbSlider.length||$(this.selectors.photoThumbs).length<2){var $video=$(this.selectors.productImageMain).find(selectors.productVideo);$video.length&&this.initVideo($video);return}this.settings.hasMultipleImages=!0;var $activeSlide=this.$mainSlider.find(".starting-slide"),startIndex=this._slideIndex($activeSlide);this.$mainSlider.off("init"),this.$mainSlider.off("beforeChange"),this.$mainSlider.on("init",this.mainSlideInit.bind(this)),this.$mainSlider.on("beforeChange",this.beforeSlideChange.bind(this)),this.$thumbSlider.on("init",this.thumbSlideInit.bind(this));var thumbnailsVertical=this.settings.thumbVertical=this.$thumbSlider.data("position")==="beside",thumbArrows=this.settings.thumbArrows=this.$thumbSlider.data("arrows");this.$mainSlider.slick({accessibility:!1,adaptiveHeight:!0,asNavFor:this.selectors.thumbSlider,infinite:!1,arrows:!1,dots:!1,initialSlide:startIndex,appendDots:this.selectors.dotsContainer}),this.$thumbSlider.slick({accessibility:!1,asNavFor:this.selectors.mainSlider,slidesToShow:1,slidesToScroll:1,arrows:thumbArrows,dots:!1,vertical:thumbnailsVertical,verticalSwiping:thumbnailsVertical,focusOnSelect:!0,infinite:!1,customHeightMatching:thumbArrows?!1:thumbnailsVertical,customSlideAdvancement:!0,initialSlide:startIndex}),AOS&&AOS.refresh()},destroyImageCarousels:function(){this.$mainSlider&&this.settings.slickMainInitialized&&(this.$mainSlider.slick("unslick"),this.settings.slickMainInitialized=!1),this.$thumbSlider&&this.settings.slickThumbInitialized&&(this.$thumbSlider.slick("unslick"),this.settings.slickThumbInitialized=!1),this.settings.slickMainInitialized=!1,this.settings.slickThumbInitialized=!1},mainSlideInit:function(event,slick){var $slider=slick.$slider,$currentSlide=$slider.find(selectors.currentSlide),$video=$currentSlide.find(selectors.productVideo);this.settings.slickMainInitialized=!0,this.settings.currentSlideIndex=$currentSlide.data("slick-index"),$video.length&&this.initVideo($video)},thumbSlideInit:function(event,slick){this.settings.slickThumbInitialized=!0,this.settings.thumbArrows&&this.$thumbSlider.on("setPosition",this.thumbSlideArrowVisibility.bind(this))},thumbSlideArrowVisibility:function(event,slick){var $slider=slick.$slider,$arrows=$slider.find(".slick-arrow"),showArrows=!1;if(this.settings.thumbVertical){var $trackHeight=$slider.find(".slick-track").height();$trackHeight>=$slider.height()&&(showArrows=!0)}else{var $trackWidth=$slider.find(".slick-track").width();$trackWidth>=$slider.width()&&(showArrows=!0)}showArrows?$arrows.removeClass(classes.hidden):$arrows.addClass(classes.hidden)},beforeSlideChange:function(event,slick,currentSlide,nextSlide){if(this.settings.currentSlideIndex!==nextSlide){this.settings.currentSlideIndex=nextSlide;var $slider=slick.$slider,$currentSlide=$slider.find(selectors.currentSlide),$nextSlide=$slider.find('.slick-slide[data-slick-index="'+nextSlide+'"]');$currentSlide.attr("tabindex","-1"),$nextSlide.attr("tabindex",0);var $prevVideo=$currentSlide.find(".product__video");if(currentSlide!==nextSlide&&$prevVideo.length){var prevVideoType=this.getVideoType($prevVideo),prevVideoId=this.getVideoId($prevVideo);prevVideoId&&this.stopVideo(prevVideoId,prevVideoType)}var $nextVideo=$nextSlide.find(".product__video");if($nextVideo.length){var nextVideoType=this.getVideoType($nextVideo),nextVideoId=this.getVideoId($nextVideo);nextVideoId&&nextVideoType==="youtube"&&(youtubeReady?videos[nextVideoId]&&videos[nextVideoId].style==="muted"&&this.requestToPlayYoutubeVideo(nextVideoId,!0):$("body").on("youTubeReady"+this.settings.namespace,function(){videos[nextVideoId]&&videos[nextVideoId].style==="muted"&&this.requestToPlayYoutubeVideo(nextVideoId,!0)}.bind(this))),nextVideoId&&videos[nextVideoId]&&videos[nextVideoId].style==="muted"&&nextVideoType==="mp4"&&this.playMp4Video(nextVideoId),nextVideoId&&videos[nextVideoId]&&videos[nextVideoId].style!="muted"&&setParentAsLoaded($("#"+nextVideoId))}var $currentMedia=$currentSlide.find(this.selectors.media);$currentMedia.length&&$currentMedia.trigger("mediaHidden");var $nextMedia=$nextSlide.find(this.selectors.media);$nextMedia.length&&($nextMedia.trigger("mediaVisible"),$nextSlide.find(".shopify-model-viewer-ui__button").attr("tabindex",0),$nextSlide.find(".product-single__close-media").attr("tabindex",0))}},resizeSlides:function(){this.settings.hasMultipleImages&&($(window).trigger("resize.slick"),setTimeout(function(){this.$mainSlider&&this.settings.slickMainInitialized&&this.$mainSlider.slick("setPosition"),this.$thumbSlider&&this.settings.slickThumbInitialized&&this.$thumbSlider.slick("setPosition")}.bind(this),500))},_slideIndex:function($el){return $el.data("index")},openModalProduct:function(){if(!this.settings.modalInit){var $formHolder=$(this.selectors.modalFormHolder),url=$formHolder.data("url"),template=$formHolder.data("template");template||(url=url+"?view=ajax"),$formHolder.load(url+" #AddToCartForm-"+this.sectionId,function(){this.formSetup(),Shopify.PaymentButton&&Shopify.PaymentButton.init()}.bind(this)),this.productSetup(),this.loadModalContent(),this.createImageCarousels(),this.customMediaListners(),this.settings.modalInit=!0}this.resizeSlides()},closeModalProduct:function(){this.stopVideo(),$("body").off(this.settings.namespace),$(window).off(this.settings.namespace)},loadModalContent:function(){var videoTypes=this.checkIfVideos();videoTypes&&videoTypes.indexOf("mp4")>-1&&this.$modal.find('.product__video[data-video-type="mp4"]').find(".product__video-src").each(function(i,video){var $el=$(video),src=$el.attr("src"),type=$el.attr("type"),newEl=document.createElement("source");newEl.src=src,newEl.type=type,$el.after(newEl)}.bind(this))},initModelViewerLibraries:function(){var $modelViewerElements=$(this.selectors.media,this.$container);$modelViewerElements.length<1||theme.ProductMedia.init($modelViewerElements,this.sectionId)},initShopifyXrLaunch:function(){var self=this;$(document).on("shopify_xr_launch",function(){var $currentMedia=$(self.selectors.productMediaWrapper+":not(."+classes.hidden+")",self.$container);$currentMedia.trigger("xrLaunch")})},customMediaListners:function(){$("body").on("click",this.selectors.closeMedia,function(){this.$mainSlider.find(selectors.currentSlide).find(this.selectors.media).trigger("mediaHidden")}.bind(this)),this.$container.find("model-viewer").on("shopify_model_viewer_ui_toggle_play",function(evt){this.mediaLoaded(evt)}.bind(this)).on("shopify_model_viewer_ui_toggle_pause",function(evt){this.mediaUnloaded(evt)}.bind(this))},mediaLoaded:function(evt){this.$container.find(this.selectors.closeMedia).removeClass(classes.hidden),this.toggleSliderSwiping(!1)},mediaUnloaded:function(evt){this.$container.find(this.selectors.closeMedia).addClass(classes.hidden),this.toggleSliderSwiping(!0)},toggleSliderSwiping:function(enable){this.$mainSlider&&this.settings.slickMainInitialized&&(this.$mainSlider.slick("slickSetOption","swipe",enable),this.$mainSlider.slick("slickSetOption","draggable",enable),this.$mainSlider.slick("slickSetOption","touchMove",enable),this.$mainSlider.slick("slickSetOption","accessibility",enable))},onUnload:function(){this.$container.off(this.settings.namespace),$("body").off(this.settings.namespace),this.destroyImageCarousels(),theme.ProductMedia.removeSectionModels(this.sectionId)}}),Product}(),theme.Recommendations=function(){function Recommendations(container){var $container=this.$container=$(container),sectionId=this.sectionId=$container.attr("data-section-id");this.selectors={recommendations:"#Recommendations-"+sectionId,placeholder:".product-recommendations-placeholder",sectionClass:" .product-recommendations",productResults:".grid-product"},this.init()}return Recommendations.prototype=$.extend({},Recommendations.prototype,{init:function(){var $section=$(this.selectors.recommendations);if(!(!$section.length||$section.data("enable")===!1)){var $placeholder=$section.find(this.selectors.placeholder),id=$section.data("product-id"),limit=$section.data("limit"),url="/recommendations/products?section_id=product-recommendations&limit="+limit+"&product_id="+id;$placeholder.load(url+this.selectors.sectionClass,function(data){theme.reinitProductGridItem($section),this.updateVariantInventory($section),$(data).find(this.selectors.sectionClass).find(this.selectors.productResults).length===0&&$section.addClass("hide")}.bind(this))}},updateVariantInventory:function($section){window.inventories=window.inventories||{},$section.find(".js-product-inventory-data").each(function(){var $el=$(this),sectionId=$el.data("section-id");window.inventories[sectionId]={},$(".js-variant-inventory-data",$el).each(function(){var $child=$(this);window.inventories[sectionId][$child.data("id")]={quantity:$child.data("quantity"),incoming:$child.data("incoming"),next_incoming_date:$child.data("date")}})})}}),Recommendations}(),theme.Collection=function(){var isAnimating=!1,selectors={sortSelect:"#SortBy",tags:".tags",hero:".collection-hero",parallaxContainer:".parallax-container"},data={sortBy:"data-default-sortby"},classes={activeTag:"tag--active"};function Collection(container){this.container=container,this.sectionId=$(container).attr("data-section-id"),this.namespace=".collection-"+this.sectionId;var $heroImageContainer=this.$heroContainer=$(container).find(".collection-hero");if($heroImageContainer.length){if(this.checkIfNeedReload(),theme.loadImageSection($heroImageContainer),$(container).data("parallax")){var $parallaxContainer=$(container).find(selectors.parallaxContainer),args={namespace:this.namespace};theme.parallaxSections[this.namespace]=new theme.Parallax($parallaxContainer,args)}}else theme.settings.overlayHeader&&theme.headerNav.disableOverlayHeader();$(window).on("popstate",function(state){state&&this.getNewCollectionContent(location.href)}.bind(this)),this.init()}return Collection.prototype=$.extend({},Collection.prototype,{init:function(){this.$container=$(this.container),this.sectionId=this.$container.attr("data-section-id"),this.$sortSelect=$(selectors.sortSelect),this.$sortSelect.on("change",this.onSortChange.bind(this)),this.defaultSort=this.getDefaultSortValue(),this.initParams(),this.sortTags(),this.initTagAjax()},initTagAjax:function(){this.$container.on("click"+this.namespace,".tags a",function(evt){var $el=$(evt.currentTarget);if(!$el.hasClass("no-ajax")&&(evt.preventDefault(),!isAnimating)){isAnimating=!0;var newUrl=$el.attr("href");$(selectors.tags).find("."+classes.activeTag).removeClass(classes.activeTag),$el.parent().addClass(classes.activeTag),history.pushState({},"",newUrl),$(".grid-product").addClass("unload"),this.getNewCollectionContent(newUrl)}}.bind(this))},getNewCollectionContent:function(url){url=url+"?view=ajax",$("#CollectionAjaxResult").load(url+" #CollectionAjaxContent",function(){isAnimating=!1,this.reInit()}.bind(this))},initParams:function(){if(this.queryParams={},location.search.length)for(var aKeyValue,aCouples=location.search.substr(1).split("&"),i=0;i1&&(this.queryParams[decodeURIComponent(aKeyValue[0])]=decodeURIComponent(aKeyValue[1]))},getSortValue:function(){return this.$sortSelect.val()||this.defaultSort},getDefaultSortValue:function(){return this.$sortSelect.attr(data.sortBy)},onSortChange:function(){this.queryParams.sort_by=this.getSortValue(),this.queryParams.page&&delete this.queryParams.page,window.location.search=$.param(this.queryParams)},sortTags:function(){var $sortTags=$("#SortTags");$sortTags.length&&$sortTags.on("change",function(){location.href=$(this).val()})},reInit:function(){for(var i=0;ithis.data.block_count&&(this.data.active_image=1),$container.find(".fading-images__item[data-slide-index="+this.data.active_image+"]").addClass(classes.activeImage)},nextTitle:function(){var $container=this.$container,$allTitles=this.selectors.$allTitles;this.selectors.$allTitles.removeClass(classes.activeTitles).addClass(classes.finishedTitles),this.data.active_title++,this.data.active_title>this.data.block_count&&(this.data.active_title=1);var target_title=this.data.active_title;window.setTimeout(function(){var newText1=$container.find(".fading-images__item[data-slide-index="+target_title+"]").attr("data-slide-title1"),newText2=$container.find(".fading-images__item[data-slide-index="+target_title+"]").attr("data-slide-title2");$container.find(".fading-images-overlay__title--1").text(newText1),$container.find(".fading-images-overlay__title--2").text(newText2),$allTitles.removeClass(classes.finishedTitles).addClass(classes.activeTitles)},this.data.finish_interval-200)},startImages:function(){this.$container.find(".fading-images__item[data-slide-index="+this.data.active_image+"]").addClass(classes.activeImage).addClass(classes.compensation),window.setTimeout(function(){var fading_images_timer=window.setInterval(this.nextImage.bind(this),this.data.interval)}.bind(this),this.data.timer_offset)},startTitles:function(){var $container=this.$container,$allTitles=this.selectors.$allTitles,target_title=this.data.active_title;window.setTimeout(function(){var newText1=$container.find(".fading-images__item[data-slide-index="+target_title+"]").attr("data-slide-title1"),newText2=$container.find(".fading-images__item[data-slide-index="+target_title+"]").attr("data-slide-title2");$container.find(".fading-images-overlay__title--1").text(newText1),$container.find(".fading-images-overlay__title--2").text(newText2),$allTitles.addClass(classes.activeTitles)},750);var fading_titles_timer=window.setInterval(this.nextTitle.bind(this),this.data.interval)},onLoad:function(){},onSelect:function(){},onDeselect:function(){},onUnload:function(){}}),FadingImages}(),theme.Maps=function(){var config={zoom:14},apiStatus=null,mapsToLoad=[],errors={addressNoResults:theme.strings.addressNoResults,addressQueryLimit:theme.strings.addressQueryLimit,addressError:theme.strings.addressError,authError:theme.strings.authError},selectors={section:'[data-section-type="map"]',map:"[data-map]",mapOverlay:"[data-map-overlay]"},classes={mapError:"map-section--load-error",errorMsg:"map-section__error errors text-center"};window.gm_authFailure=function(){Shopify.designMode&&($(selectors.section).addClass(classes.mapError),$(selectors.map).remove(),$(selectors.mapOverlay).after('
'+theme.strings.authError+"
"))};function Map(container){this.$container=$(container),this.sectionId=this.$container.attr("data-section-id"),this.namespace=".map-"+this.sectionId,this.$map=this.$container.find(selectors.map),this.key=this.$map.data("api-key"),this.key&&(this.checkVisibility(),$(window).on("scroll"+this.namespace,$.throttle(50,this.checkVisibility.bind(this))))}function initAllMaps(){$.each(mapsToLoad,function(index,instance){instance.createMap()})}function geolocate($map){var deferred=$.Deferred(),geocoder=new google.maps.Geocoder,address=$map.data("address-setting");return geocoder.geocode({address:address},function(results,status2){status2!==google.maps.GeocoderStatus.OK&&deferred.reject(status2),deferred.resolve(results)}),deferred}return Map.prototype=$.extend({},Map.prototype,{prepMapApi:function(){apiStatus==="loaded"?this.createMap():(mapsToLoad.push(this),apiStatus!=="loading"&&(apiStatus="loading",(typeof window.google=="undefined"||typeof window.google.maps=="undefined")&&$.getScript("https://maps.googleapis.com/maps/api/js?key="+this.key).then(function(){apiStatus="loaded",initAllMaps()})))},createMap:function(){var $map=this.$map;return geolocate($map).then(function(results){var mapOptions={zoom:config.zoom,backgroundColor:"none",center:results[0].geometry.location,draggable:!1,clickableIcons:!1,scrollwheel:!1,disableDoubleClickZoom:!0,disableDefaultUI:!0},map=this.map=new google.maps.Map($map[0],mapOptions),center=this.center=map.getCenter(),marker=new google.maps.Marker({map:map,position:map.getCenter()});google.maps.event.addDomListener(window,"resize",$.debounce(250,function(){google.maps.event.trigger(map,"resize"),map.setCenter(center),$map.removeAttr("style")}))}.bind(this)).fail(function(){var errorMessage;switch(status){case"ZERO_RESULTS":errorMessage=errors.addressNoResults;break;case"OVER_QUERY_LIMIT":errorMessage=errors.addressQueryLimit;break;case"REQUEST_DENIED":errorMessage=errors.authError;break;default:errorMessage=errors.addressError;break}Shopify.designMode&&$map.parent().addClass(classes.mapError).html('
'+errorMessage+"
")})},checkVisibility:function(){theme.isElementVisible(this.$container,600)&&(this.prepMapApi(),$(window).off(this.namespace))},onUnload:function(){this.$map.length!==0&&google.maps.event.clearListeners(this.map,"resize")}}),Map}(),theme.Blog=function(){function Blog(container){this.tagFilters()}return Blog.prototype=$.extend({},Blog.prototype,{tagFilters:function(){var $filterBy=$("#BlogTagFilter");$filterBy.length&&$filterBy.on("change",function(){location.href=$(this).val()})},onUnload:function(){}}),Blog}(),theme.Photoswipe=function(){var selectors={trigger:".js-photoswipe__zoom",images:".photoswipe__image",activeImage:".slick-active .photoswipe__image"};function Photoswipe(container,sectionId){this.$container=$(container),this.sectionId=sectionId,this.namespace=".photoswipe-"+this.sectionId,this.gallery,this.$images,this.inSlideshow=!1,this.$container.attr("data-zoom")!=="false"&&(this.$container.attr("data-has-slideshow")==="true"&&(this.inSlideshow=!0),this.init())}return Photoswipe.prototype=$.extend({},Photoswipe.prototype,{init:function(){var $trigger=this.$container.find(selectors.trigger);this.$images=this.$container.find(selectors.images);var items=[];$trigger.on("click"+this.namespace,function(evt){if(items=this.getImageData(),this.inSlideshow)var index=this.$container.find(selectors.activeImage).data("index");else var index=$(evt.currentTarget).data("index");this.initGallery(items,index)}.bind(this))},getImageData:function(){var haveImages=!1,items=[],options={};return this.$images.each(function(){var haveImages2=!0,smallSrc=$(this).prop("currentSrc")||$(this).prop("src"),item={msrc:smallSrc,src:$(this).data("photoswipe-src"),w:$(this).data("photoswipe-width"),h:$(this).data("photoswipe-height"),el:$(this)[0],initialZoomLevel:.5};items.push(item)}),items},initGallery:function(items,index){var pswpElement=document.querySelectorAll(".pswp")[0],options={allowPanToNext:!1,captionEl:!1,closeOnScroll:!1,counterEl:!1,history:!1,index:index-1,pinchToClose:!1,preloaderEl:!1,scaleMode:"zoom",shareEl:!1,tapToToggleControls:!1,getThumbBoundsFn:function(index2){var pageYScroll=window.pageYOffset||document.documentElement.scrollTop,thumbnail=items[index2].el,rect=thumbnail.getBoundingClientRect();return{x:rect.left,y:rect.top+pageYScroll,w:rect.width}}};this.gallery=new PhotoSwipe(pswpElement,PhotoSwipeUI_Default,items,options),this.gallery.init(),this.gallery.listen("afterChange",this.afterChange.bind(this))},afterChange:function(){if(this.inSlideshow){var $slideshow=$("#ProductPhotos-"+this.sectionId);if($slideshow.hasClass("slick-initialized")){var newIndex=this.gallery.getCurrentIndex();$slideshow.slick("slickGoTo",newIndex)}}}}),Photoswipe}(),theme.bp={},theme.bp.smallUp=590,theme.bp.small=theme.bp.smallUp-1,theme.config={bpSmall:!1,hasSessionStorage:!0,mediaQuerySmall:"screen and (max-width: "+theme.bp.small+"px)",mediaQuerySmallUp:"screen and (min-width: "+theme.bp.smallUp+"px)",youTubeReady:!1,vimeoReady:!1,vimeoLoading:!1,isTouch:!!("ontouchstart"in window||window.DocumentTouch&&window.document instanceof DocumentTouch||window.navigator.maxTouchPoints||window.navigator.msMaxTouchPoints),isIpad:/ipad/.test(window.navigator.userAgent.toLowerCase())||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1},theme.config.isIpad&&(document.documentElement.className+=" js-ipad"),window.onYouTubeIframeAPIReady=function(){theme.config.youTubeReady=!0,$("body").trigger("youTubeReady")},window.loadVimeo=function(){if(!theme.config.vimeoLoading&&!theme.config.vimeoReady){theme.config.vimeoLoading=!0;var tag=document.createElement("script");tag.src="https://player.vimeo.com/api/player.js";var firstScriptTag=document.getElementsByTagName("script")[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag),checkIfVimeoIsReady().then(function(){theme.config.vimeoReady=!0,theme.config.vimeoLoading=!1,$("body").trigger("vimeoReady")}).fail(function(){})}};function checkIfVimeoIsReady(){var deferred=$.Deferred(),wait,timeout;return wait=setInterval(function(){Vimeo&&(clearInterval(wait),clearTimeout(timeout),deferred.resolve())},500),timeout=setTimeout(function(){clearInterval(wait),deferred.reject()},4e3),deferred}theme.init=function(){theme.setGlobals(),theme.pageTransitions(),theme.initQuickShop(),theme.settings.predictiveSearch&&theme.predictiveSearch.init(),theme.videoModal(),theme.articleImages.init(),theme.customerTemplates.init(),theme.collapsibles.init(),theme.rte.init(),AOS.init({easing:"ease-out-quad",once:!0,offset:60,disableMutationObserver:!0}),$(document.documentElement).on("keyup.tab",function(evt){evt.keyCode===9&&($(document.documentElement).addClass("tab-outline"),$(document.documentElement).off("keyup.tab"))})},theme.setGlobals=function(){theme.config.hasSessionStorage=theme.isSessionStorageSupported(),theme.config.isTouch&&$("body").addClass("supports-touch"),enquire.register(theme.config.mediaQuerySmall,{match:function(){theme.config.bpSmall=!0,$("body").trigger("matchSmall")},unmatch:function(){theme.config.bpSmall=!1,$("body").trigger("unmatchSmall")}})},theme.loadImageSection=function($container){function setAsLoaded(){$container.removeClass("loading loading--delayed").addClass("loaded")}function checkForLazyloadedImage(){return $container.find(".lazyloaded").length}if($container.find("svg").length){setAsLoaded();return}if(checkForLazyloadedImage()>0){setAsLoaded();return}var interval=setInterval(function(){checkForLazyloadedImage()>0&&(clearInterval(interval),setAsLoaded())},80)},theme.isSessionStorageSupported=function(){if(window.self!==window.top)return!1;var testKey="test",storage=window.sessionStorage;try{return storage.setItem(testKey,"1"),storage.removeItem(testKey),!0}catch(error){return!1}},theme.isElementVisible=function($el,threshold){var rect=$el[0].getBoundingClientRect(),windowHeight=window.innerHeight||document.documentElement.clientHeight;return threshold=threshold||0,rect.bottom>=0&&rect.right>=0&&rect.top<=windowHeight+threshold&&rect.left<=(window.innerWidth||document.documentElement.clientWidth)},theme.pageTransitions=function(){$("body").data("transitions")==!0&&(navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)&&$("a").on("click",function(){window.setTimeout(function(){$("body").removeClass("unloading")},1200)}),$('a[href^="mailto:"], a[href^="#"], a[target="_blank"], a[href*="youtube.com/watch"], a[href*="youtu.be/"], .shg-btn').each(function(){$(this).addClass("js-no-transition")}),$("a:not(.js-no-transition)").bind("click",function(evt){if(evt.metaKey)return!0;evt.preventDefault(),$("body").addClass("unloading");var src=$(this).attr("href");window.setTimeout(function(){location.href=src},50)}),$("a.mobile-nav__link").bind("click",function(){theme.NavDrawer.close()}))},theme.reinitProductGridItem=function($scope){AOS&&AOS.refreshHard(),theme.initQuickShop(!0),window.SPR&&(SPR.initDomEls(),SPR.loadBadges()),sections.register("product-template",theme.Product,$scope),theme.collapsibles.init()},window.onpageshow=function(evt){evt.persisted&&$("body").removeClass("unloading")},$(document).ready(function(){theme.init(),window.sections=new theme.Sections,sections.register("header-section",theme.HeaderSection),sections.register("slideshow-section",theme.SlideshowSection),sections.register("video-section",theme.VideoSection),sections.register("product",theme.Product),sections.register("product-recommendations",theme.Recommendations),sections.register("product-template",theme.Product),sections.register("collection-template",theme.Collection),sections.register("featured-content-section",theme.FeaturedContentSection),sections.register("collection-switcher",theme.CollectionSwitcher),sections.register("testimonials",theme.Testimonials),sections.register("newsletter-popup",theme.NewsletterPopup),sections.register("fading-images",theme.FadingImages),sections.register("background-image",theme.BackgroundImage),sections.register("map",theme.Maps),sections.register("blog",theme.Blog),sections.register("photoswipe",theme.Photoswipe),sections.register("footer-section",theme.FooterSection)}),$(function(){$("#gift-packing").change(function(){$("#gift-note-box").toggle(this.checked)}).change()})}(theme.jQuery); //# sourceMappingURL=/cdn/shop/t/45/assets/theme.js.map?v=163487073469112201941718131811