Files
backend-mm/public/web/shella/scripts/theme.min.js
2025-09-25 03:03:31 +05:00

1 line
65 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use strict";window.theme=window.theme||{},theme.Global=function(){function t(){this.settings={set_offset_with_fixed_body:[".header__content--sticky",".footbar",".footer--fixed","#admin_bar_iframe","#preview-bar-iframe"]},this.dom={},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var t,e=window.navigator.userAgent.toLowerCase(),a=$(".scroll-offset-example");function n(){theme.current.width=window.innerWidth,theme.current.height=window.innerHeight}function o(){theme.current.is_mobile=theme.current.width<theme.breakpoints.main,theme.current.is_desktop=!theme.current.is_mobile,$.each(theme.breakpoints.values,function(t,e){if(e>theme.current.width)return!1;theme.current.bp=t}),t&&t!=theme.current.bp&&$(window).trigger("theme.changed.breakpoint"),t=theme.current.bp}function i(){var t=$("style.scroll-offset-style");if(theme.current.scroll_w=a[0].offsetWidth-a[0].clientWidth,0<theme.current.scroll_w){if(!t.length){var e="body.overflow-hidden.offset-scroll{padding-right:"+theme.current.scroll_w+"px;}.fixed-elem.offset-scroll{padding-right:"+theme.current.scroll_w+"px;}";$("head").append($("<style>").addClass("scroll-offset-style").html(e))}}else t.remove()}window.ie=/trident/gi.test(e)||/msie/gi.test(e),window.edge=document.documentMode||/edge/.test(e),window.ios=navigator.userAgent.match(/like Mac OS X/i),window.moz="undefined"!=typeof InstallTrigger,window.$window=$(window),window.$document=$(document),window.$html=$("html"),window.$body=$html.find("body"),ios?$html.addClass("is-ios"):edge?$html.addClass("is-edge"):ie?$html.addClass("is-ie"):moz&&$html.addClass("is-moz"),this.dom.$icons=$("#theme-icons"),theme.rtl="rtl"===$html.attr("dir"),theme.breakpoints={values:{xs:0,sm:541,md:778,lg:1025,xl:1260}},theme.breakpoints.main=theme.breakpoints.values.lg,theme.current={},$(window).on("resize",$.debounce(250,function(){n(),o(),$(window).trigger("theme.resize")})),$(window).on("theme.changed.breakpoint",function(){i()}),n(),o(),i(),$(window).on("load",function(){theme.is_loaded=!0})},bodyHasScroll:function(t){var e=document,a=e.documentElement,n=e.body,o="client"+t,i="scroll"+t;return/CSS/.test(e.compatMode)?a[o]<a[i]:n[o]<n[i]},fixBody:function(){this.bodyHasScroll("Height")&&($body.addClass("offset-scroll"),$.each(this.settings.set_offset_with_fixed_body,function(){$(this).addClass("offset-scroll fixed-elem")})),this._fixed_scroll_top=pageYOffset,$body.css({top:-1*pageYOffset}),$body.addClass("overflow-hidden position-fixed left-0 w-100"),theme.StickySidebar&&theme.StickySidebar.update($(".js-sticky-sidebar"))},unfixBody:function(){$body.removeClass("offset-scroll overflow-hidden position-fixed left-0 w-100"),$body.add($html).scrollTop(this._fixed_scroll_top),this._fixed_scroll_top=null,$body.css({top:""}),$.each(this.settings.set_offset_with_fixed_body,function(){$(this).removeClass("fixed-elem offset-scroll")}),theme.StickySidebar&&theme.StickySidebar.update($(".js-sticky-sidebar"))},responsiveHandler:function(a){var t,n=a.namespace?a.namespace:".widthHandler";function e(){$.each(a.events,function(t){$(a.element).unbind(t+n)})}function o(){theme.current.is_mobile!==t&&(t=theme.current.is_mobile,a.on_desktop&&theme.current.is_desktop||a.on_mobile&&theme.current.is_mobile?$.each(a.events,function(t,e){a.delegate?$(a.element).on(t+n,a.delegate,e):$(a.element).on(t+n,e)}):e())}return $(window).on("theme.resize"+n,function(){o()}),o(),{unbind:function(){$(window).unbind("theme.resize"+n),e()}}},getIcon:function(t,e){var a=this.dom.$icons.find(".icon-theme-"+t);return e?a.parent().html():a.clone()},handleize:function(t){return t.toLowerCase().replace(/[-!"#$₹%&'* ,./:;<=>?@[\\\]_`{|}~]+/g,"-").replace(/[()]+/g,"").replace(/^-+|-+$/g,"")}}),theme.Global=new t},theme.ImagesLazyLoad=function(){function t(){this.load()}t.prototype=$.extend({},t.prototype,{load:function(){this.init(),this.page_is_loaded=!0},init:function(){var n=this;function t(){$(".lazyload.loaded").each(function(){var t=$(this),e=t.attr("data-master");e&&(t.attr("data-bg")?t.css({"background-image":n.buildSrcset(t,e,"bg")}):t.attr("srcset",n.buildSrcset(t,e,"srcset")))})}this.api=new LazyLoad({elements_selector:".lazyload",threshold:100,callback_enter:function(t){var e,a=$(t);a.attr("data-bg")?(e=a.attr("data-master")||a.attr("data-bg"),a.css({"background-image":n.buildSrcset(a,e,"bg")})):(e=a.attr("data-master")||a.attr("data-srcset"),a.attr("data-srcset",n.buildSrcset(a,e,"srcset")))},callback_load:function(t){$(t).trigger("lazyloaded")}}),$window.on("load",function(){$window.on("theme.resize.lazyload checkImages",t)})},update:function(){this.page_is_loaded&&this.api.update()},buildSrcset:function(t,e,a){var n,o,i,s,r,d=+t.attr("data-scale")||1;return"bg"===a?(i=t.width(),i*=d,0<(i=Math.ceil(i))?e.replace("[width]",i):t.attr("data-bg")):(i=(n=t.parent()).width(),s=n.innerHeight(),o=t.attr("data-aspect-ratio"),r=+t.attr("data-scale-perspective")||1,i*=d,s*=d,theme.current.is_desktop&&(i*=r,s*=r),0<(i=Math.ceil(Math.max(i,s*o)))&&-1!==e.indexOf("{width}")?e.replace("{width}",i)+" 1x, "+e.replace("{width}",2*i)+" 2x":t.attr("data-srcset"))}}),theme.ImagesLazyLoad=new t},theme.Position=function(){function t(){this.settings={name:"data-js-position-name",desktop:"data-js-position-desktop",mobile:"data-js-position-mobile",all:"data-js-position-all"},this.selectors={elements:".js-position"},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var t,e=this;function a(){t!==theme.current.is_desktop&&(e.update(),t=theme.current.is_desktop)}$(window).on("theme.resize.position",function(){a()}),a();var n=$(this.selectors.elements).filter("[data-js-position-onload]");this.append(n,this.settings.all)},update:function(t){var e=t?$("["+this.settings.name+'="'+t+'"]'):$(this.selectors.elements).not("[data-js-position-onload]"),a=theme.current.is_desktop?this.settings.desktop:this.settings.mobile;this.append(e,a)},append:function(t,n){var o=this;t.each(function(){var t=$(this),e=t.attr(o.settings.name),a=$("["+n+'="'+e+'"]');a.length&&!$.contains(a[0],t[0])&&(a.find("["+o.settings.name+'="'+e+'"]').length?t.remove():t.appendTo(a))})}}),theme.Position=new t},theme.Dropdown=function(){var i=".dropdown";function t(){this.selectors={element:".js-dropdown",button:"[data-js-dropdown-button]",dropdown:"[data-js-dropdown]"},this.load()}t.prototype=$.extend({},t.prototype,{duration:function(){return 1e3*theme.animations.dropdown.duration},load:function(){var o=this;theme.Global.responsiveHandler({namespace:i,element:$body,delegate:this.selectors.button+", "+this.selectors.dropdown,on_desktop:!0,events:{"show hide close":function(t){var e=$(this).parents(o.selectors.element),a=e.find(o.selectors.button),n=e.find(o.selectors.dropdown);o["_"+t.type](e,n,a)}}}),theme.Global.responsiveHandler({namespace:i,element:$body,delegate:this.selectors.button,on_desktop:!0,events:{mouseenter:function(){var t=$(this),e=t.parents(o.selectors.element),a=e.find(o.selectors.dropdown);t.hasClass("active")||a.hasClass("show")||o._show(e,a,t)},mousedown:function(t){var e=$(this),a=e.parents(o.selectors.element),n=a.find(o.selectors.dropdown);return e.hasClass("active")?o._hide(a,n,e):(o._show(a,n,e,!0),$body.one("mousedown"+i,function(t){$(t.target).parents(o.selectors.dropdown+", "+o.selectors.button).length||$(o.selectors.dropdown).trigger("hide")})),t.preventDefault(),!1}}}),theme.Global.responsiveHandler({namespace:i,element:$body,delegate:this.selectors.element,on_desktop:!0,events:{mouseleave:function(){var t=$(this),e=t.find(o.selectors.button),a=t.find(o.selectors.dropdown);e.hasClass("active")||o._hide(t,a,e)}}})},_show:function(t,e,a,n){$(this.selectors.dropdown).not(e).trigger("close"),n&&a.addClass("active"),e.hasClass("show")||($(this.selectors.element).removeClass("hovered"),t.addClass("hovered"),e.addClass("show animate"),window.edge?e.addClass("visible"):(e.velocity("stop",!0).removeAttr("style"),e.velocity("slideDown",{duration:this.duration(),begin:function(){setTimeout(function(){e.addClass("visible")},0)},complete:function(){e.removeAttr("style")}})))},_hide:function(t,e,a){window.edge?(e.removeClass("show animate visible"),t.removeClass("hovered")):(e.velocity("stop",!0),e.velocity("slideUp",{duration:this.duration(),begin:function(){e.removeClass("visible")},complete:function(){e.removeClass("show animate").removeAttr("style"),t.removeClass("hovered")}})),a.removeClass("active"),$body.unbind("click"+i)},_close:function(t,e){t.velocity("stop"),t.removeClass("show animate visible").removeAttr("style"),e.removeClass("active"),$body.unbind("click"+i)}}),theme.Dropdown=new t},theme.Select=function(){var t=".select";function e(){this.selectors={element:".js-select",dropdown:"[data-js-select-dropdown]"},this.load()}e.prototype=$.extend({},e.prototype,{load:function(){var o=this;theme.Global.responsiveHandler({namespace:t,element:$body,delegate:this.selectors.element+" "+this.selectors.dropdown+" span",on_desktop:!0,events:{click:function(){var t=$(this);if(!t.hasClass("selected")&&!t[0].hasAttribute("disabled")){var e=t.attr("data-value"),a=t.parents(o.selectors.dropdown),n=t.parents(".js-select").find("select");n.val(e),a.find("span").removeClass("selected"),t.addClass("selected"),a.trigger("hide"),n.change()}}}}),$body.on("change update"+t,this.selectors.element+" select",function(){var t=$(this),e=t.parents(o.selectors.element).find(o.selectors.dropdown+" span"),a=t.val();e.each(function(){var t=$(this);t[t.attr("data-value")==a?"addClass":"removeClass"]("selected")})}),$(this.selectors.element+"[data-onload-check] select").trigger("update"+t)}}),theme.Select=new e},theme.Loader=function(){function t(){this.$loader=$("#theme-loader .js-loader"),this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var t=$body.find(".js-loader[data-js-page-loader]");t.hasClass("visible")?(t.on("transitionend",function(){t.remove()}).addClass("animate").removeClass("visible"),"0s"===t.css("transition-duration")&&t.trigger("transitionend")):t.remove()},set:function(t,e){if(t.length&&!t.find("> .js-loader").length){var a,n=this.$loader.clone(),o=n.find("[data-js-loader-spinner]");e&&(!1===e.bg&&n.find("[data-js-loader-bg]").remove(),!1===e.spinner&&o.remove(),!0===e.fixed&&(o.addClass("fixed"),a=100*(t.innerWidth()/2+t[0].getBoundingClientRect().left)/theme.current.width,o.css({left:a+"%"})),e.delay&&n.addClass("delay")),t.addClass("loading-element"),t.append(n),n.addClass("animate"),setTimeout(function(){o.addClass("animate"),n.addClass("visible")},0)}},unset:function(t){t.find("> .loader").remove(),t.removeClass("loading-element")}}),theme.Loader=new t},theme.Popups=function(){function t(){this.selectors={popup:".js-popup",button:".js-popup-button",button_close:"[data-js-popup-close]",bg:"[data-js-popup-bg]"},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){if($(this.selectors.popup).length){var n=this;$body.on("click",this.selectors.button,function(t){var e=$(this),a=e.attr("data-js-popup-button");if(n.callByName(a,e))return t.preventDefault(),!1}),$body.on("click",this.selectors.button_close,function(t){var e=$(this),a=e.parents("[data-js-popup-name]").attr("data-js-popup-name");return n.closeByName(a,e),t.preventDefault(),!1}),$body.on("click",this.selectors.popup+" [data-js-popup-name]",function(t){var e=$(t.target);if(e[0].hasAttribute("data-js-popup-name")){var a=e.attr("data-js-popup-name");n.closeByName(a,e)}}),setTimeout(function(){$body.find(n.selectors.popup+' [data-js-auto-call="true"]').each(function(){n.callByName($(this).attr("data-js-popup-name"))})},0)}},getByName:function(t){return $(this.selectors.popup).find('[data-js-popup-name="'+t+'"]')},callByName:function(t,e){var a=this,n=$(this.selectors.popup),o=$(this.selectors.bg),i=n.find('[data-js-popup-name="'+t+'"]'),s=void 0!==i.attr("data-js-popup-ajax");function r(){n.scrollTop(0),o.one("transitionend",function(){i.add(o).removeClass("animate"),i.trigger("call.after",[i,e||null])}),i.add(o).addClass("animate"),setTimeout(function(){i.add(o).addClass("visible"),"0s"===o.css("transition-duration")&&o.trigger("transitionend")},0),i[0].hasAttribute("data-js-popup-mobile-only")&&$window.on("theme.changed.breakpoint.popups",function(){theme.current.is_mobile||a.closeByName(t)})}return!!i.length&&((!theme.current.is_desktop||!i[0].hasAttribute("data-js-popup-mobile-only"))&&(o.unbind("transitionend"),i.trigger("call.before",[i,e||null]),n.addClass("active"),n.find("[data-js-popup-name]").removeClass("show visible"),n.add(i).addClass("show"),theme.Global.fixBody(),s?(i.addClass("is-process-loading"),theme.Loader.set(n,{fixed:!0,delay:!0}),i.on("contentloaded",function(){i.removeClass("is-process-loading"),r(),theme.Loader.unset(n)})):r(),$body.on("keyup.popups",function(t){27===t.keyCode&&a.closeAll()}),i.trigger("call.visible",[i,e||null]),!0))},closeByName:function(t,e){var a=$(this.selectors.popup),n=$(this.selectors.bg),o=a.find('[data-js-popup-name="'+t+'"]');n.css("transition-duration");return!!o.length&&(o.unbind("contentloaded").removeClass("is-process-loading"),n.unbind("transitionend"),$body.unbind("keyup.popups"),$window.unbind("theme.changed.breakpoint.popups"),o.trigger("close.before",[o,e||null]),theme.Loader.unset(a),n.one("transitionend",function(){a.add(o).removeClass("show"),o.add(n).removeClass("animate"),theme.Global.unfixBody(),a.removeClass("active"),o.trigger("close.after",[o,e||null])}),o.add(n).addClass("animate"),n.hasClass("visible")&&"0s"!==n.css("transition-duration")||n.trigger("transitionend"),o.add(n).removeClass("visible"),!0)},closeAll:function(){var t=this,e=$(this.selectors.popup+".active").find("[data-js-popup-name]").filter(".show, .is-process-loading");return!!e.length&&(e.each(function(){t.closeByName(e.attr("data-js-popup-name"))}),!0)},cartItemAdded:function(t){alert(theme.strings.general.popups.cart.item_added.replace("{{ title }}",t))},cartLimitIsExceeded:function(t){alert(theme.strings.general.popups.cart.limit_is_exceeded.replace("{{ limit }}",t))},addHandler:function(t,e,n){$body.on(e,'[data-js-popup-name="'+t+'"]',function(t,e,a){n(e,a)})},removeHandler:function(t,e){$body.unbind(e)}}),theme.Popups=new t},theme.PopupAccount=function(){function t(){this.settings={popup_name:"account"},this.selectors={account:".js-popup-account",show_sign_up:".js-popup-account-show-sign-up"},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var a=this;$body.on("click",this.selectors.show_sign_up,function(t){var e=$(a.selectors.account);return e.find(".popup-account__login").addClass("d-none-important"),e.find(".popup-account__sign-up").removeClass("d-none-important"),t.preventDefault(),!1}),theme.Popups.addHandler(a.settings.popup_name,"close.after",function(){var t=$(a.selectors.account);t.find(".popup-account__login").removeClass("d-none-important"),t.find(".popup-account__sign-up").addClass("d-none-important")})}}),theme.PopupAccount=new t},theme.PopupSearch=function(){function t(){this.settings={popup_name:"navigation"},this.selectors={search:".js-popup-search-ajax"},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var n=this,o="";function i(t,e,a,n){var o=t.find(".search__result"),i=t.find(".search__view-all"),s=i.find("a"),r=t.find(".search__empty"),d=$("[data-js-menu-mobile]"),c=$("[data-js-popup-navigation-button]"),l=""===a?"close":"search";s.attr("href","/search?q="+a),i[0<n.count?"removeClass":"addClass"]("d-none-important"),r[""===a||0<n.count?"addClass":"removeClass"]("d-none-important"),d[""===a?"removeClass":"addClass"]("d-none-important"),c.attr("data-js-popup-navigation-button",l),theme.Menu.closeMobileMenu(),o.addClass("invisible"),function(t,e,a){if(0<a.count){var i=$($("#template-search-ajax")[0].content),s=$(document.createDocumentFragment()),r=+t.attr("data-js-max-products")-1;$.each(a.results,function(t){var e=i.clone(),a=e.find(".product-search__image img"),n=e.find(".product-search__title a"),o=e.find(".product-search__price .price");return e.find("a").attr("href",this.url),n.html(this.title),a.attr("srcset",this.thumbnail+" 1x, "+this.thumbnail2x+" 2x"),this.price?theme.ProductCurrency.setPrice(o,this.price,this.compare_at_price):o.remove(),s.append(e),t<r}),e.html(""),e.append(s),theme.ImagesLazyLoad.update(),theme.ProductCurrency.update()}else e.html("");e[0<a.count?"removeClass":"addClass"]("d-none-important")}(t,o,n),o.removeClass("invisible"),theme.Loader.unset(t)}function t(){var t=$(n.selectors.search);t.find(".search__content");o="",t.find("input").val(""),i(t,0,o,{count:0})}$body.on("keyup",this.selectors.search+" input",$.debounce(500,function(t){var e=$(this).parents(n.selectors.search);if(27!==t.keyCode){var a=$(this).val();e.find(".search__content");a!==o&&(""===(o=a)?i(e,0,o,{count:0}):(theme.Loader.set(e),i(e,0,o,{count:6,results:[{url:"/products/copy-of-long-strappy-dress?variant=8078909538356",title:"Ripped skinny jeans",price:33e3,compare_at_price:null,thumbnail:"https://cdn.shopify.com/s/files/1/0026/2910/7764/products/0004916250_1_1_1_200x.jpg?v=1530810593",thumbnail2x:"https://cdn.shopify.com/s/files/1/0026/2910/7764/products/0004916250_1_1_1_200x@2x.jpg?v=1530810593"},{url:"/products/copy-of-relaxed-fit-cotton-shirt?variant=8077662945332",title:"Super skinny jeans",price:33500,compare_at_price:null,thumbnail:"https://cdn.shopify.com/s/files/1/0026/2910/7764/products/5333043427_1_1_1_200x.jpg?v=1542368814",thumbnail2x:"https://cdn.shopify.com/s/files/1/0026/2910/7764/products/5333043427_1_1_1_200x@2x.jpg?v=1542368814"},{url:"/products/copy-of-ecologically-grown-cotton-t-shirt-with-slogan?variant=8078905442356",title:"Low waist ripped jeans",price:25e3,compare_at_price:null,thumbnail:"https://cdn.shopify.com/s/files/1/0026/2910/7764/products/0188388250_1_1_1_200x.jpg?v=1525100936",thumbnail2x:"https://cdn.shopify.com/s/files/1/0026/2910/7764/products/0188388250_1_1_1_200x@2x.jpg?v=1525100936"},{url:"/products/copy-of-tailored-fit-polo-shirt?variant=8077663174708",title:"Super skinny ripped jeans",price:31e3,compare_at_price:null,thumbnail:"https://cdn.shopify.com/s/files/1/0026/2910/7764/products/0278211506_1_1_1_200x.jpg?v=1525093887",thumbnail2x:"https://cdn.shopify.com/s/files/1/0026/2910/7764/products/0278211506_1_1_1_200x@2x.jpg?v=1525093887"},{url:"/blogs/masonry/what-i-wore-this-week-white-jeans",title:"What I wore this week: white jeans",thumbnail:"https://cdn.shopify.com/s/files/1/0026/2910/7764/articles/06_200x.jpg?v=1542459754",thumbnail2x:"https://cdn.shopify.com/s/files/1/0026/2910/7764/articles/06_200x@2x.jpg?v=1542459754"}]})))}})),$body.on("keyup",this.selectors.search+" input",function(t){if(27===t.keyCode){var e=$(this).parents(n.selectors.search);e.find(".search__content");o="",theme.Popups.closeByName("navigation"),i(e,0,o,{count:0})}}),theme.Popups.addHandler(this.settings.popup_name,"close.before",function(){t()}),theme.Popups.addHandler(this.settings.popup_name,"call.after",function(t){theme.current.is_desktop&&t.find("input").focus()}),theme.Global.responsiveHandler({namespace:".searchMobileBack",element:$body,delegate:'[data-js-popup-navigation-button="search"]',on_mobile:!0,events:{click:function(){t()}}})}}),theme.PopupSearch=new t},theme.PopupCart=function(){function t(){this.settings={popup_name:"cart"},this.selectors={cart:".js-popup-cart-ajax"},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var a=this;theme.Popups.addHandler(this.settings.popup_name,"call.visible",function(t,e){a.update(function(){t.trigger("contentloaded")})})},update:function(t){t&&t()}}),theme.PopupCart=new t},theme.PopupQuickView=function(){function t(){this.settings={popup_name:"quick-view"},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var o=this;theme.Popups.addHandler(this.settings.popup_name,"call.visible",function(e,t){var a=e.find("[data-js-quick-view]"),n=t.parents("[data-js-product]");a.html(""),o.$gallery=null,o.getProduct(n,function(t){o.insertContent(a,t),e.trigger("contentloaded")})}),theme.Popups.addHandler(this.settings.popup_name,"call.after",function(t){o.$gallery&&o.$gallery.length&&o.$gallery.productGallery("update"),theme.Tooltip&&theme.Tooltip.init({appendTo:t[0]})}),theme.Popups.addHandler(this.settings.popup_name,"close.after",function(){o.ajax&&o.ajax.abort(),o.$gallery&&o.$gallery.length&&(theme.ProductGallery.destroy(o.$gallery),o.$gallery=null)})},getProduct:function(t,e){this.ajax&&this.ajax.abort();var a=t.attr("data-product-handle"),n=t.attr("data-product-variant-id");a&&(this.ajax=$.ajax({type:"GET",url:"https://shella-demo.myshopify.com/products/"+a+"?variant="+n,data:{view:"quick-view"},dataType:"html",success:function(t){e(t)}}))},insertContent:function(t,e){e=e.replace(/\/\/cdn./g,"https://cdn."),t.html(e);var a=t.find("[data-js-product]"),n=a.find("[data-js-product-gallery]"),o=a.find("[data-js-product-countdown] .js-countdown"),i=a.find(".js-text-countdown"),s=a.find(".js-visitors");n.length&&(this.$gallery=n,theme.ProductGallery.init(n)),theme.ImagesLazyLoad.update(),theme.ProductReview.update(),o.length&&theme.ProductCountdown.init(o),i.length&&theme.ProductTextCountdown.init(i),s.length&&theme.ProductVisitors.init(s),theme.StoreLists.checkProductStatus(a)}}),theme.PopupQuickView=new t},theme.ProductCurrency=function(){function t(){}t.prototype=$.extend({},t.prototype,{load:function(){if(theme.multipleСurrencies){var t;try{t=Currency.cookie.read()}catch(t){}$("span.money span.money").each(function(){$(this).parents("span.money").removeClass("money")}),$("span.money").each(function(){$(this).attr("data-currency-"+Currency.shopCurrency,$(this).html())}),null==t?Currency.shopCurrency!==Currency.defaultCurrency?Currency.convertAll(Currency.shopCurrency,Currency.defaultCurrency):Currency.currentCurrency=Currency.defaultCurrency:t===Currency.shopCurrency?Currency.currentCurrency=Currency.shopCurrency:Currency.convertAll(Currency.shopCurrency,t)}},setCurrency:function(t){theme.multipleСurrencies&&(t==Currency.currentCurrency?Currency.convertAll(Currency.shopCurrency,t):Currency.convertAll(Currency.currentCurrency,t))},setPrice:function(t,e,a){e=+e;var n="",o=(a=+a)&&e<a;t[o?"addClass":"removeClass"]("price--sale"),o&&(n+="<span>",n+=Shopify.formatMoney(a,theme.moneyFormat),n+="</span>",t[0].hasAttribute("data-js-show-sale-separator")&&(n+=theme.strings.priceSaleSeparator)),n+="<span>",n+=Shopify.formatMoney(e,theme.moneyFormat),n+="</span>",t.html(n)},update:function(){theme.multipleСurrencies&&Currency.convertAll(Currency.shopCurrency,Currency.currentCurrency)}}),theme.ProductCurrency=new t},theme.ProductQuantity=function(){function t(){this.selectors={quantity:".js-product-quantity"},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var c=this;$body.on("click",this.selectors.quantity+" [data-control]",function(t){var e,a=$(this),n=a.parents(c.selectors.quantity),o=n.find("input"),i=a.attr("data-control"),s=o.attr("min")||1,r=o.attr("max")||1/0,d=+o.val();$.isNumeric(d)?("+"===i?e=++d:"-"===i&&(e=--d),e<s?e=s:r<e&&(e=r),e<0&&(e=0),o.val(e),o.trigger("custom.change"),c.dublicate(n)):o.val(s)}),$(document).on("keydown",this.selectors.quantity+" input",function(t){if(-1===$.inArray(t.keyCode,[8,9,27,37,38,39,40,46,48,49,50,51,52,53,54,55,56,57,96,97,98,99,100,101,102,103,104,105]))return t.preventDefault(),!1}),$(document).on("focus",this.selectors.quantity+" input",function(){$(this).select()}),$(document).on("blur",this.selectors.quantity+" input",function(){var t=$(this),e=t.parents(c.selectors.quantity),a=+t.val(),n=t.attr("min")||1,o=t.attr("max")||1/0;!$.isNumeric(a)||a<n?t.val(n):o<a&&t.val(o),c.dublicate(e)})},dublicate:function(t){var e=t.attr("data-js-quantity-connect");if(t.length&&void 0!==e){var a=$(this.selectors.quantity+'[data-js-quantity-connect="'+e+'"]').find("input"),n=t.find("input").val();a.val(n),a.trigger("custom.change")}}}),theme.ProductQuantity=new t},theme.ProductCountdown=function(){function t(){this.selectors={},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){this.init($(".js-countdown").not(".countdown--init"))},init:function(t){t.not(".countdown--init").each(function(){var d=$(this),t=d.data("date");if(t){var c=d.data("hidezero")||!0,e=t.indexOf(" +");-1!=e&&(t=t.slice(0,e));var a=new Date(t.replace(/-/g,"/"));if(!(a.getTime()-(new Date).getTime()<=0)){d.countdown(a,function(t){for(var e="",a=[["totalDays",theme.strings.countdown.days],["hours",theme.strings.countdown.hours],["minutes",theme.strings.countdown.minutes],["seconds",theme.strings.countdown.seconds]],n=0;n<a.length;n++){var o=a[n][0],i=t.offset[o],s=a[n][1];if(0!==n||0!==i||!0!==c)if(d.hasClass("countdown--type-01"))e+='<span class="countdown__section"><span class="countdown__time">'+i+'</span><span class="countdown__postfix">'+s+"</span></span>";else if(d.hasClass("countdown--type-02")){i<10?i="0"+i:i+="",e+='<span class="countdown__section"><span class="countdown__time">';for(var r=0;r<i.length;r++)e+="<span>"+i.charAt(r)+"</span>";e+='</span><span class="countdown__postfix">'+s+"</span></span>"}}$(this).html(e)});d.parents("[data-js-product-countdown]").removeClass("d-none-important"),d.addClass("countdown--init")}}})},destroy:function(t){t.hasClass("countdown--init")&&t.countdown("remove").off().removeClass("countdown--init").html("")},reinit:function(t,e){this.destroy(t);var a=t.clone();t.replaceWith(a),t.remove(),e&&a.attr("data-date",e),this.init(a)}}),theme.ProductCountdown=new t},theme.ProductTextCountdown=function(){function t(){this.selectors={},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){this.init($(".js-text-countdown").not(".text-countdown--init"))},init:function(t){t.not(".text-countdown--init").each(function(){var a,n,o,i,s,r,d,t=$(this),e=t.find("[data-js-text-countdown-counter]"),c=t.find("[data-js-text-countdown-delivery]"),l=+t.attr("data-reset-time"),u=+t.attr("data-delivery-time"),p=t.attr("data-hidezero")||!0,h=new Date,m=[["hours",theme.strings.text_countdown.hours],["minutes",theme.strings.text_countdown.minutes]],f=[theme.strings.text_countdown.days_of_week.sunday,theme.strings.text_countdown.days_of_week.monday,theme.strings.text_countdown.days_of_week.tuesday,theme.strings.text_countdown.days_of_week.wednesday,theme.strings.text_countdown.days_of_week.thursday,theme.strings.text_countdown.days_of_week.friday,theme.strings.text_countdown.days_of_week.saturday];h.setDate(h.getDate()+1),h.setHours(l,0,0,0);e.countdown(h,function(t){o=i="";for(var e=0;e<m.length;e++)s=m[e][0],r=t.offset[s],d=m[e][1],0===e&&0===r&&!0===p||(0!==e&&(i+=" "),i+=r+" "+d);$(this).html(i),(n=new Date).setDate(n.getDate()+u),(a=new Date).getHours()>=h.getHours()&&a.getMinutes()>=h.getMinutes()&&a.getSeconds()>=h.getSeconds()&&n.setDate(n.getDate()+1),o+=f[n.getDay()],o+=" ",o+=("0"+n.getDate()).slice(-2)+"/"+("0"+(n.getMonth()+1)).slice(-2)+"/"+n.getFullYear(),c.html(o)});t.addClass("text-countdown--init")})},destroy:function(t){t.hasClass("text-countdown--init")&&t.countdown("remove").off().removeClass("text-countdown--init").html("")}}),theme.ProductTextCountdown=new t},theme.ProductVisitors=function(){function t(){this.selectors={},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){this.init($(".js-visitors").not(".visitors--init"))},init:function(t){function l(t,e){return Math.round(t-.5+Math.random()*(e-t+1))}t.not(".visitors--init").each(function(){var e,a,n=$(this),o=n.find("[data-js-counter]"),i=n.attr("data-min"),s=n.attr("data-max"),r=n.attr("data-interval-min"),d=n.attr("data-interval-max"),c=+n.attr("data-stroke");n.addClass("visitors--processing"),function t(){setTimeout(function(){n.hasClass("visitors--processing")&&(e=+o.text(),a=l(i,s),Math.abs(e-a)>c&&(a=l(e,a=e<a?e+c:e-c)),o.text(a),t())},1e3*l(r,d))}(),n.addClass("visitors--init")})},destroy:function(t){t.hasClass("visitors--init")&&t.off().removeClass("visitors--processing visitors--init").html("")}}),theme.ProductVisitors=new t},theme.ProductImagesNavigation=function(){function t(){this.selectors={images_nav:".js-product-images-navigation"},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var n=this;$body.on("click","[data-js-product-images-navigation]:not([data-disabled])",function(){var t=$(this),e=t.parents("[data-js-product]"),a=t.attr("data-js-product-images-navigation");theme.ProductImagesHover.disable(e.find("img"));theme.ProductOptions.switchByImage(e,a,null,function(t){n._updateButtons(e,t.is_first,t.is_last)})})},switch:function(t,e){var a=t.find("[data-js-product-image] img");if(a.length){theme.ProductImagesHover.disable(a);var n=e.update_variant.featured_image;if(n&&n.src||e.json.images[0]&&(n=e.json.images[0]),n&&n.src&&n.id!==a.attr("data-image-id")){var o=Shopify.resizeImage(n.src,a.width()+"x")+" 1x, "+Shopify.resizeImage(n.src,2*a.width()+"x")+" 2x";this.changeSrc(a,o,n.id),a.parents(this.selectors.images_nav).length&&this._updateButtons(t,+e.json.images[0].id==+n.id,+e.json.images[e.json.images.length-1].id==+n.id)}}},changeSrc:function(t,e,a){var n=t.parent();a=a||"null",theme.Loader.set(n),t.one("load",function(){theme.Loader.unset(n)}),t.attr("srcset",e).attr("data-image-id",a)},_updateButtons:function(t,e,a){t.find('[data-js-product-images-navigation="prev"]')[e?"attr":"removeAttr"]("data-disabled","disabled"),t.find('[data-js-product-images-navigation="next"]')[a?"attr":"removeAttr"]("data-disabled","disabled")}}),theme.ProductImagesNavigation=new t},theme.ProductImagesHover=function(){function t(){this.selectors={images_hover:".js-product-images-hover",images_hovered_end:".js-product-images-hovered-end"},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){function o(t,e,a,n){var o=theme.ImagesLazyLoad.buildSrcset(e,a);t.attr("data-js-product-image-hover-id",e.attr("data-image-id")),theme.ProductImagesNavigation.changeSrc(e,o,n)}theme.Global.responsiveHandler({namespace:".product-collection.images.hover",element:$body,delegate:this.selectors.images_hover,on_desktop:!0,events:{mouseenter:function(){var a=$(this),n=a.find("img"),t=a.attr("data-js-product-image-hover"),e=a.attr("data-js-product-image-hover-id");t&&(o(a,n,t,e),a.one("mouseleave",function(){var t=n.attr("data-master"),e=a.attr("data-js-product-image-hover-id");o(a,n,t,e)}))}}}),theme.Global.responsiveHandler({namespace:".product-collection.images.hoveredend",element:$body,delegate:this.selectors.images_hovered_end,on_desktop:!0,events:{mouseenter:function(){var t,e=$(this);t=setTimeout(function(){e.addClass("hovered-end")},1e3*theme.animations.css.duration),e.one("mouseleave",function(){clearTimeout(t)})},mouseleave:function(){$(this).removeClass("hovered-end")}}})},disable:function(t){t.parents(this.selectors.images_hover).removeClass("js-product-images-hover").unbind("mouseleave")}}),theme.ProductImagesHover=new t},theme.ProductOptions=function(){function t(){this.selectors={options:".js-product-options",options_attr:"[data-js-product-options]"},this.afterChange=[],this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var e,a,c=this;function n(t){var e=$(this);if(!e.hasClass("active")&&!e.hasClass("disabled")){var a=e.parents(c.selectors.options),n=e.parents("[data-property]").find("[data-js-option-value]"),o=e.parents("[data-js-product]"),i=o.attr("data-json-product"),s={},r=null,d=!0;"click"===t.type&&(n.removeClass("active"),e.addClass("active")),c._loadJSON(o,i,function(n){var t=a.find("[data-js-option-value].active").add(a.find("option:selected"));$.each(t,function(){var t=$(this);s[t.parents("[data-property]").data("property")]=""+t.data("value")}),$.each(n.variants,function(){var e={},a=!0;if($.each(this.options,function(t){e[theme.Global.handleize(n.options[t])]=theme.Global.handleize(this)}),$.each(s,function(t){if(s[t]!==e[t])return a=!1}),a&&s.length===e.length)return r=this,!1}),r||(r=c._getDefaultVariant(n),d=!1),c._switchVariant(o,{update_variant:r,json:n,current_values:s,is_avilable:d})})}}$body.on("click",this.selectors.options+" [data-js-option-value]",n),$body.on("mouseenter",this.selectors.options+"[data-js-options-onhover] [data-js-option-value]",$.debounce(400,n)),$body.on("change","[data-js-option-select]",function(t,e){if(!e){var a=$(this).find("option:selected");n.call(a,t)}}),$body.on("change",'[data-js-product-variants="control"]',function(){var t=$(this),e=t.parents("[data-js-product]"),a=t.find("option:selected").attr("value"),n=e.attr("data-json-product"),o=null,i=!0;c._loadJSON(e,n,function(t){$.each(t.variants,function(){if(+this.id==+a)return o=this,!1}),o||(o=c._getDefaultVariant(t),i=!1),c._switchVariant(e,{update_variant:o,json:t,is_avilable:i,dontUpdateVariantsSelect:!0})})}),theme.Global.responsiveHandler({namespace:".product.load-json",element:$body,delegate:"[data-js-product][data-js-product-json-preload]",on_desktop:!0,events:{mouseenter:function(){var t=$(this);clearTimeout(e),e=setTimeout(function(){t.attr("data-json-product")||(a=c._loadJSON(t,null,function(){a=null},!1))},300)},mouseleave:function(){clearTimeout(e),a&&(a.abort(),a=null)}}})},_loadJSON:function(e,a,n,o){if(e[0].hasAttribute("data-js-process-ajax-loading-json"))e.one("json-loaded",function(){n&&n(JSON.parse(e.attr("data-json-product")))});else{if(o=void 0===o||o,!a){e.attr("data-js-process-ajax-loading-json",!0),o&&theme.Loader.set(e);var t=e.attr("data-product-handle");return $.ajax({type:"GET",url:"https://shella-demo.myshopify.com/products/"+t,data:{view:"get_json"},cache:!1,dataType:"html",success:function(t){t=t.replace(/\/\/cdn./g,"https://cdn."),a=JSON.parse(t),e.attr("data-json-product",JSON.stringify(a)),o&&theme.Loader.unset(e),n&&n(a),e.trigger("json-loaded")},complete:function(){e.removeAttr("data-js-process-ajax-loading-json")}})}n&&n("object"==typeof a?a:JSON.parse(a))}},switchByImage:function(i,s,r,d){var c=this,l=i.find("[data-js-product-image] img"),t=i.attr("data-json-product"),u=!1;this._loadJSON(i,t,function(t){var e,a,n=t.images,o="by_id"===s?+r:+l.attr("data-image-id");$.each(n,function(t){if(+this.id===o)return e=t,!1}),(e||0===e)&&("prev"===s&&0!==e?e--:"next"===s&&e!==n.length-1&&e++,$.each(t.variants,function(){if(this.featured_image&&+this.featured_image.id==+n[e].id)return a=this,!1}),a||((a=c._getDefaultVariant(t)).featured_image=n[e]),c._updateOptions(i,{update_variant:a,json:t}),c._switchVariant(i,{update_variant:a,json:t,is_avilable:!0}),u={index:e,image:n[e],is_first:0===e,is_last:e===n.length-1}),d(u)})},_switchVariant:function(t,e){e.update_variant.metafields=$.extend({},e.json.metafields),$.each(e.json.variants_metafields,function(){+this.variant_id==+e.update_variant.id&&(e.update_variant.metafields=$.extend(!0,e.update_variant.metafields,this.metafields))}),t.attr("data-product-variant-id",e.update_variant.id),this._updateContent(t,e)},_getDefaultVariant:function(t){var e={};return $.each(t.variants,function(){if(+this.id==+t.default_variant_id)return Object.assign(e,this),!1}),e},_updateContent:function(t,e){var a=t.attr("data-js-product-clone-id"),n=$('[data-js-product-clone="'+a+'"]');this._updateFormVariantInput(t,e),this._updatePrice(t,n,e),this._updateLabelSale(t,e),this._updateLabelInStock(t,e),this._updateLabelOutStock(t,e),this._updateLabelHot(t,e),this._updateLabelNew(t,e),this._updateCountdown(t,e),this._updateAddToCart(t,n,e),this._updateSKU(t,e),this._updateBarcode(t,e),this._updateAvailability(t,e),this._updateStockCountdown(t,e),this._updateGallery(t,e),this._updateLinks(t,e),this._updateHistory(t,e),theme.StoreLists.checkProductStatus(t),theme.ProductImagesNavigation.switch(t,e),e.dontUpdateVariantsSelect||this._updateVariantsSelect(t,e),n.length&&(this._updateOptions(n,e,!0),theme.ProductImagesNavigation.switch(n,e))},_updateOptions:function(t,e,a){var n=t.find(this.selectors.options_attr);n.length&&(n.find("[data-js-option-value]").removeClass("active"),a?$.each(e.current_values,function(t,e){n.find('[data-property="'+t+'"] [data-js-option-value][data-value="'+e+'"]').addClass("active"),n.find('[data-js-option-select][data-property="'+t+'"]').val(e).trigger("change",[!0])}):$.each(e.json.options,function(t){n.find('[data-property="'+theme.Global.handleize(this)+'"] [data-js-option-value][data-value="'+theme.Global.handleize(e.update_variant.options[t])+'"]').addClass("active"),n.find('[data-js-option-select][data-property="'+theme.Global.handleize(this)+'"]').val(e.update_variant.options[t]).trigger("change",[!0])}))},_updateFormVariantInput:function(t,e){t.find("[data-js-product-variant-input]").attr("value",e.update_variant.id)},_updateVariantsSelect:function(t,e){var a=t.find("[data-js-product-variants]");a.length&&a.val(e.update_variant.id).change()},_updateAddToCart:function(t,e,a){var n=t.add(e).find("[data-js-product-button-add-to-cart]");n.length&&(a.is_avilable&&a.update_variant.available?n.removeAttr("disabled data-button-status"):n.attr("disabled","disabled").attr("data-button-status","sold-out"))},_updatePrice:function(t,e,a){var n,o=t.add(e).find("[data-js-product-price]"),i=t.find("[data-js-product-price-sale-details]");(o.length&&theme.ProductCurrency.setPrice(o,a.update_variant.price,a.update_variant.compare_at_price),i.length)&&($.each(a.json.variants_price_sale_details,function(){+this.id==+a.update_variant.id&&(n=this.details)}),i.html(n||"")[n?"removeClass":"addClass"]("d-none-important"));(o.length||i.length)&&theme.ProductCurrency.update()},_updateLabelSale:function(t,e){var a=t.find("[data-js-product-label-sale]");if(a.length){var n="",o=e.update_variant.compare_at_price&&e.update_variant.compare_at_price>e.update_variant.price;if(a[o?"removeClass":"addClass"]("d-none-important"),o){var i=Math.round(100-100*e.update_variant.price/e.update_variant.compare_at_price);n=(n+=theme.strings.label.sale).replace("{{ percent }}",i)}a.html(n)}},_updateLabelInStock:function(t,e){var a=t.find("[data-js-product-label-in-stock]");a.length&&a[e.update_variant.available?"removeClass":"addClass"]("d-none-important")},_updateLabelOutStock:function(t,e){var a=t.find("[data-js-product-label-out-stock]");a.length&&a[e.update_variant.available?"addClass":"removeClass"]("d-none-important")},_updateLabelHot:function(t,e){var a=t.find("[data-js-product-label-hot]");a.length&&a[e.update_variant.metafields.labels&&e.update_variant.metafields.labels.hot?"removeClass":"addClass"]("d-none-important")},_updateLabelNew:function(t,e){var a=t.find("[data-js-product-label-new]");a.length&&a[e.update_variant.metafields.labels&&e.update_variant.metafields.labels.new?"removeClass":"addClass"]("d-none-important")},_updateCountdown:function(t,e){var a,n,o=t.find("[data-js-product-countdown]"),i=!(!e.update_variant.metafields.countdown||!e.update_variant.metafields.countdown.date)&&e.update_variant.metafields.countdown.date;o.length&&(a=o.find(".js-countdown"),(n=i&&e.update_variant.compare_at_price&&e.update_variant.compare_at_price>e.update_variant.price)&&a.attr("data-date")!==i&&theme.ProductCountdown.reinit(a,i),n||o.addClass("d-none-important"))},_updateSKU:function(t,e){var a=t.find("[data-js-product-sku]");a.length&&(a[e.update_variant.sku?"removeClass":"addClass"]("d-none-important"),a.find("span").html(e.update_variant.sku))},_updateBarcode:function(t,e){var a=t.find("[data-js-product-barcode]");a.length&&(a[e.update_variant.barcode?"removeClass":"addClass"]("d-none-important"),a.find("span").html(e.update_variant.barcode))},_updateAvailability:function(t,e){var a=t.find("[data-js-product-availability]");if(a.length){var n="",o=0;$.each(e.json.variants_quantity,function(){+this.id==+e.update_variant.id&&(o=+this.quantity)}),e.update_variant.available?n=(n=(n+=theme.strings.availability_value_in_stock).replace("{{ count }}",o)).replace("{{ item }}",1===o?theme.strings.layout.cart.items_count.one:theme.strings.layout.cart.items_count.other):n+=theme.strings.availability_value_out_stock,a.attr("data-availability",e.update_variant.available).find("span").html(n)}},_updateStockCountdown:function(t,e){var a=t.find("[data-js-product-stock-countdown]"),n=a.find("[data-js-product-stock-countdown-title]"),o=a.find("[data-js-product-stock-countdown-progress]"),i=+a.attr("data-min"),s=0;$.each(e.json.variants_quantity,function(){+this.id==+e.update_variant.id&&(s=+this.quantity)}),n&&n.html(theme.strings.stock_countdown.title.replace("{{ quantity }}",'<span class="stock-countdown__counter">'+s+"</span>")),o&&o.width(s/(i/100)+"%"),a.length&&a[0<s&&s<i?"removeClass":"addClass"]("d-none-important")},_updateGallery:function(t,e){var a=t.find("[data-js-product-gallery]");if(a.find(".fotorama").length){var n=e.update_variant.featured_image;n&&n.src||e.json.images[0]&&(n=e.json.images[0]),a.productGallery("switchImageById",n.id)}},_updateLinks:function(t,e){var a=decodeURIComponent(window.location.origin)+"/products/"+e.json.handle+"?variant="+e.update_variant.id;t.find('a[href*="products/'+e.json.handle+'"]').attr("href",a)},_updateHistory:function(t,e){var a=t.find(this.selectors.options);if(a.length&&a[0].hasAttribute("data-js-change-history"))decodeURIComponent(window.location.origin),e.json.handle,e.update_variant.id}}),theme.ProductOptions=new t},theme.ProductReview=function(){function t(){}t.prototype=$.extend({},t.prototype,{update:function(){}}),theme.ProductReview=new t},theme.ProductGallery=function(){function t(){this.load()}t.prototype=$.extend({},t.prototype,{load:function(){$.widget("ui.productGallery",{options:{bp:1024,bp_slick:1024,fotorama:{size:3,nav:!1,arrows:!1,allowfullscreen:!0,auto:!1,shadows:!1,transition:"slide",clicktransition:"crossfade"},slick:{preview:{lazyLoad:!1,vertical:!0,verticalSwiping:!0,slidesToShow:6,slidesToScroll:6,dots:!1,arrows:!0,infinite:!1,touchMove:!1,responsive:[{breakpoint:1259,settings:{slidesToShow:4,slidesToScroll:4}}]},panorama:{lazyLoad:!1,slidesToShow:3,slidesToScroll:1,customPaging:"10px",dots:!1,arrows:!0,infinite:!1,touchMove:!1,responsive:[{breakpoint:1024,settings:{slidesToShow:2}},{breakpoint:779,settings:{slidesToShow:2}},{breakpoint:542,settings:{slidesToShow:1}}]}},zoom:{zoomType:"inner",cursor:"crosshair",easing:!0,zoomWindowFadeIn:150,zoomWindowFadeOut:150},zoomEnable:!0,arrows:!0,btnZoom:!1,fullscreen:!0},_create:function(){this.$gallery=this.element,this.$main=this.$gallery.find("[data-js-product-gallery-main]"),this.$preview=this.$gallery.find("[data-js-product-gallery-preview]"),this.$collage=this.$gallery.find("[data-js-product-gallery-collage]"),this.preview_type=this.$preview.attr("data-type"),this.$main_act_img=null,this.$zoomWrapper=this.$gallery.find("[data-js-product-gallery-zoom]"),this.slick_state=null,this.zoom_activate=!0,this.zoom_state=!1,this.id="id"+Math.ceil(1e7*Math.random()),this.index_id_obj=this.$main.data("index-id"),this.zoom_src=this.$main.data("zoom-images");var a=this,t=this.$main.data("arrows"),e=this.$main.data("fullscreen"),n=this.$main.data("zoom"),o=this.$gallery.data("active-image");null!=t&&(this.options.arrows=t),null!=e&&(this.options.fullscreen=e),null!=n&&(this.options.zoomEnable=n),null!=o&&(this.options.fotorama.startindex=o,this.options.slick.initialSlide=o),this.options.fotorama.allowfullscreen=this.options.fullscreen,1===this.$main.find("img").length&&this.$main.addClass("product-page-gallery__main--single"),this.fotorama=this.$main.fotorama(this.options.fotorama).data("fotorama"),this.options.fullscreen&&(this.$btn_full=this.$gallery.find("[data-js-product-gallery-btn-fullscreen]"),this.$main.on({"fotorama:fullscreenenter":function(){a._zoomDestroy()},"fotorama:fullscreenexit":function(){a._checkSlick(),a._checkCollage(),a._zoomInit()}}),this.$btn_full.on("click",function(){a.fotorama.requestFullScreen()})),this.options.btnZoom&&(this.$btn_zoom_toggle=$("<div>").addClass("fotorama__btn-zoom").append($("<i>").addClass("icon-zoom-in")),this.$main.append(this.$btn_zoom_toggle),this.$btn_zoom_toggle.on("click",function(){a.zoom_state?a.zoomToggle("off"):a.zoomToggle("on")})),this.options.arrows&&(this.$arrow_prev=this.$gallery.find("[data-js-product-gallery-main-btn-prev]"),this.$arrow_next=this.$gallery.find("[data-js-product-gallery-main-btn-next]"),this.$arrow_prev.on("click",function(){a._setEffect("crossfade",function(){a.fotorama.show("<")})}),this.$arrow_next.on("click",function(){a._setEffect("crossfade",function(){a.fotorama.show(">")})})),this.$prev_slides=this.$preview.find("[data-js-product-gallery-preview-image]"),this.$preview.on("init",function(){a.$preview.removeClass("invisible")}),this.$preview.one("init",function(){a.slick_is_init=!0}),this.$preview.on("mousedown",".slick-slide",function(){$(this).one({mouseup:function(t){var e=$(this);a.switchImage(e)}})}),this.$collage_slides=this.$collage.find("[data-js-product-gallery-preview-image]"),this.$collage.on("click","[data-js-product-gallery-preview-image]",function(){var t=$(this);a.switchImage(t)}),this.$gallery.on("click","[data-js-product-gallery-btn-video]",function(){a.switchImage(null,"video")}),this._slickInit(),this.$gallery.addClass("product-page-gallery--loaded"),this.$main.one("fotorama:load",function(t,e){a._zoomInit(),a._checkBtns(e),a.$main.on("fotorama:show.change",function(t,e){a.$main.unbind("fotorama:showend.change fotorama:load.change"),a._zoomDestroy(),a._checkBtns(e),a.$main.one("fotorama:load.change",function(){a._zoomInit()}),a.$main.one("fotorama:showend.change",function(t,e){a.$main.find(".fotorama__active img").attr("src")&&a.$main.trigger("fotorama:load.change"),a._checkSlick(),a._checkCollage()})}),a.$main.removeClass("invisible"),a.fotorama_is_init=!0}),$(window).on("theme.changed.breakpoint.productgallery"+this.id,function(){a._slickInit(),a._checkSlick(),a._checkCollage(),a._zoomDestroy(),a._zoomInit()})},_slickInit:function(){var t=window.innerWidth>this.options.bp_slick;if(t!==this.slick_state){if("panorama"===this.preview_type||t)if(this.$preview.hasClass("slick-initialized"))this.$preview.slick("setPosition");else{if("panorama"===this.preview_type)var e=this.options.slick.panorama;else{e=this.options.slick.preview;var a=this.$preview.attr("data-slides-to-show");void 0!==a&&(e.slidesToShow=+a)}this.$preview.slick($.extend(e,{prevArrow:this.$gallery.find("[data-js-product-gallery-preview-btn-prev]"),nextArrow:this.$gallery.find("[data-js-product-gallery-preview-btn-next]")}))}else this.$preview.hasClass("slick-initialized")&&(this.$preview.addClass("invisible"),this.$preview.slick("destroy")),this.slick_is_init=!0;this.slick_state=t}},_checkSlick:function(t){if(!this.$main.hasClass("fotorama--fullscreen")&&this.$preview.hasClass("slick-initialized")){if(!t){if(!this.fotorama)return;t=this.index_id_obj[this.fotorama.activeIndex]}var e=this.$prev_slides.filter('[data-js-product-gallery-image-id="'+t+'"]'),a=this.$prev_slides.index(e);this.$prev_slides.removeClass("current"),e.addClass("current"),this.$preview.slick("slickGoTo",a)}},_checkCollage:function(t){if(!this.$main.hasClass("fotorama--fullscreen")&&this.$collage.length){if(!t){if(!this.fotorama)return;t=this.index_id_obj[this.fotorama.activeIndex]}var e=this.$collage_slides.filter('[data-js-product-gallery-image-id="'+t+'"]');this.$collage_slides.removeClass("current"),e.addClass("current")}},_checkBtns:function(t){if(this.options.arrows){var e=t.activeFrame.i;1===e?this.$arrow_prev.addClass("disabled"):this.$arrow_prev.removeClass("disabled"),e===t.size?this.$arrow_next.addClass("disabled"):this.$arrow_next.removeClass("disabled")}},_zoomInit:function(){var e=this;if(this.$main_act_img=this.$main.find(".fotorama__active").not("fotorama__stage__frame--video").find(".fotorama__img").not(".fotorama__img--full"),this.fotorama&&this.options.zoomEnable&&this.$main_act_img.length&&window.innerWidth>this.options.bp&&this.zoom_activate&&!this.$main.hasClass("fotorama--fullscreen")){var t=this.zoom_src[this.fotorama.activeIndex];if(!t)return;this.$main_act_img.attr("data-zoom-image",t),this.$main_act_img.elevateZoom(this.options.zoom),function t(){setTimeout(function(){e.$zoomContainer=$("body > .zoomContainer"),e.$zoomContainer.length?e.$zoomContainer.appendTo(e.$zoomWrapper):t()},20)}(),this.$zoomWrapper.removeClass("d-none-important"),this.$main.addClass("fotorama--zoom"),this.zoom_state=!0}},_zoomDestroy:function(){this.options.zoomEnable&&this.zoom_state&&this.$main_act_img.length&&this.$zoomContainer&&($.removeData(this.$main_act_img,"elevateZoom"),this.$main_act_img.removeAttr("data-zoom-image"),this.$zoomContainer.remove(),this.$zoomContainer=null,this.$zoomWrapper.addClass("d-none-important"),this.$main.removeClass("fotorama--zoom"),this.zoom_state=!1)},zoomToggle:function(t){if(this.$btn_zoom_toggle){var e=this.$btn_zoom_toggle.find("i");e.removeAttr("class"),"on"===t?(e.addClass("icon-zoom-in"),this.zoom_activate=!0,this._zoomInit()):"off"===t&&(e.addClass("icon-zoom-out"),this.zoom_activate=!1,this._zoomDestroy())}},_setEffect:function(t,e){var a=this;this.fotorama.setOptions({transition:t}),e(),this.$main.one("fotorama:showend",function(){a.fotorama.setOptions({transition:"slide"})})},switchImage:function(t,n){if(!t||!t.hasClass("current")){var o=this;n=n||t.data("js-product-gallery-image-id");this.fotorama?function t(){if(o.fotorama_is_init){for(var e=0,a=0;a<o.index_id_obj.length;a++)o.index_id_obj[a]==n&&(e=a);o._setEffect("crossfade",function(){o.fotorama.show(e)})}else o.$main.one("fotorama:load",function(){t()}),o.$preview.on("init",function(){t()})}():"panorama"===this.preview_type&&this._checkSlick(n)}},switchImageById:function(t){var e=this.$prev_slides.add(this.$collage_slides).filter('[data-js-product-gallery-image-id="'+t+'"]');this.switchImage(e)},update:function(){this.$preview.hasClass("slick-initialized")&&this.$preview.slick("setPosition")},_init:function(){},_setOption:function(t,e){$.Widget.prototype._setOption.apply(this,arguments)},destroy:function(){this._zoomDestroy(),this.$preview.unbind("mousedown"),this.$preview.slick("destroy"),$(this.$gallery,this.$btn_full,this.$arrow_prev,this.$arrow_next,this.$btn_zoom_toggle).off().remove(),this.fotorama.destroy(),$(window).unbind("theme.changed.breakpoint.productgallery"+this.id),$.Widget.prototype.destroy.call(this)}})},init:function(t){t.hasClass("product-page-gallery--loaded")||t.productGallery()},destroy:function(t){t.hasClass("product-page-gallery--loaded")&&t.productGallery("destroy")}}),theme.ProductGallery=new t},theme.Cart=function(){function t(){this.selectors={button_add:".js-product-button-add-to-cart",button_remove:".js-product-button-remove-from-cart"},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var c=this;$body.on("click",this.selectors.button_add,function(t){var e,a,n=$(this);if(!n.hasClass("active")&&"added"!==n.attr("data-button-status")){n.addClass("active").attr("disabled","disabled");var o,i,s=n.parents("form"),r=$.extend({},s.serializeArray()),d={};return $.each(r,function(){-1!=this.name.indexOf("[")&&-1!=this.name.indexOf("]")?(o=this.name.split("[")[0],i=this.name.split("[")[1].split("]")[0],d[o]={},d[o][i]=this.value):d[this.name]=this.value}),void 0!==(a=(e=n).attr("data-js-button-add-to-cart-clone-id"))&&(e=e.add($('[data-js-button-add-to-cart-clone="'+a+'"]'))),e.each(function(){var t=$(this);t.css({"min-width":t.outerWidth()+"px"})}),e.removeAttr("disabled").attr("data-button-status","added"),setTimeout(function(){e.removeAttr("data-button-status").removeClass("active").removeAttr("style")},2e3),c.updateValues(null,function(){}),t.preventDefault(),!1}}),$body.on("click",this.selectors.button_remove,function(t){var e=+$(this).parents("[data-js-product]").attr("data-product-variant-id");return Shopify.removeItem(e,function(t){c.updateValues(t),theme.Popups.getByName("cart").hasClass("d-none-important")||theme.PopupCart.update()}),t.preventDefault(),!1})},updateValues:function(t,e){var a=this;function n(t){a.updateHeaderCount(t),a.updateFreeShipping(t)}t?n(t):Shopify.getCart(function(t){n(t),e&&"function"==typeof e&&e(t)})},updateHeaderCount:function(t){$("[data-js-cart-count-mobile]").attr("data-js-cart-count-mobile",t.item_count).html(t.item_count),$("[data-js-cart-count-desktop]").attr("data-js-cart-count-desktop",t.item_count).html(theme.strings.header.cart_count_desktop.replace("{{ count }}",t.item_count))},updateFreeShipping:function(t){var e=$(".js-free-shipping"),a=e.find("[data-js-progress]"),n=e.find("[data-js-text]"),o=+e.attr("data-value"),i=+t.total_price,s=Math.min(i/(o/100),100),r=Math.max(o-i,0),d=0<r?theme.strings.cart.general.free_shipping_html.replace("{{ value }}",Shopify.formatMoney(r,theme.moneyFormat)):theme.strings.cart.general.free_shipping_complete;a.css({width:s+"%"}),n.html(d)}}),theme.Cart=new t},theme.StoreLists=function(){function r(t,e){this.namespace=t,this.selectors={button:".js-store-lists-add-"+t,button_remove:".js-store-lists-remove-"+t,button_clear:".js-store-lists-clear-"+t,has_items:"[data-js-store-lists-has-items-"+t+"]",dhas_items:"[data-js-store-lists-dhas-items-"+t+"]"},theme.customer?(this.current_storage=t+"-customer-"+theme.customer_id,this.app_obj={namespace:t,customerid:theme.customer_id,shop:theme.permanent_domain,domain:theme.host,iid:theme.lists_app.iid}):this.current_storage=t+"-guest",this.load(e)}function d(t){this.namespace=t,this.load()}function t(){this.namespaces=["wishlist","compare"],this.load()}r.prototype=$.extend({},r.prototype,{load:function(t){var i=this;if(theme.customer){var a,e=localStorage.getItem(this.current_storage),n=e?JSON.parse(e):[],o=localStorage.getItem(this.namespace+"-guest"),s=o?JSON.parse(o):[],r={},d={},c=[],l=function(t){return t},u=function(){i.getCustomerList(function(t){if(200===t.status){var e=0;if(t.items&&t.items.length){for(n=n.concat(t.items);e<t.items.length;e++)$.each(t.items[e],function(t,e){r[t]=e});r=l(r)}for(e=0;e<n.length;e++)$.each(n[e],function(t,e){d[t]=e});d=l(d),$.each(d,function(t,e){var a={};a[t]=e,c.push(a)}),a=JSON.stringify(c),JSON.stringify(r)!==JSON.stringify(d)&&(localStorage.setItem(i.current_storage,a),i.setCustomerList(a)),i.updateHeaderCount(),i.checkProductStatus(),localStorage.removeItem(i.namespace+"-guest")}})};s.length?t({trigger:function(t){t&&(n=n.concat(s)),u()},info:{namespace:i.namespace,count:s.length}}):u()}else this.checkProductStatus();function p(t,e){var a="[data-js-store-lists-product-"+i.namespace+"]",n=theme.Popups.getByName(i.namespace);e&&(a+='[data-product-handle="'+e+'"]'),$(a).each(function(){var t=$(this);$(t.parent('[class*="col"]').length?t.parent():t).remove()}),t&&void 0!==typeof t&&t.length&&t.remove(),n.hasClass("d-none-important")||theme.StoreLists.popups[i.namespace].update(n)}$body.on("click",this.selectors.button,function(t){t.preventDefault();var e=$(this);e.attr("disabled","disabled");var a=e.parents("[data-js-product]"),n=a.attr("data-product-handle"),o=+a.attr("data-product-variant-id");return"added"===e.attr("data-button-status")?i.removeItem(o,n,function(t){e.removeAttr("data-button-status"),e.removeAttr("disabled")}):i.addItem(o,n,function(t){e.attr("data-button-status","added"),e.removeAttr("disabled")}),t.preventDefault(),!1}),$body.on("click",this.selectors.button_remove,function(){var t=$(this).parents("[data-js-product]"),e=t.attr("data-product-handle"),a=+t.attr("data-product-variant-id");i.removeItem(a,e,function(){p(t,e)})}),$body.on("click",this.selectors.button_clear,function(){i.clear(function(){p()})})},setCustomerList:function(t,e){},getCustomerList:function(t){},addCustomerItem:function(t,e,a){},removeCustomerItem:function(t,e){},clearCustomerItem:function(t){},addItem:function(t,e,a){var n=localStorage.getItem(this.current_storage),o=n?JSON.parse(n):[],i={};i[t]=e,o.push(i),localStorage.setItem(this.current_storage,JSON.stringify(o)),this.checkProductStatus(),this.updateHeaderCount(),this.addCustomerItem(t,e),a&&a()},removeItem:function(e,a,t){var n=localStorage.getItem(this.current_storage),o=n?JSON.parse(n):[];$.each(o,function(t){if(this[e]&&this[e]===a)return o.splice(t,1),!1}),localStorage.setItem(this.current_storage,JSON.stringify(o)),this.checkProductStatus(),$(this.selectors.has_items)[0<o.length?"removeClass":"addClass"]("d-none-important"),$(this.selectors.dhas_items)[0<o.length?"addClass":"removeClass"]("d-none-important"),this.updateHeaderCount(),this.removeCustomerItem(e),t&&t()},clear:function(t){localStorage.removeItem(this.current_storage),this.checkProductStatus(),$(this.selectors.has_items).addClass("d-none-important"),$(this.selectors.dhas_items).removeClass("d-none-important"),this.updateHeaderCount(),this.clearCustomerItem(),t&&t()},checkProductStatus:function(n){n=n||$("[data-js-product]");var t=localStorage.getItem(this.current_storage),e=t?JSON.parse(t):[],o=$();$.each(e,function(){$.each(this,function(t,e){var a=n.filter('[data-product-handle="'+e+'"][data-product-variant-id="'+t+'"]');a.length&&(o=o.add(a))})}),n.not(o).find(this.selectors.button).removeAttr("data-button-status"),o.find(this.selectors.button).attr("data-button-status","added")},updateHeaderCount:function(t){var e=localStorage.getItem(this.current_storage),a=e?JSON.parse(e).length:0;$("[data-js-"+this.namespace+"-count]").attr("data-js-"+this.namespace+"-count",a).html(a),t&&t()}}),d.prototype=$.extend({},d.prototype,{load:function(){var e=this;theme.Popups.addHandler(this.namespace,"call.visible",function(t){e.update(t,function(){t.trigger("contentloaded")})}),theme.Popups.addHandler(this.namespace+"-full","call.visible",function(t){e.updateFull(t,function(){t.trigger("contentloaded")})})},_resultToHTML:function(t,e,a){a&&a()},_getProducts:function(t,e){var a=[];this.xhr&&this.xhr.abort();for(var n=0;n<t.length;n++)$.each(t[n],function(){a.push(this)});a=a.join("+"),e({params:t})},update:function(t,e){var a=localStorage.getItem(theme.StoreLists.lists[this.namespace].current_storage),n=a?JSON.parse(a):[1,2,3,4],o=t.find(".popup-"+this.namespace+"__content"),i=t.find(".popup-"+this.namespace+"__empty");t.find(".popup-"+this.namespace+"__items");t.find("[data-js-popup-"+this.namespace+"-count]").html(theme.strings.general.popups[this.namespace].count.replace("{{ count }}",n.length)),o[0<n.length?"removeClass":"addClass"]("d-none-important"),i[0<n.length?"addClass":"removeClass"]("d-none-important"),e&&e()},updateFull:function(t,e){t.find(".popup-"+this.namespace+"-full__content");theme.ImagesLazyLoad.update(),theme.ProductCurrency.update(),e&&e()}}),t.prototype=$.extend({},t.prototype,{lists:{},popups:{},load:function(){for(var e=[],t=0;t<this.namespaces.length;t++)this.lists[this.namespaces[t]]=new r(this.namespaces[t],function(t){e.push(t)}),this.popups[this.namespaces[t]]=new d(this.namespaces[t]);if(e.length){var a=$("[data-js-button-transfer-data]");a.one("click",function(){a.attr("data-js-active",!0),theme.Popups.closeByName("confirm-transfer-data")}),theme.Popups.addHandler("confirm-transfer-data","close.after",function(){a.off();for(var t=0;t<e.length;t++)e[t].trigger("true"===a.attr("data-js-active"))});var n=$("[data-js-transfer-data-info]");for(t=0;t<e.length;t++){var o,i=$("<li>"),s=theme.strings.general.popups.confirm_transfer_data.info;switch(e[t].info.namespace){case"wishlist":o=theme.strings.general.popups.confirm_transfer_data.wishlist_title;break;case"compare":o=theme.strings.general.popups.confirm_transfer_data.compare_title}s=(s=(s=s.replace("{{ title }}",o)).replace("{{ count }}",e[t].info.count)).replace("{{ name }}",1<e[t].info.count?theme.strings.general.popups.confirm_transfer_data.name_plural:theme.strings.general.popups.confirm_transfer_data.name_single),i.html(s),n.append(i)}theme.Popups.callByName("confirm-transfer-data")}},checkProductStatus:function(){$.each(this.lists,function(){this.checkProductStatus()})},updateHeaderCount:function(){$.each(this.lists,function(){this.updateHeaderCount()})}}),theme.StoreLists=new t},theme.Menu=function(){function t(){this.settings={popup_name:"navigation",button_navigation:"data-js-popup-navigation-button"},this.selectors={popup_navigation:".js-popup-navigation"}}t.prototype=$.extend({},t.prototype,{is_open_animate:!1,duration:function(){return.1<window.theme.animations.menu.duration?1e3*(window.theme.animations.menu.duration-.1):0},init:function(o,t){var i=this,s=o.find(".menu__panel"),e=s.find(".menu__megamenu"),a=s.find(".menu__dropdown"),n=$(this.selectors.popup_navigation),r=n.find("["+this.settings.button_navigation+"]"),d=o.find(".menu__curtain");return this.$menu=o,this.$panel=s,this.$megamenus=e,this.$dropdowns=a,this.$curtain=d,this.handlerMenu=theme.Global.responsiveHandler({namespace:t.namespace,element:o,delegate:"a",on_mobile:!0,events:{click:function(t){var e=$(this).parent(),a=e.find(".menu__list").first();if(s.unbind("transitionend"),a.length){var n=e.parents(".menu__level-02").length?3:2;return e.addClass("open"),e.find(".menu__list").first().addClass("show"),s.attr("data-mobile-level",n),o.length&&o.scrollTop(0),r.attr(i.settings.button_navigation,"back"),t.preventDefault(),!1}}}}),this.handlerBack=theme.Global.responsiveHandler({namespace:t.namespace,element:n,delegate:"["+this.settings.button_navigation+'="back"]',on_mobile:!0,events:{click:function(){var t=s.attr("data-mobile-level")-1,e=1<t?"back":"close",a=o.find(".menu__item.open").last();a.removeClass("open"),s.one("transitionend",function(){a.find(".menu__list").first().removeClass("show")}),s.attr("data-mobile-level",t),o.scrollTop(0),r.attr(i.settings.button_navigation,e),"0s"===s.css("transition-duration")&&s.trigger("transitionend")}}}),theme.Popups.addHandler(this.settings.popup_name,"close.before.closeMobileMenu",function(){theme.current.is_mobile&&(i.closeMobileMenu(),r.attr(i.settings.button_navigation,"close"))}),this.handlerDropdown=theme.Global.responsiveHandler({namespace:t.namespace,element:s,delegate:"> .menu__item",on_desktop:!0,events:{"mouseenter mouseleave":function(t){i._toggleMegamenu($(this),t)}}}),{destroy:function(){theme.Popups.removeHandler(i.settings.popup_name,"close.before.closeMobileMenu"),i.handlerMenu.unbind(),i.handlerBack.unbind(),i.handlerDropdown.unbind()}}},_toggleMegamenu:function(t,e){var i=this,s=t.find(".menu__megamenu"),a=t.find(".menu__dropdown");if("mouseenter"===e.type)if(s.length){this.is_open_animate=!0,s.velocity("stop",!0),this.$dropdowns.velocity("finish"),this.$megamenus.not(s).removeClass("show animate visible").removeAttr("style"),this.$dropdowns.removeClass("show animate visible").removeAttr("style"),s.addClass("show overflow-hidden");var n=theme.current.height-s[0].getBoundingClientRect().top,o=Math.min(s.children().innerHeight(),n);s.css({"max-height":n}),this.$curtain.velocity({height:o,tween:[o,this.$curtain.height()]},{duration:this.duration(),begin:function(){i.$curtain.addClass("show"),s.addClass("animate visible")},progress:function(t,e,a,n,o){s.height(o)},complete:function(){s.removeClass("overflow-hidden").removeAttr("style"),i.is_open_animate=!1}})}else a.length&&(a.addClass("show"),a.velocity("stop",!0),this.$megamenus.velocity("finish"),this.$dropdowns.not(a).removeClass("show animate visible").removeAttr("style"),this.$megamenus.removeClass("show animate visible").removeAttr("style"),a.velocity("slideDown",{duration:this.duration(),begin:function(){setTimeout(function(){a.addClass("animate visible")},0)},complete:function(){a.removeAttr("style")}}));else"mouseleave"===e.type&&(s.length&&s.hasClass("show")?(this.$curtain.velocity("stop"),s.velocity({height:0,tween:[0,s.height()]},{duration:this.duration(),begin:function(){s.addClass("overflow-hidden").removeClass("visible")},progress:function(t,e,a,n,o){i.$curtain.height(o)},complete:function(){s.removeClass("show animate overflow-hidden").removeAttr("style"),i.is_open_animate||i.$curtain.removeClass("show").removeAttr("style")}})):a.length&&a.velocity("slideUp",{duration:this.duration(),begin:function(){a.removeClass("visible")},complete:function(){a.removeClass("show animate").removeAttr("style")}}))},closeMobileMenu:function(){if(theme.current.is_mobile){var t=this.$menu.find(".menu__panel");t.find(".menu__item").removeClass("open"),t.attr("data-mobile-level","1"),this.$menu.scrollTop(0)}}}),theme.Menu=new t},theme.Accordion=function(){function t(){this.settings={elements:"data-js-accordion",button:"data-js-accordion-button",duration:function(){return 1e3*theme.animations.accordion.duration}},this.selectors={elements:"["+this.settings.elements+"]",button:"["+this.settings.button+"]",content:"[data-js-accordion-content]",input:"[data-js-accordion-input]"},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var s=this;function t(t){var e=$(this),a=e.find(s.selectors.input),n=$(".js-sticky-sidebar");if(a.length){if("INPUT"===t.target.tagName)return;if($.contains(e.find("label")[0],t.target)&&!a.prop("checked")&&e.hasClass("open"))return}var o=e.parents(s.selectors.elements).first(),i=o.find(s.selectors.content).first();i.is(":animated")||(e.toggleClass("open"),e.hasClass("open")?i.hide().removeClass("d-none").slideDown({duration:s.settings.duration(),step:function(){theme.StickySidebar&&theme.StickySidebar.update(n)},complete:function(){i.removeAttr("style"),theme.StickySidebar&&theme.StickySidebar.update(n)}}):i.slideUp({duration:s.settings.duration(),step:function(){theme.StickySidebar&&theme.StickySidebar.update(n)},complete:function(){i.addClass("d-none").removeAttr("style"),theme.StickySidebar&&theme.StickySidebar.update(n)}}),o.find(s.selectors.button).not(e).not(o.find(s.selectors.content).find(s.selectors.button)).add(o.find("["+s.settings.button+'="inner"]'))[e.hasClass("open")?"addClass":"removeClass"]("open"))}$body.on("click","["+this.settings.elements+'="all"] '+this.selectors.button,t),theme.Global.responsiveHandler({namespace:".accordion",element:$body,delegate:"["+this.settings.elements+'="only-mobile"] '+this.selectors.button,on_mobile:!0,events:{click:t}})}}),theme.Accordion=new t};var Section={};Section.prototype=$.extend({},Section.prototype,{_registerHansler:function(){this.elemsHasHandler||(this.elemsHasHandler=[]);for(var t=0;t<arguments.length;t++)this.elemsHasHandler.push(arguments[t])},_offHanslers:function(){if(this.elemsHasHandler&&$.isArray(this.elemsHasHandler)){for(var t=0;t<this.elemsHasHandler.length;t++)$(this.elemsHasHandler[t]).off();delete this.elemsHasHandler}}});var Currency={convertAll:function(t){return t},convert:function(t){return t},moneyFormats:function(t){return t}};$(function(){theme.Global(),theme.ProductCurrency(),theme.ImagesLazyLoad(),theme.Position(),theme.Menu(),theme.Dropdown(),theme.Select(),theme.Loader(),theme.Popups(),theme.PopupAccount(),theme.PopupSearch(),theme.PopupCart(),theme.PopupQuickView(),theme.ProductQuantity(),theme.ProductCountdown(),theme.ProductTextCountdown(),theme.ProductVisitors(),theme.ProductImagesNavigation(),theme.ProductImagesHover(),theme.ProductOptions(),theme.ProductReview(),theme.ProductGallery(),theme.Cart(),theme.StoreLists(),theme.Accordion(),theme.sections={register:function(t,e){$('[data-section-type="'+t+'"]').each(function(){new e($(this))})}}});