Y||(Y={});Y.Template||(Y.Template={}); Y.Template.noYUI={init:function(){this.setIndexFullscreenGalleryHeights();this.scrollYPolyfill();this.vCenterTopSectionContent()},scrollYPolyfill:function(){window.scrollY||(window.scrollY=window.pageYOffset||document.documentElement.scrollTop,window.addEventListener("scroll",function(){window.scrollY=window.pageYOffset||document.documentElement.scrollTop}))},setIndexFullscreenGalleryHeights:function(){if(document.querySelectorAll&&!(-1=this.y?Y.one(this.el).addClass("show"):Y.one(this.el).removeClass("show")}}); Y.namespace("Template").CenterNav=Class.create({initialize:function(a){this.navItems=a.navItems;this.centerEl=a.centerEl;this.wrapper=a.wrapper;this.innerWrapper=a.innerWrapper;if(this.navItems)if(this.centerEl)if(this.wrapper){if(!this.innerWrapper)return console.error("centernav.js: You must specify an inner nav wrapper."),!1}else return console.error("centernav.js: You must specify an outer wrapper that contains the nav items and nav wrapper."),!1;else return console.error("centernav.js: You must specify an element to center around."), !1;else return console.error("centernav.js: You must specify the nav items selector."),!1;this.bindUI()},bindUI:function(){if(1this.navItemsRight.get("offsetWidth").reduce(this.sum,0)&&(this.navItemsSplitPoint-=1,this.navItemsLeft=Y.all(this.navItems).slice(0,this.navItemsSplitPoint), this.navItemsRight=Y.all(this.navItems).slice(this.navItemsSplitPoint)),this.calculateWidthDiff(),this.leftOfLogo=Y.all(this.navItems).item(this.navItemsSplitPoint-1),this.rightOfLogo=Y.all(this.navItems).item(this.navItemsSplitPoint),this.navItemsLeft.get("offsetWidth").reduce(this.sum,0)>this.navSpace-12||this.navItemsRight.get("offsetWidth").reduce(this.sum,0)>this.navSpace-12)this.destroy(),Y.one(this.innerWrapper).setStyles({marginLeft:0,marginTop:"10px",marginBottom:0});else{this.destroy(); Y.one(this.leftOfLogo).setStyle("marginRight",this.centerElWidth/2);Y.one(this.rightOfLogo).setStyle("marginLeft",this.centerElWidth/2);var a=parseInt(Y.one(this.innerWrapper).getComputedStyle("height"),10);Y.one(this.innerWrapper).setStyles({marginLeft:this.widthDiff,marginTop:Math.ceil(-1*(this.centerElHeight/2+a/2)),marginBottom:Math.ceil(this.centerElHeight/2+a/2-a)})}Y.one(this.innerWrapper).addClass("positioned")},destroy:function(){Y.all(this.navItems).removeAttribute("style")},getVariables:function(){this.wrapperWidth= Y.one(this.wrapper).get("offsetWidth")-2*parseInt(Y.Squarespace.Template.getTweakValue("headerPadding"),10);this.centerElWidth=Y.one(this.centerEl).get("offsetWidth")+2*this.CENTER_SPACING;this.centerElHeight=Y.one(this.centerEl).get("offsetHeight")},calculateWidthDiff:function(){this.widthDiff=this.navItemsRight.get("offsetWidth").reduce(this.sum,0)-this.navItemsLeft.get("offsetWidth").reduce(this.sum,0)},sum:function(a,b){if("number"==typeof a&&"number"==typeof b)return a+b;console.warn("centernav.js sum function: can't add non-numbers."); return!1}}); Y.namespace("Template").Gallery=Class.create({initialize:function(a){this.slides=a.slides;this.wrapper=a.wrapper;if(!this.slides)return console.error("index-gallery.js: You have to define the slides selector."),!1;if(!this.wrapper)return console.error("index-gallery.js: You have to define the wrapper selector."),!1;if(!Y.one(this.wrapper)||!Y.one(this.slides))return!1;this.getTweaks();this.bindUI();this.syncUI()},bindUI:function(){if("grid"==this.tweak.design)this.loadGridImages(),this.lightboxSet=[], Y.one(this.wrapper).all(this.slides).each(function(a){var b=a.one(".sqs-video-wrapper"),e=b?a.one(".sqs-video-wrapper"):a.one("img"),b=b?null:a.one(".slide-meta-content")&&a.one(".slide-meta-content").getHTML();this.lightboxSet.push({content:e,meta:b});a.on("click",function(b){b.halt();a.one(".clickthrough-link")?(b.stopPropagation(),window.location=a.one(".clickthrough-link").getAttribute("href")):(this.gallery&&this.gallery.destroy(),this.gallery=new Y.Squarespace.Lightbox2({controls:{previous:!0, next:!0},currentSetIndex:Y.one(this.wrapper).all(this.slides).indexOf(a),set:this.lightboxSet}),this.gallery.render())},this)},this);else{var a=!1;"auto"==this.tweak.aspect&&(a=!0);var b=!1;!0===this.tweak.autoplay&&(b=!0);"fullscreen"==this.tweak.aspect&&"slideshow"==this.tweak.design&&this.fullscreen();this.wrapper.generateID();this.nodeID="#"+this.wrapper.get("id");this.galleryManager=[];this.gallery=new Y.Squarespace.Gallery2({container:this.wrapper,design:"stacked",autoplay:b,designOptions:{autoHeight:a, clickBehavior:"auto",transition:this.tweak.transition},elements:{controls:this.nodeID+" ~ .circles",next:this.nodeID+" ~ .next-slide",previous:this.nodeID+" ~ .previous-slide"},historyHash:!1,keyboard:!1,lazyLoad:!0,loaderOptions:{mode:"fill"},loop:"true",refreshOnResize:!0,slides:this.slides});Y.one(this.wrapper).delegate("click",function(a){a.halt();a.currentTarget.ancestor(this.slides).toggleClass("hide-meta")},".hide-meta-toggle");this.galleryManager.push(this.gallery);this.keyboardControls()}}, syncUI:function(){Y.Template.helper.on("resizeend",function(){"grid"==this.tweak.design&&this.loadGridImages();"fullscreen"==this.tweak.aspect&&"slideshow"==this.tweak.design&&this.fullscreen()},this);Y.Global.on("tweak:reset",this.refresh,this);Y.Global.on("tweak:change",function(a){a=a.getName();("grid-aspect-ratio"==a||"slideshow-aspect-ratio"==a||"design"==a||"gallery-controls"==a||"slideshow-transition"==a||"slideshow-autoplay"==a)&&this.refresh();("grid-aspect-ratio"==a||"slideshow-aspect-ratio"== a||"design"==a||"grid-max-columns"==a)&&Y.one(window).simulate("resize")},this)},getTweaks:function(){this.tweak={aspect:this.getTweakValue("slideshow-aspect-ratio"),design:this.getTweakValue("design"),nav:this.getTweakValue("gallery-controls"),transition:this.getTweakValue("slideshow-transition"),autoplay:this.getTweakValue("slideshow-autoplay")}},getTweakValue:function(a){a=Y.Squarespace.Template.getTweakValue(a);Y.Lang.isString(a)&&(a=a.toLowerCase());"true"===a?a=!0:"false"===a&&(a=!1);return a}, keyboardControls:function(){Y.one(window).on("keyup",function(a){Y.all(this.wrapper).each(function(b,c){if(b.inViewportRegion()&&(37==a.keyCode||39==a.keyCode)){var d=1;37==a.keyCode&&(d=-1);this.galleryManager[c].set("currentIndex",this.galleryManager[c].get("currentIndex")+d)}},this)},this)},fullscreen:function(){this.mobileNavShowing="none"==Y.one("#header .mobile-nav-toggle-label").getComputedStyle("display")?!1:!0;Y.all(this.wrapper).each(function(a){this.mobileNavShowing?a.setStyle("height", Y.config.win.innerHeight):Y.one("#siteWrapper #content .index-section.gallery:first-child")&&Y.one("#showOnScrollWrapper #mainNavWrapper")?(a.setStyle("height",Y.config.win.innerHeight-Y.one("#showOnScrollWrapper #mainNavWrapper").get("clientHeight")),Y.one("#siteWrapper #content .index-section.gallery:first-child .gallery-wrapper").setStyle("height",Y.config.win.innerHeight)):Y.one("#showOnScrollWrapper #mainNavWrapper")?a.setStyle("height",Y.config.win.innerHeight-Y.one("#showOnScrollWrapper #mainNavWrapper").get("clientHeight")): a.setStyle("height",Y.config.win.innerHeight)},this)},loadGridImages:function(){Y.one(this.wrapper).all(this.slides).each(function(a){a.one(".sqs-video-wrapper")?a.one(".sqs-video-wrapper").plug(Y.Squarespace.VideoLoader,{mode:"fill"}):ImageLoader.load(a.one("img"),{load:!0,mode:"fill"})},this)},destroy:function(){Y.all(this.wrapper).each(function(a){a.detachAll();a.removeAttribute("style")},this);Y.all(this.slides).each(function(a){a.detachAll();a.removeAttribute("style")},this);this.gallery&&this.gallery.destroy()}, refresh:function(){this.destroy();this.getTweaks();this.bindUI()}}); Y.use("node",function(a){a.namespace("Template").Site=Singleton.create({ready:function(){this.regularHeaderForGridGallery();a.on("domready",function(){this.init()},this)},init:function(){this.cartState();this._touch=a.one(".touch-styles");a.one(".index-section .index-section-image")&&this.fadeInFirstIndexSectionImageOnLoad();this.transparentHeaderPadding();this.textShrink("#siteTitle a","#siteTitle");this.textShrink(".index-gallery .slide-meta-content .title",".index-gallery .slide-meta-content"); this.textShrink(".index-section-wrapper.has-main-image .sqs-block-content h1",".index-section-wrapper.has-main-image .sqs-block-content");this.textShrink(".banner-thumbnail-wrapper .desc-wrapper h1",".banner-thumbnail-wrapper .desc-wrapper");this.textShrink(".quote-block figure",".sqs-block.quote-block");this.textShrink(".page-description p",".page-description");this.getVariables();this.wrapper=a.Node.create('\x3cdiv class\x3d"show-on-scroll-wrapper" id\x3d"showOnScrollWrapper"\x3e\x3c/div\x3e'); this.injectScrollNavContent();this.syncUI();this.bindUI();this._touch||a.one(".always-use-overlay-nav")||768>=a.config.win.innerWidth?(a.Template.helper.radioCheckboxes("#mainNavigation"),a.Template.helper.radioCheckboxes("#mobileNavigation")):(a.Template.helper.folderRedirect("#headerNav .folder-toggle-label"),a.Template.helper.folderRedirect("#footer .folder-toggle-label"))},fadeInFirstIndexSectionImageOnLoad:function(){a.one(".index-section-image img").on("load",function(a){a.currentTarget.addClass("loaded")})}, mutationObserver:function(b,c,d){var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(e){var g=new e(d);g.observe(b,c);var f=a.later(15E3,this,function(){g.disconnect();f.cancel()})}else d(null,null)},bindUI:function(){this.mutationObserver(a.one("#siteWrapper").getDOMNode(),{childList:!0,subtree:!0},this.mutationCallback);a.one(window).on("resize",function(){this.getVariables();this.syncUI();a.Template.noYUI.vCenterTopSectionContent()},this);a.Squarespace.Singletons.ShoppingCart.on("change", a.Template.Site.cartState);this.disableScroll();a.Template.helper.on("resizeend",function(){a.all(".map-block[data-block-json]").each(function(b){a.Template.helper.centerMapPin(b.one(".page-map"),JSON.parse(b.getData("block-json")))})});a.one(".collection-type-index")&&(a.all(".index-gallery").each(function(b){new a.Template.Gallery({wrapper:b.one(".gallery-wrapper"),slides:".slide-wrapper"})}),a.one(".collection-type-index.homepage")&&new a.Template.RevealOnScroll({el:"#showOnScrollWrapper",offsetEl:".index-section-wrapper", behavior:"bottom"}));a.one(".index-section-image img")&&2<=a.all(".index-section-image img").length?this.lazyload?this.lazyload.refresh():this.lazyload=new a.Template.Lazyload({el:".index-section-image img",mobile:!1,loadEvent:"throttle"}):a.all(".index-section-image img").each(function(a){ImageLoader.load(a.removeAttribute("data-load"))});this.scrollNav();this.altSections(a.all(".index-section.no-main-image + .index-section.no-main-image"));a.Template.helper.scrollAnchors()},syncUI:function(){this.runCenterNav(); this.overlayNavPadding();this.folderEdgeDetection();a.Template.helper.on("resizeend",this.scrollNav,this);a.Template.helper.on("resizeend",this.injectScrollNavContent(),this);a.one(".collection-type-index.homepage")?(this.scrollNavHeight=a.one("#showOnScrollWrapper #mainNavWrapper")?a.one("#showOnScrollWrapper #mainNavWrapper").get("clientHeight"):0,a.all(this.navLinks).each(function(b){b.on("click",function(c){window.location.hash&&history.pushState("",document.title,window.location.pathname);c.halt(); c=b.getAttribute("href");var d;"/"===c.charAt(0)&&(c=c.substr(1));a.one(c)&&(d=this.mobileNav?a.one(c).getY()+1:a.one(c).getY()-this.scrollNavHeight+1,this.mobileNav?(a.one("#mobileNavToggle").set("checked",!1).simulate("change"),a.later(400,this,function(){a.Template.helper.smoothScrollTo(d)})):a.Template.helper.smoothScrollTo(d))},this)},this)):this.mobileNav&&a.all(this.navLinks).each(function(b){b.on("click",function(){a.one("#mobileNavToggle").set("checked",!1).simulate("change")},this)},this)}, mutationCallback:function(b){if(b)for(var c=0;c=a.config.win.innerWidth;this.navLinks=".nav-wrapper .index.home a";this.mobileNavShowing="none"==a.one("#header .mobile-nav-toggle-label").getComputedStyle("display")?!1:!0},scrollNav:function(){if(a.one(".collection-type-index.homepage")&&a.one("#header #mainNavWrapper")&&a.one(".index.home")){var b=a.all(".index-section:not(.gallery)"), c=this.mobileNavShowing?a.all("#mobileNavWrapper .index.home"):a.all("#showOnScrollWrapper #mainNavigation .index.home"),d=0,e=0,g=this.mobileNavShowing?0:a.one("#showOnScrollWrapper #mainNavWrapper").get("clientHeight")+1,f=a.throttle(a.bind(function(){b.each(function(b,c){c=c++;b.getY()=a.one("body").get("clientHeight")?(c.item(c.size()-1).addClass("active"),d=c.size()-1):c.item(d).addClass("active");d!=e&&(c.item(e).removeClass("active"), e=d)},this),200);a.one(window).on("scroll",f);a.Template.helper.on("scrollend",f)}},cartState:function(){var b=a.Squarespace.Singletons.ShoppingCart.get("totalQuantity"),c=a.one(".custom-cart");c&&(b&&0