1(function($){$(".collection-sidebar")&&History.Adapter.bind(window,"statechange",function(){var State=History.getState();if(!ella.isSidebarAjaxClick){ella.sidebarParams();var newurl=ella.sidebarCreateUrl();ella.sidebarGetContent(newurl),ella.reActivateSidebar()}ella.isSidebarAjaxClick=!1}),window.use_color_swatch&&($(".swatch :radio").change(function(){var optionIndex=$(this).closest(".swatch").attr("data-option-index"),optionValue=$(this).val();$(this).closest("form").find(".single-option-selector").eq(optionIndex).val(optionValue).trigger("change")}),Shopify.optionsMap={},Shopify.updateOptionsInSelector=function(selectorIndex){switch(selectorIndex){case 0:var key="root",selector=$(".single-option-selector:eq(0)");break;case 1:var key=$(".single-option-selector:eq(0)").val(),selector=$(".single-option-selector:eq(1)");break;case 2:var key=$(".single-option-selector:eq(0)").val();key+=" / "+$(".single-option-selector:eq(1)").val();var selector=$(".single-option-selector:eq(2)")}var initialValue=selector.val();selector.empty();var availableOptions=Shopify.optionsMap[key];if(availableOptions&&availableOptions.length){for(var i2=0;i2<availableOptions.length;i2++){var option=availableOptions[i2],newOption=$("<option></option>").val(option).html(option);selector.append(newOption)}$('.swatch[data-option-index="'+selectorIndex+'"] .swatch-element').each(function(){$.inArray($(this).attr("data-value"),availableOptions)!==-1?$(this).removeClass("soldout").show().find(":radio").removeAttr("disabled","disabled").removeAttr("checked"):$(this).addClass("soldout").hide().find(":radio").removeAttr("checked").attr("disabled","disabled")}),$.inArray(initialValue,availableOptions)!==-1&&selector.val(initialValue),selector.trigger("change")}},Shopify.linkOptionSelectors=function(product){for(var i2=0;i2<product.variants.length;i2++){var variant=product.variants[i2];if(variant.available){if(Shopify.optionsMap.root=Shopify.optionsMap.root||[],Shopify.optionsMap.root.push(variant.option1),Shopify.optionsMap.root=Shopify.uniq(Shopify.optionsMap.root),product.options.length>1){var key=variant.option1;Shopify.optionsMap[key]=Shopify.optionsMap[key]||[],Shopify.optionsMap[key].push(variant.option2),Shopify.optionsMap[key]=Shopify.uniq(Shopify.optionsMap[key])}if(product.options.length===3){var key=variant.option1+" / "+variant.option2;Shopify.optionsMap[key]=Shopify.optionsMap[key]||[],Shopify.optionsMap[key].push(variant.option3),Shopify.optionsMap[key]=Shopify.uniq(Shopify.optionsMap[key])}}}Shopify.updateOptionsInSelector(0),product.options.length>1&&Shopify.updateOptionsInSelector(1),product.options.length===3&&Shopify.updateOptionsInSelector(2),$(".single-option-selector:eq(0)").change(function(){return Shopify.updateOptionsInSelector(1),product.options.length===3&&Shopify.updateOptionsInSelector(2),!0}),$(".single-option-selector:eq(1)").change(function(){return product.options.length===3&&Shopify.updateOptionsInSelector(2),!0})}),$(document).ready(function(){ella.init()}),$(window).resize(function(){ella.initMobileMenu(),ella.initResizeImage()}),$(window).scroll(function(){$(this).scrollTop()>200?$("#back-top").fadeIn():$("#back-top").fadeOut()}),$(".header-mobile").is(":visible")||$(document).on("click touchstart",function(e){var quickview=$(".quick-view"),dropdowncart=$("#dropdown-cart"),cartButton=$("#cartToggle"),newsletter=$("#email-modal .modal-window"),searchBar=$(".nav-search");!quickview.is(e.target)&&quickview.has(e.target).length===0&&!dropdowncart.is(e.target)&&dropdowncart.has(e.target).length===0&&!cartButton.is(e.target)&&cartButton.has(e.target).length===0&&!newsletter.is(e.target)&&newsletter.has(e.target).length===0&&!searchBar.is(e.target)&&searchBar.has(e.target).length===0&&(ella.closeQuickViewPopup(),ella.closeDropdownCart(),ella.closeEmailModalWindow(),ella.closeDropdownSearch())}),$(document).keyup(function(e){e.keyCode==27&&(ella.closeQuickViewPopup(),ella.closeDropdownCart(),ella.closeDropdownSearch(),clearTimeout(ella.ellaTimeout),$(".modal").is(":visible")&&$(".modal").fadeOut(500))});var ella={ellaTimeout:null,isSidebarAjaxClick:!1,init:function(){this.initColorSwatchGrid(),this.initResizeImage(),this.initMobileMenu(),this.initSidebar(),this.initMobileSidebar(),this.initScrollTop(),this.initQuickView(),this.initCloudzoom(),this.initProductMoreview(),this.initAddToCart(),this.changeQuantity(),this.updateQuantity(),this.initModal(),this.initProductAddToCart(),this.initDropDownCart(),this.initDropdownSearch(),this.initToggleCollectionPanel(),this.initWishlist(),this.initProductWishlist(),this.initRemoveWishlist(),this.initInfiniteScrolling()}
1,sidebarMapTagEvents:function(){$('.sidebar-tag a:not(".clear"), .sidebar-tag label').click(function(e){var currentTags=[];if(Shopify.queryParams.constraint&&(currentTags=Shopify.queryParams.constraint.split("+")),!window.enable_sidebar_multiple_choice&&!$(this).prev().is(":checked")){var otherTag=$(this).parents(".sidebar-tag").find("input:checked");if(otherTag.length>0){var tagName=otherTag.val();if(tagName){var tagPos=currentTags.indexOf(tagName);tagPos>=0&¤tTags.splice(tagPos,1)}}}var tagName=$(this).prev().val();if(tagName){var tagPos=currentTags.indexOf(tagName);tagPos>=0?currentTags.splice(tagPos,1):currentTags.push(tagName)}currentTags.length?Shopify.queryParams.constraint=currentTags.join("+"):delete Shopify.queryParams.constraint,ella.sidebarAjaxClick(),e.preventDefault()})},sidebarMapCategories:function(){$(".sidebar-links a").click(function(e){$(this).hasClass("active")||(delete Shopify.queryParams.q,ella.sidebarAjaxClick($(this).attr("href")),$(".sidebar-links a.active").removeClass("active"),$(this).addClass("active")),e.preventDefault()})},sidebarMapView:function(){$(".view-mode > span").click(function(e){if(!$(this).hasClass("active")){var paging=$(".filter-show > button span").text();$(this).hasClass("list")?Shopify.queryParams.view="list"+paging:Shopify.queryParams.view=paging,ella.sidebarAjaxClick(),$(".view-mode span.active").removeClass("active"),$(this).addClass("active")}e.preventDefault()})},sidebarMapShow:function(){$(".filter-show a").click(function(e){if(!$(this).parent().hasClass("active")){var thisPaging=$(this).attr("href"),view=$(".view-mode a.active").attr("href");view=="list"?Shopify.queryParams.view="list"+thisPaging:Shopify.queryParams.view=thisPaging,ella.sidebarAjaxClick(),$(".filter-show > button span").text(thisPaging),$(".filter-show li.active").removeClass("active"),$(this).parent().addClass("active")}e.preventDefault()})},sidebarInitToggle:function(){$(".sidebar-tag").length>0&&$(".sidebar-tag .widget-title span").click(function(){var $title=$(this).parents(".widget-title");$title.hasClass("click")?$title.removeClass("click"):$title.addClass("click"),$(this).parents(".sidebar-tag").find(".widget-content").slideToggle()})},sidebarMapSorting:function(e){$(".filter-sortby li span").click(function(e2){if(!$(this).parent().hasClass("active")){Shopify.queryParams.sort_by=$(this).attr("data-href"),ella.sidebarAjaxClick();var sortbyText=$(this).text();$(".filter-sortby > button span").text(sortbyText),$(".filter-sortby li.active").removeClass("active"),$(this).parent().addClass("active")}e2.preventDefault()})},sidebarMapPaging:function(){$(".pagination-page a").click(function(e){var page=$(this).attr("href").match(/page=\d+/g);if(page&&(Shopify.queryParams.page=parseInt(page[0].match(/\d+/g)),Shopify.queryParams.page)){var newurl=ella.sidebarCreateUrl();ella.isSidebarAjaxClick=!0,History.pushState({param:Shopify.queryParams},newurl,newurl),ella.sidebarGetContent(newurl),$("body,html").animate({scrollTop:500},600)}e.preventDefault()})},sidebarMapClearAll:function(){$(".refined-widgets a.clear-all").click(function(e){delete Shopify.queryParams.constraint,delete Shopify.queryParams.q,ella.sidebarAjaxClick(),e.preventDefault()})},sidebarMapClear:function(){$(".sidebar-tag").each(function(){var sidebarTag=$(this);sidebarTag.find("input:checked").length>0&&sidebarTag.find(".clear").show().click(function(e){console.log("im clicked");var currentTags=[];Shopify.queryParams.constraint&&(currentTags=Shopify.queryParams.constraint.split("+")),sidebarTag.find("input:checked").each(function(){var selectedTag=$(this),tagName=selectedTag.val();if(tagName){var tagPos=currentTags.indexOf(tagName);tagPos>=0&¤tTags.splice(tagPos,1)}}),currentTags.length?Shopify.queryParams.constraint=currentTags.join("+"):delete Shopify.queryParams.constraint,ella.sidebarAjaxClick(),e.preventDefault()})})},sidebarMapEvents:function(){ella.sidebarMapTagEvents(),ella.sidebarMapCategories(),ella.sidebarMapView(),ella.sidebarMapShow(),ella.sidebarMapSorting()},reActivateSidebar:function(){$(".sidebar-custom .active, .sidebar-links .active").removeClass("active"),$(".sidebar-tag input:checked").attr("checked",!1);var cat=location.pathname.match(/\/collections\/(.*)(\?)?/);if(cat&&cat[1]&&$(".sidebar-links a[href='"+cat[0]+"']").addClass("active"),Shopify.queryParams.view){$(".view-mode .active").removeClass("active");var view=Shopify.queryParams.view;view.indexOf("list")>=0?($(".view-mode .list").addClass("active"),view=view.replace("list","")):$(".view-mode .grid").addClass("active"),$(".filter-show > button span").text(view),$(".filter-show li.active").removeClass("active"),$(".filter-show a[href='"+view+"']").parent().addClass("active")}ella.initSortby()},initSortby:function(){if(Shopify.queryParams.sort_by){var sortby=Shopify.queryParams.sort_by,sortbyText=$(".filter-sortby span[data-href='"+sortby+"']").text();$(".filter-sortby > button span").text(sortbyText),$(".filter-sortby li.active").removeClass("active"),$(".filter-sortby span[data-href='"+sortby+"']").parent().addClass("active")}},sidebarMapData:function(data){var currentList=$(".col-main .products-grid");currentList.length==0&&(currentList=$(".col-main .product-list"));var productList=$(data).find(".col-main .products-grid");productList.length==0&&(productList=$(data).find(".col-main .product-list")),productList.length>0&&productList.hasClass("products-grid")&&window.product_image_resize&&productList.find("img").fakecrop({fill:window.images_size.is_crop,widthSelector:".products-grid .grid-item .product-image",ratioWrapper:window.images_size}),currentList.replaceWith(productList),ella.checkNeedToConvertCurrency()&&Currency.convertAll(window.shop_currency,jQuery("#currencies").val(),".col-main span.money","money_format"),$(".padding").length>0?$(".padding").replaceWith($(data).find(".padding")):$(".block-row.col-main").append($(data).find(".padding"));var currentHeader=$(".page-header"),dataHeader=$(data).find(".page-header");if(currentHeader.find("h2").text()!=dataHeader.find("h2").text()){currentHeader.find("h2").replaceWith(dataHeader.find("h2"));var currentDes=$(".collection-des"),dataDes=$(data).find(".collection-des");currentDes.find(".rte").length?dataDes.find(".rte").length?currentDes.html(dataDes.find(".rte")):currentDes.find(".rte").hide():currentDes.html(dataDes.find(".rte"));var currentImg=$(".collection-img"),dataImg=$(data).find(".collection-img");
1currentImg.find("p").length?dataImg.find("p").length?currentImg.html(dataImg.find("p")):currentImg.find("p").hide():currentImg.html(dataImg.find("p"))}if($(".refined-widgets").replaceWith($(data).find(".refined-widgets")),$(".sidebar-block").replaceWith($(data).find(".sidebar-block")),$(".breadcrumb .bd-title").replaceWith($(data).find(".breadcrumb .bd-title")),ella.initColorSwatchGrid(),$(".spr-badge").length>0)return window.SPR.registerCallbacks(),window.SPR.initRatingHandler(),window.SPR.initDomEls(),window.SPR.loadProducts(),window.SPR.loadBadges()},sidebarCreateUrl:function(baseLink){var newQuery=$.param(Shopify.queryParams).replace(/%2B/g,"+");return baseLink?newQuery!=""?baseLink+"?"+newQuery:baseLink:location.pathname+"?"+newQuery},sidebarAjaxClick:function(baseLink){delete Shopify.queryParams.page;var newurl=ella.sidebarCreateUrl(baseLink);ella.isSidebarAjaxClick=!0,History.pushState({param:Shopify.queryParams},newurl,newurl),ella.sidebarGetContent(newurl)},sidebarGetContent:function(newurl){$.ajax({type:"get",url:newurl,beforeSend:function(){ella.showLoading()},success:function(data){ella.sidebarMapData(data),ella.sidebarMapPaging(),ella.translateBlock(".main-content"),ella.sidebarMapTagEvents(),ella.sidebarInitToggle(),ella.sidebarMapClear(),ella.sidebarMapClearAll(),ella.hideLoading(),ella.initQuickView(),ella.initAddToCart(),ella.initWishlist(),ella.initInfiniteScrolling()},error:function(xhr,text){ella.hideLoading(),$(".loading-modal").hide(),$(".ajax-error-message").text($.parseJSON(xhr.responseText).description),ella.showModal(".ajax-error-modal")}})},sidebarParams:function(){if(Shopify.queryParams={},location.search.length)for(var aKeyValue,i2=0,aCouples=location.search.substr(1).split("&");i2<aCouples.length;i2++)aKeyValue=aCouples[i2].split("="),aKeyValue.length>1&&(Shopify.queryParams[decodeURIComponent(aKeyValue[0])]=decodeURIComponent(aKeyValue[1]))},initMobileSidebar:function(){$("footer").append("<a class='option-sidebar left' id='displayTextLeft' href='javascript:void(0)' title='Show Sidebar'><span>Show Sidebar</span></a>"),$("#displayTextLeft").click(function(event){event.preventDefault(),$(".sidebar").is(":hidden")?($(".sidebar").fadeIn(800),$("body,html").animate({scrollTop:400},600),$("#displayTextLeft").toggleClass("hidden-arrow-left"),$("#displayTextLeft").attr("title","hide-sidebar"),$("#displayTextLeft").html("<span>Hide Sidebar</span>")):($(".sidebar").fadeOut(800),$("#displayTextLeft").removeClass("hidden-arrow-left"),$("#displayTextLeft").attr("title","show-sidebar"),$("#displayTextLeft").html("<span>Show Sidebar</span>"))})},initSidebar:function(){$(".collection-sidebar").length>0&&(ella.sidebarParams(),ella.initSortby(),ella.sidebarMapEvents(),ella.sidebarMapPaging(),ella.sidebarInitToggle(),ella.sidebarMapClear(),ella.sidebarMapClearAll())},initMobileMenu:function(){if($(".menu-block").is(":visible")){$(".gf-menu-device-container ul.gf-menu li.dropdown").each(function(){$(this).find("> p.toogleClick").length==0&&$(this).prepend('<p class="toogleClick">+</p>')}),$(".menu-block").children().hasClass("gf-menu-device-wrapper")==!1&&$(".menu-block").children().addClass("gf-menu-device-wrapper"),$(".gf-menu-device-container").find("ul.gf-menu").size()==0&&($(".gf-menu-device-container").append($(".nav-bar .container").html()),$(".gf-menu-device-container .site-nav").addClass("gf-menu"),$(".gf-menu-device-container .site-nav").removeClass("nav")),$("p.toogleClick").click(function(){$(this).hasClass("mobile-toggle-open")?($(this).next().next().hide(),$(this).removeClass("mobile-toggle-open")):($(this).next().next().show(),$(this).addClass("mobile-toggle-open"))});var w=window.innerWidth;w<767&&jQuery(".site-nav .dropdown .menu__moblie").bind("click",function(event){currentEl!=this&&($(this).next().show(),$(this).prev().addClass("mobile-toggle-open"),event.preventDefault(),currentEl=this)}),$("p.toogleClick").show(),$("div.gf-menu-toggle").hide(),$(".nav-bar .container").hide(),$("ul.gf-menu").hasClass("clicked")==!1&&($(".gf-menu").hide(),$(".gf-menu li.dropdown ul.site-nav-dropdown").hide()),$(".col-1 .inner ul.dropdown").parent().each(function(){$(this).find("> p.toogleClick").length==0&&$(this).prepend('<p class="toogleClick">+</p>')}),$(".cbp-spmenu span.icon-dropdown").remove(),$("ul.gf-menu li.dropdown").each(function(){$(this).find("> p.toogleClick").length==0&&$(this).prepend('<p class="toogleClick">+</p>')}),$("p.toogleClick").click(function(){$(this).hasClass("mobile-toggle-open")?($(this).next().next().hide(),$(this).removeClass("mobile-toggle-open")):($(this).next().next().show(),$(this).addClass("mobile-toggle-open"))})}else $(".nav-bar .container").show(),$(".gf-menu").hide(),$(".customer-area ul.customer-links").appendTo($(".header-panel-bottom")).after($(".top-header"));
1$(".menu-block").children().hasClass("gf-menu-device-wrapper")==!1&&$(".menu-block").children().addClass("resized")},initWishlist:function(){$(".grid-item button.wishlist").click(function(e){e.preventDefault();var form=$(this).parent(),item=form.parents(".grid-item");$.ajax({type:"POST",url:"/contact",data:form.serialize(),beforeSend:function(){ella.showLoading()},success:function(data){ella.hideLoading(),form.html('<a class="wishlist" href="/pages/wish-list" title="Go to wishlist"><span class="icon"></span><span>Go to wishlist</span></a>');var title=item.find(".product-title").html(),image=item.find("a > img").attr("src");$(".ajax-success-modal").find(".ajax-product-title").html(title),$(".ajax-success-modal").find(".ajax-product-image").attr("src",image),$(".ajax-success-modal").find(".btn-go-to-wishlist").show(),$(".ajax-success-modal").find(".btn-go-to-cart").hide(),ella.showModal(".ajax-success-modal")},error:function(xhr,text){ella.hideLoading(),$(".loading-modal").hide(),$(".ajax-error-message").text($.parseJSON(xhr.responseText).description),ella.showModal(".ajax-error-modal")}})})},initProductWishlist:function(){$(".product button.wishlist").click(function(e){e.preventDefault();var form=$(this).parent(),item=form.parents(".grid-item");$.ajax({type:"POST",url:"/contact",data:form.serialize(),beforeSend:function(){ella.showLoading()},success:function(data){ella.hideLoading(),form.html('<a class="wishlist" href="/pages/wish-list" title="Go to wishlist"><span class="icon"></span><span>Go to wishlist</span></a>');var title=$(".product-title h2").html(),image=$("#product-featured-image").attr("src");$(".ajax-success-modal").find(".ajax-product-title").html(title),$(".ajax-success-modal").find(".ajax-product-image").attr("src",image),$(".ajax-success-modal").find(".btn-go-to-wishlist").show(),$(".ajax-success-modal").find(".btn-go-to-cart").hide(),ella.showModal(".ajax-success-modal")},error:function(xhr,text){ella.hideLoading(),$(".loading-modal").hide(),$(".ajax-error-message").text($.parseJSON(xhr.responseText).description),ella.showModal(".ajax-error-modal")}})})},initRemoveWishlist:function(){$(".btn-remove-wishlist").click(function(e){var row=$(this).parents("tr"),tagID=row.find(".tag-id").val(),form=jQuery("#remove-wishlist-form");form.find("input[name='contact[tags]']").val("x"+tagID),$.ajax({type:"POST",url:"/contact",data:form.serialize(),beforeSend:function(){ella.showLoading()},success:function(data){ella.hideLoading(),row.fadeOut(1e3)},error:function(xhr,text){ella.hideLoading(),$(".loading-modal").hide(),$(".ajax-error-message").text($.parseJSON(xhr.responseText).description),ella.showModal(".ajax-error-modal")}})})},initColorSwatchGrid:function(){jQuery(".item-swatch li label").hover(function(){var newImage=jQuery(this).parent().find(".hidden a").attr("href");return jQuery(this).parents(".grid-item").find(".product-grid-image img").attr({src:newImage}),!1})},initResizeImage:function(){window.product_image_resize&&$(".products-grid .product-image img").fakecrop({fill:window.images_size.is_crop,widthSelector:".products-grid .grid-item .product-image",ratioWrapper:window.images_size})},initInfiniteScrolling:function(){$(".infinite-scrolling").length>0&&$(".infinite-scrolling a").click(function(e){e.preventDefault(),$(this).hasClass("disabled")||ella.doInfiniteScrolling()})},doInfiniteScrolling:function(){var currentList=$(".block-row .products-grid");if(currentList.length||(currentList=$(".block-row .product-list")),currentList){var showMoreButton=$(".infinite-scrolling a").first();$.ajax({type:"GET",url:showMoreButton.attr("href"),beforeSend:function(){ella.showLoading(),$(".loading-modal").show()},success:function(data){ella.hideLoading();var products=$(data).find(".block-row .products-grid");if(products.length||(products=$(data).find(".block-row .product-list")),products.length&&(products.hasClass("products-grid")&&window.product_image_resize&&products.children().find("img").fakecrop({fill:window.images_size.is_crop,widthSelector:".products-grid .grid-item .product-image",ratioWrapper:window.images_size}
1),currentList.append(products.children()),ella.translateBlock("."+currentList.attr("class")),ella.initQuickView(),ella.initAddToCart(),ella.initWishlist(),$(data).find(".infinite-scrolling").length>0?showMoreButton.attr("href",$(data).find(".infinite-scrolling a").attr("href")):(showMoreButton.hide(),showMoreButton.next().show()),window.show_multiple_currencies&&window.shop_currency!=jQuery("#currencies").val()&&Currency.convertAll(window.shop_currency,jQuery("#currencies").val(),"span.money","money_format"),ella.initColorSwatchGrid(),$(".spr-badge").length>0))return window.SPR.registerCallbacks(),window.SPR.initRatingHandler(),window.SPR.initDomEls(),window.SPR.loadProducts(),window.SPR.loadBadges()},error:function(xhr,text){ella.hideLoading(),$(".loading-modal").hide(),$(".ajax-error-message").text($.parseJSON(xhr.responseText).description),ella.showModal(".ajax-error-modal")},dataType:"html"})}},closeEmailModalWindow:function(){$("#email-modal").length>0&&$("#email-modal").is(":visible")&&$("#email-modal .modal-window").fadeOut(600,function(){$("#email-modal .modal-overlay").fadeOut(600,function(){$("#email-modal").hide(),$.cookie("emailSubcribeModal","closed",{expires:1,path:"/"})})})},showModal:function(selector){$(selector).fadeIn(500),ella.ellaTimeout=setTimeout(function(){$(selector).fadeOut(500)},5e3)},initToggleCollectionPanel:function(){$(".collection-sharing-btn").length>0&&$(".collection-sharing-btn").click(function(){$(".collection-sharing-panel").toggle(),$(".collection-sharing-panel").is(":visible")?($(".collection-sharing-btn").addClass("btn-hover"),$(".collection-filter-panel").hide(),$(".collection-filter-btn").removeClass("btn-hover")):$(".collection-sharing-btn").removeClass("btn-hover")}),$(".collection-filter-btn").length>0&&($(".collection-filter-btn").click(function(){$(".collection-filter-panel").toggle(),$(".collection-filter-panel").is(":visible")?($(".collection-filter-btn").addClass("btn-hover"),$(".collection-sharing-panel").hide(),$(".collection-sharing-btn").removeClass("btn-hover")):$(".collection-filter-btn").removeClass("btn-hover")}),$(".collection-filter-panel select").change(function(index){window.location=$(this).find("option:selected").val()}))},checkItemsInDropdownCart:function(){$("#dropdown-cart .mini-products-list").children().length>0?($("#dropdown-cart .no-items").hide(),$("#dropdown-cart .has-items").show()):($("#dropdown-cart .has-items").hide(),$("#dropdown-cart .no-items").show())},initModal:function(){$(".continue-shopping").click(function(){clearTimeout(ella.ellaTimeout),$(".ajax-success-modal").fadeOut(500)}),$(".close-modal, .overlay").click(function(){clearTimeout(ella.ellaTimeout),$(".ajax-success-modal").fadeOut(500)})},initDropDownCart:function(){window.dropdowncart_type=="click"?$("#cartToggle").click(function(){$("#dropdown-cart").is(":visible")?$("#dropdown-cart").slideUp("fast"):$("#dropdown-cart").slideDown("fast")}):"ontouchstart"in document?$("#cartToggle").click(function(){$("#dropdown-cart").is(":visible")?$("#dropdown-cart").slideUp("fast"):$("#dropdown-cart").slideDown("fast")}):($("#cartToggle").hover(function(){$("#dropdown-cart").is(":visible")||$("#dropdown-cart").slideDown("fast")}),$(".wrapper-top-cart").mouseleave(function(){$("#dropdown-cart").slideUp("fast")})),ella.checkItemsInDropdownCart(),$("#dropdown-cart .no-items a").click(function(){$("#dropdown-cart").slideUp("fast")}),$("#dropdown-cart .btn-remove").click(function(event){event.preventDefault();var productId=$(this).parents(".item").attr("id");productId=productId.match(/\d+/g),Shopify.removeItem(productId,function(cart){ella.doUpdateDropdownCart(cart)})})},closeDropdownCart:function(){$("#dropdown-cart").is(":visible")&&$("#dropdown-cart").slideUp("fast")},initDropdownSearch:function(){$(".nav-search .icon-search").click(function(){$(".header-bottom.on .search-bar").is(":visible")?$(".header-bottom.on .search-bar").slideUp("fast"):$(".header-bottom.on .search-bar").slideDown("fast")})},closeDropdownSearch:function(){$(".header-bottom.on .search-bar").is(":visible")&&$(".header-bottom.on .search-bar").slideUp("fast")},initProductMoreview:function(){$(".more-view-wrapper-owlslider").length>0?this.initOwlMoreview():$(".more-view-wrapper-jcarousel").length>0&&this.initJcarouselMoreview()},initOwlMoreview:function(){$(".more-view-wrapper-owlslider ul").owlCarousel({navigation:!0,items:5,itemsDesktop:[1199,5],itemsDesktopSmall:[979,5],itemsTablet:[768,5],itemsTabletSmall:[540,5],items
1Mobile:[360,5]}).css("visibility","visible")},initJcarouselMoreview:function(){$(".more-view-wrapper-jcarousel ul").jcarousel({vertical:!0}).css("visibility","visible"),$(".product-img-box").addClass("has-jcarousel"),$(".more-view-wrapper").css("visibility","visible")},initCloudzoom:function(){$("#product-featured-image").length>0&&($(".visible-phone").is(":visible")?($("#product-featured-image").elevateZoom({gallery:"more-view-carousel",cursor:"pointer",galleryActiveClass:"active",imageCrossfade:!1,scrollZoom:!1,onImageSwapComplete:function(){$(".zoomWrapper div").hide()},loadingIcon:window.loading_url}),$("#product-featured-image").bind("click",function(e){return!1})):($("#product-featured-image").elevateZoom({gallery:"more-view-carousel",cursor:"pointer",galleryActiveClass:"active",imageCrossfade:!0,scrollZoom:!0,onImageSwapComplete:function(){$(".zoomWrapper div").hide()},loadingIcon:window.loading_url}),$("#product-featured-image").bind("click",function(e){var ez=$("#product-featured-image").data("elevateZoom");return console.log(ez),$.fancybox(ez.getGalleryList()),!1})))},initScrollTop:function(){$("#back-top").click(function(){return $("body,html").animate({scrollTop:0},400),!1})},initProductAddToCart:function(){$("#product-add-to-cart").length>0&&$("#product-add-to-cart").click(function(event){if(event.preventDefault(),$(this).attr("disabled")!="disabled")if(!window.ajax_cart)$(this).closest("form").submit();else{var variant_id=$("#add-to-cart-form select[name=id]").val();variant_id||(variant_id=$("#add-to-cart-form input[name=id]").val());var quantity=$("#add-to-cart-form input[name=quantity]").val();quantity||(quantity=1);var title=$(".product-title h2").html(),image=$("#product-featured-image").attr("src"),dataSerial=$("#add-to-cart-form").serialize();ella.doAjaxAddToCart(variant_id,quantity,title,image,dataSerial)}return!1})},initAddToCart:function(){$(".add-to-cart-btn").length>0&&$(".add-to-cart-btn").click(function(event){if(event.preventDefault(),$(this).attr("disabled")!="disabled"){var productItem=$(this).parents(".product-item"),productId=$(productItem).attr("id");if(productId=productId.match(/\d+/g),!window.ajax_cart)$("#product-actions-"+productId).submit();else{var variant_id=$("#product-actions-"+productId+" select[name=id]").val();variant_id||(variant_id=$("#product-actions-"+productId+" input[name=id]").val());var quantity=$("#product-actions-"+productId+" input[name=quantity]").val();quantity||(quantity=1);var title=$(productItem).find(".product-title").html(),image=$(productItem).find(".product-grid-image img").attr("src"),dataSerial=$("#add-to-cart-form").serialize();ella.doAjaxAddToCart(variant_id,quantity,title,image,dataSerial)}}return!1})},showLoading:function(){$(".loading-modal").show()},hideLoading:function(){$(".loading-modal").hide()},changeQuantity:function(){var count=0;$("body,html").on("click",".item .button",function(i2){if(count=count+1,console.log(count),count%2!=0){var oldValue=$(this).closest(".item").find(".quantity").val(),newVal=1;jQuery(this).text()=="+"?newVal=parseInt(oldValue)+1:oldValue>1&&(newVal=parseInt(oldValue)-1),$(this).closest(".item").find(".quantity").val(newVal);var a=$(this).parents(".item").attr("id");a=a.match(/\d+/g);var quantity=$(this).closest(".item").find(".quantity").val();console.log(a+" a "+quantity),$.ajax({type:"post",url:"/cart/change.js",data:"quantity="+quantity+"&id="+a,dataType:"json",beforeSend:function(){ella.showLoading(),$("#dropdown-cart .loader-img").css("display","block")},success:function(i3){ella.hideLoading(),ella.updateDropdownCart(),console.log(i3),setTimeout(function(){$("#dropdown-cart .loader-img").css("display","none")},500)},error:function(i3){ella.hideLoading(),console.log(i3)}})}})},updateQuantity:function(){},doAjaxAddToCart:function(variant_id,quantity,title,image,dataSerial){$.ajax({type:"post",url:"/cart/add.js",data:"quantity="+quantity+"&id="+variant_id,dataType:"json",beforeSend:function(){ella.showLoading()},success:function(msg){ella.hideLoading(),$("#dropdown-cart").css("right","0px"),$("html,body").css("overflow","hidden"),$(".black-box").show(),ella.updateDropdownCart()},error:function(xhr,text){ella.hideLoading(),$(".ajax-error-message").text($.parseJSON(xhr.responseText).description),ella.showModal(".ajax-error-modal")}})},initQuickView:function(){$(".quickview-button a").click(function(){var product_handle=$(this).attr("id");return Shopify.getProduct(product_handle,function(product){var template=$("#quickview-template").html();$(".quick-view").html(template);var quickview=$(".quick-view");if(quickview.find(".product-title a").html(ella.translateText(product.title)),quickview.find(".product-title a").attr("href",product.url),quickview.find(".product-vendor span").length>0&&quickview.find(".product-vendor span").text(product.vendor),quickview.find(".product-type span").length>0&&quickview.find(".product-type span").text(product.type),quickview.find(".product-inventory span").length>0){var variant=product.variants[0],inventoryInfo=quickview.find(".product-inventory span");variant.available?variant.inventory_management!=null?inventoryInfo.text(window.inventory_text.in_stock):inventoryInfo.text(window.inventory_text.many_in_stock):inventoryInfo.text(window.inventory_text.out_of_stock)}if(product.description.indexOf("[countdown]")>0){var countdownTime=product.description.match(/\[countdown\](.*)\[\/countdown\]/);countdownTime&&countdownTime.length>0&&(quickview.find(".countdown").show(),quickview.find(".quickview-clock").countdown(countdownTime[1],function(event){$(this).html(event.strftime("%Dd %H:%M:%S"))}))}if(quickview.find(".product-description").length>0){var description=product.description.replace(/(<([^>]+)>)/ig,""),description=description.replace(/\[countdown\](.*)\[\/countdown\]/g,"");if(window.multi_lang&&description.indexOf("[lang2]")>0){var descList=description.split("[lang2]");jQuery.cookie("language")!=null?description=descList[translator.current_lang-1]:description=descList[0]}description=description.split(" ").splice(0,20).join(" ")+"...",quickview.find(".product-description").text(description)}else quickview.find(".product-description").remove();quickview.find(".price").html(Shopify.formatMoney(product.price,window.money_format)),quickview.find(".product-item").attr("id","product-"+product.id),quickview.find(".variants").attr("id","product-actions-"+product.id),quickview.find(".variants select").attr("id","product-select-"+product.id),product.compare_at_price>product.price?(quickview.find(".compare-price").html(Shopify.formatMoney(product.compare_at_price_max,window.money_format)).show(),quickview.find(".price").addClass("on-sale")):(quickview.find(".compare-price").html(""),quickview.find(".price").removeClass("on-sale")),product.available?(quickview.find(".total-price span").html(Shopify.formatMoney(product.price,window.money_format)),window.use_color_swatch?ella.createQuickViewVariantsSwatch(product,quickview):ella.createQuickViewVariants(product,quickview)):(quickview.find("select, input, .total-price, .dec, .inc, .variants label").remove(),quickview.find(".add-to-cart-btn").text(window.inventory_text.unavailable).addClass("disabled").attr("disabled","disabled")),quickview.find(".button").on("click",function(){var oldValue=quickview.find(".quantity").val(),newVal=1;$(this).text()=="+"?newVal=parseInt(oldValue)+1:oldValue>1&&(newVal=parseInt(oldValue)-1),quickview.find(".quantity").val(newVal),quickview.find(".total-price").length>0&&ella.updatePricingQuickview()}),window.show_multiple_currencies&&Currency.convertAll(window.shop_currency,jQuery("#currencies").val(),"span.money","money_format"),ella.loadQuickViewSlider(product,quickview),ella.initQuickviewAddToCart(),ella.translateBlock(".quick-view"),$(".quick-view").fadeIn(500),$(".quick-view .total-price").length>0&&$(".quick-view input[name=quantity]").on("change",ella.updatePricingQuickview)}),!1}),$(document).on("click",".quick-view .overlay, .close-window",function(){return ella.closeQuickViewPopup(),!1})},updatePricingQuickview:function(){var regex=/([0-9]+[.|,][0-9]+[.|,][0-9]+)/g,unitPriceTextMatch=$(".quick-view .price").text().match(regex);if(unitPriceTextMatch||(regex=/([0-9]+[.|,][0-9]+)/g,unitPriceTextMatch=$(".quick-view .price").text().match(regex)),unitPriceTextMatch){var unitPriceText=unitPriceTextMatch[0],unitPrice=unitPriceText.replace(/[.|,]/g,""),quantity=parseInt($(".quick-view input[name=quantity]").val()),totalPrice=unitPrice*quantity,totalPriceText=Shopify.formatMoney(totalPrice,window.money_format);regex=/([0-9]+[.|,][0-9]+[.|,][0-9]+)/g,totalPriceText.match(regex)||(regex=/([0-9]+[.|,][0-9]+)/g),totalPriceText=totalPriceText.match(regex)[0];var regInput=new RegExp(unitPriceText,"g"),totalPriceHtml=$(".quick-view .price").html().replace(regInput,totalPriceText);$(".quick-view .total-price span").html(totalPriceHtml)}},initQuickviewAddToCart:function(){$(".quick-view .add-to-cart-btn").length>0&&$(".quick-view .add-to-cart-btn").click(function(){var variant_id=$(".quick-view select[name=id]").val();variant_id||(variant_id=$(".quick-view input[name=id]").val());var quantity=$(".quick-view input[name=quantity]").val();quantity||(quantity=1);
1var title=$(".quick-view .product-title a").html(),image=$(".quick-view .quickview-featured-image img").attr("src");ella.doAjaxAddToCart(variant_id,quantity,title,image),ella.closeQuickViewPopup()})},updateDropdownCart:function(){Shopify.getCart(function(cart){ella.doUpdateDropdownCart(cart)})},doUpdateDropdownCart:function(cart){var template='<li class="item" id="cart-item-{ID}"><a href="{URL}" title="{TITLE}" class="product-image"><img src="{IMAGE}" alt="{TITLE}"></a><div class="product-details"><a href="javascript:void(0)" title="Remove This Item" class="btn-remove">X</a><p class="product-name"><a href="{URL}">{TITLE}</a></p><div class="option quantity-box text-center"><div class="dec button">-</div><input type="text" class="quantity" name="quantity" value="{QUANTITY}" readonly><div class="inc button">+</div></div><div class="cart-collateral"><span class="price">{PRICE}</span></div></div></li>';if($("#cartCount").text(cart.item_count),$("#dropdown-cart .summary .price").html(Shopify.formatMoney(cart.total_price,window.money_format)),$("#dropdown-cart .mini-products-list").html(""),cart.item_count>0){for(var i2=0;i2<cart.items.length;i2++){var item=template;item=item.replace(/\{ID\}/g,cart.items[i2].id),item=item.replace(/\{URL\}/g,cart.items[i2].url),item=item.replace(/\{TITLE\}/g,ella.translateText(cart.items[i2].title)),item=item.replace(/\{QUANTITY\}/g,cart.items[i2].quantity),item=item.replace(/\{IMAGE\}/g,Shopify.resizeImage(cart.items[i2].image,"small")),item=item.replace(/\{PRICE\}/g,Shopify.formatMoney(cart.items[i2].price,window.money_format)),$("#dropdown-cart .mini-products-list").append(item)}$("#dropdown-cart .btn-remove").click(function(event){event.preventDefault(),$("#dropdown-cart .loader-img").css("display","block");var productId=$(this).parents(".item").attr("id");productId=productId.match(/\d+/g),Shopify.removeItem(productId,function(cart2){ella.doUpdateDropdownCart(cart2),$("#dropdown-cart .loader-img").css("display","none")})}),ella.checkNeedToConvertCurrency()&&Currency.convertAll(window.shop_currency,jQuery("#currencies").val(),"#dropdown-cart span.money","money_format")}ella.checkItemsInDropdownCart()},checkNeedToConvertCurrency:function(){return window.show_multiple_currencies&&Currency.currentCurrency!=shopCurrency},loadQuickViewSlider:function(product,quickviewTemplate){var featuredImage=Shopify.resizeImage(product.featured_image,"grande");if(quickviewTemplate.find(".quickview-featured-image").append('<a href="'+product.url+'"><img src="'+featuredImage+'" title="'+product.title+'"/><div style="height: 100%; width: 100%; top:0; left:0 z-index: 2000; position: absolute; display: none; background: url('+window.loading_url+') 50% 50% no-repeat;"></div></a>'),product.images.length>1){var quickViewCarousel=quickviewTemplate.find(".more-view-wrapper ul"),count=0;for(i in product.images)if(count<product.images.length){var grande=Shopify.resizeImage(product.images[i],"grande"),compact=Shopify.resizeImage(product.images[i],"compact"),item='<li><a href="javascript:void(0)" data-image="'+grande+'"><img src="'+compact+'" /></a></li>';quickViewCarousel.append(item),count=count+1}quickViewCarousel.find("a").click(function(){var quickViewFeatureImage=quickviewTemplate.find(".quickview-featured-image img"),quickViewFeatureLoading=quickviewTemplate.find(".quickview-featured-image div");quickViewFeatureImage.attr("src")!=$(this).attr("data-image")&&(quickViewFeatureImage.attr("src",$(this).attr("data-image")),quickViewFeatureLoading.show(),quickViewFeatureImage.load(function(e){quickViewFeatureLoading.hide(),$(this).unbind("load"),quickViewFeatureLoading.hide()}))}),quickViewCarousel.hasClass("quickview-more-views-owlslider")?ella.initQuickViewCarousel(quickViewCarousel):ella.initQuickViewVerticalMoreview(quickViewCarousel)}else quickviewTemplate.find(".quickview-more-views").remove(),quickviewTemplate.find(".quickview-more-view-wrapper-jcarousel").remove()},initQuickViewCarousel:function(quickViewCarousel){quickViewCarousel&&quickViewCarousel.owlCarousel({navigation:!0,items:5,itemsDesktop:[1199,4],itemsDesktopSmall:[979,3],itemsTablet:[768,3],itemsTabletSmall:[540,3],itemsMobile:[360,3]}).css("visibility","visible")},initQuickViewVerticalMoreview:function(quickViewCarousel){quickViewCarousel&&(quickViewCarousel.jcarousel({vertical:!0}),$(".product-img-box").addClass("has-jcarousel"),$(".more-view-wrapper").css("visibility","visible"))},convertToSlug:function(text){return text.toLowerCase().replace(/[^a-z0-9 -]/g,"-").replace(/\s+/g,"-").replace(/-+/g,"-")},createQuickViewVariantsSwatch:function(product,quickviewTemplate){if(product.variants.length>1){for(var i2=0;i2<product.variants.length;i2++){var variant=product.variants[i2],option='<option value="'+variant.id+'">'+variant.title+"</option>";quickviewTemplate.find("form.variants > select").append(option)}
1new Shopify.OptionSelectors("product-select-"+product.id,{product:product,onVariantSelected:selectCallbackQuickview});for(var filePath=window.file_url.substring(0,window.file_url.lastIndexOf("?")),assetUrl=window.asset_url.substring(0,window.asset_url.lastIndexOf("?")),options="",i2=0;i2<product.options.length;i2++){options+='<div class="swatch clearfix" data-option-index="'+i2+'">',options+='<div class="header">'+product.options[i2].name+"</div>";var is_color=!1;/Color|Colour/i.test(product.options[i2].name)&&(is_color=!0);for(var optionValues=new Array,j=0;j<product.variants.length;j++){var variant=product.variants[j],value=variant.options[i2],valueHandle=this.convertToSlug(value),forText="swatch-"+i2+"-"+valueHandle;optionValues.indexOf(value)<0&&(options+='<div data-value="'+value+'" class="swatch-element '+(is_color?"color":"")+valueHandle+(variant.available?" available ":" soldout ")+'">',is_color&&(options+='<div class="tooltip">'+value+"</div>"),options+='<input id="'+forText+'" type="radio" name="option-'+i2+'" value="'+value+'" '+(j==0?" checked ":"")+(variant.available?"":" disabled")+" />",is_color?options+='<label for="'+forText+'" style="background-color: '+valueHandle+"; background-image: url("+filePath+valueHandle+'.png)"><img class="crossed-out" src="'+assetUrl+'soldout.png" /></label>':options+='<label for="'+forText+'">'+value+'<img class="crossed-out" src="'+assetUrl+'soldout.png" /></label>',options+="</div>",variant.available&&$('.quick-view .swatch[data-option-index="'+i2+'"] .'+valueHandle).removeClass("soldout").addClass("available").find(":radio").removeAttr("disabled"),optionValues.push(value))}options+="</div>"}quickviewTemplate.find("form.variants > select").after(options),quickviewTemplate.find(".swatch :radio").change(function(){var optionIndex=$(this).closest(".swatch").attr("data-option-index"),optionValue=$(this).val();$(this).closest("form").find(".single-option-selector").eq(optionIndex).val(optionValue).trigger("change")}),product.available&&(Shopify.optionsMap={},Shopify.linkOptionSelectors(product))}else{quickviewTemplate.find("form.variants > select").remove();var variant_field='<input type="hidden" name="id" value="'+product.variants[0].id+'">';quickviewTemplate.find("form.variants").append(variant_field)}},createQuickViewVariants:function(product,quickviewTemplate){if(product.variants.length>1){for(var i2=0;i2<product.variants.length;i2++){var variant=product.variants[i2],option='<option value="'+variant.id+'">'+variant.title+"</option>";quickviewTemplate.find("form.variants > select").append(option)}if(new Shopify.OptionSelectors("product-select-"+product.id,{product:product,onVariantSelected:selectCallbackQuickview}),product.options.length==1){$(".selector-wrapper:eq(0)").prepend("<label>"+product.options[0].name+"</label>");for(var text=product.variants,r=0;r<text.length;r++){var s=text[r];s.available||jQuery(".single-option-selector option").filter(function(){return jQuery(this).html()===s.title}).remove()}}$(".quick-view .single-option-selector").selectize(),$(".quick-view .selectize-input input").attr("disabled","disabled"),quickviewTemplate.find("form.variants .selector-wrapper label").each(function(i3,v){$(this).html(product.options[i3].name)})}else{quickviewTemplate.find("form.variants > select").remove();var variant_field='<input type="hidden" name="id" value="'+product.variants[0].id+'">';quickviewTemplate.find("form.variants").append(variant_field)}},closeQuickViewPopup:function(){$(".quick-view").fadeOut(500)},translateText:function(str){if(!window.multi_lang||str.indexOf("|")<0)return str;if(window.multi_lang){var textArr=str.split("|");return translator.isLang2()?textArr[1]:textArr[0]}},translateBlock:function(blockSelector){window.multi_lang&&translator.isLang2()&&translator.doTranslate(blockSelector)}}})(jQuery); 2//# sourceMappingURL=/cdn/shop/t/3/assets/ella.js.map?v=14982580511109538871563879997
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.