"use strict";var BrowseScreen,body="body",site=".site",shade="rgba(0,0,0,0.05)",controller=new ScrollMagic.Controller;"theme"!=Config.install&&((BrowseScreen=Overlay.custom[1]).data=$(BrowseScreen.chapter.col).children(BrowseScreen.chunk).children().length);var PrintWidth=function(){var e=$(document)[0].documentElement.clientWidth,o=Site.desktop.width-e+"px",t=100/Site.desktop.width*e+"%";$(".width").html(o),gsap.set(Overlay.mobile.bar,{width:t})},CheckWidth=function(){Site.desktop.active?(gsap.set(Overlay.mobile.screen,{clearProps:"display"}),gsap.set(site,{display:Config.display})):(gsap.set(site,{clearProps:"display"}),gsap.set(Overlay.mobile.screen,{display:Config.display}),PrintWidth())};Config.respond||($(CheckWidth),$(window).resize(CheckWidth));var ActiveBook=function(){if(!$(body).hasClass("type-home")){var e=$(body)[0].classList,t=($(Site.topbar.lnk)[0].classList[2],"");$(e).each(function(e,o){o.startsWith("book-")&&(t=o.slice(5),gsap.set(Site.topbar.lnk+"."+t,{borderBottom:"3px solid"}))})}};$(function(){"theme"!=Config.install&&$(ActiveBook)});var ExpandBlock=function(e){var o=$(e.target),t=o.parent().siblings(Site.page.artwork).children(Site.code.wrap);"none"==t.css("display")?(gsap.set(t,{display:Config.display}),gsap.set(o,{text:"Hide"})):(gsap.set(t,{clearProps:"display"}),gsap.set(o,{text:"Show"}))};"docs"==Config.style&&$(Site.code.expand).click(function(e){ExpandBlock(e)});var ChangeScreen=function(e,o,t){"close"==t?(gsap.set(body,{clearProps:"overflow"}),gsap.set(".overlay."+Overlay.custom[e].name,{clearProps:"display"}),Overlay.custom[e].open=!1):(gsap.set(body,{overflow:"hidden"}),gsap.set(".overlay."+Overlay.custom[e].name,{display:Config.display}),Overlay.custom[e].open=!0)},BuildScreens=function(e,o){var t=".btn.nav.".concat(o.name),n=".exit.".concat(o.name);$(t).click(function(){ChangeScreen(e,o,"open")}),$(n).click(function(){ChangeScreen(e,o,"close")})},KeyUp=function(t){27==t.keyCode&&$(Overlay.custom).each(function(e,o){Overlay.custom[e].open&&ChangeScreen(e,o,"close")}),65==t.keyCode&&$(Overlay.custom).each(function(e,o){Overlay.custom[0].open||(ChangeScreen(0,o,"open"),console.log(t.keyCode))}),66==t.keyCode&&$(Overlay.custom).each(function(e,o){Overlay.custom[1].open||ChangeScreen(1,o,"open")}),83==t.keyCode&&$(Overlay.custom).each(function(e,o){Overlay.custom[2].open||ChangeScreen(2,o,"open")})};$(function(){$(Overlay.custom).each(function(e,o){BuildScreens(e,o)})}),$(document).keyup(function(e){Site.focus||KeyUp(e)});var ScrollerUpdate=function(){var e=$(Site.scroll.lnk);1'):e==$(Site.chapter.target).length-1?n+=''):n+='')}),n+="",$(site).append(n),ScrollerUpdate(),SmoothScroll()};$(function(){"theme"!=Config.install&&1<$(Site.chapter.target).length&&ScrollFunc()});var SetupHome=function(){$(body).hasClass("type-home")&&(gsap.timeline({repeat:-1,yoyo:!0,defaults:{ease:"sine.inOut"}}).fromTo(".area.book",{y:-5},{duration:1,y:5}),$(".wrap.home").slick(Config.slick),$(".wrap.book").hover(function(){gsap.to(this,{duration:.1,y:-20})},function(){gsap.to(this,{duration:.1,y:0})}))};"library"==Config.install&&$(SetupHome);var isLibraryHome="library"==Config.install&&$(body).hasClass("type-home"),SiteFunc=function(){Config.respond?isLibraryHome?gsap.set(site,{display:"block"}):gsap.set(site,{display:Config.display}):Site.mobile.active||(isLibraryHome?gsap.set(site,{display:"block"}):gsap.set(site,{display:Config.display})),setTimeout(function(){gsap.set(Overlay.load.screen,{clearProps:"display"}),SiteTl.pause()},1e3)};$(SiteFunc),$(window).resize(SiteFunc);var SmoothScroll=function(){$('a[href*="#"]').not('[href="#"]').not('[href="#0"]').click(function(e){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var o=$(this.hash);(o=o.length?o:$("[name="+this.hash.slice(1)+"]")).length&&(e.preventDefault(),$("html, body").animate({scrollTop:o.offset().top},500,function(){var e=$(o);if(e.focus(),e.is(":focus"))return!1;e.attr("tabindex","-1"),e.focus()}))}})};$(SmoothScroll);var SplitCode=function(){$(Site.code.page).each(function(e,o){$(Site.code.scss,this);var t=$(Site.code.html,this),n=t.html();t.text(n)})};"docs"==Config.style&&$(SplitCode);var StartBrowse=function(){var e=$(".block.browse-lnk",BrowseScreen.book.col)[0],o=$(".block.browse-chunk",BrowseScreen.chapter.col)[0],t=$(".block.browse-chunk",BrowseScreen.page.col)[0],n=$(t)[0].children[0],r=$(e)[0].children[0],a=$(o)[0].children[0].children[0],c=$(n)[0].children[0].children[0];gsap.timeline().set(BrowseScreen.chunk,{display:"none"}).set([o,t,n],{display:"block"}).set([r,a,c],{backgroundColor:shade})},HoverBook=function(e){var o=$(e.target)[0].classList[2].slice(5),t=$(BrowseScreen.chunk+"."+o,BrowseScreen.chapter.col),n=$(BrowseScreen.chunk+"."+o,BrowseScreen.page.col),r=$(n)[0].children[0],a=$(t)[0].children[0].children[0],c=$(r)[0].children[0].children[0];gsap.timeline().set(BrowseScreen.chunk,{display:"none"}).set([t,n,r],{display:"block"}).set([BrowseScreen.book.lnk,BrowseScreen.chapter.lnk,BrowseScreen.page.lnk],{clearProps:"backgroundColor"}).set([$(e.target),a,c],{backgroundColor:shade})},HoverChap=function(e){var o=$(e.target)[0].classList[2].slice(5),t=$(e.target)[0].classList[3].slice(8),n=$(BrowseScreen.chunk+"."+o,BrowseScreen.chapter.col),r=$(BrowseScreen.chunk+"."+o,BrowseScreen.page.col),a=$(BrowseScreen.chunk+"."+t,r),c=$(a)[0].children[0].children[0];gsap.timeline().set(BrowseScreen.chunk,{display:"none"}).set([n,r,a],{display:"block"}).set([BrowseScreen.chapter.lnk,BrowseScreen.page.lnk],{clearProps:"backgroundColor"}).set([$(e.target),c],{backgroundColor:shade})},HoverPage=function(e){gsap.timeline().set(BrowseScreen.page.lnk,{clearProps:"backgroundColor"}).set($(e.target),{backgroundColor:shade})};"theme"!=Config.install&&$(function(){$(body).hasClass("type-home")||0