var Components;(function(n){var t=function(){function t(n){this.$element=n;this.initializePage();this.initializeHomePage()}return t.prototype.initializePage=function(){},t.prototype.initializeHomePage=function(){var t=new n.Pages.HomePage(this.$element)},t}(),i;n.PageInstance=t;i=function(){function n(){}return n.initialize=function(){if(this.current==null)try{this.current=new t($("html"))}catch(n){console.error(n)}else console.info("Page already initialized")},n}();n.Page=i})(Components||(Components={}));jQuery(document).ready(function(){Components.Page.initialize()}),function(n){var t;(function(n){var t=function(){function n(n){this.isInPageEditor=function(){try{return $("body").hasClass("in-page-editor")}catch(n){return!1}}();this.$element=n;this.$bannerSection=$("section#hp-banners");this.$productsSection=$("section#hp-products");this.initialize()}return n.prototype.initialize=function(){console.log("initializing homepage");this.initializeBanners();this.initializeFeaturedProducts()},n.prototype.initializeBanners=function(){var n,t,i;this.$bannerSection&&!this.isInPageEditor&&(n=this.getBanners(),t=$.parseHTML(this.buildSwiperHtml("hp-bnrswpr",n)),this.$bannerSection.append(t),i=new Swiper("#hp-bnrswpr",{slidesPerView:1.1}))},n.prototype.getBanners=function(){var n=[];return this.$element.find("a[class='bnr']").each(function(t,i){n.push(i.outerHTML)}),n},n.prototype.initializeFeaturedProducts=function(){var n,t,i;this.$productsSection&&!this.isInPageEditor&&(n=this.getFeaturedProducts(),t=$.parseHTML(this.buildSwiperHtml("hp-fpswpr",n)),this.$productsSection.append(t),i=new Swiper("#hp-fpswpr",{slidesPerView:1.4,spaceBetween:16}),$("#hp-products>.container .featured-product .fpt-usp").matchHeight({byRow:!0,property:"height",target:null,remove:!1}),$("#hp-products>.hp-fpswpr .featured-product .fpt-usp").matchHeight({byRow:!0,property:"height",target:null,remove:!1}))},n.prototype.getFeaturedProducts=function(){var n=[];return this.$element.find("div[class='featured-product']").each(function(t,i){n.push(i.outerHTML)}),n},n.prototype.buildSwiperHtml=function(n,t){var i='<div class="phone-only '+n+'">\n                            <div id="'+n+'" class="swiper-container">\n                                <div class="swiper-wrapper">';return t.forEach(function(n){i+='       <div class="swiper-slide">'+n+"<\/div>"}),i+='           <\/div>\n                                <div class="swiper-pagination"><\/div>\n                            <\/div>\n                        <\/div>'},n}();n.HomePage=t})(t=n.Pages||(n.Pages={}))}(Components||(Components={}))